@humain/humain-code 0.4.12 → 0.4.13

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 (539) hide show
  1. package/CHANGELOG.md +15 -1
  2. package/dist/bun/sandbox-env-setup.js +1 -1
  3. package/dist/bun/sandbox-env-setup.js.map +1 -1
  4. package/dist/bundle/agent-monitor.js +1 -1
  5. package/dist/bundle/chunks/anthropic-messages-YSAHA7QM.js +67 -0
  6. package/dist/bundle/chunks/azure-openai-responses-Z5XYDPHS.js +15 -0
  7. package/dist/bundle/chunks/bedrock-converse-stream.js +393 -314
  8. package/dist/bundle/chunks/{chunk-EDKZRYWJ.js → chunk-2TTB6GIB.js} +2 -2
  9. package/dist/bundle/chunks/{chunk-HSDTSUZE.js → chunk-36Q5UVQL.js} +47 -89
  10. package/dist/bundle/chunks/chunk-4DXXZHY2.js +540 -0
  11. package/dist/bundle/chunks/{chunk-BKJU56SM.js → chunk-A7QKOI62.js} +142 -126
  12. package/dist/bundle/chunks/{chunk-UW4GMZL3.js → chunk-AIXI6RIE.js} +264 -248
  13. package/dist/bundle/chunks/{chunk-V5ZF7Q7L.js → chunk-BVHXWQLD.js} +52 -47
  14. package/dist/bundle/chunks/{chunk-I2ZWZAIV.js → chunk-COF5P635.js} +222 -148
  15. package/dist/bundle/chunks/{chunk-SCIGZFN5.js → chunk-DNGJMRJW.js} +11 -11
  16. package/dist/bundle/chunks/{chunk-XGO43DKL.js → chunk-DUSJT2W4.js} +21 -25
  17. package/dist/bundle/chunks/chunk-EYIYBQAR.js +7 -0
  18. package/dist/bundle/chunks/chunk-FRUFMISJ.js +505 -0
  19. package/dist/bundle/chunks/{chunk-R5VIAWGA.js → chunk-H2FY3PEV.js} +9 -8
  20. package/dist/bundle/chunks/{chunk-KGI4EX6R.js → chunk-JNHXXVLA.js} +126 -125
  21. package/dist/bundle/chunks/{chunk-45ZBHMQG.js → chunk-JQCWRL5K.js} +4 -4
  22. package/dist/bundle/chunks/{chunk-AS2Y2MO6.js → chunk-KK3KUUMM.js} +643 -624
  23. package/dist/bundle/chunks/{chunk-6KAMTNN3.js → chunk-L3J4P5JR.js} +1 -1
  24. package/dist/bundle/chunks/chunk-L6Z6JKKC.js +3 -0
  25. package/dist/bundle/chunks/{chunk-DZ5C66IU.js → chunk-LUL775V7.js} +33 -33
  26. package/dist/bundle/chunks/{chunk-BRXQUQSC.js → chunk-MF2NEHP4.js} +778 -775
  27. package/dist/bundle/chunks/chunk-MG5PX4KU.js +31 -0
  28. package/dist/bundle/chunks/{chunk-LCOHFEZZ.js → chunk-NNKA2PAP.js} +1 -1
  29. package/dist/bundle/chunks/{chunk-HMWAH7ZY.js → chunk-OX2IBCCA.js} +53 -49
  30. package/dist/bundle/chunks/{chunk-WBJN6PEI.js → chunk-QYCOHSI7.js} +1 -1
  31. package/dist/bundle/chunks/{chunk-NLTW6A7G.js → chunk-TC7EANW4.js} +3730 -3353
  32. package/dist/bundle/chunks/{chunk-77EWF2NW.js → chunk-TJG52LZB.js} +1 -1
  33. package/dist/bundle/chunks/{chunk-5XD3DHYL.js → chunk-UDVC7A5S.js} +1 -1
  34. package/dist/bundle/chunks/chunk-UGXYG7HN.js +22 -0
  35. package/dist/bundle/chunks/{chunk-VYIIPF57.js → chunk-UHLW4KJ7.js} +419 -413
  36. package/dist/bundle/chunks/{chunk-FF26YENK.js → chunk-W2QRCQBX.js} +4 -3
  37. package/dist/bundle/chunks/chunk-XQRYOCHA.js +26 -0
  38. package/dist/bundle/chunks/{chunk-7Z5MWPYE.js → chunk-Y3RFGBG2.js} +1 -1
  39. package/dist/bundle/chunks/chunk-YJ3NQWES.js +9 -0
  40. package/dist/bundle/chunks/{chunk-YJBE3IGR.js → chunk-YRCLNWFV.js} +20 -20
  41. package/dist/bundle/chunks/chunk-YZMQXAJM.js +8 -0
  42. package/dist/bundle/chunks/{chunk-BHM75BJJ.js → chunk-Z74ZYQPX.js} +207 -79
  43. package/dist/bundle/chunks/{cli-5ACW3WND.js → cli-SRI4UOSL.js} +6 -6
  44. package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-FZ3UQCZ7.js → cloudflare-workers-ai-system-one-JGN7NZCV.js} +1 -1
  45. package/dist/bundle/chunks/codemode-worker.js +27 -14
  46. package/dist/bundle/chunks/{compat-KXWWOFHQ.js → compat-PCHMBE76.js} +6 -6
  47. package/dist/bundle/chunks/dist-MNSGVI4C.js +7 -0
  48. package/dist/bundle/chunks/{dist-6SWVHFCS.js → dist-UWE5M6HK.js} +211 -8
  49. package/dist/bundle/chunks/{dist-cjs-RL2OCAP2.js → dist-cjs-4BMVQ74V.js} +1 -1
  50. package/dist/bundle/chunks/{easter-egg-3d-3L3IKAT6.js → easter-egg-3d-ZJ2JUFOA.js} +1 -1
  51. package/dist/bundle/chunks/es-YEFEOGR3.js +1905 -0
  52. package/dist/bundle/chunks/{esm-763X2IA7.js → esm-NCUV2DF7.js} +1 -1
  53. package/dist/bundle/chunks/{event-streams-R5OECII4.js → event-streams-NXFTZDSF.js} +1 -1
  54. package/dist/bundle/chunks/execute-LRTXH4YJ.js +553 -0
  55. package/dist/bundle/chunks/{extract-DLZ425VI.js → extract-OZW5JHG6.js} +140 -120
  56. package/dist/bundle/chunks/{google-generative-ai-JD2FVOIX.js → google-generative-ai-YXXFSTX7.js} +2 -2
  57. package/dist/bundle/chunks/{google-vertex-PFBMDCBW.js → google-vertex-3IVWLYJ5.js} +2 -2
  58. package/dist/bundle/chunks/host-2RMBOGA7.js +2 -0
  59. package/dist/bundle/chunks/{mistral-conversations-D74NZ65O.js → mistral-conversations-Y7GWO3QB.js} +14 -13
  60. package/dist/bundle/chunks/{node-W47VUEGE.js → node-ELWNZC34.js} +328 -337
  61. package/dist/bundle/chunks/{node-4GGYDW5Q.js → node-SPBTZUUS.js} +26 -25
  62. package/dist/bundle/chunks/{openai-codex-responses-JAAA7MSS.js → openai-codex-responses-NSXWHIDT.js} +3 -4
  63. package/dist/bundle/chunks/{openai-completions-PGPMGQPU.js → openai-completions-WGBQHTYA.js} +9 -8
  64. package/dist/bundle/chunks/{openai-decisions-QQ4MEABI.js → openai-decisions-QWEISDVO.js} +1 -1
  65. package/dist/bundle/chunks/{openai-responses-FG2R2M4L.js → openai-responses-OKGCSIEY.js} +6 -6
  66. package/dist/bundle/chunks/{openrouter-images-NTBP3UUE.js → openrouter-images-BMVMAROU.js} +1 -1
  67. package/dist/bundle/chunks/{pi-messages-JD4O7KIP.js → pi-messages-XNEG23NU.js} +1 -1
  68. package/dist/bundle/chunks/runtime-VGSK3QCM.js +2 -0
  69. package/dist/bundle/chunks/{typesafe-system-one-TTC7YCO3.js → typesafe-system-one-62YHYXZV.js} +1 -1
  70. package/dist/bundle/chunks/{undici-EEOUTE5F.js → undici-7EW63V4X.js} +1 -1
  71. package/dist/bundle/chunks/virtual-modules-JSGQ72M6.js +5 -0
  72. package/dist/bundle/cli-runtime.js +3 -3
  73. package/dist/bundle/flow/package.json +5 -6
  74. package/dist/bundle/index.js +6 -6
  75. package/dist/bundle/rpc-entry.js +2 -2
  76. package/dist/coordination/adapter/delivery.d.ts.map +1 -1
  77. package/dist/coordination/adapter/delivery.js +1 -0
  78. package/dist/coordination/adapter/delivery.js.map +1 -1
  79. package/dist/coordination/adapter/index.d.ts.map +1 -1
  80. package/dist/coordination/adapter/index.js +3 -1
  81. package/dist/coordination/adapter/index.js.map +1 -1
  82. package/dist/coordination/adapter/receipts.d.ts +2 -1
  83. package/dist/coordination/adapter/receipts.d.ts.map +1 -1
  84. package/dist/coordination/adapter/receipts.js +7 -4
  85. package/dist/coordination/adapter/receipts.js.map +1 -1
  86. package/dist/coordination/adapter/supervisor.d.ts.map +1 -1
  87. package/dist/coordination/adapter/supervisor.js +8 -0
  88. package/dist/coordination/adapter/supervisor.js.map +1 -1
  89. package/dist/coordination/broker/broker.d.ts +11 -0
  90. package/dist/coordination/broker/broker.d.ts.map +1 -1
  91. package/dist/coordination/broker/broker.js +195 -18
  92. package/dist/coordination/broker/broker.js.map +1 -1
  93. package/dist/coordination/client/client.d.ts +5 -0
  94. package/dist/coordination/client/client.d.ts.map +1 -1
  95. package/dist/coordination/client/client.js +23 -9
  96. package/dist/coordination/client/client.js.map +1 -1
  97. package/dist/coordination/transport/protocol.d.ts.map +1 -1
  98. package/dist/coordination/transport/protocol.js +8 -1
  99. package/dist/coordination/transport/protocol.js.map +1 -1
  100. package/dist/coordination/transport/types.d.ts +6 -0
  101. package/dist/coordination/transport/types.d.ts.map +1 -1
  102. package/dist/coordination/transport/types.js +2 -1
  103. package/dist/coordination/transport/types.js.map +1 -1
  104. package/dist/core/agent-session.d.ts +44 -2
  105. package/dist/core/agent-session.d.ts.map +1 -1
  106. package/dist/core/agent-session.js +305 -124
  107. package/dist/core/agent-session.js.map +1 -1
  108. package/dist/core/auth-storage.d.ts.map +1 -1
  109. package/dist/core/auth-storage.js +20 -13
  110. package/dist/core/auth-storage.js.map +1 -1
  111. package/dist/core/auto-effort.d.ts +16 -0
  112. package/dist/core/auto-effort.d.ts.map +1 -0
  113. package/dist/core/auto-effort.js +69 -0
  114. package/dist/core/auto-effort.js.map +1 -0
  115. package/dist/core/auto-session-namer.d.ts.map +1 -1
  116. package/dist/core/auto-session-namer.js +2 -12
  117. package/dist/core/auto-session-namer.js.map +1 -1
  118. package/dist/core/bug-report.d.ts +11 -1
  119. package/dist/core/bug-report.d.ts.map +1 -1
  120. package/dist/core/bug-report.js +2 -2
  121. package/dist/core/bug-report.js.map +1 -1
  122. package/dist/core/compaction/branch-summarization.d.ts +3 -2
  123. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  124. package/dist/core/compaction/branch-summarization.js +1 -1
  125. package/dist/core/compaction/branch-summarization.js.map +1 -1
  126. package/dist/core/compaction/compaction.d.ts +13 -4
  127. package/dist/core/compaction/compaction.d.ts.map +1 -1
  128. package/dist/core/compaction/compaction.js +94 -5
  129. package/dist/core/compaction/compaction.js.map +1 -1
  130. package/dist/core/compaction/utils.d.ts +6 -0
  131. package/dist/core/compaction/utils.d.ts.map +1 -1
  132. package/dist/core/compaction/utils.js +7 -8
  133. package/dist/core/compaction/utils.js.map +1 -1
  134. package/dist/core/extensions/index.d.ts +1 -1
  135. package/dist/core/extensions/index.d.ts.map +1 -1
  136. package/dist/core/extensions/index.js.map +1 -1
  137. package/dist/core/extensions/runner.d.ts +4 -2
  138. package/dist/core/extensions/runner.d.ts.map +1 -1
  139. package/dist/core/extensions/runner.js +6 -3
  140. package/dist/core/extensions/runner.js.map +1 -1
  141. package/dist/core/extensions/types.d.ts +33 -7
  142. package/dist/core/extensions/types.d.ts.map +1 -1
  143. package/dist/core/extensions/types.js.map +1 -1
  144. package/dist/core/key-id-schema.d.ts +6 -0
  145. package/dist/core/key-id-schema.d.ts.map +1 -0
  146. package/dist/core/key-id-schema.js +16 -0
  147. package/dist/core/key-id-schema.js.map +1 -0
  148. package/dist/core/keybindings-schema.d.ts +4 -0
  149. package/dist/core/keybindings-schema.d.ts.map +1 -0
  150. package/dist/core/keybindings-schema.js +16 -0
  151. package/dist/core/keybindings-schema.js.map +1 -0
  152. package/dist/core/keybindings.d.ts +198 -63
  153. package/dist/core/keybindings.d.ts.map +1 -1
  154. package/dist/core/keybindings.js +26 -23
  155. package/dist/core/keybindings.js.map +1 -1
  156. package/dist/core/model-config.d.ts +695 -74
  157. package/dist/core/model-config.d.ts.map +1 -1
  158. package/dist/core/model-config.js +16 -166
  159. package/dist/core/model-config.js.map +1 -1
  160. package/dist/core/model-runtime.d.ts.map +1 -1
  161. package/dist/core/model-runtime.js +39 -4
  162. package/dist/core/model-runtime.js.map +1 -1
  163. package/dist/core/package-manager.d.ts.map +1 -1
  164. package/dist/core/package-manager.js +3 -3
  165. package/dist/core/package-manager.js.map +1 -1
  166. package/dist/core/project-trust.d.ts.map +1 -1
  167. package/dist/core/project-trust.js +2 -1
  168. package/dist/core/project-trust.js.map +1 -1
  169. package/dist/core/remote-catalog-provider.d.ts +13 -1
  170. package/dist/core/remote-catalog-provider.d.ts.map +1 -1
  171. package/dist/core/remote-catalog-provider.js +110 -27
  172. package/dist/core/remote-catalog-provider.js.map +1 -1
  173. package/dist/core/resource-loader.d.ts.map +1 -1
  174. package/dist/core/resource-loader.js +5 -1
  175. package/dist/core/resource-loader.js.map +1 -1
  176. package/dist/core/session-export.d.ts.map +1 -1
  177. package/dist/core/session-export.js +2 -2
  178. package/dist/core/session-export.js.map +1 -1
  179. package/dist/core/session-manager.d.ts +36 -5
  180. package/dist/core/session-manager.d.ts.map +1 -1
  181. package/dist/core/session-manager.js +164 -40
  182. package/dist/core/session-manager.js.map +1 -1
  183. package/dist/core/settings-defaults.d.ts +65 -0
  184. package/dist/core/settings-defaults.d.ts.map +1 -0
  185. package/dist/core/settings-defaults.js +66 -0
  186. package/dist/core/settings-defaults.js.map +1 -0
  187. package/dist/core/settings-manager.d.ts +10 -175
  188. package/dist/core/settings-manager.d.ts.map +1 -1
  189. package/dist/core/settings-manager.js +64 -44
  190. package/dist/core/settings-manager.js.map +1 -1
  191. package/dist/core/settings-schema.d.ts +257 -0
  192. package/dist/core/settings-schema.d.ts.map +1 -0
  193. package/dist/core/settings-schema.js +311 -0
  194. package/dist/core/settings-schema.js.map +1 -0
  195. package/dist/core/tools/edit-diff.d.ts +4 -1
  196. package/dist/core/tools/edit-diff.d.ts.map +1 -1
  197. package/dist/core/tools/edit-diff.js +480 -29
  198. package/dist/core/tools/edit-diff.js.map +1 -1
  199. package/dist/core/tools/render-utils.d.ts +18 -0
  200. package/dist/core/tools/render-utils.d.ts.map +1 -1
  201. package/dist/core/tools/render-utils.js +46 -0
  202. package/dist/core/tools/render-utils.js.map +1 -1
  203. package/dist/core/tools/renderers/bash.d.ts.map +1 -1
  204. package/dist/core/tools/renderers/bash.js +17 -46
  205. package/dist/core/tools/renderers/bash.js.map +1 -1
  206. package/dist/core/tools/renderers/edit.d.ts +19 -1
  207. package/dist/core/tools/renderers/edit.d.ts.map +1 -1
  208. package/dist/core/tools/renderers/edit.js +38 -7
  209. package/dist/core/tools/renderers/edit.js.map +1 -1
  210. package/dist/core/tools/renderers/find.d.ts.map +1 -1
  211. package/dist/core/tools/renderers/find.js +3 -0
  212. package/dist/core/tools/renderers/find.js.map +1 -1
  213. package/dist/core/tools/renderers/grep.d.ts.map +1 -1
  214. package/dist/core/tools/renderers/grep.js +3 -0
  215. package/dist/core/tools/renderers/grep.js.map +1 -1
  216. package/dist/core/tools/renderers/highlighting.d.ts +13 -0
  217. package/dist/core/tools/renderers/highlighting.d.ts.map +1 -0
  218. package/dist/core/tools/renderers/highlighting.js +42 -0
  219. package/dist/core/tools/renderers/highlighting.js.map +1 -0
  220. package/dist/core/tools/renderers/ls.d.ts.map +1 -1
  221. package/dist/core/tools/renderers/ls.js +3 -0
  222. package/dist/core/tools/renderers/ls.js.map +1 -1
  223. package/dist/core/tools/renderers/read.d.ts.map +1 -1
  224. package/dist/core/tools/renderers/read.js +3 -0
  225. package/dist/core/tools/renderers/read.js.map +1 -1
  226. package/dist/core/tools/renderers/write.d.ts.map +1 -1
  227. package/dist/core/tools/renderers/write.js +3 -1
  228. package/dist/core/tools/renderers/write.js.map +1 -1
  229. package/dist/core/tools/subagent.d.ts +4 -0
  230. package/dist/core/tools/subagent.d.ts.map +1 -1
  231. package/dist/core/tools/subagent.js +85 -8
  232. package/dist/core/tools/subagent.js.map +1 -1
  233. package/dist/core/tools/truncate.d.ts.map +1 -1
  234. package/dist/core/tools/truncate.js +92 -44
  235. package/dist/core/tools/truncate.js.map +1 -1
  236. package/dist/core/usage-totals.d.ts +8 -1
  237. package/dist/core/usage-totals.d.ts.map +1 -1
  238. package/dist/core/usage-totals.js +106 -10
  239. package/dist/core/usage-totals.js.map +1 -1
  240. package/dist/extensions/codemode/execute.d.ts.map +1 -1
  241. package/dist/extensions/codemode/execute.js +64 -45
  242. package/dist/extensions/codemode/execute.js.map +1 -1
  243. package/dist/extensions/codemode/index.d.ts.map +1 -1
  244. package/dist/extensions/codemode/index.js +2 -1
  245. package/dist/extensions/codemode/index.js.map +1 -1
  246. package/dist/extensions/codemode/renderer.d.ts +2 -2
  247. package/dist/extensions/codemode/renderer.d.ts.map +1 -1
  248. package/dist/extensions/codemode/renderer.js +9 -3
  249. package/dist/extensions/codemode/renderer.js.map +1 -1
  250. package/dist/extensions/codemode/tool.d.ts +6 -12
  251. package/dist/extensions/codemode/tool.d.ts.map +1 -1
  252. package/dist/extensions/codemode/tool.js +44 -32
  253. package/dist/extensions/codemode/tool.js.map +1 -1
  254. package/dist/extensions/mcp/cli.js +5 -8
  255. package/dist/extensions/mcp/cli.js.map +1 -1
  256. package/dist/extensions/mcp/index.d.ts.map +1 -1
  257. package/dist/extensions/mcp/index.js +26 -23
  258. package/dist/extensions/mcp/index.js.map +1 -1
  259. package/dist/extensions/mcp/resources.d.ts +0 -6
  260. package/dist/extensions/mcp/resources.d.ts.map +1 -1
  261. package/dist/extensions/mcp/resources.js +1 -1
  262. package/dist/extensions/mcp/resources.js.map +1 -1
  263. package/dist/extensions/mcp/runtime.d.ts +3 -6
  264. package/dist/extensions/mcp/runtime.d.ts.map +1 -1
  265. package/dist/extensions/mcp/runtime.js +4 -39
  266. package/dist/extensions/mcp/runtime.js.map +1 -1
  267. package/dist/extensions/mcp/tools.d.ts +2 -3
  268. package/dist/extensions/mcp/tools.d.ts.map +1 -1
  269. package/dist/extensions/mcp/tools.js +62 -6
  270. package/dist/extensions/mcp/tools.js.map +1 -1
  271. package/dist/extensions/tool-search/tool.d.ts +0 -2
  272. package/dist/extensions/tool-search/tool.d.ts.map +1 -1
  273. package/dist/extensions/tool-search/tool.js +2 -4
  274. package/dist/extensions/tool-search/tool.js.map +1 -1
  275. package/dist/humain/adhd/index.d.ts +3 -2
  276. package/dist/humain/adhd/index.d.ts.map +1 -1
  277. package/dist/humain/adhd/index.js +22 -10
  278. package/dist/humain/adhd/index.js.map +1 -1
  279. package/dist/humain/bedrock-provider/vendor/index.bundle.mjs +306 -20
  280. package/dist/humain/caveman/index.d.ts +4 -2
  281. package/dist/humain/caveman/index.d.ts.map +1 -1
  282. package/dist/humain/caveman/index.js +51 -16
  283. package/dist/humain/caveman/index.js.map +1 -1
  284. package/dist/humain/ponytail/index.d.ts +2 -0
  285. package/dist/humain/ponytail/index.d.ts.map +1 -1
  286. package/dist/humain/ponytail/index.js +2 -0
  287. package/dist/humain/ponytail/index.js.map +1 -1
  288. package/dist/humain/ponytail/vendor/hooks/ponytail-config.d.ts.map +1 -1
  289. package/dist/humain/ponytail/vendor/hooks/ponytail-config.js +39 -9
  290. package/dist/humain/ponytail/vendor/hooks/ponytail-config.js.map +1 -1
  291. package/dist/humain/ponytail/vendor/hooks/ponytail-instructions.js +1 -1
  292. package/dist/humain/ponytail/vendor/hooks/ponytail-instructions.js.map +1 -1
  293. package/dist/humain/ponytail/vendor/pi-extension/index.d.ts +4 -0
  294. package/dist/humain/ponytail/vendor/pi-extension/index.d.ts.map +1 -1
  295. package/dist/humain/ponytail/vendor/pi-extension/index.js +8 -0
  296. package/dist/humain/ponytail/vendor/pi-extension/index.js.map +1 -1
  297. package/dist/humain/web-access/vendor/baizhi.js.map +1 -1
  298. package/dist/humain/web-access/vendor/brave.d.ts.map +1 -1
  299. package/dist/humain/web-access/vendor/brave.js +19 -2
  300. package/dist/humain/web-access/vendor/brave.js.map +1 -1
  301. package/dist/humain/web-access/vendor/ceramic.d.ts +4 -0
  302. package/dist/humain/web-access/vendor/ceramic.d.ts.map +1 -0
  303. package/dist/humain/web-access/vendor/ceramic.js +212 -0
  304. package/dist/humain/web-access/vendor/ceramic.js.map +1 -0
  305. package/dist/humain/web-access/vendor/content-find.d.ts.map +1 -1
  306. package/dist/humain/web-access/vendor/content-find.js +2 -1
  307. package/dist/humain/web-access/vendor/content-find.js.map +1 -1
  308. package/dist/humain/web-access/vendor/curator-page.d.ts.map +1 -1
  309. package/dist/humain/web-access/vendor/curator-page.js +3 -1
  310. package/dist/humain/web-access/vendor/curator-page.js.map +1 -1
  311. package/dist/humain/web-access/vendor/curator-server.d.ts.map +1 -1
  312. package/dist/humain/web-access/vendor/curator-server.js +2 -0
  313. package/dist/humain/web-access/vendor/curator-server.js.map +1 -1
  314. package/dist/humain/web-access/vendor/duckduckgo.d.ts.map +1 -1
  315. package/dist/humain/web-access/vendor/duckduckgo.js +5 -1
  316. package/dist/humain/web-access/vendor/duckduckgo.js.map +1 -1
  317. package/dist/humain/web-access/vendor/endpoint-pdf-extract.d.ts +23 -0
  318. package/dist/humain/web-access/vendor/endpoint-pdf-extract.d.ts.map +1 -0
  319. package/dist/humain/web-access/vendor/endpoint-pdf-extract.js +193 -0
  320. package/dist/humain/web-access/vendor/endpoint-pdf-extract.js.map +1 -0
  321. package/dist/humain/web-access/vendor/extract.d.ts +5 -1
  322. package/dist/humain/web-access/vendor/extract.d.ts.map +1 -1
  323. package/dist/humain/web-access/vendor/extract.js +49 -12
  324. package/dist/humain/web-access/vendor/extract.js.map +1 -1
  325. package/dist/humain/web-access/vendor/fetch-params.d.ts +2 -0
  326. package/dist/humain/web-access/vendor/fetch-params.d.ts.map +1 -1
  327. package/dist/humain/web-access/vendor/fetch-params.js +9 -0
  328. package/dist/humain/web-access/vendor/fetch-params.js.map +1 -1
  329. package/dist/humain/web-access/vendor/gemini-api.d.ts +5 -0
  330. package/dist/humain/web-access/vendor/gemini-api.d.ts.map +1 -1
  331. package/dist/humain/web-access/vendor/gemini-api.js +16 -0
  332. package/dist/humain/web-access/vendor/gemini-api.js.map +1 -1
  333. package/dist/humain/web-access/vendor/gemini-search.d.ts +3 -3
  334. package/dist/humain/web-access/vendor/gemini-search.d.ts.map +1 -1
  335. package/dist/humain/web-access/vendor/gemini-search.js +48 -172
  336. package/dist/humain/web-access/vendor/gemini-search.js.map +1 -1
  337. package/dist/humain/web-access/vendor/github-extract.d.ts +7 -0
  338. package/dist/humain/web-access/vendor/github-extract.d.ts.map +1 -1
  339. package/dist/humain/web-access/vendor/github-extract.js +31 -2
  340. package/dist/humain/web-access/vendor/github-extract.js.map +1 -1
  341. package/dist/humain/web-access/vendor/github-issue-pr.d.ts +2 -0
  342. package/dist/humain/web-access/vendor/github-issue-pr.d.ts.map +1 -1
  343. package/dist/humain/web-access/vendor/github-issue-pr.js +86 -74
  344. package/dist/humain/web-access/vendor/github-issue-pr.js.map +1 -1
  345. package/dist/humain/web-access/vendor/index.d.ts.map +1 -1
  346. package/dist/humain/web-access/vendor/index.js +68 -27
  347. package/dist/humain/web-access/vendor/index.js.map +1 -1
  348. package/dist/humain/web-access/vendor/openai-search.js +3 -3
  349. package/dist/humain/web-access/vendor/openai-search.js.map +1 -1
  350. package/dist/humain/web-access/vendor/page-query.d.ts.map +1 -1
  351. package/dist/humain/web-access/vendor/page-query.js +6 -9
  352. package/dist/humain/web-access/vendor/page-query.js.map +1 -1
  353. package/dist/humain/web-access/vendor/parallel-mcp.d.ts.map +1 -1
  354. package/dist/humain/web-access/vendor/parallel-mcp.js +2 -0
  355. package/dist/humain/web-access/vendor/parallel-mcp.js.map +1 -1
  356. package/dist/humain/web-access/vendor/pdf-extract.d.ts +1 -1
  357. package/dist/humain/web-access/vendor/pdf-extract.d.ts.map +1 -1
  358. package/dist/humain/web-access/vendor/pdf-extract.js +31 -1
  359. package/dist/humain/web-access/vendor/pdf-extract.js.map +1 -1
  360. package/dist/humain/web-access/vendor/perplexity.d.ts.map +1 -1
  361. package/dist/humain/web-access/vendor/perplexity.js +21 -2
  362. package/dist/humain/web-access/vendor/perplexity.js.map +1 -1
  363. package/dist/humain/web-access/vendor/query-rewrite.js +1 -1
  364. package/dist/humain/web-access/vendor/query-rewrite.js.map +1 -1
  365. package/dist/humain/web-access/vendor/ssrf-protection.d.ts +4 -0
  366. package/dist/humain/web-access/vendor/ssrf-protection.d.ts.map +1 -1
  367. package/dist/humain/web-access/vendor/ssrf-protection.js +19 -4
  368. package/dist/humain/web-access/vendor/ssrf-protection.js.map +1 -1
  369. package/dist/humain/web-access/vendor/storage.d.ts +14 -0
  370. package/dist/humain/web-access/vendor/storage.d.ts.map +1 -1
  371. package/dist/humain/web-access/vendor/storage.js +48 -0
  372. package/dist/humain/web-access/vendor/storage.js.map +1 -1
  373. package/dist/humain/web-access/vendor/summary-review.d.ts.map +1 -1
  374. package/dist/humain/web-access/vendor/summary-review.js +18 -6
  375. package/dist/humain/web-access/vendor/summary-review.js.map +1 -1
  376. package/dist/humain/web-access/vendor/tool-arguments.d.ts.map +1 -1
  377. package/dist/humain/web-access/vendor/tool-arguments.js +5 -2
  378. package/dist/humain/web-access/vendor/tool-arguments.js.map +1 -1
  379. package/dist/humain/web-access/vendor/utils.d.ts.map +1 -1
  380. package/dist/humain/web-access/vendor/utils.js +21 -6
  381. package/dist/humain/web-access/vendor/utils.js.map +1 -1
  382. package/dist/humain/web-access/vendor/video-extract.js +6 -2
  383. package/dist/humain/web-access/vendor/video-extract.js.map +1 -1
  384. package/dist/humain/web-access/vendor/web-tool-core.d.ts +2 -1
  385. package/dist/humain/web-access/vendor/web-tool-core.d.ts.map +1 -1
  386. package/dist/humain/web-access/vendor/web-tool-core.js +56 -13
  387. package/dist/humain/web-access/vendor/web-tool-core.js.map +1 -1
  388. package/dist/humain/web-access/vendor/zai.js.map +1 -1
  389. package/dist/index.d.ts +3 -3
  390. package/dist/index.d.ts.map +1 -1
  391. package/dist/index.js.map +1 -1
  392. package/dist/main.js +3 -3
  393. package/dist/main.js.map +1 -1
  394. package/dist/modes/interactive/components/assistant-message.d.ts +21 -1
  395. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  396. package/dist/modes/interactive/components/assistant-message.js +79 -10
  397. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  398. package/dist/modes/interactive/components/footer.d.ts +8 -3
  399. package/dist/modes/interactive/components/footer.d.ts.map +1 -1
  400. package/dist/modes/interactive/components/footer.js +156 -133
  401. package/dist/modes/interactive/components/footer.js.map +1 -1
  402. package/dist/modes/interactive/components/mermaid.js +1 -1
  403. package/dist/modes/interactive/components/mermaid.js.map +1 -1
  404. package/dist/modes/interactive/components/settings-selector.d.ts +10 -1
  405. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  406. package/dist/modes/interactive/components/settings-selector.js +83 -7
  407. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  408. package/dist/modes/interactive/components/status-indicator.d.ts +1 -1
  409. package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
  410. package/dist/modes/interactive/components/status-indicator.js +2 -2
  411. package/dist/modes/interactive/components/status-indicator.js.map +1 -1
  412. package/dist/modes/interactive/components/themed-text.d.ts.map +1 -1
  413. package/dist/modes/interactive/components/themed-text.js +3 -1
  414. package/dist/modes/interactive/components/themed-text.js.map +1 -1
  415. package/dist/modes/interactive/components/tool-execution.d.ts +7 -1
  416. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  417. package/dist/modes/interactive/components/tool-execution.js +36 -19
  418. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  419. package/dist/modes/interactive/components/transcript-container.d.ts +12 -0
  420. package/dist/modes/interactive/components/transcript-container.d.ts.map +1 -0
  421. package/dist/modes/interactive/components/transcript-container.js +31 -0
  422. package/dist/modes/interactive/components/transcript-container.js.map +1 -0
  423. package/dist/modes/interactive/components/user-message.d.ts +6 -1
  424. package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
  425. package/dist/modes/interactive/components/user-message.js +20 -5
  426. package/dist/modes/interactive/components/user-message.js.map +1 -1
  427. package/dist/modes/interactive/components/visual-truncate.d.ts +20 -5
  428. package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -1
  429. package/dist/modes/interactive/components/visual-truncate.js +42 -3
  430. package/dist/modes/interactive/components/visual-truncate.js.map +1 -1
  431. package/dist/modes/interactive/interactive-mode.d.ts +2 -0
  432. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  433. package/dist/modes/interactive/interactive-mode.js +125 -19
  434. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  435. package/dist/modes/interactive/theme/theme-schema.d.ts +28 -0
  436. package/dist/modes/interactive/theme/theme-schema.d.ts.map +1 -0
  437. package/dist/modes/interactive/theme/theme-schema.js +105 -0
  438. package/dist/modes/interactive/theme/theme-schema.js.map +1 -0
  439. package/dist/modes/interactive/theme/theme-tokens.d.ts +257 -0
  440. package/dist/modes/interactive/theme/theme-tokens.d.ts.map +1 -0
  441. package/dist/modes/interactive/theme/theme-tokens.js +94 -0
  442. package/dist/modes/interactive/theme/theme-tokens.js.map +1 -0
  443. package/dist/modes/interactive/theme/theme.d.ts +15 -16
  444. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  445. package/dist/modes/interactive/theme/theme.js +26 -29
  446. package/dist/modes/interactive/theme/theme.js.map +1 -1
  447. package/dist/modes/print-mode.d.ts.map +1 -1
  448. package/dist/modes/print-mode.js +4 -0
  449. package/dist/modes/print-mode.js.map +1 -1
  450. package/dist/utils/child-process.d.ts +0 -7
  451. package/dist/utils/child-process.d.ts.map +1 -1
  452. package/dist/utils/child-process.js +12 -3
  453. package/dist/utils/child-process.js.map +1 -1
  454. package/dist/utils/clipboard.d.ts.map +1 -1
  455. package/dist/utils/clipboard.js +6 -1
  456. package/dist/utils/clipboard.js.map +1 -1
  457. package/dist/utils/image-convert.d.ts +7 -0
  458. package/dist/utils/image-convert.d.ts.map +1 -1
  459. package/dist/utils/image-convert.js +35 -3
  460. package/dist/utils/image-convert.js.map +1 -1
  461. package/dist/utils/image-resize.d.ts.map +1 -1
  462. package/dist/utils/image-resize.js +2 -2
  463. package/dist/utils/image-resize.js.map +1 -1
  464. package/dist/utils/syntax-highlight.d.ts +7 -0
  465. package/dist/utils/syntax-highlight.d.ts.map +1 -1
  466. package/dist/utils/syntax-highlight.js +54 -3
  467. package/dist/utils/syntax-highlight.js.map +1 -1
  468. package/dist/utils/windows-path.js +1 -1
  469. package/dist/utils/windows-path.js.map +1 -1
  470. package/dist/utils/zip.d.ts.map +1 -1
  471. package/dist/utils/zip.js +3 -1
  472. package/dist/utils/zip.js.map +1 -1
  473. package/docs/auto-session-namer.md +4 -0
  474. package/docs/cli-integration.md +1 -1
  475. package/docs/cli.md +1 -1
  476. package/docs/codemode.md +1 -1
  477. package/docs/compaction.md +9 -5
  478. package/docs/coordination.md +7 -0
  479. package/docs/environment-variables.md +1 -0
  480. package/docs/extensions.md +7 -4
  481. package/docs/keybindings.md +1 -0
  482. package/docs/mcp.md +1 -1
  483. package/docs/models.md +1 -0
  484. package/docs/providers.md +20 -0
  485. package/docs/session-format.md +16 -2
  486. package/docs/settings.md +16 -1
  487. package/docs/themes.md +4 -2
  488. package/docs/tui.md +1 -1
  489. package/docs/usage.md +6 -2
  490. package/examples/extensions/custom-provider-anthropic/package-lock.json +6 -6
  491. package/examples/extensions/custom-provider-anthropic/package.json +2 -2
  492. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  493. package/examples/extensions/dynamic-resources/dynamic.json +1 -1
  494. package/examples/extensions/gondolin/package-lock.json +20 -20
  495. package/examples/extensions/gondolin/package.json +1 -1
  496. package/examples/extensions/overlay-test.ts +2 -2
  497. package/examples/extensions/plan-mode/index.ts +6 -2
  498. package/examples/extensions/sandbox/package-lock.json +8 -8
  499. package/examples/extensions/sandbox/package.json +2 -2
  500. package/examples/extensions/with-deps/package-lock.json +2 -2
  501. package/examples/extensions/with-deps/package.json +1 -1
  502. package/examples/plugins/pi-example-plugin/package.json +2 -2
  503. package/examples/plugins/pi-example-plugin/src/contract.ts +1 -1
  504. package/examples/plugins/pi-example-plugin/src/session.ts +1 -1
  505. package/examples/plugins/pi-example-plugin/src/tui.ts +1 -1
  506. package/npm-shrinkwrap.json +174 -190
  507. package/package.json +24 -23
  508. package/schemas/keybindings.schema.json +397 -0
  509. package/schemas/models.schema.json +1157 -0
  510. package/schemas/settings.schema.json +875 -0
  511. package/schemas/theme.schema.json +365 -0
  512. package/src/coordination/UPSTREAM.md +36 -3
  513. package/src/coordination/upstream.json +3 -2
  514. package/src/humain/adhd/UPSTREAM.md +21 -3
  515. package/src/humain/adhd/upstream.json +1 -1
  516. package/src/humain/caveman/UPSTREAM.md +24 -3
  517. package/src/humain/ponytail/UPSTREAM.md +51 -4
  518. package/src/humain/ponytail/upstream.json +12 -12
  519. package/src/humain/ponytail/vendor/skills/ponytail/SKILL.md +1 -1
  520. package/src/humain/ponytail/vendor/skills/ponytail-audit/SKILL.md +1 -1
  521. package/src/humain/ponytail/vendor/skills/ponytail-debt/SKILL.md +13 -10
  522. package/src/humain/ponytail/vendor/skills/ponytail-help/SKILL.md +1 -1
  523. package/src/humain/ponytail/vendor/skills/ponytail-review/SKILL.md +1 -1
  524. package/src/humain/web-access/UPSTREAM.md +55 -1
  525. package/src/humain/web-access/upstream.json +4 -4
  526. package/dist/bundle/chunks/anthropic-messages-UNHXXOD4.js +0 -70
  527. package/dist/bundle/chunks/azure-openai-responses-4QRYJCC2.js +0 -14
  528. package/dist/bundle/chunks/chunk-GVVRXZHN.js +0 -17
  529. package/dist/bundle/chunks/chunk-QMUIATLD.js +0 -209
  530. package/dist/bundle/chunks/chunk-QSPDLT2R.js +0 -160
  531. package/dist/bundle/chunks/chunk-SZRZXVVZ.js +0 -125
  532. package/dist/bundle/chunks/chunk-XMHLSV3I.js +0 -48
  533. package/dist/bundle/chunks/chunk-YKZGL4MB.js +0 -86
  534. package/dist/bundle/chunks/dist-VNSMKBZ6.js +0 -7
  535. package/dist/bundle/chunks/es-N6YFJOD7.js +0 -1901
  536. package/dist/bundle/chunks/execute-4X6G65NZ.js +0 -536
  537. package/dist/bundle/chunks/host-4J7H7KDS.js +0 -2
  538. package/dist/bundle/chunks/runtime-SI76JZNE.js +0 -2
  539. package/dist/bundle/chunks/virtual-modules-GZY3Y4GX.js +0 -5
@@ -83,9 +83,10 @@ hasChildren(node)&&existsOne(test,node.children))}function findAll(test,nodes){l
83
83
  {"node_modules/domutils/dist/querying.js"(){init_dist4()}});function getAttribCheck(attrib,value){return typeof value=="function"?element=>isTag2(element)&&value(element.attribs[attrib]):element=>isTag2(element)&&element.attribs[attrib]===value}function combineFuncs(a,b){return element=>a(element)||b(element)}function compileTest(options){let funcs=Object.keys(options).map(key=>{let value=options[key];return Object.hasOwn(Checks,key)?Checks[key](value):getAttribCheck(key,value)});return funcs.length===0?null:funcs.reduce(combineFuncs)}function testElement(options,node){
84
84
  let test=compileTest(options);return test?test(node):!0}function getElements(options,nodes,recurse,limit=Number.POSITIVE_INFINITY){let test=compileTest(options);return test?filter(test,nodes,recurse,limit):[]}function getElementById(id,nodes,recurse=!0){return Array.isArray(nodes)||(nodes=[nodes]),findOne(getAttribCheck("id",id),nodes,recurse)}function getElementsByTagName(tagName,nodes,recurse=!0,limit=Number.POSITIVE_INFINITY){return filter(Checks.tag_name(tagName),nodes,recurse,limit)}function getElementsByClassName(className,nodes,recurse=!0,limit=Number.
85
85
  POSITIVE_INFINITY){return filter(getAttribCheck("class",className),nodes,recurse,limit)}function getElementsByTagType(type,nodes,recurse=!0,limit=Number.POSITIVE_INFINITY){return filter(Checks.tag_type(type),nodes,recurse,limit)}var Checks,init_legacy=__esm({"node_modules/domutils/dist/legacy.js"(){init_dist4();init_querying();Checks={tag_name(name){return typeof name=="function"?element=>isTag2(element)&&name(element.name):name==="*"?isTag2:element=>isTag2(element)&&element.name===name},tag_type(type){
86
- return typeof type=="function"?element=>type(element.type):element=>element.type===type},tag_contains(data){return typeof data=="function"?element=>isText(element)&&data(element.data):element=>isText(element)&&element.data===data}}}});function encodeXML(input){let out,last=0,{length}=input;for(let index=0;index<length;index++){let char=input.charCodeAt(index);if(char<128&&((XML_BITSET_VALUE>>>char&1)===0||char>=64||char<32))continue;if(out===void 0?out=input.substring(0,index):last!==index&&(out+=input.substring(last,index)),char<64){out+=xmlCodeMap.get(char),last=index+1;continue}let cp=getCodePoint(input,index);out+=`&#x${cp.toString(16)};`,cp!==char&&index++,last=index+1}return out===void 0?input:(last<length&&(out+=input.
87
- substr(last)),out)}function getEscaper(regex,map){return function(data){let match,lastIndex=0,result="";for(;match=regex.exec(data);)lastIndex!==match.index&&(result+=data.substring(lastIndex,match.index)),result+=map.get(match[0].charCodeAt(0)),lastIndex=match.index+1;return result+data.substring(lastIndex)}}var xmlCodeMap,getCodePoint,XML_BITSET_VALUE,escapeAttribute,escapeText,init_escape=__esm({"node_modules/entities/dist/escape.js"(){xmlCodeMap=new Map([[34,"&quot;"],[38,"&amp;"],[39,"&apos\
88
- ;"],[60,"&lt;"],[62,"&gt;"]]),getCodePoint=typeof String.prototype.codePointAt=="function"?(input,index)=>input.codePointAt(index):(c,index)=>(c.charCodeAt(index)&64512)===55296?(c.charCodeAt(index)-55296)*1024+c.charCodeAt(index+1)-56320+65536:c.charCodeAt(index),XML_BITSET_VALUE=1342177476;escapeAttribute=getEscaper(/["&\u00A0]/g,new Map([[34,"&quot;"],[38,"&amp;"],[160,"&nbsp;"]])),escapeText=getEscaper(/[&<>\u00A0]/g,new Map([[38,"&amp;"],[60,"&lt;"],[62,"&gt;"],[160,"&nbsp;"]]))}});var EntityLevel,EncodingMode,init_dist5=__esm({"node_modules/entities/dist/index.js"(){init_escape();(function(EntityLevel2){EntityLevel2[EntityLevel2.XML=0]="XML",EntityLevel2[EntityLevel2.HTML=1]="HTML"})(EntityLevel||(EntityLevel={}));(function(EncodingMode2){EncodingMode2[EncodingMode2.UTF8=0]="UTF8",EncodingMode2[EncodingMode2.ASCII=1]="ASCII",EncodingMode2[EncodingMode2.Extensive=2]="Extensive",EncodingMode2[EncodingMode2.Attribute=3]="Attribute",EncodingMode2[EncodingMode2.Text=4]="Text"})(
86
+ return typeof type=="function"?element=>type(element.type):element=>element.type===type},tag_contains(data){return typeof data=="function"?element=>isText(element)&&data(element.data):element=>isText(element)&&element.data===data}}}});function getEscape(char){return char===34?"&quot;":char===38?"&amp;":char===39?"&apos;":char===60?"&lt;":char===62?"&gt;":"&nbsp;"}function isXmlEscapable(code){return code>=128||code>=32&&code<64&&(XML_BITSET_VALUE>>>code&1)===1}function encodeXML(input){let{length}=input,out,last=0,index=0;for(;index<length;){let char=input.charCodeAt(index);if(!isXmlEscapable(char)){let bound=Math.min(index+32,length),next=index+1;for(;next<bound&&!isXmlEscapable(input.charCodeAt(next));)next++;if(next<bound){
87
+ index=next;continue}if(next>=length||(xmlEncodeRegex.lastIndex=next,!xmlEncodeRegex.test(input)))break;index=xmlEncodeRegex.lastIndex-1;continue}if(out===void 0?out=input.substring(0,index):last!==index&&(out+=input.substring(last,index)),char<64){out+=getEscape(char),last=index+=1;continue}let cp=input.codePointAt(index);out+=`&#x${cp.toString(16)};`,cp!==char&&index++,last=index+=1}return out===void 0?input:(last<length&&(out+=input.substr(last)),out)}function escapeWithRegex(re,data){if(re.lastIndex=
88
+ 0,!re.test(data))return data;let out="",last=0;do{let index=re.lastIndex-1;last!==index&&(out+=data.substring(last,index));let char=data.charCodeAt(index);out+=getEscape(char),last=index+1}while(re.test(data));return out+data.substring(last)}function escapeAttribute(data){return escapeWithRegex(attributeEscapeRegex,data)}function escapeText(data){return escapeWithRegex(textEscapeRegex,data)}var XML_BITSET_VALUE,xmlEncodeRegex,attributeEscapeRegex,textEscapeRegex,init_escape=__esm({"node_modules/\
89
+ entities/dist/escape.js"(){XML_BITSET_VALUE=1342177476,xmlEncodeRegex=/["&'<>\u0080-\uFFFF]/g;attributeEscapeRegex=/["&\u{A0}]/gu;textEscapeRegex=/[&<>\u{A0}]/gu}});var EntityLevel,EncodingMode,init_dist5=__esm({"node_modules/entities/dist/index.js"(){init_escape();(function(EntityLevel2){EntityLevel2[EntityLevel2.XML=0]="XML",EntityLevel2[EntityLevel2.HTML=1]="HTML"})(EntityLevel||(EntityLevel={}));(function(EncodingMode2){EncodingMode2[EncodingMode2.UTF8=0]="UTF8",EncodingMode2[EncodingMode2.ASCII=1]="ASCII",EncodingMode2[EncodingMode2.Extensive=2]="Extensive",EncodingMode2[EncodingMode2.Attribute=3]="Attribute",EncodingMode2[EncodingMode2.Text=4]="Text"})(
89
90
  EncodingMode||(EncodingMode={}))}});var elementNames,attributeNames,init_foreign_names=__esm({"node_modules/dom-serializer/dist/foreign-names.js"(){elementNames=new Map("altGlyph altGlyphDef altGlyphItem animateColor animateMotion animateTransform clipPath feBlend feColorMatrix feComponentTransfer feComposite feConvolveMatrix feDiffuseLighting feDisplacementMap feDistantLight feDropShadow feFlood feFuncA feFuncB feFuncG feFuncR feGaussianBlur feImage feMerge feMergeNode feMorphology feOffset fePointLight feSpecularLighting feSpotL\
90
91
  ight feTile feTurbulence foreignObject glyphRef linearGradient radialGradient textPath".split(" ").map(name=>[name.toLowerCase(),name])),attributeNames=new Map("definitionURL attributeName attributeType baseFrequency baseProfile calcMode clipPathUnits diffuseConstant edgeMode filterUnits glyphRef gradientTransform gradientUnits kernelMatrix kernelUnitLength keyPoints keySplines keyTimes lengthAdjust limitingConeAngle markerHeight markerUnits markerWidth maskContentUnits maskUnits numOctaves path\
91
92
  Length patternContentUnits patternTransform patternUnits pointsAtX pointsAtY pointsAtZ preserveAlpha preserveAspectRatio primitiveUnits refX refY repeatCount repeatDur requiredExtensions requiredFeatures specularConstant specularExponent spreadMethod startOffset stdDeviation stitchTiles surfaceScale systemLanguage tableValues targetX targetY textLength viewBox viewTarget xChannelSelector yChannelSelector zoomAndPan".split(" ").map(name=>[name.toLowerCase(),name]))}});function render(node,options={}){let nodes="length"in node?node:[node],xmlMode=options.xmlMode??!1,output="";for(let index=0;index<nodes.length;index++)output+=renderNode(nodes[index],options,xmlMode);return output}function renderChildren(children,options,xmlMode){let output="";for(let index=0;index<children.length;index++)output+=renderNode(children[index],options,xmlMode);return output}function renderNode(node,options,xmlMode){switch(node.type){case Root:return renderChildren(node.children,options,
@@ -0,0 +1,26 @@
1
+ import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
2
+ function stringReplaceAll(string,substring,postfix){let index=string.indexOf(substring);if(index===-1)return string;let substringLength=substring.length,endIndex=0,returnValue="";do returnValue+=string.slice(endIndex,index)+substring+postfix,endIndex=index+substringLength,index=string.indexOf(substring,endIndex);while(index!==-1);return returnValue+=string.slice(endIndex),returnValue}function stringEncaseCRLFWithFirstIndex(string,prefix,postfix,index){let endIndex=0,returnValue="";do{let isGotCR=string[index-
3
+ 1]==="\r";returnValue+=string.slice(endIndex,isGotCR?index-1:index)+prefix+(isGotCR?`\r
4
+ `:`
5
+ `)+postfix,endIndex=index+1,index=string.indexOf(`
6
+ `,endIndex)}while(index!==-1);return returnValue+=string.slice(endIndex),returnValue}var wrapAnsi16=(offset=0)=>code=>`\x1B[${code+offset}m`,wrapAnsi256=(offset=0)=>code=>`\x1B[${38+offset};5;${code}m`,wrapAnsi16m=(offset=0)=>(red,green,blue)=>`\x1B[${38+offset};2;${red};${green};${blue}m`,wrapUnderlineAnsi=code=>`\x1B[58;5;${code<90?code-30:code-90+8}m`,styles={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],underlineDouble:["4:2",24],underlineCurly:["4:3",24],underlineDotted:["4:4",24],underlineDashed:["4:5",24],overline:[53,55],inverse:[7,27],hidden:[
7
+ 8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,
8
+ 49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]},underlineColor:{underlineBlack:["58;5;0",59],underlineRed:["58;5;1",59],underlineGreen:["58;5;2",59],underlineYellow:["58;5;3",59],underlineBlue:["58;5;4",59],underlineMagenta:["58;5;5",59],underlineCyan:["58;5;6",59],underlineWhite:["58;5;7",59],underlineBlackBright:["58;5;8",59],underlineGray:["58;5;8",59],underlineGrey:[
9
+ "58;5;8",59],underlineRedBright:["58;5;9",59],underlineGreenBright:["58;5;10",59],underlineYellowBright:["58;5;11",59],underlineBlueBright:["58;5;12",59],underlineMagentaBright:["58;5;13",59],underlineCyanBright:["58;5;14",59],underlineWhiteBright:["58;5;15",59]}},modifierNames=Object.keys(styles.modifier),foregroundColorNames=Object.keys(styles.color),backgroundColorNames=Object.keys(styles.bgColor),underlineColorNames=Object.keys(styles.underlineColor),colorNames=[...foregroundColorNames,...backgroundColorNames];
10
+ function assembleStyles(){let codes=new Map;for(let[groupName,group]of Object.entries(styles)){for(let[styleName,style]of Object.entries(group))styles[styleName]={open:`\x1B[${style[0]}m`,close:`\x1B[${style[1]}m`},group[styleName]=styles[styleName],codes.set(Number.parseInt(style[0],10),style[1]);Object.defineProperty(styles,groupName,{value:group,enumerable:!1})}return Object.defineProperty(styles,"codes",{value:codes,enumerable:!1}),styles.color.close="\x1B[39m",styles.bgColor.close="\x1B[49m",
11
+ styles.underlineColor.close="\x1B[59m",styles.color.ansi=wrapAnsi16(),styles.color.ansi256=wrapAnsi256(),styles.color.ansi16m=wrapAnsi16m(),styles.bgColor.ansi=wrapAnsi16(10),styles.bgColor.ansi256=wrapAnsi256(10),styles.bgColor.ansi16m=wrapAnsi16m(10),styles.underlineColor.ansi=wrapUnderlineAnsi,styles.underlineColor.ansi256=wrapAnsi256(20),styles.underlineColor.ansi16m=wrapAnsi16m(20),Object.defineProperties(styles,{rgbToAnsi256:{value(red,green,blue){return red===green&&green===blue?red<8?16:
12
+ red>248?231:Math.round((red-8)/247*24)+232:16+36*Math.round(red/255*5)+6*Math.round(green/255*5)+Math.round(blue/255*5)},enumerable:!1},hexToRgb:{value(hex){let matches=/[\da-f]{6}|[\da-f]{3}/i.exec(hex.toString(16));if(!matches)return[0,0,0];let[colorString]=matches;colorString.length===3&&(colorString=[...colorString].map(character=>character+character).join(""));let integer=Number.parseInt(colorString,16);return[integer>>16&255,integer>>8&255,integer&255]},enumerable:!1},hexToAnsi256:{value:hex=>styles.
13
+ rgbToAnsi256(...styles.hexToRgb(hex)),enumerable:!1},ansi256ToAnsi:{value(code){if(code<8)return 30+code;if(code<16)return 90+(code-8);let red,green,blue;if(code>=232)red=((code-232)*10+8)/255,green=red,blue=red;else{code-=16;let remainder=code%36;red=Math.floor(code/36)/5,green=Math.floor(remainder/6)/5,blue=remainder%6/5}let value=Math.max(red,green,blue)*2;if(value===0)return 30;let result=30+(Math.round(blue)<<2|Math.round(green)<<1|Math.round(red));return value===2&&(result+=60),result},enumerable:!1},
14
+ rgbToAnsi:{value:(red,green,blue)=>styles.ansi256ToAnsi(styles.rgbToAnsi256(red,green,blue)),enumerable:!1},hexToAnsi:{value:hex=>styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),enumerable:!1}}),styles}var ansiStyles=assembleStyles(),ansi_styles_default=ansiStyles;import process from"node:process";import os from"node:os";import tty from"node:tty";function hasFlag(flag,argv=globalThis.Deno?globalThis.Deno.args:process.argv){let prefix=flag.startsWith("-")?"":flag.length===1?"-":"--",position=argv.indexOf(prefix+flag),terminatorPosition=argv.indexOf("--");return position!==-1&&(terminatorPosition===-1||position<terminatorPosition)}var{env}=process,flagForceColor;hasFlag("no-color")||hasFlag("no-colors")||hasFlag("color=false")||hasFlag("color=never")?flagForceColor=
15
+ 0:(hasFlag("color")||hasFlag("colors")||hasFlag("color=true")||hasFlag("color=always"))&&(flagForceColor=1);function hasNumericForceColor(){return/^\d+$/.test(env.FORCE_COLOR)}function envForceColor(){if("FORCE_COLOR"in env){if(env.FORCE_COLOR==="false")return 0;if(env.FORCE_COLOR==="true"||env.FORCE_COLOR.length===0)return 1;if(hasNumericForceColor())return Math.min(Number.parseInt(env.FORCE_COLOR,10),3)}}function translateLevel(level){return level===0?!1:{level,hasBasic:!0,has256:level>=2,has16m:level>=
16
+ 3}}function _supportsColor(haveStream,{streamIsTTY,sniffFlags=!0}={}){let noFlagForceColor=envForceColor();noFlagForceColor!==void 0&&(flagForceColor=noFlagForceColor);let forceColor=sniffFlags?flagForceColor:noFlagForceColor;if(forceColor===0)return 0;if(sniffFlags){if(hasFlag("color=16m")||hasFlag("color=full")||hasFlag("color=truecolor"))return 3;if(hasFlag("color=256"))return 2}if(forceColor!==void 0&&hasNumericForceColor())return forceColor;if("TF_BUILD"in env&&"AGENT_NAME"in env)return 1;if(haveStream&&
17
+ !streamIsTTY&&forceColor===void 0)return 0;let min=forceColor||0;if(env.TERM==="dumb")return min;if(process.platform==="win32"){let osRelease=os.release().split(".");return Number(osRelease[0])>=10&&Number(osRelease[2])>=10586?Number(osRelease[2])>=14931?3:2:1}if("CI"in env)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(key=>key in env)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(sign=>sign in env)||env.CI_NAME==="codeship"?1:min;if("TEAMCITY_VERSION"in env)return/^(?:9\.0*[1-9]\d*\.|\d{2,}\.)/.
18
+ test(env.TEAMCITY_VERSION)?1:0;if(env.COLORTERM==="truecolor"||env.TERM==="xterm-kitty"||env.TERM==="xterm-ghostty"||env.TERM==="wezterm")return 3;if("TERM_PROGRAM"in env){let version=Number.parseInt((env.TERM_PROGRAM_VERSION||"").split(".",1)[0],10);switch(env.TERM_PROGRAM){case"iTerm.app":return version>=3?3:2;case"Apple_Terminal":return 2}}return/-256(?:color)?$/i.test(env.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)||"COLORTERM"in env?1:min}function createSupportsColor(stream,options={}){
19
+ let level=_supportsColor(stream,{streamIsTTY:stream&&stream.isTTY,...options});return translateLevel(level)}var supportsColor={stdout:createSupportsColor({isTTY:tty.isatty(1)}),stderr:createSupportsColor({isTTY:tty.isatty(2)})},supports_color_default=supportsColor;var{stdout:stdoutColor,stderr:stderrColor}=supports_color_default,GENERATOR=Symbol("GENERATOR"),STYLER=Symbol("STYLER"),IS_EMPTY=Symbol("IS_EMPTY"),LEVEL=Symbol("LEVEL"),styles2=Object.create(null),assertValidLevel=level=>{if(!Number.isSafeInteger(level)||level<0||level>3)throw new Error("The `level` should be an integer from 0 to 3")},levelDescriptor={enumerable:!0,get(){return this[LEVEL]},set(level){assertValidLevel(level),this[LEVEL]=level}},applyOptions=(object,options={})=>{options.level!==
20
+ void 0&&assertValidLevel(options.level);let colorLevel=stdoutColor?stdoutColor.level:0;object[LEVEL]=options.level===void 0?colorLevel:options.level};var chalkFactory=options=>{let chalk2=(...strings)=>strings.join(" ");return applyOptions(chalk2,options),Object.setPrototypeOf(chalk2,createChalk.prototype),chalk2};function createChalk(options){return chalkFactory(options)}Object.setPrototypeOf(createChalk.prototype,Function.prototype);for(let[styleName,style]of Object.entries(ansi_styles_default))styles2[styleName]={get(){let builder=createBuilder(this,createStyler(style.open,style.close,this[STYLER]),this[IS_EMPTY]);return Object.defineProperty(
21
+ this,styleName,{value:builder}),builder}};styles2.visible={get(){let builder=createBuilder(this,this[STYLER],!0);return Object.defineProperty(this,"visible",{value:builder}),builder}};var createModelConverters=(model,type)=>{let style=ansi_styles_default[type];if(model==="rgb"){let ansi2=(red,green,blue)=>style.ansi(ansi_styles_default.rgbToAnsi(red,green,blue));return[ansi2,ansi2,(red,green,blue)=>style.ansi256(ansi_styles_default.rgbToAnsi256(red,green,blue)),style.ansi16m]}if(model==="hex"){let ansi2=hex=>style.
22
+ ansi(ansi_styles_default.hexToAnsi(hex));return[ansi2,ansi2,hex=>style.ansi256(ansi_styles_default.hexToAnsi256(hex)),hex=>style.ansi16m(...ansi_styles_default.hexToRgb(hex))]}let ansi=code=>style.ansi(ansi_styles_default.ansi256ToAnsi(code));return[ansi,ansi,style.ansi256,style.ansi256]},usedModels=["rgb","hex","ansi256"];for(let model of usedModels){let capitalizedModel=model[0].toUpperCase()+model.slice(1);for(let[styleName,type]of[[model,"color"],["bg"+capitalizedModel,"bgColor"],["underline"+
23
+ capitalizedModel,"underlineColor"]]){let{close}=ansi_styles_default[type],converters=createModelConverters(model,type);styles2[styleName]={get(){let styleFunction=function(first,second,third){let open=converters[this.level](first,second,third);return createBuilder(this,createStyler(open,close,this[STYLER]),this[IS_EMPTY])};return Object.defineProperty(this,styleName,{value:styleFunction}),styleFunction}}}}var proto=Object.defineProperties(()=>{},{...styles2,level:{enumerable:!0,get(){return this[GENERATOR].
24
+ level},set(level){this[GENERATOR].level=level}}}),createStyler=(open,close,parent)=>{let openAll,closeAll;return parent===void 0?(openAll=open,closeAll=close):(openAll=parent.openAll+open,closeAll=close+parent.closeAll),{open,close,openAll,closeAll,parent}},createBuilder=(self,_styler,_isEmpty)=>{let builder=(...arguments_)=>arguments_.length===1?applyStyle(builder,""+arguments_[0]):arguments_.length===2?applyStyle(builder,`${arguments_[0]??""} ${arguments_[1]??""}`):applyStyle(builder,arguments_.
25
+ join(" "));return Object.setPrototypeOf(builder,proto),builder[GENERATOR]=self[GENERATOR]??self,builder[STYLER]=_styler,builder[IS_EMPTY]=_isEmpty,builder},applyStyle=(self,string)=>{if(self[GENERATOR][LEVEL]<=0||!string)return self[IS_EMPTY]?"":string;let styler=self[STYLER];if(styler===void 0)return string;let{openAll,closeAll}=styler;if(string.includes("\x1B"))for(;styler!==void 0;)string=stringReplaceAll(string,styler.close,styler.open),styler=styler.parent;let lfIndex=string.indexOf(`
26
+ `);return lfIndex!==-1&&(string=stringEncaseCRLFWithFirstIndex(string,closeAll,openAll,lfIndex)),openAll+string+closeAll};Object.defineProperties(createChalk.prototype,{...styles2,level:levelDescriptor});var chalk=createChalk(),chalkStderr=createChalk({level:stderrColor?stderrColor.level:0});var source_default=chalk;export{source_default};
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
2
- import{retryProviderRequest}from"./chunk-Z33NNMNB.js";import{createRequestObserver,headersToRecord,providerHeadersToRecord}from"./chunk-5CDES42D.js";import{calculateCost}from"./chunk-DZ5C66IU.js";function httpError(label,response,body){let error=new Error(`${label} returned ${response.status}`);return error.status=response.status,error.headers=response.headers,error.body=body,error}function timeoutError(timeoutMs){let error=new Error(`Request timed out after ${timeoutMs}ms`);return error.name="TimeoutError",error.status=void 0,error.headers=void 0,error.body="",error}function isRecord(value){return typeof value=="object"&&value!==null&&!Array.isArray(value)}function requiredNumber(label,value,field){
2
+ import{retryProviderRequest}from"./chunk-Z33NNMNB.js";import{createRequestObserver,headersToRecord,providerHeadersToRecord}from"./chunk-5CDES42D.js";import{calculateCost}from"./chunk-LUL775V7.js";function httpError(label,response,body){let error=new Error(`${label} returned ${response.status}`);return error.status=response.status,error.headers=response.headers,error.body=body,error}function timeoutError(timeoutMs){let error=new Error(`Request timed out after ${timeoutMs}ms`);return error.name="TimeoutError",error.status=void 0,error.headers=void 0,error.body="",error}function isRecord(value){return typeof value=="object"&&value!==null&&!Array.isArray(value)}function requiredNumber(label,value,field){
3
3
  if(typeof value!="number"||!Number.isFinite(value))throw new Error(`${label} returned an invalid ${field}`);return value}function requestHeaders(model,apiKey,optionsHeaders){return providerHeadersToRecord({authorization:`Bearer ${apiKey}`,"content-type":"application/json"},model.headers,optionsHeaders)??{}}async function postClassifierRequest(label,url,model,body,options,noRetryStatuses){if(!options?.apiKey)throw new Error(`No API key for provider: ${model.provider}`);let apiKey=options.apiKey,payload=body,
4
4
  transformed=await options.onPayload?.(payload,model);transformed!==void 0&&(payload=transformed);let requestFetch=options.fetch??globalThis.fetch,observe=createRequestObserver(options,{api:model.api,provider:model.provider,model:model.id,operation:"classifier"}),{response,json}=await retryProviderRequest(async()=>{let timeoutSignal=options.timeoutMs!==void 0?AbortSignal.timeout(options.timeoutMs):void 0,signal=options.signal&&timeoutSignal?AbortSignal.any([options.signal,timeoutSignal]):options.
5
5
  signal??timeoutSignal;try{let requestBody=JSON.stringify(payload);await observe(requestBody);let next=await requestFetch(url,{method:"POST",headers:requestHeaders(model,apiKey,options.headers),body:requestBody,signal});if(!next.ok)throw httpError(label,next,await next.text());return{response:next,json:await next.json()}}catch(error){throw timeoutSignal?.aborted&&!options.signal?.aborted?timeoutError(options.timeoutMs):error}},{maxRetries:options.maxRetries??2,maxRetryDelayMs:options.maxRetryDelayMs,
@@ -0,0 +1,9 @@
1
+ import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
2
+ function buildProviderErrorPattern(patterns){return new RegExp(patterns.join("|"),"i")}var NON_RETRYABLE_PROVIDER_LIMIT_ERROR_PATTERN=buildProviderErrorPattern(["GoUsageLimitError","FreeUsageLimitError","Monthly usage limit reached","available balance","insufficient_quota","out of budget","quota exceeded","billing","subscription_sharing_usage_limit_exceeded"]),RETRYABLE_PROVIDER_ERROR_PATTERN=buildProviderErrorPattern(["overloaded","server_busy","servers are currently busy","currently experienci\
3
+ ng high demand","model is at capacity","rate.?limit","too many requests","429","500","502","503","504","520","524","service.?unavailable","server.?error","internal.?error","provider.?returned.?(?:an.?)?error","exceeded request buffer limit while retrying upstream","network.?error","connection.?error","connection.?refused","connection.?lost","other side closed","fetch failed","getaddrinfo","ENOTFOUND","EAI_AGAIN","upstream.?connect","reset before headers","socket hang up","socket connection was c\
4
+ losed","timed? out","timeout","terminated","websocket.?closed","websocket.?error","ended without","stream ended before message_stop","stream ended before a terminal response event","http2 request did not get a response","pending stream has been canceled","retry delay","you can retry your request","try your request again","please retry your request","ResourceExhausted","subscription_sharing_usage_unavailable","subscription_sharing_user_unavailable"]),DEFAULT_MAX_AGENT_RETRY_DELAY_MS=6e4;function retryDelayMs(policy,attempt){
5
+ let delay=policy.baseDelayMs*2**Math.max(0,attempt-1),safeDelay=Number.isSafeInteger(delay)?delay:Number.MAX_SAFE_INTEGER;return Math.min(safeDelay,policy.maxAgentDelayMs??DEFAULT_MAX_AGENT_RETRY_DELAY_MS)}var RetrySleepAbortError=class extends Error{constructor(){super("Aborted")}};function sleep(ms,signal){return new Promise((resolve,reject)=>{if(signal?.aborted){reject(new RetrySleepAbortError);return}let timeout=setTimeout(resolve,ms);signal?.addEventListener("abort",()=>{clearTimeout(timeout),
6
+ reject(new RetrySleepAbortError)},{once:!0})})}async function retryAssistantCall(produce,policy,signal,callbacks){let maxAttempts=policy?.enabled?policy.maxRetries:0,attempt=0,lastRetry;for(;;){let response=await produce();if(response.stopReason==="aborted")return lastRetry&&await callbacks?.onRetryFinished?.(!1,lastRetry.attempt),response;if(response.stopReason!=="error")return lastRetry&&await callbacks?.onRetryFinished?.(!0,lastRetry.attempt),response;if(attempt>=maxAttempts||!isRetryableAssistantError(
7
+ response))return lastRetry&&await callbacks?.onRetryFinished?.(!1,lastRetry.attempt,response.errorMessage),response;attempt++,lastRetry={attempt,errorMessage:response.errorMessage||"Unknown error"};let delayMs=getAssistantRetryDelayMs(response,retryDelayMs(policy,attempt));await callbacks?.onRetryScheduled?.(attempt,maxAttempts,delayMs,lastRetry.errorMessage);try{await sleep(delayMs,signal)}catch(error){if(await callbacks?.onRetryFinished?.(!1,attempt,lastRetry.errorMessage),error instanceof RetrySleepAbortError){
8
+ let{errorMessage:_errorMessage,...rest}=response;return{...rest,stopReason:"aborted"}}throw error}await callbacks?.onRetryAttemptStart?.()}}function isRetryableAssistantError(message){if(message.stopReason!=="error"||!message.errorMessage)return!1;let httpError=message.diagnostics?.findLast(entry=>entry.type==="provider_http_error");if(typeof httpError?.details?.retryable=="boolean")return httpError.details.retryable;let errorMessage=message.errorMessage;return NON_RETRYABLE_PROVIDER_LIMIT_ERROR_PATTERN.
9
+ test(errorMessage)?!1:RETRYABLE_PROVIDER_ERROR_PATTERN.test(errorMessage)}function getAssistantRetryDelayMs(message,baseDelayMs){let retryAt=message.diagnostics?.findLast(entry=>entry.type==="provider_http_error")?.details?.retryAt;return typeof retryAt=="number"&&Number.isFinite(retryAt)?Math.max(baseDelayMs,retryAt-Date.now()):baseDelayMs}export{DEFAULT_MAX_AGENT_RETRY_DELAY_MS,retryDelayMs,retryAssistantCall,isRetryableAssistantError,getAssistantRetryDelayMs};
@@ -2,25 +2,25 @@ import { createRequire as __piCreateRequire } from "node:module"; const require
2
2
  import{__commonJS,__require,__toESM}from"./chunk-JXWJOIH4.js";var require_windows=__commonJS({"node_modules/isexe/windows.js"(exports,module){module.exports=isexe;isexe.sync=sync;var fs=__require("fs");function checkPathExt(path,options){var pathext=options.pathExt!==void 0?options.pathExt:process.env.PATHEXT;if(!pathext||(pathext=pathext.split(";"),pathext.indexOf("")!==-1))return!0;for(var i=0;i<pathext.length;i++){var p=pathext[i].toLowerCase();if(p&&path.substr(-p.length).toLowerCase()===p)return!0}return!1}function checkStat(stat,path,options){return!stat.
3
3
  isSymbolicLink()&&!stat.isFile()?!1:checkPathExt(path,options)}function isexe(path,options,cb){fs.stat(path,function(er,stat){cb(er,er?!1:checkStat(stat,path,options))})}function sync(path,options){return checkStat(fs.statSync(path),path,options)}}});var require_mode=__commonJS({"node_modules/isexe/mode.js"(exports,module){module.exports=isexe;isexe.sync=sync;var fs=__require("fs");function isexe(path,options,cb){fs.stat(path,function(er,stat){cb(er,er?!1:checkStat(stat,options))})}function sync(path,options){return checkStat(fs.statSync(path),options)}function checkStat(stat,options){return stat.isFile()&&checkMode(stat,options)}function checkMode(stat,options){var mod=stat.mode,uid=stat.uid,gid=stat.gid,myUid=options.uid!==void 0?options.uid:
4
4
  process.getuid&&process.getuid(),myGid=options.gid!==void 0?options.gid:process.getgid&&process.getgid(),u=parseInt("100",8),g=parseInt("010",8),o=parseInt("001",8),ug=u|g,ret=mod&o||mod&g&&gid===myGid||mod&u&&uid===myUid||mod&ug&&myUid===0;return ret}}});var require_isexe=__commonJS({"node_modules/isexe/index.js"(exports,module){var fs=__require("fs"),core;process.platform==="win32"||global.TESTING_WINDOWS?core=require_windows():core=require_mode();module.exports=isexe;isexe.sync=sync;function isexe(path,options,cb){if(typeof options=="function"&&(cb=options,options={}),!cb){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(resolve3,reject){isexe(path,options||{},function(er,is){er?reject(er):
5
- resolve3(is)})})}core(path,options||{},function(er,is){er&&(er.code==="EACCES"||options&&options.ignoreErrors)&&(er=null,is=!1),cb(er,is)})}function sync(path,options){try{return core.sync(path,options||{})}catch(er){if(options&&options.ignoreErrors||er.code==="EACCES")return!1;throw er}}}});var require_which=__commonJS({"packages/coding-agent/node_modules/which/which.js"(exports,module){var isWindows=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",path=__require("path"),COLON=isWindows?";":":",isexe=require_isexe(),getNotFoundError=cmd=>Object.assign(new Error(`not found: ${cmd}`),{code:"ENOENT"}),getPathInfo=(cmd,opt)=>{let colon=opt.colon||COLON,pathEnv=cmd.match(/\//)||isWindows&&cmd.match(/\\/)?[""]:[...isWindows?[process.cwd()]:[],...(opt.
6
- path||process.env.PATH||"").split(colon)],pathExtExe=isWindows?opt.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",pathExt=isWindows?pathExtExe.split(colon):[""];return isWindows&&cmd.indexOf(".")!==-1&&pathExt[0]!==""&&pathExt.unshift(""),{pathEnv,pathExt,pathExtExe}},which=(cmd,opt,cb)=>{typeof opt=="function"&&(cb=opt,opt={}),opt||(opt={});let{pathEnv,pathExt,pathExtExe}=getPathInfo(cmd,opt),found=[],step=i=>new Promise((resolve3,reject)=>{if(i===pathEnv.length)return opt.all&&found.length?
7
- resolve3(found):reject(getNotFoundError(cmd));let ppRaw=pathEnv[i],pathPart=/^".*"$/.test(ppRaw)?ppRaw.slice(1,-1):ppRaw,pCmd=path.join(pathPart,cmd),p=!pathPart&&/^\.[\\\/]/.test(cmd)?cmd.slice(0,2)+pCmd:pCmd;resolve3(subStep(p,i,0))}),subStep=(p,i,ii)=>new Promise((resolve3,reject)=>{if(ii===pathExt.length)return resolve3(step(i+1));let ext=pathExt[ii];isexe(p+ext,{pathExt:pathExtExe},(er,is)=>{if(!er&&is)if(opt.all)found.push(p+ext);else return resolve3(p+ext);return resolve3(subStep(p,i,ii+1))})});
8
- return cb?step(0).then(res=>cb(null,res),cb):step(0)},whichSync=(cmd,opt)=>{opt=opt||{};let{pathEnv,pathExt,pathExtExe}=getPathInfo(cmd,opt),found=[];for(let i=0;i<pathEnv.length;i++){let ppRaw=pathEnv[i],pathPart=/^".*"$/.test(ppRaw)?ppRaw.slice(1,-1):ppRaw,pCmd=path.join(pathPart,cmd),p=!pathPart&&/^\.[\\\/]/.test(cmd)?cmd.slice(0,2)+pCmd:pCmd;for(let j=0;j<pathExt.length;j++){let cur=p+pathExt[j];try{if(isexe.sync(cur,{pathExt:pathExtExe}))if(opt.all)found.push(cur);else return cur}catch{}}}if(opt.
9
- all&&found.length)return found;if(opt.nothrow)return null;throw getNotFoundError(cmd)};module.exports=which;which.sync=whichSync}});var require_path_key=__commonJS({"packages/coding-agent/node_modules/path-key/index.js"(exports,module){"use strict";var pathKey=(options={})=>{let environment=options.env||process.env;return(options.platform||process.platform)!=="win32"?"PATH":Object.keys(environment).reverse().find(key=>key.toUpperCase()==="PATH")||"Path"};module.exports=pathKey;module.exports.default=pathKey}});var require_resolveCommand=__commonJS({"packages/coding-agent/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports,module){"use strict";var path=__require("path"),which=require_which(),getPathKey=require_path_key();function resolveCommandAttempt(parsed,withoutPathExt){let env=parsed.options.env||process.env,cwd=process.cwd(),hasCustomCwd=parsed.options.cwd!=null,shouldSwitchCwd=hasCustomCwd&&process.chdir!==void 0&&!process.chdir.disabled;if(shouldSwitchCwd)try{process.chdir(parsed.options.
10
- cwd)}catch{}let resolved;try{resolved=which.sync(parsed.command,{path:env[getPathKey({env})],pathExt:withoutPathExt?path.delimiter:void 0})}catch{}finally{shouldSwitchCwd&&process.chdir(cwd)}return resolved&&(resolved=path.resolve(hasCustomCwd?parsed.options.cwd:"",resolved)),resolved}function resolveCommand2(parsed){return resolveCommandAttempt(parsed)||resolveCommandAttempt(parsed,!0)}module.exports=resolveCommand2}});var require_escape=__commonJS({"packages/coding-agent/node_modules/cross-spawn/lib/util/escape.js"(exports,module){"use strict";var metaCharsRegExp=/([()\][%!^"`<>&|;, *?])/g;function escapeCommand(arg){return arg=arg.replace(metaCharsRegExp,"^$1"),arg}function escapeArgument(arg,doubleEscapeMetaChars){return arg=`${arg}`,arg=arg.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),arg=arg.replace(/(?=(\\+?)?)\1$/,"$1$1"),arg=`"${arg}"`,arg=arg.replace(metaCharsRegExp,"^$1"),doubleEscapeMetaChars&&(arg=arg.replace(
11
- metaCharsRegExp,"^$1")),arg}module.exports.command=escapeCommand;module.exports.argument=escapeArgument}});var require_shebang_regex=__commonJS({"packages/coding-agent/node_modules/shebang-regex/index.js"(exports,module){"use strict";module.exports=/^#!(.*)/}});var require_shebang_command=__commonJS({"packages/coding-agent/node_modules/shebang-command/index.js"(exports,module){"use strict";var shebangRegex=require_shebang_regex();module.exports=(string="")=>{let match=string.match(shebangRegex);if(!match)return null;let[path,argument]=match[0].replace(/#! ?/,"").split(" "),binary=path.split("/").pop();return binary==="env"?argument:argument?`${binary} ${argument}`:binary}}});var require_readShebang=__commonJS({"packages/coding-agent/node_modules/cross-spawn/lib/util/readShebang.js"(exports,module){"use strict";var fs=__require("fs"),shebangCommand=require_shebang_command();function readShebang2(command){let buffer=Buffer.alloc(150),fd;try{fd=fs.openSync(command,"r"),fs.readSync(fd,buffer,0,150,0),fs.closeSync(fd)}catch{}return shebangCommand(buffer.toString())}module.exports=readShebang2}});var require_parse=__commonJS({"packages/coding-agent/node_modules/cross-spawn/lib/parse.js"(exports,module){"use strict";var path=__require("path"),resolveCommand2=require_resolveCommand(),escape=require_escape(),readShebang2=require_readShebang(),isWin=process.platform==="win32",isExecutableRegExp=/\.(?:com|exe)$/i,isCmdShimRegExp=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function detectShebang(parsed){parsed.file=resolveCommand2(parsed);let shebang=parsed.file&&readShebang2(parsed.file);return shebang?
12
- (parsed.args.unshift(parsed.file),parsed.command=shebang,resolveCommand2(parsed)):parsed.file}function parseNonShell(parsed){if(!isWin)return parsed;let commandFile=detectShebang(parsed),needsShell=!isExecutableRegExp.test(commandFile);if(parsed.options.forceShell||needsShell){let needsDoubleEscapeMetaChars=isCmdShimRegExp.test(commandFile);parsed.command=path.normalize(parsed.command),parsed.command=escape.command(parsed.command),parsed.args=parsed.args.map(arg=>escape.argument(arg,needsDoubleEscapeMetaChars));
5
+ resolve3(is)})})}core(path,options||{},function(er,is){er&&(er.code==="EACCES"||options&&options.ignoreErrors)&&(er=null,is=!1),cb(er,is)})}function sync(path,options){try{return core.sync(path,options||{})}catch(er){if(options&&options.ignoreErrors||er.code==="EACCES")return!1;throw er}}}});var require_which=__commonJS({"node_modules/which/which.js"(exports,module){var isWindows=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",path=__require("path"),COLON=isWindows?";":":",isexe=require_isexe(),getNotFoundError=cmd=>Object.assign(new Error(`not found: ${cmd}`),{code:"ENOENT"}),getPathInfo=(cmd,opt)=>{let colon=opt.colon||COLON,pathEnv=cmd.match(/\//)||isWindows&&cmd.match(/\\/)?[""]:[...isWindows?[process.cwd()]:[],...(opt.path||process.env.PATH||
6
+ "").split(colon)],pathExtExe=isWindows?opt.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",pathExt=isWindows?pathExtExe.split(colon):[""];return isWindows&&cmd.indexOf(".")!==-1&&pathExt[0]!==""&&pathExt.unshift(""),{pathEnv,pathExt,pathExtExe}},which=(cmd,opt,cb)=>{typeof opt=="function"&&(cb=opt,opt={}),opt||(opt={});let{pathEnv,pathExt,pathExtExe}=getPathInfo(cmd,opt),found=[],step=i=>new Promise((resolve3,reject)=>{if(i===pathEnv.length)return opt.all&&found.length?resolve3(found):reject(
7
+ getNotFoundError(cmd));let ppRaw=pathEnv[i],pathPart=/^".*"$/.test(ppRaw)?ppRaw.slice(1,-1):ppRaw,pCmd=path.join(pathPart,cmd),p=!pathPart&&/^\.[\\\/]/.test(cmd)?cmd.slice(0,2)+pCmd:pCmd;resolve3(subStep(p,i,0))}),subStep=(p,i,ii)=>new Promise((resolve3,reject)=>{if(ii===pathExt.length)return resolve3(step(i+1));let ext=pathExt[ii];isexe(p+ext,{pathExt:pathExtExe},(er,is)=>{if(!er&&is)if(opt.all)found.push(p+ext);else return resolve3(p+ext);return resolve3(subStep(p,i,ii+1))})});return cb?step(0).
8
+ then(res=>cb(null,res),cb):step(0)},whichSync=(cmd,opt)=>{opt=opt||{};let{pathEnv,pathExt,pathExtExe}=getPathInfo(cmd,opt),found=[];for(let i=0;i<pathEnv.length;i++){let ppRaw=pathEnv[i],pathPart=/^".*"$/.test(ppRaw)?ppRaw.slice(1,-1):ppRaw,pCmd=path.join(pathPart,cmd),p=!pathPart&&/^\.[\\\/]/.test(cmd)?cmd.slice(0,2)+pCmd:pCmd;for(let j=0;j<pathExt.length;j++){let cur=p+pathExt[j];try{if(isexe.sync(cur,{pathExt:pathExtExe}))if(opt.all)found.push(cur);else return cur}catch{}}}if(opt.all&&found.length)
9
+ return found;if(opt.nothrow)return null;throw getNotFoundError(cmd)};module.exports=which;which.sync=whichSync}});var require_path_key=__commonJS({"node_modules/path-key/index.js"(exports,module){"use strict";var pathKey=(options={})=>{let environment=options.env||process.env;return(options.platform||process.platform)!=="win32"?"PATH":Object.keys(environment).reverse().find(key=>key.toUpperCase()==="PATH")||"Path"};module.exports=pathKey;module.exports.default=pathKey}});var require_resolveCommand=__commonJS({"node_modules/cross-spawn/lib/util/resolveCommand.js"(exports,module){"use strict";var path=__require("path"),which=require_which(),getPathKey=require_path_key();function resolveCommandAttempt(parsed,withoutPathExt){let env=parsed.options.env||process.env,cwd=process.cwd(),hasCustomCwd=parsed.options.cwd!=null,shouldSwitchCwd=hasCustomCwd&&process.chdir!==void 0&&!process.chdir.disabled;if(shouldSwitchCwd)try{process.chdir(parsed.options.cwd)}catch{}let resolved;
10
+ try{resolved=which.sync(parsed.command,{path:env[getPathKey({env})],pathExt:withoutPathExt?path.delimiter:void 0})}catch{}finally{shouldSwitchCwd&&process.chdir(cwd)}return resolved&&(resolved=path.resolve(hasCustomCwd?parsed.options.cwd:"",resolved)),resolved}function resolveCommand2(parsed){return resolveCommandAttempt(parsed)||resolveCommandAttempt(parsed,!0)}module.exports=resolveCommand2}});var require_escape=__commonJS({"node_modules/cross-spawn/lib/util/escape.js"(exports,module){"use strict";var metaCharsRegExp=/([()\][%!^"`<>&|;, *?])/g;function escapeCommand(arg){return arg=arg.replace(metaCharsRegExp,"^$1"),arg}function escapeArgument(arg,doubleEscapeMetaChars){return arg=`${arg}`,arg=arg.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),arg=arg.replace(/(?=(\\+?)?)\1$/,"$1$1"),arg=`"${arg}"`,arg=arg.replace(metaCharsRegExp,"^$1"),doubleEscapeMetaChars&&(arg=arg.replace(metaCharsRegExp,"^\
11
+ $1")),arg}module.exports.command=escapeCommand;module.exports.argument=escapeArgument}});var require_shebang_regex=__commonJS({"node_modules/shebang-regex/index.js"(exports,module){"use strict";module.exports=/^#!(.*)/}});var require_shebang_command=__commonJS({"node_modules/shebang-command/index.js"(exports,module){"use strict";var shebangRegex=require_shebang_regex();module.exports=(string="")=>{let match=string.match(shebangRegex);if(!match)return null;let[path,argument]=match[0].replace(/#! ?/,"").split(" "),binary=path.split("/").pop();return binary==="env"?argument:argument?`${binary} ${argument}`:binary}}});var require_readShebang=__commonJS({"node_modules/cross-spawn/lib/util/readShebang.js"(exports,module){"use strict";var fs=__require("fs"),shebangCommand=require_shebang_command();function readShebang2(command){let buffer=Buffer.alloc(150),fd;try{fd=fs.openSync(command,"r"),fs.readSync(fd,buffer,0,150,0),fs.closeSync(fd)}catch{}return shebangCommand(buffer.toString())}module.exports=readShebang2}});var require_parse=__commonJS({"node_modules/cross-spawn/lib/parse.js"(exports,module){"use strict";var path=__require("path"),resolveCommand2=require_resolveCommand(),escape=require_escape(),readShebang2=require_readShebang(),isWin=process.platform==="win32",isExecutableRegExp=/\.(?:com|exe)$/i,isCmdShimRegExp=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function detectShebang(parsed){parsed.file=resolveCommand2(parsed);let shebang=parsed.file&&readShebang2(parsed.file);return shebang?(parsed.args.
12
+ unshift(parsed.file),parsed.command=shebang,resolveCommand2(parsed)):parsed.file}function parseNonShell(parsed){if(!isWin)return parsed;let commandFile=detectShebang(parsed),needsShell=!isExecutableRegExp.test(commandFile);if(parsed.options.forceShell||needsShell){let needsDoubleEscapeMetaChars=isCmdShimRegExp.test(commandFile);parsed.command=path.normalize(parsed.command),parsed.command=escape.command(parsed.command),parsed.args=parsed.args.map(arg=>escape.argument(arg,needsDoubleEscapeMetaChars));
13
13
  let shellCommand=[parsed.command].concat(parsed.args).join(" ");parsed.args=["/d","/s","/c",`"${shellCommand}"`],parsed.command=process.env.comspec||"cmd.exe",parsed.options.windowsVerbatimArguments=!0}return parsed}function parse(command,args,options){args&&!Array.isArray(args)&&(options=args,args=null),args=args?args.slice(0):[],options=Object.assign({},options);let parsed={command,args,options,file:void 0,original:{command,args}};return options.shell?parsed:parseNonShell(parsed)}module.exports=
14
- parse}});var require_enoent=__commonJS({"packages/coding-agent/node_modules/cross-spawn/lib/enoent.js"(exports,module){"use strict";var isWin=process.platform==="win32";function notFoundError(original,syscall){return Object.assign(new Error(`${syscall} ${original.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${syscall} ${original.command}`,path:original.command,spawnargs:original.args})}function hookChildProcess(cp,parsed){if(!isWin)return;let originalEmit=cp.emit;cp.emit=function(name,arg1){if(name===
15
- "exit"){let err=verifyENOENT(arg1,parsed);if(err)return originalEmit.call(cp,"error",err)}return originalEmit.apply(cp,arguments)}}function verifyENOENT(status,parsed){return isWin&&status===1&&!parsed.file?notFoundError(parsed.original,"spawn"):null}function verifyENOENTSync(status,parsed){return isWin&&status===1&&!parsed.file?notFoundError(parsed.original,"spawnSync"):null}module.exports={hookChildProcess,verifyENOENT,verifyENOENTSync,notFoundError}}});var require_cross_spawn=__commonJS({"packages/coding-agent/node_modules/cross-spawn/index.js"(exports,module){"use strict";var cp=__require("child_process"),parse=require_parse(),enoent=require_enoent();function spawn(command,args,options){let parsed=parse(command,args,options),spawned=cp.spawn(parsed.command,parsed.args,parsed.options);return enoent.hookChildProcess(spawned,parsed),spawned}function spawnSync(command,args,options){let parsed=parse(command,args,options),result=cp.spawnSync(parsed.
16
- command,parsed.args,parsed.options);return result.error=result.error||enoent.verifyENOENTSync(result.status,parsed),result}module.exports=spawn;module.exports.spawn=spawn;module.exports.sync=spawnSync;module.exports._parse=parse;module.exports._enoent=enoent}});import{accessSync,constants,existsSync,readFileSync,realpathSync as realpathSync2}from"fs";import{createRequire}from"module";import{homedir as homedir2}from"os";import{basename,dirname,join as join3,resolve as resolve2,sep as sep2,win32}from"path";import{fileURLToPath as fileURLToPath3}from"url";var import_cross_spawn=__toESM(require_cross_spawn(),1),import_readShebang=__toESM(require_readShebang(),1),import_resolveCommand=__toESM(require_resolveCommand(),1);import{spawn as nodeSpawn,spawnSync as nodeSpawnSync}from"node:child_process";import{isAbsolute,join,resolve}from"node:path";import{fileURLToPath}from"node:url";import{lstatSync,statSync}from"node:fs";import{delimiter}from"node:path";function windowsPathDirectories(path){return path.split(delimiter).map(dir=>dir.trim().replace(/^"(.*)"$/,"$1")).filter(Boolean)}function isProgramFile(file){try{let stats=statSync(file,{throwIfNoEntry:!1});if(stats)return stats.isFile()}catch{}try{let link=lstatSync(file,{throwIfNoEntry:!1});return link!==void 0&&!link.isDirectory()}catch{return!1}}var EXIT_STDIO_GRACE_MS=100;function spawnProcess(command,args,options){if(process.platform!=="win32")return nodeSpawn(command,args,options);let invocation=resolveWindowsInvocation(command,args,options);return(0,import_cross_spawn.default)(invocation.command,invocation.args,options)}function spawnProcessSync(command,args,options){if(process.platform!=="win32")return nodeSpawnSync(command,args,options);let invocation=resolveWindowsInvocation(command,args,options);return import_cross_spawn.default.
14
+ parse}});var require_enoent=__commonJS({"node_modules/cross-spawn/lib/enoent.js"(exports,module){"use strict";var isWin=process.platform==="win32";function notFoundError(original,syscall){return Object.assign(new Error(`${syscall} ${original.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${syscall} ${original.command}`,path:original.command,spawnargs:original.args})}function hookChildProcess(cp,parsed){if(!isWin)return;let originalEmit=cp.emit;cp.emit=function(name,arg1){if(name==="exit"){let err=verifyENOENT(
15
+ arg1,parsed);if(err)return originalEmit.call(cp,"error",err)}return originalEmit.apply(cp,arguments)}}function verifyENOENT(status,parsed){return isWin&&status===1&&!parsed.file?notFoundError(parsed.original,"spawn"):null}function verifyENOENTSync(status,parsed){return isWin&&status===1&&!parsed.file?notFoundError(parsed.original,"spawnSync"):null}module.exports={hookChildProcess,verifyENOENT,verifyENOENTSync,notFoundError}}});var require_cross_spawn=__commonJS({"node_modules/cross-spawn/index.js"(exports,module){"use strict";var cp=__require("child_process"),parse=require_parse(),enoent=require_enoent();function spawn(command,args,options){let parsed=parse(command,args,options),spawned=cp.spawn(parsed.command,parsed.args,parsed.options);return enoent.hookChildProcess(spawned,parsed),spawned}function spawnSync(command,args,options){let parsed=parse(command,args,options),result=cp.spawnSync(parsed.command,parsed.args,parsed.
16
+ options);return result.error=result.error||enoent.verifyENOENTSync(result.status,parsed),result}module.exports=spawn;module.exports.spawn=spawn;module.exports.sync=spawnSync;module.exports._parse=parse;module.exports._enoent=enoent}});import{accessSync,constants,existsSync,readFileSync,realpathSync as realpathSync2}from"fs";import{createRequire}from"module";import{homedir as homedir2}from"os";import{basename,dirname,join as join3,resolve as resolve2,sep as sep2,win32}from"path";import{fileURLToPath as fileURLToPath3}from"url";var import_cross_spawn=__toESM(require_cross_spawn(),1),import_readShebang=__toESM(require_readShebang(),1),import_resolveCommand=__toESM(require_resolveCommand(),1);import{spawn as nodeSpawn,spawnSync as nodeSpawnSync}from"node:child_process";import{isAbsolute,join,resolve}from"node:path";import{fileURLToPath}from"node:url";import{lstatSync,statSync}from"node:fs";import{delimiter}from"node:path";function windowsPathDirectories(path){return path.split(delimiter).map(dir=>dir.trim().replace(/^"(.*)"$/,"$1")).filter(Boolean)}function isProgramFile(file){try{let stats=statSync(file,{throwIfNoEntry:!1});if(stats)return stats.isFile()}catch{}try{let link=lstatSync(file,{throwIfNoEntry:!1});return link!==void 0&&!link.isDirectory()}catch{return!1}}var EXIT_STDIO_GRACE_MS=100;function spawnProcess(command,args,options){if(process.platform!=="win32")return nodeSpawn(command,args,options);let invocation=resolveWindowsInvocation(command,args,options);return(0,import_cross_spawn.default)(invocation.command,invocation.args,options)}function spawnProcessSync(command,args,options){if(process.platform!=="win32")return nodeSpawnSync(command,args,options);let invocation=resolveWindowsInvocation(command,args,options);return import_cross_spawn.default.
17
17
  sync(invocation.command,invocation.args,options)}function resolveWindowsInvocation(command,args,options){let file=resolveWindowsCommand(command,options.env);if(options.shell)return{command:file,args};let cwd=typeof options.cwd=="object"?fileURLToPath(options.cwd):options.cwd,visited=new Set;for(;;){file=resolve(cwd??"",file);let script=(0,import_resolveCommand.default)({command:file,options:{env:options.env}})??file,key=script.toLowerCase();if(visited.has(key)||visited.size===32)return{command:resolveWindowsCommand(
18
- "shebang-chain",{PATH:""}),args};visited.add(key);let interpreter=(0,import_readShebang.default)(script);if(!interpreter)return{command:script,args};file=resolveWindowsCommand(interpreter,options.env),args=[script,...args]}}function resolveWindowsCommand(command,env){if(/[\\/]/.test(command))return command;let source=env??process.env,pathKey="PATH"in source?"PATH":Object.keys(source).find(key=>key.toLowerCase()==="path"),dirs=windowsPathDirectories(pathKey?source[pathKey]??"":"").filter(dir=>isAbsolute(
19
- dir)),pathExtensions=(source.PATHEXT??".COM;.EXE;.BAT;.CMD").split(";").filter(Boolean),extensions=command.includes(".")?["",...pathExtensions]:pathExtensions;for(let dir of dirs)for(let extension of extensions){let file=join(dir,command+extension);if(isProgramFile(file))return file}return join(process.env.SystemRoot??"C:\\Windows","humain-code-no-such-command",`${command}.exe`)}function waitForChildProcess(child,drainSignal){return new Promise((resolve3,reject)=>{let settled=!1,exited=!1,exitCode=null,
20
- postExitTimer,stdoutEnded=child.stdout===null,stderrEnded=child.stderr===null,cleanup=()=>{drainSignal?.removeEventListener("abort",onDrainAbort),postExitTimer&&(clearTimeout(postExitTimer),postExitTimer=void 0),child.removeListener("error",onError),child.removeListener("exit",onExit),child.removeListener("close",onClose),child.stdout?.removeListener("end",onStdoutEnd),child.stderr?.removeListener("end",onStderrEnd),child.stdout?.removeListener("data",onData),child.stderr?.removeListener("data",
21
- onData)},finalize=code=>{settled||(settled=!0,cleanup(),child.stdout?.destroy(),child.stderr?.destroy(),resolve3(code))},onDrainAbort=()=>finalize(child.exitCode),maybeFinalizeAfterExit=()=>{!exited||settled||stdoutEnded&&stderrEnded&&finalize(exitCode)},armIdleTimer=()=>{postExitTimer&&clearTimeout(postExitTimer),postExitTimer=setTimeout(()=>finalize(exitCode),EXIT_STDIO_GRACE_MS)},onData=()=>{exited&&!settled&&armIdleTimer()},onStdoutEnd=()=>{stdoutEnded=!0,maybeFinalizeAfterExit()},onStderrEnd=()=>{
22
- stderrEnded=!0,maybeFinalizeAfterExit()},onError=err=>{settled||(settled=!0,cleanup(),reject(err))},onExit=code=>{exited=!0,exitCode=code,maybeFinalizeAfterExit(),settled||armIdleTimer()},onClose=code=>{finalize(code)};child.stdout?.once("end",onStdoutEnd),child.stderr?.once("end",onStderrEnd),child.stdout?.on("data",onData),child.stderr?.on("data",onData),child.once("error",onError),child.once("exit",onExit),child.once("close",onClose),drainSignal?.addEventListener("abort",onDrainAbort,{once:!0}),
23
- drainSignal?.aborted&&onDrainAbort()})}import{realpathSync,statSync as statSync2}from"node:fs";import{homedir}from"node:os";import{isAbsolute as isAbsolute2,join as join2,resolve as nodeResolvePath,relative,sep}from"node:path";import{fileURLToPath as fileURLToPath2}from"node:url";var UNICODE_SPACES=/[\u00A0\u2000-\u200A\u202F\u205F\u3000]/g;function canonicalizePath(path){try{return realpathSync(path)}catch{return path}}function getFileRevision(path){try{let stats=statSync2(path,{bigint:!0});return`${stats.dev}:${stats.ino}:${stats.size}:${stats.mtimeNs}:${stats.ctimeNs}`}catch{return}}function isLocalPath(value){let trimmed=value.trim();return!(trimmed.startsWith("npm:")||trimmed.startsWith("git:")||trimmed.startsWith("github:")||trimmed.startsWith("http:")||trimmed.startsWith(
18
+ "shebang-chain",{PATH:""}),args};visited.add(key);let interpreter=(0,import_readShebang.default)(script);if(!interpreter)return{command:script,args};file=resolveWindowsCommand(interpreter,options.env),args=[script,...args]}}var resolvedWindowsCommands=new Map;function resolveWindowsCommand(command,env){if(/[\\/]/.test(command))return command;let source=env??process.env,pathKey="PATH"in source?"PATH":Object.keys(source).find(key2=>key2.toLowerCase()==="path"),pathValue=pathKey?source[pathKey]??"":
19
+ "",key=`${pathValue}\0${source.PATHEXT??""}\0${command}`,cached=resolvedWindowsCommands.get(key);if(cached&&isProgramFile(cached))return cached;resolvedWindowsCommands.delete(key);let dirs=windowsPathDirectories(pathValue).filter(dir=>isAbsolute(dir)),pathExtensions=(source.PATHEXT??".COM;.EXE;.BAT;.CMD").split(";").filter(Boolean),extensions=command.includes(".")?["",...pathExtensions]:pathExtensions;for(let dir of dirs)for(let extension of extensions){let file=join(dir,command+extension);if(isProgramFile(
20
+ file))return resolvedWindowsCommands.set(key,file),file}return join(process.env.SystemRoot??"C:\\Windows","humain-code-no-such-command",`${command}.exe`)}function waitForChildProcess(child,drainSignal){return new Promise((resolve3,reject)=>{let settled=!1,exited=!1,exitCode=null,postExitTimer,stdoutEnded=child.stdout===null,stderrEnded=child.stderr===null,cleanup=()=>{drainSignal?.removeEventListener("abort",onDrainAbort),postExitTimer&&(clearTimeout(postExitTimer),postExitTimer=void 0),child.removeListener(
21
+ "error",onError),child.removeListener("exit",onExit),child.removeListener("close",onClose),child.stdout?.removeListener("end",onStdoutEnd),child.stderr?.removeListener("end",onStderrEnd),child.stdout?.removeListener("data",onData),child.stderr?.removeListener("data",onData)},finalize=code=>{settled||(settled=!0,cleanup(),child.stdout?.destroy(),child.stderr?.destroy(),resolve3(code))},onDrainAbort=()=>finalize(child.exitCode),maybeFinalizeAfterExit=()=>{!exited||settled||stdoutEnded&&stderrEnded&&
22
+ finalize(exitCode)},armIdleTimer=()=>{postExitTimer&&clearTimeout(postExitTimer),postExitTimer=setTimeout(()=>finalize(exitCode),EXIT_STDIO_GRACE_MS)},onData=()=>{exited&&!settled&&armIdleTimer()},onStdoutEnd=()=>{stdoutEnded=!0,maybeFinalizeAfterExit()},onStderrEnd=()=>{stderrEnded=!0,maybeFinalizeAfterExit()},onError=err=>{settled||(settled=!0,cleanup(),reject(err))},onExit=code=>{exited=!0,exitCode=code,maybeFinalizeAfterExit(),settled||armIdleTimer()},onClose=code=>{finalize(code)};child.stdout?.
23
+ once("end",onStdoutEnd),child.stderr?.once("end",onStderrEnd),child.stdout?.on("data",onData),child.stderr?.on("data",onData),child.once("error",onError),child.once("exit",onExit),child.once("close",onClose),drainSignal?.addEventListener("abort",onDrainAbort,{once:!0}),drainSignal?.aborted&&onDrainAbort()})}import{realpathSync,statSync as statSync2}from"node:fs";import{homedir}from"node:os";import{isAbsolute as isAbsolute2,join as join2,resolve as nodeResolvePath,relative,sep}from"node:path";import{fileURLToPath as fileURLToPath2}from"node:url";var UNICODE_SPACES=/[\u00A0\u2000-\u200A\u202F\u205F\u3000]/g;function canonicalizePath(path){try{return realpathSync(path)}catch{return path}}function getFileRevision(path){try{let stats=statSync2(path,{bigint:!0});return`${stats.dev}:${stats.ino}:${stats.size}:${stats.mtimeNs}:${stats.ctimeNs}`}catch{return}}function isLocalPath(value){let trimmed=value.trim();return!(trimmed.startsWith("npm:")||trimmed.startsWith("git:")||trimmed.startsWith("github:")||trimmed.startsWith("http:")||trimmed.startsWith(
24
24
  "https:")||trimmed.startsWith("ssh:")||trimmed.startsWith("builtin:"))}function normalizeWindowsShellPath(filePath){if(!filePath.startsWith("/")||filePath.startsWith("//")||filePath.includes("\\"))return filePath;let match=filePath.match(/^\/(?:mnt\/|cygdrive\/)?([a-z])(?:\/(.*))?$/i);if(!match)return filePath;let suffix=match[2]?.replaceAll("/","\\");return`${match[1].toUpperCase()}:\\${suffix??""}`}function normalizePath(input,options={}){let normalized=options.trim?input.trim():input;if(options.
25
25
  normalizeUnicodeSpaces&&(normalized=normalized.replace(UNICODE_SPACES," ")),options.stripAtPrefix&&normalized.startsWith("@")&&(normalized=normalized.slice(1)),process.platform==="win32"&&(normalized=normalizeWindowsShellPath(normalized)),options.expandTilde??!0){let home=options.homeDir??homedir();if(normalized==="~")return home;if(normalized.startsWith("~/")||process.platform==="win32"&&normalized.startsWith("~\\"))return join2(home,normalized.slice(2))}return/^file:\/\//.test(normalized)?fileURLToPath2(
26
26
  normalized):normalized}function resolvePath(input,baseDir=process.cwd(),options={}){let normalized=normalizePath(input,options),normalizedBaseDir=normalizePath(baseDir);return isAbsolute2(normalized)?nodeResolvePath(normalized):nodeResolvePath(normalizedBaseDir,normalized)}function getCwdRelativePath(filePath,cwd){let resolvedCwd=resolvePath(cwd),resolvedPath=resolvePath(filePath,resolvedCwd),relativePath=relative(resolvedCwd,resolvedPath);return relativePath===""||relativePath!==".."&&!relativePath.
@@ -51,6 +51,6 @@ trim().replace(/[^a-zA-Z0-9]+/g,"_").replace(/^_+|_+$/g,"").toUpperCase()}var PA
51
51
  APP_NAME),ENV_AGENT_DIR=`${ENV_PREFIX}_CODING_AGENT_DIR`,ENV_SESSION_DIR=`${ENV_PREFIX}_CODING_AGENT_SESSION_DIR`,ENV_SESSION_ID=`${ENV_PREFIX}_SESSION_ID`,ENV_SESSION_FILE=`${ENV_PREFIX}_SESSION_FILE`,ENV_PROVIDER=`${ENV_PREFIX}_PROVIDER`,ENV_MODEL=`${ENV_PREFIX}_MODEL`,ENV_MCP_CLIENT_METADATA_URL=`${ENV_PREFIX}_MCP_CLIENT_METADATA_URL`,ENV_REASONING_LEVEL=`${ENV_PREFIX}_REASONING_LEVEL`,ENV_OFFLINE=`${ENV_PREFIX}_OFFLINE`,ENV_PACKAGE_DIR=`${ENV_PREFIX}_PACKAGE_DIR`,ENV_SHARE_VIEWER_URL=`${ENV_PREFIX}\
52
52
  _SHARE_VIEWER_URL`,ENV_SKIP_VERSION_CHECK=`${ENV_PREFIX}_SKIP_VERSION_CHECK`,ENV_STARTUP_BENCHMARK=`${ENV_PREFIX}_STARTUP_BENCHMARK`,ENV_TELEMETRY=`${ENV_PREFIX}_TELEMETRY`,ENV_VERSION_CHECK_URL=`${ENV_PREFIX}_VERSION_CHECK_URL`,ENV_BINARY_RELEASE_URL=`${ENV_PREFIX}_BINARY_RELEASE_URL`,ENV_INSTALL_TELEMETRY_URL=`${ENV_PREFIX}_INSTALL_TELEMETRY_URL`,ENV_CHANGELOG_URL=`${ENV_PREFIX}_CHANGELOG_URL`;function expandTildePath(path){return normalizePath(path)}var HUMAIN_TERMINAL_WEB_URL="https://code.h\
53
53
  umain.com",HUMAIN_TERMINAL_BINARY_RELEASE_URL="https://gitlab.humain.com/humain/data-and-ai-modeling/standard/agentic/humain-terminal/-/releases/permalink/latest",HUMAIN_TERMINAL_VERSION_CHECK_URL="https://registry.npmjs.org/@humain%2fhumain-code/latest",HUMAIN_TERMINAL_INSTALL_TELEMETRY_URL=`${HUMAIN_TERMINAL_WEB_URL}/api/report-install`,HUMAIN_TERMINAL_CHANGELOG_URL=`${HUMAIN_TERMINAL_WEB_URL}/changelog`,DEFAULT_SHARE_VIEWER_URL=`${HUMAIN_TERMINAL_WEB_URL}/session/`;function getVersionCheckUrl(){
54
- return process.env[ENV_VERSION_CHECK_URL]||HUMAIN_TERMINAL_VERSION_CHECK_URL}function getBinaryReleaseUrl(){return process.env[ENV_BINARY_RELEASE_URL]||HUMAIN_TERMINAL_BINARY_RELEASE_URL}function getShareViewerUrl(gistId){return`${process.env[ENV_SHARE_VIEWER_URL]||process.env.PI_SHARE_VIEWER_URL||DEFAULT_SHARE_VIEWER_URL}#${gistId}`}function getAgentDir(){let envDir=process.env[ENV_AGENT_DIR];return envDir?expandTildePath(envDir):join3(homedir2(),CONFIG_DIR_NAME,"agent")}function getCustomThemesDir(){return join3(getAgentDir(),"themes")}function getAuthPath(){return join3(getAgentDir(),"auth.json")}function getSettingsPath(){return join3(getAgentDir(),"settings.json")}function getBinDir(){return join3(getAgentDir(),"bin")}function getSessionsDir(){return join3(getAgentDir(),"sessions")}function getDebugLogPath(){return join3(getAgentDir(),`${APP_NAME}-debug.log`)}export{require_isexe,spawnProcess,spawnProcessSync,waitForChildProcess,canonicalizePath,getFileRevision,isLocalPath,normalizePath,resolvePath,getCwdRelativePath,formatPathRelativeToCwdOrAbsolute,markPathIgnoredByCloudSync,splitBom,stripBom,isBunBinary,isBunRuntime,isBundledNode,detectInstallMethod,getSelfUpdateCommand,getSelfUpdateUnavailableInstruction,getPackageDir,getThemesDir,getExportTemplateDir,getReadmePath,getDocsPath,getExamplesPath,getChangelogPath,getBundledInteractiveAssetPath,getHumainModuleAssetsDir,
55
- getBundledFlowPackageDir,getBundledFlowProfilesDir,getQuickJSWasmPath,getCodemodeWorkerSpecifier,detectInstallChange,PACKAGE_NAME,APP_NAME,APP_TITLE,APP_COMMAND,CONFIG_DIR_NAME,FIRST_TIME_SETUP_ENABLED,VERSION,UPSTREAM_PI_VERSION,ENV_PREFIX,ENV_AGENT_DIR,ENV_SESSION_DIR,ENV_MCP_CLIENT_METADATA_URL,ENV_OFFLINE,ENV_PACKAGE_DIR,ENV_SHARE_VIEWER_URL,ENV_SKIP_VERSION_CHECK,ENV_TELEMETRY,expandTildePath,HUMAIN_TERMINAL_WEB_URL,DEFAULT_SHARE_VIEWER_URL,getVersionCheckUrl,getShareViewerUrl,getAgentDir,getCustomThemesDir,
56
- getAuthPath,getSettingsPath,getBinDir,getSessionsDir,getDebugLogPath};
54
+ return process.env[ENV_VERSION_CHECK_URL]||HUMAIN_TERMINAL_VERSION_CHECK_URL}function getBinaryReleaseUrl(){return process.env[ENV_BINARY_RELEASE_URL]||HUMAIN_TERMINAL_BINARY_RELEASE_URL}function getShareViewerUrl(gistId){return`${process.env[ENV_SHARE_VIEWER_URL]||process.env.PI_SHARE_VIEWER_URL||DEFAULT_SHARE_VIEWER_URL}#${gistId}`}function getAgentDir(){let envDir=process.env[ENV_AGENT_DIR];return envDir?expandTildePath(envDir):join3(homedir2(),CONFIG_DIR_NAME,"agent")}function getCustomThemesDir(){return join3(getAgentDir(),"themes")}function getAuthPath(){return join3(getAgentDir(),"auth.json")}function getSettingsPath(){return join3(getAgentDir(),"settings.json")}function getBinDir(){return join3(getAgentDir(),"bin")}function getSessionsDir(){return join3(getAgentDir(),"sessions")}function getDebugLogPath(){return join3(getAgentDir(),`${APP_NAME}-debug.log`)}export{require_resolveCommand,require_readShebang,require_cross_spawn,spawnProcess,spawnProcessSync,waitForChildProcess,canonicalizePath,getFileRevision,isLocalPath,normalizePath,resolvePath,getCwdRelativePath,formatPathRelativeToCwdOrAbsolute,markPathIgnoredByCloudSync,splitBom,stripBom,isBunBinary,isBunRuntime,isBundledNode,detectInstallMethod,getSelfUpdateCommand,getSelfUpdateUnavailableInstruction,getPackageDir,getThemesDir,getExportTemplateDir,getReadmePath,getDocsPath,getExamplesPath,getChangelogPath,
55
+ getBundledInteractiveAssetPath,getHumainModuleAssetsDir,getBundledFlowPackageDir,getBundledFlowProfilesDir,getQuickJSWasmPath,getCodemodeWorkerSpecifier,detectInstallChange,PACKAGE_NAME,APP_NAME,APP_TITLE,APP_COMMAND,CONFIG_DIR_NAME,FIRST_TIME_SETUP_ENABLED,VERSION,UPSTREAM_PI_VERSION,ENV_PREFIX,ENV_AGENT_DIR,ENV_SESSION_DIR,ENV_MCP_CLIENT_METADATA_URL,ENV_OFFLINE,ENV_PACKAGE_DIR,ENV_SHARE_VIEWER_URL,ENV_SKIP_VERSION_CHECK,ENV_TELEMETRY,expandTildePath,HUMAIN_TERMINAL_WEB_URL,DEFAULT_SHARE_VIEWER_URL,
56
+ getVersionCheckUrl,getShareViewerUrl,getAgentDir,getCustomThemesDir,getAuthPath,getSettingsPath,getBinDir,getSessionsDir,getDebugLogPath};
@@ -0,0 +1,8 @@
1
+ import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
2
+ function createSseDecoder(options={}){return{event:null,data:[],raw:[],stripLineBom:options.stripLineBom??!1,rest:"",skipLeadingNewline:!1}}function flushSseEvent(state){if(!state.event&&state.data.length===0)return null;let event={event:state.event,data:state.data.join(`
3
+ `),raw:state.raw};return state.event=null,state.data=[],state.raw=[],event}function decodeSseLine(line,state){if(state.stripLineBom&&line.charCodeAt(0)===65279&&(line=line.slice(1)),line==="")return flushSseEvent(state);if(state.raw.push(line),line.startsWith(":"))return null;let delimiterIndex=line.indexOf(":"),fieldName=delimiterIndex===-1?line:line.slice(0,delimiterIndex),value=delimiterIndex===-1?"":line.slice(delimiterIndex+1);return value.startsWith(" ")&&(value=value.slice(1)),fieldName===
4
+ "event"?state.event=value:fieldName==="data"&&state.data.push(value),null}function*decodeSseText(state,text,final){let lineStart=0;state.skipLeadingNewline&&text.length>0&&(state.skipLeadingNewline=!1,text.charCodeAt(0)===10&&(lineStart=1));let buffer=text;state.rest.length>0&&(buffer=state.rest+text.slice(lineStart),lineStart=0,state.rest="");let carriageReturn=buffer.indexOf("\r",lineStart),newline=buffer.indexOf(`
5
+ `,lineStart);for(;carriageReturn!==-1||newline!==-1;){let lineEnd=carriageReturn===-1?newline:newline===-1?carriageReturn:Math.min(carriageReturn,newline),next=lineEnd+1;lineEnd===carriageReturn&&(newline===next?next+=1:next===buffer.length&&(state.skipLeadingNewline=!final));let event=decodeSseLine(buffer.slice(lineStart,lineEnd),state);event&&(yield event),lineStart=next,carriageReturn!==-1&&carriageReturn<next&&(carriageReturn=buffer.indexOf("\r",next)),newline!==-1&&newline<next&&(newline=buffer.
6
+ indexOf(`
7
+ `,next))}if(final){if(lineStart<buffer.length){let event=decodeSseLine(buffer.slice(lineStart),state);event&&(yield event)}let trailingEvent=flushSseEvent(state);trailingEvent&&(yield trailingEvent)}else lineStart<buffer.length&&(state.rest=lineStart===0?buffer:buffer.slice(lineStart))}async function*iterateSseMessages(body,options={}){let reader=body.getReader(),decoder=new TextDecoder,state=createSseDecoder();try{for(;;){if(options.signal?.aborted)throw new Error("Request was aborted");let{value,
8
+ done}=await reader.read();if(done)break;yield*decodeSseText(state,decoder.decode(value,{stream:!0}),!1)}yield*decodeSseText(state,decoder.decode(),!0)}finally{reader.releaseLock()}}export{createSseDecoder,decodeSseText,iterateSseMessages};