@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
|
@@ -13,7 +13,7 @@ unshift(parsed.file),parsed.command=shebang,resolveCommand2(parsed)):parsed.file
|
|
|
13
13
|
let shellCommand=[parsed.command].concat(parsed.args).join(" ");parsed.args=["/d","/s","/c",`"${shellCommand}"`],parsed.command=process.env.comspec||"cmd.exe",parsed.options.windowsVerbatimArguments=!0}return parsed}function parse(command,args,options){args&&!Array.isArray(args)&&(options=args,args=null),args=args?args.slice(0):[],options=Object.assign({},options);let parsed={command,args,options,file:void 0,original:{command,args}};return options.shell?parsed:parseNonShell(parsed)}module.exports=
|
|
14
14
|
parse}});var require_enoent=__commonJS({"node_modules/cross-spawn/lib/enoent.js"(exports,module){"use strict";var isWin=process.platform==="win32";function notFoundError(original,syscall){return Object.assign(new Error(`${syscall} ${original.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${syscall} ${original.command}`,path:original.command,spawnargs:original.args})}function hookChildProcess(cp,parsed){if(!isWin)return;let originalEmit=cp.emit;cp.emit=function(name,arg1){if(name==="exit"){let err=verifyENOENT(
|
|
15
15
|
arg1,parsed);if(err)return originalEmit.call(cp,"error",err)}return originalEmit.apply(cp,arguments)}}function verifyENOENT(status,parsed){return isWin&&status===1&&!parsed.file?notFoundError(parsed.original,"spawn"):null}function verifyENOENTSync(status,parsed){return isWin&&status===1&&!parsed.file?notFoundError(parsed.original,"spawnSync"):null}module.exports={hookChildProcess,verifyENOENT,verifyENOENTSync,notFoundError}}});var require_cross_spawn=__commonJS({"node_modules/cross-spawn/index.js"(exports,module){"use strict";var cp=__require("child_process"),parse=require_parse(),enoent=require_enoent();function spawn(command,args,options){let parsed=parse(command,args,options),spawned=cp.spawn(parsed.command,parsed.args,parsed.options);return enoent.hookChildProcess(spawned,parsed),spawned}function spawnSync(command,args,options){let parsed=parse(command,args,options),result=cp.spawnSync(parsed.command,parsed.args,parsed.
|
|
16
|
-
options);return result.error=result.error||enoent.verifyENOENTSync(result.status,parsed),result}module.exports=spawn;module.exports.spawn=spawn;module.exports.sync=spawnSync;module.exports._parse=parse;module.exports._enoent=enoent}});import{
|
|
16
|
+
options);return result.error=result.error||enoent.verifyENOENTSync(result.status,parsed),result}module.exports=spawn;module.exports.spawn=spawn;module.exports.sync=spawnSync;module.exports._parse=parse;module.exports._enoent=enoent}});import{realpathSync,statSync as statSync2}from"node:fs";import{homedir}from"node:os";import{isAbsolute as isAbsolute2,join as join2,resolve as nodeResolvePath,posix,relative,sep,win32}from"node:path";import{fileURLToPath as fileURLToPath2}from"node:url";var import_cross_spawn=__toESM(require_cross_spawn(),1),import_readShebang=__toESM(require_readShebang(),1),import_resolveCommand=__toESM(require_resolveCommand(),1);import{spawn as nodeSpawn,spawnSync as nodeSpawnSync}from"node:child_process";import{isAbsolute,join,resolve}from"node:path";import{fileURLToPath}from"node:url";import{lstatSync,statSync}from"node:fs";import{delimiter}from"node:path";function windowsPathDirectories(path){return path.split(delimiter).map(dir=>dir.trim().replace(/^"(.*)"$/,"$1")).filter(Boolean)}function isProgramFile(file){try{let stats=statSync(file,{throwIfNoEntry:!1});if(stats)return stats.isFile()}catch{}try{let link=lstatSync(file,{throwIfNoEntry:!1});return link!==void 0&&!link.isDirectory()}catch{return!1}}var EXIT_STDIO_GRACE_MS=100;function spawnProcess(command,args,options){if(process.platform!=="win32")return nodeSpawn(command,args,options);let invocation=resolveWindowsInvocation(command,args,options);return(0,import_cross_spawn.default)(invocation.command,invocation.args,options)}function spawnProcessSync(command,args,options){if(process.platform!=="win32")return nodeSpawnSync(command,args,options);let invocation=resolveWindowsInvocation(command,args,options);return import_cross_spawn.default.
|
|
17
17
|
sync(invocation.command,invocation.args,options)}function resolveWindowsInvocation(command,args,options){let file=resolveWindowsCommand(command,options.env);if(options.shell)return{command:file,args};let cwd=typeof options.cwd=="object"?fileURLToPath(options.cwd):options.cwd,visited=new Set;for(;;){file=resolve(cwd??"",file);let script=(0,import_resolveCommand.default)({command:file,options:{env:options.env}})??file,key=script.toLowerCase();if(visited.has(key)||visited.size===32)return{command:resolveWindowsCommand(
|
|
18
18
|
"shebang-chain",{PATH:""}),args};visited.add(key);let interpreter=(0,import_readShebang.default)(script);if(!interpreter)return{command:script,args};file=resolveWindowsCommand(interpreter,options.env),args=[script,...args]}}var resolvedWindowsCommands=new Map;function resolveWindowsCommand(command,env){if(/[\\/]/.test(command))return command;let source=env??process.env,pathKey="PATH"in source?"PATH":Object.keys(source).find(key2=>key2.toLowerCase()==="path"),pathValue=pathKey?source[pathKey]??"":
|
|
19
19
|
"",key=`${pathValue}\0${source.PATHEXT??""}\0${command}`,cached=resolvedWindowsCommands.get(key);if(cached&&isProgramFile(cached))return cached;resolvedWindowsCommands.delete(key);let dirs=windowsPathDirectories(pathValue).filter(dir=>isAbsolute(dir)),pathExtensions=(source.PATHEXT??".COM;.EXE;.BAT;.CMD").split(";").filter(Boolean),extensions=command.includes(".")?["",...pathExtensions]:pathExtensions;for(let dir of dirs)for(let extension of extensions){let file=join(dir,command+extension);if(isProgramFile(
|
|
@@ -21,14 +21,14 @@ file))return resolvedWindowsCommands.set(key,file),file}return join(process.env.
|
|
|
21
21
|
"error",onError),child.removeListener("exit",onExit),child.removeListener("close",onClose),child.stdout?.removeListener("end",onStdoutEnd),child.stderr?.removeListener("end",onStderrEnd),child.stdout?.removeListener("data",onData),child.stderr?.removeListener("data",onData),child.stdout?.removeListener("pause",onFlowChange),child.stderr?.removeListener("pause",onFlowChange),child.stdout?.removeListener("resume",onFlowChange),child.stderr?.removeListener("resume",onFlowChange)},finalize=code=>{settled||
|
|
22
22
|
(settled=!0,cleanup(),child.stdout?.destroy(),child.stderr?.destroy(),resolve3(code))},onDrainAbort=()=>finalize(child.exitCode),maybeFinalizeAfterExit=()=>{!exited||settled||stdoutEnded&&stderrEnded&&finalize(exitCode)},armIdleTimer=()=>{postExitTimer&&clearTimeout(postExitTimer),postExitTimer=void 0,!(!stdoutEnded&&child.stdout?.isPaused()||!stderrEnded&&child.stderr?.isPaused())&&(postExitTimer=setTimeout(()=>finalize(exitCode),EXIT_STDIO_GRACE_MS))},onFlowChange=()=>{exited&&!settled&&armIdleTimer()},
|
|
23
23
|
onData=()=>{exited&&!settled&&armIdleTimer()},onStdoutEnd=()=>{stdoutEnded=!0,maybeFinalizeAfterExit()},onStderrEnd=()=>{stderrEnded=!0,maybeFinalizeAfterExit()},onError=err=>{settled||(settled=!0,cleanup(),reject(err))},onExit=code=>{exited=!0,exitCode=code,maybeFinalizeAfterExit(),settled||armIdleTimer()},onClose=code=>{finalize(code)};child.stdout?.once("end",onStdoutEnd),child.stderr?.once("end",onStderrEnd),child.stdout?.on("data",onData),child.stderr?.on("data",onData),child.stdout?.on("pa\
|
|
24
|
-
use",onFlowChange),child.stderr?.on("pause",onFlowChange),child.stdout?.on("resume",onFlowChange),child.stderr?.on("resume",onFlowChange),child.once("error",onError),child.once("exit",onExit),child.once("close",onClose),drainSignal?.addEventListener("abort",onDrainAbort,{once:!0}),drainSignal?.aborted&&onDrainAbort()})}
|
|
24
|
+
use",onFlowChange),child.stderr?.on("pause",onFlowChange),child.stdout?.on("resume",onFlowChange),child.stderr?.on("resume",onFlowChange),child.once("error",onError),child.once("exit",onExit),child.once("close",onClose),drainSignal?.addEventListener("abort",onDrainAbort,{once:!0}),drainSignal?.aborted&&onDrainAbort()})}var UNICODE_SPACES=/[\u00A0\u2000-\u200A\u202F\u205F\u3000]/g;function canonicalizePath(path){try{return realpathSync(path)}catch{return path}}function getPathComparisonKey(path){let pathApi=getPlatformPathApi(),resolvedPath=pathApi.resolve(path);return pathApi===win32?resolvedPath.toLowerCase():resolvedPath}function getPlatformPathApi(){return process.platform==="win32"?win32:posix}function pathsEqual(left,right){return getPathComparisonKey(left)===getPathComparisonKey(right)}function isPathWithin(parent,child){
|
|
25
25
|
let parentKey=getPathComparisonKey(parent),childKey=getPathComparisonKey(child);if(childKey===parentKey)return!0;let pathSep=getPlatformPathApi().sep;return childKey.startsWith(parentKey.endsWith(pathSep)?parentKey:`${parentKey}${pathSep}`)}function shortenHomePath(path,homeDir=homedir()){let pathApi=getPlatformPathApi();if(!homeDir||!pathApi.isAbsolute(path)||!isPathWithin(homeDir,path))return path;let relativePath=pathApi.relative(homeDir,path);return relativePath?`~${pathApi.sep}${relativePath}`:
|
|
26
26
|
"~"}function getFileRevision(path){try{let stats=statSync2(path,{bigint:!0});return`${stats.dev}:${stats.ino}:${stats.size}:${stats.mtimeNs}:${stats.ctimeNs}`}catch{return}}function isLocalPath(value){let trimmed=value.trim();return!(trimmed.startsWith("npm:")||trimmed.startsWith("git:")||trimmed.startsWith("github:")||trimmed.startsWith("http:")||trimmed.startsWith("https:")||trimmed.startsWith("ssh:")||trimmed.startsWith("builtin:"))}function normalizeWindowsShellPath(filePath){if(!filePath.startsWith(
|
|
27
27
|
"/")||filePath.startsWith("//")||filePath.includes("\\"))return filePath;let match=filePath.match(/^\/(?:mnt\/|cygdrive\/)?([a-z])(?:\/(.*))?$/i);if(!match)return filePath;let suffix=match[2]?.replaceAll("/","\\");return`${match[1].toUpperCase()}:\\${suffix??""}`}function normalizePath(input,options={}){let normalized=options.trim?input.trim():input;if(options.normalizeUnicodeSpaces&&(normalized=normalized.replace(UNICODE_SPACES," ")),options.stripAtPrefix&&normalized.startsWith("@")&&(normalized=
|
|
28
28
|
normalized.slice(1)),process.platform==="win32"&&(normalized=normalizeWindowsShellPath(normalized)),options.expandTilde??!0){let home=options.homeDir??homedir();if(normalized==="~")return home;if(normalized.startsWith("~/")||process.platform==="win32"&&normalized.startsWith("~\\"))return join2(home,normalized.slice(2))}return/^file:\/\//.test(normalized)?fileURLToPath2(normalized):normalized}function resolvePath(input,baseDir=process.cwd(),options={}){let normalized=normalizePath(input,options),
|
|
29
29
|
normalizedBaseDir=normalizePath(baseDir);return isAbsolute2(normalized)?nodeResolvePath(normalized):nodeResolvePath(normalizedBaseDir,normalized)}function getCwdRelativePath(filePath,cwd){let resolvedCwd=resolvePath(cwd),resolvedPath=resolvePath(filePath,resolvedCwd),relativePath=relative(resolvedCwd,resolvedPath);return relativePath===""||relativePath!==".."&&!relativePath.startsWith(`..${sep}`)&&!isAbsolute2(relativePath)?relativePath||".":void 0}function formatPathRelativeToCwdOrAbsolute(filePath,cwd){
|
|
30
30
|
let absolutePath=resolvePath(filePath,cwd);return(getCwdRelativePath(absolutePath,cwd)??absolutePath).split(sep).join("/")}function markPathIgnoredByCloudSync(path){let attrs=process.platform==="darwin"?["com.dropbox.ignored","com.apple.fileprovider.ignore#P"]:process.platform==="linux"?["user.com.dropbox.ignored"]:[];for(let attr of attrs)process.platform==="darwin"?spawnProcessSync("xattr",["-w",attr,"1",path],{encoding:"utf-8",stdio:"ignore"}):spawnProcessSync("setfattr",["-n",attr,"-v","1",path],
|
|
31
|
-
{encoding:"utf-8",stdio:"ignore"})}function splitBom(content){return content.startsWith("\uFEFF")?{bom:"\uFEFF",text:content.slice(1)}:{bom:"",text:content}}function stripBom(content){return splitBom(content).text}var __filename=fileURLToPath3(import.meta.url),__dirname=dirname(__filename),BOOTSTRAP_ENV_PACKAGE_DIR="HUMAIN_TERMINAL_PACKAGE_DIR",isBunBinary=import.meta.url.includes("$bunfs")||import.meta.url.includes("~BUN")||import.meta.url.includes("%7EBUN"),isBunRuntime=!!process.versions.bun,isBundledNode=!0;function normalizeSelfUpdatePackageTarget(target){return typeof target=="string"?{packageName:target,installSpec:target}:{packageName:target.packageName,installSpec:target.installSpec??target.packageName}}
|
|
31
|
+
{encoding:"utf-8",stdio:"ignore"})}function splitBom(content){return content.startsWith("\uFEFF")?{bom:"\uFEFF",text:content.slice(1)}:{bom:"",text:content}}function stripBom(content){return splitBom(content).text}import{accessSync,constants,existsSync,readFileSync,realpathSync as realpathSync2}from"fs";import{createRequire}from"module";import{homedir as homedir2}from"os";import{basename,dirname,join as join3,resolve as resolve2,sep as sep2,win32 as win322}from"path";import{fileURLToPath as fileURLToPath3}from"url";var __filename=fileURLToPath3(import.meta.url),__dirname=dirname(__filename),BOOTSTRAP_ENV_PACKAGE_DIR="HUMAIN_TERMINAL_PACKAGE_DIR",isBunBinary=import.meta.url.includes("$bunfs")||import.meta.url.includes("~BUN")||import.meta.url.includes("%7EBUN"),isBunRuntime=!!process.versions.bun,isBundledNode=!0;function normalizeSelfUpdatePackageTarget(target){return typeof target=="string"?{packageName:target,installSpec:target}:{packageName:target.packageName,installSpec:target.installSpec??target.packageName}}
|
|
32
32
|
function makeSelfUpdateCommand(installStep,uninstallStep){return uninstallStep?{...installStep,display:`${uninstallStep.display} && ${installStep.display}`,steps:[uninstallStep,installStep]}:installStep}function makeSelfUpdateCommandStep(command,args){return{command,args,display:[command,...args].map(arg=>/\s/.test(arg)?`"${arg}"`:arg).join(" ")}}function detectInstallMethod(){if(isBunBinary)return"bun-binary";let resolvedPath=`${__dirname}\0${process.execPath||""}`.toLowerCase().replace(/\\/g,"\
|
|
33
33
|
/");return resolvedPath.includes("/pnpm/")||resolvedPath.includes("/.pnpm/")?"pnpm":resolvedPath.includes("/yarn/")||resolvedPath.includes("/.yarn/")?"yarn":isBunRuntime||resolvedPath.includes("/install/global/node_modules/")?"bun":resolvedPath.includes("/npm/")||resolvedPath.includes("/node_modules/")?"npm":"unknown"}function getInferredNpmInstall(){let packageDir=getPackageDir(),path=process.platform==="win32"||packageDir.includes("\\")?win322:{basename,dirname},parent=path.dirname(packageDir),
|
|
34
34
|
root;if(path.basename(parent).startsWith("@")&&path.basename(path.dirname(parent))==="node_modules"?root=path.dirname(parent):path.basename(parent)==="node_modules"&&(root=parent),!root)return;let rootParent=path.dirname(root);if(path.basename(rootParent)==="lib")return{root,prefix:path.dirname(rootParent)}}function getSelfUpdateCommandForMethod(method,installedPackageName,updatePackageTarget=installedPackageName,npmCommand){let target=normalizeSelfUpdatePackageTarget(updatePackageTarget);switch(method){case"\
|
|
@@ -55,7 +55,6 @@ trim().replace(/[^a-zA-Z0-9]+/g,"_").replace(/^_+|_+$/g,"").toUpperCase()}var PA
|
|
|
55
55
|
APP_NAME),ENV_AGENT_DIR=`${ENV_PREFIX}_CODING_AGENT_DIR`,ENV_SESSION_DIR=`${ENV_PREFIX}_CODING_AGENT_SESSION_DIR`,ENV_SESSION_ID=`${ENV_PREFIX}_SESSION_ID`,ENV_SESSION_FILE=`${ENV_PREFIX}_SESSION_FILE`,ENV_PROVIDER=`${ENV_PREFIX}_PROVIDER`,ENV_MODEL=`${ENV_PREFIX}_MODEL`,ENV_MCP_CLIENT_METADATA_URL=`${ENV_PREFIX}_MCP_CLIENT_METADATA_URL`,ENV_REASONING_LEVEL=`${ENV_PREFIX}_REASONING_LEVEL`,ENV_OFFLINE=`${ENV_PREFIX}_OFFLINE`,ENV_PACKAGE_DIR=`${ENV_PREFIX}_PACKAGE_DIR`,ENV_SELF_UPDATE_COMMAND=`${ENV_PREFIX}\
|
|
56
56
|
_SELF_UPDATE_COMMAND`,ENV_SHARE_VIEWER_URL=`${ENV_PREFIX}_SHARE_VIEWER_URL`,ENV_SKIP_VERSION_CHECK=`${ENV_PREFIX}_SKIP_VERSION_CHECK`,ENV_STARTUP_BENCHMARK=`${ENV_PREFIX}_STARTUP_BENCHMARK`,ENV_TELEMETRY=`${ENV_PREFIX}_TELEMETRY`,ENV_VERSION_CHECK_URL=`${ENV_PREFIX}_VERSION_CHECK_URL`,ENV_BINARY_RELEASE_URL=`${ENV_PREFIX}_BINARY_RELEASE_URL`,ENV_INSTALL_TELEMETRY_URL=`${ENV_PREFIX}_INSTALL_TELEMETRY_URL`,ENV_CHANGELOG_URL=`${ENV_PREFIX}_CHANGELOG_URL`;function expandTildePath(path){return normalizePath(
|
|
57
57
|
path)}var HUMAIN_TERMINAL_WEB_URL="https://code.humain.com",HUMAIN_TERMINAL_BINARY_RELEASE_URL="https://gitlab.humain.com/humain/data-and-ai-modeling/standard/agentic/humain-terminal/-/releases/permalink/latest",HUMAIN_TERMINAL_VERSION_CHECK_URL="https://registry.npmjs.org/@humain%2fhumain-code/latest",HUMAIN_TERMINAL_INSTALL_TELEMETRY_URL=`${HUMAIN_TERMINAL_WEB_URL}/api/report-install`,HUMAIN_TERMINAL_CHANGELOG_URL=`${HUMAIN_TERMINAL_WEB_URL}/changelog`,DEFAULT_SHARE_VIEWER_URL=`${HUMAIN_TERMINAL_WEB_URL}\
|
|
58
|
-
/session/`;function getVersionCheckUrl(){return process.env[ENV_VERSION_CHECK_URL]||HUMAIN_TERMINAL_VERSION_CHECK_URL}function getBinaryReleaseUrl(){return process.env[ENV_BINARY_RELEASE_URL]||HUMAIN_TERMINAL_BINARY_RELEASE_URL}function
|
|
59
|
-
function getShareViewerUrl(gistId){return`${process.env[ENV_SHARE_VIEWER_URL]||process.env.PI_SHARE_VIEWER_URL||DEFAULT_SHARE_VIEWER_URL}#${gistId}`}function getAgentDir(){let envDir=process.env[ENV_AGENT_DIR];return envDir?expandTildePath(envDir):join3(homedir2(),CONFIG_DIR_NAME,"agent")}function getCustomThemesDir(){return join3(getAgentDir(),"themes")}function getAuthPath(){return join3(getAgentDir(),"auth.json")}function getSettingsPath(){return join3(getAgentDir(),"settings.json")}function getBinDir(){return join3(getAgentDir(),"bin")}function getSessionsDir(){return join3(getAgentDir(),"sessions")}function getDebugLogPath(){return join3(getAgentDir(),`${APP_NAME}-debug.log`)}export{require_resolveCommand,require_readShebang,require_cross_spawn,spawnProcess,spawnProcessSync,waitForChildProcess,canonicalizePath,getPathComparisonKey,pathsEqual,isPathWithin,shortenHomePath,getFileRevision,isLocalPath,normalizePath,resolvePath,getCwdRelativePath,formatPathRelativeToCwdOrAbsolute,markPathIgnoredByCloudSync,splitBom,stripBom,isBunBinary,isBunRuntime,isBundledNode,detectInstallMethod,getSelfUpdateCommand,getConfiguredSelfUpdateArgv,makeConfiguredSelfUpdateCommand,getSelfUpdateUnavailableInstruction,
|
|
58
|
+
/session/`;function getVersionCheckUrl(){return process.env[ENV_VERSION_CHECK_URL]||HUMAIN_TERMINAL_VERSION_CHECK_URL}function getBinaryReleaseUrl(){return process.env[ENV_BINARY_RELEASE_URL]||HUMAIN_TERMINAL_BINARY_RELEASE_URL}function getChangelogUrl(){return process.env[ENV_CHANGELOG_URL]||HUMAIN_TERMINAL_CHANGELOG_URL}function getShareViewerUrl(gistId){return`${process.env[ENV_SHARE_VIEWER_URL]||process.env.PI_SHARE_VIEWER_URL||DEFAULT_SHARE_VIEWER_URL}#${gistId}`}function getAgentDir(){let envDir=process.env[ENV_AGENT_DIR];return envDir?expandTildePath(envDir):join3(homedir2(),CONFIG_DIR_NAME,"agent")}function getCustomThemesDir(){return join3(getAgentDir(),"themes")}function getAuthPath(){return join3(getAgentDir(),"auth.json")}function getSettingsPath(){return join3(getAgentDir(),"settings.json")}function getBinDir(){return join3(getAgentDir(),"bin")}function getSessionsDir(){return join3(getAgentDir(),"sessions")}function getDebugLogPath(){return join3(getAgentDir(),`${APP_NAME}-debug.log`)}export{require_resolveCommand,require_readShebang,require_cross_spawn,spawnProcess,spawnProcessSync,waitForChildProcess,canonicalizePath,getPathComparisonKey,pathsEqual,isPathWithin,shortenHomePath,getFileRevision,isLocalPath,normalizePath,resolvePath,getCwdRelativePath,formatPathRelativeToCwdOrAbsolute,markPathIgnoredByCloudSync,splitBom,stripBom,isBunBinary,isBunRuntime,isBundledNode,detectInstallMethod,getSelfUpdateCommand,getConfiguredSelfUpdateArgv,makeConfiguredSelfUpdateCommand,getSelfUpdateUnavailableInstruction,
|
|
60
59
|
getPackageDir,getThemesDir,getExportTemplateDir,getReadmePath,getDocsPath,getExamplesPath,getChangelogPath,getBundledInteractiveAssetPath,getHumainModuleAssetsDir,getBundledFlowPackageDir,getBundledFlowProfilesDir,getQuickJSWasmPath,getCodemodeWorkerSpecifier,detectInstallChange,PACKAGE_NAME,APP_NAME,APP_TITLE,APP_COMMAND,CONFIG_DIR_NAME,FIRST_TIME_SETUP_ENABLED,VERSION,UPSTREAM_PI_VERSION,ENV_PREFIX,ENV_AGENT_DIR,ENV_SESSION_DIR,ENV_MCP_CLIENT_METADATA_URL,ENV_OFFLINE,ENV_PACKAGE_DIR,ENV_SELF_UPDATE_COMMAND,
|
|
61
|
-
ENV_SHARE_VIEWER_URL,ENV_SKIP_VERSION_CHECK,ENV_STARTUP_BENCHMARK,ENV_TELEMETRY,expandTildePath,HUMAIN_TERMINAL_WEB_URL,DEFAULT_SHARE_VIEWER_URL,getVersionCheckUrl,
|
|
60
|
+
ENV_SHARE_VIEWER_URL,ENV_SKIP_VERSION_CHECK,ENV_STARTUP_BENCHMARK,ENV_TELEMETRY,expandTildePath,HUMAIN_TERMINAL_WEB_URL,DEFAULT_SHARE_VIEWER_URL,getVersionCheckUrl,getChangelogUrl,getShareViewerUrl,getAgentDir,getCustomThemesDir,getAuthPath,getSettingsPath,getBinDir,getSessionsDir,getDebugLogPath};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
|
+
import{VisualLinePreview,getTextOutput,replaceTabs,startToolTimer,str,toolTimerText}from"./chunk-5B25YXF7.js";import{SETTINGS_DEFAULTS}from"./chunk-WQOOJP7U.js";import{CodeHighlighter,keyHint}from"./chunk-JF7FYXAI.js";import{Container,Spacer,Text,sanitizeTerminalText}from"./chunk-JYWUOKOI.js";import{typebox_exports}from"./chunk-VEGJT52D.js";import{getDocsPath}from"./chunk-VFLVWPLZ.js";function toCodemodeIdentifier(name){let identifier="";for(let char of name){let valid=identifier===""?/^[A-Za-z_$]$/.test(char):/^[A-Za-z0-9_$]$/.test(char);identifier+=valid?char:"_"}return identifier===""?"_":identifier}var IDENTIFIER=/^[A-Za-z_$][A-Za-z0-9_$]*$/,INDENT=" ",DEFAULT_INPUT_SCHEMA_MAX_CHARS=16e3,MAX_REF_EXPANSIONS=32,TAG_KEYWORDS=["minimum","exclusiveMinimum","maximum","exclusiveMaximum","multipleOf","minLength","maxLength","pattern","format","minItems","maxItems"],LOWER_BOUNDS=new Set(["minimum","exclusiveMinimum","minLength","minItems"]),UPPER_BOUNDS=new Set(["maximum","exclusiveMaximum","maxLength","maxItems"]),MAX_TAG_CHARS=80,LINE_TERMINATORS=/[\r\n\u2028\u2029]/g;function renderToolSignature(tool,options={}){let input=tool.inputSchema===void 0?"unknown":schemaToType(tool.inputSchema,{maxChars:options.inputMaxChars??DEFAULT_INPUT_SCHEMA_MAX_CHARS});return`${toCodemodeIdentifier(tool.name)}(args: ${input}): Promise<${renderToolOutputType(tool.outputSchema)}>;`}function renderToolSample(tool,options={}){let declaration=`declare const tools: { ${renderToolSignature(tool,options)} };`;return`${tool.description?.trim()??""}
|
|
3
|
+
|
|
4
|
+
codemode tool declaration:
|
|
5
|
+
\`\`\`ts
|
|
6
|
+
${declaration}
|
|
7
|
+
\`\`\``}function renderToolOutputType(schema){return schema===void 0?"unknown":schemaToType(schema)}function propertyKey(name){return IDENTIFIER.test(name)?name:JSON.stringify(name)}function union(types){let unique=[...new Set(types)];return unique.includes("unknown")?"unknown":unique.length===0?"never":unique.join(" | ")}function schemaToType(schema,options={}){let render=tags=>toType(schema,{root:schema,resolving:new Set,expansions:0,tags}),type=render(!0);if(options.maxChars===void 0||type.length<=options.maxChars)return type;let untagged=render(!1);return untagged.length<=options.maxChars?
|
|
8
|
+
untagged:"unknown"}function resolveSchemaRef(ref,root){if(!ref.startsWith("#"))return;let pointer;try{pointer=decodeURIComponent(ref.slice(1))}catch{return}if(pointer!==""&&!pointer.startsWith("/"))return;let current=root;for(let segment of pointer===""?[]:pointer.slice(1).split("/")){let key=segment.replaceAll("~1","/").replaceAll("~0","~");if(typeof current!="object"||current===null||!Object.hasOwn(current,key)||Array.isArray(current)&&(!/^(0|[1-9][0-9]*)$/.test(key)||Number(key)>=current.length))
|
|
9
|
+
return;current=current[key]}return typeof current=="boolean"||typeof current=="object"&¤t!==null&&!Array.isArray(current)?current:void 0}function toType(schema,context){if(schema===!0)return"unknown";if(schema===!1)return"never";if(typeof schema!="object"||schema===null||Array.isArray(schema))return"unknown";if(typeof schema.$ref=="string"){let ref=schema.$ref;if(context.resolving.has(ref)||context.expansions>=MAX_REF_EXPANSIONS)return"unknown";let target=resolveSchemaRef(ref,context.root);
|
|
10
|
+
if(target===void 0)return"unknown";context.expansions++,context.resolving.add(ref);try{return toType(target,context)}finally{context.resolving.delete(ref)}}if("const"in schema)return JSON.stringify(schema.const)??"unknown";if(Array.isArray(schema.enum))return union(schema.enum.map(value=>JSON.stringify(value)??"unknown"));let variants=Array.isArray(schema.anyOf)?schema.anyOf:Array.isArray(schema.oneOf)?schema.oneOf:void 0;if(variants)return union(variants.map(variant=>toType(variant,context)));if(Array.
|
|
11
|
+
isArray(schema.allOf)){let parts=schema.allOf.map(part=>toType(part,context)).filter(part=>part!=="unknown");return parts.length===0?"unknown":parts.map(part=>part.includes(" | ")?`(${part})`:part).join(" & ")}let type=schema.type;if(Array.isArray(type))return union(type.map(entry=>toType({...schema,type:entry},context)));switch(type){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":return arrayType(schema,context);case"\
|
|
12
|
+
object":return objectType(schema,context);case void 0:return"properties"in schema||"additionalProperties"in schema||"required"in schema?objectType(schema,context):"items"in schema||"prefixItems"in schema?arrayType(schema,context):"unknown";default:return"unknown"}}function arrayType(schema,context){if(schema.items!==void 0&&!Array.isArray(schema.items))return`Array<${toType(schema.items,context)}>`;let tuple=Array.isArray(schema.prefixItems)?schema.prefixItems:Array.isArray(schema.items)?schema.
|
|
13
|
+
items:[];return tuple.length>0?`[${tuple.map(item=>toType(item,context)).join(", ")}]`:"unknown[]"}function descriptionOf(property){let description=property?.description;return typeof description=="string"?description.trim():""}function constraintTags(schema){if(typeof schema!="object"||schema===null||Array.isArray(schema))return"";let property=schema,variants=Array.isArray(property.anyOf)?property.anyOf:property.oneOf,nonNull=Array.isArray(variants)?variants.filter(variant=>variant?.type!=="nul\
|
|
14
|
+
l"):[],branch=nonNull.length===1?nonNull[0]:void 0,schemas=(typeof branch=="object"&&branch!==null&&!Array.isArray(branch)?[property,branch]:[property]).map(schema2=>({...schema2,...schema2.exclusiveMinimum===!0?{minimum:void 0,exclusiveMinimum:schema2.minimum}:{},...schema2.exclusiveMaximum===!0?{maximum:void 0,exclusiveMaximum:schema2.maximum}:{}})),tags=[],isInteger=type=>type==="integer"||Array.isArray(type)&&type.includes("integer");schemas.some(schema2=>isInteger(schema2.type))&&tags.push(
|
|
15
|
+
"@integer");for(let keyword of TAG_KEYWORDS){let values=schemas.map(schema2=>schema2[keyword]);if(LOWER_BOUNDS.has(keyword)||UPPER_BOUNDS.has(keyword)){let numbers=values.filter(value=>typeof value=="number");if(numbers.length===0)continue;tags.push(`@${keyword} ${LOWER_BOUNDS.has(keyword)?Math.max(...numbers):Math.min(...numbers)}`);continue}for(let value of new Set(values))(typeof value=="number"||typeof value=="string")&&tags.push(`@${keyword} ${value}`)}return schemas.some(schema2=>schema2.uniqueItems===
|
|
16
|
+
!0)&&tags.push("@uniqueItems"),property.default!==void 0&&property.default!==null&&tags.push(`@default ${JSON.stringify(property.default)}`),property.deprecated===!0&&tags.push("@deprecated"),tags.filter(tag=>tag.length<=MAX_TAG_CHARS).map(tag=>tag.replace(LINE_TERMINATORS,char=>`\\u${char.charCodeAt(0).toString(16).padStart(4,"0")}`)).join(" ")}function objectType(schema,context){let properties=typeof schema.properties=="object"&&schema.properties!==null&&!Array.isArray(schema.properties)?schema.
|
|
17
|
+
properties:{},required=new Set(Array.isArray(schema.required)?schema.required:[]),names=Object.keys(properties).sort(),members=names.map(name=>{let optional=required.has(name)?"":"?";return`${propertyKey(name)}${optional}: ${toType(properties[name],context)};`}),additional=schema.additionalProperties;if(additional!==void 0&&additional!==!1){let type=additional===!0?"unknown":toType(additional,context);members.push(`[key: string]: ${type};`)}else additional===void 0&&names.length===0&&members.push(
|
|
18
|
+
"[key: string]: unknown;");if(members.length===0)return"{}";let comments=names.map(name=>{let lines2=descriptionOf(properties[name]).split(LINE_TERMINATORS).map(line=>line.trim()).filter(Boolean),tags=context.tags?constraintTags(properties[name]):"";return tags?[...lines2,tags]:lines2});if(!comments.some(comment=>comment.length>0))return`{ ${members.join(" ")} }`;let lines=["{"];comments.forEach((comment,index)=>{for(let line of comment)lines.push(`${INDENT}// ${line}`);lines.push(`${INDENT}${members[index].
|
|
19
|
+
replaceAll(`
|
|
20
|
+
`,`
|
|
21
|
+
${INDENT}`)}`)});for(let member of members.slice(names.length))lines.push(`${INDENT}${member}`);return lines.push("}"),lines.join(`
|
|
22
|
+
`)}var CODEMODE_OPTIONS_PREFIX="// @options:",SUPPORTED_FIELDS=["max_output_tokens","timeout_ms"],SUPPORTED_FIELDS_TEXT="`max_output_tokens` and `timeout_ms`";var CODEMODE_SOURCE_GRAMMAR=String.raw`
|
|
23
|
+
start: options_source | plain_source
|
|
24
|
+
options_source: OPTIONS_LINE NEWLINE SOURCE
|
|
25
|
+
plain_source: SOURCE
|
|
26
|
+
|
|
27
|
+
OPTIONS_LINE: /[ \t]*\/\/ @options:[^\r\n]*/
|
|
28
|
+
NEWLINE: /\r?\n/
|
|
29
|
+
SOURCE: /[\s\S]+/
|
|
30
|
+
`,CodemodeSourceError=class extends Error{constructor(message){super(message),this.name="CodemodeSourceError"}};function isSafeInteger(value){return typeof value=="number"&&Number.isSafeInteger(value)&&value>=0}function parseOptions(directive){if(directive==="")throw new CodemodeSourceError(`@options must be a JSON object with supported fields ${SUPPORTED_FIELDS_TEXT}`);let value;try{value=JSON.parse(directive)}catch(error){throw new CodemodeSourceError(`@options must be valid JSON with supporte\
|
|
31
|
+
d fields ${SUPPORTED_FIELDS_TEXT}: ${error instanceof Error?error.message:String(error)}`)}if(typeof value!="object"||value===null||Array.isArray(value))throw new CodemodeSourceError(`@options must be a JSON object with supported fields ${SUPPORTED_FIELDS_TEXT}`);let fields=value;for(let key of Object.keys(fields))if(!SUPPORTED_FIELDS.includes(key))throw new CodemodeSourceError(`@options only supports ${SUPPORTED_FIELDS_TEXT}; got \`${key}\``);let options={},{max_output_tokens,timeout_ms}=fields;
|
|
32
|
+
if(max_output_tokens!==void 0){if(!isSafeInteger(max_output_tokens))throw new CodemodeSourceError("@options field `max_output_tokens` must be a non-negative safe integer");options.maxOutputTokens=max_output_tokens}if(timeout_ms!==void 0){if(!isSafeInteger(timeout_ms)||timeout_ms===0||timeout_ms>2147483647)throw new CodemodeSourceError("@options field `timeout_ms` must be a positive integer up to 2147483647");options.timeoutMs=timeout_ms}return options}function parseCodemodeSource(input){if(input.
|
|
33
|
+
trim()==="")throw new CodemodeSourceError('Expected JavaScript source text (non-empty). Provide JS only, optionally with a first line `// @options: {"max_output_tokens": 1000}`.');let lines=input.split(`
|
|
34
|
+
`),misplaced=lines.findIndex((line,index)=>index>0&&line.trimStart().startsWith(CODEMODE_OPTIONS_PREFIX));if(misplaced!==-1)throw new CodemodeSourceError(`The ${CODEMODE_OPTIONS_PREFIX} line must be the first line of the input; found one on line ${misplaced+1}`);let newline=input.indexOf(`
|
|
35
|
+
`),trimmed=lines[0].replace(/\r$/,"").trimStart();if(!trimmed.startsWith(CODEMODE_OPTIONS_PREFIX))return{code:input,options:{}};let code=newline===-1?"":input.slice(newline);if(code.trim()==="")throw new CodemodeSourceError("The @options line must be followed by JavaScript source on subsequent lines");return{code,options:parseOptions(trimmed.slice(CODEMODE_OPTIONS_PREFIX.length).trim())}}import{join}from"node:path";var loadCodemodeExecutor=()=>import("./execute-MY5JSEPV.js");var CODE_PREVIEW_LINES=10,CALL_PREVIEW_COUNT=8,OUTPUT_PREVIEW_LINES=5,COLLAPSED_ARGS_CHARS=80,SCRIPT_HEADER=/^Script (completed|failed)\nWall time [\d.]+ seconds\nOutput:\n$/;function expandHint(theme,hidden,noun){return`${theme.fg("muted",`... (${hidden} more ${noun},`)} ${keyHint("app.tools.expand","to expand")}${theme.fg("muted",")")}`}function formatDuration(ms){return ms===void 0?"":ms<1e3?`${Math.round(ms)}ms`:`${(ms/1e3).toFixed(1)}s`}function formatCost(cost){return`$${cost>=.01?cost.toFixed(
|
|
36
|
+
2):cost.toPrecision(2)}`}function statusIcon(call,theme){switch(call.status){case"running":return theme.fg("warning","\u2026");case"ok":return theme.fg("success","\u2713");case"error":return theme.fg("error","\u2717");case"cancelled":return theme.fg("muted","\u2298")}}function formatCall(call,theme,expanded){let callArgs=sanitizeTerminalText(call.args),args=!expanded&&callArgs.length>COLLAPSED_ARGS_CHARS?`${callArgs.slice(0,COLLAPSED_ARGS_CHARS-3)}...`:callArgs,duration=formatDuration(call.durationMs),
|
|
37
|
+
line=`${statusIcon(call,theme)} ${theme.fg("toolTitle",sanitizeTerminalText(call.name))}`;return args&&(line+=` ${theme.fg("muted",args)}`),duration&&(line+=` ${theme.fg("dim",duration)}`),call.cost&&(line+=` ${theme.fg("dim",formatCost(call.cost))}`),expanded&&call.error&&(line+=`
|
|
38
|
+
${theme.fg("error",sanitizeTerminalText(call.error).split(`
|
|
39
|
+
`).join(`
|
|
40
|
+
`))}`),line}var codemodeRenderers={renderCall(args,theme,context){startToolTimer(context);let code=str(args?.code),title=theme.fg("toolTitle",theme.bold("codemode")),component=context.lastComponent??new Container;if(component.clear(),code===null)return component.addChild(new Text(`${title} ${theme.fg("error","[invalid arg]")}`,0,0)),component;if(component.addChild(new Text(title,0,0)),code){let state=context.state;state.scriptHighlighter??=new CodeHighlighter;let highlighted=state.scriptHighlighter.
|
|
41
|
+
highlight(replaceTabs(code.replace(/\r/g,"").trimEnd()),"javascript").join(`
|
|
42
|
+
`);component.addChild(context.expanded?new Text(highlighted,0,0):new VisualLinePreview({text:highlighted,maxVisualLines:CODE_PREVIEW_LINES,keep:"start",formatHint:hidden=>expandHint(theme,hidden,"lines")}))}return component},renderResult(result,options,theme,context){let timerText=toolTimerText(context,options.isPartial),component=context.lastComponent??new Container;component.clear();let calls=result.details?.calls??[];if(calls.length>0){let shown=options.expanded?calls:calls.slice(-CALL_PREVIEW_COUNT),
|
|
43
|
+
lines=shown.map(call=>formatCall(call,theme,options.expanded));shown.length<calls.length&&lines.unshift(`${theme.fg("muted",`... (${calls.length-shown.length} earlier calls,`)} ${keyHint("app.tools.expand","to expand")}${theme.fg("muted",")")}`);let priced=calls.filter(call=>call.cost);if(priced.length>1){let total=priced.reduce((sum,call)=>sum+(call.cost??0),0);lines.push(theme.fg("muted",`Model calls: ${formatCost(total)}`))}component.addChild(new Spacer(1)),component.addChild(new Text(lines.join(
|
|
44
|
+
`
|
|
45
|
+
`),0,0))}let[first,...rest]=result.content,hasHeader=first?.type==="text"&&SCRIPT_HEADER.test(first.text),output=options.isPartial?"":getTextOutput({...result,content:hasHeader?rest:result.content},context.showImages).trim();if(output){let color=context.isError?"error":"toolOutput",styled=replaceTabs(output).split(`
|
|
46
|
+
`).map(line=>theme.fg(color,line)).join(`
|
|
47
|
+
`);if(component.addChild(new Spacer(1)),options.expanded)component.addChild(new Text(styled,0,0));else{component.addChild(new VisualLinePreview({text:styled,maxVisualLines:OUTPUT_PREVIEW_LINES,keep:"start",formatHint:hidden=>expandHint(theme,hidden,"lines")}));let fullOutputPath=result.details?.fullOutputPath;fullOutputPath&&component.addChild(new Text(theme.fg("muted",`Full output: ${fullOutputPath}`),0,0))}}return timerText&&(component.addChild(new Spacer(1)),component.addChild(new Text(theme.
|
|
48
|
+
fg("muted",timerText),0,0))),component}};var CODEMODE_TOOL_NAME="codemode",CODEMODE_STORE_ENTRY_TYPE="codemode-store",TEXT_OUTPUT_SCHEMA={type:"string"},codemodeSchema=typebox_exports.Object({code:typebox_exports.String({description:"Raw JavaScript source."})}),codemodeToolSystemPromptContribution={snippet:"Run JavaScript that calls other tools",guidelines:["Use codemode to batch independent tool calls (Promise.allSettled), chain them, or filter large output, instead of many separate calls."]},CODEMODE_DOCS_PATH=join(getDocsPath(),"cod\
|
|
49
|
+
emode.md"),DESCRIPTION_INTRO='Run JavaScript that calls other tools. The input is raw JavaScript (not JSON, no code fence), run as an async function body in a QuickJS sandbox: top-level `await` and `return` work. No Node, file system, network, or timers.\n- `await tools.<name>({ ...args })` resolves to a string, or an object if the tool\'s declaration says so, and rejects with an Error on failure. A tool whose declaration returns an object resolves on failure too when it returned that object; chec\
|
|
50
|
+
k its fields. Calls still running when the script ends are cancelled.\n- Optional first line: `// @options: {"max_output_tokens": 10000, "timeout_ms": 60000}`';function describeGlobals(models){let lines=["Globals:","- `text(value)`, `image(dataUrlOrImageBlock)`, `console.log(...)`, and top-level `return` add output; `exit()` ends the script. With several text items, each starts with a `==> text N/M <==` line, and `console` lines follow the other output in one `<console_output>` block. `image()` \
|
|
51
|
+
also saves the image to a temp file and the result names its path.","- `store(key, value)` and `load(key)` keep JSON values across codemode calls.","- `ALL_TOOLS`, `await searchTools(query, { limit?, namespace? })`, `await describeTool(name)`, `await describeNamespace(name)`: find unlisted tools, such as MCP tools."];return models&&lines.push(`- \`models\`: classifiers and image generation. Read ${CODEMODE_DOCS_PATH} first.`),lines.join(`
|
|
52
|
+
`)}var DEFAULT_CODEMODE_INLINE_BUDGET=SETTINGS_DEFAULTS.codemode.inlineBudget,CHARS_PER_TOKEN=4;function toCodemodeDeclaration(tool,guidelines=[]){let bullets=guidelines.flatMap(guideline=>guideline.trim()?[`- ${guideline.trim()}`]:[]);return{name:tool.name,description:bullets.length>0?`${tool.description.trim()}
|
|
53
|
+
|
|
54
|
+
${bullets.join(`
|
|
55
|
+
`)}`:tool.description,inputSchema:tool.parameters,outputSchema:tool.outputSchema??TEXT_OUTPUT_SCHEMA}}function getCodemodeCallableTools(tools){return tools.filter(tool=>tool.name!==CODEMODE_TOOL_NAME)}function renderToolSection(declaration){let id=toCodemodeIdentifier(declaration.name);return`${id===declaration.name?`### \`${id}\``:`### \`${id}\` (\`${declaration.name}\`)`}
|
|
56
|
+
${renderToolSample(declaration).trim()}`}function selectCatalog(groups,budget){if(budget===void 0)return new Set(groups.flatMap(group=>group.entries.map(entry=>entry.name)));let queues=groups.map(group=>[...group.entries].sort((a,b)=>a.cost-b.cost)),shown=new Set,remaining=budget,active=queues.filter(queue=>queue.length>0);for(;active.length>0;)active=active.filter(queue=>{let next=queue[0];return next.cost>remaining?!1:(remaining-=next.cost,shown.add(next.name),queue.shift(),queue.length>0)});return shown}
|
|
57
|
+
function createCodemodeDescription(tools,options={}){let declarations=getCodemodeCallableTools(tools).filter(tool=>!options.deferred?.has(tool.name)).map(tool=>toCodemodeDeclaration(tool,options.guidelines?.get(tool.name))),groups=new Map([["",{namespace:void 0,entries:[]}]]);for(let declaration of declarations){let namespace=options.namespaces?.get(declaration.name),key=namespace?`ns:${namespace.name}`:"",group=groups.get(key)??{namespace,entries:[]};groups.set(key,group);let section=renderToolSection(
|
|
58
|
+
declaration);group.entries.push({name:declaration.name,section,cost:Math.ceil(section.length/CHARS_PER_TOKEN)})}let ordered=[...groups.values()].sort((a,b)=>a.namespace===void 0?-1:b.namespace===void 0?1:a.namespace.name.localeCompare(b.namespace.name)),shown=selectCatalog(ordered,options.inlineBudget),sections=[DESCRIPTION_INTRO,describeGlobals(options.models===!0)];if(declarations.length===0)return sections.join(`
|
|
59
|
+
|
|
60
|
+
`);let toolSections=["Nested tools:"];for(let{namespace,entries}of ordered){let visible=entries.filter(entry=>shown.has(entry.name));if(namespace){let listing=visible.length===entries.length?"":visible.length===0?" (tools not listed)":" (some tools not listed)",description=namespace.description?.trim();toolSections.push(`## ${namespace.name}${listing}${description?`
|
|
61
|
+
${description}`:""}`)}for(let entry of visible)toolSections.push(entry.section)}return sections.push(toolSections.join(`
|
|
62
|
+
|
|
63
|
+
`)),sections.join(`
|
|
64
|
+
|
|
65
|
+
`)}function describeFields(schema,root,depth){let resolved=followRef(schema,root);if(typeof resolved!="object"||resolved===null)return;let{type,properties,required}=resolved;if(type!=="object"||typeof properties!="object"||properties===null)return;let requiredNames=new Set(Array.isArray(required)?required:[]);return`{ ${Object.entries(properties).map(([name,field])=>{let constValue=followRef(field,root)?.const,nested=constValue!==void 0?JSON.stringify(constValue):depth>0?describeFields(field,root,
|
|
66
|
+
depth-1):void 0;return`${name}${requiredNames.has(name)?"":"?"}${nested?`: ${nested}`:""}`}).join(", ")} }`}function describeOutput(name,schema){let type=renderToolOutputType(schema);if(type==="string")return"a string";let fields=schema===void 0?void 0:describeFields(schema,schema,1)??describeUnionFields(schema,schema);return fields?`\`${fields}\``:type.includes(`
|
|
67
|
+
`)?`a value; \`await describeTool(${JSON.stringify(name)})\` shows its type`:`\`${type}\``}function describeUnionFields(schema,root){let resolved=followRef(schema,root);if(typeof resolved!="object"||resolved===null)return;let{anyOf,oneOf}=resolved,variants=anyOf??oneOf;if(!Array.isArray(variants)||variants.length===0)return;let described=variants.map(variant=>describeFields(variant,root,0));return described.every(fields=>fields!==void 0)?described.join(" | "):void 0}function followRef(schema,root){
|
|
68
|
+
let seen=new Set,current=schema;for(;typeof current=="object"&¤t!==null&&!seen.has(current);){let ref=current.$ref;if(typeof ref!="string")break;let target=resolveSchemaRef(ref,root);if(target===void 0)break;seen.add(current),current=target}return current}function describeScriptCall(tool){return`${tool.description.trim()}
|
|
69
|
+
|
|
70
|
+
Codemode: \`tools.${toCodemodeIdentifier(tool.name)}(args)\` resolves to ${describeOutput(tool.name,toCodemodeDeclaration(tool).outputSchema)}.`}function prepareCodemodeLoadout(loadout,options){let mode=options.getMode?.()??SETTINGS_DEFAULTS.codemode.mode,isDirect=tool=>loadout.getExposure(tool.name)==="direct",callable=getCodemodeCallableTools(loadout.callable),callableNames=new Set(callable.map(tool=>tool.name)),descriptions={};if(mode==="on")for(let tool of loadout.declared)callableNames.has(
|
|
71
|
+
tool.name)&&(descriptions[tool.name]=describeScriptCall(tool));let listed=mode==="only"?callable:callable.filter(tool=>!isDirect(tool)),namespaces=new Map(listed.flatMap(tool=>{let namespace=loadout.getNamespace(tool.name);return namespace?[[tool.name,namespace]]:[]})),guidelines=new Map(listed.map(tool=>[tool.name,loadout.getPromptGuidelines(tool.name)]));descriptions[CODEMODE_TOOL_NAME]=createCodemodeDescription(listed,{models:options.models===!0,namespaces,guidelines,deferred:new Set(listed.filter(
|
|
72
|
+
tool=>loadout.getExposure(tool.name)==="deferred").map(tool=>tool.name)),inlineBudget:options.getInlineBudget?.()??DEFAULT_CODEMODE_INLINE_BUDGET});let declaredNames=new Set(loadout.declared.map(tool=>tool.name));return{descriptions,hiddenDeclarations:mode==="only"?callable.filter(tool=>isDirect(tool)&&declaredNames.has(tool.name)).map(tool=>tool.name):[]}}var DISCOVERY_GLOBALS=/\b(searchTools|describeNamespace|describeTool|ALL_TOOLS)\b/;function getScriptReach(code){return typeof code!="string"?
|
|
73
|
+
[]:DISCOVERY_GLOBALS.test(code)?"all":code.match(/\w+/g)??[]}function createCodemodeToolDefinition(options={}){return{name:CODEMODE_TOOL_NAME,label:CODEMODE_TOOL_NAME,description:createCodemodeDescription([],{models:options.models===!0}),promptSnippet:codemodeToolSystemPromptContribution.snippet,promptGuidelines:[...codemodeToolSystemPromptContribution.guidelines],parameters:codemodeSchema,exposure:"model-only",prepareLoadout:loadout=>prepareCodemodeLoadout(loadout,options),reachesTools:input=>getScriptReach(
|
|
74
|
+
input.code),constrainedSampling:{type:"grammar",variants:{openai_lark:CODEMODE_SOURCE_GRAMMAR}},execute:async(toolCallId,params,signal,onUpdate,ctx)=>(await loadCodemodeExecutor()).executeCodemode(toolCallId,params,signal,onUpdate,ctx,options),...codemodeRenderers}}export{toCodemodeIdentifier,renderToolSample,resolveSchemaRef,parseCodemodeSource,CODEMODE_TOOL_NAME,CODEMODE_STORE_ENTRY_TYPE,CODEMODE_DOCS_PATH,toCodemodeDeclaration,getCodemodeCallableTools,createCodemodeToolDefinition};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
|
+
import{DH_MAX_EXTERNAL_IDS,DhExternalIdSchema}from"./chunk-UZNIPOGS.js";import{Compile}from"./chunk-LB4CIS4F.js";import{isAbsolute,normalize}from"node:path";function lazyValidator(schema){let validator;return()=>validator??=Compile(schema)}import{randomBytes}from"node:crypto";var ID_RANDOM_BYTES=18;function mintTraceId(prefix){return`${prefix}_${randomBytes(ID_RANDOM_BYTES).toString("base64url")}`}var ID_PATTERNS={gen:/^gen_[A-Za-z0-9_-]{8,128}$/,agt:/^agt_[A-Za-z0-9_-]{8,128}$/,att:/^att_[A-Za-z0-9_-]{8,128}$/,evt:/^evt_[A-Za-z0-9_-]{8,128}$/,art:/^art_[A-Za-z0-9_-]{8,128}$/};function isTraceId(prefix,value){return typeof value=="string"&&ID_PATTERNS[prefix].test(value)}var TRACE_ENV={spoolDir:"HUMAIN_TERMINAL_TRACE_SPOOL_DIR",generationId:"HUMAIN_TERMINAL_TRACE_GENERATION_ID",agentId:"HUMAIN_TERMINAL_TRACE_AGENT_ID",attemptId:"HUMAIN_TERMINAL_TRACE_ATTEMPT_ID",parentAgentId:"HUMAIN_TERMINAL_TRACE_PARENT_AGENT_ID",attemptNumber:"HUMAIN_TERMINAL_TRACE_ATTEMPT_NUMBER",retryOfAttemptId:"HUMAIN_TERMINAL_TRACE_RETRY_OF_ATTEMPT_ID",lifecycleOwner:"HUMAIN_TERMINAL_TRACE_LIFECYCLE_OWNER",environmentId:"HUMAIN_TERMINAL_TRACE_ENVIRONMENT_ID",projectId:"HUMAIN_TERMINAL_TR\
|
|
3
|
+
ACE_PROJECT_ID",externalIds:"HUMAIN_TERMINAL_TRACE_EXTERNAL_IDS",ingestUrl:"HUMAIN_TERMINAL_TRACE_INGEST_URL",ingestToken:"HUMAIN_TERMINAL_TRACE_INGEST_TOKEN"};function traceCaptureDisabledReason(config,activation){if(activation?.enabled!==!0)return"not_enabled";let{policy,syntheticAttestation}=activation;if(activation.environment!=="local"||policy?.kind!=="synthetic-local"||policy.syntheticOnly!==!0||typeof policy.revision!="string"||policy.revision.trim()==="")return"not_authorized";if(!Array.
|
|
4
|
+
isArray(policy.environmentIds)||!policy.environmentIds.includes(config.tenantScope.environmentId)||!Array.isArray(policy.projectIds)||!policy.projectIds.includes(config.tenantScope.projectId))return"scope_not_in_policy";if(syntheticAttestation?.syntheticBindings!==!0||syntheticAttestation.nonProductionResources!==!0||syntheticAttestation.spoolDir!==config.spoolDir||syntheticAttestation.ingestUrl!==config.ingestUrl)return"synthetic_exception_conditions_unmet";if(config.ingestUrl!==void 0){let url=new URL(
|
|
5
|
+
config.ingestUrl);if(url.protocol!=="http:"||url.hostname!=="127.0.0.1"&&url.hostname!=="[::1]"||url.username!==""||url.password!==""||url.hash!=="")return"non_local_ingest"}}var ExternalIdsValidator=lazyValidator(DhExternalIdSchema),SHORT_STRING_MAX=256;function present(env,name){let value=env[name];return value===void 0||value===""?void 0:value}function hasControlChars(value){for(let i=0;i<value.length;i++){let code=value.charCodeAt(i);if(code<32||code===127)return!0}return!1}var heldIngestToken,
|
|
6
|
+
heldIngestSecrets=new Set,intakeOverflow=!1,credentialIntake;function setTraceCredentialIntake(intake){credentialIntake=intake}function takeTraceIngestCredentials(env){for(let name of Object.keys(env)){if(name.toUpperCase()!==TRACE_ENV.ingestToken)continue;let token=env[name];delete env[name],!(token===void 0||token==="")&&(credentialIntake?.([token]),heldIngestToken=token,heldIngestSecrets.size<257?heldIngestSecrets.add(token):intakeOverflow=!0)}}function consumeTraceIngestToken(){let token=heldIngestToken;
|
|
7
|
+
return heldIngestToken=void 0,heldIngestSecrets.clear(),intakeOverflow=!1,token}function readTraceProducerConfig(env){let spoolDir=present(env,TRACE_ENV.spoolDir);if(spoolDir===void 0)return{enabled:!1};let invalid=(name,why)=>({enabled:!1,reason:`${name} ${why}`});if(spoolDir.includes("\0")||!isAbsolute(spoolDir))return invalid(TRACE_ENV.spoolDir,"must be an absolute path");let requiredId=(prefix,name)=>{let value=present(env,name);return value===void 0?invalid(name,"is required"):isTraceId(prefix,
|
|
8
|
+
value)?value:invalid(name,`must be a ${prefix}_ id`)},optionalId=(prefix,name)=>{let value=present(env,name);if(value!==void 0)return isTraceId(prefix,value)?value:invalid(name,`must be a ${prefix}_ id`)},shortString=name=>{let value=present(env,name);return value===void 0?invalid(name,"is required"):value.length>SHORT_STRING_MAX||hasControlChars(value)?invalid(name,`must be 1-${SHORT_STRING_MAX} printable characters`):value},isFailure=value=>typeof value=="object"&&value!==null,generationId=requiredId(
|
|
9
|
+
"gen",TRACE_ENV.generationId);if(isFailure(generationId))return generationId;let agentId=requiredId("agt",TRACE_ENV.agentId);if(isFailure(agentId))return agentId;let attemptId=requiredId("att",TRACE_ENV.attemptId);if(isFailure(attemptId))return attemptId;let parentAgentId=optionalId("agt",TRACE_ENV.parentAgentId);if(isFailure(parentAgentId))return parentAgentId;let retryOfAttemptId=optionalId("att",TRACE_ENV.retryOfAttemptId);if(isFailure(retryOfAttemptId))return retryOfAttemptId;if(parentAgentId===
|
|
10
|
+
agentId)return invalid(TRACE_ENV.parentAgentId,"must differ from the agent id");if(retryOfAttemptId===attemptId)return invalid(TRACE_ENV.retryOfAttemptId,"must differ from the attempt id");let attemptNumber=1,attemptNumberRaw=present(env,TRACE_ENV.attemptNumber);if(attemptNumberRaw!==void 0){if(!/^[1-9][0-9]{0,8}$/.test(attemptNumberRaw))return invalid(TRACE_ENV.attemptNumber,"must be an integer >= 1");attemptNumber=Number(attemptNumberRaw)}let lifecycleOwner="self",ownerRaw=present(env,TRACE_ENV.
|
|
11
|
+
lifecycleOwner);if(ownerRaw!==void 0){if(ownerRaw!=="self"&&ownerRaw!=="parent")return invalid(TRACE_ENV.lifecycleOwner,"must be self or parent");lifecycleOwner=ownerRaw}let environmentId=shortString(TRACE_ENV.environmentId);if(isFailure(environmentId))return environmentId;let projectId=shortString(TRACE_ENV.projectId);if(isFailure(projectId))return projectId;let externalIds=[],externalRaw=present(env,TRACE_ENV.externalIds);if(externalRaw!==void 0){let parsed;try{parsed=JSON.parse(externalRaw)}catch{
|
|
12
|
+
return invalid(TRACE_ENV.externalIds,"must be a JSON array")}if(!Array.isArray(parsed)||parsed.length>DH_MAX_EXTERNAL_IDS)return invalid(TRACE_ENV.externalIds,`must be a JSON array of at most ${DH_MAX_EXTERNAL_IDS} external ids`);for(let entry of parsed){if(!ExternalIdsValidator().Check(entry))return invalid(TRACE_ENV.externalIds,"contains an invalid external id");externalIds.push({...entry})}}let config={spoolDir:normalize(spoolDir),generationId,agentId,attemptId,attemptNumber,lifecycleOwner,tenantScope:{
|
|
13
|
+
environmentId,projectId},externalIds};parentAgentId!==void 0&&(config.parentAgentId=parentAgentId),retryOfAttemptId!==void 0&&(config.retryOfAttemptId=retryOfAttemptId);let ingestUrl=present(env,TRACE_ENV.ingestUrl);if(ingestUrl!==void 0){let url;try{url=new URL(ingestUrl)}catch{return invalid(TRACE_ENV.ingestUrl,"must be an http(s) URL")}if(url.protocol!=="https:"&&url.protocol!=="http:"||url.username!==""||url.password!=="")return invalid(TRACE_ENV.ingestUrl,"must be an http(s) URL without cre\
|
|
14
|
+
dentials");config.ingestUrl=ingestUrl}return{enabled:!0,config}}function consumeTraceProducerConfig(env){takeTraceIngestCredentials(env),takeTraceIngestCredentials(process.env);let secrets=[...heldIngestSecrets];intakeOverflow&&secrets.push("!");try{return{result:readTraceProducerConfig(env),secrets}}finally{consumeTraceIngestToken()}}function buildChildTraceEnv(parent,child){let set={[TRACE_ENV.spoolDir]:parent.spoolDir,[TRACE_ENV.generationId]:parent.generationId,[TRACE_ENV.agentId]:child.agentId,
|
|
15
|
+
[TRACE_ENV.attemptId]:child.attemptId,[TRACE_ENV.parentAgentId]:parent.agentId,[TRACE_ENV.attemptNumber]:String(child.attemptNumber),[TRACE_ENV.lifecycleOwner]:"parent",[TRACE_ENV.environmentId]:parent.tenantScope.environmentId,[TRACE_ENV.projectId]:parent.tenantScope.projectId};child.retryOfAttemptId!==void 0&&(set[TRACE_ENV.retryOfAttemptId]=child.retryOfAttemptId);let unset=[TRACE_ENV.ingestUrl,TRACE_ENV.ingestToken];return child.retryOfAttemptId===void 0&&unset.push(TRACE_ENV.retryOfAttemptId),
|
|
16
|
+
child.externalIds!==void 0&&child.externalIds.length>0?set[TRACE_ENV.externalIds]=JSON.stringify(child.externalIds):unset.push(TRACE_ENV.externalIds),{set,unset}}export{lazyValidator,mintTraceId,isTraceId,TRACE_ENV,traceCaptureDisabledReason,setTraceCredentialIntake,takeTraceIngestCredentials,consumeTraceIngestToken,readTraceProducerConfig,consumeTraceProducerConfig,buildChildTraceEnv};
|