@code-yeongyu/senpi 2026.9.11 → 2026.9.12-3

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 (1582) hide show
  1. package/CHANGELOG.md +83 -0
  2. package/README.md +1 -1
  3. package/dist/bun/cli.d.ts +2 -1
  4. package/dist/bun/cli.d.ts.map +1 -1
  5. package/dist/bun/cli.js +5 -8
  6. package/dist/bun/cli.js.map +1 -1
  7. package/dist/bun/runtime-setup.d.ts +2 -0
  8. package/dist/bun/runtime-setup.d.ts.map +1 -0
  9. package/dist/bun/runtime-setup.js +9 -0
  10. package/dist/bun/runtime-setup.js.map +1 -0
  11. package/dist/bun/sandbox-env-setup.d.ts +2 -0
  12. package/dist/bun/sandbox-env-setup.d.ts.map +1 -0
  13. package/dist/bun/sandbox-env-setup.js +4 -0
  14. package/dist/bun/sandbox-env-setup.js.map +1 -0
  15. package/dist/cli/config-selector.d.ts.map +1 -1
  16. package/dist/cli/config-selector.js +2 -1
  17. package/dist/cli/config-selector.js.map +1 -1
  18. package/dist/cli/setup.d.ts +2 -0
  19. package/dist/cli/setup.d.ts.map +1 -0
  20. package/dist/cli/setup.js +12 -0
  21. package/dist/cli/setup.js.map +1 -0
  22. package/dist/cli.js +3 -0
  23. package/dist/cli.js.map +1 -1
  24. package/dist/client/index.d.ts +1 -2
  25. package/dist/client/index.d.ts.map +1 -1
  26. package/dist/client/index.js +1 -2
  27. package/dist/client/index.js.map +1 -1
  28. package/dist/config.d.ts +1 -0
  29. package/dist/config.d.ts.map +1 -1
  30. package/dist/config.js +1 -0
  31. package/dist/config.js.map +1 -1
  32. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  33. package/dist/core/agent-session-runtime.js +18 -6
  34. package/dist/core/agent-session-runtime.js.map +1 -1
  35. package/dist/core/agent-session.d.ts +54 -17
  36. package/dist/core/agent-session.d.ts.map +1 -1
  37. package/dist/core/agent-session.js +153 -157
  38. package/dist/core/agent-session.js.map +1 -1
  39. package/dist/core/compaction/branch-summarization.d.ts +1 -1
  40. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  41. package/dist/core/compaction/branch-summarization.js +6 -4
  42. package/dist/core/compaction/branch-summarization.js.map +1 -1
  43. package/dist/core/compaction-settings-access.d.ts +18 -2
  44. package/dist/core/compaction-settings-access.d.ts.map +1 -1
  45. package/dist/core/compaction-settings-access.js +35 -4
  46. package/dist/core/compaction-settings-access.js.map +1 -1
  47. package/dist/core/compaction-settings-resolver.d.ts +2 -2
  48. package/dist/core/compaction-settings-resolver.d.ts.map +1 -1
  49. package/dist/core/compaction-settings-resolver.js +6 -3
  50. package/dist/core/compaction-settings-resolver.js.map +1 -1
  51. package/dist/core/cursor-history-admission.d.ts +50 -0
  52. package/dist/core/cursor-history-admission.d.ts.map +1 -0
  53. package/dist/core/cursor-history-admission.js +130 -0
  54. package/dist/core/cursor-history-admission.js.map +1 -0
  55. package/dist/core/extensions/builtin/ask-user/extension.d.ts.map +1 -1
  56. package/dist/core/extensions/builtin/ask-user/extension.js +11 -0
  57. package/dist/core/extensions/builtin/ask-user/extension.js.map +1 -1
  58. package/dist/core/extensions/builtin/cursor-cli-oauth/models.d.ts.map +1 -1
  59. package/dist/core/extensions/builtin/cursor-cli-oauth/models.js +2 -1
  60. package/dist/core/extensions/builtin/cursor-cli-oauth/models.js.map +1 -1
  61. package/dist/core/extensions/builtin/prompt-preset/presets.d.ts.map +1 -1
  62. package/dist/core/extensions/builtin/prompt-preset/presets.js +7 -1
  63. package/dist/core/extensions/builtin/prompt-preset/presets.js.map +1 -1
  64. package/dist/core/extensions/loader.d.ts.map +1 -1
  65. package/dist/core/extensions/loader.js +4 -2
  66. package/dist/core/extensions/loader.js.map +1 -1
  67. package/dist/core/keybindings.d.ts +10 -0
  68. package/dist/core/keybindings.d.ts.map +1 -1
  69. package/dist/core/keybindings.js +8 -0
  70. package/dist/core/keybindings.js.map +1 -1
  71. package/dist/core/messages.d.ts +1 -1
  72. package/dist/core/messages.d.ts.map +1 -1
  73. package/dist/core/messages.js.map +1 -1
  74. package/dist/core/model-registry.d.ts +5 -1
  75. package/dist/core/model-registry.d.ts.map +1 -1
  76. package/dist/core/model-registry.js +8 -0
  77. package/dist/core/model-registry.js.map +1 -1
  78. package/dist/core/model-resolver.d.ts.map +1 -1
  79. package/dist/core/model-resolver.js +2 -0
  80. package/dist/core/model-resolver.js.map +1 -1
  81. package/dist/core/model-runtime.d.ts +1 -0
  82. package/dist/core/model-runtime.d.ts.map +1 -1
  83. package/dist/core/model-runtime.js +5 -2
  84. package/dist/core/model-runtime.js.map +1 -1
  85. package/dist/core/retry-fallback/settings.d.ts +2 -0
  86. package/dist/core/retry-fallback/settings.d.ts.map +1 -1
  87. package/dist/core/retry-fallback/settings.js.map +1 -1
  88. package/dist/core/session-manager.d.ts +5 -2
  89. package/dist/core/session-manager.d.ts.map +1 -1
  90. package/dist/core/session-manager.js +68 -19
  91. package/dist/core/session-manager.js.map +1 -1
  92. package/dist/core/session-write-reservation.d.ts +9 -0
  93. package/dist/core/session-write-reservation.d.ts.map +1 -1
  94. package/dist/core/session-write-reservation.js +33 -0
  95. package/dist/core/session-write-reservation.js.map +1 -1
  96. package/dist/core/settings-manager.d.ts +12 -5
  97. package/dist/core/settings-manager.d.ts.map +1 -1
  98. package/dist/core/settings-manager.js +18 -6
  99. package/dist/core/settings-manager.js.map +1 -1
  100. package/dist/core/settings-public-types.d.ts +1 -1
  101. package/dist/core/settings-public-types.d.ts.map +1 -1
  102. package/dist/core/settings-public-types.js.map +1 -1
  103. package/dist/core/skills.d.ts +1 -1
  104. package/dist/core/skills.d.ts.map +1 -1
  105. package/dist/core/skills.js +6 -2
  106. package/dist/core/skills.js.map +1 -1
  107. package/dist/core/system-prompt.d.ts.map +1 -1
  108. package/dist/core/system-prompt.js +8 -9
  109. package/dist/core/system-prompt.js.map +1 -1
  110. package/dist/core/tools/bash.d.ts.map +1 -1
  111. package/dist/core/tools/bash.js +3 -142
  112. package/dist/core/tools/bash.js.map +1 -1
  113. package/dist/core/tools/edit.d.ts +1 -12
  114. package/dist/core/tools/edit.d.ts.map +1 -1
  115. package/dist/core/tools/edit.js +4 -168
  116. package/dist/core/tools/edit.js.map +1 -1
  117. package/dist/core/tools/find.d.ts.map +1 -1
  118. package/dist/core/tools/find.js +2 -53
  119. package/dist/core/tools/find.js.map +1 -1
  120. package/dist/core/tools/grep.d.ts.map +1 -1
  121. package/dist/core/tools/grep.js +2 -58
  122. package/dist/core/tools/grep.js.map +1 -1
  123. package/dist/core/tools/ls.d.ts.map +1 -1
  124. package/dist/core/tools/ls.js +2 -47
  125. package/dist/core/tools/ls.js.map +1 -1
  126. package/dist/core/tools/read.d.ts +1 -4
  127. package/dist/core/tools/read.d.ts.map +1 -1
  128. package/dist/core/tools/read.js +4 -141
  129. package/dist/core/tools/read.js.map +1 -1
  130. package/dist/core/tools/renderers/bash.d.ts +12 -0
  131. package/dist/core/tools/renderers/bash.d.ts.map +1 -0
  132. package/dist/core/tools/renderers/bash.js +156 -0
  133. package/dist/core/tools/renderers/bash.js.map +1 -0
  134. package/dist/core/tools/renderers/edit.d.ts +23 -0
  135. package/dist/core/tools/renderers/edit.d.ts.map +1 -0
  136. package/dist/core/tools/renderers/edit.js +172 -0
  137. package/dist/core/tools/renderers/edit.js.map +1 -0
  138. package/dist/core/tools/renderers/find.d.ts +10 -0
  139. package/dist/core/tools/renderers/find.d.ts.map +1 -0
  140. package/dist/core/tools/renderers/find.js +64 -0
  141. package/dist/core/tools/renderers/find.js.map +1 -0
  142. package/dist/core/tools/renderers/grep.d.ts +10 -0
  143. package/dist/core/tools/renderers/grep.d.ts.map +1 -0
  144. package/dist/core/tools/renderers/grep.js +69 -0
  145. package/dist/core/tools/renderers/grep.js.map +1 -0
  146. package/dist/core/tools/renderers/index.d.ts +28 -0
  147. package/dist/core/tools/renderers/index.d.ts.map +1 -0
  148. package/dist/core/tools/renderers/index.js +47 -0
  149. package/dist/core/tools/renderers/index.js.map +1 -0
  150. package/dist/core/tools/renderers/ls.d.ts +10 -0
  151. package/dist/core/tools/renderers/ls.d.ts.map +1 -0
  152. package/dist/core/tools/renderers/ls.js +58 -0
  153. package/dist/core/tools/renderers/ls.js.map +1 -0
  154. package/dist/core/tools/renderers/read.d.ts +19 -0
  155. package/dist/core/tools/renderers/read.d.ts.map +1 -0
  156. package/dist/core/tools/renderers/read.js +149 -0
  157. package/dist/core/tools/renderers/read.js.map +1 -0
  158. package/dist/core/tools/renderers/write.d.ts +10 -0
  159. package/dist/core/tools/renderers/write.d.ts.map +1 -0
  160. package/dist/core/tools/renderers/write.js +162 -0
  161. package/dist/core/tools/renderers/write.js.map +1 -0
  162. package/dist/core/tools/write.d.ts.map +1 -1
  163. package/dist/core/tools/write.js +4 -153
  164. package/dist/core/tools/write.js.map +1 -1
  165. package/dist/index.d.ts +2 -2
  166. package/dist/index.d.ts.map +1 -1
  167. package/dist/index.js.map +1 -1
  168. package/dist/migrations.d.ts.map +1 -1
  169. package/dist/migrations.js +2 -2
  170. package/dist/migrations.js.map +1 -1
  171. package/dist/modes/app-server/threads/turn-runtime.d.ts +3 -1
  172. package/dist/modes/app-server/threads/turn-runtime.d.ts.map +1 -1
  173. package/dist/modes/app-server/threads/turn-runtime.js.map +1 -1
  174. package/dist/modes/app-server/threads/turns.js +1 -1
  175. package/dist/modes/app-server/threads/turns.js.map +1 -1
  176. package/dist/modes/app-server/turn-adapter.js +4 -2
  177. package/dist/modes/app-server/turn-adapter.js.map +1 -1
  178. package/dist/modes/interactive/chat-viewport.d.ts +22 -0
  179. package/dist/modes/interactive/chat-viewport.d.ts.map +1 -0
  180. package/dist/modes/interactive/chat-viewport.js +29 -0
  181. package/dist/modes/interactive/chat-viewport.js.map +1 -0
  182. package/dist/modes/interactive/components/ask-user-answer-key.d.ts +14 -0
  183. package/dist/modes/interactive/components/ask-user-answer-key.d.ts.map +1 -0
  184. package/dist/modes/interactive/components/ask-user-answer-key.js +65 -0
  185. package/dist/modes/interactive/components/ask-user-answer-key.js.map +1 -0
  186. package/dist/modes/interactive/components/ask-user-async-widget.d.ts +17 -12
  187. package/dist/modes/interactive/components/ask-user-async-widget.d.ts.map +1 -1
  188. package/dist/modes/interactive/components/ask-user-async-widget.js +47 -23
  189. package/dist/modes/interactive/components/ask-user-async-widget.js.map +1 -1
  190. package/dist/modes/interactive/components/assistant-message.d.ts +7 -0
  191. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  192. package/dist/modes/interactive/components/assistant-message.js +26 -2
  193. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  194. package/dist/modes/interactive/components/assistant-render-descriptors.d.ts +4 -0
  195. package/dist/modes/interactive/components/assistant-render-descriptors.d.ts.map +1 -1
  196. package/dist/modes/interactive/components/assistant-render-descriptors.js +8 -5
  197. package/dist/modes/interactive/components/assistant-render-descriptors.js.map +1 -1
  198. package/dist/modes/interactive/components/custom-editor.d.ts +10 -1
  199. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
  200. package/dist/modes/interactive/components/custom-editor.js +37 -1
  201. package/dist/modes/interactive/components/custom-editor.js.map +1 -1
  202. package/dist/modes/interactive/components/index.d.ts +1 -1
  203. package/dist/modes/interactive/components/index.d.ts.map +1 -1
  204. package/dist/modes/interactive/components/index.js.map +1 -1
  205. package/dist/modes/interactive/components/scoped-models-selector.js +8 -8
  206. package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
  207. package/dist/modes/interactive/components/status-indicator.d.ts +4 -1
  208. package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
  209. package/dist/modes/interactive/components/status-indicator.js +14 -2
  210. package/dist/modes/interactive/components/status-indicator.js.map +1 -1
  211. package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
  212. package/dist/modes/interactive/components/thinking-selector.js +4 -4
  213. package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
  214. package/dist/modes/interactive/components/tool-execution-renderer.d.ts +4 -1
  215. package/dist/modes/interactive/components/tool-execution-renderer.d.ts.map +1 -1
  216. package/dist/modes/interactive/components/tool-execution-renderer.js +23 -10
  217. package/dist/modes/interactive/components/tool-execution-renderer.js.map +1 -1
  218. package/dist/modes/interactive/components/tool-execution-types.d.ts +18 -2
  219. package/dist/modes/interactive/components/tool-execution-types.d.ts.map +1 -1
  220. package/dist/modes/interactive/components/tool-execution-types.js.map +1 -1
  221. package/dist/modes/interactive/components/tool-execution.d.ts +3 -3
  222. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  223. package/dist/modes/interactive/components/tool-execution.js +5 -0
  224. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  225. package/dist/modes/interactive/interactive-mode.d.ts +10 -15
  226. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  227. package/dist/modes/interactive/interactive-mode.js +178 -138
  228. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  229. package/dist/modes/interactive/theme/dark.json +2 -1
  230. package/dist/modes/interactive/theme/grok-day.json +2 -1
  231. package/dist/modes/interactive/theme/grok-night.json +2 -1
  232. package/dist/modes/interactive/theme/light.json +2 -1
  233. package/dist/modes/interactive/theme/theme-controller.d.ts +1 -0
  234. package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -1
  235. package/dist/modes/interactive/theme/theme-controller.js +5 -0
  236. package/dist/modes/interactive/theme/theme-controller.js.map +1 -1
  237. package/dist/modes/interactive/theme/theme-json.d.ts +84 -0
  238. package/dist/modes/interactive/theme/theme-json.d.ts.map +1 -0
  239. package/dist/modes/interactive/theme/theme-json.js +130 -0
  240. package/dist/modes/interactive/theme/theme-json.js.map +1 -0
  241. package/dist/modes/interactive/theme/theme-schema.json +6 -2
  242. package/dist/modes/interactive/theme/theme.d.ts +10 -5
  243. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  244. package/dist/modes/interactive/theme/theme.js +14 -117
  245. package/dist/modes/interactive/theme/theme.js.map +1 -1
  246. package/dist/modes/interactive/tips/catalog/input-tips.d.ts +5 -0
  247. package/dist/modes/interactive/tips/catalog/input-tips.d.ts.map +1 -1
  248. package/dist/modes/interactive/tips/catalog/input-tips.js +5 -0
  249. package/dist/modes/interactive/tips/catalog/input-tips.js.map +1 -1
  250. package/dist/modes/interactive/tui-renderer.d.ts +21 -0
  251. package/dist/modes/interactive/tui-renderer.d.ts.map +1 -0
  252. package/dist/modes/interactive/tui-renderer.js +67 -0
  253. package/dist/modes/interactive/tui-renderer.js.map +1 -0
  254. package/dist/modes/rpc/connection-handler.d.ts.map +1 -1
  255. package/dist/modes/rpc/connection-handler.js +8 -2
  256. package/dist/modes/rpc/connection-handler.js.map +1 -1
  257. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  258. package/dist/modes/rpc/rpc-client.js +11 -1
  259. package/dist/modes/rpc/rpc-client.js.map +1 -1
  260. package/dist/modes/rpc/rpc-types.d.ts +2 -1
  261. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  262. package/dist/modes/rpc/rpc-types.js +1 -0
  263. package/dist/modes/rpc/rpc-types.js.map +1 -1
  264. package/dist/modes/rpc/session-path-reservations.d.ts +30 -0
  265. package/dist/modes/rpc/session-path-reservations.d.ts.map +1 -0
  266. package/dist/modes/rpc/session-path-reservations.js +58 -0
  267. package/dist/modes/rpc/session-path-reservations.js.map +1 -0
  268. package/dist/modes/rpc/session-registry.d.ts +3 -1
  269. package/dist/modes/rpc/session-registry.d.ts.map +1 -1
  270. package/dist/modes/rpc/session-registry.js.map +1 -1
  271. package/dist/modes/rpc/session-worker-client.d.ts +10 -8
  272. package/dist/modes/rpc/session-worker-client.d.ts.map +1 -1
  273. package/dist/modes/rpc/session-worker-client.js +14 -23
  274. package/dist/modes/rpc/session-worker-client.js.map +1 -1
  275. package/dist/modes/rpc/session-worker-credit.d.ts +17 -0
  276. package/dist/modes/rpc/session-worker-credit.d.ts.map +1 -0
  277. package/dist/modes/rpc/session-worker-credit.js +39 -0
  278. package/dist/modes/rpc/session-worker-credit.js.map +1 -0
  279. package/dist/modes/rpc/session-worker-protocol.d.ts +10 -0
  280. package/dist/modes/rpc/session-worker-protocol.d.ts.map +1 -1
  281. package/dist/modes/rpc/session-worker-protocol.js +2 -0
  282. package/dist/modes/rpc/session-worker-protocol.js.map +1 -1
  283. package/dist/modes/rpc/session-worker-signals.d.ts +7 -0
  284. package/dist/modes/rpc/session-worker-signals.d.ts.map +1 -0
  285. package/dist/modes/rpc/session-worker-signals.js +19 -0
  286. package/dist/modes/rpc/session-worker-signals.js.map +1 -0
  287. package/dist/modes/rpc/session-worker.js +12 -16
  288. package/dist/modes/rpc/session-worker.js.map +1 -1
  289. package/dist/modes/rpc/worker-session-registry.d.ts +12 -0
  290. package/dist/modes/rpc/worker-session-registry.d.ts.map +1 -1
  291. package/dist/modes/rpc/worker-session-registry.js +51 -24
  292. package/dist/modes/rpc/worker-session-registry.js.map +1 -1
  293. package/dist/senpi +3 -0
  294. package/dist/utils/clipboard-command.d.ts +7 -0
  295. package/dist/utils/clipboard-command.d.ts.map +1 -0
  296. package/dist/utils/clipboard-command.js +45 -0
  297. package/dist/utils/clipboard-command.js.map +1 -0
  298. package/dist/utils/clipboard-image.d.ts.map +1 -1
  299. package/dist/utils/clipboard-image.js +52 -69
  300. package/dist/utils/clipboard-image.js.map +1 -1
  301. package/dist/utils/clipboard.d.ts.map +1 -1
  302. package/dist/utils/clipboard.js +49 -126
  303. package/dist/utils/clipboard.js.map +1 -1
  304. package/dist/utils/exif-orientation.d.ts.map +1 -1
  305. package/dist/utils/exif-orientation.js +2 -3
  306. package/dist/utils/exif-orientation.js.map +1 -1
  307. package/dist/utils/tools-manager.d.ts +1 -0
  308. package/dist/utils/tools-manager.d.ts.map +1 -1
  309. package/dist/utils/tools-manager.js +41 -19
  310. package/dist/utils/tools-manager.js.map +1 -1
  311. package/docs/compaction.md +39 -13
  312. package/docs/containerization.md +45 -0
  313. package/docs/development.md +19 -0
  314. package/docs/docs.json +4 -0
  315. package/docs/environment-variables.md +2 -0
  316. package/docs/extensions.md +21 -10
  317. package/docs/keybindings.md +7 -2
  318. package/docs/models.md +1 -1
  319. package/docs/providers.md +1 -1
  320. package/docs/rpc.md +16 -8
  321. package/docs/sdk.md +7 -0
  322. package/docs/session-format.md +52 -38
  323. package/docs/settings.md +40 -4
  324. package/docs/skills.md +1 -1
  325. package/docs/termux.md +0 -1
  326. package/docs/themes.md +8 -6
  327. package/docs/tui.md +22 -3
  328. package/examples/README.md +3 -0
  329. package/examples/extensions/dynamic-resources/dynamic.json +2 -0
  330. package/examples/plugins/pi-example-plugin/README.md +38 -0
  331. package/examples/plugins/pi-example-plugin/package.json +10 -0
  332. package/examples/plugins/pi-example-plugin/src/contract.ts +13 -0
  333. package/examples/plugins/pi-example-plugin/src/session.ts +23 -0
  334. package/examples/plugins/pi-example-plugin/src/tui.ts +31 -0
  335. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-cjs/index.js +1 -1
  336. package/node_modules/@aws-sdk/client-bedrock-runtime/package.json +3 -3
  337. package/node_modules/@aws-sdk/core/dist-cjs/submodules/util/index.js +5 -0
  338. package/node_modules/@aws-sdk/core/dist-es/submodules/util/hasOwn.js +3 -0
  339. package/node_modules/@aws-sdk/core/dist-es/submodules/util/index.js +1 -0
  340. package/node_modules/@aws-sdk/core/dist-types/submodules/util/hasOwn.d.ts +4 -0
  341. package/node_modules/@aws-sdk/core/dist-types/submodules/util/index.d.ts +1 -0
  342. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/hasOwn.d.ts +1 -0
  343. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/index.d.ts +1 -0
  344. package/node_modules/@aws-sdk/core/package.json +1 -1
  345. package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
  346. package/node_modules/@aws-sdk/credential-provider-http/package.json +2 -2
  347. package/node_modules/@aws-sdk/credential-provider-ini/package.json +9 -9
  348. package/node_modules/@aws-sdk/credential-provider-login/package.json +3 -3
  349. package/node_modules/@aws-sdk/credential-provider-node/dist-cjs/index.js +2 -0
  350. package/node_modules/@aws-sdk/credential-provider-node/dist-es/runtime/memoize-chain.js +2 -0
  351. package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
  352. package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
  353. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/LICENSE +201 -0
  354. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/README.md +62 -0
  355. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-cjs/index.js +158 -0
  356. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/constants.js +2 -0
  357. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/fromEnvSigningName.js +16 -0
  358. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/fromSso.js +84 -0
  359. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/fromStatic.js +8 -0
  360. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/getNewSsoOidcToken.js +11 -0
  361. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/getSsoOidcClient.js +10 -0
  362. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/index.js +4 -0
  363. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/nodeProvider.js +5 -0
  364. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/validateTokenExpiry.js +7 -0
  365. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/validateTokenKey.js +7 -0
  366. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/writeSSOTokenToFile.js +8 -0
  367. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/constants.d.ts +8 -0
  368. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/fromEnvSigningName.d.ts +18 -0
  369. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/fromSso.d.ts +12 -0
  370. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/fromStatic.d.ts +9 -0
  371. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/getNewSsoOidcToken.d.ts +8 -0
  372. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/getSsoOidcClient.d.ts +7 -0
  373. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/index.d.ts +7 -0
  374. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/nodeProvider.d.ts +18 -0
  375. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/constants.d.ts +3 -0
  376. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/fromEnvSigningName.d.ts +8 -0
  377. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/fromSso.d.ts +10 -0
  378. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/fromStatic.d.ts +5 -0
  379. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/getNewSsoOidcToken.d.ts +9 -0
  380. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/getSsoOidcClient.d.ts +7 -0
  381. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/index.d.ts +7 -0
  382. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/nodeProvider.d.ts +3 -0
  383. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/validateTokenExpiry.d.ts +2 -0
  384. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/validateTokenKey.d.ts +1 -0
  385. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/writeSSOTokenToFile.d.ts +2 -0
  386. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/validateTokenExpiry.d.ts +5 -0
  387. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/validateTokenKey.d.ts +4 -0
  388. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/writeSSOTokenToFile.d.ts +5 -0
  389. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/package.json +69 -0
  390. package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
  391. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
  392. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
  393. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
  394. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
  395. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
  396. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
  397. package/node_modules/@aws-sdk/nested-clients/package.json +2 -2
  398. package/node_modules/@aws-sdk/token-providers/package.json +1 -1
  399. package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +36 -0
  400. package/node_modules/@code-yeongyu/senpi-codemode/package.json +5 -5
  401. package/node_modules/@earendil-works/chord/README.md +205 -0
  402. package/node_modules/@earendil-works/chord/dist/api.d.ts +15 -0
  403. package/node_modules/@earendil-works/chord/dist/api.d.ts.map +1 -0
  404. package/node_modules/@earendil-works/chord/dist/api.js +72 -0
  405. package/node_modules/@earendil-works/chord/dist/api.js.map +1 -0
  406. package/node_modules/@earendil-works/chord/dist/bundler.d.ts +6 -0
  407. package/node_modules/@earendil-works/chord/dist/bundler.d.ts.map +1 -0
  408. package/node_modules/@earendil-works/chord/dist/bundler.js +3 -0
  409. package/node_modules/@earendil-works/chord/dist/bundler.js.map +1 -0
  410. package/node_modules/@earendil-works/chord/dist/context/index.d.ts +24 -0
  411. package/node_modules/@earendil-works/chord/dist/context/index.d.ts.map +1 -0
  412. package/node_modules/@earendil-works/chord/dist/context/index.js +97 -0
  413. package/node_modules/@earendil-works/chord/dist/context/index.js.map +1 -0
  414. package/node_modules/@earendil-works/chord/dist/delta/index.d.ts +119 -0
  415. package/node_modules/@earendil-works/chord/dist/delta/index.d.ts.map +1 -0
  416. package/node_modules/@earendil-works/chord/dist/delta/index.js +1209 -0
  417. package/node_modules/@earendil-works/chord/dist/delta/index.js.map +1 -0
  418. package/node_modules/@earendil-works/chord/dist/facets/host.d.ts +12 -0
  419. package/node_modules/@earendil-works/chord/dist/facets/host.d.ts.map +1 -0
  420. package/node_modules/@earendil-works/chord/dist/facets/host.js +762 -0
  421. package/node_modules/@earendil-works/chord/dist/facets/host.js.map +1 -0
  422. package/node_modules/@earendil-works/chord/dist/facets/loader.d.ts +3 -0
  423. package/node_modules/@earendil-works/chord/dist/facets/loader.d.ts.map +1 -0
  424. package/node_modules/@earendil-works/chord/dist/facets/loader.js +5 -0
  425. package/node_modules/@earendil-works/chord/dist/facets/loader.js.map +1 -0
  426. package/node_modules/@earendil-works/chord/dist/index.d.ts +11 -0
  427. package/node_modules/@earendil-works/chord/dist/index.d.ts.map +1 -0
  428. package/node_modules/@earendil-works/chord/dist/index.js +10 -0
  429. package/node_modules/@earendil-works/chord/dist/index.js.map +1 -0
  430. package/node_modules/@earendil-works/chord/dist/json.d.ts +4 -0
  431. package/node_modules/@earendil-works/chord/dist/json.d.ts.map +1 -0
  432. package/node_modules/@earendil-works/chord/dist/json.js +57 -0
  433. package/node_modules/@earendil-works/chord/dist/json.js.map +1 -0
  434. package/node_modules/@earendil-works/chord/dist/node/bundle-loader.d.ts +30 -0
  435. package/node_modules/@earendil-works/chord/dist/node/bundle-loader.d.ts.map +1 -0
  436. package/node_modules/@earendil-works/chord/dist/node/bundle-loader.js +377 -0
  437. package/node_modules/@earendil-works/chord/dist/node/bundle-loader.js.map +1 -0
  438. package/node_modules/@earendil-works/chord/dist/node/bundle.d.ts +26 -0
  439. package/node_modules/@earendil-works/chord/dist/node/bundle.d.ts.map +1 -0
  440. package/node_modules/@earendil-works/chord/dist/node/bundle.js +183 -0
  441. package/node_modules/@earendil-works/chord/dist/node/bundle.js.map +1 -0
  442. package/node_modules/@earendil-works/chord/dist/node/manifest.d.ts +36 -0
  443. package/node_modules/@earendil-works/chord/dist/node/manifest.d.ts.map +1 -0
  444. package/node_modules/@earendil-works/chord/dist/node/manifest.js +6 -0
  445. package/node_modules/@earendil-works/chord/dist/node/manifest.js.map +1 -0
  446. package/node_modules/@earendil-works/chord/dist/node/package.d.ts +15 -0
  447. package/node_modules/@earendil-works/chord/dist/node/package.d.ts.map +1 -0
  448. package/node_modules/@earendil-works/chord/dist/node/package.js +199 -0
  449. package/node_modules/@earendil-works/chord/dist/node/package.js.map +1 -0
  450. package/node_modules/@earendil-works/chord/dist/node.d.ts +5 -0
  451. package/node_modules/@earendil-works/chord/dist/node.d.ts.map +1 -0
  452. package/node_modules/@earendil-works/chord/dist/node.js +3 -0
  453. package/node_modules/@earendil-works/chord/dist/node.js.map +1 -0
  454. package/node_modules/@earendil-works/chord/dist/services/consumer.d.ts +11 -0
  455. package/node_modules/@earendil-works/chord/dist/services/consumer.d.ts.map +1 -0
  456. package/node_modules/@earendil-works/chord/dist/services/consumer.js +535 -0
  457. package/node_modules/@earendil-works/chord/dist/services/consumer.js.map +1 -0
  458. package/node_modules/@earendil-works/chord/dist/services/errors.d.ts +8 -0
  459. package/node_modules/@earendil-works/chord/dist/services/errors.d.ts.map +1 -0
  460. package/node_modules/@earendil-works/chord/dist/services/errors.js +21 -0
  461. package/node_modules/@earendil-works/chord/dist/services/errors.js.map +1 -0
  462. package/node_modules/@earendil-works/chord/dist/services/handle.d.ts +15 -0
  463. package/node_modules/@earendil-works/chord/dist/services/handle.d.ts.map +1 -0
  464. package/node_modules/@earendil-works/chord/dist/services/handle.js +99 -0
  465. package/node_modules/@earendil-works/chord/dist/services/handle.js.map +1 -0
  466. package/node_modules/@earendil-works/chord/dist/services/instances.d.ts +25 -0
  467. package/node_modules/@earendil-works/chord/dist/services/instances.d.ts.map +1 -0
  468. package/node_modules/@earendil-works/chord/dist/services/instances.js +137 -0
  469. package/node_modules/@earendil-works/chord/dist/services/instances.js.map +1 -0
  470. package/node_modules/@earendil-works/chord/dist/services/loopback.d.ts +5 -0
  471. package/node_modules/@earendil-works/chord/dist/services/loopback.d.ts.map +1 -0
  472. package/node_modules/@earendil-works/chord/dist/services/loopback.js +15 -0
  473. package/node_modules/@earendil-works/chord/dist/services/loopback.js.map +1 -0
  474. package/node_modules/@earendil-works/chord/dist/services/provider.d.ts +37 -0
  475. package/node_modules/@earendil-works/chord/dist/services/provider.d.ts.map +1 -0
  476. package/node_modules/@earendil-works/chord/dist/services/provider.js +472 -0
  477. package/node_modules/@earendil-works/chord/dist/services/provider.js.map +1 -0
  478. package/node_modules/@earendil-works/chord/dist/services/state-codec.d.ts +15 -0
  479. package/node_modules/@earendil-works/chord/dist/services/state-codec.d.ts.map +1 -0
  480. package/node_modules/@earendil-works/chord/dist/services/state-codec.js +115 -0
  481. package/node_modules/@earendil-works/chord/dist/services/state-codec.js.map +1 -0
  482. package/node_modules/@earendil-works/chord/dist/services/state-internals.d.ts +11 -0
  483. package/node_modules/@earendil-works/chord/dist/services/state-internals.d.ts.map +1 -0
  484. package/node_modules/@earendil-works/chord/dist/services/state-internals.js +10 -0
  485. package/node_modules/@earendil-works/chord/dist/services/state-internals.js.map +1 -0
  486. package/node_modules/@earendil-works/chord/dist/services/state.d.ts +23 -0
  487. package/node_modules/@earendil-works/chord/dist/services/state.d.ts.map +1 -0
  488. package/node_modules/@earendil-works/chord/dist/services/state.js +124 -0
  489. package/node_modules/@earendil-works/chord/dist/services/state.js.map +1 -0
  490. package/node_modules/@earendil-works/chord/dist/services/wire.d.ts +60 -0
  491. package/node_modules/@earendil-works/chord/dist/services/wire.d.ts.map +1 -0
  492. package/node_modules/@earendil-works/chord/dist/services/wire.js +173 -0
  493. package/node_modules/@earendil-works/chord/dist/services/wire.js.map +1 -0
  494. package/node_modules/@earendil-works/chord/dist/types.d.ts +203 -0
  495. package/node_modules/@earendil-works/chord/dist/types.d.ts.map +1 -0
  496. package/node_modules/@earendil-works/chord/dist/types.js +2 -0
  497. package/node_modules/@earendil-works/chord/dist/types.js.map +1 -0
  498. package/node_modules/@earendil-works/chord/package.json +73 -0
  499. package/node_modules/@earendil-works/pi-agent-core/README.md +4 -0
  500. package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.d.ts +639 -384
  501. package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.d.ts.map +1 -1
  502. package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.js +5 -250
  503. package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.js.map +1 -1
  504. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.d.ts +12 -6
  505. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.d.ts.map +1 -1
  506. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.js +33 -27
  507. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.js.map +1 -1
  508. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.d.ts +30 -8
  509. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.d.ts.map +1 -1
  510. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js +53 -64
  511. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js.map +1 -1
  512. package/node_modules/@earendil-works/pi-agent-core/dist/harness/config.d.ts +9 -0
  513. package/node_modules/@earendil-works/pi-agent-core/dist/harness/config.d.ts.map +1 -0
  514. package/node_modules/@earendil-works/pi-agent-core/dist/harness/config.js +35 -0
  515. package/node_modules/@earendil-works/pi-agent-core/dist/harness/config.js.map +1 -0
  516. package/node_modules/@earendil-works/pi-agent-core/dist/harness/context.d.ts +9 -0
  517. package/node_modules/@earendil-works/pi-agent-core/dist/harness/context.d.ts.map +1 -0
  518. package/node_modules/@earendil-works/pi-agent-core/dist/harness/context.js +13 -0
  519. package/node_modules/@earendil-works/pi-agent-core/dist/harness/context.js.map +1 -0
  520. package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.d.ts +25 -28
  521. package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.d.ts.map +1 -1
  522. package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.js +368 -125
  523. package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.js.map +1 -1
  524. package/node_modules/@earendil-works/pi-agent-core/dist/harness/events.d.ts +20 -38
  525. package/node_modules/@earendil-works/pi-agent-core/dist/harness/events.d.ts.map +1 -1
  526. package/node_modules/@earendil-works/pi-agent-core/dist/harness/events.js +233 -55
  527. package/node_modules/@earendil-works/pi-agent-core/dist/harness/events.js.map +1 -1
  528. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/assistant.d.ts +42 -0
  529. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/assistant.d.ts.map +1 -0
  530. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/assistant.js +82 -0
  531. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/assistant.js.map +1 -0
  532. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/effect-gate.d.ts +22 -0
  533. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/effect-gate.d.ts.map +1 -0
  534. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/effect-gate.js +48 -0
  535. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/effect-gate.js.map +1 -0
  536. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/tools.d.ts +67 -0
  537. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/tools.d.ts.map +1 -0
  538. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/tools.js +121 -0
  539. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/tools.js.map +1 -0
  540. package/node_modules/@earendil-works/pi-agent-core/dist/harness/hooks.d.ts +38 -0
  541. package/node_modules/@earendil-works/pi-agent-core/dist/harness/hooks.d.ts.map +1 -0
  542. package/node_modules/@earendil-works/pi-agent-core/dist/harness/hooks.js +404 -0
  543. package/node_modules/@earendil-works/pi-agent-core/dist/harness/hooks.js.map +1 -0
  544. package/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.d.ts +2 -2
  545. package/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.d.ts.map +1 -1
  546. package/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.js.map +1 -1
  547. package/node_modules/@earendil-works/pi-agent-core/dist/harness/prompt-templates.d.ts +3 -2
  548. package/node_modules/@earendil-works/pi-agent-core/dist/harness/prompt-templates.d.ts.map +1 -1
  549. package/node_modules/@earendil-works/pi-agent-core/dist/harness/prompt-templates.js +17 -17
  550. package/node_modules/@earendil-works/pi-agent-core/dist/harness/prompt-templates.js.map +1 -1
  551. package/node_modules/@earendil-works/pi-agent-core/dist/harness/result.d.ts +93 -0
  552. package/node_modules/@earendil-works/pi-agent-core/dist/harness/result.d.ts.map +1 -1
  553. package/node_modules/@earendil-works/pi-agent-core/dist/harness/result.js +39 -0
  554. package/node_modules/@earendil-works/pi-agent-core/dist/harness/result.js.map +1 -1
  555. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/boundary.d.ts +28 -0
  556. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/boundary.d.ts.map +1 -0
  557. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/boundary.js +173 -0
  558. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/boundary.js.map +1 -0
  559. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/checkpoint.d.ts +8 -0
  560. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/checkpoint.d.ts.map +1 -0
  561. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/checkpoint.js +133 -0
  562. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/checkpoint.js.map +1 -0
  563. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/deferred.d.ts +15 -0
  564. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/deferred.d.ts.map +1 -0
  565. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/deferred.js +179 -0
  566. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/deferred.js.map +1 -0
  567. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/generation.d.ts +8 -0
  568. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/generation.d.ts.map +1 -0
  569. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/generation.js +205 -0
  570. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/generation.js.map +1 -0
  571. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/reconcile.d.ts +5 -0
  572. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/reconcile.d.ts.map +1 -0
  573. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/reconcile.js +140 -0
  574. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/reconcile.js.map +1 -0
  575. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/recovery.d.ts +8 -0
  576. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/recovery.d.ts.map +1 -0
  577. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/recovery.js +85 -0
  578. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/recovery.js.map +1 -0
  579. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/response.d.ts +23 -0
  580. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/response.d.ts.map +1 -0
  581. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/response.js +394 -0
  582. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/response.js.map +1 -0
  583. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/retry.d.ts +4 -0
  584. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/retry.d.ts.map +1 -0
  585. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/retry.js +34 -0
  586. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/retry.js.map +1 -0
  587. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/structural.d.ts +32 -0
  588. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/structural.d.ts.map +1 -0
  589. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/structural.js +929 -0
  590. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/structural.js.map +1 -0
  591. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/terminal.d.ts +7 -0
  592. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/terminal.d.ts.map +1 -0
  593. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/terminal.js +49 -0
  594. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/terminal.js.map +1 -0
  595. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/tool-placement.d.ts +14 -0
  596. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/tool-placement.d.ts.map +1 -0
  597. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/tool-placement.js +244 -0
  598. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/tool-placement.js.map +1 -0
  599. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/tools.d.ts +6 -0
  600. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/tools.d.ts.map +1 -0
  601. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/tools.js +449 -0
  602. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/tools.js.map +1 -0
  603. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive.d.ts +6 -0
  604. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive.d.ts.map +1 -0
  605. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive.js +93 -0
  606. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive.js.map +1 -0
  607. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/harness.d.ts +59 -0
  608. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/harness.d.ts.map +1 -0
  609. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/harness.js +302 -0
  610. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/harness.js.map +1 -0
  611. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/index.d.ts +2 -0
  612. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/index.d.ts.map +1 -0
  613. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/index.js +2 -0
  614. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/index.js.map +1 -0
  615. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/lane.d.ts +118 -0
  616. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/lane.d.ts.map +1 -0
  617. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/lane.js +1559 -0
  618. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/lane.js.map +1 -0
  619. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/progress.d.ts +15 -0
  620. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/progress.d.ts.map +1 -0
  621. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/progress.js +66 -0
  622. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/progress.js.map +1 -0
  623. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/reducer.d.ts +5 -0
  624. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/reducer.d.ts.map +1 -0
  625. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/reducer.js +240 -0
  626. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/reducer.js.map +1 -0
  627. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/restore.d.ts +24 -0
  628. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/restore.d.ts.map +1 -0
  629. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/restore.js +117 -0
  630. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/restore.js.map +1 -0
  631. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/transcript.d.ts +21 -0
  632. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/transcript.d.ts.map +1 -0
  633. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/transcript.js +72 -0
  634. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/transcript.js.map +1 -0
  635. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/types.d.ts +105 -0
  636. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/types.d.ts.map +1 -0
  637. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/types.js +50 -0
  638. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/types.js.map +1 -0
  639. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/commit.d.ts +53 -0
  640. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/commit.d.ts.map +1 -0
  641. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/commit.js +57 -0
  642. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/commit.js.map +1 -0
  643. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/context.d.ts +6 -19
  644. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/context.d.ts.map +1 -1
  645. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/context.js +31 -53
  646. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/context.js.map +1 -1
  647. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork-policy.d.ts +21 -0
  648. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork-policy.d.ts.map +1 -0
  649. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork-policy.js +55 -0
  650. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork-policy.js.map +1 -0
  651. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.d.ts +16 -0
  652. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.d.ts.map +1 -0
  653. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.js +79 -0
  654. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.js.map +1 -0
  655. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/in-memory-storage-state.d.ts +39 -0
  656. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/in-memory-storage-state.d.ts.map +1 -0
  657. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/in-memory-storage-state.js +269 -0
  658. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/in-memory-storage-state.js.map +1 -0
  659. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/index.d.ts +9 -5
  660. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/index.d.ts.map +1 -1
  661. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/index.js +7 -4
  662. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/index.js.map +1 -1
  663. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/codec.d.ts +19 -8
  664. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/codec.d.ts.map +1 -1
  665. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/codec.js +34 -219
  666. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/codec.js.map +1 -1
  667. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/fork.d.ts +38 -0
  668. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/fork.d.ts.map +1 -0
  669. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/fork.js +266 -0
  670. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/fork.js.map +1 -0
  671. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/index.d.ts +4 -0
  672. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/index.d.ts.map +1 -0
  673. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/index.js +4 -0
  674. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/index.js.map +1 -0
  675. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/io.d.ts +14 -0
  676. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/io.d.ts.map +1 -0
  677. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/io.js +86 -0
  678. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/io.js.map +1 -0
  679. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/legacy-v3.d.ts +44 -0
  680. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/legacy-v3.d.ts.map +1 -0
  681. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/legacy-v3.js +454 -0
  682. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/legacy-v3.js.map +1 -0
  683. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/repo.d.ts +27 -24
  684. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/repo.d.ts.map +1 -1
  685. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/repo.js +276 -151
  686. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/repo.js.map +1 -1
  687. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/storage.d.ts +39 -41
  688. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/storage.d.ts.map +1 -1
  689. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/storage.js +175 -196
  690. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/storage.js.map +1 -1
  691. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/types.d.ts +23 -22
  692. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/types.d.ts.map +1 -1
  693. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/types.js +2 -1
  694. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/types.js.map +1 -1
  695. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory.d.ts +44 -40
  696. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory.d.ts.map +1 -1
  697. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory.js +333 -115
  698. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory.js.map +1 -1
  699. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/mutation-line.d.ts +8 -0
  700. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/mutation-line.d.ts.map +1 -0
  701. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/mutation-line.js +22 -0
  702. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/mutation-line.js.map +1 -0
  703. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.d.ts +78 -51
  704. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.d.ts.map +1 -1
  705. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.js +327 -207
  706. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.js.map +1 -1
  707. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/datasets.d.ts +12 -0
  708. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/datasets.d.ts.map +1 -0
  709. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/datasets.js +24 -0
  710. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/datasets.js.map +1 -0
  711. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/session-repo.d.ts +42 -0
  712. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/session-repo.d.ts.map +1 -0
  713. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/session-repo.js +127 -0
  714. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/session-repo.js.map +1 -0
  715. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/storage.d.ts +25 -0
  716. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/storage.d.ts.map +1 -0
  717. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/storage.js +114 -0
  718. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/storage.js.map +1 -0
  719. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance/session-repo.d.ts +23 -0
  720. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance/session-repo.d.ts.map +1 -0
  721. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance/session-repo.js +809 -0
  722. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance/session-repo.js.map +1 -0
  723. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance/storage.d.ts +4 -0
  724. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance/storage.d.ts.map +1 -0
  725. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance/storage.js +600 -0
  726. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance/storage.js.map +1 -0
  727. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/gating-storage.d.ts +26 -0
  728. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/gating-storage.d.ts.map +1 -0
  729. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/gating-storage.js +103 -0
  730. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/gating-storage.js.map +1 -0
  731. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/index.d.ts +9 -2
  732. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/index.d.ts.map +1 -1
  733. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/index.js +8 -1
  734. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/index.js.map +1 -1
  735. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/instrumented-storage.d.ts +11 -0
  736. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/instrumented-storage.d.ts.map +1 -0
  737. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/instrumented-storage.js +19 -0
  738. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/instrumented-storage.js.map +1 -0
  739. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/storage-decorator.d.ts +20 -0
  740. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/storage-decorator.d.ts.map +1 -0
  741. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/storage-decorator.js +40 -0
  742. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/storage-decorator.js.map +1 -0
  743. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/types.d.ts +5 -7
  744. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/types.d.ts.map +1 -1
  745. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/types.js.map +1 -1
  746. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/types.d.ts +425 -265
  747. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/types.d.ts.map +1 -1
  748. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/types.js +7 -7
  749. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/types.js.map +1 -1
  750. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/values.d.ts +95 -0
  751. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/values.d.ts.map +1 -0
  752. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/values.js +81 -0
  753. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/values.js.map +1 -0
  754. package/node_modules/@earendil-works/pi-agent-core/dist/harness/skills.d.ts +3 -2
  755. package/node_modules/@earendil-works/pi-agent-core/dist/harness/skills.d.ts.map +1 -1
  756. package/node_modules/@earendil-works/pi-agent-core/dist/harness/skills.js +29 -26
  757. package/node_modules/@earendil-works/pi-agent-core/dist/harness/skills.js.map +1 -1
  758. package/node_modules/@earendil-works/pi-agent-core/dist/harness/telemetry.d.ts +64 -43
  759. package/node_modules/@earendil-works/pi-agent-core/dist/harness/telemetry.d.ts.map +1 -1
  760. package/node_modules/@earendil-works/pi-agent-core/dist/harness/telemetry.js +45 -26
  761. package/node_modules/@earendil-works/pi-agent-core/dist/harness/telemetry.js.map +1 -1
  762. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/bash.d.ts +4 -4
  763. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/bash.d.ts.map +1 -1
  764. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/bash.js +66 -93
  765. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/bash.js.map +1 -1
  766. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/edit.d.ts.map +1 -1
  767. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/edit.js +17 -13
  768. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/edit.js.map +1 -1
  769. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/file-mutation-queue.d.ts +2 -1
  770. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/file-mutation-queue.d.ts.map +1 -1
  771. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/file-mutation-queue.js +5 -5
  772. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/file-mutation-queue.js.map +1 -1
  773. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/path-utils.d.ts +3 -2
  774. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/path-utils.d.ts.map +1 -1
  775. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/path-utils.js +5 -5
  776. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/path-utils.js.map +1 -1
  777. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/read.d.ts +2 -1
  778. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/read.d.ts.map +1 -1
  779. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/read.js +4 -6
  780. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/read.js.map +1 -1
  781. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/write.d.ts.map +1 -1
  782. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/write.js +12 -8
  783. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/write.js.map +1 -1
  784. package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.d.ts +128 -45
  785. package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.d.ts.map +1 -1
  786. package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.js.map +1 -1
  787. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/adaptive-publisher.d.ts +24 -0
  788. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/adaptive-publisher.d.ts.map +1 -0
  789. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/adaptive-publisher.js +79 -0
  790. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/adaptive-publisher.js.map +1 -0
  791. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/output-capture.d.ts +31 -0
  792. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/output-capture.d.ts.map +1 -0
  793. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/output-capture.js +217 -0
  794. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/output-capture.js.map +1 -0
  795. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.d.ts +19 -5
  796. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.d.ts.map +1 -1
  797. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.js +65 -192
  798. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.js.map +1 -1
  799. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/truncate.d.ts +1 -0
  800. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/truncate.d.ts.map +1 -1
  801. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/truncate.js +1 -1
  802. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/truncate.js.map +1 -1
  803. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/usage.d.ts +4 -0
  804. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/usage.d.ts.map +1 -0
  805. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/usage.js +33 -0
  806. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/usage.js.map +1 -0
  807. package/node_modules/@earendil-works/pi-agent-core/dist/index.d.ts +4 -1
  808. package/node_modules/@earendil-works/pi-agent-core/dist/index.d.ts.map +1 -1
  809. package/node_modules/@earendil-works/pi-agent-core/dist/index.js +3 -6
  810. package/node_modules/@earendil-works/pi-agent-core/dist/index.js.map +1 -1
  811. package/node_modules/@earendil-works/pi-agent-core/dist/search/index.d.ts +24 -16
  812. package/node_modules/@earendil-works/pi-agent-core/dist/search/index.d.ts.map +1 -1
  813. package/node_modules/@earendil-works/pi-agent-core/dist/search/index.js +1 -1
  814. package/node_modules/@earendil-works/pi-agent-core/dist/search/index.js.map +1 -1
  815. package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts +2 -0
  816. package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts.map +1 -1
  817. package/node_modules/@earendil-works/pi-agent-core/dist/types.js.map +1 -1
  818. package/node_modules/@earendil-works/pi-agent-core/package.json +27 -6
  819. package/node_modules/@earendil-works/pi-ai/README.md +39 -4
  820. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.d.ts.map +1 -1
  821. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +8 -1
  822. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js.map +1 -1
  823. package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-ai-binding.d.ts +77 -0
  824. package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-ai-binding.d.ts.map +1 -0
  825. package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-ai-binding.js +72 -0
  826. package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-ai-binding.js.map +1 -0
  827. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/measure.d.ts +11 -0
  828. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/measure.d.ts.map +1 -1
  829. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/measure.js +18 -0
  830. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/measure.js.map +1 -1
  831. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.d.ts +1 -1
  832. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.d.ts.map +1 -1
  833. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.js +5 -1
  834. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.js.map +1 -1
  835. package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/discovery.d.ts +2 -0
  836. package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/discovery.d.ts.map +1 -1
  837. package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/discovery.js +96 -51
  838. package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/discovery.js.map +1 -1
  839. package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/gen/cascade_pb.d.ts +389 -1
  840. package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/gen/cascade_pb.d.ts.map +1 -1
  841. package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/gen/cascade_pb.js +132 -4
  842. package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/gen/cascade_pb.js.map +1 -1
  843. package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/metadata.d.ts +34 -4
  844. package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/metadata.d.ts.map +1 -1
  845. package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/metadata.js +41 -8
  846. package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/metadata.js.map +1 -1
  847. package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/paths.d.ts +20 -0
  848. package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/paths.d.ts.map +1 -1
  849. package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/paths.js +20 -0
  850. package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/paths.js.map +1 -1
  851. package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/request.d.ts +18 -6
  852. package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/request.d.ts.map +1 -1
  853. package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/request.js +77 -35
  854. package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/request.js.map +1 -1
  855. package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/stream-state.d.ts +9 -3
  856. package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/stream-state.d.ts.map +1 -1
  857. package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/stream-state.js +30 -38
  858. package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/stream-state.js.map +1 -1
  859. package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/trailer.d.ts +16 -0
  860. package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/trailer.d.ts.map +1 -0
  861. package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/trailer.js +69 -0
  862. package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/trailer.js.map +1 -0
  863. package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/unary.d.ts +26 -0
  864. package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/unary.d.ts.map +1 -0
  865. package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/unary.js +61 -0
  866. package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/unary.js.map +1 -0
  867. package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/wire.d.ts +6 -4
  868. package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/wire.d.ts.map +1 -1
  869. package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/wire.js +6 -4
  870. package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/wire.js.map +1 -1
  871. package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent.d.ts +13 -5
  872. package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent.d.ts.map +1 -1
  873. package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent.js +76 -21
  874. package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent.js.map +1 -1
  875. package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js +4 -1
  876. package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js.map +1 -1
  877. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.d.ts.map +1 -1
  878. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js +6 -3
  879. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js.map +1 -1
  880. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.d.ts.map +1 -1
  881. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js +4 -1
  882. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js.map +1 -1
  883. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.d.ts.map +1 -1
  884. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js +13 -3
  885. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js.map +1 -1
  886. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/devin.d.ts +5 -0
  887. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/devin.d.ts.map +1 -1
  888. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/devin.js +7 -2
  889. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/devin.js.map +1 -1
  890. package/node_modules/@earendil-works/pi-ai/dist/cursor/context-limit-store.d.ts +32 -0
  891. package/node_modules/@earendil-works/pi-ai/dist/cursor/context-limit-store.d.ts.map +1 -0
  892. package/node_modules/@earendil-works/pi-ai/dist/cursor/context-limit-store.js +62 -0
  893. package/node_modules/@earendil-works/pi-ai/dist/cursor/context-limit-store.js.map +1 -0
  894. package/node_modules/@earendil-works/pi-ai/dist/cursor/store-migration.d.ts.map +1 -1
  895. package/node_modules/@earendil-works/pi-ai/dist/cursor/store-migration.js +2 -1
  896. package/node_modules/@earendil-works/pi-ai/dist/cursor/store-migration.js.map +1 -1
  897. package/node_modules/@earendil-works/pi-ai/dist/index.d.ts +2 -1
  898. package/node_modules/@earendil-works/pi-ai/dist/index.d.ts.map +1 -1
  899. package/node_modules/@earendil-works/pi-ai/dist/index.js +2 -1
  900. package/node_modules/@earendil-works/pi-ai/dist/index.js.map +1 -1
  901. package/node_modules/@earendil-works/pi-ai/dist/model.d.ts +11 -1
  902. package/node_modules/@earendil-works/pi-ai/dist/model.d.ts.map +1 -1
  903. package/node_modules/@earendil-works/pi-ai/dist/model.js.map +1 -1
  904. package/node_modules/@earendil-works/pi-ai/dist/models.d.ts +1 -0
  905. package/node_modules/@earendil-works/pi-ai/dist/models.d.ts.map +1 -1
  906. package/node_modules/@earendil-works/pi-ai/dist/models.js +5 -2
  907. package/node_modules/@earendil-works/pi-ai/dist/models.js.map +1 -1
  908. package/node_modules/@earendil-works/pi-ai/dist/openai-responses-compat.d.ts +1 -1
  909. package/node_modules/@earendil-works/pi-ai/dist/openai-responses-compat.d.ts.map +1 -1
  910. package/node_modules/@earendil-works/pi-ai/dist/openai-responses-compat.js.map +1 -1
  911. package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.d.ts.map +1 -1
  912. package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.js +4 -0
  913. package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.js.map +1 -1
  914. package/node_modules/@earendil-works/pi-ai/dist/providers/cursor.d.ts.map +1 -1
  915. package/node_modules/@earendil-works/pi-ai/dist/providers/cursor.js +2 -1
  916. package/node_modules/@earendil-works/pi-ai/dist/providers/cursor.js.map +1 -1
  917. package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
  918. package/node_modules/@earendil-works/pi-ai/dist/providers/data/amazon-bedrock.json +1 -1
  919. package/node_modules/@earendil-works/pi-ai/dist/providers/data/azure-openai-responses.json +1 -1
  920. package/node_modules/@earendil-works/pi-ai/dist/providers/data/baseten.json +1 -1
  921. package/node_modules/@earendil-works/pi-ai/dist/providers/data/deepseek.json +1 -1
  922. package/node_modules/@earendil-works/pi-ai/dist/providers/data/fireworks.json +1 -1
  923. package/node_modules/@earendil-works/pi-ai/dist/providers/data/github-copilot.json +1 -1
  924. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai-codex.json +1 -1
  925. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
  926. package/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan-cn.json +1 -1
  927. package/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan-individual.json +1 -1
  928. package/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan.json +1 -1
  929. package/node_modules/@earendil-works/pi-ai/dist/providers/data/venice.json +1 -1
  930. package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
  931. package/node_modules/@earendil-works/pi-ai/dist/providers/data/xai.json +1 -1
  932. package/node_modules/@earendil-works/pi-ai/dist/providers/devin.d.ts.map +1 -1
  933. package/node_modules/@earendil-works/pi-ai/dist/providers/devin.js +3 -3
  934. package/node_modules/@earendil-works/pi-ai/dist/providers/devin.js.map +1 -1
  935. package/node_modules/@earendil-works/pi-ai/dist/providers/devin.models.d.ts +4 -2
  936. package/node_modules/@earendil-works/pi-ai/dist/providers/devin.models.d.ts.map +1 -1
  937. package/node_modules/@earendil-works/pi-ai/dist/providers/devin.models.js +18 -9
  938. package/node_modules/@earendil-works/pi-ai/dist/providers/devin.models.js.map +1 -1
  939. package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js +5 -5
  940. package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js.map +1 -1
  941. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.d.ts.map +1 -1
  942. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.js +4 -3
  943. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.js.map +1 -1
  944. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-headers.d.ts +4 -0
  945. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-headers.d.ts.map +1 -0
  946. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-headers.js +22 -0
  947. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-headers.js.map +1 -0
  948. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode.d.ts.map +1 -1
  949. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode.js +5 -4
  950. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode.js.map +1 -1
  951. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +16 -6
  952. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
  953. package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -1
  954. package/node_modules/@earendil-works/pi-ai/dist/utils/assistant-message-frame.d.ts +77 -0
  955. package/node_modules/@earendil-works/pi-ai/dist/utils/assistant-message-frame.d.ts.map +1 -0
  956. package/node_modules/@earendil-works/pi-ai/dist/utils/assistant-message-frame.js +427 -0
  957. package/node_modules/@earendil-works/pi-ai/dist/utils/assistant-message-frame.js.map +1 -0
  958. package/node_modules/@earendil-works/pi-ai/dist/utils/cursor-context-limit.d.ts +12 -0
  959. package/node_modules/@earendil-works/pi-ai/dist/utils/cursor-context-limit.d.ts.map +1 -0
  960. package/node_modules/@earendil-works/pi-ai/dist/utils/cursor-context-limit.js +93 -0
  961. package/node_modules/@earendil-works/pi-ai/dist/utils/cursor-context-limit.js.map +1 -0
  962. package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.d.ts.map +1 -1
  963. package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js +25 -5
  964. package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js.map +1 -1
  965. package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.d.ts +1 -1
  966. package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.d.ts.map +1 -1
  967. package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.js +5 -1
  968. package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.js.map +1 -1
  969. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/types.d.ts +10 -1
  970. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/types.d.ts.map +1 -1
  971. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/types.js.map +1 -1
  972. package/node_modules/@earendil-works/pi-ai/dist/utils/retry.d.ts +13 -2
  973. package/node_modules/@earendil-works/pi-ai/dist/utils/retry.d.ts.map +1 -1
  974. package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +18 -7
  975. package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js.map +1 -1
  976. package/node_modules/@earendil-works/pi-ai/dist/utils/uuid.d.ts +2 -2
  977. package/node_modules/@earendil-works/pi-ai/dist/utils/uuid.d.ts.map +1 -1
  978. package/node_modules/@earendil-works/pi-ai/dist/utils/uuid.js +36 -31
  979. package/node_modules/@earendil-works/pi-ai/dist/utils/uuid.js.map +1 -1
  980. package/node_modules/@earendil-works/pi-ai/package.json +6 -6
  981. package/node_modules/@earendil-works/pi-pty/package.json +1 -1
  982. package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
  983. package/node_modules/@earendil-works/pi-tui/README.md +53 -4
  984. package/node_modules/@earendil-works/pi-tui/dist/alt-screen-search.d.ts +21 -1
  985. package/node_modules/@earendil-works/pi-tui/dist/alt-screen-search.d.ts.map +1 -1
  986. package/node_modules/@earendil-works/pi-tui/dist/alt-screen-search.js +199 -42
  987. package/node_modules/@earendil-works/pi-tui/dist/alt-screen-search.js.map +1 -1
  988. package/node_modules/@earendil-works/pi-tui/dist/components/box.d.ts +3 -1
  989. package/node_modules/@earendil-works/pi-tui/dist/components/box.d.ts.map +1 -1
  990. package/node_modules/@earendil-works/pi-tui/dist/components/box.js +28 -0
  991. package/node_modules/@earendil-works/pi-tui/dist/components/box.js.map +1 -1
  992. package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts +6 -1
  993. package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts.map +1 -1
  994. package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +98 -18
  995. package/node_modules/@earendil-works/pi-tui/dist/components/editor.js.map +1 -1
  996. package/node_modules/@earendil-works/pi-tui/dist/components/input.d.ts +12 -1
  997. package/node_modules/@earendil-works/pi-tui/dist/components/input.d.ts.map +1 -1
  998. package/node_modules/@earendil-works/pi-tui/dist/components/input.js +40 -6
  999. package/node_modules/@earendil-works/pi-tui/dist/components/input.js.map +1 -1
  1000. package/node_modules/@earendil-works/pi-tui/dist/components/latex.d.ts.map +1 -1
  1001. package/node_modules/@earendil-works/pi-tui/dist/components/latex.js +7 -0
  1002. package/node_modules/@earendil-works/pi-tui/dist/components/latex.js.map +1 -1
  1003. package/node_modules/@earendil-works/pi-tui/dist/components/loader.d.ts +3 -0
  1004. package/node_modules/@earendil-works/pi-tui/dist/components/loader.d.ts.map +1 -1
  1005. package/node_modules/@earendil-works/pi-tui/dist/components/loader.js +20 -8
  1006. package/node_modules/@earendil-works/pi-tui/dist/components/loader.js.map +1 -1
  1007. package/node_modules/@earendil-works/pi-tui/dist/components/mouse-region.d.ts +12 -0
  1008. package/node_modules/@earendil-works/pi-tui/dist/components/mouse-region.d.ts.map +1 -0
  1009. package/node_modules/@earendil-works/pi-tui/dist/components/mouse-region.js +19 -0
  1010. package/node_modules/@earendil-works/pi-tui/dist/components/mouse-region.js.map +1 -0
  1011. package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.d.ts +6 -3
  1012. package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.d.ts.map +1 -1
  1013. package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.js +6 -1
  1014. package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.js.map +1 -1
  1015. package/node_modules/@earendil-works/pi-tui/dist/components/select-list.d.ts +4 -1
  1016. package/node_modules/@earendil-works/pi-tui/dist/components/select-list.d.ts.map +1 -1
  1017. package/node_modules/@earendil-works/pi-tui/dist/components/select-list.js +48 -2
  1018. package/node_modules/@earendil-works/pi-tui/dist/components/select-list.js.map +1 -1
  1019. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts +5 -1
  1020. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts.map +1 -1
  1021. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js +54 -5
  1022. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js.map +1 -1
  1023. package/node_modules/@earendil-works/pi-tui/dist/index.d.ts +3 -1
  1024. package/node_modules/@earendil-works/pi-tui/dist/index.d.ts.map +1 -1
  1025. package/node_modules/@earendil-works/pi-tui/dist/index.js +3 -0
  1026. package/node_modules/@earendil-works/pi-tui/dist/index.js.map +1 -1
  1027. package/node_modules/@earendil-works/pi-tui/dist/layout.d.ts +3 -1
  1028. package/node_modules/@earendil-works/pi-tui/dist/layout.d.ts.map +1 -1
  1029. package/node_modules/@earendil-works/pi-tui/dist/layout.js +32 -9
  1030. package/node_modules/@earendil-works/pi-tui/dist/layout.js.map +1 -1
  1031. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.d.ts +2 -1
  1032. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.d.ts.map +1 -1
  1033. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js +3 -44
  1034. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js.map +1 -1
  1035. package/node_modules/@earendil-works/pi-tui/dist/native-platform.d.ts +18 -0
  1036. package/node_modules/@earendil-works/pi-tui/dist/native-platform.d.ts.map +1 -0
  1037. package/node_modules/@earendil-works/pi-tui/dist/native-platform.js +42 -0
  1038. package/node_modules/@earendil-works/pi-tui/dist/native-platform.js.map +1 -0
  1039. package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts.map +1 -1
  1040. package/node_modules/@earendil-works/pi-tui/dist/terminal.js +2 -20
  1041. package/node_modules/@earendil-works/pi-tui/dist/terminal.js.map +1 -1
  1042. package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.d.ts +31 -1
  1043. package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.d.ts.map +1 -1
  1044. package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.js +335 -41
  1045. package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.js.map +1 -1
  1046. package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts +83 -5
  1047. package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts.map +1 -1
  1048. package/node_modules/@earendil-works/pi-tui/dist/tui.js +118 -4
  1049. package/node_modules/@earendil-works/pi-tui/dist/tui.js.map +1 -1
  1050. package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts +2 -0
  1051. package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts.map +1 -1
  1052. package/node_modules/@earendil-works/pi-tui/dist/utils.js +9 -0
  1053. package/node_modules/@earendil-works/pi-tui/dist/utils.js.map +1 -1
  1054. package/node_modules/@earendil-works/pi-tui/native/clipboard.h +170 -0
  1055. package/node_modules/@earendil-works/pi-tui/native/darwin/README.md +8 -6
  1056. package/node_modules/@earendil-works/pi-tui/native/darwin/build.sh +12 -5
  1057. package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-arm64/{darwin-modifiers.node → darwin-platform.node} +0 -0
  1058. package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-x64/{darwin-modifiers.node → darwin-platform.node} +0 -0
  1059. package/node_modules/@earendil-works/pi-tui/native/darwin/src/darwin-platform.m +93 -0
  1060. package/node_modules/@earendil-works/pi-tui/native/linux/README.md +23 -0
  1061. package/node_modules/@earendil-works/pi-tui/native/linux/build.sh +65 -0
  1062. package/node_modules/@earendil-works/pi-tui/native/linux/prebuilds/linux-arm64/linux-platform-x11.node +0 -0
  1063. package/node_modules/@earendil-works/pi-tui/native/linux/prebuilds/linux-x64/linux-platform-x11.node +0 -0
  1064. package/node_modules/@earendil-works/pi-tui/native/linux/src/clipboard-worker.h +70 -0
  1065. package/node_modules/@earendil-works/pi-tui/native/linux/src/linux-platform-x11.c +274 -0
  1066. package/node_modules/@earendil-works/pi-tui/native/napi.h +89 -0
  1067. package/node_modules/@earendil-works/pi-tui/native/win32/README.md +18 -7
  1068. package/node_modules/@earendil-works/pi-tui/native/win32/build.mjs +7 -4
  1069. package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-arm64/win32-platform.node +0 -0
  1070. package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-x64/win32-platform.node +0 -0
  1071. package/node_modules/@earendil-works/pi-tui/native/win32/src/win32-platform.c +241 -0
  1072. package/node_modules/@earendil-works/pi-tui/package.json +10 -3
  1073. package/node_modules/@google/genai/dist/genai.d.ts +1799 -289
  1074. package/node_modules/@google/genai/dist/index.cjs +319 -299
  1075. package/node_modules/@google/genai/dist/index.mjs +319 -299
  1076. package/node_modules/@google/genai/dist/index.mjs.map +1 -1
  1077. package/node_modules/@google/genai/dist/node/index.cjs +320 -300
  1078. package/node_modules/@google/genai/dist/node/index.mjs +320 -300
  1079. package/node_modules/@google/genai/dist/node/index.mjs.map +1 -1
  1080. package/node_modules/@google/genai/dist/node/node.d.ts +1799 -289
  1081. package/node_modules/@google/genai/dist/tokenizer/node.cjs +49 -2
  1082. package/node_modules/@google/genai/dist/tokenizer/node.d.ts +43 -3
  1083. package/node_modules/@google/genai/dist/tokenizer/node.mjs +49 -2
  1084. package/node_modules/@google/genai/dist/tokenizer/node.mjs.map +1 -1
  1085. package/node_modules/@google/genai/dist/vertex_internal/index.cjs +39 -3
  1086. package/node_modules/@google/genai/dist/vertex_internal/index.cjs.map +1 -1
  1087. package/node_modules/@google/genai/dist/vertex_internal/index.d.ts +51 -9
  1088. package/node_modules/@google/genai/dist/vertex_internal/index.js +39 -3
  1089. package/node_modules/@google/genai/dist/vertex_internal/index.js.map +1 -1
  1090. package/node_modules/@google/genai/dist/web/index.mjs +319 -299
  1091. package/node_modules/@google/genai/dist/web/index.mjs.map +1 -1
  1092. package/node_modules/@google/genai/dist/web/web.d.ts +1799 -289
  1093. package/node_modules/@google/genai/package.json +1 -1
  1094. package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +11 -4
  1095. package/node_modules/@smithy/node-http-handler/dist-es/http2/ClientHttp2SessionRef.js +1 -0
  1096. package/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js +2 -3
  1097. package/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +8 -1
  1098. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/LICENSE +201 -0
  1099. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/README.md +115 -0
  1100. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-cjs/index.js +96 -0
  1101. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/abort-handler.js +1 -0
  1102. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/abort.js +1 -0
  1103. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/auth/HttpApiKeyAuth.js +5 -0
  1104. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/auth/HttpAuthScheme.js +1 -0
  1105. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/auth/HttpAuthSchemeProvider.js +1 -0
  1106. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/auth/HttpSigner.js +1 -0
  1107. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/auth/IdentityProviderConfig.js +1 -0
  1108. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/auth/auth.js +5 -0
  1109. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/auth/index.js +2 -0
  1110. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/blob/blob-payload-input-types.js +1 -0
  1111. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/checksum.js +1 -0
  1112. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/client.js +1 -0
  1113. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/command.js +1 -0
  1114. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/connection/config.js +1 -0
  1115. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/connection/index.js +1 -0
  1116. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/connection/manager.js +1 -0
  1117. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/connection/pool.js +1 -0
  1118. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/crypto.js +1 -0
  1119. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/downlevel-ts3.4/transform/type-transform.js +1 -0
  1120. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/encode.js +1 -0
  1121. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/endpoint.js +5 -0
  1122. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/endpoints/EndpointParameterInstructions.js +1 -0
  1123. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/endpoints/EndpointRuleObject.js +1 -0
  1124. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/endpoints/ErrorRuleObject.js +1 -0
  1125. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/endpoints/RuleSetObject.js +1 -0
  1126. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/endpoints/TreeRuleObject.js +1 -0
  1127. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/endpoints/index.js +1 -0
  1128. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/endpoints/shared.js +1 -0
  1129. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/eventStream.js +1 -0
  1130. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/extensions/checksum.js +38 -0
  1131. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/extensions/defaultClientConfiguration.js +7 -0
  1132. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/extensions/defaultExtensionConfiguration.js +1 -0
  1133. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/extensions/index.js +2 -0
  1134. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/extensions/retry.js +1 -0
  1135. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/externals-check/browser-externals-check.js +1 -0
  1136. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/feature-ids.js +1 -0
  1137. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/http/httpHandlerInitialization.js +1 -0
  1138. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/http.js +5 -0
  1139. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/identity/apiKeyIdentity.js +1 -0
  1140. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/identity/awsCredentialIdentity.js +1 -0
  1141. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/identity/identity.js +1 -0
  1142. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/identity/index.js +1 -0
  1143. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/identity/tokenIdentity.js +1 -0
  1144. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/index.js +7 -0
  1145. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/logger.js +1 -0
  1146. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/metrics.js +1 -0
  1147. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/middleware.js +1 -0
  1148. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/pagination.js +1 -0
  1149. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/profile.js +6 -0
  1150. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/response.js +1 -0
  1151. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/retry.js +1 -0
  1152. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/schema/schema-deprecated.js +1 -0
  1153. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/schema/schema.js +1 -0
  1154. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/schema/sentinels.js +1 -0
  1155. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/schema/static-schemas.js +1 -0
  1156. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/schema/traits.js +1 -0
  1157. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/serde.js +1 -0
  1158. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/shapes.js +1 -0
  1159. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/signature.js +1 -0
  1160. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/stream.js +1 -0
  1161. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-common-types.js +1 -0
  1162. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-payload-input-types.js +1 -0
  1163. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-payload-output-types.js +1 -0
  1164. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/transfer.js +6 -0
  1165. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/transform/client-method-transforms.js +1 -0
  1166. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/transform/client-payload-blob-type-narrow.js +1 -0
  1167. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/transform/exact.js +1 -0
  1168. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/transform/mutable.js +1 -0
  1169. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/transform/no-undefined.js +1 -0
  1170. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/transform/type-transform.js +1 -0
  1171. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/uri.js +1 -0
  1172. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/util.js +1 -0
  1173. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/waiter.js +1 -0
  1174. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/abort-handler.d.ts +7 -0
  1175. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/abort.d.ts +48 -0
  1176. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/auth/HttpApiKeyAuth.d.ts +7 -0
  1177. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/auth/HttpAuthScheme.d.ts +49 -0
  1178. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/auth/HttpAuthSchemeProvider.d.ts +20 -0
  1179. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/auth/HttpSigner.d.ts +41 -0
  1180. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/auth/IdentityProviderConfig.d.ts +14 -0
  1181. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/auth/auth.d.ts +59 -0
  1182. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/auth/index.d.ts +7 -0
  1183. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/blob/blob-payload-input-types.d.ts +37 -0
  1184. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/checksum.d.ts +61 -0
  1185. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/client.d.ts +57 -0
  1186. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/command.d.ts +28 -0
  1187. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/connection/config.d.ts +15 -0
  1188. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/connection/index.d.ts +3 -0
  1189. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/connection/manager.d.ts +34 -0
  1190. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/connection/pool.d.ts +32 -0
  1191. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/crypto.d.ts +58 -0
  1192. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/downlevel-ts3.4/transform/type-transform.d.ts +24 -0
  1193. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/encode.d.ts +31 -0
  1194. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/endpoint.d.ts +77 -0
  1195. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/endpoints/EndpointParameterInstructions.d.ts +41 -0
  1196. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/endpoints/EndpointRuleObject.d.ts +27 -0
  1197. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/endpoints/ErrorRuleObject.d.ts +10 -0
  1198. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/endpoints/RuleSetObject.d.ts +28 -0
  1199. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/endpoints/TreeRuleObject.d.ts +16 -0
  1200. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/endpoints/index.d.ts +5 -0
  1201. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/endpoints/shared.d.ts +55 -0
  1202. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/eventStream.d.ts +137 -0
  1203. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/extensions/checksum.d.ts +58 -0
  1204. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/extensions/defaultClientConfiguration.d.ts +32 -0
  1205. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/extensions/defaultExtensionConfiguration.d.ts +9 -0
  1206. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/extensions/index.d.ts +6 -0
  1207. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/extensions/retry.d.ts +18 -0
  1208. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/externals-check/browser-externals-check.d.ts +35 -0
  1209. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/feature-ids.d.ts +16 -0
  1210. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/http/httpHandlerInitialization.d.ts +142 -0
  1211. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/http.d.ts +110 -0
  1212. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/identity/apiKeyIdentity.d.ts +14 -0
  1213. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/identity/awsCredentialIdentity.d.ts +31 -0
  1214. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/identity/identity.d.ts +15 -0
  1215. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/identity/index.d.ts +4 -0
  1216. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/identity/tokenIdentity.d.ts +14 -0
  1217. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/index.d.ts +52 -0
  1218. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/logger.d.ts +13 -0
  1219. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/metrics.d.ts +93 -0
  1220. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/middleware.d.ts +541 -0
  1221. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/pagination.d.ts +33 -0
  1222. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/profile.d.ts +30 -0
  1223. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/response.d.ts +40 -0
  1224. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/retry.d.ts +162 -0
  1225. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/schema/schema-deprecated.d.ts +143 -0
  1226. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/schema/schema.d.ts +236 -0
  1227. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/schema/sentinels.d.ts +65 -0
  1228. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/schema/static-schemas.d.ts +99 -0
  1229. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/schema/traits.d.ts +46 -0
  1230. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/serde.d.ts +114 -0
  1231. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/shapes.d.ts +79 -0
  1232. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/signature.d.ts +172 -0
  1233. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/stream.d.ts +22 -0
  1234. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/streaming-payload/streaming-blob-common-types.d.ts +28 -0
  1235. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/streaming-payload/streaming-blob-payload-input-types.d.ts +54 -0
  1236. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/streaming-payload/streaming-blob-payload-output-types.d.ts +41 -0
  1237. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/transfer.d.ts +42 -0
  1238. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/transform/client-method-transforms.d.ts +26 -0
  1239. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/transform/client-payload-blob-type-narrow.d.ts +73 -0
  1240. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/transform/exact.d.ts +6 -0
  1241. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/transform/mutable.d.ts +6 -0
  1242. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/transform/no-undefined.d.ts +68 -0
  1243. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/transform/type-transform.d.ts +39 -0
  1244. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/abort-handler.d.ts +7 -0
  1245. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/abort.d.ts +45 -0
  1246. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/auth/HttpApiKeyAuth.d.ts +7 -0
  1247. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/auth/HttpAuthScheme.d.ts +49 -0
  1248. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/auth/HttpAuthSchemeProvider.d.ts +20 -0
  1249. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/auth/HttpSigner.d.ts +41 -0
  1250. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/auth/IdentityProviderConfig.d.ts +14 -0
  1251. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/auth/auth.d.ts +59 -0
  1252. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/auth/index.d.ts +7 -0
  1253. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/blob/blob-payload-input-types.d.ts +37 -0
  1254. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/checksum.d.ts +61 -0
  1255. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/client.d.ts +57 -0
  1256. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/command.d.ts +28 -0
  1257. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/connection/config.d.ts +15 -0
  1258. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/connection/index.d.ts +3 -0
  1259. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/connection/manager.d.ts +34 -0
  1260. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/connection/pool.d.ts +32 -0
  1261. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/crypto.d.ts +58 -0
  1262. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/downlevel-ts3.4/transform/type-transform.d.ts +40 -0
  1263. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/encode.d.ts +31 -0
  1264. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/endpoint.d.ts +77 -0
  1265. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/endpoints/EndpointParameterInstructions.d.ts +41 -0
  1266. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/endpoints/EndpointRuleObject.d.ts +27 -0
  1267. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/endpoints/ErrorRuleObject.d.ts +10 -0
  1268. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/endpoints/RuleSetObject.d.ts +28 -0
  1269. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/endpoints/TreeRuleObject.d.ts +16 -0
  1270. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/endpoints/index.d.ts +5 -0
  1271. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/endpoints/shared.d.ts +55 -0
  1272. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/eventStream.d.ts +137 -0
  1273. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/extensions/checksum.d.ts +58 -0
  1274. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/extensions/defaultClientConfiguration.d.ts +32 -0
  1275. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/extensions/defaultExtensionConfiguration.d.ts +9 -0
  1276. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/extensions/index.d.ts +6 -0
  1277. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/extensions/retry.d.ts +18 -0
  1278. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/externals-check/browser-externals-check.d.ts +35 -0
  1279. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/feature-ids.d.ts +16 -0
  1280. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/http/httpHandlerInitialization.d.ts +142 -0
  1281. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/http.d.ts +110 -0
  1282. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/identity/apiKeyIdentity.d.ts +14 -0
  1283. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/identity/awsCredentialIdentity.d.ts +31 -0
  1284. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/identity/identity.d.ts +15 -0
  1285. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/identity/index.d.ts +4 -0
  1286. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/identity/tokenIdentity.d.ts +14 -0
  1287. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/index.d.ts +52 -0
  1288. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/logger.d.ts +13 -0
  1289. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/metrics.d.ts +93 -0
  1290. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/middleware.d.ts +541 -0
  1291. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/pagination.d.ts +33 -0
  1292. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/profile.d.ts +30 -0
  1293. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/response.d.ts +40 -0
  1294. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/retry.d.ts +162 -0
  1295. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/schema/schema-deprecated.d.ts +149 -0
  1296. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/schema/schema.d.ts +251 -0
  1297. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/schema/sentinels.d.ts +65 -0
  1298. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/schema/static-schemas.d.ts +118 -0
  1299. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/schema/traits.d.ts +46 -0
  1300. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/serde.d.ts +114 -0
  1301. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/shapes.d.ts +79 -0
  1302. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/signature.d.ts +172 -0
  1303. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/stream.d.ts +22 -0
  1304. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/streaming-payload/streaming-blob-common-types.d.ts +28 -0
  1305. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/streaming-payload/streaming-blob-payload-input-types.d.ts +54 -0
  1306. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/streaming-payload/streaming-blob-payload-output-types.d.ts +41 -0
  1307. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/transfer.d.ts +42 -0
  1308. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/transform/client-method-transforms.d.ts +26 -0
  1309. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/transform/client-payload-blob-type-narrow.d.ts +77 -0
  1310. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/transform/exact.d.ts +14 -0
  1311. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/transform/mutable.d.ts +6 -0
  1312. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/transform/no-undefined.d.ts +88 -0
  1313. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/transform/type-transform.d.ts +40 -0
  1314. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/uri.d.ts +17 -0
  1315. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/util.d.ts +192 -0
  1316. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/waiter.d.ts +35 -0
  1317. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/uri.d.ts +17 -0
  1318. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/util.d.ts +176 -0
  1319. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/waiter.d.ts +35 -0
  1320. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/package.json +50 -0
  1321. package/node_modules/@smithy/node-http-handler/package.json +2 -2
  1322. package/node_modules/esbuild/LICENSE.md +21 -0
  1323. package/node_modules/esbuild/README.md +3 -0
  1324. package/node_modules/esbuild/bin/esbuild +223 -0
  1325. package/node_modules/esbuild/install.js +300 -0
  1326. package/node_modules/esbuild/lib/main.d.ts +720 -0
  1327. package/node_modules/esbuild/lib/main.js +2536 -0
  1328. package/node_modules/esbuild/package.json +47 -0
  1329. package/node_modules/ignore/README.md +52 -0
  1330. package/node_modules/ignore/index.js +785 -129
  1331. package/node_modules/ignore/legacy.js +660 -98
  1332. package/node_modules/ignore/package.json +10 -4
  1333. package/node_modules/marked/README.md +1 -0
  1334. package/node_modules/marked/lib/marked.d.ts +7 -0
  1335. package/node_modules/marked/lib/marked.esm.js +30 -30
  1336. package/node_modules/marked/lib/marked.esm.js.map +3 -3
  1337. package/node_modules/marked/lib/marked.umd.js +30 -30
  1338. package/node_modules/marked/lib/marked.umd.js.map +3 -3
  1339. package/node_modules/marked/man/marked.1 +1 -1
  1340. package/node_modules/marked/package.json +2 -2
  1341. package/node_modules/typebox/build/compile/validator.d.mts +1 -1
  1342. package/node_modules/typebox/build/compile/validator.mjs +1 -1
  1343. package/node_modules/typebox/build/format/idna/idn-hostname.mjs +7 -5
  1344. package/node_modules/typebox/build/format/iri.mjs +5 -1
  1345. package/node_modules/typebox/build/guard/emit.mjs +2 -4
  1346. package/node_modules/typebox/build/guard/guard.mjs +6 -18
  1347. package/node_modules/typebox/build/guard/string.mjs +16 -24
  1348. package/node_modules/typebox/build/schema/compile.d.mts +3 -2
  1349. package/node_modules/typebox/build/schema/compile.mjs +8 -8
  1350. package/node_modules/typebox/build/schema/engine/_context.d.mts +1 -6
  1351. package/node_modules/typebox/build/schema/engine/_context.mjs +9 -14
  1352. package/node_modules/typebox/build/schema/engine/_functions.mjs +1 -1
  1353. package/node_modules/typebox/build/schema/engine/_stack.d.mts +6 -2
  1354. package/node_modules/typebox/build/schema/engine/_stack.mjs +135 -32
  1355. package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +16 -4
  1356. package/node_modules/typebox/build/schema/engine/allOf.mjs +2 -2
  1357. package/node_modules/typebox/build/schema/engine/anyOf.mjs +2 -2
  1358. package/node_modules/typebox/build/schema/engine/if.mjs +2 -2
  1359. package/node_modules/typebox/build/schema/engine/oneOf.mjs +2 -2
  1360. package/node_modules/typebox/build/schema/engine/propertyNames.mjs +1 -3
  1361. package/node_modules/typebox/build/schema/engine/ref.mjs +2 -2
  1362. package/node_modules/typebox/build/schema/engine/schema.mjs +6 -0
  1363. package/node_modules/typebox/build/schema/engine/unevaluatedItems.mjs +2 -2
  1364. package/node_modules/typebox/build/schema/engine/unevaluatedProperties.mjs +2 -2
  1365. package/node_modules/typebox/build/schema/errors.d.mts +2 -2
  1366. package/node_modules/typebox/build/schema/errors.mjs +7 -13
  1367. package/node_modules/typebox/build/schema/intern/index.d.mts +1 -0
  1368. package/node_modules/typebox/build/schema/intern/index.mjs +1 -0
  1369. package/node_modules/typebox/build/schema/intern/intern.d.mts +14 -0
  1370. package/node_modules/typebox/build/schema/intern/intern.mjs +259 -0
  1371. package/node_modules/typebox/build/schema/parse.d.mts +1 -0
  1372. package/node_modules/typebox/build/schema/parse.mjs +10 -5
  1373. package/node_modules/typebox/build/schema/resolve/resolve.d.mts +34 -3
  1374. package/node_modules/typebox/build/schema/resolve/resolve.mjs +198 -73
  1375. package/node_modules/typebox/build/schema/schema.d.mts +1 -0
  1376. package/node_modules/typebox/build/schema/schema.mjs +1 -0
  1377. package/node_modules/typebox/build/value/errors/errors.d.mts +2 -12
  1378. package/node_modules/typebox/build/value/errors/errors.mjs +2 -7
  1379. package/node_modules/typebox/package.json +1 -1
  1380. package/node_modules/typebox/readme.md +9 -5
  1381. package/node_modules/undici/docs/docs/api/Client.md +4 -0
  1382. package/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +3 -2
  1383. package/node_modules/undici/docs/docs/api/EventSource.md +4 -0
  1384. package/node_modules/undici/docs/docs/api/Interceptors.md +7 -3
  1385. package/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +7 -1
  1386. package/node_modules/undici/lib/cache/memory-cache-store.js +2 -2
  1387. package/node_modules/undici/lib/core/symbols.js +2 -0
  1388. package/node_modules/undici/lib/dispatcher/agent.js +7 -2
  1389. package/node_modules/undici/lib/dispatcher/balanced-pool.js +7 -4
  1390. package/node_modules/undici/lib/dispatcher/client-h1.js +12 -4
  1391. package/node_modules/undici/lib/dispatcher/client-h2.js +43 -3
  1392. package/node_modules/undici/lib/dispatcher/client.js +3 -2
  1393. package/node_modules/undici/lib/dispatcher/dispatcher-base.js +13 -1
  1394. package/node_modules/undici/lib/dispatcher/dispatcher.js +15 -1
  1395. package/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +3 -0
  1396. package/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +10 -3
  1397. package/node_modules/undici/lib/dispatcher/proxy-agent.js +18 -1
  1398. package/node_modules/undici/lib/dispatcher/retry-agent.js +3 -0
  1399. package/node_modules/undici/lib/dispatcher/round-robin-pool.js +1 -1
  1400. package/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +91 -21
  1401. package/node_modules/undici/lib/handler/cache-handler.js +29 -5
  1402. package/node_modules/undici/lib/handler/decorator-handler.js +7 -1
  1403. package/node_modules/undici/lib/handler/deduplication-handler.js +12 -6
  1404. package/node_modules/undici/lib/handler/redirect-handler.js +21 -4
  1405. package/node_modules/undici/lib/handler/retry-handler.js +148 -30
  1406. package/node_modules/undici/lib/interceptor/cache.js +65 -12
  1407. package/node_modules/undici/lib/interceptor/decompress.js +115 -13
  1408. package/node_modules/undici/lib/interceptor/deduplicate.js +5 -4
  1409. package/node_modules/undici/lib/interceptor/dns.js +7 -0
  1410. package/node_modules/undici/lib/interceptor/dump.js +10 -23
  1411. package/node_modules/undici/lib/mock/mock-agent.js +13 -1
  1412. package/node_modules/undici/lib/mock/mock-utils.js +11 -10
  1413. package/node_modules/undici/lib/util/cache.js +45 -3
  1414. package/node_modules/undici/lib/web/cookies/parse.js +150 -147
  1415. package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +28 -1
  1416. package/node_modules/undici/lib/web/eventsource/eventsource.js +13 -3
  1417. package/node_modules/undici/lib/web/fetch/index.js +6 -0
  1418. package/node_modules/undici/lib/web/fetch/request.js +2 -3
  1419. package/node_modules/undici/lib/web/fetch/util.js +6 -1
  1420. package/node_modules/undici/lib/web/webidl/index.js +3 -3
  1421. package/node_modules/undici/lib/web/websocket/connection.js +1 -1
  1422. package/node_modules/undici/lib/web/websocket/permessage-deflate.js +5 -0
  1423. package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +8 -10
  1424. package/node_modules/undici/package.json +3 -3
  1425. package/node_modules/undici/types/client.d.ts +10 -0
  1426. package/node_modules/undici/types/interceptors.d.ts +2 -0
  1427. package/node_modules/undici/types/mock-agent.d.ts +11 -10
  1428. package/node_modules/undici/types/socks5-proxy-agent.d.ts +2 -0
  1429. package/package.json +70 -49
  1430. package/vendor/pi-client/client.d.ts +20 -15
  1431. package/vendor/pi-client/client.d.ts.map +1 -1
  1432. package/vendor/pi-client/client.js +248 -245
  1433. package/vendor/pi-client/client.js.map +1 -1
  1434. package/vendor/pi-client/connection.d.ts +4 -3
  1435. package/vendor/pi-client/connection.d.ts.map +1 -1
  1436. package/vendor/pi-client/connection.js +13 -9
  1437. package/vendor/pi-client/connection.js.map +1 -1
  1438. package/vendor/pi-client/errors.d.ts +6 -15
  1439. package/vendor/pi-client/errors.d.ts.map +1 -1
  1440. package/vendor/pi-client/errors.js +10 -25
  1441. package/vendor/pi-client/errors.js.map +1 -1
  1442. package/vendor/pi-client/index.d.ts +3 -4
  1443. package/vendor/pi-client/index.d.ts.map +1 -1
  1444. package/vendor/pi-client/index.js +2 -2
  1445. package/vendor/pi-client/index.js.map +1 -1
  1446. package/vendor/pi-client/types.d.ts +14 -8
  1447. package/vendor/pi-client/types.d.ts.map +1 -1
  1448. package/vendor/pi-client/types.js.map +1 -1
  1449. package/vendor/pi-client/unix.d.ts +14 -1
  1450. package/vendor/pi-client/unix.d.ts.map +1 -1
  1451. package/vendor/pi-client/unix.js +138 -8
  1452. package/vendor/pi-client/unix.js.map +1 -1
  1453. package/vendor/pi-protocol/codec.d.ts +2 -4
  1454. package/vendor/pi-protocol/codec.d.ts.map +1 -1
  1455. package/vendor/pi-protocol/codec.js +7 -34
  1456. package/vendor/pi-protocol/codec.js.map +1 -1
  1457. package/vendor/pi-protocol/framing.d.ts +0 -2
  1458. package/vendor/pi-protocol/framing.d.ts.map +1 -1
  1459. package/vendor/pi-protocol/framing.js +0 -15
  1460. package/vendor/pi-protocol/framing.js.map +1 -1
  1461. package/vendor/pi-protocol/index.d.ts +1 -1
  1462. package/vendor/pi-protocol/index.d.ts.map +1 -1
  1463. package/vendor/pi-protocol/index.js +1 -1
  1464. package/vendor/pi-protocol/index.js.map +1 -1
  1465. package/vendor/pi-protocol/protocol.d.ts +167 -0
  1466. package/vendor/pi-protocol/protocol.d.ts.map +1 -0
  1467. package/vendor/pi-protocol/protocol.js +85 -0
  1468. package/vendor/pi-protocol/protocol.js.map +1 -0
  1469. package/dist/bun/register-bedrock.d.ts +0 -2
  1470. package/dist/bun/register-bedrock.d.ts.map +0 -1
  1471. package/dist/bun/register-bedrock.js +0 -4
  1472. package/dist/bun/register-bedrock.js.map +0 -1
  1473. package/dist/cli/experimental/auth.d.ts +0 -16
  1474. package/dist/cli/experimental/auth.d.ts.map +0 -1
  1475. package/dist/cli/experimental/auth.js +0 -13
  1476. package/dist/cli/experimental/auth.js.map +0 -1
  1477. package/dist/cli/experimental/cli.d.ts +0 -6
  1478. package/dist/cli/experimental/cli.d.ts.map +0 -1
  1479. package/dist/cli/experimental/cli.js +0 -5
  1480. package/dist/cli/experimental/cli.js.map +0 -1
  1481. package/dist/cli/experimental/command-options.d.ts +0 -17
  1482. package/dist/cli/experimental/command-options.d.ts.map +0 -1
  1483. package/dist/cli/experimental/command-options.js +0 -35
  1484. package/dist/cli/experimental/command-options.js.map +0 -1
  1485. package/dist/cli/experimental/command.d.ts +0 -63
  1486. package/dist/cli/experimental/command.d.ts.map +0 -1
  1487. package/dist/cli/experimental/command.js +0 -127
  1488. package/dist/cli/experimental/command.js.map +0 -1
  1489. package/dist/cli/experimental/commands/client.d.ts +0 -13
  1490. package/dist/cli/experimental/commands/client.d.ts.map +0 -1
  1491. package/dist/cli/experimental/commands/client.js +0 -25
  1492. package/dist/cli/experimental/commands/client.js.map +0 -1
  1493. package/dist/cli/experimental/commands/pi.d.ts +0 -15
  1494. package/dist/cli/experimental/commands/pi.d.ts.map +0 -1
  1495. package/dist/cli/experimental/commands/pi.js +0 -28
  1496. package/dist/cli/experimental/commands/pi.js.map +0 -1
  1497. package/dist/cli/experimental/commands/server.d.ts +0 -13
  1498. package/dist/cli/experimental/commands/server.d.ts.map +0 -1
  1499. package/dist/cli/experimental/commands/server.js +0 -25
  1500. package/dist/cli/experimental/commands/server.js.map +0 -1
  1501. package/dist/cli/experimental/transport-address.d.ts +0 -10
  1502. package/dist/cli/experimental/transport-address.d.ts.map +0 -1
  1503. package/dist/cli/experimental/transport-address.js +0 -38
  1504. package/dist/cli/experimental/transport-address.js.map +0 -1
  1505. package/dist/client/remote-session.d.ts +0 -53
  1506. package/dist/client/remote-session.d.ts.map +0 -1
  1507. package/dist/client/remote-session.js +0 -340
  1508. package/dist/client/remote-session.js.map +0 -1
  1509. package/dist/client/transcript.d.ts +0 -12
  1510. package/dist/client/transcript.d.ts.map +0 -1
  1511. package/dist/client/transcript.js +0 -98
  1512. package/dist/client/transcript.js.map +0 -1
  1513. package/dist/server/create-harness.d.ts +0 -26
  1514. package/dist/server/create-harness.d.ts.map +0 -1
  1515. package/dist/server/create-harness.js +0 -106
  1516. package/dist/server/create-harness.js.map +0 -1
  1517. package/dist/utils/clipboard-native.d.ts +0 -11
  1518. package/dist/utils/clipboard-native.d.ts.map +0 -1
  1519. package/dist/utils/clipboard-native.js +0 -20
  1520. package/dist/utils/clipboard-native.js.map +0 -1
  1521. package/docs/AGENTS.md +0 -67
  1522. package/node_modules/@earendil-works/pi-agent-core/dist/harness/reducer.d.ts +0 -100
  1523. package/node_modules/@earendil-works/pi-agent-core/dist/harness/reducer.d.ts.map +0 -1
  1524. package/node_modules/@earendil-works/pi-agent-core/dist/harness/reducer.js +0 -420
  1525. package/node_modules/@earendil-works/pi-agent-core/dist/harness/reducer.js.map +0 -1
  1526. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/errors.d.ts +0 -9
  1527. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/errors.d.ts.map +0 -1
  1528. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/errors.js +0 -18
  1529. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/errors.js.map +0 -1
  1530. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl.d.ts +0 -3
  1531. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl.d.ts.map +0 -1
  1532. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl.js +0 -2
  1533. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl.js.map +0 -1
  1534. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/state.d.ts +0 -65
  1535. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/state.d.ts.map +0 -1
  1536. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/state.js +0 -320
  1537. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/state.js.map +0 -1
  1538. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance.d.ts +0 -4
  1539. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance.d.ts.map +0 -1
  1540. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance.js +0 -762
  1541. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance.js.map +0 -1
  1542. package/node_modules/@earendil-works/pi-agent-core/dist/search/scanning.d.ts +0 -29
  1543. package/node_modules/@earendil-works/pi-agent-core/dist/search/scanning.d.ts.map +0 -1
  1544. package/node_modules/@earendil-works/pi-agent-core/dist/search/scanning.js +0 -103
  1545. package/node_modules/@earendil-works/pi-agent-core/dist/search/scanning.js.map +0 -1
  1546. package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-gateway-binding.d.ts +0 -69
  1547. package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-gateway-binding.d.ts.map +0 -1
  1548. package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-gateway-binding.js +0 -159
  1549. package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-gateway-binding.js.map +0 -1
  1550. package/node_modules/@earendil-works/pi-tui/native/darwin/src/darwin-modifiers.c +0 -70
  1551. package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-arm64/win32-console-mode.node +0 -0
  1552. package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-x64/win32-console-mode.node +0 -0
  1553. package/node_modules/@earendil-works/pi-tui/native/win32/src/win32-console-mode.c +0 -119
  1554. package/node_modules/@mariozechner/clipboard/.yarnrc.yml +0 -1
  1555. package/node_modules/@mariozechner/clipboard/Cargo.toml +0 -45
  1556. package/node_modules/@mariozechner/clipboard/README.md +0 -60
  1557. package/node_modules/@mariozechner/clipboard/build.rs +0 -5
  1558. package/node_modules/@mariozechner/clipboard/exp.ts +0 -12
  1559. package/node_modules/@mariozechner/clipboard/index.d.ts +0 -37
  1560. package/node_modules/@mariozechner/clipboard/index.js +0 -606
  1561. package/node_modules/@mariozechner/clipboard/package.json +0 -45
  1562. package/node_modules/@mariozechner/clipboard/src/clipboard_rs/common.rs +0 -307
  1563. package/node_modules/@mariozechner/clipboard/src/clipboard_rs/mod.rs +0 -93
  1564. package/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/ios.rs +0 -313
  1565. package/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/macos.rs +0 -471
  1566. package/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/mod.rs +0 -252
  1567. package/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/wayland.rs +0 -431
  1568. package/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/win.rs +0 -712
  1569. package/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/x11.rs +0 -916
  1570. package/node_modules/@mariozechner/clipboard/src/lib.rs +0 -194
  1571. package/vendor/pi-client/session-handle.d.ts +0 -54
  1572. package/vendor/pi-client/session-handle.d.ts.map +0 -1
  1573. package/vendor/pi-client/session-handle.js +0 -50
  1574. package/vendor/pi-client/session-handle.js.map +0 -1
  1575. package/vendor/pi-client/state.d.ts +0 -22
  1576. package/vendor/pi-client/state.d.ts.map +0 -1
  1577. package/vendor/pi-client/state.js +0 -145
  1578. package/vendor/pi-client/state.js.map +0 -1
  1579. package/vendor/pi-protocol/schemas.d.ts +0 -13739
  1580. package/vendor/pi-protocol/schemas.d.ts.map +0 -1
  1581. package/vendor/pi-protocol/schemas.js +0 -386
  1582. package/vendor/pi-protocol/schemas.js.map +0 -1
@@ -0,0 +1,2536 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // lib/npm/node.ts
31
+ var node_exports = {};
32
+ __export(node_exports, {
33
+ analyzeMetafile: () => analyzeMetafile,
34
+ analyzeMetafileSync: () => analyzeMetafileSync,
35
+ build: () => build,
36
+ buildSync: () => buildSync,
37
+ context: () => context,
38
+ default: () => node_default,
39
+ formatMessages: () => formatMessages,
40
+ formatMessagesSync: () => formatMessagesSync,
41
+ initialize: () => initialize,
42
+ stop: () => stop,
43
+ transform: () => transform,
44
+ transformSync: () => transformSync,
45
+ version: () => version
46
+ });
47
+ module.exports = __toCommonJS(node_exports);
48
+
49
+ // lib/shared/stdio_protocol.ts
50
+ function encodePacket(packet) {
51
+ let visit = (value) => {
52
+ if (value === null) {
53
+ bb.write8(0);
54
+ } else if (typeof value === "boolean") {
55
+ bb.write8(1);
56
+ bb.write8(+value);
57
+ } else if (typeof value === "number") {
58
+ bb.write8(2);
59
+ bb.write32(value | 0);
60
+ } else if (typeof value === "string") {
61
+ bb.write8(3);
62
+ bb.write(encodeUTF8(value));
63
+ } else if (value instanceof Uint8Array) {
64
+ bb.write8(4);
65
+ bb.write(value);
66
+ } else if (value instanceof Array) {
67
+ bb.write8(5);
68
+ bb.write32(value.length);
69
+ for (let item of value) {
70
+ visit(item);
71
+ }
72
+ } else {
73
+ let keys = Object.keys(value);
74
+ bb.write8(6);
75
+ bb.write32(keys.length);
76
+ for (let key of keys) {
77
+ bb.write(encodeUTF8(key));
78
+ visit(value[key]);
79
+ }
80
+ }
81
+ };
82
+ let bb = new ByteBuffer();
83
+ bb.write32(0);
84
+ bb.write32(packet.id << 1 | +!packet.isRequest);
85
+ visit(packet.value);
86
+ writeUInt32LE(bb.buf, bb.len - 4, 0);
87
+ return bb.buf.subarray(0, bb.len);
88
+ }
89
+ function decodePacket(bytes) {
90
+ let visit = () => {
91
+ switch (bb.read8()) {
92
+ case 0:
93
+ return null;
94
+ case 1:
95
+ return !!bb.read8();
96
+ case 2:
97
+ return bb.read32();
98
+ case 3:
99
+ return decodeUTF8(bb.read());
100
+ case 4:
101
+ return bb.read();
102
+ case 5: {
103
+ let count = bb.read32();
104
+ let value2 = [];
105
+ for (let i = 0; i < count; i++) {
106
+ value2.push(visit());
107
+ }
108
+ return value2;
109
+ }
110
+ case 6: {
111
+ let count = bb.read32();
112
+ let value2 = {};
113
+ for (let i = 0; i < count; i++) {
114
+ value2[decodeUTF8(bb.read())] = visit();
115
+ }
116
+ return value2;
117
+ }
118
+ default:
119
+ throw new Error("Invalid packet");
120
+ }
121
+ };
122
+ let bb = new ByteBuffer(bytes);
123
+ let id = bb.read32();
124
+ let isRequest = (id & 1) === 0;
125
+ id >>>= 1;
126
+ let value = visit();
127
+ if (bb.ptr !== bytes.length) {
128
+ throw new Error("Invalid packet");
129
+ }
130
+ return { id, isRequest, value };
131
+ }
132
+ var ByteBuffer = class {
133
+ constructor(buf = new Uint8Array(1024)) {
134
+ this.buf = buf;
135
+ this.len = 0;
136
+ this.ptr = 0;
137
+ }
138
+ _write(delta) {
139
+ if (this.len + delta > this.buf.length) {
140
+ let clone = new Uint8Array((this.len + delta) * 2);
141
+ clone.set(this.buf);
142
+ this.buf = clone;
143
+ }
144
+ this.len += delta;
145
+ return this.len - delta;
146
+ }
147
+ write8(value) {
148
+ let offset = this._write(1);
149
+ this.buf[offset] = value;
150
+ }
151
+ write32(value) {
152
+ let offset = this._write(4);
153
+ writeUInt32LE(this.buf, value, offset);
154
+ }
155
+ write(bytes) {
156
+ let offset = this._write(4 + bytes.length);
157
+ writeUInt32LE(this.buf, bytes.length, offset);
158
+ this.buf.set(bytes, offset + 4);
159
+ }
160
+ _read(delta) {
161
+ if (this.ptr + delta > this.buf.length) {
162
+ throw new Error("Invalid packet");
163
+ }
164
+ this.ptr += delta;
165
+ return this.ptr - delta;
166
+ }
167
+ read8() {
168
+ return this.buf[this._read(1)];
169
+ }
170
+ read32() {
171
+ return readUInt32LE(this.buf, this._read(4));
172
+ }
173
+ read() {
174
+ let length = this.read32();
175
+ let bytes = new Uint8Array(length);
176
+ let ptr = this._read(bytes.length);
177
+ bytes.set(this.buf.subarray(ptr, ptr + length));
178
+ return bytes;
179
+ }
180
+ };
181
+ var encodeUTF8;
182
+ var decodeUTF8;
183
+ var encodeInvariant;
184
+ if (typeof TextEncoder !== "undefined" && typeof TextDecoder !== "undefined") {
185
+ let encoder = new TextEncoder();
186
+ let decoder = new TextDecoder();
187
+ encodeUTF8 = (text) => encoder.encode(text);
188
+ decodeUTF8 = (bytes) => decoder.decode(bytes);
189
+ encodeInvariant = 'new TextEncoder().encode("")';
190
+ } else if (typeof Buffer !== "undefined") {
191
+ encodeUTF8 = (text) => Buffer.from(text);
192
+ decodeUTF8 = (bytes) => {
193
+ let { buffer, byteOffset, byteLength } = bytes;
194
+ return Buffer.from(buffer, byteOffset, byteLength).toString();
195
+ };
196
+ encodeInvariant = 'Buffer.from("")';
197
+ } else {
198
+ throw new Error("No UTF-8 codec found");
199
+ }
200
+ if (!(encodeUTF8("") instanceof Uint8Array))
201
+ throw new Error(`Invariant violation: "${encodeInvariant} instanceof Uint8Array" is incorrectly false
202
+
203
+ This indicates that your JavaScript environment is broken. You cannot use
204
+ esbuild in this environment because esbuild relies on this invariant. This
205
+ is not a problem with esbuild. You need to fix your environment instead.
206
+ `);
207
+ function readUInt32LE(buffer, offset) {
208
+ return (buffer[offset++] | buffer[offset++] << 8 | buffer[offset++] << 16 | buffer[offset++] << 24) >>> 0;
209
+ }
210
+ function writeUInt32LE(buffer, value, offset) {
211
+ buffer[offset++] = value;
212
+ buffer[offset++] = value >> 8;
213
+ buffer[offset++] = value >> 16;
214
+ buffer[offset++] = value >> 24;
215
+ }
216
+
217
+ // lib/shared/uint8array_json_parser.ts
218
+ var fromCharCode = String.fromCharCode;
219
+ function throwSyntaxError(bytes, index, message) {
220
+ const c = bytes[index];
221
+ let line = 1;
222
+ let column = 0;
223
+ for (let i = 0; i < index; i++) {
224
+ if (bytes[i] === 10 /* Newline */) {
225
+ line++;
226
+ column = 0;
227
+ } else {
228
+ column++;
229
+ }
230
+ }
231
+ throw new SyntaxError(
232
+ message ? message : index === bytes.length ? "Unexpected end of input while parsing JSON" : c >= 32 && c <= 126 ? `Unexpected character ${fromCharCode(c)} in JSON at position ${index} (line ${line}, column ${column})` : `Unexpected byte 0x${c.toString(16)} in JSON at position ${index} (line ${line}, column ${column})`
233
+ );
234
+ }
235
+ function JSON_parse(bytes) {
236
+ if (!(bytes instanceof Uint8Array)) {
237
+ throw new Error(`JSON input must be a Uint8Array`);
238
+ }
239
+ const propertyStack = [];
240
+ const objectStack = [];
241
+ const stateStack = [];
242
+ const length = bytes.length;
243
+ let property = null;
244
+ let state = 0 /* TopLevel */;
245
+ let object;
246
+ let i = 0;
247
+ while (i < length) {
248
+ let c = bytes[i++];
249
+ if (c <= 32 /* Space */) {
250
+ continue;
251
+ }
252
+ let value;
253
+ if (state === 2 /* Object */ && property === null && c !== 34 /* Quote */ && c !== 125 /* CloseBrace */) {
254
+ throwSyntaxError(bytes, --i);
255
+ }
256
+ switch (c) {
257
+ // True
258
+ case 116 /* LowerT */: {
259
+ if (bytes[i++] !== 114 /* LowerR */ || bytes[i++] !== 117 /* LowerU */ || bytes[i++] !== 101 /* LowerE */) {
260
+ throwSyntaxError(bytes, --i);
261
+ }
262
+ value = true;
263
+ break;
264
+ }
265
+ // False
266
+ case 102 /* LowerF */: {
267
+ if (bytes[i++] !== 97 /* LowerA */ || bytes[i++] !== 108 /* LowerL */ || bytes[i++] !== 115 /* LowerS */ || bytes[i++] !== 101 /* LowerE */) {
268
+ throwSyntaxError(bytes, --i);
269
+ }
270
+ value = false;
271
+ break;
272
+ }
273
+ // Null
274
+ case 110 /* LowerN */: {
275
+ if (bytes[i++] !== 117 /* LowerU */ || bytes[i++] !== 108 /* LowerL */ || bytes[i++] !== 108 /* LowerL */) {
276
+ throwSyntaxError(bytes, --i);
277
+ }
278
+ value = null;
279
+ break;
280
+ }
281
+ // Number begin
282
+ case 45 /* Minus */:
283
+ case 46 /* Dot */:
284
+ case 48 /* Digit0 */:
285
+ case 49 /* Digit1 */:
286
+ case 50 /* Digit2 */:
287
+ case 51 /* Digit3 */:
288
+ case 52 /* Digit4 */:
289
+ case 53 /* Digit5 */:
290
+ case 54 /* Digit6 */:
291
+ case 55 /* Digit7 */:
292
+ case 56 /* Digit8 */:
293
+ case 57 /* Digit9 */: {
294
+ let index = i;
295
+ value = fromCharCode(c);
296
+ c = bytes[i];
297
+ while (true) {
298
+ switch (c) {
299
+ case 43 /* Plus */:
300
+ case 45 /* Minus */:
301
+ case 46 /* Dot */:
302
+ case 48 /* Digit0 */:
303
+ case 49 /* Digit1 */:
304
+ case 50 /* Digit2 */:
305
+ case 51 /* Digit3 */:
306
+ case 52 /* Digit4 */:
307
+ case 53 /* Digit5 */:
308
+ case 54 /* Digit6 */:
309
+ case 55 /* Digit7 */:
310
+ case 56 /* Digit8 */:
311
+ case 57 /* Digit9 */:
312
+ case 101 /* LowerE */:
313
+ case 69 /* UpperE */: {
314
+ value += fromCharCode(c);
315
+ c = bytes[++i];
316
+ continue;
317
+ }
318
+ }
319
+ break;
320
+ }
321
+ value = +value;
322
+ if (isNaN(value)) {
323
+ throwSyntaxError(bytes, --index, "Invalid number");
324
+ }
325
+ break;
326
+ }
327
+ // String begin
328
+ case 34 /* Quote */: {
329
+ value = "";
330
+ while (true) {
331
+ if (i >= length) {
332
+ throwSyntaxError(bytes, length);
333
+ }
334
+ c = bytes[i++];
335
+ if (c === 34 /* Quote */) {
336
+ break;
337
+ } else if (c === 92 /* Backslash */) {
338
+ switch (bytes[i++]) {
339
+ // Normal escape sequence
340
+ case 34 /* Quote */:
341
+ value += '"';
342
+ break;
343
+ case 47 /* Slash */:
344
+ value += "/";
345
+ break;
346
+ case 92 /* Backslash */:
347
+ value += "\\";
348
+ break;
349
+ case 98 /* LowerB */:
350
+ value += "\b";
351
+ break;
352
+ case 102 /* LowerF */:
353
+ value += "\f";
354
+ break;
355
+ case 110 /* LowerN */:
356
+ value += "\n";
357
+ break;
358
+ case 114 /* LowerR */:
359
+ value += "\r";
360
+ break;
361
+ case 116 /* LowerT */:
362
+ value += " ";
363
+ break;
364
+ // Unicode escape sequence
365
+ case 117 /* LowerU */: {
366
+ let code = 0;
367
+ for (let j = 0; j < 4; j++) {
368
+ c = bytes[i++];
369
+ code <<= 4;
370
+ if (c >= 48 /* Digit0 */ && c <= 57 /* Digit9 */) code |= c - 48 /* Digit0 */;
371
+ else if (c >= 97 /* LowerA */ && c <= 102 /* LowerF */) code |= c + (10 - 97 /* LowerA */);
372
+ else if (c >= 65 /* UpperA */ && c <= 70 /* UpperF */) code |= c + (10 - 65 /* UpperA */);
373
+ else throwSyntaxError(bytes, --i);
374
+ }
375
+ value += fromCharCode(code);
376
+ break;
377
+ }
378
+ // Invalid escape sequence
379
+ default:
380
+ throwSyntaxError(bytes, --i);
381
+ break;
382
+ }
383
+ } else if (c <= 127) {
384
+ value += fromCharCode(c);
385
+ } else if ((c & 224) === 192) {
386
+ value += fromCharCode((c & 31) << 6 | bytes[i++] & 63);
387
+ } else if ((c & 240) === 224) {
388
+ value += fromCharCode((c & 15) << 12 | (bytes[i++] & 63) << 6 | bytes[i++] & 63);
389
+ } else if ((c & 248) == 240) {
390
+ let codePoint = (c & 7) << 18 | (bytes[i++] & 63) << 12 | (bytes[i++] & 63) << 6 | bytes[i++] & 63;
391
+ if (codePoint > 65535) {
392
+ codePoint -= 65536;
393
+ value += fromCharCode(codePoint >> 10 & 1023 | 55296);
394
+ codePoint = 56320 | codePoint & 1023;
395
+ }
396
+ value += fromCharCode(codePoint);
397
+ }
398
+ }
399
+ value[0];
400
+ break;
401
+ }
402
+ // Array begin
403
+ case 91 /* OpenBracket */: {
404
+ value = [];
405
+ propertyStack.push(property);
406
+ objectStack.push(object);
407
+ stateStack.push(state);
408
+ property = null;
409
+ object = value;
410
+ state = 1 /* Array */;
411
+ continue;
412
+ }
413
+ // Object begin
414
+ case 123 /* OpenBrace */: {
415
+ value = {};
416
+ propertyStack.push(property);
417
+ objectStack.push(object);
418
+ stateStack.push(state);
419
+ property = null;
420
+ object = value;
421
+ state = 2 /* Object */;
422
+ continue;
423
+ }
424
+ // Array end
425
+ case 93 /* CloseBracket */: {
426
+ if (state !== 1 /* Array */) {
427
+ throwSyntaxError(bytes, --i);
428
+ }
429
+ value = object;
430
+ property = propertyStack.pop();
431
+ object = objectStack.pop();
432
+ state = stateStack.pop();
433
+ break;
434
+ }
435
+ // Object end
436
+ case 125 /* CloseBrace */: {
437
+ if (state !== 2 /* Object */) {
438
+ throwSyntaxError(bytes, --i);
439
+ }
440
+ value = object;
441
+ property = propertyStack.pop();
442
+ object = objectStack.pop();
443
+ state = stateStack.pop();
444
+ break;
445
+ }
446
+ default: {
447
+ throwSyntaxError(bytes, --i);
448
+ }
449
+ }
450
+ c = bytes[i];
451
+ while (c <= 32 /* Space */) {
452
+ c = bytes[++i];
453
+ }
454
+ switch (state) {
455
+ case 0 /* TopLevel */: {
456
+ if (i === length) {
457
+ return value;
458
+ }
459
+ break;
460
+ }
461
+ case 1 /* Array */: {
462
+ object.push(value);
463
+ if (c === 44 /* Comma */) {
464
+ i++;
465
+ continue;
466
+ }
467
+ if (c === 93 /* CloseBracket */) {
468
+ continue;
469
+ }
470
+ break;
471
+ }
472
+ case 2 /* Object */: {
473
+ if (property === null) {
474
+ property = value;
475
+ if (c === 58 /* Colon */) {
476
+ i++;
477
+ continue;
478
+ }
479
+ } else {
480
+ object[property] = value;
481
+ property = null;
482
+ if (c === 44 /* Comma */) {
483
+ i++;
484
+ continue;
485
+ }
486
+ if (c === 125 /* CloseBrace */) {
487
+ continue;
488
+ }
489
+ }
490
+ break;
491
+ }
492
+ }
493
+ break;
494
+ }
495
+ throwSyntaxError(bytes, i);
496
+ }
497
+
498
+ // lib/shared/common.ts
499
+ var quote = JSON.stringify;
500
+ var buildLogLevelDefault = "warning";
501
+ var transformLogLevelDefault = "silent";
502
+ function validateAndJoinStringArray(values, what) {
503
+ const toJoin = [];
504
+ for (const value of values) {
505
+ validateStringValue(value, what);
506
+ if (value.indexOf(",") >= 0) throw new Error(`Invalid ${what}: ${value}`);
507
+ toJoin.push(value);
508
+ }
509
+ return toJoin.join(",");
510
+ }
511
+ var canBeAnything = () => null;
512
+ var mustBeBoolean = (value) => typeof value === "boolean" ? null : "a boolean";
513
+ var mustBeString = (value) => typeof value === "string" ? null : "a string";
514
+ var mustBeRegExp = (value) => value instanceof RegExp ? null : "a RegExp object";
515
+ var mustBeInteger = (value) => typeof value === "number" && value === (value | 0) ? null : "an integer";
516
+ var mustBeValidPortNumber = (value) => typeof value === "number" && value === (value | 0) && value >= 0 && value <= 65535 ? null : "a valid port number";
517
+ var mustBeFunction = (value) => typeof value === "function" ? null : "a function";
518
+ var mustBeArray = (value) => Array.isArray(value) ? null : "an array";
519
+ var mustBeArrayOfStrings = (value) => Array.isArray(value) && value.every((x) => typeof x === "string") ? null : "an array of strings";
520
+ var mustBeObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value) ? null : "an object";
521
+ var mustBeEntryPoints = (value) => typeof value === "object" && value !== null ? null : "an array or an object";
522
+ var mustBeWebAssemblyModule = (value) => value instanceof WebAssembly.Module ? null : "a WebAssembly.Module";
523
+ var mustBeObjectOrNull = (value) => typeof value === "object" && !Array.isArray(value) ? null : "an object or null";
524
+ var mustBeStringOrBoolean = (value) => typeof value === "string" || typeof value === "boolean" ? null : "a string or a boolean";
525
+ var mustBeStringOrObject = (value) => typeof value === "string" || typeof value === "object" && value !== null && !Array.isArray(value) ? null : "a string or an object";
526
+ var mustBeStringOrArrayOfStrings = (value) => typeof value === "string" || Array.isArray(value) && value.every((x) => typeof x === "string") ? null : "a string or an array of strings";
527
+ var mustBeStringOrUint8Array = (value) => typeof value === "string" || value instanceof Uint8Array ? null : "a string or a Uint8Array";
528
+ var mustBeStringOrURL = (value) => typeof value === "string" || value instanceof URL ? null : "a string or a URL";
529
+ function getFlag(object, keys, key, mustBeFn) {
530
+ let value = object[key];
531
+ keys[key + ""] = true;
532
+ if (value === void 0) return void 0;
533
+ let mustBe = mustBeFn(value);
534
+ if (mustBe !== null) throw new Error(`${quote(key)} must be ${mustBe}`);
535
+ return value;
536
+ }
537
+ function checkForInvalidFlags(object, keys, where) {
538
+ for (let key in object) {
539
+ if (!(key in keys)) {
540
+ throw new Error(`Invalid option ${where}: ${quote(key)}`);
541
+ }
542
+ }
543
+ }
544
+ function validateInitializeOptions(options) {
545
+ let keys = /* @__PURE__ */ Object.create(null);
546
+ let wasmURL = getFlag(options, keys, "wasmURL", mustBeStringOrURL);
547
+ let wasmModule = getFlag(options, keys, "wasmModule", mustBeWebAssemblyModule);
548
+ let worker = getFlag(options, keys, "worker", mustBeBoolean);
549
+ checkForInvalidFlags(options, keys, "in initialize() call");
550
+ return {
551
+ wasmURL,
552
+ wasmModule,
553
+ worker
554
+ };
555
+ }
556
+ function validateMangleCache(mangleCache) {
557
+ let validated;
558
+ if (mangleCache !== void 0) {
559
+ validated = /* @__PURE__ */ Object.create(null);
560
+ for (let key in mangleCache) {
561
+ let value = mangleCache[key];
562
+ if (typeof value === "string" || value === false) {
563
+ validated[key] = value;
564
+ } else {
565
+ throw new Error(`Expected ${quote(key)} in mangle cache to map to either a string or false`);
566
+ }
567
+ }
568
+ }
569
+ return validated;
570
+ }
571
+ function pushLogFlags(flags, options, keys, isTTY2, logLevelDefault) {
572
+ let color = getFlag(options, keys, "color", mustBeBoolean);
573
+ let logLevel = getFlag(options, keys, "logLevel", mustBeString);
574
+ let logLimit = getFlag(options, keys, "logLimit", mustBeInteger);
575
+ let logStyle = getFlag(options, keys, "logStyle", mustBeString);
576
+ if (color !== void 0) flags.push(`--color=${color}`);
577
+ else if (isTTY2) flags.push(`--color=true`);
578
+ flags.push(`--log-level=${logLevel || logLevelDefault}`);
579
+ flags.push(`--log-limit=${logLimit || 0}`);
580
+ if (logStyle) flags.push(`--log-style=${logStyle}`);
581
+ }
582
+ function validateStringValue(value, what, key) {
583
+ if (typeof value !== "string") {
584
+ throw new Error(`Expected value for ${what}${key !== void 0 ? " " + quote(key) : ""} to be a string, got ${typeof value} instead`);
585
+ }
586
+ return value;
587
+ }
588
+ function pushCommonFlags(flags, options, keys) {
589
+ let legalComments = getFlag(options, keys, "legalComments", mustBeString);
590
+ let sourceRoot = getFlag(options, keys, "sourceRoot", mustBeString);
591
+ let sourcesContent = getFlag(options, keys, "sourcesContent", mustBeBoolean);
592
+ let target = getFlag(options, keys, "target", mustBeStringOrArrayOfStrings);
593
+ let format = getFlag(options, keys, "format", mustBeString);
594
+ let globalName = getFlag(options, keys, "globalName", mustBeString);
595
+ let mangleProps = getFlag(options, keys, "mangleProps", mustBeRegExp);
596
+ let reserveProps = getFlag(options, keys, "reserveProps", mustBeRegExp);
597
+ let mangleQuoted = getFlag(options, keys, "mangleQuoted", mustBeBoolean);
598
+ let minify = getFlag(options, keys, "minify", mustBeBoolean);
599
+ let minifySyntax = getFlag(options, keys, "minifySyntax", mustBeBoolean);
600
+ let minifyWhitespace = getFlag(options, keys, "minifyWhitespace", mustBeBoolean);
601
+ let minifyIdentifiers = getFlag(options, keys, "minifyIdentifiers", mustBeBoolean);
602
+ let lineLimit = getFlag(options, keys, "lineLimit", mustBeInteger);
603
+ let drop = getFlag(options, keys, "drop", mustBeArrayOfStrings);
604
+ let dropLabels = getFlag(options, keys, "dropLabels", mustBeArrayOfStrings);
605
+ let charset = getFlag(options, keys, "charset", mustBeString);
606
+ let treeShaking = getFlag(options, keys, "treeShaking", mustBeBoolean);
607
+ let ignoreAnnotations = getFlag(options, keys, "ignoreAnnotations", mustBeBoolean);
608
+ let jsx = getFlag(options, keys, "jsx", mustBeString);
609
+ let jsxFactory = getFlag(options, keys, "jsxFactory", mustBeString);
610
+ let jsxFragment = getFlag(options, keys, "jsxFragment", mustBeString);
611
+ let jsxImportSource = getFlag(options, keys, "jsxImportSource", mustBeString);
612
+ let jsxDev = getFlag(options, keys, "jsxDev", mustBeBoolean);
613
+ let jsxSideEffects = getFlag(options, keys, "jsxSideEffects", mustBeBoolean);
614
+ let define = getFlag(options, keys, "define", mustBeObject);
615
+ let logOverride = getFlag(options, keys, "logOverride", mustBeObject);
616
+ let supported = getFlag(options, keys, "supported", mustBeObject);
617
+ let pure = getFlag(options, keys, "pure", mustBeArrayOfStrings);
618
+ let keepNames = getFlag(options, keys, "keepNames", mustBeBoolean);
619
+ let platform = getFlag(options, keys, "platform", mustBeString);
620
+ let tsconfigRaw = getFlag(options, keys, "tsconfigRaw", mustBeStringOrObject);
621
+ let absPaths = getFlag(options, keys, "absPaths", mustBeArrayOfStrings);
622
+ if (legalComments) flags.push(`--legal-comments=${legalComments}`);
623
+ if (sourceRoot !== void 0) flags.push(`--source-root=${sourceRoot}`);
624
+ if (sourcesContent !== void 0) flags.push(`--sources-content=${sourcesContent}`);
625
+ if (target) flags.push(`--target=${validateAndJoinStringArray(Array.isArray(target) ? target : [target], "target")}`);
626
+ if (format) flags.push(`--format=${format}`);
627
+ if (globalName) flags.push(`--global-name=${globalName}`);
628
+ if (platform) flags.push(`--platform=${platform}`);
629
+ if (tsconfigRaw) flags.push(`--tsconfig-raw=${typeof tsconfigRaw === "string" ? tsconfigRaw : JSON.stringify(tsconfigRaw)}`);
630
+ if (minify) flags.push("--minify");
631
+ if (minifySyntax) flags.push("--minify-syntax");
632
+ if (minifyWhitespace) flags.push("--minify-whitespace");
633
+ if (minifyIdentifiers) flags.push("--minify-identifiers");
634
+ if (lineLimit) flags.push(`--line-limit=${lineLimit}`);
635
+ if (charset) flags.push(`--charset=${charset}`);
636
+ if (treeShaking !== void 0) flags.push(`--tree-shaking=${treeShaking}`);
637
+ if (ignoreAnnotations) flags.push(`--ignore-annotations`);
638
+ if (drop) for (let what of drop) flags.push(`--drop:${validateStringValue(what, "drop")}`);
639
+ if (dropLabels) flags.push(`--drop-labels=${validateAndJoinStringArray(dropLabels, "drop label")}`);
640
+ if (absPaths) flags.push(`--abs-paths=${validateAndJoinStringArray(absPaths, "abs paths")}`);
641
+ if (mangleProps) flags.push(`--mangle-props=${jsRegExpToGoRegExp(mangleProps)}`);
642
+ if (reserveProps) flags.push(`--reserve-props=${jsRegExpToGoRegExp(reserveProps)}`);
643
+ if (mangleQuoted !== void 0) flags.push(`--mangle-quoted=${mangleQuoted}`);
644
+ if (jsx) flags.push(`--jsx=${jsx}`);
645
+ if (jsxFactory) flags.push(`--jsx-factory=${jsxFactory}`);
646
+ if (jsxFragment) flags.push(`--jsx-fragment=${jsxFragment}`);
647
+ if (jsxImportSource) flags.push(`--jsx-import-source=${jsxImportSource}`);
648
+ if (jsxDev) flags.push(`--jsx-dev`);
649
+ if (jsxSideEffects) flags.push(`--jsx-side-effects`);
650
+ if (define) {
651
+ for (let key in define) {
652
+ if (key.indexOf("=") >= 0) throw new Error(`Invalid define: ${key}`);
653
+ flags.push(`--define:${key}=${validateStringValue(define[key], "define", key)}`);
654
+ }
655
+ }
656
+ if (logOverride) {
657
+ for (let key in logOverride) {
658
+ if (key.indexOf("=") >= 0) throw new Error(`Invalid log override: ${key}`);
659
+ flags.push(`--log-override:${key}=${validateStringValue(logOverride[key], "log override", key)}`);
660
+ }
661
+ }
662
+ if (supported) {
663
+ for (let key in supported) {
664
+ if (key.indexOf("=") >= 0) throw new Error(`Invalid supported: ${key}`);
665
+ const value = supported[key];
666
+ if (typeof value !== "boolean") throw new Error(`Expected value for supported ${quote(key)} to be a boolean, got ${typeof value} instead`);
667
+ flags.push(`--supported:${key}=${value}`);
668
+ }
669
+ }
670
+ if (pure) for (let fn of pure) flags.push(`--pure:${validateStringValue(fn, "pure")}`);
671
+ if (keepNames) flags.push(`--keep-names`);
672
+ }
673
+ function flagsForBuildOptions(callName, options, isTTY2, logLevelDefault, writeDefault) {
674
+ var _a2;
675
+ let flags = [];
676
+ let entries = [];
677
+ let keys = /* @__PURE__ */ Object.create(null);
678
+ let stdinContents = null;
679
+ let stdinResolveDir = null;
680
+ pushLogFlags(flags, options, keys, isTTY2, logLevelDefault);
681
+ pushCommonFlags(flags, options, keys);
682
+ let sourcemap = getFlag(options, keys, "sourcemap", mustBeStringOrBoolean);
683
+ let bundle = getFlag(options, keys, "bundle", mustBeBoolean);
684
+ let splitting = getFlag(options, keys, "splitting", mustBeBoolean);
685
+ let preserveSymlinks = getFlag(options, keys, "preserveSymlinks", mustBeBoolean);
686
+ let metafile = getFlag(options, keys, "metafile", mustBeBoolean);
687
+ let outfile = getFlag(options, keys, "outfile", mustBeString);
688
+ let outdir = getFlag(options, keys, "outdir", mustBeString);
689
+ let outbase = getFlag(options, keys, "outbase", mustBeString);
690
+ let tsconfig = getFlag(options, keys, "tsconfig", mustBeString);
691
+ let resolveExtensions = getFlag(options, keys, "resolveExtensions", mustBeArrayOfStrings);
692
+ let nodePathsInput = getFlag(options, keys, "nodePaths", mustBeArrayOfStrings);
693
+ let mainFields = getFlag(options, keys, "mainFields", mustBeArrayOfStrings);
694
+ let conditions = getFlag(options, keys, "conditions", mustBeArrayOfStrings);
695
+ let external = getFlag(options, keys, "external", mustBeArrayOfStrings);
696
+ let packages = getFlag(options, keys, "packages", mustBeString);
697
+ let alias = getFlag(options, keys, "alias", mustBeObject);
698
+ let loader = getFlag(options, keys, "loader", mustBeObject);
699
+ let outExtension = getFlag(options, keys, "outExtension", mustBeObject);
700
+ let publicPath = getFlag(options, keys, "publicPath", mustBeString);
701
+ let entryNames = getFlag(options, keys, "entryNames", mustBeString);
702
+ let chunkNames = getFlag(options, keys, "chunkNames", mustBeString);
703
+ let assetNames = getFlag(options, keys, "assetNames", mustBeString);
704
+ let inject = getFlag(options, keys, "inject", mustBeArrayOfStrings);
705
+ let banner = getFlag(options, keys, "banner", mustBeObject);
706
+ let footer = getFlag(options, keys, "footer", mustBeObject);
707
+ let entryPoints = getFlag(options, keys, "entryPoints", mustBeEntryPoints);
708
+ let absWorkingDir = getFlag(options, keys, "absWorkingDir", mustBeString);
709
+ let stdin = getFlag(options, keys, "stdin", mustBeObject);
710
+ let write = (_a2 = getFlag(options, keys, "write", mustBeBoolean)) != null ? _a2 : writeDefault;
711
+ let allowOverwrite = getFlag(options, keys, "allowOverwrite", mustBeBoolean);
712
+ let mangleCache = getFlag(options, keys, "mangleCache", mustBeObject);
713
+ keys.plugins = true;
714
+ checkForInvalidFlags(options, keys, `in ${callName}() call`);
715
+ if (sourcemap) flags.push(`--sourcemap${sourcemap === true ? "" : `=${sourcemap}`}`);
716
+ if (bundle) flags.push("--bundle");
717
+ if (allowOverwrite) flags.push("--allow-overwrite");
718
+ if (splitting) flags.push("--splitting");
719
+ if (preserveSymlinks) flags.push("--preserve-symlinks");
720
+ if (metafile) flags.push(`--metafile`);
721
+ if (outfile) flags.push(`--outfile=${outfile}`);
722
+ if (outdir) flags.push(`--outdir=${outdir}`);
723
+ if (outbase) flags.push(`--outbase=${outbase}`);
724
+ if (tsconfig) flags.push(`--tsconfig=${tsconfig}`);
725
+ if (packages) flags.push(`--packages=${packages}`);
726
+ if (resolveExtensions) flags.push(`--resolve-extensions=${validateAndJoinStringArray(resolveExtensions, "resolve extension")}`);
727
+ if (publicPath) flags.push(`--public-path=${publicPath}`);
728
+ if (entryNames) flags.push(`--entry-names=${entryNames}`);
729
+ if (chunkNames) flags.push(`--chunk-names=${chunkNames}`);
730
+ if (assetNames) flags.push(`--asset-names=${assetNames}`);
731
+ if (mainFields) flags.push(`--main-fields=${validateAndJoinStringArray(mainFields, "main field")}`);
732
+ if (conditions) flags.push(`--conditions=${validateAndJoinStringArray(conditions, "condition")}`);
733
+ if (external) for (let name of external) flags.push(`--external:${validateStringValue(name, "external")}`);
734
+ if (alias) {
735
+ for (let old in alias) {
736
+ if (old.indexOf("=") >= 0) throw new Error(`Invalid package name in alias: ${old}`);
737
+ flags.push(`--alias:${old}=${validateStringValue(alias[old], "alias", old)}`);
738
+ }
739
+ }
740
+ if (banner) {
741
+ for (let type in banner) {
742
+ if (type.indexOf("=") >= 0) throw new Error(`Invalid banner file type: ${type}`);
743
+ flags.push(`--banner:${type}=${validateStringValue(banner[type], "banner", type)}`);
744
+ }
745
+ }
746
+ if (footer) {
747
+ for (let type in footer) {
748
+ if (type.indexOf("=") >= 0) throw new Error(`Invalid footer file type: ${type}`);
749
+ flags.push(`--footer:${type}=${validateStringValue(footer[type], "footer", type)}`);
750
+ }
751
+ }
752
+ if (inject) for (let path3 of inject) flags.push(`--inject:${validateStringValue(path3, "inject")}`);
753
+ if (loader) {
754
+ for (let ext in loader) {
755
+ if (ext.indexOf("=") >= 0) throw new Error(`Invalid loader extension: ${ext}`);
756
+ flags.push(`--loader:${ext}=${validateStringValue(loader[ext], "loader", ext)}`);
757
+ }
758
+ }
759
+ if (outExtension) {
760
+ for (let ext in outExtension) {
761
+ if (ext.indexOf("=") >= 0) throw new Error(`Invalid out extension: ${ext}`);
762
+ flags.push(`--out-extension:${ext}=${validateStringValue(outExtension[ext], "out extension", ext)}`);
763
+ }
764
+ }
765
+ if (entryPoints) {
766
+ if (Array.isArray(entryPoints)) {
767
+ for (let i = 0, n = entryPoints.length; i < n; i++) {
768
+ let entryPoint = entryPoints[i];
769
+ if (typeof entryPoint === "object" && entryPoint !== null) {
770
+ let entryPointKeys = /* @__PURE__ */ Object.create(null);
771
+ let input = getFlag(entryPoint, entryPointKeys, "in", mustBeString);
772
+ let output = getFlag(entryPoint, entryPointKeys, "out", mustBeString);
773
+ checkForInvalidFlags(entryPoint, entryPointKeys, "in entry point at index " + i);
774
+ if (input === void 0) throw new Error('Missing property "in" for entry point at index ' + i);
775
+ if (output === void 0) throw new Error('Missing property "out" for entry point at index ' + i);
776
+ entries.push([output, input]);
777
+ } else {
778
+ entries.push(["", validateStringValue(entryPoint, "entry point at index " + i)]);
779
+ }
780
+ }
781
+ } else {
782
+ for (let key in entryPoints) {
783
+ entries.push([key, validateStringValue(entryPoints[key], "entry point", key)]);
784
+ }
785
+ }
786
+ }
787
+ if (stdin) {
788
+ let stdinKeys = /* @__PURE__ */ Object.create(null);
789
+ let contents = getFlag(stdin, stdinKeys, "contents", mustBeStringOrUint8Array);
790
+ let resolveDir = getFlag(stdin, stdinKeys, "resolveDir", mustBeString);
791
+ let sourcefile = getFlag(stdin, stdinKeys, "sourcefile", mustBeString);
792
+ let loader2 = getFlag(stdin, stdinKeys, "loader", mustBeString);
793
+ checkForInvalidFlags(stdin, stdinKeys, 'in "stdin" object');
794
+ if (sourcefile) flags.push(`--sourcefile=${sourcefile}`);
795
+ if (loader2) flags.push(`--loader=${loader2}`);
796
+ if (resolveDir) stdinResolveDir = resolveDir;
797
+ if (typeof contents === "string") stdinContents = encodeUTF8(contents);
798
+ else if (contents instanceof Uint8Array) stdinContents = contents;
799
+ }
800
+ let nodePaths = [];
801
+ if (nodePathsInput) {
802
+ for (let value of nodePathsInput) {
803
+ value += "";
804
+ nodePaths.push(value);
805
+ }
806
+ }
807
+ return {
808
+ entries,
809
+ flags,
810
+ write,
811
+ stdinContents,
812
+ stdinResolveDir,
813
+ absWorkingDir,
814
+ nodePaths,
815
+ mangleCache: validateMangleCache(mangleCache)
816
+ };
817
+ }
818
+ function flagsForTransformOptions(callName, options, isTTY2, logLevelDefault) {
819
+ let flags = [];
820
+ let keys = /* @__PURE__ */ Object.create(null);
821
+ pushLogFlags(flags, options, keys, isTTY2, logLevelDefault);
822
+ pushCommonFlags(flags, options, keys);
823
+ let sourcemap = getFlag(options, keys, "sourcemap", mustBeStringOrBoolean);
824
+ let sourcefile = getFlag(options, keys, "sourcefile", mustBeString);
825
+ let loader = getFlag(options, keys, "loader", mustBeString);
826
+ let banner = getFlag(options, keys, "banner", mustBeString);
827
+ let footer = getFlag(options, keys, "footer", mustBeString);
828
+ let mangleCache = getFlag(options, keys, "mangleCache", mustBeObject);
829
+ checkForInvalidFlags(options, keys, `in ${callName}() call`);
830
+ if (sourcemap) flags.push(`--sourcemap=${sourcemap === true ? "external" : sourcemap}`);
831
+ if (sourcefile) flags.push(`--sourcefile=${sourcefile}`);
832
+ if (loader) flags.push(`--loader=${loader}`);
833
+ if (banner) flags.push(`--banner=${banner}`);
834
+ if (footer) flags.push(`--footer=${footer}`);
835
+ return {
836
+ flags,
837
+ mangleCache: validateMangleCache(mangleCache)
838
+ };
839
+ }
840
+ function createChannel(streamIn) {
841
+ const requestCallbacksByKey = {};
842
+ const closeData = { didClose: false, reason: "" };
843
+ let responseCallbacks = {};
844
+ let nextRequestID = 0;
845
+ let nextBuildKey = 0;
846
+ let stdout = new Uint8Array(16 * 1024);
847
+ let stdoutUsed = 0;
848
+ let readFromStdout = (chunk) => {
849
+ let limit = stdoutUsed + chunk.length;
850
+ if (limit > stdout.length) {
851
+ let swap = new Uint8Array(limit * 2);
852
+ swap.set(stdout);
853
+ stdout = swap;
854
+ }
855
+ stdout.set(chunk, stdoutUsed);
856
+ stdoutUsed += chunk.length;
857
+ let offset = 0;
858
+ while (offset + 4 <= stdoutUsed) {
859
+ let length = readUInt32LE(stdout, offset);
860
+ if (offset + 4 + length > stdoutUsed) {
861
+ break;
862
+ }
863
+ offset += 4;
864
+ handleIncomingPacket(stdout.subarray(offset, offset + length));
865
+ offset += length;
866
+ }
867
+ if (offset > 0) {
868
+ stdout.copyWithin(0, offset, stdoutUsed);
869
+ stdoutUsed -= offset;
870
+ }
871
+ };
872
+ let afterClose = (error) => {
873
+ closeData.didClose = true;
874
+ if (error) closeData.reason = ": " + (error.message || error);
875
+ const text = "The service was stopped" + closeData.reason;
876
+ for (let id in responseCallbacks) {
877
+ responseCallbacks[id](text, null);
878
+ }
879
+ responseCallbacks = {};
880
+ };
881
+ let sendRequest = (refs, value, callback) => {
882
+ if (closeData.didClose) return callback("The service is no longer running" + closeData.reason, null);
883
+ let id = nextRequestID++;
884
+ responseCallbacks[id] = (error, response) => {
885
+ try {
886
+ callback(error, response);
887
+ } finally {
888
+ if (refs) refs.unref();
889
+ }
890
+ };
891
+ if (refs) refs.ref();
892
+ streamIn.writeToStdin(encodePacket({ id, isRequest: true, value }));
893
+ };
894
+ let sendResponse = (id, value) => {
895
+ if (closeData.didClose) throw new Error("The service is no longer running" + closeData.reason);
896
+ streamIn.writeToStdin(encodePacket({ id, isRequest: false, value }));
897
+ };
898
+ let handleRequest = async (id, request) => {
899
+ try {
900
+ if (request.command === "ping") {
901
+ sendResponse(id, {});
902
+ return;
903
+ }
904
+ if (typeof request.key === "number") {
905
+ const requestCallbacks = requestCallbacksByKey[request.key];
906
+ if (!requestCallbacks) {
907
+ return;
908
+ }
909
+ const callback = requestCallbacks[request.command];
910
+ if (callback) {
911
+ await callback(id, request);
912
+ return;
913
+ }
914
+ }
915
+ throw new Error(`Invalid command: ` + request.command);
916
+ } catch (e) {
917
+ const errors = [extractErrorMessageV8(e, streamIn, null, void 0, "")];
918
+ try {
919
+ sendResponse(id, { errors });
920
+ } catch {
921
+ }
922
+ }
923
+ };
924
+ let isFirstPacket = true;
925
+ let handleIncomingPacket = (bytes) => {
926
+ if (isFirstPacket) {
927
+ isFirstPacket = false;
928
+ let binaryVersion = String.fromCharCode(...bytes);
929
+ if (binaryVersion !== "0.28.2") {
930
+ throw new Error(`Cannot start service: Host version "${"0.28.2"}" does not match binary version ${quote(binaryVersion)}`);
931
+ }
932
+ return;
933
+ }
934
+ let packet = decodePacket(bytes);
935
+ if (packet.isRequest) {
936
+ handleRequest(packet.id, packet.value);
937
+ } else {
938
+ let callback = responseCallbacks[packet.id];
939
+ delete responseCallbacks[packet.id];
940
+ if (packet.value.error) callback(packet.value.error, {});
941
+ else callback(null, packet.value);
942
+ }
943
+ };
944
+ let buildOrContext = ({ callName, refs, options, isTTY: isTTY2, defaultWD: defaultWD2, callback }) => {
945
+ let refCount = 0;
946
+ const buildKey = nextBuildKey++;
947
+ const requestCallbacks = {};
948
+ const buildRefs = {
949
+ ref() {
950
+ if (++refCount === 1) {
951
+ if (refs) refs.ref();
952
+ }
953
+ },
954
+ unref() {
955
+ if (--refCount === 0) {
956
+ delete requestCallbacksByKey[buildKey];
957
+ if (refs) refs.unref();
958
+ }
959
+ }
960
+ };
961
+ requestCallbacksByKey[buildKey] = requestCallbacks;
962
+ buildRefs.ref();
963
+ buildOrContextImpl(
964
+ callName,
965
+ buildKey,
966
+ sendRequest,
967
+ sendResponse,
968
+ buildRefs,
969
+ streamIn,
970
+ requestCallbacks,
971
+ options,
972
+ isTTY2,
973
+ defaultWD2,
974
+ (err, res) => {
975
+ try {
976
+ callback(err, res);
977
+ } finally {
978
+ buildRefs.unref();
979
+ }
980
+ }
981
+ );
982
+ };
983
+ let transform2 = ({ callName, refs, input, options, isTTY: isTTY2, fs: fs3, callback }) => {
984
+ const details = createObjectStash();
985
+ let start = (inputPath) => {
986
+ try {
987
+ if (typeof input !== "string" && !(input instanceof Uint8Array))
988
+ throw new Error('The input to "transform" must be a string or a Uint8Array');
989
+ let {
990
+ flags,
991
+ mangleCache
992
+ } = flagsForTransformOptions(callName, options, isTTY2, transformLogLevelDefault);
993
+ let request = {
994
+ command: "transform",
995
+ flags,
996
+ inputFS: inputPath !== null,
997
+ input: inputPath !== null ? encodeUTF8(inputPath) : typeof input === "string" ? encodeUTF8(input) : input
998
+ };
999
+ if (mangleCache) request.mangleCache = mangleCache;
1000
+ sendRequest(refs, request, (error, response) => {
1001
+ if (error) return callback(new Error(error), null);
1002
+ let errors = replaceDetailsInMessages(response.errors, details);
1003
+ let warnings = replaceDetailsInMessages(response.warnings, details);
1004
+ let outstanding = 1;
1005
+ let next = () => {
1006
+ if (--outstanding === 0) {
1007
+ let result = {
1008
+ warnings,
1009
+ code: response.code,
1010
+ map: response.map,
1011
+ mangleCache: void 0,
1012
+ legalComments: void 0
1013
+ };
1014
+ if ("legalComments" in response) result.legalComments = response == null ? void 0 : response.legalComments;
1015
+ if (response.mangleCache) result.mangleCache = response == null ? void 0 : response.mangleCache;
1016
+ callback(null, result);
1017
+ }
1018
+ };
1019
+ if (errors.length > 0) return callback(failureErrorWithLog("Transform failed", errors, warnings), null);
1020
+ if (response.codeFS) {
1021
+ outstanding++;
1022
+ fs3.readFile(response.code, (err, contents) => {
1023
+ if (err !== null) {
1024
+ callback(err, null);
1025
+ } else {
1026
+ response.code = contents;
1027
+ next();
1028
+ }
1029
+ });
1030
+ }
1031
+ if (response.mapFS) {
1032
+ outstanding++;
1033
+ fs3.readFile(response.map, (err, contents) => {
1034
+ if (err !== null) {
1035
+ callback(err, null);
1036
+ } else {
1037
+ response.map = contents;
1038
+ next();
1039
+ }
1040
+ });
1041
+ }
1042
+ next();
1043
+ });
1044
+ } catch (e) {
1045
+ let flags = [];
1046
+ try {
1047
+ pushLogFlags(flags, options, {}, isTTY2, transformLogLevelDefault);
1048
+ } catch {
1049
+ }
1050
+ const error = extractErrorMessageV8(e, streamIn, details, void 0, "");
1051
+ sendRequest(refs, { command: "error", flags, error }, () => {
1052
+ error.detail = details.load(error.detail);
1053
+ callback(failureErrorWithLog("Transform failed", [error], []), null);
1054
+ });
1055
+ }
1056
+ };
1057
+ if ((typeof input === "string" || input instanceof Uint8Array) && input.length > 1024 * 1024) {
1058
+ let next = start;
1059
+ start = () => fs3.writeFile(input, next);
1060
+ }
1061
+ start(null);
1062
+ };
1063
+ let formatMessages2 = ({ callName, refs, messages, options, callback }) => {
1064
+ if (!options) throw new Error(`Missing second argument in ${callName}() call`);
1065
+ let keys = {};
1066
+ let kind = getFlag(options, keys, "kind", mustBeString);
1067
+ let color = getFlag(options, keys, "color", mustBeBoolean);
1068
+ let terminalWidth = getFlag(options, keys, "terminalWidth", mustBeInteger);
1069
+ let logStyle = getFlag(options, keys, "logStyle", mustBeString);
1070
+ checkForInvalidFlags(options, keys, `in ${callName}() call`);
1071
+ if (kind === void 0) throw new Error(`Missing "kind" in ${callName}() call`);
1072
+ if (kind !== "error" && kind !== "warning") throw new Error(`Expected "kind" to be "error" or "warning" in ${callName}() call`);
1073
+ let request = {
1074
+ command: "format-msgs",
1075
+ messages: sanitizeMessages(messages, "messages", null, "", terminalWidth),
1076
+ isWarning: kind === "warning"
1077
+ };
1078
+ if (color !== void 0) request.color = color;
1079
+ if (terminalWidth !== void 0) request.terminalWidth = terminalWidth;
1080
+ if (logStyle !== void 0) request.logStyle = logStyle;
1081
+ sendRequest(refs, request, (error, response) => {
1082
+ if (error) return callback(new Error(error), null);
1083
+ callback(null, response.messages);
1084
+ });
1085
+ };
1086
+ let analyzeMetafile2 = ({ callName, refs, metafile, options, callback }) => {
1087
+ if (options === void 0) options = {};
1088
+ let keys = {};
1089
+ let color = getFlag(options, keys, "color", mustBeBoolean);
1090
+ let verbose = getFlag(options, keys, "verbose", mustBeBoolean);
1091
+ checkForInvalidFlags(options, keys, `in ${callName}() call`);
1092
+ let request = {
1093
+ command: "analyze-metafile",
1094
+ metafile
1095
+ };
1096
+ if (color !== void 0) request.color = color;
1097
+ if (verbose !== void 0) request.verbose = verbose;
1098
+ sendRequest(refs, request, (error, response) => {
1099
+ if (error) return callback(new Error(error), null);
1100
+ callback(null, response.result);
1101
+ });
1102
+ };
1103
+ return {
1104
+ readFromStdout,
1105
+ afterClose,
1106
+ service: {
1107
+ buildOrContext,
1108
+ transform: transform2,
1109
+ formatMessages: formatMessages2,
1110
+ analyzeMetafile: analyzeMetafile2
1111
+ }
1112
+ };
1113
+ }
1114
+ function buildOrContextImpl(callName, buildKey, sendRequest, sendResponse, refs, streamIn, requestCallbacks, options, isTTY2, defaultWD2, callback) {
1115
+ const details = createObjectStash();
1116
+ const isContext = callName === "context";
1117
+ const handleError = (e, pluginName) => {
1118
+ const flags = [];
1119
+ try {
1120
+ pushLogFlags(flags, options, {}, isTTY2, buildLogLevelDefault);
1121
+ } catch {
1122
+ }
1123
+ const message = extractErrorMessageV8(e, streamIn, details, void 0, pluginName);
1124
+ sendRequest(refs, { command: "error", flags, error: message }, () => {
1125
+ message.detail = details.load(message.detail);
1126
+ callback(failureErrorWithLog(isContext ? "Context failed" : "Build failed", [message], []), null);
1127
+ });
1128
+ };
1129
+ let plugins;
1130
+ if (typeof options === "object") {
1131
+ const value = options.plugins;
1132
+ if (value !== void 0) {
1133
+ if (!Array.isArray(value)) return handleError(new Error(`"plugins" must be an array`), "");
1134
+ plugins = value;
1135
+ }
1136
+ }
1137
+ if (plugins && plugins.length > 0) {
1138
+ if (streamIn.isSync) return handleError(new Error("Cannot use plugins in synchronous API calls"), "");
1139
+ handlePlugins(
1140
+ buildKey,
1141
+ sendRequest,
1142
+ sendResponse,
1143
+ refs,
1144
+ streamIn,
1145
+ requestCallbacks,
1146
+ options,
1147
+ plugins,
1148
+ details
1149
+ ).then(
1150
+ (result) => {
1151
+ if (!result.ok) return handleError(result.error, result.pluginName);
1152
+ try {
1153
+ buildOrContextContinue(result.requestPlugins, result.runOnEndCallbacks, result.scheduleOnDisposeCallbacks);
1154
+ } catch (e) {
1155
+ handleError(e, "");
1156
+ }
1157
+ },
1158
+ (e) => handleError(e, "")
1159
+ );
1160
+ return;
1161
+ }
1162
+ try {
1163
+ buildOrContextContinue(null, (result, done) => done([], []), () => {
1164
+ });
1165
+ } catch (e) {
1166
+ handleError(e, "");
1167
+ }
1168
+ function buildOrContextContinue(requestPlugins, runOnEndCallbacks, scheduleOnDisposeCallbacks) {
1169
+ const writeDefault = streamIn.hasFS;
1170
+ const {
1171
+ entries,
1172
+ flags,
1173
+ write,
1174
+ stdinContents,
1175
+ stdinResolveDir,
1176
+ absWorkingDir,
1177
+ nodePaths,
1178
+ mangleCache
1179
+ } = flagsForBuildOptions(callName, options, isTTY2, buildLogLevelDefault, writeDefault);
1180
+ if (write && !streamIn.hasFS) throw new Error(`The "write" option is unavailable in this environment`);
1181
+ const request = {
1182
+ command: "build",
1183
+ key: buildKey,
1184
+ entries,
1185
+ flags,
1186
+ write,
1187
+ stdinContents,
1188
+ stdinResolveDir,
1189
+ absWorkingDir: absWorkingDir || defaultWD2,
1190
+ nodePaths,
1191
+ context: isContext
1192
+ };
1193
+ if (requestPlugins) request.plugins = requestPlugins;
1194
+ if (mangleCache) request.mangleCache = mangleCache;
1195
+ const buildResponseToResult = (response, callback2) => {
1196
+ const result = {
1197
+ errors: replaceDetailsInMessages(response.errors, details),
1198
+ warnings: replaceDetailsInMessages(response.warnings, details),
1199
+ outputFiles: void 0,
1200
+ metafile: void 0,
1201
+ mangleCache: void 0
1202
+ };
1203
+ const originalErrors = result.errors.slice();
1204
+ const originalWarnings = result.warnings.slice();
1205
+ if (response.outputFiles) result.outputFiles = response.outputFiles.map(convertOutputFiles);
1206
+ if (response.metafile && response.metafile.length) result.metafile = parseJSON(response.metafile);
1207
+ if (response.mangleCache) result.mangleCache = response.mangleCache;
1208
+ if (response.writeToStdout !== void 0) console.log(decodeUTF8(response.writeToStdout).replace(/\n$/, ""));
1209
+ runOnEndCallbacks(result, (onEndErrors, onEndWarnings) => {
1210
+ if (originalErrors.length > 0 || onEndErrors.length > 0) {
1211
+ const error = failureErrorWithLog("Build failed", originalErrors.concat(onEndErrors), originalWarnings.concat(onEndWarnings));
1212
+ return callback2(error, null, onEndErrors, onEndWarnings);
1213
+ }
1214
+ callback2(null, result, onEndErrors, onEndWarnings);
1215
+ });
1216
+ };
1217
+ let latestResultPromise;
1218
+ let provideLatestResult;
1219
+ if (isContext)
1220
+ requestCallbacks["on-end"] = (id, request2) => new Promise((resolve) => {
1221
+ buildResponseToResult(request2, (err, result, onEndErrors, onEndWarnings) => {
1222
+ const response = {
1223
+ errors: onEndErrors,
1224
+ warnings: onEndWarnings
1225
+ };
1226
+ if (provideLatestResult) provideLatestResult(err, result);
1227
+ latestResultPromise = void 0;
1228
+ provideLatestResult = void 0;
1229
+ sendResponse(id, response);
1230
+ resolve();
1231
+ });
1232
+ });
1233
+ sendRequest(refs, request, (error, response) => {
1234
+ if (error) return callback(new Error(error), null);
1235
+ if (!isContext) {
1236
+ return buildResponseToResult(response, (err, res) => {
1237
+ scheduleOnDisposeCallbacks();
1238
+ return callback(err, res);
1239
+ });
1240
+ }
1241
+ if (response.errors.length > 0) {
1242
+ return callback(failureErrorWithLog("Context failed", response.errors, response.warnings), null);
1243
+ }
1244
+ let didDispose = false;
1245
+ const result = {
1246
+ rebuild: () => {
1247
+ if (!latestResultPromise) latestResultPromise = new Promise((resolve, reject) => {
1248
+ let settlePromise;
1249
+ provideLatestResult = (err, result2) => {
1250
+ if (!settlePromise) settlePromise = () => err ? reject(err) : resolve(result2);
1251
+ };
1252
+ const triggerAnotherBuild = () => {
1253
+ const request2 = {
1254
+ command: "rebuild",
1255
+ key: buildKey
1256
+ };
1257
+ sendRequest(refs, request2, (error2, response2) => {
1258
+ if (error2) {
1259
+ reject(new Error(error2));
1260
+ } else if (settlePromise) {
1261
+ settlePromise();
1262
+ } else {
1263
+ triggerAnotherBuild();
1264
+ }
1265
+ });
1266
+ };
1267
+ triggerAnotherBuild();
1268
+ });
1269
+ return latestResultPromise;
1270
+ },
1271
+ watch: (options2 = {}) => new Promise((resolve, reject) => {
1272
+ if (!streamIn.hasFS) throw new Error(`Cannot use the "watch" API in this environment`);
1273
+ const keys = {};
1274
+ const delay = getFlag(options2, keys, "delay", mustBeInteger);
1275
+ checkForInvalidFlags(options2, keys, `in watch() call`);
1276
+ const request2 = {
1277
+ command: "watch",
1278
+ key: buildKey
1279
+ };
1280
+ if (delay) request2.delay = delay;
1281
+ sendRequest(refs, request2, (error2) => {
1282
+ if (error2) reject(new Error(error2));
1283
+ else resolve(void 0);
1284
+ });
1285
+ }),
1286
+ serve: (options2 = {}) => new Promise((resolve, reject) => {
1287
+ if (!streamIn.hasFS) throw new Error(`Cannot use the "serve" API in this environment`);
1288
+ const keys = {};
1289
+ const port = getFlag(options2, keys, "port", mustBeValidPortNumber);
1290
+ const host = getFlag(options2, keys, "host", mustBeString);
1291
+ const servedir = getFlag(options2, keys, "servedir", mustBeString);
1292
+ const keyfile = getFlag(options2, keys, "keyfile", mustBeString);
1293
+ const certfile = getFlag(options2, keys, "certfile", mustBeString);
1294
+ const fallback = getFlag(options2, keys, "fallback", mustBeString);
1295
+ const cors = getFlag(options2, keys, "cors", mustBeObject);
1296
+ const onRequest = getFlag(options2, keys, "onRequest", mustBeFunction);
1297
+ checkForInvalidFlags(options2, keys, `in serve() call`);
1298
+ const request2 = {
1299
+ command: "serve",
1300
+ key: buildKey,
1301
+ onRequest: !!onRequest
1302
+ };
1303
+ if (port !== void 0) request2.port = port;
1304
+ if (host !== void 0) request2.host = host;
1305
+ if (servedir !== void 0) request2.servedir = servedir;
1306
+ if (keyfile !== void 0) request2.keyfile = keyfile;
1307
+ if (certfile !== void 0) request2.certfile = certfile;
1308
+ if (fallback !== void 0) request2.fallback = fallback;
1309
+ if (cors) {
1310
+ const corsKeys = {};
1311
+ const origin = getFlag(cors, corsKeys, "origin", mustBeStringOrArrayOfStrings);
1312
+ checkForInvalidFlags(cors, corsKeys, `on "cors" object`);
1313
+ if (Array.isArray(origin)) request2.corsOrigin = origin;
1314
+ else if (origin !== void 0) request2.corsOrigin = [origin];
1315
+ }
1316
+ sendRequest(refs, request2, (error2, response2) => {
1317
+ if (error2) return reject(new Error(error2));
1318
+ if (onRequest) {
1319
+ requestCallbacks["serve-request"] = (id, request3) => {
1320
+ onRequest(request3.args);
1321
+ sendResponse(id, {});
1322
+ };
1323
+ }
1324
+ resolve(response2);
1325
+ });
1326
+ }),
1327
+ cancel: () => new Promise((resolve) => {
1328
+ if (didDispose) return resolve();
1329
+ const request2 = {
1330
+ command: "cancel",
1331
+ key: buildKey
1332
+ };
1333
+ sendRequest(refs, request2, () => {
1334
+ resolve();
1335
+ });
1336
+ }),
1337
+ dispose: () => new Promise((resolve) => {
1338
+ if (didDispose) return resolve();
1339
+ didDispose = true;
1340
+ const request2 = {
1341
+ command: "dispose",
1342
+ key: buildKey
1343
+ };
1344
+ sendRequest(refs, request2, () => {
1345
+ resolve();
1346
+ scheduleOnDisposeCallbacks();
1347
+ refs.unref();
1348
+ });
1349
+ })
1350
+ };
1351
+ refs.ref();
1352
+ callback(null, result);
1353
+ });
1354
+ }
1355
+ }
1356
+ var handlePlugins = async (buildKey, sendRequest, sendResponse, refs, streamIn, requestCallbacks, initialOptions, plugins, details) => {
1357
+ let onStartCallbacks = [];
1358
+ let onEndCallbacks = [];
1359
+ let onResolveCallbacks = {};
1360
+ let onLoadCallbacks = {};
1361
+ let onDisposeCallbacks = [];
1362
+ let nextCallbackID = 0;
1363
+ let i = 0;
1364
+ let requestPlugins = [];
1365
+ let isSetupDone = false;
1366
+ plugins = [...plugins];
1367
+ for (let item of plugins) {
1368
+ let keys = {};
1369
+ if (typeof item !== "object") throw new Error(`Plugin at index ${i} must be an object`);
1370
+ const name = getFlag(item, keys, "name", mustBeString);
1371
+ if (typeof name !== "string" || name === "") throw new Error(`Plugin at index ${i} is missing a name`);
1372
+ try {
1373
+ let setup = getFlag(item, keys, "setup", mustBeFunction);
1374
+ if (typeof setup !== "function") throw new Error(`Plugin is missing a setup function`);
1375
+ checkForInvalidFlags(item, keys, `on plugin ${quote(name)}`);
1376
+ let plugin = {
1377
+ name,
1378
+ onStart: false,
1379
+ onEnd: false,
1380
+ onResolve: [],
1381
+ onLoad: []
1382
+ };
1383
+ i++;
1384
+ let resolve = (path3, options = {}) => {
1385
+ if (!isSetupDone) throw new Error('Cannot call "resolve" before plugin setup has completed');
1386
+ if (typeof path3 !== "string") throw new Error(`The path to resolve must be a string`);
1387
+ let keys2 = /* @__PURE__ */ Object.create(null);
1388
+ let pluginName = getFlag(options, keys2, "pluginName", mustBeString);
1389
+ let importer = getFlag(options, keys2, "importer", mustBeString);
1390
+ let namespace = getFlag(options, keys2, "namespace", mustBeString);
1391
+ let resolveDir = getFlag(options, keys2, "resolveDir", mustBeString);
1392
+ let kind = getFlag(options, keys2, "kind", mustBeString);
1393
+ let pluginData = getFlag(options, keys2, "pluginData", canBeAnything);
1394
+ let importAttributes = getFlag(options, keys2, "with", mustBeObject);
1395
+ checkForInvalidFlags(options, keys2, "in resolve() call");
1396
+ return new Promise((resolve2, reject) => {
1397
+ const request = {
1398
+ command: "resolve",
1399
+ path: path3,
1400
+ key: buildKey,
1401
+ pluginName: name
1402
+ };
1403
+ if (pluginName != null) request.pluginName = pluginName;
1404
+ if (importer != null) request.importer = importer;
1405
+ if (namespace != null) request.namespace = namespace;
1406
+ if (resolveDir != null) request.resolveDir = resolveDir;
1407
+ if (kind != null) request.kind = kind;
1408
+ else throw new Error(`Must specify "kind" when calling "resolve"`);
1409
+ if (pluginData != null) request.pluginData = details.store(pluginData);
1410
+ if (importAttributes != null) request.with = sanitizeStringMap(importAttributes, "with");
1411
+ sendRequest(refs, request, (error, response) => {
1412
+ if (error !== null) reject(new Error(error));
1413
+ else resolve2({
1414
+ errors: replaceDetailsInMessages(response.errors, details),
1415
+ warnings: replaceDetailsInMessages(response.warnings, details),
1416
+ path: response.path,
1417
+ external: response.external,
1418
+ sideEffects: response.sideEffects,
1419
+ namespace: response.namespace,
1420
+ suffix: response.suffix,
1421
+ pluginData: details.load(response.pluginData)
1422
+ });
1423
+ });
1424
+ });
1425
+ };
1426
+ let promise = setup({
1427
+ initialOptions,
1428
+ resolve,
1429
+ onStart(callback) {
1430
+ let registeredText = `This error came from the "onStart" callback registered here:`;
1431
+ let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onStart");
1432
+ onStartCallbacks.push({ name, callback, note: registeredNote });
1433
+ plugin.onStart = true;
1434
+ },
1435
+ onEnd(callback) {
1436
+ let registeredText = `This error came from the "onEnd" callback registered here:`;
1437
+ let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onEnd");
1438
+ onEndCallbacks.push({ name, callback, note: registeredNote });
1439
+ plugin.onEnd = true;
1440
+ },
1441
+ onResolve(options, callback) {
1442
+ let registeredText = `This error came from the "onResolve" callback registered here:`;
1443
+ let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onResolve");
1444
+ let keys2 = {};
1445
+ let filter = getFlag(options, keys2, "filter", mustBeRegExp);
1446
+ let namespace = getFlag(options, keys2, "namespace", mustBeString);
1447
+ checkForInvalidFlags(options, keys2, `in onResolve() call for plugin ${quote(name)}`);
1448
+ if (filter == null) throw new Error(`onResolve() call is missing a filter`);
1449
+ let id = nextCallbackID++;
1450
+ onResolveCallbacks[id] = { name, callback, note: registeredNote };
1451
+ plugin.onResolve.push({ id, filter: jsRegExpToGoRegExp(filter), namespace: namespace || "" });
1452
+ },
1453
+ onLoad(options, callback) {
1454
+ let registeredText = `This error came from the "onLoad" callback registered here:`;
1455
+ let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onLoad");
1456
+ let keys2 = {};
1457
+ let filter = getFlag(options, keys2, "filter", mustBeRegExp);
1458
+ let namespace = getFlag(options, keys2, "namespace", mustBeString);
1459
+ checkForInvalidFlags(options, keys2, `in onLoad() call for plugin ${quote(name)}`);
1460
+ if (filter == null) throw new Error(`onLoad() call is missing a filter`);
1461
+ let id = nextCallbackID++;
1462
+ onLoadCallbacks[id] = { name, callback, note: registeredNote };
1463
+ plugin.onLoad.push({ id, filter: jsRegExpToGoRegExp(filter), namespace: namespace || "" });
1464
+ },
1465
+ onDispose(callback) {
1466
+ onDisposeCallbacks.push(callback);
1467
+ },
1468
+ esbuild: streamIn.esbuild
1469
+ });
1470
+ if (promise) await promise;
1471
+ requestPlugins.push(plugin);
1472
+ } catch (e) {
1473
+ return { ok: false, error: e, pluginName: name };
1474
+ }
1475
+ }
1476
+ requestCallbacks["on-start"] = async (id, request) => {
1477
+ details.clear();
1478
+ let response = { errors: [], warnings: [] };
1479
+ await Promise.all(onStartCallbacks.map(async ({ name, callback, note }) => {
1480
+ try {
1481
+ let result = await callback();
1482
+ if (result != null) {
1483
+ if (typeof result !== "object") throw new Error(`Expected onStart() callback in plugin ${quote(name)} to return an object`);
1484
+ let keys = {};
1485
+ let errors = getFlag(result, keys, "errors", mustBeArray);
1486
+ let warnings = getFlag(result, keys, "warnings", mustBeArray);
1487
+ checkForInvalidFlags(result, keys, `from onStart() callback in plugin ${quote(name)}`);
1488
+ if (errors != null) response.errors.push(...sanitizeMessages(errors, "errors", details, name, void 0));
1489
+ if (warnings != null) response.warnings.push(...sanitizeMessages(warnings, "warnings", details, name, void 0));
1490
+ }
1491
+ } catch (e) {
1492
+ response.errors.push(extractErrorMessageV8(e, streamIn, details, note && note(), name));
1493
+ }
1494
+ }));
1495
+ sendResponse(id, response);
1496
+ };
1497
+ requestCallbacks["on-resolve"] = async (id, request) => {
1498
+ let response = {}, name = "", callback, note;
1499
+ for (let id2 of request.ids) {
1500
+ try {
1501
+ ({ name, callback, note } = onResolveCallbacks[id2]);
1502
+ let result = await callback({
1503
+ path: request.path,
1504
+ importer: request.importer,
1505
+ namespace: request.namespace,
1506
+ resolveDir: request.resolveDir,
1507
+ kind: request.kind,
1508
+ pluginData: details.load(request.pluginData),
1509
+ with: request.with
1510
+ });
1511
+ if (result != null) {
1512
+ if (typeof result !== "object") throw new Error(`Expected onResolve() callback in plugin ${quote(name)} to return an object`);
1513
+ let keys = {};
1514
+ let pluginName = getFlag(result, keys, "pluginName", mustBeString);
1515
+ let path3 = getFlag(result, keys, "path", mustBeString);
1516
+ let namespace = getFlag(result, keys, "namespace", mustBeString);
1517
+ let suffix = getFlag(result, keys, "suffix", mustBeString);
1518
+ let external = getFlag(result, keys, "external", mustBeBoolean);
1519
+ let sideEffects = getFlag(result, keys, "sideEffects", mustBeBoolean);
1520
+ let pluginData = getFlag(result, keys, "pluginData", canBeAnything);
1521
+ let errors = getFlag(result, keys, "errors", mustBeArray);
1522
+ let warnings = getFlag(result, keys, "warnings", mustBeArray);
1523
+ let watchFiles = getFlag(result, keys, "watchFiles", mustBeArrayOfStrings);
1524
+ let watchDirs = getFlag(result, keys, "watchDirs", mustBeArrayOfStrings);
1525
+ checkForInvalidFlags(result, keys, `from onResolve() callback in plugin ${quote(name)}`);
1526
+ response.id = id2;
1527
+ if (pluginName != null) response.pluginName = pluginName;
1528
+ if (path3 != null) response.path = path3;
1529
+ if (namespace != null) response.namespace = namespace;
1530
+ if (suffix != null) response.suffix = suffix;
1531
+ if (external != null) response.external = external;
1532
+ if (sideEffects != null) response.sideEffects = sideEffects;
1533
+ if (pluginData != null) response.pluginData = details.store(pluginData);
1534
+ if (errors != null) response.errors = sanitizeMessages(errors, "errors", details, name, void 0);
1535
+ if (warnings != null) response.warnings = sanitizeMessages(warnings, "warnings", details, name, void 0);
1536
+ if (watchFiles != null) response.watchFiles = sanitizeStringArray(watchFiles, "watchFiles");
1537
+ if (watchDirs != null) response.watchDirs = sanitizeStringArray(watchDirs, "watchDirs");
1538
+ break;
1539
+ }
1540
+ } catch (e) {
1541
+ response = { id: id2, errors: [extractErrorMessageV8(e, streamIn, details, note && note(), name)] };
1542
+ break;
1543
+ }
1544
+ }
1545
+ sendResponse(id, response);
1546
+ };
1547
+ requestCallbacks["on-load"] = async (id, request) => {
1548
+ let response = {}, name = "", callback, note;
1549
+ for (let id2 of request.ids) {
1550
+ try {
1551
+ ({ name, callback, note } = onLoadCallbacks[id2]);
1552
+ let result = await callback({
1553
+ path: request.path,
1554
+ namespace: request.namespace,
1555
+ suffix: request.suffix,
1556
+ pluginData: details.load(request.pluginData),
1557
+ with: request.with
1558
+ });
1559
+ if (result != null) {
1560
+ if (typeof result !== "object") throw new Error(`Expected onLoad() callback in plugin ${quote(name)} to return an object`);
1561
+ let keys = {};
1562
+ let pluginName = getFlag(result, keys, "pluginName", mustBeString);
1563
+ let contents = getFlag(result, keys, "contents", mustBeStringOrUint8Array);
1564
+ let resolveDir = getFlag(result, keys, "resolveDir", mustBeString);
1565
+ let pluginData = getFlag(result, keys, "pluginData", canBeAnything);
1566
+ let loader = getFlag(result, keys, "loader", mustBeString);
1567
+ let errors = getFlag(result, keys, "errors", mustBeArray);
1568
+ let warnings = getFlag(result, keys, "warnings", mustBeArray);
1569
+ let watchFiles = getFlag(result, keys, "watchFiles", mustBeArrayOfStrings);
1570
+ let watchDirs = getFlag(result, keys, "watchDirs", mustBeArrayOfStrings);
1571
+ checkForInvalidFlags(result, keys, `from onLoad() callback in plugin ${quote(name)}`);
1572
+ response.id = id2;
1573
+ if (pluginName != null) response.pluginName = pluginName;
1574
+ if (contents instanceof Uint8Array) response.contents = contents;
1575
+ else if (contents != null) response.contents = encodeUTF8(contents);
1576
+ if (resolveDir != null) response.resolveDir = resolveDir;
1577
+ if (pluginData != null) response.pluginData = details.store(pluginData);
1578
+ if (loader != null) response.loader = loader;
1579
+ if (errors != null) response.errors = sanitizeMessages(errors, "errors", details, name, void 0);
1580
+ if (warnings != null) response.warnings = sanitizeMessages(warnings, "warnings", details, name, void 0);
1581
+ if (watchFiles != null) response.watchFiles = sanitizeStringArray(watchFiles, "watchFiles");
1582
+ if (watchDirs != null) response.watchDirs = sanitizeStringArray(watchDirs, "watchDirs");
1583
+ break;
1584
+ }
1585
+ } catch (e) {
1586
+ response = { id: id2, errors: [extractErrorMessageV8(e, streamIn, details, note && note(), name)] };
1587
+ break;
1588
+ }
1589
+ }
1590
+ sendResponse(id, response);
1591
+ };
1592
+ let runOnEndCallbacks = (result, done) => done([], []);
1593
+ if (onEndCallbacks.length > 0) {
1594
+ runOnEndCallbacks = (result, done) => {
1595
+ (async () => {
1596
+ const onEndErrors = [];
1597
+ const onEndWarnings = [];
1598
+ for (const { name, callback, note } of onEndCallbacks) {
1599
+ let newErrors;
1600
+ let newWarnings;
1601
+ try {
1602
+ const value = await callback(result);
1603
+ if (value != null) {
1604
+ if (typeof value !== "object") throw new Error(`Expected onEnd() callback in plugin ${quote(name)} to return an object`);
1605
+ let keys = {};
1606
+ let errors = getFlag(value, keys, "errors", mustBeArray);
1607
+ let warnings = getFlag(value, keys, "warnings", mustBeArray);
1608
+ checkForInvalidFlags(value, keys, `from onEnd() callback in plugin ${quote(name)}`);
1609
+ if (errors != null) newErrors = sanitizeMessages(errors, "errors", details, name, void 0);
1610
+ if (warnings != null) newWarnings = sanitizeMessages(warnings, "warnings", details, name, void 0);
1611
+ }
1612
+ } catch (e) {
1613
+ newErrors = [extractErrorMessageV8(e, streamIn, details, note && note(), name)];
1614
+ }
1615
+ if (newErrors) {
1616
+ onEndErrors.push(...newErrors);
1617
+ try {
1618
+ result.errors.push(...newErrors);
1619
+ } catch {
1620
+ }
1621
+ }
1622
+ if (newWarnings) {
1623
+ onEndWarnings.push(...newWarnings);
1624
+ try {
1625
+ result.warnings.push(...newWarnings);
1626
+ } catch {
1627
+ }
1628
+ }
1629
+ }
1630
+ done(onEndErrors, onEndWarnings);
1631
+ })();
1632
+ };
1633
+ }
1634
+ let scheduleOnDisposeCallbacks = () => {
1635
+ for (const cb of onDisposeCallbacks) {
1636
+ setTimeout(() => cb(), 0);
1637
+ }
1638
+ };
1639
+ isSetupDone = true;
1640
+ return {
1641
+ ok: true,
1642
+ requestPlugins,
1643
+ runOnEndCallbacks,
1644
+ scheduleOnDisposeCallbacks
1645
+ };
1646
+ };
1647
+ function createObjectStash() {
1648
+ const map = /* @__PURE__ */ new Map();
1649
+ let nextID = 0;
1650
+ return {
1651
+ clear() {
1652
+ map.clear();
1653
+ },
1654
+ load(id) {
1655
+ return map.get(id);
1656
+ },
1657
+ store(value) {
1658
+ if (value === void 0) return -1;
1659
+ const id = nextID++;
1660
+ map.set(id, value);
1661
+ return id;
1662
+ }
1663
+ };
1664
+ }
1665
+ function extractCallerV8(e, streamIn, ident) {
1666
+ let note;
1667
+ let tried = false;
1668
+ return () => {
1669
+ if (tried) return note;
1670
+ tried = true;
1671
+ try {
1672
+ let lines = (e.stack + "").split("\n");
1673
+ lines.splice(1, 1);
1674
+ let location = parseStackLinesV8(streamIn, lines, ident);
1675
+ if (location) {
1676
+ note = { text: e.message, location };
1677
+ return note;
1678
+ }
1679
+ } catch {
1680
+ }
1681
+ };
1682
+ }
1683
+ function extractErrorMessageV8(e, streamIn, stash, note, pluginName) {
1684
+ let text = "Internal error";
1685
+ let location = null;
1686
+ try {
1687
+ text = (e && e.message || e) + "";
1688
+ } catch {
1689
+ }
1690
+ try {
1691
+ location = parseStackLinesV8(streamIn, (e.stack + "").split("\n"), "");
1692
+ } catch {
1693
+ }
1694
+ return { id: "", pluginName, text, location, notes: note ? [note] : [], detail: stash ? stash.store(e) : -1 };
1695
+ }
1696
+ function parseStackLinesV8(streamIn, lines, ident) {
1697
+ let at = " at ";
1698
+ if (streamIn.readFileSync && !lines[0].startsWith(at) && lines[1].startsWith(at)) {
1699
+ for (let i = 1; i < lines.length; i++) {
1700
+ let line = lines[i];
1701
+ if (!line.startsWith(at)) continue;
1702
+ line = line.slice(at.length);
1703
+ while (true) {
1704
+ let match = /^(?:new |async )?\S+ \((.*)\)$/.exec(line);
1705
+ if (match) {
1706
+ line = match[1];
1707
+ continue;
1708
+ }
1709
+ match = /^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(line);
1710
+ if (match) {
1711
+ line = match[1];
1712
+ continue;
1713
+ }
1714
+ match = /^(\S+):(\d+):(\d+)$/.exec(line);
1715
+ if (match) {
1716
+ let contents;
1717
+ try {
1718
+ contents = streamIn.readFileSync(match[1], "utf8");
1719
+ } catch {
1720
+ break;
1721
+ }
1722
+ let lineText = contents.split(/\r\n|\r|\n|\u2028|\u2029/)[+match[2] - 1] || "";
1723
+ let column = +match[3] - 1;
1724
+ let length = lineText.slice(column, column + ident.length) === ident ? ident.length : 0;
1725
+ return {
1726
+ file: match[1],
1727
+ namespace: "file",
1728
+ line: +match[2],
1729
+ column: encodeUTF8(lineText.slice(0, column)).length,
1730
+ length: encodeUTF8(lineText.slice(column, column + length)).length,
1731
+ lineText: lineText + "\n" + lines.slice(1).join("\n"),
1732
+ suggestion: ""
1733
+ };
1734
+ }
1735
+ break;
1736
+ }
1737
+ }
1738
+ }
1739
+ return null;
1740
+ }
1741
+ function failureErrorWithLog(text, errors, warnings) {
1742
+ let limit = 5;
1743
+ text += errors.length < 1 ? "" : ` with ${errors.length} error${errors.length < 2 ? "" : "s"}:` + errors.slice(0, limit + 1).map((e, i) => {
1744
+ if (i === limit) return "\n...";
1745
+ if (!e.location) return `
1746
+ error: ${e.text}`;
1747
+ let { file, line, column } = e.location;
1748
+ let pluginText = e.pluginName ? `[plugin: ${e.pluginName}] ` : "";
1749
+ return `
1750
+ ${file}:${line}:${column}: ERROR: ${pluginText}${e.text}`;
1751
+ }).join("");
1752
+ let error = new Error(text);
1753
+ for (const [key, value] of [["errors", errors], ["warnings", warnings]]) {
1754
+ Object.defineProperty(error, key, {
1755
+ configurable: true,
1756
+ enumerable: true,
1757
+ get: () => value,
1758
+ set: (value2) => Object.defineProperty(error, key, {
1759
+ configurable: true,
1760
+ enumerable: true,
1761
+ value: value2
1762
+ })
1763
+ });
1764
+ }
1765
+ return error;
1766
+ }
1767
+ function replaceDetailsInMessages(messages, stash) {
1768
+ for (const message of messages) {
1769
+ message.detail = stash.load(message.detail);
1770
+ }
1771
+ return messages;
1772
+ }
1773
+ function sanitizeLocation(location, where, terminalWidth) {
1774
+ if (location == null) return null;
1775
+ let keys = {};
1776
+ let file = getFlag(location, keys, "file", mustBeString);
1777
+ let namespace = getFlag(location, keys, "namespace", mustBeString);
1778
+ let line = getFlag(location, keys, "line", mustBeInteger);
1779
+ let column = getFlag(location, keys, "column", mustBeInteger);
1780
+ let length = getFlag(location, keys, "length", mustBeInteger);
1781
+ let lineText = getFlag(location, keys, "lineText", mustBeString);
1782
+ let suggestion = getFlag(location, keys, "suggestion", mustBeString);
1783
+ checkForInvalidFlags(location, keys, where);
1784
+ if (lineText) {
1785
+ const relevantASCII = lineText.slice(
1786
+ 0,
1787
+ (column && column > 0 ? column : 0) + (length && length > 0 ? length : 0) + (terminalWidth && terminalWidth > 0 ? terminalWidth : 80)
1788
+ );
1789
+ if (!/[\x7F-\uFFFF]/.test(relevantASCII) && !/\n/.test(lineText)) {
1790
+ lineText = relevantASCII;
1791
+ }
1792
+ }
1793
+ return {
1794
+ file: file || "",
1795
+ namespace: namespace || "",
1796
+ line: line || 0,
1797
+ column: column || 0,
1798
+ length: length || 0,
1799
+ lineText: lineText || "",
1800
+ suggestion: suggestion || ""
1801
+ };
1802
+ }
1803
+ function sanitizeMessages(messages, property, stash, fallbackPluginName, terminalWidth) {
1804
+ let messagesClone = [];
1805
+ let index = 0;
1806
+ for (const message of messages) {
1807
+ let keys = {};
1808
+ let id = getFlag(message, keys, "id", mustBeString);
1809
+ let pluginName = getFlag(message, keys, "pluginName", mustBeString);
1810
+ let text = getFlag(message, keys, "text", mustBeString);
1811
+ let location = getFlag(message, keys, "location", mustBeObjectOrNull);
1812
+ let notes = getFlag(message, keys, "notes", mustBeArray);
1813
+ let detail = getFlag(message, keys, "detail", canBeAnything);
1814
+ let where = `in element ${index} of "${property}"`;
1815
+ checkForInvalidFlags(message, keys, where);
1816
+ let notesClone = [];
1817
+ if (notes) {
1818
+ for (const note of notes) {
1819
+ let noteKeys = {};
1820
+ let noteText = getFlag(note, noteKeys, "text", mustBeString);
1821
+ let noteLocation = getFlag(note, noteKeys, "location", mustBeObjectOrNull);
1822
+ checkForInvalidFlags(note, noteKeys, where);
1823
+ notesClone.push({
1824
+ text: noteText || "",
1825
+ location: sanitizeLocation(noteLocation, where, terminalWidth)
1826
+ });
1827
+ }
1828
+ }
1829
+ messagesClone.push({
1830
+ id: id || "",
1831
+ pluginName: pluginName || fallbackPluginName,
1832
+ text: text || "",
1833
+ location: sanitizeLocation(location, where, terminalWidth),
1834
+ notes: notesClone,
1835
+ detail: stash ? stash.store(detail) : -1
1836
+ });
1837
+ index++;
1838
+ }
1839
+ return messagesClone;
1840
+ }
1841
+ function sanitizeStringArray(values, property) {
1842
+ const result = [];
1843
+ for (const value of values) {
1844
+ if (typeof value !== "string") throw new Error(`${quote(property)} must be an array of strings`);
1845
+ result.push(value);
1846
+ }
1847
+ return result;
1848
+ }
1849
+ function sanitizeStringMap(map, property) {
1850
+ const result = /* @__PURE__ */ Object.create(null);
1851
+ for (const key in map) {
1852
+ const value = map[key];
1853
+ if (typeof value !== "string") throw new Error(`key ${quote(key)} in object ${quote(property)} must be a string`);
1854
+ result[key] = value;
1855
+ }
1856
+ return result;
1857
+ }
1858
+ function convertOutputFiles({ path: path3, contents, hash }) {
1859
+ let text = null;
1860
+ return {
1861
+ path: path3,
1862
+ contents,
1863
+ hash,
1864
+ get text() {
1865
+ const binary = this.contents;
1866
+ if (text === null || binary !== contents) {
1867
+ contents = binary;
1868
+ text = decodeUTF8(binary);
1869
+ }
1870
+ return text;
1871
+ }
1872
+ };
1873
+ }
1874
+ function jsRegExpToGoRegExp(regexp) {
1875
+ let result = regexp.source;
1876
+ if (regexp.flags) result = `(?${regexp.flags})${result}`;
1877
+ return result;
1878
+ }
1879
+ function parseJSON(bytes) {
1880
+ let text;
1881
+ try {
1882
+ text = decodeUTF8(bytes);
1883
+ } catch {
1884
+ return JSON_parse(bytes);
1885
+ }
1886
+ return JSON.parse(text);
1887
+ }
1888
+
1889
+ // lib/npm/node-platform.ts
1890
+ var fs = require("fs");
1891
+ var os = require("os");
1892
+ var path = require("path");
1893
+ var ESBUILD_BINARY_PATH = process.env.ESBUILD_BINARY_PATH || ESBUILD_BINARY_PATH;
1894
+ var isValidBinaryPath = (x) => !!x && x !== "/usr/bin/esbuild";
1895
+ var packageDarwin_arm64 = "@esbuild/darwin-arm64";
1896
+ var packageDarwin_x64 = "@esbuild/darwin-x64";
1897
+ var knownWindowsPackages = {
1898
+ "win32 arm64 LE": "@esbuild/win32-arm64",
1899
+ "win32 ia32 LE": "@esbuild/win32-ia32",
1900
+ "win32 x64 LE": "@esbuild/win32-x64"
1901
+ };
1902
+ var knownUnixlikePackages = {
1903
+ "aix ppc64 BE": "@esbuild/aix-ppc64",
1904
+ "android arm64 LE": "@esbuild/android-arm64",
1905
+ "darwin arm64 LE": "@esbuild/darwin-arm64",
1906
+ "darwin x64 LE": "@esbuild/darwin-x64",
1907
+ "freebsd arm64 LE": "@esbuild/freebsd-arm64",
1908
+ "freebsd x64 LE": "@esbuild/freebsd-x64",
1909
+ "linux arm LE": "@esbuild/linux-arm",
1910
+ "linux arm64 LE": "@esbuild/linux-arm64",
1911
+ "linux ia32 LE": "@esbuild/linux-ia32",
1912
+ "linux mips64el LE": "@esbuild/linux-mips64el",
1913
+ "linux ppc64 LE": "@esbuild/linux-ppc64",
1914
+ "linux riscv64 LE": "@esbuild/linux-riscv64",
1915
+ "linux s390x BE": "@esbuild/linux-s390x",
1916
+ "linux x64 LE": "@esbuild/linux-x64",
1917
+ "linux loong64 LE": "@esbuild/linux-loong64",
1918
+ "netbsd arm64 LE": "@esbuild/netbsd-arm64",
1919
+ "netbsd x64 LE": "@esbuild/netbsd-x64",
1920
+ "openbsd arm64 LE": "@esbuild/openbsd-arm64",
1921
+ "openbsd x64 LE": "@esbuild/openbsd-x64",
1922
+ "sunos x64 LE": "@esbuild/sunos-x64"
1923
+ };
1924
+ var knownWebAssemblyFallbackPackages = {
1925
+ "android arm LE": "@esbuild/android-arm",
1926
+ "android x64 LE": "@esbuild/android-x64",
1927
+ "openharmony arm64 LE": "@esbuild/openharmony-arm64"
1928
+ };
1929
+ function pkgAndSubpathForCurrentPlatform() {
1930
+ let pkg;
1931
+ let subpath;
1932
+ let isWASM = false;
1933
+ let platformKey = `${process.platform} ${os.arch()} ${os.endianness()}`;
1934
+ if (platformKey in knownWindowsPackages) {
1935
+ pkg = knownWindowsPackages[platformKey];
1936
+ subpath = "esbuild.exe";
1937
+ } else if (platformKey in knownUnixlikePackages) {
1938
+ pkg = knownUnixlikePackages[platformKey];
1939
+ subpath = "bin/esbuild";
1940
+ } else if (platformKey in knownWebAssemblyFallbackPackages) {
1941
+ pkg = knownWebAssemblyFallbackPackages[platformKey];
1942
+ subpath = "bin/esbuild";
1943
+ isWASM = true;
1944
+ } else {
1945
+ throw new Error(`Unsupported platform: ${platformKey}`);
1946
+ }
1947
+ return { pkg, subpath, isWASM };
1948
+ }
1949
+ function pkgForSomeOtherPlatform() {
1950
+ const libMainJS = require.resolve("esbuild");
1951
+ const nodeModulesDirectory = path.dirname(path.dirname(path.dirname(libMainJS)));
1952
+ if (path.basename(nodeModulesDirectory) === "node_modules") {
1953
+ for (const unixKey in knownUnixlikePackages) {
1954
+ try {
1955
+ const pkg = knownUnixlikePackages[unixKey];
1956
+ if (fs.existsSync(path.join(nodeModulesDirectory, pkg))) return pkg;
1957
+ } catch {
1958
+ }
1959
+ }
1960
+ for (const windowsKey in knownWindowsPackages) {
1961
+ try {
1962
+ const pkg = knownWindowsPackages[windowsKey];
1963
+ if (fs.existsSync(path.join(nodeModulesDirectory, pkg))) return pkg;
1964
+ } catch {
1965
+ }
1966
+ }
1967
+ }
1968
+ return null;
1969
+ }
1970
+ function downloadedBinPath(pkg, subpath) {
1971
+ const esbuildLibDir = path.dirname(require.resolve("esbuild"));
1972
+ return path.join(esbuildLibDir, `downloaded-${pkg.replace("/", "-")}-${path.basename(subpath)}`);
1973
+ }
1974
+ function generateBinPath() {
1975
+ if (isValidBinaryPath(ESBUILD_BINARY_PATH)) {
1976
+ if (!fs.existsSync(ESBUILD_BINARY_PATH)) {
1977
+ console.warn(`[esbuild] Ignoring bad configuration: ESBUILD_BINARY_PATH=${ESBUILD_BINARY_PATH}`);
1978
+ } else {
1979
+ return { binPath: ESBUILD_BINARY_PATH, isWASM: false };
1980
+ }
1981
+ }
1982
+ const { pkg, subpath, isWASM } = pkgAndSubpathForCurrentPlatform();
1983
+ let binPath;
1984
+ try {
1985
+ binPath = require.resolve(`${pkg}/${subpath}`);
1986
+ } catch (e) {
1987
+ binPath = downloadedBinPath(pkg, subpath);
1988
+ if (!fs.existsSync(binPath)) {
1989
+ try {
1990
+ require.resolve(pkg);
1991
+ } catch {
1992
+ const otherPkg = pkgForSomeOtherPlatform();
1993
+ if (otherPkg) {
1994
+ let suggestions = `
1995
+ Specifically the "${otherPkg}" package is present but this platform
1996
+ needs the "${pkg}" package instead. People often get into this
1997
+ situation by installing esbuild on Windows or macOS and copying "node_modules"
1998
+ into a Docker image that runs Linux, or by copying "node_modules" between
1999
+ Windows and WSL environments.
2000
+
2001
+ If you are installing with npm, you can try not copying the "node_modules"
2002
+ directory when you copy the files over, and running "npm ci" or "npm install"
2003
+ on the destination platform after the copy. Or you could consider using yarn
2004
+ instead of npm which has built-in support for installing a package on multiple
2005
+ platforms simultaneously.
2006
+
2007
+ If you are installing with yarn, you can try listing both this platform and the
2008
+ other platform in your ".yarnrc.yml" file using the "supportedArchitectures"
2009
+ feature: https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures
2010
+ Keep in mind that this means multiple copies of esbuild will be present.
2011
+ `;
2012
+ if (pkg === packageDarwin_x64 && otherPkg === packageDarwin_arm64 || pkg === packageDarwin_arm64 && otherPkg === packageDarwin_x64) {
2013
+ suggestions = `
2014
+ Specifically the "${otherPkg}" package is present but this platform
2015
+ needs the "${pkg}" package instead. People often get into this
2016
+ situation by installing esbuild with npm running inside of Rosetta 2 and then
2017
+ trying to use it with node running outside of Rosetta 2, or vice versa (Rosetta
2018
+ 2 is Apple's on-the-fly x86_64-to-arm64 translation service).
2019
+
2020
+ If you are installing with npm, you can try ensuring that both npm and node are
2021
+ not running under Rosetta 2 and then reinstalling esbuild. This likely involves
2022
+ changing how you installed npm and/or node. For example, installing node with
2023
+ the universal installer here should work: https://nodejs.org/en/download/. Or
2024
+ you could consider using yarn instead of npm which has built-in support for
2025
+ installing a package on multiple platforms simultaneously.
2026
+
2027
+ If you are installing with yarn, you can try listing both "arm64" and "x64"
2028
+ in your ".yarnrc.yml" file using the "supportedArchitectures" feature:
2029
+ https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures
2030
+ Keep in mind that this means multiple copies of esbuild will be present.
2031
+ `;
2032
+ }
2033
+ throw new Error(`
2034
+ You installed esbuild for another platform than the one you're currently using.
2035
+ This won't work because esbuild is written with native code and needs to
2036
+ install a platform-specific binary executable.
2037
+ ${suggestions}
2038
+ Another alternative is to use the "esbuild-wasm" package instead, which works
2039
+ the same way on all platforms. But it comes with a heavy performance cost and
2040
+ can sometimes be 10x slower than the "esbuild" package, so you may also not
2041
+ want to do that.
2042
+ `);
2043
+ }
2044
+ throw new Error(`The package "${pkg}" could not be found, and is needed by esbuild.
2045
+
2046
+ If you are installing esbuild with npm, make sure that you don't specify the
2047
+ "--no-optional" or "--omit=optional" flags. The "optionalDependencies" feature
2048
+ of "package.json" is used by esbuild to install the correct binary executable
2049
+ for your current platform.`);
2050
+ }
2051
+ throw e;
2052
+ }
2053
+ }
2054
+ if (/\.zip\//.test(binPath)) {
2055
+ let pnpapi;
2056
+ try {
2057
+ pnpapi = require("pnpapi");
2058
+ } catch (e) {
2059
+ }
2060
+ if (pnpapi) {
2061
+ const root = pnpapi.getPackageInformation(pnpapi.topLevel).packageLocation;
2062
+ const binTargetPath = path.join(
2063
+ root,
2064
+ "node_modules",
2065
+ ".cache",
2066
+ "esbuild",
2067
+ `pnpapi-${pkg.replace("/", "-")}-${"0.28.2"}-${path.basename(subpath)}`
2068
+ );
2069
+ if (!fs.existsSync(binTargetPath)) {
2070
+ fs.mkdirSync(path.dirname(binTargetPath), { recursive: true });
2071
+ fs.copyFileSync(binPath, binTargetPath);
2072
+ fs.chmodSync(binTargetPath, 493);
2073
+ }
2074
+ return { binPath: binTargetPath, isWASM };
2075
+ }
2076
+ }
2077
+ return { binPath, isWASM };
2078
+ }
2079
+
2080
+ // lib/npm/node.ts
2081
+ var child_process = require("child_process");
2082
+ var crypto = require("crypto");
2083
+ var path2 = require("path");
2084
+ var fs2 = require("fs");
2085
+ var os2 = require("os");
2086
+ var tty = require("tty");
2087
+ var worker_threads;
2088
+ if (process.env.ESBUILD_WORKER_THREADS !== "0") {
2089
+ try {
2090
+ worker_threads = require("worker_threads");
2091
+ } catch {
2092
+ }
2093
+ let [major, minor] = process.versions.node.split(".");
2094
+ if (
2095
+ // <v12.17.0 does not work
2096
+ +major < 12 || +major === 12 && +minor < 17 || +major === 13 && +minor < 13
2097
+ ) {
2098
+ worker_threads = void 0;
2099
+ }
2100
+ }
2101
+ var _a;
2102
+ var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.28.2";
2103
+ var esbuildCommandAndArgs = () => {
2104
+ if ((!ESBUILD_BINARY_PATH || false) && (path2.basename(__filename) !== "main.js" || path2.basename(__dirname) !== "lib")) {
2105
+ throw new Error(
2106
+ `The esbuild JavaScript API cannot be bundled. Please mark the "esbuild" package as external so it's not included in the bundle.
2107
+
2108
+ More information: The file containing the code for esbuild's JavaScript API (${__filename}) does not appear to be inside the esbuild package on the file system, which usually means that the esbuild package was bundled into another file. This is problematic because the API needs to run a binary executable inside the esbuild package which is located using a relative path from the API code to the executable. If the esbuild package is bundled, the relative path will be incorrect and the executable won't be found.`
2109
+ );
2110
+ }
2111
+ if (false) {
2112
+ return ["node", [path2.join(__dirname, "..", "bin", "esbuild")]];
2113
+ } else {
2114
+ const { binPath, isWASM } = generateBinPath();
2115
+ if (isWASM) {
2116
+ return ["node", [binPath]];
2117
+ } else {
2118
+ return [binPath, []];
2119
+ }
2120
+ }
2121
+ };
2122
+ var isTTY = () => tty.isatty(2);
2123
+ var fsSync = {
2124
+ readFile(tempFile, callback) {
2125
+ try {
2126
+ let contents = fs2.readFileSync(tempFile, "utf8");
2127
+ try {
2128
+ fs2.unlinkSync(tempFile);
2129
+ } catch {
2130
+ }
2131
+ callback(null, contents);
2132
+ } catch (err) {
2133
+ callback(err, null);
2134
+ }
2135
+ },
2136
+ writeFile(contents, callback) {
2137
+ try {
2138
+ let tempFile = randomFileName();
2139
+ fs2.writeFileSync(tempFile, contents);
2140
+ callback(tempFile);
2141
+ } catch {
2142
+ callback(null);
2143
+ }
2144
+ }
2145
+ };
2146
+ var fsAsync = {
2147
+ readFile(tempFile, callback) {
2148
+ try {
2149
+ fs2.readFile(tempFile, "utf8", (err, contents) => {
2150
+ try {
2151
+ fs2.unlink(tempFile, () => callback(err, contents));
2152
+ } catch {
2153
+ callback(err, contents);
2154
+ }
2155
+ });
2156
+ } catch (err) {
2157
+ callback(err, null);
2158
+ }
2159
+ },
2160
+ writeFile(contents, callback) {
2161
+ try {
2162
+ let tempFile = randomFileName();
2163
+ fs2.writeFile(tempFile, contents, (err) => err !== null ? callback(null) : callback(tempFile));
2164
+ } catch {
2165
+ callback(null);
2166
+ }
2167
+ }
2168
+ };
2169
+ var version = "0.28.2";
2170
+ var build = (options) => ensureServiceIsRunning().build(options);
2171
+ var context = (buildOptions) => ensureServiceIsRunning().context(buildOptions);
2172
+ var transform = (input, options) => ensureServiceIsRunning().transform(input, options);
2173
+ var formatMessages = (messages, options) => ensureServiceIsRunning().formatMessages(messages, options);
2174
+ var analyzeMetafile = (messages, options) => ensureServiceIsRunning().analyzeMetafile(messages, options);
2175
+ var buildSync = (options) => {
2176
+ if (worker_threads && !isInternalWorkerThread) {
2177
+ if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads);
2178
+ return workerThreadService.buildSync(options);
2179
+ }
2180
+ let result;
2181
+ runServiceSync((service) => service.buildOrContext({
2182
+ callName: "buildSync",
2183
+ refs: null,
2184
+ options,
2185
+ isTTY: isTTY(),
2186
+ defaultWD,
2187
+ callback: (err, res) => {
2188
+ if (err) throw err;
2189
+ result = res;
2190
+ }
2191
+ }));
2192
+ return result;
2193
+ };
2194
+ var transformSync = (input, options) => {
2195
+ if (worker_threads && !isInternalWorkerThread) {
2196
+ if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads);
2197
+ return workerThreadService.transformSync(input, options);
2198
+ }
2199
+ let result;
2200
+ runServiceSync((service) => service.transform({
2201
+ callName: "transformSync",
2202
+ refs: null,
2203
+ input,
2204
+ options: options || {},
2205
+ isTTY: isTTY(),
2206
+ fs: fsSync,
2207
+ callback: (err, res) => {
2208
+ if (err) throw err;
2209
+ result = res;
2210
+ }
2211
+ }));
2212
+ return result;
2213
+ };
2214
+ var formatMessagesSync = (messages, options) => {
2215
+ if (worker_threads && !isInternalWorkerThread) {
2216
+ if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads);
2217
+ return workerThreadService.formatMessagesSync(messages, options);
2218
+ }
2219
+ let result;
2220
+ runServiceSync((service) => service.formatMessages({
2221
+ callName: "formatMessagesSync",
2222
+ refs: null,
2223
+ messages,
2224
+ options,
2225
+ callback: (err, res) => {
2226
+ if (err) throw err;
2227
+ result = res;
2228
+ }
2229
+ }));
2230
+ return result;
2231
+ };
2232
+ var analyzeMetafileSync = (metafile, options) => {
2233
+ if (worker_threads && !isInternalWorkerThread) {
2234
+ if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads);
2235
+ return workerThreadService.analyzeMetafileSync(metafile, options);
2236
+ }
2237
+ let result;
2238
+ runServiceSync((service) => service.analyzeMetafile({
2239
+ callName: "analyzeMetafileSync",
2240
+ refs: null,
2241
+ metafile: typeof metafile === "string" ? metafile : JSON.stringify(metafile),
2242
+ options,
2243
+ callback: (err, res) => {
2244
+ if (err) throw err;
2245
+ result = res;
2246
+ }
2247
+ }));
2248
+ return result;
2249
+ };
2250
+ var stop = () => {
2251
+ if (stopService) stopService();
2252
+ if (workerThreadService) workerThreadService.stop();
2253
+ return Promise.resolve();
2254
+ };
2255
+ var initializeWasCalled = false;
2256
+ var initialize = (options) => {
2257
+ options = validateInitializeOptions(options || {});
2258
+ if (options.wasmURL) throw new Error(`The "wasmURL" option only works in the browser`);
2259
+ if (options.wasmModule) throw new Error(`The "wasmModule" option only works in the browser`);
2260
+ if (options.worker) throw new Error(`The "worker" option only works in the browser`);
2261
+ if (initializeWasCalled) throw new Error('Cannot call "initialize" more than once');
2262
+ ensureServiceIsRunning();
2263
+ initializeWasCalled = true;
2264
+ return Promise.resolve();
2265
+ };
2266
+ var defaultWD = process.cwd();
2267
+ var longLivedService;
2268
+ var stopService;
2269
+ var ensureServiceIsRunning = () => {
2270
+ if (longLivedService) return longLivedService;
2271
+ let [command, args] = esbuildCommandAndArgs();
2272
+ let child = child_process.spawn(command, args.concat(`--service=${"0.28.2"}`, "--ping"), {
2273
+ windowsHide: true,
2274
+ stdio: ["pipe", "pipe", "inherit"],
2275
+ cwd: defaultWD
2276
+ });
2277
+ let { readFromStdout, afterClose, service } = createChannel({
2278
+ writeToStdin(bytes) {
2279
+ child.stdin.write(bytes, (err) => {
2280
+ if (err) afterClose(err);
2281
+ });
2282
+ },
2283
+ readFileSync: fs2.readFileSync,
2284
+ isSync: false,
2285
+ hasFS: true,
2286
+ esbuild: node_exports
2287
+ });
2288
+ child.stdin.on("error", afterClose);
2289
+ child.on("error", afterClose);
2290
+ const stdin = child.stdin;
2291
+ const stdout = child.stdout;
2292
+ stdout.on("data", readFromStdout);
2293
+ stdout.on("end", afterClose);
2294
+ stopService = () => {
2295
+ stdin.destroy();
2296
+ stdout.destroy();
2297
+ child.kill();
2298
+ initializeWasCalled = false;
2299
+ longLivedService = void 0;
2300
+ stopService = void 0;
2301
+ };
2302
+ let refCount = 0;
2303
+ child.unref();
2304
+ if (stdin.unref) {
2305
+ stdin.unref();
2306
+ }
2307
+ if (stdout.unref) {
2308
+ stdout.unref();
2309
+ }
2310
+ const refs = {
2311
+ ref() {
2312
+ if (++refCount === 1) child.ref();
2313
+ },
2314
+ unref() {
2315
+ if (--refCount === 0) child.unref();
2316
+ }
2317
+ };
2318
+ longLivedService = {
2319
+ build: (options) => new Promise((resolve, reject) => {
2320
+ service.buildOrContext({
2321
+ callName: "build",
2322
+ refs,
2323
+ options,
2324
+ isTTY: isTTY(),
2325
+ defaultWD,
2326
+ callback: (err, res) => err ? reject(err) : resolve(res)
2327
+ });
2328
+ }),
2329
+ context: (options) => new Promise((resolve, reject) => service.buildOrContext({
2330
+ callName: "context",
2331
+ refs,
2332
+ options,
2333
+ isTTY: isTTY(),
2334
+ defaultWD,
2335
+ callback: (err, res) => err ? reject(err) : resolve(res)
2336
+ })),
2337
+ transform: (input, options) => new Promise((resolve, reject) => service.transform({
2338
+ callName: "transform",
2339
+ refs,
2340
+ input,
2341
+ options: options || {},
2342
+ isTTY: isTTY(),
2343
+ fs: fsAsync,
2344
+ callback: (err, res) => err ? reject(err) : resolve(res)
2345
+ })),
2346
+ formatMessages: (messages, options) => new Promise((resolve, reject) => service.formatMessages({
2347
+ callName: "formatMessages",
2348
+ refs,
2349
+ messages,
2350
+ options,
2351
+ callback: (err, res) => err ? reject(err) : resolve(res)
2352
+ })),
2353
+ analyzeMetafile: (metafile, options) => new Promise((resolve, reject) => service.analyzeMetafile({
2354
+ callName: "analyzeMetafile",
2355
+ refs,
2356
+ metafile: typeof metafile === "string" ? metafile : JSON.stringify(metafile),
2357
+ options,
2358
+ callback: (err, res) => err ? reject(err) : resolve(res)
2359
+ }))
2360
+ };
2361
+ return longLivedService;
2362
+ };
2363
+ var runServiceSync = (callback) => {
2364
+ let [command, args] = esbuildCommandAndArgs();
2365
+ let stdin = new Uint8Array();
2366
+ let { readFromStdout, afterClose, service } = createChannel({
2367
+ writeToStdin(bytes) {
2368
+ if (stdin.length !== 0) throw new Error("Must run at most one command");
2369
+ stdin = bytes;
2370
+ },
2371
+ isSync: true,
2372
+ hasFS: true,
2373
+ esbuild: node_exports
2374
+ });
2375
+ callback(service);
2376
+ let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.28.2"}`), {
2377
+ cwd: defaultWD,
2378
+ windowsHide: true,
2379
+ input: stdin,
2380
+ // We don't know how large the output could be. If it's too large, the
2381
+ // command will fail with ENOBUFS. Reserve 16mb for now since that feels
2382
+ // like it should be enough. Also allow overriding this with an environment
2383
+ // variable.
2384
+ maxBuffer: +process.env.ESBUILD_MAX_BUFFER || 16 * 1024 * 1024
2385
+ });
2386
+ readFromStdout(stdout);
2387
+ afterClose(null);
2388
+ };
2389
+ var randomFileName = () => {
2390
+ return path2.join(os2.tmpdir(), `esbuild-${crypto.randomBytes(32).toString("hex")}`);
2391
+ };
2392
+ var workerThreadService = null;
2393
+ var startWorkerThreadService = (worker_threads2) => {
2394
+ let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel();
2395
+ let worker = new worker_threads2.Worker(__filename, {
2396
+ workerData: { workerPort, defaultWD, esbuildVersion: "0.28.2" },
2397
+ transferList: [workerPort],
2398
+ // From node's documentation: https://nodejs.org/api/worker_threads.html
2399
+ //
2400
+ // Take care when launching worker threads from preload scripts (scripts loaded
2401
+ // and run using the `-r` command line flag). Unless the `execArgv` option is
2402
+ // explicitly set, new Worker threads automatically inherit the command line flags
2403
+ // from the running process and will preload the same preload scripts as the main
2404
+ // thread. If the preload script unconditionally launches a worker thread, every
2405
+ // thread spawned will spawn another until the application crashes.
2406
+ //
2407
+ execArgv: []
2408
+ });
2409
+ let nextID = 0;
2410
+ let fakeBuildError = (text) => {
2411
+ let error = new Error(`Build failed with 1 error:
2412
+ error: ${text}`);
2413
+ let errors = [{ id: "", pluginName: "", text, location: null, notes: [], detail: void 0 }];
2414
+ error.errors = errors;
2415
+ error.warnings = [];
2416
+ return error;
2417
+ };
2418
+ let validateBuildSyncOptions = (options) => {
2419
+ if (!options) return;
2420
+ let plugins = options.plugins;
2421
+ if (plugins && plugins.length > 0) throw fakeBuildError(`Cannot use plugins in synchronous API calls`);
2422
+ };
2423
+ let applyProperties = (object, properties) => {
2424
+ for (let key in properties) {
2425
+ object[key] = properties[key];
2426
+ }
2427
+ };
2428
+ let runCallSync = (command, args) => {
2429
+ let id = nextID++;
2430
+ let sharedBuffer = new SharedArrayBuffer(8);
2431
+ let sharedBufferView = new Int32Array(sharedBuffer);
2432
+ let msg = { sharedBuffer, id, command, args };
2433
+ worker.postMessage(msg);
2434
+ let status = Atomics.wait(sharedBufferView, 0, 0);
2435
+ if (status !== "ok" && status !== "not-equal") throw new Error("Internal error: Atomics.wait() failed: " + status);
2436
+ let { message: { id: id2, resolve, reject, properties } } = worker_threads2.receiveMessageOnPort(mainPort);
2437
+ if (id !== id2) throw new Error(`Internal error: Expected id ${id} but got id ${id2}`);
2438
+ if (reject) {
2439
+ applyProperties(reject, properties);
2440
+ throw reject;
2441
+ }
2442
+ return resolve;
2443
+ };
2444
+ worker.unref();
2445
+ return {
2446
+ buildSync(options) {
2447
+ validateBuildSyncOptions(options);
2448
+ return runCallSync("build", [options]);
2449
+ },
2450
+ transformSync(input, options) {
2451
+ return runCallSync("transform", [input, options]);
2452
+ },
2453
+ formatMessagesSync(messages, options) {
2454
+ return runCallSync("formatMessages", [messages, options]);
2455
+ },
2456
+ analyzeMetafileSync(metafile, options) {
2457
+ return runCallSync("analyzeMetafile", [metafile, options]);
2458
+ },
2459
+ stop() {
2460
+ worker.terminate();
2461
+ workerThreadService = null;
2462
+ }
2463
+ };
2464
+ };
2465
+ var startSyncServiceWorker = () => {
2466
+ let workerPort = worker_threads.workerData.workerPort;
2467
+ let parentPort = worker_threads.parentPort;
2468
+ let extractProperties = (object) => {
2469
+ let properties = {};
2470
+ if (object && typeof object === "object") {
2471
+ for (let key in object) {
2472
+ properties[key] = object[key];
2473
+ }
2474
+ }
2475
+ return properties;
2476
+ };
2477
+ try {
2478
+ let service = ensureServiceIsRunning();
2479
+ defaultWD = worker_threads.workerData.defaultWD;
2480
+ parentPort.on("message", (msg) => {
2481
+ (async () => {
2482
+ let { sharedBuffer, id, command, args } = msg;
2483
+ let sharedBufferView = new Int32Array(sharedBuffer);
2484
+ try {
2485
+ switch (command) {
2486
+ case "build":
2487
+ workerPort.postMessage({ id, resolve: await service.build(args[0]) });
2488
+ break;
2489
+ case "transform":
2490
+ workerPort.postMessage({ id, resolve: await service.transform(args[0], args[1]) });
2491
+ break;
2492
+ case "formatMessages":
2493
+ workerPort.postMessage({ id, resolve: await service.formatMessages(args[0], args[1]) });
2494
+ break;
2495
+ case "analyzeMetafile":
2496
+ workerPort.postMessage({ id, resolve: await service.analyzeMetafile(args[0], args[1]) });
2497
+ break;
2498
+ default:
2499
+ throw new Error(`Invalid command: ${command}`);
2500
+ }
2501
+ } catch (reject) {
2502
+ workerPort.postMessage({ id, reject, properties: extractProperties(reject) });
2503
+ }
2504
+ Atomics.add(sharedBufferView, 0, 1);
2505
+ Atomics.notify(sharedBufferView, 0, Infinity);
2506
+ })();
2507
+ });
2508
+ } catch (reject) {
2509
+ parentPort.on("message", (msg) => {
2510
+ let { sharedBuffer, id } = msg;
2511
+ let sharedBufferView = new Int32Array(sharedBuffer);
2512
+ workerPort.postMessage({ id, reject, properties: extractProperties(reject) });
2513
+ Atomics.add(sharedBufferView, 0, 1);
2514
+ Atomics.notify(sharedBufferView, 0, Infinity);
2515
+ });
2516
+ }
2517
+ };
2518
+ if (isInternalWorkerThread) {
2519
+ startSyncServiceWorker();
2520
+ }
2521
+ var node_default = node_exports;
2522
+ // Annotate the CommonJS export names for ESM import in node:
2523
+ 0 && (module.exports = {
2524
+ analyzeMetafile,
2525
+ analyzeMetafileSync,
2526
+ build,
2527
+ buildSync,
2528
+ context,
2529
+ formatMessages,
2530
+ formatMessagesSync,
2531
+ initialize,
2532
+ stop,
2533
+ transform,
2534
+ transformSync,
2535
+ version
2536
+ });