@harrylabsj/kiwi-merchant-cloud 0.12.4 → 0.12.5

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 (1225) 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/cloud/bootstrap.d.ts +4 -0
  34. package/app/cloud/bootstrap.js +69 -55
  35. package/app/cloud/bootstrap.js.map +1 -1
  36. package/app/cloud/file-listing-publication.js +6 -0
  37. package/app/cloud/file-listing-publication.js.map +1 -1
  38. package/app/cloud/main.d.ts +3 -0
  39. package/app/cloud/main.js +47 -11
  40. package/app/cloud/main.js.map +1 -1
  41. package/app/cloud/product-import-tabular.d.ts +1 -1
  42. package/app/cloud/product-import-tabular.js +263 -36
  43. package/app/cloud/product-import-tabular.js.map +1 -1
  44. package/app/cloud/product-source.d.ts +6 -1
  45. package/app/cloud/product-source.js +47 -15
  46. package/app/cloud/product-source.js.map +1 -1
  47. package/app/cloud-sample/products.json +3 -3
  48. package/app/commerce/data-source.d.ts +4 -0
  49. package/app/commerce/data-source.js.map +1 -1
  50. package/app/commerce/shopping-cli-source.js +4 -0
  51. package/app/commerce/shopping-cli-source.js.map +1 -1
  52. package/app/discovery/catalog-source/kiwi-source.d.ts +2 -0
  53. package/app/discovery/catalog-source/kiwi-source.js +4 -0
  54. package/app/discovery/catalog-source/kiwi-source.js.map +1 -1
  55. package/app/handoff/index.d.ts +2 -1
  56. package/app/handoff/index.js +1 -0
  57. package/app/handoff/index.js.map +1 -1
  58. package/app/handoff/launch-marketplace-policy.d.ts +149 -0
  59. package/app/handoff/launch-marketplace-policy.js +301 -0
  60. package/app/handoff/launch-marketplace-policy.js.map +1 -0
  61. package/app/handoff/marketplace-product-link.d.ts +18 -0
  62. package/app/handoff/marketplace-product-link.js +71 -0
  63. package/app/handoff/marketplace-product-link.js.map +1 -0
  64. package/app/handoff/transaction.d.ts +30 -0
  65. package/app/handoff/transaction.js +64 -0
  66. package/app/handoff/transaction.js.map +1 -1
  67. package/app/handoff/url-safety.d.ts +3 -0
  68. package/app/handoff/url-safety.js +4 -0
  69. package/app/handoff/url-safety.js.map +1 -1
  70. package/app/http/merchant-management/page.js +176 -45
  71. package/app/http/merchant-management/page.js.map +1 -1
  72. package/app/i18n.d.ts +1 -0
  73. package/app/i18n.js +3 -0
  74. package/app/i18n.js.map +1 -1
  75. package/app/lifecycle/close.d.ts +24 -0
  76. package/app/lifecycle/close.js +131 -0
  77. package/app/lifecycle/close.js.map +1 -0
  78. package/app/mcp/merchant-runtime-assembly.js +6 -4
  79. package/app/mcp/merchant-runtime-assembly.js.map +1 -1
  80. package/app/mcp/tools.js +17 -16
  81. package/app/mcp/tools.js.map +1 -1
  82. package/app/merchant/application/service.d.ts +4 -0
  83. package/app/merchant/application/service.js.map +1 -1
  84. package/app/merchant/stats-store.d.ts +3 -0
  85. package/app/merchant/stats-store.js +15 -1
  86. package/app/merchant/stats-store.js.map +1 -1
  87. package/app/merchant-core/rfq/data-source-adapter.d.ts +2 -10
  88. package/app/merchant-core/rfq/data-source-adapter.js +21 -9
  89. package/app/merchant-core/rfq/data-source-adapter.js.map +1 -1
  90. package/app/merchant-gateway/pinned-fetch.js +5 -2
  91. package/app/merchant-gateway/pinned-fetch.js.map +1 -1
  92. package/build-manifest.json +2901 -1966
  93. package/node_modules/@earendil-works/chord/CHANGELOG.md +20 -0
  94. package/node_modules/@earendil-works/chord/README.md +77 -194
  95. package/node_modules/@earendil-works/chord/dist/cell.d.ts +101 -0
  96. package/node_modules/@earendil-works/chord/dist/cell.d.ts.map +1 -0
  97. package/node_modules/@earendil-works/chord/dist/cell.js +316 -0
  98. package/node_modules/@earendil-works/chord/dist/cell.js.map +1 -0
  99. package/node_modules/@earendil-works/chord/dist/cluster.d.ts +26 -0
  100. package/node_modules/@earendil-works/chord/dist/cluster.d.ts.map +1 -0
  101. package/node_modules/@earendil-works/chord/dist/cluster.js +214 -0
  102. package/node_modules/@earendil-works/chord/dist/cluster.js.map +1 -0
  103. package/node_modules/@earendil-works/chord/dist/connection.d.ts +157 -0
  104. package/node_modules/@earendil-works/chord/dist/connection.d.ts.map +1 -0
  105. package/node_modules/@earendil-works/chord/dist/connection.js +757 -0
  106. package/node_modules/@earendil-works/chord/dist/connection.js.map +1 -0
  107. package/node_modules/@earendil-works/chord/dist/context/index.d.ts +12 -1
  108. package/node_modules/@earendil-works/chord/dist/context/index.d.ts.map +1 -1
  109. package/node_modules/@earendil-works/chord/dist/context/index.js.map +1 -1
  110. package/node_modules/@earendil-works/chord/dist/contract.d.ts +133 -0
  111. package/node_modules/@earendil-works/chord/dist/contract.d.ts.map +1 -0
  112. package/node_modules/@earendil-works/chord/dist/contract.js +157 -0
  113. package/node_modules/@earendil-works/chord/dist/contract.js.map +1 -0
  114. package/node_modules/@earendil-works/chord/dist/declare.d.ts +70 -0
  115. package/node_modules/@earendil-works/chord/dist/declare.d.ts.map +1 -0
  116. package/node_modules/@earendil-works/chord/dist/declare.js +22 -0
  117. package/node_modules/@earendil-works/chord/dist/declare.js.map +1 -0
  118. package/node_modules/@earendil-works/chord/dist/delta/apply-immutable-trusted.js.map +1 -1
  119. package/node_modules/@earendil-works/chord/dist/delta/diff.d.ts +1 -1
  120. package/node_modules/@earendil-works/chord/dist/delta/diff.d.ts.map +1 -1
  121. package/node_modules/@earendil-works/chord/dist/delta/diff.js.map +1 -1
  122. package/node_modules/@earendil-works/chord/dist/delta/index.d.ts +2 -2
  123. package/node_modules/@earendil-works/chord/dist/delta/index.d.ts.map +1 -1
  124. package/node_modules/@earendil-works/chord/dist/delta/index.js +41 -0
  125. package/node_modules/@earendil-works/chord/dist/delta/index.js.map +1 -1
  126. package/node_modules/@earendil-works/chord/dist/delta/revision-validator.d.ts +1 -1
  127. package/node_modules/@earendil-works/chord/dist/delta/revision-validator.d.ts.map +1 -1
  128. package/node_modules/@earendil-works/chord/dist/delta/revision-validator.js.map +1 -1
  129. package/node_modules/@earendil-works/chord/dist/delta/tracker.d.ts +1 -1
  130. package/node_modules/@earendil-works/chord/dist/delta/tracker.d.ts.map +1 -1
  131. package/node_modules/@earendil-works/chord/dist/delta/tracker.js +40 -4
  132. package/node_modules/@earendil-works/chord/dist/delta/tracker.js.map +1 -1
  133. package/node_modules/@earendil-works/chord/dist/errors.d.ts +27 -0
  134. package/node_modules/@earendil-works/chord/dist/errors.d.ts.map +1 -0
  135. package/node_modules/@earendil-works/chord/dist/errors.js +44 -0
  136. package/node_modules/@earendil-works/chord/dist/errors.js.map +1 -0
  137. package/node_modules/@earendil-works/chord/dist/host.d.ts +254 -0
  138. package/node_modules/@earendil-works/chord/dist/host.d.ts.map +1 -0
  139. package/node_modules/@earendil-works/chord/dist/host.js +795 -0
  140. package/node_modules/@earendil-works/chord/dist/host.js.map +1 -0
  141. package/node_modules/@earendil-works/chord/dist/index.d.ts +17 -10
  142. package/node_modules/@earendil-works/chord/dist/index.d.ts.map +1 -1
  143. package/node_modules/@earendil-works/chord/dist/index.js +8 -8
  144. package/node_modules/@earendil-works/chord/dist/index.js.map +1 -1
  145. package/node_modules/@earendil-works/chord/dist/json.d.ts +9 -1
  146. package/node_modules/@earendil-works/chord/dist/json.d.ts.map +1 -1
  147. package/node_modules/@earendil-works/chord/dist/json.js.map +1 -1
  148. package/node_modules/@earendil-works/chord/dist/link.d.ts +72 -0
  149. package/node_modules/@earendil-works/chord/dist/link.d.ts.map +1 -0
  150. package/node_modules/@earendil-works/chord/dist/link.js +169 -0
  151. package/node_modules/@earendil-works/chord/dist/link.js.map +1 -0
  152. package/node_modules/@earendil-works/chord/dist/loader.d.ts +4 -0
  153. package/node_modules/@earendil-works/chord/dist/loader.d.ts.map +1 -0
  154. package/node_modules/@earendil-works/chord/dist/loader.js +68 -0
  155. package/node_modules/@earendil-works/chord/dist/loader.js.map +1 -0
  156. package/node_modules/@earendil-works/chord/dist/manager.d.ts +115 -0
  157. package/node_modules/@earendil-works/chord/dist/manager.d.ts.map +1 -0
  158. package/node_modules/@earendil-works/chord/dist/manager.js +319 -0
  159. package/node_modules/@earendil-works/chord/dist/manager.js.map +1 -0
  160. package/node_modules/@earendil-works/chord/dist/node.d.ts +3 -4
  161. package/node_modules/@earendil-works/chord/dist/node.d.ts.map +1 -1
  162. package/node_modules/@earendil-works/chord/dist/node.js +3 -2
  163. package/node_modules/@earendil-works/chord/dist/node.js.map +1 -1
  164. package/node_modules/@earendil-works/chord/dist/publish.d.ts +5 -0
  165. package/node_modules/@earendil-works/chord/dist/publish.d.ts.map +1 -0
  166. package/node_modules/@earendil-works/chord/dist/publish.js +40 -0
  167. package/node_modules/@earendil-works/chord/dist/publish.js.map +1 -0
  168. package/node_modules/@earendil-works/chord/dist/record.d.ts +320 -0
  169. package/node_modules/@earendil-works/chord/dist/record.d.ts.map +1 -0
  170. package/node_modules/@earendil-works/chord/dist/record.js +1292 -0
  171. package/node_modules/@earendil-works/chord/dist/record.js.map +1 -0
  172. package/node_modules/@earendil-works/chord/dist/registry.d.ts +25 -0
  173. package/node_modules/@earendil-works/chord/dist/registry.d.ts.map +1 -0
  174. package/node_modules/@earendil-works/chord/dist/registry.js +6 -0
  175. package/node_modules/@earendil-works/chord/dist/registry.js.map +1 -0
  176. package/node_modules/@earendil-works/chord/dist/reload.d.ts +118 -0
  177. package/node_modules/@earendil-works/chord/dist/reload.d.ts.map +1 -0
  178. package/node_modules/@earendil-works/chord/dist/reload.js +589 -0
  179. package/node_modules/@earendil-works/chord/dist/reload.js.map +1 -0
  180. package/node_modules/@earendil-works/chord/dist/remote.d.ts +70 -0
  181. package/node_modules/@earendil-works/chord/dist/remote.d.ts.map +1 -0
  182. package/node_modules/@earendil-works/chord/dist/remote.js +308 -0
  183. package/node_modules/@earendil-works/chord/dist/remote.js.map +1 -0
  184. package/node_modules/@earendil-works/chord/dist/schema.d.ts +21 -0
  185. package/node_modules/@earendil-works/chord/dist/schema.d.ts.map +1 -0
  186. package/node_modules/@earendil-works/chord/dist/schema.js +228 -0
  187. package/node_modules/@earendil-works/chord/dist/schema.js.map +1 -0
  188. package/node_modules/@earendil-works/chord/dist/state.d.ts +92 -0
  189. package/node_modules/@earendil-works/chord/dist/state.d.ts.map +1 -0
  190. package/node_modules/@earendil-works/chord/dist/{services/state.js → state.js} +28 -138
  191. package/node_modules/@earendil-works/chord/dist/state.js.map +1 -0
  192. package/node_modules/@earendil-works/chord/dist/types.d.ts +62 -262
  193. package/node_modules/@earendil-works/chord/dist/types.d.ts.map +1 -1
  194. package/node_modules/@earendil-works/chord/dist/types.js.map +1 -1
  195. package/node_modules/@earendil-works/chord/dist/websocket.d.ts +16 -0
  196. package/node_modules/@earendil-works/chord/dist/websocket.d.ts.map +1 -0
  197. package/node_modules/@earendil-works/chord/dist/websocket.js +15 -0
  198. package/node_modules/@earendil-works/chord/dist/websocket.js.map +1 -0
  199. package/node_modules/@earendil-works/chord/dist/wire.d.ts +135 -0
  200. package/node_modules/@earendil-works/chord/dist/wire.d.ts.map +1 -0
  201. package/node_modules/@earendil-works/chord/dist/wire.js +112 -0
  202. package/node_modules/@earendil-works/chord/dist/wire.js.map +1 -0
  203. package/node_modules/@earendil-works/chord/docs/guide.md +750 -0
  204. package/node_modules/@earendil-works/chord/docs/spec.md +261 -0
  205. package/node_modules/@earendil-works/chord/docs/tutorial.md +909 -0
  206. package/node_modules/@earendil-works/chord/package.json +10 -11
  207. package/node_modules/@earendil-works/chord/src/delta/README.md +5 -3
  208. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
  209. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js +9 -1
  210. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js.map +1 -1
  211. package/node_modules/@earendil-works/pi-agent-core/dist/proxy.d.ts +2 -5
  212. package/node_modules/@earendil-works/pi-agent-core/dist/proxy.d.ts.map +1 -1
  213. package/node_modules/@earendil-works/pi-agent-core/dist/proxy.js +2 -14
  214. package/node_modules/@earendil-works/pi-agent-core/dist/proxy.js.map +1 -1
  215. package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts +4 -0
  216. package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts.map +1 -1
  217. package/node_modules/@earendil-works/pi-agent-core/dist/types.js.map +1 -1
  218. package/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
  219. package/node_modules/@earendil-works/pi-ai/README.md +14 -3
  220. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.d.ts.map +1 -1
  221. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +63 -22
  222. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js.map +1 -1
  223. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-config.d.ts +15 -0
  224. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-config.d.ts.map +1 -0
  225. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-config.js +76 -0
  226. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-config.js.map +1 -0
  227. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.d.ts +3 -6
  228. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.d.ts.map +1 -1
  229. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js +2 -74
  230. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js.map +1 -1
  231. package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js +33 -2
  232. package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js.map +1 -1
  233. package/node_modules/@earendil-works/pi-ai/dist/api/classifier-shared.d.ts +21 -0
  234. package/node_modules/@earendil-works/pi-ai/dist/api/classifier-shared.d.ts.map +1 -0
  235. package/node_modules/@earendil-works/pi-ai/dist/api/classifier-shared.js +98 -0
  236. package/node_modules/@earendil-works/pi-ai/dist/api/classifier-shared.js.map +1 -0
  237. package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-workers-ai-system-one.d.ts.map +1 -1
  238. package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-workers-ai-system-one.js +2 -1
  239. package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-workers-ai-system-one.js.map +1 -1
  240. package/node_modules/@earendil-works/pi-ai/dist/api/lazy.d.ts.map +1 -1
  241. package/node_modules/@earendil-works/pi-ai/dist/api/lazy.js +4 -3
  242. package/node_modules/@earendil-works/pi-ai/dist/api/lazy.js.map +1 -1
  243. package/node_modules/@earendil-works/pi-ai/dist/api/llama-cpp-classify.d.ts.map +1 -1
  244. package/node_modules/@earendil-works/pi-ai/dist/api/llama-cpp-classify.js +2 -0
  245. package/node_modules/@earendil-works/pi-ai/dist/api/llama-cpp-classify.js.map +1 -1
  246. package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.d.ts.map +1 -1
  247. package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js +31 -14
  248. package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js.map +1 -1
  249. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.d.ts.map +1 -1
  250. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js +7 -4
  251. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js.map +1 -1
  252. package/node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.d.ts +4 -0
  253. package/node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.d.ts.map +1 -0
  254. package/node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.js +162 -0
  255. package/node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.js.map +1 -0
  256. package/node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.lazy.d.ts +3 -0
  257. package/node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.lazy.d.ts.map +1 -0
  258. package/node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.lazy.js +4 -0
  259. package/node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.lazy.js.map +1 -0
  260. package/node_modules/@earendil-works/pi-ai/dist/api/system-one-shared.d.ts +0 -1
  261. package/node_modules/@earendil-works/pi-ai/dist/api/system-one-shared.d.ts.map +1 -1
  262. package/node_modules/@earendil-works/pi-ai/dist/api/system-one-shared.js +5 -89
  263. package/node_modules/@earendil-works/pi-ai/dist/api/system-one-shared.js.map +1 -1
  264. package/node_modules/@earendil-works/pi-ai/dist/api/typesafe-system-one.d.ts.map +1 -1
  265. package/node_modules/@earendil-works/pi-ai/dist/api/typesafe-system-one.js +2 -1
  266. package/node_modules/@earendil-works/pi-ai/dist/api/typesafe-system-one.js.map +1 -1
  267. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/anthropic.d.ts.map +1 -1
  268. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/anthropic.js +14 -6
  269. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/anthropic.js.map +1 -1
  270. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openai-chatgpt.js +1 -1
  271. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openai-chatgpt.js.map +1 -1
  272. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openai-codex.d.ts.map +1 -1
  273. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openai-codex.js +4 -4
  274. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openai-codex.js.map +1 -1
  275. package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.d.ts +16 -1
  276. package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.d.ts.map +1 -1
  277. package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js +51 -27
  278. package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js.map +1 -1
  279. package/node_modules/@earendil-works/pi-ai/dist/auth/types.d.ts +5 -0
  280. package/node_modules/@earendil-works/pi-ai/dist/auth/types.d.ts.map +1 -1
  281. package/node_modules/@earendil-works/pi-ai/dist/auth/types.js.map +1 -1
  282. package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js +1 -1
  283. package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js.map +1 -1
  284. package/node_modules/@earendil-works/pi-ai/dist/models.d.ts +5 -0
  285. package/node_modules/@earendil-works/pi-ai/dist/models.d.ts.map +1 -1
  286. package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts +4 -4
  287. package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts.map +1 -1
  288. package/node_modules/@earendil-works/pi-ai/dist/models.generated.js +4 -4
  289. package/node_modules/@earendil-works/pi-ai/dist/models.generated.js.map +1 -1
  290. package/node_modules/@earendil-works/pi-ai/dist/models.js +7 -8
  291. package/node_modules/@earendil-works/pi-ai/dist/models.js.map +1 -1
  292. package/node_modules/@earendil-works/pi-ai/dist/providers/all.js +2 -2
  293. package/node_modules/@earendil-works/pi-ai/dist/providers/all.js.map +1 -1
  294. package/node_modules/@earendil-works/pi-ai/dist/providers/azure.d.ts +3 -0
  295. package/node_modules/@earendil-works/pi-ai/dist/providers/azure.d.ts.map +1 -0
  296. package/node_modules/@earendil-works/pi-ai/dist/providers/azure.js +46 -0
  297. package/node_modules/@earendil-works/pi-ai/dist/providers/azure.js.map +1 -0
  298. package/node_modules/@earendil-works/pi-ai/dist/providers/azure.models.d.ts +6 -0
  299. package/node_modules/@earendil-works/pi-ai/dist/providers/azure.models.d.ts.map +1 -0
  300. package/node_modules/@earendil-works/pi-ai/dist/providers/azure.models.js +8 -0
  301. package/node_modules/@earendil-works/pi-ai/dist/providers/azure.models.js.map +1 -0
  302. package/node_modules/@earendil-works/pi-ai/dist/providers/compat-schema.d.ts +338 -0
  303. package/node_modules/@earendil-works/pi-ai/dist/providers/compat-schema.d.ts.map +1 -0
  304. package/node_modules/@earendil-works/pi-ai/dist/providers/compat-schema.js +375 -0
  305. package/node_modules/@earendil-works/pi-ai/dist/providers/compat-schema.js.map +1 -0
  306. package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
  307. package/node_modules/@earendil-works/pi-ai/dist/providers/data/amazon-bedrock.json +1 -1
  308. package/node_modules/@earendil-works/pi-ai/dist/providers/data/anthropic.json +1 -1
  309. package/node_modules/@earendil-works/pi-ai/dist/providers/data/azure.json +1 -0
  310. package/node_modules/@earendil-works/pi-ai/dist/providers/data/baseten.json +1 -1
  311. package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-ai-gateway.json +1 -1
  312. package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-workers-ai.json +1 -1
  313. package/node_modules/@earendil-works/pi-ai/dist/providers/data/github-copilot.json +1 -1
  314. package/node_modules/@earendil-works/pi-ai/dist/providers/data/google-vertex.json +1 -1
  315. package/node_modules/@earendil-works/pi-ai/dist/providers/data/google.json +1 -1
  316. package/node_modules/@earendil-works/pi-ai/dist/providers/data/huggingface.json +1 -1
  317. package/node_modules/@earendil-works/pi-ai/dist/providers/data/meta.json +1 -1
  318. package/node_modules/@earendil-works/pi-ai/dist/providers/data/minimax-cn.json +1 -1
  319. package/node_modules/@earendil-works/pi-ai/dist/providers/data/minimax.json +1 -1
  320. package/node_modules/@earendil-works/pi-ai/dist/providers/data/mistral.json +1 -1
  321. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai.json +1 -1
  322. package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode-go.json +1 -1
  323. package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode.json +1 -1
  324. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
  325. package/node_modules/@earendil-works/pi-ai/dist/providers/data/radius.json +1 -1
  326. package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
  327. package/node_modules/@earendil-works/pi-ai/dist/providers/faux.d.ts.map +1 -1
  328. package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js +25 -8
  329. package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js.map +1 -1
  330. package/node_modules/@earendil-works/pi-ai/dist/providers/model-schema.d.ts +91 -0
  331. package/node_modules/@earendil-works/pi-ai/dist/providers/model-schema.d.ts.map +1 -0
  332. package/node_modules/@earendil-works/pi-ai/dist/providers/model-schema.js +55 -0
  333. package/node_modules/@earendil-works/pi-ai/dist/providers/model-schema.js.map +1 -0
  334. package/node_modules/@earendil-works/pi-ai/dist/providers/openai.d.ts.map +1 -1
  335. package/node_modules/@earendil-works/pi-ai/dist/providers/openai.js +12 -3
  336. package/node_modules/@earendil-works/pi-ai/dist/providers/openai.js.map +1 -1
  337. package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter-api.d.ts +40 -0
  338. package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter-api.d.ts.map +1 -0
  339. package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter-api.js +41 -0
  340. package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter-api.js.map +1 -0
  341. package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.d.ts +11 -1
  342. package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.d.ts.map +1 -1
  343. package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.js +52 -1
  344. package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.js.map +1 -1
  345. package/node_modules/@earendil-works/pi-ai/dist/providers/radius.d.ts.map +1 -1
  346. package/node_modules/@earendil-works/pi-ai/dist/providers/radius.js +4 -12
  347. package/node_modules/@earendil-works/pi-ai/dist/providers/radius.js.map +1 -1
  348. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +22 -305
  349. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
  350. package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -1
  351. package/node_modules/@earendil-works/pi-ai/dist/utils/estimate.js +1 -1
  352. package/node_modules/@earendil-works/pi-ai/dist/utils/estimate.js.map +1 -1
  353. package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.d.ts +10 -1
  354. package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.d.ts.map +1 -1
  355. package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js +25 -0
  356. package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js.map +1 -1
  357. package/node_modules/@earendil-works/pi-ai/dist/utils/model-operations.d.ts +3 -1
  358. package/node_modules/@earendil-works/pi-ai/dist/utils/model-operations.d.ts.map +1 -1
  359. package/node_modules/@earendil-works/pi-ai/dist/utils/model-operations.js +6 -0
  360. package/node_modules/@earendil-works/pi-ai/dist/utils/model-operations.js.map +1 -1
  361. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.d.ts +2 -0
  362. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.d.ts.map +1 -1
  363. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.js +2 -0
  364. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.js.map +1 -1
  365. package/node_modules/@earendil-works/pi-ai/dist/utils/retry.d.ts.map +1 -1
  366. package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +8 -2
  367. package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js.map +1 -1
  368. package/node_modules/@earendil-works/pi-ai/package.json +2 -2
  369. package/node_modules/@earendil-works/pi-codemode/README.md +177 -11
  370. package/node_modules/@earendil-works/pi-codemode/dist/cloudflare.d.ts +53 -0
  371. package/node_modules/@earendil-works/pi-codemode/dist/cloudflare.d.ts.map +1 -0
  372. package/node_modules/@earendil-works/pi-codemode/dist/cloudflare.js +64 -0
  373. package/node_modules/@earendil-works/pi-codemode/dist/cloudflare.js.map +1 -0
  374. package/node_modules/@earendil-works/pi-codemode/dist/declarations.d.ts +6 -21
  375. package/node_modules/@earendil-works/pi-codemode/dist/declarations.d.ts.map +1 -1
  376. package/node_modules/@earendil-works/pi-codemode/dist/declarations.js +113 -127
  377. package/node_modules/@earendil-works/pi-codemode/dist/declarations.js.map +1 -1
  378. package/node_modules/@earendil-works/pi-codemode/dist/index.d.ts +5 -2
  379. package/node_modules/@earendil-works/pi-codemode/dist/index.d.ts.map +1 -1
  380. package/node_modules/@earendil-works/pi-codemode/dist/index.js +4 -1
  381. package/node_modules/@earendil-works/pi-codemode/dist/index.js.map +1 -1
  382. package/node_modules/@earendil-works/pi-codemode/dist/portable.d.ts +15 -0
  383. package/node_modules/@earendil-works/pi-codemode/dist/portable.d.ts.map +1 -0
  384. package/node_modules/@earendil-works/pi-codemode/dist/portable.js +12 -0
  385. package/node_modules/@earendil-works/pi-codemode/dist/portable.js.map +1 -0
  386. package/node_modules/@earendil-works/pi-codemode/dist/runtime/execution.d.ts +66 -0
  387. package/node_modules/@earendil-works/pi-codemode/dist/runtime/execution.d.ts.map +1 -0
  388. package/node_modules/@earendil-works/pi-codemode/dist/runtime/execution.js +494 -0
  389. package/node_modules/@earendil-works/pi-codemode/dist/runtime/execution.js.map +1 -0
  390. package/node_modules/@earendil-works/pi-codemode/dist/runtime/host.d.ts +8 -30
  391. package/node_modules/@earendil-works/pi-codemode/dist/runtime/host.d.ts.map +1 -1
  392. package/node_modules/@earendil-works/pi-codemode/dist/runtime/host.js +41 -283
  393. package/node_modules/@earendil-works/pi-codemode/dist/runtime/host.js.map +1 -1
  394. package/node_modules/@earendil-works/pi-codemode/dist/runtime/inline.d.ts +63 -0
  395. package/node_modules/@earendil-works/pi-codemode/dist/runtime/inline.d.ts.map +1 -0
  396. package/node_modules/@earendil-works/pi-codemode/dist/runtime/inline.js +80 -0
  397. package/node_modules/@earendil-works/pi-codemode/dist/runtime/inline.js.map +1 -0
  398. package/node_modules/@earendil-works/pi-codemode/dist/runtime/prelude-source.d.ts +9 -3
  399. package/node_modules/@earendil-works/pi-codemode/dist/runtime/prelude-source.d.ts.map +1 -1
  400. package/node_modules/@earendil-works/pi-codemode/dist/runtime/prelude-source.js +122 -12
  401. package/node_modules/@earendil-works/pi-codemode/dist/runtime/prelude-source.js.map +1 -1
  402. package/node_modules/@earendil-works/pi-codemode/dist/runtime/protocol.d.ts +47 -6
  403. package/node_modules/@earendil-works/pi-codemode/dist/runtime/protocol.d.ts.map +1 -1
  404. package/node_modules/@earendil-works/pi-codemode/dist/runtime/protocol.js +6 -1
  405. package/node_modules/@earendil-works/pi-codemode/dist/runtime/protocol.js.map +1 -1
  406. package/node_modules/@earendil-works/pi-codemode/dist/runtime/remote.d.ts +102 -0
  407. package/node_modules/@earendil-works/pi-codemode/dist/runtime/remote.d.ts.map +1 -0
  408. package/node_modules/@earendil-works/pi-codemode/dist/runtime/remote.js +175 -0
  409. package/node_modules/@earendil-works/pi-codemode/dist/runtime/remote.js.map +1 -0
  410. package/node_modules/@earendil-works/pi-codemode/dist/runtime/vm.d.ts +24 -0
  411. package/node_modules/@earendil-works/pi-codemode/dist/runtime/vm.d.ts.map +1 -0
  412. package/node_modules/@earendil-works/pi-codemode/dist/runtime/vm.js +293 -0
  413. package/node_modules/@earendil-works/pi-codemode/dist/runtime/vm.js.map +1 -0
  414. package/node_modules/@earendil-works/pi-codemode/dist/runtime/worker.js +11 -110
  415. package/node_modules/@earendil-works/pi-codemode/dist/runtime/worker.js.map +1 -1
  416. package/node_modules/@earendil-works/pi-codemode/dist/source.d.ts +2 -1
  417. package/node_modules/@earendil-works/pi-codemode/dist/source.d.ts.map +1 -1
  418. package/node_modules/@earendil-works/pi-codemode/dist/source.js +8 -2
  419. package/node_modules/@earendil-works/pi-codemode/dist/source.js.map +1 -1
  420. package/node_modules/@earendil-works/pi-codemode/dist/types.d.ts +101 -6
  421. package/node_modules/@earendil-works/pi-codemode/dist/types.d.ts.map +1 -1
  422. package/node_modules/@earendil-works/pi-codemode/dist/types.js.map +1 -1
  423. package/node_modules/@earendil-works/pi-codemode/package.json +15 -3
  424. package/node_modules/@earendil-works/pi-coding-agent/CHANGELOG.md +165 -0
  425. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/anthropic-messages-Q7SXESRX.js +6 -0
  426. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/anthropic.js +1 -1
  427. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/azure-openai-responses-LM52U7CK.js +2 -0
  428. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/bedrock-converse-stream.js +2 -2
  429. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-22CYIUS4.js +2 -0
  430. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-3ZATHNCK.js +9 -0
  431. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-5GTPJSRI.js +7 -0
  432. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-6MWTY2OB.js +130 -0
  433. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-6QGV3IWD.js +6 -0
  434. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-2KAZSACP.js → chunk-AKJ3ZOR3.js} +1 -1
  435. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-G7EDXK4D.js → chunk-CQ3XTLTY.js} +1 -1
  436. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-SYF2TF6W.js → chunk-D7PHKNBM.js} +29 -92
  437. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-DOST5PQW.js +82 -0
  438. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-DVQEBGVL.js +2 -0
  439. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-ZSI3BL5Q.js → chunk-GDR5JFDJ.js} +1 -1
  440. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-HACVPRBJ.js +11 -0
  441. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-ITZNWD4K.js +2 -0
  442. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-LPXNMA2W.js +2 -0
  443. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-LD2P6SFZ.js → chunk-PMRZO46Y.js} +1 -1
  444. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-RDZVAGPR.js +2 -0
  445. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-ZSBPJAJ2.js → chunk-TJXZSVTD.js} +116 -99
  446. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-BYB6ZAAQ.js → chunk-TN4NLWHF.js} +1 -1
  447. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-WBQBCFWG.js +2 -0
  448. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-WJUNYZC5.js +2 -0
  449. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-XIX7LUWI.js +2 -0
  450. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-ZBURYEWF.js +2 -0
  451. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{cli-KILDDGW3.js → cli-SWM4FQ6V.js} +4 -4
  452. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/cloudflare-workers-ai-system-one-UTBL2KOF.js +2 -0
  453. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/codemode-worker.js +117 -14
  454. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/easter-egg-3d-OX6RUCIS.js +2 -0
  455. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/execute-3CFUPDLS.js +499 -0
  456. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/github-copilot.js +1 -1
  457. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{google-generative-ai-ZOK6CV7D.js → google-generative-ai-DXKP72HC.js} +1 -1
  458. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{google-vertex-VKWZQ3AY.js → google-vertex-W6SIDOVV.js} +1 -1
  459. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/image-resize-worker.js +1 -1
  460. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{llama-cpp-classify-XT44PI3C.js → llama-cpp-classify-FYN623RH.js} +2 -2
  461. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/mistral-conversations-GBMHTSYF.js +5 -0
  462. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/openai-chatgpt.js +1 -1
  463. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/openai-codex-responses-RN6B5UPP.js +10 -0
  464. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/openai-codex.js +1 -1
  465. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{openai-completions-GWHGMQ3T.js → openai-completions-QW2B4SML.js} +1 -1
  466. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/openai-decisions-WVPMQ4JD.js +5 -0
  467. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{openai-responses-EZ7FJ2KL.js → openai-responses-KDJUSIU7.js} +1 -1
  468. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{openrouter-images-ZVXWCSIM.js → openrouter-images-DUPG5DZO.js} +1 -1
  469. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{pi-messages-TM5SOOIW.js → pi-messages-YHKPQIHC.js} +1 -1
  470. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/runtime-366HE7CW.js +2 -0
  471. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/typesafe-system-one-ZSK3RN4B.js +2 -0
  472. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/virtual-modules-GI6FRNLG.js +2 -0
  473. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/cli-runtime.js +1 -1
  474. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/index.js +1 -1
  475. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/rpc-entry.js +1 -1
  476. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.d.ts +2 -1
  477. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.d.ts.map +1 -1
  478. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.js +24 -5
  479. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.js.map +1 -1
  480. package/node_modules/@earendil-works/pi-coding-agent/dist/config.d.ts +18 -1
  481. package/node_modules/@earendil-works/pi-coding-agent/dist/config.d.ts.map +1 -1
  482. package/node_modules/@earendil-works/pi-coding-agent/dist/config.js +44 -6
  483. package/node_modules/@earendil-works/pi-coding-agent/dist/config.js.map +1 -1
  484. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.d.ts +47 -5
  485. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
  486. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js +148 -78
  487. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js.map +1 -1
  488. package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.d.ts.map +1 -1
  489. package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.js +20 -13
  490. package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.js.map +1 -1
  491. package/node_modules/@earendil-works/pi-coding-agent/dist/core/bash-executor.d.ts.map +1 -1
  492. package/node_modules/@earendil-works/pi-coding-agent/dist/core/bash-executor.js +42 -52
  493. package/node_modules/@earendil-works/pi-coding-agent/dist/core/bash-executor.js.map +1 -1
  494. package/node_modules/@earendil-works/pi-coding-agent/dist/core/bug-report.d.ts +9 -1
  495. package/node_modules/@earendil-works/pi-coding-agent/dist/core/bug-report.d.ts.map +1 -1
  496. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/utils.d.ts +6 -0
  497. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/utils.d.ts.map +1 -1
  498. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/utils.js +7 -8
  499. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/utils.js.map +1 -1
  500. package/node_modules/@earendil-works/pi-coding-agent/dist/core/export-html/tool-renderer.d.ts.map +1 -1
  501. package/node_modules/@earendil-works/pi-coding-agent/dist/core/export-html/tool-renderer.js +2 -0
  502. package/node_modules/@earendil-works/pi-coding-agent/dist/core/export-html/tool-renderer.js.map +1 -1
  503. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/index.d.ts +1 -1
  504. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/index.d.ts.map +1 -1
  505. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/index.js.map +1 -1
  506. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.d.ts +4 -2
  507. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.d.ts.map +1 -1
  508. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.js +2 -3
  509. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.js.map +1 -1
  510. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/types.d.ts +44 -7
  511. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/types.d.ts.map +1 -1
  512. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/types.js.map +1 -1
  513. package/node_modules/@earendil-works/pi-coding-agent/dist/core/key-id-schema.d.ts +6 -0
  514. package/node_modules/@earendil-works/pi-coding-agent/dist/core/key-id-schema.d.ts.map +1 -0
  515. package/node_modules/@earendil-works/pi-coding-agent/dist/core/key-id-schema.js +16 -0
  516. package/node_modules/@earendil-works/pi-coding-agent/dist/core/key-id-schema.js.map +1 -0
  517. package/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings-schema.d.ts +4 -0
  518. package/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings-schema.d.ts.map +1 -0
  519. package/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings-schema.js +16 -0
  520. package/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings-schema.js.map +1 -0
  521. package/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings.d.ts +198 -66
  522. package/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings.d.ts.map +1 -1
  523. package/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings.js +26 -23
  524. package/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings.js.map +1 -1
  525. package/node_modules/@earendil-works/pi-coding-agent/dist/core/mcp-servers.d.ts +8 -0
  526. package/node_modules/@earendil-works/pi-coding-agent/dist/core/mcp-servers.d.ts.map +1 -1
  527. package/node_modules/@earendil-works/pi-coding-agent/dist/core/mcp-servers.js +30 -7
  528. package/node_modules/@earendil-works/pi-coding-agent/dist/core/mcp-servers.js.map +1 -1
  529. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-config.d.ts +695 -74
  530. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-config.d.ts.map +1 -1
  531. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-config.js +16 -166
  532. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-config.js.map +1 -1
  533. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.js +1 -1
  534. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.js.map +1 -1
  535. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-runtime.d.ts.map +1 -1
  536. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-runtime.js +13 -7
  537. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-runtime.js.map +1 -1
  538. package/node_modules/@earendil-works/pi-coding-agent/dist/core/nested-tool-calls.d.ts +1 -0
  539. package/node_modules/@earendil-works/pi-coding-agent/dist/core/nested-tool-calls.d.ts.map +1 -1
  540. package/node_modules/@earendil-works/pi-coding-agent/dist/core/nested-tool-calls.js +1 -0
  541. package/node_modules/@earendil-works/pi-coding-agent/dist/core/nested-tool-calls.js.map +1 -1
  542. package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.d.ts.map +1 -1
  543. package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.js +3 -3
  544. package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.js.map +1 -1
  545. package/node_modules/@earendil-works/pi-coding-agent/dist/core/project-trust.d.ts.map +1 -1
  546. package/node_modules/@earendil-works/pi-coding-agent/dist/core/project-trust.js +2 -1
  547. package/node_modules/@earendil-works/pi-coding-agent/dist/core/project-trust.js.map +1 -1
  548. package/node_modules/@earendil-works/pi-coding-agent/dist/core/remote-catalog-provider.d.ts +12 -1
  549. package/node_modules/@earendil-works/pi-coding-agent/dist/core/remote-catalog-provider.d.ts.map +1 -1
  550. package/node_modules/@earendil-works/pi-coding-agent/dist/core/remote-catalog-provider.js +82 -24
  551. package/node_modules/@earendil-works/pi-coding-agent/dist/core/remote-catalog-provider.js.map +1 -1
  552. package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.d.ts +3 -0
  553. package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.d.ts.map +1 -1
  554. package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.js +9 -4
  555. package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.js.map +1 -1
  556. package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.d.ts +13 -4
  557. package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.d.ts.map +1 -1
  558. package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.js +19 -6
  559. package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.js.map +1 -1
  560. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-defaults.d.ts +65 -0
  561. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-defaults.d.ts.map +1 -0
  562. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-defaults.js +66 -0
  563. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-defaults.js.map +1 -0
  564. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.d.ts +15 -145
  565. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -1
  566. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.js +85 -57
  567. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.js.map +1 -1
  568. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-schema.d.ts +228 -0
  569. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-schema.d.ts.map +1 -0
  570. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-schema.js +287 -0
  571. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-schema.js.map +1 -0
  572. package/node_modules/@earendil-works/pi-coding-agent/dist/core/skills.d.ts +4 -1
  573. package/node_modules/@earendil-works/pi-coding-agent/dist/core/skills.d.ts.map +1 -1
  574. package/node_modules/@earendil-works/pi-coding-agent/dist/core/skills.js +6 -1
  575. package/node_modules/@earendil-works/pi-coding-agent/dist/core/skills.js.map +1 -1
  576. package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.d.ts +6 -0
  577. package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.d.ts.map +1 -1
  578. package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.js +9 -4
  579. package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.js.map +1 -1
  580. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/output-accumulator.d.ts.map +1 -1
  581. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/output-accumulator.js +4 -10
  582. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/output-accumulator.js.map +1 -1
  583. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.d.ts +13 -0
  584. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.d.ts.map +1 -1
  585. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.js +18 -1
  586. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.js.map +1 -1
  587. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/render-utils.d.ts +18 -0
  588. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/render-utils.d.ts.map +1 -1
  589. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/render-utils.js +46 -0
  590. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/render-utils.js.map +1 -1
  591. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/renderers/bash.d.ts.map +1 -1
  592. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/renderers/bash.js +7 -35
  593. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/renderers/bash.js.map +1 -1
  594. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/renderers/edit.d.ts.map +1 -1
  595. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/renderers/edit.js +5 -4
  596. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/renderers/edit.js.map +1 -1
  597. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/execute.d.ts.map +1 -1
  598. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/execute.js +165 -48
  599. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/execute.js.map +1 -1
  600. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/index.d.ts.map +1 -1
  601. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/index.js +3 -1
  602. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/index.js.map +1 -1
  603. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/renderer.d.ts +2 -2
  604. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/renderer.d.ts.map +1 -1
  605. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/renderer.js +9 -3
  606. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/renderer.js.map +1 -1
  607. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/tool.d.ts +15 -14
  608. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/tool.d.ts.map +1 -1
  609. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/tool.js +58 -38
  610. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/tool.js.map +1 -1
  611. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/llama/provider.d.ts.map +1 -1
  612. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/llama/provider.js +34 -11
  613. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/llama/provider.js.map +1 -1
  614. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/cli.js +22 -31
  615. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/cli.js.map +1 -1
  616. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/index.d.ts.map +1 -1
  617. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/index.js +188 -84
  618. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/index.js.map +1 -1
  619. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/oauth.d.ts +5 -3
  620. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/oauth.d.ts.map +1 -1
  621. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/oauth.js +36 -10
  622. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/oauth.js.map +1 -1
  623. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/resources.d.ts +3 -10
  624. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/resources.d.ts.map +1 -1
  625. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/resources.js +4 -5
  626. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/resources.js.map +1 -1
  627. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/runtime.d.ts +7 -7
  628. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/runtime.d.ts.map +1 -1
  629. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/runtime.js +26 -44
  630. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/runtime.js.map +1 -1
  631. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/tools.d.ts +4 -4
  632. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/tools.d.ts.map +1 -1
  633. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/tools.js +68 -16
  634. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/tools.js.map +1 -1
  635. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/ui.d.ts +3 -3
  636. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/ui.d.ts.map +1 -1
  637. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/ui.js +10 -2
  638. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/ui.js.map +1 -1
  639. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/tool-search/tool.d.ts +0 -2
  640. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/tool-search/tool.d.ts.map +1 -1
  641. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/tool-search/tool.js +2 -4
  642. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/tool-search/tool.js.map +1 -1
  643. package/node_modules/@earendil-works/pi-coding-agent/dist/index.d.ts +1 -1
  644. package/node_modules/@earendil-works/pi-coding-agent/dist/index.d.ts.map +1 -1
  645. package/node_modules/@earendil-works/pi-coding-agent/dist/index.js.map +1 -1
  646. package/node_modules/@earendil-works/pi-coding-agent/dist/main.d.ts.map +1 -1
  647. package/node_modules/@earendil-works/pi-coding-agent/dist/main.js +4 -3
  648. package/node_modules/@earendil-works/pi-coding-agent/dist/main.js.map +1 -1
  649. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/bash-execution.d.ts +5 -1
  650. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
  651. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/bash-execution.js +17 -14
  652. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/bash-execution.js.map +1 -1
  653. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/branch-summary-message.d.ts +2 -1
  654. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
  655. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/branch-summary-message.js +5 -2
  656. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
  657. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.d.ts +2 -1
  658. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
  659. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.js +5 -2
  660. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
  661. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-entry.d.ts +3 -1
  662. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
  663. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-entry.js +8 -2
  664. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-entry.js.map +1 -1
  665. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
  666. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-message.js +1 -0
  667. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-message.js.map +1 -1
  668. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  669. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-selector.js +4 -3
  670. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-selector.js.map +1 -1
  671. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.d.ts +2 -1
  672. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
  673. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.js +5 -2
  674. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
  675. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/status-indicator.d.ts +1 -1
  676. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
  677. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/status-indicator.js +2 -2
  678. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/status-indicator.js.map +1 -1
  679. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts +5 -0
  680. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  681. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +10 -0
  682. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
  683. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +9 -0
  684. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  685. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js +103 -40
  686. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
  687. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/program-status-reporter.d.ts +34 -0
  688. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/program-status-reporter.d.ts.map +1 -0
  689. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/program-status-reporter.js +110 -0
  690. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/program-status-reporter.js.map +1 -0
  691. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/dark.json +1 -1
  692. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/light.json +1 -1
  693. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-schema.d.ts +28 -0
  694. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-schema.d.ts.map +1 -0
  695. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-schema.js +105 -0
  696. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-schema.js.map +1 -0
  697. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-tokens.d.ts +257 -0
  698. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-tokens.d.ts.map +1 -0
  699. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-tokens.js +94 -0
  700. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-tokens.js.map +1 -0
  701. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts +13 -16
  702. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  703. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme.js +22 -29
  704. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme.js.map +1 -1
  705. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/print-mode.d.ts.map +1 -1
  706. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/print-mode.js +4 -0
  707. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/print-mode.js.map +1 -1
  708. package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.d.ts.map +1 -1
  709. package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.js +24 -0
  710. package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.js.map +1 -1
  711. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/ansi.d.ts +8 -0
  712. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/ansi.d.ts.map +1 -1
  713. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/ansi.js +30 -11
  714. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/ansi.js.map +1 -1
  715. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/clipboard.d.ts.map +1 -1
  716. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/clipboard.js +18 -12
  717. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/clipboard.js.map +1 -1
  718. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-core.d.ts +12 -0
  719. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-core.d.ts.map +1 -1
  720. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-core.js +5 -0
  721. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-core.js.map +1 -1
  722. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-worker.js +3 -2
  723. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-worker.js.map +1 -1
  724. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize.d.ts.map +1 -1
  725. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize.js +9 -10
  726. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize.js.map +1 -1
  727. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/output-files.d.ts +15 -0
  728. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/output-files.d.ts.map +1 -0
  729. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/output-files.js +30 -0
  730. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/output-files.js.map +1 -0
  731. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/syntax-highlight.d.ts.map +1 -1
  732. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/syntax-highlight.js +6 -1
  733. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/syntax-highlight.js.map +1 -1
  734. package/node_modules/@earendil-works/pi-coding-agent/docs/cli-integration.md +1 -1
  735. package/node_modules/@earendil-works/pi-coding-agent/docs/cli.md +19 -7
  736. package/node_modules/@earendil-works/pi-coding-agent/docs/codemode.md +30 -9
  737. package/node_modules/@earendil-works/pi-coding-agent/docs/compaction.md +2 -2
  738. package/node_modules/@earendil-works/pi-coding-agent/docs/environment-variables.md +3 -1
  739. package/node_modules/@earendil-works/pi-coding-agent/docs/extensions.md +7 -4
  740. package/node_modules/@earendil-works/pi-coding-agent/docs/json.md +3 -3
  741. package/node_modules/@earendil-works/pi-coding-agent/docs/keybindings.md +5 -4
  742. package/node_modules/@earendil-works/pi-coding-agent/docs/llama-cpp.md +8 -1
  743. package/node_modules/@earendil-works/pi-coding-agent/docs/mcp.md +4 -2
  744. package/node_modules/@earendil-works/pi-coding-agent/docs/message-types.md +22 -4
  745. package/node_modules/@earendil-works/pi-coding-agent/docs/models.md +5 -1
  746. package/node_modules/@earendil-works/pi-coding-agent/docs/providers.md +47 -0
  747. package/node_modules/@earendil-works/pi-coding-agent/docs/settings.md +6 -4
  748. package/node_modules/@earendil-works/pi-coding-agent/docs/terminal-setup.md +14 -0
  749. package/node_modules/@earendil-works/pi-coding-agent/docs/themes.md +4 -2
  750. package/node_modules/@earendil-works/pi-coding-agent/docs/tui.md +1 -1
  751. package/node_modules/@earendil-works/pi-coding-agent/examples/README.md +0 -3
  752. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  753. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-anthropic/package.json +1 -1
  754. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  755. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/dynamic-resources/dynamic.json +1 -1
  756. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/gondolin/package-lock.json +2 -2
  757. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/gondolin/package.json +1 -1
  758. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/overlay-test.ts +2 -2
  759. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/plan-mode/index.ts +6 -2
  760. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/sandbox/package-lock.json +2 -2
  761. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/sandbox/package.json +1 -1
  762. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/with-deps/package-lock.json +2 -2
  763. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/with-deps/package.json +1 -1
  764. package/node_modules/@earendil-works/pi-coding-agent/package.json +10 -21
  765. package/node_modules/@earendil-works/pi-coding-agent/schemas/keybindings.schema.json +393 -0
  766. package/node_modules/@earendil-works/pi-coding-agent/schemas/models.schema.json +1157 -0
  767. package/node_modules/@earendil-works/pi-coding-agent/schemas/settings.schema.json +765 -0
  768. package/node_modules/@earendil-works/pi-coding-agent/schemas/theme.schema.json +365 -0
  769. package/node_modules/@earendil-works/pi-durable/CHANGELOG.md +114 -0
  770. package/node_modules/@earendil-works/pi-durable/README.md +164 -12
  771. package/node_modules/@earendil-works/pi-durable/dist/codemode/codemode.d.ts +173 -0
  772. package/node_modules/@earendil-works/pi-durable/dist/codemode/codemode.d.ts.map +1 -0
  773. package/node_modules/@earendil-works/pi-durable/dist/codemode/codemode.js +886 -0
  774. package/node_modules/@earendil-works/pi-durable/dist/codemode/codemode.js.map +1 -0
  775. package/node_modules/@earendil-works/pi-durable/dist/codemode/describe.d.ts +38 -0
  776. package/node_modules/@earendil-works/pi-durable/dist/codemode/describe.d.ts.map +1 -0
  777. package/node_modules/@earendil-works/pi-durable/dist/codemode/describe.js +119 -0
  778. package/node_modules/@earendil-works/pi-durable/dist/codemode/describe.js.map +1 -0
  779. package/node_modules/@earendil-works/pi-durable/dist/codemode/index.d.ts +3 -0
  780. package/node_modules/@earendil-works/pi-durable/dist/codemode/index.d.ts.map +1 -0
  781. package/node_modules/@earendil-works/pi-durable/dist/codemode/index.js +3 -0
  782. package/node_modules/@earendil-works/pi-durable/dist/codemode/index.js.map +1 -0
  783. package/node_modules/@earendil-works/pi-durable/dist/codemode/models.d.ts +28 -0
  784. package/node_modules/@earendil-works/pi-durable/dist/codemode/models.d.ts.map +1 -0
  785. package/node_modules/@earendil-works/pi-durable/dist/codemode/models.js +231 -0
  786. package/node_modules/@earendil-works/pi-durable/dist/codemode/models.js.map +1 -0
  787. package/node_modules/@earendil-works/pi-durable/dist/codemode/output.d.ts +41 -0
  788. package/node_modules/@earendil-works/pi-durable/dist/codemode/output.d.ts.map +1 -0
  789. package/node_modules/@earendil-works/pi-durable/dist/codemode/output.js +167 -0
  790. package/node_modules/@earendil-works/pi-durable/dist/codemode/output.js.map +1 -0
  791. package/node_modules/@earendil-works/pi-durable/dist/env/decode.d.ts +16 -0
  792. package/node_modules/@earendil-works/pi-durable/dist/env/decode.d.ts.map +1 -0
  793. package/node_modules/@earendil-works/pi-durable/dist/env/decode.js +28 -0
  794. package/node_modules/@earendil-works/pi-durable/dist/env/decode.js.map +1 -0
  795. package/node_modules/@earendil-works/pi-durable/dist/env/index.d.ts +197 -3
  796. package/node_modules/@earendil-works/pi-durable/dist/env/index.d.ts.map +1 -1
  797. package/node_modules/@earendil-works/pi-durable/dist/env/index.js +2 -0
  798. package/node_modules/@earendil-works/pi-durable/dist/env/index.js.map +1 -1
  799. package/node_modules/@earendil-works/pi-durable/dist/env/line-scan.d.ts +13 -0
  800. package/node_modules/@earendil-works/pi-durable/dist/env/line-scan.d.ts.map +1 -0
  801. package/node_modules/@earendil-works/pi-durable/dist/env/line-scan.js +147 -0
  802. package/node_modules/@earendil-works/pi-durable/dist/env/line-scan.js.map +1 -0
  803. package/node_modules/@earendil-works/pi-durable/dist/env/node-watch.d.ts +29 -0
  804. package/node_modules/@earendil-works/pi-durable/dist/env/node-watch.d.ts.map +1 -0
  805. package/node_modules/@earendil-works/pi-durable/dist/env/node-watch.js +485 -0
  806. package/node_modules/@earendil-works/pi-durable/dist/env/node-watch.js.map +1 -0
  807. package/node_modules/@earendil-works/pi-durable/dist/env/node.d.ts +11 -2
  808. package/node_modules/@earendil-works/pi-durable/dist/env/node.d.ts.map +1 -1
  809. package/node_modules/@earendil-works/pi-durable/dist/env/node.js +284 -21
  810. package/node_modules/@earendil-works/pi-durable/dist/env/node.js.map +1 -1
  811. package/node_modules/@earendil-works/pi-durable/dist/errors.d.ts +20 -3
  812. package/node_modules/@earendil-works/pi-durable/dist/errors.d.ts.map +1 -1
  813. package/node_modules/@earendil-works/pi-durable/dist/errors.js +34 -5
  814. package/node_modules/@earendil-works/pi-durable/dist/errors.js.map +1 -1
  815. package/node_modules/@earendil-works/pi-durable/dist/harness/agent.d.ts +7 -3
  816. package/node_modules/@earendil-works/pi-durable/dist/harness/agent.d.ts.map +1 -1
  817. package/node_modules/@earendil-works/pi-durable/dist/harness/agent.js +81 -25
  818. package/node_modules/@earendil-works/pi-durable/dist/harness/agent.js.map +1 -1
  819. package/node_modules/@earendil-works/pi-durable/dist/harness/compaction.d.ts +6 -1
  820. package/node_modules/@earendil-works/pi-durable/dist/harness/compaction.d.ts.map +1 -1
  821. package/node_modules/@earendil-works/pi-durable/dist/harness/compaction.js +11 -8
  822. package/node_modules/@earendil-works/pi-durable/dist/harness/compaction.js.map +1 -1
  823. package/node_modules/@earendil-works/pi-durable/dist/harness/context.d.ts +29 -1
  824. package/node_modules/@earendil-works/pi-durable/dist/harness/context.d.ts.map +1 -1
  825. package/node_modules/@earendil-works/pi-durable/dist/harness/context.js +125 -24
  826. package/node_modules/@earendil-works/pi-durable/dist/harness/context.js.map +1 -1
  827. package/node_modules/@earendil-works/pi-durable/dist/harness/events.d.ts +35 -15
  828. package/node_modules/@earendil-works/pi-durable/dist/harness/events.d.ts.map +1 -1
  829. package/node_modules/@earendil-works/pi-durable/dist/harness/events.js +77 -23
  830. package/node_modules/@earendil-works/pi-durable/dist/harness/events.js.map +1 -1
  831. package/node_modules/@earendil-works/pi-durable/dist/harness/generation.d.ts +2 -0
  832. package/node_modules/@earendil-works/pi-durable/dist/harness/generation.d.ts.map +1 -1
  833. package/node_modules/@earendil-works/pi-durable/dist/harness/generation.js +40 -16
  834. package/node_modules/@earendil-works/pi-durable/dist/harness/generation.js.map +1 -1
  835. package/node_modules/@earendil-works/pi-durable/dist/harness/harness.d.ts +7 -0
  836. package/node_modules/@earendil-works/pi-durable/dist/harness/harness.d.ts.map +1 -1
  837. package/node_modules/@earendil-works/pi-durable/dist/harness/harness.js +56 -28
  838. package/node_modules/@earendil-works/pi-durable/dist/harness/harness.js.map +1 -1
  839. package/node_modules/@earendil-works/pi-durable/dist/harness/inbox.d.ts +16 -4
  840. package/node_modules/@earendil-works/pi-durable/dist/harness/inbox.d.ts.map +1 -1
  841. package/node_modules/@earendil-works/pi-durable/dist/harness/inbox.js +26 -3
  842. package/node_modules/@earendil-works/pi-durable/dist/harness/inbox.js.map +1 -1
  843. package/node_modules/@earendil-works/pi-durable/dist/harness/live.d.ts +74 -17
  844. package/node_modules/@earendil-works/pi-durable/dist/harness/live.d.ts.map +1 -1
  845. package/node_modules/@earendil-works/pi-durable/dist/harness/live.js +66 -14
  846. package/node_modules/@earendil-works/pi-durable/dist/harness/live.js.map +1 -1
  847. package/node_modules/@earendil-works/pi-durable/dist/harness/output.d.ts +13 -6
  848. package/node_modules/@earendil-works/pi-durable/dist/harness/output.d.ts.map +1 -1
  849. package/node_modules/@earendil-works/pi-durable/dist/harness/output.js +75 -18
  850. package/node_modules/@earendil-works/pi-durable/dist/harness/output.js.map +1 -1
  851. package/node_modules/@earendil-works/pi-durable/dist/harness/scheduler.d.ts +18 -5
  852. package/node_modules/@earendil-works/pi-durable/dist/harness/scheduler.d.ts.map +1 -1
  853. package/node_modules/@earendil-works/pi-durable/dist/harness/scheduler.js +794 -168
  854. package/node_modules/@earendil-works/pi-durable/dist/harness/scheduler.js.map +1 -1
  855. package/node_modules/@earendil-works/pi-durable/dist/harness/submissions.d.ts +7 -4
  856. package/node_modules/@earendil-works/pi-durable/dist/harness/submissions.d.ts.map +1 -1
  857. package/node_modules/@earendil-works/pi-durable/dist/harness/submissions.js +32 -13
  858. package/node_modules/@earendil-works/pi-durable/dist/harness/submissions.js.map +1 -1
  859. package/node_modules/@earendil-works/pi-durable/dist/harness/task-graph.d.ts +1 -1
  860. package/node_modules/@earendil-works/pi-durable/dist/harness/task-graph.d.ts.map +1 -1
  861. package/node_modules/@earendil-works/pi-durable/dist/harness/task-graph.js +15 -10
  862. package/node_modules/@earendil-works/pi-durable/dist/harness/task-graph.js.map +1 -1
  863. package/node_modules/@earendil-works/pi-durable/dist/harness/tool.d.ts +45 -5
  864. package/node_modules/@earendil-works/pi-durable/dist/harness/tool.d.ts.map +1 -1
  865. package/node_modules/@earendil-works/pi-durable/dist/harness/tool.js +400 -67
  866. package/node_modules/@earendil-works/pi-durable/dist/harness/tool.js.map +1 -1
  867. package/node_modules/@earendil-works/pi-durable/dist/harness/types.d.ts +194 -17
  868. package/node_modules/@earendil-works/pi-durable/dist/harness/types.d.ts.map +1 -1
  869. package/node_modules/@earendil-works/pi-durable/dist/harness/types.js.map +1 -1
  870. package/node_modules/@earendil-works/pi-durable/dist/harness/util.d.ts +6 -1
  871. package/node_modules/@earendil-works/pi-durable/dist/harness/util.d.ts.map +1 -1
  872. package/node_modules/@earendil-works/pi-durable/dist/harness/util.js +5 -2
  873. package/node_modules/@earendil-works/pi-durable/dist/harness/util.js.map +1 -1
  874. package/node_modules/@earendil-works/pi-durable/dist/harness/view.d.ts +6 -2
  875. package/node_modules/@earendil-works/pi-durable/dist/harness/view.d.ts.map +1 -1
  876. package/node_modules/@earendil-works/pi-durable/dist/harness/view.js +22 -12
  877. package/node_modules/@earendil-works/pi-durable/dist/harness/view.js.map +1 -1
  878. package/node_modules/@earendil-works/pi-durable/dist/images/cloudflare.d.ts +4 -0
  879. package/node_modules/@earendil-works/pi-durable/dist/images/cloudflare.d.ts.map +1 -0
  880. package/node_modules/@earendil-works/pi-durable/dist/images/cloudflare.js +9 -0
  881. package/node_modules/@earendil-works/pi-durable/dist/images/cloudflare.js.map +1 -0
  882. package/node_modules/@earendil-works/pi-durable/dist/images/exif.d.ts +3 -0
  883. package/node_modules/@earendil-works/pi-durable/dist/images/exif.d.ts.map +1 -0
  884. package/node_modules/@earendil-works/pi-durable/dist/images/exif.js +71 -0
  885. package/node_modules/@earendil-works/pi-durable/dist/images/exif.js.map +1 -0
  886. package/node_modules/@earendil-works/pi-durable/dist/images/index.d.ts +18 -0
  887. package/node_modules/@earendil-works/pi-durable/dist/images/index.d.ts.map +1 -0
  888. package/node_modules/@earendil-works/pi-durable/dist/images/index.js +125 -0
  889. package/node_modules/@earendil-works/pi-durable/dist/images/index.js.map +1 -0
  890. package/node_modules/@earendil-works/pi-durable/dist/images/node-worker.d.ts +17 -0
  891. package/node_modules/@earendil-works/pi-durable/dist/images/node-worker.d.ts.map +1 -0
  892. package/node_modules/@earendil-works/pi-durable/dist/images/node-worker.js +16 -0
  893. package/node_modules/@earendil-works/pi-durable/dist/images/node-worker.js.map +1 -0
  894. package/node_modules/@earendil-works/pi-durable/dist/images/node.d.ts +21 -0
  895. package/node_modules/@earendil-works/pi-durable/dist/images/node.d.ts.map +1 -0
  896. package/node_modules/@earendil-works/pi-durable/dist/images/node.js +121 -0
  897. package/node_modules/@earendil-works/pi-durable/dist/images/node.js.map +1 -0
  898. package/node_modules/@earendil-works/pi-durable/dist/index.d.ts +7 -7
  899. package/node_modules/@earendil-works/pi-durable/dist/index.d.ts.map +1 -1
  900. package/node_modules/@earendil-works/pi-durable/dist/index.js +4 -4
  901. package/node_modules/@earendil-works/pi-durable/dist/index.js.map +1 -1
  902. package/node_modules/@earendil-works/pi-durable/dist/search.d.ts +13 -0
  903. package/node_modules/@earendil-works/pi-durable/dist/search.d.ts.map +1 -0
  904. package/node_modules/@earendil-works/pi-durable/dist/search.js +85 -0
  905. package/node_modules/@earendil-works/pi-durable/dist/search.js.map +1 -0
  906. package/node_modules/@earendil-works/pi-durable/dist/session/observation.d.ts +10 -3
  907. package/node_modules/@earendil-works/pi-durable/dist/session/observation.d.ts.map +1 -1
  908. package/node_modules/@earendil-works/pi-durable/dist/session/observation.js +24 -34
  909. package/node_modules/@earendil-works/pi-durable/dist/session/observation.js.map +1 -1
  910. package/node_modules/@earendil-works/pi-durable/dist/session/session.d.ts +71 -6
  911. package/node_modules/@earendil-works/pi-durable/dist/session/session.d.ts.map +1 -1
  912. package/node_modules/@earendil-works/pi-durable/dist/session/session.js +463 -50
  913. package/node_modules/@earendil-works/pi-durable/dist/session/session.js.map +1 -1
  914. package/node_modules/@earendil-works/pi-durable/dist/session/transaction.d.ts +2 -0
  915. package/node_modules/@earendil-works/pi-durable/dist/session/transaction.d.ts.map +1 -1
  916. package/node_modules/@earendil-works/pi-durable/dist/session/transaction.js +19 -1
  917. package/node_modules/@earendil-works/pi-durable/dist/session/transaction.js.map +1 -1
  918. package/node_modules/@earendil-works/pi-durable/dist/storage/jsonl/storage.d.ts +8 -0
  919. package/node_modules/@earendil-works/pi-durable/dist/storage/jsonl/storage.d.ts.map +1 -1
  920. package/node_modules/@earendil-works/pi-durable/dist/storage/jsonl/storage.js +2 -1
  921. package/node_modules/@earendil-works/pi-durable/dist/storage/jsonl/storage.js.map +1 -1
  922. package/node_modules/@earendil-works/pi-durable/dist/storage/memory.d.ts +2 -0
  923. package/node_modules/@earendil-works/pi-durable/dist/storage/memory.d.ts.map +1 -1
  924. package/node_modules/@earendil-works/pi-durable/dist/storage/memory.js +79 -27
  925. package/node_modules/@earendil-works/pi-durable/dist/storage/memory.js.map +1 -1
  926. package/node_modules/@earendil-works/pi-durable/dist/storage/scan.d.ts +18 -0
  927. package/node_modules/@earendil-works/pi-durable/dist/storage/scan.d.ts.map +1 -0
  928. package/node_modules/@earendil-works/pi-durable/dist/storage/scan.js +29 -0
  929. package/node_modules/@earendil-works/pi-durable/dist/storage/scan.js.map +1 -0
  930. package/node_modules/@earendil-works/pi-durable/dist/storage/sqlite/cloudflare.d.ts +46 -0
  931. package/node_modules/@earendil-works/pi-durable/dist/storage/sqlite/cloudflare.d.ts.map +1 -0
  932. package/node_modules/@earendil-works/pi-durable/dist/storage/sqlite/cloudflare.js +106 -0
  933. package/node_modules/@earendil-works/pi-durable/dist/storage/sqlite/cloudflare.js.map +1 -0
  934. package/node_modules/@earendil-works/pi-durable/dist/storage/sqlite/storage.d.ts +2 -0
  935. package/node_modules/@earendil-works/pi-durable/dist/storage/sqlite/storage.d.ts.map +1 -1
  936. package/node_modules/@earendil-works/pi-durable/dist/storage/sqlite/storage.js +77 -27
  937. package/node_modules/@earendil-works/pi-durable/dist/storage/sqlite/storage.js.map +1 -1
  938. package/node_modules/@earendil-works/pi-durable/dist/testing/env-conformance.d.ts +7 -0
  939. package/node_modules/@earendil-works/pi-durable/dist/testing/env-conformance.d.ts.map +1 -0
  940. package/node_modules/@earendil-works/pi-durable/dist/testing/env-conformance.js +531 -0
  941. package/node_modules/@earendil-works/pi-durable/dist/testing/env-conformance.js.map +1 -0
  942. package/node_modules/@earendil-works/pi-durable/dist/testing/index.d.ts +3 -2
  943. package/node_modules/@earendil-works/pi-durable/dist/testing/index.d.ts.map +1 -1
  944. package/node_modules/@earendil-works/pi-durable/dist/testing/index.js +2 -1
  945. package/node_modules/@earendil-works/pi-durable/dist/testing/index.js.map +1 -1
  946. package/node_modules/@earendil-works/pi-durable/dist/testing/runner.d.ts +4 -2
  947. package/node_modules/@earendil-works/pi-durable/dist/testing/runner.d.ts.map +1 -1
  948. package/node_modules/@earendil-works/pi-durable/dist/testing/runner.js +9 -0
  949. package/node_modules/@earendil-works/pi-durable/dist/testing/runner.js.map +1 -1
  950. package/node_modules/@earendil-works/pi-durable/dist/testing/storage-conformance.d.ts.map +1 -1
  951. package/node_modules/@earendil-works/pi-durable/dist/testing/storage-conformance.js +61 -2
  952. package/node_modules/@earendil-works/pi-durable/dist/testing/storage-conformance.js.map +1 -1
  953. package/node_modules/@earendil-works/pi-durable/dist/testing/types.d.ts +20 -0
  954. package/node_modules/@earendil-works/pi-durable/dist/testing/types.d.ts.map +1 -1
  955. package/node_modules/@earendil-works/pi-durable/dist/testing/types.js.map +1 -1
  956. package/node_modules/@earendil-works/pi-durable/dist/tool-search/index.d.ts +2 -0
  957. package/node_modules/@earendil-works/pi-durable/dist/tool-search/index.d.ts.map +1 -0
  958. package/node_modules/@earendil-works/pi-durable/dist/tool-search/index.js +2 -0
  959. package/node_modules/@earendil-works/pi-durable/dist/tool-search/index.js.map +1 -0
  960. package/node_modules/@earendil-works/pi-durable/dist/tool-search/tool-search.d.ts +23 -0
  961. package/node_modules/@earendil-works/pi-durable/dist/tool-search/tool-search.d.ts.map +1 -0
  962. package/node_modules/@earendil-works/pi-durable/dist/tool-search/tool-search.js +84 -0
  963. package/node_modules/@earendil-works/pi-durable/dist/tool-search/tool-search.js.map +1 -0
  964. package/node_modules/@earendil-works/pi-durable/dist/tools/bash.d.ts +30 -3
  965. package/node_modules/@earendil-works/pi-durable/dist/tools/bash.d.ts.map +1 -1
  966. package/node_modules/@earendil-works/pi-durable/dist/tools/bash.js +105 -37
  967. package/node_modules/@earendil-works/pi-durable/dist/tools/bash.js.map +1 -1
  968. package/node_modules/@earendil-works/pi-durable/dist/tools/edit.js +1 -1
  969. package/node_modules/@earendil-works/pi-durable/dist/tools/edit.js.map +1 -1
  970. package/node_modules/@earendil-works/pi-durable/dist/tools/image-processor.d.ts +47 -0
  971. package/node_modules/@earendil-works/pi-durable/dist/tools/image-processor.d.ts.map +1 -0
  972. package/node_modules/@earendil-works/pi-durable/dist/tools/image-processor.js +30 -0
  973. package/node_modules/@earendil-works/pi-durable/dist/tools/image-processor.js.map +1 -0
  974. package/node_modules/@earendil-works/pi-durable/dist/tools/image.d.ts +18 -0
  975. package/node_modules/@earendil-works/pi-durable/dist/tools/image.d.ts.map +1 -1
  976. package/node_modules/@earendil-works/pi-durable/dist/tools/image.js +86 -0
  977. package/node_modules/@earendil-works/pi-durable/dist/tools/image.js.map +1 -1
  978. package/node_modules/@earendil-works/pi-durable/dist/tools/index.d.ts +26 -3
  979. package/node_modules/@earendil-works/pi-durable/dist/tools/index.d.ts.map +1 -1
  980. package/node_modules/@earendil-works/pi-durable/dist/tools/index.js +14 -6
  981. package/node_modules/@earendil-works/pi-durable/dist/tools/index.js.map +1 -1
  982. package/node_modules/@earendil-works/pi-durable/dist/tools/read.d.ts +10 -2
  983. package/node_modules/@earendil-works/pi-durable/dist/tools/read.d.ts.map +1 -1
  984. package/node_modules/@earendil-works/pi-durable/dist/tools/read.js +212 -78
  985. package/node_modules/@earendil-works/pi-durable/dist/tools/read.js.map +1 -1
  986. package/node_modules/@earendil-works/pi-durable/dist/tools/write.js +1 -1
  987. package/node_modules/@earendil-works/pi-durable/dist/tools/write.js.map +1 -1
  988. package/node_modules/@earendil-works/pi-durable/dist/truncate.d.ts +9 -0
  989. package/node_modules/@earendil-works/pi-durable/dist/truncate.d.ts.map +1 -1
  990. package/node_modules/@earendil-works/pi-durable/dist/truncate.js +12 -4
  991. package/node_modules/@earendil-works/pi-durable/dist/truncate.js.map +1 -1
  992. package/node_modules/@earendil-works/pi-durable/dist/types.d.ts +89 -12
  993. package/node_modules/@earendil-works/pi-durable/dist/types.d.ts.map +1 -1
  994. package/node_modules/@earendil-works/pi-durable/dist/types.js.map +1 -1
  995. package/node_modules/@earendil-works/pi-durable/package.json +50 -5
  996. package/node_modules/@earendil-works/pi-mcp/CHANGELOG.md +29 -0
  997. package/node_modules/@earendil-works/pi-mcp/dist/auth-provider.d.ts +4 -0
  998. package/node_modules/@earendil-works/pi-mcp/dist/auth-provider.d.ts.map +1 -1
  999. package/node_modules/@earendil-works/pi-mcp/dist/auth-provider.js.map +1 -1
  1000. package/node_modules/@earendil-works/pi-mcp/dist/client.d.ts.map +1 -1
  1001. package/node_modules/@earendil-works/pi-mcp/dist/client.js +9 -5
  1002. package/node_modules/@earendil-works/pi-mcp/dist/client.js.map +1 -1
  1003. package/node_modules/@earendil-works/pi-mcp/dist/index.d.ts +1 -1
  1004. package/node_modules/@earendil-works/pi-mcp/dist/index.d.ts.map +1 -1
  1005. package/node_modules/@earendil-works/pi-mcp/dist/index.js.map +1 -1
  1006. package/node_modules/@earendil-works/pi-mcp/dist/oauth/discovery.d.ts +3 -0
  1007. package/node_modules/@earendil-works/pi-mcp/dist/oauth/discovery.d.ts.map +1 -1
  1008. package/node_modules/@earendil-works/pi-mcp/dist/oauth/discovery.js +8 -5
  1009. package/node_modules/@earendil-works/pi-mcp/dist/oauth/discovery.js.map +1 -1
  1010. package/node_modules/@earendil-works/pi-mcp/dist/oauth/errors.d.ts +3 -2
  1011. package/node_modules/@earendil-works/pi-mcp/dist/oauth/errors.d.ts.map +1 -1
  1012. package/node_modules/@earendil-works/pi-mcp/dist/oauth/errors.js +3 -1
  1013. package/node_modules/@earendil-works/pi-mcp/dist/oauth/errors.js.map +1 -1
  1014. package/node_modules/@earendil-works/pi-mcp/dist/oauth/flow.d.ts +4 -0
  1015. package/node_modules/@earendil-works/pi-mcp/dist/oauth/flow.d.ts.map +1 -1
  1016. package/node_modules/@earendil-works/pi-mcp/dist/oauth/flow.js +35 -7
  1017. package/node_modules/@earendil-works/pi-mcp/dist/oauth/flow.js.map +1 -1
  1018. package/node_modules/@earendil-works/pi-mcp/dist/oauth/types.d.ts +5 -0
  1019. package/node_modules/@earendil-works/pi-mcp/dist/oauth/types.d.ts.map +1 -1
  1020. package/node_modules/@earendil-works/pi-mcp/dist/oauth/types.js.map +1 -1
  1021. package/node_modules/@earendil-works/pi-mcp/dist/protocol/content.d.ts +2 -1
  1022. package/node_modules/@earendil-works/pi-mcp/dist/protocol/content.d.ts.map +1 -1
  1023. package/node_modules/@earendil-works/pi-mcp/dist/protocol/content.js.map +1 -1
  1024. package/node_modules/@earendil-works/pi-mcp/dist/transports/streamable-http.d.ts +9 -2
  1025. package/node_modules/@earendil-works/pi-mcp/dist/transports/streamable-http.d.ts.map +1 -1
  1026. package/node_modules/@earendil-works/pi-mcp/dist/transports/streamable-http.js +28 -19
  1027. package/node_modules/@earendil-works/pi-mcp/dist/transports/streamable-http.js.map +1 -1
  1028. package/node_modules/@earendil-works/pi-mcp/dist/transports/transport.d.ts +9 -1
  1029. package/node_modules/@earendil-works/pi-mcp/dist/transports/transport.d.ts.map +1 -1
  1030. package/node_modules/@earendil-works/pi-mcp/dist/transports/transport.js.map +1 -1
  1031. package/node_modules/@earendil-works/pi-mcp/package.json +2 -2
  1032. package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
  1033. package/node_modules/@earendil-works/pi-tui/README.md +5 -3
  1034. package/node_modules/@earendil-works/pi-tui/dist/components/box.d.ts +1 -0
  1035. package/node_modules/@earendil-works/pi-tui/dist/components/box.d.ts.map +1 -1
  1036. package/node_modules/@earendil-works/pi-tui/dist/components/box.js +4 -0
  1037. package/node_modules/@earendil-works/pi-tui/dist/components/box.js.map +1 -1
  1038. package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts.map +1 -1
  1039. package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +3 -3
  1040. package/node_modules/@earendil-works/pi-tui/dist/components/editor.js.map +1 -1
  1041. package/node_modules/@earendil-works/pi-tui/dist/components/input.d.ts.map +1 -1
  1042. package/node_modules/@earendil-works/pi-tui/dist/components/input.js +4 -4
  1043. package/node_modules/@earendil-works/pi-tui/dist/components/input.js.map +1 -1
  1044. package/node_modules/@earendil-works/pi-tui/dist/components/text.d.ts +1 -0
  1045. package/node_modules/@earendil-works/pi-tui/dist/components/text.d.ts.map +1 -1
  1046. package/node_modules/@earendil-works/pi-tui/dist/components/text.js +4 -0
  1047. package/node_modules/@earendil-works/pi-tui/dist/components/text.js.map +1 -1
  1048. package/node_modules/@earendil-works/pi-tui/dist/index.d.ts +2 -1
  1049. package/node_modules/@earendil-works/pi-tui/dist/index.d.ts.map +1 -1
  1050. package/node_modules/@earendil-works/pi-tui/dist/index.js +3 -1
  1051. package/node_modules/@earendil-works/pi-tui/dist/index.js.map +1 -1
  1052. package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts +4 -4
  1053. package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts.map +1 -1
  1054. package/node_modules/@earendil-works/pi-tui/dist/keybindings.js +4 -4
  1055. package/node_modules/@earendil-works/pi-tui/dist/keybindings.js.map +1 -1
  1056. package/node_modules/@earendil-works/pi-tui/dist/keys.d.ts.map +1 -1
  1057. package/node_modules/@earendil-works/pi-tui/dist/keys.js +52 -20
  1058. package/node_modules/@earendil-works/pi-tui/dist/keys.js.map +1 -1
  1059. package/node_modules/@earendil-works/pi-tui/dist/program-status.d.ts +23 -0
  1060. package/node_modules/@earendil-works/pi-tui/dist/program-status.d.ts.map +1 -0
  1061. package/node_modules/@earendil-works/pi-tui/dist/program-status.js +43 -0
  1062. package/node_modules/@earendil-works/pi-tui/dist/program-status.js.map +1 -0
  1063. package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.d.ts +4 -2
  1064. package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.d.ts.map +1 -1
  1065. package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.js +36 -1
  1066. package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.js.map +1 -1
  1067. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts.map +1 -1
  1068. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js +5 -0
  1069. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js.map +1 -1
  1070. package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts +17 -0
  1071. package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts.map +1 -1
  1072. package/node_modules/@earendil-works/pi-tui/dist/terminal.js +46 -2
  1073. package/node_modules/@earendil-works/pi-tui/dist/terminal.js.map +1 -1
  1074. package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.d.ts +2 -0
  1075. package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.d.ts.map +1 -1
  1076. package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.js +8 -4
  1077. package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.js.map +1 -1
  1078. package/node_modules/@earendil-works/pi-tui/dist/tui-main-screen.d.ts.map +1 -1
  1079. package/node_modules/@earendil-works/pi-tui/dist/tui-main-screen.js +2 -1
  1080. package/node_modules/@earendil-works/pi-tui/dist/tui-main-screen.js.map +1 -1
  1081. package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts +11 -0
  1082. package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts.map +1 -1
  1083. package/node_modules/@earendil-works/pi-tui/dist/tui.js +23 -1
  1084. package/node_modules/@earendil-works/pi-tui/dist/tui.js.map +1 -1
  1085. package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts.map +1 -1
  1086. package/node_modules/@earendil-works/pi-tui/dist/utils.js +5 -2
  1087. package/node_modules/@earendil-works/pi-tui/dist/utils.js.map +1 -1
  1088. package/node_modules/@earendil-works/pi-tui/package.json +1 -1
  1089. package/node_modules/@silvia-odwyer/photon/LICENSE.md +201 -0
  1090. package/node_modules/@silvia-odwyer/photon/README.md +158 -0
  1091. package/node_modules/@silvia-odwyer/photon/package.json +23 -0
  1092. package/node_modules/@silvia-odwyer/photon/photon_rs.d.ts +3443 -0
  1093. package/node_modules/@silvia-odwyer/photon/photon_rs.js +4572 -0
  1094. package/node_modules/@silvia-odwyer/photon/photon_rs_bg.wasm +0 -0
  1095. package/node_modules/@types/node/README.md +1 -1
  1096. package/node_modules/@types/node/crypto.d.ts +2 -2
  1097. package/node_modules/@types/node/dgram.d.ts +1 -1
  1098. package/node_modules/@types/node/package.json +2 -2
  1099. package/node_modules/@types/node/util.d.ts +6 -3
  1100. package/node_modules/@types/node/zlib.d.ts +6 -0
  1101. package/package.json +7 -8
  1102. package/runtime-package.json +7 -9
  1103. package/scripts/check-install-toolchain.mjs +64 -40
  1104. package/shipping-sbom.cdx.json +126 -160
  1105. package/shipping-source.json +15 -15
  1106. package/node_modules/@earendil-works/chord/dist/api.d.ts +0 -20
  1107. package/node_modules/@earendil-works/chord/dist/api.d.ts.map +0 -1
  1108. package/node_modules/@earendil-works/chord/dist/api.js +0 -77
  1109. package/node_modules/@earendil-works/chord/dist/api.js.map +0 -1
  1110. package/node_modules/@earendil-works/chord/dist/bundler.d.ts +0 -6
  1111. package/node_modules/@earendil-works/chord/dist/bundler.d.ts.map +0 -1
  1112. package/node_modules/@earendil-works/chord/dist/bundler.js +0 -3
  1113. package/node_modules/@earendil-works/chord/dist/bundler.js.map +0 -1
  1114. package/node_modules/@earendil-works/chord/dist/facets/host.d.ts +0 -12
  1115. package/node_modules/@earendil-works/chord/dist/facets/host.d.ts.map +0 -1
  1116. package/node_modules/@earendil-works/chord/dist/facets/host.js +0 -763
  1117. package/node_modules/@earendil-works/chord/dist/facets/host.js.map +0 -1
  1118. package/node_modules/@earendil-works/chord/dist/facets/loader.d.ts +0 -3
  1119. package/node_modules/@earendil-works/chord/dist/facets/loader.d.ts.map +0 -1
  1120. package/node_modules/@earendil-works/chord/dist/facets/loader.js +0 -5
  1121. package/node_modules/@earendil-works/chord/dist/facets/loader.js.map +0 -1
  1122. package/node_modules/@earendil-works/chord/dist/node/bundle-loader.d.ts +0 -30
  1123. package/node_modules/@earendil-works/chord/dist/node/bundle-loader.d.ts.map +0 -1
  1124. package/node_modules/@earendil-works/chord/dist/node/bundle-loader.js +0 -377
  1125. package/node_modules/@earendil-works/chord/dist/node/bundle-loader.js.map +0 -1
  1126. package/node_modules/@earendil-works/chord/dist/node/bundle.d.ts +0 -26
  1127. package/node_modules/@earendil-works/chord/dist/node/bundle.d.ts.map +0 -1
  1128. package/node_modules/@earendil-works/chord/dist/node/bundle.js +0 -183
  1129. package/node_modules/@earendil-works/chord/dist/node/bundle.js.map +0 -1
  1130. package/node_modules/@earendil-works/chord/dist/node/manifest.d.ts +0 -36
  1131. package/node_modules/@earendil-works/chord/dist/node/manifest.d.ts.map +0 -1
  1132. package/node_modules/@earendil-works/chord/dist/node/manifest.js +0 -6
  1133. package/node_modules/@earendil-works/chord/dist/node/manifest.js.map +0 -1
  1134. package/node_modules/@earendil-works/chord/dist/node/package.d.ts +0 -15
  1135. package/node_modules/@earendil-works/chord/dist/node/package.d.ts.map +0 -1
  1136. package/node_modules/@earendil-works/chord/dist/node/package.js +0 -199
  1137. package/node_modules/@earendil-works/chord/dist/node/package.js.map +0 -1
  1138. package/node_modules/@earendil-works/chord/dist/services/consumer.d.ts +0 -11
  1139. package/node_modules/@earendil-works/chord/dist/services/consumer.d.ts.map +0 -1
  1140. package/node_modules/@earendil-works/chord/dist/services/consumer.js +0 -585
  1141. package/node_modules/@earendil-works/chord/dist/services/consumer.js.map +0 -1
  1142. package/node_modules/@earendil-works/chord/dist/services/errors.d.ts +0 -8
  1143. package/node_modules/@earendil-works/chord/dist/services/errors.d.ts.map +0 -1
  1144. package/node_modules/@earendil-works/chord/dist/services/errors.js +0 -22
  1145. package/node_modules/@earendil-works/chord/dist/services/errors.js.map +0 -1
  1146. package/node_modules/@earendil-works/chord/dist/services/handle.d.ts +0 -15
  1147. package/node_modules/@earendil-works/chord/dist/services/handle.d.ts.map +0 -1
  1148. package/node_modules/@earendil-works/chord/dist/services/handle.js +0 -101
  1149. package/node_modules/@earendil-works/chord/dist/services/handle.js.map +0 -1
  1150. package/node_modules/@earendil-works/chord/dist/services/instances.d.ts +0 -26
  1151. package/node_modules/@earendil-works/chord/dist/services/instances.d.ts.map +0 -1
  1152. package/node_modules/@earendil-works/chord/dist/services/instances.js +0 -140
  1153. package/node_modules/@earendil-works/chord/dist/services/instances.js.map +0 -1
  1154. package/node_modules/@earendil-works/chord/dist/services/loopback.d.ts +0 -5
  1155. package/node_modules/@earendil-works/chord/dist/services/loopback.d.ts.map +0 -1
  1156. package/node_modules/@earendil-works/chord/dist/services/loopback.js +0 -15
  1157. package/node_modules/@earendil-works/chord/dist/services/loopback.js.map +0 -1
  1158. package/node_modules/@earendil-works/chord/dist/services/provider.d.ts +0 -37
  1159. package/node_modules/@earendil-works/chord/dist/services/provider.d.ts.map +0 -1
  1160. package/node_modules/@earendil-works/chord/dist/services/provider.js +0 -521
  1161. package/node_modules/@earendil-works/chord/dist/services/provider.js.map +0 -1
  1162. package/node_modules/@earendil-works/chord/dist/services/state-codec.d.ts +0 -15
  1163. package/node_modules/@earendil-works/chord/dist/services/state-codec.d.ts.map +0 -1
  1164. package/node_modules/@earendil-works/chord/dist/services/state-codec.js +0 -133
  1165. package/node_modules/@earendil-works/chord/dist/services/state-codec.js.map +0 -1
  1166. package/node_modules/@earendil-works/chord/dist/services/state-internals.d.ts +0 -13
  1167. package/node_modules/@earendil-works/chord/dist/services/state-internals.d.ts.map +0 -1
  1168. package/node_modules/@earendil-works/chord/dist/services/state-internals.js +0 -10
  1169. package/node_modules/@earendil-works/chord/dist/services/state-internals.js.map +0 -1
  1170. package/node_modules/@earendil-works/chord/dist/services/state.d.ts +0 -28
  1171. package/node_modules/@earendil-works/chord/dist/services/state.d.ts.map +0 -1
  1172. package/node_modules/@earendil-works/chord/dist/services/state.js.map +0 -1
  1173. package/node_modules/@earendil-works/chord/dist/services/wire.d.ts +0 -63
  1174. package/node_modules/@earendil-works/chord/dist/services/wire.d.ts.map +0 -1
  1175. package/node_modules/@earendil-works/chord/dist/services/wire.js +0 -186
  1176. package/node_modules/@earendil-works/chord/dist/services/wire.js.map +0 -1
  1177. package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.d.ts +0 -3
  1178. package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.d.ts.map +0 -1
  1179. package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js +0 -14
  1180. package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js.map +0 -1
  1181. package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.models.d.ts +0 -6
  1182. package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.models.d.ts.map +0 -1
  1183. package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.models.js +0 -8
  1184. package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.models.js.map +0 -1
  1185. package/node_modules/@earendil-works/pi-ai/dist/providers/data/azure-openai-responses.json +0 -1
  1186. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/anthropic-messages-MVG2FL56.js +0 -6
  1187. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/azure-openai-responses-7AMFUIWJ.js +0 -2
  1188. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-6FX7UEPL.js +0 -132
  1189. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-7JGR3GZN.js +0 -11
  1190. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-A3JYRWB6.js +0 -2
  1191. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-IKZJX7ZT.js +0 -2
  1192. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-OSKPX3Z5.js +0 -2
  1193. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-OYBSLV7Y.js +0 -16
  1194. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-PDFMCAOZ.js +0 -19
  1195. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-U7B62NSC.js +0 -2
  1196. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-VIV3CWXG.js +0 -2
  1197. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-WCQZGZ6I.js +0 -82
  1198. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/cloudflare-workers-ai-system-one-X5PVWWYJ.js +0 -2
  1199. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/easter-egg-3d-T5FFWIBR.js +0 -2
  1200. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/execute-RYVK27GT.js +0 -388
  1201. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/mistral-conversations-7DAUEE4N.js +0 -5
  1202. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/openai-codex-responses-TC3OK7B4.js +0 -10
  1203. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/runtime-D5I2NTIF.js +0 -2
  1204. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/typesafe-system-one-A4CZTQWZ.js +0 -2
  1205. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/virtual-modules-KVWJD3T3.js +0 -2
  1206. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-json.d.ts +0 -85
  1207. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-json.d.ts.map +0 -1
  1208. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-json.js +0 -132
  1209. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-json.js.map +0 -1
  1210. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-schema.json +0 -361
  1211. package/node_modules/@earendil-works/pi-coding-agent/examples/plugins/pi-example-plugin/README.md +0 -38
  1212. package/node_modules/@earendil-works/pi-coding-agent/examples/plugins/pi-example-plugin/package.json +0 -10
  1213. package/node_modules/@earendil-works/pi-coding-agent/examples/plugins/pi-example-plugin/src/contract.ts +0 -13
  1214. package/node_modules/@earendil-works/pi-coding-agent/examples/plugins/pi-example-plugin/src/session.ts +0 -24
  1215. package/node_modules/@earendil-works/pi-coding-agent/examples/plugins/pi-example-plugin/src/tui.ts +0 -31
  1216. package/node_modules/@esbuild/linux-x64/README.md +0 -3
  1217. package/node_modules/@esbuild/linux-x64/bin/esbuild +0 -0
  1218. package/node_modules/@esbuild/linux-x64/package.json +0 -20
  1219. package/node_modules/esbuild/LICENSE.md +0 -21
  1220. package/node_modules/esbuild/README.md +0 -3
  1221. package/node_modules/esbuild/bin/esbuild +0 -223
  1222. package/node_modules/esbuild/install.js +0 -300
  1223. package/node_modules/esbuild/lib/main.d.ts +0 -720
  1224. package/node_modules/esbuild/lib/main.js +0 -2536
  1225. package/node_modules/esbuild/package.json +0 -74
@@ -1 +0,0 @@
1
- {"version":3,"file":"host.js","sourceRoot":"","sources":["../../src/facets/host.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAA+B,MAAM,0BAA0B,CAAC;AAC1F,OAAO,EAAE,8BAA8B,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,mCAAmC,EAAE,MAAM,yBAAyB,CAAC;AACrG,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAoDlE,MAAM,cAAc;IACV,EAAE,CAAS;IACX,QAAQ,GAAe,EAAE,CAAC;IAC1B,aAAa,GAA0B,EAAE,CAAC;IAC1C,SAAS,GAAsC,EAAE,CAAC;IAC3D,MAAM,GAAmB,YAAY,CAAC;IACtC,cAAc,GAAG,KAAK,CAAC;IAEvB,YAAY,EAAU;QACrB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IACd,CAAC;IAED,eAAe,CAAC,SAAiB;QAChC,IAAI,IAAI,CAAC,MAAM,KAAK,YAAY,EAAE,CAAC;YAClC,MAAM,IAAI,KAAK,CAAC,SAAS,IAAI,CAAC,EAAE,QAAQ,SAAS,oBAAoB,CAAC,CAAC;QACxE,CAAC;IACF,CAAC;IAED,aAAa,CAAC,SAAiB;QAC9B,IAAI,IAAI,CAAC,MAAM,KAAK,YAAY,IAAI,IAAI,CAAC,MAAM,KAAK,QAAQ,EAAE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CONTEXT } from \"../context/index.ts\";\nimport { RemoteServiceBindingImpl } from \"../services/consumer.ts\";\nimport { ServiceSlot } from \"../services/handle.ts\";\nimport { InstanceDirectory, type InstanceDirectoryEntry } from \"../services/instances.ts\";\nimport { createLoopbackServiceTransport } from \"../services/loopback.ts\";\nimport { RemoteServiceProvider, validateRemoteServiceImplementation } from \"../services/provider.ts\";\nimport { MutableReplicatedStateImpl } from \"../services/state.ts\";\nimport type {\n\tContext,\n\tFacet,\n\tFacetEnvironment,\n\tFacetOptions,\n\tRemoteServiceContract,\n\tRemoteServiceSource,\n\tRemoteServices,\n\tService,\n\tServiceMode,\n\tServiceSpawner,\n} from \"../types.ts\";\n\ninterface FacetServiceReference {\n\treadonly serviceId: string;\n\treadonly service: Service<unknown>;\n\treadonly mode: ServiceMode;\n}\n\ninterface ExternalService {\n\treadonly service: Service<unknown>;\n\treadonly mode: ServiceMode;\n\treadonly source: RemoteServiceSource;\n}\n\ninterface FacetShape {\n\tfacetId: string;\n\trequires: readonly FacetServiceReference[];\n\tprovides: readonly FacetServiceReference[];\n}\n\ninterface FacetRuntime extends FacetShape {\n\trequires: FacetServiceReference[];\n\tprovides: FacetServiceReference[];\n\treadonly lifecycle: FacetLifecycle;\n\treadonly provisions: FacetProvision[];\n\treadonly singletonViews: Map<string, unknown>;\n}\n\ntype LifecycleState = \"setting_up\" | \"prepared\" | \"active\" | \"disposing\" | \"dead\";\ntype GenerationPhase =\n\t| \"setup\"\n\t| \"assembling\"\n\t| \"connecting\"\n\t| \"activating\"\n\t| \"active\"\n\t| \"reloading\"\n\t| \"disposing\"\n\t| \"dead\";\ntype Disposal = () => void | Promise<void>;\n\nclass FacetLifecycle {\n\treadonly id: string;\n\treadonly #effects: Disposal[] = [];\n\treadonly #observations: Array<() => Disposal> = [];\n\treadonly #activate: Array<() => void | Promise<void>> = [];\n\t#state: LifecycleState = \"setting_up\";\n\t#serviceAccess = false;\n\n\tconstructor(id: string) {\n\t\tthis.id = id;\n\t}\n\n\tassertSettingUp(operation: string): void {\n\t\tif (this.#state !== \"setting_up\") {\n\t\t\tthrow new Error(`Facet ${this.id} can ${operation} only during setup`);\n\t\t}\n\t}\n\n\tassertRunning(operation: string): void {\n\t\tif (this.#state !== \"setting_up\" && this.#state !== \"active\") {\n\t\t\tthrow new Error(`Facet ${this.id} cannot ${operation} while ${this.#state}`);\n\t\t}\n\t}\n\n\tassertActive(operation: string): void {\n\t\tif (this.#state !== \"active\") throw new Error(`Facet ${this.id} can ${operation} only while active`);\n\t}\n\n\tassertServiceAccess(): void {\n\t\tif (!this.#serviceAccess) {\n\t\t\tthrow new Error(`Facet ${this.id} service handles cannot be used while ${this.#state}`);\n\t\t}\n\t}\n\n\trevoke(): void {\n\t\tthis.#serviceAccess = false;\n\t}\n\n\town(disposal: Disposal): void {\n\t\tthis.assertRunning(\"own resources\");\n\t\tthis.#effects.push(disposal);\n\t}\n\n\tobserve(start: () => Disposal): void {\n\t\tthis.assertSettingUp(\"observe services\");\n\t\tthis.#observations.push(start);\n\t}\n\n\tonActivate(callback: () => void | Promise<void>): void {\n\t\tthis.assertSettingUp(\"register activation callbacks\");\n\t\tthis.#activate.push(callback);\n\t}\n\n\tprepared(): void {\n\t\tthis.assertSettingUp(\"finish setup\");\n\t\tthis.#state = \"prepared\";\n\t}\n\n\tasync activate(): Promise<void> {\n\t\tif (this.#state !== \"prepared\") throw new Error(`Facet ${this.id} is not prepared`);\n\t\tthis.#state = \"active\";\n\t\tthis.#serviceAccess = true;\n\t\tfor (const start of this.#observations) this.#effects.push(start());\n\t\tfor (const callback of this.#activate) await callback();\n\t}\n\n\tasync dispose(): Promise<void> {\n\t\tif (this.#state === \"dead\") return;\n\t\tthis.#state = \"disposing\";\n\t\tconst errors: unknown[] = [];\n\t\tfor (const effect of this.#effects.splice(0).reverse()) {\n\t\t\ttry {\n\t\t\t\tawait effect();\n\t\t\t} catch (error) {\n\t\t\t\terrors.push(error);\n\t\t\t}\n\t\t}\n\t\tthis.#observations.length = 0;\n\t\tthis.#activate.length = 0;\n\t\tthis.#serviceAccess = false;\n\t\tthis.#state = \"dead\";\n\t\tif (errors.length === 1) throw errors[0];\n\t\tif (errors.length > 1) throw new AggregateError(errors, `Failed to dispose facet ${this.id}`);\n\t}\n}\n\ninterface KeyedServiceSource {\n\tobserve<T>(service: Service<T>, handler: (service: T, context: Context) => void | Promise<void>): () => void;\n}\n\ninterface LocalKeyedRegistration {\n\treadonly generations: Map<string, number>;\n\treadonly directory: InstanceDirectory<InstanceDirectoryEntry>;\n}\n\nclass LocalKeyedServiceRegistry implements KeyedServiceSource {\n\treadonly #registrations = new Map<string, LocalKeyedRegistration>();\n\t#disposed = false;\n\n\tconstructor(services: readonly { readonly id: string }[], onError: (error: Error) => void) {\n\t\tconst ids = services.map(({ id }) => id);\n\t\tif (new Set(ids).size !== ids.length) throw new TypeError(\"Local keyed service registry has duplicate IDs\");\n\t\tfor (const serviceId of ids) {\n\t\t\tthis.#registrations.set(serviceId, {\n\t\t\t\tgenerations: new Map(),\n\t\t\t\tdirectory: new InstanceDirectory({ ready: true, onError }),\n\t\t\t});\n\t\t}\n\t}\n\n\tspawn<T>(service: Service<T>, key: string, implementation: T): () => void {\n\t\tthis.#assertActive();\n\t\tif (key.length === 0) throw new TypeError(\"Local service instance key must not be empty\");\n\t\tif (typeof implementation !== \"object\" || implementation === null || Array.isArray(implementation)) {\n\t\t\tthrow new TypeError(`Local service ${service.id} implementation must be an object`);\n\t\t}\n\t\tconst registration = this.#registration(service.id);\n\t\tif (registration.directory.get(key) !== undefined) {\n\t\t\tthrow new Error(`Local service ${service.id} already has a live instance with key ${key}`);\n\t\t}\n\t\tconst generation = (registration.generations.get(key) ?? 0) + 1;\n\t\tregistration.generations.set(key, generation);\n\t\tconst instance: InstanceDirectoryEntry = {\n\t\t\tkey,\n\t\t\tgeneration,\n\t\t\tservice: implementation as object,\n\t\t\tdeactivate() {},\n\t\t};\n\t\tregistration.directory.insert(instance);\n\t\tlet closed = false;\n\t\treturn () => {\n\t\t\tif (closed) return;\n\t\t\tclosed = true;\n\t\t\tregistration.directory.remove(instance);\n\t\t};\n\t}\n\n\tobserve<T>(service: Service<T>, handler: (service: T, context: Context) => void | Promise<void>): () => void {\n\t\tthis.#assertActive();\n\t\treturn this.#registration(service.id).directory.observe(handler);\n\t}\n\n\tdispose(): void {\n\t\tif (this.#disposed) return;\n\t\tthis.#disposed = true;\n\t\tfor (const registration of this.#registrations.values()) registration.directory.dispose();\n\t\tthis.#registrations.clear();\n\t}\n\n\t#registration(serviceId: string): LocalKeyedRegistration {\n\t\tconst registration = this.#registrations.get(serviceId);\n\t\tif (registration === undefined) throw new Error(`Local keyed service ${serviceId} is not registered`);\n\t\treturn registration;\n\t}\n\n\t#assertActive(): void {\n\t\tif (this.#disposed) throw new Error(\"Local keyed service registry is disposed\");\n\t}\n}\n\nclass HostServiceSlots {\n\treadonly #singletons = new Map<string, ServiceSlot>();\n\treadonly #keyedSources = new Map<string, KeyedServiceSource>();\n\n\tgetSingleton<T>(service: Service<T>, assertAccess: () => void): T {\n\t\tlet slot = this.#singletons.get(service.id);\n\t\tif (slot === undefined) {\n\t\t\tslot = new ServiceSlot(service.id, !service.local);\n\t\t\tthis.#singletons.set(service.id, slot);\n\t\t}\n\t\treturn slot.view<T>(assertAccess);\n\t}\n\n\thasSingleton(serviceId: string): boolean {\n\t\treturn this.#singletons.has(serviceId);\n\t}\n\n\tobserve<T>(\n\t\tservice: Service<T>,\n\t\tassertAccess: () => void,\n\t\thandler: (service: T, context: Context) => void | Promise<void>,\n\t): Disposal {\n\t\tconst source = this.#keyedSources.get(service.id);\n\t\tif (source === undefined) throw new Error(`Service ${service.id} is disconnected`);\n\t\tlet stopped = false;\n\t\tconst stop = source.observe(service, (target, context) => {\n\t\t\tconst slot = new ServiceSlot(service.id, !service.local);\n\t\t\tslot.bind(target as object);\n\t\t\treturn handler(\n\t\t\t\tslot.view<T>(() => {\n\t\t\t\t\tassertAccess();\n\t\t\t\t\tif (stopped || context.abortSignal?.aborted) {\n\t\t\t\t\t\tthrow new Error(`Keyed service ${service.id} observation is closed`);\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tcontext,\n\t\t\t);\n\t\t});\n\t\treturn () => {\n\t\t\tif (stopped) return;\n\t\t\tstopped = true;\n\t\t\tstop();\n\t\t};\n\t}\n\n\tbindSingleton(serviceId: string, target: object): void {\n\t\tthis.#singletons.get(serviceId)?.bind(target);\n\t}\n\n\tbindKeyed(serviceId: string, services: KeyedServiceSource): void {\n\t\tthis.#keyedSources.set(serviceId, services);\n\t}\n\n\tdispose(): void {\n\t\tfor (const slot of this.#singletons.values()) slot.unbind();\n\t\tthis.#singletons.clear();\n\t\tthis.#keyedSources.clear();\n\t}\n}\n\ntype ServiceInstanceInstaller<T> = (key: string, implementation: T) => () => void;\n\ninterface StagedServiceInstance<T> {\n\treadonly key: string;\n\treadonly implementation: T;\n\trelease?: () => void;\n}\n\nclass StagedServiceSpawner<T> implements ServiceSpawner<T> {\n\treadonly #lifecycle: FacetLifecycle;\n\treadonly #validate: (key: string, implementation: T) => void;\n\treadonly #instances = new Map<string, StagedServiceInstance<T>>();\n\t#installer: ServiceInstanceInstaller<T> | undefined;\n\n\tconstructor(lifecycle: FacetLifecycle, validate: (key: string, implementation: T) => void) {\n\t\tthis.#lifecycle = lifecycle;\n\t\tthis.#validate = validate;\n\t}\n\n\tconnect(installer: ServiceInstanceInstaller<T>): void {\n\t\tif (this.#installer !== undefined) throw new Error(\"Facet service provider is already connected\");\n\t\tthis.#installer = installer;\n\t\tfor (const instance of this.#instances.values()) {\n\t\t\tinstance.release = installer(instance.key, instance.implementation);\n\t\t}\n\t}\n\n\tspawn(key: string, implementation: T): () => void {\n\t\tthis.#lifecycle.assertActive(\"spawn service instances\");\n\t\tthis.#validate(key, implementation);\n\t\tif (this.#instances.has(key)) throw new Error(`Facet service already has a live instance with key ${key}`);\n\t\tconst instance: StagedServiceInstance<T> = { key, implementation };\n\t\tthis.#instances.set(key, instance);\n\t\tif (this.#installer !== undefined) instance.release = this.#installer(key, implementation);\n\t\tconst close = (): void => {\n\t\t\tif (this.#instances.get(key) !== instance) return;\n\t\t\tthis.#instances.delete(key);\n\t\t\tinstance.release?.();\n\t\t};\n\t\tthis.#lifecycle.own(close);\n\t\treturn close;\n\t}\n}\n\ntype FacetProvision =\n\t| {\n\t\t\treadonly kind: \"singleton\";\n\t\t\treadonly service: { readonly id: string; readonly local: boolean };\n\t\t\treadonly implementation: object;\n\t\t\tinstall(provider: RemoteServiceProvider): void;\n\t\t\tvalidateReplacement(provider: RemoteServiceProvider): void;\n\t\t\treplace(provider: RemoteServiceProvider): void;\n\t }\n\t| {\n\t\t\treadonly kind: \"keyed\";\n\t\t\treadonly service: { readonly id: string; readonly local: boolean };\n\t\t\tconnectLocal(registry: LocalKeyedServiceRegistry): void;\n\t\t\tconnectRemote(provider: RemoteServiceProvider): void;\n\t };\n\n/** Private lifecycle and dependency kernel behind the atomic host entry point. */\nexport class FacetKernel {\n\treadonly #initialFacets: readonly Facet[];\n\treadonly #serviceSources: readonly RemoteServiceSource[];\n\treadonly #onError: (error: Error) => void;\n\treadonly #facets = new Map<string, FacetRuntime>();\n\treadonly #serviceSlots: HostServiceSlots;\n\treadonly #sourceBindings = new Map<RemoteServiceSource, RemoteServices>();\n\t#activationOrder: readonly string[] = [];\n\t#provider: RemoteServiceProvider | undefined;\n\t#internalServices: RemoteServices | undefined;\n\t#localKeyedServices: LocalKeyedServiceRegistry | undefined;\n\t#phase: GenerationPhase = \"setup\";\n\n\tconstructor(options: FacetOptions) {\n\t\tconst ids = options.facets.map((facet) => facet.id);\n\t\tif (ids.some((id) => id.length === 0)) throw new Error(\"Facet ID must not be empty\");\n\t\tif (new Set(ids).size !== ids.length) throw new Error(\"Facet IDs must be unique within a generation\");\n\t\tthis.#initialFacets = options.facets;\n\t\tthis.#serviceSources = options.serviceSources ?? [];\n\t\tthis.#onError = options.onError ?? (() => {});\n\t\tthis.#serviceSlots = new HostServiceSlots();\n\t}\n\n\tget provider(): RemoteServiceProvider {\n\t\tif (this.#provider === undefined) throw new Error(\"Facet service provider is not assembled\");\n\t\treturn this.#provider;\n\t}\n\n\t#createFacetRuntime(facetId: string): FacetRuntime {\n\t\treturn {\n\t\t\tfacetId,\n\t\t\trequires: [],\n\t\t\tprovides: [],\n\t\t\tlifecycle: new FacetLifecycle(facetId),\n\t\t\tprovisions: [],\n\t\t\tsingletonViews: new Map(),\n\t\t};\n\t}\n\n\t#setupFacet(facet: Facet, record: FacetRuntime): void {\n\t\tconst result: unknown = facet.setup(this.#environment(record));\n\t\tif (isPromiseLike(result)) {\n\t\t\tvoid Promise.resolve(result).catch(() => {});\n\t\t\tthrow new Error(`Facet ${facet.id} setup must be synchronous`);\n\t\t}\n\t\trecord.lifecycle.prepared();\n\t}\n\n\tasync activate(): Promise<void> {\n\t\tconst records: FacetRuntime[] = [];\n\t\ttry {\n\t\t\tfor (const facet of this.#initialFacets) {\n\t\t\t\tconst record = this.#createFacetRuntime(facet.id);\n\t\t\t\tthis.#facets.set(facet.id, record);\n\t\t\t\tthis.#setupFacet(facet, record);\n\t\t\t\trecords.push(record);\n\t\t\t}\n\n\t\t\tthis.#phase = \"assembling\";\n\t\t\tconst externalServices = await this.#resolveExternalServices(records);\n\t\t\tthis.#activationOrder = validateFacets(records, externalServices);\n\t\t\tthis.#assembleProviders();\n\t\t\tthis.#bindServices(externalServices);\n\n\t\t\tthis.#phase = \"connecting\";\n\t\t\tawait Promise.all(\n\t\t\t\t[...this.#sourceBindings.values(), this.#internalServiceBinding].map((services) =>\n\t\t\t\t\tservices.ready(BACKGROUND_CONTEXT),\n\t\t\t\t),\n\t\t\t);\n\n\t\t\tthis.#phase = \"activating\";\n\t\t\tfor (const id of this.#activationOrder) await this.#facets.get(id)!.lifecycle.activate();\n\t\t\tthis.#phase = \"active\";\n\t\t} catch (error) {\n\t\t\tconst cleanupErrors = await this.#terminate();\n\t\t\tif (cleanupErrors.length > 0) {\n\t\t\t\tthrow new AggregateError([error, ...cleanupErrors], \"Facet generation startup and cleanup failed\");\n\t\t\t}\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\tasync reload(facets: readonly Facet[]): Promise<void> {\n\t\tif (this.#phase !== \"active\") throw new Error(`Facet host cannot reload while ${this.#phase}`);\n\t\tconst ids = facets.map(({ id }) => id);\n\t\tif (ids.some((id) => id.length === 0)) throw new Error(\"Facet ID must not be empty\");\n\t\tif (new Set(ids).size !== ids.length) throw new Error(\"Reloaded facet IDs must be unique\");\n\t\tfor (const id of ids) {\n\t\t\tif (!this.#facets.has(id)) throw new Error(`Facet ${id} is not active`);\n\t\t}\n\t\tthis.#phase = \"reloading\";\n\n\t\tconst staged: FacetRuntime[] = [];\n\t\tconst candidates: FacetRuntime[] = [];\n\t\ttry {\n\t\t\tfor (const facet of facets) {\n\t\t\t\tconst record = this.#createFacetRuntime(facet.id);\n\t\t\t\tstaged.push(record);\n\t\t\t\tthis.#setupFacet(facet, record);\n\t\t\t\tconst previous = this.#facets.get(facet.id)!;\n\t\t\t\tif (!sameFacetShape(previous, record)) {\n\t\t\t\t\tthrow new Error(`Reloaded facet ${facet.id} must preserve its service requirements and provisions`);\n\t\t\t\t}\n\t\t\t\tthis.#validateReplacementProvisions(record.provisions);\n\t\t\t\tcandidates.push(record);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tconst cleanupErrors = await disposeFacetRecords(staged.reverse());\n\t\t\tif (cleanupErrors.length > 0) {\n\t\t\t\tconst abortErrors = await this.#abort();\n\t\t\t\tthrow new AggregateError(\n\t\t\t\t\t[error, ...cleanupErrors, ...abortErrors],\n\t\t\t\t\t\"Facet reload setup and cleanup failed\",\n\t\t\t\t);\n\t\t\t}\n\t\t\tthis.#phase = \"active\";\n\t\t\tthrow error;\n\t\t}\n\n\t\tconst replacements = new Map(candidates.map((record) => [record.facetId, record]));\n\t\tconst candidateOrder = this.#activationOrder.flatMap((id) => {\n\t\t\tconst candidate = replacements.get(id);\n\t\t\treturn candidate === undefined ? [] : [candidate];\n\t\t});\n\t\ttry {\n\t\t\tfor (const candidate of candidateOrder) await candidate.lifecycle.activate();\n\t\t\tfor (const candidate of candidateOrder) this.#validateReplacementProvisions(candidate.provisions);\n\t\t} catch (error) {\n\t\t\tconst cleanupErrors = await disposeFacetRecords([...candidateOrder].reverse());\n\t\t\tif (cleanupErrors.length > 0) {\n\t\t\t\tconst abortErrors = await this.#abort();\n\t\t\t\tthrow new AggregateError(\n\t\t\t\t\t[error, ...cleanupErrors, ...abortErrors],\n\t\t\t\t\t\"Facet reload activation and cleanup failed\",\n\t\t\t\t);\n\t\t\t}\n\t\t\tthis.#phase = \"active\";\n\t\t\tthrow error;\n\t\t}\n\n\t\tconst previous = candidateOrder.map(({ facetId }) => this.#facets.get(facetId)!);\n\t\tfor (const candidate of candidateOrder) this.#facets.set(candidate.facetId, candidate);\n\t\ttry {\n\t\t\tfor (const candidate of candidateOrder) {\n\t\t\t\tfor (const provision of candidate.provisions) {\n\t\t\t\t\tif (provision.kind !== \"singleton\") continue;\n\t\t\t\t\tif (provision.service.local) {\n\t\t\t\t\t\tthis.#serviceSlots.bindSingleton(provision.service.id, provision.implementation);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tprovision.replace(this.provider);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst retirementErrors = await disposeFacetRecords(previous.reverse());\n\t\t\tif (retirementErrors.length === 1) throw retirementErrors[0];\n\t\t\tif (retirementErrors.length > 1) {\n\t\t\t\tthrow new AggregateError(retirementErrors, \"Failed to retire replaced facets\");\n\t\t\t}\n\t\t\tfor (const candidate of candidateOrder) {\n\t\t\t\tfor (const provision of candidate.provisions) {\n\t\t\t\t\tif (provision.kind !== \"keyed\") continue;\n\t\t\t\t\tif (provision.service.local) provision.connectLocal(this.#localKeyedRegistry);\n\t\t\t\t\telse provision.connectRemote(this.provider);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tconst abortErrors = await this.#abort(previous);\n\t\t\tthrow new AggregateError([error, ...abortErrors], \"Facet reload failed after cutover\");\n\t\t}\n\t\tthis.#phase = \"active\";\n\t}\n\n\tasync dispose(): Promise<void> {\n\t\tif (this.#phase === \"dead\") return;\n\t\tif (this.#phase !== \"active\") throw new Error(`Facet host cannot be disposed while ${this.#phase}`);\n\t\tconst errors = await this.#terminate();\n\t\tif (errors.length === 1) throw errors[0];\n\t\tif (errors.length > 1) throw new AggregateError(errors, \"Failed to dispose facet generation\");\n\t}\n\n\t#validateReplacementProvisions(provisions: readonly FacetProvision[]): void {\n\t\tfor (const provision of provisions) {\n\t\t\tif (provision.kind !== \"singleton\" || provision.service.local) continue;\n\t\t\tprovision.validateReplacement(this.provider);\n\t\t}\n\t}\n\n\t#environment(runtime: FacetRuntime): FacetEnvironment {\n\t\tconst { lifecycle, provisions } = runtime;\n\t\treturn {\n\t\t\tprovide: <T>(service: Service<T>, implementation: NoInfer<T>): void => {\n\t\t\t\tlifecycle.assertSettingUp(\"provide services\");\n\t\t\t\tif (typeof implementation !== \"object\" || implementation === null || Array.isArray(implementation)) {\n\t\t\t\t\tthrow new TypeError(`Service ${service.id} implementation must be an object`);\n\t\t\t\t}\n\t\t\t\trecordServiceReference(runtime.provides, service, \"singleton\");\n\t\t\t\tprovisions.push({\n\t\t\t\t\tkind: \"singleton\",\n\t\t\t\t\tservice,\n\t\t\t\t\timplementation,\n\t\t\t\t\tinstall: (provider) => provider.provide(service, implementation as NoInfer<RemoteServiceContract<T>>),\n\t\t\t\t\tvalidateReplacement: (provider) =>\n\t\t\t\t\t\tprovider.validateReplacement(service, implementation as NoInfer<RemoteServiceContract<T>>),\n\t\t\t\t\treplace: (provider) => provider.replace(service, implementation as NoInfer<RemoteServiceContract<T>>),\n\t\t\t\t});\n\t\t\t},\n\t\t\tprovideMany: <T>(service: Service<T>): ServiceSpawner<T> => {\n\t\t\t\tlifecycle.assertSettingUp(\"provide service instances\");\n\t\t\t\trecordServiceReference(runtime.provides, service, \"keyed\");\n\t\t\t\tconst instances = new StagedServiceSpawner<T>(lifecycle, (key, implementation) => {\n\t\t\t\t\tif (key.length === 0) throw new TypeError(\"Facet service instance key must not be empty\");\n\t\t\t\t\tif (typeof implementation !== \"object\" || implementation === null || Array.isArray(implementation)) {\n\t\t\t\t\t\tthrow new TypeError(`Facet service ${service.id} implementation must be an object`);\n\t\t\t\t\t}\n\t\t\t\t\tif (!service.local) validateRemoteServiceImplementation(service.id, implementation);\n\t\t\t\t});\n\t\t\t\tprovisions.push({\n\t\t\t\t\tkind: \"keyed\",\n\t\t\t\t\tservice,\n\t\t\t\t\tconnectLocal: (registry) =>\n\t\t\t\t\t\tinstances.connect((key, implementation) => registry.spawn(service, key, implementation)),\n\t\t\t\t\tconnectRemote: (provider) =>\n\t\t\t\t\t\tinstances.connect((key, implementation) =>\n\t\t\t\t\t\t\tprovider.spawn(service, key, implementation as NoInfer<RemoteServiceContract<T>>),\n\t\t\t\t\t\t),\n\t\t\t\t});\n\t\t\t\treturn instances;\n\t\t\t},\n\t\t\tuse: <T>(service: Service<T>): T => {\n\t\t\t\tlifecycle.assertSettingUp(\"acquire services\");\n\t\t\t\trecordServiceReference(runtime.requires, service, \"singleton\");\n\t\t\t\tlet view = runtime.singletonViews.get(service.id);\n\t\t\t\tif (view === undefined) {\n\t\t\t\t\tview = this.#serviceSlots.getSingleton<T>(service, () => lifecycle.assertServiceAccess());\n\t\t\t\t\truntime.singletonViews.set(service.id, view);\n\t\t\t\t}\n\t\t\t\treturn view as T;\n\t\t\t},\n\t\t\tobserve: <T>(service: Service<T>, handler: (service: T, context: Context) => void | Promise<void>): void => {\n\t\t\t\tlifecycle.assertSettingUp(\"observe services\");\n\t\t\t\trecordServiceReference(runtime.requires, service, \"keyed\");\n\t\t\t\tlifecycle.observe(() =>\n\t\t\t\t\tthis.#serviceSlots.observe(service, () => lifecycle.assertServiceAccess(), handler),\n\t\t\t\t);\n\t\t\t},\n\t\t\treplicatedState: <T extends object>(initial: T) => {\n\t\t\t\tlifecycle.assertRunning(\"create replicated state\");\n\t\t\t\treturn new MutableReplicatedStateImpl(initial);\n\t\t\t},\n\t\t\town: (disposal) => lifecycle.own(disposal),\n\t\t\tonActivate: (callback) => lifecycle.onActivate(callback),\n\t\t\tonDeactivate: (callback) => lifecycle.own(callback),\n\t\t};\n\t}\n\n\tasync #resolveExternalServices(records: readonly FacetShape[]): Promise<ReadonlyMap<string, ExternalService>> {\n\t\tconst catalogues = await Promise.all(\n\t\t\tthis.#serviceSources.map(async (source) => ({\n\t\t\t\tsource,\n\t\t\t\tentries: await source.catalogue(BACKGROUND_CONTEXT),\n\t\t\t})),\n\t\t);\n\t\tconst offered = new Map<string, { readonly mode: ServiceMode; readonly source: RemoteServiceSource }>();\n\t\tfor (const { source, entries } of catalogues) {\n\t\t\tfor (const { serviceId, mode } of entries) {\n\t\t\t\tif (offered.has(serviceId)) {\n\t\t\t\t\tthrow new Error(`Facet host service ${serviceId} is offered by more than one source`);\n\t\t\t\t}\n\t\t\t\toffered.set(serviceId, { mode, source });\n\t\t\t}\n\t\t}\n\n\t\tconst local = new Set(records.flatMap(({ provides }) => provides.map(({ serviceId }) => serviceId)));\n\t\tconst external = new Map<string, ExternalService>();\n\t\tfor (const { requires } of records) {\n\t\t\tfor (const requirement of requires) {\n\t\t\t\tif (local.has(requirement.serviceId) || external.has(requirement.serviceId)) continue;\n\t\t\t\tlet source = offered.get(requirement.serviceId);\n\t\t\t\tif (source === undefined) {\n\t\t\t\t\tconst deferred = this.#serviceSources.filter(\n\t\t\t\t\t\t({ acceptsUnavailableServices }) => acceptsUnavailableServices,\n\t\t\t\t\t);\n\t\t\t\t\tif (deferred.length > 1) {\n\t\t\t\t\t\tthrow new Error(`Facet host service ${requirement.serviceId} has more than one deferred source`);\n\t\t\t\t\t}\n\t\t\t\t\tif (deferred.length === 1) source = { mode: requirement.mode, source: deferred[0]! };\n\t\t\t\t}\n\t\t\t\tif (source !== undefined) {\n\t\t\t\t\texternal.set(requirement.serviceId, { ...source, service: requirement.service });\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tconst serviceIdsBySource = new Map<RemoteServiceSource, string[]>();\n\t\tfor (const [serviceId, { source }] of external) {\n\t\t\tlet serviceIds = serviceIdsBySource.get(source);\n\t\t\tif (serviceIds === undefined) {\n\t\t\t\tserviceIds = [];\n\t\t\t\tserviceIdsBySource.set(source, serviceIds);\n\t\t\t}\n\t\t\tserviceIds.push(serviceId);\n\t\t}\n\t\tfor (const [source, serviceIds] of serviceIdsBySource) {\n\t\t\tthis.#sourceBindings.set(\n\t\t\t\tsource,\n\t\t\t\tsource.open({\n\t\t\t\t\tservices: serviceIds.map((id) => ({ id })),\n\t\t\t\t\tassertAccess: () => this.#assertServiceTargetAccess(),\n\t\t\t\t\tonError: this.#onError,\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\t\treturn external;\n\t}\n\n\t#assembleProviders(): void {\n\t\tconst provisions = this.#provisions();\n\t\tconst remoteProvisions = provisions.filter(({ service }) => !service.local);\n\t\tconst provider = new RemoteServiceProvider(\n\t\t\tremoteProvisions.map(({ service, kind }) => ({ service, mode: kind })),\n\t\t);\n\t\tconst internalServices = new RemoteServiceBindingImpl({\n\t\t\tservices: remoteProvisions.map(({ service }) => service),\n\t\t\ttransport: createLoopbackServiceTransport(provider),\n\t\t\tassertAccess: () => this.#assertServiceTargetAccess(),\n\t\t\tonError: this.#onError,\n\t\t});\n\t\tconst localKeyedServices = new LocalKeyedServiceRegistry(\n\t\t\tprovisions.flatMap((provision) =>\n\t\t\t\tprovision.kind === \"keyed\" && provision.service.local ? [provision.service] : [],\n\t\t\t),\n\t\t\tthis.#onError,\n\t\t);\n\t\tthis.#provider = provider;\n\t\tthis.#internalServices = internalServices;\n\t\tthis.#localKeyedServices = localKeyedServices;\n\t\tfor (const provision of provisions) {\n\t\t\tif (provision.kind === \"singleton\") {\n\t\t\t\tif (!provision.service.local) provision.install(provider);\n\t\t\t} else if (provision.service.local) {\n\t\t\t\tprovision.connectLocal(localKeyedServices);\n\t\t\t} else {\n\t\t\t\tprovision.connectRemote(provider);\n\t\t\t}\n\t\t}\n\t}\n\n\t#bindServices(externalServices: ReadonlyMap<string, ExternalService>): void {\n\t\tfor (const provision of this.#provisions()) {\n\t\t\tif (provision.kind === \"singleton\") {\n\t\t\t\tif (!this.#serviceSlots.hasSingleton(provision.service.id)) continue;\n\t\t\t\tconst target = provision.service.local\n\t\t\t\t\t? provision.implementation\n\t\t\t\t\t: (this.#internalServiceBinding.use(provision.service) as object);\n\t\t\t\tthis.#serviceSlots.bindSingleton(provision.service.id, target);\n\t\t\t} else {\n\t\t\t\tthis.#serviceSlots.bindKeyed(\n\t\t\t\t\tprovision.service.id,\n\t\t\t\t\tprovision.service.local ? this.#localKeyedRegistry : this.#internalServiceBinding,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tfor (const [serviceId, { service, mode, source }] of externalServices) {\n\t\t\tconst services = this.#sourceBindings.get(source);\n\t\t\tif (services === undefined) throw new Error(`Service source for ${serviceId} is not open`);\n\t\t\tif (mode === \"singleton\") {\n\t\t\t\tthis.#serviceSlots.bindSingleton(serviceId, services.use(service) as object);\n\t\t\t} else {\n\t\t\t\tthis.#serviceSlots.bindKeyed(serviceId, services);\n\t\t\t}\n\t\t}\n\t}\n\n\t#provisions(): FacetProvision[] {\n\t\treturn [...this.#facets.values()].flatMap(({ provisions }) => provisions);\n\t}\n\n\tget #localKeyedRegistry(): LocalKeyedServiceRegistry {\n\t\tif (this.#localKeyedServices === undefined) throw new Error(\"Facet keyed services are not assembled\");\n\t\treturn this.#localKeyedServices;\n\t}\n\n\tget #internalServiceBinding(): RemoteServices {\n\t\tif (this.#internalServices === undefined) throw new Error(\"Facet remote services are not assembled\");\n\t\treturn this.#internalServices;\n\t}\n\n\tasync #disposeServiceBindings(): Promise<unknown[]> {\n\t\tconst bindings = [...this.#sourceBindings.values()];\n\t\tthis.#sourceBindings.clear();\n\t\tif (this.#internalServices !== undefined) bindings.push(this.#internalServices);\n\t\tthis.#internalServices = undefined;\n\t\tconst results = await Promise.allSettled(bindings.map((services) => services.dispose(BACKGROUND_CONTEXT)));\n\t\treturn results.flatMap((result) => (result.status === \"rejected\" ? [result.reason] : []));\n\t}\n\n\t#assertServiceTargetAccess(): void {\n\t\tif (\n\t\t\tthis.#phase !== \"activating\" &&\n\t\t\tthis.#phase !== \"active\" &&\n\t\t\tthis.#phase !== \"reloading\" &&\n\t\t\tthis.#phase !== \"disposing\"\n\t\t) {\n\t\t\tthrow new Error(`Facet service targets cannot be used during ${this.#phase}`);\n\t\t}\n\t}\n\n\tasync #abort(extraRecords: readonly FacetRuntime[] = []): Promise<unknown[]> {\n\t\tfor (const record of this.#facets.values()) record.lifecycle.revoke();\n\t\tfor (const record of extraRecords) record.lifecycle.revoke();\n\t\treturn this.#terminate(extraRecords);\n\t}\n\n\tasync #terminate(extraRecords: readonly FacetRuntime[] = []): Promise<unknown[]> {\n\t\tthis.#phase = \"disposing\";\n\t\tconst errors = await this.#disposeLifecycles();\n\t\terrors.push(...(await disposeFacetRecords([...extraRecords].reverse())));\n\t\ttry {\n\t\t\tthis.#localKeyedServices?.dispose();\n\t\t} catch (error) {\n\t\t\terrors.push(error);\n\t\t}\n\t\tthis.#localKeyedServices = undefined;\n\t\terrors.push(...(await this.#disposeServiceBindings()));\n\t\ttry {\n\t\t\tthis.#serviceSlots.dispose();\n\t\t} catch (error) {\n\t\t\terrors.push(error);\n\t\t}\n\t\ttry {\n\t\t\tthis.#provider?.dispose();\n\t\t} catch (error) {\n\t\t\terrors.push(error);\n\t\t}\n\t\tthis.#phase = \"dead\";\n\t\treturn errors;\n\t}\n\n\tasync #disposeLifecycles(): Promise<unknown[]> {\n\t\tconst errors: unknown[] = [];\n\t\tconst order =\n\t\t\tthis.#activationOrder.length > 0 ? [...this.#activationOrder].reverse() : [...this.#facets.keys()].reverse();\n\t\tfor (const id of order) {\n\t\t\tconst record = this.#facets.get(id);\n\t\t\tif (record === undefined) continue;\n\t\t\tthis.#facets.delete(id);\n\t\t\ttry {\n\t\t\t\tawait record.lifecycle.dispose();\n\t\t\t} catch (error) {\n\t\t\t\terrors.push(error);\n\t\t\t}\n\t\t}\n\t\treturn errors;\n\t}\n}\n\nasync function disposeFacetRecords(records: readonly FacetRuntime[]): Promise<unknown[]> {\n\tconst errors: unknown[] = [];\n\tfor (const record of records) {\n\t\ttry {\n\t\t\tawait record.lifecycle.dispose();\n\t\t} catch (error) {\n\t\t\terrors.push(error);\n\t\t}\n\t}\n\treturn errors;\n}\n\nfunction validateFacets(\n\trecords: readonly FacetShape[],\n\texternalServices: ReadonlyMap<string, { readonly mode: ServiceMode }>,\n): string[] {\n\tconst providers = new Map<\n\t\tstring,\n\t\t{ readonly facetId: string | undefined; readonly mode: ServiceMode | undefined }\n\t>();\n\tfor (const [serviceId, { mode }] of externalServices) providers.set(serviceId, { facetId: undefined, mode });\n\tfor (const record of records) {\n\t\tfor (const provision of record.provides) {\n\t\t\tconst existing = providers.get(provision.serviceId);\n\t\t\tif (existing !== undefined) {\n\t\t\t\tif (existing.mode !== undefined && existing.mode !== provision.mode) {\n\t\t\t\t\tthrow new Error(`Service ${provision.serviceId} is provided as both singleton and keyed`);\n\t\t\t\t}\n\t\t\t\tif (existing.facetId === undefined) {\n\t\t\t\t\tthrow new Error(`Service ${provision.serviceId} is provided by both the host and ${record.facetId}`);\n\t\t\t\t}\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Service ${provision.serviceId} is provided by both ${existing.facetId} and ${record.facetId}`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tproviders.set(provision.serviceId, { facetId: record.facetId, mode: provision.mode });\n\t\t}\n\t}\n\n\tconst dependencies = new Map(records.map((record) => [record.facetId, new Set<string>()]));\n\tconst dependents = new Map(records.map((record) => [record.facetId, new Set<string>()]));\n\tfor (const record of records) {\n\t\tfor (const requirement of record.requires) {\n\t\t\tconst provider = providers.get(requirement.serviceId);\n\t\t\tif (provider === undefined) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Facet ${record.facetId} requires local/${requirement.serviceId}/${requirement.mode}, but no facet provides it`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (provider.mode !== undefined && provider.mode !== requirement.mode) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Facet ${record.facetId} requires ${requirement.serviceId} as ${requirement.mode}, but ${provider.facetId ?? \"the host\"} provides it as ${provider.mode}`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (provider.facetId === undefined || provider.facetId === record.facetId) continue;\n\t\t\tdependencies.get(record.facetId)!.add(provider.facetId);\n\t\t\tdependents.get(provider.facetId)!.add(record.facetId);\n\t\t}\n\t}\n\treturn topologicalOrder(records, dependencies, dependents);\n}\n\nfunction topologicalOrder(\n\trecords: readonly FacetShape[],\n\tdependencies: ReadonlyMap<string, ReadonlySet<string>>,\n\tdependents: ReadonlyMap<string, ReadonlySet<string>>,\n): string[] {\n\tconst remaining = new Map([...dependencies].map(([id, values]) => [id, values.size]));\n\tconst ready = records.map((record) => record.facetId).filter((id) => remaining.get(id) === 0);\n\tconst order: string[] = [];\n\twhile (ready.length > 0) {\n\t\tconst id = ready.shift()!;\n\t\torder.push(id);\n\t\tfor (const dependent of dependents.get(id) ?? []) {\n\t\t\tconst count = remaining.get(dependent)! - 1;\n\t\t\tremaining.set(dependent, count);\n\t\t\tif (count === 0) ready.push(dependent);\n\t\t}\n\t}\n\tif (order.length !== records.length) {\n\t\tconst cycle = records.map((record) => record.facetId).filter((id) => remaining.get(id)! > 0);\n\t\tthrow new Error(`Facet dependency cycle: ${cycle.join(\", \")}`);\n\t}\n\treturn order;\n}\n\nfunction recordServiceReference(\n\ttarget: FacetServiceReference[],\n\tservice: { readonly id: string },\n\tmode: ServiceMode,\n): void {\n\tif (target.some((reference) => reference.serviceId === service.id && reference.mode === mode)) return;\n\ttarget.push({ serviceId: service.id, service: service as Service<unknown>, mode });\n}\n\nfunction sameFacetShape(left: FacetShape, right: FacetShape): boolean {\n\treturn sameReferences(left.requires, right.requires) && sameReferences(left.provides, right.provides);\n}\n\nfunction sameReferences(left: readonly FacetServiceReference[], right: readonly FacetServiceReference[]): boolean {\n\treturn (\n\t\tleft.length === right.length &&\n\t\tleft.every((reference) =>\n\t\t\tright.some((other) => other.serviceId === reference.serviceId && other.mode === reference.mode),\n\t\t)\n\t);\n}\n\nfunction isPromiseLike(value: unknown): value is PromiseLike<unknown> {\n\treturn typeof value === \"object\" && value !== null && \"then\" in value && typeof value.then === \"function\";\n}\n"]}
@@ -1,3 +0,0 @@
1
- import type { LoadedFacets } from "../types.ts";
2
- export declare function disposeLoadedFacets(loaded: readonly LoadedFacets[]): Promise<unknown[]>;
3
- //# sourceMappingURL=loader.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/facets/loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAG7F"}
@@ -1,5 +0,0 @@
1
- export async function disposeLoadedFacets(loaded) {
2
- const results = await Promise.allSettled(loaded.map((entry) => entry.dispose()));
3
- return results.flatMap((result) => (result.status === "rejected" ? [result.reason] : []));
4
- }
5
- //# sourceMappingURL=loader.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"loader.js","sourceRoot":"","sources":["../../src/facets/loader.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,MAA+B;IACxE,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;IACjF,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC3F,CAAC","sourcesContent":["import type { LoadedFacets } from \"../types.ts\";\n\nexport async function disposeLoadedFacets(loaded: readonly LoadedFacets[]): Promise<unknown[]> {\n\tconst results = await Promise.allSettled(loaded.map((entry) => entry.dispose()));\n\treturn results.flatMap((result) => (result.status === \"rejected\" ? [result.reason] : []));\n}\n"]}
@@ -1,30 +0,0 @@
1
- import type { FacetLoader } from "../types.ts";
2
- import { type FacetBundleArtifact, type FacetBundleManifest } from "./manifest.ts";
3
- export type FacetBundleExternalResolver = (specifier: string) => string | URL | undefined;
4
- export interface FacetBundleLoaderOptions {
5
- readonly manifestPath: string | URL;
6
- readonly entry: string;
7
- /** Verify the entry's SHA-256 integrity before evaluating it. Defaults to true. */
8
- readonly verifyIntegrity?: boolean;
9
- /** Resolve host-provided external imports when the bundle is outside the host's package tree. */
10
- readonly resolveExternal?: FacetBundleExternalResolver;
11
- }
12
- export interface FacetBundleArtifactLoaderOptions {
13
- readonly artifact: unknown;
14
- /** Resolve host-provided external imports against the receiving application. */
15
- readonly resolveExternal?: FacetBundleExternalResolver;
16
- /** Parent directory for materialized module generations. Defaults to the operating system temp directory. */
17
- readonly temporaryDirectory?: string;
18
- }
19
- /** Read and validate a versioned facet bundle manifest. */
20
- export declare function readFacetBundleManifest(path: string | URL): Promise<FacetBundleManifest>;
21
- /** Read and verify one transportable entry from a facet bundle on disk. */
22
- export declare function readFacetBundleArtifact(options: {
23
- readonly manifestPath: string | URL;
24
- readonly entry: string;
25
- }): Promise<FacetBundleArtifact>;
26
- /** Materialize a transported artifact and create a fresh VM-compiled CommonJS generation for each load. */
27
- export declare function createFacetBundleArtifactLoader(options: FacetBundleArtifactLoaderOptions): FacetLoader;
28
- /** Create a reusable loader for one opaque entry in a facet bundle manifest. */
29
- export declare function createFacetBundleLoader(options: FacetBundleLoaderOptions): FacetLo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+CtG;AAED,gFAAgF;AAChF,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,wBAAwB,GAAG,WAAW,CAmCtF"}
@@ -1,377 +0,0 @@
1
- import { createHash } from "node:crypto";
2
- import { mkdir, mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
3
- import { createRequire, isBuiltin } from "node:module";
4
- import { tmpdir } from "node:os";
5
- import { basename, dirname, isAbsolute, join, resolve } from "node:path";
6
- import { fileURLToPath } from "node:url";
7
- import { compileFunction } from "node:vm";
8
- import { FACET_BUNDLE_ARTIFACT_FORMAT, FACET_BUNDLE_ARTIFACT_FORMAT_VERSION, FACET_BUNDLE_FORMAT, FACET_BUNDLE_FORMAT_VERSION, FACET_BUNDLE_MANIFEST_FILE, } from "./manifest.js";
9
- /** Read and validate a versioned facet bundle manifest. */
10
- export async function readFacetBundleManifest(path) {
11
- const manifestPath = toFilePath(path);
12
- let parsed;
13
- try {
14
- parsed = JSON.parse(await readFile(manifestPath, "utf8"));
15
- }
16
- catch (error) {
17
- throw new Error(`Could not read facet bundle manifest ${manifestPath}`, { cause: error });
18
- }
19
- return validateManifest(parsed, manifestPath);
20
- }
21
- /** Read and verify one transportable entry from a facet bundle on disk. */
22
- export async function readFacetBundleArtifact(options) {
23
- if (options.entry.length === 0)
24
- throw new TypeError("Facet bundle entry name must not be empty");
25
- const manifestPath = toFilePath(options.manifestPath);
26
- const manifest = await readFacetBundleManifest(manifestPath);
27
- const entry = manifest.entries[options.entry];
28
- if (entry === undefined)
29
- throw new Error(`Facet bundle ${manifest.plugin.id} has no entry named ${options.entry}`);
30
- const modulePath = resolveBundleFile(manifestPath, entry.file, "entry");
31
- const source = await readFile(modulePath, "utf8");
32
- verifySource(source, entry);
33
- const sourceMapContents = entry.sourceMap === undefined
34
- ? undefined
35
- : await readFile(resolveBundleFile(manifestPath, entry.sourceMap, "source map"), "utf8");
36
- return Object.freeze({
37
- format: FACET_BUNDLE_ARTIFACT_FORMAT,
38
- formatVersion: FACET_BUNDLE_ARTIFACT_FORMAT_VERSION,
39
- plugin: manifest.plugin,
40
- entryName: options.entry,
41
- entry,
42
- source,
43
- ...(sourceMapContents === undefined ? {} : { sourceMapContents }),
44
- });
45
- }
46
- /** Materialize a transported artifact and create a fresh VM-compiled CommonJS generation for each load. */
47
- export function createFacetBundleArtifactLoader(options) {
48
- const artifact = validateArtifact(options.artifact);
49
- const temporaryParent = resolve(options.temporaryDirectory ?? tmpdir());
50
- return {
51
- async load() {
52
- await mkdir(temporaryParent, { recursive: true });
53
- const directory = await mkdtemp(join(temporaryParent, "chord-facet-"));
54
- try {
55
- await materializeArtifact(directory, artifact);
56
- const loaded = await createFacetBundleLoader({
57
- manifestPath: join(directory, FACET_BUNDLE_MANIFEST_FILE),
58
- entry: artifact.entryName,
59
- resolveExternal: options.resolveExternal,
60
- }).load();
61
- let disposed = false;
62
- return {
63
- get facets() {
64
- return loaded.facets;
65
- },
66
- async dispose() {
67
- if (disposed)
68
- return;
69
- disposed = true;
70
- const errors = [];
71
- try {
72
- await loaded.dispose();
73
- }
74
- catch (error) {
75
- errors.push(error);
76
- }
77
- try {
78
- await rm(directory, { force: true, recursive: true });
79
- }
80
- catch (error) {
81
- errors.push(error);
82
- }
83
- if (errors.length === 1)
84
- throw errors[0];
85
- if (errors.length > 1)
86
- throw new AggregateError(errors, "Failed to dispose facet bundle artifact");
87
- },
88
- };
89
- }
90
- catch (error) {
91
- try {
92
- await rm(directory, { force: true, recursive: true });
93
- }
94
- catch (cleanupError) {
95
- throw new AggregateError([error, cleanupError], "Facet bundle artifact loading and cleanup failed");
96
- }
97
- throw error;
98
- }
99
- },
100
- };
101
- }
102
- /** Create a reusable loader for one opaque entry in a facet bundle manifest. */
103
- export function createFacetBundleLoader(options) {
104
- if (options.entry.length === 0)
105
- throw new TypeError("Facet bundle entry name must not be empty");
106
- const manifestPath = toFilePath(options.manifestPath);
107
- return {
108
- async load() {
109
- const manifest = await readFacetBundleManifest(manifestPath);
110
- const entry = manifest.entries[options.entry];
111
- if (entry === undefined) {
112
- throw new Error(`Facet bundle ${manifest.plugin.id} has no entry named ${options.entry}`);
113
- }
114
- const modulePath = resolveBundleFile(manifestPath, entry.file, "entry");
115
- try {
116
- const source = await readFile(modulePath, "utf8");
117
- if (options.verifyIntegrity !== false)
118
- verifySource(source, entry);
119
- const exported = executeCommonJsModule(source, modulePath, entry.externalImports, options.resolveExternal);
120
- let facets = facetsFromModule(exported, manifest.plugin.id, options.entry);
121
- let disposed = false;
122
- return {
123
- get facets() {
124
- return facets;
125
- },
126
- async dispose() {
127
- if (disposed)
128
- return;
129
- disposed = true;
130
- facets = Object.freeze([]);
131
- },
132
- };
133
- }
134
- catch (error) {
135
- const detail = error instanceof Error ? `: ${error.message}` : "";
136
- throw new Error(`Could not load facet bundle entry ${manifest.plugin.id}/${options.entry}${detail}`, {
137
- cause: error,
138
- });
139
- }
140
- },
141
- };
142
- }
143
- function executeCommonJsModule(source, modulePath, externalImports, resolver) {
144
- const requireFromModule = createRequire(modulePath);
145
- const externalTargets = new Map();
146
- for (const specifier of externalImports) {
147
- if (!isBuiltin(specifier))
148
- validatePackageSpecifier(specifier);
149
- externalTargets.set(specifier, toRequireSpecifier(resolveExternalTarget(specifier, resolver)));
150
- }
151
- const targetFor = (specifier) => {
152
- const target = externalTargets.get(specifier);
153
- if (target === undefined)
154
- throw new Error(`Facet bundle required undeclared external import: ${specifier}`);
155
- return target;
156
- };
157
- const requireExternal = Object.assign((specifier) => requireFromModule(targetFor(specifier)), {
158
- resolve: (specifier) => requireFromModule.resolve(targetFor(specifier)),
159
- });
160
- const commonJsModule = { exports: Object.create(null) };
161
- const compiled = compileFunction(source, ["exports", "require", "module", "__filename", "__dirname"], {
162
- filename: modulePath,
163
- });
164
- Reflect.apply(compiled, commonJsModule.exports, [
165
- commonJsModule.exports,
166
- requireExternal,
167
- commonJsModule,
168
- modulePath,
169
- dirname(modulePath),
170
- ]);
171
- return commonJsModule.exports;
172
- }
173
- function toRequireSpecifier(target) {
174
- if (isAbsolute(target) || isBuiltin(target))
175
- return target;
176
- let url;
177
- try {
178
- url = new URL(target);
179
- }
180
- catch {
181
- return target;
182
- }
183
- if (url.protocol === "file:")
184
- return fileURLToPath(url);
185
- if (url.protocol === "node:")
186
- return url.href;
187
- throw new Error(`Facet bundle external target must be a file, package, or built-in module: ${target}`);
188
- }
189
- function toFilePath(path) {
190
- if (typeof path === "string")
191
- return resolve(path);
192
- if (path.protocol !== "file:")
193
- throw new TypeError(`Facet bundle manifest must be a file URL, not ${path.protocol}`);
194
- return fileURLToPath(path);
195
- }
196
- function resolveBundleFile(manifestPath, file, label) {
197
- if (file.length === 0 || isAbsolute(file) || basename(file) !== file || file === "." || file === "..") {
198
- throw new Error(`Facet bundle ${label} must be a filename relative to its manifest`);
199
- }
200
- return resolve(dirname(manifestPath), file);
201
- }
202
- function verifySource(source, entry) {
203
- const expected = parseIntegrity(entry.integrity);
204
- const actual = createHash("sha256").update(source, "utf8").digest("base64");
205
- if (actual !== expected)
206
- throw new Error(`Facet bundle integrity check failed for ${entry.file}`);
207
- }
208
- function parseIntegrity(integrity) {
209
- const prefix = "sha256-";
210
- if (!integrity.startsWith(prefix) || integrity.length === prefix.length) {
211
- throw new Error("Facet bundle entry has an invalid SHA-256 integrity value");
212
- }
213
- return integrity.slice(prefix.length);
214
- }
215
- function facetsFromModule(imported, pluginId, entryName) {
216
- if (!isRecord(imported))
217
- throw new Error(`Facet bundle entry ${pluginId}/${entryName} did not export a module`);
218
- const exported = imported.default;
219
- const candidates = Array.isArray(exported) ? exported : [exported];
220
- if (candidates.length === 0) {
221
- throw new Error(`Facet bundle entry ${pluginId}/${entryName} exported no facets`);
222
- }
223
- const facets = [];
224
- for (const candidate of candidates) {
225
- if (!isRecord(candidate) || typeof candidate.id !== "string" || candidate.id.length === 0) {
226
- throw new Error(`Facet bundle entry ${pluginId}/${entryName} has a facet with an invalid ID`);
227
- }
228
- if (typeof candidate.setup !== "function") {
229
- throw new Error(`Facet bundle entry ${pluginId}/${entryName} facet ${candidate.id} has no setup function`);
230
- }
231
- facets.push(candidate);
232
- }
233
- const ids = facets.map(({ id }) => id);
234
- if (new Set(ids).size !== ids.length) {
235
- throw new Error(`Facet bundle entry ${pluginId}/${entryName} exports duplicate facet IDs`);
236
- }
237
- return Object.freeze(facets);
238
- }
239
- function validateArtifact(value) {
240
- if (!isRecord(value) ||
241
- value.format !== FACET_BUNDLE_ARTIFACT_FORMAT ||
242
- value.formatVersion !== FACET_BUNDLE_ARTIFACT_FORMAT_VERSION ||
243
- typeof value.entryName !== "string" ||
244
- value.entryName.length === 0 ||
245
- typeof value.source !== "string") {
246
- throw new Error("Invalid facet bundle artifact");
247
- }
248
- const manifest = validateManifest({
249
- format: FACET_BUNDLE_FORMAT,
250
- formatVersion: FACET_BUNDLE_FORMAT_VERSION,
251
- plugin: value.plugin,
252
- entries: { [value.entryName]: value.entry },
253
- }, "facet bundle artifact");
254
- const entry = manifest.entries[value.entryName];
255
- if (entry.sourceMap === undefined) {
256
- if (value.sourceMapContents !== undefined) {
257
- throw new Error("Facet bundle artifact has source map contents without a source map");
258
- }
259
- }
260
- else if (typeof value.sourceMapContents !== "string") {
261
- throw new Error("Facet bundle artifact is missing its source map contents");
262
- }
263
- verifySource(value.source, entry);
264
- return Object.freeze({
265
- format: FACET_BUNDLE_ARTIFACT_FORMAT,
266
- formatVersion: FACET_BUNDLE_ARTIFACT_FORMAT_VERSION,
267
- plugin: manifest.plugin,
268
- entryName: value.entryName,
269
- entry,
270
- source: value.source,
271
- ...(value.sourceMapContents === undefined ? {} : { sourceMapContents: value.sourceMapContents }),
272
- });
273
- }
274
- async function materializeArtifact(directory, artifact) {
275
- const manifest = {
276
- format: FACET_BUNDLE_FORMAT,
277
- formatVersion: FACET_BUNDLE_FORMAT_VERSION,
278
- plugin: artifact.plugin,
279
- entries: { [artifact.entryName]: artifact.entry },
280
- };
281
- await Promise.all([
282
- writeFile(join(directory, artifact.entry.file), artifact.source, "utf8"),
283
- writeFile(join(directory, FACET_BUNDLE_MANIFEST_FILE), `${JSON.stringify(manifest, null, 2)}\n`, "utf8"),
284
- ...(artifact.entry.sourceMap === undefined
285
- ? []
286
- : [writeFile(join(directory, artifact.entry.sourceMap), artifact.sourceMapContents, "utf8")]),
287
- ]);
288
- }
289
- function resolveExternalTarget(specifier, resolver) {
290
- const resolved = resolver?.(specifier);
291
- if (resolved !== undefined)
292
- return typeof resolved === "string" ? resolved : resolved.href;
293
- const extension = import.meta.url.endsWith(".ts") ? "ts" : "js";
294
- if (specifier === "@earendil-works/chord")
295
- return new URL(`../index.${extension}`, import.meta.url).href;
296
- if (specifier === "@earendil-works/chord/context") {
297
- return new URL(`../context/index.${extension}`, import.meta.url).href;
298
- }
299
- if (specifier === "@earendil-works/chord/node")
300
- return new URL(`../node.${extension}`, import.meta.url).href;
301
- return import.meta.resolve(specifier);
302
- }
303
- function validatePackageSpecifier(specifier) {
304
- const segments = specifier.split("/");
305
- const packageParts = specifier.startsWith("@") ? 2 : 1;
306
- if (specifier.startsWith(".") ||
307
- specifier.startsWith("/") ||
308
- specifier.startsWith("#") ||
309
- specifier.includes(":") ||
310
- specifier.includes("\\") ||
311
- segments.length < packageParts ||
312
- segments.some((part) => part.length === 0 || part === "." || part === "..")) {
313
- throw new Error(`Facet bundle artifact has an unsupported external import: ${specifier}`);
314
- }
315
- }
316
- function validateManifest(value, path) {
317
- if (!isRecord(value) || value.format !== FACET_BUNDLE_FORMAT) {
318
- throw new Error(`Invalid facet bundle manifest format in ${path}`);
319
- }
320
- if (value.formatVersion !== FACET_BUNDLE_FORMAT_VERSION) {
321
- throw new Error(`Unsupported facet bundle manifest version in ${path}: ${String(value.formatVersion)}`);
322
- }
323
- if (!isRecord(value.plugin) || typeof value.plugin.id !== "string" || value.plugin.id.length === 0) {
324
- throw new Error(`Facet bundle manifest has an invalid plugin identity in ${path}`);
325
- }
326
- if (value.plugin.version !== undefined &&
327
- (typeof value.plugin.version !== "string" || value.plugin.version.length === 0)) {
328
- throw new Error(`Facet bundle manifest has an invalid plugin version in ${path}`);
329
- }
330
- if (!isRecord(value.entries) || Object.keys(value.entries).length === 0) {
331
- throw new Error(`Facet bundle manifest has no entries in ${path}`);
332
- }
333
- const entries = {};
334
- for (const [name, candidate] of Object.entries(value.entries)) {
335
- if (name.length === 0 || !isRecord(candidate)) {
336
- throw new Error(`Facet bundle manifest has an invalid entry in ${path}`);
337
- }
338
- if (typeof candidate.file !== "string")
339
- throw new Error(`Facet bundle entry ${name} has no file`);
340
- resolveBundleFile(path, candidate.file, `entry ${name}`);
341
- if (typeof candidate.integrity !== "string")
342
- throw new Error(`Facet bundle entry ${name} has no integrity`);
343
- parseIntegrity(candidate.integrity);
344
- if (!Array.isArray(candidate.externalImports) ||
345
- candidate.externalImports.some((item) => typeof item !== "string")) {
346
- throw new Error(`Facet bundle entry ${name} has invalid external imports`);
347
- }
348
- const externalImports = Object.freeze([...candidate.externalImports]);
349
- if (new Set(externalImports).size !== externalImports.length) {
350
- throw new Error(`Facet bundle entry ${name} has duplicate external imports`);
351
- }
352
- if (candidate.sourceMap !== undefined) {
353
- if (typeof candidate.sourceMap !== "string")
354
- throw new Error(`Facet bundle entry ${name} has an invalid source map`);
355
- resolveBundleFile(path, candidate.sourceMap, `entry ${name} source map`);
356
- }
357
- entries[name] = Object.freeze({
358
- file: candidate.file,
359
- integrity: candidate.integrity,
360
- externalImports,
361
- ...(candidate.sourceMap === undefined ? {} : { sourceMap: candidate.sourceMap }),
362
- });
363
- }
364
- return Object.freeze({
365
- format: FACET_BUNDLE_FORMAT,
366
- formatVersion: FACET_BUNDLE_FORMAT_VERSION,
367
- plugin: Object.freeze({
368
- id: value.plugin.id,
369
- ...(value.plugin.version === undefined ? {} : { version: value.plugin.version }),
370
- }),
371
- entries: Object.freeze(entries),
372
- });
373
- }
374
- function isRecord(value) {
375
- return typeof value === "object" && value !== null && !Array.isArray(value);
376
- }
377
- //# sourceMappingURL=bundle-loader.js.map