@harrylabsj/kiwi-merchant-cloud 0.12.4 → 0.12.6

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 (1813) hide show
  1. package/app/a2a/node.d.ts +5 -1
  2. package/app/a2a/node.js +68 -30
  3. package/app/a2a/node.js.map +1 -1
  4. package/app/a2a/server/merchant-handler.d.ts +4 -0
  5. package/app/a2a/server/merchant-handler.js +123 -45
  6. package/app/a2a/server/merchant-handler.js.map +1 -1
  7. package/app/a2a/server/merchant-product-facts.d.ts +32 -0
  8. package/app/a2a/server/merchant-product-facts.js +57 -0
  9. package/app/a2a/server/merchant-product-facts.js.map +1 -0
  10. package/app/agent/buyer/buyer-tools.js +285 -3
  11. package/app/agent/buyer/buyer-tools.js.map +1 -1
  12. package/app/agent/merchant/types.d.ts +4 -9
  13. package/app/agent/merchant/types.js +14 -0
  14. package/app/agent/merchant/types.js.map +1 -1
  15. package/app/buyer-core/a2a-knp.d.ts +1 -0
  16. package/app/buyer-core/a2a-knp.js +1 -1
  17. package/app/buyer-core/a2a-knp.js.map +1 -1
  18. package/app/buyer-core/a2a-negotiator.d.ts +2 -0
  19. package/app/buyer-core/a2a-negotiator.js +20 -19
  20. package/app/buyer-core/a2a-negotiator.js.map +1 -1
  21. package/app/buyer-core/a2a-quote-fetcher.d.ts +2 -0
  22. package/app/buyer-core/a2a-quote-fetcher.js +13 -5
  23. package/app/buyer-core/a2a-quote-fetcher.js.map +1 -1
  24. package/app/buyer-core/product-summary.d.ts +4 -0
  25. package/app/buyer-core/product-summary.js +6 -0
  26. package/app/buyer-core/product-summary.js.map +1 -1
  27. package/app/buyer-core/protocol-recovery.d.ts +12 -1
  28. package/app/buyer-core/protocol-recovery.js +59 -19
  29. package/app/buyer-core/protocol-recovery.js.map +1 -1
  30. package/app/buyer-core/receive-gate.d.ts +11 -0
  31. package/app/buyer-core/receive-gate.js +107 -0
  32. package/app/buyer-core/receive-gate.js.map +1 -0
  33. package/app/buyer-core/service.d.ts +22 -1
  34. package/app/buyer-core/service.js +325 -33
  35. package/app/buyer-core/service.js.map +1 -1
  36. package/app/buyer-core/store.d.ts +23 -0
  37. package/app/buyer-core/store.js +71 -8
  38. package/app/buyer-core/store.js.map +1 -1
  39. package/app/cloud/bootstrap.d.ts +17 -0
  40. package/app/cloud/bootstrap.js +96 -59
  41. package/app/cloud/bootstrap.js.map +1 -1
  42. package/app/cloud/config.d.ts +26 -0
  43. package/app/cloud/config.js +75 -3
  44. package/app/cloud/config.js.map +1 -1
  45. package/app/cloud/file-listing-publication.js +6 -0
  46. package/app/cloud/file-listing-publication.js.map +1 -1
  47. package/app/cloud/main.d.ts +72 -0
  48. package/app/cloud/main.js +332 -11
  49. package/app/cloud/main.js.map +1 -1
  50. package/app/cloud/owned-clock.d.ts +27 -0
  51. package/app/cloud/owned-clock.js +98 -0
  52. package/app/cloud/owned-clock.js.map +1 -0
  53. package/app/cloud/owned-runtime.d.ts +188 -0
  54. package/app/cloud/owned-runtime.js +1041 -0
  55. package/app/cloud/owned-runtime.js.map +1 -0
  56. package/app/cloud/product-import-tabular.d.ts +1 -1
  57. package/app/cloud/product-import-tabular.js +263 -36
  58. package/app/cloud/product-import-tabular.js.map +1 -1
  59. package/app/cloud/product-source.d.ts +6 -1
  60. package/app/cloud/product-source.js +47 -15
  61. package/app/cloud/product-source.js.map +1 -1
  62. package/app/cloud-sample/products.json +3 -3
  63. package/app/commerce/data-source.d.ts +4 -0
  64. package/app/commerce/data-source.js.map +1 -1
  65. package/app/commerce/shopping-cli-source.js +4 -0
  66. package/app/commerce/shopping-cli-source.js.map +1 -1
  67. package/app/demo/demo-runner.js +6 -0
  68. package/app/demo/demo-runner.js.map +1 -1
  69. package/app/discovery/catalog-source/kiwi-source.d.ts +2 -0
  70. package/app/discovery/catalog-source/kiwi-source.js +4 -0
  71. package/app/discovery/catalog-source/kiwi-source.js.map +1 -1
  72. package/app/handoff/destination.d.ts +2 -0
  73. package/app/handoff/destination.js +4 -0
  74. package/app/handoff/destination.js.map +1 -1
  75. package/app/handoff/index.d.ts +2 -1
  76. package/app/handoff/index.js +1 -0
  77. package/app/handoff/index.js.map +1 -1
  78. package/app/handoff/launch-marketplace-policy.d.ts +149 -0
  79. package/app/handoff/launch-marketplace-policy.js +301 -0
  80. package/app/handoff/launch-marketplace-policy.js.map +1 -0
  81. package/app/handoff/marketplace-product-link.d.ts +18 -0
  82. package/app/handoff/marketplace-product-link.js +71 -0
  83. package/app/handoff/marketplace-product-link.js.map +1 -0
  84. package/app/handoff/transaction.d.ts +30 -0
  85. package/app/handoff/transaction.js +64 -0
  86. package/app/handoff/transaction.js.map +1 -1
  87. package/app/handoff/url-safety.d.ts +3 -0
  88. package/app/handoff/url-safety.js +4 -0
  89. package/app/handoff/url-safety.js.map +1 -1
  90. package/app/http/merchant-management/page.js +176 -45
  91. package/app/http/merchant-management/page.js.map +1 -1
  92. package/app/i18n.d.ts +1 -0
  93. package/app/i18n.js +3 -0
  94. package/app/i18n.js.map +1 -1
  95. package/app/lifecycle/close.d.ts +24 -0
  96. package/app/lifecycle/close.js +131 -0
  97. package/app/lifecycle/close.js.map +1 -0
  98. package/app/mcp/merchant-runtime-assembly.js +6 -4
  99. package/app/mcp/merchant-runtime-assembly.js.map +1 -1
  100. package/app/mcp/tools.js +17 -16
  101. package/app/mcp/tools.js.map +1 -1
  102. package/app/merchant/application/service.d.ts +4 -0
  103. package/app/merchant/application/service.js.map +1 -1
  104. package/app/merchant/stats-store.d.ts +3 -0
  105. package/app/merchant/stats-store.js +15 -1
  106. package/app/merchant/stats-store.js.map +1 -1
  107. package/app/merchant-core/rfq/data-source-adapter.d.ts +2 -10
  108. package/app/merchant-core/rfq/data-source-adapter.js +21 -9
  109. package/app/merchant-core/rfq/data-source-adapter.js.map +1 -1
  110. package/app/merchant-gateway/pinned-fetch.js +5 -2
  111. package/app/merchant-gateway/pinned-fetch.js.map +1 -1
  112. package/build-manifest.json +4103 -3123
  113. package/node_modules/@earendil-works/chord/CHANGELOG.md +20 -0
  114. package/node_modules/@earendil-works/chord/README.md +77 -194
  115. package/node_modules/@earendil-works/chord/dist/cell.d.ts +101 -0
  116. package/node_modules/@earendil-works/chord/dist/cell.d.ts.map +1 -0
  117. package/node_modules/@earendil-works/chord/dist/cell.js +316 -0
  118. package/node_modules/@earendil-works/chord/dist/cell.js.map +1 -0
  119. package/node_modules/@earendil-works/chord/dist/cluster.d.ts +26 -0
  120. package/node_modules/@earendil-works/chord/dist/cluster.d.ts.map +1 -0
  121. package/node_modules/@earendil-works/chord/dist/cluster.js +214 -0
  122. package/node_modules/@earendil-works/chord/dist/cluster.js.map +1 -0
  123. package/node_modules/@earendil-works/chord/dist/connection.d.ts +157 -0
  124. package/node_modules/@earendil-works/chord/dist/connection.d.ts.map +1 -0
  125. package/node_modules/@earendil-works/chord/dist/connection.js +757 -0
  126. package/node_modules/@earendil-works/chord/dist/connection.js.map +1 -0
  127. package/node_modules/@earendil-works/chord/dist/context/index.d.ts +12 -1
  128. package/node_modules/@earendil-works/chord/dist/context/index.d.ts.map +1 -1
  129. package/node_modules/@earendil-works/chord/dist/context/index.js.map +1 -1
  130. package/node_modules/@earendil-works/chord/dist/contract.d.ts +133 -0
  131. package/node_modules/@earendil-works/chord/dist/contract.d.ts.map +1 -0
  132. package/node_modules/@earendil-works/chord/dist/contract.js +157 -0
  133. package/node_modules/@earendil-works/chord/dist/contract.js.map +1 -0
  134. package/node_modules/@earendil-works/chord/dist/declare.d.ts +70 -0
  135. package/node_modules/@earendil-works/chord/dist/declare.d.ts.map +1 -0
  136. package/node_modules/@earendil-works/chord/dist/declare.js +22 -0
  137. package/node_modules/@earendil-works/chord/dist/declare.js.map +1 -0
  138. package/node_modules/@earendil-works/chord/dist/delta/apply-immutable-trusted.js.map +1 -1
  139. package/node_modules/@earendil-works/chord/dist/delta/diff.d.ts +1 -1
  140. package/node_modules/@earendil-works/chord/dist/delta/diff.d.ts.map +1 -1
  141. package/node_modules/@earendil-works/chord/dist/delta/diff.js.map +1 -1
  142. package/node_modules/@earendil-works/chord/dist/delta/index.d.ts +2 -2
  143. package/node_modules/@earendil-works/chord/dist/delta/index.d.ts.map +1 -1
  144. package/node_modules/@earendil-works/chord/dist/delta/index.js +41 -0
  145. package/node_modules/@earendil-works/chord/dist/delta/index.js.map +1 -1
  146. package/node_modules/@earendil-works/chord/dist/delta/revision-validator.d.ts +1 -1
  147. package/node_modules/@earendil-works/chord/dist/delta/revision-validator.d.ts.map +1 -1
  148. package/node_modules/@earendil-works/chord/dist/delta/revision-validator.js.map +1 -1
  149. package/node_modules/@earendil-works/chord/dist/delta/tracker.d.ts +1 -1
  150. package/node_modules/@earendil-works/chord/dist/delta/tracker.d.ts.map +1 -1
  151. package/node_modules/@earendil-works/chord/dist/delta/tracker.js +40 -4
  152. package/node_modules/@earendil-works/chord/dist/delta/tracker.js.map +1 -1
  153. package/node_modules/@earendil-works/chord/dist/errors.d.ts +27 -0
  154. package/node_modules/@earendil-works/chord/dist/errors.d.ts.map +1 -0
  155. package/node_modules/@earendil-works/chord/dist/errors.js +44 -0
  156. package/node_modules/@earendil-works/chord/dist/errors.js.map +1 -0
  157. package/node_modules/@earendil-works/chord/dist/host.d.ts +254 -0
  158. package/node_modules/@earendil-works/chord/dist/host.d.ts.map +1 -0
  159. package/node_modules/@earendil-works/chord/dist/host.js +795 -0
  160. package/node_modules/@earendil-works/chord/dist/host.js.map +1 -0
  161. package/node_modules/@earendil-works/chord/dist/index.d.ts +17 -10
  162. package/node_modules/@earendil-works/chord/dist/index.d.ts.map +1 -1
  163. package/node_modules/@earendil-works/chord/dist/index.js +8 -8
  164. package/node_modules/@earendil-works/chord/dist/index.js.map +1 -1
  165. package/node_modules/@earendil-works/chord/dist/json.d.ts +9 -1
  166. package/node_modules/@earendil-works/chord/dist/json.d.ts.map +1 -1
  167. package/node_modules/@earendil-works/chord/dist/json.js.map +1 -1
  168. package/node_modules/@earendil-works/chord/dist/link.d.ts +72 -0
  169. package/node_modules/@earendil-works/chord/dist/link.d.ts.map +1 -0
  170. package/node_modules/@earendil-works/chord/dist/link.js +169 -0
  171. package/node_modules/@earendil-works/chord/dist/link.js.map +1 -0
  172. package/node_modules/@earendil-works/chord/dist/loader.d.ts +4 -0
  173. package/node_modules/@earendil-works/chord/dist/loader.d.ts.map +1 -0
  174. package/node_modules/@earendil-works/chord/dist/loader.js +68 -0
  175. package/node_modules/@earendil-works/chord/dist/loader.js.map +1 -0
  176. package/node_modules/@earendil-works/chord/dist/manager.d.ts +115 -0
  177. package/node_modules/@earendil-works/chord/dist/manager.d.ts.map +1 -0
  178. package/node_modules/@earendil-works/chord/dist/manager.js +319 -0
  179. package/node_modules/@earendil-works/chord/dist/manager.js.map +1 -0
  180. package/node_modules/@earendil-works/chord/dist/node.d.ts +3 -4
  181. package/node_modules/@earendil-works/chord/dist/node.d.ts.map +1 -1
  182. package/node_modules/@earendil-works/chord/dist/node.js +3 -2
  183. package/node_modules/@earendil-works/chord/dist/node.js.map +1 -1
  184. package/node_modules/@earendil-works/chord/dist/publish.d.ts +5 -0
  185. package/node_modules/@earendil-works/chord/dist/publish.d.ts.map +1 -0
  186. package/node_modules/@earendil-works/chord/dist/publish.js +40 -0
  187. package/node_modules/@earendil-works/chord/dist/publish.js.map +1 -0
  188. package/node_modules/@earendil-works/chord/dist/record.d.ts +320 -0
  189. package/node_modules/@earendil-works/chord/dist/record.d.ts.map +1 -0
  190. package/node_modules/@earendil-works/chord/dist/record.js +1292 -0
  191. package/node_modules/@earendil-works/chord/dist/record.js.map +1 -0
  192. package/node_modules/@earendil-works/chord/dist/registry.d.ts +25 -0
  193. package/node_modules/@earendil-works/chord/dist/registry.d.ts.map +1 -0
  194. package/node_modules/@earendil-works/chord/dist/registry.js +6 -0
  195. package/node_modules/@earendil-works/chord/dist/registry.js.map +1 -0
  196. package/node_modules/@earendil-works/chord/dist/reload.d.ts +118 -0
  197. package/node_modules/@earendil-works/chord/dist/reload.d.ts.map +1 -0
  198. package/node_modules/@earendil-works/chord/dist/reload.js +589 -0
  199. package/node_modules/@earendil-works/chord/dist/reload.js.map +1 -0
  200. package/node_modules/@earendil-works/chord/dist/remote.d.ts +70 -0
  201. package/node_modules/@earendil-works/chord/dist/remote.d.ts.map +1 -0
  202. package/node_modules/@earendil-works/chord/dist/remote.js +308 -0
  203. package/node_modules/@earendil-works/chord/dist/remote.js.map +1 -0
  204. package/node_modules/@earendil-works/chord/dist/schema.d.ts +21 -0
  205. package/node_modules/@earendil-works/chord/dist/schema.d.ts.map +1 -0
  206. package/node_modules/@earendil-works/chord/dist/schema.js +228 -0
  207. package/node_modules/@earendil-works/chord/dist/schema.js.map +1 -0
  208. package/node_modules/@earendil-works/chord/dist/state.d.ts +92 -0
  209. package/node_modules/@earendil-works/chord/dist/state.d.ts.map +1 -0
  210. package/node_modules/@earendil-works/chord/dist/{services/state.js → state.js} +28 -138
  211. package/node_modules/@earendil-works/chord/dist/state.js.map +1 -0
  212. package/node_modules/@earendil-works/chord/dist/types.d.ts +62 -262
  213. package/node_modules/@earendil-works/chord/dist/types.d.ts.map +1 -1
  214. package/node_modules/@earendil-works/chord/dist/types.js.map +1 -1
  215. package/node_modules/@earendil-works/chord/dist/websocket.d.ts +16 -0
  216. package/node_modules/@earendil-works/chord/dist/websocket.d.ts.map +1 -0
  217. package/node_modules/@earendil-works/chord/dist/websocket.js +15 -0
  218. package/node_modules/@earendil-works/chord/dist/websocket.js.map +1 -0
  219. package/node_modules/@earendil-works/chord/dist/wire.d.ts +135 -0
  220. package/node_modules/@earendil-works/chord/dist/wire.d.ts.map +1 -0
  221. package/node_modules/@earendil-works/chord/dist/wire.js +112 -0
  222. package/node_modules/@earendil-works/chord/dist/wire.js.map +1 -0
  223. package/node_modules/@earendil-works/chord/docs/guide.md +750 -0
  224. package/node_modules/@earendil-works/chord/docs/spec.md +261 -0
  225. package/node_modules/@earendil-works/chord/docs/tutorial.md +909 -0
  226. package/node_modules/@earendil-works/chord/package.json +10 -11
  227. package/node_modules/@earendil-works/chord/src/delta/README.md +5 -3
  228. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
  229. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js +9 -1
  230. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js.map +1 -1
  231. package/node_modules/@earendil-works/pi-agent-core/dist/proxy.d.ts +2 -5
  232. package/node_modules/@earendil-works/pi-agent-core/dist/proxy.d.ts.map +1 -1
  233. package/node_modules/@earendil-works/pi-agent-core/dist/proxy.js +2 -14
  234. package/node_modules/@earendil-works/pi-agent-core/dist/proxy.js.map +1 -1
  235. package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts +4 -0
  236. package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts.map +1 -1
  237. package/node_modules/@earendil-works/pi-agent-core/dist/types.js.map +1 -1
  238. package/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
  239. package/node_modules/@earendil-works/pi-ai/README.md +14 -3
  240. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.d.ts.map +1 -1
  241. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +63 -22
  242. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js.map +1 -1
  243. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-config.d.ts +15 -0
  244. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-config.d.ts.map +1 -0
  245. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-config.js +76 -0
  246. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-config.js.map +1 -0
  247. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.d.ts +3 -6
  248. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.d.ts.map +1 -1
  249. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js +2 -74
  250. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js.map +1 -1
  251. package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js +33 -2
  252. package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js.map +1 -1
  253. package/node_modules/@earendil-works/pi-ai/dist/api/classifier-shared.d.ts +21 -0
  254. package/node_modules/@earendil-works/pi-ai/dist/api/classifier-shared.d.ts.map +1 -0
  255. package/node_modules/@earendil-works/pi-ai/dist/api/classifier-shared.js +98 -0
  256. package/node_modules/@earendil-works/pi-ai/dist/api/classifier-shared.js.map +1 -0
  257. package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-workers-ai-system-one.d.ts.map +1 -1
  258. package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-workers-ai-system-one.js +2 -1
  259. package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-workers-ai-system-one.js.map +1 -1
  260. package/node_modules/@earendil-works/pi-ai/dist/api/lazy.d.ts.map +1 -1
  261. package/node_modules/@earendil-works/pi-ai/dist/api/lazy.js +4 -3
  262. package/node_modules/@earendil-works/pi-ai/dist/api/lazy.js.map +1 -1
  263. package/node_modules/@earendil-works/pi-ai/dist/api/llama-cpp-classify.d.ts.map +1 -1
  264. package/node_modules/@earendil-works/pi-ai/dist/api/llama-cpp-classify.js +2 -0
  265. package/node_modules/@earendil-works/pi-ai/dist/api/llama-cpp-classify.js.map +1 -1
  266. package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.d.ts.map +1 -1
  267. package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js +31 -14
  268. package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js.map +1 -1
  269. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.d.ts.map +1 -1
  270. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js +7 -4
  271. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js.map +1 -1
  272. package/node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.d.ts +4 -0
  273. package/node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.d.ts.map +1 -0
  274. package/node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.js +162 -0
  275. package/node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.js.map +1 -0
  276. package/node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.lazy.d.ts +3 -0
  277. package/node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.lazy.d.ts.map +1 -0
  278. package/node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.lazy.js +4 -0
  279. package/node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.lazy.js.map +1 -0
  280. package/node_modules/@earendil-works/pi-ai/dist/api/system-one-shared.d.ts +0 -1
  281. package/node_modules/@earendil-works/pi-ai/dist/api/system-one-shared.d.ts.map +1 -1
  282. package/node_modules/@earendil-works/pi-ai/dist/api/system-one-shared.js +5 -89
  283. package/node_modules/@earendil-works/pi-ai/dist/api/system-one-shared.js.map +1 -1
  284. package/node_modules/@earendil-works/pi-ai/dist/api/typesafe-system-one.d.ts.map +1 -1
  285. package/node_modules/@earendil-works/pi-ai/dist/api/typesafe-system-one.js +2 -1
  286. package/node_modules/@earendil-works/pi-ai/dist/api/typesafe-system-one.js.map +1 -1
  287. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/anthropic.d.ts.map +1 -1
  288. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/anthropic.js +14 -6
  289. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/anthropic.js.map +1 -1
  290. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openai-chatgpt.js +1 -1
  291. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openai-chatgpt.js.map +1 -1
  292. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openai-codex.d.ts.map +1 -1
  293. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openai-codex.js +4 -4
  294. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openai-codex.js.map +1 -1
  295. package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.d.ts +16 -1
  296. package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.d.ts.map +1 -1
  297. package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js +51 -27
  298. package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js.map +1 -1
  299. package/node_modules/@earendil-works/pi-ai/dist/auth/types.d.ts +5 -0
  300. package/node_modules/@earendil-works/pi-ai/dist/auth/types.d.ts.map +1 -1
  301. package/node_modules/@earendil-works/pi-ai/dist/auth/types.js.map +1 -1
  302. package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js +1 -1
  303. package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js.map +1 -1
  304. package/node_modules/@earendil-works/pi-ai/dist/models.d.ts +5 -0
  305. package/node_modules/@earendil-works/pi-ai/dist/models.d.ts.map +1 -1
  306. package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts +4 -4
  307. package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts.map +1 -1
  308. package/node_modules/@earendil-works/pi-ai/dist/models.generated.js +4 -4
  309. package/node_modules/@earendil-works/pi-ai/dist/models.generated.js.map +1 -1
  310. package/node_modules/@earendil-works/pi-ai/dist/models.js +7 -8
  311. package/node_modules/@earendil-works/pi-ai/dist/models.js.map +1 -1
  312. package/node_modules/@earendil-works/pi-ai/dist/providers/all.js +2 -2
  313. package/node_modules/@earendil-works/pi-ai/dist/providers/all.js.map +1 -1
  314. package/node_modules/@earendil-works/pi-ai/dist/providers/azure.d.ts +3 -0
  315. package/node_modules/@earendil-works/pi-ai/dist/providers/azure.d.ts.map +1 -0
  316. package/node_modules/@earendil-works/pi-ai/dist/providers/azure.js +46 -0
  317. package/node_modules/@earendil-works/pi-ai/dist/providers/azure.js.map +1 -0
  318. package/node_modules/@earendil-works/pi-ai/dist/providers/azure.models.d.ts +6 -0
  319. package/node_modules/@earendil-works/pi-ai/dist/providers/azure.models.d.ts.map +1 -0
  320. package/node_modules/@earendil-works/pi-ai/dist/providers/azure.models.js +8 -0
  321. package/node_modules/@earendil-works/pi-ai/dist/providers/azure.models.js.map +1 -0
  322. package/node_modules/@earendil-works/pi-ai/dist/providers/compat-schema.d.ts +338 -0
  323. package/node_modules/@earendil-works/pi-ai/dist/providers/compat-schema.d.ts.map +1 -0
  324. package/node_modules/@earendil-works/pi-ai/dist/providers/compat-schema.js +375 -0
  325. package/node_modules/@earendil-works/pi-ai/dist/providers/compat-schema.js.map +1 -0
  326. package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
  327. package/node_modules/@earendil-works/pi-ai/dist/providers/data/amazon-bedrock.json +1 -1
  328. package/node_modules/@earendil-works/pi-ai/dist/providers/data/anthropic.json +1 -1
  329. package/node_modules/@earendil-works/pi-ai/dist/providers/data/azure.json +1 -0
  330. package/node_modules/@earendil-works/pi-ai/dist/providers/data/baseten.json +1 -1
  331. package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-ai-gateway.json +1 -1
  332. package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-workers-ai.json +1 -1
  333. package/node_modules/@earendil-works/pi-ai/dist/providers/data/github-copilot.json +1 -1
  334. package/node_modules/@earendil-works/pi-ai/dist/providers/data/google-vertex.json +1 -1
  335. package/node_modules/@earendil-works/pi-ai/dist/providers/data/google.json +1 -1
  336. package/node_modules/@earendil-works/pi-ai/dist/providers/data/huggingface.json +1 -1
  337. package/node_modules/@earendil-works/pi-ai/dist/providers/data/meta.json +1 -1
  338. package/node_modules/@earendil-works/pi-ai/dist/providers/data/minimax-cn.json +1 -1
  339. package/node_modules/@earendil-works/pi-ai/dist/providers/data/minimax.json +1 -1
  340. package/node_modules/@earendil-works/pi-ai/dist/providers/data/mistral.json +1 -1
  341. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai.json +1 -1
  342. package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode-go.json +1 -1
  343. package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode.json +1 -1
  344. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
  345. package/node_modules/@earendil-works/pi-ai/dist/providers/data/radius.json +1 -1
  346. package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
  347. package/node_modules/@earendil-works/pi-ai/dist/providers/faux.d.ts.map +1 -1
  348. package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js +25 -8
  349. package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js.map +1 -1
  350. package/node_modules/@earendil-works/pi-ai/dist/providers/model-schema.d.ts +91 -0
  351. package/node_modules/@earendil-works/pi-ai/dist/providers/model-schema.d.ts.map +1 -0
  352. package/node_modules/@earendil-works/pi-ai/dist/providers/model-schema.js +55 -0
  353. package/node_modules/@earendil-works/pi-ai/dist/providers/model-schema.js.map +1 -0
  354. package/node_modules/@earendil-works/pi-ai/dist/providers/openai.d.ts.map +1 -1
  355. package/node_modules/@earendil-works/pi-ai/dist/providers/openai.js +12 -3
  356. package/node_modules/@earendil-works/pi-ai/dist/providers/openai.js.map +1 -1
  357. package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter-api.d.ts +40 -0
  358. package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter-api.d.ts.map +1 -0
  359. package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter-api.js +41 -0
  360. package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter-api.js.map +1 -0
  361. package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.d.ts +11 -1
  362. package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.d.ts.map +1 -1
  363. package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.js +52 -1
  364. package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.js.map +1 -1
  365. package/node_modules/@earendil-works/pi-ai/dist/providers/radius.d.ts.map +1 -1
  366. package/node_modules/@earendil-works/pi-ai/dist/providers/radius.js +4 -12
  367. package/node_modules/@earendil-works/pi-ai/dist/providers/radius.js.map +1 -1
  368. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +22 -305
  369. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
  370. package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -1
  371. package/node_modules/@earendil-works/pi-ai/dist/utils/estimate.js +1 -1
  372. package/node_modules/@earendil-works/pi-ai/dist/utils/estimate.js.map +1 -1
  373. package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.d.ts +10 -1
  374. package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.d.ts.map +1 -1
  375. package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js +25 -0
  376. package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js.map +1 -1
  377. package/node_modules/@earendil-works/pi-ai/dist/utils/model-operations.d.ts +3 -1
  378. package/node_modules/@earendil-works/pi-ai/dist/utils/model-operations.d.ts.map +1 -1
  379. package/node_modules/@earendil-works/pi-ai/dist/utils/model-operations.js +6 -0
  380. package/node_modules/@earendil-works/pi-ai/dist/utils/model-operations.js.map +1 -1
  381. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.d.ts +2 -0
  382. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.d.ts.map +1 -1
  383. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.js +2 -0
  384. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.js.map +1 -1
  385. package/node_modules/@earendil-works/pi-ai/dist/utils/retry.d.ts.map +1 -1
  386. package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +8 -2
  387. package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js.map +1 -1
  388. package/node_modules/@earendil-works/pi-ai/package.json +2 -2
  389. package/node_modules/@earendil-works/pi-codemode/README.md +177 -11
  390. package/node_modules/@earendil-works/pi-codemode/dist/cloudflare.d.ts +53 -0
  391. package/node_modules/@earendil-works/pi-codemode/dist/cloudflare.d.ts.map +1 -0
  392. package/node_modules/@earendil-works/pi-codemode/dist/cloudflare.js +64 -0
  393. package/node_modules/@earendil-works/pi-codemode/dist/cloudflare.js.map +1 -0
  394. package/node_modules/@earendil-works/pi-codemode/dist/declarations.d.ts +6 -21
  395. package/node_modules/@earendil-works/pi-codemode/dist/declarations.d.ts.map +1 -1
  396. package/node_modules/@earendil-works/pi-codemode/dist/declarations.js +113 -127
  397. package/node_modules/@earendil-works/pi-codemode/dist/declarations.js.map +1 -1
  398. package/node_modules/@earendil-works/pi-codemode/dist/index.d.ts +5 -2
  399. package/node_modules/@earendil-works/pi-codemode/dist/index.d.ts.map +1 -1
  400. package/node_modules/@earendil-works/pi-codemode/dist/index.js +4 -1
  401. package/node_modules/@earendil-works/pi-codemode/dist/index.js.map +1 -1
  402. package/node_modules/@earendil-works/pi-codemode/dist/portable.d.ts +15 -0
  403. package/node_modules/@earendil-works/pi-codemode/dist/portable.d.ts.map +1 -0
  404. package/node_modules/@earendil-works/pi-codemode/dist/portable.js +12 -0
  405. package/node_modules/@earendil-works/pi-codemode/dist/portable.js.map +1 -0
  406. package/node_modules/@earendil-works/pi-codemode/dist/runtime/execution.d.ts +66 -0
  407. package/node_modules/@earendil-works/pi-codemode/dist/runtime/execution.d.ts.map +1 -0
  408. package/node_modules/@earendil-works/pi-codemode/dist/runtime/execution.js +494 -0
  409. package/node_modules/@earendil-works/pi-codemode/dist/runtime/execution.js.map +1 -0
  410. package/node_modules/@earendil-works/pi-codemode/dist/runtime/host.d.ts +8 -30
  411. package/node_modules/@earendil-works/pi-codemode/dist/runtime/host.d.ts.map +1 -1
  412. package/node_modules/@earendil-works/pi-codemode/dist/runtime/host.js +41 -283
  413. package/node_modules/@earendil-works/pi-codemode/dist/runtime/host.js.map +1 -1
  414. package/node_modules/@earendil-works/pi-codemode/dist/runtime/inline.d.ts +63 -0
  415. package/node_modules/@earendil-works/pi-codemode/dist/runtime/inline.d.ts.map +1 -0
  416. package/node_modules/@earendil-works/pi-codemode/dist/runtime/inline.js +80 -0
  417. package/node_modules/@earendil-works/pi-codemode/dist/runtime/inline.js.map +1 -0
  418. package/node_modules/@earendil-works/pi-codemode/dist/runtime/prelude-source.d.ts +9 -3
  419. package/node_modules/@earendil-works/pi-codemode/dist/runtime/prelude-source.d.ts.map +1 -1
  420. package/node_modules/@earendil-works/pi-codemode/dist/runtime/prelude-source.js +122 -12
  421. package/node_modules/@earendil-works/pi-codemode/dist/runtime/prelude-source.js.map +1 -1
  422. package/node_modules/@earendil-works/pi-codemode/dist/runtime/protocol.d.ts +47 -6
  423. package/node_modules/@earendil-works/pi-codemode/dist/runtime/protocol.d.ts.map +1 -1
  424. package/node_modules/@earendil-works/pi-codemode/dist/runtime/protocol.js +6 -1
  425. package/node_modules/@earendil-works/pi-codemode/dist/runtime/protocol.js.map +1 -1
  426. package/node_modules/@earendil-works/pi-codemode/dist/runtime/remote.d.ts +102 -0
  427. package/node_modules/@earendil-works/pi-codemode/dist/runtime/remote.d.ts.map +1 -0
  428. package/node_modules/@earendil-works/pi-codemode/dist/runtime/remote.js +175 -0
  429. package/node_modules/@earendil-works/pi-codemode/dist/runtime/remote.js.map +1 -0
  430. package/node_modules/@earendil-works/pi-codemode/dist/runtime/vm.d.ts +24 -0
  431. package/node_modules/@earendil-works/pi-codemode/dist/runtime/vm.d.ts.map +1 -0
  432. package/node_modules/@earendil-works/pi-codemode/dist/runtime/vm.js +293 -0
  433. package/node_modules/@earendil-works/pi-codemode/dist/runtime/vm.js.map +1 -0
  434. package/node_modules/@earendil-works/pi-codemode/dist/runtime/worker.js +11 -110
  435. package/node_modules/@earendil-works/pi-codemode/dist/runtime/worker.js.map +1 -1
  436. package/node_modules/@earendil-works/pi-codemode/dist/source.d.ts +2 -1
  437. package/node_modules/@earendil-works/pi-codemode/dist/source.d.ts.map +1 -1
  438. package/node_modules/@earendil-works/pi-codemode/dist/source.js +8 -2
  439. package/node_modules/@earendil-works/pi-codemode/dist/source.js.map +1 -1
  440. package/node_modules/@earendil-works/pi-codemode/dist/types.d.ts +101 -6
  441. package/node_modules/@earendil-works/pi-codemode/dist/types.d.ts.map +1 -1
  442. package/node_modules/@earendil-works/pi-codemode/dist/types.js.map +1 -1
  443. package/node_modules/@earendil-works/pi-codemode/package.json +15 -3
  444. package/node_modules/@earendil-works/pi-coding-agent/CHANGELOG.md +165 -0
  445. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/anthropic-messages-Q7SXESRX.js +6 -0
  446. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/anthropic.js +1 -1
  447. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/azure-openai-responses-LM52U7CK.js +2 -0
  448. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/bedrock-converse-stream.js +2 -2
  449. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-22CYIUS4.js +2 -0
  450. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-3ZATHNCK.js +9 -0
  451. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-5GTPJSRI.js +7 -0
  452. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-6MWTY2OB.js +130 -0
  453. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-6QGV3IWD.js +6 -0
  454. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-2KAZSACP.js → chunk-AKJ3ZOR3.js} +1 -1
  455. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-G7EDXK4D.js → chunk-CQ3XTLTY.js} +1 -1
  456. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-SYF2TF6W.js → chunk-D7PHKNBM.js} +29 -92
  457. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-DOST5PQW.js +82 -0
  458. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-DVQEBGVL.js +2 -0
  459. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-ZSI3BL5Q.js → chunk-GDR5JFDJ.js} +1 -1
  460. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-HACVPRBJ.js +11 -0
  461. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-ITZNWD4K.js +2 -0
  462. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-LPXNMA2W.js +2 -0
  463. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-LD2P6SFZ.js → chunk-PMRZO46Y.js} +1 -1
  464. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-RDZVAGPR.js +2 -0
  465. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-ZSBPJAJ2.js → chunk-TJXZSVTD.js} +116 -99
  466. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-BYB6ZAAQ.js → chunk-TN4NLWHF.js} +1 -1
  467. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-WBQBCFWG.js +2 -0
  468. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-WJUNYZC5.js +2 -0
  469. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-XIX7LUWI.js +2 -0
  470. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-ZBURYEWF.js +2 -0
  471. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{cli-KILDDGW3.js → cli-SWM4FQ6V.js} +4 -4
  472. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/cloudflare-workers-ai-system-one-UTBL2KOF.js +2 -0
  473. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/codemode-worker.js +117 -14
  474. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/easter-egg-3d-OX6RUCIS.js +2 -0
  475. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/execute-3CFUPDLS.js +499 -0
  476. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/github-copilot.js +1 -1
  477. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{google-generative-ai-ZOK6CV7D.js → google-generative-ai-DXKP72HC.js} +1 -1
  478. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{google-vertex-VKWZQ3AY.js → google-vertex-W6SIDOVV.js} +1 -1
  479. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/image-resize-worker.js +1 -1
  480. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{llama-cpp-classify-XT44PI3C.js → llama-cpp-classify-FYN623RH.js} +2 -2
  481. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/mistral-conversations-GBMHTSYF.js +5 -0
  482. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/openai-chatgpt.js +1 -1
  483. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/openai-codex-responses-RN6B5UPP.js +10 -0
  484. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/openai-codex.js +1 -1
  485. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{openai-completions-GWHGMQ3T.js → openai-completions-QW2B4SML.js} +1 -1
  486. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/openai-decisions-WVPMQ4JD.js +5 -0
  487. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{openai-responses-EZ7FJ2KL.js → openai-responses-KDJUSIU7.js} +1 -1
  488. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{openrouter-images-ZVXWCSIM.js → openrouter-images-DUPG5DZO.js} +1 -1
  489. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{pi-messages-TM5SOOIW.js → pi-messages-YHKPQIHC.js} +1 -1
  490. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/runtime-366HE7CW.js +2 -0
  491. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/typesafe-system-one-ZSK3RN4B.js +2 -0
  492. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/virtual-modules-GI6FRNLG.js +2 -0
  493. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/cli-runtime.js +1 -1
  494. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/index.js +1 -1
  495. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/rpc-entry.js +1 -1
  496. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.d.ts +2 -1
  497. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.d.ts.map +1 -1
  498. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.js +24 -5
  499. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.js.map +1 -1
  500. package/node_modules/@earendil-works/pi-coding-agent/dist/config.d.ts +18 -1
  501. package/node_modules/@earendil-works/pi-coding-agent/dist/config.d.ts.map +1 -1
  502. package/node_modules/@earendil-works/pi-coding-agent/dist/config.js +44 -6
  503. package/node_modules/@earendil-works/pi-coding-agent/dist/config.js.map +1 -1
  504. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.d.ts +47 -5
  505. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
  506. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js +148 -78
  507. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js.map +1 -1
  508. package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.d.ts.map +1 -1
  509. package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.js +20 -13
  510. package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.js.map +1 -1
  511. package/node_modules/@earendil-works/pi-coding-agent/dist/core/bash-executor.d.ts.map +1 -1
  512. package/node_modules/@earendil-works/pi-coding-agent/dist/core/bash-executor.js +42 -52
  513. package/node_modules/@earendil-works/pi-coding-agent/dist/core/bash-executor.js.map +1 -1
  514. package/node_modules/@earendil-works/pi-coding-agent/dist/core/bug-report.d.ts +9 -1
  515. package/node_modules/@earendil-works/pi-coding-agent/dist/core/bug-report.d.ts.map +1 -1
  516. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/utils.d.ts +6 -0
  517. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/utils.d.ts.map +1 -1
  518. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/utils.js +7 -8
  519. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/utils.js.map +1 -1
  520. package/node_modules/@earendil-works/pi-coding-agent/dist/core/export-html/tool-renderer.d.ts.map +1 -1
  521. package/node_modules/@earendil-works/pi-coding-agent/dist/core/export-html/tool-renderer.js +2 -0
  522. package/node_modules/@earendil-works/pi-coding-agent/dist/core/export-html/tool-renderer.js.map +1 -1
  523. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/index.d.ts +1 -1
  524. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/index.d.ts.map +1 -1
  525. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/index.js.map +1 -1
  526. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.d.ts +4 -2
  527. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.d.ts.map +1 -1
  528. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.js +2 -3
  529. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.js.map +1 -1
  530. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/types.d.ts +44 -7
  531. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/types.d.ts.map +1 -1
  532. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/types.js.map +1 -1
  533. package/node_modules/@earendil-works/pi-coding-agent/dist/core/key-id-schema.d.ts +6 -0
  534. package/node_modules/@earendil-works/pi-coding-agent/dist/core/key-id-schema.d.ts.map +1 -0
  535. package/node_modules/@earendil-works/pi-coding-agent/dist/core/key-id-schema.js +16 -0
  536. package/node_modules/@earendil-works/pi-coding-agent/dist/core/key-id-schema.js.map +1 -0
  537. package/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings-schema.d.ts +4 -0
  538. package/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings-schema.d.ts.map +1 -0
  539. package/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings-schema.js +16 -0
  540. package/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings-schema.js.map +1 -0
  541. package/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings.d.ts +198 -66
  542. package/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings.d.ts.map +1 -1
  543. package/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings.js +26 -23
  544. package/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings.js.map +1 -1
  545. package/node_modules/@earendil-works/pi-coding-agent/dist/core/mcp-servers.d.ts +8 -0
  546. package/node_modules/@earendil-works/pi-coding-agent/dist/core/mcp-servers.d.ts.map +1 -1
  547. package/node_modules/@earendil-works/pi-coding-agent/dist/core/mcp-servers.js +30 -7
  548. package/node_modules/@earendil-works/pi-coding-agent/dist/core/mcp-servers.js.map +1 -1
  549. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-config.d.ts +695 -74
  550. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-config.d.ts.map +1 -1
  551. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-config.js +16 -166
  552. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-config.js.map +1 -1
  553. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.js +1 -1
  554. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.js.map +1 -1
  555. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-runtime.d.ts.map +1 -1
  556. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-runtime.js +13 -7
  557. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-runtime.js.map +1 -1
  558. package/node_modules/@earendil-works/pi-coding-agent/dist/core/nested-tool-calls.d.ts +1 -0
  559. package/node_modules/@earendil-works/pi-coding-agent/dist/core/nested-tool-calls.d.ts.map +1 -1
  560. package/node_modules/@earendil-works/pi-coding-agent/dist/core/nested-tool-calls.js +1 -0
  561. package/node_modules/@earendil-works/pi-coding-agent/dist/core/nested-tool-calls.js.map +1 -1
  562. package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.d.ts.map +1 -1
  563. package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.js +3 -3
  564. package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.js.map +1 -1
  565. package/node_modules/@earendil-works/pi-coding-agent/dist/core/project-trust.d.ts.map +1 -1
  566. package/node_modules/@earendil-works/pi-coding-agent/dist/core/project-trust.js +2 -1
  567. package/node_modules/@earendil-works/pi-coding-agent/dist/core/project-trust.js.map +1 -1
  568. package/node_modules/@earendil-works/pi-coding-agent/dist/core/remote-catalog-provider.d.ts +12 -1
  569. package/node_modules/@earendil-works/pi-coding-agent/dist/core/remote-catalog-provider.d.ts.map +1 -1
  570. package/node_modules/@earendil-works/pi-coding-agent/dist/core/remote-catalog-provider.js +82 -24
  571. package/node_modules/@earendil-works/pi-coding-agent/dist/core/remote-catalog-provider.js.map +1 -1
  572. package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.d.ts +3 -0
  573. package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.d.ts.map +1 -1
  574. package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.js +9 -4
  575. package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.js.map +1 -1
  576. package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.d.ts +13 -4
  577. package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.d.ts.map +1 -1
  578. package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.js +19 -6
  579. package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.js.map +1 -1
  580. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-defaults.d.ts +65 -0
  581. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-defaults.d.ts.map +1 -0
  582. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-defaults.js +66 -0
  583. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-defaults.js.map +1 -0
  584. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.d.ts +15 -145
  585. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -1
  586. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.js +85 -57
  587. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.js.map +1 -1
  588. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-schema.d.ts +228 -0
  589. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-schema.d.ts.map +1 -0
  590. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-schema.js +287 -0
  591. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-schema.js.map +1 -0
  592. package/node_modules/@earendil-works/pi-coding-agent/dist/core/skills.d.ts +4 -1
  593. package/node_modules/@earendil-works/pi-coding-agent/dist/core/skills.d.ts.map +1 -1
  594. package/node_modules/@earendil-works/pi-coding-agent/dist/core/skills.js +6 -1
  595. package/node_modules/@earendil-works/pi-coding-agent/dist/core/skills.js.map +1 -1
  596. package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.d.ts +6 -0
  597. package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.d.ts.map +1 -1
  598. package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.js +9 -4
  599. package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.js.map +1 -1
  600. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/output-accumulator.d.ts.map +1 -1
  601. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/output-accumulator.js +4 -10
  602. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/output-accumulator.js.map +1 -1
  603. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.d.ts +13 -0
  604. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.d.ts.map +1 -1
  605. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.js +18 -1
  606. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.js.map +1 -1
  607. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/render-utils.d.ts +18 -0
  608. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/render-utils.d.ts.map +1 -1
  609. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/render-utils.js +46 -0
  610. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/render-utils.js.map +1 -1
  611. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/renderers/bash.d.ts.map +1 -1
  612. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/renderers/bash.js +7 -35
  613. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/renderers/bash.js.map +1 -1
  614. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/renderers/edit.d.ts.map +1 -1
  615. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/renderers/edit.js +5 -4
  616. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/renderers/edit.js.map +1 -1
  617. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/execute.d.ts.map +1 -1
  618. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/execute.js +165 -48
  619. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/execute.js.map +1 -1
  620. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/index.d.ts.map +1 -1
  621. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/index.js +3 -1
  622. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/index.js.map +1 -1
  623. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/renderer.d.ts +2 -2
  624. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/renderer.d.ts.map +1 -1
  625. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/renderer.js +9 -3
  626. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/renderer.js.map +1 -1
  627. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/tool.d.ts +15 -14
  628. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/tool.d.ts.map +1 -1
  629. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/tool.js +58 -38
  630. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/tool.js.map +1 -1
  631. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/llama/provider.d.ts.map +1 -1
  632. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/llama/provider.js +34 -11
  633. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/llama/provider.js.map +1 -1
  634. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/cli.js +22 -31
  635. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/cli.js.map +1 -1
  636. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/index.d.ts.map +1 -1
  637. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/index.js +188 -84
  638. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/index.js.map +1 -1
  639. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/oauth.d.ts +5 -3
  640. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/oauth.d.ts.map +1 -1
  641. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/oauth.js +36 -10
  642. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/oauth.js.map +1 -1
  643. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/resources.d.ts +3 -10
  644. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/resources.d.ts.map +1 -1
  645. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/resources.js +4 -5
  646. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/resources.js.map +1 -1
  647. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/runtime.d.ts +7 -7
  648. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/runtime.d.ts.map +1 -1
  649. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/runtime.js +26 -44
  650. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/runtime.js.map +1 -1
  651. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/tools.d.ts +4 -4
  652. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/tools.d.ts.map +1 -1
  653. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/tools.js +68 -16
  654. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/tools.js.map +1 -1
  655. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/ui.d.ts +3 -3
  656. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/ui.d.ts.map +1 -1
  657. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/ui.js +10 -2
  658. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/ui.js.map +1 -1
  659. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/tool-search/tool.d.ts +0 -2
  660. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/tool-search/tool.d.ts.map +1 -1
  661. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/tool-search/tool.js +2 -4
  662. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/tool-search/tool.js.map +1 -1
  663. package/node_modules/@earendil-works/pi-coding-agent/dist/index.d.ts +1 -1
  664. package/node_modules/@earendil-works/pi-coding-agent/dist/index.d.ts.map +1 -1
  665. package/node_modules/@earendil-works/pi-coding-agent/dist/index.js.map +1 -1
  666. package/node_modules/@earendil-works/pi-coding-agent/dist/main.d.ts.map +1 -1
  667. package/node_modules/@earendil-works/pi-coding-agent/dist/main.js +4 -3
  668. package/node_modules/@earendil-works/pi-coding-agent/dist/main.js.map +1 -1
  669. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/bash-execution.d.ts +5 -1
  670. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
  671. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/bash-execution.js +17 -14
  672. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/bash-execution.js.map +1 -1
  673. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/branch-summary-message.d.ts +2 -1
  674. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
  675. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/branch-summary-message.js +5 -2
  676. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
  677. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.d.ts +2 -1
  678. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
  679. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.js +5 -2
  680. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
  681. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-entry.d.ts +3 -1
  682. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
  683. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-entry.js +8 -2
  684. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-entry.js.map +1 -1
  685. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
  686. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-message.js +1 -0
  687. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-message.js.map +1 -1
  688. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  689. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-selector.js +4 -3
  690. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-selector.js.map +1 -1
  691. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.d.ts +2 -1
  692. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
  693. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.js +5 -2
  694. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
  695. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/status-indicator.d.ts +1 -1
  696. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
  697. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/status-indicator.js +2 -2
  698. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/status-indicator.js.map +1 -1
  699. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts +5 -0
  700. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  701. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +10 -0
  702. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
  703. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +9 -0
  704. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  705. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js +103 -40
  706. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
  707. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/program-status-reporter.d.ts +34 -0
  708. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/program-status-reporter.d.ts.map +1 -0
  709. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/program-status-reporter.js +110 -0
  710. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/program-status-reporter.js.map +1 -0
  711. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/dark.json +1 -1
  712. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/light.json +1 -1
  713. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-schema.d.ts +28 -0
  714. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-schema.d.ts.map +1 -0
  715. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-schema.js +105 -0
  716. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-schema.js.map +1 -0
  717. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-tokens.d.ts +257 -0
  718. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-tokens.d.ts.map +1 -0
  719. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-tokens.js +94 -0
  720. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-tokens.js.map +1 -0
  721. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts +13 -16
  722. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  723. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme.js +22 -29
  724. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme.js.map +1 -1
  725. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/print-mode.d.ts.map +1 -1
  726. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/print-mode.js +4 -0
  727. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/print-mode.js.map +1 -1
  728. package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.d.ts.map +1 -1
  729. package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.js +24 -0
  730. package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.js.map +1 -1
  731. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/ansi.d.ts +8 -0
  732. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/ansi.d.ts.map +1 -1
  733. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/ansi.js +30 -11
  734. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/ansi.js.map +1 -1
  735. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/clipboard.d.ts.map +1 -1
  736. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/clipboard.js +18 -12
  737. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/clipboard.js.map +1 -1
  738. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-core.d.ts +12 -0
  739. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-core.d.ts.map +1 -1
  740. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-core.js +5 -0
  741. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-core.js.map +1 -1
  742. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-worker.js +3 -2
  743. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-worker.js.map +1 -1
  744. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize.d.ts.map +1 -1
  745. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize.js +9 -10
  746. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize.js.map +1 -1
  747. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/output-files.d.ts +15 -0
  748. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/output-files.d.ts.map +1 -0
  749. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/output-files.js +30 -0
  750. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/output-files.js.map +1 -0
  751. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/syntax-highlight.d.ts.map +1 -1
  752. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/syntax-highlight.js +6 -1
  753. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/syntax-highlight.js.map +1 -1
  754. package/node_modules/@earendil-works/pi-coding-agent/docs/cli-integration.md +1 -1
  755. package/node_modules/@earendil-works/pi-coding-agent/docs/cli.md +19 -7
  756. package/node_modules/@earendil-works/pi-coding-agent/docs/codemode.md +30 -9
  757. package/node_modules/@earendil-works/pi-coding-agent/docs/compaction.md +2 -2
  758. package/node_modules/@earendil-works/pi-coding-agent/docs/environment-variables.md +3 -1
  759. package/node_modules/@earendil-works/pi-coding-agent/docs/extensions.md +7 -4
  760. package/node_modules/@earendil-works/pi-coding-agent/docs/json.md +3 -3
  761. package/node_modules/@earendil-works/pi-coding-agent/docs/keybindings.md +5 -4
  762. package/node_modules/@earendil-works/pi-coding-agent/docs/llama-cpp.md +8 -1
  763. package/node_modules/@earendil-works/pi-coding-agent/docs/mcp.md +4 -2
  764. package/node_modules/@earendil-works/pi-coding-agent/docs/message-types.md +22 -4
  765. package/node_modules/@earendil-works/pi-coding-agent/docs/models.md +5 -1
  766. package/node_modules/@earendil-works/pi-coding-agent/docs/providers.md +47 -0
  767. package/node_modules/@earendil-works/pi-coding-agent/docs/settings.md +6 -4
  768. package/node_modules/@earendil-works/pi-coding-agent/docs/terminal-setup.md +14 -0
  769. package/node_modules/@earendil-works/pi-coding-agent/docs/themes.md +4 -2
  770. package/node_modules/@earendil-works/pi-coding-agent/docs/tui.md +1 -1
  771. package/node_modules/@earendil-works/pi-coding-agent/examples/README.md +0 -3
  772. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  773. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-anthropic/package.json +1 -1
  774. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  775. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/dynamic-resources/dynamic.json +1 -1
  776. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/gondolin/package-lock.json +2 -2
  777. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/gondolin/package.json +1 -1
  778. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/overlay-test.ts +2 -2
  779. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/plan-mode/index.ts +6 -2
  780. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/sandbox/package-lock.json +2 -2
  781. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/sandbox/package.json +1 -1
  782. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/with-deps/package-lock.json +2 -2
  783. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/with-deps/package.json +1 -1
  784. package/node_modules/@earendil-works/pi-coding-agent/package.json +10 -21
  785. package/node_modules/@earendil-works/pi-coding-agent/schemas/keybindings.schema.json +393 -0
  786. package/node_modules/@earendil-works/pi-coding-agent/schemas/models.schema.json +1157 -0
  787. package/node_modules/@earendil-works/pi-coding-agent/schemas/settings.schema.json +765 -0
  788. package/node_modules/@earendil-works/pi-coding-agent/schemas/theme.schema.json +365 -0
  789. package/node_modules/@earendil-works/pi-durable/CHANGELOG.md +114 -0
  790. package/node_modules/@earendil-works/pi-durable/README.md +164 -12
  791. package/node_modules/@earendil-works/pi-durable/dist/codemode/codemode.d.ts +173 -0
  792. package/node_modules/@earendil-works/pi-durable/dist/codemode/codemode.d.ts.map +1 -0
  793. package/node_modules/@earendil-works/pi-durable/dist/codemode/codemode.js +886 -0
  794. package/node_modules/@earendil-works/pi-durable/dist/codemode/codemode.js.map +1 -0
  795. package/node_modules/@earendil-works/pi-durable/dist/codemode/describe.d.ts +38 -0
  796. package/node_modules/@earendil-works/pi-durable/dist/codemode/describe.d.ts.map +1 -0
  797. package/node_modules/@earendil-works/pi-durable/dist/codemode/describe.js +119 -0
  798. package/node_modules/@earendil-works/pi-durable/dist/codemode/describe.js.map +1 -0
  799. package/node_modules/@earendil-works/pi-durable/dist/codemode/index.d.ts +3 -0
  800. package/node_modules/@earendil-works/pi-durable/dist/codemode/index.d.ts.map +1 -0
  801. package/node_modules/@earendil-works/pi-durable/dist/codemode/index.js +3 -0
  802. package/node_modules/@earendil-works/pi-durable/dist/codemode/index.js.map +1 -0
  803. package/node_modules/@earendil-works/pi-durable/dist/codemode/models.d.ts +28 -0
  804. package/node_modules/@earendil-works/pi-durable/dist/codemode/models.d.ts.map +1 -0
  805. package/node_modules/@earendil-works/pi-durable/dist/codemode/models.js +231 -0
  806. package/node_modules/@earendil-works/pi-durable/dist/codemode/models.js.map +1 -0
  807. package/node_modules/@earendil-works/pi-durable/dist/codemode/output.d.ts +41 -0
  808. package/node_modules/@earendil-works/pi-durable/dist/codemode/output.d.ts.map +1 -0
  809. package/node_modules/@earendil-works/pi-durable/dist/codemode/output.js +167 -0
  810. package/node_modules/@earendil-works/pi-durable/dist/codemode/output.js.map +1 -0
  811. package/node_modules/@earendil-works/pi-durable/dist/env/decode.d.ts +16 -0
  812. package/node_modules/@earendil-works/pi-durable/dist/env/decode.d.ts.map +1 -0
  813. package/node_modules/@earendil-works/pi-durable/dist/env/decode.js +28 -0
  814. package/node_modules/@earendil-works/pi-durable/dist/env/decode.js.map +1 -0
  815. package/node_modules/@earendil-works/pi-durable/dist/env/index.d.ts +197 -3
  816. package/node_modules/@earendil-works/pi-durable/dist/env/index.d.ts.map +1 -1
  817. package/node_modules/@earendil-works/pi-durable/dist/env/index.js +2 -0
  818. package/node_modules/@earendil-works/pi-durable/dist/env/index.js.map +1 -1
  819. package/node_modules/@earendil-works/pi-durable/dist/env/line-scan.d.ts +13 -0
  820. package/node_modules/@earendil-works/pi-durable/dist/env/line-scan.d.ts.map +1 -0
  821. package/node_modules/@earendil-works/pi-durable/dist/env/line-scan.js +147 -0
  822. package/node_modules/@earendil-works/pi-durable/dist/env/line-scan.js.map +1 -0
  823. package/node_modules/@earendil-works/pi-durable/dist/env/node-watch.d.ts +29 -0
  824. package/node_modules/@earendil-works/pi-durable/dist/env/node-watch.d.ts.map +1 -0
  825. package/node_modules/@earendil-works/pi-durable/dist/env/node-watch.js +485 -0
  826. package/node_modules/@earendil-works/pi-durable/dist/env/node-watch.js.map +1 -0
  827. package/node_modules/@earendil-works/pi-durable/dist/env/node.d.ts +11 -2
  828. package/node_modules/@earendil-works/pi-durable/dist/env/node.d.ts.map +1 -1
  829. package/node_modules/@earendil-works/pi-durable/dist/env/node.js +284 -21
  830. package/node_modules/@earendil-works/pi-durable/dist/env/node.js.map +1 -1
  831. package/node_modules/@earendil-works/pi-durable/dist/errors.d.ts +20 -3
  832. package/node_modules/@earendil-works/pi-durable/dist/errors.d.ts.map +1 -1
  833. package/node_modules/@earendil-works/pi-durable/dist/errors.js +34 -5
  834. package/node_modules/@earendil-works/pi-durable/dist/errors.js.map +1 -1
  835. package/node_modules/@earendil-works/pi-durable/dist/harness/agent.d.ts +7 -3
  836. package/node_modules/@earendil-works/pi-durable/dist/harness/agent.d.ts.map +1 -1
  837. package/node_modules/@earendil-works/pi-durable/dist/harness/agent.js +81 -25
  838. package/node_modules/@earendil-works/pi-durable/dist/harness/agent.js.map +1 -1
  839. package/node_modules/@earendil-works/pi-durable/dist/harness/compaction.d.ts +6 -1
  840. package/node_modules/@earendil-works/pi-durable/dist/harness/compaction.d.ts.map +1 -1
  841. package/node_modules/@earendil-works/pi-durable/dist/harness/compaction.js +11 -8
  842. package/node_modules/@earendil-works/pi-durable/dist/harness/compaction.js.map +1 -1
  843. package/node_modules/@earendil-works/pi-durable/dist/harness/context.d.ts +29 -1
  844. package/node_modules/@earendil-works/pi-durable/dist/harness/context.d.ts.map +1 -1
  845. package/node_modules/@earendil-works/pi-durable/dist/harness/context.js +125 -24
  846. package/node_modules/@earendil-works/pi-durable/dist/harness/context.js.map +1 -1
  847. package/node_modules/@earendil-works/pi-durable/dist/harness/events.d.ts +35 -15
  848. package/node_modules/@earendil-works/pi-durable/dist/harness/events.d.ts.map +1 -1
  849. package/node_modules/@earendil-works/pi-durable/dist/harness/events.js +77 -23
  850. package/node_modules/@earendil-works/pi-durable/dist/harness/events.js.map +1 -1
  851. package/node_modules/@earendil-works/pi-durable/dist/harness/generation.d.ts +2 -0
  852. package/node_modules/@earendil-works/pi-durable/dist/harness/generation.d.ts.map +1 -1
  853. package/node_modules/@earendil-works/pi-durable/dist/harness/generation.js +40 -16
  854. package/node_modules/@earendil-works/pi-durable/dist/harness/generation.js.map +1 -1
  855. package/node_modules/@earendil-works/pi-durable/dist/harness/harness.d.ts +7 -0
  856. package/node_modules/@earendil-works/pi-durable/dist/harness/harness.d.ts.map +1 -1
  857. package/node_modules/@earendil-works/pi-durable/dist/harness/harness.js +56 -28
  858. package/node_modules/@earendil-works/pi-durable/dist/harness/harness.js.map +1 -1
  859. package/node_modules/@earendil-works/pi-durable/dist/harness/inbox.d.ts +16 -4
  860. package/node_modules/@earendil-works/pi-durable/dist/harness/inbox.d.ts.map +1 -1
  861. package/node_modules/@earendil-works/pi-durable/dist/harness/inbox.js +26 -3
  862. package/node_modules/@earendil-works/pi-durable/dist/harness/inbox.js.map +1 -1
  863. package/node_modules/@earendil-works/pi-durable/dist/harness/live.d.ts +74 -17
  864. package/node_modules/@earendil-works/pi-durable/dist/harness/live.d.ts.map +1 -1
  865. package/node_modules/@earendil-works/pi-durable/dist/harness/live.js +66 -14
  866. package/node_modules/@earendil-works/pi-durable/dist/harness/live.js.map +1 -1
  867. package/node_modules/@earendil-works/pi-durable/dist/harness/output.d.ts +13 -6
  868. package/node_modules/@earendil-works/pi-durable/dist/harness/output.d.ts.map +1 -1
  869. package/node_modules/@earendil-works/pi-durable/dist/harness/output.js +75 -18
  870. package/node_modules/@earendil-works/pi-durable/dist/harness/output.js.map +1 -1
  871. package/node_modules/@earendil-works/pi-durable/dist/harness/scheduler.d.ts +18 -5
  872. package/node_modules/@earendil-works/pi-durable/dist/harness/scheduler.d.ts.map +1 -1
  873. package/node_modules/@earendil-works/pi-durable/dist/harness/scheduler.js +794 -168
  874. package/node_modules/@earendil-works/pi-durable/dist/harness/scheduler.js.map +1 -1
  875. package/node_modules/@earendil-works/pi-durable/dist/harness/submissions.d.ts +7 -4
  876. package/node_modules/@earendil-works/pi-durable/dist/harness/submissions.d.ts.map +1 -1
  877. package/node_modules/@earendil-works/pi-durable/dist/harness/submissions.js +32 -13
  878. package/node_modules/@earendil-works/pi-durable/dist/harness/submissions.js.map +1 -1
  879. package/node_modules/@earendil-works/pi-durable/dist/harness/task-graph.d.ts +1 -1
  880. package/node_modules/@earendil-works/pi-durable/dist/harness/task-graph.d.ts.map +1 -1
  881. package/node_modules/@earendil-works/pi-durable/dist/harness/task-graph.js +15 -10
  882. package/node_modules/@earendil-works/pi-durable/dist/harness/task-graph.js.map +1 -1
  883. package/node_modules/@earendil-works/pi-durable/dist/harness/tool.d.ts +45 -5
  884. package/node_modules/@earendil-works/pi-durable/dist/harness/tool.d.ts.map +1 -1
  885. package/node_modules/@earendil-works/pi-durable/dist/harness/tool.js +400 -67
  886. package/node_modules/@earendil-works/pi-durable/dist/harness/tool.js.map +1 -1
  887. package/node_modules/@earendil-works/pi-durable/dist/harness/types.d.ts +194 -17
  888. package/node_modules/@earendil-works/pi-durable/dist/harness/types.d.ts.map +1 -1
  889. package/node_modules/@earendil-works/pi-durable/dist/harness/types.js.map +1 -1
  890. package/node_modules/@earendil-works/pi-durable/dist/harness/util.d.ts +6 -1
  891. package/node_modules/@earendil-works/pi-durable/dist/harness/util.d.ts.map +1 -1
  892. package/node_modules/@earendil-works/pi-durable/dist/harness/util.js +5 -2
  893. package/node_modules/@earendil-works/pi-durable/dist/harness/util.js.map +1 -1
  894. package/node_modules/@earendil-works/pi-durable/dist/harness/view.d.ts +6 -2
  895. package/node_modules/@earendil-works/pi-durable/dist/harness/view.d.ts.map +1 -1
  896. package/node_modules/@earendil-works/pi-durable/dist/harness/view.js +22 -12
  897. package/node_modules/@earendil-works/pi-durable/dist/harness/view.js.map +1 -1
  898. package/node_modules/@earendil-works/pi-durable/dist/images/cloudflare.d.ts +4 -0
  899. package/node_modules/@earendil-works/pi-durable/dist/images/cloudflare.d.ts.map +1 -0
  900. package/node_modules/@earendil-works/pi-durable/dist/images/cloudflare.js +9 -0
  901. package/node_modules/@earendil-works/pi-durable/dist/images/cloudflare.js.map +1 -0
  902. package/node_modules/@earendil-works/pi-durable/dist/images/exif.d.ts +3 -0
  903. package/node_modules/@earendil-works/pi-durable/dist/images/exif.d.ts.map +1 -0
  904. package/node_modules/@earendil-works/pi-durable/dist/images/exif.js +71 -0
  905. package/node_modules/@earendil-works/pi-durable/dist/images/exif.js.map +1 -0
  906. package/node_modules/@earendil-works/pi-durable/dist/images/index.d.ts +18 -0
  907. package/node_modules/@earendil-works/pi-durable/dist/images/index.d.ts.map +1 -0
  908. package/node_modules/@earendil-works/pi-durable/dist/images/index.js +125 -0
  909. package/node_modules/@earendil-works/pi-durable/dist/images/index.js.map +1 -0
  910. package/node_modules/@earendil-works/pi-durable/dist/images/node-worker.d.ts +17 -0
  911. package/node_modules/@earendil-works/pi-durable/dist/images/node-worker.d.ts.map +1 -0
  912. package/node_modules/@earendil-works/pi-durable/dist/images/node-worker.js +16 -0
  913. package/node_modules/@earendil-works/pi-durable/dist/images/node-worker.js.map +1 -0
  914. package/node_modules/@earendil-works/pi-durable/dist/images/node.d.ts +21 -0
  915. package/node_modules/@earendil-works/pi-durable/dist/images/node.d.ts.map +1 -0
  916. package/node_modules/@earendil-works/pi-durable/dist/images/node.js +121 -0
  917. package/node_modules/@earendil-works/pi-durable/dist/images/node.js.map +1 -0
  918. package/node_modules/@earendil-works/pi-durable/dist/index.d.ts +7 -7
  919. package/node_modules/@earendil-works/pi-durable/dist/index.d.ts.map +1 -1
  920. package/node_modules/@earendil-works/pi-durable/dist/index.js +4 -4
  921. package/node_modules/@earendil-works/pi-durable/dist/index.js.map +1 -1
  922. package/node_modules/@earendil-works/pi-durable/dist/search.d.ts +13 -0
  923. package/node_modules/@earendil-works/pi-durable/dist/search.d.ts.map +1 -0
  924. package/node_modules/@earendil-works/pi-durable/dist/search.js +85 -0
  925. package/node_modules/@earendil-works/pi-durable/dist/search.js.map +1 -0
  926. package/node_modules/@earendil-works/pi-durable/dist/session/observation.d.ts +10 -3
  927. package/node_modules/@earendil-works/pi-durable/dist/session/observation.d.ts.map +1 -1
  928. package/node_modules/@earendil-works/pi-durable/dist/session/observation.js +24 -34
  929. package/node_modules/@earendil-works/pi-durable/dist/session/observation.js.map +1 -1
  930. package/node_modules/@earendil-works/pi-durable/dist/session/session.d.ts +71 -6
  931. package/node_modules/@earendil-works/pi-durable/dist/session/session.d.ts.map +1 -1
  932. package/node_modules/@earendil-works/pi-durable/dist/session/session.js +463 -50
  933. package/node_modules/@earendil-works/pi-durable/dist/session/session.js.map +1 -1
  934. package/node_modules/@earendil-works/pi-durable/dist/session/transaction.d.ts +2 -0
  935. package/node_modules/@earendil-works/pi-durable/dist/session/transaction.d.ts.map +1 -1
  936. package/node_modules/@earendil-works/pi-durable/dist/session/transaction.js +19 -1
  937. package/node_modules/@earendil-works/pi-durable/dist/session/transaction.js.map +1 -1
  938. package/node_modules/@earendil-works/pi-durable/dist/storage/jsonl/storage.d.ts +8 -0
  939. package/node_modules/@earendil-works/pi-durable/dist/storage/jsonl/storage.d.ts.map +1 -1
  940. package/node_modules/@earendil-works/pi-durable/dist/storage/jsonl/storage.js +2 -1
  941. package/node_modules/@earendil-works/pi-durable/dist/storage/jsonl/storage.js.map +1 -1
  942. package/node_modules/@earendil-works/pi-durable/dist/storage/memory.d.ts +2 -0
  943. package/node_modules/@earendil-works/pi-durable/dist/storage/memory.d.ts.map +1 -1
  944. package/node_modules/@earendil-works/pi-durable/dist/storage/memory.js +79 -27
  945. package/node_modules/@earendil-works/pi-durable/dist/storage/memory.js.map +1 -1
  946. package/node_modules/@earendil-works/pi-durable/dist/storage/scan.d.ts +18 -0
  947. package/node_modules/@earendil-works/pi-durable/dist/storage/scan.d.ts.map +1 -0
  948. package/node_modules/@earendil-works/pi-durable/dist/storage/scan.js +29 -0
  949. package/node_modules/@earendil-works/pi-durable/dist/storage/scan.js.map +1 -0
  950. package/node_modules/@earendil-works/pi-durable/dist/storage/sqlite/cloudflare.d.ts +46 -0
  951. package/node_modules/@earendil-works/pi-durable/dist/storage/sqlite/cloudflare.d.ts.map +1 -0
  952. package/node_modules/@earendil-works/pi-durable/dist/storage/sqlite/cloudflare.js +106 -0
  953. package/node_modules/@earendil-works/pi-durable/dist/storage/sqlite/cloudflare.js.map +1 -0
  954. package/node_modules/@earendil-works/pi-durable/dist/storage/sqlite/storage.d.ts +2 -0
  955. package/node_modules/@earendil-works/pi-durable/dist/storage/sqlite/storage.d.ts.map +1 -1
  956. package/node_modules/@earendil-works/pi-durable/dist/storage/sqlite/storage.js +77 -27
  957. package/node_modules/@earendil-works/pi-durable/dist/storage/sqlite/storage.js.map +1 -1
  958. package/node_modules/@earendil-works/pi-durable/dist/testing/env-conformance.d.ts +7 -0
  959. package/node_modules/@earendil-works/pi-durable/dist/testing/env-conformance.d.ts.map +1 -0
  960. package/node_modules/@earendil-works/pi-durable/dist/testing/env-conformance.js +531 -0
  961. package/node_modules/@earendil-works/pi-durable/dist/testing/env-conformance.js.map +1 -0
  962. package/node_modules/@earendil-works/pi-durable/dist/testing/index.d.ts +3 -2
  963. package/node_modules/@earendil-works/pi-durable/dist/testing/index.d.ts.map +1 -1
  964. package/node_modules/@earendil-works/pi-durable/dist/testing/index.js +2 -1
  965. package/node_modules/@earendil-works/pi-durable/dist/testing/index.js.map +1 -1
  966. package/node_modules/@earendil-works/pi-durable/dist/testing/runner.d.ts +4 -2
  967. package/node_modules/@earendil-works/pi-durable/dist/testing/runner.d.ts.map +1 -1
  968. package/node_modules/@earendil-works/pi-durable/dist/testing/runner.js +9 -0
  969. package/node_modules/@earendil-works/pi-durable/dist/testing/runner.js.map +1 -1
  970. package/node_modules/@earendil-works/pi-durable/dist/testing/storage-conformance.d.ts.map +1 -1
  971. package/node_modules/@earendil-works/pi-durable/dist/testing/storage-conformance.js +61 -2
  972. package/node_modules/@earendil-works/pi-durable/dist/testing/storage-conformance.js.map +1 -1
  973. package/node_modules/@earendil-works/pi-durable/dist/testing/types.d.ts +20 -0
  974. package/node_modules/@earendil-works/pi-durable/dist/testing/types.d.ts.map +1 -1
  975. package/node_modules/@earendil-works/pi-durable/dist/testing/types.js.map +1 -1
  976. package/node_modules/@earendil-works/pi-durable/dist/tool-search/index.d.ts +2 -0
  977. package/node_modules/@earendil-works/pi-durable/dist/tool-search/index.d.ts.map +1 -0
  978. package/node_modules/@earendil-works/pi-durable/dist/tool-search/index.js +2 -0
  979. package/node_modules/@earendil-works/pi-durable/dist/tool-search/index.js.map +1 -0
  980. package/node_modules/@earendil-works/pi-durable/dist/tool-search/tool-search.d.ts +23 -0
  981. package/node_modules/@earendil-works/pi-durable/dist/tool-search/tool-search.d.ts.map +1 -0
  982. package/node_modules/@earendil-works/pi-durable/dist/tool-search/tool-search.js +84 -0
  983. package/node_modules/@earendil-works/pi-durable/dist/tool-search/tool-search.js.map +1 -0
  984. package/node_modules/@earendil-works/pi-durable/dist/tools/bash.d.ts +30 -3
  985. package/node_modules/@earendil-works/pi-durable/dist/tools/bash.d.ts.map +1 -1
  986. package/node_modules/@earendil-works/pi-durable/dist/tools/bash.js +105 -37
  987. package/node_modules/@earendil-works/pi-durable/dist/tools/bash.js.map +1 -1
  988. package/node_modules/@earendil-works/pi-durable/dist/tools/edit.js +1 -1
  989. package/node_modules/@earendil-works/pi-durable/dist/tools/edit.js.map +1 -1
  990. package/node_modules/@earendil-works/pi-durable/dist/tools/image-processor.d.ts +47 -0
  991. package/node_modules/@earendil-works/pi-durable/dist/tools/image-processor.d.ts.map +1 -0
  992. package/node_modules/@earendil-works/pi-durable/dist/tools/image-processor.js +30 -0
  993. package/node_modules/@earendil-works/pi-durable/dist/tools/image-processor.js.map +1 -0
  994. package/node_modules/@earendil-works/pi-durable/dist/tools/image.d.ts +18 -0
  995. package/node_modules/@earendil-works/pi-durable/dist/tools/image.d.ts.map +1 -1
  996. package/node_modules/@earendil-works/pi-durable/dist/tools/image.js +86 -0
  997. package/node_modules/@earendil-works/pi-durable/dist/tools/image.js.map +1 -1
  998. package/node_modules/@earendil-works/pi-durable/dist/tools/index.d.ts +26 -3
  999. package/node_modules/@earendil-works/pi-durable/dist/tools/index.d.ts.map +1 -1
  1000. package/node_modules/@earendil-works/pi-durable/dist/tools/index.js +14 -6
  1001. package/node_modules/@earendil-works/pi-durable/dist/tools/index.js.map +1 -1
  1002. package/node_modules/@earendil-works/pi-durable/dist/tools/read.d.ts +10 -2
  1003. package/node_modules/@earendil-works/pi-durable/dist/tools/read.d.ts.map +1 -1
  1004. package/node_modules/@earendil-works/pi-durable/dist/tools/read.js +212 -78
  1005. package/node_modules/@earendil-works/pi-durable/dist/tools/read.js.map +1 -1
  1006. package/node_modules/@earendil-works/pi-durable/dist/tools/write.js +1 -1
  1007. package/node_modules/@earendil-works/pi-durable/dist/tools/write.js.map +1 -1
  1008. package/node_modules/@earendil-works/pi-durable/dist/truncate.d.ts +9 -0
  1009. package/node_modules/@earendil-works/pi-durable/dist/truncate.d.ts.map +1 -1
  1010. package/node_modules/@earendil-works/pi-durable/dist/truncate.js +12 -4
  1011. package/node_modules/@earendil-works/pi-durable/dist/truncate.js.map +1 -1
  1012. package/node_modules/@earendil-works/pi-durable/dist/types.d.ts +89 -12
  1013. package/node_modules/@earendil-works/pi-durable/dist/types.d.ts.map +1 -1
  1014. package/node_modules/@earendil-works/pi-durable/dist/types.js.map +1 -1
  1015. package/node_modules/@earendil-works/pi-durable/package.json +50 -5
  1016. package/node_modules/@earendil-works/pi-mcp/CHANGELOG.md +29 -0
  1017. package/node_modules/@earendil-works/pi-mcp/dist/auth-provider.d.ts +4 -0
  1018. package/node_modules/@earendil-works/pi-mcp/dist/auth-provider.d.ts.map +1 -1
  1019. package/node_modules/@earendil-works/pi-mcp/dist/auth-provider.js.map +1 -1
  1020. package/node_modules/@earendil-works/pi-mcp/dist/client.d.ts.map +1 -1
  1021. package/node_modules/@earendil-works/pi-mcp/dist/client.js +9 -5
  1022. package/node_modules/@earendil-works/pi-mcp/dist/client.js.map +1 -1
  1023. package/node_modules/@earendil-works/pi-mcp/dist/index.d.ts +1 -1
  1024. package/node_modules/@earendil-works/pi-mcp/dist/index.d.ts.map +1 -1
  1025. package/node_modules/@earendil-works/pi-mcp/dist/index.js.map +1 -1
  1026. package/node_modules/@earendil-works/pi-mcp/dist/oauth/discovery.d.ts +3 -0
  1027. package/node_modules/@earendil-works/pi-mcp/dist/oauth/discovery.d.ts.map +1 -1
  1028. package/node_modules/@earendil-works/pi-mcp/dist/oauth/discovery.js +8 -5
  1029. package/node_modules/@earendil-works/pi-mcp/dist/oauth/discovery.js.map +1 -1
  1030. package/node_modules/@earendil-works/pi-mcp/dist/oauth/errors.d.ts +3 -2
  1031. package/node_modules/@earendil-works/pi-mcp/dist/oauth/errors.d.ts.map +1 -1
  1032. package/node_modules/@earendil-works/pi-mcp/dist/oauth/errors.js +3 -1
  1033. package/node_modules/@earendil-works/pi-mcp/dist/oauth/errors.js.map +1 -1
  1034. package/node_modules/@earendil-works/pi-mcp/dist/oauth/flow.d.ts +4 -0
  1035. package/node_modules/@earendil-works/pi-mcp/dist/oauth/flow.d.ts.map +1 -1
  1036. package/node_modules/@earendil-works/pi-mcp/dist/oauth/flow.js +35 -7
  1037. package/node_modules/@earendil-works/pi-mcp/dist/oauth/flow.js.map +1 -1
  1038. package/node_modules/@earendil-works/pi-mcp/dist/oauth/types.d.ts +5 -0
  1039. package/node_modules/@earendil-works/pi-mcp/dist/oauth/types.d.ts.map +1 -1
  1040. package/node_modules/@earendil-works/pi-mcp/dist/oauth/types.js.map +1 -1
  1041. package/node_modules/@earendil-works/pi-mcp/dist/protocol/content.d.ts +2 -1
  1042. package/node_modules/@earendil-works/pi-mcp/dist/protocol/content.d.ts.map +1 -1
  1043. package/node_modules/@earendil-works/pi-mcp/dist/protocol/content.js.map +1 -1
  1044. package/node_modules/@earendil-works/pi-mcp/dist/transports/streamable-http.d.ts +9 -2
  1045. package/node_modules/@earendil-works/pi-mcp/dist/transports/streamable-http.d.ts.map +1 -1
  1046. package/node_modules/@earendil-works/pi-mcp/dist/transports/streamable-http.js +28 -19
  1047. package/node_modules/@earendil-works/pi-mcp/dist/transports/streamable-http.js.map +1 -1
  1048. package/node_modules/@earendil-works/pi-mcp/dist/transports/transport.d.ts +9 -1
  1049. package/node_modules/@earendil-works/pi-mcp/dist/transports/transport.d.ts.map +1 -1
  1050. package/node_modules/@earendil-works/pi-mcp/dist/transports/transport.js.map +1 -1
  1051. package/node_modules/@earendil-works/pi-mcp/package.json +2 -2
  1052. package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
  1053. package/node_modules/@earendil-works/pi-tui/README.md +5 -3
  1054. package/node_modules/@earendil-works/pi-tui/dist/components/box.d.ts +1 -0
  1055. package/node_modules/@earendil-works/pi-tui/dist/components/box.d.ts.map +1 -1
  1056. package/node_modules/@earendil-works/pi-tui/dist/components/box.js +4 -0
  1057. package/node_modules/@earendil-works/pi-tui/dist/components/box.js.map +1 -1
  1058. package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts.map +1 -1
  1059. package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +3 -3
  1060. package/node_modules/@earendil-works/pi-tui/dist/components/editor.js.map +1 -1
  1061. package/node_modules/@earendil-works/pi-tui/dist/components/input.d.ts.map +1 -1
  1062. package/node_modules/@earendil-works/pi-tui/dist/components/input.js +4 -4
  1063. package/node_modules/@earendil-works/pi-tui/dist/components/input.js.map +1 -1
  1064. package/node_modules/@earendil-works/pi-tui/dist/components/text.d.ts +1 -0
  1065. package/node_modules/@earendil-works/pi-tui/dist/components/text.d.ts.map +1 -1
  1066. package/node_modules/@earendil-works/pi-tui/dist/components/text.js +4 -0
  1067. package/node_modules/@earendil-works/pi-tui/dist/components/text.js.map +1 -1
  1068. package/node_modules/@earendil-works/pi-tui/dist/index.d.ts +2 -1
  1069. package/node_modules/@earendil-works/pi-tui/dist/index.d.ts.map +1 -1
  1070. package/node_modules/@earendil-works/pi-tui/dist/index.js +3 -1
  1071. package/node_modules/@earendil-works/pi-tui/dist/index.js.map +1 -1
  1072. package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts +4 -4
  1073. package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts.map +1 -1
  1074. package/node_modules/@earendil-works/pi-tui/dist/keybindings.js +4 -4
  1075. package/node_modules/@earendil-works/pi-tui/dist/keybindings.js.map +1 -1
  1076. package/node_modules/@earendil-works/pi-tui/dist/keys.d.ts.map +1 -1
  1077. package/node_modules/@earendil-works/pi-tui/dist/keys.js +52 -20
  1078. package/node_modules/@earendil-works/pi-tui/dist/keys.js.map +1 -1
  1079. package/node_modules/@earendil-works/pi-tui/dist/program-status.d.ts +23 -0
  1080. package/node_modules/@earendil-works/pi-tui/dist/program-status.d.ts.map +1 -0
  1081. package/node_modules/@earendil-works/pi-tui/dist/program-status.js +43 -0
  1082. package/node_modules/@earendil-works/pi-tui/dist/program-status.js.map +1 -0
  1083. package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.d.ts +4 -2
  1084. package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.d.ts.map +1 -1
  1085. package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.js +36 -1
  1086. package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.js.map +1 -1
  1087. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts.map +1 -1
  1088. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js +5 -0
  1089. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js.map +1 -1
  1090. package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts +17 -0
  1091. package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts.map +1 -1
  1092. package/node_modules/@earendil-works/pi-tui/dist/terminal.js +46 -2
  1093. package/node_modules/@earendil-works/pi-tui/dist/terminal.js.map +1 -1
  1094. package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.d.ts +2 -0
  1095. package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.d.ts.map +1 -1
  1096. package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.js +8 -4
  1097. package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.js.map +1 -1
  1098. package/node_modules/@earendil-works/pi-tui/dist/tui-main-screen.d.ts.map +1 -1
  1099. package/node_modules/@earendil-works/pi-tui/dist/tui-main-screen.js +2 -1
  1100. package/node_modules/@earendil-works/pi-tui/dist/tui-main-screen.js.map +1 -1
  1101. package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts +11 -0
  1102. package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts.map +1 -1
  1103. package/node_modules/@earendil-works/pi-tui/dist/tui.js +23 -1
  1104. package/node_modules/@earendil-works/pi-tui/dist/tui.js.map +1 -1
  1105. package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts.map +1 -1
  1106. package/node_modules/@earendil-works/pi-tui/dist/utils.js +5 -2
  1107. package/node_modules/@earendil-works/pi-tui/dist/utils.js.map +1 -1
  1108. package/node_modules/@earendil-works/pi-tui/package.json +1 -1
  1109. package/node_modules/@silvia-odwyer/photon/LICENSE.md +201 -0
  1110. package/node_modules/@silvia-odwyer/photon/README.md +158 -0
  1111. package/node_modules/@silvia-odwyer/photon/package.json +23 -0
  1112. package/node_modules/@silvia-odwyer/photon/photon_rs.d.ts +3443 -0
  1113. package/node_modules/@silvia-odwyer/photon/photon_rs.js +4572 -0
  1114. package/node_modules/@silvia-odwyer/photon/photon_rs_bg.wasm +0 -0
  1115. package/node_modules/@types/node/README.md +1 -1
  1116. package/node_modules/@types/node/crypto.d.ts +2 -2
  1117. package/node_modules/@types/node/dgram.d.ts +1 -1
  1118. package/node_modules/@types/node/package.json +2 -2
  1119. package/node_modules/@types/node/util.d.ts +6 -3
  1120. package/node_modules/@types/node/zlib.d.ts +6 -0
  1121. package/node_modules/hono/README.md +1 -1
  1122. package/node_modules/hono/dist/_virtual/_rolldown/runtime.js +13 -0
  1123. package/node_modules/hono/dist/adapter/aws-lambda/conninfo.js +42 -23
  1124. package/node_modules/hono/dist/adapter/aws-lambda/handler.js +320 -342
  1125. package/node_modules/hono/dist/adapter/aws-lambda/index.js +2 -8
  1126. package/node_modules/hono/dist/adapter/aws-lambda/types.js +1 -0
  1127. package/node_modules/hono/dist/adapter/bun/conninfo.js +20 -25
  1128. package/node_modules/hono/dist/adapter/bun/index.js +3 -13
  1129. package/node_modules/hono/dist/adapter/bun/serve-static.js +27 -27
  1130. package/node_modules/hono/dist/adapter/bun/server.js +11 -5
  1131. package/node_modules/hono/dist/adapter/bun/ssg.js +25 -15
  1132. package/node_modules/hono/dist/adapter/bun/websocket.js +61 -68
  1133. package/node_modules/hono/dist/adapter/cloudflare-pages/conninfo.js +24 -9
  1134. package/node_modules/hono/dist/adapter/cloudflare-pages/handler.js +59 -62
  1135. package/node_modules/hono/dist/adapter/cloudflare-pages/index.js +2 -8
  1136. package/node_modules/hono/dist/adapter/cloudflare-workers/conninfo.js +7 -9
  1137. package/node_modules/hono/dist/adapter/cloudflare-workers/index.js +3 -8
  1138. package/node_modules/hono/dist/adapter/cloudflare-workers/serve-static-module.js +5 -6
  1139. package/node_modules/hono/dist/adapter/cloudflare-workers/serve-static.js +26 -20
  1140. package/node_modules/hono/dist/adapter/cloudflare-workers/utils.js +21 -34
  1141. package/node_modules/hono/dist/adapter/cloudflare-workers/websocket.js +31 -39
  1142. package/node_modules/hono/dist/adapter/deno/conninfo.js +16 -13
  1143. package/node_modules/hono/dist/adapter/deno/deno.d.js +1 -0
  1144. package/node_modules/hono/dist/adapter/deno/index.js +3 -10
  1145. package/node_modules/hono/dist/adapter/deno/serve-static.js +33 -38
  1146. package/node_modules/hono/dist/adapter/deno/ssg.js +27 -16
  1147. package/node_modules/hono/dist/adapter/deno/websocket.js +30 -30
  1148. package/node_modules/hono/dist/adapter/lambda-edge/conninfo.js +7 -9
  1149. package/node_modules/hono/dist/adapter/lambda-edge/handler.js +102 -87
  1150. package/node_modules/hono/dist/adapter/lambda-edge/index.js +2 -6
  1151. package/node_modules/hono/dist/adapter/netlify/conninfo.js +24 -9
  1152. package/node_modules/hono/dist/adapter/netlify/handler.js +10 -8
  1153. package/node_modules/hono/dist/adapter/netlify/index.js +3 -2
  1154. package/node_modules/hono/dist/adapter/netlify/mod.js +2 -6
  1155. package/node_modules/hono/dist/adapter/service-worker/handler.js +15 -19
  1156. package/node_modules/hono/dist/adapter/service-worker/index.js +23 -7
  1157. package/node_modules/hono/dist/adapter/service-worker/types.js +1 -0
  1158. package/node_modules/hono/dist/adapter/vercel/conninfo.js +7 -10
  1159. package/node_modules/hono/dist/adapter/vercel/handler.js +8 -6
  1160. package/node_modules/hono/dist/adapter/vercel/index.js +2 -6
  1161. package/node_modules/hono/dist/cjs/_virtual/_rolldown/runtime.js +33 -0
  1162. package/node_modules/hono/dist/cjs/adapter/aws-lambda/conninfo.js +42 -44
  1163. package/node_modules/hono/dist/cjs/adapter/aws-lambda/handler.js +328 -371
  1164. package/node_modules/hono/dist/cjs/adapter/aws-lambda/index.js +7 -34
  1165. package/node_modules/hono/dist/cjs/adapter/aws-lambda/types.js +0 -15
  1166. package/node_modules/hono/dist/cjs/adapter/bun/conninfo.js +21 -47
  1167. package/node_modules/hono/dist/cjs/adapter/bun/index.js +14 -45
  1168. package/node_modules/hono/dist/cjs/adapter/bun/serve-static.js +29 -50
  1169. package/node_modules/hono/dist/cjs/adapter/bun/server.js +11 -26
  1170. package/node_modules/hono/dist/cjs/adapter/bun/ssg.js +24 -35
  1171. package/node_modules/hono/dist/cjs/adapter/bun/websocket.js +63 -91
  1172. package/node_modules/hono/dist/cjs/adapter/cloudflare-pages/conninfo.js +25 -31
  1173. package/node_modules/hono/dist/cjs/adapter/cloudflare-pages/handler.js +61 -85
  1174. package/node_modules/hono/dist/cjs/adapter/cloudflare-pages/index.js +7 -34
  1175. package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/conninfo.js +8 -31
  1176. package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/index.js +7 -33
  1177. package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/serve-static-module.js +7 -29
  1178. package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/serve-static.js +27 -42
  1179. package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/utils.js +21 -55
  1180. package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/websocket.js +33 -62
  1181. package/node_modules/hono/dist/cjs/adapter/deno/conninfo.js +16 -34
  1182. package/node_modules/hono/dist/cjs/adapter/deno/index.js +10 -38
  1183. package/node_modules/hono/dist/cjs/adapter/deno/serve-static.js +33 -59
  1184. package/node_modules/hono/dist/cjs/adapter/deno/ssg.js +27 -37
  1185. package/node_modules/hono/dist/cjs/adapter/deno/websocket.js +32 -53
  1186. package/node_modules/hono/dist/cjs/adapter/lambda-edge/conninfo.js +8 -31
  1187. package/node_modules/hono/dist/cjs/adapter/lambda-edge/handler.js +105 -119
  1188. package/node_modules/hono/dist/cjs/adapter/lambda-edge/index.js +5 -30
  1189. package/node_modules/hono/dist/cjs/adapter/netlify/conninfo.js +25 -31
  1190. package/node_modules/hono/dist/cjs/adapter/netlify/handler.js +10 -29
  1191. package/node_modules/hono/dist/cjs/adapter/netlify/index.js +5 -21
  1192. package/node_modules/hono/dist/cjs/adapter/netlify/mod.js +5 -30
  1193. package/node_modules/hono/dist/cjs/adapter/service-worker/handler.js +16 -41
  1194. package/node_modules/hono/dist/cjs/adapter/service-worker/index.js +25 -30
  1195. package/node_modules/hono/dist/cjs/adapter/service-worker/types.js +0 -15
  1196. package/node_modules/hono/dist/cjs/adapter/vercel/conninfo.js +8 -32
  1197. package/node_modules/hono/dist/cjs/adapter/vercel/handler.js +8 -27
  1198. package/node_modules/hono/dist/cjs/adapter/vercel/index.js +5 -30
  1199. package/node_modules/hono/dist/cjs/client/client.js +139 -212
  1200. package/node_modules/hono/dist/cjs/client/fetch-result-please.js +62 -80
  1201. package/node_modules/hono/dist/cjs/client/index.js +7 -32
  1202. package/node_modules/hono/dist/cjs/client/types.js +0 -15
  1203. package/node_modules/hono/dist/cjs/client/utils.js +54 -92
  1204. package/node_modules/hono/dist/cjs/compose.js +49 -66
  1205. package/node_modules/hono/dist/cjs/context.js +379 -450
  1206. package/node_modules/hono/dist/cjs/helper/accepts/accepts.js +47 -70
  1207. package/node_modules/hono/dist/cjs/helper/accepts/index.js +3 -27
  1208. package/node_modules/hono/dist/cjs/helper/adapter/index.js +33 -73
  1209. package/node_modules/hono/dist/cjs/helper/conninfo/index.js +0 -15
  1210. package/node_modules/hono/dist/cjs/helper/conninfo/types.js +0 -15
  1211. package/node_modules/hono/dist/cjs/helper/cookie/index.js +75 -116
  1212. package/node_modules/hono/dist/cjs/helper/css/common.js +165 -244
  1213. package/node_modules/hono/dist/cjs/helper/css/index.js +136 -151
  1214. package/node_modules/hono/dist/cjs/helper/dev/index.js +45 -71
  1215. package/node_modules/hono/dist/cjs/helper/factory/index.js +30 -51
  1216. package/node_modules/hono/dist/cjs/helper/html/index.js +32 -62
  1217. package/node_modules/hono/dist/cjs/helper/proxy/index.js +113 -106
  1218. package/node_modules/hono/dist/cjs/helper/route/index.js +123 -66
  1219. package/node_modules/hono/dist/cjs/helper/ssg/index.js +19 -43
  1220. package/node_modules/hono/dist/cjs/helper/ssg/middleware.js +56 -64
  1221. package/node_modules/hono/dist/cjs/helper/ssg/plugins.js +55 -57
  1222. package/node_modules/hono/dist/cjs/helper/ssg/ssg.js +196 -296
  1223. package/node_modules/hono/dist/cjs/helper/ssg/utils.js +47 -90
  1224. package/node_modules/hono/dist/cjs/helper/streaming/index.js +8 -35
  1225. package/node_modules/hono/dist/cjs/helper/streaming/sse.js +53 -85
  1226. package/node_modules/hono/dist/cjs/helper/streaming/stream.js +23 -53
  1227. package/node_modules/hono/dist/cjs/helper/streaming/text.js +10 -32
  1228. package/node_modules/hono/dist/cjs/helper/streaming/utils.js +13 -32
  1229. package/node_modules/hono/dist/cjs/helper/testing/index.js +16 -31
  1230. package/node_modules/hono/dist/cjs/helper/websocket/index.js +51 -76
  1231. package/node_modules/hono/dist/cjs/hono-base.js +345 -403
  1232. package/node_modules/hono/dist/cjs/hono.js +28 -42
  1233. package/node_modules/hono/dist/cjs/http-exception.js +55 -56
  1234. package/node_modules/hono/dist/cjs/index.js +22 -30
  1235. package/node_modules/hono/dist/cjs/jsx/base.js +237 -366
  1236. package/node_modules/hono/dist/cjs/jsx/children.js +16 -41
  1237. package/node_modules/hono/dist/cjs/jsx/components.js +119 -192
  1238. package/node_modules/hono/dist/cjs/jsx/constants.js +15 -42
  1239. package/node_modules/hono/dist/cjs/jsx/context.js +144 -162
  1240. package/node_modules/hono/dist/cjs/jsx/dom/client.js +49 -69
  1241. package/node_modules/hono/dist/cjs/jsx/dom/components.js +23 -52
  1242. package/node_modules/hono/dist/cjs/jsx/dom/context.js +39 -67
  1243. package/node_modules/hono/dist/cjs/jsx/dom/css.js +143 -158
  1244. package/node_modules/hono/dist/cjs/jsx/dom/hooks/index.js +55 -64
  1245. package/node_modules/hono/dist/cjs/jsx/dom/index.js +114 -173
  1246. package/node_modules/hono/dist/cjs/jsx/dom/intrinsic-element/components.js +282 -375
  1247. package/node_modules/hono/dist/cjs/jsx/dom/jsx-dev-runtime.js +14 -49
  1248. package/node_modules/hono/dist/cjs/jsx/dom/jsx-runtime.js +5 -32
  1249. package/node_modules/hono/dist/cjs/jsx/dom/render.js +471 -589
  1250. package/node_modules/hono/dist/cjs/jsx/dom/server.js +37 -64
  1251. package/node_modules/hono/dist/cjs/jsx/dom/utils.js +7 -30
  1252. package/node_modules/hono/dist/cjs/jsx/hooks/index.js +225 -318
  1253. package/node_modules/hono/dist/cjs/jsx/index.js +86 -135
  1254. package/node_modules/hono/dist/cjs/jsx/intrinsic-element/common.js +20 -43
  1255. package/node_modules/hono/dist/cjs/jsx/intrinsic-element/components.js +117 -168
  1256. package/node_modules/hono/dist/cjs/jsx/intrinsic-elements.js +0 -15
  1257. package/node_modules/hono/dist/cjs/jsx/jsx-dev-runtime.js +14 -39
  1258. package/node_modules/hono/dist/cjs/jsx/jsx-runtime.js +34 -68
  1259. package/node_modules/hono/dist/cjs/jsx/streaming.js +123 -166
  1260. package/node_modules/hono/dist/cjs/jsx/types.js +0 -15
  1261. package/node_modules/hono/dist/cjs/jsx/utils.js +91 -175
  1262. package/node_modules/hono/dist/cjs/middleware/basic-auth/index.js +98 -86
  1263. package/node_modules/hono/dist/cjs/middleware/bearer-auth/index.js +92 -109
  1264. package/node_modules/hono/dist/cjs/middleware/body-limit/index.js +66 -72
  1265. package/node_modules/hono/dist/cjs/middleware/cache/index.js +153 -199
  1266. package/node_modules/hono/dist/cjs/middleware/combine/index.js +133 -95
  1267. package/node_modules/hono/dist/cjs/middleware/compress/index.js +73 -88
  1268. package/node_modules/hono/dist/cjs/middleware/context-storage/index.js +49 -41
  1269. package/node_modules/hono/dist/cjs/middleware/cors/index.js +107 -107
  1270. package/node_modules/hono/dist/cjs/middleware/csrf/index.js +101 -72
  1271. package/node_modules/hono/dist/cjs/middleware/etag/digest.js +58 -97
  1272. package/node_modules/hono/dist/cjs/middleware/etag/index.js +71 -91
  1273. package/node_modules/hono/dist/cjs/middleware/ip-restriction/index.js +161 -169
  1274. package/node_modules/hono/dist/cjs/middleware/jsx-renderer/index.js +99 -77
  1275. package/node_modules/hono/dist/cjs/middleware/jwk/index.js +3 -27
  1276. package/node_modules/hono/dist/cjs/middleware/jwk/jwk.js +118 -135
  1277. package/node_modules/hono/dist/cjs/middleware/jwt/index.js +9 -38
  1278. package/node_modules/hono/dist/cjs/middleware/jwt/jwt.js +120 -141
  1279. package/node_modules/hono/dist/cjs/middleware/language/index.js +7 -35
  1280. package/node_modules/hono/dist/cjs/middleware/language/language.js +184 -179
  1281. package/node_modules/hono/dist/cjs/middleware/logger/index.js +41 -62
  1282. package/node_modules/hono/dist/cjs/middleware/method-not-allowed/index.js +82 -88
  1283. package/node_modules/hono/dist/cjs/middleware/method-override/index.js +101 -102
  1284. package/node_modules/hono/dist/cjs/middleware/powered-by/index.js +23 -30
  1285. package/node_modules/hono/dist/cjs/middleware/pretty-json/index.js +38 -36
  1286. package/node_modules/hono/dist/cjs/middleware/request-id/index.js +3 -27
  1287. package/node_modules/hono/dist/cjs/middleware/request-id/request-id.js +34 -42
  1288. package/node_modules/hono/dist/cjs/middleware/secure-headers/index.js +4 -29
  1289. package/node_modules/hono/dist/cjs/middleware/secure-headers/permissions-policy.js +0 -15
  1290. package/node_modules/hono/dist/cjs/middleware/secure-headers/secure-headers.js +142 -174
  1291. package/node_modules/hono/dist/cjs/middleware/serve-static/index.js +56 -93
  1292. package/node_modules/hono/dist/cjs/middleware/serve-static/path.js +15 -38
  1293. package/node_modules/hono/dist/cjs/middleware/timeout/index.js +40 -45
  1294. package/node_modules/hono/dist/cjs/middleware/timing/index.js +7 -35
  1295. package/node_modules/hono/dist/cjs/middleware/timing/timing.js +177 -118
  1296. package/node_modules/hono/dist/cjs/middleware/trailing-slash/index.js +85 -58
  1297. package/node_modules/hono/dist/cjs/preset/quick.js +18 -37
  1298. package/node_modules/hono/dist/cjs/preset/tiny.js +15 -33
  1299. package/node_modules/hono/dist/cjs/request/constants.js +5 -27
  1300. package/node_modules/hono/dist/cjs/request.js +334 -343
  1301. package/node_modules/hono/dist/cjs/router/linear-router/index.js +3 -27
  1302. package/node_modules/hono/dist/cjs/router/linear-router/router.js +95 -143
  1303. package/node_modules/hono/dist/cjs/router/pattern-router/index.js +3 -27
  1304. package/node_modules/hono/dist/cjs/router/pattern-router/router.js +41 -63
  1305. package/node_modules/hono/dist/cjs/router/reg-exp-router/index.js +7 -34
  1306. package/node_modules/hono/dist/cjs/router/reg-exp-router/matcher.js +18 -45
  1307. package/node_modules/hono/dist/cjs/router/reg-exp-router/node.js +91 -135
  1308. package/node_modules/hono/dist/cjs/router/reg-exp-router/prepared-router.js +92 -161
  1309. package/node_modules/hono/dist/cjs/router/reg-exp-router/router.js +98 -147
  1310. package/node_modules/hono/dist/cjs/router/reg-exp-router/trie.js +73 -89
  1311. package/node_modules/hono/dist/cjs/router/smart-router/index.js +3 -27
  1312. package/node_modules/hono/dist/cjs/router/smart-router/router.js +49 -79
  1313. package/node_modules/hono/dist/cjs/router/trie-router/index.js +3 -27
  1314. package/node_modules/hono/dist/cjs/router/trie-router/node.js +134 -186
  1315. package/node_modules/hono/dist/cjs/router/trie-router/router.js +15 -39
  1316. package/node_modules/hono/dist/cjs/router/utils.js +5 -27
  1317. package/node_modules/hono/dist/cjs/router.js +37 -37
  1318. package/node_modules/hono/dist/cjs/types.js +5 -28
  1319. package/node_modules/hono/dist/cjs/utils/accept.js +177 -228
  1320. package/node_modules/hono/dist/cjs/utils/basic-auth.js +16 -40
  1321. package/node_modules/hono/dist/cjs/utils/body.js +84 -110
  1322. package/node_modules/hono/dist/cjs/utils/buffer.js +43 -91
  1323. package/node_modules/hono/dist/cjs/utils/color.js +35 -44
  1324. package/node_modules/hono/dist/cjs/utils/compress.js +11 -26
  1325. package/node_modules/hono/dist/cjs/utils/concurrent.js +29 -59
  1326. package/node_modules/hono/dist/cjs/utils/constants.js +7 -26
  1327. package/node_modules/hono/dist/cjs/utils/cookie.js +107 -177
  1328. package/node_modules/hono/dist/cjs/utils/crypto.js +30 -61
  1329. package/node_modules/hono/dist/cjs/utils/encode.js +31 -48
  1330. package/node_modules/hono/dist/cjs/utils/filepath.js +23 -54
  1331. package/node_modules/hono/dist/cjs/utils/handler.js +11 -33
  1332. package/node_modules/hono/dist/cjs/utils/headers.js +0 -15
  1333. package/node_modules/hono/dist/cjs/utils/html.js +96 -137
  1334. package/node_modules/hono/dist/cjs/utils/http-status.js +0 -15
  1335. package/node_modules/hono/dist/cjs/utils/ipaddr.js +213 -286
  1336. package/node_modules/hono/dist/cjs/utils/jwt/index.js +14 -27
  1337. package/node_modules/hono/dist/cjs/utils/jwt/jwa.js +25 -42
  1338. package/node_modules/hono/dist/cjs/utils/jwt/jws.js +119 -199
  1339. package/node_modules/hono/dist/cjs/utils/jwt/jwt.js +122 -205
  1340. package/node_modules/hono/dist/cjs/utils/jwt/types.js +122 -159
  1341. package/node_modules/hono/dist/cjs/utils/jwt/utf8.js +9 -28
  1342. package/node_modules/hono/dist/cjs/utils/mime.js +75 -101
  1343. package/node_modules/hono/dist/cjs/utils/stream.js +88 -111
  1344. package/node_modules/hono/dist/cjs/utils/types.js +0 -15
  1345. package/node_modules/hono/dist/cjs/utils/url.js +185 -234
  1346. package/node_modules/hono/dist/cjs/validator/index.js +3 -27
  1347. package/node_modules/hono/dist/cjs/validator/utils.js +0 -15
  1348. package/node_modules/hono/dist/cjs/validator/validator.js +60 -103
  1349. package/node_modules/hono/dist/client/client.js +138 -197
  1350. package/node_modules/hono/dist/client/fetch-result-please.js +59 -56
  1351. package/node_modules/hono/dist/client/index.js +3 -7
  1352. package/node_modules/hono/dist/client/types.js +1 -0
  1353. package/node_modules/hono/dist/client/utils.js +51 -68
  1354. package/node_modules/hono/dist/compose.js +49 -45
  1355. package/node_modules/hono/dist/context.js +376 -426
  1356. package/node_modules/hono/dist/helper/accepts/accepts.js +47 -49
  1357. package/node_modules/hono/dist/helper/accepts/index.js +1 -4
  1358. package/node_modules/hono/dist/helper/adapter/index.js +33 -52
  1359. package/node_modules/hono/dist/helper/conninfo/index.js +1 -0
  1360. package/node_modules/hono/dist/helper/conninfo/types.js +1 -0
  1361. package/node_modules/hono/dist/helper/cookie/index.js +74 -94
  1362. package/node_modules/hono/dist/helper/css/common.js +167 -225
  1363. package/node_modules/hono/dist/helper/css/index.js +132 -137
  1364. package/node_modules/hono/dist/helper/dev/index.js +44 -49
  1365. package/node_modules/hono/dist/helper/factory/index.js +27 -27
  1366. package/node_modules/hono/dist/helper/html/index.js +30 -39
  1367. package/node_modules/hono/dist/helper/proxy/index.js +116 -88
  1368. package/node_modules/hono/dist/helper/route/index.js +121 -43
  1369. package/node_modules/hono/dist/helper/ssg/index.js +3 -18
  1370. package/node_modules/hono/dist/helper/ssg/middleware.js +53 -40
  1371. package/node_modules/hono/dist/helper/ssg/plugins.js +55 -36
  1372. package/node_modules/hono/dist/helper/ssg/ssg.js +198 -283
  1373. package/node_modules/hono/dist/helper/ssg/utils.js +53 -75
  1374. package/node_modules/hono/dist/helper/streaming/index.js +2 -8
  1375. package/node_modules/hono/dist/helper/streaming/sse.js +50 -61
  1376. package/node_modules/hono/dist/helper/streaming/stream.js +22 -31
  1377. package/node_modules/hono/dist/helper/streaming/text.js +9 -10
  1378. package/node_modules/hono/dist/helper/streaming/utils.js +9 -12
  1379. package/node_modules/hono/dist/helper/testing/index.js +16 -10
  1380. package/node_modules/hono/dist/helper/websocket/index.js +49 -53
  1381. package/node_modules/hono/dist/hono-base.js +342 -379
  1382. package/node_modules/hono/dist/hono.js +27 -20
  1383. package/node_modules/hono/dist/http-exception.js +53 -33
  1384. package/node_modules/hono/dist/index.js +19 -6
  1385. package/node_modules/hono/dist/jsx/base.js +231 -340
  1386. package/node_modules/hono/dist/jsx/children.js +16 -20
  1387. package/node_modules/hono/dist/jsx/components.js +118 -170
  1388. package/node_modules/hono/dist/jsx/constants.js +9 -15
  1389. package/node_modules/hono/dist/jsx/context.js +153 -150
  1390. package/node_modules/hono/dist/jsx/dom/client.js +45 -48
  1391. package/node_modules/hono/dist/jsx/dom/components.js +21 -29
  1392. package/node_modules/hono/dist/jsx/dom/context.js +37 -44
  1393. package/node_modules/hono/dist/jsx/dom/css.js +142 -147
  1394. package/node_modules/hono/dist/jsx/dom/hooks/index.js +52 -40
  1395. package/node_modules/hono/dist/jsx/dom/index.js +71 -134
  1396. package/node_modules/hono/dist/jsx/dom/intrinsic-element/components.js +275 -359
  1397. package/node_modules/hono/dist/jsx/dom/jsx-dev-runtime.js +14 -18
  1398. package/node_modules/hono/dist/jsx/dom/jsx-runtime.js +2 -8
  1399. package/node_modules/hono/dist/jsx/dom/render.js +492 -595
  1400. package/node_modules/hono/dist/jsx/dom/server.js +32 -32
  1401. package/node_modules/hono/dist/jsx/dom/utils.js +6 -8
  1402. package/node_modules/hono/dist/jsx/hooks/index.js +236 -308
  1403. package/node_modules/hono/dist/jsx/index.js +45 -98
  1404. package/node_modules/hono/dist/jsx/intrinsic-element/common.js +20 -22
  1405. package/node_modules/hono/dist/jsx/intrinsic-element/components.js +113 -154
  1406. package/node_modules/hono/dist/jsx/intrinsic-elements.js +1 -0
  1407. package/node_modules/hono/dist/jsx/jsx-dev-runtime.js +12 -16
  1408. package/node_modules/hono/dist/jsx/jsx-runtime.js +29 -42
  1409. package/node_modules/hono/dist/jsx/streaming.js +120 -142
  1410. package/node_modules/hono/dist/jsx/types.js +1 -0
  1411. package/node_modules/hono/dist/jsx/utils.js +105 -168
  1412. package/node_modules/hono/dist/middleware/basic-auth/index.js +96 -63
  1413. package/node_modules/hono/dist/middleware/bearer-auth/index.js +93 -89
  1414. package/node_modules/hono/dist/middleware/body-limit/index.js +66 -51
  1415. package/node_modules/hono/dist/middleware/cache/index.js +165 -190
  1416. package/node_modules/hono/dist/middleware/combine/index.js +132 -73
  1417. package/node_modules/hono/dist/middleware/compress/index.js +75 -69
  1418. package/node_modules/hono/dist/middleware/context-storage/index.js +49 -19
  1419. package/node_modules/hono/dist/middleware/cors/index.js +107 -86
  1420. package/node_modules/hono/dist/middleware/csrf/index.js +103 -53
  1421. package/node_modules/hono/dist/middleware/etag/digest.js +59 -77
  1422. package/node_modules/hono/dist/middleware/etag/index.js +71 -70
  1423. package/node_modules/hono/dist/middleware/ip-restriction/index.js +163 -158
  1424. package/node_modules/hono/dist/middleware/jsx-renderer/index.js +97 -54
  1425. package/node_modules/hono/dist/middleware/jwk/index.js +1 -4
  1426. package/node_modules/hono/dist/middleware/jwk/jwk.js +116 -112
  1427. package/node_modules/hono/dist/middleware/jwt/index.js +2 -10
  1428. package/node_modules/hono/dist/middleware/jwt/jwt.js +114 -114
  1429. package/node_modules/hono/dist/middleware/language/index.js +2 -15
  1430. package/node_modules/hono/dist/middleware/language/language.js +180 -154
  1431. package/node_modules/hono/dist/middleware/logger/index.js +43 -37
  1432. package/node_modules/hono/dist/middleware/method-not-allowed/index.js +81 -66
  1433. package/node_modules/hono/dist/middleware/method-override/index.js +101 -81
  1434. package/node_modules/hono/dist/middleware/powered-by/index.js +23 -9
  1435. package/node_modules/hono/dist/middleware/pretty-json/index.js +39 -16
  1436. package/node_modules/hono/dist/middleware/request-id/index.js +1 -4
  1437. package/node_modules/hono/dist/middleware/request-id/request-id.js +33 -20
  1438. package/node_modules/hono/dist/middleware/secure-headers/index.js +1 -5
  1439. package/node_modules/hono/dist/middleware/secure-headers/permissions-policy.js +1 -0
  1440. package/node_modules/hono/dist/middleware/secure-headers/secure-headers.js +144 -155
  1441. package/node_modules/hono/dist/middleware/serve-static/index.js +56 -72
  1442. package/node_modules/hono/dist/middleware/serve-static/path.js +15 -17
  1443. package/node_modules/hono/dist/middleware/timeout/index.js +40 -23
  1444. package/node_modules/hono/dist/middleware/timing/index.js +2 -9
  1445. package/node_modules/hono/dist/middleware/timing/timing.js +177 -97
  1446. package/node_modules/hono/dist/middleware/trailing-slash/index.js +85 -37
  1447. package/node_modules/hono/dist/preset/quick.js +17 -15
  1448. package/node_modules/hono/dist/preset/tiny.js +14 -11
  1449. package/node_modules/hono/dist/request/constants.js +4 -5
  1450. package/node_modules/hono/dist/request.js +328 -316
  1451. package/node_modules/hono/dist/router/linear-router/index.js +1 -4
  1452. package/node_modules/hono/dist/router/linear-router/router.js +93 -120
  1453. package/node_modules/hono/dist/router/pattern-router/index.js +1 -4
  1454. package/node_modules/hono/dist/router/pattern-router/router.js +39 -40
  1455. package/node_modules/hono/dist/router/reg-exp-router/index.js +1 -7
  1456. package/node_modules/hono/dist/router/reg-exp-router/matcher.js +17 -23
  1457. package/node_modules/hono/dist/router/reg-exp-router/node.js +87 -110
  1458. package/node_modules/hono/dist/router/reg-exp-router/prepared-router.js +89 -137
  1459. package/node_modules/hono/dist/router/reg-exp-router/router.js +92 -129
  1460. package/node_modules/hono/dist/router/reg-exp-router/trie.js +69 -64
  1461. package/node_modules/hono/dist/router/smart-router/index.js +1 -4
  1462. package/node_modules/hono/dist/router/smart-router/router.js +46 -55
  1463. package/node_modules/hono/dist/router/trie-router/index.js +1 -4
  1464. package/node_modules/hono/dist/router/trie-router/node.js +131 -162
  1465. package/node_modules/hono/dist/router/trie-router/router.js +11 -14
  1466. package/node_modules/hono/dist/router/utils.js +4 -5
  1467. package/node_modules/hono/dist/router.js +35 -14
  1468. package/node_modules/hono/dist/types/adapter/aws-lambda/conninfo.d.ts +4 -1
  1469. package/node_modules/hono/dist/types/adapter/aws-lambda/handler.d.ts +150 -105
  1470. package/node_modules/hono/dist/types/adapter/aws-lambda/index.d.ts +4 -8
  1471. package/node_modules/hono/dist/types/adapter/aws-lambda/types.d.ts +152 -123
  1472. package/node_modules/hono/dist/types/adapter/bun/conninfo.d.ts +4 -1
  1473. package/node_modules/hono/dist/types/adapter/bun/index.d.ts +6 -10
  1474. package/node_modules/hono/dist/types/adapter/bun/serve-static.d.ts +7 -2
  1475. package/node_modules/hono/dist/types/adapter/bun/server.d.ts +4 -5
  1476. package/node_modules/hono/dist/types/adapter/bun/ssg.d.ts +5 -1
  1477. package/node_modules/hono/dist/types/adapter/bun/websocket.d.ts +31 -17
  1478. package/node_modules/hono/dist/types/adapter/cloudflare-pages/conninfo.d.ts +4 -1
  1479. package/node_modules/hono/dist/types/adapter/cloudflare-pages/handler.d.ts +29 -18
  1480. package/node_modules/hono/dist/types/adapter/cloudflare-pages/index.d.ts +3 -7
  1481. package/node_modules/hono/dist/types/adapter/cloudflare-workers/conninfo.d.ts +6 -1
  1482. package/node_modules/hono/dist/types/adapter/cloudflare-workers/index.d.ts +4 -7
  1483. package/node_modules/hono/dist/types/adapter/cloudflare-workers/serve-static-module.d.ts +5 -3
  1484. package/node_modules/hono/dist/types/adapter/cloudflare-workers/serve-static.d.ts +10 -5
  1485. package/node_modules/hono/dist/types/adapter/cloudflare-workers/utils.d.ts +10 -2
  1486. package/node_modules/hono/dist/types/adapter/cloudflare-workers/websocket.d.ts +6 -1
  1487. package/node_modules/hono/dist/types/adapter/deno/conninfo.d.ts +4 -1
  1488. package/node_modules/hono/dist/types/adapter/deno/deno.d.ts +1 -0
  1489. package/node_modules/hono/dist/types/adapter/deno/index.d.ts +5 -8
  1490. package/node_modules/hono/dist/types/adapter/deno/serve-static.d.ts +7 -2
  1491. package/node_modules/hono/dist/types/adapter/deno/ssg.d.ts +5 -1
  1492. package/node_modules/hono/dist/types/adapter/deno/websocket.d.ts +6 -1
  1493. package/node_modules/hono/dist/types/adapter/lambda-edge/conninfo.d.ts +6 -1
  1494. package/node_modules/hono/dist/types/adapter/lambda-edge/handler.d.ts +83 -58
  1495. package/node_modules/hono/dist/types/adapter/lambda-edge/index.d.ts +3 -7
  1496. package/node_modules/hono/dist/types/adapter/netlify/conninfo.d.ts +4 -1
  1497. package/node_modules/hono/dist/types/adapter/netlify/handler.d.ts +6 -1
  1498. package/node_modules/hono/dist/types/adapter/netlify/index.d.ts +3 -5
  1499. package/node_modules/hono/dist/types/adapter/netlify/mod.d.ts +3 -2
  1500. package/node_modules/hono/dist/types/adapter/service-worker/handler.d.ts +9 -8
  1501. package/node_modules/hono/dist/types/adapter/service-worker/index.d.ts +6 -9
  1502. package/node_modules/hono/dist/types/adapter/service-worker/types.d.ts +12 -8
  1503. package/node_modules/hono/dist/types/adapter/vercel/conninfo.d.ts +6 -1
  1504. package/node_modules/hono/dist/types/adapter/vercel/handler.d.ts +6 -1
  1505. package/node_modules/hono/dist/types/adapter/vercel/index.d.ts +3 -6
  1506. package/node_modules/hono/dist/types/client/client.d.ts +5 -3
  1507. package/node_modules/hono/dist/types/client/fetch-result-please.d.ts +21 -19
  1508. package/node_modules/hono/dist/types/client/index.d.ts +5 -7
  1509. package/node_modules/hono/dist/types/client/types.d.ts +134 -160
  1510. package/node_modules/hono/dist/types/client/utils.d.ts +6 -4
  1511. package/node_modules/hono/dist/types/compose.d.ts +4 -2
  1512. package/node_modules/hono/dist/types/context.d.ts +335 -336
  1513. package/node_modules/hono/dist/types/helper/accepts/accepts.d.ts +11 -9
  1514. package/node_modules/hono/dist/types/helper/accepts/index.d.ts +2 -5
  1515. package/node_modules/hono/dist/types/helper/adapter/index.d.ts +4 -6
  1516. package/node_modules/hono/dist/types/helper/conninfo/index.d.ts +2 -5
  1517. package/node_modules/hono/dist/types/helper/conninfo/types.d.ts +25 -23
  1518. package/node_modules/hono/dist/types/helper/cookie/index.d.ts +10 -13
  1519. package/node_modules/hono/dist/types/helper/css/common.d.ts +11 -10
  1520. package/node_modules/hono/dist/types/helper/css/index.d.ts +25 -28
  1521. package/node_modules/hono/dist/types/helper/dev/index.d.ts +10 -13
  1522. package/node_modules/hono/dist/types/helper/factory/index.d.ts +26 -74
  1523. package/node_modules/hono/dist/types/helper/html/index.d.ts +4 -7
  1524. package/node_modules/hono/dist/types/helper/proxy/index.d.ts +20 -23
  1525. package/node_modules/hono/dist/types/helper/route/index.d.ts +6 -4
  1526. package/node_modules/hono/dist/types/helper/ssg/index.d.ts +4 -7
  1527. package/node_modules/hono/dist/types/helper/ssg/middleware.d.ts +8 -7
  1528. package/node_modules/hono/dist/types/helper/ssg/plugins.d.ts +3 -1
  1529. package/node_modules/hono/dist/types/helper/ssg/ssg.d.ts +38 -36
  1530. package/node_modules/hono/dist/types/helper/ssg/utils.d.ts +5 -4
  1531. package/node_modules/hono/dist/types/helper/streaming/index.d.ts +4 -8
  1532. package/node_modules/hono/dist/types/helper/streaming/sse.d.ts +10 -8
  1533. package/node_modules/hono/dist/types/helper/streaming/stream.d.ts +4 -2
  1534. package/node_modules/hono/dist/types/helper/streaming/text.d.ts +4 -2
  1535. package/node_modules/hono/dist/types/helper/streaming/utils.d.ts +2 -0
  1536. package/node_modules/hono/dist/types/helper/testing/index.d.ts +7 -10
  1537. package/node_modules/hono/dist/types/helper/websocket/index.d.ts +30 -33
  1538. package/node_modules/hono/dist/types/hono-base.d.ts +208 -211
  1539. package/node_modules/hono/dist/types/hono.d.ts +11 -10
  1540. package/node_modules/hono/dist/types/http-exception.d.ts +20 -23
  1541. package/node_modules/hono/dist/types/index.d.ts +6 -37
  1542. package/node_modules/hono/dist/types/jsx/base.d.ts +36 -35
  1543. package/node_modules/hono/dist/types/jsx/children.d.ts +8 -6
  1544. package/node_modules/hono/dist/types/jsx/components.d.ts +8 -5
  1545. package/node_modules/hono/dist/types/jsx/constants.d.ts +2 -0
  1546. package/node_modules/hono/dist/types/jsx/context.d.ts +9 -7
  1547. package/node_modules/hono/dist/types/jsx/dom/client.d.ts +8 -10
  1548. package/node_modules/hono/dist/types/jsx/dom/components.d.ts +9 -6
  1549. package/node_modules/hono/dist/types/jsx/dom/context.d.ts +3 -1
  1550. package/node_modules/hono/dist/types/jsx/dom/css.d.ts +26 -30
  1551. package/node_modules/hono/dist/types/jsx/dom/hooks/index.d.ts +11 -13
  1552. package/node_modules/hono/dist/types/jsx/dom/index.d.ts +78 -83
  1553. package/node_modules/hono/dist/types/jsx/dom/intrinsic-element/components.d.ts +9 -5
  1554. package/node_modules/hono/dist/types/jsx/dom/jsx-dev-runtime.d.ts +4 -6
  1555. package/node_modules/hono/dist/types/jsx/dom/jsx-runtime.d.ts +3 -7
  1556. package/node_modules/hono/dist/types/jsx/dom/render.d.ts +32 -51
  1557. package/node_modules/hono/dist/types/jsx/dom/server.d.ts +86 -85
  1558. package/node_modules/hono/dist/types/jsx/dom/utils.d.ts +2 -0
  1559. package/node_modules/hono/dist/types/jsx/hooks/index.d.ts +16 -17
  1560. package/node_modules/hono/dist/types/jsx/index.d.ts +70 -73
  1561. package/node_modules/hono/dist/types/jsx/intrinsic-element/common.d.ts +3 -1
  1562. package/node_modules/hono/dist/types/jsx/intrinsic-element/components.d.ts +7 -4
  1563. package/node_modules/hono/dist/types/jsx/intrinsic-elements.d.ts +708 -708
  1564. package/node_modules/hono/dist/types/jsx/jsx-dev-runtime.d.ts +4 -7
  1565. package/node_modules/hono/dist/types/jsx/jsx-runtime.d.ts +7 -10
  1566. package/node_modules/hono/dist/types/jsx/streaming.d.ts +9 -10
  1567. package/node_modules/hono/dist/types/jsx/types.d.ts +11 -13
  1568. package/node_modules/hono/dist/types/jsx/utils.d.ts +2 -0
  1569. package/node_modules/hono/dist/types/middleware/basic-auth/index.d.ts +17 -20
  1570. package/node_modules/hono/dist/types/middleware/bearer-auth/index.d.ts +46 -49
  1571. package/node_modules/hono/dist/types/middleware/body-limit/index.d.ts +6 -9
  1572. package/node_modules/hono/dist/types/middleware/cache/index.d.ts +13 -15
  1573. package/node_modules/hono/dist/types/middleware/combine/index.d.ts +7 -8
  1574. package/node_modules/hono/dist/types/middleware/compress/index.d.ts +8 -10
  1575. package/node_modules/hono/dist/types/middleware/context-storage/index.d.ts +4 -6
  1576. package/node_modules/hono/dist/types/middleware/cors/index.d.ts +10 -13
  1577. package/node_modules/hono/dist/types/middleware/csrf/index.d.ts +6 -9
  1578. package/node_modules/hono/dist/types/middleware/etag/digest.d.ts +2 -0
  1579. package/node_modules/hono/dist/types/middleware/etag/index.d.ts +6 -9
  1580. package/node_modules/hono/dist/types/middleware/ip-restriction/index.d.ts +11 -13
  1581. package/node_modules/hono/dist/types/middleware/jsx-renderer/index.d.ts +11 -12
  1582. package/node_modules/hono/dist/types/middleware/jwk/index.d.ts +2 -1
  1583. package/node_modules/hono/dist/types/middleware/jwk/jwk.d.ts +20 -23
  1584. package/node_modules/hono/dist/types/middleware/jwt/index.d.ts +6 -6
  1585. package/node_modules/hono/dist/types/middleware/jwt/jwt.d.ts +28 -30
  1586. package/node_modules/hono/dist/types/middleware/language/index.d.ts +5 -5
  1587. package/node_modules/hono/dist/types/middleware/language/language.d.ts +42 -44
  1588. package/node_modules/hono/dist/types/middleware/logger/index.d.ts +3 -6
  1589. package/node_modules/hono/dist/types/middleware/method-not-allowed/index.d.ts +7 -10
  1590. package/node_modules/hono/dist/types/middleware/method-override/index.d.ts +14 -17
  1591. package/node_modules/hono/dist/types/middleware/powered-by/index.d.ts +8 -11
  1592. package/node_modules/hono/dist/types/middleware/pretty-json/index.d.ts +18 -21
  1593. package/node_modules/hono/dist/types/middleware/request-id/index.d.ts +5 -5
  1594. package/node_modules/hono/dist/types/middleware/request-id/request-id.d.ts +9 -11
  1595. package/node_modules/hono/dist/types/middleware/secure-headers/index.d.ts +5 -6
  1596. package/node_modules/hono/dist/types/middleware/secure-headers/permissions-policy.d.ts +2 -1
  1597. package/node_modules/hono/dist/types/middleware/secure-headers/secure-headers.d.ts +55 -58
  1598. package/node_modules/hono/dist/types/middleware/serve-static/index.d.ts +24 -24
  1599. package/node_modules/hono/dist/types/middleware/serve-static/path.d.ts +2 -0
  1600. package/node_modules/hono/dist/types/middleware/timeout/index.d.ts +5 -7
  1601. package/node_modules/hono/dist/types/middleware/timing/index.d.ts +5 -5
  1602. package/node_modules/hono/dist/types/middleware/timing/timing.d.ts +17 -21
  1603. package/node_modules/hono/dist/types/middleware/trailing-slash/index.d.ts +35 -38
  1604. package/node_modules/hono/dist/types/preset/quick.d.ts +6 -9
  1605. package/node_modules/hono/dist/types/preset/tiny.d.ts +6 -9
  1606. package/node_modules/hono/dist/types/request/constants.d.ts +2 -0
  1607. package/node_modules/hono/dist/types/request.d.ts +288 -287
  1608. package/node_modules/hono/dist/types/router/linear-router/index.d.ts +2 -5
  1609. package/node_modules/hono/dist/types/router/linear-router/router.d.ts +7 -5
  1610. package/node_modules/hono/dist/types/router/pattern-router/index.d.ts +2 -5
  1611. package/node_modules/hono/dist/types/router/pattern-router/router.d.ts +7 -5
  1612. package/node_modules/hono/dist/types/router/reg-exp-router/index.d.ts +3 -6
  1613. package/node_modules/hono/dist/types/router/reg-exp-router/matcher.d.ts +3 -1
  1614. package/node_modules/hono/dist/types/router/reg-exp-router/node.d.ts +6 -4
  1615. package/node_modules/hono/dist/types/router/reg-exp-router/prepared-router.d.ts +11 -11
  1616. package/node_modules/hono/dist/types/router/reg-exp-router/router.d.ts +10 -9
  1617. package/node_modules/hono/dist/types/router/reg-exp-router/trie.d.ts +7 -5
  1618. package/node_modules/hono/dist/types/router/smart-router/index.d.ts +2 -5
  1619. package/node_modules/hono/dist/types/router/smart-router/router.d.ts +11 -9
  1620. package/node_modules/hono/dist/types/router/trie-router/index.d.ts +2 -5
  1621. package/node_modules/hono/dist/types/router/trie-router/node.d.ts +6 -4
  1622. package/node_modules/hono/dist/types/router/trie-router/router.d.ts +7 -5
  1623. package/node_modules/hono/dist/types/router/utils.d.ts +2 -0
  1624. package/node_modules/hono/dist/types/router.d.ts +23 -22
  1625. package/node_modules/hono/dist/types/types.d.ts +146 -506
  1626. package/node_modules/hono/dist/types/utils/accept.d.ts +5 -3
  1627. package/node_modules/hono/dist/types/utils/basic-auth.d.ts +4 -2
  1628. package/node_modules/hono/dist/types/utils/body.d.ts +46 -51
  1629. package/node_modules/hono/dist/types/utils/buffer.d.ts +7 -6
  1630. package/node_modules/hono/dist/types/utils/color.d.ts +2 -0
  1631. package/node_modules/hono/dist/types/utils/compress.d.ts +2 -0
  1632. package/node_modules/hono/dist/types/utils/concurrent.d.ts +6 -4
  1633. package/node_modules/hono/dist/types/utils/constants.d.ts +2 -0
  1634. package/node_modules/hono/dist/types/utils/cookie.d.ts +20 -19
  1635. package/node_modules/hono/dist/types/utils/crypto.d.ts +5 -8
  1636. package/node_modules/hono/dist/types/utils/encode.d.ts +2 -0
  1637. package/node_modules/hono/dist/types/utils/filepath.d.ts +5 -4
  1638. package/node_modules/hono/dist/types/utils/handler.d.ts +2 -0
  1639. package/node_modules/hono/dist/types/utils/headers.d.ts +2 -0
  1640. package/node_modules/hono/dist/types/utils/html.d.ts +11 -10
  1641. package/node_modules/hono/dist/types/utils/http-status.d.ts +2 -0
  1642. package/node_modules/hono/dist/types/utils/ipaddr.d.ts +4 -6
  1643. package/node_modules/hono/dist/types/utils/jwt/index.d.ts +18 -12
  1644. package/node_modules/hono/dist/types/utils/jwt/jwa.d.ts +15 -13
  1645. package/node_modules/hono/dist/types/utils/jwt/jws.d.ts +4 -7
  1646. package/node_modules/hono/dist/types/utils/jwt/jwt.d.ts +26 -29
  1647. package/node_modules/hono/dist/types/utils/jwt/types.d.ts +48 -45
  1648. package/node_modules/hono/dist/types/utils/jwt/utf8.d.ts +2 -0
  1649. package/node_modules/hono/dist/types/utils/mime.d.ts +59 -57
  1650. package/node_modules/hono/dist/types/utils/stream.d.ts +27 -25
  1651. package/node_modules/hono/dist/types/utils/types.d.ts +15 -28
  1652. package/node_modules/hono/dist/types/utils/url.d.ts +2 -1
  1653. package/node_modules/hono/dist/types/validator/index.d.ts +3 -7
  1654. package/node_modules/hono/dist/types/validator/utils.d.ts +6 -9
  1655. package/node_modules/hono/dist/types/validator/validator.d.ts +11 -10
  1656. package/node_modules/hono/dist/types.js +4 -6
  1657. package/node_modules/hono/dist/utils/accept.js +185 -215
  1658. package/node_modules/hono/dist/utils/basic-auth.js +18 -21
  1659. package/node_modules/hono/dist/utils/body.js +87 -92
  1660. package/node_modules/hono/dist/utils/buffer.js +44 -71
  1661. package/node_modules/hono/dist/utils/color.js +33 -21
  1662. package/node_modules/hono/dist/utils/compress.js +11 -5
  1663. package/node_modules/hono/dist/utils/concurrent.js +29 -38
  1664. package/node_modules/hono/dist/utils/constants.js +7 -5
  1665. package/node_modules/hono/dist/utils/cookie.js +114 -163
  1666. package/node_modules/hono/dist/utils/crypto.js +30 -40
  1667. package/node_modules/hono/dist/utils/encode.js +30 -26
  1668. package/node_modules/hono/dist/utils/filepath.js +23 -33
  1669. package/node_modules/hono/dist/utils/handler.js +10 -11
  1670. package/node_modules/hono/dist/utils/headers.js +1 -0
  1671. package/node_modules/hono/dist/utils/html.js +97 -117
  1672. package/node_modules/hono/dist/utils/http-status.js +1 -0
  1673. package/node_modules/hono/dist/utils/ipaddr.js +227 -279
  1674. package/node_modules/hono/dist/utils/jwt/index.js +12 -4
  1675. package/node_modules/hono/dist/utils/jwt/jwa.js +24 -20
  1676. package/node_modules/hono/dist/utils/jwt/jws.js +115 -174
  1677. package/node_modules/hono/dist/utils/jwt/jwt.js +120 -197
  1678. package/node_modules/hono/dist/utils/jwt/types.js +79 -95
  1679. package/node_modules/hono/dist/utils/jwt/utf8.js +9 -7
  1680. package/node_modules/hono/dist/utils/mime.js +74 -79
  1681. package/node_modules/hono/dist/utils/stream.js +86 -88
  1682. package/node_modules/hono/dist/utils/types.js +1 -0
  1683. package/node_modules/hono/dist/utils/url.js +187 -215
  1684. package/node_modules/hono/dist/validator/index.js +1 -4
  1685. package/node_modules/hono/dist/validator/utils.js +1 -0
  1686. package/node_modules/hono/dist/validator/validator.js +61 -83
  1687. package/node_modules/hono/package.json +27 -27
  1688. package/package.json +7 -8
  1689. package/prepare.mjs +109 -4
  1690. package/runtime-package.json +7 -9
  1691. package/scripts/check-install-toolchain.mjs +64 -40
  1692. package/shipping-sbom.cdx.json +134 -168
  1693. package/shipping-source.json +15 -15
  1694. package/node_modules/@earendil-works/chord/dist/api.d.ts +0 -20
  1695. package/node_modules/@earendil-works/chord/dist/api.d.ts.map +0 -1
  1696. package/node_modules/@earendil-works/chord/dist/api.js +0 -77
  1697. package/node_modules/@earendil-works/chord/dist/api.js.map +0 -1
  1698. package/node_modules/@earendil-works/chord/dist/bundler.d.ts +0 -6
  1699. package/node_modules/@earendil-works/chord/dist/bundler.d.ts.map +0 -1
  1700. package/node_modules/@earendil-works/chord/dist/bundler.js +0 -3
  1701. package/node_modules/@earendil-works/chord/dist/bundler.js.map +0 -1
  1702. package/node_modules/@earendil-works/chord/dist/facets/host.d.ts +0 -12
  1703. package/node_modules/@earendil-works/chord/dist/facets/host.d.ts.map +0 -1
  1704. package/node_modules/@earendil-works/chord/dist/facets/host.js +0 -763
  1705. package/node_modules/@earendil-works/chord/dist/facets/host.js.map +0 -1
  1706. package/node_modules/@earendil-works/chord/dist/facets/loader.d.ts +0 -3
  1707. package/node_modules/@earendil-works/chord/dist/facets/loader.d.ts.map +0 -1
  1708. package/node_modules/@earendil-works/chord/dist/facets/loader.js +0 -5
  1709. package/node_modules/@earendil-works/chord/dist/facets/loader.js.map +0 -1
  1710. package/node_modules/@earendil-works/chord/dist/node/bundle-loader.d.ts +0 -30
  1711. package/node_modules/@earendil-works/chord/dist/node/bundle-loader.d.ts.map +0 -1
  1712. package/node_modules/@earendil-works/chord/dist/node/bundle-loader.js +0 -377
  1713. package/node_modules/@earendil-works/chord/dist/node/bundle-loader.js.map +0 -1
  1714. package/node_modules/@earendil-works/chord/dist/node/bundle.d.ts +0 -26
  1715. package/node_modules/@earendil-works/chord/dist/node/bundle.d.ts.map +0 -1
  1716. package/node_modules/@earendil-works/chord/dist/node/bundle.js +0 -183
  1717. package/node_modules/@earendil-works/chord/dist/node/bundle.js.map +0 -1
  1718. package/node_modules/@earendil-works/chord/dist/node/manifest.d.ts +0 -36
  1719. package/node_modules/@earendil-works/chord/dist/node/manifest.d.ts.map +0 -1
  1720. package/node_modules/@earendil-works/chord/dist/node/manifest.js +0 -6
  1721. package/node_modules/@earendil-works/chord/dist/node/manifest.js.map +0 -1
  1722. package/node_modules/@earendil-works/chord/dist/node/package.d.ts +0 -15
  1723. package/node_modules/@earendil-works/chord/dist/node/package.d.ts.map +0 -1
  1724. package/node_modules/@earendil-works/chord/dist/node/package.js +0 -199
  1725. package/node_modules/@earendil-works/chord/dist/node/package.js.map +0 -1
  1726. package/node_modules/@earendil-works/chord/dist/services/consumer.d.ts +0 -11
  1727. package/node_modules/@earendil-works/chord/dist/services/consumer.d.ts.map +0 -1
  1728. package/node_modules/@earendil-works/chord/dist/services/consumer.js +0 -585
  1729. package/node_modules/@earendil-works/chord/dist/services/consumer.js.map +0 -1
  1730. package/node_modules/@earendil-works/chord/dist/services/errors.d.ts +0 -8
  1731. package/node_modules/@earendil-works/chord/dist/services/errors.d.ts.map +0 -1
  1732. package/node_modules/@earendil-works/chord/dist/services/errors.js +0 -22
  1733. package/node_modules/@earendil-works/chord/dist/services/errors.js.map +0 -1
  1734. package/node_modules/@earendil-works/chord/dist/services/handle.d.ts +0 -15
  1735. package/node_modules/@earendil-works/chord/dist/services/handle.d.ts.map +0 -1
  1736. package/node_modules/@earendil-works/chord/dist/services/handle.js +0 -101
  1737. package/node_modules/@earendil-works/chord/dist/services/handle.js.map +0 -1
  1738. package/node_modules/@earendil-works/chord/dist/services/instances.d.ts +0 -26
  1739. package/node_modules/@earendil-works/chord/dist/services/instances.d.ts.map +0 -1
  1740. package/node_modules/@earendil-works/chord/dist/services/instances.js +0 -140
  1741. package/node_modules/@earendil-works/chord/dist/services/instances.js.map +0 -1
  1742. package/node_modules/@earendil-works/chord/dist/services/loopback.d.ts +0 -5
  1743. package/node_modules/@earendil-works/chord/dist/services/loopback.d.ts.map +0 -1
  1744. package/node_modules/@earendil-works/chord/dist/services/loopback.js +0 -15
  1745. package/node_modules/@earendil-works/chord/dist/services/loopback.js.map +0 -1
  1746. package/node_modules/@earendil-works/chord/dist/services/provider.d.ts +0 -37
  1747. package/node_modules/@earendil-works/chord/dist/services/provider.d.ts.map +0 -1
  1748. package/node_modules/@earendil-works/chord/dist/services/provider.js +0 -521
  1749. package/node_modules/@earendil-works/chord/dist/services/provider.js.map +0 -1
  1750. package/node_modules/@earendil-works/chord/dist/services/state-codec.d.ts +0 -15
  1751. package/node_modules/@earendil-works/chord/dist/services/state-codec.d.ts.map +0 -1
  1752. package/node_modules/@earendil-works/chord/dist/services/state-codec.js +0 -133
  1753. package/node_modules/@earendil-works/chord/dist/services/state-codec.js.map +0 -1
  1754. package/node_modules/@earendil-works/chord/dist/services/state-internals.d.ts +0 -13
  1755. package/node_modules/@earendil-works/chord/dist/services/state-internals.d.ts.map +0 -1
  1756. package/node_modules/@earendil-works/chord/dist/services/state-internals.js +0 -10
  1757. package/node_modules/@earendil-works/chord/dist/services/state-internals.js.map +0 -1
  1758. package/node_modules/@earendil-works/chord/dist/services/state.d.ts +0 -28
  1759. package/node_modules/@earendil-works/chord/dist/services/state.d.ts.map +0 -1
  1760. package/node_modules/@earendil-works/chord/dist/services/state.js.map +0 -1
  1761. package/node_modules/@earendil-works/chord/dist/services/wire.d.ts +0 -63
  1762. package/node_modules/@earendil-works/chord/dist/services/wire.d.ts.map +0 -1
  1763. package/node_modules/@earendil-works/chord/dist/services/wire.js +0 -186
  1764. package/node_modules/@earendil-works/chord/dist/services/wire.js.map +0 -1
  1765. package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.d.ts +0 -3
  1766. package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.d.ts.map +0 -1
  1767. package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js +0 -14
  1768. package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js.map +0 -1
  1769. package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.models.d.ts +0 -6
  1770. package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.models.d.ts.map +0 -1
  1771. package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.models.js +0 -8
  1772. package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.models.js.map +0 -1
  1773. package/node_modules/@earendil-works/pi-ai/dist/providers/data/azure-openai-responses.json +0 -1
  1774. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/anthropic-messages-MVG2FL56.js +0 -6
  1775. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/azure-openai-responses-7AMFUIWJ.js +0 -2
  1776. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-6FX7UEPL.js +0 -132
  1777. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-7JGR3GZN.js +0 -11
  1778. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-A3JYRWB6.js +0 -2
  1779. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-IKZJX7ZT.js +0 -2
  1780. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-OSKPX3Z5.js +0 -2
  1781. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-OYBSLV7Y.js +0 -16
  1782. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-PDFMCAOZ.js +0 -19
  1783. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-U7B62NSC.js +0 -2
  1784. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-VIV3CWXG.js +0 -2
  1785. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-WCQZGZ6I.js +0 -82
  1786. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/cloudflare-workers-ai-system-one-X5PVWWYJ.js +0 -2
  1787. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/easter-egg-3d-T5FFWIBR.js +0 -2
  1788. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/execute-RYVK27GT.js +0 -388
  1789. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/mistral-conversations-7DAUEE4N.js +0 -5
  1790. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/openai-codex-responses-TC3OK7B4.js +0 -10
  1791. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/runtime-D5I2NTIF.js +0 -2
  1792. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/typesafe-system-one-A4CZTQWZ.js +0 -2
  1793. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/virtual-modules-KVWJD3T3.js +0 -2
  1794. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-json.d.ts +0 -85
  1795. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-json.d.ts.map +0 -1
  1796. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-json.js +0 -132
  1797. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-json.js.map +0 -1
  1798. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-schema.json +0 -361
  1799. package/node_modules/@earendil-works/pi-coding-agent/examples/plugins/pi-example-plugin/README.md +0 -38
  1800. package/node_modules/@earendil-works/pi-coding-agent/examples/plugins/pi-example-plugin/package.json +0 -10
  1801. package/node_modules/@earendil-works/pi-coding-agent/examples/plugins/pi-example-plugin/src/contract.ts +0 -13
  1802. package/node_modules/@earendil-works/pi-coding-agent/examples/plugins/pi-example-plugin/src/session.ts +0 -24
  1803. package/node_modules/@earendil-works/pi-coding-agent/examples/plugins/pi-example-plugin/src/tui.ts +0 -31
  1804. package/node_modules/@esbuild/linux-x64/README.md +0 -3
  1805. package/node_modules/@esbuild/linux-x64/bin/esbuild +0 -0
  1806. package/node_modules/@esbuild/linux-x64/package.json +0 -20
  1807. package/node_modules/esbuild/LICENSE.md +0 -21
  1808. package/node_modules/esbuild/README.md +0 -3
  1809. package/node_modules/esbuild/bin/esbuild +0 -223
  1810. package/node_modules/esbuild/install.js +0 -300
  1811. package/node_modules/esbuild/lib/main.d.ts +0 -720
  1812. package/node_modules/esbuild/lib/main.js +0 -2536
  1813. package/node_modules/esbuild/package.json +0 -74
@@ -1,2536 +0,0 @@
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
- });