This commit is contained in:
2025-07-30 15:00:20 +02:00
parent 9fd551e0f7
commit 66757c52d7
85 changed files with 117 additions and 499 deletions

View File

@@ -5,9 +5,9 @@ import freeflowuniverse.herolib.biz.bizmodel
bizmodel_name := 'test'
export_path := '${os.home_dir}/Downloads/bizmodel'
playbook_path := os.dir(@FILE) + '/exampledata'
plbook_path := os.dir(@FILE) + '/exampledata'
mut model := bizmodel.generate(bizmodel_name, playbook_path)!
mut model := bizmodel.generate(bizmodel_name, plbook_path)!
// Export to CSV
model.export_csv(

View File

@@ -11,16 +11,8 @@ const action_priorities = {
3: ['sheet_wiki', 'graph_bar_row', 'graph_pie_row', 'graph_line_row', 'row_overview']
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string
heroscript_path string
plbook ?PlayBook
reset bool
}
pub fn play(args PlayArgs) ! PlayBook {
pub fn play(mut plbook PlayBook) ! {
mut plbook := args.plbook or {
playbook.new(text: args.heroscript, path: args.heroscript_path)!
}
@@ -31,16 +23,15 @@ pub fn play(args PlayArgs) ! PlayBook {
return a.params.get('bizname') or { 'default' }
})
// play actions for each biz in playbook
// play actions for each biz in plbook
for biz, actions in actions_by_biz {
mut model := getset(biz)!
model.play(mut plbook)!
}
return plbook
}
pub fn (mut m BizModel) play(mut plbook PlayBook) !PlayBook {
pub fn (mut m BizModel) play(mut plbook PlayBook) ! {
mut actions := plbook.actions_find(actor: 'bizmodel')!
for action in actions.filter(it.name in action_priorities[0]) {
@@ -68,5 +59,4 @@ pub fn (mut m BizModel) play(mut plbook PlayBook) !PlayBook {
m.act(*action)!
}
return plbook
}

View File

@@ -71,21 +71,8 @@ fn set(o IPApi) ! {
ipapi_default = o.name
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(args_ PlayArgs) ! {
mut args := args_
if args.heroscript == '' {
args.heroscript = heroscript_default()!
}
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
pub fn play(mut plbook PlayBook) ! {
mut install_actions := plbook.find(filter: 'ipapi.configure')!
if install_actions.len > 0 {

View File

@@ -76,18 +76,8 @@ fn set_in_mem(o Jina) ! {
jina_default = o.name
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(args_ PlayArgs) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
pub fn play(mut plbook PlayBook) ! {
mut install_actions := plbook.find(filter: 'jina.configure')!
if install_actions.len > 0 {

View File

@@ -74,21 +74,9 @@ fn set(o MailClient) ! {
mailclient_default = o.name
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(args_ PlayArgs) ! {
mut args := args_
if args.heroscript == '' {
args.heroscript = heroscript_default()!
}
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
pub fn play(mut plbook PlayBook) ! {
mut install_actions := plbook.find(filter: 'mailclient.configure')!
if install_actions.len > 0 {

View File

@@ -77,21 +77,8 @@ pub fn save(o MeilisearchClient) ! {
context.hero_config_set('meilisearch', model.name, heroscript)!
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(args_ PlayArgs) ! {
mut model := args_
if model.heroscript == '' {
model.heroscript = heroscript_default()!
}
mut plbook := model.plbook or { playbook.new(text: model.heroscript)! }
pub fn play(mut plbook PlayBook) ! {
mut configure_actions := plbook.find(filter: 'meilisearch.configure')!
if configure_actions.len > 0 {

View File

@@ -75,18 +75,8 @@ fn set_in_mem(o Mycelium) ! {
mycelium_default = o.name
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(args_ PlayArgs) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
pub fn play(mut plbook PlayBook) ! {
mut install_actions := plbook.find(filter: 'mycelium.configure')!
if install_actions.len > 0 {

View File

@@ -78,18 +78,8 @@ fn set_in_mem(o MyceliumRPC) ! {
mycelium_rpc_default = o.name
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(args_ PlayArgs) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
pub fn play(mut plbook PlayBook) ! {
mut install_actions := plbook.find(filter: 'mycelium_rpc.configure')!
if install_actions.len > 0 {

View File

@@ -78,19 +78,8 @@ fn set_in_mem(o OpenAI) ! {
openai_default = o.name
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(args_ PlayArgs) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
pub fn play(mut plbook PlayBook) ! {
mut install_actions := plbook.find(filter: 'openai.configure')!
if install_actions.len > 0 {
for install_action in install_actions {

View File

@@ -78,21 +78,8 @@ pub fn save(o PostgresClient) ! {
context.hero_config_set('postgresql_client', o.name, heroscript)!
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(args_ PlayArgs) ! {
mut model := args_
if model.heroscript == '' {
model.heroscript = heroscript_default()!
}
mut plbook := model.plbook or { playbook.new(text: model.heroscript)! }
pub fn play(mut plbook PlayBook) ! {
mut configure_actions := plbook.find(filter: 'postgresql_client.configure')!
if configure_actions.len > 0 {

View File

@@ -76,18 +76,7 @@ fn set_in_mem(o QDrantClient) ! {
qdrant_default = o.name
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(args_ PlayArgs) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
pub fn play(mut plbook PlayBook) ! {
mut install_actions := plbook.find(filter: 'qdrant.configure')!
if install_actions.len > 0 {

View File

@@ -67,28 +67,8 @@ fn set(o RCloneClient) ! {
rclone_global['default'] = &o2
}
@[params]
pub struct PlayArgs {
pub mut:
name string = 'default'
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
start bool
stop bool
restart bool
delete bool
configure bool // make sure there is at least one installed
}
pub fn play(args_ PlayArgs) ! {
mut args := args_
if args.heroscript == '' {
args.heroscript = heroscript_default()!
}
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
pub fn play(mut plbook PlayBook) ! {
mut install_actions := plbook.find(filter: 'rclone.configure')!
if install_actions.len > 0 {

View File

@@ -71,21 +71,8 @@ fn set(o RunPod) ! {
runpod_default = o.name
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(args_ PlayArgs) ! {
mut args := args_
if args.heroscript == '' {
args.heroscript = heroscript_default()!
}
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
pub fn play(mut plbook PlayBook) ! {
mut install_actions := plbook.find(filter: 'runpod.configure')!
if install_actions.len > 0 {

View File

@@ -42,7 +42,7 @@ fn (mut p Personalizations) set_subject(s string) {
p.subject = s
}
// add_headers adds a playbook of key/value pairs to specify handling instructions for your email.
// add_headers adds a plbook of key/value pairs to specify handling instructions for your email.
// if some of the new headers already existed, their values are overwritten.
fn (mut p Personalizations) add_headers(new_headers map[string]string) {
p.headers or {
@@ -55,7 +55,7 @@ fn (mut p Personalizations) add_headers(new_headers map[string]string) {
}
}
// add_substitution adds a playbook of key/value pairs to allow you to insert data without using Dynamic Transactional Templates.
// add_substitution adds a plbook of key/value pairs to allow you to insert data without using Dynamic Transactional Templates.
// if some of the keys already existed, their values are overwritten.
fn (mut p Personalizations) add_substitution(new_subs map[string]string) {
p.substitutions or {
@@ -68,7 +68,7 @@ fn (mut p Personalizations) add_substitution(new_subs map[string]string) {
}
}
// add_dynamic_template_data adds a playbook of key/value pairs to dynamic template data.
// add_dynamic_template_data adds a plbook of key/value pairs to dynamic template data.
// Dynamic template data is available using Handlebars syntax in Dynamic Transactional Templates.
// if some of the keys already existed, their values are overwritten.
fn (mut p Personalizations) add_dynamic_template_data(new_dynamic_template_data map[string]string) {
@@ -82,7 +82,7 @@ fn (mut p Personalizations) add_dynamic_template_data(new_dynamic_template_data
}
}
// add_custom_args adds a playbook of key/value pairs to custom_args.
// add_custom_args adds a plbook of key/value pairs to custom_args.
// custom args are values that are specific to this personalization that will be carried along with the email and its activity data.
// if some of the keys already existed, their values are overwritten.
fn (mut p Personalizations) add_custom_args(new_custom_args map[string]string) {

View File

@@ -71,21 +71,8 @@ fn set(o VastAI) ! {
vastai_default = o.name
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(args_ PlayArgs) ! {
mut args := args_
if args.heroscript == '' {
args.heroscript = heroscript_default()!
}
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
pub fn play(mut plbook PlayBook) ! {
mut install_actions := plbook.find(filter: 'vastai.configure')!
if install_actions.len > 0 {

View File

@@ -71,21 +71,8 @@ fn set(o WireGuard) ! {
wireguard_default = o.name
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(args_ PlayArgs) ! {
mut args := args_
if args.heroscript == '' {
args.heroscript = heroscript_default()!
}
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
pub fn play(mut plbook PlayBook) ! {
mut install_actions := plbook.find(filter: 'wireguard.configure')!
if install_actions.len > 0 {

View File

@@ -78,19 +78,8 @@ fn set_in_mem(o ZinitRPC) ! {
zinit_rpc_default = o.name
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(args_ PlayArgs) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
pub fn play(mut plbook PlayBook) ! {
mut install_actions := plbook.find(filter: 'zinit_rpc.configure')!
if install_actions.len > 0 {
for install_action in install_actions {

View File

@@ -94,26 +94,9 @@ pub fn save(o ${model.classname})! {
context.hero_config_set("${model.name}",o.name,heroscript)!
}
^^[params]
pub struct PlayArgs {
pub mut:
heroscript string //if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(args_ PlayArgs) ! {
pub fn play(mut plbook PlayBook) ! {
mut model:=args_
@if model.hasconfig
if model.heroscript == "" {
model.heroscript = heroscript_default()!
}
@end
mut plbook := model.plbook or {
playbook.new(text: model.heroscript)!
}
@if model.hasconfig
mut configure_actions := plbook.find(filter: '${model.name}.configure')!

View File

@@ -93,24 +93,9 @@ pub fn get(args_ ArgsGet) !&${args.classname} {
}
@end
^^[params]
pub struct PlayArgs {
pub mut:
heroscript string //if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(args_ PlayArgs) ! {
pub fn play(mut plbook PlayBook) ! {
mut args:=args_
@if args.hasconfig
@end
mut plbook := args.plbook or {
playbook.new(text: args.heroscript)!
}
@if args.hasconfig
mut install_actions := plbook.find(filter: '${args.name}.configure')!

View File

@@ -94,23 +94,9 @@ pub fn save(o ${model.classname})! {
context.hero_config_set("${model.name}",o.name,heroscript)!
}
^^[params]
pub struct PlayArgs {
pub mut:
heroscript string //if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(args_ PlayArgs) ! {
pub fn play(mut plbook PlayBook) ! {
mut model:=args_
@if model.hasconfig
if model.heroscript == "" {
model.heroscript = heroscript_default()!
}
@end
mut plbook := model.plbook or {
playbook.new(text: model.heroscript)!
}

View File

@@ -84,7 +84,7 @@ fn cmd_mdbook_execute(cmd Command) ! {
mut url := cmd.flags.get_string('url') or { '' }
mut path := cmd.flags.get_string('path') or { '' }
if path.len > 0 || url.len > 0 {
// execute the attached playbook
// execute the attached plbook
mut plbook, _ := plbook_run(cmd)!
// get name from the book.generate action
if name == '' {

View File

@@ -141,19 +141,19 @@ pub fn plbook_code_get(cmd Command) !string {
return path
}
// same as session_run_get but will also run the playbook
// same as session_run_get but will also run the plbook
pub fn plbook_run(cmd Command) !(&playbook.PlayBook, string) {
path := plbook_code_get(cmd)!
if path.len == 0 {
return error(cmd.help_message())
}
// add all actions inside to the playbook
// add all actions inside to the plbook
mut plbook := playbook.new(path: path)!
dagu := cmd.flags.get_bool('dagu') or { false }
playcmds.run(mut playbook)!
playcmds.run(mut plbook)!
// TODO: below gives Segmentation fault (core dumped)
// console.print_stdout(plbook.str())

View File

@@ -16,7 +16,7 @@ pub mut:
// session ?&base.Session
}
// get a new playbook, can scan a directory or just add text
// get a new plbook, can scan a directory or just add text
// ```
// path string
// text string
@@ -26,7 +26,7 @@ pub mut:
// git_reset bool
// session &base.Session
// ```
pub fn new(args_ PlayBookNewArgs) !PlayBook {
pub fn new(args_ PlayBookNewArgs) ! {
mut args := args_
mut c := base.context() or { return error('failed to get context: ${err}') }

View File

@@ -189,7 +189,7 @@ pub fn (plbook PlayBook) hashkey() string {
return bs.hex()
}
// check if playbook is empty,if not will give error, means there are actions left to be exected
// check if plbook is empty,if not will give error, means there are actions left to be exected
pub fn (mut plbook PlayBook) empty_check() ! {
mut actions := []&Action{}
for a in plbook.actions {

View File

@@ -14,16 +14,24 @@ import freeflowuniverse.herolib.biz.bizmodel
// import freeflowuniverse.herolib.virt.hetzner
// import freeflowuniverse.herolib.clients.b2
@[params]
pub struct PlayArgs {
pub mut:
heroscript string
heroscript_path string
plbook ?playbook.PlayBook
reset bool
}
pub fn run(args_ PlayArgs) !PlayBook {
pub fn run(args_ PlayArgs) ! {
mut args := args_
mut plbook := args.plbook or {
playbook.new(text: args.heroscript, path: args.heroscript_path)!
}
play_core(mut playbook)!
play_git(mut playbook)!
play_core(mut plbook)!
play_git(mut plbook)!
// play_ssh(mut plbook)!
// play_publisher(mut plbook)!
@@ -36,8 +44,8 @@ pub fn run(args_ PlayArgs) !PlayBook {
// plbook = farmingsimulator.play(mut plbook)!
// plbook = gridsimulator.play(mut plbook)!
plbook = bizmodel.play(mut playbook)!
plbook = doctree.play(mut playbook)!
plbook = bizmodel.play(mut plbook)!
plbook = doctree.play(mut plbook)!
// slides.play(mut plbook)!
// base_install(play(mut plbook)!
@@ -46,5 +54,5 @@ pub fn run(args_ PlayArgs) !PlayBook {
// plbook.empty_check()!
return plbook
}

View File

@@ -11,12 +11,7 @@ import freeflowuniverse.herolib.ui.console
// interactive:true
fn play_core(args_ PlayArgs) !PlayBook {
mut args := args_
mut plbook := args.plbook or {
playbook.new(text: args.heroscript, path: args.heroscript_path)!
}
fn play_core(mut plbook PlayBook) ! {
// for mut action in plbook.find(filter: 'context.configure')! {
// mut p := action.params
@@ -34,7 +29,6 @@ fn play_core(args_ PlayArgs) !PlayBook {
// action.done = true
// }
for action_ in plbook.find(filter: 'play.*')! {
if action_.name == 'include' {
console.print_debug('play run:${action_}')
@@ -82,9 +76,9 @@ fn play_core(args_ PlayArgs) !PlayBook {
}
// CHANGE {...} args in playbook
// CHANGE {...} args in plbook
println('playbook:${plbook}')
println('plbook:${plbook}')
mut context := base.context()!
mut session := context.session_latest()!
@@ -128,5 +122,4 @@ fn play_core(args_ PlayArgs) !PlayBook {
// action.done = true
// }
return plbook
}

View File

@@ -6,11 +6,7 @@ import freeflowuniverse.herolib.core.playbook { PlayBook }
// import freeflowuniverse.herolib.ui.console
import freeflowuniverse.herolib.web.docusaurus
fn play(args_ PlayArgs) !PlayBook {
mut args := args_
mut plbook := args.plbook or {
playbook.new(text: args.heroscript, path: args.heroscript_path)!
}
fn play(mut plbook PlayBook) ! {
mut ds := docusaurus.new()!
@@ -43,6 +39,6 @@ fn play(args_ PlayArgs) !PlayBook {
}
return plbook
}

View File

@@ -4,7 +4,7 @@ import freeflowuniverse.herolib.develop.gittools
import freeflowuniverse.herolib.core.playbook {PlayBook}
import freeflowuniverse.herolib.ui.console
fn play_git(args_ PlayArgs) !PlayBook {
fn play_git(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or {
playbook.new(text: args.heroscript, path: args.heroscript_path)!
@@ -155,5 +155,5 @@ fn play_git(args_ PlayArgs) !PlayBook {
gs.load(true)! // Force reload
}
return plbook
}

View File

@@ -4,12 +4,7 @@ import freeflowuniverse.herolib.develop.luadns
import freeflowuniverse.herolib.core.playbook {PlayBook}
// import os
fn play_luadns(args_ PlayArgs) !PlayBook {
mut args := args_
mut plbook := args.plbook or {
playbook.new(text: args.heroscript, path: args.heroscript_path)!
}
fn play_luadns(mut plbook PlayBook) ! {
// Variables below are not used, commenting them out
// mut buildroot := '${os.home_dir()}/hero/var/mdbuild'
@@ -40,5 +35,5 @@ fn play_luadns(args_ PlayArgs) !PlayBook {
action.done = true
}
return plbook
}

View File

@@ -3,11 +3,7 @@ module playcmds
import freeflowuniverse.herolib.osal.sshagent
import freeflowuniverse.herolib.core.playbook {PlayBook}
fn play_ssh(args_ PlayArgs) !PlayBook {
mut args := args_
mut plbook := args.plbook or {
playbook.new(text: args.heroscript, path: args.heroscript_path)!
}
fn play_ssh(mut plbook PlayBook) ! {
mut agent := sshagent.new()!
for mut action in plbook.find(filter: 'sshagent.*')! {
@@ -24,5 +20,5 @@ fn play_ssh(args_ PlayArgs) !PlayBook {
}
action.done = true
}
return plbook
}

View File

@@ -1,11 +0,0 @@
module playcmds
import freeflowuniverse.herolib.core.playbook
@[params]
pub struct PlayArgs {
pub mut:
heroscript string
heroscript_path string
plbook ?playbook.PlayBook
reset bool
}

View File

@@ -27,7 +27,7 @@ The Core module provides fundamental system-level functionality for the Hero fra
- **httpconnection**: HTTP client functionality
- **logger**: Logging infrastructure
- **pathlib**: Path manipulation and handling
- **playbook**: Execution playbooks
- **playbook**: Execution plbooks
- **redisclient**: Redis database client
- **rootpath**: Root path management
- **smartid**: Identifier management

View File

@@ -3,20 +3,8 @@ module doctree
import freeflowuniverse.herolib.core.playbook { PlayBook }
// import freeflowuniverse.herolib.ui.console
@[params]
pub struct PlayArgs {
pub mut:
heroscript string
heroscript_path string
plbook ?PlayBook
reset bool
}
pub fn play(args_ PlayArgs) !PlayBook {
mut args := args_
mut plbook := args.plbook or {
playbook.new(text: args.heroscript, path: args.heroscript_path)!
}
pub fn play(mut plbook PlayBook) ! {
mut doctrees := map[string]&Tree{}

View File

@@ -13,7 +13,7 @@ pub mut:
name string
}
// adds all action elements to a playbook, calls playmacros.play on the playbook,
// adds all action elements to a playbook, calls playmacros.play on the plbook,
// which processes the macros, then reprocesses every page with the actions' new content
pub fn (mut tree Tree) process_actions_and_macros() ! {
console.print_green('Processing actions and macros')

View File

@@ -73,8 +73,8 @@ pub fn action_job_from_json(data string) !ActionJob {
return json.decode(ActionJob, data)
}
// to_playbook converts the job's heroscript to a PlayBook object
pub fn (job ActionJob) to_playbook() !&playbook.PlayBook {
// to_plbook converts the job's heroscript to a PlayBook object
pub fn (job ActionJob) to_plbook() !&playbook.PlayBook {
if job.heroscript.trim_space() == '' {
return error('No heroscript content in job')
}

View File

@@ -87,7 +87,7 @@ pub mut:
reset bool
}
pub fn play(args_ PlayArgs) ! {
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }

View File

@@ -79,18 +79,8 @@ fn set_in_mem(o MeilisearchInstaller) ! {
meilisearch_installer_default = o.name
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(args_ PlayArgs) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
pub fn play(mut plbook PlayBook) ! {
mut install_actions := plbook.find(filter: 'meilisearch_installer.configure')!
if install_actions.len > 0 {

View File

@@ -87,10 +87,7 @@ pub mut:
reset bool
}
pub fn play(args_ PlayArgs) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
pub fn play(mut plbook PlayBook) ! {
mut install_actions := plbook.find(filter: 'postgresql.configure')!
if install_actions.len > 0 {

View File

@@ -79,18 +79,8 @@ fn set_in_mem(o QDrant) ! {
qdrant_installer_default = o.name
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(args_ PlayArgs) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
pub fn play(mut plbook PlayBook) ! {
mut install_actions := plbook.find(filter: 'qdrant_installer.configure')!
if install_actions.len > 0 {

View File

@@ -79,18 +79,8 @@ fn set_in_mem(o ZeroDB) ! {
zerodb_default = o.name
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(args_ PlayArgs) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
pub fn play(mut plbook PlayBook) ! {
mut install_actions := plbook.find(filter: 'zerodb.configure')!
if install_actions.len > 0 {

View File

@@ -23,18 +23,8 @@ pub fn get(args_ ArgsGet) !&ZeroFS {
return &ZeroFS{}
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(args_ PlayArgs) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
pub fn play(mut plbook PlayBook) ! {
mut other_actions := plbook.find(filter: 'zerofs.')!
for other_action in other_actions {

View File

@@ -79,18 +79,8 @@ fn set_in_mem(o CoreDNS) ! {
coredns_default = o.name
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(args_ PlayArgs) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
pub fn play(mut plbook PlayBook) ! {
mut install_actions := plbook.find(filter: 'coredns.configure')!
if install_actions.len > 0 {

View File

@@ -81,18 +81,9 @@ fn set_in_mem(o DifyInstaller) ! {
dify_default = o.name
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(args_ PlayArgs) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
pub fn play(mut plbook PlayBook) ! {
mut install_actions := plbook.find(filter: 'dify.configure')!
if install_actions.len > 0 {

View File

@@ -79,18 +79,8 @@ fn set_in_mem(o GiteaServer) ! {
gitea_default = o.name
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(args_ PlayArgs) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
pub fn play(mut plbook PlayBook) ! {
mut install_actions := plbook.find(filter: 'gitea.configure')!
if install_actions.len > 0 {

View File

@@ -79,18 +79,8 @@ fn set_in_mem(o LivekitServer) ! {
livekit_default = o.name
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(args_ PlayArgs) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
pub fn play(mut plbook PlayBook) ! {
mut install_actions := plbook.find(filter: 'livekit.configure')!
if install_actions.len > 0 {

View File

@@ -30,7 +30,7 @@ pub mut:
reset bool
}
pub fn play(args_ PlayArgs) ! {
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }

View File

@@ -31,7 +31,7 @@ pub mut:
reset bool
}
pub fn play(args_ PlayArgs) ! {
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }

View File

@@ -30,7 +30,7 @@ pub mut:
reset bool
}
pub fn play(args_ PlayArgs) ! {
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }

View File

@@ -30,7 +30,7 @@ pub mut:
reset bool
}
pub fn play(args_ PlayArgs) ! {
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }

View File

@@ -30,7 +30,7 @@ pub mut:
reset bool
}
pub fn play(args_ PlayArgs) ! {
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }

View File

@@ -30,7 +30,7 @@ pub mut:
reset bool
}
pub fn play(args_ PlayArgs) ! {
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }

View File

@@ -87,7 +87,7 @@ pub mut:
reset bool
}
pub fn play(args_ PlayArgs) ! {
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }

View File

@@ -30,7 +30,7 @@ pub mut:
reset bool
}
pub fn play(args_ PlayArgs) ! {
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }

View File

@@ -31,7 +31,7 @@ pub mut:
reset bool
}
pub fn play(args_ PlayArgs) ! {
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }

View File

@@ -31,7 +31,7 @@ pub mut:
reset bool
}
pub fn play(args_ PlayArgs) ! {
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }

View File

@@ -30,7 +30,7 @@ pub mut:
reset bool
}
pub fn play(args_ PlayArgs) ! {
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }

View File

@@ -87,7 +87,7 @@ pub mut:
reset bool
}
pub fn play(args_ PlayArgs) ! {
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }

View File

@@ -23,15 +23,7 @@ pub fn get(args_ ArgsGet) !&FungiStor {
return &FungiStor{}
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(args_ PlayArgs) ! {
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }

View File

@@ -87,7 +87,7 @@ pub mut:
reset bool
}
pub fn play(args_ PlayArgs) ! {
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }

View File

@@ -31,7 +31,7 @@ pub mut:
reset bool
}
pub fn play(args_ PlayArgs) ! {
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }

View File

@@ -31,7 +31,7 @@ pub mut:
reset bool
}
pub fn play(args_ PlayArgs) ! {
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }

View File

@@ -86,7 +86,7 @@ pub mut:
reset bool
}
pub fn play(args_ PlayArgs) ! {
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }

View File

@@ -31,7 +31,7 @@ pub mut:
reset bool
}
pub fn play(args_ PlayArgs) ! {
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }

View File

@@ -31,7 +31,7 @@ pub mut:
reset bool
}
pub fn play(args_ PlayArgs) ! {
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }

View File

@@ -30,7 +30,7 @@ pub mut:
reset bool
}
pub fn play(args_ PlayArgs) ! {
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }

View File

@@ -30,7 +30,7 @@ pub mut:
reset bool
}
pub fn play(args_ PlayArgs) ! {
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }

View File

@@ -23,18 +23,8 @@ pub fn get(args_ ArgsGet) !&DockerInstaller {
return &DockerInstaller{}
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(args_ PlayArgs) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
pub fn play(mut plbook PlayBook) ! {
mut other_actions := plbook.find(filter: 'docker.')!
for other_action in other_actions {

View File

@@ -30,7 +30,7 @@ pub mut:
reset bool
}
pub fn play(args_ PlayArgs) ! {
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }

View File

@@ -30,7 +30,7 @@ pub mut:
reset bool
}
pub fn play(args_ PlayArgs) ! {
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }

View File

@@ -30,7 +30,7 @@ pub mut:
reset bool
}
pub fn play(args_ PlayArgs) ! {
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }

View File

@@ -30,7 +30,7 @@ pub mut:
reset bool
}
pub fn play(args_ PlayArgs) ! {
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }

View File

@@ -31,7 +31,7 @@ pub mut:
reset bool
}
pub fn play(args_ PlayArgs) ! {
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }

View File

@@ -31,7 +31,7 @@ pub mut:
reset bool
}
pub fn play(args_ PlayArgs) ! {
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }

View File

@@ -30,7 +30,7 @@ pub mut:
reset bool
}
pub fn play(args_ PlayArgs) ! {
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }

View File

@@ -30,7 +30,7 @@ pub mut:
reset bool
}
pub fn play(args_ PlayArgs) ! {
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }

View File

@@ -87,7 +87,7 @@ pub mut:
reset bool
}
pub fn play(args_ PlayArgs) ! {
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }

View File

@@ -30,7 +30,7 @@ pub mut:
reset bool
}
pub fn play(args_ PlayArgs) ! {
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }

View File

@@ -88,7 +88,7 @@ pub mut:
reset bool
}
pub fn play(args_ PlayArgs) ! {
pub fn play(mut plbook PlayBook) ! {
mut args := args_
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }

View File

@@ -39,7 +39,7 @@ pub fn configure(instance string, config_ Config) !TFRobot[Config] {
// pub fn heroplay(args play.PLayBookAddArgs) ! {
// // make session for configuring from heroscript
// mut session := play.session_new(session_name: 'config')!
// session.playbook_add(path: args.path, text: args.text, git_url: args.git_url)!
// session.plbook_add(path: args.path, text: args.text, git_url: args.git_url)!
// for mut action in session.plbook.find(filter: 'tfrobot.define')! {
// mut p := action.params
// instance := p.get_default('instance', 'default')!

View File

@@ -81,7 +81,7 @@ pub mut:
configure bool // make sure there is at least one installed
}
pub fn play(args_ PlayArgs) ! {
pub fn play(mut plbook PlayBook) ! {
mut args := args_
if args.heroscript == '' {

View File

@@ -61,11 +61,11 @@ pub fn (mut f DocusaurusFactory) add(args_ DSiteGetArgs) !&DocSite {
args.path_publish = '${f.path_publish}/${args.name}'
}
//this will get us the siteconfig run through playbook
//this will get us the siteconfig run through plbook
mut mysiteconfig := *siteconfig.new(configpath)!
// NOT NEEDED IS DONE FROM HEROSCRIPT BEFORE
// //now run the playbook to get all relevant for the site, {SITENAME} has been set in the context.session
// //now run the plbook to get all relevant for the site, {SITENAME} has been set in the context.session
// doctree.play(
// heroscript_path: configpath
// reset: args.update

View File

@@ -82,7 +82,7 @@ pub mut:
configure bool // make sure there is at least one installed
}
pub fn play(args_ PlayArgs) ! {
pub fn play(mut plbook PlayBook) ! {
mut args := args_
if args.heroscript == '' {

View File

@@ -39,11 +39,7 @@ fn play_build_dest_dev(mut plbook PlayBook, mut config SiteConfig) ! {
}
}
pub fn play(args_ PlayArgs) !PlayBook {
mut args := args_
mut plbook := args.plbook or {
playbook.new(text: args.heroscript, path: args.heroscript_path)!
}
pub fn play(mut plbook PlayBook) ! {
mut context := base.context()!
mut redis := context.redis()!

View File

@@ -110,7 +110,7 @@ siteconfig := site.new("/tmp/mypath")!
```
## how to use with playbook
## how to use with plbook
```v
import freeflowuniverse.herolib.core.playbook
@@ -124,7 +124,7 @@ import freeflowuniverse.herolib.web.site
// session ?&base.Session is optional
mut plbook := playbook.new( "....")!
site.play(mut playbook)!
site.play(mut plbook)!
```

View File

@@ -4,22 +4,8 @@ import freeflowuniverse.herolib.core.playbook { PlayBook }
import freeflowuniverse.herolib.ui.console
import os
@[params]
pub struct PlayArgs {
pub mut:
heroscript string
heroscript_path string
plbook ?PlayBook
dest string
flat bool // if flat then won't use sitenames as subdir's
sitename string
}
pub fn play(args_ PlayArgs) ! {
mut args := args_
mut plbook := args.plbook or {
playbook.new(text: args.heroscript, path: args.heroscript_path)!
}
pub fn play(mut plbook PlayBook) ! {
if args.dest == '' {
args.dest = '${os.home_dir()}/hero/var/sitegen'