@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
|
@@ -5,13 +5,15 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import * as fs from "node:fs";
|
|
7
7
|
import * as path from "node:path";
|
|
8
|
+
import { Agent } from "@earendil-works/pi-agent-core";
|
|
9
|
+
import { getSupportedThinkingLevels } from "@earendil-works/pi-ai";
|
|
8
10
|
import { isRetryableAssistantError, } from "@earendil-works/pi-ai/compat";
|
|
9
11
|
import * as TuiLayouts from "@earendil-works/pi-tui";
|
|
10
12
|
import { CombinedAutocompleteProvider, Container, fuzzyFilter, getCapabilities, hyperlink, Markdown, matchesKey, onCapabilitiesChange, Spacer, setCapabilityOverrides, setKeybindings, Text, TruncatedText, TuiAltScreen, TuiMainScreen, visibleWidth, } from "@earendil-works/pi-tui";
|
|
11
13
|
import chalk from "chalk";
|
|
12
14
|
import { spawn } from "child_process";
|
|
13
15
|
import { trackUserWait } from "../../agent-monitor/user-wait.js";
|
|
14
|
-
import { APP_COMMAND, APP_TITLE, CONFIG_DIR_NAME, detectInstallChange, ENV_OFFLINE, getAgentDir, getAuthPath, getChangelogUrl, getDebugLogPath, getDocsPath,
|
|
16
|
+
import { APP_COMMAND, APP_TITLE, CONFIG_DIR_NAME, detectInstallChange, ENV_OFFLINE, getAgentDir, getAuthPath, getChangelogUrl, getDebugLogPath, getDocsPath, VERSION, } from "../../config.js";
|
|
15
17
|
import { formatAccountUsageReport } from "../../core/account-reporting.js";
|
|
16
18
|
import { parseSkillBlock } from "../../core/agent-session.js";
|
|
17
19
|
import { SessionImportFileNotFoundError } from "../../core/agent-session-runtime.js";
|
|
@@ -28,6 +30,7 @@ import { KeybindingsManager } from "../../core/keybindings.js";
|
|
|
28
30
|
import { createCompactionSummaryMessage, createCustomMessage } from "../../core/messages.js";
|
|
29
31
|
import { defaultModelPerProvider, findExactModelReferenceMatch, resolveModelScopeFromModels, } from "../../core/model-resolver.js";
|
|
30
32
|
import { CredentialSynchronizationError } from "../../core/model-runtime.js";
|
|
33
|
+
import { getModelSelectionIntent } from "../../core/model-selection-intent.js";
|
|
31
34
|
import { getOAuthAccountRemovalSuccessor } from "../../core/oauth-account-pool.js";
|
|
32
35
|
import { DefaultPackageManager } from "../../core/package-manager.js";
|
|
33
36
|
import { RADIUS_MCP_URL, RADIUS_PROVIDER_ID, writeRadiusMcpServer } from "../../core/radius.js";
|
|
@@ -45,15 +48,20 @@ import { resolveAdhdSessionMode } from "../../humain/adhd/index.js";
|
|
|
45
48
|
import { renderHumainCodeIcon } from "../../humain/brand-logo.js";
|
|
46
49
|
import { CAVEMAN_LEVELS, getCavemanDefaultMode, resolveCavemanSessionMode } from "../../humain/caveman/index.js";
|
|
47
50
|
import { bindFlowAccountsHost, createFlowAccountReporter, FLOW_ACCOUNT_PERSISTENCE_NOTICE, flowUsageTargets, formatFlowAccountAdvanced, listFlowAccountMetadata, nodeLabelContainsStoredKey, readFlowNodeFallbackState, refreshFlowCatalog, updateFlowNodeFallback, } from "../../humain/flow-accounts-host.js";
|
|
51
|
+
import { HUMAIN_FUSE_PROVIDER } from "../../humain/fuse-provider.js";
|
|
52
|
+
import { HCODE_SESSION_ONLY_NOTICE } from "../../humain/hcode/account.js";
|
|
53
|
+
import { HCODE_PROVIDER } from "../../humain/hcode/http.js";
|
|
54
|
+
import { HCODE_LOGIN_LABEL } from "../../humain/hcode/provider.js";
|
|
55
|
+
import { assertHcodeSelection, captureHcodeSelection, HCODE_SELECTION_CHANGED_MESSAGE, HCODE_UNSUPPORTED_THINKING_MESSAGE, } from "../../humain/hcode/selection.js";
|
|
48
56
|
import { ACCOUNT_LOGIN_LABEL, API_KEY_LOGIN_LABEL, HUMAIN_LOGIN_LABEL, HUMAIN_SHIMMER_COLORS, humainLoginProviders, topLevelLoginOptions, } from "../../humain/login-menu.js";
|
|
49
57
|
import { RUNTIME_MODES, readDefaultMode, resolveSessionMode as resolvePonytailSessionMode, } from "../../humain/ponytail/index.js";
|
|
58
|
+
import { raceWithAbortSignal } from "../../utils/abort.js";
|
|
50
59
|
import { getChangelogPath, getNewEntries, normalizeChangelogLinks, parseChangelog } from "../../utils/changelog.js";
|
|
51
60
|
import { copyToClipboard, readClipboardFilePaths, readClipboardText } from "../../utils/clipboard.js";
|
|
52
61
|
import { readClipboardImage, writePastedImage } from "../../utils/clipboard-image.js";
|
|
53
62
|
import { parseGitUrl } from "../../utils/git.js";
|
|
54
63
|
import { ensurePngTranscoderOnFirstUse } from "../../utils/image-convert.js";
|
|
55
64
|
import { getCwdRelativePath, shortenHomePath } from "../../utils/paths.js";
|
|
56
|
-
import { getPiUserAgent } from "../../utils/pi-user-agent.js";
|
|
57
65
|
import { killTrackedDetachedChildren, killTrackedDetachedChildrenAsync } from "../../utils/shell.js";
|
|
58
66
|
import { loadAllHighlightLanguagesOnDemand } from "../../utils/syntax-highlight.js";
|
|
59
67
|
import { stripBom } from "../../utils/text.js";
|
|
@@ -80,14 +88,14 @@ import { FooterComponent, formatTokens } from "./components/footer.js";
|
|
|
80
88
|
import { formatKeyText, keyDisplayText, keyHint, keyText, rawKeyHint } from "./components/keybinding-hints.js";
|
|
81
89
|
import { LoginDialogComponent } from "./components/login-dialog.js";
|
|
82
90
|
import { createMermaidMarkdownTransformer } from "./components/mermaid.js";
|
|
83
|
-
import { ModelSelectorComponent, modelSelectionStatus } from "./components/model-selector.js";
|
|
91
|
+
import { ModelSelectorComponent, modelSelectionStatus, } from "./components/model-selector.js";
|
|
84
92
|
import { formatAuthSelectorProviderType, OAuthSelectorComponent, } from "./components/oauth-selector.js";
|
|
85
93
|
import { createLoginMenuSelector } from "./components/radius-login-selector.js";
|
|
86
94
|
import { ScopedModelsSelectorComponent } from "./components/scoped-models-selector.js";
|
|
87
95
|
import { SessionSelectorComponent } from "./components/session-selector.js";
|
|
88
96
|
import { SettingsSelectorComponent } from "./components/settings-selector.js";
|
|
89
97
|
import { SkillInvocationMessageComponent } from "./components/skill-invocation-message.js";
|
|
90
|
-
import { BranchSummaryStatusIndicator, CompactionStatusIndicator, IdleStatus, RetryStatusIndicator, WorkingStatusIndicator, } from "./components/status-indicator.js";
|
|
98
|
+
import { AdaptiveStatusIndicator, BranchSummaryStatusIndicator, CompactionStatusIndicator, IdleStatus, RetryStatusIndicator, WorkingStatusIndicator, } from "./components/status-indicator.js";
|
|
91
99
|
import { ThemedText } from "./components/themed-text.js";
|
|
92
100
|
import { ThinkingSelectorComponent } from "./components/thinking-selector.js";
|
|
93
101
|
import { ToolExecutionComponent } from "./components/tool-execution.js";
|
|
@@ -97,7 +105,7 @@ import { TrustSelectorComponent } from "./components/trust-selector.js";
|
|
|
97
105
|
import { UserMessageComponent } from "./components/user-message.js";
|
|
98
106
|
import { UserMessageSelectorComponent } from "./components/user-message-selector.js";
|
|
99
107
|
import { editInExternalEditor } from "./external-editor.js";
|
|
100
|
-
import { refreshModelCatalogs } from "./model-catalog-refresh.js";
|
|
108
|
+
import { refreshModelCatalogs, refreshStartupModelCatalogs } from "./model-catalog-refresh.js";
|
|
101
109
|
import { getModelSearchText } from "./model-search.js";
|
|
102
110
|
import { formatOAuthAccountOption, formatOAuthAccountResetTime, } from "./oauth-account-format.js";
|
|
103
111
|
import { ProgramStatusReporter } from "./program-status-reporter.js";
|
|
@@ -240,6 +248,7 @@ function formatLoginProviderCompletionDescription(provider) {
|
|
|
240
248
|
return provider.name === provider.id ? authTypes : `${provider.name} · ${authTypes}`;
|
|
241
249
|
}
|
|
242
250
|
export class InteractiveMode {
|
|
251
|
+
extensionOverlays = new Map();
|
|
243
252
|
runtimeHost;
|
|
244
253
|
renderer;
|
|
245
254
|
ui;
|
|
@@ -272,6 +281,7 @@ export class InteractiveMode {
|
|
|
272
281
|
onInputCallback;
|
|
273
282
|
pendingUserInputs = [];
|
|
274
283
|
activeStatusIndicator = undefined;
|
|
284
|
+
adaptiveStatus;
|
|
275
285
|
activeWorkingIndicatorEmbedded = false;
|
|
276
286
|
idleStatus = new IdleStatus();
|
|
277
287
|
workingMessage = undefined;
|
|
@@ -892,7 +902,7 @@ export class InteractiveMode {
|
|
|
892
902
|
if (!(process.env[ENV_OFFLINE] || process.env.PI_OFFLINE)) {
|
|
893
903
|
const controller = new AbortController();
|
|
894
904
|
const timeout = setTimeout(() => controller.abort(), 15_000);
|
|
895
|
-
void
|
|
905
|
+
void refreshStartupModelCatalogs(this.session.modelRuntime, controller.signal)
|
|
896
906
|
.then(() => this.updateAvailableProviderCount())
|
|
897
907
|
.catch(() => { })
|
|
898
908
|
.finally(() => clearTimeout(timeout));
|
|
@@ -976,10 +986,20 @@ export class InteractiveMode {
|
|
|
976
986
|
// Main interactive loop
|
|
977
987
|
while (true) {
|
|
978
988
|
const userInput = await this.getUserInput();
|
|
989
|
+
const session = this.session;
|
|
990
|
+
const messages = session.messages;
|
|
979
991
|
try {
|
|
980
|
-
await
|
|
992
|
+
await session.prompt(userInput);
|
|
981
993
|
}
|
|
982
994
|
catch (error) {
|
|
995
|
+
const current = session.messages;
|
|
996
|
+
if (this.session === session &&
|
|
997
|
+
messages.every((message, index) => current[index] === message) &&
|
|
998
|
+
!current.slice(messages.length).some((message) => message.role === "user")) {
|
|
999
|
+
const draft = this.editor.getText();
|
|
1000
|
+
if (draft !== userInput)
|
|
1001
|
+
this.editor.setText([userInput, draft].filter(Boolean).join("\n\n"));
|
|
1002
|
+
}
|
|
983
1003
|
const errorMessage = error instanceof Error ? error.message : "Unknown error occurred";
|
|
984
1004
|
this.showError(errorMessage);
|
|
985
1005
|
}
|
|
@@ -1128,14 +1148,7 @@ export class InteractiveMode {
|
|
|
1128
1148
|
if (!isInstallTelemetryEnabled(this.settingsManager)) {
|
|
1129
1149
|
return;
|
|
1130
1150
|
}
|
|
1131
|
-
|
|
1132
|
-
headers: {
|
|
1133
|
-
"User-Agent": getPiUserAgent(version),
|
|
1134
|
-
},
|
|
1135
|
-
signal: AbortSignal.timeout(5000),
|
|
1136
|
-
})
|
|
1137
|
-
.then(() => undefined)
|
|
1138
|
-
.catch(() => undefined);
|
|
1151
|
+
this.session.modelRuntime.observeHcodeVersion(version);
|
|
1139
1152
|
}
|
|
1140
1153
|
getMarkdownThemeWithSettings() {
|
|
1141
1154
|
return {
|
|
@@ -1753,7 +1766,12 @@ export class InteractiveMode {
|
|
|
1753
1766
|
}
|
|
1754
1767
|
stopThemeWatcher();
|
|
1755
1768
|
this.stop("transcript");
|
|
1756
|
-
|
|
1769
|
+
try {
|
|
1770
|
+
await this.runtimeHost.dispose();
|
|
1771
|
+
}
|
|
1772
|
+
finally {
|
|
1773
|
+
process.exit(1);
|
|
1774
|
+
}
|
|
1757
1775
|
}
|
|
1758
1776
|
getCrashExtensionHint(error) {
|
|
1759
1777
|
try {
|
|
@@ -1825,6 +1843,7 @@ export class InteractiveMode {
|
|
|
1825
1843
|
this.loadedResourcesContainer.clear();
|
|
1826
1844
|
this.chatContainer.clear();
|
|
1827
1845
|
this.pendingMessagesContainer.clear();
|
|
1846
|
+
this.pendingBashComponents = [];
|
|
1828
1847
|
this.compactionQueuedMessages = [];
|
|
1829
1848
|
this.streamingComponent = undefined;
|
|
1830
1849
|
this.streamingMessage = undefined;
|
|
@@ -1911,7 +1930,8 @@ export class InteractiveMode {
|
|
|
1911
1930
|
}
|
|
1912
1931
|
setEditorWorkingStatusIndicator(indicator) {
|
|
1913
1932
|
this.defaultEditor.setWorkingStatusIndicator(undefined);
|
|
1914
|
-
|
|
1933
|
+
// Keep adaptive status separate from the editor border so its detail shortcut stays visible.
|
|
1934
|
+
if (indicator instanceof AdaptiveStatusIndicator || !isEmbeddedStatus(this.editor))
|
|
1915
1935
|
return false;
|
|
1916
1936
|
this.editor.setWorkingStatusIndicator(indicator);
|
|
1917
1937
|
return true;
|
|
@@ -1947,6 +1967,16 @@ export class InteractiveMode {
|
|
|
1947
1967
|
}
|
|
1948
1968
|
}
|
|
1949
1969
|
showWorkingStatusIndicator() {
|
|
1970
|
+
if (this.adaptiveStatus) {
|
|
1971
|
+
if (this.activeStatusIndicator instanceof AdaptiveStatusIndicator) {
|
|
1972
|
+
this.activeStatusIndicator.setStatus(this.adaptiveStatus);
|
|
1973
|
+
return;
|
|
1974
|
+
}
|
|
1975
|
+
const indicator = new AdaptiveStatusIndicator(this.ui, this.adaptiveStatus, () => this.setToolsExpanded(false), this.workingIndicatorOptions);
|
|
1976
|
+
this.showStatusIndicator(indicator);
|
|
1977
|
+
indicator.setExpanded(this.toolOutputExpanded);
|
|
1978
|
+
return;
|
|
1979
|
+
}
|
|
1950
1980
|
const colorFn = isEmbeddedStatus(this.editor)
|
|
1951
1981
|
? (text) => (this.editor.borderColor ?? theme.getThinkingBorderColor(this.session.thinkingLevel || "off"))(text)
|
|
1952
1982
|
: undefined;
|
|
@@ -1959,7 +1989,7 @@ export class InteractiveMode {
|
|
|
1959
1989
|
this.ui.requestRender();
|
|
1960
1990
|
return;
|
|
1961
1991
|
}
|
|
1962
|
-
if (this.session.isStreaming && this.activeStatusIndicator?.kind !== "working") {
|
|
1992
|
+
if ((this.session.isStreaming || this.adaptiveStatus) && this.activeStatusIndicator?.kind !== "working") {
|
|
1963
1993
|
this.showWorkingStatusIndicator();
|
|
1964
1994
|
}
|
|
1965
1995
|
this.ui.requestRender();
|
|
@@ -2032,12 +2062,19 @@ export class InteractiveMode {
|
|
|
2032
2062
|
this.renderWidgets();
|
|
2033
2063
|
}
|
|
2034
2064
|
resetExtensionUI() {
|
|
2065
|
+
this.adaptiveStatus = undefined;
|
|
2066
|
+
if (this.activeStatusIndicator instanceof AdaptiveStatusIndicator)
|
|
2067
|
+
this.clearStatusIndicator();
|
|
2068
|
+
this.disposeActiveSelector();
|
|
2035
2069
|
// Release first: aborting resolves pending account dialogs before their UI is hidden.
|
|
2036
2070
|
this.releaseFlowAccountsHost();
|
|
2037
2071
|
if (this.extensionDialogs.length > 0) {
|
|
2038
2072
|
this.closeExtensionDialogs();
|
|
2039
2073
|
}
|
|
2040
|
-
|
|
2074
|
+
// Reload and session switches replace every extension without calling done(): remove their overlays,
|
|
2075
|
+
// newest first, the same way done() does, but leave the promises pending as for inline dialogs.
|
|
2076
|
+
for (const removeOverlay of [...this.extensionOverlays.values()].reverse())
|
|
2077
|
+
removeOverlay();
|
|
2041
2078
|
this.clearExtensionTerminalInputListeners();
|
|
2042
2079
|
this.setExtensionFooter(undefined);
|
|
2043
2080
|
this.setExtensionHeader(undefined);
|
|
@@ -2194,7 +2231,8 @@ export class InteractiveMode {
|
|
|
2194
2231
|
setStatus: (key, text) => this.setExtensionStatus(key, text),
|
|
2195
2232
|
setWorkingMessage: (message) => {
|
|
2196
2233
|
this.workingMessage = message;
|
|
2197
|
-
if (this.activeStatusIndicator?.kind === "working"
|
|
2234
|
+
if (this.activeStatusIndicator?.kind === "working" &&
|
|
2235
|
+
!(this.activeStatusIndicator instanceof AdaptiveStatusIndicator)) {
|
|
2198
2236
|
this.activeStatusIndicator.setMessage(message ?? this.defaultWorkingMessage);
|
|
2199
2237
|
}
|
|
2200
2238
|
},
|
|
@@ -2360,7 +2398,7 @@ export class InteractiveMode {
|
|
|
2360
2398
|
setCustomEditorComponent(factory) {
|
|
2361
2399
|
this.editorComponentFactory = factory;
|
|
2362
2400
|
// Save text from current editor before switching
|
|
2363
|
-
const currentText = this.editor.getText();
|
|
2401
|
+
const currentText = this.editor.getExpandedText?.() ?? this.editor.getText();
|
|
2364
2402
|
// An open extension dialog keeps the editor slot; the new editor is shown when the last dialog closes.
|
|
2365
2403
|
const dialogOpen = this.extensionDialogs.length > 0;
|
|
2366
2404
|
if (!dialogOpen) {
|
|
@@ -2448,7 +2486,7 @@ export class InteractiveMode {
|
|
|
2448
2486
|
}
|
|
2449
2487
|
/** Show a custom component with keyboard focus. Overlay mode renders on top of existing content. */
|
|
2450
2488
|
async showExtensionCustom(factory, options) {
|
|
2451
|
-
const savedText = this.editor.getText();
|
|
2489
|
+
const savedText = this.editor.getExpandedText?.() ?? this.editor.getText();
|
|
2452
2490
|
const isOverlay = options?.overlay ?? false;
|
|
2453
2491
|
return new Promise((resolve, reject) => {
|
|
2454
2492
|
let component;
|
|
@@ -2460,17 +2498,7 @@ export class InteractiveMode {
|
|
|
2460
2498
|
this.editor.setText(savedText);
|
|
2461
2499
|
this.ui.requestRender();
|
|
2462
2500
|
};
|
|
2463
|
-
const
|
|
2464
|
-
if (closed)
|
|
2465
|
-
return;
|
|
2466
|
-
closed = true;
|
|
2467
|
-
// Remove this overlay, not the topmost one: another overlay may have opened above it.
|
|
2468
|
-
if (isOverlay)
|
|
2469
|
-
overlayHandle?.hide();
|
|
2470
|
-
else
|
|
2471
|
-
restoreEditor();
|
|
2472
|
-
// Note: both branches above already call requestRender
|
|
2473
|
-
resolve(result);
|
|
2501
|
+
const disposeComponent = () => {
|
|
2474
2502
|
try {
|
|
2475
2503
|
component?.dispose?.();
|
|
2476
2504
|
}
|
|
@@ -2478,6 +2506,28 @@ export class InteractiveMode {
|
|
|
2478
2506
|
/* ignore dispose errors */
|
|
2479
2507
|
}
|
|
2480
2508
|
};
|
|
2509
|
+
// Shared by done() and resetExtensionUI(). Removing the map entry first makes a second call a no-op.
|
|
2510
|
+
const removeOverlay = () => {
|
|
2511
|
+
if (!overlayHandle || !this.extensionOverlays.delete(overlayHandle))
|
|
2512
|
+
return;
|
|
2513
|
+
// Remove this overlay, not the topmost one: another overlay may have opened above it.
|
|
2514
|
+
overlayHandle.hide();
|
|
2515
|
+
disposeComponent();
|
|
2516
|
+
};
|
|
2517
|
+
const close = (result) => {
|
|
2518
|
+
if (closed)
|
|
2519
|
+
return;
|
|
2520
|
+
closed = true;
|
|
2521
|
+
if (isOverlay) {
|
|
2522
|
+
removeOverlay();
|
|
2523
|
+
resolve(result);
|
|
2524
|
+
}
|
|
2525
|
+
else {
|
|
2526
|
+
restoreEditor();
|
|
2527
|
+
resolve(result);
|
|
2528
|
+
disposeComponent();
|
|
2529
|
+
}
|
|
2530
|
+
};
|
|
2481
2531
|
Promise.resolve(factory(this.ui, theme, this.keybindings, close))
|
|
2482
2532
|
.then((c) => {
|
|
2483
2533
|
if (closed)
|
|
@@ -2497,6 +2547,7 @@ export class InteractiveMode {
|
|
|
2497
2547
|
return w ? { width: w } : undefined;
|
|
2498
2548
|
};
|
|
2499
2549
|
overlayHandle = this.ui.showOverlay(c, resolveOptions());
|
|
2550
|
+
this.extensionOverlays.set(overlayHandle, removeOverlay);
|
|
2500
2551
|
// Expose handle to caller for visibility control
|
|
2501
2552
|
options?.onHandle?.(overlayHandle);
|
|
2502
2553
|
}
|
|
@@ -2854,7 +2905,15 @@ export class InteractiveMode {
|
|
|
2854
2905
|
if (this.session.isStreaming) {
|
|
2855
2906
|
this.editor.addToHistory?.(text);
|
|
2856
2907
|
this.editor.setText("");
|
|
2857
|
-
|
|
2908
|
+
try {
|
|
2909
|
+
await this.session.prompt(text, { streamingBehavior: "steer" });
|
|
2910
|
+
}
|
|
2911
|
+
catch (error) {
|
|
2912
|
+
const draft = this.editor.getText();
|
|
2913
|
+
if (draft !== text)
|
|
2914
|
+
this.editor.setText([text, draft].filter(Boolean).join("\n\n"));
|
|
2915
|
+
this.showError(error instanceof Error ? error.message : String(error));
|
|
2916
|
+
}
|
|
2858
2917
|
this.updatePendingMessagesDisplay();
|
|
2859
2918
|
this.ui.requestRender();
|
|
2860
2919
|
return;
|
|
@@ -2900,6 +2959,12 @@ export class InteractiveMode {
|
|
|
2900
2959
|
this.footer.markActivity();
|
|
2901
2960
|
}
|
|
2902
2961
|
switch (event.type) {
|
|
2962
|
+
case "adaptive_status":
|
|
2963
|
+
this.adaptiveStatus = event.status;
|
|
2964
|
+
if (this.workingVisible)
|
|
2965
|
+
this.showWorkingStatusIndicator();
|
|
2966
|
+
this.ui.requestRender();
|
|
2967
|
+
break;
|
|
2903
2968
|
case "agent_start":
|
|
2904
2969
|
this.pendingTools.clear();
|
|
2905
2970
|
// Restore main escape handler if retry handler is still active
|
|
@@ -3128,7 +3193,9 @@ export class InteractiveMode {
|
|
|
3128
3193
|
if (this.settingsManager.getShowTerminalProgress()) {
|
|
3129
3194
|
this.ui.terminal.setProgress(false);
|
|
3130
3195
|
}
|
|
3131
|
-
|
|
3196
|
+
// Primary agent_end precedes adaptive Check/review and is not run settlement.
|
|
3197
|
+
if (!this.adaptiveStatus)
|
|
3198
|
+
this.clearStatusIndicator("working");
|
|
3132
3199
|
if (this.streamingComponent) {
|
|
3133
3200
|
this.chatContainer.removeChild(this.streamingComponent);
|
|
3134
3201
|
this.streamingComponent = undefined;
|
|
@@ -3138,6 +3205,14 @@ export class InteractiveMode {
|
|
|
3138
3205
|
this.ui.requestRender();
|
|
3139
3206
|
break;
|
|
3140
3207
|
case "agent_settled":
|
|
3208
|
+
if (this.adaptiveStatus) {
|
|
3209
|
+
this.adaptiveStatus = undefined;
|
|
3210
|
+
this.workingMessage = undefined;
|
|
3211
|
+
this.clearStatusIndicator("working");
|
|
3212
|
+
}
|
|
3213
|
+
// The session records deferred user bash results when the run settles; show them there too.
|
|
3214
|
+
this.flushPendingBashComponents();
|
|
3215
|
+
this.ui.requestRender();
|
|
3141
3216
|
await this.checkShutdownRequested();
|
|
3142
3217
|
break;
|
|
3143
3218
|
case "compaction_start": {
|
|
@@ -3911,7 +3986,15 @@ export class InteractiveMode {
|
|
|
3911
3986
|
if (this.session.isStreaming) {
|
|
3912
3987
|
this.editor.addToHistory?.(text);
|
|
3913
3988
|
this.editor.setText("");
|
|
3914
|
-
|
|
3989
|
+
try {
|
|
3990
|
+
await this.session.prompt(text, { streamingBehavior: "followUp", expandPromptTemplates: false });
|
|
3991
|
+
}
|
|
3992
|
+
catch (error) {
|
|
3993
|
+
const draft = this.editor.getText();
|
|
3994
|
+
if (draft !== text)
|
|
3995
|
+
this.editor.setText([text, draft].filter(Boolean).join("\n\n"));
|
|
3996
|
+
this.showError(error instanceof Error ? error.message : String(error));
|
|
3997
|
+
}
|
|
3915
3998
|
this.updatePendingMessagesDisplay();
|
|
3916
3999
|
this.ui.requestRender();
|
|
3917
4000
|
}
|
|
@@ -3988,11 +4071,13 @@ export class InteractiveMode {
|
|
|
3988
4071
|
if (expanded === this.toolOutputExpanded)
|
|
3989
4072
|
return;
|
|
3990
4073
|
this.toolOutputExpanded = expanded;
|
|
4074
|
+
if (isExpandable(this.activeStatusIndicator))
|
|
4075
|
+
this.activeStatusIndicator.setExpanded(expanded);
|
|
3991
4076
|
const activeHeader = this.customHeader ?? this.builtInHeader;
|
|
3992
4077
|
if (isExpandable(activeHeader)) {
|
|
3993
4078
|
activeHeader.setExpanded(expanded);
|
|
3994
4079
|
}
|
|
3995
|
-
for (const container of [this.loadedResourcesContainer, this.chatContainer]) {
|
|
4080
|
+
for (const container of [this.loadedResourcesContainer, this.chatContainer, this.pendingMessagesContainer]) {
|
|
3996
4081
|
for (const child of container.children) {
|
|
3997
4082
|
if (isExpandable(child)) {
|
|
3998
4083
|
child.setExpanded(expanded);
|
|
@@ -4130,6 +4215,10 @@ export class InteractiveMode {
|
|
|
4130
4215
|
}
|
|
4131
4216
|
updatePendingMessagesDisplay() {
|
|
4132
4217
|
this.pendingMessagesContainer.clear();
|
|
4218
|
+
// User bash output shown while the agent works lives here until it moves to the chat.
|
|
4219
|
+
for (const component of this.pendingBashComponents) {
|
|
4220
|
+
this.pendingMessagesContainer.addChild(component);
|
|
4221
|
+
}
|
|
4133
4222
|
const { steering: steeringMessages, followUp: followUpMessages } = this.getAllQueuedMessages();
|
|
4134
4223
|
if (steeringMessages.length > 0 || followUpMessages.length > 0) {
|
|
4135
4224
|
this.pendingMessagesContainer.addChild(new Spacer(1));
|
|
@@ -4157,7 +4246,7 @@ export class InteractiveMode {
|
|
|
4157
4246
|
return 0;
|
|
4158
4247
|
}
|
|
4159
4248
|
const queuedText = allQueued.join("\n\n");
|
|
4160
|
-
const currentText = options?.currentText ?? this.editor.getText();
|
|
4249
|
+
const currentText = options?.currentText ?? this.editor.getExpandedText?.() ?? this.editor.getText();
|
|
4161
4250
|
const combinedText = [queuedText, currentText].filter((t) => t.trim()).join("\n\n");
|
|
4162
4251
|
this.editor.setText(combinedText);
|
|
4163
4252
|
this.updatePendingMessagesDisplay();
|
|
@@ -4596,7 +4685,10 @@ export class InteractiveMode {
|
|
|
4596
4685
|
const normalized = searchTerm.trim().toLowerCase();
|
|
4597
4686
|
const level = availableLevels.find((candidate) => candidate.toLowerCase() === normalized);
|
|
4598
4687
|
if (!level) {
|
|
4599
|
-
this.showError(
|
|
4688
|
+
this.showError(this.session.model?.provider === HCODE_PROVIDER &&
|
|
4689
|
+
THINKING_LEVEL_OPTIONS.some((level) => level === normalized)
|
|
4690
|
+
? HCODE_UNSUPPORTED_THINKING_MESSAGE
|
|
4691
|
+
: `Unknown thinking level "${searchTerm}". Available levels: ${availableLevels.join(", ")}.`);
|
|
4600
4692
|
return;
|
|
4601
4693
|
}
|
|
4602
4694
|
this.selectThinkingLevel(level, false);
|
|
@@ -4785,15 +4877,59 @@ export class InteractiveMode {
|
|
|
4785
4877
|
return { component: selector, focus: selector };
|
|
4786
4878
|
});
|
|
4787
4879
|
}
|
|
4788
|
-
showModelSelector(initialSearchInput) {
|
|
4880
|
+
showModelSelector(initialSearchInput, selectionContext = { kind: "all" }) {
|
|
4881
|
+
const session = this.session;
|
|
4789
4882
|
this.showSelector((done) => {
|
|
4883
|
+
const controller = new AbortController();
|
|
4884
|
+
let owner = "model";
|
|
4885
|
+
let finishSelection = done;
|
|
4886
|
+
const cancelSelection = () => {
|
|
4887
|
+
finishSelection();
|
|
4888
|
+
if (selectionContext.kind === "hcode" && this.session === session)
|
|
4889
|
+
this.showStatus(`Signed in to ${HCODE_LOGIN_LABEL}. No model selected. Use /model when you're ready.`);
|
|
4890
|
+
this.ui.requestRender();
|
|
4891
|
+
};
|
|
4790
4892
|
const selectModel = async (model, persist) => {
|
|
4791
4893
|
try {
|
|
4792
|
-
|
|
4894
|
+
const reference = model.provider === HCODE_PROVIDER ? captureHcodeSelection(session.modelRuntime, model) : undefined;
|
|
4895
|
+
let thinkingLevel = session.settingsManager.getModelThinkingLevel(model.provider, model.id) ??
|
|
4896
|
+
session.settingsManager.getDefaultThinkingLevel() ??
|
|
4897
|
+
session.thinkingLevel;
|
|
4898
|
+
const levels = getSupportedThinkingLevels(model);
|
|
4899
|
+
if (reference && !levels.includes(thinkingLevel)) {
|
|
4900
|
+
owner = "thinking";
|
|
4901
|
+
const chosen = await new Promise((resolve) => {
|
|
4902
|
+
this.showSelector((finish) => {
|
|
4903
|
+
finishSelection = finish;
|
|
4904
|
+
const selector = new ThinkingSelectorComponent(thinkingLevel, levels, (level) => resolve(level), () => {
|
|
4905
|
+
resolve(undefined);
|
|
4906
|
+
cancelSelection();
|
|
4907
|
+
});
|
|
4908
|
+
return {
|
|
4909
|
+
component: selector,
|
|
4910
|
+
focus: selector,
|
|
4911
|
+
dispose: () => {
|
|
4912
|
+
controller.abort();
|
|
4913
|
+
resolve(undefined);
|
|
4914
|
+
},
|
|
4915
|
+
};
|
|
4916
|
+
});
|
|
4917
|
+
});
|
|
4918
|
+
if (chosen === undefined || this.session !== session)
|
|
4919
|
+
return;
|
|
4920
|
+
thinkingLevel = chosen;
|
|
4921
|
+
}
|
|
4922
|
+
if (this.session !== session || controller.signal.aborted)
|
|
4923
|
+
return;
|
|
4924
|
+
if (reference)
|
|
4925
|
+
assertHcodeSelection(session.modelRuntime, model, reference);
|
|
4926
|
+
await session.setModel(model, { persist, thinkingLevel, signal: controller.signal });
|
|
4927
|
+
if (this.session !== session)
|
|
4928
|
+
return;
|
|
4793
4929
|
this.updateAvailableProviderCount();
|
|
4794
4930
|
this.footer.invalidate();
|
|
4795
4931
|
this.updateEditorBorderColor();
|
|
4796
|
-
|
|
4932
|
+
finishSelection();
|
|
4797
4933
|
const isDefault = this.settingsManager.getDefaultProvider() === model.provider &&
|
|
4798
4934
|
this.settingsManager.getDefaultModel() === model.id;
|
|
4799
4935
|
const showTip = !persist && !isDefault && !this.modelSaveTipShown;
|
|
@@ -4809,17 +4945,24 @@ export class InteractiveMode {
|
|
|
4809
4945
|
void this.maybeWarnAboutAnthropicSubscriptionAuth(model);
|
|
4810
4946
|
}
|
|
4811
4947
|
catch (error) {
|
|
4812
|
-
|
|
4948
|
+
if (controller.signal.aborted || this.session !== session)
|
|
4949
|
+
return;
|
|
4950
|
+
finishSelection();
|
|
4813
4951
|
this.showError(error instanceof Error ? error.message : String(error));
|
|
4814
4952
|
}
|
|
4815
4953
|
};
|
|
4816
4954
|
const defaultProvider = this.settingsManager.getDefaultProvider();
|
|
4817
4955
|
const defaultModel = this.settingsManager.getDefaultModel();
|
|
4818
|
-
const selector = new ModelSelectorComponent(this.ui, this.session.model, this.session.modelRuntime, this.session.scopedModels, (model) => selectModel(model, false), () => {
|
|
4819
|
-
|
|
4820
|
-
|
|
4821
|
-
|
|
4822
|
-
|
|
4956
|
+
const selector = new ModelSelectorComponent(this.ui, this.session.model, this.session.modelRuntime, this.session.scopedModels, (model) => selectModel(model, false), cancelSelection, initialSearchInput, (model) => selectModel(model, true), defaultProvider && defaultModel ? { provider: defaultProvider, id: defaultModel } : undefined, selectionContext);
|
|
4957
|
+
return {
|
|
4958
|
+
component: selector,
|
|
4959
|
+
focus: selector,
|
|
4960
|
+
dispose: () => {
|
|
4961
|
+
if (owner === "model")
|
|
4962
|
+
controller.abort();
|
|
4963
|
+
selector.dispose();
|
|
4964
|
+
},
|
|
4965
|
+
};
|
|
4823
4966
|
});
|
|
4824
4967
|
}
|
|
4825
4968
|
showModelsSelector() {
|
|
@@ -5192,6 +5335,7 @@ export class InteractiveMode {
|
|
|
5192
5335
|
options.push({
|
|
5193
5336
|
id: provider.id,
|
|
5194
5337
|
name: provider.name,
|
|
5338
|
+
authTypeLabel: provider.id === HCODE_PROVIDER ? "account" : undefined,
|
|
5195
5339
|
authType: "api_key",
|
|
5196
5340
|
method: provider.auth.apiKey,
|
|
5197
5341
|
status,
|
|
@@ -5828,6 +5972,25 @@ export class InteractiveMode {
|
|
|
5828
5972
|
}
|
|
5829
5973
|
/** `onBack` reopens the selector the login was started from when the user cancels it. */
|
|
5830
5974
|
async startProviderLogin(providerOption, onBack, accountKey) {
|
|
5975
|
+
if (providerOption.id === HCODE_PROVIDER) {
|
|
5976
|
+
const session = this.session;
|
|
5977
|
+
const controller = new AbortController();
|
|
5978
|
+
let close = () => { };
|
|
5979
|
+
this.showSelector((done) => {
|
|
5980
|
+
close = done;
|
|
5981
|
+
const selector = new ExtensionSelectorComponent(`Checking ${HCODE_LOGIN_LABEL} availability…`, ["Cancel"], () => done(), () => done());
|
|
5982
|
+
return { component: selector, focus: selector, dispose: () => controller.abort() };
|
|
5983
|
+
});
|
|
5984
|
+
const ready = await this.checkHcodeLogin(controller.signal);
|
|
5985
|
+
if (controller.signal.aborted || this.session !== session)
|
|
5986
|
+
return;
|
|
5987
|
+
close();
|
|
5988
|
+
this.ui.requestRender();
|
|
5989
|
+
if (!ready) {
|
|
5990
|
+
this.showStatus(`${HCODE_LOGIN_LABEL} is unavailable for this environment. Try /login again later.`);
|
|
5991
|
+
return;
|
|
5992
|
+
}
|
|
5993
|
+
}
|
|
5831
5994
|
if (providerOption.authType === "oauth") {
|
|
5832
5995
|
await this.showLoginDialog(providerOption.id, providerOption.name, onBack, accountKey);
|
|
5833
5996
|
}
|
|
@@ -5897,11 +6060,21 @@ export class InteractiveMode {
|
|
|
5897
6060
|
return { component: selector, focus: selector, dispose: () => selector.dispose() };
|
|
5898
6061
|
});
|
|
5899
6062
|
}
|
|
6063
|
+
async checkHcodeLogin(signal) {
|
|
6064
|
+
const bounded = AbortSignal.any([signal, AbortSignal.timeout(5000)]);
|
|
6065
|
+
try {
|
|
6066
|
+
return ((await raceWithAbortSignal(this.session.modelRuntime.probeHcodeLogin(bounded), bounded)).kind === "ready");
|
|
6067
|
+
}
|
|
6068
|
+
catch {
|
|
6069
|
+
return false;
|
|
6070
|
+
}
|
|
6071
|
+
}
|
|
5900
6072
|
showLoginProviderSelector(authType, initialSearchInput, humainOnly = false) {
|
|
5901
|
-
const
|
|
5902
|
-
|
|
5903
|
-
|
|
5904
|
-
|
|
6073
|
+
const session = this.session;
|
|
6074
|
+
const available = this.getLoginProviderOptions().filter((provider) => provider.id === HCODE_PROVIDER ? authType !== "api_key" : !authType || provider.authType === authType);
|
|
6075
|
+
const ordered = humainOnly ? humainLoginProviders(available) : available;
|
|
6076
|
+
let providerOptions = ordered.filter((provider) => provider.id !== HCODE_PROVIDER);
|
|
6077
|
+
if (ordered.length === 0) {
|
|
5905
6078
|
const message = humainOnly
|
|
5906
6079
|
? "No HUMAIN providers available."
|
|
5907
6080
|
: authType === "oauth"
|
|
@@ -5929,7 +6102,15 @@ export class InteractiveMode {
|
|
|
5929
6102
|
this.ui.requestRender();
|
|
5930
6103
|
}
|
|
5931
6104
|
}, initialSearchInput);
|
|
5932
|
-
|
|
6105
|
+
const controller = new AbortController();
|
|
6106
|
+
void this.checkHcodeLogin(controller.signal).then((ready) => {
|
|
6107
|
+
if (controller.signal.aborted || this.session !== session)
|
|
6108
|
+
return;
|
|
6109
|
+
providerOptions = ready ? ordered : ordered.filter((provider) => provider.id !== HCODE_PROVIDER);
|
|
6110
|
+
selector.setProviders(providerOptions);
|
|
6111
|
+
this.ui.requestRender();
|
|
6112
|
+
});
|
|
6113
|
+
return { component: selector, focus: selector, dispose: () => controller.abort() };
|
|
5933
6114
|
});
|
|
5934
6115
|
}
|
|
5935
6116
|
async showOAuthSelector(mode) {
|
|
@@ -5965,6 +6146,36 @@ export class InteractiveMode {
|
|
|
5965
6146
|
});
|
|
5966
6147
|
}
|
|
5967
6148
|
async completeProviderAuthentication(providerId, providerName, authType, previousModel) {
|
|
6149
|
+
if (providerId === HCODE_PROVIDER || providerId === HUMAIN_FUSE_PROVIDER) {
|
|
6150
|
+
const fresh = getModelSelectionIntent(this.session.sessionManager).kind === "fresh";
|
|
6151
|
+
if (providerId === HCODE_PROVIDER) {
|
|
6152
|
+
if (this.session.modelRuntime.getProviderAuthStatus(providerId).source === "runtime")
|
|
6153
|
+
this.showStatus(`Signed in to ${HCODE_LOGIN_LABEL} for this session only. Nothing from this sign-in was saved.`);
|
|
6154
|
+
this.showStatus(fresh
|
|
6155
|
+
? `Signed in to ${HCODE_LOGIN_LABEL}.`
|
|
6156
|
+
: `Signed in to ${HCODE_LOGIN_LABEL}. Your current model was kept. Use /model to choose a HUMAIN Code model.`);
|
|
6157
|
+
}
|
|
6158
|
+
else
|
|
6159
|
+
this.showStatus(`Saved API key for ${providerName}. Credentials saved to ${getAuthPath()}`);
|
|
6160
|
+
this.updateAvailableProviderCount();
|
|
6161
|
+
this.footer.invalidate();
|
|
6162
|
+
this.updateEditorBorderColor();
|
|
6163
|
+
if (providerId === HCODE_PROVIDER && fresh) {
|
|
6164
|
+
const runtime = this.session.modelRuntime;
|
|
6165
|
+
const reference = runtime.hcode.account.status(runtime.hcode.environment.id);
|
|
6166
|
+
if (!reference) {
|
|
6167
|
+
this.showStatus(HCODE_SELECTION_CHANGED_MESSAGE);
|
|
6168
|
+
return;
|
|
6169
|
+
}
|
|
6170
|
+
// Reuse Agent's unselected sentinel without resetting messages, tools or user history.
|
|
6171
|
+
this.session.agent.state.model = new Agent({ streamFn: this.session.agent.streamFunction }).state.model;
|
|
6172
|
+
this.showModelSelector(undefined, { kind: "hcode", reference });
|
|
6173
|
+
}
|
|
6174
|
+
else {
|
|
6175
|
+
await this.refreshLoginCatalog(providerId, providerName);
|
|
6176
|
+
}
|
|
6177
|
+
return;
|
|
6178
|
+
}
|
|
5968
6179
|
const actionLabel = authType === "oauth" ? `Logged in to ${providerName}` : `Saved API key for ${providerName}`;
|
|
5969
6180
|
const session = this.session;
|
|
5970
6181
|
// Dynamic catalogs may be empty until the first authenticated network refresh.
|
|
@@ -6058,6 +6269,45 @@ export class InteractiveMode {
|
|
|
6058
6269
|
})
|
|
6059
6270
|
.finally(() => clearTimeout(timeout));
|
|
6060
6271
|
}
|
|
6272
|
+
async refreshLoginCatalog(providerId, providerName) {
|
|
6273
|
+
const session = this.session;
|
|
6274
|
+
do {
|
|
6275
|
+
const controller = new AbortController();
|
|
6276
|
+
let close = () => { };
|
|
6277
|
+
this.showSelector((done) => {
|
|
6278
|
+
close = done;
|
|
6279
|
+
const selector = new ExtensionSelectorComponent(`Loading ${providerName} models…`, ["Cancel"], done, done);
|
|
6280
|
+
return { component: selector, focus: selector, dispose: () => controller.abort() };
|
|
6281
|
+
});
|
|
6282
|
+
const signal = AbortSignal.any([controller.signal, AbortSignal.timeout(15_000)]);
|
|
6283
|
+
let failed = false;
|
|
6284
|
+
try {
|
|
6285
|
+
const result = await raceWithAbortSignal(session.modelRuntime.refresh({ providers: [providerId], signal }), signal);
|
|
6286
|
+
failed = result.aborted || result.errors.size > 0;
|
|
6287
|
+
}
|
|
6288
|
+
catch {
|
|
6289
|
+
failed = true;
|
|
6290
|
+
}
|
|
6291
|
+
if (controller.signal.aborted || this.session !== session)
|
|
6292
|
+
return;
|
|
6293
|
+
close();
|
|
6294
|
+
this.ui.requestRender();
|
|
6295
|
+
this.updateAvailableProviderCount();
|
|
6296
|
+
this.footer.invalidate();
|
|
6297
|
+
if (!failed && session.modelRuntime.getAvailableSnapshot().some((model) => model.provider === providerId)) {
|
|
6298
|
+
if (providerId !== HCODE_PROVIDER)
|
|
6299
|
+
this.showStatus(`Use /model to select a ${providerName} model. Your current model was not changed.`);
|
|
6300
|
+
return;
|
|
6301
|
+
}
|
|
6302
|
+
const message = failed
|
|
6303
|
+
? "Couldn't load models."
|
|
6304
|
+
: providerId === HCODE_PROVIDER
|
|
6305
|
+
? "Your admin hasn't enabled CLI models yet."
|
|
6306
|
+
: "No HUMAIN Fuse models are available.";
|
|
6307
|
+
if ((await this.showExtensionSelector(message, ["Retry", "Cancel"])) !== "Retry")
|
|
6308
|
+
return;
|
|
6309
|
+
} while (this.session === session);
|
|
6310
|
+
}
|
|
6061
6311
|
showAmbientAuthDialog(providerOption, onBack, signal) {
|
|
6062
6312
|
const restoreEditor = () => {
|
|
6063
6313
|
this.editorContainer.clear();
|
|
@@ -6093,26 +6343,54 @@ export class InteractiveMode {
|
|
|
6093
6343
|
theme.fg("accent", ` ${path.join(getDocsPath(), "providers.md")}`),
|
|
6094
6344
|
]);
|
|
6095
6345
|
}
|
|
6096
|
-
this.
|
|
6097
|
-
|
|
6098
|
-
|
|
6099
|
-
|
|
6100
|
-
|
|
6346
|
+
const session = this.session;
|
|
6347
|
+
let current = true;
|
|
6348
|
+
let close = () => { };
|
|
6349
|
+
if (providerId === HCODE_PROVIDER) {
|
|
6350
|
+
this.showSelector((done) => {
|
|
6351
|
+
close = done;
|
|
6352
|
+
return {
|
|
6353
|
+
component: dialog,
|
|
6354
|
+
focus: dialog,
|
|
6355
|
+
dispose: () => {
|
|
6356
|
+
current = false;
|
|
6357
|
+
dialog.dismiss();
|
|
6358
|
+
},
|
|
6359
|
+
};
|
|
6360
|
+
});
|
|
6361
|
+
}
|
|
6362
|
+
else {
|
|
6101
6363
|
this.editorContainer.clear();
|
|
6102
|
-
this.editorContainer.addChild(
|
|
6103
|
-
this.ui.setFocus(
|
|
6364
|
+
this.editorContainer.addChild(dialog);
|
|
6365
|
+
this.ui.setFocus(dialog);
|
|
6366
|
+
this.ui.requestRender();
|
|
6367
|
+
}
|
|
6368
|
+
const restoreEditor = () => {
|
|
6369
|
+
if (providerId === HCODE_PROVIDER)
|
|
6370
|
+
close();
|
|
6371
|
+
else {
|
|
6372
|
+
this.editorContainer.clear();
|
|
6373
|
+
this.editorContainer.addChild(this.editor);
|
|
6374
|
+
this.ui.setFocus(this.editor);
|
|
6375
|
+
}
|
|
6104
6376
|
this.ui.requestRender();
|
|
6105
6377
|
};
|
|
6106
6378
|
try {
|
|
6107
6379
|
await this.loginProvider(dialog, providerId, providerName, "api_key", accountKey);
|
|
6380
|
+
if (!current || this.session !== session)
|
|
6381
|
+
return;
|
|
6108
6382
|
restoreEditor();
|
|
6109
6383
|
await this.completeProviderAuthentication(providerId, providerName, "api_key", previousModel);
|
|
6110
6384
|
}
|
|
6111
6385
|
catch (error) {
|
|
6386
|
+
if (!current || this.session !== session)
|
|
6387
|
+
return;
|
|
6112
6388
|
restoreEditor();
|
|
6113
6389
|
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
6114
6390
|
if (error instanceof CredentialSynchronizationError) {
|
|
6115
|
-
this.showError(
|
|
6391
|
+
this.showError(providerId === HCODE_PROVIDER
|
|
6392
|
+
? `Signed in to ${HCODE_LOGIN_LABEL}, but local model state could not be synchronized: ${errorMsg}`
|
|
6393
|
+
: `Saved API key for ${providerName}, but local model state could not be synchronized: ${errorMsg}`);
|
|
6116
6394
|
}
|
|
6117
6395
|
else if (errorMsg === "Login cancelled") {
|
|
6118
6396
|
onBack?.();
|
|
@@ -6121,7 +6399,9 @@ export class InteractiveMode {
|
|
|
6121
6399
|
this.showError(`Sign-in failed for ${providerName}: ${errorMsg}`);
|
|
6122
6400
|
}
|
|
6123
6401
|
else {
|
|
6124
|
-
this.showError(
|
|
6402
|
+
this.showError(providerId === HCODE_PROVIDER
|
|
6403
|
+
? `Sign-in failed for ${HCODE_LOGIN_LABEL}: ${errorMsg}`
|
|
6404
|
+
: `Failed to save API key for ${providerName}: ${errorMsg}`);
|
|
6125
6405
|
}
|
|
6126
6406
|
}
|
|
6127
6407
|
}
|
|
@@ -6137,14 +6417,20 @@ export class InteractiveMode {
|
|
|
6137
6417
|
const selector = new ExtensionSelectorComponent(prompt.message, labels, (optionLabel) => {
|
|
6138
6418
|
restoreDialog();
|
|
6139
6419
|
const id = prompt.options.find((option) => option.label === optionLabel)?.id;
|
|
6140
|
-
if (id)
|
|
6420
|
+
if (id && !(providerId === HCODE_PROVIDER && id === "cancel"))
|
|
6141
6421
|
resolve(id);
|
|
6142
6422
|
else
|
|
6143
6423
|
reject(new Error("Login cancelled"));
|
|
6144
6424
|
}, () => {
|
|
6145
6425
|
restoreDialog();
|
|
6146
6426
|
reject(new Error("Login cancelled"));
|
|
6147
|
-
}, {
|
|
6427
|
+
}, {
|
|
6428
|
+
description: providerId === RADIUS_PROVIDER_ID
|
|
6429
|
+
? RADIUS_LOGIN_INTRO
|
|
6430
|
+
: providerId === HCODE_PROVIDER && prompt.options.some((option) => option.id === "session")
|
|
6431
|
+
? HCODE_SESSION_ONLY_NOTICE
|
|
6432
|
+
: undefined,
|
|
6433
|
+
});
|
|
6148
6434
|
this.editorContainer.clear();
|
|
6149
6435
|
this.editorContainer.addChild(selector);
|
|
6150
6436
|
this.ui.setFocus(selector);
|
|
@@ -6746,7 +7032,7 @@ export class InteractiveMode {
|
|
|
6746
7032
|
| \`${cycleThinkingLevel}\` | Cycle thinking level |
|
|
6747
7033
|
| \`${cycleModelForward}\` / \`${cycleModelBackward}\` | Cycle models |
|
|
6748
7034
|
| \`${selectModel}\` | Open model selector |
|
|
6749
|
-
| \`${expandTools}\` | Toggle tool output expansion |
|
|
7035
|
+
| \`${expandTools}\` | Toggle tool output and adaptive criteria/evidence expansion |
|
|
6750
7036
|
| \`${toggleThinking}\` | Toggle thinking block visibility |
|
|
6751
7037
|
| \`${externalEditor}\` | Edit message in external editor |
|
|
6752
7038
|
| \`${copyMessage}\` | Copy selection or last assistant message |
|
|
@@ -6857,6 +7143,7 @@ export class InteractiveMode {
|
|
|
6857
7143
|
const result = eventResult.result;
|
|
6858
7144
|
// Create UI component for display
|
|
6859
7145
|
this.bashComponent = new BashExecutionComponent(command, this.ui, excludeFromContext, this.outputPad);
|
|
7146
|
+
this.bashComponent.setExpanded(this.toolOutputExpanded);
|
|
6860
7147
|
if (this.session.isStreaming) {
|
|
6861
7148
|
this.pendingMessagesContainer.addChild(this.bashComponent);
|
|
6862
7149
|
this.pendingBashComponents.push(this.bashComponent);
|
|
@@ -6878,6 +7165,7 @@ export class InteractiveMode {
|
|
|
6878
7165
|
// Normal execution path (possibly with custom operations)
|
|
6879
7166
|
const isDeferred = this.session.isStreaming;
|
|
6880
7167
|
this.bashComponent = new BashExecutionComponent(command, this.ui, excludeFromContext, this.outputPad);
|
|
7168
|
+
this.bashComponent.setExpanded(this.toolOutputExpanded);
|
|
6881
7169
|
if (isDeferred) {
|
|
6882
7170
|
// Show in pending area when agent is streaming
|
|
6883
7171
|
this.pendingMessagesContainer.addChild(this.bashComponent);
|