@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":"host.js","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC9E,OAAO,EAAsB,UAAU,EAAoC,MAAM,iBAAiB,CAAC;AACnG,OAAO,EAEN,IAAI,GAOJ,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EACN,OAAO,EAGP,UAAU,EAIV,WAAW,EACX,UAAU,GAGV,MAAM,aAAa,CAAC;AAErB,OAAO,EAAyC,SAAS,EAAE,MAAM,aAAa,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAIrF,qCAAqC;AACrC,MAAM,CAAC,MAAM,aAAa,GAAc,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;AAgDtE,MAAM,CAAC,MAAM,WAAW,GAAG,CAC1B,KAA8B,EAC9B,OAAO,GAA+C,EAAE,EACtC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;AAQtD,MAAM,OAAO,GAAG,CAAC,GAAc,EAAgB,EAAE,CAAC,OAAO,GAAG,KAAK,QAAQ,IAAI,CAAC,CAAC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AAW,GAAG,CAAC,IAAY,EAAE,IAAY,EAAc,EAAE,CAC9D,IAAI,UAAU,CAAC,aAAa,EAAE,GAAG,IAAI,qBAAqB,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC,CAAC;AAE/F,oGAAoG;AACpG,SAAS,OAAO,CAAC,IAAgB,EAAE,EAAc;IAChD,MAAM,IAAI,GAAG,IAAI,GAAG,EAAc,CAAC;IACnC,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,CAAC;IACrB,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACzB,MAAM,MAAM,GAAG,KAAK,CAAC,GAAG,EAAG,CAAC;QAC5B,IAAI,MAAM,KAAK,EAAE;YAAE,OAAO,IAAI,CAAC;QAC/B,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC;YAAE,SAAS;QAC/B,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACjB,mFAAmF;QACnF,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC;YACvC,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE;gBAAE,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS;oBAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACjG,CAAC;IACF,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC","sourcesContent":["import { ChildReloads, reconcileChild, runClusterReload } from \"./cluster.ts\";\nimport { type AcceptOptions, Connection, type LinkOptions, type RelayHold } from \"./connection.ts\";\nimport {\n\ttype AnyContract,\n\tbind,\n\ttype Handle,\n\ttype InputOf,\n\ttype LocalContract,\n\ttype LocalDef,\n\ttype RemoteContract,\n\ttype RemoteDef,\n} from \"./contract.ts\";\nimport { ChordError, invalid, runAll } from \"./errors.ts\";\nimport type { Link } from \"./link.ts\";\nimport { enqueue } from \"./publish.ts\";\nimport {\n\tCtxImpl,\n\ttype Decls,\n\ttype Factory,\n\tHandleImpl,\n\ttype Hold,\n\ttype HoldOwner,\n\ttype HostCore,\n\tmakeService,\n\tRecordImpl,\n\ttype ServeOptions,\n\ttype Service,\n} from \"./record.ts\";\nimport type { Registry, RegistryTable, RegistryView } from \"./registry.ts\";\nimport { type ReloadOptions, type ReloadReport, runReload } from \"./reload.ts\";\nimport { RemoteHandle } from \"./remote.ts\";\nimport { canonicalIdentity, canonicalJson, deepEqual, normalize } from \"./schema.ts\";\nimport type { Ctx, GetOptions, Principal } from \"./types.ts\";\nimport type { Frame } from \"./wire.ts\";\n\n/** The principal of in-host code. */\nexport const hostPrincipal: Principal = Object.freeze({ host: true });\n\n/**\n * Registers a factory for a type. Overloaded on the contract's definition (not the contract type) so TypeScript\n * keeps literal `kind`s in factory returns.\n */\nexport interface Serve {\n\t<D extends RemoteDef>(\n\t\ttype: RemoteContract<D>,\n\t\tfactory: Factory<RemoteContract<D>>,\n\t\toptions?: ServeOptions<RemoteContract<D>>,\n\t): void;\n\t<D extends LocalDef>(\n\t\ttype: LocalContract<D>,\n\t\tfactory: Factory<LocalContract<D>>,\n\t\toptions?: ServeOptions<LocalContract<D>>,\n\t): void;\n}\n\ntype AnyServe = (type: AnyContract, factory: Factory<AnyContract>, options?: ServeOptions) => void;\n\n/**\n * What a facet's `setup` gets. `serve` registers types; `root` and `registry` give the facet's code that is not a\n * Chord method, listener or task (Durable tools and hooks, callbacks of native libraries) access to its own host,\n * so plugins never need a process-global host. Both may be kept and used after `setup` returns.\n */\nexport interface FacetApi {\n\treadonly serve: Serve;\n\t/** The host's name (`server`, `session:S1`, ...). */\n\treadonly name: string;\n\t/** Starts a root on the facet's host (in its current epoch at call time). */\n\troot<T>(fn: (ctx: Ctx) => T | Promise<T>, options?: RootOptions): Promise<T>;\n\t/** The facet's host's registry view (`get(key, ctx)` reads the table of `ctx.epoch`). */\n\tregistry<V>(registry: Registry<V>): RegistryView<V>;\n}\n\n/** What a facet module exports (default export): the code that serves its types on one host kind. */\nexport interface FacetDefinition {\n\t/** Contract tokens this facet consumes; checked against providers at reload. */\n\treadonly uses?: readonly AnyContract[];\n\tsetup(api: FacetApi): void;\n}\n\n/** A named facet. Modules are named by their URL; reloading a facet replaces everything it served. */\nexport interface Facet extends FacetDefinition {\n\treadonly name: string;\n}\n\nexport const defineFacet = (\n\tsetup: (api: FacetApi) => void,\n\toptions: { readonly uses?: readonly AnyContract[] } = {},\n): FacetDefinition => ({ setup, uses: options.uses });\n\n/** Imports facet modules (fresh copies on every call) and names them by module URL. */\nexport type FacetLoader = (modules: readonly (string | URL)[]) => Promise<Facet[]>;\n\n/** A facet object, or a module (path or URL) whose default export is a FacetDefinition. */\nexport type PluginRef = Facet | string | URL;\n\nconst isFacet = (ref: PluginRef): ref is Facet => typeof ref === \"object\" && !(ref instanceof URL);\n\nexport interface HostOptions {\n\treadonly name?: string;\n\t/** Maps a principal to its record key (should include connection provenance and grant revision). */\n\treadonly principalKey?: (principal: Principal) => string;\n\t/** Validates every cell write and exposed state value against its schemas. */\n\treadonly dev?: boolean;\n\t/** Errors from background work (disposal, listeners, tasks). Defaults to console.error. */\n\treadonly onError?: (error: unknown) => void;\n\t/** Needed for `load`/`reload` with modules; `nodeLoader` from loader.ts in Node. */\n\treadonly loader?: FacetLoader;\n\t/** `client` (browser): never a reload participant, never carries roots or epochs. Default `host`. */\n\treadonly kind?: \"host\" | \"client\";\n\t/** The link to this host's parent (server). Can also be set later with `connect`. */\n\treadonly upstream?: Link;\n\treadonly upstreamOptions?: LinkOptions;\n}\n\n/** Where requests for hosts named `prefix…` go (on the server). */\nexport interface Route {\n\t/** Checked before resolving (or spawning) and again after: grants may change meanwhile. */\n\tauthorize(principal: Principal, hostName: string): boolean | Promise<boolean>;\n\t/** A link to the host, spawned if needed. */\n\tresolve(hostName: string): Promise<Link>;\n\t/** Principal the resolved host acts as when it calls back (default `{ host: hostName }`). */\n\treadonly principal?: (hostName: string) => Principal;\n}\n\n/** `invalidatePrincipal` matches: a predicate (this host only), or a pattern (fields that must be equal; propagates). */\nexport type PrincipalMatch = ((principal: Principal) => boolean) | Readonly<Record<string, unknown>>;\n\nexport interface RootOptions {\n\treadonly principal?: Principal;\n\treadonly signal?: AbortSignal;\n\t/** Start the root in a retained epoch (links carry epochs). Defaults to the current epoch. */\n\treadonly epoch?: number;\n}\n\nexport interface LoadOptions {\n\t/** Await eager activation (default true). False starts it but leaves readiness to `host.ready()`. */\n\treadonly awaitEager?: boolean;\n}\n\nexport interface Host {\n\treadonly name: string;\n\treadonly epoch: number;\n\treadonly previousEpoch: number | undefined;\n\treadonly serve: Serve;\n\t/** Installs synchronously, then awaits this facet's eager objects unless `awaitEager` is false. */\n\tinstall(facet: Facet, options?: LoadOptions): Promise<void>;\n\t/** Installs all facets before awaiting their eager objects; lazy objects stay lazy. */\n\tload(plugins: readonly PluginRef[], options?: LoadOptions): Promise<void>;\n\t/** Awaits the eager holds present at call time, including those started by `serve` or deferred loads. */\n\tready(): Promise<void>;\n\tget<C extends AnyContract>(type: C, input: InputOf<C>, options?: GetOptions): Handle<C>;\n\troot<T>(fn: (ctx: Ctx) => T | Promise<T>, options?: RootOptions): Promise<T>;\n\tregistry<V>(registry: Registry<V>): RegistryView<V>;\n\t/**\n\t * Force-disposes every record whose principal matches (never the host principal), re-stamps or closes matching\n\t * links, and propagates pattern matches to child hosts.\n\t */\n\tinvalidatePrincipal(match: PrincipalMatch): Promise<void>;\n\t/** Accepts a child link (a worker or a browser); requests on it act as `options.principal`. */\n\taccept(link: Link, options: AcceptOptions): void;\n\t/** Sets (or replaces, after a reconnect) the link to this host's parent; remote handles re-hold over it. */\n\tconnect(link: Link, options?: LinkOptions): void;\n\troute(prefix: string, route: Route): void;\n\t/** Reloads the given facets (modules are re-imported); facets not listed keep running unchanged. */\n\treload(plugins: readonly PluginRef[], options?: ReloadOptions): Promise<ReloadReport>;\n\tclose(): Promise<void>;\n}\n\nexport interface EpochState {\n\treadonly id: number;\n\treadonly services: Map<string, Service>;\n\ttables: ReadonlyMap<string, RegistryTable<unknown>>;\n\t/** Running roots with the number of their calls running here. */\n\treadonly roots: Map<string, number>;\n}\n\nconst EMPTY_TABLE: RegistryTable<never> = new Map<string, never>();\n\nexport function createHost(options: HostOptions = {}): Host {\n\treturn new HostImpl(options);\n}\n\nexport class HostImpl implements Host, HostCore {\n\treadonly name: string;\n\treadonly dev: boolean;\n\treadonly principal: Principal = hostPrincipal;\n\tinFactory = 0;\n\tfailed: unknown;\n\treadonly records = new Map<string, RecordImpl>();\n\treadonly epochs = new Map<number, EpochState>();\n\treadonly facets = new Map<string, Facet>();\n\treadonly eager = new Map<string, Hold>();\n\treadonly kind: \"host\" | \"client\";\n\treadonly connections = new Set<Connection>();\n\tupstream: Connection | undefined;\n\t/** Remote handles this host holds (re-held after an upstream reconnect). */\n\treadonly remotes = new Set<RemoteHandle>();\n\treadonly #routes = new Map<string, Route>();\n\treadonly #childReloads = new ChildReloads(this);\n\t/** Child facet modules by host-name prefix, from every committed cluster reload (for reconciling children). */\n\tremoteModules: Record<string, string[]> = {};\n\t/** Removal tombstones also reconcile children that connected during a transaction. */\n\tremoteRemoved: Record<string, string[]> = {};\n\t/** Highest epoch the parent has retired. */\n\t#retireAllowed = 0;\n\t/** Roots that came over a link, by the link they came from. */\n\t/** Foreign roots (started on another host), by the links they came over. */\n\treadonly #foreign = new Map<string, Set<Connection>>();\n\t/** Roots started on this host that have not ended. */\n\treadonly #local = new Set<string>();\n\treadonly #incarnation = Math.random().toString(36).slice(2, 8);\n\t/** Links each root's calls went out on. */\n\treadonly #rootLinks = new Map<string, Set<Connection>>();\n\tcurrent: EpochState;\n\tprevious: EpochState | undefined;\n\t/** The epoch a running reload will commit; new types activated during prepare install their behavior for it. */\n\tpending: EpochState | undefined;\n\t/** Activations of these types wait (reload gate). */\n\t/** Types behind a reload gate: new records of these types are rejected `upgrade_conflict` until commit/abort. */\n\tgating: ReadonlySet<string> | undefined;\n\treloading = false;\n\tretired: () => void = () => {};\n\treadonly #principalKey: (principal: Principal) => string;\n\treadonly #onError: (error: unknown) => void;\n\treadonly #loader: FacetLoader | undefined;\n\treadonly #dying = new Map<string, RecordImpl>();\n\treadonly #touches = new Map<string, Set<RecordImpl>>();\n\treadonly #order = new Map<string, Map<string, number>>();\n\treadonly #subscribers = new Map<string, Set<(table: RegistryTable<unknown>, epoch: number) => void>>();\n\t#epochSeq = 1;\n\t#rootSeq = 0;\n\n\tconstructor(options: HostOptions) {\n\t\tthis.name = options.name ?? \"host\";\n\t\tthis.dev = options.dev ?? false;\n\t\tthis.#principalKey = options.principalKey ?? canonicalJson;\n\t\tthis.#onError = options.onError ?? ((error) => console.error(\"chord:\", error));\n\t\tthis.#loader = options.loader;\n\t\tthis.current = { id: this.#epochSeq, services: new Map(), tables: new Map(), roots: new Map() };\n\t\tthis.epochs.set(this.current.id, this.current);\n\t\tthis.kind = options.kind ?? \"host\";\n\t\tif (options.upstream !== undefined) this.connect(options.upstream, options.upstreamOptions);\n\t}\n\n\tget epoch(): number {\n\t\treturn this.current.id;\n\t}\n\n\tget previousEpoch(): number | undefined {\n\t\treturn this.previous?.id;\n\t}\n\n\t/** Allocates the next epoch id, or adopts one issued by the coordinating server. */\n\tnextEpochId(given?: number): number {\n\t\tif (given !== undefined && given <= this.current.id)\n\t\t\tthrow new Error(`epoch ${given} is not newer than ${this.current.id}`);\n\t\tthis.#epochSeq = given ?? this.#epochSeq + 1;\n\t\treturn this.#epochSeq;\n\t}\n\n\treport(error: unknown): void {\n\t\tthis.#onError(error);\n\t}\n\n\t// ─── serving ───\n\n\treadonly serve: Serve = ((type, factory, options = {}) => {\n\t\tif (this.reloading) throw new Error(\"host.serve during a reload; serve from a facet passed to reload()\");\n\t\tthis.serveInto(this.current.services, makeService(type, factory, options, \"\"));\n\t\tif (options.eager) this.startEager(this.current.services.get(type.name)!);\n\t}) satisfies AnyServe as Serve;\n\n\tinstall(facet: Facet, options: LoadOptions = {}): Promise<void> {\n\t\tif (this.reloading) throw new Error(\"host.install during a reload\");\n\t\tif (this.facets.has(facet.name)) throw new Error(`facet ${facet.name} is already installed; use reload()`);\n\t\tconst added: Service[] = [];\n\t\tfacet.setup(\n\t\t\tthis.facetApi(((type, factory, options = {}) => {\n\t\t\t\tconst service = makeService(type, factory, options, facet.name);\n\t\t\t\tthis.serveInto(this.current.services, service);\n\t\t\t\tadded.push(service);\n\t\t\t}) satisfies AnyServe as Serve),\n\t\t);\n\t\tthis.facets.set(facet.name, facet);\n\t\tconst holds = added.filter((service) => service.options.eager).map((service) => this.startEager(service));\n\t\treturn options.awaitEager === false ? Promise.resolve() : this.#eagerReady(holds);\n\t}\n\n\tasync load(plugins: readonly PluginRef[], options: LoadOptions = {}): Promise<void> {\n\t\tconst facets = await this.resolve(plugins);\n\t\t// No await between installs: an eager factory may consume a type served by a later facet.\n\t\tawait Promise.all(facets.map((facet) => this.install(facet, options)));\n\t}\n\n\tready(): Promise<void> {\n\t\treturn this.#eagerReady(this.eager.values());\n\t}\n\n\t#eagerReady(holds: Iterable<Hold>): Promise<void> {\n\t\tconst ready = Promise.all([...holds].map((hold) => hold.ready)).then(() => {});\n\t\t// Ignoring install's return still reports through onError without an unhandled rejection.\n\t\tready.catch(() => {});\n\t\treturn ready;\n\t}\n\n\t/** Turns plugin references into facets, importing modules through the loader. */\n\tasync resolve(plugins: readonly PluginRef[]): Promise<Facet[]> {\n\t\tconst modules = plugins.filter((ref): ref is string | URL => !isFacet(ref));\n\t\tif (modules.length > 0 && this.#loader === undefined) {\n\t\t\tthrow new Error(\n\t\t\t\t\"loading modules needs createHost({ loader }), e.g. nodeLoader from @earendil-works/chord/node\",\n\t\t\t);\n\t\t}\n\t\tconst loaded = modules.length > 0 && this.#loader !== undefined ? await this.#loader(modules) : [];\n\t\treturn plugins.map((ref) => (isFacet(ref) ? ref : loaded.shift()!));\n\t}\n\n\tfacetApi(serve: Serve): FacetApi {\n\t\treturn {\n\t\t\tserve,\n\t\t\tname: this.name,\n\t\t\troot: (fn, options) => this.root(fn, options),\n\t\t\tregistry: (registry) => this.registry(registry),\n\t\t};\n\t}\n\n\tserveInto(services: Map<string, Service>, service: Service): void {\n\t\tif (services.has(service.contract.name)) throw new Error(`${service.contract.name} is already served`);\n\t\tservices.set(service.contract.name, service);\n\t}\n\n\tstartEager(service: Service): Hold {\n\t\tconst eager = service.options.eager;\n\t\tconst input = typeof eager === \"object\" ? eager.input : {};\n\t\tconst handle = this.acquire(service.contract, input, undefined, \"host\");\n\t\tthis.eager.set(service.contract.name, handle);\n\t\thandle.ready.catch((error: unknown) => this.report(error));\n\t\treturn handle;\n\t}\n\n\t// ─── HostCore ───\n\n\tcurrentEpoch(): number {\n\t\treturn this.current.id;\n\t}\n\n\thasEpoch(epoch: number): boolean {\n\t\treturn this.epochs.has(epoch);\n\t}\n\n\t*retainedEpochs(): Iterable<readonly [number, ReadonlyMap<string, Service>]> {\n\t\tfor (const [id, state] of this.epochs) yield [id, state.services];\n\t\tif (this.pending !== undefined) yield [this.pending.id, this.pending.services];\n\t}\n\n\tpendingEpoch(): number | undefined {\n\t\treturn this.pending?.id;\n\t}\n\n\t/** The current code for a type; a type a running reload adds is served from the pending epoch. */\n\tservice(typeName: string): Service | undefined {\n\t\treturn this.current.services.get(typeName) ?? this.pending?.services.get(typeName);\n\t}\n\n\taddressOf(type: AnyContract, input: unknown, principal: Principal, at?: string, candidate = false): string {\n\t\tif (at !== undefined && at !== this.name)\n\t\t\treturn remoteAddress(at, type, input, principal === this.principal ? undefined : principal);\n\t\tconst service = this.#bindingService(type.name, candidate);\n\t\tif (service === undefined) throw unknownType(type.name, this.name);\n\t\tconst normalized = normalize(service.contract.input, input, `${type.name} input`);\n\t\treturn this.#address(service, normalized, principal);\n\t}\n\n\t#address(service: Service, normalized: unknown, principal: Principal): string {\n\t\tconst key = principal === this.principal ? \"host\" : `p:${this.#principalKey(principal)}`;\n\t\treturn `${service.contract.name}\\u0000${canonicalIdentity(service.contract.input, normalized)}\\u0000${key}`;\n\t}\n\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 = false,\n\t): Hold {\n\t\tif (options?.at !== undefined && options.at !== this.name)\n\t\t\treturn this.#acquireRemote(type, input, options, owner);\n\t\tconst service = this.#bindingService(type.name, candidate);\n\t\tif (service === undefined) throw unknownType(type.name, this.name);\n\t\tbind(service.contract, service.options.accepts, type);\n\t\tconst principal = options?.principal ?? this.principal;\n\t\tconst normalized = normalize(service.contract.input, input, `${type.name} input`);\n\t\tconst address = this.#address(service, normalized, principal);\n\t\tlet record = this.records.get(address);\n\t\tif (from !== undefined && record !== undefined && (record === from || reaches(record, from))) {\n\t\t\tthrow invalid(\"cycle\", `${from.address} -> ${address} would create a hold cycle`);\n\t\t}\n\t\tif (record === undefined) {\n\t\t\tif (this.gating?.has(type.name)) {\n\t\t\t\tthrow new ChordError(\"upgrade_conflict\", `${type.name} is being upgraded; retry`, { reason: \"gate\" });\n\t\t\t}\n\t\t\tconst dying = this.#dying.get(address);\n\t\t\tif (dying?.status === \"disposed\") this.#dying.delete(address);\n\t\t\trecord = new RecordImpl(this, {\n\t\t\t\taddress,\n\t\t\t\ttypeName: type.name,\n\t\t\t\tinput: normalized,\n\t\t\t\tprincipal,\n\t\t\t\teager:\n\t\t\t\t\tservice.options.eager !== undefined && service.options.eager !== false && principal === this.principal,\n\t\t\t});\n\t\t\tthis.records.set(address, record);\n\t\t\t// A new record for an address still being disposed waits for that cleanup (exclusive resources).\n\t\t\trecord.start(dying?.status === \"disposing\" ? dying.dispose(false) : undefined);\n\t\t}\n\t\tconst handle = new HandleImpl(record, type, owner);\n\t\trecord.addHold(handle);\n\t\treturn handle;\n\t}\n\n\tforget(record: RecordImpl): void {\n\t\tif (this.records.get(record.address) === record) this.records.delete(record.address);\n\t\tif (record.status === \"disposing\") this.#dying.set(record.address, record);\n\t}\n\n\ttouch(rootId: string, record: RecordImpl): void {\n\t\tlet touched = this.#touches.get(rootId);\n\t\tif (touched === undefined) {\n\t\t\ttouched = new Set();\n\t\t\tthis.#touches.set(rootId, touched);\n\t\t}\n\t\ttouched.add(record);\n\t}\n\n\t// ─── roots ───\n\n\tasync root<T>(fn: (ctx: Ctx) => T | Promise<T>, options: RootOptions = {}): Promise<T> {\n\t\t// The incarnation keeps root ids unique across restarts of a host with the same name.\n\t\tconst rootId = `${this.name}#${this.#incarnation}:${++this.#rootSeq}`;\n\t\tthis.#local.add(rootId);\n\t\treturn this.joinRoot(rootId, options.epoch ?? this.current.id, fn, options);\n\t}\n\n\t/**\n\t * Runs `fn` inside root `rootId` of `epoch`. A root counts as running here (for retirement) while any of its calls\n\t * runs here. A root that started here ends when its last call here settles, even if it went out and came back\n\t * over a link meanwhile. A foreign root (started elsewhere, arriving `from` a link) keeps its leases on records\n\t * until every link it came over announced its end (`root_end`) or closed, so its re-entry stays grandfathered.\n\t */\n\tasync joinRoot<T>(\n\t\trootId: string,\n\t\tepochId: number,\n\t\tfn: (ctx: Ctx) => T | Promise<T>,\n\t\toptions: { readonly principal?: Principal; readonly signal?: AbortSignal; readonly from?: Connection } = {},\n\t): Promise<T> {\n\t\tconst epoch = this.epochs.get(epochId);\n\t\tif (epoch === undefined) {\n\t\t\tthis.#local.delete(rootId);\n\t\t\tthrow new ChordError(\"superseded\", `epoch ${epochId} is not retained by ${this.name}`);\n\t\t}\n\t\tif (options.from !== undefined && !this.#local.has(rootId)) {\n\t\t\tlet links = this.#foreign.get(rootId);\n\t\t\tif (links === undefined) {\n\t\t\t\tlinks = new Set();\n\t\t\t\tthis.#foreign.set(rootId, links);\n\t\t\t}\n\t\t\tlinks.add(options.from);\n\t\t}\n\t\tepoch.roots.set(rootId, (epoch.roots.get(rootId) ?? 0) + 1);\n\t\tconst ctx = new CtxImpl(this, {\n\t\t\tsignal: options.signal ?? new AbortController().signal,\n\t\t\trootId,\n\t\t\tepoch: epoch.id,\n\t\t\tprincipal: options.principal ?? this.principal,\n\t\t});\n\t\ttry {\n\t\t\treturn await fn(ctx);\n\t\t} finally {\n\t\t\tctx.close();\n\t\t\tconst count = (epoch.roots.get(rootId) ?? 1) - 1;\n\t\t\tif (count > 0) epoch.roots.set(rootId, count);\n\t\t\telse {\n\t\t\t\tepoch.roots.delete(rootId);\n\t\t\t\tif (!this.#foreign.has(rootId)) this.endRoot(rootId);\n\t\t\t\tthis.maybeRetire();\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Remembers that calls of `rootId` went out on `connection`, which must hear when the root ends. */\n\trootSent(rootId: string, connection: Connection): void {\n\t\tlet links = this.#rootLinks.get(rootId);\n\t\tif (links === undefined) {\n\t\t\tlinks = new Set();\n\t\t\tthis.#rootLinks.set(rootId, links);\n\t\t}\n\t\tlinks.add(connection);\n\t}\n\n\t/** A root ended (here, or announced by its origin): end its leases and tell the links it went out on. */\n\tendRoot(rootId: string): void {\n\t\tthis.#local.delete(rootId);\n\t\tthis.#foreign.delete(rootId);\n\t\tfor (const record of this.#touches.get(rootId) ?? []) record.rootEnded(rootId);\n\t\tthis.#touches.delete(rootId);\n\t\tfor (const connection of this.#rootLinks.get(rootId) ?? []) connection.send({ t: \"root_end\", rootId });\n\t\tthis.#rootLinks.delete(rootId);\n\t}\n\n\t/**\n\t * `from` announced the end of a foreign root (or closed). Honored only if the root came over `from`: a peer cannot\n\t * end leases of roots it never carried. The root ends when no link that brought it remains.\n\t */\n\tforeignRootEnded(rootId: string, from: Connection): void {\n\t\tconst links = this.#foreign.get(rootId);\n\t\tif (links === undefined || !links.delete(from) || links.size > 0) return;\n\t\tconst running = [...this.epochs.values()].some((epoch) => epoch.roots.has(rootId));\n\t\t// Still running here (a call in flight): the lease ends when it settles.\n\t\tif (running) this.#foreign.delete(rootId);\n\t\telse this.endRoot(rootId);\n\t}\n\n\t/**\n\t * Retires the previous epoch once no local roots of it remain. A child also waits for its parent to retire it:\n\t * roots span hosts, and an old root on the server may still call in.\n\t */\n\tmaybeRetire(): void {\n\t\tconst previous = this.previous;\n\t\tif (previous === undefined || previous.roots.size > 0) return;\n\t\tif (this.kind !== \"client\" && this.upstream !== undefined && previous.id > this.#retireAllowed) return;\n\t\tthis.retire();\n\t}\n\n\tallowRetire(epoch: number): void {\n\t\tthis.#retireAllowed = Math.max(this.#retireAllowed, epoch);\n\t\tthis.maybeRetire();\n\t}\n\n\t/** Drops the previous epoch: its behaviors and the declarations only it used. */\n\tretire(): void {\n\t\tconst previous = this.previous;\n\t\tif (previous === undefined) return;\n\t\tthis.previous = undefined;\n\t\tthis.epochs.delete(previous.id);\n\t\tfor (const record of [...this.records.values()]) this.retireBehavior(record, previous.id);\n\t\tfor (const connection of this.connections) {\n\t\t\tif (connection.role === \"downstream\" && connection.peer?.kind === \"host\")\n\t\t\t\tconnection.send({ t: \"retire\", epoch: previous.id });\n\t\t}\n\t\tthis.retired();\n\t}\n\n\t/**\n\t * Drops a record's behavior for `epoch` and what only that behavior declared, in disposal order: resources close\n\t * (reverse open order) before its holds are released.\n\t */\n\tretireBehavior(record: RecordImpl, epoch: number): void {\n\t\tconst installed = record.behaviors.get(epoch);\n\t\trecord.behaviors.delete(epoch);\n\t\tif (installed === undefined || installed.decls === record.decls) return;\n\t\tconst kept = record.allDecls();\n\t\tconst keep = <T>(pick: (decls: Decls) => Iterable<T>): Set<T> =>\n\t\t\tnew Set([...kept].flatMap((decls) => [...pick(decls)]));\n\t\tconst holds = keep((decls) => decls.holds.values());\n\t\tconst resources = keep((decls) => decls.resources.values());\n\t\tconst derives = keep((decls) => decls.derives.values());\n\t\tfor (const derived of installed.decls.derives.values()) if (!derives.has(derived)) derived.detach();\n\t\tconst closing = [...installed.decls.resources.values()]\n\t\t\t.filter((resource) => !resources.has(resource))\n\t\t\t.sort((a, b) => record.openOrder.indexOf(b) - record.openOrder.indexOf(a));\n\t\tconst releasing = [...installed.decls.holds.values()].filter((hold) => !holds.has(hold));\n\t\trecord.refreshSchemas();\n\t\trunAll(\n\t\t\t[\n\t\t\t\t...closing.map((resource) => () => resource.close(record.openOrder)),\n\t\t\t\t...releasing.map((hold) => () => hold.release()),\n\t\t\t],\n\t\t\t`${record.address}: retiring epoch ${epoch} failed`,\n\t\t).catch((error: unknown) => this.report(error));\n\t}\n\n\t// ─── registries ───\n\n\tregistry<V>(registry: Registry<V>): RegistryView<V> {\n\t\tconst table = (ctx?: Ctx): RegistryTable<V> => {\n\t\t\tconst epoch = ctx === undefined ? this.current : this.epochs.get(ctx.epoch);\n\t\t\tif (epoch === undefined) throw new ChordError(\"superseded\", `epoch ${ctx?.epoch} is retired`);\n\t\t\treturn (epoch.tables.get(registry.name) ?? EMPTY_TABLE) as RegistryTable<V>;\n\t\t};\n\t\treturn {\n\t\t\ttable,\n\t\t\tget: (key, ctx) => table(ctx).get(key),\n\t\t\tsubscribe: (listener) => {\n\t\t\t\tlet set = this.#subscribers.get(registry.name);\n\t\t\t\tif (set === undefined) {\n\t\t\t\t\tset = new Set();\n\t\t\t\t\tthis.#subscribers.set(registry.name, set);\n\t\t\t\t}\n\t\t\t\tconst wrapped = listener as (table: RegistryTable<unknown>, epoch: number) => void;\n\t\t\t\tset.add(wrapped);\n\t\t\t\twrapped(table(), this.current.id);\n\t\t\t\treturn () => set.delete(wrapped);\n\t\t\t},\n\t\t};\n\t}\n\n\t/** Builds registry tables from (record, declarations) pairs. Throws registry_conflict. */\n\tbuildTables(entries: Iterable<readonly [RecordImpl, Decls]>): Map<string, RegistryTable<unknown>> {\n\t\tconst byRegistry = new Map<string, Map<string, { value: unknown; record: RecordImpl }>>();\n\t\tfor (const [record, decls] of entries) {\n\t\t\tfor (const { registry, key, value } of decls.registrations.values()) {\n\t\t\t\tlet entries = byRegistry.get(registry.name);\n\t\t\t\tif (entries === undefined) {\n\t\t\t\t\tentries = new Map();\n\t\t\t\t\tbyRegistry.set(registry.name, entries);\n\t\t\t\t}\n\t\t\t\tconst existing = entries.get(key);\n\t\t\t\tif (existing !== undefined && existing.record !== record && registry.conflict === \"error\") {\n\t\t\t\t\tthrow invalid(\n\t\t\t\t\t\t\"registry_conflict\",\n\t\t\t\t\t\t`${registry.name}: ${key} registered by ${existing.record.address} and ${record.address}`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tentries.set(key, { value, record });\n\t\t\t\tlet order = this.#order.get(registry.name);\n\t\t\t\tif (order === undefined) {\n\t\t\t\t\torder = new Map();\n\t\t\t\t\tthis.#order.set(registry.name, order);\n\t\t\t\t}\n\t\t\t\tif (!order.has(key)) order.set(key, order.size);\n\t\t\t}\n\t\t}\n\t\tconst tables = new Map<string, RegistryTable<unknown>>();\n\t\tfor (const [name, entries] of byRegistry) {\n\t\t\tconst order = this.#order.get(name)!;\n\t\t\tconst sorted = [...entries].sort(([a], [b]) => order.get(a)! - order.get(b)!);\n\t\t\ttables.set(name, new Map(sorted.map(([key, entry]) => [key, entry.value])));\n\t\t}\n\t\treturn tables;\n\t}\n\n\t/**\n\t * The service a hold binds against: the current one, or for a prepare rerun (`candidate`) the running reload's\n\t * pending one, so consumer and provider of a breaking change can reload in one batch.\n\t */\n\t#bindingService(typeName: string, candidate: boolean): Service | undefined {\n\t\treturn (candidate ? this.pending?.services.get(typeName) : undefined) ?? this.service(typeName);\n\t}\n\n\t/** Live records with their current declarations; records waiting for a reload's commit only with `candidates`. */\n\tliveDecls(candidates = false): [RecordImpl, Decls][] {\n\t\treturn [...this.records.values()]\n\t\t\t.filter((record) => record.status === \"live\" && (candidates || !record.deferredRuntime))\n\t\t\t.map((record) => [record, record.decls]);\n\t}\n\n\tcheckRegistrations(record: RecordImpl, decls: Decls): void {\n\t\tif (decls.registrations.size === 0) return;\n\t\tthis.buildTables([...this.liveDecls().filter(([other]) => other !== record), [record, decls]]);\n\t}\n\n\tregistriesChanged(including?: RecordImpl): void {\n\t\tconst entries = this.liveDecls().filter(([record]) => record !== including);\n\t\tif (including !== undefined) entries.push([including, including.decls]);\n\t\tthis.installTables(this.current, this.buildTables(entries));\n\t}\n\n\t/** A commit failed midway: from now on this host admits no work (calls fail `unavailable/host_failed`). */\n\tfail(error: unknown): void {\n\t\tthis.failed ??= error;\n\t\tthis.report(error);\n\t}\n\n\t/** Installs tables for `epoch`; subscribers hear about changed tables of the current epoch (all tables when `all`). */\n\tinstallTables(epoch: EpochState, tables: Map<string, RegistryTable<unknown>>, all = false): void {\n\t\tconst before = epoch.tables;\n\t\tepoch.tables = tables;\n\t\tif (epoch !== this.current) return;\n\t\tfor (const [name, listeners] of this.#subscribers) {\n\t\t\tconst next = tables.get(name) ?? EMPTY_TABLE;\n\t\t\tif (!all && sameTable(before.get(name) ?? EMPTY_TABLE, next)) continue;\n\t\t\tconst current = [...listeners];\n\t\t\tenqueue(() => {\n\t\t\t\tfor (const listener of current) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tlistener(next, epoch.id);\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tthis.report(error);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\t// ─── public API ───\n\n\tget<C extends AnyContract>(type: C, input: InputOf<C>, options?: GetOptions): Handle<C> {\n\t\treturn this.acquire(type, input, options, \"external\").proxy as Handle<C>;\n\t}\n\n\tasync invalidatePrincipal(match: PrincipalMatch): Promise<void> {\n\t\tconst matches = typeof match === \"function\" ? match : (principal: Principal) => matchesPattern(match, principal);\n\t\tconst reason = new ChordError(\"gone\", \"principal invalidated\");\n\t\t// Links acting as a matching principal are re-stamped (if the acceptor can) or closed.\n\t\tfor (const connection of [...this.connections]) {\n\t\t\tif (connection.role !== \"downstream\" || !matches(connection.principal)) continue;\n\t\t\t// Relays under the old principal close at once, including those still resolving their route.\n\t\t\tconnection.revoke(connection.restamp?.(connection.principal));\n\t\t}\n\t\t// Patterns propagate to child hosts, which dispose their own matching records (e.g. relayed guests).\n\t\tif (typeof match !== \"function\") {\n\t\t\tfor (const connection of this.connections) {\n\t\t\t\tif (connection.role === \"downstream\" && connection.peer.kind === \"host\") {\n\t\t\t\t\tconnection.send({ t: \"invalidate\", pattern: match });\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tconst matching = [...this.records.values()].filter(\n\t\t\t(record) => record.principal !== this.principal && matches(record.principal),\n\t\t);\n\t\tawait disposeHoldersFirst(matching, reason, \"invalidatePrincipal: disposal failed\");\n\t}\n\n\t// ─── links ───\n\n\taccept(link: Link, options: AcceptOptions): void {\n\t\tconst kind = options.kind ?? \"client\";\n\t\tif (kind === \"host\" && options.name === undefined) throw new TypeError(\"accepting a host link needs its name\");\n\t\tthis.#addConnection(link, {\n\t\t\t...options,\n\t\t\trole: \"downstream\",\n\t\t\tprincipal: options.principal,\n\t\t\tpeer: { kind, name: kind === \"host\" ? options.name : undefined },\n\t\t});\n\t}\n\n\tconnect(link: Link, options: LinkOptions = {}): void {\n\t\tif (this.upstream?.open) this.upstream.link.close(\"replaced\");\n\t\tconst connection = this.#addConnection(link, {\n\t\t\t...options,\n\t\t\trole: \"upstream\",\n\t\t\tprincipal: undefined,\n\t\t\tpeer: { kind: \"host\", name: undefined },\n\t\t});\n\t\tthis.upstream = connection;\n\t\t// Remote handles that lost their link re-hold over the new one; state subscribers get a reset.\n\t\tfor (const handle of this.remotes) if (handle.binding === undefined) connection.hold(handle);\n\t}\n\n\t#addConnection(link: Link, config: ConstructorParameters<typeof Connection>[2]): Connection {\n\t\tconst connection = new Connection(this, link, config);\n\t\tthis.connections.add(connection);\n\t\treturn connection;\n\t}\n\n\troute(prefix: string, route: Route): void {\n\t\tthis.#routes.set(prefix, route);\n\t}\n\n\t/**\n\t * A child host announced its epoch. In step: usable. Behind: fenced (nothing is routed to it) and reconciled by a\n\t * reload of its modules to this host's epoch, never by renumbering what it runs. Ahead: impossible, refused.\n\t */\n\tpeerHello(connection: Connection, epoch: number): void {\n\t\tif (epoch === this.current.id) {\n\t\t\tconnection.markSynced(epoch);\n\t\t\treturn;\n\t\t}\n\t\tif (epoch > this.current.id) {\n\t\t\tthis.report(new ChordError(\"invalid\", `${connection.name} runs epoch ${epoch}, ahead of ${this.current.id}`));\n\t\t\tconnection.link.close(\"epoch ahead of parent\");\n\t\t\treturn;\n\t\t}\n\t\tconnection.peerEpoch = epoch;\n\t\tconnection.fencedEpochs.add(epoch);\n\t\treconcileChild(this, connection).catch((error: unknown) => {\n\t\t\tthis.report(error);\n\t\t\tconnection.link.close(\"reconciliation failed\");\n\t\t});\n\t}\n\n\tconnectionClosed(connection: Connection): void {\n\t\tthis.connections.delete(connection);\n\t\t// Foreign roots that came over this link will never announce their end over it.\n\t\tfor (const [rootId, links] of [...this.#foreign])\n\t\t\tif (links.has(connection)) this.foreignRootEnded(rootId, connection);\n\t\tfor (const links of this.#rootLinks.values()) links.delete(connection);\n\t\tif (this.upstream === connection) {\n\t\t\tthis.upstream = undefined;\n\t\t\tthis.#childReloads.parentLost();\n\t\t}\n\t}\n\n\tforgetRemote(handle: RemoteHandle): void {\n\t\tthis.remotes.delete(handle);\n\t}\n\n\t/** A downstream host connection by its configured name (never by what a peer announced). */\n\t#childNamed(name: string): Connection | undefined {\n\t\treturn [...this.connections].find(\n\t\t\t(connection) =>\n\t\t\t\tconnection.role === \"downstream\" && connection.peer.kind === \"host\" && connection.peer.name === name,\n\t\t);\n\t}\n\n\t#acquireRemote(type: AnyContract, input: unknown, options: GetOptions, owner: HoldOwner): Hold {\n\t\tconst at = options.at!;\n\t\tif (type.scope !== \"remote\") throw invalid(\"local\", `${type.name} is local and cannot be reached at ${at}`);\n\t\tconst principal =\n\t\t\toptions.principal === undefined || options.principal === this.principal ? undefined : options.principal;\n\t\tconst handle = new RemoteHandle(this, {\n\t\t\tcontract: type,\n\t\t\tat,\n\t\t\tinput,\n\t\t\tprincipal,\n\t\t\towner,\n\t\t\taddress: remoteAddress(at, type, input, principal),\n\t\t});\n\t\tthis.remotes.add(handle);\n\t\tconst bindWhenSynced = (connection: Promise<Connection>): void => {\n\t\t\tconnection.then(\n\t\t\t\t(target) => {\n\t\t\t\t\tif (handle.status === \"loading\" && handle.binding === undefined) target.hold(handle);\n\t\t\t\t},\n\t\t\t\t(error: unknown) => handle.gone(error),\n\t\t\t);\n\t\t};\n\t\tconst direct = this.#childNamed(at);\n\t\tif (this.upstream !== undefined) this.upstream.hold(handle);\n\t\telse if (direct !== undefined) bindWhenSynced(direct.whenSynced().then(() => direct));\n\t\telse {\n\t\t\tconst route = this.#routeFor(at);\n\t\t\tif (route === undefined) handle.gone(new ChordError(\"unavailable\", `no route to ${at}`));\n\t\t\telse bindWhenSynced(this.#resolve(route, at, principal ?? this.principal));\n\t\t}\n\t\treturn handle;\n\t}\n\n\t#routeFor(hostName: string): Route | undefined {\n\t\tlet best: [string, Route] | undefined;\n\t\tfor (const entry of this.#routes) {\n\t\t\tif (hostName.startsWith(entry[0]) && (best === undefined || entry[0].length > best[0].length)) best = entry;\n\t\t}\n\t\treturn best?.[1];\n\t}\n\n\t/** Authorize, resolve (maybe spawn), authorize again; returns the synced connection to the host. */\n\tasync #resolve(\n\t\troute: Route,\n\t\thostName: string,\n\t\tprincipal: Principal,\n\t\tstill: () => boolean = () => true,\n\t): Promise<Connection> {\n\t\tconst refuse = (): ChordError => new ChordError(\"forbidden\", `${hostName} refused for this principal`);\n\t\tconst revoked = (): ChordError => new ChordError(\"gone\", \"principal invalidated while resolving\");\n\t\tif (!(await route.authorize(principal, hostName))) throw refuse();\n\t\tif (!still()) throw revoked();\n\t\tconst link = await route.resolve(hostName);\n\t\tif (!still()) throw revoked();\n\t\tif (!(await route.authorize(principal, hostName))) throw refuse();\n\t\tif (!still()) throw revoked();\n\t\tlet connection = [...this.connections].find((candidate) => candidate.link === link);\n\t\tconnection ??= this.#addConnection(link, {\n\t\t\trole: \"downstream\",\n\t\t\tprincipal: route.principal?.(hostName) ?? { host: hostName },\n\t\t\tpeer: { kind: \"host\", name: hostName },\n\t\t});\n\t\tawait connection.whenSynced();\n\t\tif (!still()) throw revoked();\n\t\treturn connection;\n\t}\n\n\t/**\n\t * Relays a hold from `relay.origin` to the host it names. Relaying needs a route: it is where authorization\n\t * lives. The origin's authorization generation is re-checked after every await and right before forwarding, so a\n\t * revocation during resolution wins.\n\t */\n\tasync relay(relay: RelayHold): Promise<void> {\n\t\tconst at = relay.frame.at;\n\t\tconst route = this.#routeFor(at);\n\t\tif (route === undefined) {\n\t\t\tthrow this.#childNamed(at) === undefined\n\t\t\t\t? new ChordError(\"unavailable\", `no route to ${at}`)\n\t\t\t\t: new ChordError(\"forbidden\", `no route authorizes ${at}`);\n\t\t}\n\t\tconst down = await this.#resolve(route, at, relay.principal, () => relay.current);\n\t\tif (!relay.current) return;\n\t\trelay.open(down);\n\t}\n\n\treload(plugins: readonly PluginRef[], options: ReloadOptions = {}): Promise<ReloadReport> {\n\t\t// Client-local facet epochs never cross the parent link; only child hosts require cluster coordination.\n\t\tif (this.kind !== \"client\" && this.upstream !== undefined) {\n\t\t\treturn Promise.reject(\n\t\t\t\tnew ChordError(\"unavailable\", \"reloads are coordinated by the server\", { reason: \"not_coordinator\" }),\n\t\t\t);\n\t\t}\n\t\tconst children = [...this.connections].some(\n\t\t\t(connection) => connection.role === \"downstream\" && connection.peer.kind === \"host\",\n\t\t);\n\t\treturn children || options.remote !== undefined || options.remoteRemove !== undefined\n\t\t\t? runClusterReload(this, plugins, options)\n\t\t\t: runReload(this, plugins, options);\n\t}\n\n\tonReloadFrame(connection: Connection, frame: Extract<Frame, { t: \"prepare\" | \"commit\" | \"abort\" }>): void {\n\t\tthis.#childReloads.handle(connection, frame);\n\t}\n\n\trememberRemoteModules(\n\t\tremote: Readonly<Record<string, readonly string[]>> | undefined,\n\t\tremove: Readonly<Record<string, readonly string[]>> | undefined,\n\t): void {\n\t\tfor (const prefix of new Set([...Object.keys(remote ?? {}), ...Object.keys(remove ?? {})])) {\n\t\t\tconst modules = remote?.[prefix] ?? [];\n\t\t\tconst removed = remove?.[prefix] ?? [];\n\t\t\tthis.remoteModules[prefix] = [...new Set([...(this.remoteModules[prefix] ?? []), ...modules])].filter(\n\t\t\t\t(module) => !removed.includes(module),\n\t\t\t);\n\t\t\tthis.remoteRemoved[prefix] = [...new Set([...(this.remoteRemoved[prefix] ?? []), ...removed])].filter(\n\t\t\t\t(module) => !modules.includes(module),\n\t\t\t);\n\t\t}\n\t}\n\n\t/** The epoch id the next reload would commit. */\n\tpeekNextEpoch(): number {\n\t\treturn this.#epochSeq + 1;\n\t}\n\n\t/**\n\t * Disposes every record, holders before what they hold (a resource's `close` may still use the objects its record\n\t * holds, local or remote), then closes the links.\n\t */\n\tasync close(): Promise<void> {\n\t\tthis.eager.clear();\n\t\tconst reason = new ChordError(\"gone\", `host ${this.name} closed`);\n\t\ttry {\n\t\t\tawait disposeHoldersFirst([...this.records.values()], reason, \"host close: disposal failed\");\n\t\t} finally {\n\t\t\tfor (const connection of [...this.connections]) connection.link.close(\"host closed\");\n\t\t}\n\t}\n}\n\n/**\n * Force-disposes `records` in waves: a record goes once no record of the set that holds it is left, so holders are\n * disposed (and their resources closed) while what they hold is still live. In-host holds are acyclic. Errors of\n * every disposal are collected.\n */\nasync function disposeHoldersFirst(records: readonly RecordImpl[], reason: unknown, message: string): Promise<void> {\n\tconst remaining = new Set(records);\n\tconst held = (record: RecordImpl): Set<RecordImpl> => {\n\t\tconst result = new Set<RecordImpl>();\n\t\tfor (const decls of record.allDecls()) {\n\t\t\tfor (const hold of decls.holds.values()) if (hold.record !== undefined) result.add(hold.record);\n\t\t}\n\t\treturn result;\n\t};\n\tconst holds = new Map(records.map((record) => [record, held(record)] as const));\n\tconst errors: unknown[] = [];\n\twhile (remaining.size > 0) {\n\t\tconst heldByRemaining = new Set<RecordImpl>();\n\t\tfor (const record of remaining) for (const target of holds.get(record) ?? []) heldByRemaining.add(target);\n\t\tlet wave = [...remaining].filter((record) => !heldByRemaining.has(record));\n\t\t// A cycle cannot happen in-host; dispose the rest together rather than loop.\n\t\tif (wave.length === 0) wave = [...remaining];\n\t\tfor (const record of wave) remaining.delete(record);\n\t\tconst results = await Promise.allSettled(wave.map((record) => record.dispose(true, reason)));\n\t\tfor (const result of results) if (result.status === \"rejected\") errors.push(result.reason);\n\t}\n\tif (errors.length === 1) throw errors[0];\n\tif (errors.length > 1) throw new AggregateError(errors, message);\n}\n\nfunction sameTable(a: RegistryTable<unknown>, b: RegistryTable<unknown>): boolean {\n\tif (a.size !== b.size) return false;\n\tconst keys = [...a.keys()];\n\treturn [...b].every(([key, value], index) => keys[index] === key && a.get(key) === value);\n}\n\nconst matchesPattern = (pattern: Readonly<Record<string, unknown>>, principal: Principal): boolean =>\n\tprincipal !== null &&\n\ttypeof principal === \"object\" &&\n\tObject.entries(pattern).every(([key, value]) => deepEqual((principal as Record<string, unknown>)[key], value));\n\n/** Address of a remote hold, as the consumer sees it (the provider normalizes the input). */\nconst remoteAddress = (at: string, type: AnyContract, input: unknown, principal: Principal | undefined): string =>\n\t`@${at}\\u0000${type.name}\\u0000${canonicalJson(input)}\\u0000${principal === undefined ? \"host\" : canonicalJson(principal)}`;\n\nconst unknownType = (type: string, host: string): ChordError =>\n\tnew ChordError(\"unavailable\", `${type} is not served by ${host}`, { reason: \"unknown_type\" });\n\n/** True if `from` holds `to`, directly or transitively, through record-owned holds on this host. */\nfunction reaches(from: RecordImpl, to: RecordImpl): boolean {\n\tconst seen = new Set<RecordImpl>();\n\tconst stack = [from];\n\twhile (stack.length > 0) {\n\t\tconst record = stack.pop()!;\n\t\tif (record === to) return true;\n\t\tif (seen.has(record)) continue;\n\t\tseen.add(record);\n\t\t// Remote holds have no record here: cycles across hosts are avoided by convention.\n\t\tfor (const decls of record.allDecls()) {\n\t\t\tfor (const hold of decls.holds.values()) if (hold.record !== undefined) stack.push(hold.record);\n\t\t}\n\t}\n\treturn false;\n}\n"]}
@@ -1,12 +1,19 @@
1
- /**
2
- * Chord is a standalone application-composition runtime for agentic applications.
3
- */
4
- export { combineFacetLoaders, createFacetHost, createRemoteServiceBinding, createStaticFacetLoader, defineFacet, defineService, replicatedState, } from "./api.ts";
1
+ export type { Cell } from "./cell.ts";
2
+ export type { AcceptOptions, LinkOptions } from "./connection.ts";
3
+ export type { Context, ContextKey } from "./context/index.ts";
4
+ export { type Accepts, type Adapter, type AnyContract, type BehaviorOf, bind, coverage, type Description, type Handle, type InputOf, type LocalContract, local, type MembersOf, method, opaque, type RemoteContract, remote, } from "./contract.ts";
5
+ export { type CellDecl, cell, type DerivationDecl, derivation, type ListenerDecl, listener, type Resource, type ResourceDecl, type ResourceSpec, resource, type Subscribable, } from "./declare.ts";
5
6
  export type { Draft } from "./delta/index.ts";
6
- export { type CopyJsonOptions, copyJson, isJsonValue } from "./json.ts";
7
- export { isRemoteServiceErrorCode, REMOTE_SERVICE_ERROR_CODES, RemoteServiceError, type RemoteServiceErrorCode, } from "./services/errors.ts";
8
- export { createRemoteServiceEndpoint, type RemoteServiceEndpoint, RemoteServiceProvider, type ServiceUpdatePublisher, } from "./services/provider.ts";
9
- export { createServiceStateDecoder, createServiceStateEncoder, type ServiceStateDecoder, type ServiceStateEncoder, } from "./services/state-codec.ts";
10
- export { createServiceCatalogueCall, createServiceSubscribeCall, createServiceUnsubscribeCall, decodeServiceControlCall, parseServiceCall, parseServiceCatalogue, parseServiceProviderUpdate, parseServiceSubscriptionSnapshot, parseWireServiceProviderUpdate, parseWireServiceSubscriptionSnapshot, type ServiceControlCall, type WireServiceInstanceSnapshot, type WireServiceMemberSnapshot, type WireServiceProviderUpdate, type WireServiceSubscriptionSnapshot, } from "./services/wire.ts";
11
- export type { AttachedReplicatedState, Context, ContextKey, Facet, FacetEnvironment, FacetHost, FacetLoader, FacetOptions, JsonRepresentation, JsonValue, LoadedFacets, MutableReplicatedState, RemoteServiceBinding, RemoteServiceBindingOptions, RemoteServiceSource, RemoteServices, RemoteServiceTransport, ReplicatedState, ReplicatedStateDelivery, ReplicatedStateSource, ReplicatedStateSourceAttachment, ReplicatedStateSourceFrame, ReplicatedStateSourceOptions, Service, ServiceCall, ServiceCatalogueEntry, ServiceInstanceAddress, ServiceInstanceSnapshot, ServiceMemberSnapshot, ServiceMode, ServiceProviderUpdate, ServiceSpawner, ServiceSubscription, ServiceSubscriptionSnapshot, } from "./types.ts";
7
+ export { ChordError, type ChordErrorCode, forbidden, invalid, isChordError } from "./errors.ts";
8
+ export type { PrincipalMatch, Route } from "./host.ts";
9
+ export { createHost, defineFacet, type Facet, type FacetApi, type FacetDefinition, type FacetLoader, type Host, type HostOptions, hostPrincipal, type LoadOptions, type PluginRef, type RootOptions, } from "./host.ts";
10
+ export { type CopyJsonOptions, copyJson, isJsonValue, type JsonRepresentation, type JsonValue } from "./json.ts";
11
+ export { type IpcChannel, ipcLink, type Link, memoryLinkPair, type WebSocketLike, webSocketLink } from "./link.ts";
12
+ export type { Factory, Self, ServeOptions } from "./record.ts";
13
+ export { defineRegistry, type Registry, type RegistryTable, type RegistryView } from "./registry.ts";
14
+ export type { ReloadOptions, ReloadReport } from "./reload.ts";
15
+ export { type AttachedReplicatedState, type MutableReplicatedState, type ReplicatedState, type ReplicatedStateDelivery, type ReplicatedStateSource, type ReplicatedStateSourceAttachment, type ReplicatedStateSourceFrame, type ReplicatedStateSourceOptions, replicatedState, } from "./state.ts";
16
+ export type { Ctx, GetOptions, HandleStatus, Principal, Readable, Shape, StateEvent } from "./types.ts";
17
+ export { acceptWebSockets, type WebSocketAcceptOptions, type WebSocketServerLike } from "./websocket.ts";
18
+ export type { Frame } from "./wire.ts";
12
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EACN,mBAAmB,EACnB,eAAe,EACf,0BAA0B,EAC1B,uBAAuB,EACvB,WAAW,EACX,aAAa,EACb,eAAe,GACf,MAAM,UAAU,CAAC;AAClB,YAAY,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,KAAK,eAAe,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxE,OAAO,EACN,wBAAwB,EACxB,0BAA0B,EAC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CAAC;AACnH,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,KAAK,QAAQ,EAAE,KAAK,aAAa,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AACrG,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EACN,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,+BAA+B,EACpC,KAAK,0BAA0B,EAC/B,KAAK,4BAA4B,EACjC,eAAe,GACf,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,GAAG,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxG,OAAO,EAAE,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,KAAK,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACzG,YAAY,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC"}
@@ -1,10 +1,10 @@
1
- /**
2
- * Chord is a standalone application-composition runtime for agentic applications.
3
- */
4
- export { combineFacetLoaders, createFacetHost, createRemoteServiceBinding, createStaticFacetLoader, defineFacet, defineService, replicatedState, } from "./api.js";
1
+ export { bind, coverage, local, method, opaque, remote, } from "./contract.js";
2
+ export { cell, derivation, listener, resource, } from "./declare.js";
3
+ export { ChordError, forbidden, invalid, isChordError } from "./errors.js";
4
+ export { createHost, defineFacet, hostPrincipal, } from "./host.js";
5
5
  export { copyJson, isJsonValue } from "./json.js";
6
- export { isRemoteServiceErrorCode, REMOTE_SERVICE_ERROR_CODES, RemoteServiceError, } from "./services/errors.js";
7
- export { createRemoteServiceEndpoint, RemoteServiceProvider, } from "./services/provider.js";
8
- export { createServiceStateDecoder, createServiceStateEncoder, } from "./services/state-codec.js";
9
- export { createServiceCatalogueCall, createServiceSubscribeCall, createServiceUnsubscribeCall, decodeServiceControlCall, parseServiceCall, parseServiceCatalogue, parseServiceProviderUpdate, parseServiceSubscriptionSnapshot, parseWireServiceProviderUpdate, parseWireServiceSubscriptionSnapshot, } from "./services/wire.js";
6
+ export { ipcLink, memoryLinkPair, webSocketLink } from "./link.js";
7
+ export { defineRegistry } from "./registry.js";
8
+ export { replicatedState, } from "./state.js";
9
+ export { acceptWebSockets } from "./websocket.js";
10
10
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EACN,mBAAmB,EACnB,eAAe,EACf,0BAA0B,EAC1B,uBAAuB,EACvB,WAAW,EACX,aAAa,EACb,eAAe,GACf,MAAM,UAAU,CAAC;AAElB,OAAO,EAAwB,QAAQ,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxE,OAAO,EACN,wBAAwB,EACxB,0BAA0B,EAC1B,kBAAkB,GAElB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACN,2BAA2B,EAE3B,qBAAqB,GAErB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,yBAAyB,EACzB,yBAAyB,GAGzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACN,0BAA0B,EAC1B,0BAA0B,EAC1B,4BAA4B,EAC5B,wBAAwB,EACxB,gBAAgB,EAChB,qBAAqB,EACrB,0BAA0B,EAC1B,gCAAgC,EAChC,8BAA8B,EAC9B,oCAAoC,GAMpC,MAAM,oBAAoB,CAAC","sourcesContent":["/**\n * Chord is a standalone application-composition runtime for agentic applications.\n */\nexport {\n\tcombineFacetLoaders,\n\tcreateFacetHost,\n\tcreateRemoteServiceBinding,\n\tcreateStaticFacetLoader,\n\tdefineFacet,\n\tdefineService,\n\treplicatedState,\n} from \"./api.ts\";\nexport type { Draft } from \"./delta/index.ts\";\nexport { type CopyJsonOptions, copyJson, isJsonValue } from \"./json.ts\";\nexport {\n\tisRemoteServiceErrorCode,\n\tREMOTE_SERVICE_ERROR_CODES,\n\tRemoteServiceError,\n\ttype RemoteServiceErrorCode,\n} from \"./services/errors.ts\";\nexport {\n\tcreateRemoteServiceEndpoint,\n\ttype RemoteServiceEndpoint,\n\tRemoteServiceProvider,\n\ttype ServiceUpdatePublisher,\n} from \"./services/provider.ts\";\nexport {\n\tcreateServiceStateDecoder,\n\tcreateServiceStateEncoder,\n\ttype ServiceStateDecoder,\n\ttype ServiceStateEncoder,\n} from \"./services/state-codec.ts\";\nexport {\n\tcreateServiceCatalogueCall,\n\tcreateServiceSubscribeCall,\n\tcreateServiceUnsubscribeCall,\n\tdecodeServiceControlCall,\n\tparseServiceCall,\n\tparseServiceCatalogue,\n\tparseServiceProviderUpdate,\n\tparseServiceSubscriptionSnapshot,\n\tparseWireServiceProviderUpdate,\n\tparseWireServiceSubscriptionSnapshot,\n\ttype ServiceControlCall,\n\ttype WireServiceInstanceSnapshot,\n\ttype WireServiceMemberSnapshot,\n\ttype WireServiceProviderUpdate,\n\ttype WireServiceSubscriptionSnapshot,\n} from \"./services/wire.ts\";\nexport type {\n\tAttachedReplicatedState,\n\tContext,\n\tContextKey,\n\tFacet,\n\tFacetEnvironment,\n\tFacetHost,\n\tFacetLoader,\n\tFacetOptions,\n\tJsonRepresentation,\n\tJsonValue,\n\tLoadedFacets,\n\tMutableReplicatedState,\n\tRemoteServiceBinding,\n\tRemoteServiceBindingOptions,\n\tRemoteServiceSource,\n\tRemoteServices,\n\tRemoteServiceTransport,\n\tReplicatedState,\n\tReplicatedStateDelivery,\n\tReplicatedStateSource,\n\tReplicatedStateSourceAttachment,\n\tReplicatedStateSourceFrame,\n\tReplicatedStateSourceOptions,\n\tService,\n\tServiceCall,\n\tServiceCatalogueEntry,\n\tServiceInstanceAddress,\n\tServiceInstanceSnapshot,\n\tServiceMemberSnapshot,\n\tServiceMode,\n\tServiceProviderUpdate,\n\tServiceSpawner,\n\tServiceSubscription,\n\tServiceSubscriptionSnapshot,\n} from \"./types.ts\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAKN,IAAI,EACJ,QAAQ,EAKR,KAAK,EAEL,MAAM,EACN,MAAM,EAEN,MAAM,GACN,MAAM,eAAe,CAAC;AACvB,OAAO,EAEN,IAAI,EAEJ,UAAU,EAEV,QAAQ,EAIR,QAAQ,GAER,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,UAAU,EAAuB,SAAS,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhG,OAAO,EACN,UAAU,EACV,WAAW,EAOX,aAAa,GAIb,MAAM,WAAW,CAAC;AACnB,OAAO,EAAwB,QAAQ,EAAE,WAAW,EAA2C,MAAM,WAAW,CAAC;AACjH,OAAO,EAAmB,OAAO,EAAa,cAAc,EAAsB,aAAa,EAAE,MAAM,WAAW,CAAC;AAEnH,OAAO,EAAE,cAAc,EAAwD,MAAM,eAAe,CAAC;AAErG,OAAO,EASN,eAAe,GACf,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,gBAAgB,EAAyD,MAAM,gBAAgB,CAAC","sourcesContent":["export type { Cell } from \"./cell.ts\";\nexport type { AcceptOptions, LinkOptions } from \"./connection.ts\";\nexport type { Context, ContextKey } from \"./context/index.ts\";\nexport {\n\ttype Accepts,\n\ttype Adapter,\n\ttype AnyContract,\n\ttype BehaviorOf,\n\tbind,\n\tcoverage,\n\ttype Description,\n\ttype Handle,\n\ttype InputOf,\n\ttype LocalContract,\n\tlocal,\n\ttype MembersOf,\n\tmethod,\n\topaque,\n\ttype RemoteContract,\n\tremote,\n} from \"./contract.ts\";\nexport {\n\ttype CellDecl,\n\tcell,\n\ttype DerivationDecl,\n\tderivation,\n\ttype ListenerDecl,\n\tlistener,\n\ttype Resource,\n\ttype ResourceDecl,\n\ttype ResourceSpec,\n\tresource,\n\ttype Subscribable,\n} from \"./declare.ts\";\nexport type { Draft } from \"./delta/index.ts\";\nexport { ChordError, type ChordErrorCode, forbidden, invalid, isChordError } from \"./errors.ts\";\nexport type { PrincipalMatch, Route } from \"./host.ts\";\nexport {\n\tcreateHost,\n\tdefineFacet,\n\ttype Facet,\n\ttype FacetApi,\n\ttype FacetDefinition,\n\ttype FacetLoader,\n\ttype Host,\n\ttype HostOptions,\n\thostPrincipal,\n\ttype LoadOptions,\n\ttype PluginRef,\n\ttype RootOptions,\n} from \"./host.ts\";\nexport { type CopyJsonOptions, copyJson, isJsonValue, type JsonRepresentation, type JsonValue } from \"./json.ts\";\nexport { type IpcChannel, ipcLink, type Link, memoryLinkPair, type WebSocketLike, webSocketLink } from \"./link.ts\";\nexport type { Factory, Self, ServeOptions } from \"./record.ts\";\nexport { defineRegistry, type Registry, type RegistryTable, type RegistryView } from \"./registry.ts\";\nexport type { ReloadOptions, ReloadReport } from \"./reload.ts\";\nexport {\n\ttype AttachedReplicatedState,\n\ttype MutableReplicatedState,\n\ttype ReplicatedState,\n\ttype ReplicatedStateDelivery,\n\ttype ReplicatedStateSource,\n\ttype ReplicatedStateSourceAttachment,\n\ttype ReplicatedStateSourceFrame,\n\ttype ReplicatedStateSourceOptions,\n\treplicatedState,\n} from \"./state.ts\";\nexport type { Ctx, GetOptions, HandleStatus, Principal, Readable, Shape, StateEvent } from \"./types.ts\";\nexport { acceptWebSockets, type WebSocketAcceptOptions, type WebSocketServerLike } from \"./websocket.ts\";\nexport type { Frame } from \"./wire.ts\";\n"]}
@@ -1,4 +1,11 @@
1
- import type { JsonValue } from "./types.ts";
1
+ export type JsonValue = null | boolean | number | string | JsonValue[] | {
2
+ [key: string]: JsonValue;
3
+ };
4
+ type IsAny<T> = 0 extends 1 & T ? true : false;
5
+ /** Strict-JSON representation of an application data type. Unknown payloads become JsonValue. */
6
+ export type JsonRepresentation<T> = IsAny<T> extends true ? JsonValue : unknown extends T ? JsonValue : T extends null | boolean | number | string ? T : T extends readonly (infer TItem)[] ? JsonRepresentation<TItem>[] : T extends object ? {
7
+ [TKey in keyof T]: JsonRepresentation<T[TKey]>;
8
+ } : never;
2
9
  export type CopyJsonOptions = {
3
10
  /** Omit undefined object properties while preserving strict array semantics. */
4
11
  readonly omitUndefinedProperties?: boolean;
@@ -7,4 +14,5 @@ export type CopyJsonOptions = {
7
14
  export declare function copyJson(value: unknown, options?: CopyJsonOptions): JsonValue;
8
15
  /** Return whether a value is finite strict JSON with plain objects and no cycles. */
9
16
  export declare function isJsonValue(value: unknown): value is JsonValue;
17
+ export {};
10
18
  //# sourceMappingURL=json.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../src/json.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAS5C,MAAM,MAAM,eAAe,GAAG;IAC7B,gFAAgF;IAChF,QAAQ,CAAC,uBAAuB,CAAC,EAAE,OAAO,CAAC;CAC3C,CAAC;AAEF,4EAA4E;AAC5E,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,SAAS,CAE7E;AAuDD,qFAAqF;AACrF,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,SAAS,CAE9D"}
1
+ {"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../src/json.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,EAAE,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAEtG,KAAK,KAAK,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC;AAE/C,iGAAiG;AACjG,MAAM,MAAM,kBAAkB,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC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,CAAC;gBAC/F,OAAO,KAAK,CAAC;YACd,CAAC;QACF,CAAC;QACD,OAAO,IAAI,CAAC;IACb,CAAC;YAAS,CAAC;QACV,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;AACF,CAAC","sourcesContent":["import type { JsonValue } from \"./types.ts\";\n\nconst DATA_DESCRIPTOR: PropertyDescriptor = {\n\tvalue: undefined,\n\twritable: true,\n\tenumerable: true,\n\tconfigurable: true,\n};\n\nexport type CopyJsonOptions = {\n\t/** Omit undefined object properties while preserving strict array semantics. */\n\treadonly omitUndefinedProperties?: boolean;\n};\n\n/** Copy a value into an alias-free strict-JSON tree owned by the caller. */\nexport function copyJson(value: unknown, options?: CopyJsonOptions): JsonValue {\n\treturn copy(value, undefined, options?.omitUndefinedProperties === true);\n}\n\nfunction copy(value: unknown, ancestors: Set<object> | undefined, omitUndefinedProperties: boolean): JsonValue {\n\tif (value === null || typeof value === \"string\" || typeof value === \"boolean\") return value;\n\tif (typeof value === \"number\") {\n\t\tif (Number.isFinite(value)) return value;\n\t\tthrow new TypeError(\"Value contains a non-finite number and is not strict JSON\");\n\t}\n\tif (typeof value !== \"object\")\n\t\tthrow new TypeError(`Value contains a non-JSON ${typeof value}; expected strict JSON`);\n\tconst active = ancestors ?? new Set<object>();\n\tif (active.has(value)) throw new TypeError(\"Value contains cycles and is not strict JSON\");\n\tactive.add(value);\n\ttry {\n\t\tif (Array.isArray(value)) {\n\t\t\t// Indices plus `length` only: extra, symbol, and missing keys all change the count.\n\t\t\tif (Object.getPrototypeOf(value) !== Array.prototype || Reflect.ownKeys(value).length !== value.length + 1) {\n\t\t\t\tthrow new TypeError(\"Value must contain strict JSON dense plain arrays\");\n\t\t\t}\n\t\t\tconst result = new Array<JsonValue>(value.length);\n\t\t\tfor (let index = 0; index < value.length; index++) {\n\t\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(value, index);\n\t\t\t\tif (descriptor === undefined || !descriptor.enumerable || !(\"value\" in descriptor)) {\n\t\t\t\t\tthrow new TypeError(\"Value must contain strict JSON enumerable indexed data properties\");\n\t\t\t\t}\n\t\t\t\tdefineData(result, String(index), copy(descriptor.value, active, omitUndefinedProperties));\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\tconst prototype = Object.getPrototypeOf(value);\n\t\tif (prototype !== Object.prototype && prototype !== null) {\n\t\t\tthrow new TypeError(\"Value must contain strict JSON plain objects or arrays\");\n\t\t}\n\t\tconst result = Object.create(prototype) as Record<string, JsonValue>;\n\t\tfor (const key of Reflect.ownKeys(value)) {\n\t\t\tif (typeof key === \"symbol\") throw new TypeError(\"Value contains a symbol key and is not strict JSON\");\n\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(value, key)!;\n\t\t\tif (!descriptor.enumerable || !(\"value\" in descriptor)) {\n\t\t\t\tthrow new TypeError(\"Value must contain strict JSON enumerable data properties\");\n\t\t\t}\n\t\t\tif (descriptor.value === undefined && omitUndefinedProperties) continue;\n\t\t\tdefineData(result, key, copy(descriptor.value, active, omitUndefinedProperties));\n\t\t}\n\t\treturn result;\n\t} finally {\n\t\tactive.delete(value);\n\t}\n}\n\nfunction defineData(target: object, key: PropertyKey, value: JsonValue): void {\n\tDATA_DESCRIPTOR.value = value;\n\tObject.defineProperty(target, key, DATA_DESCRIPTOR);\n\tDATA_DESCRIPTOR.value = undefined;\n}\n\n/** Return whether a value is finite strict JSON with plain objects and no cycles. */\nexport function isJsonValue(value: unknown): value is JsonValue {\n\treturn check(value, new Set<object>());\n}\n\nfunction check(value: unknown, ancestors: Set<object>): boolean {\n\tif (value === null || typeof value === \"string\" || typeof value === \"boolean\") return true;\n\tif (typeof value === \"number\") return Number.isFinite(value);\n\tif (Array.isArray(value)) {\n\t\tif (Object.getPrototypeOf(value) !== Array.prototype) return false;\n\t\tconst keys = Reflect.ownKeys(value);\n\t\tif (keys.length !== value.length + 1 || keys.some((key) => typeof key !== \"string\")) return false;\n\t\tif (ancestors.has(value)) return false;\n\t\tancestors.add(value);\n\t\ttry {\n\t\t\tfor (let index = 0; index < value.length; index++) {\n\t\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(value, String(index));\n\t\t\t\tif (\n\t\t\t\t\tdescriptor === undefined ||\n\t\t\t\t\t!descriptor.enumerable ||\n\t\t\t\t\t!(\"value\" in descriptor) ||\n\t\t\t\t\t!check(descriptor.value, ancestors)\n\t\t\t\t) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t} finally {\n\t\t\tancestors.delete(value);\n\t\t}\n\t}\n\tif (typeof value !== \"object\" || value === null) return false;\n\tconst prototype = Object.getPrototypeOf(value);\n\tif (prototype !== Object.prototype && prototype !== null) return false;\n\tif (Reflect.ownKeys(value).some((key) => typeof key !== \"string\")) return false;\n\tif (ancestors.has(value)) return false;\n\tancestors.add(value);\n\ttry {\n\t\tfor (const descriptor of Object.values(Object.getOwnPropertyDescriptors(value))) {\n\t\t\tif (!descriptor.enumerable || !(\"value\" in descriptor) || !check(descriptor.value, ancestors)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t} finally {\n\t\tancestors.delete(value);\n\t}\n}\n"]}
1
+ {"version":3,"file":"json.js","sourceRoot":"","sources":["../src/json.ts"],"names":[],"mappings":"AAiBA,MAAM,eAAe,GAAuB;IAC3C,KAAK,EAAE,SAAS;IAChB,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE,IAAI;IAChB,YAAY,EAAE,IAAI;CAClB,CAAC;AAOF,4EAA4E;AAC5E,MAAM,UAAU,QAAQ,CAAC,KAAc,EAAE,OAAyB;IACjE,OAAO,IAAI,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,uBAAuB,KAAK,IAAI,CAAC,CAAC;AAC1E,CAAC;AAED,SAAS,IAAI,CAAC,KAAc,EAAE,SAAkC,EAAE,uBAAgC;IACjG,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAA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AAK,CAAC,UAAU,CAAC,KAAK,EAAE,SAAS,CAAC,EAAE,CAAC;gBAC/F,OAAO,KAAK,CAAC;YACd,CAAC;QACF,CAAC;QACD,OAAO,IAAI,CAAC;IACb,CAAC;YAAS,CAAC;QACV,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;AACF,CAAC","sourcesContent":["export type JsonValue = null | boolean | number | string | JsonValue[] | { [key: string]: JsonValue };\n\ntype IsAny<T> = 0 extends 1 & T ? true : false;\n\n/** Strict-JSON representation of an application data type. Unknown payloads become JsonValue. */\nexport type JsonRepresentation<T> = IsAny<T> extends true\n\t? JsonValue\n\t: unknown extends T\n\t\t? JsonValue\n\t\t: T extends null | boolean | number | string\n\t\t\t? T\n\t\t\t: T extends readonly (infer TItem)[]\n\t\t\t\t? JsonRepresentation<TItem>[]\n\t\t\t\t: T extends object\n\t\t\t\t\t? { [TKey in keyof T]: JsonRepresentation<T[TKey]> }\n\t\t\t\t\t: never;\n\nconst DATA_DESCRIPTOR: PropertyDescriptor = {\n\tvalue: undefined,\n\twritable: true,\n\tenumerable: true,\n\tconfigurable: true,\n};\n\nexport type CopyJsonOptions = {\n\t/** Omit undefined object properties while preserving strict array semantics. */\n\treadonly omitUndefinedProperties?: boolean;\n};\n\n/** Copy a value into an alias-free strict-JSON tree owned by the caller. */\nexport function copyJson(value: unknown, options?: CopyJsonOptions): JsonValue {\n\treturn copy(value, undefined, options?.omitUndefinedProperties === true);\n}\n\nfunction copy(value: unknown, ancestors: Set<object> | undefined, omitUndefinedProperties: boolean): JsonValue {\n\tif (value === null || typeof value === \"string\" || typeof value === \"boolean\") return value;\n\tif (typeof value === \"number\") {\n\t\tif (Number.isFinite(value)) return value;\n\t\tthrow new TypeError(\"Value contains a non-finite number and is not strict JSON\");\n\t}\n\tif (typeof value !== \"object\")\n\t\tthrow new TypeError(`Value contains a non-JSON ${typeof value}; expected strict JSON`);\n\tconst active = ancestors ?? new Set<object>();\n\tif (active.has(value)) throw new TypeError(\"Value contains cycles and is not strict JSON\");\n\tactive.add(value);\n\ttry {\n\t\tif (Array.isArray(value)) {\n\t\t\t// Indices plus `length` only: extra, symbol, and missing keys all change the count.\n\t\t\tif (Object.getPrototypeOf(value) !== Array.prototype || Reflect.ownKeys(value).length !== value.length + 1) {\n\t\t\t\tthrow new TypeError(\"Value must contain strict JSON dense plain arrays\");\n\t\t\t}\n\t\t\tconst result = new Array<JsonValue>(value.length);\n\t\t\tfor (let index = 0; index < value.length; index++) {\n\t\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(value, index);\n\t\t\t\tif (descriptor === undefined || !descriptor.enumerable || !(\"value\" in descriptor)) {\n\t\t\t\t\tthrow new TypeError(\"Value must contain strict JSON enumerable indexed data properties\");\n\t\t\t\t}\n\t\t\t\tdefineData(result, String(index), copy(descriptor.value, active, omitUndefinedProperties));\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\tconst prototype = Object.getPrototypeOf(value);\n\t\tif (prototype !== Object.prototype && prototype !== null) {\n\t\t\tthrow new TypeError(\"Value must contain strict JSON plain objects or arrays\");\n\t\t}\n\t\tconst result = Object.create(prototype) as Record<string, JsonValue>;\n\t\tfor (const key of Reflect.ownKeys(value)) {\n\t\t\tif (typeof key === \"symbol\") throw new TypeError(\"Value contains a symbol key and is not strict JSON\");\n\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(value, key)!;\n\t\t\tif (!descriptor.enumerable || !(\"value\" in descriptor)) {\n\t\t\t\tthrow new TypeError(\"Value must contain strict JSON enumerable data properties\");\n\t\t\t}\n\t\t\tif (descriptor.value === undefined && omitUndefinedProperties) continue;\n\t\t\tdefineData(result, key, copy(descriptor.value, active, omitUndefinedProperties));\n\t\t}\n\t\treturn result;\n\t} finally {\n\t\tactive.delete(value);\n\t}\n}\n\nfunction defineData(target: object, key: PropertyKey, value: JsonValue): void {\n\tDATA_DESCRIPTOR.value = value;\n\tObject.defineProperty(target, key, DATA_DESCRIPTOR);\n\tDATA_DESCRIPTOR.value = undefined;\n}\n\n/** Return whether a value is finite strict JSON with plain objects and no cycles. */\nexport function isJsonValue(value: unknown): value is JsonValue {\n\treturn check(value, new Set<object>());\n}\n\nfunction check(value: unknown, ancestors: Set<object>): boolean {\n\tif (value === null || typeof value === \"string\" || typeof value === \"boolean\") return true;\n\tif (typeof value === \"number\") return Number.isFinite(value);\n\tif (Array.isArray(value)) {\n\t\tif (Object.getPrototypeOf(value) !== Array.prototype) return false;\n\t\tconst keys = Reflect.ownKeys(value);\n\t\tif (keys.length !== value.length + 1 || keys.some((key) => typeof key !== \"string\")) return false;\n\t\tif (ancestors.has(value)) return false;\n\t\tancestors.add(value);\n\t\ttry {\n\t\t\tfor (let index = 0; index < value.length; index++) {\n\t\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(value, String(index));\n\t\t\t\tif (\n\t\t\t\t\tdescriptor === undefined ||\n\t\t\t\t\t!descriptor.enumerable ||\n\t\t\t\t\t!(\"value\" in descriptor) ||\n\t\t\t\t\t!check(descriptor.value, ancestors)\n\t\t\t\t) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t} finally {\n\t\t\tancestors.delete(value);\n\t\t}\n\t}\n\tif (typeof value !== \"object\" || value === null) return false;\n\tconst prototype = Object.getPrototypeOf(value);\n\tif (prototype !== Object.prototype && prototype !== null) return false;\n\tif (Reflect.ownKeys(value).some((key) => typeof key !== \"string\")) return false;\n\tif (ancestors.has(value)) return false;\n\tancestors.add(value);\n\ttry {\n\t\tfor (const descriptor of Object.values(Object.getOwnPropertyDescriptors(value))) {\n\t\t\tif (!descriptor.enumerable || !(\"value\" in descriptor) || !check(descriptor.value, ancestors)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t} finally {\n\t\tancestors.delete(value);\n\t}\n}\n"]}
@@ -0,0 +1,72 @@
1
+ import type { Frame } from "./wire.ts";
2
+ /** An ordered (FIFO), bidirectional frame channel between two hosts. */
3
+ export interface Link {
4
+ readonly closed: boolean;
5
+ send(frame: Frame): void;
6
+ /** Sets the single receiver. Frames arriving earlier are queued. */
7
+ receive(handler: (frame: Frame) => void): void;
8
+ onClose(handler: (reason: string) => void): void;
9
+ /** Closes both ends: the peer gets a `bye`. */
10
+ close(reason?: string): void;
11
+ }
12
+ /** Shared plumbing: receive queue, close handlers, `bye`. Transports implement `transmit` and `shutdown`. */
13
+ declare abstract class BaseLink implements Link {
14
+ #private;
15
+ get closed(): boolean;
16
+ protected abstract transmit(frame: Frame): void;
17
+ protected abstract shutdown(): void;
18
+ send(frame: Frame): void;
19
+ receive(handler: (frame: Frame) => void): void;
20
+ onClose(handler: (reason: string) => void): void;
21
+ close(reason?: string): void;
22
+ /** Delivers a parsed frame from the transport. */
23
+ protected deliver(frame: Frame): void;
24
+ /** Marks the link closed (transport ended) and notifies once. */
25
+ protected ended(reason: string): void;
26
+ }
27
+ export declare class MemoryLink extends BaseLink {
28
+ #private;
29
+ peer: MemoryLink | undefined;
30
+ /** Simulates a dead network: frames are dropped silently in both directions and no close is signalled. */
31
+ sever(): void;
32
+ protected transmit(frame: Frame): void;
33
+ protected shutdown(): void;
34
+ }
35
+ /** Two connected in-memory links (tests). */
36
+ export declare function memoryLinkPair(): [MemoryLink, MemoryLink];
37
+ /** `process` in a forked child, or the parent's `ChildProcess`. Structural, so Chord needs no Node types here. */
38
+ export interface IpcChannel {
39
+ readonly connected: boolean;
40
+ send(message: unknown): boolean;
41
+ on(event: "message", listener: (message: unknown) => void): unknown;
42
+ on(event: "disconnect", listener: () => void): unknown;
43
+ off(event: "message", listener: (message: unknown) => void): unknown;
44
+ off(event: "disconnect", listener: () => void): unknown;
45
+ }
46
+ /** Chord frames on an IPC channel are wrapped as `{ chord2: frame }`; other messages (control) pass by. */
47
+ export declare class IpcLink extends BaseLink {
48
+ #private;
49
+ constructor(channel: IpcChannel);
50
+ protected transmit(frame: Frame): void;
51
+ protected shutdown(): void;
52
+ }
53
+ export declare const ipcLink: (channel: IpcChannel) => IpcLink;
54
+ /** The WHATWG WebSocket surface: the browser `WebSocket`, Node's global `WebSocket`, and `ws` sockets. */
55
+ export interface WebSocketLike {
56
+ readonly readyState: number;
57
+ send(data: string): void;
58
+ close(code?: number, reason?: string): void;
59
+ addEventListener(type: "message", listener: (event: {
60
+ readonly data: unknown;
61
+ }) => void): void;
62
+ addEventListener(type: "open" | "close" | "error", listener: () => void): void;
63
+ }
64
+ export declare class WebSocketLink extends BaseLink {
65
+ #private;
66
+ constructor(socket: WebSocketLike);
67
+ protected transmit(frame: Frame): void;
68
+ protected shutdown(): void;
69
+ }
70
+ export declare const webSocketLink: (socket: WebSocketLike) => WebSocketLink;
71
+ export {};
72
+ //# sourceMappingURL=link.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../src/link.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAEvC,wEAAwE;AACxE,MAAM,WAAW,IAAI;IACpB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,IAAI,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACzB,oEAAoE;IACpE,OAAO,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,IAAI,CAAC;IAC/C,OAAO,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI,CAAC;IACjD,+CAA+C;IAC/C,KAAK,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,6GAA6G;AAC7G,uBAAe,QAAS,YAAW,IAAI;;IAMtC,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAChD,SAAS,CAAC,QAAQ,CAAC,QAAQ,IAAI,IAAI,CAAC;I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Y,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC;CACxD;AAED,2GAA2G;AAC3G,qBAAa,OAAQ,SAAQ,QAAQ;;IAQpC,YAAY,OAAO,EAAE,UAAU,EAK9B;IAED,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAErC;IAED,SAAS,CAAC,QAAQ,IAAI,IAAI,CAGzB;CACD;AAED,eAAO,MAAM,OAAO,YAAa,UAAU,KAAG,OAA+B,CAAC;AAI9E,0GAA0G;AAC1G,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5C,gBAAgB,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,GAAG,IAAI,CAAC;IAC/F,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;CAC/E;AAID,qBAAa,aAAc,SAAQ,QAAQ;;IAI1C,YAAY,MAAM,EAAE,aAAa,EAchC;IAED,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAIrC;IAED,SAAS,CAAC,QAAQ,IAAI,IAAI,CAGzB;CACD;AAED,eAAO,MAAM,aAAa,WAAY,aAAa,KAAG,aAA0C,CAAC"}
@@ -0,0 +1,169 @@
1
+ /** Shared plumbing: receive queue, close handlers, `bye`. Transports implement `transmit` and `shutdown`. */
2
+ class BaseLink {
3
+ #handler;
4
+ #queue = [];
5
+ #closeHandlers = new Set();
6
+ #closed = false;
7
+ get closed() {
8
+ return this.#closed;
9
+ }
10
+ send(frame) {
11
+ if (this.#closed)
12
+ return;
13
+ this.transmit(frame);
14
+ }
15
+ receive(handler) {
16
+ this.#handler = handler;
17
+ for (const frame of this.#queue.splice(0))
18
+ handler(frame);
19
+ }
20
+ onClose(handler) {
21
+ if (this.#closed)
22
+ handler("closed");
23
+ else
24
+ this.#closeHandlers.add(handler);
25
+ }
26
+ close(reason = "closed") {
27
+ if (this.#closed)
28
+ return;
29
+ try {
30
+ this.transmit({ t: "bye", reason });
31
+ }
32
+ catch {
33
+ // The transport may already be gone.
34
+ }
35
+ this.ended(reason);
36
+ }
37
+ /** Delivers a parsed frame from the transport. */
38
+ deliver(frame) {
39
+ if (this.#closed)
40
+ return;
41
+ if (frame.t === "bye") {
42
+ this.ended(frame.reason ?? "peer closed");
43
+ return;
44
+ }
45
+ if (this.#handler === undefined)
46
+ this.#queue.push(frame);
47
+ else
48
+ this.#handler(frame);
49
+ }
50
+ /** Marks the link closed (transport ended) and notifies once. */
51
+ ended(reason) {
52
+ if (this.#closed)
53
+ return;
54
+ this.#closed = true;
55
+ this.#queue = [];
56
+ try {
57
+ this.shutdown();
58
+ }
59
+ finally {
60
+ for (const handler of this.#closeHandlers)
61
+ handler(reason);
62
+ this.#closeHandlers.clear();
63
+ }
64
+ }
65
+ }
66
+ /** Parses a JSON frame; anything else is a protocol error. */
67
+ function parseFrame(data) {
68
+ const frame = JSON.parse(data);
69
+ if (frame === null || typeof frame !== "object" || typeof frame.t !== "string")
70
+ throw new TypeError("not a frame");
71
+ return frame;
72
+ }
73
+ // ─── memory ──────────────────────────────────────────────────────────────────
74
+ export class MemoryLink extends BaseLink {
75
+ peer;
76
+ #severed = false;
77
+ #pending = Promise.resolve();
78
+ /** Simulates a dead network: frames are dropped silently in both directions and no close is signalled. */
79
+ sever() {
80
+ this.#severed = true;
81
+ if (this.peer)
82
+ this.peer.#severed = true;
83
+ }
84
+ transmit(frame) {
85
+ if (this.#severed)
86
+ return;
87
+ // A JSON round trip detaches the frame (and rejects what JSON would mangle silently, e.g. bigint).
88
+ const data = JSON.stringify(frame);
89
+ const peer = this.peer;
90
+ // One promise chain per direction keeps delivery FIFO and asynchronous, like a real transport.
91
+ this.#pending = this.#pending.then(() => {
92
+ if (!this.#severed && peer !== undefined)
93
+ peer.deliver(parseFrame(data));
94
+ });
95
+ }
96
+ shutdown() {
97
+ const peer = this.peer;
98
+ this.#pending = this.#pending.then(() => peer?.ended("peer closed"));
99
+ }
100
+ }
101
+ /** Two connected in-memory links (tests). */
102
+ export function memoryLinkPair() {
103
+ const a = new MemoryLink();
104
+ const b = new MemoryLink();
105
+ a.peer = b;
106
+ b.peer = a;
107
+ return [a, b];
108
+ }
109
+ /** Chord frames on an IPC channel are wrapped as `{ chord2: frame }`; other messages (control) pass by. */
110
+ export class IpcLink extends BaseLink {
111
+ #channel;
112
+ #onMessage = (message) => {
113
+ const frame = message?.chord2;
114
+ if (frame !== undefined)
115
+ this.deliver(frame);
116
+ };
117
+ #onDisconnect = () => this.ended("ipc disconnected");
118
+ constructor(channel) {
119
+ super();
120
+ this.#channel = channel;
121
+ channel.on("message", this.#onMessage);
122
+ channel.on("disconnect", this.#onDisconnect);
123
+ }
124
+ transmit(frame) {
125
+ if (this.#channel.connected)
126
+ this.#channel.send({ chord2: frame });
127
+ }
128
+ shutdown() {
129
+ this.#channel.off("message", this.#onMessage);
130
+ this.#channel.off("disconnect", this.#onDisconnect);
131
+ }
132
+ }
133
+ export const ipcLink = (channel) => new IpcLink(channel);
134
+ const OPEN = 1;
135
+ export class WebSocketLink extends BaseLink {
136
+ #socket;
137
+ #outbox = [];
138
+ constructor(socket) {
139
+ super();
140
+ this.#socket = socket;
141
+ socket.addEventListener("open", () => {
142
+ for (const data of this.#outbox.splice(0))
143
+ socket.send(data);
144
+ });
145
+ socket.addEventListener("message", (event) => {
146
+ try {
147
+ this.deliver(parseFrame(typeof event.data === "string" ? event.data : String(event.data)));
148
+ }
149
+ catch {
150
+ this.close("protocol error");
151
+ }
152
+ });
153
+ socket.addEventListener("close", () => this.ended("socket closed"));
154
+ }
155
+ transmit(frame) {
156
+ const data = JSON.stringify(frame);
157
+ if (this.#socket.readyState === OPEN)
158
+ this.#socket.send(data);
159
+ else
160
+ this.#outbox.push(data);
161
+ }
162
+ shutdown() {
163
+ this.#outbox = [];
164
+ if (this.#socket.readyState <= OPEN)
165
+ this.#socket.close(1000);
166
+ }
167
+ }
168
+ export const webSocketLink = (socket) => new WebSocketLink(socket);
169
+ //# sourceMappingURL=link.js.map