@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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"record.js","sourceRoot":"","sources":["../src/record.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC9D,OAAO,EAKN,IAAI,EAGJ,aAAa,GAEb,MAAM,eAAe,CAAC;AACvB,OAAO,EAKN,QAAQ,GAOR,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1C,MAAM,IAAI,GAAG,GAAS,EAAE,GAAE,CAAC,CAAC;AAgC5B,MAAM,CAAC,MAAM,WAAW,GAAG,CAC1B,QAAW,EACX,OAAmB,EACnB,OAAwB,EACxB,KAAa,EACH,EAAE,CAAC,CAAC;IACd,QAAQ;IACR,OAAO,EAAE,OAAgC;IACzC,OAAO,EAAE,OAAuB;IAChC,KAAK;IACL,YAAY,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,IAAI,CAAC;CACzC,CAAC,CAAC;AAsBH,oCAAoC;AACpC,MAAM,WAAW;IACP,QAAQ,CAAe;IAChC,YAAY,QAAsB;QACjC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC1B,CAAC;CACD;AAED,MAAM,OAAO,YAAY;IACf,GAAG,CAAS;IACZ,IAAI,CAAkB;IACtB,IAAI,CAAm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jH,MAAM,QAAQ,GAAsB,EAAE,CAAC;QACvC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;YAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,IAAI,SAAS,GAAG,EAAE,CAAC,GAAG,KAAK,CAAC;QACrG,KAAK,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE,CAAC;YAC1F,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,EAAE;gBACjC,QAAQ,EAAE,QAA6B;gBACvC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;gBACvC,KAAK;aACL,CAAC,CAAC;QACJ,CAAC;IACF,CAAC;CACD","sourcesContent":["import type { TSchema } from \"typebox\";\nimport { Value } from \"typebox/value\";\nimport { Cell, Derived, isSource, notReady } from \"./cell.ts\";\nimport {\n\ttype Accepts,\n\ttype Adapter,\n\ttype AnyContract,\n\ttype BehaviorOf,\n\tbind,\n\ttype Handle,\n\ttype InputOf,\n\tLOCAL_VARIANT,\n\ttype MemberDescription,\n} from \"./contract.ts\";\nimport {\n\ttype CellDecl,\n\ttype Cells,\n\ttype DerivationDecl,\n\ttype Derivations,\n\tdeclKind,\n\ttype ListenerDecl,\n\ttype Resource,\n\ttype ResourceDecl,\n\ttype ResourceSpec,\n\ttype Resources,\n\ttype Subscribable,\n} from \"./declare.ts\";\nimport { asChordError, ChordError, invalid, runAll } from \"./errors.ts\";\nimport { enqueue } from \"./publish.ts\";\nimport type { Registration, Registry } from \"./registry.ts\";\nimport { assertValid } from \"./schema.ts\";\nimport type { Ctx, Exposed, GetOptions, HandleStatus, Principal, Readable, Shape, StateEvent } from \"./types.ts\";\n\nconst noop = (): void => {};\n\n// ─── Services ────────────────────────────────────────────────────────────────\n\nexport interface ServeOptions<C extends AnyContract = AnyContract> {\n\t/**\n\t * State version: the meaning of the record's cells. At a bump, `migrate[name](old, fromVersion)` maps a cell's value;\n\t * the record may be several versions behind.\n\t */\n\treadonly state?: {\n\t\treadonly version: number;\n\t\treadonly migrate?: Readonly<Record<string, (old: unknown, fromVersion: number) => unknown>>;\n\t};\n\t/** Milliseconds a record stays alive after its last hold is released. */\n\treadonly linger?: number;\n\t/** Host-held record created with this input (true: `{}` normalized). Only eager records may register. */\n\treadonly eager?: boolean | { readonly input: InputOf<C> };\n\t/** Adapters for consumers built against older contract versions. */\n\treadonly accepts?: Accepts;\n}\n\nexport type Factory<C extends AnyContract> = (input: InputOf<C>, principal: Principal, self: Self) => BehaviorOf<C>;\ntype AnyFactory = (input: unknown, principal: Principal, self: Self) => unknown;\n\nexport interface Service {\n\treadonly contract: AnyContract;\n\treadonly factory: AnyFactory;\n\treadonly options: ServeOptions;\n\treadonly facet: string;\n\treadonly stateVersion: number;\n}\n\nexport const makeService = <C extends AnyContract>(\n\tcontract: C,\n\tfactory: Factory<C>,\n\toptions: ServeOptions<C>,\n\tfacet: string,\n): Service => ({\n\tcontract,\n\tfactory: factory as unknown as AnyFactory,\n\toptions: options as ServeOptions,\n\tfacet,\n\tstateVersion: options.state?.version ?? 1,\n});\n\n// ─── Declarations ────────────────────────────────────────────────────────────\n\nexport interface Self {\n\t/** Cells by name. Existing names keep their cell (and value) across reloads. */\n\tstate<const D extends Readonly<Record<string, CellDecl<unknown>>>>(cells: D): Cells<D>;\n\t/** A record-owned hold, identified by its address. */\n\tget<C extends AnyContract>(type: C, input: InputOf<C>, options?: GetOptions): Handle<C>;\n\tresources<const D extends Readonly<Record<string, ResourceDecl<unknown>>>>(resources: D): Resources<D>;\n\tlisten(listeners: Readonly<Record<string, ListenerDecl>>): void;\n\ttasks(tasks: Readonly<Record<string, (ctx: Ctx) => Promise<void>>>): void;\n\tderive<const D extends Readonly<Record<string, DerivationDecl<unknown>>>>(derivations: D): Derivations<D>;\n\t/** Eager records only. Keys are the registry's own keys. */\n\tregister<V>(registry: Registry<V>, entries: Readonly<Record<string, V>>): void;\n\t/**\n\t * A member backed by one of this record's resources, for local contracts: handles read the resource's value once\n\t * the record is live (`undefined` before). Typically an `opaque` member: `{ harness: self.expose(res.durable) }`.\n\t */\n\texpose<T>(resource: Resource<T>): Exposed<T>;\n}\n\n/** Runtime form of `Exposed<T>`. */\nclass ExposedImpl {\n\treadonly resource: ResourceImpl;\n\tconstructor(resource: ResourceImpl) {\n\t\tthis.resource = resource;\n\t}\n}\n\nexport class ResourceImpl<T = unknown> implements Resource<T> {\n\treadonly key: string;\n\treadonly spec: ResourceSpec<T>;\n\treadonly deps: readonly (Hold | ResourceImpl)[];\n\t/** `unavailable`: a close/reopen failed during a reload rollback; the value is gone for good. */\n\tstate: \"closed\" | \"opening\" | \"open\" | \"unavailable\" = \"closed\";\n\t#value: T | undefined;\n\n\tconstructor(key: string, spec: ResourceSpec<T>, deps: readonly (Hold | ResourceImpl)[]) {\n\t\tthis.key = key;\n\t\tthis.spec = spec;\n\t\tthis.deps = deps;\n\t}\n\n\tget value(): T {\n\t\tif (this.state === \"unavailable\")\n\t\t\tthrow new ChordError(\"unavailable\", `resource ${this.key} could not be restored`);\n\t\tif (this.state !== \"open\") throw notReady(`resource ${this.key}`);\n\t\treturn this.#value as T;\n\t}\n\n\tget exclusive(): boolean {\n\t\treturn this.spec.exclusive === true;\n\t}\n\n\t/**\n\t * Opens the resource. An open that completes after `signal` aborted (rollback, abandonment) closes the value it\n\t * produced at once: nobody owns it any more.\n\t */\n\tasync open(signal: AbortSignal, order: ResourceImpl[]): Promise<void> {\n\t\tif (this.state !== \"closed\") return;\n\t\tthis.state = \"opening\";\n\t\tlet value: T;\n\t\ttry {\n\t\t\tvalue = await this.spec.open({ signal });\n\t\t} catch (error) {\n\t\t\tthis.state = \"closed\";\n\t\t\tthrow error;\n\t\t}\n\t\tif (signal.aborted) {\n\t\t\tthis.state = \"closed\";\n\t\t\tawait this.spec.close?.(value);\n\t\t\tthrow new ChordError(\"aborted\", `resource ${this.key} opened after abort`);\n\t\t}\n\t\tthis.#value = value;\n\t\tthis.state = \"open\";\n\t\torder.push(this);\n\t}\n\n\tasync close(order: ResourceImpl[]): Promise<void> {\n\t\tif (this.state !== \"open\") return;\n\t\tthis.state = \"closed\";\n\t\tconst index = order.indexOf(this);\n\t\tif (index !== -1) order.splice(index, 1);\n\t\tconst value = this.#value as T;\n\t\tthis.#value = undefined;\n\t\tawait this.spec.close?.(value);\n\t}\n\n\tmarkUnavailable(): void {\n\t\tthis.state = \"unavailable\";\n\t\tthis.#value = undefined;\n\t}\n}\n\n/**\n * What `self.resources` returns: the resource, except that `.value` throws `not_ready` while any factory runs, even\n * if the resource is open (a reload's prepare rerun must not touch the native resource the old code uses).\n */\nclass ResourceFacade<T> implements Resource<T> {\n\treadonly #resource: ResourceImpl<T>;\n\treadonly #host: HostCore;\n\n\tconstructor(resource: ResourceImpl<T>, host: HostCore) {\n\t\tthis.#resource = resource;\n\t\tthis.#host = host;\n\t\tfacades.set(this, resource as ResourceImpl);\n\t}\n\n\tget key(): string {\n\t\treturn this.#resource.key;\n\t}\n\n\tget value(): T {\n\t\tif (this.#host.inFactory > 0) throw notReady(`resource ${this.key} (inside a factory)`);\n\t\treturn this.#resource.value;\n\t}\n}\n\nconst facades = new WeakMap<object, ResourceImpl>();\nconst resourceOf = (value: unknown): ResourceImpl | undefined =>\n\tvalue instanceof ResourceImpl ? value : value !== null && typeof value === \"object\" ? facades.get(value) : undefined;\n\ntype TaskFn = (ctx: Ctx) => Promise<void>;\n\n/** Everything one factory run declared, by kind and key. */\nexport class Decls {\n\treadonly cells = new Map<string, Cell<unknown>>();\n\treadonly cellSchemas = new Map<string, TSchema>();\n\treadonly holds = new Map<string, Hold>();\n\treadonly resources = new Map<string, ResourceImpl>();\n\treadonly listeners = new Map<string, ListenerDecl>();\n\treadonly tasks = new Map<string, TaskFn>();\n\treadonly derives = new Map<string, Derived<unknown>>();\n\treadonly deriveFns = new Map<string, (...values: never[]) => unknown>();\n\treadonly registrations = new Map<string, Registration>();\n}\n\n/** One factory run: its behavior, declarations and the objects it created (not reused from the previous run). */\nexport interface Run {\n\treadonly behavior: Record<string, unknown>;\n\treadonly decls: Decls;\n\treadonly created: {\n\t\treadonly holds: Hold[];\n\t\treadonly resources: ResourceImpl[];\n\t\treadonly derives: Derived<unknown>[];\n\t};\n}\n\nexport interface Installed {\n\treadonly epoch: number;\n\treadonly service: Service;\n\treadonly behavior: Record<string, unknown>;\n\treadonly decls: Decls;\n}\n\n// ─── Host interface the runtime pieces use ───────────────────────────────────\n\nexport interface HostCore {\n\treadonly name: string;\n\treadonly dev: boolean;\n\treadonly principal: Principal;\n\tinFactory: number;\n\t/** Set when a commit failed midway: the host admits no more work (terminal). */\n\treadonly failed: unknown;\n\treport(error: unknown): void;\n\tcurrentEpoch(): number;\n\thasEpoch(epoch: number): boolean;\n\tretainedEpochs(): Iterable<readonly [number, ReadonlyMap<string, Service>]>;\n\tpendingEpoch(): number | undefined;\n\tservice(typeName: string): Service | undefined;\n\tacquire(\n\t\ttype: AnyContract,\n\t\tinput: unknown,\n\t\toptions: GetOptions | undefined,\n\t\towner: HoldOwner,\n\t\tfrom?: RecordImpl,\n\t\tcandidate?: boolean,\n\t): Hold;\n\taddressOf(type: AnyContract, input: unknown, principal: Principal, at?: string, candidate?: boolean): string;\n\troot<T>(fn: (ctx: Ctx) => T | Promise<T>, options?: { epoch?: number; signal?: AbortSignal }): Promise<T>;\n\ttouch(rootId: string, record: RecordImpl): void;\n\tforget(record: RecordImpl): void;\n\tcheckRegistrations(record: RecordImpl, decls: Decls): void;\n\t/** Rebuilds the current registry tables from live records (plus `including`, which is finishing activation). */\n\tregistriesChanged(including?: RecordImpl): void;\n}\n\n// ─── Contexts ────────────────────────────────────────────────────────────────\n\nexport class CtxImpl implements Ctx {\n\treadonly host: HostCore;\n\treadonly signal: AbortSignal;\n\treadonly rootId: string;\n\treadonly epoch: number;\n\treadonly principal: Principal;\n\t/** Code holders (tasks): every call they make starts a fresh root. */\n\treadonly holder: boolean;\n\treadonly #holds: Hold[] = [];\n\t#closed = false;\n\n\t/** True after the call or root that received this ctx settled: it may no longer start work. */\n\tget closed(): boolean {\n\t\treturn this.#closed;\n\t}\n\n\t/** Throws unless this ctx may start work on `host` now (not expired, not aborted, not from another host). */\n\tcheck(host: HostCore): void {\n\t\tif (this.host !== host) throw invalid(\"foreign_ctx\", \"ctx belongs to another host\");\n\t\tif (this.#closed) throw new ChordError(\"aborted\", \"ctx expired: its call already settled\", { reason: \"expired\" });\n\t\tif (this.signal.aborted) throw new ChordError(\"aborted\", \"ctx aborted\", { cause: this.signal.reason });\n\t}\n\n\tconstructor(\n\t\thost: HostCore,\n\t\tfields: { signal: AbortSignal; rootId: string; epoch: number; principal: Principal; holder?: boolean },\n\t) {\n\t\tthis.host = host;\n\t\tthis.signal = fields.signal;\n\t\tthis.rootId = fields.rootId;\n\t\tthis.epoch = fields.epoch;\n\t\tthis.principal = fields.principal;\n\t\tthis.holder = fields.holder ?? false;\n\t}\n\n\tget<C extends AnyContract>(type: C, input: InputOf<C>, options?: GetOptions): Handle<C> {\n\t\tthis.check(this.host);\n\t\tconst handle = this.host.acquire(type, input, { principal: this.principal, ...options }, \"call\");\n\t\tthis.#holds.push(handle);\n\t\treturn handle.proxy as Handle<C>;\n\t}\n\n\t/**\n\t * A context for a call into `record`: same root and epoch, its own call-owned holds, aborted on forced disposal.\n\t * Code inside an object acts as the host principal.\n\t */\n\tchild(record: RecordImpl): CtxImpl {\n\t\treturn new CtxImpl(this.host, {\n\t\t\tsignal: AbortSignal.any([this.signal, record.callAbort.signal]),\n\t\t\trootId: this.rootId,\n\t\t\tepoch: this.epoch,\n\t\t\tprincipal: this.host.principal,\n\t\t});\n\t}\n\n\tclose(): void {\n\t\tthis.#closed = true;\n\t\tfor (const handle of this.#holds.splice(0)) handle.release();\n\t}\n}\n\nexport async function raceSignal<T>(promise: Promise<T>, signal: AbortSignal): Promise<T> {\n\tif (signal.aborted) throw new ChordError(\"aborted\", \"call aborted\", { cause: signal.reason });\n\tlet onAbort = noop;\n\tconst aborted = new Promise<never>((_, reject) => {\n\t\tonAbort = () => reject(new ChordError(\"aborted\", \"call aborted\", { cause: signal.reason }));\n\t\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\t});\n\ttry {\n\t\treturn await Promise.race([promise, aborted]);\n\t} finally {\n\t\tsignal.removeEventListener(\"abort\", onAbort);\n\t}\n}\n\n// ─── Handles ─────────────────────────────────────────────────────────────────\n\n/** Who a hold belongs to. `connection`: a peer host over a link; `client`: a browser (not a reload participant). */\nexport type HoldOwner = \"record\" | \"call\" | \"host\" | \"external\" | \"connection\" | \"client\";\n\n/** A claim on an object: a local `HandleImpl`, or a `RemoteHandle` on another host (no record here). */\nexport interface Hold {\n\treadonly address: string;\n\treadonly contract: AnyContract;\n\treadonly status: HandleStatus;\n\treadonly ready: Promise<void>;\n\treadonly proxy: object;\n\treadonly record: RecordImpl | undefined;\n\trelease(): void;\n}\n\nexport const HANDLE_BASE: ReadonlySet<PropertyKey> = new Set([\n\t\"contract\",\n\t\"status\",\n\t\"ready\",\n\t\"kind\",\n\t\"shape\",\n\t\"error\",\n\t\"onShape\",\n\t\"onStatus\",\n\t\"release\",\n]);\n\nexport type StatusListener = (status: HandleStatus, error: unknown) => void;\n\n/** Queues a status notification (after the change that caused it is complete, like every publication). */\nexport function notifyStatus(\n\tlisteners: ReadonlySet<StatusListener>,\n\tstatus: HandleStatus,\n\terror: unknown,\n\treport: (error: unknown) => void,\n): void {\n\tif (listeners.size === 0) return;\n\tconst current = [...listeners];\n\tenqueue(() => {\n\t\tfor (const listener of current) {\n\t\t\ttry {\n\t\t\t\tlistener(status, error);\n\t\t\t} catch (thrown) {\n\t\t\t\treport(thrown);\n\t\t\t}\n\t\t}\n\t});\n}\n\n/** Proxy → hold, for `deps: [handle]` and links. */\nexport const holdsByProxy = new WeakMap<object, Hold>();\nexport const handleOf = (value: unknown): Hold | undefined =>\n\tvalue !== null && typeof value === \"object\" ? holdsByProxy.get(value) : undefined;\n\n/**\n * A handle's state member: a stable readable that follows whatever source the current behavior exposes under that\n * name. `undefined` until the handle is live (or while the variant lacks the member). Rebinding (reload, variant)\n * delivers a reset. Upstream is subscribed only while someone listens.\n */\nclass MemberReadable implements Readable<unknown> {\n\treadonly #handle: HandleImpl;\n\treadonly #name: string;\n\treadonly #values = new Set<(value: unknown) => void>();\n\treadonly #events = new Set<(event: StateEvent<unknown>) => void>();\n\t#source: Readable<unknown> | undefined;\n\t#upstream = noop;\n\t/** The value listeners last saw; a first upstream snapshot equal to it is not re-announced. */\n\t#seen: unknown;\n\n\tconstructor(handle: HandleImpl, name: string) {\n\t\tthis.#handle = handle;\n\t\tthis.#name = name;\n\t}\n\n\tget value(): unknown {\n\t\treturn this.#current()?.value;\n\t}\n\n\tsubscribe(listener: (value: unknown) => void): () => void {\n\t\tthis.#values.add(listener);\n\t\tthis.#seen = this.value;\n\t\tthis.#safe(() => listener(this.#seen));\n\t\tthis.bind();\n\t\treturn () => this.#remove(this.#values, listener);\n\t}\n\n\tevents(listener: (event: StateEvent<unknown>) => void): () => void {\n\t\tthis.#events.add(listener);\n\t\tthis.#seen = this.value;\n\t\tthis.#safe(() => listener({ type: \"snap\", value: this.#seen }));\n\t\tthis.bind();\n\t\treturn () => this.#remove(this.#events, listener);\n\t}\n\n\t/** (Re)subscribes upstream to the current source; a changed source is announced as a reset. */\n\tbind(): void {\n\t\tconst source = this.#values.size + this.#events.size > 0 ? this.#current() : undefined;\n\t\tif (source === this.#source) return;\n\t\tthis.#upstream();\n\t\tthis.#upstream = noop;\n\t\tthis.#source = source;\n\t\tif (source === undefined) return;\n\t\tlet first = true;\n\t\tthis.#upstream = source.events((event) => {\n\t\t\tconst isFirst = first;\n\t\t\tfirst = false;\n\t\t\tif (isFirst && event.value === this.#seen) return;\n\t\t\tthis.#seen = event.value;\n\t\t\tconst translated: StateEvent<unknown> = isFirst ? { type: \"reset\", value: event.value } : event;\n\t\t\tconst events = [...this.#events];\n\t\t\tconst values = [...this.#values];\n\t\t\t// Queued: a rebind during a commit must not run observers before the commit completes.\n\t\t\tenqueue(() => {\n\t\t\t\tfor (const listener of events) if (this.#events.has(listener)) this.#safe(() => listener(translated));\n\t\t\t\tfor (const listener of values) if (this.#values.has(listener)) this.#safe(() => listener(event.value));\n\t\t\t});\n\t\t});\n\t}\n\n\tstop(): void {\n\t\tthis.#values.clear();\n\t\tthis.#events.clear();\n\t\tthis.bind();\n\t}\n\n\t#current(): Readable<unknown> | undefined {\n\t\tconst view = this.#handle.currentView();\n\t\tif (view === undefined || !this.#handle.inVariant(view, this.#name)) return undefined;\n\t\tconst value = view[this.#name];\n\t\t// Cells and derivations, or any readable an `accepts` adapter maps them to.\n\t\treturn isSource(value) || isReadableLike(value) ? (value as Readable<unknown>) : undefined;\n\t}\n\n\t#remove<T>(set: Set<T>, listener: T): void {\n\t\tset.delete(listener);\n\t\tthis.bind();\n\t}\n\n\t#safe(fn: () => void): void {\n\t\ttry {\n\t\t\tfn();\n\t\t} catch (error) {\n\t\t\tthis.#handle.record.host.report(error);\n\t\t}\n\t}\n}\n\n/** One hold on a record. Exposed through a Proxy so members bind late to the current behavior. */\nexport class HandleImpl {\n\treadonly record: RecordImpl;\n\treadonly contract: AnyContract;\n\treadonly owner: HoldOwner;\n\treadonly address: string;\n\treadonly proxy: object;\n\treadonly ready: Promise<void>;\n\tstatus: HandleStatus;\n\terror: unknown;\n\treadonly shapeListeners = new Set<(shape: Shape) => void>();\n\t/** Internal: notified when the handle becomes gone (links forward it). */\n\treadonly goneListeners = new Set<(error: unknown) => void>();\n\treadonly readables = new Map<string, MemberReadable>();\n\treadonly bindings = new Map<Service, Adapter | undefined>();\n\treadonly views = new WeakMap<Record<string, unknown>, Record<string, unknown>>();\n\treadonly callers = new Map<string, (args: unknown, ctx?: Ctx) => Promise<unknown>>();\n\n\tconstructor(record: RecordImpl, contract: AnyContract, owner: HoldOwner) {\n\t\tthis.record = record;\n\t\tthis.contract = contract;\n\t\tthis.owner = owner;\n\t\tthis.address = record.address;\n\t\tthis.status = record.status === \"live\" ? \"live\" : \"loading\";\n\t\tthis.ready = record.ready.then(() => {\n\t\t\tif (this.status === \"gone\") throw this.error;\n\t\t\tif (this.status === \"released\") throw new ChordError(\"released\", `handle ${this.address} released`);\n\t\t});\n\t\tthis.ready.catch(noop);\n\t\tthis.proxy = new Proxy(this, {\n\t\t\tget: (target, property) => {\n\t\t\t\tif (HANDLE_BASE.has(property)) {\n\t\t\t\t\tconst value: unknown = Reflect.get(target, property, target);\n\t\t\t\t\treturn typeof value === \"function\" ? value.bind(target) : value;\n\t\t\t\t}\n\t\t\t\tif (typeof property !== \"string\" || property === \"then\") return undefined;\n\t\t\t\treturn target.member(property);\n\t\t\t},\n\t\t\thas: (target, property) => HANDLE_BASE.has(property) || target.member(String(property)) !== undefined,\n\t\t});\n\t\tholdsByProxy.set(this.proxy, this);\n\t}\n\n\tget kind(): string | undefined {\n\t\tconst view = this.currentView();\n\t\treturn view === undefined ? undefined : kindOf(view);\n\t}\n\n\tget shape(): Shape | undefined {\n\t\tconst installed = this.status === \"live\" ? this.record.currentInstalled() : undefined;\n\t\tconst view = installed === undefined ? undefined : this.#safeView(installed);\n\t\tif (installed === undefined || view === undefined) return undefined;\n\t\treturn {\n\t\t\tkind: kindOf(view),\n\t\t\tmembers: Object.keys(view).filter((key) => key !== \"kind\"),\n\t\t\tcontract: installed.service.contract.fingerprint,\n\t\t\tepoch: installed.epoch,\n\t\t};\n\t}\n\n\tonShape(listener: (shape: Shape) => void): () => void {\n\t\tthis.shapeListeners.add(listener);\n\t\treturn () => this.shapeListeners.delete(listener);\n\t}\n\n\tonStatus(listener: StatusListener): () => void {\n\t\tthis.#statusListeners.add(listener);\n\t\treturn () => this.#statusListeners.delete(listener);\n\t}\n\n\treadonly #statusListeners = new Set<StatusListener>();\n\n\t#statusChanged(): void {\n\t\tnotifyStatus(this.#statusListeners, this.status, this.error, (error) => this.record.host.report(error));\n\t}\n\n\trelease(): void {\n\t\tif (this.status === \"released\" || this.status === \"gone\") return;\n\t\tthis.status = \"released\";\n\t\tthis.#stopReadables();\n\t\tthis.#statusChanged();\n\t\tthis.record.release(this);\n\t}\n\n\t// ─── internal ───\n\n\tlive(): void {\n\t\tif (this.status !== \"loading\") return;\n\t\tthis.status = \"live\";\n\t\tthis.#statusChanged();\n\t\tthis.shapeChanged();\n\t}\n\n\tgone(error: unknown): void {\n\t\tif (this.status === \"released\" || this.status === \"gone\") return;\n\t\tthis.status = \"gone\";\n\t\tthis.error = error;\n\t\tthis.#stopReadables();\n\t\tthis.#statusChanged();\n\t\tfor (const listener of [...this.goneListeners]) listener(error);\n\t}\n\n\tshapeChanged(): void {\n\t\tfor (const readable of this.readables.values()) readable.bind();\n\t\tconst shape = this.shape;\n\t\tif (shape === undefined) return;\n\t\tconst listeners = [...this.shapeListeners];\n\t\tenqueue(() => {\n\t\t\tfor (const listener of listeners) {\n\t\t\t\ttry {\n\t\t\t\t\tlistener(shape);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tthis.record.host.report(error);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\tterminalError(): unknown {\n\t\treturn this.status === \"gone\" ? this.error : new ChordError(\"released\", `handle ${this.address} released`);\n\t}\n\n\t/** The behavior as this consumer sees it (through an accepts adapter when bound to another version). */\n\tviewOf(installed: Installed): Record<string, unknown> {\n\t\tlet adapter = this.bindings.get(installed.service);\n\t\tif (!this.bindings.has(installed.service)) {\n\t\t\tadapter = bind(installed.service.contract, installed.service.options.accepts, this.contract);\n\t\t\tthis.bindings.set(installed.service, adapter);\n\t\t}\n\t\tif (adapter === undefined) return installed.behavior;\n\t\tlet view = this.views.get(installed.behavior);\n\t\tif (view === undefined) {\n\t\t\tview = adapter(installed.behavior);\n\t\t\tthis.views.set(installed.behavior, view);\n\t\t}\n\t\treturn view;\n\t}\n\n\tcurrentView(): Record<string, unknown> | undefined {\n\t\tif (this.status !== \"live\") return undefined;\n\t\tconst installed = this.record.currentInstalled();\n\t\treturn installed === undefined ? undefined : this.#safeView(installed);\n\t}\n\n\t/** The view, or undefined when this consumer no longer binds (reported; calls reject with the bind error). */\n\t#safeView(installed: Installed): Record<string, unknown> | undefined {\n\t\ttry {\n\t\t\treturn this.viewOf(installed);\n\t\t} catch (error) {\n\t\t\tthis.record.host.report(error);\n\t\t\treturn undefined;\n\t\t}\n\t}\n\n\tdescribe(kind: string | undefined, member: string): MemberDescription | undefined {\n\t\tconst variants = this.contract.description.variants;\n\t\tif (kind !== undefined) return variants[kind]?.[member];\n\t\tfor (const members of Object.values(variants)) if (members[member] !== undefined) return members[member];\n\t\treturn undefined;\n\t}\n\n\t/** Remote consumers see only the members their contract lists for the current variant. */\n\tinVariant(view: Record<string, unknown>, name: string): boolean {\n\t\treturn this.contract.scope !== \"remote\" || this.describe(kindOf(view), name) !== undefined;\n\t}\n\n\tmember(name: string): unknown {\n\t\tconst declared = this.describe(undefined, name);\n\t\tconst view = this.currentView();\n\t\tconst value = view?.[name];\n\t\tif (declared?.kind === \"method\" || (declared === undefined && typeof value === \"function\")) {\n\t\t\treturn this.caller(name);\n\t\t}\n\t\tif (declared?.kind === \"state\" || (declared === undefined && (isSource(value) || isReadableLike(value)))) {\n\t\t\tlet readable = this.readables.get(name);\n\t\t\tif (readable === undefined) {\n\t\t\t\treadable = new MemberReadable(this, name);\n\t\t\t\tthis.readables.set(name, readable);\n\t\t\t}\n\t\t\treturn readable;\n\t\t}\n\t\tif (view === undefined || !this.inVariant(view, name)) return undefined;\n\t\treturn value instanceof ExposedImpl ? value.resource.value : value;\n\t}\n\n\tcaller(name: string): (args: unknown, ctx?: Ctx) => Promise<unknown> {\n\t\tlet caller = this.callers.get(name);\n\t\tif (caller === undefined) {\n\t\t\tcaller = (args, ctx) => {\n\t\t\t\tif (this.record.host.inFactory > 0) {\n\t\t\t\t\tthrow new ChordError(\"not_ready\", `${this.address}.${name} called inside a factory`);\n\t\t\t\t}\n\t\t\t\tif (ctx !== undefined && !(ctx instanceof CtxImpl)) {\n\t\t\t\t\treturn Promise.reject(invalid(\"foreign_ctx\", \"ctx must come from a Chord host\"));\n\t\t\t\t}\n\t\t\t\tif (ctx === undefined || ctx.holder) {\n\t\t\t\t\t// A code holder (task) starts a fresh root per call, cancelled with the holder.\n\t\t\t\t\ttry {\n\t\t\t\t\t\tctx?.check(this.record.host);\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\treturn Promise.reject(error);\n\t\t\t\t\t}\n\t\t\t\t\treturn this.record.host.root((root) => this.record.call(this, name, args, root as CtxImpl), {\n\t\t\t\t\t\tsignal: ctx?.signal,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn this.record.call(this, name, args, ctx);\n\t\t\t};\n\t\t\tthis.callers.set(name, caller);\n\t\t}\n\t\treturn caller;\n\t}\n\n\t#stopReadables(): void {\n\t\tfor (const readable of this.readables.values()) readable.stop();\n\t}\n}\n\nexport const kindOf = (behavior: Record<string, unknown>): string | undefined =>\n\ttypeof behavior.kind === \"string\" ? behavior.kind : undefined;\n\n// ─── Records ─────────────────────────────────────────────────────────────────\n\nexport type RecordStatus = \"activating\" | \"live\" | \"failed\" | \"disposing\" | \"disposed\";\n\ninterface Gate {\n\treadonly grandfathered: Set<string>;\n\treadonly queue: { readonly key: string; readonly event: unknown }[];\n\tdrained: () => void;\n}\n\ninterface Subscription {\n\t/** What the listener was declared on: the resource (not its facade), or the source itself. */\n\treadonly origin: unknown;\n\treadonly select: ListenerDecl[\"select\"];\n\tunsubscribe: () => void;\n}\n\n/**\n * Two `select` functions are the same if they are identical or have the same source text: an inline arrow is a new\n * object on every factory run, but its code is what matters. (A select whose behavior depends on captured values\n * that change between runs is not detected; such a listener keeps its old subscription until its source changes.)\n */\nconst sameSelect = (a: ListenerDecl[\"select\"], b: ListenerDecl[\"select\"]): boolean =>\n\ta === b || (a !== undefined && b !== undefined && String(a) === String(b));\n\n/** Listener subscriptions made ahead of a commit: `activate` switches over, `discard` drops them. */\nexport interface StagedListeners {\n\tactivate(): void;\n\tdiscard(): void;\n}\n\ninterface RunningTask {\n\treadonly controller: AbortController;\n\treadonly done: Promise<void>;\n}\n\nexport interface RecordIdentity {\n\treadonly address: string;\n\treadonly typeName: string;\n\treadonly input: unknown;\n\treadonly principal: Principal;\n\treadonly eager: boolean;\n}\n\nexport class RecordImpl {\n\treadonly host: HostCore;\n\treadonly address: string;\n\treadonly typeName: string;\n\treadonly input: unknown;\n\treadonly principal: Principal;\n\treadonly eager: boolean;\n\tstatus: RecordStatus = \"activating\";\n\tready: Promise<void> = Promise.resolve();\n\tservice: Service | undefined;\n\tstateVersion = 0;\n\t/** Calls carrying an older epoch are rejected upgrade_conflict (state bump or exclusive resource replaced). */\n\tminEpoch = 0;\n\tdecls = new Decls();\n\t/** Declarations of a factory run that has not been installed yet (activation or reload candidate). */\n\treadonly pending = new Set<Decls>();\n\treadonly behaviors = new Map<number, Installed>();\n\treadonly holds = new Set<HandleImpl>();\n\treadonly leases = new Map<string, number>();\n\treadonly openOrder: ResourceImpl[] = [];\n\treadonly callAbort = new AbortController();\n\treadonly activationAbort = new AbortController();\n\tgate: Gate | undefined;\n\t/** Served only by a running reload's pending epoch: listeners, tasks and registrations start at its commit. */\n\tdeferredRuntime = false;\n\treadonly #subscriptions = new Map<string, Subscription>();\n\treadonly #invocations = new Set<Promise<unknown>>();\n\t#tasks = new Map<string, RunningTask>();\n\treadonly #stopped: Promise<void>[] = [];\n\t#linger: ReturnType<typeof setTimeout> | undefined;\n\t#disposal: Promise<void> | undefined;\n\n\tconstructor(host: HostCore, identity: RecordIdentity) {\n\t\tthis.host = host;\n\t\tthis.address = identity.address;\n\t\tthis.typeName = identity.typeName;\n\t\tthis.input = identity.input;\n\t\tthis.principal = identity.principal;\n\t\tthis.eager = identity.eager;\n\t}\n\n\tstart(after: Promise<void> | undefined): void {\n\t\tthis.ready = this.#activate(after).then(\n\t\t\t() => {\n\t\t\t\tfor (const handle of this.holds) handle.live();\n\t\t\t\tthis.#maybeIdle();\n\t\t\t},\n\t\t\t(cause: unknown) => {\n\t\t\t\tif (this.status === \"activating\") this.status = \"failed\";\n\t\t\t\tthis.host.forget(this);\n\t\t\t\t// A ChordError (forbidden, a dependency's error, ...) keeps its code; anything else is `unavailable`.\n\t\t\t\tconst error = asChordError(cause, `activating ${this.address}`);\n\t\t\t\tfor (const handle of this.holds) handle.gone(error);\n\t\t\t\tthrow error;\n\t\t\t},\n\t\t);\n\t\tthis.ready.catch(noop);\n\t}\n\n\t/**\n\t * Activation as one transaction: factory, opens, then a synchronous finalization (registry check and publication,\n\t * behaviors, runtime). Every failure, including one during finalization or a release while listeners start,\n\t * unwinds everything this activation did.\n\t */\n\tasync #activate(after: Promise<void> | undefined): Promise<void> {\n\t\tawait after?.catch(noop);\n\t\tconst signal = this.activationAbort.signal;\n\t\tconst abandoned = (): ChordError => new ChordError(\"aborted\", `${this.address} abandoned`);\n\t\tif (signal.aborted) throw abandoned();\n\t\tconst service = this.host.service(this.typeName);\n\t\tif (service === undefined)\n\t\t\tthrow new ChordError(\"unavailable\", `${this.typeName} is not served`, { reason: \"unknown_type\" });\n\t\tthis.service = service;\n\t\tthis.stateVersion = service.stateVersion;\n\t\tconst run = this.run(service, undefined);\n\t\ttry {\n\t\t\tawait this.open(run.created.resources, run.created.holds, signal);\n\t\t\tif (signal.aborted) throw abandoned();\n\t\t\tthis.host.checkRegistrations(this, run.decls);\n\t\t\tthis.decls = run.decls;\n\t\t\tfor (const [retained, services] of this.host.retainedEpochs()) {\n\t\t\t\tif (services.get(this.typeName) === service) {\n\t\t\t\t\tthis.behaviors.set(retained, { epoch: retained, service, behavior: run.behavior, decls: run.decls });\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst pending = this.host.pendingEpoch();\n\t\t\tif (!this.behaviors.has(this.host.currentEpoch()) && (pending === undefined || !this.behaviors.has(pending))) {\n\t\t\t\tthrow new ChordError(\"superseded\", `${this.address}: code changed during activation`);\n\t\t\t}\n\t\t\tfor (const derived of run.created.derives) derived.attach();\n\t\t\tthis.refreshSchemas();\n\t\t\t// Served only by a running reload's pending epoch: new code must not run (listeners, tasks, registrations)\n\t\t\t// before that reload commits.\n\t\t\tthis.deferredRuntime = !this.behaviors.has(this.host.currentEpoch());\n\t\t\tif (!this.deferredRuntime) {\n\t\t\t\tif (run.decls.registrations.size > 0) this.host.registriesChanged(this);\n\t\t\t\tthis.startRuntime();\n\t\t\t}\n\t\t\t// A listener starting up may have released the last hold synchronously: no resurrection.\n\t\t\tif (signal.aborted) throw abandoned();\n\t\t\tthis.status = \"live\";\n\t\t} catch (error) {\n\t\t\t// Invocations started during finalization (listener roots) end before their resources close.\n\t\t\tthis.callAbort.abort(error);\n\t\t\tthis.stopListeners();\n\t\t\tthis.stopTasks();\n\t\t\tconst registered = this.decls.registrations.size > 0 && !this.deferredRuntime;\n\t\t\tthis.behaviors.clear();\n\t\t\tthis.decls = new Decls();\n\t\t\tif (registered) this.host.registriesChanged();\n\t\t\tawait Promise.allSettled([...this.#invocations, ...this.#stopped.splice(0)]);\n\t\t\tawait this.unwind(run).catch((cleanup: unknown) => this.host.report(cleanup));\n\t\t\tthrow error;\n\t\t} finally {\n\t\t\tthis.pending.delete(run.decls);\n\t\t}\n\t}\n\n\t/**\n\t * Runs the factory synchronously. With `previous`, runs in recording mode for a reload prepare. The run's\n\t * declarations stay in `pending` (visible to the cycle check) until the caller installs or discards them.\n\t */\n\trun(service: Service, previous: Decls | undefined): Run {\n\t\tconst self = new SelfImpl(this, previous);\n\t\tconst discard = (run: Run): void => {\n\t\t\tthis.pending.delete(run.decls);\n\t\t\tvoid this.unwind(run).catch((cleanup: unknown) => this.host.report(cleanup));\n\t\t};\n\t\tthis.pending.add(self.run(undefined).decls);\n\t\tthis.host.inFactory++;\n\t\tlet behavior: unknown;\n\t\ttry {\n\t\t\tbehavior = service.factory(this.input, this.principal, self);\n\t\t} catch (error) {\n\t\t\tthis.host.inFactory--;\n\t\t\tdiscard(self.run(undefined));\n\t\t\tthrow error;\n\t\t}\n\t\tthis.host.inFactory--;\n\t\tconst run = self.run(behavior);\n\t\ttry {\n\t\t\tif (behavior instanceof Promise) throw invalid(\"behavior\", `${this.typeName}: factories must be synchronous`);\n\t\t\tvalidateBehavior(service, run.behavior);\n\t\t} catch (error) {\n\t\t\tdiscard(run);\n\t\t\tthrow error;\n\t\t}\n\t\treturn run;\n\t}\n\n\t/** Opens resources (dependencies first) and waits for holds; settles all before failing. */\n\tasync open(resources: readonly ResourceImpl[], holds: readonly Hold[], signal: AbortSignal): Promise<void> {\n\t\tconst opening = new Map<ResourceImpl, Promise<void>>();\n\t\tconst openOne = (resource: ResourceImpl): Promise<void> => {\n\t\t\tlet promise = opening.get(resource);\n\t\t\tif (promise === undefined) {\n\t\t\t\tpromise = (async () => {\n\t\t\t\t\tawait Promise.all(\n\t\t\t\t\t\tresource.deps.map((dep) =>\n\t\t\t\t\t\t\t!(dep instanceof ResourceImpl) ? dep.ready : resources.includes(dep) ? openOne(dep) : undefined,\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\t\tawait resource.open(signal, this.openOrder);\n\t\t\t\t})();\n\t\t\t\topening.set(resource, promise);\n\t\t\t}\n\t\t\treturn promise;\n\t\t};\n\t\tconst results = await Promise.allSettled([...resources.map(openOne), ...holds.map((hold) => hold.ready)]);\n\t\tconst failure = results.find((result) => result.status === \"rejected\");\n\t\tif (failure !== undefined) throw failure.reason;\n\t}\n\n\t/** Undoes the objects a run created: closes its resources (reverse order) and releases its holds. */\n\tasync unwind(run: Run): Promise<void> {\n\t\tfor (const derived of run.created.derives) derived.detach();\n\t\tconst resources = [...run.created.resources].sort(\n\t\t\t(a, b) => this.openOrder.indexOf(b) - this.openOrder.indexOf(a),\n\t\t);\n\t\tawait runAll(\n\t\t\t[\n\t\t\t\t...resources.map((resource) => () => resource.close(this.openOrder)),\n\t\t\t\t...run.created.holds.map((hold) => () => hold.release()),\n\t\t\t],\n\t\t\t`${this.address}: cleanup failed`,\n\t\t);\n\t}\n\n\tcurrentInstalled(): Installed | undefined {\n\t\treturn this.behaviors.get(this.host.currentEpoch()) ?? [...this.behaviors.values()].at(-1);\n\t}\n\n\t/** Every state source exposed as a remote state member gets that member's schema (checked per write in dev mode). */\n\trefreshSchemas(): void {\n\t\tconst schemas = new Map<Readable<unknown>, TSchema[]>();\n\t\tfor (const installed of this.behaviors.values()) {\n\t\t\tfor (const [source, list] of memberSchemas(installed.service, installed.behavior)) {\n\t\t\t\tschemas.set(source, [...(schemas.get(source) ?? []), ...list]);\n\t\t\t}\n\t\t}\n\t\tfor (const decls of this.allDecls()) {\n\t\t\tfor (const source of [...decls.cells.values(), ...decls.derives.values()])\n\t\t\t\tsource.schemas = schemas.get(source) ?? [];\n\t\t}\n\t}\n\n\tallDecls(): Set<Decls> {\n\t\tconst result = new Set<Decls>([this.decls, ...this.pending]);\n\t\tfor (const installed of this.behaviors.values()) result.add(installed.decls);\n\t\treturn result;\n\t}\n\n\t// ─── runtime: listeners and tasks of the current declarations ───\n\n\t/** The resource a listener is declared on, or its source itself. */\n\t#origin(decl: ListenerDecl): unknown {\n\t\treturn resourceOf(decl.source) ?? decl.source;\n\t}\n\n\t/** Resolves a listener's subscribable: `select(resource value)`, `select(source)` or the source itself. */\n\t#listenSource(key: string, decl: ListenerDecl): Subscribable<unknown> {\n\t\tconst resource = resourceOf(decl.source);\n\t\tconst value = resource === undefined ? decl.source : resource.value;\n\t\tconst source = (decl.select === undefined ? value : decl.select(value as never)) as Subscribable<unknown>;\n\t\tif (typeof source?.subscribe !== \"function\")\n\t\t\tthrow invalid(\"behavior\", `listener ${key}: source has no subscribe()`);\n\t\treturn source;\n\t}\n\n\t/**\n\t * Subscribes the listeners of `decls` without delivering: events are buffered until `activate`. A listener declared\n\t * on the same resource (or source) with the same `select` keeps its subscription without calling `select` again\n\t * (only its function is swapped, by name), so sources that accept a single subscriber survive reloads. Throws, with\n\t * nothing left subscribed, if any source fails.\n\t */\n\tstageListeners(decls: Decls): StagedListeners {\n\t\tconst fresh = new Map<string, Subscription & { buffer: unknown[] | undefined }>();\n\t\tconst kept = new Set<string>();\n\t\ttry {\n\t\t\tfor (const [key, decl] of decls.listeners) {\n\t\t\t\tconst origin = this.#origin(decl);\n\t\t\t\tconst previous = this.#subscriptions.get(key);\n\t\t\t\tif (previous !== undefined && previous.origin === origin && sameSelect(previous.select, decl.select)) {\n\t\t\t\t\tkept.add(key);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst source = this.#listenSource(key, decl);\n\t\t\t\tconst entry: Subscription & { buffer: unknown[] | undefined } = {\n\t\t\t\t\torigin,\n\t\t\t\t\tselect: decl.select,\n\t\t\t\t\tunsubscribe: noop,\n\t\t\t\t\tbuffer: [],\n\t\t\t\t};\n\t\t\t\tfresh.set(key, entry);\n\t\t\t\tentry.unsubscribe = source.subscribe((event) => {\n\t\t\t\t\tif (entry.buffer !== undefined) entry.buffer.push(event);\n\t\t\t\t\telse this.#deliver(key, event);\n\t\t\t\t});\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tfor (const entry of fresh.values()) entry.unsubscribe();\n\t\t\tthrow error;\n\t\t}\n\t\treturn {\n\t\t\tactivate: () => {\n\t\t\t\tfor (const [key, subscription] of this.#subscriptions) {\n\t\t\t\t\tif (kept.has(key)) continue;\n\t\t\t\t\tsubscription.unsubscribe();\n\t\t\t\t\tthis.#subscriptions.delete(key);\n\t\t\t\t}\n\t\t\t\tfor (const [key, entry] of fresh) {\n\t\t\t\t\tthis.#subscriptions.set(key, entry);\n\t\t\t\t\tconst buffered = entry.buffer ?? [];\n\t\t\t\t\tentry.buffer = undefined;\n\t\t\t\t\tfor (const event of buffered) this.#deliver(key, event);\n\t\t\t\t}\n\t\t\t},\n\t\t\tdiscard: () => {\n\t\t\t\tfor (const entry of fresh.values()) entry.unsubscribe();\n\t\t\t},\n\t\t};\n\t}\n\n\tstartRuntime(): void {\n\t\tthis.stageListeners(this.decls).activate();\n\t\tthis.startTasks();\n\t}\n\n\tstartTasks(): void {\n\t\tfor (const key of this.decls.tasks.keys()) this.startTask(key, this.host.currentEpoch());\n\t}\n\n\tstopListeners(): void {\n\t\tfor (const subscription of this.#subscriptions.values()) subscription.unsubscribe();\n\t\tthis.#subscriptions.clear();\n\t}\n\n\tstartTask(key: string, epoch: number): void {\n\t\tconst fn = this.decls.tasks.get(key);\n\t\tif (fn === undefined) return;\n\t\tconst controller = new AbortController();\n\t\tconst ctx = new CtxImpl(this.host, {\n\t\t\tsignal: AbortSignal.any([controller.signal, this.callAbort.signal]),\n\t\t\trootId: `task:${this.address}:${key}`,\n\t\t\tepoch,\n\t\t\tprincipal: this.host.principal,\n\t\t\tholder: true,\n\t\t});\n\t\tconst done = (async () => {\n\t\t\ttry {\n\t\t\t\tawait fn(ctx);\n\t\t\t} catch (error) {\n\t\t\t\tif (!ctx.signal.aborted) this.host.report(error);\n\t\t\t} finally {\n\t\t\t\tctx.close();\n\t\t\t\tif (this.#tasks.get(key)?.controller === controller) this.#tasks.delete(key);\n\t\t\t}\n\t\t})();\n\t\tthis.#tasks.set(key, { controller, done });\n\t}\n\n\t/** Aborts running tasks; their completion is awaited at disposal. */\n\tstopTasks(): void {\n\t\tfor (const task of this.#tasks.values()) {\n\t\t\ttask.controller.abort(new ChordError(\"aborted\", \"task stopped\"));\n\t\t\tthis.#stopped.push(task.done);\n\t\t}\n\t\tthis.#tasks.clear();\n\t}\n\n\t/**\n\t * Delivers one listener event, in publication order. The invocation is a root that holds a lease on this record\n\t * (a reload gate waits for it like for any other root that touched the record), counts as an invocation (disposal\n\t * waits for it) and is cancelled by forced disposal.\n\t */\n\t#deliver(key: string, event: unknown): void {\n\t\tenqueue(() => {\n\t\t\tif (this.gate !== undefined) {\n\t\t\t\tthis.gate.queue.push({ key, event });\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst decl = this.decls.listeners.get(key);\n\t\t\tif (decl === undefined || (this.status !== \"live\" && this.status !== \"activating\")) return;\n\t\t\tconst invocation = this.host.root((root) => {\n\t\t\t\tthis.lease(root);\n\t\t\t\tconst child = (root as CtxImpl).child(this);\n\t\t\t\treturn this.#invoke(async () => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait decl.fn(event, child);\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tchild.close();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t\tinvocation.catch((error: unknown) => this.host.report(error));\n\t\t});\n\t}\n\n\t/** Opens the record's gate and replays queued listener events through the current listeners. */\n\topenGate(): void {\n\t\tconst gate = this.gate;\n\t\tthis.gate = undefined;\n\t\tfor (const { key, event } of gate?.queue ?? []) this.#deliver(key, event);\n\t}\n\n\t// ─── calls ───\n\n\t/** Admission for a call or write carrying `ctx`. */\n\tadmit(ctx: Ctx): void {\n\t\tif (this.host.failed !== undefined) {\n\t\t\tthrow new ChordError(\"unavailable\", `${this.host.name} failed and admits no work`, { reason: \"host_failed\" });\n\t\t}\n\t\tif (!this.host.hasEpoch(ctx.epoch)) throw new ChordError(\"superseded\", `epoch ${ctx.epoch} is retired`);\n\t\tif (ctx.epoch < this.minEpoch) {\n\t\t\tthrow new ChordError(\"upgrade_conflict\", `${this.address} was upgraded in epoch ${this.minEpoch}`);\n\t\t}\n\t\tif (this.gate !== undefined && !this.gate.grandfathered.has(ctx.rootId)) {\n\t\t\tthrow new ChordError(\"upgrade_conflict\", `${this.address} is being upgraded`);\n\t\t}\n\t}\n\n\t/** Records that the root of `ctx` touched this record (a reload gate grandfathers it). */\n\tlease(ctx: Ctx): void {\n\t\tif (this.leases.has(ctx.rootId)) return;\n\t\tthis.leases.set(ctx.rootId, ctx.epoch);\n\t\tthis.host.touch(ctx.rootId, this);\n\t}\n\n\tguard = (ctx: Ctx): void => {\n\t\tif (this.host.inFactory > 0) throw invalid(\"read_only\", \"cells cannot be written while a factory runs\");\n\t\tif (ctx instanceof CtxImpl) ctx.check(this.host);\n\t\tif (ctx.signal.aborted) throw new ChordError(\"aborted\", \"write with an aborted ctx\");\n\t\tif (this.status === \"disposed\") throw new ChordError(\"gone\", `${this.address} is disposed`);\n\t\tif (ctx.rootId.startsWith(\"task:\")) return;\n\t\tthis.admit(ctx);\n\t};\n\n\tasync call(handle: HandleImpl, name: string, args: unknown, ctx: CtxImpl): Promise<unknown> {\n\t\tctx.check(this.host);\n\t\tif (handle.status === \"released\" || handle.status === \"gone\") throw handle.terminalError();\n\t\tif (handle.status === \"loading\") await raceSignal(handle.ready, ctx.signal);\n\t\tif (handle.status !== \"live\" || this.status !== \"live\") {\n\t\t\tthrow handle.status === \"live\"\n\t\t\t\t? new ChordError(\"gone\", `${this.address} is ${this.status}`)\n\t\t\t\t: handle.terminalError();\n\t\t}\n\t\tthis.admit(ctx);\n\t\tconst installed = this.behaviors.get(ctx.epoch);\n\t\tif (installed === undefined)\n\t\t\tthrow new ChordError(\"superseded\", `${this.address} has no behavior for epoch ${ctx.epoch}`);\n\t\tconst view = handle.viewOf(installed);\n\t\tconst kind = kindOf(view);\n\t\tconst wanted = handle.describe(handle.contract.scope === \"remote\" ? kind : LOCAL_VARIANT, name);\n\t\tconst fn = view[name];\n\t\tif (typeof fn !== \"function\" || (handle.contract.scope === \"remote\" && wanted?.kind !== \"method\")) {\n\t\t\tthrow new ChordError(\n\t\t\t\t\"not_in_variant\",\n\t\t\t\t`${this.address}: ${name} is not a method of variant ${kind ?? \"(local)\"}`,\n\t\t\t);\n\t\t}\n\t\tconst direct = view === installed.behavior;\n\t\tconst schema = direct ? installed.service.contract.description.variants[kind ?? LOCAL_VARIANT]?.[name] : wanted;\n\t\tconst validated = handle.contract.scope === \"remote\" && schema?.kind === \"method\" ? schema : undefined;\n\t\t// The additive rule assumes a consumer sends only what its own schema knows, and a provider sees only what its\n\t\t// schema knows: strip with both before validating.\n\t\tconst own = handle.contract.scope === \"remote\" && wanted?.kind === \"method\" ? wanted.args : undefined;\n\t\tconst sent = own === undefined ? args : Value.Clean(own, Value.Clone(args));\n\t\tconst input = validated ? Value.Clean(validated.args, Value.Clone(sent)) : sent;\n\t\tif (validated) assertValid(\"args\", `${this.address}.${name} args`, validated.args, input);\n\t\tthis.lease(ctx);\n\t\tconst child = ctx.child(this);\n\t\tlet result: unknown;\n\t\ttry {\n\t\t\tresult = await this.#invoke(() => (fn as (args: unknown, ctx: Ctx) => unknown)(input, child));\n\t\t} finally {\n\t\t\tchild.close();\n\t\t}\n\t\tif (validated) assertValid(\"result\", `${this.address}.${name} result`, validated.result, result);\n\t\treturn result;\n\t}\n\n\t/** Runs an invocation (method or listener) that keeps the record alive until it settles. */\n\t#invoke<T>(fn: () => T | Promise<T>): Promise<T> {\n\t\tconst invocation = (async () => fn())();\n\t\tthis.#invocations.add(invocation);\n\t\tconst done = (): void => {\n\t\t\tthis.#invocations.delete(invocation);\n\t\t\tif (this.#invocations.size === 0) this.#maybeIdle();\n\t\t};\n\t\tinvocation.then(done, done);\n\t\treturn invocation;\n\t}\n\n\trootEnded(rootId: string): void {\n\t\tthis.leases.delete(rootId);\n\t\tconst gate = this.gate;\n\t\tif (gate?.grandfathered.delete(rootId) && gate.grandfathered.size === 0) gate.drained();\n\t}\n\n\t// ─── lifetime ───\n\n\taddHold(handle: HandleImpl): void {\n\t\tthis.holds.add(handle);\n\t\tif (this.#linger !== undefined) clearTimeout(this.#linger);\n\t\tthis.#linger = undefined;\n\t}\n\n\trelease(handle: HandleImpl): void {\n\t\tif (this.holds.delete(handle)) this.#maybeIdle();\n\t}\n\n\t/** No holds and no invocations: dispose (after `linger` for a live record). */\n\t#maybeIdle(): void {\n\t\tif (this.holds.size > 0 || this.#invocations.size > 0 || this.#linger !== undefined) return;\n\t\tif (this.status === \"activating\") {\n\t\t\tthis.#background(this.dispose(false));\n\t\t\treturn;\n\t\t}\n\t\tif (this.status !== \"live\") return;\n\t\tconst linger = this.service?.options.linger ?? 0;\n\t\tif (linger <= 0) {\n\t\t\tthis.#background(this.dispose(false));\n\t\t\treturn;\n\t\t}\n\t\tthis.#linger = setTimeout(() => {\n\t\t\tthis.#linger = undefined;\n\t\t\tif (this.holds.size === 0 && this.#invocations.size === 0 && this.status === \"live\") {\n\t\t\t\tthis.#background(this.dispose(false));\n\t\t\t}\n\t\t}, linger);\n\t\tthis.#linger.unref?.();\n\t}\n\n\t#background(disposal: Promise<void>): void {\n\t\tdisposal.catch((error: unknown) => this.host.report(error));\n\t}\n\n\t/**\n\t * Disposes the record. Forced: handles become gone at once (new calls are rejected) and running invocations are\n\t * cancelled. Either way, resources close only after every invocation settled.\n\t */\n\tdispose(forced: boolean, reason?: unknown): Promise<void> {\n\t\tthis.#disposal ??= this.#dispose(forced, reason);\n\t\treturn this.#disposal;\n\t}\n\n\tasync #dispose(forced: boolean, reason: unknown): Promise<void> {\n\t\tconst wasActivating = this.status === \"activating\";\n\t\tthis.status = \"disposing\";\n\t\tthis.host.forget(this);\n\t\tif (this.#linger !== undefined) clearTimeout(this.#linger);\n\t\tthis.#linger = undefined;\n\t\tconst error = reason ?? new ChordError(\"gone\", `${this.address} was disposed`);\n\t\tif (forced) {\n\t\t\tfor (const handle of this.holds) handle.gone(error);\n\t\t\tthis.callAbort.abort(error);\n\t\t}\n\t\tthis.activationAbort.abort(error);\n\t\tif (wasActivating) await this.ready.catch(noop);\n\t\tfor (const handle of this.holds) handle.gone(error);\n\t\tconst decls = this.allDecls();\n\t\tthis.stopTasks();\n\t\tthis.stopListeners();\n\t\tawait Promise.allSettled([...this.#invocations]);\n\t\tconst registered = [...decls].some((set) => set.registrations.size > 0) && !this.deferredRuntime;\n\t\tthis.behaviors.clear();\n\t\tthis.decls = new Decls();\n\t\tif (registered) this.host.registriesChanged();\n\t\tconst holds = new Set<Hold>();\n\t\tfor (const set of decls) {\n\t\t\tfor (const derived of set.derives.values()) derived.detach();\n\t\t\tfor (const hold of set.holds.values()) holds.add(hold);\n\t\t}\n\t\ttry {\n\t\t\tawait runAll(\n\t\t\t\t[\n\t\t\t\t\t() => Promise.allSettled(this.#stopped.splice(0)),\n\t\t\t\t\t...[...this.openOrder].reverse().map((resource) => () => resource.close(this.openOrder)),\n\t\t\t\t\t...[...holds].map((hold) => () => hold.release()),\n\t\t\t\t],\n\t\t\t\t`${this.address}: disposal failed`,\n\t\t\t);\n\t\t} finally {\n\t\t\tthis.status = \"disposed\";\n\t\t}\n\t}\n}\n\nconst isReadableLike = (value: unknown): boolean =>\n\tvalue !== null &&\n\ttypeof value === \"object\" &&\n\ttypeof (value as Readable<unknown>).events === \"function\" &&\n\ttypeof (value as Readable<unknown>).subscribe === \"function\";\n\n/** The remote state-member schemas a behavior exposes, by source. */\nexport function memberSchemas(service: Service, behavior: Record<string, unknown>): Map<Readable<unknown>, TSchema[]> {\n\tconst schemas = new Map<Readable<unknown>, TSchema[]>();\n\tconst contract = service.contract;\n\tif (contract.scope !== \"remote\") return schemas;\n\tconst members = contract.description.variants[kindOf(behavior) ?? \"\"] ?? {};\n\tfor (const [name, description] of Object.entries(members)) {\n\t\tconst source = behavior[name];\n\t\tif (description.kind !== \"state\" || !isSource(source)) continue;\n\t\tschemas.set(source, [...(schemas.get(source) ?? []), description.schema]);\n\t}\n\treturn schemas;\n}\n\nfunction validateBehavior(service: Service, behavior: Record<string, unknown>): void {\n\tconst contract = service.contract;\n\tconst fail = (message: string): never => {\n\t\tthrow invalid(\"behavior\", `${contract.name}: ${message}`);\n\t};\n\tif (behavior === null || typeof behavior !== \"object\") fail(\"factory must return an object\");\n\tlet members: Readonly<Record<string, MemberDescription>>;\n\tif (contract.scope === \"remote\") {\n\t\tconst kind = behavior.kind;\n\t\tif (typeof kind !== \"string\" || contract.description.variants[kind] === undefined)\n\t\t\tfail(`unknown variant ${String(kind)}`);\n\t\tmembers = contract.description.variants[kind as string]!;\n\t\tfor (const key of Object.keys(behavior))\n\t\t\tif (key !== \"kind\" && members[key] === undefined) fail(`${key} is not in variant ${String(kind)}`);\n\t} else {\n\t\tmembers = contract.description.variants[LOCAL_VARIANT] ?? {};\n\t}\n\tfor (const [name, description] of Object.entries(members)) {\n\t\tconst value = behavior[name];\n\t\tif (description.kind === \"method\" && typeof value !== \"function\") fail(`${name} must be a method`);\n\t\tif (description.kind === \"state\" && !isSource(value) && !isReadableLike(value)) {\n\t\t\tfail(`${name} must be a cell, a derivation or a held object's state member`);\n\t\t}\n\t\tif (description.kind === \"opaque\" && value === undefined) fail(`${name} is missing`);\n\t}\n}\n\n// ─── The factory's `self` ────────────────────────────────────────────────────\n\nclass SelfImpl implements Self {\n\treadonly #record: RecordImpl;\n\treadonly #previous: Decls | undefined;\n\treadonly #decls = new Decls();\n\treadonly #created: { holds: Hold[]; resources: ResourceImpl[]; derives: Derived<unknown>[] } = {\n\t\tholds: [],\n\t\tresources: [],\n\t\tderives: [],\n\t};\n\n\tconstructor(record: RecordImpl, previous: Decls | undefined) {\n\t\tthis.#record = record;\n\t\tthis.#previous = previous;\n\t}\n\n\trun(behavior: unknown): Run {\n\t\treturn { behavior: behavior as Record<string, unknown>, decls: this.#decls, created: this.#created };\n\t}\n\n\t/** Iterates named declarations of one kind, rejecting repeated names and wrong descriptors. */\n\t*#entries<T>(\n\t\tmap: ReadonlyMap<string, unknown>,\n\t\tkind: string,\n\t\tentries: Readonly<Record<string, T>>,\n\t\tdescriptor?: string,\n\t) {\n\t\tif (entries === null || typeof entries !== \"object\")\n\t\t\tthrow new TypeError(`${kind} takes an object of named declarations`);\n\t\tfor (const [name, value] of Object.entries(entries)) {\n\t\t\tif (map.has(name)) throw invalid(\"duplicate\", `${this.#record.typeName}: duplicate ${kind} name ${name}`);\n\t\t\tif (descriptor !== undefined && declKind(value) !== descriptor) {\n\t\t\t\tthrow new TypeError(`${kind}.${name} must be declared with ${descriptor}()`);\n\t\t\t}\n\t\t\tyield [name, value] as const;\n\t\t}\n\t}\n\n\tstate<const D extends Readonly<Record<string, CellDecl<unknown>>>>(cells: D): Cells<D> {\n\t\tconst result: Record<string, Cell<unknown>> = {};\n\t\tconst host = this.#record.host;\n\t\tfor (const [name, decl] of this.#entries(this.#decls.cells, \"state\", cells, \"cell\")) {\n\t\t\tconst cell =\n\t\t\t\tthis.#previous?.cells.get(name) ??\n\t\t\t\tnew Cell(name, decl.schema, decl.initial, this.#record.guard, {\n\t\t\t\t\tdev: host.dev,\n\t\t\t\t\treport: (error) => host.report(error),\n\t\t\t\t});\n\t\t\tthis.#decls.cells.set(name, cell);\n\t\t\tthis.#decls.cellSchemas.set(name, decl.schema);\n\t\t\tresult[name] = cell;\n\t\t}\n\t\treturn result as Cells<D>;\n\t}\n\n\tget<C extends AnyContract>(type: C, input: InputOf<C>, options?: GetOptions): Handle<C> {\n\t\tconst host = this.#record.host;\n\t\t// A prepare rerun (recording mode) binds new holds against the reload's pending contracts: a breaking provider\n\t\t// change and its updated consumer reload together.\n\t\tconst candidate = this.#previous !== undefined;\n\t\tconst address = host.addressOf(type, input, options?.principal ?? host.principal, options?.at, candidate);\n\t\tconst declared = this.#decls.holds.get(address);\n\t\tif (declared !== undefined) {\n\t\t\tif (declared.contract.fingerprint !== type.fingerprint) {\n\t\t\t\tthrow invalid(\"duplicate\", `${this.#record.typeName}: ${type.name} held twice with different contracts`);\n\t\t\t}\n\t\t\treturn declared.proxy as Handle<C>;\n\t\t}\n\t\tconst existing = this.#previous?.holds.get(address);\n\t\tif (\n\t\t\texisting !== undefined &&\n\t\t\texisting.contract.fingerprint === type.fingerprint &&\n\t\t\texisting.status !== \"gone\" &&\n\t\t\texisting.status !== \"released\"\n\t\t) {\n\t\t\tthis.#decls.holds.set(address, existing);\n\t\t\treturn existing.proxy as Handle<C>;\n\t\t}\n\t\tconst handle = host.acquire(type, input, options, \"record\", this.#record, candidate);\n\t\tthis.#decls.holds.set(address, handle);\n\t\tthis.#created.holds.push(handle);\n\t\treturn handle.proxy as Handle<C>;\n\t}\n\n\tresources<const D extends Readonly<Record<string, ResourceDecl<unknown>>>>(resources: D): Resources<D> {\n\t\tconst result: Record<string, ResourceImpl> = {};\n\t\tfor (const [name, { spec }] of this.#entries(this.#decls.resources, \"resources\", resources, \"resource\")) {\n\t\t\tconst deps = (spec.deps ?? []).map((dep) => {\n\t\t\t\tconst resolved = handleOf(dep) ?? resourceOf(dep);\n\t\t\t\tif (resolved === undefined) {\n\t\t\t\t\tthrow new TypeError(`resource ${name}: deps must be handles or resources of this record`);\n\t\t\t\t}\n\t\t\t\treturn resolved;\n\t\t\t});\n\t\t\tconst existing = this.#previous?.resources.get(name);\n\t\t\tconst kept =\n\t\t\t\texisting !== undefined &&\n\t\t\t\texisting.spec.rev === spec.rev &&\n\t\t\t\texisting.exclusive === (spec.exclusive === true) &&\n\t\t\t\texisting.deps.length === deps.length &&\n\t\t\t\texisting.deps.every((dep, index) => dep === deps[index]);\n\t\t\tconst resource = kept ? existing : new ResourceImpl(name, spec, deps);\n\t\t\tif (!kept) this.#created.resources.push(resource);\n\t\t\tthis.#decls.resources.set(name, resource);\n\t\t\tresult[name] = new ResourceFacade(resource, this.#record.host) as unknown as ResourceImpl;\n\t\t}\n\t\treturn result as unknown as Resources<D>;\n\t}\n\n\tlisten(listeners: Readonly<Record<string, ListenerDecl>>): void {\n\t\tfor (const [name, decl] of this.#entries(this.#decls.listeners, \"listen\", listeners, \"listener\")) {\n\t\t\tthis.#decls.listeners.set(name, decl);\n\t\t}\n\t}\n\n\ttasks(tasks: Readonly<Record<string, (ctx: Ctx) => Promise<void>>>): void {\n\t\tfor (const [name, fn] of this.#entries(this.#decls.tasks, \"tasks\", tasks)) {\n\t\t\tif (typeof fn !== \"function\") throw new TypeError(`tasks.${name} must be a function`);\n\t\t\tthis.#decls.tasks.set(name, fn);\n\t\t}\n\t}\n\n\tderive<const D extends Readonly<Record<string, DerivationDecl<unknown>>>>(derivations: D): Derivations<D> {\n\t\tconst result: Record<string, Derived<unknown>> = {};\n\t\tconst host = this.#record.host;\n\t\tfor (const [name, { sources, fn }] of this.#entries(this.#decls.derives, \"derive\", derivations, \"derivation\")) {\n\t\t\tconst existing = this.#previous?.derives.get(name);\n\t\t\tlet derived: Derived<unknown>;\n\t\t\tif (\n\t\t\t\texisting !== undefined &&\n\t\t\t\texisting.sources.length === sources.length &&\n\t\t\t\texisting.sources.every((source, index) => source === sources[index])\n\t\t\t) {\n\t\t\t\tderived = existing;\n\t\t\t} else {\n\t\t\t\tderived = new Derived(name, sources, fn, { dev: host.dev, report: (error) => host.report(error) });\n\t\t\t\tthis.#created.derives.push(derived);\n\t\t\t}\n\t\t\tthis.#decls.derives.set(name, derived);\n\t\t\tthis.#decls.deriveFns.set(name, fn);\n\t\t\tresult[name] = derived;\n\t\t}\n\t\treturn result as unknown as Derivations<D>;\n\t}\n\n\texpose<T>(resource: Resource<T>): Exposed<T> {\n\t\tconst resolved = resourceOf(resource);\n\t\tif (resolved === undefined || ![...this.#decls.resources.values()].includes(resolved)) {\n\t\t\tthrow new TypeError(\"expose takes a resource declared by this record\");\n\t\t}\n\t\treturn new ExposedImpl(resolved) as unknown as Exposed<T>;\n\t}\n\n\tregister<V>(registry: Registry<V>, entries: Readonly<Record<string, V>>): void {\n\t\tif (!this.#record.eager) throw invalid(\"not_eager\", `${this.#record.typeName}: only eager records may register`);\n\t\tconst prefixed: Record<string, V> = {};\n\t\tfor (const [key, value] of Object.entries(entries)) prefixed[`${registry.name}\\u0000${key}`] = value;\n\t\tfor (const [id, value] of this.#entries(this.#decls.registrations, \"register\", prefixed)) {\n\t\t\tthis.#decls.registrations.set(id, {\n\t\t\t\tregistry: registry as Registry<unknown>,\n\t\t\t\tkey: id.slice(registry.name.length + 1),\n\t\t\t\tvalue,\n\t\t\t});\n\t\t}\n\t}\n}\n"]}
@@ -0,0 +1,25 @@
1
+ import type { Ctx } from "./types.ts";
2
+ export interface Registry<V> {
3
+ readonly name: string;
4
+ readonly conflict: "error" | "last";
5
+ /** Type carrier only; never set. */
6
+ readonly value?: V;
7
+ }
8
+ /** `conflict: "error"` rejects two records registering one key; `"last"` keeps the later registration. */
9
+ export declare const defineRegistry: <V>(name: string, options?: {
10
+ conflict?: "error" | "last";
11
+ }) => Registry<V>;
12
+ export type RegistryTable<V> = ReadonlyMap<string, V>;
13
+ export interface RegistryView<V> {
14
+ /** Table of `ctx.epoch`, or of the current epoch without ctx. */
15
+ table(ctx?: Ctx): RegistryTable<V>;
16
+ get(key: string, ctx?: Ctx): V | undefined;
17
+ /** Called with the current table immediately and whenever a new table is installed. */
18
+ subscribe(listener: (table: RegistryTable<V>, epoch: number) => void): () => void;
19
+ }
20
+ export interface Registration {
21
+ readonly registry: Registry<unknown>;
22
+ readonly key: string;
23
+ readonly value: unknown;
24
+ }
25
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,WAAW,QAAQ,CAAC,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC;IACpC,oCAAoC;IACpC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;CACnB;AAED,0GAA0G;AAC1G,eAAO,MAAM,cAAc,GAAI,CAAC,QAAQ,MAAM,YAAW;IAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;CAAE,KAAQ,QAAQ,CAAC,CAAC,CAGxG,CAAC;AAEH,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;AAEtD,MAAM,WAAW,YAAY,CAAC,CAAC;IAC9B,iEAAiE;IACjE,KAAK,CAAC,GAAG,CAAC,EAAE,GAAG,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;IACnC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,GAAG,CAAC,GAAG,SAAS,CAAC;IAC3C,uFAAuF;IACvF,SAAS,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;CAClF;AAED,MAAM,WAAW,YAAY;IAC5B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;IACrC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACxB"}
@@ -0,0 +1,6 @@
1
+ /** `conflict: "error"` rejects two records registering one key; `"last"` keeps the later registration. */
2
+ export const defineRegistry = (name, options = {}) => ({
3
+ name,
4
+ conflict: options.conflict ?? "error",
5
+ });
6
+ //# sourceMappingURL=registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AASA,0GAA0G;AAC1G,MAAM,CAAC,MAAM,cAAc,GAAG,CAAI,IAAY,EAAE,OAAO,GAAoC,EAAE,EAAe,EAAE,CAAC,CAAC;IAC/G,IAAI;IACJ,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,OAAO;CACrC,CAAC,CAAC","sourcesContent":["import type { Ctx } from \"./types.ts\";\n\nexport interface Registry<V> {\n\treadonly name: string;\n\treadonly conflict: \"error\" | \"last\";\n\t/** Type carrier only; never set. */\n\treadonly value?: V;\n}\n\n/** `conflict: \"error\"` rejects two records registering one key; `\"last\"` keeps the later registration. */\nexport const defineRegistry = <V>(name: string, options: { conflict?: \"error\" | \"last\" } = {}): Registry<V> => ({\n\tname,\n\tconflict: options.conflict ?? \"error\",\n});\n\nexport type RegistryTable<V> = ReadonlyMap<string, V>;\n\nexport interface RegistryView<V> {\n\t/** Table of `ctx.epoch`, or of the current epoch without ctx. */\n\ttable(ctx?: Ctx): RegistryTable<V>;\n\tget(key: string, ctx?: Ctx): V | undefined;\n\t/** Called with the current table immediately and whenever a new table is installed. */\n\tsubscribe(listener: (table: RegistryTable<V>, epoch: number) => void): () => void;\n}\n\nexport interface Registration {\n\treadonly registry: Registry<unknown>;\n\treadonly key: string;\n\treadonly value: unknown;\n}\n"]}
@@ -0,0 +1,118 @@
1
+ import type { Cell } from "./cell.ts";
2
+ import { ChordError } from "./errors.ts";
3
+ import type { Facet, HostImpl, PluginRef } from "./host.ts";
4
+ import { type RecordImpl, type ResourceImpl, type Run, type Service, type StagedListeners } from "./record.ts";
5
+ import type { RegistryTable } from "./registry.ts";
6
+ export interface ReloadOptions {
7
+ /** Facet names to remove. */
8
+ readonly remove?: readonly string[];
9
+ /** Milliseconds the gate waits for grandfathered roots (default 5000). Missed: the reload aborts. */
10
+ readonly gateDeadline?: number;
11
+ /** Milliseconds to wait for the previous epoch to retire first (default 5000). Missed: it is retired anyway. */
12
+ readonly retireDeadline?: number;
13
+ /** Server: facet modules for child hosts by host-name prefix (longest wins). Every connected host participates. */
14
+ readonly remote?: Readonly<Record<string, readonly string[]>>;
15
+ /** Server: facet names to remove on child hosts, by the same host-name prefix rules. */
16
+ readonly remoteRemove?: Readonly<Record<string, readonly string[]>>;
17
+ /** Server: milliseconds to wait for every child's vote (default: gate + retire deadlines + 5000). */
18
+ readonly voteDeadline?: number;
19
+ }
20
+ export interface ReloadReport {
21
+ readonly epoch: number;
22
+ readonly previous: number;
23
+ readonly changed: readonly string[];
24
+ readonly removed: readonly string[];
25
+ /** Addresses of records whose new factory was installed. */
26
+ readonly prepared: readonly string[];
27
+ /** Addresses of records that went through the gate. */
28
+ readonly gated: readonly string[];
29
+ /**
30
+ * Cluster reloads: what each participating child host prepared, by host name (its vote; the child commits it after
31
+ * the server). Absent for local reloads.
32
+ */
33
+ readonly children?: Readonly<Record<string, ReloadReport>>;
34
+ }
35
+ interface Candidate {
36
+ readonly record: RecordImpl;
37
+ readonly service: Service;
38
+ readonly run: Run;
39
+ /** Why the record needs the gate (empty: compatible). */
40
+ readonly reasons: string[];
41
+ /** New exclusive resources and their new dependents, opened at the gate. */
42
+ readonly atGate: ResourceImpl[];
43
+ /** Old exclusive resources closed at the gate. */
44
+ readonly replaced: ResourceImpl[];
45
+ readonly migrated: Map<Cell<unknown>, unknown>;
46
+ /** Values of the run's derivations over the candidate (migrated) values, validated. */
47
+ derived: Map<unknown, unknown>;
48
+ /** Listener subscriptions made at the end of prepare, activated by the commit. */
49
+ staged: StagedListeners | undefined;
50
+ }
51
+ /** A reload error keeps the underlying code (`contract_mismatch`, `invalid`, ...) and says it aborted the reload. */
52
+ export declare function reloadError(error: unknown): ChordError;
53
+ /** Serialized: a second reload while one runs is rejected. */
54
+ export declare function runReload(host: HostImpl, plugins: readonly PluginRef[], options: ReloadOptions): Promise<ReloadReport>;
55
+ /** Takes the host's reload slot and loads the plugin modules. Pair with `endReload`. */
56
+ export declare function beginReload(host: HostImpl, plugins: readonly PluginRef[], options: ReloadOptions, epoch?: number): Promise<Reload>;
57
+ export declare function endReload(host: HostImpl): void;
58
+ /** One reload on one host: `prepare` (load, prepare, gate), then `commit` or `rollback`. */
59
+ export declare class Reload {
60
+ #private;
61
+ readonly host: HostImpl;
62
+ readonly facets: readonly Facet[];
63
+ readonly options: ReloadOptions;
64
+ /** Epoch id to commit (issued by the coordinating server); a local reload allocates one. */
65
+ readonly epoch: number | undefined;
66
+ readonly candidates: Map<RecordImpl, Candidate>;
67
+ readonly abort: AbortController;
68
+ readonly closed: [RecordImpl, ResourceImpl][];
69
+ services: Map<string, Service>;
70
+ changed: Set<string>;
71
+ removed: Set<string>;
72
+ tables: Map<string, RegistryTable<unknown>>;
73
+ gated: Candidate[];
74
+ rolledBack: boolean;
75
+ /** Records of types this reload adds, with their staged listeners: their runtime starts at commit. */
76
+ readonly deferred: Map<RecordImpl, StagedListeners>;
77
+ constructor(host: HostImpl, facets: readonly Facet[], options: ReloadOptions, epoch?: number);
78
+ /** Everything up to the commit. On failure the host is rolled back and the underlying error is thrown. */
79
+ prepare(): Promise<void>;
80
+ /** What a successful prepare will commit (a child sends it with its vote). */
81
+ summary(): ReloadReport;
82
+ waitForRetirement(): Promise<void>;
83
+ /** Builds the candidate service table: unchanged services plus everything the given facets serve. */
84
+ load(): void;
85
+ withDeadline<T>(promise: Promise<T>, what: string): Promise<T>;
86
+ /** Same contract version must cover the old description (forgotten bump); facets' `uses` must bind. */
87
+ checkProviders(): void;
88
+ /**
89
+ * Prepares every live record of a changed type, including records that activate meanwhile, to a fixpoint. Records
90
+ * already running the new code (types this reload adds) are skipped.
91
+ */
92
+ prepareAll(): Promise<void>;
93
+ /** Runs the new factory in recording mode and opens what can be opened without the gate. */
94
+ prepareRecord(record: RecordImpl): Promise<void>;
95
+ /**
96
+ * Every hold that survives into the new epoch must bind to the new provider. Browser holds don't block a reload:
97
+ * after the commit they get `upgrade_required` instead.
98
+ */
99
+ checkHolds(): void;
100
+ entries(): [RecordImpl, Run["decls"]][];
101
+ /**
102
+ * Admission cut, wait for grandfathered roots (deadline), replace exclusive resources, migrate into private
103
+ * copies. Old tasks of gated records are stopped at the cut; listener events are queued until commit or abort.
104
+ */
105
+ gate(): Promise<void>;
106
+ migrate(candidate: Candidate): void;
107
+ rollback(): Promise<void>;
108
+ /**
109
+ * Publishes the new epoch in one synchronous step. Everything fallible ran in prepare (factories, opens, migration
110
+ * and derivation checks against the prospective schemas, listener subscriptions), so this only installs. Observers
111
+ * (state, shapes, registries, listener roots) are notified after the whole step. If an install still throws, the
112
+ * epoch is half-published: the host fails terminally and admits no more work.
113
+ */
114
+ commit(beforeStart?: () => void): ReloadReport;
115
+ install(candidate: Candidate, epoch: number): void;
116
+ }
117
+ export {};
118
+ //# sourceMappingURL=reload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reload.d.ts","sourceRoot":"","sources":["../src/reload.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAgB,UAAU,EAAW,MAAM,aAAa,CAAC;AAChE,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