@humain/humain-code 0.6.2 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +119 -0
- package/README.md +23 -6
- package/dist/agent-monitor/entry.lazy.d.ts +3 -0
- package/dist/agent-monitor/entry.lazy.d.ts.map +1 -0
- package/dist/agent-monitor/entry.lazy.js +3 -0
- package/dist/agent-monitor/entry.lazy.js.map +1 -0
- package/dist/bundle/agent-monitor.js +1 -1
- package/dist/bundle/chunks/adaptive-peer-worker-X2ZNZE3S.js +8 -0
- package/dist/bundle/chunks/adaptive-session-host-7KDSQV5I.js +162 -0
- package/dist/bundle/chunks/anthropic-messages-TQK3FUV3.js +68 -0
- package/dist/bundle/chunks/anthropic.js +13 -10
- package/dist/bundle/chunks/{azure-openai-responses-IV74M5OR.js → azure-openai-responses-JY7OSLH2.js} +6 -6
- package/dist/bundle/chunks/bedrock-converse-stream.js +79 -74
- package/dist/bundle/chunks/chunk-2FYYW6FY.js +2 -0
- package/dist/bundle/chunks/{chunk-A2VPLMF2.js → chunk-2G7YVAVF.js} +1 -1
- package/dist/bundle/chunks/chunk-32QLLD2P.js +1114 -0
- package/dist/bundle/chunks/{chunk-3LP543EX.js → chunk-3EDMWQ35.js} +17 -16
- package/dist/bundle/chunks/chunk-3HVHETMU.js +18 -0
- package/dist/bundle/chunks/{chunk-XMZGB3H4.js → chunk-4HTVBBJD.js} +11 -6
- package/dist/bundle/chunks/chunk-4JRER4XK.js +175 -0
- package/dist/bundle/chunks/{chunk-FHLLDO7U.js → chunk-4PRNKB6V.js} +5 -5
- package/dist/bundle/chunks/chunk-4QAXV5T6.js +49 -0
- package/dist/bundle/chunks/{chunk-JCTQQ3DX.js → chunk-4V5VL2BO.js} +1 -1
- package/dist/bundle/chunks/chunk-5B25YXF7.js +24 -0
- package/dist/bundle/chunks/chunk-5L4PBYC7.js +11 -0
- package/dist/bundle/chunks/chunk-66FZJO75.js +5146 -0
- package/dist/bundle/chunks/chunk-6P6GJPYB.js +4 -0
- package/dist/bundle/chunks/chunk-6PNQYO6A.js +10 -0
- package/dist/bundle/chunks/chunk-7NKUVTBL.js +76 -0
- package/dist/bundle/chunks/chunk-AEWYICBL.js +89 -0
- package/dist/bundle/chunks/chunk-AQ4EXORZ.js +14 -0
- package/dist/bundle/chunks/chunk-AZXVJN6E.js +19 -0
- package/dist/bundle/chunks/chunk-CRN54O4D.js +24 -0
- package/dist/bundle/chunks/chunk-CTU2ECLD.js +7 -0
- package/dist/bundle/chunks/{chunk-BQ3TMEWD.js → chunk-EIC7CQX3.js} +4 -3
- package/dist/bundle/chunks/chunk-F6ZAYLU2.js +59 -0
- package/dist/bundle/chunks/chunk-G4QPSFBF.js +493 -0
- package/dist/bundle/chunks/chunk-GME4AWDG.js +23 -0
- package/dist/bundle/chunks/{chunk-SFMDIVZ4.js → chunk-GRJUKEE3.js} +43 -30
- package/dist/bundle/chunks/chunk-GTILMMUF.js +12 -0
- package/dist/bundle/chunks/chunk-GUHNFZ2Q.js +51 -0
- package/dist/bundle/chunks/chunk-GY663MNP.js +11 -0
- package/dist/bundle/chunks/chunk-HTA325LJ.js +56 -0
- package/dist/bundle/chunks/{chunk-5L4JG6PO.js → chunk-I3NDOUHE.js} +8 -7
- package/dist/bundle/chunks/chunk-I5E7RQ5V.js +21 -0
- package/dist/bundle/chunks/chunk-IWZQ25I3.js +5 -0
- package/dist/bundle/chunks/chunk-IYGHKVUG.js +2 -0
- package/dist/bundle/chunks/chunk-J57HOSWD.js +21 -0
- package/dist/bundle/chunks/chunk-JF7FYXAI.js +288 -0
- package/dist/bundle/chunks/chunk-JSZBTGI6.js +10 -0
- package/dist/bundle/chunks/chunk-JYWUOKOI.js +1061 -0
- package/dist/bundle/chunks/{chunk-DLCBSLHW.js → chunk-KRCX3ZBA.js} +1 -1
- package/dist/bundle/chunks/chunk-KTSJYIYC.js +30 -0
- package/dist/bundle/chunks/{chunk-K7SDY3VJ.js → chunk-LB4CIS4F.js} +40 -165
- package/dist/bundle/chunks/{chunk-NN53K2QQ.js → chunk-LYZ37DJP.js} +2 -14
- package/dist/bundle/chunks/chunk-MD7K7RPN.js +20 -0
- package/dist/bundle/chunks/chunk-MX4Q4W6H.js +214 -0
- package/dist/bundle/chunks/{chunk-6PD3T2EF.js → chunk-N2SNMUD3.js} +1 -1
- package/dist/bundle/chunks/chunk-NXA6NEHE.js +54 -0
- package/dist/bundle/chunks/chunk-OB332KMV.js +300 -0
- package/dist/bundle/chunks/chunk-P6AXBESH.js +1883 -0
- package/dist/bundle/chunks/chunk-PPBDDQHP.js +11 -0
- package/dist/bundle/chunks/chunk-PWUDFU5V.js +51 -0
- package/dist/bundle/chunks/chunk-Q5RKNQ2T.js +73 -0
- package/dist/bundle/chunks/chunk-QT6ZHDMP.js +12 -0
- package/dist/bundle/chunks/chunk-R5OOX7RW.js +16 -0
- package/dist/bundle/chunks/chunk-R6YQR7TZ.js +25 -0
- package/dist/bundle/chunks/{chunk-4ZBGTJJM.js → chunk-RNBZBCH2.js} +1 -1
- package/dist/bundle/chunks/chunk-RQU722SY.js +1 -0
- package/dist/bundle/chunks/{chunk-RGUZULEE.js → chunk-RS6PZK35.js} +71 -72
- package/dist/bundle/chunks/{jiti-loader-6P33XTLC.js → chunk-RW7GT7L3.js} +1 -1
- package/dist/bundle/chunks/{chunk-PCTLFSQG.js → chunk-SCINMV4X.js} +1 -1
- package/dist/bundle/chunks/{chunk-NCC2FAJN.js → chunk-SSRCVJZK.js} +28 -28
- package/dist/bundle/chunks/chunk-T5A6T24H.js +93 -0
- package/dist/bundle/chunks/chunk-T7BXP46S.js +3367 -0
- package/dist/bundle/chunks/chunk-TGDPZCSW.js +9 -0
- package/dist/bundle/chunks/{chunk-4J6BGNX2.js → chunk-TWAHPPXN.js} +434 -429
- package/dist/bundle/chunks/chunk-UEW6TUSP.js +36 -0
- package/dist/bundle/chunks/chunk-UZNIPOGS.js +323 -0
- package/dist/bundle/chunks/{chunk-KM4GQ2BU.js → chunk-VFLVWPLZ.js} +5 -6
- package/dist/bundle/chunks/chunk-WAPZN4KP.js +74 -0
- package/dist/bundle/chunks/chunk-WCFHG6NO.js +16 -0
- package/dist/bundle/chunks/chunk-WQ7EJQIT.js +839 -0
- package/dist/bundle/chunks/chunk-WQOOJP7U.js +4 -0
- package/dist/bundle/chunks/chunk-XHDVDJM7.js +17 -0
- package/dist/bundle/chunks/chunk-YPZPCHNV.js +3 -0
- package/dist/bundle/chunks/chunk-Z5YLKK3S.js +41 -0
- package/dist/bundle/chunks/chunk-ZJUU6WOV.js +2052 -0
- package/dist/bundle/chunks/{cli-N7KOVPLB.js → cli-H4LJNE2V.js} +2 -2
- package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-KRMHG2L3.js → cloudflare-workers-ai-system-one-T5R2RVFQ.js} +1 -1
- package/dist/bundle/chunks/codemode-worker.js +2 -0
- package/dist/bundle/chunks/compat-ZK2DIW3P.js +15 -0
- package/dist/bundle/chunks/dist-EY7YKQHB.js +11 -0
- package/dist/bundle/chunks/dist-FMWWM4H7.js +268 -0
- package/dist/bundle/chunks/dist-NHQTBDHT.js +1107 -0
- package/dist/bundle/chunks/{easter-egg-3d-O2GG2XIG.js → easter-egg-3d-BUEOC3NO.js} +1 -1
- package/dist/bundle/chunks/entry-A2CSLKHC.js +323 -0
- package/dist/bundle/chunks/entry-AL54ZGYO.js +2 -0
- package/dist/bundle/chunks/{execute-LMBACTKA.js → execute-MY5JSEPV.js} +18 -15
- package/dist/bundle/chunks/{extract-CXXLVFC5.js → extract-PTGACPGP.js} +3 -3
- package/dist/bundle/chunks/flow-implementer-APJFY4YI.js +21 -0
- package/dist/bundle/chunks/github-copilot.js +66 -62
- package/dist/bundle/chunks/{google-generative-ai-SBL77OXO.js → google-generative-ai-UL7YEQ6J.js} +2 -3
- package/dist/bundle/chunks/{google-vertex-NZBNNXMK.js → google-vertex-OTMSPUYH.js} +3 -3
- package/dist/bundle/chunks/host-75YAHLDR.js +3 -0
- package/dist/bundle/chunks/index.bundle-THL4EUSU.js +390 -0
- package/dist/bundle/chunks/inprocess-5NP5VJHZ.js +32 -0
- package/dist/bundle/chunks/interactive-mode-IW4PIVAQ.js +5 -0
- package/dist/bundle/chunks/jiti-bun-loader-VSLLRCSD.js +3459 -0
- package/dist/bundle/chunks/jiti-loader-TMJL6S2D.js +2 -0
- package/dist/bundle/chunks/{llama-cpp-classify-PP63BYDF.js → llama-cpp-classify-GJAXULWL.js} +1 -1
- package/dist/bundle/chunks/{mistral-conversations-DX4YKJSO.js → mistral-conversations-E72Y6OC3.js} +2 -2
- package/dist/bundle/chunks/{node-UGQUSQE6.js → node-ZFIIS5IM.js} +32 -32
- package/dist/bundle/chunks/openai-codex-responses-S7CMCAOY.js +101 -0
- package/dist/bundle/chunks/openai-completions-2Z57N7PC.js +87 -0
- package/dist/bundle/chunks/{openai-decisions-ALJROWBE.js → openai-decisions-JIOJDB4C.js} +1 -1
- package/dist/bundle/chunks/openai-responses-5VBZSTHL.js +27 -0
- package/dist/bundle/chunks/{openrouter-images-FCJT7C7I.js → openrouter-images-S6O7DBEJ.js} +1 -1
- package/dist/bundle/chunks/{pi-messages-NHTQQOPW.js → pi-messages-SMLN5J2W.js} +10 -7
- package/dist/bundle/chunks/runtime-OYTWXIUM.js +2 -0
- package/dist/bundle/chunks/session-picker-DM6S37IF.js +4 -0
- package/dist/bundle/chunks/startup-ui-4GGLWNSU.js +3 -0
- package/dist/bundle/chunks/trace-command-YLDYCL55.js +254 -0
- package/dist/bundle/chunks/typesafe-system-one-7BEL3H5N.js +3 -0
- package/dist/bundle/chunks/virtual-modules-TI3W24YL.js +28 -0
- package/dist/bundle/cli-runtime.js +5 -3
- package/dist/bundle/flow/agents/orch-implementation-fast.md +4 -4
- package/dist/bundle/flow/agents/orch-implementation-strong.md +5 -5
- package/dist/bundle/flow/package.json +35 -3
- package/dist/bundle/index.js +20 -17
- package/dist/bundle/orchestrate/README.md +37 -0
- package/dist/bundle/{flow → orchestrate}/agents/orch-qa-agent.md +1 -1
- package/dist/bundle/{flow → orchestrate}/agents/orch-worker.md +1 -1
- package/dist/bundle/{flow → orchestrate}/agents/orchestrator-lead.md +1 -1
- package/dist/bundle/orchestrate/package.json +29 -0
- package/dist/bundle/rpc-entry.js +5 -3
- package/dist/cli/args.d.ts +6 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +69 -2
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/auth-check.d.ts +3 -2
- package/dist/cli/auth-check.d.ts.map +1 -1
- package/dist/cli/auth-check.js +4 -3
- package/dist/cli/auth-check.js.map +1 -1
- package/dist/cli/config-selector.d.ts.map +1 -1
- package/dist/cli/config-selector.js +3 -1
- package/dist/cli/config-selector.js.map +1 -1
- package/dist/cli/file-processor.d.ts +2 -0
- package/dist/cli/file-processor.d.ts.map +1 -1
- package/dist/cli/file-processor.js +6 -6
- package/dist/cli/file-processor.js.map +1 -1
- package/dist/cli/metadata-disclosure.d.ts +4 -0
- package/dist/cli/metadata-disclosure.d.ts.map +1 -0
- package/dist/cli/metadata-disclosure.js +23 -0
- package/dist/cli/metadata-disclosure.js.map +1 -0
- package/dist/cli/project-trust.d.ts.map +1 -1
- package/dist/cli/project-trust.js +4 -1
- package/dist/cli/project-trust.js.map +1 -1
- package/dist/cli/session-picker.lazy.d.ts +3 -0
- package/dist/cli/session-picker.lazy.d.ts.map +1 -0
- package/dist/cli/session-picker.lazy.js +3 -0
- package/dist/cli/session-picker.lazy.js.map +1 -0
- package/dist/cli/startup-ui.d.ts +4 -4
- package/dist/cli/startup-ui.d.ts.map +1 -1
- package/dist/cli/startup-ui.js +38 -14
- package/dist/cli/startup-ui.js.map +1 -1
- package/dist/cli/startup-ui.lazy.d.ts +3 -0
- package/dist/cli/startup-ui.lazy.d.ts.map +1 -0
- package/dist/cli/startup-ui.lazy.js +3 -0
- package/dist/cli/startup-ui.lazy.js.map +1 -0
- package/dist/cli/trace-command.lazy.d.ts +3 -0
- package/dist/cli/trace-command.lazy.d.ts.map +1 -0
- package/dist/cli/trace-command.lazy.js +3 -0
- package/dist/cli/trace-command.lazy.js.map +1 -0
- package/dist/cli.js.map +1 -1
- package/dist/coordination/broker/entry.lazy.d.ts +3 -0
- package/dist/coordination/broker/entry.lazy.d.ts.map +1 -0
- package/dist/coordination/broker/entry.lazy.js +3 -0
- package/dist/coordination/broker/entry.lazy.js.map +1 -0
- package/dist/core/acceptance-command.d.ts +15 -0
- package/dist/core/acceptance-command.d.ts.map +1 -0
- package/dist/core/acceptance-command.js +150 -0
- package/dist/core/acceptance-command.js.map +1 -0
- package/dist/core/acceptance-ledger.d.ts +52 -0
- package/dist/core/acceptance-ledger.d.ts.map +1 -0
- package/dist/core/acceptance-ledger.js +341 -0
- package/dist/core/acceptance-ledger.js.map +1 -0
- package/dist/core/admission-types.d.ts +69 -0
- package/dist/core/admission-types.js +2 -0
- package/dist/core/admission-types.js.map +1 -0
- package/dist/core/agent-session-runtime.d.ts +7 -0
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +43 -9
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session-services.d.ts +8 -0
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +13 -1
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session.d.ts +127 -10
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +1390 -145
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/anthropic-subscription-usage.d.ts +1 -1
- package/dist/core/anthropic-subscription-usage.d.ts.map +1 -1
- package/dist/core/anthropic-subscription-usage.js +31 -3
- package/dist/core/anthropic-subscription-usage.js.map +1 -1
- package/dist/core/auth-storage.d.ts +2 -1
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +13 -10
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/auto-session-namer.d.ts.map +1 -1
- package/dist/core/auto-session-namer.js +3 -1
- package/dist/core/auto-session-namer.js.map +1 -1
- package/dist/core/bash-executor.d.ts.map +1 -1
- package/dist/core/bash-executor.js +3 -1
- package/dist/core/bash-executor.js.map +1 -1
- package/dist/core/bug-report-redaction.d.ts +4 -0
- package/dist/core/bug-report-redaction.d.ts.map +1 -0
- package/dist/core/bug-report-redaction.js +209 -0
- package/dist/core/bug-report-redaction.js.map +1 -0
- package/dist/core/bug-report.d.ts +26 -6
- package/dist/core/bug-report.d.ts.map +1 -1
- package/dist/core/bug-report.js +82 -9
- package/dist/core/bug-report.js.map +1 -1
- package/dist/core/cache-warmer.d.ts.map +1 -1
- package/dist/core/cache-warmer.js +5 -0
- package/dist/core/cache-warmer.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +6 -0
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +103 -71
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/compaction/utils.d.ts.map +1 -1
- package/dist/core/compaction/utils.js +2 -1
- package/dist/core/compaction/utils.js.map +1 -1
- package/dist/core/extensions/jiti-bun-babel.d.ts +4 -0
- package/dist/core/extensions/jiti-bun-babel.d.ts.map +1 -0
- package/dist/core/extensions/jiti-bun-babel.js +4 -0
- package/dist/core/extensions/jiti-bun-babel.js.map +1 -0
- package/dist/core/extensions/jiti-bun-loader.d.ts +4 -0
- package/dist/core/extensions/jiti-bun-loader.d.ts.map +1 -0
- package/dist/core/extensions/jiti-bun-loader.js +13 -0
- package/dist/core/extensions/jiti-bun-loader.js.map +1 -0
- package/dist/core/extensions/jiti-bun-loader.lazy.d.ts +3 -0
- package/dist/core/extensions/jiti-bun-loader.lazy.d.ts.map +1 -0
- package/dist/core/extensions/jiti-bun-loader.lazy.js +3 -0
- package/dist/core/extensions/jiti-bun-loader.lazy.js.map +1 -0
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +9 -3
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +4 -0
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +3 -0
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/flow-implementer.d.ts +25 -0
- package/dist/core/flow-implementer.d.ts.map +1 -0
- package/dist/core/flow-implementer.js +301 -0
- package/dist/core/flow-implementer.js.map +1 -0
- package/dist/core/internal-process.d.ts +23 -0
- package/dist/core/internal-process.d.ts.map +1 -0
- package/dist/core/internal-process.js +88 -0
- package/dist/core/internal-process.js.map +1 -0
- package/dist/core/keybindings.d.ts +2 -2
- package/dist/core/keybindings.js +1 -1
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/model-config.d.ts +52 -0
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js +4 -4
- package/dist/core/model-config.js.map +1 -1
- package/dist/core/model-registry.d.ts +4 -0
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +8 -0
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-request-admission.d.ts +51 -0
- package/dist/core/model-request-admission.d.ts.map +1 -0
- package/dist/core/model-request-admission.js +103 -0
- package/dist/core/model-request-admission.js.map +1 -0
- package/dist/core/model-resolver.d.ts +4 -0
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +109 -2
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts +56 -1
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +482 -40
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/model-selection-intent.d.ts +14 -0
- package/dist/core/model-selection-intent.d.ts.map +1 -0
- package/dist/core/model-selection-intent.js +15 -0
- package/dist/core/model-selection-intent.js.map +1 -0
- package/dist/core/oauth-account-pool.d.ts +4 -1
- package/dist/core/oauth-account-pool.d.ts.map +1 -1
- package/dist/core/oauth-account-pool.js +251 -228
- package/dist/core/oauth-account-pool.js.map +1 -1
- package/dist/core/os-secret-store.d.ts +25 -0
- package/dist/core/os-secret-store.d.ts.map +1 -0
- package/dist/core/os-secret-store.js +290 -0
- package/dist/core/os-secret-store.js.map +1 -0
- package/dist/core/output-guard.d.ts.map +1 -1
- package/dist/core/output-guard.js +62 -2
- package/dist/core/output-guard.js.map +1 -1
- package/dist/core/pi-ai-schemas.d.ts +4 -0
- package/dist/core/pi-ai-schemas.d.ts.map +1 -1
- package/dist/core/private-windows-path.d.ts +4 -0
- package/dist/core/private-windows-path.d.ts.map +1 -0
- package/dist/core/private-windows-path.js +44 -0
- package/dist/core/private-windows-path.js.map +1 -0
- package/dist/core/prompt-templates.d.ts.map +1 -1
- package/dist/core/prompt-templates.js +18 -2
- package/dist/core/prompt-templates.js.map +1 -1
- package/dist/core/provider-composer.d.ts.map +1 -1
- package/dist/core/provider-composer.js +1 -1
- package/dist/core/provider-composer.js.map +1 -1
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +6 -2
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/run-outcome.d.ts +40 -0
- package/dist/core/run-outcome.d.ts.map +1 -0
- package/dist/core/run-outcome.js +91 -0
- package/dist/core/run-outcome.js.map +1 -0
- package/dist/core/run-preflight.d.ts +5 -0
- package/dist/core/run-preflight.d.ts.map +1 -0
- package/dist/core/run-preflight.js +96 -0
- package/dist/core/run-preflight.js.map +1 -0
- package/dist/core/runtime-credentials.d.ts +18 -2
- package/dist/core/runtime-credentials.d.ts.map +1 -1
- package/dist/core/runtime-credentials.js +65 -9
- package/dist/core/runtime-credentials.js.map +1 -1
- package/dist/core/sdk.d.ts +19 -3
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +115 -20
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/settings-defaults.d.ts +2 -1
- package/dist/core/settings-defaults.d.ts.map +1 -1
- package/dist/core/settings-defaults.js +2 -1
- package/dist/core/settings-defaults.js.map +1 -1
- package/dist/core/settings-manager.d.ts +15 -4
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +114 -22
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/settings-schema.d.ts +7 -2
- package/dist/core/settings-schema.d.ts.map +1 -1
- package/dist/core/settings-schema.js +12 -5
- package/dist/core/settings-schema.js.map +1 -1
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +11 -0
- package/dist/core/skills.js.map +1 -1
- package/dist/core/system-prompt.d.ts +3 -0
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +10 -2
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/bash-jobs.d.ts +109 -0
- package/dist/core/tools/bash-jobs.d.ts.map +1 -0
- package/dist/core/tools/bash-jobs.js +563 -0
- package/dist/core/tools/bash-jobs.js.map +1 -0
- package/dist/core/tools/bash.d.ts +68 -6
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +350 -37
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit-diff.d.ts +11 -1
- package/dist/core/tools/edit-diff.d.ts.map +1 -1
- package/dist/core/tools/edit-diff.js +89 -20
- package/dist/core/tools/edit-diff.js.map +1 -1
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +15 -7
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/file-mutation-custody.d.ts +29 -0
- package/dist/core/tools/file-mutation-custody.d.ts.map +1 -0
- package/dist/core/tools/file-mutation-custody.js +173 -0
- package/dist/core/tools/file-mutation-custody.js.map +1 -0
- package/dist/core/tools/find.d.ts +6 -0
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +84 -38
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts +8 -2
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +121 -77
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/index.d.ts +3 -1
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js +12 -0
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/jobs.d.ts +24 -0
- package/dist/core/tools/jobs.d.ts.map +1 -0
- package/dist/core/tools/jobs.js +86 -0
- package/dist/core/tools/jobs.js.map +1 -0
- package/dist/core/tools/ls.d.ts.map +1 -1
- package/dist/core/tools/ls.js +2 -1
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/output-accumulator.d.ts +12 -1
- package/dist/core/tools/output-accumulator.d.ts.map +1 -1
- package/dist/core/tools/output-accumulator.js +88 -8
- package/dist/core/tools/output-accumulator.js.map +1 -1
- package/dist/core/tools/output-cleanup.d.ts +40 -0
- package/dist/core/tools/output-cleanup.d.ts.map +1 -0
- package/dist/core/tools/output-cleanup.js +273 -0
- package/dist/core/tools/output-cleanup.js.map +1 -0
- package/dist/core/tools/powershell.d.ts.map +1 -1
- package/dist/core/tools/powershell.js +15 -2
- package/dist/core/tools/powershell.js.map +1 -1
- package/dist/core/tools/read.d.ts +21 -0
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +162 -29
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/renderers/bash.d.ts.map +1 -1
- package/dist/core/tools/renderers/bash.js +3 -1
- package/dist/core/tools/renderers/bash.js.map +1 -1
- package/dist/core/tools/renderers/index.d.ts.map +1 -1
- package/dist/core/tools/renderers/index.js +1 -0
- package/dist/core/tools/renderers/index.js.map +1 -1
- package/dist/core/tools/subagent.d.ts +5 -1
- package/dist/core/tools/subagent.d.ts.map +1 -1
- package/dist/core/tools/subagent.js +76 -19
- package/dist/core/tools/subagent.js.map +1 -1
- package/dist/core/tools/truncate.d.ts +4 -0
- package/dist/core/tools/truncate.d.ts.map +1 -1
- package/dist/core/tools/truncate.js +24 -1
- package/dist/core/tools/truncate.js.map +1 -1
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +6 -1
- package/dist/core/tools/write.js.map +1 -1
- package/dist/core/trace/config.js +3 -3
- package/dist/core/trace/config.js.map +1 -1
- package/dist/core/trace/redaction.d.ts.map +1 -1
- package/dist/core/trace/redaction.js +12 -9
- package/dist/core/trace/redaction.js.map +1 -1
- package/dist/core/trace-client/credential-store.d.ts +1 -1
- package/dist/core/trace-client/credential-store.d.ts.map +1 -1
- package/dist/core/trace-client/credential-store.js +20 -3
- package/dist/core/trace-client/credential-store.js.map +1 -1
- package/dist/core/usage-ledger.d.ts +35 -0
- package/dist/core/usage-ledger.d.ts.map +1 -0
- package/dist/core/usage-ledger.js +140 -0
- package/dist/core/usage-ledger.js.map +1 -0
- package/dist/extensions/codemode/execute.d.ts.map +1 -1
- package/dist/extensions/codemode/execute.js +24 -15
- package/dist/extensions/codemode/execute.js.map +1 -1
- package/dist/extensions/codemode/index.d.ts +4 -2
- package/dist/extensions/codemode/index.d.ts.map +1 -1
- package/dist/extensions/codemode/index.js +8 -4
- package/dist/extensions/codemode/index.js.map +1 -1
- package/dist/extensions/codemode/tool.d.ts +4 -2
- package/dist/extensions/codemode/tool.d.ts.map +1 -1
- package/dist/extensions/codemode/tool.js +34 -12
- package/dist/extensions/codemode/tool.js.map +1 -1
- package/dist/extensions/llama/client.d.ts +2 -0
- package/dist/extensions/llama/client.d.ts.map +1 -1
- package/dist/extensions/llama/client.js +23 -2
- package/dist/extensions/llama/client.js.map +1 -1
- package/dist/extensions/llama/ui.d.ts.map +1 -1
- package/dist/extensions/llama/ui.js +15 -3
- package/dist/extensions/llama/ui.js.map +1 -1
- package/dist/extensions/mcp/runtime.d.ts.map +1 -1
- package/dist/extensions/mcp/runtime.js +3 -2
- package/dist/extensions/mcp/runtime.js.map +1 -1
- package/dist/extensions/tool-search/tool.d.ts.map +1 -1
- package/dist/extensions/tool-search/tool.js +18 -6
- package/dist/extensions/tool-search/tool.js.map +1 -1
- package/dist/extensions/usage/hcode-overview.d.ts +23 -0
- package/dist/extensions/usage/hcode-overview.d.ts.map +1 -0
- package/dist/extensions/usage/hcode-overview.js +109 -0
- package/dist/extensions/usage/hcode-overview.js.map +1 -0
- package/dist/extensions/usage/index.d.ts +5 -0
- package/dist/extensions/usage/index.d.ts.map +1 -1
- package/dist/extensions/usage/index.js +194 -12
- package/dist/extensions/usage/index.js.map +1 -1
- package/dist/extensions/usage/overview.d.ts +5 -0
- package/dist/extensions/usage/overview.d.ts.map +1 -1
- package/dist/extensions/usage/overview.js +21 -1
- package/dist/extensions/usage/overview.js.map +1 -1
- package/dist/extensions/usage/popup.d.ts +14 -3
- package/dist/extensions/usage/popup.d.ts.map +1 -1
- package/dist/extensions/usage/popup.js +199 -25
- package/dist/extensions/usage/popup.js.map +1 -1
- package/dist/humain/adaptive-execution.d.ts +51 -0
- package/dist/humain/adaptive-execution.d.ts.map +1 -0
- package/dist/humain/adaptive-execution.js +100 -0
- package/dist/humain/adaptive-execution.js.map +1 -0
- package/dist/humain/adaptive-peer-process.d.ts +44 -0
- package/dist/humain/adaptive-peer-process.d.ts.map +1 -0
- package/dist/humain/adaptive-peer-process.js +159 -0
- package/dist/humain/adaptive-peer-process.js.map +1 -0
- package/dist/humain/adaptive-peer-worker.d.ts +3 -0
- package/dist/humain/adaptive-peer-worker.d.ts.map +1 -0
- package/dist/humain/adaptive-peer-worker.js +122 -0
- package/dist/humain/adaptive-peer-worker.js.map +1 -0
- package/dist/humain/adaptive-runtime-types.d.ts +621 -0
- package/dist/humain/adaptive-runtime-types.d.ts.map +1 -0
- package/dist/humain/adaptive-runtime-types.js +3 -0
- package/dist/humain/adaptive-runtime-types.js.map +1 -0
- package/dist/humain/adaptive-session-host.d.ts +113 -0
- package/dist/humain/adaptive-session-host.d.ts.map +1 -0
- package/dist/humain/adaptive-session-host.js +1838 -0
- package/dist/humain/adaptive-session-host.js.map +1 -0
- package/dist/humain/adhd/index.d.ts +2 -2
- package/dist/humain/adhd/index.d.ts.map +1 -1
- package/dist/humain/adhd/index.js +22 -13
- package/dist/humain/adhd/index.js.map +1 -1
- package/dist/humain/bedrock-provider/vendor/index.bundle.mjs +162 -49
- package/dist/humain/caveman/index.d.ts +1 -1
- package/dist/humain/caveman/index.d.ts.map +1 -1
- package/dist/humain/caveman/index.js +21 -12
- package/dist/humain/caveman/index.js.map +1 -1
- package/dist/humain/classify-tool.d.ts +4 -0
- package/dist/humain/classify-tool.d.ts.map +1 -0
- package/dist/humain/classify-tool.js +50 -0
- package/dist/humain/classify-tool.js.map +1 -0
- package/dist/humain/flow-command.d.ts +1 -1
- package/dist/humain/flow-command.d.ts.map +1 -1
- package/dist/humain/flow-command.js +21 -3
- package/dist/humain/flow-command.js.map +1 -1
- package/dist/humain/flow-loader.d.ts +15 -10
- package/dist/humain/flow-loader.d.ts.map +1 -1
- package/dist/humain/flow-loader.js +72 -18
- package/dist/humain/flow-loader.js.map +1 -1
- package/dist/humain/fuse-provider.d.ts +5 -0
- package/dist/humain/fuse-provider.d.ts.map +1 -0
- package/dist/humain/fuse-provider.js +302 -0
- package/dist/humain/fuse-provider.js.map +1 -0
- package/dist/humain/gateway/provider.d.ts.map +1 -1
- package/dist/humain/gateway/provider.js +2 -0
- package/dist/humain/gateway/provider.js.map +1 -1
- package/dist/humain/gateway/secret-store.d.ts +3 -7
- package/dist/humain/gateway/secret-store.d.ts.map +1 -1
- package/dist/humain/gateway/secret-store.js +21 -249
- package/dist/humain/gateway/secret-store.js.map +1 -1
- package/dist/humain/hcode/account-store.d.ts +92 -0
- package/dist/humain/hcode/account-store.d.ts.map +1 -0
- package/dist/humain/hcode/account-store.js +720 -0
- package/dist/humain/hcode/account-store.js.map +1 -0
- package/dist/humain/hcode/account.d.ts +42 -0
- package/dist/humain/hcode/account.d.ts.map +1 -0
- package/dist/humain/hcode/account.js +552 -0
- package/dist/humain/hcode/account.js.map +1 -0
- package/dist/humain/hcode/catalog.d.ts +6 -0
- package/dist/humain/hcode/catalog.d.ts.map +1 -0
- package/dist/humain/hcode/catalog.js +47 -0
- package/dist/humain/hcode/catalog.js.map +1 -0
- package/dist/humain/hcode/contracts.d.ts +389 -0
- package/dist/humain/hcode/contracts.d.ts.map +1 -0
- package/dist/humain/hcode/contracts.js +1243 -0
- package/dist/humain/hcode/contracts.js.map +1 -0
- package/dist/humain/hcode/environment.d.ts +9 -0
- package/dist/humain/hcode/environment.d.ts.map +1 -0
- package/dist/humain/hcode/environment.js +24 -0
- package/dist/humain/hcode/environment.js.map +1 -0
- package/dist/humain/hcode/facade.d.ts +54 -0
- package/dist/humain/hcode/facade.d.ts.map +1 -0
- package/dist/humain/hcode/facade.js +326 -0
- package/dist/humain/hcode/facade.js.map +1 -0
- package/dist/humain/hcode/http.d.ts +10 -0
- package/dist/humain/hcode/http.d.ts.map +1 -0
- package/dist/humain/hcode/http.js +119 -0
- package/dist/humain/hcode/http.js.map +1 -0
- package/dist/humain/hcode/notices.d.ts +15 -0
- package/dist/humain/hcode/notices.d.ts.map +1 -0
- package/dist/humain/hcode/notices.js +69 -0
- package/dist/humain/hcode/notices.js.map +1 -0
- package/dist/humain/hcode/ports.d.ts +34 -0
- package/dist/humain/hcode/ports.d.ts.map +1 -0
- package/dist/humain/hcode/ports.js +2 -0
- package/dist/humain/hcode/ports.js.map +1 -0
- package/dist/humain/hcode/provider.d.ts +15 -0
- package/dist/humain/hcode/provider.d.ts.map +1 -0
- package/dist/humain/hcode/provider.js +200 -0
- package/dist/humain/hcode/provider.js.map +1 -0
- package/dist/humain/hcode/selection.d.ts +16 -0
- package/dist/humain/hcode/selection.d.ts.map +1 -0
- package/dist/humain/hcode/selection.js +37 -0
- package/dist/humain/hcode/selection.js.map +1 -0
- package/dist/humain/hcode/transport.d.ts +22 -0
- package/dist/humain/hcode/transport.d.ts.map +1 -0
- package/dist/humain/hcode/transport.js +368 -0
- package/dist/humain/hcode/transport.js.map +1 -0
- package/dist/humain/hcode/usage.d.ts +5 -0
- package/dist/humain/hcode/usage.d.ts.map +1 -0
- package/dist/humain/hcode/usage.js +66 -0
- package/dist/humain/hcode/usage.js.map +1 -0
- package/dist/humain/hcode/wire.d.ts +16 -0
- package/dist/humain/hcode/wire.d.ts.map +1 -0
- package/dist/humain/hcode/wire.js +104 -0
- package/dist/humain/hcode/wire.js.map +1 -0
- package/dist/humain/index.d.ts +1 -3
- package/dist/humain/index.d.ts.map +1 -1
- package/dist/humain/index.js +8 -60
- package/dist/humain/index.js.map +1 -1
- package/dist/humain/login-menu.d.ts.map +1 -1
- package/dist/humain/login-menu.js +8 -1
- package/dist/humain/login-menu.js.map +1 -1
- package/dist/humain/metadata/contracts.d.ts +82 -0
- package/dist/humain/metadata/contracts.d.ts.map +1 -0
- package/dist/humain/metadata/contracts.js +214 -0
- package/dist/humain/metadata/contracts.js.map +1 -0
- package/dist/humain/metadata/identity.d.ts +10 -0
- package/dist/humain/metadata/identity.d.ts.map +1 -0
- package/dist/humain/metadata/identity.js +209 -0
- package/dist/humain/metadata/identity.js.map +1 -0
- package/dist/humain/metadata/index.d.ts +41 -0
- package/dist/humain/metadata/index.d.ts.map +1 -0
- package/dist/humain/metadata/index.js +100 -0
- package/dist/humain/metadata/index.js.map +1 -0
- package/dist/humain/metadata/sender.d.ts +20 -0
- package/dist/humain/metadata/sender.d.ts.map +1 -0
- package/dist/humain/metadata/sender.js +302 -0
- package/dist/humain/metadata/sender.js.map +1 -0
- package/dist/humain/metadata/version.d.ts +8 -0
- package/dist/humain/metadata/version.d.ts.map +1 -0
- package/dist/humain/metadata/version.js +38 -0
- package/dist/humain/metadata/version.js.map +1 -0
- package/dist/humain/node-http.d.ts +2 -0
- package/dist/humain/node-http.d.ts.map +1 -1
- package/dist/humain/node-http.js +9 -4
- package/dist/humain/node-http.js.map +1 -1
- package/dist/humain/node-provider.d.ts +2 -0
- package/dist/humain/node-provider.d.ts.map +1 -1
- package/dist/humain/node-provider.js +39 -8
- package/dist/humain/node-provider.js.map +1 -1
- package/dist/humain/ponytail/vendor/hooks/ponytail-config.d.ts +1 -1
- package/dist/humain/ponytail/vendor/hooks/ponytail-config.d.ts.map +1 -1
- package/dist/humain/ponytail/vendor/hooks/ponytail-config.js +4 -4
- package/dist/humain/ponytail/vendor/hooks/ponytail-config.js.map +1 -1
- package/dist/humain/ponytail/vendor/hooks/ponytail-instructions.d.ts.map +1 -1
- package/dist/humain/ponytail/vendor/hooks/ponytail-instructions.js +7 -0
- package/dist/humain/ponytail/vendor/hooks/ponytail-instructions.js.map +1 -1
- package/dist/humain/ponytail/vendor/pi-extension/index.d.ts.map +1 -1
- package/dist/humain/ponytail/vendor/pi-extension/index.js +12 -1
- package/dist/humain/ponytail/vendor/pi-extension/index.js.map +1 -1
- package/dist/humain/systemone.d.ts +23 -0
- package/dist/humain/systemone.d.ts.map +1 -0
- package/dist/humain/systemone.js +101 -0
- package/dist/humain/systemone.js.map +1 -0
- package/dist/humain/trace-capture/flow-producer.d.ts.map +1 -1
- package/dist/humain/trace-capture/flow-producer.js +3 -3
- package/dist/humain/trace-capture/flow-producer.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts +1 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +292 -183
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/bug-report.d.ts.map +1 -1
- package/dist/modes/interactive/bug-report.js +82 -36
- package/dist/modes/interactive/bug-report.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +8 -5
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/diff.d.ts.map +1 -1
- package/dist/modes/interactive/components/diff.js +11 -5
- package/dist/modes/interactive/components/diff.js.map +1 -1
- package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-selector.js +9 -1
- package/dist/modes/interactive/components/extension-selector.js.map +1 -1
- package/dist/modes/interactive/components/first-time-setup.d.ts +10 -5
- package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -1
- package/dist/modes/interactive/components/first-time-setup.js +55 -29
- package/dist/modes/interactive/components/first-time-setup.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts +16 -2
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +164 -19
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts +3 -0
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.js +19 -2
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
- package/dist/modes/interactive/components/status-indicator.d.ts +17 -0
- package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
- package/dist/modes/interactive/components/status-indicator.js +78 -1
- package/dist/modes/interactive/components/status-indicator.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector.d.ts +1 -0
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector.js +19 -10
- package/dist/modes/interactive/components/tree-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +4 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +353 -65
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.lazy.d.ts +3 -0
- package/dist/modes/interactive/interactive-mode.lazy.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-mode.lazy.js +3 -0
- package/dist/modes/interactive/interactive-mode.lazy.js.map +1 -0
- package/dist/modes/interactive/model-catalog-refresh.d.ts +2 -0
- package/dist/modes/interactive/model-catalog-refresh.d.ts.map +1 -1
- package/dist/modes/interactive/model-catalog-refresh.js +12 -0
- package/dist/modes/interactive/model-catalog-refresh.js.map +1 -1
- package/dist/modes/interactive/theme/theme-controller.d.ts +2 -3
- package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-controller.js +4 -5
- package/dist/modes/interactive/theme/theme-controller.js.map +1 -1
- package/dist/modes/interactive/theme/theme-schema.js +4 -4
- package/dist/modes/interactive/theme/theme-schema.js.map +1 -1
- package/dist/modes/interactive/theme/theme.d.ts +2 -0
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +8 -0
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/json-event.d.ts +2 -1
- package/dist/modes/json-event.d.ts.map +1 -1
- package/dist/modes/json-event.js.map +1 -1
- package/dist/modes/print-mode.d.ts +4 -0
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +57 -11
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +68 -16
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +2 -0
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/utils/changelog.d.ts +1 -1
- package/dist/utils/changelog.d.ts.map +1 -1
- package/dist/utils/changelog.js +7 -5
- package/dist/utils/changelog.js.map +1 -1
- package/dist/utils/image-resize.d.ts.map +1 -1
- package/dist/utils/image-resize.js +3 -1
- package/dist/utils/image-resize.js.map +1 -1
- package/dist/utils/lazy-validator.d.ts +5 -0
- package/dist/utils/lazy-validator.d.ts.map +1 -0
- package/dist/utils/lazy-validator.js +7 -0
- package/dist/utils/lazy-validator.js.map +1 -0
- package/dist/utils/shell.d.ts +3 -1
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/shell.js +9 -4
- package/dist/utils/shell.js.map +1 -1
- package/docs/cli.md +23 -5
- package/docs/codemode.md +21 -1
- package/docs/development.md +18 -0
- package/docs/docs.json +4 -0
- package/docs/extensions.md +4 -0
- package/docs/flow.md +115 -16
- package/docs/headless-modes.md +61 -0
- package/docs/humain-code-forge-architecture.md +65 -13
- package/docs/humain-code-forge-component-scorecard.md +10 -1
- package/docs/humain-code-forge-flow-walkthrough.md +54 -55
- package/docs/humain-code.md +22 -19
- package/docs/index.md +1 -0
- package/docs/keybindings.md +1 -1
- package/docs/models-configuration.md +6 -1
- package/docs/models.md +1 -1
- package/docs/prompt-templates.md +1 -1
- package/docs/providers.md +67 -15
- package/docs/run-preflight.md +47 -0
- package/docs/sdk.md +39 -1
- package/docs/security.md +1 -1
- package/docs/settings.md +12 -5
- package/docs/skills.md +2 -0
- package/docs/slash-commands.md +5 -3
- package/docs/usage.md +29 -0
- package/examples/extensions/custom-provider-anthropic/package-lock.json +4 -4
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/tsconfig.json +13 -0
- package/npm-shrinkwrap.json +67 -67
- package/package.json +25 -19
- package/schemas/models.schema.json +30 -0
- package/schemas/settings.schema.json +28 -9
- package/src/humain/caveman/UPSTREAM.md +19 -3
- package/src/humain/caveman/upstream.json +2 -2
- package/src/humain/ponytail/UPSTREAM.md +16 -1
- package/src/humain/web-access/UPSTREAM.md +10 -0
- package/src/humain/web-access/upstream.json +1 -0
- package/dist/bundle/chunks/anthropic-messages-MNISFDZA.js +0 -66
- package/dist/bundle/chunks/chunk-2HZ2V3HS.js +0 -1985
- package/dist/bundle/chunks/chunk-2PZ46FSM.js +0 -6
- package/dist/bundle/chunks/chunk-4SQUP6IR.js +0 -88
- package/dist/bundle/chunks/chunk-5JSLXC2A.js +0 -3
- package/dist/bundle/chunks/chunk-75CQYZ63.js +0 -1336
- package/dist/bundle/chunks/chunk-DCPACGLH.js +0 -12267
- package/dist/bundle/chunks/chunk-FLVBQ6GS.js +0 -24
- package/dist/bundle/chunks/chunk-H7Y4QY7K.js +0 -11
- package/dist/bundle/chunks/chunk-JEAM6N22.js +0 -139
- package/dist/bundle/chunks/chunk-PS2FJ7M4.js +0 -23
- package/dist/bundle/chunks/chunk-TEOMXMW6.js +0 -23
- package/dist/bundle/chunks/chunk-WEFEQEIQ.js +0 -28
- package/dist/bundle/chunks/chunk-WW4SILXG.js +0 -249
- package/dist/bundle/chunks/compat-MXAZPYDN.js +0 -13
- package/dist/bundle/chunks/dist-3V7ZSLER.js +0 -3166
- package/dist/bundle/chunks/dist-66CW64M2.js +0 -8
- package/dist/bundle/chunks/host-SCZ4IKWR.js +0 -2
- package/dist/bundle/chunks/openai-codex-responses-LZWBQYVP.js +0 -101
- package/dist/bundle/chunks/openai-completions-7NWH423P.js +0 -82
- package/dist/bundle/chunks/openai-responses-5YOLHMCF.js +0 -27
- package/dist/bundle/chunks/runtime-UVPDE4CX.js +0 -2
- package/dist/bundle/chunks/typesafe-system-one-BHJYAZ6E.js +0 -3
- package/dist/bundle/chunks/virtual-modules-YQPK57CW.js +0 -23
- package/dist/humain/legacy-workflow-tiers.d.ts +0 -3
- package/dist/humain/legacy-workflow-tiers.d.ts.map +0 -1
- package/dist/humain/legacy-workflow-tiers.js +0 -46
- package/dist/humain/legacy-workflow-tiers.js.map +0 -1
- /package/dist/bundle/{flow → orchestrate}/agents/orch-architect.md +0 -0
- /package/dist/bundle/{flow → orchestrate}/agents/orch-scout.md +0 -0
- /package/dist/bundle/{flow → orchestrate}/agents/orch-security-review.md +0 -0
- /package/dist/bundle/{flow → orchestrate}/agents/orch-technical-lead.md +0 -0
- /package/dist/bundle/{flow → orchestrate}/agents/orch-technical-review.md +0 -0
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ExtensionFactory } from "../core/extensions/types.ts";
|
|
2
|
+
/** Expose classification only with configured Node auth; resolve the active key at execution time. */
|
|
3
|
+
export declare function createHumainClassifyExtensionFactory(): ExtensionFactory;
|
|
4
|
+
//# sourceMappingURL=classify-tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classify-tool.d.ts","sourceRoot":"","sources":["../../src/humain/classify-tool.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAoB,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAItF,sGAAsG;AACtG,wBAAgB,oCAAoC,IAAI,gBAAgB,CAoDvE"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Type } from "typebox";
|
|
2
|
+
import { HUMAIN_NODE_PROVIDER } from "./node-provider.js";
|
|
3
|
+
import { classifyHumainNode, SYSTEMONE_MODELS, systemOneUsage } from "./systemone.js";
|
|
4
|
+
/** Expose classification only with configured Node auth; resolve the active key at execution time. */
|
|
5
|
+
export function createHumainClassifyExtensionFactory() {
|
|
6
|
+
return (pi) => {
|
|
7
|
+
let registered = false;
|
|
8
|
+
let available = false;
|
|
9
|
+
const sync = (ctx) => {
|
|
10
|
+
const configured = ctx.modelRegistry.getProviderAuthStatus(HUMAIN_NODE_PROVIDER).configured;
|
|
11
|
+
if (configured === available)
|
|
12
|
+
return;
|
|
13
|
+
available = configured;
|
|
14
|
+
if (!configured && !registered)
|
|
15
|
+
return;
|
|
16
|
+
registered = true;
|
|
17
|
+
pi.registerTool({
|
|
18
|
+
name: "humain_classify",
|
|
19
|
+
label: "HUMAIN classify",
|
|
20
|
+
description: "Classify text with HUMAIN Node SystemOne. Questions need string type (noul, choice, score) and instructions; additional fields pass through unchanged.",
|
|
21
|
+
exposure: configured ? "deferred" : "hidden",
|
|
22
|
+
parameters: Type.Object({
|
|
23
|
+
model: Type.Union(SYSTEMONE_MODELS.map((model) => Type.Literal(model))),
|
|
24
|
+
state: Type.String(),
|
|
25
|
+
questions: Type.Record(Type.String(), Type.Object({
|
|
26
|
+
type: Type.String(),
|
|
27
|
+
instructions: Type.String(),
|
|
28
|
+
}, { additionalProperties: true })),
|
|
29
|
+
}),
|
|
30
|
+
async execute(_id, params, signal, _onUpdate, context) {
|
|
31
|
+
const auth = await context.modelRegistry.getProviderAuth(HUMAIN_NODE_PROVIDER);
|
|
32
|
+
if (!auth?.auth.apiKey)
|
|
33
|
+
throw new Error("Sign in with /login humain-node to classify");
|
|
34
|
+
const result = await classifyHumainNode(params, {
|
|
35
|
+
apiKey: auth.auth.apiKey,
|
|
36
|
+
baseUrl: auth.auth.baseUrl,
|
|
37
|
+
}, signal);
|
|
38
|
+
return {
|
|
39
|
+
content: [{ type: "text", text: JSON.stringify(result) }],
|
|
40
|
+
details: result,
|
|
41
|
+
usage: systemOneUsage(result),
|
|
42
|
+
};
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
pi.on("session_start", (_event, ctx) => sync(ctx));
|
|
47
|
+
pi.on("before_agent_start", (_event, ctx) => sync(ctx));
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=classify-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classify-tool.js","sourceRoot":"","sources":["../../src/humain/classify-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEtF,sGAAsG;AACtG,MAAM,UAAU,oCAAoC;IACnD,OAAO,CAAC,EAAE,EAAE,EAAE;QACb,IAAI,UAAU,GAAG,KAAK,CAAC;QACvB,IAAI,SAAS,GAAG,KAAK,CAAC;QACtB,MAAM,IAAI,GAAG,CAAC,GAAqB,EAAE,EAAE;YACtC,MAAM,UAAU,GAAG,GAAG,CAAC,aAAa,CAAC,qBAAqB,CAAC,oBAAoB,CAAC,CAAC,UAAU,CAAC;YAC5F,IAAI,UAAU,KAAK,SAAS;gBAAE,OAAO;YACrC,SAAS,GAAG,UAAU,CAAC;YACvB,IAAI,CAAC,UAAU,IAAI,CAAC,UAAU;gBAAE,OAAO;YACvC,UAAU,GAAG,IAAI,CAAC;YAClB,EAAE,CAAC,YAAY,CAAC;gBACf,IAAI,EA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E,MAAM;wBACf,KAAK,EAAE,cAAc,CAAC,MAAM,CAAC;qBAC7B,CAAC;gBACH,CAAC;aACD,CAAC,CAAC;QACJ,CAAC,CAAC;QACF,EAAE,CAAC,EAAE,CAAC,eAAe,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QACnD,EAAE,CAAC,EAAE,CAAC,oBAAoB,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IACzD,CAAC,CAAC;AACH,CAAC","sourcesContent":["import { Type } from \"typebox\";\nimport type { ExtensionContext, ExtensionFactory } from \"../core/extensions/types.ts\";\nimport { HUMAIN_NODE_PROVIDER } from \"./node-provider.ts\";\nimport { classifyHumainNode, SYSTEMONE_MODELS, systemOneUsage } from \"./systemone.ts\";\n\n/** Expose classification only with configured Node auth; resolve the active key at execution time. */\nexport function createHumainClassifyExtensionFactory(): ExtensionFactory {\n\treturn (pi) => {\n\t\tlet registered = false;\n\t\tlet available = false;\n\t\tconst sync = (ctx: ExtensionContext) => {\n\t\t\tconst configured = ctx.modelRegistry.getProviderAuthStatus(HUMAIN_NODE_PROVIDER).configured;\n\t\t\tif (configured === available) return;\n\t\t\tavailable = configured;\n\t\t\tif (!configured && !registered) return;\n\t\t\tregistered = true;\n\t\t\tpi.registerTool({\n\t\t\t\tname: \"humain_classify\",\n\t\t\t\tlabel: \"HUMAIN classify\",\n\t\t\t\tdescription:\n\t\t\t\t\t\"Classify text with HUMAIN Node SystemOne. Questions need string type (noul, choice, score) and instructions; additional fields pass through unchanged.\",\n\t\t\t\texposure: configured ? \"deferred\" : \"hidden\",\n\t\t\t\tparameters: Type.Object({\n\t\t\t\t\tmodel: Type.Union(SYSTEMONE_MODELS.map((model) => Type.Literal(model))),\n\t\t\t\t\tstate: Type.String(),\n\t\t\t\t\tquestions: Type.Record(\n\t\t\t\t\t\tType.String(),\n\t\t\t\t\t\tType.Object(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: Type.String(),\n\t\t\t\t\t\t\t\tinstructions: Type.String(),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{ additionalProperties: true },\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t}),\n\t\t\t\tasync execute(_id, params, signal, _onUpdate, context) {\n\t\t\t\t\tconst auth = await context.modelRegistry.getProviderAuth(HUMAIN_NODE_PROVIDER);\n\t\t\t\t\tif (!auth?.auth.apiKey) throw new Error(\"Sign in with /login humain-node to classify\");\n\t\t\t\t\tconst result = await classifyHumainNode(\n\t\t\t\t\t\tparams,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tapiKey: auth.auth.apiKey,\n\t\t\t\t\t\t\tbaseUrl: auth.auth.baseUrl,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsignal,\n\t\t\t\t\t);\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontent: [{ type: \"text\", text: JSON.stringify(result) }],\n\t\t\t\t\t\tdetails: result,\n\t\t\t\t\t\tusage: systemOneUsage(result),\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t});\n\t\t};\n\t\tpi.on(\"session_start\", (_event, ctx) => sync(ctx));\n\t\tpi.on(\"before_agent_start\", (_event, ctx) => sync(ctx));\n\t};\n}\n"]}
|
|
@@ -3,7 +3,7 @@ import type { AutocompleteItem } from "@earendil-works/pi-tui";
|
|
|
3
3
|
* Static vocabulary, parsing, help and completion for the single `/flow` command. Pure and dependency-light on
|
|
4
4
|
* purpose: the lazy loader uses it before (and without) importing Flow, so help works when Flow is disabled.
|
|
5
5
|
*/
|
|
6
|
-
export declare const FLOW_SUBCOMMANDS: readonly ["help", "run", "continue", "fix", "list", "status", "cancel", "pause", "resume", "title", "message", "hide", "show", "models", "profile", "setup"];
|
|
6
|
+
export declare const FLOW_SUBCOMMANDS: readonly ["help", "run", "orchestrate", "continue", "fix", "list", "status", "cancel", "pause", "resume", "title", "message", "hide", "show", "models", "profile", "setup"];
|
|
7
7
|
export type FlowSubcommand = (typeof FLOW_SUBCOMMANDS)[number];
|
|
8
8
|
/** Refusal for `/flow setup` outside the terminal UI: secure account dialogs exist only there. */
|
|
9
9
|
export declare const FLOW_SETUP_TERMINAL_ONLY = "/flow setup needs the interactive terminal. Use /flow models and /flow profile for changes from other modes.";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-command.d.ts","sourceRoot":"","sources":["../../src/humain/flow-command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG/D;;;GAGG;AAEH,eAAO,MAAM,gBAAgB,YAC5B,MAAM,EACN,KAAK,EACL,UAAU,EACV,KAAK,EACL,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,OAAO,EACP,SAAS,EACT,MAAM,EACN,MAAM,EACN,QAAQ,EACR,SAAS,EACT,OAAO,CACE,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/D,kGAAkG;AAClG,eAAO,MAAM,wBAAwB,iHAC0E,CAAC;
|
|
1
|
+
{"version":3,"file":"flow-command.d.ts","sourceRoot":"","sources":["../../src/humain/flow-command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG/D;;;GAGG;AAEH,eAAO,MAAM,gBAAgB,YAC5B,MAAM,EACN,KAAK,EACL,aAAa,EACb,UAAU,EACV,KAAK,EACL,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,OAAO,EACP,SAAS,EACT,MAAM,EACN,MAAM,EACN,QAAQ,EACR,SAAS,EACT,OAAO,CACE,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/D,kGAAkG;AAClG,eAAO,MAAM,wBAAwB,iHAC0E,CAAC;AAoDhH,0EAA0E;AAC1E,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC/B,IAAI,EAAE,MAAM,GACV;IAAE,OAAO,EAAE,cAAc,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,cAAc,CAAA;CAAE,CA8B5F;AAyGD,mHAAmH;AACnH,wBAAgB,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAOrD;AAED,8GAA8G;AAC9G,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB,EAAE,GAAG,IAAI,CAyB/E"}
|
|
@@ -6,6 +6,7 @@ import { sanitizeForTerminal } from "../core/trace-client/sanitize.js";
|
|
|
6
6
|
export const FLOW_SUBCOMMANDS = [
|
|
7
7
|
"help",
|
|
8
8
|
"run",
|
|
9
|
+
"orchestrate",
|
|
9
10
|
"continue",
|
|
10
11
|
"fix",
|
|
11
12
|
"list",
|
|
@@ -36,7 +37,8 @@ const NO_ARGUMENT_SUBCOMMANDS = new Set([
|
|
|
36
37
|
]);
|
|
37
38
|
const SUMMARIES = {
|
|
38
39
|
help: "Show usage and examples",
|
|
39
|
-
run: "
|
|
40
|
+
run: "Run one implementer with checks",
|
|
41
|
+
orchestrate: "Plan and run a multi-agent topology",
|
|
40
42
|
continue: "Recover an interrupted run",
|
|
41
43
|
fix: "Fix failing checks of a verified-after run",
|
|
42
44
|
list: "Find recent runs and run IDs",
|
|
@@ -115,6 +117,9 @@ const GENERAL_HELP = [
|
|
|
115
117
|
"",
|
|
116
118
|
"Start work",
|
|
117
119
|
" /flow run <goal> [flags]",
|
|
120
|
+
` ${SUMMARIES.run}`,
|
|
121
|
+
" /flow orchestrate <goal> [flags]",
|
|
122
|
+
` ${SUMMARIES.orchestrate}. Short form: /orchestrate`,
|
|
118
123
|
"",
|
|
119
124
|
"Manage a run",
|
|
120
125
|
helpRow("/flow list", "list"),
|
|
@@ -160,8 +165,21 @@ const TOPIC_HELP = {
|
|
|
160
165
|
"Example:",
|
|
161
166
|
" /flow run Fix the login timeout --risk medium",
|
|
162
167
|
"",
|
|
163
|
-
"Describe the outcome you want. Flow
|
|
164
|
-
"
|
|
168
|
+
"Describe the outcome you want. Flow runs one implementer,",
|
|
169
|
+
"then the repository checks. For a multi-agent run use /orchestrate.",
|
|
170
|
+
"",
|
|
171
|
+
RUN_FLAGS,
|
|
172
|
+
].join("\n"),
|
|
173
|
+
orchestrate: [
|
|
174
|
+
"Plan and run a multi-agent Flow topology",
|
|
175
|
+
"",
|
|
176
|
+
"Usage:",
|
|
177
|
+
" /orchestrate <goal> [flags]",
|
|
178
|
+
" /flow orchestrate <goal> [flags]",
|
|
179
|
+
"",
|
|
180
|
+
"Flow sizes the goal. Large goals get an architect, scouts,",
|
|
181
|
+
"leads and reviewers; smaller goals start with one implementer",
|
|
182
|
+
"and can escalate.",
|
|
165
183
|
"",
|
|
166
184
|
RUN_FLAGS,
|
|
167
185
|
].join("\n"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-command.js","sourceRoot":"","sources":["../../src/humain/flow-command.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAEvE;;;GAGG;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC/B,MAAM;IACN,KAAK;IACL,UAAU;IACV,KAAK;IACL,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,OAAO;IACP,SAAS;IACT,MAAM;IACN,MAAM;IACN,QAAQ;IACR,SAAS;IACT,OAAO;CACE,CAAC;AAIX,kGAAkG;AAClG,MAAM,CAAC,MAAM,wBAAwB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C,CAAC;QAC5F,CAAC;IACF,CAAC;SAAM,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,SAAS,CAAC,EAAE,CAAC;QAC9E,KAAK,MAAM,IAAI,IAAI,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,mBAAmB,EAAE,CAAC;YAClF,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,IAAI,EAAE,CAAC;gBAAE,KAAK,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QAC3F,CAAC;IACF,CAAC;IACD,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;AACxC,CAAC","sourcesContent":["import type { AutocompleteItem } from \"@earendil-works/pi-tui\";\nimport { sanitizeForTerminal } from \"../core/trace-client/sanitize.ts\";\n\n/**\n * Static vocabulary, parsing, help and completion for the single `/flow` command. Pure and dependency-light on\n * purpose: the lazy loader uses it before (and without) importing Flow, so help works when Flow is disabled.\n */\n\nexport const FLOW_SUBCOMMANDS = [\n\t\"help\",\n\t\"run\",\n\t\"continue\",\n\t\"fix\",\n\t\"list\",\n\t\"status\",\n\t\"cancel\",\n\t\"pause\",\n\t\"resume\",\n\t\"title\",\n\t\"message\",\n\t\"hide\",\n\t\"show\",\n\t\"models\",\n\t\"profile\",\n\t\"setup\",\n] as const;\n\nexport type FlowSubcommand = (typeof FLOW_SUBCOMMANDS)[number];\n\n/** Refusal for `/flow setup` outside the terminal UI: secure account dialogs exist only there. */\nexport const FLOW_SETUP_TERMINAL_ONLY =\n\t\"/flow setup needs the interactive terminal. Use /flow models and /flow profile for changes from other modes.\";\n\n/** Commands that take no arguments. */\nconst NO_ARGUMENT_SUBCOMMANDS: ReadonlySet<FlowSubcommand> = new Set([\n\t\"list\",\n\t\"status\",\n\t\"cancel\",\n\t\"pause\",\n\t\"resume\",\n\t\"hide\",\n\t\"show\",\n\t\"setup\",\n]);\n\nconst SUMMARIES: Record<FlowSubcommand, string> = {\n\thelp: \"Show usage and examples\",\n\trun: \"Start work\",\n\tcontinue: \"Recover an interrupted run\",\n\tfix: \"Fix failing checks of a verified-after run\",\n\tlist: \"Find recent runs and run IDs\",\n\tstatus: \"View progress\",\n\tcancel: \"Stop the active run\",\n\tpause: \"Pause new work\",\n\tresume: \"Resume paused work\",\n\ttitle: \"Rename the active run\",\n\tmessage: \"Send guidance\",\n\thide: \"Hide the widget; work continues\",\n\tshow: \"Show the active run's widget\",\n\tmodels: \"Manage model choices\",\n\tprofile: \"Manage run profiles\",\n\tsetup: \"Connect providers and configure Flow\",\n};\n\nconst MODELS_SUBCOMMANDS = [\n\t\"show\",\n\t\"list\",\n\t\"validate\",\n\t\"check\",\n\t\"set\",\n\t\"effort\",\n\t\"use\",\n\t\"new\",\n\t\"pick\",\n\t\"convert\",\n\t\"workflow\",\n];\nconst PROFILE_SUBCOMMANDS = [\"list\", \"show\", \"use\", \"export\", \"import\", \"validate\"];\n\nconst isSubcommand = (value: string): value is FlowSubcommand =>\n\t(FLOW_SUBCOMMANDS as readonly string[]).includes(value);\n\n/** Copy for a recognized subcommand this build does not implement yet. */\nexport function flowBuildUnavailable(command: string): string {\n\treturn `/flow ${sanitizeForTerminal(command)} is not available in this build. Use /flow help to see supported commands.`;\n}\n\n/**\n * Splits `/flow` arguments into subcommand and payload. Consumes the subcommand and exactly one separating\n * whitespace character; the rest of the payload is returned byte-for-byte so goal, message and title text is\n * never split or rejoined. Bare or whitespace-only input means help.\n */\nexport function parseFlowCommand(\n\targs: string,\n): { command: FlowSubcommand; payload: string } | { error: string; command?: FlowSubcommand } {\n\tconst match = /^\\s*(\\S+)([\\s\\S]*)$/.exec(args);\n\tif (!match) return { command: \"help\", payload: \"\" };\n\tconst [, name, rest] = match;\n\tif (!isSubcommand(name)) {\n\t\treturn {\n\t\t\terror: `Unknown Flow command: ${sanitizeForTerminal(name).slice(0, 80)}. Use /flow help to see available commands. To start work: /flow run <goal>`,\n\t\t};\n\t}\n\tconst payload = /^\\s/.test(rest) ? rest.slice(1) : rest;\n\tconst trimmed = payload.trim();\n\tif (name === \"help\" && trimmed) {\n\t\tif (/\\s/.test(trimmed)) return { error: \"/flow help accepts at most one topic. Usage: /flow help [topic]\" };\n\t\tif (!isSubcommand(trimmed)) {\n\t\t\treturn {\n\t\t\t\terror: `No help topic named “${sanitizeForTerminal(trimmed).slice(0, 80)}”. Use /flow help to see available commands.`,\n\t\t\t};\n\t\t}\n\t}\n\tif (NO_ARGUMENT_SUBCOMMANDS.has(name) && trimmed) {\n\t\treturn { error: `/flow ${name} does not accept arguments. Usage: /flow ${name}` };\n\t}\n\tif (name === \"fix\" && /\\s/.test(trimmed)) {\n\t\treturn { error: \"/flow fix accepts at most one run ID. Usage: /flow fix [run-id]\", command: name };\n\t}\n\tif (name === \"continue\" && /\\s/.test(trimmed)) {\n\t\t// `command` lets the loader settle the refused start over rpc.\n\t\treturn { error: \"/flow continue accepts at most one run ID. Usage: /flow continue [run-id]\", command: name };\n\t}\n\treturn { command: name, payload };\n}\n\nconst helpRow = (usage: string, command: FlowSubcommand) => `${` ${usage}`.padEnd(27)}${SUMMARIES[command]}`;\n\nconst GENERAL_HELP = [\n\t\"Flow — plan, run, and verify work with agents.\",\n\t\"\",\n\t\"Start work\",\n\t\" /flow run <goal> [flags]\",\n\t\"\",\n\t\"Manage a run\",\n\thelpRow(\"/flow list\", \"list\"),\n\thelpRow(\"/flow status\", \"status\"),\n\thelpRow(\"/flow cancel\", \"cancel\"),\n\thelpRow(\"/flow pause\", \"pause\"),\n\thelpRow(\"/flow resume\", \"resume\"),\n\thelpRow(\"/flow continue [run-id]\", \"continue\"),\n\thelpRow(\"/flow fix [run-id]\", \"fix\"),\n\thelpRow(\"/flow title <title>\", \"title\"),\n\thelpRow(\"/flow message <text>\", \"message\"),\n\thelpRow(\"/flow hide\", \"hide\"),\n\thelpRow(\"/flow show\", \"show\"),\n\t\"\",\n\t\"Configure\",\n\thelpRow(\"/flow setup\", \"setup\"),\n\thelpRow(\"/flow models <command>\", \"models\"),\n\thelpRow(\"/flow profile <command>\", \"profile\"),\n\t\"\",\n\t\"Learn more\",\n\t\" /flow help <command> Show usage and examples\",\n\t\"\",\n\t\"Example\",\n\t\" /flow run Fix the login timeout --risk medium\",\n].join(\"\\n\");\n\nconst RUN_FLAGS = [\n\t\"Flags:\",\n\t\" --task-class T --complexity N --risk low|medium|high|critical\",\n\t\" --profile ID --lead-size small|standard|large --workflow direct|checked|led|full --effort LEVEL\",\n\t\" --cheap ALIAS --mid ALIAS --premium ALIAS --frontier ALIAS --model <capability>=ALIAS\",\n\t\" --quality-floor F --cost-aggressiveness C --max-retries R --fan-out\",\n\t\" --context FILE ... --with-last-reply --force --route-only --candidate PATH --verify-after\",\n\t\" --live-qa --no-live-qa --live-qa-adapter ID --live-qa-scope SCOPE --live-qa-acceptance FILE\",\n].join(\"\\n\");\n\nconst TOPIC_HELP: Record<FlowSubcommand, string> = {\n\thelp: \"Show help\\n\\nUsage:\\n /flow help [command]\",\n\trun: [\n\t\t\"Start a Flow run\",\n\t\t\"\",\n\t\t\"Usage:\",\n\t\t\" /flow run <goal> [flags]\",\n\t\t\"\",\n\t\t\"Example:\",\n\t\t\" /flow run Fix the login timeout --risk medium\",\n\t\t\"\",\n\t\t\"Describe the outcome you want. Flow plans the work,\",\n\t\t\"dispatches agents, and verifies the result.\",\n\t\t\"\",\n\t\tRUN_FLAGS,\n\t].join(\"\\n\"),\n\tfix: \"Fix the failing checks of a run started with --verify-after\\n\\nUsage:\\n /flow fix [run-id]\\n\\nStarts a new run from that run's local failing-check report. Default: the last such run in this session.\",\n\tcontinue:\n\t\t\"Recover an interrupted run\\n\\nUsage:\\n /flow continue [run-id]\\n\\nRecovery requires a safety check and your confirmation.\",\n\tlist: [\n\t\t\"Find recent runs and run IDs\",\n\t\t\"\",\n\t\t\"Usage:\",\n\t\t\" /flow list\",\n\t\t\"\",\n\t\t\"History examines up to 200 runs by creation time.\",\n\t\t\"Runs without readable execution snapshots are omitted.\",\n\t\t\"Listing does not recover a run or claim ownership.\",\n\t].join(\"\\n\"),\n\tstatus: \"View progress of the active run\\n\\nUsage:\\n /flow status\",\n\tcancel: \"Stop the active run\\n\\nUsage:\\n /flow cancel\",\n\tpause: \"Pause new work. Running agents finish their current turn. No new agents will start.\\n\\nUsage:\\n /flow pause\",\n\tresume: \"Resume paused work\\n\\nUsage:\\n /flow resume\",\n\ttitle: \"Rename the active run\\n\\nUsage:\\n /flow title <title>\",\n\tmessage:\n\t\t\"Send guidance to the running lead. It is held until the lead starts if none is running yet, and sent to the host as a follow-up when no Flow is running.\\n\\nUsage:\\n /flow message <text>\\n\\nUse \\\\n for newlines.\",\n\thide: \"Hide the widget; work continues. Only the current widget is hidden; a new run shows it again. Bring it back with /flow show.\\n\\nUsage:\\n /flow hide\",\n\tshow: \"Show the active run's widget, or the retained final result of the last run until a new run starts.\\n\\nUsage:\\n /flow show\",\n\tmodels: `Flow models\\n\\nView or change the models Flow uses.\\nChanges apply to future runs. Runs already started keep their settings.\\nFlow switches models after a failure only to fallbacks you list.\\nWith no fallbacks configured, Flow will not switch models automatically.\\n\\nUsage:\\n /flow models [${MODELS_SUBCOMMANDS.join(\"|\")}]\\n\\nView current choices:\\n /flow models show`,\n\tprofile: `Flow profiles\\n\\nView and manage saved run settings.\\nChanges apply to future runs. Runs already started keep their settings.\\n\\nUsage:\\n /flow profile [${PROFILE_SUBCOMMANDS.join(\"|\")}]\\n\\nList profiles:\\n /flow profile list`,\n\t// The account sentence must equal FLOW_ACCOUNT_PERSISTENCE_NOTICE; humain-flow-command.test.ts enforces it.\n\tsetup: `Connect providers and configure Flow\\n\\nTerminal only. Use /flow models and /flow profile from other modes.\\nProfile edits remain unsaved until Save. Sign-in and account changes take effect immediately and are not undone by cancelling setup.\\n\\nUsage:\\n /flow setup`,\n};\n\n/** Static help text. An unrecognized topic yields the unknown-topic copy; the parser rejects those before this. */\nexport function renderFlowHelp(topic?: string): string {\n\tconst name = topic?.trim();\n\tif (!name) return GENERAL_HELP;\n\tif (!isSubcommand(name)) {\n\t\treturn `No help topic named “${sanitizeForTerminal(name).slice(0, 80)}”. Use /flow help to see available commands.`;\n\t}\n\treturn TOPIC_HELP[name];\n}\n\n/** Static completion for the argument text after `/flow `: subcommands, then help topics and nested names. */\nexport function completeFlowArguments(prefix: string): AutocompleteItem[] | null {\n\tconst words = prefix.trimStart().split(/\\s+/);\n\tconst [first = \"\", second] = words;\n\tconst items: AutocompleteItem[] = [];\n\tif (words.length === 1) {\n\t\tfor (const command of FLOW_SUBCOMMANDS) {\n\t\t\tif (command.startsWith(first)) {\n\t\t\t\titems.push({\n\t\t\t\t\tvalue: command,\n\t\t\t\t\tlabel: command,\n\t\t\t\t\tdescription: SUMMARIES[command],\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t} else if (words.length === 2 && first === \"help\") {\n\t\tfor (const command of FLOW_SUBCOMMANDS) {\n\t\t\tif (command.startsWith(second ?? \"\"))\n\t\t\t\titems.push({ value: `help ${command}`, label: command, description: SUMMARIES[command] });\n\t\t}\n\t} else if (words.length === 2 && (first === \"models\" || first === \"profile\")) {\n\t\tfor (const name of first === \"models\" ? MODELS_SUBCOMMANDS : PROFILE_SUBCOMMANDS) {\n\t\t\tif (name.startsWith(second ?? \"\")) items.push({ value: `${first} ${name}`, label: name });\n\t\t}\n\t}\n\treturn items.length > 0 ? items : null;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"flow-command.js","sourceRoot":"","sources":["../../src/humain/flow-command.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAEvE;;;GAGG;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC/B,MAAM;IACN,KAAK;IACL,aAAa;IACb,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CAAC,EAAE,CAAC;gBAC/B,KAAK,CAAC,IAAI,CAAC;oBACV,KAAK,EAAE,OAAO;oBACd,KAAK,EAAE,OAAO;oBACd,WAAW,EAAE,SAAS,CAAC,OAAO,CAAC;iBAC/B,CAAC,CAAC;YACJ,CAAC;QACF,CAAC;IACF,CAAC;SAAM,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,KAAK,MAAM,EAAE,CAAC;QACnD,KAAK,MAAM,OAAO,IAAI,gBAAgB,EAAE,CAAC;YACxC,IAAI,OAAO,CAAC,UAAU,CAAC,MAAM,IAAI,EAAE,CAAC;gBACnC,KAAK,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,QAAQ,OAAO,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAC5F,CAAC;IACF,CAAC;SAAM,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,SAAS,CAAC,EAAE,CAAC;QAC9E,KAAK,MAAM,IAAI,IAAI,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,mBAAmB,EAAE,CAAC;YAClF,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,IAAI,EAAE,CAAC;gBAAE,KAAK,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QAC3F,CAAC;IACF,CAAC;IACD,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;AACxC,CAAC","sourcesContent":["import type { AutocompleteItem } from \"@earendil-works/pi-tui\";\nimport { sanitizeForTerminal } from \"../core/trace-client/sanitize.ts\";\n\n/**\n * Static vocabulary, parsing, help and completion for the single `/flow` command. Pure and dependency-light on\n * purpose: the lazy loader uses it before (and without) importing Flow, so help works when Flow is disabled.\n */\n\nexport const FLOW_SUBCOMMANDS = [\n\t\"help\",\n\t\"run\",\n\t\"orchestrate\",\n\t\"continue\",\n\t\"fix\",\n\t\"list\",\n\t\"status\",\n\t\"cancel\",\n\t\"pause\",\n\t\"resume\",\n\t\"title\",\n\t\"message\",\n\t\"hide\",\n\t\"show\",\n\t\"models\",\n\t\"profile\",\n\t\"setup\",\n] as const;\n\nexport type FlowSubcommand = (typeof FLOW_SUBCOMMANDS)[number];\n\n/** Refusal for `/flow setup` outside the terminal UI: secure account dialogs exist only there. */\nexport const FLOW_SETUP_TERMINAL_ONLY =\n\t\"/flow setup needs the interactive terminal. Use /flow models and /flow profile for changes from other modes.\";\n\n/** Commands that take no arguments. */\nconst NO_ARGUMENT_SUBCOMMANDS: ReadonlySet<FlowSubcommand> = new Set([\n\t\"list\",\n\t\"status\",\n\t\"cancel\",\n\t\"pause\",\n\t\"resume\",\n\t\"hide\",\n\t\"show\",\n\t\"setup\",\n]);\n\nconst SUMMARIES: Record<FlowSubcommand, string> = {\n\thelp: \"Show usage and examples\",\n\trun: \"Run one implementer with checks\",\n\torchestrate: \"Plan and run a multi-agent topology\",\n\tcontinue: \"Recover an interrupted run\",\n\tfix: \"Fix failing checks of a verified-after run\",\n\tlist: \"Find recent runs and run IDs\",\n\tstatus: \"View progress\",\n\tcancel: \"Stop the active run\",\n\tpause: \"Pause new work\",\n\tresume: \"Resume paused work\",\n\ttitle: \"Rename the active run\",\n\tmessage: \"Send guidance\",\n\thide: \"Hide the widget; work continues\",\n\tshow: \"Show the active run's widget\",\n\tmodels: \"Manage model choices\",\n\tprofile: \"Manage run profiles\",\n\tsetup: \"Connect providers and configure Flow\",\n};\n\nconst MODELS_SUBCOMMANDS = [\n\t\"show\",\n\t\"list\",\n\t\"validate\",\n\t\"check\",\n\t\"set\",\n\t\"effort\",\n\t\"use\",\n\t\"new\",\n\t\"pick\",\n\t\"convert\",\n\t\"workflow\",\n];\nconst PROFILE_SUBCOMMANDS = [\"list\", \"show\", \"use\", \"export\", \"import\", \"validate\"];\n\nconst isSubcommand = (value: string): value is FlowSubcommand =>\n\t(FLOW_SUBCOMMANDS as readonly string[]).includes(value);\n\n/** Copy for a recognized subcommand this build does not implement yet. */\nexport function flowBuildUnavailable(command: string): string {\n\treturn `/flow ${sanitizeForTerminal(command)} is not available in this build. Use /flow help to see supported commands.`;\n}\n\n/**\n * Splits `/flow` arguments into subcommand and payload. Consumes the subcommand and exactly one separating\n * whitespace character; the rest of the payload is returned byte-for-byte so goal, message and title text is\n * never split or rejoined. Bare or whitespace-only input means help.\n */\nexport function parseFlowCommand(\n\targs: string,\n): { command: FlowSubcommand; payload: string } | { error: string; command?: FlowSubcommand } {\n\tconst match = /^\\s*(\\S+)([\\s\\S]*)$/.exec(args);\n\tif (!match) return { command: \"help\", payload: \"\" };\n\tconst [, name, rest] = match;\n\tif (!isSubcommand(name)) {\n\t\treturn {\n\t\t\terror: `Unknown Flow command: ${sanitizeForTerminal(name).slice(0, 80)}. Use /flow help to see available commands. To start work: /flow run <goal>`,\n\t\t};\n\t}\n\tconst payload = /^\\s/.test(rest) ? rest.slice(1) : rest;\n\tconst trimmed = payload.trim();\n\tif (name === \"help\" && trimmed) {\n\t\tif (/\\s/.test(trimmed)) return { error: \"/flow help accepts at most one topic. Usage: /flow help [topic]\" };\n\t\tif (!isSubcommand(trimmed)) {\n\t\t\treturn {\n\t\t\t\terror: `No help topic named “${sanitizeForTerminal(trimmed).slice(0, 80)}”. Use /flow help to see available commands.`,\n\t\t\t};\n\t\t}\n\t}\n\tif (NO_ARGUMENT_SUBCOMMANDS.has(name) && trimmed) {\n\t\treturn { error: `/flow ${name} does not accept arguments. Usage: /flow ${name}` };\n\t}\n\tif (name === \"fix\" && /\\s/.test(trimmed)) {\n\t\treturn { error: \"/flow fix accepts at most one run ID. Usage: /flow fix [run-id]\", command: name };\n\t}\n\tif (name === \"continue\" && /\\s/.test(trimmed)) {\n\t\t// `command` lets the loader settle the refused start over rpc.\n\t\treturn { error: \"/flow continue accepts at most one run ID. Usage: /flow continue [run-id]\", command: name };\n\t}\n\treturn { command: name, payload };\n}\n\nconst helpRow = (usage: string, command: FlowSubcommand) => `${` ${usage}`.padEnd(27)}${SUMMARIES[command]}`;\n\nconst GENERAL_HELP = [\n\t\"Flow — plan, run, and verify work with agents.\",\n\t\"\",\n\t\"Start work\",\n\t\" /flow run <goal> [flags]\",\n\t` ${SUMMARIES.run}`,\n\t\" /flow orchestrate <goal> [flags]\",\n\t` ${SUMMARIES.orchestrate}. Short form: /orchestrate`,\n\t\"\",\n\t\"Manage a run\",\n\thelpRow(\"/flow list\", \"list\"),\n\thelpRow(\"/flow status\", \"status\"),\n\thelpRow(\"/flow cancel\", \"cancel\"),\n\thelpRow(\"/flow pause\", \"pause\"),\n\thelpRow(\"/flow resume\", \"resume\"),\n\thelpRow(\"/flow continue [run-id]\", \"continue\"),\n\thelpRow(\"/flow fix [run-id]\", \"fix\"),\n\thelpRow(\"/flow title <title>\", \"title\"),\n\thelpRow(\"/flow message <text>\", \"message\"),\n\thelpRow(\"/flow hide\", \"hide\"),\n\thelpRow(\"/flow show\", \"show\"),\n\t\"\",\n\t\"Configure\",\n\thelpRow(\"/flow setup\", \"setup\"),\n\thelpRow(\"/flow models <command>\", \"models\"),\n\thelpRow(\"/flow profile <command>\", \"profile\"),\n\t\"\",\n\t\"Learn more\",\n\t\" /flow help <command> Show usage and examples\",\n\t\"\",\n\t\"Example\",\n\t\" /flow run Fix the login timeout --risk medium\",\n].join(\"\\n\");\n\nconst RUN_FLAGS = [\n\t\"Flags:\",\n\t\" --task-class T --complexity N --risk low|medium|high|critical\",\n\t\" --profile ID --lead-size small|standard|large --workflow direct|checked|led|full --effort LEVEL\",\n\t\" --cheap ALIAS --mid ALIAS --premium ALIAS --frontier ALIAS --model <capability>=ALIAS\",\n\t\" --quality-floor F --cost-aggressiveness C --max-retries R --fan-out\",\n\t\" --context FILE ... --with-last-reply --force --route-only --candidate PATH --verify-after\",\n\t\" --live-qa --no-live-qa --live-qa-adapter ID --live-qa-scope SCOPE --live-qa-acceptance FILE\",\n].join(\"\\n\");\n\nconst TOPIC_HELP: Record<FlowSubcommand, string> = {\n\thelp: \"Show help\\n\\nUsage:\\n /flow help [command]\",\n\trun: [\n\t\t\"Start a Flow run\",\n\t\t\"\",\n\t\t\"Usage:\",\n\t\t\" /flow run <goal> [flags]\",\n\t\t\"\",\n\t\t\"Example:\",\n\t\t\" /flow run Fix the login timeout --risk medium\",\n\t\t\"\",\n\t\t\"Describe the outcome you want. Flow runs one implementer,\",\n\t\t\"then the repository checks. For a multi-agent run use /orchestrate.\",\n\t\t\"\",\n\t\tRUN_FLAGS,\n\t].join(\"\\n\"),\n\torchestrate: [\n\t\t\"Plan and run a multi-agent Flow topology\",\n\t\t\"\",\n\t\t\"Usage:\",\n\t\t\" /orchestrate <goal> [flags]\",\n\t\t\" /flow orchestrate <goal> [flags]\",\n\t\t\"\",\n\t\t\"Flow sizes the goal. Large goals get an architect, scouts,\",\n\t\t\"leads and reviewers; smaller goals start with one implementer\",\n\t\t\"and can escalate.\",\n\t\t\"\",\n\t\tRUN_FLAGS,\n\t].join(\"\\n\"),\n\tfix: \"Fix the failing checks of a run started with --verify-after\\n\\nUsage:\\n /flow fix [run-id]\\n\\nStarts a new run from that run's local failing-check report. Default: the last such run in this session.\",\n\tcontinue:\n\t\t\"Recover an interrupted run\\n\\nUsage:\\n /flow continue [run-id]\\n\\nRecovery requires a safety check and your confirmation.\",\n\tlist: [\n\t\t\"Find recent runs and run IDs\",\n\t\t\"\",\n\t\t\"Usage:\",\n\t\t\" /flow list\",\n\t\t\"\",\n\t\t\"History examines up to 200 runs by creation time.\",\n\t\t\"Runs without readable execution snapshots are omitted.\",\n\t\t\"Listing does not recover a run or claim ownership.\",\n\t].join(\"\\n\"),\n\tstatus: \"View progress of the active run\\n\\nUsage:\\n /flow status\",\n\tcancel: \"Stop the active run\\n\\nUsage:\\n /flow cancel\",\n\tpause: \"Pause new work. Running agents finish their current turn. No new agents will start.\\n\\nUsage:\\n /flow pause\",\n\tresume: \"Resume paused work\\n\\nUsage:\\n /flow resume\",\n\ttitle: \"Rename the active run\\n\\nUsage:\\n /flow title <title>\",\n\tmessage:\n\t\t\"Send guidance to the running lead. It is held until the lead starts if none is running yet, and sent to the host as a follow-up when no Flow is running.\\n\\nUsage:\\n /flow message <text>\\n\\nUse \\\\n for newlines.\",\n\thide: \"Hide the widget; work continues. Only the current widget is hidden; a new run shows it again. Bring it back with /flow show.\\n\\nUsage:\\n /flow hide\",\n\tshow: \"Show the active run's widget, or the retained final result of the last run until a new run starts.\\n\\nUsage:\\n /flow show\",\n\tmodels: `Flow models\\n\\nView or change the models Flow uses.\\nChanges apply to future runs. Runs already started keep their settings.\\nFlow switches models after a failure only to fallbacks you list.\\nWith no fallbacks configured, Flow will not switch models automatically.\\n\\nUsage:\\n /flow models [${MODELS_SUBCOMMANDS.join(\"|\")}]\\n\\nView current choices:\\n /flow models show`,\n\tprofile: `Flow profiles\\n\\nView and manage saved run settings.\\nChanges apply to future runs. Runs already started keep their settings.\\n\\nUsage:\\n /flow profile [${PROFILE_SUBCOMMANDS.join(\"|\")}]\\n\\nList profiles:\\n /flow profile list`,\n\t// The account sentence must equal FLOW_ACCOUNT_PERSISTENCE_NOTICE; humain-flow-command.test.ts enforces it.\n\tsetup: `Connect providers and configure Flow\\n\\nTerminal only. Use /flow models and /flow profile from other modes.\\nProfile edits remain unsaved until Save. Sign-in and account changes take effect immediately and are not undone by cancelling setup.\\n\\nUsage:\\n /flow setup`,\n};\n\n/** Static help text. An unrecognized topic yields the unknown-topic copy; the parser rejects those before this. */\nexport function renderFlowHelp(topic?: string): string {\n\tconst name = topic?.trim();\n\tif (!name) return GENERAL_HELP;\n\tif (!isSubcommand(name)) {\n\t\treturn `No help topic named “${sanitizeForTerminal(name).slice(0, 80)}”. Use /flow help to see available commands.`;\n\t}\n\treturn TOPIC_HELP[name];\n}\n\n/** Static completion for the argument text after `/flow `: subcommands, then help topics and nested names. */\nexport function completeFlowArguments(prefix: string): AutocompleteItem[] | null {\n\tconst words = prefix.trimStart().split(/\\s+/);\n\tconst [first = \"\", second] = words;\n\tconst items: AutocompleteItem[] = [];\n\tif (words.length === 1) {\n\t\tfor (const command of FLOW_SUBCOMMANDS) {\n\t\t\tif (command.startsWith(first)) {\n\t\t\t\titems.push({\n\t\t\t\t\tvalue: command,\n\t\t\t\t\tlabel: command,\n\t\t\t\t\tdescription: SUMMARIES[command],\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t} else if (words.length === 2 && first === \"help\") {\n\t\tfor (const command of FLOW_SUBCOMMANDS) {\n\t\t\tif (command.startsWith(second ?? \"\"))\n\t\t\t\titems.push({ value: `help ${command}`, label: command, description: SUMMARIES[command] });\n\t\t}\n\t} else if (words.length === 2 && (first === \"models\" || first === \"profile\")) {\n\t\tfor (const name of first === \"models\" ? MODELS_SUBCOMMANDS : PROFILE_SUBCOMMANDS) {\n\t\t\tif (name.startsWith(second ?? \"\")) items.push({ value: `${first} ${name}`, label: name });\n\t\t}\n\t}\n\treturn items.length > 0 ? items : null;\n}\n"]}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
+
import type { FlowHierarchyCommands } from "@humain/flow";
|
|
1
2
|
import type { FlowEventFrameV1, FlowReceiptV1, FlowStatusV1 } from "@humain/humain-code-contracts/flow-control";
|
|
2
|
-
import type { ExtensionCommandContext, ExtensionFactory } from "../core/extensions/types.ts";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
* commands and not-yet-available commands are answered statically and never import Flow. Flow is bundled as its own
|
|
9
|
-
* chunk.
|
|
10
|
-
*/
|
|
3
|
+
import type { ExtensionAPI, ExtensionCommandContext, ExtensionFactory } from "../core/extensions/types.ts";
|
|
4
|
+
import type { startFlowImplementerSession } from "../core/flow-implementer.ts";
|
|
5
|
+
import type { AdaptiveExecutionOptions } from "./adaptive-execution.ts";
|
|
6
|
+
import type { AdaptiveHostPorts, createAdaptiveExecutionHost } from "./adaptive-session-host.ts";
|
|
7
|
+
/** Lazy adaptive host loading is colocated here so direct/legacy startup never reaches Flow. */
|
|
8
|
+
export declare function loadAdaptiveExecutionHost(ports: AdaptiveHostPorts, options?: AdaptiveExecutionOptions, project?: Omit<AdaptiveExecutionOptions, "hostLimits">): Promise<ReturnType<typeof createAdaptiveExecutionHost>>;
|
|
11
9
|
export declare const HUMAIN_FLOW_DISABLED_ENV = "HUMAIN_TERMINAL_FLOW_DISABLED";
|
|
12
10
|
export declare const HUMAIN_FLOW_PACKAGE_DIR_ENV = "HUMAIN_TERMINAL_FLOW_PACKAGE_DIR";
|
|
13
11
|
/** Run-control surface Flow exposes to rpc mode (flow_status/pause/resume/cancel/message). */
|
|
@@ -19,7 +17,9 @@ export interface FlowRpcControl {
|
|
|
19
17
|
activeRunId(): string | undefined;
|
|
20
18
|
}
|
|
21
19
|
export interface FlowModule {
|
|
22
|
-
flowExtension:
|
|
20
|
+
flowExtension(pi: ExtensionAPI, publishHierarchy?: (commands: FlowHierarchyCommands) => void, hostServices?: {
|
|
21
|
+
startImplementerSession: typeof startFlowImplementerSession;
|
|
22
|
+
}): void | Promise<void>;
|
|
23
23
|
/** Documented rpc hook: called once when Flow loads; `writeFrame` carries `flow_event` frames to the rpc host. */
|
|
24
24
|
createFlowRpcControl?(options: {
|
|
25
25
|
writeFrame?: (frame: FlowEventFrameV1) => void | Promise<void>;
|
|
@@ -36,9 +36,14 @@ export interface FlowModule {
|
|
|
36
36
|
builtInDir?: string;
|
|
37
37
|
}): unknown;
|
|
38
38
|
}
|
|
39
|
+
export interface OrchestrateModule {
|
|
40
|
+
createOrchestrateExtension(commands: FlowHierarchyCommands): ExtensionFactory;
|
|
41
|
+
}
|
|
39
42
|
export interface HumainFlowLoaderOptions {
|
|
40
43
|
/** Test seam. Defaults to the single sanctioned dynamic import of @humain/flow. */
|
|
41
44
|
importFlow?: () => Promise<FlowModule>;
|
|
45
|
+
/** Test seam for the separate sanctioned lazy import of @humain/orchestrate. */
|
|
46
|
+
importOrchestrate?: () => Promise<OrchestrateModule>;
|
|
42
47
|
env?: NodeJS.ProcessEnv;
|
|
43
48
|
/** Directory holding Flow's agents/assets/package.json. Defaults to the bundled layout's flow/ dir. */
|
|
44
49
|
flowPackageDir?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-loader.d.ts","sourceRoot":"","sources":["../../src/humain/flow-loader.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"flow-loader.d.ts","sourceRoot":"","sources":["../../src/humain/flow-loader.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAE1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAEhH,OAAO,KAAK,EACX,YAAY,EACZ,uBAAuB,EACvB,gBAAgB,EAEhB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAG/E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,KAAK,EAAE,iBAAiB,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAyBjG,gGAAgG;AAChG,wBAAsB,yBAAyB,CAC9C,KAAK,EAAE,iBAAiB,EACxB,OAAO,GAAE,wBAA6B,EACtC,OAAO,GAAE,IAAI,CAAC,wBAAwB,EAAE,YAAY,CAAM,GACxD,OAAO,CAAC,UAAU,CAAC,OAAO,2BAA2B,CAAC,CAAC,CAIzD;AAED,eAAO,MAAM,wBAAwB,kCAAkC,CAAC;AACxE,eAAO,MAAM,2BAA2B,qCAAqC,CAAC;AAE9E,8FAA8F;AAC9F,MAAM,WAAW,cAAc;IAC9B,MAAM,CAAC,KAAK,E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AAC;IACvC,gFAAgF;IAChF,iBAAiB,CAAC,EAAE,MAAM,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACrD,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,uGAAuG;IACvG,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sHAAsH;IACtH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,mEAAmE;IACnE,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAQD,qGAAqG;AACrG,wBAAgB,iBAAiB,IAAI,cAAc,GAAG,SAAS,CAE9D;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAI9E;AAED,sHAAsH;AACtH,wBAAgB,cAAc,IAAI,OAAO,CAExC;AAED,gGAAgG;AAChG,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,CAAC,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS,GAAG,IAAI,CAE9G;AAED,mHAAmH;AACnH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS,GAAG,IAAI,CAE7F;AAsPD,wBAAgB,sCAAsC,CAAC,OAAO,GAAE,uBAA4B,GAAG,gBAAgB,CAgN9G"}
|
|
@@ -6,13 +6,24 @@ import { createTraceRedactor } from "../core/trace/redaction.js";
|
|
|
6
6
|
import { sanitizeForTerminal } from "../core/trace-client/sanitize.js";
|
|
7
7
|
import { completeFlowArguments, FLOW_SETUP_TERMINAL_ONLY, flowBuildUnavailable, parseFlowCommand, renderFlowHelp, } from "./flow-command.js";
|
|
8
8
|
/**
|
|
9
|
-
* Lazy loader for the private @humain/flow
|
|
9
|
+
* Lazy loader for the private @humain/flow and @humain/orchestrate packages.
|
|
10
10
|
*
|
|
11
|
-
* The CLI entry graph must not statically reach Flow: this module registers one cheap `/flow` stub
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
11
|
+
* The CLI entry graph must not statically reach Flow: this module registers one cheap `/flow` stub (plus `/orchestrate`,
|
|
12
|
+
* which forwards to it) and two flags, and
|
|
13
|
+
* loads Flow the first time a subcommand needs it. Hierarchy commands additionally load Orchestrate through a second
|
|
14
|
+
* memoized dynamic import, using the initialized Flow instance. Help, completion, unknown commands and not-yet-available
|
|
15
|
+
* commands are answered statically and never import either package. Both packages are bundled as lazy chunks.
|
|
15
16
|
*/
|
|
17
|
+
// Single sanctioned Flow runtime boundary, shared by commands and explicitly selected adaptive runs.
|
|
18
|
+
function importFlowRuntime() {
|
|
19
|
+
return import("@humain/flow");
|
|
20
|
+
}
|
|
21
|
+
/** Lazy adaptive host loading is colocated here so direct/legacy startup never reaches Flow. */
|
|
22
|
+
export async function loadAdaptiveExecutionHost(ports, options = {}, project = {}) {
|
|
23
|
+
// Runtime/lazy boundary exception: importing this host elsewhere would pull checks into ordinary startup.
|
|
24
|
+
const [flow, host] = await Promise.all([importFlowRuntime(), import("./adaptive-session-host.js")]);
|
|
25
|
+
return host.createAdaptiveExecutionHost(flow, ports, options, project);
|
|
26
|
+
}
|
|
16
27
|
export const HUMAIN_FLOW_DISABLED_ENV = "HUMAIN_TERMINAL_FLOW_DISABLED";
|
|
17
28
|
export const HUMAIN_FLOW_PACKAGE_DIR_ENV = "HUMAIN_TERMINAL_FLOW_PACKAGE_DIR";
|
|
18
29
|
let rpcControl;
|
|
@@ -69,8 +80,8 @@ const STAGED_MEMBERS = new Set([
|
|
|
69
80
|
"registerVirtualModel",
|
|
70
81
|
"unregisterVirtualModel",
|
|
71
82
|
]);
|
|
72
|
-
const FLOW_DESCRIPTION = "Plan, run, and verify work with agents. Subcommands: run, continue, list, status, cancel, pause,
|
|
73
|
-
"title, message, hide, show, models, profile, setup. Use /flow help for usage.";
|
|
83
|
+
const FLOW_DESCRIPTION = "Plan, run, and verify work with agents. Subcommands: run, orchestrate, continue, list, status, cancel, pause, " +
|
|
84
|
+
"resume, title, message, hide, show, models, profile, setup. Use /flow help for usage.";
|
|
74
85
|
/**
|
|
75
86
|
* Act on an already loaded run only; with Flow not loaded there is no run, so Flow is never imported for them. They
|
|
76
87
|
* stay reachable when Flow is disabled so a live run can still be stopped. Every other subcommand is refused when
|
|
@@ -96,7 +107,7 @@ const NO_LOADED_RUN_COPY = {
|
|
|
96
107
|
show: "No current Flow widget to show.",
|
|
97
108
|
};
|
|
98
109
|
/** Only these start (or recover) work, so only their refusals settle an rpc run. */
|
|
99
|
-
const START_COMMANDS = new Set(["run", "continue", "fix"]);
|
|
110
|
+
const START_COMMANDS = new Set(["run", "orchestrate", "continue", "fix"]);
|
|
100
111
|
function isRecord(value) {
|
|
101
112
|
return typeof value === "object" && value !== null;
|
|
102
113
|
}
|
|
@@ -184,7 +195,7 @@ function disabledReason(pi, env) {
|
|
|
184
195
|
return undefined;
|
|
185
196
|
}
|
|
186
197
|
/**
|
|
187
|
-
* Run
|
|
198
|
+
* Run an executor extension against a staging proxy. The selected command is captured (so names never double-register); every other
|
|
188
199
|
* registration is recorded and applied to the real pi only after the factory and the session_start replay succeed, so
|
|
189
200
|
* a failed attempt leaves nothing behind and a retry starts from scratch. Late registration is supported by the
|
|
190
201
|
* extension loader (handlers, tools, commands and flags are written to the live extension object), but
|
|
@@ -194,7 +205,7 @@ function disabledReason(pi, env) {
|
|
|
194
205
|
* Commit is not transactional for non-handler members: if one throws midway, committed handlers are unsubscribed, and
|
|
195
206
|
* tools/commands/flags/shortcuts/renderers (keyed maps in the extension loader) are simply overwritten on retry.
|
|
196
207
|
*/
|
|
197
|
-
async function runFlowExtension(pi, flowExtension, lastSessionStart) {
|
|
208
|
+
async function runFlowExtension(pi, flowExtension, lastSessionStart, capturedCommand = "flow") {
|
|
198
209
|
const captured = new Map();
|
|
199
210
|
const staged = [];
|
|
200
211
|
// After a successful commit the proxy forwards live, so registrations made later (from handlers) reach the real pi.
|
|
@@ -203,7 +214,7 @@ async function runFlowExtension(pi, flowExtension, lastSessionStart) {
|
|
|
203
214
|
get(target, prop) {
|
|
204
215
|
if (!live && typeof prop === "string" && STAGED_MEMBERS.has(prop)) {
|
|
205
216
|
return (...args) => {
|
|
206
|
-
if (prop === "registerCommand" && args[0] ===
|
|
217
|
+
if (prop === "registerCommand" && args[0] === capturedCommand) {
|
|
207
218
|
captured.set(args[0], args[1]);
|
|
208
219
|
return undefined;
|
|
209
220
|
}
|
|
@@ -279,7 +290,9 @@ function isSameCliReleaseFlowDir(dir) {
|
|
|
279
290
|
export function createHumainFlowLoaderExtensionFactory(options = {}) {
|
|
280
291
|
const env = options.env ?? process.env;
|
|
281
292
|
// This is the single sanctioned lazy-load boundary for @humain/flow (see AGENTS.md "No inline imports" exception).
|
|
282
|
-
const importFlow = options.importFlow ??
|
|
293
|
+
const importFlow = options.importFlow ?? importFlowRuntime;
|
|
294
|
+
// Separate sanctioned lazy boundary: lean Flow commands must never import the hierarchy package.
|
|
295
|
+
const importOrchestrate = options.importOrchestrate ?? (() => import("@humain/orchestrate"));
|
|
283
296
|
const flowPackageDir = options.flowPackageDir ?? getBundledFlowPackageDir();
|
|
284
297
|
const builtInProfilesDir = options.builtInProfilesDir ?? getBundledFlowProfilesDir();
|
|
285
298
|
let flowModule;
|
|
@@ -287,6 +300,8 @@ export function createHumainFlowLoaderExtensionFactory(options = {}) {
|
|
|
287
300
|
disabledProbe = () => disabledReason(pi, env) !== undefined;
|
|
288
301
|
let lastStart;
|
|
289
302
|
let loaded;
|
|
303
|
+
let hierarchy;
|
|
304
|
+
let orchestrateLoaded;
|
|
290
305
|
pi.on("session_start", (event, ctx) => {
|
|
291
306
|
lastStart = [event, ctx];
|
|
292
307
|
});
|
|
@@ -298,6 +313,8 @@ export function createHumainFlowLoaderExtensionFactory(options = {}) {
|
|
|
298
313
|
delete env[HUMAIN_FLOW_PACKAGE_DIR_ENV];
|
|
299
314
|
if (flowPackageDir && !env[HUMAIN_FLOW_PACKAGE_DIR_ENV])
|
|
300
315
|
env[HUMAIN_FLOW_PACKAGE_DIR_ENV] = flowPackageDir;
|
|
316
|
+
if (flowPackageDir)
|
|
317
|
+
env.HUMAIN_TERMINAL_ORCHESTRATE_PACKAGE_DIR = join(dirname(flowPackageDir), "orchestrate");
|
|
301
318
|
flowModule ??= importFlow().then((module) => {
|
|
302
319
|
rpcControl = module.createFlowRpcControl?.({
|
|
303
320
|
writeFrame: (frame) => rpcOutput?.(frame),
|
|
@@ -327,7 +344,21 @@ export function createHumainFlowLoaderExtensionFactory(options = {}) {
|
|
|
327
344
|
if (!loaded) {
|
|
328
345
|
const attempt = (async () => {
|
|
329
346
|
const module = await loadModule();
|
|
330
|
-
|
|
347
|
+
let published;
|
|
348
|
+
const commands = await runFlowExtension(pi, (api) => module.flowExtension(api, (value) => {
|
|
349
|
+
published = value;
|
|
350
|
+
}, {
|
|
351
|
+
// Sanctioned opt-in runtime boundary: never load SDK session code for ordinary Flow children.
|
|
352
|
+
startImplementerSession: async (input) => (await import("../core/flow-implementer.js")).startFlowImplementerSession(input),
|
|
353
|
+
}), () => lastStart);
|
|
354
|
+
// Publish only after staging and session replay succeed; failed attempts cannot leak their command.
|
|
355
|
+
hierarchy = published;
|
|
356
|
+
hierarchy?.hierarchyExecutor.setLoader(async () => {
|
|
357
|
+
if (disabledReason(pi, env))
|
|
358
|
+
return;
|
|
359
|
+
await loadOrchestrate();
|
|
360
|
+
});
|
|
361
|
+
return commands;
|
|
331
362
|
})();
|
|
332
363
|
loaded = attempt;
|
|
333
364
|
// A failed load must be retryable on the next invocation.
|
|
@@ -338,7 +369,24 @@ export function createHumainFlowLoaderExtensionFactory(options = {}) {
|
|
|
338
369
|
}
|
|
339
370
|
return loaded;
|
|
340
371
|
};
|
|
341
|
-
|
|
372
|
+
const loadOrchestrate = () => {
|
|
373
|
+
if (!orchestrateLoaded) {
|
|
374
|
+
const attempt = (async () => {
|
|
375
|
+
await load();
|
|
376
|
+
if (!hierarchy)
|
|
377
|
+
return new Map();
|
|
378
|
+
const module = await importOrchestrate();
|
|
379
|
+
return runFlowExtension(pi, module.createOrchestrateExtension(hierarchy), () => lastStart, "orchestrate");
|
|
380
|
+
})();
|
|
381
|
+
orchestrateLoaded = attempt;
|
|
382
|
+
attempt.catch(() => {
|
|
383
|
+
if (orchestrateLoaded === attempt)
|
|
384
|
+
orchestrateLoaded = undefined;
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
return orchestrateLoaded;
|
|
388
|
+
};
|
|
389
|
+
const flow = {
|
|
342
390
|
description: FLOW_DESCRIPTION,
|
|
343
391
|
getArgumentCompletions: completeFlowArguments,
|
|
344
392
|
handler: async (args, rawCtx) => {
|
|
@@ -403,7 +451,7 @@ export function createHumainFlowLoaderExtensionFactory(options = {}) {
|
|
|
403
451
|
}
|
|
404
452
|
let commands;
|
|
405
453
|
try {
|
|
406
|
-
commands = await load();
|
|
454
|
+
commands = await (command === "orchestrate" ? loadOrchestrate() : load());
|
|
407
455
|
}
|
|
408
456
|
catch (error) {
|
|
409
457
|
try {
|
|
@@ -414,7 +462,7 @@ export function createHumainFlowLoaderExtensionFactory(options = {}) {
|
|
|
414
462
|
}
|
|
415
463
|
return;
|
|
416
464
|
}
|
|
417
|
-
const real = commands.get("flow");
|
|
465
|
+
const real = commands.get(command === "orchestrate" ? "orchestrate" : "flow");
|
|
418
466
|
if (!real) {
|
|
419
467
|
try {
|
|
420
468
|
ctx.ui.notify(flowBuildUnavailable(command), "error");
|
|
@@ -424,9 +472,15 @@ export function createHumainFlowLoaderExtensionFactory(options = {}) {
|
|
|
424
472
|
}
|
|
425
473
|
return;
|
|
426
474
|
}
|
|
427
|
-
// Flow
|
|
428
|
-
await real.handler(args, ctx);
|
|
475
|
+
// Flow re-parses its original arguments; Orchestrate receives the same byte-preserved payload directly.
|
|
476
|
+
await real.handler(command === "orchestrate" ? payload : args, ctx);
|
|
429
477
|
},
|
|
478
|
+
};
|
|
479
|
+
pi.registerCommand("flow", flow);
|
|
480
|
+
// Same load, gating and refusal path as `/flow orchestrate <goal>`.
|
|
481
|
+
pi.registerCommand("orchestrate", {
|
|
482
|
+
description: "Plan and run a multi-agent Flow topology. Args: <goal> [flags]",
|
|
483
|
+
handler: (args, ctx) => flow.handler(`orchestrate ${args}`, ctx),
|
|
430
484
|
});
|
|
431
485
|
};
|
|
432
486
|
}
|