@humain/humain-code 0.4.15 → 0.4.18
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 +86 -0
- package/README.md +1 -1
- package/dist/bundle/agent-monitor.js +1 -1
- package/dist/bundle/chunks/anthropic-messages-TSNY5MWH.js +67 -0
- package/dist/bundle/chunks/azure-openai-responses-Z4DCXO2G.js +15 -0
- package/dist/bundle/chunks/bedrock-converse-stream.js +59 -42
- package/dist/bundle/chunks/{chunk-W2QRCQBX.js → chunk-26EAEXO5.js} +18 -16
- package/dist/bundle/chunks/chunk-2ZFUMXOZ.js +1790 -0
- package/dist/bundle/chunks/{chunk-W5YJZKPF.js → chunk-3UXBFT4Q.js} +2264 -2432
- package/dist/bundle/chunks/{chunk-OX2IBCCA.js → chunk-3XDL5ZE4.js} +88 -82
- package/dist/bundle/chunks/{chunk-LUL775V7.js → chunk-5K5RFXXO.js} +4 -4
- package/dist/bundle/chunks/{chunk-AIXI6RIE.js → chunk-7PRU6YW3.js} +114 -82
- package/dist/bundle/chunks/{chunk-DUSJT2W4.js → chunk-7VY5IL74.js} +1 -1
- package/dist/bundle/chunks/chunk-AWCJWXGD.js +212 -0
- package/dist/bundle/chunks/chunk-FZUJXM6D.js +816 -0
- package/dist/bundle/chunks/{chunk-KK3KUUMM.js → chunk-G6ABHCPB.js} +115 -95
- package/dist/bundle/chunks/{chunk-NNKA2PAP.js → chunk-HPSQKIWK.js} +1 -1
- package/dist/bundle/chunks/chunk-IJYVMOB4.js +6 -0
- package/dist/bundle/chunks/{chunk-36Q5UVQL.js → chunk-L5OUCJ7N.js} +9 -9
- package/dist/bundle/chunks/chunk-NCQ6WAQK.js +125 -0
- package/dist/bundle/chunks/chunk-NSMMDV3N.js +131 -0
- package/dist/bundle/chunks/{chunk-Z74ZYQPX.js → chunk-OKALNPTJ.js} +80 -210
- package/dist/bundle/chunks/{chunk-UHLW4KJ7.js → chunk-OWLBGSXY.js} +94 -91
- package/dist/bundle/chunks/{chunk-JRX7GYW3.js → chunk-P4UKLIQB.js} +8 -8
- package/dist/bundle/chunks/chunk-PY7SOXCA.js +10 -0
- package/dist/bundle/chunks/chunk-Q7VXYXY3.js +7 -0
- package/dist/bundle/chunks/{chunk-COF5P635.js → chunk-QEF72EIZ.js} +13 -13
- package/dist/bundle/chunks/{chunk-EYIYBQAR.js → chunk-RXOCQRBG.js} +1 -1
- package/dist/bundle/chunks/{chunk-BVHXWQLD.js → chunk-SCBU5WOP.js} +1 -1
- package/dist/bundle/chunks/{chunk-DNGJMRJW.js → chunk-SCIGZFN5.js} +11 -11
- package/dist/bundle/chunks/{chunk-UDVC7A5S.js → chunk-TIFFHHW6.js} +16 -14
- package/dist/bundle/chunks/{chunk-L3J4P5JR.js → chunk-UGJAAWNC.js} +1 -1
- package/dist/bundle/chunks/chunk-V76YPIMT.js +48 -0
- package/dist/bundle/chunks/{chunk-Y3RFGBG2.js → chunk-X3O5MCKJ.js} +1 -1
- package/dist/bundle/chunks/chunk-Y26OS23T.js +80 -0
- package/dist/bundle/chunks/chunk-YDBNMIA3.js +34 -0
- package/dist/bundle/chunks/chunk-YLYOJQQX.js +1951 -0
- package/dist/bundle/chunks/{chunk-TJG52LZB.js → chunk-YMBXWW36.js} +1 -1
- package/dist/bundle/chunks/{cli-SRI4UOSL.js → cli-2NKM2RNJ.js} +1 -1
- package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-JGN7NZCV.js → cloudflare-workers-ai-system-one-MUJQ6LT2.js} +1 -1
- package/dist/bundle/chunks/{compat-2S3PCPEI.js → compat-VDGEZSVM.js} +8 -8
- package/dist/bundle/chunks/dist-LKDZAEUQ.js +7 -0
- package/dist/bundle/chunks/{dist-JXEXN6S2.js → dist-XVXV2CL4.js} +1 -1
- package/dist/bundle/chunks/{dist-SGQMXO45.js → dist-ZJIYY3GA.js} +1416 -866
- package/dist/bundle/chunks/dist-cjs-AXBW3N4F.js +182 -0
- package/dist/bundle/chunks/{easter-egg-3d-ZJ2JUFOA.js → easter-egg-3d-VGJ77XZQ.js} +1 -1
- package/dist/bundle/chunks/es-N6YFJOD7.js +1901 -0
- package/dist/bundle/chunks/{esm-NCUV2DF7.js → esm-GIR7QH65.js} +1 -1
- package/dist/bundle/chunks/{execute-LRTXH4YJ.js → execute-ZBEZNJ4E.js} +10 -9
- package/dist/bundle/chunks/{extract-OZW5JHG6.js → extract-RFWEHH6W.js} +16 -15
- package/dist/bundle/chunks/github-copilot.js +34 -47
- package/dist/bundle/chunks/{google-generative-ai-YXXFSTX7.js → google-generative-ai-4OVYRP24.js} +2 -2
- package/dist/bundle/chunks/{google-vertex-3IVWLYJ5.js → google-vertex-3WQAZJQD.js} +2 -2
- package/dist/bundle/chunks/host-63SNKK5Y.js +2 -0
- package/dist/bundle/chunks/jiti-static-loader-7OZNBOCI.js +2 -0
- package/dist/bundle/chunks/{mistral-conversations-Y7GWO3QB.js → mistral-conversations-G3GN6CMT.js} +20 -20
- package/dist/bundle/chunks/{node-ELWNZC34.js → node-A6SZ3T7E.js} +185 -185
- package/dist/bundle/chunks/{node-SPBTZUUS.js → node-DZCAT4Q6.js} +1 -1
- package/dist/bundle/chunks/{openai-codex-responses-NSXWHIDT.js → openai-codex-responses-FJFDAWHI.js} +17 -17
- package/dist/bundle/chunks/openai-completions-IC7WRLTI.js +82 -0
- package/dist/bundle/chunks/{openai-decisions-QWEISDVO.js → openai-decisions-HESOHYZB.js} +1 -1
- package/dist/bundle/chunks/openai-responses-XXCYDFSM.js +24 -0
- package/dist/bundle/chunks/{openrouter-images-BMVMAROU.js → openrouter-images-DT2HMZNO.js} +1 -1
- package/dist/bundle/chunks/pdfjs-EK6K7CXX.js +3593 -0
- package/dist/bundle/chunks/{pi-messages-XNEG23NU.js → pi-messages-SAOV3JNW.js} +1 -1
- package/dist/bundle/chunks/{runtime-VGSK3QCM.js → runtime-HJEUOD4R.js} +1 -1
- package/dist/bundle/chunks/{typesafe-system-one-62YHYXZV.js → typesafe-system-one-HCMGHK6A.js} +1 -1
- package/dist/bundle/chunks/{undici-7EW63V4X.js → undici-4BK3MVJV.js} +1 -1
- package/dist/bundle/chunks/virtual-modules-CFJTDIXL.js +5 -0
- package/dist/bundle/cli-runtime.js +3 -3
- package/dist/bundle/cli.js +2 -2
- package/dist/bundle/flow/package.json +6 -5
- package/dist/bundle/index.js +8 -8
- package/dist/bundle/rpc-entry.js +3 -3
- package/dist/cli/credential-print.d.ts.map +1 -1
- package/dist/cli/credential-print.js +4 -4
- package/dist/cli/credential-print.js.map +1 -1
- package/dist/coordination/adapter/index.d.ts.map +1 -1
- package/dist/coordination/adapter/index.js +1 -1
- package/dist/coordination/adapter/index.js.map +1 -1
- package/dist/coordination/adapter/integration-notices.d.ts +1 -1
- package/dist/coordination/adapter/integration-notices.d.ts.map +1 -1
- package/dist/coordination/adapter/integration-notices.js +5 -2
- package/dist/coordination/adapter/integration-notices.js.map +1 -1
- package/dist/coordination/broker/extension-state.js +3 -3
- package/dist/coordination/broker/extension-state.js.map +1 -1
- package/dist/coordination/transport/framing.d.ts.map +1 -1
- package/dist/coordination/transport/framing.js +2 -1
- package/dist/coordination/transport/framing.js.map +1 -1
- package/dist/core/account-reporting.d.ts +3 -1
- package/dist/core/account-reporting.d.ts.map +1 -1
- package/dist/core/account-reporting.js +12 -2
- package/dist/core/account-reporting.js.map +1 -1
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +39 -36
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session.d.ts +4 -2
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +5 -4
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/codex-usage.d.ts +11 -2
- package/dist/core/codex-usage.d.ts.map +1 -1
- package/dist/core/codex-usage.js +74 -2
- package/dist/core/codex-usage.js.map +1 -1
- package/dist/core/export-html/template.js +21 -16
- package/dist/core/model-config.d.ts +33 -8
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js +22 -4
- package/dist/core/model-config.js.map +1 -1
- package/dist/core/model-resolver.d.ts +56 -43
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +256 -361
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts +6 -3
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +19 -5
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/models-store.d.ts.map +1 -1
- package/dist/core/models-store.js +7 -2
- package/dist/core/models-store.js.map +1 -1
- package/dist/core/oauth-account-pool.d.ts +9 -1
- package/dist/core/oauth-account-pool.d.ts.map +1 -1
- package/dist/core/oauth-account-pool.js +63 -12
- package/dist/core/oauth-account-pool.js.map +1 -1
- package/dist/core/prompt-templates.d.ts.map +1 -1
- package/dist/core/prompt-templates.js +7 -2
- package/dist/core/prompt-templates.js.map +1 -1
- package/dist/core/settings-defaults.d.ts +2 -0
- package/dist/core/settings-defaults.d.ts.map +1 -1
- package/dist/core/settings-defaults.js +2 -0
- package/dist/core/settings-defaults.js.map +1 -1
- package/dist/core/settings-manager.d.ts +4 -2
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +11 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/settings-schema.d.ts +4 -0
- package/dist/core/settings-schema.d.ts.map +1 -1
- package/dist/core/settings-schema.js +8 -0
- package/dist/core/settings-schema.js.map +1 -1
- package/dist/core/slash-commands.js +1 -1
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/tools/render-utils.d.ts +2 -0
- package/dist/core/tools/render-utils.d.ts.map +1 -1
- package/dist/core/tools/render-utils.js +21 -0
- package/dist/core/tools/render-utils.js.map +1 -1
- package/dist/core/tools/renderers/read.d.ts.map +1 -1
- package/dist/core/tools/renderers/read.js +7 -10
- package/dist/core/tools/renderers/read.js.map +1 -1
- package/dist/core/tools/subagent.d.ts.map +1 -1
- package/dist/core/tools/subagent.js +4 -7
- package/dist/core/tools/subagent.js.map +1 -1
- package/dist/core/trace/redaction.d.ts.map +1 -1
- package/dist/core/trace/redaction.js +3 -1
- package/dist/core/trace/redaction.js.map +1 -1
- package/dist/extensions/codemode/execute.d.ts.map +1 -1
- package/dist/extensions/codemode/execute.js +12 -0
- package/dist/extensions/codemode/execute.js.map +1 -1
- package/dist/extensions/codemode/index.d.ts.map +1 -1
- package/dist/extensions/codemode/index.js +5 -0
- package/dist/extensions/codemode/index.js.map +1 -1
- package/dist/humain/bedrock-provider/vendor/index.bundle.mjs +74 -20
- package/dist/humain/flow-accounts-host.d.ts.map +1 -1
- package/dist/humain/flow-accounts-host.js +3 -0
- package/dist/humain/flow-accounts-host.js.map +1 -1
- package/dist/humain/node-provider.d.ts.map +1 -1
- package/dist/humain/node-provider.js +2 -0
- package/dist/humain/node-provider.js.map +1 -1
- package/dist/humain/trace-capture/index.js +3 -3
- package/dist/humain/trace-capture/index.js.map +1 -1
- package/dist/humain/web-access/vendor/credential-source.d.ts +2 -0
- package/dist/humain/web-access/vendor/credential-source.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/credential-source.js +50 -4
- package/dist/humain/web-access/vendor/credential-source.js.map +1 -1
- package/dist/humain/web-access/vendor/curator-page.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/curator-page.js +3 -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 +2 -0
- package/dist/humain/web-access/vendor/curator-server.js.map +1 -1
- package/dist/humain/web-access/vendor/deepseek.d.ts +4 -0
- package/dist/humain/web-access/vendor/deepseek.d.ts.map +1 -0
- package/dist/humain/web-access/vendor/deepseek.js +201 -0
- package/dist/humain/web-access/vendor/deepseek.js.map +1 -0
- package/dist/humain/web-access/vendor/extract.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/extract.js +4 -2
- package/dist/humain/web-access/vendor/extract.js.map +1 -1
- package/dist/humain/web-access/vendor/gemini-adc.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/gemini-adc.js +49 -5
- package/dist/humain/web-access/vendor/gemini-adc.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 +11 -4
- 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 +16 -1
- package/dist/humain/web-access/vendor/index.js.map +1 -1
- package/dist/humain/web-access/vendor/page-query.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/page-query.js +12 -6
- package/dist/humain/web-access/vendor/page-query.js.map +1 -1
- package/dist/humain/web-access/vendor/query-rewrite.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/query-rewrite.js +11 -4
- package/dist/humain/web-access/vendor/query-rewrite.js.map +1 -1
- package/dist/humain/web-access/vendor/searxng.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/searxng.js +2 -1
- package/dist/humain/web-access/vendor/searxng.js.map +1 -1
- package/dist/humain/web-access/vendor/ssrf-protection.d.ts +1 -0
- package/dist/humain/web-access/vendor/ssrf-protection.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/ssrf-protection.js +10 -0
- package/dist/humain/web-access/vendor/ssrf-protection.js.map +1 -1
- package/dist/humain/web-access/vendor/summary-review.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/summary-review.js +17 -6
- package/dist/humain/web-access/vendor/summary-review.js.map +1 -1
- package/dist/humain/web-access/vendor/utils.d.ts +2 -0
- package/dist/humain/web-access/vendor/utils.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/utils.js +18 -0
- package/dist/humain/web-access/vendor/utils.js.map +1 -1
- package/dist/humain/web-access/vendor/web-tool-core.d.ts +2 -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.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +1 -0
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +3 -1
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +10 -0
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/status-indicator.d.ts +5 -0
- package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
- package/dist/modes/interactive/components/status-indicator.js +27 -2
- package/dist/modes/interactive/components/status-indicator.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +2 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +4 -2
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector.js +2 -9
- package/dist/modes/interactive/components/tree-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +28 -14
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/oauth-account-format.d.ts +4 -4
- package/dist/modes/interactive/oauth-account-format.d.ts.map +1 -1
- package/dist/modes/interactive/oauth-account-format.js +5 -2
- package/dist/modes/interactive/oauth-account-format.js.map +1 -1
- package/dist/modes/interactive/session-share.d.ts.map +1 -1
- package/dist/modes/interactive/session-share.js +9 -2
- package/dist/modes/interactive/session-share.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +8 -3
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/utils/tools-manager.d.ts.map +1 -1
- package/dist/utils/tools-manager.js +2 -1
- package/dist/utils/tools-manager.js.map +1 -1
- package/docs/cli.md +3 -3
- package/docs/codemode.md +3 -1
- package/docs/coordination.md +6 -0
- package/docs/docs.json +4 -0
- package/docs/environment-variables.md +4 -0
- package/docs/flow.md +6 -0
- package/docs/humain-code-forge-flow-walkthrough.md +1 -1
- package/docs/humain-code.md +2 -4
- package/docs/json.md +2 -2
- package/docs/llama-cpp.md +1 -1
- package/docs/nvidia-rtx-llama-cpp.md +96 -0
- package/docs/rpc-commands.md +1 -1
- package/docs/rpc.md +9 -1
- package/docs/sessions.md +1 -1
- package/docs/settings.md +2 -0
- package/docs/trace.md +4 -0
- package/docs/usage.md +1 -1
- package/examples/extensions/custom-provider-anthropic/package-lock.json +16 -6
- package/examples/extensions/custom-provider-anthropic/package.json +2 -2
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/gondolin/package-lock.json +16 -16
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/minimal-mode.ts +4 -4
- package/examples/extensions/sandbox/package-lock.json +6 -6
- package/examples/extensions/sandbox/package.json +2 -2
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/examples/plugins/pi-example-plugin/package.json +2 -2
- package/examples/rpc-subagent-progress-host.ts +6 -2
- package/npm-shrinkwrap.json +129 -171
- package/package.json +19 -19
- package/schemas/models.schema.json +9 -5
- package/schemas/settings.schema.json +32 -0
- package/src/coordination/UPSTREAM.md +31 -1
- package/src/coordination/upstream.json +3 -3
- package/src/humain/adhd/UPSTREAM.md +8 -0
- package/src/humain/caveman/UPSTREAM.md +19 -3
- package/src/humain/caveman/upstream.json +2 -2
- package/src/humain/ponytail/UPSTREAM.md +23 -2
- package/src/humain/ponytail/upstream.json +8 -8
- package/src/humain/ponytail/vendor/skills/ponytail/SKILL.md +1 -1
- package/src/humain/ponytail/vendor/skills/ponytail-debt/SKILL.md +1 -2
- package/src/humain/ponytail/vendor/skills/ponytail-gain/SKILL.md +0 -1
- package/src/humain/web-access/UPSTREAM.md +45 -1
- package/src/humain/web-access/upstream.json +4 -4
- package/dist/bundle/chunks/anthropic-messages-YSAHA7QM.js +0 -67
- package/dist/bundle/chunks/azure-openai-responses-Z5XYDPHS.js +0 -15
- package/dist/bundle/chunks/chunk-2TTB6GIB.js +0 -47
- package/dist/bundle/chunks/chunk-5JHUWRJN.js +0 -1790
- package/dist/bundle/chunks/chunk-A7QKOI62.js +0 -572
- package/dist/bundle/chunks/chunk-FRUFMISJ.js +0 -505
- package/dist/bundle/chunks/chunk-MF2NEHP4.js +0 -1575
- package/dist/bundle/chunks/chunk-MG5PX4KU.js +0 -31
- package/dist/bundle/chunks/chunk-OEOXBLWI.js +0 -540
- package/dist/bundle/chunks/chunk-RYC5BYVE.js +0 -5
- package/dist/bundle/chunks/chunk-YJ3NQWES.js +0 -9
- package/dist/bundle/chunks/dist-MNSGVI4C.js +0 -7
- package/dist/bundle/chunks/dist-cjs-4BMVQ74V.js +0 -179
- package/dist/bundle/chunks/es-YEFEOGR3.js +0 -1905
- package/dist/bundle/chunks/host-2RMBOGA7.js +0 -2
- package/dist/bundle/chunks/jiti-static-loader-2RCDI6B4.js +0 -2
- package/dist/bundle/chunks/openai-completions-WGBQHTYA.js +0 -79
- package/dist/bundle/chunks/openai-responses-OKGCSIEY.js +0 -23
- package/dist/bundle/chunks/pdfjs-6UVU6XFX.js +0 -3564
- package/dist/bundle/chunks/virtual-modules-7HDINPIK.js +0 -5
- /package/dist/bundle/chunks/{chunk-XQRYOCHA.js → chunk-WZMA7HAJ.js} +0 -0
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
|
-
import{__commonJS,__toESM}from"./chunk-JXWJOIH4.js";var require_options=__commonJS({"node_modules/partial-json/dist/options.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.Allow=exports.ALL=exports.COLLECTION=exports.ATOM=exports.SPECIAL=exports.INF=exports._INFINITY=exports.INFINITY=exports.NAN=exports.BOOL=exports.NULL=exports.OBJ=exports.ARR=exports.NUM=exports.STR=void 0;exports.STR=1;exports.NUM=2;exports.ARR=4;exports.OBJ=8;exports.NULL=16;exports.BOOL=32;exports.NAN=64;exports.INFINITY=128;exports._INFINITY=
|
|
3
|
-
256;exports.INF=exports.INFINITY|exports._INFINITY;exports.SPECIAL=exports.NULL|exports.BOOL|exports.INF|exports.NAN;exports.ATOM=exports.STR|exports.NUM|exports.SPECIAL;exports.COLLECTION=exports.ARR|exports.OBJ;exports.ALL=exports.ATOM|exports.COLLECTION;exports.Allow={STR:exports.STR,NUM:exports.NUM,ARR:exports.ARR,OBJ:exports.OBJ,NULL:exports.NULL,BOOL:exports.BOOL,NAN:exports.NAN,INFINITY:exports.INFINITY,_INFINITY:exports._INFINITY,INF:exports.INF,SPECIAL:exports.SPECIAL,ATOM:exports.ATOM,
|
|
4
|
-
COLLECTION:exports.COLLECTION,ALL:exports.ALL};exports.default=exports.Allow}});var require_dist=__commonJS({"node_modules/partial-json/dist/index.js"(exports){"use strict";var __createBinding=exports&&exports.__createBinding||(Object.create?(function(o,m,k,k2){k2===void 0&&(k2=k);var desc=Object.getOwnPropertyDescriptor(m,k);(!desc||("get"in desc?!m.__esModule:desc.writable||desc.configurable))&&(desc={enumerable:!0,get:function(){return m[k]}}),Object.defineProperty(o,k2,desc)}):(function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]})),__exportStar=exports&&exports.__exportStar||
|
|
5
|
-
function(m,exports2){for(var p in m)p!=="default"&&!Object.prototype.hasOwnProperty.call(exports2,p)&&__createBinding(exports2,m,p)};Object.defineProperty(exports,"__esModule",{value:!0});exports.Allow=exports.MalformedJSON=exports.PartialJSON=exports.parseJSON=exports.parse=void 0;var options_1=require_options();Object.defineProperty(exports,"Allow",{enumerable:!0,get:function(){return options_1.Allow}});__exportStar(require_options(),exports);var PartialJSON=class extends Error{};exports.PartialJSON=
|
|
6
|
-
PartialJSON;var MalformedJSON=class extends Error{};exports.MalformedJSON=MalformedJSON;function parseJSON(jsonString,allowPartial=options_1.Allow.ALL){if(typeof jsonString!="string")throw new TypeError(`expecting str, got ${typeof jsonString}`);if(!jsonString.trim())throw new Error(`${jsonString} is empty`);return _parseJSON(jsonString.trim(),allowPartial)}exports.parseJSON=parseJSON;var _parseJSON=(jsonString,allow)=>{let length=jsonString.length,index=0,markPartialJSON=msg=>{throw new PartialJSON(
|
|
7
|
-
`${msg} at position ${index}`)},throwMalformedError=msg=>{throw new MalformedJSON(`${msg} at position ${index}`)},parseAny=()=>(skipBlank(),index>=length&&markPartialJSON("Unexpected end of input"),jsonString[index]==='"'?parseStr():jsonString[index]==="{"?parseObj():jsonString[index]==="["?parseArr():jsonString.substring(index,index+4)==="null"||options_1.Allow.NULL&allow&&length-index<4&&"null".startsWith(jsonString.substring(index))?(index+=4,null):jsonString.substring(index,index+4)==="true"||
|
|
8
|
-
options_1.Allow.BOOL&allow&&length-index<4&&"true".startsWith(jsonString.substring(index))?(index+=4,!0):jsonString.substring(index,index+5)==="false"||options_1.Allow.BOOL&allow&&length-index<5&&"false".startsWith(jsonString.substring(index))?(index+=5,!1):jsonString.substring(index,index+8)==="Infinity"||options_1.Allow.INFINITY&allow&&length-index<8&&"Infinity".startsWith(jsonString.substring(index))?(index+=8,1/0):jsonString.substring(index,index+9)==="-Infinity"||options_1.Allow._INFINITY&allow&&
|
|
9
|
-
1<length-index&&length-index<9&&"-Infinity".startsWith(jsonString.substring(index))?(index+=9,-1/0):jsonString.substring(index,index+3)==="NaN"||options_1.Allow.NAN&allow&&length-index<3&&"NaN".startsWith(jsonString.substring(index))?(index+=3,NaN):parseNum()),parseStr=()=>{let start=index,escape=!1;for(index++;index<length&&(jsonString[index]!=='"'||escape&&jsonString[index-1]==="\\");)escape=jsonString[index]==="\\"?!escape:!1,index++;if(jsonString.charAt(index)=='"')try{return JSON.parse(jsonString.
|
|
10
|
-
substring(start,++index-Number(escape)))}catch(e){throwMalformedError(String(e))}else if(options_1.Allow.STR&allow)try{return JSON.parse(jsonString.substring(start,index-Number(escape))+'"')}catch{return JSON.parse(jsonString.substring(start,jsonString.lastIndexOf("\\"))+'"')}markPartialJSON("Unterminated string literal")},parseObj=()=>{index++,skipBlank();let obj={};try{for(;jsonString[index]!=="}";){if(skipBlank(),index>=length&&options_1.Allow.OBJ&allow)return obj;let key=parseStr();skipBlank(),
|
|
11
|
-
index++;try{let value=parseAny();obj[key]=value}catch(e){if(options_1.Allow.OBJ&allow)return obj;throw e}skipBlank(),jsonString[index]===","&&index++}}catch{if(options_1.Allow.OBJ&allow)return obj;markPartialJSON("Expected '}' at end of object")}return index++,obj},parseArr=()=>{index++;let arr=[];try{for(;jsonString[index]!=="]";)arr.push(parseAny()),skipBlank(),jsonString[index]===","&&index++}catch{if(options_1.Allow.ARR&allow)return arr;markPartialJSON("Expected ']' at end of array")}return index++,
|
|
12
|
-
arr},parseNum=()=>{if(index===0){jsonString==="-"&&throwMalformedError("Not sure what '-' is");try{return JSON.parse(jsonString)}catch(e){if(options_1.Allow.NUM&allow)try{return JSON.parse(jsonString.substring(0,jsonString.lastIndexOf("e")))}catch{}throwMalformedError(String(e))}}let start=index;for(jsonString[index]==="-"&&index++;jsonString[index]&&",]}".indexOf(jsonString[index])===-1;)index++;index==length&&!(options_1.Allow.NUM&allow)&&markPartialJSON("Unterminated number literal");try{return JSON.
|
|
13
|
-
parse(jsonString.substring(start,index))}catch{jsonString.substring(start,index)==="-"&&markPartialJSON("Not sure what '-' is");try{return JSON.parse(jsonString.substring(start,jsonString.lastIndexOf("e")))}catch(e2){throwMalformedError(String(e2))}}},skipBlank=()=>{for(;index<length&&`
|
|
14
|
-
\r `.includes(jsonString[index]);)index++};return parseAny()},parse=parseJSON;exports.parse=parse}});var import_partial_json=__toESM(require_dist(),1),VALID_JSON_ESCAPES=new Set(['"',"\\","/","b","f","n","r","t","u"]);function escapeControlCharacter(char){switch(char){case"\b":return"\\b";case"\f":return"\\f";case`
|
|
15
|
-
`:return"\\n";case"\r":return"\\r";case" ":return"\\t";default:return`\\u${char.codePointAt(0)?.toString(16).padStart(4,"0")??"0000"}`}}function repairJson(json){let repaired="",runStart=0,inString=!1;for(let index=0;index<json.length;index++){let code=json.charCodeAt(index);if(!inString){code===34&&(inString=!0);continue}if(code===34){inString=!1;continue}if(code===92){let nextChar=json[index+1];if(nextChar!==void 0&&VALID_JSON_ESCAPES.has(nextChar)){index+=1;continue}repaired+=`${json.slice(runStart,
|
|
16
|
-
index)}\\\\`,runStart=index+1;continue}code<=31&&(repaired+=json.slice(runStart,index)+escapeControlCharacter(json[index]),runStart=index+1)}return runStart===0?json:repaired+json.slice(runStart)}function parseJsonWithRepair(json){try{return JSON.parse(json)}catch(error){let repairedJson=repairJson(json);if(repairedJson!==json)return JSON.parse(repairedJson);throw error}}function mayBeCompleteJson(json){let first=0;for(;first<json.length&&isJsonWhitespace(json.charCodeAt(first));)first++;let open=json.
|
|
17
|
-
charCodeAt(first);if(open!==123&&open!==91)return!0;let last=json.length-1;for(;last>first&&isJsonWhitespace(json.charCodeAt(last));)last--;return json.charCodeAt(last)===(open===123?125:93)}function isJsonWhitespace(code){return code===32||code===10||code===13||code===9}function parseStreamingJsonWith(partialJson,scan){if(!partialJson||partialJson.trim()==="")return{};try{return JSON.parse(partialJson)}catch{if(mayBeCompleteJson(partialJson)){let repairedJson=repairJson(partialJson);if(repairedJson!==
|
|
18
|
-
partialJson)try{return JSON.parse(repairedJson)}catch{}}}if(scan){let completed=parsePartialJsonPrefix(scan,partialJson);if(completed!==void 0)return completed}try{return(0,import_partial_json.parse)(partialJson)??{}}catch{try{return(0,import_partial_json.parse)(repairJson(partialJson))??{}}catch{return{}}}}function parseStreamingJson(partialJson){return parseStreamingJsonWith(partialJson,void 0)}var VALUE=0,ARRAY_FIRST=1,OBJECT_FIRST=2,OBJECT_KEY=3,KEY_STRING=4,AFTER_KEY=5,VALUE_STRING=6,NUMBER=7,
|
|
19
|
-
LITERAL=8,AFTER_VALUE=9,DONE=10,ARRAY_FIRST_SPACED=11,NUMBER_MINUS=0,NUMBER_ZERO=1,NUMBER_INTEGER=2,NUMBER_DOT=3,NUMBER_FRACTION=4,NUMBER_E=5,NUMBER_E_SIGN=6,NUMBER_EXPONENT=7;function createPartialJsonScan(){return{text:"",valid:!0,protoKey:!1,state:VALUE,closers:[],committed:[],stringStart:0,escapeStart:-1,hexLeft:0,keyHasEscape:!1,literal:"",literalIndex:0,numberState:NUMBER_MINUS}}function isHexDigit(code){return code>=48&&code<=57||code>=65&&code<=70||code>=97&&code<=102}function isNumberComplete(numberState){
|
|
20
|
-
return numberState===NUMBER_ZERO||numberState===NUMBER_INTEGER||numberState===NUMBER_FRACTION||numberState===NUMBER_EXPONENT}function isTrimmedByTrim(code){return code>=9&&code<=13||code===32||code===160||code===5760||code>=8192&&code<=8202||code===8232||code===8233||code===8239||code===8287||code===12288||code===65279}function scanPartialJson(scan,text,start){let i=start,length=text.length,nextQuote=-2,nextBackslash=-2,endValue=end=>{scan.closers.length===0?scan.state=DONE:(scan.committed[scan.
|
|
21
|
-
committed.length-1]=end,scan.state=AFTER_VALUE)};for(;i<length;){let state=scan.state;if(state===KEY_STRING||state===VALUE_STRING){if(scan.escapeStart!==-1){let code2=text.charCodeAt(i);if(scan.hexLeft>0){if(!isHexDigit(code2)){scan.valid=!1;return}scan.hexLeft--,scan.hexLeft===0&&(scan.escapeStart=-1)}else if(code2===117)scan.hexLeft=4;else if(code2===34||code2===92||code2===47||code2===98||code2===102||code2===110||code2===114||code2===116)scan.escapeStart=-1;else{scan.valid=!1;return}i++;continue}
|
|
22
|
-
nextQuote!==-1&&nextQuote<i&&(nextQuote=text.indexOf('"',i)),nextBackslash!==-1&&nextBackslash<i&&(nextBackslash=text.indexOf("\\",i));let quote=nextQuote,backslash=nextBackslash!==-1&&(quote===-1||nextBackslash<quote)?nextBackslash:-1;if(backslash!==-1){scan.escapeStart=backslash,state===KEY_STRING&&(scan.keyHasEscape=!0),i=backslash+1;continue}if(quote===-1){i=length;break}state===KEY_STRING?((scan.keyHasEscape||quote-scan.stringStart===10&&text.startsWith("__proto__",scan.stringStart+1))&&(scan.
|
|
23
|
-
protoKey=!0),scan.state=AFTER_KEY):endValue(quote+1),i=quote+1;continue}let code=text.charCodeAt(i);if(state===NUMBER){let numberState=scan.numberState;if(code>=48&&code<=57){if(numberState===NUMBER_MINUS)scan.numberState=code===48?NUMBER_ZERO:NUMBER_INTEGER;else if(numberState===NUMBER_ZERO){scan.valid=!1;return}else numberState===NUMBER_DOT?scan.numberState=NUMBER_FRACTION:(numberState===NUMBER_E||numberState===NUMBER_E_SIGN)&&(scan.numberState=NUMBER_EXPONENT);i++;continue}if(code===46&&(numberState===
|
|
24
|
-
NUMBER_ZERO||numberState===NUMBER_INTEGER)){scan.numberState=NUMBER_DOT,i++;continue}if((code===101||code===69)&&(numberState===NUMBER_ZERO||numberState===NUMBER_INTEGER||numberState===NUMBER_FRACTION)){scan.numberState=NUMBER_E,i++;continue}if((code===43||code===45)&&numberState===NUMBER_E){scan.numberState=NUMBER_E_SIGN,i++;continue}if(!isNumberComplete(numberState)){scan.valid=!1;return}endValue(i);continue}if(state===LITERAL){if(code!==scan.literal.charCodeAt(scan.literalIndex)){scan.valid=!1;
|
|
25
|
-
return}scan.literalIndex++,i++,scan.literalIndex===scan.literal.length&&endValue(i);continue}if(i++,isJsonWhitespace(code)){state===ARRAY_FIRST&&(scan.state=ARRAY_FIRST_SPACED);continue}if(state===VALUE||state===ARRAY_FIRST||state===ARRAY_FIRST_SPACED){if(code===93&&state===ARRAY_FIRST_SPACED){scan.valid=!1;return}if(code===93&&state===ARRAY_FIRST)scan.closers.pop(),scan.committed.pop(),endValue(i);else if(code===123||code===91)scan.closers.push(code===123?125:93),scan.committed.push(i),scan.state=
|
|
26
|
-
code===123?OBJECT_FIRST:ARRAY_FIRST;else if(scan.closers.length===0){scan.valid=!1;return}else if(code===34)scan.stringStart=i-1,scan.state=VALUE_STRING;else if(code===45||code>=48&&code<=57)scan.numberState=code===45?NUMBER_MINUS:code===48?NUMBER_ZERO:NUMBER_INTEGER,scan.state=NUMBER;else if(code===116||code===102||code===110)scan.literal=code===116?"true":code===102?"false":"null",scan.literalIndex=1,scan.state=LITERAL;else{scan.valid=!1;return}}else if(state===OBJECT_FIRST||state===OBJECT_KEY)
|
|
27
|
-
if(code===125&&state===OBJECT_FIRST)scan.closers.pop(),scan.committed.pop(),endValue(i);else if(code===34)scan.stringStart=i-1,scan.keyHasEscape=!1,scan.state=KEY_STRING;else{scan.valid=!1;return}else if(state===AFTER_KEY){if(code!==58){scan.valid=!1;return}scan.state=VALUE}else if(state===AFTER_VALUE){let closer=scan.closers[scan.closers.length-1];if(code===44)scan.state=closer===125?OBJECT_KEY:VALUE;else if(code===closer)scan.closers.pop(),scan.committed.pop(),endValue(i);else{scan.valid=!1;return}}else{
|
|
28
|
-
scan.valid=!1;return}}}function parsePartialJsonPrefix(scan,text){if(scan.text.length>0&&text.length>=scan.text.length&&text.startsWith(scan.text)?scan.valid&&scanPartialJson(scan,text,scan.text.length):(Object.assign(scan,createPartialJsonScan()),scanPartialJson(scan,text,0)),scan.text=text,!scan.valid||scan.protoKey||scan.closers.length===0)return;let completed,state=scan.state;if(state===AFTER_VALUE)completed=text;else if(state===LITERAL)completed=text+scan.literal.slice(scan.literalIndex);else if(state===
|
|
29
|
-
NUMBER){if(!isNumberComplete(scan.numberState))return;completed=text}else if(state===VALUE_STRING){let end=text.length;for(;end>scan.stringStart+1&&isTrimmedByTrim(text.charCodeAt(end-1));)end--;end<text.length?completed=`${text.slice(0,end)}"`:scan.escapeStart!==-1?completed=`${text.slice(0,scan.escapeStart)}"`:completed=`${text}"`}else completed=text.slice(0,scan.committed[scan.committed.length-1]);for(let level=scan.closers.length-1;level>=0;level--)completed+=scan.closers[level]===125?"}":"]";
|
|
30
|
-
try{return JSON.parse(completed)}catch{return}}var lengthsParsedWhileStreaming=new WeakMap,textsParsedWhileStreaming=new WeakMap,scansWhileStreaming=new WeakMap;function parseStreamingJsonWhileStreaming(block,partialJson,current){let length=partialJson?.length??0,parsed=lengthsParsedWhileStreaming.get(block);if(current!==void 0&&parsed!==void 0&&(length>parsed||partialJson===textsParsedWhileStreaming.get(block))&&length-parsed<(parsed<1024?1:parsed>>3))return current;lengthsParsedWhileStreaming.
|
|
31
|
-
set(block,length),textsParsedWhileStreaming.set(block,partialJson);let scan=scansWhileStreaming.get(block);return scan||(scan=createPartialJsonScan(),scansWhileStreaming.set(block,scan)),parseStreamingJsonWith(partialJson,scan)}export{require_dist,repairJson,parseJsonWithRepair,parseStreamingJson,parseStreamingJsonWhileStreaming};
|