@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
package/dist/main.js
CHANGED
|
@@ -5,26 +5,27 @@
|
|
|
5
5
|
* This file handles CLI argument parsing and translates them into
|
|
6
6
|
* createAgentSession() options. The SDK does the heavy lifting.
|
|
7
7
|
*/
|
|
8
|
-
import { statSync } from "node:fs";
|
|
8
|
+
import { statSync, writeFileSync } from "node:fs";
|
|
9
9
|
import { createInterface } from "node:readline";
|
|
10
10
|
import { modelsAreEqual } from "@earendil-works/pi-ai";
|
|
11
11
|
import { setCapabilityOverrides } from "@earendil-works/pi-tui";
|
|
12
12
|
import chalk from "chalk";
|
|
13
|
-
import {
|
|
13
|
+
import { loadAgentMonitorCommand } from "./agent-monitor/entry.lazy.js";
|
|
14
14
|
import { AGENT_MONITOR_COMMAND } from "./agent-monitor/protocol.js";
|
|
15
|
-
import { missingExtensionPaths, parseArgs, printHelp } from "./cli/args.js";
|
|
15
|
+
import { missingExtensionPaths, parseArgs, printHelp, stripStartupEnvArgs } from "./cli/args.js";
|
|
16
16
|
import { checkProviderAuth, createAuthCheckModelRuntime, getProviderCredential, } from "./cli/auth-check.js";
|
|
17
17
|
import { AuthCommandError, getAuthCommandName, getAuthCommandUsage, isAuthCommandHelp, parseAuthCommand, printAuthCommandHelp, validateAuthCommandArgs, } from "./cli/auth-command.js";
|
|
18
18
|
import { resolveCredentialForPrint } from "./cli/credential-print.js";
|
|
19
19
|
import { processFileArguments } from "./cli/file-processor.js";
|
|
20
20
|
import { buildInitialMessage } from "./cli/initial-message.js";
|
|
21
21
|
import { listModels } from "./cli/list-models.js";
|
|
22
|
+
import { showNonInteractiveMetadataDisclosure } from "./cli/metadata-disclosure.js";
|
|
22
23
|
import { createProjectTrustContext } from "./cli/project-trust.js";
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
24
|
+
import { loadSessionPicker } from "./cli/session-picker.lazy.js";
|
|
25
|
+
import { loadStartupUi } from "./cli/startup-ui.lazy.js";
|
|
26
|
+
import { loadTraceCommand } from "./cli/trace-command.lazy.js";
|
|
26
27
|
import { APP_COMMAND, ENV_OFFLINE, ENV_SESSION_DIR, ENV_SKIP_VERSION_CHECK, ENV_STARTUP_BENCHMARK, expandTildePath, getAgentDir, getPackageDir, VERSION, } from "./config.js";
|
|
27
|
-
import {
|
|
28
|
+
import { loadCoordinationBrokerCommand } from "./coordination/broker/entry.lazy.js";
|
|
28
29
|
import { COORDINATION_BROKER_COMMAND } from "./coordination/client/launch.js";
|
|
29
30
|
import { createAgentSessionRuntime } from "./core/agent-session-runtime.js";
|
|
30
31
|
import { createAgentSessionFromServices, createAgentSessionServices, } from "./core/agent-session-services.js";
|
|
@@ -32,10 +33,13 @@ import { formatNoModelsAvailableMessage } from "./core/auth-guidance.js";
|
|
|
32
33
|
import { AuthStorage, ReadOnlyAuthStorage } from "./core/auth-storage.js";
|
|
33
34
|
import { exportFromFile } from "./core/export-html/index.js";
|
|
34
35
|
import { applyHttpProxySettings, configureHttpDispatcher } from "./core/http-dispatcher.js";
|
|
35
|
-
import { resolveCliModel, resolveModelScope } from "./core/model-resolver.js";
|
|
36
|
+
import { isRetiredHumainProvider, resolveCliModel, resolveModelScope, } from "./core/model-resolver.js";
|
|
36
37
|
import { ModelRuntime } from "./core/model-runtime.js";
|
|
38
|
+
import { captureModelSelectionIntent } from "./core/model-selection-intent.js";
|
|
37
39
|
import { flushRawStdout, restoreStdout, takeOverStdout, writeRawStdout } from "./core/output-guard.js";
|
|
38
40
|
import { resolveProjectTrusted } from "./core/project-trust.js";
|
|
41
|
+
import { failureOutcome, RunFailure } from "./core/run-outcome.js";
|
|
42
|
+
import { preflightModel } from "./core/run-preflight.js";
|
|
39
43
|
import { formatMissingSessionCwdPrompt, getMissingSessionCwdIssue, MissingSessionCwdError, } from "./core/session-cwd.js";
|
|
40
44
|
import { assertValidSessionId, SessionManager } from "./core/session-manager.js";
|
|
41
45
|
import { collectSettingsDiagnostics, deduplicateDiagnostics } from "./core/settings-diagnostics.js";
|
|
@@ -48,18 +52,25 @@ import { builtInExtensions, createAgentMonitorFactory, createAutoSessionNamerFac
|
|
|
48
52
|
import { loadMcpCommand } from "./extensions/mcp/cli.lazy.js";
|
|
49
53
|
import { HUMAIN_GATEWAY_PROVIDER } from "./humain/gateway/constants.js";
|
|
50
54
|
import { revokeGatewayOrphans, shouldReconcileGatewayOnStartup } from "./humain/gateway/provider.js";
|
|
55
|
+
import { resolveHcodeEnvironment } from "./humain/hcode/environment.js";
|
|
56
|
+
import { HCODE_PROVIDER } from "./humain/hcode/http.js";
|
|
51
57
|
import { getHumainBundledExtensionFactories, getHumainDefaultPackageSources, HUMAIN_FORGE_CWD_ENV, } from "./humain/index.js";
|
|
52
58
|
import { HUMAIN_NODE_PROVIDER } from "./humain/node-provider.js";
|
|
53
59
|
import { ensureOmniRouteReady, isOmniRouteEnabled, OMNIROUTE_HINT } from "./humain/omniroute.js";
|
|
54
60
|
import { createAdmittedPiAgentExecutionHost } from "./humain/pi-agent-execution-host.js";
|
|
55
61
|
import { initializeFlowChildBootstrap } from "./humain/trace-capture/child-launch.js";
|
|
56
62
|
import { runMigrations, showDeprecationWarnings } from "./migrations.js";
|
|
57
|
-
import { AgentExecInputError,
|
|
63
|
+
import { AgentExecInputError, runAgentExecMode } from "./modes/agent-exec-mode.js";
|
|
64
|
+
import { loadInteractiveMode } from "./modes/interactive/interactive-mode.lazy.js";
|
|
65
|
+
import { refreshStartupModelCatalogs } from "./modes/interactive/model-catalog-refresh.js";
|
|
58
66
|
import { initTheme, setThemeJsonValidator, stopThemeWatcher } from "./modes/interactive/theme/theme.js";
|
|
59
67
|
import { validateThemeJson } from "./modes/interactive/theme/theme-schema.js";
|
|
68
|
+
import { runPrintMode } from "./modes/print-mode.js";
|
|
69
|
+
import { runRpcMode } from "./modes/rpc/rpc-mode.js";
|
|
60
70
|
import { cleanupManagedInstall, handleConfigCommand, handlePackageCommand } from "./package-manager-cli.js";
|
|
61
71
|
import { isLocalPath, normalizePath, resolvePath } from "./utils/paths.js";
|
|
62
72
|
import { cleanupWindowsSelfUpdateQuarantine } from "./utils/windows-self-update.js";
|
|
73
|
+
export { stripStartupEnvArgs } from "./cli/args.js";
|
|
63
74
|
const EXTENSION_LOAD_FAILURE_HINT = `Hint: Start without extensions using "${APP_COMMAND} -ne".`;
|
|
64
75
|
const HUMAIN_DEFAULT_CWD_ENV = "HUMAIN_TERMINAL_DEFAULT_CWD";
|
|
65
76
|
/**
|
|
@@ -90,6 +101,19 @@ function reportDiagnostics(diagnostics) {
|
|
|
90
101
|
console.error(color(`${prefix}${diagnostic.message}`));
|
|
91
102
|
}
|
|
92
103
|
}
|
|
104
|
+
async function reportRunFailure(mode, error) {
|
|
105
|
+
const outcome = failureOutcome(error);
|
|
106
|
+
const line = `${JSON.stringify(outcome)}\n`;
|
|
107
|
+
if (mode === "json" || mode === "rpc") {
|
|
108
|
+
writeRawStdout(line);
|
|
109
|
+
await flushRawStdout();
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
// Agent-exec reserves stdout for its single correlated response.
|
|
113
|
+
process.stderr.write(line);
|
|
114
|
+
}
|
|
115
|
+
return outcome.exitCode;
|
|
116
|
+
}
|
|
93
117
|
function isTruthyEnvFlag(value) {
|
|
94
118
|
if (!value)
|
|
95
119
|
return false;
|
|
@@ -116,7 +140,7 @@ function toPrintOutputMode(appMode) {
|
|
|
116
140
|
function isPlainRuntimeMetadataCommand(parsed) {
|
|
117
141
|
return !parsed.print && parsed.mode === undefined && (parsed.help === true || parsed.listModels !== undefined);
|
|
118
142
|
}
|
|
119
|
-
async function runAuthCommand(args) {
|
|
143
|
+
async function runAuthCommand(args, environment) {
|
|
120
144
|
if (isAuthCommandHelp(args)) {
|
|
121
145
|
printAuthCommandHelp();
|
|
122
146
|
return true;
|
|
@@ -147,7 +171,7 @@ async function runAuthCommand(args) {
|
|
|
147
171
|
}
|
|
148
172
|
if (command.kind !== "check") {
|
|
149
173
|
const signal = AbortSignal.timeout(15_000);
|
|
150
|
-
const modelRuntime = await ModelRuntime.create({ allowModelNetwork: false, signal });
|
|
174
|
+
const modelRuntime = await ModelRuntime.create({ allowModelNetwork: false, signal, hcode: { environment } });
|
|
151
175
|
const credential = await resolveCredentialForPrint(parsed, modelRuntime, command.kind, command.minExpiryMs, signal);
|
|
152
176
|
process.stdout.write(`${credential}\n`);
|
|
153
177
|
return true;
|
|
@@ -157,10 +181,10 @@ async function runAuthCommand(args) {
|
|
|
157
181
|
let credential;
|
|
158
182
|
try {
|
|
159
183
|
const credentials = command.noRefresh ? new ReadOnlyAuthStorage() : AuthStorage.create();
|
|
160
|
-
const modelRuntime = await createAuthCheckModelRuntime(credentials);
|
|
184
|
+
const modelRuntime = await createAuthCheckModelRuntime(credentials, environment);
|
|
161
185
|
result = await checkProviderAuth(parsed, modelRuntime, { refresh: !command.noRefresh });
|
|
162
186
|
if (command.credentials && result.status === "ready") {
|
|
163
|
-
credential = await getProviderCredential(result.provider, modelRuntime,
|
|
187
|
+
credential = await getProviderCredential(result.provider, modelRuntime, {
|
|
164
188
|
refresh: !command.noRefresh,
|
|
165
189
|
});
|
|
166
190
|
if (!credential) {
|
|
@@ -188,12 +212,11 @@ async function runAuthCommand(args) {
|
|
|
188
212
|
}
|
|
189
213
|
return true;
|
|
190
214
|
}
|
|
191
|
-
|
|
192
|
-
if (
|
|
215
|
+
function prepareInitialMessage(parsed, files, stdinContent) {
|
|
216
|
+
if (!files) {
|
|
193
217
|
return buildInitialMessage({ parsed, stdinContent });
|
|
194
218
|
}
|
|
195
|
-
|
|
196
|
-
const { text, images } = await processFileArguments(parsed.fileArgs, { autoResizeImages: false });
|
|
219
|
+
const { text, images } = files;
|
|
197
220
|
return buildInitialMessage({
|
|
198
221
|
parsed,
|
|
199
222
|
fileText: text,
|
|
@@ -347,6 +370,7 @@ export async function createSessionManager(parsed, cwd, sessionDir, settingsMana
|
|
|
347
370
|
}
|
|
348
371
|
if (parsed.resume) {
|
|
349
372
|
try {
|
|
373
|
+
const { selectSession } = await loadSessionPicker();
|
|
350
374
|
const selectedPath = await selectSession((onProgress, signal) => SessionManager.list(cwd, sessionDir, onProgress, signal), (onProgress, signal) => SessionManager.listAll(sessionDir, onProgress, signal), settingsManager);
|
|
351
375
|
if (!selectedPath) {
|
|
352
376
|
console.log(chalk.dim("No session selected"));
|
|
@@ -371,7 +395,7 @@ export async function createSessionManager(parsed, cwd, sessionDir, settingsMana
|
|
|
371
395
|
return SessionManager.create(cwd, sessionDir, { id: parsed.sessionId });
|
|
372
396
|
}
|
|
373
397
|
function buildSessionOptions(parsed, scopedModels, hasExistingSession, modelRuntime, settingsManager) {
|
|
374
|
-
const options = {};
|
|
398
|
+
const options = { timeLimitSeconds: parsed.timeLimitSeconds };
|
|
375
399
|
const diagnostics = [];
|
|
376
400
|
let cliThinkingFromModel = false;
|
|
377
401
|
// Model from CLI
|
|
@@ -407,7 +431,12 @@ function buildSessionOptions(parsed, scopedModels, hasExistingSession, modelRunt
|
|
|
407
431
|
}
|
|
408
432
|
}
|
|
409
433
|
}
|
|
410
|
-
if (!options.model &&
|
|
434
|
+
if (!options.model &&
|
|
435
|
+
scopedModels.length > 0 &&
|
|
436
|
+
!hasExistingSession &&
|
|
437
|
+
(parsed.models !== undefined ||
|
|
438
|
+
(settingsManager.getDefaultProvider() !== HCODE_PROVIDER &&
|
|
439
|
+
!isRetiredHumainProvider(settingsManager.getDefaultProvider())))) {
|
|
411
440
|
// Check if saved default is in scoped models - use it if so, otherwise first scoped model
|
|
412
441
|
const savedProvider = settingsManager.getDefaultProvider();
|
|
413
442
|
const savedModelId = settingsManager.getDefaultModel();
|
|
@@ -462,6 +491,7 @@ function resolveCliPaths(cwd, paths) {
|
|
|
462
491
|
return paths?.map((value) => (isLocalPath(value) ? resolvePath(value, cwd) : value));
|
|
463
492
|
}
|
|
464
493
|
async function promptForMissingSessionCwd(issue, settingsManager) {
|
|
494
|
+
const { showStartupSelector } = await loadStartupUi();
|
|
465
495
|
return showStartupSelector(settingsManager, formatMissingSessionCwdPrompt(issue), [
|
|
466
496
|
{ label: "Continue", value: issue.fallbackCwd },
|
|
467
497
|
{ label: "Cancel", value: undefined },
|
|
@@ -480,6 +510,19 @@ export function resolveStartupCwd(parsed, env, currentCwd) {
|
|
|
480
510
|
return resolvedCwd;
|
|
481
511
|
}
|
|
482
512
|
export async function main(args, options) {
|
|
513
|
+
const parsed = parseArgs(args);
|
|
514
|
+
const rawIntent = parsed.model || parsed.provider
|
|
515
|
+
? { kind: "chosen", source: "cli" }
|
|
516
|
+
: parsed.models !== undefined
|
|
517
|
+
? { kind: "chosen", source: "scope" }
|
|
518
|
+
: undefined;
|
|
519
|
+
const environmentError = parsed.diagnostics.find((diagnostic) => diagnostic.message === "Invalid --env. Choose dev, staging, or production.");
|
|
520
|
+
if (environmentError) {
|
|
521
|
+
reportDiagnostics([environmentError]);
|
|
522
|
+
process.exit(1);
|
|
523
|
+
return;
|
|
524
|
+
}
|
|
525
|
+
const environment = resolveHcodeEnvironment(parsed.environment);
|
|
483
526
|
// Credential intake removes env literals before trace command diagnostics can snapshot them.
|
|
484
527
|
const traceErrorSecrets = getTraceEnvSecrets(process.env);
|
|
485
528
|
// Must run before extension loading, package commands or any subprocess creation.
|
|
@@ -487,36 +530,38 @@ export async function main(args, options) {
|
|
|
487
530
|
takeTraceIngestCredentials(process.env);
|
|
488
531
|
// Hidden internal command: the detached coordination broker, re-executed by ensureBroker().
|
|
489
532
|
if (args[0] === COORDINATION_BROKER_COMMAND) {
|
|
533
|
+
const { runCoordinationBrokerCommand } = await loadCoordinationBrokerCommand();
|
|
490
534
|
process.exitCode = await runCoordinationBrokerCommand(args.slice(1), process.env);
|
|
491
535
|
return;
|
|
492
536
|
}
|
|
493
537
|
// Hidden internal command: the detached agent monitor, re-executed by defaultMonitorConnection().
|
|
494
538
|
if (args[0] === AGENT_MONITOR_COMMAND) {
|
|
539
|
+
const { runAgentMonitorCommand } = await loadAgentMonitorCommand();
|
|
495
540
|
process.exitCode = await runAgentMonitorCommand(process.env);
|
|
496
541
|
return;
|
|
497
542
|
}
|
|
498
543
|
resetTimings();
|
|
499
544
|
// Commands and startup selectors can load user-authored themes before runtime creation.
|
|
500
545
|
setThemeJsonValidator(validateThemeJson);
|
|
501
|
-
const
|
|
502
|
-
const commandArgs = stripStartupCwdArgs(args);
|
|
546
|
+
const commandArgs = stripStartupCwdArgs(stripStartupEnvArgs(args));
|
|
503
547
|
// Append the auto-session-namer once we have a SettingsManager below.
|
|
504
548
|
let extensionFactories = [
|
|
505
549
|
...builtInExtensions,
|
|
506
550
|
...getHumainBundledExtensionFactories(process.env),
|
|
507
551
|
...(options?.extensionFactories ?? []),
|
|
508
552
|
];
|
|
509
|
-
const offlineMode =
|
|
553
|
+
const offlineMode = parsed.offline || isTruthyEnvFlag(process.env[ENV_OFFLINE] ?? process.env.PI_OFFLINE);
|
|
510
554
|
if (offlineMode) {
|
|
511
555
|
process.env[ENV_OFFLINE] = "1";
|
|
512
556
|
process.env[ENV_SKIP_VERSION_CHECK] = "1";
|
|
513
557
|
process.env.PI_OFFLINE = "1";
|
|
514
558
|
process.env.PI_SKIP_VERSION_CHECK = "1";
|
|
515
559
|
}
|
|
516
|
-
if (await runAuthCommand(commandArgs)) {
|
|
560
|
+
if (await runAuthCommand(commandArgs, environment.id)) {
|
|
517
561
|
return;
|
|
518
562
|
}
|
|
519
563
|
if (commandArgs[0] === "trace") {
|
|
564
|
+
const { runTraceCommand } = await loadTraceCommand();
|
|
520
565
|
process.exitCode = await runTraceCommand(commandArgs.slice(1), { errorSecrets: traceErrorSecrets });
|
|
521
566
|
return;
|
|
522
567
|
}
|
|
@@ -619,6 +664,10 @@ export async function main(args, options) {
|
|
|
619
664
|
process.exit(0);
|
|
620
665
|
}
|
|
621
666
|
let appMode = resolveAppMode(parsed, process.stdin.isTTY, process.stdout.isTTY);
|
|
667
|
+
if (parsed.timeLimitSeconds !== undefined && (appMode === "interactive" || parsed.mode === "agent-exec")) {
|
|
668
|
+
console.error(chalk.red("Error: --time-limit is only supported in print, JSON and RPC modes"));
|
|
669
|
+
process.exit(1);
|
|
670
|
+
}
|
|
622
671
|
const isAgentExecMode = parsed.mode === "agent-exec";
|
|
623
672
|
const shouldTakeOverStdout = appMode !== "interactive" && !isPlainRuntimeMetadataCommand(parsed);
|
|
624
673
|
if (shouldTakeOverStdout) {
|
|
@@ -667,11 +716,20 @@ export async function main(args, options) {
|
|
|
667
716
|
}
|
|
668
717
|
const startupSettingsManager = SettingsManager.create(cwd, agentDir);
|
|
669
718
|
const startupSettingsDiagnostics = collectSettingsDiagnostics(startupSettingsManager);
|
|
670
|
-
// Experimental first-time setup: theme choice and
|
|
719
|
+
// Experimental first-time setup: theme choice and metadata disclosure.
|
|
671
720
|
// Runs before any runtime services are created so the chosen settings apply everywhere.
|
|
672
|
-
if (appMode === "interactive" && !parsed.help && parsed.listModels === undefined
|
|
673
|
-
await
|
|
674
|
-
|
|
721
|
+
if (appMode === "interactive" && !parsed.help && parsed.listModels === undefined) {
|
|
722
|
+
const { shouldRunFirstTimeSetup, showFirstTimeSetup } = await loadStartupUi();
|
|
723
|
+
if (shouldRunFirstTimeSetup()) {
|
|
724
|
+
await showFirstTimeSetup(startupSettingsManager, environment.origin);
|
|
725
|
+
time("firstTimeSetup");
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
if (appMode !== "interactive" && !parsed.help && parsed.listModels === undefined) {
|
|
729
|
+
await showNonInteractiveMetadataDisclosure(startupSettingsManager, environment.origin, (text) => {
|
|
730
|
+
// Complete the write or throw inside the locked notice, rather than emitting a later stream error.
|
|
731
|
+
writeFileSync(process.stderr.fd, text, "utf8");
|
|
732
|
+
});
|
|
675
733
|
}
|
|
676
734
|
if (appMode === "interactive" && parsed.useTheme !== undefined) {
|
|
677
735
|
startupSettingsManager.applyOverrides({ theme: parsed.useTheme });
|
|
@@ -736,6 +794,7 @@ export async function main(args, options) {
|
|
|
736
794
|
cwd,
|
|
737
795
|
agentDir,
|
|
738
796
|
settingsManager: runtimeSettingsManager,
|
|
797
|
+
hcodeEnvironment: environment.id,
|
|
739
798
|
modelRuntimeSignal: AbortSignal.timeout(15_000),
|
|
740
799
|
extensionFlagValues: parsed.unknownFlags,
|
|
741
800
|
resourceLoaderReloadOptions: shouldResolveProjectTrust
|
|
@@ -818,11 +877,22 @@ export async function main(args, options) {
|
|
|
818
877
|
diagnostics.push({ type: "warning", message: "HUMAIN model discovery timed out" });
|
|
819
878
|
}
|
|
820
879
|
}
|
|
880
|
+
captureModelSelectionIntent(sessionManager, rawIntent ??
|
|
881
|
+
(sessionManager
|
|
882
|
+
.getBranch()
|
|
883
|
+
.some((entry) => entry.type === "model_change" || (entry.type === "message" && entry.message.role === "assistant"))
|
|
884
|
+
? { kind: "chosen", source: "session" }
|
|
885
|
+
: settingsManager.getDefaultProvider() && settingsManager.getDefaultModel()
|
|
886
|
+
? { kind: "chosen", source: "default" }
|
|
887
|
+
: settingsManager.getEnabledModels()?.length
|
|
888
|
+
? { kind: "chosen", source: "scope" }
|
|
889
|
+
: { kind: "fresh" }));
|
|
821
890
|
const modelPatterns = parsed.models ?? settingsManager.getEnabledModels();
|
|
822
891
|
const scopedModels = modelPatterns && modelPatterns.length > 0
|
|
823
892
|
? await resolveModelScope(modelPatterns, modelRuntime, { signal: AbortSignal.timeout(15_000) })
|
|
824
893
|
: [];
|
|
825
|
-
const { options: sessionOptions, cliThinkingFromModel, diagnostics: sessionOptionDiagnostics, } = buildSessionOptions(parsed, scopedModels, sessionManager.buildSessionContext().messages.length > 0
|
|
894
|
+
const { options: sessionOptions, cliThinkingFromModel, diagnostics: sessionOptionDiagnostics, } = buildSessionOptions(parsed, scopedModels, sessionManager.buildSessionContext().messages.length > 0 ||
|
|
895
|
+
sessionManager.getBranch().some((entry) => entry.type === "model_change"), modelRuntime, settingsManager);
|
|
826
896
|
diagnostics.push(...sessionOptionDiagnostics);
|
|
827
897
|
if (parsed.apiKey) {
|
|
828
898
|
if (!sessionOptions.model) {
|
|
@@ -846,6 +916,7 @@ export async function main(args, options) {
|
|
|
846
916
|
excludeTools: sessionOptions.excludeTools,
|
|
847
917
|
noTools: sessionOptions.noTools,
|
|
848
918
|
customTools: sessionOptions.customTools,
|
|
919
|
+
timeLimitSeconds: sessionOptions.timeLimitSeconds,
|
|
849
920
|
});
|
|
850
921
|
const cliThinkingOverride = parsed.thinking !== undefined || cliThinkingFromModel;
|
|
851
922
|
if (created.session.model && cliThinkingOverride) {
|
|
@@ -858,181 +929,219 @@ export async function main(args, options) {
|
|
|
858
929
|
};
|
|
859
930
|
};
|
|
860
931
|
time("createRuntime");
|
|
932
|
+
// File processing can hard-exit; validate attachments before creating owned account lifetimes.
|
|
933
|
+
// AgentSession resizes these after extension hooks select the request model.
|
|
934
|
+
const initialFiles = !parsed.help && parsed.listModels === undefined && parsed.fileArgs.length > 0
|
|
935
|
+
? await processFileArguments(parsed.fileArgs, { autoResizeImages: false })
|
|
936
|
+
: undefined;
|
|
861
937
|
const runtime = await createAgentSessionRuntime(createRuntime, {
|
|
862
938
|
cwd: sessionManager.getCwd(),
|
|
863
939
|
agentDir,
|
|
864
940
|
sessionManager,
|
|
941
|
+
}).catch(async (error) => {
|
|
942
|
+
if (appMode === "interactive" || parsed.help || parsed.listModels !== undefined)
|
|
943
|
+
throw error;
|
|
944
|
+
const exitCode = await reportRunFailure(isAgentExecMode ? "agent-exec" : appMode, new RunFailure("setup", "Runtime setup failed"));
|
|
945
|
+
restoreStdout();
|
|
946
|
+
process.exit(exitCode);
|
|
865
947
|
});
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
948
|
+
let forceExit;
|
|
949
|
+
try {
|
|
950
|
+
time("createAgentSessionRuntime");
|
|
951
|
+
const { services, session, modelFallbackMessage } = runtime;
|
|
952
|
+
const { settingsManager, modelRuntime, resourceLoader } = services;
|
|
953
|
+
setCapabilityOverrides(settingsManager.getTerminalCapabilityOverrides());
|
|
954
|
+
applyHttpProxySettings(settingsManager.getGlobalSettings().httpProxy);
|
|
955
|
+
configureHttpDispatcher(settingsManager.getHttpIdleTimeoutMs());
|
|
956
|
+
const startupDiagnostics = deduplicateDiagnostics([...startupSettingsDiagnostics, ...runtime.diagnostics]);
|
|
957
|
+
const hasRuntimeErrors = runtime.diagnostics.some((diagnostic) => diagnostic.type === "error");
|
|
958
|
+
if (parsed.help) {
|
|
959
|
+
reportDiagnostics(startupDiagnostics);
|
|
960
|
+
const extensionFlags = resourceLoader
|
|
961
|
+
.getExtensions()
|
|
962
|
+
.extensions.flatMap((extension) => Array.from(extension.flags.values()));
|
|
963
|
+
printHelp(extensionFlags);
|
|
964
|
+
forceExit = 0;
|
|
965
|
+
return;
|
|
966
|
+
}
|
|
967
|
+
if (parsed.listModels !== undefined) {
|
|
968
|
+
reportDiagnostics(startupDiagnostics);
|
|
969
|
+
const searchPattern = typeof parsed.listModels === "string" ? parsed.listModels : undefined;
|
|
970
|
+
await listModels(modelRuntime, searchPattern, AbortSignal.timeout(15_000));
|
|
971
|
+
forceExit = 0;
|
|
972
|
+
return;
|
|
973
|
+
}
|
|
974
|
+
if (isAgentExecMode) {
|
|
975
|
+
reportDiagnostics(runtime.diagnostics);
|
|
976
|
+
if (runtime.diagnostics.some((diagnostic) => diagnostic.type === "error")) {
|
|
977
|
+
if (runtime.diagnostics.some((diagnostic) => diagnostic.message.includes("Failed to load extension"))) {
|
|
978
|
+
console.error(chalk.yellow(EXTENSION_LOAD_FAILURE_HINT));
|
|
979
|
+
}
|
|
980
|
+
forceExit = await reportRunFailure("agent-exec", new RunFailure("setup", "Runtime setup failed"));
|
|
981
|
+
return;
|
|
982
|
+
}
|
|
983
|
+
const controller = new AbortController();
|
|
984
|
+
const onSigterm = () => controller.abort();
|
|
985
|
+
process.on("SIGTERM", onSigterm);
|
|
986
|
+
let exitCode = 0;
|
|
987
|
+
let preflightComplete = false;
|
|
988
|
+
try {
|
|
989
|
+
await session.preflightRun(preflightModel, controller.signal);
|
|
990
|
+
preflightComplete = true;
|
|
991
|
+
const host = createAdmittedPiAgentExecutionHost({
|
|
992
|
+
cwd: runtime.cwd,
|
|
993
|
+
agentDir: services.agentDir,
|
|
994
|
+
model: session.model,
|
|
995
|
+
thinkingLevel: session.thinkingLevel,
|
|
996
|
+
baseSessionOptions: { modelRuntime, resourceLoader, settingsManager },
|
|
997
|
+
});
|
|
998
|
+
await runAgentExecMode({
|
|
999
|
+
input: process.stdin,
|
|
1000
|
+
host,
|
|
1001
|
+
signal: controller.signal,
|
|
1002
|
+
writeLine: async (line) => {
|
|
1003
|
+
writeRawStdout(`${line}\n`);
|
|
1004
|
+
await flushRawStdout();
|
|
1005
|
+
},
|
|
1006
|
+
});
|
|
1007
|
+
}
|
|
1008
|
+
catch (error) {
|
|
1009
|
+
if (!preflightComplete && !controller.signal.aborted) {
|
|
1010
|
+
exitCode = await reportRunFailure("agent-exec", error);
|
|
1011
|
+
}
|
|
1012
|
+
else {
|
|
1013
|
+
exitCode = controller.signal.aborted ? 143 : 1;
|
|
1014
|
+
const message = error instanceof AgentExecInputError
|
|
1015
|
+
? error.message
|
|
1016
|
+
: error instanceof Error
|
|
1017
|
+
? error.message
|
|
1018
|
+
: "agent-exec failed";
|
|
1019
|
+
console.error(chalk.red(`Error: ${message}`));
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
finally {
|
|
1023
|
+
process.off("SIGTERM", onSigterm);
|
|
1024
|
+
}
|
|
1025
|
+
if (exitCode !== 0)
|
|
1026
|
+
process.exitCode = exitCode;
|
|
1027
|
+
return;
|
|
1028
|
+
}
|
|
1029
|
+
// Read piped stdin content (if any) - skip for RPC mode which uses stdin for JSON-RPC
|
|
1030
|
+
let stdinContent;
|
|
1031
|
+
if (appMode !== "rpc") {
|
|
1032
|
+
stdinContent = await readPipedStdin();
|
|
1033
|
+
if (stdinContent !== undefined && appMode === "interactive") {
|
|
1034
|
+
appMode = "print";
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
time("readPipedStdin");
|
|
1038
|
+
const { initialMessage, initialImages } = prepareInitialMessage(parsed, initialFiles, stdinContent);
|
|
1039
|
+
time("prepareInitialMessage");
|
|
1040
|
+
initTheme(settingsManager.getTheme(), appMode === "interactive");
|
|
1041
|
+
time("initTheme");
|
|
1042
|
+
// Show deprecation warnings in interactive mode
|
|
1043
|
+
if (appMode === "interactive" && deprecationWarnings.length > 0) {
|
|
1044
|
+
await showDeprecationWarnings(deprecationWarnings);
|
|
1045
|
+
}
|
|
1046
|
+
time("resolveModelScope");
|
|
1047
|
+
if (appMode !== "interactive" || hasRuntimeErrors) {
|
|
1048
|
+
reportDiagnostics(startupDiagnostics);
|
|
1049
|
+
}
|
|
1050
|
+
if (hasRuntimeErrors) {
|
|
891
1051
|
if (runtime.diagnostics.some((diagnostic) => diagnostic.message.includes("Failed to load extension"))) {
|
|
892
1052
|
console.error(chalk.yellow(EXTENSION_LOAD_FAILURE_HINT));
|
|
893
1053
|
}
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
1054
|
+
forceExit =
|
|
1055
|
+
appMode === "interactive"
|
|
1056
|
+
? 1
|
|
1057
|
+
: await reportRunFailure(appMode, new RunFailure("setup", "Runtime setup failed"));
|
|
1058
|
+
return;
|
|
897
1059
|
}
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
const host = createAdmittedPiAgentExecutionHost({
|
|
904
|
-
cwd: runtime.cwd,
|
|
905
|
-
agentDir: services.agentDir,
|
|
906
|
-
model: session.model,
|
|
907
|
-
thinkingLevel: session.thinkingLevel,
|
|
908
|
-
baseSessionOptions: { modelRuntime, resourceLoader, settingsManager },
|
|
909
|
-
});
|
|
910
|
-
await runAgentExecMode({
|
|
911
|
-
input: process.stdin,
|
|
912
|
-
host,
|
|
913
|
-
signal: controller.signal,
|
|
914
|
-
writeLine: async (line) => {
|
|
915
|
-
writeRawStdout(`${line}\n`);
|
|
916
|
-
await flushRawStdout();
|
|
917
|
-
},
|
|
918
|
-
});
|
|
1060
|
+
time("createAgentSession");
|
|
1061
|
+
if (appMode !== "interactive" && (!session.model || session.model.provider === "unknown")) {
|
|
1062
|
+
console.error(chalk.red(modelFallbackMessage ?? formatNoModelsAvailableMessage()));
|
|
1063
|
+
forceExit = await reportRunFailure(appMode, new RunFailure("setup", "No model selected"));
|
|
1064
|
+
return;
|
|
919
1065
|
}
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
? error.message
|
|
926
|
-
: "agent-exec failed";
|
|
927
|
-
console.error(chalk.red(`Error: ${message}`));
|
|
1066
|
+
const startupBenchmark = isTruthyEnvFlag(process.env[ENV_STARTUP_BENCHMARK] ?? process.env.PI_STARTUP_BENCHMARK);
|
|
1067
|
+
if (startupBenchmark && appMode !== "interactive") {
|
|
1068
|
+
console.error(chalk.red(`Error: ${ENV_STARTUP_BENCHMARK} only supports interactive mode`));
|
|
1069
|
+
forceExit = 1;
|
|
1070
|
+
return;
|
|
928
1071
|
}
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
1072
|
+
// RPC refreshes catalogs here in the background; interactive mode starts its refresh after TUI initialization.
|
|
1073
|
+
if (!offlineMode && appMode === "rpc") {
|
|
1074
|
+
const controller = new AbortController();
|
|
1075
|
+
const timeout = setTimeout(() => controller.abort(), 15_000);
|
|
1076
|
+
void refreshStartupModelCatalogs(modelRuntime, controller.signal)
|
|
1077
|
+
.catch(() => { })
|
|
1078
|
+
.finally(() => clearTimeout(timeout));
|
|
934
1079
|
}
|
|
935
|
-
if (
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
}
|
|
939
|
-
// Read piped stdin content (if any) - skip for RPC mode which uses stdin for JSON-RPC
|
|
940
|
-
let stdinContent;
|
|
941
|
-
if (appMode !== "rpc") {
|
|
942
|
-
stdinContent = await readPipedStdin();
|
|
943
|
-
if (stdinContent !== undefined && appMode === "interactive") {
|
|
944
|
-
appMode = "print";
|
|
1080
|
+
if (appMode === "rpc") {
|
|
1081
|
+
printTimings();
|
|
1082
|
+
await runRpcMode(runtime);
|
|
945
1083
|
}
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
1084
|
+
else if (appMode === "interactive") {
|
|
1085
|
+
const { InteractiveMode } = await loadInteractiveMode();
|
|
1086
|
+
const interactiveMode = new InteractiveMode(runtime, {
|
|
1087
|
+
migratedProviders,
|
|
1088
|
+
startupDiagnostics,
|
|
1089
|
+
modelFallbackMessage,
|
|
1090
|
+
autoTrustOnReloadCwd,
|
|
1091
|
+
initialMessage,
|
|
1092
|
+
initialImages,
|
|
1093
|
+
initialMessages: parsed.messages,
|
|
1094
|
+
verbose: parsed.verbose,
|
|
1095
|
+
tuiMode: parsed.tuiMode,
|
|
1096
|
+
initialThemeSetting: parsed.useTheme,
|
|
1097
|
+
});
|
|
1098
|
+
if (startupBenchmark) {
|
|
1099
|
+
await interactiveMode.init();
|
|
1100
|
+
time("interactiveMode.init");
|
|
1101
|
+
process.send?.("startup-ready");
|
|
1102
|
+
// Give the TUI's stdin handler a brief chance to consume terminal query replies
|
|
1103
|
+
// (Kitty keyboard protocol, device attributes, cell size) before restoring the terminal.
|
|
1104
|
+
await new Promise((resolve) => setTimeout(resolve, 150));
|
|
1105
|
+
interactiveMode.stop();
|
|
1106
|
+
await runtime.dispose();
|
|
1107
|
+
stopThemeWatcher();
|
|
1108
|
+
printTimings();
|
|
1109
|
+
if (process.stdout.writableLength > 0) {
|
|
1110
|
+
await new Promise((resolve) => process.stdout.once("drain", resolve));
|
|
1111
|
+
}
|
|
1112
|
+
if (process.stderr.writableLength > 0) {
|
|
1113
|
+
await new Promise((resolve) => process.stderr.once("drain", resolve));
|
|
1114
|
+
}
|
|
1115
|
+
return;
|
|
1116
|
+
}
|
|
1117
|
+
printTimings();
|
|
1118
|
+
await interactiveMode.run();
|
|
963
1119
|
}
|
|
964
|
-
|
|
965
|
-
}
|
|
966
|
-
time("createAgentSession");
|
|
967
|
-
if (appMode !== "interactive" && !session.model) {
|
|
968
|
-
console.error(chalk.red(formatNoModelsAvailableMessage()));
|
|
969
|
-
process.exit(1);
|
|
970
|
-
}
|
|
971
|
-
const startupBenchmark = isTruthyEnvFlag(process.env[ENV_STARTUP_BENCHMARK] ?? process.env.PI_STARTUP_BENCHMARK);
|
|
972
|
-
if (startupBenchmark && appMode !== "interactive") {
|
|
973
|
-
console.error(chalk.red(`Error: ${ENV_STARTUP_BENCHMARK} only supports interactive mode`));
|
|
974
|
-
process.exit(1);
|
|
975
|
-
}
|
|
976
|
-
// RPC refreshes catalogs here in the background; interactive mode starts its refresh after TUI initialization.
|
|
977
|
-
if (!offlineMode && appMode === "rpc") {
|
|
978
|
-
const controller = new AbortController();
|
|
979
|
-
const timeout = setTimeout(() => controller.abort(), 15_000);
|
|
980
|
-
void modelRuntime
|
|
981
|
-
.refresh({ signal: controller.signal })
|
|
982
|
-
.catch(() => { })
|
|
983
|
-
.finally(() => clearTimeout(timeout));
|
|
984
|
-
}
|
|
985
|
-
if (appMode === "rpc") {
|
|
986
|
-
printTimings();
|
|
987
|
-
await runRpcMode(runtime);
|
|
988
|
-
}
|
|
989
|
-
else if (appMode === "interactive") {
|
|
990
|
-
const interactiveMode = new InteractiveMode(runtime, {
|
|
991
|
-
migratedProviders,
|
|
992
|
-
startupDiagnostics,
|
|
993
|
-
modelFallbackMessage,
|
|
994
|
-
autoTrustOnReloadCwd,
|
|
995
|
-
initialMessage,
|
|
996
|
-
initialImages,
|
|
997
|
-
initialMessages: parsed.messages,
|
|
998
|
-
verbose: parsed.verbose,
|
|
999
|
-
tuiMode: parsed.tuiMode,
|
|
1000
|
-
initialThemeSetting: parsed.useTheme,
|
|
1001
|
-
});
|
|
1002
|
-
if (startupBenchmark) {
|
|
1003
|
-
await interactiveMode.init();
|
|
1004
|
-
time("interactiveMode.init");
|
|
1005
|
-
// Give the TUI's stdin handler a brief chance to consume terminal query replies
|
|
1006
|
-
// (Kitty keyboard protocol, device attributes, cell size) before restoring the terminal.
|
|
1007
|
-
await new Promise((resolve) => setTimeout(resolve, 150));
|
|
1008
|
-
interactiveMode.stop();
|
|
1009
|
-
stopThemeWatcher();
|
|
1120
|
+
else {
|
|
1010
1121
|
printTimings();
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1122
|
+
const exitCode = await runPrintMode(runtime, {
|
|
1123
|
+
mode: toPrintOutputMode(appMode),
|
|
1124
|
+
messages: parsed.messages,
|
|
1125
|
+
initialMessage,
|
|
1126
|
+
initialImages,
|
|
1127
|
+
initialFileTexts: initialFiles?.texts,
|
|
1128
|
+
expandPromptTemplates: parsed.literalPrompt ? false : undefined,
|
|
1129
|
+
});
|
|
1130
|
+
stopThemeWatcher();
|
|
1131
|
+
if (exitCode !== 0) {
|
|
1132
|
+
process.exitCode = exitCode;
|
|
1016
1133
|
}
|
|
1017
1134
|
return;
|
|
1018
1135
|
}
|
|
1019
|
-
printTimings();
|
|
1020
|
-
await interactiveMode.run();
|
|
1021
1136
|
}
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
initialMessage,
|
|
1028
|
-
initialImages,
|
|
1029
|
-
});
|
|
1030
|
-
stopThemeWatcher();
|
|
1031
|
-
restoreStdout();
|
|
1032
|
-
if (exitCode !== 0) {
|
|
1033
|
-
process.exitCode = exitCode;
|
|
1137
|
+
finally {
|
|
1138
|
+
await runtime.dispose();
|
|
1139
|
+
if (shouldTakeOverStdout) {
|
|
1140
|
+
await flushRawStdout();
|
|
1141
|
+
restoreStdout();
|
|
1034
1142
|
}
|
|
1035
|
-
|
|
1143
|
+
if (forceExit !== undefined)
|
|
1144
|
+
process.exit(forceExit);
|
|
1036
1145
|
}
|
|
1037
1146
|
}
|
|
1038
1147
|
//# sourceMappingURL=main.js.map
|