Files
herolib/lib/core/playcmds/factory.v
2025-08-28 19:22:14 +02:00

71 lines
1.7 KiB
V
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

module playcmds
import freeflowuniverse.herolib.core.playbook { PlayBook }
import freeflowuniverse.herolib.data.doctree
import freeflowuniverse.herolib.biz.bizmodel
import freeflowuniverse.herolib.threefold.incatokens
import freeflowuniverse.herolib.web.site
import freeflowuniverse.herolib.virt.hetznermanager
import freeflowuniverse.herolib.web.docusaurus
import freeflowuniverse.herolib.clients.openai
import freeflowuniverse.herolib.clients.giteaclient
import freeflowuniverse.herolib.osal.tmux
// -------------------------------------------------------------------
// run entry point for all HeroScript playcommands
// -------------------------------------------------------------------
@[params]
pub struct PlayArgs {
pub mut:
heroscript string
heroscript_path string
plbook ?PlayBook
reset bool
emptycheck bool = true
}
pub fn play(args_ PlayArgs) ! {
return run(args_)
}
pub fn run(args_ PlayArgs) ! {
mut args := args_
// println('DEBUG: the args is: ${args}')
mut plbook := args.plbook or {
playbook.new(text: args.heroscript, path: args.heroscript_path)!
}
// Core actions
play_core(mut plbook)!
// Git actions
play_git(mut plbook)!
// Tmux actions
tmux.play(mut plbook)!
// Business model (e.g. currency, bizmodel)
bizmodel.play(mut plbook)!
// OpenAI client
openai.play(mut plbook)!
// Website / docs
site.play(mut plbook)!
doctree.play(mut plbook)!
incatokens.play(mut plbook)!
docusaurus.play(mut plbook)!
hetznermanager.play(mut plbook)!
hetznermanager.play2(mut plbook)!
giteaclient.play(mut plbook)!
if args.emptycheck {
// Ensure we did not leave any actions unprocessed
plbook.empty_check()!
}
}