@humain/humain-code 0.4.15 → 0.4.17

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.
Files changed (309) hide show
  1. package/CHANGELOG.md +74 -0
  2. package/README.md +1 -1
  3. package/dist/bundle/agent-monitor.js +1 -1
  4. package/dist/bundle/chunks/anthropic-messages-TSNY5MWH.js +67 -0
  5. package/dist/bundle/chunks/azure-openai-responses-Z4DCXO2G.js +15 -0
  6. package/dist/bundle/chunks/bedrock-converse-stream.js +59 -42
  7. package/dist/bundle/chunks/{chunk-JRX7GYW3.js → chunk-4NFYTS4C.js} +8 -8
  8. package/dist/bundle/chunks/{chunk-MF2NEHP4.js → chunk-4XU7TDAL.js} +939 -560
  9. package/dist/bundle/chunks/{chunk-LUL775V7.js → chunk-5K5RFXXO.js} +4 -4
  10. package/dist/bundle/chunks/chunk-65U7MPF4.js +1790 -0
  11. package/dist/bundle/chunks/{chunk-AIXI6RIE.js → chunk-7PRU6YW3.js} +114 -82
  12. package/dist/bundle/chunks/{chunk-W5YJZKPF.js → chunk-AOL6QG6L.js} +2231 -2399
  13. package/dist/bundle/chunks/chunk-AWCJWXGD.js +212 -0
  14. package/dist/bundle/chunks/{chunk-NNKA2PAP.js → chunk-FHVNUUBF.js} +1 -1
  15. package/dist/bundle/chunks/chunk-FZUJXM6D.js +816 -0
  16. package/dist/bundle/chunks/chunk-IJYVMOB4.js +6 -0
  17. package/dist/bundle/chunks/chunk-LG2PJ6JN.js +131 -0
  18. package/dist/bundle/chunks/chunk-NCQ6WAQK.js +125 -0
  19. package/dist/bundle/chunks/{chunk-Z74ZYQPX.js → chunk-OKALNPTJ.js} +80 -210
  20. package/dist/bundle/chunks/{chunk-OX2IBCCA.js → chunk-PTP2ZHFQ.js} +88 -82
  21. package/dist/bundle/chunks/chunk-PY7SOXCA.js +10 -0
  22. package/dist/bundle/chunks/chunk-Q7VXYXY3.js +7 -0
  23. package/dist/bundle/chunks/{chunk-COF5P635.js → chunk-QEF72EIZ.js} +13 -13
  24. package/dist/bundle/chunks/{chunk-EYIYBQAR.js → chunk-RXOCQRBG.js} +1 -1
  25. package/dist/bundle/chunks/{chunk-BVHXWQLD.js → chunk-SCBU5WOP.js} +1 -1
  26. package/dist/bundle/chunks/{chunk-UDVC7A5S.js → chunk-TIFFHHW6.js} +16 -14
  27. package/dist/bundle/chunks/{chunk-L3J4P5JR.js → chunk-UGJAAWNC.js} +1 -1
  28. package/dist/bundle/chunks/chunk-V76YPIMT.js +48 -0
  29. package/dist/bundle/chunks/{chunk-Y3RFGBG2.js → chunk-X3O5MCKJ.js} +1 -1
  30. package/dist/bundle/chunks/{chunk-KK3KUUMM.js → chunk-X6OTEVGA.js} +71 -66
  31. package/dist/bundle/chunks/chunk-Y26OS23T.js +80 -0
  32. package/dist/bundle/chunks/chunk-YDBNMIA3.js +34 -0
  33. package/dist/bundle/chunks/{chunk-UHLW4KJ7.js → chunk-ZRGFX6T6.js} +92 -89
  34. package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-JGN7NZCV.js → cloudflare-workers-ai-system-one-MUJQ6LT2.js} +1 -1
  35. package/dist/bundle/chunks/{compat-2S3PCPEI.js → compat-ARQPWKBQ.js} +8 -8
  36. package/dist/bundle/chunks/{dist-SGQMXO45.js → dist-D7M52E3X.js} +1416 -866
  37. package/dist/bundle/chunks/dist-LKDZAEUQ.js +7 -0
  38. package/dist/bundle/chunks/{dist-JXEXN6S2.js → dist-XVXV2CL4.js} +1 -1
  39. package/dist/bundle/chunks/dist-cjs-AXBW3N4F.js +182 -0
  40. package/dist/bundle/chunks/{easter-egg-3d-ZJ2JUFOA.js → easter-egg-3d-4SUPLBUF.js} +1 -1
  41. package/dist/bundle/chunks/{execute-LRTXH4YJ.js → execute-NTO3U76E.js} +10 -9
  42. package/dist/bundle/chunks/{extract-OZW5JHG6.js → extract-BKBHK4AK.js} +14 -13
  43. package/dist/bundle/chunks/github-copilot.js +34 -47
  44. package/dist/bundle/chunks/{google-generative-ai-YXXFSTX7.js → google-generative-ai-SJ4JO2MY.js} +2 -2
  45. package/dist/bundle/chunks/{google-vertex-3IVWLYJ5.js → google-vertex-KNLNNDET.js} +2 -2
  46. package/dist/bundle/chunks/host-63SNKK5Y.js +2 -0
  47. package/dist/bundle/chunks/jiti-static-loader-7OZNBOCI.js +2 -0
  48. package/dist/bundle/chunks/{mistral-conversations-Y7GWO3QB.js → mistral-conversations-G3GN6CMT.js} +20 -20
  49. package/dist/bundle/chunks/{node-SPBTZUUS.js → node-DZCAT4Q6.js} +1 -1
  50. package/dist/bundle/chunks/{openai-codex-responses-NSXWHIDT.js → openai-codex-responses-FJFDAWHI.js} +17 -17
  51. package/dist/bundle/chunks/openai-completions-IC7WRLTI.js +82 -0
  52. package/dist/bundle/chunks/{openai-decisions-QWEISDVO.js → openai-decisions-HESOHYZB.js} +1 -1
  53. package/dist/bundle/chunks/openai-responses-XXCYDFSM.js +24 -0
  54. package/dist/bundle/chunks/{openrouter-images-BMVMAROU.js → openrouter-images-DT2HMZNO.js} +1 -1
  55. package/dist/bundle/chunks/pdfjs-EK6K7CXX.js +3593 -0
  56. package/dist/bundle/chunks/{pi-messages-XNEG23NU.js → pi-messages-SAOV3JNW.js} +1 -1
  57. package/dist/bundle/chunks/{typesafe-system-one-62YHYXZV.js → typesafe-system-one-HCMGHK6A.js} +1 -1
  58. package/dist/bundle/chunks/{undici-7EW63V4X.js → undici-N4LWJ3S3.js} +1 -1
  59. package/dist/bundle/chunks/virtual-modules-LP2ULVLW.js +5 -0
  60. package/dist/bundle/cli-runtime.js +3 -3
  61. package/dist/bundle/cli.js +2 -2
  62. package/dist/bundle/flow/package.json +6 -5
  63. package/dist/bundle/index.js +8 -8
  64. package/dist/bundle/rpc-entry.js +3 -3
  65. package/dist/cli/credential-print.d.ts.map +1 -1
  66. package/dist/cli/credential-print.js +4 -4
  67. package/dist/cli/credential-print.js.map +1 -1
  68. package/dist/coordination/adapter/index.d.ts.map +1 -1
  69. package/dist/coordination/adapter/index.js +1 -1
  70. package/dist/coordination/adapter/index.js.map +1 -1
  71. package/dist/coordination/adapter/integration-notices.d.ts +1 -1
  72. package/dist/coordination/adapter/integration-notices.d.ts.map +1 -1
  73. package/dist/coordination/adapter/integration-notices.js +5 -2
  74. package/dist/coordination/adapter/integration-notices.js.map +1 -1
  75. package/dist/coordination/broker/extension-state.js +3 -3
  76. package/dist/coordination/broker/extension-state.js.map +1 -1
  77. package/dist/coordination/transport/framing.d.ts.map +1 -1
  78. package/dist/coordination/transport/framing.js +2 -1
  79. package/dist/coordination/transport/framing.js.map +1 -1
  80. package/dist/core/account-reporting.d.ts +3 -1
  81. package/dist/core/account-reporting.d.ts.map +1 -1
  82. package/dist/core/account-reporting.js +12 -2
  83. package/dist/core/account-reporting.js.map +1 -1
  84. package/dist/core/agent-session-services.d.ts.map +1 -1
  85. package/dist/core/agent-session-services.js +39 -36
  86. package/dist/core/agent-session-services.js.map +1 -1
  87. package/dist/core/agent-session.d.ts +4 -2
  88. package/dist/core/agent-session.d.ts.map +1 -1
  89. package/dist/core/agent-session.js +5 -4
  90. package/dist/core/agent-session.js.map +1 -1
  91. package/dist/core/codex-usage.d.ts +11 -2
  92. package/dist/core/codex-usage.d.ts.map +1 -1
  93. package/dist/core/codex-usage.js +74 -2
  94. package/dist/core/codex-usage.js.map +1 -1
  95. package/dist/core/export-html/template.js +21 -16
  96. package/dist/core/model-config.d.ts +33 -8
  97. package/dist/core/model-config.d.ts.map +1 -1
  98. package/dist/core/model-config.js +22 -4
  99. package/dist/core/model-config.js.map +1 -1
  100. package/dist/core/model-resolver.d.ts +56 -43
  101. package/dist/core/model-resolver.d.ts.map +1 -1
  102. package/dist/core/model-resolver.js +256 -361
  103. package/dist/core/model-resolver.js.map +1 -1
  104. package/dist/core/model-runtime.d.ts +6 -3
  105. package/dist/core/model-runtime.d.ts.map +1 -1
  106. package/dist/core/model-runtime.js +19 -5
  107. package/dist/core/model-runtime.js.map +1 -1
  108. package/dist/core/models-store.d.ts.map +1 -1
  109. package/dist/core/models-store.js +7 -2
  110. package/dist/core/models-store.js.map +1 -1
  111. package/dist/core/oauth-account-pool.d.ts +9 -1
  112. package/dist/core/oauth-account-pool.d.ts.map +1 -1
  113. package/dist/core/oauth-account-pool.js +63 -12
  114. package/dist/core/oauth-account-pool.js.map +1 -1
  115. package/dist/core/prompt-templates.d.ts.map +1 -1
  116. package/dist/core/prompt-templates.js +7 -2
  117. package/dist/core/prompt-templates.js.map +1 -1
  118. package/dist/core/settings-defaults.d.ts +2 -0
  119. package/dist/core/settings-defaults.d.ts.map +1 -1
  120. package/dist/core/settings-defaults.js +2 -0
  121. package/dist/core/settings-defaults.js.map +1 -1
  122. package/dist/core/settings-manager.d.ts +4 -2
  123. package/dist/core/settings-manager.d.ts.map +1 -1
  124. package/dist/core/settings-manager.js +11 -0
  125. package/dist/core/settings-manager.js.map +1 -1
  126. package/dist/core/settings-schema.d.ts +4 -0
  127. package/dist/core/settings-schema.d.ts.map +1 -1
  128. package/dist/core/settings-schema.js +8 -0
  129. package/dist/core/settings-schema.js.map +1 -1
  130. package/dist/core/slash-commands.js +1 -1
  131. package/dist/core/slash-commands.js.map +1 -1
  132. package/dist/core/tools/render-utils.d.ts +2 -0
  133. package/dist/core/tools/render-utils.d.ts.map +1 -1
  134. package/dist/core/tools/render-utils.js +21 -0
  135. package/dist/core/tools/render-utils.js.map +1 -1
  136. package/dist/core/tools/renderers/read.d.ts.map +1 -1
  137. package/dist/core/tools/renderers/read.js +7 -10
  138. package/dist/core/tools/renderers/read.js.map +1 -1
  139. package/dist/core/tools/subagent.d.ts.map +1 -1
  140. package/dist/core/tools/subagent.js +4 -7
  141. package/dist/core/tools/subagent.js.map +1 -1
  142. package/dist/core/trace/redaction.d.ts.map +1 -1
  143. package/dist/core/trace/redaction.js +3 -1
  144. package/dist/core/trace/redaction.js.map +1 -1
  145. package/dist/extensions/codemode/execute.d.ts.map +1 -1
  146. package/dist/extensions/codemode/execute.js +12 -0
  147. package/dist/extensions/codemode/execute.js.map +1 -1
  148. package/dist/extensions/codemode/index.d.ts.map +1 -1
  149. package/dist/extensions/codemode/index.js +5 -0
  150. package/dist/extensions/codemode/index.js.map +1 -1
  151. package/dist/humain/bedrock-provider/vendor/index.bundle.mjs +74 -20
  152. package/dist/humain/flow-accounts-host.d.ts.map +1 -1
  153. package/dist/humain/flow-accounts-host.js +3 -0
  154. package/dist/humain/flow-accounts-host.js.map +1 -1
  155. package/dist/humain/node-provider.d.ts.map +1 -1
  156. package/dist/humain/node-provider.js +2 -0
  157. package/dist/humain/node-provider.js.map +1 -1
  158. package/dist/humain/trace-capture/index.js +3 -3
  159. package/dist/humain/trace-capture/index.js.map +1 -1
  160. package/dist/humain/web-access/vendor/credential-source.d.ts +2 -0
  161. package/dist/humain/web-access/vendor/credential-source.d.ts.map +1 -1
  162. package/dist/humain/web-access/vendor/credential-source.js +50 -4
  163. package/dist/humain/web-access/vendor/credential-source.js.map +1 -1
  164. package/dist/humain/web-access/vendor/curator-page.d.ts.map +1 -1
  165. package/dist/humain/web-access/vendor/curator-page.js +3 -1
  166. package/dist/humain/web-access/vendor/curator-page.js.map +1 -1
  167. package/dist/humain/web-access/vendor/curator-server.d.ts.map +1 -1
  168. package/dist/humain/web-access/vendor/curator-server.js +2 -0
  169. package/dist/humain/web-access/vendor/curator-server.js.map +1 -1
  170. package/dist/humain/web-access/vendor/deepseek.d.ts +4 -0
  171. package/dist/humain/web-access/vendor/deepseek.d.ts.map +1 -0
  172. package/dist/humain/web-access/vendor/deepseek.js +201 -0
  173. package/dist/humain/web-access/vendor/deepseek.js.map +1 -0
  174. package/dist/humain/web-access/vendor/extract.d.ts.map +1 -1
  175. package/dist/humain/web-access/vendor/extract.js +4 -2
  176. package/dist/humain/web-access/vendor/extract.js.map +1 -1
  177. package/dist/humain/web-access/vendor/gemini-adc.d.ts.map +1 -1
  178. package/dist/humain/web-access/vendor/gemini-adc.js +49 -5
  179. package/dist/humain/web-access/vendor/gemini-adc.js.map +1 -1
  180. package/dist/humain/web-access/vendor/gemini-search.d.ts +3 -3
  181. package/dist/humain/web-access/vendor/gemini-search.d.ts.map +1 -1
  182. package/dist/humain/web-access/vendor/gemini-search.js +11 -4
  183. package/dist/humain/web-access/vendor/gemini-search.js.map +1 -1
  184. package/dist/humain/web-access/vendor/index.d.ts.map +1 -1
  185. package/dist/humain/web-access/vendor/index.js +16 -1
  186. package/dist/humain/web-access/vendor/index.js.map +1 -1
  187. package/dist/humain/web-access/vendor/page-query.d.ts.map +1 -1
  188. package/dist/humain/web-access/vendor/page-query.js +12 -6
  189. package/dist/humain/web-access/vendor/page-query.js.map +1 -1
  190. package/dist/humain/web-access/vendor/query-rewrite.d.ts.map +1 -1
  191. package/dist/humain/web-access/vendor/query-rewrite.js +11 -4
  192. package/dist/humain/web-access/vendor/query-rewrite.js.map +1 -1
  193. package/dist/humain/web-access/vendor/searxng.d.ts.map +1 -1
  194. package/dist/humain/web-access/vendor/searxng.js +2 -1
  195. package/dist/humain/web-access/vendor/searxng.js.map +1 -1
  196. package/dist/humain/web-access/vendor/ssrf-protection.d.ts +1 -0
  197. package/dist/humain/web-access/vendor/ssrf-protection.d.ts.map +1 -1
  198. package/dist/humain/web-access/vendor/ssrf-protection.js +10 -0
  199. package/dist/humain/web-access/vendor/ssrf-protection.js.map +1 -1
  200. package/dist/humain/web-access/vendor/summary-review.d.ts.map +1 -1
  201. package/dist/humain/web-access/vendor/summary-review.js +17 -6
  202. package/dist/humain/web-access/vendor/summary-review.js.map +1 -1
  203. package/dist/humain/web-access/vendor/utils.d.ts +2 -0
  204. package/dist/humain/web-access/vendor/utils.d.ts.map +1 -1
  205. package/dist/humain/web-access/vendor/utils.js +18 -0
  206. package/dist/humain/web-access/vendor/utils.js.map +1 -1
  207. package/dist/humain/web-access/vendor/web-tool-core.d.ts +2 -0
  208. package/dist/humain/web-access/vendor/web-tool-core.d.ts.map +1 -1
  209. package/dist/humain/web-access/vendor/web-tool-core.js.map +1 -1
  210. package/dist/index.d.ts +1 -0
  211. package/dist/index.d.ts.map +1 -1
  212. package/dist/index.js.map +1 -1
  213. package/dist/main.d.ts.map +1 -1
  214. package/dist/main.js +1 -0
  215. package/dist/main.js.map +1 -1
  216. package/dist/modes/interactive/components/settings-selector.d.ts +3 -1
  217. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  218. package/dist/modes/interactive/components/settings-selector.js +10 -0
  219. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  220. package/dist/modes/interactive/components/status-indicator.d.ts +5 -0
  221. package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
  222. package/dist/modes/interactive/components/status-indicator.js +27 -2
  223. package/dist/modes/interactive/components/status-indicator.js.map +1 -1
  224. package/dist/modes/interactive/components/tool-execution.d.ts +2 -1
  225. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  226. package/dist/modes/interactive/components/tool-execution.js +4 -2
  227. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  228. package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
  229. package/dist/modes/interactive/components/tree-selector.js +2 -9
  230. package/dist/modes/interactive/components/tree-selector.js.map +1 -1
  231. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  232. package/dist/modes/interactive/interactive-mode.js +28 -14
  233. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  234. package/dist/modes/interactive/oauth-account-format.d.ts +4 -4
  235. package/dist/modes/interactive/oauth-account-format.d.ts.map +1 -1
  236. package/dist/modes/interactive/oauth-account-format.js +5 -2
  237. package/dist/modes/interactive/oauth-account-format.js.map +1 -1
  238. package/dist/modes/interactive/session-share.d.ts.map +1 -1
  239. package/dist/modes/interactive/session-share.js +9 -2
  240. package/dist/modes/interactive/session-share.js.map +1 -1
  241. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  242. package/dist/modes/rpc/rpc-mode.js +8 -3
  243. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  244. package/dist/utils/tools-manager.d.ts.map +1 -1
  245. package/dist/utils/tools-manager.js +2 -1
  246. package/dist/utils/tools-manager.js.map +1 -1
  247. package/docs/cli.md +3 -3
  248. package/docs/codemode.md +3 -1
  249. package/docs/coordination.md +6 -0
  250. package/docs/docs.json +4 -0
  251. package/docs/environment-variables.md +4 -0
  252. package/docs/flow.md +6 -0
  253. package/docs/humain-code-forge-flow-walkthrough.md +1 -1
  254. package/docs/humain-code.md +2 -4
  255. package/docs/json.md +2 -2
  256. package/docs/llama-cpp.md +1 -1
  257. package/docs/nvidia-rtx-llama-cpp.md +96 -0
  258. package/docs/rpc-commands.md +1 -1
  259. package/docs/rpc.md +9 -1
  260. package/docs/sessions.md +1 -1
  261. package/docs/settings.md +2 -0
  262. package/docs/trace.md +4 -0
  263. package/docs/usage.md +1 -1
  264. package/examples/extensions/custom-provider-anthropic/package-lock.json +16 -6
  265. package/examples/extensions/custom-provider-anthropic/package.json +2 -2
  266. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  267. package/examples/extensions/gondolin/package-lock.json +16 -16
  268. package/examples/extensions/gondolin/package.json +1 -1
  269. package/examples/extensions/minimal-mode.ts +4 -4
  270. package/examples/extensions/sandbox/package-lock.json +6 -6
  271. package/examples/extensions/sandbox/package.json +2 -2
  272. package/examples/extensions/with-deps/package-lock.json +2 -2
  273. package/examples/extensions/with-deps/package.json +1 -1
  274. package/examples/plugins/pi-example-plugin/package.json +2 -2
  275. package/examples/rpc-subagent-progress-host.ts +6 -2
  276. package/npm-shrinkwrap.json +129 -171
  277. package/package.json +19 -19
  278. package/schemas/models.schema.json +9 -5
  279. package/schemas/settings.schema.json +32 -0
  280. package/src/coordination/UPSTREAM.md +31 -1
  281. package/src/coordination/upstream.json +3 -3
  282. package/src/humain/adhd/UPSTREAM.md +8 -0
  283. package/src/humain/caveman/UPSTREAM.md +19 -3
  284. package/src/humain/caveman/upstream.json +2 -2
  285. package/src/humain/ponytail/UPSTREAM.md +23 -2
  286. package/src/humain/ponytail/upstream.json +8 -8
  287. package/src/humain/ponytail/vendor/skills/ponytail/SKILL.md +1 -1
  288. package/src/humain/ponytail/vendor/skills/ponytail-debt/SKILL.md +1 -2
  289. package/src/humain/ponytail/vendor/skills/ponytail-gain/SKILL.md +0 -1
  290. package/src/humain/web-access/UPSTREAM.md +45 -1
  291. package/src/humain/web-access/upstream.json +4 -4
  292. package/dist/bundle/chunks/anthropic-messages-YSAHA7QM.js +0 -67
  293. package/dist/bundle/chunks/azure-openai-responses-Z5XYDPHS.js +0 -15
  294. package/dist/bundle/chunks/chunk-2TTB6GIB.js +0 -47
  295. package/dist/bundle/chunks/chunk-5JHUWRJN.js +0 -1790
  296. package/dist/bundle/chunks/chunk-A7QKOI62.js +0 -572
  297. package/dist/bundle/chunks/chunk-FRUFMISJ.js +0 -505
  298. package/dist/bundle/chunks/chunk-MG5PX4KU.js +0 -31
  299. package/dist/bundle/chunks/chunk-OEOXBLWI.js +0 -540
  300. package/dist/bundle/chunks/chunk-RYC5BYVE.js +0 -5
  301. package/dist/bundle/chunks/chunk-YJ3NQWES.js +0 -9
  302. package/dist/bundle/chunks/dist-MNSGVI4C.js +0 -7
  303. package/dist/bundle/chunks/dist-cjs-4BMVQ74V.js +0 -179
  304. package/dist/bundle/chunks/host-2RMBOGA7.js +0 -2
  305. package/dist/bundle/chunks/jiti-static-loader-2RCDI6B4.js +0 -2
  306. package/dist/bundle/chunks/openai-completions-WGBQHTYA.js +0 -79
  307. package/dist/bundle/chunks/openai-responses-OKGCSIEY.js +0 -23
  308. package/dist/bundle/chunks/pdfjs-6UVU6XFX.js +0 -3564
  309. package/dist/bundle/chunks/virtual-modules-7HDINPIK.js +0 -5
@@ -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};