diff --git a/aiprompts/herolib_advanced/ui console chalk.md b/aiprompts/herolib_advanced/ui console chalk.md index 5ebbbf88..0b267216 100644 --- a/aiprompts/herolib_advanced/ui console chalk.md +++ b/aiprompts/herolib_advanced/ui console chalk.md @@ -7,7 +7,7 @@ Chalk offers functions:- `console.color_fg(text string, color string)` - To chan Example: -```vlang +```v import freeflowuniverse.herolib.ui.console # basic usage diff --git a/aiprompts/herolib_core/core_params.md b/aiprompts/herolib_core/core_params.md index 8edc7a0a..36c86077 100644 --- a/aiprompts/herolib_core/core_params.md +++ b/aiprompts/herolib_core/core_params.md @@ -25,7 +25,7 @@ The parser supports various input formats: 4. **Comments**: `// this is a comment` (ignored during parsing) Example: -```vlang +```v text := "name:'John Doe' age:30 active:true // user details" params := paramsparser.new(text)! ``` diff --git a/aiprompts/herolib_core/core_ui_console.md b/aiprompts/herolib_core/core_ui_console.md index 8203c25b..4a623c5a 100644 --- a/aiprompts/herolib_core/core_ui_console.md +++ b/aiprompts/herolib_core/core_ui_console.md @@ -4,7 +4,7 @@ has mechanisms to print better to console, see the methods below import as -```vlang +```v import freeflowuniverse.herolib.ui.console ``` diff --git a/aiprompts/herolib_core/core_vshell.md b/aiprompts/herolib_core/core_vshell.md index ce06efec..9c6c6095 100644 --- a/aiprompts/herolib_core/core_vshell.md +++ b/aiprompts/herolib_core/core_vshell.md @@ -2,7 +2,7 @@ this is how we want example scripts to be, see the first line -```vlang +```v #!/usr/bin/env -S v -cg -gc none -cc tcc -d use_openssl -enable-globals run import freeflowuniverse.herolib... diff --git a/aiprompts/instructions_archive/models_from_v/complete.md b/aiprompts/instructions_archive/models_from_v/complete.md index b0babcb1..da56fd9f 100644 --- a/aiprompts/instructions_archive/models_from_v/complete.md +++ b/aiprompts/instructions_archive/models_from_v/complete.md @@ -926,7 +926,7 @@ The parser supports various input formats: 4. **Comments**: `// this is a comment` (ignored during parsing) Example: -```vlang +```v text := "name:'John Doe' age:30 active:true // user details" params := paramsparser.new(text)! ``` @@ -1278,7 +1278,7 @@ has mechanisms to print better to console, see the methods below import as -```vlang +```v import freeflowuniverse.herolib.ui.console ``` @@ -1481,7 +1481,7 @@ File: /Users/despiegk/code/github/freeflowuniverse/herolib/aiprompts/herolib_cor this is how we want example scripts to be, see the first line -```vlang +```v #!/usr/bin/env -S v -cg -gc none -cc tcc -d use_openssl -enable-globals run import freeflowuniverse.herolib... diff --git a/aiprompts/v_advanced/time instructions.md b/aiprompts/v_advanced/time instructions.md index 51552ebe..f84cd515 100644 --- a/aiprompts/v_advanced/time instructions.md +++ b/aiprompts/v_advanced/time instructions.md @@ -83,7 +83,7 @@ fn main() { } ``` -```vlang +```v module time diff --git a/examples/threefold/grid/README.md b/examples/threefold/grid/README.md index 33f353a8..23c04fe9 100644 --- a/examples/threefold/grid/README.md +++ b/examples/threefold/grid/README.md @@ -6,7 +6,7 @@ To be able to run examples you need to install updated version of `griddriver`. Create some `griddriver_install.vsh` file containing following code: -```vlang +```v #!/usr/bin/env -S v -gc none -cc tcc -d use_openssl -enable-globals run import freeflowuniverse.herolib.installers.tfgrid.griddriver as griddriverinstaller diff --git a/examples/web/doctree/content/test.md b/examples/web/doctree/content/test.md index 00b22b0e..591dbadd 100644 --- a/examples/web/doctree/content/test.md +++ b/examples/web/doctree/content/test.md @@ -25,7 +25,7 @@ text in paragraph | February | $80 | | March | $420 | -```vlang +```v fn main(){ println('hello world') } diff --git a/lib/clients/ipapi/readme.md b/lib/clients/ipapi/readme.md index 01288e93..e246cda7 100644 --- a/lib/clients/ipapi/readme.md +++ b/lib/clients/ipapi/readme.md @@ -4,7 +4,7 @@ To get started -```vlang +```v import freeflowuniverse.herolib.clients. ipapi diff --git a/lib/clients/jina/readme.md b/lib/clients/jina/readme.md index cad966b1..987d4cbd 100644 --- a/lib/clients/jina/readme.md +++ b/lib/clients/jina/readme.md @@ -6,7 +6,7 @@ see https://jina.ai/ To get started -```vlang +```v import freeflowuniverse.herolib.clients. jina diff --git a/lib/clients/livekit/readme.md b/lib/clients/livekit/readme.md index e8500dcb..62e33d71 100644 --- a/lib/clients/livekit/readme.md +++ b/lib/clients/livekit/readme.md @@ -2,7 +2,7 @@ To get started -```vlang +```v import freeflowuniverse.herolib.clients.livekit diff --git a/lib/clients/mailclient/readme.md b/lib/clients/mailclient/readme.md index d3862b36..fd44ffa9 100644 --- a/lib/clients/mailclient/readme.md +++ b/lib/clients/mailclient/readme.md @@ -3,7 +3,7 @@ To get started -```vlang +```v import freeflowuniverse.herolib.clients.mailclient diff --git a/lib/clients/openai/readme.md b/lib/clients/openai/readme.md index 68f7a5a8..1d6ecc70 100644 --- a/lib/clients/openai/readme.md +++ b/lib/clients/openai/readme.md @@ -2,7 +2,7 @@ To get started -```vlang +```v import freeflowuniverse.herolib.clients.openai import freeflowuniverse.herolib.core.playcmds diff --git a/lib/clients/runpod/readme.md b/lib/clients/runpod/readme.md index f04c665d..02d902a1 100644 --- a/lib/clients/runpod/readme.md +++ b/lib/clients/runpod/readme.md @@ -4,7 +4,7 @@ To get started -```vlang +```v diff --git a/lib/clients/vastai/readme.md b/lib/clients/vastai/readme.md index 6c68d3da..a5f1308b 100644 --- a/lib/clients/vastai/readme.md +++ b/lib/clients/vastai/readme.md @@ -4,7 +4,7 @@ To get started -```vlang +```v import freeflowuniverse.herolib.clients. vastai diff --git a/lib/clients/wireguard/readme.md b/lib/clients/wireguard/readme.md index 5fe40e9f..f571524c 100644 --- a/lib/clients/wireguard/readme.md +++ b/lib/clients/wireguard/readme.md @@ -4,7 +4,7 @@ To get started -```vlang +```v import freeflowuniverse.herolib.clients. wireguard diff --git a/lib/core/generator/generic/templates/readme.md b/lib/core/generator/generic/templates/readme.md index d7e73a6c..17005bc5 100644 --- a/lib/core/generator/generic/templates/readme.md +++ b/lib/core/generator/generic/templates/readme.md @@ -4,7 +4,7 @@ ${args.title} To get started -```vlang +```v @if args.cat == .installer diff --git a/lib/develop/codewalker/ignore.v b/lib/develop/codewalker/ignore.v index d6eb3492..1c4aca5e 100644 --- a/lib/develop/codewalker/ignore.v +++ b/lib/develop/codewalker/ignore.v @@ -8,7 +8,51 @@ module codewalker // - Lines starting with '#' are comments; empty lines ignored // No negation support for simplicity -const default_gitignore = '.git/\n.svn/\n.hg/\n.bzr/\nnode_modules/\n__pycache__/\n*.py[cod]\n*.so\n.Python\nbuild/\ndevelop-eggs/\ndownloads/\neggs/\n.eggs/\nlib/\nlib64/\nparts/\nsdist/\nvar/\nwheels/\n*.egg-info/\n.installed.cfg\n*.egg\n.env\n.venv\nvenv/\n.tox/\n.nox/\n.coverage\n.coveragerc\ncoverage.xml\n*.cover\n*.gem\n*.pyc\n.cache\n.pytest_cache/\n.mypy_cache/\n.hypothesis/\n.DS_Store\nThumbs.db\n*.tmp\n*.temp\n*.log\n' +const default_gitignore = ' +.git/ +.svn/ +.hg/ +.bzr/ +node_modules/ +__pycache__/ +*.py[cod] +*.so +.Python +build/ +develop-eggs/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +*.egg-info/ +.installed.cfg +*.egg +.env +.venv +venv/ +.tox/ +.nox/ +.coverage +.coveragerc +coverage.xml +*.cover +*.gem +*.pyc +.cache +.pytest_cache/ +.mypy_cache/ +.hypothesis/ +.DS_Store +Thumbs.db +*.tmp +*.temp +*.log +' struct IgnoreRule { base string // relative dir from source root where the ignore file lives ('' means global) diff --git a/lib/develop/heroprompt/readme.md b/lib/develop/heroprompt/readme.md index 8a7d70aa..2b38b0eb 100644 --- a/lib/develop/heroprompt/readme.md +++ b/lib/develop/heroprompt/readme.md @@ -1,30 +1,28 @@ # heroprompt - - To get started -```vlang +```v -import freeflowuniverse.herolib.clients. heroprompt +import freeflowuniverse.herolib.develop.heroprompt -mut client:= heroprompt.get()! +// Example Usage: -client... +// 1. Create a new workspace +mut workspace := heroprompt.new(name: 'my_workspace', path: os.getwd())! +// 2. Add a directory to the workspace +workspace.add_dir(path: './my_project_dir')! + +// 3. Add a file to the workspace +workspace.add_file(path: './my_project_dir/main.v')! + +// 4. Generate a prompt +user_instructions := 'Explain the code in main.v' +prompt_output := workspace.prompt(text: user_instructions) +println(prompt_output) ``` - -## example heroscript - -```hero -!!heroprompt.configure - secret: '...' - host: 'localhost' - port: 8888 -``` - - diff --git a/lib/develop/reprompt/templates/prompt_example.md b/lib/develop/reprompt/templates/prompt_example.md deleted file mode 100644 index 0675fea0..00000000 --- a/lib/develop/reprompt/templates/prompt_example.md +++ /dev/null @@ -1,1607 +0,0 @@ - -/Users/despiegk/code/github/freeflowuniverse/herolib -├── .gitignore -├── .vdocignore -├── compile.sh -├── CONTRIBUTING.md -├── doc.vsh -├── generate.vsh -├── herolib.code-workspace -├── install_hero.sh -├── install_herolib.vsh -├── install_v.sh -├── LICENSE -├── README.md -├── release_OLD.sh -├── release.vsh -├── specs.md -├── test_basic.vsh -└── test_runner.vsh -├── .github -│ └── workflows -│ ├── documentation.yml -│ ├── hero_build.yml -│ └── test.yml -├── aiprompts -│ └── herolib_start_here.md -│ ├── .openhands -│ │ └── setup.sh -│ ├── ai_instruct -│ │ ├── documentation_from_v_md.md -│ │ ├── documentation_from_v.md -│ │ ├── prompt_processing_instructions.md -│ │ ├── prompt_processing_openrpc_like.md -│ │ └── what_is_a_hero_twin.md -│ │ ├── models_from_v -│ ├── bizmodel -│ │ ├── bizmodel_cost.md -│ │ ├── bizmodel_funding.md -│ │ ├── bizmodel_generation_prompt.md -│ │ ├── bizmodel_hr.md -│ │ ├── bizmodel_revenue.md -│ │ └── costs.heroscript -│ ├── documentor -│ │ └── generate_v_doc_readable_md_files.md -│ ├── docusaurus -│ │ └── docusaurus_ebook_manual.md -│ ├── herolib_advanced -│ │ ├── advanced_paths.md -│ │ ├── builder.md -│ │ ├── cmdline_argument_parsing_example.vsh -│ │ ├── datatypes.md -│ │ ├── osal.md -│ │ ├── ourdb.md -│ │ ├── redis.md -│ │ ├── spreadsheet.md -│ │ └── ui console chalk.md -│ ├── herolib_core -│ │ ├── core_curdir_example.md -│ │ ├── core_globals.md -│ │ ├── core_heroscript_basics.md -│ │ ├── core_heroscript_playbook.md -│ │ ├── core_http_client.md -│ │ ├── core_osal.md -│ │ ├── core_ourtime.md -│ │ ├── core_params.md -│ │ ├── core_paths.md -│ │ ├── core_text.md -│ │ ├── core_ui_console.md -│ │ └── core_vshell.md -│ ├── v_advanced -│ │ ├── advanced_topics.md -│ │ ├── compress.md -│ │ ├── generics.md -│ │ ├── html_parser.md -│ │ ├── io.md -│ │ ├── net.md -│ │ ├── reflection.md -│ │ ├── regex.md -│ │ ├── smtp.md -│ │ └── time instructions.md -│ ├── v_core -│ │ └── v_manual.md -│ ├── v_veb_webserver -│ │ ├── veb_assets.md -│ │ ├── veb_auth.md -│ │ ├── veb_csrf.md -│ │ ├── veb_sse.md -│ │ ├── veb.md -│ │ └── vtemplates.md -├── cli -│ ├── .gitignore -│ ├── compile -│ ├── compile_upload.vsh -│ ├── compile_vdo.vsh -│ ├── compile.vsh -│ ├── hero.v -│ └── vdo.v -├── docker -│ └── docker_ubuntu_install.sh -│ ├── herolib -│ │ ├── .gitignore -│ │ ├── build.sh -│ │ ├── debug.sh -│ │ ├── docker-compose.yml -│ │ ├── Dockerfile -│ │ ├── export.sh -│ │ ├── README.md -│ │ ├── shell.sh -│ │ ├── ssh_init.sh -│ │ ├── ssh.sh -│ │ └── start.sh -│ │ ├── scripts -│ ├── postgresql -│ │ ├── docker-compose.yml -│ │ ├── readme.md -│ │ └── start.sh -├── examples -│ ├── README.md -│ └── sync_do.sh -│ ├── aiexamples -│ │ ├── groq.vsh -│ │ ├── jetconvertor.vsh -│ │ ├── jina.vsh -│ │ └── qdrant.vsh -│ ├── baobab -│ │ ├── generator -│ │ └── specification -│ ├── biztools -│ │ ├── bizmodel_complete.vsh -│ │ ├── bizmodel_export.vsh -│ │ ├── bizmodel_full.vsh -│ │ ├── bizmodel.vsh -│ │ ├── bizmodel1.vsh -│ │ ├── bizmodel2.vsh -│ │ ├── costs.vsh -│ │ ├── funding.vsh -│ │ ├── hr.vsh -│ │ └── notworking.md -│ │ ├── _archive -│ │ ├── bizmodel_docusaurus -│ │ ├── examples -│ ├── builder -│ │ ├── simple_ip4.vsh -│ │ ├── simple_ip6.vsh -│ │ └── simple.vsh -│ │ ├── remote_executor -│ ├── clients -│ │ ├── aiclient_example.vsh -│ │ ├── jina_example.vsh -│ │ ├── mail.vsh -│ │ ├── mycelium_rpc.vsh -│ │ ├── mycelium.vsh -│ │ ├── psql.vsh -│ │ └── zinit_rpc_example.vsh -│ ├── core -│ │ ├── agent_encoding.vsh -│ │ ├── generate.vsh -│ │ └── secrets_example.vsh -│ │ ├── base -│ │ ├── db -│ │ ├── dbfs -│ │ ├── openapi -│ │ ├── openrpc -│ │ ├── pathlib -│ ├── data -│ │ ├── .gitignore -│ │ ├── cache.vsh -│ │ ├── compress_gzip_example.vsh -│ │ ├── deduped_mycelium_master.vsh -│ │ ├── deduped_mycelium_worker.vsh -│ │ ├── encoder.vsh -│ │ ├── encrypt_decrypt.vsh -│ │ ├── graphdb.vsh -│ │ ├── heroencoder_example.vsh -│ │ ├── heroencoder_simple.vsh -│ │ ├── jsonexample.vsh -│ │ ├── ourdb_client.vsh -│ │ ├── ourdb_example.vsh -│ │ ├── ourdb_server.vsh -│ │ ├── radixtree.vsh -│ │ └── regex_example.vsh -│ │ ├── location -│ │ ├── ourdb_syncer -│ │ ├── params -│ │ ├── resp -│ ├── develop -│ │ ├── gittools -│ │ ├── ipapi -│ │ ├── juggler -│ │ ├── luadns -│ │ ├── openai -│ │ ├── runpod -│ │ ├── vastai -│ │ └── wireguard -│ ├── hero -│ │ └── alpine_example.vsh -│ │ ├── db -│ │ ├── generation -│ │ ├── openapi -│ ├── installers -│ │ ├── .gitignore -│ │ ├── cometbft.vsh -│ │ ├── conduit.vsh -│ │ ├── coredns.vsh -│ │ ├── hero_install.vsh -│ │ ├── installers.vsh -│ │ ├── traefik.vsh -│ │ └── youki.vsh -│ │ ├── db -│ │ ├── infra -│ │ ├── lang -│ │ ├── net -│ │ ├── sysadmintools -│ │ ├── threefold -│ │ ├── virt -│ ├── jobs -│ │ └── vfs_jobs_example.vsh -│ ├── lang -│ │ └── python -│ ├── mcp -│ │ ├── http_demo -│ │ ├── http_server -│ │ ├── inspector -│ │ └── simple_http -│ ├── osal -│ │ ├── .gitignore -│ │ ├── notifier.vsh -│ │ ├── startup_manager.vsh -│ │ ├── systemd.vsh -│ │ ├── tun.vsh -│ │ ├── ufw_play.vsh -│ │ └── ufw.vsh -│ │ ├── coredns -│ │ ├── download -│ │ ├── ping -│ │ ├── process -│ │ ├── rsync -│ │ ├── sandbox -│ │ ├── sshagent -│ │ ├── zinit -│ ├── schemas -│ │ ├── openapi -│ │ └── openrpc -│ ├── threefold -│ │ └── .gitignore -│ │ ├── grid -│ │ ├── gridproxy -│ │ ├── holochain -│ │ ├── solana -│ │ ├── tfgrid3deployer -│ ├── tools -│ │ ├── imagemagick -│ │ ├── tmux -│ │ └── vault -│ ├── ui -│ │ ├── flow1.v -│ │ └── silence.vsh -│ │ ├── console -│ │ ├── telegram -│ ├── vfs -│ │ └── vfs_db -│ ├── virt -│ │ ├── daguserver -│ │ ├── docker -│ │ ├── hetzner -│ │ ├── lima -│ │ ├── podman_buildah -│ │ ├── runc -│ │ └── windows -│ ├── web -│ │ ├── .gitignore -│ │ ├── docusaurus_example.vsh -│ │ ├── starllight_example.vsh -│ │ └── ui_demo.vsh -│ │ ├── doctree -│ │ ├── markdown_renderer -│ ├── webdav -│ │ ├── .gitignore -│ │ └── webdav_vfs.vsh -├── lib -│ ├── readme.md -│ └── v.mod -│ ├── ai -│ │ ├── escalayer -│ │ ├── mcp -│ │ └── utils -│ ├── baobab -│ │ └── README.md -│ │ ├── actor -│ │ ├── generator -│ │ ├── osis -│ │ ├── specification -│ │ ├── stage -│ ├── biz -│ │ ├── bizmodel -│ │ ├── investortool -│ │ ├── planner -│ │ └── spreadsheet -│ ├── builder -│ │ ├── bootstrapper.v -│ │ ├── builder_factory.v -│ │ ├── done.v -│ │ ├── executor_local_test.v -│ │ ├── executor_local.v -│ │ ├── executor_ssh_test.v -│ │ ├── executor_ssh.v -│ │ ├── executor.v -│ │ ├── model_package.v -│ │ ├── node_commands.v -│ │ ├── node_executor.v -│ │ ├── node_factory.v -│ │ ├── node.v -│ │ ├── nodedb_test.v -│ │ ├── portforward_lib.v -│ │ ├── readme.md -│ │ └── this_remote.v -│ ├── clients -│ │ ├── ipapi -│ │ ├── jina -│ │ ├── livekit -│ │ ├── mailclient -│ │ ├── meilisearch -│ │ ├── mycelium -│ │ ├── mycelium_rpc -│ │ ├── openai -│ │ ├── postgresql_client -│ │ ├── qdrant -│ │ ├── rclone -│ │ ├── runpod -│ │ ├── sendgrid -│ │ ├── vastai -│ │ ├── wireguard -│ │ ├── zerodb_client -│ │ ├── zinit -│ │ └── zinit_rpc -│ ├── code -│ │ └── generator -│ ├── conversiontools -│ │ └── tools.v -│ │ ├── docsorter -│ │ ├── imagemagick -│ │ ├── pdftotext -│ │ ├── text_extractor -│ ├── core -│ │ ├── interactive.v -│ │ ├── memdb_test.v -│ │ ├── memdb.v -│ │ ├── platform_test.v -│ │ ├── platform.v -│ │ ├── readme.md -│ │ ├── sudo_test.v -│ │ └── sudo.v -│ │ ├── base -│ │ ├── code -│ │ ├── generator -│ │ ├── herocmds -│ │ ├── httpconnection -│ │ ├── logger -│ │ ├── openrpc_remove -│ │ ├── pathlib -│ │ ├── playbook -│ │ ├── playcmds -│ │ ├── playmacros -│ │ ├── redisclient -│ │ ├── rootpath -│ │ ├── smartid -│ │ ├── texttools -│ │ ├── vexecutor -│ ├── crypt -│ │ └── crypt.v -│ │ ├── aes_symmetric -│ │ ├── crpgp -│ │ ├── ed25519 -│ │ ├── keychain -│ │ ├── keysafe -│ │ ├── openssl -│ │ ├── pgp -│ │ ├── secp256k1 -│ │ ├── secrets -│ ├── data -│ │ ├── cache -│ │ ├── currency -│ │ ├── dbfs -│ │ ├── dedupestor -│ │ ├── doctree -│ │ ├── encoder -│ │ ├── encoderhero -│ │ ├── flist -│ │ ├── gid -│ │ ├── graphdb -│ │ ├── ipaddress -│ │ ├── location -│ │ ├── markdown -│ │ ├── markdownparser2 -│ │ ├── markdownrenderer -│ │ ├── mnemonic -│ │ ├── models -│ │ ├── ourdb -│ │ ├── ourdb_syncer -│ │ ├── ourjson -│ │ ├── ourtime -│ │ ├── paramsparser -│ │ ├── radixtree -│ │ ├── resp -│ │ ├── serializers -│ │ ├── tst -│ │ ├── verasure -│ │ └── vstor -│ ├── dav -│ │ └── webdav -│ ├── develop -│ │ ├── gittools -│ │ ├── luadns -│ │ ├── performance -│ │ ├── sourcetree -│ │ ├── vscode -│ │ └── vscode_extensions -│ ├── hero -│ │ └── models -│ │ ├── db -│ ├── installers -│ │ ├── install_multi.v -│ │ └── upload.v -│ │ ├── base -│ │ ├── db -│ │ ├── develapps -│ │ ├── infra -│ │ ├── lang -│ │ ├── net -│ │ ├── sysadmintools -│ │ ├── threefold -│ │ ├── ulist -│ │ ├── virt -│ │ ├── web -│ ├── lang -│ │ ├── python -│ │ └── rust -│ ├── mcp -│ │ ├── backend_interface.v -│ │ ├── backend_memory.v -│ │ ├── factory.v -│ │ ├── generics.v -│ │ ├── handler_initialize_test.v -│ │ ├── handler_initialize.v -│ │ ├── handler_prompts.v -│ │ ├── handler_resources.v -│ │ ├── handler_tools.v -│ │ ├── model_configuration_test.v -│ │ ├── model_configuration.v -│ │ ├── model_error.v -│ │ ├── README.md -│ │ └── server.v -│ │ ├── baobab -│ │ ├── cmd -│ │ ├── mcpgen -│ │ ├── pugconvert -│ │ ├── rhai -│ │ ├── transport -│ │ ├── vcode -│ ├── osal -│ │ ├── core -│ │ ├── coredns -│ │ ├── hostsfile -│ │ ├── notifier -│ │ ├── osinstaller -│ │ ├── rsync -│ │ ├── screen -│ │ ├── sshagent -│ │ ├── startupmanager -│ │ ├── systemd -│ │ ├── tmux -│ │ ├── traefik -│ │ ├── tun -│ │ ├── ufw -│ │ └── zinit -│ ├── schemas -│ │ ├── jsonrpc -│ │ ├── jsonschema -│ │ ├── openapi -│ │ └── openrpc -│ ├── security -│ │ ├── authentication -│ │ └── jwt -│ ├── threefold -│ │ ├── grid3 -│ │ └── grid4 -│ ├── ui -│ │ ├── factory.v -│ │ └── readme.md -│ │ ├── console -│ │ ├── generic -│ │ ├── logger -│ │ ├── telegram -│ │ ├── template -│ │ ├── uimodel -│ ├── vfs -│ │ ├── interface.v -│ │ ├── metadata.v -│ │ └── README.md -│ │ ├── vfs_calendar -│ │ ├── vfs_contacts -│ │ ├── vfs_db -│ │ ├── vfs_local -│ │ ├── vfs_mail -│ │ ├── vfs_nested -│ ├── virt -│ │ ├── cloudhypervisor -│ │ ├── docker -│ │ ├── herocontainers -│ │ ├── hetzner -│ │ ├── lima -│ │ ├── qemu -│ │ ├── runc -│ │ └── utils -│ ├── web -│ │ ├── doctreeclient -│ │ ├── docusaurus -│ │ ├── echarts -│ │ ├── site -│ │ └── ui -├── libarchive -│ ├── installers -│ │ └── web -│ ├── rhai -│ │ ├── generate_rhai_example.v -│ │ ├── generate_wrapper_module.v -│ │ ├── register_functions.v -│ │ ├── register_types_test.v -│ │ ├── register_types.v -│ │ ├── rhai_test.v -│ │ ├── rhai.v -│ │ └── verify.v -│ │ ├── prompts -│ │ ├── templates -│ │ ├── testdata -│ └── starlight -│ ├── clean.v -│ ├── config.v -│ ├── factory.v -│ ├── model.v -│ ├── site_get.v -│ ├── site.v -│ ├── template.v -│ └── watcher.v -│ ├── templates -├── manual -│ ├── config.json -│ ├── create_tag.md -│ └── serve_wiki.sh -│ ├── best_practices -│ │ └── using_args_in_function.md -│ │ ├── osal -│ │ ├── scripts -│ ├── core -│ │ ├── base.md -│ │ ├── context_session_job.md -│ │ ├── context.md -│ │ ├── play.md -│ │ └── session.md -│ │ ├── concepts -│ ├── documentation -│ │ └── docextractor.md -├── research -│ └── globals -│ ├── globals_example_inplace.vsh -│ ├── globals_example_reference.vsh -│ ├── globals_example.vsh -│ └── ubuntu_partition.sh -├── vscodeplugin -│ ├── install_ubuntu.sh -│ ├── package.sh -│ └── readme.md -│ ├── heroscrypt-syntax -│ │ ├── heroscript-syntax-0.0.1.vsix -│ │ ├── language-configuration.json -│ │ └── package.json -│ │ ├── syntaxes - - - -File: /Users/despiegk/code/github/freeflowuniverse/herolib/lib/core/playcmds/_archive/bizmodel.v -```v -module playcmds - -// import freeflowuniverse.herolib.core.playbook - -// fn git(mut actions playbook.Actions, action playbook.Action) ! { -// if action.name == 'init' { -// // means we support initialization afterwards -// c.bizmodel_init(mut actions, action)! -// } - -// // if action.name == 'get' { -// // mut gs := gittools.new()! -// // url := action.params.get('url')! -// // branch := action.params.get_default('branch', '')! -// // reset := action.params.get_default_false('reset')! -// // pull := action.params.get_default_false('pull')! -// // mut gr := gs.repo_get_from_url(url: url, branch: branch, pull: pull, reset: reset)! -// // } -// } - -``` - -File: /Users/despiegk/code/github/freeflowuniverse/herolib/lib/core/playcmds/_archive/currency.v -```v -module playcmds - -// fn currency_actions(actions_ []playbook.Action) ! { -// mut actions2 := actions.filtersort(actions: actions_, actor: 'currency', book: '*')! -// if actions2.len == 0 { -// return -// } - -// mut cs := currency.new()! - -// for action in actions2 { -// // TODO: set the currencies -// if action.name == 'default_set' { -// cur := action.params.get('cur')! -// usdval := action.params.get_int('usdval')! -// cs.default_set(cur, usdval)! -// } -// } - -// // TODO: add the currency metainfo, do a test -// } - -``` - -File: /Users/despiegk/code/github/freeflowuniverse/herolib/lib/core/playcmds/_archive/dagu.v -```v -module playcmds - -// import freeflowuniverse.herolib.installers.sysadmintools.daguserver - -// pub fn scheduler(heroscript string) ! { -// daguserver.play( -// heroscript: heroscript -// )! -// } - -``` - -File: /Users/despiegk/code/github/freeflowuniverse/herolib/lib/core/playcmds/_archive/downloader.v -```v -module playcmds - -// import freeflowuniverse.herolib.core.playbook -// import freeflowuniverse.herolib.sysadmin.downloader - -// can start with sal, dal, ... the 2nd name is typicall the actor (or topic) -// do this function public and then it breaches out to detail functionality - -// pub fn sal_downloader(action playbook.Action) ! { -// match action.actor { -// 'downloader' { -// match action.name { -// 'get' { -// downloader_get(action: action)! -// } -// else { -// return error('actions not supported yet') -// } -// } -// } -// else { -// return error('actor not supported yet') -// } -// } -// } - -// fn downloader_get(args ActionExecArgs) ! { -// action := args.action -// // session:=args.action or {panic("no context")} //if we need it here -// mut name := action.params.get_default('name', '')! -// mut downloadpath := action.params.get_default('downloadpath', '')! -// mut url := action.params.get_default('url', '')! -// mut reset := action.params.get_default_false('reset') -// mut gitpull := action.params.get_default_false('gitpull') - -// mut minsize_kb := action.params.get_u32_default('minsize_kb', 0)! -// mut maxsize_kb := action.params.get_u32_default('maxsize_kb', 0)! - -// mut destlink := action.params.get_default_false('destlink') - -// mut dest := action.params.get_default('dest', '')! -// mut hash := action.params.get_default('hash', '')! -// mut metapath := action.params.get_default('metapath', '')! - -// mut meta := downloader.download( -// name: name -// downloadpath: downloadpath -// url: url -// reset: reset -// gitpull: gitpull -// minsize_kb: minsize_kb -// maxsize_kb: maxsize_kb -// destlink: destlink -// dest: dest -// hash: hash -// metapath: metapath -// // session:session // TODO IMPLEMENT (also optional) -// )! -// } - -``` - -File: /Users/despiegk/code/github/freeflowuniverse/herolib/lib/core/playcmds/_archive/play_caddy.v -```v -module playcmds - -// import freeflowuniverse.herolib.installers.web.caddy as caddy_installer -// import freeflowuniverse.herolib.servers.caddy { CaddyFile } -// import freeflowuniverse.herolib.core.playbook -// import os -// // import net.urllib - -// pub fn play_caddy(mut plbook playbook.PlayBook) ! { -// play_caddy_basic(mut plbook)! -// play_caddy_configure(mut plbook)! -// } - -// pub fn play_caddy_configure(mut plbook playbook.PlayBook) ! { -// mut caddy_actions := plbook.find(filter: 'caddy_configure')! -// if caddy_actions.len == 0 { -// return -// } -// } - -// pub fn play_caddy_basic(mut plbook playbook.PlayBook) ! { -// caddy_actions := plbook.find(filter: 'caddy.')! -// if caddy_actions.len == 0 { -// return -// } - -// mut install_actions := plbook.find(filter: 'caddy.install')! - -// if install_actions.len > 0 { -// for install_action in install_actions { -// mut p := install_action.params -// xcaddy := p.get_default_false('xcaddy') -// file_path := p.get_default('file_path', '/etc/caddy')! -// file_url := p.get_default('file_url', '')! -// reset := p.get_default_false('reset') -// start := p.get_default_false('start') -// restart := p.get_default_false('restart') -// stop := p.get_default_false('stop') -// homedir := p.get_default('file_url', '')! -// plugins := p.get_list_default('plugins', []string{})! - -// caddy_installer.install( -// xcaddy: xcaddy -// file_path: file_path -// file_url: file_url -// reset: reset -// start: start -// restart: restart -// stop: stop -// homedir: homedir -// plugins: plugins -// )! -// } -// } - -// mut config_actions := plbook.find(filter: 'caddy.configure')! -// if config_actions.len > 0 { -// mut coderoot := '' -// mut reset := false -// mut pull := false - -// mut public_ip := '' - -// mut c := caddy.get('')! -// // that to me seems to be wrong, not generic enough -// if config_actions.len > 1 { -// return error('can only have 1 config action for books') -// } else if config_actions.len == 1 { -// mut p := config_actions[0].params -// path := p.get_default('path', '/etc/caddy')! -// url := p.get_default('url', '')! -// public_ip = p.get_default('public_ip', '')! -// c = caddy.configure('', homedir: path)! -// config_actions[0].done = true -// } - -// mut caddyfile := CaddyFile{} -// for mut action in plbook.find(filter: 'caddy.add_reverse_proxy')! { -// mut p := action.params -// mut from := p.get_default('from', '')! -// mut to := p.get_default('to', '')! - -// if from == '' || to == '' { -// return error('from & to cannot be empty') -// } - -// caddyfile.add_reverse_proxy( -// from: from -// to: to -// )! -// action.done = true -// } - -// for mut action in plbook.find(filter: 'caddy.add_file_server')! { -// mut p := action.params -// mut domain := p.get_default('domain', '')! -// mut root := p.get_default('root', '')! - -// if root.starts_with('~') { -// root = '${os.home_dir()}${root.trim_string_left('~')}' -// } - -// if domain == '' || root == '' { -// return error('domain & root cannot be empty') -// } - -// caddyfile.add_file_server( -// domain: domain -// root: root -// )! -// action.done = true -// } - -// for mut action in plbook.find(filter: 'caddy.add_basic_auth')! { -// mut p := action.params -// mut domain := p.get_default('domain', '')! -// mut username := p.get_default('username', '')! -// mut password := p.get_default('password', '')! - -// if domain == '' || username == '' || password == '' { -// return error('domain & root cannot be empty') -// } - -// caddyfile.add_basic_auth( -// domain: domain -// username: username -// password: password -// )! -// action.done = true -// } - -// for mut action in plbook.find(filter: 'caddy.generate')! { -// c.set_caddyfile(caddyfile)! -// action.done = true -// } - -// for mut action in plbook.find(filter: 'caddy.start')! { -// c.start()! -// action.done = true -// } -// c.reload()! -// } -// } - -``` - -File: /Users/despiegk/code/github/freeflowuniverse/herolib/lib/core/playcmds/_archive/play_dagu_test.v -```v -module playcmds - -import freeflowuniverse.herolib.core.playbook - -const dagu_script = " -!!dagu.configure - instance: 'test' - username: 'admin' - password: 'testpassword' - -!!dagu.new_dag - name: 'test_dag' - -!!dagu.add_step - dag: 'test_dag' - name: 'hello_world' - command: 'echo hello world' - -!!dagu.add_step - dag: 'test_dag' - name: 'last_step' - command: 'echo last step' - - -" - -fn test_play_dagu() ! { - mut plbook := playbook.new(text: dagu_script)! - play_dagu(mut plbook)! - // panic('s') -} - -``` - -File: /Users/despiegk/code/github/freeflowuniverse/herolib/lib/core/playcmds/_archive/play_dagu.v -```v -module playcmds - -// import freeflowuniverse.herolib.clients.daguclient -// import freeflowuniverse.herolib.installers.sysadmintools.daguserver -// import freeflowuniverse.herolib.installers.sysadmintools.daguserver -import freeflowuniverse.herolib.core.playbook -import freeflowuniverse.herolib.ui.console -import os - -// pub fn play_dagu(mut plbook playbook.PlayBook) ! { -// // dagu_actions := plbook.find(filter: 'dagu.')! -// // if dagu_actions.len == 0 { -// // return -// // } - -// // play_dagu_basic(mut plbook)! -// // play_dagu_configure(mut plbook)! -// } - -// // play_dagu plays the dagu play commands -// pub fn play_dagu_basic(mut plbook playbook.PlayBook) ! { -// // mut install_actions := plbook.find(filter: 'daguserver.configure')! - -// // if install_actions.len > 0 { -// // for install_action in install_actions { -// // mut p := install_action.params -// // panic("daguinstall play") -// // } -// // } - -// // dagu_actions := plbook.find(filter: 'daguserver.install')! -// // if dagu_actions.len > 0 { -// // panic("daguinstall play") -// // return -// // } - -// // mut config_actions := plbook.find(filter: 'dagu.configure')! -// // mut d := if config_actions.len > 1 { -// // return error('can only have 1 config action for dagu') -// // } else if config_actions.len == 1 { -// // mut p := config_actions[0].params -// // instance := p.get_default('instance', 'default')! -// // port := p.get_int_default('port', 8888)! -// // username := p.get_default('username', '')! -// // password := p.get_default('password', '')! -// // config_actions[0].done = true -// // mut server := daguserver.configure(instance, -// // port: port -// // username: username -// // password: password -// // )! -// // server.start()! -// // console.print_debug('Dagu server is running at http://localhost:${port}') -// // console.print_debug('Username: ${username} password: ${password}') - -// // // configure dagu client with server url and api secret -// // server_cfg := server.config()! -// // daguclient.get(instance, -// // url: 'http://localhost:${port}' -// // apisecret: server_cfg.secret -// // )! -// // } else { -// // mut server := daguserver.get('')! -// // server.start()! -// // daguclient.get('')! -// // } - -// // mut dags := map[string]DAG{} - -// // for mut action in plbook.find(filter: 'dagu.new_dag')! { -// // mut p := action.params -// // name := p.get_default('name', '')! -// // dags[name] = DAG{} -// // action.done = true -// // } - -// // for mut action in plbook.find(filter: 'dagu.add_step')! { -// // mut p := action.params -// // dag := p.get_default('dag', 'default')! -// // name := p.get_default('name', 'default')! -// // command := p.get_default('command', '')! -// // dags[dag].step_add( -// // nr: dags.len -// // name: name -// // command: command -// // )! -// // } - -// // for mut action in plbook.find(filter: 'dagu.run')! { -// // mut p := action.params -// // dag := p.get_default('dag', 'default')! -// // // d.new_dag(dags[dag])! -// // panic('to implement') -// // } -// } - -``` - -File: /Users/despiegk/code/github/freeflowuniverse/herolib/lib/core/playcmds/_archive/play_juggler.v -```v -module playcmds - -import freeflowuniverse.herolib.data.doctree -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.playbook -import freeflowuniverse.herolib.develop.juggler -import os - -pub fn play_juggler(mut plbook playbook.PlayBook) ! { - mut coderoot := '' - // mut install := false - mut reset := false - mut pull := false - - mut config_actions := plbook.find(filter: 'juggler.configure')! - - mut j := juggler.Juggler{} - - if config_actions.len > 1 { - return error('can only have 1 config action for juggler') - } else if config_actions.len == 1 { - mut p := config_actions[0].params - path := p.get_default('path', '/etc/juggler')! - url := p.get_default('url', '')! - username := p.get_default('username', '')! - password := p.get_default('password', '')! - port := p.get_int_default('port', 8000)! - - j = juggler.configure( - url: 'https://git.threefold.info/projectmycelium/itenv' - username: username - password: password - reset: true - )! - config_actions[0].done = true - } - - for mut action in plbook.find(filter: 'juggler.start')! { - j.start()! - action.done = true - } - - for mut action in plbook.find(filter: 'juggler.restart')! { - j.restart()! - action.done = true - } -} - -``` - -File: /Users/despiegk/code/github/freeflowuniverse/herolib/lib/core/playcmds/_archive/play_publisher_test.v -```v -module playcmds - -import freeflowuniverse.herolib.core.playbook -import freeflowuniverse.herolib.core.playcmds -import freeflowuniverse.herolib.core.pathlib -import os - -fn test_play_publisher() { - mut p := pathlib.get_file(path: '/tmp/heroscript/do.hero', create: true)! - - s2 := " - -!!publisher.new_collection - url:'https://git.threefold.info/tfgrid/info_tfgrid/src/branch/main/collections' - reset: false - pull: true - - -!!book.define - name:'info_tfgrid' - summary_url:'https://git.threefold.info/tfgrid/info_tfgrid/src/branch/development/books/tech/SUMMARY.md' - title:'ThreeFold Technology' - collections: 'about,dashboard,farmers,library,partners_utilization,tech,p2p' - - -!!book.publish - name:'tech' - production: false -" - p.write(s2)! - - mut plbook := playbook.new(path: '/tmp/heroscript')! - playcmds.play_publisher(mut plbook)! -} - -``` - -File: /Users/despiegk/code/github/freeflowuniverse/herolib/lib/core/playcmds/_archive/play_publisher.v -```v -module playcmds - -import freeflowuniverse.herolib.core.playbook -// import freeflowuniverse.herolib.hero.publishing - -// pub fn play_publisher(mut plbook playbook.PlayBook) ! { -// publishing.play(mut plbook)! -// } - -``` - -File: /Users/despiegk/code/github/freeflowuniverse/herolib/lib/core/playcmds/_archive/play_threefold.v -```v -module playcmds - -import freeflowuniverse.herolib.core.playbook -// import freeflowuniverse.herolib.threefold.grid -// import freeflowuniverse.herolib.threefold.tfrobot -// import os - -// pub fn play_threefold(mut plbook playbook.PlayBook) ! { -// panic('fix tfrobot module') -// // mut config_actions := plbook.find(filter: 'threefold.configure')! - -// // mnemonics_ := os.getenv_opt('TFGRID_MNEMONIC') or { '' } -// // mut ssh_key := os.getenv_opt('SSH_KEY') or { '' } - -// // tfrobot.configure('play', network: 'main', mnemonics: mnemonics_)! - -// // mut robot := tfrobot.get('play')! - -// // if config_actions.len > 1 { -// // return error('can only have 1 config action for threefold') -// // } else if config_actions.len == 1 { -// // mut a := config_actions[0] -// // mut p := a.params -// // mut network := p.get_default('network', 'main')! -// // mnemonics := p.get_default('mnemonics', '')! -// // ssh_key = p.get_default('ssh_key', '')! - -// // network = network.to_lower() - -// // // mnemonics string -// // // network string = 'main' -// // tfrobot.configure('play', network: network, mnemonics: mnemonics)! - -// // robot = tfrobot.get('play')! - -// // config_actions[0].done = true -// // } -// // cfg := robot.config()! -// // if cfg.mnemonics == '' { -// // return error('TFGRID_MNEMONIC should be specified as env variable') -// // } - -// // if ssh_key == '' { -// // return error('SSHKey should be specified as env variable') -// // } - -// // panic('implement') - -// // for mut action in plbook.find(filter: 'threefold.deploy_vm')! { -// // mut p := action.params -// // deployment_name := p.get_default('deployment_name', 'deployment')! -// // name := p.get_default('name', 'vm')! -// // ssh_key := p.get_default('ssh_key', '')! -// // cores := p.get_int_default('cores', 1)! -// // memory := p.get_int_default('memory', 20)! -// // panic("implement") -// // action.done = true -// // } - -// // for mut action in plbook.find(filter: 'threefold.deploy_zdb')! { -// // panic("implement") -// // action.done = true -// // } -// } - -``` - -File: /Users/despiegk/code/github/freeflowuniverse/herolib/lib/core/playcmds/_archive/play_zola.v -```v -module playcmds - -// import freeflowuniverse.herolib.ui.console -// import freeflowuniverse.herolib.web.zola -// import freeflowuniverse.herolib.core.playbook - -// struct WebsiteItem { -// mut: -// name string -// site ?&zola.ZolaSite -// } - -// pub fn play_zola(mut plbook playbook.PlayBook) ! { -// // mut coderoot := '' -// mut buildroot := '' -// mut publishroot := '' -// mut install := true -// mut reset := false - -// wsactions := plbook.find(filter: 'website.')! -// if wsactions.len == 0 { -// return -// } - -// mut config_actions := plbook.find(filter: 'websites:configure')! -// if config_actions.len > 1 { -// return error('can only have 1 config action for websites') -// } else if config_actions.len == 1 { -// mut p := config_actions[0].params -// buildroot = p.get_default('buildroot', '')! -// publishroot = p.get_default('publishroot', '')! -// // coderoot = p.get_default('coderoot', '')! -// install = p.get_default_true('install') -// reset = p.get_default_false('reset') -// config_actions[0].done = true -// } -// mut websites := zola.new( -// path_build: buildroot -// path_publish: publishroot -// install: install -// reset: reset -// )! - -// mut ws := WebsiteItem{} - -// for mut action in plbook.find(filter: 'website.')! { -// if action.name == 'define' { -// console.print_debug('website.define') -// mut p := action.params -// ws.name = p.get('name')! -// title := p.get_default('title', '')! -// description := p.get_default('description', '')! -// ws.site = websites.new(name: ws.name, title: title, description: description)! -// } else if action.name == 'template_add' { -// console.print_debug('website.template_add') -// mut p := action.params -// url := p.get_default('url', '')! -// mut site_ := ws.site or { -// return error("can't find website for template_add, should have been defined before with !!website.define") -// } - -// site_.template_add(url: url)! -// } else if action.name == 'content_add' { -// console.print_debug('website.content_add') -// mut p := action.params -// url := p.get_default('url', '')! -// mut site_ := ws.site or { -// return error("can't find website for content_add, should have been defined before with !!website.define") -// } - -// site_.content_add(url: url)! -// } else if action.name == 'doctree_add' { -// console.print_debug('website.doctree_add') -// mut p := action.params -// url := p.get_default('url', '')! -// pull := p.get_default_false('pull') -// mut site_ := ws.site or { -// return error("can't find website for doctree_add, should have been defined before with !!website.define") -// } - -// site_.doctree_add(url: url, pull: pull)! -// } else if action.name == 'post_add' { -// console.print_debug('website.post_add') -// mut p := action.params -// name := p.get_default('name', '')! -// collection := p.get_default('collection', '')! -// file := p.get_default('file', '')! -// page := p.get_default('page', '')! -// pointer := p.get_default('pointer', '')! -// mut site_ := ws.site or { -// return error("can't find website for doctree_add, should have been defined before with !!website.define") -// } - -// site_.post_add(name: name, collection: collection, file: file, pointer: pointer)! -// } else if action.name == 'blog_add' { -// console.print_debug('website.blog_add') -// mut p := action.params -// name := p.get_default('name', '')! -// collection := p.get_default('collection', '')! -// file := p.get_default('file', '')! -// page := p.get_default('page', '')! -// pointer := p.get_default('pointer', '')! -// mut site_ := ws.site or { -// return error("can't find website for doctree_add, should have been defined before with !!website.define") -// } - -// site_.blog_add(name: name)! -// } else if action.name == 'person_add' { -// console.print_debug('website.person_add') -// mut p := action.params -// name := p.get_default('name', '')! -// page := p.get_default('page', '')! -// collection := p.get_default('collection', '')! -// file := p.get_default('file', '')! -// pointer := p.get_default('pointer', '')! -// mut site_ := ws.site or { -// return error("can't find website for doctree_add, should have been defined before with !!website.define") -// } - -// site_.person_add( -// name: name -// collection: collection -// file: file -// page: page -// pointer: pointer -// )! -// } else if action.name == 'people_add' { -// console.print_debug('website.people_add') -// mut p := action.params -// name := p.get_default('name', '')! -// description := p.get_default('description', '')! -// sort_by_ := p.get_default('sort_by', '')! -// mut site_ := ws.site or { -// return error("can't find website for people_add, should have been defined before with !!website.define") -// } - -// sort_by := zola.SortBy.from(sort_by_)! -// site_.people_add( -// name: name -// title: p.get_default('title', '')! -// sort_by: sort_by -// description: description -// )! -// } else if action.name == 'blog_add' { -// console.print_debug('website.blog_add') -// mut p := action.params -// name := p.get_default('name', '')! -// description := p.get_default('description', '')! -// sort_by_ := p.get_default('sort_by', '')! -// mut site_ := ws.site or { -// return error("can't find website for people_add, should have been defined before with !!website.define") -// } - -// sort_by := zola.SortBy.from(sort_by_)! -// site_.blog_add( -// name: name -// title: p.get_default('title', '')! -// sort_by: sort_by -// description: description -// )! -// } else if action.name == 'news_add' { -// console.print_debug('website.news_add') -// mut p := action.params -// name := p.get_default('name', '')! -// collection := p.get_default('collection', '')! -// pointer := p.get_default('pointer', '')! -// file := p.get_default('file', '')! -// mut site_ := ws.site or { -// return error("can't find website for news_add, should have been defined before with !!website.define") -// } - -// site_.article_add(name: name, collection: collection, file: file, pointer: pointer)! -// } else if action.name == 'header_add' { -// console.print_debug('website.header_add') -// mut p := action.params -// template := p.get_default('template', '')! -// logo := p.get_default('logo', '')! -// mut site_ := ws.site or { -// return error("can't find website for doctree_add, should have been defined before with !!website.define") -// } - -// site_.header_add(template: template, logo: logo)! -// } else if action.name == 'header_link_add' { -// console.print_debug('website.header_link_add') -// mut p := action.params -// page := p.get_default('page', '')! -// label := p.get_default('label', '')! -// mut site_ := ws.site or { -// return error("can't find website for header_link_add, should have been defined before with !!website.define") -// } - -// site_.header_link_add(page: page, label: label)! -// } else if action.name == 'footer_add' { -// console.print_debug('website.footer_add') -// mut p := action.params -// template := p.get_default('template', '')! -// mut site_ := ws.site or { -// return error("can't find website for doctree_add, should have been defined before with !!website.define") -// } - -// site_.footer_add(template: template)! -// } else if action.name == 'page_add' { -// console.print_debug('website.page_add') -// mut p := action.params -// name := p.get_default('name', '')! -// collection := p.get_default('collection', '')! -// file := p.get_default('file', '')! -// homepage := p.get_default_false('homepage') -// mut site_ := ws.site or { -// return error("can't find website for doctree_add, should have been defined before with !!website.define") -// } - -// site_.page_add(name: name, collection: collection, file: file, homepage: homepage)! - -// // }else if action.name=="pull"{ -// // mut site_:=ws.site or { return error("can't find website for pull, should have been defined before with !!website.define")} -// // site_.pull()! -// } else if action.name == 'section_add' { -// console.print_debug('website.section_add') -// // mut p := action.params -// // name := p.get_default('name', '')! -// // // collection := p.get_default('collection', '')! -// // // file := p.get_default('file', '')! -// // // homepage := p.get_default_false('homepage') -// // mut site_ := ws.site or { -// // return error("can't find website for doctree_add, should have been defined before with !!website.define") -// // } - -// // site_.add_section(name: name)! - -// // }else if action.name=="pull"{ -// // mut site_:=ws.site or { return error("can't find website for pull, should have been defined before with !!website.define")} -// // site_.pull()! -// } else if action.name == 'generate' { -// mut site_ := ws.site or { -// return error("can't find website for generate, should have been defined before with !!website.define") -// } - -// site_.generate()! -// // site_.serve()! -// } else { -// return error("Cannot find right action for website. Found '${action.name}' which is a non understood action for !!website.") -// } -// action.done = true -// } -// } - -``` - -File: /Users/despiegk/code/github/freeflowuniverse/herolib/lib/core/playcmds/factory.v -```v -module playcmds - -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.data.doctree -import freeflowuniverse.herolib.biz.bizmodel -import freeflowuniverse.herolib.web.site -import freeflowuniverse.herolib.web.docusaurus -import freeflowuniverse.herolib.clients.openai - -// ------------------------------------------------------------------- -// run – entry point for all HeroScript play‑commands -// ------------------------------------------------------------------- - -@[params] -pub struct PlayArgs { -pub mut: - heroscript string - heroscript_path string - plbook ?PlayBook - reset bool -} - -pub fn run(args_ PlayArgs) ! { - mut args := 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)! - - // 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)! - docusaurus.play(mut plbook)! - - // Ensure we did not leave any actions un‑processed - plbook.empty_check()! -} - -``` - -File: /Users/despiegk/code/github/freeflowuniverse/herolib/lib/core/playcmds/play_core.v -```v -module playcmds - -import freeflowuniverse.herolib.develop.gittools -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools - -// ------------------------------------------------------------------- -// Core play‑command processing (context, session, env‑subst, etc) -// ------------------------------------------------------------------- - -fn play_core(mut plbook PlayBook) ! { - // ---------------------------------------------------------------- - // 1. Include handling (play include / echo) - // ---------------------------------------------------------------- - // Track included paths to prevent infinite recursion - mut included_paths := map[string]bool{} - - for action_ in plbook.find(filter: 'play.*')! { - if action_.name == 'include' { - console.print_debug('play run:${action_}') - mut action := *action_ - mut playrunpath := action.params.get_default('path', '')! - if playrunpath.len == 0 { - action.name = 'pull' - playrunpath = gittools.path( - path: action.params.get_default('path', '')! - git_url: action.params.get_default('git_url', '')! - git_reset: action.params.get_default_false('git_reset') - git_pull: action.params.get_default_false('git_pull') - )! - } - if playrunpath.len == 0 { - return error("can't run a heroscript didn't find url or path.") - } - - // Check for cycle detection - if playrunpath in included_paths { - console.print_debug('Skipping already included path: ${playrunpath}') - continue - } - - console.print_debug('play run path:${playrunpath}') - included_paths[playrunpath] = true - plbook.add(path: playrunpath)! - } - if action_.name == 'echo' { - content := action_.params.get_default('content', "didn't find content")! - console.print_header(content) - } - } - - // ---------------------------------------------------------------- - // 2. Session environment handling - // ---------------------------------------------------------------- - // Guard – make sure a session exists - mut session := plbook.session - - // !!session.env_set / env_set_once - for mut action in plbook.find(filter: 'session.')! { - mut p := action.params - match action.name { - 'env_set' { - key := p.get('key')! - val := p.get('val') or { p.get('value')! } - session.env_set(key, val)! - } - 'env_set_once' { - key := p.get('key')! - val := p.get('val') or { p.get('value')! } - // Use the dedicated “set‑once” method - session.env_set_once(key, val)! - } - else { /* ignore unknown sub‑action */ } - } - action.done = true - } - - // ---------------------------------------------------------------- - // 3. Template replacement in action parameters - // ---------------------------------------------------------------- - // Apply template replacement from session environment variables - if session.env.len > 0 { - // Create a map with name_fix applied to keys for template replacement - mut env_fixed := map[string]string{} - for key, value in session.env { - env_fixed[texttools.name_fix(key)] = value - } - - for mut action in plbook.actions { - if !action.done { - action.params.replace(env_fixed) - } - } - } - - for mut action in plbook.find(filter: 'core.coderoot_set')! { - mut p := action.params - if p.exists('coderoot') { - coderoot := p.get_path_create('coderoot')! - if session.context.config.coderoot != coderoot { - session.context.config.coderoot = coderoot - session.context.save()! - } - } else { - return error('coderoot needs to be specified') - } - action.done = true - } - - for mut action in plbook.find(filter: 'core.params_context_set')! { - mut p := action.params - mut context_params := session.context.params()! - for param in p.params { - context_params.set(param.key, param.value) - } - session.context.save()! - action.done = true - } - - for mut action in plbook.find(filter: 'core.params_session_set')! { - mut p := action.params - for param in p.params { - session.params.set(param.key, param.value) - } - session.save()! - action.done = true - } -} - -``` - - -these are my instructions what needs to be done with the attached code - -TODO… - diff --git a/lib/installers/db/cometbft/readme.md b/lib/installers/db/cometbft/readme.md index 00c6b32a..412a9a09 100644 --- a/lib/installers/db/cometbft/readme.md +++ b/lib/installers/db/cometbft/readme.md @@ -4,7 +4,7 @@ To get started -```vlang +```v import freeflowuniverse.herolib.installers.db.cometbft as cometbft_installer diff --git a/lib/installers/db/meilisearch_installer/readme.md b/lib/installers/db/meilisearch_installer/readme.md index 46a6e264..92e61d3b 100644 --- a/lib/installers/db/meilisearch_installer/readme.md +++ b/lib/installers/db/meilisearch_installer/readme.md @@ -4,7 +4,7 @@ To get started -```vlang +```v import freeflowuniverse.herolib.installers.db.meilisearch as meilisearchinstaller diff --git a/lib/installers/db/postgresql/readme.md b/lib/installers/db/postgresql/readme.md index 06a25bf5..ba45ab97 100644 --- a/lib/installers/db/postgresql/readme.md +++ b/lib/installers/db/postgresql/readme.md @@ -4,7 +4,7 @@ To get started -```vlang +```v diff --git a/lib/installers/db/qdrant_installer/readme.md b/lib/installers/db/qdrant_installer/readme.md index 8e5f6b78..cc2e142f 100644 --- a/lib/installers/db/qdrant_installer/readme.md +++ b/lib/installers/db/qdrant_installer/readme.md @@ -4,7 +4,7 @@ Is a powerfull db for embedding for AI Agents. To get started -```vlang +```v import freeflowuniverse.herolib.installers.db.qdrant_installer diff --git a/lib/installers/infra/coredns/readme.md b/lib/installers/infra/coredns/readme.md index 15fa18a8..9c8b59ef 100644 --- a/lib/installers/infra/coredns/readme.md +++ b/lib/installers/infra/coredns/readme.md @@ -4,7 +4,7 @@ coredns To get started -```vlang +```v import freeflowuniverse.herolib.installers.infra.coredns as coredns_installer diff --git a/lib/installers/infra/gitea/readme.md b/lib/installers/infra/gitea/readme.md index 9dfb7153..9c14c56e 100644 --- a/lib/installers/infra/gitea/readme.md +++ b/lib/installers/infra/gitea/readme.md @@ -4,7 +4,7 @@ To get started -```vlang +```v import freeflowuniverse.herolib.installers.infra.gitea as gitea_installer diff --git a/lib/installers/infra/livekit/readme.md b/lib/installers/infra/livekit/readme.md index 61c79442..df226a99 100644 --- a/lib/installers/infra/livekit/readme.md +++ b/lib/installers/infra/livekit/readme.md @@ -4,7 +4,7 @@ To get started -```vlang +```v diff --git a/lib/installers/infra/screen/readme.md b/lib/installers/infra/screen/readme.md index f8480f1f..8b13f311 100644 --- a/lib/installers/infra/screen/readme.md +++ b/lib/installers/infra/screen/readme.md @@ -4,7 +4,7 @@ To get started -```vlang +```v import freeflowuniverse.herolib.installers.something.screen as screen_installer diff --git a/lib/installers/infra/zinit_installer/readme.md b/lib/installers/infra/zinit_installer/readme.md index a5130131..a1994d3c 100644 --- a/lib/installers/infra/zinit_installer/readme.md +++ b/lib/installers/infra/zinit_installer/readme.md @@ -4,7 +4,7 @@ To get started -```vlang +```v import freeflowuniverse.herolib.installers.something. zinit diff --git a/lib/installers/lang/golang/readme.md b/lib/installers/lang/golang/readme.md index 0d8346a1..ca110c61 100644 --- a/lib/installers/lang/golang/readme.md +++ b/lib/installers/lang/golang/readme.md @@ -4,7 +4,7 @@ To get started -```vlang +```v import freeflowuniverse.herolib.installers.lang.golang diff --git a/lib/installers/lang/nodejs/readme.md b/lib/installers/lang/nodejs/readme.md index 14f8478e..04585cd9 100644 --- a/lib/installers/lang/nodejs/readme.md +++ b/lib/installers/lang/nodejs/readme.md @@ -4,7 +4,7 @@ To get started -```vlang +```v import freeflowuniverse.herolib.installers.something.nodejs as nodejs_installer diff --git a/lib/installers/lang/python/readme.md b/lib/installers/lang/python/readme.md index f4046274..8b80bde6 100644 --- a/lib/installers/lang/python/readme.md +++ b/lib/installers/lang/python/readme.md @@ -4,7 +4,7 @@ To get started -```vlang +```v import freeflowuniverse.herolib.installers.something.python as python_installer diff --git a/lib/installers/lang/rust/readme.md b/lib/installers/lang/rust/readme.md index 1aa9a9a1..3b251986 100644 --- a/lib/installers/lang/rust/readme.md +++ b/lib/installers/lang/rust/readme.md @@ -4,7 +4,7 @@ To get started -```vlang +```v import freeflowuniverse.herolib.installers.something.rust as rust_installer diff --git a/lib/installers/net/wireguard_installer/readme.md b/lib/installers/net/wireguard_installer/readme.md index 73a58c61..8047b5c1 100644 --- a/lib/installers/net/wireguard_installer/readme.md +++ b/lib/installers/net/wireguard_installer/readme.md @@ -4,7 +4,7 @@ To get started -```vlang +```v import freeflowuniverse.herolib.installers.something.wireguard as wireguard_installer diff --git a/lib/installers/net/yggdrasil/readme.md b/lib/installers/net/yggdrasil/readme.md index 8da4e9ec..8241c696 100644 --- a/lib/installers/net/yggdrasil/readme.md +++ b/lib/installers/net/yggdrasil/readme.md @@ -4,7 +4,7 @@ To get started -```vlang +```v import freeflowuniverse.herolib.installers.something.yggdrasil as yggdrasil_installer diff --git a/lib/installers/sysadmintools/b2/readme.md b/lib/installers/sysadmintools/b2/readme.md index 68824662..514ee422 100644 --- a/lib/installers/sysadmintools/b2/readme.md +++ b/lib/installers/sysadmintools/b2/readme.md @@ -4,7 +4,7 @@ To get started -```vlang +```v import freeflowuniverse.herolib.installers.something.b2 as b2_installer diff --git a/lib/installers/sysadmintools/fungistor/readme.md b/lib/installers/sysadmintools/fungistor/readme.md index 731a2330..7f0d665e 100644 --- a/lib/installers/sysadmintools/fungistor/readme.md +++ b/lib/installers/sysadmintools/fungistor/readme.md @@ -4,7 +4,7 @@ To get started -```vlang +```v import freeflowuniverse.herolib.installers.something.fungistor as fungistor_installer diff --git a/lib/installers/sysadmintools/garage_s3/readme.md b/lib/installers/sysadmintools/garage_s3/readme.md index 04075960..bd280790 100644 --- a/lib/installers/sysadmintools/garage_s3/readme.md +++ b/lib/installers/sysadmintools/garage_s3/readme.md @@ -4,7 +4,7 @@ To get started -```vlang +```v diff --git a/lib/installers/sysadmintools/grafana/readme.md b/lib/installers/sysadmintools/grafana/readme.md index 2be52a90..14d7b25f 100644 --- a/lib/installers/sysadmintools/grafana/readme.md +++ b/lib/installers/sysadmintools/grafana/readme.md @@ -4,7 +4,7 @@ To get started -```vlang +```v import freeflowuniverse.herolib.installers.something.grafana as grafana_installer diff --git a/lib/installers/sysadmintools/rclone/readme.md b/lib/installers/sysadmintools/rclone/readme.md index 09428d8a..99f5165c 100644 --- a/lib/installers/sysadmintools/rclone/readme.md +++ b/lib/installers/sysadmintools/rclone/readme.md @@ -4,7 +4,7 @@ To get started -```vlang +```v diff --git a/lib/installers/sysadmintools/restic/readme.md b/lib/installers/sysadmintools/restic/readme.md index 61863bd2..0e8d2013 100644 --- a/lib/installers/sysadmintools/restic/readme.md +++ b/lib/installers/sysadmintools/restic/readme.md @@ -4,7 +4,7 @@ To get started -```vlang +```v import freeflowuniverse.herolib.installers.something.restic as restic_installer diff --git a/lib/installers/threefold/griddriver/readme.md b/lib/installers/threefold/griddriver/readme.md index 990b8c23..11dea35a 100644 --- a/lib/installers/threefold/griddriver/readme.md +++ b/lib/installers/threefold/griddriver/readme.md @@ -2,7 +2,7 @@ To use the installer: -```vlang +```v import freeflowuniverse.herolib.installers.threefold.griddriver fn main() { diff --git a/lib/installers/virt/cloudhypervisor/readme.md b/lib/installers/virt/cloudhypervisor/readme.md index 1d0d0ef7..698213a5 100644 --- a/lib/installers/virt/cloudhypervisor/readme.md +++ b/lib/installers/virt/cloudhypervisor/readme.md @@ -4,7 +4,7 @@ To get started -```vlang +```v import freeflowuniverse.herolib.installers.something. cloudhypervisor diff --git a/lib/installers/virt/docker/readme.md b/lib/installers/virt/docker/readme.md index 8cb368a3..ac886ba7 100644 --- a/lib/installers/virt/docker/readme.md +++ b/lib/installers/virt/docker/readme.md @@ -2,7 +2,7 @@ To get started -```vlang +```v import freeflowuniverse.herolib.installers.something.docker as docker_installer diff --git a/lib/installers/virt/pacman/readme.md b/lib/installers/virt/pacman/readme.md index 42007738..ecf9ab55 100644 --- a/lib/installers/virt/pacman/readme.md +++ b/lib/installers/virt/pacman/readme.md @@ -4,7 +4,7 @@ To get started -```vlang +```v import freeflowuniverse.herolib.installers.virt.pacman diff --git a/lib/installers/virt/podman/readme.md b/lib/installers/virt/podman/readme.md index 968205bd..f8de50a4 100644 --- a/lib/installers/virt/podman/readme.md +++ b/lib/installers/virt/podman/readme.md @@ -7,7 +7,7 @@ Podman is a lightweight container manager that allows users to manage and run co The following example demonstrates how to use the Podman installer in a VLang script. It checks if Podman is installed, removes it if found, or installs it if not. ### Example Code (VLang) -```vlang +```v import freeflowuniverse.herolib.installers.virt.podman as podman_installer mut podman := podman_installer.get()! diff --git a/lib/installers/virt/youki/readme.md b/lib/installers/virt/youki/readme.md index 0c20bfc6..781dcdf6 100644 --- a/lib/installers/virt/youki/readme.md +++ b/lib/installers/virt/youki/readme.md @@ -4,7 +4,7 @@ To get started -```vlang +```v import freeflowuniverse.herolib.installers.virt.youki diff --git a/lib/installers/web/bun/readme.md b/lib/installers/web/bun/readme.md index e756650f..2ca7cb7f 100644 --- a/lib/installers/web/bun/readme.md +++ b/lib/installers/web/bun/readme.md @@ -4,7 +4,7 @@ To get started -```vlang +```v import freeflowuniverse.herolib.installers.something.bun as bun_installer diff --git a/lib/installers/web/imagemagick/readme.md b/lib/installers/web/imagemagick/readme.md index ca621788..36cc4439 100644 --- a/lib/installers/web/imagemagick/readme.md +++ b/lib/installers/web/imagemagick/readme.md @@ -4,7 +4,7 @@ To get started -```vlang +```v import freeflowuniverse.herolib.installers.something.imagemagick as imagemagick_installer diff --git a/lib/installers/web/tailwind/readme.md b/lib/installers/web/tailwind/readme.md index 098cefeb..3c798a16 100644 --- a/lib/installers/web/tailwind/readme.md +++ b/lib/installers/web/tailwind/readme.md @@ -4,7 +4,7 @@ To get started -```vlang +```v diff --git a/lib/installers/web/tailwind4/readme.md b/lib/installers/web/tailwind4/readme.md index 13f5639a..a9e3dfb3 100644 --- a/lib/installers/web/tailwind4/readme.md +++ b/lib/installers/web/tailwind4/readme.md @@ -4,7 +4,7 @@ To get started -```vlang +```v diff --git a/lib/installers/web/traefik/readme.md b/lib/installers/web/traefik/readme.md index 1409995f..dcf74b3d 100644 --- a/lib/installers/web/traefik/readme.md +++ b/lib/installers/web/traefik/readme.md @@ -4,7 +4,7 @@ To get started -```vlang +```v diff --git a/lib/installers/web/zola/readme.md b/lib/installers/web/zola/readme.md index 2da105e2..5bb3a965 100644 --- a/lib/installers/web/zola/readme.md +++ b/lib/installers/web/zola/readme.md @@ -4,7 +4,7 @@ To get started -```vlang +```v diff --git a/lib/threefold/grid3/deployer/readme.md b/lib/threefold/grid3/deployer/readme.md index 1934c719..21363df6 100644 --- a/lib/threefold/grid3/deployer/readme.md +++ b/lib/threefold/grid3/deployer/readme.md @@ -2,7 +2,7 @@ To get started -```vlang +```v diff --git a/libarchive/daguserver/readme.md b/libarchive/daguserver/readme.md index ea080590..30a1d8a0 100644 --- a/libarchive/daguserver/readme.md +++ b/libarchive/daguserver/readme.md @@ -4,7 +4,7 @@ To get started -```vlang +```v diff --git a/libarchive/dify/readme.md b/libarchive/dify/readme.md index e1cd7691..fff6c211 100644 --- a/libarchive/dify/readme.md +++ b/libarchive/dify/readme.md @@ -4,7 +4,7 @@ dify To get started -```vlang +```v import freeflowuniverse.herolib.installers.something.dify as dify_installer diff --git a/libarchive/installers/web/caddy2/readme.md b/libarchive/installers/web/caddy2/readme.md index 5bbcebc2..a440becb 100644 --- a/libarchive/installers/web/caddy2/readme.md +++ b/libarchive/installers/web/caddy2/readme.md @@ -4,7 +4,7 @@ To get started -```vlang +```v