@humain/humain-code 0.7.0 → 0.8.1
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 +160 -0
- package/README.md +2 -2
- package/dist/bundle/agent-monitor.js +1 -1
- package/dist/bundle/chunks/anthropic-messages-XFCDMGD6.js +77 -0
- package/dist/bundle/chunks/anthropic.js +25 -24
- package/dist/bundle/chunks/azure-openai-responses-F4KQM3NK.js +15 -0
- package/dist/bundle/chunks/bedrock-converse-stream.js +460 -431
- package/dist/bundle/chunks/bowser-DXKSTXFQ.js +89 -0
- package/dist/bundle/chunks/{chunk-2G7YVAVF.js → chunk-2JNJJ6SZ.js} +1 -1
- package/dist/bundle/chunks/{chunk-HTA325LJ.js → chunk-2NVGOSBN.js} +1 -1
- package/dist/bundle/chunks/{chunk-5B25YXF7.js → chunk-3CGMVKHA.js} +13 -3
- package/dist/bundle/chunks/{chunk-SCINMV4X.js → chunk-46C6D7UC.js} +22 -21
- package/dist/bundle/chunks/chunk-4MKATHT2.js +24 -0
- package/dist/bundle/chunks/{chunk-TGDPZCSW.js → chunk-4TDNOR36.js} +1 -1
- package/dist/bundle/chunks/{chunk-C6VERWRZ.js → chunk-4XF5JX7X.js} +1 -1
- package/dist/bundle/chunks/{chunk-4HTVBBJD.js → chunk-65FLSKDA.js} +2 -2
- package/dist/bundle/chunks/chunk-6HTHDVJC.js +4 -0
- package/dist/bundle/chunks/{chunk-4PRNKB6V.js → chunk-6P6MMQUH.js} +7 -7
- package/dist/bundle/chunks/{chunk-66FZJO75.js → chunk-6TTMNQXI.js} +472 -3924
- package/dist/bundle/chunks/{chunk-32QLLD2P.js → chunk-6YVORXTX.js} +410 -352
- package/dist/bundle/chunks/chunk-7H2WNBX7.js +11 -0
- package/dist/bundle/chunks/{chunk-2FYYW6FY.js → chunk-7OZNMWAJ.js} +1 -1
- package/dist/bundle/chunks/{chunk-R6YQR7TZ.js → chunk-7WE77IE3.js} +1 -1
- package/dist/bundle/chunks/{chunk-Z5YLKK3S.js → chunk-7WETECIB.js} +1 -1
- package/dist/bundle/chunks/chunk-7X6DNT45.js +78 -0
- package/dist/bundle/chunks/{chunk-KRCX3ZBA.js → chunk-APNPBT7Y.js} +1 -1
- package/dist/bundle/chunks/{chunk-R5OOX7RW.js → chunk-B47PNNLL.js} +9 -2
- package/dist/bundle/chunks/{chunk-PPBDDQHP.js → chunk-CQ2CE3RB.js} +7 -6
- package/dist/bundle/chunks/{chunk-MD7K7RPN.js → chunk-D3KYOSQY.js} +1 -1
- package/dist/bundle/chunks/{chunk-I3NDOUHE.js → chunk-DCXHRP6C.js} +1 -1
- package/dist/bundle/chunks/{chunk-OB332KMV.js → chunk-DD5UT56Y.js} +46 -32
- package/dist/bundle/chunks/{chunk-I5E7RQ5V.js → chunk-DJG2WUNM.js} +5 -5
- package/dist/bundle/chunks/{chunk-4QAXV5T6.js → chunk-E7OBH44W.js} +9 -9
- package/dist/bundle/chunks/{chunk-Q7VXYXY3.js → chunk-ENBDASDN.js} +2 -2
- package/dist/bundle/chunks/{chunk-RS6PZK35.js → chunk-F2H47FRF.js} +249 -216
- package/dist/bundle/chunks/{chunk-2H3LUS62.js → chunk-FJIISX5W.js} +241 -229
- package/dist/bundle/chunks/chunk-FQ4KS5S4.js +23 -0
- package/dist/bundle/chunks/{chunk-SSRCVJZK.js → chunk-GPLWWO5Q.js} +5 -5
- package/dist/bundle/chunks/{chunk-WQOOJP7U.js → chunk-GV5OVRKK.js} +1 -1
- package/dist/bundle/chunks/{chunk-KTSJYIYC.js → chunk-HHWVVNGG.js} +1 -1
- package/dist/bundle/chunks/{chunk-4JRER4XK.js → chunk-HQMUDHC3.js} +19 -19
- package/dist/bundle/chunks/{chunk-G4QPSFBF.js → chunk-IMUFBWEK.js} +216 -223
- package/dist/bundle/chunks/{chunk-RU7ADKA7.js → chunk-J4GII2EE.js} +112 -96
- package/dist/bundle/chunks/{chunk-QT6ZHDMP.js → chunk-JBSWWCT5.js} +1 -1
- package/dist/bundle/chunks/{chunk-PWUDFU5V.js → chunk-JWOPWHVH.js} +4 -4
- package/dist/bundle/chunks/{chunk-AEWYICBL.js → chunk-KI7CHPWC.js} +2 -2
- package/dist/bundle/chunks/{chunk-4V5VL2BO.js → chunk-KLSRGGOH.js} +131 -154
- package/dist/bundle/chunks/{chunk-JF7FYXAI.js → chunk-KONLZKPL.js} +7 -6
- package/dist/bundle/chunks/{chunk-N2SNMUD3.js → chunk-KRBELWQH.js} +1 -1
- package/dist/bundle/chunks/{chunk-UZNIPOGS.js → chunk-L4J7SMJB.js} +1 -1
- package/dist/bundle/chunks/{chunk-EIC7CQX3.js → chunk-LSRXA7OS.js} +1 -1
- package/dist/bundle/chunks/{chunk-GRJUKEE3.js → chunk-MIAXMK5F.js} +4 -4
- package/dist/bundle/chunks/chunk-MPRAQ6ZI.js +41 -0
- package/dist/bundle/chunks/{chunk-GUHNFZ2Q.js → chunk-NICPFMOP.js} +20 -19
- package/dist/bundle/chunks/{chunk-WAPZN4KP.js → chunk-P2Y2H7SD.js} +2 -2
- package/dist/bundle/chunks/{chunk-T7BXP46S.js → chunk-P42E6YY6.js} +1892 -1680
- package/dist/bundle/chunks/{chunk-3EDMWQ35.js → chunk-PFBAIRCY.js} +17 -15
- package/dist/bundle/chunks/{chunk-XHDVDJM7.js → chunk-PVNXN2TC.js} +7 -7
- package/dist/bundle/chunks/{chunk-TWAHPPXN.js → chunk-PWFM6AQQ.js} +1307 -1194
- package/dist/bundle/chunks/{chunk-RNBZBCH2.js → chunk-QJB5YI3I.js} +1 -1
- package/dist/bundle/chunks/{chunk-P6AXBESH.js → chunk-QRRVZYTG.js} +1119 -1098
- package/dist/bundle/chunks/{chunk-WQ7EJQIT.js → chunk-ROFZVEFN.js} +247 -250
- package/dist/bundle/chunks/chunk-SKCJ25SX.js +24 -0
- package/dist/bundle/chunks/{chunk-AZXVJN6E.js → chunk-SXOIQWNX.js} +1 -1
- package/dist/bundle/chunks/{chunk-6E6RHNOU.js → chunk-UXM4WFLH.js} +12 -11
- package/dist/bundle/chunks/{chunk-LB4CIS4F.js → chunk-VCMXBP5S.js} +17 -17
- package/dist/bundle/chunks/{chunk-JYWUOKOI.js → chunk-WBSGWISD.js} +367 -353
- package/dist/bundle/chunks/chunk-XZ7FTBXS.js +2102 -0
- package/dist/bundle/chunks/chunk-YSWDFV2L.js +11 -0
- package/dist/bundle/chunks/chunk-ZG74NES2.js +2 -0
- package/dist/bundle/chunks/chunk-ZTG5OKI7.js +3 -0
- package/dist/bundle/chunks/{cli-H4LJNE2V.js → cli-6DJO467D.js} +2 -2
- package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-T5R2RVFQ.js → cloudflare-workers-ai-system-one-JEZVYITT.js} +1 -1
- package/dist/bundle/chunks/codemode-worker.js +68 -68
- package/dist/bundle/chunks/compat-SRCNS6OQ.js +15 -0
- package/dist/bundle/chunks/curator-server-QB4GITGS.js +3600 -0
- package/dist/bundle/chunks/dist-35STTNYA.js +37 -0
- package/dist/bundle/chunks/{dist-FMWWM4H7.js → dist-4OMLHRJE.js} +2 -2
- package/dist/bundle/chunks/dist-CBODG4CA.js +11 -0
- package/dist/bundle/chunks/{dist-NHQTBDHT.js → dist-TRAK7EXI.js} +91 -257
- package/dist/bundle/chunks/dist-cjs-EROMDUKS.js +193 -0
- package/dist/bundle/chunks/{easter-egg-3d-BUEOC3NO.js → easter-egg-3d-VVUF3C3X.js} +1 -1
- package/dist/bundle/chunks/entry-2GZ3PTWQ.js +2 -0
- package/dist/bundle/chunks/{entry-A2CSLKHC.js → entry-SRYLSS5P.js} +3 -3
- package/dist/bundle/chunks/{event-streams-7YGFEPBZ.js → event-streams-F67JLS6B.js} +1 -1
- package/dist/bundle/chunks/{execute-MY5JSEPV.js → execute-I3WGGPWL.js} +2 -2
- package/dist/bundle/chunks/{extract-PTGACPGP.js → extract-L373D6O7.js} +68 -65
- package/dist/bundle/chunks/{flow-implementer-APJFY4YI.js → flow-implementer-4KO3Q4B5.js} +8 -9
- package/dist/bundle/chunks/github-copilot.js +53 -46
- package/dist/bundle/chunks/google-generative-ai-WIASMWS3.js +22 -0
- package/dist/bundle/chunks/google-vertex-WSPHRZIZ.js +25 -0
- package/dist/bundle/chunks/host-WOLZCWQQ.js +3 -0
- package/dist/bundle/chunks/image-resize-worker.js +3 -3
- package/dist/bundle/chunks/{index.bundle-THL4EUSU.js → index.bundle-HONF3PUD.js} +177 -176
- package/dist/bundle/chunks/{inprocess-5NP5VJHZ.js → inprocess-TOBRVK4C.js} +6 -6
- package/dist/bundle/chunks/interactive-mode-BJJKPBXD.js +5 -0
- package/dist/bundle/chunks/{llama-cpp-classify-GJAXULWL.js → llama-cpp-classify-KYZT532X.js} +1 -1
- package/dist/bundle/chunks/mistral-conversations-7JYDDRUT.js +43 -0
- package/dist/bundle/chunks/{node-UNHECG4X.js → node-MHHE76P4.js} +475 -440
- package/dist/bundle/chunks/{node-ZFIIS5IM.js → node-N7TPBUJB.js} +53 -30
- package/dist/bundle/chunks/{openai-codex-responses-S7CMCAOY.js → openai-codex-responses-7PAML4NF.js} +30 -29
- package/dist/bundle/chunks/openai-codex.js +9 -8
- package/dist/bundle/chunks/{openai-completions-2Z57N7PC.js → openai-completions-UJDAIGTK.js} +22 -22
- package/dist/bundle/chunks/{openai-decisions-JIOJDB4C.js → openai-decisions-JMSDGR7K.js} +1 -1
- package/dist/bundle/chunks/{openai-responses-5VBZSTHL.js → openai-responses-2WNCE6AY.js} +4 -5
- package/dist/bundle/chunks/{openrouter-images-S6O7DBEJ.js → openrouter-images-V3UCCO6X.js} +1 -1
- package/dist/bundle/chunks/openrouter.js +9 -8
- package/dist/bundle/chunks/pdfjs-FE3L72A6.js +3662 -0
- package/dist/bundle/chunks/{pdfjs-decoders-OFXX4HDZ.js → pdfjs-decoders-VCMCTQJ2.js} +1 -1
- package/dist/bundle/chunks/pdfjs-jbig2_nowasm_fallback-I4K6AIV4.js +295 -0
- package/dist/bundle/chunks/pdfjs-openjpeg-PYQCV6CM.js +590 -0
- package/dist/bundle/chunks/pdfjs-openjpeg_nowasm_fallback-G363SGDI.js +775 -0
- package/dist/bundle/chunks/{pi-messages-SMLN5J2W.js → pi-messages-TQ7LJUNQ.js} +11 -11
- package/dist/bundle/chunks/radius.js +8 -7
- package/dist/bundle/chunks/{runtime-OYTWXIUM.js → runtime-H7LYNKCZ.js} +1 -1
- package/dist/bundle/chunks/session-picker-4JQEGLDD.js +4 -0
- package/dist/bundle/chunks/startup-ui-AKTA4NDP.js +3 -0
- package/dist/bundle/chunks/{trace-command-YLDYCL55.js → trace-command-7ORDQ3JS.js} +4 -4
- package/dist/bundle/chunks/{typesafe-system-one-7BEL3H5N.js → typesafe-system-one-YP7GGN4C.js} +1 -1
- package/dist/bundle/chunks/{undici-C6S56CGI.js → undici-WVNE45GY.js} +1 -1
- package/dist/bundle/chunks/virtual-modules-3CT5BMBA.js +28 -0
- package/dist/bundle/cli-runtime.js +5 -5
- package/dist/bundle/flow/package.json +5 -5
- package/dist/bundle/index.js +13 -13
- package/dist/bundle/orchestrate/package.json +22 -6
- package/dist/bundle/rpc-entry.js +4 -5
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +4 -3
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/config-selector.d.ts.map +1 -1
- package/dist/cli/config-selector.js +9 -6
- package/dist/cli/config-selector.js.map +1 -1
- package/dist/cli/list-models.d.ts.map +1 -1
- package/dist/cli/list-models.js +16 -1
- package/dist/cli/list-models.js.map +1 -1
- package/dist/cli/session-picker.d.ts.map +1 -1
- package/dist/cli/session-picker.js +9 -6
- package/dist/cli/session-picker.js.map +1 -1
- package/dist/cli/setup.d.ts +1 -1
- package/dist/cli/setup.d.ts.map +1 -1
- package/dist/cli/setup.js +3 -2
- package/dist/cli/setup.js.map +1 -1
- package/dist/cli/startup-ui.d.ts.map +1 -1
- package/dist/cli/startup-ui.js +8 -4
- package/dist/cli/startup-ui.js.map +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts +14 -0
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +30 -2
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session-services.d.ts +0 -2
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +0 -2
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session.d.ts +31 -39
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +231 -535
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/anthropic-subscription-usage.d.ts +4 -2
- package/dist/core/anthropic-subscription-usage.d.ts.map +1 -1
- package/dist/core/anthropic-subscription-usage.js +32 -16
- package/dist/core/anthropic-subscription-usage.js.map +1 -1
- package/dist/core/auto-session-namer.js +1 -1
- package/dist/core/auto-session-namer.js.map +1 -1
- package/dist/core/cache-warmer.d.ts.map +1 -1
- package/dist/core/cache-warmer.js +2 -0
- package/dist/core/cache-warmer.js.map +1 -1
- package/dist/core/exec.d.ts +1 -0
- package/dist/core/exec.d.ts.map +1 -1
- package/dist/core/exec.js +4 -1
- package/dist/core/exec.js.map +1 -1
- package/dist/core/export-html/ansi-to-html.d.ts +6 -1
- package/dist/core/export-html/ansi-to-html.d.ts.map +1 -1
- package/dist/core/export-html/ansi-to-html.js +57 -20
- package/dist/core/export-html/ansi-to-html.js.map +1 -1
- package/dist/core/export-html/template.js +1 -1
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
- package/dist/core/export-html/tool-renderer.js +2 -3
- package/dist/core/export-html/tool-renderer.js.map +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +18 -1
- 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 +5 -0
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +5 -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.map +1 -1
- package/dist/core/flow-implementer.js +3 -9
- package/dist/core/flow-implementer.js.map +1 -1
- package/dist/core/keybindings.d.ts +64 -0
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +8 -0
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/model-config.d.ts +13 -0
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-registry.d.ts +3 -0
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +44 -9
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts +0 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +14 -17
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts +28 -8
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +64 -14
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/oauth-account-pool.d.ts +9 -0
- package/dist/core/oauth-account-pool.d.ts.map +1 -1
- package/dist/core/oauth-account-pool.js +138 -23
- package/dist/core/oauth-account-pool.js.map +1 -1
- package/dist/core/package-manager.d.ts +16 -0
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +46 -3
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/pi-ai-schemas.d.ts +1 -0
- package/dist/core/pi-ai-schemas.d.ts.map +1 -1
- package/dist/core/remote-catalog-provider.d.ts.map +1 -1
- package/dist/core/remote-catalog-provider.js +7 -0
- package/dist/core/remote-catalog-provider.js.map +1 -1
- package/dist/core/resource-loader.d.ts +5 -1
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +2 -0
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/run-outcome.d.ts +6 -3
- package/dist/core/run-outcome.d.ts.map +1 -1
- package/dist/core/run-outcome.js +36 -9
- package/dist/core/run-outcome.js.map +1 -1
- package/dist/core/run-preflight.d.ts +1 -1
- package/dist/core/run-preflight.d.ts.map +1 -1
- package/dist/core/run-preflight.js +19 -11
- package/dist/core/run-preflight.js.map +1 -1
- package/dist/core/sdk.d.ts +0 -6
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +9 -18
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/settings-manager.d.ts +0 -5
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +0 -9
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/settings-schema.d.ts +0 -4
- package/dist/core/settings-schema.d.ts.map +1 -1
- package/dist/core/settings-schema.js +0 -1
- package/dist/core/settings-schema.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +1 -0
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/tools/bash-jobs.d.ts.map +1 -1
- package/dist/core/tools/bash-jobs.js +2 -9
- package/dist/core/tools/bash-jobs.js.map +1 -1
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +28 -16
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/output-accumulator.d.ts.map +1 -1
- package/dist/core/tools/output-accumulator.js +4 -1
- package/dist/core/tools/output-accumulator.js.map +1 -1
- package/dist/core/tools/read.d.ts +8 -4
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +10 -15
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/renderers/read.d.ts.map +1 -1
- package/dist/core/tools/renderers/read.js +6 -2
- package/dist/core/tools/renderers/read.js.map +1 -1
- package/dist/core/tools/subagent-worktree.d.ts.map +1 -1
- package/dist/core/tools/subagent-worktree.js +2 -10
- package/dist/core/tools/subagent-worktree.js.map +1 -1
- package/dist/core/trace-client/credential-store.d.ts.map +1 -1
- package/dist/core/trace-client/credential-store.js +9 -5
- package/dist/core/trace-client/credential-store.js.map +1 -1
- package/dist/extensions/codemode/execute.js +2 -2
- package/dist/extensions/codemode/execute.js.map +1 -1
- package/dist/extensions/llama/provider.d.ts +1 -1
- package/dist/extensions/llama/provider.d.ts.map +1 -1
- package/dist/extensions/llama/provider.js +6 -4
- package/dist/extensions/llama/provider.js.map +1 -1
- package/dist/extensions/usage/account-reconnect.d.ts +5 -0
- package/dist/extensions/usage/account-reconnect.d.ts.map +1 -0
- package/dist/extensions/usage/account-reconnect.js +12 -0
- package/dist/extensions/usage/account-reconnect.js.map +1 -0
- package/dist/extensions/usage/confirmation.d.ts.map +1 -1
- package/dist/extensions/usage/confirmation.js +1 -1
- package/dist/extensions/usage/confirmation.js.map +1 -1
- package/dist/extensions/usage/hcode-overview.d.ts +6 -19
- package/dist/extensions/usage/hcode-overview.d.ts.map +1 -1
- package/dist/extensions/usage/hcode-overview.js +86 -100
- package/dist/extensions/usage/hcode-overview.js.map +1 -1
- package/dist/extensions/usage/index.d.ts.map +1 -1
- package/dist/extensions/usage/index.js +75 -99
- package/dist/extensions/usage/index.js.map +1 -1
- package/dist/extensions/usage/overview.d.ts +22 -17
- package/dist/extensions/usage/overview.d.ts.map +1 -1
- package/dist/extensions/usage/overview.js +98 -13
- package/dist/extensions/usage/overview.js.map +1 -1
- package/dist/extensions/usage/panes.d.ts +5 -0
- package/dist/extensions/usage/panes.d.ts.map +1 -0
- package/dist/extensions/usage/panes.js +10 -0
- package/dist/extensions/usage/panes.js.map +1 -0
- package/dist/extensions/usage/popup.d.ts +9 -14
- package/dist/extensions/usage/popup.d.ts.map +1 -1
- package/dist/extensions/usage/popup.js +87 -183
- package/dist/extensions/usage/popup.js.map +1 -1
- package/dist/humain/bedrock-provider/vendor/index.bundle.mjs +4 -1
- package/dist/humain/flow-command.js +1 -1
- package/dist/humain/flow-command.js.map +1 -1
- package/dist/humain/flow-loader.d.ts +9 -4
- package/dist/humain/flow-loader.d.ts.map +1 -1
- package/dist/humain/flow-loader.js +30 -21
- package/dist/humain/flow-loader.js.map +1 -1
- package/dist/humain/gateway/client.d.ts +3 -1
- package/dist/humain/gateway/client.d.ts.map +1 -1
- package/dist/humain/gateway/client.js +10 -5
- package/dist/humain/gateway/client.js.map +1 -1
- package/dist/humain/gateway/login.d.ts.map +1 -1
- package/dist/humain/gateway/login.js +160 -53
- package/dist/humain/gateway/login.js.map +1 -1
- package/dist/humain/hcode/account-store.d.ts +29 -5
- package/dist/humain/hcode/account-store.d.ts.map +1 -1
- package/dist/humain/hcode/account-store.js +224 -124
- package/dist/humain/hcode/account-store.js.map +1 -1
- package/dist/humain/hcode/account.d.ts +6 -0
- package/dist/humain/hcode/account.d.ts.map +1 -1
- package/dist/humain/hcode/account.js +348 -129
- package/dist/humain/hcode/account.js.map +1 -1
- package/dist/humain/hcode/catalog-watch.d.ts +21 -0
- package/dist/humain/hcode/catalog-watch.d.ts.map +1 -0
- package/dist/humain/hcode/catalog-watch.js +46 -0
- package/dist/humain/hcode/catalog-watch.js.map +1 -0
- package/dist/humain/hcode/contracts.d.ts +31 -1
- package/dist/humain/hcode/contracts.d.ts.map +1 -1
- package/dist/humain/hcode/contracts.js +205 -136
- package/dist/humain/hcode/contracts.js.map +1 -1
- package/dist/humain/hcode/environment.d.ts +3 -1
- package/dist/humain/hcode/environment.d.ts.map +1 -1
- package/dist/humain/hcode/environment.js +14 -2
- package/dist/humain/hcode/environment.js.map +1 -1
- package/dist/humain/hcode/facade.d.ts +26 -6
- package/dist/humain/hcode/facade.d.ts.map +1 -1
- package/dist/humain/hcode/facade.js +148 -38
- package/dist/humain/hcode/facade.js.map +1 -1
- package/dist/humain/hcode/http.d.ts +3 -1
- package/dist/humain/hcode/http.d.ts.map +1 -1
- package/dist/humain/hcode/http.js +44 -23
- package/dist/humain/hcode/http.js.map +1 -1
- package/dist/humain/hcode/images.d.ts +67 -0
- package/dist/humain/hcode/images.d.ts.map +1 -0
- package/dist/humain/hcode/images.js +465 -0
- package/dist/humain/hcode/images.js.map +1 -0
- package/dist/humain/hcode/login-copy.d.ts +28 -0
- package/dist/humain/hcode/login-copy.d.ts.map +1 -0
- package/dist/humain/hcode/login-copy.js +74 -0
- package/dist/humain/hcode/login-copy.js.map +1 -0
- package/dist/humain/hcode/login-failure.d.ts +26 -0
- package/dist/humain/hcode/login-failure.d.ts.map +1 -0
- package/dist/humain/hcode/login-failure.js +50 -0
- package/dist/humain/hcode/login-failure.js.map +1 -0
- package/dist/humain/hcode/notices.d.ts +45 -1
- package/dist/humain/hcode/notices.d.ts.map +1 -1
- package/dist/humain/hcode/notices.js +124 -7
- package/dist/humain/hcode/notices.js.map +1 -1
- package/dist/humain/hcode/provider.d.ts +9 -3
- package/dist/humain/hcode/provider.d.ts.map +1 -1
- package/dist/humain/hcode/provider.js +204 -20
- package/dist/humain/hcode/provider.js.map +1 -1
- package/dist/humain/hcode/run-credential.d.ts +21 -0
- package/dist/humain/hcode/run-credential.d.ts.map +1 -0
- package/dist/humain/hcode/run-credential.js +140 -0
- package/dist/humain/hcode/run-credential.js.map +1 -0
- package/dist/humain/hcode/sandbox.d.ts +6 -0
- package/dist/humain/hcode/sandbox.d.ts.map +1 -0
- package/dist/humain/hcode/sandbox.js +139 -0
- package/dist/humain/hcode/sandbox.js.map +1 -0
- package/dist/humain/hcode/selection.d.ts +9 -2
- package/dist/humain/hcode/selection.d.ts.map +1 -1
- package/dist/humain/hcode/selection.js +37 -6
- package/dist/humain/hcode/selection.js.map +1 -1
- package/dist/humain/hcode/transport.d.ts +14 -10
- package/dist/humain/hcode/transport.d.ts.map +1 -1
- package/dist/humain/hcode/transport.js +119 -149
- package/dist/humain/hcode/transport.js.map +1 -1
- package/dist/humain/hcode/wire.d.ts +3 -0
- package/dist/humain/hcode/wire.d.ts.map +1 -1
- package/dist/humain/hcode/wire.js +11 -0
- package/dist/humain/hcode/wire.js.map +1 -1
- package/dist/humain/metadata/contracts.d.ts +1 -0
- package/dist/humain/metadata/contracts.d.ts.map +1 -1
- package/dist/humain/metadata/contracts.js +2 -1
- package/dist/humain/metadata/contracts.js.map +1 -1
- package/dist/humain/remote/broker.d.ts +84 -0
- package/dist/humain/remote/broker.d.ts.map +1 -0
- package/dist/humain/remote/broker.js +427 -0
- package/dist/humain/remote/broker.js.map +1 -0
- package/dist/humain/remote/deny-store.d.ts +12 -0
- package/dist/humain/remote/deny-store.d.ts.map +1 -0
- package/dist/humain/remote/deny-store.js +164 -0
- package/dist/humain/remote/deny-store.js.map +1 -0
- package/dist/humain/remote/enablement.d.ts +5 -0
- package/dist/humain/remote/enablement.d.ts.map +1 -0
- package/dist/humain/remote/enablement.js +8 -0
- package/dist/humain/remote/enablement.js.map +1 -0
- package/dist/humain/remote/environment.d.ts +11 -0
- package/dist/humain/remote/environment.d.ts.map +1 -0
- package/dist/humain/remote/environment.js +19 -0
- package/dist/humain/remote/environment.js.map +1 -0
- package/dist/humain/remote/host-watch.d.ts +21 -0
- package/dist/humain/remote/host-watch.d.ts.map +1 -0
- package/dist/humain/remote/host-watch.js +186 -0
- package/dist/humain/remote/host-watch.js.map +1 -0
- package/dist/humain/remote/ipc-posix.d.ts +5 -0
- package/dist/humain/remote/ipc-posix.d.ts.map +1 -0
- package/dist/humain/remote/ipc-posix.js +29 -0
- package/dist/humain/remote/ipc-posix.js.map +1 -0
- package/dist/humain/remote/ipc-windows.d.ts +3 -0
- package/dist/humain/remote/ipc-windows.d.ts.map +1 -0
- package/dist/humain/remote/ipc-windows.js +5 -0
- package/dist/humain/remote/ipc-windows.js.map +1 -0
- package/dist/humain/remote/ipc.d.ts +10 -0
- package/dist/humain/remote/ipc.d.ts.map +1 -0
- package/dist/humain/remote/ipc.js +19 -0
- package/dist/humain/remote/ipc.js.map +1 -0
- package/dist/humain/remote/protocol.d.ts +43 -0
- package/dist/humain/remote/protocol.d.ts.map +1 -0
- package/dist/humain/remote/protocol.js +76 -0
- package/dist/humain/remote/protocol.js.map +1 -0
- package/dist/humain/remote/relay-socket.d.ts +30 -0
- package/dist/humain/remote/relay-socket.d.ts.map +1 -0
- package/dist/humain/remote/relay-socket.js +137 -0
- package/dist/humain/remote/relay-socket.js.map +1 -0
- package/dist/humain/remote/secure-channel.d.ts +10 -0
- package/dist/humain/remote/secure-channel.d.ts.map +1 -0
- package/dist/humain/remote/secure-channel.js +5 -0
- package/dist/humain/remote/secure-channel.js.map +1 -0
- package/dist/humain/remote/terminal.d.ts +48 -0
- package/dist/humain/remote/terminal.d.ts.map +1 -0
- package/dist/humain/remote/terminal.js +119 -0
- package/dist/humain/remote/terminal.js.map +1 -0
- package/dist/humain/remote/tickets.d.ts +35 -0
- package/dist/humain/remote/tickets.d.ts.map +1 -0
- package/dist/humain/remote/tickets.js +132 -0
- package/dist/humain/remote/tickets.js.map +1 -0
- package/dist/humain/web-access/vendor/anysearch.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/anysearch.js +7 -3
- package/dist/humain/web-access/vendor/anysearch.js.map +1 -1
- package/dist/humain/web-access/vendor/autom.d.ts +4 -0
- package/dist/humain/web-access/vendor/autom.d.ts.map +1 -0
- package/dist/humain/web-access/vendor/autom.js +191 -0
- package/dist/humain/web-access/vendor/autom.js.map +1 -0
- package/dist/humain/web-access/vendor/cloro.d.ts +4 -0
- package/dist/humain/web-access/vendor/cloro.d.ts.map +1 -0
- package/dist/humain/web-access/vendor/cloro.js +236 -0
- package/dist/humain/web-access/vendor/cloro.js.map +1 -0
- package/dist/humain/web-access/vendor/curator-page.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/curator-page.js +7 -1
- package/dist/humain/web-access/vendor/curator-page.js.map +1 -1
- package/dist/humain/web-access/vendor/curator-server.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/curator-server.js +6 -0
- package/dist/humain/web-access/vendor/curator-server.js.map +1 -1
- package/dist/humain/web-access/vendor/domain-filter-normalization.d.ts +8 -0
- package/dist/humain/web-access/vendor/domain-filter-normalization.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/domain-filter-normalization.js +37 -0
- package/dist/humain/web-access/vendor/domain-filter-normalization.js.map +1 -1
- package/dist/humain/web-access/vendor/duckduckgo-rate-limit.d.ts +28 -8
- package/dist/humain/web-access/vendor/duckduckgo-rate-limit.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/duckduckgo-rate-limit.js +135 -34
- package/dist/humain/web-access/vendor/duckduckgo-rate-limit.js.map +1 -1
- package/dist/humain/web-access/vendor/duckduckgo.d.ts +1 -1
- package/dist/humain/web-access/vendor/duckduckgo.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/duckduckgo.js +10 -3
- package/dist/humain/web-access/vendor/duckduckgo.js.map +1 -1
- package/dist/humain/web-access/vendor/extract.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/extract.js +61 -5
- package/dist/humain/web-access/vendor/extract.js.map +1 -1
- package/dist/humain/web-access/vendor/gemini-search.d.ts +3 -3
- package/dist/humain/web-access/vendor/gemini-search.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/gemini-search.js +35 -5
- package/dist/humain/web-access/vendor/gemini-search.js.map +1 -1
- package/dist/humain/web-access/vendor/index.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/index.js +8 -1
- package/dist/humain/web-access/vendor/index.js.map +1 -1
- package/dist/humain/web-access/vendor/page-query.d.ts +5 -0
- package/dist/humain/web-access/vendor/page-query.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/page-query.js +12 -2
- package/dist/humain/web-access/vendor/page-query.js.map +1 -1
- package/dist/humain/web-access/vendor/specstream.d.ts +6 -0
- package/dist/humain/web-access/vendor/specstream.d.ts.map +1 -0
- package/dist/humain/web-access/vendor/specstream.js +253 -0
- package/dist/humain/web-access/vendor/specstream.js.map +1 -0
- package/dist/humain/web-access/vendor/tool-activation.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/tool-activation.js +21 -5
- package/dist/humain/web-access/vendor/tool-activation.js.map +1 -1
- package/dist/humain/web-access/vendor/upgrade-notice.d.ts +1 -1
- package/dist/humain/web-access/vendor/upgrade-notice.js +1 -1
- package/dist/humain/web-access/vendor/upgrade-notice.js.map +1 -1
- package/dist/humain/web-access/vendor/utils.d.ts +1 -0
- package/dist/humain/web-access/vendor/utils.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/utils.js +3 -0
- package/dist/humain/web-access/vendor/utils.js.map +1 -1
- package/dist/humain/web-access/vendor/video-extract.js +2 -2
- package/dist/humain/web-access/vendor/video-extract.js.map +1 -1
- package/dist/humain/web-access/vendor/web-tool-core.d.ts +13 -0
- package/dist/humain/web-access/vendor/web-tool-core.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/web-tool-core.js +16 -5
- package/dist/humain/web-access/vendor/web-tool-core.js.map +1 -1
- package/dist/humain/web-access/vendor/youtube-extract.js +2 -2
- package/dist/humain/web-access/vendor/youtube-extract.js.map +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +109 -29
- package/dist/main.js.map +1 -1
- package/dist/modes/diagnostics-stderr.d.ts +4 -0
- package/dist/modes/diagnostics-stderr.d.ts.map +1 -0
- package/dist/modes/diagnostics-stderr.js +11 -0
- package/dist/modes/diagnostics-stderr.js.map +1 -0
- package/dist/modes/interactive/components/account-picker.d.ts +31 -0
- package/dist/modes/interactive/components/account-picker.d.ts.map +1 -0
- package/dist/modes/interactive/components/account-picker.js +150 -0
- package/dist/modes/interactive/components/account-picker.js.map +1 -0
- package/dist/modes/interactive/components/assistant-message.d.ts +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/config-selector.js +5 -2
- package/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-selector.js +14 -5
- package/dist/modes/interactive/components/extension-selector.js.map +1 -1
- package/dist/modes/interactive/components/first-time-setup.d.ts +1 -1
- package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -1
- package/dist/modes/interactive/components/first-time-setup.js.map +1 -1
- package/dist/modes/interactive/components/keybinding-hints.d.ts +2 -0
- package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -1
- package/dist/modes/interactive/components/keybinding-hints.js +6 -0
- package/dist/modes/interactive/components/keybinding-hints.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts +10 -0
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +101 -23
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts +5 -0
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.js +17 -6
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
- package/dist/modes/interactive/components/radius-login-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/radius-login-selector.js +2 -1
- package/dist/modes/interactive/components/radius-login-selector.js.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js +13 -6
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts +8 -1
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector.js +41 -9
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-submenu.d.ts +1 -1
- package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-submenu.js +5 -1
- package/dist/modes/interactive/components/settings-submenu.js.map +1 -1
- package/dist/modes/interactive/components/status-indicator.d.ts +0 -17
- package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
- package/dist/modes/interactive/components/status-indicator.js +1 -78
- package/dist/modes/interactive/components/status-indicator.js.map +1 -1
- package/dist/modes/interactive/components/themed-text.d.ts +1 -1
- package/dist/modes/interactive/components/themed-text.d.ts.map +1 -1
- package/dist/modes/interactive/components/themed-text.js.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.js +5 -1
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +3 -1
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/trust-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/trust-selector.js +14 -5
- package/dist/modes/interactive/components/trust-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message.d.ts +1 -1
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message.js.map +1 -1
- package/dist/modes/interactive/components/visual-truncate.d.ts +2 -2
- package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -1
- package/dist/modes/interactive/components/visual-truncate.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +35 -4
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +821 -250
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/model-catalog-refresh.d.ts +4 -0
- package/dist/modes/interactive/model-catalog-refresh.d.ts.map +1 -1
- package/dist/modes/interactive/model-catalog-refresh.js +40 -1
- package/dist/modes/interactive/model-catalog-refresh.js.map +1 -1
- package/dist/modes/interactive/oauth-account-format.d.ts +15 -2
- package/dist/modes/interactive/oauth-account-format.d.ts.map +1 -1
- package/dist/modes/interactive/oauth-account-format.js +39 -21
- package/dist/modes/interactive/oauth-account-format.js.map +1 -1
- package/dist/modes/interactive/session-share.js +2 -0
- package/dist/modes/interactive/session-share.js.map +1 -1
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +1 -0
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +30 -32
- 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 +26 -39
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +1 -0
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +14 -1
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/utils/abort.d.ts +5 -0
- package/dist/utils/abort.d.ts.map +1 -1
- package/dist/utils/abort.js +9 -0
- package/dist/utils/abort.js.map +1 -1
- package/dist/utils/changelog.d.ts.map +1 -1
- package/dist/utils/changelog.js +3 -2
- package/dist/utils/changelog.js.map +1 -1
- package/dist/utils/flush-stdout.d.ts +8 -0
- package/dist/utils/flush-stdout.d.ts.map +1 -0
- package/dist/utils/flush-stdout.js +23 -0
- package/dist/utils/flush-stdout.js.map +1 -0
- package/dist/utils/image-process.d.ts +2 -0
- package/dist/utils/image-process.d.ts.map +1 -1
- package/dist/utils/image-process.js +3 -3
- package/dist/utils/image-process.js.map +1 -1
- package/dist/utils/image-resize-core.js +2 -2
- package/dist/utils/image-resize-core.js.map +1 -1
- package/dist/utils/shell.d.ts +2 -0
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/shell.js +19 -0
- package/dist/utils/shell.js.map +1 -1
- package/docs/cli.md +1 -1
- package/docs/development.md +0 -13
- package/docs/extensions.md +6 -4
- package/docs/flow.md +4 -62
- package/docs/forge-run-bootstrap.md +46 -0
- package/docs/humain-code-forge-architecture.md +1 -47
- package/docs/humain-code-forge-flow-walkthrough.md +1 -1
- package/docs/humain-code.md +2 -2
- package/docs/index.md +2 -1
- package/docs/keybindings.md +12 -0
- package/docs/llama-cpp.md +5 -5
- package/docs/models-configuration.md +4 -2
- package/docs/nvidia-rtx-llama-cpp.md +5 -5
- package/docs/providers.md +14 -9
- package/docs/quickstart.md +16 -2
- package/docs/rpc-commands.md +1 -1
- package/docs/run-preflight.md +1 -1
- package/docs/slash-commands.md +5 -3
- package/docs/tui.md +2 -0
- package/examples/README.md +0 -3
- package/examples/extensions/custom-provider-anthropic/package-lock.json +4 -4
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/gondolin/index.ts +4 -7
- package/examples/tsconfig.json +96 -76
- package/npm-shrinkwrap.json +285 -764
- package/package.json +24 -37
- package/schemas/keybindings.schema.json +32 -0
- package/schemas/models.schema.json +5 -1
- package/schemas/settings.schema.json +0 -13
- package/src/humain/web-access/UPSTREAM.md +52 -1
- package/src/humain/web-access/upstream.json +5 -5
- package/src/humain/web-access/vendor/CHANGELOG.md +29 -0
- package/dist/bundle/chunks/adaptive-peer-worker-X2ZNZE3S.js +0 -8
- package/dist/bundle/chunks/adaptive-session-host-7KDSQV5I.js +0 -162
- package/dist/bundle/chunks/anthropic-messages-TQK3FUV3.js +0 -68
- package/dist/bundle/chunks/azure-openai-responses-JY7OSLH2.js +0 -15
- package/dist/bundle/chunks/chunk-5L4PBYC7.js +0 -11
- package/dist/bundle/chunks/chunk-6PNQYO6A.js +0 -10
- package/dist/bundle/chunks/chunk-CRN54O4D.js +0 -24
- package/dist/bundle/chunks/chunk-CTU2ECLD.js +0 -7
- package/dist/bundle/chunks/chunk-DBL35X7L.js +0 -3
- package/dist/bundle/chunks/chunk-GME4AWDG.js +0 -23
- package/dist/bundle/chunks/chunk-GTILMMUF.js +0 -12
- package/dist/bundle/chunks/chunk-J57HOSWD.js +0 -21
- package/dist/bundle/chunks/chunk-KQM7ZGL6.js +0 -11
- package/dist/bundle/chunks/chunk-MX4Q4W6H.js +0 -214
- package/dist/bundle/chunks/chunk-NXA6NEHE.js +0 -54
- package/dist/bundle/chunks/chunk-PJACZCIR.js +0 -2
- package/dist/bundle/chunks/chunk-T5A6T24H.js +0 -93
- package/dist/bundle/chunks/chunk-WCFHG6NO.js +0 -16
- package/dist/bundle/chunks/chunk-ZJUU6WOV.js +0 -2052
- package/dist/bundle/chunks/compat-ZK2DIW3P.js +0 -15
- package/dist/bundle/chunks/dist-EY7YKQHB.js +0 -11
- package/dist/bundle/chunks/dist-J5IUPLMH.js +0 -37
- package/dist/bundle/chunks/dist-cjs-2SKN226B.js +0 -184
- package/dist/bundle/chunks/entry-AL54ZGYO.js +0 -2
- package/dist/bundle/chunks/es5-GYTRHFKS.js +0 -77
- package/dist/bundle/chunks/google-generative-ai-UL7YEQ6J.js +0 -21
- package/dist/bundle/chunks/google-vertex-OTMSPUYH.js +0 -26
- package/dist/bundle/chunks/host-75YAHLDR.js +0 -3
- package/dist/bundle/chunks/interactive-mode-IW4PIVAQ.js +0 -5
- package/dist/bundle/chunks/mistral-conversations-E72Y6OC3.js +0 -43
- package/dist/bundle/chunks/pdfjs-AKD6EBKN.js +0 -3614
- package/dist/bundle/chunks/pdfjs-jbig2_nowasm_fallback-FH3KJM4H.js +0 -326
- package/dist/bundle/chunks/pdfjs-openjpeg-SKR7C34X.js +0 -671
- package/dist/bundle/chunks/pdfjs-openjpeg_nowasm_fallback-VUBL7UEE.js +0 -974
- package/dist/bundle/chunks/session-picker-DM6S37IF.js +0 -4
- package/dist/bundle/chunks/startup-ui-4GGLWNSU.js +0 -3
- package/dist/bundle/chunks/virtual-modules-TI3W24YL.js +0 -28
- package/dist/core/internal-process.d.ts +0 -23
- package/dist/core/internal-process.d.ts.map +0 -1
- package/dist/core/internal-process.js +0 -88
- package/dist/core/internal-process.js.map +0 -1
- package/dist/humain/adaptive-execution.d.ts +0 -51
- package/dist/humain/adaptive-execution.d.ts.map +0 -1
- package/dist/humain/adaptive-execution.js +0 -100
- package/dist/humain/adaptive-execution.js.map +0 -1
- package/dist/humain/adaptive-peer-process.d.ts +0 -44
- package/dist/humain/adaptive-peer-process.d.ts.map +0 -1
- package/dist/humain/adaptive-peer-process.js +0 -159
- package/dist/humain/adaptive-peer-process.js.map +0 -1
- package/dist/humain/adaptive-peer-worker.d.ts +0 -3
- package/dist/humain/adaptive-peer-worker.d.ts.map +0 -1
- package/dist/humain/adaptive-peer-worker.js +0 -122
- package/dist/humain/adaptive-peer-worker.js.map +0 -1
- package/dist/humain/adaptive-runtime-types.d.ts +0 -621
- package/dist/humain/adaptive-runtime-types.d.ts.map +0 -1
- package/dist/humain/adaptive-runtime-types.js +0 -3
- package/dist/humain/adaptive-runtime-types.js.map +0 -1
- package/dist/humain/adaptive-session-host.d.ts +0 -113
- package/dist/humain/adaptive-session-host.d.ts.map +0 -1
- package/dist/humain/adaptive-session-host.js +0 -1838
- package/dist/humain/adaptive-session-host.js.map +0 -1
- package/dist/utils/deprecation.d.ts +0 -4
- package/dist/utils/deprecation.d.ts.map +0 -1
- package/dist/utils/deprecation.js +0 -13
- package/dist/utils/deprecation.js.map +0 -1
- package/examples/plugins/pi-example-plugin/README.md +0 -38
- package/examples/plugins/pi-example-plugin/package.json +0 -10
- package/examples/plugins/pi-example-plugin/src/contract.ts +0 -13
- package/examples/plugins/pi-example-plugin/src/session.ts +0 -24
- package/examples/plugins/pi-example-plugin/src/tui.ts +0 -31
|
@@ -24,8 +24,8 @@ function source(value) {
|
|
|
24
24
|
}
|
|
25
25
|
/** Parse trusted-origin discovery data before the account owner qualifies the issuer. */
|
|
26
26
|
export function parseHcodeCliConfig(value) {
|
|
27
|
-
const v = wire.
|
|
28
|
-
const auth = wire.
|
|
27
|
+
const v = wire.fields(value, ["schemaVersion", "environmentId", "origin", "inferenceBaseUrl", "auth"]);
|
|
28
|
+
const auth = wire.fields(v.auth, [
|
|
29
29
|
"kind",
|
|
30
30
|
"issuer",
|
|
31
31
|
"clientId",
|
|
@@ -79,7 +79,7 @@ export function parseHcodeCliConfig(value) {
|
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
81
|
export function parseHcodeAccount(value) {
|
|
82
|
-
const v = wire.
|
|
82
|
+
const v = wire.fields(value, [
|
|
83
83
|
"schemaVersion",
|
|
84
84
|
"accountId",
|
|
85
85
|
"environmentId",
|
|
@@ -88,7 +88,7 @@ export function parseHcodeAccount(value) {
|
|
|
88
88
|
"role",
|
|
89
89
|
"eligibility",
|
|
90
90
|
]);
|
|
91
|
-
const eligibility = wire.
|
|
91
|
+
const eligibility = wire.fields(v.eligibility, ["kind"]);
|
|
92
92
|
const email = wire.nullable(v.email, (entry) => wire.string(entry, 320));
|
|
93
93
|
if (email !== null &&
|
|
94
94
|
!/^(?:[A-Za-z0-9_'+-]+\.)*[A-Za-z0-9_'+-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9-]*\.)+[A-Za-z]{2,}$/.test(email))
|
|
@@ -104,46 +104,37 @@ export function parseHcodeAccount(value) {
|
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
106
|
function parseValue(value) {
|
|
107
|
-
const v = wire.
|
|
107
|
+
const v = wire.fields(value, ["kind", "value"]);
|
|
108
108
|
if (v.kind === "known")
|
|
109
109
|
return { kind: "known", value: wire.integer(v.value) };
|
|
110
|
-
wire.object(value, ["kind"]);
|
|
111
110
|
return { kind: wire.member(v.kind, ["unknown", "redacted", "unavailable"]) };
|
|
112
111
|
}
|
|
112
|
+
const tokenKeys = ["input", "output", "cacheRead", "cacheWrite", "total"];
|
|
113
113
|
function parseTokens(value, max = 2147483647) {
|
|
114
|
-
|
|
114
|
+
// Statement and allowance totals are shown as sent.
|
|
115
|
+
return readTokenCounts(wire.fields(value, tokenKeys), max, parseValue);
|
|
116
|
+
}
|
|
117
|
+
function readTokenCounts(v, max, parse) {
|
|
115
118
|
const result = {
|
|
116
|
-
input:
|
|
117
|
-
output:
|
|
118
|
-
cacheRead:
|
|
119
|
-
cacheWrite:
|
|
120
|
-
total:
|
|
119
|
+
input: parse(v.input),
|
|
120
|
+
output: parse(v.output),
|
|
121
|
+
cacheRead: parse(v.cacheRead),
|
|
122
|
+
cacheWrite: parse(v.cacheWrite),
|
|
123
|
+
total: parse(v.total),
|
|
121
124
|
};
|
|
122
125
|
for (const token of Object.values(result))
|
|
123
126
|
if (token.kind === "known")
|
|
124
127
|
wire.integer(token.value, max);
|
|
125
|
-
if (result.input.kind === "known") {
|
|
126
|
-
if (result.output.kind === "known" &&
|
|
127
|
-
result.total.kind === "known" &&
|
|
128
|
-
(!Number.isSafeInteger(result.input.value + result.output.value) ||
|
|
129
|
-
result.total.value !== result.input.value + result.output.value))
|
|
130
|
-
return wire.invalid();
|
|
131
|
-
if ((result.cacheRead.kind === "known" ? result.cacheRead.value : 0) +
|
|
132
|
-
(result.cacheWrite.kind === "known" ? result.cacheWrite.value : 0) >
|
|
133
|
-
result.input.value)
|
|
134
|
-
return wire.invalid();
|
|
135
|
-
}
|
|
136
128
|
return result;
|
|
137
129
|
}
|
|
138
130
|
function parseAllowance(value) {
|
|
139
|
-
const v = wire.
|
|
131
|
+
const v = wire.fields(value, ["kind", "limitMicrocents"]);
|
|
140
132
|
if (v.kind === "limited")
|
|
141
133
|
return { kind: "limited", limitMicrocents: wire.integer(v.limitMicrocents) };
|
|
142
|
-
wire.object(value, ["kind"]);
|
|
143
134
|
return { kind: wire.literal(v.kind, "unlimited") };
|
|
144
135
|
}
|
|
145
136
|
function parseUsageSource(value) {
|
|
146
|
-
const v = wire.
|
|
137
|
+
const v = wire.fields(value, ["surface", "actual", "reserved", "tokens"]);
|
|
147
138
|
return {
|
|
148
139
|
surface: source(v.surface),
|
|
149
140
|
actual: parseValue(v.actual),
|
|
@@ -152,7 +143,7 @@ function parseUsageSource(value) {
|
|
|
152
143
|
};
|
|
153
144
|
}
|
|
154
145
|
function parseUsageItem(value) {
|
|
155
|
-
const v = wire.
|
|
146
|
+
const v = wire.fields(value, [
|
|
156
147
|
"id",
|
|
157
148
|
"at",
|
|
158
149
|
"surface",
|
|
@@ -186,7 +177,7 @@ function parseUsageItem(value) {
|
|
|
186
177
|
};
|
|
187
178
|
}
|
|
188
179
|
export function parseHcodeUsage(value) {
|
|
189
|
-
const v = wire.
|
|
180
|
+
const v = wire.fields(value, [
|
|
190
181
|
"schemaVersion",
|
|
191
182
|
"accountId",
|
|
192
183
|
"environmentId",
|
|
@@ -240,6 +231,56 @@ export function parseHcodeUsageQuery(value) {
|
|
|
240
231
|
};
|
|
241
232
|
}
|
|
242
233
|
const efforts = ["off", "minimal", "low", "medium", "high", "xhigh", "max"];
|
|
234
|
+
/** Header naming why a successful catalog is empty; Forge keeps the body closed for released clients. */
|
|
235
|
+
export const HCODE_CATALOG_EMPTY_REASON_HEADER = "x-hcode-catalog-empty-reason";
|
|
236
|
+
const HCODE_CATALOG_EMPTY_REASONS = [
|
|
237
|
+
"no_cli_models_approved",
|
|
238
|
+
"provider_key_not_cli_enabled",
|
|
239
|
+
"cli_capacity_unconfigured",
|
|
240
|
+
"provider_key_not_dedicated",
|
|
241
|
+
"models_not_qualified",
|
|
242
|
+
];
|
|
243
|
+
/** Accepts only a known reason code; unknown or missing values are dropped, never displayed. */
|
|
244
|
+
export function parseHcodeCatalogEmptyReason(value) {
|
|
245
|
+
return HCODE_CATALOG_EMPTY_REASONS.find((reason) => reason === value);
|
|
246
|
+
}
|
|
247
|
+
/** Header naming approved models Forge left out of this account's catalog and why (URL-encoded JSON array). */
|
|
248
|
+
export const HCODE_CATALOG_EXCLUSIONS_HEADER = "x-hcode-catalog-exclusions";
|
|
249
|
+
const HCODE_CATALOG_EXCLUSION_REASONS = [
|
|
250
|
+
"missing_trusted_metadata",
|
|
251
|
+
"credential_unavailable",
|
|
252
|
+
"provider_quota_isolation_unverified",
|
|
253
|
+
"quota_mapping_unavailable",
|
|
254
|
+
];
|
|
255
|
+
// Forge caps the encoded header at 3072 characters; anything larger is not Forge's diagnostic.
|
|
256
|
+
const HCODE_CATALOG_EXCLUSIONS_MAX_CHARS = 3072;
|
|
257
|
+
/**
|
|
258
|
+
* Maps catalog model IDs (`provider/model`) to Forge's known exclusion reason. Malformed, oversized or
|
|
259
|
+
* unknown data yields an empty map so the generic refusal is kept; reasons are codes, never server text.
|
|
260
|
+
*/
|
|
261
|
+
export function parseHcodeCatalogExclusions(value) {
|
|
262
|
+
const exclusions = new Map();
|
|
263
|
+
if (!value || value.length > HCODE_CATALOG_EXCLUSIONS_MAX_CHARS)
|
|
264
|
+
return exclusions;
|
|
265
|
+
try {
|
|
266
|
+
const rows = JSON.parse(decodeURIComponent(value));
|
|
267
|
+
if (!Array.isArray(rows))
|
|
268
|
+
return exclusions;
|
|
269
|
+
for (const row of rows) {
|
|
270
|
+
if (!row || typeof row !== "object" || Array.isArray(row) || Object.keys(row).length !== 3)
|
|
271
|
+
return new Map();
|
|
272
|
+
const { provider, model, reason: code } = row;
|
|
273
|
+
const reason = HCODE_CATALOG_EXCLUSION_REASONS.find((known) => known === code);
|
|
274
|
+
if (typeof provider !== "string" || typeof model !== "string" || !reason || !provider || !model)
|
|
275
|
+
return new Map();
|
|
276
|
+
exclusions.set(`${provider}/${model}`, reason);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
catch {
|
|
280
|
+
return new Map();
|
|
281
|
+
}
|
|
282
|
+
return exclusions;
|
|
283
|
+
}
|
|
243
284
|
const bytes = (value) => new TextEncoder().encode(value).length;
|
|
244
285
|
function scalar(value, max = 1048576, min = 0) {
|
|
245
286
|
const text = wire.string(value, max, min);
|
|
@@ -358,18 +399,17 @@ function jsonSchema(value) {
|
|
|
358
399
|
refs(parsed, "schema");
|
|
359
400
|
return parsed;
|
|
360
401
|
}
|
|
361
|
-
function rates(value
|
|
362
|
-
const v = wire.
|
|
402
|
+
function rates(value) {
|
|
403
|
+
const v = wire.fields(value, ["input", "output", "cacheRead", "cacheWrite"]);
|
|
363
404
|
return {
|
|
364
405
|
input: wire.number(v.input),
|
|
365
406
|
output: wire.number(v.output),
|
|
366
407
|
cacheRead: wire.number(v.cacheRead),
|
|
367
408
|
cacheWrite: wire.number(v.cacheWrite),
|
|
368
|
-
...(tier ? { inputTokensAbove: wire.integer(v.inputTokensAbove) } : {}),
|
|
369
409
|
};
|
|
370
410
|
}
|
|
371
411
|
function parseModel(value) {
|
|
372
|
-
const v = wire.
|
|
412
|
+
const v = wire.fields(value, [
|
|
373
413
|
"id",
|
|
374
414
|
"name",
|
|
375
415
|
"api",
|
|
@@ -389,7 +429,7 @@ function parseModel(value) {
|
|
|
389
429
|
const input = wire.array(v.input, (entry) => wire.member(entry, ["text", "image"]), 2, 1);
|
|
390
430
|
if (input[0] !== "text" || (input.length === 2 && input[1] !== "image"))
|
|
391
431
|
return wire.invalid();
|
|
392
|
-
const map = wire.
|
|
432
|
+
const map = wire.fields(v.thinkingLevelMap, efforts);
|
|
393
433
|
const thinkingLevelMap = {};
|
|
394
434
|
for (const effort of efforts)
|
|
395
435
|
thinkingLevelMap[effort] = map[effort] === null ? null : wire.literal(map[effort], effort);
|
|
@@ -399,32 +439,25 @@ function parseModel(value) {
|
|
|
399
439
|
if (!efforts.some((e) => thinkingLevelMap[e] !== null) ||
|
|
400
440
|
(reasoning && !efforts.some((e) => e !== "off" && thinkingLevelMap[e] !== null)))
|
|
401
441
|
return wire.invalid();
|
|
402
|
-
const costRecord = wire.
|
|
403
|
-
const cost = {
|
|
404
|
-
...rates({
|
|
405
|
-
input: costRecord.input,
|
|
406
|
-
output: costRecord.output,
|
|
407
|
-
cacheRead: costRecord.cacheRead,
|
|
408
|
-
cacheWrite: costRecord.cacheWrite,
|
|
409
|
-
}),
|
|
410
|
-
};
|
|
442
|
+
const costRecord = wire.fields(v.cost, ["input", "output", "cacheRead", "cacheWrite", "tiers"]);
|
|
443
|
+
const cost = { ...rates(costRecord) };
|
|
411
444
|
if (costRecord.tiers !== undefined) {
|
|
412
|
-
const tiers = wire.array(costRecord.tiers, (entry) => {
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
}, 1024);
|
|
445
|
+
const tiers = wire.array(costRecord.tiers, (entry) => ({
|
|
446
|
+
...rates(entry),
|
|
447
|
+
inputTokensAbove: wire.integer(wire.fields(entry, ["inputTokensAbove"]).inputTokensAbove),
|
|
448
|
+
}), 1024);
|
|
416
449
|
if (tiers.some((entry, i) => entry.inputTokensAbove <= (tiers[i - 1]?.inputTokensAbove ?? -1)))
|
|
417
450
|
return wire.invalid();
|
|
418
451
|
cost.tiers = tiers;
|
|
419
452
|
}
|
|
420
|
-
const limits = wire.
|
|
453
|
+
const limits = wire.fields(v.inputLimits, ["maxRequestBytes", "images"]);
|
|
421
454
|
const inputLimits = {};
|
|
422
455
|
if (limits.maxRequestBytes !== undefined)
|
|
423
456
|
inputLimits.maxRequestBytes = wire.integer(limits.maxRequestBytes, 12582912, 1);
|
|
424
457
|
if (limits.images !== undefined) {
|
|
425
458
|
if (input.length !== 2)
|
|
426
459
|
return wire.invalid();
|
|
427
|
-
const image = wire.
|
|
460
|
+
const image = wire.fields(limits.images, ["resize", "maxPerMessage", "maxPerRequest"]), resize = wire.fields(image.resize, ["maxWidth", "maxHeight", "maxBytes", "jpegQuality"]);
|
|
428
461
|
inputLimits.images = {
|
|
429
462
|
maxPerMessage: wire.integer(image.maxPerMessage, 4, 1),
|
|
430
463
|
maxPerRequest: wire.integer(image.maxPerRequest, 4, 1),
|
|
@@ -459,8 +492,7 @@ function parseModel(value) {
|
|
|
459
492
|
};
|
|
460
493
|
}
|
|
461
494
|
export function parseHcodeModelList(value) {
|
|
462
|
-
|
|
463
|
-
const v = wire.object(value, ["object", "data"]);
|
|
495
|
+
const v = wire.fields(value, ["object", "data"]);
|
|
464
496
|
const data = wire.array(v.data, parseModel, 1024);
|
|
465
497
|
if (new Set(data.map((model) => model.id)).size !== data.length)
|
|
466
498
|
return wire.invalid();
|
|
@@ -502,8 +534,8 @@ function thinkingBlock(value) {
|
|
|
502
534
|
return wire.invalid();
|
|
503
535
|
return result;
|
|
504
536
|
}
|
|
505
|
-
function toolCall(value) {
|
|
506
|
-
const v =
|
|
537
|
+
function toolCall(value, read) {
|
|
538
|
+
const v = read(value, ["type", "id", "name", "arguments", "thoughtSignature", "namespace", "argumentsError"]);
|
|
507
539
|
const result = {
|
|
508
540
|
type: wire.literal(v.type, "toolCall"),
|
|
509
541
|
id: ascii(v.id),
|
|
@@ -606,6 +638,20 @@ function history(v) {
|
|
|
606
638
|
}
|
|
607
639
|
}
|
|
608
640
|
function parseMessage(value) {
|
|
641
|
+
const entry = value && typeof value === "object" && "role" in value ? value : undefined;
|
|
642
|
+
const role = entry?.role;
|
|
643
|
+
const deferred = entry &&
|
|
644
|
+
(("deferred" in entry && entry.deferred !== undefined) ||
|
|
645
|
+
("stopReason" in entry && entry.stopReason === "deferred"));
|
|
646
|
+
const detail = role === "assistant" && deferred
|
|
647
|
+
? "assistant.deferred"
|
|
648
|
+
: role === "assistant" || role === "system" || role === "user" || role === "toolResult"
|
|
649
|
+
? `${role}.schema`
|
|
650
|
+
: "message.schema";
|
|
651
|
+
// Run the same strict checks; only annotate their failures with a closed element code.
|
|
652
|
+
return requestElement(detail, () => parseMessageFields(value));
|
|
653
|
+
}
|
|
654
|
+
function parseMessageFields(value) {
|
|
609
655
|
const base = wire.object(value, [
|
|
610
656
|
"role",
|
|
611
657
|
"content",
|
|
@@ -709,7 +755,7 @@ function parseMessage(value) {
|
|
|
709
755
|
return record.type === "thinking"
|
|
710
756
|
? thinkingBlock(entry)
|
|
711
757
|
: record.type === "toolCall"
|
|
712
|
-
? toolCall(entry)
|
|
758
|
+
? requestElement(record.argumentsError === undefined ? "toolCall.schema" : "toolCall.argumentsError", () => toolCall(entry, wire.object))
|
|
713
759
|
: textBlock(entry);
|
|
714
760
|
}, 2048),
|
|
715
761
|
api: scalar(v.api, 256, 1),
|
|
@@ -797,16 +843,53 @@ function parseOptions(value) {
|
|
|
797
843
|
}
|
|
798
844
|
return result;
|
|
799
845
|
}
|
|
846
|
+
export const HCODE_REQUEST_MAX_IMAGE_BYTES = 8 * 1024 * 1024;
|
|
847
|
+
export const HCODE_REQUEST_MAX_NON_IMAGE_BYTES = 1024 * 1024;
|
|
848
|
+
/** Base64 payload bytes are the only bytes excluded from the non-image envelope budget. */
|
|
849
|
+
export function hcodeImagePayloadBytes(messages) {
|
|
850
|
+
let bytes = 0;
|
|
851
|
+
for (const message of messages) {
|
|
852
|
+
if (typeof message.content === "string")
|
|
853
|
+
continue;
|
|
854
|
+
for (const block of message.content)
|
|
855
|
+
if (block.type === "image")
|
|
856
|
+
bytes += block.data.length;
|
|
857
|
+
}
|
|
858
|
+
return bytes;
|
|
859
|
+
}
|
|
860
|
+
/** Decoded size of an image payload already validated as canonical base64. */
|
|
861
|
+
export function hcodeDecodedImageBytes(data) {
|
|
862
|
+
const padding = data.endsWith("==") ? 2 : data.endsWith("=") ? 1 : 0;
|
|
863
|
+
return (data.length / 4) * 3 - padding;
|
|
864
|
+
}
|
|
865
|
+
/** A strict request failure tagged with a fixed element code, never rejected input. */
|
|
866
|
+
export class HcodeRequestSchemaError extends Error {
|
|
867
|
+
detail;
|
|
868
|
+
constructor(detail) {
|
|
869
|
+
super("Invalid HUMAIN Code wire value.");
|
|
870
|
+
this.detail = detail;
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
function requestElement(detail, parse) {
|
|
874
|
+
try {
|
|
875
|
+
return parse();
|
|
876
|
+
}
|
|
877
|
+
catch (error) {
|
|
878
|
+
if (error instanceof HcodeRequestSchemaError)
|
|
879
|
+
throw error;
|
|
880
|
+
throw new HcodeRequestSchemaError(detail);
|
|
881
|
+
}
|
|
882
|
+
}
|
|
800
883
|
export function parseHcodeMessagesRequest(value) {
|
|
801
884
|
const raw = boundedJson(value, 48, 1048576);
|
|
802
885
|
if (wire.jsonBytes(raw) > 12582912)
|
|
803
886
|
return wire.invalid();
|
|
804
887
|
const v = wire.object(raw, ["model", "context", "options"]), context = wire.object(v.context, ["messages"]);
|
|
805
|
-
const messages = wire.array(context.messages, parseMessage, 512, 1);
|
|
888
|
+
const messages = requestElement("message.schema", () => wire.array(context.messages, parseMessage, 512, 1));
|
|
806
889
|
const result = {
|
|
807
890
|
model: scalar(v.model, 256, 1),
|
|
808
891
|
context: { messages },
|
|
809
|
-
...(v.options === undefined ? {} : { options: parseOptions(v.options) }),
|
|
892
|
+
...(v.options === undefined ? {} : { options: requestElement("options.schema", () => parseOptions(v.options)) }),
|
|
810
893
|
};
|
|
811
894
|
let blocks = 0, images = 0, imageBytes = 0, schemaBytes = 0;
|
|
812
895
|
const active = new Map(), seen = new Set(), pending = new Map();
|
|
@@ -829,19 +912,23 @@ export function parseHcodeMessagesRequest(value) {
|
|
|
829
912
|
}
|
|
830
913
|
else if (message.role === "toolResult") {
|
|
831
914
|
if (pending.get(message.toolCallId) !== message.toolName)
|
|
832
|
-
|
|
915
|
+
throw new HcodeRequestSchemaError("toolResult.orphan");
|
|
833
916
|
pending.delete(message.toolCallId);
|
|
834
917
|
}
|
|
835
918
|
else {
|
|
836
919
|
if (pending.size)
|
|
837
|
-
|
|
920
|
+
throw new HcodeRequestSchemaError("toolCall.orphan");
|
|
838
921
|
if (message.role === "assistant") {
|
|
839
922
|
const calls = message.content.filter((block) => block.type === "toolCall");
|
|
840
923
|
if (calls.length > 64)
|
|
841
924
|
return wire.invalid();
|
|
842
925
|
for (const call of calls) {
|
|
843
|
-
if (seen.has(call.id)
|
|
844
|
-
|
|
926
|
+
if (seen.has(call.id))
|
|
927
|
+
throw new HcodeRequestSchemaError("toolCall.duplicate");
|
|
928
|
+
if (!active.has(call.name))
|
|
929
|
+
throw new HcodeRequestSchemaError("toolCall.unknownTool");
|
|
930
|
+
if (call.argumentsError)
|
|
931
|
+
throw new HcodeRequestSchemaError("toolCall.argumentsError");
|
|
845
932
|
seen.add(call.id);
|
|
846
933
|
pending.set(call.id, call.name);
|
|
847
934
|
}
|
|
@@ -856,8 +943,7 @@ export function parseHcodeMessagesRequest(value) {
|
|
|
856
943
|
if (block.type === "image") {
|
|
857
944
|
images++;
|
|
858
945
|
perMessage++;
|
|
859
|
-
const
|
|
860
|
-
const decoded = (block.data.length / 4) * 3 - padding;
|
|
946
|
+
const decoded = hcodeDecodedImageBytes(block.data);
|
|
861
947
|
if (decoded > 3145728)
|
|
862
948
|
return wire.invalid();
|
|
863
949
|
imageBytes += decoded;
|
|
@@ -866,23 +952,21 @@ export function parseHcodeMessagesRequest(value) {
|
|
|
866
952
|
return wire.invalid();
|
|
867
953
|
}
|
|
868
954
|
}
|
|
869
|
-
if (pending.size
|
|
870
|
-
|
|
955
|
+
if (pending.size)
|
|
956
|
+
throw new HcodeRequestSchemaError("toolCall.orphan");
|
|
957
|
+
if (blocks > 2048 || images > 4 || imageBytes > HCODE_REQUEST_MAX_IMAGE_BYTES)
|
|
958
|
+
throw new HcodeRequestSchemaError("message.schema");
|
|
871
959
|
const choice = result.options?.toolChoice;
|
|
872
960
|
if (choice !== undefined && (!active.size || (typeof choice === "object" && !active.has(choice.function.name))))
|
|
873
|
-
|
|
961
|
+
throw new HcodeRequestSchemaError("toolChoice.unknownTool");
|
|
874
962
|
// Count the raw envelope, including ignored bookkeeping, with only actual image payloads emptied.
|
|
875
|
-
|
|
876
|
-
messages.reduce((sum, message) => sum +
|
|
877
|
-
(typeof message.content === "string"
|
|
878
|
-
? 0
|
|
879
|
-
: message.content.reduce((n, block) => n + (block.type === "image" ? block.data.length : 0), 0)), 0);
|
|
880
|
-
if (nonImage > 1048576)
|
|
963
|
+
if (wire.jsonBytes(raw) - hcodeImagePayloadBytes(messages) > HCODE_REQUEST_MAX_NON_IMAGE_BYTES)
|
|
881
964
|
return wire.invalid();
|
|
882
965
|
return result;
|
|
883
966
|
}
|
|
967
|
+
/** Open reader for streamed usage; request history closes its keys before calling this. */
|
|
884
968
|
export function parseHcodePiUsage(value) {
|
|
885
|
-
const v = wire.
|
|
969
|
+
const v = wire.fields(value, [
|
|
886
970
|
"input",
|
|
887
971
|
"output",
|
|
888
972
|
"cacheRead",
|
|
@@ -896,7 +980,7 @@ export function parseHcodePiUsage(value) {
|
|
|
896
980
|
const input = wire.integer(v.input, 2147483647), output = wire.integer(v.output, 2147483647), cacheRead = wire.integer(v.cacheRead, 2147483647), cacheWrite = wire.integer(v.cacheWrite, 2147483647), totalTokens = wire.integer(v.totalTokens, 2147483647);
|
|
897
981
|
if (totalTokens !== input + output + cacheRead + cacheWrite)
|
|
898
982
|
return wire.invalid();
|
|
899
|
-
const cost = wire.
|
|
983
|
+
const cost = wire.fields(v.cost, ["input", "output", "cacheRead", "cacheWrite", "total", "totalFromProvider"]);
|
|
900
984
|
const costResult = {
|
|
901
985
|
input: wire.number(cost.input, 0, Number.MAX_SAFE_INTEGER),
|
|
902
986
|
output: wire.number(cost.output, 0, Number.MAX_SAFE_INTEGER),
|
|
@@ -926,9 +1010,9 @@ const safeStreamErrors = [
|
|
|
926
1010
|
"HUMAIN Code account unavailable.",
|
|
927
1011
|
"Request aborted.",
|
|
928
1012
|
];
|
|
1013
|
+
/** Parse one streamed event; unknown keys are ignored, unknown event types are invalid. */
|
|
929
1014
|
export function parseHcodePiEvent(value) {
|
|
930
|
-
|
|
931
|
-
const v = wire.object(value, [
|
|
1015
|
+
const v = wire.fields(value, [
|
|
932
1016
|
"type",
|
|
933
1017
|
"contentIndex",
|
|
934
1018
|
"delta",
|
|
@@ -945,20 +1029,9 @@ export function parseHcodePiEvent(value) {
|
|
|
945
1029
|
"responseModel",
|
|
946
1030
|
"providerThinkingLevel",
|
|
947
1031
|
]);
|
|
948
|
-
if (v.type === "start")
|
|
949
|
-
wire.object(value, ["type"]);
|
|
1032
|
+
if (v.type === "start")
|
|
950
1033
|
return { type: "start" };
|
|
951
|
-
}
|
|
952
1034
|
if (v.type === "done" || v.type === "error") {
|
|
953
|
-
wire.object(value, [
|
|
954
|
-
"type",
|
|
955
|
-
"reason",
|
|
956
|
-
"usage",
|
|
957
|
-
"responseId",
|
|
958
|
-
"responseModel",
|
|
959
|
-
"providerThinkingLevel",
|
|
960
|
-
...(v.type === "error" ? ["errorMessage"] : []),
|
|
961
|
-
]);
|
|
962
1035
|
const terminal = {
|
|
963
1036
|
usage: parseHcodePiUsage(v.usage),
|
|
964
1037
|
...(v.responseId === undefined ? {} : { responseId: ascii(v.responseId) }),
|
|
@@ -972,30 +1045,23 @@ export function parseHcodePiEvent(value) {
|
|
|
972
1045
|
return wire.invalid();
|
|
973
1046
|
return { type: "done", reason: wire.member(v.reason, ["stop", "length", "toolUse"]), ...terminal };
|
|
974
1047
|
}
|
|
1048
|
+
if (Object.hasOwn(v, "errorMessage") && typeof v.errorMessage !== "string")
|
|
1049
|
+
return wire.invalid();
|
|
1050
|
+
// Unknown or reworded text is dropped, never reflected; the CLI then shows its own generic failure.
|
|
1051
|
+
const errorMessage = safeStreamErrors.find((entry) => entry === v.errorMessage);
|
|
975
1052
|
return {
|
|
976
1053
|
type: "error",
|
|
977
1054
|
reason: wire.member(v.reason, ["aborted", "error"]),
|
|
978
1055
|
...terminal,
|
|
979
|
-
...(
|
|
1056
|
+
...(errorMessage === undefined ? {} : { errorMessage }),
|
|
980
1057
|
};
|
|
981
1058
|
}
|
|
982
1059
|
const contentIndex = wire.integer(v.contentIndex, 2047);
|
|
983
|
-
if (v.type === "text_start" || v.type === "thinking_start")
|
|
984
|
-
wire.object(value, ["type", "contentIndex"]);
|
|
1060
|
+
if (v.type === "text_start" || v.type === "thinking_start")
|
|
985
1061
|
return { type: v.type, contentIndex };
|
|
986
|
-
|
|
987
|
-
if (v.type === "text_delta" || v.type === "thinking_delta" || v.type === "toolcall_delta") {
|
|
988
|
-
wire.object(value, ["type", "contentIndex", "delta"]);
|
|
1062
|
+
if (v.type === "text_delta" || v.type === "thinking_delta" || v.type === "toolcall_delta")
|
|
989
1063
|
return { type: v.type, contentIndex, delta: scalar(v.delta, v.type === "toolcall_delta" ? 65536 : 1048576) };
|
|
990
|
-
}
|
|
991
1064
|
if (v.type === "text_end" || v.type === "thinking_end") {
|
|
992
|
-
wire.object(value, [
|
|
993
|
-
"type",
|
|
994
|
-
"contentIndex",
|
|
995
|
-
"content",
|
|
996
|
-
"contentSignature",
|
|
997
|
-
...(v.type === "thinking_end" ? ["redacted"] : []),
|
|
998
|
-
]);
|
|
999
1065
|
const end = {
|
|
1000
1066
|
contentIndex,
|
|
1001
1067
|
content: scalar(v.content, 8388608),
|
|
@@ -1008,12 +1074,9 @@ export function parseHcodePiEvent(value) {
|
|
|
1008
1074
|
return wire.invalid();
|
|
1009
1075
|
return { type: "thinking_end", ...end, ...(redacted === undefined ? {} : { redacted }) };
|
|
1010
1076
|
}
|
|
1011
|
-
if (v.type === "toolcall_start")
|
|
1012
|
-
wire.object(value, ["type", "contentIndex", "id", "toolName"]);
|
|
1077
|
+
if (v.type === "toolcall_start")
|
|
1013
1078
|
return { type: "toolcall_start", contentIndex, id: ascii(v.id), toolName: toolName(v.toolName) };
|
|
1014
|
-
}
|
|
1015
|
-
wire.object(value, ["type", "contentIndex", "toolCall"]);
|
|
1016
|
-
return { type: wire.literal(v.type, "toolcall_end"), contentIndex, toolCall: toolCall(v.toolCall) };
|
|
1079
|
+
return { type: wire.literal(v.type, "toolcall_end"), contentIndex, toolCall: toolCall(v.toolCall, wire.fields) };
|
|
1017
1080
|
}
|
|
1018
1081
|
export function createHcodePiEventValidator() {
|
|
1019
1082
|
let started = false, terminal = false, failed = false, retained = 0, malformed = false;
|
|
@@ -1106,29 +1169,13 @@ const snapshotFields = [
|
|
|
1106
1169
|
"remaining",
|
|
1107
1170
|
"costComplete",
|
|
1108
1171
|
];
|
|
1109
|
-
function checkAllowanceConsistency(value) {
|
|
1110
|
-
if ((value.allowance.kind === "unlimited") !== (value.remaining.kind === "unlimited"))
|
|
1111
|
-
wire.invalid();
|
|
1112
|
-
if (value.actual.kind === "known" &&
|
|
1113
|
-
value.reserved.kind === "known" &&
|
|
1114
|
-
value.committed.kind === "known" &&
|
|
1115
|
-
(!Number.isSafeInteger(value.actual.value + value.reserved.value) ||
|
|
1116
|
-
value.committed.value !== value.actual.value + value.reserved.value))
|
|
1117
|
-
wire.invalid();
|
|
1118
|
-
if (value.allowance.kind === "limited" &&
|
|
1119
|
-
value.committed.kind === "known" &&
|
|
1120
|
-
value.remaining.kind === "known" &&
|
|
1121
|
-
value.remaining.value !== Math.max(0, value.allowance.limitMicrocents - value.committed.value))
|
|
1122
|
-
wire.invalid();
|
|
1123
|
-
}
|
|
1124
1172
|
export function parseAllowanceSnapshot(value) {
|
|
1125
|
-
const v = wire.
|
|
1173
|
+
const v = wire.fields(value, snapshotFields), period = wire.fields(v.period, ["start", "resetAt"]);
|
|
1126
1174
|
const start = wire.time(period.start), resetAt = wire.time(period.resetAt);
|
|
1127
1175
|
if (Date.parse(start) >= Date.parse(resetAt))
|
|
1128
1176
|
return wire.invalid();
|
|
1129
|
-
const
|
|
1130
|
-
|
|
1131
|
-
? { kind: wire.literal(wire.object(v.remaining, ["kind"]).kind, "unlimited") }
|
|
1177
|
+
const remaining = wire.fields(v.remaining, ["kind"]).kind === "unlimited"
|
|
1178
|
+
? { kind: "unlimited" }
|
|
1132
1179
|
: parseValue(v.remaining);
|
|
1133
1180
|
const result = {
|
|
1134
1181
|
asOf: wire.time(v.asOf),
|
|
@@ -1142,7 +1189,9 @@ export function parseAllowanceSnapshot(value) {
|
|
|
1142
1189
|
remaining,
|
|
1143
1190
|
costComplete: wire.boolean(v.costComplete),
|
|
1144
1191
|
};
|
|
1145
|
-
|
|
1192
|
+
// The server's arithmetic is shown as sent; only the allowance kind must agree with the remaining kind.
|
|
1193
|
+
if ((result.allowance.kind === "unlimited") !== (result.remaining.kind === "unlimited"))
|
|
1194
|
+
return wire.invalid();
|
|
1146
1195
|
return result;
|
|
1147
1196
|
}
|
|
1148
1197
|
export function parseHcodeAdminResolutionEvidence(value) {
|
|
@@ -1168,6 +1217,20 @@ export function parseHcodeAdminResolutionEvidence(value) {
|
|
|
1168
1217
|
const decision = wire.member(v.decision, ["charged", "not-charged"]), basis = wire.member(v.basis, ["provider-evidence", "no-charge-evidence", "administrative-waiver"]), costMicrocents = wire.integer(v.costMicrocents);
|
|
1169
1218
|
if (decision === "charged" ? basis !== "provider-evidence" : costMicrocents !== 0 || basis === "provider-evidence")
|
|
1170
1219
|
return wire.invalid();
|
|
1220
|
+
const tokens = readTokenCounts(wire.object(v.tokens, tokenKeys), 2147483647, (value) => {
|
|
1221
|
+
const count = wire.object(value, ["kind", "value"]);
|
|
1222
|
+
if (count.kind !== "known")
|
|
1223
|
+
wire.object(value, ["kind"]);
|
|
1224
|
+
return parseValue(count);
|
|
1225
|
+
});
|
|
1226
|
+
const { input, output, cacheRead, cacheWrite, total } = tokens;
|
|
1227
|
+
if (input.kind === "known") {
|
|
1228
|
+
if (output.kind === "known" && total.kind === "known" && total.value !== input.value + output.value)
|
|
1229
|
+
return wire.invalid();
|
|
1230
|
+
if ((cacheRead.kind === "known" ? cacheRead.value : 0) + (cacheWrite.kind === "known" ? cacheWrite.value : 0) >
|
|
1231
|
+
input.value)
|
|
1232
|
+
return wire.invalid();
|
|
1233
|
+
}
|
|
1171
1234
|
return {
|
|
1172
1235
|
kind: wire.literal(v.kind, "admin-resolution"),
|
|
1173
1236
|
resolutionId: wire.string(v.resolutionId),
|
|
@@ -1182,7 +1245,7 @@ export function parseHcodeAdminResolutionEvidence(value) {
|
|
|
1182
1245
|
basis,
|
|
1183
1246
|
reason,
|
|
1184
1247
|
evidenceReference,
|
|
1185
|
-
tokens
|
|
1248
|
+
tokens,
|
|
1186
1249
|
};
|
|
1187
1250
|
}
|
|
1188
1251
|
const errorMessages = {
|
|
@@ -1203,41 +1266,47 @@ const errorMessages = {
|
|
|
1203
1266
|
settlement_unavailable: "Settlement unavailable.",
|
|
1204
1267
|
};
|
|
1205
1268
|
export const HCODE_ALLOWANCE_ESTIMATE_MESSAGE = "Your remaining monthly allowance cannot cover this request.";
|
|
1269
|
+
/** Parse a refusal by its code; the server's wording and unknown keys are ignored, and the CLI shows its own text. */
|
|
1206
1270
|
export function parseHcodeInferenceError(value) {
|
|
1207
|
-
const outer = wire.
|
|
1271
|
+
const outer = wire.fields(value, ["error"]), v = wire.fields(outer.error, ["code", "message", "details"]);
|
|
1272
|
+
if (typeof v.message !== "string")
|
|
1273
|
+
return wire.invalid();
|
|
1274
|
+
// An unknown code stays invalid: the caller then shows the generic "do not resend" failure, never a refusal.
|
|
1208
1275
|
const code = wire.member(v.code, Object.keys(errorMessages));
|
|
1209
1276
|
if (code === "hcode_busy") {
|
|
1210
|
-
const d = wire.
|
|
1277
|
+
const d = wire.fields(v.details, ["dispatched", "automaticRetryAllowed", "retryAfterMs"]);
|
|
1211
1278
|
return {
|
|
1212
1279
|
error: {
|
|
1213
1280
|
code,
|
|
1214
|
-
message:
|
|
1281
|
+
message: errorMessages[code],
|
|
1215
1282
|
details: {
|
|
1216
1283
|
dispatched: wire.literal(d.dispatched, false),
|
|
1217
1284
|
automaticRetryAllowed: wire.literal(d.automaticRetryAllowed, false),
|
|
1218
|
-
retryAfterMs: wire.
|
|
1285
|
+
retryAfterMs: wire.integer(d.retryAfterMs, Number.MAX_SAFE_INTEGER, 1),
|
|
1219
1286
|
},
|
|
1220
1287
|
},
|
|
1221
1288
|
};
|
|
1222
1289
|
}
|
|
1223
1290
|
if (code === "quota_exceeded") {
|
|
1224
|
-
const d = wire.
|
|
1291
|
+
const d = wire.fields(v.details, ["dispatched", "automaticRetryAllowed", "usage"]);
|
|
1292
|
+
const usage = parseAllowanceSnapshot(d.usage);
|
|
1293
|
+
// Allowance left over means the request's estimate, not the allowance, was refused.
|
|
1294
|
+
const estimate = v.message === HCODE_ALLOWANCE_ESTIMATE_MESSAGE ||
|
|
1295
|
+
(usage.remaining.kind === "known" && usage.remaining.value > 0);
|
|
1225
1296
|
return {
|
|
1226
1297
|
error: {
|
|
1227
1298
|
code,
|
|
1228
|
-
message:
|
|
1299
|
+
message: estimate ? HCODE_ALLOWANCE_ESTIMATE_MESSAGE : errorMessages[code],
|
|
1229
1300
|
details: {
|
|
1230
1301
|
dispatched: wire.literal(d.dispatched, false),
|
|
1231
1302
|
automaticRetryAllowed: wire.literal(d.automaticRetryAllowed, false),
|
|
1232
|
-
usage
|
|
1303
|
+
usage,
|
|
1233
1304
|
},
|
|
1234
1305
|
},
|
|
1235
1306
|
};
|
|
1236
1307
|
}
|
|
1237
1308
|
if (v.details !== null)
|
|
1238
1309
|
return wire.invalid();
|
|
1239
|
-
return {
|
|
1240
|
-
error: { code, message: wire.literal(v.message, errorMessages[code]), details: null },
|
|
1241
|
-
};
|
|
1310
|
+
return { error: { code, message: errorMessages[code], details: null } };
|
|
1242
1311
|
}
|
|
1243
1312
|
//# sourceMappingURL=contracts.js.map
|