From 8f2d187b1787ac96a3a2eecaa4f7a44b7257d2a2 Mon Sep 17 00:00:00 2001 From: Mahmoud-Emad Date: Sun, 12 Oct 2025 12:30:19 +0300 Subject: [PATCH] fix: Rename freeflowuniverse to incubaid --- CONTRIBUTING.md | 17 +- README.md | 15 +- aiprompts/bizmodel/bizmodel_revenue.md | 14 +- .../docusaurus/docusaurus_ebook_manual.md | 187 +- aiprompts/herolib_advanced/advanced_paths.md | 24 +- aiprompts/herolib_advanced/builder.md | 24 +- aiprompts/herolib_advanced/osal.md | 574 +-- aiprompts/herolib_advanced/ourdb.md | 3 +- aiprompts/herolib_advanced/spreadsheet.md | 117 +- .../herolib_advanced/ui console chalk.md | 2 +- aiprompts/herolib_core/core_globals.md | 36 +- .../herolib_core/core_heroscript_basics.md | 58 +- .../herolib_core/core_heroscript_playbook.md | 6 +- aiprompts/herolib_core/core_http_client.md | 25 +- aiprompts/herolib_core/core_osal.md | 106 +- aiprompts/herolib_core/core_ourtime.md | 3 +- aiprompts/herolib_core/core_params.md | 119 +- aiprompts/herolib_core/core_paths.md | 14 +- aiprompts/herolib_core/core_redis.md | 72 +- aiprompts/herolib_core/core_text.md | 90 +- aiprompts/herolib_core/core_ui_console.md | 118 +- aiprompts/herolib_core/core_vshell.md | 2 +- aiprompts/instructions/herodb_base_fs.md | 696 ++-- .../documentation_from_v.md | 10 +- .../documentation_from_v_md.md | 6 +- .../models_from_v/complete.md | 535 +-- .../models_from_v/prompt.md | 4 +- .../models_from_v/update.md | 2 +- aiprompts/todo/refactor_herofs.md | 3105 +++++++++-------- aiprompts/vlang_herolib_core.md | 624 ++-- cli/hero.v | 21 +- cli/vdo.v | 2 +- docker/herolib/scripts/install_herolib.vsh | 4 +- docker/herolib/scripts/install_v.sh | 2 +- examples/aiexamples/groq.vsh | 2 +- examples/aiexamples/jetconvertor.vsh | 2 +- examples/aiexamples/jina.vsh | 2 +- examples/aiexamples/qdrant.vsh | 6 +- examples/alpine_example.vsh | 2 +- examples/biztools/_archive/investor_tool.vsh | 4 +- examples/biztools/_archive/tf9_biz.vsh | 14 +- examples/biztools/bizmodel.vsh | 2 +- examples/biztools/bizmodel1.vsh | 4 +- examples/biztools/bizmodel2.vsh | 4 +- examples/biztools/bizmodel_complete.vsh | 4 +- examples/biztools/bizmodel_export.vsh | 6 +- examples/biztools/bizmodel_full.vsh | 4 +- examples/biztools/costs.vsh | 4 +- examples/biztools/funding.vsh | 4 +- examples/biztools/hr.vsh | 4 +- examples/builder/remote_executor/README.md | 9 +- examples/builder/remote_executor/toexec.v | 2 +- examples/builder/simple.vsh | 4 +- examples/builder/simple_ip4.vsh | 4 +- examples/builder/simple_ip6.vsh | 4 +- examples/clients/aiclient_example.vsh | 4 +- examples/clients/gitea.vsh | 4 +- examples/clients/jina_example.vsh | 2 +- examples/clients/mail.vsh | 2 +- examples/clients/mycelium.vsh | 4 +- examples/clients/mycelium_rpc.vsh | 4 +- examples/clients/psql.vsh | 4 +- examples/clients/zinit_rpc.vsh | 4 +- examples/core/agent_encoding.vsh | 4 +- examples/core/base/config_basic.vsh | 2 +- .../base/config_with_template_replacement.vsh | 4 +- examples/core/base/core_1.vsh | 4 +- examples/core/db/db_do.v | 6 +- examples/core/generate.vsh | 4 +- examples/core/logger/logger.vsh | 2 +- examples/core/openapi/gitea/gitea_openapi.vsh | 2 +- .../openrpc/examples/openrpc_client/client.v | 2 +- .../openrpc/examples/petstore_client/client.v | 2 +- .../examples/petstore_client/methods.v | 2 +- .../core/pathlib/examples/list/path_list.vsh | 2 +- .../core/pathlib/examples/md5/paths_md5.vsh | 2 +- .../pathlib/examples/scanner/path_scanner.vsh | 4 +- .../pathlib/examples/sha256/paths_sha256.vsh | 2 +- examples/crypt/crypt_example.vsh | 2 +- examples/data/cache.vsh | 2 +- examples/data/countries.vsh | 2 +- examples/data/deduped_mycelium_master.vsh | 2 +- examples/data/deduped_mycelium_worker.vsh | 2 +- examples/data/encoder.vsh | 4 +- examples/data/encrypt_decrypt.vsh | 4 +- examples/data/graphdb.vsh | 2 +- examples/data/heroencoder_example.vsh | 4 +- examples/data/heroencoder_simple.vsh | 4 +- examples/data/location/location_example.vsh | 4 +- .../data/location/location_example_tcc.vsh | 4 +- examples/data/ourdb_client.vsh | 2 +- examples/data/ourdb_example.vsh | 2 +- examples/data/ourdb_server.vsh | 2 +- examples/data/ourdb_syncer/db_example.v | 2 +- examples/data/ourdb_syncer/master_example.v | 2 +- examples/data/ourdb_syncer/worker_example.v | 2 +- examples/data/params/args/args_example.vsh | 4 +- .../data/params/paramsfilter/paramsfilter.vsh | 2 +- examples/data/radixtree.vsh | 2 +- examples/data/resp/resp_example.vsh | 2 +- .../develop/codewalker/codewalker_example.vsh | 4 +- .../develop/gittools/gittools_example2.vsh | 4 +- .../develop/gittools/gittools_path_get.vsh | 4 +- examples/develop/gittools/gittools_play.vsh | 2 +- examples/develop/gittools/gittools_print.vsh | 2 +- .../develop/heroprompt/heroprompt_example.vsh | 2 +- examples/develop/ipapi/example.vsh | 2 +- examples/develop/juggler/v_example.vsh | 4 +- examples/develop/juggler/v_example2.vsh | 2 +- examples/develop/luadns/example.vsh | 2 +- examples/develop/openai/openai_example.vsh | 2 +- examples/develop/runpod/runpod_example.vsh | 4 +- examples/develop/vastai/vastai_example.vsh | 2 +- examples/develop/wireguard/wireguard.vsh | 4 +- examples/hero/crypt/hero_crypt_example.vsh | 4 +- examples/hero/db/psql2.vsh | 10 +- examples/hero/herofs/fs_server.vsh | 4 +- examples/hero/herofs/fs_tools_example.vsh | 2 +- examples/hero/herofs/herofs_advanced.vsh | 2 +- examples/hero/herofs/herofs_basic.vsh | 2 +- .../hero/herofs/import_export_example.vsh | 2 +- .../hero/heromodels/heromodels_calendar.vsh | 4 +- .../heromodels/heromodels_calendar_event.vsh | 4 +- .../heromodels_calendar_event_simple.vsh | 4 +- ...omodels_calendar_event_with_recurrence.vsh | 4 +- .../hero/heromodels/heromodels_chat_group.vsh | 4 +- .../heromodels/heromodels_chat_message.vsh | 4 +- .../hero/heromodels/heromodels_comments.vsh | 4 +- examples/hero/heromodels/heromodels_group.vsh | 2 +- .../heromodels_group_add_members.vsh | 2 +- .../heromodels_group_relationships.vsh | 2 +- .../heromodels_group_with_members.vsh | 2 +- .../hero/heromodels/heromodels_project.vsh | 4 +- .../heromodels/heromodels_project_issue.vsh | 4 +- examples/hero/heromodels/heromodels_user.vsh | 2 +- .../hero/heromodels/heroserver_example.vsh | 4 +- examples/hero/herorpc/herorpc_example.vsh | 4 +- examples/hero/heroserver/heroserver.vsh | 4 +- examples/installers/cometbft.vsh | 2 +- examples/installers/conduit.vsh | 2 +- examples/installers/coredns.vsh | 4 +- examples/installers/db/meilisearch.vsh | 2 +- examples/installers/db/postgresql.vsh | 2 +- examples/installers/db/qdrant.vsh | 2 +- examples/installers/db/zerodb.vsh | 2 +- examples/installers/hero_install.vsh | 6 +- examples/installers/infra/dify.vsh | 2 +- examples/installers/infra/gitea.vsh | 2 +- examples/installers/infra/livekit.vsh | 2 +- examples/installers/infra/screen.vsh | 2 +- examples/installers/infra/zinit_installer.vsh | 2 +- examples/installers/installers.vsh | 10 +- examples/installers/lang/golang.vsh | 2 +- examples/installers/lang/nodejs.vsh | 2 +- examples/installers/lang/python.vsh | 2 +- examples/installers/lang/rust.vsh | 2 +- examples/installers/net/mycelium.vsh | 4 +- examples/installers/net/wireguard.vsh | 2 +- .../installers/sysadmintools/actrunner.vsh | 4 +- .../installers/sysadmintools/garage_s3.vsh | 2 +- examples/installers/sysadmintools/rclone.vsh | 2 +- examples/installers/threefold/griddriver.vsh | 2 +- examples/installers/traefik.vsh | 2 +- examples/installers/virt/buildah.vsh | 2 +- examples/installers/virt/dagu.vsh | 4 +- examples/installers/virt/docker.vsh | 2 +- examples/installers/virt/herocontainers.vsh | 8 +- examples/installers/virt/pacman.vsh | 2 +- examples/installers/virt/podman.vsh | 2 +- examples/installers/youki.vsh | 2 +- examples/jobs/vfs_jobs_example.vsh | 2 +- examples/lang/python/codewalker.vsh | 6 +- examples/lang/python/pythonexample.vsh | 2 +- examples/mcp/http_demo/server.vsh | 6 +- examples/mcp/http_server/server.vsh | 8 +- examples/mcp/inspector/README.md | 2 +- examples/mcp/inspector/server.vsh | 8 +- examples/mcp/simple_http/server.vsh | 8 +- examples/osal/coredns/example.vsh | 6 +- examples/osal/download/download_example.vsh | 2 +- examples/osal/notifier.vsh | 2 +- examples/osal/ping/ping_example.vsh | 2 +- examples/osal/ping/portforward.vsh | 2 +- examples/osal/process/process.v | 2 +- examples/osal/process/processmap.v | 2 +- examples/osal/rsync/rsync_example.v | 4 +- .../osal/sandbox/examples/sandbox_example.v | 2 +- examples/osal/sshagent/sshagent.vsh | 6 +- examples/osal/sshagent/sshagent_example.vsh | 6 +- examples/osal/sshagent/sshagent_example2.vsh | 4 +- examples/osal/startup_manager.vsh | 4 +- examples/osal/systemd.vsh | 2 +- examples/osal/tmux/server_dashboard.vsh | 4 +- examples/osal/tmux/tmux.vsh | 4 +- examples/osal/tmux/tmux_old.vsh | 2 +- examples/osal/tmux/tmux_pane_resize.vsh | 2 +- examples/osal/tmux/tmux_panes.vsh | 2 +- examples/osal/tmux/tmux_process_info_old.vsh | 4 +- examples/osal/tun.vsh | 2 +- examples/osal/ubuntu/ubuntu_do.vsh | 2 +- examples/osal/ufw.vsh | 2 +- examples/osal/ufw_play.vsh | 4 +- examples/osal/zinit/rpc/zinit.v | 2 +- examples/osal/zinit/simple/zinit.vsh | 2 +- examples/osal/zinit/zinit_openrpc_example.v | 2 +- examples/schemas/example/generate_model.vsh | 8 +- .../openapi/codegen/calendar_ts_client.vsh | 4 +- .../schemas/openrpc/zinit_rpc_example.vsh | 4 +- examples/sshagent/test_hero_sshagent.vsh | 2 +- examples/threefold/grid/README.md | 34 +- .../grid/deploy/create_update_deployments.vsh | 4 +- .../threefold/grid/deploy/deploy_gw_fqdn.vsh | 4 +- .../threefold/grid/deploy/deploy_gw_name.vsh | 4 +- examples/threefold/grid/deploy/deploy_vm.vsh | 4 +- .../grid/deploy/deploy_vm_high_level.vsh | 4 +- examples/threefold/grid/deploy/deploy_zdb.vsh | 4 +- .../threefold/grid/deploy/holochain_vm.vsh | 6 +- .../threefold/grid/deploy/vm_with_gw_name.vsh | 8 +- .../threefold/grid/utils/cancel_contracts.vsh | 2 +- .../threefold/grid/utils/tfgrid_config.vsh | 2 +- examples/threefold/grid/utils/zos_version.vsh | 6 +- examples/threefold/grid/zdb_example.vsh | 2 +- examples/threefold/gridproxy/bill.vsh | 4 +- examples/threefold/gridproxy/contract.vsh | 6 +- examples/threefold/gridproxy/farm.vsh | 4 +- examples/threefold/gridproxy/gateway.vsh | 4 +- examples/threefold/gridproxy/grid.vsh | 4 +- examples/threefold/gridproxy/node.vsh | 4 +- examples/threefold/gridproxy/stats.vsh | 6 +- examples/threefold/gridproxy/twin.vsh | 4 +- .../holochain/holochain_deployer.vsh | 6 +- .../threefold/holochain/holochain_vms.vsh | 4 +- .../threefold/holochain/tasker_example.vsh | 4 +- .../threefold/holochain/tasker_example2.vsh | 4 +- .../incatokens/incatokens_simulate.vsh | 4 +- examples/threefold/solana/seahorse_vm.vsh | 6 +- examples/threefold/tfgrid3deployer/filter.vsh | 2 +- .../gw_over_wireguard/gw_over_wireguard.vsh | 6 +- .../tfgrid3deployer/hetzner/hetzner.vsh | 6 +- .../open_webui_gw/open_webui_gw.vsh | 6 +- .../tfgrid3deployer/open_webui_gw/readme.md | 15 +- .../tfgrid3deployer_example.vsh | 6 +- examples/threefold/tfgrid3deployer/vm.vsh | 6 +- .../tfgrid3deployer/vm_gw_caddy/delete.vsh | 6 +- .../vm_gw_caddy/vm_gw_caddy.vsh | 6 +- examples/tools/imagemagick/example.v | 2 +- examples/ui/console/console2/console2.v | 4 +- examples/ui/console/flow1/flow1.v | 4 +- examples/ui/flow1.v | 2 +- examples/ui/silence.vsh | 4 +- examples/ui/telegram/flow1.v | 2 +- examples/vfs/vfs_db/dedupestor_vfs.vsh | 6 +- examples/vfs/vfs_db/ourdb_vfs.vsh | 4 +- examples/vfs/vfs_db/vfs_basics.vsh | 4 +- examples/virt/daguserver/dagu_server.vsh | 2 +- examples/virt/docker/ai_web_ui/ai_web_ui.vsh | 2 +- examples/virt/docker/docker_dev.vsh | 2 +- examples/virt/docker/docker_init.vsh | 2 +- examples/virt/docker/docker_registry.vsh | 2 +- examples/virt/docker/docker_ubuntu.vsh | 2 +- examples/virt/docker/presearch_docker.vsh | 2 +- examples/virt/docker/tf_dashboard.vsh | 2 +- examples/virt/heropods/heropods.vsh | 2 +- examples/virt/heropods/runcommands.vsh | 2 +- examples/virt/hetzner/hetzner_example.vsh | 10 +- examples/virt/lima/lima_example.vsh | 8 +- examples/virt/podman/podman.vsh | 6 +- examples/virt/windows/cloudhypervisor.vsh | 8 +- examples/web/doctree/doctree_client.vsh | 4 +- examples/web/doctree/doctree_export.vsh | 2 +- examples/web/doctree/markdown_example.vsh | 6 +- examples/web/docusaurus_example.vsh | 2 +- .../web/markdown_renderer/markdown_parser.vsh | 2 +- .../web/markdown_renderer/markdown_render.vsh | 6 +- examples/web/starllight_example.vsh | 4 +- examples/web/ui_demo.vsh | 2 +- examples/webdav/webdav_vfs.vsh | 6 +- generate.vsh | 2 +- install_herolib.vsh | 6 +- install_v.sh | 2 +- lib/ai/escalayer/README.md | 4 +- lib/ai/escalayer/escalayer.v | 2 +- lib/ai/escalayer/escalayer_architecture.md | 12 +- lib/ai/escalayer/models.v | 2 +- lib/ai/escalayer/openrouter.v | 4 +- lib/ai/escalayer/unit_task.v | 2 +- lib/ai/mcp/handler_logging.v | 2 +- lib/ai/mcp/mcp.v | 2 +- lib/ai/mcp/mcpgen/mcpgen.v | 8 +- lib/ai/mcp/mcpgen/mcpgen_helpers.v | 2 +- lib/ai/mcp/mcpgen/mcpgen_tools.v | 6 +- lib/ai/mcp/mcpgen/server.v | 2 +- lib/ai/mcp/vcode/cmd/main.v | 2 +- lib/ai/mcp/vcode/logic/vlang.v | 6 +- lib/ai/mcp/vcode/logic/vlang_tools.v | 6 +- lib/ai/mcp/vcode/logic/write_vfile_tool.v | 6 +- lib/ai/mcp/vcode/mcp/handlers.v | 6 +- lib/ai/mcp/vcode/mcp/mcp.v | 4 +- lib/ai/mcp/vcode/mcp/specifications.v | 6 +- lib/ai/mcp/vcode/vlang.v | 6 +- lib/ai/mcp/vcode/vlang_tools.v | 8 +- lib/ai/mcp/vcode/write_vfile_tool.v | 6 +- lib/ai/mcpcore/README.md | 4 +- lib/ai/mcpcore/cmd/mcp.v | 12 +- lib/ai/mcpcore/factory.v | 2 +- lib/ai/mcpcore/handler_initialize.v | 2 +- lib/ai/mcpcore/handler_initialize_test.v | 2 +- lib/ai/mcpcore/handler_prompts.v | 2 +- lib/ai/mcpcore/handler_resources.v | 2 +- lib/ai/mcpcore/handler_sampling.v | 2 +- lib/ai/mcpcore/handler_tools.v | 4 +- lib/ai/mcpcore/model_configuration.v | 2 +- lib/ai/mcpcore/model_configuration_test.v | 2 +- lib/ai/mcpcore/model_error.v | 2 +- lib/ai/mcpcore/server.v | 2 +- lib/biz/bizmodel/act.v | 14 +- lib/biz/bizmodel/docu/revenue.md | 14 +- lib/biz/bizmodel/export.v | 8 +- lib/biz/bizmodel/export_csv.v | 2 +- lib/biz/bizmodel/export_csv_test.vsh | 2 +- lib/biz/bizmodel/export_test.v | 2 +- lib/biz/bizmodel/factory.v | 4 +- lib/biz/bizmodel/macros.v | 8 +- lib/biz/bizmodel/model.v | 4 +- lib/biz/bizmodel/play.v | 4 +- lib/biz/bizmodel/play_cost.v | 4 +- lib/biz/bizmodel/play_costcenter.v | 4 +- lib/biz/bizmodel/play_department.v | 2 +- lib/biz/bizmodel/play_funding.v | 2 +- lib/biz/bizmodel/play_hr.v | 4 +- lib/biz/bizmodel/play_pl.v | 4 +- lib/biz/bizmodel/play_product_revenue.v | 4 +- lib/biz/bizmodel/play_product_revenue_item.v | 4 +- lib/biz/bizmodel/play_product_revenue_total.v | 2 +- lib/biz/bizmodel/play_tools.v | 4 +- lib/biz/investortool/company.v | 2 +- lib/biz/investortool/employee.v | 6 +- lib/biz/investortool/factory.v | 2 +- lib/biz/investortool/investment_share.v | 6 +- lib/biz/investortool/investor.v | 2 +- lib/biz/investortool/simulator/play.v | 4 +- lib/biz/investortool/simulator/simulator.v | 4 +- lib/biz/investortool/user.v | 2 +- lib/biz/spreadsheet/calc_test.v | 4 +- lib/biz/spreadsheet/cell.v | 2 +- lib/biz/spreadsheet/charts.v | 6 +- lib/biz/spreadsheet/charts_test.v | 6 +- .../spreadsheet/docu/charting_capabilities.md | 15 +- .../docu/data_aggregation_transformation.md | 18 +- lib/biz/spreadsheet/docu/exporting_data.md | 6 +- .../spreadsheet/docu/row_cell_operations.md | 4 +- lib/biz/spreadsheet/docu/sheet_operations.md | 4 +- lib/biz/spreadsheet/extrapolate.v | 2 +- lib/biz/spreadsheet/factory.v | 2 +- lib/biz/spreadsheet/playmacro.v | 4 +- lib/biz/spreadsheet/row.v | 4 +- lib/biz/spreadsheet/sheet.v | 6 +- lib/biz/spreadsheet/sheet_export.v | 2 +- lib/biz/spreadsheet/sheet_export_csv.v | 2 +- lib/biz/spreadsheet/sheet_getters.v | 2 +- lib/biz/spreadsheet/wiki.v | 4 +- lib/biz/spreadsheet/wiki_charts.v | 4 +- lib/builder/bootstrapper.v | 6 +- lib/builder/builder_factory.v | 2 +- lib/builder/done.v | 2 +- lib/builder/executor.v | 2 +- lib/builder/executor_crun.v | 8 +- lib/builder/executor_local.v | 6 +- lib/builder/executor_local_test.v | 2 +- lib/builder/executor_ssh.v | 12 +- lib/builder/executor_ssh_test.v | 4 +- lib/builder/heroscript.md | 6 +- lib/builder/node.v | 6 +- lib/builder/node_commands.v | 8 +- lib/builder/node_factory.v | 2 +- lib/builder/play.v | 4 +- lib/builder/portforward_lib.v | 6 +- lib/builder/readme.md | 14 +- lib/builder/this_remote.v | 6 +- .../giteaclient/giteaclient_factory_.v | 6 +- lib/clients/giteaclient/giteaclient_model.v | 6 +- lib/clients/giteaclient/methods.v | 2 +- lib/clients/giteaclient/readme.md | 37 +- lib/clients/ipapi/ipapi_factory_.v | 6 +- lib/clients/ipapi/ipapi_model.v | 4 +- lib/clients/ipapi/readme.md | 6 +- lib/clients/jina/classification_api.v | 2 +- lib/clients/jina/embeddings_api.v | 2 +- lib/clients/jina/jina_factory_.v | 6 +- lib/clients/jina/jina_model.v | 4 +- lib/clients/jina/multi_vector_api.v | 2 +- lib/clients/jina/rank_api.v | 2 +- lib/clients/jina/readme.md | 8 +- lib/clients/livekit/client_mgmt.v | 2 +- lib/clients/livekit/livekit_factory_.v | 6 +- lib/clients/livekit/livekit_model.v | 4 +- lib/clients/livekit/play.v | 6 +- lib/clients/livekit/readme.md | 5 +- lib/clients/livekit/room_test.v | 2 +- lib/clients/mailclient/client.v | 2 +- lib/clients/mailclient/mailclient_factory_.v | 6 +- lib/clients/mailclient/mailclient_model.v | 2 +- lib/clients/mailclient/readme.md | 8 +- lib/clients/meilisearch/client.v | 2 +- lib/clients/meilisearch/documents.v | 2 +- .../meilisearch/meilisearch_factory_.v | 6 +- lib/clients/meilisearch/meilisearch_model.v | 4 +- lib/clients/meilisearch/readme.md | 5 +- lib/clients/mycelium/mycelium.v | 2 +- lib/clients/mycelium/mycelium_check.v | 4 +- lib/clients/mycelium/mycelium_factory_.v | 4 +- lib/clients/mycelium/mycelium_model.v | 4 +- lib/clients/mycelium/readme.md | 9 +- lib/clients/mycelium_rpc/mycelium_rpc.v | 4 +- .../mycelium_rpc/mycelium_rpc_factory_.v | 6 +- lib/clients/mycelium_rpc/mycelium_rpc_model.v | 4 +- lib/clients/mycelium_rpc/readme.md | 10 +- lib/clients/openai/audio/README.md | 3 +- lib/clients/openai/audio/audio.v | 4 +- lib/clients/openai/audio/audio_test.v | 2 +- lib/clients/openai/embeddings/README.md | 4 +- lib/clients/openai/embeddings/embeddings.v | 2 +- .../openai/embeddings/embeddings_test.v | 2 +- lib/clients/openai/files/README.md | 4 +- lib/clients/openai/files/files.v | 4 +- lib/clients/openai/finetune/README.md | 5 +- lib/clients/openai/finetune/fine_tunes.v | 4 +- lib/clients/openai/images/README.md | 4 +- lib/clients/openai/images/images.v | 4 +- lib/clients/openai/moderation/README.md | 4 +- lib/clients/openai/moderation/moderation.v | 2 +- lib/clients/openai/openai_factory_.v | 6 +- lib/clients/openai/openai_model.v | 4 +- lib/clients/openai/readme.md | 12 +- lib/clients/postgresql_client/cmds.v | 6 +- .../postgresql_client_factory_.v | 6 +- .../postgresql_client_model.v | 6 +- lib/clients/postgresql_client/readme.md | 32 +- lib/clients/qdrant/collections.v | 2 +- lib/clients/qdrant/points.v | 2 +- lib/clients/qdrant/qdrant_client.v | 2 +- lib/clients/qdrant/qdrant_factory_.v | 6 +- lib/clients/qdrant/qdrant_model.v | 4 +- lib/clients/qdrant/readme.md | 2 +- lib/clients/rclone/config.v | 4 +- lib/clients/rclone/rclone_factory_.v | 6 +- lib/clients/rclone/rclone_model.v | 4 +- lib/clients/rclone/readme.md | 36 +- lib/clients/rclone/readme.v.md | 4 +- lib/clients/runpod/readme.md | 7 +- lib/clients/runpod/runpod_factory_.v | 6 +- lib/clients/runpod/runpod_http.v | 2 +- lib/clients/runpod/runpod_model.v | 2 +- lib/clients/runpod/utils.v | 2 +- lib/clients/sendgrid/sendgrid_factory_.v | 6 +- lib/clients/sendgrid/sendgrid_model.v | 2 +- lib/clients/traefik/factory.v | 6 +- lib/clients/traefik/manager.v | 6 +- lib/clients/traefik/play.v | 6 +- lib/clients/vastai/readme.md | 6 +- lib/clients/vastai/vastai_factory_.v | 6 +- lib/clients/vastai/vastai_model.v | 4 +- lib/clients/wireguard/readme.md | 6 +- lib/clients/wireguard/wireguard_factory_.v | 6 +- lib/clients/wireguard/wireguard_model.v | 2 +- lib/clients/zerodb_client/zdb.v | 4 +- .../zerodb_client/zerodb_client_factory_.v | 6 +- .../zerodb_client/zerodb_client_model.v | 2 +- lib/clients/zinit/README.md | 14 +- lib/clients/zinit/zinit.v | 4 +- lib/clients/zinit/zinit_factory_.v | 6 +- lib/clients/zinit/zinit_model.v | 4 +- lib/conversiontools/docsorter/docsorter.v | 4 +- lib/conversiontools/docsorter/readme.md | 6 +- .../docsorter/slides_process.v | 2 +- lib/conversiontools/imagemagick/image.v | 2 +- .../imagemagick/image_downsize.v | 6 +- .../imagemagick/image_downsize_test.v | 6 +- .../imagemagick/image_identify.v | 4 +- .../imagemagick/image_identify_test.v | 6 +- lib/conversiontools/imagemagick/image_test.v | 4 +- lib/conversiontools/imagemagick/imagemagick.v | 8 +- lib/conversiontools/imagemagick/readme.md | 4 +- lib/conversiontools/pdftotext/main.v | 2 +- lib/conversiontools/text_extractor/main.v | 2 +- lib/core/base/context.v | 6 +- lib/core/base/context_session.v | 4 +- lib/core/base/factory_context.v | 2 +- lib/core/base/session.v | 14 +- lib/core/base/session_error.v | 4 +- lib/core/base/session_logger.v | 2 +- lib/core/code/folder.v | 2 +- lib/core/code/improvements.md | 23 +- lib/core/code/model_file.v | 4 +- lib/core/code/model_file_test.v | 4 +- lib/core/code/model_folder.v | 2 +- lib/core/code/model_function.v | 2 +- lib/core/code/model_module.v | 4 +- lib/core/code/model_param.v | 2 +- lib/core/code/model_struct.v | 2 +- lib/core/code/vlang_utils.v | 6 +- lib/core/generator/generic/generate.v | 4 +- .../generic/generate_installer_client.v | 6 +- lib/core/generator/generic/model.v | 8 +- lib/core/generator/generic/readme.md | 4 +- lib/core/generator/generic/scanner.v | 4 +- .../templates/objname_actions.vtemplate | 20 +- .../templates/objname_factory_.vtemplate | 8 +- .../generic/templates/objname_model.vtemplate | 4 +- .../generator/generic/templates/readme.md | 14 +- lib/core/herocmds/bootstrap.v | 8 +- lib/core/herocmds/docsorter.v | 4 +- lib/core/herocmds/docusaurus.v | 8 +- lib/core/herocmds/generator.v | 2 +- lib/core/herocmds/git.v | 6 +- lib/core/herocmds/imagedownsize.v | 4 +- lib/core/herocmds/init.v | 8 +- lib/core/herocmds/installers.v | 4 +- lib/core/herocmds/luadns.v | 4 +- lib/core/herocmds/playbook_lib.v | 14 +- lib/core/herocmds/sshagent.v | 6 +- lib/core/herocmds/tofix.md | 43 +- lib/core/herocmds/web.v | 4 +- lib/core/httpconnection/connection.v | 2 +- lib/core/httpconnection/connection_methods.v | 4 +- lib/core/httpconnection/factory.v | 2 +- lib/core/httpconnection/readme.md | 24 +- lib/core/logger/factory.v | 2 +- lib/core/logger/log.v | 6 +- lib/core/logger/log_test.v | 4 +- lib/core/logger/model.v | 4 +- lib/core/logger/readme.md | 4 +- lib/core/logger/search.v | 4 +- lib/core/pathlib/path.v | 2 +- lib/core/pathlib/path_backup.v | 2 +- lib/core/pathlib/path_link.v | 2 +- lib/core/pathlib/path_link_test.v | 4 +- lib/core/pathlib/path_list.v | 4 +- lib/core/pathlib/path_list_test.v | 4 +- lib/core/pathlib/path_rsync.v | 2 +- lib/core/pathlib/path_scanner.v | 2 +- lib/core/pathlib/path_sid.v | 2 +- lib/core/pathlib/path_subgetters.v | 2 +- lib/core/pathlib/path_tools.v | 4 +- lib/core/pathlib/path_tools_test.v | 4 +- lib/core/pathlib/readme.md | 4 +- lib/core/pathlib/template.v | 4 +- lib/core/platform.v | 2 +- lib/core/playbook/action.v | 6 +- lib/core/playbook/factory.v | 2 +- lib/core/playbook/find.v | 4 +- lib/core/playbook/playbook.v | 6 +- lib/core/playbook/playbook_add.v | 8 +- lib/core/playbook/playbook_include.v | 2 +- lib/core/playbook/playbook_test.v | 2 +- lib/core/playbook/readme.md | 14 +- lib/core/playcmds/factory.v | 26 +- lib/core/playcmds/play_core.v | 8 +- lib/core/playcmds/play_git.v | 6 +- lib/core/playcmds/play_luadns.v | 4 +- lib/core/playcmds/play_osal_core.v | 6 +- lib/core/playcmds/play_ssh.v | 8 +- lib/core/playcmds/readme.md | 8 +- lib/core/playmacros/playmacros.v | 12 +- lib/core/readme.md | 12 +- lib/core/redisclient/readme.md | 5 +- lib/core/redisclient/rediscache.v | 2 +- lib/core/redisclient/redisclient_cmd.v | 2 +- lib/core/redisclient/redisclient_commands.v | 2 +- lib/core/redisclient/redisclient_encode.v | 2 +- lib/core/redisclient/redisclient_internal.v | 2 +- lib/core/redisclient/redisclient_sadd_test.v | 2 +- lib/core/redisclient/redisclient_send.v | 4 +- lib/core/redisclient/redisclient_test.v | 4 +- lib/core/redisclient/rpc_test.v | 4 +- lib/core/rootpath/README.md | 5 +- lib/core/texttools/regext/readme.md | 12 +- lib/core/texttools/regext/regexreplacer.v | 4 +- .../texttools/regext/regexreplacer_test.v | 2 +- lib/core/vexecutor/execute_large.v | 2 +- lib/core/vexecutor/vexecutor.v | 4 +- lib/crypt/crpgp/types.v | 2 +- lib/crypt/herocrypt/herocrypt.v | 2 +- lib/crypt/herocrypt/readme.md | 17 +- lib/crypt/openssl/generate.v | 2 +- lib/crypt/openssl/generate_ca.v | 2 +- lib/crypt/openssl/get.v | 2 +- lib/crypt/openssl/openssl.v | 2 +- lib/crypt/pgp/pgp.v | 2 +- lib/crypt/pgp/pgp_cmds.v | 2 +- lib/crypt/pgp/pgp_instance.v | 2 +- lib/crypt/pgp/pgp_model.v | 2 +- lib/crypt/secrets/encrypt_decrypt.v | 6 +- lib/crypt/secrets/factory.v | 2 +- lib/crypt/secrets/readme.md | 5 +- lib/crypt/secrets/secrets.v | 6 +- lib/crypt/secrets/secrets_test.v | 2 +- lib/data/cache/README.md | 6 +- lib/data/countries/README.md | 6 +- lib/data/currency/currency_test.v | 2 +- lib/data/currency/rates.v | 2 +- lib/data/currency/readme.md | 3 +- lib/data/currency/serialize.v | 2 +- lib/data/dbfs/core.v | 2 +- lib/data/dbfs/db.v | 10 +- lib/data/dbfs/dbcollection.v | 8 +- lib/data/dbfs/dbfs_test.v | 2 +- lib/data/dbfs/factory.v | 4 +- lib/data/dbfs/namedb.v | 4 +- lib/data/dbfs/namedb_test.v | 6 +- lib/data/dbfs/readme.md | 11 +- lib/data/dbfs/sid.v | 2 +- lib/data/dedupestor/dedupe_ourdb/README.md | 11 +- lib/data/dedupestor/dedupe_ourdb/dedupestor.v | 6 +- .../dedupestor/dedupe_ourdb/dedupestor_test.v | 2 +- lib/data/doctree/README.md | 24 +- lib/data/doctree/collection/collection.v | 6 +- lib/data/doctree/collection/data/error.v | 2 +- lib/data/doctree/collection/data/file.v | 2 +- lib/data/doctree/collection/data/page.v | 6 +- .../doctree/collection/data/process_aliases.v | 4 +- .../collection/data/process_aliases_test.v | 2 +- .../data/process_def_pointers_test.v | 2 +- .../doctree/collection/data/process_link.v | 10 +- .../collection/data/process_link_test.v | 2 +- .../doctree/collection/data/process_macros.v | 4 +- lib/data/doctree/collection/error.v | 6 +- lib/data/doctree/collection/export.v | 10 +- lib/data/doctree/collection/export_test.v | 2 +- lib/data/doctree/collection/getters.v | 2 +- lib/data/doctree/collection/scan.v | 8 +- lib/data/doctree/collection/scan_test.v | 2 +- lib/data/doctree/error.v | 2 +- lib/data/doctree/export.v | 8 +- lib/data/doctree/export_test.v | 2 +- lib/data/doctree/getters.v | 6 +- lib/data/doctree/getters_test.v | 2 +- lib/data/doctree/list.v | 2 +- lib/data/doctree/play.v | 4 +- lib/data/doctree/pointer/pointer.v | 2 +- lib/data/doctree/pointer/pointer_test.v | 6 +- lib/data/doctree/process_defs.v | 6 +- lib/data/doctree/process_defs_test.v | 4 +- lib/data/doctree/process_includes.v | 12 +- lib/data/doctree/process_includes_test.v | 2 +- lib/data/doctree/process_macros.v | 10 +- lib/data/doctree/scan.v | 12 +- lib/data/doctree/tree.v | 8 +- lib/data/doctree/tree_test.v | 6 +- lib/data/encoder/encoder_decode.v | 6 +- lib/data/encoder/encoder_encode.v | 6 +- lib/data/encoder/encoder_test.v | 6 +- lib/data/encoder/readme.md | 25 +- lib/data/encoderhero/decoder.v | 2 +- lib/data/encoderhero/decoder_test.v | 4 +- lib/data/encoderhero/encoder.v | 6 +- .../encoderhero/encoder_ignorepropery_test.v | 2 +- lib/data/encoderhero/encoder_test.v | 4 +- lib/data/encoderhero/readme.md | 11 +- lib/data/gid/gid.v | 2 +- lib/data/graphdb/README.md | 4 +- lib/data/graphdb/graphdb.v | 4 +- lib/data/graphdb/serialization.v | 2 +- lib/data/ipaddress/ipaddress.v | 4 +- lib/data/location/db.v | 6 +- lib/data/location/factory.v | 2 +- lib/data/location/importer.v | 6 +- lib/data/markdown/action_test.v | 8 +- lib/data/markdown/elements/base.v | 12 +- lib/data/markdown/elements/char_parser_test.v | 2 +- lib/data/markdown/elements/doc.v | 2 +- lib/data/markdown/elements/element_action.v | 2 +- .../markdown/elements/element_codeblock.v | 2 +- lib/data/markdown/elements/element_empty.v | 2 +- lib/data/markdown/elements/element_link.v | 4 +- .../markdown/elements/element_paragraph.v | 2 +- lib/data/markdown/elements/element_table.v | 2 +- .../markdown/elements/interface_element.v | 4 +- lib/data/markdown/elements/parser_char.v | 2 +- lib/data/markdown/elements/parser_paragraph.v | 4 +- lib/data/markdown/factory.v | 6 +- lib/data/markdown/frontmatter_remove_test.v | 4 +- lib/data/markdown/link_def_test.v | 4 +- lib/data/markdown/link_test.v | 4 +- lib/data/markdown/list_test.v | 2 +- lib/data/markdown/markdown_test.v | 8 +- lib/data/markdown/parsers/parse_doc.v | 4 +- lib/data/markdown/parsers/parser_line.v | 2 +- lib/data/markdown/table_test.v | 2 +- lib/data/markdown/tools/min_header_test.v | 2 +- lib/data/markdownrenderer/readme.md | 6 +- lib/data/mnemonic/vnemonic.v | 2 +- lib/data/models/hr/company.v | 4 +- lib/data/models/hr/country.v | 4 +- lib/data/models/hr/hr.v | 2 +- lib/data/models/hr/person.v | 4 +- lib/data/ourdb/README.md | 10 +- lib/data/ourdb/client.v | 4 +- lib/data/ourdb_syncer/streamer/nodes.v | 6 +- lib/data/ourdb_syncer/streamer/streamer.v | 4 +- lib/data/ourjson/ourjson.v | 2 +- lib/data/ourtime/ourtime.v | 2 +- lib/data/ourtime/readme.md | 5 +- lib/data/ourtime/timetools_test.v | 2 +- lib/data/paramsparser/jsonschema.v | 2 +- lib/data/paramsparser/params_currency.v | 2 +- lib/data/paramsparser/params_export_import.v | 4 +- lib/data/paramsparser/params_export_test.v | 2 +- lib/data/paramsparser/params_get_kwargs.v | 2 +- lib/data/paramsparser/params_getlist.v | 2 +- lib/data/paramsparser/params_gettime.v | 4 +- lib/data/paramsparser/params_gettime_test.v | 2 +- lib/data/paramsparser/params_reflection.v | 4 +- lib/data/paramsparser/params_replace.v | 6 +- lib/data/paramsparser/params_resp.v | 2 +- lib/data/paramsparser/params_test.v | 4 +- lib/data/paramsparser/parser.v | 2 +- lib/data/paramsparser/readme.md | 50 +- lib/data/radixtree/README.md | 15 +- lib/data/radixtree/correctness_test.v | 2 +- lib/data/radixtree/debug_deletion_test.v | 2 +- lib/data/radixtree/debug_test.v | 2 +- lib/data/radixtree/factory_test.v | 2 +- lib/data/radixtree/getall_test.v | 2 +- lib/data/radixtree/prefix_test.v | 2 +- lib/data/radixtree/radixtree.v | 4 +- lib/data/radixtree/radixtree_debug.v | 2 +- lib/data/radixtree/serialize.v | 2 +- lib/data/resp/resp_test.v | 2 +- lib/data/tst/serialize.v | 2 +- lib/data/tst/tst.v | 2 +- lib/data/tst/tst_list.v | 2 +- lib/data/verasure/README.md | 14 +- lib/data/verasure/verasure.v | 2 +- lib/data/vstor/file.v | 2 +- lib/data/vstor/location.v | 2 +- lib/data/vstor/vstor.v | 2 +- lib/data/vstor/zdb.v | 2 +- lib/data/vstor/zdbstats.v | 2 +- lib/dav/webdav/README.md | 2 +- lib/dav/webdav/bin/main.v | 2 +- lib/dav/webdav/factory.v | 4 +- lib/dav/webdav/factory_test.v | 6 +- lib/dav/webdav/middleware_auth.v | 2 +- lib/dav/webdav/middleware_headers.v | 2 +- lib/dav/webdav/middleware_log.v | 2 +- lib/dav/webdav/model_propfind.v | 6 +- lib/dav/webdav/server.v | 4 +- lib/dav/webdav/server_propfind.v | 8 +- lib/dav/webdav/server_test.v | 4 +- lib/develop/codetools/readme.md | 14 +- lib/develop/codetools/vtest.v | 4 +- lib/develop/codetools/vvet.v | 2 +- lib/develop/codewalker/README.md | 2 +- lib/develop/codewalker/codewalker.v | 2 +- lib/develop/codewalker/codewalker_test.v | 2 +- lib/develop/codewalker/filemap.v | 2 +- lib/develop/gittools/README.md | 106 +- lib/develop/gittools/factory.v | 4 +- lib/develop/gittools/gitlocation.v | 2 +- lib/develop/gittools/gitlocation_test.v | 2 +- lib/develop/gittools/gitstructure.v | 4 +- lib/develop/gittools/gittools_do.v | 6 +- lib/develop/gittools/repos_get.v | 4 +- lib/develop/gittools/repos_print.v | 2 +- lib/develop/gittools/repository.v | 4 +- lib/develop/gittools/repository_cache.v | 2 +- lib/develop/gittools/repository_clone.v | 4 +- lib/develop/gittools/repository_load.v | 2 +- lib/develop/gittools/repository_utils.v | 8 +- lib/develop/gittools/tests/gittools_test.v | 4 +- lib/develop/gittools/tests/setup.v | 4 +- lib/develop/heroprompt/heroprompt_child.v | 2 +- lib/develop/heroprompt/heroprompt_factory_.v | 6 +- lib/develop/heroprompt/heroprompt_model.v | 2 +- lib/develop/heroprompt/heroprompt_workspace.v | 4 +- lib/develop/heroprompt/readme.md | 2 +- lib/develop/luadns/factory.v | 2 +- lib/develop/luadns/luadns.v | 4 +- lib/develop/luadns/parse.v | 2 +- lib/develop/performance/README.md | 7 +- lib/develop/performance/performance.v | 2 +- lib/develop/sourcetree/readme.md | 4 +- lib/develop/sourcetree/sourcetree.v | 4 +- lib/develop/vscode/readme.md | 4 +- lib/develop/vscode/vscode.v | 2 +- lib/develop/vscode_extensions/ourdb/README.md | 13 +- lib/hero/crypt/age.v | 2 +- lib/hero/crypt/factory.v | 2 +- lib/hero/crypt/readme.md | 10 +- lib/hero/db/ai_instructions_hero_models.md | 124 +- lib/hero/db/core_methods.v | 8 +- lib/hero/db/factory.v | 6 +- lib/hero/herocluster/example/example.vsh | 6 +- lib/hero/herocluster/factory.v | 2 +- lib/hero/herofs/README.md | 41 +- lib/hero/herofs/factory.v | 4 +- lib/hero/herofs/fs.v | 14 +- lib/hero/herofs/fs_blob.v | 10 +- lib/hero/herofs/fs_blob_membership.v | 12 +- lib/hero/herofs/fs_blob_membership_test.v | 2 +- lib/hero/herofs/fs_blob_test.v | 12 +- lib/hero/herofs/fs_dir.v | 12 +- lib/hero/herofs/fs_dir_test.v | 47 +- lib/hero/herofs/fs_file.v | 12 +- lib/hero/herofs/fs_file_directory_test.v | 2 +- lib/hero/herofs/fs_file_test.v | 202 +- lib/hero/herofs/fs_symlink.v | 12 +- lib/hero/herofs/fs_test.v | 34 +- lib/hero/herofs/fs_tools_cp.v | 300 +- lib/hero/herofs/fs_tools_cp_test.v | 144 +- lib/hero/herofs/fs_tools_find_test.v | 18 +- lib/hero/herofs/fs_tools_import_export.v | 2 +- lib/hero/herofs_server/README.md | 2 +- .../herofs_server/handlers_blob_symlink.v | 2 +- lib/hero/herofs_server/handlers_directory.v | 2 +- lib/hero/herofs_server/handlers_file.v | 2 +- lib/hero/herofs_server/handlers_filesystem.v | 2 +- lib/hero/herofs_server/handlers_tools.v | 2 +- lib/hero/herofs_server/middlewares.v | 2 +- lib/hero/herofs_server/server.v | 8 +- .../herofs_server/typescript_client/README.md | 2 +- .../typescript_client/package.json | 6 +- lib/hero/heromodels/calendar.v | 12 +- lib/hero/heromodels/calendar_event.v | 10 +- lib/hero/heromodels/calendar_event_test.v | 25 +- lib/hero/heromodels/chat_group.v | 10 +- lib/hero/heromodels/chat_group_test.v | 16 +- lib/hero/heromodels/chat_message.v | 10 +- lib/hero/heromodels/contact.v | 10 +- lib/hero/heromodels/factory.v | 12 +- lib/hero/heromodels/factory_server.v | 4 +- lib/hero/heromodels/group.v | 10 +- lib/hero/heromodels/group_test.v | 52 +- lib/hero/heromodels/location.v | 6 +- lib/hero/heromodels/message.v | 10 +- lib/hero/heromodels/message_test.v | 2 +- lib/hero/heromodels/planning.v | 10 +- lib/hero/heromodels/planning_test.v | 22 +- lib/hero/heromodels/profile.v | 10 +- lib/hero/heromodels/project.v | 10 +- lib/hero/heromodels/project_issue.v | 10 +- lib/hero/heromodels/registration_desk.v | 10 +- lib/hero/heromodels/registration_desk_test.v | 292 +- lib/hero/heromodels/tags.v | 6 +- lib/hero/heromodels/user.v | 10 +- lib/hero/heroserver/api_handler.v | 2 +- lib/hero/heroserver/doc_handler.v | 6 +- lib/hero/heroserver/doc_model.v | 4 +- lib/hero/heroserver/factory.v | 10 +- lib/hero/heroserver/model.v | 8 +- lib/hero/heroserver/readme.md | 4 +- lib/hero/heroserver/templates/home.html | 2 +- lib/hero/typescriptgenerator/generate.vsh | 4 +- lib/hero/typescriptgenerator/generator.v | 43 +- lib/hero/typescriptgenerator/generator_test.v | 49 +- .../typescriptgenerator/intermediate_model.v | 117 +- lib/installers/base/installer.v | 6 +- lib/installers/base/play.v | 4 +- lib/installers/base/redis.v | 10 +- lib/installers/db/cometbft/cometbft_actions.v | 20 +- .../db/cometbft/cometbft_factory_.v | 8 +- lib/installers/db/cometbft/cometbft_model.v | 4 +- lib/installers/db/cometbft/readme.md | 6 +- .../meilisearch_installer_actions.v | 12 +- .../meilisearch_installer_factory_.v | 8 +- .../meilisearch_installer_model.v | 2 +- .../db/meilisearch_installer/readme.md | 6 +- .../db/postgresql/postgresql_actions.v | 10 +- .../db/postgresql/postgresql_factory_.v | 8 +- .../db/postgresql/postgresql_model.v | 2 +- lib/installers/db/postgresql/readme.md | 7 +- .../qdrant_installer_actions.v | 6 +- .../qdrant_installer_factory_.v | 8 +- .../qdrant_installer/qdrant_installer_model.v | 4 +- lib/installers/db/qdrant_installer/readme.md | 2 +- lib/installers/db/zerodb/zerodb_actions.v | 18 +- lib/installers/db/zerodb/zerodb_factory_.v | 8 +- lib/installers/db/zerodb/zerodb_model.v | 4 +- lib/installers/db/zerofs/rfs.v | 10 +- lib/installers/db/zerofs/zerofs_actions.v | 20 +- lib/installers/db/zerofs/zerofs_factory_.v | 6 +- lib/installers/db/zerofs/zerofs_model.v | 2 +- lib/installers/develapps/chrome/chrome.v | 6 +- lib/installers/develapps/vscode/vscode.v | 6 +- .../infra/coredns/coredns_actions.v | 20 +- .../infra/coredns/coredns_configure.v | 6 +- .../infra/coredns/coredns_factory_.v | 8 +- lib/installers/infra/coredns/coredns_fix.v | 2 +- lib/installers/infra/coredns/coredns_model.v | 4 +- lib/installers/infra/gitea/gitea_actions.v | 12 +- lib/installers/infra/gitea/gitea_factory_.v | 8 +- lib/installers/infra/gitea/gitea_model.v | 14 +- lib/installers/infra/gitea/play.v | 6 +- .../infra/livekit/livekit_actions.v | 10 +- .../infra/livekit/livekit_factory_.v | 8 +- lib/installers/infra/livekit/livekit_model.v | 6 +- .../zinit_installer/zinit_installer_actions.v | 18 +- .../zinit_installer_factory_.v | 6 +- .../zinit_installer/zinit_installer_model.v | 2 +- lib/installers/install_multi.v | 50 +- lib/installers/lang/golang/golang_actions.v | 12 +- lib/installers/lang/golang/golang_factory_.v | 6 +- lib/installers/lang/golang/golang_model.v | 2 +- lib/installers/lang/golang/readme.md | 5 +- lib/installers/lang/herolib/herolib.v | 16 +- lib/installers/lang/herolib/play.v | 4 +- lib/installers/lang/nodejs/nodejs_actions.v | 4 +- lib/installers/lang/nodejs/nodejs_factory_.v | 6 +- lib/installers/lang/nodejs/nodejs_model.v | 2 +- lib/installers/lang/nodejs/readme.md | 6 +- lib/installers/lang/python/python_actions.v | 12 +- lib/installers/lang/python/python_factory_.v | 6 +- lib/installers/lang/python/python_model.v | 2 +- lib/installers/lang/python/readme.md | 6 +- lib/installers/lang/rust/readme.md | 6 +- lib/installers/lang/rust/rust_actions.v | 14 +- lib/installers/lang/rust/rust_factory_.v | 6 +- lib/installers/lang/rust/rust_model.v | 4 +- lib/installers/lang/vlang/play.v | 4 +- lib/installers/lang/vlang/v-analyzer.v | 10 +- lib/installers/lang/vlang/vlang.v | 14 +- .../mycelium_installer_actions.v | 20 +- .../mycelium_installer_factory_.v | 8 +- .../mycelium_installer_model.v | 4 +- .../net/wireguard_installer/readme.md | 6 +- .../wireguard_installer_actions.v | 8 +- .../wireguard_installer_factory_.v | 6 +- .../wireguard_installer_model.v | 2 +- lib/installers/net/yggdrasil/readme.md | 6 +- lib/installers/net/yggdrasil/ygg.v | 12 +- .../net/yggdrasil/yggdrasil_actions.v | 20 +- .../net/yggdrasil/yggdrasil_factory_.v | 6 +- .../net/yggdrasil/yggdrasil_model.v | 2 +- .../actrunner/actrunner_actions.v | 12 +- .../actrunner/actrunner_factory_.v | 6 +- .../sysadmintools/actrunner/actrunner_model.v | 2 +- lib/installers/sysadmintools/b2/b2_actions.v | 8 +- lib/installers/sysadmintools/b2/b2_factory_.v | 6 +- lib/installers/sysadmintools/b2/b2_model.v | 2 +- lib/installers/sysadmintools/b2/readme.md | 6 +- .../sysadmintools/fungistor/fungistor.v | 8 +- .../fungistor/fungistor_actions.v | 20 +- .../fungistor/fungistor_factory_.v | 6 +- .../sysadmintools/fungistor/fungistor_model.v | 2 +- .../sysadmintools/fungistor/readme.md | 6 +- .../garage_s3/garage_s3_actions.v | 16 +- .../garage_s3/garage_s3_factory_.v | 8 +- .../sysadmintools/garage_s3/garage_s3_model.v | 6 +- .../sysadmintools/garage_s3/readme.md | 7 +- .../sysadmintools/grafana/grafana.v | 14 +- .../sysadmintools/grafana/grafana_actions.v | 20 +- .../sysadmintools/grafana/grafana_factory_.v | 6 +- .../sysadmintools/grafana/grafana_model.v | 2 +- .../sysadmintools/grafana/readme.md | 6 +- .../prometheus/alertmanager_installer.v | 14 +- .../prometheus/blackbox_exporter.v | 12 +- .../sysadmintools/prometheus/node_exporter.v | 14 +- .../sysadmintools/prometheus/prom2json.v | 14 +- .../prometheus/prometheus_actions.v | 20 +- .../prometheus/prometheus_factory_.v | 6 +- .../prometheus/prometheus_installer.v | 12 +- .../prometheus/prometheus_installer_factory.v | 12 +- .../prometheus/prometheus_model.v | 2 +- .../sysadmintools/rclone/rclone_actions.v | 10 +- .../sysadmintools/rclone/rclone_factory_.v | 8 +- .../sysadmintools/rclone/rclone_model.v | 4 +- lib/installers/sysadmintools/rclone/readme.md | 7 +- lib/installers/sysadmintools/restic/builder.v | 10 +- lib/installers/sysadmintools/restic/readme.md | 6 +- .../sysadmintools/restic/restic_actions.v | 20 +- .../sysadmintools/restic/restic_factory_.v | 6 +- .../sysadmintools/restic/restic_install.v | 6 +- .../sysadmintools/restic/restic_model.v | 2 +- lib/installers/sysadmintools/s3/builder.v | 8 +- lib/installers/sysadmintools/s3/s3.v | 10 +- lib/installers/sysadmintools/s3/s3_actions.v | 20 +- lib/installers/sysadmintools/s3/s3_factory_.v | 6 +- lib/installers/sysadmintools/s3/s3_model.v | 2 +- lib/installers/sysadmintools/s3/server.v | 10 +- .../threefold/griddriver/griddriver_actions.v | 10 +- .../griddriver/griddriver_factory_.v | 6 +- .../threefold/griddriver/griddriver_model.v | 2 +- lib/installers/threefold/griddriver/readme.md | 6 +- lib/installers/threefold/tfrobot/tfrobot.v | 12 +- lib/installers/ulist/ulist.v | 4 +- lib/installers/upload.v | 4 +- .../cloudhypervisor/cloudhypervisor_actions.v | 12 +- .../cloudhypervisor_factory_.v | 6 +- .../cloudhypervisor/cloudhypervisor_model.v | 2 +- lib/installers/virt/cloudhypervisor/readme.md | 6 +- lib/installers/virt/docker/docker_actions.v | 10 +- lib/installers/virt/docker/docker_factory_.v | 6 +- lib/installers/virt/docker/readme.md | 4 +- .../virt/herorunner/herorunner_actions.v | 10 +- .../virt/herorunner/herorunner_factory_.v | 6 +- .../virt/herorunner/herorunner_model.v | 4 +- lib/installers/virt/herorunner/readme.md | 6 +- lib/installers/virt/lima/lima_actions.v | 16 +- lib/installers/virt/lima/lima_factory_.v | 8 +- lib/installers/virt/lima/lima_model.v | 4 +- lib/installers/virt/lima/readme.md | 4 +- lib/installers/virt/pacman/pacman_actions.v | 6 +- lib/installers/virt/pacman/pacman_factory_.v | 6 +- lib/installers/virt/pacman/pacman_model.v | 2 +- lib/installers/virt/pacman/readme.md | 6 +- lib/installers/virt/podman/podman_actions.v | 10 +- lib/installers/virt/podman/podman_factory_.v | 6 +- lib/installers/virt/podman/podman_model.v | 4 +- lib/installers/virt/podman/readme.md | 3 +- lib/installers/virt/qemu/qemu_install.v | 10 +- lib/installers/virt/youki/readme.md | 6 +- lib/installers/virt/youki/youki_actions.v | 18 +- lib/installers/virt/youki/youki_factory_.v | 6 +- lib/installers/virt/youki/youki_model.v | 2 +- lib/installers/web/bun/bun_actions.v | 10 +- lib/installers/web/bun/bun_factory_.v | 6 +- lib/installers/web/bun/bun_model.v | 2 +- lib/installers/web/bun/readme.md | 6 +- lib/installers/web/imagemagick/imagemagick.v | 4 +- .../web/imagemagick/imagemagick_actions.v | 20 +- .../web/imagemagick/imagemagick_factory_.v | 6 +- .../web/imagemagick/imagemagick_model.v | 2 +- lib/installers/web/imagemagick/readme.md | 6 +- lib/installers/web/lighttpd/installer.v | 16 +- .../web/lighttpd/lighttpd_actions.v | 20 +- .../web/lighttpd/lighttpd_factory_.v | 6 +- lib/installers/web/lighttpd/lighttpd_model.v | 2 +- lib/installers/web/tailwind/readme.md | 7 +- .../web/tailwind/tailwind_actions.v | 10 +- .../web/tailwind/tailwind_factory_.v | 6 +- lib/installers/web/tailwind/tailwind_model.v | 2 +- lib/installers/web/tailwind4/readme.md | 7 +- .../web/tailwind4/tailwind4_actions.v | 10 +- .../web/tailwind4/tailwind4_factory_.v | 6 +- .../web/tailwind4/tailwind4_model.v | 2 +- lib/installers/web/traefik/readme.md | 5 +- lib/installers/web/traefik/traefik_actions.v | 12 +- lib/installers/web/traefik/traefik_factory_.v | 8 +- lib/installers/web/traefik/traefik_model.v | 8 +- lib/installers/web/zola/readme.md | 7 +- lib/installers/web/zola/zola_actions.v | 14 +- lib/installers/web/zola/zola_factory_.v | 6 +- lib/installers/web/zola/zola_model.v | 2 +- lib/lang/python/MIGRATION.md | 28 +- lib/lang/python/freeze.v | 4 +- lib/lang/python/pyexec.v | 10 +- lib/lang/python/python.v | 8 +- lib/lang/python/python_test.v | 2 +- lib/lang/python/readme.md | 6 +- lib/lang/python/shell.v | 4 +- lib/lang/python/templates.v | 4 +- lib/lang/rust/rust.v | 2 +- lib/lang/rust/rust_test.v | 2 +- lib/osal/core/cmds.v | 10 +- lib/osal/core/done.v | 6 +- lib/osal/core/downloader.v | 6 +- lib/osal/core/env.v | 2 +- lib/osal/core/exec.v | 6 +- lib/osal/core/exec_to_scriptpath.v | 6 +- lib/osal/core/file.v | 6 +- lib/osal/core/net.v | 4 +- lib/osal/core/package.v | 6 +- lib/osal/core/package_test.v | 2 +- lib/osal/core/ps_tool.v | 2 +- lib/osal/core/readme.md | 169 +- lib/osal/core/ssh_key.v | 2 +- lib/osal/core/users.v | 4 +- lib/osal/coredns/README.md | 21 +- lib/osal/coredns/model.v | 2 +- lib/osal/coredns/play.v | 2 +- lib/osal/coredns/populator.v | 2 +- lib/osal/hostsfile/README.md | 2 +- lib/osal/hostsfile/hostsfile.v | 2 +- lib/osal/linux/play.v | 2 +- lib/osal/linux/user_mgmt.v | 4 +- lib/osal/notifier/readme.md | 2 +- lib/osal/osinstaller/diskmgmt.v | 2 +- lib/osal/osinstaller/factory.v | 2 +- lib/osal/rsync/rsync.v | 6 +- lib/osal/rsync/usermgmt.v | 2 +- lib/osal/screen/factory.v | 10 +- lib/osal/screen/readme.md | 2 +- lib/osal/screen/screen.v | 6 +- lib/osal/sshagent/agent.v | 2 +- lib/osal/sshagent/builder_integration.v | 4 +- lib/osal/sshagent/factory.v | 2 +- lib/osal/sshagent/get.v | 2 +- lib/osal/sshagent/play.v | 2 +- lib/osal/sshagent/readme.md | 4 +- lib/osal/sshagent/security.v | 2 +- lib/osal/sshagent/sshagent.v | 4 +- lib/osal/sshagent/sshagent_test.v | 2 +- lib/osal/sshagent/sshkey.v | 4 +- lib/osal/startupmanager/readme.md | 30 +- lib/osal/startupmanager/startupmanager.v | 10 +- lib/osal/startupmanager/startupmanager_test.v | 6 +- lib/osal/systemd/journalctl.v | 2 +- lib/osal/systemd/readme.md | 4 +- lib/osal/systemd/systemd.v | 8 +- lib/osal/systemd/systemd_process.v | 6 +- lib/osal/systemd/systemd_process_test.v | 6 +- lib/osal/tmux/bin/tmux_logger.v | 4 +- lib/osal/tmux/play.v | 8 +- lib/osal/tmux/tmux.v | 10 +- lib/osal/tmux/tmux_pane.v | 6 +- lib/osal/tmux/tmux_scan.v | 6 +- lib/osal/tmux/tmux_session.v | 6 +- lib/osal/tmux/tmux_session_test.v | 2 +- lib/osal/tmux/tmux_state.v | 4 +- lib/osal/tmux/tmux_test.v | 6 +- lib/osal/tmux/tmux_window.v | 4 +- lib/osal/traefik/README.md | 7 +- lib/osal/traefik/populator.v | 2 +- lib/osal/tun/readme.md | 9 +- lib/osal/tun/tun.v | 2 +- lib/osal/ubuntu/mirrors.v | 4 +- lib/osal/ufw/play.v | 4 +- lib/osal/ufw/ufw.v | 4 +- lib/readme.md | 10 +- lib/schemas/jsonrpc/README.md | 22 +- lib/schemas/jsonrpc/client.v | 2 +- lib/schemas/jsonrpc/reflection/handler.v | 2 +- .../testdata/testserver/openrpc_server.v | 4 +- lib/schemas/jsonrpc/transport_unixsocket.v | 2 +- lib/schemas/jsonschema/README.md | 14 +- lib/schemas/jsonschema/codegen/codegen.v | 4 +- lib/schemas/jsonschema/codegen/codegen_test.v | 2 +- lib/schemas/jsonschema/codegen/generate.v | 4 +- .../jsonschema/codegen/generate_test.v | 2 +- lib/schemas/jsonschema/decode_test.v | 2 +- .../openapi/codegen/client_typescript.v | 14 +- .../openapi/codegen/client_typescript_test.v | 14 +- lib/schemas/openapi/codegen/to_code.v | 6 +- lib/schemas/openapi/controller_http.v | 2 +- lib/schemas/openapi/controller_playground.v | 2 +- lib/schemas/openapi/decode.v | 2 +- lib/schemas/openapi/decode_test.v | 2 +- lib/schemas/openapi/factory.v | 4 +- lib/schemas/openapi/handler.v | 2 +- lib/schemas/openapi/model.v | 2 +- lib/schemas/openrpc/_archive/codegen/docgen.v | 6 +- .../openrpc/_archive/codegen/generate.v | 4 +- .../_archive/codegen/generate_client.v | 16 +- .../_archive/codegen/generate_handler.v | 12 +- .../_archive/codegen/generate_interface.v | 8 +- .../openrpc/_archive/codegen/generate_model.v | 10 +- .../_archive/codegen/generate_model_test.v | 6 +- .../_archive/codegen/generate_openrpc.v | 8 +- .../codegen/templates/client.v.template | 4 +- .../openrpc/_archive/codegen/to_code.v | 10 +- lib/schemas/openrpc/_archive/parse_example.v | 4 +- .../openrpc/_archive/parse_example_test.v | 2 +- lib/schemas/openrpc/_archive/playground.v | 8 +- lib/schemas/openrpc/_archive/server/comment.v | 4 +- .../openrpc/_archive/server/core_methods.v | 2 +- .../openrpc/_archive/server/core_models.v | 4 +- .../openrpc/_archive/testdata/methods.v | 2 +- .../testdata/petstore_client/client.v | 2 +- .../testdata/petstore_client/methods.v | 2 +- lib/schemas/openrpc/client_unix.v | 4 +- lib/schemas/openrpc/client_unix_test.v | 4 +- lib/schemas/openrpc/custom.v | 2 +- lib/schemas/openrpc/decode.v | 2 +- lib/schemas/openrpc/decode_test.v | 4 +- lib/schemas/openrpc/encode_test.v | 2 +- lib/schemas/openrpc/handler.v | 2 +- lib/schemas/openrpc/inflate.v | 2 +- lib/schemas/openrpc/model.v | 2 +- lib/schemas/openrpc/readme.md | 3 +- lib/schemas/openrpc/server_http.v | 2 +- lib/schemas/openrpc/server_http_test.v | 2 +- lib/schemas/openrpc/server_unix.v | 4 +- lib/schemas/openrpc/server_unix_test.v | 4 +- .../grid3/deploy_tosort/deployment.v | 10 +- lib/threefold/grid3/deployer/contracts.v | 4 +- lib/threefold/grid3/deployer/deployer.v | 6 +- .../grid3/deployer/deployer_factory_.v | 6 +- lib/threefold/grid3/deployer/deployer_model.v | 4 +- lib/threefold/grid3/deployer/deployment.v | 4 +- .../grid3/deployer/deployment_setup.v | 4 +- lib/threefold/grid3/deployer/filter.v | 4 +- lib/threefold/grid3/deployer/kvstore.v | 2 +- lib/threefold/grid3/deployer/network.v | 4 +- lib/threefold/grid3/deployer/readme.md | 2 +- lib/threefold/grid3/deployer/rmb.v | 2 +- lib/threefold/grid3/deployer/utils.v | 8 +- lib/threefold/grid3/deployer/vmachine.v | 2 +- lib/threefold/grid3/deployer/zdbs.v | 4 +- .../grid3/deployer2_sort/deployment_state.v | 2 +- lib/threefold/grid3/deployer2_sort/factory.v | 8 +- lib/threefold/grid3/deployer2_sort/graphql.v | 2 +- lib/threefold/grid3/deployer2_sort/vm.v | 4 +- lib/threefold/grid3/deployer2_sort/vm_test.v | 2 +- lib/threefold/grid3/deployer2_sort/zdb.v | 2 +- lib/threefold/grid3/griddriver/substrate.v | 2 +- lib/threefold/grid3/griddriver/utils.v | 2 +- lib/threefold/grid3/gridproxy/README.md | 10 +- .../grid3/gridproxy/gridproxy_core.v | 4 +- .../grid3/gridproxy/gridproxy_factory.v | 6 +- .../grid3/gridproxy/gridproxy_highlevel.v | 2 +- .../grid3/gridproxy/gridproxy_test.v | 2 +- lib/threefold/grid3/rmb/rmb_client.v | 4 +- lib/threefold/grid3/rmb/rmb_test.v | 2 +- lib/threefold/grid3/tfrobot/cancel.v | 4 +- lib/threefold/grid3/tfrobot/deploy.v | 10 +- lib/threefold/grid3/tfrobot/factory.v | 8 +- lib/threefold/grid3/tfrobot/job.v | 6 +- lib/threefold/grid3/tfrobot/tfrobot_redis.v | 4 +- lib/threefold/grid3/tfrobot/vm.v | 10 +- lib/threefold/grid3/tfrobot/vm_deploy_test.v | 2 +- lib/threefold/grid3/tokens/tokens_fetch.v | 4 +- lib/threefold/grid3/zerohub/zerohub.v | 2 +- lib/threefold/grid3/zerohub/zerohub_test.v | 2 +- lib/threefold/grid4/datamodel/play.v | 2 +- .../grid4/datamodelsimulator/loader.v | 4 +- .../datamodelsimulator/model_aggregated.v | 2 +- .../datamodelsimulator/model_simulations.v | 2 +- lib/threefold/grid4/datamodelsimulator/play.v | 4 +- .../grid4/farmingsimulator/factory.v | 10 +- .../grid4/farmingsimulator/model_nodesbatch.v | 2 +- .../grid4/farmingsimulator/model_params.v | 2 +- .../farmingsimulator/model_regionalinternet.v | 2 +- .../grid4/farmingsimulator/model_simulator.v | 14 +- lib/threefold/grid4/farmingsimulator/play.v | 6 +- .../grid4/farmingsimulator/playmacro.v | 4 +- lib/threefold/grid4/farmingsimulator/wiki.v | 2 +- lib/threefold/grid4/gridsimulator/factory.v | 14 +- lib/threefold/grid4/gridsimulator/play.v | 4 +- lib/threefold/incatokens/charts.v | 4 +- lib/threefold/incatokens/export.v | 4 +- lib/threefold/incatokens/factory.v | 4 +- lib/threefold/incatokens/incatokens_test.v | 2 +- lib/threefold/incatokens/play.v | 6 +- lib/threefold/incatokens/simulation.v | 2 +- lib/threefold/incatokens/types.v | 2 +- lib/threefold/incatokens/vesting.v | 2 +- lib/threefold/models_ledger/account.v | 6 +- lib/threefold/models_ledger/asset.v | 52 +- lib/threefold/models_ledger/dnszone.v | 6 +- lib/threefold/models_ledger/group.v | 6 +- lib/threefold/models_ledger/member.v | 6 +- lib/threefold/models_ledger/notary.v | 26 +- lib/threefold/models_ledger/signature.v | 6 +- lib/threefold/models_ledger/test_utils.v | 2 +- lib/threefold/models_ledger/transaction.v | 6 +- lib/threefold/models_ledger/user.v | 6 +- lib/threefold/models_ledger/userkvs.v | 8 +- lib/threefold/models_ledger/userkvsitem.v | 10 +- lib/threefold/models_tfgrid/bid.v | 10 +- lib/threefold/models_tfgrid/contract.v | 89 +- lib/threefold/models_tfgrid/node.v | 90 +- lib/threefold/models_tfgrid/nodegroup.v | 8 +- lib/threefold/models_tfgrid/reputation.v | 18 +- lib/ui/console/console.v | 4 +- lib/ui/console/dropdown.v | 6 +- lib/ui/console/factory.v | 2 +- lib/ui/console/question.v | 4 +- lib/ui/console/time_date.v | 2 +- lib/ui/console/yesno.v | 4 +- lib/ui/factory.v | 8 +- lib/ui/generic/dropdown.v | 6 +- lib/ui/generic/editor.v | 6 +- lib/ui/generic/info.v | 6 +- lib/ui/generic/log.v | 6 +- lib/ui/generic/model.v | 6 +- lib/ui/generic/payment.v | 6 +- lib/ui/generic/question.v | 6 +- lib/ui/generic/yesno.v | 6 +- lib/ui/logger/logger.v | 2 +- lib/ui/readme.md | 55 +- lib/ui/telegram/channel.v | 4 +- lib/ui/telegram/client/client.v | 4 +- lib/ui/telegram/questions.v | 4 +- lib/ui/template/console.v | 2 +- lib/ui/template/dropdown.v | 4 +- lib/ui/template/question.v | 4 +- lib/ui/template/time_date.v | 2 +- lib/ui/template/yesno.v | 2 +- lib/v.mod | 2 +- lib/vfs/vfs_calendar/factory.v | 4 +- lib/vfs/vfs_calendar/model_fsentry.v | 4 +- lib/vfs/vfs_calendar/vfs_calendar.v | 4 +- lib/vfs/vfs_calendar/vfs_implementation.v | 6 +- .../vfs_calendar/vfs_implementation_test.v | 8 +- lib/vfs/vfs_contacts/README.md | 27 +- lib/vfs/vfs_contacts/factory.v | 4 +- lib/vfs/vfs_contacts/model_fsentry.v | 4 +- lib/vfs/vfs_contacts/vfs_contacts.v | 6 +- lib/vfs/vfs_contacts/vfs_implementation.v | 6 +- .../vfs_contacts/vfs_implementation_test.v | 8 +- lib/vfs/vfs_db/database_get.v | 6 +- lib/vfs/vfs_db/database_get_test.v | 4 +- lib/vfs/vfs_db/database_set.v | 6 +- lib/vfs/vfs_db/decode.v | 4 +- lib/vfs/vfs_db/encode.v | 4 +- lib/vfs/vfs_db/encode_test.v | 2 +- lib/vfs/vfs_db/factory_test.v | 2 +- lib/vfs/vfs_db/model_directory.v | 2 +- lib/vfs/vfs_db/model_directory_test.v | 2 +- lib/vfs/vfs_db/model_file.v | 2 +- lib/vfs/vfs_db/model_file_test.v | 4 +- lib/vfs/vfs_db/model_fsentry.v | 2 +- lib/vfs/vfs_db/model_fsentry_test.v | 2 +- lib/vfs/vfs_db/model_symlink.v | 2 +- lib/vfs/vfs_db/model_symlink_test.v | 2 +- lib/vfs/vfs_db/readme.md | 9 +- lib/vfs/vfs_db/vfs_directory.v | 2 +- lib/vfs/vfs_db/vfs_directory_test.v | 4 +- lib/vfs/vfs_db/vfs_implementation.v | 4 +- lib/vfs/vfs_db/vfs_implementation_test.v | 2 +- lib/vfs/vfs_db/vfs_print_test.v | 4 +- lib/vfs/vfs_db/vfs_test.v | 4 +- lib/vfs/vfs_local/factory.v | 2 +- lib/vfs/vfs_local/model_fsentry.v | 2 +- lib/vfs/vfs_local/vfs_implementation.v | 2 +- lib/vfs/vfs_local/vfs_local.v | 2 +- lib/vfs/vfs_mail/factory.v | 4 +- lib/vfs/vfs_mail/model_fsentry.v | 4 +- lib/vfs/vfs_mail/vfs_implementation.v | 6 +- lib/vfs/vfs_mail/vfs_implementation_test.v | 10 +- lib/vfs/vfs_mail/vfs_mail.v | 4 +- lib/vfs/vfs_nested/nested_test.v | 2 +- lib/vfs/vfs_nested/vfsnested.v | 2 +- lib/virt/cloudhypervisor/chv_factory.v | 4 +- lib/virt/crun/factory.v | 2 +- lib/virt/crun/tojson.v | 2 +- lib/virt/docker/docker_build_args.v | 2 +- lib/virt/docker/docker_compose.v | 8 +- lib/virt/docker/docker_compose_service.v | 2 +- lib/virt/docker/docker_container.v | 8 +- lib/virt/docker/docker_container_create.v | 4 +- lib/virt/docker/docker_engine.v | 10 +- lib/virt/docker/docker_image.v | 4 +- lib/virt/docker/docker_recipe.v | 8 +- .../docker/docker_recipe_addfile_embedded.v | 2 +- lib/virt/docker/docker_recipe_code.v | 6 +- .../docker/docker_recipe_code_rustbuilder.v | 4 +- lib/virt/docker/docker_recipe_download.v | 4 +- lib/virt/docker/docker_recipe_entrypoint.v | 2 +- lib/virt/docker/docker_recipe_package.v | 2 +- lib/virt/docker/docker_recipe_run.v | 2 +- lib/virt/docker/docker_recipe_snippets.v | 4 +- lib/virt/docker/docker_recipe_writefile.v | 4 +- lib/virt/docker/docker_recipe_zinit.v | 4 +- lib/virt/docker/docker_registry.v | 8 +- lib/virt/docker/docker_test.v | 2 +- lib/virt/heropods/container.v | 10 +- lib/virt/heropods/container_create.v | 8 +- lib/virt/heropods/container_image.v | 8 +- lib/virt/heropods/factory.v | 6 +- lib/virt/herorun2/README.md | 10 +- lib/virt/herorun2/container.v | 4 +- lib/virt/herorun2/executor.v | 6 +- lib/virt/herorun2/factory.v | 2 +- lib/virt/herorun2/hetzner_backend.v | 4 +- lib/virt/herorun2/installer.v | 2 +- lib/virt/herorun2/nodes.v | 2 +- lib/virt/hetznermanager/actions_key.v | 2 +- .../hetznermanager/hetznermanager_factory_.v | 6 +- .../hetznermanager/hetznermanager_model.v | 6 +- lib/virt/hetznermanager/play.v | 2 +- lib/virt/hetznermanager/readme.md | 90 +- lib/virt/hetznermanager/rescue.v | 8 +- lib/virt/hetznermanager/reset.v | 8 +- lib/virt/hetznermanager/serverinfo.v | 8 +- lib/virt/lima/lima_factory.v | 4 +- lib/virt/lima/raw/vm.v | 2 +- lib/virt/lima/vm.v | 4 +- lib/virt/lima/vm_new.v | 8 +- lib/virt/podman/builder.v | 4 +- lib/virt/podman/container.v | 6 +- lib/virt/podman/factory.v | 6 +- lib/virt/podman/image.v | 4 +- lib/virt/podman/readme.md | 6 +- lib/virt/qemu/qemu_factory.v | 4 +- lib/virt/qemu/vm.v | 4 +- lib/virt/qemu/vm_new.v | 8 +- lib/web/doctreeclient/README.md | 6 +- lib/web/doctreeclient/client.v | 4 +- lib/web/doctreeclient/doctree_test.v | 6 +- lib/web/doctreeclient/factory.v | 2 +- lib/web/doctreeclient/model.v | 2 +- lib/web/docusaurus/config.v | 2 +- lib/web/docusaurus/dsite.v | 10 +- lib/web/docusaurus/dsite_configuration.v | 2 +- lib/web/docusaurus/dsite_generate.v | 6 +- lib/web/docusaurus/dsite_generate_docs.v | 10 +- lib/web/docusaurus/dsite_import.v | 8 +- lib/web/docusaurus/dsite_store_structure.v | 14 +- lib/web/docusaurus/factory.v | 8 +- lib/web/docusaurus/install.v | 10 +- lib/web/docusaurus/model_configuration_test.v | 4 +- lib/web/docusaurus/play.v | 4 +- lib/web/docusaurus/watcher.v | 2 +- lib/web/security/authentication/controller.v | 2 +- .../authentication/email_authentication.v | 2 +- lib/web/site/factory.v | 2 +- lib/web/site/play.v | 4 +- lib/web/site/play_page.v | 2 +- lib/web/site/readme.md | 9 +- lib/web/ui/heroprompt_api.v | 2 +- libarchive/baobab/actor/client.v | 4 +- .../generator/_archive/client_typescript.v | 10 +- .../_archive/client_typescript_test.v | 8 +- .../generator/_archive/generate_objects.v | 4 +- .../generator/_archive/write_object_methods.v | 8 +- .../generator/_archive/write_object_tests.v | 6 +- libarchive/baobab/generator/generate_act.v | 14 +- .../baobab/generator/generate_actor_folder.v | 8 +- .../baobab/generator/generate_actor_source.v | 8 +- .../baobab/generator/generate_actor_test.v | 8 +- .../baobab/generator/generate_clients.v | 18 +- .../baobab/generator/generate_command.v | 8 +- .../baobab/generator/generate_interface.v | 4 +- .../baobab/generator/generate_methods.v | 18 +- .../generator/generate_methods_example.v | 18 +- .../generator/generate_methods_interface.v | 14 +- libarchive/baobab/generator/generate_model.v | 12 +- .../baobab/generator/generate_openapi.v | 8 +- .../baobab/generator/generate_openrpc.v | 6 +- .../baobab/generator/generate_openrpc_test.v | 4 +- .../baobab/generator/generate_scripts.v | 4 +- .../generator/templates/actor.v.template | 6 +- .../templates/actor_example.v.template | 6 +- .../baobab/generator/templates/cli.v.template | 4 +- .../baobab/generator/templates/client_test.v | 4 +- .../generator/templates/command.v.template | 4 +- .../templates/interface_http.v.template | 8 +- .../templates/interface_openapi.v.template | 6 +- .../templates/interface_openrpc.v.template | 4 +- .../generator/templates/playground.v.template | 6 +- .../templates/specifications.v.template | 4 +- .../generator/write_object_methods_test.v | 2 +- libarchive/baobab/osis/indexer.v | 4 +- libarchive/baobab/osis/storer.v | 2 +- .../baobab/specification/from_openapi.v | 10 +- .../baobab/specification/from_openapi_test.v | 8 +- .../baobab/specification/from_openrpc.v | 6 +- .../baobab/specification/from_openrpc_test.v | 8 +- libarchive/baobab/specification/model.v | 8 +- libarchive/baobab/specification/to_openapi.v | 4 +- .../baobab/specification/to_openapi_test.v | 8 +- libarchive/baobab/specification/to_openrpc.v | 6 +- libarchive/baobab/stage/action.v | 2 +- libarchive/baobab/stage/action_client.v | 2 +- libarchive/baobab/stage/actor.v | 4 +- libarchive/baobab/stage/interfaces/jsonrpc.v | 4 +- libarchive/baobab/stage/interfaces/openapi.v | 6 +- libarchive/baobab/stage/interfaces/openrpc.v | 4 +- .../stage/interfaces/reflection_openapi.v | 4 +- .../baobab/stage/interfaces/server_http.v | 6 +- libarchive/buildah/buildah_core.v | 12 +- libarchive/buildah/buildah_core_installers.v | 8 +- libarchive/buildah/buildah_exec.v | 4 +- libarchive/buildah/buildah_factory.v | 6 +- libarchive/buildah/buildah_hero.v | 2 +- libarchive/buildah/buildah_solutions.v | 4 +- libarchive/buildah/readme.md | 17 +- libarchive/daguserver/daguserver_actions.v | 18 +- libarchive/daguserver/daguserver_factory_.v | 8 +- libarchive/daguserver/daguserver_model.v | 8 +- libarchive/daguserver/readme.md | 7 +- libarchive/dify/dify_actions.v | 22 +- libarchive/dify/dify_factory_.v | 8 +- libarchive/dify/dify_model.v | 4 +- libarchive/dify/readme.md | 4 +- .../generator/basic/generate_actor_module.vsh | 6 +- .../generator/basic/generate_methods.vsh | 6 +- .../generator/basic/generate_openrpc_file.vsh | 6 +- .../baobab/generator/geomind_poc/generate.vsh | 6 +- .../baobab/generator/geomind_poc/play.v | 2 +- .../generator/geomind_poc/test_commerce.vsh | 2 +- .../examples/baobab/generator/mcc_example.vsh | 6 +- .../openapi_e2e/generate_actor_module.vsh | 6 +- .../openapi_to_specification.vsh | 4 +- .../openrpc_to_specification.vsh | 4 +- .../specification_to_openapi.vsh | 6 +- .../specification_to_openrpc.vsh | 8 +- .../installers/web/caddy2/caddy_actions.v | 14 +- .../installers/web/caddy2/caddy_factory_.v | 10 +- .../installers/web/caddy2/caddy_model.v | 4 +- libarchive/installers/web/caddy2/installer.v | 12 +- libarchive/installers/web/caddy2/installers.v | 4 +- libarchive/installers/web/caddy2/play.v | 2 +- libarchive/installers/web/caddy2/readme.md | 7 +- libarchive/mcp_baobab/baobab_tools.v | 10 +- libarchive/mcp_baobab/baobab_tools_test.v | 4 +- libarchive/mcp_baobab/mcp_test.v | 4 +- libarchive/mcp_baobab/server.v | 6 +- libarchive/mcp_old/README.md | 4 +- libarchive/mcp_old/baobab/baobab_tools.v | 10 +- libarchive/mcp_old/baobab/baobab_tools_test.v | 4 +- libarchive/mcp_old/baobab/mcp_test.v | 4 +- libarchive/mcp_old/baobab/server.v | 6 +- libarchive/mcp_old/cmd/mcp.v | 10 +- libarchive/mcp_old/factory.v | 4 +- libarchive/mcp_old/handler_initialize.v | 2 +- libarchive/mcp_old/handler_initialize_test.v | 2 +- libarchive/mcp_old/handler_logging.v | 2 +- libarchive/mcp_old/handler_prompts.v | 2 +- libarchive/mcp_old/handler_resources.v | 2 +- libarchive/mcp_old/handler_tools.v | 4 +- libarchive/mcp_old/mcpgen/mcpgen.v | 8 +- libarchive/mcp_old/mcpgen/mcpgen_helpers.v | 2 +- libarchive/mcp_old/mcpgen/mcpgen_tools.v | 6 +- libarchive/mcp_old/mcpgen/server.v | 4 +- libarchive/mcp_old/model_configuration.v | 2 +- libarchive/mcp_old/model_configuration_test.v | 2 +- libarchive/mcp_old/model_error.v | 2 +- libarchive/mcp_old/pugconvert/cmd/main.v | 2 +- .../mcp_old/pugconvert/logic/convertpug.v | 6 +- .../mcp_old/pugconvert/logic/jetvalidation.v | 2 +- libarchive/mcp_old/pugconvert/mcp/handlers.v | 18 +- libarchive/mcp_old/pugconvert/mcp/mcp.v | 16 +- .../mcp_old/pugconvert/mcp/specifications.v | 8 +- libarchive/mcp_old/rhai/cmd/main.v | 2 +- .../mcp_old/rhai/example/example copy.vsh | 2 +- libarchive/mcp_old/rhai/example/example.vsh | 4 +- libarchive/mcp_old/rhai/logic/logic.v | 6 +- libarchive/mcp_old/rhai/mcp/mcp.v | 14 +- libarchive/mcp_old/rhai/mcp/prompts.v | 20 +- libarchive/mcp_old/rhai/mcp/specifications.v | 6 +- libarchive/mcp_old/rhai/mcp/tools.v | 14 +- libarchive/mcp_old/server.v | 4 +- libarchive/mcp_old/transport/http.v | 4 +- libarchive/mcp_old/transport/interface.v | 2 +- libarchive/mcp_old/transport/stdio.v | 4 +- libarchive/mcp_old/vcode/cmd/main.v | 2 +- libarchive/mcp_old/vcode/logic/server.v | 4 +- libarchive/mcp_old/vcode/logic/vlang.v | 6 +- libarchive/mcp_old/vcode/logic/vlang_tools.v | 6 +- .../mcp_old/vcode/logic/write_vfile_tool.v | 6 +- libarchive/mcp_old/vcode/mcp/handlers.v | 6 +- libarchive/mcp_old/vcode/mcp/mcp.v | 6 +- libarchive/mcp_old/vcode/mcp/specifications.v | 6 +- libarchive/mcp_pugconvert/cmd/main.v | 2 +- libarchive/mcp_pugconvert/logic/convertpug.v | 6 +- .../mcp_pugconvert/logic/jetvalidation.v | 2 +- libarchive/mcp_pugconvert/mcp/handlers.v | 18 +- libarchive/mcp_pugconvert/mcp/mcp.v | 16 +- .../mcp_pugconvert/mcp/specifications.v | 8 +- libarchive/mcp_rust_wip/generics.v | 2 +- libarchive/mcp_rust_wip/mcp.v | 4 +- libarchive/mcp_rust_wip/prompts.v | 2 +- libarchive/mcp_rust_wip/tools.v | 6 +- .../openrpc_remove/examples/job_client.vsh | 2 +- libarchive/openrpc_remove/examples/server.vsh | 4 +- libarchive/openrpc_remove/factory.v | 4 +- libarchive/openrpc_remove/handler.v | 2 +- .../openrpc_remove/handler_agent_manager.v | 2 +- .../openrpc_remove/handler_group_manager.v | 2 +- .../openrpc_remove/handler_job_manager.v | 2 +- .../openrpc_remove/handler_service_manager.v | 2 +- libarchive/openrpc_remove/ws_server.v | 2 +- libarchive/rhai/generate_rhai_example.v | 2 +- libarchive/rhai/generate_wrapper_module.v | 2 +- libarchive/rhai/register_types.v | 2 +- libarchive/rhai/register_types_test.v | 2 +- libarchive/rhai/rhai.v | 2 +- libarchive/rhai/rhai_test.v | 6 +- libarchive/rhai/verify.v | 4 +- libarchive/smartid/sid.v | 4 +- libarchive/starlight/config.v | 2 +- libarchive/starlight/factory.v | 2 +- libarchive/starlight/site.v | 8 +- libarchive/starlight/site_get.v | 10 +- libarchive/starlight/template.v | 10 +- libarchive/starlight/watcher.v | 2 +- libarchive/zinit/readme.md | 10 +- libarchive/zinit/rpc.v | 2 +- libarchive/zinit/rpc_test.v | 4 +- libarchive/zinit/zinit.v | 8 +- libarchive/zinit/zinit_client.v | 2 +- libarchive/zinit/zinit_factory.v | 6 +- libarchive/zinit/zinit_openrpc_test.v | 2 +- libarchive/zinit/zinit_stateless.v | 8 +- libarchive/zinit/zprocess.v | 6 +- libwip/mcp_rhai/cmd/main.v | 2 +- libwip/mcp_rhai/example/example copy.vsh | 2 +- libwip/mcp_rhai/example/example.vsh | 2 +- libwip/mcp_rhai/logic/logic.v | 9 +- libwip/mcp_rhai/logic/logic_sampling.v | 6 +- libwip/mcp_rhai/mcp/mcp.v | 14 +- libwip/mcp_rhai/mcp/prompts.v | 20 +- libwip/mcp_rhai/mcp/specifications.v | 6 +- libwip/mcp_rhai/mcp/tools.v | 14 +- manual/best_practices/osal/silence.md | 6 +- manual/core/base.md | 15 +- manual/core/context.md | 16 +- manual/core/session.md | 21 +- test_basic.vsh | 2 +- tests/main.v | 14 +- 1593 files changed, 8753 insertions(+), 8300 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 039053ab..6b4d4686 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -24,7 +24,7 @@ Thank you for your interest in contributing to Herolib! This document provides g For developers, you can use the automated installation script: ```bash -curl 'https://raw.githubusercontent.com/freeflowuniverse/herolib/refs/heads/development/install_v.sh' > /tmp/install_v.sh +curl 'https://raw.githubusercontent.com/incubaid/herolib/refs/heads/development/install_v.sh' > /tmp/install_v.sh bash /tmp/install_v.sh --analyzer --herolib # IMPORTANT: Start a new shell after installation for paths to be set correctly ``` @@ -34,7 +34,7 @@ Alternatively, you can manually set up the environment: ```bash mkdir -p ~/code/github/incubaid cd ~/code/github/incubaid -git clone git@github.com:freeflowuniverse/herolib.git +git clone git@github.com:incubaid/herolib.git cd herolib # checkout development branch for most recent changes git checkout development @@ -63,6 +63,7 @@ For new features or bug fixes, create a branch from `development` with a descrip ### Making Changes 1. Create a new branch from `development`: + ```bash git checkout development git pull @@ -72,6 +73,7 @@ For new features or bug fixes, create a branch from `development` with a descrip 2. Make your changes, following the code guidelines. 3. Run tests to ensure your changes don't break existing functionality: + ```bash ./test_basic.vsh ``` @@ -98,6 +100,7 @@ The test script (`test_basic.vsh`) manages test execution and caching to optimiz ### Pull Requests 1. Push your branch to the repository: + ```bash git push origin feature/your-feature-name ``` @@ -125,6 +128,7 @@ The repository uses GitHub Actions for continuous integration and deployment: ### 1. Testing Workflow (`test.yml`) This workflow runs on every push and pull request to ensure code quality: + - Sets up V and Herolib - Runs all basic tests using `test_basic.vsh` @@ -133,6 +137,7 @@ All tests must pass before a PR can be merged to the `development` branch. ### 2. Hero Build Workflow (`hero_build.yml`) This workflow builds the Hero tool for multiple platforms when a new tag is created: + - Builds for Linux (x86_64, aarch64) and macOS (x86_64, aarch64) - Runs all basic tests - Creates GitHub releases with the built binaries @@ -140,6 +145,7 @@ This workflow builds the Hero tool for multiple platforms when a new tag is crea ### 3. Documentation Workflow (`documentation.yml`) This workflow automatically updates the documentation on GitHub Pages when changes are pushed to the `development` branch: + - Generates documentation using `doc.vsh` - Deploys the documentation to GitHub Pages @@ -152,7 +158,7 @@ cd ~/code/github/incubaid/herolib bash doc.sh ``` -The documentation is automatically published to [https://freeflowuniverse.github.io/herolib/](https://freeflowuniverse.github.io/herolib/) when changes are pushed to the `development` branch. +The documentation is automatically published to [https://incubaid.github.io/herolib/](https://incubaid.github.io/herolib/) when changes are pushed to the `development` branch. ## Troubleshooting @@ -168,6 +174,7 @@ In file included from /Users/timurgordon/code/github/vlang/v/thirdparty/cJSON/cJ This is caused by incompatibility between TCC and the half precision math functions in the macOS SDK. To fix this issue: 1. Open the math.h file: + ```bash sudo nano /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/math.h ``` @@ -178,6 +185,6 @@ For more details, see the [README.md](README.md) troubleshooting section. ## Additional Resources -- [Herolib Documentation](https://freeflowuniverse.github.io/herolib/) -- [Cookbook Examples](https://github.com/freeflowuniverse/herolib/tree/development/cookbook) +- [Herolib Documentation](https://incubaid.github.io/herolib/) +- [Cookbook Examples](https://github.com/incubaid/herolib/tree/development/cookbook) - [AI Prompts](aiprompts/starter/0_start_here.md) diff --git a/README.md b/README.md index f01681d6..77f78b41 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Herolib is an opinionated library primarily used by ThreeFold to automate cloud [![Build on Linux & Run tests](https://github.com/incubaid/herolib/actions/workflows/test.yml/badge.svg)](https://github.com/incubaid/herolib/actions/workflows/test.yml) [![Deploy Documentation to Pages](https://github.com/incubaid/herolib/actions/workflows/documentation.yml/badge.svg)](https://github.com/incubaid/herolib/actions/workflows/documentation.yml) -> [Complete Documentation](https://freeflowuniverse.github.io/herolib/) +> [Complete Documentation](https://incubaid.github.io/herolib/) ## Installation @@ -18,6 +18,7 @@ curl https://raw.githubusercontent.com/incubaid/herolib/refs/heads/development/i ``` Hero will be installed in: + - `/usr/local/bin` for Linux - `~/hero/bin` for macOS @@ -74,15 +75,16 @@ Herolib provides a wide range of functionality: - Cloud automation tools - Git operations and management + ### Offline Mode for Git Operations Herolib now supports an `offline` mode for Git operations, which prevents automatic fetching from remote repositories. This can be useful in environments with limited or no internet connectivity, or when you want to avoid network calls during development or testing. To enable offline mode: - - **Via `GitStructureConfig`**: Set the `offline` field to `true` in the `GitStructureConfig` struct. - - **Via `GitStructureArgsNew`**: When creating a new `GitStructure` instance using `gittools.new()`, set the `offline` parameter to `true`. - - **Via Environment Variable**: Set the `OFFLINE` environment variable to any value (e.g., `export OFFLINE=true`). + - **Via `GitStructureConfig`**: Set the `offline` field to `true` in the `GitStructureConfig` struct. + - **Via `GitStructureArgsNew`**: When creating a new `GitStructure` instance using `gittools.new()`, set the `offline` parameter to `true`. + - **Via Environment Variable**: Set the `OFFLINE` environment variable to any value (e.g., `export OFFLINE=true`). When offline mode is active, `git fetch --all` operations will be skipped, and a debug message "fetch skipped (offline)" will be printed. - Documentation building @@ -133,11 +135,13 @@ In file included from /Users/timurgordon/code/github/vlang/v/thirdparty/cJSON/cJ This is caused by incompatibility between TCC and the half precision math functions in the macOS SDK. To fix this issue: 1. Open the math.h file: + ```bash sudo nano /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/math.h ``` 2. Comment out the following lines (around line 612-626): + ```c /* half precision math functions */ // extern _Float16 __fabsf16(_Float16) __API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0)); @@ -159,7 +163,7 @@ This is caused by incompatibility between TCC and the half precision math functi ## Additional Resources -- [Complete Documentation](https://freeflowuniverse.github.io/herolib/) +- [Complete Documentation](https://incubaid.github.io/herolib/) - [Cookbook Examples](https://github.com/incubaid/herolib/tree/development/cookbook) - [AI Prompts](aiprompts/starter/0_start_here.md) @@ -172,7 +176,6 @@ cd ~/code/github/incubaid/herolib bash doc.sh ``` - \ No newline at end of file diff --git a/aiprompts/bizmodel/bizmodel_revenue.md b/aiprompts/bizmodel/bizmodel_revenue.md index dbc37557..135ace8a 100644 --- a/aiprompts/bizmodel/bizmodel_revenue.md +++ b/aiprompts/bizmodel/bizmodel_revenue.md @@ -1,4 +1,4 @@ -# Revenue +# Revenue ``` !!bizmodel.revenue_define bizname:'test' name:'oem1' ... @@ -21,7 +21,7 @@ cogs stands for cost of goods - cogs_delay: delay in months between cogs and revenue - extrapolate: if you want to extrapolate revenue or cogs do extrapolate:1, default is 0 -### results in +### results in follow rows in sheets @@ -36,16 +36,14 @@ follow rows in sheets - revenue_item_setup_delay, delay between sell and recognition of sale in months e.g. 1 - revenue_item_monthly, revenue per month for 1 item - revenue_item_monthly_delay, how many months before monthly revenue starts -- revenue_item_monthly_perc, how much percent of revenue_item_setup will come back over months e.g. 20% +- revenue_item_monthly_perc, how much percent of revenue_item_setup will come back over months e.g. 20% - cogs_item_setup, cost of good for 1 item at setup - cogs_item_setup_rev_perc: what is percentage of the revenue which is cogs, e.g. 2% - cogs_item_monthly, cost of goods for the monthly per 1 item - cogs_item_monthly_rev_perc: what is percentage of the monthly revenue which is cogs, e.g. 10% - cogs_item_delay, how many months before cogs starts after sales - - -### results in +### results in follow rows in sheets @@ -62,7 +60,7 @@ follow rows in sheets ```v -import freeflowuniverse.herolib.biz.bizmodel +import incubaid.herolib.biz.bizmodel import os heroscript:=" @@ -89,4 +87,4 @@ mut bm:=bizmodel.get("test")! bm.sheet.pprint()! -``` \ No newline at end of file +``` diff --git a/aiprompts/docusaurus/docusaurus_ebook_manual.md b/aiprompts/docusaurus/docusaurus_ebook_manual.md index fb1f4b46..bd0b2073 100644 --- a/aiprompts/docusaurus/docusaurus_ebook_manual.md +++ b/aiprompts/docusaurus/docusaurus_ebook_manual.md @@ -6,9 +6,9 @@ This manual provides a comprehensive guide on how to leverage HeroLib's Docusaur To effectively create ebooks with HeroLib, it's crucial to understand the interplay of three core components: -* **HeroScript**: A concise scripting language used to define the structure, configuration, and content flow of your Docusaurus site. It acts as the declarative interface for the entire process. -* **Docusaurus**: A popular open-source static site generator. HeroLib uses Docusaurus as the underlying framework to render your ebook content into a navigable website. -* **Doctree**: HeroLib's content management system. Doctree organizes your markdown files into "collections" and "pages," allowing for structured content retrieval and reuse across multiple projects. +* **HeroScript**: A concise scripting language used to define the structure, configuration, and content flow of your Docusaurus site. It acts as the declarative interface for the entire process. +* **Docusaurus**: A popular open-source static site generator. HeroLib uses Docusaurus as the underlying framework to render your ebook content into a navigable website. +* **Doctree**: HeroLib's content management system. Doctree organizes your markdown files into "collections" and "pages," allowing for structured content retrieval and reuse across multiple projects. ## 2. Setting Up a Docusaurus Project with HeroLib @@ -30,10 +30,10 @@ The `docusaurus.define` HeroScript directive configures the global settings for **Arguments:** -* `path_build` (string, optional): The local path where the Docusaurus site will be built. Defaults to `~/hero/var/docusaurus/build`. -* `path_publish` (string, optional): The local path where the final Docusaurus site will be published (e.g., for deployment). Defaults to `~/hero/var/docusaurus/publish`. -* `production` (boolean, optional): If `true`, the site will be built for production (optimized). Default is `false`. -* `update` (boolean, optional): If `true`, the Docusaurus template and dependencies will be updated. Default is `false`. +* `path_build` (string, optional): The local path where the Docusaurus site will be built. Defaults to `~/hero/var/docusaurus/build`. +* `path_publish` (string, optional): The local path where the final Docusaurus site will be published (e.g., for deployment). Defaults to `~/hero/var/docusaurus/publish`. +* `production` (boolean, optional): If `true`, the site will be built for production (optimized). Default is `false`. +* `update` (boolean, optional): If `true`, the Docusaurus template and dependencies will be updated. Default is `false`. ### 2.2. Adding a Docusaurus Site (`docusaurus.add`) @@ -61,19 +61,19 @@ The `docusaurus.add` directive defines an individual Docusaurus site (your ebook **Arguments:** -* `name` (string, optional): A unique name for your Docusaurus site/ebook. Defaults to "main". -* `path` (string, optional): The local file system path to the root of your documentation content (e.g., where your `docs` and `cfg` directories are). -* `git_url` (string, optional): A Git URL to a repository containing your documentation content. HeroLib will clone/pull this repository. -* `git_reset` (boolean, optional): If `true`, the Git repository will be reset to a clean state before pulling. Default is `false`. -* `git_pull` (boolean, optional): If `true`, the Git repository will be pulled to get the latest changes. Default is `false`. -* `git_root` (string, optional): An optional root directory where Git repositories will be cloned. -* `nameshort` (string, optional): A shorter name for the Docusaurus site. Defaults to the value of `name`. -* `path_publish` (string, optional): Overrides the factory's `path_publish` for this specific site. -* `production` (boolean, optional): Overrides the factory's `production` setting for this specific site. -* `watch_changes` (boolean, optional): If `true`, HeroLib will watch for changes in your source `docs` directory and trigger rebuilds. Default is `true`. -* `update` (boolean, optional): If `true`, this specific documentation will be updated. Default is `false`. -* `open` (boolean, optional): If `true`, the Docusaurus site will be opened in your default browser after generation/development server start. Default is `false`. -* `init` (boolean, optional): If `true`, the Docusaurus site will be initialized (e.g., creating missing `docs` directories). Default is `false`. +* `name` (string, optional): A unique name for your Docusaurus site/ebook. Defaults to "main". +* `path` (string, optional): The local file system path to the root of your documentation content (e.g., where your `docs` and `cfg` directories are). +* `git_url` (string, optional): A Git URL to a repository containing your documentation content. HeroLib will clone/pull this repository. +* `git_reset` (boolean, optional): If `true`, the Git repository will be reset to a clean state before pulling. Default is `false`. +* `git_pull` (boolean, optional): If `true`, the Git repository will be pulled to get the latest changes. Default is `false`. +* `git_root` (string, optional): An optional root directory where Git repositories will be cloned. +* `nameshort` (string, optional): A shorter name for the Docusaurus site. Defaults to the value of `name`. +* `path_publish` (string, optional): Overrides the factory's `path_publish` for this specific site. +* `production` (boolean, optional): Overrides the factory's `production` setting for this specific site. +* `watch_changes` (boolean, optional): If `true`, HeroLib will watch for changes in your source `docs` directory and trigger rebuilds. Default is `true`. +* `update` (boolean, optional): If `true`, this specific documentation will be updated. Default is `false`. +* `open` (boolean, optional): If `true`, the Docusaurus site will be opened in your default browser after generation/development server start. Default is `false`. +* `init` (boolean, optional): If `true`, the Docusaurus site will be initialized (e.g., creating missing `docs` directories). Default is `false`. ## 3. Structuring Content with HeroScript and Doctree @@ -105,22 +105,22 @@ These directives define the fundamental properties and metadata of your Docusaur **Arguments:** -* **`site.config`**: - * `name` (string, required): Unique identifier for the site. - * `title` (string, optional): Main title of the site. Defaults to "My Documentation Site". - * `description` (string, optional): General site description. - * `tagline` (string, optional): Short tagline for the site. - * `favicon` (string, optional): Path to the favicon. Defaults to "img/favicon.png". - * `image` (string, optional): General site image (e.g., for social media previews). Defaults to "img/tf_graph.png". - * `copyright` (string, optional): Copyright notice. Defaults to "© [Current Year] Example Organization". - * `url` (string, optional): The main URL where the site will be hosted. - * `base_url` (string, optional): The base URL for Docusaurus (e.g., `/` or `/my-ebook/`). - * `url_home` (string, optional): The path to the home page relative to `base_url`. -* **`site.config_meta`**: Overrides for specific SEO metadata. - * `title` (string, optional): Specific title for SEO (e.g., ``). - * `image` (string, optional): Specific image for SEO (e.g., ``). - * `description` (string, optional): Specific description for SEO. - * `keywords` (string, optional): Comma-separated keywords for SEO. +* **`site.config`**: + * `name` (string, required): Unique identifier for the site. + * `title` (string, optional): Main title of the site. Defaults to "My Documentation Site". + * `description` (string, optional): General site description. + * `tagline` (string, optional): Short tagline for the site. + * `favicon` (string, optional): Path to the favicon. Defaults to "img/favicon.png". + * `image` (string, optional): General site image (e.g., for social media previews). Defaults to "img/tf_graph.png". + * `copyright` (string, optional): Copyright notice. Defaults to "© [Current Year] Example Organization". + * `url` (string, optional): The main URL where the site will be hosted. + * `base_url` (string, optional): The base URL for Docusaurus (e.g., `/` or `/my-ebook/`). + * `url_home` (string, optional): The path to the home page relative to `base_url`. +* **`site.config_meta`**: Overrides for specific SEO metadata. + * `title` (string, optional): Specific title for SEO (e.g., ``). + * `image` (string, optional): Specific image for SEO (e.g., ``). + * `description` (string, optional): Specific description for SEO. + * `keywords` (string, optional): Comma-separated keywords for SEO. ### 3.2. Navigation Bar (`site.navbar`, `site.navbar_item`) @@ -148,16 +148,16 @@ Define the main navigation menu of your Docusaurus site. **Arguments:** -* **`site.navbar`**: - * `title` (string, optional): Title displayed in the navbar. Defaults to `site.config.title`. - * `logo_alt` (string, optional): Alt text for the logo. - * `logo_src` (string, optional): Path to the light mode logo. - * `logo_src_dark` (string, optional): Path to the dark mode logo. -* **`site.navbar_item`**: - * `label` (string, required): Text displayed for the menu item. - * `href` (string, optional): External URL for the link. - * `to` (string, optional): Internal Docusaurus path (e.g., `/docs/my-page`). - * `position` (string, optional): "left" or "right" for placement in the navbar. Defaults to "right". +* **`site.navbar`**: + * `title` (string, optional): Title displayed in the navbar. Defaults to `site.config.title`. + * `logo_alt` (string, optional): Alt text for the logo. + * `logo_src` (string, optional): Path to the light mode logo. + * `logo_src_dark` (string, optional): Path to the dark mode logo. +* **`site.navbar_item`**: + * `label` (string, required): Text displayed for the menu item. + * `href` (string, optional): External URL for the link. + * `to` (string, optional): Internal Docusaurus path (e.g., `/docs/my-page`). + * `position` (string, optional): "left" or "right" for placement in the navbar. Defaults to "right". ### 3.3. Footer (`site.footer`, `site.footer_item`) @@ -182,13 +182,13 @@ Configure the footer section of your Docusaurus site. **Arguments:** -* **`site.footer`**: - * `style` (string, optional): "dark" or "light" style for the footer. Defaults to "dark". -* **`site.footer_item`**: - * `title` (string, required): The title under which this item will be grouped in the footer. - * `label` (string, required): Text displayed for the footer link. - * `href` (string, optional): External URL for the link. - * `to` (string, optional): Internal Docusaurus path. +* **`site.footer`**: + * `style` (string, optional): "dark" or "light" style for the footer. Defaults to "dark". +* **`site.footer_item`**: + * `title` (string, required): The title under which this item will be grouped in the footer. + * `label` (string, required): Text displayed for the footer link. + * `href` (string, optional): External URL for the link. + * `to` (string, optional): Internal Docusaurus path. ### 3.4. Build Destinations (`site.build_dest`, `site.build_dest_dev`) @@ -208,8 +208,8 @@ Specify where the built Docusaurus site should be deployed. This typically invol **Arguments:** -* `ssh_name` (string, required): The name of the SSH connection to use for deployment. -* `path` (string, required): The destination path on the remote server. +* `ssh_name` (string, required): The name of the SSH connection to use for deployment. +* `path` (string, required): The destination path on the remote server. ### 3.5. Importing External Content (`site.import`) @@ -226,9 +226,9 @@ This powerful feature allows you to pull markdown content and assets from other **Arguments:** -* `url` (string, required): The Git URL of the repository or specific path within a repository to import. -* `dest` (string, required): The subdirectory within your Docusaurus `docs` folder where the imported content will be placed. -* `replace` (string, optional): A comma-separated string of `KEY:VALUE` pairs. During import, all occurrences of `${KEY}` in the imported content will be replaced with `VALUE`. +* `url` (string, required): The Git URL of the repository or specific path within a repository to import. +* `dest` (string, required): The subdirectory within your Docusaurus `docs` folder where the imported content will be placed. +* `replace` (string, optional): A comma-separated string of `KEY:VALUE` pairs. During import, all occurrences of `${KEY}` in the imported content will be replaced with `VALUE`. ### 3.6. Defining Pages and Categories (`site.page_category`, `site.page`) @@ -250,20 +250,20 @@ This is where you define the actual content pages and how they are organized int **Arguments:** -* **`site.page_category`**: - * `path` (string, required): The path to the category directory within your Docusaurus `docs` folder (e.g., `introduction` will create `docs/introduction/_category_.json`). - * `label` (string, required): The display name for the category in the sidebar. - * `position` (int, optional): The order of the category in the sidebar. - * `sitename` (string, optional): If you have multiple Docusaurus sites defined, specify which site this category belongs to. Defaults to the current site's name. -* **`site.page`**: - * `src` (string, required): **Crucial for Doctree integration.** This specifies the source of the page content in the format `collection_name:page_name`. HeroLib will fetch the markdown content from the specified Doctree collection and page. - * `path` (string, required): The relative path and filename for the generated markdown file within your Docusaurus `docs` folder (e.g., `introduction/chapter_1.md`). If only a directory is provided (e.g., `introduction/`), the `page_name` from `src` will be used as the filename. - * `title` (string, optional): The title of the page. If not provided, HeroLib will attempt to extract it from the markdown content or use the `page_name`. - * `description` (string, optional): A short description for the page, used in frontmatter. - * `position` (int, optional): The order of the page within its category. - * `hide_title` (boolean, optional): If `true`, the title will not be displayed on the page itself. - * `draft` (boolean, optional): If `true`, the page will be marked as a draft and not included in production builds. - * `title_nr` (int, optional): If set, HeroLib will re-number the markdown headings (e.g., `title_nr:3` will make `# Heading` become `### Heading`). Useful for consistent heading levels across imported content. +* **`site.page_category`**: + * `path` (string, required): The path to the category directory within your Docusaurus `docs` folder (e.g., `introduction` will create `docs/introduction/_category_.json`). + * `label` (string, required): The display name for the category in the sidebar. + * `position` (int, optional): The order of the category in the sidebar. + * `sitename` (string, optional): If you have multiple Docusaurus sites defined, specify which site this category belongs to. Defaults to the current site's name. +* **`site.page`**: + * `src` (string, required): **Crucial for Doctree integration.** This specifies the source of the page content in the format `collection_name:page_name`. HeroLib will fetch the markdown content from the specified Doctree collection and page. + * `path` (string, required): The relative path and filename for the generated markdown file within your Docusaurus `docs` folder (e.g., `introduction/chapter_1.md`). If only a directory is provided (e.g., `introduction/`), the `page_name` from `src` will be used as the filename. + * `title` (string, optional): The title of the page. If not provided, HeroLib will attempt to extract it from the markdown content or use the `page_name`. + * `description` (string, optional): A short description for the page, used in frontmatter. + * `position` (int, optional): The order of the page within its category. + * `hide_title` (boolean, optional): If `true`, the title will not be displayed on the page itself. + * `draft` (boolean, optional): If `true`, the page will be marked as a draft and not included in production builds. + * `title_nr` (int, optional): If set, HeroLib will re-number the markdown headings (e.g., `title_nr:3` will make `# Heading` become `### Heading`). Useful for consistent heading levels across imported content. ### 3.7. Doctree Integration Details @@ -271,14 +271,16 @@ The `site.page` directive's `src` parameter (`collection_name:page_name`) is the **How Doctree Works:** -1. **Collections**: Doctree organizes markdown files into logical groups called "collections." A collection is typically a directory containing markdown files and an empty `.collection` file. -2. **Scanning**: You define which collections Doctree should scan using `!!doctree.scan` in a HeroScript file (e.g., `doctree.heroscript`). +1. **Collections**: Doctree organizes markdown files into logical groups called "collections." A collection is typically a directory containing markdown files and an empty `.collection` file. +2. **Scanning**: You define which collections Doctree should scan using `!!doctree.scan` in a HeroScript file (e.g., `doctree.heroscript`). **Example `doctree.heroscript`:** + ```heroscript !!doctree.scan git_url:"https://git.threefold.info/tfgrid/docs_tfgrid4/src/branch/main/collections" ``` + This will pull the `collections` directory from the specified Git URL and make its contents available to Doctree. -3. **Page Retrieval**: When `site.page` references `src:"my_collection:my_page"`, HeroLib's `doctreeclient` fetches the content of `my_page.md` from the `my_collection` collection that Doctree has scanned. +3. **Page Retrieval**: When `site.page` references `src:"my_collection:my_page"`, HeroLib's `doctreeclient` fetches the content of `my_page.md` from the `my_collection` collection that Doctree has scanned. ## 4. Building and Developing Your Ebook @@ -287,12 +289,13 @@ Once your HeroScript configuration is set up, HeroLib provides commands to build ### 4.1. Generating Site Files (`site.generate()`) The `site.generate()` function (called internally by `build`, `dev`, etc.) performs the core file generation: -* Copies Docusaurus template files. -* Copies your site's `src` and `static` assets. -* Generates Docusaurus configuration JSON files (`main.json`, `navbar.json`, `footer.json`) from your HeroScript `site.config`, `site.navbar`, and `site.footer` directives. -* Copies your source `docs` directory. -* Processes `site.page` and `site.page_category` directives using the `sitegen` module to create the final markdown files and `_category_.json` files in the Docusaurus `docs` directory, fetching content from Doctree. -* Handles `site.import` directives, pulling external content and performing replacements. + +* Copies Docusaurus template files. +* Copies your site's `src` and `static` assets. +* Generates Docusaurus configuration JSON files (`main.json`, `navbar.json`, `footer.json`) from your HeroScript `site.config`, `site.navbar`, and `site.footer` directives. +* Copies your source `docs` directory. +* Processes `site.page` and `site.page_category` directives using the `sitegen` module to create the final markdown files and `_category_.json` files in the Docusaurus `docs` directory, fetching content from Doctree. +* Handles `site.import` directives, pulling external content and performing replacements. ### 4.2. Local Development @@ -305,35 +308,34 @@ can be stored as example_docusaurus.vsh and then used to generate and develop an ```v #!/usr/bin/env -S v -n -w -gc none -cg -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.web.docusaurus +import incubaid.herolib.web.docusaurus import os const cfgpath = os.dir(@FILE) docusaurus.new( - heroscript: ' + heroscript: ' - // !!docusaurus.define - // path_build: "/tmp/docusaurus_build" - // path_publish: "/tmp/docusaurus_publish" + // !!docusaurus.define + // path_build: "/tmp/docusaurus_build" + // path_publish: "/tmp/docusaurus_publish" - !!docusaurus.add name:"tfgrid_docs" - path:"${cfgpath}" + !!docusaurus.add name:"tfgrid_docs" + path:"${cfgpath}" - !!docusaurus.dev + !!docusaurus.dev - ' + ' )! ``` - the following script suggest to call it do.vsh and put in directory of where the ebook is ```v #!/usr/bin/env -S v -n -w -gc none -cg -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.web.docusaurus +import incubaid.herolib.web.docusaurus const cfgpath = os.dir(@FILE) + '/cfg' @@ -341,4 +343,3 @@ docusaurus.new(heroscript_path:cfgpath)! ``` by just called do.vsh we can execute on the ebook - diff --git a/aiprompts/herolib_advanced/advanced_paths.md b/aiprompts/herolib_advanced/advanced_paths.md index 7f4e50ea..0f487ddd 100644 --- a/aiprompts/herolib_advanced/advanced_paths.md +++ b/aiprompts/herolib_advanced/advanced_paths.md @@ -13,12 +13,12 @@ The `list` method accepts a `ListArgs` struct to control its behavior: ```v pub struct ListArgs { pub mut: - regex []string // A slice of regular expressions to filter files. - recursive bool = true // Whether to list files recursively (default true). - ignore_default bool = true // Whether to ignore files starting with . and _ (default true). - include_links bool // Whether to include symbolic links in the list. - dirs_only bool // Whether to include only directories in the list. - files_only bool // Whether to include only files in the list. + regex []string // A slice of regular expressions to filter files. + recursive bool = true // Whether to list files recursively (default true). + ignore_default bool = true // Whether to ignore files starting with . and _ (default true). + include_links bool // Whether to include symbolic links in the list. + dirs_only bool // Whether to include only directories in the list. + files_only bool // Whether to include only files in the list. } ``` @@ -31,7 +31,7 @@ Here are examples demonstrating how to use these advanced filtering options: You can use regular expressions to filter files based on their names or extensions. The `regex` parameter accepts a slice of strings, where each string is a regex pattern. ```v -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib // Get a directory path mut dir := pathlib.get('/some/directory')! @@ -61,7 +61,7 @@ for path_obj in vlang_files.paths { By default, `list()` is recursive. You can disable recursion to list only items in the current directory. ```v -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib mut dir := pathlib.get('/some/directory')! @@ -80,7 +80,7 @@ for path_obj in top_level_items.paths { The `ignore_default` parameter controls whether files and directories starting with `.` or `_` are ignored. ```v -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib mut dir := pathlib.get('/some/directory')! @@ -99,7 +99,7 @@ for path_obj in all_items.paths { By default, symbolic links are ignored when walking the directory structure. Set `include_links` to `true` to include them. ```v -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib mut dir := pathlib.get('/some/directory')! @@ -118,7 +118,7 @@ for path_obj in items_with_links.paths { Use `dirs_only` or `files_only` to restrict the results to only directories or only files. ```v -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib mut dir := pathlib.get('/some/directory')! @@ -138,4 +138,4 @@ for path_obj in only_dirs.paths { } ``` -By combining these parameters, you can create highly specific and powerful file system listing operations tailored to your needs. \ No newline at end of file +By combining these parameters, you can create highly specific and powerful file system listing operations tailored to your needs. diff --git a/aiprompts/herolib_advanced/builder.md b/aiprompts/herolib_advanced/builder.md index e5d4ae4d..e0c4bee9 100644 --- a/aiprompts/herolib_advanced/builder.md +++ b/aiprompts/herolib_advanced/builder.md @@ -4,10 +4,10 @@ The `builder` module in Herolib provides a powerful framework for automating sys ## Key Components -- **`BuilderFactory`**: Responsible for creating and managing `Node` instances. -- **`Node`**: Represents a target system (local or remote). It encapsulates system properties (platform, CPU type, environment variables) and provides methods for interaction. -- **`Executor`**: An interface (implemented by `ExecutorLocal` and `ExecutorSSH`) that handles the actual command execution and file operations on the target system. -- **NodeDB (via `Node.done` map)**: A key-value store within each `Node` for persistent state, caching, and tracking execution history. +- **`BuilderFactory`**: Responsible for creating and managing `Node` instances. +- **`Node`**: Represents a target system (local or remote). It encapsulates system properties (platform, CPU type, environment variables) and provides methods for interaction. +- **`Executor`**: An interface (implemented by `ExecutorLocal` and `ExecutorSSH`) that handles the actual command execution and file operations on the target system. +- **NodeDB (via `Node.done` map)**: A key-value store within each `Node` for persistent state, caching, and tracking execution history. ## Getting Started @@ -16,7 +16,7 @@ The `builder` module in Herolib provides a powerful framework for automating sys First, import the `builder` module and create a new `BuilderFactory` instance. Then, create a `Node` object, which can represent either the local machine or a remote server. ```v -import freeflowuniverse.herolib.builder +import incubaid.herolib.builder // Create a new builder factory mut b := builder.new()! @@ -68,7 +68,7 @@ The `Node` object provides methods to execute commands on the target system. Executes a command and returns its standard output. ```v -import freeflowuniverse.herolib.builder { ExecArgs } +import incubaid.herolib.builder { ExecArgs } // Execute a command with stdout result := node.exec(cmd: "ls -la /tmp", stdout: true)! @@ -101,7 +101,7 @@ node.exec_interactive("bash")! A more advanced command execution method that supports caching, periodic execution, and temporary script handling. ```v -import freeflowuniverse.herolib.builder { NodeExecCmd } +import incubaid.herolib.builder { NodeExecCmd } // Execute a command, cache its result for 24 hours (48*3600 seconds) // and provide a description for logging. @@ -130,7 +130,7 @@ println(script_output) Executes a command with retries until it succeeds or a timeout is reached. ```v -import freeflowuniverse.herolib.builder { ExecRetryArgs } +import incubaid.herolib.builder { ExecRetryArgs } // Try to connect to a service, retrying every 100ms for up to 10 seconds result := node.exec_retry( @@ -219,7 +219,7 @@ if node.dir_exists("/var/log") { Transfer files between the local machine and the target node using `rsync` or `scp`. ```v -import freeflowuniverse.herolib.builder { SyncArgs } +import incubaid.herolib.builder { SyncArgs } // Upload a local file to the remote node node.upload( @@ -286,7 +286,7 @@ node.hero_install()! Updates the Herolib code on the node, with options for syncing from local, git reset, or git pull. ```v -import freeflowuniverse.herolib.builder { HeroUpdateArgs } +import incubaid.herolib.builder { HeroUpdateArgs } // Sync local Herolib code to the remote node (full sync) node.hero_update(sync_from_local: true, sync_full: true)! @@ -300,7 +300,7 @@ node.hero_update(git_reset: true, branch: "dev")! Uploads and executes a Vlang script (`.vsh` or `.v`) on the remote node. ```v -import freeflowuniverse.herolib.builder { VScriptArgs } +import incubaid.herolib.builder { VScriptArgs } // Upload and execute a local V script on the remote node node.vscript(path: "/local/path/to/my_script.vsh", sync_from_local: true)! @@ -311,7 +311,7 @@ node.vscript(path: "/local/path/to/my_script.vsh", sync_from_local: true)! The `portforward_to_local` function allows forwarding a remote port on an SSH host to a local port. ```v -import freeflowuniverse.herolib.builder { portforward_to_local, ForwardArgsToLocal } +import incubaid.herolib.builder { portforward_to_local, ForwardArgsToLocal } // Forward remote port 8080 on 192.168.1.100 to local port 9000 portforward_to_local( diff --git a/aiprompts/herolib_advanced/osal.md b/aiprompts/herolib_advanced/osal.md index fa16e116..45c60f66 100644 --- a/aiprompts/herolib_advanced/osal.md +++ b/aiprompts/herolib_advanced/osal.md @@ -1,508 +1,682 @@ -# OSAL Core Module (freeflowuniverse.herolib.osal.core) +# OSAL Core Module (incubaid.herolib.osal.core) This document describes the core functionalities of the Operating System Abstraction Layer (OSAL) module, designed for platform-independent system operations in V. ```v //example how to get started -import freeflowuniverse.herolib.osal.core as osal +import incubaid.herolib.osal.core as osal osal.exec(...)! ``` - ## 1. Process Management ### `osal.exec(cmd: Command) !Job` + Executes a shell command with extensive configuration. -* **Parameters**: - * `cmd` (`Command` struct): - * `cmd` (string): The command string. - * `timeout` (int, default: 3600): Max execution time in seconds. - * `retry` (int): Number of retries on failure. - * `work_folder` (string): Working directory. - * `environment` (map[string]string): Environment variables. - * `stdout` (bool, default: true): Show command output. - * `stdout_log` (bool, default: true): Log stdout to internal buffer. - * `raise_error` (bool, default: true): Raise V error on failure. - * `ignore_error` (bool): Do not raise error, just report. - * `debug` (bool): Enable debug output. - * `shell` (bool): Execute in interactive shell. - * `interactive` (bool, default: true): Run in interactive mode. - * `async` (bool): Run command asynchronously. - * `runtime` (`RunTime` enum): Specify runtime (`.bash`, `.python`, etc.). -* **Returns**: `Job` struct (contains `status`, `output`, `error`, `exit_code`, `start`, `end`, `process`, `runnr`). -* **Error Handling**: Returns `JobError` with `error_type` (`.exec`, `.timeout`, `.args`). + +* **Parameters**: + * `cmd` (`Command` struct): + * `cmd` (string): The command string. + * `timeout` (int, default: 3600): Max execution time in seconds. + * `retry` (int): Number of retries on failure. + * `work_folder` (string): Working directory. + * `environment` (map[string]string): Environment variables. + * `stdout` (bool, default: true): Show command output. + * `stdout_log` (bool, default: true): Log stdout to internal buffer. + * `raise_error` (bool, default: true): Raise V error on failure. + * `ignore_error` (bool): Do not raise error, just report. + * `debug` (bool): Enable debug output. + * `shell` (bool): Execute in interactive shell. + * `interactive` (bool, default: true): Run in interactive mode. + * `async` (bool): Run command asynchronously. + * `runtime` (`RunTime` enum): Specify runtime (`.bash`, `.python`, etc.). +* **Returns**: `Job` struct (contains `status`, `output`, `error`, `exit_code`, `start`, `end`, `process`, `runnr`). +* **Error Handling**: Returns `JobError` with `error_type` (`.exec`, `.timeout`, `.args`). ### `osal.execute_silent(cmd string) !string` + Executes a command silently. -* **Parameters**: `cmd` (string): The command string. -* **Returns**: `string` (command output). + +* **Parameters**: `cmd` (string): The command string. +* **Returns**: `string` (command output). ### `osal.execute_debug(cmd string) !string` + Executes a command with debug output. -* **Parameters**: `cmd` (string): The command string. -* **Returns**: `string` (command output). + +* **Parameters**: `cmd` (string): The command string. +* **Returns**: `string` (command output). ### `osal.execute_stdout(cmd string) !string` + Executes a command and prints output to stdout. -* **Parameters**: `cmd` (string): The command string. -* **Returns**: `string` (command output). + +* **Parameters**: `cmd` (string): The command string. +* **Returns**: `string` (command output). ### `osal.execute_interactive(cmd string) !` + ### `osal.execute_ok(cmd string) bool` + Executes a command and returns `true` if the command exits with a zero status, `false` otherwise. -* **Parameters**: `cmd` (string): The command string. -* **Returns**: `bool`. + +* **Parameters**: `cmd` (string): The command string. +* **Returns**: `bool`. Executes a command in an interactive shell. + ### `osal.exec_fast(cmd: CommandFast) !string` + Executes a command quickly, with options for profile sourcing and environment variables. -* **Parameters**: - * `cmd` (`CommandFast` struct): - * `cmd` (string): The command string. - * `ignore_error` (bool): Do not raise error on non-zero exit code. - * `work_folder` (string): Working directory. - * `environment` (map[string]string): Environment variables. - * `ignore_error_codes` ([]int): List of exit codes to ignore. - * `debug` (bool): Enable debug output. - * `includeprofile` (bool): Source the user's profile before execution. - * `notempty` (bool): Return an error if the output is empty. -* **Returns**: `string` (command output). -* **Parameters**: `cmd` (string): The command string. + +* **Parameters**: + * `cmd` (`CommandFast` struct): + * `cmd` (string): The command string. + * `ignore_error` (bool): Do not raise error on non-zero exit code. + * `work_folder` (string): Working directory. + * `environment` (map[string]string): Environment variables. + * `ignore_error_codes` ([]int): List of exit codes to ignore. + * `debug` (bool): Enable debug output. + * `includeprofile` (bool): Source the user's profile before execution. + * `notempty` (bool): Return an error if the output is empty. +* **Returns**: `string` (command output). +* **Parameters**: `cmd` (string): The command string. ### `osal.cmd_exists(cmd string) bool` + Checks if a command exists in the system's PATH. -* **Parameters**: `cmd` (string): The command name. -* **Returns**: `bool`. + +* **Parameters**: `cmd` (string): The command name. +* **Returns**: `bool`. ### `osal.processmap_get() !ProcessMap` + Scans and returns a map of all running processes. -* **Returns**: `ProcessMap` struct (contains `processes` (`[]ProcessInfo`), `lastscan`, `state`, `pids`). + +* **Returns**: `ProcessMap` struct (contains `processes` (`[]ProcessInfo`), `lastscan`, `state`, `pids`). ### `osal.processinfo_get(pid int) !ProcessInfo` + Retrieves detailed information for a specific process by PID. -* **Parameters**: `pid` (int): Process ID. -* **Returns**: `ProcessInfo` struct (contains `cpu_perc`, `mem_perc`, `cmd`, `pid`, `ppid`, `rss`). + +* **Parameters**: `pid` (int): Process ID. +* **Returns**: `ProcessInfo` struct (contains `cpu_perc`, `mem_perc`, `cmd`, `pid`, `ppid`, `rss`). ### `osal.processinfo_get_byname(name string) ![]ProcessInfo` + Retrieves detailed information for processes matching a given name. -* **Parameters**: `name` (string): Process name (substring match). -* **Returns**: `[]ProcessInfo`. + +* **Parameters**: `name` (string): Process name (substring match). +* **Returns**: `[]ProcessInfo`. ### `osal.process_exists(pid int) bool` + Checks if a process with a given PID exists. -* **Parameters**: `pid` (int): Process ID. -* **Returns**: `bool`. + +* **Parameters**: `pid` (int): Process ID. +* **Returns**: `bool`. ### `osal.processinfo_with_children(pid int) !ProcessMap` + Returns a process and all its child processes. + ## 1.1. Done Context Management (`done.v`) Functions for managing a "done" context or state using Redis. -* **`osal.done_set(key string, val string) !`**: Sets a key-value pair in the "done" context. -* **`osal.done_get(key string) ?string`**: Retrieves a value from the "done" context by key. -* **`osal.done_delete(key string) !`**: Deletes a key from the "done" context. -* **`osal.done_get_str(key string) string`**: Retrieves a string value from the "done" context by key (panics on error). -* **`osal.done_get_int(key string) int`**: Retrieves an integer value from the "done" context by key (panics on error). -* **`osal.done_exists(key string) bool`**: Checks if a key exists in the "done" context. -* **`osal.done_print() !`**: Prints all key-value pairs in the "done" context to debug output. -* **`osal.done_reset() !`**: Resets (deletes all keys from) the "done" context. -* **Parameters**: `pid` (int): Parent Process ID. -* **Returns**: `ProcessMap`. +* **`osal.done_set(key string, val string) !`**: Sets a key-value pair in the "done" context. +* **`osal.done_get(key string) ?string`**: Retrieves a value from the "done" context by key. +* **`osal.done_delete(key string) !`**: Deletes a key from the "done" context. +* **`osal.done_get_str(key string) string`**: Retrieves a string value from the "done" context by key (panics on error). +* **`osal.done_get_int(key string) int`**: Retrieves an integer value from the "done" context by key (panics on error). +* **`osal.done_exists(key string) bool`**: Checks if a key exists in the "done" context. +* **`osal.done_print() !`**: Prints all key-value pairs in the "done" context to debug output. +* **`osal.done_reset() !`**: Resets (deletes all keys from) the "done" context. +* **Parameters**: `pid` (int): Parent Process ID. +* **Returns**: `ProcessMap`. ### `osal.processinfo_children(pid int) !ProcessMap` + Returns all child processes for a given PID. -* **Parameters**: `pid` (int): Parent Process ID. -* **Returns**: `ProcessMap`. + +* **Parameters**: `pid` (int): Parent Process ID. +* **Returns**: `ProcessMap`. ### `osal.process_kill_recursive(args: ProcessKillArgs) !` + Kills a process and all its children by name or PID. -* **Parameters**: - * `args` (`ProcessKillArgs` struct): - * `name` (string): Process name. - * `pid` (int): Process ID. + +* **Parameters**: + * `args` (`ProcessKillArgs` struct): + * `name` (string): Process name. + * `pid` (int): Process ID. ### `osal.process_exists_byname(name string) !bool` + Checks if a process with a given name exists. -* **Parameters**: `name` (string): Process name (substring match). -* **Returns**: `bool`. + +* **Parameters**: `name` (string): Process name (substring match). +* **Returns**: `bool`. + ### `osal.whoami() !string` + Returns the current username. -* **Returns**: `string`. + +* **Returns**: `string`. ## 2. Network Utilities ### `osal.ping(args: PingArgs) ! bool` + Checks host reachability. -* **Parameters**: + +* **Parameters**: + ### `osal.ipaddr_pub_get_check() !string` + Retrieves the public IP address and verifies it is bound to a local interface. -* **Returns**: `string`. + +* **Returns**: `string`. ### `osal.is_ip_on_local_interface(ip string) !bool` + Checks if a given IP address is bound to a local network interface. -* **Parameters**: `ip` (string): IP address to check. -* **Returns**: `bool`. - * `args` (`PingArgs` struct): - * `address` (string, required): IP address or hostname. - * `count` (u8, default: 1): Number of pings. - * `timeout` (u16, default: 1): Timeout in seconds per ping. - * `retry` (u8): Number of retry attempts. -* **Returns**: `PingResult` enum (`.ok`, `.timeout`, `.unknownhost`). + +* **Parameters**: `ip` (string): IP address to check. +* **Returns**: `bool`. + * `args` (`PingArgs` struct): + * `address` (string, required): IP address or hostname. + * `count` (u8, default: 1): Number of pings. + * `timeout` (u16, default: 1): Timeout in seconds per ping. + * `retry` (u8): Number of retry attempts. +* **Returns**: `PingResult` enum (`.ok`, `.timeout`, `.unknownhost`). ### `osal.tcp_port_test(args: TcpPortTestArgs) bool` + Tests if a TCP port is open on a given address. -* **Parameters**: - * `args` (`TcpPortTestArgs` struct): - * `address` (string, required): IP address or hostname. - * `port` (int, default: 22): TCP port number. - * `timeout` (u16, default: 2000): Total timeout in milliseconds. -* **Returns**: `bool`. + +* **Parameters**: + * `args` (`TcpPortTestArgs` struct): + * `address` (string, required): IP address or hostname. + * `port` (int, default: 22): TCP port number. + * `timeout` (u16, default: 2000): Total timeout in milliseconds. +* **Returns**: `bool`. ### `osal.ipaddr_pub_get() !string` + Retrieves the public IP address. -* **Returns**: `string`. + +* **Returns**: `string`. ### `osal.is_ip_on_local_interface(ip string) !bool` + Checks if a given IP address is bound to a local network interface. -* **Parameters**: `ip` (string): IP address to check. -* **Returns**: `bool`. + +* **Parameters**: `ip` (string): IP address to check. +* **Returns**: `bool`. ## 3. File System Operations ### `osal.file_write(path string, text string) !` + Writes text content to a file. -* **Parameters**: - * `path` (string): File path. - * `text` (string): Content to write. + +* **Parameters**: + * `path` (string): File path. + * `text` (string): Content to write. ### `osal.file_read(path string) !string` + Reads content from a file. -* **Parameters**: `path` (string): File path. -* **Returns**: `string` (file content). + +* **Parameters**: `path` (string): File path. +* **Returns**: `string` (file content). ### `osal.dir_ensure(path string) !` + Ensures a directory exists, creating it if necessary. -* **Parameters**: `path` (string): Directory path. + +* **Parameters**: `path` (string): Directory path. ### `osal.dir_delete(path string) !` + Deletes a directory if it exists. -* **Parameters**: `path` (string): Directory path. + +* **Parameters**: `path` (string): Directory path. ### `osal.dir_reset(path string) !` + Deletes and then recreates a directory. -* **Parameters**: `path` (string): Directory path. + +* **Parameters**: `path` (string): Directory path. ### `osal.rm(todelete string) !` + Removes files or directories. -* **Parameters**: `todelete` (string): Comma or newline separated list of paths (supports `~` for home directory). + +* **Parameters**: `todelete` (string): Comma or newline separated list of paths (supports `~` for home directory). ### `osal.env_get_all() map[string]string` + Returns all existing environment variables as a map. -* **Returns**: `map[string]string`. + +* **Returns**: `map[string]string`. + ## 4. Environment Variables + ## 4.1. Package Management (`package.v`) Functions for managing system packages. -* **`osal.package_refresh() !`**: Updates the package list for the detected platform. -* **`osal.package_install(name_ string) !`**: Installs one or more packages. -* **`osal.package_remove(name_ string) !`**: Removes one or more packages. +* **`osal.package_refresh() !`**: Updates the package list for the detected platform. +* **`osal.package_install(name_ string) !`**: Installs one or more packages. +* **`osal.package_remove(name_ string) !`**: Removes one or more packages. ### `osal.env_set(args: EnvSet)` + Sets an environment variable. -* **Parameters**: - * `args` (`EnvSet` struct): - * `key` (string, required): Environment variable name. - * `value` (string, required): Value to set. - * `overwrite` (bool, default: true): Overwrite if exists. + +* **Parameters**: + * `args` (`EnvSet` struct): + * `key` (string, required): Environment variable name. + * `value` (string, required): Value to set. + * `overwrite` (bool, default: true): Overwrite if exists. ### `osal.env_unset(key string)` + Unsets a specific environment variable. -* **Parameters**: `key` (string): Environment variable name. + +* **Parameters**: `key` (string): Environment variable name. ### `osal.env_unset_all()` + Unsets all environment variables. ### `osal.env_set_all(args: EnvSetAll)` + Sets multiple environment variables. -* **Parameters**: - * `args` (`EnvSetAll` struct): - * `env` (map[string]string): Map of key-value pairs. - * `clear_before_set` (bool): Clear all existing variables before setting. - * `overwrite_if_exists` (bool, default: true): Overwrite existing variables. + +* **Parameters**: + * `args` (`EnvSetAll` struct): + * `env` (map[string]string): Map of key-value pairs. + * `clear_before_set` (bool): Clear all existing variables before setting. + * `overwrite_if_exists` (bool, default: true): Overwrite existing variables. ### `osal.env_get(key string) !string` + Retrieves the value of a specific environment variable. -* **Parameters**: `key` (string): Environment variable name. -* **Returns**: `string` (variable value). + +* **Parameters**: `key` (string): Environment variable name. +* **Returns**: `string` (variable value). ### `osal.env_exists(key string) !bool` + Checks if an environment variable exists. -* **Parameters**: `key` (string): Environment variable name. -* **Returns**: `bool`. + +* **Parameters**: `key` (string): Environment variable name. +* **Returns**: `bool`. ### `osal.env_get_default(key string, def string) string` + Retrieves an environment variable or a default value if not found. -* **Parameters**: - * `key` (string): Environment variable name. - * `def` (string): Default value. -* **Returns**: `string`. + +* **Parameters**: + * `key` (string): Environment variable name. + * `def` (string): Default value. +* **Returns**: `string`. ### `osal.load_env_file(file_path string) !` + Loads environment variables from a specified file. -* **Parameters**: `file_path` (string): Path to the environment file. + +* **Parameters**: `file_path` (string): Path to the environment file. ## 5. Command & Profile Management ### `osal.cmd_add(args: CmdAddArgs) !` + Adds (copies or symlinks) a binary to system paths and updates user profiles. -* **Parameters**: - * `args` (`CmdAddArgs` struct): - * `cmdname` (string): Name of the command (optional, derived from source if empty). - * `source` (string, required): Path to the binary. - * `symlink` (bool): Create a symlink instead of copying. - * `reset` (bool, default: true): Delete existing command if found. + +* **Parameters**: + * `args` (`CmdAddArgs` struct): + * `cmdname` (string): Name of the command (optional, derived from source if empty). + * `source` (string, required): Path to the binary. + * `symlink` (bool): Create a symlink instead of copying. + * `reset` (bool, default: true): Delete existing command if found. ### `osal.profile_path_add_hero() !string` + Ensures the `~/hero/bin` path is added to the user's profile. -* **Returns**: `string` (the `~/hero/bin` path). + +* **Returns**: `string` (the `~/hero/bin` path). ### `osal.bin_path() !string` + Returns the preferred binary installation path (`~/hero/bin`). -* **Returns**: `string`. + +* **Returns**: `string`. ### `osal.hero_path() !string` + Returns the `~/hero` directory path. -* **Returns**: `string`. + +* **Returns**: `string`. ### `osal.usr_local_path() !string` + Returns `/usr/local` for Linux or `~/hero` for macOS. -* **Returns**: `string`. + +* **Returns**: `string`. ### `osal.cmd_exists_profile(cmd string) bool` + Checks if a command exists in the system's PATH, considering the user's profile. -* **Parameters**: `cmd` (string): The command name. -* **Returns**: `bool`. + +* **Parameters**: `cmd` (string): The command name. +* **Returns**: `bool`. + ### `osal.profile_path_source() !string` + Returns a source statement for the preferred profile file (e.g., `. /home/user/.zprofile`). -* **Returns**: `string`. + +* **Returns**: `string`. ### `osal.profile_path_source_and() !string` + Returns a source statement followed by `&&` for command chaining, or empty if profile doesn't exist. -* **Returns**: `string`. + +* **Returns**: `string`. ### `osal.profile_path_add_remove(args: ProfilePathAddRemoveArgs) !` + Adds and/or removes paths from specified or preferred user profiles. -* **Parameters**: - * `args` (`ProfilePathAddRemoveArgs` struct): - * `paths_profile` (string): Comma/newline separated list of profile file paths (optional, uses preferred if empty). - * `paths2add` (string): Comma/newline separated list of paths to add. - * `paths2delete` (string): Comma/newline separated list of paths to delete. - * `allprofiles` (bool): Apply to all known profile files. + +* **Parameters**: + * `args` (`ProfilePathAddRemoveArgs` struct): + * `paths_profile` (string): Comma/newline separated list of profile file paths (optional, uses preferred if empty). + * `paths2add` (string): Comma/newline separated list of paths to add. + * `paths2delete` (string): Comma/newline separated list of paths to delete. + * `allprofiles` (bool): Apply to all known profile files. ### `osal.cmd_path(cmd string) !string` + Returns the full path of an executable command using `which`. -* **Parameters**: `cmd` (string): Command name. -* **Returns**: `string` (full path). + +* **Parameters**: `cmd` (string): Command name. +* **Returns**: `string` (full path). ### `osal.cmd_delete(cmd string) !` + Deletes commands from their found locations. -* **Parameters**: `cmd` (string): Command name. + +* **Parameters**: `cmd` (string): Command name. ### `osal.profile_paths_all() ![]string` + Lists all possible profile file paths in the OS. -* **Returns**: `[]string`. + +* **Returns**: `[]string`. ### `osal.profile_paths_preferred() ![]string` + ## 5.1. SSH Key Management (`ssh_key.v`) Functions and structs for managing SSH keys. ### `struct SSHKey` + Represents an SSH key pair. -* **Fields**: `name` (string), `directory` (string). -* **Methods**: - * `public_key_path() !pathlib.Path`: Returns the path to the public key. - * `private_key_path() !pathlib.Path`: Returns the path to the private key. - * `public_key() !string`: Returns the content of the public key. - * `private_key() !string`: Returns the content of the private key. + +* **Fields**: `name` (string), `directory` (string). +* **Methods**: + * `public_key_path() !pathlib.Path`: Returns the path to the public key. + * `private_key_path() !pathlib.Path`: Returns the path to the private key. + * `public_key() !string`: Returns the content of the public key. + * `private_key() !string`: Returns the content of the private key. ### `struct SSHConfig` + Configuration for SSH key operations. -* **Fields**: `directory` (string, default: `~/.ssh`). + +* **Fields**: `directory` (string, default: `~/.ssh`). ### `osal.get_ssh_key(key_name string, config SSHConfig) ?SSHKey` + Retrieves a specific SSH key by name. -* **Parameters**: `key_name` (string), `config` (`SSHConfig` struct). -* **Returns**: `?SSHKey` (optional SSHKey struct). + +* **Parameters**: `key_name` (string), `config` (`SSHConfig` struct). +* **Returns**: `?SSHKey` (optional SSHKey struct). ### `osal.list_ssh_keys(config SSHConfig) ![]SSHKey` + Lists all SSH keys in the specified directory. -* **Parameters**: `config` (`SSHConfig` struct). -* **Returns**: `[]SSHKey`. + +* **Parameters**: `config` (`SSHConfig` struct). +* **Returns**: `[]SSHKey`. ### `osal.new_ssh_key(key_name string, config SSHConfig) !SSHKey` + Creates a new SSH key pair. -* **Parameters**: `key_name` (string), `config` (`SSHConfig` struct). -* **Returns**: `SSHKey`. + +* **Parameters**: `key_name` (string), `config` (`SSHConfig` struct). +* **Returns**: `SSHKey`. Lists preferred profile file paths based on the operating system. -* **Returns**: `[]string`. +* **Returns**: `[]string`. ### `osal.profile_path() !string` + Returns the most preferred profile file path. -* **Returns**: `string`. + +* **Returns**: `string`. ## 6. System Information & Utilities ### `osal.platform() !PlatformType` + Identifies the operating system. -* **Returns**: `PlatformType` enum (`.unknown`, `.osx`, `.ubuntu`, `.alpine`, `.arch`, `.suse`). + +* **Returns**: `PlatformType` enum (`.unknown`, `.osx`, `.ubuntu`, `.alpine`, `.arch`, `.suse`). ### `osal.cputype() !CPUType` + Identifies the CPU architecture. -* **Returns**: `CPUType` enum (`.unknown`, `.intel`, `.arm`, `.intel32`, `.arm32`). + +* **Returns**: `CPUType` enum (`.unknown`, `.intel`, `.arm`, `.intel32`, `.arm32`). ### `osal.is_linux() !bool` + Checks if the current OS is Linux. -* **Returns**: `bool`. + +* **Returns**: `bool`. ### `osal.is_osx() !bool` + Checks if the current OS is macOS. -* **Returns**: `bool`. + +* **Returns**: `bool`. ### `osal.is_ubuntu() !bool` + Checks if the current OS is Ubuntu. -* **Returns**: `bool`. + +* **Returns**: `bool`. ### `osal.is_osx_arm() !bool` + Checks if the current OS is macOS ARM. -* **Returns**: `bool`. + +* **Returns**: `bool`. ### `osal.is_linux_arm() !bool` + Checks if the current OS is Linux ARM. -* **Returns**: `bool`. + +* **Returns**: `bool`. ### `osal.is_osx_intel() !bool` + Checks if the current OS is macOS Intel. -* **Returns**: `bool`. + +* **Returns**: `bool`. ### `osal.is_linux_intel() !bool` + Checks if the current OS is Linux Intel. -* **Returns**: `bool`. + +* **Returns**: `bool`. ### `osal.hostname() !string` + Returns the system hostname. -* **Returns**: `string`. + +* **Returns**: `string`. ### `osal.initname() !string` + Returns the init system name (e.g., `systemd`, `bash`, `zinit`). -* **Returns**: `string`. + +* **Returns**: `string`. ### `osal.sleep(duration int)` + Pauses execution for a specified duration. -* **Parameters**: `duration` (int): Sleep duration in seconds. + +* **Parameters**: `duration` (int): Sleep duration in seconds. ### `osal.download(args: DownloadArgs) !pathlib.Path` + Downloads a file from a URL. -* **Parameters**: - * `args` (`DownloadArgs` struct): - * `url` (string, required): URL of the file. - * `name` (string): Optional, derived from filename if empty. - * `reset` (bool): Force download, remove existing. - * `hash` (string): Hash for verification. - * `dest` (string): Destination path. - * `timeout` (int, default: 180): Download timeout in seconds. - * `retry` (int, default: 3): Number of retries. - * `minsize_kb` (u32, default: 10): Minimum expected size in KB. - * `maxsize_kb` (u32): Maximum expected size in KB. - * `expand_dir` (string): Directory to expand archive into. - * `expand_file` (string): File to expand archive into. -* **Returns**: `pathlib.Path` (path to the downloaded file/directory). + +* **Parameters**: + * `args` (`DownloadArgs` struct): + * `url` (string, required): URL of the file. + * `name` (string): Optional, derived from filename if empty. + * `reset` (bool): Force download, remove existing. + * `hash` (string): Hash for verification. + * `dest` (string): Destination path. + * `timeout` (int, default: 180): Download timeout in seconds. + * `retry` (int, default: 3): Number of retries. + * `minsize_kb` (u32, default: 10): Minimum expected size in KB. + * `maxsize_kb` (u32): Maximum expected size in KB. + * `expand_dir` (string): Directory to expand archive into. + * `expand_file` (string): File to expand archive into. +* **Returns**: `pathlib.Path` (path to the downloaded file/directory). ### `osal.user_exists(username string) bool` + Checks if a user exists on the system. -* **Parameters**: `username` (string): Username to check. -* **Returns**: `bool`. + +* **Parameters**: `username` (string): Username to check. +* **Returns**: `bool`. ### `osal.user_id_get(username string) !int` + Retrieves the user ID for a given username. -* **Parameters**: `username` (string): Username. -* **Returns**: `int` (User ID). + +* **Parameters**: `username` (string): Username. +* **Returns**: `int` (User ID). ### `osal.user_add(args: UserArgs) !int` + Adds a new user to the system. -* **Parameters**: - * `args` (`UserArgs` struct): - * `name` (string, required): Username to add. -* **Returns**: `int` (User ID of the added user). + +* **Parameters**: + * `args` (`UserArgs` struct): + * `name` (string, required): Username to add. +* **Returns**: `int` (User ID of the added user). ## Enums & Structs ### `enum PlatformType` + Represents the detected operating system. -* Values: `unknown`, `osx`, `ubuntu`, `alpine`, `arch`, `suse`. + +* Values: `unknown`, `osx`, `ubuntu`, `alpine`, `arch`, `suse`. ### `enum CPUType` + Represents the detected CPU architecture. -* Values: `unknown`, `intel`, `arm`, `intel32`, `arm32`. + +* Values: `unknown`, `intel`, `arm`, `intel32`, `arm32`. ### `enum RunTime` + Specifies the runtime environment for command execution. -* Values: `bash`, `python`, `heroscript`, `herocmd`, `v`. + +* Values: `bash`, `python`, `heroscript`, `herocmd`, `v`. ### `enum JobStatus` + Status of an executed command job. -* Values: `init`, `running`, `error_exec`, `error_timeout`, `error_args`, `done`. + +* Values: `init`, `running`, `error_exec`, `error_timeout`, `error_args`, `done`. ### `enum ErrorType` + Types of errors that can occur during job execution. -* Values: `exec`, `timeout`, `args`. + +* Values: `exec`, `timeout`, `args`. ### `enum PingResult` + Result of a ping operation. -* Values: `ok`, `timeout`, `unknownhost`. + +* Values: `ok`, `timeout`, `unknownhost`. ### `struct Command` + Configuration for `osal.exec` function. (See `osal.exec` parameters for fields). ### `struct Job` + Result object returned by `osal.exec`. (See `osal.exec` returns for fields). ### `struct JobError` + Error details for failed jobs. ### `struct PingArgs` + Arguments for `osal.ping` function. (See `osal.ping` parameters for fields). ### `struct TcpPortTestArgs` + Arguments for `osal.tcp_port_test` function. (See `osal.tcp_port_test` parameters for fields). ### `struct EnvSet` + Arguments for `osal.env_set` function. (See `osal.env_set` parameters for fields). ### `struct EnvSetAll` + Arguments for `osal.env_set_all` function. (See `osal.env_set_all` parameters for fields). ### `struct CmdAddArgs` + Arguments for `osal.cmd_add` function. (See `osal.cmd_add` parameters for fields). ### `struct ProfilePathAddRemoveArgs` + Arguments for `osal.profile_path_add_remove` function. (See `osal.profile_path_add_remove` parameters for fields). ### `struct ProcessMap` + Contains a list of `ProcessInfo` objects. ### `struct ProcessInfo` + Detailed information about a single process. (See `osal.processinfo_get` returns for fields). ### `struct ProcessKillArgs` + Arguments for `osal.process_kill_recursive` function. (See `osal.process_kill_recursive` parameters for fields). ### `struct DownloadArgs` + Arguments for `osal.download` function. (See `osal.download` parameters for fields). ### `struct UserArgs` + Arguments for `osal.user_add` function. (See `osal.user_add` parameters for fields). diff --git a/aiprompts/herolib_advanced/ourdb.md b/aiprompts/herolib_advanced/ourdb.md index 5c5cb5ce..086ddb42 100644 --- a/aiprompts/herolib_advanced/ourdb.md +++ b/aiprompts/herolib_advanced/ourdb.md @@ -3,6 +3,7 @@ The `OurTime` module in V provides flexible time handling, supporting relative and absolute time formats, Unix timestamps, and formatting utilities. ## Key Features + - Create time objects from strings or current time - Relative time expressions (e.g., `+1h`, `-2d`) - Absolute time formats (e.g., `YYYY-MM-DD HH:mm:ss`) @@ -12,7 +13,7 @@ The `OurTime` module in V provides flexible time handling, supporting relative a ## Basic Usage ```v -import freeflowuniverse.herolib.data.ourtime +import incubaid.herolib.data.ourtime // Current time mut t := ourtime.now() diff --git a/aiprompts/herolib_advanced/spreadsheet.md b/aiprompts/herolib_advanced/spreadsheet.md index 68174acf..fee5e9eb 100644 --- a/aiprompts/herolib_advanced/spreadsheet.md +++ b/aiprompts/herolib_advanced/spreadsheet.md @@ -1,6 +1,6 @@ # Herolib Spreadsheet Module for AI Prompt Engineering -This document provides an overview and usage instructions for the `freeflowuniverse.herolib.biz.spreadsheet` module, which offers a powerful software representation of a spreadsheet. This module is designed for business modeling, data analysis, and can be leveraged in AI prompt engineering scenarios where structured data manipulation and visualization are required. +This document provides an overview and usage instructions for the `incubaid.herolib.biz.spreadsheet` module, which offers a powerful software representation of a spreadsheet. This module is designed for business modeling, data analysis, and can be leveraged in AI prompt engineering scenarios where structured data manipulation and visualization are required. ## 1. Core Concepts @@ -10,16 +10,17 @@ The spreadsheet module revolves around three main entities: `Sheet`, `Row`, and The `Sheet` is the primary container, representing the entire spreadsheet. -* **Properties:** - * `name` (string): A unique identifier for the sheet. - * `rows` (map[string]&Row): A collection of `Row` objects, indexed by their names. - * `nrcol` (int): The number of columns in the sheet (e.g., 60 for 5 years of monthly data). - * `params` (SheetParams): Configuration parameters, e.g., `visualize_cur` (boolean to display currency symbols). - * `currency` (currency.Currency): The default currency for the sheet (e.g., USD), used for automatic conversions. +* **Properties:** + * `name` (string): A unique identifier for the sheet. + * `rows` (map[string]&Row): A collection of `Row` objects, indexed by their names. + * `nrcol` (int): The number of columns in the sheet (e.g., 60 for 5 years of monthly data). + * `params` (SheetParams): Configuration parameters, e.g., `visualize_cur` (boolean to display currency symbols). + * `currency` (currency.Currency): The default currency for the sheet (e.g., USD), used for automatic conversions. + +* **Creation:** -* **Creation:** ```v - import freeflowuniverse.herolib.biz.spreadsheet + import incubaid.herolib.biz.spreadsheet // Create a new sheet named 'my_financial_sheet' with 60 columns (e.g., 60 months) mut my_sheet := spreadsheet.sheet_new( @@ -33,28 +34,29 @@ The `Sheet` is the primary container, representing the entire spreadsheet. mut existing_sheet := spreadsheet.sheet_get('my_financial_sheet')! ``` -* **Key Operations:** - * `sheet.row_get(name string) !&Row`: Retrieves a row by its name. - * `sheet.cell_get(row string, col int) !&Cell`: Retrieves a cell by row name and column index. - * `sheet.row_delete(name string)` / `sheet.delete(name string)`: Deletes a row. - * `sheet.cells_width(colnr int) !int`: Finds the maximum string length of cells in a given column. - * `sheet.rows_names_width_max() int`: Returns the maximum width of row names/aliases. - * `sheet.rows_description_width_max() int`: Returns the maximum width of row descriptions. - * `sheet.header() ![]string`: Generates column headers (e.g., "M1", "Q1", "Y1") based on `nrcol`. +* **Key Operations:** + * `sheet.row_get(name string) !&Row`: Retrieves a row by its name. + * `sheet.cell_get(row string, col int) !&Cell`: Retrieves a cell by row name and column index. + * `sheet.row_delete(name string)` / `sheet.delete(name string)`: Deletes a row. + * `sheet.cells_width(colnr int) !int`: Finds the maximum string length of cells in a given column. + * `sheet.rows_names_width_max() int`: Returns the maximum width of row names/aliases. + * `sheet.rows_description_width_max() int`: Returns the maximum width of row descriptions. + * `sheet.header() ![]string`: Generates column headers (e.g., "M1", "Q1", "Y1") based on `nrcol`. ### 1.2. Row A `Row` represents a single horizontal line of data within a `Sheet`. -* **Properties:** - * `name` (string): Unique identifier for the row. - * `alias` (string, optional): Alternative name. - * `description` (string): Textual description. - * `tags` (string): Space-separated tags for categorization (e.g., "department:hr location:belgium"). - * `cells` ([]Cell): List of `Cell` objects. - * `aggregatetype` (RowAggregateType): Defines default aggregation for this row (`.sum`, `.avg`, `.max`, `.min`). +* **Properties:** + * `name` (string): Unique identifier for the row. + * `alias` (string, optional): Alternative name. + * `description` (string): Textual description. + * `tags` (string): Space-separated tags for categorization (e.g., "department:hr location:belgium"). + * `cells` ([]Cell): List of `Cell` objects. + * `aggregatetype` (RowAggregateType): Defines default aggregation for this row (`.sum`, `.avg`, `.max`, `.min`). + +* **Creation (within a Sheet):** -* **Creation (within a Sheet):** ```v // Assuming 'my_sheet' is an existing Sheet object mut salaries_row := my_sheet.row_new( @@ -65,21 +67,21 @@ A `Row` represents a single horizontal line of data within a `Sheet`. )! ``` -* **Key Operations:** - * `row.values_get() []f64`: Returns all cell values in the row as a list of floats. +* **Key Operations:** + * `row.values_get() []f64`: Returns all cell values in the row as a list of floats. ### 1.3. Cell A `Cell` is the fundamental unit of data, storing a numeric value. -* **Properties:** - * `val` (f64): The numeric value. - * `empty` (bool): `true` if the cell is empty. +* **Properties:** + * `val` (f64): The numeric value. + * `empty` (bool): `true` if the cell is empty. -* **Key Operations:** - * `cell.set(v string) !`: Sets the cell's value. Handles currency strings (e.g., "100 USD") by converting to the sheet's currency. - * `cell.add(v f64)`: Adds a numeric value to the existing cell value. - * `cell.repr() string`: Returns a formatted string representation of the value (e.g., "100.00", or "-" if empty). +* **Key Operations:** + * `cell.set(v string) !`: Sets the cell's value. Handles currency strings (e.g., "100 USD") by converting to the sheet's currency. + * `cell.add(v f64)`: Adds a numeric value to the existing cell value. + * `cell.repr() string`: Returns a formatted string representation of the value (e.g., "100.00", or "-" if empty). ## 2. Data Aggregation and Transformation @@ -144,10 +146,10 @@ csv_string := my_sheet.export_csv(path: '')! println(csv_string) ``` -* **`ExportCSVArgs` Parameters:** - * `path` (string, optional): File path. Empty string returns content as string. `~` is expanded to home directory. - * `include_empty` (bool, optional, default: `false`): If `true`, empty cells are included. - * `separator` (string, optional, default: `'|'`): Delimiter character. +* **`ExportCSVArgs` Parameters:** + * `path` (string, optional): File path. Empty string returns content as string. `~` is expanded to home directory. + * `include_empty` (bool, optional, default: `false`): If `true`, empty cells are included. + * `separator` (string, optional, default: `'|'`): Delimiter character. ## 4. Charting Capabilities @@ -157,25 +159,26 @@ Integrates with ECharts for data visualization. Charting functions return an `ec Used across line, bar, and pie charts to specify data and presentation. -* `rowname` (string, optional): Single row name or comma-separated list. -* `namefilter` ([]string, optional): List of exact row names to include. -* `includefilter` ([]string, optional): List of tags to include. -* `excludefilter` ([]string, optional): List of tags to exclude. -* `period_type` (PeriodType, optional): X-axis period (`.month`, `.quarter`, `.year`). -* `aggregate` (bool, optional, default: `true`): Aggregate multiple matching rows. -* `aggregatetype` (RowAggregateType, optional, default: `.sum`): Aggregation type. -* `unit` (UnitType, optional): Data unit. -* `title`, `title_sub` (string, optional): Chart titles. -* `size` (string, optional): For pie charts, defines radius (e.g., "70%"). -* `rowname_show` (bool, optional, default: `true`): Show row name in legend. -* `descr_show` (bool, optional, default: `false`): Show row description (overrides `rowname_show`). -* `description` (string, optional): General chart description. +* `rowname` (string, optional): Single row name or comma-separated list. +* `namefilter` ([]string, optional): List of exact row names to include. +* `includefilter` ([]string, optional): List of tags to include. +* `excludefilter` ([]string, optional): List of tags to exclude. +* `period_type` (PeriodType, optional): X-axis period (`.month`, `.quarter`, `.year`). +* `aggregate` (bool, optional, default: `true`): Aggregate multiple matching rows. +* `aggregatetype` (RowAggregateType, optional, default: `.sum`): Aggregation type. +* `unit` (UnitType, optional): Data unit. +* `title`, `title_sub` (string, optional): Chart titles. +* `size` (string, optional): For pie charts, defines radius (e.g., "70%"). +* `rowname_show` (bool, optional, default: `true`): Show row name in legend. +* `descr_show` (bool, optional, default: `false`): Show row description (overrides `rowname_show`). +* `description` (string, optional): General chart description. ### 4.2. Chart Types -* **Line Chart (`line_chart`)**: Visualizes trends over time. +* **Line Chart (`line_chart`)**: Visualizes trends over time. + ```v - import freeflowuniverse.herolib.web.echarts // Required for EChartsOption type + import incubaid.herolib.web.echarts // Required for EChartsOption type line_chart_option := my_sheet.line_chart( rowname: 'revenue_row,expenses_row', @@ -184,7 +187,8 @@ Used across line, bar, and pie charts to specify data and presentation. )! ``` -* **Bar Chart (`bar_chart`)**: Compares discrete categories or values. +* **Bar Chart (`bar_chart`)**: Compares discrete categories or values. + ```v bar_chart_option := my_sheet.bar_chart( rowname: 'profit_row', @@ -193,7 +197,8 @@ Used across line, bar, and pie charts to specify data and presentation. )! ``` -* **Pie Chart (`pie_chart`)**: Shows proportions of categories. +* **Pie Chart (`pie_chart`)**: Shows proportions of categories. + ```v pie_chart_option := my_sheet.pie_chart( rowname: 'budget_allocation_row', @@ -203,4 +208,4 @@ Used across line, bar, and pie charts to specify data and presentation. )! ``` -This documentation should provide sufficient information for an AI to understand and utilize the `lib/biz/spreadsheet` module effectively for various data manipulation and visualization tasks. \ No newline at end of file +This documentation should provide sufficient information for an AI to understand and utilize the `lib/biz/spreadsheet` module effectively for various data manipulation and visualization tasks. diff --git a/aiprompts/herolib_advanced/ui console chalk.md b/aiprompts/herolib_advanced/ui console chalk.md index 0b267216..a73e7b53 100644 --- a/aiprompts/herolib_advanced/ui console chalk.md +++ b/aiprompts/herolib_advanced/ui console chalk.md @@ -8,7 +8,7 @@ Chalk offers functions:- `console.color_fg(text string, color string)` - To chan Example: ```v -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console # basic usage println('I am really ' + console.color_fg('happy', 'green')) diff --git a/aiprompts/herolib_core/core_globals.md b/aiprompts/herolib_core/core_globals.md index a4be6957..8158880d 100644 --- a/aiprompts/herolib_core/core_globals.md +++ b/aiprompts/herolib_core/core_globals.md @@ -6,39 +6,39 @@ the following is a good pragmatic way to remember clients, installers as a globa module docsite -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.texttools __global ( - siteconfigs map[string]&SiteConfig + siteconfigs map[string]&SiteConfig ) @[params] pub struct FactoryArgs { pub mut: - name string = "default" + name string = "default" } pub fn new(args FactoryArgs) !&SiteConfig { - name := texttools.name_fix(args.name) - siteconfigs[name] = &SiteConfig{ - name: name - } - return get(name:name)! + name := texttools.name_fix(args.name) + siteconfigs[name] = &SiteConfig{ + name: name + } + return get(name:name)! } pub fn get(args FactoryArgs) !&SiteConfig { - name := texttools.name_fix(args.name) - mut sc := siteconfigs[name] or { - return error('siteconfig with name "${name}" does not exist') - } - return sc + name := texttools.name_fix(args.name) + mut sc := siteconfigs[name] or { + return error('siteconfig with name "${name}" does not exist') + } + return sc } pub fn default() !&SiteConfig { - if siteconfigs.len == 0 { - return new(name:'default')! - } - return get()! + if siteconfigs.len == 0 { + return new(name:'default')! + } + return get()! } -``` \ No newline at end of file +``` diff --git a/aiprompts/herolib_core/core_heroscript_basics.md b/aiprompts/herolib_core/core_heroscript_basics.md index 2456d8f4..c5ed9c77 100644 --- a/aiprompts/herolib_core/core_heroscript_basics.md +++ b/aiprompts/herolib_core/core_heroscript_basics.md @@ -6,49 +6,49 @@ HeroScript is a concise scripting language with the following structure: ```heroscript !!actor.action_name - param1: 'value1' - param2: 'value with spaces' - multiline_description: ' - This is a multiline description. - It can span multiple lines. - ' - arg1 arg2 // Arguments without keys + param1: 'value1' + param2: 'value with spaces' + multiline_description: ' + This is a multiline description. + It can span multiple lines. + ' + arg1 arg2 // Arguments without keys ``` Key characteristics: -- **Actions**: Start with `!!`, followed by `actor.action_name` (e.g., `!!mailclient.configure`). -- **Parameters**: Defined as `key:value`. Values can be quoted for spaces. -- **Multiline Support**: Parameters like `description` can span multiple lines. -- **Arguments**: Values without keys (e.g., `arg1`). + +- **Actions**: Start with `!!`, followed by `actor.action_name` (e.g., `!!mailclient.configure`). +- **Parameters**: Defined as `key:value`. Values can be quoted for spaces. +- **Multiline Support**: Parameters like `description` can span multiple lines. +- **Arguments**: Values without keys (e.g., `arg1`). ## Processing HeroScript in Vlang HeroScript can be parsed into a `playbook.PlayBook` object, allowing structured access to actions and their parameters, this is used in most of the herolib modules, it allows configuration or actions in a structured way. ```v -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console pub fn play(mut plbook PlayBook) ! { - if plbook.exists_once(filter: 'docusaurus.define') { - mut action := plbook.get(filter: 'docusaurus.define')! - mut p := action.params - //example how we get parameters from the action see core_params.md for more details - ds = new( - path: p.get_default('path_publish', '')! - production: p.get_default_false('production') - )! - } + if plbook.exists_once(filter: 'docusaurus.define') { + mut action := plbook.get(filter: 'docusaurus.define')! + mut p := action.params + //example how we get parameters from the action see core_params.md for more details + ds = new( + path: p.get_default('path_publish', '')! + production: p.get_default_false('production') + )! + } - // Process 'docusaurus.add' actions to configure individual Docusaurus sites - actions := plbook.find(filter: 'docusaurus.add')! - for action in actions { - mut p := action.params - //do more processing here - } + // Process 'docusaurus.add' actions to configure individual Docusaurus sites + actions := plbook.find(filter: 'docusaurus.add')! + for action in actions { + mut p := action.params + //do more processing here + } } ``` For detailed information on parameter retrieval methods (e.g., `p.get()`, `p.get_int()`, `p.get_default_true()`), refer to `aiprompts/ai_core/core_params.md`. - diff --git a/aiprompts/herolib_core/core_heroscript_playbook.md b/aiprompts/herolib_core/core_heroscript_playbook.md index 010714fc..45060163 100644 --- a/aiprompts/herolib_core/core_heroscript_playbook.md +++ b/aiprompts/herolib_core/core_heroscript_playbook.md @@ -5,8 +5,8 @@ HeroScript can be parsed into a `playbook.PlayBook` object, allowing structured access to actions and their parameters. ```v -import freeflowuniverse.herolib.core.playbook -import freeflowuniverse.herolib.core.playcmds +import incubaid.herolib.core.playbook +import incubaid.herolib.core.playcmds // path string // text string @@ -21,5 +21,3 @@ mut plbook := playbook.new(path: "....")! playcmds.run(mut plbook)! ``` - - diff --git a/aiprompts/herolib_core/core_http_client.md b/aiprompts/herolib_core/core_http_client.md index 8f07a6d0..b64ae513 100644 --- a/aiprompts/herolib_core/core_http_client.md +++ b/aiprompts/herolib_core/core_http_client.md @@ -3,6 +3,7 @@ The `HTTPConnection` module provides a robust HTTP client for Vlang, supporting JSON, custom headers, retries, and caching. ## Key Features + - Type-safe JSON methods - Custom headers - Retry mechanism @@ -12,7 +13,7 @@ The `HTTPConnection` module provides a robust HTTP client for Vlang, supporting ## Basic Usage ```v -import freeflowuniverse.herolib.core.httpconnection +import incubaid.herolib.core.httpconnection // Create a new HTTP connection mut conn := httpconnection.new( @@ -30,17 +31,17 @@ To integrate `HTTPConnection` into a management class (e.g., `HetznerManager`), ```v // Example: HetznerManager pub fn (mut h HetznerManager) connection() !&httpconnection.HTTPConnection { - mut c := h.conn or { - mut c2 := httpconnection.new( - name: 'hetzner_${h.name}' - url: h.baseurl - cache: true - retry: 3 - )! - c2.basic_auth(h.user, h.password) - c2 - } - return c + mut c := h.conn or { + mut c2 := httpconnection.new( + name: 'hetzner_${h.name}' + url: h.baseurl + cache: true + retry: 3 + )! + c2.basic_auth(h.user, h.password) + c2 + } + return c } ``` diff --git a/aiprompts/herolib_core/core_osal.md b/aiprompts/herolib_core/core_osal.md index 48f7f9c4..72a95fdf 100644 --- a/aiprompts/herolib_core/core_osal.md +++ b/aiprompts/herolib_core/core_osal.md @@ -1,9 +1,9 @@ -# OSAL Core Module - Key Capabilities (freeflowuniverse.herolib.osal.core) +# OSAL Core Module - Key Capabilities (incubaid.herolib.osal.core) ```v //example how to get started -import freeflowuniverse.herolib.osal.core as osal +import incubaid.herolib.osal.core as osal job := osal.exec(cmd: 'ls /')! ``` @@ -12,70 +12,70 @@ This document describes the core functionalities of the Operating System Abstrac ## 1. Process Execution -* **`osal.exec(cmd: Command) !Job`**: Execute a shell command. - * **Key Parameters**: `cmd` (string), `timeout` (int), `retry` (int), `work_folder` (string), `environment` (map[string]string), `stdout` (bool), `raise_error` (bool). - * **Returns**: `Job` (status, output, error, exit code). -* **`osal.execute_silent(cmd string) !string`**: Execute silently, return output. -* **`osal.execute_debug(cmd string) !string`**: Execute with debug output, return output. -* **`osal.execute_stdout(cmd string) !string`**: Execute and print output to stdout, return output. -* **`osal.execute_interactive(cmd string) !`**: Execute in an interactive shell. -* **`osal.cmd_exists(cmd string) bool`**: Check if a command exists. +* **`osal.exec(cmd: Command) !Job`**: Execute a shell command. + * **Key Parameters**: `cmd` (string), `timeout` (int), `retry` (int), `work_folder` (string), `environment` (map[string]string), `stdout` (bool), `raise_error` (bool). + * **Returns**: `Job` (status, output, error, exit code). +* **`osal.execute_silent(cmd string) !string`**: Execute silently, return output. +* **`osal.execute_debug(cmd string) !string`**: Execute with debug output, return output. +* **`osal.execute_stdout(cmd string) !string`**: Execute and print output to stdout, return output. +* **`osal.execute_interactive(cmd string) !`**: Execute in an interactive shell. +* **`osal.cmd_exists(cmd string) bool`**: Check if a command exists. ## 2. Network Utilities -* **`osal.ping(args: PingArgs) !bool`**: Check host reachability. - - address string = "8.8.8.8" - - nr_ping u16 = 3 // amount of ping requests we will do - - nr_ok u16 = 3 //how many of them need to be ok - - retry u8 //how many times fo we retry above sequence, basically we ping ourselves with -c 1 +* **`osal.ping(args: PingArgs) !bool`**: Check host reachability. + - address string = "8.8.8.8" + - nr_ping u16 = 3 // amount of ping requests we will do + - nr_ok u16 = 3 //how many of them need to be ok + - retry u8 //how many times fo we retry above sequence, basically we ping ourselves with -c 1 **`osal.ipaddr_pub_get() !string`**: Get public IP address. ## 3. File System Operations -* **`osal.file_write(path string, text string) !`**: Write text to a file. -* **`osal.file_read(path string) !string`**: Read content from a file. -* **`osal.dir_ensure(path string) !`**: Ensure a directory exists. -* **`osal.rm(todelete string) !`**: Remove files/directories. +* **`osal.file_write(path string, text string) !`**: Write text to a file. +* **`osal.file_read(path string) !string`**: Read content from a file. +* **`osal.dir_ensure(path string) !`**: Ensure a directory exists. +* **`osal.rm(todelete string) !`**: Remove files/directories. ## 4. Environment Variables -* **`osal.env_set(args: EnvSet)`**: Set an environment variable. - * **Key Parameters**: `key` (string), `value` (string). -* **`osal.env_unset(key string)`**: Unset a specific environment variable. -* **`osal.env_unset_all()`**: Unset all environment variables. -* **`osal.env_set_all(args: EnvSetAll)`**: Set multiple environment variables. - * **Key Parameters**: `env` (map[string]string), `clear_before_set` (bool), `overwrite_if_exists` (bool). -* **`osal.env_get(key string) !string`**: Get an environment variable's value. -* **`osal.env_exists(key string) !bool`**: Check if an environment variable exists. -* **`osal.env_get_default(key string, def string) string`**: Get an environment variable or a default value. -* **`osal.load_env_file(file_path string) !`**: Load variables from a file. +* **`osal.env_set(args: EnvSet)`**: Set an environment variable. + * **Key Parameters**: `key` (string), `value` (string). +* **`osal.env_unset(key string)`**: Unset a specific environment variable. +* **`osal.env_unset_all()`**: Unset all environment variables. +* **`osal.env_set_all(args: EnvSetAll)`**: Set multiple environment variables. + * **Key Parameters**: `env` (map[string]string), `clear_before_set` (bool), `overwrite_if_exists` (bool). +* **`osal.env_get(key string) !string`**: Get an environment variable's value. +* **`osal.env_exists(key string) !bool`**: Check if an environment variable exists. +* **`osal.env_get_default(key string, def string) string`**: Get an environment variable or a default value. +* **`osal.load_env_file(file_path string) !`**: Load variables from a file. ## 5. Command & Profile Management -* **`osal.cmd_add(args: CmdAddArgs) !`**: Add a binary to system paths and update profiles. - * **Key Parameters**: `source` (string, required), `cmdname` (string). -* **`osal.profile_path_add_remove(args: ProfilePathAddRemoveArgs) !`**: Add/remove paths from profiles. - * **Key Parameters**: `paths2add` (string), `paths2delete` (string). +* **`osal.cmd_add(args: CmdAddArgs) !`**: Add a binary to system paths and update profiles. + * **Key Parameters**: `source` (string, required), `cmdname` (string). +* **`osal.profile_path_add_remove(args: ProfilePathAddRemoveArgs) !`**: Add/remove paths from profiles. + * **Key Parameters**: `paths2add` (string), `paths2delete` (string). ## 6. System Information & Utilities -* **`osal.processmap_get() !ProcessMap`**: Get a map of all running processes. -* **`osal.processinfo_get(pid int) !ProcessInfo`**: Get detailed information for a specific process. -* **`osal.processinfo_get_byname(name string) ![]ProcessInfo`**: Get info for processes matching a name. -* **`osal.process_exists(pid int) bool`**: Check if a process exists by PID. -* **`osal.processinfo_with_children(pid int) !ProcessMap`**: Get a process and its children. -* **`osal.processinfo_children(pid int) !ProcessMap`**: Get children of a process. -* **`osal.process_kill_recursive(args: ProcessKillArgs) !`**: Kill a process and its children. - * **Key Parameters**: `name` (string), `pid` (int). -* **`osal.whoami() !string`**: Return the current username. -* **`osal.platform() !PlatformType`**: Identify the operating system. -* **`osal.cputype() !CPUType`**: Identify the CPU architecture. -* **`osal.hostname() !string`**: Get system hostname. -* **`osal.sleep(duration int)`**: Pause execution for a specified duration. -* **`osal.download(args: DownloadArgs) !pathlib.Path`**: Download a file from a URL. - * `pathlib.Path` is from `freeflowuniverse.herolib.core.pathlib` - * **Key Parameters**: `url` (string), `dest` (string), `timeout` (int), `retry` (int). -* **`osal.user_exists(username string) bool`**: Check if a user exists. -* **`osal.user_id_get(username string) !int`**: Get user ID. -* **`osal.user_add(args: UserArgs) !int`**: Add a user. - * **Key Parameters**: `name` (string). +* **`osal.processmap_get() !ProcessMap`**: Get a map of all running processes. +* **`osal.processinfo_get(pid int) !ProcessInfo`**: Get detailed information for a specific process. +* **`osal.processinfo_get_byname(name string) ![]ProcessInfo`**: Get info for processes matching a name. +* **`osal.process_exists(pid int) bool`**: Check if a process exists by PID. +* **`osal.processinfo_with_children(pid int) !ProcessMap`**: Get a process and its children. +* **`osal.processinfo_children(pid int) !ProcessMap`**: Get children of a process. +* **`osal.process_kill_recursive(args: ProcessKillArgs) !`**: Kill a process and its children. + * **Key Parameters**: `name` (string), `pid` (int). +* **`osal.whoami() !string`**: Return the current username. +* **`osal.platform() !PlatformType`**: Identify the operating system. +* **`osal.cputype() !CPUType`**: Identify the CPU architecture. +* **`osal.hostname() !string`**: Get system hostname. +* **`osal.sleep(duration int)`**: Pause execution for a specified duration. +* **`osal.download(args: DownloadArgs) !pathlib.Path`**: Download a file from a URL. + * `pathlib.Path` is from `incubaid.herolib.core.pathlib` + * **Key Parameters**: `url` (string), `dest` (string), `timeout` (int), `retry` (int). +* **`osal.user_exists(username string) bool`**: Check if a user exists. +* **`osal.user_id_get(username string) !int`**: Get user ID. +* **`osal.user_add(args: UserArgs) !int`**: Add a user. + * **Key Parameters**: `name` (string). diff --git a/aiprompts/herolib_core/core_ourtime.md b/aiprompts/herolib_core/core_ourtime.md index 5c5cb5ce..086ddb42 100644 --- a/aiprompts/herolib_core/core_ourtime.md +++ b/aiprompts/herolib_core/core_ourtime.md @@ -3,6 +3,7 @@ The `OurTime` module in V provides flexible time handling, supporting relative and absolute time formats, Unix timestamps, and formatting utilities. ## Key Features + - Create time objects from strings or current time - Relative time expressions (e.g., `+1h`, `-2d`) - Absolute time formats (e.g., `YYYY-MM-DD HH:mm:ss`) @@ -12,7 +13,7 @@ The `OurTime` module in V provides flexible time handling, supporting relative a ## Basic Usage ```v -import freeflowuniverse.herolib.data.ourtime +import incubaid.herolib.data.ourtime // Current time mut t := ourtime.now() diff --git a/aiprompts/herolib_core/core_params.md b/aiprompts/herolib_core/core_params.md index 36c86077..aa4f4103 100644 --- a/aiprompts/herolib_core/core_params.md +++ b/aiprompts/herolib_core/core_params.md @@ -5,7 +5,7 @@ This document details the `paramsparser` module, essential for handling paramete ## Obtaining a `paramsparser` Instance ```v -import freeflowuniverse.herolib.data.paramsparser +import incubaid.herolib.data.paramsparser // Create new params from a string params := paramsparser.new("color:red size:'large' priority:1 enable:true")! @@ -19,12 +19,13 @@ params.set("color", "red") The parser supports various input formats: -1. **Key-value pairs**: `key:value` -2. **Quoted values**: `key:'value with spaces'` (single or double quotes) -3. **Arguments without keys**: `arg1 arg2` (accessed by index) -4. **Comments**: `// this is a comment` (ignored during parsing) +1. **Key-value pairs**: `key:value` +2. **Quoted values**: `key:'value with spaces'` (single or double quotes) +3. **Arguments without keys**: `arg1 arg2` (accessed by index) +4. **Comments**: `// this is a comment` (ignored during parsing) Example: + ```v text := "name:'John Doe' age:30 active:true // user details" params := paramsparser.new(text)! @@ -36,74 +37,74 @@ The `paramsparser` module provides a comprehensive set of methods for retrieving ### Basic Retrieval -- `get(key string) !string`: Retrieves a string value by key. Returns an error if the key does not exist. -- `get_default(key string, defval string) !string`: Retrieves a string value by key, or returns `defval` if the key is not found. -- `exists(key string) bool`: Checks if a keyword argument (`key:value`) exists. -- `exists_arg(key string) bool`: Checks if an argument (value without a key) exists. +- `get(key string) !string`: Retrieves a string value by key. Returns an error if the key does not exist. +- `get_default(key string, defval string) !string`: Retrieves a string value by key, or returns `defval` if the key is not found. +- `exists(key string) bool`: Checks if a keyword argument (`key:value`) exists. +- `exists_arg(key string) bool`: Checks if an argument (value without a key) exists. ### Argument Retrieval (Positional) -- `get_arg(nr int) !string`: Retrieves an argument by its 0-based index. Returns an error if the index is out of bounds. -- `get_arg_default(nr int, defval string) !string`: Retrieves an argument by index, or returns `defval` if the index is out of bounds. +- `get_arg(nr int) !string`: Retrieves an argument by its 0-based index. Returns an error if the index is out of bounds. +- `get_arg_default(nr int, defval string) !string`: Retrieves an argument by index, or returns `defval` if the index is out of bounds. ### Type-Specific Retrieval -- `get_int(key string) !int`: Converts and retrieves an integer (int32). -- `get_int_default(key string, defval int) !int`: Retrieves an integer with a default. -- `get_u32(key string) !u32`: Converts and retrieves an unsigned 32-bit integer. -- `get_u32_default(key string, defval u32) !u32`: Retrieves a u32 with a default. -- `get_u64(key string) !u64`: Converts and retrieves an unsigned 64-bit integer. -- `get_u64_default(key string, defval u64) !u64`: Retrieves a u64 with a default. -- `get_u8(key string) !u8`: Converts and retrieves an unsigned 8-bit integer. -- `get_u8_default(key string, defval u8) !u8`: Retrieves a u8 with a default. -- `get_float(key string) !f64`: Converts and retrieves a 64-bit float. -- `get_float_default(key string, defval f64) !f64`: Retrieves a float with a default. -- `get_percentage(key string) !f64`: Converts a percentage string (e.g., "80%") to a float (0.8). -- `get_percentage_default(key string, defval string) !f64`: Retrieves a percentage with a default. +- `get_int(key string) !int`: Converts and retrieves an integer (int32). +- `get_int_default(key string, defval int) !int`: Retrieves an integer with a default. +- `get_u32(key string) !u32`: Converts and retrieves an unsigned 32-bit integer. +- `get_u32_default(key string, defval u32) !u32`: Retrieves a u32 with a default. +- `get_u64(key string) !u64`: Converts and retrieves an unsigned 64-bit integer. +- `get_u64_default(key string, defval u64) !u64`: Retrieves a u64 with a default. +- `get_u8(key string) !u8`: Converts and retrieves an unsigned 8-bit integer. +- `get_u8_default(key string, defval u8) !u8`: Retrieves a u8 with a default. +- `get_float(key string) !f64`: Converts and retrieves a 64-bit float. +- `get_float_default(key string, defval f64) !f64`: Retrieves a float with a default. +- `get_percentage(key string) !f64`: Converts a percentage string (e.g., "80%") to a float (0.8). +- `get_percentage_default(key string, defval string) !f64`: Retrieves a percentage with a default. ### Boolean Retrieval -- `get_default_true(key string) bool`: Returns `true` if the value is empty, "1", "true", "y", or "yes". Otherwise `false`. -- `get_default_false(key string) bool`: Returns `false` if the value is empty, "0", "false", "n", or "no". Otherwise `true`. +- `get_default_true(key string) bool`: Returns `true` if the value is empty, "1", "true", "y", or "yes". Otherwise `false`. +- `get_default_false(key string) bool`: Returns `false` if the value is empty, "0", "false", "n", or "no". Otherwise `true`. ### List Retrieval Lists are typically comma-separated strings (e.g., `users: "john,jane,bob"`). -- `get_list(key string) ![]string`: Retrieves a list of strings. -- `get_list_default(key string, def []string) ![]string`: Retrieves a list of strings with a default. -- `get_list_int(key string) ![]int`: Retrieves a list of integers. -- `get_list_int_default(key string, def []int) []int`: Retrieves a list of integers with a default. -- `get_list_f32(key string) ![]f32`: Retrieves a list of 32-bit floats. -- `get_list_f32_default(key string, def []f32) []f32`: Retrieves a list of f32 with a default. -- `get_list_f64(key string) ![]f64`: Retrieves a list of 64-bit floats. -- `get_list_f64_default(key string, def []f64) []f64`: Retrieves a list of f64 with a default. -- `get_list_i8(key string) ![]i8`: Retrieves a list of 8-bit signed integers. -- `get_list_i8_default(key string, def []i8) []i8`: Retrieves a list of i8 with a default. -- `get_list_i16(key string) ![]i16`: Retrieves a list of 16-bit signed integers. -- `get_list_i16_default(key string, def []i16) []i16`: Retrieves a list of i16 with a default. -- `get_list_i64(key string) ![]i64`: Retrieves a list of 64-bit signed integers. -- `get_list_i64_default(key string, def []i64) []i64`: Retrieves a list of i64 with a default. -- `get_list_u16(key string) ![]u16`: Retrieves a list of 16-bit unsigned integers. -- `get_list_u16_default(key string, def []u16) []u16`: Retrieves a list of u16 with a default. -- `get_list_u32(key string) ![]u32`: Retrieves a list of 32-bit unsigned integers. -- `get_list_u32_default(key string, def []u32) []u32`: Retrieves a list of u32 with a default. -- `get_list_u64(key string) ![]u64`: Retrieves a list of 64-bit unsigned integers. -- `get_list_u64_default(key string, def []u64) []u64`: Retrieves a list of u64 with a default. -- `get_list_namefix(key string) ![]string`: Retrieves a list of strings, normalizing each item (e.g., "My Name" -> "my_name"). -- `get_list_namefix_default(key string, def []string) ![]string`: Retrieves a list of name-fixed strings with a default. +- `get_list(key string) ![]string`: Retrieves a list of strings. +- `get_list_default(key string, def []string) ![]string`: Retrieves a list of strings with a default. +- `get_list_int(key string) ![]int`: Retrieves a list of integers. +- `get_list_int_default(key string, def []int) []int`: Retrieves a list of integers with a default. +- `get_list_f32(key string) ![]f32`: Retrieves a list of 32-bit floats. +- `get_list_f32_default(key string, def []f32) []f32`: Retrieves a list of f32 with a default. +- `get_list_f64(key string) ![]f64`: Retrieves a list of 64-bit floats. +- `get_list_f64_default(key string, def []f64) []f64`: Retrieves a list of f64 with a default. +- `get_list_i8(key string) ![]i8`: Retrieves a list of 8-bit signed integers. +- `get_list_i8_default(key string, def []i8) []i8`: Retrieves a list of i8 with a default. +- `get_list_i16(key string) ![]i16`: Retrieves a list of 16-bit signed integers. +- `get_list_i16_default(key string, def []i16) []i16`: Retrieves a list of i16 with a default. +- `get_list_i64(key string) ![]i64`: Retrieves a list of 64-bit signed integers. +- `get_list_i64_default(key string, def []i64) []i64`: Retrieves a list of i64 with a default. +- `get_list_u16(key string) ![]u16`: Retrieves a list of 16-bit unsigned integers. +- `get_list_u16_default(key string, def []u16) []u16`: Retrieves a list of u16 with a default. +- `get_list_u32(key string) ![]u32`: Retrieves a list of 32-bit unsigned integers. +- `get_list_u32_default(key string, def []u32) []u32`: Retrieves a list of u32 with a default. +- `get_list_u64(key string) ![]u64`: Retrieves a list of 64-bit unsigned integers. +- `get_list_u64_default(key string, def []u64) []u64`: Retrieves a list of u64 with a default. +- `get_list_namefix(key string) ![]string`: Retrieves a list of strings, normalizing each item (e.g., "My Name" -> "my_name"). +- `get_list_namefix_default(key string, def []string) ![]string`: Retrieves a list of name-fixed strings with a default. ### Specialized Retrieval -- `get_map() map[string]string`: Returns all parameters as a map. -- `get_path(key string) !string`: Retrieves a path string. -- `get_path_create(key string) !string`: Retrieves a path string, creating the directory if it doesn't exist. -- `get_from_hashmap(key string, defval string, hashmap map[string]string) !string`: Retrieves a value from a provided hashmap based on the parameter's value. -- `get_storagecapacity_in_bytes(key string) !u64`: Converts storage capacity strings (e.g., "10 GB", "500 MB") to bytes (u64). -- `get_storagecapacity_in_bytes_default(key string, defval u64) !u64`: Retrieves storage capacity in bytes with a default. -- `get_storagecapacity_in_gigabytes(key string) !u64`: Converts storage capacity strings to gigabytes (u64). -- `get_time(key string) !ourtime.OurTime`: Parses a time string (relative or absolute) into an `ourtime.OurTime` object. -- `get_time_default(key string, defval ourtime.OurTime) !ourtime.OurTime`: Retrieves time with a default. -- `get_time_interval(key string) !Duration`: Parses a time interval string into a `Duration` object. -- `get_timestamp(key string) !Duration`: Parses a timestamp string into a `Duration` object. -- `get_timestamp_default(key string, defval Duration) !Duration`: Retrieves a timestamp with a default. +- `get_map() map[string]string`: Returns all parameters as a map. +- `get_path(key string) !string`: Retrieves a path string. +- `get_path_create(key string) !string`: Retrieves a path string, creating the directory if it doesn't exist. +- `get_from_hashmap(key string, defval string, hashmap map[string]string) !string`: Retrieves a value from a provided hashmap based on the parameter's value. +- `get_storagecapacity_in_bytes(key string) !u64`: Converts storage capacity strings (e.g., "10 GB", "500 MB") to bytes (u64). +- `get_storagecapacity_in_bytes_default(key string, defval u64) !u64`: Retrieves storage capacity in bytes with a default. +- `get_storagecapacity_in_gigabytes(key string) !u64`: Converts storage capacity strings to gigabytes (u64). +- `get_time(key string) !ourtime.OurTime`: Parses a time string (relative or absolute) into an `ourtime.OurTime` object. +- `get_time_default(key string, defval ourtime.OurTime) !ourtime.OurTime`: Retrieves time with a default. +- `get_time_interval(key string) !Duration`: Parses a time interval string into a `Duration` object. +- `get_timestamp(key string) !Duration`: Parses a timestamp string into a `Duration` object. +- `get_timestamp_default(key string, defval Duration) !Duration`: Retrieves a timestamp with a default. diff --git a/aiprompts/herolib_core/core_paths.md b/aiprompts/herolib_core/core_paths.md index fbd10130..681434f8 100644 --- a/aiprompts/herolib_core/core_paths.md +++ b/aiprompts/herolib_core/core_paths.md @@ -14,8 +14,9 @@ The pathlib module provides a comprehensive interface for handling file system o ## Basic Usage ### Importing pathlib + ```v -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib ``` ### Creating Path Objects @@ -33,6 +34,7 @@ mut dir_path := pathlib.get("path/to/directory") if you know in advance if you expect a dir or file its better to use `pathlib.get_dir(path:...,create:true)` or `pathlib.get_file(path:...,create:true)`. ### Basic Path Operations + ```v // Get absolute path abs_path := file_path.absolute() @@ -49,6 +51,7 @@ if file_path.exists() { ## Path Properties and Methods ### Path Types + ```v // Check if path is a file if file_path.is_file() { @@ -67,6 +70,7 @@ if file_path.is_link() { ``` ### Path Normalization + ```v // Normalize path (remove extra slashes, resolve . and ..) normalized_path := file_path.path_normalize() @@ -81,6 +85,7 @@ name_no_ext := file_path.name_no_ext() ## File and Directory Operations ### File Operations + ```v // Write to file file_path.write("Content to write")! @@ -93,6 +98,7 @@ file_path.delete()! ``` ### Directory Operations + ```v // Create directory mut dir := pathlib.get_dir( @@ -108,6 +114,7 @@ dir.delete()! ``` ### Symlink Operations + ```v // Create symlink file_path.link("path/to/symlink", delete_exists: true)! @@ -119,12 +126,14 @@ real_path := file_path.realpath() ## Advanced Operations ### Path Copying + ```v // Copy file to destination file_path.copy(dest: "path/to/destination")! ``` ### Recursive Operations + ```v // List directory recursively mut recursive_list := dir.list(recursive: true)! @@ -134,6 +143,7 @@ dir.delete()! ``` ### Path Filtering + ```v // List files matching pattern mut filtered_list := dir.list( @@ -145,6 +155,7 @@ mut filtered_list := dir.list( ## Best Practices ### Error Handling + ```v if file_path.exists() { // Safe to operate @@ -152,4 +163,3 @@ if file_path.exists() { // Handle missing file } ``` - diff --git a/aiprompts/herolib_core/core_redis.md b/aiprompts/herolib_core/core_redis.md index bea288fc..c8ff2c3b 100644 --- a/aiprompts/herolib_core/core_redis.md +++ b/aiprompts/herolib_core/core_redis.md @@ -4,17 +4,17 @@ The `redisclient` module in Herolib provides a comprehensive client for interact ## Key Features -- **Direct Redis Commands**: Access to a wide range of Redis commands (strings, hashes, lists, keys, etc.). -- **Caching**: Built-in caching mechanism with namespace support and expiration. -- **Queues**: Simple queue implementation using Redis lists. -- **RPC**: Remote Procedure Call (RPC) functionality over Redis queues for inter-service communication. +- **Direct Redis Commands**: Access to a wide range of Redis commands (strings, hashes, lists, keys, etc.). +- **Caching**: Built-in caching mechanism with namespace support and expiration. +- **Queues**: Simple queue implementation using Redis lists. +- **RPC**: Remote Procedure Call (RPC) functionality over Redis queues for inter-service communication. ## Basic Usage To get a Redis client instance, use `redisclient.core_get()`. By default, it connects to `127.0.0.1:6379`. You can specify a different address and port using the `RedisURL` struct. ```v -import freeflowuniverse.herolib.core.redisclient +import incubaid.herolib.core.redisclient // Connect to default Redis instance (127.0.0.1:6379) mut redis := redisclient.core_get()! @@ -42,13 +42,13 @@ The `Redis` object provides methods for most standard Redis commands. Here are s ### String Commands -- `set(key string, value string) !`: Sets the string value of a key. -- `get(key string) !string`: Gets the string value of a key. -- `set_ex(key string, value string, ex string) !`: Sets a key with an expiration time in seconds. -- `incr(key string) !int`: Increments the integer value of a key by one. -- `decr(key string) !int`: Decrements the integer value of a key by one. -- `append(key string, value string) !int`: Appends a value to a key. -- `strlen(key string) !int`: Gets the length of the value stored in a key. +- `set(key string, value string) !`: Sets the string value of a key. +- `get(key string) !string`: Gets the string value of a key. +- `set_ex(key string, value string, ex string) !`: Sets a key with an expiration time in seconds. +- `incr(key string) !int`: Increments the integer value of a key by one. +- `decr(key string) !int`: Decrements the integer value of a key by one. +- `append(key string, value string) !int`: Appends a value to a key. +- `strlen(key string) !int`: Gets the length of the value stored in a key. ```v redis.set('counter', '10')! @@ -58,11 +58,11 @@ val := redis.get('counter')! // "11" ### Hash Commands -- `hset(key string, skey string, value string) !`: Sets the string value of a hash field. -- `hget(key string, skey string) !string`: Gets the value of a hash field. -- `hgetall(key string) !map[string]string`: Gets all fields and values in a hash. -- `hexists(key string, skey string) !bool`: Checks if a hash field exists. -- `hdel(key string, skey string) !int`: Deletes one or more hash fields. +- `hset(key string, skey string, value string) !`: Sets the string value of a hash field. +- `hget(key string, skey string) !string`: Gets the value of a hash field. +- `hgetall(key string) !map[string]string`: Gets all fields and values in a hash. +- `hexists(key string, skey string) !bool`: Checks if a hash field exists. +- `hdel(key string, skey string) !int`: Deletes one or more hash fields. ```v redis.hset('user:1', 'name', 'John Doe')! @@ -73,12 +73,12 @@ user_data := redis.hgetall('user:1')! // map['name':'John Doe', 'email':'john@ex ### List Commands -- `lpush(key string, element string) !int`: Inserts all specified values at the head of the list stored at key. -- `rpush(key string, element string) !int`: Inserts all specified values at the tail of the list stored at key. -- `lpop(key string) !string`: Removes and returns the first element of the list stored at key. -- `rpop(key string) !string`: Removes and returns the last element of the list stored at key. -- `llen(key string) !int`: Gets the length of a list. -- `lrange(key string, start int, end int) ![]resp.RValue`: Gets a range of elements from a list. +- `lpush(key string, element string) !int`: Inserts all specified values at the head of the list stored at key. +- `rpush(key string, element string) !int`: Inserts all specified values at the tail of the list stored at key. +- `lpop(key string) !string`: Removes and returns the first element of the list stored at key. +- `rpop(key string) !string`: Removes and returns the last element of the list stored at key. +- `llen(key string) !int`: Gets the length of a list. +- `lrange(key string, start int, end int) ![]resp.RValue`: Gets a range of elements from a list. ```v redis.lpush('mylist', 'item1')! @@ -88,8 +88,8 @@ first_item := redis.lpop('mylist')! // "item1" ### Set Commands -- `sadd(key string, members []string) !int`: Adds the specified members to the set stored at key. -- `smismember(key string, members []string) ![]int`: Returns if member is a member of the set stored at key. +- `sadd(key string, members []string) !int`: Adds the specified members to the set stored at key. +- `smismember(key string, members []string) ![]int`: Returns if member is a member of the set stored at key. ```v redis.sadd('myset', ['member1', 'member2'])! @@ -98,13 +98,13 @@ is_member := redis.smismember('myset', ['member1', 'member3'])! // [1, 0] ### Key Management -- `keys(pattern string) ![]string`: Finds all keys matching the given pattern. -- `del(key string) !int`: Deletes a key. -- `expire(key string, seconds int) !int`: Sets a key's time to live in seconds. -- `ttl(key string) !int`: Gets the time to live for a key in seconds. -- `flushall() !`: Deletes all the keys of all the existing databases. -- `flushdb() !`: Deletes all the keys of the currently selected database. -- `selectdb(database int) !`: Changes the selected database. +- `keys(pattern string) ![]string`: Finds all keys matching the given pattern. +- `del(key string) !int`: Deletes a key. +- `expire(key string, seconds int) !int`: Sets a key's time to live in seconds. +- `ttl(key string) !int`: Gets the time to live for a key in seconds. +- `flushall() !`: Deletes all the keys of all the existing databases. +- `flushdb() !`: Deletes all the keys of the currently selected database. +- `selectdb(database int) !`: Changes the selected database. ```v redis.set('temp_key', 'value')! @@ -116,7 +116,7 @@ redis.expire('temp_key', 60)! // Expires in 60 seconds The `RedisCache` struct provides a convenient way to implement caching using Redis. ```v -import freeflowuniverse.herolib.core.redisclient +import incubaid.herolib.core.redisclient mut redis := redisclient.core_get()! mut cache := redis.cache('my_app_cache') @@ -145,7 +145,7 @@ cache.reset()! The `RedisQueue` struct provides a simple queue mechanism using Redis lists. ```v -import freeflowuniverse.herolib.core.redisclient +import incubaid.herolib.core.redisclient import time mut redis := redisclient.core_get()! @@ -169,7 +169,7 @@ task2 := my_queue.pop()! The `RedisRpc` struct enables Remote Procedure Call (RPC) over Redis, allowing services to communicate by sending messages to queues and waiting for responses. ```v -import freeflowuniverse.herolib.core.redisclient +import incubaid.herolib.core.redisclient import json import time @@ -201,4 +201,4 @@ response := rpc_client.call( // In a real application, this would be in a loop or a background worker // return_queue_name := rpc_client.process(my_rpc_processor, timeout: 1000)! // result := rpc_client.result(1000, return_queue_name)! -// println('Processed result: ${result}') \ No newline at end of file +// println('Processed result: ${result}') diff --git a/aiprompts/herolib_core/core_text.md b/aiprompts/herolib_core/core_text.md index 75f78136..e63aca95 100644 --- a/aiprompts/herolib_core/core_text.md +++ b/aiprompts/herolib_core/core_text.md @@ -2,96 +2,124 @@ The `texttools` module provides a comprehensive set of utilities for text manipulation and processing. -## Functions and Examples: +## Functions and Examples ```v -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.texttools assert hello_world == texttools.name_fix("Hello World!") ``` + ### Name/Path Processing -* `name_fix(name string) string`: Normalizes filenames and paths. -* `name_fix_keepspace(name string) !string`: Like name_fix but preserves spaces. -* `name_fix_no_ext(name_ string) string`: Removes file extension. -* `name_fix_snake_to_pascal(name string) string`: Converts snake_case to PascalCase. + +* `name_fix(name string) string`: Normalizes filenames and paths. +* `name_fix_keepspace(name string) !string`: Like name_fix but preserves spaces. +* `name_fix_no_ext(name_ string) string`: Removes file extension. +* `name_fix_snake_to_pascal(name string) string`: Converts snake_case to PascalCase. + ```v name := texttools.name_fix_snake_to_pascal("hello_world") // Result: "HelloWorld" ``` -* `snake_case(name string) string`: Converts PascalCase to snake_case. + +* `snake_case(name string) string`: Converts PascalCase to snake_case. + ```v name := texttools.snake_case("HelloWorld") // Result: "hello_world" ``` -* `name_split(name string) !(string, string)`: Splits name into site and page components. +* `name_split(name string) !(string, string)`: Splits name into site and page components. ### Text Cleaning -* `name_clean(r string) string`: Normalizes names by removing special characters. + +* `name_clean(r string) string`: Normalizes names by removing special characters. + ```v name := texttools.name_clean("Hello@World!") // Result: "HelloWorld" ``` -* `ascii_clean(r string) string`: Removes all non-ASCII characters. -* `remove_empty_lines(text string) string`: Removes empty lines from text. + +* `ascii_clean(r string) string`: Removes all non-ASCII characters. +* `remove_empty_lines(text string) string`: Removes empty lines from text. + ```v text := texttools.remove_empty_lines("line1\n\nline2\n\n\nline3") // Result: "line1\nline2\nline3" ``` -* `remove_double_lines(text string) string`: Removes consecutive empty lines. -* `remove_empty_js_blocks(text string) string`: Removes empty code blocks (```...```). + +* `remove_double_lines(text string) string`: Removes consecutive empty lines. +* `remove_empty_js_blocks(text string) string`: Removes empty code blocks (```...```). ### Command Line Parsing -* `cmd_line_args_parser(text string) ![]string`: Parses command line arguments with support for quotes and escaping. + +* `cmd_line_args_parser(text string) ![]string`: Parses command line arguments with support for quotes and escaping. + ```v args := texttools.cmd_line_args_parser("'arg with spaces' --flag=value") // Result: ['arg with spaces', '--flag=value'] ``` -* `text_remove_quotes(text string) string`: Removes quoted sections from text. -* `check_exists_outside_quotes(text string, items []string) bool`: Checks if items exist in text outside of quotes. + +* `text_remove_quotes(text string) string`: Removes quoted sections from text. +* `check_exists_outside_quotes(text string, items []string) bool`: Checks if items exist in text outside of quotes. ### Text Expansion -* `expand(txt_ string, l int, expand_with string) string`: Expands text to a specified length with a given character. + +* `expand(txt_ string, l int, expand_with string) string`: Expands text to a specified length with a given character. ### Indentation -* `indent(text string, prefix string) string`: Adds indentation prefix to each line. + +* `indent(text string, prefix string) string`: Adds indentation prefix to each line. + ```v text := texttools.indent("line1\nline2", " ") // Result: " line1\n line2\n" ``` -* `dedent(text string) string`: Removes common leading whitespace from every line. + +* `dedent(text string) string`: Removes common leading whitespace from every line. + ```v text := texttools.dedent(" line1\n line2") // Result: "line1\nline2" ``` ### String Validation -* `is_int(text string) bool`: Checks if text contains only digits. -* `is_upper_text(text string) bool`: Checks if text contains only uppercase letters. + +* `is_int(text string) bool`: Checks if text contains only digits. +* `is_upper_text(text string) bool`: Checks if text contains only uppercase letters. ### Multiline Processing -* `multiline_to_single(text string) !string`: Converts multiline text to a single line with proper escaping. + +* `multiline_to_single(text string) !string`: Converts multiline text to a single line with proper escaping. ### Text Splitting -* `split_smart(t string, delimiter_ string) []string`: Intelligent string splitting that respects quotes. + +* `split_smart(t string, delimiter_ string) []string`: Intelligent string splitting that respects quotes. ### Tokenization -* `tokenize(text_ string) TokenizerResult`: Tokenizes text into meaningful parts. -* `text_token_replace(text string, tofind string, replacewith string) !string`: Replaces tokens in text. + +* `tokenize(text_ string) TokenizerResult`: Tokenizes text into meaningful parts. +* `text_token_replace(text string, tofind string, replacewith string) !string`: Replaces tokens in text. ### Version Parsing -* `version(text_ string) int`: Converts version strings to comparable integers. + +* `version(text_ string) int`: Converts version strings to comparable integers. + ```v ver := texttools.version("v0.4.36") // Result: 4036 ver = texttools.version("v1.4.36") // Result: 1004036 ``` ### Formatting -* `format_rfc1123(t time.Time) string`: Formats a time.Time object into RFC 1123 format. - +* `format_rfc1123(t time.Time) string`: Formats a time.Time object into RFC 1123 format. + ### Array Operations -* `to_array(r string) []string`: Converts a comma or newline separated list to an array of strings. + +* `to_array(r string) []string`: Converts a comma or newline separated list to an array of strings. + ```v text := "item1,item2,item3" array := texttools.to_array(text) // Result: ['item1', 'item2', 'item3'] ``` -* `to_array_int(r string) []int`: Converts a text list to an array of integers. -* `to_map(mapstring string, line string, delimiter_ string) map[string]string`: Intelligent mapping of a line to a map based on a template. + +* `to_array_int(r string) []int`: Converts a text list to an array of integers. +* `to_map(mapstring string, line string, delimiter_ string) map[string]string`: Intelligent mapping of a line to a map based on a template. + ```v r := texttools.to_map("name,-,-,-,-,pid,-,-,-,-,path", "root 304 0.0 0.0 408185328 1360 ?? S 16Dec23 0:34.06 /usr/sbin/distnoted") diff --git a/aiprompts/herolib_core/core_ui_console.md b/aiprompts/herolib_core/core_ui_console.md index 4a623c5a..cd9ac92c 100644 --- a/aiprompts/herolib_core/core_ui_console.md +++ b/aiprompts/herolib_core/core_ui_console.md @@ -5,7 +5,7 @@ has mechanisms to print better to console, see the methods below import as ```v -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console ``` @@ -24,23 +24,23 @@ fn color_fg(c ForegroundColor) string struct PrintArgs { pub mut: - foreground ForegroundColor - background BackgroundColor - text string - style Style - reset_before bool = true - reset_after bool = true + foreground ForegroundColor + background BackgroundColor + text string + style Style + reset_before bool = true + reset_after bool = true } fn cprint(args PrintArgs) // print with colors, reset... // ``` - // foreground ForegroundColor - // background BackgroundColor - // text string - // style Style - // reset_before bool = true - // reset_after bool = true + // foreground ForegroundColor + // background BackgroundColor + // text string + // style Style + // reset_before bool = true + // reset_after bool = true // ``` fn cprintln(args_ PrintArgs) @@ -95,11 +95,11 @@ Is used to ask feedback to users struct UIConsole { pub mut: - x_max int = 80 - y_max int = 60 - prev_lf bool - prev_title bool - prev_item bool + x_max int = 80 + y_max int = 60 + prev_lf bool + prev_title bool + prev_item bool } //DropDownArgs: @@ -150,51 +150,51 @@ fn (mut c UIConsole) status() string ```v enum BackgroundColor { - default_color = 49 // 'default' is a reserved keyword in V - black = 40 - red = 41 - green = 42 - yellow = 43 - blue = 44 - magenta = 45 - cyan = 46 - light_gray = 47 - dark_gray = 100 - light_red = 101 - light_green = 102 - light_yellow = 103 - light_blue = 104 - light_magenta = 105 - light_cyan = 106 - white = 107 + default_color = 49 // 'default' is a reserved keyword in V + black = 40 + red = 41 + green = 42 + yellow = 43 + blue = 44 + magenta = 45 + cyan = 46 + light_gray = 47 + dark_gray = 100 + light_red = 101 + light_green = 102 + light_yellow = 103 + light_blue = 104 + light_magenta = 105 + light_cyan = 106 + white = 107 } enum ForegroundColor { - default_color = 39 // 'default' is a reserved keyword in V - white = 97 - black = 30 - red = 31 - green = 32 - yellow = 33 - blue = 34 - magenta = 35 - cyan = 36 - light_gray = 37 - dark_gray = 90 - light_red = 91 - light_green = 92 - light_yellow = 93 - light_blue = 94 - light_magenta = 95 - light_cyan = 96 + default_color = 39 // 'default' is a reserved keyword in V + white = 97 + black = 30 + red = 31 + green = 32 + yellow = 33 + blue = 34 + magenta = 35 + cyan = 36 + light_gray = 37 + dark_gray = 90 + light_red = 91 + light_green = 92 + light_yellow = 93 + light_blue = 94 + light_magenta = 95 + light_cyan = 96 } enum Style { - normal = 99 - bold = 1 - dim = 2 - underline = 4 - blink = 5 - reverse = 7 - hidden = 8 + normal = 99 + bold = 1 + dim = 2 + underline = 4 + blink = 5 + reverse = 7 + hidden = 8 } ``` diff --git a/aiprompts/herolib_core/core_vshell.md b/aiprompts/herolib_core/core_vshell.md index cae5628d..ace15ab8 100644 --- a/aiprompts/herolib_core/core_vshell.md +++ b/aiprompts/herolib_core/core_vshell.md @@ -5,7 +5,7 @@ this is how we want example scripts to be, see the first line ```v #!/usr/bin/env -S v -cg -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib... +import incubaid.herolib... ``` diff --git a/aiprompts/instructions/herodb_base_fs.md b/aiprompts/instructions/herodb_base_fs.md index eff9fac3..2a098b9c 100644 --- a/aiprompts/instructions/herodb_base_fs.md +++ b/aiprompts/instructions/herodb_base_fs.md @@ -674,6 +674,7 @@ File: /Users/despiegk/code/github/incubaid/herolib/lib/hero/db/ai_instructions.md + ```md # HeroDB Model Creation Instructions for AI @@ -701,14 +702,14 @@ Define your model struct with the following pattern: ```v @[heap] pub struct Calendar { - db.Base // Inherit from Base struct + db.Base // Inherit from Base struct pub mut: - // Add your specific fields here - title string - start_time i64 - end_time i64 - location string - attendees []string + // Add your specific fields here + title string + start_time i64 + end_time i64 + location string + attendees []string } ``` @@ -718,7 +719,7 @@ Implement a method to return the model's type name: ```v pub fn (self Calendar) type_name() string { - return 'calendar' + return 'calendar' } ``` @@ -728,11 +729,11 @@ Implement the `dump` method to serialize your struct's fields using the encoder: ```v pub fn (self Calendar) dump(mut e &encoder.Encoder) ! { - e.add_string(self.title) - e.add_i64(self.start_time) - e.add_i64(self.end_time) - e.add_string(self.location) - e.add_list_string(self.attendees) + e.add_string(self.title) + e.add_i64(self.start_time) + e.add_i64(self.end_time) + e.add_string(self.location) + e.add_list_string(self.attendees) } ``` @@ -742,11 +743,11 @@ Implement the `load` method to deserialize your struct's fields: ```v fn (mut self DBCalendar) load(mut o Calendar, mut e &encoder.Decoder) ! { - o.title = e.get_string()! - o.start_time = e.get_i64()! - o.end_time = e.get_i64()! - o.location = e.get_string()! - o.attendees = e.get_list_string()! + o.title = e.get_string()! + o.start_time = e.get_i64()! + o.end_time = e.get_i64()! + o.location = e.get_string()! + o.attendees = e.get_list_string()! } ``` @@ -758,11 +759,11 @@ Define a struct for creating new instances of your model: @[params] pub struct CalendarArg { pub mut: - title string @[required] - start_time i64 - end_time i64 - location string - attendees []string + title string @[required] + start_time i64 + end_time i64 + location string + attendees []string } ``` @@ -773,7 +774,7 @@ Create a database wrapper struct for your model: ```v pub struct DBCalendar { pub mut: - db &db.DB @[skip; str: skip] + db &db.DB @[skip; str: skip] } ``` @@ -784,8 +785,8 @@ Add your model to the ModelsFactory struct in `factory.v`: ```v pub struct ModelsFactory { pub mut: - comments DBCalendar - // ... other models + comments DBCalendar + // ... other models } ``` @@ -793,13 +794,13 @@ And initialize it in the `new()` function: ```v pub fn new() !ModelsFactory { - mut mydb := db.new()! - return ModelsFactory{ - comments: DBCalendar{ - db: &mydb - } - // ... initialize other models - } + mut mydb := db.new()! + return ModelsFactory{ + comments: DBCalendar{ + db: &mydb + } + // ... initialize other models + } } ``` @@ -808,6 +809,7 @@ pub fn new() !ModelsFactory { Use these methods for serialization/deserialization: ### Encoder (Serialization) + - `e.add_bool(val bool)` - `e.add_u8(val u8)` - `e.add_u16(val u16)` @@ -834,6 +836,7 @@ Use these methods for serialization/deserialization: - `e.add_list_string(val []string)` ### Decoder (Deserialization) + - `e.get_bool()!` - `e.get_u8()!` - `e.get_u16()!` @@ -862,55 +865,61 @@ Use these methods for serialization/deserialization: ## CRUD Methods Implementation ### Create New Instance + ```v pub fn (mut self DBCalendar) new(args CalendarArg) !Calendar { - mut o := Calendar{ - title: args.title - start_time: args.start_time - end_time: args.end_time - location: args.location - attendees: args.attendees - updated_at: ourtime.now().unix() - } - return o + mut o := Calendar{ + title: args.title + start_time: args.start_time + end_time: args.end_time + location: args.location + attendees: args.attendees + updated_at: ourtime.now().unix() + } + return o } ``` ### Save to Database + ```v pub fn (mut self DBCalendar) set(o Calendar) !u32 { - return self.db.set[Calendar](o)! + return self.db.set[Calendar](o)! } ``` ### Retrieve from Database + ```v pub fn (mut self DBCalendar) get(id u32) !Calendar { - mut o, data := self.db.get_data[Calendar](id)! - mut e_decoder := encoder.decoder_new(data) - self.load(mut o, mut e_decoder)! - return o + mut o, data := self.db.get_data[Calendar](id)! + mut e_decoder := encoder.decoder_new(data) + self.load(mut o, mut e_decoder)! + return o } ``` ### Delete from Database + ```v pub fn (mut self DBCalendar) delete(id u32) ! { - self.db.delete[Calendar](id)! + self.db.delete[Calendar](id)! } ``` ### Check Existence + ```v pub fn (mut self DBCalendar) exist(id u32) !bool { - return self.db.exists[Calendar](id)! + return self.db.exists[Calendar](id)! } ``` ### List All Objects + ```v pub fn (mut self DBCalendar) list() ![]Calendar { - return self.db.list[Calendar]()!.map(self.get(it)!) + return self.db.list[Calendar]()!.map(self.get(it)!) } ``` @@ -921,18 +930,18 @@ Create a `.vsh` script in `examples/hero/heromodels/` to demonstrate usage: ```v #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.core.redisclient -import freeflowuniverse.herolib.hero.heromodels +import incubaid.herolib.core.redisclient +import incubaid.herolib.hero.heromodels mut mydb := heromodels.new()! // Create a new object mut o := mydb.calendar.new( - title: 'Meeting' - start_time: 1672531200 - end_time: 1672534800 - location: 'Conference Room' - attendees: ['john@example.com', 'jane@example.com'] + title: 'Meeting' + start_time: 1672531200 + end_time: 1672534800 + location: 'Conference Room' + attendees: ['john@example.com', 'jane@example.com'] )! // Save to database @@ -971,160 +980,163 @@ println('All objects: ${objects}') 8. Implement CRUD methods 9. Create example usage script 10. Test the implementation with the example script + ``` File: /Users/despiegk/code/github/incubaid/herolib/lib/hero/db/core_methods.v ```v module db -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.data.encoder pub fn (mut self DB) set[T](obj_ T) !u32 { - // Get the next ID - mut obj := obj_ - if obj.id == 0 { - obj.id = self.new_id()! - } - mut t := ourtime.now().unix() - if obj.created_at == 0 { - obj.created_at = t - } - obj.updated_at = t + // Get the next ID + mut obj := obj_ + if obj.id == 0 { + obj.id = self.new_id()! + } + mut t := ourtime.now().unix() + if obj.created_at == 0 { + obj.created_at = t + } + obj.updated_at = t - // id u32 - // name string - // description string - // created_at i64 - // updated_at i64 - // securitypolicy u32 - // tags u32 // when we set/get we always do as []string but this can then be sorted and md5ed this gies the unique id of tags - // comments []u32 - mut e := encoder.new() - e.add_u8(1) - e.add_u32(obj.id) - e.add_string(obj.name) - e.add_string(obj.description) - e.add_i64(obj.created_at) - e.add_i64(obj.updated_at) - e.add_u32(obj.securitypolicy) - e.add_u32(obj.tags) - e.add_u16(u16(obj.comments.len)) - for comment in obj.comments { - e.add_u32(comment) - } - // println('set: before dump, e.data.len: ${e.data.len}') - obj.dump(mut e)! - // println('set: after dump, e.data.len: ${e.data.len}') - self.redis.hset(self.db_name[T](), obj.id.str(), e.data.bytestr())! - return obj.id + // id u32 + // name string + // description string + // created_at i64 + // updated_at i64 + // securitypolicy u32 + // tags u32 // when we set/get we always do as []string but this can then be sorted and md5ed this gies the unique id of tags + // comments []u32 + mut e := encoder.new() + e.add_u8(1) + e.add_u32(obj.id) + e.add_string(obj.name) + e.add_string(obj.description) + e.add_i64(obj.created_at) + e.add_i64(obj.updated_at) + e.add_u32(obj.securitypolicy) + e.add_u32(obj.tags) + e.add_u16(u16(obj.comments.len)) + for comment in obj.comments { + e.add_u32(comment) + } + // println('set: before dump, e.data.len: ${e.data.len}') + obj.dump(mut e)! + // println('set: after dump, e.data.len: ${e.data.len}') + self.redis.hset(self.db_name[T](), obj.id.str(), e.data.bytestr())! + return obj.id } // return the data, cannot return the object as we do not know the type pub fn (mut self DB) get_data[T](id u32) !(T, []u8) { - data := self.redis.hget(self.db_name[T](), id.str())! + data := self.redis.hget(self.db_name[T](), id.str())! - if data.len == 0 { - return error('herodb:${self.db_name[T]()} not found for ${id}') - } + if data.len == 0 { + return error('herodb:${self.db_name[T]()} not found for ${id}') + } - // println('get_data: data.len: ${data.len}') - mut e := encoder.decoder_new(data.bytes()) - version := e.get_u8()! - if version != 1 { - panic('wrong version in base load') - } - mut base := T{} - base.id = e.get_u32()! - base.name = e.get_string()! - base.description = e.get_string()! - base.created_at = e.get_i64()! - base.updated_at = e.get_i64()! - base.securitypolicy = e.get_u32()! - base.tags = e.get_u32()! - for _ in 0 .. e.get_u16()! { - base.comments << e.get_u32()! - } - return base, e.data + // println('get_data: data.len: ${data.len}') + mut e := encoder.decoder_new(data.bytes()) + version := e.get_u8()! + if version != 1 { + panic('wrong version in base load') + } + mut base := T{} + base.id = e.get_u32()! + base.name = e.get_string()! + base.description = e.get_string()! + base.created_at = e.get_i64()! + base.updated_at = e.get_i64()! + base.securitypolicy = e.get_u32()! + base.tags = e.get_u32()! + for _ in 0 .. e.get_u16()! { + base.comments << e.get_u32()! + } + return base, e.data } pub fn (mut self DB) exists[T](id u32) !bool { - return self.redis.hexists(self.db_name[T](), id.str())! + return self.redis.hexists(self.db_name[T](), id.str())! } pub fn (mut self DB) delete[T](id u32) ! { - self.redis.hdel(self.db_name[T](), id.str())! + self.redis.hdel(self.db_name[T](), id.str())! } pub fn (mut self DB) list[T]() ![]u32 { - ids := self.redis.hkeys(self.db_name[T]())! - return ids.map(it.u32()) + ids := self.redis.hkeys(self.db_name[T]())! + return ids.map(it.u32()) } // make it easy to get a base object pub fn (mut self DB) new_from_base[T](args BaseArgs) !Base { - return T{ - Base: new_base(args)! - } + return T{ + Base: new_base(args)! + } } fn (mut self DB) db_name[T]() string { - // get the name of the type T - mut name := T.name.to_lower_ascii().split('.').last() - // println("db_name rediskey: '${name}'") - return 'db:${name}' + // get the name of the type T + mut name := T.name.to_lower_ascii().split('.').last() + // println("db_name rediskey: '${name}'") + return 'db:${name}' } pub fn (mut self DB) new_id() !u32 { - return u32(self.redis.incr('db:id')!) + return u32(self.redis.incr('db:id')!) } ``` File: /Users/despiegk/code/github/incubaid/herolib/lib/hero/db/core_models.v + ```v module db import crypto.md5 -import freeflowuniverse.herolib.core.redisclient -import freeflowuniverse.herolib.data.ourtime +import incubaid.herolib.core.redisclient +import incubaid.herolib.data.ourtime // Group represents a collection of users with roles and permissions @[heap] pub struct Base { pub mut: - id u32 - name string - description string - created_at i64 - updated_at i64 - securitypolicy u32 - tags u32 // when we set/get we always do as []string but this can then be sorted and md5ed this gies the unique id of tags - comments []u32 + id u32 + name string + description string + created_at i64 + updated_at i64 + securitypolicy u32 + tags u32 // when we set/get we always do as []string but this can then be sorted and md5ed this gies the unique id of tags + comments []u32 } @[heap] pub struct SecurityPolicy { pub mut: - id u32 - read []u32 // links to users & groups - write []u32 // links to users & groups - delete []u32 // links to users & groups - public bool - md5 string // this sorts read, write and delete u32 + hash, then do md5 hash, this allows to go from a random read/write/delete/public config to a hash + id u32 + read []u32 // links to users & groups + write []u32 // links to users & groups + delete []u32 // links to users & groups + public bool + md5 string // this sorts read, write and delete u32 + hash, then do md5 hash, this allows to go from a random read/write/delete/public config to a hash } @[heap] pub struct Tags { pub mut: - id u32 - names []string // unique per id - md5 string // of sorted names, to make easy to find unique id, each name lowercased and made ascii + id u32 + names []string // unique per id + md5 string // of sorted names, to make easy to find unique id, each name lowercased and made ascii } ``` File: /Users/despiegk/code/github/incubaid/herolib/lib/hero/db/helpers_comments.v + ```v module db @@ -1134,298 +1146,301 @@ import crypto.md5 @[params] pub struct CommentArg { pub mut: - comment string - parent u32 - author u32 + comment string + parent u32 + author u32 } pub fn (mut self DB) comments_get(args []CommentArg) ![]u32 { - return args.map(self.comment_get(it.comment)!) + return args.map(self.comment_get(it.comment)!) } pub fn (mut self DB) comment_get(comment string) !u32 { - comment_fixed := comment.to_lower_ascii().trim_space() - return if comment_fixed.len > 0 { - hash := md5.hexhash(comment_fixed) - comment_found := self.redis.hget('db:comments', hash)! - if comment_found == '' { - id := self.new_id()! - self.redis.hset('db:comments', hash, id.str())! - self.redis.hset('db:comments', id.str(), comment_fixed)! - id - } else { - comment_found.u32() - } - } else { - 0 - } + comment_fixed := comment.to_lower_ascii().trim_space() + return if comment_fixed.len > 0 { + hash := md5.hexhash(comment_fixed) + comment_found := self.redis.hget('db:comments', hash)! + if comment_found == '' { + id := self.new_id()! + self.redis.hset('db:comments', hash, id.str())! + self.redis.hset('db:comments', id.str(), comment_fixed)! + id + } else { + comment_found.u32() + } + } else { + 0 + } } ``` File: /Users/despiegk/code/github/incubaid/herolib/lib/hero/db/helpers_tags.v + ```v module db import crypto.md5 pub fn (mut self DB) tags_get(tags []string) !u32 { - return if tags.len > 0 { - mut tags_fixed := tags.map(it.to_lower_ascii().trim_space()).filter(it != '') - tags_fixed.sort_ignore_case() - hash := md5.hexhash(tags_fixed.join(',')) - tags_found := self.redis.hget('db:tags', hash)! - return if tags_found == '' { - println('tags_get: new tags: ${tags_fixed.join(",")}') - id := self.new_id()! - self.redis.hset('db:tags', hash, id.str())! - self.redis.hset('db:tags', id.str(), tags_fixed.join(','))! - id - } else { - tags_found.u32() - } - } else { - 0 - } + return if tags.len > 0 { + mut tags_fixed := tags.map(it.to_lower_ascii().trim_space()).filter(it != '') + tags_fixed.sort_ignore_case() + hash := md5.hexhash(tags_fixed.join(',')) + tags_found := self.redis.hget('db:tags', hash)! + return if tags_found == '' { + println('tags_get: new tags: ${tags_fixed.join(",")}') + id := self.new_id()! + self.redis.hset('db:tags', hash, id.str())! + self.redis.hset('db:tags', id.str(), tags_fixed.join(','))! + id + } else { + tags_found.u32() + } + } else { + 0 + } } ``` File: /Users/despiegk/code/github/incubaid/herolib/lib/hero/heromodels/calendar_event.v + ```v module heromodels -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.hero.db +import incubaid.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.hero.db // CalendarEvent represents a single event in a calendar @[heap] pub struct CalendarEvent { - db.Base + db.Base pub mut: - title string - start_time i64 // Unix timestamp - end_time i64 // Unix timestamp - location string - attendees []u32 // IDs of user groups - fs_items []u32 // IDs of linked files or dirs - calendar_id u32 // Associated calendar - status EventStatus - is_all_day bool - is_recurring bool - recurrence []RecurrenceRule // normally empty - reminder_mins []int // Minutes before event for reminders - color string // Hex color code - timezone string + title string + start_time i64 // Unix timestamp + end_time i64 // Unix timestamp + location string + attendees []u32 // IDs of user groups + fs_items []u32 // IDs of linked files or dirs + calendar_id u32 // Associated calendar + status EventStatus + is_all_day bool + is_recurring bool + recurrence []RecurrenceRule // normally empty + reminder_mins []int // Minutes before event for reminders + color string // Hex color code + timezone string } pub struct Attendee { pub mut: - user_id u32 - status AttendanceStatus - role AttendeeRole + user_id u32 + status AttendanceStatus + role AttendeeRole } pub enum AttendanceStatus { - no_response - accepted - declined - tentative + no_response + accepted + declined + tentative } pub enum AttendeeRole { - required - optional - organizer + required + optional + organizer } pub enum EventStatus { - draft - published - cancelled - completed + draft + published + cancelled + completed } pub struct RecurrenceRule { pub mut: - frequency RecurrenceFreq - interval int // Every N frequencies - until i64 // End date (Unix timestamp) - count int // Number of occurrences - by_weekday []int // Days of week (0=Sunday) - by_monthday []int // Days of month + frequency RecurrenceFreq + interval int // Every N frequencies + until i64 // End date (Unix timestamp) + count int // Number of occurrences + by_weekday []int // Days of week (0=Sunday) + by_monthday []int // Days of month } pub enum RecurrenceFreq { - none - daily - weekly - monthly - yearly + none + daily + weekly + monthly + yearly } pub struct DBCalendarEvent { pub mut: - db &db.DB @[skip; str: skip] + db &db.DB @[skip; str: skip] } pub fn (self CalendarEvent) type_name() string { - return 'calendar_event' + return 'calendar_event' } pub fn (self CalendarEvent) dump(mut e &encoder.Encoder) ! { - e.add_string(self.title) - e.add_i64(self.start_time) - e.add_i64(self.end_time) - e.add_string(self.location) - e.add_list_u32(self.attendees) - e.add_list_u32(self.fs_items) - e.add_u32(self.calendar_id) - e.add_u8(u8(self.status)) - e.add_bool(self.is_all_day) - e.add_bool(self.is_recurring) + e.add_string(self.title) + e.add_i64(self.start_time) + e.add_i64(self.end_time) + e.add_string(self.location) + e.add_list_u32(self.attendees) + e.add_list_u32(self.fs_items) + e.add_u32(self.calendar_id) + e.add_u8(u8(self.status)) + e.add_bool(self.is_all_day) + e.add_bool(self.is_recurring) - // Encode recurrence array - e.add_u16(u16(self.recurrence.len)) - for rule in self.recurrence { - e.add_u8(u8(rule.frequency)) - e.add_int(rule.interval) - e.add_i64(rule.until) - e.add_int(rule.count) - e.add_list_int(rule.by_weekday) - e.add_list_int(rule.by_monthday) - } + // Encode recurrence array + e.add_u16(u16(self.recurrence.len)) + for rule in self.recurrence { + e.add_u8(u8(rule.frequency)) + e.add_int(rule.interval) + e.add_i64(rule.until) + e.add_int(rule.count) + e.add_list_int(rule.by_weekday) + e.add_list_int(rule.by_monthday) + } - e.add_list_int(self.reminder_mins) - e.add_string(self.color) - e.add_string(self.timezone) + e.add_list_int(self.reminder_mins) + e.add_string(self.color) + e.add_string(self.timezone) } fn (mut self DBCalendarEvent) load(mut o CalendarEvent, mut e &encoder.Decoder) ! { - o.title = e.get_string()! - o.start_time = e.get_i64()! - o.end_time = e.get_i64()! - o.location = e.get_string()! - o.attendees = e.get_list_u32()! - o.fs_items = e.get_list_u32()! - o.calendar_id = e.get_u32()! - o.status = unsafe { EventStatus(e.get_u8()!) } //TODO: is there no better way? - o.is_all_day = e.get_bool()! - o.is_recurring = e.get_bool()! + o.title = e.get_string()! + o.start_time = e.get_i64()! + o.end_time = e.get_i64()! + o.location = e.get_string()! + o.attendees = e.get_list_u32()! + o.fs_items = e.get_list_u32()! + o.calendar_id = e.get_u32()! + o.status = unsafe { EventStatus(e.get_u8()!) } //TODO: is there no better way? + o.is_all_day = e.get_bool()! + o.is_recurring = e.get_bool()! - // Decode recurrence array - recurrence_len := e.get_u16()! - mut recurrence := []RecurrenceRule{} - for _ in 0 .. recurrence_len { - frequency := unsafe { RecurrenceFreq(e.get_u8()!) } - interval := e.get_int()! - until := e.get_i64()! - count := e.get_int()! - by_weekday := e.get_list_int()! - by_monthday := e.get_list_int()! + // Decode recurrence array + recurrence_len := e.get_u16()! + mut recurrence := []RecurrenceRule{} + for _ in 0 .. recurrence_len { + frequency := unsafe { RecurrenceFreq(e.get_u8()!) } + interval := e.get_int()! + until := e.get_i64()! + count := e.get_int()! + by_weekday := e.get_list_int()! + by_monthday := e.get_list_int()! - recurrence << RecurrenceRule{ - frequency: frequency - interval: interval - until: until - count: count - by_weekday: by_weekday - by_monthday: by_monthday - } - } - o.recurrence = recurrence + recurrence << RecurrenceRule{ + frequency: frequency + interval: interval + until: until + count: count + by_weekday: by_weekday + by_monthday: by_monthday + } + } + o.recurrence = recurrence - o.reminder_mins = e.get_list_int()! - o.color = e.get_string()! - o.timezone = e.get_string()! + o.reminder_mins = e.get_list_int()! + o.color = e.get_string()! + o.timezone = e.get_string()! } @[params] pub struct CalendarEventArg { pub mut: - name string - description string - title string - start_time string // use ourtime module to go from string to epoch - end_time string // use ourtime module to go from string to epoch - location string - attendees []u32 // IDs of user groups - fs_items []u32 // IDs of linked files or dirs - calendar_id u32 // Associated calendar - status EventStatus - is_all_day bool - is_recurring bool - recurrence []RecurrenceRule - reminder_mins []int // Minutes before event for reminders - color string // Hex color code - timezone string - securitypolicy u32 - tags []string - comments []db.CommentArg + name string + description string + title string + start_time string // use ourtime module to go from string to epoch + end_time string // use ourtime module to go from string to epoch + location string + attendees []u32 // IDs of user groups + fs_items []u32 // IDs of linked files or dirs + calendar_id u32 // Associated calendar + status EventStatus + is_all_day bool + is_recurring bool + recurrence []RecurrenceRule + reminder_mins []int // Minutes before event for reminders + color string // Hex color code + timezone string + securitypolicy u32 + tags []string + comments []db.CommentArg } // get new calendar event, not from the DB pub fn (mut self DBCalendarEvent) new(args CalendarEventArg) !CalendarEvent { - mut o := CalendarEvent{ - title: args.title - location: args.location - attendees: args.attendees - fs_items: args.fs_items - calendar_id: args.calendar_id - status: args.status - is_all_day: args.is_all_day - is_recurring: args.is_recurring - recurrence: args.recurrence - reminder_mins: args.reminder_mins - color: args.color - timezone: args.timezone - } + mut o := CalendarEvent{ + title: args.title + location: args.location + attendees: args.attendees + fs_items: args.fs_items + calendar_id: args.calendar_id + status: args.status + is_all_day: args.is_all_day + is_recurring: args.is_recurring + recurrence: args.recurrence + reminder_mins: args.reminder_mins + color: args.color + timezone: args.timezone + } - // Set base fields - o.name = args.name - o.description = args.description - o.securitypolicy = args.securitypolicy - o.tags = self.db.tags_get(args.tags)! - o.comments = self.db.comments_get(args.comments)! - o.updated_at = ourtime.now().unix() + // Set base fields + o.name = args.name + o.description = args.description + o.securitypolicy = args.securitypolicy + o.tags = self.db.tags_get(args.tags)! + o.comments = self.db.comments_get(args.comments)! + o.updated_at = ourtime.now().unix() - // Convert string times to Unix timestamps - mut start_time_obj := ourtime.new(args.start_time)! - o.start_time = start_time_obj.unix() + // Convert string times to Unix timestamps + mut start_time_obj := ourtime.new(args.start_time)! + o.start_time = start_time_obj.unix() - mut end_time_obj := ourtime.new(args.end_time)! - o.end_time = end_time_obj.unix() + mut end_time_obj := ourtime.new(args.end_time)! + o.end_time = end_time_obj.unix() - return o + return o } pub fn (mut self DBCalendarEvent) set(o CalendarEvent) !u32 { - // Use db set function which now returns the ID - return self.db.set[CalendarEvent](o)! + // Use db set function which now returns the ID + return self.db.set[CalendarEvent](o)! } pub fn (mut self DBCalendarEvent) delete(id u32) ! { - self.db.delete[CalendarEvent](id)! + self.db.delete[CalendarEvent](id)! } pub fn (mut self DBCalendarEvent) exist(id u32) !bool { - return self.db.exists[CalendarEvent](id)! + return self.db.exists[CalendarEvent](id)! } pub fn (mut self DBCalendarEvent) get(id u32) !CalendarEvent { - mut o, data := self.db.get_data[CalendarEvent](id)! - mut e_decoder := encoder.decoder_new(data) - self.load(mut o, mut e_decoder)! - return o + mut o, data := self.db.get_data[CalendarEvent](id)! + mut e_decoder := encoder.decoder_new(data) + self.load(mut o, mut e_decoder)! + return o } pub fn (mut self DBCalendarEvent) list() ![]CalendarEvent { - return self.db.list[CalendarEvent]()!.map(self.get(it)!) + return self.db.list[CalendarEvent]()!.map(self.get(it)!) } ``` + make the crud and example for all files in lib/hero/herofs @@ -1436,5 +1451,4 @@ check the implementation do the implementation - diff --git a/aiprompts/instructions_archive/documentation_from_v.md b/aiprompts/instructions_archive/documentation_from_v.md index fedea0c0..09b55227 100644 --- a/aiprompts/instructions_archive/documentation_from_v.md +++ b/aiprompts/instructions_archive/documentation_from_v.md @@ -1,4 +1,4 @@ -params: +params: - filepath: /Users/despiegk/code/github/incubaid/herolib/lib/clients/openai @@ -18,8 +18,8 @@ the template is as follows ## factory is there factory, which one and quick example how to call, don’t say in which file not relevant -show how to import the module is as follows: import freeflowuniverse.herolib. -and then starting from lib e.g. lib/clients/mycelium would result in import freeflowuniverse.herolib. clients.mycelium +show how to import the module is as follows: import incubaid.herolib. +and then starting from lib e.g. lib/clients/mycelium would result in import incubaid.herolib. clients.mycelium ## overview @@ -45,8 +45,8 @@ don't mention what we don't show because of rules above. the only output we want is markdown file as follows -===WRITE=== +===WRITE=== $filepath ===CONTENT=== $the content of the generated markdown file -===END=== \ No newline at end of file +===END=== diff --git a/aiprompts/instructions_archive/documentation_from_v_md.md b/aiprompts/instructions_archive/documentation_from_v_md.md index b8ac036e..cb8dfe68 100644 --- a/aiprompts/instructions_archive/documentation_from_v_md.md +++ b/aiprompts/instructions_archive/documentation_from_v_md.md @@ -10,13 +10,11 @@ start of output file is: ## factory is there factory, which one and quick example how to call, don’t say in which file not relevant -show how to import the module is as follows: import freeflowuniverse.herolib. -and then starting from lib e.g. lib/clients/mycelium would result in import freeflowuniverse.herolib. clients.mycelium +show how to import the module is as follows: import incubaid.herolib. +and then starting from lib e.g. lib/clients/mycelium would result in import incubaid.herolib. clients.mycelium ## structs and methods quick overview as list with identations, of the structs and its methods - ONLY OUTPUT THE MARKDOWN FILE, NOTHING ELSE - diff --git a/aiprompts/instructions_archive/models_from_v/complete.md b/aiprompts/instructions_archive/models_from_v/complete.md index 8a9c4d71..db16c785 100644 --- a/aiprompts/instructions_archive/models_from_v/complete.md +++ b/aiprompts/instructions_archive/models_from_v/complete.md @@ -468,6 +468,7 @@ File: /Users/despiegk/code/github/incubaid/herolib/aiprompts/herolib_core/core_curdir_example.md + ```md # Getting the Current Script's Path in Herolib/V Shell @@ -493,42 +494,43 @@ the following is a good pragmatic way to remember clients, installers as a globa module docsite -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.texttools __global ( - siteconfigs map[string]&SiteConfig + siteconfigs map[string]&SiteConfig ) @[params] pub struct FactoryArgs { pub mut: - name string = "default" + name string = "default" } pub fn new(args FactoryArgs) !&SiteConfig { - name := texttools.name_fix(args.name) - siteconfigs[name] = &SiteConfig{ - name: name - } - return get(name:name)! + name := texttools.name_fix(args.name) + siteconfigs[name] = &SiteConfig{ + name: name + } + return get(name:name)! } pub fn get(args FactoryArgs) !&SiteConfig { - name := texttools.name_fix(args.name) - mut sc := siteconfigs[name] or { - return error('siteconfig with name "${name}" does not exist') - } - return sc + name := texttools.name_fix(args.name) + mut sc := siteconfigs[name] or { + return error('siteconfig with name "${name}" does not exist') + } + return sc } pub fn default() !&SiteConfig { - if siteconfigs.len == 0 { - return new(name:'default')! - } - return get()! + if siteconfigs.len == 0 { + return new(name:'default')! + } + return get()! } ``` + ``` File: /Users/despiegk/code/github/incubaid/herolib/aiprompts/herolib_core/core_heroscript_basics.md @@ -541,53 +543,53 @@ HeroScript is a concise scripting language with the following structure: ```heroscript !!actor.action_name - param1: 'value1' - param2: 'value with spaces' - multiline_description: ' - This is a multiline description. - It can span multiple lines. - ' - arg1 arg2 // Arguments without keys + param1: 'value1' + param2: 'value with spaces' + multiline_description: ' + This is a multiline description. + It can span multiple lines. + ' + arg1 arg2 // Arguments without keys ``` Key characteristics: -- **Actions**: Start with `!!`, followed by `actor.action_name` (e.g., `!!mailclient.configure`). -- **Parameters**: Defined as `key:value`. Values can be quoted for spaces. -- **Multiline Support**: Parameters like `description` can span multiple lines. -- **Arguments**: Values without keys (e.g., `arg1`). + +- __Actions__: Start with `!!`, followed by `actor.action_name` (e.g., `!!mailclient.configure`). +- __Parameters__: Defined as `key:value`. Values can be quoted for spaces. +- __Multiline Support__: Parameters like `description` can span multiple lines. +- __Arguments__: Values without keys (e.g., `arg1`). ## Processing HeroScript in Vlang HeroScript can be parsed into a `playbook.PlayBook` object, allowing structured access to actions and their parameters, this is used in most of the herolib modules, it allows configuration or actions in a structured way. ```v -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console pub fn play(mut plbook PlayBook) ! { - if plbook.exists_once(filter: 'docusaurus.define') { - mut action := plbook.get(filter: 'docusaurus.define')! - mut p := action.params - //example how we get parameters from the action see core_params.md for more details - ds = new( - path: p.get_default('path_publish', '')! - production: p.get_default_false('production') - )! - } + if plbook.exists_once(filter: 'docusaurus.define') { + mut action := plbook.get(filter: 'docusaurus.define')! + mut p := action.params + //example how we get parameters from the action see core_params.md for more details + ds = new( + path: p.get_default('path_publish', '')! + production: p.get_default_false('production') + )! + } - // Process 'docusaurus.add' actions to configure individual Docusaurus sites - actions := plbook.find(filter: 'docusaurus.add')! - for action in actions { - mut p := action.params - //do more processing here - } + // Process 'docusaurus.add' actions to configure individual Docusaurus sites + actions := plbook.find(filter: 'docusaurus.add')! + for action in actions { + mut p := action.params + //do more processing here + } } ``` For detailed information on parameter retrieval methods (e.g., `p.get()`, `p.get_int()`, `p.get_default_true()`), refer to `aiprompts/ai_core/core_params.md`. - ``` File: /Users/despiegk/code/github/incubaid/herolib/aiprompts/herolib_core/core_heroscript_playbook.md @@ -599,8 +601,8 @@ File: /Users/despiegk/code/github/incubaid/herolib/aiprompts/herolib_core/core_h HeroScript can be parsed into a `playbook.PlayBook` object, allowing structured access to actions and their parameters. ```v -import freeflowuniverse.herolib.core.playbook -import freeflowuniverse.herolib.core.playcmds +import incubaid.herolib.core.playbook +import incubaid.herolib.core.playcmds // path string // text string @@ -616,8 +618,6 @@ playcmds.run(mut plbook)! ``` - - ``` File: /Users/despiegk/code/github/incubaid/herolib/aiprompts/herolib_core/core_http_client.md @@ -636,7 +636,7 @@ The `HTTPConnection` module provides a robust HTTP client for Vlang, supporting ## Basic Usage ```v -import freeflowuniverse.herolib.core.httpconnection +import incubaid.herolib.core.httpconnection // Create a new HTTP connection mut conn := httpconnection.new( @@ -654,17 +654,17 @@ To integrate `HTTPConnection` into a management class (e.g., `HetznerManager`), ```v // Example: HetznerManager pub fn (mut h HetznerManager) connection() !&httpconnection.HTTPConnection { - mut c := h.conn or { - mut c2 := httpconnection.new( - name: 'hetzner_${h.name}' - url: h.baseurl - cache: true - retry: 3 - )! - c2.basic_auth(h.user, h.password) - c2 - } - return c + mut c := h.conn or { + mut c2 := httpconnection.new( + name: 'hetzner_${h.name}' + url: h.baseurl + cache: true + retry: 3 + )! + c2.basic_auth(h.user, h.password) + c2 + } + return c } ``` @@ -733,14 +733,15 @@ user := conn.get_json_generic[User]( ``` File: /Users/despiegk/code/github/incubaid/herolib/aiprompts/herolib_core/core_osal.md + ```md -# OSAL Core Module - Key Capabilities (freeflowuniverse.herolib.osal.core) +# OSAL Core Module - Key Capabilities (incubaid.herolib.osal.core) ```v //example how to get started -import freeflowuniverse.herolib.osal.core as osal +import incubaid.herolib.osal.core as osal osal.exec(cmd:"ls /")! @@ -752,50 +753,49 @@ this document has info about the most core functions, more detailed info can be ### 1. Process Execution -* **`osal.exec(cmd: Command) !Job`**: Execute a shell command. - * **Key Parameters**: `cmd` (string), `timeout` (int), `retry` (int), `work_folder` (string), `environment` (map[string]string), `stdout` (bool), `raise_error` (bool). - * **Returns**: `Job` (status, output, error, exit code). -* **`osal.execute_silent(cmd string) !string`**: Execute silently, return output. -* **`osal.cmd_exists(cmd string) bool`**: Check if a command exists. -* **`osal.process_kill_recursive(args: ProcessKillArgs) !`**: Kill a process and its children. +- __`osal.exec(cmd: Command) !Job`__: Execute a shell command. + - __Key Parameters__: `cmd` (string), `timeout` (int), `retry` (int), `work_folder` (string), `environment` (map[string]string), `stdout` (bool), `raise_error` (bool). + - __Returns__: `Job` (status, output, error, exit code). +- __`osal.execute_silent(cmd string) !string`__: Execute silently, return output. +- __`osal.cmd_exists(cmd string) bool`__: Check if a command exists. +- __`osal.process_kill_recursive(args: ProcessKillArgs) !`__: Kill a process and its children. ### 2. Network Utilities -* **`osal.ping(args: PingArgs) !bool`**: Check host reachability. -* **`osal.tcp_port_test(args: TcpPortTestArgs) bool`**: Test if a TCP port is open. - * **Key Parameters**: `address` (string), `port` (int). -* **`osal.ipaddr_pub_get() !string`**: Get public IP address. +- __`osal.ping(args: PingArgs) !bool`__: Check host reachability. +- __`osal.tcp_port_test(args: TcpPortTestArgs) bool`__: Test if a TCP port is open. + - __Key Parameters__: `address` (string), `port` (int). +- __`osal.ipaddr_pub_get() !string`__: Get public IP address. ### 3. File System Operations -* **`osal.file_write(path string, text string) !`**: Write text to a file. -* **`osal.file_read(path string) !string`**: Read content from a file. -* **`osal.dir_ensure(path string) !`**: Ensure a directory exists. -* **`osal.rm(todelete string) !`**: Remove files/directories. +- __`osal.file_write(path string, text string) !`__: Write text to a file. +- __`osal.file_read(path string) !string`__: Read content from a file. +- __`osal.dir_ensure(path string) !`__: Ensure a directory exists. +- __`osal.rm(todelete string) !`__: Remove files/directories. ### 4. Environment Variables -* **`osal.env_set(args: EnvSet)`**: Set an environment variable. - * **Key Parameters**: `key` (string), `value` (string). -* **`osal.env_get(key string) !string`**: Get an environment variable's value. -* **`osal.load_env_file(file_path string) !`**: Load variables from a file. +- __`osal.env_set(args: EnvSet)`__: Set an environment variable. + - __Key Parameters__: `key` (string), `value` (string). +- __`osal.env_get(key string) !string`__: Get an environment variable's value. +- __`osal.load_env_file(file_path string) !`__: Load variables from a file. ### 5. Command & Profile Management -* **`osal.cmd_add(args: CmdAddArgs) !`**: Add a binary to system paths and update profiles. - * **Key Parameters**: `source` (string, required), `cmdname` (string). -* **`osal.profile_path_add_remove(args: ProfilePathAddRemoveArgs) !`**: Add/remove paths from profiles. - * **Key Parameters**: `paths2add` (string), `paths2delete` (string). +- __`osal.cmd_add(args: CmdAddArgs) !`__: Add a binary to system paths and update profiles. + - __Key Parameters__: `source` (string, required), `cmdname` (string). +- __`osal.profile_path_add_remove(args: ProfilePathAddRemoveArgs) !`__: Add/remove paths from profiles. + - __Key Parameters__: `paths2add` (string), `paths2delete` (string). ### 6. System Information -* **`osal.platform() !PlatformType`**: Identify the operating system. -* **`osal.cputype() !CPUType`**: Identify the CPU architecture. -* **`osal.hostname() !string`**: Get system hostname. +- __`osal.platform() !PlatformType`__: Identify the operating system. +- __`osal.cputype() !CPUType`__: Identify the CPU architecture. +- __`osal.hostname() !string`__: Get system hostname. --- - ``` File: /Users/despiegk/code/github/incubaid/herolib/aiprompts/herolib_core/core_ourtime.md @@ -814,7 +814,7 @@ The `OurTime` module in V provides flexible time handling, supporting relative a ## Basic Usage ```v -import freeflowuniverse.herolib.data.ourtime +import incubaid.herolib.data.ourtime // Current time mut t := ourtime.now() @@ -896,6 +896,7 @@ t_invalid := ourtime.new('bad-date') or { ``` File: /Users/despiegk/code/github/incubaid/herolib/aiprompts/herolib_core/core_params.md + ```md # Parameter Parsing in Vlang @@ -904,7 +905,7 @@ This document details the `paramsparser` module, essential for handling paramete ## Obtaining a `paramsparser` Instance ```v -import freeflowuniverse.herolib.data.paramsparser +import incubaid.herolib.data.paramsparser // Create new params from a string params := paramsparser.new("color:red size:'large' priority:1 enable:true")! @@ -918,12 +919,13 @@ params.set("color", "red") The parser supports various input formats: -1. **Key-value pairs**: `key:value` -2. **Quoted values**: `key:'value with spaces'` (single or double quotes) -3. **Arguments without keys**: `arg1 arg2` (accessed by index) -4. **Comments**: `// this is a comment` (ignored during parsing) +1. __Key-value pairs__: `key:value` +2. __Quoted values__: `key:'value with spaces'` (single or double quotes) +3. __Arguments without keys__: `arg1 arg2` (accessed by index) +4. __Comments__: `// this is a comment` (ignored during parsing) Example: + ```v text := "name:'John Doe' age:30 active:true // user details" params := paramsparser.new(text)! @@ -935,77 +937,77 @@ The `paramsparser` module provides a comprehensive set of methods for retrieving ### Basic Retrieval -- `get(key string) !string`: Retrieves a string value by key. Returns an error if the key does not exist. -- `get_default(key string, defval string) !string`: Retrieves a string value by key, or returns `defval` if the key is not found. -- `exists(key string) bool`: Checks if a keyword argument (`key:value`) exists. -- `exists_arg(key string) bool`: Checks if an argument (value without a key) exists. +- `get(key string) !string`: Retrieves a string value by key. Returns an error if the key does not exist. +- `get_default(key string, defval string) !string`: Retrieves a string value by key, or returns `defval` if the key is not found. +- `exists(key string) bool`: Checks if a keyword argument (`key:value`) exists. +- `exists_arg(key string) bool`: Checks if an argument (value without a key) exists. ### Argument Retrieval (Positional) -- `get_arg(nr int) !string`: Retrieves an argument by its 0-based index. Returns an error if the index is out of bounds. -- `get_arg_default(nr int, defval string) !string`: Retrieves an argument by index, or returns `defval` if the index is out of bounds. +- `get_arg(nr int) !string`: Retrieves an argument by its 0-based index. Returns an error if the index is out of bounds. +- `get_arg_default(nr int, defval string) !string`: Retrieves an argument by index, or returns `defval` if the index is out of bounds. ### Type-Specific Retrieval -- `get_int(key string) !int`: Converts and retrieves an integer (int32). -- `get_int_default(key string, defval int) !int`: Retrieves an integer with a default. -- `get_u32(key string) !u32`: Converts and retrieves an unsigned 32-bit integer. -- `get_u32_default(key string, defval u32) !u32`: Retrieves a u32 with a default. -- `get_u64(key string) !u64`: Converts and retrieves an unsigned 64-bit integer. -- `get_u64_default(key string, defval u64) !u64`: Retrieves a u64 with a default. -- `get_u8(key string) !u8`: Converts and retrieves an unsigned 8-bit integer. -- `get_u8_default(key string, defval u8) !u8`: Retrieves a u8 with a default. -- `get_float(key string) !f64`: Converts and retrieves a 64-bit float. -- `get_float_default(key string, defval f64) !f64`: Retrieves a float with a default. -- `get_percentage(key string) !f64`: Converts a percentage string (e.g., "80%") to a float (0.8). -- `get_percentage_default(key string, defval string) !f64`: Retrieves a percentage with a default. +- `get_int(key string) !int`: Converts and retrieves an integer (int32). +- `get_int_default(key string, defval int) !int`: Retrieves an integer with a default. +- `get_u32(key string) !u32`: Converts and retrieves an unsigned 32-bit integer. +- `get_u32_default(key string, defval u32) !u32`: Retrieves a u32 with a default. +- `get_u64(key string) !u64`: Converts and retrieves an unsigned 64-bit integer. +- `get_u64_default(key string, defval u64) !u64`: Retrieves a u64 with a default. +- `get_u8(key string) !u8`: Converts and retrieves an unsigned 8-bit integer. +- `get_u8_default(key string, defval u8) !u8`: Retrieves a u8 with a default. +- `get_float(key string) !f64`: Converts and retrieves a 64-bit float. +- `get_float_default(key string, defval f64) !f64`: Retrieves a float with a default. +- `get_percentage(key string) !f64`: Converts a percentage string (e.g., "80%") to a float (0.8). +- `get_percentage_default(key string, defval string) !f64`: Retrieves a percentage with a default. ### Boolean Retrieval -- `get_default_true(key string) bool`: Returns `true` if the value is empty, "1", "true", "y", or "yes". Otherwise `false`. -- `get_default_false(key string) bool`: Returns `false` if the value is empty, "0", "false", "n", or "no". Otherwise `true`. +- `get_default_true(key string) bool`: Returns `true` if the value is empty, "1", "true", "y", or "yes". Otherwise `false`. +- `get_default_false(key string) bool`: Returns `false` if the value is empty, "0", "false", "n", or "no". Otherwise `true`. ### List Retrieval Lists are typically comma-separated strings (e.g., `users: "john,jane,bob"`). -- `get_list(key string) ![]string`: Retrieves a list of strings. -- `get_list_default(key string, def []string) ![]string`: Retrieves a list of strings with a default. -- `get_list_int(key string) ![]int`: Retrieves a list of integers. -- `get_list_int_default(key string, def []int) []int`: Retrieves a list of integers with a default. -- `get_list_f32(key string) ![]f32`: Retrieves a list of 32-bit floats. -- `get_list_f32_default(key string, def []f32) []f32`: Retrieves a list of f32 with a default. -- `get_list_f64(key string) ![]f64`: Retrieves a list of 64-bit floats. -- `get_list_f64_default(key string, def []f64) []f64`: Retrieves a list of f64 with a default. -- `get_list_i8(key string) ![]i8`: Retrieves a list of 8-bit signed integers. -- `get_list_i8_default(key string, def []i8) []i8`: Retrieves a list of i8 with a default. -- `get_list_i16(key string) ![]i16`: Retrieves a list of 16-bit signed integers. -- `get_list_i16_default(key string, def []i16) []i16`: Retrieves a list of i16 with a default. -- `get_list_i64(key string) ![]i64`: Retrieves a list of 64-bit signed integers. -- `get_list_i64_default(key string, def []i64) []i64`: Retrieves a list of i64 with a default. -- `get_list_u16(key string) ![]u16`: Retrieves a list of 16-bit unsigned integers. -- `get_list_u16_default(key string, def []u16) []u16`: Retrieves a list of u16 with a default. -- `get_list_u32(key string) ![]u32`: Retrieves a list of 32-bit unsigned integers. -- `get_list_u32_default(key string, def []u32) []u32`: Retrieves a list of u32 with a default. -- `get_list_u64(key string) ![]u64`: Retrieves a list of 64-bit unsigned integers. -- `get_list_u64_default(key string, def []u64) []u64`: Retrieves a list of u64 with a default. -- `get_list_namefix(key string) ![]string`: Retrieves a list of strings, normalizing each item (e.g., "My Name" -> "my_name"). -- `get_list_namefix_default(key string, def []string) ![]string`: Retrieves a list of name-fixed strings with a default. +- `get_list(key string) ![]string`: Retrieves a list of strings. +- `get_list_default(key string, def []string) ![]string`: Retrieves a list of strings with a default. +- `get_list_int(key string) ![]int`: Retrieves a list of integers. +- `get_list_int_default(key string, def []int) []int`: Retrieves a list of integers with a default. +- `get_list_f32(key string) ![]f32`: Retrieves a list of 32-bit floats. +- `get_list_f32_default(key string, def []f32) []f32`: Retrieves a list of f32 with a default. +- `get_list_f64(key string) ![]f64`: Retrieves a list of 64-bit floats. +- `get_list_f64_default(key string, def []f64) []f64`: Retrieves a list of f64 with a default. +- `get_list_i8(key string) ![]i8`: Retrieves a list of 8-bit signed integers. +- `get_list_i8_default(key string, def []i8) []i8`: Retrieves a list of i8 with a default. +- `get_list_i16(key string) ![]i16`: Retrieves a list of 16-bit signed integers. +- `get_list_i16_default(key string, def []i16) []i16`: Retrieves a list of i16 with a default. +- `get_list_i64(key string) ![]i64`: Retrieves a list of 64-bit signed integers. +- `get_list_i64_default(key string, def []i64) []i64`: Retrieves a list of i64 with a default. +- `get_list_u16(key string) ![]u16`: Retrieves a list of 16-bit unsigned integers. +- `get_list_u16_default(key string, def []u16) []u16`: Retrieves a list of u16 with a default. +- `get_list_u32(key string) ![]u32`: Retrieves a list of 32-bit unsigned integers. +- `get_list_u32_default(key string, def []u32) []u32`: Retrieves a list of u32 with a default. +- `get_list_u64(key string) ![]u64`: Retrieves a list of 64-bit unsigned integers. +- `get_list_u64_default(key string, def []u64) []u64`: Retrieves a list of u64 with a default. +- `get_list_namefix(key string) ![]string`: Retrieves a list of strings, normalizing each item (e.g., "My Name" -> "my_name"). +- `get_list_namefix_default(key string, def []string) ![]string`: Retrieves a list of name-fixed strings with a default. ### Specialized Retrieval -- `get_map() map[string]string`: Returns all parameters as a map. -- `get_path(key string) !string`: Retrieves a path string. -- `get_path_create(key string) !string`: Retrieves a path string, creating the directory if it doesn't exist. -- `get_from_hashmap(key string, defval string, hashmap map[string]string) !string`: Retrieves a value from a provided hashmap based on the parameter's value. -- `get_storagecapacity_in_bytes(key string) !u64`: Converts storage capacity strings (e.g., "10 GB", "500 MB") to bytes (u64). -- `get_storagecapacity_in_bytes_default(key string, defval u64) !u64`: Retrieves storage capacity in bytes with a default. -- `get_storagecapacity_in_gigabytes(key string) !u64`: Converts storage capacity strings to gigabytes (u64). -- `get_time(key string) !ourtime.OurTime`: Parses a time string (relative or absolute) into an `ourtime.OurTime` object. -- `get_time_default(key string, defval ourtime.OurTime) !ourtime.OurTime`: Retrieves time with a default. -- `get_time_interval(key string) !Duration`: Parses a time interval string into a `Duration` object. -- `get_timestamp(key string) !Duration`: Parses a timestamp string into a `Duration` object. -- `get_timestamp_default(key string, defval Duration) !Duration`: Retrieves a timestamp with a default. +- `get_map() map[string]string`: Returns all parameters as a map. +- `get_path(key string) !string`: Retrieves a path string. +- `get_path_create(key string) !string`: Retrieves a path string, creating the directory if it doesn't exist. +- `get_from_hashmap(key string, defval string, hashmap map[string]string) !string`: Retrieves a value from a provided hashmap based on the parameter's value. +- `get_storagecapacity_in_bytes(key string) !u64`: Converts storage capacity strings (e.g., "10 GB", "500 MB") to bytes (u64). +- `get_storagecapacity_in_bytes_default(key string, defval u64) !u64`: Retrieves storage capacity in bytes with a default. +- `get_storagecapacity_in_gigabytes(key string) !u64`: Converts storage capacity strings to gigabytes (u64). +- `get_time(key string) !ourtime.OurTime`: Parses a time string (relative or absolute) into an `ourtime.OurTime` object. +- `get_time_default(key string, defval ourtime.OurTime) !ourtime.OurTime`: Retrieves time with a default. +- `get_time_interval(key string) !Duration`: Parses a time interval string into a `Duration` object. +- `get_timestamp(key string) !Duration`: Parses a timestamp string into a `Duration` object. +- `get_timestamp_default(key string, defval Duration) !Duration`: Retrieves a timestamp with a default. ``` @@ -1028,10 +1030,11 @@ The pathlib module provides a comprehensive interface for handling file system o ### Importing pathlib ```v -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib ``` ### Creating Path Objects + ```v // Create a Path object for a file mut file_path := pathlib.get("path/to/file.txt") @@ -1041,6 +1044,7 @@ mut dir_path := pathlib.get("path/to/directory") ``` ### Basic Path Operations + ```v // Get absolute path abs_path := file_path.absolute() @@ -1057,6 +1061,7 @@ if file_path.exists() { ## Path Properties and Methods ### Path Types + ```v // Check if path is a file if file_path.is_file() { @@ -1075,6 +1080,7 @@ if file_path.is_link() { ``` ### Path Normalization + ```v // Normalize path (remove extra slashes, resolve . and ..) normalized_path := file_path.path_normalize() @@ -1089,6 +1095,7 @@ name_no_ext := file_path.name_no_ext() ## File and Directory Operations ### File Operations + ```v // Write to file file_path.write("Content to write")! @@ -1101,6 +1108,7 @@ file_path.delete()! ``` ### Directory Operations + ```v // Create directory mut dir := pathlib.get_dir( @@ -1116,6 +1124,7 @@ dir.delete()! ``` ### Symlink Operations + ```v // Create symlink file_path.link("path/to/symlink", delete_exists: true)! @@ -1127,12 +1136,14 @@ real_path := file_path.realpath() ## Advanced Operations ### Path Copying + ```v // Copy file to destination file_path.copy(dest: "path/to/destination")! ``` ### Recursive Operations + ```v // List directory recursively mut recursive_list := dir.list(recursive: true)! @@ -1142,6 +1153,7 @@ dir.delete()! ``` ### Path Filtering + ```v // List files matching pattern mut filtered_list := dir.list( @@ -1153,6 +1165,7 @@ mut filtered_list := dir.list( ## Best Practices ### Error Handling + ```v if file_path.exists() { // Safe to operate @@ -1161,7 +1174,6 @@ if file_path.exists() { } ``` - ``` File: /Users/despiegk/code/github/incubaid/herolib/aiprompts/herolib_core/core_text.md @@ -1173,93 +1185,121 @@ The `texttools` module provides a comprehensive set of utilities for text manipu ## Functions and Examples: ```v -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.texttools assert hello_world == texttools.name_fix("Hello World!") ``` + ### Name/Path Processing -* `name_fix(name string) string`: Normalizes filenames and paths. -* `name_fix_keepspace(name string) !string`: Like name_fix but preserves spaces. -* `name_fix_no_ext(name_ string) string`: Removes file extension. -* `name_fix_snake_to_pascal(name string) string`: Converts snake_case to PascalCase. + +* `name_fix(name string) string`: Normalizes filenames and paths. +- `name_fix_keepspace(name string) !string`: Like name_fix but preserves spaces. +- `name_fix_no_ext(name_ string) string`: Removes file extension. +- `name_fix_snake_to_pascal(name string) string`: Converts snake_case to PascalCase. + ```v name := texttools.name_fix_snake_to_pascal("hello_world") // Result: "HelloWorld" ``` -* `snake_case(name string) string`: Converts PascalCase to snake_case. + +* `snake_case(name string) string`: Converts PascalCase to snake_case. + ```v name := texttools.snake_case("HelloWorld") // Result: "hello_world" ``` -* `name_split(name string) !(string, string)`: Splits name into site and page components. +* `name_split(name string) !(string, string)`: Splits name into site and page components. ### Text Cleaning -* `name_clean(r string) string`: Normalizes names by removing special characters. + +* `name_clean(r string) string`: Normalizes names by removing special characters. + ```v name := texttools.name_clean("Hello@World!") // Result: "HelloWorld" ``` -* `ascii_clean(r string) string`: Removes all non-ASCII characters. -* `remove_empty_lines(text string) string`: Removes empty lines from text. + +* `ascii_clean(r string) string`: Removes all non-ASCII characters. +- `remove_empty_lines(text string) string`: Removes empty lines from text. + ```v text := texttools.remove_empty_lines("line1\n\nline2\n\n\nline3") // Result: "line1\nline2\nline3" ``` -* `remove_double_lines(text string) string`: Removes consecutive empty lines. -* `remove_empty_js_blocks(text string) string`: Removes empty code blocks (```...```). + +* `remove_double_lines(text string) string`: Removes consecutive empty lines. +- `remove_empty_js_blocks(text string) string`: Removes empty code blocks (```...```). ### Command Line Parsing -* `cmd_line_args_parser(text string) ![]string`: Parses command line arguments with support for quotes and escaping. + +* `cmd_line_args_parser(text string) ![]string`: Parses command line arguments with support for quotes and escaping. + ```v args := texttools.cmd_line_args_parser("'arg with spaces' --flag=value") // Result: ['arg with spaces', '--flag=value'] ``` -* `text_remove_quotes(text string) string`: Removes quoted sections from text. -* `check_exists_outside_quotes(text string, items []string) bool`: Checks if items exist in text outside of quotes. + +* `text_remove_quotes(text string) string`: Removes quoted sections from text. +- `check_exists_outside_quotes(text string, items []string) bool`: Checks if items exist in text outside of quotes. ### Text Expansion -* `expand(txt_ string, l int, expand_with string) string`: Expands text to a specified length with a given character. + +* `expand(txt_ string, l int, expand_with string) string`: Expands text to a specified length with a given character. ### Indentation -* `indent(text string, prefix string) string`: Adds indentation prefix to each line. + +* `indent(text string, prefix string) string`: Adds indentation prefix to each line. + ```v text := texttools.indent("line1\nline2", " ") // Result: " line1\n line2\n" ``` -* `dedent(text string) string`: Removes common leading whitespace from every line. + +* `dedent(text string) string`: Removes common leading whitespace from every line. + ```v text := texttools.dedent(" line1\n line2") // Result: "line1\nline2" ``` ### String Validation -* `is_int(text string) bool`: Checks if text contains only digits. -* `is_upper_text(text string) bool`: Checks if text contains only uppercase letters. + +* `is_int(text string) bool`: Checks if text contains only digits. +- `is_upper_text(text string) bool`: Checks if text contains only uppercase letters. ### Multiline Processing -* `multiline_to_single(text string) !string`: Converts multiline text to a single line with proper escaping. + +* `multiline_to_single(text string) !string`: Converts multiline text to a single line with proper escaping. ### Text Splitting -* `split_smart(t string, delimiter_ string) []string`: Intelligent string splitting that respects quotes. + +* `split_smart(t string, delimiter_ string) []string`: Intelligent string splitting that respects quotes. ### Tokenization -* `tokenize(text_ string) TokenizerResult`: Tokenizes text into meaningful parts. -* `text_token_replace(text string, tofind string, replacewith string) !string`: Replaces tokens in text. + +* `tokenize(text_ string) TokenizerResult`: Tokenizes text into meaningful parts. +- `text_token_replace(text string, tofind string, replacewith string) !string`: Replaces tokens in text. ### Version Parsing -* `version(text_ string) int`: Converts version strings to comparable integers. + +* `version(text_ string) int`: Converts version strings to comparable integers. + ```v ver := texttools.version("v0.4.36") // Result: 4036 ver = texttools.version("v1.4.36") // Result: 1004036 ``` ### Formatting -* `format_rfc1123(t time.Time) string`: Formats a time.Time object into RFC 1123 format. - +* `format_rfc1123(t time.Time) string`: Formats a time.Time object into RFC 1123 format. + ### Array Operations -* `to_array(r string) []string`: Converts a comma or newline separated list to an array of strings. + +* `to_array(r string) []string`: Converts a comma or newline separated list to an array of strings. + ```v text := "item1,item2,item3" array := texttools.to_array(text) // Result: ['item1', 'item2', 'item3'] ``` -* `to_array_int(r string) []int`: Converts a text list to an array of integers. -* `to_map(mapstring string, line string, delimiter_ string) map[string]string`: Intelligent mapping of a line to a map based on a template. + +* `to_array_int(r string) []int`: Converts a text list to an array of integers. +- `to_map(mapstring string, line string, delimiter_ string) map[string]string`: Intelligent mapping of a line to a map based on a template. + ```v r := texttools.to_map("name,-,-,-,-,pid,-,-,-,-,path", "root 304 0.0 0.0 408185328 1360 ?? S 16Dec23 0:34.06 /usr/sbin/distnoted") @@ -1277,7 +1317,7 @@ has mechanisms to print better to console, see the methods below import as ```v -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console ``` @@ -1296,23 +1336,23 @@ fn color_fg(c ForegroundColor) string struct PrintArgs { pub mut: - foreground ForegroundColor - background BackgroundColor - text string - style Style - reset_before bool = true - reset_after bool = true + foreground ForegroundColor + background BackgroundColor + text string + style Style + reset_before bool = true + reset_after bool = true } fn cprint(args PrintArgs) // print with colors, reset... // ``` - // foreground ForegroundColor - // background BackgroundColor - // text string - // style Style - // reset_before bool = true - // reset_after bool = true + // foreground ForegroundColor + // background BackgroundColor + // text string + // style Style + // reset_before bool = true + // reset_after bool = true // ``` fn cprintln(args_ PrintArgs) @@ -1367,11 +1407,11 @@ Is used to ask feedback to users struct UIConsole { pub mut: - x_max int = 80 - y_max int = 60 - prev_lf bool - prev_title bool - prev_item bool + x_max int = 80 + y_max int = 60 + prev_lf bool + prev_title bool + prev_item bool } //DropDownArgs: @@ -1422,51 +1462,51 @@ fn (mut c UIConsole) status() string ```v enum BackgroundColor { - default_color = 49 // 'default' is a reserved keyword in V - black = 40 - red = 41 - green = 42 - yellow = 43 - blue = 44 - magenta = 45 - cyan = 46 - light_gray = 47 - dark_gray = 100 - light_red = 101 - light_green = 102 - light_yellow = 103 - light_blue = 104 - light_magenta = 105 - light_cyan = 106 - white = 107 + default_color = 49 // 'default' is a reserved keyword in V + black = 40 + red = 41 + green = 42 + yellow = 43 + blue = 44 + magenta = 45 + cyan = 46 + light_gray = 47 + dark_gray = 100 + light_red = 101 + light_green = 102 + light_yellow = 103 + light_blue = 104 + light_magenta = 105 + light_cyan = 106 + white = 107 } enum ForegroundColor { - default_color = 39 // 'default' is a reserved keyword in V - white = 97 - black = 30 - red = 31 - green = 32 - yellow = 33 - blue = 34 - magenta = 35 - cyan = 36 - light_gray = 37 - dark_gray = 90 - light_red = 91 - light_green = 92 - light_yellow = 93 - light_blue = 94 - light_magenta = 95 - light_cyan = 96 + default_color = 39 // 'default' is a reserved keyword in V + white = 97 + black = 30 + red = 31 + green = 32 + yellow = 33 + blue = 34 + magenta = 35 + cyan = 36 + light_gray = 37 + dark_gray = 90 + light_red = 91 + light_green = 92 + light_yellow = 93 + light_blue = 94 + light_magenta = 95 + light_cyan = 96 } enum Style { - normal = 99 - bold = 1 - dim = 2 - underline = 4 - blink = 5 - reverse = 7 - hidden = 8 + normal = 99 + bold = 1 + dim = 2 + underline = 4 + blink = 5 + reverse = 7 + hidden = 8 } ``` @@ -1482,7 +1522,7 @@ this is how we want example scripts to be, see the first line ```v #!/usr/bin/env -S v -cg -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib... +import incubaid.herolib... ``` @@ -1688,6 +1728,7 @@ impl Company { ``` File: /Users/despiegk/code/git.threefold.info/herocode/db/heromodels/src/models/biz/mod.rs + ```rs // Business models module // Sub-modules will be declared here @@ -1712,6 +1753,7 @@ pub use sale::{Sale, SaleItem, SaleStatus}; ``` File: /Users/despiegk/code/git.threefold.info/herocode/db/heromodels/src/models/biz/payment.rs + ```rs use heromodels_core::BaseModelData; use heromodels_derive::model; @@ -1933,6 +1975,7 @@ impl Payment { ``` File: /Users/despiegk/code/git.threefold.info/herocode/db/heromodels/src/models/biz/product.rs + ```rs use heromodels_core::BaseModelData; use heromodels_derive::model; @@ -2086,6 +2129,7 @@ impl Product { ``` File: /Users/despiegk/code/git.threefold.info/herocode/db/heromodels/src/models/biz/README.md + ```md # Business Models (`biz`) @@ -2149,6 +2193,7 @@ All models use the builder pattern for easy and readable instance creation. ``` File: /Users/despiegk/code/git.threefold.info/herocode/db/heromodels/src/models/biz/sale.rs + ```rs use heromodels_core::{BaseModelData, BaseModelDataOps, Model}; use rhai::{CustomType, TypeBuilder}; @@ -2326,6 +2371,7 @@ impl Sale { ``` File: /Users/despiegk/code/git.threefold.info/herocode/db/heromodels/src/models/biz/shareholder.rs + ```rs use heromodels_core::BaseModelData; use heromodels_derive::model; @@ -2410,6 +2456,7 @@ impl Shareholder { } ``` + You are a senior software architect specializing in code design and implementation planning. Your role is to: @@ -2425,6 +2472,7 @@ You are a senior software architect specializing in code design and implementati - Configuration updates For each change: + - Describe the exact location in the code where changes are needed - Explain the logic and reasoning behind each modification - Provide example signatures, parameters, and return types @@ -2448,7 +2496,6 @@ forget what rust does, there is no special module things needed, no re-exports o there is no defaults for empty strings or 0 ints, … defaults are only for non empty stuff - $NAME = finance @@ -2472,6 +2519,4 @@ at top of each file we have ```module $NAME``` don't create management classes, only output the structs - - diff --git a/aiprompts/instructions_archive/models_from_v/prompt.md b/aiprompts/instructions_archive/models_from_v/prompt.md index d7b4eeaa..eb2799ce 100644 --- a/aiprompts/instructions_archive/models_from_v/prompt.md +++ b/aiprompts/instructions_archive/models_from_v/prompt.md @@ -17,16 +17,14 @@ don't do anything additional for modules, don't do import at top of each file we have ```module $NAME``` - make sure all time related fields are in u64 format, use unix timestamp for that don't create management classes, only output the structs, don't create a mod.v, don't make .v scripts executatble, don't create a main.v - ## now also make sure we use core.base as follows ``` -import freeflowuniverse.herolib.hero.models.core +import incubaid.herolib.hero.models.core // Account represents a financial account for tracking balances and transactions // Supports multiple account types (checking, savings, investment, etc.) diff --git a/aiprompts/instructions_archive/models_from_v/update.md b/aiprompts/instructions_archive/models_from_v/update.md index bafa8741..6f7bf3f1 100644 --- a/aiprompts/instructions_archive/models_from_v/update.md +++ b/aiprompts/instructions_archive/models_from_v/update.md @@ -3,7 +3,7 @@ for governance and legal make sure we use core.base as follows -import freeflowuniverse.herolib.hero.models.core +import incubaid.herolib.hero.models.core // Account represents a financial account for tracking balances and transactions // Supports multiple account types (checking, savings, investment, etc.) diff --git a/aiprompts/todo/refactor_herofs.md b/aiprompts/todo/refactor_herofs.md index 43c94f39..d2ebe6a2 100644 --- a/aiprompts/todo/refactor_herofs.md +++ b/aiprompts/todo/refactor_herofs.md @@ -677,34 +677,36 @@ File: /Users/despiegk/code/github/incubaid/herolib/lib/hero/db/helpers_tags.v + ```v module db import crypto.md5 pub fn (mut self DB) tags_get(tags []string) !u32 { - return if tags.len > 0 { - mut tags_fixed := tags.map(it.to_lower_ascii().trim_space()).filter(it != '') - tags_fixed.sort_ignore_case() - hash := md5.hexhash(tags_fixed.join(',')) - tags_found := self.redis.hget('db:tags', hash)! - return if tags_found == '' { - println('tags_get: new tags: ${tags_fixed.join(',')}') - id := self.new_id()! - self.redis.hset('db:tags', hash, id.str())! - self.redis.hset('db:tags', id.str(), tags_fixed.join(','))! - id - } else { - tags_found.u32() - } - } else { - 0 - } + return if tags.len > 0 { + mut tags_fixed := tags.map(it.to_lower_ascii().trim_space()).filter(it != '') + tags_fixed.sort_ignore_case() + hash := md5.hexhash(tags_fixed.join(',')) + tags_found := self.redis.hget('db:tags', hash)! + return if tags_found == '' { + println('tags_get: new tags: ${tags_fixed.join(',')}') + id := self.new_id()! + self.redis.hset('db:tags', hash, id.str())! + self.redis.hset('db:tags', id.str(), tags_fixed.join(','))! + id + } else { + tags_found.u32() + } + } else { + 0 + } } ``` File: /Users/despiegk/code/github/incubaid/herolib/lib/hero/db/helpers_comments.v + ```v module db @@ -713,210 +715,214 @@ import crypto.md5 @[params] pub struct CommentArg { pub mut: - comment string - parent u32 - author u32 + comment string + parent u32 + author u32 } pub fn (mut self DB) comments_get(args []CommentArg) ![]u32 { - return args.map(self.comment_get(it.comment)!) + return args.map(self.comment_get(it.comment)!) } pub fn (mut self DB) comment_get(comment string) !u32 { - comment_fixed := comment.to_lower_ascii().trim_space() - return if comment_fixed.len > 0 { - hash := md5.hexhash(comment_fixed) - comment_found := self.redis.hget('db:comments', hash)! - if comment_found == '' { - id := self.new_id()! - self.redis.hset('db:comments', hash, id.str())! - self.redis.hset('db:comments', id.str(), comment_fixed)! - id - } else { - comment_found.u32() - } - } else { - 0 - } + comment_fixed := comment.to_lower_ascii().trim_space() + return if comment_fixed.len > 0 { + hash := md5.hexhash(comment_fixed) + comment_found := self.redis.hget('db:comments', hash)! + if comment_found == '' { + id := self.new_id()! + self.redis.hset('db:comments', hash, id.str())! + self.redis.hset('db:comments', id.str(), comment_fixed)! + id + } else { + comment_found.u32() + } + } else { + 0 + } } ``` File: /Users/despiegk/code/github/incubaid/herolib/lib/hero/db/factory.v + ```v module db -import freeflowuniverse.herolib.core.redisclient +import incubaid.herolib.core.redisclient // Current time -// import freeflowuniverse.herolib.data.encoder +// import incubaid.herolib.data.encoder pub struct DB { pub mut: - redis &redisclient.Redis @[skip; str: skip] + redis &redisclient.Redis @[skip; str: skip] } pub fn new() !DB { - mut redisconnection := redisclient.core_get()! - return DB{ - redis: redisconnection - } + mut redisconnection := redisclient.core_get()! + return DB{ + redis: redisconnection + } } ``` File: /Users/despiegk/code/github/incubaid/herolib/lib/hero/db/core_models.v + ```v module db import crypto.md5 -import freeflowuniverse.herolib.core.redisclient -import freeflowuniverse.herolib.data.ourtime +import incubaid.herolib.core.redisclient +import incubaid.herolib.data.ourtime // Group represents a collection of users with roles and permissions @[heap] pub struct Base { pub mut: - id u32 - name string - description string - created_at i64 - updated_at i64 - securitypolicy u32 - tags u32 // when we set/get we always do as []string but this can then be sorted and md5ed this gies the unique id of tags - comments []u32 + id u32 + name string + description string + created_at i64 + updated_at i64 + securitypolicy u32 + tags u32 // when we set/get we always do as []string but this can then be sorted and md5ed this gies the unique id of tags + comments []u32 } @[heap] pub struct SecurityPolicy { pub mut: - id u32 - read []u32 // links to users & groups - write []u32 // links to users & groups - delete []u32 // links to users & groups - public bool - md5 string // this sorts read, write and delete u32 + hash, then do md5 hash, this allows to go from a random read/write/delete/public config to a hash + id u32 + read []u32 // links to users & groups + write []u32 // links to users & groups + delete []u32 // links to users & groups + public bool + md5 string // this sorts read, write and delete u32 + hash, then do md5 hash, this allows to go from a random read/write/delete/public config to a hash } @[heap] pub struct Tags { pub mut: - id u32 - names []string // unique per id - md5 string // of sorted names, to make easy to find unique id, each name lowercased and made ascii + id u32 + names []string // unique per id + md5 string // of sorted names, to make easy to find unique id, each name lowercased and made ascii } ``` File: /Users/despiegk/code/github/incubaid/herolib/lib/hero/db/core_methods.v + ```v module db -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.data.encoder pub fn (mut self DB) set[T](obj_ T) !u32 { - // Get the next ID - mut obj := obj_ - if obj.id == 0 { - obj.id = self.new_id()! - } - mut t := ourtime.now().unix() - if obj.created_at == 0 { - obj.created_at = t - } - obj.updated_at = t + // Get the next ID + mut obj := obj_ + if obj.id == 0 { + obj.id = self.new_id()! + } + mut t := ourtime.now().unix() + if obj.created_at == 0 { + obj.created_at = t + } + obj.updated_at = t - // id u32 - // name string - // description string - // created_at i64 - // updated_at i64 - // securitypolicy u32 - // tags u32 // when we set/get we always do as []string but this can then be sorted and md5ed this gies the unique id of tags - // comments []u32 - mut e := encoder.new() - e.add_u8(1) - e.add_u32(obj.id) - e.add_string(obj.name) - e.add_string(obj.description) - e.add_i64(obj.created_at) - e.add_i64(obj.updated_at) - e.add_u32(obj.securitypolicy) - e.add_u32(obj.tags) - e.add_u16(u16(obj.comments.len)) - for comment in obj.comments { - e.add_u32(comment) - } - // println('set: before dump, e.data.len: ${e.data.len}') - obj.dump(mut e)! - // println('set: after dump, e.data.len: ${e.data.len}') - self.redis.hset(self.db_name[T](), obj.id.str(), e.data.bytestr())! - return obj.id + // id u32 + // name string + // description string + // created_at i64 + // updated_at i64 + // securitypolicy u32 + // tags u32 // when we set/get we always do as []string but this can then be sorted and md5ed this gies the unique id of tags + // comments []u32 + mut e := encoder.new() + e.add_u8(1) + e.add_u32(obj.id) + e.add_string(obj.name) + e.add_string(obj.description) + e.add_i64(obj.created_at) + e.add_i64(obj.updated_at) + e.add_u32(obj.securitypolicy) + e.add_u32(obj.tags) + e.add_u16(u16(obj.comments.len)) + for comment in obj.comments { + e.add_u32(comment) + } + // println('set: before dump, e.data.len: ${e.data.len}') + obj.dump(mut e)! + // println('set: after dump, e.data.len: ${e.data.len}') + self.redis.hset(self.db_name[T](), obj.id.str(), e.data.bytestr())! + return obj.id } // return the data, cannot return the object as we do not know the type pub fn (mut self DB) get_data[T](id u32) !(T, []u8) { - data := self.redis.hget(self.db_name[T](), id.str())! + data := self.redis.hget(self.db_name[T](), id.str())! - if data.len == 0 { - return error('herodb:${self.db_name[T]()} not found for ${id}') - } + if data.len == 0 { + return error('herodb:${self.db_name[T]()} not found for ${id}') + } - // println('get_data: data.len: ${data.len}') - mut e := encoder.decoder_new(data.bytes()) - version := e.get_u8()! - if version != 1 { - panic('wrong version in base load') - } - mut base := T{} - base.id = e.get_u32()! - base.name = e.get_string()! - base.description = e.get_string()! - base.created_at = e.get_i64()! - base.updated_at = e.get_i64()! - base.securitypolicy = e.get_u32()! - base.tags = e.get_u32()! - for _ in 0 .. e.get_u16()! { - base.comments << e.get_u32()! - } - return base, e.data + // println('get_data: data.len: ${data.len}') + mut e := encoder.decoder_new(data.bytes()) + version := e.get_u8()! + if version != 1 { + panic('wrong version in base load') + } + mut base := T{} + base.id = e.get_u32()! + base.name = e.get_string()! + base.description = e.get_string()! + base.created_at = e.get_i64()! + base.updated_at = e.get_i64()! + base.securitypolicy = e.get_u32()! + base.tags = e.get_u32()! + for _ in 0 .. e.get_u16()! { + base.comments << e.get_u32()! + } + return base, e.data } pub fn (mut self DB) exists[T](id u32) !bool { - return self.redis.hexists(self.db_name[T](), id.str())! + return self.redis.hexists(self.db_name[T](), id.str())! } pub fn (mut self DB) delete[T](id u32) ! { - self.redis.hdel(self.db_name[T](), id.str())! + self.redis.hdel(self.db_name[T](), id.str())! } pub fn (mut self DB) list[T]() ![]u32 { - ids := self.redis.hkeys(self.db_name[T]())! - return ids.map(it.u32()) + ids := self.redis.hkeys(self.db_name[T]())! + return ids.map(it.u32()) } // make it easy to get a base object pub fn (mut self DB) new_from_base[T](args BaseArgs) !Base { - return T{ - Base: new_base(args)! - } + return T{ + Base: new_base(args)! + } } fn (mut self DB) db_name[T]() string { - // get the name of the type T - mut name := T.name.to_lower_ascii().split('.').last() - // println("db_name rediskey: '${name}'") - return 'db:${name}' + // get the name of the type T + mut name := T.name.to_lower_ascii().split('.').last() + // println("db_name rediskey: '${name}'") + return 'db:${name}' } pub fn (mut self DB) new_id() !u32 { - return u32(self.redis.incr('db:id')!) + return u32(self.redis.incr('db:id')!) } ``` File: /Users/despiegk/code/github/incubaid/herolib/lib/hero/db/ai_instructions_hero_models.md + ```md # HeroDB Model Creation Instructions for AI @@ -944,14 +950,14 @@ Define your model struct with the following pattern: ```v @[heap] pub struct Calendar { - db.Base // Inherit from Base struct + db.Base // Inherit from Base struct pub mut: - // Add your specific fields here - title string - start_time i64 - end_time i64 - location string - attendees []string + // Add your specific fields here + title string + start_time i64 + end_time i64 + location string + attendees []string } ``` @@ -961,7 +967,7 @@ Implement a method to return the model's type name: ```v pub fn (self Calendar) type_name() string { - return 'calendar' + return 'calendar' } ``` @@ -971,11 +977,11 @@ Implement the `dump` method to serialize your struct's fields using the encoder: ```v pub fn (self Calendar) dump(mut e &encoder.Encoder) ! { - e.add_string(self.title) - e.add_i64(self.start_time) - e.add_i64(self.end_time) - e.add_string(self.location) - e.add_list_string(self.attendees) + e.add_string(self.title) + e.add_i64(self.start_time) + e.add_i64(self.end_time) + e.add_string(self.location) + e.add_list_string(self.attendees) } ``` @@ -985,11 +991,11 @@ Implement the `load` method to deserialize your struct's fields: ```v fn (mut self DBCalendar) load(mut o Calendar, mut e &encoder.Decoder) ! { - o.title = e.get_string()! - o.start_time = e.get_i64()! - o.end_time = e.get_i64()! - o.location = e.get_string()! - o.attendees = e.get_list_string()! + o.title = e.get_string()! + o.start_time = e.get_i64()! + o.end_time = e.get_i64()! + o.location = e.get_string()! + o.attendees = e.get_list_string()! } ``` @@ -1001,11 +1007,11 @@ Define a struct for creating new instances of your model: @[params] pub struct CalendarArg { pub mut: - title string @[required] - start_time i64 - end_time i64 - location string - attendees []string + title string @[required] + start_time i64 + end_time i64 + location string + attendees []string } ``` @@ -1016,7 +1022,7 @@ Create a database wrapper struct for your model: ```v pub struct DBCalendar { pub mut: - db &db.DB @[skip; str: skip] + db &db.DB @[skip; str: skip] } ``` @@ -1027,8 +1033,8 @@ Add your model to the ModelsFactory struct in `factory.v`: ```v pub struct ModelsFactory { pub mut: - comments DBCalendar - // ... other models + comments DBCalendar + // ... other models } ``` @@ -1036,13 +1042,13 @@ And initialize it in the `new()` function: ```v pub fn new() !ModelsFactory { - mut mydb := db.new()! - return ModelsFactory{ - comments: DBCalendar{ - db: &mydb - } - // ... initialize other models - } + mut mydb := db.new()! + return ModelsFactory{ + comments: DBCalendar{ + db: &mydb + } + // ... initialize other models + } } ``` @@ -1051,6 +1057,7 @@ pub fn new() !ModelsFactory { Use these methods for serialization/deserialization: ### Encoder (Serialization) + - `e.add_bool(val bool)` - `e.add_u8(val u8)` - `e.add_u16(val u16)` @@ -1077,6 +1084,7 @@ Use these methods for serialization/deserialization: - `e.add_list_string(val []string)` ### Decoder (Deserialization) + - `e.get_bool()!` - `e.get_u8()!` - `e.get_u16()!` @@ -1105,55 +1113,61 @@ Use these methods for serialization/deserialization: ## CRUD Methods Implementation ### Create New Instance + ```v pub fn (mut self DBCalendar) new(args CalendarArg) !Calendar { - mut o := Calendar{ - title: args.title - start_time: args.start_time - end_time: args.end_time - location: args.location - attendees: args.attendees - updated_at: ourtime.now().unix() - } - return o + mut o := Calendar{ + title: args.title + start_time: args.start_time + end_time: args.end_time + location: args.location + attendees: args.attendees + updated_at: ourtime.now().unix() + } + return o } ``` ### Save to Database + ```v pub fn (mut self DBCalendar) set(o Calendar) !u32 { - return self.db.set[Calendar](o)! + return self.db.set[Calendar](o)! } ``` ### Retrieve from Database + ```v pub fn (mut self DBCalendar) get(id u32) !Calendar { - mut o, data := self.db.get_data[Calendar](id)! - mut e_decoder := encoder.decoder_new(data) - self.load(mut o, mut e_decoder)! - return o + mut o, data := self.db.get_data[Calendar](id)! + mut e_decoder := encoder.decoder_new(data) + self.load(mut o, mut e_decoder)! + return o } ``` ### Delete from Database + ```v pub fn (mut self DBCalendar) delete(id u32) ! { - self.db.delete[Calendar](id)! + self.db.delete[Calendar](id)! } ``` ### Check Existence + ```v pub fn (mut self DBCalendar) exist(id u32) !bool { - return self.db.exists[Calendar](id)! + return self.db.exists[Calendar](id)! } ``` ### List All Objects + ```v pub fn (mut self DBCalendar) list() ![]Calendar { - return self.db.list[Calendar]()!.map(self.get(it)!) + return self.db.list[Calendar]()!.map(self.get(it)!) } ``` @@ -1164,18 +1178,18 @@ Create a `.vsh` script in `examples/hero/heromodels/` to demonstrate usage: ```v #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.core.redisclient -import freeflowuniverse.herolib.hero.heromodels +import incubaid.herolib.core.redisclient +import incubaid.herolib.hero.heromodels mut mydb := heromodels.new()! // Create a new object mut o := mydb.calendar.new( - title: 'Meeting' - start_time: 1672531200 - end_time: 1672534800 - location: 'Conference Room' - attendees: ['john@example.com', 'jane@example.com'] + title: 'Meeting' + start_time: 1672531200 + end_time: 1672534800 + location: 'Conference Room' + attendees: ['john@example.com', 'jane@example.com'] )! // Save to database @@ -1214,14 +1228,15 @@ println('All objects: ${objects}') 8. Implement CRUD methods 9. Create example usage script 10. Test the implementation with the example script + ``` File: /Users/despiegk/code/github/incubaid/herolib/examples/hero/herofs/herofs_advanced.vsh ```vsh #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.core.redisclient -import freeflowuniverse.herolib.hero.herofs +import incubaid.herolib.core.redisclient +import incubaid.herolib.hero.herofs import time import os @@ -1234,1916 +1249,1924 @@ import os // - Searching and filtering fn main() { - // Initialize the HeroFS factory - mut fs_factory := herofs.new()! - println('HeroFS factory initialized') + // Initialize the HeroFS factory + mut fs_factory := herofs.new()! + println('HeroFS factory initialized') - // Create a new filesystem - mut my_fs := fs_factory.fs.new( - name: 'project_workspace' - description: 'Project development workspace' - quota_bytes: 5 * 1024 * 1024 * 1024 // 5GB quota - )! + // Create a new filesystem + mut my_fs := fs_factory.fs.new( + name: 'project_workspace' + description: 'Project development workspace' + quota_bytes: 5 * 1024 * 1024 * 1024 // 5GB quota + )! - // Save the filesystem to get an ID - fs_id := fs_factory.fs.set(my_fs)! - println('Created filesystem: ${my_fs.name} with ID: ${fs_id}') + // Save the filesystem to get an ID + fs_id := fs_factory.fs.set(my_fs)! + println('Created filesystem: ${my_fs.name} with ID: ${fs_id}') - // Create root directory - mut root_dir := fs_factory.fs_dir.new( - name: 'root' - fs_id: fs_id - parent_id: 0 // Root has no parent - description: 'Root directory' - )! + // Create root directory + mut root_dir := fs_factory.fs_dir.new( + name: 'root' + fs_id: fs_id + parent_id: 0 // Root has no parent + description: 'Root directory' + )! - // Save the root directory - root_dir_id := fs_factory.fs_dir.set(root_dir)! - println('Created root directory with ID: ${root_dir_id}') + // Save the root directory + root_dir_id := fs_factory.fs_dir.set(root_dir)! + println('Created root directory with ID: ${root_dir_id}') - // Update the filesystem with the root directory ID - my_fs.root_dir_id = root_dir_id - fs_factory.fs.set(my_fs)! + // Update the filesystem with the root directory ID + my_fs.root_dir_id = root_dir_id + fs_factory.fs.set(my_fs)! - // Create a directory hierarchy - println('\nCreating directory hierarchy...') + // Create a directory hierarchy + println('\nCreating directory hierarchy...') - // Main project directories - mut src_dir := fs_factory.fs_dir.new( - name: 'src' - fs_id: fs_id - parent_id: root_dir_id - description: 'Source code' - )! - src_dir_id := fs_factory.fs_dir.set(src_dir)! + // Main project directories + mut src_dir := fs_factory.fs_dir.new( + name: 'src' + fs_id: fs_id + parent_id: root_dir_id + description: 'Source code' + )! + src_dir_id := fs_factory.fs_dir.set(src_dir)! - mut docs_dir := fs_factory.fs_dir.new( - name: 'docs' - fs_id: fs_id - parent_id: root_dir_id - description: 'Documentation' - )! - docs_dir_id := fs_factory.fs_dir.set(docs_dir)! + mut docs_dir := fs_factory.fs_dir.new( + name: 'docs' + fs_id: fs_id + parent_id: root_dir_id + description: 'Documentation' + )! + docs_dir_id := fs_factory.fs_dir.set(docs_dir)! - mut assets_dir := fs_factory.fs_dir.new( - name: 'assets' - fs_id: fs_id - parent_id: root_dir_id - description: 'Project assets' - )! - assets_dir_id := fs_factory.fs_dir.set(assets_dir)! + mut assets_dir := fs_factory.fs_dir.new( + name: 'assets' + fs_id: fs_id + parent_id: root_dir_id + description: 'Project assets' + )! + assets_dir_id := fs_factory.fs_dir.set(assets_dir)! - // Subdirectories - mut images_dir := fs_factory.fs_dir.new( - name: 'images' - fs_id: fs_id - parent_id: assets_dir_id - description: 'Image assets' - )! - images_dir_id := fs_factory.fs_dir.set(images_dir)! + // Subdirectories + mut images_dir := fs_factory.fs_dir.new( + name: 'images' + fs_id: fs_id + parent_id: assets_dir_id + description: 'Image assets' + )! + images_dir_id := fs_factory.fs_dir.set(images_dir)! - mut api_docs_dir := fs_factory.fs_dir.new( - name: 'api' - fs_id: fs_id - parent_id: docs_dir_id - description: 'API documentation' - )! - api_docs_dir_id := fs_factory.fs_dir.set(api_docs_dir)! + mut api_docs_dir := fs_factory.fs_dir.new( + name: 'api' + fs_id: fs_id + parent_id: docs_dir_id + description: 'API documentation' + )! + api_docs_dir_id := fs_factory.fs_dir.set(api_docs_dir)! - println('Directory hierarchy created successfully') + println('Directory hierarchy created successfully') - // Create some files with different content types - println('\nCreating various files...') + // Create some files with different content types + println('\nCreating various files...') - // Text file for source code - code_content := 'fn main() {\n println("Hello, HeroFS!")\n}\n'.bytes() - mut code_blob := fs_factory.fs_blob.new( - data: code_content - mime_type: 'text/plain' - name: 'main.v blob' - )! - code_blob_id := fs_factory.fs_blob.set(code_blob)! + // Text file for source code + code_content := 'fn main() {\n println("Hello, HeroFS!")\n}\n'.bytes() + mut code_blob := fs_factory.fs_blob.new( + data: code_content + mime_type: 'text/plain' + name: 'main.v blob' + )! + code_blob_id := fs_factory.fs_blob.set(code_blob)! - mut code_file := fs_factory.fs_file.new( - name: 'main.v' - fs_id: fs_id - directories: [src_dir_id] - blobs: [code_blob_id] - mime_type: 'text/plain' - metadata: { - 'language': 'vlang' - 'version': '0.3.3' - } - )! - code_file_id := fs_factory.fs_file.set(code_file)! + mut code_file := fs_factory.fs_file.new( + name: 'main.v' + fs_id: fs_id + directories: [src_dir_id] + blobs: [code_blob_id] + mime_type: 'text/plain' + metadata: { + 'language': 'vlang' + 'version': '0.3.3' + } + )! + code_file_id := fs_factory.fs_file.set(code_file)! - // Markdown documentation file - docs_content := '# API Documentation\n\n## Endpoints\n\n- GET /api/v1/users\n- POST /api/v1/users\n'.bytes() - mut docs_blob := fs_factory.fs_blob.new( - data: docs_content - mime_type: 'text/markdown' - name: 'api.md blob' - )! - docs_blob_id := fs_factory.fs_blob.set(docs_blob)! + // Markdown documentation file + docs_content := '# API Documentation\n\n## Endpoints\n\n- GET /api/v1/users\n- POST /api/v1/users\n'.bytes() + mut docs_blob := fs_factory.fs_blob.new( + data: docs_content + mime_type: 'text/markdown' + name: 'api.md blob' + )! + docs_blob_id := fs_factory.fs_blob.set(docs_blob)! - mut docs_file := fs_factory.fs_file.new( - name: 'api.md' - fs_id: fs_id - directories: [api_docs_dir_id] - blobs: [docs_blob_id] - mime_type: 'text/markdown' - )! - docs_file_id := fs_factory.fs_file.set(docs_file)! + mut docs_file := fs_factory.fs_file.new( + name: 'api.md' + fs_id: fs_id + directories: [api_docs_dir_id] + blobs: [docs_blob_id] + mime_type: 'text/markdown' + )! + docs_file_id := fs_factory.fs_file.set(docs_file)! - // Create a binary file (sample image) - // For this example, we'll just create random bytes - mut image_data := []u8{len: 1024, init: u8(index % 256)} - mut image_blob := fs_factory.fs_blob.new( - data: image_data - mime_type: 'image/png' - name: 'logo.png blob' - )! - image_blob_id := fs_factory.fs_blob.set(image_blob)! + // Create a binary file (sample image) + // For this example, we'll just create random bytes + mut image_data := []u8{len: 1024, init: u8(index % 256)} + mut image_blob := fs_factory.fs_blob.new( + data: image_data + mime_type: 'image/png' + name: 'logo.png blob' + )! + image_blob_id := fs_factory.fs_blob.set(image_blob)! - mut image_file := fs_factory.fs_file.new( - name: 'logo.png' - fs_id: fs_id - directories: [images_dir_id] - blobs: [image_blob_id] - mime_type: 'image/png' - metadata: { - 'width': '200' - 'height': '100' - 'format': 'PNG' - } - )! - image_file_id := fs_factory.fs_file.set(image_file)! + mut image_file := fs_factory.fs_file.new( + name: 'logo.png' + fs_id: fs_id + directories: [images_dir_id] + blobs: [image_blob_id] + mime_type: 'image/png' + metadata: { + 'width': '200' + 'height': '100' + 'format': 'PNG' + } + )! + image_file_id := fs_factory.fs_file.set(image_file)! - println('Files created successfully') + println('Files created successfully') - // Create symlinks - println('\nCreating symlinks...') + // Create symlinks + println('\nCreating symlinks...') - // Symlink to the API docs from the root directory - mut api_symlink := fs_factory.fs_symlink.new( - name: 'api-docs' - fs_id: fs_id - parent_id: root_dir_id - target_id: api_docs_dir_id - target_type: .directory - description: 'Shortcut to API documentation' - )! - api_symlink_id := fs_factory.fs_symlink.set(api_symlink)! + // Symlink to the API docs from the root directory + mut api_symlink := fs_factory.fs_symlink.new( + name: 'api-docs' + fs_id: fs_id + parent_id: root_dir_id + target_id: api_docs_dir_id + target_type: .directory + description: 'Shortcut to API documentation' + )! + api_symlink_id := fs_factory.fs_symlink.set(api_symlink)! - // Symlink to the logo from the docs directory - mut logo_symlink := fs_factory.fs_symlink.new( - name: 'logo.png' - fs_id: fs_id - parent_id: docs_dir_id - target_id: image_file_id - target_type: .file - description: 'Shortcut to project logo' - )! - logo_symlink_id := fs_factory.fs_symlink.set(logo_symlink)! + // Symlink to the logo from the docs directory + mut logo_symlink := fs_factory.fs_symlink.new( + name: 'logo.png' + fs_id: fs_id + parent_id: docs_dir_id + target_id: image_file_id + target_type: .file + description: 'Shortcut to project logo' + )! + logo_symlink_id := fs_factory.fs_symlink.set(logo_symlink)! - println('Symlinks created successfully') + println('Symlinks created successfully') - // Demonstrate file operations - println('\nDemonstrating file operations...') + // Demonstrate file operations + println('\nDemonstrating file operations...') - // 1. Move a file to multiple directories (hard link-like behavior) - println('Moving logo.png to both images and docs directories...') - image_file = fs_factory.fs_file.get(image_file_id)! - fs_factory.fs_file.move(image_file_id, [images_dir_id, docs_dir_id])! - image_file = fs_factory.fs_file.get(image_file_id)! + // 1. Move a file to multiple directories (hard link-like behavior) + println('Moving logo.png to both images and docs directories...') + image_file = fs_factory.fs_file.get(image_file_id)! + fs_factory.fs_file.move(image_file_id, [images_dir_id, docs_dir_id])! + image_file = fs_factory.fs_file.get(image_file_id)! - // 2. Rename a file - println('Renaming main.v to app.v...') - fs_factory.fs_file.rename(code_file_id, 'app.v')! - code_file = fs_factory.fs_file.get(code_file_id)! + // 2. Rename a file + println('Renaming main.v to app.v...') + fs_factory.fs_file.rename(code_file_id, 'app.v')! + code_file = fs_factory.fs_file.get(code_file_id)! - // 3. Update file metadata - println('Updating file metadata...') - fs_factory.fs_file.update_metadata(docs_file_id, 'status', 'draft')! - fs_factory.fs_file.update_metadata(docs_file_id, 'author', 'HeroFS Team')! + // 3. Update file metadata + println('Updating file metadata...') + fs_factory.fs_file.update_metadata(docs_file_id, 'status', 'draft')! + fs_factory.fs_file.update_metadata(docs_file_id, 'author', 'HeroFS Team')! - // 4. Update file access time when "reading" it - println('Updating file access time...') - fs_factory.fs_file.update_accessed(docs_file_id)! + // 4. Update file access time when "reading" it + println('Updating file access time...') + fs_factory.fs_file.update_accessed(docs_file_id)! - // 5. Add additional content to a file (append a blob) - println('Appending content to API docs...') - additional_content := '\n## Authentication\n\nUse Bearer token for authentication.\n'.bytes() - mut additional_blob := fs_factory.fs_blob.new( - data: additional_content - mime_type: 'text/markdown' - name: 'api_append.md blob' - )! - additional_blob_id := fs_factory.fs_blob.set(additional_blob)! - fs_factory.fs_file.append_blob(docs_file_id, additional_blob_id)! + // 5. Add additional content to a file (append a blob) + println('Appending content to API docs...') + additional_content := '\n## Authentication\n\nUse Bearer token for authentication.\n'.bytes() + mut additional_blob := fs_factory.fs_blob.new( + data: additional_content + mime_type: 'text/markdown' + name: 'api_append.md blob' + )! + additional_blob_id := fs_factory.fs_blob.set(additional_blob)! + fs_factory.fs_file.append_blob(docs_file_id, additional_blob_id)! - // Demonstrate directory operations - println('\nDemonstrating directory operations...') + // Demonstrate directory operations + println('\nDemonstrating directory operations...') - // 1. Create a new directory and move it - mut temp_dir := fs_factory.fs_dir.new( - name: 'temp' - fs_id: fs_id - parent_id: root_dir_id - description: 'Temporary directory' - )! - temp_dir_id := fs_factory.fs_dir.set(temp_dir)! + // 1. Create a new directory and move it + mut temp_dir := fs_factory.fs_dir.new( + name: 'temp' + fs_id: fs_id + parent_id: root_dir_id + description: 'Temporary directory' + )! + temp_dir_id := fs_factory.fs_dir.set(temp_dir)! - println('Moving temp directory to be under docs...') - fs_factory.fs_dir.move(temp_dir_id, docs_dir_id)! + println('Moving temp directory to be under docs...') + fs_factory.fs_dir.move(temp_dir_id, docs_dir_id)! - // 2. Rename a directory - println('Renaming temp directory to drafts...') - fs_factory.fs_dir.rename(temp_dir_id, 'drafts')! + // 2. Rename a directory + println('Renaming temp directory to drafts...') + fs_factory.fs_dir.rename(temp_dir_id, 'drafts')! - // 3. Check if a directory has children - has_children := fs_factory.fs_dir.has_children(docs_dir_id)! - println('Does docs directory have children? ${has_children}') + // 3. Check if a directory has children + has_children := fs_factory.fs_dir.has_children(docs_dir_id)! + println('Does docs directory have children? ${has_children}') - // Demonstrate searching and filtering - println('\nDemonstrating searching and filtering...') + // Demonstrate searching and filtering + println('\nDemonstrating searching and filtering...') - // 1. List all files in the filesystem - all_files := fs_factory.fs_file.list_by_filesystem(fs_id)! - println('All files in filesystem (${all_files.len}):') - for file in all_files { - println('- ${file.name} (ID: ${file.id})') - } + // 1. List all files in the filesystem + all_files := fs_factory.fs_file.list_by_filesystem(fs_id)! + println('All files in filesystem (${all_files.len}):') + for file in all_files { + println('- ${file.name} (ID: ${file.id})') + } - // 2. List files by MIME type - markdown_files := fs_factory.fs_file.list_by_mime_type('text/markdown')! - println('\nMarkdown files (${markdown_files.len}):') - for file in markdown_files { - println('- ${file.name} (ID: ${file.id})') - } + // 2. List files by MIME type + markdown_files := fs_factory.fs_file.list_by_mime_type('text/markdown')! + println('\nMarkdown files (${markdown_files.len}):') + for file in markdown_files { + println('- ${file.name} (ID: ${file.id})') + } - // 3. List all symlinks - all_symlinks := fs_factory.fs_symlink.list_by_filesystem(fs_id)! - println('\nAll symlinks (${all_symlinks.len}):') - for symlink in all_symlinks { - target_type_str := if symlink.target_type == .file { 'file' } else { 'directory' } - println('- ${symlink.name} -> ${symlink.target_id} (${target_type_str})') - } + // 3. List all symlinks + all_symlinks := fs_factory.fs_symlink.list_by_filesystem(fs_id)! + println('\nAll symlinks (${all_symlinks.len}):') + for symlink in all_symlinks { + target_type_str := if symlink.target_type == .file { 'file' } else { 'directory' } + println('- ${symlink.name} -> ${symlink.target_id} (${target_type_str})') + } - // 4. Check for broken symlinks - println('\nChecking for broken symlinks:') - for symlink in all_symlinks { - is_broken := fs_factory.fs_symlink.is_broken(symlink.id)! - println('- ${symlink.name}: ${if is_broken { 'BROKEN' } else { 'OK' }}') - } + // 4. Check for broken symlinks + println('\nChecking for broken symlinks:') + for symlink in all_symlinks { + is_broken := fs_factory.fs_symlink.is_broken(symlink.id)! + println('- ${symlink.name}: ${if is_broken { 'BROKEN' } else { 'OK' }}') + } - // Demonstrate file content retrieval - println('\nDemonstrating file content retrieval:') + // Demonstrate file content retrieval + println('\nDemonstrating file content retrieval:') - // Get the updated API docs file and print its content - docs_file = fs_factory.fs_file.get(docs_file_id)! - println('Content of ${docs_file.name}:') - mut full_content := '' + // Get the updated API docs file and print its content + docs_file = fs_factory.fs_file.get(docs_file_id)! + println('Content of ${docs_file.name}:') + mut full_content := '' - for blob_id in docs_file.blobs { - blob := fs_factory.fs_blob.get(blob_id)! - full_content += blob.data.bytestr() - } + for blob_id in docs_file.blobs { + blob := fs_factory.fs_blob.get(blob_id)! + full_content += blob.data.bytestr() + } - println('---BEGIN CONTENT---') - println(full_content) - println('---END CONTENT---') + println('---BEGIN CONTENT---') + println(full_content) + println('---END CONTENT---') - // Print filesystem usage - println('\nFilesystem usage:') - my_fs = fs_factory.fs.get(fs_id)! - println('Used: ${my_fs.used_bytes} bytes') - println('Quota: ${my_fs.quota_bytes} bytes') - println('Available: ${my_fs.quota_bytes - my_fs.used_bytes} bytes') + // Print filesystem usage + println('\nFilesystem usage:') + my_fs = fs_factory.fs.get(fs_id)! + println('Used: ${my_fs.used_bytes} bytes') + println('Quota: ${my_fs.quota_bytes} bytes') + println('Available: ${my_fs.quota_bytes - my_fs.used_bytes} bytes') - println('\nHeroFS advanced example completed successfully!') + println('\nHeroFS advanced example completed successfully!') } ``` File: /Users/despiegk/code/github/incubaid/herolib/examples/hero/herofs/herofs_basic.vsh + ```vsh #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.core.redisclient -import freeflowuniverse.herolib.hero.herofs +import incubaid.herolib.core.redisclient +import incubaid.herolib.hero.herofs // Basic example of using HeroFS - the Hero Filesystem // Demonstrates creating a filesystem, directories, and files fn main() { - // Initialize the HeroFS factory - mut fs_factory := herofs.new()! - println('HeroFS factory initialized') + // Initialize the HeroFS factory + mut fs_factory := herofs.new()! + println('HeroFS factory initialized') - // Create a new filesystem - mut my_fs := fs_factory.fs.new( - name: 'my_documents' - description: 'Personal documents filesystem' - quota_bytes: 1024 * 1024 * 1024 // 1GB quota - )! + // Create a new filesystem + mut my_fs := fs_factory.fs.new( + name: 'my_documents' + description: 'Personal documents filesystem' + quota_bytes: 1024 * 1024 * 1024 // 1GB quota + )! - // Save the filesystem to get an ID - fs_id := fs_factory.fs.set(my_fs)! - println('Created filesystem: ${my_fs.name} with ID: ${fs_id}') + // Save the filesystem to get an ID + fs_id := fs_factory.fs.set(my_fs)! + println('Created filesystem: ${my_fs.name} with ID: ${fs_id}') - // Create root directory - mut root_dir := fs_factory.fs_dir.new( - name: 'root' - fs_id: fs_id - parent_id: 0 // Root has no parent - description: 'Root directory' - )! + // Create root directory + mut root_dir := fs_factory.fs_dir.new( + name: 'root' + fs_id: fs_id + parent_id: 0 // Root has no parent + description: 'Root directory' + )! - // Save the root directory - root_dir_id := fs_factory.fs_dir.set(root_dir)! - println('Created root directory with ID: ${root_dir_id}') + // Save the root directory + root_dir_id := fs_factory.fs_dir.set(root_dir)! + println('Created root directory with ID: ${root_dir_id}') - // Update the filesystem with the root directory ID - my_fs.root_dir_id = root_dir_id - fs_factory.fs.set(my_fs)! + // Update the filesystem with the root directory ID + my_fs.root_dir_id = root_dir_id + fs_factory.fs.set(my_fs)! - // Create some subdirectories - mut docs_dir := fs_factory.fs_dir.new( - name: 'documents' - fs_id: fs_id - parent_id: root_dir_id - description: 'Documents directory' - )! + // Create some subdirectories + mut docs_dir := fs_factory.fs_dir.new( + name: 'documents' + fs_id: fs_id + parent_id: root_dir_id + description: 'Documents directory' + )! - mut pics_dir := fs_factory.fs_dir.new( - name: 'pictures' - fs_id: fs_id - parent_id: root_dir_id - description: 'Pictures directory' - )! + mut pics_dir := fs_factory.fs_dir.new( + name: 'pictures' + fs_id: fs_id + parent_id: root_dir_id + description: 'Pictures directory' + )! - // Save the subdirectories - docs_dir_id := fs_factory.fs_dir.set(docs_dir)! - pics_dir_id := fs_factory.fs_dir.set(pics_dir)! - println('Created documents directory with ID: ${docs_dir_id}') - println('Created pictures directory with ID: ${pics_dir_id}') + // Save the subdirectories + docs_dir_id := fs_factory.fs_dir.set(docs_dir)! + pics_dir_id := fs_factory.fs_dir.set(pics_dir)! + println('Created documents directory with ID: ${docs_dir_id}') + println('Created pictures directory with ID: ${pics_dir_id}') - // Create a text file blob - text_content := 'Hello, world! This is a test file in HeroFS.'.bytes() - mut text_blob := fs_factory.fs_blob.new( - data: text_content - mime_type: 'text/plain' - name: 'hello.txt blob' - )! + // Create a text file blob + text_content := 'Hello, world! This is a test file in HeroFS.'.bytes() + mut text_blob := fs_factory.fs_blob.new( + data: text_content + mime_type: 'text/plain' + name: 'hello.txt blob' + )! - // Save the blob - blob_id := fs_factory.fs_blob.set(text_blob)! - println('Created text blob with ID: ${blob_id}') + // Save the blob + blob_id := fs_factory.fs_blob.set(text_blob)! + println('Created text blob with ID: ${blob_id}') - // Create a file referencing the blob - mut text_file := fs_factory.fs_file.new( - name: 'hello.txt' - fs_id: fs_id - directories: [docs_dir_id] - blobs: [blob_id] - mime_type: 'text/plain' - )! + // Create a file referencing the blob + mut text_file := fs_factory.fs_file.new( + name: 'hello.txt' + fs_id: fs_id + directories: [docs_dir_id] + blobs: [blob_id] + mime_type: 'text/plain' + )! - // Save the file - file_id := fs_factory.fs_file.set(text_file)! - println('Created text file with ID: ${file_id}') + // Save the file + file_id := fs_factory.fs_file.set(text_file)! + println('Created text file with ID: ${file_id}') - // List all directories in the filesystem - dirs := fs_factory.fs_dir.list_by_filesystem(fs_id)! - println('\nAll directories in filesystem:') - for dir in dirs { - println('- ${dir.name} (ID: ${dir.id})') - } + // List all directories in the filesystem + dirs := fs_factory.fs_dir.list_by_filesystem(fs_id)! + println('\nAll directories in filesystem:') + for dir in dirs { + println('- ${dir.name} (ID: ${dir.id})') + } - // List all files in the documents directory - files := fs_factory.fs_file.list_by_directory(docs_dir_id)! - println('\nFiles in documents directory:') - for file in files { - println('- ${file.name} (ID: ${file.id}, Size: ${file.size_bytes} bytes)') + // List all files in the documents directory + files := fs_factory.fs_file.list_by_directory(docs_dir_id)! + println('\nFiles in documents directory:') + for file in files { + println('- ${file.name} (ID: ${file.id}, Size: ${file.size_bytes} bytes)') - // Get the file's content from its blobs - if file.blobs.len > 0 { - blob := fs_factory.fs_blob.get(file.blobs[0])! - content := blob.data.bytestr() - println(' Content: "${content}"') - } - } + // Get the file's content from its blobs + if file.blobs.len > 0 { + blob := fs_factory.fs_blob.get(file.blobs[0])! + content := blob.data.bytestr() + println(' Content: "${content}"') + } + } - println('\nHeroFS basic example completed successfully!') + println('\nHeroFS basic example completed successfully!') } ``` File: /Users/despiegk/code/github/incubaid/herolib/lib/hero/herofs/factory.v + ```v module herofs -import freeflowuniverse.herolib.hero.db +import incubaid.herolib.hero.db pub struct FsFactory { pub mut: - fs DBFs - fs_blob DBFsBlob - fs_dir DBFsDir - fs_file DBFsFile - fs_symlink DBFsSymlink + fs DBFs + fs_blob DBFsBlob + fs_dir DBFsDir + fs_file DBFsFile + fs_symlink DBFsSymlink } pub fn new() !FsFactory { - mut mydb := db.new()! - return FsFactory{ - fs: DBFs{ - db: &mydb - } - fs_blob: DBFsBlob{ - db: &mydb - } - fs_dir: DBFsDir{ - db: &mydb - } - fs_file: DBFsFile{ - db: &mydb - } - fs_symlink: DBFsSymlink{ - db: &mydb - } - } + mut mydb := db.new()! + return FsFactory{ + fs: DBFs{ + db: &mydb + } + fs_blob: DBFsBlob{ + db: &mydb + } + fs_dir: DBFsDir{ + db: &mydb + } + fs_file: DBFsFile{ + db: &mydb + } + fs_symlink: DBFsSymlink{ + db: &mydb + } + } } ``` File: /Users/despiegk/code/github/incubaid/herolib/lib/hero/herofs/fs_blob.v + ```v module herofs import time import crypto.blake3 -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.hero.db +import incubaid.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.hero.db // FsBlob represents binary data up to 1MB @[heap] pub struct FsBlob { - db.Base + db.Base pub mut: - hash string // blake192 hash of content - data []u8 // Binary data (max 1MB) - size_bytes int // Size in bytes - created_at i64 - mime_type string // MIME type - encoding string // Encoding type + hash string // blake192 hash of content + data []u8 // Binary data (max 1MB) + size_bytes int // Size in bytes + created_at i64 + mime_type string // MIME type + encoding string // Encoding type } pub struct DBFsBlob { pub mut: - db &db.DB @[skip; str: skip] + db &db.DB @[skip; str: skip] } pub fn (self FsBlob) type_name() string { - return 'fs_blob' + return 'fs_blob' } pub fn (self FsBlob) dump(mut e encoder.Encoder) ! { - e.add_string(self.hash) - e.add_list_u8(self.data) - e.add_int(self.size_bytes) - e.add_i64(self.created_at) - e.add_string(self.mime_type) - e.add_string(self.encoding) + e.add_string(self.hash) + e.add_list_u8(self.data) + e.add_int(self.size_bytes) + e.add_i64(self.created_at) + e.add_string(self.mime_type) + e.add_string(self.encoding) } fn (mut self DBFsBlob) load(mut o FsBlob, mut e encoder.Decoder) ! { - o.hash = e.get_string()! - o.data = e.get_list_u8()! - o.size_bytes = e.get_int()! - o.created_at = e.get_i64()! - o.mime_type = e.get_string()! - o.encoding = e.get_string()! + o.hash = e.get_string()! + o.data = e.get_list_u8()! + o.size_bytes = e.get_int()! + o.created_at = e.get_i64()! + o.mime_type = e.get_string()! + o.encoding = e.get_string()! } @[params] pub struct FsBlobArg { pub mut: - data []u8 @[required] - mime_type string - encoding string - name string - description string - tags []string - comments []db.CommentArg + data []u8 @[required] + mime_type string + encoding string + name string + description string + tags []string + comments []db.CommentArg } pub fn (mut blob FsBlob) calculate_hash() { - hash := blake3.sum256(blob.data) - blob.hash = hash.hex()[..48] // blake192 = first 192 bits = 48 hex chars + hash := blake3.sum256(blob.data) + blob.hash = hash.hex()[..48] // blake192 = first 192 bits = 48 hex chars } // get new blob, not from the DB pub fn (mut self DBFsBlob) new(args FsBlobArg) !FsBlob { - if args.data.len > 1024 * 1024 { // 1MB limit - return error('Blob size exceeds 1MB limit') - } + if args.data.len > 1024 * 1024 { // 1MB limit + return error('Blob size exceeds 1MB limit') + } - mut o := FsBlob{ - data: args.data - size_bytes: args.data.len - created_at: ourtime.now().unix() - mime_type: args.mime_type - encoding: if args.encoding == '' { 'none' } else { args.encoding } - } + mut o := FsBlob{ + data: args.data + size_bytes: args.data.len + created_at: ourtime.now().unix() + mime_type: args.mime_type + encoding: if args.encoding == '' { 'none' } else { args.encoding } + } - // Calculate hash - o.calculate_hash() + // Calculate hash + o.calculate_hash() - // Set base fields - o.name = args.name - o.description = args.description - o.tags = self.db.tags_get(args.tags)! - o.comments = self.db.comments_get(args.comments)! - o.updated_at = ourtime.now().unix() + // Set base fields + o.name = args.name + o.description = args.description + o.tags = self.db.tags_get(args.tags)! + o.comments = self.db.comments_get(args.comments)! + o.updated_at = ourtime.now().unix() - return o + return o } pub fn (mut self DBFsBlob) set(o FsBlob) !u32 { - // Check if a blob with this hash already exists - hash_id := self.db.redis.hget('fsblob:hashes', o.hash)! - if hash_id != '' { - // Blob already exists, return existing ID - return hash_id.u32() - } + // Check if a blob with this hash already exists + hash_id := self.db.redis.hget('fsblob:hashes', o.hash)! + if hash_id != '' { + // Blob already exists, return existing ID + return hash_id.u32() + } - // Use db set function which now returns the ID - id := self.db.set[FsBlob](o)! + // Use db set function which now returns the ID + id := self.db.set[FsBlob](o)! - // Store the hash -> id mapping for lookup - self.db.redis.hset('fsblob:hashes', o.hash, id.str())! + // Store the hash -> id mapping for lookup + self.db.redis.hset('fsblob:hashes', o.hash, id.str())! - return id + return id } pub fn (mut self DBFsBlob) delete(id u32) ! { - // Get the blob to retrieve its hash - mut blob := self.get(id)! + // Get the blob to retrieve its hash + mut blob := self.get(id)! - // Remove hash -> id mapping - self.db.redis.hdel('fsblob:hashes', blob.hash)! + // Remove hash -> id mapping + self.db.redis.hdel('fsblob:hashes', blob.hash)! - // Delete the blob - self.db.delete[FsBlob](id)! + // Delete the blob + self.db.delete[FsBlob](id)! } pub fn (mut self DBFsBlob) exist(id u32) !bool { - return self.db.exists[FsBlob](id)! + return self.db.exists[FsBlob](id)! } pub fn (mut self DBFsBlob) get(id u32) !FsBlob { - mut o, data := self.db.get_data[FsBlob](id)! - mut e_decoder := encoder.decoder_new(data) - self.load(mut o, mut e_decoder)! - return o + mut o, data := self.db.get_data[FsBlob](id)! + mut e_decoder := encoder.decoder_new(data) + self.load(mut o, mut e_decoder)! + return o } pub fn (mut self DBFsBlob) list() ![]FsBlob { - return self.db.list[FsBlob]()!.map(self.get(it)!) + return self.db.list[FsBlob]()!.map(self.get(it)!) } pub fn (mut self DBFsBlob) get_by_hash(hash string) !FsBlob { - id_str := self.db.redis.hget('fsblob:hashes', hash)! - if id_str == '' { - return error('Blob with hash "${hash}" not found') - } - return self.get(id_str.u32())! + id_str := self.db.redis.hget('fsblob:hashes', hash)! + if id_str == '' { + return error('Blob with hash "${hash}" not found') + } + return self.get(id_str.u32())! } pub fn (mut self DBFsBlob) exists_by_hash(hash string) !bool { - id_str := self.db.redis.hget('fsblob:hashes', hash)! - return id_str != '' + id_str := self.db.redis.hget('fsblob:hashes', hash)! + return id_str != '' } pub fn (blob FsBlob) verify_integrity() bool { - hash := blake3.sum256(blob.data) - return hash.hex()[..48] == blob.hash + hash := blake3.sum256(blob.data) + return hash.hex()[..48] == blob.hash } ``` File: /Users/despiegk/code/github/incubaid/herolib/lib/hero/herofs/fs_dir.v + ```v module herofs import time import crypto.blake3 import json -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.hero.db +import incubaid.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.hero.db // FsDir represents a directory in a filesystem @[heap] pub struct FsDir { - db.Base + db.Base pub mut: - name string - fs_id u32 // Associated filesystem - parent_id u32 // Parent directory ID (0 for root) + name string + fs_id u32 // Associated filesystem + parent_id u32 // Parent directory ID (0 for root) } // DirectoryContents represents the contents of a directory pub struct DirectoryContents { pub mut: - directories []FsDir - files []FsFile - symlinks []FsSymlink + directories []FsDir + files []FsFile + symlinks []FsSymlink } // ListContentsOptions defines options for listing directory contents @[params] pub struct ListContentsOptions { pub mut: - recursive bool - include_patterns []string // File/directory name patterns to include (e.g. *.py, doc*) - exclude_patterns []string // File/directory name patterns to exclude + recursive bool + include_patterns []string // File/directory name patterns to include (e.g. *.py, doc*) + exclude_patterns []string // File/directory name patterns to exclude } // we only keep the parents, not the children, as children can be found by doing a query on parent_id, we will need some smart hsets to make this fast enough and efficient pub struct DBFsDir { pub mut: - db &db.DB @[skip; str: skip] + db &db.DB @[skip; str: skip] } pub fn (self FsDir) type_name() string { - return 'fs_dir' + return 'fs_dir' } pub fn (self FsDir) dump(mut e encoder.Encoder) ! { - e.add_string(self.name) - e.add_u32(self.fs_id) - e.add_u32(self.parent_id) + e.add_string(self.name) + e.add_u32(self.fs_id) + e.add_u32(self.parent_id) } fn (mut self DBFsDir) load(mut o FsDir, mut e encoder.Decoder) ! { - o.name = e.get_string()! - o.fs_id = e.get_u32()! - o.parent_id = e.get_u32()! + o.name = e.get_string()! + o.fs_id = e.get_u32()! + o.parent_id = e.get_u32()! } @[params] pub struct FsDirArg { pub mut: - name string @[required] - description string - fs_id u32 @[required] - parent_id u32 - tags []string - comments []db.CommentArg + name string @[required] + description string + fs_id u32 @[required] + parent_id u32 + tags []string + comments []db.CommentArg } // get new directory, not from the DB pub fn (mut self DBFsDir) new(args FsDirArg) !FsDir { - mut o := FsDir{ - name: args.name - fs_id: args.fs_id - parent_id: args.parent_id - } + mut o := FsDir{ + name: args.name + fs_id: args.fs_id + parent_id: args.parent_id + } - // Set base fields - o.description = args.description - o.tags = self.db.tags_get(args.tags)! - o.comments = self.db.comments_get(args.comments)! - o.updated_at = ourtime.now().unix() + // Set base fields + o.description = args.description + o.tags = self.db.tags_get(args.tags)! + o.comments = self.db.comments_get(args.comments)! + o.updated_at = ourtime.now().unix() - return o + return o } pub fn (mut self DBFsDir) set(o FsDir) !u32 { - id := self.db.set[FsDir](o)! + id := self.db.set[FsDir](o)! - // Store directory in filesystem's directory index - path_key := '${o.fs_id}:${o.parent_id}:${o.name}' - self.db.redis.hset('fsdir:paths', path_key, id.str())! + // Store directory in filesystem's directory index + path_key := '${o.fs_id}:${o.parent_id}:${o.name}' + self.db.redis.hset('fsdir:paths', path_key, id.str())! - // Store in filesystem's directory list using hset - self.db.redis.hset('fsdir:fs:${o.fs_id}', id.str(), id.str())! + // Store in filesystem's directory list using hset + self.db.redis.hset('fsdir:fs:${o.fs_id}', id.str(), id.str())! - // Store in parent's children list using hset - if o.parent_id > 0 { - self.db.redis.hset('fsdir:children:${o.parent_id}', id.str(), id.str())! - } + // Store in parent's children list using hset + if o.parent_id > 0 { + self.db.redis.hset('fsdir:children:${o.parent_id}', id.str(), id.str())! + } - return id + return id } pub fn (mut self DBFsDir) delete(id u32) ! { - // Get the directory info before deleting - dir := self.get(id)! + // Get the directory info before deleting + dir := self.get(id)! - // Check if directory has children using hkeys - children := self.db.redis.hkeys('fsdir:children:${id}')! - if children.len > 0 { - return error('Cannot delete directory ${dir.name} (ID: ${id}) because it has ${children.len} children') - } + // Check if directory has children using hkeys + children := self.db.redis.hkeys('fsdir:children:${id}')! + if children.len > 0 { + return error('Cannot delete directory ${dir.name} (ID: ${id}) because it has ${children.len} children') + } - // Remove from path index - path_key := '${dir.fs_id}:${dir.parent_id}:${dir.name}' - self.db.redis.hdel('fsdir:paths', path_key)! + // Remove from path index + path_key := '${dir.fs_id}:${dir.parent_id}:${dir.name}' + self.db.redis.hdel('fsdir:paths', path_key)! - // Remove from filesystem's directory list using hdel - self.db.redis.hdel('fsdir:fs:${dir.fs_id}', id.str())! + // Remove from filesystem's directory list using hdel + self.db.redis.hdel('fsdir:fs:${dir.fs_id}', id.str())! - // Remove from parent's children list using hdel - if dir.parent_id > 0 { - self.db.redis.hdel('fsdir:children:${dir.parent_id}', id.str())! - } + // Remove from parent's children list using hdel + if dir.parent_id > 0 { + self.db.redis.hdel('fsdir:children:${dir.parent_id}', id.str())! + } - // Delete the directory itself - self.db.delete[FsDir](id)! + // Delete the directory itself + self.db.delete[FsDir](id)! } pub fn (mut self DBFsDir) exist(id u32) !bool { - return self.db.exists[FsDir](id)! + return self.db.exists[FsDir](id)! } pub fn (mut self DBFsDir) get(id u32) !FsDir { - mut o, data := self.db.get_data[FsDir](id)! - mut e_decoder := encoder.decoder_new(data) - self.load(mut o, mut e_decoder)! - return o + mut o, data := self.db.get_data[FsDir](id)! + mut e_decoder := encoder.decoder_new(data) + self.load(mut o, mut e_decoder)! + return o } pub fn (mut self DBFsDir) list() ![]FsDir { - return self.db.list[FsDir]()!.map(self.get(it)!) + return self.db.list[FsDir]()!.map(self.get(it)!) } // Get directory by path components pub fn (mut self DBFsDir) get_by_path(fs_id u32, parent_id u32, name string) !FsDir { - path_key := '${fs_id}:${parent_id}:${name}' - id_str := self.db.redis.hget('fsdir:paths', path_key)! - if id_str == '' { - return error('Directory "${name}" not found in filesystem ${fs_id} under parent ${parent_id}') - } - return self.get(id_str.u32())! + path_key := '${fs_id}:${parent_id}:${name}' + id_str := self.db.redis.hget('fsdir:paths', path_key)! + if id_str == '' { + return error('Directory "${name}" not found in filesystem ${fs_id} under parent ${parent_id}') + } + return self.get(id_str.u32())! } // Get all directories in a filesystem pub fn (mut self DBFsDir) list_by_filesystem(fs_id u32) ![]FsDir { - dir_ids := self.db.redis.hkeys('fsdir:fs:${fs_id}')! - mut dirs := []FsDir{} - for id_str in dir_ids { - dirs << self.get(id_str.u32())! - } - return dirs + dir_ids := self.db.redis.hkeys('fsdir:fs:${fs_id}')! + mut dirs := []FsDir{} + for id_str in dir_ids { + dirs << self.get(id_str.u32())! + } + return dirs } // Get directory by absolute path pub fn (mut self DBFsDir) get_by_absolute_path(fs_id u32, path string) !FsDir { - // Normalize path (remove trailing slashes, handle empty path) - normalized_path := if path == '' || path == '/' { '/' } else { path.trim_right('/') } - - if normalized_path == '/' { - // Special case for root directory - dirs := self.list_by_filesystem(fs_id)! - for dir in dirs { - if dir.parent_id == 0 { - return dir - } - } - return error('Root directory not found for filesystem ${fs_id}') - } - - // Split path into components - components := normalized_path.trim_left('/').split('/') - - // Start from the root directory - mut current_dir_id := u32(0) - mut dirs := self.list_by_filesystem(fs_id)! - - // Find root directory - for dir in dirs { - if dir.parent_id == 0 { - current_dir_id = dir.id - break - } - } - - if current_dir_id == 0 { - return error('Root directory not found for filesystem ${fs_id}') - } - - // Navigate through path components - for component in components { - found := false - for dir in dirs { - if dir.parent_id == current_dir_id && dir.name == component { - current_dir_id = dir.id - found = true - break - } - } - - if !found { - return error('Directory "${component}" not found in path "${normalized_path}"') - } - - // Update dirs for next iteration - dirs = self.list_children(current_dir_id)! - } - - return self.get(current_dir_id)! + // Normalize path (remove trailing slashes, handle empty path) + normalized_path := if path == '' || path == '/' { '/' } else { path.trim_right('/') } + + if normalized_path == '/' { + // Special case for root directory + dirs := self.list_by_filesystem(fs_id)! + for dir in dirs { + if dir.parent_id == 0 { + return dir + } + } + return error('Root directory not found for filesystem ${fs_id}') + } + + // Split path into components + components := normalized_path.trim_left('/').split('/') + + // Start from the root directory + mut current_dir_id := u32(0) + mut dirs := self.list_by_filesystem(fs_id)! + + // Find root directory + for dir in dirs { + if dir.parent_id == 0 { + current_dir_id = dir.id + break + } + } + + if current_dir_id == 0 { + return error('Root directory not found for filesystem ${fs_id}') + } + + // Navigate through path components + for component in components { + found := false + for dir in dirs { + if dir.parent_id == current_dir_id && dir.name == component { + current_dir_id = dir.id + found = true + break + } + } + + if !found { + return error('Directory "${component}" not found in path "${normalized_path}"') + } + + // Update dirs for next iteration + dirs = self.list_children(current_dir_id)! + } + + return self.get(current_dir_id)! } // Create a directory by absolute path, creating parent directories as needed pub fn (mut self DBFsDir) create_path(fs_id u32, path string) !u32 { - // Normalize path - normalized_path := if path == '' || path == '/' { '/' } else { path.trim_right('/') } - - if normalized_path == '/' { - // Special case for root directory - dirs := self.list_by_filesystem(fs_id)! - for dir in dirs { - if dir.parent_id == 0 { - return dir.id - } - } - - // Create root directory if it doesn't exist - mut root_dir := self.new( - name: 'root' - fs_id: fs_id - parent_id: 0 - description: 'Root directory' - )! - return self.set(root_dir)! - } - - // Split path into components - components := normalized_path.trim_left('/').split('/') - - // Start from the root directory - mut current_dir_id := u32(0) - mut dirs := self.list_by_filesystem(fs_id)! - - // Find or create root directory - for dir in dirs { - if dir.parent_id == 0 { - current_dir_id = dir.id - break - } - } - - if current_dir_id == 0 { - // Create root directory - mut root_dir := self.new( - name: 'root' - fs_id: fs_id - parent_id: 0 - description: 'Root directory' - )! - current_dir_id = self.set(root_dir)! - } - - // Navigate/create through path components - for component in components { - found := false - for dir in dirs { - if dir.parent_id == current_dir_id && dir.name == component { - current_dir_id = dir.id - found = true - break - } - } - - if !found { - // Create this directory component - mut new_dir := self.new( - name: component - fs_id: fs_id - parent_id: current_dir_id - description: 'Directory created as part of path ${normalized_path}' - )! - current_dir_id = self.set(new_dir)! - } - - // Update directory list for next iteration - dirs = self.list_children(current_dir_id)! - } - - return current_dir_id + // Normalize path + normalized_path := if path == '' || path == '/' { '/' } else { path.trim_right('/') } + + if normalized_path == '/' { + // Special case for root directory + dirs := self.list_by_filesystem(fs_id)! + for dir in dirs { + if dir.parent_id == 0 { + return dir.id + } + } + + // Create root directory if it doesn't exist + mut root_dir := self.new( + name: 'root' + fs_id: fs_id + parent_id: 0 + description: 'Root directory' + )! + return self.set(root_dir)! + } + + // Split path into components + components := normalized_path.trim_left('/').split('/') + + // Start from the root directory + mut current_dir_id := u32(0) + mut dirs := self.list_by_filesystem(fs_id)! + + // Find or create root directory + for dir in dirs { + if dir.parent_id == 0 { + current_dir_id = dir.id + break + } + } + + if current_dir_id == 0 { + // Create root directory + mut root_dir := self.new( + name: 'root' + fs_id: fs_id + parent_id: 0 + description: 'Root directory' + )! + current_dir_id = self.set(root_dir)! + } + + // Navigate/create through path components + for component in components { + found := false + for dir in dirs { + if dir.parent_id == current_dir_id && dir.name == component { + current_dir_id = dir.id + found = true + break + } + } + + if !found { + // Create this directory component + mut new_dir := self.new( + name: component + fs_id: fs_id + parent_id: current_dir_id + description: 'Directory created as part of path ${normalized_path}' + )! + current_dir_id = self.set(new_dir)! + } + + // Update directory list for next iteration + dirs = self.list_children(current_dir_id)! + } + + return current_dir_id } // Delete a directory by absolute path pub fn (mut self DBFsDir) delete_by_path(fs_id u32, path string) ! { - dir := self.get_by_absolute_path(fs_id, path)! - self.delete(dir.id)! + dir := self.get_by_absolute_path(fs_id, path)! + self.delete(dir.id)! } // Move a directory using source and destination paths pub fn (mut self DBFsDir) move_by_path(fs_id u32, source_path string, dest_path string) !u32 { - // Get the source directory - source_dir := self.get_by_absolute_path(fs_id, source_path)! - - // For the destination, we need the parent directory - dest_dir_path := dest_path.all_before_last('/') - dest_dir_name := dest_path.all_after_last('/') - - dest_parent_dir := if dest_dir_path == '' || dest_dir_path == '/' { - // Moving to the root - self.get_by_absolute_path(fs_id, '/')! - } else { - self.get_by_absolute_path(fs_id, dest_dir_path)! - } - - // First rename if the destination name is different - if source_dir.name != dest_dir_name { - self.rename(source_dir.id, dest_dir_name)! - } - - // Then move to the new parent - return self.move(source_dir.id, dest_parent_dir.id)! + // Get the source directory + source_dir := self.get_by_absolute_path(fs_id, source_path)! + + // For the destination, we need the parent directory + dest_dir_path := dest_path.all_before_last('/') + dest_dir_name := dest_path.all_after_last('/') + + dest_parent_dir := if dest_dir_path == '' || dest_dir_path == '/' { + // Moving to the root + self.get_by_absolute_path(fs_id, '/')! + } else { + self.get_by_absolute_path(fs_id, dest_dir_path)! + } + + // First rename if the destination name is different + if source_dir.name != dest_dir_name { + self.rename(source_dir.id, dest_dir_name)! + } + + // Then move to the new parent + return self.move(source_dir.id, dest_parent_dir.id)! } // Get children of a directory pub fn (mut self DBFsDir) list_children(dir_id u32) ![]FsDir { - child_ids := self.db.redis.hkeys('fsdir:children:${dir_id}')! - mut dirs := []FsDir{} - for id_str in child_ids { - dirs << self.get(id_str.u32())! - } - return dirs + child_ids := self.db.redis.hkeys('fsdir:children:${dir_id}')! + mut dirs := []FsDir{} + for id_str in child_ids { + dirs << self.get(id_str.u32())! + } + return dirs } // Check if a directory has children pub fn (mut self DBFsDir) has_children(dir_id u32) !bool { - keys := self.db.redis.hkeys('fsdir:children:${dir_id}')! - return keys.len > 0 + keys := self.db.redis.hkeys('fsdir:children:${dir_id}')! + return keys.len > 0 } // Rename a directory pub fn (mut self DBFsDir) rename(id u32, new_name string) !u32 { - mut dir := self.get(id)! + mut dir := self.get(id)! - // Remove old path index - old_path_key := '${dir.fs_id}:${dir.parent_id}:${dir.name}' - self.db.redis.hdel('fsdir:paths', old_path_key)! + // Remove old path index + old_path_key := '${dir.fs_id}:${dir.parent_id}:${dir.name}' + self.db.redis.hdel('fsdir:paths', old_path_key)! - // Update name - dir.name = new_name + // Update name + dir.name = new_name - // Save with new name - return self.set(dir)! + // Save with new name + return self.set(dir)! } // Move a directory to a new parent pub fn (mut self DBFsDir) move(id u32, new_parent_id u32) !u32 { - mut dir := self.get(id)! + mut dir := self.get(id)! - // Check that new parent exists and is in the same filesystem - if new_parent_id > 0 { - parent := self.get(new_parent_id)! - if parent.fs_id != dir.fs_id { - return error('Cannot move directory across filesystems') - } - } + // Check that new parent exists and is in the same filesystem + if new_parent_id > 0 { + parent := self.get(new_parent_id)! + if parent.fs_id != dir.fs_id { + return error('Cannot move directory across filesystems') + } + } - // Remove old path index - old_path_key := '${dir.fs_id}:${dir.parent_id}:${dir.name}' - self.db.redis.hdel('fsdir:paths', old_path_key)! + // Remove old path index + old_path_key := '${dir.fs_id}:${dir.parent_id}:${dir.name}' + self.db.redis.hdel('fsdir:paths', old_path_key)! - // Remove from old parent's children list - if dir.parent_id > 0 { - self.db.redis.hdel('fsdir:children:${dir.parent_id}', id.str())! - } + // Remove from old parent's children list + if dir.parent_id > 0 { + self.db.redis.hdel('fsdir:children:${dir.parent_id}', id.str())! + } - // Update parent - dir.parent_id = new_parent_id + // Update parent + dir.parent_id = new_parent_id - // Save with new parent - return self.set(dir)! + // Save with new parent + return self.set(dir)! } // List contents of a directory with filtering capabilities pub fn (mut self DBFsDir) list_contents(fs_factory &FsFactory, dir_id u32, opts ListContentsOptions) !DirectoryContents { - mut result := DirectoryContents{} - - // Helper function to check if name matches include/exclude patterns - matches_pattern := fn (name string, patterns []string) bool { - if patterns.len == 0 { - return true // No patterns means include everything - } - - for pattern in patterns { - if pattern.contains('*') { - prefix := pattern.all_before('*') - suffix := pattern.all_after('*') - - if prefix == '' && suffix == '' { - return true // Pattern is just "*" - } else if prefix == '' { - if name.ends_with(suffix) { - return true - } - } else if suffix == '' { - if name.starts_with(prefix) { - return true - } - } else { - if name.starts_with(prefix) && name.ends_with(suffix) { - return true - } - } - } else if name == pattern { - return true // Exact match - } - } - - return false - } - - // Check if item should be included based on patterns - should_include := fn (name string, include_patterns []string, exclude_patterns []string) bool { - // First apply include patterns (if empty, include everything) - if !matches_pattern(name, include_patterns) && include_patterns.len > 0 { - return false - } - - // Then apply exclude patterns - if matches_pattern(name, exclude_patterns) && exclude_patterns.len > 0 { - return false - } - - return true - } - - // Get directories, files, and symlinks in the current directory - dirs := self.list_children(dir_id)! - for dir in dirs { - if should_include(dir.name, opts.include_patterns, opts.exclude_patterns) { - result.directories << dir - } - - // If recursive, process subdirectories - if opts.recursive { - sub_contents := self.list_contents(fs_factory, dir.id, opts)! - result.directories << sub_contents.directories - result.files << sub_contents.files - result.symlinks << sub_contents.symlinks - } - } - - // Get files in the directory - files := fs_factory.fs_file.list_by_directory(dir_id)! - for file in files { - if should_include(file.name, opts.include_patterns, opts.exclude_patterns) { - result.files << file - } - } - - // Get symlinks in the directory - symlinks := fs_factory.fs_symlink.list_by_parent(dir_id)! - for symlink in symlinks { - if should_include(symlink.name, opts.include_patterns, opts.exclude_patterns) { - result.symlinks << symlink - } - } - - return result + mut result := DirectoryContents{} + + // Helper function to check if name matches include/exclude patterns + matches_pattern := fn (name string, patterns []string) bool { + if patterns.len == 0 { + return true // No patterns means include everything + } + + for pattern in patterns { + if pattern.contains('*') { + prefix := pattern.all_before('*') + suffix := pattern.all_after('*') + + if prefix == '' && suffix == '' { + return true // Pattern is just "*" + } else if prefix == '' { + if name.ends_with(suffix) { + return true + } + } else if suffix == '' { + if name.starts_with(prefix) { + return true + } + } else { + if name.starts_with(prefix) && name.ends_with(suffix) { + return true + } + } + } else if name == pattern { + return true // Exact match + } + } + + return false + } + + // Check if item should be included based on patterns + should_include := fn (name string, include_patterns []string, exclude_patterns []string) bool { + // First apply include patterns (if empty, include everything) + if !matches_pattern(name, include_patterns) && include_patterns.len > 0 { + return false + } + + // Then apply exclude patterns + if matches_pattern(name, exclude_patterns) && exclude_patterns.len > 0 { + return false + } + + return true + } + + // Get directories, files, and symlinks in the current directory + dirs := self.list_children(dir_id)! + for dir in dirs { + if should_include(dir.name, opts.include_patterns, opts.exclude_patterns) { + result.directories << dir + } + + // If recursive, process subdirectories + if opts.recursive { + sub_contents := self.list_contents(fs_factory, dir.id, opts)! + result.directories << sub_contents.directories + result.files << sub_contents.files + result.symlinks << sub_contents.symlinks + } + } + + // Get files in the directory + files := fs_factory.fs_file.list_by_directory(dir_id)! + for file in files { + if should_include(file.name, opts.include_patterns, opts.exclude_patterns) { + result.files << file + } + } + + // Get symlinks in the directory + symlinks := fs_factory.fs_symlink.list_by_parent(dir_id)! + for symlink in symlinks { + if should_include(symlink.name, opts.include_patterns, opts.exclude_patterns) { + result.symlinks << symlink + } + } + + return result } ``` File: /Users/despiegk/code/github/incubaid/herolib/lib/hero/herofs/fs_file.v + ```v module herofs import time import crypto.blake3 import json -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.hero.db +import incubaid.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.hero.db // FsFile represents a file in a filesystem @[heap] pub struct FsFile { - db.Base + db.Base pub mut: - name string - fs_id u32 // Associated filesystem - directories []u32 // Directory IDs where this file exists, means file can be part of multiple directories (like hard links in Linux) - blobs []u32 // IDs of file content blobs - size_bytes u64 - mime_type string // e.g., "image/png" - checksum string // e.g., SHA256 checksum of the file - accessed_at i64 - metadata map[string]string // Custom metadata + name string + fs_id u32 // Associated filesystem + directories []u32 // Directory IDs where this file exists, means file can be part of multiple directories (like hard links in Linux) + blobs []u32 // IDs of file content blobs + size_bytes u64 + mime_type string // e.g., "image/png" + checksum string // e.g., SHA256 checksum of the file + accessed_at i64 + metadata map[string]string // Custom metadata } pub struct DBFsFile { pub mut: - db &db.DB @[skip; str: skip] + db &db.DB @[skip; str: skip] } pub fn (self FsFile) type_name() string { - return 'fs_file' + return 'fs_file' } pub fn (self FsFile) dump(mut e encoder.Encoder) ! { - e.add_string(self.name) - e.add_u32(self.fs_id) + e.add_string(self.name) + e.add_u32(self.fs_id) - // Handle directories - e.add_u16(u16(self.directories.len)) - for dir_id in self.directories { - e.add_u32(dir_id) - } + // Handle directories + e.add_u16(u16(self.directories.len)) + for dir_id in self.directories { + e.add_u32(dir_id) + } - // Handle blobs - e.add_u16(u16(self.blobs.len)) - for blob_id in self.blobs { - e.add_u32(blob_id) - } + // Handle blobs + e.add_u16(u16(self.blobs.len)) + for blob_id in self.blobs { + e.add_u32(blob_id) + } - e.add_u64(self.size_bytes) - e.add_string(self.mime_type) - e.add_string(self.checksum) - e.add_i64(self.accessed_at) + e.add_u64(self.size_bytes) + e.add_string(self.mime_type) + e.add_string(self.checksum) + e.add_i64(self.accessed_at) - // Handle metadata map - e.add_u16(u16(self.metadata.len)) - for key, value in self.metadata { - e.add_string(key) - e.add_string(value) - } + // Handle metadata map + e.add_u16(u16(self.metadata.len)) + for key, value in self.metadata { + e.add_string(key) + e.add_string(value) + } } fn (mut self DBFsFile) load(mut o FsFile, mut e encoder.Decoder) ! { - o.name = e.get_string()! - o.fs_id = e.get_u32()! + o.name = e.get_string()! + o.fs_id = e.get_u32()! - // Load directories - dirs_count := e.get_u16()! - o.directories = []u32{cap: int(dirs_count)} - for _ in 0 .. dirs_count { - o.directories << e.get_u32()! - } + // Load directories + dirs_count := e.get_u16()! + o.directories = []u32{cap: int(dirs_count)} + for _ in 0 .. dirs_count { + o.directories << e.get_u32()! + } - // Load blobs - blobs_count := e.get_u16()! - o.blobs = []u32{cap: int(blobs_count)} - for _ in 0 .. blobs_count { - o.blobs << e.get_u32()! - } + // Load blobs + blobs_count := e.get_u16()! + o.blobs = []u32{cap: int(blobs_count)} + for _ in 0 .. blobs_count { + o.blobs << e.get_u32()! + } - o.size_bytes = e.get_u64()! - o.mime_type = e.get_string()! - o.checksum = e.get_string()! - o.accessed_at = e.get_i64()! + o.size_bytes = e.get_u64()! + o.mime_type = e.get_string()! + o.checksum = e.get_string()! + o.accessed_at = e.get_i64()! - // Load metadata map - metadata_count := e.get_u16()! - o.metadata = map[string]string{} - for _ in 0 .. metadata_count { - key := e.get_string()! - value := e.get_string()! - o.metadata[key] = value - } + // Load metadata map + metadata_count := e.get_u16()! + o.metadata = map[string]string{} + for _ in 0 .. metadata_count { + key := e.get_string()! + value := e.get_string()! + o.metadata[key] = value + } } @[params] pub struct FsFileArg { pub mut: - name string @[required] - description string - fs_id u32 @[required] - directories []u32 @[required] - blobs []u32 - size_bytes u64 - mime_type string - checksum string - metadata map[string]string - tags []string - comments []db.CommentArg + name string @[required] + description string + fs_id u32 @[required] + directories []u32 @[required] + blobs []u32 + size_bytes u64 + mime_type string + checksum string + metadata map[string]string + tags []string + comments []db.CommentArg } // get new file, not from the DB pub fn (mut self DBFsFile) new(args FsFileArg) !FsFile { - // Calculate size based on blobs if not provided - mut size := args.size_bytes - if size == 0 && args.blobs.len > 0 { - // We'll need to sum the sizes of all blobs - for blob_id in args.blobs { - blob_exists := self.db.exists[FsBlob](blob_id)! - if !blob_exists { - return error('Blob with ID ${blob_id} does not exist') - } + // Calculate size based on blobs if not provided + mut size := args.size_bytes + if size == 0 && args.blobs.len > 0 { + // We'll need to sum the sizes of all blobs + for blob_id in args.blobs { + blob_exists := self.db.exists[FsBlob](blob_id)! + if !blob_exists { + return error('Blob with ID ${blob_id} does not exist') + } - // Get blob data - mut blob_obj, blob_data := self.db.get_data[FsBlob](blob_id)! - mut e_decoder := encoder.decoder_new(blob_data) + // Get blob data + mut blob_obj, blob_data := self.db.get_data[FsBlob](blob_id)! + mut e_decoder := encoder.decoder_new(blob_data) - // Skip hash - e_decoder.get_string()! + // Skip hash + e_decoder.get_string()! - // Skip data, get size directly - e_decoder.get_list_u8()! - size += u64(e_decoder.get_int()!) - } - } + // Skip data, get size directly + e_decoder.get_list_u8()! + size += u64(e_decoder.get_int()!) + } + } - mut o := FsFile{ - name: args.name - fs_id: args.fs_id - directories: args.directories - blobs: args.blobs - size_bytes: size - mime_type: args.mime_type - checksum: args.checksum - accessed_at: ourtime.now().unix() - metadata: args.metadata - } + mut o := FsFile{ + name: args.name + fs_id: args.fs_id + directories: args.directories + blobs: args.blobs + size_bytes: size + mime_type: args.mime_type + checksum: args.checksum + accessed_at: ourtime.now().unix() + metadata: args.metadata + } - // Set base fields - o.description = args.description - o.tags = self.db.tags_get(args.tags)! - o.comments = self.db.comments_get(args.comments)! - o.updated_at = ourtime.now().unix() + // Set base fields + o.description = args.description + o.tags = self.db.tags_get(args.tags)! + o.comments = self.db.comments_get(args.comments)! + o.updated_at = ourtime.now().unix() - return o + return o } pub fn (mut self DBFsFile) set(o FsFile) !u32 { - // Check that directories exist - for dir_id in o.directories { - dir_exists := self.db.exists[FsDir](dir_id)! - if !dir_exists { - return error('Directory with ID ${dir_id} does not exist') - } - } + // Check that directories exist + for dir_id in o.directories { + dir_exists := self.db.exists[FsDir](dir_id)! + if !dir_exists { + return error('Directory with ID ${dir_id} does not exist') + } + } - // Check that blobs exist - for blob_id in o.blobs { - blob_exists := self.db.exists[FsBlob](blob_id)! - if !blob_exists { - return error('Blob with ID ${blob_id} does not exist') - } - } + // Check that blobs exist + for blob_id in o.blobs { + blob_exists := self.db.exists[FsBlob](blob_id)! + if !blob_exists { + return error('Blob with ID ${blob_id} does not exist') + } + } - id := self.db.set[FsFile](o)! + id := self.db.set[FsFile](o)! - // Store file in each directory's file index - for dir_id in o.directories { - // Store by name in each directory - path_key := '${dir_id}:${o.name}' - self.db.redis.hset('fsfile:paths', path_key, id.str())! + // Store file in each directory's file index + for dir_id in o.directories { + // Store by name in each directory + path_key := '${dir_id}:${o.name}' + self.db.redis.hset('fsfile:paths', path_key, id.str())! - // Add to directory's file list using hset - self.db.redis.hset('fsfile:dir:${dir_id}', id.str(), id.str())! - } + // Add to directory's file list using hset + self.db.redis.hset('fsfile:dir:${dir_id}', id.str(), id.str())! + } - // Store in filesystem's file list using hset - self.db.redis.hset('fsfile:fs:${o.fs_id}', id.str(), id.str())! + // Store in filesystem's file list using hset + self.db.redis.hset('fsfile:fs:${o.fs_id}', id.str(), id.str())! - // Store by mimetype using hset - if o.mime_type != '' { - self.db.redis.hset('fsfile:mime:${o.mime_type}', id.str(), id.str())! - } + // Store by mimetype using hset + if o.mime_type != '' { + self.db.redis.hset('fsfile:mime:${o.mime_type}', id.str(), id.str())! + } - return id + return id } pub fn (mut self DBFsFile) delete(id u32) ! { - // Get the file info before deleting - file := self.get(id)! + // Get the file info before deleting + file := self.get(id)! - // Remove from each directory's file index - for dir_id in file.directories { - // Remove from path index - path_key := '${dir_id}:${file.name}' - self.db.redis.hdel('fsfile:paths', path_key)! + // Remove from each directory's file index + for dir_id in file.directories { + // Remove from path index + path_key := '${dir_id}:${file.name}' + self.db.redis.hdel('fsfile:paths', path_key)! - // Remove from directory's file list using hdel - self.db.redis.hdel('fsfile:dir:${dir_id}', id.str())! - } + // Remove from directory's file list using hdel + self.db.redis.hdel('fsfile:dir:${dir_id}', id.str())! + } - // Remove from filesystem's file list using hdel - self.db.redis.hdel('fsfile:fs:${file.fs_id}', id.str())! + // Remove from filesystem's file list using hdel + self.db.redis.hdel('fsfile:fs:${file.fs_id}', id.str())! - // Remove from mimetype index using hdel - if file.mime_type != '' { - self.db.redis.hdel('fsfile:mime:${file.mime_type}', id.str())! - } + // Remove from mimetype index using hdel + if file.mime_type != '' { + self.db.redis.hdel('fsfile:mime:${file.mime_type}', id.str())! + } - // Delete the file itself - self.db.delete[FsFile](id)! + // Delete the file itself + self.db.delete[FsFile](id)! } pub fn (mut self DBFsFile) exist(id u32) !bool { - return self.db.exists[FsFile](id)! + return self.db.exists[FsFile](id)! } pub fn (mut self DBFsFile) get(id u32) !FsFile { - mut o, data := self.db.get_data[FsFile](id)! - mut e_decoder := encoder.decoder_new(data) - self.load(mut o, mut e_decoder)! - return o + mut o, data := self.db.get_data[FsFile](id)! + mut e_decoder := encoder.decoder_new(data) + self.load(mut o, mut e_decoder)! + return o } pub fn (mut self DBFsFile) list() ![]FsFile { - return self.db.list[FsFile]()!.map(self.get(it)!) + return self.db.list[FsFile]()!.map(self.get(it)!) } // Get file by path in a specific directory pub fn (mut self DBFsFile) get_by_path(dir_id u32, name string) !FsFile { - path_key := '${dir_id}:${name}' - id_str := self.db.redis.hget('fsfile:paths', path_key)! - if id_str == '' { - return error('File "${name}" not found in directory ${dir_id}') - } - return self.get(id_str.u32())! + path_key := '${dir_id}:${name}' + id_str := self.db.redis.hget('fsfile:paths', path_key)! + if id_str == '' { + return error('File "${name}" not found in directory ${dir_id}') + } + return self.get(id_str.u32())! } // List files in a directory pub fn (mut self DBFsFile) list_by_directory(dir_id u32) ![]FsFile { - file_ids := self.db.redis.hkeys('fsfile:dir:${dir_id}')! - mut files := []FsFile{} - for id_str in file_ids { - files << self.get(id_str.u32())! - } - return files + file_ids := self.db.redis.hkeys('fsfile:dir:${dir_id}')! + mut files := []FsFile{} + for id_str in file_ids { + files << self.get(id_str.u32())! + } + return files } // List files in a filesystem pub fn (mut self DBFsFile) list_by_filesystem(fs_id u32) ![]FsFile { - file_ids := self.db.redis.hkeys('fsfile:fs:${fs_id}')! - mut files := []FsFile{} - for id_str in file_ids { - files << self.get(id_str.u32())! - } - return files + file_ids := self.db.redis.hkeys('fsfile:fs:${fs_id}')! + mut files := []FsFile{} + for id_str in file_ids { + files << self.get(id_str.u32())! + } + return files } // List files by mime type pub fn (mut self DBFsFile) list_by_mime_type(mime_type string) ![]FsFile { - file_ids := self.db.redis.hkeys('fsfile:mime:${mime_type}')! - mut files := []FsFile{} - for id_str in file_ids { - files << self.get(id_str.u32())! - } - return files + file_ids := self.db.redis.hkeys('fsfile:mime:${mime_type}')! + mut files := []FsFile{} + for id_str in file_ids { + files << self.get(id_str.u32())! + } + return files } // Update file with a new blob (append) pub fn (mut self DBFsFile) append_blob(id u32, blob_id u32) !u32 { - // Check blob exists - blob_exists := self.db.exists[FsBlob](blob_id)! - if !blob_exists { - return error('Blob with ID ${blob_id} does not exist') - } + // Check blob exists + blob_exists := self.db.exists[FsBlob](blob_id)! + if !blob_exists { + return error('Blob with ID ${blob_id} does not exist') + } - // Get blob size - mut blob_obj, blob_data := self.db.get_data[FsBlob](blob_id)! - mut e_decoder := encoder.decoder_new(blob_data) + // Get blob size + mut blob_obj, blob_data := self.db.get_data[FsBlob](blob_id)! + mut e_decoder := encoder.decoder_new(blob_data) - // Skip hash - e_decoder.get_string()! + // Skip hash + e_decoder.get_string()! - // Skip data, get size directly - e_decoder.get_list_u8()! - blob_size := e_decoder.get_int()! + // Skip data, get size directly + e_decoder.get_list_u8()! + blob_size := e_decoder.get_int()! - // Get file - mut file := self.get(id)! + // Get file + mut file := self.get(id)! - // Add blob if not already in the list - if blob_id !in file.blobs { - file.blobs << blob_id - file.size_bytes += u64(blob_size) - file.updated_at = ourtime.now().unix() - } + // Add blob if not already in the list + if blob_id !in file.blobs { + file.blobs << blob_id + file.size_bytes += u64(blob_size) + file.updated_at = ourtime.now().unix() + } - // Save file - return self.set(file)! + // Save file + return self.set(file)! } // Update file accessed timestamp pub fn (mut self DBFsFile) update_accessed(id u32) !u32 { - mut file := self.get(id)! - file.accessed_at = ourtime.now().unix() - return self.set(file)! + mut file := self.get(id)! + file.accessed_at = ourtime.now().unix() + return self.set(file)! } // Update file metadata pub fn (mut self DBFsFile) update_metadata(id u32, key string, value string) !u32 { - mut file := self.get(id)! - file.metadata[key] = value - file.updated_at = ourtime.now().unix() - return self.set(file)! + mut file := self.get(id)! + file.metadata[key] = value + file.updated_at = ourtime.now().unix() + return self.set(file)! } // Rename a file pub fn (mut self DBFsFile) rename(id u32, new_name string) !u32 { - mut file := self.get(id)! + mut file := self.get(id)! - // Remove old path indexes - for dir_id in file.directories { - old_path_key := '${dir_id}:${file.name}' - self.db.redis.hdel('fsfile:paths', old_path_key)! - } + // Remove old path indexes + for dir_id in file.directories { + old_path_key := '${dir_id}:${file.name}' + self.db.redis.hdel('fsfile:paths', old_path_key)! + } - // Update name - file.name = new_name + // Update name + file.name = new_name - // Save with new name - return self.set(file)! + // Save with new name + return self.set(file)! } // Move file to different directories pub fn (mut self DBFsFile) move(id u32, new_directories []u32) !u32 { - mut file := self.get(id)! + mut file := self.get(id)! - // Check that all new directories exist - for dir_id in new_directories { - dir_exists := self.db.exists[FsDir](dir_id)! - if !dir_exists { - return error('Directory with ID ${dir_id} does not exist') - } - } + // Check that all new directories exist + for dir_id in new_directories { + dir_exists := self.db.exists[FsDir](dir_id)! + if !dir_exists { + return error('Directory with ID ${dir_id} does not exist') + } + } - // Remove from old directories - for dir_id in file.directories { - path_key := '${dir_id}:${file.name}' - self.db.redis.hdel('fsfile:paths', path_key)! - self.db.redis.hdel('fsfile:dir:${dir_id}', id.str())! - } + // Remove from old directories + for dir_id in file.directories { + path_key := '${dir_id}:${file.name}' + self.db.redis.hdel('fsfile:paths', path_key)! + self.db.redis.hdel('fsfile:dir:${dir_id}', id.str())! + } - // Update directories - file.directories = new_directories + // Update directories + file.directories = new_directories - // Save with new directories - return self.set(file)! + // Save with new directories + return self.set(file)! } ``` File: /Users/despiegk/code/github/incubaid/herolib/lib/hero/herofs/fs_symlink.v + ```v module herofs import time import crypto.blake3 import json -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.hero.db +import incubaid.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.hero.db // FsSymlink represents a symbolic link in a filesystem @[heap] pub struct FsSymlink { - db.Base + db.Base pub mut: - name string - fs_id u32 // Associated filesystem - parent_id u32 // Parent directory ID - target_id u32 // ID of target file or directory - target_type SymlinkTargetType + name string + fs_id u32 // Associated filesystem + parent_id u32 // Parent directory ID + target_id u32 // ID of target file or directory + target_type SymlinkTargetType } pub enum SymlinkTargetType { - file - directory + file + directory } pub struct DBFsSymlink { pub mut: - db &db.DB @[skip; str: skip] + db &db.DB @[skip; str: skip] } pub fn (self FsSymlink) type_name() string { - return 'fs_symlink' + return 'fs_symlink' } pub fn (self FsSymlink) dump(mut e encoder.Encoder) ! { - e.add_string(self.name) - e.add_u32(self.fs_id) - e.add_u32(self.parent_id) - e.add_u32(self.target_id) - e.add_u8(u8(self.target_type)) + e.add_string(self.name) + e.add_u32(self.fs_id) + e.add_u32(self.parent_id) + e.add_u32(self.target_id) + e.add_u8(u8(self.target_type)) } fn (mut self DBFsSymlink) load(mut o FsSymlink, mut e encoder.Decoder) ! { - o.name = e.get_string()! - o.fs_id = e.get_u32()! - o.parent_id = e.get_u32()! - o.target_id = e.get_u32()! - o.target_type = unsafe { SymlinkTargetType(e.get_u8()!) } + o.name = e.get_string()! + o.fs_id = e.get_u32()! + o.parent_id = e.get_u32()! + o.target_id = e.get_u32()! + o.target_type = unsafe { SymlinkTargetType(e.get_u8()!) } } @[params] pub struct FsSymlinkArg { pub mut: - name string @[required] - description string - fs_id u32 @[required] - parent_id u32 @[required] - target_id u32 @[required] - target_type SymlinkTargetType @[required] - tags []string - comments []db.CommentArg + name string @[required] + description string + fs_id u32 @[required] + parent_id u32 @[required] + target_id u32 @[required] + target_type SymlinkTargetType @[required] + tags []string + comments []db.CommentArg } // get new symlink, not from the DB pub fn (mut self DBFsSymlink) new(args FsSymlinkArg) !FsSymlink { - mut o := FsSymlink{ - name: args.name - fs_id: args.fs_id - parent_id: args.parent_id - target_id: args.target_id - target_type: args.target_type - } + mut o := FsSymlink{ + name: args.name + fs_id: args.fs_id + parent_id: args.parent_id + target_id: args.target_id + target_type: args.target_type + } - // Set base fields - o.description = args.description - o.tags = self.db.tags_get(args.tags)! - o.comments = self.db.comments_get(args.comments)! - o.updated_at = ourtime.now().unix() + // Set base fields + o.description = args.description + o.tags = self.db.tags_get(args.tags)! + o.comments = self.db.comments_get(args.comments)! + o.updated_at = ourtime.now().unix() - return o + return o } pub fn (mut self DBFsSymlink) set(o FsSymlink) !u32 { - // Check parent directory exists - if o.parent_id > 0 { - parent_exists := self.db.exists[FsDir](o.parent_id)! - if !parent_exists { - return error('Parent directory with ID ${o.parent_id} does not exist') - } - } + // Check parent directory exists + if o.parent_id > 0 { + parent_exists := self.db.exists[FsDir](o.parent_id)! + if !parent_exists { + return error('Parent directory with ID ${o.parent_id} does not exist') + } + } - // Check target exists based on target type - if o.target_type == .file { - target_exists := self.db.exists[FsFile](o.target_id)! - if !target_exists { - return error('Target file with ID ${o.target_id} does not exist') - } - } else if o.target_type == .directory { - target_exists := self.db.exists[FsDir](o.target_id)! - if !target_exists { - return error('Target directory with ID ${o.target_id} does not exist') - } - } + // Check target exists based on target type + if o.target_type == .file { + target_exists := self.db.exists[FsFile](o.target_id)! + if !target_exists { + return error('Target file with ID ${o.target_id} does not exist') + } + } else if o.target_type == .directory { + target_exists := self.db.exists[FsDir](o.target_id)! + if !target_exists { + return error('Target directory with ID ${o.target_id} does not exist') + } + } - id := self.db.set[FsSymlink](o)! + id := self.db.set[FsSymlink](o)! - // Store symlink in parent directory's symlink index - path_key := '${o.parent_id}:${o.name}' - self.db.redis.hset('fssymlink:paths', path_key, id.str())! + // Store symlink in parent directory's symlink index + path_key := '${o.parent_id}:${o.name}' + self.db.redis.hset('fssymlink:paths', path_key, id.str())! - // Add to parent's symlinks list using hset - self.db.redis.hset('fssymlink:parent:${o.parent_id}', id.str(), id.str())! + // Add to parent's symlinks list using hset + self.db.redis.hset('fssymlink:parent:${o.parent_id}', id.str(), id.str())! - // Store in filesystem's symlink list using hset - self.db.redis.hset('fssymlink:fs:${o.fs_id}', id.str(), id.str())! + // Store in filesystem's symlink list using hset + self.db.redis.hset('fssymlink:fs:${o.fs_id}', id.str(), id.str())! - // Store in target's referrers list using hset - target_key := '${o.target_type}:${o.target_id}' - self.db.redis.hset('fssymlink:target:${target_key}', id.str(), id.str())! + // Store in target's referrers list using hset + target_key := '${o.target_type}:${o.target_id}' + self.db.redis.hset('fssymlink:target:${target_key}', id.str(), id.str())! - return id + return id } pub fn (mut self DBFsSymlink) delete(id u32) ! { - // Get the symlink info before deleting - symlink := self.get(id)! + // Get the symlink info before deleting + symlink := self.get(id)! - // Remove from path index - path_key := '${symlink.parent_id}:${symlink.name}' - self.db.redis.hdel('fssymlink:paths', path_key)! + // Remove from path index + path_key := '${symlink.parent_id}:${symlink.name}' + self.db.redis.hdel('fssymlink:paths', path_key)! - // Remove from parent's symlinks list using hdel - self.db.redis.hdel('fssymlink:parent:${symlink.parent_id}', id.str())! + // Remove from parent's symlinks list using hdel + self.db.redis.hdel('fssymlink:parent:${symlink.parent_id}', id.str())! - // Remove from filesystem's symlink list using hdel - self.db.redis.hdel('fssymlink:fs:${symlink.fs_id}', id.str())! + // Remove from filesystem's symlink list using hdel + self.db.redis.hdel('fssymlink:fs:${symlink.fs_id}', id.str())! - // Remove from target's referrers list using hdel - target_key := '${symlink.target_type}:${symlink.target_id}' - self.db.redis.hdel('fssymlink:target:${target_key}', id.str())! + // Remove from target's referrers list using hdel + target_key := '${symlink.target_type}:${symlink.target_id}' + self.db.redis.hdel('fssymlink:target:${target_key}', id.str())! - // Delete the symlink itself - self.db.delete[FsSymlink](id)! + // Delete the symlink itself + self.db.delete[FsSymlink](id)! } pub fn (mut self DBFsSymlink) exist(id u32) !bool { - return self.db.exists[FsSymlink](id)! + return self.db.exists[FsSymlink](id)! } pub fn (mut self DBFsSymlink) get(id u32) !FsSymlink { - mut o, data := self.db.get_data[FsSymlink](id)! - mut e_decoder := encoder.decoder_new(data) - self.load(mut o, mut e_decoder)! - return o + mut o, data := self.db.get_data[FsSymlink](id)! + mut e_decoder := encoder.decoder_new(data) + self.load(mut o, mut e_decoder)! + return o } pub fn (mut self DBFsSymlink) list() ![]FsSymlink { - return self.db.list[FsSymlink]()!.map(self.get(it)!) + return self.db.list[FsSymlink]()!.map(self.get(it)!) } // Get symlink by path in a parent directory pub fn (mut self DBFsSymlink) get_by_path(parent_id u32, name string) !FsSymlink { - path_key := '${parent_id}:${name}' - id_str := self.db.redis.hget('fssymlink:paths', path_key)! - if id_str == '' { - return error('Symlink "${name}" not found in parent directory ${parent_id}') - } - return self.get(id_str.u32())! + path_key := '${parent_id}:${name}' + id_str := self.db.redis.hget('fssymlink:paths', path_key)! + if id_str == '' { + return error('Symlink "${name}" not found in parent directory ${parent_id}') + } + return self.get(id_str.u32())! } // List symlinks in a parent directory pub fn (mut self DBFsSymlink) list_by_parent(parent_id u32) ![]FsSymlink { - symlink_ids := self.db.redis.hkeys('fssymlink:parent:${parent_id}')! - mut symlinks := []FsSymlink{} - for id_str in symlink_ids { - symlinks << self.get(id_str.u32())! - } - return symlinks + symlink_ids := self.db.redis.hkeys('fssymlink:parent:${parent_id}')! + mut symlinks := []FsSymlink{} + for id_str in symlink_ids { + symlinks << self.get(id_str.u32())! + } + return symlinks } // List symlinks in a filesystem pub fn (mut self DBFsSymlink) list_by_filesystem(fs_id u32) ![]FsSymlink { - symlink_ids := self.db.redis.hkeys('fssymlink:fs:${fs_id}')! - mut symlinks := []FsSymlink{} - for id_str in symlink_ids { - symlinks << self.get(id_str.u32())! - } - return symlinks + symlink_ids := self.db.redis.hkeys('fssymlink:fs:${fs_id}')! + mut symlinks := []FsSymlink{} + for id_str in symlink_ids { + symlinks << self.get(id_str.u32())! + } + return symlinks } // List symlinks pointing to a target pub fn (mut self DBFsSymlink) list_by_target(target_type SymlinkTargetType, target_id u32) ![]FsSymlink { - target_key := '${target_type}:${target_id}' - symlink_ids := self.db.redis.hkeys('fssymlink:target:${target_key}')! - mut symlinks := []FsSymlink{} - for id_str in symlink_ids { - symlinks << self.get(id_str.u32())! - } - return symlinks + target_key := '${target_type}:${target_id}' + symlink_ids := self.db.redis.hkeys('fssymlink:target:${target_key}')! + mut symlinks := []FsSymlink{} + for id_str in symlink_ids { + symlinks << self.get(id_str.u32())! + } + return symlinks } // Rename a symlink pub fn (mut self DBFsSymlink) rename(id u32, new_name string) !u32 { - mut symlink := self.get(id)! + mut symlink := self.get(id)! - // Remove old path index - old_path_key := '${symlink.parent_id}:${symlink.name}' - self.db.redis.hdel('fssymlink:paths', old_path_key)! + // Remove old path index + old_path_key := '${symlink.parent_id}:${symlink.name}' + self.db.redis.hdel('fssymlink:paths', old_path_key)! - // Update name - symlink.name = new_name + // Update name + symlink.name = new_name - // Save with new name - return self.set(symlink)! + // Save with new name + return self.set(symlink)! } // Move symlink to a new parent directory pub fn (mut self DBFsSymlink) move(id u32, new_parent_id u32) !u32 { - mut symlink := self.get(id)! + mut symlink := self.get(id)! - // Check that new parent exists and is in the same filesystem - if new_parent_id > 0 { - parent_data, _ := self.db.get_data[FsDir](new_parent_id)! - if parent_data.fs_id != symlink.fs_id { - return error('Cannot move symlink across filesystems') - } - } + // Check that new parent exists and is in the same filesystem + if new_parent_id > 0 { + parent_data, _ := self.db.get_data[FsDir](new_parent_id)! + if parent_data.fs_id != symlink.fs_id { + return error('Cannot move symlink across filesystems') + } + } - // Remove old path index - old_path_key := '${symlink.parent_id}:${symlink.name}' - self.db.redis.hdel('fssymlink:paths', old_path_key)! + // Remove old path index + old_path_key := '${symlink.parent_id}:${symlink.name}' + self.db.redis.hdel('fssymlink:paths', old_path_key)! - // Remove from old parent's symlinks list using hdel - self.db.redis.hdel('fssymlink:parent:${symlink.parent_id}', id.str())! + // Remove from old parent's symlinks list using hdel + self.db.redis.hdel('fssymlink:parent:${symlink.parent_id}', id.str())! - // Update parent - symlink.parent_id = new_parent_id + // Update parent + symlink.parent_id = new_parent_id - // Save with new parent - return self.set(symlink)! + // Save with new parent + return self.set(symlink)! } // Redirect symlink to a new target pub fn (mut self DBFsSymlink) redirect(id u32, new_target_id u32, new_target_type SymlinkTargetType) !u32 { - mut symlink := self.get(id)! + mut symlink := self.get(id)! - // Check new target exists - if new_target_type == .file { - target_exists := self.db.exists[FsFile](new_target_id)! - if !target_exists { - return error('Target file with ID ${new_target_id} does not exist') - } - } else if new_target_type == .directory { - target_exists := self.db.exists[FsDir](new_target_id)! - if !target_exists { - return error('Target directory with ID ${new_target_id} does not exist') - } - } + // Check new target exists + if new_target_type == .file { + target_exists := self.db.exists[FsFile](new_target_id)! + if !target_exists { + return error('Target file with ID ${new_target_id} does not exist') + } + } else if new_target_type == .directory { + target_exists := self.db.exists[FsDir](new_target_id)! + if !target_exists { + return error('Target directory with ID ${new_target_id} does not exist') + } + } - // Remove from old target's referrers list - old_target_key := '${symlink.target_type}:${symlink.target_id}' - self.db.redis.hdel('fssymlink:target:${old_target_key}', id.str())! + // Remove from old target's referrers list + old_target_key := '${symlink.target_type}:${symlink.target_id}' + self.db.redis.hdel('fssymlink:target:${old_target_key}', id.str())! - // Update target - symlink.target_id = new_target_id - symlink.target_type = new_target_type + // Update target + symlink.target_id = new_target_id + symlink.target_type = new_target_type - // Save with new target - return self.set(symlink)! + // Save with new target + return self.set(symlink)! } // Resolve a symlink to get its target pub fn (mut self DBFsSymlink) resolve(id u32) !u32 { - symlink := self.get(id)! - return symlink.target_id + symlink := self.get(id)! + return symlink.target_id } // Check if a symlink is broken (target doesn't exist) pub fn (mut self DBFsSymlink) is_broken(id u32) !bool { - symlink := self.get(id)! + symlink := self.get(id)! - if symlink.target_type == .file { - return !self.db.exists[FsFile](symlink.target_id)! - } else if symlink.target_type == .directory { - return !self.db.exists[FsDir](symlink.target_id)! - } + if symlink.target_type == .file { + return !self.db.exists[FsFile](symlink.target_id)! + } else if symlink.target_type == .directory { + return !self.db.exists[FsDir](symlink.target_id)! + } - return true // Unknown target type is considered broken + return true // Unknown target type is considered broken } ``` File: /Users/despiegk/code/github/incubaid/herolib/lib/hero/herofs/fs.v + ```v module herofs import time import crypto.blake3 import json -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.hero.db +import incubaid.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.hero.db // Fs represents a filesystem, is the top level container for files and directories and symlinks, blobs are used over filesystems @[heap] pub struct Fs { - db.Base + db.Base pub mut: - name string - group_id u32 // Associated group for permissions - root_dir_id u32 // ID of root directory - quota_bytes u64 // Storage quota in bytes - used_bytes u64 // Current usage in bytes + name string + group_id u32 // Associated group for permissions + root_dir_id u32 // ID of root directory + quota_bytes u64 // Storage quota in bytes + used_bytes u64 // Current usage in bytes } // We only keep the root directory ID here, other directories can be found by querying parent_id in FsDir pub struct DBFs { pub mut: - db &db.DB @[skip; str: skip] + db &db.DB @[skip; str: skip] } pub fn (self Fs) type_name() string { - return 'fs' + return 'fs' } pub fn (self Fs) dump(mut e encoder.Encoder) ! { - e.add_string(self.name) - e.add_u32(self.group_id) - e.add_u32(self.root_dir_id) - e.add_u64(self.quota_bytes) - e.add_u64(self.used_bytes) + e.add_string(self.name) + e.add_u32(self.group_id) + e.add_u32(self.root_dir_id) + e.add_u64(self.quota_bytes) + e.add_u64(self.used_bytes) } fn (mut self DBFs) load(mut o Fs, mut e encoder.Decoder) ! { - o.name = e.get_string()! - o.group_id = e.get_u32()! - o.root_dir_id = e.get_u32()! - o.quota_bytes = e.get_u64()! - o.used_bytes = e.get_u64()! + o.name = e.get_string()! + o.group_id = e.get_u32()! + o.root_dir_id = e.get_u32()! + o.quota_bytes = e.get_u64()! + o.used_bytes = e.get_u64()! } @[params] pub struct FsArg { pub mut: - name string @[required] - description string - group_id u32 - root_dir_id u32 - quota_bytes u64 - used_bytes u64 - tags []string - comments []db.CommentArg + name string @[required] + description string + group_id u32 + root_dir_id u32 + quota_bytes u64 + used_bytes u64 + tags []string + comments []db.CommentArg } // get new filesystem, not from the DB pub fn (mut self DBFs) new(args FsArg) !Fs { - mut o := Fs{ - name: args.name - group_id: args.group_id - root_dir_id: args.root_dir_id - quota_bytes: args.quota_bytes - used_bytes: args.used_bytes - } + mut o := Fs{ + name: args.name + group_id: args.group_id + root_dir_id: args.root_dir_id + quota_bytes: args.quota_bytes + used_bytes: args.used_bytes + } - // Set base fields - o.description = args.description - o.tags = self.db.tags_get(args.tags)! - o.comments = self.db.comments_get(args.comments)! - o.updated_at = ourtime.now().unix() + // Set base fields + o.description = args.description + o.tags = self.db.tags_get(args.tags)! + o.comments = self.db.comments_get(args.comments)! + o.updated_at = ourtime.now().unix() - return o + return o } pub fn (mut self DBFs) set(o Fs) !u32 { - id := self.db.set[Fs](o)! + id := self.db.set[Fs](o)! - // Store name -> id mapping for lookups - self.db.redis.hset('fs:names', o.name, id.str())! + // Store name -> id mapping for lookups + self.db.redis.hset('fs:names', o.name, id.str())! - return id + return id } pub fn (mut self DBFs) delete(id u32) ! { - // Get the filesystem to retrieve its name - fs := self.get(id)! + // Get the filesystem to retrieve its name + fs := self.get(id)! - // Remove name -> id mapping - self.db.redis.hdel('fs:names', fs.name)! + // Remove name -> id mapping + self.db.redis.hdel('fs:names', fs.name)! - // Delete the filesystem - self.db.delete[Fs](id)! + // Delete the filesystem + self.db.delete[Fs](id)! } pub fn (mut self DBFs) exist(id u32) !bool { - return self.db.exists[Fs](id)! + return self.db.exists[Fs](id)! } pub fn (mut self DBFs) get(id u32) !Fs { - mut o, data := self.db.get_data[Fs](id)! - mut e_decoder := encoder.decoder_new(data) - self.load(mut o, mut e_decoder)! - return o + mut o, data := self.db.get_data[Fs](id)! + mut e_decoder := encoder.decoder_new(data) + self.load(mut o, mut e_decoder)! + return o } pub fn (mut self DBFs) list() ![]Fs { - return self.db.list[Fs]()!.map(self.get(it)!) + return self.db.list[Fs]()!.map(self.get(it)!) } // Additional hset operations for efficient lookups pub fn (mut self DBFs) get_by_name(name string) !Fs { - // We'll store a mapping of name -> id in a separate hash - id_str := self.db.redis.hget('fs:names', name)! - if id_str == '' { - return error('Filesystem with name "${name}" not found') - } - return self.get(id_str.u32())! + // We'll store a mapping of name -> id in a separate hash + id_str := self.db.redis.hget('fs:names', name)! + if id_str == '' { + return error('Filesystem with name "${name}" not found') + } + return self.get(id_str.u32())! } // Custom method to increase used_bytes pub fn (mut self DBFs) increase_usage(id u32, bytes u64) !u64 { - mut fs := self.get(id)! - fs.used_bytes += bytes - self.set(fs)! - return fs.used_bytes + mut fs := self.get(id)! + fs.used_bytes += bytes + self.set(fs)! + return fs.used_bytes } // Custom method to decrease used_bytes pub fn (mut self DBFs) decrease_usage(id u32, bytes u64) !u64 { - mut fs := self.get(id)! - if bytes > fs.used_bytes { - fs.used_bytes = 0 - } else { - fs.used_bytes -= bytes - } - self.set(fs)! - return fs.used_bytes + mut fs := self.get(id)! + if bytes > fs.used_bytes { + fs.used_bytes = 0 + } else { + fs.used_bytes -= bytes + } + self.set(fs)! + return fs.used_bytes } // Check if quota is exceeded pub fn (mut self DBFs) check_quota(id u32, additional_bytes u64) !bool { - fs := self.get(id)! - return (fs.used_bytes + additional_bytes) <= fs.quota_bytes + fs := self.get(id)! + return (fs.used_bytes + additional_bytes) <= fs.quota_bytes } ``` File: /Users/despiegk/code/github/incubaid/herolib/lib/hero/herofs/README.md + ```md # HeroFS - Distributed Filesystem for HeroLib @@ -3177,7 +3200,7 @@ HeroFS is part of HeroLib and is automatically available when using HeroLib. To use HeroFS, you need to create a filesystem factory: ```v -import freeflowuniverse.herolib.hero.herofs +import incubaid.herolib.hero.herofs mut fs_factory := herofs.new()! ``` @@ -3186,8 +3209,8 @@ mut fs_factory := herofs.new()! ```v fs_id := fs_factory.fs.set(fs_factory.fs.new( - name: 'my_filesystem' - quota_bytes: 1000000000 // 1GB quota + name: 'my_filesystem' + quota_bytes: 1000000000 // 1GB quota )!)! ``` @@ -3196,16 +3219,16 @@ fs_id := fs_factory.fs.set(fs_factory.fs.new( ```v // Create root directory root_dir_id := fs_factory.fs_dir.set(fs_factory.fs_dir.new( - name: 'root' - fs_id: fs_id - parent_id: 0 + name: 'root' + fs_id: fs_id + parent_id: 0 )!)! // Create subdirectory sub_dir_id := fs_factory.fs_dir.set(fs_factory.fs_dir.new( - name: 'documents' - fs_id: fs_id - parent_id: root_dir_id + name: 'documents' + fs_id: fs_id + parent_id: root_dir_id )!)! ``` @@ -3214,8 +3237,8 @@ sub_dir_id := fs_factory.fs_dir.set(fs_factory.fs_dir.new( ```v // Create a blob with binary data blob_id := fs_factory.fs_blob.set(fs_factory.fs_blob.new( - data: content_bytes - mime_type: 'text/plain' + data: content_bytes + mime_type: 'text/plain' )!)! ``` @@ -3224,10 +3247,10 @@ blob_id := fs_factory.fs_blob.set(fs_factory.fs_blob.new( ```v // Create a file file_id := fs_factory.fs_file.set(fs_factory.fs_file.new( - name: 'example.txt' - fs_id: fs_id - directories: [root_dir_id] - blobs: [blob_id] + name: 'example.txt' + fs_id: fs_id + directories: [root_dir_id] + blobs: [blob_id] )!)! ``` @@ -3236,11 +3259,11 @@ file_id := fs_factory.fs_file.set(fs_factory.fs_file.new( ```v // Create a symbolic link to a file symlink_id := fs_factory.fs_symlink.set(fs_factory.fs_symlink.new( - name: 'example_link.txt' - fs_id: fs_id - parent_id: root_dir_id - target_id: file_id - target_type: .file + name: 'example_link.txt' + fs_id: fs_id + parent_id: root_dir_id + target_id: file_id + target_type: .file )!)! ``` @@ -3288,13 +3311,13 @@ The `Fs` struct represents a filesystem as a top-level container: ```v @[heap] pub struct Fs { - db.Base + db.Base pub mut: - name string - group_id u32 // Associated group for permissions - root_dir_id u32 // ID of root directory - quota_bytes u64 // Storage quota in bytes - used_bytes u64 // Current usage in bytes + name string + group_id u32 // Associated group for permissions + root_dir_id u32 // ID of root directory + quota_bytes u64 // Storage quota in bytes + used_bytes u64 // Current usage in bytes } ``` @@ -3325,11 +3348,11 @@ The `FsDir` struct represents a directory in a filesystem: ```v @[heap] pub struct FsDir { - db.Base + db.Base pub mut: - name string - fs_id u32 // Associated filesystem - parent_id u32 // Parent directory ID (0 for root) + name string + fs_id u32 // Associated filesystem + parent_id u32 // Parent directory ID (0 for root) } ``` @@ -3362,17 +3385,17 @@ The `FsFile` struct represents a file in a filesystem: ```v @[heap] pub struct FsFile { - db.Base + db.Base pub mut: - name string - fs_id u32 // Associated filesystem - directories []u32 // Directory IDs where this file exists - blobs []u32 // IDs of file content blobs - size_bytes u64 - mime_type string // e.g., "image/png" - checksum string // e.g., SHA256 checksum of the file - accessed_at i64 - metadata map[string]string // Custom metadata + name string + fs_id u32 // Associated filesystem + directories []u32 // Directory IDs where this file exists + blobs []u32 // IDs of file content blobs + size_bytes u64 + mime_type string // e.g., "image/png" + checksum string // e.g., SHA256 checksum of the file + accessed_at i64 + metadata map[string]string // Custom metadata } ``` @@ -3411,18 +3434,18 @@ The `FsSymlink` struct represents a symbolic link in a filesystem: ```v @[heap] pub struct FsSymlink { - db.Base + db.Base pub mut: - name string - fs_id u32 // Associated filesystem - parent_id u32 // Parent directory ID - target_id u32 // ID of target file or directory - target_type SymlinkTargetType + name string + fs_id u32 // Associated filesystem + parent_id u32 // Parent directory ID + target_id u32 // ID of target file or directory + target_type SymlinkTargetType } pub enum SymlinkTargetType { - file - directory + file + directory } ``` @@ -3458,14 +3481,14 @@ The `FsBlob` struct represents binary data chunks: ```v @[heap] pub struct FsBlob { - db.Base + db.Base pub mut: - hash string // blake192 hash of content - data []u8 // Binary data (max 1MB) - size_bytes int // Size in bytes - created_at i64 - mime_type string // MIME type - encoding string // Encoding type + hash string // blake192 hash of content + data []u8 // Binary data (max 1MB) + size_bytes int // Size in bytes + created_at i64 + mime_type string // MIME type + encoding string // Encoding type } ``` @@ -3495,6 +3518,7 @@ pub mut: HeroFS uses Redis hash sets extensively for efficient indexing and lookup: ### Filesystem Indices + - `fs:names` - Maps filesystem names to IDs - `fsdir:paths` - Maps directory path components to IDs - `fsdir:fs:${fs_id}` - Lists directories in a filesystem @@ -3521,19 +3545,25 @@ All HeroFS components use the HeroLib encoder for serialization: ## Special Features ### Hard Links + Files can be associated with multiple directories through the `directories` field, allowing for hard link-like behavior. ### Deduplication + Blobs are automatically deduplicated based on their content hash. When creating a new blob with identical content to an existing one, the existing ID is returned. ### Quota Management + Filesystems track their storage usage and can enforce quotas to prevent overconsumption. ### Metadata Support + Files support custom metadata as key-value pairs, allowing for flexible attribute storage. ### Cross-Component Validation + When creating or modifying components, HeroFS validates references to other components: + - Directory parent must exist - File directories must exist - File blobs must exist @@ -3543,6 +3573,7 @@ When creating or modifying components, HeroFS validates references to other comp ## Security Model HeroFS inherits the security model from HeroDB: + - Each component has a `securitypolicy` field referencing a SecurityPolicy object - Components can have associated tags for categorization - Components can have associated comments for documentation diff --git a/aiprompts/vlang_herolib_core.md b/aiprompts/vlang_herolib_core.md index 0184d75a..0fae7baf 100644 --- a/aiprompts/vlang_herolib_core.md +++ b/aiprompts/vlang_herolib_core.md @@ -3,13 +3,12 @@ IMPORTANT: USE THIS PAGE AS THE ABSOLUTE AUTHORITY ON ALL INSTRUCTIONS IN RELATION TO HEROSCRIPT AND VLANG -## instructions for code generation +## instructions for code generation > when I generate code, the following instructions can never be overruled they are the basics - do not try to fix files which end with _.v because these are generated files - ## instruction for vlang scripts when I generate vlang scripts I will always use .vsh extension and use following as first line: @@ -54,12 +53,12 @@ vtest ~/code/github/incubaid/herolib/lib/osal/package_test.v /@[params] pub struct MyArgs { pub mut: - name string - passphrase string + name string + passphrase string } pub fn my_function(args MyArgs) { - // Use args.name and args.passphrase + // Use args.name and args.passphrase } //it get called as follows @@ -70,7 +69,6 @@ my_function(name:"my_key", passphrase:"my_passphrase") ``` - # Getting the Current Script's Path in Herolib/V Shell can be used in any .v or .vsh script, easy to find content close to the script itself. @@ -95,60 +93,60 @@ HeroScript is a concise scripting language with the following structure: ```heroscript !!actor.action_name - param1: 'value1' - param2: 'value with spaces' - multiline_description: ' - This is a multiline description. - It can span multiple lines. - ' - arg1 arg2 // Arguments without keys + param1: 'value1' + param2: 'value with spaces' + multiline_description: ' + This is a multiline description. + It can span multiple lines. + ' + arg1 arg2 // Arguments without keys ``` Key characteristics: -- **Actions**: Start with `!!`, followed by `actor.action_name` (e.g., `!!mailclient.configure`). -- **Parameters**: Defined as `key:value`. Values can be quoted for spaces. -- **Multiline Support**: Parameters like `description` can span multiple lines. -- **Arguments**: Values without keys (e.g., `arg1`). + +- **Actions**: Start with `!!`, followed by `actor.action_name` (e.g., `!!mailclient.configure`). +- **Parameters**: Defined as `key:value`. Values can be quoted for spaces. +- **Multiline Support**: Parameters like `description` can span multiple lines. +- **Arguments**: Values without keys (e.g., `arg1`). ## Processing HeroScript in Vlang HeroScript can be parsed into a `playbook.PlayBook` object, allowing structured access to actions and their parameters, this is used in most of the herolib modules, it allows configuration or actions in a structured way. ```v -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console pub fn play(mut plbook PlayBook) ! { - if plbook.exists_once(filter: 'docusaurus.define') { - mut action := plbook.get(filter: 'docusaurus.define')! - mut p := action.params - //example how we get parameters from the action see core_params.md for more details - ds = new( - path: p.get_default('path_publish', '')! - production: p.get_default_false('production') - )! - } + if plbook.exists_once(filter: 'docusaurus.define') { + mut action := plbook.get(filter: 'docusaurus.define')! + mut p := action.params + //example how we get parameters from the action see core_params.md for more details + ds = new( + path: p.get_default('path_publish', '')! + production: p.get_default_false('production') + )! + } - // Process 'docusaurus.add' actions to configure individual Docusaurus sites - actions := plbook.find(filter: 'docusaurus.add')! - for action in actions { - mut p := action.params - //do more processing here - } + // Process 'docusaurus.add' actions to configure individual Docusaurus sites + actions := plbook.find(filter: 'docusaurus.add')! + for action in actions { + mut p := action.params + //do more processing here + } } ``` For detailed information on parameter retrieval methods (e.g., `p.get()`, `p.get_int()`, `p.get_default_true()`), refer to `aiprompts/ai_core/core_params.md`. - # PlayBook, process heroscripts HeroScript can be parsed into a `playbook.PlayBook` object, allowing structured access to actions and their parameters. ```v -import freeflowuniverse.herolib.core.playbook -import freeflowuniverse.herolib.core.playcmds +import incubaid.herolib.core.playbook +import incubaid.herolib.core.playcmds // path string // text string @@ -169,6 +167,7 @@ playcmds.run(mut plbook)! The `HTTPConnection` module provides a robust HTTP client for Vlang, supporting JSON, custom headers, retries, and caching. ## Key Features + - Type-safe JSON methods - Custom headers - Retry mechanism @@ -178,7 +177,7 @@ The `HTTPConnection` module provides a robust HTTP client for Vlang, supporting ## Basic Usage ```v -import freeflowuniverse.herolib.core.httpconnection +import incubaid.herolib.core.httpconnection // Create a new HTTP connection mut conn := httpconnection.new( @@ -196,17 +195,17 @@ To integrate `HTTPConnection` into a management class (e.g., `HetznerManager`), ```v // Example: HetznerManager pub fn (mut h HetznerManager) connection() !&httpconnection.HTTPConnection { - mut c := h.conn or { - mut c2 := httpconnection.new( - name: 'hetzner_${h.name}' - url: h.baseurl - cache: true - retry: 3 - )! - c2.basic_auth(h.user, h.password) - c2 - } - return c + mut c := h.conn or { + mut c2 := httpconnection.new( + name: 'hetzner_${h.name}' + url: h.baseurl + cache: true + retry: 3 + )! + c2.basic_auth(h.user, h.password) + c2 + } + return c } ``` @@ -274,12 +273,12 @@ user := conn.get_json_generic[User]( ``` -# OSAL Core Module - SYSTEM TOOLS OS - Key Capabilities (freeflowuniverse.herolib.osal.core) +# OSAL Core Module - SYSTEM TOOLS OS - Key Capabilities (incubaid.herolib.osal.core) ```v //example how to get started -import freeflowuniverse.herolib.osal.core as osal +import incubaid.herolib.osal.core as osal job := osal.exec(cmd: 'ls /')! ``` @@ -288,73 +287,73 @@ This document describes the core functionalities of the Operating System Abstrac ## 1. Process Execution -* **`osal.exec(cmd: Command) !Job`**: Execute a shell command. - * **Key Parameters**: `cmd` (string), `timeout` (int), `retry` (int), `work_folder` (string), `environment` (map[string]string), `stdout` (bool), `raise_error` (bool). - * **Returns**: `Job` (status, output, error, exit code). -* **`osal.execute_silent(cmd string) !string`**: Execute silently, return output. -* **`osal.execute_debug(cmd string) !string`**: Execute with debug output, return output. -* **`osal.execute_stdout(cmd string) !string`**: Execute and print output to stdout, return output. -* **`osal.execute_interactive(cmd string) !`**: Execute in an interactive shell. -* **`osal.cmd_exists(cmd string) bool`**: Check if a command exists. +- **`osal.exec(cmd: Command) !Job`**: Execute a shell command. + - **Key Parameters**: `cmd` (string), `timeout` (int), `retry` (int), `work_folder` (string), `environment` (map[string]string), `stdout` (bool), `raise_error` (bool). + - **Returns**: `Job` (status, output, error, exit code). +- **`osal.execute_silent(cmd string) !string`**: Execute silently, return output. +- **`osal.execute_debug(cmd string) !string`**: Execute with debug output, return output. +- **`osal.execute_stdout(cmd string) !string`**: Execute and print output to stdout, return output. +- **`osal.execute_interactive(cmd string) !`**: Execute in an interactive shell. +- **`osal.cmd_exists(cmd string) bool`**: Check if a command exists. ## 2. Network Utilities -* **`osal.ping(args: PingArgs) !bool`**: Check host reachability. - - address string = "8.8.8.8" - - nr_ping u16 = 3 // amount of ping requests we will do - - nr_ok u16 = 3 //how many of them need to be ok - - retry u8 //how many times fo we retry above sequence, basically we ping ourselves with -c 1 +- **`osal.ping(args: PingArgs) !bool`**: Check host reachability. + - address string = "8.8.8.8" + - nr_ping u16 = 3 // amount of ping requests we will do + - nr_ok u16 = 3 //how many of them need to be ok + - retry u8 //how many times fo we retry above sequence, basically we ping ourselves with -c 1 **`osal.ipaddr_pub_get() !string`**: Get public IP address. ## 3. File System Operations -* **`osal.file_write(path string, text string) !`**: Write text to a file. -* **`osal.file_read(path string) !string`**: Read content from a file. -* **`osal.dir_ensure(path string) !`**: Ensure a directory exists. -* **`osal.rm(todelete string) !`**: Remove files/directories. +- **`osal.file_write(path string, text string) !`**: Write text to a file. +- **`osal.file_read(path string) !string`**: Read content from a file. +- **`osal.dir_ensure(path string) !`**: Ensure a directory exists. +- **`osal.rm(todelete string) !`**: Remove files/directories. ## 4. Environment Variables -* **`osal.env_set(args: EnvSet)`**: Set an environment variable. - * **Key Parameters**: `key` (string), `value` (string). -* **`osal.env_unset(key string)`**: Unset a specific environment variable. -* **`osal.env_unset_all()`**: Unset all environment variables. -* **`osal.env_set_all(args: EnvSetAll)`**: Set multiple environment variables. - * **Key Parameters**: `env` (map[string]string), `clear_before_set` (bool), `overwrite_if_exists` (bool). -* **`osal.env_get(key string) !string`**: Get an environment variable's value. -* **`osal.env_exists(key string) !bool`**: Check if an environment variable exists. -* **`osal.env_get_default(key string, def string) string`**: Get an environment variable or a default value. -* **`osal.load_env_file(file_path string) !`**: Load variables from a file. +- **`osal.env_set(args: EnvSet)`**: Set an environment variable. + - **Key Parameters**: `key` (string), `value` (string). +- **`osal.env_unset(key string)`**: Unset a specific environment variable. +- **`osal.env_unset_all()`**: Unset all environment variables. +- **`osal.env_set_all(args: EnvSetAll)`**: Set multiple environment variables. + - **Key Parameters**: `env` (map[string]string), `clear_before_set` (bool), `overwrite_if_exists` (bool). +- **`osal.env_get(key string) !string`**: Get an environment variable's value. +- **`osal.env_exists(key string) !bool`**: Check if an environment variable exists. +- **`osal.env_get_default(key string, def string) string`**: Get an environment variable or a default value. +- **`osal.load_env_file(file_path string) !`**: Load variables from a file. ## 5. Command & Profile Management -* **`osal.cmd_add(args: CmdAddArgs) !`**: Add a binary to system paths and update profiles. - * **Key Parameters**: `source` (string, required), `cmdname` (string). -* **`osal.profile_path_add_remove(args: ProfilePathAddRemoveArgs) !`**: Add/remove paths from profiles. - * **Key Parameters**: `paths2add` (string), `paths2delete` (string). +- **`osal.cmd_add(args: CmdAddArgs) !`**: Add a binary to system paths and update profiles. + - **Key Parameters**: `source` (string, required), `cmdname` (string). +- **`osal.profile_path_add_remove(args: ProfilePathAddRemoveArgs) !`**: Add/remove paths from profiles. + - **Key Parameters**: `paths2add` (string), `paths2delete` (string). ## 6. System Information & Utilities -* **`osal.processmap_get() !ProcessMap`**: Get a map of all running processes. -* **`osal.processinfo_get(pid int) !ProcessInfo`**: Get detailed information for a specific process. -* **`osal.processinfo_get_byname(name string) ![]ProcessInfo`**: Get info for processes matching a name. -* **`osal.process_exists(pid int) bool`**: Check if a process exists by PID. -* **`osal.processinfo_with_children(pid int) !ProcessMap`**: Get a process and its children. -* **`osal.processinfo_children(pid int) !ProcessMap`**: Get children of a process. -* **`osal.process_kill_recursive(args: ProcessKillArgs) !`**: Kill a process and its children. - * **Key Parameters**: `name` (string), `pid` (int). -* **`osal.whoami() !string`**: Return the current username. -* **`osal.platform() !PlatformType`**: Identify the operating system. -* **`osal.cputype() !CPUType`**: Identify the CPU architecture. -* **`osal.hostname() !string`**: Get system hostname. -* **`osal.sleep(duration int)`**: Pause execution for a specified duration. -* **`osal.download(args: DownloadArgs) !pathlib.Path`**: Download a file from a URL. - * `pathlib.Path` is from `freeflowuniverse.herolib.core.pathlib` - * **Key Parameters**: `url` (string), `dest` (string), `timeout` (int), `retry` (int). -* **`osal.user_exists(username string) bool`**: Check if a user exists. -* **`osal.user_id_get(username string) !int`**: Get user ID. -* **`osal.user_add(args: UserArgs) !int`**: Add a user. - * **Key Parameters**: `name` (string). +- **`osal.processmap_get() !ProcessMap`**: Get a map of all running processes. +- **`osal.processinfo_get(pid int) !ProcessInfo`**: Get detailed information for a specific process. +- **`osal.processinfo_get_byname(name string) ![]ProcessInfo`**: Get info for processes matching a name. +- **`osal.process_exists(pid int) bool`**: Check if a process exists by PID. +- **`osal.processinfo_with_children(pid int) !ProcessMap`**: Get a process and its children. +- **`osal.processinfo_children(pid int) !ProcessMap`**: Get children of a process. +- **`osal.process_kill_recursive(args: ProcessKillArgs) !`**: Kill a process and its children. + - **Key Parameters**: `name` (string), `pid` (int). +- **`osal.whoami() !string`**: Return the current username. +- **`osal.platform() !PlatformType`**: Identify the operating system. +- **`osal.cputype() !CPUType`**: Identify the CPU architecture. +- **`osal.hostname() !string`**: Get system hostname. +- **`osal.sleep(duration int)`**: Pause execution for a specified duration. +- **`osal.download(args: DownloadArgs) !pathlib.Path`**: Download a file from a URL. + - `pathlib.Path` is from `incubaid.herolib.core.pathlib` + - **Key Parameters**: `url` (string), `dest` (string), `timeout` (int), `retry` (int). +- **`osal.user_exists(username string) bool`**: Check if a user exists. +- **`osal.user_id_get(username string) !int`**: Get user ID. +- **`osal.user_add(args: UserArgs) !int`**: Add a user. + - **Key Parameters**: `name` (string). ``` @@ -372,7 +371,7 @@ The `OurTime` module in V provides flexible time handling, supporting relative a ## Basic Usage ```v -import freeflowuniverse.herolib.data.ourtime +import incubaid.herolib.data.ourtime // Current time mut t := ourtime.now() @@ -460,7 +459,7 @@ This document details the `paramsparser` module, essential for handling paramete ## Obtaining a `paramsparser` Instance ```v -import freeflowuniverse.herolib.data.paramsparser +import incubaid.herolib.data.paramsparser // Create new params from a string params := paramsparser.new("color:red size:'large' priority:1 enable:true")! @@ -474,12 +473,13 @@ params.set("color", "red") The parser supports various input formats: -1. **Key-value pairs**: `key:value` -2. **Quoted values**: `key:'value with spaces'` (single or double quotes) -3. **Arguments without keys**: `arg1 arg2` (accessed by index) -4. **Comments**: `// this is a comment` (ignored during parsing) +1. **Key-value pairs**: `key:value` +2. **Quoted values**: `key:'value with spaces'` (single or double quotes) +3. **Arguments without keys**: `arg1 arg2` (accessed by index) +4. **Comments**: `// this is a comment` (ignored during parsing) Example: + ```v text := "name:'John Doe' age:30 active:true // user details" params := paramsparser.new(text)! @@ -491,77 +491,77 @@ The `paramsparser` module provides a comprehensive set of methods for retrieving ### Basic Retrieval -- `get(key string) !string`: Retrieves a string value by key. Returns an error if the key does not exist. -- `get_default(key string, defval string) !string`: Retrieves a string value by key, or returns `defval` if the key is not found. -- `exists(key string) bool`: Checks if a keyword argument (`key:value`) exists. -- `exists_arg(key string) bool`: Checks if an argument (value without a key) exists. +- `get(key string) !string`: Retrieves a string value by key. Returns an error if the key does not exist. +- `get_default(key string, defval string) !string`: Retrieves a string value by key, or returns `defval` if the key is not found. +- `exists(key string) bool`: Checks if a keyword argument (`key:value`) exists. +- `exists_arg(key string) bool`: Checks if an argument (value without a key) exists. ### Argument Retrieval (Positional) -- `get_arg(nr int) !string`: Retrieves an argument by its 0-based index. Returns an error if the index is out of bounds. -- `get_arg_default(nr int, defval string) !string`: Retrieves an argument by index, or returns `defval` if the index is out of bounds. +- `get_arg(nr int) !string`: Retrieves an argument by its 0-based index. Returns an error if the index is out of bounds. +- `get_arg_default(nr int, defval string) !string`: Retrieves an argument by index, or returns `defval` if the index is out of bounds. ### Type-Specific Retrieval -- `get_int(key string) !int`: Converts and retrieves an integer (int32). -- `get_int_default(key string, defval int) !int`: Retrieves an integer with a default. -- `get_u32(key string) !u32`: Converts and retrieves an unsigned 32-bit integer. -- `get_u32_default(key string, defval u32) !u32`: Retrieves a u32 with a default. -- `get_u64(key string) !u64`: Converts and retrieves an unsigned 64-bit integer. -- `get_u64_default(key string, defval u64) !u64`: Retrieves a u64 with a default. -- `get_u8(key string) !u8`: Converts and retrieves an unsigned 8-bit integer. -- `get_u8_default(key string, defval u8) !u8`: Retrieves a u8 with a default. -- `get_float(key string) !f64`: Converts and retrieves a 64-bit float. -- `get_float_default(key string, defval f64) !f64`: Retrieves a float with a default. -- `get_percentage(key string) !f64`: Converts a percentage string (e.g., "80%") to a float (0.8). -- `get_percentage_default(key string, defval string) !f64`: Retrieves a percentage with a default. +- `get_int(key string) !int`: Converts and retrieves an integer (int32). +- `get_int_default(key string, defval int) !int`: Retrieves an integer with a default. +- `get_u32(key string) !u32`: Converts and retrieves an unsigned 32-bit integer. +- `get_u32_default(key string, defval u32) !u32`: Retrieves a u32 with a default. +- `get_u64(key string) !u64`: Converts and retrieves an unsigned 64-bit integer. +- `get_u64_default(key string, defval u64) !u64`: Retrieves a u64 with a default. +- `get_u8(key string) !u8`: Converts and retrieves an unsigned 8-bit integer. +- `get_u8_default(key string, defval u8) !u8`: Retrieves a u8 with a default. +- `get_float(key string) !f64`: Converts and retrieves a 64-bit float. +- `get_float_default(key string, defval f64) !f64`: Retrieves a float with a default. +- `get_percentage(key string) !f64`: Converts a percentage string (e.g., "80%") to a float (0.8). +- `get_percentage_default(key string, defval string) !f64`: Retrieves a percentage with a default. ### Boolean Retrieval -- `get_default_true(key string) bool`: Returns `true` if the value is empty, "1", "true", "y", or "yes". Otherwise `false`. -- `get_default_false(key string) bool`: Returns `false` if the value is empty, "0", "false", "n", or "no". Otherwise `true`. +- `get_default_true(key string) bool`: Returns `true` if the value is empty, "1", "true", "y", or "yes". Otherwise `false`. +- `get_default_false(key string) bool`: Returns `false` if the value is empty, "0", "false", "n", or "no". Otherwise `true`. ### List Retrieval Lists are typically comma-separated strings (e.g., `users: "john,jane,bob"`). -- `get_list(key string) ![]string`: Retrieves a list of strings. -- `get_list_default(key string, def []string) ![]string`: Retrieves a list of strings with a default. -- `get_list_int(key string) ![]int`: Retrieves a list of integers. -- `get_list_int_default(key string, def []int) []int`: Retrieves a list of integers with a default. -- `get_list_f32(key string) ![]f32`: Retrieves a list of 32-bit floats. -- `get_list_f32_default(key string, def []f32) []f32`: Retrieves a list of f32 with a default. -- `get_list_f64(key string) ![]f64`: Retrieves a list of 64-bit floats. -- `get_list_f64_default(key string, def []f64) []f64`: Retrieves a list of f64 with a default. -- `get_list_i8(key string) ![]i8`: Retrieves a list of 8-bit signed integers. -- `get_list_i8_default(key string, def []i8) []i8`: Retrieves a list of i8 with a default. -- `get_list_i16(key string) ![]i16`: Retrieves a list of 16-bit signed integers. -- `get_list_i16_default(key string, def []i16) []i16`: Retrieves a list of i16 with a default. -- `get_list_i64(key string) ![]i64`: Retrieves a list of 64-bit signed integers. -- `get_list_i64_default(key string, def []i64) []i64`: Retrieves a list of i64 with a default. -- `get_list_u16(key string) ![]u16`: Retrieves a list of 16-bit unsigned integers. -- `get_list_u16_default(key string, def []u16) []u16`: Retrieves a list of u16 with a default. -- `get_list_u32(key string) ![]u32`: Retrieves a list of 32-bit unsigned integers. -- `get_list_u32_default(key string, def []u32) []u32`: Retrieves a list of u32 with a default. -- `get_list_u64(key string) ![]u64`: Retrieves a list of 64-bit unsigned integers. -- `get_list_u64_default(key string, def []u64) []u64`: Retrieves a list of u64 with a default. -- `get_list_namefix(key string) ![]string`: Retrieves a list of strings, normalizing each item (e.g., "My Name" -> "my_name"). -- `get_list_namefix_default(key string, def []string) ![]string`: Retrieves a list of name-fixed strings with a default. +- `get_list(key string) ![]string`: Retrieves a list of strings. +- `get_list_default(key string, def []string) ![]string`: Retrieves a list of strings with a default. +- `get_list_int(key string) ![]int`: Retrieves a list of integers. +- `get_list_int_default(key string, def []int) []int`: Retrieves a list of integers with a default. +- `get_list_f32(key string) ![]f32`: Retrieves a list of 32-bit floats. +- `get_list_f32_default(key string, def []f32) []f32`: Retrieves a list of f32 with a default. +- `get_list_f64(key string) ![]f64`: Retrieves a list of 64-bit floats. +- `get_list_f64_default(key string, def []f64) []f64`: Retrieves a list of f64 with a default. +- `get_list_i8(key string) ![]i8`: Retrieves a list of 8-bit signed integers. +- `get_list_i8_default(key string, def []i8) []i8`: Retrieves a list of i8 with a default. +- `get_list_i16(key string) ![]i16`: Retrieves a list of 16-bit signed integers. +- `get_list_i16_default(key string, def []i16) []i16`: Retrieves a list of i16 with a default. +- `get_list_i64(key string) ![]i64`: Retrieves a list of 64-bit signed integers. +- `get_list_i64_default(key string, def []i64) []i64`: Retrieves a list of i64 with a default. +- `get_list_u16(key string) ![]u16`: Retrieves a list of 16-bit unsigned integers. +- `get_list_u16_default(key string, def []u16) []u16`: Retrieves a list of u16 with a default. +- `get_list_u32(key string) ![]u32`: Retrieves a list of 32-bit unsigned integers. +- `get_list_u32_default(key string, def []u32) []u32`: Retrieves a list of u32 with a default. +- `get_list_u64(key string) ![]u64`: Retrieves a list of 64-bit unsigned integers. +- `get_list_u64_default(key string, def []u64) []u64`: Retrieves a list of u64 with a default. +- `get_list_namefix(key string) ![]string`: Retrieves a list of strings, normalizing each item (e.g., "My Name" -> "my_name"). +- `get_list_namefix_default(key string, def []string) ![]string`: Retrieves a list of name-fixed strings with a default. ### Specialized Retrieval -- `get_map() map[string]string`: Returns all parameters as a map. -- `get_path(key string) !string`: Retrieves a path string. -- `get_path_create(key string) !string`: Retrieves a path string, creating the directory if it doesn't exist. -- `get_from_hashmap(key string, defval string, hashmap map[string]string) !string`: Retrieves a value from a provided hashmap based on the parameter's value. -- `get_storagecapacity_in_bytes(key string) !u64`: Converts storage capacity strings (e.g., "10 GB", "500 MB") to bytes (u64). -- `get_storagecapacity_in_bytes_default(key string, defval u64) !u64`: Retrieves storage capacity in bytes with a default. -- `get_storagecapacity_in_gigabytes(key string) !u64`: Converts storage capacity strings to gigabytes (u64). -- `get_time(key string) !ourtime.OurTime`: Parses a time string (relative or absolute) into an `ourtime.OurTime` object. -- `get_time_default(key string, defval ourtime.OurTime) !ourtime.OurTime`: Retrieves time with a default. -- `get_time_interval(key string) !Duration`: Parses a time interval string into a `Duration` object. -- `get_timestamp(key string) !Duration`: Parses a timestamp string into a `Duration` object. -- `get_timestamp_default(key string, defval Duration) !Duration`: Retrieves a timestamp with a default. +- `get_map() map[string]string`: Returns all parameters as a map. +- `get_path(key string) !string`: Retrieves a path string. +- `get_path_create(key string) !string`: Retrieves a path string, creating the directory if it doesn't exist. +- `get_from_hashmap(key string, defval string, hashmap map[string]string) !string`: Retrieves a value from a provided hashmap based on the parameter's value. +- `get_storagecapacity_in_bytes(key string) !u64`: Converts storage capacity strings (e.g., "10 GB", "500 MB") to bytes (u64). +- `get_storagecapacity_in_bytes_default(key string, defval u64) !u64`: Retrieves storage capacity in bytes with a default. +- `get_storagecapacity_in_gigabytes(key string) !u64`: Converts storage capacity strings to gigabytes (u64). +- `get_time(key string) !ourtime.OurTime`: Parses a time string (relative or absolute) into an `ourtime.OurTime` object. +- `get_time_default(key string, defval ourtime.OurTime) !ourtime.OurTime`: Retrieves time with a default. +- `get_time_interval(key string) !Duration`: Parses a time interval string into a `Duration` object. +- `get_timestamp(key string) !Duration`: Parses a timestamp string into a `Duration` object. +- `get_timestamp_default(key string, defval Duration) !Duration`: Retrieves a timestamp with a default. ``` @@ -582,7 +582,7 @@ The pathlib module provides a comprehensive interface for handling file system o ### Importing pathlib ```v -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib ``` ### Creating Path Objects @@ -600,6 +600,7 @@ mut dir_path := pathlib.get("path/to/directory") if you know in advance if you expect a dir or file its better to use `pathlib.get_dir(path:...,create:true)` or `pathlib.get_file(path:...,create:true)`. ### Basic Path Operations + ```v // Get absolute path abs_path := file_path.absolute() @@ -616,6 +617,7 @@ if file_path.exists() { ## Path Properties and Methods ### Path Types + ```v // Check if path is a file if file_path.is_file() { @@ -634,6 +636,7 @@ if file_path.is_link() { ``` ### Path Normalization + ```v // Normalize path (remove extra slashes, resolve . and ..) normalized_path := file_path.path_normalize() @@ -648,6 +651,7 @@ name_no_ext := file_path.name_no_ext() ## File and Directory Operations ### File Operations + ```v // Write to file file_path.write("Content to write")! @@ -660,6 +664,7 @@ file_path.delete()! ``` ### Directory Operations + ```v // Create directory mut dir := pathlib.get_dir( @@ -675,6 +680,7 @@ dir.delete()! ``` ### Symlink Operations + ```v // Create symlink file_path.link("path/to/symlink", delete_exists: true)! @@ -686,12 +692,14 @@ real_path := file_path.realpath() ## Advanced Operations ### Path Copying + ```v // Copy file to destination file_path.copy(dest: "path/to/destination")! ``` ### Recursive Operations + ```v // List directory recursively mut recursive_list := dir.list(recursive: true)! @@ -701,6 +709,7 @@ dir.delete()! ``` ### Path Filtering + ```v // List files matching pattern mut filtered_list := dir.list( @@ -712,6 +721,7 @@ mut filtered_list := dir.list( ## Best Practices ### Error Handling + ```v if file_path.exists() { // Safe to operate @@ -726,17 +736,17 @@ The `redisclient` module in Herolib provides a comprehensive client for interact ## Key Features -- **Direct Redis Commands**: Access to a wide range of Redis commands (strings, hashes, lists, keys, etc.). -- **Caching**: Built-in caching mechanism with namespace support and expiration. -- **Queues**: Simple queue implementation using Redis lists. -- **RPC**: Remote Procedure Call (RPC) functionality over Redis queues for inter-service communication. +- **Direct Redis Commands**: Access to a wide range of Redis commands (strings, hashes, lists, keys, etc.). +- **Caching**: Built-in caching mechanism with namespace support and expiration. +- **Queues**: Simple queue implementation using Redis lists. +- **RPC**: Remote Procedure Call (RPC) functionality over Redis queues for inter-service communication. ## Basic Usage To get a Redis client instance, use `redisclient.core_get()`. By default, it connects to `127.0.0.1:6379`. You can specify a different address and port using the `RedisURL` struct. ```v -import freeflowuniverse.herolib.core.redisclient +import incubaid.herolib.core.redisclient // Connect to default Redis instance (127.0.0.1:6379) mut redis := redisclient.core_get()! @@ -764,13 +774,13 @@ The `Redis` object provides methods for most standard Redis commands. Here are s ### String Commands -- `set(key string, value string) !`: Sets the string value of a key. -- `get(key string) !string`: Gets the string value of a key. -- `set_ex(key string, value string, ex string) !`: Sets a key with an expiration time in seconds. -- `incr(key string) !int`: Increments the integer value of a key by one. -- `decr(key string) !int`: Decrements the integer value of a key by one. -- `append(key string, value string) !int`: Appends a value to a key. -- `strlen(key string) !int`: Gets the length of the value stored in a key. +- `set(key string, value string) !`: Sets the string value of a key. +- `get(key string) !string`: Gets the string value of a key. +- `set_ex(key string, value string, ex string) !`: Sets a key with an expiration time in seconds. +- `incr(key string) !int`: Increments the integer value of a key by one. +- `decr(key string) !int`: Decrements the integer value of a key by one. +- `append(key string, value string) !int`: Appends a value to a key. +- `strlen(key string) !int`: Gets the length of the value stored in a key. ```v redis.set('counter', '10')! @@ -780,11 +790,11 @@ val := redis.get('counter')! // "11" ### Hash Commands -- `hset(key string, skey string, value string) !`: Sets the string value of a hash field. -- `hget(key string, skey string) !string`: Gets the value of a hash field. -- `hgetall(key string) !map[string]string`: Gets all fields and values in a hash. -- `hexists(key string, skey string) !bool`: Checks if a hash field exists. -- `hdel(key string, skey string) !int`: Deletes one or more hash fields. +- `hset(key string, skey string, value string) !`: Sets the string value of a hash field. +- `hget(key string, skey string) !string`: Gets the value of a hash field. +- `hgetall(key string) !map[string]string`: Gets all fields and values in a hash. +- `hexists(key string, skey string) !bool`: Checks if a hash field exists. +- `hdel(key string, skey string) !int`: Deletes one or more hash fields. ```v redis.hset('user:1', 'name', 'John Doe')! @@ -795,12 +805,12 @@ user_data := redis.hgetall('user:1')! // map['name':'John Doe', 'email':'john/@e ### List Commands -- `lpush(key string, element string) !int`: Inserts all specified values at the head of the list stored at key. -- `rpush(key string, element string) !int`: Inserts all specified values at the tail of the list stored at key. -- `lpop(key string) !string`: Removes and returns the first element of the list stored at key. -- `rpop(key string) !string`: Removes and returns the last element of the list stored at key. -- `llen(key string) !int`: Gets the length of a list. -- `lrange(key string, start int, end int) ![]resp.RValue`: Gets a range of elements from a list. +- `lpush(key string, element string) !int`: Inserts all specified values at the head of the list stored at key. +- `rpush(key string, element string) !int`: Inserts all specified values at the tail of the list stored at key. +- `lpop(key string) !string`: Removes and returns the first element of the list stored at key. +- `rpop(key string) !string`: Removes and returns the last element of the list stored at key. +- `llen(key string) !int`: Gets the length of a list. +- `lrange(key string, start int, end int) ![]resp.RValue`: Gets a range of elements from a list. ```v redis.lpush('mylist', 'item1')! @@ -810,8 +820,8 @@ first_item := redis.lpop('mylist')! // "item1" ### Set Commands -- `sadd(key string, members []string) !int`: Adds the specified members to the set stored at key. -- `smismember(key string, members []string) ![]int`: Returns if member is a member of the set stored at key. +- `sadd(key string, members []string) !int`: Adds the specified members to the set stored at key. +- `smismember(key string, members []string) ![]int`: Returns if member is a member of the set stored at key. ```v redis.sadd('myset', ['member1', 'member2'])! @@ -820,13 +830,13 @@ is_member := redis.smismember('myset', ['member1', 'member3'])! // [1, 0] ### Key Management -- `keys(pattern string) ![]string`: Finds all keys matching the given pattern. -- `del(key string) !int`: Deletes a key. -- `expire(key string, seconds int) !int`: Sets a key's time to live in seconds. -- `ttl(key string) !int`: Gets the time to live for a key in seconds. -- `flushall() !`: Deletes all the keys of all the existing databases. -- `flushdb() !`: Deletes all the keys of the currently selected database. -- `selectdb(database int) !`: Changes the selected database. +- `keys(pattern string) ![]string`: Finds all keys matching the given pattern. +- `del(key string) !int`: Deletes a key. +- `expire(key string, seconds int) !int`: Sets a key's time to live in seconds. +- `ttl(key string) !int`: Gets the time to live for a key in seconds. +- `flushall() !`: Deletes all the keys of all the existing databases. +- `flushdb() !`: Deletes all the keys of the currently selected database. +- `selectdb(database int) !`: Changes the selected database. ```v redis.set('temp_key', 'value')! @@ -838,7 +848,7 @@ redis.expire('temp_key', 60)! // Expires in 60 seconds The `RedisCache` struct provides a convenient way to implement caching using Redis. ```v -import freeflowuniverse.herolib.core.redisclient +import incubaid.herolib.core.redisclient mut redis := redisclient.core_get()! mut cache := redis.cache('my_app_cache') @@ -867,7 +877,7 @@ cache.reset()! The `RedisQueue` struct provides a simple queue mechanism using Redis lists. ```v -import freeflowuniverse.herolib.core.redisclient +import incubaid.herolib.core.redisclient import time mut redis := redisclient.core_get()! @@ -891,7 +901,7 @@ task2 := my_queue.pop()! The `RedisRpc` struct enables Remote Procedure Call (RPC) over Redis, allowing services to communicate by sending messages to queues and waiting for responses. ```v -import freeflowuniverse.herolib.core.redisclient +import incubaid.herolib.core.redisclient import json import time @@ -930,96 +940,124 @@ response := rpc_client.call( The `texttools` module provides a comprehensive set of utilities for text manipulation and processing. -## Functions and Examples: +## Functions and Examples ```v -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.texttools assert hello_world == texttools.name_fix("Hello World!") ``` + ### Name/Path Processing -* `name_fix(name string) string`: Normalizes filenames and paths. -* `name_fix_keepspace(name string) !string`: Like name_fix but preserves spaces. -* `name_fix_no_ext(name_ string) string`: Removes file extension. -* `name_fix_snake_to_pascal(name string) string`: Converts snake_case to PascalCase. + +* `name_fix(name string) string`: Normalizes filenames and paths. +- `name_fix_keepspace(name string) !string`: Like name_fix but preserves spaces. +- `name_fix_no_ext(name_ string) string`: Removes file extension. +- `name_fix_snake_to_pascal(name string) string`: Converts snake_case to PascalCase. + ```v name := texttools.name_fix_snake_to_pascal("hello_world") // Result: "HelloWorld" ``` -* `snake_case(name string) string`: Converts PascalCase to snake_case. + +* `snake_case(name string) string`: Converts PascalCase to snake_case. + ```v name := texttools.snake_case("HelloWorld") // Result: "hello_world" ``` -* `name_split(name string) !(string, string)`: Splits name into site and page components. +* `name_split(name string) !(string, string)`: Splits name into site and page components. ### Text Cleaning -* `name_clean(r string) string`: Normalizes names by removing special characters. + +* `name_clean(r string) string`: Normalizes names by removing special characters. + ```v name := texttools.name_clean("Hello/@World!") // Result: "HelloWorld" ``` -* `ascii_clean(r string) string`: Removes all non-ASCII characters. -* `remove_empty_lines(text string) string`: Removes empty lines from text. + +* `ascii_clean(r string) string`: Removes all non-ASCII characters. +- `remove_empty_lines(text string) string`: Removes empty lines from text. + ```v text := texttools.remove_empty_lines("line1\n\nline2\n\n\nline3") // Result: "line1\nline2\nline3" ``` -* `remove_double_lines(text string) string`: Removes consecutive empty lines. -* `remove_empty_js_blocks(text string) string`: Removes empty code blocks (```...```). + +* `remove_double_lines(text string) string`: Removes consecutive empty lines. +- `remove_empty_js_blocks(text string) string`: Removes empty code blocks (```...```). ### Command Line Parsing -* `cmd_line_args_parser(text string) ![]string`: Parses command line arguments with support for quotes and escaping. + +* `cmd_line_args_parser(text string) ![]string`: Parses command line arguments with support for quotes and escaping. + ```v args := texttools.cmd_line_args_parser("'arg with spaces' --flag=value") // Result: ['arg with spaces', '--flag=value'] ``` -* `text_remove_quotes(text string) string`: Removes quoted sections from text. -* `check_exists_outside_quotes(text string, items []string) bool`: Checks if items exist in text outside of quotes. + +* `text_remove_quotes(text string) string`: Removes quoted sections from text. +- `check_exists_outside_quotes(text string, items []string) bool`: Checks if items exist in text outside of quotes. ### Text Expansion -* `expand(txt_ string, l int, expand_with string) string`: Expands text to a specified length with a given character. + +* `expand(txt_ string, l int, expand_with string) string`: Expands text to a specified length with a given character. ### Indentation -* `indent(text string, prefix string) string`: Adds indentation prefix to each line. + +* `indent(text string, prefix string) string`: Adds indentation prefix to each line. + ```v text := texttools.indent("line1\nline2", " ") // Result: " line1\n line2\n" ``` -* `dedent(text string) string`: Removes common leading whitespace from every line. + +* `dedent(text string) string`: Removes common leading whitespace from every line. + ```v text := texttools.dedent(" line1\n line2") // Result: "line1\nline2" ``` ### String Validation -* `is_int(text string) bool`: Checks if text contains only digits. -* `is_upper_text(text string) bool`: Checks if text contains only uppercase letters. + +* `is_int(text string) bool`: Checks if text contains only digits. +- `is_upper_text(text string) bool`: Checks if text contains only uppercase letters. ### Multiline Processing -* `multiline_to_single(text string) !string`: Converts multiline text to a single line with proper escaping. + +* `multiline_to_single(text string) !string`: Converts multiline text to a single line with proper escaping. ### Text Splitting -* `split_smart(t string, delimiter_ string) []string`: Intelligent string splitting that respects quotes. + +* `split_smart(t string, delimiter_ string) []string`: Intelligent string splitting that respects quotes. ### Tokenization -* `tokenize(text_ string) TokenizerResult`: Tokenizes text into meaningful parts. -* `text_token_replace(text string, tofind string, replacewith string) !string`: Replaces tokens in text. + +* `tokenize(text_ string) TokenizerResult`: Tokenizes text into meaningful parts. +- `text_token_replace(text string, tofind string, replacewith string) !string`: Replaces tokens in text. ### Version Parsing -* `version(text_ string) int`: Converts version strings to comparable integers. + +* `version(text_ string) int`: Converts version strings to comparable integers. + ```v ver := texttools.version("v0.4.36") // Result: 4036 ver = texttools.version("v1.4.36") // Result: 1004036 ``` ### Formatting -* `format_rfc1123(t time.Time) string`: Formats a time.Time object into RFC 1123 format. - +* `format_rfc1123(t time.Time) string`: Formats a time.Time object into RFC 1123 format. + ### Array Operations -* `to_array(r string) []string`: Converts a comma or newline separated list to an array of strings. + +* `to_array(r string) []string`: Converts a comma or newline separated list to an array of strings. + ```v text := "item1,item2,item3" array := texttools.to_array(text) // Result: ['item1', 'item2', 'item3'] ``` -* `to_array_int(r string) []int`: Converts a text list to an array of integers. -* `to_map(mapstring string, line string, delimiter_ string) map[string]string`: Intelligent mapping of a line to a map based on a template. + +* `to_array_int(r string) []int`: Converts a text list to an array of integers. +- `to_map(mapstring string, line string, delimiter_ string) map[string]string`: Intelligent mapping of a line to a map based on a template. + ```v r := texttools.to_map("name,-,-,-,-,pid,-,-,-,-,path", "root 304 0.0 0.0 408185328 1360 ?? S 16Dec23 0:34.06 /usr/sbin/distnoted") @@ -1035,7 +1073,7 @@ has mechanisms to print better to console, see the methods below import as ```v -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console ``` @@ -1054,23 +1092,23 @@ fn color_fg(c ForegroundColor) string struct PrintArgs { pub mut: - foreground ForegroundColor - background BackgroundColor - text string - style Style - reset_before bool = true - reset_after bool = true + foreground ForegroundColor + background BackgroundColor + text string + style Style + reset_before bool = true + reset_after bool = true } fn cprint(args PrintArgs) // print with colors, reset... // ``` - // foreground ForegroundColor - // background BackgroundColor - // text string - // style Style - // reset_before bool = true - // reset_after bool = true + // foreground ForegroundColor + // background BackgroundColor + // text string + // style Style + // reset_before bool = true + // reset_after bool = true // ``` fn cprintln(args_ PrintArgs) @@ -1125,11 +1163,11 @@ Is used to ask feedback to users struct UIConsole { pub mut: - x_max int = 80 - y_max int = 60 - prev_lf bool - prev_title bool - prev_item bool + x_max int = 80 + y_max int = 60 + prev_lf bool + prev_title bool + prev_item bool } //DropDownArgs: @@ -1180,51 +1218,51 @@ fn (mut c UIConsole) status() string ```v enum BackgroundColor { - default_color = 49 // 'default' is a reserved keyword in V - black = 40 - red = 41 - green = 42 - yellow = 43 - blue = 44 - magenta = 45 - cyan = 46 - light_gray = 47 - dark_gray = 100 - light_red = 101 - light_green = 102 - light_yellow = 103 - light_blue = 104 - light_magenta = 105 - light_cyan = 106 - white = 107 + default_color = 49 // 'default' is a reserved keyword in V + black = 40 + red = 41 + green = 42 + yellow = 43 + blue = 44 + magenta = 45 + cyan = 46 + light_gray = 47 + dark_gray = 100 + light_red = 101 + light_green = 102 + light_yellow = 103 + light_blue = 104 + light_magenta = 105 + light_cyan = 106 + white = 107 } enum ForegroundColor { - default_color = 39 // 'default' is a reserved keyword in V - white = 97 - black = 30 - red = 31 - green = 32 - yellow = 33 - blue = 34 - magenta = 35 - cyan = 36 - light_gray = 37 - dark_gray = 90 - light_red = 91 - light_green = 92 - light_yellow = 93 - light_blue = 94 - light_magenta = 95 - light_cyan = 96 + default_color = 39 // 'default' is a reserved keyword in V + white = 97 + black = 30 + red = 31 + green = 32 + yellow = 33 + blue = 34 + magenta = 35 + cyan = 36 + light_gray = 37 + dark_gray = 90 + light_red = 91 + light_green = 92 + light_yellow = 93 + light_blue = 94 + light_magenta = 95 + light_cyan = 96 } enum Style { - normal = 99 - bold = 1 - dim = 2 - underline = 4 - blink = 5 - reverse = 7 - hidden = 8 + normal = 99 + bold = 1 + dim = 2 + underline = 4 + blink = 5 + reverse = 7 + hidden = 8 } ``` @@ -1236,7 +1274,7 @@ this is how we want example scripts to be, see the first line, always use like t ```v #!/usr/bin/env -S v -cg -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib... +import incubaid.herolib... ``` @@ -1248,7 +1286,6 @@ the files are in ~/code/github/incubaid/herolib/examples for herolib - always use the top line as in example above - these scripts can be executed as is but can also use vrun $pathOfFile - # V TEMPLATES V allows for easily using text templates, expanded at compile time to @@ -1371,7 +1408,7 @@ The include directive is for including other html files (which will be processed and consists of two parts, the `/@include` tag and a following `''` string. The path parameter is relative to the template file being called. -### Example for the folder structure of a project using templates: +### Example for the folder structure of a project using templates ``` Project root @@ -1391,7 +1428,6 @@ Project root > Note that there shouldn't be a file suffix, > it is automatically appended and only allows `html` files. - ## js The js directive consists of two parts, the `/@js` tag and `''` string, @@ -1401,7 +1437,7 @@ where you can insert your src /@js '' ``` -### Example for the /@js directive: +### Example for the /@js directive ```html /@js 'myscripts.js' @@ -1414,5 +1450,5 @@ It's also possible to use properties of structs here like `/@{my_struct.prop}`. # Escaping -The `/@` symbol starts a template directive. If you need to use `/@` as a regular +The `/@` symbol starts a template directive. If you need to use `/@` as a regular character within a template, escape it by using a double `/@` like this: `/@/@`. diff --git a/cli/hero.v b/cli/hero.v index fbb73f73..56dddb86 100644 --- a/cli/hero.v +++ b/cli/hero.v @@ -2,14 +2,14 @@ module main import os import cli { Command } -import freeflowuniverse.herolib.core.herocmds -import freeflowuniverse.herolib.installers.base -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.ui -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.core -import freeflowuniverse.herolib.core.playbook -import freeflowuniverse.herolib.core.playcmds +import incubaid.herolib.core.herocmds +import incubaid.herolib.installers.base +import incubaid.herolib.ui.console +import incubaid.herolib.ui +import incubaid.herolib.osal.core as osal +import incubaid.herolib.core +import incubaid.herolib.core.playbook +import incubaid.herolib.core.playcmds fn playcmds_do(path string) ! { mut plbook := playbook.new(path: path)! @@ -38,7 +38,8 @@ fn do() ! { if os.args.len == 2 { mypath := os.args[1] - if mypath.to_lower().ends_with('.hero') || mypath.to_lower().ends_with('.heroscript') || mypath.to_lower().ends_with('.hs') { + if mypath.to_lower().ends_with('.hero') || mypath.to_lower().ends_with('.heroscript') + || mypath.to_lower().ends_with('.hs') { // hero was called from a file playcmds_do(mypath)! return @@ -103,4 +104,4 @@ fn main() { // fn pre_func(cmd Command) ! { // herocmds.plbook_run(cmd)! -// } \ No newline at end of file +// } diff --git a/cli/vdo.v b/cli/vdo.v index 894247a0..9b3cf059 100644 --- a/cli/vdo.v +++ b/cli/vdo.v @@ -1,6 +1,6 @@ module main -import freeflowuniverse.herolib.mcp.v_do +import incubaid.herolib.mcp.v_do fn main() { // Create and start the MCP server diff --git a/docker/herolib/scripts/install_herolib.vsh b/docker/herolib/scripts/install_herolib.vsh index 3806ec87..acba9584 100755 --- a/docker/herolib/scripts/install_herolib.vsh +++ b/docker/herolib/scripts/install_herolib.vsh @@ -51,8 +51,8 @@ println('Resetting all symlinks...') os.rm('${os.home_dir()}/.vmodules/incubaid/herolib') or {} // Create necessary directories -os.mkdir_all('${os.home_dir()}/.vmodules/freeflowuniverse') or { - panic('Failed to create directory ~/.vmodules/freeflowuniverse: ${err}') +os.mkdir_all('${os.home_dir()}/.vmodules/incubaid') or { + panic('Failed to create directory ~/.vmodules/incubaid: ${err}') } // Create new symlinks diff --git a/docker/herolib/scripts/install_v.sh b/docker/herolib/scripts/install_v.sh index 10ae5829..2ff5db67 100755 --- a/docker/herolib/scripts/install_v.sh +++ b/docker/herolib/scripts/install_v.sh @@ -224,7 +224,7 @@ function hero_lib_get { hero_lib_pull else pushd $DIR_CODE/github/incubaid 2>&1 >> /dev/null - git clone --depth 1 --no-single-branch https://github.com/freeflowuniverse/herolib.git + git clone --depth 1 --no-single-branch https://github.com/incubaid/herolib.git popd 2>&1 >> /dev/null fi } diff --git a/examples/aiexamples/groq.vsh b/examples/aiexamples/groq.vsh index bdf753d1..eb4e5c57 100755 --- a/examples/aiexamples/groq.vsh +++ b/examples/aiexamples/groq.vsh @@ -2,7 +2,7 @@ module main -import freeflowuniverse.herolib.clients.openai +import incubaid.herolib.clients.openai import os fn test1(mut client openai.OpenAI) ! { diff --git a/examples/aiexamples/jetconvertor.vsh b/examples/aiexamples/jetconvertor.vsh index ec9cede8..7dae6904 100755 --- a/examples/aiexamples/jetconvertor.vsh +++ b/examples/aiexamples/jetconvertor.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.mcp.aitools +import incubaid.herolib.mcp.aitools // aitools.convert_pug("/root/code/github/incubaid/herolauncher/pkg/herolauncher/web/templates/admin")! diff --git a/examples/aiexamples/jina.vsh b/examples/aiexamples/jina.vsh index ea430db1..5cda6f48 100755 --- a/examples/aiexamples/jina.vsh +++ b/examples/aiexamples/jina.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.clients.jina +import incubaid.herolib.clients.jina mut jina_client := jina.get()! health := jina_client.health()! diff --git a/examples/aiexamples/qdrant.vsh b/examples/aiexamples/qdrant.vsh index 565025da..101ba090 100755 --- a/examples/aiexamples/qdrant.vsh +++ b/examples/aiexamples/qdrant.vsh @@ -1,8 +1,8 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.clients.qdrant -import freeflowuniverse.herolib.installers.db.qdrant_installer -import freeflowuniverse.herolib.core.httpconnection +import incubaid.herolib.clients.qdrant +import incubaid.herolib.installers.db.qdrant_installer +import incubaid.herolib.core.httpconnection import rand import os diff --git a/examples/alpine_example.vsh b/examples/alpine_example.vsh index 9be0f17d..b1841639 100755 --- a/examples/alpine_example.vsh +++ b/examples/alpine_example.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.hero.bootstrap +import incubaid.herolib.hero.bootstrap mut al := bootstrap.new_alpine_loader() diff --git a/examples/biztools/_archive/investor_tool.vsh b/examples/biztools/_archive/investor_tool.vsh index 126ed3cb..72013deb 100755 --- a/examples/biztools/_archive/investor_tool.vsh +++ b/examples/biztools/_archive/investor_tool.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -gc none -no-retry-compilation -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.biz.investortool -import freeflowuniverse.herolib.core.playbook +import incubaid.herolib.biz.investortool +import incubaid.herolib.core.playbook import os mut plbook := playbook.new( diff --git a/examples/biztools/_archive/tf9_biz.vsh b/examples/biztools/_archive/tf9_biz.vsh index fc58d98f..e2b39530 100755 --- a/examples/biztools/_archive/tf9_biz.vsh +++ b/examples/biztools/_archive/tf9_biz.vsh @@ -1,13 +1,13 @@ #!/usr/bin/env -S v -cg -gc none -no-retry-compilation -cc tcc -d use_openssl -enable-globals run // #!/usr/bin/env -S v -cg -enable-globals run -import freeflowuniverse.herolib.data.doctree -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.biz.bizmodel -import freeflowuniverse.herolib.core.playbook -import freeflowuniverse.herolib.core.playcmds -import freeflowuniverse.herolib.web.mdbook -import freeflowuniverse.herolib.biz.spreadsheet +import incubaid.herolib.data.doctree +import incubaid.herolib.ui.console +import incubaid.herolib.biz.bizmodel +import incubaid.herolib.core.playbook +import incubaid.herolib.core.playcmds +import incubaid.herolib.web.mdbook +import incubaid.herolib.biz.spreadsheet import os const name = 'tf9_budget' diff --git a/examples/biztools/bizmodel.vsh b/examples/biztools/bizmodel.vsh index a3bd9c6c..762b5820 100755 --- a/examples/biztools/bizmodel.vsh +++ b/examples/biztools/bizmodel.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -cg -gc none -no-retry-compilation -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.biz.bizmodel +import incubaid.herolib.biz.bizmodel import os const playbook_path = os.dir(@FILE) + '/playbook' diff --git a/examples/biztools/bizmodel1.vsh b/examples/biztools/bizmodel1.vsh index fbf295dc..15107cbc 100755 --- a/examples/biztools/bizmodel1.vsh +++ b/examples/biztools/bizmodel1.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -cg -gc none -no-retry-compilation -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.biz.bizmodel -import freeflowuniverse.herolib.core.playbook +import incubaid.herolib.biz.bizmodel +import incubaid.herolib.core.playbook import os heroscript := " diff --git a/examples/biztools/bizmodel2.vsh b/examples/biztools/bizmodel2.vsh index b4d30946..bb7285e2 100755 --- a/examples/biztools/bizmodel2.vsh +++ b/examples/biztools/bizmodel2.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -cg -gc none -no-retry-compilation -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.biz.bizmodel -import freeflowuniverse.herolib.core.playbook +import incubaid.herolib.biz.bizmodel +import incubaid.herolib.core.playbook import os heroscript := " diff --git a/examples/biztools/bizmodel_complete.vsh b/examples/biztools/bizmodel_complete.vsh index 32da1bab..0a54ed2e 100755 --- a/examples/biztools/bizmodel_complete.vsh +++ b/examples/biztools/bizmodel_complete.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.biz.bizmodel -import freeflowuniverse.herolib.core.playbook +import incubaid.herolib.biz.bizmodel +import incubaid.herolib.core.playbook import os heroscript_path := os.join_path(os.dir(@FILE), 'examples/complete.heroscript') diff --git a/examples/biztools/bizmodel_export.vsh b/examples/biztools/bizmodel_export.vsh index ba43fa34..a57b9482 100755 --- a/examples/biztools/bizmodel_export.vsh +++ b/examples/biztools/bizmodel_export.vsh @@ -1,8 +1,8 @@ #!/usr/bin/env -S v -n -w -cg -gc none -no-retry-compilation -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.biz.bizmodel -import freeflowuniverse.herolib.core.playbook -import freeflowuniverse.herolib.core.playcmds +import incubaid.herolib.biz.bizmodel +import incubaid.herolib.core.playbook +import incubaid.herolib.core.playcmds import os heroscript_path := os.join_path(os.dir(@FILE), 'examples/complete.heroscript') diff --git a/examples/biztools/bizmodel_full.vsh b/examples/biztools/bizmodel_full.vsh index 073a4dc7..2944f23c 100755 --- a/examples/biztools/bizmodel_full.vsh +++ b/examples/biztools/bizmodel_full.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.biz.bizmodel -import freeflowuniverse.herolib.core.playbook +import incubaid.herolib.biz.bizmodel +import incubaid.herolib.core.playbook import os heroscript_path := os.join_path(os.dir(@FILE), 'examples/full') diff --git a/examples/biztools/costs.vsh b/examples/biztools/costs.vsh index 06d92511..cdf3fee1 100755 --- a/examples/biztools/costs.vsh +++ b/examples/biztools/costs.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -cg -gc none -no-retry-compilation -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.biz.bizmodel -import freeflowuniverse.herolib.core.playbook +import incubaid.herolib.biz.bizmodel +import incubaid.herolib.core.playbook import os heroscript := " diff --git a/examples/biztools/funding.vsh b/examples/biztools/funding.vsh index 6775f851..5c28d2da 100755 --- a/examples/biztools/funding.vsh +++ b/examples/biztools/funding.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -cg -gc none -no-retry-compilation -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.biz.bizmodel -import freeflowuniverse.herolib.core.playbook +import incubaid.herolib.biz.bizmodel +import incubaid.herolib.core.playbook import os heroscript := " diff --git a/examples/biztools/hr.vsh b/examples/biztools/hr.vsh index 4715a11c..ceea80a3 100755 --- a/examples/biztools/hr.vsh +++ b/examples/biztools/hr.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -cg -gc none -no-retry-compilation -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.biz.bizmodel -import freeflowuniverse.herolib.core.playbook +import incubaid.herolib.biz.bizmodel +import incubaid.herolib.core.playbook import os heroscript := " diff --git a/examples/builder/remote_executor/README.md b/examples/builder/remote_executor/README.md index 05e6b8ba..3848edc4 100644 --- a/examples/builder/remote_executor/README.md +++ b/examples/builder/remote_executor/README.md @@ -1,6 +1,6 @@ # Remote Executor Example -This example demonstrates how to compile and execute V code remotely using SSH. +This example demonstrates how to compile and execute V code remotely using SSH. It shows a practical implementation of the herolib builder's remote execution capabilities, its good for debugging. @@ -19,6 +19,7 @@ A V program that demonstrates remote execution of system operations: ### `run.sh` A bash script that: + 1. Compiles the V program 2. Copies it to a remote machine using SCP 3. Executes it remotely using SSH @@ -45,16 +46,19 @@ Modify these values to match your remote system configuration. ## Usage 1. Set the required environment variable: + ```bash export SECRET=your_secret_value ``` 2. Make the script executable: + ```bash chmod +x run.sh ``` 3. Run the script: + ```bash ./run.sh ``` @@ -66,9 +70,8 @@ This example demonstrates practical usage of the herolib builder module's remote The builder module provides a more structured way to manage remote nodes and execute commands: ```v -import freeflowuniverse.herolib.builder +import incubaid.herolib.builder mut b := builder.new()! mut n := b.node_new(ipaddr:"user@host:port")! // Execute commands on the remote node ``` - diff --git a/examples/builder/remote_executor/toexec.v b/examples/builder/remote_executor/toexec.v index 03d1284e..3c4b9a6a 100644 --- a/examples/builder/remote_executor/toexec.v +++ b/examples/builder/remote_executor/toexec.v @@ -1,6 +1,6 @@ module main -import freeflowuniverse.herolib.core +import incubaid.herolib.core fn do() ! { // base.uninstall_brew()! diff --git a/examples/builder/simple.vsh b/examples/builder/simple.vsh index fe78455a..5f24ffa9 100755 --- a/examples/builder/simple.vsh +++ b/examples/builder/simple.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.builder -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.builder +import incubaid.herolib.core.pathlib import os fn do1() ! { diff --git a/examples/builder/simple_ip4.vsh b/examples/builder/simple_ip4.vsh index a3a22627..6d75b9ef 100755 --- a/examples/builder/simple_ip4.vsh +++ b/examples/builder/simple_ip4.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.builder -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.builder +import incubaid.herolib.core.pathlib import os mut b := builder.new()! diff --git a/examples/builder/simple_ip6.vsh b/examples/builder/simple_ip6.vsh index ee8c118a..52053b2c 100755 --- a/examples/builder/simple_ip6.vsh +++ b/examples/builder/simple_ip6.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.builder -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.builder +import incubaid.herolib.core.pathlib import os mut b := builder.new()! diff --git a/examples/clients/aiclient_example.vsh b/examples/clients/aiclient_example.vsh index 8b537e30..3b0cc2ac 100755 --- a/examples/clients/aiclient_example.vsh +++ b/examples/clients/aiclient_example.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.clients.openai -import freeflowuniverse.herolib.core.playcmds +import incubaid.herolib.clients.openai +import incubaid.herolib.core.playcmds playcmds.run( heroscript: ' diff --git a/examples/clients/gitea.vsh b/examples/clients/gitea.vsh index 3b9f6b89..9bbe3172 100755 --- a/examples/clients/gitea.vsh +++ b/examples/clients/gitea.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -g -cg -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.core.playcmds -import freeflowuniverse.herolib.clients.giteaclient +import incubaid.herolib.core.playcmds +import incubaid.herolib.clients.giteaclient heroscript := " !!giteaclient.configure diff --git a/examples/clients/jina_example.vsh b/examples/clients/jina_example.vsh index 8358831b..656a60d9 100755 --- a/examples/clients/jina_example.vsh +++ b/examples/clients/jina_example.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.clients.jina +import incubaid.herolib.clients.jina import os import json diff --git a/examples/clients/mail.vsh b/examples/clients/mail.vsh index c1578eba..c909feb7 100755 --- a/examples/clients/mail.vsh +++ b/examples/clients/mail.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.clients.mailclient +import incubaid.herolib.clients.mailclient // remove the previous one, otherwise the env variables are not read mailclient.config_delete(name: 'test')! diff --git a/examples/clients/mycelium.vsh b/examples/clients/mycelium.vsh index 34b69c6e..0ee2deb1 100755 --- a/examples/clients/mycelium.vsh +++ b/examples/clients/mycelium.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.clients.mycelium -import freeflowuniverse.herolib.installers.net.mycelium_installer +import incubaid.herolib.clients.mycelium +import incubaid.herolib.installers.net.mycelium_installer import time import os import encoding.base64 diff --git a/examples/clients/mycelium_rpc.vsh b/examples/clients/mycelium_rpc.vsh index 7b4e3f31..92ea2816 100755 --- a/examples/clients/mycelium_rpc.vsh +++ b/examples/clients/mycelium_rpc.vsh @@ -3,8 +3,8 @@ // Mycelium RPC Client Example // This example demonstrates how to use the new Mycelium JSON-RPC client // to interact with a Mycelium node's admin API -import freeflowuniverse.herolib.clients.mycelium_rpc -import freeflowuniverse.herolib.installers.net.mycelium_installer +import incubaid.herolib.clients.mycelium_rpc +import incubaid.herolib.installers.net.mycelium_installer import time import os import encoding.base64 diff --git a/examples/clients/psql.vsh b/examples/clients/psql.vsh index f38db93f..e49fea46 100755 --- a/examples/clients/psql.vsh +++ b/examples/clients/psql.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.core -import freeflowuniverse.herolib.clients.postgresql_client +import incubaid.herolib.core +import incubaid.herolib.clients.postgresql_client // Configure PostgreSQL client heroscript := " diff --git a/examples/clients/zinit_rpc.vsh b/examples/clients/zinit_rpc.vsh index a0a78877..539e4f9d 100755 --- a/examples/clients/zinit_rpc.vsh +++ b/examples/clients/zinit_rpc.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.clients.zinit -import freeflowuniverse.herolib.installers.infra.zinit_installer +import incubaid.herolib.clients.zinit +import incubaid.herolib.installers.infra.zinit_installer import os import time diff --git a/examples/core/agent_encoding.vsh b/examples/core/agent_encoding.vsh index 831bdef3..ed5bdbef 100755 --- a/examples/core/agent_encoding.vsh +++ b/examples/core/agent_encoding.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.core.jobs.model +import incubaid.herolib.data.ourtime +import incubaid.herolib.core.jobs.model // Create a test agent with some sample data mut agent := model.Agent{ diff --git a/examples/core/base/config_basic.vsh b/examples/core/base/config_basic.vsh index e19cd557..879c3e26 100755 --- a/examples/core/base/config_basic.vsh +++ b/examples/core/base/config_basic.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.core.base +import incubaid.herolib.core.base pub struct MyClient[T] { base.BaseConfig[T] diff --git a/examples/core/base/config_with_template_replacement.vsh b/examples/core/base/config_with_template_replacement.vsh index bdae2f47..0c4fefa1 100755 --- a/examples/core/base/config_with_template_replacement.vsh +++ b/examples/core/base/config_with_template_replacement.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.core.base +import incubaid.herolib.core.pathlib +import incubaid.herolib.core.base pub struct MyClient[T] { base.BaseConfig[T] diff --git a/examples/core/base/core_1.vsh b/examples/core/base/core_1.vsh index b39face2..ab986025 100755 --- a/examples/core/base/core_1.vsh +++ b/examples/core/base/core_1.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.develop.gittools +import incubaid.herolib.core.base +import incubaid.herolib.develop.gittools pub struct MyClass { base.Base diff --git a/examples/core/db/db_do.v b/examples/core/db/db_do.v index 01caf274..2bebfd4e 100755 --- a/examples/core/db/db_do.v +++ b/examples/core/db/db_do.v @@ -1,9 +1,9 @@ #!/usr/bin/env -S v -gc none -cc tcc -d use_openssl -enable-globals run import time -import freeflowuniverse.herolib.core.smartid -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.core.db +import incubaid.herolib.core.smartid +import incubaid.herolib.data.ourtime +import incubaid.herolib.core.db pub struct MyStruct { db.Base diff --git a/examples/core/generate.vsh b/examples/core/generate.vsh index 4a7e5984..60297055 100755 --- a/examples/core/generate.vsh +++ b/examples/core/generate.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.core.generator.generic as generator -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.generator.generic as generator +import incubaid.herolib.core.pathlib // mut args := generator.GeneratorArgs{ // path: '~/code/github/incubaid/herolib/lib/clients' diff --git a/examples/core/logger/logger.vsh b/examples/core/logger/logger.vsh index 9d79e51d..c5fa68ad 100755 --- a/examples/core/logger/logger.vsh +++ b/examples/core/logger/logger.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.core.logger +import incubaid.herolib.core.logger mut l := logger.new(path: '/tmp/vlogs')! diff --git a/examples/core/openapi/gitea/gitea_openapi.vsh b/examples/core/openapi/gitea/gitea_openapi.vsh index 1730a0b8..4189347c 100644 --- a/examples/core/openapi/gitea/gitea_openapi.vsh +++ b/examples/core/openapi/gitea/gitea_openapi.vsh @@ -2,7 +2,7 @@ import os import json -import freeflowuniverse.herolib.core.openapi.gen +import incubaid.herolib.core.openapi.gen const spec_path = '${os.dir(@FILE)}/openapi.json' diff --git a/examples/core/openrpc/examples/openrpc_client/client.v b/examples/core/openrpc/examples/openrpc_client/client.v index 2bd4d497..348c4a7d 100644 --- a/examples/core/openrpc/examples/openrpc_client/client.v +++ b/examples/core/openrpc/examples/openrpc_client/client.v @@ -1,6 +1,6 @@ module openrpc_client -import freeflowuniverse.herolib.data.jsonrpc { JsonRpcRequest } +import incubaid.herolib.data.jsonrpc { JsonRpcRequest } import net.websocket struct Client { diff --git a/examples/core/openrpc/examples/petstore_client/client.v b/examples/core/openrpc/examples/petstore_client/client.v index 8e0ccb3d..cee08757 100644 --- a/examples/core/openrpc/examples/petstore_client/client.v +++ b/examples/core/openrpc/examples/petstore_client/client.v @@ -1,6 +1,6 @@ module petstore_client -import freeflowuniverse.herolib.data.jsonrpc { JsonRpcRequest } +import incubaid.herolib.data.jsonrpc { JsonRpcRequest } import net.websocket struct Client { diff --git a/examples/core/openrpc/examples/petstore_client/methods.v b/examples/core/openrpc/examples/petstore_client/methods.v index 4eca6992..cf03cc29 100644 --- a/examples/core/openrpc/examples/petstore_client/methods.v +++ b/examples/core/openrpc/examples/petstore_client/methods.v @@ -1,6 +1,6 @@ module petstore_client -import freeflowuniverse.herolib.data.jsonrpc +import incubaid.herolib.data.jsonrpc // get_pets finds pets in the system that the user has access to by tags and within a limit // - tags: tags to filter by diff --git a/examples/core/pathlib/examples/list/path_list.vsh b/examples/core/pathlib/examples/list/path_list.vsh index 17f8b09f..a8fc5dea 100755 --- a/examples/core/pathlib/examples/list/path_list.vsh +++ b/examples/core/pathlib/examples/list/path_list.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib import os const testpath3 = os.dir(@FILE) + '/../../..' diff --git a/examples/core/pathlib/examples/md5/paths_md5.vsh b/examples/core/pathlib/examples/md5/paths_md5.vsh index b6c59ca7..ea2f35bc 100755 --- a/examples/core/pathlib/examples/md5/paths_md5.vsh +++ b/examples/core/pathlib/examples/md5/paths_md5.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib import os const testpath4 = os.dir(@FILE) + '../../' diff --git a/examples/core/pathlib/examples/scanner/path_scanner.vsh b/examples/core/pathlib/examples/scanner/path_scanner.vsh index 73e33830..2fd7a370 100755 --- a/examples/core/pathlib/examples/scanner/path_scanner.vsh +++ b/examples/core/pathlib/examples/scanner/path_scanner.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.data.paramsparser +import incubaid.herolib.core.pathlib +import incubaid.herolib.data.paramsparser import os const testpath3 = os.dir(@FILE) + '/../..' diff --git a/examples/core/pathlib/examples/sha256/paths_sha256.vsh b/examples/core/pathlib/examples/sha256/paths_sha256.vsh index ef9a1726..25f3c717 100755 --- a/examples/core/pathlib/examples/sha256/paths_sha256.vsh +++ b/examples/core/pathlib/examples/sha256/paths_sha256.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib import os const testpath4 = os.dir(@FILE) + '/paths_sha256.vsh' diff --git a/examples/crypt/crypt_example.vsh b/examples/crypt/crypt_example.vsh index 93568c59..6fd39347 100755 --- a/examples/crypt/crypt_example.vsh +++ b/examples/crypt/crypt_example.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals -no-skip-unused run -import freeflowuniverse.herolib.crypt.herocrypt +import incubaid.herolib.crypt.herocrypt import time // Initialize the HeroCrypt client diff --git a/examples/data/cache.vsh b/examples/data/cache.vsh index 2e81cacc..1f96358d 100755 --- a/examples/data/cache.vsh +++ b/examples/data/cache.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v run // Example struct to cache -import freeflowuniverse.herolib.data.cache +import incubaid.herolib.data.cache import time @[heap] diff --git a/examples/data/countries.vsh b/examples/data/countries.vsh index b8e9c9a5..6cea7984 100755 --- a/examples/data/countries.vsh +++ b/examples/data/countries.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.data.countries +import incubaid.herolib.data.countries mut all_countries := countries.get_all_countries() or { eprintln('Error loading countries: ${err}') diff --git a/examples/data/deduped_mycelium_master.vsh b/examples/data/deduped_mycelium_master.vsh index 3dc112e5..3340437a 100755 --- a/examples/data/deduped_mycelium_master.vsh +++ b/examples/data/deduped_mycelium_master.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.data.ourdb +import incubaid.herolib.data.ourdb import time // Known worker public key diff --git a/examples/data/deduped_mycelium_worker.vsh b/examples/data/deduped_mycelium_worker.vsh index 014b0e92..afc880e1 100755 --- a/examples/data/deduped_mycelium_worker.vsh +++ b/examples/data/deduped_mycelium_worker.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.data.ourdb +import incubaid.herolib.data.ourdb worker_public_key := '46a9f9cee1ce98ef7478f3dea759589bbf6da9156533e63fed9f233640ac072c' diff --git a/examples/data/encoder.vsh b/examples/data/encoder.vsh index 7b048c93..bb02d466 100755 --- a/examples/data/encoder.vsh +++ b/examples/data/encoder.vsh @@ -1,8 +1,8 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.data.encoder +import incubaid.herolib.data.encoder import crypto.ed25519 -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console struct AStruct { mut: diff --git a/examples/data/encrypt_decrypt.vsh b/examples/data/encrypt_decrypt.vsh index 1537ca72..4f4abe0b 100755 --- a/examples/data/encrypt_decrypt.vsh +++ b/examples/data/encrypt_decrypt.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cg -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.crypt.aes_symmetric { decrypt, encrypt } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.crypt.aes_symmetric { decrypt, encrypt } +import incubaid.herolib.ui.console msg := 'my message'.bytes() console.print_debug('${msg}') diff --git a/examples/data/graphdb.vsh b/examples/data/graphdb.vsh index 4813de52..d75e0817 100755 --- a/examples/data/graphdb.vsh +++ b/examples/data/graphdb.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run // Example demonstrating GraphDB usage in a social network context -import freeflowuniverse.herolib.data.graphdb +import incubaid.herolib.data.graphdb fn main() { // Initialize a new graph database with default cache settings diff --git a/examples/data/heroencoder_example.vsh b/examples/data/heroencoder_example.vsh index e25766f2..3ffafdf4 100755 --- a/examples/data/heroencoder_example.vsh +++ b/examples/data/heroencoder_example.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.data.encoderhero -import freeflowuniverse.herolib.core.base +import incubaid.herolib.data.encoderhero +import incubaid.herolib.core.base // this is docu at top @[name: 'teststruct '] diff --git a/examples/data/heroencoder_simple.vsh b/examples/data/heroencoder_simple.vsh index 6b798a92..f5d838a8 100755 --- a/examples/data/heroencoder_simple.vsh +++ b/examples/data/heroencoder_simple.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.data.encoderhero -import freeflowuniverse.herolib.core.base +import incubaid.herolib.data.encoderhero +import incubaid.herolib.core.base import time struct Person { diff --git a/examples/data/location/location_example.vsh b/examples/data/location/location_example.vsh index 1ebb0bfb..f1079b4f 100755 --- a/examples/data/location/location_example.vsh +++ b/examples/data/location/location_example.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -cg -d use_openssl -enable-globals run -import freeflowuniverse.herolib.clients.postgresql_client -import freeflowuniverse.herolib.data.location +import incubaid.herolib.clients.postgresql_client +import incubaid.herolib.data.location // Configure PostgreSQL client heroscript := " diff --git a/examples/data/location/location_example_tcc.vsh b/examples/data/location/location_example_tcc.vsh index 66a00fcb..ea2df104 100755 --- a/examples/data/location/location_example_tcc.vsh +++ b/examples/data/location/location_example_tcc.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.clients.postgresql_client -import freeflowuniverse.herolib.data.location +import incubaid.herolib.clients.postgresql_client +import incubaid.herolib.data.location // Configure PostgreSQL client heroscript := " diff --git a/examples/data/ourdb_client.vsh b/examples/data/ourdb_client.vsh index 8469adfc..c0987e98 100755 --- a/examples/data/ourdb_client.vsh +++ b/examples/data/ourdb_client.vsh @@ -2,7 +2,7 @@ // Please note that before running this script you need to run the server first // See examples/data/ourdb_server.vsh -import freeflowuniverse.herolib.data.ourdb +import incubaid.herolib.data.ourdb import os mut client := ourdb.new_client( diff --git a/examples/data/ourdb_example.vsh b/examples/data/ourdb_example.vsh index d274c6a8..53462384 100755 --- a/examples/data/ourdb_example.vsh +++ b/examples/data/ourdb_example.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.data.ourdb +import incubaid.herolib.data.ourdb const test_dir = '/tmp/ourdb' diff --git a/examples/data/ourdb_server.vsh b/examples/data/ourdb_server.vsh index a2150c6b..61e4fd8f 100755 --- a/examples/data/ourdb_server.vsh +++ b/examples/data/ourdb_server.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.data.ourdb +import incubaid.herolib.data.ourdb import os mut server := ourdb.new_server( diff --git a/examples/data/ourdb_syncer/db_example.v b/examples/data/ourdb_syncer/db_example.v index b7ceb271..b419ab23 100644 --- a/examples/data/ourdb_syncer/db_example.v +++ b/examples/data/ourdb_syncer/db_example.v @@ -1,6 +1,6 @@ module main -import freeflowuniverse.herolib.data.ourdb_syncer.streamer +import incubaid.herolib.data.ourdb_syncer.streamer fn main() { master_public_key := '570c1069736786f06c4fd2a6dc6c17cd88347604593b60e34b5688c369fa1b39' diff --git a/examples/data/ourdb_syncer/master_example.v b/examples/data/ourdb_syncer/master_example.v index 1f229ec0..acfe65a3 100644 --- a/examples/data/ourdb_syncer/master_example.v +++ b/examples/data/ourdb_syncer/master_example.v @@ -1,6 +1,6 @@ module main -import freeflowuniverse.herolib.data.ourdb_syncer.streamer +import incubaid.herolib.data.ourdb_syncer.streamer fn main() { println('Strating the streamer first!') diff --git a/examples/data/ourdb_syncer/worker_example.v b/examples/data/ourdb_syncer/worker_example.v index 8ade56d1..b7602059 100644 --- a/examples/data/ourdb_syncer/worker_example.v +++ b/examples/data/ourdb_syncer/worker_example.v @@ -1,6 +1,6 @@ module main -import freeflowuniverse.herolib.data.ourdb_syncer.streamer +import incubaid.herolib.data.ourdb_syncer.streamer fn main() { // Create a new streamer diff --git a/examples/data/params/args/args_example.vsh b/examples/data/params/args/args_example.vsh index b5962bfd..707add18 100755 --- a/examples/data/params/args/args_example.vsh +++ b/examples/data/params/args/args_example.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.core.playbook -import freeflowuniverse.herolib.data.paramsparser +import incubaid.herolib.core.playbook +import incubaid.herolib.data.paramsparser import os const testpath = os.dir(@FILE) + '/data' diff --git a/examples/data/params/paramsfilter/paramsfilter.vsh b/examples/data/params/paramsfilter/paramsfilter.vsh index 5b7c858c..fbce2582 100755 --- a/examples/data/params/paramsfilter/paramsfilter.vsh +++ b/examples/data/params/paramsfilter/paramsfilter.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.data.paramsparser { Params, parse } +import incubaid.herolib.data.paramsparser { Params, parse } import time totalnr := 1000000 diff --git a/examples/data/radixtree.vsh b/examples/data/radixtree.vsh index b439386a..e5534a21 100755 --- a/examples/data/radixtree.vsh +++ b/examples/data/radixtree.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.data.radixtree +import incubaid.herolib.data.radixtree mut rt := radixtree.new(path: '/tmp/radixtree_test', reset: true)! diff --git a/examples/data/resp/resp_example.vsh b/examples/data/resp/resp_example.vsh index 6a9a24e8..57db2a8a 100755 --- a/examples/data/resp/resp_example.vsh +++ b/examples/data/resp/resp_example.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.data.resp +import incubaid.herolib.data.resp import crypto.ed25519 mut b := resp.builder_new() diff --git a/examples/develop/codewalker/codewalker_example.vsh b/examples/develop/codewalker/codewalker_example.vsh index aea1da66..460e6d33 100755 --- a/examples/develop/codewalker/codewalker_example.vsh +++ b/examples/develop/codewalker/codewalker_example.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.develop.codewalker -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.develop.codewalker +import incubaid.herolib.core.pathlib import os // Simple example demonstrating CodeWalker: diff --git a/examples/develop/gittools/gittools_example2.vsh b/examples/develop/gittools/gittools_example2.vsh index c768b256..8a1e1684 100755 --- a/examples/develop/gittools/gittools_example2.vsh +++ b/examples/develop/gittools/gittools_example2.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.develop.gittools -import freeflowuniverse.herolib.osal +import incubaid.herolib.develop.gittools +import incubaid.herolib.osal import time // Creates a new file in the specified repository path and returns its name. diff --git a/examples/develop/gittools/gittools_path_get.vsh b/examples/develop/gittools/gittools_path_get.vsh index 21d59ad5..f3f7cf18 100755 --- a/examples/develop/gittools/gittools_path_get.vsh +++ b/examples/develop/gittools/gittools_path_get.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.develop.gittools -import freeflowuniverse.herolib.osal +import incubaid.herolib.develop.gittools +import incubaid.herolib.osal import time mut gs := gittools.new()! diff --git a/examples/develop/gittools/gittools_play.vsh b/examples/develop/gittools/gittools_play.vsh index 4a7e7cea..f1a2e8b8 100755 --- a/examples/develop/gittools/gittools_play.vsh +++ b/examples/develop/gittools/gittools_play.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -cg -gc none -no-retry-compilation -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.develop.gittools +import incubaid.herolib.develop.gittools import os heroscript := " diff --git a/examples/develop/gittools/gittools_print.vsh b/examples/develop/gittools/gittools_print.vsh index 3befba73..cfac21d4 100755 --- a/examples/develop/gittools/gittools_print.vsh +++ b/examples/develop/gittools/gittools_print.vsh @@ -3,7 +3,7 @@ // #!/usr/bin/env -S v -n -w -cg -d use_openssl -enable-globals run //-parallel-cc import os -import freeflowuniverse.herolib.develop.gittools +import incubaid.herolib.develop.gittools mut gs := gittools.get(reload: true)! diff --git a/examples/develop/heroprompt/heroprompt_example.vsh b/examples/develop/heroprompt/heroprompt_example.vsh index 4bd03898..f6475506 100755 --- a/examples/develop/heroprompt/heroprompt_example.vsh +++ b/examples/develop/heroprompt/heroprompt_example.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cg -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.develop.heroprompt +import incubaid.herolib.develop.heroprompt import os // mut workspace := heroprompt.new( diff --git a/examples/develop/ipapi/example.vsh b/examples/develop/ipapi/example.vsh index b261eda8..b167d860 100755 --- a/examples/develop/ipapi/example.vsh +++ b/examples/develop/ipapi/example.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -no-retry-compilation -d use_openssl -enable-globals run -import freeflowuniverse.herolib.clients.ipapi +import incubaid.herolib.clients.ipapi import os mut ip_api_client := ipapi.get()! diff --git a/examples/develop/juggler/v_example.vsh b/examples/develop/juggler/v_example.vsh index cd3a64f8..bf2dfc03 100755 --- a/examples/develop/juggler/v_example.vsh +++ b/examples/develop/juggler/v_example.vsh @@ -1,8 +1,8 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run import os -import freeflowuniverse.herolib.osal -import freeflowuniverse.herolib.develop.juggler +import incubaid.herolib.osal +import incubaid.herolib.develop.juggler import veb osal.load_env_file('${os.dir(@FILE)}/.env')! diff --git a/examples/develop/juggler/v_example2.vsh b/examples/develop/juggler/v_example2.vsh index 99e77ba5..efa7935f 100755 --- a/examples/develop/juggler/v_example2.vsh +++ b/examples/develop/juggler/v_example2.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.sysadmin.startupmanager +import incubaid.herolib.sysadmin.startupmanager import os mut sm := startupmanager.get()! diff --git a/examples/develop/luadns/example.vsh b/examples/develop/luadns/example.vsh index cebd9bdf..b79f5347 100644 --- a/examples/develop/luadns/example.vsh +++ b/examples/develop/luadns/example.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.develop.luadns +import incubaid.herolib.develop.luadns fn main() { mut lua_dns := luadns.load('https://github.com/Incubaid/dns') or { diff --git a/examples/develop/openai/openai_example.vsh b/examples/develop/openai/openai_example.vsh index 7f3c7c81..122f5d14 100644 --- a/examples/develop/openai/openai_example.vsh +++ b/examples/develop/openai/openai_example.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.clients.openai as op +import incubaid.herolib.clients.openai as op mut ai_cli := op.new()! mut msg := []op.Message{} diff --git a/examples/develop/runpod/runpod_example.vsh b/examples/develop/runpod/runpod_example.vsh index d0029a3f..2f26da24 100755 --- a/examples/develop/runpod/runpod_example.vsh +++ b/examples/develop/runpod/runpod_example.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -// import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.clients.runpod +// import incubaid.herolib.core.base +import incubaid.herolib.clients.runpod import json import x.json2 diff --git a/examples/develop/vastai/vastai_example.vsh b/examples/develop/vastai/vastai_example.vsh index 5e1eaaf9..b9a0b602 100755 --- a/examples/develop/vastai/vastai_example.vsh +++ b/examples/develop/vastai/vastai_example.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.clients.vastai +import incubaid.herolib.clients.vastai import json import x.json2 diff --git a/examples/develop/wireguard/wireguard.vsh b/examples/develop/wireguard/wireguard.vsh index 0c112ce0..6c555d49 100755 --- a/examples/develop/wireguard/wireguard.vsh +++ b/examples/develop/wireguard/wireguard.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -no-retry-compilation -d use_openssl -enable-globals run -import freeflowuniverse.herolib.clients.wireguard -import freeflowuniverse.herolib.installers.net.wireguard as wireguard_installer +import incubaid.herolib.clients.wireguard +import incubaid.herolib.installers.net.wireguard as wireguard_installer import time import os diff --git a/examples/hero/crypt/hero_crypt_example.vsh b/examples/hero/crypt/hero_crypt_example.vsh index 47957534..60974212 100755 --- a/examples/hero/crypt/hero_crypt_example.vsh +++ b/examples/hero/crypt/hero_crypt_example.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.hero.crypt -import freeflowuniverse.herolib.core.redisclient +import incubaid.herolib.hero.crypt +import incubaid.herolib.core.redisclient // Connect to default Redis instance (127.0.0.1:6379) mut age_client := crypt.new_age_client()! diff --git a/examples/hero/db/psql2.vsh b/examples/hero/db/psql2.vsh index c5912314..3a94f864 100755 --- a/examples/hero/db/psql2.vsh +++ b/examples/hero/db/psql2.vsh @@ -1,11 +1,11 @@ #!/usr/bin/env -S v -n -cg -w -gc none -cc tcc -d use_openssl -enable-globals run // #!/usr/bin/env -S v -n -w -enable-globals run -import freeflowuniverse.herolib.clients.postgresql_client -import freeflowuniverse.herolib.core.playbook -import freeflowuniverse.herolib.hero.models.circle -import freeflowuniverse.herolib.core.playcmds -import freeflowuniverse.herolib.hero.db.hero_db +import incubaid.herolib.clients.postgresql_client +import incubaid.herolib.core.playbook +import incubaid.herolib.hero.models.circle +import incubaid.herolib.core.playcmds +import incubaid.herolib.hero.db.hero_db import db.pg // psql -h /tmp -U myuser -d mydb diff --git a/examples/hero/herofs/fs_server.vsh b/examples/hero/herofs/fs_server.vsh index b148c215..5c9ddcbc 100755 --- a/examples/hero/herofs/fs_server.vsh +++ b/examples/hero/herofs/fs_server.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals -no-skip-unused run -import freeflowuniverse.herolib.hero.herofs_server -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.hero.herofs_server +import incubaid.herolib.ui.console fn main() { console.print_header('HeroFS REST API Server Example') diff --git a/examples/hero/herofs/fs_tools_example.vsh b/examples/hero/herofs/fs_tools_example.vsh index 0062fedd..e6500b34 100755 --- a/examples/hero/herofs/fs_tools_example.vsh +++ b/examples/hero/herofs/fs_tools_example.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals -no-skip-unused run -import freeflowuniverse.herolib.hero.herofs +import incubaid.herolib.hero.herofs // Example demonstrating the new FsTools high-level filesystem operations // This shows how to use find, cp, rm, and mv operations diff --git a/examples/hero/herofs/herofs_advanced.vsh b/examples/hero/herofs/herofs_advanced.vsh index f819fe03..e84d9ec7 100755 --- a/examples/hero/herofs/herofs_advanced.vsh +++ b/examples/hero/herofs/herofs_advanced.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals -no-skip-unused run -import freeflowuniverse.herolib.hero.herofs +import incubaid.herolib.hero.herofs // Advanced example of using HeroFS - the Hero Filesystem // Demonstrates more complex operations including: diff --git a/examples/hero/herofs/herofs_basic.vsh b/examples/hero/herofs/herofs_basic.vsh index 7a6fa414..154660e2 100755 --- a/examples/hero/herofs/herofs_basic.vsh +++ b/examples/hero/herofs/herofs_basic.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals -no-skip-unused run -import freeflowuniverse.herolib.hero.herofs +import incubaid.herolib.hero.herofs // Basic example of using HeroFS - the Hero Filesystem // Demonstrates creating a filesystem, directories, and files diff --git a/examples/hero/herofs/import_export_example.vsh b/examples/hero/herofs/import_export_example.vsh index 724f2059..d5cfa5ba 100755 --- a/examples/hero/herofs/import_export_example.vsh +++ b/examples/hero/herofs/import_export_example.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals -no-skip-unused run -import freeflowuniverse.herolib.hero.herofs +import incubaid.herolib.hero.herofs import os // Example demonstrating HeroFS import/export functionality diff --git a/examples/hero/heromodels/heromodels_calendar.vsh b/examples/hero/heromodels/heromodels_calendar.vsh index 7c57d945..b689d8be 100755 --- a/examples/hero/heromodels/heromodels_calendar.vsh +++ b/examples/hero/heromodels/heromodels_calendar.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals -no-skip-unused run -import freeflowuniverse.herolib.core.redisclient -import freeflowuniverse.herolib.hero.heromodels +import incubaid.herolib.core.redisclient +import incubaid.herolib.hero.heromodels mut mydb := heromodels.new()! mydb.calendar.db.redis.flushdb()! diff --git a/examples/hero/heromodels/heromodels_calendar_event.vsh b/examples/hero/heromodels/heromodels_calendar_event.vsh index 744e8d05..3579003f 100755 --- a/examples/hero/heromodels/heromodels_calendar_event.vsh +++ b/examples/hero/heromodels/heromodels_calendar_event.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals -no-skip-unused run -import freeflowuniverse.herolib.core.redisclient -import freeflowuniverse.herolib.hero.heromodels +import incubaid.herolib.core.redisclient +import incubaid.herolib.hero.heromodels mut mydb := heromodels.new()! mydb.calendar_event.db.redis.flushdb()! diff --git a/examples/hero/heromodels/heromodels_calendar_event_simple.vsh b/examples/hero/heromodels/heromodels_calendar_event_simple.vsh index 23bbe8f3..992d8493 100755 --- a/examples/hero/heromodels/heromodels_calendar_event_simple.vsh +++ b/examples/hero/heromodels/heromodels_calendar_event_simple.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals -no-skip-unused run -import freeflowuniverse.herolib.core.redisclient -import freeflowuniverse.herolib.hero.heromodels +import incubaid.herolib.core.redisclient +import incubaid.herolib.hero.heromodels mut mydb := heromodels.new()! // mydb.calendar_event.db.redis.flushdb()! diff --git a/examples/hero/heromodels/heromodels_calendar_event_with_recurrence.vsh b/examples/hero/heromodels/heromodels_calendar_event_with_recurrence.vsh index 62ccdff2..2be7167d 100755 --- a/examples/hero/heromodels/heromodels_calendar_event_with_recurrence.vsh +++ b/examples/hero/heromodels/heromodels_calendar_event_with_recurrence.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals -no-skip-unused run -import freeflowuniverse.herolib.core.redisclient -import freeflowuniverse.herolib.hero.heromodels +import incubaid.herolib.core.redisclient +import incubaid.herolib.hero.heromodels mut mydb := heromodels.new()! mydb.calendar_event.db.redis.flushdb()! diff --git a/examples/hero/heromodels/heromodels_chat_group.vsh b/examples/hero/heromodels/heromodels_chat_group.vsh index a0465e4d..ebeeb3b8 100755 --- a/examples/hero/heromodels/heromodels_chat_group.vsh +++ b/examples/hero/heromodels/heromodels_chat_group.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals -no-skip-unused run -import freeflowuniverse.herolib.core.redisclient -import freeflowuniverse.herolib.hero.heromodels +import incubaid.herolib.core.redisclient +import incubaid.herolib.hero.heromodels mut mydb := heromodels.new()! diff --git a/examples/hero/heromodels/heromodels_chat_message.vsh b/examples/hero/heromodels/heromodels_chat_message.vsh index 3834b0b9..a7d1bbf5 100755 --- a/examples/hero/heromodels/heromodels_chat_message.vsh +++ b/examples/hero/heromodels/heromodels_chat_message.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals -no-skip-unused run -import freeflowuniverse.herolib.core.redisclient -import freeflowuniverse.herolib.hero.heromodels +import incubaid.herolib.core.redisclient +import incubaid.herolib.hero.heromodels mut mydb := heromodels.new()! diff --git a/examples/hero/heromodels/heromodels_comments.vsh b/examples/hero/heromodels/heromodels_comments.vsh index 7e4a4f49..2ec46102 100755 --- a/examples/hero/heromodels/heromodels_comments.vsh +++ b/examples/hero/heromodels/heromodels_comments.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals -no-skip-unused run -import freeflowuniverse.herolib.core.redisclient -import freeflowuniverse.herolib.hero.heromodels +import incubaid.herolib.core.redisclient +import incubaid.herolib.hero.heromodels mut mydb := heromodels.new()! mydb.comments.db.redis.flushdb()! diff --git a/examples/hero/heromodels/heromodels_group.vsh b/examples/hero/heromodels/heromodels_group.vsh index cacbfd58..c9e8e314 100755 --- a/examples/hero/heromodels/heromodels_group.vsh +++ b/examples/hero/heromodels/heromodels_group.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals -no-skip-unused run -import freeflowuniverse.herolib.hero.heromodels +import incubaid.herolib.hero.heromodels mut mydb := heromodels.new()! diff --git a/examples/hero/heromodels/heromodels_group_add_members.vsh b/examples/hero/heromodels/heromodels_group_add_members.vsh index 12a243d5..bdea1686 100755 --- a/examples/hero/heromodels/heromodels_group_add_members.vsh +++ b/examples/hero/heromodels/heromodels_group_add_members.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals -no-skip-unused run -import freeflowuniverse.herolib.hero.heromodels +import incubaid.herolib.hero.heromodels mut mydb := heromodels.new()! diff --git a/examples/hero/heromodels/heromodels_group_relationships.vsh b/examples/hero/heromodels/heromodels_group_relationships.vsh index 73d65286..1c26db03 100755 --- a/examples/hero/heromodels/heromodels_group_relationships.vsh +++ b/examples/hero/heromodels/heromodels_group_relationships.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals -no-skip-unused run -import freeflowuniverse.herolib.hero.heromodels +import incubaid.herolib.hero.heromodels mut mydb := heromodels.new()! diff --git a/examples/hero/heromodels/heromodels_group_with_members.vsh b/examples/hero/heromodels/heromodels_group_with_members.vsh index dd8c1a85..fa3b5e14 100755 --- a/examples/hero/heromodels/heromodels_group_with_members.vsh +++ b/examples/hero/heromodels/heromodels_group_with_members.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals -no-skip-unused run -import freeflowuniverse.herolib.hero.heromodels +import incubaid.herolib.hero.heromodels mut mydb := heromodels.new()! diff --git a/examples/hero/heromodels/heromodels_project.vsh b/examples/hero/heromodels/heromodels_project.vsh index 8aaa9d42..474fcce6 100755 --- a/examples/hero/heromodels/heromodels_project.vsh +++ b/examples/hero/heromodels/heromodels_project.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals -no-skip-unused run -import freeflowuniverse.herolib.hero.heromodels -import freeflowuniverse.herolib.hero.db +import incubaid.herolib.hero.heromodels +import incubaid.herolib.hero.db mut mydb := heromodels.new()! mydb.project.db.redis.flushdb()! diff --git a/examples/hero/heromodels/heromodels_project_issue.vsh b/examples/hero/heromodels/heromodels_project_issue.vsh index 87881f8f..a68a0c3d 100755 --- a/examples/hero/heromodels/heromodels_project_issue.vsh +++ b/examples/hero/heromodels/heromodels_project_issue.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals -no-skip-unused run -import freeflowuniverse.herolib.hero.heromodels -import freeflowuniverse.herolib.hero.db +import incubaid.herolib.hero.heromodels +import incubaid.herolib.hero.db mut mydb := heromodels.new()! mydb.project_issue.db.redis.flushdb()! diff --git a/examples/hero/heromodels/heromodels_user.vsh b/examples/hero/heromodels/heromodels_user.vsh index 9dd89be4..d07c1276 100755 --- a/examples/hero/heromodels/heromodels_user.vsh +++ b/examples/hero/heromodels/heromodels_user.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals -no-skip-unused run -import freeflowuniverse.herolib.hero.heromodels +import incubaid.herolib.hero.heromodels mut mydb := heromodels.new()! diff --git a/examples/hero/heromodels/heroserver_example.vsh b/examples/hero/heromodels/heroserver_example.vsh index 01cb77f0..b8d5f26d 100755 --- a/examples/hero/heromodels/heroserver_example.vsh +++ b/examples/hero/heromodels/heroserver_example.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals -no-skip-unused run -import freeflowuniverse.herolib.hero.heromodels -import freeflowuniverse.herolib.hero.db +import incubaid.herolib.hero.heromodels +import incubaid.herolib.hero.db import time fn main() { diff --git a/examples/hero/herorpc/herorpc_example.vsh b/examples/hero/herorpc/herorpc_example.vsh index 36913037..294feb05 100755 --- a/examples/hero/herorpc/herorpc_example.vsh +++ b/examples/hero/herorpc/herorpc_example.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.hero.heromodels.rpc -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.hero.heromodels.rpc +import incubaid.herolib.ui.console // when httpport is set, the rpc will be available over http // if 0, then its only available on unix socket /tmp/heromodels diff --git a/examples/hero/heroserver/heroserver.vsh b/examples/hero/heroserver/heroserver.vsh index f10a1946..29b122e2 100755 --- a/examples/hero/heroserver/heroserver.vsh +++ b/examples/hero/heroserver/heroserver.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.hero.heroserver -import freeflowuniverse.herolib.schemas.openrpc +import incubaid.herolib.hero.heroserver +import incubaid.herolib.schemas.openrpc import os // 1. Create a new server instance diff --git a/examples/installers/cometbft.vsh b/examples/installers/cometbft.vsh index 6b57b943..fbc8b364 100755 --- a/examples/installers/cometbft.vsh +++ b/examples/installers/cometbft.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.installers.db.cometbft as cometbft_installer +import incubaid.herolib.installers.db.cometbft as cometbft_installer // coredns_installer.delete()! mut installer := cometbft_installer.get()! diff --git a/examples/installers/conduit.vsh b/examples/installers/conduit.vsh index d4e1a69d..b6f0c351 100755 --- a/examples/installers/conduit.vsh +++ b/examples/installers/conduit.vsh @@ -1,5 +1,5 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.installers.fediverse.conduit +import incubaid.herolib.installers.fediverse.conduit conduit.install()! diff --git a/examples/installers/coredns.vsh b/examples/installers/coredns.vsh index 2bc22432..fb27c51d 100755 --- a/examples/installers/coredns.vsh +++ b/examples/installers/coredns.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.installers.infra.coredns as coredns_installer -import freeflowuniverse.herolib.osal +import incubaid.herolib.installers.infra.coredns as coredns_installer +import incubaid.herolib.osal // coredns_installer.delete()! mut installer := coredns_installer.get()! diff --git a/examples/installers/db/meilisearch.vsh b/examples/installers/db/meilisearch.vsh index d0a4ccfc..7739004d 100755 --- a/examples/installers/db/meilisearch.vsh +++ b/examples/installers/db/meilisearch.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.installers.db.meilisearch_installer +import incubaid.herolib.installers.db.meilisearch_installer mut meilisearch := meilisearch_installer.get()! meilisearch.install()! diff --git a/examples/installers/db/postgresql.vsh b/examples/installers/db/postgresql.vsh index 7cd5d819..43c35d0e 100755 --- a/examples/installers/db/postgresql.vsh +++ b/examples/installers/db/postgresql.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.installers.db.postgresql as postgresql_installer +import incubaid.herolib.installers.db.postgresql as postgresql_installer mut db := postgresql_installer.get()! diff --git a/examples/installers/db/qdrant.vsh b/examples/installers/db/qdrant.vsh index 8dc9bb83..9a9df6cc 100755 --- a/examples/installers/db/qdrant.vsh +++ b/examples/installers/db/qdrant.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.installers.db.qdrant as qdrant_installer +import incubaid.herolib.installers.db.qdrant as qdrant_installer mut db := qdrant_installer.get()! diff --git a/examples/installers/db/zerodb.vsh b/examples/installers/db/zerodb.vsh index 924f791a..324ed91c 100755 --- a/examples/installers/db/zerodb.vsh +++ b/examples/installers/db/zerodb.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.installers.db.zerodb as zerodb_installer +import incubaid.herolib.installers.db.zerodb as zerodb_installer mut db := zerodb_installer.get()! diff --git a/examples/installers/hero_install.vsh b/examples/installers/hero_install.vsh index e2d5365c..98eb4d4e 100755 --- a/examples/installers/hero_install.vsh +++ b/examples/installers/hero_install.vsh @@ -1,8 +1,8 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.installers.lang.vlang -import freeflowuniverse.herolib.installers.sysadmintools.daguserver -import freeflowuniverse.herolib.installers.sysadmintools.b2 as b2_installer +import incubaid.herolib.installers.lang.vlang +import incubaid.herolib.installers.sysadmintools.daguserver +import incubaid.herolib.installers.sysadmintools.b2 as b2_installer vlang.v_analyzer_install()! daguserver.new()! // will install & start a daguserver diff --git a/examples/installers/infra/dify.vsh b/examples/installers/infra/dify.vsh index 9a55232f..43e2288a 100755 --- a/examples/installers/infra/dify.vsh +++ b/examples/installers/infra/dify.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.installers.infra.dify as dify_installer +import incubaid.herolib.installers.infra.dify as dify_installer mut dify := dify_installer.get()! diff --git a/examples/installers/infra/gitea.vsh b/examples/installers/infra/gitea.vsh index 64888a33..f5214da2 100755 --- a/examples/installers/infra/gitea.vsh +++ b/examples/installers/infra/gitea.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.installers.infra.gitea as gitea_installer +import incubaid.herolib.installers.infra.gitea as gitea_installer mut gitea := gitea_installer.get()! gitea.install()! diff --git a/examples/installers/infra/livekit.vsh b/examples/installers/infra/livekit.vsh index ac6e3cb3..28a408b3 100755 --- a/examples/installers/infra/livekit.vsh +++ b/examples/installers/infra/livekit.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.installers.infra.livekit as livekit_installer +import incubaid.herolib.installers.infra.livekit as livekit_installer mut livekit := livekit_installer.get(create: true)! livekit.install()! diff --git a/examples/installers/infra/screen.vsh b/examples/installers/infra/screen.vsh index a98ca4f9..269dee19 100755 --- a/examples/installers/infra/screen.vsh +++ b/examples/installers/infra/screen.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.installers.infra.screen as screen_installer +import incubaid.herolib.installers.infra.screen as screen_installer mut screen := screen_installer.get()! diff --git a/examples/installers/infra/zinit_installer.vsh b/examples/installers/infra/zinit_installer.vsh index 2817969b..9aebf845 100755 --- a/examples/installers/infra/zinit_installer.vsh +++ b/examples/installers/infra/zinit_installer.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.installers.infra.zinit_installer +import incubaid.herolib.installers.infra.zinit_installer mut installer := zinit_installer.get()! installer.install()! diff --git a/examples/installers/installers.vsh b/examples/installers/installers.vsh index 56855b0f..bb71bb6d 100755 --- a/examples/installers/installers.vsh +++ b/examples/installers/installers.vsh @@ -1,10 +1,10 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.installers.lang.rust -import freeflowuniverse.herolib.installers.lang.python -import freeflowuniverse.herolib.installers.lang.nodejs -import freeflowuniverse.herolib.installers.lang.golang -import freeflowuniverse.herolib.core +import incubaid.herolib.installers.lang.rust +import incubaid.herolib.installers.lang.python +import incubaid.herolib.installers.lang.nodejs +import incubaid.herolib.installers.lang.golang +import incubaid.herolib.core core.interactive_set()! // make sure the sudo works so we can do things even if it requires those rights diff --git a/examples/installers/lang/golang.vsh b/examples/installers/lang/golang.vsh index 90a29b1c..d57a7a68 100755 --- a/examples/installers/lang/golang.vsh +++ b/examples/installers/lang/golang.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.installers.lang.golang +import incubaid.herolib.installers.lang.golang mut golang_installer := golang.get()! golang_installer.install()! diff --git a/examples/installers/lang/nodejs.vsh b/examples/installers/lang/nodejs.vsh index 3c33017a..fa636cc5 100755 --- a/examples/installers/lang/nodejs.vsh +++ b/examples/installers/lang/nodejs.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.installers.lang.nodejs +import incubaid.herolib.installers.lang.nodejs mut nodejs_installer := nodejs.get()! // nodejs_installer.install()! diff --git a/examples/installers/lang/python.vsh b/examples/installers/lang/python.vsh index 24cd2978..3d7d54b7 100755 --- a/examples/installers/lang/python.vsh +++ b/examples/installers/lang/python.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.installers.lang.python as python_module +import incubaid.herolib.installers.lang.python as python_module mut python_installer := python_module.get()! python_installer.install()! diff --git a/examples/installers/lang/rust.vsh b/examples/installers/lang/rust.vsh index cfd2a000..8af1f1a0 100755 --- a/examples/installers/lang/rust.vsh +++ b/examples/installers/lang/rust.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.installers.lang.rust as rust_module +import incubaid.herolib.installers.lang.rust as rust_module mut rust_installer := rust_module.get()! // rust_installer.install()! diff --git a/examples/installers/net/mycelium.vsh b/examples/installers/net/mycelium.vsh index 97da5f20..ef5cc540 100755 --- a/examples/installers/net/mycelium.vsh +++ b/examples/installers/net/mycelium.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.installers.net.mycelium_installer -import freeflowuniverse.herolib.clients.mycelium +import incubaid.herolib.installers.net.mycelium_installer +import incubaid.herolib.clients.mycelium mut installer := mycelium_installer.get(create: true)! println(installer) diff --git a/examples/installers/net/wireguard.vsh b/examples/installers/net/wireguard.vsh index 5577ddd2..486b3125 100755 --- a/examples/installers/net/wireguard.vsh +++ b/examples/installers/net/wireguard.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.installers.net.wireguard_installer as wireguard +import incubaid.herolib.installers.net.wireguard_installer as wireguard mut wireguard_installer := wireguard.get()! wireguard_installer.install()! diff --git a/examples/installers/sysadmintools/actrunner.vsh b/examples/installers/sysadmintools/actrunner.vsh index 3b5e250f..1aa59e66 100755 --- a/examples/installers/sysadmintools/actrunner.vsh +++ b/examples/installers/sysadmintools/actrunner.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.installers.sysadmintools.actrunner -// import freeflowuniverse.herolib.installers.virt.herocontainers +import incubaid.herolib.installers.sysadmintools.actrunner +// import incubaid.herolib.installers.virt.herocontainers mut actrunner_ := actrunner.get()! actrunner_.install()! diff --git a/examples/installers/sysadmintools/garage_s3.vsh b/examples/installers/sysadmintools/garage_s3.vsh index 2ec3ea00..3e10bc25 100755 --- a/examples/installers/sysadmintools/garage_s3.vsh +++ b/examples/installers/sysadmintools/garage_s3.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.installers.sysadmintools.garage_s3 as garage_s3_installer +import incubaid.herolib.installers.sysadmintools.garage_s3 as garage_s3_installer mut garage_s3 := garage_s3_installer.get()! garage_s3.install()! diff --git a/examples/installers/sysadmintools/rclone.vsh b/examples/installers/sysadmintools/rclone.vsh index 154d7840..488bea86 100755 --- a/examples/installers/sysadmintools/rclone.vsh +++ b/examples/installers/sysadmintools/rclone.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.installers.sysadmintools.rclone as rclone_installer +import incubaid.herolib.installers.sysadmintools.rclone as rclone_installer mut rclone := rclone_installer.get()! rclone.install()! diff --git a/examples/installers/threefold/griddriver.vsh b/examples/installers/threefold/griddriver.vsh index da5085c2..edb4bd59 100755 --- a/examples/installers/threefold/griddriver.vsh +++ b/examples/installers/threefold/griddriver.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.installers.threefold.griddriver +import incubaid.herolib.installers.threefold.griddriver mut griddriver_installer := griddriver.get()! griddriver_installer.install()! diff --git a/examples/installers/traefik.vsh b/examples/installers/traefik.vsh index dfc99220..92688437 100755 --- a/examples/installers/traefik.vsh +++ b/examples/installers/traefik.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run import os -import freeflowuniverse.herolib.installers.web.traefik as traefik_installer +import incubaid.herolib.installers.web.traefik as traefik_installer traefik_installer.delete()! mut installer := traefik_installer.get()! diff --git a/examples/installers/virt/buildah.vsh b/examples/installers/virt/buildah.vsh index a5ca6978..23e20e50 100755 --- a/examples/installers/virt/buildah.vsh +++ b/examples/installers/virt/buildah.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -no-retry-compilation -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.installers.virt.buildah as buildah_installer +import incubaid.herolib.installers.virt.buildah as buildah_installer mut buildah := buildah_installer.get()! diff --git a/examples/installers/virt/dagu.vsh b/examples/installers/virt/dagu.vsh index 2b33db7d..8f555a71 100755 --- a/examples/installers/virt/dagu.vsh +++ b/examples/installers/virt/dagu.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.installers.sysadmintools.daguserver -import freeflowuniverse.herolib.installers.infra.zinit_installer +import incubaid.herolib.installers.sysadmintools.daguserver +import incubaid.herolib.installers.infra.zinit_installer mut ds := daguserver.get()! ds.install()! diff --git a/examples/installers/virt/docker.vsh b/examples/installers/virt/docker.vsh index 1a0fe523..4d3b589f 100755 --- a/examples/installers/virt/docker.vsh +++ b/examples/installers/virt/docker.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -no-retry-compilation -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.installers.virt.docker as docker_installer +import incubaid.herolib.installers.virt.docker as docker_installer mut docker := docker_installer.get()! diff --git a/examples/installers/virt/herocontainers.vsh b/examples/installers/virt/herocontainers.vsh index a42e0a6a..02fb309d 100755 --- a/examples/installers/virt/herocontainers.vsh +++ b/examples/installers/virt/herocontainers.vsh @@ -1,9 +1,9 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.osal -import freeflowuniverse.herolib.installers.lang.golang -import freeflowuniverse.herolib.installers.virt.podman as podman_installer -import freeflowuniverse.herolib.installers.virt.buildah as buildah_installer +import incubaid.herolib.osal +import incubaid.herolib.installers.lang.golang +import incubaid.herolib.installers.virt.podman as podman_installer +import incubaid.herolib.installers.virt.buildah as buildah_installer mut podman_installer0 := podman_installer.get()! mut buildah_installer0 := buildah_installer.get()! diff --git a/examples/installers/virt/pacman.vsh b/examples/installers/virt/pacman.vsh index 14cc0307..b2eeee8c 100755 --- a/examples/installers/virt/pacman.vsh +++ b/examples/installers/virt/pacman.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.installers.virt.pacman as pacman_installer +import incubaid.herolib.installers.virt.pacman as pacman_installer mut pacman := pacman_installer.get()! diff --git a/examples/installers/virt/podman.vsh b/examples/installers/virt/podman.vsh index 71f771df..c60a2ae3 100755 --- a/examples/installers/virt/podman.vsh +++ b/examples/installers/virt/podman.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.installers.virt.podman as podman_installer +import incubaid.herolib.installers.virt.podman as podman_installer mut podman := podman_installer.get()! diff --git a/examples/installers/youki.vsh b/examples/installers/youki.vsh index 0e00e757..52b9d285 100755 --- a/examples/installers/youki.vsh +++ b/examples/installers/youki.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.installers.virt.youki +import incubaid.herolib.installers.virt.youki mut youki_installer := youki.get()! diff --git a/examples/jobs/vfs_jobs_example.vsh b/examples/jobs/vfs_jobs_example.vsh index 9afaab58..e17b8a22 100644 --- a/examples/jobs/vfs_jobs_example.vsh +++ b/examples/jobs/vfs_jobs_example.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.core.jobs.model +import incubaid.herolib.core.jobs.model import flag import os import time diff --git a/examples/lang/python/codewalker.vsh b/examples/lang/python/codewalker.vsh index e0dd3758..de5f07da 100755 --- a/examples/lang/python/codewalker.vsh +++ b/examples/lang/python/codewalker.vsh @@ -1,8 +1,8 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.lib.lang.codewalker -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.osal.core as osal +import incubaid.herolib.lib.lang.codewalker +import incubaid.herolib.core.pathlib +import incubaid.herolib.osal.core as osal // Create test directory structure in /tmp/filemap test_source := '/tmp/filemap' diff --git a/examples/lang/python/pythonexample.vsh b/examples/lang/python/pythonexample.vsh index 3ee6a089..427bf9b4 100755 --- a/examples/lang/python/pythonexample.vsh +++ b/examples/lang/python/pythonexample.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.lang.python +import incubaid.herolib.lang.python import json pub struct Person { diff --git a/examples/mcp/http_demo/server.vsh b/examples/mcp/http_demo/server.vsh index ea957e15..f2e57f8b 100755 --- a/examples/mcp/http_demo/server.vsh +++ b/examples/mcp/http_demo/server.vsh @@ -1,8 +1,8 @@ #!/usr/bin/env -S v -n -w -cg -d use_openssl -d json_no_inline_sumtypes -enable-globals run -import freeflowuniverse.herolib.mcp -import freeflowuniverse.herolib.mcp.transport -import freeflowuniverse.herolib.schemas.jsonschema +import incubaid.herolib.mcp +import incubaid.herolib.mcp.transport +import incubaid.herolib.schemas.jsonschema import x.json2 import os import time diff --git a/examples/mcp/http_server/server.vsh b/examples/mcp/http_server/server.vsh index cb564e08..e2554307 100755 --- a/examples/mcp/http_server/server.vsh +++ b/examples/mcp/http_server/server.vsh @@ -1,9 +1,9 @@ #!/usr/bin/env -S v -n -w -cg -d use_openssl -d json_no_inline_sumtypes -enable-globals run -import freeflowuniverse.herolib.mcp -import freeflowuniverse.herolib.mcp.transport -import freeflowuniverse.herolib.schemas.jsonrpc -import freeflowuniverse.herolib.schemas.jsonschema +import incubaid.herolib.mcp +import incubaid.herolib.mcp.transport +import incubaid.herolib.schemas.jsonrpc +import incubaid.herolib.schemas.jsonschema import x.json2 import os diff --git a/examples/mcp/inspector/README.md b/examples/mcp/inspector/README.md index 3f831153..ee1a9f65 100644 --- a/examples/mcp/inspector/README.md +++ b/examples/mcp/inspector/README.md @@ -5,7 +5,7 @@ This is a simple example of how to use the MCP module to create a server that ha ## Usage ```v -import freeflowuniverse.herolib.mcp +import incubaid.herolib.mcp // Define custom handlers if needed handlers := { diff --git a/examples/mcp/inspector/server.vsh b/examples/mcp/inspector/server.vsh index da93e9ab..dcca9471 100755 --- a/examples/mcp/inspector/server.vsh +++ b/examples/mcp/inspector/server.vsh @@ -1,9 +1,9 @@ #!/usr/bin/env -S v -n -w -cg -d use_openssl -d json_no_inline_sumtypes -enable-globals run -import freeflowuniverse.herolib.mcp -import freeflowuniverse.herolib.mcp.transport -import freeflowuniverse.herolib.schemas.jsonrpc -import freeflowuniverse.herolib.schemas.jsonschema +import incubaid.herolib.mcp +import incubaid.herolib.mcp.transport +import incubaid.herolib.schemas.jsonrpc +import incubaid.herolib.schemas.jsonschema import x.json2 import os diff --git a/examples/mcp/simple_http/server.vsh b/examples/mcp/simple_http/server.vsh index 5495129c..250e386a 100755 --- a/examples/mcp/simple_http/server.vsh +++ b/examples/mcp/simple_http/server.vsh @@ -1,9 +1,9 @@ #!/usr/bin/env -S v -n -w -cg -d use_openssl -d json_no_inline_sumtypes -enable-globals run -import freeflowuniverse.herolib.mcp -import freeflowuniverse.herolib.mcp.transport -import freeflowuniverse.herolib.schemas.jsonrpc -import freeflowuniverse.herolib.schemas.jsonschema +import incubaid.herolib.mcp +import incubaid.herolib.mcp.transport +import incubaid.herolib.schemas.jsonrpc +import incubaid.herolib.schemas.jsonschema import x.json2 import os diff --git a/examples/osal/coredns/example.vsh b/examples/osal/coredns/example.vsh index 78695163..9403c3ca 100755 --- a/examples/osal/coredns/example.vsh +++ b/examples/osal/coredns/example.vsh @@ -1,8 +1,8 @@ #!/usr/bin/env -S v -n -w -cg -d use_openssl -enable-globals run -import freeflowuniverse.herolib.installers.infra.coredns as coredns_installer -import freeflowuniverse.herolib.osal.coredns -import freeflowuniverse.herolib.core.playbook +import incubaid.herolib.installers.infra.coredns as coredns_installer +import incubaid.herolib.osal.coredns +import incubaid.herolib.core.playbook // coredns_installer.delete()! mut installer := coredns_installer.get()! diff --git a/examples/osal/download/download_example.vsh b/examples/osal/download/download_example.vsh index f88006cf..35d1971f 100755 --- a/examples/osal/download/download_example.vsh +++ b/examples/osal/download/download_example.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.osal { download } +import incubaid.herolib.osal { download } mut p := download( url: 'https://cdnjs.cloudflare.com/ajax/libs/echarts/5.4.3/@name' diff --git a/examples/osal/notifier.vsh b/examples/osal/notifier.vsh index 0e7f07a4..e27b43c4 100755 --- a/examples/osal/notifier.vsh +++ b/examples/osal/notifier.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.osal.notifier +import incubaid.herolib.osal.notifier import os import time diff --git a/examples/osal/ping/ping_example.vsh b/examples/osal/ping/ping_example.vsh index cd6a01c6..ea6d2a08 100755 --- a/examples/osal/ping/ping_example.vsh +++ b/examples/osal/ping/ping_example.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.osal { ping } +import incubaid.herolib.osal { ping } assert ping(address: '338.8.8.8')! == .unknownhost assert ping(address: '8.8.8.8')! == .ok diff --git a/examples/osal/ping/portforward.vsh b/examples/osal/ping/portforward.vsh index 83c3f953..02ec0022 100755 --- a/examples/osal/ping/portforward.vsh +++ b/examples/osal/ping/portforward.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.builder +import incubaid.herolib.builder // name string @[required] // address string @[required] diff --git a/examples/osal/process/process.v b/examples/osal/process/process.v index 1701ba70..62738d54 100644 --- a/examples/osal/process/process.v +++ b/examples/osal/process/process.v @@ -1,6 +1,6 @@ module main -import freeflowuniverse.herolib.osal +import incubaid.herolib.osal fn do() ? { if osal.is_osx() { diff --git a/examples/osal/process/processmap.v b/examples/osal/process/processmap.v index faff6148..10a98372 100644 --- a/examples/osal/process/processmap.v +++ b/examples/osal/process/processmap.v @@ -1,6 +1,6 @@ module main -import freeflowuniverse.herolib.osal +import incubaid.herolib.osal fn do() ? { mut pm := process.processmap_get()? diff --git a/examples/osal/rsync/rsync_example.v b/examples/osal/rsync/rsync_example.v index 51a7e1e0..d05d365f 100644 --- a/examples/osal/rsync/rsync_example.v +++ b/examples/osal/rsync/rsync_example.v @@ -1,7 +1,7 @@ module main -import freeflowuniverse.herolib.osal -import freeflowuniverse.herolib.builder +import incubaid.herolib.osal +import incubaid.herolib.builder import os const myexamplepath = os.dir(@FILE) + '/../..' diff --git a/examples/osal/sandbox/examples/sandbox_example.v b/examples/osal/sandbox/examples/sandbox_example.v index 05330121..cee621f7 100644 --- a/examples/osal/sandbox/examples/sandbox_example.v +++ b/examples/osal/sandbox/examples/sandbox_example.v @@ -1,6 +1,6 @@ module main -import freeflowuniverse.herolib.osal.sandbox +import incubaid.herolib.osal.sandbox import os fn do() ! { diff --git a/examples/osal/sshagent/sshagent.vsh b/examples/osal/sshagent/sshagent.vsh index b9abe1fa..8e583b52 100755 --- a/examples/osal/sshagent/sshagent.vsh +++ b/examples/osal/sshagent/sshagent.vsh @@ -1,8 +1,8 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.osal.sshagent -import freeflowuniverse.herolib.builder -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.osal.sshagent +import incubaid.herolib.builder +import incubaid.herolib.ui.console console.print_header('SSH Agent Management Example') diff --git a/examples/osal/sshagent/sshagent_example.vsh b/examples/osal/sshagent/sshagent_example.vsh index 13d484e7..c57274cd 100755 --- a/examples/osal/sshagent/sshagent_example.vsh +++ b/examples/osal/sshagent/sshagent_example.vsh @@ -1,8 +1,8 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.osal.sshagent -import freeflowuniverse.herolib.osal.linux -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.osal.sshagent +import incubaid.herolib.osal.linux +import incubaid.herolib.ui.console fn demo_sshagent_basic() ! { console.print_header('SSH Agent Basic Demo') diff --git a/examples/osal/sshagent/sshagent_example2.vsh b/examples/osal/sshagent/sshagent_example2.vsh index 9933cbee..d02fd01a 100755 --- a/examples/osal/sshagent/sshagent_example2.vsh +++ b/examples/osal/sshagent/sshagent_example2.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.osal.sshagent -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.osal.sshagent +import incubaid.herolib.ui.console console.print_header('SSH Agent Management Example') diff --git a/examples/osal/startup_manager.vsh b/examples/osal/startup_manager.vsh index 0e5dca92..de086081 100755 --- a/examples/osal/startup_manager.vsh +++ b/examples/osal/startup_manager.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.installers.infra.zinit as zinitinstaller -import freeflowuniverse.herolib.sysadmin.startupmanager +import incubaid.herolib.installers.infra.zinit as zinitinstaller +import incubaid.herolib.sysadmin.startupmanager mut z := zinitinstaller.get()! z.destroy()! diff --git a/examples/osal/systemd.vsh b/examples/osal/systemd.vsh index c7778014..9e892402 100755 --- a/examples/osal/systemd.vsh +++ b/examples/osal/systemd.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.osal.systemd +import incubaid.herolib.osal.systemd mut systemdfactory := systemd.new()! // mut systemdprocess := systemdfactory.new( diff --git a/examples/osal/tmux/server_dashboard.vsh b/examples/osal/tmux/server_dashboard.vsh index d0a9d5e9..712c33d9 100755 --- a/examples/osal/tmux/server_dashboard.vsh +++ b/examples/osal/tmux/server_dashboard.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.osal.tmux -import freeflowuniverse.herolib.osal.core as osal +import incubaid.herolib.osal.tmux +import incubaid.herolib.osal.core as osal import time import os diff --git a/examples/osal/tmux/tmux.vsh b/examples/osal/tmux/tmux.vsh index 3fbc4d29..48fe9da4 100755 --- a/examples/osal/tmux/tmux.vsh +++ b/examples/osal/tmux/tmux.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.osal.tmux -import freeflowuniverse.herolib.osal.core as osal +import incubaid.herolib.osal.tmux +import incubaid.herolib.osal.core as osal import time // Constants for display formatting diff --git a/examples/osal/tmux/tmux_old.vsh b/examples/osal/tmux/tmux_old.vsh index 5c18a170..95dad9a1 100755 --- a/examples/osal/tmux/tmux_old.vsh +++ b/examples/osal/tmux/tmux_old.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.osal.tmux +import incubaid.herolib.osal.tmux mut t := tmux.new()! if !t.is_running()! { diff --git a/examples/osal/tmux/tmux_pane_resize.vsh b/examples/osal/tmux/tmux_pane_resize.vsh index be443ca9..2f29b2e5 100755 --- a/examples/osal/tmux/tmux_pane_resize.vsh +++ b/examples/osal/tmux/tmux_pane_resize.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.osal.tmux +import incubaid.herolib.osal.tmux import time println('=== Tmux Pane Resizing Example ===') diff --git a/examples/osal/tmux/tmux_panes.vsh b/examples/osal/tmux/tmux_panes.vsh index 31d09225..951b8e4d 100755 --- a/examples/osal/tmux/tmux_panes.vsh +++ b/examples/osal/tmux/tmux_panes.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.osal.tmux +import incubaid.herolib.osal.tmux import time println('=== Tmux Pane Splitting Example ===') diff --git a/examples/osal/tmux/tmux_process_info_old.vsh b/examples/osal/tmux/tmux_process_info_old.vsh index 6d95c657..3866b8cf 100644 --- a/examples/osal/tmux/tmux_process_info_old.vsh +++ b/examples/osal/tmux/tmux_process_info_old.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.osal.tmux -import freeflowuniverse.herolib.osal.core as osal +import incubaid.herolib.osal.tmux +import incubaid.herolib.osal.core as osal import time mut t := tmux.new()! diff --git a/examples/osal/tun.vsh b/examples/osal/tun.vsh index 74a3825d..6b96cd0e 100755 --- a/examples/osal/tun.vsh +++ b/examples/osal/tun.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.osal.tun +import incubaid.herolib.osal.tun // Check if TUN is available if available := tun.available() { diff --git a/examples/osal/ubuntu/ubuntu_do.vsh b/examples/osal/ubuntu/ubuntu_do.vsh index eac8320f..b397162d 100755 --- a/examples/osal/ubuntu/ubuntu_do.vsh +++ b/examples/osal/ubuntu/ubuntu_do.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.osal.ubuntu +import incubaid.herolib.osal.ubuntu import os import time diff --git a/examples/osal/ufw.vsh b/examples/osal/ufw.vsh index 592cf4dc..205d367c 100755 --- a/examples/osal/ufw.vsh +++ b/examples/osal/ufw.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.osal.ufw +import incubaid.herolib.osal.ufw ufw.enable()! println(ufw.ufw_status()!) diff --git a/examples/osal/ufw_play.vsh b/examples/osal/ufw_play.vsh index 02dda0ed..1f8d3fff 100755 --- a/examples/osal/ufw_play.vsh +++ b/examples/osal/ufw_play.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.osal.ufw -import freeflowuniverse.herolib.core.playbook +import incubaid.herolib.osal.ufw +import incubaid.herolib.core.playbook heroscript := " !!ufw.configure diff --git a/examples/osal/zinit/rpc/zinit.v b/examples/osal/zinit/rpc/zinit.v index 2f684f3f..690123f7 100644 --- a/examples/osal/zinit/rpc/zinit.v +++ b/examples/osal/zinit/rpc/zinit.v @@ -2,7 +2,7 @@ module main import os import time -import freeflowuniverse.herolib.osal.zinit +import incubaid.herolib.osal.zinit fn main() { do() or { panic(err) } diff --git a/examples/osal/zinit/simple/zinit.vsh b/examples/osal/zinit/simple/zinit.vsh index cb0d6c3a..35ea9329 100644 --- a/examples/osal/zinit/simple/zinit.vsh +++ b/examples/osal/zinit/simple/zinit.vsh @@ -2,7 +2,7 @@ import os import time -import freeflowuniverse.herolib.osal.zinit +import incubaid.herolib.osal.zinit zinit.destroy()! mut z := zinit.new()! diff --git a/examples/osal/zinit/zinit_openrpc_example.v b/examples/osal/zinit/zinit_openrpc_example.v index afea8821..e314a81c 100644 --- a/examples/osal/zinit/zinit_openrpc_example.v +++ b/examples/osal/zinit/zinit_openrpc_example.v @@ -1,6 +1,6 @@ module main -import freeflowuniverse.herolib.osal.zinit +import incubaid.herolib.osal.zinit import json fn main() { diff --git a/examples/schemas/example/generate_model.vsh b/examples/schemas/example/generate_model.vsh index dac356f0..263df28a 100755 --- a/examples/schemas/example/generate_model.vsh +++ b/examples/schemas/example/generate_model.vsh @@ -1,10 +1,10 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals run import os -import freeflowuniverse.herolib.core.code { Alias } -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.schemas.openrpc -import freeflowuniverse.herolib.schemas.openrpc.codegen { generate_model } +import incubaid.herolib.core.code { Alias } +import incubaid.herolib.core.pathlib +import incubaid.herolib.schemas.openrpc +import incubaid.herolib.schemas.openrpc.codegen { generate_model } const doc_path = '${os.dir(@FILE)}/testdata/openrpc.json' diff --git a/examples/schemas/openapi/codegen/calendar_ts_client.vsh b/examples/schemas/openapi/codegen/calendar_ts_client.vsh index bbe748ee..8be56300 100755 --- a/examples/schemas/openapi/codegen/calendar_ts_client.vsh +++ b/examples/schemas/openapi/codegen/calendar_ts_client.vsh @@ -4,8 +4,8 @@ // This example demonstrates how to generate a typescript client // from a given OpenAPI Specification using the `openapi/codegen` module. import os -import freeflowuniverse.herolib.schemas.openapi -import freeflowuniverse.herolib.schemas.openapi.codegen +import incubaid.herolib.schemas.openapi +import incubaid.herolib.schemas.openapi.codegen const dir = os.dir(@FILE) const specification = openapi.new(path: '${dir}/meeting_api.json') or { diff --git a/examples/schemas/openrpc/zinit_rpc_example.vsh b/examples/schemas/openrpc/zinit_rpc_example.vsh index 37925a9d..b5c4db6b 100755 --- a/examples/schemas/openrpc/zinit_rpc_example.vsh +++ b/examples/schemas/openrpc/zinit_rpc_example.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -cg -gc none -d use_openssl -enable-globals run -import freeflowuniverse.herolib.schemas.jsonrpc -import freeflowuniverse.herolib.schemas.openrpc // for the model as used +import incubaid.herolib.schemas.jsonrpc +import incubaid.herolib.schemas.openrpc // for the model as used import json // Define the service status response structure based on the OpenRPC schema diff --git a/examples/sshagent/test_hero_sshagent.vsh b/examples/sshagent/test_hero_sshagent.vsh index 8ff8dbfd..692b53ab 100755 --- a/examples/sshagent/test_hero_sshagent.vsh +++ b/examples/sshagent/test_hero_sshagent.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run import os -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console // Test script for Hero SSH Agent functionality // This script demonstrates the key features of the hero sshagent command diff --git a/examples/threefold/grid/README.md b/examples/threefold/grid/README.md index 23c04fe9..3c07b37c 100644 --- a/examples/threefold/grid/README.md +++ b/examples/threefold/grid/README.md @@ -9,7 +9,7 @@ Create some `griddriver_install.vsh` file containing following code: ```v #!/usr/bin/env -S v -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.installers.tfgrid.griddriver as griddriverinstaller +import incubaid.herolib.installers.tfgrid.griddriver as griddriverinstaller mut reset:=true griddriverinstaller.install(reset:reset)! @@ -25,7 +25,7 @@ chmod +x ./griddriver_install.vsh ## Install from repo Checkout the `griddriver` main branch -https://github.com/threefoldtech/web3gw/tree/development_integration + Inside the web3gw directory, run: @@ -43,33 +43,33 @@ deploying resources on the grid. ## Utils -- `billing_hourly.vsh`: calculate the hourly billing for a specific contract +- `billing_hourly.vsh`: calculate the hourly billing for a specific contract ID. -- `cancel_contract.vsh`: cancel a specific contract on the TFGrid. -- `cancel_contracts.vsh`: cancel multiple contracts on the TFGrid. -- `deploy_vm_high_level.vsh`: deploy a virtual machine (VM) on the TFGrid +- `cancel_contract.vsh`: cancel a specific contract on the TFGrid. +- `cancel_contracts.vsh`: cancel multiple contracts on the TFGrid. +- `deploy_vm_high_level.vsh`: deploy a virtual machine (VM) on the TFGrid using a high-level approach. -- `get_contracts.vsh`: retrieve a list of all active contracts associated with +- `get_contracts.vsh`: retrieve a list of all active contracts associated with the configured identity on the TFGrid. -- `list_gateways.vsh`: list all available gateways on the TFGrid. -- `tfgrid_config.vsh`: configure the connection settings for interacting with +- `list_gateways.vsh`: list all available gateways on the TFGrid. +- `tfgrid_config.vsh`: configure the connection settings for interacting with the TFGrid. -- `zos_version.vsh`: check the version of the Zero-OS (ZOS) running on a +- `zos_version.vsh`: check the version of the Zero-OS (ZOS) running on a specific node. ## Tests -- `create_update_deployments.vsh`: create a deployment with various workloads +- `create_update_deployments.vsh`: create a deployment with various workloads (network, disk, public IP, VM, logs, ZDB) and a gateway name proxy, deploy it to a node, and update the deployment with the gateway name workload. -- `deploy_gw_fqdn.vsh`: deploy a gateway workload using a Fully Qualified +- `deploy_gw_fqdn.vsh`: deploy a gateway workload using a Fully Qualified Domain Name (FQDN). -- `deploy_gw_name.vsh`: deploy a gateway workload using a name contract. It +- `deploy_gw_name.vsh`: deploy a gateway workload using a name contract. It creates a GatewayNameProxy workload, reserves the name on the grid using a name contract, and deploys it to a specific node. -- `deploy_vm.vsh`: deploy a network (Znet) and a virtual machine (Zmachine). -- `deploy_zdb.vsh`: deploy a ZDB (Zero-DB) workload on a specific node. -- `holochain_vm.vsh`: set up a Holochain development environment on the +- `deploy_vm.vsh`: deploy a network (Znet) and a virtual machine (Zmachine). +- `deploy_zdb.vsh`: deploy a ZDB (Zero-DB) workload on a specific node. +- `holochain_vm.vsh`: set up a Holochain development environment on the ThreeFold Grid without manual configuration. The script is related to Holochain because it specifically deploys a Holochain development environment on the ThreeFold Grid. The Flist URL used in the virtual machine @@ -80,7 +80,7 @@ deploying resources on the grid. ./holochain_vm.vsh --mnemonic "your_mnemonic_phrase" --ssh_key "your_public_ssh_key" [--network main|test|qa|dev] [--code_server_pass "your_password"] [--cpu 4] [--ram 8] [--disk 30] [--public_ip] ``` -- `vm_with_gw_name.vsh`: deploy a VM workload along with a gateway using a +- `vm_with_gw_name.vsh`: deploy a VM workload along with a gateway using a name contract. It finds a node matching the VM capacity requirements, creates a network, a VM, and a gateway workload pointing to the VM. It then deploys the VM and gateway workloads to their respective nodes. Usage: diff --git a/examples/threefold/grid/deploy/create_update_deployments.vsh b/examples/threefold/grid/deploy/create_update_deployments.vsh index b9776617..f0c1e51f 100755 --- a/examples/threefold/grid/deploy/create_update_deployments.vsh +++ b/examples/threefold/grid/deploy/create_update_deployments.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.threefold.grid3.models -import freeflowuniverse.herolib.threefold.grid as tfgrid +import incubaid.herolib.threefold.grid3.models +import incubaid.herolib.threefold.grid as tfgrid import json import log diff --git a/examples/threefold/grid/deploy/deploy_gw_fqdn.vsh b/examples/threefold/grid/deploy/deploy_gw_fqdn.vsh index 0737bedf..52bc9d35 100755 --- a/examples/threefold/grid/deploy/deploy_gw_fqdn.vsh +++ b/examples/threefold/grid/deploy/deploy_gw_fqdn.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.threefold.grid as tfgrid -import freeflowuniverse.herolib.threefold.grid3.models +import incubaid.herolib.threefold.grid as tfgrid +import incubaid.herolib.threefold.grid3.models import log fn main() { diff --git a/examples/threefold/grid/deploy/deploy_gw_name.vsh b/examples/threefold/grid/deploy/deploy_gw_name.vsh index 4b2e9a5d..6b866871 100755 --- a/examples/threefold/grid/deploy/deploy_gw_name.vsh +++ b/examples/threefold/grid/deploy/deploy_gw_name.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.threefold.grid as tfgrid -import freeflowuniverse.herolib.threefold.grid3.models +import incubaid.herolib.threefold.grid as tfgrid +import incubaid.herolib.threefold.grid3.models import log fn main() { diff --git a/examples/threefold/grid/deploy/deploy_vm.vsh b/examples/threefold/grid/deploy/deploy_vm.vsh index 1ffc1b69..652c0f37 100755 --- a/examples/threefold/grid/deploy/deploy_vm.vsh +++ b/examples/threefold/grid/deploy/deploy_vm.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.threefold.grid3.models -import freeflowuniverse.herolib.threefold.grid as tfgrid +import incubaid.herolib.threefold.grid3.models +import incubaid.herolib.threefold.grid as tfgrid import json import log import os diff --git a/examples/threefold/grid/deploy/deploy_vm_high_level.vsh b/examples/threefold/grid/deploy/deploy_vm_high_level.vsh index e5dda2af..968b5d27 100755 --- a/examples/threefold/grid/deploy/deploy_vm_high_level.vsh +++ b/examples/threefold/grid/deploy/deploy_vm_high_level.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.threefold.grid3.models -import freeflowuniverse.herolib.threefold.grid as tfgrid +import incubaid.herolib.threefold.grid3.models +import incubaid.herolib.threefold.grid as tfgrid import log import os diff --git a/examples/threefold/grid/deploy/deploy_zdb.vsh b/examples/threefold/grid/deploy/deploy_zdb.vsh index b841bc58..e7bfadca 100755 --- a/examples/threefold/grid/deploy/deploy_zdb.vsh +++ b/examples/threefold/grid/deploy/deploy_zdb.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.threefold.grid3.models -import freeflowuniverse.herolib.threefold.grid as tfgrid +import incubaid.herolib.threefold.grid3.models +import incubaid.herolib.threefold.grid as tfgrid import log fn main() { diff --git a/examples/threefold/grid/deploy/holochain_vm.vsh b/examples/threefold/grid/deploy/holochain_vm.vsh index 3b4cc7ed..3a9b1b00 100755 --- a/examples/threefold/grid/deploy/holochain_vm.vsh +++ b/examples/threefold/grid/deploy/holochain_vm.vsh @@ -1,8 +1,8 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.threefold.grid3.models -import freeflowuniverse.herolib.threefold.grid as tfgrid -import freeflowuniverse.herolib.threefold.grid3.gridproxy +import incubaid.herolib.threefold.grid3.models +import incubaid.herolib.threefold.grid as tfgrid +import incubaid.herolib.threefold.grid3.gridproxy import flag import rand import json diff --git a/examples/threefold/grid/deploy/vm_with_gw_name.vsh b/examples/threefold/grid/deploy/vm_with_gw_name.vsh index 5d439489..36f096b2 100755 --- a/examples/threefold/grid/deploy/vm_with_gw_name.vsh +++ b/examples/threefold/grid/deploy/vm_with_gw_name.vsh @@ -1,9 +1,9 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.threefold.grid3.models -import freeflowuniverse.herolib.threefold.grid as tfgrid -import freeflowuniverse.herolib.threefold.grid3.gridproxy -import freeflowuniverse.herolib.threefold.grid3.gridproxy.model { NodeFilter } +import incubaid.herolib.threefold.grid3.models +import incubaid.herolib.threefold.grid as tfgrid +import incubaid.herolib.threefold.grid3.gridproxy +import incubaid.herolib.threefold.grid3.gridproxy.model { NodeFilter } import rand import log import os diff --git a/examples/threefold/grid/utils/cancel_contracts.vsh b/examples/threefold/grid/utils/cancel_contracts.vsh index 15a7aa84..f4ce3eed 100755 --- a/examples/threefold/grid/utils/cancel_contracts.vsh +++ b/examples/threefold/grid/utils/cancel_contracts.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.threefold.grid as tfgrid +import incubaid.herolib.threefold.grid as tfgrid import log fn test_cancel_contracts(contracts_ids []u64) ! { diff --git a/examples/threefold/grid/utils/tfgrid_config.vsh b/examples/threefold/grid/utils/tfgrid_config.vsh index df8c7c13..dc4e4b3b 100755 --- a/examples/threefold/grid/utils/tfgrid_config.vsh +++ b/examples/threefold/grid/utils/tfgrid_config.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.threefold.grid as tfgrid +import incubaid.herolib.threefold.grid as tfgrid mut cl := tfgrid.get('my_config')! mut cfg := cl.config()! diff --git a/examples/threefold/grid/utils/zos_version.vsh b/examples/threefold/grid/utils/zos_version.vsh index d4cbe23c..b015643c 100755 --- a/examples/threefold/grid/utils/zos_version.vsh +++ b/examples/threefold/grid/utils/zos_version.vsh @@ -1,8 +1,8 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.threefold.grid as tfgrid -import freeflowuniverse.herolib.threefold.griddriver -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.threefold.grid as tfgrid +import incubaid.herolib.threefold.griddriver +import incubaid.herolib.ui.console import log fn test_get_zos_version(node_id u32) ! { diff --git a/examples/threefold/grid/zdb_example.vsh b/examples/threefold/grid/zdb_example.vsh index ab1f2cb7..1496d1f4 100644 --- a/examples/threefold/grid/zdb_example.vsh +++ b/examples/threefold/grid/zdb_example.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.core.redisclient { RedisClient } +import incubaid.herolib.core.redisclient { RedisClient } struct ZDBSpecs { deployment_name string diff --git a/examples/threefold/gridproxy/bill.vsh b/examples/threefold/gridproxy/bill.vsh index 10572513..7b4b7795 100755 --- a/examples/threefold/gridproxy/bill.vsh +++ b/examples/threefold/gridproxy/bill.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.threefold.grid3.gridproxy -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.threefold.grid3.gridproxy +import incubaid.herolib.ui.console contract_id := u64(119450) mut gp_client := gridproxy.new(net: .dev, cache: false)! diff --git a/examples/threefold/gridproxy/contract.vsh b/examples/threefold/gridproxy/contract.vsh index 58b7e30c..712994a5 100755 --- a/examples/threefold/gridproxy/contract.vsh +++ b/examples/threefold/gridproxy/contract.vsh @@ -1,8 +1,8 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.threefold.grid as tfgrid -import freeflowuniverse.herolib.threefold.grid3.gridproxy -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.threefold.grid as tfgrid +import incubaid.herolib.threefold.grid3.gridproxy +import incubaid.herolib.ui.console fn get_contracts_example() ! { mut myfilter := gridproxy.contractfilter()! diff --git a/examples/threefold/gridproxy/farm.vsh b/examples/threefold/gridproxy/farm.vsh index 9287a2ef..f37e53fc 100755 --- a/examples/threefold/gridproxy/farm.vsh +++ b/examples/threefold/gridproxy/farm.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.threefold.grid3.gridproxy -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.threefold.grid3.gridproxy +import incubaid.herolib.ui.console fn get_farms_example() ! { mut myfilter := gridproxy.farmfilter()! diff --git a/examples/threefold/gridproxy/gateway.vsh b/examples/threefold/gridproxy/gateway.vsh index d5427389..7064ba9b 100755 --- a/examples/threefold/gridproxy/gateway.vsh +++ b/examples/threefold/gridproxy/gateway.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.threefold.grid3.gridproxy -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.threefold.grid3.gridproxy +import incubaid.herolib.ui.console fn get_gateway_nodes_example() ! { mut myfilter := gridproxy.nodefilter()! diff --git a/examples/threefold/gridproxy/grid.vsh b/examples/threefold/gridproxy/grid.vsh index 39535d3a..d626b0b7 100755 --- a/examples/threefold/gridproxy/grid.vsh +++ b/examples/threefold/gridproxy/grid.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.threefold.grid3.gridproxy -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.threefold.grid3.gridproxy +import incubaid.herolib.ui.console mut gp_client := gridproxy.new(net: .test, cache: true)! diff --git a/examples/threefold/gridproxy/node.vsh b/examples/threefold/gridproxy/node.vsh index 7c30e4c5..ddb21333 100755 --- a/examples/threefold/gridproxy/node.vsh +++ b/examples/threefold/gridproxy/node.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.threefold.grid3.gridproxy -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.threefold.grid3.gridproxy +import incubaid.herolib.ui.console fn get_nodes_example() ! { mut myfilter := gridproxy.nodefilter()! diff --git a/examples/threefold/gridproxy/stats.vsh b/examples/threefold/gridproxy/stats.vsh index d329b2b1..4b7b9c7b 100755 --- a/examples/threefold/gridproxy/stats.vsh +++ b/examples/threefold/gridproxy/stats.vsh @@ -1,8 +1,8 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.threefold.grid3.gridproxy -import freeflowuniverse.herolib.threefold.grid3.gridproxy.model { NodeStatus } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.threefold.grid3.gridproxy +import incubaid.herolib.threefold.grid3.gridproxy.model { NodeStatus } +import incubaid.herolib.ui.console fn get_online_grid_stats_example() ! { mut myfilter := gridproxy.statfilter()! diff --git a/examples/threefold/gridproxy/twin.vsh b/examples/threefold/gridproxy/twin.vsh index 7a798c5e..a614a2c1 100755 --- a/examples/threefold/gridproxy/twin.vsh +++ b/examples/threefold/gridproxy/twin.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.threefold.grid3.gridproxy -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.threefold.grid3.gridproxy +import incubaid.herolib.ui.console fn get_all_twins_example() ! { mut gp_client := gridproxy.new(net: .dev, cache: true)! diff --git a/examples/threefold/holochain/holochain_deployer.vsh b/examples/threefold/holochain/holochain_deployer.vsh index f3e3ae1e..8edbf54f 100755 --- a/examples/threefold/holochain/holochain_deployer.vsh +++ b/examples/threefold/holochain/holochain_deployer.vsh @@ -1,8 +1,8 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.threefold.tfrobot -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.clients.dagu +import incubaid.herolib.threefold.tfrobot +import incubaid.herolib.ui.console +import incubaid.herolib.clients.dagu console.print_header('Deploy test of vmachines on TFGrid using TFRobot.') diff --git a/examples/threefold/holochain/holochain_vms.vsh b/examples/threefold/holochain/holochain_vms.vsh index bbcdd594..37fb671f 100755 --- a/examples/threefold/holochain/holochain_vms.vsh +++ b/examples/threefold/holochain/holochain_vms.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.threefold.tfrobot -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.threefold.tfrobot +import incubaid.herolib.ui.console console.print_header("Get VM's.") diff --git a/examples/threefold/holochain/tasker_example.vsh b/examples/threefold/holochain/tasker_example.vsh index 1ea20b37..a3adb7ac 100755 --- a/examples/threefold/holochain/tasker_example.vsh +++ b/examples/threefold/holochain/tasker_example.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.threefold.tfrobot -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.threefold.tfrobot +import incubaid.herolib.ui.console console.print_header('Tasker Example.') diff --git a/examples/threefold/holochain/tasker_example2.vsh b/examples/threefold/holochain/tasker_example2.vsh index ab1c1bb5..c4d58869 100755 --- a/examples/threefold/holochain/tasker_example2.vsh +++ b/examples/threefold/holochain/tasker_example2.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.threefold.tfrobot -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.threefold.tfrobot +import incubaid.herolib.ui.console console.print_header('Tasker Example 2.') diff --git a/examples/threefold/incatokens/incatokens_simulate.vsh b/examples/threefold/incatokens/incatokens_simulate.vsh index 2acdc827..2e40494b 100755 --- a/examples/threefold/incatokens/incatokens_simulate.vsh +++ b/examples/threefold/incatokens/incatokens_simulate.vsh @@ -1,8 +1,8 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.threefold.incatokens +import incubaid.herolib.threefold.incatokens import os -import freeflowuniverse.herolib.core.playcmds +import incubaid.herolib.core.playcmds current_dir := os.dir(@FILE) heroscript_path := '${current_dir}/data' diff --git a/examples/threefold/solana/seahorse_vm.vsh b/examples/threefold/solana/seahorse_vm.vsh index 558afe93..4d357a4f 100755 --- a/examples/threefold/solana/seahorse_vm.vsh +++ b/examples/threefold/solana/seahorse_vm.vsh @@ -1,8 +1,8 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.threefold.grid3.models -import freeflowuniverse.herolib.threefold.grid as tfgrid -import freeflowuniverse.herolib.threefold.grid3.gridproxy +import incubaid.herolib.threefold.grid3.models +import incubaid.herolib.threefold.grid as tfgrid +import incubaid.herolib.threefold.grid3.gridproxy import time import flag import rand diff --git a/examples/threefold/tfgrid3deployer/filter.vsh b/examples/threefold/tfgrid3deployer/filter.vsh index 4738f5da..742ba27f 100755 --- a/examples/threefold/tfgrid3deployer/filter.vsh +++ b/examples/threefold/tfgrid3deployer/filter.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -gc none -cc tcc -d use_openssl -enable-globals -cg run -import freeflowuniverse.herolib.threefold.grid3.deployer +import incubaid.herolib.threefold.grid3.deployer const gigabyte = u64(1024 * 1024 * 1024) diff --git a/examples/threefold/tfgrid3deployer/gw_over_wireguard/gw_over_wireguard.vsh b/examples/threefold/tfgrid3deployer/gw_over_wireguard/gw_over_wireguard.vsh index c4d76216..9b08cadd 100755 --- a/examples/threefold/tfgrid3deployer/gw_over_wireguard/gw_over_wireguard.vsh +++ b/examples/threefold/tfgrid3deployer/gw_over_wireguard/gw_over_wireguard.vsh @@ -1,8 +1,8 @@ #!/usr/bin/env -S v -gc none -no-retry-compilation -d use_openssl -enable-globals -cg run -import freeflowuniverse.herolib.threefold.grid3.gridproxy -import freeflowuniverse.herolib.threefold.grid3.deployer -import freeflowuniverse.herolib.installers.threefold.griddriver +import incubaid.herolib.threefold.grid3.gridproxy +import incubaid.herolib.threefold.grid3.deployer +import incubaid.herolib.installers.threefold.griddriver import os import time diff --git a/examples/threefold/tfgrid3deployer/hetzner/hetzner.vsh b/examples/threefold/tfgrid3deployer/hetzner/hetzner.vsh index a6fd56f8..03ece693 100644 --- a/examples/threefold/tfgrid3deployer/hetzner/hetzner.vsh +++ b/examples/threefold/tfgrid3deployer/hetzner/hetzner.vsh @@ -1,9 +1,9 @@ #!/usr/bin/env -S v -gc none -d use_openssl -enable-globals -cg run //#!/usr/bin/env -S v -gc none -cc tcc -d use_openssl -enable-globals -cg run -import freeflowuniverse.herolib.threefold.grid3.gridproxy -import freeflowuniverse.herolib.threefold.grid3.deployer -import freeflowuniverse.herolib.installers.threefold.griddriver +import incubaid.herolib.threefold.grid3.gridproxy +import incubaid.herolib.threefold.grid3.deployer +import incubaid.herolib.installers.threefold.griddriver import os import time diff --git a/examples/threefold/tfgrid3deployer/open_webui_gw/open_webui_gw.vsh b/examples/threefold/tfgrid3deployer/open_webui_gw/open_webui_gw.vsh index 0f604257..e2b7ef0e 100755 --- a/examples/threefold/tfgrid3deployer/open_webui_gw/open_webui_gw.vsh +++ b/examples/threefold/tfgrid3deployer/open_webui_gw/open_webui_gw.vsh @@ -1,9 +1,9 @@ #!/usr/bin/env -S v -gc none -no-retry-compilation -d use_openssl -enable-globals -cg run //#!/usr/bin/env -S v -gc none -no-retry-compilation -cc tcc -d use_openssl -enable-globals -cg run -import freeflowuniverse.herolib.threefold.grid3.gridproxy -import freeflowuniverse.herolib.threefold.grid3.deployer -import freeflowuniverse.herolib.installers.threefold.griddriver +import incubaid.herolib.threefold.grid3.gridproxy +import incubaid.herolib.threefold.grid3.deployer +import incubaid.herolib.installers.threefold.griddriver import os import time diff --git a/examples/threefold/tfgrid3deployer/open_webui_gw/readme.md b/examples/threefold/tfgrid3deployer/open_webui_gw/readme.md index 9b746d6d..ca943adf 100644 --- a/examples/threefold/tfgrid3deployer/open_webui_gw/readme.md +++ b/examples/threefold/tfgrid3deployer/open_webui_gw/readme.md @@ -1,20 +1,24 @@ # OpenWebUI Deployment on ThreeFold Grid ## Overview + This script automates the deployment of an OpenWebUI instance on the ThreeFold Grid using the `tfgrid3deployer` module. It sets up a virtual machine (VM), configures networking, and assigns a webname for easy access. ## Requirements + - V compiler installed - OpenSSL support enabled - herolib dependencies: - - `freeflowuniverse.herolib.threefold.grid3.gridproxy` - - `freeflowuniverse.herolib.threefold.grid3.deployer` - - `freeflowuniverse.herolib.installers.threefold.griddriver` + - `incubaid.herolib.threefold.grid3.gridproxy` + - `incubaid.herolib.threefold.grid3.deployer` + - `incubaid.herolib.installers.threefold.griddriver` ## Installation + Ensure you have the required dependencies installed. The script will automatically install the `griddriver` before proceeding. ## Usage + Run the script using the following command: ```sh @@ -22,6 +26,7 @@ Run the script using the following command: ``` ### Script Execution Steps + 1. Installs the necessary ThreeFold Grid driver. 2. Retrieves credentials for deployment. 3. Creates a new deployment named `openwebui_example`. @@ -38,16 +43,18 @@ Run the script using the following command: 9. Retrieves and displays webname gateway details. ## Cleanup + To delete the deployment, run the following line in the script: ```v tfgrid3deployer.delete_deployment(deployment_name)! ``` - ## Gateway Information + The gateway points to the WireGuard IP of the VM on port 8080, which is the port that the OpenWebUI server is listening on. ## Notes + - Ensure you have a valid ThreeFold Grid account and necessary permissions to deploy resources. - Adjust VM specifications based on your requirements. diff --git a/examples/threefold/tfgrid3deployer/tfgrid3deployer_example.vsh b/examples/threefold/tfgrid3deployer/tfgrid3deployer_example.vsh index a03df698..6952b691 100755 --- a/examples/threefold/tfgrid3deployer/tfgrid3deployer_example.vsh +++ b/examples/threefold/tfgrid3deployer/tfgrid3deployer_example.vsh @@ -1,8 +1,8 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.threefold.grid3.gridproxy -import freeflowuniverse.herolib.threefold.grid3.deployer -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.threefold.grid3.gridproxy +import incubaid.herolib.threefold.grid3.deployer +import incubaid.herolib.ui.console fn main() { v := tfgrid3deployer.get()! diff --git a/examples/threefold/tfgrid3deployer/vm.vsh b/examples/threefold/tfgrid3deployer/vm.vsh index 769a34c8..892eb781 100755 --- a/examples/threefold/tfgrid3deployer/vm.vsh +++ b/examples/threefold/tfgrid3deployer/vm.vsh @@ -1,9 +1,9 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run import os -import freeflowuniverse.herolib.threefold.grid3.gridproxy -import freeflowuniverse.herolib.threefold.grid3.deployer -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.threefold.grid3.gridproxy +import incubaid.herolib.threefold.grid3.deployer +import incubaid.herolib.ui.console const node_id = u32(2009) const deployment_name = 'vmtestdeployment' diff --git a/examples/threefold/tfgrid3deployer/vm_gw_caddy/delete.vsh b/examples/threefold/tfgrid3deployer/vm_gw_caddy/delete.vsh index 4aa61d11..a027a077 100755 --- a/examples/threefold/tfgrid3deployer/vm_gw_caddy/delete.vsh +++ b/examples/threefold/tfgrid3deployer/vm_gw_caddy/delete.vsh @@ -1,8 +1,8 @@ #!/usr/bin/env -S v -gc none -cc tcc -d use_openssl -enable-globals -cg run -import freeflowuniverse.herolib.threefold.grid3.gridproxy -import freeflowuniverse.herolib.threefold.grid3.deployer -import freeflowuniverse.herolib.installers.threefold.griddriver +import incubaid.herolib.threefold.grid3.gridproxy +import incubaid.herolib.threefold.grid3.deployer +import incubaid.herolib.installers.threefold.griddriver import os import time diff --git a/examples/threefold/tfgrid3deployer/vm_gw_caddy/vm_gw_caddy.vsh b/examples/threefold/tfgrid3deployer/vm_gw_caddy/vm_gw_caddy.vsh index e5d2a434..fc712256 100755 --- a/examples/threefold/tfgrid3deployer/vm_gw_caddy/vm_gw_caddy.vsh +++ b/examples/threefold/tfgrid3deployer/vm_gw_caddy/vm_gw_caddy.vsh @@ -1,8 +1,8 @@ #!/usr/bin/env -S v -gc none -cc tcc -d use_openssl -enable-globals -cg run -import freeflowuniverse.herolib.threefold.grid3.gridproxy -import freeflowuniverse.herolib.threefold.grid3.deployer -import freeflowuniverse.herolib.installers.threefold.griddriver +import incubaid.herolib.threefold.grid3.gridproxy +import incubaid.herolib.threefold.grid3.deployer +import incubaid.herolib.installers.threefold.griddriver import os import time diff --git a/examples/tools/imagemagick/example.v b/examples/tools/imagemagick/example.v index 9d780882..64f2919a 100644 --- a/examples/tools/imagemagick/example.v +++ b/examples/tools/imagemagick/example.v @@ -1,6 +1,6 @@ module main -import freeflowuniverse.herolib.conversiontools.imagemagick +import incubaid.herolib.conversiontools.imagemagick import gittools fn do() ! { diff --git a/examples/ui/console/console2/console2.v b/examples/ui/console/console2/console2.v index 70872f41..43875d24 100644 --- a/examples/ui/console/console2/console2.v +++ b/examples/ui/console/console2/console2.v @@ -1,7 +1,7 @@ module main -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.ui.uimodel { DropDownArgs, QuestionArgs } +import incubaid.herolib.ui.console +import incubaid.herolib.ui.uimodel { DropDownArgs, QuestionArgs } fn do() ! { mut c := console.new() diff --git a/examples/ui/console/flow1/flow1.v b/examples/ui/console/flow1/flow1.v index fc1ed438..fbef77f7 100644 --- a/examples/ui/console/flow1/flow1.v +++ b/examples/ui/console/flow1/flow1.v @@ -1,7 +1,7 @@ module main -import freeflowuniverse.herolib.ui -import freeflowuniverse.herolib.ui.generic +import incubaid.herolib.ui +import incubaid.herolib.ui.generic struct RoomOrderFlow { pub mut: diff --git a/examples/ui/flow1.v b/examples/ui/flow1.v index 6fe0c49b..0f65bf55 100644 --- a/examples/ui/flow1.v +++ b/examples/ui/flow1.v @@ -1,6 +1,6 @@ module main -import freeflowuniverse.herolib.ui +import incubaid.herolib.ui struct RoomOrderFlow { current_product string diff --git a/examples/ui/silence.vsh b/examples/ui/silence.vsh index 84627974..7e2fded1 100755 --- a/examples/ui/silence.vsh +++ b/examples/ui/silence.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.osal -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.osal +import incubaid.herolib.ui.console console.silent_set() mut job2 := osal.exec(cmd: 'ls /', debug: true)! diff --git a/examples/ui/telegram/flow1.v b/examples/ui/telegram/flow1.v index 5e39c426..a37630bc 100644 --- a/examples/ui/telegram/flow1.v +++ b/examples/ui/telegram/flow1.v @@ -1,6 +1,6 @@ module main -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console struct RoomOrderFlow { current_product string diff --git a/examples/vfs/vfs_db/dedupestor_vfs.vsh b/examples/vfs/vfs_db/dedupestor_vfs.vsh index 8ff80639..ef60d4b8 100755 --- a/examples/vfs/vfs_db/dedupestor_vfs.vsh +++ b/examples/vfs/vfs_db/dedupestor_vfs.vsh @@ -2,9 +2,9 @@ import os import rand -import freeflowuniverse.herolib.vfs.vfs_db -import freeflowuniverse.herolib.data.dedupestor -import freeflowuniverse.herolib.data.ourdb +import incubaid.herolib.vfs.vfs_db +import incubaid.herolib.data.dedupestor +import incubaid.herolib.data.ourdb pub struct VFSDedupeDB { dedupestor.DedupeStore diff --git a/examples/vfs/vfs_db/ourdb_vfs.vsh b/examples/vfs/vfs_db/ourdb_vfs.vsh index 4c5a50c4..52707232 100755 --- a/examples/vfs/vfs_db/ourdb_vfs.vsh +++ b/examples/vfs/vfs_db/ourdb_vfs.vsh @@ -2,8 +2,8 @@ import os import rand -import freeflowuniverse.herolib.vfs.vfs_db -import freeflowuniverse.herolib.data.ourdb +import incubaid.herolib.vfs.vfs_db +import incubaid.herolib.data.ourdb example_data_dir := os.join_path(os.temp_dir(), 'ourdb_example_data_${rand.string(3)}') os.mkdir_all(example_data_dir)! diff --git a/examples/vfs/vfs_db/vfs_basics.vsh b/examples/vfs/vfs_db/vfs_basics.vsh index 80d3f030..bf3f7d7e 100755 --- a/examples/vfs/vfs_db/vfs_basics.vsh +++ b/examples/vfs/vfs_db/vfs_basics.vsh @@ -1,8 +1,8 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run import os -import freeflowuniverse.herolib.vfs.vfs_db -import freeflowuniverse.herolib.data.ourdb +import incubaid.herolib.vfs.vfs_db +import incubaid.herolib.data.ourdb // This example demonstrates directory operations in the VFS // - Creating directories with subdirectories diff --git a/examples/virt/daguserver/dagu_server.vsh b/examples/virt/daguserver/dagu_server.vsh index 00a0156a..106ee53a 100755 --- a/examples/virt/daguserver/dagu_server.vsh +++ b/examples/virt/daguserver/dagu_server.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.installers.sysadmintools.daguserver +import incubaid.herolib.installers.sysadmintools.daguserver // will call the installer underneith diff --git a/examples/virt/docker/ai_web_ui/ai_web_ui.vsh b/examples/virt/docker/ai_web_ui/ai_web_ui.vsh index ffe84d2f..46d62bd8 100644 --- a/examples/virt/docker/ai_web_ui/ai_web_ui.vsh +++ b/examples/virt/docker/ai_web_ui/ai_web_ui.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.virt.docker +import incubaid.herolib.virt.docker mut engine := docker.new(prefix: '', localonly: true)! diff --git a/examples/virt/docker/docker_dev.vsh b/examples/virt/docker/docker_dev.vsh index ddf54d08..8f7c8a6e 100755 --- a/examples/virt/docker/docker_dev.vsh +++ b/examples/virt/docker/docker_dev.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.virt.docker +import incubaid.herolib.virt.docker fn build() ! { mut engine := docker.new(prefix: '', localonly: true)! diff --git a/examples/virt/docker/docker_init.vsh b/examples/virt/docker/docker_init.vsh index a0b906a3..293b1d3e 100755 --- a/examples/virt/docker/docker_init.vsh +++ b/examples/virt/docker/docker_init.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.virt.docker +import incubaid.herolib.virt.docker mut engine := docker.new()! diff --git a/examples/virt/docker/docker_registry.vsh b/examples/virt/docker/docker_registry.vsh index 5e3c7ee4..ebea5649 100755 --- a/examples/virt/docker/docker_registry.vsh +++ b/examples/virt/docker/docker_registry.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.virt.docker +import incubaid.herolib.virt.docker mut engine := docker.new()! diff --git a/examples/virt/docker/docker_ubuntu.vsh b/examples/virt/docker/docker_ubuntu.vsh index 4fc4cc3e..6855db75 100755 --- a/examples/virt/docker/docker_ubuntu.vsh +++ b/examples/virt/docker/docker_ubuntu.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.virt.docker +import incubaid.herolib.virt.docker fn build() ! { mut engine := docker.new(prefix: '', localonly: true)! diff --git a/examples/virt/docker/presearch_docker.vsh b/examples/virt/docker/presearch_docker.vsh index a5f57024..b0f974d1 100755 --- a/examples/virt/docker/presearch_docker.vsh +++ b/examples/virt/docker/presearch_docker.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.virt.docker +import incubaid.herolib.virt.docker import os registration_code := os.getenv('PRESEARCH_CODE') diff --git a/examples/virt/docker/tf_dashboard.vsh b/examples/virt/docker/tf_dashboard.vsh index 01e947f4..8d146aeb 100755 --- a/examples/virt/docker/tf_dashboard.vsh +++ b/examples/virt/docker/tf_dashboard.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.virt.docker +import incubaid.herolib.virt.docker mut engine := docker.new(prefix: '', localonly: true)! diff --git a/examples/virt/heropods/heropods.vsh b/examples/virt/heropods/heropods.vsh index aafbdd12..f595d7f5 100755 --- a/examples/virt/heropods/heropods.vsh +++ b/examples/virt/heropods/heropods.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.virt.heropods +import incubaid.herolib.virt.heropods // Initialize factory mut factory := heropods.new( diff --git a/examples/virt/heropods/runcommands.vsh b/examples/virt/heropods/runcommands.vsh index 9352cc80..c32825a2 100644 --- a/examples/virt/heropods/runcommands.vsh +++ b/examples/virt/heropods/runcommands.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.virt.heropods +import incubaid.herolib.virt.heropods mut factory := heropods.new( reset: false diff --git a/examples/virt/hetzner/hetzner_example.vsh b/examples/virt/hetzner/hetzner_example.vsh index 1341c8f8..9557f52b 100755 --- a/examples/virt/hetzner/hetzner_example.vsh +++ b/examples/virt/hetzner/hetzner_example.vsh @@ -1,12 +1,12 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.virt.hetznermanager -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.builder +import incubaid.herolib.virt.hetznermanager +import incubaid.herolib.ui.console +import incubaid.herolib.core.base +import incubaid.herolib.builder import time import os -import freeflowuniverse.herolib.core.playcmds +import incubaid.herolib.core.playcmds user := os.environ()['HETZNER_USER'] or { println('HETZNER_USER not set') diff --git a/examples/virt/lima/lima_example.vsh b/examples/virt/lima/lima_example.vsh index dfa6f10c..0924df60 100755 --- a/examples/virt/lima/lima_example.vsh +++ b/examples/virt/lima/lima_example.vsh @@ -1,9 +1,9 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -// import freeflowuniverse.herolib.virt.lima -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.installers.virt.lima as limainstaller +// import incubaid.herolib.virt.lima +import incubaid.herolib.core.texttools +import incubaid.herolib.ui.console +import incubaid.herolib.installers.virt.lima as limainstaller import os mut i := limainstaller.get(create: true)! diff --git a/examples/virt/podman/podman.vsh b/examples/virt/podman/podman.vsh index eb149381..cc36dac9 100755 --- a/examples/virt/podman/podman.vsh +++ b/examples/virt/podman/podman.vsh @@ -1,8 +1,8 @@ #!/usr/bin/env -S v -n -w -enable-globals run -import freeflowuniverse.herolib.virt.podman -import freeflowuniverse.herolib.installers.virt.podman as podman_installer -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.virt.podman +import incubaid.herolib.installers.virt.podman as podman_installer +import incubaid.herolib.ui.console console.print_header('🐳 Comprehensive Podman Module Demo') console.print_stdout('This demo showcases both Simple API and Factory API approaches') diff --git a/examples/virt/windows/cloudhypervisor.vsh b/examples/virt/windows/cloudhypervisor.vsh index b9dd9574..6809a679 100755 --- a/examples/virt/windows/cloudhypervisor.vsh +++ b/examples/virt/windows/cloudhypervisor.vsh @@ -1,9 +1,9 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.installers.virt.cloudhypervisor as cloudhypervisor_installer -import freeflowuniverse.herolib.virt.cloudhypervisor -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.installers.virt.cloudhypervisor as cloudhypervisor_installer +import incubaid.herolib.virt.cloudhypervisor +import incubaid.herolib.core.texttools +import incubaid.herolib.ui.console import os mut ci := cloudhypervisor_installer.get()! diff --git a/examples/web/doctree/doctree_client.vsh b/examples/web/doctree/doctree_client.vsh index ae02177c..4099c9c9 100755 --- a/examples/web/doctree/doctree_client.vsh +++ b/examples/web/doctree/doctree_client.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.data.doctree -import freeflowuniverse.herolib.web.doctreeclient +import incubaid.herolib.data.doctree +import incubaid.herolib.web.doctreeclient import os println('This example demonstrates how to use the DocTreeClient to interact with doctree data.') diff --git a/examples/web/doctree/doctree_export.vsh b/examples/web/doctree/doctree_export.vsh index b954134d..a592c171 100755 --- a/examples/web/doctree/doctree_export.vsh +++ b/examples/web/doctree/doctree_export.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.data.doctree +import incubaid.herolib.data.doctree mut tree := doctree.new(name: 'test')! diff --git a/examples/web/doctree/markdown_example.vsh b/examples/web/doctree/markdown_example.vsh index 23c3f51d..4819defc 100755 --- a/examples/web/doctree/markdown_example.vsh +++ b/examples/web/doctree/markdown_example.vsh @@ -1,9 +1,9 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals run -// import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.ui.console +// import incubaid.herolib.core.texttools +import incubaid.herolib.ui.console import log -import freeflowuniverse.herolib.data.markdownparser +import incubaid.herolib.data.markdownparser import os console.print_header('Print markdown in treeview.') diff --git a/examples/web/docusaurus_example.vsh b/examples/web/docusaurus_example.vsh index 812f6ff7..797b020c 100755 --- a/examples/web/docusaurus_example.vsh +++ b/examples/web/docusaurus_example.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cg -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.core.playcmds +import incubaid.herolib.core.playcmds playcmds.run( heroscript: ' diff --git a/examples/web/markdown_renderer/markdown_parser.vsh b/examples/web/markdown_renderer/markdown_parser.vsh index 5ce12208..c8976ccc 100755 --- a/examples/web/markdown_renderer/markdown_parser.vsh +++ b/examples/web/markdown_renderer/markdown_parser.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none run -import freeflowuniverse.herolib.data.markdownparser2 +import incubaid.herolib.data.markdownparser2 // Sample markdown text text := '# Heading 1 diff --git a/examples/web/markdown_renderer/markdown_render.vsh b/examples/web/markdown_renderer/markdown_render.vsh index a9ed5edf..369cab14 100755 --- a/examples/web/markdown_renderer/markdown_render.vsh +++ b/examples/web/markdown_renderer/markdown_render.vsh @@ -1,11 +1,11 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -// import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.ui.console +// import incubaid.herolib.core.texttools +import incubaid.herolib.ui.console import log import os import markdown -import freeflowuniverse.herolib.data.markdownparser2 +import incubaid.herolib.data.markdownparser2 path1 := '${os.home_dir()}/code/github/incubaid/herolib/examples/web/mdbook_markdown/content/cybercity.md' diff --git a/examples/web/starllight_example.vsh b/examples/web/starllight_example.vsh index b680cb01..f1ce20de 100755 --- a/examples/web/starllight_example.vsh +++ b/examples/web/starllight_example.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cg -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.web.starlight -// import freeflowuniverse.herolib.data.doctree +import incubaid.herolib.web.starlight +// import incubaid.herolib.data.doctree // Create a new starlight factory mut docs := starlight.new( diff --git a/examples/web/ui_demo.vsh b/examples/web/ui_demo.vsh index 10f395eb..43ac78f4 100755 --- a/examples/web/ui_demo.vsh +++ b/examples/web/ui_demo.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cg -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.web.ui +import incubaid.herolib.web.ui fn main() { println('Starting UI test server on port 8080...') diff --git a/examples/webdav/webdav_vfs.vsh b/examples/webdav/webdav_vfs.vsh index c72bceef..3d7e9c25 100755 --- a/examples/webdav/webdav_vfs.vsh +++ b/examples/webdav/webdav_vfs.vsh @@ -1,8 +1,8 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.dav.webdav -import freeflowuniverse.herolib.vfs.vfs_db -import freeflowuniverse.herolib.data.ourdb +import incubaid.herolib.dav.webdav +import incubaid.herolib.vfs.vfs_db +import incubaid.herolib.data.ourdb import os import log diff --git a/generate.vsh b/generate.vsh index f9345fea..9b82669a 100755 --- a/generate.vsh +++ b/generate.vsh @@ -2,7 +2,7 @@ import os import flag -import freeflowuniverse.herolib.core.generator.installer_client as generator +import incubaid.herolib.core.generator.installer_client as generator mut fp := flag.new_flag_parser(os.args) fp.application('generate.vsh') diff --git a/install_herolib.vsh b/install_herolib.vsh index f01696d7..9f2d7f1e 100755 --- a/install_herolib.vsh +++ b/install_herolib.vsh @@ -45,9 +45,9 @@ fn addtoscript(tofind string, toadd string) ! { abs_dir_of_script := dir(@FILE) // Determine the organization name from the current path -// This makes the script work with any organization (incubaid, freeflowuniverse, etc.) +// This makes the script work with any organization (incubaid, incubaid, etc.) path_parts := abs_dir_of_script.split('/') -mut org_name := 'freeflowuniverse' // default fallback +mut org_name := 'incubaid' // default fallback for i, part in path_parts { if part == 'github' && i + 1 < path_parts.len { org_name = path_parts[i + 1] @@ -60,7 +60,7 @@ println('Detected organization: ${org_name}') // Reset symlinks for both possible organizations (cleanup) println('Resetting all symlinks...') os.rm('${os.home_dir()}/.vmodules/incubaid/herolib') or {} -os.rm('${os.home_dir()}/.vmodules/freeflowuniverse/herolib') or {} +os.rm('${os.home_dir()}/.vmodules/incubaid/herolib') or {} os.rm('${os.home_dir()}/.vmodules/${org_name}/herolib') or {} // Create necessary directories diff --git a/install_v.sh b/install_v.sh index 957bc45b..d3cba344 100755 --- a/install_v.sh +++ b/install_v.sh @@ -318,7 +318,7 @@ function hero_lib_get { hero_lib_pull else pushd $DIR_CODE/github/incubaid 2>&1 >> /dev/null - git clone --depth 1 --no-single-branch https://github.com/freeflowuniverse/herolib.git + git clone --depth 1 --no-single-branch https://github.com/incubaid/herolib.git popd 2>&1 >> /dev/null fi } diff --git a/lib/ai/escalayer/README.md b/lib/ai/escalayer/README.md index 42968e05..4498131b 100644 --- a/lib/ai/escalayer/README.md +++ b/lib/ai/escalayer/README.md @@ -25,7 +25,7 @@ The module is organized into the following components: ### Basic Example ```v -import freeflowuniverse.herolib.ai.mcp.aitools.escalayer +import incubaid.herolib.ai.mcp.aitools.escalayer fn main() { // Create a new task @@ -120,4 +120,4 @@ This module was designed based on the following requirements: For a detailed architecture overview, see [escalayer_architecture.md](./escalayer_architecture.md). -For a complete example, see [example.v](../servers/rhai). \ No newline at end of file +For a complete example, see [example.v](../servers/rhai). diff --git a/lib/ai/escalayer/escalayer.v b/lib/ai/escalayer/escalayer.v index 8648a4b7..a5705c2a 100644 --- a/lib/ai/escalayer/escalayer.v +++ b/lib/ai/escalayer/escalayer.v @@ -1,6 +1,6 @@ module escalayer -import freeflowuniverse.herolib.clients.openai +import incubaid.herolib.clients.openai // TaskParams defines the parameters for creating a new task @[params] diff --git a/lib/ai/escalayer/escalayer_architecture.md b/lib/ai/escalayer/escalayer_architecture.md index 0ae04c1f..10375e27 100644 --- a/lib/ai/escalayer/escalayer_architecture.md +++ b/lib/ai/escalayer/escalayer_architecture.md @@ -54,21 +54,25 @@ classDiagram ### 2.2 Component Descriptions #### Task + - Represents a complete AI task composed of multiple sequential unit tasks - Manages the flow of data between unit tasks - Tracks overall task progress and results #### UnitTask + - Represents a single step in the task - Contains a prompt function that generates the AI prompt - Contains a callback function that processes the AI response - Manages retries and model escalation #### ModelConfig + - Defines the configuration for an AI model - Includes model name, provider, and parameters like temperature and max tokens #### OpenRouter Client + - Handles communication with the OpenRouter API - Sends prompts to AI models and receives responses @@ -79,7 +83,7 @@ classDiagram ```v module escalayer -import freeflowuniverse.herolib.clients.openai +import incubaid.herolib.clients.openai // TaskParams defines the parameters for creating a new task @[params] @@ -157,7 +161,7 @@ pub fn (mut t Task) initiate(input string)! string { ```v module escalayer -import freeflowuniverse.herolib.clients.openai +import incubaid.herolib.clients.openai // UnitTask represents a single step in the task pub struct UnitTask { @@ -230,7 +234,7 @@ fn call_ai_model(prompt string, model ModelConfig)! string { ```v module escalayer -import freeflowuniverse.herolib.clients.openai +import incubaid.herolib.clients.openai import os // Get an OpenAI client configured for OpenRouter @@ -254,7 +258,7 @@ fn get_openrouter_client()! &openai.OpenAI { ## 4. Usage Example ```v -import freeflowuniverse.herolib.ai.mcp.aitools.escalayer +import incubaid.herolib.ai.mcp.aitools.escalayer fn main() { // Create a new task diff --git a/lib/ai/escalayer/models.v b/lib/ai/escalayer/models.v index 179a241f..cf6446f8 100644 --- a/lib/ai/escalayer/models.v +++ b/lib/ai/escalayer/models.v @@ -1,6 +1,6 @@ module escalayer -import freeflowuniverse.herolib.clients.openai +import incubaid.herolib.clients.openai // ModelConfig defines the configuration for an AI model pub struct ModelConfig { diff --git a/lib/ai/escalayer/openrouter.v b/lib/ai/escalayer/openrouter.v index 889d8fff..22a65bb9 100644 --- a/lib/ai/escalayer/openrouter.v +++ b/lib/ai/escalayer/openrouter.v @@ -1,7 +1,7 @@ module escalayer -import freeflowuniverse.herolib.clients.openai -import freeflowuniverse.herolib.osal.core as osal +import incubaid.herolib.clients.openai +import incubaid.herolib.osal.core as osal import os // Get an OpenAI client configured for OpenRouter diff --git a/lib/ai/escalayer/unit_task.v b/lib/ai/escalayer/unit_task.v index 60a0e489..c2f22082 100644 --- a/lib/ai/escalayer/unit_task.v +++ b/lib/ai/escalayer/unit_task.v @@ -1,7 +1,7 @@ module escalayer import log -import freeflowuniverse.herolib.clients.openai +import incubaid.herolib.clients.openai // UnitTask represents a single step in the task pub struct UnitTask { diff --git a/lib/ai/mcp/handler_logging.v b/lib/ai/mcp/handler_logging.v index 15020488..a076e3f4 100644 --- a/lib/ai/mcp/handler_logging.v +++ b/lib/ai/mcp/handler_logging.v @@ -1,7 +1,7 @@ module mcp import x.json2 -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.schemas.jsonrpc // LogLevel represents the logging levels supported by MCP pub enum LogLevel { diff --git a/lib/ai/mcp/mcp.v b/lib/ai/mcp/mcp.v index b6e16f96..70f2bed3 100644 --- a/lib/ai/mcp/mcp.v +++ b/lib/ai/mcp/mcp.v @@ -1,6 +1,6 @@ module mcp -import freeflowuniverse.herolib.ai.mcpcore +import incubaid.herolib.ai.mcpcore // Re-export the main types from mcpcore pub type Server = mcpcore.Server diff --git a/lib/ai/mcp/mcpgen/mcpgen.v b/lib/ai/mcp/mcpgen/mcpgen.v index 12b4cad4..186704d1 100644 --- a/lib/ai/mcp/mcpgen/mcpgen.v +++ b/lib/ai/mcp/mcpgen/mcpgen.v @@ -1,9 +1,9 @@ module mcpgen -import freeflowuniverse.herolib.develop.codetools as code -import freeflowuniverse.herolib.ai.mcp -import freeflowuniverse.herolib.schemas.jsonschema -import freeflowuniverse.herolib.schemas.jsonschema.codegen +import incubaid.herolib.develop.codetools as code +import incubaid.herolib.ai.mcp +import incubaid.herolib.schemas.jsonschema +import incubaid.herolib.schemas.jsonschema.codegen import os pub struct FunctionPointer { diff --git a/lib/ai/mcp/mcpgen/mcpgen_helpers.v b/lib/ai/mcp/mcpgen/mcpgen_helpers.v index 90525a4b..c63aa40b 100644 --- a/lib/ai/mcp/mcpgen/mcpgen_helpers.v +++ b/lib/ai/mcp/mcpgen/mcpgen_helpers.v @@ -1,6 +1,6 @@ module mcpgen -import freeflowuniverse.herolib.ai.mcp +import incubaid.herolib.ai.mcp pub fn result_to_mcp_tool_contents[T](result T) []mcp.ToolContent { return [result_to_mcp_tool_content(result)] diff --git a/lib/ai/mcp/mcpgen/mcpgen_tools.v b/lib/ai/mcp/mcpgen/mcpgen_tools.v index 35a5212d..5375d6a9 100644 --- a/lib/ai/mcp/mcpgen/mcpgen_tools.v +++ b/lib/ai/mcp/mcpgen/mcpgen_tools.v @@ -1,8 +1,8 @@ module mcpgen -import freeflowuniverse.herolib.ai.mcp -import freeflowuniverse.herolib.develop.codetools as code -import freeflowuniverse.herolib.schemas.jsonschema +import incubaid.herolib.ai.mcp +import incubaid.herolib.develop.codetools as code +import incubaid.herolib.schemas.jsonschema import x.json2 as json { Any } // import json diff --git a/lib/ai/mcp/mcpgen/server.v b/lib/ai/mcp/mcpgen/server.v index 4b7e749f..4438bac9 100644 --- a/lib/ai/mcp/mcpgen/server.v +++ b/lib/ai/mcp/mcpgen/server.v @@ -1,6 +1,6 @@ module mcpgen -import freeflowuniverse.herolib.ai.mcp +import incubaid.herolib.ai.mcp @[heap] pub struct MCPGen {} diff --git a/lib/ai/mcp/vcode/cmd/main.v b/lib/ai/mcp/vcode/cmd/main.v index 35f87e39..30028985 100644 --- a/lib/ai/mcp/vcode/cmd/main.v +++ b/lib/ai/mcp/vcode/cmd/main.v @@ -1,6 +1,6 @@ module main -import freeflowuniverse.herolib.ai.mcp.vcode +import incubaid.herolib.ai.mcp.vcode fn main() { // Create a VCode instance diff --git a/lib/ai/mcp/vcode/logic/vlang.v b/lib/ai/mcp/vcode/logic/vlang.v index 9e12c491..1a38ed8d 100644 --- a/lib/ai/mcp/vcode/logic/vlang.v +++ b/lib/ai/mcp/vcode/logic/vlang.v @@ -1,12 +1,12 @@ module vcode -import freeflowuniverse.herolib.ai.mcp -import freeflowuniverse.herolib.ai.mcp.logger +import incubaid.herolib.ai.mcp +import incubaid.herolib.ai.mcp.logger import os import log fn get_module_dir(mod string) string { - module_parts := mod.trim_string_left('freeflowuniverse.herolib').split('.') + module_parts := mod.trim_string_left('incubaid.herolib').split('.') return '${os.home_dir()}/code/github/incubaid/herolib/lib/${module_parts.join('/')}' } diff --git a/lib/ai/mcp/vcode/logic/vlang_tools.v b/lib/ai/mcp/vcode/logic/vlang_tools.v index 9a9f241a..74f6ac17 100644 --- a/lib/ai/mcp/vcode/logic/vlang_tools.v +++ b/lib/ai/mcp/vcode/logic/vlang_tools.v @@ -1,8 +1,8 @@ module vcode -import freeflowuniverse.herolib.ai.mcp -import freeflowuniverse.herolib.develop.codetools as code -import freeflowuniverse.herolib.schemas.jsonschema +import incubaid.herolib.ai.mcp +import incubaid.herolib.develop.codetools as code +import incubaid.herolib.schemas.jsonschema import x.json2 { Any } const get_function_from_file_tool = mcp.Tool{ diff --git a/lib/ai/mcp/vcode/logic/write_vfile_tool.v b/lib/ai/mcp/vcode/logic/write_vfile_tool.v index 3ddefcb0..2e1be813 100644 --- a/lib/ai/mcp/vcode/logic/write_vfile_tool.v +++ b/lib/ai/mcp/vcode/logic/write_vfile_tool.v @@ -1,8 +1,8 @@ module vcode -import freeflowuniverse.herolib.ai.mcp -import freeflowuniverse.herolib.develop.codetools as code -import freeflowuniverse.herolib.schemas.jsonschema +import incubaid.herolib.ai.mcp +import incubaid.herolib.develop.codetools as code +import incubaid.herolib.schemas.jsonschema import x.json2 { Any } const write_vfile_tool = mcp.Tool{ diff --git a/lib/ai/mcp/vcode/mcp/handlers.v b/lib/ai/mcp/vcode/mcp/handlers.v index 6aeb6e81..d2fc4905 100644 --- a/lib/ai/mcp/vcode/mcp/handlers.v +++ b/lib/ai/mcp/vcode/mcp/handlers.v @@ -1,9 +1,9 @@ module pugconvert -import freeflowuniverse.herolib.ai.mcp +import incubaid.herolib.ai.mcp import x.json2 as json { Any } -import freeflowuniverse.herolib.ai.mcp.aitools.pugconvert -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.ai.mcp.aitools.pugconvert +import incubaid.herolib.core.pathlib import os pub fn handler(arguments map[string]Any) !mcp.ToolCallResult { diff --git a/lib/ai/mcp/vcode/mcp/mcp.v b/lib/ai/mcp/vcode/mcp/mcp.v index b01c01a8..37ea6389 100644 --- a/lib/ai/mcp/vcode/mcp/mcp.v +++ b/lib/ai/mcp/vcode/mcp/mcp.v @@ -1,7 +1,7 @@ module vcode -import freeflowuniverse.herolib.ai.mcp -import freeflowuniverse.herolib.ai.mcp.vcode.logic +import incubaid.herolib.ai.mcp +import incubaid.herolib.ai.mcp.vcode.logic pub fn new_mcp_server() !&mcp.Server { // Note: Removed logger.info() as it interferes with STDIO transport JSON-RPC communication diff --git a/lib/ai/mcp/vcode/mcp/specifications.v b/lib/ai/mcp/vcode/mcp/specifications.v index efce2a74..7b3ad726 100644 --- a/lib/ai/mcp/vcode/mcp/specifications.v +++ b/lib/ai/mcp/vcode/mcp/specifications.v @@ -1,9 +1,9 @@ module pugconvert -import freeflowuniverse.herolib.ai.mcp +import incubaid.herolib.ai.mcp import x.json2 as json -import freeflowuniverse.herolib.schemas.jsonschema -import freeflowuniverse.herolib.ai.mcp.logger +import incubaid.herolib.schemas.jsonschema +import incubaid.herolib.ai.mcp.logger const specs = mcp.Tool{ name: 'pugconvert' diff --git a/lib/ai/mcp/vcode/vlang.v b/lib/ai/mcp/vcode/vlang.v index 8a3cf5d9..163799b0 100644 --- a/lib/ai/mcp/vcode/vlang.v +++ b/lib/ai/mcp/vcode/vlang.v @@ -1,12 +1,12 @@ module vcode -// import freeflowuniverse.herolib.ai.mcp -// import freeflowuniverse.herolib.ai.mcp.logger +// import incubaid.herolib.ai.mcp +// import incubaid.herolib.ai.mcp.logger import os import log fn get_module_dir(mod string) string { - module_parts := mod.trim_string_left('freeflowuniverse.herolib').split('.') + module_parts := mod.trim_string_left('incubaid.herolib').split('.') return '${os.home_dir()}/code/github/incubaid/herolib/lib/${module_parts.join('/')}' } diff --git a/lib/ai/mcp/vcode/vlang_tools.v b/lib/ai/mcp/vcode/vlang_tools.v index 06d0d0b5..f90b2d44 100644 --- a/lib/ai/mcp/vcode/vlang_tools.v +++ b/lib/ai/mcp/vcode/vlang_tools.v @@ -1,9 +1,9 @@ module vcode -// import freeflowuniverse.herolib.ai.mcpcore -// import freeflowuniverse.herolib.core.code.vlang_utils -// import freeflowuniverse.herolib.core.code -// import freeflowuniverse.herolib.schemas.jsonschema +// import incubaid.herolib.ai.mcpcore +// import incubaid.herolib.core.code.vlang_utils +// import incubaid.herolib.core.code +// import incubaid.herolib.schemas.jsonschema // import x.json2 // TODO: Uncomment when mcpcore module is fixed diff --git a/lib/ai/mcp/vcode/write_vfile_tool.v b/lib/ai/mcp/vcode/write_vfile_tool.v index 412e1f00..8b6a3803 100644 --- a/lib/ai/mcp/vcode/write_vfile_tool.v +++ b/lib/ai/mcp/vcode/write_vfile_tool.v @@ -1,10 +1,10 @@ module vcode -// import freeflowuniverse.herolib.ai.mcpcore +// import incubaid.herolib.ai.mcpcore // TODO: Uncomment when mcpcore module is fixed /* -// import freeflowuniverse.herolib.develop.codetools as code -import freeflowuniverse.herolib.schemas.jsonschema +// import incubaid.herolib.develop.codetools as code +import incubaid.herolib.schemas.jsonschema import x.json2 { Any } const write_vfile_tool = mcpcore.Tool{ diff --git a/lib/ai/mcpcore/README.md b/lib/ai/mcpcore/README.md index c0e09e2a..c2fef194 100644 --- a/lib/ai/mcpcore/README.md +++ b/lib/ai/mcpcore/README.md @@ -40,8 +40,8 @@ curl -fsSL https://bun.sh/install | bash To create a new MCP server using the core module: ```v -import freeflowuniverse.herolib.ai.mcp -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.ai.mcp +import incubaid.herolib.schemas.jsonrpc // Create a backend (memory-based or custom implementation) backend := mcp.MemoryBackend{ diff --git a/lib/ai/mcpcore/cmd/mcp.v b/lib/ai/mcpcore/cmd/mcp.v index 378042db..6819953e 100644 --- a/lib/ai/mcpcore/cmd/mcp.v +++ b/lib/ai/mcpcore/cmd/mcp.v @@ -2,12 +2,12 @@ module main import os import cli { Command, Flag } -import freeflowuniverse.herolib.osal.core as osal -// import freeflowuniverse.herolib.ai.mcp.vcode -// import freeflowuniverse.herolib.ai.mcp.mcpgen -// import freeflowuniverse.herolib.ai.mcp.baobab -// import freeflowuniverse.herolib.ai.mcp.rhai.mcp as rhai_mcp -// import freeflowuniverse.herolib.ai.mcp.rust +import incubaid.herolib.osal.core as osal +// import incubaid.herolib.ai.mcp.vcode +// import incubaid.herolib.ai.mcp.mcpgen +// import incubaid.herolib.ai.mcp.baobab +// import incubaid.herolib.ai.mcp.rhai.mcp as rhai_mcp +// import incubaid.herolib.ai.mcp.rust fn main() { do() or { panic(err) } diff --git a/lib/ai/mcpcore/factory.v b/lib/ai/mcpcore/factory.v index 20892dc8..795d475a 100644 --- a/lib/ai/mcpcore/factory.v +++ b/lib/ai/mcpcore/factory.v @@ -4,7 +4,7 @@ import time import os import log import x.json2 -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.schemas.jsonrpc @[params] pub struct ServerParams { diff --git a/lib/ai/mcpcore/handler_initialize.v b/lib/ai/mcpcore/handler_initialize.v index ac26acd8..aad1b936 100644 --- a/lib/ai/mcpcore/handler_initialize.v +++ b/lib/ai/mcpcore/handler_initialize.v @@ -4,7 +4,7 @@ import time import os import log import x.json2 -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.schemas.jsonrpc // initialize_handler handles the initialize request according to the MCP specification fn (mut s Server) initialize_handler(data string) !string { diff --git a/lib/ai/mcpcore/handler_initialize_test.v b/lib/ai/mcpcore/handler_initialize_test.v index 160428cf..d16549ba 100644 --- a/lib/ai/mcpcore/handler_initialize_test.v +++ b/lib/ai/mcpcore/handler_initialize_test.v @@ -1,6 +1,6 @@ module mcpcore -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.schemas.jsonrpc import json // This file contains tests for the MCP initialize handler implementation. diff --git a/lib/ai/mcpcore/handler_prompts.v b/lib/ai/mcpcore/handler_prompts.v index 7bd5dcc1..55514641 100644 --- a/lib/ai/mcpcore/handler_prompts.v +++ b/lib/ai/mcpcore/handler_prompts.v @@ -5,7 +5,7 @@ import os import log import x.json2 import json -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.schemas.jsonrpc // Prompt related structs diff --git a/lib/ai/mcpcore/handler_resources.v b/lib/ai/mcpcore/handler_resources.v index 2f06f20a..f0e67d5c 100644 --- a/lib/ai/mcpcore/handler_resources.v +++ b/lib/ai/mcpcore/handler_resources.v @@ -5,7 +5,7 @@ import os import log import x.json2 import json -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.schemas.jsonrpc pub struct Resource { pub: diff --git a/lib/ai/mcpcore/handler_sampling.v b/lib/ai/mcpcore/handler_sampling.v index cabef572..2f16f21d 100644 --- a/lib/ai/mcpcore/handler_sampling.v +++ b/lib/ai/mcpcore/handler_sampling.v @@ -5,7 +5,7 @@ import os import log import x.json2 import json -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.schemas.jsonrpc // Sampling related structs diff --git a/lib/ai/mcpcore/handler_tools.v b/lib/ai/mcpcore/handler_tools.v index e3b7d714..2d8eedcb 100644 --- a/lib/ai/mcpcore/handler_tools.v +++ b/lib/ai/mcpcore/handler_tools.v @@ -2,8 +2,8 @@ module mcpcore import x.json2 import json -import freeflowuniverse.herolib.schemas.jsonrpc -import freeflowuniverse.herolib.schemas.jsonschema +import incubaid.herolib.schemas.jsonrpc +import incubaid.herolib.schemas.jsonschema // Tool related structs diff --git a/lib/ai/mcpcore/model_configuration.v b/lib/ai/mcpcore/model_configuration.v index ad38a873..1d8f9550 100644 --- a/lib/ai/mcpcore/model_configuration.v +++ b/lib/ai/mcpcore/model_configuration.v @@ -4,7 +4,7 @@ import time import os import log import x.json2 -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.schemas.jsonrpc const protocol_version = '2024-11-05' // MCP server implementation using stdio transport diff --git a/lib/ai/mcpcore/model_configuration_test.v b/lib/ai/mcpcore/model_configuration_test.v index 02ca29fa..1ac1763b 100644 --- a/lib/ai/mcpcore/model_configuration_test.v +++ b/lib/ai/mcpcore/model_configuration_test.v @@ -1,6 +1,6 @@ module mcpcore -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.schemas.jsonrpc import json // This file contains tests for the MCP initialize handler implementation. diff --git a/lib/ai/mcpcore/model_error.v b/lib/ai/mcpcore/model_error.v index bd2f6744..444fcb30 100644 --- a/lib/ai/mcpcore/model_error.v +++ b/lib/ai/mcpcore/model_error.v @@ -1,6 +1,6 @@ module mcpcore -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.schemas.jsonrpc // resource_not_found indicates that the requested resource doesn't exist. // This error is returned when the resource specified in the request is not found. diff --git a/lib/ai/mcpcore/server.v b/lib/ai/mcpcore/server.v index 4da173c9..27435a57 100644 --- a/lib/ai/mcpcore/server.v +++ b/lib/ai/mcpcore/server.v @@ -2,7 +2,7 @@ module mcpcore import time import os -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.schemas.jsonrpc // Server is the main MCP server struct @[heap] diff --git a/lib/biz/bizmodel/act.v b/lib/biz/bizmodel/act.v index 9b519ab2..46dd4c00 100644 --- a/lib/biz/bizmodel/act.v +++ b/lib/biz/bizmodel/act.v @@ -1,13 +1,13 @@ module bizmodel import os -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.core.playbook { Action } -import freeflowuniverse.herolib.ui.console -// import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.data.paramsparser { Params } -import freeflowuniverse.herolib.biz.spreadsheet { PeriodType, RowGetArgs, UnitType } +import incubaid.herolib.core.texttools +import incubaid.herolib.core.pathlib +import incubaid.herolib.core.playbook { Action } +import incubaid.herolib.ui.console +// import incubaid.herolib.core.texttools +import incubaid.herolib.data.paramsparser { Params } +import incubaid.herolib.biz.spreadsheet { PeriodType, RowGetArgs, UnitType } pub fn (mut m BizModel) act(action Action) !Action { return match texttools.snake_case(action.name) { diff --git a/lib/biz/bizmodel/docu/revenue.md b/lib/biz/bizmodel/docu/revenue.md index dbc37557..135ace8a 100644 --- a/lib/biz/bizmodel/docu/revenue.md +++ b/lib/biz/bizmodel/docu/revenue.md @@ -1,4 +1,4 @@ -# Revenue +# Revenue ``` !!bizmodel.revenue_define bizname:'test' name:'oem1' ... @@ -21,7 +21,7 @@ cogs stands for cost of goods - cogs_delay: delay in months between cogs and revenue - extrapolate: if you want to extrapolate revenue or cogs do extrapolate:1, default is 0 -### results in +### results in follow rows in sheets @@ -36,16 +36,14 @@ follow rows in sheets - revenue_item_setup_delay, delay between sell and recognition of sale in months e.g. 1 - revenue_item_monthly, revenue per month for 1 item - revenue_item_monthly_delay, how many months before monthly revenue starts -- revenue_item_monthly_perc, how much percent of revenue_item_setup will come back over months e.g. 20% +- revenue_item_monthly_perc, how much percent of revenue_item_setup will come back over months e.g. 20% - cogs_item_setup, cost of good for 1 item at setup - cogs_item_setup_rev_perc: what is percentage of the revenue which is cogs, e.g. 2% - cogs_item_monthly, cost of goods for the monthly per 1 item - cogs_item_monthly_rev_perc: what is percentage of the monthly revenue which is cogs, e.g. 10% - cogs_item_delay, how many months before cogs starts after sales - - -### results in +### results in follow rows in sheets @@ -62,7 +60,7 @@ follow rows in sheets ```v -import freeflowuniverse.herolib.biz.bizmodel +import incubaid.herolib.biz.bizmodel import os heroscript:=" @@ -89,4 +87,4 @@ mut bm:=bizmodel.get("test")! bm.sheet.pprint()! -``` \ No newline at end of file +``` diff --git a/lib/biz/bizmodel/export.v b/lib/biz/bizmodel/export.v index fd72e139..25a0cd95 100644 --- a/lib/biz/bizmodel/export.v +++ b/lib/biz/bizmodel/export.v @@ -1,9 +1,9 @@ module bizmodel import os -// import freeflowuniverse.herolib.web.docusaurus -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core.pathlib +// import incubaid.herolib.web.docusaurus +import incubaid.herolib.core.texttools +import incubaid.herolib.core.pathlib @[params] pub struct ExportArgs { @@ -43,7 +43,7 @@ pub fn (model BizModel) write_introduction(args ExportArgs) ! { } pub fn (model BizModel) write_operational_plan(args ExportArgs) ! { - mut sim:=model + mut sim := model mut dir := pathlib.get_dir(path: '${args.path}/operational_plan')! mut ops_page := pathlib.get_file(path: '${dir.path}/operational_plan.md')! ops_page.write('# Operational Plan')! diff --git a/lib/biz/bizmodel/export_csv.v b/lib/biz/bizmodel/export_csv.v index 2ef25fe5..90598d48 100644 --- a/lib/biz/bizmodel/export_csv.v +++ b/lib/biz/bizmodel/export_csv.v @@ -1,7 +1,7 @@ module bizmodel import os -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib @[params] pub struct ExportCSVArgs { diff --git a/lib/biz/bizmodel/export_csv_test.vsh b/lib/biz/bizmodel/export_csv_test.vsh index 9b04437d..ef421f48 100755 --- a/lib/biz/bizmodel/export_csv_test.vsh +++ b/lib/biz/bizmodel/export_csv_test.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -cg -gc none -no-retry-compilation -cc tcc -d use_openssl -enable-globals run import os -import freeflowuniverse.herolib.biz.bizmodel +import incubaid.herolib.biz.bizmodel bizmodel_name := 'test' export_path := '${os.home_dir}/Downloads/bizmodel' diff --git a/lib/biz/bizmodel/export_test.v b/lib/biz/bizmodel/export_test.v index e12680d1..c2cc9ff2 100644 --- a/lib/biz/bizmodel/export_test.v +++ b/lib/biz/bizmodel/export_test.v @@ -1,7 +1,7 @@ module bizmodel import os -import freeflowuniverse.herolib.web.docusaurus +import incubaid.herolib.web.docusaurus const bizmodel_name = 'test' const export_path = os.join_path(os.dir(@FILE), 'exampledata') diff --git a/lib/biz/bizmodel/factory.v b/lib/biz/bizmodel/factory.v index fbdc8506..cbb18ac7 100644 --- a/lib/biz/bizmodel/factory.v +++ b/lib/biz/bizmodel/factory.v @@ -1,7 +1,7 @@ module bizmodel -import freeflowuniverse.herolib.biz.spreadsheet -import freeflowuniverse.herolib.core.playbook +import incubaid.herolib.biz.spreadsheet +import incubaid.herolib.core.playbook __global ( bizmodels shared map[string]&BizModel diff --git a/lib/biz/bizmodel/macros.v b/lib/biz/bizmodel/macros.v index 07649e74..d658525c 100644 --- a/lib/biz/bizmodel/macros.v +++ b/lib/biz/bizmodel/macros.v @@ -1,9 +1,9 @@ module bizmodel -import freeflowuniverse.herolib.core.playbook -import freeflowuniverse.herolib.data.paramsparser -import freeflowuniverse.herolib.data.markdown.elements -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook +import incubaid.herolib.data.paramsparser +import incubaid.herolib.data.markdown.elements +import incubaid.herolib.ui.console pub fn playmacro(action playbook.Action) !string { p := action.params diff --git a/lib/biz/bizmodel/model.v b/lib/biz/bizmodel/model.v index a6d98f46..b1b75254 100644 --- a/lib/biz/bizmodel/model.v +++ b/lib/biz/bizmodel/model.v @@ -1,8 +1,8 @@ module bizmodel import os -import freeflowuniverse.herolib.biz.spreadsheet -import freeflowuniverse.herolib.data.ourtime +import incubaid.herolib.biz.spreadsheet +import incubaid.herolib.data.ourtime @[heap] pub struct BizModel { diff --git a/lib/biz/bizmodel/play.v b/lib/biz/bizmodel/play.v index 63bb4d2f..2ccc4b87 100644 --- a/lib/biz/bizmodel/play.v +++ b/lib/biz/bizmodel/play.v @@ -1,8 +1,8 @@ module bizmodel import arrays -import freeflowuniverse.herolib.core.playbook { Action, PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook { Action, PlayBook } +import incubaid.herolib.ui.console const action_priorities = { 0: ['department_define', 'costcenter_define'] diff --git a/lib/biz/bizmodel/play_cost.v b/lib/biz/bizmodel/play_cost.v index 93a928c0..a978e31c 100644 --- a/lib/biz/bizmodel/play_cost.v +++ b/lib/biz/bizmodel/play_cost.v @@ -1,7 +1,7 @@ module bizmodel -import freeflowuniverse.herolib.core.playbook { Action } -import freeflowuniverse.herolib.data.currency +import incubaid.herolib.core.playbook { Action } +import incubaid.herolib.data.currency import math // Example HeroScript for cost_define_action: diff --git a/lib/biz/bizmodel/play_costcenter.v b/lib/biz/bizmodel/play_costcenter.v index e3fb361b..fc57714d 100644 --- a/lib/biz/bizmodel/play_costcenter.v +++ b/lib/biz/bizmodel/play_costcenter.v @@ -1,7 +1,7 @@ module bizmodel -import freeflowuniverse.herolib.core.playbook { Action } -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.playbook { Action } +import incubaid.herolib.core.texttools // Example HeroScript for costcenter_define_action: // !!bizmodel.costcenter_define bizname:'test' diff --git a/lib/biz/bizmodel/play_department.v b/lib/biz/bizmodel/play_department.v index 3bb46bbd..b7259609 100644 --- a/lib/biz/bizmodel/play_department.v +++ b/lib/biz/bizmodel/play_department.v @@ -1,6 +1,6 @@ module bizmodel -import freeflowuniverse.herolib.core.playbook { Action } +import incubaid.herolib.core.playbook { Action } // !!bizmodel.department_define bizname:'test' // name:'engineering' diff --git a/lib/biz/bizmodel/play_funding.v b/lib/biz/bizmodel/play_funding.v index ccb85925..74b0038e 100644 --- a/lib/biz/bizmodel/play_funding.v +++ b/lib/biz/bizmodel/play_funding.v @@ -1,6 +1,6 @@ module bizmodel -import freeflowuniverse.herolib.core.playbook { Action } +import incubaid.herolib.core.playbook { Action } // !!hr.funding_define // - name: identifier for the funding entity diff --git a/lib/biz/bizmodel/play_hr.v b/lib/biz/bizmodel/play_hr.v index 36301c5c..4d0b9f9f 100644 --- a/lib/biz/bizmodel/play_hr.v +++ b/lib/biz/bizmodel/play_hr.v @@ -1,7 +1,7 @@ module bizmodel -import freeflowuniverse.herolib.core.playbook { Action } -import freeflowuniverse.herolib.data.currency +import incubaid.herolib.core.playbook { Action } +import incubaid.herolib.data.currency import math // populate the params for hr diff --git a/lib/biz/bizmodel/play_pl.v b/lib/biz/bizmodel/play_pl.v index 521bbef0..54c7cff7 100644 --- a/lib/biz/bizmodel/play_pl.v +++ b/lib/biz/bizmodel/play_pl.v @@ -1,8 +1,8 @@ module bizmodel import arrays -import freeflowuniverse.herolib.core.playbook -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook +import incubaid.herolib.ui.console // revenue_total calculates and aggregates the total revenue and cost of goods sold (COGS) for the business model fn (mut sim BizModel) pl_total() ! { diff --git a/lib/biz/bizmodel/play_product_revenue.v b/lib/biz/bizmodel/play_product_revenue.v index d90e3631..59ddff42 100644 --- a/lib/biz/bizmodel/play_product_revenue.v +++ b/lib/biz/bizmodel/play_product_revenue.v @@ -1,7 +1,7 @@ module bizmodel -import freeflowuniverse.herolib.core.playbook { Action } -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.playbook { Action } +import incubaid.herolib.core.texttools // see lib/biz/bizmodel/docs/revenue.md fn (mut m BizModel) revenue_action(action Action) !Action { diff --git a/lib/biz/bizmodel/play_product_revenue_item.v b/lib/biz/bizmodel/play_product_revenue_item.v index 48ab0bcc..278cf521 100644 --- a/lib/biz/bizmodel/play_product_revenue_item.v +++ b/lib/biz/bizmodel/play_product_revenue_item.v @@ -1,7 +1,7 @@ module bizmodel -import freeflowuniverse.herolib.core.playbook { Action } -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.playbook { Action } +import incubaid.herolib.core.texttools // see lib/biz/bizmodel/docs/revenue.md fn (mut m BizModel) revenue_item_action(action Action) !Action { diff --git a/lib/biz/bizmodel/play_product_revenue_total.v b/lib/biz/bizmodel/play_product_revenue_total.v index 57b9336b..650db1ed 100644 --- a/lib/biz/bizmodel/play_product_revenue_total.v +++ b/lib/biz/bizmodel/play_product_revenue_total.v @@ -1,6 +1,6 @@ module bizmodel -import freeflowuniverse.herolib.core.playbook +import incubaid.herolib.core.playbook // revenue_total calculates and aggregates the total revenue and cost of goods sold (COGS) for the business model fn (mut sim BizModel) revenue_total() ! { diff --git a/lib/biz/bizmodel/play_tools.v b/lib/biz/bizmodel/play_tools.v index 6a764163..e168df2e 100644 --- a/lib/biz/bizmodel/play_tools.v +++ b/lib/biz/bizmodel/play_tools.v @@ -1,7 +1,7 @@ module bizmodel -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core.playbook { Action } +import incubaid.herolib.core.texttools +import incubaid.herolib.core.playbook { Action } pub struct RowDescrFields { pub mut: diff --git a/lib/biz/investortool/company.v b/lib/biz/investortool/company.v index 2829f45a..a29b1e63 100644 --- a/lib/biz/investortool/company.v +++ b/lib/biz/investortool/company.v @@ -1,6 +1,6 @@ module investortool -import freeflowuniverse.herolib.core.playbook +import incubaid.herolib.core.playbook @[heap] pub struct Company { diff --git a/lib/biz/investortool/employee.v b/lib/biz/investortool/employee.v index 7dc5cf19..4577a952 100644 --- a/lib/biz/investortool/employee.v +++ b/lib/biz/investortool/employee.v @@ -1,8 +1,8 @@ module investortool -import freeflowuniverse.herolib.core.playbook -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.data.currency +import incubaid.herolib.core.playbook +import incubaid.herolib.data.ourtime +import incubaid.herolib.data.currency // TODO add currency and ourtime types @[heap] diff --git a/lib/biz/investortool/factory.v b/lib/biz/investortool/factory.v index c40afe7d..52231361 100644 --- a/lib/biz/investortool/factory.v +++ b/lib/biz/investortool/factory.v @@ -1,6 +1,6 @@ module investortool -import freeflowuniverse.herolib.core.playbook +import incubaid.herolib.core.playbook // TODO: need to do a global __global ( diff --git a/lib/biz/investortool/investment_share.v b/lib/biz/investortool/investment_share.v index b84bf8a0..838ad6d6 100644 --- a/lib/biz/investortool/investment_share.v +++ b/lib/biz/investortool/investment_share.v @@ -1,8 +1,8 @@ module investortool -import freeflowuniverse.herolib.core.playbook -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.data.currency +import incubaid.herolib.core.playbook +import incubaid.herolib.data.ourtime +import incubaid.herolib.data.currency @[heap] pub struct InvestmentShares { diff --git a/lib/biz/investortool/investor.v b/lib/biz/investortool/investor.v index 65ecb0e1..f359af72 100644 --- a/lib/biz/investortool/investor.v +++ b/lib/biz/investortool/investor.v @@ -1,6 +1,6 @@ module investortool -import freeflowuniverse.herolib.core.playbook +import incubaid.herolib.core.playbook @[heap] pub struct Investor { diff --git a/lib/biz/investortool/simulator/play.v b/lib/biz/investortool/simulator/play.v index beb2c4d4..c04f53ea 100644 --- a/lib/biz/investortool/simulator/play.v +++ b/lib/biz/investortool/simulator/play.v @@ -1,7 +1,7 @@ module investorsimulator -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.biz.investortool +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.biz.investortool pub fn (mut s Simulator) play(mut plbook PlayBook) ! { for mut action in plbook.find(filter: 'investorsimulator.user_view_add')! { diff --git a/lib/biz/investortool/simulator/simulator.v b/lib/biz/investortool/simulator/simulator.v index bc219634..c568a037 100644 --- a/lib/biz/investortool/simulator/simulator.v +++ b/lib/biz/investortool/simulator/simulator.v @@ -1,7 +1,7 @@ module investorsimulator -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.biz.investortool +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.biz.investortool __global ( simulators map[string]Simulator diff --git a/lib/biz/investortool/user.v b/lib/biz/investortool/user.v index e285f530..15d67473 100644 --- a/lib/biz/investortool/user.v +++ b/lib/biz/investortool/user.v @@ -1,6 +1,6 @@ module investortool -import freeflowuniverse.herolib.core.playbook +import incubaid.herolib.core.playbook @[heap] pub struct User { diff --git a/lib/biz/spreadsheet/calc_test.v b/lib/biz/spreadsheet/calc_test.v index 4e41ca98..ea006f49 100644 --- a/lib/biz/spreadsheet/calc_test.v +++ b/lib/biz/spreadsheet/calc_test.v @@ -1,7 +1,7 @@ module spreadsheet -import freeflowuniverse.herolib.data.currency -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.data.currency +import incubaid.herolib.ui.console fn test_sheets() { mut sh := sheet_new() or { panic(err) } diff --git a/lib/biz/spreadsheet/cell.v b/lib/biz/spreadsheet/cell.v index aa5b81c6..fe2ed937 100644 --- a/lib/biz/spreadsheet/cell.v +++ b/lib/biz/spreadsheet/cell.v @@ -1,6 +1,6 @@ module spreadsheet -import freeflowuniverse.herolib.data.currency +import incubaid.herolib.data.currency pub struct Cell { pub mut: diff --git a/lib/biz/spreadsheet/charts.v b/lib/biz/spreadsheet/charts.v index 6a6f422e..a2f323d8 100644 --- a/lib/biz/spreadsheet/charts.v +++ b/lib/biz/spreadsheet/charts.v @@ -1,8 +1,8 @@ module spreadsheet -import freeflowuniverse.herolib.data.markdown.elements -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.web.echarts +import incubaid.herolib.data.markdown.elements +import incubaid.herolib.ui.console +import incubaid.herolib.web.echarts pub fn (s Sheet) title_chart(args RowGetArgs) echarts.EChartsOption { return echarts.EChartsOption{ diff --git a/lib/biz/spreadsheet/charts_test.v b/lib/biz/spreadsheet/charts_test.v index 406079cf..05e01f5d 100644 --- a/lib/biz/spreadsheet/charts_test.v +++ b/lib/biz/spreadsheet/charts_test.v @@ -1,8 +1,8 @@ module spreadsheet -import freeflowuniverse.herolib.data.markdown.elements -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.web.echarts +import incubaid.herolib.data.markdown.elements +import incubaid.herolib.ui.console +import incubaid.herolib.web.echarts fn test_title_chart() { mut s := sheet_new() or { panic(err) } diff --git a/lib/biz/spreadsheet/docu/charting_capabilities.md b/lib/biz/spreadsheet/docu/charting_capabilities.md index cde23a3f..5f57f189 100644 --- a/lib/biz/spreadsheet/docu/charting_capabilities.md +++ b/lib/biz/spreadsheet/docu/charting_capabilities.md @@ -7,6 +7,7 @@ The spreadsheet module integrates with ECharts to provide powerful data visualiz Most charting functions utilize a common set of arguments defined in `RowGetArgs` to specify which data to chart and how to present it. **Key `RowGetArgs` Parameters:** + - `rowname` (string, optional): The exact name of a single row to chart. - `namefilter` ([]string, optional): A list of exact row names to include. - `includefilter` ([]string, optional): A list of tags to include. Rows must match at least one of these tags. @@ -29,8 +30,8 @@ Most charting functions utilize a common set of arguments defined in `RowGetArgs Generates a line chart, ideal for visualizing trends over time. Multiple rows can be plotted on the same chart. ```v -import freeflowuniverse.herolib.biz.spreadsheet -import freeflowuniverse.herolib.web.echarts +import incubaid.herolib.biz.spreadsheet +import incubaid.herolib.web.echarts // Assuming 'my_sheet' is an existing Sheet object mut my_sheet := spreadsheet.sheet_new(name: 'my_sheet', nrcol: 60)! @@ -52,8 +53,8 @@ line_chart_option := my_sheet.line_chart( Generates a bar chart, suitable for comparing discrete categories or values. Typically used for a single row's data. ```v -import freeflowuniverse.herolib.biz.spreadsheet -import freeflowuniverse.herolib.web.echarts +import incubaid.herolib.biz.spreadsheet +import incubaid.herolib.web.echarts // Assuming 'my_sheet' is an existing Sheet object mut my_sheet := spreadsheet.sheet_new(name: 'my_sheet', nrcol: 60)! @@ -73,8 +74,8 @@ bar_chart_option := my_sheet.bar_chart( Generates a pie chart, useful for showing the proportion of different categories within a single data set. Typically used for a single row's data. ```v -import freeflowuniverse.herolib.biz.spreadsheet -import freeflowuniverse.herolib.web.echarts +import incubaid.herolib.biz.spreadsheet +import incubaid.herolib.web.echarts // Assuming 'my_sheet' is an existing Sheet object mut my_sheet := spreadsheet.sheet_new(name: 'my_sheet', nrcol: 60)! @@ -91,4 +92,4 @@ pie_chart_option := my_sheet.pie_chart( ## Integration with ECharts -The charting functions return an `echarts.EChartsOption` object, which is a JSON-serializable structure compatible with the ECharts JavaScript library. This allows for flexible rendering of these charts in web interfaces or other environments that support ECharts. \ No newline at end of file +The charting functions return an `echarts.EChartsOption` object, which is a JSON-serializable structure compatible with the ECharts JavaScript library. This allows for flexible rendering of these charts in web interfaces or other environments that support ECharts. diff --git a/lib/biz/spreadsheet/docu/data_aggregation_transformation.md b/lib/biz/spreadsheet/docu/data_aggregation_transformation.md index 7e3b842e..b28e956c 100644 --- a/lib/biz/spreadsheet/docu/data_aggregation_transformation.md +++ b/lib/biz/spreadsheet/docu/data_aggregation_transformation.md @@ -7,7 +7,7 @@ The spreadsheet module provides powerful functionalities to aggregate and transf The `group2row` method allows you to select rows based on their tags and aggregate their values into a new, single row. This is particularly useful for creating summary rows (e.g., total salaries for a specific department). ```v -import freeflowuniverse.herolib.biz.spreadsheet +import incubaid.herolib.biz.spreadsheet // Assuming 'my_sheet' is an existing Sheet object with various rows // and some rows have tags like 'department:dev' or 'department:engineering'. @@ -33,6 +33,7 @@ mut total_salaries_row := my_sheet.group2row( ``` **`Group2RowArgs` Parameters:** + - `name` (string, required): The name of the new aggregated row. - `include` ([]string, optional): A list of tags to include. Rows must match at least one of these tags to be included in the aggregation. Supports wildcard matching (e.g., `location:belgium_*`). - `exclude` ([]string, optional): A list of tags to exclude. Rows matching any of these tags will be excluded from the aggregation. @@ -40,10 +41,10 @@ mut total_salaries_row := my_sheet.group2row( - `descr` (string, optional): Description for the new aggregated row. - `subgroup` (string, optional): Subgroup for the new aggregated row. - `aggregatetype` (`RowAggregateType`, optional, default: `.sum`): The type of aggregation to perform. - - `.sum`: Sums the values of matching cells. - - `.avg`: Calculates the average of matching cells. - - `.max`: Finds the maximum value among matching cells. - - `.min`: Finds the minimum value among matching cells. + - `.sum`: Sums the values of matching cells. + - `.avg`: Calculates the average of matching cells. + - `.max`: Finds the maximum value among matching cells. + - `.min`: Finds the minimum value among matching cells. ## Transforming Sheet Periodicity (Yearly/Quarterly Aggregation) @@ -54,7 +55,7 @@ The module allows you to create new sheets where the data is aggregated into lar The `toyear` method creates a new sheet where monthly data is aggregated into yearly columns. ```v -import freeflowuniverse.herolib.biz.spreadsheet +import incubaid.herolib.biz.spreadsheet // Assuming 'monthly_sheet' is a sheet with 60 columns (5 years of monthly data) mut monthly_sheet := spreadsheet.sheet_new(name: 'monthly_data', nrcol: 60)! @@ -74,7 +75,7 @@ mut yearly_sheet := monthly_sheet.toyear( Similarly, the `toquarter` method creates a new sheet with data aggregated into quarterly columns. ```v -import freeflowuniverse.herolib.biz.spreadsheet +import incubaid.herolib.biz.spreadsheet // Assuming 'monthly_sheet' is a sheet with 60 columns mut monthly_sheet := spreadsheet.sheet_new(name: 'monthly_data', nrcol: 60)! @@ -87,7 +88,8 @@ mut quarterly_sheet := monthly_sheet.toquarter( ``` **`ToYearQuarterArgs` Parameters:** + - `name` (string, optional): The name of the new aggregated sheet. If empty, a default name based on the original sheet and period (e.g., `original_sheet_name_year`) is used. - `namefilter` ([]string, optional): A list of exact row names to include in the new sheet. If provided, only these rows will be processed. - `includefilter` ([]string, optional): A list of tags to include. Rows must match at least one of these tags to be included. -- `excludefilter` ([]string, optional): A list of tags to exclude. Rows matching any of these tags will be excluded. \ No newline at end of file +- `excludefilter` ([]string, optional): A list of tags to exclude. Rows matching any of these tags will be excluded. diff --git a/lib/biz/spreadsheet/docu/exporting_data.md b/lib/biz/spreadsheet/docu/exporting_data.md index 1e47b097..68fda8a8 100644 --- a/lib/biz/spreadsheet/docu/exporting_data.md +++ b/lib/biz/spreadsheet/docu/exporting_data.md @@ -7,7 +7,7 @@ The spreadsheet module provides functionality to export sheet data into various The `export_csv` method allows you to export the sheet's data to a CSV (Comma Separated Values) file or directly as a string. It offers flexibility in terms of separators and handling of empty cells. ```v -import freeflowuniverse.herolib.biz.spreadsheet +import incubaid.herolib.biz.spreadsheet import os // Assuming 'my_sheet' is an existing Sheet object @@ -31,14 +31,16 @@ println(csv_string) ``` **`ExportCSVArgs` Parameters:** + - `path` (string, optional): The file path where the CSV should be saved. If an empty string is provided, the CSV content will be returned as a string instead of being written to a file. The `~` character is expanded to the user's home directory. - `include_empty` (bool, optional, default: `false`): If `true`, empty cells will be included in the CSV output (represented as '0' for numeric values, or empty string for others). If `false`, empty cells will be represented as an empty string. - `separator` (string, optional, default: `'|'`): The character used to separate values in the CSV. Common separators include ',' (comma), ';' (semicolon), or '|' (pipe). **CSV Export Features:** + - **Configurable Separator:** Easily change the delimiter to suit different CSV parsing requirements. - **Special Character Handling:** Values containing the separator, double quotes, or newlines are automatically enclosed in double quotes, and internal double quotes are escaped (e.g., `"` becomes `""`). - **Empty Cell Inclusion:** Control whether empty cells are explicitly represented in the output. - **Numeric Formatting:** Numeric values are formatted appropriately, with small numbers showing up to 3 decimal places and larger numbers as integers. Trailing zeros and decimal points are removed if unnecessary. -The CSV output includes a header row with "Name", "Description", "AggregateType", "Tags", "Subgroup", followed by the sheet's column headers (e.g., "M1", "M2", "Y1", etc.). Each subsequent row represents a sheet row, with its metadata followed by its cell values. \ No newline at end of file +The CSV output includes a header row with "Name", "Description", "AggregateType", "Tags", "Subgroup", followed by the sheet's column headers (e.g., "M1", "M2", "Y1", etc.). Each subsequent row represents a sheet row, with its metadata followed by its cell values. diff --git a/lib/biz/spreadsheet/docu/row_cell_operations.md b/lib/biz/spreadsheet/docu/row_cell_operations.md index df45a6b7..ffa42fc4 100644 --- a/lib/biz/spreadsheet/docu/row_cell_operations.md +++ b/lib/biz/spreadsheet/docu/row_cell_operations.md @@ -9,7 +9,7 @@ Rows and Cells are fundamental building blocks of the spreadsheet, allowing for Rows are created within the context of a `Sheet` object. ```v -import freeflowuniverse.herolib.biz.spreadsheet +import incubaid.herolib.biz.spreadsheet // Assuming 'my_sheet' is an existing Sheet object mut my_sheet := spreadsheet.sheet_new(name: 'my_sheet', nrcol: 60)! @@ -63,4 +63,4 @@ The `repr()` and `str()` methods of a `Cell` provide a formatted string represen // Assuming 'my_cell' is a Cell object cell_string := my_cell.repr() // If the cell is empty, cell_string will be "-" -// Otherwise, it will be the formatted numeric value. \ No newline at end of file +// Otherwise, it will be the formatted numeric value. diff --git a/lib/biz/spreadsheet/docu/sheet_operations.md b/lib/biz/spreadsheet/docu/sheet_operations.md index 7d84cb7b..7c234f22 100644 --- a/lib/biz/spreadsheet/docu/sheet_operations.md +++ b/lib/biz/spreadsheet/docu/sheet_operations.md @@ -7,7 +7,7 @@ The `Sheet` object is the central component of the spreadsheet module, providing A new sheet can be initialized using the `sheet_new` function. ```v -import freeflowuniverse.herolib.biz.spreadsheet +import incubaid.herolib.biz.spreadsheet // Create a new sheet named 'my_financial_sheet' with 60 columns mut my_sheet := spreadsheet.sheet_new( @@ -85,4 +85,4 @@ The `header()` function generates a list of strings representing the column head header_labels := my_sheet.header()! // For a sheet with 5 columns (years) -// header_labels will be ["Y1", "Y2", ..., "Y5"] \ No newline at end of file +// header_labels will be ["Y1", "Y2", ..., "Y5"] diff --git a/lib/biz/spreadsheet/extrapolate.v b/lib/biz/spreadsheet/extrapolate.v index 64cbe438..5137e47f 100644 --- a/lib/biz/spreadsheet/extrapolate.v +++ b/lib/biz/spreadsheet/extrapolate.v @@ -1,6 +1,6 @@ module spreadsheet -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console // smartstring is something like 3:2,10:5 means end month 3 we start with 2, it grows to 5 on end month 10 . // the cells out of the mentioned ranges are not filled if they are already set . diff --git a/lib/biz/spreadsheet/factory.v b/lib/biz/spreadsheet/factory.v index 29e6a8bb..5e532fd3 100644 --- a/lib/biz/spreadsheet/factory.v +++ b/lib/biz/spreadsheet/factory.v @@ -1,6 +1,6 @@ module spreadsheet -import freeflowuniverse.herolib.data.currency +import incubaid.herolib.data.currency __global ( sheets shared map[string]&Sheet diff --git a/lib/biz/spreadsheet/playmacro.v b/lib/biz/spreadsheet/playmacro.v index f94eefc0..bae277fe 100644 --- a/lib/biz/spreadsheet/playmacro.v +++ b/lib/biz/spreadsheet/playmacro.v @@ -1,7 +1,7 @@ module spreadsheet -import freeflowuniverse.herolib.core.playbook { Action } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook { Action } +import incubaid.herolib.ui.console pub fn playmacro(action Action) !string { console.print_green('playmacro for worksheet') diff --git a/lib/biz/spreadsheet/row.v b/lib/biz/spreadsheet/row.v index c9a19a1b..02428243 100644 --- a/lib/biz/spreadsheet/row.v +++ b/lib/biz/spreadsheet/row.v @@ -1,7 +1,7 @@ module spreadsheet -import freeflowuniverse.herolib.data.paramsparser -// import freeflowuniverse.herolib.ui.console +import incubaid.herolib.data.paramsparser +// import incubaid.herolib.ui.console @[heap] pub struct Row { diff --git a/lib/biz/spreadsheet/sheet.v b/lib/biz/spreadsheet/sheet.v index 724e3320..b1096bb4 100644 --- a/lib/biz/spreadsheet/sheet.v +++ b/lib/biz/spreadsheet/sheet.v @@ -1,8 +1,8 @@ module spreadsheet -import freeflowuniverse.herolib.data.currency -import freeflowuniverse.herolib.data.paramsparser -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.data.currency +import incubaid.herolib.data.paramsparser +import incubaid.herolib.ui.console @[heap] pub struct Sheet { diff --git a/lib/biz/spreadsheet/sheet_export.v b/lib/biz/spreadsheet/sheet_export.v index ce747080..7d7cdffb 100644 --- a/lib/biz/spreadsheet/sheet_export.v +++ b/lib/biz/spreadsheet/sheet_export.v @@ -1,7 +1,7 @@ module spreadsheet import os -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib @[params] pub struct ExportArgs { diff --git a/lib/biz/spreadsheet/sheet_export_csv.v b/lib/biz/spreadsheet/sheet_export_csv.v index d215dc7e..5edf0d7b 100644 --- a/lib/biz/spreadsheet/sheet_export_csv.v +++ b/lib/biz/spreadsheet/sheet_export_csv.v @@ -1,7 +1,7 @@ module spreadsheet import os -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib @[params] pub struct ExportCSVArgs { diff --git a/lib/biz/spreadsheet/sheet_getters.v b/lib/biz/spreadsheet/sheet_getters.v index 78ead9eb..c3aeae3a 100644 --- a/lib/biz/spreadsheet/sheet_getters.v +++ b/lib/biz/spreadsheet/sheet_getters.v @@ -1,6 +1,6 @@ module spreadsheet -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console import math fn remove_empty_line(txt string) string { diff --git a/lib/biz/spreadsheet/wiki.v b/lib/biz/spreadsheet/wiki.v index 306f3afc..e9cdfe5a 100644 --- a/lib/biz/spreadsheet/wiki.v +++ b/lib/biz/spreadsheet/wiki.v @@ -1,7 +1,7 @@ module spreadsheet -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.ui.console // format a sheet properly in wiki format pub fn (s Sheet) wiki(args_ RowGetArgs) !string { diff --git a/lib/biz/spreadsheet/wiki_charts.v b/lib/biz/spreadsheet/wiki_charts.v index 55990c89..c5101af3 100644 --- a/lib/biz/spreadsheet/wiki_charts.v +++ b/lib/biz/spreadsheet/wiki_charts.v @@ -1,7 +1,7 @@ module spreadsheet -import freeflowuniverse.herolib.data.markdown.elements -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.data.markdown.elements +import incubaid.herolib.ui.console pub fn (s Sheet) wiki_title_chart(args RowGetArgs) !string { return s.title_chart(args).markdown() diff --git a/lib/builder/bootstrapper.v b/lib/builder/bootstrapper.v index dc8dcd62..49607b2d 100644 --- a/lib/builder/bootstrapper.v +++ b/lib/builder/bootstrapper.v @@ -1,9 +1,9 @@ module builder import os -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.core.pathlib +import incubaid.herolib.ui.console const heropath_ = os.dir(@FILE) + '/../' diff --git a/lib/builder/builder_factory.v b/lib/builder/builder_factory.v index 02599ee5..80ad6aef 100644 --- a/lib/builder/builder_factory.v +++ b/lib/builder/builder_factory.v @@ -1,6 +1,6 @@ module builder -import freeflowuniverse.herolib.core.base +import incubaid.herolib.core.base @[heap] pub struct BuilderFactory { diff --git a/lib/builder/done.v b/lib/builder/done.v index fbb6c1d4..28c9688a 100644 --- a/lib/builder/done.v +++ b/lib/builder/done.v @@ -1,6 +1,6 @@ module builder -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console pub fn (mut node Node) done_set(key string, val string) ! { if key in node.done { diff --git a/lib/builder/executor.v b/lib/builder/executor.v index 5c9326d2..fd672b15 100644 --- a/lib/builder/executor.v +++ b/lib/builder/executor.v @@ -1,6 +1,6 @@ module builder -import freeflowuniverse.herolib.data.ipaddress +import incubaid.herolib.data.ipaddress type Executor = ExecutorLocal | ExecutorSSH | ExecutorCrun diff --git a/lib/builder/executor_crun.v b/lib/builder/executor_crun.v index 7d38504b..03edf618 100644 --- a/lib/builder/executor_crun.v +++ b/lib/builder/executor_crun.v @@ -2,10 +2,10 @@ module builder import os import rand -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.osal.core as osal +import incubaid.herolib.core.pathlib +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools @[heap] pub struct ExecutorCrun { diff --git a/lib/builder/executor_local.v b/lib/builder/executor_local.v index 0df623be..f1f513cf 100644 --- a/lib/builder/executor_local.v +++ b/lib/builder/executor_local.v @@ -1,8 +1,8 @@ module builder -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.osal.rsync -// import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.osal.core as osal +import incubaid.herolib.osal.rsync +// import incubaid.herolib.core.pathlib import os @[heap] diff --git a/lib/builder/executor_local_test.v b/lib/builder/executor_local_test.v index 6c17cc0e..df37f006 100644 --- a/lib/builder/executor_local_test.v +++ b/lib/builder/executor_local_test.v @@ -1,6 +1,6 @@ module builder -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console fn test_exec() { mut e := ExecutorLocal{} diff --git a/lib/builder/executor_ssh.v b/lib/builder/executor_ssh.v index 8b385b8e..ce767f2f 100644 --- a/lib/builder/executor_ssh.v +++ b/lib/builder/executor_ssh.v @@ -2,12 +2,12 @@ module builder import os import rand -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.osal.rsync -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.data.ipaddress -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.osal.core as osal +import incubaid.herolib.osal.rsync +import incubaid.herolib.core.pathlib +import incubaid.herolib.data.ipaddress +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools @[heap] pub struct ExecutorSSH { diff --git a/lib/builder/executor_ssh_test.v b/lib/builder/executor_ssh_test.v index 5736877c..868a16a0 100644 --- a/lib/builder/executor_ssh_test.v +++ b/lib/builder/executor_ssh_test.v @@ -1,8 +1,8 @@ module builder import rand -import freeflowuniverse.herolib.data.ipaddress { IPAddress } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.data.ipaddress { IPAddress } +import incubaid.herolib.ui.console // Assuming this function runs first (which is the case) // This generates ssh keys on local machine to use for diff --git a/lib/builder/heroscript.md b/lib/builder/heroscript.md index 02eeb8e3..250e0149 100644 --- a/lib/builder/heroscript.md +++ b/lib/builder/heroscript.md @@ -57,11 +57,11 @@ Here is a full example of a Heroscript playbook for the builder module: To run a playbook, you can use the `play` function in `builder.play`. ```v -import freeflowuniverse.herolib.core.playbook -import freeflowuniverse.herolib.builder +import incubaid.herolib.core.playbook +import incubaid.herolib.builder mut plbook := playbook.new(path: "path/to/your/playbook.hs")! builder.play(mut plbook)! ``` -This will parse the Heroscript file and execute the defined actions. \ No newline at end of file +This will parse the Heroscript file and execute the defined actions. diff --git a/lib/builder/node.v b/lib/builder/node.v index bf924337..8fcf21b7 100644 --- a/lib/builder/node.v +++ b/lib/builder/node.v @@ -1,9 +1,9 @@ module builder import json -import freeflowuniverse.herolib.data.paramsparser { Params } -import freeflowuniverse.herolib.core.base -// import freeflowuniverse.herolib.ui.console +import incubaid.herolib.data.paramsparser { Params } +import incubaid.herolib.core.base +// import incubaid.herolib.ui.console import crypto.md5 pub enum PlatformType { diff --git a/lib/builder/node_commands.v b/lib/builder/node_commands.v index 4d8fbbcc..7c9136da 100644 --- a/lib/builder/node_commands.v +++ b/lib/builder/node_commands.v @@ -1,11 +1,11 @@ module builder -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.texttools import crypto.md5 import time -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.ui.console -// import freeflowuniverse.herolib.osal.core as osal +import incubaid.herolib.data.ourtime +import incubaid.herolib.ui.console +// import incubaid.herolib.osal.core as osal // check command exists on the platform, knows how to deal with different platforms pub fn (mut node Node) cmd_exists(cmd string) bool { diff --git a/lib/builder/node_factory.v b/lib/builder/node_factory.v index 0793ac21..f16d5fef 100644 --- a/lib/builder/node_factory.v +++ b/lib/builder/node_factory.v @@ -1,6 +1,6 @@ module builder -import freeflowuniverse.herolib.data.ipaddress +import incubaid.herolib.data.ipaddress // get node connection to local machine pub fn (mut bldr BuilderFactory) node_local() !&Node { diff --git a/lib/builder/play.v b/lib/builder/play.v index a470290e..214d97ab 100644 --- a/lib/builder/play.v +++ b/lib/builder/play.v @@ -1,7 +1,7 @@ module builder -import freeflowuniverse.herolib.core.playbook -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook +import incubaid.herolib.ui.console // execute a playbook which can build nodes pub fn play(mut plbook playbook.PlayBook) ! { diff --git a/lib/builder/portforward_lib.v b/lib/builder/portforward_lib.v index 1fb78030..a5bb95a9 100644 --- a/lib/builder/portforward_lib.v +++ b/lib/builder/portforward_lib.v @@ -1,8 +1,8 @@ module builder -import freeflowuniverse.herolib.osal.screen -import freeflowuniverse.herolib.data.ipaddress -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.osal.screen +import incubaid.herolib.data.ipaddress +import incubaid.herolib.ui.console @[params] pub struct ForwardArgsToLocal { diff --git a/lib/builder/readme.md b/lib/builder/readme.md index e7ac6b7d..9e178f20 100644 --- a/lib/builder/readme.md +++ b/lib/builder/readme.md @@ -5,6 +5,7 @@ The Builder module is a powerful system automation and remote execution framewor ## Overview The Builder module consists of several key components: + - **BuilderFactory**: Creates and manages builder instances - **Node**: Represents a target system (local or remote) with its properties and state - **Executor**: Interface for command execution and file operations (SSH or Local) @@ -15,7 +16,7 @@ The Builder module consists of several key components: ### Basic Initialization ```v -import freeflowuniverse.herolib.builder +import incubaid.herolib.builder // Create a new builder instance mut b := builder.new()! @@ -30,6 +31,7 @@ mut local_node := builder.node_local()! ### Node Configuration Nodes can be configured with various properties: + ```v // Full node configuration mut n := b.node_new( @@ -43,6 +45,7 @@ mut n := b.node_new( ## Node Properties Each node maintains information about: + - Platform type (OSX, Ubuntu, Alpine, Arch) - CPU architecture (Intel, ARM) - Environment variables @@ -56,6 +59,7 @@ The node automatically detects and caches system information for better performa The executor provides a unified interface for both local and remote operations: ### Command Execution + ```v // Execute command and get output result := n.exec("ls -la")! @@ -68,6 +72,7 @@ n.shell("bash")! ``` ### File Operations + ```v // Write file n.file_write("/path/to/file", "content")! @@ -90,6 +95,7 @@ n.upload("/local/file", "/remote/path")! ``` ### Environment Management + ```v // Get all environment variables env := n.environ_get()! @@ -113,6 +119,7 @@ value := n.done["key"] ``` This is useful for: + - Caching system information - Storing configuration state - Tracking execution history @@ -123,6 +130,7 @@ This is useful for: 1. **Error Handling**: Always use the `!` operator for methods that can fail and handle errors appropriately. 2. **Resource Management**: Close connections and clean up resources when done: + ```v defer { n.close() @@ -130,12 +138,14 @@ defer { ``` 3. **Debug Mode**: Enable debug mode when troubleshooting: + ```v n.debug_on() // Enable debug output n.debug_off() // Disable debug output ``` 4. **Platform Awareness**: Check platform compatibility before executing commands: + ```v if n.platform == .ubuntu { // Ubuntu-specific commands @@ -147,6 +157,7 @@ if n.platform == .ubuntu { ## Examples See complete examples in: + - Simple usage: `examples/builder/simple.vsh` - Remote execution: `examples/builder/remote_executor/` - Platform-specific examples: @@ -156,6 +167,7 @@ See complete examples in: ## Implementation Details The Builder module uses: + - Redis for caching node information - SSH for secure remote execution - MD5 hashing for unique node identification diff --git a/lib/builder/this_remote.v b/lib/builder/this_remote.v index 60ecffa0..149b4160 100644 --- a/lib/builder/this_remote.v +++ b/lib/builder/this_remote.v @@ -1,9 +1,9 @@ module builder import os -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console @[params] pub struct ThisRemoteArgs { diff --git a/lib/clients/giteaclient/giteaclient_factory_.v b/lib/clients/giteaclient/giteaclient_factory_.v index e5dd0e79..116925b1 100644 --- a/lib/clients/giteaclient/giteaclient_factory_.v +++ b/lib/clients/giteaclient/giteaclient_factory_.v @@ -1,8 +1,8 @@ module giteaclient -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.base +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json __global ( diff --git a/lib/clients/giteaclient/giteaclient_model.v b/lib/clients/giteaclient/giteaclient_model.v index 45f940a2..14a72e9e 100644 --- a/lib/clients/giteaclient/giteaclient_model.v +++ b/lib/clients/giteaclient/giteaclient_model.v @@ -1,9 +1,9 @@ // File: lib/clients/giteaclient/giteaclient_model.v module giteaclient -import freeflowuniverse.herolib.data.paramsparser -import freeflowuniverse.herolib.data.encoderhero -import freeflowuniverse.herolib.core.httpconnection +import incubaid.herolib.data.paramsparser +import incubaid.herolib.data.encoderhero +import incubaid.herolib.core.httpconnection import os pub const version = '0.0.0' diff --git a/lib/clients/giteaclient/methods.v b/lib/clients/giteaclient/methods.v index 0c27187b..b66c5b78 100644 --- a/lib/clients/giteaclient/methods.v +++ b/lib/clients/giteaclient/methods.v @@ -1,7 +1,7 @@ // File: lib/clients/giteaclient/methods.v module giteaclient -import freeflowuniverse.herolib.core.httpconnection +import incubaid.herolib.core.httpconnection import json import net.http diff --git a/lib/clients/giteaclient/readme.md b/lib/clients/giteaclient/readme.md index 46b4cc93..33548184 100644 --- a/lib/clients/giteaclient/readme.md +++ b/lib/clients/giteaclient/readme.md @@ -1,4 +1,5 @@ // File: lib/clients/giteaclient/readme.md + # giteaclient This library provides a client for interacting with the Gitea API. @@ -19,31 +20,31 @@ You can configure the client using a HeroScript file: Here's how to get the client and use its methods. ```v -import freeflowuniverse.herolib.clients.giteaclient -import freeflowuniverse.herolib.core.base +import incubaid.herolib.clients.giteaclient +import incubaid.herolib.core.base fn main() ! { // Make sure hero is initialized base.init()! - // Example configuration (can also be loaded from file) - heroscript_config := "!!giteaclient.configure url:'https://gitea.com' secret:'...your_token...'" - mut plbook := playbook.new(text: heroscript_config)! - giteaclient.play(mut plbook)! + // Example configuration (can also be loaded from file) + heroscript_config := "!!giteaclient.configure url:'https://gitea.com' secret:'...your_token...'" + mut plbook := playbook.new(text: heroscript_config)! + giteaclient.play(mut plbook)! - // Get the default configured client - mut client := giteaclient.get()! + // Get the default configured client + mut client := giteaclient.get()! - // Get the authenticated user - user := client.get_current_user()! - println('Authenticated as: ${user.login}') + // Get the authenticated user + user := client.get_current_user()! + println('Authenticated as: ${user.login}') - // List repositories for the authenticated user - repos := client.user_list_repos()! - println('Found ${repos.len} repositories:') - for repo in repos { - println('- ${repo.full_name}') - } + // List repositories for the authenticated user + repos := client.user_list_repos()! + println('Found ${repos.len} repositories:') + for repo in repos { + println('- ${repo.full_name}') + } // Get a specific repository's issues owner := 'gitea' @@ -59,4 +60,4 @@ fn main() ! { ## tips -- to see the admin api: https://git.ourworld.tf/api/swagger \ No newline at end of file +- to see the admin api: https://git.ourworld.tf/api/swagger diff --git a/lib/clients/ipapi/ipapi_factory_.v b/lib/clients/ipapi/ipapi_factory_.v index bf4838c8..933c1904 100644 --- a/lib/clients/ipapi/ipapi_factory_.v +++ b/lib/clients/ipapi/ipapi_factory_.v @@ -1,8 +1,8 @@ module ipapi -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.base +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json __global ( diff --git a/lib/clients/ipapi/ipapi_model.v b/lib/clients/ipapi/ipapi_model.v index 2f8392db..64598e1d 100644 --- a/lib/clients/ipapi/ipapi_model.v +++ b/lib/clients/ipapi/ipapi_model.v @@ -1,7 +1,7 @@ module ipapi -import freeflowuniverse.herolib.data.paramsparser -import freeflowuniverse.herolib.core.httpconnection +import incubaid.herolib.data.paramsparser +import incubaid.herolib.core.httpconnection import os pub const version = '1.14.3' diff --git a/lib/clients/ipapi/readme.md b/lib/clients/ipapi/readme.md index e246cda7..96346431 100644 --- a/lib/clients/ipapi/readme.md +++ b/lib/clients/ipapi/readme.md @@ -1,13 +1,11 @@ # ipapi - - To get started ```v -import freeflowuniverse.herolib.clients. ipapi +import incubaid.herolib.clients. ipapi mut client:= ipapi.get()! @@ -26,5 +24,3 @@ client... host: 'localhost' port: 8888 ``` - - diff --git a/lib/clients/jina/classification_api.v b/lib/clients/jina/classification_api.v index 4d508dac..230b1a88 100644 --- a/lib/clients/jina/classification_api.v +++ b/lib/clients/jina/classification_api.v @@ -1,7 +1,7 @@ module jina import json -import freeflowuniverse.herolib.core.httpconnection +import incubaid.herolib.core.httpconnection // ClassificationTrainAccess represents the accessibility of the classifier pub enum ClassificationTrainAccess { diff --git a/lib/clients/jina/embeddings_api.v b/lib/clients/jina/embeddings_api.v index 20088ad7..c6772896 100644 --- a/lib/clients/jina/embeddings_api.v +++ b/lib/clients/jina/embeddings_api.v @@ -1,6 +1,6 @@ module jina -import freeflowuniverse.herolib.core.httpconnection +import incubaid.herolib.core.httpconnection import json // JinaModel represents the available Jina models diff --git a/lib/clients/jina/jina_factory_.v b/lib/clients/jina/jina_factory_.v index d55dd343..2f5006a1 100644 --- a/lib/clients/jina/jina_factory_.v +++ b/lib/clients/jina/jina_factory_.v @@ -1,8 +1,8 @@ module jina -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.base +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json __global ( diff --git a/lib/clients/jina/jina_model.v b/lib/clients/jina/jina_model.v index cbcd1861..81a8177a 100644 --- a/lib/clients/jina/jina_model.v +++ b/lib/clients/jina/jina_model.v @@ -1,7 +1,7 @@ module jina -import freeflowuniverse.herolib.data.encoderhero -import freeflowuniverse.herolib.core.httpconnection +import incubaid.herolib.data.encoderhero +import incubaid.herolib.core.httpconnection // import net.http import os diff --git a/lib/clients/jina/multi_vector_api.v b/lib/clients/jina/multi_vector_api.v index 8061b757..408b9407 100644 --- a/lib/clients/jina/multi_vector_api.v +++ b/lib/clients/jina/multi_vector_api.v @@ -1,7 +1,7 @@ module jina import json -import freeflowuniverse.herolib.core.httpconnection +import incubaid.herolib.core.httpconnection // Enum for available Jina multi-vector models pub enum MultiVectorModel { diff --git a/lib/clients/jina/rank_api.v b/lib/clients/jina/rank_api.v index 191bf899..ef0add95 100644 --- a/lib/clients/jina/rank_api.v +++ b/lib/clients/jina/rank_api.v @@ -1,6 +1,6 @@ module jina -import freeflowuniverse.herolib.core.httpconnection +import incubaid.herolib.core.httpconnection import json pub enum JinaRerankModel { diff --git a/lib/clients/jina/readme.md b/lib/clients/jina/readme.md index 987d4cbd..bd14b4f8 100644 --- a/lib/clients/jina/readme.md +++ b/lib/clients/jina/readme.md @@ -1,15 +1,13 @@ # jina -see https://jina.ai/ - - +see To get started ```v -import freeflowuniverse.herolib.clients. jina +import incubaid.herolib.clients. jina mut client:= jina.get()! @@ -28,5 +26,3 @@ client... host: 'localhost' port: 8888 ``` - - diff --git a/lib/clients/livekit/client_mgmt.v b/lib/clients/livekit/client_mgmt.v index 8d5f52de..5a8c2985 100644 --- a/lib/clients/livekit/client_mgmt.v +++ b/lib/clients/livekit/client_mgmt.v @@ -1,6 +1,6 @@ module livekit -import freeflowuniverse.herolib.data.caching +import incubaid.herolib.data.caching import os // const CACHING_METHOD = caching.CachingMethod.once_per_process diff --git a/lib/clients/livekit/livekit_factory_.v b/lib/clients/livekit/livekit_factory_.v index 036d61ce..d50bcc6b 100644 --- a/lib/clients/livekit/livekit_factory_.v +++ b/lib/clients/livekit/livekit_factory_.v @@ -1,8 +1,8 @@ module livekit -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.base +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json __global ( diff --git a/lib/clients/livekit/livekit_model.v b/lib/clients/livekit/livekit_model.v index 28dd15fb..bde83074 100644 --- a/lib/clients/livekit/livekit_model.v +++ b/lib/clients/livekit/livekit_model.v @@ -1,7 +1,7 @@ module livekit -import freeflowuniverse.herolib.data.paramsparser -import freeflowuniverse.herolib.data.encoderhero +import incubaid.herolib.data.paramsparser +import incubaid.herolib.data.encoderhero import os pub const version = '0.0.0' diff --git a/lib/clients/livekit/play.v b/lib/clients/livekit/play.v index 0b99117a..15b9b42c 100644 --- a/lib/clients/livekit/play.v +++ b/lib/clients/livekit/play.v @@ -1,8 +1,8 @@ module livekit -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.core.texttools +import incubaid.herolib.ui.console pub fn play(mut plbook PlayBook) ! { if !plbook.exists(filter: 'livekit.') { diff --git a/lib/clients/livekit/readme.md b/lib/clients/livekit/readme.md index 62e33d71..1a1bab56 100644 --- a/lib/clients/livekit/readme.md +++ b/lib/clients/livekit/readme.md @@ -4,7 +4,7 @@ To get started ```v -import freeflowuniverse.herolib.clients.livekit +import incubaid.herolib.clients.livekit mut client:= livekit.get()! @@ -14,12 +14,9 @@ client... ## example heroscript - ```hero !!livekit.configure livekit_url:'' livekit_api_key:'' livekit_api_secret:'' ``` - - diff --git a/lib/clients/livekit/room_test.v b/lib/clients/livekit/room_test.v index d671da6c..56919baa 100644 --- a/lib/clients/livekit/room_test.v +++ b/lib/clients/livekit/room_test.v @@ -1,7 +1,7 @@ module livekit import os -import freeflowuniverse.herolib.osal.core as osal +import incubaid.herolib.osal.core as osal const env_file = '${os.dir(@FILE)}/.env' diff --git a/lib/clients/mailclient/client.v b/lib/clients/mailclient/client.v index eccb72da..c09a7afe 100644 --- a/lib/clients/mailclient/client.v +++ b/lib/clients/mailclient/client.v @@ -1,6 +1,6 @@ module mailclient -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.texttools import net.smtp import time diff --git a/lib/clients/mailclient/mailclient_factory_.v b/lib/clients/mailclient/mailclient_factory_.v index 3211ba14..03b6ed6e 100644 --- a/lib/clients/mailclient/mailclient_factory_.v +++ b/lib/clients/mailclient/mailclient_factory_.v @@ -1,8 +1,8 @@ module mailclient -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.base +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json __global ( diff --git a/lib/clients/mailclient/mailclient_model.v b/lib/clients/mailclient/mailclient_model.v index d9b431d9..1155f9d2 100644 --- a/lib/clients/mailclient/mailclient_model.v +++ b/lib/clients/mailclient/mailclient_model.v @@ -1,6 +1,6 @@ module mailclient -import freeflowuniverse.herolib.data.paramsparser +import incubaid.herolib.data.paramsparser import os pub const version = '0.0.0' diff --git a/lib/clients/mailclient/readme.md b/lib/clients/mailclient/readme.md index fd44ffa9..525d8fdd 100644 --- a/lib/clients/mailclient/readme.md +++ b/lib/clients/mailclient/readme.md @@ -1,11 +1,10 @@ # mailclient - To get started ```v -import freeflowuniverse.herolib.clients.mailclient +import incubaid.herolib.clients.mailclient //remove the previous one, otherwise the env variables are not read @@ -52,12 +51,11 @@ following env variables are supported - MAIL_PASSWORD= - MAIL_PORT=465 - MAIL_SERVER=smtp-relay.brevo.com -- MAIL_USERNAME=kristof@incubaid.com +- MAIL_USERNAME= these variables will only be set at configure time - ## brevo remark - use ssl -- use port: 465 \ No newline at end of file +- use port: 465 diff --git a/lib/clients/meilisearch/client.v b/lib/clients/meilisearch/client.v index 67973eec..2216ec67 100644 --- a/lib/clients/meilisearch/client.v +++ b/lib/clients/meilisearch/client.v @@ -1,6 +1,6 @@ module meilisearch -import freeflowuniverse.herolib.core.httpconnection +import incubaid.herolib.core.httpconnection import x.json2 import json diff --git a/lib/clients/meilisearch/documents.v b/lib/clients/meilisearch/documents.v index 3546b041..910f3589 100644 --- a/lib/clients/meilisearch/documents.v +++ b/lib/clients/meilisearch/documents.v @@ -1,6 +1,6 @@ module meilisearch -import freeflowuniverse.herolib.core.httpconnection +import incubaid.herolib.core.httpconnection import x.json2 import json diff --git a/lib/clients/meilisearch/meilisearch_factory_.v b/lib/clients/meilisearch/meilisearch_factory_.v index 0ab80331..3d3992ff 100644 --- a/lib/clients/meilisearch/meilisearch_factory_.v +++ b/lib/clients/meilisearch/meilisearch_factory_.v @@ -1,8 +1,8 @@ module meilisearch -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.base +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json __global ( diff --git a/lib/clients/meilisearch/meilisearch_model.v b/lib/clients/meilisearch/meilisearch_model.v index a7f55125..388231f6 100644 --- a/lib/clients/meilisearch/meilisearch_model.v +++ b/lib/clients/meilisearch/meilisearch_model.v @@ -1,7 +1,7 @@ module meilisearch -import freeflowuniverse.herolib.data.paramsparser -import freeflowuniverse.herolib.core.httpconnection +import incubaid.herolib.data.paramsparser +import incubaid.herolib.core.httpconnection import os pub const version = '1.0.0' diff --git a/lib/clients/meilisearch/readme.md b/lib/clients/meilisearch/readme.md index 447aeef6..1d1da6db 100644 --- a/lib/clients/meilisearch/readme.md +++ b/lib/clients/meilisearch/readme.md @@ -4,7 +4,7 @@ This is a simple V client for interacting with a [self-hosted Meilisearch instan ### Getting Started with Self-Hosted Meilisearch -To use this V client, ensure you have a **self-hosted Meilisearch instance installed and running**. +To use this V client, ensure you have a **self-hosted Meilisearch instance installed and running**. This quick start will walk you through installing Meilisearch, adding documents, and performing your first search. @@ -29,6 +29,7 @@ Start Meilisearch with the following command, replacing `"aSampleMasterKey"` wit # Launch Meilisearch meilisearch --master-key="aSampleMasterKey" ``` + --- ### Running the V Client Tests @@ -48,7 +49,7 @@ v -enable-globals -stats herolib/clients/meilisearch/index_test.v Here is a quick example of how to retrieve the Meilisearch server version using this V client: ```v -import freeflowuniverse.herolib.clients.meilisearch +import incubaid.herolib.clients.meilisearch mut client := meilisearch.get() or { panic(err) } version := client.version() or { panic(err) } diff --git a/lib/clients/mycelium/mycelium.v b/lib/clients/mycelium/mycelium.v index 4c68f2c2..d54021c1 100644 --- a/lib/clients/mycelium/mycelium.v +++ b/lib/clients/mycelium/mycelium.v @@ -2,7 +2,7 @@ module mycelium import json import encoding.base64 -import freeflowuniverse.herolib.core.httpconnection +import incubaid.herolib.core.httpconnection // Represents a destination for a message, can be either IP or public key pub struct MessageDestination { diff --git a/lib/clients/mycelium/mycelium_check.v b/lib/clients/mycelium/mycelium_check.v index 2c13e874..9beecc69 100644 --- a/lib/clients/mycelium/mycelium_check.v +++ b/lib/clients/mycelium/mycelium_check.v @@ -1,7 +1,7 @@ module mycelium -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console import os import json diff --git a/lib/clients/mycelium/mycelium_factory_.v b/lib/clients/mycelium/mycelium_factory_.v index f1b95ce0..449d8ea6 100644 --- a/lib/clients/mycelium/mycelium_factory_.v +++ b/lib/clients/mycelium/mycelium_factory_.v @@ -1,7 +1,7 @@ module mycelium -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.playbook { PlayBook } +import incubaid.herolib.core.base +import incubaid.herolib.core.playbook { PlayBook } import json __global ( diff --git a/lib/clients/mycelium/mycelium_model.v b/lib/clients/mycelium/mycelium_model.v index bc3eb791..f29e0fa1 100644 --- a/lib/clients/mycelium/mycelium_model.v +++ b/lib/clients/mycelium/mycelium_model.v @@ -1,7 +1,7 @@ module mycelium -import freeflowuniverse.herolib.core.httpconnection -import freeflowuniverse.herolib.data.encoderhero +import incubaid.herolib.core.httpconnection +import incubaid.herolib.data.encoderhero pub const version = '0.0.0' const singleton = true diff --git a/lib/clients/mycelium/readme.md b/lib/clients/mycelium/readme.md index 54c37101..3d3f3088 100644 --- a/lib/clients/mycelium/readme.md +++ b/lib/clients/mycelium/readme.md @@ -16,7 +16,7 @@ The client can be configured either through V code or using heroscript. ### V Code Configuration ```v -import freeflowuniverse.herolib.clients.mycelium +import incubaid.herolib.clients.mycelium // Get default client instance mut client := mycelium.get()! @@ -32,7 +32,7 @@ mut client := mycelium.get(name: "custom")! Get information about the local Mycelium node: ```v -import freeflowuniverse.herolib.clients.mycelium +import incubaid.herolib.clients.mycelium // Get node info including public key and address result := mycelium.inspect()! @@ -49,7 +49,7 @@ println('IP Address: ${addr}') Check if the Mycelium node is running and reachable: ```v -import freeflowuniverse.herolib.clients.mycelium +import incubaid.herolib.clients.mycelium is_running := mycelium.check() if is_running { @@ -64,7 +64,7 @@ if is_running { The client provides several functions for sending and receiving messages between nodes: ```v -import freeflowuniverse.herolib.clients.mycelium +import incubaid.herolib.clients.mycelium mut client := mycelium.get()! @@ -100,6 +100,7 @@ println('Expires at: ${status.deadline}') ``` The messaging API supports: + - Sending messages to nodes identified by public key - Optional message topics for filtering - Waiting for replies when sending messages diff --git a/lib/clients/mycelium_rpc/mycelium_rpc.v b/lib/clients/mycelium_rpc/mycelium_rpc.v index c9ca4822..faca2133 100644 --- a/lib/clients/mycelium_rpc/mycelium_rpc.v +++ b/lib/clients/mycelium_rpc/mycelium_rpc.v @@ -1,7 +1,7 @@ module mycelium_rpc -import freeflowuniverse.herolib.schemas.jsonrpc -import freeflowuniverse.herolib.core.httpconnection +import incubaid.herolib.schemas.jsonrpc +import incubaid.herolib.core.httpconnection import encoding.base64 // Helper function to get or create the RPC client diff --git a/lib/clients/mycelium_rpc/mycelium_rpc_factory_.v b/lib/clients/mycelium_rpc/mycelium_rpc_factory_.v index 1caafa58..399cc230 100644 --- a/lib/clients/mycelium_rpc/mycelium_rpc_factory_.v +++ b/lib/clients/mycelium_rpc/mycelium_rpc_factory_.v @@ -1,8 +1,8 @@ module mycelium_rpc -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.base +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json __global ( diff --git a/lib/clients/mycelium_rpc/mycelium_rpc_model.v b/lib/clients/mycelium_rpc/mycelium_rpc_model.v index 82f19553..bfed071e 100644 --- a/lib/clients/mycelium_rpc/mycelium_rpc_model.v +++ b/lib/clients/mycelium_rpc/mycelium_rpc_model.v @@ -1,7 +1,7 @@ module mycelium_rpc -import freeflowuniverse.herolib.data.encoderhero -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.data.encoderhero +import incubaid.herolib.schemas.jsonrpc pub const version = '0.0.0' const singleton = true diff --git a/lib/clients/mycelium_rpc/readme.md b/lib/clients/mycelium_rpc/readme.md index c117f654..7c9ebfe2 100644 --- a/lib/clients/mycelium_rpc/readme.md +++ b/lib/clients/mycelium_rpc/readme.md @@ -25,7 +25,7 @@ Mycelium is a mesh networking system that creates secure, encrypted connections ### Basic Example ```v -import freeflowuniverse.herolib.clients.mycelium_rpc +import incubaid.herolib.clients.mycelium_rpc // Create a new client mut client := mycelium_rpc.new_client( @@ -51,7 +51,7 @@ for peer in peers { The client can be configured with: - `name`: Client instance name (default: 'default') -- `url`: Mycelium node API URL (default: 'http://localhost:8990') +- `url`: Mycelium node API URL (default: '') ### Available Methods @@ -94,6 +94,7 @@ The client can be configured with: ## Data Types ### Info + ```v struct Info { node_subnet string // The subnet owned by the node @@ -102,6 +103,7 @@ struct Info { ``` ### PeerStats + ```v struct PeerStats { endpoint Endpoint // Peer endpoint @@ -113,6 +115,7 @@ struct PeerStats { ``` ### InboundMessage + ```v struct InboundMessage { id string // Message ID (hex encoded) @@ -150,6 +153,7 @@ v run examples/clients/mycelium_rpc.vsh ``` The example will: + 1. Install Mycelium if needed 2. Start a Mycelium node with API enabled 3. Demonstrate various RPC operations @@ -176,5 +180,3 @@ info := client.get_info() or { ## License This client follows the same license as the HeroLib project. - - diff --git a/lib/clients/openai/audio/README.md b/lib/clients/openai/audio/README.md index b6562685..8a57c19c 100644 --- a/lib/clients/openai/audio/README.md +++ b/lib/clients/openai/audio/README.md @@ -2,7 +2,7 @@ ```v -import freeflowuniverse.herolib.clients.openai +import incubaid.herolib.clients.openai mut client:= openai.get()! //will be the default client, key is in `AIKEY` on environment variable or `OPENROUTER_API_KEY` @@ -16,4 +16,3 @@ resp := client.audio.create_transcription( )! ``` - diff --git a/lib/clients/openai/audio/audio.v b/lib/clients/openai/audio/audio.v index 8e9a9ce5..3ab5fb35 100644 --- a/lib/clients/openai/audio/audio.v +++ b/lib/clients/openai/audio/audio.v @@ -1,10 +1,10 @@ module audio import json -import freeflowuniverse.herolib.core.httpconnection +import incubaid.herolib.core.httpconnection import os import net.http -import freeflowuniverse.herolib.clients.openai { OpenAI } +import incubaid.herolib.clients.openai { OpenAI } type OpenAIAlias = OpenAI diff --git a/lib/clients/openai/audio/audio_test.v b/lib/clients/openai/audio/audio_test.v index 1409fbfe..2a12bcaf 100644 --- a/lib/clients/openai/audio/audio_test.v +++ b/lib/clients/openai/audio/audio_test.v @@ -4,7 +4,7 @@ import os import clients.openai import clients.openai.audio import clients.openai.openai_factory_ { get } -import freeflowuniverse.crystallib.osal { play } +import incubaid.crystallib.osal { play } fn test_audio() { key := os.getenv('OPENAI_API_KEY') diff --git a/lib/clients/openai/embeddings/README.md b/lib/clients/openai/embeddings/README.md index bb97ccd5..70c4b50b 100644 --- a/lib/clients/openai/embeddings/README.md +++ b/lib/clients/openai/embeddings/README.md @@ -3,7 +3,7 @@ ```v -import freeflowuniverse.herolib.clients.openai +import incubaid.herolib.clients.openai mut client:= openai.get()! //will be the default client, key is in `AIKEY` on environment variable or `OPENROUTER_API_KEY` @@ -14,4 +14,4 @@ resp := client.embeddings.create_embedding( model: 'text-embedding-ada-002' )! -``` \ No newline at end of file +``` diff --git a/lib/clients/openai/embeddings/embeddings.v b/lib/clients/openai/embeddings/embeddings.v index 36ac097c..8c09282f 100644 --- a/lib/clients/openai/embeddings/embeddings.v +++ b/lib/clients/openai/embeddings/embeddings.v @@ -1,7 +1,7 @@ module embeddings import json -import freeflowuniverse.herolib.clients.openai { OpenAI, Usage } +import incubaid.herolib.clients.openai { OpenAI, Usage } type OpenAIAlias = OpenAI diff --git a/lib/clients/openai/embeddings/embeddings_test.v b/lib/clients/openai/embeddings/embeddings_test.v index 200089a3..beb1b97b 100644 --- a/lib/clients/openai/embeddings/embeddings_test.v +++ b/lib/clients/openai/embeddings/embeddings_test.v @@ -4,7 +4,7 @@ import os import clients.openai import clients.openai.embeddings import clients.openai.openai_factory_ { get } -import freeflowuniverse.crystallib.osal { play } +import incubaid.crystallib.osal { play } fn test_embeddings() { key := os.getenv('OPENAI_API_KEY') diff --git a/lib/clients/openai/files/README.md b/lib/clients/openai/files/README.md index f752610d..8a0c8945 100644 --- a/lib/clients/openai/files/README.md +++ b/lib/clients/openai/files/README.md @@ -2,7 +2,7 @@ # Example: Uploading a File ```v -import freeflowuniverse.herolib.clients.openai +import incubaid.herolib.clients.openai mut client:= openai.get()! //will be the default client, key is in `AIKEY` on environment variable or `OPENROUTER_API_KEY` @@ -22,4 +22,4 @@ if resp.id.len > 0 { } -``` \ No newline at end of file +``` diff --git a/lib/clients/openai/files/files.v b/lib/clients/openai/files/files.v index e4473bd2..54511f6a 100644 --- a/lib/clients/openai/files/files.v +++ b/lib/clients/openai/files/files.v @@ -1,10 +1,10 @@ module files import json -import freeflowuniverse.herolib.core.httpconnection +import incubaid.herolib.core.httpconnection import os import net.http -import freeflowuniverse.herolib.clients.openai { OpenAI } +import incubaid.herolib.clients.openai { OpenAI } type OpenAIAlias = OpenAI diff --git a/lib/clients/openai/finetune/README.md b/lib/clients/openai/finetune/README.md index 31f2943f..077a53c9 100644 --- a/lib/clients/openai/finetune/README.md +++ b/lib/clients/openai/finetune/README.md @@ -1,8 +1,7 @@ # OpenAI Fine-tuning Client - ```v -import freeflowuniverse.herolib.clients.openai +import incubaid.herolib.clients.openai mut client:= openai.get()! //will be the default client, key is in `AIKEY` on environment variable or `OPENROUTER_API_KEY` @@ -19,4 +18,4 @@ if resp.id.len > 0 { } else { eprintln('Failed to create fine-tuning job.') } -``` \ No newline at end of file +``` diff --git a/lib/clients/openai/finetune/fine_tunes.v b/lib/clients/openai/finetune/fine_tunes.v index b71b8492..ce0e3228 100644 --- a/lib/clients/openai/finetune/fine_tunes.v +++ b/lib/clients/openai/finetune/fine_tunes.v @@ -1,7 +1,7 @@ module finetune -import freeflowuniverse.herolib.clients.openai { OpenAI } -import freeflowuniverse.herolib.clients.openai.files { File } +import incubaid.herolib.clients.openai { OpenAI } +import incubaid.herolib.clients.openai.files { File } import json type OpenAIAlias = OpenAI diff --git a/lib/clients/openai/images/README.md b/lib/clients/openai/images/README.md index a6d8890f..4457665d 100644 --- a/lib/clients/openai/images/README.md +++ b/lib/clients/openai/images/README.md @@ -1,9 +1,9 @@ -# Example: Creating an Image +# Example: Creating an Image ```v -import freeflowuniverse.herolib.clients.openai +import incubaid.herolib.clients.openai mut client:= openai.get()! //will be the default client, key is in `AIKEY` on environment variable or `OPENROUTER_API_KEY` diff --git a/lib/clients/openai/images/images.v b/lib/clients/openai/images/images.v index bea8b001..549f1872 100644 --- a/lib/clients/openai/images/images.v +++ b/lib/clients/openai/images/images.v @@ -3,8 +3,8 @@ module openai import json import net.http import os -import freeflowuniverse.herolib.core.httpconnection -import freeflowuniverse.herolib.clients.openai { OpenAI } +import incubaid.herolib.core.httpconnection +import incubaid.herolib.clients.openai { OpenAI } type OpenAIAlias = OpenAI diff --git a/lib/clients/openai/moderation/README.md b/lib/clients/openai/moderation/README.md index a8e428e0..8c4be843 100644 --- a/lib/clients/openai/moderation/README.md +++ b/lib/clients/openai/moderation/README.md @@ -2,10 +2,9 @@ This directory contains the V client for OpenAI's Moderation API. - ```v -import freeflowuniverse.herolib.clients.openai +import incubaid.herolib.clients.openai mut client:= openai.get()! //will be the default client, key is in `AIKEY` on environment variable or `OPENROUTER_API_KEY` @@ -27,4 +26,3 @@ if resp.results.len > 0 { } ``` - diff --git a/lib/clients/openai/moderation/moderation.v b/lib/clients/openai/moderation/moderation.v index be2ab46b..33de2457 100644 --- a/lib/clients/openai/moderation/moderation.v +++ b/lib/clients/openai/moderation/moderation.v @@ -1,7 +1,7 @@ module moderation import json -import freeflowuniverse.herolib.clients.openai { OpenAI } +import incubaid.herolib.clients.openai { OpenAI } type OpenAIAlias = OpenAI diff --git a/lib/clients/openai/openai_factory_.v b/lib/clients/openai/openai_factory_.v index d5ed5033..14187a0e 100644 --- a/lib/clients/openai/openai_factory_.v +++ b/lib/clients/openai/openai_factory_.v @@ -1,8 +1,8 @@ module openai -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.base +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json __global ( diff --git a/lib/clients/openai/openai_model.v b/lib/clients/openai/openai_model.v index daeaba95..2b217129 100644 --- a/lib/clients/openai/openai_model.v +++ b/lib/clients/openai/openai_model.v @@ -1,7 +1,7 @@ module openai -import freeflowuniverse.herolib.data.encoderhero -import freeflowuniverse.herolib.core.httpconnection +import incubaid.herolib.data.encoderhero +import incubaid.herolib.core.httpconnection import os pub const version = '0.0.0' diff --git a/lib/clients/openai/readme.md b/lib/clients/openai/readme.md index 1d6ecc70..9b3d43be 100644 --- a/lib/clients/openai/readme.md +++ b/lib/clients/openai/readme.md @@ -4,8 +4,8 @@ To get started ```v -import freeflowuniverse.herolib.clients.openai -import freeflowuniverse.herolib.core.playcmds +import incubaid.herolib.clients.openai +import incubaid.herolib.core.playcmds playcmds.run( heroscript:' @@ -21,10 +21,10 @@ playcmds.run( mut client:= openai.get()! mut r:=client.chat_completion( - model: "gpt-3.5-turbo", - message: 'Hello, world!' - temperature: 0.5 - max_completion_tokens: 1024 + model: "gpt-3.5-turbo", + message: 'Hello, world!' + temperature: 0.5 + max_completion_tokens: 1024 )! ``` diff --git a/lib/clients/postgresql_client/cmds.v b/lib/clients/postgresql_client/cmds.v index 1d757157..bc3325d1 100644 --- a/lib/clients/postgresql_client/cmds.v +++ b/lib/clients/postgresql_client/cmds.v @@ -1,10 +1,10 @@ module postgresql_client import db.pg -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.osal.core as osal +import incubaid.herolib.core.texttools +import incubaid.herolib.osal.core as osal import os -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console pub fn (mut self PostgresqlClient) check() ! { mut db := self.db()! diff --git a/lib/clients/postgresql_client/postgresql_client_factory_.v b/lib/clients/postgresql_client/postgresql_client_factory_.v index 5678c02c..c3fa262d 100644 --- a/lib/clients/postgresql_client/postgresql_client_factory_.v +++ b/lib/clients/postgresql_client/postgresql_client_factory_.v @@ -1,8 +1,8 @@ module postgresql_client -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.base +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json __global ( diff --git a/lib/clients/postgresql_client/postgresql_client_model.v b/lib/clients/postgresql_client/postgresql_client_model.v index 23c9cf05..99eb73df 100644 --- a/lib/clients/postgresql_client/postgresql_client_model.v +++ b/lib/clients/postgresql_client/postgresql_client_model.v @@ -1,8 +1,8 @@ module postgresql_client -import freeflowuniverse.herolib.data.paramsparser -import freeflowuniverse.herolib.data.encoderhero -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.data.paramsparser +import incubaid.herolib.data.encoderhero +import incubaid.herolib.ui.console import os import db.pg diff --git a/lib/clients/postgresql_client/readme.md b/lib/clients/postgresql_client/readme.md index 905aceb6..37fe2423 100644 --- a/lib/clients/postgresql_client/readme.md +++ b/lib/clients/postgresql_client/readme.md @@ -11,19 +11,19 @@ The PostgreSQL client can be configured using HeroScript. Configuration settings ```v #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.core -import freeflowuniverse.herolib.clients.postgresql_client +import incubaid.herolib.core +import incubaid.herolib.clients.postgresql_client // Configure PostgreSQL client heroscript := " !!postgresql_client.configure - name:'test' - user: 'postgres' - port: 5432 - host: 'localhost' - password: '1234' - dbname: 'postgres' + name:'test' + user: 'postgres' + port: 5432 + host: 'localhost' + password: '1234' + dbname: 'postgres' " // Process the heroscript configuration @@ -34,8 +34,8 @@ mut db_client := postgresql_client.get(name: "test")! // Check if test database exists, create if not if !db_client.db_exists('test')! { - println('Creating database test...') - db_client.db_create('test')! + println('Creating database test...') + db_client.db_create('test')! } // Switch to test database @@ -43,10 +43,10 @@ db_client.dbname = 'test' // Create table if not exists create_table_sql := "CREATE TABLE IF NOT EXISTS users ( - id SERIAL PRIMARY KEY, - name VARCHAR(100) NOT NULL, - email VARCHAR(255) UNIQUE NOT NULL, - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP + id SERIAL PRIMARY KEY, + name VARCHAR(100) NOT NULL, + email VARCHAR(255) UNIQUE NOT NULL, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP )" println('Creating table users if not exists...') @@ -117,10 +117,10 @@ db_client.backup(dest: '/path/to/backup/dir')! Backups are created in custom PostgreSQL format (.bak files) which can be restored using pg_restore. - ## OS supporting OSX + ``` ## supporting @@ -132,4 +132,4 @@ brew install libpq brew link --force libpq export PATH="/usr/local/opt/libpq/bin:$PATH" -``` \ No newline at end of file +``` diff --git a/lib/clients/qdrant/collections.v b/lib/clients/qdrant/collections.v index dd5ddc56..02b9b020 100644 --- a/lib/clients/qdrant/collections.v +++ b/lib/clients/qdrant/collections.v @@ -1,6 +1,6 @@ module qdrant -import freeflowuniverse.herolib.core.httpconnection +import incubaid.herolib.core.httpconnection import json // Configuration of the collection diff --git a/lib/clients/qdrant/points.v b/lib/clients/qdrant/points.v index 278e8f72..e799abe0 100644 --- a/lib/clients/qdrant/points.v +++ b/lib/clients/qdrant/points.v @@ -1,6 +1,6 @@ module qdrant -import freeflowuniverse.herolib.core.httpconnection +import incubaid.herolib.core.httpconnection import json import rand diff --git a/lib/clients/qdrant/qdrant_client.v b/lib/clients/qdrant/qdrant_client.v index 14af1f61..5ddf0213 100644 --- a/lib/clients/qdrant/qdrant_client.v +++ b/lib/clients/qdrant/qdrant_client.v @@ -1,6 +1,6 @@ module qdrant -import freeflowuniverse.herolib.core.httpconnection +import incubaid.herolib.core.httpconnection import json // QDrant usage diff --git a/lib/clients/qdrant/qdrant_factory_.v b/lib/clients/qdrant/qdrant_factory_.v index 72e7b943..889bbb4b 100644 --- a/lib/clients/qdrant/qdrant_factory_.v +++ b/lib/clients/qdrant/qdrant_factory_.v @@ -1,8 +1,8 @@ module qdrant -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.base +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json __global ( diff --git a/lib/clients/qdrant/qdrant_model.v b/lib/clients/qdrant/qdrant_model.v index 99ea6693..8e652276 100644 --- a/lib/clients/qdrant/qdrant_model.v +++ b/lib/clients/qdrant/qdrant_model.v @@ -1,7 +1,7 @@ module qdrant -// import freeflowuniverse.herolib.data.paramsparser -import freeflowuniverse.herolib.data.encoderhero +// import incubaid.herolib.data.paramsparser +import incubaid.herolib.data.encoderhero // import json // import os diff --git a/lib/clients/qdrant/readme.md b/lib/clients/qdrant/readme.md index a8b1839a..223fd2c5 100644 --- a/lib/clients/qdrant/readme.md +++ b/lib/clients/qdrant/readme.md @@ -15,7 +15,7 @@ This is a V client for [Qdrant](https://qdrant.tech/), a high-performance vector ```v // Create a new Qdrant client -import freeflowuniverse.herolib.clients.qdrant +import incubaid.herolib.clients.qdrant mut client := qdrant.get()! diff --git a/lib/clients/rclone/config.v b/lib/clients/rclone/config.v index 91f1215d..f026b06f 100644 --- a/lib/clients/rclone/config.v +++ b/lib/clients/rclone/config.v @@ -1,7 +1,7 @@ module rclone -import freeflowuniverse.herolib.core.playbook -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.playbook +import incubaid.herolib.core.texttools import os const configfile = '${os.home_dir()}/.config/rclone/rclone.conf' diff --git a/lib/clients/rclone/rclone_factory_.v b/lib/clients/rclone/rclone_factory_.v index c7e1a11c..627fffd1 100644 --- a/lib/clients/rclone/rclone_factory_.v +++ b/lib/clients/rclone/rclone_factory_.v @@ -1,8 +1,8 @@ module rclone -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.base +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json __global ( diff --git a/lib/clients/rclone/rclone_model.v b/lib/clients/rclone/rclone_model.v index 4167d562..b693fa68 100644 --- a/lib/clients/rclone/rclone_model.v +++ b/lib/clients/rclone/rclone_model.v @@ -1,7 +1,7 @@ module rclone -import freeflowuniverse.herolib.data.paramsparser -import freeflowuniverse.herolib.data.encoderhero +import incubaid.herolib.data.paramsparser +import incubaid.herolib.data.encoderhero import os pub const version = '0.0.0' diff --git a/lib/clients/rclone/readme.md b/lib/clients/rclone/readme.md index b336e4e5..89415e43 100644 --- a/lib/clients/rclone/readme.md +++ b/lib/clients/rclone/readme.md @@ -2,31 +2,30 @@ Rclone is this incredible swiss army knive to deal with S3 storage servers. - ## Example ```golang -import freeflowuniverse.herolib.osal.core.rclone +import incubaid.herolib.osal.core.rclone fn main() { - do() or { panic(err) } + do() or { panic(err) } } fn do() ! { - mut z:=rclone.new()! + mut z:=rclone.new()! - // name string @[required] - // cmd string @[required] - // cmd_file bool //if we wanna force to run it as a file which is given to bash -c (not just a cmd in rclone) - // test string - // test_file bool - // after []string - // env map[string]string - // oneshot bool - p:=z.new( - name:"test" - cmd:'/bin/bash' - )! + // name string @[required] + // cmd string @[required] + // cmd_file bool //if we wanna force to run it as a file which is given to bash -c (not just a cmd in rclone) + // test string + // test_file bool + // after []string + // env map[string]string + // oneshot bool + p:=z.new( + name:"test" + cmd:'/bin/bash' + )! } @@ -34,7 +33,6 @@ fn do() ! { ## protocol defined in +sal on top of -sal on top of https://github.com/threefoldtech/rclone/tree/master - -https://github.com/threefoldtech/rclone/blob/master/docs/protocol.md \ No newline at end of file + diff --git a/lib/clients/rclone/readme.v.md b/lib/clients/rclone/readme.v.md index e3cfa73b..9c7995b7 100644 --- a/lib/clients/rclone/readme.v.md +++ b/lib/clients/rclone/readme.v.md @@ -12,12 +12,12 @@ This module provides a V language interface to RCloneClient, a command line prog ## Prerequisites -RCloneClient must be installed on your system. Visit https://rclone.org/install/ for installation instructions. +RCloneClient must be installed on your system. Visit for installation instructions. ## Usage ```v -import freeflowuniverse.herolib.osal.core.rclone +import incubaid.herolib.osal.core.rclone fn main() { // Create a new RCloneClient instance diff --git a/lib/clients/runpod/readme.md b/lib/clients/runpod/readme.md index 02d902a1..b89e9a30 100644 --- a/lib/clients/runpod/readme.md +++ b/lib/clients/runpod/readme.md @@ -1,14 +1,12 @@ # runpod - - To get started ```v -import freeflowuniverse.herolib.clients. runpod +import incubaid.herolib.clients. runpod mut client:= runpod.get()! @@ -21,7 +19,6 @@ client... ## example heroscript - ```hero !!runpod.configure secret: '...' @@ -39,4 +36,4 @@ This script demonstrates creating, stopping, starting, and terminating RunPod po **How to Run** -- Find out our example in: examples/develop/runpod/runpod_example.vsh +* Find out our example in: examples/develop/runpod/runpod_example.vsh diff --git a/lib/clients/runpod/runpod_factory_.v b/lib/clients/runpod/runpod_factory_.v index 7940207d..5767a054 100644 --- a/lib/clients/runpod/runpod_factory_.v +++ b/lib/clients/runpod/runpod_factory_.v @@ -1,8 +1,8 @@ module runpod -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.base +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json __global ( diff --git a/lib/clients/runpod/runpod_http.v b/lib/clients/runpod/runpod_http.v index ac221765..8fd24971 100644 --- a/lib/clients/runpod/runpod_http.v +++ b/lib/clients/runpod/runpod_http.v @@ -2,7 +2,7 @@ module runpod import x.json2 import net.http { Method } -import freeflowuniverse.herolib.core.httpconnection +import incubaid.herolib.core.httpconnection // GraphQL response wrapper struct GqlResponse[T] { diff --git a/lib/clients/runpod/runpod_model.v b/lib/clients/runpod/runpod_model.v index ea3a9606..c166db52 100644 --- a/lib/clients/runpod/runpod_model.v +++ b/lib/clients/runpod/runpod_model.v @@ -1,6 +1,6 @@ module runpod -import freeflowuniverse.herolib.data.paramsparser +import incubaid.herolib.data.paramsparser import os pub const version = '1.14.3' diff --git a/lib/clients/runpod/utils.v b/lib/clients/runpod/utils.v index bdd147c4..fea5b934 100644 --- a/lib/clients/runpod/utils.v +++ b/lib/clients/runpod/utils.v @@ -1,6 +1,6 @@ module runpod -import freeflowuniverse.herolib.core.httpconnection +import incubaid.herolib.core.httpconnection import x.json2 enum OperationType { diff --git a/lib/clients/sendgrid/sendgrid_factory_.v b/lib/clients/sendgrid/sendgrid_factory_.v index aa3a27b4..4b17f855 100644 --- a/lib/clients/sendgrid/sendgrid_factory_.v +++ b/lib/clients/sendgrid/sendgrid_factory_.v @@ -1,8 +1,8 @@ module sendgrid -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.base +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json __global ( diff --git a/lib/clients/sendgrid/sendgrid_model.v b/lib/clients/sendgrid/sendgrid_model.v index 7b835262..e08d11df 100644 --- a/lib/clients/sendgrid/sendgrid_model.v +++ b/lib/clients/sendgrid/sendgrid_model.v @@ -1,6 +1,6 @@ module sendgrid -import freeflowuniverse.herolib.data.paramsparser +import incubaid.herolib.data.paramsparser import os pub const version = '0.0.0' diff --git a/lib/clients/traefik/factory.v b/lib/clients/traefik/factory.v index 03f39b9a..df80b408 100644 --- a/lib/clients/traefik/factory.v +++ b/lib/clients/traefik/factory.v @@ -1,8 +1,8 @@ module traefik -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core.redisclient -import freeflowuniverse.herolib.osal.traefik as osal_traefik +import incubaid.herolib.core.texttools +import incubaid.herolib.core.redisclient +import incubaid.herolib.osal.traefik as osal_traefik __global ( traefik_managers map[string]&TraefikManager diff --git a/lib/clients/traefik/manager.v b/lib/clients/traefik/manager.v index 3d2cd256..5cb53603 100644 --- a/lib/clients/traefik/manager.v +++ b/lib/clients/traefik/manager.v @@ -1,8 +1,8 @@ module traefik -import freeflowuniverse.herolib.core.redisclient -import freeflowuniverse.herolib.osal.traefik as osal_traefik -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.redisclient +import incubaid.herolib.osal.traefik as osal_traefik +import incubaid.herolib.core.texttools @[heap] pub struct TraefikManager { diff --git a/lib/clients/traefik/play.v b/lib/clients/traefik/play.v index 66e8189d..5eb0c700 100644 --- a/lib/clients/traefik/play.v +++ b/lib/clients/traefik/play.v @@ -1,8 +1,8 @@ module traefik -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.core.texttools +import incubaid.herolib.ui.console pub fn play(mut plbook PlayBook) ! { if !plbook.exists(filter: 'traefik.') { diff --git a/lib/clients/vastai/readme.md b/lib/clients/vastai/readme.md index a5f1308b..7f67e5ca 100644 --- a/lib/clients/vastai/readme.md +++ b/lib/clients/vastai/readme.md @@ -1,13 +1,11 @@ # vastai - - To get started ```v -import freeflowuniverse.herolib.clients. vastai +import incubaid.herolib.clients. vastai mut client:= vastai.get()! @@ -26,5 +24,3 @@ client... host: 'localhost' port: 8888 ``` - - diff --git a/lib/clients/vastai/vastai_factory_.v b/lib/clients/vastai/vastai_factory_.v index 3f9f884e..0b64ee75 100644 --- a/lib/clients/vastai/vastai_factory_.v +++ b/lib/clients/vastai/vastai_factory_.v @@ -1,8 +1,8 @@ module vastai -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.base +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json __global ( diff --git a/lib/clients/vastai/vastai_model.v b/lib/clients/vastai/vastai_model.v index 540206f0..fe0dee29 100644 --- a/lib/clients/vastai/vastai_model.v +++ b/lib/clients/vastai/vastai_model.v @@ -1,7 +1,7 @@ module vastai -import freeflowuniverse.herolib.data.paramsparser -import freeflowuniverse.herolib.core.httpconnection +import incubaid.herolib.data.paramsparser +import incubaid.herolib.core.httpconnection import os pub const version = '1.14.3' diff --git a/lib/clients/wireguard/readme.md b/lib/clients/wireguard/readme.md index f571524c..dd566671 100644 --- a/lib/clients/wireguard/readme.md +++ b/lib/clients/wireguard/readme.md @@ -1,13 +1,11 @@ # wireguard - - To get started ```v -import freeflowuniverse.herolib.clients. wireguard +import incubaid.herolib.clients. wireguard mut client:= wireguard.get()! @@ -26,5 +24,3 @@ client... host: 'localhost' port: 8888 ``` - - diff --git a/lib/clients/wireguard/wireguard_factory_.v b/lib/clients/wireguard/wireguard_factory_.v index 58e4f4f7..b356d38a 100644 --- a/lib/clients/wireguard/wireguard_factory_.v +++ b/lib/clients/wireguard/wireguard_factory_.v @@ -1,8 +1,8 @@ module wireguard -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.base +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json __global ( diff --git a/lib/clients/wireguard/wireguard_model.v b/lib/clients/wireguard/wireguard_model.v index 678a308b..9fb76f58 100644 --- a/lib/clients/wireguard/wireguard_model.v +++ b/lib/clients/wireguard/wireguard_model.v @@ -1,6 +1,6 @@ module wireguard -import freeflowuniverse.herolib.data.paramsparser +import incubaid.herolib.data.paramsparser pub const version = '1.14.3' const singleton = false diff --git a/lib/clients/zerodb_client/zdb.v b/lib/clients/zerodb_client/zdb.v index e01fd2db..b554f7b2 100644 --- a/lib/clients/zerodb_client/zdb.v +++ b/lib/clients/zerodb_client/zdb.v @@ -1,7 +1,7 @@ module zerodb_client -import freeflowuniverse.herolib.core.redisclient -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.redisclient +import incubaid.herolib.ui.console pub struct ZDB { pub mut: diff --git a/lib/clients/zerodb_client/zerodb_client_factory_.v b/lib/clients/zerodb_client/zerodb_client_factory_.v index 0f4c6f1b..fa73b1f3 100644 --- a/lib/clients/zerodb_client/zerodb_client_factory_.v +++ b/lib/clients/zerodb_client/zerodb_client_factory_.v @@ -1,8 +1,8 @@ module zerodb_client -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.base +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json __global ( diff --git a/lib/clients/zerodb_client/zerodb_client_model.v b/lib/clients/zerodb_client/zerodb_client_model.v index fad77119..782acb9f 100644 --- a/lib/clients/zerodb_client/zerodb_client_model.v +++ b/lib/clients/zerodb_client/zerodb_client_model.v @@ -1,6 +1,6 @@ module zerodb_client -import freeflowuniverse.herolib.data.paramsparser +import incubaid.herolib.data.paramsparser import os pub const version = '0.0.0' diff --git a/lib/clients/zinit/README.md b/lib/clients/zinit/README.md index e54c2cd2..c6b43aca 100644 --- a/lib/clients/zinit/README.md +++ b/lib/clients/zinit/README.md @@ -26,7 +26,7 @@ Zinit is a process manager that provides service monitoring, dependency manageme ### Basic Example ```v -import freeflowuniverse.herolib.clients.zinit +import incubaid.herolib.clients.zinit // Create a new client mut client := zinit.get(create:true)! @@ -54,7 +54,7 @@ client.service_stop('redis')! ### Service Configuration Management ```v -import freeflowuniverse.herolib.clients.zinit +import incubaid.herolib.clients.zinit mut client := zinit.new_client()! @@ -86,7 +86,7 @@ println('Delete result: ${result}') ### Service Statistics ```v -import freeflowuniverse.herolib.clients.zinit +import incubaid.herolib.clients.zinit mut client := zinit.new_client()! @@ -106,7 +106,7 @@ for child in stats.children { ### Log Streaming ```v -import freeflowuniverse.herolib.clients.zinit +import incubaid.herolib.clients.zinit mut client := zinit.new_client()! @@ -170,7 +170,7 @@ println('Subscribed to logs with ID: ${subscription_id}') ### Using the Factory Pattern ```v -import freeflowuniverse.herolib.clients.zinit +import incubaid.herolib.clients.zinit // Get client using factory (recommended) mut client := zinit.get()! @@ -202,7 +202,7 @@ The client provides comprehensive error handling for all Zinit-specific error co - `-32008`: Service file error ```v -import freeflowuniverse.herolib.clients.zinit +import incubaid.herolib.clients.zinit mut client := zinit.new_client()! @@ -215,5 +215,3 @@ client.service_start('nonexistent') or { } } ``` - - diff --git a/lib/clients/zinit/zinit.v b/lib/clients/zinit/zinit.v index 739a22ff..630b5449 100644 --- a/lib/clients/zinit/zinit.v +++ b/lib/clients/zinit/zinit.v @@ -1,8 +1,8 @@ module zinit import json -import freeflowuniverse.herolib.schemas.jsonrpc -import freeflowuniverse.herolib.schemas.openrpc +import incubaid.herolib.schemas.jsonrpc +import incubaid.herolib.schemas.openrpc // Helper function to get or create the RPC client fn (mut c ZinitRPC) client_() !&jsonrpc.Client { diff --git a/lib/clients/zinit/zinit_factory_.v b/lib/clients/zinit/zinit_factory_.v index 88895839..0b26a24e 100644 --- a/lib/clients/zinit/zinit_factory_.v +++ b/lib/clients/zinit/zinit_factory_.v @@ -1,8 +1,8 @@ module zinit -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.base +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json __global ( diff --git a/lib/clients/zinit/zinit_model.v b/lib/clients/zinit/zinit_model.v index db2c00ea..ab336a87 100644 --- a/lib/clients/zinit/zinit_model.v +++ b/lib/clients/zinit/zinit_model.v @@ -1,7 +1,7 @@ module zinit -import freeflowuniverse.herolib.data.encoderhero -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.data.encoderhero +import incubaid.herolib.schemas.jsonrpc import os pub const version = '0.0.0' diff --git a/lib/conversiontools/docsorter/docsorter.v b/lib/conversiontools/docsorter/docsorter.v index 529dcfc1..baa60d28 100644 --- a/lib/conversiontools/docsorter/docsorter.v +++ b/lib/conversiontools/docsorter/docsorter.v @@ -1,9 +1,9 @@ module docsorter -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console import os import json -import freeflowuniverse.herolib.lang.python +import incubaid.herolib.lang.python @[heap] pub struct Doc { diff --git a/lib/conversiontools/docsorter/readme.md b/lib/conversiontools/docsorter/readme.md index 9b49d071..8d405cdb 100644 --- a/lib/conversiontools/docsorter/readme.md +++ b/lib/conversiontools/docsorter/readme.md @@ -1,19 +1,17 @@ - Each document we will sort need to have e.g. `[aac]` in the name, the aac is the id of the document How to use - documents can be downloaded from any source and put in a directory which is the the source of the information - ## example ```v #!/usr/bin/env -S v -gc none -cc tcc -d use_openssl -enable-globals run import os -import import freeflowuniverse.herolib.conversiontools.docsorter +import import incubaid.herolib.conversiontools.docsorter docsorter.sort( path: '/Users/despiegk1/Downloads/pdfcleaner' @@ -46,4 +44,4 @@ the first is the id, 2nd is name of the collection, the 3e is the name, and 4e i url:'https://docs.google.com/document/d/1sjh2K6iay86H9Gd83gY04bVDSj4brxADEWQMVmDq0SQ' description:'OurWorld Investment Memo Nov 2024' !!docsorter.canva_export ... -``` \ No newline at end of file +``` diff --git a/lib/conversiontools/docsorter/slides_process.v b/lib/conversiontools/docsorter/slides_process.v index 7e965dc2..57f9f311 100644 --- a/lib/conversiontools/docsorter/slides_process.v +++ b/lib/conversiontools/docsorter/slides_process.v @@ -1,6 +1,6 @@ module docsorter -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console import os fn (mut pc DocSorter) slides_process(path string) ! { diff --git a/lib/conversiontools/imagemagick/image.v b/lib/conversiontools/imagemagick/image.v index 991a17b9..0663ceaa 100644 --- a/lib/conversiontools/imagemagick/image.v +++ b/lib/conversiontools/imagemagick/image.v @@ -1,6 +1,6 @@ module imagemagick -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib pub struct Image { pub mut: diff --git a/lib/conversiontools/imagemagick/image_downsize.v b/lib/conversiontools/imagemagick/image_downsize.v index ee04a9d6..8796c33a 100644 --- a/lib/conversiontools/imagemagick/image_downsize.v +++ b/lib/conversiontools/imagemagick/image_downsize.v @@ -1,8 +1,8 @@ module imagemagick -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.pathlib +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console import os @[params] diff --git a/lib/conversiontools/imagemagick/image_downsize_test.v b/lib/conversiontools/imagemagick/image_downsize_test.v index 81738fa0..8a0bd2d6 100644 --- a/lib/conversiontools/imagemagick/image_downsize_test.v +++ b/lib/conversiontools/imagemagick/image_downsize_test.v @@ -1,7 +1,7 @@ -import freeflowuniverse.herolib.conversiontools.imagemagick { image_new } -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.conversiontools.imagemagick { image_new } +import incubaid.herolib.core.pathlib import os -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console const testpath = os.dir(@FILE) + '/example' diff --git a/lib/conversiontools/imagemagick/image_identify.v b/lib/conversiontools/imagemagick/image_identify.v index d2374022..a5f10888 100644 --- a/lib/conversiontools/imagemagick/image_identify.v +++ b/lib/conversiontools/imagemagick/image_identify.v @@ -1,7 +1,7 @@ module imagemagick -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console fn (mut image Image) identify_verbose() ! { if image.size_y != 0 { diff --git a/lib/conversiontools/imagemagick/image_identify_test.v b/lib/conversiontools/imagemagick/image_identify_test.v index 13832cb3..f019715e 100644 --- a/lib/conversiontools/imagemagick/image_identify_test.v +++ b/lib/conversiontools/imagemagick/image_identify_test.v @@ -1,7 +1,7 @@ -import freeflowuniverse.herolib.conversiontools.imagemagick { image_new } -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.conversiontools.imagemagick { image_new } +import incubaid.herolib.core.pathlib import os -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console const testpath = os.dir(@FILE) + '/example' diff --git a/lib/conversiontools/imagemagick/image_test.v b/lib/conversiontools/imagemagick/image_test.v index 802868f1..f9b3f04c 100644 --- a/lib/conversiontools/imagemagick/image_test.v +++ b/lib/conversiontools/imagemagick/image_test.v @@ -1,5 +1,5 @@ -import freeflowuniverse.herolib.conversiontools.imagemagick { image_new } -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.conversiontools.imagemagick { image_new } +import incubaid.herolib.core.pathlib import os const testpath = os.dir(@FILE) + '/example' diff --git a/lib/conversiontools/imagemagick/imagemagick.v b/lib/conversiontools/imagemagick/imagemagick.v index 4aa5eaa0..1497d9eb 100644 --- a/lib/conversiontools/imagemagick/imagemagick.v +++ b/lib/conversiontools/imagemagick/imagemagick.v @@ -1,9 +1,9 @@ module imagemagick -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.data.paramsparser -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.pathlib +import incubaid.herolib.data.paramsparser +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console pub struct DownsizeArgs { pub: diff --git a/lib/conversiontools/imagemagick/readme.md b/lib/conversiontools/imagemagick/readme.md index 87d1d2d3..a76b35b3 100644 --- a/lib/conversiontools/imagemagick/readme.md +++ b/lib/conversiontools/imagemagick/readme.md @@ -3,7 +3,7 @@ ### example how to use ```v -import freeflowuniverse.herolib.conversiontools.imagemagick +import incubaid.herolib.conversiontools.imagemagick imagemagick.downsize( path:"/tmp/mydir" @@ -34,4 +34,4 @@ Image{ size_kbyte: 414 transparent: true } -``` \ No newline at end of file +``` diff --git a/lib/conversiontools/pdftotext/main.v b/lib/conversiontools/pdftotext/main.v index f2937c89..9b26486b 100644 --- a/lib/conversiontools/pdftotext/main.v +++ b/lib/conversiontools/pdftotext/main.v @@ -2,7 +2,7 @@ module main import os import flag -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console fn convert_to_text(path string, dst string) !os.Result { if !os.exists(path) { diff --git a/lib/conversiontools/text_extractor/main.v b/lib/conversiontools/text_extractor/main.v index e733be79..c13529f7 100644 --- a/lib/conversiontools/text_extractor/main.v +++ b/lib/conversiontools/text_extractor/main.v @@ -2,7 +2,7 @@ module main import os import flag -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console fn convert_to_text(path string) !os.Result { if !os.exists(path) { diff --git a/lib/core/base/context.v b/lib/core/base/context.v index 0ed72b81..4e36367c 100644 --- a/lib/core/base/context.v +++ b/lib/core/base/context.v @@ -1,8 +1,8 @@ module base -import freeflowuniverse.herolib.data.paramsparser -import freeflowuniverse.herolib.core.redisclient -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.data.paramsparser +import incubaid.herolib.core.redisclient +import incubaid.herolib.core.pathlib import json import os diff --git a/lib/core/base/context_session.v b/lib/core/base/context_session.v index 3e626114..6095a080 100644 --- a/lib/core/base/context_session.v +++ b/lib/core/base/context_session.v @@ -1,7 +1,7 @@ module base -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.data.paramsparser +import incubaid.herolib.data.ourtime +import incubaid.herolib.data.paramsparser import json @[params] diff --git a/lib/core/base/factory_context.v b/lib/core/base/factory_context.v index 7de7c97e..e377b572 100644 --- a/lib/core/base/factory_context.v +++ b/lib/core/base/factory_context.v @@ -1,6 +1,6 @@ module base -import freeflowuniverse.herolib.data.paramsparser +import incubaid.herolib.data.paramsparser @[params] pub struct ContextConfigArgs { diff --git a/lib/core/base/session.v b/lib/core/base/session.v index 1e5c1e94..ca3778d9 100644 --- a/lib/core/base/session.v +++ b/lib/core/base/session.v @@ -1,13 +1,13 @@ module base -import freeflowuniverse.herolib.data.ourtime -// import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.data.paramsparser -import freeflowuniverse.herolib.core.logger +import incubaid.herolib.data.ourtime +// import incubaid.herolib.core.texttools +import incubaid.herolib.data.paramsparser +import incubaid.herolib.core.logger import json -import freeflowuniverse.herolib.core.pathlib -// import freeflowuniverse.herolib.develop.gittools -// import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.pathlib +// import incubaid.herolib.develop.gittools +// import incubaid.herolib.ui.console @[heap] pub struct Session { diff --git a/lib/core/base/session_error.v b/lib/core/base/session_error.v index 63d82264..edb3941f 100644 --- a/lib/core/base/session_error.v +++ b/lib/core/base/session_error.v @@ -1,7 +1,7 @@ module base -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.data.ourtime +import incubaid.herolib.core.texttools pub struct ErrorArgs { pub mut: diff --git a/lib/core/base/session_logger.v b/lib/core/base/session_logger.v index 2f200cd3..1d6e6ea4 100644 --- a/lib/core/base/session_logger.v +++ b/lib/core/base/session_logger.v @@ -1,6 +1,6 @@ module base -import freeflowuniverse.herolib.core.logger +import incubaid.herolib.core.logger pub fn (mut session Session) logger() !logger.Logger { return session.logger_ or { diff --git a/lib/core/code/folder.v b/lib/core/code/folder.v index 5326e440..bc0aa627 100644 --- a/lib/core/code/folder.v +++ b/lib/core/code/folder.v @@ -1,6 +1,6 @@ module code -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib pub interface IFolder { name string diff --git a/lib/core/code/improvements.md b/lib/core/code/improvements.md index f9d3f44b..7fb31e66 100644 --- a/lib/core/code/improvements.md +++ b/lib/core/code/improvements.md @@ -1,30 +1,36 @@ # Code Review and Improvement Plan for HeroLib Code Module ## Overview + The HeroLib `code` module provides utilities for parsing and generating V language code. It's designed to be a lightweight alternative to `v.ast` for code analysis and generation across multiple languages. While the module has good foundational structure, there are several areas that need improvement. ## Issues Identified ### 1. Incomplete TypeScript Generation Support + - The `typescript()` method exists in some models but lacks comprehensive implementation - Missing TypeScript generation for complex types (arrays, maps, results) - No TypeScript interface generation for structs ### 2. Template System Issues + - Some templates are empty (e.g., `templates/function/method.py`, `templates/comment/comment.py`) - Template usage is inconsistent across the codebase - No clear separation between V and other language templates ### 3. Missing Parser Documentation Examples + - README.md mentions codeparser but doesn't show how to use the parser from this module - No clear examples of parsing V files or modules ### 4. Incomplete Type Handling + - The `parse_type` function doesn't handle all V language types comprehensively - Missing support for function types, sum types, and complex generics - No handling of optional types (`?Type`) ### 5. Code Structure and Consistency + - Some functions lack proper error handling - Inconsistent naming conventions in test files - Missing documentation for several key functions @@ -34,11 +40,13 @@ The HeroLib `code` module provides utilities for parsing and generating V langua ### 1. Complete TypeScript Generation Implementation **What needs to be done:** + - Implement comprehensive TypeScript generation in `model_types.v` - Add TypeScript generation for all type variants - Create proper TypeScript interface generation in `model_struct.v` **Specific fixes:** + ```v // In model_types.v, improve the typescript() method: pub fn (t Type) typescript() string { @@ -67,11 +75,13 @@ pub fn (s Struct) typescript() string { ### 2. Fix Template System **What needs to be done:** + - Remove empty Python template files - Ensure all templates are properly implemented - Add template support for other languages **Specific fixes:** + - Delete `templates/function/method.py` and `templates/comment/comment.py` if they're not needed - Add proper TypeScript templates for struct and interface generation - Create consistent template naming conventions @@ -79,18 +89,20 @@ pub fn (s Struct) typescript() string { ### 3. Improve Parser Documentation **What needs to be done:** + - Add clear examples in README.md showing how to use the parser - Document the parsing functions with practical examples **Specific fixes:** Add to README.md: + ```markdown ## Parsing V Code The code module provides utilities to parse V code into structured models: ```v -import freeflowuniverse.herolib.core.code +import incubaid.herolib.core.code // Parse a V file content := os.read_file('example.v') or { panic(err) } @@ -109,11 +121,13 @@ struct_ := code.parse_struct(struct_code_string) or { panic(err) } ### 4. Complete Type Handling **What needs to be done:** + - Extend `parse_type` to handle more complex V types - Add support for optional types (`?Type`) - Improve generic type parsing **Specific fixes:** + ```v // In model_types.v, enhance parse_type function: pub fn parse_type(type_str string) Type { @@ -143,11 +157,13 @@ pub fn parse_type(type_str string) Type { ### 5. Code Structure Improvements **What needs to be done:** + - Add proper error handling to all parsing functions - Standardize naming conventions - Improve documentation consistency **Specific fixes:** + - Add error checking in `parse_function`, `parse_struct`, and other parsing functions - Ensure all public functions have clear documentation comments - Standardize test function names @@ -155,6 +171,7 @@ pub fn parse_type(type_str string) Type { ## Module Generation to Other Languages ### Current Implementation + The current code shows basic TypeScript generation support, but it's incomplete. The generation should: 1. **Support multiple languages**: The code structure allows for multi-language generation, but only TypeScript has partial implementation @@ -164,11 +181,13 @@ The current code shows basic TypeScript generation support, but it's incomplete. ### What Needs to Move to Other Modules **TypeScript Generation Module:** + - Move all TypeScript-specific generation code to a new `typescript` module - Create TypeScript templates for structs, interfaces, and functions - Add proper TypeScript formatting support **Example Structure:** + ``` lib/core/code/ ├── model_types.v # Core type models (language agnostic) @@ -225,4 +244,4 @@ println('Parsed function: ${function.name}') 6. **Improve error handling** in all parsing functions 7. **Standardize documentation and naming** conventions across the module -These improvements will make the code module more robust, easier to use, and better prepared for multi-language code generation. \ No newline at end of file +These improvements will make the code module more robust, easier to use, and better prepared for multi-language code generation. diff --git a/lib/core/code/model_file.v b/lib/core/code/model_file.v index 1d4bebbd..d3d43b96 100644 --- a/lib/core/code/model_file.v +++ b/lib/core/code/model_file.v @@ -1,8 +1,8 @@ module code import log -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.texttools +import incubaid.herolib.core.pathlib import os pub interface IFile { diff --git a/lib/core/code/model_file_test.v b/lib/core/code/model_file_test.v index 7d68c614..3f88a026 100644 --- a/lib/core/code/model_file_test.v +++ b/lib/core/code/model_file_test.v @@ -6,7 +6,7 @@ module test import os import strings -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.texttools const ( VERSION = '1.0.0' @@ -45,7 +45,7 @@ pub fn create_person(name string, age int) Person { assert vfile.imports.len == 3 assert vfile.imports[0].mod == 'os' assert vfile.imports[1].mod == 'strings' - assert vfile.imports[2].mod == 'freeflowuniverse.herolib.core.texttools' + assert vfile.imports[2].mod == 'incubaid.herolib.core.texttools' // Test constants assert vfile.consts.len == 2 diff --git a/lib/core/code/model_folder.v b/lib/core/code/model_folder.v index f11f899f..04e197a3 100644 --- a/lib/core/code/model_folder.v +++ b/lib/core/code/model_folder.v @@ -1,6 +1,6 @@ module code -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib pub interface IBasicFolder { name string diff --git a/lib/core/code/model_function.v b/lib/core/code/model_function.v index 3b37ff8e..493338dc 100644 --- a/lib/core/code/model_function.v +++ b/lib/core/code/model_function.v @@ -1,6 +1,6 @@ module code -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.texttools pub struct Function { pub: diff --git a/lib/core/code/model_module.v b/lib/core/code/model_module.v index 4e9ae8cb..22253fc0 100644 --- a/lib/core/code/model_module.v +++ b/lib/core/code/model_module.v @@ -1,7 +1,7 @@ module code -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.ui.console +import incubaid.herolib.core.pathlib import os import log diff --git a/lib/core/code/model_param.v b/lib/core/code/model_param.v index 4357903a..0ca9293c 100644 --- a/lib/core/code/model_param.v +++ b/lib/core/code/model_param.v @@ -1,6 +1,6 @@ module code -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.texttools pub struct Param { pub mut: diff --git a/lib/core/code/model_struct.v b/lib/core/code/model_struct.v index 7e3bc674..bd590b13 100644 --- a/lib/core/code/model_struct.v +++ b/lib/core/code/model_struct.v @@ -2,7 +2,7 @@ module code import log import os -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.texttools import strings pub struct Struct { diff --git a/lib/core/code/vlang_utils.v b/lib/core/code/vlang_utils.v index a00c8a6f..de001678 100644 --- a/lib/core/code/vlang_utils.v +++ b/lib/core/code/vlang_utils.v @@ -1,6 +1,6 @@ module codetools -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console import os // ===== FILE AND DIRECTORY OPERATIONS ===== @@ -26,11 +26,11 @@ pub fn list_v_files(dir string) ![]string { // get_module_dir converts a V module path to a directory path // ARGS: -// mod string - module name (e.g., 'freeflowuniverse.herolib.mcp') +// mod string - module name (e.g., 'incubaid.herolib.mcp') // RETURNS: // string - absolute path to the module directory pub fn get_module_dir(mod string) string { - module_parts := mod.trim_string_left('freeflowuniverse.herolib').split('.') + module_parts := mod.trim_string_left('incubaid.herolib').split('.') return '${os.home_dir()}/code/github/incubaid/herolib/lib/${module_parts.join('/')}' } diff --git a/lib/core/generator/generic/generate.v b/lib/core/generator/generic/generate.v index 0a6aba7b..45c37dc9 100644 --- a/lib/core/generator/generic/generate.v +++ b/lib/core/generator/generic/generate.v @@ -1,8 +1,8 @@ module generic -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console import os -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib // will ask questions when not in force mode // & generate the module diff --git a/lib/core/generator/generic/generate_installer_client.v b/lib/core/generator/generic/generate_installer_client.v index 64e147a5..faf3f4de 100644 --- a/lib/core/generator/generic/generate_installer_client.v +++ b/lib/core/generator/generic/generate_installer_client.v @@ -1,8 +1,8 @@ module generic -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.osal.core as osal +import incubaid.herolib.ui.console +import incubaid.herolib.core.pathlib +import incubaid.herolib.osal.core as osal fn generate_exec(path string, reset bool) ! { mut args := args_get(path)! diff --git a/lib/core/generator/generic/model.v b/lib/core/generator/generic/model.v index 23a75122..23b82292 100644 --- a/lib/core/generator/generic/model.v +++ b/lib/core/generator/generic/model.v @@ -1,8 +1,8 @@ module generic -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.core.playbook -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.pathlib +import incubaid.herolib.core.playbook +import incubaid.herolib.ui.console pub struct GeneratorArgs { pub mut: @@ -22,7 +22,7 @@ pub mut: hasconfig bool = true playonly bool play_name string // e.g. docusaurus is what we look for - module_path string // e.g.freeflowuniverse.herolib.web.docusaurus + module_path string // e.g.incubaid.herolib.web.docusaurus } pub enum Cat { diff --git a/lib/core/generator/generic/readme.md b/lib/core/generator/generic/readme.md index dc5af9ee..f7a080ea 100644 --- a/lib/core/generator/generic/readme.md +++ b/lib/core/generator/generic/readme.md @@ -54,7 +54,6 @@ there will be a ```.heroscript``` in the director you want to generate for, the needs to be put as .heroscript in the directories which we want to generate - ## templates remarks in templates: @@ -71,7 +70,7 @@ to call in code ```v #!/usr/bin/env -S v -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.core.generator.generic +import incubaid.herolib.core.generator.generic generic.scan(path:"~/code/github/incubaid/herolib/herolib/installers",force:true)! @@ -83,4 +82,3 @@ to run from bash ```bash ~/code/github/incubaid/herolib/scripts/fix_installers.vsh ``` - diff --git a/lib/core/generator/generic/scanner.v b/lib/core/generator/generic/scanner.v index 3fbd4fd3..81a72cb1 100644 --- a/lib/core/generator/generic/scanner.v +++ b/lib/core/generator/generic/scanner.v @@ -1,8 +1,8 @@ module generic import os -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.pathlib +import incubaid.herolib.ui.console // scan over a set of directories call the play where pub fn scan(args_ GeneratorArgs) ! { diff --git a/lib/core/generator/generic/templates/objname_actions.vtemplate b/lib/core/generator/generic/templates/objname_actions.vtemplate index be9fb5b2..200f6755 100644 --- a/lib/core/generator/generic/templates/objname_actions.vtemplate +++ b/lib/core/generator/generic/templates/objname_actions.vtemplate @@ -1,20 +1,20 @@ module ${args.name} -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.core.pathlib @if args.startupmanager -import freeflowuniverse.herolib.osal.systemd -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.systemd +import incubaid.herolib.osal.startupmanager @end -import freeflowuniverse.herolib.installers.ulist +import incubaid.herolib.installers.ulist @if args.build -import freeflowuniverse.herolib.installers.lang.golang -import freeflowuniverse.herolib.installers.lang.rust -import freeflowuniverse.herolib.installers.lang.python +import incubaid.herolib.installers.lang.golang +import incubaid.herolib.installers.lang.rust +import incubaid.herolib.installers.lang.python @end import os diff --git a/lib/core/generator/generic/templates/objname_factory_.vtemplate b/lib/core/generator/generic/templates/objname_factory_.vtemplate index 92855fcf..af3367de 100644 --- a/lib/core/generator/generic/templates/objname_factory_.vtemplate +++ b/lib/core/generator/generic/templates/objname_factory_.vtemplate @@ -1,14 +1,14 @@ module ${args.name} @if args.hasconfig -import freeflowuniverse.herolib.core.base +import incubaid.herolib.core.base @end -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json @if args.cat == .installer -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager @if args.startupmanager import time @end diff --git a/lib/core/generator/generic/templates/objname_model.vtemplate b/lib/core/generator/generic/templates/objname_model.vtemplate index 9933e197..ce957255 100644 --- a/lib/core/generator/generic/templates/objname_model.vtemplate +++ b/lib/core/generator/generic/templates/objname_model.vtemplate @@ -1,6 +1,6 @@ module ${args.name} -import freeflowuniverse.herolib.data.paramsparser -import freeflowuniverse.herolib.data.encoderhero +import incubaid.herolib.data.paramsparser +import incubaid.herolib.data.encoderhero import os pub const version = '0.0.0' diff --git a/lib/core/generator/generic/templates/readme.md b/lib/core/generator/generic/templates/readme.md index 17005bc5..9d486db2 100644 --- a/lib/core/generator/generic/templates/readme.md +++ b/lib/core/generator/generic/templates/readme.md @@ -8,12 +8,12 @@ To get started @if args.cat == .installer -import freeflowuniverse.herolib.installers.something.${args.name} as ${args.name}_installer +import incubaid.herolib.installers.something.${args.name} as ${args.name}_installer heroscript:=" !!${args.name}.configure name:'test' - password: '1234' - port: 7701 + password: '1234' + port: 7701 !!${args.name}.start name:'test' reset:1 " @@ -26,7 +26,7 @@ ${args.name}_installer.play(heroscript=heroscript)! @else -import freeflowuniverse.herolib.clients. ${args.name} +import incubaid.herolib.clients. ${args.name} mut client:= ${args.name}.get()! @@ -41,6 +41,7 @@ client... ## example heroscript @if args.cat == .installer + ```hero !!${args.name}.configure homedir: '/home/user/${args.name}' @@ -51,13 +52,14 @@ client... port: 8888 ``` + @else + ```hero !!${args.name}.configure secret: '...' host: 'localhost' port: 8888 ``` + @end - - diff --git a/lib/core/herocmds/bootstrap.v b/lib/core/herocmds/bootstrap.v index d34b34b5..cc7f3378 100644 --- a/lib/core/herocmds/bootstrap.v +++ b/lib/core/herocmds/bootstrap.v @@ -1,9 +1,9 @@ module herocmds -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.installers.base -import freeflowuniverse.herolib.installers.lang.herolib -import freeflowuniverse.herolib.builder +import incubaid.herolib.osal.core as osal +import incubaid.herolib.installers.base +import incubaid.herolib.installers.lang.herolib +import incubaid.herolib.builder import cli { Command, Flag } pub fn cmd_bootstrap(mut cmdroot Command) { diff --git a/lib/core/herocmds/docsorter.v b/lib/core/herocmds/docsorter.v index 0480b53f..b66ce787 100644 --- a/lib/core/herocmds/docsorter.v +++ b/lib/core/herocmds/docsorter.v @@ -1,9 +1,9 @@ module herocmds -import freeflowuniverse.herolib.conversiontools.docsorter +import incubaid.herolib.conversiontools.docsorter import cli { Command, Flag } import os -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console // const wikipath = os.dir(@FILE) + '/wiki' diff --git a/lib/core/herocmds/docusaurus.v b/lib/core/herocmds/docusaurus.v index f14ed8c9..4ae770c1 100644 --- a/lib/core/herocmds/docusaurus.v +++ b/lib/core/herocmds/docusaurus.v @@ -1,9 +1,9 @@ module herocmds -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.web.docusaurus -import freeflowuniverse.herolib.core.playcmds -import freeflowuniverse.herolib.develop.gittools +import incubaid.herolib.ui.console +import incubaid.herolib.web.docusaurus +import incubaid.herolib.core.playcmds +import incubaid.herolib.develop.gittools import os import cli { Command, Flag } diff --git a/lib/core/herocmds/generator.v b/lib/core/herocmds/generator.v index c75e9982..a5db411a 100644 --- a/lib/core/herocmds/generator.v +++ b/lib/core/herocmds/generator.v @@ -1,6 +1,6 @@ module herocmds -import freeflowuniverse.herolib.core.generator.generic +import incubaid.herolib.core.generator.generic import os import cli { Command, Flag } diff --git a/lib/core/herocmds/git.v b/lib/core/herocmds/git.v index 6027f36a..dc8bb71b 100644 --- a/lib/core/herocmds/git.v +++ b/lib/core/herocmds/git.v @@ -1,7 +1,7 @@ module herocmds -import freeflowuniverse.herolib.develop.gittools -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.develop.gittools +import incubaid.herolib.ui.console import cli { Command, Flag } import os @@ -19,7 +19,7 @@ pub fn cmd_git(mut cmdroot Command) { sort_flags: true name: 'clone' execute: cmd_git_execute - description: 'will clone the repo based on a given url, e.g. https://github.com/freeflowuniverse/webcomponents/tree/main' + description: 'will clone the repo based on a given url, e.g. https://github.com/incubaid/webcomponents/tree/main' } mut pull_command := Command{ diff --git a/lib/core/herocmds/imagedownsize.v b/lib/core/herocmds/imagedownsize.v index f649fc5c..df45daca 100644 --- a/lib/core/herocmds/imagedownsize.v +++ b/lib/core/herocmds/imagedownsize.v @@ -1,9 +1,9 @@ module herocmds -import freeflowuniverse.herolib.conversiontools.imagemagick +import incubaid.herolib.conversiontools.imagemagick import cli { Command, Flag } import os -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console // const wikipath = os.dir(@FILE) + '/wiki' diff --git a/lib/core/herocmds/init.v b/lib/core/herocmds/init.v index 066fa25e..0d450b46 100644 --- a/lib/core/herocmds/init.v +++ b/lib/core/herocmds/init.v @@ -1,9 +1,9 @@ module herocmds -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.installers.base -import freeflowuniverse.herolib.installers.lang.herolib -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.osal.core as osal +import incubaid.herolib.installers.base +import incubaid.herolib.installers.lang.herolib +import incubaid.herolib.ui.console import cli { Command, Flag } pub fn cmd_init(mut cmdroot Command) { diff --git a/lib/core/herocmds/installers.v b/lib/core/herocmds/installers.v index b7fa417e..9a4a1100 100644 --- a/lib/core/herocmds/installers.v +++ b/lib/core/herocmds/installers.v @@ -1,8 +1,8 @@ module herocmds -import freeflowuniverse.herolib.installers +import incubaid.herolib.installers import cli { Command, Flag } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console pub fn cmd_installers(mut cmdroot Command) { mut cmd_run := Command{ diff --git a/lib/core/herocmds/luadns.v b/lib/core/herocmds/luadns.v index 161d7f0b..08713189 100644 --- a/lib/core/herocmds/luadns.v +++ b/lib/core/herocmds/luadns.v @@ -1,8 +1,8 @@ module herocmds import cli { Command, Flag } -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.develop.luadns +import incubaid.herolib.ui.console +import incubaid.herolib.develop.luadns // Main function to set up CLI commands pub fn cmd_luadns(mut cmdroot Command) { diff --git a/lib/core/herocmds/playbook_lib.v b/lib/core/herocmds/playbook_lib.v index 1ad2a1d9..82b44d6c 100644 --- a/lib/core/herocmds/playbook_lib.v +++ b/lib/core/herocmds/playbook_lib.v @@ -1,12 +1,12 @@ module herocmds -import freeflowuniverse.herolib.develop.gittools -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.playcmds -import freeflowuniverse.herolib.core.playbook -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.develop.vscode -import freeflowuniverse.herolib.develop.sourcetree +import incubaid.herolib.develop.gittools +import incubaid.herolib.core.base +import incubaid.herolib.core.playcmds +import incubaid.herolib.core.playbook +import incubaid.herolib.ui.console +import incubaid.herolib.develop.vscode +import incubaid.herolib.develop.sourcetree import cli { Command, Flag } import os diff --git a/lib/core/herocmds/sshagent.v b/lib/core/herocmds/sshagent.v index 45e826e9..2f1848b5 100644 --- a/lib/core/herocmds/sshagent.v +++ b/lib/core/herocmds/sshagent.v @@ -1,9 +1,9 @@ module herocmds import os -import freeflowuniverse.herolib.osal.sshagent -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.ui +import incubaid.herolib.osal.sshagent +import incubaid.herolib.ui.console +import incubaid.herolib.ui import cli { Command, Flag } pub fn cmd_sshagent(mut cmdroot Command) { diff --git a/lib/core/herocmds/tofix.md b/lib/core/herocmds/tofix.md index 008ec5a6..71181b08 100644 --- a/lib/core/herocmds/tofix.md +++ b/lib/core/herocmds/tofix.md @@ -11,7 +11,7 @@ Below you’ll find a **concise, actionable “TODO list”** grouped by file, t | Problem | What to do | |---|---| | **Name clash** – the file defines a **`fn play(mut plbook PlayBook) !`** in the `playcmds` module. This collides with other possible `play` functions (e.g. `play_core`, `play_git`), and the function is never used by the factory. | 1. **Rename** the function to `pub fn play_docusaurus(mut plbook PlayBook) !`.
2. Update the `factory.v` to call the renamed function (or simply remove this file and call `docusaurus.play` directly).
3. Remove the import of `PlayBook` from the file header if it is no longer needed. | -| **Unused import** – `import freeflowuniverse.herolib.core.playbook { PlayBook }` is only needed for the renamed function. If we decide to keep the wrapper, keep it; otherwise, delete the whole file. | Delete or comment out the file if you prefer to call `docusaurus.play` directly from `factory.v`. | +| **Unused import** – `import incubaid.herolib.core.playbook { PlayBook }` is only needed for the renamed function. If we decide to keep the wrapper, keep it; otherwise, delete the whole file. | Delete or comment out the file if you prefer to call `docusaurus.play` directly from `factory.v`. | | **Missing documentation** – The file has no comment describing why the wrapper exists. | Add a short comment: `// Wrapper used by legacy scripts – forwards to the docusaurus module.` | ### Concrete Patch (rename function, update factory) @@ -20,8 +20,8 @@ Below you’ll find a **concise, actionable “TODO list”** grouped by file, t // lib/core/playcmds/play_docusaurus.v module playcmds -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.web.docusaurus +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.web.docusaurus // ------------------------------------------------------------------- // Legacy wrapper: older scripts expected a “play” function in the @@ -49,12 +49,12 @@ play_docusaurus.play(mut plbook)! // <-- new line, optional | Problem | What to do | |---|---| | **Wrong API name** – the code uses **`gittools.new(gittools.GitStructureArgGet{})`** – there is no `GitStructureArgGet` struct in the git‑tools package. The correct type is **`gittools.GitStructureArgs`** (or the default `gittools.GitStructure` argument). | Replace `GitStructureArgGet` with the correct type (`gittools.GitStructureArgs`). | -| **Missing import alias** – the file uses `gittools.new` and `gittools.new` but the import is just `import freeflowuniverse.herolib.develop.gittools`. That is fine, but for clarity rename the import to **`gittools`** (it already is) and use the same alias everywhere. | +| **Missing import alias** – the file uses `gittools.new` and `gittools.new` but the import is just `import incubaid.herolib.develop.gittools`. That is fine, but for clarity rename the import to **`gittools`** (it already is) and use the same alias everywhere. | | **Potential nil `gs`** – after a `git.clone` we do `gs = gittools.new(coderoot: coderoot)!`. This shadows the previous `gs` and loses the original configuration (e.g. `light`, `log`). The intent is to **re‑initialise** the `GitStructure` **only** when a `coderoot` is explicitly given. Keep the current flow but **document** the intention. | | **Unused variable `action_`** – the variable `action_` is used only for iteration. No problem. | | **Missing `gittools.GitCloneArgs`** – check that the struct is actually named `GitCloneArgs` in the git‑tools package. If not, change to the proper name. | Verify and, if needed, replace with the correct struct name (`gittools.GitCloneArgs`). | | **Missing error handling for unknown actions** – the code already prints an error and continues when `error_ignore` is true. That part is OK. | -| **Redundant import** – the file imports `freeflowuniverse.herolib.ui.console` but only uses `console.print_stderr`. Keep it, but add a comment that it is for verbose error reporting. | +| **Redundant import** – the file imports `incubaid.herolib.ui.console` but only uses `console.print_stderr`. Keep it, but add a comment that it is for verbose error reporting. | | **Formatting** – add a header comment explaining what this file does (process git actions). | Add a comment block at the top of the file. | ### Concrete Patch (partial) @@ -63,9 +63,9 @@ play_docusaurus.play(mut plbook)! // <-- new line, optional // lib/core/playcmds/play_git.v module playcmds -import freeflowuniverse.herolib.develop.gittools -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.develop.gittools +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console // --------------------------------------------------------------- // Git actions interpreter for HeroScript. This file @@ -125,10 +125,10 @@ fn play_git(mut plbook PlayBook) ! { // lib/core/playcmds/play_core.v module playcmds -import freeflowuniverse.herolib.develop.gittools -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.develop.gittools +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools // ------------------------------------------------------------------- // Core play‑command processing (context, session, env‑subst, etc) @@ -191,11 +191,11 @@ fn play_core(mut plbook PlayBook) ! { ```v module playcmds -import freeflowuniverse.herolib.core.playbook { PlayBook, PlayArgs } -import freeflowuniverse.herolib.core.playbook -import freeflowuniverse.herolib.core.playcmds -import freeflowuniverse.herolib.core.playcmds.{play_core, play_git, play_docusaurus} -import freeflowuniverse.herolib.web.docusaurus as docusaurus_mod // optional alias +import incubaid.herolib.core.playbook { PlayBook, PlayArgs } +import incubaid.herolib.core.playbook +import incubaid.herolib.core.playcmds +import incubaid.herolib.core.playcmds.{play_core, play_git, play_docusaurus} +import incubaid.herolib.web.docusaurus as docusaurus_mod // optional alias // ------------------------------------------------------------------- // run – entry point for all HeroScript play‑commands @@ -251,7 +251,7 @@ The `_archive` folder contains **dead, commented‑out, or placeholder code** (e | Problem | What to do | |---|---| -| **Unused import** – `import freeflowuniverse.herolib.osal.sshagent` is used, fine. | +| **Unused import** – `import incubaid.herolib.osal.sshagent` is used, fine. | | **No `pub` on `play_ssh`** – the function is private but is referenced from `factory.v`. It is already called as `play_ssh(mut plbook)`. The function is **public** (no `pub` needed because it's called inside the same module). No change needed. | | **Comment about missing actions** – Keep a short comment stating “Currently only `key_add` is supported”. | | **Add error handling** – The `else` branch returns an error. This is fine. No changes needed. | @@ -269,7 +269,7 @@ The `_archive` folder contains **dead, commented‑out, or placeholder code** (e --- -## 8️⃣ `lib/core/playcmds/play_zola.v` – **All code is commented out** +## 8️⃣ `lib/core/playcmds/play_zola.v` – **All code is commented out** No current code. Keep the file as a placeholder for future implementation. No action needed unless you want to **delete** it to keep the repo tidy. @@ -288,7 +288,7 @@ No current code. Keep the file as a placeholder for future implementation. No ac # Using the playcmds package ```v -import freeflowuniverse.herolib.core.playcmds +import incubaid.herolib.core.playcmds mut args := playcmds.PlayArgs{ heroscript: my_hero_script, @@ -297,6 +297,7 @@ mut args := playcmds.PlayArgs{ } playcmds.run(args)! ``` + ``` --- @@ -323,4 +324,4 @@ playcmds.run(args)! 3. **Run** the test suite (`./test_runner.vsh` or the GitHub actions) to ensure no regressions. 4. **Commit** the changes with a clear commit message, e.g. `"fix: rename play_docusaurus, fix gittools API, cleanup playcmds module"`. -After these changes the **`lib/core/playcmds`** module will compile cleanly, the public API will be consistent, and the dead code will no longer pollute the package namespace. Happy coding! 🚀 \ No newline at end of file +After these changes the **`lib/core/playcmds`** module will compile cleanly, the public API will be consistent, and the dead code will no longer pollute the package namespace. Happy coding! 🚀 diff --git a/lib/core/herocmds/web.v b/lib/core/herocmds/web.v index 805c68f9..291b06de 100644 --- a/lib/core/herocmds/web.v +++ b/lib/core/herocmds/web.v @@ -1,7 +1,7 @@ module herocmds -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.web.ui +import incubaid.herolib.ui.console +import incubaid.herolib.web.ui import os import cli { Command, Flag } import time diff --git a/lib/core/httpconnection/connection.v b/lib/core/httpconnection/connection.v index cbd48bb8..5a2948ee 100644 --- a/lib/core/httpconnection/connection.v +++ b/lib/core/httpconnection/connection.v @@ -1,7 +1,7 @@ module httpconnection import net.http { Header } -import freeflowuniverse.herolib.core.redisclient { Redis } +import incubaid.herolib.core.redisclient { Redis } @[heap] pub struct HTTPConnection { diff --git a/lib/core/httpconnection/connection_methods.v b/lib/core/httpconnection/connection_methods.v index c6d6f182..735fef47 100644 --- a/lib/core/httpconnection/connection_methods.v +++ b/lib/core/httpconnection/connection_methods.v @@ -17,8 +17,8 @@ module httpconnection import x.json2 import net.http -import freeflowuniverse.herolib.data.ourjson -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.data.ourjson +import incubaid.herolib.ui.console // Build url from Request and httpconnection fn (mut h HTTPConnection) url(req Request) string { diff --git a/lib/core/httpconnection/factory.v b/lib/core/httpconnection/factory.v index fdf9748a..fe19e136 100644 --- a/lib/core/httpconnection/factory.v +++ b/lib/core/httpconnection/factory.v @@ -1,7 +1,7 @@ module httpconnection import net.http -import freeflowuniverse.herolib.core.redisclient { RedisURL } +import incubaid.herolib.core.redisclient { RedisURL } @[params] pub struct HTTPConnectionArgs { diff --git a/lib/core/httpconnection/readme.md b/lib/core/httpconnection/readme.md index 025641d6..56c8b5bf 100644 --- a/lib/core/httpconnection/readme.md +++ b/lib/core/httpconnection/readme.md @@ -13,7 +13,7 @@ The HTTPConnection module provides a robust HTTP client implementation with supp ## Basic Usage ```v -import freeflowuniverse.herolib.core.httpconnection +import incubaid.herolib.core.httpconnection // Create a new HTTP connection mut conn := HTTPConnection{ @@ -28,18 +28,18 @@ mut conn := HTTPConnection{ // e.g. HetznerManager is the object on which we want to have an http client pub fn (mut h HetznerManager) connection() !&httpconnection.HTTPConnection { - mut c := h.conn or { - mut c2 := httpconnection.new( - name: 'hetzner_${h.name}' - url: h.baseurl - cache: true - retry: 3 - )! - c2.basic_auth(h.user, h.password) - c2 - } + mut c := h.conn or { + mut c2 := httpconnection.new( + name: 'hetzner_${h.name}' + url: h.baseurl + cache: true + retry: 3 + )! + c2.basic_auth(h.user, h.password) + c2 + } - return c + return c } ``` diff --git a/lib/core/logger/factory.v b/lib/core/logger/factory.v index bc3e35c1..00917d4a 100644 --- a/lib/core/logger/factory.v +++ b/lib/core/logger/factory.v @@ -1,6 +1,6 @@ module logger -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib // Logger Factory pub struct LoggerFactoryArgs { diff --git a/lib/core/logger/log.v b/lib/core/logger/log.v index 776e117c..003a2e36 100644 --- a/lib/core/logger/log.v +++ b/lib/core/logger/log.v @@ -1,9 +1,9 @@ module logger import os -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.data.ourtime +import incubaid.herolib.ui.console @[params] pub struct LogItemArgs { diff --git a/lib/core/logger/log_test.v b/lib/core/logger/log_test.v index 28fa7252..40733d4d 100644 --- a/lib/core/logger/log_test.v +++ b/lib/core/logger/log_test.v @@ -1,8 +1,8 @@ module logger import os -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.data.ourtime +import incubaid.herolib.core.pathlib fn testsuite_begin() { if os.exists('/tmp/testlogs') { diff --git a/lib/core/logger/model.v b/lib/core/logger/model.v index 7a5ff0c7..5aef0717 100644 --- a/lib/core/logger/model.v +++ b/lib/core/logger/model.v @@ -1,7 +1,7 @@ module logger -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.data.ourtime +import incubaid.herolib.core.pathlib @[heap] pub struct Logger { diff --git a/lib/core/logger/readme.md b/lib/core/logger/readme.md index cf5ce661..fdd9e97d 100644 --- a/lib/core/logger/readme.md +++ b/lib/core/logger/readme.md @@ -15,8 +15,8 @@ Logs are stored in hourly files with a consistent format that makes them both hu ## Usage ```v -import freeflowuniverse.herolib.core.logger -import freeflowuniverse.herolib.data.ourtime +import incubaid.herolib.core.logger +import incubaid.herolib.data.ourtime // Create a new logger mut l := logger.new(path: '/var/logs')! diff --git a/lib/core/logger/search.v b/lib/core/logger/search.v index e56957c1..2ef85918 100644 --- a/lib/core/logger/search.v +++ b/lib/core/logger/search.v @@ -1,8 +1,8 @@ module logger import os -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.data.ourtime +import incubaid.herolib.core.texttools +import incubaid.herolib.data.ourtime @[params] pub struct SearchArgs { diff --git a/lib/core/pathlib/path.v b/lib/core/pathlib/path.v index 7a6d0f56..aa52bd83 100644 --- a/lib/core/pathlib/path.v +++ b/lib/core/pathlib/path.v @@ -1,6 +1,6 @@ module pathlib -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.texttools import os @[heap] diff --git a/lib/core/pathlib/path_backup.v b/lib/core/pathlib/path_backup.v index a67f1e7e..cd7d4a3e 100644 --- a/lib/core/pathlib/path_backup.v +++ b/lib/core/pathlib/path_backup.v @@ -1,7 +1,7 @@ module pathlib import os -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console // import time @[params] diff --git a/lib/core/pathlib/path_link.v b/lib/core/pathlib/path_link.v index 430cbbd8..c442e555 100644 --- a/lib/core/pathlib/path_link.v +++ b/lib/core/pathlib/path_link.v @@ -1,7 +1,7 @@ module pathlib import os -// import freeflowuniverse.herolib.ui.console +// import incubaid.herolib.ui.console // path needs to be existing // linkpath is where the link will be (the symlink who points to path) diff --git a/lib/core/pathlib/path_link_test.v b/lib/core/pathlib/path_link_test.v index 2467fb4f..70228e0e 100644 --- a/lib/core/pathlib/path_link_test.v +++ b/lib/core/pathlib/path_link_test.v @@ -1,5 +1,5 @@ -import freeflowuniverse.herolib.core.pathlib { Path } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.pathlib { Path } +import incubaid.herolib.ui.console import os const testpath = os.dir(@FILE) + '/examples/test_path' diff --git a/lib/core/pathlib/path_list.v b/lib/core/pathlib/path_list.v index 6be63422..f27c2d64 100644 --- a/lib/core/pathlib/path_list.v +++ b/lib/core/pathlib/path_list.v @@ -2,8 +2,8 @@ module pathlib import os import regex -// import freeflowuniverse.herolib.core.smartid -import freeflowuniverse.herolib.ui.console +// import incubaid.herolib.core.smartid +import incubaid.herolib.ui.console @[params] pub struct ListArgs { diff --git a/lib/core/pathlib/path_list_test.v b/lib/core/pathlib/path_list_test.v index 6b368922..e39b455d 100644 --- a/lib/core/pathlib/path_list_test.v +++ b/lib/core/pathlib/path_list_test.v @@ -1,5 +1,5 @@ -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.pathlib +import incubaid.herolib.ui.console import os const testpath = os.dir(@FILE) + '/testdata' diff --git a/lib/core/pathlib/path_rsync.v b/lib/core/pathlib/path_rsync.v index d88707a7..2a0b8566 100644 --- a/lib/core/pathlib/path_rsync.v +++ b/lib/core/pathlib/path_rsync.v @@ -1,7 +1,7 @@ module pathlib import os -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console @[params] pub struct RsyncArgs { diff --git a/lib/core/pathlib/path_scanner.v b/lib/core/pathlib/path_scanner.v index 04cf64bd..09028d8e 100644 --- a/lib/core/pathlib/path_scanner.v +++ b/lib/core/pathlib/path_scanner.v @@ -1,6 +1,6 @@ module pathlib -import freeflowuniverse.herolib.data.paramsparser +import incubaid.herolib.data.paramsparser type Filter0 = fn (mut Path, mut paramsparser.Params) !bool diff --git a/lib/core/pathlib/path_sid.v b/lib/core/pathlib/path_sid.v index 49660db0..80999344 100644 --- a/lib/core/pathlib/path_sid.v +++ b/lib/core/pathlib/path_sid.v @@ -1,6 +1,6 @@ module pathlib -// import freeflowuniverse.herolib.core.smartid +// import incubaid.herolib.core.smartid // // sids_acknowledge . // // means our redis server knows about the sid's found, so we know which ones to generate new diff --git a/lib/core/pathlib/path_subgetters.v b/lib/core/pathlib/path_subgetters.v index 45794a25..c545898d 100644 --- a/lib/core/pathlib/path_subgetters.v +++ b/lib/core/pathlib/path_subgetters.v @@ -1,6 +1,6 @@ module pathlib -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.texttools import os @[params] diff --git a/lib/core/pathlib/path_tools.v b/lib/core/pathlib/path_tools.v index 2bf90a65..b3bf9cd7 100644 --- a/lib/core/pathlib/path_tools.v +++ b/lib/core/pathlib/path_tools.v @@ -1,11 +1,11 @@ module pathlib import os -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.texttools import time import crypto.md5 import rand -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console // check path exists pub fn (mut path Path) exists() bool { diff --git a/lib/core/pathlib/path_tools_test.v b/lib/core/pathlib/path_tools_test.v index 9fbdcf2f..9675adc9 100644 --- a/lib/core/pathlib/path_tools_test.v +++ b/lib/core/pathlib/path_tools_test.v @@ -1,6 +1,6 @@ -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib import os -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console const testpath = os.dir(@FILE) + '/examples/test_path' diff --git a/lib/core/pathlib/readme.md b/lib/core/pathlib/readme.md index 1cfff89f..def26f78 100644 --- a/lib/core/pathlib/readme.md +++ b/lib/core/pathlib/readme.md @@ -5,7 +5,7 @@ The pathlib module provides a robust way to handle file system operations. Here' ## 1. Basic Path Creation ```v -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib // Get a basic path object mut path := pathlib.get('/some/path') @@ -110,6 +110,7 @@ mut wd := pathlib.get_wd() ## Features The module handles common edge cases: + - Automatically expands ~ to home directory - Creates parent directories as needed - Provides proper error handling with V's result type @@ -119,6 +120,7 @@ The module handles common edge cases: ## Path Object Structure Each Path object contains: + - `path`: The actual path string - `cat`: Category (file/dir/link) - `exist`: Existence status diff --git a/lib/core/pathlib/template.v b/lib/core/pathlib/template.v index 84dad150..5a596fee 100644 --- a/lib/core/pathlib/template.v +++ b/lib/core/pathlib/template.v @@ -1,8 +1,8 @@ module pathlib -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.texttools import os -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console // template is the text coming from template engine. pub fn template_write(template_ string, dest string, overwrite bool) ! { diff --git a/lib/core/platform.v b/lib/core/platform.v index 48d6255c..e09d26ec 100644 --- a/lib/core/platform.v +++ b/lib/core/platform.v @@ -2,7 +2,7 @@ module core import os -// import freeflowuniverse.herolib.ui.console +// import incubaid.herolib.ui.console // Returns the enum value that matches the provided string for PlatformType pub enum PlatformType { diff --git a/lib/core/playbook/action.v b/lib/core/playbook/action.v index 0fd7f1a3..dda2a634 100644 --- a/lib/core/playbook/action.v +++ b/lib/core/playbook/action.v @@ -1,9 +1,9 @@ module playbook import crypto.blake2b -import freeflowuniverse.herolib.data.paramsparser -import freeflowuniverse.herolib.core.texttools -// import freeflowuniverse.herolib.core.smartid +import incubaid.herolib.data.paramsparser +import incubaid.herolib.core.texttools +// import incubaid.herolib.core.smartid pub struct Action { pub mut: diff --git a/lib/core/playbook/factory.v b/lib/core/playbook/factory.v index a8560c11..140c6fbc 100644 --- a/lib/core/playbook/factory.v +++ b/lib/core/playbook/factory.v @@ -1,6 +1,6 @@ module playbook -import freeflowuniverse.herolib.core.base +import incubaid.herolib.core.base @[params] pub struct PlayBookNewArgs { diff --git a/lib/core/playbook/find.v b/lib/core/playbook/find.v index 413ab256..05c0944c 100644 --- a/lib/core/playbook/find.v +++ b/lib/core/playbook/find.v @@ -1,7 +1,7 @@ module playbook -import freeflowuniverse.herolib.data.paramsparser -// import freeflowuniverse.herolib.ui.console +import incubaid.herolib.data.paramsparser +// import incubaid.herolib.ui.console @[params] pub struct FilterSortArgs { diff --git a/lib/core/playbook/playbook.v b/lib/core/playbook/playbook.v index 31762c17..c576b0df 100644 --- a/lib/core/playbook/playbook.v +++ b/lib/core/playbook/playbook.v @@ -1,8 +1,8 @@ module playbook -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.data.paramsparser +import incubaid.herolib.core.base +import incubaid.herolib.core.texttools +import incubaid.herolib.data.paramsparser import crypto.blake2b @[heap] diff --git a/lib/core/playbook/playbook_add.v b/lib/core/playbook/playbook_add.v index 67766c16..5f42e0ad 100644 --- a/lib/core/playbook/playbook_add.v +++ b/lib/core/playbook/playbook_add.v @@ -1,9 +1,9 @@ module playbook -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.data.paramsparser -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.develop.gittools // Added import for gittools +import incubaid.herolib.core.texttools +import incubaid.herolib.data.paramsparser +import incubaid.herolib.core.pathlib +import incubaid.herolib.develop.gittools // Added import for gittools enum State { start diff --git a/lib/core/playbook/playbook_include.v b/lib/core/playbook/playbook_include.v index b23c78e2..cc0b00e0 100644 --- a/lib/core/playbook/playbook_include.v +++ b/lib/core/playbook/playbook_include.v @@ -1,6 +1,6 @@ module playbook -// import freeflowuniverse.herolib.develop.gittools // Added import for gittools +// import incubaid.herolib.develop.gittools // Added import for gittools // REMARK: include is done in play_core diff --git a/lib/core/playbook/playbook_test.v b/lib/core/playbook/playbook_test.v index b1f60f64..15e34a1c 100644 --- a/lib/core/playbook/playbook_test.v +++ b/lib/core/playbook/playbook_test.v @@ -2,7 +2,7 @@ module playbook import os import crypto.sha256 -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console const testpath = os.dir(@FILE) + '/testdata' diff --git a/lib/core/playbook/readme.md b/lib/core/playbook/readme.md index 122056ce..8b3aa27f 100644 --- a/lib/core/playbook/readme.md +++ b/lib/core/playbook/readme.md @@ -7,8 +7,8 @@ Our heroscript is a simple way to execute commands in a playbook. It allows you the following will load heroscript and execute ```v -import freeflowuniverse.herolib.core.playbook -import freeflowuniverse.herolib.core.playcmds +import incubaid.herolib.core.playbook +import incubaid.herolib.core.playcmds // path string // text string @@ -24,6 +24,7 @@ playcmds.run(mut plbook)! ``` + ## execute a heroscript and make executable ```bash @@ -36,14 +37,12 @@ playcmds.run(mut plbook)! you can now just execute this script and hero will interprete the content - - ## filtersort ```v -import freeflowuniverse.herolib.core.playbook -import freeflowuniverse.herolib.core.playcmds +import incubaid.herolib.core.playbook +import incubaid.herolib.core.playcmds mut plbook := playbook.new(path: "....") or { panic(err) } @@ -52,7 +51,7 @@ mut plbook := playbook.new(path: "....") or { panic(err) } // string for filter is $actor:$action, ... name and globs are possible (*,?) // // struct FilterSortArgs -// priorities map[int]string //filter and give priority +// priorities map[int]string //filter and give priority //``` // the action_names or actor_names can be a glob in match_glob . // see https://modules.vlang.io/index.html#string.match_glob . @@ -75,4 +74,3 @@ for a in actions{ } ``` - diff --git a/lib/core/playcmds/factory.v b/lib/core/playcmds/factory.v index e312db56..b8945f7f 100644 --- a/lib/core/playcmds/factory.v +++ b/lib/core/playcmds/factory.v @@ -1,18 +1,18 @@ 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 -import freeflowuniverse.herolib.installers.base -import freeflowuniverse.herolib.installers.lang.vlang -import freeflowuniverse.herolib.installers.lang.herolib +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.data.doctree +import incubaid.herolib.biz.bizmodel +import incubaid.herolib.threefold.incatokens +import incubaid.herolib.web.site +import incubaid.herolib.virt.hetznermanager +import incubaid.herolib.web.docusaurus +import incubaid.herolib.clients.openai +import incubaid.herolib.clients.giteaclient +import incubaid.herolib.osal.tmux +import incubaid.herolib.installers.base +import incubaid.herolib.installers.lang.vlang +import incubaid.herolib.installers.lang.herolib // ------------------------------------------------------------------- // run – entry point for all HeroScript play‑commands diff --git a/lib/core/playcmds/play_core.v b/lib/core/playcmds/play_core.v index ea38bcb6..4f1f6578 100644 --- a/lib/core/playcmds/play_core.v +++ b/lib/core/playcmds/play_core.v @@ -1,9 +1,9 @@ module playcmds -import freeflowuniverse.herolib.develop.gittools -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.develop.gittools +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools import os // ------------------------------------------------------------------- diff --git a/lib/core/playcmds/play_git.v b/lib/core/playcmds/play_git.v index c2d20431..76b3e05b 100644 --- a/lib/core/playcmds/play_git.v +++ b/lib/core/playcmds/play_git.v @@ -1,8 +1,8 @@ module playcmds -import freeflowuniverse.herolib.develop.gittools -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console // For verbose error reporting +import incubaid.herolib.develop.gittools +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console // For verbose error reporting // --------------------------------------------------------------- // Git actions interpreter for HeroScript. This file diff --git a/lib/core/playcmds/play_luadns.v b/lib/core/playcmds/play_luadns.v index b46b3c26..d0cb9710 100644 --- a/lib/core/playcmds/play_luadns.v +++ b/lib/core/playcmds/play_luadns.v @@ -1,7 +1,7 @@ module playcmds -import freeflowuniverse.herolib.develop.luadns -import freeflowuniverse.herolib.core.playbook { PlayBook } +import incubaid.herolib.develop.luadns +import incubaid.herolib.core.playbook { PlayBook } // import os fn play_luadns(mut plbook PlayBook) ! { diff --git a/lib/core/playcmds/play_osal_core.v b/lib/core/playcmds/play_osal_core.v index 026978f1..3c0e647d 100644 --- a/lib/core/playcmds/play_osal_core.v +++ b/lib/core/playcmds/play_osal_core.v @@ -1,8 +1,8 @@ module playcmds -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console pub fn play_osal_core(mut plbook PlayBook) ! { if !plbook.exists(filter: 'osal.') { diff --git a/lib/core/playcmds/play_ssh.v b/lib/core/playcmds/play_ssh.v index 50372832..cae34a4a 100644 --- a/lib/core/playcmds/play_ssh.v +++ b/lib/core/playcmds/play_ssh.v @@ -1,9 +1,9 @@ module playcmds -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.builder -import freeflowuniverse.herolib.osal.sshagent +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console +import incubaid.herolib.builder +import incubaid.herolib.osal.sshagent pub fn play_ssh(mut plbook PlayBook) ! { if !plbook.exists(filter: 'sshagent.') { diff --git a/lib/core/playcmds/readme.md b/lib/core/playcmds/readme.md index 4dc12068..ff11e40b 100644 --- a/lib/core/playcmds/readme.md +++ b/lib/core/playcmds/readme.md @@ -1,13 +1,13 @@ # how to use the playcmds ```v -import freeflowuniverse.herolib.core.playcmds +import incubaid.herolib.core.playcmds playcmds.run( - heroscript:'' - heroscript_path:'' + heroscript:'' + heroscript_path:'' reset: false - //plbook ?PlayBook + //plbook ?PlayBook )! ``` diff --git a/lib/core/playmacros/playmacros.v b/lib/core/playmacros/playmacros.v index f00784f8..48cbf076 100644 --- a/lib/core/playmacros/playmacros.v +++ b/lib/core/playmacros/playmacros.v @@ -1,11 +1,11 @@ module playmacros -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.playbook { Action, PlayBook } -import freeflowuniverse.herolib.threefold.grid4.gridsimulator -import freeflowuniverse.herolib.threefold.grid4.farmingsimulator -import freeflowuniverse.herolib.biz.bizmodel -import freeflowuniverse.herolib.biz.spreadsheet +import incubaid.herolib.ui.console +import incubaid.herolib.core.playbook { Action, PlayBook } +import incubaid.herolib.threefold.grid4.gridsimulator +import incubaid.herolib.threefold.grid4.farmingsimulator +import incubaid.herolib.biz.bizmodel +import incubaid.herolib.biz.spreadsheet pub fn play_actions(mut plbook PlayBook) ! { console.print_green('play actions (simulators)') diff --git a/lib/core/readme.md b/lib/core/readme.md index f1438e26..ed15556b 100644 --- a/lib/core/readme.md +++ b/lib/core/readme.md @@ -5,17 +5,20 @@ The Core module provides fundamental system-level functionality for the Hero fra ## Main Features ### Platform Management + - Platform detection (OSX, Ubuntu, Alpine, Arch) - CPU architecture detection (Intel, ARM) - System information retrieval (hostname, init system) - Cross-platform compatibility utilities ### Memory Database + - Thread-safe in-memory key-value store - Global state management - Caching for system information ### Sudo Operations + - Permission management and verification - Sudo requirement detection - Path access rights checking @@ -37,12 +40,14 @@ The Core module provides fundamental system-level functionality for the Hero fra ## Platform Support The module supports multiple platforms: + - macOS (Intel and ARM) - Ubuntu - Alpine Linux - Arch Linux And CPU architectures: + - x86_64 (Intel) - ARM64/AArch64 @@ -53,8 +58,8 @@ The core module provides essential functionality used by other Hero framework co ### Interactivity Check & Influence on delete ``` -import freeflowuniverse.herolib.installers.lang.golang -import freeflowuniverse.herolib.core +import incubaid.herolib.installers.lang.golang +import incubaid.herolib.core core.interactive_set()! //make sure the sudo works so we can do things even if it requires those rights @@ -62,8 +67,8 @@ core.interactive_set()! //make sure the sudo works so we can do things even if i golang.install(reset:false)! ``` - ### Platform Detection + ```v // Check platform type if core.is_linux()! { @@ -77,6 +82,7 @@ if core.is_linux_arm()! { ``` ### Memory Database + ```v // Store values core.memdb_set('key', 'value') diff --git a/lib/core/redisclient/readme.md b/lib/core/redisclient/readme.md index 703f4414..56996967 100644 --- a/lib/core/redisclient/readme.md +++ b/lib/core/redisclient/readme.md @@ -4,7 +4,7 @@ ```v -import freeflowuniverse.herolib.core.redisclient +import incubaid.herolib.core.redisclient mut redis := redisclient.core_get()! redis.set('test', 'some data') or { panic('set' + err.str() + '\n' + c.str()) } @@ -15,5 +15,4 @@ if r != 'some data' { ``` -> redis commands can be found on https://redis.io/commands/ - +> redis commands can be found on diff --git a/lib/core/redisclient/rediscache.v b/lib/core/redisclient/rediscache.v index f2148f4d..ea81ed31 100644 --- a/lib/core/redisclient/rediscache.v +++ b/lib/core/redisclient/rediscache.v @@ -1,6 +1,6 @@ module redisclient -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console pub struct RedisCache { mut: diff --git a/lib/core/redisclient/redisclient_cmd.v b/lib/core/redisclient/redisclient_cmd.v index fff6e29b..00969134 100644 --- a/lib/core/redisclient/redisclient_cmd.v +++ b/lib/core/redisclient/redisclient_cmd.v @@ -1,6 +1,6 @@ module redisclient -import freeflowuniverse.herolib.data.resp +import incubaid.herolib.data.resp pub fn (mut r Redis) cmd_str(script string, args []string) !string { mut cmds := []string{} diff --git a/lib/core/redisclient/redisclient_commands.v b/lib/core/redisclient/redisclient_commands.v index f6b82dc6..07c230e9 100644 --- a/lib/core/redisclient/redisclient_commands.v +++ b/lib/core/redisclient/redisclient_commands.v @@ -1,6 +1,6 @@ module redisclient -import freeflowuniverse.herolib.data.resp +import incubaid.herolib.data.resp import time pub fn (mut r Redis) ping() !string { diff --git a/lib/core/redisclient/redisclient_encode.v b/lib/core/redisclient/redisclient_encode.v index db3c1015..9f453ca7 100644 --- a/lib/core/redisclient/redisclient_encode.v +++ b/lib/core/redisclient/redisclient_encode.v @@ -1,6 +1,6 @@ module redisclient -import freeflowuniverse.herolib.data.resp +import incubaid.herolib.data.resp fn (mut r Redis) get_response() !resp.RValue { line := r.read_line()! diff --git a/lib/core/redisclient/redisclient_internal.v b/lib/core/redisclient/redisclient_internal.v index 2433f14f..08c1b6b8 100644 --- a/lib/core/redisclient/redisclient_internal.v +++ b/lib/core/redisclient/redisclient_internal.v @@ -2,7 +2,7 @@ module redisclient import os import net -import freeflowuniverse.herolib.data.resp +import incubaid.herolib.data.resp import time import net.unix diff --git a/lib/core/redisclient/redisclient_sadd_test.v b/lib/core/redisclient/redisclient_sadd_test.v index dd21edf3..ef2955e2 100644 --- a/lib/core/redisclient/redisclient_sadd_test.v +++ b/lib/core/redisclient/redisclient_sadd_test.v @@ -1,4 +1,4 @@ -import freeflowuniverse.herolib.core.redisclient +import incubaid.herolib.core.redisclient fn setup() !&redisclient.Redis { mut redis := redisclient.core_get()! diff --git a/lib/core/redisclient/redisclient_send.v b/lib/core/redisclient/redisclient_send.v index 77748642..89d502a5 100644 --- a/lib/core/redisclient/redisclient_send.v +++ b/lib/core/redisclient/redisclient_send.v @@ -1,7 +1,7 @@ module redisclient -import freeflowuniverse.herolib.data.resp -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.data.resp +import incubaid.herolib.ui.console // send list of strings, expect OK back pub fn (mut r Redis) send_expect_ok(items []string) ! { diff --git a/lib/core/redisclient/redisclient_test.v b/lib/core/redisclient/redisclient_test.v index f445c936..90476f19 100644 --- a/lib/core/redisclient/redisclient_test.v +++ b/lib/core/redisclient/redisclient_test.v @@ -1,6 +1,6 @@ -import freeflowuniverse.herolib.core.redisclient +import incubaid.herolib.core.redisclient import time -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console // original code see https://github.com/patrickpissurno/vredis/blob/master/vredis_test.v // credits see there as well (-: diff --git a/lib/core/redisclient/rpc_test.v b/lib/core/redisclient/rpc_test.v index 59823af4..6b042ebb 100644 --- a/lib/core/redisclient/rpc_test.v +++ b/lib/core/redisclient/rpc_test.v @@ -1,5 +1,5 @@ -import freeflowuniverse.herolib.core.redisclient -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.redisclient +import incubaid.herolib.ui.console fn setup() !&redisclient.Redis { mut redis := redisclient.core_get()! diff --git a/lib/core/rootpath/README.md b/lib/core/rootpath/README.md index e1c41daa..95beff6e 100644 --- a/lib/core/rootpath/README.md +++ b/lib/core/rootpath/README.md @@ -8,7 +8,7 @@ The rootpath module provides functionality for managing the Hero environment dir - `herodir()` - Returns the root directory for the Hero environment (`~/hero`) - `bindir()` - Returns the binary directory (`~/hero/bin`) -- `vardir()` - Returns the variable directory (`~/hero/var`) +- `vardir()` - Returns the variable directory (`~/hero/var`) - `cfgdir()` - Returns the configuration directory (`~/hero/cfg`) - `ensure_hero_dirs()` - Creates all necessary Hero directories if they don't exist @@ -22,7 +22,7 @@ The rootpath module provides functionality for managing the Hero environment dir ## Usage Example ```vsh -import freeflowuniverse.herolib.core.rootpath +import incubaid.herolib.core.rootpath // Get and ensure Hero directories exist hero_root := rootpath.ensure_hero_dirs() @@ -45,4 +45,3 @@ The module manages the following directory structure: ├── var/ # Variable data └── cfg/ # Configuration files ``` - diff --git a/lib/core/texttools/regext/readme.md b/lib/core/texttools/regext/readme.md index 9fed2604..2ff6c9e3 100644 --- a/lib/core/texttools/regext/readme.md +++ b/lib/core/texttools/regext/readme.md @@ -8,10 +8,10 @@ Tool to flexibly replace elements in file(s) or text. -next example does it for +next example does it for ```golang -import freeflowuniverse.herolib.core.texttools.regext +import incubaid.herolib.core.texttools.regext text := ' this is test_1 SomeTest @@ -43,17 +43,15 @@ mut text_out2 := ri.replace(text: text, dedent: true) or { panic(err) } //pub struct ReplaceDirArgs { //pub mut: -// path string -// extensions []string -// dryrun bool +// path string +// extensions []string +// dryrun bool //} // if dryrun is true then will not replace but just show ri.replace_in_dir(path:"/tmp/mypath",extensions:["md"])! ``` - - ``` diff --git a/lib/core/texttools/regext/regexreplacer.v b/lib/core/texttools/regext/regexreplacer.v index ed298beb..d9788a28 100644 --- a/lib/core/texttools/regext/regexreplacer.v +++ b/lib/core/texttools/regext/regexreplacer.v @@ -1,8 +1,8 @@ module regext -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.texttools import regex -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console import os pub struct ReplaceInstructions { diff --git a/lib/core/texttools/regext/regexreplacer_test.v b/lib/core/texttools/regext/regexreplacer_test.v index ccbe60d2..5dcbe2fb 100644 --- a/lib/core/texttools/regext/regexreplacer_test.v +++ b/lib/core/texttools/regext/regexreplacer_test.v @@ -1,7 +1,7 @@ module regext import os -import freeflowuniverse.herolib.core.texttools { dedent } +import incubaid.herolib.core.texttools { dedent } fn test_stdtext() { // this is test without much fancyness, just rext replace, no regex, all case sensitive diff --git a/lib/core/vexecutor/execute_large.v b/lib/core/vexecutor/execute_large.v index bb305bd7..4bd2297b 100644 --- a/lib/core/vexecutor/execute_large.v +++ b/lib/core/vexecutor/execute_large.v @@ -2,7 +2,7 @@ module vexecutor import strings import os { Result, fileno } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console fn vpopen(path string) voidptr { // *C.FILE { diff --git a/lib/core/vexecutor/vexecutor.v b/lib/core/vexecutor/vexecutor.v index d0d14066..95e7c12f 100644 --- a/lib/core/vexecutor/vexecutor.v +++ b/lib/core/vexecutor/vexecutor.v @@ -1,8 +1,8 @@ module vexecutor -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib import os -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console // TODO make sure each function opens and closes the executor.vsh file, no file should be open across functions diff --git a/lib/crypt/crpgp/types.v b/lib/crypt/crpgp/types.v index 52bb2db2..cff1a6d5 100644 --- a/lib/crypt/crpgp/types.v +++ b/lib/crypt/crpgp/types.v @@ -1,6 +1,6 @@ module crpgp -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console pub fn new_secret_key_param_builder() !SecretKeyParamsBuilder { builder := C.params_builder_new() diff --git a/lib/crypt/herocrypt/herocrypt.v b/lib/crypt/herocrypt/herocrypt.v index 621c9eba..51f54b9e 100644 --- a/lib/crypt/herocrypt/herocrypt.v +++ b/lib/crypt/herocrypt/herocrypt.v @@ -1,6 +1,6 @@ module herocrypt -import freeflowuniverse.herolib.core.redisclient +import incubaid.herolib.core.redisclient // HeroCrypt provides a client for HeroDB's AGE cryptography features. pub struct HeroCrypt { diff --git a/lib/crypt/herocrypt/readme.md b/lib/crypt/herocrypt/readme.md index 57124e30..49c3f4f3 100644 --- a/lib/crypt/herocrypt/readme.md +++ b/lib/crypt/herocrypt/readme.md @@ -11,13 +11,12 @@ HeroDB is a high-performance, Redis-compatible database that offers built-in sup - **Encryption & Decryption**: Securely encrypt and decrypt data. - **Digital Signatures**: Sign and verify messages to ensure their integrity and authenticity. - **Flexible Key Management**: Choose between two modes for managing your cryptographic keys: - 1. **Key-Managed (Server-Side)**: Let HeroDB manage your keys. Keys are stored securely within the database and are referenced by a name. This is the recommended approach for simplicity and centralized key management. - 2. **Stateless (Client-Side)**: Manage your own keys on the client side. You pass the key material with every cryptographic operation. This mode is for advanced users who require full control over their keys. - + 1. **Key-Managed (Server-Side)**: Let HeroDB manage your keys. Keys are stored securely within the database and are referenced by a name. This is the recommended approach for simplicity and centralized key management. + 2. **Stateless (Client-Side)**: Manage your own keys on the client side. You pass the key material with every cryptographic operation. This mode is for advanced users who require full control over their keys. ## To start a db see -https://git.ourworld.tf/herocode/herodb + to do: @@ -33,7 +32,7 @@ In this mode, HeroDB generates and stores the keypairs for you. You only need to ### Encryption ```v -import freeflowuniverse.herolib.crypt.herocrypt +import incubaid.herolib.crypt.herocrypt mut client := herocrypt.new_default()! @@ -52,7 +51,7 @@ assert decrypted_message == message ### Signing ```v -import freeflowuniverse.herolib.crypt.herocrypt +import incubaid.herolib.crypt.herocrypt mut client := herocrypt.new_default()! @@ -75,7 +74,7 @@ In this mode, you are responsible for generating and managing your own keys. ### Encryption ```v -import freeflowuniverse.herolib.crypt.herocrypt +import incubaid.herolib.crypt.herocrypt mut client := herocrypt.new_default()! @@ -96,7 +95,7 @@ assert decrypted_message == message ### Signing ```v -import freeflowuniverse.herolib.crypt.herocrypt +import incubaid.herolib.crypt.herocrypt mut client := herocrypt.new_default()! @@ -113,4 +112,4 @@ signature := client.sign(sign_sec_b64, message)! is_valid := client.verify(verify_pub_b64, message, signature)! assert is_valid -``` \ No newline at end of file +``` diff --git a/lib/crypt/openssl/generate.v b/lib/crypt/openssl/generate.v index 356dab4e..3f57859b 100644 --- a/lib/crypt/openssl/generate.v +++ b/lib/crypt/openssl/generate.v @@ -1,6 +1,6 @@ module openssl -import freeflowuniverse.herolib.builder +import incubaid.herolib.builder import json @[params] diff --git a/lib/crypt/openssl/generate_ca.v b/lib/crypt/openssl/generate_ca.v index 768d863e..f877c508 100644 --- a/lib/crypt/openssl/generate_ca.v +++ b/lib/crypt/openssl/generate_ca.v @@ -1,6 +1,6 @@ module openssl -import freeflowuniverse.herolib.builder +import incubaid.herolib.builder import json @[params] diff --git a/lib/crypt/openssl/get.v b/lib/crypt/openssl/get.v index 06743dec..6bc24aa6 100644 --- a/lib/crypt/openssl/get.v +++ b/lib/crypt/openssl/get.v @@ -1,6 +1,6 @@ module openssl -import freeflowuniverse.herolib.core.pathlib { Path } +import incubaid.herolib.core.pathlib { Path } import json pub struct OpenSSLKey { diff --git a/lib/crypt/openssl/openssl.v b/lib/crypt/openssl/openssl.v index 6a595024..f70b8177 100644 --- a/lib/crypt/openssl/openssl.v +++ b/lib/crypt/openssl/openssl.v @@ -1,6 +1,6 @@ module openssl -import freeflowuniverse.herolib.core.pathlib { Path } +import incubaid.herolib.core.pathlib { Path } pub struct OpenSSL { certpath Path diff --git a/lib/crypt/pgp/pgp.v b/lib/crypt/pgp/pgp.v index b71b2e91..fd91fb38 100644 --- a/lib/crypt/pgp/pgp.v +++ b/lib/crypt/pgp/pgp.v @@ -1,6 +1,6 @@ module pgp -// import freeflowuniverse.herolib.builder +// import incubaid.herolib.builder import os pub enum PGPFactoryStatus { diff --git a/lib/crypt/pgp/pgp_cmds.v b/lib/crypt/pgp/pgp_cmds.v index 29683cb5..1d57fdf6 100644 --- a/lib/crypt/pgp/pgp_cmds.v +++ b/lib/crypt/pgp/pgp_cmds.v @@ -1,6 +1,6 @@ module pgp -// import freeflowuniverse.herolib.builder +// import incubaid.herolib.builder import os // list all instances diff --git a/lib/crypt/pgp/pgp_instance.v b/lib/crypt/pgp/pgp_instance.v index 76c58150..3a8abdbe 100644 --- a/lib/crypt/pgp/pgp_instance.v +++ b/lib/crypt/pgp/pgp_instance.v @@ -1,6 +1,6 @@ module pgp -// import freeflowuniverse.herolib.builder +// import incubaid.herolib.builder import os @[heap] diff --git a/lib/crypt/pgp/pgp_model.v b/lib/crypt/pgp/pgp_model.v index 9abce8bd..ab97596a 100644 --- a/lib/crypt/pgp/pgp_model.v +++ b/lib/crypt/pgp/pgp_model.v @@ -1,6 +1,6 @@ module pgp -// import freeflowuniverse.herolib.builder +// import incubaid.herolib.builder import os pub struct Pubkey { diff --git a/lib/crypt/secrets/encrypt_decrypt.v b/lib/crypt/secrets/encrypt_decrypt.v index 7fafbb2e..69eacf26 100644 --- a/lib/crypt/secrets/encrypt_decrypt.v +++ b/lib/crypt/secrets/encrypt_decrypt.v @@ -1,9 +1,9 @@ module secrets import rand -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.ui -import freeflowuniverse.herolib.crypt.aes_symmetric +import incubaid.herolib.ui.console +import incubaid.herolib.ui +import incubaid.herolib.crypt.aes_symmetric import crypto.md5 import regex import os diff --git a/lib/crypt/secrets/factory.v b/lib/crypt/secrets/factory.v index b5ddf303..4e915850 100644 --- a/lib/crypt/secrets/factory.v +++ b/lib/crypt/secrets/factory.v @@ -1,6 +1,6 @@ module secrets -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console pub struct SecretBox { pub mut: diff --git a/lib/crypt/secrets/readme.md b/lib/crypt/secrets/readme.md index 3b3321cf..aea9d66a 100644 --- a/lib/crypt/secrets/readme.md +++ b/lib/crypt/secrets/readme.md @@ -3,7 +3,7 @@ Some tools to work with encryption/decryption (symmetric) ```go -import freeflowuniverse.herolib.crypt.secrets +import incubaid.herolib.crypt.secrets mut box:=secrets.get(secret:"mysecret")! @@ -28,7 +28,7 @@ some utils to manage secret keys and easily change them in text, ideal for confi ```go #!/usr/bin/env -S v -n -cg -w -enable-globals run -import freeflowuniverse.herolib.crypt.secrets +import incubaid.herolib.crypt.secrets mut box:=secrets.get()! box.delete("myapp.something")! //make sure we remove all previous keys @@ -43,7 +43,6 @@ test_string1:=box.replace(txt:test_string)! println(test_string1) --> - test_string2:=box.replace(txt:test_string,defaults:{"MYAPP.SOMETHING.A":secrets.DefaultSecretArgs{secret:"AAA"}})! println(test_string2) diff --git a/lib/crypt/secrets/secrets.v b/lib/crypt/secrets/secrets.v index ee50f426..d058823d 100644 --- a/lib/crypt/secrets/secrets.v +++ b/lib/crypt/secrets/secrets.v @@ -1,9 +1,9 @@ module secrets import rand -// import freeflowuniverse.herolib.ui.console -// import freeflowuniverse.herolib.ui -// import freeflowuniverse.herolib.crypt.aes_symmetric +// import incubaid.herolib.ui.console +// import incubaid.herolib.ui +// import incubaid.herolib.crypt.aes_symmetric // import crypto.md5 import crypto.sha256 import os diff --git a/lib/crypt/secrets/secrets_test.v b/lib/crypt/secrets/secrets_test.v index ac1c13ee..ebee6a23 100644 --- a/lib/crypt/secrets/secrets_test.v +++ b/lib/crypt/secrets/secrets_test.v @@ -1,6 +1,6 @@ module secrets -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console fn test_check() { mut box := get(secret: 'mysecret')! diff --git a/lib/data/cache/README.md b/lib/data/cache/README.md index d0bb068b..f0541dce 100644 --- a/lib/data/cache/README.md +++ b/lib/data/cache/README.md @@ -32,7 +32,7 @@ pub mut: Here's a simple example of using the cache: ```v -import freeflowuniverse.herolib.data.cache +import incubaid.herolib.data.cache // Define your struct type @[heap] @@ -117,12 +117,12 @@ cache.clear() 1. **Choose Appropriate TTL**: Set TTL based on how frequently your data changes and how critical freshness is. -2. **Memory Management**: +2. **Memory Management**: - Set reasonable `max_entries` and `max_size_mb` limits based on your application's memory constraints - Monitor cache size using `len()` - Use appropriate `eviction_ratio` (typically 0.05-0.2) to balance performance and memory usage -3. **Type Safety**: +3. **Type Safety**: - Always use `@[heap]` attribute for structs stored in cache - Ensure cached types are properly memory managed diff --git a/lib/data/countries/README.md b/lib/data/countries/README.md index cfaa02a4..895bce05 100644 --- a/lib/data/countries/README.md +++ b/lib/data/countries/README.md @@ -5,6 +5,7 @@ This module provides access to country information data, including ISO codes, co ## Purpose The countries module allows you to: + - Load all country data from an embedded dataset - Search for specific countries by ISO code - Filter countries by continent or other attributes @@ -12,7 +13,8 @@ The countries module allows you to: ## Data Source -The country data is sourced from GeoNames (http://www.geonames.org), containing information about countries including: +The country data is sourced from GeoNames (), containing information about countries including: + - ISO country codes (2-letter, 3-letter, and numeric) - Country names and capitals - Continent information @@ -26,7 +28,7 @@ The country data is sourced from GeoNames (http://www.geonames.org), containing ## Example Usage ```v -import freeflowuniverse.herolib.data.countries +import incubaid.herolib.data.countries // Get all countries mut all_countries := countries.get_all_countries()! diff --git a/lib/data/currency/currency_test.v b/lib/data/currency/currency_test.v index ca21c3cc..798bab84 100644 --- a/lib/data/currency/currency_test.v +++ b/lib/data/currency/currency_test.v @@ -1,6 +1,6 @@ module currency -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console // pub fn test_amount_get() { // // assert amount_get("U s d 900").val == 900 diff --git a/lib/data/currency/rates.v b/lib/data/currency/rates.v index 8a1fa954..28381aa7 100644 --- a/lib/data/currency/rates.v +++ b/lib/data/currency/rates.v @@ -1,7 +1,7 @@ module currency import json -import freeflowuniverse.herolib.core.httpconnection +import incubaid.herolib.core.httpconnection struct ResponseBody { motd string diff --git a/lib/data/currency/readme.md b/lib/data/currency/readme.md index 5c23b98d..5b273bb4 100644 --- a/lib/data/currency/readme.md +++ b/lib/data/currency/readme.md @@ -16,7 +16,7 @@ A comprehensive currency handling module for V that supports both fiat and crypt ### Working with Amounts ```v -import freeflowuniverse.herolib.data.currency +import incubaid.herolib.data.currency // Parse amount from string mut amount := currency.amount_get('20 USD')! @@ -71,6 +71,7 @@ amount_get('1M EUR') // M multiplier for millions - `M` or `m`: Multiplies the amount by 1,000,000 Examples: + ```v amount_get('5k USD')! // 5,000 USD amount_get('2.5K EUR')! // 2,500 EUR diff --git a/lib/data/currency/serialize.v b/lib/data/currency/serialize.v index b341ac81..e1d60c77 100644 --- a/lib/data/currency/serialize.v +++ b/lib/data/currency/serialize.v @@ -2,7 +2,7 @@ module currency // see encoder for binary -// import freeflowuniverse.herolib.data.encoder +// import incubaid.herolib.data.encoder // // CurrencyBytes represents serialized Currency data // pub struct CurrencyBytes { diff --git a/lib/data/dbfs/core.v b/lib/data/dbfs/core.v index 4f1fd864..869e7315 100644 --- a/lib/data/dbfs/core.v +++ b/lib/data/dbfs/core.v @@ -1,6 +1,6 @@ module dbfs -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.texttools // will use default connection and get database with name as specified // is not encrypted diff --git a/lib/data/dbfs/db.v b/lib/data/dbfs/db.v index 7237236b..7b39e7b8 100644 --- a/lib/data/dbfs/db.v +++ b/lib/data/dbfs/db.v @@ -1,11 +1,11 @@ module dbfs -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.crypt.aes_symmetric +import incubaid.herolib.core.pathlib +import incubaid.herolib.core.texttools +import incubaid.herolib.ui.console +import incubaid.herolib.crypt.aes_symmetric import encoding.base64 -// import freeflowuniverse.herolib.ui.console +// import incubaid.herolib.ui.console @[heap] pub struct DB { diff --git a/lib/data/dbfs/dbcollection.v b/lib/data/dbfs/dbcollection.v index ead4a2a9..2c338dd7 100644 --- a/lib/data/dbfs/dbcollection.v +++ b/lib/data/dbfs/dbcollection.v @@ -1,11 +1,11 @@ module dbfs -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.core.texttools -// import freeflowuniverse.herolib.core.redisclient +import incubaid.herolib.core.pathlib +import incubaid.herolib.core.texttools +// import incubaid.herolib.core.redisclient import os import json -// import freeflowuniverse.herolib.ui.console +// import incubaid.herolib.ui.console @[heap] pub struct DBCollection { diff --git a/lib/data/dbfs/dbfs_test.v b/lib/data/dbfs/dbfs_test.v index ddf686b2..22078bfe 100644 --- a/lib/data/dbfs/dbfs_test.v +++ b/lib/data/dbfs/dbfs_test.v @@ -2,7 +2,7 @@ module dbfs import time import os -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console fn test_dbfs() { data_dir := '/tmp/db' diff --git a/lib/data/dbfs/factory.v b/lib/data/dbfs/factory.v index 6ab17650..099eca44 100644 --- a/lib/data/dbfs/factory.v +++ b/lib/data/dbfs/factory.v @@ -1,7 +1,7 @@ module dbfs -import freeflowuniverse.herolib.core.pathlib -// import freeflowuniverse.herolib.core.redisclient +import incubaid.herolib.core.pathlib +// import incubaid.herolib.core.redisclient import os @[params] diff --git a/lib/data/dbfs/namedb.v b/lib/data/dbfs/namedb.v index ef404a67..60cd413c 100644 --- a/lib/data/dbfs/namedb.v +++ b/lib/data/dbfs/namedb.v @@ -2,8 +2,8 @@ module dbfs import json import crypto.md5 -import freeflowuniverse.herolib.core.pathlib -// import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.pathlib +// import incubaid.herolib.ui.console @[heap] pub struct NameDB { diff --git a/lib/data/dbfs/namedb_test.v b/lib/data/dbfs/namedb_test.v index fda5fcbf..31551b39 100644 --- a/lib/data/dbfs/namedb_test.v +++ b/lib/data/dbfs/namedb_test.v @@ -1,9 +1,9 @@ module dbfs import os -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.crypt.secp256k1 -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.crypt.secp256k1 +import incubaid.herolib.ui.console fn test_dbname1() { data_dir := '/tmp/namedbtest' diff --git a/lib/data/dbfs/readme.md b/lib/data/dbfs/readme.md index 954c524c..f36b350b 100644 --- a/lib/data/dbfs/readme.md +++ b/lib/data/dbfs/readme.md @@ -6,14 +6,14 @@ The algo's used have been optimized for scalability and human readability, the i - dbcollection, can linked to a context of hero (can be a circle or another area worth remembering things for) - db, there can be more than 1 db per dbcollection -- the secret is specified per dbcollection +- the secret is specified per dbcollection - each subdb inherits the secret from the dbcollection but needs to be configured as encrypted ```v > TODO: fix, we refactored -import freeflowuniverse.herolib.data.dbfs +import incubaid.herolib.data.dbfs mut dbcollection := get(context: 'test', secret: '123456')! @@ -27,10 +27,9 @@ assert 'bbbb' == db.get('a')! ## dbfs examples - ```go -import freeflowuniverse.herolib.data.dbfs +import incubaid.herolib.data.dbfs mut dbcollection := get(context: 'test', secret: '123456')! @@ -47,7 +46,7 @@ fn (mut db DB) set(name_ string, data_ string) ! //check if entry exists based on keyname fn (mut db DB) exists(name_ string) bool - + //delete an entry fn (mut db DB) delete(name_ string) ! @@ -57,4 +56,4 @@ fn (mut db DB) keys(prefix string) ![]string // delete all data fn (mut db DB) destroy() ! -``` \ No newline at end of file +``` diff --git a/lib/data/dbfs/sid.v b/lib/data/dbfs/sid.v index 6d08fa31..308ac153 100644 --- a/lib/data/dbfs/sid.v +++ b/lib/data/dbfs/sid.v @@ -1,6 +1,6 @@ module dbfs -import freeflowuniverse.herolib.core.smartid +import incubaid.herolib.core.smartid // get u32 from sid as string pub fn sid2int(sid string) u32 { diff --git a/lib/data/dedupestor/dedupe_ourdb/README.md b/lib/data/dedupestor/dedupe_ourdb/README.md index ce76b42a..21c6c6f2 100644 --- a/lib/data/dedupestor/dedupe_ourdb/README.md +++ b/lib/data/dedupestor/dedupe_ourdb/README.md @@ -14,7 +14,7 @@ DedupeStore is a content-addressable key-value store with built-in deduplication ## Usage ```v -import freeflowuniverse.herolib.data.dedupestor +import incubaid.herolib.data.dedupestor // Create a new dedupestore mut ds := dedupestor.new( @@ -49,6 +49,7 @@ DedupeStore uses two main components for storage: 2. **OurDB**: Stores the actual data blocks When storing data: + 1. The data is hashed using blake2b-160 2. If the hash exists in the RadixTree, the existing data location is returned 3. If the hash is new: @@ -57,6 +58,7 @@ When storing data: - The hash is returned When retrieving data: + 1. The RadixTree is queried with the hash to get the data location ID 2. The data is retrieved from OurDB using the ID @@ -66,13 +68,14 @@ When retrieving data: - Attempting to store larger values will result in an error ## the reference field + In the dedupestor system, the Reference struct is defined with two fields: ```v pub struct Reference { pub: - owner u16 - id u32 + owner u16 + id u32 } ``` @@ -92,11 +95,13 @@ This design allows for efficient deduplication - if the same data is stored mult ## Testing The module includes comprehensive tests covering: + - Basic store/retrieve operations - Deduplication functionality - Size limit enforcement - Edge cases Run tests with: + ```bash v test lib/data/dedupestor/ diff --git a/lib/data/dedupestor/dedupe_ourdb/dedupestor.v b/lib/data/dedupestor/dedupe_ourdb/dedupestor.v index 5884923b..49939690 100644 --- a/lib/data/dedupestor/dedupe_ourdb/dedupestor.v +++ b/lib/data/dedupestor/dedupe_ourdb/dedupestor.v @@ -1,8 +1,8 @@ module dedupe_ourdb -import freeflowuniverse.herolib.data.radixtree -import freeflowuniverse.herolib.data.ourdb -import freeflowuniverse.herolib.data.dedupestor +import incubaid.herolib.data.radixtree +import incubaid.herolib.data.ourdb +import incubaid.herolib.data.dedupestor // DedupeStore provides a key-value store with deduplication based on content hashing pub struct DedupeStore { diff --git a/lib/data/dedupestor/dedupe_ourdb/dedupestor_test.v b/lib/data/dedupestor/dedupe_ourdb/dedupestor_test.v index 7472cde9..95ce3a55 100644 --- a/lib/data/dedupestor/dedupe_ourdb/dedupestor_test.v +++ b/lib/data/dedupestor/dedupe_ourdb/dedupestor_test.v @@ -1,7 +1,7 @@ module dedupe_ourdb import os -import freeflowuniverse.herolib.data.dedupestor +import incubaid.herolib.data.dedupestor fn testsuite_begin() ! { // Ensure test directories exist and are clean diff --git a/lib/data/doctree/README.md b/lib/data/doctree/README.md index 68328d46..3a1e51c8 100644 --- a/lib/data/doctree/README.md +++ b/lib/data/doctree/README.md @@ -4,27 +4,27 @@ The primary goal of this module is to transform structured document collections ## Key Concepts -* **Tree:** The central component (`doctree.Tree`) that holds one or more `Collection` instances. It orchestrates the scanning, processing, and exporting of all contained collections. -* **Collection:** A directory that is marked as a collection by the presence of a `.collection` file. A collection groups related documents (pages, images, files) and can have its own configuration defined within the `.collection` file. -* **.collection file:** A file placed in a directory to designate it as a collection. This file can optionally contain parameters (using the `paramsparser` format) such as a custom name for the collection. +* **Tree:** The central component (`doctree.Tree`) that holds one or more `Collection` instances. It orchestrates the scanning, processing, and exporting of all contained collections. +* **Collection:** A directory that is marked as a collection by the presence of a `.collection` file. A collection groups related documents (pages, images, files) and can have its own configuration defined within the `.collection` file. +* **.collection file:** A file placed in a directory to designate it as a collection. This file can optionally contain parameters (using the `paramsparser` format) such as a custom name for the collection. ## How it Works (Workflow) The typical workflow involves creating a `Tree`, scanning for collections, and then exporting the processed content.å -1. **Create Tree:** Initialize a `doctree.Tree` instance using `doctree.new()`. -2. **Scan:** Use the `tree.scan()` method, providing a path to a directory or a Git repository URL. The scanner recursively looks for directories containing a `.collection` file. -3. **Load Content:** For each identified collection, the module loads its content, including markdown pages, images, and other files. -4. **Process Content:** The loaded content is processed. This includes handling definitions, includes (content from other files), and macros (dynamic content generation or transformation). -5. **Generate Output Paths:** The module determines the final paths for all processed files and assets in the destination directory. -6. **Export:** The `tree.export()` method writes the processed content and assets to the specified destination directory, maintaining the desired structure. +1. **Create Tree:** Initialize a `doctree.Tree` instance using `doctree.new()`. +2. **Scan:** Use the `tree.scan()` method, providing a path to a directory or a Git repository URL. The scanner recursively looks for directories containing a `.collection` file. +3. **Load Content:** For each identified collection, the module loads its content, including markdown pages, images, and other files. +4. **Process Content:** The loaded content is processed. This includes handling definitions, includes (content from other files), and macros (dynamic content generation or transformation). +5. **Generate Output Paths:** The module determines the final paths for all processed files and assets in the destination directory. +6. **Export:** The `tree.export()` method writes the processed content and assets to the specified destination directory, maintaining the desired structure. ## Usage (For Developers) Here's a basic example of how to use the `doctree` module in your V project: ```v -import freeflowuniverse.herolib.data.doctree +import incubaid.herolib.data.doctree // 1. Create a new Tree instance mut tree := doctree.new(name: 'my_documentation')! @@ -64,7 +64,7 @@ my_collection/ └── data.csv ``` -Markdown files (`.md`) are treated as pages. +Markdown files (`.md`) are treated as pages. ## use Play @@ -93,5 +93,3 @@ doctree:$collectionname $pagename $rel_path_in_collection doctree:$collectionname $filename.$ext $rel_path_in_collection doctree:meta $collectionname $collectionpath_on_disk ``` - - diff --git a/lib/data/doctree/collection/collection.v b/lib/data/doctree/collection/collection.v index e59e178a..eec0cfd7 100644 --- a/lib/data/doctree/collection/collection.v +++ b/lib/data/doctree/collection/collection.v @@ -1,8 +1,8 @@ module collection -import freeflowuniverse.herolib.core.pathlib { Path } -import freeflowuniverse.herolib.data.doctree.collection.data -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.pathlib { Path } +import incubaid.herolib.data.doctree.collection.data +import incubaid.herolib.core.texttools @[heap] pub struct Collection { diff --git a/lib/data/doctree/collection/data/error.v b/lib/data/doctree/collection/data/error.v index 8a33dfcd..3730befa 100644 --- a/lib/data/doctree/collection/data/error.v +++ b/lib/data/doctree/collection/data/error.v @@ -1,6 +1,6 @@ module data -import freeflowuniverse.herolib.core.pathlib { Path } +import incubaid.herolib.core.pathlib { Path } pub enum PageErrorCat { unknown diff --git a/lib/data/doctree/collection/data/file.v b/lib/data/doctree/collection/data/file.v index b6f4b254..848adaa9 100644 --- a/lib/data/doctree/collection/data/file.v +++ b/lib/data/doctree/collection/data/file.v @@ -1,6 +1,6 @@ module data -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib import os pub enum FileStatus { diff --git a/lib/data/doctree/collection/data/page.v b/lib/data/doctree/collection/data/page.v index 291c220d..7e1c88e0 100644 --- a/lib/data/doctree/collection/data/page.v +++ b/lib/data/doctree/collection/data/page.v @@ -1,8 +1,8 @@ module data -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.data.markdown.elements { Action, Doc, Element, Frontmatter2 } -import freeflowuniverse.herolib.data.markdown +import incubaid.herolib.core.pathlib +import incubaid.herolib.data.markdown.elements { Action, Doc, Element, Frontmatter2 } +import incubaid.herolib.data.markdown pub enum PageStatus { unknown diff --git a/lib/data/doctree/collection/data/process_aliases.v b/lib/data/doctree/collection/data/process_aliases.v index a38a0d82..5db4af9b 100644 --- a/lib/data/doctree/collection/data/process_aliases.v +++ b/lib/data/doctree/collection/data/process_aliases.v @@ -1,7 +1,7 @@ module data -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.data.markdown.elements +import incubaid.herolib.core.texttools +import incubaid.herolib.data.markdown.elements // returns !!wiki.def actions pub fn (mut page Page) get_def_actions() ![]elements.Action { diff --git a/lib/data/doctree/collection/data/process_aliases_test.v b/lib/data/doctree/collection/data/process_aliases_test.v index 79a86f13..1f4ce60d 100644 --- a/lib/data/doctree/collection/data/process_aliases_test.v +++ b/lib/data/doctree/collection/data/process_aliases_test.v @@ -1,6 +1,6 @@ module data -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib fn test_get_def_actions() { mut page1_path := pathlib.get_file(path: '/tmp/page1', create: true)! diff --git a/lib/data/doctree/collection/data/process_def_pointers_test.v b/lib/data/doctree/collection/data/process_def_pointers_test.v index 2a013a02..80b77c1d 100644 --- a/lib/data/doctree/collection/data/process_def_pointers_test.v +++ b/lib/data/doctree/collection/data/process_def_pointers_test.v @@ -1,6 +1,6 @@ module data -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib import rand fn test_process_def_pointers() { diff --git a/lib/data/doctree/collection/data/process_link.v b/lib/data/doctree/collection/data/process_link.v index 127b2021..fc97aded 100644 --- a/lib/data/doctree/collection/data/process_link.v +++ b/lib/data/doctree/collection/data/process_link.v @@ -1,9 +1,9 @@ module data -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.data.markdown.elements -import freeflowuniverse.herolib.data.doctree.pointer +import incubaid.herolib.core.texttools +import incubaid.herolib.core.base +import incubaid.herolib.data.markdown.elements +import incubaid.herolib.data.doctree.pointer // Note: doc should not get reparsed after invoking this method pub fn (page Page) process_links(paths map[string]string) ![]string { @@ -36,7 +36,7 @@ pub fn (page Page) process_links(paths map[string]string) ![]string { // Check if Docusaurus-specific paths are available in Redis mut context := base.context() or { base.context_new()! } mut redis := context.redis() or { panic('Redis not available') } - + // Try to get Docusaurus-specific path from Redis if docusaurus_path := redis.hget('doctree_docusaurus_paths', ptr.str()) { // Use Docusaurus path (already without .md extension) diff --git a/lib/data/doctree/collection/data/process_link_test.v b/lib/data/doctree/collection/data/process_link_test.v index 4aff89fc..1dc16969 100644 --- a/lib/data/doctree/collection/data/process_link_test.v +++ b/lib/data/doctree/collection/data/process_link_test.v @@ -1,6 +1,6 @@ module data -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib fn test_process_link() { mut page1_path := pathlib.get_file(path: '/tmp/page1', create: true)! diff --git a/lib/data/doctree/collection/data/process_macros.v b/lib/data/doctree/collection/data/process_macros.v index 31046e2f..50eac55a 100644 --- a/lib/data/doctree/collection/data/process_macros.v +++ b/lib/data/doctree/collection/data/process_macros.v @@ -1,7 +1,7 @@ module data -import freeflowuniverse.herolib.core.playmacros -import freeflowuniverse.herolib.data.markdown.elements { Action } +import incubaid.herolib.core.playmacros +import incubaid.herolib.data.markdown.elements { Action } pub fn (mut page Page) process_macros() ! { mut mydoc := page.doc()! diff --git a/lib/data/doctree/collection/error.v b/lib/data/doctree/collection/error.v index 7da53ea7..f5fb8947 100644 --- a/lib/data/doctree/collection/error.v +++ b/lib/data/doctree/collection/error.v @@ -1,8 +1,8 @@ module collection -import freeflowuniverse.herolib.core.pathlib { Path } -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.pathlib { Path } +import incubaid.herolib.core.base +import incubaid.herolib.ui.console pub enum CollectionErrorCat { unknown diff --git a/lib/data/doctree/collection/export.v b/lib/data/doctree/collection/export.v index 0dab4c0c..7208de9c 100644 --- a/lib/data/doctree/collection/export.v +++ b/lib/data/doctree/collection/export.v @@ -1,11 +1,11 @@ module collection -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.texttools.regext +import incubaid.herolib.core.pathlib +import incubaid.herolib.core.base +import incubaid.herolib.core.texttools.regext import os -import freeflowuniverse.herolib.data.doctree.pointer -import freeflowuniverse.herolib.data.doctree.collection.data +import incubaid.herolib.data.doctree.pointer +import incubaid.herolib.data.doctree.collection.data @[params] pub struct CollectionExportArgs { diff --git a/lib/data/doctree/collection/export_test.v b/lib/data/doctree/collection/export_test.v index cb775a4c..b753d0aa 100644 --- a/lib/data/doctree/collection/export_test.v +++ b/lib/data/doctree/collection/export_test.v @@ -1,6 +1,6 @@ module collection -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib import os const test_dir = '${os.dir(@FILE)}/testdata/export_test' diff --git a/lib/data/doctree/collection/getters.v b/lib/data/doctree/collection/getters.v index f3b38438..0d0470f7 100644 --- a/lib/data/doctree/collection/getters.v +++ b/lib/data/doctree/collection/getters.v @@ -1,6 +1,6 @@ module collection -import freeflowuniverse.herolib.data.doctree.collection.data +import incubaid.herolib.data.doctree.collection.data // gets page with specified name from collection pub fn (collection Collection) page_get(name string) !&data.Page { diff --git a/lib/data/doctree/collection/scan.v b/lib/data/doctree/collection/scan.v index 46b0a438..cc58572e 100644 --- a/lib/data/doctree/collection/scan.v +++ b/lib/data/doctree/collection/scan.v @@ -1,9 +1,9 @@ module collection -import freeflowuniverse.herolib.conversiontools.imagemagick -import freeflowuniverse.herolib.core.pathlib { Path } -import freeflowuniverse.herolib.data.doctree.pointer -import freeflowuniverse.herolib.data.doctree.collection.data +import incubaid.herolib.conversiontools.imagemagick +import incubaid.herolib.core.pathlib { Path } +import incubaid.herolib.data.doctree.pointer +import incubaid.herolib.data.doctree.collection.data // walk over one specific collection, find all files and pages pub fn (mut collection Collection) scan() ! { diff --git a/lib/data/doctree/collection/scan_test.v b/lib/data/doctree/collection/scan_test.v index 7c20e837..19e2dcae 100644 --- a/lib/data/doctree/collection/scan_test.v +++ b/lib/data/doctree/collection/scan_test.v @@ -1,6 +1,6 @@ module collection -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib fn test_add_page_success() { /* diff --git a/lib/data/doctree/error.v b/lib/data/doctree/error.v index a8f306cc..3e0aff1e 100644 --- a/lib/data/doctree/error.v +++ b/lib/data/doctree/error.v @@ -1,6 +1,6 @@ module doctree -import freeflowuniverse.herolib.data.doctree.pointer +import incubaid.herolib.data.doctree.pointer pub struct ObjNotFound { Error diff --git a/lib/data/doctree/export.v b/lib/data/doctree/export.v index f518c69a..f495f8df 100644 --- a/lib/data/doctree/export.v +++ b/lib/data/doctree/export.v @@ -1,9 +1,9 @@ module doctree -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.data.doctree.collection { Collection } -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools.regext +import incubaid.herolib.core.pathlib +import incubaid.herolib.data.doctree.collection { Collection } +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools.regext import os @[params] diff --git a/lib/data/doctree/export_test.v b/lib/data/doctree/export_test.v index 5efc7e4d..4cd5c109 100644 --- a/lib/data/doctree/export_test.v +++ b/lib/data/doctree/export_test.v @@ -1,6 +1,6 @@ module doctree -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib import os const test_dir = '${os.dir(@FILE)}/testdata/export_test' diff --git a/lib/data/doctree/getters.v b/lib/data/doctree/getters.v index 3b11987b..e52acf47 100644 --- a/lib/data/doctree/getters.v +++ b/lib/data/doctree/getters.v @@ -1,8 +1,8 @@ module doctree -import freeflowuniverse.herolib.data.doctree.collection -import freeflowuniverse.herolib.data.doctree.collection.data -import freeflowuniverse.herolib.data.doctree.pointer +import incubaid.herolib.data.doctree.collection +import incubaid.herolib.data.doctree.collection.data +import incubaid.herolib.data.doctree.pointer pub fn (tree Tree) get_collection(name string) !&collection.Collection { col := tree.collections[name] or { return error('collection ${name} not found') } diff --git a/lib/data/doctree/getters_test.v b/lib/data/doctree/getters_test.v index a2b0cef1..c184db01 100644 --- a/lib/data/doctree/getters_test.v +++ b/lib/data/doctree/getters_test.v @@ -1,6 +1,6 @@ module doctree -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib import os fn test_page_get() { diff --git a/lib/data/doctree/list.v b/lib/data/doctree/list.v index c26bcb74..1b6be305 100644 --- a/lib/data/doctree/list.v +++ b/lib/data/doctree/list.v @@ -1,6 +1,6 @@ module doctree -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console // list_pages returns a map of collection names to a list of page names within that collection. // The structure is map[collectionname][]pagename. diff --git a/lib/data/doctree/play.v b/lib/data/doctree/play.v index a391bebe..59b5725e 100644 --- a/lib/data/doctree/play.v +++ b/lib/data/doctree/play.v @@ -1,7 +1,7 @@ module doctree -import freeflowuniverse.herolib.core.playbook { PlayBook } -// import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook { PlayBook } +// import incubaid.herolib.ui.console pub fn play(mut plbook PlayBook) ! { if !plbook.exists(filter: 'doctree.') { diff --git a/lib/data/doctree/pointer/pointer.v b/lib/data/doctree/pointer/pointer.v index a44df025..3170612d 100644 --- a/lib/data/doctree/pointer/pointer.v +++ b/lib/data/doctree/pointer/pointer.v @@ -1,6 +1,6 @@ module pointer -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.texttools pub enum PointerCat { page diff --git a/lib/data/doctree/pointer/pointer_test.v b/lib/data/doctree/pointer/pointer_test.v index 6f6f5a1b..390c65ee 100644 --- a/lib/data/doctree/pointer/pointer_test.v +++ b/lib/data/doctree/pointer/pointer_test.v @@ -1,9 +1,9 @@ module pointer -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console -// import freeflowuniverse.herolib.core.pathlib -// import freeflowuniverse.herolib.core.texttools +// import incubaid.herolib.core.pathlib +// import incubaid.herolib.core.texttools // fn test_pointerpath() { // p1 := pointerpath_new(path: '/tmp/A file.md') or { panic(err) } diff --git a/lib/data/doctree/process_defs.v b/lib/data/doctree/process_defs.v index 9003bb39..ef7d4b02 100644 --- a/lib/data/doctree/process_defs.v +++ b/lib/data/doctree/process_defs.v @@ -1,8 +1,8 @@ module doctree -import freeflowuniverse.herolib.data.doctree.collection { CollectionError } -import freeflowuniverse.herolib.data.doctree.collection.data -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.data.doctree.collection { CollectionError } +import incubaid.herolib.data.doctree.collection.data +import incubaid.herolib.ui.console // process definitions (!!wiki.def actions, elements.Def elements) // this must be done before processing includes. diff --git a/lib/data/doctree/process_defs_test.v b/lib/data/doctree/process_defs_test.v index a19aec9f..58cfdc5b 100644 --- a/lib/data/doctree/process_defs_test.v +++ b/lib/data/doctree/process_defs_test.v @@ -1,8 +1,8 @@ module doctree import os -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.data.doctree.collection.data +import incubaid.herolib.core.pathlib +import incubaid.herolib.data.doctree.collection.data const test_dir = '${os.dir(@FILE)}/testdata/process_defs_test' diff --git a/lib/data/doctree/process_includes.v b/lib/data/doctree/process_includes.v index 0db4baaf..de3373ec 100644 --- a/lib/data/doctree/process_includes.v +++ b/lib/data/doctree/process_includes.v @@ -1,11 +1,11 @@ module doctree -// import freeflowuniverse.herolib.data.doctree.collection.data -import freeflowuniverse.herolib.data.doctree.pointer -import freeflowuniverse.herolib.data.doctree.collection { CollectionError } -import freeflowuniverse.herolib.data.doctree.collection.data -import freeflowuniverse.herolib.core.playbook -import freeflowuniverse.herolib.ui.console +// import incubaid.herolib.data.doctree.collection.data +import incubaid.herolib.data.doctree.pointer +import incubaid.herolib.data.doctree.collection { CollectionError } +import incubaid.herolib.data.doctree.collection.data +import incubaid.herolib.core.playbook +import incubaid.herolib.ui.console pub fn (mut tree Tree) process_includes() ! { console.print_green('Processing page includes') diff --git a/lib/data/doctree/process_includes_test.v b/lib/data/doctree/process_includes_test.v index 6b44d989..441e8735 100644 --- a/lib/data/doctree/process_includes_test.v +++ b/lib/data/doctree/process_includes_test.v @@ -1,7 +1,7 @@ module doctree import os -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib const test_dir = '${os.dir(@FILE)}/testdata/process_includes_test' diff --git a/lib/data/doctree/process_macros.v b/lib/data/doctree/process_macros.v index 13cdb1c4..3dac6b76 100644 --- a/lib/data/doctree/process_macros.v +++ b/lib/data/doctree/process_macros.v @@ -1,10 +1,10 @@ module doctree -import freeflowuniverse.herolib.data.doctree.collection { Collection } -import freeflowuniverse.herolib.data.markdown.elements -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.playbook -import freeflowuniverse.herolib.core.playmacros +import incubaid.herolib.data.doctree.collection { Collection } +import incubaid.herolib.data.markdown.elements +import incubaid.herolib.ui.console +import incubaid.herolib.core.playbook +import incubaid.herolib.core.playmacros @[params] pub struct MacroGetArgs { diff --git a/lib/data/doctree/scan.v b/lib/data/doctree/scan.v index 9c9bbec1..eb839fcb 100644 --- a/lib/data/doctree/scan.v +++ b/lib/data/doctree/scan.v @@ -1,12 +1,12 @@ module doctree -import freeflowuniverse.herolib.core.pathlib { Path } -import freeflowuniverse.herolib.data.paramsparser -import freeflowuniverse.herolib.data.doctree.collection { Collection } -import freeflowuniverse.herolib.develop.gittools +import incubaid.herolib.core.pathlib { Path } +import incubaid.herolib.data.paramsparser +import incubaid.herolib.data.doctree.collection { Collection } +import incubaid.herolib.develop.gittools import os -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.ui.console @[params] pub struct TreeScannerArgs { diff --git a/lib/data/doctree/tree.v b/lib/data/doctree/tree.v index 292847e6..5c8fbbb6 100644 --- a/lib/data/doctree/tree.v +++ b/lib/data/doctree/tree.v @@ -1,9 +1,9 @@ module doctree -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.data.doctree.collection -import freeflowuniverse.herolib.data.doctree.collection.data -import freeflowuniverse.herolib.core.texttools.regext +import incubaid.herolib.core.texttools +import incubaid.herolib.data.doctree.collection +import incubaid.herolib.data.doctree.collection.data +import incubaid.herolib.core.texttools.regext __global ( doctrees shared map[string]&Tree diff --git a/lib/data/doctree/tree_test.v b/lib/data/doctree/tree_test.v index 22cf4de2..ec8ce3e8 100644 --- a/lib/data/doctree/tree_test.v +++ b/lib/data/doctree/tree_test.v @@ -1,8 +1,8 @@ module doctree -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.data.doctree.collection.data -import freeflowuniverse.herolib.data.doctree.collection +import incubaid.herolib.core.pathlib +import incubaid.herolib.data.doctree.collection.data +import incubaid.herolib.data.doctree.collection import os const collections_path = os.dir(@FILE) + '/testdata/tree_test' diff --git a/lib/data/encoder/encoder_decode.v b/lib/data/encoder/encoder_decode.v index f0ee4760..5b0948b0 100644 --- a/lib/data/encoder/encoder_decode.v +++ b/lib/data/encoder/encoder_decode.v @@ -1,10 +1,10 @@ module encoder import encoding.binary as bin -import freeflowuniverse.herolib.data.ourtime +import incubaid.herolib.data.ourtime import time -import freeflowuniverse.herolib.data.gid -import freeflowuniverse.herolib.data.currency +import incubaid.herolib.data.gid +import incubaid.herolib.data.currency pub struct Decoder { pub mut: diff --git a/lib/data/encoder/encoder_encode.v b/lib/data/encoder/encoder_encode.v index 005d4daa..6d03ac2b 100644 --- a/lib/data/encoder/encoder_encode.v +++ b/lib/data/encoder/encoder_encode.v @@ -2,9 +2,9 @@ module encoder import time import encoding.binary as bin -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.data.gid -import freeflowuniverse.herolib.data.currency +import incubaid.herolib.data.ourtime +import incubaid.herolib.data.gid +import incubaid.herolib.data.currency const kb = 1024 diff --git a/lib/data/encoder/encoder_test.v b/lib/data/encoder/encoder_test.v index 17d192a6..737083dd 100644 --- a/lib/data/encoder/encoder_test.v +++ b/lib/data/encoder/encoder_test.v @@ -2,9 +2,9 @@ module encoder import time import math -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.data.gid -import freeflowuniverse.herolib.data.currency +import incubaid.herolib.ui.console +import incubaid.herolib.data.gid +import incubaid.herolib.data.currency fn test_string() { mut e := new() diff --git a/lib/data/encoder/readme.md b/lib/data/encoder/readme.md index b20966bf..f22fefab 100644 --- a/lib/data/encoder/readme.md +++ b/lib/data/encoder/readme.md @@ -25,6 +25,7 @@ The binary format starts with a version byte (currently v1), followed by the enc ## Supported Types ### Primitive Types + - `string` - `int` (32-bit) - `i64` (64-bit integer) @@ -42,6 +43,7 @@ The binary format starts with a version byte (currently v1), followed by the enc - `[]byte` (raw byte arrays) ### Arrays + - `[]string` - `[]int` - `[]u8` @@ -50,10 +52,12 @@ The binary format starts with a version byte (currently v1), followed by the enc - `[]u64` ### Maps + - `map[string]string` - `map[string][]u8` ### Structs + - Nested struct support with automatic encoding/decoding ## Usage @@ -61,7 +65,7 @@ The binary format starts with a version byte (currently v1), followed by the enc ### Basic Encoding ```v -import freeflowuniverse.herolib.data.encoder +import incubaid.herolib.data.encoder // Create a new encoder mut e := encoder.new() @@ -92,17 +96,17 @@ import time e.add_time(time.now()) // Add OurTime (native time format) -import freeflowuniverse.herolib.data.ourtime +import incubaid.herolib.data.ourtime my_time := ourtime.OurTime.now() e.add_ourtime(my_time) // Add GID -import freeflowuniverse.herolib.data.gid +import incubaid.herolib.data.gid my_gid := gid.new('project:123')! e.add_gid(my_gid) // Add currency amount -import freeflowuniverse.herolib.data.currency +import incubaid.herolib.data.currency usd := currency.get('USD')! amount := currency.Amount{ currency: usd @@ -164,15 +168,15 @@ import time time_val := d.get_time()! // Read OurTime value -import freeflowuniverse.herolib.data.ourtime +import incubaid.herolib.data.ourtime my_time := d.get_ourtime()! // Read GID -import freeflowuniverse.herolib.data.gid +import incubaid.herolib.data.gid my_gid := d.get_gid()! // Read currency amount -import freeflowuniverse.herolib.data.currency +import incubaid.herolib.data.currency amount := d.get_currency()! // Read arrays @@ -221,7 +225,7 @@ decoded := encoder.decode[Person](encoded)! Here's a complete example showing how to encode nested structs: ```v -import freeflowuniverse.herolib.data.encoder +import incubaid.herolib.data.encoder // Define some nested structs struct Address { @@ -313,8 +317,6 @@ For the example above, the binary layout would be: [len][customer] // value 2 ``` - - ## Implementation Details ### Binary Format @@ -322,6 +324,7 @@ For the example above, the binary layout would be: The encoded data follows this format for different types: #### Primitive Types + - `string`: u16 length prefix + raw string bytes - `int` (32-bit): 4 bytes in little-endian format - `i64` (64-bit): 8 bytes in little-endian format @@ -334,6 +337,7 @@ The encoded data follows this format for different types: - `percentage`: Single byte (0-100) #### Special Types + - `time.Time`: Encoded as u32 Unix timestamp (seconds since epoch) - `ourtime.OurTime`: Encoded as u32 Unix timestamp - `gid.GID`: Encoded as string in format "circle:id" @@ -341,6 +345,7 @@ The encoded data follows this format for different types: - `[]byte` (raw byte arrays): u32 length prefix + raw bytes #### Collections + - Arrays (`[]T`): - u16 length prefix (number of elements) - Each element encoded according to its type diff --git a/lib/data/encoderhero/decoder.v b/lib/data/encoderhero/decoder.v index 9dddd513..cab63bec 100644 --- a/lib/data/encoderhero/decoder.v +++ b/lib/data/encoderhero/decoder.v @@ -1,6 +1,6 @@ module encoderhero -import freeflowuniverse.herolib.data.paramsparser +import incubaid.herolib.data.paramsparser pub struct Decoder[T] { pub mut: diff --git a/lib/data/encoderhero/decoder_test.v b/lib/data/encoderhero/decoder_test.v index f149023b..14eca193 100644 --- a/lib/data/encoderhero/decoder_test.v +++ b/lib/data/encoderhero/decoder_test.v @@ -1,8 +1,8 @@ module encoderhero import time -import freeflowuniverse.herolib.data.paramsparser -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.data.paramsparser +import incubaid.herolib.core.texttools struct TestStruct { id int diff --git a/lib/data/encoderhero/encoder.v b/lib/data/encoderhero/encoder.v index 4bc9e74d..6e9d19e5 100644 --- a/lib/data/encoderhero/encoder.v +++ b/lib/data/encoderhero/encoder.v @@ -1,10 +1,10 @@ module encoderhero -import freeflowuniverse.herolib.data.paramsparser +import incubaid.herolib.data.paramsparser import time import v.reflection -import freeflowuniverse.herolib.data.ourtime -// import freeflowuniverse.herolib.ui.console +import incubaid.herolib.data.ourtime +// import incubaid.herolib.ui.console // Encoder encodes the an `Any` type into HEROSCRIPT representation. // It provides parameters in order to change the end result. diff --git a/lib/data/encoderhero/encoder_ignorepropery_test.v b/lib/data/encoderhero/encoder_ignorepropery_test.v index bdac9eaa..8f2c1b40 100644 --- a/lib/data/encoderhero/encoder_ignorepropery_test.v +++ b/lib/data/encoderhero/encoder_ignorepropery_test.v @@ -1,6 +1,6 @@ module encoderhero -import freeflowuniverse.herolib.data.paramsparser +import incubaid.herolib.data.paramsparser import time import v.reflection diff --git a/lib/data/encoderhero/encoder_test.v b/lib/data/encoderhero/encoder_test.v index f0480209..9525b691 100644 --- a/lib/data/encoderhero/encoder_test.v +++ b/lib/data/encoderhero/encoder_test.v @@ -1,7 +1,7 @@ module encoderhero -import freeflowuniverse.herolib.data.paramsparser -import freeflowuniverse.herolib.data.ourtime +import incubaid.herolib.data.paramsparser +import incubaid.herolib.data.ourtime import time import v.reflection diff --git a/lib/data/encoderhero/readme.md b/lib/data/encoderhero/readme.md index ffd7a6c7..89ae02f1 100644 --- a/lib/data/encoderhero/readme.md +++ b/lib/data/encoderhero/readme.md @@ -4,15 +4,15 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.data.encoderhero -import freeflowuniverse.herolib.core.base +import incubaid.herolib.data.encoderhero +import incubaid.herolib.core.base import time struct Person { mut: - name string - age int = 20 - birthday time.Time + name string + age int = 20 + birthday time.Time } mut person := Person{ @@ -28,4 +28,3 @@ person2 := encoderhero.decode[Person](heroscript)! println(person2) ``` - diff --git a/lib/data/gid/gid.v b/lib/data/gid/gid.v index 4ac4bc1a..fac761b9 100644 --- a/lib/data/gid/gid.v +++ b/lib/data/gid/gid.v @@ -1,6 +1,6 @@ module gid -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.texttools pub struct GID { pub mut: diff --git a/lib/data/graphdb/README.md b/lib/data/graphdb/README.md index 1e3d76ed..f2307a32 100644 --- a/lib/data/graphdb/README.md +++ b/lib/data/graphdb/README.md @@ -28,7 +28,7 @@ A lightweight, efficient graph database implementation in V that supports proper GraphDB is part of the HeroLib library. Include it in your V project: ```v -import freeflowuniverse.herolib.data.graphdb +import incubaid.herolib.data.graphdb ``` ## Basic Usage @@ -36,7 +36,7 @@ import freeflowuniverse.herolib.data.graphdb Here's a simple example demonstrating core functionality: ```v -import freeflowuniverse.herolib.data.graphdb +import incubaid.herolib.data.graphdb fn main() { // Create a new graph database diff --git a/lib/data/graphdb/graphdb.v b/lib/data/graphdb/graphdb.v index 17be3a71..c2344a8e 100644 --- a/lib/data/graphdb/graphdb.v +++ b/lib/data/graphdb/graphdb.v @@ -1,7 +1,7 @@ module graphdb -import freeflowuniverse.herolib.data.ourdb -import freeflowuniverse.herolib.data.cache { Cache, CacheConfig, new_cache } +import incubaid.herolib.data.ourdb +import incubaid.herolib.data.cache { Cache, CacheConfig, new_cache } // Node represents a vertex in the graph with properties and edge references @[heap] diff --git a/lib/data/graphdb/serialization.v b/lib/data/graphdb/serialization.v index 281bde3f..248349cd 100644 --- a/lib/data/graphdb/serialization.v +++ b/lib/data/graphdb/serialization.v @@ -1,6 +1,6 @@ module graphdb -import freeflowuniverse.herolib.data.encoder +import incubaid.herolib.data.encoder const version_v1 = u8(1) diff --git a/lib/data/ipaddress/ipaddress.v b/lib/data/ipaddress/ipaddress.v index fd48a599..25795e75 100644 --- a/lib/data/ipaddress/ipaddress.v +++ b/lib/data/ipaddress/ipaddress.v @@ -1,8 +1,8 @@ module ipaddress import os -import freeflowuniverse.herolib.core -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core +import incubaid.herolib.ui.console pub struct IPNetwork { IPAddress diff --git a/lib/data/location/db.v b/lib/data/location/db.v index 041f17cc..9f1f8900 100644 --- a/lib/data/location/db.v +++ b/lib/data/location/db.v @@ -3,9 +3,9 @@ module location import db.pg import os import encoding.csv -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.clients.postgresql_client +import incubaid.herolib.osal.core as osal +import incubaid.herolib.core.pathlib +import incubaid.herolib.clients.postgresql_client // LocationDB handles all database operations for locations pub struct LocationDB { diff --git a/lib/data/location/factory.v b/lib/data/location/factory.v index b8a6956f..ad7b4c92 100644 --- a/lib/data/location/factory.v +++ b/lib/data/location/factory.v @@ -1,6 +1,6 @@ module location -import freeflowuniverse.herolib.clients.postgresql_client +import incubaid.herolib.clients.postgresql_client // Location represents the main API for location operations pub struct Location { diff --git a/lib/data/location/importer.v b/lib/data/location/importer.v index d9f7d59a..31e668f8 100644 --- a/lib/data/location/importer.v +++ b/lib/data/location/importer.v @@ -3,9 +3,9 @@ module location import os import io import time -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools const geonames_url = 'https://download.geonames.org/export/dump' diff --git a/lib/data/markdown/action_test.v b/lib/data/markdown/action_test.v index a2c9dd95..029478dc 100644 --- a/lib/data/markdown/action_test.v +++ b/lib/data/markdown/action_test.v @@ -1,9 +1,9 @@ module markdown -import freeflowuniverse.herolib.data.paramsparser { Param, Params } -import freeflowuniverse.herolib.data.markdown.elements { Action } -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.data.paramsparser { Param, Params } +import incubaid.herolib.data.markdown.elements { Action } +import incubaid.herolib.core.texttools +import incubaid.herolib.ui.console fn test_action_empty_params() { mut docs := new( diff --git a/lib/data/markdown/elements/base.v b/lib/data/markdown/elements/base.v index a8d15fea..e7ab8176 100644 --- a/lib/data/markdown/elements/base.v +++ b/lib/data/markdown/elements/base.v @@ -1,11 +1,11 @@ module elements -import freeflowuniverse.herolib.core.pathlib -// import freeflowuniverse.herolib.core.smartid -// import freeflowuniverse.herolib.data.paramsparser -import freeflowuniverse.herolib.core.playbook -// import freeflowuniverse.herolib.ui.console -// import freeflowuniverse.herolib.core.base +import incubaid.herolib.core.pathlib +// import incubaid.herolib.core.smartid +// import incubaid.herolib.data.paramsparser +import incubaid.herolib.core.playbook +// import incubaid.herolib.ui.console +// import incubaid.herolib.core.base @[heap] pub struct DocBase { diff --git a/lib/data/markdown/elements/char_parser_test.v b/lib/data/markdown/elements/char_parser_test.v index 90713545..d9a75300 100644 --- a/lib/data/markdown/elements/char_parser_test.v +++ b/lib/data/markdown/elements/char_parser_test.v @@ -1,6 +1,6 @@ module elements -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console fn test_charparser1() { mut txt := '' diff --git a/lib/data/markdown/elements/doc.v b/lib/data/markdown/elements/doc.v index 6a6f09e9..7ac356e1 100644 --- a/lib/data/markdown/elements/doc.v +++ b/lib/data/markdown/elements/doc.v @@ -1,6 +1,6 @@ module elements -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.texttools @[heap] pub struct Doc { diff --git a/lib/data/markdown/elements/element_action.v b/lib/data/markdown/elements/element_action.v index 93987971..d3194798 100644 --- a/lib/data/markdown/elements/element_action.v +++ b/lib/data/markdown/elements/element_action.v @@ -1,6 +1,6 @@ module elements -import freeflowuniverse.herolib.core.playbook +import incubaid.herolib.core.playbook @[heap] pub struct Action { diff --git a/lib/data/markdown/elements/element_codeblock.v b/lib/data/markdown/elements/element_codeblock.v index e87b4b52..5aaa98eb 100644 --- a/lib/data/markdown/elements/element_codeblock.v +++ b/lib/data/markdown/elements/element_codeblock.v @@ -1,6 +1,6 @@ module elements -import freeflowuniverse.herolib.core.playbook +import incubaid.herolib.core.playbook @[heap] pub struct Codeblock { diff --git a/lib/data/markdown/elements/element_empty.v b/lib/data/markdown/elements/element_empty.v index 0fae390e..064f8b37 100644 --- a/lib/data/markdown/elements/element_empty.v +++ b/lib/data/markdown/elements/element_empty.v @@ -1,6 +1,6 @@ module elements -import freeflowuniverse.herolib.core.playbook +import incubaid.herolib.core.playbook // NOT USED FOR NOW diff --git a/lib/data/markdown/elements/element_link.v b/lib/data/markdown/elements/element_link.v index d4554a0d..6cde0cd9 100644 --- a/lib/data/markdown/elements/element_link.v +++ b/lib/data/markdown/elements/element_link.v @@ -1,8 +1,8 @@ module elements -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.texttools import os -// import freeflowuniverse.herolib.ui.console +// import incubaid.herolib.ui.console @[heap] pub struct Link { diff --git a/lib/data/markdown/elements/element_paragraph.v b/lib/data/markdown/elements/element_paragraph.v index 699f2daf..3eec868e 100644 --- a/lib/data/markdown/elements/element_paragraph.v +++ b/lib/data/markdown/elements/element_paragraph.v @@ -1,6 +1,6 @@ module elements -// import freeflowuniverse.herolib.ui.console +// import incubaid.herolib.ui.console @[heap] pub struct Paragraph { diff --git a/lib/data/markdown/elements/element_table.v b/lib/data/markdown/elements/element_table.v index 78b74053..b330ff95 100644 --- a/lib/data/markdown/elements/element_table.v +++ b/lib/data/markdown/elements/element_table.v @@ -1,7 +1,7 @@ module elements import regex -// import freeflowuniverse.herolib.ui.console +// import incubaid.herolib.ui.console @[heap] pub struct Table { diff --git a/lib/data/markdown/elements/interface_element.v b/lib/data/markdown/elements/interface_element.v index d45aa7f3..e533269f 100644 --- a/lib/data/markdown/elements/interface_element.v +++ b/lib/data/markdown/elements/interface_element.v @@ -1,7 +1,7 @@ module elements -import freeflowuniverse.herolib.core.playbook -// import freeflowuniverse.herolib.data.paramsparser +import incubaid.herolib.core.playbook +// import incubaid.herolib.data.paramsparser @[heap] pub interface Element { diff --git a/lib/data/markdown/elements/parser_char.v b/lib/data/markdown/elements/parser_char.v index b7ef4407..bd6fd2e5 100644 --- a/lib/data/markdown/elements/parser_char.v +++ b/lib/data/markdown/elements/parser_char.v @@ -1,7 +1,7 @@ module elements import os -// import freeflowuniverse.herolib.ui.console +// import incubaid.herolib.ui.console // is a char parser diff --git a/lib/data/markdown/elements/parser_paragraph.v b/lib/data/markdown/elements/parser_paragraph.v index 08ad6024..dbd7f906 100644 --- a/lib/data/markdown/elements/parser_paragraph.v +++ b/lib/data/markdown/elements/parser_paragraph.v @@ -1,7 +1,7 @@ module elements -import freeflowuniverse.herolib.core.texttools -// import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.texttools +// import incubaid.herolib.ui.console // DO NOT CHANGE THE WAY HOW THIS WORKS, THIS HAS BEEN DONE AS A STATEFUL PARSER BY DESIGN // THIS ALLOWS FOR EASY ADOPTIONS TO DIFFERENT REALITIES diff --git a/lib/data/markdown/factory.v b/lib/data/markdown/factory.v index 08f0f6c7..a33bc95e 100644 --- a/lib/data/markdown/factory.v +++ b/lib/data/markdown/factory.v @@ -1,8 +1,8 @@ module markdown -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.data.markdown.elements -import freeflowuniverse.herolib.data.markdown.parsers +import incubaid.herolib.core.pathlib +import incubaid.herolib.data.markdown.elements +import incubaid.herolib.data.markdown.parsers import os @[params] diff --git a/lib/data/markdown/frontmatter_remove_test.v b/lib/data/markdown/frontmatter_remove_test.v index 4ef4f1d6..e3d7c397 100644 --- a/lib/data/markdown/frontmatter_remove_test.v +++ b/lib/data/markdown/frontmatter_remove_test.v @@ -1,7 +1,7 @@ module markdown -import freeflowuniverse.herolib.data.markdown { new } -import freeflowuniverse.herolib.data.markdown.elements { Frontmatter2 } +import incubaid.herolib.data.markdown { new } +import incubaid.herolib.data.markdown.elements { Frontmatter2 } import os fn test_get_content_without_frontmatter() { diff --git a/lib/data/markdown/link_def_test.v b/lib/data/markdown/link_def_test.v index b4b61e75..b5a1b7d6 100644 --- a/lib/data/markdown/link_def_test.v +++ b/lib/data/markdown/link_def_test.v @@ -1,7 +1,7 @@ module markdown -import freeflowuniverse.herolib.data.markdown.elements -// import freeflowuniverse.herolib.ui.console +import incubaid.herolib.data.markdown.elements +// import incubaid.herolib.ui.console fn test_empty() { mut mydoc := new(content: '')! diff --git a/lib/data/markdown/link_test.v b/lib/data/markdown/link_test.v index 0cccdd51..7ba5955f 100644 --- a/lib/data/markdown/link_test.v +++ b/lib/data/markdown/link_test.v @@ -1,7 +1,7 @@ module markdown -import freeflowuniverse.herolib.data.markdown.elements -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.data.markdown.elements +import incubaid.herolib.ui.console fn test_link1() { mut docs := new(content: '[Architecture](architecture/architecture.md)')! diff --git a/lib/data/markdown/list_test.v b/lib/data/markdown/list_test.v index 18db5f70..d23ce72b 100644 --- a/lib/data/markdown/list_test.v +++ b/lib/data/markdown/list_test.v @@ -1,6 +1,6 @@ module markdown -import freeflowuniverse.herolib.data.markdown.elements +import incubaid.herolib.data.markdown.elements const text = ' # Farmerbot diff --git a/lib/data/markdown/markdown_test.v b/lib/data/markdown/markdown_test.v index a959b7fb..39a3f610 100644 --- a/lib/data/markdown/markdown_test.v +++ b/lib/data/markdown/markdown_test.v @@ -1,8 +1,8 @@ module markdown -import freeflowuniverse.herolib.data.paramsparser { Param, Params } -import freeflowuniverse.herolib.data.markdown.elements { Action, Codeblock, Header, Link, List, Paragraph, Table, Text } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.data.paramsparser { Param, Params } +import incubaid.herolib.data.markdown.elements { Action, Codeblock, Header, Link, List, Paragraph, Table, Text } +import incubaid.herolib.ui.console const text = " # Farmerbot @@ -19,7 +19,7 @@ The farmerbot has been implemented using the actor model principles. It contains The first actor is the nodemanager which is in charge of executing jobs related to nodes (e.g. finding a suitable node). The second actor is the powermanager which allows us to power on and off nodes in the farm. -Actors can schedule the execution of jobs for other actors which might or might not be running on the same system. For example, the nodemanager might schedule the execution of a job to power on a node (which is meant for the powermanager). The repository [baobab](https://github.com/freeflowuniverse/baobab) contains the logic for scheduling jobs. +Actors can schedule the execution of jobs for other actors which might or might not be running on the same system. For example, the nodemanager might schedule the execution of a job to power on a node (which is meant for the powermanager). The repository [baobab](https://github.com/incubaid/baobab) contains the logic for scheduling jobs. Jobs don't have to originate from the system running the farmerbot. It may as well be scheduled from another system (with another twin id). The job to find a suitable node for example will come from the TSClient (which is located on another system). These jobs will be send from the TSClient to the farmerbot via [RMB](https://github.com/threefoldtech/rmb-rs). diff --git a/lib/data/markdown/parsers/parse_doc.v b/lib/data/markdown/parsers/parse_doc.v index f46d6d26..6f1ba2eb 100644 --- a/lib/data/markdown/parsers/parse_doc.v +++ b/lib/data/markdown/parsers/parse_doc.v @@ -1,7 +1,7 @@ module parsers -import freeflowuniverse.herolib.data.markdown.elements -// import freeflowuniverse.herolib.ui.console +import incubaid.herolib.data.markdown.elements +// import incubaid.herolib.ui.console // DO NOT CHANGE THE WAY HOW THIS WORKS, THIS HAS BEEN DONE AS A STATEFUL PARSER BY DESIGN // THIS ALLOWS FOR EASY ADOPTIONS TO DIFFERENT RELIALITIES diff --git a/lib/data/markdown/parsers/parser_line.v b/lib/data/markdown/parsers/parser_line.v index d7be4c61..a8e74bb3 100644 --- a/lib/data/markdown/parsers/parser_line.v +++ b/lib/data/markdown/parsers/parser_line.v @@ -1,6 +1,6 @@ module parsers -import freeflowuniverse.herolib.data.markdown.elements +import incubaid.herolib.data.markdown.elements // is a line parser, useful to quickly parse a file in any format as long as it is line based // error while parsing diff --git a/lib/data/markdown/table_test.v b/lib/data/markdown/table_test.v index 4b9cc0ed..bf4d8326 100644 --- a/lib/data/markdown/table_test.v +++ b/lib/data/markdown/table_test.v @@ -1,6 +1,6 @@ module markdown -import freeflowuniverse.herolib.data.markdown.elements { Table } +import incubaid.herolib.data.markdown.elements { Table } fn test_table_no_rows_invalid() { mut content := ' diff --git a/lib/data/markdown/tools/min_header_test.v b/lib/data/markdown/tools/min_header_test.v index 9116b913..eba46069 100644 --- a/lib/data/markdown/tools/min_header_test.v +++ b/lib/data/markdown/tools/min_header_test.v @@ -1,7 +1,7 @@ module tools import os -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console fn test_markdown_min_header_basic() { txt := ' diff --git a/lib/data/markdownrenderer/readme.md b/lib/data/markdownrenderer/readme.md index e7b556c6..682d14b4 100644 --- a/lib/data/markdownrenderer/readme.md +++ b/lib/data/markdownrenderer/readme.md @@ -11,7 +11,7 @@ This module provides functionality for rendering Markdown content in various for ## Usage ```v -import freeflowuniverse.herolib.data.markdownrenderer +import incubaid.herolib.data.markdownrenderer // Example usage md_text := '# Hello World\n\nThis is a paragraph.' @@ -23,8 +23,6 @@ structure_output := markdownrenderer.to_structure(md_text) ## Dependencies This module depends on the V language Markdown parser: -https://github.com/vlang/markdown/tree/master + For more detailed information, refer to the individual renderer implementations in this module. - - diff --git a/lib/data/mnemonic/vnemonic.v b/lib/data/mnemonic/vnemonic.v index 744a9966..6c19e025 100644 --- a/lib/data/mnemonic/vnemonic.v +++ b/lib/data/mnemonic/vnemonic.v @@ -1,6 +1,6 @@ module mnemonic -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console #include "@VMODROOT/vnemonic.h" diff --git a/lib/data/models/hr/company.v b/lib/data/models/hr/company.v index 1eacbd21..fc455543 100644 --- a/lib/data/models/hr/company.v +++ b/lib/data/models/hr/company.v @@ -1,7 +1,7 @@ module hr -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.playbook +import incubaid.herolib.core.base +import incubaid.herolib.core.playbook pub struct Company { pub mut: diff --git a/lib/data/models/hr/country.v b/lib/data/models/hr/country.v index d3af079f..6cba896e 100644 --- a/lib/data/models/hr/country.v +++ b/lib/data/models/hr/country.v @@ -1,7 +1,7 @@ module hr -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.playbook +import incubaid.herolib.core.base +import incubaid.herolib.core.playbook pub enum CountryID { zanzibar diff --git a/lib/data/models/hr/hr.v b/lib/data/models/hr/hr.v index c2802931..3ef5a868 100644 --- a/lib/data/models/hr/hr.v +++ b/lib/data/models/hr/hr.v @@ -1,6 +1,6 @@ module hr -import freeflowuniverse.herolib.core.base +import incubaid.herolib.core.base pub struct HRData { pub mut: diff --git a/lib/data/models/hr/person.v b/lib/data/models/hr/person.v index fefc6012..8508a017 100644 --- a/lib/data/models/hr/person.v +++ b/lib/data/models/hr/person.v @@ -1,7 +1,7 @@ module hr -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.playbook +import incubaid.herolib.core.base +import incubaid.herolib.core.playbook pub struct Person { pub mut: diff --git a/lib/data/ourdb/README.md b/lib/data/ourdb/README.md index 2e7b1d19..b7b1d150 100644 --- a/lib/data/ourdb/README.md +++ b/lib/data/ourdb/README.md @@ -5,7 +5,7 @@ OurDB is a lightweight, efficient key-value database implementation in V that pr ## Usage Example ```v -import freeflowuniverse.herolib.data.ourdb +import incubaid.herolib.data.ourdb // Configure and create a new database instance mut db := ourdb.new( @@ -59,12 +59,14 @@ struct OurDBConfig { OurDB consists of three main components working together in a layered architecture: ### 1. Frontend (db.v) + - Provides the public API for database operations - Handles high-level operations (set, get, delete, history) - Coordinates between lookup and backend components - Supports both key-value and incremental ID modes ### 2. Lookup Table (lookup.v) + - Maps keys to physical locations in the backend storage - Supports both memory and disk-based lookup tables - Automatically optimizes key sizes based on database configuration @@ -72,6 +74,7 @@ OurDB consists of three main components working together in a layered architectu - Provides next ID generation for incremental mode ### 3. Backend Storage (backend.v) + - Manages the actual data storage in files - Handles data integrity with CRC32 checksums - Supports multiple file backends for large datasets @@ -118,20 +121,25 @@ OurDB consists of three main components working together in a layered architectu ## Implementation Details ### Record Format + Each record in the backend storage includes: + - 2 bytes: Data size - 4 bytes: CRC32 checksum - 6 bytes: Previous record location - N bytes: Actual data ### Lookup Table Optimization + The lookup table automatically optimizes its key size based on the database configuration: + - 2 bytes: For databases with < 65,536 records - 3 bytes: For databases with < 16,777,216 records - 4 bytes: For databases with < 4,294,967,296 records - 6 bytes: For large databases requiring multiple files ### File Management + - Supports splitting data across multiple files when needed - Each file is limited to 500MB by default (configurable) - Automatic file selection based on record location diff --git a/lib/data/ourdb/client.v b/lib/data/ourdb/client.v index a0c6ae3e..5fa3016d 100644 --- a/lib/data/ourdb/client.v +++ b/lib/data/ourdb/client.v @@ -1,7 +1,7 @@ module ourdb -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.httpconnection +import incubaid.herolib.ui.console +import incubaid.herolib.core.httpconnection import json pub struct OurDBClient { diff --git a/lib/data/ourdb_syncer/streamer/nodes.v b/lib/data/ourdb_syncer/streamer/nodes.v index 5d2e000a..919cd333 100644 --- a/lib/data/ourdb_syncer/streamer/nodes.v +++ b/lib/data/ourdb_syncer/streamer/nodes.v @@ -1,9 +1,9 @@ module streamer import time -import freeflowuniverse.herolib.clients.mycelium -import freeflowuniverse.herolib.data.ourdb -import freeflowuniverse.herolib.osal.core as osal +import incubaid.herolib.clients.mycelium +import incubaid.herolib.data.ourdb +import incubaid.herolib.osal.core as osal import encoding.base64 import json diff --git a/lib/data/ourdb_syncer/streamer/streamer.v b/lib/data/ourdb_syncer/streamer/streamer.v index 25b2eb02..32e78aec 100644 --- a/lib/data/ourdb_syncer/streamer/streamer.v +++ b/lib/data/ourdb_syncer/streamer/streamer.v @@ -1,7 +1,7 @@ module streamer -import freeflowuniverse.herolib.clients.mycelium -import freeflowuniverse.herolib.data.ourdb +import incubaid.herolib.clients.mycelium +import incubaid.herolib.data.ourdb import encoding.base64 import json import time diff --git a/lib/data/ourjson/ourjson.v b/lib/data/ourjson/ourjson.v index 10aae89d..c3f2e2a5 100644 --- a/lib/data/ourjson/ourjson.v +++ b/lib/data/ourjson/ourjson.v @@ -1,7 +1,7 @@ module ourjson import x.json2 -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.texttools const keep_ascii = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_-+={}[]"\':;!/>.<,|\\~` ' diff --git a/lib/data/ourtime/ourtime.v b/lib/data/ourtime/ourtime.v index be98ff0b..e37280f3 100644 --- a/lib/data/ourtime/ourtime.v +++ b/lib/data/ourtime/ourtime.v @@ -1,7 +1,7 @@ module ourtime import time -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console pub struct OurTime { pub mut: diff --git a/lib/data/ourtime/readme.md b/lib/data/ourtime/readme.md index 556a03fa..0e287444 100644 --- a/lib/data/ourtime/readme.md +++ b/lib/data/ourtime/readme.md @@ -16,7 +16,7 @@ The OurTime module provides a flexible and user-friendly way to work with time i ### Basic Usage ```v -import freeflowuniverse.herolib.data.ourtime +import incubaid.herolib.data.ourtime // Create time object for current time mut t := ourtime.now() @@ -36,6 +36,7 @@ println(t2.unix()) // Output: 1670271275 #### Relative Time Format Relative time expressions use the following period indicators: + - `s`: seconds - `h`: hours - `d`: days @@ -45,6 +46,7 @@ Relative time expressions use the following period indicators: - `Y`: years Examples: + ```v // Create time object with relative time mut t := ourtime.new('+1w +2d -4h')! // 1 week forward, 2 days forward, 4 hours back @@ -66,6 +68,7 @@ Supported date formats: - Also supports '/' instead of '-' for dates Examples: + ```v // Various absolute time formats t1 := ourtime.new('2022-12-05 20:14:35')! diff --git a/lib/data/ourtime/timetools_test.v b/lib/data/ourtime/timetools_test.v index 3dacbdbb..ffe27f0b 100644 --- a/lib/data/ourtime/timetools_test.v +++ b/lib/data/ourtime/timetools_test.v @@ -1,6 +1,6 @@ module ourtime -import freeflowuniverse.herolib.data.ourtime +import incubaid.herolib.data.ourtime import time // TODO: need to update the tests diff --git a/lib/data/paramsparser/jsonschema.v b/lib/data/paramsparser/jsonschema.v index 83cfd2da..68145303 100644 --- a/lib/data/paramsparser/jsonschema.v +++ b/lib/data/paramsparser/jsonschema.v @@ -1,6 +1,6 @@ module paramsparser -// import freeflowuniverse.herolib.data.jsonschema +// import incubaid.herolib.data.jsonschema // pub struct ParamsPub { // pub mut: diff --git a/lib/data/paramsparser/params_currency.v b/lib/data/paramsparser/params_currency.v index 5ee343dd..95d9dfc1 100644 --- a/lib/data/paramsparser/params_currency.v +++ b/lib/data/paramsparser/params_currency.v @@ -1,6 +1,6 @@ module paramsparser -import freeflowuniverse.herolib.data.currency +import incubaid.herolib.data.currency // TODO: fix if necessary // see currency object, gets it from params diff --git a/lib/data/paramsparser/params_export_import.v b/lib/data/paramsparser/params_export_import.v index 283428d7..912f118e 100644 --- a/lib/data/paramsparser/params_export_import.v +++ b/lib/data/paramsparser/params_export_import.v @@ -1,8 +1,8 @@ module paramsparser -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.texttools import crypto.sha256 -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console struct ParamExportItem { mut: diff --git a/lib/data/paramsparser/params_export_test.v b/lib/data/paramsparser/params_export_test.v index 68d5cc31..c4293476 100644 --- a/lib/data/paramsparser/params_export_test.v +++ b/lib/data/paramsparser/params_export_test.v @@ -1,7 +1,7 @@ module paramsparser import crypto.sha256 -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console const textin5 = " //this is first comment (line1) diff --git a/lib/data/paramsparser/params_get_kwargs.v b/lib/data/paramsparser/params_get_kwargs.v index 31a03fa8..23852147 100644 --- a/lib/data/paramsparser/params_get_kwargs.v +++ b/lib/data/paramsparser/params_get_kwargs.v @@ -1,6 +1,6 @@ module paramsparser -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.texttools import strconv // see if the kwarg with the key exists diff --git a/lib/data/paramsparser/params_getlist.v b/lib/data/paramsparser/params_getlist.v index ff3c2867..3100b26e 100644 --- a/lib/data/paramsparser/params_getlist.v +++ b/lib/data/paramsparser/params_getlist.v @@ -1,6 +1,6 @@ module paramsparser -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.texttools import strconv // Looks for a list of strings in the parameters. If it doesn't exist this function will return an error. Furthermore an error will be returned if the list is not properly formatted diff --git a/lib/data/paramsparser/params_gettime.v b/lib/data/paramsparser/params_gettime.v index 6ff4611f..47da9c49 100644 --- a/lib/data/paramsparser/params_gettime.v +++ b/lib/data/paramsparser/params_gettime.v @@ -1,7 +1,7 @@ module paramsparser -import freeflowuniverse.herolib.data.ourtime -// import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.data.ourtime +// import incubaid.herolib.core.texttools // import os import time { Duration } diff --git a/lib/data/paramsparser/params_gettime_test.v b/lib/data/paramsparser/params_gettime_test.v index 6215d1f2..a185a594 100644 --- a/lib/data/paramsparser/params_gettime_test.v +++ b/lib/data/paramsparser/params_gettime_test.v @@ -1,6 +1,6 @@ module paramsparser -import freeflowuniverse.herolib.data.ourtime +import incubaid.herolib.data.ourtime import time const testparams = Params{ diff --git a/lib/data/paramsparser/params_reflection.v b/lib/data/paramsparser/params_reflection.v index e8833b5e..395f0108 100644 --- a/lib/data/paramsparser/params_reflection.v +++ b/lib/data/paramsparser/params_reflection.v @@ -1,9 +1,9 @@ module paramsparser import time -import freeflowuniverse.herolib.data.ourtime +import incubaid.herolib.data.ourtime import v.reflection -// import freeflowuniverse.herolib.data.encoderhero +// import incubaid.herolib.data.encoderhero // TODO: support more field types pub fn (params Params) decode[T](args T) !T { diff --git a/lib/data/paramsparser/params_replace.v b/lib/data/paramsparser/params_replace.v index fa0f58cd..23a6c5d0 100644 --- a/lib/data/paramsparser/params_replace.v +++ b/lib/data/paramsparser/params_replace.v @@ -1,8 +1,8 @@ module paramsparser -import freeflowuniverse.herolib.core.texttools.regext -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.texttools.regext +import incubaid.herolib.core.texttools +import incubaid.herolib.ui.console // find parts of text in PARAM values which are of form {NAME}, and replace those . // . diff --git a/lib/data/paramsparser/params_resp.v b/lib/data/paramsparser/params_resp.v index cccb2b19..7272ddd6 100644 --- a/lib/data/paramsparser/params_resp.v +++ b/lib/data/paramsparser/params_resp.v @@ -1,6 +1,6 @@ module paramsparser -import freeflowuniverse.herolib.data.resp +import incubaid.herolib.data.resp // TODO: fix this. encoding some params and redecoding them does not work. diff --git a/lib/data/paramsparser/params_test.v b/lib/data/paramsparser/params_test.v index 034d4967..3916486d 100644 --- a/lib/data/paramsparser/params_test.v +++ b/lib/data/paramsparser/params_test.v @@ -1,8 +1,8 @@ module paramsparser -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.texttools import json -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console const textin = " id:a1 name6:aaaaa diff --git a/lib/data/paramsparser/parser.v b/lib/data/paramsparser/parser.v index 93829f02..ab7703b1 100644 --- a/lib/data/paramsparser/parser.v +++ b/lib/data/paramsparser/parser.v @@ -1,6 +1,6 @@ module paramsparser -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.texttools enum ParamStatus { start diff --git a/lib/data/paramsparser/readme.md b/lib/data/paramsparser/readme.md index 40352956..ad5d09b3 100644 --- a/lib/data/paramsparser/readme.md +++ b/lib/data/paramsparser/readme.md @@ -4,16 +4,16 @@ The `ParamsParser` module in V provides a robust and intuitive way to parse and ## Key Features -* **Flexible Parsing:** Supports key-value pairs, quoted values, and positional arguments. -* **Automatic Type Conversion:** Easily retrieve values as strings, integers, floats, booleans, and various list types. -* **Error Handling:** Integrates with V's error handling for reliable operations. -* **Case-Insensitive Keys:** Provides convenience by treating keys as case-insensitive. -* **Merging Capabilities:** Combine multiple parameter sets effortlessly. +* **Flexible Parsing:** Supports key-value pairs, quoted values, and positional arguments. +* **Automatic Type Conversion:** Easily retrieve values as strings, integers, floats, booleans, and various list types. +* **Error Handling:** Integrates with V's error handling for reliable operations. +* **Case-Insensitive Keys:** Provides convenience by treating keys as case-insensitive. +* **Merging Capabilities:** Combine multiple parameter sets effortlessly. ## Installation ```v -import freeflowuniverse.herolib.data.paramsparser +import incubaid.herolib.data.paramsparser ``` ## Basic Usage @@ -36,10 +36,10 @@ empty_params.set("price", "1200") The parser understands several common parameter formats: -* **Key-Value Pairs:** `key:value` (e.g., `name:John`) -* **Quoted Values:** `key:'value with spaces'` or `key:"value with spaces"` (essential for values containing spaces or special characters) -* **Positional Arguments:** `arg1 arg2` (values without an explicit key) -* **Comments:** `// this is a comment` (lines starting with `//` are ignored) +* **Key-Value Pairs:** `key:value` (e.g., `name:John`) +* **Quoted Values:** `key:'value with spaces'` or `key:"value with spaces"` (essential for values containing spaces or special characters) +* **Positional Arguments:** `arg1 arg2` (values without an explicit key) +* **Comments:** `// this is a comment` (lines starting with `//` are ignored) **Example:** @@ -80,8 +80,8 @@ completion := parsed_params.get_percentage("progress")! Boolean getters are flexible and interpret common truthy/falsy strings: -* `get_default_true(key string)`: Returns `true` if the value is empty, "1", "true", "y", or "yes". Otherwise, `false`. -* `get_default_false(key string)`: Returns `false` if the value is empty, "0", "false", "n", or "no". Otherwise, `true`. +* `get_default_true(key string)`: Returns `true` if the value is empty, "1", "true", "y", or "yes". Otherwise, `false`. +* `get_default_false(key string)`: Returns `false` if the value is empty, "0", "false", "n", or "no". Otherwise, `true`. ```v is_enabled := parsed_params.get_default_true("enable_feature") // "enable_feature:yes" -> true @@ -114,10 +114,10 @@ clean_tags := list_params.get_list_namefix("tags")! **Supported List Types:** -* `get_list()`: `[]string` -* `get_list_u8()`, `get_list_u16()`, `get_list_u32()`, `get_list_u64()`: Unsigned integer lists -* `get_list_i8()`, `get_list_i16()`, `get_list_int()`, `get_list_i64()`: Signed integer lists -* `get_list_f32()`, `get_list_f64()`: Floating-point lists +* `get_list()`: `[]string` +* `get_list_u8()`, `get_list_u16()`, `get_list_u32()`, `get_list_u64()`: Unsigned integer lists +* `get_list_i8()`, `get_list_i16()`, `get_list_int()`, `get_list_i64()`: Signed integer lists +* `get_list_f32()`, `get_list_f64()`: Floating-point lists Each list method also has a `_default` version (e.g., `get_list_int_default`) for providing fallback values. @@ -204,15 +204,15 @@ optional_value := params.get("optional_key") or { The parser adheres to the following rules for input strings: -* **Keys:** Must consist of alphanumeric characters, underscores (`_`), dots (`.`), and forward slashes (`/`). -* **Values:** Can contain any characters. -* **Spaces in Values:** Must be enclosed within single (`'`) or double (`"`) quotes. -* **Lists:** Supported with comma separation or square bracket notation. +* **Keys:** Must consist of alphanumeric characters, underscores (`_`), dots (`.`), and forward slashes (`/`). +* **Values:** Can contain any characters. +* **Spaces in Values:** Must be enclosed within single (`'`) or double (`"`) quotes. +* **Lists:** Supported with comma separation or square bracket notation. ## Best Practices for Usage -1. **Always Handle Errors:** Use `!` or `or {}` to manage potential parsing or conversion failures. -2. **Use Type-Specific Getters:** Prefer `get_int()`, `get_float()`, etc., when you know the expected data type for clarity and safety. -3. **Provide Default Values:** Utilize `_default` methods (e.g., `get_default`, `get_list_default`) to ensure your application behaves predictably when parameters are missing. -4. **Quote Values with Spaces:** Always enclose values containing spaces or special characters in quotes to ensure correct parsing. -5. **Consistent Key Naming:** While case-insensitive, using a consistent naming convention (e.g., `snake_case` or `camelCase`) for keys improves human readability and maintainability. +1. **Always Handle Errors:** Use `!` or `or {}` to manage potential parsing or conversion failures. +2. **Use Type-Specific Getters:** Prefer `get_int()`, `get_float()`, etc., when you know the expected data type for clarity and safety. +3. **Provide Default Values:** Utilize `_default` methods (e.g., `get_default`, `get_list_default`) to ensure your application behaves predictably when parameters are missing. +4. **Quote Values with Spaces:** Always enclose values containing spaces or special characters in quotes to ensure correct parsing. +5. **Consistent Key Naming:** While case-insensitive, using a consistent naming convention (e.g., `snake_case` or `camelCase`) for keys improves human readability and maintainability. diff --git a/lib/data/radixtree/README.md b/lib/data/radixtree/README.md index 68dbfbc2..c94603a0 100644 --- a/lib/data/radixtree/README.md +++ b/lib/data/radixtree/README.md @@ -15,6 +15,7 @@ A radix tree (also known as a patricia trie or radix trie) is a space-optimized ### Data Structure The radix tree is composed of nodes where: + - Each node stores a segment of a key (not just a single character) - Nodes can have multiple children, each representing a different branch - Leaf nodes contain the actual values @@ -33,6 +34,7 @@ mut: ### OurDB Integration The radix tree uses OurDB as its persistent storage backend: + - Each node is serialized and stored as a record in OurDB - Node references use OurDB record IDs - The tree maintains a root node ID for traversal @@ -41,27 +43,32 @@ The radix tree uses OurDB as its persistent storage backend: ### Key Operations #### Set (formerly Insertion) + 1. Traverse the tree following matching prefixes 2. Split nodes when partial matches are found 3. Create new nodes for unmatched segments 4. Update node values and references in OurDB #### Get (formerly Search) + 1. Start from the root node 2. Follow child nodes whose key segments match the search key 3. Return the value if an exact match is found at a leaf node #### List (formerly Search by Prefix) + 1. Start from the root node 2. Find all keys that start with the given prefix 3. Return a list of matching keys #### GetAll + 1. Find all keys that start with the given prefix using List 2. Retrieve the value for each matching key 3. Return a list of values for all matching keys #### Deletion + 1. Locate the node containing the key 2. Remove the value and leaf status 3. Clean up empty nodes if necessary @@ -70,7 +77,7 @@ The radix tree uses OurDB as its persistent storage backend: ## Usage Example ```v -import freeflowuniverse.herolib.data.radixtree +import incubaid.herolib.data.radixtree // Create a new radix tree mut tree := radixtree.new('/path/to/storage')! @@ -98,11 +105,13 @@ tree.delete('help')! ### Node Serialization Nodes are serialized in a compact binary format: + ``` [Version(1B)][KeySegment][ValueLength(2B)][Value][ChildrenCount(2B)][Children][IsLeaf(1B)] ``` Where each child is stored as: + ``` [KeyPart][NodeID(4B)] ``` @@ -110,6 +119,7 @@ Where each child is stored as: ### Space Optimization The radix tree optimizes space usage by: + 1. Sharing common prefixes between keys 2. Storing only key segments at each node instead of complete keys 3. Merging nodes with single children when possible @@ -125,6 +135,7 @@ The radix tree optimizes space usage by: ## Relationship with OurDB This radix tree implementation leverages OurDB's features: + - Persistent storage with automatic file management - Record-based storage with unique IDs - Data integrity through CRC32 checksums @@ -132,6 +143,7 @@ This radix tree implementation leverages OurDB's features: - Automatic file size management The integration provides: + - Durability: All tree operations are persisted - Consistency: Tree state is maintained across restarts - Efficiency: Leverages OurDB's optimized storage @@ -140,6 +152,7 @@ The integration provides: ## Use Cases Radix trees are particularly useful for: + - Prefix-based searching - IP routing tables - Dictionary implementations diff --git a/lib/data/radixtree/correctness_test.v b/lib/data/radixtree/correctness_test.v index 4b48edd6..d6222ea0 100644 --- a/lib/data/radixtree/correctness_test.v +++ b/lib/data/radixtree/correctness_test.v @@ -1,6 +1,6 @@ module radixtree -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console // Test for the critical bug: prefix-of-existing edge inserted after the longer key fn test_prefix_overlap_bug() ! { diff --git a/lib/data/radixtree/debug_deletion_test.v b/lib/data/radixtree/debug_deletion_test.v index f60b9f92..33a425d6 100644 --- a/lib/data/radixtree/debug_deletion_test.v +++ b/lib/data/radixtree/debug_deletion_test.v @@ -1,6 +1,6 @@ module radixtree -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console fn test_debug_deletion() ! { console.print_debug('Debug deletion test') diff --git a/lib/data/radixtree/debug_test.v b/lib/data/radixtree/debug_test.v index bceeda47..b373ff4a 100644 --- a/lib/data/radixtree/debug_test.v +++ b/lib/data/radixtree/debug_test.v @@ -1,6 +1,6 @@ module radixtree -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console fn test_simple_debug() ! { console.print_debug('=== Simple Debug Test ===') diff --git a/lib/data/radixtree/factory_test.v b/lib/data/radixtree/factory_test.v index 9b8e8536..22135ee3 100644 --- a/lib/data/radixtree/factory_test.v +++ b/lib/data/radixtree/factory_test.v @@ -1,6 +1,6 @@ module radixtree -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console fn test_basic_operations() ! { mut rt := new(path: '/tmp/radixtree_test', reset: true)! diff --git a/lib/data/radixtree/getall_test.v b/lib/data/radixtree/getall_test.v index 9221fa3f..99dd0c3d 100644 --- a/lib/data/radixtree/getall_test.v +++ b/lib/data/radixtree/getall_test.v @@ -1,6 +1,6 @@ module radixtree -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console fn test_getall() ! { // console.print_debug('Starting test_getall') diff --git a/lib/data/radixtree/prefix_test.v b/lib/data/radixtree/prefix_test.v index ac18c3b1..0e62d02d 100644 --- a/lib/data/radixtree/prefix_test.v +++ b/lib/data/radixtree/prefix_test.v @@ -1,6 +1,6 @@ module radixtree -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console fn test_list() ! { // console.print_debug('Starting test_list') diff --git a/lib/data/radixtree/radixtree.v b/lib/data/radixtree/radixtree.v index 6cdb3b1c..33c0fc6a 100644 --- a/lib/data/radixtree/radixtree.v +++ b/lib/data/radixtree/radixtree.v @@ -1,7 +1,7 @@ module radixtree -import freeflowuniverse.herolib.data.ourdb -// import freeflowuniverse.herolib.ui.console +import incubaid.herolib.data.ourdb +// import incubaid.herolib.ui.console // Represents a node in the radix tree struct Node { diff --git a/lib/data/radixtree/radixtree_debug.v b/lib/data/radixtree/radixtree_debug.v index b277902b..1824cd90 100644 --- a/lib/data/radixtree/radixtree_debug.v +++ b/lib/data/radixtree/radixtree_debug.v @@ -1,6 +1,6 @@ module radixtree -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console // Gets a node from the database by its ID pub fn (mut rt RadixTree) get_node_by_id(id u32) !Node { diff --git a/lib/data/radixtree/serialize.v b/lib/data/radixtree/serialize.v index 9e04421c..ce635436 100644 --- a/lib/data/radixtree/serialize.v +++ b/lib/data/radixtree/serialize.v @@ -1,6 +1,6 @@ module radixtree -import freeflowuniverse.herolib.data.encoder +import incubaid.herolib.data.encoder const version = u8(2) // Updated binary format version const max_inline_value_size = 1024 // Values larger than this are stored out-of-line diff --git a/lib/data/resp/resp_test.v b/lib/data/resp/resp_test.v index a21e2351..0c9719ae 100644 --- a/lib/data/resp/resp_test.v +++ b/lib/data/resp/resp_test.v @@ -1,6 +1,6 @@ module resp -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console fn print_val_to_check(s string) { console.print_debug(s.replace('\n', '\\\\n').replace('\r', '\\\\r')) diff --git a/lib/data/tst/serialize.v b/lib/data/tst/serialize.v index 944c3def..2307ff1d 100644 --- a/lib/data/tst/serialize.v +++ b/lib/data/tst/serialize.v @@ -1,6 +1,6 @@ module tst -import freeflowuniverse.herolib.data.encoder +import incubaid.herolib.data.encoder const version = u8(1) // Current binary format version diff --git a/lib/data/tst/tst.v b/lib/data/tst/tst.v index 2a4265d0..e379f4a9 100644 --- a/lib/data/tst/tst.v +++ b/lib/data/tst/tst.v @@ -1,6 +1,6 @@ module tst -import freeflowuniverse.herolib.data.ourdb +import incubaid.herolib.data.ourdb // Represents a node in the ternary search tree struct Node { diff --git a/lib/data/tst/tst_list.v b/lib/data/tst/tst_list.v index ef4ade09..a60038e0 100644 --- a/lib/data/tst/tst_list.v +++ b/lib/data/tst/tst_list.v @@ -1,6 +1,6 @@ module tst -import freeflowuniverse.herolib.data.ourdb +import incubaid.herolib.data.ourdb // Lists all keys with a given prefix pub fn (mut self TST) list(prefix string) ![]string { diff --git a/lib/data/verasure/README.md b/lib/data/verasure/README.md index e17aefcd..118f3a34 100644 --- a/lib/data/verasure/README.md +++ b/lib/data/verasure/README.md @@ -9,16 +9,16 @@ In V, there is a wrapper to make call pure-v style. ```v module main -import freeflowuniverse.herolib.data.verasure +import incubaid.herolib.data.verasure fn main() { - mut e := verasure.new(16, 4) - shards := e.encode("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer consectetur accumsan augue, at pharetra".bytes()) - println(shards) + mut e := verasure.new(16, 4) + shards := e.encode("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer consectetur accumsan augue, at pharetra".bytes()) + println(shards) - data := e.decode(shards) - println(data.len) - println(data.bytestr()) + data := e.decode(shards) + println(data.len) + println(data.bytestr()) } ``` diff --git a/lib/data/verasure/verasure.v b/lib/data/verasure/verasure.v index dce4bc2c..cc0e2b94 100644 --- a/lib/data/verasure/verasure.v +++ b/lib/data/verasure/verasure.v @@ -1,7 +1,7 @@ @[translated] module verasure -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console #include "@VMODROOT/jerasure-simple.h" diff --git a/lib/data/vstor/file.v b/lib/data/vstor/file.v index 81af2e43..c2e491da 100644 --- a/lib/data/vstor/file.v +++ b/lib/data/vstor/file.v @@ -1,6 +1,6 @@ module vstor -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib // the metadata as required for retrieving info from set of ZDB's // this is the metadata which needs to be kept, otherwise data cannot be retrieved diff --git a/lib/data/vstor/location.v b/lib/data/vstor/location.v index 6672396e..0500f285 100644 --- a/lib/data/vstor/location.v +++ b/lib/data/vstor/location.v @@ -1,6 +1,6 @@ module vstor -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib import time // TODO: define what is good way to specify a location, what do we have in TFChain diff --git a/lib/data/vstor/vstor.v b/lib/data/vstor/vstor.v index 43d217db..20891099 100644 --- a/lib/data/vstor/vstor.v +++ b/lib/data/vstor/vstor.v @@ -1,6 +1,6 @@ module vstor -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib import time pub struct VSTOR { diff --git a/lib/data/vstor/zdb.v b/lib/data/vstor/zdb.v index 0e4b0f42..ff4e2af1 100644 --- a/lib/data/vstor/zdb.v +++ b/lib/data/vstor/zdb.v @@ -1,6 +1,6 @@ module vstor -// import freeflowuniverse.herolib.core.pathlib +// import incubaid.herolib.core.pathlib // import time pub struct ZDB { diff --git a/lib/data/vstor/zdbstats.v b/lib/data/vstor/zdbstats.v index eab8bf4d..1107b67d 100644 --- a/lib/data/vstor/zdbstats.v +++ b/lib/data/vstor/zdbstats.v @@ -1,6 +1,6 @@ module vstor -// import freeflowuniverse.herolib.core.pathlib +// import incubaid.herolib.core.pathlib import time enum ZDBSTATUS { diff --git a/lib/dav/webdav/README.md b/lib/dav/webdav/README.md index ea4f07f9..b897ef1b 100644 --- a/lib/dav/webdav/README.md +++ b/lib/dav/webdav/README.md @@ -25,7 +25,7 @@ This project implements a WebDAV server using the `veb` framework and modules fr ```v -import freeflowuniverse.herolib.dav.webdav +import incubaid.herolib.dav.webdav mut app := webdav.new_app( root_dir: '/tmp/rootdir' // Directory to serve via WebDAV diff --git a/lib/dav/webdav/bin/main.v b/lib/dav/webdav/bin/main.v index e33c8f9a..0cb19703 100644 --- a/lib/dav/webdav/bin/main.v +++ b/lib/dav/webdav/bin/main.v @@ -1,4 +1,4 @@ -import freeflowuniverse.herolib.dav.webdav +import incubaid.herolib.dav.webdav import cli { Command, Flag } import os diff --git a/lib/dav/webdav/factory.v b/lib/dav/webdav/factory.v index cdda55ff..5b966392 100644 --- a/lib/dav/webdav/factory.v +++ b/lib/dav/webdav/factory.v @@ -1,8 +1,8 @@ module webdav import veb -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.vfs +import incubaid.herolib.ui.console +import incubaid.herolib.vfs @[heap] pub struct Server { diff --git a/lib/dav/webdav/factory_test.v b/lib/dav/webdav/factory_test.v index 2145b7f1..796c1d67 100644 --- a/lib/dav/webdav/factory_test.v +++ b/lib/dav/webdav/factory_test.v @@ -1,13 +1,13 @@ module webdav import net.http -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib import time -import freeflowuniverse.herolib.data.ourdb +import incubaid.herolib.data.ourdb import encoding.base64 import rand import os -import freeflowuniverse.herolib.vfs.vfs_db +import incubaid.herolib.vfs.vfs_db const testdata_path = os.join_path(os.dir(@FILE), 'testdata') const database_path = os.join_path(testdata_path, 'database') diff --git a/lib/dav/webdav/middleware_auth.v b/lib/dav/webdav/middleware_auth.v index 3408a6b3..606969e0 100644 --- a/lib/dav/webdav/middleware_auth.v +++ b/lib/dav/webdav/middleware_auth.v @@ -2,7 +2,7 @@ module webdav import time import encoding.base64 -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.texttools fn (server &Server) auth_middleware(mut ctx Context) bool { ctx.set_custom_header('Date', texttools.format_rfc1123(time.utc())) or { return false } diff --git a/lib/dav/webdav/middleware_headers.v b/lib/dav/webdav/middleware_headers.v index b25cb762..e3e337d1 100644 --- a/lib/dav/webdav/middleware_headers.v +++ b/lib/dav/webdav/middleware_headers.v @@ -1,6 +1,6 @@ module webdav -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console import log // fn add_dav_headers(mut ctx Context) bool { diff --git a/lib/dav/webdav/middleware_log.v b/lib/dav/webdav/middleware_log.v index 523a2f45..8b943c7f 100644 --- a/lib/dav/webdav/middleware_log.v +++ b/lib/dav/webdav/middleware_log.v @@ -1,6 +1,6 @@ module webdav -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console import log fn middleware_log_request(mut ctx Context) bool { diff --git a/lib/dav/webdav/model_propfind.v b/lib/dav/webdav/model_propfind.v index a399b52c..966d437c 100644 --- a/lib/dav/webdav/model_propfind.v +++ b/lib/dav/webdav/model_propfind.v @@ -2,9 +2,9 @@ module webdav import encoding.xml import log -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.vfs -import freeflowuniverse.herolib.vfs.vfs_db +import incubaid.herolib.core.pathlib +import incubaid.herolib.vfs +import incubaid.herolib.vfs.vfs_db import os import time import net.http diff --git a/lib/dav/webdav/server.v b/lib/dav/webdav/server.v index afcafedc..32612675 100644 --- a/lib/dav/webdav/server.v +++ b/lib/dav/webdav/server.v @@ -1,8 +1,8 @@ module webdav import time -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.ui.console import encoding.xml import net.urllib import net diff --git a/lib/dav/webdav/server_propfind.v b/lib/dav/webdav/server_propfind.v index 460b83d0..5494b592 100644 --- a/lib/dav/webdav/server_propfind.v +++ b/lib/dav/webdav/server_propfind.v @@ -2,12 +2,12 @@ module webdav import encoding.xml import log -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.vfs -import freeflowuniverse.herolib.vfs.vfs_db +import incubaid.herolib.core.pathlib +import incubaid.herolib.vfs +import incubaid.herolib.vfs.vfs_db import os import time -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.texttools import net.http import veb diff --git a/lib/dav/webdav/server_test.v b/lib/dav/webdav/server_test.v index 6914cc9b..46d580bd 100644 --- a/lib/dav/webdav/server_test.v +++ b/lib/dav/webdav/server_test.v @@ -1,7 +1,7 @@ module webdav -import freeflowuniverse.herolib.vfs.vfs_db -import freeflowuniverse.herolib.data.ourdb +import incubaid.herolib.vfs.vfs_db +import incubaid.herolib.data.ourdb import encoding.xml import os import time diff --git a/lib/develop/codetools/readme.md b/lib/develop/codetools/readme.md index 34bb8008..459a6d53 100644 --- a/lib/develop/codetools/readme.md +++ b/lib/develop/codetools/readme.md @@ -4,9 +4,9 @@ This directory contains various utilities and tools for code development. ## Available Tools -* `utils.v`: General utility functions. -* `vvet.v`: V language vetting tool. -* `vtest.v`: V language testing tool. +* `utils.v`: General utility functions. +* `vvet.v`: V language vetting tool. +* `vtest.v`: V language testing tool. ## Usage Examples @@ -15,14 +15,14 @@ This directory contains various utilities and tools for code development. To vet your Vlang code for common issues and best practices, you can use the `vvet.v` tool. ```v -import freeflowuniverse.herolib.core.develop.codetools { list_v_files } +import incubaid.herolib.core.develop.codetools { list_v_files } v run lib/develop/codetools/vvet.v your_file.v ``` - + ### Testing Vlang Code with `vtest.v` ```v -import freeflowuniverse.herolib.core.de.vlang_utils { list_v_files } +import incubaid.herolib.core.de.vlang_utils { list_v_files } v run lib/develop/codetools/vtest.v your_test_file.v To run tests for your Vlang code, use the `vtest.v` tool. @@ -42,4 +42,4 @@ import lib.develop.codetools.utils fn main() { // Example usage of a utility function println(utils.greet("World")) -} \ No newline at end of file +} diff --git a/lib/develop/codetools/vtest.v b/lib/develop/codetools/vtest.v index feca8205..80eea81b 100644 --- a/lib/develop/codetools/vtest.v +++ b/lib/develop/codetools/vtest.v @@ -1,7 +1,7 @@ module code -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.code.vlang_utils { list_v_files } +import incubaid.herolib.ui.console +import incubaid.herolib.core.code.vlang_utils { list_v_files } import os // ===== V LANGUAGE TOOLS ===== diff --git a/lib/develop/codetools/vvet.v b/lib/develop/codetools/vvet.v index 279112fa..423f899c 100644 --- a/lib/develop/codetools/vvet.v +++ b/lib/develop/codetools/vvet.v @@ -1,6 +1,6 @@ module code -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console import os // vet_file runs v vet on a single file diff --git a/lib/develop/codewalker/README.md b/lib/develop/codewalker/README.md index 1f79644a..1b940e03 100644 --- a/lib/develop/codewalker/README.md +++ b/lib/develop/codewalker/README.md @@ -12,7 +12,7 @@ The CodeWalker module provides functionality to walk through directories and cre ## Usage ```v -import freeflowuniverse.herolib.lib.lang.codewalker +import incubaid.herolib.lib.lang.codewalker mut cw := codewalker.new('/tmp/adir')! diff --git a/lib/develop/codewalker/codewalker.v b/lib/develop/codewalker/codewalker.v index 0fb56823..d0fd2d4e 100644 --- a/lib/develop/codewalker/codewalker.v +++ b/lib/develop/codewalker/codewalker.v @@ -1,6 +1,6 @@ module codewalker -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib pub struct CodeWalker { pub mut: diff --git a/lib/develop/codewalker/codewalker_test.v b/lib/develop/codewalker/codewalker_test.v index aa9730c0..3606d21e 100644 --- a/lib/develop/codewalker/codewalker_test.v +++ b/lib/develop/codewalker/codewalker_test.v @@ -1,7 +1,7 @@ module codewalker import os -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib fn test_parse_basic() { mut cw := new(CodeWalkerArgs{})! diff --git a/lib/develop/codewalker/filemap.v b/lib/develop/codewalker/filemap.v index e4e4d3fc..a95eb187 100644 --- a/lib/develop/codewalker/filemap.v +++ b/lib/develop/codewalker/filemap.v @@ -1,6 +1,6 @@ module codewalker -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib pub struct FileMap { pub mut: diff --git a/lib/develop/gittools/README.md b/lib/develop/gittools/README.md index 611b6578..99b5254b 100644 --- a/lib/develop/gittools/README.md +++ b/lib/develop/gittools/README.md @@ -1,6 +1,6 @@ # Git Tools Module -## GitTools HeroScript +## GitTools HeroScript ### `!!git.define` @@ -23,11 +23,11 @@ Clones a Git repository from a specified URL into the configured coderoot. ```heroscript !!git.clone - url: 'https://github.com/freeflowuniverse/test_repo.git' + url: 'https://github.com/incubaid/test_repo.git' pull: true // Optional: if true, pulls latest changes after cloning reset: false // Optional: if true, resets the repository before cloning/pulling - light: true // Optional: if true, clones only the last history (default: is from git structure as defined above) - recursive: false // Optional: if true, also clones submodules (default: false) + light: true // Optional: if true, clones only the last history (default: is from git structure as defined above) + recursive: false // Optional: if true, also clones submodules (default: false) ``` ### `!!git.repo_action` @@ -36,12 +36,12 @@ Performs various Git operations on an existing repository, the filter matches mo ```heroscript !!git.repo_action - filter: 'freeflowuniverse/test_repo' - action: 'pull' // pull, commit, push, reset, branch_create, branch_switch, tag_create, tag_switch, delete - message: 'feat: Added new feature' // Optional: for 'commit' action - branchname: 'feature-branch' // Optional: for 'branch_create' or 'branch_switch' actions - tagname: 'v1.0.0' // Optional: for 'tag_create' or 'tag_switch' actions - submodules: true // Optional: for 'pull' action, if true, also updates submodules + filter: 'incubaid/test_repo' + action: 'pull' // pull, commit, push, reset, branch_create, branch_switch, tag_create, tag_switch, delete + message: 'feat: Added new feature' // Optional: for 'commit' action + branchname: 'feature-branch' // Optional: for 'branch_create' or 'branch_switch' actions + tagname: 'v1.0.0' // Optional: for 'tag_create' or 'tag_switch' actions + submodules: true // Optional: for 'pull' action, if true, also updates submodules error_ignore: false // Optional: if true, ignores errors during the action and continue for the next repo ``` @@ -49,15 +49,15 @@ Performs various Git operations on an existing repository, the filter matches mo - `filter` (string, **required**): A substring to filter repositories by name or relative path. This can match multiple repositories. - `action` (string, **required**): The Git operation to perform. Valid values: - - `pull`: Pulls latest changes from the remote. - - `commit`: Commits staged changes. Requires `message`. - - `push`: Pushes local commits to the remote. - - `reset`: Resets all local changes (hard reset). - - `branch_create`: Creates a new branch. Requires `branchname`. - - `branch_switch`: Switches to an existing branch. Requires `branchname`. - - `tag_create`: Creates a new tag. Requires `tagname`. - - `tag_switch`: Switches to an existing tag. Requires `tagname`. - - `delete`: Deletes the local repository. + - `pull`: Pulls latest changes from the remote. + - `commit`: Commits staged changes. Requires `message`. + - `push`: Pushes local commits to the remote. + - `reset`: Resets all local changes (hard reset). + - `branch_create`: Creates a new branch. Requires `branchname`. + - `branch_switch`: Switches to an existing branch. Requires `branchname`. + - `tag_create`: Creates a new tag. Requires `tagname`. + - `tag_switch`: Switches to an existing tag. Requires `tagname`. + - `delete`: Deletes the local repository. ### `!!git.list` @@ -65,17 +65,17 @@ Lists known Git repositories managed by the `gittools` module. ```heroscript !!git.list - filter: 'my_project' // Optional: filter by repository name or path + filter: 'my_project' // Optional: filter by repository name or path reload: true //if true then will check the status of those repo's against the remote's ``` -### `!!git.reload` +### `!!git.reload` Forces a reload of all Git repositories in the cache, re-scanning the `coderoot` and updating their statuses. ```heroscript !!git.reload - filter: 'my_project' // Optional: filter by repository name or path + filter: 'my_project' // Optional: filter by repository name or path ``` ## Get a specific path starting from url @@ -83,12 +83,12 @@ Forces a reload of all Git repositories in the cache, re-scanning the `coderoot` below is powerful command, will get the repo, put on right location, you can force a pull or even reset everything ```v -import freeflowuniverse.herolib.develop.gittools -// path string -// git_url string -// git_reset bool -// git_root string -// git_pull bool +import incubaid.herolib.develop.gittools +// path string +// git_url string +// git_reset bool +// git_root string +// git_pull bool // currentdir bool // can use currentdir, if true, will use current directory as base path if not giturl or path specified mydocs_path:=gittools.path( pull:true, @@ -106,20 +106,20 @@ pub struct GitPathGetArgs { pub mut: someotherparams string // you can add other params here if you want //gittools will use these params to find the right path - path string - git_url string - git_reset bool - git_root string - git_pull bool + path string + git_url string + git_reset bool + git_root string + git_pull bool } pub fn something(args GitPathGetArgs) !string{ mut path := gittools.path(path: args.path, git_url: args.git_url, git_reset: args.git_reset, git_root: args.git_root, git_pull: args.git_pull)! - if !path.is_dir() { - return error('path is not a directory') - } - if path.file_exists('.site') { - move_site_to_collection(mut path)! - } + if !path.is_dir() { + return error('path is not a directory') + } + if path.file_exists('.site') { + move_site_to_collection(mut path)! + } return path.path } @@ -128,7 +128,7 @@ pub fn something(args GitPathGetArgs) !string{ ### Repository Management ```v -import freeflowuniverse.herolib.develop.gittools +import incubaid.herolib.develop.gittools // Initialize with code root directory mut gs := gittools.new(coderoot: '~/code')! @@ -256,19 +256,19 @@ pub mut: // GitStatus holds all live status information for a repository. pub struct GitStatus { pub mut: - // State from local and remote (`git fetch`) - branches map[string]string // branch name -> commit hash - tags map[string]string // tag name -> commit hash - - // Current local state - branch string // The current checked-out branch - tag string // The current checked-out tag (if any) - ahead int // Commits ahead of remote - behind int // Commits behind remote - - // Overall status - has_changes bool // True if there are uncommitted local changes - error string // Error message if any status update fails + // State from local and remote (`git fetch`) + branches map[string]string // branch name -> commit hash + tags map[string]string // tag name -> commit hash + + // Current local state + branch string // The current checked-out branch + tag string // The current checked-out tag (if any) + ahead int // Commits ahead of remote + behind int // Commits behind remote + + // Overall status + has_changes bool // True if there are uncommitted local changes + error string // Error message if any status update fails } ``` diff --git a/lib/develop/gittools/factory.v b/lib/develop/gittools/factory.v index f606e363..f97ec15c 100644 --- a/lib/develop/gittools/factory.v +++ b/lib/develop/gittools/factory.v @@ -1,8 +1,8 @@ module gittools import os -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.pathlib +import incubaid.herolib.ui.console __global ( gsinstances map[string]&GitStructure diff --git a/lib/develop/gittools/gitlocation.v b/lib/develop/gittools/gitlocation.v index e786a514..493e203b 100644 --- a/lib/develop/gittools/gitlocation.v +++ b/lib/develop/gittools/gitlocation.v @@ -1,6 +1,6 @@ module gittools -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib // GitLocation uniquely identifies a Git repository, its online URL, and its location in the filesystem. @[heap] diff --git a/lib/develop/gittools/gitlocation_test.v b/lib/develop/gittools/gitlocation_test.v index 2ba67bc3..bc72e09a 100644 --- a/lib/develop/gittools/gitlocation_test.v +++ b/lib/develop/gittools/gitlocation_test.v @@ -1,7 +1,7 @@ module gittools import os -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib fn test_gitlocation_from_url() { mut gs := GitStructure{} diff --git a/lib/develop/gittools/gitstructure.v b/lib/develop/gittools/gitstructure.v index 40374de5..77ec0813 100644 --- a/lib/develop/gittools/gitstructure.v +++ b/lib/develop/gittools/gitstructure.v @@ -1,8 +1,8 @@ module gittools import crypto.md5 -import freeflowuniverse.herolib.core.pathlib -// import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.pathlib +// import incubaid.herolib.ui.console import os import json diff --git a/lib/develop/gittools/gittools_do.v b/lib/develop/gittools/gittools_do.v index 48de0da1..6d018105 100644 --- a/lib/develop/gittools/gittools_do.v +++ b/lib/develop/gittools/gittools_do.v @@ -1,8 +1,8 @@ module gittools -import freeflowuniverse.herolib.ui as gui -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui as gui +import incubaid.herolib.core.pathlib +import incubaid.herolib.ui.console import os pub const gitcmds = 'clone,commit,pull,push,delete,reload,list,edit,sourcetree,path,exists' diff --git a/lib/develop/gittools/repos_get.v b/lib/develop/gittools/repos_get.v index e78f6e5f..ce9bb662 100644 --- a/lib/develop/gittools/repos_get.v +++ b/lib/develop/gittools/repos_get.v @@ -1,7 +1,7 @@ module gittools -// import freeflowuniverse.herolib.core.redisclient -import freeflowuniverse.herolib.ui.console +// import incubaid.herolib.core.redisclient +import incubaid.herolib.ui.console // import time // ReposGetArgs defines arguments to retrieve repositories from the git structure. diff --git a/lib/develop/gittools/repos_print.v b/lib/develop/gittools/repos_print.v index 35edcec5..2ac18350 100644 --- a/lib/develop/gittools/repos_print.v +++ b/lib/develop/gittools/repos_print.v @@ -1,6 +1,6 @@ module gittools -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console // Check and return the status of a repository (whether it needs a commit, pull, or push) fn get_repo_status(gr GitRepo) !string { diff --git a/lib/develop/gittools/repository.v b/lib/develop/gittools/repository.v index 49127f05..6b679561 100644 --- a/lib/develop/gittools/repository.v +++ b/lib/develop/gittools/repository.v @@ -1,8 +1,8 @@ // lib/develop/gittools/repository.v module gittools -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.osal.core as osal +import incubaid.herolib.ui.console +import incubaid.herolib.osal.core as osal import os // commit stages all changes and commits them with the provided message. diff --git a/lib/develop/gittools/repository_cache.v b/lib/develop/gittools/repository_cache.v index db44a757..c8fcd3ff 100644 --- a/lib/develop/gittools/repository_cache.v +++ b/lib/develop/gittools/repository_cache.v @@ -1,7 +1,7 @@ module gittools import json -import freeflowuniverse.herolib.core.redisclient +import incubaid.herolib.core.redisclient fn redis_get() &redisclient.Redis { mut redis_client := redisclient.core_get() or { panic(err) } diff --git a/lib/develop/gittools/repository_clone.v b/lib/develop/gittools/repository_clone.v index d5759747..793eac9a 100644 --- a/lib/develop/gittools/repository_clone.v +++ b/lib/develop/gittools/repository_clone.v @@ -1,8 +1,8 @@ module gittools -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console import os -// import freeflowuniverse.herolib.core.pathlib +// import incubaid.herolib.core.pathlib @[params] pub struct GitCloneArgs { diff --git a/lib/develop/gittools/repository_load.v b/lib/develop/gittools/repository_load.v index ef292133..fa71fd60 100644 --- a/lib/develop/gittools/repository_load.v +++ b/lib/develop/gittools/repository_load.v @@ -1,7 +1,7 @@ module gittools import time -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console // import os @[params] diff --git a/lib/develop/gittools/repository_utils.v b/lib/develop/gittools/repository_utils.v index 6c8caf24..5e0fa1c8 100644 --- a/lib/develop/gittools/repository_utils.v +++ b/lib/develop/gittools/repository_utils.v @@ -1,9 +1,9 @@ module gittools -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.develop.vscode -import freeflowuniverse.herolib.develop.sourcetree +import incubaid.herolib.core.pathlib +import incubaid.herolib.ui.console +import incubaid.herolib.develop.vscode +import incubaid.herolib.develop.sourcetree import os @[params] diff --git a/lib/develop/gittools/tests/gittools_test.v b/lib/develop/gittools/tests/gittools_test.v index d49cf7fd..02d081b0 100644 --- a/lib/develop/gittools/tests/gittools_test.v +++ b/lib/develop/gittools/tests/gittools_test.v @@ -1,7 +1,7 @@ module tests -import freeflowuniverse.herolib.develop.gittools -import freeflowuniverse.herolib.osal.core as osal +import incubaid.herolib.develop.gittools +import incubaid.herolib.osal.core as osal import os import time diff --git a/lib/develop/gittools/tests/setup.v b/lib/develop/gittools/tests/setup.v index 93c5528c..7c1920bb 100644 --- a/lib/develop/gittools/tests/setup.v +++ b/lib/develop/gittools/tests/setup.v @@ -1,6 +1,6 @@ module tests -import freeflowuniverse.herolib.osal.core as osal +import incubaid.herolib.osal.core as osal import os import time @@ -34,7 +34,7 @@ fn create_new_file(repo_path string) !string { fn setup_repo() !GittoolsTests { ts := GittoolsTests{ coderoot: '/tmp/code' - repo_url: 'https://github.com/freeflowuniverse/test_repo.git' + repo_url: 'https://github.com/incubaid/test_repo.git' } if os.exists(ts.coderoot) { diff --git a/lib/develop/heroprompt/heroprompt_child.v b/lib/develop/heroprompt/heroprompt_child.v index e57af3a7..6724631a 100644 --- a/lib/develop/heroprompt/heroprompt_child.v +++ b/lib/develop/heroprompt/heroprompt_child.v @@ -1,6 +1,6 @@ module heroprompt -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib import os pub struct HeropromptChild { diff --git a/lib/develop/heroprompt/heroprompt_factory_.v b/lib/develop/heroprompt/heroprompt_factory_.v index 57797d4e..2a474891 100644 --- a/lib/develop/heroprompt/heroprompt_factory_.v +++ b/lib/develop/heroprompt/heroprompt_factory_.v @@ -1,8 +1,8 @@ module heroprompt -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.base +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json __global ( diff --git a/lib/develop/heroprompt/heroprompt_model.v b/lib/develop/heroprompt/heroprompt_model.v index ef957903..0f5af171 100644 --- a/lib/develop/heroprompt/heroprompt_model.v +++ b/lib/develop/heroprompt/heroprompt_model.v @@ -1,7 +1,7 @@ module heroprompt import time -import freeflowuniverse.herolib.core.playbook +import incubaid.herolib.core.playbook pub const version = '0.0.0' const singleton = false diff --git a/lib/develop/heroprompt/heroprompt_workspace.v b/lib/develop/heroprompt/heroprompt_workspace.v index 95a6ac4b..ba98285d 100644 --- a/lib/develop/heroprompt/heroprompt_workspace.v +++ b/lib/develop/heroprompt/heroprompt_workspace.v @@ -3,8 +3,8 @@ module heroprompt import rand import time import os -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.develop.codewalker +import incubaid.herolib.core.pathlib +import incubaid.herolib.develop.codewalker // Selection API @[params] diff --git a/lib/develop/heroprompt/readme.md b/lib/develop/heroprompt/readme.md index 2b38b0eb..d2720d95 100644 --- a/lib/develop/heroprompt/readme.md +++ b/lib/develop/heroprompt/readme.md @@ -5,7 +5,7 @@ To get started ```v -import freeflowuniverse.herolib.develop.heroprompt +import incubaid.herolib.develop.heroprompt // Example Usage: diff --git a/lib/develop/luadns/factory.v b/lib/develop/luadns/factory.v index ad672c4a..5a3192ef 100644 --- a/lib/develop/luadns/factory.v +++ b/lib/develop/luadns/factory.v @@ -1,6 +1,6 @@ module luadns -import freeflowuniverse.herolib.develop.gittools +import incubaid.herolib.develop.gittools struct LuaDNS { pub mut: diff --git a/lib/develop/luadns/luadns.v b/lib/develop/luadns/luadns.v index 7f853db6..a6d45e93 100644 --- a/lib/develop/luadns/luadns.v +++ b/lib/develop/luadns/luadns.v @@ -1,7 +1,7 @@ module luadns -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.develop.gittools +import incubaid.herolib.core.pathlib +import incubaid.herolib.develop.gittools // returns the directory of the git repository for the dns pub fn (dns LuaDNS) directory() !pathlib.Path { diff --git a/lib/develop/luadns/parse.v b/lib/develop/luadns/parse.v index 1605b960..58a4304a 100644 --- a/lib/develop/luadns/parse.v +++ b/lib/develop/luadns/parse.v @@ -1,7 +1,7 @@ module luadns import os -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib fn parse_dns_configs(directory_path string) ![]DNSConfig { mut configs := []DNSConfig{} diff --git a/lib/develop/performance/README.md b/lib/develop/performance/README.md index 02a8516d..f37d9053 100644 --- a/lib/develop/performance/README.md +++ b/lib/develop/performance/README.md @@ -43,10 +43,11 @@ Display the recorded timeline: ## Dependencies - • Redis: Requires a Redis server for data storage. - • Redis Client: Uses freeflowuniverse.herolib.core.redisclient. + • Redis: Requires a Redis server for data storage. + • Redis Client: Uses incubaid.herolib.core.redisclient. ## Example + ``` mut timer := performance.new('example_process') @@ -61,4 +62,4 @@ timer.epoch_end() timer.timeline() ``` -This will output a detailed timeline with duration bars for each event. \ No newline at end of file +This will output a detailed timeline with duration bars for each event. diff --git a/lib/develop/performance/performance.v b/lib/develop/performance/performance.v index b8997f05..f91975f9 100644 --- a/lib/develop/performance/performance.v +++ b/lib/develop/performance/performance.v @@ -4,7 +4,7 @@ import arrays import time import sync import term // For color coding -import freeflowuniverse.herolib.core.redisclient +import incubaid.herolib.core.redisclient // Struct to represent a timer for measuring process performance @[noinit] diff --git a/lib/develop/sourcetree/readme.md b/lib/develop/sourcetree/readme.md index 29808e1c..861c0884 100644 --- a/lib/develop/sourcetree/readme.md +++ b/lib/develop/sourcetree/readme.md @@ -1,11 +1,11 @@ ## sourcetree ```v -import freeflowuniverse.herolib.develop.sourcetree +import incubaid.herolib.develop.sourcetree //will look for git in location if not found will give error sourcetree.open(path:"/tmp/something")! ``` -- if path not specified will chose current path \ No newline at end of file +- if path not specified will chose current path diff --git a/lib/develop/sourcetree/sourcetree.v b/lib/develop/sourcetree/sourcetree.v index 57e70000..00214c07 100644 --- a/lib/develop/sourcetree/sourcetree.v +++ b/lib/develop/sourcetree/sourcetree.v @@ -1,8 +1,8 @@ module sourcetree -import freeflowuniverse.herolib.osal.core as osal +import incubaid.herolib.osal.core as osal import os -// import freeflowuniverse.herolib.ui.console +// import incubaid.herolib.ui.console @[params] pub struct OpenArgs { diff --git a/lib/develop/vscode/readme.md b/lib/develop/vscode/readme.md index 80680bb5..6368d627 100644 --- a/lib/develop/vscode/readme.md +++ b/lib/develop/vscode/readme.md @@ -1,10 +1,10 @@ ## visual studio code ```v -import freeflowuniverse.herolib.develop.vscode +import incubaid.herolib.develop.vscode vscode.open(path:"/tmp/something")! ``` -- if path not specified will chose current path \ No newline at end of file +- if path not specified will chose current path diff --git a/lib/develop/vscode/vscode.v b/lib/develop/vscode/vscode.v index ae9c5656..400150b9 100644 --- a/lib/develop/vscode/vscode.v +++ b/lib/develop/vscode/vscode.v @@ -1,6 +1,6 @@ module vscode -import freeflowuniverse.herolib.osal.core as osal +import incubaid.herolib.osal.core as osal import os pub struct VSCodeHelper { diff --git a/lib/develop/vscode_extensions/ourdb/README.md b/lib/develop/vscode_extensions/ourdb/README.md index 710be471..1d299aeb 100644 --- a/lib/develop/vscode_extensions/ourdb/README.md +++ b/lib/develop/vscode_extensions/ourdb/README.md @@ -21,21 +21,21 @@ A Visual Studio Code extension for viewing OurDB files line by line. This extens ``` #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.develop.vscode_extensions.ourdb +import incubaid.herolib.develop.vscode_extensions.ourdb // This example shows how to use the ourdb module to install or uninstall the VSCode extension // Install the extension ourdb.install_extension() or { - eprintln('Failed to install extension: ${err}') - exit(1) + eprintln('Failed to install extension: ${err}') + exit(1) } // To uninstall, uncomment the following lines: /* ourdb.uninstall_extension() or { - eprintln('Failed to uninstall extension: ${err}') - exit(1) + eprintln('Failed to uninstall extension: ${err}') + exit(1) } @@ -91,6 +91,7 @@ The extension creates a dedicated output channel for logging: 3. You'll see detailed logs about the extension's activity, including file processing and any errors If you don't see "OurDB Viewer" in the dropdown, try: + - Restarting VSCode - Opening an .ourdb file (which should activate the extension) - Reinstalling the extension using the provided installation scripts @@ -108,6 +109,7 @@ The extension now includes a custom editor that can handle binary .ourdb files d ## File Format This extension reads OurDB files according to the following format: + - 2 bytes: Data size (little-endian) - 4 bytes: CRC32 checksum - 6 bytes: Previous record location @@ -124,6 +126,7 @@ To modify or enhance this extension: - Open an .ourdb file in the development window to test 3. Package using `vsce package` if you want to create a VSIX file: + ``` npm install -g @vscode/vsce vsce package diff --git a/lib/hero/crypt/age.v b/lib/hero/crypt/age.v index d98764eb..3d2f92cc 100644 --- a/lib/hero/crypt/age.v +++ b/lib/hero/crypt/age.v @@ -1,6 +1,6 @@ module crypt -import freeflowuniverse.herolib.data.resp +import incubaid.herolib.data.resp // Stateless AGE operations diff --git a/lib/hero/crypt/factory.v b/lib/hero/crypt/factory.v index 1a5d53b6..52b0f4c9 100644 --- a/lib/hero/crypt/factory.v +++ b/lib/hero/crypt/factory.v @@ -1,6 +1,6 @@ module crypt -import freeflowuniverse.herolib.core.redisclient +import incubaid.herolib.core.redisclient // AGEClient provides access to the Age encryption features in HeroDB pub struct AGEClient { diff --git a/lib/hero/crypt/readme.md b/lib/hero/crypt/readme.md index c8237e24..49bd9225 100644 --- a/lib/hero/crypt/readme.md +++ b/lib/hero/crypt/readme.md @@ -15,7 +15,7 @@ herodb --dir /path/to/data --port 6381 --encrypt --encryption-key yoursecretkey ## To start a db see -https://git.ourworld.tf/herocode/herodb + to do: @@ -29,7 +29,7 @@ hero git pull https://git.ourworld.tf/herocode/herodb ### Creating an AGE Client ```v -import freeflowuniverse.herolib.crypt.herocrypt +import incubaid.herolib.crypt.herocrypt // Connect to default Redis instance (127.0.0.1:6381) mut client := herocrypt.new_default()! @@ -137,13 +137,13 @@ println('Signature valid: ${is_valid}') ## Choosing Between Modes -### Use Stateless Mode When: +### Use Stateless Mode When - You want complete control over key management - You don't want the server to store any private keys - You need to use the same keys across multiple servers -### Use Key-Managed Mode When: +### Use Key-Managed Mode When - You want simpler client code (no need to manage keys) - You trust the server to securely store private keys @@ -188,5 +188,3 @@ signature := author_client.sign_with_named_key('document_author', document)! mut verifier_client := crypt.new_age_client()! is_authentic := verifier_client.verify_with_named_key('document_author', document, signature.signature)! ``` - - diff --git a/lib/hero/db/ai_instructions_hero_models.md b/lib/hero/db/ai_instructions_hero_models.md index 1138e25e..7373ae2b 100644 --- a/lib/hero/db/ai_instructions_hero_models.md +++ b/lib/hero/db/ai_instructions_hero_models.md @@ -24,14 +24,14 @@ Define your model struct with the following pattern: ```v @[heap] pub struct Calendar { - db.Base // Inherit from Base struct + db.Base // Inherit from Base struct pub mut: - // Add your specific fields here - title string - start_time i64 - end_time i64 - location string - attendees []string + // Add your specific fields here + title string + start_time i64 + end_time i64 + location string + attendees []string } ``` @@ -41,7 +41,7 @@ Implement a method to return the model's type name: ```v pub fn (self Calendar) type_name() string { - return 'calendar' + return 'calendar' } ``` @@ -51,11 +51,11 @@ Implement the `dump` method to serialize your struct's fields using the encoder: ```v pub fn (self Calendar) dump(mut e &encoder.Encoder) ! { - e.add_string(self.title) - e.add_i64(self.start_time) - e.add_i64(self.end_time) - e.add_string(self.location) - e.add_list_string(self.attendees) + e.add_string(self.title) + e.add_i64(self.start_time) + e.add_i64(self.end_time) + e.add_string(self.location) + e.add_list_string(self.attendees) } ``` @@ -65,11 +65,11 @@ Implement the `load` method to deserialize your struct's fields: ```v fn (mut self DBCalendar) load(mut o Calendar, mut e &encoder.Decoder) ! { - o.title = e.get_string()! - o.start_time = e.get_i64()! - o.end_time = e.get_i64()! - o.location = e.get_string()! - o.attendees = e.get_list_string()! + o.title = e.get_string()! + o.start_time = e.get_i64()! + o.end_time = e.get_i64()! + o.location = e.get_string()! + o.attendees = e.get_list_string()! } ``` @@ -81,11 +81,11 @@ Define a struct for creating new instances of your model: @[params] pub struct CalendarArg { pub mut: - title string @[required] - start_time i64 - end_time i64 - location string - attendees []string + title string @[required] + start_time i64 + end_time i64 + location string + attendees []string } ``` @@ -96,7 +96,7 @@ Create a database wrapper struct for your model: ```v pub struct DBCalendar { pub mut: - db &db.DB @[skip; str: skip] + db &db.DB @[skip; str: skip] } ``` @@ -107,8 +107,8 @@ Add your model to the ModelsFactory struct in `factory.v`: ```v pub struct ModelsFactory { pub mut: - messages DBCalendar - // ... other models + messages DBCalendar + // ... other models } ``` @@ -116,13 +116,13 @@ And initialize it in the `new()` function: ```v pub fn new() !ModelsFactory { - mut mydb := db.new()! - return ModelsFactory{ - messages: DBCalendar{ - db: &mydb - } - // ... initialize other models - } + mut mydb := db.new()! + return ModelsFactory{ + messages: DBCalendar{ + db: &mydb + } + // ... initialize other models + } } ``` @@ -131,6 +131,7 @@ pub fn new() !ModelsFactory { Use these methods for serialization/deserialization: ### Encoder (Serialization) + - `e.add_bool(val bool)` - `e.add_u8(val u8)` - `e.add_u16(val u16)` @@ -157,6 +158,7 @@ Use these methods for serialization/deserialization: - `e.add_list_string(val []string)` ### Decoder (Deserialization) + - `e.get_bool()!` - `e.get_u8()!` - `e.get_u16()!` @@ -185,55 +187,61 @@ Use these methods for serialization/deserialization: ## CRUD Methods Implementation ### Create New Instance + ```v pub fn (mut self DBCalendar) new(args CalendarArg) !Calendar { - mut o := Calendar{ - title: args.title - start_time: args.start_time - end_time: args.end_time - location: args.location - attendees: args.attendees - updated_at: ourtime.now().unix() - } - return o + mut o := Calendar{ + title: args.title + start_time: args.start_time + end_time: args.end_time + location: args.location + attendees: args.attendees + updated_at: ourtime.now().unix() + } + return o } ``` ### Save to Database + ```v pub fn (mut self DBCalendar) set(o Calendar) !Calendar { - return self.db.set[Calendar](o)! + return self.db.set[Calendar](o)! } ``` ### Retrieve from Database + ```v pub fn (mut self DBCalendar) get(id u32) !Calendar { - mut o, data := self.db.get_data[Calendar](id)! - mut e_decoder := encoder.decoder_new(data) - self.load(mut o, mut e_decoder)! - return o + mut o, data := self.db.get_data[Calendar](id)! + mut e_decoder := encoder.decoder_new(data) + self.load(mut o, mut e_decoder)! + return o } ``` ### Delete from Database + ```v pub fn (mut self DBCalendar) delete(id u32) ! { - self.db.delete[Calendar](id)! + self.db.delete[Calendar](id)! } ``` ### Check Existence + ```v pub fn (mut self DBCalendar) exist(id u32) !bool { - return self.db.exists[Calendar](id)! + return self.db.exists[Calendar](id)! } ``` ### List All Objects + ```v pub fn (mut self DBCalendar) list() ![]Calendar { - return self.db.list[Calendar]()!.map(self.get(it)!) + return self.db.list[Calendar]()!.map(self.get(it)!) } ``` @@ -244,18 +252,18 @@ Create a `.vsh` script in `examples/hero/heromodels/` to demonstrate usage: ```v #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.core.redisclient -import freeflowuniverse.herolib.hero.heromodels +import incubaid.herolib.core.redisclient +import incubaid.herolib.hero.heromodels mut mydb := heromodels.new()! // Create a new object mut o := mydb.calendar.new( - title: 'Meeting' - start_time: 1672531200 - end_time: 1672534800 - location: 'Conference Room' - attendees: ['john@example.com', 'jane@example.com'] + title: 'Meeting' + start_time: 1672531200 + end_time: 1672534800 + location: 'Conference Room' + attendees: ['john@example.com', 'jane@example.com'] )! // Save to database @@ -293,4 +301,4 @@ println('All objects: ${objects}') 7. Add model to `ModelsFactory` in `factory.v` 8. Implement CRUD methods 9. Create example usage script -10. Test the implementation with the example script \ No newline at end of file +10. Test the implementation with the example script diff --git a/lib/hero/db/core_methods.v b/lib/hero/db/core_methods.v index a355787c..04743625 100644 --- a/lib/hero/db/core_methods.v +++ b/lib/hero/db/core_methods.v @@ -1,7 +1,7 @@ module db -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.data.encoder pub fn (mut self DB) set[T](obj_ T) !T { // Get the next ID @@ -90,7 +90,7 @@ fn (mut self DB) db_name[T]() string { } pub fn (mut self DB) new_id() !u32 { - r:=u32(self.redis.incr('db:id')!) - assert r>0 + r := u32(self.redis.incr('db:id')!) + assert r > 0 return r } diff --git a/lib/hero/db/factory.v b/lib/hero/db/factory.v index b4dbdad1..3869c622 100644 --- a/lib/hero/db/factory.v +++ b/lib/hero/db/factory.v @@ -1,9 +1,9 @@ module db -import freeflowuniverse.herolib.core.redisclient +import incubaid.herolib.core.redisclient // Current time -// import freeflowuniverse.herolib.data.encoder +// import incubaid.herolib.data.encoder pub struct DB { pub mut: @@ -17,7 +17,7 @@ pub mut: } pub fn new(args DBArgs) !DB { - mut redisconnection := args.redis or {redisclient.core_get()!} + mut redisconnection := args.redis or { redisclient.core_get()! } return DB{ redis: redisconnection } diff --git a/lib/hero/herocluster/example/example.vsh b/lib/hero/herocluster/example/example.vsh index 59250d70..da512167 100755 --- a/lib/hero/herocluster/example/example.vsh +++ b/lib/hero/herocluster/example/example.vsh @@ -1,9 +1,9 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals run import crypto.ed25519 -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.redisclient -import freeflowuniverse.herolib.hero.herocluster +import incubaid.herolib.core.base +import incubaid.herolib.core.redisclient +import incubaid.herolib.hero.herocluster import os import rand diff --git a/lib/hero/herocluster/factory.v b/lib/hero/herocluster/factory.v index e9b99022..d9791f08 100644 --- a/lib/hero/herocluster/factory.v +++ b/lib/hero/herocluster/factory.v @@ -1,6 +1,6 @@ module herocluster -import freeflowuniverse.herolib.core.redisclient +import incubaid.herolib.core.redisclient import crypto.ed25519 import encoding.hex import time diff --git a/lib/hero/herofs/README.md b/lib/hero/herofs/README.md index 07638505..e6b7b1c8 100644 --- a/lib/hero/herofs/README.md +++ b/lib/hero/herofs/README.md @@ -5,6 +5,7 @@ HeroFS is a distributed filesystem implementation built on top of HeroDB (Redis- ## Overview HeroFS implements a filesystem structure where: + - **Fs**: Represents a filesystem as a top-level container - **FsDir**: Represents directories within a filesystem - **FsFile**: Represents files with support for multiple directory associations @@ -30,7 +31,7 @@ HeroFS is part of HeroLib and is automatically available when using HeroLib. To use HeroFS, you need to create a filesystem factory: ```v -import freeflowuniverse.herolib.hero.herofs +import incubaid.herolib.hero.herofs mut fs_factory := herofs.new()! ``` @@ -39,8 +40,8 @@ mut fs_factory := herofs.new()! ```v mut fs := fs_factory.fs.new( - name: 'my_filesystem' - quota_bytes: 1000000000 // 1GB quota + name: 'my_filesystem' + quota_bytes: 1000000000 // 1GB quota )! fs = fs_factory.fs.set(fs)! fs_id := fs.id @@ -51,17 +52,17 @@ fs_id := fs.id ```v // Create root directory mut root_dir := fs_factory.fs_dir.new( - name: 'root' - fs_id: fs_id - parent_id: 0 + name: 'root' + fs_id: fs_id + parent_id: 0 )! root_dir_id := fs_factory.fs_dir.set(root_dir)! // Create subdirectory mut sub_dir := fs_factory.fs_dir.new( - name: 'documents' - fs_id: fs_id - parent_id: root_dir_id + name: 'documents' + fs_id: fs_id + parent_id: root_dir_id )! sub_dir_id := fs_factory.fs_dir.set(sub_dir)! ``` @@ -71,8 +72,8 @@ sub_dir_id := fs_factory.fs_dir.set(sub_dir)! ```v // Create a blob with binary data mut blob := fs_factory.fs_blob.new( - data: content_bytes - mime_type: 'text/plain' + data: content_bytes + mime_type: 'text/plain' )! blob_id := fs_factory.fs_blob.set(blob)! ``` @@ -82,10 +83,10 @@ blob_id := fs_factory.fs_blob.set(blob)! ```v // Create a file mut file := fs_factory.fs_file.new( - name: 'example.txt' - fs_id: fs_id - directories: [root_dir_id] - blobs: [blob_id] + name: 'example.txt' + fs_id: fs_id + directories: [root_dir_id] + blobs: [blob_id] )! file_id := fs_factory.fs_file.set(file)! ``` @@ -95,11 +96,11 @@ file_id := fs_factory.fs_file.set(file)! ```v // Create a symbolic link to a file mut symlink := fs_factory.fs_symlink.new( - name: 'example_link.txt' - fs_id: fs_id - parent_id: root_dir_id - target_id: file_id - target_type: .file + name: 'example_link.txt' + fs_id: fs_id + parent_id: root_dir_id + target_id: file_id + target_type: .file )! symlink_id := fs_factory.fs_symlink.set(symlink)! ``` diff --git a/lib/hero/herofs/factory.v b/lib/hero/herofs/factory.v index e3385186..1e3e6bf4 100644 --- a/lib/hero/herofs/factory.v +++ b/lib/hero/herofs/factory.v @@ -1,8 +1,8 @@ // Replace the current content with: module herofs -import freeflowuniverse.herolib.hero.db -import freeflowuniverse.herolib.core.redisclient +import incubaid.herolib.hero.db +import incubaid.herolib.core.redisclient @[heap] pub struct FSFactory { diff --git a/lib/hero/herofs/fs.v b/lib/hero/herofs/fs.v index 025325ee..f79ec472 100644 --- a/lib/hero/herofs/fs.v +++ b/lib/hero/herofs/fs.v @@ -1,12 +1,11 @@ module herofs -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.hero.db -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.schemas.jsonrpc { Response, new_error, new_response, new_response_false, new_response_int, new_response_ok, new_response_true } -import freeflowuniverse.herolib.hero.user { UserRef } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.hero.db +import incubaid.herolib.schemas.jsonrpc { Response, new_error, new_response, new_response_false, new_response_int, new_response_ok, new_response_true } +import incubaid.herolib.hero.user { UserRef } +import incubaid.herolib.ui.console import json // Fs represents a filesystem, is the top level container for files and directories and symlinks, blobs are used over filesystems @@ -320,7 +319,6 @@ pub fn fs_handle(mut f FSFactory, rpcid int, servercontext map[string]string, us res := f.fs.list(args)! return new_response(rpcid, json.encode(res)) } - else { console.print_stderr('Method not found on fs: ${method}') return new_error(rpcid, diff --git a/lib/hero/herofs/fs_blob.v b/lib/hero/herofs/fs_blob.v index 5c4186db..4eee4a8f 100644 --- a/lib/hero/herofs/fs_blob.v +++ b/lib/hero/herofs/fs_blob.v @@ -1,11 +1,11 @@ module herofs import crypto.blake3 -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.hero.db -import freeflowuniverse.herolib.schemas.jsonrpc { Response, new_error, new_response, new_response_false, new_response_int, new_response_ok, new_response_true } -import freeflowuniverse.herolib.hero.user { UserRef } +import incubaid.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.hero.db +import incubaid.herolib.schemas.jsonrpc { Response, new_error, new_response, new_response_false, new_response_int, new_response_ok, new_response_true } +import incubaid.herolib.hero.user { UserRef } import json // FsBlob represents binary data up to 1MB diff --git a/lib/hero/herofs/fs_blob_membership.v b/lib/hero/herofs/fs_blob_membership.v index 672cd735..db7a09ec 100644 --- a/lib/hero/herofs/fs_blob_membership.v +++ b/lib/hero/herofs/fs_blob_membership.v @@ -1,10 +1,10 @@ module herofs -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.hero.db -import freeflowuniverse.herolib.schemas.jsonrpc { Response, new_error, new_response, new_response_false, new_response_int, new_response_ok, new_response_true } -import freeflowuniverse.herolib.hero.user { UserRef } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.data.encoder +import incubaid.herolib.hero.db +import incubaid.herolib.schemas.jsonrpc { Response, new_error, new_response, new_response_false, new_response_ok, new_response_true } +import incubaid.herolib.hero.user { UserRef } +import incubaid.herolib.ui.console import json // FsBlobMembership represents membership of a blob in one or more filesystems, the key is the hash of the blob @@ -290,4 +290,4 @@ pub fn fs_blob_membership_handle(mut f FSFactory, rpcid int, servercontext map[s ) } } -} \ No newline at end of file +} diff --git a/lib/hero/herofs/fs_blob_membership_test.v b/lib/hero/herofs/fs_blob_membership_test.v index 4d50bc1a..3fb8659f 100644 --- a/lib/hero/herofs/fs_blob_membership_test.v +++ b/lib/hero/herofs/fs_blob_membership_test.v @@ -1,6 +1,6 @@ module herofs -import freeflowuniverse.herolib.hero.herofs { new_test } +import incubaid.herolib.hero.herofs { new_test } fn test_cleanup() ! { delete_fs_test()! diff --git a/lib/hero/herofs/fs_blob_test.v b/lib/hero/herofs/fs_blob_test.v index 840366f1..ec409748 100644 --- a/lib/hero/herofs/fs_blob_test.v +++ b/lib/hero/herofs/fs_blob_test.v @@ -1,12 +1,12 @@ module herofs -import freeflowuniverse.herolib.hero.db -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.schemas.jsonrpc -import freeflowuniverse.herolib.hero.user +import incubaid.herolib.hero.db +import incubaid.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.schemas.jsonrpc +import incubaid.herolib.hero.user import json -import freeflowuniverse.herolib.hero.herofs { FsBlob } +import incubaid.herolib.hero.herofs { FsBlob } fn test_fs_blob_new() ! { mut factory := new_test()! diff --git a/lib/hero/herofs/fs_dir.v b/lib/hero/herofs/fs_dir.v index d027bf0d..63e26242 100644 --- a/lib/hero/herofs/fs_dir.v +++ b/lib/hero/herofs/fs_dir.v @@ -1,11 +1,11 @@ module herofs -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.hero.db -import freeflowuniverse.herolib.schemas.jsonrpc { Response, new_error, new_response, new_response_false, new_response_int, new_response_ok, new_response_true } -import freeflowuniverse.herolib.hero.user { UserRef } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.hero.db +import incubaid.herolib.schemas.jsonrpc { Response, new_error, new_response, new_response_false, new_response_int, new_response_ok, new_response_true } +import incubaid.herolib.hero.user { UserRef } +import incubaid.herolib.ui.console import json // FsDir represents a directory in a filesystem diff --git a/lib/hero/herofs/fs_dir_test.v b/lib/hero/herofs/fs_dir_test.v index 381d19b0..a5907893 100644 --- a/lib/hero/herofs/fs_dir_test.v +++ b/lib/hero/herofs/fs_dir_test.v @@ -1,13 +1,13 @@ module herofs -import freeflowuniverse.herolib.hero.db -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.schemas.jsonrpc -import freeflowuniverse.herolib.hero.user +import incubaid.herolib.hero.db +import incubaid.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.schemas.jsonrpc +import incubaid.herolib.hero.user import json // FsDir, FsDirArg, FsFileArg, MimeType, FsBlobArg are part of the same module, no need to import explicitly -// import freeflowuniverse.herolib.hero.herofs { FsDir, FsDirArg, FsFileArg, MimeType, FsBlobArg } +// import incubaid.herolib.hero.herofs { FsDir, FsDirArg, FsFileArg, MimeType, FsBlobArg } fn test_fs_dir_new() ! { mut factory := new_test()! @@ -17,10 +17,10 @@ fn test_fs_dir_new() ! { mut fs := db_fs.new_get_set(name: 'test_fs_dir_new')! mut args := FsDirArg{ - name: 'test_dir' + name: 'test_dir' description: 'Test directory for new function' - fs_id: fs.id - parent_id: fs.root_dir_id + fs_id: fs.id + parent_id: fs.root_dir_id } dir := db_fs_dir.new(args)! @@ -44,10 +44,10 @@ fn test_fs_dir_crud_operations() ! { root_dir := fs.root_dir()! mut args := FsDirArg{ - name: 'crud_dir' + name: 'crud_dir' description: 'CRUD Test Directory' - fs_id: fs.id - parent_id: root_dir.id + fs_id: fs.id + parent_id: root_dir.id } mut dir := db_fs_dir.new(args)! @@ -223,11 +223,18 @@ fn test_fs_dir_has_children() ! { root_dir.directories << file_dir.id root_dir = db_fs_dir.set(root_dir)! - mut blob_args := FsBlobArg{ data: 'Child File'.bytes() } + mut blob_args := FsBlobArg{ + data: 'Child File'.bytes() + } mut blob := db_fs_blob.new(blob_args)! blob = db_fs_blob.set(blob)! - mut file_args := FsFileArg{ name: 'child_file.txt', fs_id: fs.id, blobs: [blob.id], mime_type: .txt } + mut file_args := FsFileArg{ + name: 'child_file.txt' + fs_id: fs.id + blobs: [blob.id] + mime_type: .txt + } mut file := db_fs_file.new(file_args)! file = db_fs_file.set(file)! db_fs_file.add_to_directory(file.id, file_dir.id)! @@ -283,7 +290,7 @@ fn test_fs_dir_move() ! { new_parent_after_move := db_fs_dir.get(new_parent.id)! dir_to_move_after_move := db_fs_dir.get(dir_to_move.id)! - assert !(dir_to_move.id in root_dir_after_move.directories) + assert dir_to_move.id !in root_dir_after_move.directories assert dir_to_move.id in new_parent_after_move.directories assert dir_to_move_after_move.parent_id == new_parent.id @@ -298,8 +305,8 @@ fn test_fs_dir_description() ! { mut fs := db_fs.new_get_set(name: 'fs_dir_description_test')! mut args := FsDirArg{ - name: 'description_dir' - fs_id: fs.id + name: 'description_dir' + fs_id: fs.id parent_id: fs.root_dir_id } @@ -324,8 +331,8 @@ fn test_fs_dir_example() ! { mut fs := db_fs.new_get_set(name: 'fs_dir_example_test')! mut args := FsDirArg{ - name: 'example_dir' - fs_id: fs.id + name: 'example_dir' + fs_id: fs.id parent_id: fs.root_dir_id } @@ -360,4 +367,4 @@ fn test_fs_dir_example() ! { assert unknown_result == '{}' println('✓ FsDir example test passed!') -} \ No newline at end of file +} diff --git a/lib/hero/herofs/fs_file.v b/lib/hero/herofs/fs_file.v index 55d4a18d..aae4a27b 100644 --- a/lib/hero/herofs/fs_file.v +++ b/lib/hero/herofs/fs_file.v @@ -1,11 +1,11 @@ module herofs -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.hero.db -import freeflowuniverse.herolib.schemas.jsonrpc { Response, new_error, new_response, new_response_false, new_response_int, new_response_ok, new_response_true } -import freeflowuniverse.herolib.hero.user { UserRef } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.hero.db +import incubaid.herolib.schemas.jsonrpc { Response, new_error, new_response, new_response_false, new_response_int, new_response_ok, new_response_true } +import incubaid.herolib.hero.user { UserRef } +import incubaid.herolib.ui.console import json // FsFile represents a file in a filesystem diff --git a/lib/hero/herofs/fs_file_directory_test.v b/lib/hero/herofs/fs_file_directory_test.v index 606eca3a..a2ba6574 100644 --- a/lib/hero/herofs/fs_file_directory_test.v +++ b/lib/hero/herofs/fs_file_directory_test.v @@ -1,6 +1,6 @@ module herofs -import freeflowuniverse.herolib.hero.herofs +import incubaid.herolib.hero.herofs // Test that files are automatically added to directories when created fn test_file_creation_adds_to_directory() ! { diff --git a/lib/hero/herofs/fs_file_test.v b/lib/hero/herofs/fs_file_test.v index 16014f71..712985f1 100644 --- a/lib/hero/herofs/fs_file_test.v +++ b/lib/hero/herofs/fs_file_test.v @@ -1,14 +1,14 @@ module herofs -import freeflowuniverse.herolib.hero.db -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.schemas.jsonrpc -import freeflowuniverse.herolib.hero.user +import incubaid.herolib.hero.db +import incubaid.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.schemas.jsonrpc +import incubaid.herolib.hero.user import json import time // Added for time.sleep // FsFile, FsFileArg, MimeType, FsBlobArg are part of the same module, no need to import explicitly -// import freeflowuniverse.herolib.hero.herofs { FsFile, FsFileArg, MimeType, FsBlobArg } +// import incubaid.herolib.hero.herofs { FsFile, FsFileArg, MimeType, FsBlobArg } fn test_fs_file_new() ! { mut factory := new_test()! @@ -18,10 +18,10 @@ fn test_fs_file_new() ! { mut fs := db_fs.new_get_set(name: 'test_fs_file_new')! mut args := FsFileArg{ - name: 'test_file.txt' + name: 'test_file.txt' description: 'Test file for new function' - fs_id: fs.id - mime_type: .txt + fs_id: fs.id + mime_type: .txt } file := db_fs_file.new(args)! @@ -52,11 +52,11 @@ fn test_fs_file_crud_operations() ! { blob = db_fs_blob.set(blob)! mut args := FsFileArg{ - name: 'crud_file.txt' + name: 'crud_file.txt' description: 'CRUD Test File' - fs_id: fs.id - blobs: [blob.id] - mime_type: .txt + fs_id: fs.id + blobs: [blob.id] + mime_type: .txt } mut file := db_fs_file.new(args)! @@ -116,9 +116,9 @@ fn test_fs_file_add_to_directory() ! { blob = db_fs_blob.set(blob)! mut file_args := FsFileArg{ - name: 'dir_file.txt' - fs_id: fs.id - blobs: [blob.id] + name: 'dir_file.txt' + fs_id: fs.id + blobs: [blob.id] mime_type: .txt } mut file := db_fs_file.new(file_args)! @@ -140,19 +140,33 @@ fn test_fs_file_list() ! { mut fs := db_fs.new_get_set(name: 'fs_file_list_test')! - mut blob_args1 := FsBlobArg{ data: 'File 1'.bytes() } + mut blob_args1 := FsBlobArg{ + data: 'File 1'.bytes() + } mut blob1 := db_fs_blob.new(blob_args1)! blob1 = db_fs_blob.set(blob1)! - mut blob_args2 := FsBlobArg{ data: 'File 2'.bytes() } + mut blob_args2 := FsBlobArg{ + data: 'File 2'.bytes() + } mut blob2 := db_fs_blob.new(blob_args2)! blob2 = db_fs_blob.set(blob2)! - mut file_args1 := FsFileArg{ name: 'list_file1.txt', fs_id: fs.id, blobs: [blob1.id], mime_type: .txt } + mut file_args1 := FsFileArg{ + name: 'list_file1.txt' + fs_id: fs.id + blobs: [blob1.id] + mime_type: .txt + } mut file1 := db_fs_file.new(file_args1)! file1 = db_fs_file.set(file1)! - mut file_args2 := FsFileArg{ name: 'list_file2.txt', fs_id: fs.id, blobs: [blob2.id], mime_type: .txt } + mut file_args2 := FsFileArg{ + name: 'list_file2.txt' + fs_id: fs.id + blobs: [blob2.id] + mime_type: .txt + } mut file2 := db_fs_file.new(file_args2)! file2 = db_fs_file.set(file2)! @@ -174,11 +188,18 @@ fn test_fs_file_get_by_path() ! { mut fs := db_fs.new_get_set(name: 'get_by_path_fs')! root_dir := fs.root_dir()! - mut blob_args := FsBlobArg{ data: 'Path File'.bytes() } + mut blob_args := FsBlobArg{ + data: 'Path File'.bytes() + } mut blob := db_fs_blob.new(blob_args)! blob = db_fs_blob.set(blob)! - mut file_args := FsFileArg{ name: 'path_file.txt', fs_id: fs.id, blobs: [blob.id], mime_type: .txt } + mut file_args := FsFileArg{ + name: 'path_file.txt' + fs_id: fs.id + blobs: [blob.id] + mime_type: .txt + } mut file := db_fs_file.new(file_args)! file = db_fs_file.set(file)! @@ -201,19 +222,33 @@ fn test_fs_file_list_by_directory() ! { mut fs := db_fs.new_get_set(name: 'list_by_dir_fs')! root_dir := fs.root_dir()! - mut blob_args1 := FsBlobArg{ data: 'Dir File 1'.bytes() } + mut blob_args1 := FsBlobArg{ + data: 'Dir File 1'.bytes() + } mut blob1 := db_fs_blob.new(blob_args1)! blob1 = db_fs_blob.set(blob1)! - mut blob_args2 := FsBlobArg{ data: 'Dir File 2'.bytes() } + mut blob_args2 := FsBlobArg{ + data: 'Dir File 2'.bytes() + } mut blob2 := db_fs_blob.new(blob_args2)! blob2 = db_fs_blob.set(blob2)! - mut file_args1 := FsFileArg{ name: 'dir_file1.txt', fs_id: fs.id, blobs: [blob1.id], mime_type: .txt } + mut file_args1 := FsFileArg{ + name: 'dir_file1.txt' + fs_id: fs.id + blobs: [blob1.id] + mime_type: .txt + } mut file1 := db_fs_file.new(file_args1)! file1 = db_fs_file.set(file1)! - mut file_args2 := FsFileArg{ name: 'dir_file2.txt', fs_id: fs.id, blobs: [blob2.id], mime_type: .txt } + mut file_args2 := FsFileArg{ + name: 'dir_file2.txt' + fs_id: fs.id + blobs: [blob2.id] + mime_type: .txt + } mut file2 := db_fs_file.new(file_args2)! file2 = db_fs_file.set(file2)! @@ -237,19 +272,33 @@ fn test_fs_file_list_by_filesystem() ! { mut fs1 := db_fs.new_get_set(name: 'list_by_fs_1')! mut fs2 := db_fs.new_get_set(name: 'list_by_fs_2')! - mut blob_args1 := FsBlobArg{ data: 'FS1 File'.bytes() } + mut blob_args1 := FsBlobArg{ + data: 'FS1 File'.bytes() + } mut blob1 := db_fs_blob.new(blob_args1)! blob1 = db_fs_blob.set(blob1)! - mut blob_args2 := FsBlobArg{ data: 'FS2 File'.bytes() } + mut blob_args2 := FsBlobArg{ + data: 'FS2 File'.bytes() + } mut blob2 := db_fs_blob.new(blob_args2)! blob2 = db_fs_blob.set(blob2)! - mut file_args1 := FsFileArg{ name: 'fs1_file.txt', fs_id: fs1.id, blobs: [blob1.id], mime_type: .txt } + mut file_args1 := FsFileArg{ + name: 'fs1_file.txt' + fs_id: fs1.id + blobs: [blob1.id] + mime_type: .txt + } mut file1 := db_fs_file.new(file_args1)! file1 = db_fs_file.set(file1)! - mut file_args2 := FsFileArg{ name: 'fs2_file.txt', fs_id: fs2.id, blobs: [blob2.id], mime_type: .txt } + mut file_args2 := FsFileArg{ + name: 'fs2_file.txt' + fs_id: fs2.id + blobs: [blob2.id] + mime_type: .txt + } mut file2 := db_fs_file.new(file_args2)! file2 = db_fs_file.set(file2)! @@ -272,19 +321,33 @@ fn test_fs_file_list_by_mime_type() ! { mut fs := db_fs.new_get_set(name: 'list_by_mime_fs')! - mut blob_args1 := FsBlobArg{ data: 'Text File'.bytes() } + mut blob_args1 := FsBlobArg{ + data: 'Text File'.bytes() + } mut blob1 := db_fs_blob.new(blob_args1)! blob1 = db_fs_blob.set(blob1)! - mut blob_args2 := FsBlobArg{ data: 'Image File'.bytes() } + mut blob_args2 := FsBlobArg{ + data: 'Image File'.bytes() + } mut blob2 := db_fs_blob.new(blob_args2)! blob2 = db_fs_blob.set(blob2)! - mut file_args1 := FsFileArg{ name: 'text.txt', fs_id: fs.id, blobs: [blob1.id], mime_type: .txt } + mut file_args1 := FsFileArg{ + name: 'text.txt' + fs_id: fs.id + blobs: [blob1.id] + mime_type: .txt + } mut file1 := db_fs_file.new(file_args1)! file1 = db_fs_file.set(file1)! - mut file_args2 := FsFileArg{ name: 'image.png', fs_id: fs.id, blobs: [blob2.id], mime_type: .png } + mut file_args2 := FsFileArg{ + name: 'image.png' + fs_id: fs.id + blobs: [blob2.id] + mime_type: .png + } mut file2 := db_fs_file.new(file_args2)! file2 = db_fs_file.set(file2)! @@ -307,11 +370,18 @@ fn test_fs_file_update_accessed() ! { mut fs := db_fs.new_get_set(name: 'update_accessed_fs')! - mut blob_args := FsBlobArg{ data: 'Accessed File'.bytes() } + mut blob_args := FsBlobArg{ + data: 'Accessed File'.bytes() + } mut blob := db_fs_blob.new(blob_args)! blob = db_fs_blob.set(blob)! - mut file_args := FsFileArg{ name: 'accessed.txt', fs_id: fs.id, blobs: [blob.id], mime_type: .txt } + mut file_args := FsFileArg{ + name: 'accessed.txt' + fs_id: fs.id + blobs: [blob.id] + mime_type: .txt + } mut file := db_fs_file.new(file_args)! file = db_fs_file.set(file)! @@ -336,11 +406,18 @@ fn test_fs_file_update_metadata() ! { mut fs := db_fs.new_get_set(name: 'update_metadata_fs')! - mut blob_args := FsBlobArg{ data: 'Metadata File'.bytes() } + mut blob_args := FsBlobArg{ + data: 'Metadata File'.bytes() + } mut blob := db_fs_blob.new(blob_args)! blob = db_fs_blob.set(blob)! - mut file_args := FsFileArg{ name: 'metadata.txt', fs_id: fs.id, blobs: [blob.id], mime_type: .txt } + mut file_args := FsFileArg{ + name: 'metadata.txt' + fs_id: fs.id + blobs: [blob.id] + mime_type: .txt + } mut file := db_fs_file.new(file_args)! file = db_fs_file.set(file)! @@ -360,11 +437,18 @@ fn test_fs_file_rename() ! { mut fs := db_fs.new_get_set(name: 'rename_fs')! - mut blob_args := FsBlobArg{ data: 'Rename File'.bytes() } + mut blob_args := FsBlobArg{ + data: 'Rename File'.bytes() + } mut blob := db_fs_blob.new(blob_args)! blob = db_fs_blob.set(blob)! - mut file_args := FsFileArg{ name: 'old_name.txt', fs_id: fs.id, blobs: [blob.id], mime_type: .txt } + mut file_args := FsFileArg{ + name: 'old_name.txt' + fs_id: fs.id + blobs: [blob.id] + mime_type: .txt + } mut file := db_fs_file.new(file_args)! file = db_fs_file.set(file)! @@ -398,11 +482,18 @@ fn test_fs_file_move() ! { updated_root_dir_for_dir2.directories << dir2.id updated_root_dir_for_dir2 = db_fs_dir.set(updated_root_dir_for_dir2)! - mut blob_args := FsBlobArg{ data: 'Move File'.bytes() } + mut blob_args := FsBlobArg{ + data: 'Move File'.bytes() + } mut blob := db_fs_blob.new(blob_args)! blob = db_fs_blob.set(blob)! - mut file_args := FsFileArg{ name: 'move_file.txt', fs_id: fs.id, blobs: [blob.id], mime_type: .txt } + mut file_args := FsFileArg{ + name: 'move_file.txt' + fs_id: fs.id + blobs: [blob.id] + mime_type: .txt + } mut file := db_fs_file.new(file_args)! file = db_fs_file.set(file)! @@ -414,7 +505,7 @@ fn test_fs_file_move() ! { dir1_after_move := db_fs_dir.get(dir1.id)! dir2_after_move := db_fs_dir.get(dir2.id)! - assert !(file.id in dir1_after_move.files) + assert file.id !in dir1_after_move.files assert file.id in dir2_after_move.files println('✓ FsFile move test passed!') @@ -428,18 +519,27 @@ fn test_fs_file_append_blob() ! { mut fs := db_fs.new_get_set(name: 'append_blob_fs')! - mut blob_args1 := FsBlobArg{ data: 'Part 1'.bytes() } + mut blob_args1 := FsBlobArg{ + data: 'Part 1'.bytes() + } mut blob1 := db_fs_blob.new(blob_args1)! blob1 = db_fs_blob.set(blob1)! - mut file_args := FsFileArg{ name: 'append.txt', fs_id: fs.id, blobs: [blob1.id], mime_type: .txt } + mut file_args := FsFileArg{ + name: 'append.txt' + fs_id: fs.id + blobs: [blob1.id] + mime_type: .txt + } mut file := db_fs_file.new(file_args)! file = db_fs_file.set(file)! original_size := file.size_bytes assert file.blobs.len == 1 - mut blob_args2 := FsBlobArg{ data: 'Part 2'.bytes() } + mut blob_args2 := FsBlobArg{ + data: 'Part 2'.bytes() + } mut blob2 := db_fs_blob.new(blob_args2)! blob2 = db_fs_blob.set(blob2)! @@ -461,8 +561,8 @@ fn test_fs_file_description() ! { mut fs := db_fs.new_get_set(name: 'fs_file_description_test')! mut args := FsFileArg{ - name: 'description_file.txt' - fs_id: fs.id + name: 'description_file.txt' + fs_id: fs.id mime_type: .txt } @@ -487,8 +587,8 @@ fn test_fs_file_example() ! { mut fs := db_fs.new_get_set(name: 'fs_file_example_test')! mut args := FsFileArg{ - name: 'example_file.txt' - fs_id: fs.id + name: 'example_file.txt' + fs_id: fs.id mime_type: .txt } @@ -523,4 +623,4 @@ fn test_fs_file_example() ! { assert unknown_result == '{}' println('✓ FsFile example test passed!') -} \ No newline at end of file +} diff --git a/lib/hero/herofs/fs_symlink.v b/lib/hero/herofs/fs_symlink.v index 354b9666..e7b2f38b 100644 --- a/lib/hero/herofs/fs_symlink.v +++ b/lib/hero/herofs/fs_symlink.v @@ -1,11 +1,11 @@ module herofs -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.hero.db -import freeflowuniverse.herolib.schemas.jsonrpc { Response, new_error, new_response, new_response_false, new_response_int, new_response_ok, new_response_true } -import freeflowuniverse.herolib.hero.user { UserRef } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.hero.db +import incubaid.herolib.schemas.jsonrpc { Response, new_error, new_response, new_response_false, new_response_int, new_response_ok, new_response_true } +import incubaid.herolib.hero.user { UserRef } +import incubaid.herolib.ui.console import json // FsSymlink represents a symbolic link in a filesystem diff --git a/lib/hero/herofs/fs_test.v b/lib/hero/herofs/fs_test.v index d5af474e..d387d346 100644 --- a/lib/hero/herofs/fs_test.v +++ b/lib/hero/herofs/fs_test.v @@ -1,20 +1,20 @@ module herofs -import freeflowuniverse.herolib.hero.db -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.schemas.jsonrpc -import freeflowuniverse.herolib.hero.user +import incubaid.herolib.hero.db +import incubaid.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.schemas.jsonrpc +import incubaid.herolib.hero.user import json // Fs and FsArg are part of the same module, no need to import explicitly -// import freeflowuniverse.herolib.hero.herofs { Fs, FsArg } +// import incubaid.herolib.hero.herofs { Fs, FsArg } fn test_fs_new() ! { mut factory := new_test()! mut db_fs := factory.fs mut args := FsArg{ - name: 'test_fs_new' + name: 'test_fs_new' description: 'Test filesystem for new function' quota_bytes: 1000 } @@ -36,7 +36,7 @@ fn test_fs_new_get_set() ! { mut db_fs := factory.fs mut args1 := FsArg{ - name: 'test_fs_new_get_set' + name: 'test_fs_new_get_set' description: 'Test filesystem for new_get_set function' quota_bytes: 2000 } @@ -49,7 +49,7 @@ fn test_fs_new_get_set() ! { assert fs1.root_dir_id > 0 // Should be set after new_get_set mut args2 := FsArg{ - name: 'test_fs_new_get_set' + name: 'test_fs_new_get_set' description: 'Updated description' quota_bytes: 3000 } @@ -70,7 +70,7 @@ fn test_fs_crud_operations() ! { mut db_fs := factory.fs mut args := FsArg{ - name: 'crud_test_fs' + name: 'crud_test_fs' description: 'CRUD Test Filesystem' quota_bytes: 5000 } @@ -87,7 +87,7 @@ fn test_fs_crud_operations() ! { assert exists == true mut updated_args := FsArg{ - name: 'crud_test_fs' + name: 'crud_test_fs' description: 'Updated CRUD Test Filesystem' quota_bytes: 6000 } @@ -111,13 +111,13 @@ fn test_fs_list() ! { mut db_fs := factory.fs mut args1 := FsArg{ - name: 'fs_list_test_1' + name: 'fs_list_test_1' description: 'Filesystem for list test 1' } mut fs1 := db_fs.new_get_set(args1)! mut args2 := FsArg{ - name: 'fs_list_test_2' + name: 'fs_list_test_2' description: 'Filesystem for list test 2' } mut fs2 := db_fs.new_get_set(args2)! @@ -135,7 +135,7 @@ fn test_fs_get_by_name() ! { mut db_fs := factory.fs mut args := FsArg{ - name: 'fs_by_name' + name: 'fs_by_name' description: 'Filesystem for get_by_name test' } mut fs := db_fs.new_get_set(args)! @@ -152,9 +152,9 @@ fn test_fs_check_quota() ! { mut db_fs := factory.fs mut args := FsArg{ - name: 'fs_quota_test' + name: 'fs_quota_test' quota_bytes: 100 - used_bytes: 50 + used_bytes: 50 } mut fs := db_fs.new_get_set(args)! @@ -246,4 +246,4 @@ fn test_fs_example() ! { assert unknown_result == '{}' println('✓ Fs example test passed!') -} \ No newline at end of file +} diff --git a/lib/hero/herofs/fs_tools_cp.v b/lib/hero/herofs/fs_tools_cp.v index e7d94dc3..bdce0bdc 100644 --- a/lib/hero/herofs/fs_tools_cp.v +++ b/lib/hero/herofs/fs_tools_cp.v @@ -1,6 +1,6 @@ module herofs -import freeflowuniverse.herolib.hero.db +import incubaid.herolib.hero.db import os // CopyOptions provides options for copy operations @@ -25,7 +25,7 @@ pub mut: // fs.cp('/src/*.v', '/backup/', FindOptions{recursive: true}, CopyOptions{overwrite: true})! // ``` pub fn (mut self Fs) cp(src_path string, dest_path string, find_opts FindOptions, copy_opts CopyOptions) ! { - mut items := self.find(src_path, find_opts) or { + mut items := self.find(src_path, find_opts) or { // Try to get specific file, directory, or symlink by exact path mut direct_items := []FindResult{} @@ -54,210 +54,218 @@ pub fn (mut self Fs) cp(src_path string, dest_path string, find_opts FindOptions return error('Source path "${src_path}" not found') } direct_items - } + } - if items.len == 0 { - return error('No items found matching pattern: ${src_path}') - } + if items.len == 0 { + return error('No items found matching pattern: ${src_path}') + } - is_dest_dir := dest_path.ends_with('/') || self.get_dir_by_absolute_path(dest_path) or { FsDir{} } != FsDir{} + is_dest_dir := dest_path.ends_with('/') || self.get_dir_by_absolute_path(dest_path) or { + FsDir{} + } != FsDir{} - if items.len > 1 && !is_dest_dir { - return error('Cannot copy multiple items to a single file path: ${dest_path}') - } + if items.len > 1 && !is_dest_dir { + return error('Cannot copy multiple items to a single file path: ${dest_path}') + } - for item in items { - match item.result_type { - .file { - self.copy_file(item.id, dest_path, copy_opts)! - } - .directory { - if !copy_opts.recursive { - return error('Cannot copy directory "${item.path}" without recursive option') - } - self.copy_directory(item.id, dest_path, copy_opts)! - } - .symlink { - self.copy_symlink(item.id, dest_path, copy_opts)! - } - } - } + for item in items { + match item.result_type { + .file { + self.copy_file(item.id, dest_path, copy_opts)! + } + .directory { + if !copy_opts.recursive { + return error('Cannot copy directory "${item.path}" without recursive option') + } + self.copy_directory(item.id, dest_path, copy_opts)! + } + .symlink { + self.copy_symlink(item.id, dest_path, copy_opts)! + } + } + } } // copy_file copies a single file to a destination path fn (mut self Fs) copy_file(file_id u32, dest_path string, opts CopyOptions) ! { - original_file := self.factory.fs_file.get(file_id)! - - is_dest_dir := dest_path.ends_with('/') || self.get_dir_by_absolute_path(dest_path) or { FsDir{} } != FsDir{} - + original_file := self.factory.fs_file.get(file_id)! + + is_dest_dir := dest_path.ends_with('/') || self.get_dir_by_absolute_path(dest_path) or { + FsDir{} + } != FsDir{} + dest_dir_id := if is_dest_dir { self.factory.fs_dir.create_path(self.id, dest_path)! } else { self.factory.fs_dir.create_path(self.id, os.dir(dest_path))! } - - file_name := if is_dest_dir { original_file.name } else { os.file_name(dest_path) } + + file_name := if is_dest_dir { original_file.name } else { os.file_name(dest_path) } dest_dir := self.factory.fs_dir.get(dest_dir_id)! - if existing_file_id := self.find_file_in_dir(file_name, dest_dir) { - if !opts.overwrite { - return error('File "${file_name}" already exists in destination') - } - self.factory.fs_file.delete(existing_file_id)! - } + if existing_file_id := self.find_file_in_dir(file_name, dest_dir) { + if !opts.overwrite { + return error('File "${file_name}" already exists in destination') + } + self.factory.fs_file.delete(existing_file_id)! + } - mut new_blob_ids := []u32{} - if opts.copy_blobs { - for blob_id in original_file.blobs { - o_blob := self.factory.fs_blob.get(blob_id)! - mut n_blob := self.factory.fs_blob.new(data: o_blob.data)! - n_blob = self.factory.fs_blob.set(n_blob)! - new_blob_ids << n_blob.id - } - } else { - new_blob_ids = original_file.blobs.clone() - } + mut new_blob_ids := []u32{} + if opts.copy_blobs { + for blob_id in original_file.blobs { + o_blob := self.factory.fs_blob.get(blob_id)! + mut n_blob := self.factory.fs_blob.new(data: o_blob.data)! + n_blob = self.factory.fs_blob.set(n_blob)! + new_blob_ids << n_blob.id + } + } else { + new_blob_ids = original_file.blobs.clone() + } - mut new_file := self.factory.fs_file.new( - name: file_name, - fs_id: self.id, - blobs: new_blob_ids, - mime_type: original_file.mime_type, - metadata: original_file.metadata.clone(), - )! - new_file = self.factory.fs_file.set(new_file)! - self.factory.fs_file.add_to_directory(new_file.id, dest_dir_id)! + mut new_file := self.factory.fs_file.new( + name: file_name + fs_id: self.id + blobs: new_blob_ids + mime_type: original_file.mime_type + metadata: original_file.metadata.clone() + )! + new_file = self.factory.fs_file.set(new_file)! + self.factory.fs_file.add_to_directory(new_file.id, dest_dir_id)! } // copy_directory copies a directory and its contents recursively to a destination path fn (mut self Fs) copy_directory(dir_id u32, dest_path string, opts CopyOptions) ! { - original_dir := self.factory.fs_dir.get(dir_id)! + original_dir := self.factory.fs_dir.get(dir_id)! - is_dest_dir := dest_path.ends_with('/') || self.get_dir_by_absolute_path(dest_path) or { FsDir{} } != FsDir{} - - dest_dir_name := if is_dest_dir { original_dir.name } else { os.file_name(dest_path) } - - parent_dest_dir_id := if is_dest_dir { - self.factory.fs_dir.create_path(self.id, dest_path)! - } else { - self.factory.fs_dir.create_path(self.id, os.dir(dest_path))! - } + is_dest_dir := dest_path.ends_with('/') || self.get_dir_by_absolute_path(dest_path) or { + FsDir{} + } != FsDir{} + + dest_dir_name := if is_dest_dir { original_dir.name } else { os.file_name(dest_path) } + + parent_dest_dir_id := if is_dest_dir { + self.factory.fs_dir.create_path(self.id, dest_path)! + } else { + self.factory.fs_dir.create_path(self.id, os.dir(dest_path))! + } parent_dest_dir := self.factory.fs_dir.get(parent_dest_dir_id)! - if existing_dir_id := self.find_dir_in_dir(dest_dir_name, parent_dest_dir) { + if existing_dir_id := self.find_dir_in_dir(dest_dir_name, parent_dest_dir) { if opts.recursive { self.copy_directory_contents(dir_id, existing_dir_id, opts)! return } - if !opts.overwrite { - return error('Directory "${dest_dir_name}" already exists in destination') - } - self.factory.fs_dir.delete(existing_dir_id)! - } - - mut new_dir := self.factory.fs_dir.new( - name: dest_dir_name, - fs_id: self.id, - parent_id: parent_dest_dir_id, - description: original_dir.description, - )! - new_dir = self.factory.fs_dir.set(new_dir)! + if !opts.overwrite { + return error('Directory "${dest_dir_name}" already exists in destination') + } + self.factory.fs_dir.delete(existing_dir_id)! + } - mut parent_dir := self.factory.fs_dir.get(parent_dest_dir_id)! - if new_dir.id !in parent_dir.directories { - parent_dir.directories << new_dir.id - self.factory.fs_dir.set(parent_dir)! - } - - self.copy_directory_contents(dir_id, new_dir.id, opts)! + mut new_dir := self.factory.fs_dir.new( + name: dest_dir_name + fs_id: self.id + parent_id: parent_dest_dir_id + description: original_dir.description + )! + new_dir = self.factory.fs_dir.set(new_dir)! + + mut parent_dir := self.factory.fs_dir.get(parent_dest_dir_id)! + if new_dir.id !in parent_dir.directories { + parent_dir.directories << new_dir.id + self.factory.fs_dir.set(parent_dir)! + } + + self.copy_directory_contents(dir_id, new_dir.id, opts)! } // copy_directory_contents copies the contents of one directory to another fn (mut self Fs) copy_directory_contents(src_dir_id u32, dest_dir_id u32, opts CopyOptions) ! { - src_dir := self.factory.fs_dir.get(src_dir_id)! - - for file_id in src_dir.files { - self.copy_file(file_id, dest_dir_id.str(), opts)! - } + src_dir := self.factory.fs_dir.get(src_dir_id)! - for subdir_id in src_dir.directories { - self.copy_directory(subdir_id, dest_dir_id.str(), opts)! - } + for file_id in src_dir.files { + self.copy_file(file_id, dest_dir_id.str(), opts)! + } - for symlink_id in src_dir.symlinks { - self.copy_symlink(symlink_id, dest_dir_id.str(), opts)! - } + for subdir_id in src_dir.directories { + self.copy_directory(subdir_id, dest_dir_id.str(), opts)! + } + + for symlink_id in src_dir.symlinks { + self.copy_symlink(symlink_id, dest_dir_id.str(), opts)! + } } // copy_symlink copies a symbolic link to a destination path fn (mut self Fs) copy_symlink(symlink_id u32, dest_path string, opts CopyOptions) ! { - original_symlink := self.factory.fs_symlink.get(symlink_id)! - - is_dest_dir := dest_path.ends_with('/') || self.get_dir_by_absolute_path(dest_path) or { FsDir{} } != FsDir{} - + original_symlink := self.factory.fs_symlink.get(symlink_id)! + + is_dest_dir := dest_path.ends_with('/') || self.get_dir_by_absolute_path(dest_path) or { + FsDir{} + } != FsDir{} + dest_dir_id := if is_dest_dir { self.factory.fs_dir.create_path(self.id, dest_path)! } else { self.factory.fs_dir.create_path(self.id, os.dir(dest_path))! } - symlink_name := if is_dest_dir { original_symlink.name } else { os.file_name(dest_path) } + symlink_name := if is_dest_dir { original_symlink.name } else { os.file_name(dest_path) } dest_dir := self.factory.fs_dir.get(dest_dir_id)! - if existing_symlink_id := self.find_symlink_in_dir(symlink_name, dest_dir) { - if !opts.overwrite { - return error('Symlink "${symlink_name}" already exists') - } - self.factory.fs_symlink.delete(existing_symlink_id)! - } - - mut new_symlink := self.factory.fs_symlink.new( - name: symlink_name, - fs_id: self.id, - parent_id: dest_dir_id, - target_id: original_symlink.target_id, - target_type: original_symlink.target_type, - description: original_symlink.description, - )! - new_symlink = self.factory.fs_symlink.set(new_symlink)! + if existing_symlink_id := self.find_symlink_in_dir(symlink_name, dest_dir) { + if !opts.overwrite { + return error('Symlink "${symlink_name}" already exists') + } + self.factory.fs_symlink.delete(existing_symlink_id)! + } - mut parent := self.factory.fs_dir.get(dest_dir_id)! - parent.symlinks << new_symlink.id - self.factory.fs_dir.set(parent)! + mut new_symlink := self.factory.fs_symlink.new( + name: symlink_name + fs_id: self.id + parent_id: dest_dir_id + target_id: original_symlink.target_id + target_type: original_symlink.target_type + description: original_symlink.description + )! + new_symlink = self.factory.fs_symlink.set(new_symlink)! + + mut parent := self.factory.fs_dir.get(dest_dir_id)! + parent.symlinks << new_symlink.id + self.factory.fs_dir.set(parent)! } // find_file_in_dir finds a file in a directory by name and returns its ID fn (mut self Fs) find_file_in_dir(file_name string, dir FsDir) ?u32 { - for file_id in dir.files { - file := self.factory.fs_file.get(file_id) or { continue } - if file.name == file_name { - return file_id - } - } - return none + for file_id in dir.files { + file := self.factory.fs_file.get(file_id) or { continue } + if file.name == file_name { + return file_id + } + } + return none } // find_dir_in_dir finds a directory in a directory by name and returns its ID fn (mut self Fs) find_dir_in_dir(dir_name string, dir FsDir) ?u32 { - for did in dir.directories { - d := self.factory.fs_dir.get(did) or { continue } - if d.name == dir_name { - return did - } - } - return none + for did in dir.directories { + d := self.factory.fs_dir.get(did) or { continue } + if d.name == dir_name { + return did + } + } + return none } // find_symlink_in_dir finds a symlink in a directory by name and returns its ID fn (mut self Fs) find_symlink_in_dir(symlink_name string, dir FsDir) ?u32 { - for symlink_id in dir.symlinks { - symlink := self.factory.fs_symlink.get(symlink_id) or { continue } - if symlink.name == symlink_name { - return symlink_id - } - } - return none + for symlink_id in dir.symlinks { + symlink := self.factory.fs_symlink.get(symlink_id) or { continue } + if symlink.name == symlink_name { + return symlink_id + } + } + return none } // get_dir_path returns the absolute path for a given directory ID. @@ -279,4 +287,4 @@ pub fn (mut self Fs) get_dir_path(dir_id u32) !string { current_id = dir.parent_id } return if path == '' { '/' } else { path } -} \ No newline at end of file +} diff --git a/lib/hero/herofs/fs_tools_cp_test.v b/lib/hero/herofs/fs_tools_cp_test.v index dd21f84c..780f33b7 100644 --- a/lib/hero/herofs/fs_tools_cp_test.v +++ b/lib/hero/herofs/fs_tools_cp_test.v @@ -1,10 +1,10 @@ module herofs import os -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.hero.db -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.core.redisclient +import incubaid.herolib.data.ourtime +import incubaid.herolib.hero.db +import incubaid.herolib.data.encoder +import incubaid.herolib.core.redisclient fn test_cp_file() ! { mut fs := new_fs_test() or { panic(err) } @@ -17,9 +17,9 @@ fn test_cp_file() ! { mut blob := fs.factory.fs_blob.new(data: 'file content'.bytes())! blob = fs.factory.fs_blob.set(blob)! mut file := fs.factory.fs_file.new( - name: 'test_file.txt' - fs_id: fs.id - blobs: [blob.id] + name: 'test_file.txt' + fs_id: fs.id + blobs: [blob.id] mime_type: .txt )! file = fs.factory.fs_file.set(file)! @@ -50,9 +50,9 @@ fn test_cp_file_overwrite() ! { mut blob1 := fs.factory.fs_blob.new(data: 'original content'.bytes())! blob1 = fs.factory.fs_blob.set(blob1)! mut file1 := fs.factory.fs_file.new( - name: 'overwrite_file.txt' - fs_id: fs.id - blobs: [blob1.id] + name: 'overwrite_file.txt' + fs_id: fs.id + blobs: [blob1.id] mime_type: .txt )! file1 = fs.factory.fs_file.set(file1)! @@ -63,16 +63,16 @@ fn test_cp_file_overwrite() ! { mut blob_existing := fs.factory.fs_blob.new(data: 'existing content'.bytes())! blob_existing = fs.factory.fs_blob.set(blob_existing)! mut existing_file := fs.factory.fs_file.new( - name: 'overwrite_file.txt' - fs_id: fs.id - blobs: [blob_existing.id] + name: 'overwrite_file.txt' + fs_id: fs.id + blobs: [blob_existing.id] mime_type: .txt )! existing_file = fs.factory.fs_file.set(existing_file)! fs.factory.fs_file.add_to_directory(existing_file.id, dest_dir_id)! // 3. Copy the file with overwrite enabled - fs.cp('/src/overwrite_file.txt', '/dest/', FindOptions{}, CopyOptions{overwrite: true})! + fs.cp('/src/overwrite_file.txt', '/dest/', FindOptions{}, CopyOptions{ overwrite: true })! // 4. Verify the file is overwritten dest_dir := fs.factory.fs_dir.get(dest_dir_id)! @@ -93,9 +93,9 @@ fn test_cp_file_no_overwrite_error() ! { mut blob1 := fs.factory.fs_blob.new(data: 'original content'.bytes())! blob1 = fs.factory.fs_blob.set(blob1)! mut file1 := fs.factory.fs_file.new( - name: 'no_overwrite_file.txt' - fs_id: fs.id - blobs: [blob1.id] + name: 'no_overwrite_file.txt' + fs_id: fs.id + blobs: [blob1.id] mime_type: .txt )! file1 = fs.factory.fs_file.set(file1)! @@ -106,16 +106,16 @@ fn test_cp_file_no_overwrite_error() ! { mut blob_existing := fs.factory.fs_blob.new(data: 'existing content'.bytes())! blob_existing = fs.factory.fs_blob.set(blob_existing)! mut existing_file := fs.factory.fs_file.new( - name: 'no_overwrite_file.txt' - fs_id: fs.id - blobs: [blob_existing.id] + name: 'no_overwrite_file.txt' + fs_id: fs.id + blobs: [blob_existing.id] mime_type: .txt )! existing_file = fs.factory.fs_file.set(existing_file)! fs.factory.fs_file.add_to_directory(existing_file.id, dest_dir_id)! // 3. Attempt to copy the file without overwrite (should error) - fs.cp('/src/no_overwrite_file.txt', '/dest/', FindOptions{}, CopyOptions{overwrite: false}) or { + fs.cp('/src/no_overwrite_file.txt', '/dest/', FindOptions{}, CopyOptions{ overwrite: false }) or { assert err.msg().contains('already exists') return } @@ -135,9 +135,9 @@ fn test_cp_directory_recursive() ! { mut blob1 := fs.factory.fs_blob.new(data: 'file1 content'.bytes())! blob1 = fs.factory.fs_blob.set(blob1)! mut file1 := fs.factory.fs_file.new( - name: 'file1.txt' - fs_id: fs.id - blobs: [blob1.id] + name: 'file1.txt' + fs_id: fs.id + blobs: [blob1.id] mime_type: .txt )! file1 = fs.factory.fs_file.set(file1)! @@ -146,9 +146,9 @@ fn test_cp_directory_recursive() ! { mut blob2 := fs.factory.fs_blob.new(data: 'file2 content'.bytes())! blob2 = fs.factory.fs_blob.set(blob2)! mut file2 := fs.factory.fs_file.new( - name: 'file2.txt' - fs_id: fs.id - blobs: [blob2.id] + name: 'file2.txt' + fs_id: fs.id + blobs: [blob2.id] mime_type: .txt )! file2 = fs.factory.fs_file.set(file2)! @@ -158,7 +158,7 @@ fn test_cp_directory_recursive() ! { dest_root_id := fs.factory.fs_dir.create_path(fs.id, '/dest_root')! // 3. Copy source_root to dest_root recursively - fs.cp('/src_root', '/dest_root/', FindOptions{}, CopyOptions{recursive: true})! + fs.cp('/src_root', '/dest_root/', FindOptions{}, CopyOptions{ recursive: true })! // 4. Verify destination structure dest_root := fs.factory.fs_dir.get(dest_root_id)! @@ -183,9 +183,9 @@ fn test_cp_directory_merge_overwrite() ! { mut blob1 := fs.factory.fs_blob.new(data: 'src file content'.bytes())! blob1 = fs.factory.fs_blob.set(blob1)! mut file1 := fs.factory.fs_file.new( - name: 'file1.txt' - fs_id: fs.id - blobs: [blob1.id] + name: 'file1.txt' + fs_id: fs.id + blobs: [blob1.id] mime_type: .txt )! file1 = fs.factory.fs_file.set(file1)! @@ -196,9 +196,9 @@ fn test_cp_directory_merge_overwrite() ! { mut blob_existing := fs.factory.fs_blob.new(data: 'existing file content'.bytes())! blob_existing = fs.factory.fs_blob.set(blob_existing)! mut existing_file := fs.factory.fs_file.new( - name: 'file1.txt' // Same name as source file - fs_id: fs.id - blobs: [blob_existing.id] + name: 'file1.txt' // Same name as source file + fs_id: fs.id + blobs: [blob_existing.id] mime_type: .txt )! existing_file = fs.factory.fs_file.set(existing_file)! @@ -207,16 +207,16 @@ fn test_cp_directory_merge_overwrite() ! { mut blob_new_dest := fs.factory.fs_blob.new(data: 'new dest file content'.bytes())! blob_new_dest = fs.factory.fs_blob.set(blob_new_dest)! mut new_dest_file := fs.factory.fs_file.new( - name: 'file_only_in_dest.txt' - fs_id: fs.id - blobs: [blob_new_dest.id] + name: 'file_only_in_dest.txt' + fs_id: fs.id + blobs: [blob_new_dest.id] mime_type: .txt )! new_dest_file = fs.factory.fs_file.set(new_dest_file)! fs.factory.fs_file.add_to_directory(new_dest_file.id, dest_dir_id)! // 3. Copy source directory to destination with overwrite (should merge and overwrite file1.txt) - fs.cp('/src', '/dest', FindOptions{}, CopyOptions{recursive: true, overwrite: true})! + fs.cp('/src', '/dest', FindOptions{}, CopyOptions{ recursive: true, overwrite: true })! // 4. Verify destination contents dest_dir := fs.factory.fs_dir.get(dest_dir_id)! @@ -236,9 +236,9 @@ fn test_cp_file_to_non_existent_path() ! { mut blob := fs.factory.fs_blob.new(data: 'content'.bytes())! blob = fs.factory.fs_blob.set(blob)! mut file := fs.factory.fs_file.new( - name: 'source.txt' - fs_id: fs.id - blobs: [blob.id] + name: 'source.txt' + fs_id: fs.id + blobs: [blob.id] mime_type: .txt )! file = fs.factory.fs_file.set(file)! @@ -265,9 +265,9 @@ fn test_cp_symlink() ! { mut blob := fs.factory.fs_blob.new(data: 'target content'.bytes())! blob = fs.factory.fs_blob.set(blob)! mut target_file := fs.factory.fs_file.new( - name: 'target.txt' - fs_id: fs.id - blobs: [blob.id] + name: 'target.txt' + fs_id: fs.id + blobs: [blob.id] mime_type: .txt )! target_file = fs.factory.fs_file.set(target_file)! @@ -275,10 +275,10 @@ fn test_cp_symlink() ! { // 2. Create a source symlink mut symlink := fs.factory.fs_symlink.new( - name: 'link_to_target.txt' - fs_id: fs.id - parent_id: fs.root_dir_id - target_id: target_file.id + name: 'link_to_target.txt' + fs_id: fs.id + parent_id: fs.root_dir_id + target_id: target_file.id target_type: .file )! symlink = fs.factory.fs_symlink.set(symlink)! @@ -311,9 +311,9 @@ fn test_cp_symlink_overwrite() ! { mut blob := fs.factory.fs_blob.new(data: 'target content'.bytes())! blob = fs.factory.fs_blob.set(blob)! mut target_file := fs.factory.fs_file.new( - name: 'target.txt' - fs_id: fs.id - blobs: [blob.id] + name: 'target.txt' + fs_id: fs.id + blobs: [blob.id] mime_type: .txt )! target_file = fs.factory.fs_file.set(target_file)! @@ -321,10 +321,10 @@ fn test_cp_symlink_overwrite() ! { // 2. Create a source symlink mut symlink1 := fs.factory.fs_symlink.new( - name: 'link_to_target.txt' - fs_id: fs.id - parent_id: fs.root_dir_id - target_id: target_file.id + name: 'link_to_target.txt' + fs_id: fs.id + parent_id: fs.root_dir_id + target_id: target_file.id target_type: .file )! symlink1 = fs.factory.fs_symlink.set(symlink1)! @@ -335,19 +335,19 @@ fn test_cp_symlink_overwrite() ! { // 3. Create a destination directory and an existing symlink with the same name dest_dir_id := fs.factory.fs_dir.create_path(fs.id, '/dest')! mut other_target_file := fs.factory.fs_file.new( - name: 'other_target.txt' - fs_id: fs.id - blobs: [blob.id] + name: 'other_target.txt' + fs_id: fs.id + blobs: [blob.id] mime_type: .txt )! other_target_file = fs.factory.fs_file.set(other_target_file)! fs.factory.fs_file.add_to_directory(other_target_file.id, fs.root_dir_id)! mut existing_symlink := fs.factory.fs_symlink.new( - name: 'link_to_target.txt' - fs_id: fs.id - parent_id: dest_dir_id - target_id: other_target_file.id + name: 'link_to_target.txt' + fs_id: fs.id + parent_id: dest_dir_id + target_id: other_target_file.id target_type: .file )! existing_symlink = fs.factory.fs_symlink.set(existing_symlink)! @@ -356,7 +356,7 @@ fn test_cp_symlink_overwrite() ! { fs.factory.fs_dir.set(dest_dir)! // 4. Copy the symlink with overwrite enabled - fs.cp('/link_to_target.txt', '/dest/', FindOptions{}, CopyOptions{overwrite: true})! + fs.cp('/link_to_target.txt', '/dest/', FindOptions{}, CopyOptions{ overwrite: true })! // 5. Verify the symlink is overwritten dest_dir = fs.factory.fs_dir.get(dest_dir_id)! @@ -377,9 +377,9 @@ fn test_cp_file_copy_blobs_false() ! { mut blob := fs.factory.fs_blob.new(data: 'file content'.bytes())! blob = fs.factory.fs_blob.set(blob)! mut file := fs.factory.fs_file.new( - name: 'test_file.txt' - fs_id: fs.id - blobs: [blob.id] + name: 'test_file.txt' + fs_id: fs.id + blobs: [blob.id] mime_type: .txt )! file = fs.factory.fs_file.set(file)! @@ -389,7 +389,7 @@ fn test_cp_file_copy_blobs_false() ! { dest_dir_id := fs.factory.fs_dir.create_path(fs.id, '/dest')! // 3. Copy the file with copy_blobs set to false - fs.cp('/src/test_file.txt', '/dest/', FindOptions{}, CopyOptions{copy_blobs: false})! + fs.cp('/src/test_file.txt', '/dest/', FindOptions{}, CopyOptions{ copy_blobs: false })! // 4. Verify the file is copied and references the same blob dest_dir := fs.factory.fs_dir.get(dest_dir_id)! @@ -410,9 +410,9 @@ fn test_cp_file_copy_blobs_true() ! { mut blob := fs.factory.fs_blob.new(data: 'file content'.bytes())! blob = fs.factory.fs_blob.set(blob)! mut file := fs.factory.fs_file.new( - name: 'test_file.txt' - fs_id: fs.id - blobs: [blob.id] + name: 'test_file.txt' + fs_id: fs.id + blobs: [blob.id] mime_type: .txt )! file = fs.factory.fs_file.set(file)! @@ -422,7 +422,7 @@ fn test_cp_file_copy_blobs_true() ! { dest_dir_id := fs.factory.fs_dir.create_path(fs.id, '/dest')! // 3. Copy the file with copy_blobs set to true - fs.cp('/src/test_file.txt', '/dest/', FindOptions{}, CopyOptions{copy_blobs: true})! + fs.cp('/src/test_file.txt', '/dest/', FindOptions{}, CopyOptions{ copy_blobs: true })! // 4. Verify the file is copied and has a new blob dest_dir := fs.factory.fs_dir.get(dest_dir_id)! @@ -430,7 +430,7 @@ fn test_cp_file_copy_blobs_true() ! { copied_file := fs.factory.fs_file.get(dest_dir.files[0])! assert copied_file.name == 'test_file.txt' assert copied_file.blobs[0] != blob.id // Should have a new blob ID - + // Verify the content of the new blob is the same new_blob := fs.factory.fs_blob.get(copied_file.blobs[0])! assert new_blob.data == 'file content'.bytes() diff --git a/lib/hero/herofs/fs_tools_find_test.v b/lib/hero/herofs/fs_tools_find_test.v index f175d1ee..35a766a0 100644 --- a/lib/hero/herofs/fs_tools_find_test.v +++ b/lib/hero/herofs/fs_tools_find_test.v @@ -1,6 +1,6 @@ module herofs -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib import os fn test_find() { @@ -15,7 +15,7 @@ fn test_find() { mut blob1 := f.factory.fs_blob.new(data: 'hello'.bytes())! blob1 = f.factory.fs_blob.set(blob1)! mut file1 := f.factory.fs_file.new( - name: 'file1.txt' + name: 'file1.txt' fs_id: f.id blobs: [blob1.id] )! @@ -26,7 +26,7 @@ fn test_find() { mut blob2 := f.factory.fs_blob.new(data: 'world'.bytes())! blob2 = f.factory.fs_blob.set(blob2)! mut file2 := f.factory.fs_file.new( - name: 'file2.log' + name: 'file2.log' fs_id: f.id blobs: [blob2.id] )! @@ -36,7 +36,7 @@ fn test_find() { mut blob3 := f.factory.fs_blob.new(data: 'sub'.bytes())! blob3 = f.factory.fs_blob.set(blob3)! mut file3 := f.factory.fs_file.new( - name: 'file3.txt' + name: 'file3.txt' fs_id: f.id blobs: [blob3.id] )! @@ -45,10 +45,10 @@ fn test_find() { f.factory.fs_file.add_to_directory(file3.id, dir2.id)! mut symlink1 := f.factory.fs_symlink.new( - name: 'link1.txt' - fs_id: f.id - parent_id: dir1.id - target_id: file1.id + name: 'link1.txt' + fs_id: f.id + parent_id: dir1.id + target_id: file1.id target_type: .file )! symlink1 = f.factory.fs_symlink.set(symlink1)! @@ -115,4 +115,4 @@ fn test_find() { mut results_specific_dir := f.find('/test_dir/subdir', FindOptions{})! // should contain subdir and file3.txt assert results_specific_dir.len == 2 -} \ No newline at end of file +} diff --git a/lib/hero/herofs/fs_tools_import_export.v b/lib/hero/herofs/fs_tools_import_export.v index abe91459..b896ba13 100644 --- a/lib/hero/herofs/fs_tools_import_export.v +++ b/lib/hero/herofs/fs_tools_import_export.v @@ -1,7 +1,7 @@ module herofs import os -import freeflowuniverse.herolib.data.ourtime +import incubaid.herolib.data.ourtime // ImportOptions provides options for import operations @[params] diff --git a/lib/hero/herofs_server/README.md b/lib/hero/herofs_server/README.md index 08022e5b..2e4c798b 100644 --- a/lib/hero/herofs_server/README.md +++ b/lib/hero/herofs_server/README.md @@ -14,7 +14,7 @@ A comprehensive REST API server for the HeroFS distributed filesystem, built wit ## Quick Start ```v -import freeflowuniverse.herolib.hero.herofs_server +import incubaid.herolib.hero.herofs_server // Create and start server mut server := herofs_server.new( diff --git a/lib/hero/herofs_server/handlers_blob_symlink.v b/lib/hero/herofs_server/handlers_blob_symlink.v index cbd3eea6..ad68ad70 100644 --- a/lib/hero/herofs_server/handlers_blob_symlink.v +++ b/lib/hero/herofs_server/handlers_blob_symlink.v @@ -2,7 +2,7 @@ module herofs_server import veb import json -import freeflowuniverse.herolib.hero.herofs +import incubaid.herolib.hero.herofs // ============================================================================= // BLOB ENDPOINTS diff --git a/lib/hero/herofs_server/handlers_directory.v b/lib/hero/herofs_server/handlers_directory.v index 62bd7035..ec08744a 100644 --- a/lib/hero/herofs_server/handlers_directory.v +++ b/lib/hero/herofs_server/handlers_directory.v @@ -2,7 +2,7 @@ module herofs_server import veb import json -import freeflowuniverse.herolib.hero.herofs +import incubaid.herolib.hero.herofs // ============================================================================= // DIRECTORY ENDPOINTS diff --git a/lib/hero/herofs_server/handlers_file.v b/lib/hero/herofs_server/handlers_file.v index da1aecae..8fdfeb1c 100644 --- a/lib/hero/herofs_server/handlers_file.v +++ b/lib/hero/herofs_server/handlers_file.v @@ -2,7 +2,7 @@ module herofs_server import veb import json -import freeflowuniverse.herolib.hero.herofs +import incubaid.herolib.hero.herofs // ============================================================================= // FILE ENDPOINTS diff --git a/lib/hero/herofs_server/handlers_filesystem.v b/lib/hero/herofs_server/handlers_filesystem.v index cb85f482..90071445 100644 --- a/lib/hero/herofs_server/handlers_filesystem.v +++ b/lib/hero/herofs_server/handlers_filesystem.v @@ -2,7 +2,7 @@ module herofs_server import veb import json -import freeflowuniverse.herolib.hero.herofs +import incubaid.herolib.hero.herofs // ============================================================================= // FILESYSTEM ENDPOINTS diff --git a/lib/hero/herofs_server/handlers_tools.v b/lib/hero/herofs_server/handlers_tools.v index a9cbeae4..e3dcbed2 100644 --- a/lib/hero/herofs_server/handlers_tools.v +++ b/lib/hero/herofs_server/handlers_tools.v @@ -2,7 +2,7 @@ module herofs_server import veb import json -import freeflowuniverse.herolib.hero.herofs +import incubaid.herolib.hero.herofs // ============================================================================= // FILESYSTEM TOOLS ENDPOINTS diff --git a/lib/hero/herofs_server/middlewares.v b/lib/hero/herofs_server/middlewares.v index a5927e12..a5fd9edf 100644 --- a/lib/hero/herofs_server/middlewares.v +++ b/lib/hero/herofs_server/middlewares.v @@ -1,7 +1,7 @@ module herofs_server import net.http -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console // Request logging middleware pub fn (mut server FSServer) middleware_log_request(mut ctx Context) { diff --git a/lib/hero/herofs_server/server.v b/lib/hero/herofs_server/server.v index 74441b0a..3f39b9cd 100644 --- a/lib/hero/herofs_server/server.v +++ b/lib/hero/herofs_server/server.v @@ -1,9 +1,9 @@ module herofs_server import veb -import freeflowuniverse.herolib.hero.herofs -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.redisclient +import incubaid.herolib.hero.herofs +import incubaid.herolib.ui.console +import incubaid.herolib.core.redisclient // FSServer is the main server struct pub struct FSServer { @@ -29,7 +29,7 @@ pub mut: host string = 'localhost' cors_enabled bool = true allowed_origins []string = ['*'] - redis ?&redisclient.Redis + redis ?&redisclient.Redis } // Create a new filesystem server diff --git a/lib/hero/herofs_server/typescript_client/README.md b/lib/hero/herofs_server/typescript_client/README.md index 996ce5ca..df89ccdd 100644 --- a/lib/hero/herofs_server/typescript_client/README.md +++ b/lib/hero/herofs_server/typescript_client/README.md @@ -344,5 +344,5 @@ MIT License - see the LICENSE file for details. ## Related - [HeroFS Server Documentation](../README.md) -- [HeroLib Main Repository](https://github.com/freeflowuniverse/herolib) +- [HeroLib Main Repository](https://github.com/incubaid/herolib) - [HeroFS API Specification](../handlers_common.v) diff --git a/lib/hero/herofs_server/typescript_client/package.json b/lib/hero/herofs_server/typescript_client/package.json index 714a1a4a..5320f915 100644 --- a/lib/hero/herofs_server/typescript_client/package.json +++ b/lib/hero/herofs_server/typescript_client/package.json @@ -35,13 +35,13 @@ "license": "MIT", "repository": { "type": "git", - "url": "https://github.com/freeflowuniverse/herolib.git", + "url": "https://github.com/incubaid/herolib.git", "directory": "lib/hero/herofs_server/typescript_client" }, "bugs": { - "url": "https://github.com/freeflowuniverse/herolib/issues" + "url": "https://github.com/incubaid/herolib/issues" }, - "homepage": "https://github.com/freeflowuniverse/herolib/tree/main/lib/hero/herofs_server/typescript_client", + "homepage": "https://github.com/incubaid/herolib/tree/main/lib/hero/herofs_server/typescript_client", "engines": { "bun": ">=1.0.0" }, diff --git a/lib/hero/heromodels/calendar.v b/lib/hero/heromodels/calendar.v index d62e6ce1..f84949cf 100644 --- a/lib/hero/heromodels/calendar.v +++ b/lib/hero/heromodels/calendar.v @@ -1,11 +1,11 @@ module heromodels -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.hero.db -import freeflowuniverse.herolib.schemas.jsonrpc { Response, new_error, new_response, new_response_false, new_response_int, new_response_true } -import freeflowuniverse.herolib.hero.user { UserRef } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.hero.db +import incubaid.herolib.schemas.jsonrpc { Response, new_error, new_response, new_response_false, new_response_int, new_response_true } +import incubaid.herolib.hero.user { UserRef } +import incubaid.herolib.ui.console import json // Calendar represents a collection of events diff --git a/lib/hero/heromodels/calendar_event.v b/lib/hero/heromodels/calendar_event.v index 9d986512..d1cb5120 100644 --- a/lib/hero/heromodels/calendar_event.v +++ b/lib/hero/heromodels/calendar_event.v @@ -1,11 +1,11 @@ module heromodels -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.schemas.jsonrpc { Response, new_error, new_response, new_response_false, new_response_int, new_response_true } -import freeflowuniverse.herolib.hero.user { UserRef } +import incubaid.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.schemas.jsonrpc { Response, new_error, new_response, new_response_false, new_response_int, new_response_true } +import incubaid.herolib.hero.user { UserRef } import json -import freeflowuniverse.herolib.hero.db +import incubaid.herolib.hero.db // CalendarEvent represents a single event in a calendar @[heap] diff --git a/lib/hero/heromodels/calendar_event_test.v b/lib/hero/heromodels/calendar_event_test.v index 540afb45..f9f7e41d 100644 --- a/lib/hero/heromodels/calendar_event_test.v +++ b/lib/hero/heromodels/calendar_event_test.v @@ -1,6 +1,6 @@ module heromodels -import freeflowuniverse.herolib.hero.db +import incubaid.herolib.hero.db fn test_calendar_event_new() ! { // Initialize DBCalendarEvent for testing @@ -17,7 +17,7 @@ fn test_calendar_event_new() ! { start_time: '2025-01-01 10:00:00' end_time: '2025-01-01 11:00:00' attendees: []u32{} - docs: []u32{} + docs: []u32{} calendar_id: 1 status: .published is_all_day: false @@ -25,7 +25,7 @@ fn test_calendar_event_new() ! { color: '#0000FF' timezone: 'UTC' priority: .normal // Added missing priority field - is_template: false // Added missing is_template field + is_template: false // Added missing is_template field securitypolicy: 0 tags: []string{} messages: []db.MessageArg{} @@ -64,7 +64,7 @@ fn test_calendar_event_crud_operations() ! { start_time: '2025-01-01 10:00:00' end_time: '2025-01-01 11:00:00' attendees: []u32{} - docs: []u32{} + docs: []u32{} calendar_id: 1 status: .published is_all_day: false @@ -108,7 +108,7 @@ fn test_calendar_event_crud_operations() ! { start_time: '2025-01-01 12:00:00' end_time: '2025-01-01 13:00:00' attendees: []u32{} - docs: []u32{} + docs: []u32{} calendar_id: 2 status: .draft is_all_day: true @@ -122,7 +122,7 @@ fn test_calendar_event_crud_operations() ! { mut updated_event := db_calendar_event.new(updated_args)! updated_event.id = original_id - + updated_event = db_calendar_event.set(updated_event)! // Verify update @@ -163,7 +163,7 @@ fn test_calendar_event_attendees_encoding_decoding() ! { start_time: '2025-01-01 10:00:00' end_time: '2025-01-01 11:00:00' attendees: []u32{} - docs: []u32{} + docs: []u32{} calendar_id: 1 status: .published is_all_day: false @@ -189,7 +189,6 @@ fn test_calendar_event_attendees_encoding_decoding() ! { println('✓ CalendarEvent attendees encoding/decoding test passed!') } - fn test_calendar_event_registration_desks_encoding_decoding() ! { // Initialize DBCalendarEvent for testing mut mydb := db.new_test()! @@ -205,7 +204,7 @@ fn test_calendar_event_registration_desks_encoding_decoding() ! { start_time: '2025-01-01 10:00:00' end_time: '2025-01-01 11:00:00' attendees: []u32{} - docs: []u32{} + docs: []u32{} calendar_id: 1 status: .published is_all_day: false @@ -246,7 +245,7 @@ fn test_calendar_event_docs_encoding_decoding() ! { start_time: '2025-01-01 10:00:00' end_time: '2025-01-01 11:00:00' attendees: []u32{} - docs: []u32{} + docs: []u32{} calendar_id: 1 status: .published is_all_day: false @@ -287,7 +286,7 @@ fn test_calendar_event_type_name() ! { start_time: '2025-01-01 10:00:00' end_time: '2025-01-01 11:00:00' attendees: []u32{} - docs: []u32{} + docs: []u32{} calendar_id: 1 status: .published is_all_day: false @@ -323,7 +322,7 @@ fn test_calendar_event_description() ! { start_time: '2025-01-01 10:00:00' end_time: '2025-01-01 11:00:00' attendees: []u32{} - docs: []u32{} + docs: []u32{} calendar_id: 1 status: .published is_all_day: false @@ -363,7 +362,7 @@ fn test_calendar_event_example() ! { start_time: '2025-01-01 10:00:00' end_time: '2025-01-01 11:00:00' attendees: []u32{} - docs: []u32{} + docs: []u32{} calendar_id: 1 status: .published is_all_day: false diff --git a/lib/hero/heromodels/chat_group.v b/lib/hero/heromodels/chat_group.v index b675b7a6..7990a2ab 100644 --- a/lib/hero/heromodels/chat_group.v +++ b/lib/hero/heromodels/chat_group.v @@ -1,10 +1,10 @@ module heromodels -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.hero.db -import freeflowuniverse.herolib.schemas.jsonrpc { Response, new_error, new_response, new_response_false, new_response_int, new_response_true } -import freeflowuniverse.herolib.hero.user { UserRef } +import incubaid.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.hero.db +import incubaid.herolib.schemas.jsonrpc { Response, new_error, new_response, new_response_false, new_response_int, new_response_true } +import incubaid.herolib.hero.user { UserRef } import json // ChatGroup represents a chat channel or conversation diff --git a/lib/hero/heromodels/chat_group_test.v b/lib/hero/heromodels/chat_group_test.v index 10c89a20..01009e11 100644 --- a/lib/hero/heromodels/chat_group_test.v +++ b/lib/hero/heromodels/chat_group_test.v @@ -1,6 +1,6 @@ module heromodels -import freeflowuniverse.herolib.hero.db +import incubaid.herolib.hero.db fn test_chat_group_new() ! { // Initialize DBChatGroup for testing @@ -15,7 +15,7 @@ fn test_chat_group_new() ! { description: 'Test chat group for unit testing' chat_type: .public_channel last_activity: 1678886400 - is_archived: false + is_archived: false group_id: 1 securitypolicy: 0 tags: []string{} @@ -48,7 +48,7 @@ fn test_chat_group_crud_operations() ! { description: 'Test chat group for CRUD operations' chat_type: .private_channel last_activity: 1678886400 - is_archived: false + is_archived: false group_id: 2 securitypolicy: 0 tags: []string{} @@ -81,7 +81,7 @@ fn test_chat_group_crud_operations() ! { description: 'Updated test chat group' chat_type: .direct_message last_activity: 1678886500 - is_archived: true + is_archived: true group_id: 3 securitypolicy: 0 tags: []string{} @@ -124,7 +124,7 @@ fn test_chat_group_encoding_decoding() ! { description: 'Test chat group for encoding/decoding' chat_type: .group_message last_activity: 1678886600 - is_archived: true + is_archived: true group_id: 4 securitypolicy: 0 tags: []string{} @@ -163,7 +163,7 @@ fn test_chat_group_type_name() ! { description: 'Test chat group for type name' chat_type: .public_channel last_activity: 1678886400 - is_archived: false + is_archived: false group_id: 1 securitypolicy: 0 tags: []string{} @@ -192,7 +192,7 @@ fn test_chat_group_description() ! { description: 'Test chat group for description' chat_type: .public_channel last_activity: 1678886400 - is_archived: false + is_archived: false group_id: 1 securitypolicy: 0 tags: []string{} @@ -225,7 +225,7 @@ fn test_chat_group_example() ! { description: 'Test chat group for example' chat_type: .public_channel last_activity: 1678886400 - is_archived: false + is_archived: false group_id: 1 securitypolicy: 0 tags: []string{} diff --git a/lib/hero/heromodels/chat_message.v b/lib/hero/heromodels/chat_message.v index ba4fe443..65e3e2d0 100644 --- a/lib/hero/heromodels/chat_message.v +++ b/lib/hero/heromodels/chat_message.v @@ -1,10 +1,10 @@ module heromodels -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.hero.db -import freeflowuniverse.herolib.schemas.jsonrpc { Response, new_error, new_response, new_response_false, new_response_int, new_response_true } -import freeflowuniverse.herolib.hero.user { UserRef } +import incubaid.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.hero.db +import incubaid.herolib.schemas.jsonrpc { Response, new_error, new_response, new_response_false, new_response_int, new_response_true } +import incubaid.herolib.hero.user { UserRef } import json // ChatMessage represents a message in a chat group diff --git a/lib/hero/heromodels/contact.v b/lib/hero/heromodels/contact.v index 1d05eecb..311574eb 100644 --- a/lib/hero/heromodels/contact.v +++ b/lib/hero/heromodels/contact.v @@ -1,10 +1,10 @@ module heromodels -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.hero.db -import freeflowuniverse.herolib.schemas.jsonrpc { Response, new_error, new_response, new_response_false, new_response_int, new_response_true } -import freeflowuniverse.herolib.hero.user { UserRef } +import incubaid.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.hero.db +import incubaid.herolib.schemas.jsonrpc { Response, new_error, new_response, new_response_false, new_response_int, new_response_true } +import incubaid.herolib.hero.user { UserRef } import json // Contact represents a person in the system diff --git a/lib/hero/heromodels/factory.v b/lib/hero/heromodels/factory.v index 697ca29e..1272ba7e 100644 --- a/lib/hero/heromodels/factory.v +++ b/lib/hero/heromodels/factory.v @@ -1,12 +1,12 @@ module heromodels import os -import freeflowuniverse.herolib.hero.db -import freeflowuniverse.herolib.hero.user { UserRef } -import freeflowuniverse.herolib.core.redisclient -import freeflowuniverse.herolib.schemas.openrpc { Handler, new_handler } -import freeflowuniverse.herolib.schemas.jsonrpc -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.hero.db +import incubaid.herolib.hero.user { UserRef } +import incubaid.herolib.core.redisclient +import incubaid.herolib.schemas.openrpc { Handler, new_handler } +import incubaid.herolib.schemas.jsonrpc +import incubaid.herolib.ui.console const openrpc_path = os.join_path(os.dir(@FILE), 'openrpc.json') diff --git a/lib/hero/heromodels/factory_server.v b/lib/hero/heromodels/factory_server.v index 87f53bfa..fd1d7d60 100644 --- a/lib/hero/heromodels/factory_server.v +++ b/lib/hero/heromodels/factory_server.v @@ -1,7 +1,7 @@ module heromodels -import freeflowuniverse.herolib.hero.heroserver -import freeflowuniverse.herolib.crypt.herocrypt +import incubaid.herolib.hero.heroserver +import incubaid.herolib.crypt.herocrypt // Start heromodels server using heroserver @[params] diff --git a/lib/hero/heromodels/group.v b/lib/hero/heromodels/group.v index 1b40f8aa..1509864a 100644 --- a/lib/hero/heromodels/group.v +++ b/lib/hero/heromodels/group.v @@ -1,10 +1,10 @@ module heromodels -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.hero.db -import freeflowuniverse.herolib.schemas.jsonrpc { Response, new_error, new_response, new_response_false, new_response_int, new_response_true } -import freeflowuniverse.herolib.hero.user { UserRef } +import incubaid.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.hero.db +import incubaid.herolib.schemas.jsonrpc { Response, new_error, new_response, new_response_false, new_response_int, new_response_true } +import incubaid.herolib.hero.user { UserRef } import json // Group represents a collection of users with roles and permissions diff --git a/lib/hero/heromodels/group_test.v b/lib/hero/heromodels/group_test.v index a1ce85c4..ccffdb8f 100644 --- a/lib/hero/heromodels/group_test.v +++ b/lib/hero/heromodels/group_test.v @@ -1,6 +1,6 @@ module heromodels -import freeflowuniverse.herolib.hero.db +import incubaid.herolib.hero.db fn test_group_new() ! { // Initialize DBGroup for testing @@ -20,7 +20,7 @@ fn test_group_new() ! { } group := db_group.new(args)! - + assert group.name == 'test_group' assert group.description == 'Test group for unit testing' assert group.is_public == true @@ -28,7 +28,7 @@ fn test_group_new() ! { assert group.subgroups.len == 0 assert group.parent_group == 0 assert group.updated_at > 0 - + println('✓ Group new test passed!') } @@ -88,11 +88,11 @@ fn test_group_crud_operations() ! { // Test delete operation db_group.delete(original_id)! - + // Verify deletion exists_after_delete := db_group.exist(original_id)! assert exists_after_delete == false - + println('✓ Group CRUD operations test passed!') } @@ -128,24 +128,24 @@ fn test_group_member_operations() ! { // Verify members were added updated_group := db_group.get(group_id)! assert updated_group.members.len == 3 - + // Check first member assert updated_group.members[0].user_id == 100 assert updated_group.members[0].role == .admin - + // Check second member assert updated_group.members[1].user_id == 101 assert updated_group.members[1].role == .writer - + // Check third member assert updated_group.members[2].user_id == 102 assert updated_group.members[2].role == .reader - + // Verify joined_at timestamps are set assert updated_group.members[0].joined_at > 0 assert updated_group.members[1].joined_at > 0 assert updated_group.members[2].joined_at > 0 - + println('✓ Group member operations test passed!') } @@ -191,11 +191,11 @@ fn test_group_hierarchy_operations() ! { // Verify hierarchy final_parent := db_group.get(parent_id)! final_child := db_group.get(child_id)! - + assert final_parent.subgroups.len == 1 assert final_parent.subgroups[0] == child_id assert final_child.parent_group == parent_id - + println('✓ Group hierarchy operations test passed!') } @@ -258,7 +258,7 @@ fn test_group_list_operations() ! { public_groups := db_group.list(public_list_args)! assert public_groups.len >= 1 - + mut found_public := false for group in public_groups { if group.id == public_group.id { @@ -277,7 +277,7 @@ fn test_group_list_operations() ! { parent_groups := db_group.list(parent_list_args)! assert parent_groups.len >= 1 - + mut found_child := false for group in parent_groups { if group.id == child_group.id { @@ -296,7 +296,7 @@ fn test_group_list_operations() ! { both_groups := db_group.list(both_list_args)! assert both_groups.len >= 1 - + mut found_child_public := false for group in both_groups { if group.id == child_group.id && group.is_public == true { @@ -327,11 +327,11 @@ fn test_group_type_name() ! { } group := db_group.new(args)! - + // Test type_name method type_name := group.type_name() assert type_name == 'group' - + println('✓ Group type_name test passed!') } @@ -353,7 +353,7 @@ fn test_group_description() ! { } group := db_group.new(args)! - + // Test description method for each methodname assert group.description('set') == 'Create or update a group. Returns the ID of the group.' assert group.description('get') == 'Retrieve a group by ID. Returns the group object.' @@ -361,7 +361,7 @@ fn test_group_description() ! { assert group.description('exist') == 'Check if a group exists by ID. Returns true or false.' assert group.description('list') == 'List all groups. Returns an array of group objects.' assert group.description('unknown') == 'This is generic method for the root object, TODO fill in, ...' - + println('✓ Group description test passed!') } @@ -383,7 +383,7 @@ fn test_group_example() ! { } group := db_group.new(args)! - + // Test example method for each methodname set_call, set_result := group.example('set') assert set_call == '{"group": {"name": "Admins", "description": "Administrators group", "members": [{"user_id": 1, "role": "admin", "joined_at": 1678886400}], "subgroups": [], "parent_group": 0, "is_public": false}}' @@ -408,7 +408,7 @@ fn test_group_example() ! { unknown_call, unknown_result := group.example('unknown') assert unknown_call == '{}' assert unknown_result == '{}' - + println('✓ Group example test passed!') } @@ -430,30 +430,30 @@ fn test_group_encoding_decoding() ! { } mut group := db_group.new(args)! - + // Add some members group.add_member(100, .admin) group.add_member(101, .writer) - + // Save the group group = db_group.set(group)! group_id := group.id // Retrieve and verify all fields were properly encoded/decoded retrieved_group := db_group.get(group_id)! - + assert retrieved_group.name == 'encoding_test_group' assert retrieved_group.description == 'Test group for encoding/decoding' assert retrieved_group.subgroups == [u32(10), u32(20), u32(30)] assert retrieved_group.parent_group == 0 assert retrieved_group.is_public == true assert retrieved_group.members.len == 2 - + // Verify member details assert retrieved_group.members[0].user_id == 100 assert retrieved_group.members[0].role == .admin assert retrieved_group.members[1].user_id == 101 assert retrieved_group.members[1].role == .writer - + println('✓ Group encoding/decoding test passed!') } diff --git a/lib/hero/heromodels/location.v b/lib/hero/heromodels/location.v index fa5c3305..328fa619 100644 --- a/lib/hero/heromodels/location.v +++ b/lib/hero/heromodels/location.v @@ -1,8 +1,8 @@ module heromodels -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.hero.db +import incubaid.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.hero.db // Address represents a physical address @[heap] diff --git a/lib/hero/heromodels/message.v b/lib/hero/heromodels/message.v index 44a12c90..525e9089 100644 --- a/lib/hero/heromodels/message.v +++ b/lib/hero/heromodels/message.v @@ -1,10 +1,10 @@ module heromodels -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.hero.db -import freeflowuniverse.herolib.schemas.jsonrpc { Response, new_error, new_response, new_response_false, new_response_int, new_response_true } -import freeflowuniverse.herolib.hero.user { UserRef } +import incubaid.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.hero.db +import incubaid.herolib.schemas.jsonrpc { Response, new_error, new_response, new_response_false, new_response_int, new_response_true } +import incubaid.herolib.hero.user { UserRef } import json @[heap] diff --git a/lib/hero/heromodels/message_test.v b/lib/hero/heromodels/message_test.v index 975ca16c..5d593091 100644 --- a/lib/hero/heromodels/message_test.v +++ b/lib/hero/heromodels/message_test.v @@ -1,6 +1,6 @@ module heromodels -import freeflowuniverse.herolib.hero.db +import incubaid.herolib.hero.db fn test_message_new() ! { // Initialize DBMessages for testing diff --git a/lib/hero/heromodels/planning.v b/lib/hero/heromodels/planning.v index 75ac40cc..04ca7b3a 100644 --- a/lib/hero/heromodels/planning.v +++ b/lib/hero/heromodels/planning.v @@ -1,10 +1,10 @@ module heromodels -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.hero.db -import freeflowuniverse.herolib.schemas.jsonrpc { Response, new_error, new_response, new_response_false, new_response_int, new_response_true } -import freeflowuniverse.herolib.hero.user { UserRef } +import incubaid.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.hero.db +import incubaid.herolib.schemas.jsonrpc { Response, new_error, new_response, new_response_false, new_response_int, new_response_true } +import incubaid.herolib.hero.user { UserRef } import json // Planning, how do people or teams want to plan their time diff --git a/lib/hero/heromodels/planning_test.v b/lib/hero/heromodels/planning_test.v index abf119d6..8bf6662b 100644 --- a/lib/hero/heromodels/planning_test.v +++ b/lib/hero/heromodels/planning_test.v @@ -1,7 +1,7 @@ module heromodels -import freeflowuniverse.herolib.hero.db -import freeflowuniverse.herolib.data.ourtime +import incubaid.herolib.hero.db +import incubaid.herolib.data.ourtime fn test_planning_new() ! { // Initialize DBPlanning for testing @@ -75,8 +75,8 @@ fn test_planning_crud_operations() ! { // Create some recurrence rules mut rule1 := PlanningRecurrenceRule{ - until: 1893456000 // 2030-01-01 - by_weekday: [u8(1), u8(3), u8(5)] // Monday, Wednesday, Friday + until: 1893456000 // 2030-01-01 + by_weekday: [u8(1), u8(3), u8(5)] // Monday, Wednesday, Friday by_monthday: []u8{} hour_from: 9 hour_to: 17 @@ -161,8 +161,8 @@ fn test_planning_crud_operations() ! { // Update rules mut updated_rule1 := PlanningRecurrenceRule{ - until: 1924992000 // 2031-01-01 - by_weekday: [u8(2), u8(4)] // Tuesday, Thursday + until: 1924992000 // 2031-01-01 + by_weekday: [u8(2), u8(4)] // Tuesday, Thursday by_monthday: []u8{} hour_from: 8 hour_to: 16 @@ -259,7 +259,9 @@ fn test_planning_recurrence_rules_encoding_decoding() ! { mut rule1 := PlanningRecurrenceRule{ until: 1893456000 // 2030-01-01 by_weekday: [u8(0), u8(1), u8(2), u8(3), u8(4), u8(5), u8(6)] // All days of week - by_monthday: [u8(1), u8(2), u8(3), u8(4), u8(5), u8(6), u8(7), u8(8), u8(9), u8(10), u8(11), u8(12), u8(13), u8(14), u8(15), u8(16), u8(17), u8(18), u8(19), u8(20), u8(21), u8(22), u8(23), u8(24), u8(25), u8(26), u8(27), u8(28), u8(29), u8(30), u8(31)] // All days of month + by_monthday: [u8(1), u8(2), u8(3), u8(4), u8(5), u8(6), u8(7), u8(8), u8(9), u8(10), u8(11), + u8(12), u8(13), u8(14), u8(15), u8(16), u8(17), u8(18), u8(19), u8(20), u8(21), u8(22), + u8(23), u8(24), u8(25), u8(26), u8(27), u8(28), u8(29), u8(30), u8(31)] // All days of month hour_from: 0 hour_to: 23 duration: 15 @@ -291,7 +293,8 @@ fn test_planning_recurrence_rules_encoding_decoding() ! { // Verify first autoschedule rule details assert retrieved_planning.autoschedule_rules[0].until == 1893456000 - assert retrieved_planning.autoschedule_rules[0].by_weekday == [u8(0), u8(1), u8(2), u8(3), u8(4), u8(5), u8(6)] + assert retrieved_planning.autoschedule_rules[0].by_weekday == [u8(0), u8(1), u8(2), u8(3), + u8(4), u8(5), u8(6)] assert retrieved_planning.autoschedule_rules[0].by_monthday.len == 31 assert retrieved_planning.autoschedule_rules[0].hour_from == 0 assert retrieved_planning.autoschedule_rules[0].hour_to == 23 @@ -309,7 +312,8 @@ fn test_planning_recurrence_rules_encoding_decoding() ! { // Verify invite rule details assert retrieved_planning.invite_rules[0].until == 1893456000 - assert retrieved_planning.invite_rules[0].by_weekday == [u8(0), u8(1), u8(2), u8(3), u8(4), u8(5), u8(6)] + assert retrieved_planning.invite_rules[0].by_weekday == [u8(0), u8(1), u8(2), u8(3), u8(4), + u8(5), u8(6)] assert retrieved_planning.invite_rules[0].by_monthday.len == 31 assert retrieved_planning.invite_rules[0].hour_from == 0 assert retrieved_planning.invite_rules[0].hour_to == 23 diff --git a/lib/hero/heromodels/profile.v b/lib/hero/heromodels/profile.v index f90251fa..eea8ac2e 100644 --- a/lib/hero/heromodels/profile.v +++ b/lib/hero/heromodels/profile.v @@ -1,10 +1,10 @@ module heromodels -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.hero.db -import freeflowuniverse.herolib.schemas.jsonrpc { Response, new_error, new_response, new_response_false, new_response_int, new_response_true } -import freeflowuniverse.herolib.hero.user { UserRef } +import incubaid.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.hero.db +import incubaid.herolib.schemas.jsonrpc { Response, new_error, new_response, new_response_false, new_response_int, new_response_true } +import incubaid.herolib.hero.user { UserRef } import json @[heap] diff --git a/lib/hero/heromodels/project.v b/lib/hero/heromodels/project.v index e1b9804b..1ca6f829 100644 --- a/lib/hero/heromodels/project.v +++ b/lib/hero/heromodels/project.v @@ -1,10 +1,10 @@ module heromodels -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.hero.db -import freeflowuniverse.herolib.schemas.jsonrpc { Response, new_error, new_response, new_response_false, new_response_int, new_response_true } -import freeflowuniverse.herolib.hero.user { UserRef } +import incubaid.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.hero.db +import incubaid.herolib.schemas.jsonrpc { Response, new_error, new_response, new_response_false, new_response_int, new_response_true } +import incubaid.herolib.hero.user { UserRef } import json // Project represents a collection of issues organized in swimlanes diff --git a/lib/hero/heromodels/project_issue.v b/lib/hero/heromodels/project_issue.v index d350ef34..89e6ed5c 100644 --- a/lib/hero/heromodels/project_issue.v +++ b/lib/hero/heromodels/project_issue.v @@ -1,10 +1,10 @@ module heromodels -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.hero.db -import freeflowuniverse.herolib.schemas.jsonrpc { Response, new_error, new_response, new_response_false, new_response_int, new_response_true } -import freeflowuniverse.herolib.hero.user { UserRef } +import incubaid.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.hero.db +import incubaid.herolib.schemas.jsonrpc { Response, new_error, new_response, new_response_false, new_response_int, new_response_true } +import incubaid.herolib.hero.user { UserRef } import json // ProjectIssue represents a task, story, bug, or question in a project diff --git a/lib/hero/heromodels/registration_desk.v b/lib/hero/heromodels/registration_desk.v index fe6bcf1e..24e9871c 100644 --- a/lib/hero/heromodels/registration_desk.v +++ b/lib/hero/heromodels/registration_desk.v @@ -1,10 +1,10 @@ module heromodels -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.hero.db -import freeflowuniverse.herolib.schemas.jsonrpc { Response, new_error, new_response, new_response_false, new_response_int, new_response_true } -import freeflowuniverse.herolib.hero.user { UserRef } +import incubaid.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.hero.db +import incubaid.herolib.schemas.jsonrpc { Response, new_error, new_response, new_response_false, new_response_int, new_response_true } +import incubaid.herolib.hero.user { UserRef } import json @[heap] diff --git a/lib/hero/heromodels/registration_desk_test.v b/lib/hero/heromodels/registration_desk_test.v index 7ba1b4bb..244da221 100644 --- a/lib/hero/heromodels/registration_desk_test.v +++ b/lib/hero/heromodels/registration_desk_test.v @@ -1,6 +1,6 @@ module heromodels -import freeflowuniverse.herolib.hero.db +import incubaid.herolib.hero.db fn test_registration_desk_new() ! { // Initialize DBRegistrationDesk for testing @@ -11,30 +11,30 @@ fn test_registration_desk_new() ! { // Test creating a new registration desk mut args := RegistrationDeskArg{ - name: "test_registration_desk" - description: "Test registration desk for unit testing" - fs_items: [u32(1001), u32(1002)] - white_list: [u32(2001), u32(2002), u32(2003)] + name: 'test_registration_desk' + description: 'Test registration desk for unit testing' + fs_items: [u32(1001), u32(1002)] + white_list: [u32(2001), u32(2002), u32(2003)] white_list_accepted: [u32(3001)] - black_list: [u32(4001), u32(4002)] - start_time: "2025-01-01 10:00:00" - end_time: "2025-01-01 11:00:00" + black_list: [u32(4001), u32(4002)] + start_time: '2025-01-01 10:00:00' + end_time: '2025-01-01 11:00:00' acceptance_required: true - securitypolicy: 0 - tags: ["test", "registration"] - messages: [] + securitypolicy: 0 + tags: ['test', 'registration'] + messages: [] } registration_desk := db_registration_desk.new(args)! - assert registration_desk.name == "test_registration_desk" - assert registration_desk.description == "Test registration desk for unit testing" + assert registration_desk.name == 'test_registration_desk' + assert registration_desk.description == 'Test registration desk for unit testing' assert registration_desk.fs_items.len == 2 assert registration_desk.fs_items[0].fs_item == 1001 - assert registration_desk.fs_items[0].cat == "" + assert registration_desk.fs_items[0].cat == '' assert registration_desk.fs_items[0].public == false assert registration_desk.fs_items[1].fs_item == 1002 - assert registration_desk.fs_items[1].cat == "" + assert registration_desk.fs_items[1].cat == '' assert registration_desk.fs_items[1].public == false assert registration_desk.white_list == [u32(2001), u32(2002), u32(2003)] assert registration_desk.white_list_accepted == [u32(3001)] @@ -42,7 +42,7 @@ fn test_registration_desk_new() ! { assert registration_desk.acceptance_required == true assert registration_desk.registrations.len == 0 - println("✓ RegistrationDesk new test passed!") + println('✓ RegistrationDesk new test passed!') } fn test_registration_desk_crud_operations() ! { @@ -54,18 +54,18 @@ fn test_registration_desk_crud_operations() ! { // Create a new registration desk mut args := RegistrationDeskArg{ - name: "crud_test_registration_desk" - description: "Test registration desk for CRUD operations" - fs_items: [u32(1001), u32(1002)] - white_list: [u32(2001), u32(2002)] + name: 'crud_test_registration_desk' + description: 'Test registration desk for CRUD operations' + fs_items: [u32(1001), u32(1002)] + white_list: [u32(2001), u32(2002)] white_list_accepted: [u32(3001)] - black_list: [u32(4001)] - start_time: "2025-01-01 10:00:00" - end_time: "2025-01-01 11:00:00" + black_list: [u32(4001)] + start_time: '2025-01-01 10:00:00' + end_time: '2025-01-01 11:00:00' acceptance_required: false - securitypolicy: 0 - tags: ["crud", "test"] - messages: [] + securitypolicy: 0 + tags: ['crud', 'test'] + messages: [] } mut registration_desk := db_registration_desk.new(args)! @@ -76,14 +76,14 @@ fn test_registration_desk_crud_operations() ! { // Test get operation retrieved_desk := db_registration_desk.get(original_id)! - assert retrieved_desk.name == "crud_test_registration_desk" - assert retrieved_desk.description == "Test registration desk for CRUD operations" + assert retrieved_desk.name == 'crud_test_registration_desk' + assert retrieved_desk.description == 'Test registration desk for CRUD operations' assert retrieved_desk.fs_items.len == 2 assert retrieved_desk.fs_items[0].fs_item == 1001 - assert retrieved_desk.fs_items[0].cat == "" + assert retrieved_desk.fs_items[0].cat == '' assert retrieved_desk.fs_items[0].public == false assert retrieved_desk.fs_items[1].fs_item == 1002 - assert retrieved_desk.fs_items[1].cat == "" + assert retrieved_desk.fs_items[1].cat == '' assert retrieved_desk.fs_items[1].public == false assert retrieved_desk.white_list == [u32(2001), u32(2002)] assert retrieved_desk.white_list_accepted == [u32(3001)] @@ -97,18 +97,18 @@ fn test_registration_desk_crud_operations() ! { // Test update mut updated_args := RegistrationDeskArg{ - name: "updated_registration_desk" - description: "Updated test registration desk" - fs_items: [u32(1003)] - white_list: [u32(2003), u32(2004)] + name: 'updated_registration_desk' + description: 'Updated test registration desk' + fs_items: [u32(1003)] + white_list: [u32(2003), u32(2004)] white_list_accepted: [u32(3002)] - black_list: [u32(4002), u32(4003)] - start_time: "2025-01-01 12:00:00" - end_time: "2025-01-01 13:00:00" + black_list: [u32(4002), u32(4003)] + start_time: '2025-01-01 12:00:00' + end_time: '2025-01-01 13:00:00' acceptance_required: true - securitypolicy: 0 - tags: ["updated", "test"] - messages: [] + securitypolicy: 0 + tags: ['updated', 'test'] + messages: [] } mut updated_desk := db_registration_desk.new(updated_args)! @@ -118,11 +118,11 @@ fn test_registration_desk_crud_operations() ! { // Verify update final_desk := db_registration_desk.get(original_id)! - assert final_desk.name == "updated_registration_desk" - assert final_desk.description == "Updated test registration desk" + assert final_desk.name == 'updated_registration_desk' + assert final_desk.description == 'Updated test registration desk' assert final_desk.fs_items.len == 1 assert final_desk.fs_items[0].fs_item == 1003 - assert final_desk.fs_items[0].cat == "" + assert final_desk.fs_items[0].cat == '' assert final_desk.fs_items[0].public == false assert final_desk.white_list == [u32(2003), u32(2004)] assert final_desk.white_list_accepted == [u32(3002)] @@ -136,7 +136,7 @@ fn test_registration_desk_crud_operations() ! { exists_after_delete := db_registration_desk.exist(original_id)! assert exists_after_delete == false - println("✓ RegistrationDesk CRUD operations test passed!") + println('✓ RegistrationDesk CRUD operations test passed!') } fn test_registration_desk_registrations_encoding_decoding() ! { @@ -148,18 +148,18 @@ fn test_registration_desk_registrations_encoding_decoding() ! { // Create a new registration desk mut args := RegistrationDeskArg{ - name: "registrations_test_desk" - description: "Test registration desk for registrations encoding/decoding" - fs_items: [] - white_list: [] + name: 'registrations_test_desk' + description: 'Test registration desk for registrations encoding/decoding' + fs_items: [] + white_list: [] white_list_accepted: [] - black_list: [] - start_time: "2025-01-01 10:00:00" - end_time: "2025-01-01 11:00:00" + black_list: [] + start_time: '2025-01-01 10:00:00' + end_time: '2025-01-01 11:00:00' acceptance_required: true - securitypolicy: 0 - tags: [] - messages: [] + securitypolicy: 0 + tags: [] + messages: [] } mut registration_desk := db_registration_desk.new(args)! @@ -206,7 +206,7 @@ fn test_registration_desk_registrations_encoding_decoding() ! { assert retrieved_desk.registrations[1].timestamp == 1234567891 assert retrieved_desk.registrations[1].timestamp_acceptation == 0 - println("✓ RegistrationDesk registrations encoding/decoding test passed!") + println('✓ RegistrationDesk registrations encoding/decoding test passed!') } fn test_registration_desk_type_name() ! { @@ -218,27 +218,27 @@ fn test_registration_desk_type_name() ! { // Create a new registration desk mut args := RegistrationDeskArg{ - name: "type_test_desk" - description: "Test registration desk for type name" - fs_items: [] - white_list: [] + name: 'type_test_desk' + description: 'Test registration desk for type name' + fs_items: [] + white_list: [] white_list_accepted: [] - black_list: [] - start_time: "2025-01-01 10:00:00" - end_time: "2025-01-01 11:00:00" + black_list: [] + start_time: '2025-01-01 10:00:00' + end_time: '2025-01-01 11:00:00' acceptance_required: false - securitypolicy: 0 - tags: [] - messages: [] + securitypolicy: 0 + tags: [] + messages: [] } registration_desk := db_registration_desk.new(args)! // Test type_name method type_name := registration_desk.type_name() - assert type_name == "registration_desk" + assert type_name == 'registration_desk' - println("✓ RegistrationDesk type_name test passed!") + println('✓ RegistrationDesk type_name test passed!') } fn test_registration_desk_description() ! { @@ -250,31 +250,31 @@ fn test_registration_desk_description() ! { // Create a new registration desk mut args := RegistrationDeskArg{ - name: "description_test_desk" - description: "Test registration desk for description" - fs_items: [] - white_list: [] + name: 'description_test_desk' + description: 'Test registration desk for description' + fs_items: [] + white_list: [] white_list_accepted: [] - black_list: [] - start_time: "2025-01-01 10:00:00" - end_time: "2025-01-01 11:00:00" + black_list: [] + start_time: '2025-01-01 10:00:00' + end_time: '2025-01-01 11:00:00' acceptance_required: false - securitypolicy: 0 - tags: [] - messages: [] + securitypolicy: 0 + tags: [] + messages: [] } registration_desk := db_registration_desk.new(args)! // Test description method for each methodname - assert registration_desk.description("set") == "Create or update a registration desk. Returns the ID of the registration desk." - assert registration_desk.description("get") == "Retrieve a registration desk by ID. Returns the registration desk object." - assert registration_desk.description("delete") == "Delete a registration desk by ID. Returns true if successful." - assert registration_desk.description("exist") == "Check if a registration desk exists by ID. Returns true or false." - assert registration_desk.description("list") == "List all registration desks. Returns an array of registration desk objects." - assert registration_desk.description("unknown") == "This is generic method for the root object, TODO fill in, ..." + assert registration_desk.description('set') == 'Create or update a registration desk. Returns the ID of the registration desk.' + assert registration_desk.description('get') == 'Retrieve a registration desk by ID. Returns the registration desk object.' + assert registration_desk.description('delete') == 'Delete a registration desk by ID. Returns true if successful.' + assert registration_desk.description('exist') == 'Check if a registration desk exists by ID. Returns true or false.' + assert registration_desk.description('list') == 'List all registration desks. Returns an array of registration desk objects.' + assert registration_desk.description('unknown') == 'This is generic method for the root object, TODO fill in, ...' - println("✓ RegistrationDesk description test passed!") + println('✓ RegistrationDesk description test passed!') } fn test_registration_desk_example() ! { @@ -286,48 +286,48 @@ fn test_registration_desk_example() ! { // Create a new registration desk mut args := RegistrationDeskArg{ - name: "example_test_desk" - description: "Test registration desk for example" - fs_items: [] - white_list: [] + name: 'example_test_desk' + description: 'Test registration desk for example' + fs_items: [] + white_list: [] white_list_accepted: [] - black_list: [] - start_time: "2025-01-01 10:00:00" - end_time: "2025-01-01 11:00:00" + black_list: [] + start_time: '2025-01-01 10:00:00' + end_time: '2025-01-01 11:00:00' acceptance_required: false - securitypolicy: 0 - tags: [] - messages: [] + securitypolicy: 0 + tags: [] + messages: [] } registration_desk := db_registration_desk.new(args)! // Test example method for each methodname - set_call, set_result := registration_desk.example("set") + set_call, set_result := registration_desk.example('set') assert set_call == '{"registration_desk": {"name": "event_registration", "description": "Registration desk for team meeting", "fs_items": [{"fs_item": 1001, "cat": "agenda", "public": true}], "white_list": [100, 101], "white_list_accepted": [102], "black_list": [200], "start_time": 1672564800, "end_time": 1672568400, "acceptance_required": true, "registrations": [{"user_id": 300, "accepted": true, "accepted_by": 400, "timestamp": 1672564900, "timestamp_acceptation": 1672565000}]}}' - assert set_result == "1" + assert set_result == '1' - get_call, get_result := registration_desk.example("get") + get_call, get_result := registration_desk.example('get') assert get_call == '{"id": 1}' assert get_result == '{"name": "event_registration", "description": "Registration desk for team meeting", "fs_items": [{"fs_item": 1001, "cat": "agenda", "public": true}], "white_list": [100, 101], "white_list_accepted": [102], "black_list": [200], "start_time": 1672564800, "end_time": 1672568400, "acceptance_required": true, "registrations": [{"user_id": 300, "accepted": true, "accepted_by": 400, "timestamp": 1672564900, "timestamp_acceptation": 1672565000}]}' - delete_call, delete_result := registration_desk.example("delete") + delete_call, delete_result := registration_desk.example('delete') assert delete_call == '{"id": 1}' - assert delete_result == "true" + assert delete_result == 'true' - exist_call, exist_result := registration_desk.example("exist") + exist_call, exist_result := registration_desk.example('exist') assert exist_call == '{"id": 1}' - assert exist_result == "true" + assert exist_result == 'true' - list_call, list_result := registration_desk.example("list") + list_call, list_result := registration_desk.example('list') assert list_call == '{}' assert list_result == '[{"name": "event_registration", "description": "Registration desk for team meeting", "fs_items": [{"fs_item": 1001, "cat": "agenda", "public": true}], "white_list": [100, 101], "white_list_accepted": [102], "black_list": [200], "start_time": 1672564800, "end_time": 1672568400, "acceptance_required": true, "registrations": [{"user_id": 300, "accepted": true, "accepted_by": 400, "timestamp": 1672564900, "timestamp_acceptation": 1672565000}]}]' - unknown_call, unknown_result := registration_desk.example("unknown") + unknown_call, unknown_result := registration_desk.example('unknown') assert unknown_call == '{}' assert unknown_result == '{}' - println("✓ RegistrationDesk example test passed!") + println('✓ RegistrationDesk example test passed!') } fn test_registration_desk_list() ! { @@ -343,33 +343,33 @@ fn test_registration_desk_list() ! { // Create a few registration desks mut args1 := RegistrationDeskArg{ - name: "list_test_desk_1" - description: "First test registration desk for list operations" - fs_items: [] - white_list: [] + name: 'list_test_desk_1' + description: 'First test registration desk for list operations' + fs_items: [] + white_list: [] white_list_accepted: [] - black_list: [] - start_time: "2025-01-01 10:00:00" - end_time: "2025-01-01 11:00:00" + black_list: [] + start_time: '2025-01-01 10:00:00' + end_time: '2025-01-01 11:00:00' acceptance_required: false - securitypolicy: 0 - tags: [] - messages: [] + securitypolicy: 0 + tags: [] + messages: [] } mut args2 := RegistrationDeskArg{ - name: "list_test_desk_2" - description: "Second test registration desk for list operations" - fs_items: [] - white_list: [] + name: 'list_test_desk_2' + description: 'Second test registration desk for list operations' + fs_items: [] + white_list: [] white_list_accepted: [] - black_list: [] - start_time: "2025-01-01 10:00:00" - end_time: "2025-01-01 11:00:00" + black_list: [] + start_time: '2025-01-01 10:00:00' + end_time: '2025-01-01 11:00:00' acceptance_required: true - securitypolicy: 0 - tags: [] - messages: [] + securitypolicy: 0 + tags: [] + messages: [] } mut desk1 := db_registration_desk.new(args1)! @@ -381,28 +381,28 @@ fn test_registration_desk_list() ! { // Test list by name mut listed_desks := db_registration_desk.list(RegistrationDeskListArg{ - name: "list_test_desk_1" + name: 'list_test_desk_1' })! assert listed_desks.len == 1 - assert listed_desks[0].name == "list_test_desk_1" + assert listed_desks[0].name == 'list_test_desk_1' // Test list by description listed_desks = db_registration_desk.list(RegistrationDeskListArg{ - description: "test registration desk" + description: 'test registration desk' })! assert listed_desks.len == 2 // Test list with limit listed_desks = db_registration_desk.list(RegistrationDeskListArg{ - description: "test registration desk" - limit: 1 + description: 'test registration desk' + limit: 1 })! assert listed_desks.len == 1 - println("✓ RegistrationDesk list test passed!") + println('✓ RegistrationDesk list test passed!') } fn test_registration_desk_fs_items_encoding_decoding() ! { @@ -414,18 +414,18 @@ fn test_registration_desk_fs_items_encoding_decoding() ! { // Create a new registration desk mut args := RegistrationDeskArg{ - name: "fs_items_test_desk" - description: "Test registration desk for fs_items encoding/decoding" - fs_items: [u32(1001), u32(1002)] - white_list: [] + name: 'fs_items_test_desk' + description: 'Test registration desk for fs_items encoding/decoding' + fs_items: [u32(1001), u32(1002)] + white_list: [] white_list_accepted: [] - black_list: [] - start_time: "2025-01-01 10:00:00" - end_time: "2025-01-01 11:00:00" + black_list: [] + start_time: '2025-01-01 10:00:00' + end_time: '2025-01-01 11:00:00' acceptance_required: false - securitypolicy: 0 - tags: [] - messages: [] + securitypolicy: 0 + tags: [] + messages: [] } mut registration_desk := db_registration_desk.new(args)! @@ -433,13 +433,13 @@ fn test_registration_desk_fs_items_encoding_decoding() ! { // Add file attachments manually with custom values mut fs_item1 := RegistrationFileAttachment{ fs_item: 1001 - cat: "agenda" + cat: 'agenda' public: true } mut fs_item2 := RegistrationFileAttachment{ fs_item: 2002 - cat: "minutes" + cat: 'minutes' public: false } @@ -456,13 +456,13 @@ fn test_registration_desk_fs_items_encoding_decoding() ! { // Verify first file attachment details assert retrieved_desk.fs_items[0].fs_item == 1001 - assert retrieved_desk.fs_items[0].cat == "agenda" + assert retrieved_desk.fs_items[0].cat == 'agenda' assert retrieved_desk.fs_items[0].public == true // Verify second file attachment details assert retrieved_desk.fs_items[1].fs_item == 2002 - assert retrieved_desk.fs_items[1].cat == "minutes" + assert retrieved_desk.fs_items[1].cat == 'minutes' assert retrieved_desk.fs_items[1].public == false - println("✓ RegistrationDesk fs_items encoding/decoding test passed!") -} \ No newline at end of file + println('✓ RegistrationDesk fs_items encoding/decoding test passed!') +} diff --git a/lib/hero/heromodels/tags.v b/lib/hero/heromodels/tags.v index aee36d2c..8a82dacd 100644 --- a/lib/hero/heromodels/tags.v +++ b/lib/hero/heromodels/tags.v @@ -1,8 +1,8 @@ module heromodels -import freeflowuniverse.herolib.hero.db -import freeflowuniverse.herolib.schemas.jsonrpc { Response, new_error, new_response, new_response_false, new_response_true } -import freeflowuniverse.herolib.hero.user { UserRef } +import incubaid.herolib.hero.db +import incubaid.herolib.schemas.jsonrpc { Response, new_error, new_response, new_response_false, new_response_true } +import incubaid.herolib.hero.user { UserRef } import json // Tags represents a collection of tag names with a unique ID diff --git a/lib/hero/heromodels/user.v b/lib/hero/heromodels/user.v index 019ff11f..cb515a07 100644 --- a/lib/hero/heromodels/user.v +++ b/lib/hero/heromodels/user.v @@ -1,10 +1,10 @@ module heromodels -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.hero.db -import freeflowuniverse.herolib.schemas.jsonrpc { Response, new_error, new_response, new_response_false, new_response_int, new_response_true } -import freeflowuniverse.herolib.hero.user { UserRef } +import incubaid.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.hero.db +import incubaid.herolib.schemas.jsonrpc { Response, new_error, new_response, new_response_false, new_response_int, new_response_true } +import incubaid.herolib.hero.user { UserRef } import json // User represents a person in the system diff --git a/lib/hero/heroserver/api_handler.v b/lib/hero/heroserver/api_handler.v index 37279906..a9e68d9c 100644 --- a/lib/hero/heroserver/api_handler.v +++ b/lib/hero/heroserver/api_handler.v @@ -3,7 +3,7 @@ module heroserver import json import net.http import veb -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.schemas.jsonrpc @['/auth/:action'] pub fn (mut server HeroServer) auth_handler(mut ctx Context, action string) !veb.Result { diff --git a/lib/hero/heroserver/doc_handler.v b/lib/hero/heroserver/doc_handler.v index 1f20c3ee..5794015f 100644 --- a/lib/hero/heroserver/doc_handler.v +++ b/lib/hero/heroserver/doc_handler.v @@ -2,9 +2,9 @@ module heroserver import veb import net.http -import freeflowuniverse.herolib.schemas.openrpc -import freeflowuniverse.herolib.schemas.jsonschema -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.schemas.openrpc +import incubaid.herolib.schemas.jsonschema +import incubaid.herolib.schemas.jsonrpc import time // Home page handler - returns HTML homepage for GET, handles JSON-RPC for POST diff --git a/lib/hero/heroserver/doc_model.v b/lib/hero/heroserver/doc_model.v index 104221f7..e46c5a16 100644 --- a/lib/hero/heroserver/doc_model.v +++ b/lib/hero/heroserver/doc_model.v @@ -1,7 +1,7 @@ module heroserver -import freeflowuniverse.herolib.schemas.openrpc -import freeflowuniverse.herolib.schemas.jsonschema +import incubaid.herolib.schemas.openrpc +import incubaid.herolib.schemas.jsonschema // DocSpec is the main object passed to the documentation template. pub struct DocSpec { diff --git a/lib/hero/heroserver/factory.v b/lib/hero/heroserver/factory.v index c2c26288..73967f96 100644 --- a/lib/hero/heroserver/factory.v +++ b/lib/hero/heroserver/factory.v @@ -1,10 +1,10 @@ module heroserver -import freeflowuniverse.herolib.crypt.herocrypt -import freeflowuniverse.herolib.schemas.openrpc -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.logger -import freeflowuniverse.herolib.osal.core as osal +import incubaid.herolib.crypt.herocrypt +import incubaid.herolib.schemas.openrpc +import incubaid.herolib.ui.console +import incubaid.herolib.core.logger +import incubaid.herolib.osal.core as osal import time import veb diff --git a/lib/hero/heroserver/model.v b/lib/hero/heroserver/model.v index 6a587067..c6a5ba0d 100644 --- a/lib/hero/heroserver/model.v +++ b/lib/hero/heroserver/model.v @@ -1,9 +1,9 @@ module heroserver -import freeflowuniverse.herolib.crypt.herocrypt -import freeflowuniverse.herolib.schemas.openrpc -import freeflowuniverse.herolib.core.logger -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.crypt.herocrypt +import incubaid.herolib.schemas.openrpc +import incubaid.herolib.core.logger +import incubaid.herolib.ui.console import time import veb diff --git a/lib/hero/heroserver/readme.md b/lib/hero/heroserver/readme.md index 2a5f64be..023630cd 100644 --- a/lib/hero/heroserver/readme.md +++ b/lib/hero/heroserver/readme.md @@ -14,8 +14,8 @@ HeroServer is a secure web server built in V, designed for public key-based auth ## Usage ```v -import freeflowuniverse.herolib.hero.heroserver -import freeflowuniverse.herolib.schemas.openrpc +import incubaid.herolib.hero.heroserver +import incubaid.herolib.schemas.openrpc fn main() { // 1. Create a new server instance with CORS support diff --git a/lib/hero/heroserver/templates/home.html b/lib/hero/heroserver/templates/home.html index 0474be35..87bfd196 100644 --- a/lib/hero/heroserver/templates/home.html +++ b/lib/hero/heroserver/templates/home.html @@ -378,7 +378,7 @@

HeroServer - Built with V language • - + View on GitHub

diff --git a/lib/hero/typescriptgenerator/generate.vsh b/lib/hero/typescriptgenerator/generate.vsh index 7eefbb37..35d89a1d 100755 --- a/lib/hero/typescriptgenerator/generate.vsh +++ b/lib/hero/typescriptgenerator/generate.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -cg -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.hero.typescriptgenerator -import freeflowuniverse.herolib.schemas.openrpc +import incubaid.herolib.hero.typescriptgenerator +import incubaid.herolib.schemas.openrpc import os const openrpc_path = os.dir(@FILE) + '/../../hero/heromodels/openrpc.json' diff --git a/lib/hero/typescriptgenerator/generator.v b/lib/hero/typescriptgenerator/generator.v index 1157f2ef..86929056 100644 --- a/lib/hero/typescriptgenerator/generator.v +++ b/lib/hero/typescriptgenerator/generator.v @@ -1,12 +1,12 @@ module typescriptgenerator -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.pathlib +import incubaid.herolib.core.texttools import os pub fn generate_typescript_client(spec IntermediateSpec, dest_path string) ! { mut dest := pathlib.get_dir(path: dest_path, create: true)! - + // Generate a file for each schema for name, schema in spec.schemas { mut file_content := generate_interface(schema) @@ -18,7 +18,7 @@ pub fn generate_typescript_client(spec IntermediateSpec, dest_path string) ! { mut client_content := generate_client(spec) mut client_file_path := pathlib.get_file(path: '${dest.path}/client.ts', create: true)! client_file_path.write(client_content) or { panic(err) } - + // Copy templates to destination mut templates_src := os.dir(@FILE) + '/templates' if os.exists(templates_src) { @@ -26,17 +26,17 @@ pub fn generate_typescript_client(spec IntermediateSpec, dest_path string) ! { mut index_content := os.read_file('${templates_src}/index.html')! mut index_file := pathlib.get_file(path: '${dest.path}/index.html', create: true)! index_file.write(index_content)! - + // Copy package.json template mut package_content := os.read_file('${templates_src}/package.json')! mut package_file := pathlib.get_file(path: '${dest.path}/package.json', create: true)! package_file.write(package_content)! - + // Copy tsconfig.json template mut tsconfig_content := os.read_file('${templates_src}/tsconfig.json')! mut tsconfig_file := pathlib.get_file(path: '${dest.path}/tsconfig.json', create: true)! tsconfig_file.write(tsconfig_content)! - + // Copy dev-server.ts template mut dev_server_content := os.read_file('${templates_src}/dev-server.ts')! mut dev_server_file := pathlib.get_file(path: '${dest.path}/dev-server.ts', create: true)! @@ -54,20 +54,20 @@ fn generate_interface(schema IntermediateSchema) string { } fn generate_client(spec IntermediateSpec) string { - mut methods_str := '' - for method in spec.methods { - params_str := method.params.map('${it.name}: ${ts_type(it.type_info)}').join(', ') - methods_str += ' + mut methods_str := '' + for method in spec.methods { + params_str := method.params.map('${it.name}: ${ts_type(it.type_info)}').join(', ') + methods_str += ' async ${texttools.snake_case(method.name)}(params: { ${params_str} }): Promise<${ts_type(method.result.type_info)}> { return this.send(\'${method.name}\', params); } ' - } + } - mut imports_str := '' - for schema_name in spec.schemas.keys() { - imports_str += "import { ${schema_name} } from './${schema_name}';\n" - } + mut imports_str := '' + for schema_name in spec.schemas.keys() { + imports_str += "import { ${schema_name} } from './${schema_name}';\n" + } return " import fetch from 'node-fetch'; @@ -96,12 +96,12 @@ export class HeroModelsClient { }); if (!response.ok) { - throw new Error(`HTTP error! status: ${"$"}{response.status}`); + throw new Error(`HTTP error! status: ${'$'}{response.status}`); } const jsonResponse:any = await response.json(); if (jsonResponse.error) { - throw new Error(`RPC error: ${"$"}{jsonResponse.error.message}`); + throw new Error(`RPC error: ${'$'}{jsonResponse.error.message}`); } return jsonResponse.result; @@ -111,7 +111,6 @@ ${methods_str} " } - fn ts_type(v_type string) string { return match v_type { 'string' { 'string' } @@ -120,7 +119,7 @@ fn ts_type(v_type string) string { 'f32', 'f64' { 'number' } '[]string' { 'string[]' } '[]int' { 'number[]' } - 'array' { 'any[]' } - else { v_type } + 'array' { 'any[]' } + else { v_type } } -} \ No newline at end of file +} diff --git a/lib/hero/typescriptgenerator/generator_test.v b/lib/hero/typescriptgenerator/generator_test.v index 4ce56276..2b7178ba 100644 --- a/lib/hero/typescriptgenerator/generator_test.v +++ b/lib/hero/typescriptgenerator/generator_test.v @@ -1,37 +1,36 @@ module typescriptgenerator -import freeflowuniverse.herolib.schemas.openrpc +import incubaid.herolib.schemas.openrpc import os const openrpc_path = os.dir(@FILE) + '/../../heromodels/openrpc.json' const output_dir = os.dir(@FILE) + '/test_generated_ts_client' - fn test_generate_typescript_client() { - spec_text := os.read_file(openrpc_path) or { - eprintln('Failed to read openrpc.json: ${err}') - return - } + spec_text := os.read_file(openrpc_path) or { + eprintln('Failed to read openrpc.json: ${err}') + return + } - openrpc_spec := openrpc.decode(spec_text) or { - eprintln('Failed to decode openrpc spec: ${err}') - return - } + openrpc_spec := openrpc.decode(spec_text) or { + eprintln('Failed to decode openrpc spec: ${err}') + return + } - config := IntermediateConfig{ - base_url: 'http://localhost:8086/api/heromodels' - handler_type: 'heromodels' - } + config := IntermediateConfig{ + base_url: 'http://localhost:8086/api/heromodels' + handler_type: 'heromodels' + } - intermediate_spec := from_openrpc(openrpc_spec, config) or { - eprintln('Failed to create intermediate spec: ${err}') - return - } + intermediate_spec := from_openrpc(openrpc_spec, config) or { + eprintln('Failed to create intermediate spec: ${err}') + return + } - generate_typescript_client(intermediate_spec, output_dir) or { - eprintln('Failed to generate typescript client: ${err}') - return - } - - println("TypeScript client generated successfully in ${output_dir}") -} \ No newline at end of file + generate_typescript_client(intermediate_spec, output_dir) or { + eprintln('Failed to generate typescript client: ${err}') + return + } + + println('TypeScript client generated successfully in ${output_dir}') +} diff --git a/lib/hero/typescriptgenerator/intermediate_model.v b/lib/hero/typescriptgenerator/intermediate_model.v index aa5e1475..b5a23e23 100644 --- a/lib/hero/typescriptgenerator/intermediate_model.v +++ b/lib/hero/typescriptgenerator/intermediate_model.v @@ -1,15 +1,15 @@ module typescriptgenerator -import freeflowuniverse.herolib.schemas.openrpc -import freeflowuniverse.herolib.schemas.jsonschema +import incubaid.herolib.schemas.openrpc +import incubaid.herolib.schemas.jsonschema // IntermediateSpec is the main object passed to the typescript generator. pub struct IntermediateSpec { pub mut: - info openrpc.Info - methods []IntermediateMethod - schemas map[string]IntermediateSchema - base_url string + info openrpc.Info + methods []IntermediateMethod + schemas map[string]IntermediateSchema + base_url string } // IntermediateSchema represents a schema in a format that's easy to consume for generation. @@ -23,12 +23,12 @@ pub mut: // IntermediateMethod holds the information for a single method to be displayed. pub struct IntermediateMethod { pub mut: - name string - summary string - description string - params []IntermediateParam - result IntermediateParam - endpoint_url string + name string + summary string + description string + params []IntermediateParam + result IntermediateParam + endpoint_url string } // IntermediateParam represents a parameter or result in the documentation @@ -43,10 +43,10 @@ pub mut: // IntermediateProperty represents a property of a schema pub struct IntermediateProperty { pub mut: - name string - description string - type_info string - required bool + name string + description string + type_info string + required bool } // IntermediateConfig holds configuration for documentation generation @@ -65,10 +65,10 @@ pub fn from_openrpc(openrpc_spec openrpc.OpenRPC, config IntermediateConfig) !In mut schemas_map := process_schemas(openrpc_spec.components.schemas)! mut intermediate_spec := IntermediateSpec{ - info: openrpc_spec.info - methods: []IntermediateMethod{} - schemas: schemas_map - base_url: config.base_url + info: openrpc_spec.info + methods: []IntermediateMethod{} + schemas: schemas_map + base_url: config.base_url } // Process all methods @@ -88,12 +88,12 @@ fn process_method(method openrpc.Method, config IntermediateConfig) !Intermediat intermediate_result := process_result(method.result)! intermediate_method := IntermediateMethod{ - name: method.name - summary: method.summary - description: method.description - params: intermediate_params - result: intermediate_result - endpoint_url: '${config.base_url}/api/${config.handler_type}' + name: method.name + summary: method.summary + description: method.description + params: intermediate_params + result: intermediate_result + endpoint_url: '${config.base_url}/api/${config.handler_type}' } return intermediate_method @@ -113,7 +113,7 @@ fn process_parameters(params []openrpc.ContentDescriptorRef) ![]IntermediatePara required: param.required } } else if param is jsonschema.Reference { - //TODO: handle reference + // TODO: handle reference // For now, create a placeholder parameter intermediate_params << IntermediateParam{ name: 'reference' @@ -146,10 +146,10 @@ fn process_result(result openrpc.ContentDescriptorRef) !IntermediateParam { } } else if result is jsonschema.Reference { // handle reference - ref := result as jsonschema.Reference - type_info := ref.ref.all_after_last('/') - intermediate_result = IntermediateParam{ - name: type_info.to_lower() + ref := result as jsonschema.Reference + type_info := ref.ref.all_after_last('/') + intermediate_result = IntermediateParam{ + name: type_info.to_lower() description: '' type_info: type_info required: false @@ -173,7 +173,7 @@ fn extract_type_from_schema(schema_ref jsonschema.SchemaRef) string { schema_ref } jsonschema.Reference { - ref := schema_ref as jsonschema.Reference + ref := schema_ref as jsonschema.Reference return ref.ref.all_after_last('/') } } @@ -184,31 +184,30 @@ fn extract_type_from_schema(schema_ref jsonschema.SchemaRef) string { return 'unknown' } - fn process_schemas(schemas map[string]jsonschema.SchemaRef) !map[string]IntermediateSchema { - // Initialize the map with a known size if possible - mut intermediate_schemas := map[string]IntermediateSchema{} - - // Process each schema in the map - for name, schema_ref in schemas { - if schema_ref is jsonschema.Schema { - schema := schema_ref as jsonschema.Schema - mut properties := []IntermediateProperty{} - for prop_name, prop_schema_ref in schema.properties { - prop_type := extract_type_from_schema(prop_schema_ref) - properties << IntermediateProperty{ - name: prop_name - description: "" // TODO - type_info: prop_type - required: prop_name in schema.required - } - } - intermediate_schemas[name] = IntermediateSchema{ - name: name - description: schema.description - properties: properties - } - } - } - return intermediate_schemas -} \ No newline at end of file + // Initialize the map with a known size if possible + mut intermediate_schemas := map[string]IntermediateSchema{} + + // Process each schema in the map + for name, schema_ref in schemas { + if schema_ref is jsonschema.Schema { + schema := schema_ref as jsonschema.Schema + mut properties := []IntermediateProperty{} + for prop_name, prop_schema_ref in schema.properties { + prop_type := extract_type_from_schema(prop_schema_ref) + properties << IntermediateProperty{ + name: prop_name + description: '' // TODO + type_info: prop_type + required: prop_name in schema.required + } + } + intermediate_schemas[name] = IntermediateSchema{ + name: name + description: schema.description + properties: properties + } + } + } + return intermediate_schemas +} diff --git a/lib/installers/base/installer.v b/lib/installers/base/installer.v index 20fc918f..c280bbf1 100644 --- a/lib/installers/base/installer.v +++ b/lib/installers/base/installer.v @@ -1,8 +1,8 @@ module base -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console +import incubaid.herolib.core import os @[params] diff --git a/lib/installers/base/play.v b/lib/installers/base/play.v index 358ef441..78d2a9a2 100644 --- a/lib/installers/base/play.v +++ b/lib/installers/base/play.v @@ -1,7 +1,7 @@ module base -import freeflowuniverse.herolib.core.playbook -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook +import incubaid.herolib.ui.console pub fn play(mut plbook playbook.PlayBook) ! { if plbook.exists(filter: 'base.install') { diff --git a/lib/installers/base/redis.v b/lib/installers/base/redis.v index adaf8942..330260ab 100644 --- a/lib/installers/base/redis.v +++ b/lib/installers/base/redis.v @@ -1,10 +1,10 @@ module base -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.osal.startupmanager -import freeflowuniverse.herolib.core +import incubaid.herolib.osal.core as osal +import incubaid.herolib.core.pathlib +import incubaid.herolib.ui.console +import incubaid.herolib.osal.startupmanager +import incubaid.herolib.core import time import os diff --git a/lib/installers/db/cometbft/cometbft_actions.v b/lib/installers/db/cometbft/cometbft_actions.v index c391931d..6b4eeb1e 100644 --- a/lib/installers/db/cometbft/cometbft_actions.v +++ b/lib/installers/db/cometbft/cometbft_actions.v @@ -1,15 +1,15 @@ module cometbft -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.osal.systemd -import freeflowuniverse.herolib.osal.startupmanager -import freeflowuniverse.herolib.installers.ulist -import freeflowuniverse.herolib.installers.lang.golang -import freeflowuniverse.herolib.installers.lang.rust -import freeflowuniverse.herolib.installers.lang.python +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.core.pathlib +import incubaid.herolib.osal.systemd +import incubaid.herolib.osal.startupmanager +import incubaid.herolib.installers.ulist +import incubaid.herolib.installers.lang.golang +import incubaid.herolib.installers.lang.rust +import incubaid.herolib.installers.lang.python import os fn startupcmd() ![]startupmanager.ZProcessNewArgs { diff --git a/lib/installers/db/cometbft/cometbft_factory_.v b/lib/installers/db/cometbft/cometbft_factory_.v index 542d8e0f..739e7b2e 100644 --- a/lib/installers/db/cometbft/cometbft_factory_.v +++ b/lib/installers/db/cometbft/cometbft_factory_.v @@ -1,10 +1,10 @@ module cometbft -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.base +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager import time __global ( diff --git a/lib/installers/db/cometbft/cometbft_model.v b/lib/installers/db/cometbft/cometbft_model.v index be068409..a10c4cee 100644 --- a/lib/installers/db/cometbft/cometbft_model.v +++ b/lib/installers/db/cometbft/cometbft_model.v @@ -1,7 +1,7 @@ module cometbft -import freeflowuniverse.herolib.data.paramsparser -import freeflowuniverse.herolib.data.encoderhero +import incubaid.herolib.data.paramsparser +import incubaid.herolib.data.encoderhero import os pub const version = '0.0.0' diff --git a/lib/installers/db/cometbft/readme.md b/lib/installers/db/cometbft/readme.md index 412a9a09..fbd920d0 100644 --- a/lib/installers/db/cometbft/readme.md +++ b/lib/installers/db/cometbft/readme.md @@ -1,13 +1,11 @@ # cometbft - - To get started ```v -import freeflowuniverse.herolib.installers.db.cometbft as cometbft_installer +import incubaid.herolib.installers.db.cometbft as cometbft_installer heroscript:=" !!cometbft.configure name:'test' @@ -40,5 +38,3 @@ cometbft_installer.play(heroscript=heroscript)! port: 8888 ``` - - diff --git a/lib/installers/db/meilisearch_installer/meilisearch_installer_actions.v b/lib/installers/db/meilisearch_installer/meilisearch_installer_actions.v index 3b93f936..9186f624 100644 --- a/lib/installers/db/meilisearch_installer/meilisearch_installer_actions.v +++ b/lib/installers/db/meilisearch_installer/meilisearch_installer_actions.v @@ -1,11 +1,11 @@ module meilisearch_installer -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.osal.startupmanager -import freeflowuniverse.herolib.installers.ulist -import freeflowuniverse.herolib.core.httpconnection -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console +import incubaid.herolib.osal.startupmanager +import incubaid.herolib.installers.ulist +import incubaid.herolib.core.httpconnection +import incubaid.herolib.core.texttools import os import rand import json diff --git a/lib/installers/db/meilisearch_installer/meilisearch_installer_factory_.v b/lib/installers/db/meilisearch_installer/meilisearch_installer_factory_.v index bbdd01fc..5a69a5e3 100644 --- a/lib/installers/db/meilisearch_installer/meilisearch_installer_factory_.v +++ b/lib/installers/db/meilisearch_installer/meilisearch_installer_factory_.v @@ -1,10 +1,10 @@ module meilisearch_installer -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.base +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager import time __global ( diff --git a/lib/installers/db/meilisearch_installer/meilisearch_installer_model.v b/lib/installers/db/meilisearch_installer/meilisearch_installer_model.v index 6fd6afdf..c2ea1a54 100644 --- a/lib/installers/db/meilisearch_installer/meilisearch_installer_model.v +++ b/lib/installers/db/meilisearch_installer/meilisearch_installer_model.v @@ -1,6 +1,6 @@ module meilisearch_installer -import freeflowuniverse.herolib.data.encoderhero +import incubaid.herolib.data.encoderhero pub const version = '1.11.3' const singleton = false diff --git a/lib/installers/db/meilisearch_installer/readme.md b/lib/installers/db/meilisearch_installer/readme.md index 92e61d3b..05799bd0 100644 --- a/lib/installers/db/meilisearch_installer/readme.md +++ b/lib/installers/db/meilisearch_installer/readme.md @@ -1,13 +1,11 @@ # meilisearch - - To get started ```v -import freeflowuniverse.herolib.installers.db.meilisearch as meilisearchinstaller +import incubaid.herolib.installers.db.meilisearch as meilisearchinstaller heroscript:=" !!meilisearch.configure name:'test' @@ -39,5 +37,3 @@ meilisearchinstaller.play(heroscript=heroscript)! production: 0 ``` - - diff --git a/lib/installers/db/postgresql/postgresql_actions.v b/lib/installers/db/postgresql/postgresql_actions.v index 6feec92a..00896172 100644 --- a/lib/installers/db/postgresql/postgresql_actions.v +++ b/lib/installers/db/postgresql/postgresql_actions.v @@ -1,10 +1,10 @@ module postgresql -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.installers.virt.podman as podman_installer -import freeflowuniverse.herolib.osal.startupmanager -import freeflowuniverse.herolib.installers.ulist +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console +import incubaid.herolib.installers.virt.podman as podman_installer +import incubaid.herolib.osal.startupmanager +import incubaid.herolib.installers.ulist import os fn startupcmd() ![]startupmanager.ZProcessNewArgs { diff --git a/lib/installers/db/postgresql/postgresql_factory_.v b/lib/installers/db/postgresql/postgresql_factory_.v index 10210aad..38a3e36b 100644 --- a/lib/installers/db/postgresql/postgresql_factory_.v +++ b/lib/installers/db/postgresql/postgresql_factory_.v @@ -1,10 +1,10 @@ module postgresql -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.base +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager import time __global ( diff --git a/lib/installers/db/postgresql/postgresql_model.v b/lib/installers/db/postgresql/postgresql_model.v index fba4cf2c..878ea792 100644 --- a/lib/installers/db/postgresql/postgresql_model.v +++ b/lib/installers/db/postgresql/postgresql_model.v @@ -1,6 +1,6 @@ module postgresql -import freeflowuniverse.herolib.data.encoderhero +import incubaid.herolib.data.encoderhero pub const version = '0.0.0' const singleton = true diff --git a/lib/installers/db/postgresql/readme.md b/lib/installers/db/postgresql/readme.md index ba45ab97..c76d3c9a 100644 --- a/lib/installers/db/postgresql/readme.md +++ b/lib/installers/db/postgresql/readme.md @@ -1,14 +1,12 @@ # postgresql - - To get started ```v -import freeflowuniverse.herolib.installers.something. postgresql +import incubaid.herolib.installers.something. postgresql mut installer:= postgresql.get()! @@ -21,7 +19,6 @@ installer.start()! ## example heroscript - ```hero !!postgresql.install homedir: '/home/user/postgresql' @@ -32,5 +29,3 @@ installer.start()! port: 8888 ``` - - diff --git a/lib/installers/db/qdrant_installer/qdrant_installer_actions.v b/lib/installers/db/qdrant_installer/qdrant_installer_actions.v index 76579766..b5fbfa42 100644 --- a/lib/installers/db/qdrant_installer/qdrant_installer_actions.v +++ b/lib/installers/db/qdrant_installer/qdrant_installer_actions.v @@ -1,8 +1,8 @@ module qdrant_installer -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.osal.startupmanager -import freeflowuniverse.herolib.installers.ulist +import incubaid.herolib.ui.console +import incubaid.herolib.osal.startupmanager +import incubaid.herolib.installers.ulist import os fn startupcmd() ![]startupmanager.ZProcessNewArgs { diff --git a/lib/installers/db/qdrant_installer/qdrant_installer_factory_.v b/lib/installers/db/qdrant_installer/qdrant_installer_factory_.v index 4cdf077a..d0ff1411 100644 --- a/lib/installers/db/qdrant_installer/qdrant_installer_factory_.v +++ b/lib/installers/db/qdrant_installer/qdrant_installer_factory_.v @@ -1,10 +1,10 @@ module qdrant_installer -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.base +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager import time __global ( diff --git a/lib/installers/db/qdrant_installer/qdrant_installer_model.v b/lib/installers/db/qdrant_installer/qdrant_installer_model.v index cd878a95..4f2518a5 100644 --- a/lib/installers/db/qdrant_installer/qdrant_installer_model.v +++ b/lib/installers/db/qdrant_installer/qdrant_installer_model.v @@ -1,7 +1,7 @@ module qdrant_installer -import freeflowuniverse.herolib.data.encoderhero -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.data.encoderhero +import incubaid.herolib.core.pathlib import os pub const version = '1.13.4' diff --git a/lib/installers/db/qdrant_installer/readme.md b/lib/installers/db/qdrant_installer/readme.md index cc2e142f..9d60a0dd 100644 --- a/lib/installers/db/qdrant_installer/readme.md +++ b/lib/installers/db/qdrant_installer/readme.md @@ -6,7 +6,7 @@ To get started ```v -import freeflowuniverse.herolib.installers.db.qdrant_installer +import incubaid.herolib.installers.db.qdrant_installer heroscript:=" !!qdrant.configure name:'test' diff --git a/lib/installers/db/zerodb/zerodb_actions.v b/lib/installers/db/zerodb/zerodb_actions.v index ba434822..cadb2a06 100644 --- a/lib/installers/db/zerodb/zerodb_actions.v +++ b/lib/installers/db/zerodb/zerodb_actions.v @@ -1,14 +1,14 @@ module zerodb -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core -import freeflowuniverse.herolib.osal.startupmanager -import freeflowuniverse.herolib.installers.ulist -import freeflowuniverse.herolib.develop.gittools -import freeflowuniverse.herolib.installers.base -import freeflowuniverse.herolib.crypt.secrets -import freeflowuniverse.herolib.clients.zerodb_client +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console +import incubaid.herolib.core +import incubaid.herolib.osal.startupmanager +import incubaid.herolib.installers.ulist +import incubaid.herolib.develop.gittools +import incubaid.herolib.installers.base +import incubaid.herolib.crypt.secrets +import incubaid.herolib.clients.zerodb_client import crypto.md5 import rand import os diff --git a/lib/installers/db/zerodb/zerodb_factory_.v b/lib/installers/db/zerodb/zerodb_factory_.v index 796d239c..ff70ffd8 100644 --- a/lib/installers/db/zerodb/zerodb_factory_.v +++ b/lib/installers/db/zerodb/zerodb_factory_.v @@ -1,10 +1,10 @@ module zerodb -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.base +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager import time __global ( diff --git a/lib/installers/db/zerodb/zerodb_model.v b/lib/installers/db/zerodb/zerodb_model.v index 4ef18790..d987a514 100644 --- a/lib/installers/db/zerodb/zerodb_model.v +++ b/lib/installers/db/zerodb/zerodb_model.v @@ -1,10 +1,10 @@ module zerodb -import freeflowuniverse.herolib.data.encoderhero +import incubaid.herolib.data.encoderhero import os import rand import crypto.md5 -import freeflowuniverse.herolib.crypt.secrets +import incubaid.herolib.crypt.secrets pub const version = '2.0.7' const singleton = true diff --git a/lib/installers/db/zerofs/rfs.v b/lib/installers/db/zerofs/rfs.v index 02b3fc9e..4d03b94d 100644 --- a/lib/installers/db/zerofs/rfs.v +++ b/lib/installers/db/zerofs/rfs.v @@ -1,10 +1,10 @@ module rfs -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.installers.lang.rust -import freeflowuniverse.herolib.develop.gittools -import freeflowuniverse.herolib.installers.zinit -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.osal.core as osal +import incubaid.herolib.installers.lang.rust +import incubaid.herolib.develop.gittools +import incubaid.herolib.installers.zinit +import incubaid.herolib.ui.console pub fn install_() ! { rust.install()! diff --git a/lib/installers/db/zerofs/zerofs_actions.v b/lib/installers/db/zerofs/zerofs_actions.v index 8284594e..543a5866 100644 --- a/lib/installers/db/zerofs/zerofs_actions.v +++ b/lib/installers/db/zerofs/zerofs_actions.v @@ -1,15 +1,15 @@ module zerofs -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.osal.systemd -import freeflowuniverse.herolib.osal.startupmanager -import freeflowuniverse.herolib.installers.ulist -import freeflowuniverse.herolib.installers.lang.golang -import freeflowuniverse.herolib.installers.lang.rust -import freeflowuniverse.herolib.installers.lang.python +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.core.pathlib +import incubaid.herolib.osal.systemd +import incubaid.herolib.osal.startupmanager +import incubaid.herolib.installers.ulist +import incubaid.herolib.installers.lang.golang +import incubaid.herolib.installers.lang.rust +import incubaid.herolib.installers.lang.python import os fn startupcmd() ![]startupmanager.ZProcessNewArgs { diff --git a/lib/installers/db/zerofs/zerofs_factory_.v b/lib/installers/db/zerofs/zerofs_factory_.v index 97c51e17..1078f6fe 100644 --- a/lib/installers/db/zerofs/zerofs_factory_.v +++ b/lib/installers/db/zerofs/zerofs_factory_.v @@ -1,9 +1,9 @@ module zerofs -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager import time __global ( diff --git a/lib/installers/db/zerofs/zerofs_model.v b/lib/installers/db/zerofs/zerofs_model.v index 21ddaabd..aa7cc8f3 100644 --- a/lib/installers/db/zerofs/zerofs_model.v +++ b/lib/installers/db/zerofs/zerofs_model.v @@ -1,6 +1,6 @@ module zerofs -import freeflowuniverse.herolib.data.paramsparser +import incubaid.herolib.data.paramsparser import os pub const version = '0.0.0' diff --git a/lib/installers/develapps/chrome/chrome.v b/lib/installers/develapps/chrome/chrome.v index 8f1137e2..5e9017c9 100644 --- a/lib/installers/develapps/chrome/chrome.v +++ b/lib/installers/develapps/chrome/chrome.v @@ -1,8 +1,8 @@ module chrome -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.core -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.osal.core as osal +import incubaid.herolib.core +import incubaid.herolib.ui.console import os @[params] diff --git a/lib/installers/develapps/vscode/vscode.v b/lib/installers/develapps/vscode/vscode.v index 17520c7a..2b7524dc 100644 --- a/lib/installers/develapps/vscode/vscode.v +++ b/lib/installers/develapps/vscode/vscode.v @@ -1,8 +1,8 @@ module vscode -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.core -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.osal.core as osal +import incubaid.herolib.core +import incubaid.herolib.ui.console import os @[params] diff --git a/lib/installers/infra/coredns/coredns_actions.v b/lib/installers/infra/coredns/coredns_actions.v index 494150ac..5e102863 100644 --- a/lib/installers/infra/coredns/coredns_actions.v +++ b/lib/installers/infra/coredns/coredns_actions.v @@ -1,15 +1,15 @@ module coredns -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.core -import freeflowuniverse.herolib.develop.gittools -import freeflowuniverse.herolib.osal.startupmanager -import freeflowuniverse.herolib.installers.ulist -import freeflowuniverse.herolib.core.httpconnection -import freeflowuniverse.herolib.installers.lang.golang +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.core.pathlib +import incubaid.herolib.core +import incubaid.herolib.develop.gittools +import incubaid.herolib.osal.startupmanager +import incubaid.herolib.installers.ulist +import incubaid.herolib.core.httpconnection +import incubaid.herolib.installers.lang.golang import os fn startupcmd() ![]startupmanager.ZProcessNewArgs { diff --git a/lib/installers/infra/coredns/coredns_configure.v b/lib/installers/infra/coredns/coredns_configure.v index 1e358457..13f8c92f 100644 --- a/lib/installers/infra/coredns/coredns_configure.v +++ b/lib/installers/infra/coredns/coredns_configure.v @@ -1,8 +1,8 @@ module coredns -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.develop.gittools +import incubaid.herolib.core.pathlib +import incubaid.herolib.osal.core as osal +import incubaid.herolib.develop.gittools import os pub fn configure() ! { diff --git a/lib/installers/infra/coredns/coredns_factory_.v b/lib/installers/infra/coredns/coredns_factory_.v index 08885674..358510a1 100644 --- a/lib/installers/infra/coredns/coredns_factory_.v +++ b/lib/installers/infra/coredns/coredns_factory_.v @@ -1,10 +1,10 @@ module coredns -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.base +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager import time __global ( diff --git a/lib/installers/infra/coredns/coredns_fix.v b/lib/installers/infra/coredns/coredns_fix.v index f1856954..2c3cf44a 100644 --- a/lib/installers/infra/coredns/coredns_fix.v +++ b/lib/installers/infra/coredns/coredns_fix.v @@ -2,7 +2,7 @@ module coredns import os import net -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console fn is_systemd_resolved_active() bool { result := os.execute('systemctl is-active systemd-resolved') diff --git a/lib/installers/infra/coredns/coredns_model.v b/lib/installers/infra/coredns/coredns_model.v index 7532f348..d51eecbb 100644 --- a/lib/installers/infra/coredns/coredns_model.v +++ b/lib/installers/infra/coredns/coredns_model.v @@ -1,7 +1,7 @@ module coredns -import freeflowuniverse.herolib.data.paramsparser -import freeflowuniverse.herolib.data.encoderhero +import incubaid.herolib.data.paramsparser +import incubaid.herolib.data.encoderhero import os pub const version = '1.12.0' diff --git a/lib/installers/infra/gitea/gitea_actions.v b/lib/installers/infra/gitea/gitea_actions.v index 4ea704bf..8482d0a5 100644 --- a/lib/installers/infra/gitea/gitea_actions.v +++ b/lib/installers/infra/gitea/gitea_actions.v @@ -1,11 +1,11 @@ module gitea -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.core -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.installers.ulist -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.core as osal +import incubaid.herolib.core +import incubaid.herolib.core.texttools +import incubaid.herolib.ui.console +import incubaid.herolib.installers.ulist +import incubaid.herolib.osal.startupmanager import os fn installed() !bool { diff --git a/lib/installers/infra/gitea/gitea_factory_.v b/lib/installers/infra/gitea/gitea_factory_.v index 459bfc16..2230501e 100644 --- a/lib/installers/infra/gitea/gitea_factory_.v +++ b/lib/installers/infra/gitea/gitea_factory_.v @@ -1,10 +1,10 @@ module gitea -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.base +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager import time __global ( diff --git a/lib/installers/infra/gitea/gitea_model.v b/lib/installers/infra/gitea/gitea_model.v index c30c8251..1d693301 100644 --- a/lib/installers/infra/gitea/gitea_model.v +++ b/lib/installers/infra/gitea/gitea_model.v @@ -1,13 +1,13 @@ module gitea -import freeflowuniverse.herolib.data.paramsparser -import freeflowuniverse.herolib.data.encoderhero -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.osal.core as osal +import incubaid.herolib.data.paramsparser +import incubaid.herolib.data.encoderhero +import incubaid.herolib.core.pathlib +import incubaid.herolib.ui.console +import incubaid.herolib.osal.core as osal import os -import freeflowuniverse.herolib.clients.mailclient -import freeflowuniverse.herolib.clients.postgresql_client +import incubaid.herolib.clients.mailclient +import incubaid.herolib.clients.postgresql_client import rand pub const version = '1.24.5' diff --git a/lib/installers/infra/gitea/play.v b/lib/installers/infra/gitea/play.v index 9357cf6d..4ebbf5db 100644 --- a/lib/installers/infra/gitea/play.v +++ b/lib/installers/infra/gitea/play.v @@ -1,8 +1,8 @@ module gitea -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.installers.infra.gitea { install } +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console +import incubaid.herolib.installers.infra.gitea { install } pub fn play(mut plbook PlayBook) ! { if !plbook.exists(filter: 'gitea.') { diff --git a/lib/installers/infra/livekit/livekit_actions.v b/lib/installers/infra/livekit/livekit_actions.v index 35f2b64b..75a6244a 100644 --- a/lib/installers/infra/livekit/livekit_actions.v +++ b/lib/installers/infra/livekit/livekit_actions.v @@ -1,10 +1,10 @@ module livekit -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.osal.startupmanager -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.installers.ulist +import incubaid.herolib.osal.core as osal +import incubaid.herolib.osal.startupmanager +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.installers.ulist import net.http import json import os diff --git a/lib/installers/infra/livekit/livekit_factory_.v b/lib/installers/infra/livekit/livekit_factory_.v index 9d920286..9e10021b 100644 --- a/lib/installers/infra/livekit/livekit_factory_.v +++ b/lib/installers/infra/livekit/livekit_factory_.v @@ -1,10 +1,10 @@ module livekit -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.base +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager import time __global ( diff --git a/lib/installers/infra/livekit/livekit_model.v b/lib/installers/infra/livekit/livekit_model.v index 3ba7bfd4..c97e32ab 100644 --- a/lib/installers/infra/livekit/livekit_model.v +++ b/lib/installers/infra/livekit/livekit_model.v @@ -1,8 +1,8 @@ module livekit -import freeflowuniverse.herolib.data.encoderhero -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.data.encoderhero +import incubaid.herolib.core.pathlib +import incubaid.herolib.ui.console import os pub const version = '1.9.0' diff --git a/lib/installers/infra/zinit_installer/zinit_installer_actions.v b/lib/installers/infra/zinit_installer/zinit_installer_actions.v index 9298ce86..e1a90774 100644 --- a/lib/installers/infra/zinit_installer/zinit_installer_actions.v +++ b/lib/installers/infra/zinit_installer/zinit_installer_actions.v @@ -1,14 +1,14 @@ module zinit_installer -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.develop.gittools -import freeflowuniverse.herolib.core -import freeflowuniverse.herolib.osal.systemd -import freeflowuniverse.herolib.installers.ulist -import freeflowuniverse.herolib.installers.lang.rust -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.develop.gittools +import incubaid.herolib.core +import incubaid.herolib.osal.systemd +import incubaid.herolib.installers.ulist +import incubaid.herolib.installers.lang.rust +import incubaid.herolib.osal.startupmanager import os fn startupcmd() ![]startupmanager.ZProcessNewArgs { diff --git a/lib/installers/infra/zinit_installer/zinit_installer_factory_.v b/lib/installers/infra/zinit_installer/zinit_installer_factory_.v index 41a4baaa..7273351a 100644 --- a/lib/installers/infra/zinit_installer/zinit_installer_factory_.v +++ b/lib/installers/infra/zinit_installer/zinit_installer_factory_.v @@ -1,9 +1,9 @@ module zinit_installer -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager import time __global ( diff --git a/lib/installers/infra/zinit_installer/zinit_installer_model.v b/lib/installers/infra/zinit_installer/zinit_installer_model.v index a288b66c..6e81b31a 100644 --- a/lib/installers/infra/zinit_installer/zinit_installer_model.v +++ b/lib/installers/infra/zinit_installer/zinit_installer_model.v @@ -1,6 +1,6 @@ module zinit_installer -import freeflowuniverse.herolib.data.encoderhero +import incubaid.herolib.data.encoderhero pub const version = '0.2.27' const singleton = true diff --git a/lib/installers/install_multi.v b/lib/installers/install_multi.v index a3d0b3bf..9344a52d 100644 --- a/lib/installers/install_multi.v +++ b/lib/installers/install_multi.v @@ -1,30 +1,30 @@ module installers -import freeflowuniverse.herolib.installers.base -// import freeflowuniverse.herolib.installers.develapps.vscode -// import freeflowuniverse.herolib.installers.develapps.chrome -// import freeflowuniverse.herolib.installers.virt.podman as podman_installer -// import freeflowuniverse.herolib.installers.virt.buildah as buildah_installer -// import freeflowuniverse.herolib.installers.virt.lima -// import freeflowuniverse.herolib.installers.net.mycelium -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.installers.lang.rust -import freeflowuniverse.herolib.installers.lang.golang -import freeflowuniverse.herolib.installers.lang.vlang -import freeflowuniverse.herolib.installers.lang.herolib -import freeflowuniverse.herolib.installers.lang.nodejs -import freeflowuniverse.herolib.installers.lang.python -// import freeflowuniverse.herolib.installers.web.zola -// import freeflowuniverse.herolib.installers.web.tailwind -// import freeflowuniverse.herolib.installers.hero.heroweb -// import freeflowuniverse.herolib.installers.hero.herodev -// import freeflowuniverse.herolib.installers.sysadmintools.daguserver -import freeflowuniverse.herolib.installers.sysadmintools.rclone -// import freeflowuniverse.herolib.installers.sysadmintools.prometheus -// import freeflowuniverse.herolib.installers.sysadmintools.grafana -// import freeflowuniverse.herolib.installers.sysadmintools.fungistor -// import freeflowuniverse.herolib.installers.sysadmintools.garage_s3 -import freeflowuniverse.herolib.installers.infra.zinit_installer +import incubaid.herolib.installers.base +// import incubaid.herolib.installers.develapps.vscode +// import incubaid.herolib.installers.develapps.chrome +// import incubaid.herolib.installers.virt.podman as podman_installer +// import incubaid.herolib.installers.virt.buildah as buildah_installer +// import incubaid.herolib.installers.virt.lima +// import incubaid.herolib.installers.net.mycelium +import incubaid.herolib.core.texttools +import incubaid.herolib.installers.lang.rust +import incubaid.herolib.installers.lang.golang +import incubaid.herolib.installers.lang.vlang +import incubaid.herolib.installers.lang.herolib +import incubaid.herolib.installers.lang.nodejs +import incubaid.herolib.installers.lang.python +// import incubaid.herolib.installers.web.zola +// import incubaid.herolib.installers.web.tailwind +// import incubaid.herolib.installers.hero.heroweb +// import incubaid.herolib.installers.hero.herodev +// import incubaid.herolib.installers.sysadmintools.daguserver +import incubaid.herolib.installers.sysadmintools.rclone +// import incubaid.herolib.installers.sysadmintools.prometheus +// import incubaid.herolib.installers.sysadmintools.grafana +// import incubaid.herolib.installers.sysadmintools.fungistor +// import incubaid.herolib.installers.sysadmintools.garage_s3 +import incubaid.herolib.installers.infra.zinit_installer @[params] pub struct InstallArgs { diff --git a/lib/installers/lang/golang/golang_actions.v b/lib/installers/lang/golang/golang_actions.v index d2de4de5..c5ebed6d 100644 --- a/lib/installers/lang/golang/golang_actions.v +++ b/lib/installers/lang/golang/golang_actions.v @@ -1,11 +1,11 @@ module golang -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core -import freeflowuniverse.herolib.installers.base -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.installers.ulist +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console +import incubaid.herolib.core +import incubaid.herolib.installers.base +import incubaid.herolib.core.texttools +import incubaid.herolib.installers.ulist import os //////////////////// following actions are not specific to instance of the object diff --git a/lib/installers/lang/golang/golang_factory_.v b/lib/installers/lang/golang/golang_factory_.v index e7cb7ecb..f655d4f8 100644 --- a/lib/installers/lang/golang/golang_factory_.v +++ b/lib/installers/lang/golang/golang_factory_.v @@ -1,9 +1,9 @@ module golang -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager __global ( golang_global map[string]&GolangInstaller diff --git a/lib/installers/lang/golang/golang_model.v b/lib/installers/lang/golang/golang_model.v index f03a9651..9e4fc7b6 100644 --- a/lib/installers/lang/golang/golang_model.v +++ b/lib/installers/lang/golang/golang_model.v @@ -1,6 +1,6 @@ module golang -import freeflowuniverse.herolib.data.encoderhero +import incubaid.herolib.data.encoderhero pub const version = '1.23.6' const singleton = true diff --git a/lib/installers/lang/golang/readme.md b/lib/installers/lang/golang/readme.md index ca110c61..8bc5a7b2 100644 --- a/lib/installers/lang/golang/readme.md +++ b/lib/installers/lang/golang/readme.md @@ -1,13 +1,11 @@ # golang - - To get started ```v -import freeflowuniverse.herolib.installers.lang.golang +import incubaid.herolib.installers.lang.golang mut installer:= golang.get()! @@ -15,4 +13,3 @@ mut installer:= golang.get()! installer.install()! ``` - diff --git a/lib/installers/lang/herolib/herolib.v b/lib/installers/lang/herolib/herolib.v index 46f1234c..a1c5be82 100644 --- a/lib/installers/lang/herolib/herolib.v +++ b/lib/installers/lang/herolib/herolib.v @@ -1,11 +1,11 @@ module herolib -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.installers.base -import freeflowuniverse.herolib.installers.lang.vlang -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.develop.gittools +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console +import incubaid.herolib.installers.base +import incubaid.herolib.installers.lang.vlang +import incubaid.herolib.core.pathlib +import incubaid.herolib.develop.gittools import os // install herolib will return true if it was already installed @@ -40,7 +40,7 @@ fn install_(args InstallArgs) ! { // mut repo2 := gs.get_repo( // pull: args.git_pull // reset: args.git_reset - // url: 'https://github.com/freeflowuniverse/webcomponents/tree/main/webcomponents' + // url: 'https://github.com/incubaid/webcomponents/tree/main/webcomponents' // )! mut path1 := repo.path() @@ -49,7 +49,7 @@ fn install_(args InstallArgs) ! { mut path1p := pathlib.get_dir(path: path1, create: false)! // mut path2p := pathlib.get_dir(path: path2, create: false)! path1p.link('${os.home_dir()}/.vmodules/incubaid/herolib', true)! - // path2p.link('${os.home_dir()}/.vmodules/freeflowuniverse/webcomponents', true)! + // path2p.link('${os.home_dir()}/.vmodules/incubaid/webcomponents', true)! // hero_compile()! diff --git a/lib/installers/lang/herolib/play.v b/lib/installers/lang/herolib/play.v index e2448680..132a7a8f 100644 --- a/lib/installers/lang/herolib/play.v +++ b/lib/installers/lang/herolib/play.v @@ -1,7 +1,7 @@ module herolib -import freeflowuniverse.herolib.core.playbook -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook +import incubaid.herolib.ui.console pub fn play(mut plbook playbook.PlayBook) ! { if !plbook.exists(filter: 'herolib.') { diff --git a/lib/installers/lang/nodejs/nodejs_actions.v b/lib/installers/lang/nodejs/nodejs_actions.v index b746b9e6..f241a206 100644 --- a/lib/installers/lang/nodejs/nodejs_actions.v +++ b/lib/installers/lang/nodejs/nodejs_actions.v @@ -1,7 +1,7 @@ module nodejs -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.installers.ulist +import incubaid.herolib.ui.console +import incubaid.herolib.installers.ulist import os //////////////////// following actions are not specific to instance of the object diff --git a/lib/installers/lang/nodejs/nodejs_factory_.v b/lib/installers/lang/nodejs/nodejs_factory_.v index 9eec5145..03a5a717 100644 --- a/lib/installers/lang/nodejs/nodejs_factory_.v +++ b/lib/installers/lang/nodejs/nodejs_factory_.v @@ -1,9 +1,9 @@ module nodejs -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager __global ( nodejs_global map[string]&NodeJS diff --git a/lib/installers/lang/nodejs/nodejs_model.v b/lib/installers/lang/nodejs/nodejs_model.v index e01acd6a..9d4ca87c 100644 --- a/lib/installers/lang/nodejs/nodejs_model.v +++ b/lib/installers/lang/nodejs/nodejs_model.v @@ -1,6 +1,6 @@ module nodejs -import freeflowuniverse.herolib.data.encoderhero +import incubaid.herolib.data.encoderhero pub const version = '9.15.2' const singleton = true diff --git a/lib/installers/lang/nodejs/readme.md b/lib/installers/lang/nodejs/readme.md index 04585cd9..e4ec067f 100644 --- a/lib/installers/lang/nodejs/readme.md +++ b/lib/installers/lang/nodejs/readme.md @@ -1,13 +1,11 @@ # nodejs - - To get started ```v -import freeflowuniverse.herolib.installers.something.nodejs as nodejs_installer +import incubaid.herolib.installers.something.nodejs as nodejs_installer heroscript:=" !!nodejs.configure name:'test' @@ -40,5 +38,3 @@ nodejs_installer.play(heroscript=heroscript)! port: 8888 ``` - - diff --git a/lib/installers/lang/python/python_actions.v b/lib/installers/lang/python/python_actions.v index c0834948..41b19322 100644 --- a/lib/installers/lang/python/python_actions.v +++ b/lib/installers/lang/python/python_actions.v @@ -1,11 +1,11 @@ module python -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.core -import freeflowuniverse.herolib.installers.base -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.installers.ulist -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.osal.core as osal +import incubaid.herolib.core +import incubaid.herolib.installers.base +import incubaid.herolib.ui.console +import incubaid.herolib.installers.ulist +import incubaid.herolib.core.texttools import os //////////////////// following actions are not specific to instance of the object diff --git a/lib/installers/lang/python/python_factory_.v b/lib/installers/lang/python/python_factory_.v index 5fd99051..ca7b5bef 100644 --- a/lib/installers/lang/python/python_factory_.v +++ b/lib/installers/lang/python/python_factory_.v @@ -1,9 +1,9 @@ module python -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager __global ( python_global map[string]&PythonInstaller diff --git a/lib/installers/lang/python/python_model.v b/lib/installers/lang/python/python_model.v index ee8818f4..a20c7b80 100644 --- a/lib/installers/lang/python/python_model.v +++ b/lib/installers/lang/python/python_model.v @@ -1,6 +1,6 @@ module python -import freeflowuniverse.herolib.data.encoderhero +import incubaid.herolib.data.encoderhero pub const version = '0.8.11' const singleton = false diff --git a/lib/installers/lang/python/readme.md b/lib/installers/lang/python/readme.md index 8b80bde6..e55b70ed 100644 --- a/lib/installers/lang/python/readme.md +++ b/lib/installers/lang/python/readme.md @@ -1,13 +1,11 @@ # python - - To get started ```v -import freeflowuniverse.herolib.installers.something.python as python_installer +import incubaid.herolib.installers.something.python as python_installer heroscript:=" !!python.configure name:'test' @@ -40,5 +38,3 @@ python_installer.play(heroscript=heroscript)! port: 8888 ``` - - diff --git a/lib/installers/lang/rust/readme.md b/lib/installers/lang/rust/readme.md index 3b251986..40a299ca 100644 --- a/lib/installers/lang/rust/readme.md +++ b/lib/installers/lang/rust/readme.md @@ -1,13 +1,11 @@ # rust - - To get started ```v -import freeflowuniverse.herolib.installers.something.rust as rust_installer +import incubaid.herolib.installers.something.rust as rust_installer heroscript:=" !!rust.configure name:'test' @@ -40,5 +38,3 @@ rust_installer.play(heroscript=heroscript)! port: 8888 ``` - - diff --git a/lib/installers/lang/rust/rust_actions.v b/lib/installers/lang/rust/rust_actions.v index a19dc114..0e20f061 100644 --- a/lib/installers/lang/rust/rust_actions.v +++ b/lib/installers/lang/rust/rust_actions.v @@ -1,12 +1,12 @@ module rust -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.core -import freeflowuniverse.herolib.installers.base -import freeflowuniverse.herolib.installers.ulist +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.core.pathlib +import incubaid.herolib.core +import incubaid.herolib.installers.base +import incubaid.herolib.installers.ulist import os //////////////////// following actions are not specific to instance of the object diff --git a/lib/installers/lang/rust/rust_factory_.v b/lib/installers/lang/rust/rust_factory_.v index f6553aba..b48ec26f 100644 --- a/lib/installers/lang/rust/rust_factory_.v +++ b/lib/installers/lang/rust/rust_factory_.v @@ -1,9 +1,9 @@ module rust -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager __global ( rust_global map[string]&RustInstaller diff --git a/lib/installers/lang/rust/rust_model.v b/lib/installers/lang/rust/rust_model.v index 05a7edd2..9f7071ef 100644 --- a/lib/installers/lang/rust/rust_model.v +++ b/lib/installers/lang/rust/rust_model.v @@ -1,7 +1,7 @@ module rust -import freeflowuniverse.herolib.data.paramsparser -import freeflowuniverse.herolib.data.encoderhero +import incubaid.herolib.data.paramsparser +import incubaid.herolib.data.encoderhero import os pub const version = '1.83.0' diff --git a/lib/installers/lang/vlang/play.v b/lib/installers/lang/vlang/play.v index 8334c822..799718ef 100644 --- a/lib/installers/lang/vlang/play.v +++ b/lib/installers/lang/vlang/play.v @@ -1,7 +1,7 @@ module vlang -import freeflowuniverse.herolib.core.playbook -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook +import incubaid.herolib.ui.console pub fn play(mut plbook playbook.PlayBook) ! { if plbook.exists(filter: 'vlang.install') { diff --git a/lib/installers/lang/vlang/v-analyzer.v b/lib/installers/lang/vlang/v-analyzer.v index e1ea7d04..48de9edd 100644 --- a/lib/installers/lang/vlang/v-analyzer.v +++ b/lib/installers/lang/vlang/v-analyzer.v @@ -1,11 +1,11 @@ module vlang -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.core -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.osal.core as osal +import incubaid.herolib.core +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools import os -// import freeflowuniverse.herolib.sysadmin.downloader +// import incubaid.herolib.sysadmin.downloader pub fn v_analyzer_install(args_ InstallArgs) ! { mut args := args_ diff --git a/lib/installers/lang/vlang/vlang.v b/lib/installers/lang/vlang/vlang.v index 871fb3a9..d0fe5478 100644 --- a/lib/installers/lang/vlang/vlang.v +++ b/lib/installers/lang/vlang/vlang.v @@ -1,13 +1,13 @@ module vlang -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.core -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.osal.core as osal +import incubaid.herolib.core +import incubaid.herolib.core.texttools +import incubaid.herolib.ui.console import os -import freeflowuniverse.herolib.installers.base -import freeflowuniverse.herolib.develop.gittools -// import freeflowuniverse.herolib.sysadmin.downloader +import incubaid.herolib.installers.base +import incubaid.herolib.develop.gittools +// import incubaid.herolib.sysadmin.downloader pub fn install(args_ InstallArgs) ! { mut args := args_ diff --git a/lib/installers/net/mycelium_installer/mycelium_installer_actions.v b/lib/installers/net/mycelium_installer/mycelium_installer_actions.v index c24c1fde..435e8631 100644 --- a/lib/installers/net/mycelium_installer/mycelium_installer_actions.v +++ b/lib/installers/net/mycelium_installer/mycelium_installer_actions.v @@ -1,15 +1,15 @@ module mycelium_installer -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.clients.mycelium -import freeflowuniverse.herolib.develop.gittools -import freeflowuniverse.herolib.osal.startupmanager -import freeflowuniverse.herolib.installers.ulist -import freeflowuniverse.herolib.installers.lang.rust +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.core +import incubaid.herolib.core.pathlib +import incubaid.herolib.clients.mycelium +import incubaid.herolib.develop.gittools +import incubaid.herolib.osal.startupmanager +import incubaid.herolib.installers.ulist +import incubaid.herolib.installers.lang.rust import os fn startupcmd() ![]startupmanager.ZProcessNewArgs { diff --git a/lib/installers/net/mycelium_installer/mycelium_installer_factory_.v b/lib/installers/net/mycelium_installer/mycelium_installer_factory_.v index cfe2b0b1..5f33d7a6 100644 --- a/lib/installers/net/mycelium_installer/mycelium_installer_factory_.v +++ b/lib/installers/net/mycelium_installer/mycelium_installer_factory_.v @@ -1,10 +1,10 @@ module mycelium_installer -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.base +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager import time __global ( diff --git a/lib/installers/net/mycelium_installer/mycelium_installer_model.v b/lib/installers/net/mycelium_installer/mycelium_installer_model.v index 5dcfd8c6..b5daa31e 100644 --- a/lib/installers/net/mycelium_installer/mycelium_installer_model.v +++ b/lib/installers/net/mycelium_installer/mycelium_installer_model.v @@ -1,7 +1,7 @@ module mycelium_installer -import freeflowuniverse.herolib.data.encoderhero -import freeflowuniverse.herolib.osal.tun +import incubaid.herolib.data.encoderhero +import incubaid.herolib.osal.tun pub const version = '0.6.1' const singleton = true diff --git a/lib/installers/net/wireguard_installer/readme.md b/lib/installers/net/wireguard_installer/readme.md index 8047b5c1..9aa8e37f 100644 --- a/lib/installers/net/wireguard_installer/readme.md +++ b/lib/installers/net/wireguard_installer/readme.md @@ -1,13 +1,11 @@ # wireguard - - To get started ```v -import freeflowuniverse.herolib.installers.something.wireguard as wireguard_installer +import incubaid.herolib.installers.something.wireguard as wireguard_installer heroscript:=" !!wireguard.configure name:'test' @@ -40,5 +38,3 @@ wireguard_installer.play(heroscript=heroscript)! port: 8888 ``` - - diff --git a/lib/installers/net/wireguard_installer/wireguard_installer_actions.v b/lib/installers/net/wireguard_installer/wireguard_installer_actions.v index b8323bc2..a963c009 100644 --- a/lib/installers/net/wireguard_installer/wireguard_installer_actions.v +++ b/lib/installers/net/wireguard_installer/wireguard_installer_actions.v @@ -1,9 +1,9 @@ module wireguard_installer -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.installers.ulist -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core +import incubaid.herolib.osal.core as osal +import incubaid.herolib.installers.ulist +import incubaid.herolib.ui.console +import incubaid.herolib.core //////////////////// following actions are not specific to instance of the object diff --git a/lib/installers/net/wireguard_installer/wireguard_installer_factory_.v b/lib/installers/net/wireguard_installer/wireguard_installer_factory_.v index f475577f..d1063958 100644 --- a/lib/installers/net/wireguard_installer/wireguard_installer_factory_.v +++ b/lib/installers/net/wireguard_installer/wireguard_installer_factory_.v @@ -1,9 +1,9 @@ module wireguard_installer -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager __global ( wireguard_installer_global map[string]&WireGuard diff --git a/lib/installers/net/wireguard_installer/wireguard_installer_model.v b/lib/installers/net/wireguard_installer/wireguard_installer_model.v index c5d10234..375ae3d7 100644 --- a/lib/installers/net/wireguard_installer/wireguard_installer_model.v +++ b/lib/installers/net/wireguard_installer/wireguard_installer_model.v @@ -1,6 +1,6 @@ module wireguard_installer -import freeflowuniverse.herolib.data.encoderhero +import incubaid.herolib.data.encoderhero pub const version = '1.14.3' const singleton = false diff --git a/lib/installers/net/yggdrasil/readme.md b/lib/installers/net/yggdrasil/readme.md index 8241c696..405ae6f9 100644 --- a/lib/installers/net/yggdrasil/readme.md +++ b/lib/installers/net/yggdrasil/readme.md @@ -1,13 +1,11 @@ # yggdrasil - - To get started ```v -import freeflowuniverse.herolib.installers.something.yggdrasil as yggdrasil_installer +import incubaid.herolib.installers.something.yggdrasil as yggdrasil_installer heroscript:=" !!yggdrasil.configure name:'test' @@ -40,5 +38,3 @@ yggdrasil_installer.play(heroscript=heroscript)! port: 8888 ``` - - diff --git a/lib/installers/net/yggdrasil/ygg.v b/lib/installers/net/yggdrasil/ygg.v index 25e10299..cb2e71f0 100644 --- a/lib/installers/net/yggdrasil/ygg.v +++ b/lib/installers/net/yggdrasil/ygg.v @@ -1,11 +1,11 @@ module yggdrasil -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.installers.lang.golang -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.osal.screen -import freeflowuniverse.herolib.ui -import freeflowuniverse.herolib.develop.gittools +import incubaid.herolib.osal.core as osal +import incubaid.herolib.installers.lang.golang +import incubaid.herolib.ui.console +import incubaid.herolib.osal.screen +import incubaid.herolib.ui +import incubaid.herolib.develop.gittools import os import time diff --git a/lib/installers/net/yggdrasil/yggdrasil_actions.v b/lib/installers/net/yggdrasil/yggdrasil_actions.v index 08f34df2..9b2d62fe 100644 --- a/lib/installers/net/yggdrasil/yggdrasil_actions.v +++ b/lib/installers/net/yggdrasil/yggdrasil_actions.v @@ -1,15 +1,15 @@ module yggdrasil -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.osal.systemd -import freeflowuniverse.herolib.osal.startupmanager -import freeflowuniverse.herolib.installers.ulist -import freeflowuniverse.herolib.installers.lang.golang -import freeflowuniverse.herolib.installers.lang.rust -import freeflowuniverse.herolib.installers.lang.python +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.core.pathlib +import incubaid.herolib.osal.systemd +import incubaid.herolib.osal.startupmanager +import incubaid.herolib.installers.ulist +import incubaid.herolib.installers.lang.golang +import incubaid.herolib.installers.lang.rust +import incubaid.herolib.installers.lang.python import os fn startupcmd() ![]startupmanager.ZProcessNewArgs { diff --git a/lib/installers/net/yggdrasil/yggdrasil_factory_.v b/lib/installers/net/yggdrasil/yggdrasil_factory_.v index 2633140c..2e3cdbc9 100644 --- a/lib/installers/net/yggdrasil/yggdrasil_factory_.v +++ b/lib/installers/net/yggdrasil/yggdrasil_factory_.v @@ -1,9 +1,9 @@ module yggdrasil -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager import time __global ( diff --git a/lib/installers/net/yggdrasil/yggdrasil_model.v b/lib/installers/net/yggdrasil/yggdrasil_model.v index c883fe1d..fbf6e34c 100644 --- a/lib/installers/net/yggdrasil/yggdrasil_model.v +++ b/lib/installers/net/yggdrasil/yggdrasil_model.v @@ -1,6 +1,6 @@ module yggdrasil -import freeflowuniverse.herolib.data.paramsparser +import incubaid.herolib.data.paramsparser import os pub const version = '0.0.0' diff --git a/lib/installers/sysadmintools/actrunner/actrunner_actions.v b/lib/installers/sysadmintools/actrunner/actrunner_actions.v index 93edfb36..f20b6549 100644 --- a/lib/installers/sysadmintools/actrunner/actrunner_actions.v +++ b/lib/installers/sysadmintools/actrunner/actrunner_actions.v @@ -1,11 +1,11 @@ module actrunner -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.osal.startupmanager -import freeflowuniverse.herolib.installers.ulist -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.core +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.osal.startupmanager +import incubaid.herolib.installers.ulist +import incubaid.herolib.osal.core as osal +import incubaid.herolib.core import os fn startupcmd() ![]startupmanager.ZProcessNewArgs { diff --git a/lib/installers/sysadmintools/actrunner/actrunner_factory_.v b/lib/installers/sysadmintools/actrunner/actrunner_factory_.v index 7fb022d5..5e2b7802 100644 --- a/lib/installers/sysadmintools/actrunner/actrunner_factory_.v +++ b/lib/installers/sysadmintools/actrunner/actrunner_factory_.v @@ -1,9 +1,9 @@ module actrunner -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager import time __global ( diff --git a/lib/installers/sysadmintools/actrunner/actrunner_model.v b/lib/installers/sysadmintools/actrunner/actrunner_model.v index a0c97e01..dd300114 100644 --- a/lib/installers/sysadmintools/actrunner/actrunner_model.v +++ b/lib/installers/sysadmintools/actrunner/actrunner_model.v @@ -1,6 +1,6 @@ module actrunner -import freeflowuniverse.herolib.data.encoderhero +import incubaid.herolib.data.encoderhero pub const version = '0.2.11' const singleton = true diff --git a/lib/installers/sysadmintools/b2/b2_actions.v b/lib/installers/sysadmintools/b2/b2_actions.v index 77100660..063334bc 100644 --- a/lib/installers/sysadmintools/b2/b2_actions.v +++ b/lib/installers/sysadmintools/b2/b2_actions.v @@ -1,9 +1,9 @@ module b2 -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.installers.ulist -import freeflowuniverse.herolib.lang.python +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console +import incubaid.herolib.installers.ulist +import incubaid.herolib.lang.python import os //////////////////// following actions are not specific to instance of the object diff --git a/lib/installers/sysadmintools/b2/b2_factory_.v b/lib/installers/sysadmintools/b2/b2_factory_.v index 821acbe3..56a9f239 100644 --- a/lib/installers/sysadmintools/b2/b2_factory_.v +++ b/lib/installers/sysadmintools/b2/b2_factory_.v @@ -1,9 +1,9 @@ module b2 -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager __global ( b2_global map[string]&BackBase diff --git a/lib/installers/sysadmintools/b2/b2_model.v b/lib/installers/sysadmintools/b2/b2_model.v index 4b0b9274..9cf31ca7 100644 --- a/lib/installers/sysadmintools/b2/b2_model.v +++ b/lib/installers/sysadmintools/b2/b2_model.v @@ -1,6 +1,6 @@ module b2 -import freeflowuniverse.herolib.data.encoderhero +import incubaid.herolib.data.encoderhero pub const version = '4.3.0' const singleton = true diff --git a/lib/installers/sysadmintools/b2/readme.md b/lib/installers/sysadmintools/b2/readme.md index 514ee422..e4072a8e 100644 --- a/lib/installers/sysadmintools/b2/readme.md +++ b/lib/installers/sysadmintools/b2/readme.md @@ -1,13 +1,11 @@ # b2 - - To get started ```v -import freeflowuniverse.herolib.installers.something.b2 as b2_installer +import incubaid.herolib.installers.something.b2 as b2_installer heroscript:=" !!b2.configure name:'test' @@ -40,5 +38,3 @@ b2_installer.play(heroscript=heroscript)! port: 8888 ``` - - diff --git a/lib/installers/sysadmintools/fungistor/fungistor.v b/lib/installers/sysadmintools/fungistor/fungistor.v index 221f34f6..2c435bf9 100644 --- a/lib/installers/sysadmintools/fungistor/fungistor.v +++ b/lib/installers/sysadmintools/fungistor/fungistor.v @@ -1,9 +1,9 @@ module fungistor -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.core -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.osal.core as osal +import incubaid.herolib.core +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools import os pub fn installl(args_ InstallArgs) ! { diff --git a/lib/installers/sysadmintools/fungistor/fungistor_actions.v b/lib/installers/sysadmintools/fungistor/fungistor_actions.v index a983bef9..6fa2268f 100644 --- a/lib/installers/sysadmintools/fungistor/fungistor_actions.v +++ b/lib/installers/sysadmintools/fungistor/fungistor_actions.v @@ -1,15 +1,15 @@ module fungistor -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.osal.systemd -import freeflowuniverse.herolib.osal.startupmanager -import freeflowuniverse.herolib.installers.ulist -import freeflowuniverse.herolib.installers.lang.golang -import freeflowuniverse.herolib.installers.lang.rust -import freeflowuniverse.herolib.installers.lang.python +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.core.pathlib +import incubaid.herolib.osal.systemd +import incubaid.herolib.osal.startupmanager +import incubaid.herolib.installers.ulist +import incubaid.herolib.installers.lang.golang +import incubaid.herolib.installers.lang.rust +import incubaid.herolib.installers.lang.python import os fn startupcmd() ![]startupmanager.ZProcessNewArgs { diff --git a/lib/installers/sysadmintools/fungistor/fungistor_factory_.v b/lib/installers/sysadmintools/fungistor/fungistor_factory_.v index 2694f51b..650cf2ab 100644 --- a/lib/installers/sysadmintools/fungistor/fungistor_factory_.v +++ b/lib/installers/sysadmintools/fungistor/fungistor_factory_.v @@ -1,9 +1,9 @@ module fungistor -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager import time __global ( diff --git a/lib/installers/sysadmintools/fungistor/fungistor_model.v b/lib/installers/sysadmintools/fungistor/fungistor_model.v index 4e2486ad..5e7bc14a 100644 --- a/lib/installers/sysadmintools/fungistor/fungistor_model.v +++ b/lib/installers/sysadmintools/fungistor/fungistor_model.v @@ -1,6 +1,6 @@ module fungistor -import freeflowuniverse.herolib.data.paramsparser +import incubaid.herolib.data.paramsparser import os pub const version = '0.0.0' diff --git a/lib/installers/sysadmintools/fungistor/readme.md b/lib/installers/sysadmintools/fungistor/readme.md index 7f0d665e..dd2d90d6 100644 --- a/lib/installers/sysadmintools/fungistor/readme.md +++ b/lib/installers/sysadmintools/fungistor/readme.md @@ -1,13 +1,11 @@ # fungistor - - To get started ```v -import freeflowuniverse.herolib.installers.something.fungistor as fungistor_installer +import incubaid.herolib.installers.something.fungistor as fungistor_installer heroscript:=" !!fungistor.configure name:'test' @@ -40,5 +38,3 @@ fungistor_installer.play(heroscript=heroscript)! port: 8888 ``` - - diff --git a/lib/installers/sysadmintools/garage_s3/garage_s3_actions.v b/lib/installers/sysadmintools/garage_s3/garage_s3_actions.v index 88a618ff..0d0a8112 100644 --- a/lib/installers/sysadmintools/garage_s3/garage_s3_actions.v +++ b/lib/installers/sysadmintools/garage_s3/garage_s3_actions.v @@ -1,13 +1,13 @@ module garage_s3 -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core -import freeflowuniverse.herolib.osal.startupmanager -import freeflowuniverse.herolib.installers.ulist -import freeflowuniverse.herolib.libarchive.zinit as zinit_lib -import freeflowuniverse.herolib.core.httpconnection +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.core +import incubaid.herolib.osal.startupmanager +import incubaid.herolib.installers.ulist +import incubaid.herolib.libarchive.zinit as zinit_lib +import incubaid.herolib.core.httpconnection import os import json diff --git a/lib/installers/sysadmintools/garage_s3/garage_s3_factory_.v b/lib/installers/sysadmintools/garage_s3/garage_s3_factory_.v index c97de7ac..97e2a370 100644 --- a/lib/installers/sysadmintools/garage_s3/garage_s3_factory_.v +++ b/lib/installers/sysadmintools/garage_s3/garage_s3_factory_.v @@ -1,10 +1,10 @@ module garage_s3 -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.base +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager import time __global ( diff --git a/lib/installers/sysadmintools/garage_s3/garage_s3_model.v b/lib/installers/sysadmintools/garage_s3/garage_s3_model.v index cb609f05..05481d23 100644 --- a/lib/installers/sysadmintools/garage_s3/garage_s3_model.v +++ b/lib/installers/sysadmintools/garage_s3/garage_s3_model.v @@ -1,8 +1,8 @@ module garage_s3 -import freeflowuniverse.herolib.data.encoderhero -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.data.encoderhero +import incubaid.herolib.ui.console +import incubaid.herolib.core.pathlib import rand pub const version = '1.0.1' diff --git a/lib/installers/sysadmintools/garage_s3/readme.md b/lib/installers/sysadmintools/garage_s3/readme.md index bd280790..faee7ab3 100644 --- a/lib/installers/sysadmintools/garage_s3/readme.md +++ b/lib/installers/sysadmintools/garage_s3/readme.md @@ -1,14 +1,12 @@ # garage_s3 - - To get started ```v -import freeflowuniverse.herolib.installers.something. garage_s3 +import incubaid.herolib.installers.something. garage_s3 mut installer:= garage_s3.get()! @@ -21,7 +19,6 @@ installer.start()! ## example heroscript - ```hero !!garage_s3.install homedir: '/home/user/garage_s3' @@ -32,5 +29,3 @@ installer.start()! port: 8888 ``` - - diff --git a/lib/installers/sysadmintools/grafana/grafana.v b/lib/installers/sysadmintools/grafana/grafana.v index c8256d27..57a48aa2 100644 --- a/lib/installers/sysadmintools/grafana/grafana.v +++ b/lib/installers/sysadmintools/grafana/grafana.v @@ -1,12 +1,12 @@ module grafana -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.core -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.core.httpconnection -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.core as osal +import incubaid.herolib.core +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.core.pathlib +import incubaid.herolib.core.httpconnection +import incubaid.herolib.osal.startupmanager import os import time diff --git a/lib/installers/sysadmintools/grafana/grafana_actions.v b/lib/installers/sysadmintools/grafana/grafana_actions.v index c2dc30c9..3a42d876 100644 --- a/lib/installers/sysadmintools/grafana/grafana_actions.v +++ b/lib/installers/sysadmintools/grafana/grafana_actions.v @@ -1,15 +1,15 @@ module grafana -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.osal.systemd -import freeflowuniverse.herolib.osal.startupmanager -import freeflowuniverse.herolib.installers.ulist -import freeflowuniverse.herolib.installers.lang.golang -import freeflowuniverse.herolib.installers.lang.rust -import freeflowuniverse.herolib.installers.lang.python +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.core.pathlib +import incubaid.herolib.osal.systemd +import incubaid.herolib.osal.startupmanager +import incubaid.herolib.installers.ulist +import incubaid.herolib.installers.lang.golang +import incubaid.herolib.installers.lang.rust +import incubaid.herolib.installers.lang.python import os fn startupcmd() ![]startupmanager.ZProcessNewArgs { diff --git a/lib/installers/sysadmintools/grafana/grafana_factory_.v b/lib/installers/sysadmintools/grafana/grafana_factory_.v index 826ced0f..cb17300f 100644 --- a/lib/installers/sysadmintools/grafana/grafana_factory_.v +++ b/lib/installers/sysadmintools/grafana/grafana_factory_.v @@ -1,9 +1,9 @@ module grafana -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager import time __global ( diff --git a/lib/installers/sysadmintools/grafana/grafana_model.v b/lib/installers/sysadmintools/grafana/grafana_model.v index ad937673..01f40b08 100644 --- a/lib/installers/sysadmintools/grafana/grafana_model.v +++ b/lib/installers/sysadmintools/grafana/grafana_model.v @@ -1,6 +1,6 @@ module grafana -import freeflowuniverse.herolib.data.paramsparser +import incubaid.herolib.data.paramsparser import os pub const version = '0.0.0' diff --git a/lib/installers/sysadmintools/grafana/readme.md b/lib/installers/sysadmintools/grafana/readme.md index 14d7b25f..fd0ed649 100644 --- a/lib/installers/sysadmintools/grafana/readme.md +++ b/lib/installers/sysadmintools/grafana/readme.md @@ -1,13 +1,11 @@ # grafana - - To get started ```v -import freeflowuniverse.herolib.installers.something.grafana as grafana_installer +import incubaid.herolib.installers.something.grafana as grafana_installer heroscript:=" !!grafana.configure name:'test' @@ -40,5 +38,3 @@ grafana_installer.play(heroscript=heroscript)! port: 8888 ``` - - diff --git a/lib/installers/sysadmintools/prometheus/alertmanager_installer.v b/lib/installers/sysadmintools/prometheus/alertmanager_installer.v index bdf867a7..ee1cc66c 100644 --- a/lib/installers/sysadmintools/prometheus/alertmanager_installer.v +++ b/lib/installers/sysadmintools/prometheus/alertmanager_installer.v @@ -1,12 +1,12 @@ module prometheus -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.core -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.core.httpconnection -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.core as osal +import incubaid.herolib.core +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.core.pathlib +import incubaid.herolib.core.httpconnection +import incubaid.herolib.osal.startupmanager import os import time diff --git a/lib/installers/sysadmintools/prometheus/blackbox_exporter.v b/lib/installers/sysadmintools/prometheus/blackbox_exporter.v index 2f37daae..ed9fe83a 100644 --- a/lib/installers/sysadmintools/prometheus/blackbox_exporter.v +++ b/lib/installers/sysadmintools/prometheus/blackbox_exporter.v @@ -1,11 +1,11 @@ module prometheus -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.core.httpconnection -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.core.pathlib +import incubaid.herolib.core.httpconnection +import incubaid.herolib.osal.startupmanager import os import time diff --git a/lib/installers/sysadmintools/prometheus/node_exporter.v b/lib/installers/sysadmintools/prometheus/node_exporter.v index d24dda48..799343fd 100644 --- a/lib/installers/sysadmintools/prometheus/node_exporter.v +++ b/lib/installers/sysadmintools/prometheus/node_exporter.v @@ -1,12 +1,12 @@ module prometheus -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.core -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.core.httpconnection -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.core as osal +import incubaid.herolib.core +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.core.pathlib +import incubaid.herolib.core.httpconnection +import incubaid.herolib.osal.startupmanager import os import time diff --git a/lib/installers/sysadmintools/prometheus/prom2json.v b/lib/installers/sysadmintools/prometheus/prom2json.v index 28879745..9ac58480 100644 --- a/lib/installers/sysadmintools/prometheus/prom2json.v +++ b/lib/installers/sysadmintools/prometheus/prom2json.v @@ -1,12 +1,12 @@ module prometheus -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.core -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.core.httpconnection -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.core as osal +import incubaid.herolib.core +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.core.pathlib +import incubaid.herolib.core.httpconnection +import incubaid.herolib.osal.startupmanager import os import time diff --git a/lib/installers/sysadmintools/prometheus/prometheus_actions.v b/lib/installers/sysadmintools/prometheus/prometheus_actions.v index 242e3acd..abbc6dc5 100644 --- a/lib/installers/sysadmintools/prometheus/prometheus_actions.v +++ b/lib/installers/sysadmintools/prometheus/prometheus_actions.v @@ -1,15 +1,15 @@ module prometheus -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.osal.systemd -import freeflowuniverse.herolib.osal.startupmanager -import freeflowuniverse.herolib.installers.ulist -import freeflowuniverse.herolib.installers.lang.golang -import freeflowuniverse.herolib.installers.lang.rust -import freeflowuniverse.herolib.installers.lang.python +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.core.pathlib +import incubaid.herolib.osal.systemd +import incubaid.herolib.osal.startupmanager +import incubaid.herolib.installers.ulist +import incubaid.herolib.installers.lang.golang +import incubaid.herolib.installers.lang.rust +import incubaid.herolib.installers.lang.python import os fn startupcmd() ![]startupmanager.ZProcessNewArgs { diff --git a/lib/installers/sysadmintools/prometheus/prometheus_factory_.v b/lib/installers/sysadmintools/prometheus/prometheus_factory_.v index 797a7d05..80ec24b8 100644 --- a/lib/installers/sysadmintools/prometheus/prometheus_factory_.v +++ b/lib/installers/sysadmintools/prometheus/prometheus_factory_.v @@ -1,9 +1,9 @@ module prometheus -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager import time __global ( diff --git a/lib/installers/sysadmintools/prometheus/prometheus_installer.v b/lib/installers/sysadmintools/prometheus/prometheus_installer.v index 21fe227d..f7a6d267 100644 --- a/lib/installers/sysadmintools/prometheus/prometheus_installer.v +++ b/lib/installers/sysadmintools/prometheus/prometheus_installer.v @@ -1,11 +1,11 @@ module prometheus -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.core.httpconnection -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.core.pathlib +import incubaid.herolib.core.httpconnection +import incubaid.herolib.osal.startupmanager import os import time diff --git a/lib/installers/sysadmintools/prometheus/prometheus_installer_factory.v b/lib/installers/sysadmintools/prometheus/prometheus_installer_factory.v index 8b67d16a..0431248c 100644 --- a/lib/installers/sysadmintools/prometheus/prometheus_installer_factory.v +++ b/lib/installers/sysadmintools/prometheus/prometheus_installer_factory.v @@ -1,11 +1,11 @@ module prometheus -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.core.httpconnection -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.core.pathlib +import incubaid.herolib.core.httpconnection +import incubaid.herolib.osal.startupmanager import os import time diff --git a/lib/installers/sysadmintools/prometheus/prometheus_model.v b/lib/installers/sysadmintools/prometheus/prometheus_model.v index 38dc7089..c3acc52e 100644 --- a/lib/installers/sysadmintools/prometheus/prometheus_model.v +++ b/lib/installers/sysadmintools/prometheus/prometheus_model.v @@ -1,6 +1,6 @@ module prometheus -import freeflowuniverse.herolib.data.paramsparser +import incubaid.herolib.data.paramsparser import os pub const version = '0.0.0' diff --git a/lib/installers/sysadmintools/rclone/rclone_actions.v b/lib/installers/sysadmintools/rclone/rclone_actions.v index c24f60b2..230d50d1 100644 --- a/lib/installers/sysadmintools/rclone/rclone_actions.v +++ b/lib/installers/sysadmintools/rclone/rclone_actions.v @@ -1,10 +1,10 @@ module rclone -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.installers.ulist +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.core.pathlib +import incubaid.herolib.installers.ulist import os //////////////////// following actions are not specific to instance of the object diff --git a/lib/installers/sysadmintools/rclone/rclone_factory_.v b/lib/installers/sysadmintools/rclone/rclone_factory_.v index 08802660..3ea3903d 100644 --- a/lib/installers/sysadmintools/rclone/rclone_factory_.v +++ b/lib/installers/sysadmintools/rclone/rclone_factory_.v @@ -1,10 +1,10 @@ module rclone -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.base +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager __global ( rclone_global map[string]&RClone diff --git a/lib/installers/sysadmintools/rclone/rclone_model.v b/lib/installers/sysadmintools/rclone/rclone_model.v index a5c32f47..798487ac 100644 --- a/lib/installers/sysadmintools/rclone/rclone_model.v +++ b/lib/installers/sysadmintools/rclone/rclone_model.v @@ -1,7 +1,7 @@ module rclone -import freeflowuniverse.herolib.data.paramsparser -import freeflowuniverse.herolib.data.encoderhero +import incubaid.herolib.data.paramsparser +import incubaid.herolib.data.encoderhero import os pub const version = '1.67.0' diff --git a/lib/installers/sysadmintools/rclone/readme.md b/lib/installers/sysadmintools/rclone/readme.md index 99f5165c..4d38a168 100644 --- a/lib/installers/sysadmintools/rclone/readme.md +++ b/lib/installers/sysadmintools/rclone/readme.md @@ -1,14 +1,12 @@ # rclone - - To get started ```v -import freeflowuniverse.herolib.installers.something. rclone +import incubaid.herolib.installers.something. rclone mut installer:= rclone.get()! @@ -21,7 +19,6 @@ installer.start()! ## example heroscript - ```hero !!rclone.install homedir: '/home/user/rclone' @@ -32,5 +29,3 @@ installer.start()! port: 8888 ``` - - diff --git a/lib/installers/sysadmintools/restic/builder.v b/lib/installers/sysadmintools/restic/builder.v index 7722fa3b..b9512ee2 100644 --- a/lib/installers/sysadmintools/restic/builder.v +++ b/lib/installers/sysadmintools/restic/builder.v @@ -1,10 +1,10 @@ module restic -// import freeflowuniverse.herolib.installers.base -import freeflowuniverse.herolib.installers.lang.golang -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.develop.gittools -import freeflowuniverse.herolib.ui.console +// import incubaid.herolib.installers.base +import incubaid.herolib.installers.lang.golang +import incubaid.herolib.osal.core as osal +import incubaid.herolib.develop.gittools +import incubaid.herolib.ui.console const url = 'https://github.com/restic/restic' diff --git a/lib/installers/sysadmintools/restic/readme.md b/lib/installers/sysadmintools/restic/readme.md index 0e8d2013..62cf9cfb 100644 --- a/lib/installers/sysadmintools/restic/readme.md +++ b/lib/installers/sysadmintools/restic/readme.md @@ -1,13 +1,11 @@ # restic - - To get started ```v -import freeflowuniverse.herolib.installers.something.restic as restic_installer +import incubaid.herolib.installers.something.restic as restic_installer heroscript:=" !!restic.configure name:'test' @@ -40,5 +38,3 @@ restic_installer.play(heroscript=heroscript)! port: 8888 ``` - - diff --git a/lib/installers/sysadmintools/restic/restic_actions.v b/lib/installers/sysadmintools/restic/restic_actions.v index 1d3a5e47..05f78652 100644 --- a/lib/installers/sysadmintools/restic/restic_actions.v +++ b/lib/installers/sysadmintools/restic/restic_actions.v @@ -1,15 +1,15 @@ module restic -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.osal.systemd -import freeflowuniverse.herolib.osal.startupmanager -import freeflowuniverse.herolib.installers.ulist -import freeflowuniverse.herolib.installers.lang.golang -import freeflowuniverse.herolib.installers.lang.rust -import freeflowuniverse.herolib.installers.lang.python +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.core.pathlib +import incubaid.herolib.osal.systemd +import incubaid.herolib.osal.startupmanager +import incubaid.herolib.installers.ulist +import incubaid.herolib.installers.lang.golang +import incubaid.herolib.installers.lang.rust +import incubaid.herolib.installers.lang.python import os fn startupcmd() ![]startupmanager.ZProcessNewArgs { diff --git a/lib/installers/sysadmintools/restic/restic_factory_.v b/lib/installers/sysadmintools/restic/restic_factory_.v index 634670cb..ee634a39 100644 --- a/lib/installers/sysadmintools/restic/restic_factory_.v +++ b/lib/installers/sysadmintools/restic/restic_factory_.v @@ -1,9 +1,9 @@ module restic -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager import time __global ( diff --git a/lib/installers/sysadmintools/restic/restic_install.v b/lib/installers/sysadmintools/restic/restic_install.v index b49bb604..0c6f3239 100644 --- a/lib/installers/sysadmintools/restic/restic_install.v +++ b/lib/installers/sysadmintools/restic/restic_install.v @@ -1,8 +1,8 @@ module restic -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools import os pub fn install(args_ InstallArgs) ! { diff --git a/lib/installers/sysadmintools/restic/restic_model.v b/lib/installers/sysadmintools/restic/restic_model.v index d64bb57c..6e6dd4e5 100644 --- a/lib/installers/sysadmintools/restic/restic_model.v +++ b/lib/installers/sysadmintools/restic/restic_model.v @@ -1,6 +1,6 @@ module restic -import freeflowuniverse.herolib.data.paramsparser +import incubaid.herolib.data.paramsparser import os pub const version = '0.0.0' diff --git a/lib/installers/sysadmintools/s3/builder.v b/lib/installers/sysadmintools/s3/builder.v index 233ea695..a21de5fc 100644 --- a/lib/installers/sysadmintools/s3/builder.v +++ b/lib/installers/sysadmintools/s3/builder.v @@ -1,9 +1,9 @@ module s3 -import freeflowuniverse.herolib.installers.lang.rust -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.develop.gittools -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.installers.lang.rust +import incubaid.herolib.osal.core as osal +import incubaid.herolib.develop.gittools +import incubaid.herolib.ui.console @[params] pub struct BuildArgs { diff --git a/lib/installers/sysadmintools/s3/s3.v b/lib/installers/sysadmintools/s3/s3.v index 9b9842b8..a2ed9955 100644 --- a/lib/installers/sysadmintools/s3/s3.v +++ b/lib/installers/sysadmintools/s3/s3.v @@ -1,10 +1,10 @@ module s3 -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.installers.base -import freeflowuniverse.herolib.installers.zinit as zinitinstaller -import freeflowuniverse.herolib.installers.rclone -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.osal.core as osal +import incubaid.herolib.installers.base +import incubaid.herolib.installers.zinit as zinitinstaller +import incubaid.herolib.installers.rclone +import incubaid.herolib.ui.console // install s3 will return true if it was already installed pub fn install_() ! { diff --git a/lib/installers/sysadmintools/s3/s3_actions.v b/lib/installers/sysadmintools/s3/s3_actions.v index d3868abd..c28b6f76 100644 --- a/lib/installers/sysadmintools/s3/s3_actions.v +++ b/lib/installers/sysadmintools/s3/s3_actions.v @@ -1,15 +1,15 @@ module s3 -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.osal.systemd -import freeflowuniverse.herolib.osal.startupmanager -import freeflowuniverse.herolib.installers.ulist -import freeflowuniverse.herolib.installers.lang.golang -import freeflowuniverse.herolib.installers.lang.rust -import freeflowuniverse.herolib.installers.lang.python +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.core.pathlib +import incubaid.herolib.osal.systemd +import incubaid.herolib.osal.startupmanager +import incubaid.herolib.installers.ulist +import incubaid.herolib.installers.lang.golang +import incubaid.herolib.installers.lang.rust +import incubaid.herolib.installers.lang.python import os fn startupcmd() ![]startupmanager.ZProcessNewArgs { diff --git a/lib/installers/sysadmintools/s3/s3_factory_.v b/lib/installers/sysadmintools/s3/s3_factory_.v index 763737c9..1b1ff418 100644 --- a/lib/installers/sysadmintools/s3/s3_factory_.v +++ b/lib/installers/sysadmintools/s3/s3_factory_.v @@ -1,9 +1,9 @@ module s3 -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager import time __global ( diff --git a/lib/installers/sysadmintools/s3/s3_model.v b/lib/installers/sysadmintools/s3/s3_model.v index a1a58c4d..c4881c3f 100644 --- a/lib/installers/sysadmintools/s3/s3_model.v +++ b/lib/installers/sysadmintools/s3/s3_model.v @@ -1,6 +1,6 @@ module s3 -import freeflowuniverse.herolib.data.paramsparser +import incubaid.herolib.data.paramsparser import os pub const version = '0.0.0' diff --git a/lib/installers/sysadmintools/s3/server.v b/lib/installers/sysadmintools/s3/server.v index 0cf7c2dc..4b7fd997 100644 --- a/lib/installers/sysadmintools/s3/server.v +++ b/lib/installers/sysadmintools/s3/server.v @@ -1,12 +1,12 @@ module s3 -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.osal.startupmanager -import freeflowuniverse.herolib.data.dbfs -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.osal.core as osal +import incubaid.herolib.osal.startupmanager +import incubaid.herolib.data.dbfs +import incubaid.herolib.core.texttools import json import rand -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console // --fs-root [default: .] // --host [default: localhost] diff --git a/lib/installers/threefold/griddriver/griddriver_actions.v b/lib/installers/threefold/griddriver/griddriver_actions.v index 7f5c61b4..c2589b0e 100644 --- a/lib/installers/threefold/griddriver/griddriver_actions.v +++ b/lib/installers/threefold/griddriver/griddriver_actions.v @@ -1,10 +1,10 @@ module griddriver -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.installers.ulist +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console +import incubaid.herolib.core +import incubaid.herolib.core.texttools +import incubaid.herolib.installers.ulist import os // checks if a certain version or above is installed diff --git a/lib/installers/threefold/griddriver/griddriver_factory_.v b/lib/installers/threefold/griddriver/griddriver_factory_.v index 4f287f41..a2321cd1 100644 --- a/lib/installers/threefold/griddriver/griddriver_factory_.v +++ b/lib/installers/threefold/griddriver/griddriver_factory_.v @@ -1,9 +1,9 @@ module griddriver -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager __global ( griddriver_global map[string]&GridDriverInstaller diff --git a/lib/installers/threefold/griddriver/griddriver_model.v b/lib/installers/threefold/griddriver/griddriver_model.v index ffd31722..01879503 100644 --- a/lib/installers/threefold/griddriver/griddriver_model.v +++ b/lib/installers/threefold/griddriver/griddriver_model.v @@ -1,6 +1,6 @@ module griddriver -import freeflowuniverse.herolib.data.encoderhero +import incubaid.herolib.data.encoderhero pub const version = '0.1.2' const singleton = true diff --git a/lib/installers/threefold/griddriver/readme.md b/lib/installers/threefold/griddriver/readme.md index 11dea35a..c97a946a 100644 --- a/lib/installers/threefold/griddriver/readme.md +++ b/lib/installers/threefold/griddriver/readme.md @@ -3,11 +3,11 @@ To use the installer: ```v -import freeflowuniverse.herolib.installers.threefold.griddriver +import incubaid.herolib.installers.threefold.griddriver fn main() { - mut installer := griddriver.get()! - installer.install()! + mut installer := griddriver.get()! + installer.install()! } ``` diff --git a/lib/installers/threefold/tfrobot/tfrobot.v b/lib/installers/threefold/tfrobot/tfrobot.v index 2ec4e0ad..5f90aa44 100644 --- a/lib/installers/threefold/tfrobot/tfrobot.v +++ b/lib/installers/threefold/tfrobot/tfrobot.v @@ -1,11 +1,11 @@ module tfrobot -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.core -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.installers.lang.golang -import freeflowuniverse.herolib.develop.gittools -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.osal.core as osal +import incubaid.herolib.core +import incubaid.herolib.ui.console +import incubaid.herolib.installers.lang.golang +import incubaid.herolib.develop.gittools +import incubaid.herolib.core.texttools import os @[params] diff --git a/lib/installers/ulist/ulist.v b/lib/installers/ulist/ulist.v index 5ef70a3c..befad7d8 100644 --- a/lib/installers/ulist/ulist.v +++ b/lib/installers/ulist/ulist.v @@ -1,7 +1,7 @@ module ulist -// import freeflowuniverse.herolib.core.pathlib -// import freeflowuniverse.herolib.develop.gittools +// import incubaid.herolib.core.pathlib +// import incubaid.herolib.develop.gittools // U stands for Upload pub struct UList { diff --git a/lib/installers/upload.v b/lib/installers/upload.v index 627383b4..2f4103db 100644 --- a/lib/installers/upload.v +++ b/lib/installers/upload.v @@ -1,7 +1,7 @@ module installers -// import freeflowuniverse.herolib.core.pathlib -// import freeflowuniverse.herolib.develop.gittools +// import incubaid.herolib.core.pathlib +// import incubaid.herolib.develop.gittools @[params] pub struct UploadArgs { diff --git a/lib/installers/virt/cloudhypervisor/cloudhypervisor_actions.v b/lib/installers/virt/cloudhypervisor/cloudhypervisor_actions.v index cfd47184..85d741ee 100644 --- a/lib/installers/virt/cloudhypervisor/cloudhypervisor_actions.v +++ b/lib/installers/virt/cloudhypervisor/cloudhypervisor_actions.v @@ -1,11 +1,11 @@ module cloudhypervisor -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools -// import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.installers.ulist -// import freeflowuniverse.herolib.installers.lang.rust +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools +// import incubaid.herolib.core.pathlib +import incubaid.herolib.installers.ulist +// import incubaid.herolib.installers.lang.rust import os fn installed_() !bool { diff --git a/lib/installers/virt/cloudhypervisor/cloudhypervisor_factory_.v b/lib/installers/virt/cloudhypervisor/cloudhypervisor_factory_.v index e196a292..42c7f705 100644 --- a/lib/installers/virt/cloudhypervisor/cloudhypervisor_factory_.v +++ b/lib/installers/virt/cloudhypervisor/cloudhypervisor_factory_.v @@ -1,9 +1,9 @@ module cloudhypervisor -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager __global ( cloudhypervisor_global map[string]&CloudHypervisor diff --git a/lib/installers/virt/cloudhypervisor/cloudhypervisor_model.v b/lib/installers/virt/cloudhypervisor/cloudhypervisor_model.v index 31374b45..06d90a7a 100644 --- a/lib/installers/virt/cloudhypervisor/cloudhypervisor_model.v +++ b/lib/installers/virt/cloudhypervisor/cloudhypervisor_model.v @@ -1,6 +1,6 @@ module cloudhypervisor -import freeflowuniverse.herolib.data.paramsparser +import incubaid.herolib.data.paramsparser import os pub const version0 = '41.0' diff --git a/lib/installers/virt/cloudhypervisor/readme.md b/lib/installers/virt/cloudhypervisor/readme.md index 698213a5..0e50e186 100644 --- a/lib/installers/virt/cloudhypervisor/readme.md +++ b/lib/installers/virt/cloudhypervisor/readme.md @@ -1,13 +1,11 @@ # cloudhypervisor - - To get started ```v -import freeflowuniverse.herolib.installers.something. cloudhypervisor +import incubaid.herolib.installers.something. cloudhypervisor mut installer:= cloudhypervisor.get()! @@ -30,5 +28,3 @@ installer.start()! port: 8888 ``` - - diff --git a/lib/installers/virt/docker/docker_actions.v b/lib/installers/virt/docker/docker_actions.v index e5671320..78cf166e 100644 --- a/lib/installers/virt/docker/docker_actions.v +++ b/lib/installers/virt/docker/docker_actions.v @@ -1,10 +1,10 @@ module docker -import freeflowuniverse.herolib.core -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.osal.startupmanager -import freeflowuniverse.herolib.installers.ulist +import incubaid.herolib.core +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console +import incubaid.herolib.osal.startupmanager +import incubaid.herolib.installers.ulist fn startupcmd() ![]startupmanager.ZProcessNewArgs { mut res := []startupmanager.ZProcessNewArgs{} diff --git a/lib/installers/virt/docker/docker_factory_.v b/lib/installers/virt/docker/docker_factory_.v index 92fcf208..757c2309 100644 --- a/lib/installers/virt/docker/docker_factory_.v +++ b/lib/installers/virt/docker/docker_factory_.v @@ -1,9 +1,9 @@ module docker -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager import time __global ( diff --git a/lib/installers/virt/docker/readme.md b/lib/installers/virt/docker/readme.md index ac886ba7..8868742e 100644 --- a/lib/installers/virt/docker/readme.md +++ b/lib/installers/virt/docker/readme.md @@ -5,7 +5,7 @@ To get started ```v -import freeflowuniverse.herolib.installers.something.docker as docker_installer +import incubaid.herolib.installers.something.docker as docker_installer heroscript:=" !!docker.configure name:'test' @@ -38,5 +38,3 @@ docker_installer.play(heroscript=heroscript)! port: 8888 ``` - - diff --git a/lib/installers/virt/herorunner/herorunner_actions.v b/lib/installers/virt/herorunner/herorunner_actions.v index 8ea53f05..ecff8fa7 100644 --- a/lib/installers/virt/herorunner/herorunner_actions.v +++ b/lib/installers/virt/herorunner/herorunner_actions.v @@ -1,10 +1,10 @@ module herorunner -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.installers.ulist +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.core.pathlib +import incubaid.herolib.installers.ulist import os //////////////////// following actions are not specific to instance of the object diff --git a/lib/installers/virt/herorunner/herorunner_factory_.v b/lib/installers/virt/herorunner/herorunner_factory_.v index dbf50fce..793510b5 100644 --- a/lib/installers/virt/herorunner/herorunner_factory_.v +++ b/lib/installers/virt/herorunner/herorunner_factory_.v @@ -1,9 +1,9 @@ module herorunner -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager __global ( herorunner_global map[string]&HeroRunner diff --git a/lib/installers/virt/herorunner/herorunner_model.v b/lib/installers/virt/herorunner/herorunner_model.v index e08ae618..37378363 100644 --- a/lib/installers/virt/herorunner/herorunner_model.v +++ b/lib/installers/virt/herorunner/herorunner_model.v @@ -1,7 +1,7 @@ module herorunner -import freeflowuniverse.herolib.data.paramsparser -import freeflowuniverse.herolib.data.encoderhero +import incubaid.herolib.data.paramsparser +import incubaid.herolib.data.encoderhero import os pub const version = '0.0.0' diff --git a/lib/installers/virt/herorunner/readme.md b/lib/installers/virt/herorunner/readme.md index 48a12d5f..2e669b51 100644 --- a/lib/installers/virt/herorunner/readme.md +++ b/lib/installers/virt/herorunner/readme.md @@ -1,13 +1,11 @@ # herorunner - - To get started ```vlang -import freeflowuniverse.herolib.installers.something.herorunner as herorunner_installer +import incubaid.herolib.installers.something.herorunner as herorunner_installer heroscript:=" !!herorunner.configure name:'test' @@ -40,5 +38,3 @@ herorunner_installer.play(heroscript=heroscript)! port: 8888 ``` - - diff --git a/lib/installers/virt/lima/lima_actions.v b/lib/installers/virt/lima/lima_actions.v index 704d2771..707abd74 100644 --- a/lib/installers/virt/lima/lima_actions.v +++ b/lib/installers/virt/lima/lima_actions.v @@ -1,13 +1,13 @@ module lima -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.osal.startupmanager -import freeflowuniverse.herolib.installers.ulist -import freeflowuniverse.herolib.installers.virt.qemu +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.core +import incubaid.herolib.core.pathlib +import incubaid.herolib.osal.startupmanager +import incubaid.herolib.installers.ulist +import incubaid.herolib.installers.virt.qemu import os fn startupcmd() ![]startupmanager.ZProcessNewArgs { diff --git a/lib/installers/virt/lima/lima_factory_.v b/lib/installers/virt/lima/lima_factory_.v index abc43860..e7aab6d8 100644 --- a/lib/installers/virt/lima/lima_factory_.v +++ b/lib/installers/virt/lima/lima_factory_.v @@ -1,10 +1,10 @@ module lima -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.base +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager import time __global ( diff --git a/lib/installers/virt/lima/lima_model.v b/lib/installers/virt/lima/lima_model.v index 91ad377b..50ef7aa6 100644 --- a/lib/installers/virt/lima/lima_model.v +++ b/lib/installers/virt/lima/lima_model.v @@ -1,7 +1,7 @@ module lima -import freeflowuniverse.herolib.data.paramsparser -import freeflowuniverse.herolib.data.encoderhero +import incubaid.herolib.data.paramsparser +import incubaid.herolib.data.encoderhero import os pub const version = '1.2.1' diff --git a/lib/installers/virt/lima/readme.md b/lib/installers/virt/lima/readme.md index d0e8973d..cbc55b7a 100644 --- a/lib/installers/virt/lima/readme.md +++ b/lib/installers/virt/lima/readme.md @@ -1,13 +1,11 @@ # lima - - To get started ```v -import freeflowuniverse.herolib.installers.virt.lima as lima_installer +import incubaid.herolib.installers.virt.lima as lima_installer heroscript:=" !!lima.install diff --git a/lib/installers/virt/pacman/pacman_actions.v b/lib/installers/virt/pacman/pacman_actions.v index 0bf53994..6a11c651 100644 --- a/lib/installers/virt/pacman/pacman_actions.v +++ b/lib/installers/virt/pacman/pacman_actions.v @@ -1,8 +1,8 @@ module pacman -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console +import incubaid.herolib.core import os // checks if a certain version or above is installed diff --git a/lib/installers/virt/pacman/pacman_factory_.v b/lib/installers/virt/pacman/pacman_factory_.v index 720ac080..276b4beb 100644 --- a/lib/installers/virt/pacman/pacman_factory_.v +++ b/lib/installers/virt/pacman/pacman_factory_.v @@ -1,9 +1,9 @@ module pacman -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager __global ( pacman_global map[string]&PacmanInstaller diff --git a/lib/installers/virt/pacman/pacman_model.v b/lib/installers/virt/pacman/pacman_model.v index d3d01837..473e073e 100644 --- a/lib/installers/virt/pacman/pacman_model.v +++ b/lib/installers/virt/pacman/pacman_model.v @@ -1,6 +1,6 @@ module pacman -import freeflowuniverse.herolib.data.encoderhero +import incubaid.herolib.data.encoderhero pub const version = 'v1.0' const singleton = true diff --git a/lib/installers/virt/pacman/readme.md b/lib/installers/virt/pacman/readme.md index ecf9ab55..e9d71a74 100644 --- a/lib/installers/virt/pacman/readme.md +++ b/lib/installers/virt/pacman/readme.md @@ -1,13 +1,11 @@ # pacman - - To get started ```v -import freeflowuniverse.herolib.installers.virt.pacman +import incubaid.herolib.installers.virt.pacman mut installer:= pacman.get()! @@ -18,4 +16,4 @@ installer.install()! ``` -> important we don't check signatures on install this is dangerous !!! \ No newline at end of file +> important we don't check signatures on install this is dangerous !!! diff --git a/lib/installers/virt/podman/podman_actions.v b/lib/installers/virt/podman/podman_actions.v index b4ba2231..eb52a5d5 100644 --- a/lib/installers/virt/podman/podman_actions.v +++ b/lib/installers/virt/podman/podman_actions.v @@ -1,10 +1,10 @@ module podman -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core -import freeflowuniverse.herolib.installers.ulist +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.core +import incubaid.herolib.installers.ulist import os //////////////////// following actions are not specific to instance of the object diff --git a/lib/installers/virt/podman/podman_factory_.v b/lib/installers/virt/podman/podman_factory_.v index e1c23198..49557ac8 100644 --- a/lib/installers/virt/podman/podman_factory_.v +++ b/lib/installers/virt/podman/podman_factory_.v @@ -1,9 +1,9 @@ module podman -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager __global ( podman_global map[string]&PodmanInstaller diff --git a/lib/installers/virt/podman/podman_model.v b/lib/installers/virt/podman/podman_model.v index 0077d29e..cb4fac5e 100644 --- a/lib/installers/virt/podman/podman_model.v +++ b/lib/installers/virt/podman/podman_model.v @@ -1,7 +1,7 @@ module podman -import freeflowuniverse.herolib.data.paramsparser -import freeflowuniverse.herolib.data.encoderhero +import incubaid.herolib.data.paramsparser +import incubaid.herolib.data.encoderhero import os pub const version = '4.9.3' diff --git a/lib/installers/virt/podman/readme.md b/lib/installers/virt/podman/readme.md index f8de50a4..9a648752 100644 --- a/lib/installers/virt/podman/readme.md +++ b/lib/installers/virt/podman/readme.md @@ -7,8 +7,9 @@ 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) + ```v -import freeflowuniverse.herolib.installers.virt.podman as podman_installer +import incubaid.herolib.installers.virt.podman as podman_installer mut podman := podman_installer.get()! diff --git a/lib/installers/virt/qemu/qemu_install.v b/lib/installers/virt/qemu/qemu_install.v index c91c3227..e48aed04 100644 --- a/lib/installers/virt/qemu/qemu_install.v +++ b/lib/installers/virt/qemu/qemu_install.v @@ -1,10 +1,10 @@ module qemu -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.core -import freeflowuniverse.herolib.installers.base -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.osal.core as osal +import incubaid.herolib.core +import incubaid.herolib.installers.base +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools import os @[params] diff --git a/lib/installers/virt/youki/readme.md b/lib/installers/virt/youki/readme.md index 781dcdf6..c3676d9d 100644 --- a/lib/installers/virt/youki/readme.md +++ b/lib/installers/virt/youki/readme.md @@ -1,13 +1,11 @@ # youki - - To get started ```v -import freeflowuniverse.herolib.installers.virt.youki +import incubaid.herolib.installers.virt.youki mut youki_installer:= youki.get()! @@ -30,5 +28,3 @@ youki_installer.install()! port: 8888 ``` - - diff --git a/lib/installers/virt/youki/youki_actions.v b/lib/installers/virt/youki/youki_actions.v index a2e8d370..bf678597 100644 --- a/lib/installers/virt/youki/youki_actions.v +++ b/lib/installers/virt/youki/youki_actions.v @@ -1,14 +1,14 @@ module youki -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.develop.gittools -import freeflowuniverse.herolib.installers.ulist -import freeflowuniverse.herolib.installers.lang.golang -import freeflowuniverse.herolib.installers.lang.rust -import freeflowuniverse.herolib.installers.lang.python +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.core.pathlib +import incubaid.herolib.develop.gittools +import incubaid.herolib.installers.ulist +import incubaid.herolib.installers.lang.golang +import incubaid.herolib.installers.lang.rust +import incubaid.herolib.installers.lang.python import os // checks if a certain version or above is installed diff --git a/lib/installers/virt/youki/youki_factory_.v b/lib/installers/virt/youki/youki_factory_.v index 6998bafa..129f8945 100644 --- a/lib/installers/virt/youki/youki_factory_.v +++ b/lib/installers/virt/youki/youki_factory_.v @@ -1,9 +1,9 @@ module youki -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager __global ( youki_global map[string]&YoukiInstaller diff --git a/lib/installers/virt/youki/youki_model.v b/lib/installers/virt/youki/youki_model.v index c162a53d..23e8da42 100644 --- a/lib/installers/virt/youki/youki_model.v +++ b/lib/installers/virt/youki/youki_model.v @@ -1,6 +1,6 @@ module youki -import freeflowuniverse.herolib.data.paramsparser +import incubaid.herolib.data.paramsparser import os pub const version = '1.14.3' diff --git a/lib/installers/web/bun/bun_actions.v b/lib/installers/web/bun/bun_actions.v index 250b0246..4824649b 100644 --- a/lib/installers/web/bun/bun_actions.v +++ b/lib/installers/web/bun/bun_actions.v @@ -1,10 +1,10 @@ module bun -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.installers.ulist +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.core.pathlib +import incubaid.herolib.installers.ulist import os //////////////////// following actions are not specific to instance of the object diff --git a/lib/installers/web/bun/bun_factory_.v b/lib/installers/web/bun/bun_factory_.v index 00f04ff6..438939c7 100644 --- a/lib/installers/web/bun/bun_factory_.v +++ b/lib/installers/web/bun/bun_factory_.v @@ -1,9 +1,9 @@ module bun -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager __global ( bun_global map[string]&Bun diff --git a/lib/installers/web/bun/bun_model.v b/lib/installers/web/bun/bun_model.v index 65963f69..82430b74 100644 --- a/lib/installers/web/bun/bun_model.v +++ b/lib/installers/web/bun/bun_model.v @@ -1,6 +1,6 @@ module bun -import freeflowuniverse.herolib.data.paramsparser +import incubaid.herolib.data.paramsparser import os pub const version = '1.2.3' diff --git a/lib/installers/web/bun/readme.md b/lib/installers/web/bun/readme.md index 2ca7cb7f..454d7f43 100644 --- a/lib/installers/web/bun/readme.md +++ b/lib/installers/web/bun/readme.md @@ -1,13 +1,11 @@ # bun - - To get started ```v -import freeflowuniverse.herolib.installers.something.bun as bun_installer +import incubaid.herolib.installers.something.bun as bun_installer heroscript:=" !!bun.configure name:'test' @@ -40,5 +38,3 @@ bun_installer.play(heroscript=heroscript)! port: 8888 ``` - - diff --git a/lib/installers/web/imagemagick/imagemagick.v b/lib/installers/web/imagemagick/imagemagick.v index b35b7906..33037473 100644 --- a/lib/installers/web/imagemagick/imagemagick.v +++ b/lib/installers/web/imagemagick/imagemagick.v @@ -1,7 +1,7 @@ module imagemagick -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console import os // this gets the name of the directory diff --git a/lib/installers/web/imagemagick/imagemagick_actions.v b/lib/installers/web/imagemagick/imagemagick_actions.v index f1477b97..9d16bfce 100644 --- a/lib/installers/web/imagemagick/imagemagick_actions.v +++ b/lib/installers/web/imagemagick/imagemagick_actions.v @@ -1,15 +1,15 @@ module imagemagick -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.osal.systemd -import freeflowuniverse.herolib.osal.startupmanager -import freeflowuniverse.herolib.installers.ulist -import freeflowuniverse.herolib.installers.lang.golang -import freeflowuniverse.herolib.installers.lang.rust -import freeflowuniverse.herolib.installers.lang.python +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.core.pathlib +import incubaid.herolib.osal.systemd +import incubaid.herolib.osal.startupmanager +import incubaid.herolib.installers.ulist +import incubaid.herolib.installers.lang.golang +import incubaid.herolib.installers.lang.rust +import incubaid.herolib.installers.lang.python import os fn startupcmd() ![]startupmanager.ZProcessNewArgs { diff --git a/lib/installers/web/imagemagick/imagemagick_factory_.v b/lib/installers/web/imagemagick/imagemagick_factory_.v index 65fad358..4889a19e 100644 --- a/lib/installers/web/imagemagick/imagemagick_factory_.v +++ b/lib/installers/web/imagemagick/imagemagick_factory_.v @@ -1,9 +1,9 @@ module imagemagick -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager import time __global ( diff --git a/lib/installers/web/imagemagick/imagemagick_model.v b/lib/installers/web/imagemagick/imagemagick_model.v index 80b23448..b4108881 100644 --- a/lib/installers/web/imagemagick/imagemagick_model.v +++ b/lib/installers/web/imagemagick/imagemagick_model.v @@ -1,6 +1,6 @@ module imagemagick -import freeflowuniverse.herolib.data.paramsparser +import incubaid.herolib.data.paramsparser import os pub const version = '0.0.0' diff --git a/lib/installers/web/imagemagick/readme.md b/lib/installers/web/imagemagick/readme.md index 36cc4439..91ebc773 100644 --- a/lib/installers/web/imagemagick/readme.md +++ b/lib/installers/web/imagemagick/readme.md @@ -1,13 +1,11 @@ # imagemagick - - To get started ```v -import freeflowuniverse.herolib.installers.something.imagemagick as imagemagick_installer +import incubaid.herolib.installers.something.imagemagick as imagemagick_installer heroscript:=" !!imagemagick.configure name:'test' @@ -40,5 +38,3 @@ imagemagick_installer.play(heroscript=heroscript)! port: 8888 ``` - - diff --git a/lib/installers/web/lighttpd/installer.v b/lib/installers/web/lighttpd/installer.v index 09f84540..231223f1 100644 --- a/lib/installers/web/lighttpd/installer.v +++ b/lib/installers/web/lighttpd/installer.v @@ -1,13 +1,13 @@ module lighttpd -import freeflowuniverse.herolib.installers.base -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.installers.infra.zinit -import freeflowuniverse.herolib.osal.startupmanager as zinitmgmt -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.osal.screen +import incubaid.herolib.installers.base +import incubaid.herolib.osal.core as osal +import incubaid.herolib.core.pathlib +import incubaid.herolib.core.texttools +import incubaid.herolib.installers.infra.zinit +import incubaid.herolib.osal.startupmanager as zinitmgmt +import incubaid.herolib.ui.console +import incubaid.herolib.osal.screen import os // install lighttpd will return true if it was already installed diff --git a/lib/installers/web/lighttpd/lighttpd_actions.v b/lib/installers/web/lighttpd/lighttpd_actions.v index 6cba21e1..116c9143 100644 --- a/lib/installers/web/lighttpd/lighttpd_actions.v +++ b/lib/installers/web/lighttpd/lighttpd_actions.v @@ -1,15 +1,15 @@ module lighttpd -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.osal.systemd -import freeflowuniverse.herolib.osal.startupmanager -import freeflowuniverse.herolib.installers.ulist -import freeflowuniverse.herolib.installers.lang.golang -import freeflowuniverse.herolib.installers.lang.rust -import freeflowuniverse.herolib.installers.lang.python +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.core.pathlib +import incubaid.herolib.osal.systemd +import incubaid.herolib.osal.startupmanager +import incubaid.herolib.installers.ulist +import incubaid.herolib.installers.lang.golang +import incubaid.herolib.installers.lang.rust +import incubaid.herolib.installers.lang.python import os fn startupcmd() ![]startupmanager.ZProcessNewArgs { diff --git a/lib/installers/web/lighttpd/lighttpd_factory_.v b/lib/installers/web/lighttpd/lighttpd_factory_.v index 7c506f90..402d6bcd 100644 --- a/lib/installers/web/lighttpd/lighttpd_factory_.v +++ b/lib/installers/web/lighttpd/lighttpd_factory_.v @@ -1,9 +1,9 @@ module lighttpd -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager import time __global ( diff --git a/lib/installers/web/lighttpd/lighttpd_model.v b/lib/installers/web/lighttpd/lighttpd_model.v index 39c075f7..53b2697e 100644 --- a/lib/installers/web/lighttpd/lighttpd_model.v +++ b/lib/installers/web/lighttpd/lighttpd_model.v @@ -1,6 +1,6 @@ module lighttpd -import freeflowuniverse.herolib.data.paramsparser +import incubaid.herolib.data.paramsparser import os pub const version = '0.0.0' diff --git a/lib/installers/web/tailwind/readme.md b/lib/installers/web/tailwind/readme.md index 3c798a16..a91e5b8e 100644 --- a/lib/installers/web/tailwind/readme.md +++ b/lib/installers/web/tailwind/readme.md @@ -1,14 +1,12 @@ # tailwind - - To get started ```v -import freeflowuniverse.herolib.installers.something. tailwind +import incubaid.herolib.installers.something. tailwind mut installer:= tailwind.get()! @@ -21,7 +19,6 @@ installer.start()! ## example heroscript - ```hero !!tailwind.install homedir: '/home/user/tailwind' @@ -32,5 +29,3 @@ installer.start()! port: 8888 ``` - - diff --git a/lib/installers/web/tailwind/tailwind_actions.v b/lib/installers/web/tailwind/tailwind_actions.v index 49980fbc..eb706b26 100644 --- a/lib/installers/web/tailwind/tailwind_actions.v +++ b/lib/installers/web/tailwind/tailwind_actions.v @@ -1,10 +1,10 @@ module tailwind -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.core -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.installers.ulist +import incubaid.herolib.osal.core as osal +import incubaid.herolib.core +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.installers.ulist import os //////////////////// following actions are not specific to instance of the object diff --git a/lib/installers/web/tailwind/tailwind_factory_.v b/lib/installers/web/tailwind/tailwind_factory_.v index 63ec9d5a..36bcb4fa 100644 --- a/lib/installers/web/tailwind/tailwind_factory_.v +++ b/lib/installers/web/tailwind/tailwind_factory_.v @@ -1,9 +1,9 @@ module tailwind -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager __global ( tailwind_global map[string]&Tailwind diff --git a/lib/installers/web/tailwind/tailwind_model.v b/lib/installers/web/tailwind/tailwind_model.v index 12de852b..c5e21c8e 100644 --- a/lib/installers/web/tailwind/tailwind_model.v +++ b/lib/installers/web/tailwind/tailwind_model.v @@ -1,6 +1,6 @@ module tailwind -import freeflowuniverse.herolib.data.encoderhero +import incubaid.herolib.data.encoderhero pub const version = '3.4.12' const singleton = false diff --git a/lib/installers/web/tailwind4/readme.md b/lib/installers/web/tailwind4/readme.md index a9e3dfb3..50bf07dc 100644 --- a/lib/installers/web/tailwind4/readme.md +++ b/lib/installers/web/tailwind4/readme.md @@ -1,14 +1,12 @@ # tailwind4 - - To get started ```v -import freeflowuniverse.herolib.installers.something. tailwind4 +import incubaid.herolib.installers.something. tailwind4 mut installer:= tailwind4.get()! @@ -21,7 +19,6 @@ installer.start()! ## example heroscript - ```hero !!tailwind4.install homedir: '/home/user/tailwind4' @@ -32,5 +29,3 @@ installer.start()! port: 8888 ``` - - diff --git a/lib/installers/web/tailwind4/tailwind4_actions.v b/lib/installers/web/tailwind4/tailwind4_actions.v index f5c1adaf..a5c0d1f0 100644 --- a/lib/installers/web/tailwind4/tailwind4_actions.v +++ b/lib/installers/web/tailwind4/tailwind4_actions.v @@ -1,10 +1,10 @@ module tailwind4 -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.core -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.installers.ulist +import incubaid.herolib.osal.core as osal +import incubaid.herolib.core +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.installers.ulist import os //////////////////// following actions are not specific to instance of the object diff --git a/lib/installers/web/tailwind4/tailwind4_factory_.v b/lib/installers/web/tailwind4/tailwind4_factory_.v index bb6b3c5b..996d831e 100644 --- a/lib/installers/web/tailwind4/tailwind4_factory_.v +++ b/lib/installers/web/tailwind4/tailwind4_factory_.v @@ -1,9 +1,9 @@ module tailwind4 -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager __global ( tailwind4_global map[string]&Tailwind diff --git a/lib/installers/web/tailwind4/tailwind4_model.v b/lib/installers/web/tailwind4/tailwind4_model.v index ebd6858d..0714bd9e 100644 --- a/lib/installers/web/tailwind4/tailwind4_model.v +++ b/lib/installers/web/tailwind4/tailwind4_model.v @@ -1,6 +1,6 @@ module tailwind4 -import freeflowuniverse.herolib.data.encoderhero +import incubaid.herolib.data.encoderhero pub const version = '4.0.8' const singleton = false diff --git a/lib/installers/web/traefik/readme.md b/lib/installers/web/traefik/readme.md index dcf74b3d..13fd5b45 100644 --- a/lib/installers/web/traefik/readme.md +++ b/lib/installers/web/traefik/readme.md @@ -1,14 +1,12 @@ # traefik - - To get started ```v -import freeflowuniverse.herolib.installers.web.traefik as traefik_installer +import incubaid.herolib.installers.web.traefik as traefik_installer mut installer:= traefik_installer.get()! @@ -18,4 +16,3 @@ installer.start()! ``` - diff --git a/lib/installers/web/traefik/traefik_actions.v b/lib/installers/web/traefik/traefik_actions.v index 3ff6d4e4..9cac453d 100644 --- a/lib/installers/web/traefik/traefik_actions.v +++ b/lib/installers/web/traefik/traefik_actions.v @@ -1,11 +1,11 @@ module traefik -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core -import freeflowuniverse.herolib.osal.startupmanager -import freeflowuniverse.herolib.installers.ulist +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.core +import incubaid.herolib.osal.startupmanager +import incubaid.herolib.installers.ulist import os fn startupcmd() ![]startupmanager.ZProcessNewArgs { diff --git a/lib/installers/web/traefik/traefik_factory_.v b/lib/installers/web/traefik/traefik_factory_.v index 1162e29a..cdf266ac 100644 --- a/lib/installers/web/traefik/traefik_factory_.v +++ b/lib/installers/web/traefik/traefik_factory_.v @@ -1,10 +1,10 @@ module traefik -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.base +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager import time __global ( diff --git a/lib/installers/web/traefik/traefik_model.v b/lib/installers/web/traefik/traefik_model.v index 50c12db9..48255dca 100644 --- a/lib/installers/web/traefik/traefik_model.v +++ b/lib/installers/web/traefik/traefik_model.v @@ -1,10 +1,10 @@ module traefik -import freeflowuniverse.herolib.data.paramsparser -import freeflowuniverse.herolib.data.encoderhero +import incubaid.herolib.data.paramsparser +import incubaid.herolib.data.encoderhero import os -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.ui.console +import incubaid.herolib.core.pathlib pub const version = '3.3.3' const singleton = true diff --git a/lib/installers/web/zola/readme.md b/lib/installers/web/zola/readme.md index 5bb3a965..4fa62ccf 100644 --- a/lib/installers/web/zola/readme.md +++ b/lib/installers/web/zola/readme.md @@ -1,14 +1,12 @@ # zola - - To get started ```v -import freeflowuniverse.herolib.installers.something. zola +import incubaid.herolib.installers.something. zola mut installer:= zola.get()! @@ -21,7 +19,6 @@ installer.start()! ## example heroscript - ```hero !!zola.install homedir: '/home/user/zola' @@ -32,5 +29,3 @@ installer.start()! port: 8888 ``` - - diff --git a/lib/installers/web/zola/zola_actions.v b/lib/installers/web/zola/zola_actions.v index fe1f59ac..b0a362d5 100644 --- a/lib/installers/web/zola/zola_actions.v +++ b/lib/installers/web/zola/zola_actions.v @@ -1,12 +1,12 @@ module zola -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.core -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.installers.base -import freeflowuniverse.herolib.installers.lang.rust -import freeflowuniverse.herolib.installers.web.tailwind +import incubaid.herolib.osal.core as osal +import incubaid.herolib.core +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.installers.base +import incubaid.herolib.installers.lang.rust +import incubaid.herolib.installers.web.tailwind import os pub const version = '0.18.0' diff --git a/lib/installers/web/zola/zola_factory_.v b/lib/installers/web/zola/zola_factory_.v index 089fd776..ae06e84b 100644 --- a/lib/installers/web/zola/zola_factory_.v +++ b/lib/installers/web/zola/zola_factory_.v @@ -1,9 +1,9 @@ module zola -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager __global ( zola_global map[string]&ZolaInstaller diff --git a/lib/installers/web/zola/zola_model.v b/lib/installers/web/zola/zola_model.v index 789223c5..62f8cc8b 100644 --- a/lib/installers/web/zola/zola_model.v +++ b/lib/installers/web/zola/zola_model.v @@ -1,6 +1,6 @@ module zola -import freeflowuniverse.herolib.data.paramsparser +import incubaid.herolib.data.paramsparser import os const singleton = false diff --git a/lib/lang/python/MIGRATION.md b/lib/lang/python/MIGRATION.md index 7868de38..05204789 100644 --- a/lib/lang/python/MIGRATION.md +++ b/lib/lang/python/MIGRATION.md @@ -5,6 +5,7 @@ This guide helps you migrate from the old database-based Python module to the ne ## Overview of Changes ### What Changed + - ❌ **Removed**: Database dependency (`dbfs.DB`) for package tracking - ❌ **Removed**: Manual pip package state management - ❌ **Removed**: Legacy virtual environment creation @@ -14,6 +15,7 @@ This guide helps you migrate from the old database-based Python module to the ne - ✅ **Added**: Shell script generation for environment management ### What Stayed the Same + - ✅ **Backward Compatible**: `pip()` and `pip_uninstall()` methods still work - ✅ **Same API**: `new()`, `exec()`, `shell()` methods unchanged - ✅ **Same Paths**: Environments still created in `~/hero/python/{name}` @@ -23,6 +25,7 @@ This guide helps you migrate from the old database-based Python module to the ne ### 1. Constructor Arguments **Before:** + ```v py := python.new(name: 'test', reset: true)! py.update()! // Required separate call @@ -30,6 +33,7 @@ py.pip('requests')! // Manual package installation ``` **After:** + ```v py := python.new( name: 'test' @@ -41,6 +45,7 @@ py := python.new( ### 2. Database Methods Removed **Before:** + ```v py.pips_done_reset()! // ❌ No longer exists py.pips_done_add('package')! // ❌ No longer exists @@ -49,6 +54,7 @@ py.pips_done()! // ❌ No longer exists ``` **After:** + ```v py.list_packages()! // ✅ Use this instead ``` @@ -56,6 +62,7 @@ py.list_packages()! // ✅ Use this instead ### 3. Environment Structure **Before:** + ``` ~/hero/python/test/ ├── bin/activate # venv activation @@ -64,6 +71,7 @@ py.list_packages()! // ✅ Use this instead ``` **After:** + ``` ~/hero/python/test/ ├── .venv/ # uv-managed virtual environment @@ -78,6 +86,7 @@ py.list_packages()! // ✅ Use this instead ### Step 1: Update Dependencies Ensure `uv` is installed: + ```bash curl -LsSf https://astral.sh/uv/install.sh | sh ``` @@ -85,8 +94,9 @@ curl -LsSf https://astral.sh/uv/install.sh | sh ### Step 2: Update Code **Old Code:** + ```v -import freeflowuniverse.herolib.lang.python +import incubaid.herolib.lang.python py := python.new(name: 'my_project')! py.update()! @@ -99,8 +109,9 @@ if py.pips_done_check('requests')! { ``` **New Code:** + ```v -import freeflowuniverse.herolib.lang.python +import incubaid.herolib.lang.python py := python.new( name: 'my_project' @@ -117,6 +128,7 @@ if 'requests' in packages.join(' ') { ### Step 3: Update Package Management **Old Code:** + ```v // Add packages py.pip('numpy,pandas')! @@ -129,6 +141,7 @@ py.pips_done_add('numpy')! ``` **New Code:** + ```v // Add packages (new method) py.add_dependencies(['numpy', 'pandas'], false)! @@ -144,6 +157,7 @@ py.pip_uninstall('old_package')! // Uses uv under the hood ### Step 4: Update Environment Creation **Old Code:** + ```v py := python.new(name: 'test')! if !py.exists() { @@ -153,6 +167,7 @@ py.update()! ``` **New Code:** + ```v py := python.new(name: 'test')! // Automatic initialization // No manual init_env() or update() needed @@ -197,6 +212,7 @@ py.uv_run('add --dev mypy')! // Run uv commands ### 4. Template Generation Each environment automatically generates: + - `pyproject.toml` - Project configuration - `env.sh` - Environment activation script - `install.sh` - Installation script @@ -213,6 +229,7 @@ Each environment automatically generates: ## Troubleshooting ### Issue: "uv command not found" + ```bash # Install uv curl -LsSf https://astral.sh/uv/install.sh | sh @@ -220,19 +237,23 @@ source ~/.bashrc # or restart terminal ``` ### Issue: "Environment not found" + ```v // Force recreation py := python.new(name: 'test', reset: true)! ``` ### Issue: "Package conflicts" + ```v // Update lock file and sync py.update()! ``` ### Issue: "Legacy code not working" + The old `pip()` methods are backward compatible: + ```v py.pip('requests')! // Still works, uses uv internally ``` @@ -240,6 +261,7 @@ py.pip('requests')! // Still works, uses uv internally ## Testing Migration Run the updated tests to verify everything works: + ```bash vtest lib/lang/python/python_test.v ``` @@ -248,4 +270,4 @@ vtest lib/lang/python/python_test.v - Check the updated [README.md](readme.md) for full API documentation - See `examples/lang/python/` for working examples -- The old API methods are preserved for backward compatibility \ No newline at end of file +- The old API methods are preserved for backward compatibility diff --git a/lib/lang/python/freeze.v b/lib/lang/python/freeze.v index ace6b977..e5454c31 100644 --- a/lib/lang/python/freeze.v +++ b/lib/lang/python/freeze.v @@ -1,7 +1,7 @@ module python -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console // Export current environment dependencies to requirements.txt pub fn (py PythonEnv) freeze() !string { diff --git a/lib/lang/python/pyexec.v b/lib/lang/python/pyexec.v index f21186ad..31f0cd41 100644 --- a/lib/lang/python/pyexec.v +++ b/lib/lang/python/pyexec.v @@ -1,11 +1,11 @@ module python -import freeflowuniverse.herolib.osal.core as osal -// import freeflowuniverse.herolib.data.dbfs -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.osal.core as osal +// import incubaid.herolib.data.dbfs +import incubaid.herolib.core.pathlib +import incubaid.herolib.core.texttools import os -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console @[params] pub struct PythonExecArgs { diff --git a/lib/lang/python/python.v b/lib/lang/python/python.v index dff129a7..306bae2d 100644 --- a/lib/lang/python/python.v +++ b/lib/lang/python/python.v @@ -1,9 +1,9 @@ module python -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.osal.core as osal +import incubaid.herolib.core.pathlib +import incubaid.herolib.core.texttools +import incubaid.herolib.ui.console import os pub struct PythonEnv { diff --git a/lib/lang/python/python_test.v b/lib/lang/python/python_test.v index 4f1e41d4..f05990d8 100644 --- a/lib/lang/python/python_test.v +++ b/lib/lang/python/python_test.v @@ -1,6 +1,6 @@ module python -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console fn test_python_env_creation() { console.print_debug('Testing Python environment creation') diff --git a/lib/lang/python/readme.md b/lib/lang/python/readme.md index daa78416..91ce9a81 100644 --- a/lib/lang/python/readme.md +++ b/lib/lang/python/readme.md @@ -13,7 +13,7 @@ This module provides modern Python environment management using `uv` - a fast Py ## Quick Start ```v -import freeflowuniverse.herolib.lang.python +import incubaid.herolib.lang.python // Create a new Python environment py := python.new( @@ -179,6 +179,7 @@ py.exec( ## Migration from Old Implementation ### Before (Database-based) + ```v py := python.new(name: 'test')! py.update()! // Manual pip upgrade @@ -186,6 +187,7 @@ py.pip('requests')! // Manual package tracking ``` ### After (UV-based) + ```v py := python.new( name: 'test' @@ -229,4 +231,4 @@ See `examples/lang/python/` for complete working examples. - `uv` is 10-100x faster than pip for most operations - Dependency resolution is significantly improved - Lock files ensure reproducible environments -- No manual state tracking reduces complexity and errors \ No newline at end of file +- No manual state tracking reduces complexity and errors diff --git a/lib/lang/python/shell.v b/lib/lang/python/shell.v index d2605d9f..3e900c6a 100644 --- a/lib/lang/python/shell.v +++ b/lib/lang/python/shell.v @@ -1,7 +1,7 @@ module python -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console // Open an interactive shell in the Python environment pub fn (py PythonEnv) shell() ! { diff --git a/lib/lang/python/templates.v b/lib/lang/python/templates.v index 0e121250..22b52a09 100644 --- a/lib/lang/python/templates.v +++ b/lib/lang/python/templates.v @@ -1,7 +1,7 @@ module python -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.texttools +import incubaid.herolib.core.pathlib import os @[params] diff --git a/lib/lang/rust/rust.v b/lib/lang/rust/rust.v index d07e15ee..b7d1d250 100644 --- a/lib/lang/rust/rust.v +++ b/lib/lang/rust/rust.v @@ -1,7 +1,7 @@ module rust import os -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib // Reads and combines all Rust files in the given directory pub fn read_source_code(source_code_path string) !string { diff --git a/lib/lang/rust/rust_test.v b/lib/lang/rust/rust_test.v index c65d4ae6..bd2a5d60 100644 --- a/lib/lang/rust/rust_test.v +++ b/lib/lang/rust/rust_test.v @@ -1,6 +1,6 @@ module rust_test -import freeflowuniverse.herolib.lang.rust +import incubaid.herolib.lang.rust import os fn test_extract_functions_from_content() { diff --git a/lib/osal/core/cmds.v b/lib/osal/core/cmds.v index 1ecf328c..bc2d99bc 100644 --- a/lib/osal/core/cmds.v +++ b/lib/osal/core/cmds.v @@ -1,11 +1,11 @@ module core import os -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.core -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.pathlib +import incubaid.herolib.core +import incubaid.herolib.ui.console // import regex -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.texttools pub struct CmdAddArgs { pub mut: @@ -13,7 +13,7 @@ pub mut: source string @[required] // path where the binary is symlink bool // if rather than copy do a symlink reset bool = true // if existing cmd will delete - // bin_repo_url string = 'https://github.com/freeflowuniverse/freeflow_binary' // binary where we put the results + // bin_repo_url string = 'https://github.com/incubaid/freeflow_binary' // binary where we put the results } // copy a binary to the right location on the local computer . diff --git a/lib/osal/core/done.v b/lib/osal/core/done.v index cb646938..d8a51903 100644 --- a/lib/osal/core/done.v +++ b/lib/osal/core/done.v @@ -1,8 +1,8 @@ module core -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.redisclient -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.base +import incubaid.herolib.core.redisclient +import incubaid.herolib.ui.console fn donedb() !&redisclient.Redis { mut context := base.context()! diff --git a/lib/osal/core/downloader.v b/lib/osal/core/downloader.v index 75414997..1fafdcfe 100644 --- a/lib/osal/core/downloader.v +++ b/lib/osal/core/downloader.v @@ -1,8 +1,8 @@ module core -import freeflowuniverse.herolib.core.pathlib -// import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.pathlib +// import incubaid.herolib.core.texttools +import incubaid.herolib.ui.console import os @[params] diff --git a/lib/osal/core/env.v b/lib/osal/core/env.v index ab0d06ce..9d4e1cfd 100644 --- a/lib/osal/core/env.v +++ b/lib/osal/core/env.v @@ -1,6 +1,6 @@ module core -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib import os @[params] diff --git a/lib/osal/core/exec.v b/lib/osal/core/exec.v index 9c009334..530fcf74 100644 --- a/lib/osal/core/exec.v +++ b/lib/osal/core/exec.v @@ -1,8 +1,8 @@ module core -import freeflowuniverse.herolib.core.texttools -// import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.texttools +// import incubaid.herolib.core.pathlib +import incubaid.herolib.ui.console import json import os import time diff --git a/lib/osal/core/exec_to_scriptpath.v b/lib/osal/core/exec_to_scriptpath.v index 983115bc..6ab76496 100644 --- a/lib/osal/core/exec_to_scriptpath.v +++ b/lib/osal/core/exec_to_scriptpath.v @@ -1,8 +1,8 @@ module core -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core.pathlib -// import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.core.pathlib +// import incubaid.herolib.ui.console // will return temporary path which then can be executed, is a helper function for making script out of command pub fn cmd_to_script_path(cmd Command) !string { diff --git a/lib/osal/core/file.v b/lib/osal/core/file.v index 2b679202..f08cbd51 100644 --- a/lib/osal/core/file.v +++ b/lib/osal/core/file.v @@ -1,8 +1,8 @@ module core -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.core +import incubaid.herolib.ui.console import os pub fn file_write(path string, text string) ! { diff --git a/lib/osal/core/net.v b/lib/osal/core/net.v index 2318f363..450fc801 100644 --- a/lib/osal/core/net.v +++ b/lib/osal/core/net.v @@ -2,8 +2,8 @@ module core import net import time -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core as herolib_core +import incubaid.herolib.ui.console +import incubaid.herolib.core as herolib_core import math import os diff --git a/lib/osal/core/package.v b/lib/osal/core/package.v index 48994865..c7de7c05 100644 --- a/lib/osal/core/package.v +++ b/lib/osal/core/package.v @@ -1,8 +1,8 @@ module core -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.core // update the package list pub fn package_refresh() ! { diff --git a/lib/osal/core/package_test.v b/lib/osal/core/package_test.v index a968df0c..e223fcff 100644 --- a/lib/osal/core/package_test.v +++ b/lib/osal/core/package_test.v @@ -1,6 +1,6 @@ module core -import freeflowuniverse.herolib.core +import incubaid.herolib.core fn test_package_management() { platform_ := core.platform()! diff --git a/lib/osal/core/ps_tool.v b/lib/osal/core/ps_tool.v index aa6c59b3..8c86c3d6 100644 --- a/lib/osal/core/ps_tool.v +++ b/lib/osal/core/ps_tool.v @@ -3,7 +3,7 @@ module core import time import os import math -// import freeflowuniverse.herolib.ui.console +// import incubaid.herolib.ui.console pub enum PMState { init diff --git a/lib/osal/core/readme.md b/lib/osal/core/readme.md index be3cfb5a..a3d8583e 100644 --- a/lib/osal/core/readme.md +++ b/lib/osal/core/readme.md @@ -10,31 +10,31 @@ This module encapsulates essential OS-level features, making system programming Execute shell commands with fine-grained control and robust error handling. -* **`osal.exec(cmd: Command)`**: Executes a command with extensive options. - * `Command` struct fields: - * `cmd` (string): The command string. - * `timeout` (int): Max execution time in seconds (default: 3600). - * `retry` (int): Number of retries on failure. - * `work_folder` (string): Working directory for the command. - * `environment` (map[string]string): Environment variables for the command. - * `stdout` (bool): Show command output (default: true). - * `raise_error` (bool): Raise V error on failure (default: true). - * `ignore_error` (bool): Do not raise error, just report. - * `debug` (bool): Enable debug output. - * `shell` (bool): Execute in interactive shell. - * `async` (bool): Run command asynchronously. - * `runtime` (RunTime): Specify runtime (e.g., `.bash`, `.python`). - * Returns `Job` struct with `status`, `output`, `error`, `exit_code`, etc. -* **`osal.execute_silent(cmd string)`**: Executes a command silently, returns output. -* **`osal.execute_debug(cmd string)`**: Executes a command with debug output, returns output. -* **`osal.execute_stdout(cmd string)`**: Executes a command and prints output to stdout, returns output. -* **`osal.execute_interactive(cmd string)`**: Executes a command in an interactive shell. -* **`osal.cmd_exists(cmd string)`**: Checks if a command exists in the system's PATH. +* **`osal.exec(cmd: Command)`**: Executes a command with extensive options. + * `Command` struct fields: + * `cmd` (string): The command string. + * `timeout` (int): Max execution time in seconds (default: 3600). + * `retry` (int): Number of retries on failure. + * `work_folder` (string): Working directory for the command. + * `environment` (map[string]string): Environment variables for the command. + * `stdout` (bool): Show command output (default: true). + * `raise_error` (bool): Raise V error on failure (default: true). + * `ignore_error` (bool): Do not raise error, just report. + * `debug` (bool): Enable debug output. + * `shell` (bool): Execute in interactive shell. + * `async` (bool): Run command asynchronously. + * `runtime` (RunTime): Specify runtime (e.g., `.bash`, `.python`). + * Returns `Job` struct with `status`, `output`, `error`, `exit_code`, etc. +* **`osal.execute_silent(cmd string)`**: Executes a command silently, returns output. +* **`osal.execute_debug(cmd string)`**: Executes a command with debug output, returns output. +* **`osal.execute_stdout(cmd string)`**: Executes a command and prints output to stdout, returns output. +* **`osal.execute_interactive(cmd string)`**: Executes a command in an interactive shell. +* **`osal.cmd_exists(cmd string)`**: Checks if a command exists in the system's PATH. **Example: Flexible Command Execution** ```v -import freeflowuniverse.herolib.osal.core as osal +import incubaid.herolib.osal.core as osal // Simple command execution job := osal.exec(cmd: 'ls -la')! @@ -79,90 +79,89 @@ if job_result.is_err() { Tools for network diagnostics and information. -* **`osal.ping(args: PingArgs)`**: Checks host reachability. - * `PingArgs` struct fields: `address` (string, required), `count` (u8), `timeout` (u16), `retry` (u8). - * Returns `PingResult` enum: `.ok`, `.timeout`, `.unknownhost`. -* **`osal.tcp_port_test(args: TcpPortTestArgs)`**: Tests if a TCP port is open. - * `TcpPortTestArgs` struct fields: `address` (string, required), `port` (int), `timeout` (u16 in milliseconds). - * Returns `bool`. -* **`osal.ipaddr_pub_get()`**: Retrieves the public IP address. Returns `string`. -* **`osal.is_ip_on_local_interface(ip string)`**: Checks if an IP is on a local interface. Returns `bool`. +* **`osal.ping(args: PingArgs)`**: Checks host reachability. + * `PingArgs` struct fields: `address` (string, required), `count` (u8), `timeout` (u16), `retry` (u8). + * Returns `PingResult` enum: `.ok`, `.timeout`, `.unknownhost`. +* **`osal.tcp_port_test(args: TcpPortTestArgs)`**: Tests if a TCP port is open. + * `TcpPortTestArgs` struct fields: `address` (string, required), `port` (int), `timeout` (u16 in milliseconds). + * Returns `bool`. +* **`osal.ipaddr_pub_get()`**: Retrieves the public IP address. Returns `string`. +* **`osal.is_ip_on_local_interface(ip string)`**: Checks if an IP is on a local interface. Returns `bool`. ### 3. File System Operations (`file.v`) Functions for managing files and directories. -* **`osal.file_write(path string, text string)`**: Writes text to a file. -* **`osal.file_read(path string)`**: Reads content from a file. Returns `string`. -* **`osal.dir_ensure(path string)`**: Ensures a directory exists, creates if not. -* **`osal.dir_delete(path string)`**: Deletes a directory if it exists. -* **`osal.dir_reset(path string)`**: Deletes and recreates a directory. -* **`osal.rm(todelete string)`**: Removes files/directories (supports `~`, comma/newline separated paths, sudo). +* **`osal.file_write(path string, text string)`**: Writes text to a file. +* **`osal.file_read(path string)`**: Reads content from a file. Returns `string`. +* **`osal.dir_ensure(path string)`**: Ensures a directory exists, creates if not. +* **`osal.dir_delete(path string)`**: Deletes a directory if it exists. +* **`osal.dir_reset(path string)`**: Deletes and recreates a directory. +* **`osal.rm(todelete string)`**: Removes files/directories (supports `~`, comma/newline separated paths, sudo). ### 4. Environment Variables (`env.v`) Manage system environment variables. -* **`osal.env_set(args: EnvSet)`**: Sets an environment variable. - * `EnvSet` struct fields: `key` (string, required), `value` (string, required), `overwrite` (bool). -* **`osal.env_unset(key string)`**: Unsets an environment variable. -* **`osal.env_unset_all()`**: Unsets all environment variables. -* **`osal.env_set_all(args: EnvSetAll)`**: Sets multiple environment variables. - * `EnvSetAll` struct fields: `env` (map[string]string), `clear_before_set` (bool), `overwrite_if_exists` (bool). -* **`osal.env_get(key string)`**: Retrieves an environment variable's value. Returns `string`. -* **`osal.env_exists(key string)`**: Checks if an environment variable exists. Returns `bool`. -* **`osal.env_get_default(key string, def string)`**: Gets an environment variable or a default value. Returns `string`. -* **`osal.load_env_file(file_path string)`**: Loads environment variables from a file. +* **`osal.env_set(args: EnvSet)`**: Sets an environment variable. + * `EnvSet` struct fields: `key` (string, required), `value` (string, required), `overwrite` (bool). +* **`osal.env_unset(key string)`**: Unsets an environment variable. +* **`osal.env_unset_all()`**: Unsets all environment variables. +* **`osal.env_set_all(args: EnvSetAll)`**: Sets multiple environment variables. + * `EnvSetAll` struct fields: `env` (map[string]string), `clear_before_set` (bool), `overwrite_if_exists` (bool). +* **`osal.env_get(key string)`**: Retrieves an environment variable's value. Returns `string`. +* **`osal.env_exists(key string)`**: Checks if an environment variable exists. Returns `bool`. +* **`osal.env_get_default(key string, def string)`**: Gets an environment variable or a default value. Returns `string`. +* **`osal.load_env_file(file_path string)`**: Loads environment variables from a file. ### 5. Command & Profile Management (`cmds.v`) Manage system commands and shell profile paths. -* **`osal.cmd_add(args: CmdAddArgs)`**: Adds a binary to system paths and updates profiles. - * `CmdAddArgs` struct fields: `cmdname` (string), `source` (string, required), `symlink` (bool), `reset` (bool). -* **`osal.profile_path_add_hero()`**: Adds `~/hero/bin` to profile. Returns `string` (path). -* **`osal.bin_path()`**: Returns the preferred binary installation path. Returns `string`. -* **`osal.hero_path()`**: Returns the `~/hero` directory path. Returns `string`. -* **`osal.usr_local_path()`**: Returns `/usr/local` (Linux) or `~/hero` (macOS). Returns `string`. -* **`osal.profile_path_source()`**: Returns a source command for the preferred profile. Returns `string`. -* **`osal.profile_path_source_and()`**: Returns a source command followed by `&&`. Returns `string`. -* **`osal.profile_path_add_remove(args: ProfilePathAddRemoveArgs)`**: Adds/removes paths from profiles. - * `ProfilePathAddRemoveArgs` struct fields: `paths_profile` (string), `paths2add` (string), `paths2delete` (string), `allprofiles` (bool). -* **`osal.cmd_path(cmd string)`**: Returns the full path of an executable command. Returns `string`. -* **`osal.cmd_delete(cmd string)`**: Deletes commands from their locations. -* **`osal.profile_paths_all()`**: Lists all possible profile file paths. Returns `[]string`. -* **`osal.profile_paths_preferred()`**: Lists preferred profile file paths for the OS. Returns `[]string`. -* **`osal.profile_path()`**: Returns the most preferred profile file path. Returns `string`. +* **`osal.cmd_add(args: CmdAddArgs)`**: Adds a binary to system paths and updates profiles. + * `CmdAddArgs` struct fields: `cmdname` (string), `source` (string, required), `symlink` (bool), `reset` (bool). +* **`osal.profile_path_add_hero()`**: Adds `~/hero/bin` to profile. Returns `string` (path). +* **`osal.bin_path()`**: Returns the preferred binary installation path. Returns `string`. +* **`osal.hero_path()`**: Returns the `~/hero` directory path. Returns `string`. +* **`osal.usr_local_path()`**: Returns `/usr/local` (Linux) or `~/hero` (macOS). Returns `string`. +* **`osal.profile_path_source()`**: Returns a source command for the preferred profile. Returns `string`. +* **`osal.profile_path_source_and()`**: Returns a source command followed by `&&`. Returns `string`. +* **`osal.profile_path_add_remove(args: ProfilePathAddRemoveArgs)`**: Adds/removes paths from profiles. + * `ProfilePathAddRemoveArgs` struct fields: `paths_profile` (string), `paths2add` (string), `paths2delete` (string), `allprofiles` (bool). +* **`osal.cmd_path(cmd string)`**: Returns the full path of an executable command. Returns `string`. +* **`osal.cmd_delete(cmd string)`**: Deletes commands from their locations. +* **`osal.profile_paths_all()`**: Lists all possible profile file paths. Returns `[]string`. +* **`osal.profile_paths_preferred()`**: Lists preferred profile file paths for the OS. Returns `[]string`. +* **`osal.profile_path()`**: Returns the most preferred profile file path. Returns `string`. ### 6. System Information & Utilities (`ps_tool.v`, `sleep.v`, `downloader.v`, `users.v`, etc.) Miscellaneous system functionalities. -* **`osal.processmap_get()`**: Gets a map of all running processes. Returns `ProcessMap`. -* **`osal.processinfo_get(pid int)`**: Gets info for a specific process. Returns `ProcessInfo`. -* **`osal.processinfo_get_byname(name string)`**: Gets info for processes by name. Returns `[]ProcessInfo`. -* **`osal.process_exists(pid int)`**: Checks if a process exists by PID. Returns `bool`. -* **`osal.processinfo_with_children(pid int)`**: Gets a process and its children. Returns `ProcessMap`. -* **`osal.processinfo_children(pid int)`**: Gets children of a process. Returns `ProcessMap`. -* **`osal.process_kill_recursive(args: ProcessKillArgs)`**: Kills a process and its children. - * `ProcessKillArgs` struct fields: `name` (string), `pid` (int). -* **`osal.whoami()`**: Returns the current username. Returns `string`. -* **`osal.sleep(duration int)`**: Pauses execution for `duration` seconds. -* **`osal.download(args: DownloadArgs)`**: Downloads a file from a URL. - * `DownloadArgs` struct fields: `url` (string), `name` (string), `reset` (bool), `hash` (string), `dest` (string), `timeout` (int), `retry` (int), `minsize_kb` (u32), `maxsize_kb` (u32), `expand_dir` (string), `expand_file` (string). - * Returns `pathlib.Path`. -* **`osal.user_exists(username string)`**: Checks if a user exists. Returns `bool`. -* **`osal.user_id_get(username string)`**: Gets user ID. Returns `int`. -* **`osal.user_add(args: UserArgs)`**: Adds a user. - * `UserArgs` struct fields: `name` (string, required). Returns `int` (user ID). - +* **`osal.processmap_get()`**: Gets a map of all running processes. Returns `ProcessMap`. +* **`osal.processinfo_get(pid int)`**: Gets info for a specific process. Returns `ProcessInfo`. +* **`osal.processinfo_get_byname(name string)`**: Gets info for processes by name. Returns `[]ProcessInfo`. +* **`osal.process_exists(pid int)`**: Checks if a process exists by PID. Returns `bool`. +* **`osal.processinfo_with_children(pid int)`**: Gets a process and its children. Returns `ProcessMap`. +* **`osal.processinfo_children(pid int)`**: Gets children of a process. Returns `ProcessMap`. +* **`osal.process_kill_recursive(args: ProcessKillArgs)`**: Kills a process and its children. + * `ProcessKillArgs` struct fields: `name` (string), `pid` (int). +* **`osal.whoami()`**: Returns the current username. Returns `string`. +* **`osal.sleep(duration int)`**: Pauses execution for `duration` seconds. +* **`osal.download(args: DownloadArgs)`**: Downloads a file from a URL. + * `DownloadArgs` struct fields: `url` (string), `name` (string), `reset` (bool), `hash` (string), `dest` (string), `timeout` (int), `retry` (int), `minsize_kb` (u32), `maxsize_kb` (u32), `expand_dir` (string), `expand_file` (string). + * Returns `pathlib.Path`. +* **`osal.user_exists(username string)`**: Checks if a user exists. Returns `bool`. +* **`osal.user_id_get(username string)`**: Gets user ID. Returns `int`. +* **`osal.user_add(args: UserArgs)`**: Adds a user. + * `UserArgs` struct fields: `name` (string, required). Returns `int` (user ID). ## Notes on the CMD Job Execution -* Commands are executed from temporary scripts in `/tmp/execscripts`. -* Failed script executions are preserved for debugging. -* Successful script executions are automatically cleaned up. -* Platform-specific behavior is automatically handled. -* Timeout and retry mechanisms are available for robust execution. -* Environment variables and working directories can be specified per command. -* Interactive and non-interactive modes are supported. +* Commands are executed from temporary scripts in `/tmp/execscripts`. +* Failed script executions are preserved for debugging. +* Successful script executions are automatically cleaned up. +* Platform-specific behavior is automatically handled. +* Timeout and retry mechanisms are available for robust execution. +* Environment variables and working directories can be specified per command. +* Interactive and non-interactive modes are supported. diff --git a/lib/osal/core/ssh_key.v b/lib/osal/core/ssh_key.v index f00d8085..5c618249 100644 --- a/lib/osal/core/ssh_key.v +++ b/lib/osal/core/ssh_key.v @@ -1,6 +1,6 @@ module core -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib import os @[noinit] diff --git a/lib/osal/core/users.v b/lib/osal/core/users.v index 3e6bbaa5..42b81829 100644 --- a/lib/osal/core/users.v +++ b/lib/osal/core/users.v @@ -1,8 +1,8 @@ module core import os -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core +import incubaid.herolib.ui.console +import incubaid.herolib.core @[params] pub struct UserArgs { diff --git a/lib/osal/coredns/README.md b/lib/osal/coredns/README.md index b8152c9c..84ec6b37 100644 --- a/lib/osal/coredns/README.md +++ b/lib/osal/coredns/README.md @@ -2,12 +2,12 @@ This module provides functionality for managing DNS records in Redis for use with CoreDNS. It supports various DNS record types and provides a simple interface for adding and managing DNS records. - ## Heroscript Examples The following examples demonstrate how to define DNS records using heroscript actions: ### A Record + ``` !!dns.a_record sub_domain: 'host1' @@ -16,6 +16,7 @@ The following examples demonstrate how to define DNS records using heroscript ac ``` ### AAAA Record + ``` !!dns.aaaa_record sub_domain: 'host1' @@ -24,6 +25,7 @@ The following examples demonstrate how to define DNS records using heroscript ac ``` ### MX Record + ``` !!dns.mx_record sub_domain: '*' @@ -33,6 +35,7 @@ The following examples demonstrate how to define DNS records using heroscript ac ``` ### TXT Record + ``` !!dns.txt_record sub_domain: '*' @@ -41,6 +44,7 @@ The following examples demonstrate how to define DNS records using heroscript ac ``` ### SRV Record + ``` !!dns.srv_record service: 'ssh' @@ -54,6 +58,7 @@ The following examples demonstrate how to define DNS records using heroscript ac ``` ### NS Record + ``` !!dns.ns_record sub_domain: '@' @@ -62,6 +67,7 @@ The following examples demonstrate how to define DNS records using heroscript ac ``` ### SOA Record + ``` !!dns.soa_record mbox: 'hostmaster.example.com' @@ -73,11 +79,10 @@ The following examples demonstrate how to define DNS records using heroscript ac ttl: 300 ``` - ## v ```v -import freeflowuniverse.herolib.osal.core.coredns +import incubaid.herolib.osal.core.coredns // Create a new DNS record set mut rs := coredns.new_dns_record_set() @@ -96,12 +101,12 @@ rs.add_ns(host: 'ns2.example.net.') rs.set('example.com')! ``` - ## Record Types The following DNS record types are supported: ### SRV Record + ```v SRVRecord { target string // Required: Target hostname @@ -113,6 +118,7 @@ SRVRecord { ``` ### TXT Record + ```v TXTRecord { text string // Required: Text content @@ -121,6 +127,7 @@ TXTRecord { ``` ### MX Record + ```v MXRecord { host string // Required: Mail server hostname @@ -130,6 +137,7 @@ MXRecord { ``` ### A Record + ```v ARecord { name string // Required: Hostname @@ -139,6 +147,7 @@ ARecord { ``` ### AAAA Record + ```v AAAARecord { name string // Required: Hostname @@ -148,6 +157,7 @@ AAAARecord { ``` ### NS Record + ```v NSRecord { host string // Required: Nameserver hostname @@ -156,6 +166,7 @@ NSRecord { ``` ### SOA Record + ```v SOARecord { mbox string // Required: Email address of the admin @@ -167,5 +178,3 @@ SOARecord { ttl int // Default: 300 } ``` - - diff --git a/lib/osal/coredns/model.v b/lib/osal/coredns/model.v index b1310e53..7d13ceca 100644 --- a/lib/osal/coredns/model.v +++ b/lib/osal/coredns/model.v @@ -1,6 +1,6 @@ module coredns -import freeflowuniverse.herolib.core.redisclient +import incubaid.herolib.core.redisclient // // Input parameter structs for each record type diff --git a/lib/osal/coredns/play.v b/lib/osal/coredns/play.v index 802acf89..b5fbd0d9 100644 --- a/lib/osal/coredns/play.v +++ b/lib/osal/coredns/play.v @@ -1,6 +1,6 @@ module coredns -import freeflowuniverse.herolib.core.playbook +import incubaid.herolib.core.playbook // play_dns processes DNS-related actions from heroscript pub fn play_dns(mut plbook playbook.PlayBook) !DNSRecordSet { diff --git a/lib/osal/coredns/populator.v b/lib/osal/coredns/populator.v index 183795bb..e5851863 100644 --- a/lib/osal/coredns/populator.v +++ b/lib/osal/coredns/populator.v @@ -1,6 +1,6 @@ module coredns -import freeflowuniverse.herolib.core.redisclient +import incubaid.herolib.core.redisclient import x.json2 // new_dns_record_set creates a new DNSRecordSet diff --git a/lib/osal/hostsfile/README.md b/lib/osal/hostsfile/README.md index ad2bb9b1..44e32ea0 100644 --- a/lib/osal/hostsfile/README.md +++ b/lib/osal/hostsfile/README.md @@ -19,7 +19,7 @@ Create a file `example.vsh`: ```v #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.osal.core.hostsfile +import incubaid.herolib.osal.core.hostsfile import os // Create a new instance by reading the hosts file diff --git a/lib/osal/hostsfile/hostsfile.v b/lib/osal/hostsfile/hostsfile.v index 97589d49..16aac766 100644 --- a/lib/osal/hostsfile/hostsfile.v +++ b/lib/osal/hostsfile/hostsfile.v @@ -1,7 +1,7 @@ module hostsfile import os -import freeflowuniverse.herolib.osal.core as osal +import incubaid.herolib.osal.core as osal const hosts_file_path = '/etc/hosts' diff --git a/lib/osal/linux/play.v b/lib/osal/linux/play.v index 0e52fdd4..2a417a10 100644 --- a/lib/osal/linux/play.v +++ b/lib/osal/linux/play.v @@ -1,6 +1,6 @@ module linux -import freeflowuniverse.herolib.core.playbook { PlayBook } +import incubaid.herolib.core.playbook { PlayBook } pub fn play(mut plbook PlayBook) ! { if !plbook.exists(filter: 'usermgmt.') { diff --git a/lib/osal/linux/user_mgmt.v b/lib/osal/linux/user_mgmt.v index 790e86a1..75fd6dd6 100644 --- a/lib/osal/linux/user_mgmt.v +++ b/lib/osal/linux/user_mgmt.v @@ -2,8 +2,8 @@ module linux import os import json -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console @[params] pub struct UserCreateArgs { diff --git a/lib/osal/notifier/readme.md b/lib/osal/notifier/readme.md index 79405cba..202f14cc 100644 --- a/lib/osal/notifier/readme.md +++ b/lib/osal/notifier/readme.md @@ -16,7 +16,7 @@ A file system notification system for V that provides real-time monitoring of fi ## Usage Example ```v -import freeflowuniverse.herolib.osal.notifier +import incubaid.herolib.osal.notifier // Define callback function for file events fn on_file_change(event notifier.NotifyEvent, path string) { diff --git a/lib/osal/osinstaller/diskmgmt.v b/lib/osal/osinstaller/diskmgmt.v index 1d6409a9..815829ca 100644 --- a/lib/osal/osinstaller/diskmgmt.v +++ b/lib/osal/osinstaller/diskmgmt.v @@ -1,7 +1,7 @@ module osinstaller import os -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console pub fn (s ServerManager) raid_stop() !bool { if !os.exists('/proc/mdstat') { diff --git a/lib/osal/osinstaller/factory.v b/lib/osal/osinstaller/factory.v index e4d319bb..f1d253bd 100644 --- a/lib/osal/osinstaller/factory.v +++ b/lib/osal/osinstaller/factory.v @@ -1,7 +1,7 @@ module osinstaller import os -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console // import json // import maxux.vssh diff --git a/lib/osal/rsync/rsync.v b/lib/osal/rsync/rsync.v index cb0c7fc5..448e246d 100644 --- a/lib/osal/rsync/rsync.v +++ b/lib/osal/rsync/rsync.v @@ -1,8 +1,8 @@ module rsync -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.osal.core as osal +import incubaid.herolib.core.pathlib +import incubaid.herolib.ui.console +import incubaid.herolib.osal.core as osal @[params] pub struct RsyncArgs { diff --git a/lib/osal/rsync/usermgmt.v b/lib/osal/rsync/usermgmt.v index 5d2b7dac..42acdf79 100644 --- a/lib/osal/rsync/usermgmt.v +++ b/lib/osal/rsync/usermgmt.v @@ -1,6 +1,6 @@ module rsync -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib pub struct UserManager { pub mut: diff --git a/lib/osal/screen/factory.v b/lib/osal/screen/factory.v index 77429760..5de9c8db 100644 --- a/lib/osal/screen/factory.v +++ b/lib/osal/screen/factory.v @@ -1,12 +1,12 @@ module screen -// import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.core.texttools -// import freeflowuniverse.herolib.screen +// import incubaid.herolib.osal.core as osal +import incubaid.herolib.core.texttools +// import incubaid.herolib.screen import os import time -// import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.osal.core as osal +// import incubaid.herolib.ui.console +import incubaid.herolib.osal.core as osal @[heap] pub struct ScreensFactory { diff --git a/lib/osal/screen/readme.md b/lib/osal/screen/readme.md index b7dd7cc7..5094ea0e 100644 --- a/lib/osal/screen/readme.md +++ b/lib/osal/screen/readme.md @@ -9,7 +9,7 @@ Create a file `screen_example.vsh`: ```v #!/usr/bin/env -S v run -import freeflowuniverse.herolib.osal.screen +import incubaid.herolib.osal.screen // Create a new screen factory mut sf := screen.new()! diff --git a/lib/osal/screen/screen.v b/lib/osal/screen/screen.v index f278fe0f..90aa6444 100644 --- a/lib/osal/screen/screen.v +++ b/lib/osal/screen/screen.v @@ -1,8 +1,8 @@ module screen -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.core +import incubaid.herolib.ui.console +import incubaid.herolib.osal.core as osal +import incubaid.herolib.core import os import time diff --git a/lib/osal/sshagent/agent.v b/lib/osal/sshagent/agent.v index d51f70a1..5b101e97 100644 --- a/lib/osal/sshagent/agent.v +++ b/lib/osal/sshagent/agent.v @@ -1,6 +1,6 @@ module sshagent -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console // Check if SSH agent is properly configured and all is good pub fn agent_check(mut agent SSHAgent) ! { diff --git a/lib/osal/sshagent/builder_integration.v b/lib/osal/sshagent/builder_integration.v index 2eff438a..be1fc58c 100644 --- a/lib/osal/sshagent/builder_integration.v +++ b/lib/osal/sshagent/builder_integration.v @@ -1,7 +1,7 @@ module sshagent -import freeflowuniverse.herolib.builder -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.builder +import incubaid.herolib.ui.console // push SSH public key to a remote node's authorized_keys pub fn (mut agent SSHAgent) push_key_to_node(mut node builder.Node, key_name string) ! { diff --git a/lib/osal/sshagent/factory.v b/lib/osal/sshagent/factory.v index 7b336d67..483804ed 100644 --- a/lib/osal/sshagent/factory.v +++ b/lib/osal/sshagent/factory.v @@ -1,7 +1,7 @@ module sshagent import os -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib @[params] pub struct SSHAgentNewArgs { diff --git a/lib/osal/sshagent/get.v b/lib/osal/sshagent/get.v index ecb0954f..196d4175 100644 --- a/lib/osal/sshagent/get.v +++ b/lib/osal/sshagent/get.v @@ -1,6 +1,6 @@ module sshagent -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.texttools @[params] pub struct KeyGetArgs { diff --git a/lib/osal/sshagent/play.v b/lib/osal/sshagent/play.v index ff9cbeee..9fd80f15 100644 --- a/lib/osal/sshagent/play.v +++ b/lib/osal/sshagent/play.v @@ -1,6 +1,6 @@ module sshagent -import freeflowuniverse.herolib.core.playbook { PlayBook } +import incubaid.herolib.core.playbook { PlayBook } pub fn play(mut plbook PlayBook) ! { if !plbook.exists(filter: 'sshagent.') { diff --git a/lib/osal/sshagent/readme.md b/lib/osal/sshagent/readme.md index 91d824ea..75ef8221 100644 --- a/lib/osal/sshagent/readme.md +++ b/lib/osal/sshagent/readme.md @@ -19,7 +19,7 @@ SSH agent management library for V language. Provides secure key handling, agent ## Quick Start ```v -import freeflowuniverse.herolib.osal.sshagent +import incubaid.herolib.osal.sshagent mut agent := sshagent.new()! mut key := agent.generate('my_key', '')! @@ -58,7 +58,7 @@ agent.reset()! ### Remote ```v -import freeflowuniverse.herolib.builder +import incubaid.herolib.builder mut node := builder.node_new(ipaddr: 'user@remote:22')! agent.push_key_to_node(mut node, 'my_key')! diff --git a/lib/osal/sshagent/security.v b/lib/osal/sshagent/security.v index 61b23e2e..b58f7468 100644 --- a/lib/osal/sshagent/security.v +++ b/lib/osal/sshagent/security.v @@ -1,7 +1,7 @@ module sshagent import os -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.texttools // Security validation functions for SSH agent operations diff --git a/lib/osal/sshagent/sshagent.v b/lib/osal/sshagent/sshagent.v index de271835..fa9c287b 100644 --- a/lib/osal/sshagent/sshagent.v +++ b/lib/osal/sshagent/sshagent.v @@ -1,8 +1,8 @@ module sshagent import os -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.pathlib +import incubaid.herolib.ui.console @[heap] pub struct SSHAgent { diff --git a/lib/osal/sshagent/sshagent_test.v b/lib/osal/sshagent/sshagent_test.v index 95f8c9cb..4934300c 100644 --- a/lib/osal/sshagent/sshagent_test.v +++ b/lib/osal/sshagent/sshagent_test.v @@ -1,7 +1,7 @@ module sshagent import os -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console // Test helper to create temporary directory for testing fn setup_test_env() !string { diff --git a/lib/osal/sshagent/sshkey.v b/lib/osal/sshagent/sshkey.v index 3b51b278..7e03a52f 100644 --- a/lib/osal/sshagent/sshkey.v +++ b/lib/osal/sshagent/sshkey.v @@ -1,8 +1,8 @@ module sshagent import os -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.pathlib +import incubaid.herolib.ui.console @[heap] pub struct SSHKey { diff --git a/lib/osal/startupmanager/readme.md b/lib/osal/startupmanager/readme.md index 3e94069e..14930b82 100644 --- a/lib/osal/startupmanager/readme.md +++ b/lib/osal/startupmanager/readme.md @@ -16,11 +16,11 @@ The `ZProcessNewArgs` struct defines the parameters for creating and managing a You can initialize the `StartupManager` in a few ways: -1. **Automatic Detection (Recommended):** +1. **Automatic Detection (Recommended):** The manager will automatically detect if `zinit` is available and use it, otherwise it defaults to `screen`. ```v - import freeflowuniverse.herolib.osal.startupmanager + import incubaid.herolib.osal.startupmanager fn main() { mut sm := startupmanager.get(cat:.screen)! @@ -29,11 +29,11 @@ You can initialize the `StartupManager` in a few ways: } ``` -2. **Explicitly Specify Type:** +2. **Explicitly Specify Type:** You can force the manager to use a specific type. ```v - import freeflowuniverse.herolib.osal.startupmanager + import incubaid.herolib.osal.startupmanager fn main() { mut sm_zinit := startupmanager.get(cat: .zinit)! @@ -56,7 +56,7 @@ The following examples demonstrate how to use the `StartupManager` to interact w This method creates and optionally starts a new process. ```v -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager fn main() { mut sm := startupmanager.get()! @@ -111,7 +111,7 @@ fn main() { Starts an existing process. ```v -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager fn main() { mut sm := startupmanager.get()! @@ -125,7 +125,7 @@ fn main() { Stops a running process. ```v -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager fn main() { mut sm := startupmanager.get()! @@ -139,7 +139,7 @@ fn main() { Restarts a process. ```v -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager fn main() { mut sm := startupmanager.get()! @@ -153,7 +153,7 @@ fn main() { Removes a process from the startup manager. ```v -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager fn main() { mut sm := startupmanager.get()! @@ -167,7 +167,7 @@ fn main() { Returns the current status of a process. ```v -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager fn main() { mut sm := startupmanager.get()! @@ -181,7 +181,7 @@ fn main() { Returns `true` if the process is active, `false` otherwise. ```v -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager fn main() { mut sm := startupmanager.get()! @@ -195,7 +195,7 @@ fn main() { Retrieves the output (logs) of a process. Currently supported for `systemd`. ```v -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager fn main() { mut sm := startupmanager.get(startupmanager.StartupManagerArgs{cat: .systemd})! @@ -209,7 +209,7 @@ fn main() { Returns `true` if the process is known to the startup manager, `false` otherwise. ```v -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager fn main() { mut sm := startupmanager.get()! @@ -223,10 +223,10 @@ fn main() { Returns a list of names of all services managed by the startup manager. ```v -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager fn main() { mut sm := startupmanager.get()! services := sm.list()! println("Managed services: ${services}") -} \ No newline at end of file +} diff --git a/lib/osal/startupmanager/startupmanager.v b/lib/osal/startupmanager/startupmanager.v index 73e6f3e2..9906b56a 100644 --- a/lib/osal/startupmanager/startupmanager.v +++ b/lib/osal/startupmanager/startupmanager.v @@ -1,10 +1,10 @@ module startupmanager -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.osal.screen -import freeflowuniverse.herolib.osal.systemd -// import freeflowuniverse.herolib.osal.zinit // Comment or remove this line -import freeflowuniverse.herolib.clients.zinit // Add this line +import incubaid.herolib.ui.console +import incubaid.herolib.osal.screen +import incubaid.herolib.osal.systemd +// import incubaid.herolib.osal.zinit // Comment or remove this line +import incubaid.herolib.clients.zinit // Add this line pub struct StartupManager { pub mut: diff --git a/lib/osal/startupmanager/startupmanager_test.v b/lib/osal/startupmanager/startupmanager_test.v index ce317ed8..fd9bdeef 100644 --- a/lib/osal/startupmanager/startupmanager_test.v +++ b/lib/osal/startupmanager/startupmanager_test.v @@ -1,8 +1,8 @@ module startupmanager -// import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.osal.screen -// import freeflowuniverse.herolib.osal.systemd +// import incubaid.herolib.ui.console +import incubaid.herolib.osal.screen +// import incubaid.herolib.osal.systemd import os import time diff --git a/lib/osal/systemd/journalctl.v b/lib/osal/systemd/journalctl.v index 0326b2ba..a453beac 100644 --- a/lib/osal/systemd/journalctl.v +++ b/lib/osal/systemd/journalctl.v @@ -1,6 +1,6 @@ module systemd -import freeflowuniverse.herolib.osal.core as osal +import incubaid.herolib.osal.core as osal // Add more flexible journalctl options @[params] diff --git a/lib/osal/systemd/readme.md b/lib/osal/systemd/readme.md index 5eb35ff5..1a160d4f 100644 --- a/lib/osal/systemd/readme.md +++ b/lib/osal/systemd/readme.md @@ -13,7 +13,7 @@ A V module for managing systemd services with comprehensive error handling and m ## Quick Start ```v -import freeflowuniverse.herolib.lib.osal.systemd +import incubaid.herolib.lib.osal.systemd // Create systemd factory mut systemd := systemd.new()! @@ -251,4 +251,4 @@ mut web_service := systemd.new( ```v // Test module -vtest ~/code/github/incubaid/herolib/lib/osal/systemd/systemd_process_test.v \ No newline at end of file +vtest ~/code/github/incubaid/herolib/lib/osal/systemd/systemd_process_test.v diff --git a/lib/osal/systemd/systemd.v b/lib/osal/systemd/systemd.v index c0efc6aa..b958be98 100644 --- a/lib/osal/systemd/systemd.v +++ b/lib/osal/systemd/systemd.v @@ -1,9 +1,9 @@ module systemd -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.osal.core as osal +import incubaid.herolib.core.pathlib +import incubaid.herolib.core.texttools +import incubaid.herolib.ui.console __global ( systemd_global []&Systemd diff --git a/lib/osal/systemd/systemd_process.v b/lib/osal/systemd/systemd_process.v index 90534807..ad58df30 100644 --- a/lib/osal/systemd/systemd_process.v +++ b/lib/osal/systemd/systemd_process.v @@ -2,9 +2,9 @@ module systemd // import os import maps -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.osal.core as osal +import incubaid.herolib.core.pathlib +import incubaid.herolib.ui.console import os import time diff --git a/lib/osal/systemd/systemd_process_test.v b/lib/osal/systemd/systemd_process_test.v index 18d1f339..540f94a9 100644 --- a/lib/osal/systemd/systemd_process_test.v +++ b/lib/osal/systemd/systemd_process_test.v @@ -2,9 +2,9 @@ module systemd // import os import maps -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.osal.core as osal +import incubaid.herolib.core.pathlib +import incubaid.herolib.ui.console import os pub fn testsuite_begin() ! { diff --git a/lib/osal/tmux/bin/tmux_logger.v b/lib/osal/tmux/bin/tmux_logger.v index 1bc0674a..aa54bed6 100644 --- a/lib/osal/tmux/bin/tmux_logger.v +++ b/lib/osal/tmux/bin/tmux_logger.v @@ -2,8 +2,8 @@ module main import os import io -import freeflowuniverse.herolib.core.logger -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.logger +import incubaid.herolib.core.texttools struct Args { mut: diff --git a/lib/osal/tmux/play.v b/lib/osal/tmux/play.v index 0fe4775c..57b1b403 100644 --- a/lib/osal/tmux/play.v +++ b/lib/osal/tmux/play.v @@ -1,9 +1,9 @@ module tmux -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.core.texttools +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console pub fn play(mut plbook PlayBook) ! { if !plbook.exists(filter: 'tmux.') { diff --git a/lib/osal/tmux/tmux.v b/lib/osal/tmux/tmux.v index 1201f2b7..6f175421 100644 --- a/lib/osal/tmux/tmux.v +++ b/lib/osal/tmux/tmux.v @@ -1,12 +1,12 @@ module tmux -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core.redisclient -// import freeflowuniverse.herolib.session +import incubaid.herolib.osal.core as osal +import incubaid.herolib.core.texttools +import incubaid.herolib.core.redisclient +// import incubaid.herolib.session import os import time -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console @[heap] pub struct Tmux { diff --git a/lib/osal/tmux/tmux_pane.v b/lib/osal/tmux/tmux_pane.v index 043eacf6..2a53be87 100644 --- a/lib/osal/tmux/tmux_pane.v +++ b/lib/osal/tmux/tmux_pane.v @@ -1,8 +1,8 @@ module tmux -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.osal.core as osal +import incubaid.herolib.data.ourtime +import incubaid.herolib.ui.console import time import os diff --git a/lib/osal/tmux/tmux_scan.v b/lib/osal/tmux/tmux_scan.v index c8e3819a..b4013bed 100644 --- a/lib/osal/tmux/tmux_scan.v +++ b/lib/osal/tmux/tmux_scan.v @@ -1,8 +1,8 @@ module tmux -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.osal.core as osal +import incubaid.herolib.core.texttools +import incubaid.herolib.ui.console import time // Check if error message indicates tmux server is not running diff --git a/lib/osal/tmux/tmux_session.v b/lib/osal/tmux/tmux_session.v index 00898873..54a7ba84 100644 --- a/lib/osal/tmux/tmux_session.v +++ b/lib/osal/tmux/tmux_session.v @@ -1,9 +1,9 @@ module tmux -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.osal.core as osal +import incubaid.herolib.core.texttools import os -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console @[heap] struct Session { diff --git a/lib/osal/tmux/tmux_session_test.v b/lib/osal/tmux/tmux_session_test.v index b11746e7..f89f7390 100644 --- a/lib/osal/tmux/tmux_session_test.v +++ b/lib/osal/tmux/tmux_session_test.v @@ -1,6 +1,6 @@ module tmux -import freeflowuniverse.herolib.osal.core as osal +import incubaid.herolib.osal.core as osal import rand fn testsuite_begin() { diff --git a/lib/osal/tmux/tmux_state.v b/lib/osal/tmux/tmux_state.v index 6aca3696..5cd9e809 100644 --- a/lib/osal/tmux/tmux_state.v +++ b/lib/osal/tmux/tmux_state.v @@ -1,10 +1,10 @@ module tmux -import freeflowuniverse.herolib.osal.core as osal +import incubaid.herolib.osal.core as osal import crypto.md5 import json import time -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console // Command state structure for Redis storage pub struct CommandState { diff --git a/lib/osal/tmux/tmux_test.v b/lib/osal/tmux/tmux_test.v index 48491a8b..1ece3247 100644 --- a/lib/osal/tmux/tmux_test.v +++ b/lib/osal/tmux/tmux_test.v @@ -1,9 +1,9 @@ module tmux -import freeflowuniverse.herolib.osal.core as osal -// import freeflowuniverse.herolib.installers.tmux +import incubaid.herolib.osal.core as osal +// import incubaid.herolib.installers.tmux import os -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console const testpath = os.dir(@FILE) + '/testdata' diff --git a/lib/osal/tmux/tmux_window.v b/lib/osal/tmux/tmux_window.v index 60d2d9ba..f9aac57c 100644 --- a/lib/osal/tmux/tmux_window.v +++ b/lib/osal/tmux/tmux_window.v @@ -1,9 +1,9 @@ module tmux import os -import freeflowuniverse.herolib.osal.core as osal +import incubaid.herolib.osal.core as osal import time -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console @[heap] struct Window { diff --git a/lib/osal/traefik/README.md b/lib/osal/traefik/README.md index f7d1e69f..1dac5364 100644 --- a/lib/osal/traefik/README.md +++ b/lib/osal/traefik/README.md @@ -5,6 +5,7 @@ This module provides functionality to manage Traefik configurations using Redis ## Overview The module allows you to: + - Define HTTP/HTTPS routes - Configure backend services - Set up middlewares @@ -14,7 +15,7 @@ The module allows you to: ## Usage Example ```v -import freeflowuniverse.herolib.osal.core.traefik +import incubaid.herolib.osal.core.traefik fn main() ! { // Create a new Traefik configuration @@ -73,6 +74,7 @@ The module uses the following Redis key structure as per Traefik's KV store spec ## Configuration Types ### Router Configuration + ```v RouteConfig { name: string // Router name @@ -85,6 +87,7 @@ RouteConfig { ``` ### Service Configuration + ```v ServiceConfig { name: string @@ -101,6 +104,7 @@ ServerConfig { ``` ### Middleware Configuration + ```v MiddlewareConfig { name: string @@ -110,6 +114,7 @@ MiddlewareConfig { ``` ### TLS Configuration + ```v TLSConfig { domain: string // Domain name diff --git a/lib/osal/traefik/populator.v b/lib/osal/traefik/populator.v index 9388d670..2a88699f 100644 --- a/lib/osal/traefik/populator.v +++ b/lib/osal/traefik/populator.v @@ -1,7 +1,7 @@ module traefik import json -import freeflowuniverse.herolib.core.redisclient +import incubaid.herolib.core.redisclient // new_traefik_config creates a new TraefikConfig pub fn new_traefik_config() TraefikConfig { diff --git a/lib/osal/tun/readme.md b/lib/osal/tun/readme.md index 008966f6..f524418f 100644 --- a/lib/osal/tun/readme.md +++ b/lib/osal/tun/readme.md @@ -5,12 +5,16 @@ This module provides functionality to manage TUN (network tunnel) interfaces on ## Functions ### available() !bool + Checks if TUN/TAP functionality is available on the system: + - Linux: Verifies `/dev/net/tun` exists and is a character device - macOS: Checks for `utun` interfaces using `ifconfig` and `sysctl` ### free() !string + Returns the name of an available TUN interface: + - Linux: Returns first available interface from tun0-tun10 - macOS: Returns next available utun interface number @@ -20,7 +24,7 @@ Returns the name of an available TUN interface: #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.osal.core.tun +import incubaid.herolib.osal.core.tun // Check if TUN is available @@ -57,6 +61,7 @@ The module automatically detects the platform (Linux/macOS) and uses the appropr ## Error Handling Both functions return a Result type, so errors should be handled appropriately: + - Unsupported platform errors - Interface availability errors -- System command execution errors \ No newline at end of file +- System command execution errors diff --git a/lib/osal/tun/tun.v b/lib/osal/tun/tun.v index c7b1fc7e..1a565271 100644 --- a/lib/osal/tun/tun.v +++ b/lib/osal/tun/tun.v @@ -1,7 +1,7 @@ module tun import os -import freeflowuniverse.herolib.core +import incubaid.herolib.core // available checks if TUN/TAP is available on the system pub fn available() !bool { diff --git a/lib/osal/ubuntu/mirrors.v b/lib/osal/ubuntu/mirrors.v index 080121da..e3c9e717 100644 --- a/lib/osal/ubuntu/mirrors.v +++ b/lib/osal/ubuntu/mirrors.v @@ -1,7 +1,7 @@ module ubuntu -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.osal.core as osal +import incubaid.herolib.core.texttools import net.http import os import time diff --git a/lib/osal/ufw/play.v b/lib/osal/ufw/play.v index c067d698..0d802f3a 100644 --- a/lib/osal/ufw/play.v +++ b/lib/osal/ufw/play.v @@ -1,7 +1,7 @@ module ufw -import freeflowuniverse.herolib.core.playbook -import freeflowuniverse.herolib.data.paramsparser +import incubaid.herolib.core.playbook +import incubaid.herolib.data.paramsparser pub fn play_ufw(mut plbook playbook.PlayBook) !RuleSet { mut ufw_status := UFWStatus{ diff --git a/lib/osal/ufw/ufw.v b/lib/osal/ufw/ufw.v index 15922c0e..37566975 100644 --- a/lib/osal/ufw/ufw.v +++ b/lib/osal/ufw/ufw.v @@ -1,7 +1,7 @@ module ufw -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console import os pub fn reset() ! { diff --git a/lib/readme.md b/lib/readme.md index c6c3adc8..f7ac46ba 100644 --- a/lib/readme.md +++ b/lib/readme.md @@ -3,12 +3,12 @@ Is an opinionated library as used by threefold mainly to automate cloud environments, its still very much work in progress and we welcome any contribution. -Please check also our [cookbook](https://github.com/freeflowuniverse/herolib/tree/development/cookbook) which might give some ideas how to use it. +Please check also our [cookbook](https://github.com/incubaid/herolib/tree/development/cookbook) which might give some ideas how to use it. ## Get started with hero ```bash -curl -sL https://raw.githubusercontent.com/freeflowuniverse/herolib/development/scripts/install_hero.sh | bash +curl -sL https://raw.githubusercontent.com/incubaid/herolib/development/scripts/install_hero.sh | bash ``` ## Get started with herolib @@ -16,7 +16,7 @@ curl -sL https://raw.githubusercontent.com/freeflowuniverse/herolib/development/ the following script will install vlang and herolib (report bugs please) ```bash -curl https://raw.githubusercontent.com/freeflowuniverse/herolib/development/scripts/installer.sh > /tmp/install.sh +curl https://raw.githubusercontent.com/incubaid/herolib/development/scripts/installer.sh > /tmp/install.sh bash /tmp/install.sh ``` @@ -34,7 +34,7 @@ requirements ```bash mkdir -p ~/code/github/incubaid cd ~/code/github/incubaid -git clone git@github.com:freeflowuniverse/herolib.git +git clone git@github.com:incubaid/herolib.git cd herolib # checkout a branch with most recent changes # git checkout development @@ -52,7 +52,7 @@ hero will be installed in - ~/hero/bin for osx ```bash -curl https://raw.githubusercontent.com/freeflowuniverse/herolib/development/scripts/install_hero.sh > /tmp/hero_install.sh +curl https://raw.githubusercontent.com/incubaid/herolib/development/scripts/install_hero.sh > /tmp/hero_install.sh bash /tmp/hero_install.sh #to debug bash -x /tmp/hero_install.sh diff --git a/lib/schemas/jsonrpc/README.md b/lib/schemas/jsonrpc/README.md index e3da0485..646fe7af 100644 --- a/lib/schemas/jsonrpc/README.md +++ b/lib/schemas/jsonrpc/README.md @@ -32,14 +32,14 @@ Create a new JSON-RPC client using a custom transport layer. The transport must ```v pub interface IRPCTransportClient { mut: - send(request string, params SendParams) !string + send(request string, params SendParams) !string } ``` #### Example: WebSocket Transport ```v -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.schemas.jsonrpc import net.websocket // Implement the IRPCTransportClient interface for WebSocket @@ -84,7 +84,7 @@ mut client := jsonrpc.new_client(jsonrpc.Client{ #### Example: Unix Domain Socket Transport ```v -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.schemas.jsonrpc import net.unix import time @@ -149,7 +149,7 @@ mut client := jsonrpc.new_client(jsonrpc.Client{ Send a strongly-typed JSON-RPC request and handle the response. ```v -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.schemas.jsonrpc // Define your parameter and result types struct UserParams { @@ -192,7 +192,7 @@ println('User name: ${user.name}, email: ${user.email}, role: ${user.role}') Use the predefined JSON-RPC errors or create custom ones. ```v -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.schemas.jsonrpc // Predefined error err := jsonrpc.method_not_found @@ -216,7 +216,7 @@ println(response) The JSON-RPC module provides strong typing for responses using generics, allowing you to define the exact structure of your expected results. ```v -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.schemas.jsonrpc // Define your result type struct ServerStats { @@ -256,7 +256,7 @@ if !response.is_error() { When implementing a JSON-RPC server, you can create strongly-typed responses: ```v -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.schemas.jsonrpc // Define a result type struct SearchResult { @@ -286,23 +286,31 @@ println(json) ## Modules and Key Components ### 1. **`model_request.v`** + Handles JSON-RPC requests: + - Structs: `Request`, `RequestGeneric[T]` - Methods: `new_request`, `new_request_generic[T]`, `decode_request`, `decode_request_generic[T]`, etc. ### 2. **`model_response.v`** + Handles JSON-RPC responses: + - Structs: `Response`, `ResponseGeneric[D]` - Methods: `new_response`, `new_response_generic[D]`, `decode_response`, `decode_response_generic[D]`, `validate`, etc. ### 3. **`model_error.v`** + Manages JSON-RPC errors: + - Struct: `RPCError` - Predefined errors: `parse_error`, `invalid_request`, etc. - Methods: `msg`, `is_empty`, etc. ### 4. **`client.v`** + Implements the JSON-RPC client: + - Structs: `Client`, `SendParams`, `ClientConfig` - Interface: `IRPCTransportClient` - Method: `send[T, D]` - Generic method for sending requests with parameters of type T and receiving responses with results of type D diff --git a/lib/schemas/jsonrpc/client.v b/lib/schemas/jsonrpc/client.v index 639cb412..e588bfb0 100644 --- a/lib/schemas/jsonrpc/client.v +++ b/lib/schemas/jsonrpc/client.v @@ -1,6 +1,6 @@ module jsonrpc -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console // IRPCTransportClient defines the interface for transport mechanisms used by the JSON-RPC client. // This allows for different transport implementations (HTTP, WebSocket, etc.) to be used diff --git a/lib/schemas/jsonrpc/reflection/handler.v b/lib/schemas/jsonrpc/reflection/handler.v index d944d44e..40fbe00d 100644 --- a/lib/schemas/jsonrpc/reflection/handler.v +++ b/lib/schemas/jsonrpc/reflection/handler.v @@ -1,6 +1,6 @@ module reflection -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.schemas.jsonrpc pub struct Handler[T] { pub mut: diff --git a/lib/schemas/jsonrpc/testdata/testserver/openrpc_server.v b/lib/schemas/jsonrpc/testdata/testserver/openrpc_server.v index c8c5963f..4bb29e54 100644 --- a/lib/schemas/jsonrpc/testdata/testserver/openrpc_server.v +++ b/lib/schemas/jsonrpc/testdata/testserver/openrpc_server.v @@ -2,8 +2,8 @@ module main import log import json -import freeflowuniverse.herolib.schemas.jsonrpc { JsonRpcHandler, jsonrpcrequest_decode } -import freeflowuniverse.herolib.data.rpcwebsocket +import incubaid.herolib.schemas.jsonrpc { JsonRpcHandler, jsonrpcrequest_decode } +import incubaid.herolib.data.rpcwebsocket import data.jsonrpc.testdata.testmodule { Config, testfunction0, testfunction1 } struct CustomJsonRpcHandler { diff --git a/lib/schemas/jsonrpc/transport_unixsocket.v b/lib/schemas/jsonrpc/transport_unixsocket.v index 55a6d994..ea0ec070 100644 --- a/lib/schemas/jsonrpc/transport_unixsocket.v +++ b/lib/schemas/jsonrpc/transport_unixsocket.v @@ -3,7 +3,7 @@ module jsonrpc import net.unix import time import net -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console // UnixSocketTransport implements the IRPCTransportClient interface for Unix domain sockets struct UnixSocketTransport { diff --git a/lib/schemas/jsonschema/README.md b/lib/schemas/jsonschema/README.md index 771112a3..f21262c1 100644 --- a/lib/schemas/jsonschema/README.md +++ b/lib/schemas/jsonschema/README.md @@ -47,7 +47,7 @@ It's good practice to define object type schemas separately and reference them i ## Json Schema Decode & Validation ```v -import freeflowuniverse.herolib.schemas.jsonschema +import incubaid.herolib.schemas.jsonschema mut myschema:=jsonschema.decode("the spec...")! ## Code Generation @@ -58,8 +58,8 @@ The module can generate JSON Schema from V code models, making it easy to create ```v // Example: Generate JSON Schema from a V struct -import freeflowuniverse.herolib.core.code -import freeflowuniverse.herolib.schemas.jsonschema.codegen +import incubaid.herolib.core.code +import incubaid.herolib.schemas.jsonschema.codegen // Create a struct model struct_ := code.Struct{ @@ -105,8 +105,8 @@ schema := codegen.struct_to_schema(struct_) The module can also generate V code from JSON Schema: ```v -import freeflowuniverse.herolib.schemas.jsonschema -import freeflowuniverse.herolib.schemas.jsonschema.codegen +import incubaid.herolib.schemas.jsonschema +import incubaid.herolib.schemas.jsonschema.codegen // Create or load a JSON Schema schema := jsonschema.Schema{ @@ -160,8 +160,6 @@ schema := jsonschema.Schema{ When generating schemas from V structs with anonymous struct fields, the module creates inline schema definitions in the property field, similar to how anonymous structs work in V. - - ## Notes -Due to [this issue](https://github.com/vlang/v/issues/15081), a JSON Schema cannot be directly decoded into the JSON Schema structure defined in this module. To decode a JSON Schema string into a structure, use the `pub fn decode(data str) !Schema` function defined in `decode.v`. \ No newline at end of file +Due to [this issue](https://github.com/vlang/v/issues/15081), a JSON Schema cannot be directly decoded into the JSON Schema structure defined in this module. To decode a JSON Schema string into a structure, use the `pub fn decode(data str) !Schema` function defined in `decode.v`. diff --git a/lib/schemas/jsonschema/codegen/codegen.v b/lib/schemas/jsonschema/codegen/codegen.v index 65535b5d..832e2753 100644 --- a/lib/schemas/jsonschema/codegen/codegen.v +++ b/lib/schemas/jsonschema/codegen/codegen.v @@ -1,8 +1,8 @@ module codegen import log -import freeflowuniverse.herolib.develop.codetools as code { Alias, Array, Attribute, CodeItem, Object, Struct, StructField, Type, type_from_symbol } -import freeflowuniverse.herolib.schemas.jsonschema { Reference, Schema, SchemaRef } +import incubaid.herolib.develop.codetools as code { Alias, Array, Attribute, CodeItem, Object, Struct, StructField, Type, type_from_symbol } +import incubaid.herolib.schemas.jsonschema { Reference, Schema, SchemaRef } const vtypes = { 'integer': 'int' diff --git a/lib/schemas/jsonschema/codegen/codegen_test.v b/lib/schemas/jsonschema/codegen/codegen_test.v index 40decfda..4aa6f38b 100644 --- a/lib/schemas/jsonschema/codegen/codegen_test.v +++ b/lib/schemas/jsonschema/codegen/codegen_test.v @@ -1,7 +1,7 @@ module codegen import log -import freeflowuniverse.herolib.schemas.jsonschema { Reference, Schema } +import incubaid.herolib.schemas.jsonschema { Reference, Schema } fn test_schema_to_structs_simple() ! { struct_str := ' diff --git a/lib/schemas/jsonschema/codegen/generate.v b/lib/schemas/jsonschema/codegen/generate.v index 4ec26c81..12c4491f 100644 --- a/lib/schemas/jsonschema/codegen/generate.v +++ b/lib/schemas/jsonschema/codegen/generate.v @@ -1,7 +1,7 @@ module codegen -import freeflowuniverse.herolib.develop.codetools as code { Param, Struct, Type } -import freeflowuniverse.herolib.schemas.jsonschema { Number, Reference, Schema, SchemaRef } +import incubaid.herolib.develop.codetools as code { Param, Struct, Type } +import incubaid.herolib.schemas.jsonschema { Number, Reference, Schema, SchemaRef } // struct_to_schema generates a json schema or reference from a struct model pub fn sumtype_to_schema(sumtype code.Sumtype) SchemaRef { diff --git a/lib/schemas/jsonschema/codegen/generate_test.v b/lib/schemas/jsonschema/codegen/generate_test.v index 8f0ac146..a49a910b 100644 --- a/lib/schemas/jsonschema/codegen/generate_test.v +++ b/lib/schemas/jsonschema/codegen/generate_test.v @@ -1,7 +1,7 @@ module codegen import log -import freeflowuniverse.herolib.develop.codetools as code +import incubaid.herolib.develop.codetools as code fn test_struct_to_schema() { struct_ := code.Struct{ diff --git a/lib/schemas/jsonschema/decode_test.v b/lib/schemas/jsonschema/decode_test.v index b4db8687..52437b17 100644 --- a/lib/schemas/jsonschema/decode_test.v +++ b/lib/schemas/jsonschema/decode_test.v @@ -1,7 +1,7 @@ module jsonschema import os -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib const testdata = '${os.dir(@FILE)}/testdata' diff --git a/lib/schemas/openapi/codegen/client_typescript.v b/lib/schemas/openapi/codegen/client_typescript.v index 7a302770..b0caaa68 100644 --- a/lib/schemas/openapi/codegen/client_typescript.v +++ b/lib/schemas/openapi/codegen/client_typescript.v @@ -1,12 +1,12 @@ module codegen -import freeflowuniverse.herolib.develop.codetools as code { File, Folder } -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.schemas.jsonschema { Reference, Schema } -import freeflowuniverse.herolib.schemas.jsonschema.codegen { schema_to_struct } -import freeflowuniverse.herolib.schemas.openrpc.codegen as openrpc_codegen -import freeflowuniverse.herolib.schemas.openapi { OpenAPI, Operation } -import freeflowuniverse.herolib.baobab.specification +import incubaid.herolib.develop.codetools as code { File, Folder } +import incubaid.herolib.core.texttools +import incubaid.herolib.schemas.jsonschema { Reference, Schema } +import incubaid.herolib.schemas.jsonschema.codegen { schema_to_struct } +import incubaid.herolib.schemas.openrpc.codegen as openrpc_codegen +import incubaid.herolib.schemas.openapi { OpenAPI, Operation } +import incubaid.herolib.baobab.specification import net.http // the body_generator is a function that takes an OpenAPI operation, its path, and its method diff --git a/lib/schemas/openapi/codegen/client_typescript_test.v b/lib/schemas/openapi/codegen/client_typescript_test.v index d766abf0..62d255bd 100644 --- a/lib/schemas/openapi/codegen/client_typescript_test.v +++ b/lib/schemas/openapi/codegen/client_typescript_test.v @@ -1,12 +1,12 @@ module codegen -import freeflowuniverse.herolib.develop.codetools as code -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.schemas.jsonschema { Reference, Schema, SchemaRef } -import freeflowuniverse.herolib.schemas.jsonschema.codegen -import freeflowuniverse.herolib.schemas.openrpc.codegen as openrpc_codegen -import freeflowuniverse.herolib.schemas.openapi { Operation, ResponseSpec } -import freeflowuniverse.herolib.baobab.specification +import incubaid.herolib.develop.codetools as code +import incubaid.herolib.core.texttools +import incubaid.herolib.schemas.jsonschema { Reference, Schema, SchemaRef } +import incubaid.herolib.schemas.jsonschema.codegen +import incubaid.herolib.schemas.openrpc.codegen as openrpc_codegen +import incubaid.herolib.schemas.openapi { Operation, ResponseSpec } +import incubaid.herolib.baobab.specification import net.http const test_operation = Operation{ diff --git a/lib/schemas/openapi/codegen/to_code.v b/lib/schemas/openapi/codegen/to_code.v index b51e7222..b1114a8d 100644 --- a/lib/schemas/openapi/codegen/to_code.v +++ b/lib/schemas/openapi/codegen/to_code.v @@ -1,8 +1,8 @@ module codegen -import freeflowuniverse.herolib.develop.codetools as code -import freeflowuniverse.herolib.schemas.jsonschema.codegen as jsonschema_codegen { schemaref_to_type } -import freeflowuniverse.herolib.schemas.openapi { ResponseSpec } +import incubaid.herolib.develop.codetools as code +import incubaid.herolib.schemas.jsonschema.codegen as jsonschema_codegen { schemaref_to_type } +import incubaid.herolib.schemas.openapi { ResponseSpec } // converts OpenAPI Parameter Specification // to code param specification diff --git a/lib/schemas/openapi/controller_http.v b/lib/schemas/openapi/controller_http.v index d4501818..22a16382 100644 --- a/lib/schemas/openapi/controller_http.v +++ b/lib/schemas/openapi/controller_http.v @@ -1,7 +1,7 @@ module openapi import veb -import freeflowuniverse.herolib.schemas.jsonschema { Schema } +import incubaid.herolib.schemas.jsonschema { Schema } import x.json2 { Any } import net.http import os diff --git a/lib/schemas/openapi/controller_playground.v b/lib/schemas/openapi/controller_playground.v index d8c41e9f..bbbc3892 100644 --- a/lib/schemas/openapi/controller_playground.v +++ b/lib/schemas/openapi/controller_playground.v @@ -1,7 +1,7 @@ module openapi import veb -import freeflowuniverse.herolib.schemas.jsonschema +import incubaid.herolib.schemas.jsonschema import x.json2 import net.http import os diff --git a/lib/schemas/openapi/decode.v b/lib/schemas/openapi/decode.v index 31608484..1b3cd0ca 100644 --- a/lib/schemas/openapi/decode.v +++ b/lib/schemas/openapi/decode.v @@ -2,7 +2,7 @@ module openapi import json import x.json2 { Any } -import freeflowuniverse.herolib.schemas.jsonschema +import incubaid.herolib.schemas.jsonschema pub fn json_decode(data string) !OpenAPI { // Decode the raw JSON into a map to allow field-specific processing diff --git a/lib/schemas/openapi/decode_test.v b/lib/schemas/openapi/decode_test.v index d06e21b7..ea367c9b 100644 --- a/lib/schemas/openapi/decode_test.v +++ b/lib/schemas/openapi/decode_test.v @@ -2,7 +2,7 @@ module openapi import os import x.json2 { Any } -import freeflowuniverse.herolib.schemas.jsonschema { Reference, Schema, SchemaRef } +import incubaid.herolib.schemas.jsonschema { Reference, Schema, SchemaRef } const spec_path = '${os.dir(@FILE)}/testdata/openapi.json' const spec_json = os.read_file(spec_path) or { panic(err) } diff --git a/lib/schemas/openapi/factory.v b/lib/schemas/openapi/factory.v index cefe6592..5ed8d6c9 100644 --- a/lib/schemas/openapi/factory.v +++ b/lib/schemas/openapi/factory.v @@ -1,7 +1,7 @@ module openapi -import freeflowuniverse.herolib.schemas.jsonschema { Reference, Schema, SchemaRef } -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.schemas.jsonschema { Reference, Schema, SchemaRef } +import incubaid.herolib.core.texttools import os import maps diff --git a/lib/schemas/openapi/handler.v b/lib/schemas/openapi/handler.v index e73498dc..cae25a25 100644 --- a/lib/schemas/openapi/handler.v +++ b/lib/schemas/openapi/handler.v @@ -2,7 +2,7 @@ module openapi import net.http import x.json2 { Any } -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.schemas.jsonrpc pub struct Request { pub: diff --git a/lib/schemas/openapi/model.v b/lib/schemas/openapi/model.v index 0b61a14f..a7f674df 100644 --- a/lib/schemas/openapi/model.v +++ b/lib/schemas/openapi/model.v @@ -3,7 +3,7 @@ module openapi import maps import net.http import x.json2 as json { Any } -import freeflowuniverse.herolib.schemas.jsonschema { Reference, Schema, SchemaRef } +import incubaid.herolib.schemas.jsonschema { Reference, Schema, SchemaRef } // todo: report bug: when comps is optional, doesnt work pub struct OpenAPI { diff --git a/lib/schemas/openrpc/_archive/codegen/docgen.v b/lib/schemas/openrpc/_archive/codegen/docgen.v index 49c7f008..4b3b29bb 100644 --- a/lib/schemas/openrpc/_archive/codegen/docgen.v +++ b/lib/schemas/openrpc/_archive/codegen/docgen.v @@ -1,8 +1,8 @@ module codegen -// import freeflowuniverse.herolib.core.code -// import freeflowuniverse.herolib.ui.console -// import freeflowuniverse.herolib.core.texttools +// import incubaid.herolib.core.code +// import incubaid.herolib.ui.console +// import incubaid.herolib.core.texttools // // configuration parameters for OpenRPC Document generation. // @[params] diff --git a/lib/schemas/openrpc/_archive/codegen/generate.v b/lib/schemas/openrpc/_archive/codegen/generate.v index c474ec2c..aacfe21e 100644 --- a/lib/schemas/openrpc/_archive/codegen/generate.v +++ b/lib/schemas/openrpc/_archive/codegen/generate.v @@ -1,7 +1,7 @@ module codegen -import freeflowuniverse.herolib.develop.codetools as code { Function, Module, Struct } -import freeflowuniverse.herolib.schemas.openrpc { OpenRPC } +import incubaid.herolib.develop.codetools as code { Function, Module, Struct } +import incubaid.herolib.schemas.openrpc { OpenRPC } // pub struct OpenRPCCode { // pub mut: diff --git a/lib/schemas/openrpc/_archive/codegen/generate_client.v b/lib/schemas/openrpc/_archive/codegen/generate_client.v index 3bc4cec6..5a1667bb 100644 --- a/lib/schemas/openrpc/_archive/codegen/generate_client.v +++ b/lib/schemas/openrpc/_archive/codegen/generate_client.v @@ -1,9 +1,9 @@ module codegen -import freeflowuniverse.herolib.develop.codetools as code { CodeItem, CustomCode, Function, Struct, VFile, parse_function } -// import freeflowuniverse.herolib.schemas.jsonrpc.codegen {generate_client_struct} -import freeflowuniverse.herolib.schemas.openrpc { OpenRPC } -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.develop.codetools as code { CodeItem, CustomCode, Function, Struct, VFile, parse_function } +// import incubaid.herolib.schemas.jsonrpc.codegen {generate_client_struct} +import incubaid.herolib.schemas.openrpc { OpenRPC } +import incubaid.herolib.core.texttools // generate_structs geenrates struct codes for schemas defined in an openrpc document pub fn generate_client_file(o OpenRPC, object_map map[string]Struct) !VFile { @@ -15,8 +15,8 @@ pub fn generate_client_file(o OpenRPC, object_map map[string]Struct) !VFile { // code << client_struct // code << jsonrpc.generate_ws_factory_code(client_struct_name)! // methods := jsonrpc.generate_client_methods(client_struct, o.methods.map(it.to_code()!))! - // imports := [code.parse_import('freeflowuniverse.herolib.schemas.jsonrpc'), - // code.parse_import('freeflowuniverse.herolib.schemas.rpcwebsocket'), + // imports := [code.parse_import('incubaid.herolib.schemas.jsonrpc'), + // code.parse_import('incubaid.herolib.schemas.rpcwebsocket'), // code.parse_import('log')] // code << methods.map(CodeItem(it)) mut file := VFile{ @@ -57,8 +57,8 @@ pub fn generate_client_test_file(o OpenRPC, methods_map map[string]Function, obj name: 'client_test' mod: name imports: [ - code.parse_import('freeflowuniverse.herolib.schemas.jsonrpc'), - code.parse_import('freeflowuniverse.herolib.schemas.rpcwebsocket'), + code.parse_import('incubaid.herolib.schemas.jsonrpc'), + code.parse_import('incubaid.herolib.schemas.rpcwebsocket'), code.parse_import('log'), ] items: items diff --git a/lib/schemas/openrpc/_archive/codegen/generate_handler.v b/lib/schemas/openrpc/_archive/codegen/generate_handler.v index 16bfcaf8..b461afac 100644 --- a/lib/schemas/openrpc/_archive/codegen/generate_handler.v +++ b/lib/schemas/openrpc/_archive/codegen/generate_handler.v @@ -1,18 +1,18 @@ module codegen -import freeflowuniverse.herolib.develop.codetools as code { CodeItem, CustomCode, Function, Param, Struct, VFile, parse_import } -import freeflowuniverse.herolib.schemas.openrpc { OpenRPC } -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.develop.codetools as code { CodeItem, CustomCode, Function, Param, Struct, VFile, parse_import } +import incubaid.herolib.schemas.openrpc { OpenRPC } +import incubaid.herolib.core.texttools import rand pub fn generate_handler_file(o OpenRPC, receiver Struct, method_map map[string]Function, object_map map[string]Struct) !VFile { name := texttools.name_fix(o.info.title) imports := [ - parse_import('freeflowuniverse.herolib.schemas.jsonrpc'), + parse_import('incubaid.herolib.schemas.jsonrpc'), parse_import('json'), parse_import('x.json2'), - parse_import('import freeflowuniverse.herolib.core.texttools'), + parse_import('import incubaid.herolib.core.texttools'), ] mut file := VFile{ @@ -80,7 +80,7 @@ pub fn generate_handler_test_file(o OpenRPC, receiver Struct, method_map map[str items << handle_tests.map(CodeItem(it)) - imports := parse_import('freeflowuniverse.herolib.schemas.jsonrpc {new_jsonrpcrequest, jsonrpcresponse_decode, jsonrpcerror_decode}') + imports := parse_import('incubaid.herolib.schemas.jsonrpc {new_jsonrpcrequest, jsonrpcresponse_decode, jsonrpcerror_decode}') mut file := VFile{ name: 'handler_test' diff --git a/lib/schemas/openrpc/_archive/codegen/generate_interface.v b/lib/schemas/openrpc/_archive/codegen/generate_interface.v index 093765d0..e87e7c73 100644 --- a/lib/schemas/openrpc/_archive/codegen/generate_interface.v +++ b/lib/schemas/openrpc/_archive/codegen/generate_interface.v @@ -1,8 +1,8 @@ module codegen -import freeflowuniverse.herolib.develop.codetools as code { CustomCode, VFile, parse_function, parse_import } -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.schemas.openrpc { OpenRPC } +import incubaid.herolib.develop.codetools as code { CustomCode, VFile, parse_function, parse_import } +import incubaid.herolib.core.texttools +import incubaid.herolib.schemas.openrpc { OpenRPC } // pub fn (mut handler AccountantHandler) handle_ws(client &websocket.Client, message string) string { // return handler.handle(message) or { panic(err) } @@ -36,7 +36,7 @@ pub fn generate_interface_file(specification OpenRPC) !VFile { imports: [ parse_import('log'), parse_import('net.websocket'), - parse_import('freeflowuniverse.herolib.schemas.rpcwebsocket {RpcWsServer}'), + parse_import('incubaid.herolib.schemas.rpcwebsocket {RpcWsServer}'), ] items: [ handle_ws_fn, diff --git a/lib/schemas/openrpc/_archive/codegen/generate_model.v b/lib/schemas/openrpc/_archive/codegen/generate_model.v index 26bb3e5d..a5fdacaf 100644 --- a/lib/schemas/openrpc/_archive/codegen/generate_model.v +++ b/lib/schemas/openrpc/_archive/codegen/generate_model.v @@ -1,10 +1,10 @@ module codegen -import freeflowuniverse.herolib.develop.codetools as code { CodeItem } -import freeflowuniverse.herolib.schemas.jsonschema { Schema } -import freeflowuniverse.herolib.schemas.jsonschema.codegen as jsonschema_codegen { schema_to_code } -import freeflowuniverse.herolib.schemas.openrpc { OpenRPC } -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.develop.codetools as code { CodeItem } +import incubaid.herolib.schemas.jsonschema { Schema } +import incubaid.herolib.schemas.jsonschema.codegen as jsonschema_codegen { schema_to_code } +import incubaid.herolib.schemas.openrpc { OpenRPC } +import incubaid.herolib.core.texttools // generate_structs geenrates struct codes for schemas defined in an openrpc document pub fn generate_model(o OpenRPC) ![]CodeItem { diff --git a/lib/schemas/openrpc/_archive/codegen/generate_model_test.v b/lib/schemas/openrpc/_archive/codegen/generate_model_test.v index 631344c7..c0ff4ad7 100644 --- a/lib/schemas/openrpc/_archive/codegen/generate_model_test.v +++ b/lib/schemas/openrpc/_archive/codegen/generate_model_test.v @@ -2,9 +2,9 @@ module codegen import os import json -import freeflowuniverse.herolib.develop.codetools as code { Alias, Struct } -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.schemas.openrpc +import incubaid.herolib.develop.codetools as code { Alias, Struct } +import incubaid.herolib.core.pathlib +import incubaid.herolib.schemas.openrpc const doc_path = '${os.dir(@FILE)}/testdata/openrpc.json' diff --git a/lib/schemas/openrpc/_archive/codegen/generate_openrpc.v b/lib/schemas/openrpc/_archive/codegen/generate_openrpc.v index 36856c77..6cf89912 100644 --- a/lib/schemas/openrpc/_archive/codegen/generate_openrpc.v +++ b/lib/schemas/openrpc/_archive/codegen/generate_openrpc.v @@ -1,9 +1,9 @@ module codegen -// import freeflowuniverse.herolib.schemas.jsonschema -// import freeflowuniverse.herolib.core.code { Function, Struct, Sumtype } -// import freeflowuniverse.herolib.ui.console -// import freeflowuniverse.herolib.core.texttools +// import incubaid.herolib.schemas.jsonschema +// import incubaid.herolib.core.code { Function, Struct, Sumtype } +// import incubaid.herolib.ui.console +// import incubaid.herolib.core.texttools // // configuration parameters for OpenRPC Document generation. // @[params] diff --git a/lib/schemas/openrpc/_archive/codegen/templates/client.v.template b/lib/schemas/openrpc/_archive/codegen/templates/client.v.template index e20bce15..3dedcb33 100644 --- a/lib/schemas/openrpc/_archive/codegen/templates/client.v.template +++ b/lib/schemas/openrpc/_archive/codegen/templates/client.v.template @@ -1,7 +1,7 @@ module @{module} -import freeflowuniverse.herolib.data.rpcwebsocket -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.data.rpcwebsocket +import incubaid.herolib.schemas.jsonrpc import log import json diff --git a/lib/schemas/openrpc/_archive/codegen/to_code.v b/lib/schemas/openrpc/_archive/codegen/to_code.v index efdb6409..733611d4 100644 --- a/lib/schemas/openrpc/_archive/codegen/to_code.v +++ b/lib/schemas/openrpc/_archive/codegen/to_code.v @@ -1,10 +1,10 @@ module codegen -import freeflowuniverse.herolib.develop.codetools as code { Function, Struct } -import freeflowuniverse.herolib.schemas.jsonschema.codegen as jsonschema_codegen { schema_to_struct, schemaref_to_type } -import freeflowuniverse.herolib.schemas.jsonschema { Schema } -import freeflowuniverse.herolib.schemas.openrpc { ContentDescriptor, Method } -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.develop.codetools as code { Function, Struct } +import incubaid.herolib.schemas.jsonschema.codegen as jsonschema_codegen { schema_to_struct, schemaref_to_type } +import incubaid.herolib.schemas.jsonschema { Schema } +import incubaid.herolib.schemas.openrpc { ContentDescriptor, Method } +import incubaid.herolib.core.texttools // converts OpenRPC Method to Code Function pub fn method_to_function(method Method) !Function { diff --git a/lib/schemas/openrpc/_archive/parse_example.v b/lib/schemas/openrpc/_archive/parse_example.v index 4a146187..872daf4e 100644 --- a/lib/schemas/openrpc/_archive/parse_example.v +++ b/lib/schemas/openrpc/_archive/parse_example.v @@ -1,7 +1,7 @@ module openrpc -import freeflowuniverse.herolib.schemas.jsonschema { Reference } -import freeflowuniverse.herolib.develop.codetools as code { Struct, StructField } +import incubaid.herolib.schemas.jsonschema { Reference } +import incubaid.herolib.develop.codetools as code { Struct, StructField } import x.json2 pub fn parse_example_pairing(text_ string) !ExamplePairing { diff --git a/lib/schemas/openrpc/_archive/parse_example_test.v b/lib/schemas/openrpc/_archive/parse_example_test.v index 7182e1a6..892598f2 100644 --- a/lib/schemas/openrpc/_archive/parse_example_test.v +++ b/lib/schemas/openrpc/_archive/parse_example_test.v @@ -1,6 +1,6 @@ module openrpc -import freeflowuniverse.herolib.develop.codetools as code { Attribute, Struct, StructField } +import incubaid.herolib.develop.codetools as code { Attribute, Struct, StructField } const example_txt = " Example: Get pet example. diff --git a/lib/schemas/openrpc/_archive/playground.v b/lib/schemas/openrpc/_archive/playground.v index 0f3bb407..e8dfdaa8 100644 --- a/lib/schemas/openrpc/_archive/playground.v +++ b/lib/schemas/openrpc/_archive/playground.v @@ -1,9 +1,9 @@ module openrpc import x.json2 as json -// import freeflowuniverse.herolib.develop.gittools -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.core.texttools +// import incubaid.herolib.develop.gittools +import incubaid.herolib.core.pathlib +import incubaid.herolib.core.texttools import veb import os @@ -32,7 +32,7 @@ pub fn export_playground(config PlaygroundConfig) ! { // css_dest := '${os.dir(@FILE)}/static/css/index.css' // tw.compile(css_source, css_dest)! // mut gs := gittools.new() or { panic(err) } - // mut repo := gs.get_repo(url: 'https://github.com/freeflowuniverse/playground')! + // mut repo := gs.get_repo(url: 'https://github.com/incubaid/playground')! // playground_dir := repo.get_path()! diff --git a/lib/schemas/openrpc/_archive/server/comment.v b/lib/schemas/openrpc/_archive/server/comment.v index ebd59742..08564ec0 100644 --- a/lib/schemas/openrpc/_archive/server/comment.v +++ b/lib/schemas/openrpc/_archive/server/comment.v @@ -1,7 +1,7 @@ module openrpcserver -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.data.ourtime +import incubaid.herolib.data.encoder +import incubaid.herolib.data.ourtime @[heap] pub struct Comment { diff --git a/lib/schemas/openrpc/_archive/server/core_methods.v b/lib/schemas/openrpc/_archive/server/core_methods.v index 6709c347..9e52a48a 100644 --- a/lib/schemas/openrpc/_archive/server/core_methods.v +++ b/lib/schemas/openrpc/_archive/server/core_methods.v @@ -1,6 +1,6 @@ module openrpcserver -import freeflowuniverse.herolib.core.redisclient +import incubaid.herolib.core.redisclient pub fn set[T](mut obj T) !u32 { name := T{}.type_name() diff --git a/lib/schemas/openrpc/_archive/server/core_models.v b/lib/schemas/openrpc/_archive/server/core_models.v index 8ce68fda..38aadec9 100644 --- a/lib/schemas/openrpc/_archive/server/core_models.v +++ b/lib/schemas/openrpc/_archive/server/core_models.v @@ -1,8 +1,8 @@ module openrpcserver import crypto.md5 -import freeflowuniverse.herolib.core.redisclient -import freeflowuniverse.herolib.data.ourtime +import incubaid.herolib.core.redisclient +import incubaid.herolib.data.ourtime // Group represents a collection of users with roles and permissions @[heap] diff --git a/lib/schemas/openrpc/_archive/testdata/methods.v b/lib/schemas/openrpc/_archive/testdata/methods.v index ed253bcd..32ccf4f7 100644 --- a/lib/schemas/openrpc/_archive/testdata/methods.v +++ b/lib/schemas/openrpc/_archive/testdata/methods.v @@ -1,6 +1,6 @@ module main -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console pub fn plain_method() { } diff --git a/lib/schemas/openrpc/_archive/testdata/petstore_client/client.v b/lib/schemas/openrpc/_archive/testdata/petstore_client/client.v index bbfa5110..369244f7 100644 --- a/lib/schemas/openrpc/_archive/testdata/petstore_client/client.v +++ b/lib/schemas/openrpc/_archive/testdata/petstore_client/client.v @@ -1,6 +1,6 @@ module petstore_client -import freeflowuniverse.herolib.schemas.jsonrpc { JsonRpcRequest } +import incubaid.herolib.schemas.jsonrpc { JsonRpcRequest } import net.websocket struct Client { diff --git a/lib/schemas/openrpc/_archive/testdata/petstore_client/methods.v b/lib/schemas/openrpc/_archive/testdata/petstore_client/methods.v index e6bcf36e..f0fc591c 100644 --- a/lib/schemas/openrpc/_archive/testdata/petstore_client/methods.v +++ b/lib/schemas/openrpc/_archive/testdata/petstore_client/methods.v @@ -1,6 +1,6 @@ module petstore_client -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.schemas.jsonrpc // get_pets finds pets in the system that the user has access to by tags and within a limit // - tags: tags to filter by diff --git a/lib/schemas/openrpc/client_unix.v b/lib/schemas/openrpc/client_unix.v index 1c6109cc..c03f4321 100644 --- a/lib/schemas/openrpc/client_unix.v +++ b/lib/schemas/openrpc/client_unix.v @@ -3,8 +3,8 @@ module openrpc import x.json2 as json import net.unix import time -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.ui.console +import incubaid.herolib.schemas.jsonrpc pub struct UNIXClient { pub mut: diff --git a/lib/schemas/openrpc/client_unix_test.v b/lib/schemas/openrpc/client_unix_test.v index 4873ce8d..cfcaedcb 100644 --- a/lib/schemas/openrpc/client_unix_test.v +++ b/lib/schemas/openrpc/client_unix_test.v @@ -1,7 +1,7 @@ module openrpc -import freeflowuniverse.herolib.schemas.jsonrpc -import freeflowuniverse.herolib.schemas.jsonschema +import incubaid.herolib.schemas.jsonrpc +import incubaid.herolib.schemas.jsonschema // Test struct for typed parameters struct TestParams { diff --git a/lib/schemas/openrpc/custom.v b/lib/schemas/openrpc/custom.v index ee4ab04e..675e6a55 100644 --- a/lib/schemas/openrpc/custom.v +++ b/lib/schemas/openrpc/custom.v @@ -1,6 +1,6 @@ module openrpc -import freeflowuniverse.herolib.schemas.jsonschema +import incubaid.herolib.schemas.jsonschema // In Method struct pub fn (method Method) example() (string, string) { diff --git a/lib/schemas/openrpc/decode.v b/lib/schemas/openrpc/decode.v index 76e9d587..72c9b405 100644 --- a/lib/schemas/openrpc/decode.v +++ b/lib/schemas/openrpc/decode.v @@ -2,7 +2,7 @@ module openrpc import json import x.json2 { Any } -import freeflowuniverse.herolib.schemas.jsonschema { Reference, decode_schemaref } +import incubaid.herolib.schemas.jsonschema { Reference, decode_schemaref } pub fn decode_json_any(data string) !Any { // mut o:=decode(data)! diff --git a/lib/schemas/openrpc/decode_test.v b/lib/schemas/openrpc/decode_test.v index 6c48ad65..ef4331ce 100644 --- a/lib/schemas/openrpc/decode_test.v +++ b/lib/schemas/openrpc/decode_test.v @@ -3,8 +3,8 @@ module openrpc import x.json2 import json import os -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.schemas.jsonschema +import incubaid.herolib.core.pathlib +import incubaid.herolib.schemas.jsonschema const doc_path = '${os.dir(@FILE)}/testdata/openrpc.json' diff --git a/lib/schemas/openrpc/encode_test.v b/lib/schemas/openrpc/encode_test.v index b6d07832..c2999e0b 100644 --- a/lib/schemas/openrpc/encode_test.v +++ b/lib/schemas/openrpc/encode_test.v @@ -1,7 +1,7 @@ module openrpc // import x.json2 as json -import freeflowuniverse.herolib.schemas.jsonschema { Schema, SchemaRef } +import incubaid.herolib.schemas.jsonschema { Schema, SchemaRef } const blank_openrpc = '{"openrpc": "1.0.0","info": {"version": "1.0.0"},"methods": []}' diff --git a/lib/schemas/openrpc/handler.v b/lib/schemas/openrpc/handler.v index 9e3bbf7c..37b0ad56 100644 --- a/lib/schemas/openrpc/handler.v +++ b/lib/schemas/openrpc/handler.v @@ -1,6 +1,6 @@ module openrpc -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.schemas.jsonrpc // The openrpc handler is a wrapper around a jsonrpc handler pub struct Handler { diff --git a/lib/schemas/openrpc/inflate.v b/lib/schemas/openrpc/inflate.v index afe5c0e1..777d7878 100644 --- a/lib/schemas/openrpc/inflate.v +++ b/lib/schemas/openrpc/inflate.v @@ -1,6 +1,6 @@ module openrpc -import freeflowuniverse.herolib.schemas.jsonschema { Items, Reference, Schema, SchemaRef } +import incubaid.herolib.schemas.jsonschema { Items, Reference, Schema, SchemaRef } pub fn (s OpenRPC) inflate_method(method Method) Method { return Method{ diff --git a/lib/schemas/openrpc/model.v b/lib/schemas/openrpc/model.v index afaf609e..d17e0941 100644 --- a/lib/schemas/openrpc/model.v +++ b/lib/schemas/openrpc/model.v @@ -1,6 +1,6 @@ module openrpc -import freeflowuniverse.herolib.schemas.jsonschema { Reference, SchemaRef } +import incubaid.herolib.schemas.jsonschema { Reference, SchemaRef } // Generic type for any value in examples type Any = string | int | f64 | bool | map[string]Any | []Any diff --git a/lib/schemas/openrpc/readme.md b/lib/schemas/openrpc/readme.md index 84a5f0e7..5b5e2f07 100644 --- a/lib/schemas/openrpc/readme.md +++ b/lib/schemas/openrpc/readme.md @@ -18,7 +18,7 @@ This module provides a complete implementation of the [OpenRPC specification](ht Create a handler with your OpenRPC specification: ```v -import freeflowuniverse.herolib.schemas.openrpc +import incubaid.herolib.schemas.openrpc // From file path mut handler := openrpc.new_handler('path/to/openrpc.json')! @@ -62,4 +62,3 @@ controller.run(port: 8080) mut server := openrpc.new_unix_server(handler)! server.start() ``` - diff --git a/lib/schemas/openrpc/server_http.v b/lib/schemas/openrpc/server_http.v index 6bb16873..8d84199f 100644 --- a/lib/schemas/openrpc/server_http.v +++ b/lib/schemas/openrpc/server_http.v @@ -1,7 +1,7 @@ module openrpc import veb -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.schemas.jsonrpc // Main controller for handling RPC requests pub struct HTTPController { diff --git a/lib/schemas/openrpc/server_http_test.v b/lib/schemas/openrpc/server_http_test.v index 42fad972..a941eefe 100644 --- a/lib/schemas/openrpc/server_http_test.v +++ b/lib/schemas/openrpc/server_http_test.v @@ -4,7 +4,7 @@ import os import veb import x.json2 import net.http -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.schemas.jsonrpc const specification_path = os.join_path(os.dir(@FILE), '/testdata/openrpc.json') diff --git a/lib/schemas/openrpc/server_unix.v b/lib/schemas/openrpc/server_unix.v index bac201ff..02349f3a 100644 --- a/lib/schemas/openrpc/server_unix.v +++ b/lib/schemas/openrpc/server_unix.v @@ -2,8 +2,8 @@ module openrpc import net.unix import os -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.ui.console +import incubaid.herolib.schemas.jsonrpc pub struct UNIXServer { pub mut: diff --git a/lib/schemas/openrpc/server_unix_test.v b/lib/schemas/openrpc/server_unix_test.v index 75d2fffc..fcf55dc5 100644 --- a/lib/schemas/openrpc/server_unix_test.v +++ b/lib/schemas/openrpc/server_unix_test.v @@ -5,8 +5,8 @@ import json import x.json2 import net.unix import os -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.ui.console +import incubaid.herolib.schemas.jsonrpc const testdata_dir = os.join_path(os.dir(@FILE), 'testdata') const openrpc_path = os.join_path(testdata_dir, 'openrpc.json') diff --git a/lib/threefold/grid3/deploy_tosort/deployment.v b/lib/threefold/grid3/deploy_tosort/deployment.v index f732b937..1f02184c 100644 --- a/lib/threefold/grid3/deploy_tosort/deployment.v +++ b/lib/threefold/grid3/deploy_tosort/deployment.v @@ -1,10 +1,10 @@ module deploy -import freeflowuniverse.herolib.threefold.grid3.models as grid_models -import freeflowuniverse.herolib.data.paramsparser -import freeflowuniverse.herolib.threefold.grid -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.threefold.grid3.models as grid_models +import incubaid.herolib.data.paramsparser +import incubaid.herolib.threefold.grid +import incubaid.herolib.data.encoder +import incubaid.herolib.ui.console import rand import json import encoding.base64 diff --git a/lib/threefold/grid3/deployer/contracts.v b/lib/threefold/grid3/deployer/contracts.v index 8e1732f2..6f7e6c46 100644 --- a/lib/threefold/grid3/deployer/contracts.v +++ b/lib/threefold/grid3/deployer/contracts.v @@ -1,7 +1,7 @@ module deployer -import freeflowuniverse.herolib.threefold.grid3.gridproxy -import freeflowuniverse.herolib.threefold.grid3.gridproxy.model as proxy_models +import incubaid.herolib.threefold.grid3.gridproxy +import incubaid.herolib.threefold.grid3.gridproxy.model as proxy_models @[params] pub struct ContractGetArgs { diff --git a/lib/threefold/grid3/deployer/deployer.v b/lib/threefold/grid3/deployer/deployer.v index 83188435..5fd52aeb 100644 --- a/lib/threefold/grid3/deployer/deployer.v +++ b/lib/threefold/grid3/deployer/deployer.v @@ -4,9 +4,9 @@ import os import json import time import log -import freeflowuniverse.herolib.threefold.grid3.models -import freeflowuniverse.herolib.threefold.grid3.griddriver -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.threefold.grid3.models +import incubaid.herolib.threefold.grid3.griddriver +import incubaid.herolib.ui.console @[heap] pub struct Deployer { diff --git a/lib/threefold/grid3/deployer/deployer_factory_.v b/lib/threefold/grid3/deployer/deployer_factory_.v index 89a1752f..3367087b 100644 --- a/lib/threefold/grid3/deployer/deployer_factory_.v +++ b/lib/threefold/grid3/deployer/deployer_factory_.v @@ -1,8 +1,8 @@ module deployer -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.base +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console __global ( deployer_global map[string]&TFGridDeployer diff --git a/lib/threefold/grid3/deployer/deployer_model.v b/lib/threefold/grid3/deployer/deployer_model.v index 2423c040..f4dffb87 100644 --- a/lib/threefold/grid3/deployer/deployer_model.v +++ b/lib/threefold/grid3/deployer/deployer_model.v @@ -1,7 +1,7 @@ module deployer -// import freeflowuniverse.herolib.data.paramsparser -import freeflowuniverse.herolib.data.encoderhero +// import incubaid.herolib.data.paramsparser +import incubaid.herolib.data.encoderhero import os pub const version = '1.0.0' diff --git a/lib/threefold/grid3/deployer/deployment.v b/lib/threefold/grid3/deployer/deployment.v index 46ef3bf3..2cd2f702 100644 --- a/lib/threefold/grid3/deployer/deployment.v +++ b/lib/threefold/grid3/deployer/deployment.v @@ -1,7 +1,7 @@ module deployer -import freeflowuniverse.herolib.threefold.grid3.models as grid_models -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.threefold.grid3.models as grid_models +import incubaid.herolib.ui.console import compress.zlib import encoding.hex import x.crypto.chacha20 diff --git a/lib/threefold/grid3/deployer/deployment_setup.v b/lib/threefold/grid3/deployer/deployment_setup.v index 4e7d386a..5f657ef1 100644 --- a/lib/threefold/grid3/deployer/deployment_setup.v +++ b/lib/threefold/grid3/deployer/deployment_setup.v @@ -1,8 +1,8 @@ // This file should only contains any functions, helpers that related to the deployment setup. module deployer -import freeflowuniverse.herolib.threefold.grid3.models as grid_models -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.threefold.grid3.models as grid_models +import incubaid.herolib.ui.console import rand // a struct that prepare the setup for the deployment diff --git a/lib/threefold/grid3/deployer/filter.v b/lib/threefold/grid3/deployer/filter.v index 17a84127..52d5e832 100644 --- a/lib/threefold/grid3/deployer/filter.v +++ b/lib/threefold/grid3/deployer/filter.v @@ -1,7 +1,7 @@ module deployer -import freeflowuniverse.herolib.threefold.grid3.gridproxy -import freeflowuniverse.herolib.threefold.grid3.gridproxy.model as gridproxy_models +import incubaid.herolib.threefold.grid3.gridproxy +import incubaid.herolib.threefold.grid3.gridproxy.model as gridproxy_models // TODO: put all code in relation to filtering in file filter.v @[params] diff --git a/lib/threefold/grid3/deployer/kvstore.v b/lib/threefold/grid3/deployer/kvstore.v index a38c9612..81afb6b9 100644 --- a/lib/threefold/grid3/deployer/kvstore.v +++ b/lib/threefold/grid3/deployer/kvstore.v @@ -1,6 +1,6 @@ module deployer -import freeflowuniverse.herolib.core.base as context +import incubaid.herolib.core.base as context // Will be changed when we support the logic of the TFChain one pub struct KVStoreFS {} diff --git a/lib/threefold/grid3/deployer/network.v b/lib/threefold/grid3/deployer/network.v index 8f6f66be..31a6bcce 100644 --- a/lib/threefold/grid3/deployer/network.v +++ b/lib/threefold/grid3/deployer/network.v @@ -1,7 +1,7 @@ module deployer -import freeflowuniverse.herolib.threefold.grid3.models as grid_models -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.threefold.grid3.models as grid_models +import incubaid.herolib.ui.console import json import rand diff --git a/lib/threefold/grid3/deployer/readme.md b/lib/threefold/grid3/deployer/readme.md index 21363df6..e008c6b2 100644 --- a/lib/threefold/grid3/deployer/readme.md +++ b/lib/threefold/grid3/deployer/readme.md @@ -6,7 +6,7 @@ To get started -import freeflowuniverse.herolib.clients. deployer +import incubaid.herolib.clients. deployer mut client:= deployer.get()! diff --git a/lib/threefold/grid3/deployer/rmb.v b/lib/threefold/grid3/deployer/rmb.v index 48cb4281..2260ba39 100644 --- a/lib/threefold/grid3/deployer/rmb.v +++ b/lib/threefold/grid3/deployer/rmb.v @@ -1,7 +1,7 @@ module deployer import json -import freeflowuniverse.herolib.threefold.grid3.models +import incubaid.herolib.threefold.grid3.models // TODO: decode/encode the params/result here pub fn (mut d Deployer) rmb_deployment_changes(dst u32, contract_id u64) !string { diff --git a/lib/threefold/grid3/deployer/utils.v b/lib/threefold/grid3/deployer/utils.v index 2261cb84..050ad01d 100644 --- a/lib/threefold/grid3/deployer/utils.v +++ b/lib/threefold/grid3/deployer/utils.v @@ -1,10 +1,10 @@ module deployer -import freeflowuniverse.herolib.threefold.grid3.gridproxy -import freeflowuniverse.herolib.threefold.grid3.models as grid_models -import freeflowuniverse.herolib.threefold.grid3.gridproxy.model as gridproxy_models +import incubaid.herolib.threefold.grid3.gridproxy +import incubaid.herolib.threefold.grid3.models as grid_models +import incubaid.herolib.threefold.grid3.gridproxy.model as gridproxy_models import rand -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console // Resolves the correct grid network based on the `cn.network` value. // diff --git a/lib/threefold/grid3/deployer/vmachine.v b/lib/threefold/grid3/deployer/vmachine.v index 79b3d462..643b7114 100644 --- a/lib/threefold/grid3/deployer/vmachine.v +++ b/lib/threefold/grid3/deployer/vmachine.v @@ -1,6 +1,6 @@ module deployer -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console import json import os import rand diff --git a/lib/threefold/grid3/deployer/zdbs.v b/lib/threefold/grid3/deployer/zdbs.v index c77de4ec..268ee39f 100644 --- a/lib/threefold/grid3/deployer/zdbs.v +++ b/lib/threefold/grid3/deployer/zdbs.v @@ -1,7 +1,7 @@ module deployer -import freeflowuniverse.herolib.threefold.grid3.models as grid_models -// import freeflowuniverse.herolib.ui.console +import incubaid.herolib.threefold.grid3.models as grid_models +// import incubaid.herolib.ui.console import json @[params] diff --git a/lib/threefold/grid3/deployer2_sort/deployment_state.v b/lib/threefold/grid3/deployer2_sort/deployment_state.v index 2965dbd0..34bb77e6 100644 --- a/lib/threefold/grid3/deployer2_sort/deployment_state.v +++ b/lib/threefold/grid3/deployer2_sort/deployment_state.v @@ -1,6 +1,6 @@ module deployer2 -import freeflowuniverse.herolib.core.redisclient +import incubaid.herolib.core.redisclient struct DeploymentStateDB { redis redisclient.Redis diff --git a/lib/threefold/grid3/deployer2_sort/factory.v b/lib/threefold/grid3/deployer2_sort/factory.v index 04c4008b..622b9421 100644 --- a/lib/threefold/grid3/deployer2_sort/factory.v +++ b/lib/threefold/grid3/deployer2_sort/factory.v @@ -1,9 +1,9 @@ module deployer2 -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.playbook -import freeflowuniverse.herolib.ui -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.base +import incubaid.herolib.core.playbook +import incubaid.herolib.ui +import incubaid.herolib.ui.console // pub struct TFGridClient[T] { // base.BaseConfig[T] diff --git a/lib/threefold/grid3/deployer2_sort/graphql.v b/lib/threefold/grid3/deployer2_sort/graphql.v index 7d8c9713..7366a167 100644 --- a/lib/threefold/grid3/deployer2_sort/graphql.v +++ b/lib/threefold/grid3/deployer2_sort/graphql.v @@ -4,7 +4,7 @@ import net.http import json import x.json2 import log -import freeflowuniverse.herolib.threefold.grid3.models +import incubaid.herolib.threefold.grid3.models pub struct GraphQl { url string diff --git a/lib/threefold/grid3/deployer2_sort/vm.v b/lib/threefold/grid3/deployer2_sort/vm.v index 1dc4ff79..ab55ab8f 100644 --- a/lib/threefold/grid3/deployer2_sort/vm.v +++ b/lib/threefold/grid3/deployer2_sort/vm.v @@ -2,8 +2,8 @@ module deployer2 import json import log -import freeflowuniverse.herolib.builder -import freeflowuniverse.herolib.threefold.grid3.models +import incubaid.herolib.builder +import incubaid.herolib.threefold.grid3.models struct VMSpecs { deployment_name string diff --git a/lib/threefold/grid3/deployer2_sort/vm_test.v b/lib/threefold/grid3/deployer2_sort/vm_test.v index 1d165046..5e7f4564 100644 --- a/lib/threefold/grid3/deployer2_sort/vm_test.v +++ b/lib/threefold/grid3/deployer2_sort/vm_test.v @@ -1,6 +1,6 @@ module deployer2 -import freeflowuniverse.herolib.installers.threefold.griddriver +import incubaid.herolib.installers.threefold.griddriver import os fn testsuite_begin() ! { diff --git a/lib/threefold/grid3/deployer2_sort/zdb.v b/lib/threefold/grid3/deployer2_sort/zdb.v index cc0797cd..1573a289 100644 --- a/lib/threefold/grid3/deployer2_sort/zdb.v +++ b/lib/threefold/grid3/deployer2_sort/zdb.v @@ -1,6 +1,6 @@ module deployer2 -import freeflowuniverse.herolib.core.redisclient +import incubaid.herolib.core.redisclient struct ZDBSpecs { deployment_name string diff --git a/lib/threefold/grid3/griddriver/substrate.v b/lib/threefold/grid3/griddriver/substrate.v index 0efd3e7f..dfd29922 100644 --- a/lib/threefold/grid3/griddriver/substrate.v +++ b/lib/threefold/grid3/griddriver/substrate.v @@ -3,7 +3,7 @@ module griddriver import os import strconv import json -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console pub fn (mut c Client) get_node_twin(node_id u64) !u32 { if u32(node_id) in c.node_twin { diff --git a/lib/threefold/grid3/griddriver/utils.v b/lib/threefold/grid3/griddriver/utils.v index b7a163b3..292c5d33 100644 --- a/lib/threefold/grid3/griddriver/utils.v +++ b/lib/threefold/grid3/griddriver/utils.v @@ -1,7 +1,7 @@ module griddriver import os -import freeflowuniverse.herolib.threefold.grid3.models +import incubaid.herolib.threefold.grid3.models pub fn (mut c Client) sign_deployment(hash string) !string { res := os.execute("griddriver sign --substrate \"${c.substrate}\" --mnemonics \"${c.mnemonic}\" --hash \"${hash}\"") diff --git a/lib/threefold/grid3/gridproxy/README.md b/lib/threefold/grid3/gridproxy/README.md index 47a1dd71..531bc112 100644 --- a/lib/threefold/grid3/gridproxy/README.md +++ b/lib/threefold/grid3/gridproxy/README.md @@ -2,10 +2,10 @@ Easily access Threefold grid APIs from vlang. gridproxy is v module include the API client along with API-specific information such as the root URL for the different networks available in the threefold grid. They also include classes that represent entities in the context of the API in sub-module `model`, and that are useful for making conversions between JSON objects and V objects. and some types with helper methods to convert the machine-friendly units returned by the API to more human-friendly units. -### import the client: +### import the client ```v -import freeflowuniverse.herolib.threefold.grid3.gridproxy +import incubaid.herolib.threefold.grid3.gridproxy // create a client for the testnet, with API cache disabled // you can pass true as second arg to enable cache @@ -13,7 +13,7 @@ mut gp_client := gridproxy.get(.test, false)! ``` -### use the client to interact with the gridproxy API: +### use the client to interact with the gridproxy API ```v // get farm list @@ -36,7 +36,7 @@ twins := gp_client.get_twins()! for all available methods on the client, see [GridProxy API client modules doc](./docs/) -### filtering: +### filtering ```v // getting only dedicated farms @@ -58,7 +58,7 @@ if farms_first_page.len > 0 { for all available filters, see [GridProxy API client modules doc](./docs/) -### helper methods: +### helper methods ```v node := nodes[0] diff --git a/lib/threefold/grid3/gridproxy/gridproxy_core.v b/lib/threefold/grid3/gridproxy/gridproxy_core.v index 426b537c..292a4fdf 100644 --- a/lib/threefold/grid3/gridproxy/gridproxy_core.v +++ b/lib/threefold/grid3/gridproxy/gridproxy_core.v @@ -3,8 +3,8 @@ module gridproxy // client library for threefold gridproxy API. import json import math -import freeflowuniverse.herolib.threefold.grid3.gridproxy.model { Bill, Contract, ContractFilter, ContractIterator, Farm, FarmFilter, FarmIterator, GridStat, Node, NodeFilter, NodeIterator, NodeStats, Node_, StatFilter, Twin, TwinFilter, TwinIterator } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.threefold.grid3.gridproxy.model { Bill, Contract, ContractFilter, ContractIterator, Farm, FarmFilter, FarmIterator, GridStat, Node, NodeFilter, NodeIterator, NodeStats, Node_, StatFilter, Twin, TwinFilter, TwinIterator } +import incubaid.herolib.ui.console /* all errors returned by the gridproxy API or the client are wrapped in a standard `Error` object with two fields. diff --git a/lib/threefold/grid3/gridproxy/gridproxy_factory.v b/lib/threefold/grid3/gridproxy/gridproxy_factory.v index 1f63def7..85b27939 100644 --- a/lib/threefold/grid3/gridproxy/gridproxy_factory.v +++ b/lib/threefold/grid3/gridproxy/gridproxy_factory.v @@ -1,8 +1,8 @@ module gridproxy -import freeflowuniverse.herolib.core.httpconnection -import freeflowuniverse.herolib.threefold.grid3.gridproxy.model -// import freeflowuniverse.herolib.installers.threefold.griddriver +import incubaid.herolib.core.httpconnection +import incubaid.herolib.threefold.grid3.gridproxy.model +// import incubaid.herolib.installers.threefold.griddriver @[heap] pub struct GridProxyClient { diff --git a/lib/threefold/grid3/gridproxy/gridproxy_highlevel.v b/lib/threefold/grid3/gridproxy/gridproxy_highlevel.v index 00a1e51c..e411b164 100644 --- a/lib/threefold/grid3/gridproxy/gridproxy_highlevel.v +++ b/lib/threefold/grid3/gridproxy/gridproxy_highlevel.v @@ -1,6 +1,6 @@ module gridproxy -import freeflowuniverse.herolib.threefold.grid3.gridproxy.model { Contract, ContractFilter, Farm, FarmFilter, Node, NodeFilter, ResourceFilter, Twin } +import incubaid.herolib.threefold.grid3.gridproxy.model { Contract, ContractFilter, Farm, FarmFilter, Node, NodeFilter, ResourceFilter, Twin } // fetch specific twin information by twin id. // diff --git a/lib/threefold/grid3/gridproxy/gridproxy_test.v b/lib/threefold/grid3/gridproxy/gridproxy_test.v index 2f0997c1..7e638aca 100644 --- a/lib/threefold/grid3/gridproxy/gridproxy_test.v +++ b/lib/threefold/grid3/gridproxy/gridproxy_test.v @@ -1,6 +1,6 @@ module gridproxy -import freeflowuniverse.herolib.threefold.grid3.gridproxy.model +import incubaid.herolib.threefold.grid3.gridproxy.model import time const cache = false diff --git a/lib/threefold/grid3/rmb/rmb_client.v b/lib/threefold/grid3/rmb/rmb_client.v index 2922f9c1..cde21c1e 100644 --- a/lib/threefold/grid3/rmb/rmb_client.v +++ b/lib/threefold/grid3/rmb/rmb_client.v @@ -1,7 +1,7 @@ module rmb -// import freeflowuniverse.herolib.core.httpconnection -import freeflowuniverse.herolib.core.redisclient { RedisURL } +// import incubaid.herolib.core.httpconnection +import incubaid.herolib.core.redisclient { RedisURL } import os pub struct RMBClient { diff --git a/lib/threefold/grid3/rmb/rmb_test.v b/lib/threefold/grid3/rmb/rmb_test.v index 780064c1..ef54b3fa 100644 --- a/lib/threefold/grid3/rmb/rmb_test.v +++ b/lib/threefold/grid3/rmb/rmb_test.v @@ -1,6 +1,6 @@ module rmb -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console fn test_main() ? { mut cl := new(nettype: .dev)! diff --git a/lib/threefold/grid3/tfrobot/cancel.v b/lib/threefold/grid3/tfrobot/cancel.v index f03f2d0d..38e97ed4 100644 --- a/lib/threefold/grid3/tfrobot/cancel.v +++ b/lib/threefold/grid3/tfrobot/cancel.v @@ -1,8 +1,8 @@ module tfrobot import json -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.osal.core as osal +import incubaid.herolib.core.pathlib +import incubaid.herolib.osal.core as osal pub struct CancelConfig { mut: diff --git a/lib/threefold/grid3/tfrobot/deploy.v b/lib/threefold/grid3/tfrobot/deploy.v index 12587ee9..e31fa18a 100644 --- a/lib/threefold/grid3/tfrobot/deploy.v +++ b/lib/threefold/grid3/tfrobot/deploy.v @@ -1,12 +1,12 @@ module tfrobot -import freeflowuniverse.herolib.core.redisclient +import incubaid.herolib.core.redisclient import json import os -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.osal.sshagent +import incubaid.herolib.ui.console +import incubaid.herolib.core.pathlib +import incubaid.herolib.osal.core as osal +import incubaid.herolib.osal.sshagent const tfrobot_dir = '${os.home_dir()}/hero/tfrobot' // path to tfrobot dir in fs diff --git a/lib/threefold/grid3/tfrobot/factory.v b/lib/threefold/grid3/tfrobot/factory.v index dbb74598..f03db325 100644 --- a/lib/threefold/grid3/tfrobot/factory.v +++ b/lib/threefold/grid3/tfrobot/factory.v @@ -1,9 +1,9 @@ module tfrobot -import freeflowuniverse.herolib.installers.threefold.tfrobot as tfrobot_installer -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.ui -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.installers.threefold.tfrobot as tfrobot_installer +import incubaid.herolib.core.base +import incubaid.herolib.ui +import incubaid.herolib.ui.console pub struct TFRobot[T] { base.BaseConfig[T] diff --git a/lib/threefold/grid3/tfrobot/job.v b/lib/threefold/grid3/tfrobot/job.v index 9b7bcd5c..105f5b8a 100644 --- a/lib/threefold/grid3/tfrobot/job.v +++ b/lib/threefold/grid3/tfrobot/job.v @@ -2,10 +2,10 @@ module tfrobot // import os // import arrays -// import freeflowuniverse.herolib.core.pathlib -// import freeflowuniverse.herolib.osal.core as osal +// import incubaid.herolib.core.pathlib +// import incubaid.herolib.osal.core as osal // import json -// import freeflowuniverse.herolib.ui.console +// import incubaid.herolib.ui.console // VirtualMachine represents the VM info outputted by tfrobot pub struct VirtualMachine { diff --git a/lib/threefold/grid3/tfrobot/tfrobot_redis.v b/lib/threefold/grid3/tfrobot/tfrobot_redis.v index 5dbb674c..b1c35b58 100644 --- a/lib/threefold/grid3/tfrobot/tfrobot_redis.v +++ b/lib/threefold/grid3/tfrobot/tfrobot_redis.v @@ -1,8 +1,8 @@ module tfrobot import json -// import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.redisclient +// import incubaid.herolib.ui.console +import incubaid.herolib.core.redisclient pub fn config_get(configname string) !DeployConfig { mut redis := redisclient.core_get()! diff --git a/lib/threefold/grid3/tfrobot/vm.v b/lib/threefold/grid3/tfrobot/vm.v index 439c6b08..3f7ab305 100644 --- a/lib/threefold/grid3/tfrobot/vm.v +++ b/lib/threefold/grid3/tfrobot/vm.v @@ -1,11 +1,11 @@ module tfrobot // import os -import freeflowuniverse.herolib.builder -import freeflowuniverse.herolib.osal.core as osal -// import freeflowuniverse.herolib.servers.daguserver as dagu -// import freeflowuniverse.herolib.clients.daguclient as dagu_client -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.builder +import incubaid.herolib.osal.core as osal +// import incubaid.herolib.servers.daguserver as dagu +// import incubaid.herolib.clients.daguclient as dagu_client +import incubaid.herolib.ui.console import time // pub fn (vm VMOutput) ssh_interactive(key_path string) ! { diff --git a/lib/threefold/grid3/tfrobot/vm_deploy_test.v b/lib/threefold/grid3/tfrobot/vm_deploy_test.v index ab72e22f..b79bbeaa 100644 --- a/lib/threefold/grid3/tfrobot/vm_deploy_test.v +++ b/lib/threefold/grid3/tfrobot/vm_deploy_test.v @@ -1,7 +1,7 @@ module tfrobot import os -import freeflowuniverse.herolib.osal.core as osal +import incubaid.herolib.osal.core as osal const testdata_dir = '${os.dir(@FILE)}/testdata' diff --git a/lib/threefold/grid3/tokens/tokens_fetch.v b/lib/threefold/grid3/tokens/tokens_fetch.v index 10d6a5d1..4f9dc5f2 100644 --- a/lib/threefold/grid3/tokens/tokens_fetch.v +++ b/lib/threefold/grid3/tokens/tokens_fetch.v @@ -1,8 +1,8 @@ module tokens import json -import freeflowuniverse.herolib.httpcache -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.httpcache +import incubaid.herolib.ui.console // // Raw JSON struct diff --git a/lib/threefold/grid3/zerohub/zerohub.v b/lib/threefold/grid3/zerohub/zerohub.v index 2829643f..b6649ff1 100644 --- a/lib/threefold/grid3/zerohub/zerohub.v +++ b/lib/threefold/grid3/zerohub/zerohub.v @@ -2,7 +2,7 @@ module zerohub import net.http -// import freeflowuniverse.herolib.core.httpconnection +// import incubaid.herolib.core.httpconnection // TODO: curl -H "Authorization: bearer 6Pz6giOpHSaA3KdYI6LLpGSLmDmzmRkVdwvc7S-E5PVB0-iRfgDKW9Rb_ZTlj-xEW4_uSCa5VsyoRsML7DunA1sia3Jpc3RvZi4zYm90IiwgMTY3OTIxNTc3MF0=" https://hub.grid.tf/api/flist/ diff --git a/lib/threefold/grid3/zerohub/zerohub_test.v b/lib/threefold/grid3/zerohub/zerohub_test.v index ac4a4233..4fd883b3 100644 --- a/lib/threefold/grid3/zerohub/zerohub_test.v +++ b/lib/threefold/grid3/zerohub/zerohub_test.v @@ -2,7 +2,7 @@ module zerohub import net.http import os -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console const secret = '6Pz6giOpHSaA3KdYI6LLpGSLmDmzmRkVdwvc7S-E5PVB0-iRfgDKW9Rb_ZTlj-xEW4_uSCa5VsyoRsML7DunA1sia3Jpc3RvZi4zYm90IiwgMTY3OTIxNTc3MF0=' diff --git a/lib/threefold/grid4/datamodel/play.v b/lib/threefold/grid4/datamodel/play.v index 48fd8209..19ab3705 100644 --- a/lib/threefold/grid4/datamodel/play.v +++ b/lib/threefold/grid4/datamodel/play.v @@ -1,6 +1,6 @@ module datamodel -import freeflowuniverse.herolib.core.playbook { PlayBook } +import incubaid.herolib.core.playbook { PlayBook } // this play script should never be called from hero directly its called by gridsimulator pub fn play(mut plbook PlayBook) !map[string]&Node { diff --git a/lib/threefold/grid4/datamodelsimulator/loader.v b/lib/threefold/grid4/datamodelsimulator/loader.v index 7723a318..b225e49d 100644 --- a/lib/threefold/grid4/datamodelsimulator/loader.v +++ b/lib/threefold/grid4/datamodelsimulator/loader.v @@ -1,8 +1,8 @@ module datamodelsimulator import json -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.threefold.grid4.datamodel { Node } +import incubaid.herolib.core.pathlib +import incubaid.herolib.threefold.grid4.datamodel { Node } // load the cloudboxes from a path pub fn load(path string) ![]Node { diff --git a/lib/threefold/grid4/datamodelsimulator/model_aggregated.v b/lib/threefold/grid4/datamodelsimulator/model_aggregated.v index e8134ca7..116157be 100644 --- a/lib/threefold/grid4/datamodelsimulator/model_aggregated.v +++ b/lib/threefold/grid4/datamodelsimulator/model_aggregated.v @@ -1,6 +1,6 @@ module datamodelsimulator -import freeflowuniverse.herolib.threefold.grid4.datamodel { NodeCapacity } +import incubaid.herolib.threefold.grid4.datamodel { NodeCapacity } import time // NodeTotalSim represents the aggregated data for a node simulation, including hardware specs, pricing, and location. diff --git a/lib/threefold/grid4/datamodelsimulator/model_simulations.v b/lib/threefold/grid4/datamodelsimulator/model_simulations.v index d3e77bc1..560b2e97 100644 --- a/lib/threefold/grid4/datamodelsimulator/model_simulations.v +++ b/lib/threefold/grid4/datamodelsimulator/model_simulations.v @@ -1,6 +1,6 @@ module datamodel -import freeflowuniverse.herolib.threefold.grid4.datamodel { Node } +import incubaid.herolib.threefold.grid4.datamodel { Node } pub struct NodeSim { Node diff --git a/lib/threefold/grid4/datamodelsimulator/play.v b/lib/threefold/grid4/datamodelsimulator/play.v index fbb861cb..27cba3c6 100644 --- a/lib/threefold/grid4/datamodelsimulator/play.v +++ b/lib/threefold/grid4/datamodelsimulator/play.v @@ -1,7 +1,7 @@ module datamodelsimulator -import freeflowuniverse.herolib.threefold.grid4.datamodel { Node } -import freeflowuniverse.herolib.core.playbook { PlayBook } +import incubaid.herolib.threefold.grid4.datamodel { Node } +import incubaid.herolib.core.playbook { PlayBook } // this play script should never be called from hero directly its called by gridsimulator pub fn play(mut plbook PlayBook) !map[string]&Node { diff --git a/lib/threefold/grid4/farmingsimulator/factory.v b/lib/threefold/grid4/farmingsimulator/factory.v index 5b91b4f1..50089efe 100644 --- a/lib/threefold/grid4/farmingsimulator/factory.v +++ b/lib/threefold/grid4/farmingsimulator/factory.v @@ -1,10 +1,10 @@ module farmingsimulator -import freeflowuniverse.herolib.core.playbook -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.develop.gittools -import freeflowuniverse.herolib.biz.spreadsheet -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook +import incubaid.herolib.core.texttools +import incubaid.herolib.develop.gittools +import incubaid.herolib.biz.spreadsheet +import incubaid.herolib.ui.console __global ( farmingsimulators shared map[string]&Simulator diff --git a/lib/threefold/grid4/farmingsimulator/model_nodesbatch.v b/lib/threefold/grid4/farmingsimulator/model_nodesbatch.v index b22c70f1..f8c0d516 100644 --- a/lib/threefold/grid4/farmingsimulator/model_nodesbatch.v +++ b/lib/threefold/grid4/farmingsimulator/model_nodesbatch.v @@ -1,6 +1,6 @@ module farmingsimulator -// import freeflowuniverse.herolib.calc +// import incubaid.herolib.calc // X nr of nodes who are added in 1 month struct NodesBatch { diff --git a/lib/threefold/grid4/farmingsimulator/model_params.v b/lib/threefold/grid4/farmingsimulator/model_params.v index 88f9c175..f8771152 100644 --- a/lib/threefold/grid4/farmingsimulator/model_params.v +++ b/lib/threefold/grid4/farmingsimulator/model_params.v @@ -1,6 +1,6 @@ module farmingsimulator -import freeflowuniverse.herolib.core.playbook +import incubaid.herolib.core.playbook pub struct ParamsCultivation { pub mut: diff --git a/lib/threefold/grid4/farmingsimulator/model_regionalinternet.v b/lib/threefold/grid4/farmingsimulator/model_regionalinternet.v index e58fc222..58d785b1 100644 --- a/lib/threefold/grid4/farmingsimulator/model_regionalinternet.v +++ b/lib/threefold/grid4/farmingsimulator/model_regionalinternet.v @@ -1,6 +1,6 @@ module farmingsimulator -import freeflowuniverse.herolib.biz.spreadsheet +import incubaid.herolib.biz.spreadsheet pub struct RegionalInternet { pub mut: diff --git a/lib/threefold/grid4/farmingsimulator/model_simulator.v b/lib/threefold/grid4/farmingsimulator/model_simulator.v index 47c58cd1..66ed6327 100644 --- a/lib/threefold/grid4/farmingsimulator/model_simulator.v +++ b/lib/threefold/grid4/farmingsimulator/model_simulator.v @@ -1,12 +1,12 @@ module farmingsimulator -import freeflowuniverse.herolib.biz.spreadsheet -// import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.develop.gittools -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core.playbook -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.threefold.grid4.datamodel +import incubaid.herolib.biz.spreadsheet +// import incubaid.herolib.core.pathlib +import incubaid.herolib.develop.gittools +import incubaid.herolib.core.texttools +import incubaid.herolib.core.playbook +import incubaid.herolib.ui.console +import incubaid.herolib.threefold.grid4.datamodel @[heap] pub struct Simulator { diff --git a/lib/threefold/grid4/farmingsimulator/play.v b/lib/threefold/grid4/farmingsimulator/play.v index 28952963..12b66464 100644 --- a/lib/threefold/grid4/farmingsimulator/play.v +++ b/lib/threefold/grid4/farmingsimulator/play.v @@ -1,8 +1,8 @@ module farmingsimulator -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.playbook { PlayBook } -// import freeflowuniverse.herolib.threefold.grid4.farmingsimulator +import incubaid.herolib.ui.console +import incubaid.herolib.core.playbook { PlayBook } +// import incubaid.herolib.threefold.grid4.farmingsimulator pub fn play(mut plbook PlayBook) ! { // mut sheet_name := '' diff --git a/lib/threefold/grid4/farmingsimulator/playmacro.v b/lib/threefold/grid4/farmingsimulator/playmacro.v index 3e2fd629..0e4c9923 100644 --- a/lib/threefold/grid4/farmingsimulator/playmacro.v +++ b/lib/threefold/grid4/farmingsimulator/playmacro.v @@ -1,7 +1,7 @@ module farmingsimulator -import freeflowuniverse.herolib.core.playbook { Action } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.playbook { Action } +import incubaid.herolib.ui.console // import json pub fn playmacro(action Action) !string { diff --git a/lib/threefold/grid4/farmingsimulator/wiki.v b/lib/threefold/grid4/farmingsimulator/wiki.v index 0a2ac483..86b47feb 100644 --- a/lib/threefold/grid4/farmingsimulator/wiki.v +++ b/lib/threefold/grid4/farmingsimulator/wiki.v @@ -1,6 +1,6 @@ module farmingsimulator -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console pub fn (mut s Simulator) node_template_wiki(name_ string) !string { name := name_.to_lower() diff --git a/lib/threefold/grid4/gridsimulator/factory.v b/lib/threefold/grid4/gridsimulator/factory.v index 483cbb8a..d9329bb6 100644 --- a/lib/threefold/grid4/gridsimulator/factory.v +++ b/lib/threefold/grid4/gridsimulator/factory.v @@ -1,12 +1,12 @@ module gridsimulator -import freeflowuniverse.herolib.biz.spreadsheet -// import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.develop.gittools -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core.playbook -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.threefold.grid4.datamodel +import incubaid.herolib.biz.spreadsheet +// import incubaid.herolib.core.pathlib +import incubaid.herolib.develop.gittools +import incubaid.herolib.core.texttools +import incubaid.herolib.core.playbook +import incubaid.herolib.ui.console +import incubaid.herolib.threefold.grid4.datamodel __global ( grid_simulators shared map[string]&Simulator diff --git a/lib/threefold/grid4/gridsimulator/play.v b/lib/threefold/grid4/gridsimulator/play.v index 78c4d36b..15a14c24 100644 --- a/lib/threefold/grid4/gridsimulator/play.v +++ b/lib/threefold/grid4/gridsimulator/play.v @@ -1,7 +1,7 @@ module gridsimulator -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.threefold.grid4.datamodel +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.threefold.grid4.datamodel pub fn play(mut plbook PlayBook) ! { // first make sure we find a run action to know the name diff --git a/lib/threefold/incatokens/charts.v b/lib/threefold/incatokens/charts.v index 3b4e4044..a15c87bd 100644 --- a/lib/threefold/incatokens/charts.v +++ b/lib/threefold/incatokens/charts.v @@ -1,7 +1,7 @@ module incatokens -import freeflowuniverse.herolib.biz.spreadsheet -import freeflowuniverse.herolib.web.echarts +import incubaid.herolib.biz.spreadsheet +import incubaid.herolib.web.echarts // Generate price evolution chart pub fn (sim Simulation) generate_price_chart() !echarts.EChartsOption { diff --git a/lib/threefold/incatokens/export.v b/lib/threefold/incatokens/export.v index d7832491..2b7c3fcd 100644 --- a/lib/threefold/incatokens/export.v +++ b/lib/threefold/incatokens/export.v @@ -1,7 +1,7 @@ module incatokens -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.pathlib +import incubaid.herolib.ui.console import time // Struct to hold all data for the report template diff --git a/lib/threefold/incatokens/factory.v b/lib/threefold/incatokens/factory.v index 4cace075..dff7e567 100644 --- a/lib/threefold/incatokens/factory.v +++ b/lib/threefold/incatokens/factory.v @@ -1,7 +1,7 @@ module incatokens -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.biz.spreadsheet +import incubaid.herolib.core.texttools +import incubaid.herolib.biz.spreadsheet __global ( simulations map[string]&Simulation diff --git a/lib/threefold/incatokens/incatokens_test.v b/lib/threefold/incatokens/incatokens_test.v index 3841080c..90d31339 100644 --- a/lib/threefold/incatokens/incatokens_test.v +++ b/lib/threefold/incatokens/incatokens_test.v @@ -1,6 +1,6 @@ module incatokens -import freeflowuniverse.herolib.biz.spreadsheet +import incubaid.herolib.biz.spreadsheet import os import incatokens.defaults import incatokens.factory diff --git a/lib/threefold/incatokens/play.v b/lib/threefold/incatokens/play.v index 09e0fcfd..2fe5dec3 100644 --- a/lib/threefold/incatokens/play.v +++ b/lib/threefold/incatokens/play.v @@ -1,8 +1,8 @@ module incatokens -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console +import incubaid.herolib.core.pathlib import os pub fn play(mut plbook PlayBook) ! { diff --git a/lib/threefold/incatokens/simulation.v b/lib/threefold/incatokens/simulation.v index 009a00c2..b6f29762 100644 --- a/lib/threefold/incatokens/simulation.v +++ b/lib/threefold/incatokens/simulation.v @@ -1,6 +1,6 @@ module incatokens -import freeflowuniverse.herolib.biz.spreadsheet +import incubaid.herolib.biz.spreadsheet // Simulation holds the main simulation state pub struct Simulation { diff --git a/lib/threefold/incatokens/types.v b/lib/threefold/incatokens/types.v index aa5a872b..08ce6f91 100644 --- a/lib/threefold/incatokens/types.v +++ b/lib/threefold/incatokens/types.v @@ -1,6 +1,6 @@ module incatokens -import freeflowuniverse.herolib.biz.spreadsheet +import incubaid.herolib.biz.spreadsheet // VestingSchedule defines cliff and vesting periods pub struct VestingSchedule { diff --git a/lib/threefold/incatokens/vesting.v b/lib/threefold/incatokens/vesting.v index c644256a..78b966c5 100644 --- a/lib/threefold/incatokens/vesting.v +++ b/lib/threefold/incatokens/vesting.v @@ -1,6 +1,6 @@ module incatokens -import freeflowuniverse.herolib.biz.spreadsheet +import incubaid.herolib.biz.spreadsheet // Create vesting schedule in spreadsheet pub fn (mut sim Simulation) create_vesting_schedules() ! { diff --git a/lib/threefold/models_ledger/account.v b/lib/threefold/models_ledger/account.v index 7a214e6a..0bde9052 100644 --- a/lib/threefold/models_ledger/account.v +++ b/lib/threefold/models_ledger/account.v @@ -1,9 +1,9 @@ // lib/threefold/models_ledger/account.v module models_ledger -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.hero.db +import incubaid.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.hero.db // AccountStatus represents the status of an account pub enum AccountStatus { diff --git a/lib/threefold/models_ledger/asset.v b/lib/threefold/models_ledger/asset.v index 609cf3c1..f8ae5964 100644 --- a/lib/threefold/models_ledger/asset.v +++ b/lib/threefold/models_ledger/asset.v @@ -1,24 +1,24 @@ // lib/threefold/models_ledger/asset.v module models_ledger -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.hero.db +import incubaid.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.hero.db // Asset represents a digital or physical item of value within the system. @[heap] pub struct Asset { db.Base pub mut: - address string @[required; index] // The unique address or identifier for the asset. - asset_type string @[required] // The type of the asset (e.g., 'token', 'nft'). - issuer u32 @[required] // The user ID of the issuer of the asset. - supply f64 // The total supply of the asset. - decimals u8 // The number of decimal places for the asset's value. - is_frozen bool // Indicates if the asset is currently frozen and cannot be transferred. - metadata map[string]string // A map for storing arbitrary metadata as key-value pairs. - administrators []u32 // A list of user IDs that are administrators for this asset. - min_signatures u32 // The minimum number of signatures required for administrative actions. + address string @[index; required] // The unique address or identifier for the asset. + asset_type string @[required] // The type of the asset (e.g., 'token', 'nft'). + issuer u32 @[required] // The user ID of the issuer of the asset. + supply f64 // The total supply of the asset. + decimals u8 // The number of decimal places for the asset's value. + is_frozen bool // Indicates if the asset is currently frozen and cannot be transferred. + metadata map[string]string // A map for storing arbitrary metadata as key-value pairs. + administrators []u32 // A list of user IDs that are administrators for this asset. + min_signatures u32 // The minimum number of signatures required for administrative actions. } pub struct DBAsset { @@ -63,7 +63,7 @@ pub fn (self Asset) dump(mut e encoder.Encoder) ! { e.add_f64(self.supply) e.add_u8(self.decimals) e.add_bool(self.is_frozen) - + e.add_map_string(self.metadata) e.add_list_u32(self.administrators) e.add_u32(self.min_signatures) @@ -76,7 +76,7 @@ fn (mut self DBAsset) load(mut o Asset, mut e encoder.Decoder) ! { o.supply = e.get_f64()! o.decimals = e.get_u8()! o.is_frozen = e.get_bool()! - + o.metadata = e.get_map_string()! o.administrators = e.get_list_u32()! o.min_signatures = e.get_u32()! @@ -85,17 +85,17 @@ fn (mut self DBAsset) load(mut o Asset, mut e encoder.Decoder) ! { @[params] pub struct AssetArg { pub mut: - name string - description string - address string - asset_type string - issuer u32 - supply f64 - decimals u8 - is_frozen bool - metadata map[string]string - administrators []u32 - min_signatures u32 + name string + description string + address string + asset_type string + issuer u32 + supply f64 + decimals u8 + is_frozen bool + metadata map[string]string + administrators []u32 + min_signatures u32 } pub fn (mut self DBAsset) new(args AssetArg) !Asset { @@ -139,4 +139,4 @@ pub fn (mut self DBAsset) get(id u32) !Asset { pub fn (mut self DBAsset) list() ![]Asset { return self.db.list[Asset]()!.map(self.get(it)!) -} \ No newline at end of file +} diff --git a/lib/threefold/models_ledger/dnszone.v b/lib/threefold/models_ledger/dnszone.v index 13ebda1e..c08a2221 100644 --- a/lib/threefold/models_ledger/dnszone.v +++ b/lib/threefold/models_ledger/dnszone.v @@ -1,9 +1,9 @@ // lib/threefold/models_ledger/dnszone.v module models_ledger -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.hero.db +import incubaid.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.hero.db // NameType defines the supported DNS record types pub enum NameType { diff --git a/lib/threefold/models_ledger/group.v b/lib/threefold/models_ledger/group.v index 8311c8ff..32cb798a 100644 --- a/lib/threefold/models_ledger/group.v +++ b/lib/threefold/models_ledger/group.v @@ -1,9 +1,9 @@ // lib/threefold/models_ledger/group.v module models_ledger -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.hero.db +import incubaid.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.hero.db // Group represents a collection of users with shared permissions and access. @[heap] diff --git a/lib/threefold/models_ledger/member.v b/lib/threefold/models_ledger/member.v index 9545850e..e57ecaef 100644 --- a/lib/threefold/models_ledger/member.v +++ b/lib/threefold/models_ledger/member.v @@ -1,8 +1,8 @@ module models_ledger -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.hero.db +import incubaid.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.hero.db // MemberRole defines the role of a user within a group pub enum MemberRole { diff --git a/lib/threefold/models_ledger/notary.v b/lib/threefold/models_ledger/notary.v index 9a42e2e1..60a1364a 100644 --- a/lib/threefold/models_ledger/notary.v +++ b/lib/threefold/models_ledger/notary.v @@ -1,18 +1,18 @@ module models_ledger -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.hero.db +import incubaid.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.hero.db // Notary represents a cryptographic notary in the system @[heap] pub struct Notary { db.Base pub mut: - notary_id u32 @[index] - pubkey string - address string - is_active bool + notary_id u32 @[index] + pubkey string + address string + is_active bool } pub struct DBNotary { @@ -87,12 +87,12 @@ fn (mut self DBNotary) load(mut o Notary, mut e encoder.Decoder) ! { @[params] pub struct NotaryArg { pub mut: - name string + name string description string - notary_id u32 - pubkey string - address string - is_active bool = true + notary_id u32 + pubkey string + address string + is_active bool = true } pub fn (mut self DBNotary) new(args NotaryArg) !Notary { @@ -131,4 +131,4 @@ pub fn (mut self DBNotary) get(id u32) !Notary { pub fn (mut self DBNotary) list() ![]Notary { return self.db.list[Notary]()!.map(self.get(it)!) -} \ No newline at end of file +} diff --git a/lib/threefold/models_ledger/signature.v b/lib/threefold/models_ledger/signature.v index cd59bf4d..99df9ab7 100644 --- a/lib/threefold/models_ledger/signature.v +++ b/lib/threefold/models_ledger/signature.v @@ -1,8 +1,8 @@ module models_ledger -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.hero.db +import incubaid.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.hero.db // Signature represents a digital signature in the system @[heap] diff --git a/lib/threefold/models_ledger/test_utils.v b/lib/threefold/models_ledger/test_utils.v index 26f0b366..56b66378 100644 --- a/lib/threefold/models_ledger/test_utils.v +++ b/lib/threefold/models_ledger/test_utils.v @@ -1,6 +1,6 @@ module models_ledger -import freeflowuniverse.herolib.hero.db +import incubaid.herolib.hero.db fn setup_test_db() !db.DB { mut mydb := db.new()! diff --git a/lib/threefold/models_ledger/transaction.v b/lib/threefold/models_ledger/transaction.v index 8ecdaf8b..c5ca62d5 100644 --- a/lib/threefold/models_ledger/transaction.v +++ b/lib/threefold/models_ledger/transaction.v @@ -1,9 +1,9 @@ // lib/threefold/models_ledger/transaction.v module models_ledger -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.hero.db +import incubaid.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.hero.db // Transaction represents a financial transaction @[heap] diff --git a/lib/threefold/models_ledger/user.v b/lib/threefold/models_ledger/user.v index cf2b8650..dcef0d08 100644 --- a/lib/threefold/models_ledger/user.v +++ b/lib/threefold/models_ledger/user.v @@ -1,9 +1,9 @@ // lib/threefold/models_ledger/user.v module models_ledger -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.hero.db +import incubaid.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.hero.db // User represents a user in the heroledger system @[heap] diff --git a/lib/threefold/models_ledger/userkvs.v b/lib/threefold/models_ledger/userkvs.v index f43cc1e5..a6c5e4a2 100644 --- a/lib/threefold/models_ledger/userkvs.v +++ b/lib/threefold/models_ledger/userkvs.v @@ -1,8 +1,8 @@ module models_ledger -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.hero.db +import incubaid.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.hero.db // UserKVS represents a key-value store for a user @[heap] @@ -116,4 +116,4 @@ pub fn (mut self DBUserKVS) get(id u32) !UserKVS { pub fn (mut self DBUserKVS) list() ![]UserKVS { return self.db.list[UserKVS]()!.map(self.get(it)!) -} \ No newline at end of file +} diff --git a/lib/threefold/models_ledger/userkvsitem.v b/lib/threefold/models_ledger/userkvsitem.v index e007b759..c2b1c11e 100644 --- a/lib/threefold/models_ledger/userkvsitem.v +++ b/lib/threefold/models_ledger/userkvsitem.v @@ -1,15 +1,15 @@ module models_ledger -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.hero.db +import incubaid.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.hero.db // UserKVSItem represents a single item in a user's key-value store @[heap] pub struct UserKVSItem { db.Base pub mut: - kvs_id u32 @[index] + kvs_id u32 @[index] key string @[index] value string timestamp u64 @@ -130,4 +130,4 @@ pub fn (mut self DBUserKVSItem) get(id u32) !UserKVSItem { pub fn (mut self DBUserKVSItem) list() ![]UserKVSItem { return self.db.list[UserKVSItem]()!.map(self.get(it)!) -} \ No newline at end of file +} diff --git a/lib/threefold/models_tfgrid/bid.v b/lib/threefold/models_tfgrid/bid.v index b33a19ee..e0c675f8 100644 --- a/lib/threefold/models_tfgrid/bid.v +++ b/lib/threefold/models_tfgrid/bid.v @@ -1,9 +1,9 @@ module models_tfgrid -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.hero.db -import freeflowuniverse.herolib.data.json +import incubaid.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.hero.db +import incubaid.herolib.data.json // Bid - ROOT OBJECT @[heap] @@ -173,4 +173,4 @@ pub fn (mut self DBBid) get(id u32) !Bid { pub fn (mut self DBBid) list() ![]Bid { return self.db.list[Bid]()!.map(self.get(it)!) -} \ No newline at end of file +} diff --git a/lib/threefold/models_tfgrid/contract.v b/lib/threefold/models_tfgrid/contract.v index 3a3bbe7f..ef3a4787 100644 --- a/lib/threefold/models_tfgrid/contract.v +++ b/lib/threefold/models_tfgrid/contract.v @@ -1,26 +1,26 @@ module models_tfgrid -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.hero.db +import incubaid.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.hero.db // Contract - ROOT OBJECT @[heap] pub struct Contract { db.Base pub mut: - customer_id u32 // links back to customer for this capacity - compute_slices []ComputeSliceProvisioned - storage_slices []StorageSliceProvisioned - compute_slice_price f64 // price per 1 GB agreed upon - storage_slice_price f64 // price per 1 GB agreed upon - network_slice_price f64 // price per 1 GB agreed upon (transfer) - status ContractStatus - start_date u32 // epoch - end_date u32 - signature_user string // signature as done by user/consumer - signature_hoster string // signature as done by the hoster - billing_period BillingPeriod + customer_id u32 // links back to customer for this capacity + compute_slices []ComputeSliceProvisioned + storage_slices []StorageSliceProvisioned + compute_slice_price f64 // price per 1 GB agreed upon + storage_slice_price f64 // price per 1 GB agreed upon + network_slice_price f64 // price per 1 GB agreed upon (transfer) + status ContractStatus + start_date u32 // epoch + end_date u32 + signature_user string // signature as done by user/consumer + signature_hoster string // signature as done by the hoster + billing_period BillingPeriod } pub enum ContractStatus { @@ -33,14 +33,14 @@ pub enum ContractStatus { // Provisioned compute slice pub struct ComputeSliceProvisioned { pub mut: - node_id u32 - id u16 // the id of the slice in the node - mem_gb f64 - storage_gb f64 - passmark int - vcores int - cpu_oversubscription int - tags string + node_id u32 + id u16 // the id of the slice in the node + mem_gb f64 + storage_gb f64 + passmark int + vcores int + cpu_oversubscription int + tags string } // Provisioned storage slice @@ -52,7 +52,6 @@ pub mut: tags string } - pub struct DBContract { pub mut: db &db.DB @[skip; str: skip] @@ -110,7 +109,7 @@ pub fn (self Contract) example(methodname string) (string, string) { pub fn (self Contract) dump(mut e encoder.Encoder) ! { e.add_u32(self.customer_id) - + // Encode compute slices e.add_int(self.compute_slices.len) for slice in self.compute_slices { @@ -123,7 +122,7 @@ pub fn (self Contract) dump(mut e encoder.Encoder) ! { e.add_int(slice.cpu_oversubscription) e.add_string(slice.tags) } - + // Encode storage slices e.add_int(self.storage_slices.len) for slice in self.storage_slices { @@ -132,7 +131,7 @@ pub fn (self Contract) dump(mut e encoder.Encoder) ! { e.add_int(slice.storage_size_gb) e.add_string(slice.tags) } - + e.add_f64(self.compute_slice_price) e.add_f64(self.storage_slice_price) e.add_f64(self.network_slice_price) @@ -146,7 +145,7 @@ pub fn (self Contract) dump(mut e encoder.Encoder) ! { fn (mut self DBContract) load(mut o Contract, mut e encoder.Decoder) ! { o.customer_id = e.get_u32()! - + // Decode compute slices compute_slices_len := e.get_int()! o.compute_slices = []ComputeSliceProvisioned{len: compute_slices_len} @@ -160,7 +159,7 @@ fn (mut self DBContract) load(mut o Contract, mut e encoder.Decoder) ! { o.compute_slices[i].cpu_oversubscription = e.get_int()! o.compute_slices[i].tags = e.get_string()! } - + // Decode storage slices storage_slices_len := e.get_int()! o.storage_slices = []StorageSliceProvisioned{len: storage_slices_len} @@ -170,7 +169,7 @@ fn (mut self DBContract) load(mut o Contract, mut e encoder.Decoder) ! { o.storage_slices[i].storage_size_gb = e.get_int()! o.storage_slices[i].tags = e.get_string()! } - + o.compute_slice_price = e.get_f64()! o.storage_slice_price = e.get_f64()! o.network_slice_price = e.get_f64()! @@ -185,20 +184,20 @@ fn (mut self DBContract) load(mut o Contract, mut e encoder.Decoder) ! { @[params] pub struct ContractArg { pub mut: - name string - description string - customer_id u32 - compute_slices []ComputeSliceProvisioned - storage_slices []StorageSliceProvisioned - compute_slice_price f64 - storage_slice_price f64 - network_slice_price f64 - status ContractStatus - start_date u32 - end_date u32 - signature_user string - signature_hoster string - billing_period BillingPeriod + name string + description string + customer_id u32 + compute_slices []ComputeSliceProvisioned + storage_slices []StorageSliceProvisioned + compute_slice_price f64 + storage_slice_price f64 + network_slice_price f64 + status ContractStatus + start_date u32 + end_date u32 + signature_user string + signature_hoster string + billing_period BillingPeriod } pub fn (mut self DBContract) new(args ContractArg) !Contract { @@ -245,4 +244,4 @@ pub fn (mut self DBContract) get(id u32) !Contract { pub fn (mut self DBContract) list() ![]Contract { return self.db.list[Contract]()!.map(self.get(it)!) -} \ No newline at end of file +} diff --git a/lib/threefold/models_tfgrid/node.v b/lib/threefold/models_tfgrid/node.v index ed437ea2..601a74f0 100644 --- a/lib/threefold/models_tfgrid/node.v +++ b/lib/threefold/models_tfgrid/node.v @@ -1,8 +1,8 @@ module models_tfgrid -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.hero.db +import incubaid.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.hero.db // Storage device information pub struct StorageDevice { @@ -74,18 +74,18 @@ pub mut: // Pricing policy for slices pub struct PricingPolicy { pub mut: - name string // Human friendly policy name (e.g. "fixed", "market") - details string // Optional free-form details as JSON-encoded string - marketplace_year_discounts []int // e.g. [30, 40, 50] means if user has more CC than 1Y utilization, 30% discount, etc. + name string // Human friendly policy name (e.g. "fixed", "market") + details string // Optional free-form details as JSON-encoded string + marketplace_year_discounts []int // e.g. [30, 40, 50] means if user has more CC than 1Y utilization, 30% discount, etc. } // SLA policy for slices pub struct SLAPolicy { pub mut: - uptime f32 // Uptime in percentage (0..100) - max_response_time_ms u32 // Max response time in ms - sla_bandwidth_mbit int // minimal mbits we can expect avg over 1h per node, 0 means we don't guarantee - sla_penalty int // 0-100, percent of money given back in relation to month if sla breached + uptime f32 // Uptime in percentage (0..100) + max_response_time_ms u32 // Max response time in ms + sla_bandwidth_mbit int // minimal mbits we can expect avg over 1h per node, 0 means we don't guarantee + sla_penalty int // 0-100, percent of money given back in relation to month if sla breached } // Compute slice (typically represents a base unit of compute) @@ -119,17 +119,17 @@ pub mut: pub struct Node { db.Base pub mut: - nodegroupid int // Link to node group - uptime int // Uptime percentage 0..100 - computeslices []ComputeSlice - storageslices []StorageSlice - devices DeviceInfo - country string // 2 letter code - capacity NodeCapacity // Hardware capacity details - birthtime u32 // first time node was active - pubkey string - signature_node string // signature done on node to validate pubkey with privkey - signature_farmer string // signature as done by farmers to validate their identity + nodegroupid int // Link to node group + uptime int // Uptime percentage 0..100 + computeslices []ComputeSlice + storageslices []StorageSlice + devices DeviceInfo + country string // 2 letter code + capacity NodeCapacity // Hardware capacity details + birthtime u32 // first time node was active + pubkey string + signature_node string // signature done on node to validate pubkey with privkey + signature_farmer string // signature as done by farmers to validate their identity } pub struct DBNode { @@ -190,7 +190,7 @@ pub fn (self Node) example(methodname string) (string, string) { pub fn (self Node) dump(mut e encoder.Encoder) ! { e.add_int(self.nodegroupid) e.add_int(self.uptime) - + // Encode compute slices e.add_int(self.computeslices.len) for slice in self.computeslices { @@ -212,7 +212,7 @@ pub fn (self Node) dump(mut e encoder.Encoder) ! { e.add_int(slice.sla_policy.sla_bandwidth_mbit) e.add_int(slice.sla_policy.sla_penalty) } - + // Encode storage slices e.add_int(self.storageslices.len) for slice in self.storageslices { @@ -226,7 +226,7 @@ pub fn (self Node) dump(mut e encoder.Encoder) ! { e.add_int(slice.sla_policy.sla_bandwidth_mbit) e.add_int(slice.sla_policy.sla_penalty) } - + // Encode devices e.add_string(self.devices.vendor) e.add_int(self.devices.storage.len) @@ -265,7 +265,7 @@ pub fn (self Node) dump(mut e encoder.Encoder) ! { e.add_int(device.speed_mbps) e.add_string(device.description) } - + e.add_string(self.country) e.add_f64(self.capacity.storage_gb) e.add_f64(self.capacity.mem_gb) @@ -281,7 +281,7 @@ pub fn (self Node) dump(mut e encoder.Encoder) ! { fn (mut self DBNode) load(mut o Node, mut e encoder.Decoder) ! { o.nodegroupid = e.get_int()! o.uptime = e.get_int()! - + // Decode compute slices compute_slices_len := e.get_int()! o.computeslices = []ComputeSlice{len: compute_slices_len} @@ -304,7 +304,7 @@ fn (mut self DBNode) load(mut o Node, mut e encoder.Decoder) ! { o.computeslices[i].sla_policy.sla_bandwidth_mbit = e.get_int()! o.computeslices[i].sla_policy.sla_penalty = e.get_int()! } - + // Decode storage slices storage_slices_len := e.get_int()! o.storageslices = []StorageSlice{len: storage_slices_len} @@ -319,10 +319,10 @@ fn (mut self DBNode) load(mut o Node, mut e encoder.Decoder) ! { o.storageslices[i].sla_policy.sla_bandwidth_mbit = e.get_int()! o.storageslices[i].sla_policy.sla_penalty = e.get_int()! } - + // Decode devices o.devices.vendor = e.get_string()! - + storage_devices_len := e.get_int()! o.devices.storage = []StorageDevice{len: storage_devices_len} for i in 0 .. storage_devices_len { @@ -330,7 +330,7 @@ fn (mut self DBNode) load(mut o Node, mut e encoder.Decoder) ! { o.devices.storage[i].size_gb = e.get_f64()! o.devices.storage[i].description = e.get_string()! } - + memory_devices_len := e.get_int()! o.devices.memory = []MemoryDevice{len: memory_devices_len} for i in 0 .. memory_devices_len { @@ -338,7 +338,7 @@ fn (mut self DBNode) load(mut o Node, mut e encoder.Decoder) ! { o.devices.memory[i].size_gb = e.get_f64()! o.devices.memory[i].description = e.get_string()! } - + cpu_devices_len := e.get_int()! o.devices.cpu = []CPUDevice{len: cpu_devices_len} for i in 0 .. cpu_devices_len { @@ -349,7 +349,7 @@ fn (mut self DBNode) load(mut o Node, mut e encoder.Decoder) ! { o.devices.cpu[i].cpu_brand = e.get_string()! o.devices.cpu[i].cpu_version = e.get_string()! } - + gpu_devices_len := e.get_int()! o.devices.gpu = []GPUDevice{len: gpu_devices_len} for i in 0 .. gpu_devices_len { @@ -360,7 +360,7 @@ fn (mut self DBNode) load(mut o Node, mut e encoder.Decoder) ! { o.devices.gpu[i].gpu_brand = e.get_string()! o.devices.gpu[i].gpu_version = e.get_string()! } - + network_devices_len := e.get_int()! o.devices.network = []NetworkDevice{len: network_devices_len} for i in 0 .. network_devices_len { @@ -368,7 +368,7 @@ fn (mut self DBNode) load(mut o Node, mut e encoder.Decoder) ! { o.devices.network[i].speed_mbps = e.get_int()! o.devices.network[i].description = e.get_string()! } - + o.country = e.get_string()! o.capacity.storage_gb = e.get_f64()! o.capacity.mem_gb = e.get_f64()! @@ -401,16 +401,16 @@ pub mut: pub fn (mut self DBNode) new(args NodeArg) !Node { mut o := Node{ - nodegroupid: args.nodegroupid - uptime: args.uptime - computeslices: args.computeslices - storageslices: args.storageslices - devices: args.devices - country: args.country - capacity: args.capacity - birthtime: args.birthtime - pubkey: args.pubkey - signature_node: args.signature_node + nodegroupid: args.nodegroupid + uptime: args.uptime + computeslices: args.computeslices + storageslices: args.storageslices + devices: args.devices + country: args.country + capacity: args.capacity + birthtime: args.birthtime + pubkey: args.pubkey + signature_node: args.signature_node signature_farmer: args.signature_farmer } @@ -442,4 +442,4 @@ pub fn (mut self DBNode) get(id u32) !Node { pub fn (mut self DBNode) list() ![]Node { return self.db.list[Node]()!.map(self.get(it)!) -} \ No newline at end of file +} diff --git a/lib/threefold/models_tfgrid/nodegroup.v b/lib/threefold/models_tfgrid/nodegroup.v index 6a7a8240..e7fadd10 100644 --- a/lib/threefold/models_tfgrid/nodegroup.v +++ b/lib/threefold/models_tfgrid/nodegroup.v @@ -1,8 +1,8 @@ module models_tfgrid -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.hero.db +import incubaid.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.hero.db // NodeGroup - ROOT OBJECT @[heap] @@ -156,4 +156,4 @@ pub fn (mut self DBNodeGroup) get(id u32) !NodeGroup { pub fn (mut self DBNodeGroup) list() ![]NodeGroup { return self.db.list[NodeGroup]()!.map(self.get(it)!) -} \ No newline at end of file +} diff --git a/lib/threefold/models_tfgrid/reputation.v b/lib/threefold/models_tfgrid/reputation.v index be8ca718..2800e671 100644 --- a/lib/threefold/models_tfgrid/reputation.v +++ b/lib/threefold/models_tfgrid/reputation.v @@ -1,15 +1,15 @@ module models_tfgrid -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.hero.db +import incubaid.herolib.data.encoder +import incubaid.herolib.data.ourtime +import incubaid.herolib.hero.db // Individual node reputation information pub struct NodeReputation { pub mut: node_id u32 reputation int = 50 // between 0 and 100, earned over time - uptime int // between 0 and 100, set by system + uptime int // between 0 and 100, set by system } // NodeGroupReputation - ROOT OBJECT @@ -18,8 +18,8 @@ pub struct NodeGroupReputation { db.Base pub mut: nodegroup_id u32 - reputation int = 50 // between 0 and 100, earned over time - uptime int // between 0 and 100, set by system, farmer has no ability to set this + reputation int = 50 // between 0 and 100, earned over time + uptime int // between 0 and 100, set by system, farmer has no ability to set this nodes []NodeReputation } @@ -82,7 +82,7 @@ pub fn (self NodeGroupReputation) dump(mut e encoder.Encoder) ! { e.add_u32(self.nodegroup_id) e.add_int(self.reputation) e.add_int(self.uptime) - + // Encode node reputations e.add_int(self.nodes.len) for node in self.nodes { @@ -96,7 +96,7 @@ fn (mut self DBNodeGroupReputation) load(mut o NodeGroupReputation, mut e encode o.nodegroup_id = e.get_u32()! o.reputation = e.get_int()! o.uptime = e.get_int()! - + // Decode node reputations nodes_len := e.get_int()! o.nodes = []NodeReputation{len: nodes_len} @@ -154,4 +154,4 @@ pub fn (mut self DBNodeGroupReputation) get(id u32) !NodeGroupReputation { pub fn (mut self DBNodeGroupReputation) list() ![]NodeGroupReputation { return self.db.list[NodeGroupReputation]()!.map(self.get(it)!) -} \ No newline at end of file +} diff --git a/lib/ui/console/console.v b/lib/ui/console/console.v index eb4a6922..b6c527a8 100644 --- a/lib/ui/console/console.v +++ b/lib/ui/console/console.v @@ -1,6 +1,6 @@ module console -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.texttools pub fn clear() { if !silent_get() { @@ -110,5 +110,5 @@ pub fn print_info(txt string) { c.reset() } -// import freeflowuniverse.herolib.ui.console +// import incubaid.herolib.ui.console // console.print_header() diff --git a/lib/ui/console/dropdown.v b/lib/ui/console/dropdown.v index ac2e42f7..edb28c3d 100644 --- a/lib/ui/console/dropdown.v +++ b/lib/ui/console/dropdown.v @@ -1,8 +1,8 @@ module console -// import freeflowuniverse.herolib.core.texttools -// import freeflowuniverse.herolib.ui.console { color_fg } -import freeflowuniverse.herolib.ui.uimodel { DropDownArgs } +// import incubaid.herolib.core.texttools +// import incubaid.herolib.ui.console { color_fg } +import incubaid.herolib.ui.uimodel { DropDownArgs } import os fn (mut c UIConsole) ask_dropdown_internal(args DropDownArgs) !string { diff --git a/lib/ui/console/factory.v b/lib/ui/console/factory.v index 29d7e40c..f9d123ff 100644 --- a/lib/ui/console/factory.v +++ b/lib/ui/console/factory.v @@ -1,6 +1,6 @@ module console -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.texttools __global ( consoles map[string]&UIConsole diff --git a/lib/ui/console/question.v b/lib/ui/console/question.v index 8a6c597b..2fe0985c 100644 --- a/lib/ui/console/question.v +++ b/lib/ui/console/question.v @@ -1,8 +1,8 @@ module console import os -import freeflowuniverse.herolib.ui.uimodel { QuestionArgs } -// import freeflowuniverse.herolib.ui.console { color_fg } +import incubaid.herolib.ui.uimodel { QuestionArgs } +// import incubaid.herolib.ui.console { color_fg } // args: // - description string diff --git a/lib/ui/console/time_date.v b/lib/ui/console/time_date.v index c6f87b39..569a9ce9 100644 --- a/lib/ui/console/time_date.v +++ b/lib/ui/console/time_date.v @@ -1,6 +1,6 @@ module console -import freeflowuniverse.herolib.ui.uimodel { QuestionArgs } +import incubaid.herolib.ui.uimodel { QuestionArgs } pub fn (mut c UIConsole) ask_date(args QuestionArgs) !string { panic('implement') diff --git a/lib/ui/console/yesno.v b/lib/ui/console/yesno.v index dbcc3305..c219dfbe 100644 --- a/lib/ui/console/yesno.v +++ b/lib/ui/console/yesno.v @@ -1,7 +1,7 @@ module console -import freeflowuniverse.herolib.ui.uimodel { YesNoArgs } -// import freeflowuniverse.herolib.ui.console { color_fg } +import incubaid.herolib.ui.uimodel { YesNoArgs } +// import incubaid.herolib.ui.console { color_fg } import os // yes is true, no is false diff --git a/lib/ui/factory.v b/lib/ui/factory.v index cec9fa36..11a490b3 100644 --- a/lib/ui/factory.v +++ b/lib/ui/factory.v @@ -1,9 +1,9 @@ module ui -import freeflowuniverse.herolib.ui.generic { ChannelType, UserInterface } -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.data.paramsparser -// import freeflowuniverse.herolib.ui.telegram +import incubaid.herolib.ui.generic { ChannelType, UserInterface } +import incubaid.herolib.ui.console +import incubaid.herolib.data.paramsparser +// import incubaid.herolib.ui.telegram @[params] pub struct UserInterfaceArgs { diff --git a/lib/ui/generic/dropdown.v b/lib/ui/generic/dropdown.v index aafc92c2..19ff98ff 100644 --- a/lib/ui/generic/dropdown.v +++ b/lib/ui/generic/dropdown.v @@ -1,8 +1,8 @@ module generic -import freeflowuniverse.herolib.ui.console { UIConsole } -// import freeflowuniverse.herolib.ui.telegram { UITelegram } -import freeflowuniverse.herolib.ui.uimodel { DropDownArgs } +import incubaid.herolib.ui.console { UIConsole } +// import incubaid.herolib.ui.telegram { UITelegram } +import incubaid.herolib.ui.uimodel { DropDownArgs } // return the dropdown as an int // description string diff --git a/lib/ui/generic/editor.v b/lib/ui/generic/editor.v index b5db6d6c..d677be24 100644 --- a/lib/ui/generic/editor.v +++ b/lib/ui/generic/editor.v @@ -1,8 +1,8 @@ module generic -// import freeflowuniverse.herolib.ui.console -// import freeflowuniverse.herolib.ui.telegram { UITelegram } -import freeflowuniverse.herolib.ui.uimodel +// import incubaid.herolib.ui.console +// import incubaid.herolib.ui.telegram { UITelegram } +import incubaid.herolib.ui.uimodel // open editor which can be used to edit content // (not every UI has all capability, in case of console open vscode if installed) . diff --git a/lib/ui/generic/info.v b/lib/ui/generic/info.v index 9ab1e168..7b9b9967 100644 --- a/lib/ui/generic/info.v +++ b/lib/ui/generic/info.v @@ -1,8 +1,8 @@ module generic -// import freeflowuniverse.herolib.ui.console -// import freeflowuniverse.herolib.ui.telegram { UITelegram } -import freeflowuniverse.herolib.ui.uimodel +// import incubaid.herolib.ui.console +// import incubaid.herolib.ui.telegram { UITelegram } +import incubaid.herolib.ui.uimodel // send info to the main pannel . // (not every UI has all capability e.g. html) diff --git a/lib/ui/generic/log.v b/lib/ui/generic/log.v index 30b2274d..0c77ec23 100644 --- a/lib/ui/generic/log.v +++ b/lib/ui/generic/log.v @@ -1,8 +1,8 @@ module generic -// import freeflowuniverse.herolib.ui.console -// import freeflowuniverse.herolib.ui.telegram { UITelegram } -import freeflowuniverse.herolib.ui.uimodel +// import incubaid.herolib.ui.console +// import incubaid.herolib.ui.telegram { UITelegram } +import incubaid.herolib.ui.uimodel // log content to the log panel (not every UI has this capability) // ``` diff --git a/lib/ui/generic/model.v b/lib/ui/generic/model.v index 6da0d57c..8992a3ba 100644 --- a/lib/ui/generic/model.v +++ b/lib/ui/generic/model.v @@ -1,8 +1,8 @@ module generic -import freeflowuniverse.herolib.ui.console { UIConsole } -import freeflowuniverse.herolib.ui.template { UIExample } -// import freeflowuniverse.herolib.ui.telegram { UITelegram } +import incubaid.herolib.ui.console { UIConsole } +import incubaid.herolib.ui.template { UIExample } +// import incubaid.herolib.ui.telegram { UITelegram } // need to do this for each type of UI channel e.g. console, telegram, ... type UIChannel = UIConsole | UIExample // TODO TelegramBot diff --git a/lib/ui/generic/payment.v b/lib/ui/generic/payment.v index 66655d2c..5ceda25b 100644 --- a/lib/ui/generic/payment.v +++ b/lib/ui/generic/payment.v @@ -1,8 +1,8 @@ module generic -// import freeflowuniverse.herolib.ui.console -// import freeflowuniverse.herolib.ui.telegram { UITelegram } -import freeflowuniverse.herolib.ui.uimodel +// import incubaid.herolib.ui.console +// import incubaid.herolib.ui.telegram { UITelegram } +import incubaid.herolib.ui.uimodel // ... // ``` diff --git a/lib/ui/generic/question.v b/lib/ui/generic/question.v index 7bd5097a..ac823e8d 100644 --- a/lib/ui/generic/question.v +++ b/lib/ui/generic/question.v @@ -1,8 +1,8 @@ module generic -import freeflowuniverse.herolib.ui.console { UIConsole } -// import freeflowuniverse.herolib.ui.telegram { UITelegram } -import freeflowuniverse.herolib.ui.uimodel { QuestionArgs } +import incubaid.herolib.ui.console { UIConsole } +// import incubaid.herolib.ui.telegram { UITelegram } +import incubaid.herolib.ui.uimodel { QuestionArgs } // args: // diff --git a/lib/ui/generic/yesno.v b/lib/ui/generic/yesno.v index 39f3983a..c4008ae0 100644 --- a/lib/ui/generic/yesno.v +++ b/lib/ui/generic/yesno.v @@ -1,8 +1,8 @@ module generic -import freeflowuniverse.herolib.ui.console { UIConsole } -// import freeflowuniverse.herolib.ui.telegram { UITelegram } -import freeflowuniverse.herolib.ui.uimodel +import incubaid.herolib.ui.console { UIConsole } +// import incubaid.herolib.ui.telegram { UITelegram } +import incubaid.herolib.ui.uimodel // yes is true, no is false // args: diff --git a/lib/ui/logger/logger.v b/lib/ui/logger/logger.v index b4a49512..d747e8fd 100644 --- a/lib/ui/logger/logger.v +++ b/lib/ui/logger/logger.v @@ -1,7 +1,7 @@ module console import time -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console pub enum LogLevel { error diff --git a/lib/ui/readme.md b/lib/ui/readme.md index 69ce31e0..f603fd13 100644 --- a/lib/ui/readme.md +++ b/lib/ui/readme.md @@ -1,8 +1,8 @@ # User Interface ```v -import freeflowuniverse.herolib.ui -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui +import incubaid.herolib.ui.console //today channeltype is not used, only console supported mut myui:=ui.new()! @@ -29,12 +29,12 @@ ok2delete:=myui.ask_yesno(question:"are you sure?")! // print with colors, reset... //``` -// foreground ForegroundColor -// background BackgroundColor -// text string -// style Style -// reset_before bool = true -// reset_after bool = true +// foreground ForegroundColor +// background BackgroundColor +// text string +// style Style +// reset_before bool = true +// reset_after bool = true //``` console.cprint(foreground=.yellow,style=.bold,text:"this is my happy text") @@ -51,29 +51,28 @@ can be seen in section ```generic``` not all features are possible for all UI implementations, sometimes a redirect to a webserver might be needed e.g. edit a document when using telegram, probably means we need to send a link to a server where the editor is a javascript editor and then the result get saved at the backend. - ## console colors ```v enum ForegroundColor { - default_color = 39 - white = 97 - black = 30 - red = 31 - green = 32 - yellow = 33 - blue = 34 - magenta = 35 - cyan = 36 - light_gray = 37 - dark_gray = 90 - light_red = 91 - light_green = 92 - light_yellow = 93 - light_blue = 94 - light_magenta = 95 - light_cyan = 96 + default_color = 39 + white = 97 + black = 30 + red = 31 + green = 32 + yellow = 33 + blue = 34 + magenta = 35 + cyan = 36 + light_gray = 37 + dark_gray = 90 + light_red = 91 + light_green = 92 + light_yellow = 93 + light_blue = 94 + light_magenta = 95 + light_cyan = 96 } enum BackgroundColor { @@ -97,7 +96,7 @@ enum BackgroundColor { } enum Style { - normal = 99 + normal = 99 bold = 1 dim = 2 underline = 4 @@ -106,4 +105,4 @@ enum Style { hidden = 8 } -``` \ No newline at end of file +``` diff --git a/lib/ui/telegram/channel.v b/lib/ui/telegram/channel.v index 89a403ea..146b3930 100644 --- a/lib/ui/telegram/channel.v +++ b/lib/ui/telegram/channel.v @@ -1,8 +1,8 @@ module telegram import dariotarantini.vgram -// import freeflowuniverse.herolib.baobab.client -import freeflowuniverse.herolib.data.paramsparser +// import incubaid.herolib.baobab.client +import incubaid.herolib.data.paramsparser pub struct UITelegram { pub mut: diff --git a/lib/ui/telegram/client/client.v b/lib/ui/telegram/client/client.v index d8f8a2c5..c3579d6f 100644 --- a/lib/ui/telegram/client/client.v +++ b/lib/ui/telegram/client/client.v @@ -1,7 +1,7 @@ module client -import freeflowuniverse.herolib.baobab.client -import freeflowuniverse.herolib.core.redisclient +import incubaid.herolib.baobab.client +import incubaid.herolib.core.redisclient import dariotarantini.vgram import json diff --git a/lib/ui/telegram/questions.v b/lib/ui/telegram/questions.v index a3bd3340..abc16dde 100644 --- a/lib/ui/telegram/questions.v +++ b/lib/ui/telegram/questions.v @@ -1,8 +1,8 @@ module telegram import os -import freeflowuniverse.herolib.ui.uimodel -// import freeflowuniverse.herolib.timetools +import incubaid.herolib.ui.uimodel +// import incubaid.herolib.timetools // // args: // // - description string diff --git a/lib/ui/template/console.v b/lib/ui/template/console.v index 68c71166..aaf136f1 100644 --- a/lib/ui/template/console.v +++ b/lib/ui/template/console.v @@ -1,6 +1,6 @@ module template -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console pub fn clear() { console.print_debug('\033[2J') diff --git a/lib/ui/template/dropdown.v b/lib/ui/template/dropdown.v index 250259f0..75c1a057 100644 --- a/lib/ui/template/dropdown.v +++ b/lib/ui/template/dropdown.v @@ -1,7 +1,7 @@ module template -// import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.ui.uimodel { DropDownArgs } +// import incubaid.herolib.ui.console +import incubaid.herolib.ui.uimodel { DropDownArgs } // return the dropdown as an int // description string diff --git a/lib/ui/template/question.v b/lib/ui/template/question.v index 25688928..98ee2d1f 100644 --- a/lib/ui/template/question.v +++ b/lib/ui/template/question.v @@ -1,8 +1,8 @@ module template // import os -import freeflowuniverse.herolib.ui.uimodel { QuestionArgs } -// import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.uimodel { QuestionArgs } +// import incubaid.herolib.ui.console // args: // - description string diff --git a/lib/ui/template/time_date.v b/lib/ui/template/time_date.v index efe1a068..276b7fff 100644 --- a/lib/ui/template/time_date.v +++ b/lib/ui/template/time_date.v @@ -1,6 +1,6 @@ module template -import freeflowuniverse.herolib.ui.uimodel { QuestionArgs } +import incubaid.herolib.ui.uimodel { QuestionArgs } pub fn (mut c UIExample) ask_date(args QuestionArgs) !string { panic('implement') diff --git a/lib/ui/template/yesno.v b/lib/ui/template/yesno.v index 05e0f970..53539918 100644 --- a/lib/ui/template/yesno.v +++ b/lib/ui/template/yesno.v @@ -1,6 +1,6 @@ module template -import freeflowuniverse.herolib.ui.uimodel { YesNoArgs } +import incubaid.herolib.ui.uimodel { YesNoArgs } // yes is true, no is false // args: diff --git a/lib/v.mod b/lib/v.mod index 0f67705a..f0ce4de8 100644 --- a/lib/v.mod +++ b/lib/v.mod @@ -1,6 +1,6 @@ Module { name: 'herolib' - author: 'freeflowuniverse' + author: 'incubaid' description: 'Set of various libraries' version: '0.1.0' repo_url: 'https://github.com/incubaid/herolib/herolib' diff --git a/lib/vfs/vfs_calendar/factory.v b/lib/vfs/vfs_calendar/factory.v index 6010366e..e4888bd8 100644 --- a/lib/vfs/vfs_calendar/factory.v +++ b/lib/vfs/vfs_calendar/factory.v @@ -1,7 +1,7 @@ module vfs_calendar -import freeflowuniverse.herolib.vfs -import freeflowuniverse.herolib.circles.mcc.db as core +import incubaid.herolib.vfs +import incubaid.herolib.circles.mcc.db as core // new creates a new calendar_db VFS instance pub fn new(calendar_db &core.CalendarDB) !vfs.VFSImplementation { diff --git a/lib/vfs/vfs_calendar/model_fsentry.v b/lib/vfs/vfs_calendar/model_fsentry.v index acc84249..1cf62a74 100644 --- a/lib/vfs/vfs_calendar/model_fsentry.v +++ b/lib/vfs/vfs_calendar/model_fsentry.v @@ -1,7 +1,7 @@ module vfs_calendar -import freeflowuniverse.herolib.vfs -import freeflowuniverse.herolib.circles.mcc.models as calendars +import incubaid.herolib.vfs +import incubaid.herolib.circles.mcc.models as calendars // CalendarFSEntry represents a file system entry in the calendar VFS pub struct CalendarFSEntry { diff --git a/lib/vfs/vfs_calendar/vfs_calendar.v b/lib/vfs/vfs_calendar/vfs_calendar.v index 763618bf..ee93b2c4 100644 --- a/lib/vfs/vfs_calendar/vfs_calendar.v +++ b/lib/vfs/vfs_calendar/vfs_calendar.v @@ -1,7 +1,7 @@ module vfs_calendar -import freeflowuniverse.herolib.vfs -import freeflowuniverse.herolib.circles.mcc.db as core +import incubaid.herolib.vfs +import incubaid.herolib.circles.mcc.db as core // CalendarVFS represents the virtual file system for calendar data // It provides a read-only view of calendar data organized by calendars diff --git a/lib/vfs/vfs_calendar/vfs_implementation.v b/lib/vfs/vfs_calendar/vfs_implementation.v index d7d450f4..635e6575 100644 --- a/lib/vfs/vfs_calendar/vfs_implementation.v +++ b/lib/vfs/vfs_calendar/vfs_implementation.v @@ -2,9 +2,9 @@ module vfs_calendar import json import time -import freeflowuniverse.herolib.vfs -import freeflowuniverse.herolib.circles.mcc.models as calendar -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.vfs +import incubaid.herolib.circles.mcc.models as calendar +import incubaid.herolib.core.texttools // Basic operations pub fn (mut myvfs CalendarVFS) root_get() !vfs.FSEntry { diff --git a/lib/vfs/vfs_calendar/vfs_implementation_test.v b/lib/vfs/vfs_calendar/vfs_implementation_test.v index dd1bf19a..c92e4ad5 100644 --- a/lib/vfs/vfs_calendar/vfs_implementation_test.v +++ b/lib/vfs/vfs_calendar/vfs_implementation_test.v @@ -1,9 +1,9 @@ module vfs_calendar -import freeflowuniverse.herolib.circles.mcc.models as calendar -import freeflowuniverse.herolib.circles.mcc.db as core -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.circles.base +import incubaid.herolib.circles.mcc.models as calendar +import incubaid.herolib.circles.mcc.db as core +import incubaid.herolib.data.ourtime +import incubaid.herolib.circles.base import json // get_sample_events provides a set of test events diff --git a/lib/vfs/vfs_contacts/README.md b/lib/vfs/vfs_contacts/README.md index cf4800a9..884adad0 100644 --- a/lib/vfs/vfs_contacts/README.md +++ b/lib/vfs/vfs_contacts/README.md @@ -30,6 +30,7 @@ The Contacts VFS implementation provides a read-only virtual file system interfa The Contacts VFS organizes contact groups as directories, with contacts as JSON files, browsable by name and email. **Example Structure**: + ``` /personal/ ├── by_name/ @@ -44,40 +45,41 @@ The Contacts VFS organizes contact groups as directories, with contacts as JSON ``` **Usage Example**: + ```v -import freeflowuniverse.herolib.vfs +import incubaid.herolib.vfs import vfs_contacts -import freeflowuniverse.herolib.circles.dbs.core +import incubaid.herolib.circles.dbs.core fn main() ! { // Setup mock database mut contacts_db := core.new_mock_contacts_db() contact1 := contacts.Contact{ - id: 1 + id: 1 first_name: 'John' last_name: 'Doe' email: 'john.doe@example.com' group: 'personal' created_at: 1698777600 modified_at: 1698777600 - } + } contact2 := contacts.Contact{ - id: 2 + id: 2 first_name: 'Said' last_name: 'Moaawad' email: 'said.moaawad@example.com' group: 'personal' created_at: 1698777600 modified_at: 1698777600 - } + } - // Add contacts to the database - contacts_db.set(contact1) or { panic(err) } - contacts_db.set(contact2) or { panic(err) } + // Add contacts to the database + contacts_db.set(contact1) or { panic(err) } + contacts_db.set(contact2) or { panic(err) } - // Create VFS instance - mut contacts_vfs := new(&contacts_db) or { panic(err) } + // Create VFS instance + mut contacts_vfs := new(&contacts_db) or { panic(err) } // List groups at root groups := contacts_vfs.dir_list('')! @@ -118,16 +120,19 @@ fn main() ! { The Contacts VFS implementation includes comprehensive unit tests in the `vfs_implementation_test.v` file. To run the tests: 1. **Navigate to the Module Directory**: + ```bash cd lib/vfs/vfs_contacts/ ``` 2. **Run Tests**: + ```bash v test . ``` The tests cover: + - Listing groups, subdirectories, and contact files - Reading contact file contents - Existence checks diff --git a/lib/vfs/vfs_contacts/factory.v b/lib/vfs/vfs_contacts/factory.v index 2e7937b0..3cac8da3 100644 --- a/lib/vfs/vfs_contacts/factory.v +++ b/lib/vfs/vfs_contacts/factory.v @@ -1,7 +1,7 @@ module vfs_contacts -import freeflowuniverse.herolib.vfs -import freeflowuniverse.herolib.circles.mcc.db as core +import incubaid.herolib.vfs +import incubaid.herolib.circles.mcc.db as core // new creates a new contacts_db VFS instance pub fn new(contacts_db &core.ContactsDB) !vfs.VFSImplementation { diff --git a/lib/vfs/vfs_contacts/model_fsentry.v b/lib/vfs/vfs_contacts/model_fsentry.v index 47c549d0..0f1e37a4 100644 --- a/lib/vfs/vfs_contacts/model_fsentry.v +++ b/lib/vfs/vfs_contacts/model_fsentry.v @@ -1,7 +1,7 @@ module vfs_contacts -import freeflowuniverse.herolib.vfs -import freeflowuniverse.herolib.circles.mcc.models as contacts +import incubaid.herolib.vfs +import incubaid.herolib.circles.mcc.models as contacts // ContactsFSEntry implements FSEntry for contacts objects pub struct ContactsFSEntry { diff --git a/lib/vfs/vfs_contacts/vfs_contacts.v b/lib/vfs/vfs_contacts/vfs_contacts.v index 9e23626f..808d0387 100644 --- a/lib/vfs/vfs_contacts/vfs_contacts.v +++ b/lib/vfs/vfs_contacts/vfs_contacts.v @@ -1,8 +1,8 @@ module vfs_contacts -import freeflowuniverse.herolib.vfs -import freeflowuniverse.herolib.circles.mcc.db as core -// import freeflowuniverse.herolib.circles.mcc.models as mcc +import incubaid.herolib.vfs +import incubaid.herolib.circles.mcc.db as core +// import incubaid.herolib.circles.mcc.models as mcc // ContactsVFS represents the virtual file system for contacts pub struct ContactsVFS { diff --git a/lib/vfs/vfs_contacts/vfs_implementation.v b/lib/vfs/vfs_contacts/vfs_implementation.v index 28cbfdfc..7febc89e 100644 --- a/lib/vfs/vfs_contacts/vfs_implementation.v +++ b/lib/vfs/vfs_contacts/vfs_implementation.v @@ -2,9 +2,9 @@ module vfs_contacts import json import time -import freeflowuniverse.herolib.vfs -import freeflowuniverse.herolib.circles.mcc.models as contacts -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.vfs +import incubaid.herolib.circles.mcc.models as contacts +import incubaid.herolib.core.texttools // Basic operations pub fn (mut myvfs ContactsVFS) root_get() !vfs.FSEntry { diff --git a/lib/vfs/vfs_contacts/vfs_implementation_test.v b/lib/vfs/vfs_contacts/vfs_implementation_test.v index 1142723c..0475b8ab 100644 --- a/lib/vfs/vfs_contacts/vfs_implementation_test.v +++ b/lib/vfs/vfs_contacts/vfs_implementation_test.v @@ -1,9 +1,9 @@ module vfs_contacts -import freeflowuniverse.herolib.circles.base -import freeflowuniverse.herolib.circles.mcc.db as core -import freeflowuniverse.herolib.circles.mcc.models as contacts -// import freeflowuniverse.herolib.circles.mcc.models +import incubaid.herolib.circles.base +import incubaid.herolib.circles.mcc.db as core +import incubaid.herolib.circles.mcc.models as contacts +// import incubaid.herolib.circles.mcc.models fn test_contacts_vfs() ! { // Create a session state diff --git a/lib/vfs/vfs_db/database_get.v b/lib/vfs/vfs_db/database_get.v index 151f8fd8..cc26dd05 100644 --- a/lib/vfs/vfs_db/database_get.v +++ b/lib/vfs/vfs_db/database_get.v @@ -1,9 +1,9 @@ module vfs_db import arrays -import freeflowuniverse.herolib.vfs -import freeflowuniverse.herolib.data.ourdb -import freeflowuniverse.herolib.data.encoder +import incubaid.herolib.vfs +import incubaid.herolib.data.ourdb +import incubaid.herolib.data.encoder import time import log diff --git a/lib/vfs/vfs_db/database_get_test.v b/lib/vfs/vfs_db/database_get_test.v index 7824f47f..f7cd756b 100644 --- a/lib/vfs/vfs_db/database_get_test.v +++ b/lib/vfs/vfs_db/database_get_test.v @@ -1,8 +1,8 @@ module vfs_db import os -import freeflowuniverse.herolib.data.ourdb -import freeflowuniverse.herolib.vfs as vfs_mod +import incubaid.herolib.data.ourdb +import incubaid.herolib.vfs as vfs_mod import rand fn setup_vfs() !(&DatabaseVFS, string) { diff --git a/lib/vfs/vfs_db/database_set.v b/lib/vfs/vfs_db/database_set.v index e4b3a8d0..cc469046 100644 --- a/lib/vfs/vfs_db/database_set.v +++ b/lib/vfs/vfs_db/database_set.v @@ -1,9 +1,9 @@ module vfs_db import arrays -import freeflowuniverse.herolib.vfs -import freeflowuniverse.herolib.data.ourdb -import freeflowuniverse.herolib.data.encoder +import incubaid.herolib.vfs +import incubaid.herolib.data.ourdb +import incubaid.herolib.data.encoder import time import log diff --git a/lib/vfs/vfs_db/decode.v b/lib/vfs/vfs_db/decode.v index f2c67ecb..b703966e 100644 --- a/lib/vfs/vfs_db/decode.v +++ b/lib/vfs/vfs_db/decode.v @@ -1,7 +1,7 @@ module vfs_db -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.vfs +import incubaid.herolib.data.encoder +import incubaid.herolib.vfs // decode_directory decodes a binary format back to Directory pub fn decode_directory(data []u8) !Directory { diff --git a/lib/vfs/vfs_db/encode.v b/lib/vfs/vfs_db/encode.v index 192f446a..3724e3b0 100644 --- a/lib/vfs/vfs_db/encode.v +++ b/lib/vfs/vfs_db/encode.v @@ -1,7 +1,7 @@ module vfs_db -import freeflowuniverse.herolib.data.encoder -import freeflowuniverse.herolib.vfs +import incubaid.herolib.data.encoder +import incubaid.herolib.vfs // encode_metadata encodes the common metadata structure fn encode_metadata(mut e encoder.Encoder, m vfs.Metadata) { diff --git a/lib/vfs/vfs_db/encode_test.v b/lib/vfs/vfs_db/encode_test.v index 2270190b..fedc890c 100644 --- a/lib/vfs/vfs_db/encode_test.v +++ b/lib/vfs/vfs_db/encode_test.v @@ -2,7 +2,7 @@ module vfs_db import os import time -import freeflowuniverse.herolib.vfs +import incubaid.herolib.vfs fn test_directory_encoder_decoder() ! { println('Testing encoding/decoding directories...') diff --git a/lib/vfs/vfs_db/factory_test.v b/lib/vfs/vfs_db/factory_test.v index 3b6486a5..ddc5ddf6 100644 --- a/lib/vfs/vfs_db/factory_test.v +++ b/lib/vfs/vfs_db/factory_test.v @@ -1,7 +1,7 @@ module vfs_db import os -import freeflowuniverse.herolib.data.ourdb +import incubaid.herolib.data.ourdb import rand fn test_new() { diff --git a/lib/vfs/vfs_db/model_directory.v b/lib/vfs/vfs_db/model_directory.v index 6f9a87da..854ed53a 100644 --- a/lib/vfs/vfs_db/model_directory.v +++ b/lib/vfs/vfs_db/model_directory.v @@ -1,6 +1,6 @@ module vfs_db -import freeflowuniverse.herolib.vfs +import incubaid.herolib.vfs // Directory represents a directory in the virtual filesystem pub struct Directory { diff --git a/lib/vfs/vfs_db/model_directory_test.v b/lib/vfs/vfs_db/model_directory_test.v index eddab001..b905aaa2 100644 --- a/lib/vfs/vfs_db/model_directory_test.v +++ b/lib/vfs/vfs_db/model_directory_test.v @@ -1,6 +1,6 @@ module vfs_db -import freeflowuniverse.herolib.vfs as vfs_mod +import incubaid.herolib.vfs as vfs_mod fn test_directory_get_metadata() { // Create a directory with metadata diff --git a/lib/vfs/vfs_db/model_file.v b/lib/vfs/vfs_db/model_file.v index 11632153..57185ee0 100644 --- a/lib/vfs/vfs_db/model_file.v +++ b/lib/vfs/vfs_db/model_file.v @@ -1,6 +1,6 @@ module vfs_db -import freeflowuniverse.herolib.vfs +import incubaid.herolib.vfs // File represents a file in the virtual filesystem pub struct File { diff --git a/lib/vfs/vfs_db/model_file_test.v b/lib/vfs/vfs_db/model_file_test.v index 19a57ab0..1fe30d29 100644 --- a/lib/vfs/vfs_db/model_file_test.v +++ b/lib/vfs/vfs_db/model_file_test.v @@ -1,8 +1,8 @@ module vfs_db -import freeflowuniverse.herolib.vfs as vfs_mod +import incubaid.herolib.vfs as vfs_mod import os -import freeflowuniverse.herolib.data.ourdb +import incubaid.herolib.data.ourdb import rand fn setup_vfs() !&DatabaseVFS { diff --git a/lib/vfs/vfs_db/model_fsentry.v b/lib/vfs/vfs_db/model_fsentry.v index 0eccbb26..375fc036 100644 --- a/lib/vfs/vfs_db/model_fsentry.v +++ b/lib/vfs/vfs_db/model_fsentry.v @@ -1,6 +1,6 @@ module vfs_db -import freeflowuniverse.herolib.vfs +import incubaid.herolib.vfs // FSEntry represents any type of filesystem entry pub type FSEntry = Directory | File | Symlink diff --git a/lib/vfs/vfs_db/model_fsentry_test.v b/lib/vfs/vfs_db/model_fsentry_test.v index ee792404..cc7fa576 100644 --- a/lib/vfs/vfs_db/model_fsentry_test.v +++ b/lib/vfs/vfs_db/model_fsentry_test.v @@ -1,6 +1,6 @@ module vfs_db -import freeflowuniverse.herolib.vfs as vfs_mod +import incubaid.herolib.vfs as vfs_mod fn test_fsentry_directory() { // Create a directory entry diff --git a/lib/vfs/vfs_db/model_symlink.v b/lib/vfs/vfs_db/model_symlink.v index 1d076350..32feea6e 100644 --- a/lib/vfs/vfs_db/model_symlink.v +++ b/lib/vfs/vfs_db/model_symlink.v @@ -1,6 +1,6 @@ module vfs_db -import freeflowuniverse.herolib.vfs +import incubaid.herolib.vfs // Symlink represents a symbolic link in the virtual filesystem pub struct Symlink { diff --git a/lib/vfs/vfs_db/model_symlink_test.v b/lib/vfs/vfs_db/model_symlink_test.v index 52ad94c2..66ec4bcd 100644 --- a/lib/vfs/vfs_db/model_symlink_test.v +++ b/lib/vfs/vfs_db/model_symlink_test.v @@ -1,6 +1,6 @@ module vfs_db -import freeflowuniverse.herolib.vfs as vfs_mod +import incubaid.herolib.vfs as vfs_mod fn test_symlink_get_metadata() { // Create a symlink with metadata diff --git a/lib/vfs/vfs_db/readme.md b/lib/vfs/vfs_db/readme.md index ea66ecfb..c9051d90 100644 --- a/lib/vfs/vfs_db/readme.md +++ b/lib/vfs/vfs_db/readme.md @@ -14,6 +14,7 @@ A virtual filesystem implementation that uses OurDB as its storage backend, prov ## Implementation Details ### Structure + ``` vfs_db/ ├── factory.v # VFS factory implementation @@ -33,6 +34,7 @@ vfs_db/ ### Key Components - `DatabaseVFS`: Main implementation struct + ```v pub struct DatabaseVFS { pub mut: @@ -46,6 +48,7 @@ pub mut: ``` - `FSEntry` implementations: + ```v pub type FSEntry = Directory | File | Symlink ``` @@ -53,6 +56,7 @@ pub type FSEntry = Directory | File | Symlink ### Data Storage #### Metadata Structure + ```v struct Metadata { id u32 // Unique identifier @@ -69,6 +73,7 @@ struct Metadata { ``` #### Database Interface + ```v pub interface Database { mut: @@ -81,7 +86,7 @@ mut: ## Usage ```v -import freeflowuniverse.herolib.vfs.vfs_db +import incubaid.herolib.vfs.vfs_db // Create separate databases for data and metadata mut db_data := ourdb.new( @@ -148,6 +153,7 @@ fs.destroy()! ## Testing The implementation includes tests for: + - Basic operations (create, read, write, delete) - Directory operations and traversal - Symlink handling @@ -157,6 +163,7 @@ The implementation includes tests for: - Data consistency Run tests with: + ```bash v test vfs/vfs_db/ ``` diff --git a/lib/vfs/vfs_db/vfs_directory.v b/lib/vfs/vfs_db/vfs_directory.v index 69e56a3c..ed006eec 100644 --- a/lib/vfs/vfs_db/vfs_directory.v +++ b/lib/vfs/vfs_db/vfs_directory.v @@ -1,6 +1,6 @@ module vfs_db -import freeflowuniverse.herolib.vfs { Metadata } +import incubaid.herolib.vfs { Metadata } import time import log diff --git a/lib/vfs/vfs_db/vfs_directory_test.v b/lib/vfs/vfs_db/vfs_directory_test.v index 70448ab9..bb7ea496 100644 --- a/lib/vfs/vfs_db/vfs_directory_test.v +++ b/lib/vfs/vfs_db/vfs_directory_test.v @@ -1,8 +1,8 @@ module vfs_db import os -import freeflowuniverse.herolib.data.ourdb -import freeflowuniverse.herolib.vfs as vfs_mod +import incubaid.herolib.data.ourdb +import incubaid.herolib.vfs as vfs_mod import rand fn setup_fs() !(&DatabaseVFS, string) { diff --git a/lib/vfs/vfs_db/vfs_implementation.v b/lib/vfs/vfs_db/vfs_implementation.v index 9a619368..42db98f6 100644 --- a/lib/vfs/vfs_db/vfs_implementation.v +++ b/lib/vfs/vfs_db/vfs_implementation.v @@ -1,7 +1,7 @@ module vfs_db -import freeflowuniverse.herolib.vfs -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.vfs +import incubaid.herolib.core.texttools import arrays import log import os diff --git a/lib/vfs/vfs_db/vfs_implementation_test.v b/lib/vfs/vfs_db/vfs_implementation_test.v index 768ce5ad..947413c7 100644 --- a/lib/vfs/vfs_db/vfs_implementation_test.v +++ b/lib/vfs/vfs_db/vfs_implementation_test.v @@ -1,7 +1,7 @@ module vfs_db import os -import freeflowuniverse.herolib.data.ourdb +import incubaid.herolib.data.ourdb import rand fn setup_vfs() !(&DatabaseVFS, string) { diff --git a/lib/vfs/vfs_db/vfs_print_test.v b/lib/vfs/vfs_db/vfs_print_test.v index f8924d89..92d7490b 100644 --- a/lib/vfs/vfs_db/vfs_print_test.v +++ b/lib/vfs/vfs_db/vfs_print_test.v @@ -1,8 +1,8 @@ module vfs_db import os -import freeflowuniverse.herolib.data.ourdb -import freeflowuniverse.herolib.vfs as vfs_mod +import incubaid.herolib.data.ourdb +import incubaid.herolib.vfs as vfs_mod import rand fn setup_fs() !(&DatabaseVFS, string) { diff --git a/lib/vfs/vfs_db/vfs_test.v b/lib/vfs/vfs_db/vfs_test.v index ec3f872e..cc4380fb 100644 --- a/lib/vfs/vfs_db/vfs_test.v +++ b/lib/vfs/vfs_db/vfs_test.v @@ -1,9 +1,9 @@ module vfs_db import os -import freeflowuniverse.herolib.data.ourdb +import incubaid.herolib.data.ourdb import rand -import freeflowuniverse.herolib.vfs as vfs_mod +import incubaid.herolib.vfs as vfs_mod fn setup_vfs() !(&DatabaseVFS, string) { test_data_dir := os.join_path(os.temp_dir(), 'vfsourdb_vfs_test_${rand.string(3)}') diff --git a/lib/vfs/vfs_local/factory.v b/lib/vfs/vfs_local/factory.v index 76231147..3764a139 100644 --- a/lib/vfs/vfs_local/factory.v +++ b/lib/vfs/vfs_local/factory.v @@ -1,7 +1,7 @@ module vfs_local import os -import freeflowuniverse.herolib.vfs +import incubaid.herolib.vfs // LocalVFS implements vfs.VFSImplementation for local filesystem pub struct LocalVFS { diff --git a/lib/vfs/vfs_local/model_fsentry.v b/lib/vfs/vfs_local/model_fsentry.v index 2d37bcfc..ddeb4ba7 100644 --- a/lib/vfs/vfs_local/model_fsentry.v +++ b/lib/vfs/vfs_local/model_fsentry.v @@ -1,6 +1,6 @@ module vfs_local -import freeflowuniverse.herolib.vfs +import incubaid.herolib.vfs // LocalFSEntry implements FSEntry for local filesystem struct LocalFSEntry { diff --git a/lib/vfs/vfs_local/vfs_implementation.v b/lib/vfs/vfs_local/vfs_implementation.v index e642256e..72b416bb 100644 --- a/lib/vfs/vfs_local/vfs_implementation.v +++ b/lib/vfs/vfs_local/vfs_implementation.v @@ -1,7 +1,7 @@ module vfs_local import os -import freeflowuniverse.herolib.vfs +import incubaid.herolib.vfs // Basic operations pub fn (myvfs LocalVFS) root_get() !vfs.FSEntry { diff --git a/lib/vfs/vfs_local/vfs_local.v b/lib/vfs/vfs_local/vfs_local.v index 0d50f466..80ab2f3c 100644 --- a/lib/vfs/vfs_local/vfs_local.v +++ b/lib/vfs/vfs_local/vfs_local.v @@ -1,7 +1,7 @@ module vfs_local import os -import freeflowuniverse.herolib.vfs +import incubaid.herolib.vfs // Convert path to vfs.Metadata with improved security and information gathering fn (myvfs LocalVFS) os_attr_to_metadata(path string) !vfs.Metadata { diff --git a/lib/vfs/vfs_mail/factory.v b/lib/vfs/vfs_mail/factory.v index c47bfa26..33623437 100644 --- a/lib/vfs/vfs_mail/factory.v +++ b/lib/vfs/vfs_mail/factory.v @@ -1,7 +1,7 @@ module vfs_mail -import freeflowuniverse.herolib.vfs -import freeflowuniverse.herolib.circles.mcc.db as core +import incubaid.herolib.vfs +import incubaid.herolib.circles.mcc.db as core // new creates a new mail VFS instance pub fn new(mail_db &core.MailDB) !vfs.VFSImplementation { diff --git a/lib/vfs/vfs_mail/model_fsentry.v b/lib/vfs/vfs_mail/model_fsentry.v index 565e5459..42d7df48 100644 --- a/lib/vfs/vfs_mail/model_fsentry.v +++ b/lib/vfs/vfs_mail/model_fsentry.v @@ -1,7 +1,7 @@ module vfs_mail -import freeflowuniverse.herolib.vfs -import freeflowuniverse.herolib.circles.mcc.models as mail +import incubaid.herolib.vfs +import incubaid.herolib.circles.mcc.models as mail // MailFSEntry implements FSEntry for mail objects pub struct MailFSEntry { diff --git a/lib/vfs/vfs_mail/vfs_implementation.v b/lib/vfs/vfs_mail/vfs_implementation.v index 35cde6b9..ca813d5a 100644 --- a/lib/vfs/vfs_mail/vfs_implementation.v +++ b/lib/vfs/vfs_mail/vfs_implementation.v @@ -2,9 +2,9 @@ module vfs_mail import json import time -import freeflowuniverse.herolib.vfs -import freeflowuniverse.herolib.circles.mcc.models as mail -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.vfs +import incubaid.herolib.circles.mcc.models as mail +import incubaid.herolib.core.texttools // Basic operations pub fn (mut myvfs MailVFS) root_get() !vfs.FSEntry { diff --git a/lib/vfs/vfs_mail/vfs_implementation_test.v b/lib/vfs/vfs_mail/vfs_implementation_test.v index bd80de18..c27706c0 100644 --- a/lib/vfs/vfs_mail/vfs_implementation_test.v +++ b/lib/vfs/vfs_mail/vfs_implementation_test.v @@ -1,10 +1,10 @@ module vfs_mail -import freeflowuniverse.herolib.vfs -// import freeflowuniverse.herolib.circles.mcc.models -import freeflowuniverse.herolib.circles.mcc.models as mail -import freeflowuniverse.herolib.circles.mcc.db as core -import freeflowuniverse.herolib.circles.base +import incubaid.herolib.vfs +// import incubaid.herolib.circles.mcc.models +import incubaid.herolib.circles.mcc.models as mail +import incubaid.herolib.circles.mcc.db as core +import incubaid.herolib.circles.base import json import time diff --git a/lib/vfs/vfs_mail/vfs_mail.v b/lib/vfs/vfs_mail/vfs_mail.v index 3120dac6..302a60b1 100644 --- a/lib/vfs/vfs_mail/vfs_mail.v +++ b/lib/vfs/vfs_mail/vfs_mail.v @@ -1,7 +1,7 @@ module vfs_mail -import freeflowuniverse.herolib.vfs -import freeflowuniverse.herolib.circles.mcc.db as core +import incubaid.herolib.vfs +import incubaid.herolib.circles.mcc.db as core // MailVFS implements the VFS interface for mail objects pub struct MailVFS { diff --git a/lib/vfs/vfs_nested/nested_test.v b/lib/vfs/vfs_nested/nested_test.v index f1b68c3c..be7c5028 100644 --- a/lib/vfs/vfs_nested/nested_test.v +++ b/lib/vfs/vfs_nested/nested_test.v @@ -1,6 +1,6 @@ module vfs_nested -import freeflowuniverse.herolib.vfs.vfs_local +import incubaid.herolib.vfs.vfs_local import os fn test_nested() ! { diff --git a/lib/vfs/vfs_nested/vfsnested.v b/lib/vfs/vfs_nested/vfsnested.v index 1d3ed21b..a7560917 100644 --- a/lib/vfs/vfs_nested/vfsnested.v +++ b/lib/vfs/vfs_nested/vfsnested.v @@ -1,6 +1,6 @@ module vfs_nested -import freeflowuniverse.herolib.vfs +import incubaid.herolib.vfs import time // NestedVFS represents a VFS that can contain multiple nested VFS instances diff --git a/lib/virt/cloudhypervisor/chv_factory.v b/lib/virt/cloudhypervisor/chv_factory.v index 22e43b24..cb2dc043 100644 --- a/lib/virt/cloudhypervisor/chv_factory.v +++ b/lib/virt/cloudhypervisor/chv_factory.v @@ -1,7 +1,7 @@ module cloudhypervisor -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.installers.virt.cloudhypervisor as cloudhypervisorinstaller +import incubaid.herolib.ui.console +import incubaid.herolib.installers.virt.cloudhypervisor as cloudhypervisorinstaller import os @[heap] diff --git a/lib/virt/crun/factory.v b/lib/virt/crun/factory.v index 8fdc99b3..5ab1d342 100644 --- a/lib/virt/crun/factory.v +++ b/lib/virt/crun/factory.v @@ -1,6 +1,6 @@ module crun -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.texttools @[params] pub struct FactoryArgs { diff --git a/lib/virt/crun/tojson.v b/lib/virt/crun/tojson.v index 1a3c1f04..f9cd09aa 100644 --- a/lib/virt/crun/tojson.v +++ b/lib/virt/crun/tojson.v @@ -1,7 +1,7 @@ module crun import json -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib // Simple JSON generation using V's built-in json module pub fn (config CrunConfig) to_json() !string { diff --git a/lib/virt/docker/docker_build_args.v b/lib/virt/docker/docker_build_args.v index 4eba5393..41af9351 100644 --- a/lib/virt/docker/docker_build_args.v +++ b/lib/virt/docker/docker_build_args.v @@ -1,6 +1,6 @@ module docker -import freeflowuniverse.herolib.data.paramsparser { Params } +import incubaid.herolib.data.paramsparser { Params } @[params] pub struct BuildArgs { diff --git a/lib/virt/docker/docker_compose.v b/lib/virt/docker/docker_compose.v index b9861c6e..c579cff2 100644 --- a/lib/virt/docker/docker_compose.v +++ b/lib/virt/docker/docker_compose.v @@ -1,10 +1,10 @@ module docker -import freeflowuniverse.herolib.data.paramsparser { Params } -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.osal.core as osal { exec, file_write } +import incubaid.herolib.data.paramsparser { Params } +import incubaid.herolib.core.texttools +import incubaid.herolib.osal.core as osal { exec, file_write } import os -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console @[heap] pub struct DockerComposeRecipe { diff --git a/lib/virt/docker/docker_compose_service.v b/lib/virt/docker/docker_compose_service.v index 88afd586..6cfd3753 100644 --- a/lib/virt/docker/docker_compose_service.v +++ b/lib/virt/docker/docker_compose_service.v @@ -1,7 +1,7 @@ module docker import v.embed_file -import freeflowuniverse.herolib.data.paramsparser { Params } +import incubaid.herolib.data.paramsparser { Params } @[heap] pub struct ComposeService { diff --git a/lib/virt/docker/docker_container.v b/lib/virt/docker/docker_container.v index 452a0435..05bd4620 100644 --- a/lib/virt/docker/docker_container.v +++ b/lib/virt/docker/docker_container.v @@ -1,10 +1,10 @@ module docker import time -import freeflowuniverse.herolib.osal.core as osal { exec } -import freeflowuniverse.herolib.data.ipaddress { IPAddress } -import freeflowuniverse.herolib.virt.utils -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.osal.core as osal { exec } +import incubaid.herolib.data.ipaddress { IPAddress } +import incubaid.herolib.virt.utils +import incubaid.herolib.ui.console // pub enum DockerContainerStatus { // up diff --git a/lib/virt/docker/docker_container_create.v b/lib/virt/docker/docker_container_create.v index 33980faf..0c1ebe79 100644 --- a/lib/virt/docker/docker_container_create.v +++ b/lib/virt/docker/docker_container_create.v @@ -1,7 +1,7 @@ module docker -import freeflowuniverse.herolib.osal.core as osal { exec } -import freeflowuniverse.herolib.virt.utils +import incubaid.herolib.osal.core as osal { exec } +import incubaid.herolib.virt.utils @[params] pub struct DockerContainerCreateArgs { diff --git a/lib/virt/docker/docker_engine.v b/lib/virt/docker/docker_engine.v index 8e29211d..05c27fd1 100644 --- a/lib/virt/docker/docker_engine.v +++ b/lib/virt/docker/docker_engine.v @@ -1,12 +1,12 @@ module docker -import freeflowuniverse.herolib.osal.core as osal { exec } -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.virt.utils -import freeflowuniverse.herolib.core +import incubaid.herolib.osal.core as osal { exec } +import incubaid.herolib.core.texttools +import incubaid.herolib.virt.utils +import incubaid.herolib.core import time -// import freeflowuniverse.herolib.installers.swarm +// import incubaid.herolib.installers.swarm // https://docs.docker.com/reference/ diff --git a/lib/virt/docker/docker_image.v b/lib/virt/docker/docker_image.v index d9887190..74f66469 100644 --- a/lib/virt/docker/docker_image.v +++ b/lib/virt/docker/docker_image.v @@ -1,8 +1,8 @@ module docker import time -import freeflowuniverse.herolib.osal.core as osal { exec } -import freeflowuniverse.herolib.virt.utils +import incubaid.herolib.osal.core as osal { exec } +import incubaid.herolib.virt.utils @[heap] pub struct DockerImage { diff --git a/lib/virt/docker/docker_recipe.v b/lib/virt/docker/docker_recipe.v index 7a23f36c..2fa3f9b0 100644 --- a/lib/virt/docker/docker_recipe.v +++ b/lib/virt/docker/docker_recipe.v @@ -1,12 +1,12 @@ module docker -import freeflowuniverse.herolib.data.paramsparser { Params } -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.osal.core as osal { exec, file_write } +import incubaid.herolib.data.paramsparser { Params } +import incubaid.herolib.core.texttools +import incubaid.herolib.osal.core as osal { exec, file_write } import crypto.md5 import v.embed_file import os -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console // only 2 supported for now pub enum PlatformType { diff --git a/lib/virt/docker/docker_recipe_addfile_embedded.v b/lib/virt/docker/docker_recipe_addfile_embedded.v index 255d595b..c2e9fa12 100644 --- a/lib/virt/docker/docker_recipe_addfile_embedded.v +++ b/lib/virt/docker/docker_recipe_addfile_embedded.v @@ -1,6 +1,6 @@ module docker -import freeflowuniverse.herolib.osal.core as osal { file_read } +import incubaid.herolib.osal.core as osal { file_read } @[params] pub struct AddFileEmbeddedArgs { diff --git a/lib/virt/docker/docker_recipe_code.v b/lib/virt/docker/docker_recipe_code.v index 0cb5d916..39cab89b 100644 --- a/lib/virt/docker/docker_recipe_code.v +++ b/lib/virt/docker/docker_recipe_code.v @@ -1,8 +1,8 @@ module docker -import freeflowuniverse.herolib.develop.gittools -import freeflowuniverse.herolib.ui.console -// import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.develop.gittools +import incubaid.herolib.ui.console +// import incubaid.herolib.core.pathlib @[params] pub struct CodeGetArgs { diff --git a/lib/virt/docker/docker_recipe_code_rustbuilder.v b/lib/virt/docker/docker_recipe_code_rustbuilder.v index 957ba975..a713dd2d 100644 --- a/lib/virt/docker/docker_recipe_code_rustbuilder.v +++ b/lib/virt/docker/docker_recipe_code_rustbuilder.v @@ -1,7 +1,7 @@ module docker -// import freeflowuniverse.herolib.develop.gittools -// import freeflowuniverse.herolib.core.pathlib +// import incubaid.herolib.develop.gittools +// import incubaid.herolib.core.pathlib @[params] pub struct RustBuildArgs { diff --git a/lib/virt/docker/docker_recipe_download.v b/lib/virt/docker/docker_recipe_download.v index 9159eaa4..5fb0c2c3 100644 --- a/lib/virt/docker/docker_recipe_download.v +++ b/lib/virt/docker/docker_recipe_download.v @@ -1,7 +1,7 @@ module docker -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.osal.core as osal { download } +import incubaid.herolib.core.pathlib +import incubaid.herolib.osal.core as osal { download } @[params] pub struct DownloadArgs { diff --git a/lib/virt/docker/docker_recipe_entrypoint.v b/lib/virt/docker/docker_recipe_entrypoint.v index d501d33e..fbb565c1 100644 --- a/lib/virt/docker/docker_recipe_entrypoint.v +++ b/lib/virt/docker/docker_recipe_entrypoint.v @@ -1,6 +1,6 @@ module docker -// import freeflowuniverse.herolib.builder +// import incubaid.herolib.builder @[params] pub struct EntryPointArgs { diff --git a/lib/virt/docker/docker_recipe_package.v b/lib/virt/docker/docker_recipe_package.v index e36920e6..7917180c 100644 --- a/lib/virt/docker/docker_recipe_package.v +++ b/lib/virt/docker/docker_recipe_package.v @@ -1,6 +1,6 @@ module docker -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console @[params] pub struct PackageArgs { diff --git a/lib/virt/docker/docker_recipe_run.v b/lib/virt/docker/docker_recipe_run.v index 5c0148b7..38e158c0 100644 --- a/lib/virt/docker/docker_recipe_run.v +++ b/lib/virt/docker/docker_recipe_run.v @@ -1,6 +1,6 @@ module docker -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.texttools @[params] pub struct RunArgs { diff --git a/lib/virt/docker/docker_recipe_snippets.v b/lib/virt/docker/docker_recipe_snippets.v index 711da8d2..61651a09 100644 --- a/lib/virt/docker/docker_recipe_snippets.v +++ b/lib/virt/docker/docker_recipe_snippets.v @@ -1,7 +1,7 @@ module docker -// import freeflowuniverse.herolib.develop.gittools -// import freeflowuniverse.herolib.core.pathlib +// import incubaid.herolib.develop.gittools +// import incubaid.herolib.core.pathlib pub fn (mut r DockerBuilderRecipe) add_zinit() ! { mut pkg_manager := 'apk add' diff --git a/lib/virt/docker/docker_recipe_writefile.v b/lib/virt/docker/docker_recipe_writefile.v index da3bf0e4..c26a688c 100644 --- a/lib/virt/docker/docker_recipe_writefile.v +++ b/lib/virt/docker/docker_recipe_writefile.v @@ -1,7 +1,7 @@ module docker -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.texttools +import incubaid.herolib.core.pathlib @[params] pub struct WriteFileArgs { diff --git a/lib/virt/docker/docker_recipe_zinit.v b/lib/virt/docker/docker_recipe_zinit.v index 66d22801..f3350227 100644 --- a/lib/virt/docker/docker_recipe_zinit.v +++ b/lib/virt/docker/docker_recipe_zinit.v @@ -1,7 +1,7 @@ module docker -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.pathlib +import incubaid.herolib.core.texttools pub struct ZinitItem { pub mut: diff --git a/lib/virt/docker/docker_registry.v b/lib/virt/docker/docker_registry.v index 9f3e94e5..c45c8311 100644 --- a/lib/virt/docker/docker_registry.v +++ b/lib/virt/docker/docker_registry.v @@ -1,10 +1,10 @@ module docker -import freeflowuniverse.herolib.crypt.openssl -import freeflowuniverse.herolib.core.httpconnection -import freeflowuniverse.herolib.osal.core as osal +import incubaid.herolib.crypt.openssl +import incubaid.herolib.core.httpconnection +import incubaid.herolib.osal.core as osal import os -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console @[heap] pub struct DockerRegistry { diff --git a/lib/virt/docker/docker_test.v b/lib/virt/docker/docker_test.v index ccd8ee1b..9181891e 100644 --- a/lib/virt/docker/docker_test.v +++ b/lib/virt/docker/docker_test.v @@ -1,6 +1,6 @@ module docker -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console fn test_docker1() { // mut engine := engine_local([]) or { panic(err) } diff --git a/lib/virt/heropods/container.v b/lib/virt/heropods/container.v index a01009c3..4a3d5306 100644 --- a/lib/virt/heropods/container.v +++ b/lib/virt/heropods/container.v @@ -1,11 +1,11 @@ module heropods -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.osal.tmux -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.virt.crun +import incubaid.herolib.ui.console +import incubaid.herolib.osal.tmux +import incubaid.herolib.osal.core as osal +import incubaid.herolib.virt.crun import time -import freeflowuniverse.herolib.builder +import incubaid.herolib.builder import json @[heap] diff --git a/lib/virt/heropods/container_create.v b/lib/virt/heropods/container_create.v index 66fec4fc..015b15cd 100644 --- a/lib/virt/heropods/container_create.v +++ b/lib/virt/heropods/container_create.v @@ -1,9 +1,9 @@ module heropods -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.virt.crun -import freeflowuniverse.herolib.installers.virt.herorunner as herorunner_installer +import incubaid.herolib.ui.console +import incubaid.herolib.osal.core as osal +import incubaid.herolib.virt.crun +import incubaid.herolib.installers.virt.herorunner as herorunner_installer import os // Updated enum to be more flexible diff --git a/lib/virt/heropods/container_image.v b/lib/virt/heropods/container_image.v index ab8d4037..d0db37f6 100644 --- a/lib/virt/heropods/container_image.v +++ b/lib/virt/heropods/container_image.v @@ -1,9 +1,9 @@ module heropods -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.ui.console +import incubaid.herolib.osal.core as osal +import incubaid.herolib.core.pathlib +import incubaid.herolib.core.texttools import os import json diff --git a/lib/virt/heropods/factory.v b/lib/virt/heropods/factory.v index bfd21019..494d5f42 100644 --- a/lib/virt/heropods/factory.v +++ b/lib/virt/heropods/factory.v @@ -1,8 +1,8 @@ module heropods -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.virt.crun +import incubaid.herolib.ui.console +import incubaid.herolib.osal.core as osal +import incubaid.herolib.virt.crun import os @[heap] diff --git a/lib/virt/herorun2/README.md b/lib/virt/herorun2/README.md index 7c22a4aa..c46be90e 100644 --- a/lib/virt/herorun2/README.md +++ b/lib/virt/herorun2/README.md @@ -28,7 +28,7 @@ lib/virt/herorun/ ### Basic Example ```v -import freeflowuniverse.herolib.virt.herorun +import incubaid.herolib.virt.herorun // Create user with SSH key mut user := herorun.new_user(keyname: 'id_ed25519')! @@ -92,10 +92,10 @@ chmod +x examples/virt/herorun/herorun.vsh ## Dependencies -- `freeflowuniverse.herolib.osal.sshagent` -- `freeflowuniverse.herolib.osal.tmux` -- `freeflowuniverse.herolib.installers.web.hetznermanager` -- `freeflowuniverse.herolib.ui.console` +- `incubaid.herolib.osal.sshagent` +- `incubaid.herolib.osal.tmux` +- `incubaid.herolib.installers.web.hetznermanager` +- `incubaid.herolib.ui.console` ## Future Enhancements diff --git a/lib/virt/herorun2/container.v b/lib/virt/herorun2/container.v index 17d21d6e..be379877 100644 --- a/lib/virt/herorun2/container.v +++ b/lib/virt/herorun2/container.v @@ -1,7 +1,7 @@ module herorun2 -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.osal.tmux +import incubaid.herolib.ui.console +import incubaid.herolib.osal.tmux import time // Container struct and related functionality diff --git a/lib/virt/herorun2/executor.v b/lib/virt/herorun2/executor.v index 1c9036a6..fa88bbfa 100644 --- a/lib/virt/herorun2/executor.v +++ b/lib/virt/herorun2/executor.v @@ -1,8 +1,8 @@ module herorun2 -import freeflowuniverse.herolib.osal.tmux -import freeflowuniverse.herolib.osal.sshagent -import freeflowuniverse.herolib.osal.core as osal +import incubaid.herolib.osal.tmux +import incubaid.herolib.osal.sshagent +import incubaid.herolib.osal.core as osal import time import os diff --git a/lib/virt/herorun2/factory.v b/lib/virt/herorun2/factory.v index a8794207..c5d92cef 100644 --- a/lib/virt/herorun2/factory.v +++ b/lib/virt/herorun2/factory.v @@ -1,6 +1,6 @@ module herorun2 -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console // Provider types pub enum Provider { diff --git a/lib/virt/herorun2/hetzner_backend.v b/lib/virt/herorun2/hetzner_backend.v index 15422bdf..1f36c61f 100644 --- a/lib/virt/herorun2/hetzner_backend.v +++ b/lib/virt/herorun2/hetzner_backend.v @@ -1,8 +1,8 @@ module herorun2 import os -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.osal.tmux +import incubaid.herolib.ui.console +import incubaid.herolib.osal.tmux // HetznerBackend implements NodeBackend for Hetzner cloud servers pub struct HetznerBackend { diff --git a/lib/virt/herorun2/installer.v b/lib/virt/herorun2/installer.v index d52600d6..4f66f483 100644 --- a/lib/virt/herorun2/installer.v +++ b/lib/virt/herorun2/installer.v @@ -1,6 +1,6 @@ module herorun2 -import freeflowuniverse.herolib.osal.core as osal +import incubaid.herolib.osal.core as osal // Package installer functions for herorun dependencies // Each function installs a specific package on the remote node diff --git a/lib/virt/herorun2/nodes.v b/lib/virt/herorun2/nodes.v index 4e285132..da612e1e 100644 --- a/lib/virt/herorun2/nodes.v +++ b/lib/virt/herorun2/nodes.v @@ -1,6 +1,6 @@ module herorun2 -import freeflowuniverse.herolib.osal.sshagent +import incubaid.herolib.osal.sshagent // Node-related structs and functionality pub struct NodeSettings { diff --git a/lib/virt/hetznermanager/actions_key.v b/lib/virt/hetznermanager/actions_key.v index 9a99f276..e0fa9b5e 100644 --- a/lib/virt/hetznermanager/actions_key.v +++ b/lib/virt/hetznermanager/actions_key.v @@ -1,6 +1,6 @@ module hetznermanager -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.texttools pub struct SSHKey { pub mut: diff --git a/lib/virt/hetznermanager/hetznermanager_factory_.v b/lib/virt/hetznermanager/hetznermanager_factory_.v index 8264626d..93fbdd04 100644 --- a/lib/virt/hetznermanager/hetznermanager_factory_.v +++ b/lib/virt/hetznermanager/hetznermanager_factory_.v @@ -1,8 +1,8 @@ module hetznermanager -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.base +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json __global ( diff --git a/lib/virt/hetznermanager/hetznermanager_model.v b/lib/virt/hetznermanager/hetznermanager_model.v index e1a29af1..f31645a9 100644 --- a/lib/virt/hetznermanager/hetznermanager_model.v +++ b/lib/virt/hetznermanager/hetznermanager_model.v @@ -1,8 +1,8 @@ module hetznermanager -import freeflowuniverse.herolib.core.httpconnection -import freeflowuniverse.herolib.data.encoderhero -import freeflowuniverse.herolib.core.playbook +import incubaid.herolib.core.httpconnection +import incubaid.herolib.data.encoderhero +import incubaid.herolib.core.playbook pub const version = '0.0.0' const singleton = false diff --git a/lib/virt/hetznermanager/play.v b/lib/virt/hetznermanager/play.v index 654398e5..18f715d9 100644 --- a/lib/virt/hetznermanager/play.v +++ b/lib/virt/hetznermanager/play.v @@ -1,7 +1,7 @@ // File: lib/virt/hetznermanager/play.v module hetznermanager -import freeflowuniverse.herolib.core.playbook { PlayBook } +import incubaid.herolib.core.playbook { PlayBook } // play processes playbook actions for the hetznermanager module. // It allows configuring and managing Hetzner servers through heroscript. diff --git a/lib/virt/hetznermanager/readme.md b/lib/virt/hetznermanager/readme.md index 0650d8e0..11e6bda0 100644 --- a/lib/virt/hetznermanager/readme.md +++ b/lib/virt/hetznermanager/readme.md @@ -8,11 +8,11 @@ Before using the module, you need to configure at least one client instance with ```hs !!hetznermanager.configure - name:"main" - user:"" - password:"${HETZNER_PASSWORD}" - whitelist:"2111181, 2392178" // Optional: comma-separated list of server IDs to operate on - sshkey: "name of sshkey as used with hetzner" + name:"main" + user:"" + password:"${HETZNER_PASSWORD}" + whitelist:"2111181, 2392178" // Optional: comma-separated list of server IDs to operate on + sshkey: "name of sshkey as used with hetzner" ``` ## 2. Usage @@ -24,6 +24,7 @@ You can interact with the Hetzner module in two ways: via HeroScript for automat HeroScript provides a simple, declarative way to execute server operations. You can run a script containing these actions using `playcmds.run()`. **Example Script:** + ```hs # Place a server into rescue mode @@ -53,40 +54,39 @@ HeroScript provides a simple, declarative way to execute server operations. You data: 'ssh-rsa AAAA...' ``` -#### Available Heroscript Actions: - -* `!!hetznermanager.configure`: Configures a new client instance. - * `name` (string): A unique name for this configuration. - * `user` (string): Hetzner Robot username. - * `password` (string): Hetzner Robot password. - * `whitelist` (string, optional): Comma-separated list of server IDs to restrict operations to. - * `sshkey` (string, optional): Default public SSH key to deploy in rescue mode. -* `!!hetznermanager.server_rescue`: Activates the rescue system. - * `instance` (string, optional): The client instance to use (defaults to 'default'). - * `server_name` or `id` (string/int): Identifies the target server. - * `wait` (bool, optional): Wait for the server to reboot into rescue (default: `true`). - * `hero_install` (bool, optional): Install Herolib in the rescue system (default: `false`). - * `reset` (bool, optional): Force activation even if already in rescue mode (default: `false`). -* `!!hetznermanager.ubuntu_install`: Performs a fresh installation of Ubuntu 24.04. - * `instance` (string, optional): The client instance to use (defaults to 'default'). - * `server_name` or `id` (string/int): Identifies the target server. - * `wait` (bool, optional): Wait for the installation and reboot to complete (default: `true`). - * `hero_install` (bool, optional): Install Herolib on the newly installed system (default: `false`). -* `!!hetznermanager.server_reset`: Triggers a hardware reset. - * All parameters are the same as `server_rescue`, except for `hero_install` and `reset`. -* `!!hetznermanager.key_create` / `key_delete`: Manages SSH keys in your account. - * `instance` (string, optional): The client instance to use. - * `key_name` (string): The name of the key. - * `data` (string, for create): The public key data. +#### Available Heroscript Actions +* `!!hetznermanager.configure`: Configures a new client instance. + * `name` (string): A unique name for this configuration. + * `user` (string): Hetzner Robot username. + * `password` (string): Hetzner Robot password. + * `whitelist` (string, optional): Comma-separated list of server IDs to restrict operations to. + * `sshkey` (string, optional): Default public SSH key to deploy in rescue mode. +* `!!hetznermanager.server_rescue`: Activates the rescue system. + * `instance` (string, optional): The client instance to use (defaults to 'default'). + * `server_name` or `id` (string/int): Identifies the target server. + * `wait` (bool, optional): Wait for the server to reboot into rescue (default: `true`). + * `hero_install` (bool, optional): Install Herolib in the rescue system (default: `false`). + * `reset` (bool, optional): Force activation even if already in rescue mode (default: `false`). +* `!!hetznermanager.ubuntu_install`: Performs a fresh installation of Ubuntu 24.04. + * `instance` (string, optional): The client instance to use (defaults to 'default'). + * `server_name` or `id` (string/int): Identifies the target server. + * `wait` (bool, optional): Wait for the installation and reboot to complete (default: `true`). + * `hero_install` (bool, optional): Install Herolib on the newly installed system (default: `false`). +* `!!hetznermanager.server_reset`: Triggers a hardware reset. + * All parameters are the same as `server_rescue`, except for `hero_install` and `reset`. +* `!!hetznermanager.key_create` / `key_delete`: Manages SSH keys in your account. + * `instance` (string, optional): The client instance to use. + * `key_name` (string): The name of the key. + * `data` (string, for create): The public key data. ### 2.2. V Language Usage For more granular control, you can call the module functions directly from your V code. ```v -import freeflowuniverse.herolib.virt.hetznermanager -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.virt.hetznermanager +import incubaid.herolib.ui.console // Get a configured client instance by the name you provided during configuration mut cl := hetznermanager.get(name: 'main')! @@ -114,19 +114,19 @@ println('Server has been reset.') ## Features -- Server listing and information retrieval -- Hardware reset functionality -- Rescue mode management with optional Herolib installation -- Automated Ubuntu 24.04 installation -- SSH key management -- Automatic server status monitoring during long operations -- Built-in caching for API responses to reduce rate-limiting -- Integration with Herolib installation tools +* Server listing and information retrieval +* Hardware reset functionality +* Rescue mode management with optional Herolib installation +* Automated Ubuntu 24.04 installation +* SSH key management +* Automatic server status monitoring during long operations +* Built-in caching for API responses to reduce rate-limiting +* Integration with Herolib installation tools ## Notes -- The module uses Redis for caching API responses (default 60-second cache duration). -- Server operations that include `wait: true` will monitor the server until the operation completes, providing feedback on the process. -- Reset operations with `wait: true` will timeout after 2 minutes if the server doesn't respond to SSH. -- The module automatically manages `ssh-keygen -R` to remove old host keys during reboots and reinstalls. -- The official API documentation can be found at [https://robot.hetzner.com/doc/webservice/en.html#preface](https://robot.hetzner.com/doc/webservice/en.html#preface). \ No newline at end of file +* The module uses Redis for caching API responses (default 60-second cache duration). +* Server operations that include `wait: true` will monitor the server until the operation completes, providing feedback on the process. +* Reset operations with `wait: true` will timeout after 2 minutes if the server doesn't respond to SSH. +* The module automatically manages `ssh-keygen -R` to remove old host keys during reboots and reinstalls. +* The official API documentation can be found at [https://robot.hetzner.com/doc/webservice/en.html#preface](https://robot.hetzner.com/doc/webservice/en.html#preface). diff --git a/lib/virt/hetznermanager/rescue.v b/lib/virt/hetznermanager/rescue.v index c6aabad3..a1b15ba8 100644 --- a/lib/virt/hetznermanager/rescue.v +++ b/lib/virt/hetznermanager/rescue.v @@ -1,10 +1,10 @@ module hetznermanager -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.texttools import time -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.builder +import incubaid.herolib.ui.console +import incubaid.herolib.osal.core as osal +import incubaid.herolib.builder import os // ///////////////////////////RESCUE diff --git a/lib/virt/hetznermanager/reset.v b/lib/virt/hetznermanager/reset.v index 8f82b3c6..ce86767b 100644 --- a/lib/virt/hetznermanager/reset.v +++ b/lib/virt/hetznermanager/reset.v @@ -1,10 +1,10 @@ module hetznermanager -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.texttools import time -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.builder +import incubaid.herolib.ui.console +import incubaid.herolib.osal.core as osal +import incubaid.herolib.builder // /////////////////////////////////////RESET diff --git a/lib/virt/hetznermanager/serverinfo.v b/lib/virt/hetznermanager/serverinfo.v index 85d38b23..de8a50b6 100644 --- a/lib/virt/hetznermanager/serverinfo.v +++ b/lib/virt/hetznermanager/serverinfo.v @@ -1,10 +1,10 @@ module hetznermanager -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.texttools import time -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.builder +import incubaid.herolib.ui.console +import incubaid.herolib.osal.core as osal +import incubaid.herolib.builder /////////////////////////// LIST diff --git a/lib/virt/lima/lima_factory.v b/lib/virt/lima/lima_factory.v index 1cf1518d..cad7c6f1 100644 --- a/lib/virt/lima/lima_factory.v +++ b/lib/virt/lima/lima_factory.v @@ -1,7 +1,7 @@ module lima -import freeflowuniverse.herolib.installers.virt.lima -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.installers.virt.lima +import incubaid.herolib.ui.console import virt.lima.raw import os diff --git a/lib/virt/lima/raw/vm.v b/lib/virt/lima/raw/vm.v index a87b664c..f52799f6 100644 --- a/lib/virt/lima/raw/vm.v +++ b/lib/virt/lima/raw/vm.v @@ -2,7 +2,7 @@ module raw import os import json -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console pub fn list() ![]VM { // console.print_debug(" - list vm") diff --git a/lib/virt/lima/vm.v b/lib/virt/lima/vm.v index 172b17eb..f6837be4 100644 --- a/lib/virt/lima/vm.v +++ b/lib/virt/lima/vm.v @@ -1,8 +1,8 @@ module lima import os -import freeflowuniverse.herolib.builder -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.builder +import incubaid.herolib.ui.console @[heap] pub struct VM { diff --git a/lib/virt/lima/vm_new.v b/lib/virt/lima/vm_new.v index 98b0c708..efc46c28 100644 --- a/lib/virt/lima/vm_new.v +++ b/lib/virt/lima/vm_new.v @@ -1,10 +1,10 @@ module lima import os -import freeflowuniverse.herolib.core.pathlib -// import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.osal.core as osal +import incubaid.herolib.core.pathlib +// import incubaid.herolib.core.texttools +import incubaid.herolib.ui.console +import incubaid.herolib.osal.core as osal @[params] pub struct VMNewArgs { diff --git a/lib/virt/podman/builder.v b/lib/virt/podman/builder.v index 0eab99cd..d3fb4b7b 100644 --- a/lib/virt/podman/builder.v +++ b/lib/virt/podman/builder.v @@ -1,8 +1,8 @@ module podman import time -import freeflowuniverse.herolib.osal.core as osal { exec } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.osal.core as osal { exec } +import incubaid.herolib.ui.console import json // BuildError represents errors that occur during build operations diff --git a/lib/virt/podman/container.v b/lib/virt/podman/container.v index 02f1be7a..5af05c81 100644 --- a/lib/virt/podman/container.v +++ b/lib/virt/podman/container.v @@ -1,9 +1,9 @@ module podman import time -import freeflowuniverse.herolib.osal.core as osal { exec } -import freeflowuniverse.herolib.data.ipaddress { IPAddress } -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.osal.core as osal { exec } +import incubaid.herolib.data.ipaddress { IPAddress } +import incubaid.herolib.core.texttools // PodmanContainer represents a podman container with structured data from CLI JSON output pub struct PodmanContainer { diff --git a/lib/virt/podman/factory.v b/lib/virt/podman/factory.v index 611c2b22..eeb984b6 100644 --- a/lib/virt/podman/factory.v +++ b/lib/virt/podman/factory.v @@ -1,8 +1,8 @@ module herocontainers -import freeflowuniverse.herolib.osal.core as osal { exec } -import freeflowuniverse.herolib.core -import freeflowuniverse.herolib.installers.virt.podman as podman_installer +import incubaid.herolib.osal.core as osal { exec } +import incubaid.herolib.core +import incubaid.herolib.installers.virt.podman as podman_installer @[heap] pub struct PodmanFactory { diff --git a/lib/virt/podman/image.v b/lib/virt/podman/image.v index 81633a15..9034fba1 100644 --- a/lib/virt/podman/image.v +++ b/lib/virt/podman/image.v @@ -1,8 +1,8 @@ module podman -import freeflowuniverse.herolib.osal.core as osal { exec } +import incubaid.herolib.osal.core as osal { exec } import time -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console // PodmanImage represents a podman image with structured data from CLI JSON output pub struct PodmanImage { diff --git a/lib/virt/podman/readme.md b/lib/virt/podman/readme.md index bc575e21..7b91d4b2 100644 --- a/lib/virt/podman/readme.md +++ b/lib/virt/podman/readme.md @@ -39,7 +39,7 @@ This module provides **two complementary APIs** for Podman functionality: For simple container operations, use the direct functions: ```v -import freeflowuniverse.herolib.virt.podman +import incubaid.herolib.virt.podman // List containers and images containers := podman.list_containers(true)! // true = include stopped @@ -66,7 +66,7 @@ podman.remove_image('nginx:latest', force: false)! For complex operations and state management, use the factory pattern: ```v -import freeflowuniverse.herolib.virt.podman +import incubaid.herolib.virt.podman // Create factory (with auto-install) mut factory := podman.new(install: true, herocompile: false)! @@ -274,7 +274,7 @@ builder.run('invalid_command') or { ## Installation and Setup ```v -import freeflowuniverse.herolib.virt.podman +import incubaid.herolib.virt.podman // Automatic installation mut factory := podman.new(install: true)! // Will install podman if needed diff --git a/lib/virt/qemu/qemu_factory.v b/lib/virt/qemu/qemu_factory.v index 3c7b57a2..63aa34b3 100644 --- a/lib/virt/qemu/qemu_factory.v +++ b/lib/virt/qemu/qemu_factory.v @@ -1,7 +1,7 @@ module qemu -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.installers.virt.qemu as qemuinstaller +import incubaid.herolib.ui.console +import incubaid.herolib.installers.virt.qemu as qemuinstaller import virt.qemu.raw import os diff --git a/lib/virt/qemu/vm.v b/lib/virt/qemu/vm.v index ce29f296..150f1c71 100644 --- a/lib/virt/qemu/vm.v +++ b/lib/virt/qemu/vm.v @@ -1,8 +1,8 @@ module qemu import os -import freeflowuniverse.herolib.builder -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.builder +import incubaid.herolib.ui.console @[heap] pub struct VM { diff --git a/lib/virt/qemu/vm_new.v b/lib/virt/qemu/vm_new.v index 19b31a9d..b3cf72de 100644 --- a/lib/virt/qemu/vm_new.v +++ b/lib/virt/qemu/vm_new.v @@ -1,10 +1,10 @@ module qemu import os -import freeflowuniverse.herolib.core.pathlib -// import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.osal.core as osal +import incubaid.herolib.core.pathlib +// import incubaid.herolib.core.texttools +import incubaid.herolib.ui.console +import incubaid.herolib.osal.core as osal @[params] pub struct VMNewArgs { diff --git a/lib/web/doctreeclient/README.md b/lib/web/doctreeclient/README.md index c551c785..32c46317 100644 --- a/lib/web/doctreeclient/README.md +++ b/lib/web/doctreeclient/README.md @@ -15,7 +15,7 @@ The client works with Redis as a backend storage system, where document collecti ### Creating a Client ```v -import freeflowuniverse.herolib.web.doctreeclient +import incubaid.herolib.web.doctreeclient // Create a new DocTreeClient instance mut client := doctreeclient.new()! @@ -96,8 +96,8 @@ Here's a complete example that demonstrates how to use DocTreeClient with a docu ```v module main -import freeflowuniverse.herolib.web.doctreeclient -import freeflowuniverse.herolib.data.doctree +import incubaid.herolib.web.doctreeclient +import incubaid.herolib.data.doctree fn main() { // First, populate Redis with doctree data diff --git a/lib/web/doctreeclient/client.v b/lib/web/doctreeclient/client.v index a5606d66..45d9195b 100644 --- a/lib/web/doctreeclient/client.v +++ b/lib/web/doctreeclient/client.v @@ -1,7 +1,7 @@ module doctreeclient -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.pathlib +import incubaid.herolib.core.texttools import os // List of recognized image file extensions diff --git a/lib/web/doctreeclient/doctree_test.v b/lib/web/doctreeclient/doctree_test.v index 541a090b..9bd2d7c1 100755 --- a/lib/web/doctreeclient/doctree_test.v +++ b/lib/web/doctreeclient/doctree_test.v @@ -1,8 +1,8 @@ module doctreeclient -import freeflowuniverse.herolib.data.doctree -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.data.doctree +import incubaid.herolib.core.base +import incubaid.herolib.core.pathlib import os fn test_doctree_client() ! { diff --git a/lib/web/doctreeclient/factory.v b/lib/web/doctreeclient/factory.v index c97ccbb5..04b9df12 100644 --- a/lib/web/doctreeclient/factory.v +++ b/lib/web/doctreeclient/factory.v @@ -1,6 +1,6 @@ module doctreeclient -import freeflowuniverse.herolib.core.base +import incubaid.herolib.core.base pub fn new() !&DocTreeClient { mut context := base.context()! diff --git a/lib/web/doctreeclient/model.v b/lib/web/doctreeclient/model.v index 4a91019d..b8c4237e 100644 --- a/lib/web/doctreeclient/model.v +++ b/lib/web/doctreeclient/model.v @@ -1,6 +1,6 @@ module doctreeclient -import freeflowuniverse.herolib.core.redisclient +import incubaid.herolib.core.redisclient // Combined config structure pub struct DocTreeClient { diff --git a/lib/web/docusaurus/config.v b/lib/web/docusaurus/config.v index e09fae1f..07919c27 100644 --- a/lib/web/docusaurus/config.v +++ b/lib/web/docusaurus/config.v @@ -1,7 +1,7 @@ module docusaurus import os -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib __global ( docusaurus_sites map[string]&DocSite diff --git a/lib/web/docusaurus/dsite.v b/lib/web/docusaurus/dsite.v index 3cb75bf7..027067a3 100644 --- a/lib/web/docusaurus/dsite.v +++ b/lib/web/docusaurus/dsite.v @@ -1,11 +1,9 @@ module docusaurus -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.web.site { Site, SiteConfig } -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.pathlib +import incubaid.herolib.web.site +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console @[heap] pub struct DocSite { diff --git a/lib/web/docusaurus/dsite_configuration.v b/lib/web/docusaurus/dsite_configuration.v index 8bc0b1e1..4e9ff270 100644 --- a/lib/web/docusaurus/dsite_configuration.v +++ b/lib/web/docusaurus/dsite_configuration.v @@ -1,6 +1,6 @@ module docusaurus -import freeflowuniverse.herolib.web.site +import incubaid.herolib.web.site // IS THE ONE AS USED BY DOCUSAURUS diff --git a/lib/web/docusaurus/dsite_generate.v b/lib/web/docusaurus/dsite_generate.v index 295d72e0..ace41759 100644 --- a/lib/web/docusaurus/dsite_generate.v +++ b/lib/web/docusaurus/dsite_generate.v @@ -1,10 +1,10 @@ module docusaurus -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib import json import os -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console pub fn (mut docsite DocSite) generate() ! { if docsite.generated { diff --git a/lib/web/docusaurus/dsite_generate_docs.v b/lib/web/docusaurus/dsite_generate_docs.v index 7ebb49ff..8e81fa3f 100644 --- a/lib/web/docusaurus/dsite_generate_docs.v +++ b/lib/web/docusaurus/dsite_generate_docs.v @@ -1,10 +1,10 @@ module docusaurus -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.web.doctreeclient -import freeflowuniverse.herolib.web.site { Page, Section, Site } -import freeflowuniverse.herolib.data.markdown.tools as markdowntools -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.pathlib +import incubaid.herolib.web.doctreeclient +import incubaid.herolib.web.site { Page, Section, Site } +import incubaid.herolib.data.markdown.tools as markdowntools +import incubaid.herolib.ui.console // THIS CODE GENERATES A DOCUSAURUS SITE FROM A DOCTREECLIENT AND SITE DEFINITION diff --git a/lib/web/docusaurus/dsite_import.v b/lib/web/docusaurus/dsite_import.v index 38285dae..b0aed541 100644 --- a/lib/web/docusaurus/dsite_import.v +++ b/lib/web/docusaurus/dsite_import.v @@ -1,10 +1,10 @@ module docusaurus -import freeflowuniverse.herolib.develop.gittools +import incubaid.herolib.develop.gittools import os -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools.regext +import incubaid.herolib.core.pathlib +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools.regext pub fn (mut docsite DocSite) import() ! { for importparams in docsite.website.siteconfig.imports { diff --git a/lib/web/docusaurus/dsite_store_structure.v b/lib/web/docusaurus/dsite_store_structure.v index ed59afc8..277e7711 100644 --- a/lib/web/docusaurus/dsite_store_structure.v +++ b/lib/web/docusaurus/dsite_store_structure.v @@ -1,14 +1,14 @@ module docusaurus -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.base +import incubaid.herolib.core.texttools // Store the Docusaurus site structure in Redis for link processing // This maps collection:page to their actual Docusaurus paths pub fn (mut docsite DocSite) store_site_structure() ! { mut context := base.context()! mut redis := context.redis()! - + // Store mapping of collection:page to docusaurus path (without .md extension) for page in docsite.website.pages { parts := page.src.split(':') @@ -17,22 +17,22 @@ pub fn (mut docsite DocSite) store_site_structure() ! { } collection_name := texttools.name_fix(parts[0]) page_name := texttools.name_fix(parts[1]) - + // Calculate the docusaurus path (without .md extension for URLs) mut doc_path := page.path - + // Handle empty or root path if doc_path.trim_space() == '' || doc_path == '/' { doc_path = page_name } else if doc_path.ends_with('/') { doc_path += page_name } - + // Remove .md extension if present for URL paths if doc_path.ends_with('.md') { doc_path = doc_path[..doc_path.len - 3] } - + // Store in Redis with key format: collection:page.md key := '${collection_name}:${page_name}.md' redis.hset('doctree_docusaurus_paths', key, doc_path)! diff --git a/lib/web/docusaurus/factory.v b/lib/web/docusaurus/factory.v index 7a727c03..8a7562ae 100644 --- a/lib/web/docusaurus/factory.v +++ b/lib/web/docusaurus/factory.v @@ -1,9 +1,9 @@ module docusaurus -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.web.site -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.pathlib +import incubaid.herolib.core.texttools +import incubaid.herolib.web.site +import incubaid.herolib.ui.console @[params] pub struct AddArgs { diff --git a/lib/web/docusaurus/install.v b/lib/web/docusaurus/install.v index a8f33912..6f29ace5 100644 --- a/lib/web/docusaurus/install.v +++ b/lib/web/docusaurus/install.v @@ -1,10 +1,10 @@ module docusaurus import os -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.develop.gittools -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.installers.web.bun +import incubaid.herolib.core.pathlib +import incubaid.herolib.develop.gittools +import incubaid.herolib.osal.core as osal +import incubaid.herolib.installers.web.bun fn install(c DocusaurusConfig) ! { mut gs := gittools.new()! @@ -17,7 +17,7 @@ fn install(c DocusaurusConfig) ! { template_path := gs.get_path( pull: c.template_update reset: c.reset - url: 'https://github.com/freeflowuniverse/docusaurus_template/src/branch/main/template' + url: 'https://github.com/incubaid/docusaurus_template/src/branch/main/template' )! mut template_path0 := pathlib.get_dir(path: template_path, create: false)! diff --git a/lib/web/docusaurus/model_configuration_test.v b/lib/web/docusaurus/model_configuration_test.v index 4f9607c7..1bc61bdc 100644 --- a/lib/web/docusaurus/model_configuration_test.v +++ b/lib/web/docusaurus/model_configuration_test.v @@ -1,8 +1,8 @@ module docusaurus import os -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.core.base // For context and Redis, if test needs to manage it +import incubaid.herolib.core.pathlib +import incubaid.herolib.core.base // For context and Redis, if test needs to manage it import time const test_heroscript_content = '!!site.config\n name:"Kristof"\n title:"Internet Geek"\n tagline:"Internet Geek"\n url:"https://friends.threefold.info"\n url_home:"docs/"\n base_url:"/kristof/"\n favicon:"img/favicon.png"\n image:"img/tf_graph.png"\n copyright:"Kristof"\n\n!!site.config_meta\n description:"ThreeFold is laying the foundation for a geo aware Web 4, the next generation of the Internet."\n image:"https://threefold.info/kristof/img/tf_graph.png"\n title:"ThreeFold Technology Vision"\n\n!!site.build_dest\n ssh_name:"production"\n path:"/root/hero/www/info/kristof"\n\n!!site.navbar\n title:"Kristof = Chief Executive Geek"\n logo_alt:"Kristof Logo"\n logo_src:"img/logo.svg"\n logo_src_dark:"img/logo.svg"\n\n!!site.navbar_item\n label:"ThreeFold Technology"\n href:"https://threefold.info/kristof/"\n position:"right"\n\n!!site.navbar_item\n label:"ThreeFold.io"\n href:"https://threefold.io"\n position:"right"\n\n!!site.footer\n style:"dark"\n\n!!site.footer_item\n title:"Docs"\n label:"Introduction"\n href:"/docs"\n\n!!site.footer_item\n title:"Docs"\n label:"TFGrid V4 Docs"\n href:"https://docs.threefold.io/"\n\n!!site.footer_item\n title:"Community"\n label:"Telegram"\n href:"https://t.me/threefold"\n\n!!site.footer_item\n title:"Community"\n label:"X"\n href:"https://x.com/threefold_io"\n\n!!site.footer_item\n title:"Links"\n label:"ThreeFold.io"\n href:"https://threefold.io"\n' diff --git a/lib/web/docusaurus/play.v b/lib/web/docusaurus/play.v index fe2c5cdd..5e7bbeb3 100644 --- a/lib/web/docusaurus/play.v +++ b/lib/web/docusaurus/play.v @@ -1,7 +1,7 @@ module docusaurus -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.web.site +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.web.site import os pub fn play(mut plbook PlayBook) ! { diff --git a/lib/web/docusaurus/watcher.v b/lib/web/docusaurus/watcher.v index 64d0a688..74407615 100644 --- a/lib/web/docusaurus/watcher.v +++ b/lib/web/docusaurus/watcher.v @@ -2,7 +2,7 @@ module docusaurus // not longer working because is coming from doctree -// import freeflowuniverse.herolib.osal.notifier +// import incubaid.herolib.osal.notifier // import os // fn watch_docs(docs_path string, path_src string, path_build string) ! { diff --git a/lib/web/security/authentication/controller.v b/lib/web/security/authentication/controller.v index 7ce677ea..4699c21b 100644 --- a/lib/web/security/authentication/controller.v +++ b/lib/web/security/authentication/controller.v @@ -4,7 +4,7 @@ import veb import time import json import log -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console const agent = 'Email Authentication Controller' diff --git a/lib/web/security/authentication/email_authentication.v b/lib/web/security/authentication/email_authentication.v index 924efa3c..db6ec073 100644 --- a/lib/web/security/authentication/email_authentication.v +++ b/lib/web/security/authentication/email_authentication.v @@ -5,7 +5,7 @@ import crypto.hmac import crypto.sha256 import encoding.hex import encoding.base64 -import freeflowuniverse.herolib.clients.mailclient { MailClient } +import incubaid.herolib.clients.mailclient { MailClient } pub struct StatelessAuthenticator { pub: diff --git a/lib/web/site/factory.v b/lib/web/site/factory.v index d92660ca..6d0cb5fc 100644 --- a/lib/web/site/factory.v +++ b/lib/web/site/factory.v @@ -1,6 +1,6 @@ module site -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.texttools __global ( websites map[string]&Site diff --git a/lib/web/site/play.v b/lib/web/site/play.v index 637c4f92..170f27df 100644 --- a/lib/web/site/play.v +++ b/lib/web/site/play.v @@ -1,8 +1,8 @@ module site import os -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.core.texttools import time pub fn play(mut plbook PlayBook) ! { diff --git a/lib/web/site/play_page.v b/lib/web/site/play_page.v index b607bd37..eccfbb5c 100644 --- a/lib/web/site/play_page.v +++ b/lib/web/site/play_page.v @@ -1,6 +1,6 @@ module site -import freeflowuniverse.herolib.core.playbook { PlayBook } +import incubaid.herolib.core.playbook { PlayBook } // plays the sections & pages fn play_pages(mut plbook PlayBook, mut site Site) ! { diff --git a/lib/web/site/readme.md b/lib/web/site/readme.md index c9e5af55..ce3e55d6 100644 --- a/lib/web/site/readme.md +++ b/lib/web/site/readme.md @@ -1,6 +1,5 @@ # Site Module - ## config heroscript ```yaml @@ -99,7 +98,7 @@ ## factory ```v -import freeflowuniverse.herolib.web.site +import incubaid.herolib.web.site mut mysite := site.new()! ``` @@ -107,8 +106,8 @@ mut mysite := site.new()! ## how to use with plbook ```v -import freeflowuniverse.herolib.core.playbook -import freeflowuniverse.herolib.web.site +import incubaid.herolib.core.playbook +import incubaid.herolib.web.site // path string // text string // git_url string @@ -296,4 +295,4 @@ site.play(mut plbook)! } ] } -``` \ No newline at end of file +``` diff --git a/lib/web/ui/heroprompt_api.v b/lib/web/ui/heroprompt_api.v index 871e4f12..be059f90 100644 --- a/lib/web/ui/heroprompt_api.v +++ b/lib/web/ui/heroprompt_api.v @@ -3,7 +3,7 @@ module ui import veb import os import json -import freeflowuniverse.herolib.develop.heroprompt as hp +import incubaid.herolib.develop.heroprompt as hp // Types struct DirResp { diff --git a/libarchive/baobab/actor/client.v b/libarchive/baobab/actor/client.v index 4d10d5e8..86f04977 100644 --- a/libarchive/baobab/actor/client.v +++ b/libarchive/baobab/actor/client.v @@ -1,8 +1,8 @@ module actor import json -import freeflowuniverse.herolib.clients.redisclient -import freeflowuniverse.herolib.baobab.action { ProcedureCall, ProcedureResponse } +import incubaid.herolib.clients.redisclient +import incubaid.herolib.baobab.action { ProcedureCall, ProcedureResponse } // Processor struct for managing procedure calls pub struct Client { diff --git a/libarchive/baobab/generator/_archive/client_typescript.v b/libarchive/baobab/generator/_archive/client_typescript.v index f892c971..a8f88110 100644 --- a/libarchive/baobab/generator/_archive/client_typescript.v +++ b/libarchive/baobab/generator/_archive/client_typescript.v @@ -1,10 +1,10 @@ module generator -import freeflowuniverse.herolib.develop.codetools as code -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.schemas.jsonschema.codegen -import freeflowuniverse.herolib.schemas.openrpc.codegen as openrpc_codegen -import freeflowuniverse.herolib.baobab.specification +import incubaid.herolib.develop.codetools as code +import incubaid.herolib.core.texttools +import incubaid.herolib.schemas.jsonschema.codegen +import incubaid.herolib.schemas.openrpc.codegen as openrpc_codegen +import incubaid.herolib.baobab.specification import net.http // pub enum BaseObjectMethodType { diff --git a/libarchive/baobab/generator/_archive/client_typescript_test.v b/libarchive/baobab/generator/_archive/client_typescript_test.v index 0902da77..16c235af 100644 --- a/libarchive/baobab/generator/_archive/client_typescript_test.v +++ b/libarchive/baobab/generator/_archive/client_typescript_test.v @@ -2,10 +2,10 @@ module generator import x.json2 as json import arrays -import freeflowuniverse.herolib.develop.codetools as code -import freeflowuniverse.herolib.baobab.specification -import freeflowuniverse.herolib.schemas.openrpc -import freeflowuniverse.herolib.schemas.jsonschema +import incubaid.herolib.develop.codetools as code +import incubaid.herolib.baobab.specification +import incubaid.herolib.schemas.openrpc +import incubaid.herolib.schemas.jsonschema const specification = specification.ActorSpecification{ name: 'Pet Store' diff --git a/libarchive/baobab/generator/_archive/generate_objects.v b/libarchive/baobab/generator/_archive/generate_objects.v index 71594747..2337e217 100644 --- a/libarchive/baobab/generator/_archive/generate_objects.v +++ b/libarchive/baobab/generator/_archive/generate_objects.v @@ -19,7 +19,7 @@ module generator // types: [object_type] // }, // Import{ -// mod: 'freeflowuniverse.herolib.baobab.backend' +// mod: 'incubaid.herolib.baobab.backend' // types: ['FilterParams'] // }, // ] @@ -41,7 +41,7 @@ module generator // return a.objects.map(code.new_file( // mod: texttools.name_fix(a.name) // name: '${texttools.name_fix(it.structure.name)}_model' -// // imports: [Import{mod:'freeflowuniverse.herolib.baobab.stage'}] +// // imports: [Import{mod:'incubaid.herolib.baobab.stage'}] // items: [it.structure] // )) // } diff --git a/libarchive/baobab/generator/_archive/write_object_methods.v b/libarchive/baobab/generator/_archive/write_object_methods.v index 60d4e4c6..8885fd32 100644 --- a/libarchive/baobab/generator/_archive/write_object_methods.v +++ b/libarchive/baobab/generator/_archive/write_object_methods.v @@ -1,8 +1,8 @@ module generator -import freeflowuniverse.herolib.baobab.specification -import freeflowuniverse.herolib.develop.codetools as code { Param, Param, type_from_symbol } -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.baobab.specification +import incubaid.herolib.develop.codetools as code { Param, Param, type_from_symbol } +import incubaid.herolib.core.texttools const id_param = Param{ name: 'id' @@ -28,7 +28,7 @@ const id_param = Param{ // types: [object_type] // }, // Import{ -// mod: 'freeflowuniverse.herolib.baobab.backend' +// mod: 'incubaid.herolib.baobab.backend' // types: ['FilterParams'] // }, // ] diff --git a/libarchive/baobab/generator/_archive/write_object_tests.v b/libarchive/baobab/generator/_archive/write_object_tests.v index 3c984c92..451090ff 100644 --- a/libarchive/baobab/generator/_archive/write_object_tests.v +++ b/libarchive/baobab/generator/_archive/write_object_tests.v @@ -1,9 +1,9 @@ module generator -import freeflowuniverse.herolib.develop.codetools as code -import freeflowuniverse.herolib.baobab.specification +import incubaid.herolib.develop.codetools as code +import incubaid.herolib.baobab.specification import rand -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.texttools // // generate_object_methods generates CRUD actor methods for a provided structure // pub fn generate_object_test_code(actor Struct, object BaseObject) !VFile { diff --git a/libarchive/baobab/generator/generate_act.v b/libarchive/baobab/generator/generate_act.v index 77871037..42df31d4 100644 --- a/libarchive/baobab/generator/generate_act.v +++ b/libarchive/baobab/generator/generate_act.v @@ -1,10 +1,10 @@ module generator -import freeflowuniverse.herolib.develop.codetools as code { CodeItem, CustomCode, Function, Import, Object, Param, Result, VFile } -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.schemas.openrpc { ContentDescriptor, Example } -import freeflowuniverse.herolib.schemas.jsonschema.codegen { schemaref_to_type } -import freeflowuniverse.herolib.baobab.specification { ActorMethod, ActorSpecification } +import incubaid.herolib.develop.codetools as code { CodeItem, CustomCode, Function, Import, Object, Param, Result, VFile } +import incubaid.herolib.core.texttools +import incubaid.herolib.schemas.openrpc { ContentDescriptor, Example } +import incubaid.herolib.schemas.jsonschema.codegen { schemaref_to_type } +import incubaid.herolib.baobab.specification { ActorMethod, ActorSpecification } fn generate_handle_file(spec ActorSpecification) !VFile { mut items := []CodeItem{} @@ -16,11 +16,11 @@ fn generate_handle_file(spec ActorSpecification) !VFile { name: 'act' imports: [ Import{ - mod: 'freeflowuniverse.herolib.baobab.stage' + mod: 'incubaid.herolib.baobab.stage' types: ['Action'] }, Import{ - mod: 'freeflowuniverse.herolib.core.texttools' + mod: 'incubaid.herolib.core.texttools' }, Import{ mod: 'x.json2 as json' diff --git a/libarchive/baobab/generator/generate_actor_folder.v b/libarchive/baobab/generator/generate_actor_folder.v index 20fd9b31..76cc2de8 100644 --- a/libarchive/baobab/generator/generate_actor_folder.v +++ b/libarchive/baobab/generator/generate_actor_folder.v @@ -1,9 +1,9 @@ module generator -import freeflowuniverse.herolib.develop.codetools as code { File, Folder, IFile, IFolder } -import freeflowuniverse.herolib.schemas.openapi -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.baobab.specification { ActorInterface, ActorSpecification } +import incubaid.herolib.develop.codetools as code { File, Folder, IFile, IFolder } +import incubaid.herolib.schemas.openapi +import incubaid.herolib.core.texttools +import incubaid.herolib.baobab.specification { ActorInterface, ActorSpecification } import json @[params] diff --git a/libarchive/baobab/generator/generate_actor_source.v b/libarchive/baobab/generator/generate_actor_source.v index c0eb84f4..d1ab8755 100644 --- a/libarchive/baobab/generator/generate_actor_source.v +++ b/libarchive/baobab/generator/generate_actor_source.v @@ -1,9 +1,9 @@ module generator -import freeflowuniverse.herolib.develop.codetools as code { CustomCode, IFile, IFolder, Module, VFile } -import freeflowuniverse.herolib.schemas.openapi -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.baobab.specification { ActorInterface, ActorSpecification } +import incubaid.herolib.develop.codetools as code { CustomCode, IFile, IFolder, Module, VFile } +import incubaid.herolib.schemas.openapi +import incubaid.herolib.core.texttools +import incubaid.herolib.baobab.specification { ActorInterface, ActorSpecification } import json pub fn generate_module_from_openapi(openapi_path string) !string { diff --git a/libarchive/baobab/generator/generate_actor_test.v b/libarchive/baobab/generator/generate_actor_test.v index f3bb78ce..3cdfaa99 100644 --- a/libarchive/baobab/generator/generate_actor_test.v +++ b/libarchive/baobab/generator/generate_actor_test.v @@ -1,9 +1,9 @@ module generator -import freeflowuniverse.herolib.develop.codetools as code -import freeflowuniverse.herolib.baobab.specification -import freeflowuniverse.herolib.schemas.openrpc -import freeflowuniverse.herolib.schemas.jsonschema +import incubaid.herolib.develop.codetools as code +import incubaid.herolib.baobab.specification +import incubaid.herolib.schemas.openrpc +import incubaid.herolib.schemas.jsonschema import os import x.json2 as json diff --git a/libarchive/baobab/generator/generate_clients.v b/libarchive/baobab/generator/generate_clients.v index 90188604..55018050 100644 --- a/libarchive/baobab/generator/generate_clients.v +++ b/libarchive/baobab/generator/generate_clients.v @@ -1,10 +1,10 @@ module generator -import freeflowuniverse.herolib.develop.codetools as code { CodeItem, CustomCode, Function, Import, Param, Result, VFile } -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.schemas.jsonschema.codegen as jsonschema_codegen { schemaref_to_type } -import freeflowuniverse.herolib.schemas.openrpc.codegen { content_descriptor_to_parameter } -import freeflowuniverse.herolib.baobab.specification { ActorMethod, ActorSpecification } +import incubaid.herolib.develop.codetools as code { CodeItem, CustomCode, Function, Import, Param, Result, VFile } +import incubaid.herolib.core.texttools +import incubaid.herolib.schemas.jsonschema.codegen as jsonschema_codegen { schemaref_to_type } +import incubaid.herolib.schemas.openrpc.codegen { content_descriptor_to_parameter } +import incubaid.herolib.baobab.specification { ActorMethod, ActorSpecification } pub fn generate_client_file(spec ActorSpecification) !VFile { actor_name_snake := texttools.snake_case(spec.name) @@ -30,10 +30,10 @@ pub fn generate_client_file(spec ActorSpecification) !VFile { return VFile{ imports: [ Import{ - mod: 'freeflowuniverse.herolib.baobab.stage' + mod: 'incubaid.herolib.baobab.stage' }, Import{ - mod: 'freeflowuniverse.herolib.core.redisclient' + mod: 'incubaid.herolib.core.redisclient' }, Import{ mod: 'x.json2 as json' @@ -71,10 +71,10 @@ pub fn generate_example_client_file(spec ActorSpecification) !VFile { return VFile{ imports: [ Import{ - mod: 'freeflowuniverse.herolib.baobab.stage' + mod: 'incubaid.herolib.baobab.stage' }, Import{ - mod: 'freeflowuniverse.herolib.core.redisclient' + mod: 'incubaid.herolib.core.redisclient' }, Import{ mod: 'x.json2 as json' diff --git a/libarchive/baobab/generator/generate_command.v b/libarchive/baobab/generator/generate_command.v index 5a1bccef..7e0a7ea6 100644 --- a/libarchive/baobab/generator/generate_command.v +++ b/libarchive/baobab/generator/generate_command.v @@ -1,8 +1,8 @@ module generator -import freeflowuniverse.herolib.develop.codetools as code { CodeItem, CustomCode, Import, VFile } -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.baobab.specification { ActorMethod, ActorSpecification } +import incubaid.herolib.develop.codetools as code { CodeItem, CustomCode, Import, VFile } +import incubaid.herolib.core.texttools +import incubaid.herolib.baobab.specification { ActorMethod, ActorSpecification } pub fn generate_command_file(spec ActorSpecification) !VFile { mut items := []CodeItem{} @@ -14,7 +14,7 @@ pub fn generate_command_file(spec ActorSpecification) !VFile { name: 'command' imports: [ Import{ - mod: 'freeflowuniverse.herolib.ui.console' + mod: 'incubaid.herolib.ui.console' }, Import{ mod: 'cli' diff --git a/libarchive/baobab/generator/generate_interface.v b/libarchive/baobab/generator/generate_interface.v index c163c8f2..c01991cf 100644 --- a/libarchive/baobab/generator/generate_interface.v +++ b/libarchive/baobab/generator/generate_interface.v @@ -1,7 +1,7 @@ module generator -import freeflowuniverse.herolib.baobab.specification { ActorInterface } -import freeflowuniverse.herolib.develop.codetools as code { CustomCode, VFile } +import incubaid.herolib.baobab.specification { ActorInterface } +import incubaid.herolib.develop.codetools as code { CustomCode, VFile } fn generate_openrpc_interface_files(interfaces []ActorInterface) (VFile, VFile) { http := ActorInterface.http in interfaces diff --git a/libarchive/baobab/generator/generate_methods.v b/libarchive/baobab/generator/generate_methods.v index e0411b8c..9e7e42de 100644 --- a/libarchive/baobab/generator/generate_methods.v +++ b/libarchive/baobab/generator/generate_methods.v @@ -1,13 +1,13 @@ module generator -import freeflowuniverse.herolib.develop.codetools as code { CodeItem, Function, Import, Param, Result, Struct, VFile } -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.schemas.openapi -import freeflowuniverse.herolib.schemas.openrpc -import freeflowuniverse.herolib.schemas.openrpc.codegen { content_descriptor_to_parameter, content_descriptor_to_struct } -import freeflowuniverse.herolib.schemas.jsonschema { Schema } -import freeflowuniverse.herolib.schemas.jsonschema.codegen as jsonschema_codegen -import freeflowuniverse.herolib.baobab.specification { ActorMethod, ActorSpecification } +import incubaid.herolib.develop.codetools as code { CodeItem, Function, Import, Param, Result, Struct, VFile } +import incubaid.herolib.core.texttools +import incubaid.herolib.schemas.openapi +import incubaid.herolib.schemas.openrpc +import incubaid.herolib.schemas.openrpc.codegen { content_descriptor_to_parameter, content_descriptor_to_struct } +import incubaid.herolib.schemas.jsonschema { Schema } +import incubaid.herolib.schemas.jsonschema.codegen as jsonschema_codegen +import incubaid.herolib.baobab.specification { ActorMethod, ActorSpecification } import log const crud_prefixes = ['new', 'get', 'set', 'delete', 'list'] @@ -51,7 +51,7 @@ pub fn generate_methods_file(spec ActorSpecification) !VFile { name: 'methods' imports: [ Import{ - mod: 'freeflowuniverse.herolib.baobab.osis' + mod: 'incubaid.herolib.baobab.osis' types: ['OSIS'] }, ] diff --git a/libarchive/baobab/generator/generate_methods_example.v b/libarchive/baobab/generator/generate_methods_example.v index 8e045f0a..761a0869 100644 --- a/libarchive/baobab/generator/generate_methods_example.v +++ b/libarchive/baobab/generator/generate_methods_example.v @@ -1,13 +1,13 @@ module generator -import freeflowuniverse.herolib.develop.codetools as code { CodeItem, Function, Import, Param, Result, Struct, VFile } -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.schemas.openrpc { Example } -import freeflowuniverse.herolib.schemas.jsonschema -import freeflowuniverse.herolib.schemas.jsonschema.codegen as jsonschema_codegen -import freeflowuniverse.herolib.schemas.openrpc.codegen { content_descriptor_to_parameter } -import freeflowuniverse.herolib.baobab.specification { ActorMethod, ActorSpecification } -import freeflowuniverse.herolib.schemas.openapi +import incubaid.herolib.develop.codetools as code { CodeItem, Function, Import, Param, Result, Struct, VFile } +import incubaid.herolib.core.texttools +import incubaid.herolib.schemas.openrpc { Example } +import incubaid.herolib.schemas.jsonschema +import incubaid.herolib.schemas.jsonschema.codegen as jsonschema_codegen +import incubaid.herolib.schemas.openrpc.codegen { content_descriptor_to_parameter } +import incubaid.herolib.baobab.specification { ActorMethod, ActorSpecification } +import incubaid.herolib.schemas.openapi pub fn generate_methods_example_file_str(source Source) !string { actor_spec := if path := source.openapi_path { @@ -42,7 +42,7 @@ pub fn generate_methods_example_file(spec ActorSpecification) !VFile { name: 'methods_example' imports: [ Import{ - mod: 'freeflowuniverse.herolib.baobab.osis' + mod: 'incubaid.herolib.baobab.osis' types: ['OSIS'] }, Import{ diff --git a/libarchive/baobab/generator/generate_methods_interface.v b/libarchive/baobab/generator/generate_methods_interface.v index e139231d..8324e479 100644 --- a/libarchive/baobab/generator/generate_methods_interface.v +++ b/libarchive/baobab/generator/generate_methods_interface.v @@ -1,11 +1,11 @@ module generator -import freeflowuniverse.herolib.develop.codetools as code { CodeItem, Import, Param, VFile } -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.schemas.openrpc.codegen -import freeflowuniverse.herolib.baobab.specification { ActorSpecification } -import freeflowuniverse.herolib.schemas.openapi -import freeflowuniverse.herolib.schemas.openrpc +import incubaid.herolib.develop.codetools as code { CodeItem, Import, Param, VFile } +import incubaid.herolib.core.texttools +import incubaid.herolib.schemas.openrpc.codegen +import incubaid.herolib.baobab.specification { ActorSpecification } +import incubaid.herolib.schemas.openapi +import incubaid.herolib.schemas.openrpc pub fn generate_methods_interface_file_str(source Source) !string { actor_spec := if path := source.openapi_path { @@ -23,7 +23,7 @@ pub fn generate_methods_interface_file(spec ActorSpecification) !VFile { name: 'methods_interface' imports: [ Import{ - mod: 'freeflowuniverse.herolib.baobab.osis' + mod: 'incubaid.herolib.baobab.osis' types: ['OSIS'] }, ] diff --git a/libarchive/baobab/generator/generate_model.v b/libarchive/baobab/generator/generate_model.v index b5a12221..de6d8439 100644 --- a/libarchive/baobab/generator/generate_model.v +++ b/libarchive/baobab/generator/generate_model.v @@ -1,11 +1,11 @@ module generator -import freeflowuniverse.herolib.develop.codetools as code { CodeItem, Struct, VFile } -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.schemas.jsonschema.codegen { schema_to_struct } -import freeflowuniverse.herolib.baobab.specification { ActorSpecification } -import freeflowuniverse.herolib.schemas.openapi -import freeflowuniverse.herolib.schemas.openrpc +import incubaid.herolib.develop.codetools as code { CodeItem, Struct, VFile } +import incubaid.herolib.core.texttools +import incubaid.herolib.schemas.jsonschema.codegen { schema_to_struct } +import incubaid.herolib.baobab.specification { ActorSpecification } +import incubaid.herolib.schemas.openapi +import incubaid.herolib.schemas.openrpc pub fn generate_model_file_str(source Source) !string { actor_spec := if path := source.openapi_path { diff --git a/libarchive/baobab/generator/generate_openapi.v b/libarchive/baobab/generator/generate_openapi.v index 5660e6cc..cf5477b5 100644 --- a/libarchive/baobab/generator/generate_openapi.v +++ b/libarchive/baobab/generator/generate_openapi.v @@ -1,10 +1,10 @@ module generator import json -import freeflowuniverse.herolib.develop.codetools as code { File, Folder } -import freeflowuniverse.herolib.schemas.openapi { OpenAPI, Operation } -import freeflowuniverse.herolib.schemas.openapi.codegen -import freeflowuniverse.herolib.schemas.jsonschema.codegen as jsonschema_codegen { schema_to_type } +import incubaid.herolib.develop.codetools as code { File, Folder } +import incubaid.herolib.schemas.openapi { OpenAPI, Operation } +import incubaid.herolib.schemas.openapi.codegen +import incubaid.herolib.schemas.jsonschema.codegen as jsonschema_codegen { schema_to_type } import net.http pub fn generate_openapi_file(specification OpenAPI) !File { diff --git a/libarchive/baobab/generator/generate_openrpc.v b/libarchive/baobab/generator/generate_openrpc.v index 9115bd0e..be445819 100644 --- a/libarchive/baobab/generator/generate_openrpc.v +++ b/libarchive/baobab/generator/generate_openrpc.v @@ -1,9 +1,9 @@ module generator import json -import freeflowuniverse.herolib.develop.codetools as code { File, Function, Struct, VFile } -import freeflowuniverse.herolib.schemas.openrpc { OpenRPC } -import freeflowuniverse.herolib.schemas.openrpc.codegen { generate_client_file, generate_client_test_file } +import incubaid.herolib.develop.codetools as code { File, Function, Struct, VFile } +import incubaid.herolib.schemas.openrpc { OpenRPC } +import incubaid.herolib.schemas.openrpc.codegen { generate_client_file, generate_client_test_file } pub fn generate_openrpc_file(spec OpenRPC) !File { return File{ diff --git a/libarchive/baobab/generator/generate_openrpc_test.v b/libarchive/baobab/generator/generate_openrpc_test.v index 3bd69377..0bb0787a 100644 --- a/libarchive/baobab/generator/generate_openrpc_test.v +++ b/libarchive/baobab/generator/generate_openrpc_test.v @@ -1,7 +1,7 @@ module generator -import freeflowuniverse.herolib.develop.codetools as code { Function, Param, Result, Struct, Type } -import freeflowuniverse.herolib.schemas.openrpc +import incubaid.herolib.develop.codetools as code { Function, Param, Result, Struct, Type } +import incubaid.herolib.schemas.openrpc const test_actor_specification = ActorSpecification{ methods: [ diff --git a/libarchive/baobab/generator/generate_scripts.v b/libarchive/baobab/generator/generate_scripts.v index d5c3c61e..238cf8c3 100644 --- a/libarchive/baobab/generator/generate_scripts.v +++ b/libarchive/baobab/generator/generate_scripts.v @@ -1,7 +1,7 @@ module generator -import freeflowuniverse.herolib.develop.codetools as code { File, Folder } -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.develop.codetools as code { File, Folder } +import incubaid.herolib.core.texttools // generates the folder with runnable scripts of the actor pub fn generate_scripts_folder(name string, example bool) Folder { diff --git a/libarchive/baobab/generator/templates/actor.v.template b/libarchive/baobab/generator/templates/actor.v.template index baf87c47..11159ce8 100644 --- a/libarchive/baobab/generator/templates/actor.v.template +++ b/libarchive/baobab/generator/templates/actor.v.template @@ -1,7 +1,7 @@ import os -import freeflowuniverse.herolib.baobab.stage -import freeflowuniverse.herolib.core.redisclient -import freeflowuniverse.herolib.schemas.openapi +import incubaid.herolib.baobab.stage +import incubaid.herolib.core.redisclient +import incubaid.herolib.schemas.openapi import time pub const configuration = stage.ActorConfig { diff --git a/libarchive/baobab/generator/templates/actor_example.v.template b/libarchive/baobab/generator/templates/actor_example.v.template index bea41fdd..15ea020b 100644 --- a/libarchive/baobab/generator/templates/actor_example.v.template +++ b/libarchive/baobab/generator/templates/actor_example.v.template @@ -1,7 +1,7 @@ import os -import freeflowuniverse.herolib.baobab.stage -import freeflowuniverse.herolib.core.redisclient -import freeflowuniverse.herolib.schemas.openapi +import incubaid.herolib.baobab.stage +import incubaid.herolib.core.redisclient +import incubaid.herolib.schemas.openapi const name = '@{actor_name_snake}' diff --git a/libarchive/baobab/generator/templates/cli.v.template b/libarchive/baobab/generator/templates/cli.v.template index d4762d90..dc237209 100644 --- a/libarchive/baobab/generator/templates/cli.v.template +++ b/libarchive/baobab/generator/templates/cli.v.template @@ -3,8 +3,8 @@ module @{name} import os import cli { Command } import veb -import freeflowuniverse.herolib.schemas.openrpc -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.schemas.openrpc +import incubaid.herolib.core.pathlib const openrpc_path = '@{dollar}{os.dir(os.dir(@@FILE))}/openrpc.json' diff --git a/libarchive/baobab/generator/templates/client_test.v b/libarchive/baobab/generator/templates/client_test.v index cb98126f..75def846 100644 --- a/libarchive/baobab/generator/templates/client_test.v +++ b/libarchive/baobab/generator/templates/client_test.v @@ -1,7 +1,7 @@ module pet_store_actor -import freeflowuniverse.herolib.baobab.stage -import freeflowuniverse.herolib.core.redisclient +import incubaid.herolib.baobab.stage +import incubaid.herolib.core.redisclient import x.json2 as json import time diff --git a/libarchive/baobab/generator/templates/command.v.template b/libarchive/baobab/generator/templates/command.v.template index d8e3da23..0ce37e53 100644 --- a/libarchive/baobab/generator/templates/command.v.template +++ b/libarchive/baobab/generator/templates/command.v.template @@ -1,7 +1,7 @@ -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib import cli { Command, Flag } import os -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console pub fn cmd_example_actor() Command { mut cmd := Command{ diff --git a/libarchive/baobab/generator/templates/interface_http.v.template b/libarchive/baobab/generator/templates/interface_http.v.template index fd6eed09..3f11be7a 100644 --- a/libarchive/baobab/generator/templates/interface_http.v.template +++ b/libarchive/baobab/generator/templates/interface_http.v.template @@ -1,7 +1,7 @@ -import freeflowuniverse.herolib.schemas.openapi { OpenAPI } -import freeflowuniverse.herolib.baobab.stage {Client, ClientConfig} -import freeflowuniverse.herolib.schemas.openrpc { OpenRPC } -import freeflowuniverse.herolib.baobab.stage.interfaces { HTTPServer, Context } +import incubaid.herolib.schemas.openapi { OpenAPI } +import incubaid.herolib.baobab.stage {Client, ClientConfig} +import incubaid.herolib.schemas.openrpc { OpenRPC } +import incubaid.herolib.baobab.stage.interfaces { HTTPServer, Context } import veb @@[params] diff --git a/libarchive/baobab/generator/templates/interface_openapi.v.template b/libarchive/baobab/generator/templates/interface_openapi.v.template index 5f5dbe54..38c1e929 100644 --- a/libarchive/baobab/generator/templates/interface_openapi.v.template +++ b/libarchive/baobab/generator/templates/interface_openapi.v.template @@ -1,6 +1,6 @@ -import freeflowuniverse.herolib.baobab.stage.interfaces -import freeflowuniverse.herolib.baobab.stage -import freeflowuniverse.herolib.schemas.openapi +import incubaid.herolib.baobab.stage.interfaces +import incubaid.herolib.baobab.stage +import incubaid.herolib.schemas.openapi pub fn new_openapi_interface(config stage.ActorConfig) !&interfaces.OpenAPIInterface { // create OpenAPI Handler with actor's client diff --git a/libarchive/baobab/generator/templates/interface_openrpc.v.template b/libarchive/baobab/generator/templates/interface_openrpc.v.template index 59a6f11d..ad8081d4 100644 --- a/libarchive/baobab/generator/templates/interface_openrpc.v.template +++ b/libarchive/baobab/generator/templates/interface_openrpc.v.template @@ -1,5 +1,5 @@ -import freeflowuniverse.herolib.baobab.stage.interfaces -import freeflowuniverse.herolib.schemas.openrpc +import incubaid.herolib.baobab.stage.interfaces +import incubaid.herolib.schemas.openrpc pub fn new_openrpc_interface() !&interfaces.OpenRPCInterface { // create OpenRPC Handler with actor's client diff --git a/libarchive/baobab/generator/templates/playground.v.template b/libarchive/baobab/generator/templates/playground.v.template index 871a1736..80a0f45e 100644 --- a/libarchive/baobab/generator/templates/playground.v.template +++ b/libarchive/baobab/generator/templates/playground.v.template @@ -1,10 +1,10 @@ #!/usr/bin/env -S v -n -cg -w -enable-globals run -import freeflowuniverse.herolib.baobab.stages.accountant +import incubaid.herolib.baobab.stages.accountant import veb -import freeflowuniverse.herolib.schemas.openrpc +import incubaid.herolib.schemas.openrpc import os -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib const openrpc_path = '@{dollar}{os.dir(os.dir(@@FILE))}/openrpc.json' const playground_path = '@{dollar}{os.dir(os.dir(@@FILE))}/playground' diff --git a/libarchive/baobab/generator/templates/specifications.v.template b/libarchive/baobab/generator/templates/specifications.v.template index 42208a3a..3f3cfd66 100644 --- a/libarchive/baobab/generator/templates/specifications.v.template +++ b/libarchive/baobab/generator/templates/specifications.v.template @@ -1,5 +1,5 @@ -import freeflowuniverse.herolib.schemas.openapi -import freeflowuniverse.herolib.schemas.openrpc +import incubaid.herolib.schemas.openapi +import incubaid.herolib.schemas.openrpc import os @if support_openrpc diff --git a/libarchive/baobab/generator/write_object_methods_test.v b/libarchive/baobab/generator/write_object_methods_test.v index 416a13a0..18c64096 100644 --- a/libarchive/baobab/generator/write_object_methods_test.v +++ b/libarchive/baobab/generator/write_object_methods_test.v @@ -1,6 +1,6 @@ module generator -import freeflowuniverse.herolib.develop.codetools as code +import incubaid.herolib.develop.codetools as code import os // // generate_object_methods generates CRUD actor methods for a provided structure diff --git a/libarchive/baobab/osis/indexer.v b/libarchive/baobab/osis/indexer.v index 5be7f532..98d22763 100644 --- a/libarchive/baobab/osis/indexer.v +++ b/libarchive/baobab/osis/indexer.v @@ -2,8 +2,8 @@ module osis import json import db.sqlite -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.texttools +import incubaid.herolib.core.pathlib pub struct Indexer { db sqlite.DB diff --git a/libarchive/baobab/osis/storer.v b/libarchive/baobab/osis/storer.v index 91ff7179..408ace1e 100644 --- a/libarchive/baobab/osis/storer.v +++ b/libarchive/baobab/osis/storer.v @@ -1,6 +1,6 @@ module osis -import freeflowuniverse.herolib.data.ourdb { OurDB } +import incubaid.herolib.data.ourdb { OurDB } import os pub struct Storer { diff --git a/libarchive/baobab/specification/from_openapi.v b/libarchive/baobab/specification/from_openapi.v index 82080fb7..ca3e1555 100644 --- a/libarchive/baobab/specification/from_openapi.v +++ b/libarchive/baobab/specification/from_openapi.v @@ -1,10 +1,10 @@ module specification -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.develop.codetools as code { Struct } -import freeflowuniverse.herolib.schemas.jsonschema { Schema, SchemaRef } -import freeflowuniverse.herolib.schemas.openapi { MediaType, OpenAPI, OperationInfo, Parameter } -import freeflowuniverse.herolib.schemas.openrpc { ContentDescriptor, ErrorSpec, Example, ExamplePairing, ExampleRef } +import incubaid.herolib.core.texttools +import incubaid.herolib.develop.codetools as code { Struct } +import incubaid.herolib.schemas.jsonschema { Schema, SchemaRef } +import incubaid.herolib.schemas.openapi { MediaType, OpenAPI, OperationInfo, Parameter } +import incubaid.herolib.schemas.openrpc { ContentDescriptor, ErrorSpec, Example, ExamplePairing, ExampleRef } // Helper function: Convert OpenAPI parameter to ContentDescriptor fn openapi_param_to_content_descriptor(param Parameter) ContentDescriptor { diff --git a/libarchive/baobab/specification/from_openapi_test.v b/libarchive/baobab/specification/from_openapi_test.v index 6da89cb6..41db4cff 100644 --- a/libarchive/baobab/specification/from_openapi_test.v +++ b/libarchive/baobab/specification/from_openapi_test.v @@ -1,10 +1,10 @@ module specification import x.json2 as json -import freeflowuniverse.herolib.develop.codetools as code { Struct } -import freeflowuniverse.herolib.schemas.openrpc { ContentDescriptor, ErrorSpec } -import freeflowuniverse.herolib.schemas.openapi { Components, Info, OpenAPI, Operation, PathItem, ServerSpec } -import freeflowuniverse.herolib.schemas.jsonschema { Reference, Schema, SchemaRef } +import incubaid.herolib.develop.codetools as code { Struct } +import incubaid.herolib.schemas.openrpc { ContentDescriptor, ErrorSpec } +import incubaid.herolib.schemas.openapi { Components, Info, OpenAPI, Operation, PathItem, ServerSpec } +import incubaid.herolib.schemas.jsonschema { Reference, Schema, SchemaRef } const openapi_spec = OpenAPI{ openapi: '3.0.3' diff --git a/libarchive/baobab/specification/from_openrpc.v b/libarchive/baobab/specification/from_openrpc.v index 53f903a0..5aff6abd 100644 --- a/libarchive/baobab/specification/from_openrpc.v +++ b/libarchive/baobab/specification/from_openrpc.v @@ -1,8 +1,8 @@ module specification -import freeflowuniverse.herolib.schemas.openrpc { ContentDescriptor, ErrorSpec, Method, OpenRPC } -import freeflowuniverse.herolib.schemas.jsonschema { Reference, Schema } -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.schemas.openrpc { ContentDescriptor, ErrorSpec, Method, OpenRPC } +import incubaid.herolib.schemas.jsonschema { Reference, Schema } +import incubaid.herolib.core.texttools // Helper function: Convert OpenRPC Method to ActorMethod fn openrpc_method_to_actor_method(method Method) ActorMethod { diff --git a/libarchive/baobab/specification/from_openrpc_test.v b/libarchive/baobab/specification/from_openrpc_test.v index 045dc1fd..944416a0 100644 --- a/libarchive/baobab/specification/from_openrpc_test.v +++ b/libarchive/baobab/specification/from_openrpc_test.v @@ -1,9 +1,9 @@ module specification -import freeflowuniverse.herolib.develop.codetools as code { Struct } -import freeflowuniverse.herolib.schemas.openrpc { ContentDescriptor } -import freeflowuniverse.herolib.schemas.openapi { Components, Info } -import freeflowuniverse.herolib.schemas.jsonschema { Reference, Schema, SchemaRef } +import incubaid.herolib.develop.codetools as code { Struct } +import incubaid.herolib.schemas.openrpc { ContentDescriptor } +import incubaid.herolib.schemas.openapi +import incubaid.herolib.schemas.jsonschema { Reference, Schema, SchemaRef } const openrpc_spec = openrpc.OpenRPC{ openrpc: '1.0.0-rc1' diff --git a/libarchive/baobab/specification/model.v b/libarchive/baobab/specification/model.v index 9f22ca17..442a0389 100644 --- a/libarchive/baobab/specification/model.v +++ b/libarchive/baobab/specification/model.v @@ -1,9 +1,9 @@ module specification -import freeflowuniverse.herolib.develop.codetools as code { Struct } -import freeflowuniverse.herolib.schemas.openapi -import freeflowuniverse.herolib.schemas.openrpc { ContentDescriptor, ErrorSpec, ExamplePairing } -import freeflowuniverse.herolib.schemas.jsonschema { Reference, Schema } +import incubaid.herolib.develop.codetools as code { Struct } +import incubaid.herolib.schemas.openapi +import incubaid.herolib.schemas.openrpc { ContentDescriptor, ErrorSpec, ExamplePairing } +import incubaid.herolib.schemas.jsonschema { Reference, Schema } pub struct ActorSpecification { pub mut: diff --git a/libarchive/baobab/specification/to_openapi.v b/libarchive/baobab/specification/to_openapi.v index 904ba6a3..cab8957e 100644 --- a/libarchive/baobab/specification/to_openapi.v +++ b/libarchive/baobab/specification/to_openapi.v @@ -1,7 +1,7 @@ module specification -import freeflowuniverse.herolib.schemas.jsonschema { Schema, SchemaRef } -import freeflowuniverse.herolib.schemas.openapi { Components, Info, MediaType, OpenAPI, Operation, Parameter, PathItem, ResponseSpec, ServerSpec } +import incubaid.herolib.schemas.jsonschema { Schema, SchemaRef } +import incubaid.herolib.schemas.openapi { Components, Info, MediaType, OpenAPI, Operation, Parameter, PathItem, ResponseSpec, ServerSpec } import net.http // Converts ActorSpecification to OpenAPI diff --git a/libarchive/baobab/specification/to_openapi_test.v b/libarchive/baobab/specification/to_openapi_test.v index 35ae8100..f4bad6a1 100644 --- a/libarchive/baobab/specification/to_openapi_test.v +++ b/libarchive/baobab/specification/to_openapi_test.v @@ -1,9 +1,9 @@ module specification -import freeflowuniverse.herolib.develop.codetools as code -import freeflowuniverse.herolib.schemas.jsonschema { Schema, SchemaRef } -import freeflowuniverse.herolib.schemas.openapi -import freeflowuniverse.herolib.schemas.openrpc +import incubaid.herolib.develop.codetools as code +import incubaid.herolib.schemas.jsonschema { Schema, SchemaRef } +import incubaid.herolib.schemas.openapi +import incubaid.herolib.schemas.openrpc const actor_spec = ActorSpecification{ name: 'Petstore' diff --git a/libarchive/baobab/specification/to_openrpc.v b/libarchive/baobab/specification/to_openrpc.v index a53179b2..f273fc4a 100644 --- a/libarchive/baobab/specification/to_openrpc.v +++ b/libarchive/baobab/specification/to_openrpc.v @@ -1,8 +1,8 @@ module specification -import freeflowuniverse.herolib.schemas.openrpc { Components, OpenRPC } -import freeflowuniverse.herolib.schemas.jsonschema { SchemaRef } -import freeflowuniverse.herolib.schemas.jsonschema.codegen +import incubaid.herolib.schemas.openrpc { Components, OpenRPC } +import incubaid.herolib.schemas.jsonschema { SchemaRef } +import incubaid.herolib.schemas.jsonschema.codegen // pub fn from_openrpc(spec openrpc.OpenRPC) !ActorSpecification { // // Extract Actor metadata from OpenRPC info diff --git a/libarchive/baobab/stage/action.v b/libarchive/baobab/stage/action.v index 3e0ac0fc..7e575f5c 100644 --- a/libarchive/baobab/stage/action.v +++ b/libarchive/baobab/stage/action.v @@ -1,6 +1,6 @@ module stage -// import freeflowuniverse.herolib.core.smartid +// import incubaid.herolib.core.smartid pub struct Action { pub mut: diff --git a/libarchive/baobab/stage/action_client.v b/libarchive/baobab/stage/action_client.v index 86f7a67f..d466f3e2 100644 --- a/libarchive/baobab/stage/action_client.v +++ b/libarchive/baobab/stage/action_client.v @@ -1,6 +1,6 @@ module stage -import freeflowuniverse.herolib.core.redisclient +import incubaid.herolib.core.redisclient // Processor struct for managing procedure calls pub struct Client { diff --git a/libarchive/baobab/stage/actor.v b/libarchive/baobab/stage/actor.v index c13ad0db..e3d909fe 100644 --- a/libarchive/baobab/stage/actor.v +++ b/libarchive/baobab/stage/actor.v @@ -1,7 +1,7 @@ module stage -import freeflowuniverse.herolib.baobab.osis { OSIS } -import freeflowuniverse.herolib.core.redisclient +import incubaid.herolib.baobab.osis { OSIS } +import incubaid.herolib.core.redisclient @[heap] pub interface IActor { diff --git a/libarchive/baobab/stage/interfaces/jsonrpc.v b/libarchive/baobab/stage/interfaces/jsonrpc.v index d85ed73f..d907b10e 100644 --- a/libarchive/baobab/stage/interfaces/jsonrpc.v +++ b/libarchive/baobab/stage/interfaces/jsonrpc.v @@ -1,7 +1,7 @@ module interfaces -import freeflowuniverse.herolib.schemas.jsonrpc -import freeflowuniverse.herolib.baobab.stage { Action } +import incubaid.herolib.schemas.jsonrpc +import incubaid.herolib.baobab.stage { Action } pub fn action_from_jsonrpc_request(request jsonrpc.Request) Action { return Action{ diff --git a/libarchive/baobab/stage/interfaces/openapi.v b/libarchive/baobab/stage/interfaces/openapi.v index e666da7b..d56f567d 100644 --- a/libarchive/baobab/stage/interfaces/openapi.v +++ b/libarchive/baobab/stage/interfaces/openapi.v @@ -2,9 +2,9 @@ module interfaces import rand import x.json2 as json { Any } -import freeflowuniverse.herolib.baobab.stage { Action, Client } -import freeflowuniverse.herolib.schemas.jsonrpc -import freeflowuniverse.herolib.schemas.openapi +import incubaid.herolib.baobab.stage { Action, Client } +import incubaid.herolib.schemas.jsonrpc +import incubaid.herolib.schemas.openapi pub struct OpenAPIInterface { pub mut: diff --git a/libarchive/baobab/stage/interfaces/openrpc.v b/libarchive/baobab/stage/interfaces/openrpc.v index c03dceb1..771aa138 100644 --- a/libarchive/baobab/stage/interfaces/openrpc.v +++ b/libarchive/baobab/stage/interfaces/openrpc.v @@ -1,7 +1,7 @@ module interfaces -import freeflowuniverse.herolib.baobab.stage { Client } -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.baobab.stage { Client } +import incubaid.herolib.schemas.jsonrpc // handler for test echoes JSONRPC Request as JSONRPC Response fn handler(request jsonrpc.Request) !jsonrpc.Response { diff --git a/libarchive/baobab/stage/interfaces/reflection_openapi.v b/libarchive/baobab/stage/interfaces/reflection_openapi.v index 96dc72b7..964e6063 100644 --- a/libarchive/baobab/stage/interfaces/reflection_openapi.v +++ b/libarchive/baobab/stage/interfaces/reflection_openapi.v @@ -5,8 +5,8 @@ module interfaces // import veb // import x.json2 {Any} // import net.http -import freeflowuniverse.herolib.baobab.stage { Action } -import freeflowuniverse.herolib.schemas.openapi { Request } +import incubaid.herolib.baobab.stage { Action } +import incubaid.herolib.schemas.openapi { Request } pub fn openapi_request_to_action(request Request) Action { // // Convert incoming OpenAPI request to a procedure call diff --git a/libarchive/baobab/stage/interfaces/server_http.v b/libarchive/baobab/stage/interfaces/server_http.v index e9acbef8..a3bba13c 100644 --- a/libarchive/baobab/stage/interfaces/server_http.v +++ b/libarchive/baobab/stage/interfaces/server_http.v @@ -1,8 +1,8 @@ module interfaces -import freeflowuniverse.herolib.schemas.openapi { OpenAPI } -import freeflowuniverse.herolib.baobab.stage { ClientConfig } -import freeflowuniverse.herolib.schemas.openrpc { OpenRPC } +import incubaid.herolib.schemas.openapi { OpenAPI } +import incubaid.herolib.baobab.stage { ClientConfig } +import incubaid.herolib.schemas.openrpc { OpenRPC } import veb pub struct HTTPServer { diff --git a/libarchive/buildah/buildah_core.v b/libarchive/buildah/buildah_core.v index 1602ae35..c90ccc4b 100644 --- a/libarchive/buildah/buildah_core.v +++ b/libarchive/buildah/buildah_core.v @@ -1,11 +1,11 @@ module buildah -import freeflowuniverse.herolib.osal.core as osal -// import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.installers.lang.herolib -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.builder -import freeflowuniverse.herolib.virt.utils +import incubaid.herolib.osal.core as osal +// import incubaid.herolib.ui.console +import incubaid.herolib.installers.lang.herolib +import incubaid.herolib.core.pathlib +import incubaid.herolib.builder +import incubaid.herolib.virt.utils import os import json diff --git a/libarchive/buildah/buildah_core_installers.v b/libarchive/buildah/buildah_core_installers.v index 54dbb02c..de83c252 100644 --- a/libarchive/buildah/buildah_core_installers.v +++ b/libarchive/buildah/buildah_core_installers.v @@ -1,9 +1,9 @@ module buildah -import freeflowuniverse.herolib.osal.core as osal -// import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.installers.lang.herolib -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.osal.core as osal +// import incubaid.herolib.ui.console +import incubaid.herolib.installers.lang.herolib +import incubaid.herolib.core.pathlib import os import json diff --git a/libarchive/buildah/buildah_exec.v b/libarchive/buildah/buildah_exec.v index 9b7a1f80..d1c29ea0 100644 --- a/libarchive/buildah/buildah_exec.v +++ b/libarchive/buildah/buildah_exec.v @@ -1,7 +1,7 @@ module buildah -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.osal.core as osal +import incubaid.herolib.core.pathlib import os @[params] diff --git a/libarchive/buildah/buildah_factory.v b/libarchive/buildah/buildah_factory.v index 33df57a6..a59078a2 100644 --- a/libarchive/buildah/buildah_factory.v +++ b/libarchive/buildah/buildah_factory.v @@ -1,8 +1,8 @@ module buildah -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.virt.utils +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console +import incubaid.herolib.virt.utils import json @[params] diff --git a/libarchive/buildah/buildah_hero.v b/libarchive/buildah/buildah_hero.v index eceefc65..0126b23e 100644 --- a/libarchive/buildah/buildah_hero.v +++ b/libarchive/buildah/buildah_hero.v @@ -1,6 +1,6 @@ module buildah -import freeflowuniverse.herolib.osal.core as osal +import incubaid.herolib.osal.core as osal // copies the hero from host into guest and then execute the heroscript or commandline pub fn (mut self BuildAHContainer) hero_cmd_execute(cmd string) ! { diff --git a/libarchive/buildah/buildah_solutions.v b/libarchive/buildah/buildah_solutions.v index 266091ff..c923cc60 100644 --- a/libarchive/buildah/buildah_solutions.v +++ b/libarchive/buildah/buildah_solutions.v @@ -1,7 +1,7 @@ module buildah -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console import os @[params] diff --git a/libarchive/buildah/readme.md b/libarchive/buildah/readme.md index 05337d3b..e156cc2f 100644 --- a/libarchive/buildah/readme.md +++ b/libarchive/buildah/readme.md @@ -6,9 +6,9 @@ Tools to work with containers ```go #!/usr/bin/env -S v -n -cg -w -enable-globals run -import freeflowuniverse.herolib.virt.herocontainers -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.builder +import incubaid.herolib.virt.herocontainers +import incubaid.herolib.ui.console +import incubaid.herolib.builder //interative means will ask for login/passwd @@ -40,7 +40,6 @@ buildah images result is something like - ```bash CONTAINER ID BUILDER IMAGE ID IMAGE NAME CONTAINER NAME a9946633d4e7 * scratch base @@ -68,11 +67,10 @@ ncdu ## create container - ```go -import freeflowuniverse.herolib.virt.herocontainers -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.builder +import incubaid.herolib.virt.herocontainers +import incubaid.herolib.ui.console +import incubaid.herolib.builder //interative means will ask for login/passwd @@ -111,7 +109,6 @@ mut c:=e.container_create( ``` - ## future -should make this module compatible with https://github.com/containerd/nerdctl \ No newline at end of file +should make this module compatible with diff --git a/libarchive/daguserver/daguserver_actions.v b/libarchive/daguserver/daguserver_actions.v index 38d9ef3e..6b609de3 100644 --- a/libarchive/daguserver/daguserver_actions.v +++ b/libarchive/daguserver/daguserver_actions.v @@ -1,14 +1,14 @@ module daguserver -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core -import freeflowuniverse.herolib.core.httpconnection -import freeflowuniverse.herolib.installers.ulist -// import freeflowuniverse.herolib.develop.gittools -import freeflowuniverse.herolib.osal.startupmanager -import freeflowuniverse.herolib.libarchive.zinit as zinit_lib +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.core +import incubaid.herolib.core.httpconnection +import incubaid.herolib.installers.ulist +// import incubaid.herolib.develop.gittools +import incubaid.herolib.osal.startupmanager +import incubaid.herolib.libarchive.zinit as zinit_lib import os fn startupcmd() ![]startupmanager.ZProcessNewArgs { diff --git a/libarchive/daguserver/daguserver_factory_.v b/libarchive/daguserver/daguserver_factory_.v index 9967c8ab..1e0f8cca 100644 --- a/libarchive/daguserver/daguserver_factory_.v +++ b/libarchive/daguserver/daguserver_factory_.v @@ -1,10 +1,10 @@ module daguserver -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.base +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager import time __global ( diff --git a/libarchive/daguserver/daguserver_model.v b/libarchive/daguserver/daguserver_model.v index c2c4bcca..33f8212b 100644 --- a/libarchive/daguserver/daguserver_model.v +++ b/libarchive/daguserver/daguserver_model.v @@ -1,9 +1,9 @@ module daguserver -import freeflowuniverse.herolib.data.encoderhero -import freeflowuniverse.herolib.crypt.secrets -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.data.encoderhero +import incubaid.herolib.crypt.secrets +import incubaid.herolib.ui.console +import incubaid.herolib.core.pathlib import os pub const version = '1.14.3' diff --git a/libarchive/daguserver/readme.md b/libarchive/daguserver/readme.md index 30a1d8a0..7a64cfd1 100644 --- a/libarchive/daguserver/readme.md +++ b/libarchive/daguserver/readme.md @@ -1,14 +1,12 @@ # daguserver - - To get started ```v -import freeflowuniverse.herolib.installers.something. daguserver +import incubaid.herolib.installers.something. daguserver mut installer:= daguserver.get()! @@ -21,7 +19,6 @@ installer.start()! ## example heroscript - ```hero !!daguserver.install homedir: '/home/user/daguserver' @@ -32,5 +29,3 @@ installer.start()! port: 8888 ``` - - diff --git a/libarchive/dify/dify_actions.v b/libarchive/dify/dify_actions.v index 62bb0d51..6240f422 100644 --- a/libarchive/dify/dify_actions.v +++ b/libarchive/dify/dify_actions.v @@ -1,16 +1,16 @@ module dify -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.osal.systemd -import freeflowuniverse.herolib.osal.startupmanager -import freeflowuniverse.herolib.installers.ulist -import freeflowuniverse.herolib.installers.lang.golang -import freeflowuniverse.herolib.installers.lang.rust -import freeflowuniverse.herolib.installers.lang.python -import freeflowuniverse.herolib.installers.virt.docker as docker_installer +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.core.pathlib +import incubaid.herolib.osal.systemd +import incubaid.herolib.osal.startupmanager +import incubaid.herolib.installers.ulist +import incubaid.herolib.installers.lang.golang +import incubaid.herolib.installers.lang.rust +import incubaid.herolib.installers.lang.python +import incubaid.herolib.installers.virt.docker as docker_installer import os fn startupcmd() ![]zinit.ZProcessNewArgs { diff --git a/libarchive/dify/dify_factory_.v b/libarchive/dify/dify_factory_.v index 14123845..8efaa775 100644 --- a/libarchive/dify/dify_factory_.v +++ b/libarchive/dify/dify_factory_.v @@ -1,10 +1,10 @@ module dify -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.playbook { PlayBook } -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.base +import incubaid.herolib.core.playbook { PlayBook } +import incubaid.herolib.ui.console import json -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager import time /////////FACTORY diff --git a/libarchive/dify/dify_model.v b/libarchive/dify/dify_model.v index 34d3ff10..894af5be 100644 --- a/libarchive/dify/dify_model.v +++ b/libarchive/dify/dify_model.v @@ -1,7 +1,7 @@ module dify -import freeflowuniverse.herolib.data.paramsparser -import freeflowuniverse.herolib.data.encoderhero +import incubaid.herolib.data.paramsparser +import incubaid.herolib.data.encoderhero import os import rand diff --git a/libarchive/dify/readme.md b/libarchive/dify/readme.md index fff6c211..d49194a2 100644 --- a/libarchive/dify/readme.md +++ b/libarchive/dify/readme.md @@ -7,7 +7,7 @@ To get started ```v -import freeflowuniverse.herolib.installers.something.dify as dify_installer +import incubaid.herolib.installers.something.dify as dify_installer heroscript:=" !!dify.configure name:'test' @@ -40,5 +40,3 @@ dify_installer.play(heroscript=heroscript)! port: 8888 ``` - - diff --git a/libarchive/examples/baobab/generator/basic/generate_actor_module.vsh b/libarchive/examples/baobab/generator/basic/generate_actor_module.vsh index 79d8076d..758bc3f6 100755 --- a/libarchive/examples/baobab/generator/basic/generate_actor_module.vsh +++ b/libarchive/examples/baobab/generator/basic/generate_actor_module.vsh @@ -1,8 +1,8 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.baobab.generator -import freeflowuniverse.herolib.baobab.specification -import freeflowuniverse.herolib.schemas.openrpc +import incubaid.herolib.baobab.generator +import incubaid.herolib.baobab.specification +import incubaid.herolib.schemas.openrpc import os const example_dir = os.dir(@FILE) diff --git a/libarchive/examples/baobab/generator/basic/generate_methods.vsh b/libarchive/examples/baobab/generator/basic/generate_methods.vsh index a9d17dea..1651138c 100755 --- a/libarchive/examples/baobab/generator/basic/generate_methods.vsh +++ b/libarchive/examples/baobab/generator/basic/generate_methods.vsh @@ -1,8 +1,8 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.baobab.generator -import freeflowuniverse.herolib.baobab.specification -import freeflowuniverse.herolib.schemas.openrpc +import incubaid.herolib.baobab.generator +import incubaid.herolib.baobab.specification +import incubaid.herolib.schemas.openrpc import os const example_dir = os.dir(@FILE) diff --git a/libarchive/examples/baobab/generator/basic/generate_openrpc_file.vsh b/libarchive/examples/baobab/generator/basic/generate_openrpc_file.vsh index 1a564e5b..7d142c18 100755 --- a/libarchive/examples/baobab/generator/basic/generate_openrpc_file.vsh +++ b/libarchive/examples/baobab/generator/basic/generate_openrpc_file.vsh @@ -1,8 +1,8 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.baobab.generator -import freeflowuniverse.herolib.baobab.specification -import freeflowuniverse.herolib.schemas.openrpc +import incubaid.herolib.baobab.generator +import incubaid.herolib.baobab.specification +import incubaid.herolib.schemas.openrpc import os const example_dir = os.dir(@FILE) diff --git a/libarchive/examples/baobab/generator/geomind_poc/generate.vsh b/libarchive/examples/baobab/generator/geomind_poc/generate.vsh index a32b8ccd..f57cccb4 100755 --- a/libarchive/examples/baobab/generator/geomind_poc/generate.vsh +++ b/libarchive/examples/baobab/generator/geomind_poc/generate.vsh @@ -1,8 +1,8 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.baobab.generator -import freeflowuniverse.herolib.baobab.specification -import freeflowuniverse.herolib.schemas.openapi +import incubaid.herolib.baobab.generator +import incubaid.herolib.baobab.specification +import incubaid.herolib.schemas.openapi import os const example_dir = os.dir(@FILE) diff --git a/libarchive/examples/baobab/generator/geomind_poc/play.v b/libarchive/examples/baobab/generator/geomind_poc/play.v index 746f2b60..5eb97c85 100644 --- a/libarchive/examples/baobab/generator/geomind_poc/play.v +++ b/libarchive/examples/baobab/generator/geomind_poc/play.v @@ -1,6 +1,6 @@ module geomind_poc -import freeflowuniverse.crystallib.core.playbook { PlayBook } +import incubaid.crystallib.core.playbook { PlayBook } // play_commerce processes heroscript actions for the commerce system pub fn play_commerce(mut plbook PlayBook) ! { diff --git a/libarchive/examples/baobab/generator/geomind_poc/test_commerce.vsh b/libarchive/examples/baobab/generator/geomind_poc/test_commerce.vsh index 4b33b470..20c58bdf 100644 --- a/libarchive/examples/baobab/generator/geomind_poc/test_commerce.vsh +++ b/libarchive/examples/baobab/generator/geomind_poc/test_commerce.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -import freeflowuniverse.crystallib.core.playbook +import incubaid.crystallib.core.playbook import geomind_poc fn main() { diff --git a/libarchive/examples/baobab/generator/mcc_example.vsh b/libarchive/examples/baobab/generator/mcc_example.vsh index f83ccfa4..b7b67dcc 100755 --- a/libarchive/examples/baobab/generator/mcc_example.vsh +++ b/libarchive/examples/baobab/generator/mcc_example.vsh @@ -1,8 +1,8 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.baobab.generator -import freeflowuniverse.herolib.baobab.specification -import freeflowuniverse.herolib.schemas.openapi +import incubaid.herolib.baobab.generator +import incubaid.herolib.baobab.specification +import incubaid.herolib.schemas.openapi import os const example_dir = os.join_path('${os.home_dir()}/code/github/incubaid/herolib/lib/circles/mcc', diff --git a/libarchive/examples/baobab/generator/openapi_e2e/generate_actor_module.vsh b/libarchive/examples/baobab/generator/openapi_e2e/generate_actor_module.vsh index 47d25349..bcd0b693 100755 --- a/libarchive/examples/baobab/generator/openapi_e2e/generate_actor_module.vsh +++ b/libarchive/examples/baobab/generator/openapi_e2e/generate_actor_module.vsh @@ -1,8 +1,8 @@ #!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.baobab.generator -import freeflowuniverse.herolib.baobab.specification -import freeflowuniverse.herolib.schemas.openapi +import incubaid.herolib.baobab.generator +import incubaid.herolib.baobab.specification +import incubaid.herolib.schemas.openapi import os const example_dir = os.dir(@FILE) diff --git a/libarchive/examples/baobab/specification/openapi_to_specification.vsh b/libarchive/examples/baobab/specification/openapi_to_specification.vsh index 7035ab3c..78e8a28a 100755 --- a/libarchive/examples/baobab/specification/openapi_to_specification.vsh +++ b/libarchive/examples/baobab/specification/openapi_to_specification.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.baobab.specification -import freeflowuniverse.herolib.schemas.openapi +import incubaid.herolib.baobab.specification +import incubaid.herolib.schemas.openapi import os const example_dir = os.dir(@FILE) diff --git a/libarchive/examples/baobab/specification/openrpc_to_specification.vsh b/libarchive/examples/baobab/specification/openrpc_to_specification.vsh index cabce42c..f8fdacf4 100755 --- a/libarchive/examples/baobab/specification/openrpc_to_specification.vsh +++ b/libarchive/examples/baobab/specification/openrpc_to_specification.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.baobab.specification -import freeflowuniverse.herolib.schemas.openrpc +import incubaid.herolib.baobab.specification +import incubaid.herolib.schemas.openrpc import os const example_dir = os.dir(@FILE) diff --git a/libarchive/examples/baobab/specification/specification_to_openapi.vsh b/libarchive/examples/baobab/specification/specification_to_openapi.vsh index f60c1e1b..cac235ba 100755 --- a/libarchive/examples/baobab/specification/specification_to_openapi.vsh +++ b/libarchive/examples/baobab/specification/specification_to_openapi.vsh @@ -1,9 +1,9 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run import json -import freeflowuniverse.herolib.baobab.specification -import freeflowuniverse.herolib.schemas.jsonschema -import freeflowuniverse.herolib.schemas.openrpc +import incubaid.herolib.baobab.specification +import incubaid.herolib.schemas.jsonschema +import incubaid.herolib.schemas.openrpc import os const actor_specification = specification.ActorSpecification{ diff --git a/libarchive/examples/baobab/specification/specification_to_openrpc.vsh b/libarchive/examples/baobab/specification/specification_to_openrpc.vsh index 2eb079d8..79c5631f 100755 --- a/libarchive/examples/baobab/specification/specification_to_openrpc.vsh +++ b/libarchive/examples/baobab/specification/specification_to_openrpc.vsh @@ -1,10 +1,10 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run import json -import freeflowuniverse.herolib.baobab.specification -import freeflowuniverse.herolib.core.code -import freeflowuniverse.herolib.schemas.jsonschema -import freeflowuniverse.herolib.schemas.openrpc +import incubaid.herolib.baobab.specification +import incubaid.herolib.core.code +import incubaid.herolib.schemas.jsonschema +import incubaid.herolib.schemas.openrpc import os const actor_specification = specification.ActorSpecification{ diff --git a/libarchive/installers/web/caddy2/caddy_actions.v b/libarchive/installers/web/caddy2/caddy_actions.v index e04626aa..a76761ac 100644 --- a/libarchive/installers/web/caddy2/caddy_actions.v +++ b/libarchive/installers/web/caddy2/caddy_actions.v @@ -1,12 +1,12 @@ module caddy -import freeflowuniverse.herolib.osal -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.osal.systemd -import freeflowuniverse.herolib.osal.zinit -import freeflowuniverse.herolib.installers.ulist +import incubaid.herolib.osal +import incubaid.herolib.ui.console +import incubaid.herolib.core.texttools +import incubaid.herolib.core.pathlib +import incubaid.herolib.osal.systemd +import incubaid.herolib.osal.zinit +import incubaid.herolib.installers.ulist import os fn startupcmd() ![]zinit.ZProcessNewArgs { diff --git a/libarchive/installers/web/caddy2/caddy_factory_.v b/libarchive/installers/web/caddy2/caddy_factory_.v index 9e1f0bc5..7a0b6a8b 100644 --- a/libarchive/installers/web/caddy2/caddy_factory_.v +++ b/libarchive/installers/web/caddy2/caddy_factory_.v @@ -1,10 +1,10 @@ module caddy -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.core.playbook -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.sysadmin.startupmanager -import freeflowuniverse.herolib.osal.zinit +import incubaid.herolib.core.base +import incubaid.herolib.core.playbook +import incubaid.herolib.ui.console +import incubaid.herolib.sysadmin.startupmanager +import incubaid.herolib.osal.zinit import time __global ( diff --git a/libarchive/installers/web/caddy2/caddy_model.v b/libarchive/installers/web/caddy2/caddy_model.v index d3f704b9..2baaa59a 100644 --- a/libarchive/installers/web/caddy2/caddy_model.v +++ b/libarchive/installers/web/caddy2/caddy_model.v @@ -1,7 +1,7 @@ module caddy -import freeflowuniverse.herolib.data.paramsparser -import freeflowuniverse.herolib.data.encoderhero +import incubaid.herolib.data.paramsparser +import incubaid.herolib.data.encoderhero import os pub const xcaddy_version = '0.4.2' diff --git a/libarchive/installers/web/caddy2/installer.v b/libarchive/installers/web/caddy2/installer.v index 01545620..e8bf1b77 100644 --- a/libarchive/installers/web/caddy2/installer.v +++ b/libarchive/installers/web/caddy2/installer.v @@ -1,11 +1,11 @@ module caddy -import freeflowuniverse.herolib.osal -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.sysadmin.startupmanager -import freeflowuniverse.herolib.installers.lang.golang +import incubaid.herolib.osal +import incubaid.herolib.core.pathlib +import incubaid.herolib.core.texttools +import incubaid.herolib.ui.console +import incubaid.herolib.sysadmin.startupmanager +import incubaid.herolib.installers.lang.golang import os pub fn install_caddy_from_release() ! { diff --git a/libarchive/installers/web/caddy2/installers.v b/libarchive/installers/web/caddy2/installers.v index 3c42e54c..62c5cfb3 100644 --- a/libarchive/installers/web/caddy2/installers.v +++ b/libarchive/installers/web/caddy2/installers.v @@ -1,7 +1,7 @@ module caddy -import freeflowuniverse.herolib.osal -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.osal +import incubaid.herolib.ui.console pub fn install_caddy_from_release() ! { mut url := '' diff --git a/libarchive/installers/web/caddy2/play.v b/libarchive/installers/web/caddy2/play.v index cef12cb2..fcc56569 100644 --- a/libarchive/installers/web/caddy2/play.v +++ b/libarchive/installers/web/caddy2/play.v @@ -1,6 +1,6 @@ module caddy -import freeflowuniverse.herolib.core.playbook +import incubaid.herolib.core.playbook import os pub fn play(mut plbook playbook.PlayBook) ! { diff --git a/libarchive/installers/web/caddy2/readme.md b/libarchive/installers/web/caddy2/readme.md index a440becb..740715a2 100644 --- a/libarchive/installers/web/caddy2/readme.md +++ b/libarchive/installers/web/caddy2/readme.md @@ -1,14 +1,12 @@ # caddy - - To get started ```v -import freeflowuniverse.herolib.installers.web.caddy +import incubaid.herolib.installers.web.caddy mut installer:= caddy.get()! @@ -21,7 +19,6 @@ installer.start()! ## example heroscript - ```hero !!caddy.install homedir: '/home/user/caddy' @@ -32,5 +29,3 @@ installer.start()! port: 8888 ``` - - diff --git a/libarchive/mcp_baobab/baobab_tools.v b/libarchive/mcp_baobab/baobab_tools.v index 0c71db4b..ef30930b 100644 --- a/libarchive/mcp_baobab/baobab_tools.v +++ b/libarchive/mcp_baobab/baobab_tools.v @@ -1,11 +1,11 @@ module baobab -import freeflowuniverse.herolib.ai.mcp -import freeflowuniverse.herolib.schemas.jsonschema -import freeflowuniverse.herolib.core.code +import incubaid.herolib.ai.mcp +import incubaid.herolib.schemas.jsonschema +import incubaid.herolib.core.code import x.json2 as json { Any } -import freeflowuniverse.herolib.baobab.generator -import freeflowuniverse.herolib.baobab.specification +import incubaid.herolib.baobab.generator +import incubaid.herolib.baobab.specification // generate_methods_file MCP Tool // diff --git a/libarchive/mcp_baobab/baobab_tools_test.v b/libarchive/mcp_baobab/baobab_tools_test.v index cd406ca2..fa0457df 100644 --- a/libarchive/mcp_baobab/baobab_tools_test.v +++ b/libarchive/mcp_baobab/baobab_tools_test.v @@ -1,7 +1,7 @@ module baobab -import freeflowuniverse.herolib.ai.mcp -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.ai.mcp +import incubaid.herolib.schemas.jsonrpc import json import x.json2 import os diff --git a/libarchive/mcp_baobab/mcp_test.v b/libarchive/mcp_baobab/mcp_test.v index f2d02dcc..728342ea 100644 --- a/libarchive/mcp_baobab/mcp_test.v +++ b/libarchive/mcp_baobab/mcp_test.v @@ -1,7 +1,7 @@ module baobab -import freeflowuniverse.herolib.ai.mcp -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.ai.mcp +import incubaid.herolib.schemas.jsonrpc import json import x.json2 diff --git a/libarchive/mcp_baobab/server.v b/libarchive/mcp_baobab/server.v index c90c24c8..15b28c3c 100644 --- a/libarchive/mcp_baobab/server.v +++ b/libarchive/mcp_baobab/server.v @@ -1,8 +1,8 @@ module baobab -import freeflowuniverse.herolib.ai.mcp -import freeflowuniverse.herolib.ai.mcp.logger -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.ai.mcp +import incubaid.herolib.ai.mcp.logger +import incubaid.herolib.schemas.jsonrpc @[heap] pub struct Baobab {} diff --git a/libarchive/mcp_old/README.md b/libarchive/mcp_old/README.md index 543fb1ef..c639c6bb 100644 --- a/libarchive/mcp_old/README.md +++ b/libarchive/mcp_old/README.md @@ -85,8 +85,8 @@ curl -fsSL https://bun.sh/install | bash To create a new MCP server using the core module: ```v -import freeflowuniverse.herolib.mcp -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.mcp +import incubaid.herolib.schemas.jsonrpc // Create a backend (memory-based or custom implementation) backend := mcp.MemoryBackend{ diff --git a/libarchive/mcp_old/baobab/baobab_tools.v b/libarchive/mcp_old/baobab/baobab_tools.v index 344f6d1b..adffd64c 100644 --- a/libarchive/mcp_old/baobab/baobab_tools.v +++ b/libarchive/mcp_old/baobab/baobab_tools.v @@ -1,11 +1,11 @@ module baobab -import freeflowuniverse.herolib.mcp -import freeflowuniverse.herolib.schemas.jsonschema -import freeflowuniverse.herolib.develop.codetools as code +import incubaid.herolib.mcp +import incubaid.herolib.schemas.jsonschema +import incubaid.herolib.develop.codetools as code import x.json2 as json { Any } -import freeflowuniverse.herolib.baobab.generator -import freeflowuniverse.herolib.baobab.specification +import incubaid.herolib.baobab.generator +import incubaid.herolib.baobab.specification // generate_methods_file MCP Tool // diff --git a/libarchive/mcp_old/baobab/baobab_tools_test.v b/libarchive/mcp_old/baobab/baobab_tools_test.v index 9c6c51a3..45311810 100644 --- a/libarchive/mcp_old/baobab/baobab_tools_test.v +++ b/libarchive/mcp_old/baobab/baobab_tools_test.v @@ -1,7 +1,7 @@ module baobab -import freeflowuniverse.herolib.mcp -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.mcp +import incubaid.herolib.schemas.jsonrpc import json import x.json2 import os diff --git a/libarchive/mcp_old/baobab/mcp_test.v b/libarchive/mcp_old/baobab/mcp_test.v index 2ffa7898..bfc97bb1 100644 --- a/libarchive/mcp_old/baobab/mcp_test.v +++ b/libarchive/mcp_old/baobab/mcp_test.v @@ -1,7 +1,7 @@ module baobab -import freeflowuniverse.herolib.mcp -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.mcp +import incubaid.herolib.schemas.jsonrpc import json import x.json2 diff --git a/libarchive/mcp_old/baobab/server.v b/libarchive/mcp_old/baobab/server.v index d0d4942a..1fa56cea 100644 --- a/libarchive/mcp_old/baobab/server.v +++ b/libarchive/mcp_old/baobab/server.v @@ -1,8 +1,8 @@ module baobab -import freeflowuniverse.herolib.mcp -import freeflowuniverse.herolib.mcp.logger -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.mcp +import incubaid.herolib.mcp.logger +import incubaid.herolib.schemas.jsonrpc @[heap] pub struct Baobab {} diff --git a/libarchive/mcp_old/cmd/mcp.v b/libarchive/mcp_old/cmd/mcp.v index e28ac606..62b036ee 100644 --- a/libarchive/mcp_old/cmd/mcp.v +++ b/libarchive/mcp_old/cmd/mcp.v @@ -2,11 +2,11 @@ module main import os import cli { Command, Flag } -import freeflowuniverse.herolib.osal.core as osal -// import freeflowuniverse.herolib.mcp.vcode -// import freeflowuniverse.herolib.mcp.mcpgen -// import freeflowuniverse.herolib.mcp.baobab -import freeflowuniverse.herolib.mcp.rhai.mcp as rhai_mcp +import incubaid.herolib.osal.core as osal +// import incubaid.herolib.mcp.vcode +// import incubaid.herolib.mcp.mcpgen +// import incubaid.herolib.mcp.baobab +import incubaid.herolib.mcp.rhai.mcp as rhai_mcp fn main() { do() or { panic(err) } diff --git a/libarchive/mcp_old/factory.v b/libarchive/mcp_old/factory.v index 2eadf874..349e717e 100644 --- a/libarchive/mcp_old/factory.v +++ b/libarchive/mcp_old/factory.v @@ -1,7 +1,7 @@ module mcp -import freeflowuniverse.herolib.schemas.jsonrpc -import freeflowuniverse.herolib.mcp.transport +import incubaid.herolib.schemas.jsonrpc +import incubaid.herolib.mcp.transport // Wrapper functions to convert string-based handlers to jsonrpc.Request/Response format // We reconstruct the original JSON to avoid double-encoding issues diff --git a/libarchive/mcp_old/handler_initialize.v b/libarchive/mcp_old/handler_initialize.v index 01b52e7f..c61f1e9f 100644 --- a/libarchive/mcp_old/handler_initialize.v +++ b/libarchive/mcp_old/handler_initialize.v @@ -4,7 +4,7 @@ import time import os import log import x.json2 -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.schemas.jsonrpc // initialize_handler handles the initialize request according to the MCP specification fn (mut s Server) initialize_handler(data string) !string { diff --git a/libarchive/mcp_old/handler_initialize_test.v b/libarchive/mcp_old/handler_initialize_test.v index a496a162..8634b34e 100644 --- a/libarchive/mcp_old/handler_initialize_test.v +++ b/libarchive/mcp_old/handler_initialize_test.v @@ -1,6 +1,6 @@ module mcp -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.schemas.jsonrpc import json // This file contains tests for the MCP initialize handler implementation. diff --git a/libarchive/mcp_old/handler_logging.v b/libarchive/mcp_old/handler_logging.v index 4cb0cc7e..732d7ccd 100644 --- a/libarchive/mcp_old/handler_logging.v +++ b/libarchive/mcp_old/handler_logging.v @@ -1,7 +1,7 @@ module mcp import x.json2 -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.schemas.jsonrpc // LogLevel represents the logging levels supported by MCP pub enum LogLevel { diff --git a/libarchive/mcp_old/handler_prompts.v b/libarchive/mcp_old/handler_prompts.v index bfb26fe0..5782537d 100644 --- a/libarchive/mcp_old/handler_prompts.v +++ b/libarchive/mcp_old/handler_prompts.v @@ -5,7 +5,7 @@ import os import log import x.json2 import json -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.schemas.jsonrpc // Prompt related structs diff --git a/libarchive/mcp_old/handler_resources.v b/libarchive/mcp_old/handler_resources.v index 7fb17075..d35e5119 100644 --- a/libarchive/mcp_old/handler_resources.v +++ b/libarchive/mcp_old/handler_resources.v @@ -1,7 +1,7 @@ module mcp import json -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.schemas.jsonrpc pub struct Resource { pub: diff --git a/libarchive/mcp_old/handler_tools.v b/libarchive/mcp_old/handler_tools.v index 8c175c28..b1ce3da9 100644 --- a/libarchive/mcp_old/handler_tools.v +++ b/libarchive/mcp_old/handler_tools.v @@ -5,8 +5,8 @@ import os import log import x.json2 import json -import freeflowuniverse.herolib.schemas.jsonrpc -import freeflowuniverse.herolib.schemas.jsonschema +import incubaid.herolib.schemas.jsonrpc +import incubaid.herolib.schemas.jsonschema // Tool related structs diff --git a/libarchive/mcp_old/mcpgen/mcpgen.v b/libarchive/mcp_old/mcpgen/mcpgen.v index fb06d7f3..5ff98e8a 100644 --- a/libarchive/mcp_old/mcpgen/mcpgen.v +++ b/libarchive/mcp_old/mcpgen/mcpgen.v @@ -1,9 +1,9 @@ module mcpgen -import freeflowuniverse.herolib.develop.codetools as code -import freeflowuniverse.herolib.mcp -import freeflowuniverse.herolib.schemas.jsonschema -import freeflowuniverse.herolib.schemas.jsonschema.codegen +import incubaid.herolib.develop.codetools as code +import incubaid.herolib.mcp +import incubaid.herolib.schemas.jsonschema +import incubaid.herolib.schemas.jsonschema.codegen import os pub struct FunctionPointer { diff --git a/libarchive/mcp_old/mcpgen/mcpgen_helpers.v b/libarchive/mcp_old/mcpgen/mcpgen_helpers.v index c95b934c..c029b557 100644 --- a/libarchive/mcp_old/mcpgen/mcpgen_helpers.v +++ b/libarchive/mcp_old/mcpgen/mcpgen_helpers.v @@ -1,6 +1,6 @@ module mcpgen -import freeflowuniverse.herolib.mcp +import incubaid.herolib.mcp pub fn result_to_mcp_tool_contents[T](result T) []mcp.ToolContent { return [result_to_mcp_tool_content(result)] diff --git a/libarchive/mcp_old/mcpgen/mcpgen_tools.v b/libarchive/mcp_old/mcpgen/mcpgen_tools.v index e8c26e68..c181cb44 100644 --- a/libarchive/mcp_old/mcpgen/mcpgen_tools.v +++ b/libarchive/mcp_old/mcpgen/mcpgen_tools.v @@ -1,8 +1,8 @@ module mcpgen -import freeflowuniverse.herolib.mcp -import freeflowuniverse.herolib.develop.codetools as code -import freeflowuniverse.herolib.schemas.jsonschema +import incubaid.herolib.mcp +import incubaid.herolib.develop.codetools as code +import incubaid.herolib.schemas.jsonschema import x.json2 as json { Any } // import json diff --git a/libarchive/mcp_old/mcpgen/server.v b/libarchive/mcp_old/mcpgen/server.v index 4196a7ce..ecb313cf 100644 --- a/libarchive/mcp_old/mcpgen/server.v +++ b/libarchive/mcp_old/mcpgen/server.v @@ -1,7 +1,7 @@ module mcpgen -import freeflowuniverse.herolib.mcp.logger -import freeflowuniverse.herolib.mcp +import incubaid.herolib.mcp.logger +import incubaid.herolib.mcp @[heap] pub struct MCPGen {} diff --git a/libarchive/mcp_old/model_configuration.v b/libarchive/mcp_old/model_configuration.v index ec2ec77a..b38686f2 100644 --- a/libarchive/mcp_old/model_configuration.v +++ b/libarchive/mcp_old/model_configuration.v @@ -4,7 +4,7 @@ import time import os import log import x.json2 -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.schemas.jsonrpc const protocol_version = '2024-11-05' // MCP server implementation using stdio transport diff --git a/libarchive/mcp_old/model_configuration_test.v b/libarchive/mcp_old/model_configuration_test.v index 2b863571..ecd58631 100644 --- a/libarchive/mcp_old/model_configuration_test.v +++ b/libarchive/mcp_old/model_configuration_test.v @@ -1,6 +1,6 @@ module mcp -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.schemas.jsonrpc import json // This file contains tests for the MCP initialize handler implementation. diff --git a/libarchive/mcp_old/model_error.v b/libarchive/mcp_old/model_error.v index 8c2e17c7..afa8adc1 100644 --- a/libarchive/mcp_old/model_error.v +++ b/libarchive/mcp_old/model_error.v @@ -1,6 +1,6 @@ module mcp -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.schemas.jsonrpc // resource_not_found indicates that the requested resource doesn't exist. // This error is returned when the resource specified in the request is not found. diff --git a/libarchive/mcp_old/pugconvert/cmd/main.v b/libarchive/mcp_old/pugconvert/cmd/main.v index 0d4c483c..18dd1845 100644 --- a/libarchive/mcp_old/pugconvert/cmd/main.v +++ b/libarchive/mcp_old/pugconvert/cmd/main.v @@ -1,6 +1,6 @@ module main -import freeflowuniverse.herolib.mcp.servers.pugconvert.mcp +import incubaid.herolib.mcp.servers.pugconvert.mcp fn main() { // Create a new MCP server diff --git a/libarchive/mcp_old/pugconvert/logic/convertpug.v b/libarchive/mcp_old/pugconvert/logic/convertpug.v index dfb6cca9..ffafda18 100644 --- a/libarchive/mcp_old/pugconvert/logic/convertpug.v +++ b/libarchive/mcp_old/pugconvert/logic/convertpug.v @@ -1,8 +1,8 @@ module pugconvert -import freeflowuniverse.herolib.clients.openai -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.clients.openai +import incubaid.herolib.core.texttools +import incubaid.herolib.core.pathlib import json pub fn convert_pug(mydir string) ! { diff --git a/libarchive/mcp_old/pugconvert/logic/jetvalidation.v b/libarchive/mcp_old/pugconvert/logic/jetvalidation.v index bad12bf3..78498120 100644 --- a/libarchive/mcp_old/pugconvert/logic/jetvalidation.v +++ b/libarchive/mcp_old/pugconvert/logic/jetvalidation.v @@ -1,6 +1,6 @@ module pugconvert -import freeflowuniverse.herolib.core.httpconnection +import incubaid.herolib.core.httpconnection import json // JetTemplateResponse is the expected response structure from the validation service diff --git a/libarchive/mcp_old/pugconvert/mcp/handlers.v b/libarchive/mcp_old/pugconvert/mcp/handlers.v index 00deb811..c7e634ee 100644 --- a/libarchive/mcp_old/pugconvert/mcp/handlers.v +++ b/libarchive/mcp_old/pugconvert/mcp/handlers.v @@ -1,17 +1,17 @@ module mcp -import freeflowuniverse.herolib.mcp +import incubaid.herolib.mcp import x.json2 as json { Any } -import freeflowuniverse.herolib.mcp.aitools.pugconvert -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.mcp.aitools.pugconvert +import incubaid.herolib.core.pathlib import os -pub fn handler(arguments map[string]Any) !mcp.ToolCallResult { +pub fn handler(arguments map[string]Any) !ToolCallResult { path := arguments['path'].str() // Check if path exists if !os.exists(path) { - return mcp.ToolCallResult{ + return ToolCallResult{ is_error: true content: mcp.result_to_mcp_tool_contents[string]("Error: Path '${path}' does not exist") } @@ -25,7 +25,7 @@ pub fn handler(arguments map[string]Any) !mcp.ToolCallResult { if is_directory { // Convert all pug files in the directory pugconvert.convert_pug(path) or { - return mcp.ToolCallResult{ + return ToolCallResult{ is_error: true content: mcp.result_to_mcp_tool_contents[string]('Error converting pug files in directory: ${err}') } @@ -34,20 +34,20 @@ pub fn handler(arguments map[string]Any) !mcp.ToolCallResult { } else if path.ends_with('.pug') { // Convert a single pug file pugconvert.convert_pug_file(path) or { - return mcp.ToolCallResult{ + return ToolCallResult{ is_error: true content: mcp.result_to_mcp_tool_contents[string]('Error converting pug file: ${err}') } } message = "Successfully converted pug file '${path}'" } else { - return mcp.ToolCallResult{ + return ToolCallResult{ is_error: true content: mcp.result_to_mcp_tool_contents[string]("Error: Path '${path}' is not a directory or .pug file") } } - return mcp.ToolCallResult{ + return ToolCallResult{ is_error: false content: mcp.result_to_mcp_tool_contents[string](message) } diff --git a/libarchive/mcp_old/pugconvert/mcp/mcp.v b/libarchive/mcp_old/pugconvert/mcp/mcp.v index 7c14cbdc..bdb80640 100644 --- a/libarchive/mcp_old/pugconvert/mcp/mcp.v +++ b/libarchive/mcp_old/pugconvert/mcp/mcp.v @@ -1,23 +1,23 @@ module mcp -import freeflowuniverse.herolib.mcp -import freeflowuniverse.herolib.mcp.logger -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.mcp +import incubaid.herolib.mcp.logger +import incubaid.herolib.schemas.jsonrpc -pub fn new_mcp_server() !&mcp.Server { +pub fn new_mcp_server() !&Server { logger.info('Creating new Developer MCP server') // Initialize the server with the empty handlers map - mut server := mcp.new_server(mcp.MemoryBackend{ + mut server := mcp.new_server(MemoryBackend{ tools: { 'pugconvert': specs } tool_handlers: { 'pugconvert': handler } - }, mcp.ServerParams{ - config: mcp.ServerConfiguration{ - server_info: mcp.ServerInfo{ + }, ServerParams{ + config: ServerConfiguration{ + server_info: ServerInfo{ name: 'developer' version: '1.0.0' } diff --git a/libarchive/mcp_old/pugconvert/mcp/specifications.v b/libarchive/mcp_old/pugconvert/mcp/specifications.v index d01ff2d2..6d923cad 100644 --- a/libarchive/mcp_old/pugconvert/mcp/specifications.v +++ b/libarchive/mcp_old/pugconvert/mcp/specifications.v @@ -1,11 +1,11 @@ module mcp -import freeflowuniverse.herolib.mcp +import incubaid.herolib.mcp import x.json2 as json -import freeflowuniverse.herolib.schemas.jsonschema -import freeflowuniverse.herolib.mcp.logger +import incubaid.herolib.schemas.jsonschema +import incubaid.herolib.mcp.logger -const specs = mcp.Tool{ +const specs = Tool{ name: 'pugconvert' description: 'Convert Pug template files to Jet template files' input_schema: jsonschema.Schema{ diff --git a/libarchive/mcp_old/rhai/cmd/main.v b/libarchive/mcp_old/rhai/cmd/main.v index 13704783..f09d165c 100644 --- a/libarchive/mcp_old/rhai/cmd/main.v +++ b/libarchive/mcp_old/rhai/cmd/main.v @@ -1,6 +1,6 @@ module main -import freeflowuniverse.herolib.mcp.rhai.mcp +import incubaid.herolib.mcp.rhai.mcp import log fn main() { diff --git a/libarchive/mcp_old/rhai/example/example copy.vsh b/libarchive/mcp_old/rhai/example/example copy.vsh index 5d79814b..0749832a 100644 --- a/libarchive/mcp_old/rhai/example/example copy.vsh +++ b/libarchive/mcp_old/rhai/example/example copy.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.mcp.aitools.escalayer +import incubaid.herolib.mcp.aitools.escalayer import os fn main() { diff --git a/libarchive/mcp_old/rhai/example/example.vsh b/libarchive/mcp_old/rhai/example/example.vsh index b72d7bff..f2eedf72 100755 --- a/libarchive/mcp_old/rhai/example/example.vsh +++ b/libarchive/mcp_old/rhai/example/example.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.mcp.aitools.escalayer -import freeflowuniverse.herolib.core.redisclient +import incubaid.herolib.mcp.aitools.escalayer +import incubaid.herolib.core.redisclient import os fn main() { diff --git a/libarchive/mcp_old/rhai/logic/logic.v b/libarchive/mcp_old/rhai/logic/logic.v index 28d92ed1..2696312a 100644 --- a/libarchive/mcp_old/rhai/logic/logic.v +++ b/libarchive/mcp_old/rhai/logic/logic.v @@ -1,8 +1,8 @@ module logic -import freeflowuniverse.herolib.ai.escalayer -import freeflowuniverse.herolib.lang.rust -import freeflowuniverse.herolib.ai.utils +import incubaid.herolib.ai.escalayer +import incubaid.herolib.lang.rust +import incubaid.herolib.ai.utils import os pub fn generate_rhai_wrapper(name string, source_path string) !string { diff --git a/libarchive/mcp_old/rhai/mcp/mcp.v b/libarchive/mcp_old/rhai/mcp/mcp.v index b4321d3a..0cf2f75a 100644 --- a/libarchive/mcp_old/rhai/mcp/mcp.v +++ b/libarchive/mcp_old/rhai/mcp/mcp.v @@ -1,14 +1,14 @@ module mcp -import freeflowuniverse.herolib.mcp -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.mcp +import incubaid.herolib.schemas.jsonrpc import log -pub fn new_mcp_server() !&mcp.Server { +pub fn new_mcp_server() !&Server { log.info('Creating new Developer MCP server') // Initialize the server with the empty handlers map - mut server := mcp.new_server(mcp.MemoryBackend{ + mut server := mcp.new_server(MemoryBackend{ tools: { 'generate_rhai_wrapper': generate_rhai_wrapper_spec } @@ -21,9 +21,9 @@ pub fn new_mcp_server() !&mcp.Server { prompt_handlers: { 'rhai_wrapper': rhai_wrapper_prompt_handler } - }, mcp.ServerParams{ - config: mcp.ServerConfiguration{ - server_info: mcp.ServerInfo{ + }, ServerParams{ + config: ServerConfiguration{ + server_info: ServerInfo{ name: 'rhai' version: '1.0.0' } diff --git a/libarchive/mcp_old/rhai/mcp/prompts.v b/libarchive/mcp_old/rhai/mcp/prompts.v index 511f5f61..9eb59725 100644 --- a/libarchive/mcp_old/rhai/mcp/prompts.v +++ b/libarchive/mcp_old/rhai/mcp/prompts.v @@ -1,18 +1,18 @@ module mcp -import freeflowuniverse.herolib.mcp -import freeflowuniverse.herolib.develop.codetools as code -import freeflowuniverse.herolib.mcp.rhai.logic -import freeflowuniverse.herolib.schemas.jsonschema -import freeflowuniverse.herolib.lang.rust +import incubaid.herolib.mcp +import incubaid.herolib.develop.codetools as code +import incubaid.herolib.mcp.rhai.logic +import incubaid.herolib.schemas.jsonschema +import incubaid.herolib.lang.rust import x.json2 as json // Tool definition for the create_rhai_wrapper function -const rhai_wrapper_prompt_spec = mcp.Prompt{ +const rhai_wrapper_prompt_spec = Prompt{ name: 'rhai_wrapper' description: 'provides a prompt for creating Rhai wrappers for Rust functions that follow builder pattern and create examples corresponding to the provided example file' arguments: [ - mcp.PromptArgument{ + PromptArgument{ name: 'source_path' description: 'Path to the source directory' required: true @@ -21,7 +21,7 @@ const rhai_wrapper_prompt_spec = mcp.Prompt{ } // Tool handler for the create_rhai_wrapper function -pub fn rhai_wrapper_prompt_handler(arguments []string) ![]mcp.PromptMessage { +pub fn rhai_wrapper_prompt_handler(arguments []string) ![]PromptMessage { source_path := arguments[0] // Read and combine all Rust files in the source directory @@ -32,9 +32,9 @@ pub fn rhai_wrapper_prompt_handler(arguments []string) ![]mcp.PromptMessage { result := logic.rhai_wrapper_generation_prompt(name, source_code)! return [ - mcp.PromptMessage{ + PromptMessage{ role: 'assistant' - content: mcp.PromptContent{ + content: PromptContent{ typ: 'text' text: result } diff --git a/libarchive/mcp_old/rhai/mcp/specifications.v b/libarchive/mcp_old/rhai/mcp/specifications.v index 5b1644ba..2e528793 100644 --- a/libarchive/mcp_old/rhai/mcp/specifications.v +++ b/libarchive/mcp_old/rhai/mcp/specifications.v @@ -1,11 +1,11 @@ module mcp -import freeflowuniverse.herolib.mcp +import incubaid.herolib.mcp import x.json2 as json -import freeflowuniverse.herolib.schemas.jsonschema +import incubaid.herolib.schemas.jsonschema import log -const specs = mcp.Tool{ +const specs = Tool{ name: 'rhai_interface' description: 'Add Rhai Interface to Rust Code Files' input_schema: jsonschema.Schema{ diff --git a/libarchive/mcp_old/rhai/mcp/tools.v b/libarchive/mcp_old/rhai/mcp/tools.v index 912f52f1..5d7fdc90 100644 --- a/libarchive/mcp_old/rhai/mcp/tools.v +++ b/libarchive/mcp_old/rhai/mcp/tools.v @@ -1,13 +1,13 @@ module mcp -import freeflowuniverse.herolib.mcp -import freeflowuniverse.herolib.develop.codetools as code -import freeflowuniverse.herolib.mcp.rhai.logic -import freeflowuniverse.herolib.schemas.jsonschema +import incubaid.herolib.mcp +import incubaid.herolib.develop.codetools as code +import incubaid.herolib.mcp.rhai.logic +import incubaid.herolib.schemas.jsonschema import x.json2 as json { Any } // Tool definition for the generate_rhai_wrapper function -const generate_rhai_wrapper_spec = mcp.Tool{ +const generate_rhai_wrapper_spec = Tool{ name: 'generate_rhai_wrapper' description: 'generate_rhai_wrapper receives the name of a V language function string, and the path to the module in which it exists.' input_schema: jsonschema.Schema{ @@ -25,13 +25,13 @@ const generate_rhai_wrapper_spec = mcp.Tool{ } // Tool handler for the generate_rhai_wrapper function -pub fn generate_rhai_wrapper_handler(arguments map[string]Any) !mcp.ToolCallResult { +pub fn generate_rhai_wrapper_handler(arguments map[string]Any) !ToolCallResult { name := arguments['name'].str() source_path := arguments['source_path'].str() result := logic.generate_rhai_wrapper(name, source_path) or { return mcp.error_tool_call_result(err) } - return mcp.ToolCallResult{ + return ToolCallResult{ is_error: false content: mcp.result_to_mcp_tool_contents[string](result) } diff --git a/libarchive/mcp_old/server.v b/libarchive/mcp_old/server.v index 030b82fa..d93f2396 100644 --- a/libarchive/mcp_old/server.v +++ b/libarchive/mcp_old/server.v @@ -1,8 +1,8 @@ module mcp import log -import freeflowuniverse.herolib.schemas.jsonrpc -import freeflowuniverse.herolib.mcp.transport +import incubaid.herolib.schemas.jsonrpc +import incubaid.herolib.mcp.transport // Server is the main MCP server struct @[heap] diff --git a/libarchive/mcp_old/transport/http.v b/libarchive/mcp_old/transport/http.v index f27a5e0b..4b165e36 100644 --- a/libarchive/mcp_old/transport/http.v +++ b/libarchive/mcp_old/transport/http.v @@ -3,8 +3,8 @@ module transport import veb import veb.sse import time -import freeflowuniverse.herolib.schemas.jsonrpc -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.schemas.jsonrpc +import incubaid.herolib.ui.console // HttpTransport implements the Transport interface for HTTP communication. // It provides both JSON-RPC over HTTP and REST API endpoints for MCP servers. diff --git a/libarchive/mcp_old/transport/interface.v b/libarchive/mcp_old/transport/interface.v index df995203..7852944d 100644 --- a/libarchive/mcp_old/transport/interface.v +++ b/libarchive/mcp_old/transport/interface.v @@ -1,6 +1,6 @@ module transport -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.schemas.jsonrpc // Transport defines the interface for different MCP transport mechanisms. // This abstraction allows MCP servers to work with multiple transport protocols diff --git a/libarchive/mcp_old/transport/stdio.v b/libarchive/mcp_old/transport/stdio.v index 6377556a..54de6a97 100644 --- a/libarchive/mcp_old/transport/stdio.v +++ b/libarchive/mcp_old/transport/stdio.v @@ -2,8 +2,8 @@ module transport import time import os -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.ui.console +import incubaid.herolib.schemas.jsonrpc // StdioTransport implements the Transport interface for standard input/output communication. // This is the original MCP transport method where the server reads JSON-RPC requests from stdin diff --git a/libarchive/mcp_old/vcode/cmd/main.v b/libarchive/mcp_old/vcode/cmd/main.v index 5a3d1c70..0bccead6 100644 --- a/libarchive/mcp_old/vcode/cmd/main.v +++ b/libarchive/mcp_old/vcode/cmd/main.v @@ -1,6 +1,6 @@ module main -import freeflowuniverse.herolib.mcp.vcode +import incubaid.herolib.mcp.vcode fn main() { // Create a new MCP server diff --git a/libarchive/mcp_old/vcode/logic/server.v b/libarchive/mcp_old/vcode/logic/server.v index cb69a00d..ecaacba9 100644 --- a/libarchive/mcp_old/vcode/logic/server.v +++ b/libarchive/mcp_old/vcode/logic/server.v @@ -1,7 +1,7 @@ module vcode -import freeflowuniverse.herolib.mcp -import freeflowuniverse.herolib.mcp.logger +import incubaid.herolib.mcp +import incubaid.herolib.mcp.logger @[heap] pub struct VCode { diff --git a/libarchive/mcp_old/vcode/logic/vlang.v b/libarchive/mcp_old/vcode/logic/vlang.v index eea711d0..fd03b92c 100644 --- a/libarchive/mcp_old/vcode/logic/vlang.v +++ b/libarchive/mcp_old/vcode/logic/vlang.v @@ -1,12 +1,12 @@ module vcode -import freeflowuniverse.herolib.mcp -import freeflowuniverse.herolib.mcp.logger +import incubaid.herolib.mcp +import incubaid.herolib.mcp.logger import os import log fn get_module_dir(mod string) string { - module_parts := mod.trim_string_left('freeflowuniverse.herolib').split('.') + module_parts := mod.trim_string_left('incubaid.herolib').split('.') return '${os.home_dir()}/code/github/incubaid/herolib/lib/${module_parts.join('/')}' } diff --git a/libarchive/mcp_old/vcode/logic/vlang_tools.v b/libarchive/mcp_old/vcode/logic/vlang_tools.v index f99bc773..68b082ed 100644 --- a/libarchive/mcp_old/vcode/logic/vlang_tools.v +++ b/libarchive/mcp_old/vcode/logic/vlang_tools.v @@ -1,8 +1,8 @@ module vcode -import freeflowuniverse.herolib.mcp -import freeflowuniverse.herolib.develop.codetools as code -import freeflowuniverse.herolib.schemas.jsonschema +import incubaid.herolib.mcp +import incubaid.herolib.develop.codetools as code +import incubaid.herolib.schemas.jsonschema import x.json2 { Any } const get_function_from_file_tool = mcp.Tool{ diff --git a/libarchive/mcp_old/vcode/logic/write_vfile_tool.v b/libarchive/mcp_old/vcode/logic/write_vfile_tool.v index 19c69563..999ade5f 100644 --- a/libarchive/mcp_old/vcode/logic/write_vfile_tool.v +++ b/libarchive/mcp_old/vcode/logic/write_vfile_tool.v @@ -1,8 +1,8 @@ module vcode -import freeflowuniverse.herolib.mcp -import freeflowuniverse.herolib.develop.codetools as code -import freeflowuniverse.herolib.schemas.jsonschema +import incubaid.herolib.mcp +import incubaid.herolib.develop.codetools as code +import incubaid.herolib.schemas.jsonschema import x.json2 { Any } const write_vfile_tool = mcp.Tool{ diff --git a/libarchive/mcp_old/vcode/mcp/handlers.v b/libarchive/mcp_old/vcode/mcp/handlers.v index 770bab95..1c66f4d1 100644 --- a/libarchive/mcp_old/vcode/mcp/handlers.v +++ b/libarchive/mcp_old/vcode/mcp/handlers.v @@ -1,9 +1,9 @@ module pugconvert -import freeflowuniverse.herolib.mcp +import incubaid.herolib.mcp import x.json2 as json { Any } -import freeflowuniverse.herolib.mcp.aitools.pugconvert -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.mcp.aitools.pugconvert +import incubaid.herolib.core.pathlib import os pub fn handler(arguments map[string]Any) !mcp.ToolCallResult { diff --git a/libarchive/mcp_old/vcode/mcp/mcp.v b/libarchive/mcp_old/vcode/mcp/mcp.v index 720b8d19..dfad8d71 100644 --- a/libarchive/mcp_old/vcode/mcp/mcp.v +++ b/libarchive/mcp_old/vcode/mcp/mcp.v @@ -1,8 +1,8 @@ module pugconvert -import freeflowuniverse.herolib.mcp -import freeflowuniverse.herolib.mcp.logger -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.mcp +import incubaid.herolib.mcp.logger +import incubaid.herolib.schemas.jsonrpc pub fn new_mcp_server() !&mcp.Server { logger.info('Creating new Developer MCP server') diff --git a/libarchive/mcp_old/vcode/mcp/specifications.v b/libarchive/mcp_old/vcode/mcp/specifications.v index 3990b577..e6493eb9 100644 --- a/libarchive/mcp_old/vcode/mcp/specifications.v +++ b/libarchive/mcp_old/vcode/mcp/specifications.v @@ -1,9 +1,9 @@ module pugconvert -import freeflowuniverse.herolib.mcp +import incubaid.herolib.mcp import x.json2 as json -import freeflowuniverse.herolib.schemas.jsonschema -import freeflowuniverse.herolib.mcp.logger +import incubaid.herolib.schemas.jsonschema +import incubaid.herolib.mcp.logger const specs = mcp.Tool{ name: 'pugconvert' diff --git a/libarchive/mcp_pugconvert/cmd/main.v b/libarchive/mcp_pugconvert/cmd/main.v index 5bf6791b..fec57ae4 100644 --- a/libarchive/mcp_pugconvert/cmd/main.v +++ b/libarchive/mcp_pugconvert/cmd/main.v @@ -1,6 +1,6 @@ module main -import freeflowuniverse.herolib.ai.mcp.servers.pugconvert.mcp +import incubaid.herolib.ai.mcp.servers.pugconvert.mcp fn main() { // Create a new MCP server diff --git a/libarchive/mcp_pugconvert/logic/convertpug.v b/libarchive/mcp_pugconvert/logic/convertpug.v index dfb6cca9..ffafda18 100644 --- a/libarchive/mcp_pugconvert/logic/convertpug.v +++ b/libarchive/mcp_pugconvert/logic/convertpug.v @@ -1,8 +1,8 @@ module pugconvert -import freeflowuniverse.herolib.clients.openai -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.clients.openai +import incubaid.herolib.core.texttools +import incubaid.herolib.core.pathlib import json pub fn convert_pug(mydir string) ! { diff --git a/libarchive/mcp_pugconvert/logic/jetvalidation.v b/libarchive/mcp_pugconvert/logic/jetvalidation.v index bad12bf3..78498120 100644 --- a/libarchive/mcp_pugconvert/logic/jetvalidation.v +++ b/libarchive/mcp_pugconvert/logic/jetvalidation.v @@ -1,6 +1,6 @@ module pugconvert -import freeflowuniverse.herolib.core.httpconnection +import incubaid.herolib.core.httpconnection import json // JetTemplateResponse is the expected response structure from the validation service diff --git a/libarchive/mcp_pugconvert/mcp/handlers.v b/libarchive/mcp_pugconvert/mcp/handlers.v index 4d944de8..2b806f56 100644 --- a/libarchive/mcp_pugconvert/mcp/handlers.v +++ b/libarchive/mcp_pugconvert/mcp/handlers.v @@ -1,17 +1,17 @@ module mcp -import freeflowuniverse.herolib.ai.mcp +import incubaid.herolib.ai.mcp import x.json2 as json { Any } -import freeflowuniverse.herolib.ai.mcp.aitools.pugconvert -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.ai.mcp.aitools.pugconvert +import incubaid.herolib.core.pathlib import os -pub fn handler(arguments map[string]Any) !mcp.ToolCallResult { +pub fn handler(arguments map[string]Any) !ToolCallResult { path := arguments['path'].str() // Check if path exists if !os.exists(path) { - return mcp.ToolCallResult{ + return ToolCallResult{ is_error: true content: mcp.result_to_mcp_tool_contents[string]("Error: Path '${path}' does not exist") } @@ -25,7 +25,7 @@ pub fn handler(arguments map[string]Any) !mcp.ToolCallResult { if is_directory { // Convert all pug files in the directory pugconvert.convert_pug(path) or { - return mcp.ToolCallResult{ + return ToolCallResult{ is_error: true content: mcp.result_to_mcp_tool_contents[string]('Error converting pug files in directory: ${err}') } @@ -34,20 +34,20 @@ pub fn handler(arguments map[string]Any) !mcp.ToolCallResult { } else if path.ends_with('.pug') { // Convert a single pug file pugconvert.convert_pug_file(path) or { - return mcp.ToolCallResult{ + return ToolCallResult{ is_error: true content: mcp.result_to_mcp_tool_contents[string]('Error converting pug file: ${err}') } } message = "Successfully converted pug file '${path}'" } else { - return mcp.ToolCallResult{ + return ToolCallResult{ is_error: true content: mcp.result_to_mcp_tool_contents[string]("Error: Path '${path}' is not a directory or .pug file") } } - return mcp.ToolCallResult{ + return ToolCallResult{ is_error: false content: mcp.result_to_mcp_tool_contents[string](message) } diff --git a/libarchive/mcp_pugconvert/mcp/mcp.v b/libarchive/mcp_pugconvert/mcp/mcp.v index 32e6251f..c24f618a 100644 --- a/libarchive/mcp_pugconvert/mcp/mcp.v +++ b/libarchive/mcp_pugconvert/mcp/mcp.v @@ -1,23 +1,23 @@ module mcp -import freeflowuniverse.herolib.ai.mcp -import freeflowuniverse.herolib.ai.mcp.logger -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.ai.mcp +import incubaid.herolib.ai.mcp.logger +import incubaid.herolib.schemas.jsonrpc -pub fn new_mcp_server() !&mcp.Server { +pub fn new_mcp_server() !&Server { logger.info('Creating new Developer MCP server') // Initialize the server with the empty handlers map - mut server := mcp.new_server(mcp.MemoryBackend{ + mut server := mcp.new_server(MemoryBackend{ tools: { 'pugconvert': specs } tool_handlers: { 'pugconvert': handler } - }, mcp.ServerParams{ - config: mcp.ServerConfiguration{ - server_info: mcp.ServerInfo{ + }, ServerParams{ + config: ServerConfiguration{ + server_info: ServerInfo{ name: 'developer' version: '1.0.0' } diff --git a/libarchive/mcp_pugconvert/mcp/specifications.v b/libarchive/mcp_pugconvert/mcp/specifications.v index 3a912407..bc129928 100644 --- a/libarchive/mcp_pugconvert/mcp/specifications.v +++ b/libarchive/mcp_pugconvert/mcp/specifications.v @@ -1,11 +1,11 @@ module mcp -import freeflowuniverse.herolib.ai.mcp +import incubaid.herolib.ai.mcp import x.json2 as json -import freeflowuniverse.herolib.schemas.jsonschema -import freeflowuniverse.herolib.ai.mcp.logger +import incubaid.herolib.schemas.jsonschema +import incubaid.herolib.ai.mcp.logger -const specs = mcp.Tool{ +const specs = Tool{ name: 'pugconvert' description: 'Convert Pug template files to Jet template files' input_schema: jsonschema.Schema{ diff --git a/libarchive/mcp_rust_wip/generics.v b/libarchive/mcp_rust_wip/generics.v index c9455cb4..7228b677 100644 --- a/libarchive/mcp_rust_wip/generics.v +++ b/libarchive/mcp_rust_wip/generics.v @@ -1,6 +1,6 @@ module rust -import freeflowuniverse.herolib.ai.mcp { ToolContent } +import incubaid.herolib.ai.mcp { ToolContent } pub fn result_to_mcp_tool_contents[T](result T) []ToolContent { return [result_to_mcp_tool_content[T](result)] diff --git a/libarchive/mcp_rust_wip/mcp.v b/libarchive/mcp_rust_wip/mcp.v index c8f52cb8..11acd33f 100644 --- a/libarchive/mcp_rust_wip/mcp.v +++ b/libarchive/mcp_rust_wip/mcp.v @@ -1,7 +1,7 @@ module rust -import freeflowuniverse.herolib.ai.mcp -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.ai.mcp +import incubaid.herolib.schemas.jsonrpc import log pub fn new_mcp_server() !&mcp.Server { diff --git a/libarchive/mcp_rust_wip/prompts.v b/libarchive/mcp_rust_wip/prompts.v index d6d33b10..45e3a46a 100644 --- a/libarchive/mcp_rust_wip/prompts.v +++ b/libarchive/mcp_rust_wip/prompts.v @@ -1,6 +1,6 @@ module rust -import freeflowuniverse.herolib.ai.mcp +import incubaid.herolib.ai.mcp import os import x.json2 as json diff --git a/libarchive/mcp_rust_wip/tools.v b/libarchive/mcp_rust_wip/tools.v index 2e98aac6..cc082bc5 100644 --- a/libarchive/mcp_rust_wip/tools.v +++ b/libarchive/mcp_rust_wip/tools.v @@ -1,8 +1,8 @@ module rust -import freeflowuniverse.herolib.ai.mcp -import freeflowuniverse.herolib.lang.rust -import freeflowuniverse.herolib.schemas.jsonschema +import incubaid.herolib.ai.mcp +import incubaid.herolib.lang.rust +import incubaid.herolib.schemas.jsonschema import x.json2 as json { Any } // Tool specification for listing functions in a Rust file diff --git a/libarchive/openrpc_remove/examples/job_client.vsh b/libarchive/openrpc_remove/examples/job_client.vsh index bc2d03e7..26270b54 100755 --- a/libarchive/openrpc_remove/examples/job_client.vsh +++ b/libarchive/openrpc_remove/examples/job_client.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.core.jobs.model +import incubaid.herolib.core.jobs.model import net.websocket import json import rand diff --git a/libarchive/openrpc_remove/examples/server.vsh b/libarchive/openrpc_remove/examples/server.vsh index 0e94d65a..04678032 100755 --- a/libarchive/openrpc_remove/examples/server.vsh +++ b/libarchive/openrpc_remove/examples/server.vsh @@ -1,7 +1,7 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.core.jobs.openrpc -import freeflowuniverse.herolib.core.jobs.model +import incubaid.herolib.core.jobs.openrpc +import incubaid.herolib.core.jobs.model import time import sync import os diff --git a/libarchive/openrpc_remove/factory.v b/libarchive/openrpc_remove/factory.v index 1097bb90..f853a135 100644 --- a/libarchive/openrpc_remove/factory.v +++ b/libarchive/openrpc_remove/factory.v @@ -1,7 +1,7 @@ module openrpc -import freeflowuniverse.herolib.core.redisclient -import freeflowuniverse.herolib.core.jobs.model +import incubaid.herolib.core.redisclient +import incubaid.herolib.core.jobs.model // Generic OpenRPC server that handles all managers pub struct OpenRPCServer { diff --git a/libarchive/openrpc_remove/handler.v b/libarchive/openrpc_remove/handler.v index 80d89b00..3a9cb840 100644 --- a/libarchive/openrpc_remove/handler.v +++ b/libarchive/openrpc_remove/handler.v @@ -1,6 +1,6 @@ module openrpc -import freeflowuniverse.herolib.core.redisclient +import incubaid.herolib.core.redisclient import json // Start the server and listen for requests diff --git a/libarchive/openrpc_remove/handler_agent_manager.v b/libarchive/openrpc_remove/handler_agent_manager.v index 10d873c9..8776bde5 100644 --- a/libarchive/openrpc_remove/handler_agent_manager.v +++ b/libarchive/openrpc_remove/handler_agent_manager.v @@ -1,6 +1,6 @@ module openrpc -import freeflowuniverse.herolib.core.jobs.model +import incubaid.herolib.core.jobs.model import json pub fn (mut h OpenRPCServer) handle_request_agent(request OpenRPCRequest) !OpenRPCResponse { diff --git a/libarchive/openrpc_remove/handler_group_manager.v b/libarchive/openrpc_remove/handler_group_manager.v index 187b0c96..0b96b039 100644 --- a/libarchive/openrpc_remove/handler_group_manager.v +++ b/libarchive/openrpc_remove/handler_group_manager.v @@ -1,6 +1,6 @@ module openrpc -import freeflowuniverse.herolib.core.jobs.model +import incubaid.herolib.core.jobs.model import json pub fn (mut h OpenRPCServer) handle_request_group(request OpenRPCRequest) !OpenRPCResponse { diff --git a/libarchive/openrpc_remove/handler_job_manager.v b/libarchive/openrpc_remove/handler_job_manager.v index 4cddda21..968141e8 100644 --- a/libarchive/openrpc_remove/handler_job_manager.v +++ b/libarchive/openrpc_remove/handler_job_manager.v @@ -1,6 +1,6 @@ module openrpc -import freeflowuniverse.herolib.core.jobs.model +import incubaid.herolib.core.jobs.model import json pub fn (mut h OpenRPCServer) handle_request_job(request OpenRPCRequest) !OpenRPCResponse { diff --git a/libarchive/openrpc_remove/handler_service_manager.v b/libarchive/openrpc_remove/handler_service_manager.v index b7a59cd2..6371658e 100644 --- a/libarchive/openrpc_remove/handler_service_manager.v +++ b/libarchive/openrpc_remove/handler_service_manager.v @@ -1,6 +1,6 @@ module openrpc -import freeflowuniverse.herolib.core.jobs.model +import incubaid.herolib.core.jobs.model import json pub fn (mut h OpenRPCServer) handle_request_service(request OpenRPCRequest) !OpenRPCResponse { diff --git a/libarchive/openrpc_remove/ws_server.v b/libarchive/openrpc_remove/ws_server.v index ded269c6..74b974c9 100644 --- a/libarchive/openrpc_remove/ws_server.v +++ b/libarchive/openrpc_remove/ws_server.v @@ -1,7 +1,7 @@ module openrpc import net.websocket -import freeflowuniverse.herolib.core.redisclient +import incubaid.herolib.core.redisclient import json import rand diff --git a/libarchive/rhai/generate_rhai_example.v b/libarchive/rhai/generate_rhai_example.v index 75e799e9..43244dc4 100644 --- a/libarchive/rhai/generate_rhai_example.v +++ b/libarchive/rhai/generate_rhai_example.v @@ -1,7 +1,7 @@ module rhai import log -import freeflowuniverse.herolib.ai.escalayer +import incubaid.herolib.ai.escalayer pub struct WrapperGenerator { pub: diff --git a/libarchive/rhai/generate_wrapper_module.v b/libarchive/rhai/generate_wrapper_module.v index db5e83c0..35df5669 100644 --- a/libarchive/rhai/generate_wrapper_module.v +++ b/libarchive/rhai/generate_wrapper_module.v @@ -1,6 +1,6 @@ module rhai -import freeflowuniverse.herolib.lang.rust +import incubaid.herolib.lang.rust import os // generates rhai wrapper for given source rust code diff --git a/libarchive/rhai/register_types.v b/libarchive/rhai/register_types.v index a4dc707d..424e498a 100644 --- a/libarchive/rhai/register_types.v +++ b/libarchive/rhai/register_types.v @@ -1,7 +1,7 @@ module rhai import strings -import freeflowuniverse.herolib.lang.rust +import incubaid.herolib.lang.rust // generate_rhai_registration generates Rust code to register a Rust struct and its fields with Rhai. // Input: rust_struct_definition - A string containing the Rust struct definition. diff --git a/libarchive/rhai/register_types_test.v b/libarchive/rhai/register_types_test.v index 8aa9a0b2..8e306cb9 100644 --- a/libarchive/rhai/register_types_test.v +++ b/libarchive/rhai/register_types_test.v @@ -1,7 +1,7 @@ module rhai import os -import freeflowuniverse.herolib.lang.rust // Import the rust module +import incubaid.herolib.lang.rust // Import the rust module fn test_generate_container_registration() { // Define the path to the test data file diff --git a/libarchive/rhai/rhai.v b/libarchive/rhai/rhai.v index 1f4e0424..36f1c794 100644 --- a/libarchive/rhai/rhai.v +++ b/libarchive/rhai/rhai.v @@ -1,7 +1,7 @@ module rhai import log -import freeflowuniverse.herolib.ai.escalayer +import incubaid.herolib.ai.escalayer // pub struct WrapperGenerator { // pub: diff --git a/libarchive/rhai/rhai_test.v b/libarchive/rhai/rhai_test.v index 7d3ef544..5bf9608d 100644 --- a/libarchive/rhai/rhai_test.v +++ b/libarchive/rhai/rhai_test.v @@ -1,9 +1,9 @@ module rhai -import freeflowuniverse.herolib.lang.rhai -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.lang.rhai +import incubaid.herolib.core.texttools // import strings // No longer needed directly here -import freeflowuniverse.herolib.lang.rust +import incubaid.herolib.lang.rust import os const test_data_file = os.dir(@FILE) + '/testdata/functions.rs' // Use path relative to this test file diff --git a/libarchive/rhai/verify.v b/libarchive/rhai/verify.v index d7772f3d..bec74456 100644 --- a/libarchive/rhai/verify.v +++ b/libarchive/rhai/verify.v @@ -1,8 +1,8 @@ module rhai -import freeflowuniverse.herolib.core.texttools +import incubaid.herolib.core.texttools // import strings // No longer needed directly here -import freeflowuniverse.herolib.lang.rust +import incubaid.herolib.lang.rust import os // Helper to extract the primary struct name from declarations diff --git a/libarchive/smartid/sid.v b/libarchive/smartid/sid.v index af8aa6e1..df7210fa 100644 --- a/libarchive/smartid/sid.v +++ b/libarchive/smartid/sid.v @@ -1,8 +1,8 @@ module smartid -// import freeflowuniverse.herolib.core.redisclient +// import incubaid.herolib.core.redisclient import math -// import freeflowuniverse.herolib.core.texttools.regext +// import incubaid.herolib.core.texttools.regext // import rand // each part min3 max 6 chars, each char = a...z or 0...9 diff --git a/libarchive/starlight/config.v b/libarchive/starlight/config.v index 2a2f3b48..c610c0bd 100644 --- a/libarchive/starlight/config.v +++ b/libarchive/starlight/config.v @@ -1,6 +1,6 @@ module starlight -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib import json import os diff --git a/libarchive/starlight/factory.v b/libarchive/starlight/factory.v index 18940fc7..873401a3 100644 --- a/libarchive/starlight/factory.v +++ b/libarchive/starlight/factory.v @@ -1,7 +1,7 @@ module starlight import os -import freeflowuniverse.herolib.core.pathlib +import incubaid.herolib.core.pathlib @[heap] pub struct StarlightFactory { diff --git a/libarchive/starlight/site.v b/libarchive/starlight/site.v index ab2d388c..17ae06d2 100644 --- a/libarchive/starlight/site.v +++ b/libarchive/starlight/site.v @@ -1,10 +1,10 @@ module starlight -import freeflowuniverse.herolib.osal.screen +import incubaid.herolib.osal.screen import os -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.pathlib +import incubaid.herolib.osal.core as osal +import incubaid.herolib.ui.console @[heap] pub struct DocSite { diff --git a/libarchive/starlight/site_get.v b/libarchive/starlight/site_get.v index 1b04db7f..2775340b 100644 --- a/libarchive/starlight/site_get.v +++ b/libarchive/starlight/site_get.v @@ -1,10 +1,10 @@ module starlight import os -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.develop.gittools -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.core.pathlib +import incubaid.herolib.core.texttools +import incubaid.herolib.develop.gittools +import incubaid.herolib.ui.console @[params] pub struct SiteGetArgs { @@ -46,7 +46,7 @@ pub fn (mut f StarlightFactory) get(args_ SiteGetArgs) !&DocSite { args.path = args.path.replace('~', os.home_dir()) mut r := gs.get_repo( - url: 'https://github.com/freeflowuniverse/starlight_template.git' + url: 'https://github.com/incubaid/starlight_template.git' )! mut template_path := r.patho()! diff --git a/libarchive/starlight/template.v b/libarchive/starlight/template.v index e06dbd92..50c07915 100644 --- a/libarchive/starlight/template.v +++ b/libarchive/starlight/template.v @@ -1,9 +1,9 @@ module starlight -import freeflowuniverse.herolib.develop.gittools -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.installers.web.bun -import freeflowuniverse.herolib.installers.web.tailwind +import incubaid.herolib.develop.gittools +import incubaid.herolib.osal.core as osal +import incubaid.herolib.installers.web.bun +import incubaid.herolib.installers.web.tailwind import os @[params] @@ -17,7 +17,7 @@ fn (mut self StarlightFactory) template_install(args TemplateInstallArgs) ! { mut gs := gittools.new()! mut r := gs.get_repo( - url: 'https://github.com/freeflowuniverse/starlight_template.git' + url: 'https://github.com/incubaid/starlight_template.git' pull: args.template_update )! mut template_path := r.patho()! diff --git a/libarchive/starlight/watcher.v b/libarchive/starlight/watcher.v index 9f7b19aa..b8ababb5 100644 --- a/libarchive/starlight/watcher.v +++ b/libarchive/starlight/watcher.v @@ -1,6 +1,6 @@ module starlight -import freeflowuniverse.herolib.osal.notifier +import incubaid.herolib.osal.notifier import os fn watch_docs(docs_path string, path_src string, path_build string) ! { diff --git a/libarchive/zinit/readme.md b/libarchive/zinit/readme.md index 679f4315..cf57ade2 100644 --- a/libarchive/zinit/readme.md +++ b/libarchive/zinit/readme.md @@ -22,7 +22,7 @@ Zinit is a process manager that allows you to manage services on a system. This ### Basic Usage ```v -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager fn main() { // Create a new Zinit client with the default socket path @@ -47,7 +47,7 @@ fn main() { ### Creating a New Service ```v -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager fn main() { mut zinit_client := zinit.new_stateless()! @@ -77,7 +77,7 @@ fn main() { ### Getting Service Statistics ```v -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager fn main() { mut zinit_client := zinit.new_stateless()! @@ -98,7 +98,7 @@ fn main() { ### Retrieving Logs ```v -import freeflowuniverse.herolib.osal.startupmanager +import incubaid.herolib.osal.startupmanager fn main() { mut zinit_client := zinit.new_stateless()! @@ -152,4 +152,4 @@ The full OpenRPC specification for the Zinit API is available in the `openrpc.js ## Example -See the `examples/osal/zinit/zinit_openrpc_example.v` file for a complete example of using the Zinit OpenRPC client. \ No newline at end of file +See the `examples/osal/zinit/zinit_openrpc_example.v` file for a complete example of using the Zinit OpenRPC client. diff --git a/libarchive/zinit/rpc.v b/libarchive/zinit/rpc.v index 62c599bd..88ae8950 100644 --- a/libarchive/zinit/rpc.v +++ b/libarchive/zinit/rpc.v @@ -2,7 +2,7 @@ module zinit import net.unix import json -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.ui.console // these need to be all private (non pub) diff --git a/libarchive/zinit/rpc_test.v b/libarchive/zinit/rpc_test.v index 3ed0daa3..b75efb09 100644 --- a/libarchive/zinit/rpc_test.v +++ b/libarchive/zinit/rpc_test.v @@ -2,8 +2,8 @@ module zinit import os import time -import freeflowuniverse.herolib.core -import freeflowuniverse.herolib.osal.core as osal +import incubaid.herolib.core +import incubaid.herolib.osal.core as osal fn test_zinit() { if !core.is_linux()! { diff --git a/libarchive/zinit/zinit.v b/libarchive/zinit/zinit.v index 5f8e7f69..f2355409 100644 --- a/libarchive/zinit/zinit.v +++ b/libarchive/zinit/zinit.v @@ -1,9 +1,9 @@ module zinit -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.data.ourtime +import incubaid.herolib.core.texttools +import incubaid.herolib.ui.console +import incubaid.herolib.core.pathlib +import incubaid.herolib.data.ourtime import os import json diff --git a/libarchive/zinit/zinit_client.v b/libarchive/zinit/zinit_client.v index f2d71dc5..f413bf16 100644 --- a/libarchive/zinit/zinit_client.v +++ b/libarchive/zinit/zinit_client.v @@ -1,6 +1,6 @@ module zinit -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.schemas.jsonrpc // Default socket path for Zinit pub const default_socket_path = '/tmp/zinit.sock' diff --git a/libarchive/zinit/zinit_factory.v b/libarchive/zinit/zinit_factory.v index 89921745..333f0717 100644 --- a/libarchive/zinit/zinit_factory.v +++ b/libarchive/zinit/zinit_factory.v @@ -1,8 +1,8 @@ module zinit -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.osal.core as osal +import incubaid.herolib.core.pathlib +import incubaid.herolib.ui.console +import incubaid.herolib.osal.core as osal __global ( zinit_global_manager []&Zinit diff --git a/libarchive/zinit/zinit_openrpc_test.v b/libarchive/zinit/zinit_openrpc_test.v index f5167e07..326526ff 100644 --- a/libarchive/zinit/zinit_openrpc_test.v +++ b/libarchive/zinit/zinit_openrpc_test.v @@ -1,6 +1,6 @@ module zinit -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.schemas.jsonrpc import os import rand import time diff --git a/libarchive/zinit/zinit_stateless.v b/libarchive/zinit/zinit_stateless.v index 93884f75..6f330aa2 100644 --- a/libarchive/zinit/zinit_stateless.v +++ b/libarchive/zinit/zinit_stateless.v @@ -1,9 +1,9 @@ module zinit -import freeflowuniverse.herolib.core.texttools -import freeflowuniverse.herolib.ui.console -import freeflowuniverse.herolib.core.pathlib -import freeflowuniverse.herolib.data.ourtime +import incubaid.herolib.core.texttools +import incubaid.herolib.ui.console +import incubaid.herolib.core.pathlib +import incubaid.herolib.data.ourtime import time import json diff --git a/libarchive/zinit/zprocess.v b/libarchive/zinit/zprocess.v index 2690e3dd..30e90963 100644 --- a/libarchive/zinit/zprocess.v +++ b/libarchive/zinit/zprocess.v @@ -1,9 +1,9 @@ module zinit import os -import freeflowuniverse.herolib.osal.core as osal -import freeflowuniverse.herolib.data.ourtime -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.osal.core as osal +import incubaid.herolib.data.ourtime +import incubaid.herolib.ui.console import time pub struct ZProcess { diff --git a/libwip/mcp_rhai/cmd/main.v b/libwip/mcp_rhai/cmd/main.v index 59b77f4e..9b9e1ba7 100644 --- a/libwip/mcp_rhai/cmd/main.v +++ b/libwip/mcp_rhai/cmd/main.v @@ -1,6 +1,6 @@ module main -import freeflowuniverse.herolib.ai.mcp.rhai.mcp +import incubaid.herolib.ai.mcp.rhai.mcp fn main() { // Create a new MCP server diff --git a/libwip/mcp_rhai/example/example copy.vsh b/libwip/mcp_rhai/example/example copy.vsh index 6920dac5..6a32c74e 100644 --- a/libwip/mcp_rhai/example/example copy.vsh +++ b/libwip/mcp_rhai/example/example copy.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.ai.mcp.aitools.escalayer +import incubaid.herolib.ai.mcp.aitools.escalayer import os fn main() { diff --git a/libwip/mcp_rhai/example/example.vsh b/libwip/mcp_rhai/example/example.vsh index b0ac996a..f95f6e1d 100755 --- a/libwip/mcp_rhai/example/example.vsh +++ b/libwip/mcp_rhai/example/example.vsh @@ -1,6 +1,6 @@ #!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run -import freeflowuniverse.herolib.ai.mcp.aitools.escalayer +import incubaid.herolib.ai.mcp.aitools.escalayer import os fn main() { diff --git a/libwip/mcp_rhai/logic/logic.v b/libwip/mcp_rhai/logic/logic.v index 982acfe0..554e1098 100644 --- a/libwip/mcp_rhai/logic/logic.v +++ b/libwip/mcp_rhai/logic/logic.v @@ -1,8 +1,8 @@ module logic -import freeflowuniverse.herolib.ai.escalayer -import freeflowuniverse.herolib.lang.rust -import freeflowuniverse.herolib.develop.codetools.utils as ai_utils +import incubaid.herolib.ai.escalayer +import incubaid.herolib.lang.rust +import incubaid.herolib.develop.codetools.utils as ai_utils import os pub fn generate_rhai_wrapper(name string, source_path string) !string { @@ -254,7 +254,8 @@ fn extract_code_blocks(response string) !CodeBlocks { } // Extract example.rhai content - mut example_rhai_content := ai_utils.extract_code_block(response, 'example.rhai', 'rhai') + mut example_rhai_content := ai_utils.extract_code_block(response, 'example.rhai', + 'rhai') if example_rhai_content == '' { // Try to extract from the response without explicit language marker example_rhai_content = ai_utils.extract_code_block(response, 'example.rhai', '') diff --git a/libwip/mcp_rhai/logic/logic_sampling.v b/libwip/mcp_rhai/logic/logic_sampling.v index 688070b7..ac802dd6 100644 --- a/libwip/mcp_rhai/logic/logic_sampling.v +++ b/libwip/mcp_rhai/logic/logic_sampling.v @@ -1,8 +1,8 @@ module logic -import freeflowuniverse.herolib.ai.escalayer -import freeflowuniverse.herolib.lang.rust -import freeflowuniverse.herolib.develop.codetools.utils as ai_utils +import incubaid.herolib.ai.escalayer +import incubaid.herolib.lang.rust +import incubaid.herolib.develop.codetools.utils as ai_utils import os // pub fn generate_rhai_wrapper_sampling(name string, source_path string) !string { diff --git a/libwip/mcp_rhai/mcp/mcp.v b/libwip/mcp_rhai/mcp/mcp.v index 730c0a4d..cf77c11a 100644 --- a/libwip/mcp_rhai/mcp/mcp.v +++ b/libwip/mcp_rhai/mcp/mcp.v @@ -1,14 +1,14 @@ module mcp -import freeflowuniverse.herolib.ai.mcp -import freeflowuniverse.herolib.schemas.jsonrpc +import incubaid.herolib.ai.mcp +import incubaid.herolib.schemas.jsonrpc import log -pub fn new_mcp_server() !&mcp.Server { +pub fn new_mcp_server() !&Server { log.info('Creating new Developer MCP server') // Initialize the server with the empty handlers map - mut server := mcp.new_server(mcp.MemoryBackend{ + mut server := mcp.new_server(MemoryBackend{ tools: { 'generate_rhai_wrapper': generate_rhai_wrapper_spec } @@ -21,9 +21,9 @@ pub fn new_mcp_server() !&mcp.Server { prompt_handlers: { 'rhai_wrapper': rhai_wrapper_prompt_handler } - }, mcp.ServerParams{ - config: mcp.ServerConfiguration{ - server_info: mcp.ServerInfo{ + }, ServerParams{ + config: ServerConfiguration{ + server_info: ServerInfo{ name: 'rhai' version: '1.0.0' } diff --git a/libwip/mcp_rhai/mcp/prompts.v b/libwip/mcp_rhai/mcp/prompts.v index 27cc60ce..1dfa6091 100644 --- a/libwip/mcp_rhai/mcp/prompts.v +++ b/libwip/mcp_rhai/mcp/prompts.v @@ -1,18 +1,18 @@ module mcp -import freeflowuniverse.herolib.ai.mcp -import freeflowuniverse.herolib.develop.codetools as code -import freeflowuniverse.herolib.ai.mcp.rhai.logic -import freeflowuniverse.herolib.schemas.jsonschema -import freeflowuniverse.herolib.lang.rust +import incubaid.herolib.ai.mcp +import incubaid.herolib.develop.codetools as code +import incubaid.herolib.ai.mcp.rhai.logic +import incubaid.herolib.schemas.jsonschema +import incubaid.herolib.lang.rust import x.json2 as json // Tool definition for the create_rhai_wrapper function -const rhai_wrapper_prompt_spec = mcp.Prompt{ +const rhai_wrapper_prompt_spec = Prompt{ name: 'rhai_wrapper' description: 'provides a prompt for creating Rhai wrappers for Rust functions that follow builder pattern and create examples corresponding to the provided example file' arguments: [ - mcp.PromptArgument{ + PromptArgument{ name: 'source_path' description: 'Path to the source directory' required: true @@ -21,7 +21,7 @@ const rhai_wrapper_prompt_spec = mcp.Prompt{ } // Tool handler for the create_rhai_wrapper function -pub fn rhai_wrapper_prompt_handler(arguments []string) ![]mcp.PromptMessage { +pub fn rhai_wrapper_prompt_handler(arguments []string) ![]PromptMessage { source_path := arguments[0] // Read and combine all Rust files in the source directory @@ -34,9 +34,9 @@ pub fn rhai_wrapper_prompt_handler(arguments []string) ![]mcp.PromptMessage { result := logic.rhai_wrapper_generation_prompt(name, source_code, source_pkg_info)! return [ - mcp.PromptMessage{ + PromptMessage{ role: 'assistant' - content: mcp.PromptContent{ + content: PromptContent{ typ: 'text' text: result } diff --git a/libwip/mcp_rhai/mcp/specifications.v b/libwip/mcp_rhai/mcp/specifications.v index a28447fb..dfd8b1bb 100644 --- a/libwip/mcp_rhai/mcp/specifications.v +++ b/libwip/mcp_rhai/mcp/specifications.v @@ -1,11 +1,11 @@ module mcp -import freeflowuniverse.herolib.ai.mcp +import incubaid.herolib.ai.mcp import x.json2 as json -import freeflowuniverse.herolib.schemas.jsonschema +import incubaid.herolib.schemas.jsonschema import log -const specs = mcp.Tool{ +const specs = Tool{ name: 'rhai_interface' description: 'Add Rhai Interface to Rust Code Files' input_schema: jsonschema.Schema{ diff --git a/libwip/mcp_rhai/mcp/tools.v b/libwip/mcp_rhai/mcp/tools.v index 0ea9682d..0b9a751a 100644 --- a/libwip/mcp_rhai/mcp/tools.v +++ b/libwip/mcp_rhai/mcp/tools.v @@ -1,13 +1,13 @@ module mcp -import freeflowuniverse.herolib.ai.mcp -import freeflowuniverse.herolib.develop.codetools as code -import freeflowuniverse.herolib.ai.mcp.rhai.logic -import freeflowuniverse.herolib.schemas.jsonschema +import incubaid.herolib.ai.mcp +import incubaid.herolib.develop.codetools as code +import incubaid.herolib.ai.mcp.rhai.logic +import incubaid.herolib.schemas.jsonschema import x.json2 as json { Any } // Tool definition for the generate_rhai_wrapper function -const generate_rhai_wrapper_spec = mcp.Tool{ +const generate_rhai_wrapper_spec = Tool{ name: 'generate_rhai_wrapper' description: 'generate_rhai_wrapper receives the name of a V language function string, and the path to the module in which it exists.' input_schema: jsonschema.Schema{ @@ -25,13 +25,13 @@ const generate_rhai_wrapper_spec = mcp.Tool{ } // Tool handler for the generate_rhai_wrapper function -pub fn generate_rhai_wrapper_handler(arguments map[string]Any) !mcp.ToolCallResult { +pub fn generate_rhai_wrapper_handler(arguments map[string]Any) !ToolCallResult { name := arguments['name'].str() source_path := arguments['source_path'].str() result := logic.generate_rhai_wrapper(name, source_path) or { return mcp.error_tool_call_result(err) } - return mcp.ToolCallResult{ + return ToolCallResult{ is_error: false content: mcp.result_to_mcp_tool_contents[string](result) } diff --git a/manual/best_practices/osal/silence.md b/manual/best_practices/osal/silence.md index 241731ae..86c1b42e 100644 --- a/manual/best_practices/osal/silence.md +++ b/manual/best_practices/osal/silence.md @@ -7,8 +7,8 @@ the example is a .vsh script note the arguments to v, this also makes sure there ```go #!/usr/bin/env -S v -n -w -enable-globals run -import freeflowuniverse.herolib.osal -import freeflowuniverse.herolib.ui.console +import incubaid.herolib.osal +import incubaid.herolib.ui.console console.silent_set() mut job2 := osal.exec(cmd: 'ls /',debug:true)! @@ -18,4 +18,4 @@ console.silent_unset() println("now I will get output") osal.exec(cmd: 'ls /',debug:true)! -``` \ No newline at end of file +``` diff --git a/manual/core/base.md b/manual/core/base.md index aeb55f11..9e0bee10 100644 --- a/manual/core/base.md +++ b/manual/core/base.md @@ -35,28 +35,26 @@ there is a KVS attached to each context/session - see [kvs](kvs.md) - # BaseConfig Clients, DALs, SAL's can inherit base - ```golang pub struct BaseConfig { pub mut: - session_ ?&Session - instance string + session_ ?&Session + instance string } //how to use -import freeflowuniverse.herolib.core.base +import incubaid.herolib.core.base pub struct B2Client { - base.BaseConfig + base.BaseConfig pub mut: - someprop string + someprop string } @@ -67,7 +65,6 @@ pub mut: This will give some super powers to each base inheritted class - ```v // return a session which has link to the actions and params on context and session level @@ -84,4 +81,4 @@ pub fn (mut self BaseConfig) session(args PlayArgs) &Session pub fn (mut self BaseConfig) context() &Context -``` \ No newline at end of file +``` diff --git a/manual/core/context.md b/manual/core/context.md index 323fe676..2af31848 100644 --- a/manual/core/context.md +++ b/manual/core/context.md @@ -1,17 +1,15 @@ - # Context ## Get a context - ```js cid string // rid.cid or just cid name string // a unique name in cid params paramsparser.Params redis &redisclient.Redis dbcollection &dbfs.DBCollection -``` +``` - cid is the unique id for a circle. - the default context is "default" @@ -19,14 +17,13 @@ dbcollection &dbfs.DBCollection - each context has a redis client (can be a different per context but normally not) - context db is a fs db (key value stor) - ```golang -import freeflowuniverse.herolib.core.base +import incubaid.herolib.core.base struct ContextGetArgs { - name string = "default" // a unique name in cid - interactive bool = true + name string = "default" // a unique name in cid + interactive bool = true } //get context based on name, can overrule interactivity @@ -79,7 +76,6 @@ fn (mut self Context) db_config_get() !dbfs.DB interactive:true ``` - ## Configure a context A context can get certain configuration e.g. params, coderoot, ... (in future encryption), configuration is optional. @@ -92,9 +88,9 @@ A context can get certain configuration e.g. params, coderoot, ... (in future en // cid string = "000" // rid.cid or cid allone // name string // a unique name in cid // params string -// coderoot string +// coderoot string // interactive bool // ``` fn context_configure(args_ ContextConfigureArgs) ! -``` \ No newline at end of file +``` diff --git a/manual/core/session.md b/manual/core/session.md index c4ff176a..6a6936ef 100644 --- a/manual/core/session.md +++ b/manual/core/session.md @@ -12,8 +12,8 @@ context Context //link back to the context ### **The PlayArgs:** -- context ?&Context -- session ?&Session +- context ?&Context +- session ?&Session - context_name string = 'default' - session_name string //default will be based on a date when run - interactive bool = true //can ask questions, default on true @@ -23,8 +23,8 @@ context Context //link back to the context - playbook_text string //heroscript to execute ```golang -import freeflowuniverse.herolib.core.base -import freeflowuniverse.herolib.develop.gittools +import incubaid.herolib.core.base +import incubaid.herolib.develop.gittools mut session:=play.session_new( coderoot:'/tmp/code' @@ -34,17 +34,16 @@ mut session:=play.session_new( //THE next could be in a module which we call pub fn play_git(mut session Session) ! { - for mut action in session.plbook.find(filter:'gittools.*')! { - mut p := action.params - mut repo := p.get_default('repo', '')! + for mut action in session.plbook.find(filter:'gittools.*')! { + mut p := action.params + mut repo := p.get_default('repo', '')! ... do whatever is required to - } + } } ``` - ### use playbook ```golang @@ -55,7 +54,7 @@ pub fn play_git(mut session Session) ! { // text string // prio int = 99 // url string -//``` +//``` fn (mut session Session) playbook_add(args_ PLayBookAddArgs) ! //show the sesstion playbook as heroscript @@ -79,4 +78,4 @@ fn (mut self Session) db_get() !dbfs.DB { // get the db of the config, is unique per context fn (mut self Session) db_config_get() !dbfs.DB { -``` \ No newline at end of file +``` diff --git a/test_basic.vsh b/test_basic.vsh index 91fb335a..e577b20b 100755 --- a/test_basic.vsh +++ b/test_basic.vsh @@ -170,7 +170,7 @@ lib/clients lib/core lib/develop lib/hero -// lib/vfs The vfs folder is not exists on the development branch, so we need to uncomment it after merging this PR https://github.com/freeflowuniverse/herolib/pull/68 +// lib/vfs The vfs folder is not exists on the development branch, so we need to uncomment it after merging this PR https://github.com/incubaid/herolib/pull/68 // lib/crypt ' diff --git a/tests/main.v b/tests/main.v index 8642fe2e..cc61bd0f 100644 --- a/tests/main.v +++ b/tests/main.v @@ -1,12 +1,12 @@ -import freeflowuniverse.herolib.threefold.incatokens -import freeflowuniverse.herolib.core.playcmds +import incubaid.herolib.threefold.incatokens +import incubaid.herolib.core.playcmds import os const heroscript_path = os.dir(@FILE) + '/data' fn main() { - playcmds.run( - heroscript_path: heroscript_path - )! - println('Simulation complete!') -} \ No newline at end of file + playcmds.run( + heroscript_path: heroscript_path + )! + println('Simulation complete!') +}