@harrylabsj/kiwi-merchant-cloud 0.12.4 → 0.12.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1813) hide show
  1. package/app/a2a/node.d.ts +5 -1
  2. package/app/a2a/node.js +68 -30
  3. package/app/a2a/node.js.map +1 -1
  4. package/app/a2a/server/merchant-handler.d.ts +4 -0
  5. package/app/a2a/server/merchant-handler.js +123 -45
  6. package/app/a2a/server/merchant-handler.js.map +1 -1
  7. package/app/a2a/server/merchant-product-facts.d.ts +32 -0
  8. package/app/a2a/server/merchant-product-facts.js +57 -0
  9. package/app/a2a/server/merchant-product-facts.js.map +1 -0
  10. package/app/agent/buyer/buyer-tools.js +285 -3
  11. package/app/agent/buyer/buyer-tools.js.map +1 -1
  12. package/app/agent/merchant/types.d.ts +4 -9
  13. package/app/agent/merchant/types.js +14 -0
  14. package/app/agent/merchant/types.js.map +1 -1
  15. package/app/buyer-core/a2a-knp.d.ts +1 -0
  16. package/app/buyer-core/a2a-knp.js +1 -1
  17. package/app/buyer-core/a2a-knp.js.map +1 -1
  18. package/app/buyer-core/a2a-negotiator.d.ts +2 -0
  19. package/app/buyer-core/a2a-negotiator.js +20 -19
  20. package/app/buyer-core/a2a-negotiator.js.map +1 -1
  21. package/app/buyer-core/a2a-quote-fetcher.d.ts +2 -0
  22. package/app/buyer-core/a2a-quote-fetcher.js +13 -5
  23. package/app/buyer-core/a2a-quote-fetcher.js.map +1 -1
  24. package/app/buyer-core/product-summary.d.ts +4 -0
  25. package/app/buyer-core/product-summary.js +6 -0
  26. package/app/buyer-core/product-summary.js.map +1 -1
  27. package/app/buyer-core/protocol-recovery.d.ts +12 -1
  28. package/app/buyer-core/protocol-recovery.js +59 -19
  29. package/app/buyer-core/protocol-recovery.js.map +1 -1
  30. package/app/buyer-core/receive-gate.d.ts +11 -0
  31. package/app/buyer-core/receive-gate.js +107 -0
  32. package/app/buyer-core/receive-gate.js.map +1 -0
  33. package/app/buyer-core/service.d.ts +22 -1
  34. package/app/buyer-core/service.js +325 -33
  35. package/app/buyer-core/service.js.map +1 -1
  36. package/app/buyer-core/store.d.ts +23 -0
  37. package/app/buyer-core/store.js +71 -8
  38. package/app/buyer-core/store.js.map +1 -1
  39. package/app/cloud/bootstrap.d.ts +17 -0
  40. package/app/cloud/bootstrap.js +96 -59
  41. package/app/cloud/bootstrap.js.map +1 -1
  42. package/app/cloud/config.d.ts +26 -0
  43. package/app/cloud/config.js +75 -3
  44. package/app/cloud/config.js.map +1 -1
  45. package/app/cloud/file-listing-publication.js +6 -0
  46. package/app/cloud/file-listing-publication.js.map +1 -1
  47. package/app/cloud/main.d.ts +72 -0
  48. package/app/cloud/main.js +332 -11
  49. package/app/cloud/main.js.map +1 -1
  50. package/app/cloud/owned-clock.d.ts +27 -0
  51. package/app/cloud/owned-clock.js +98 -0
  52. package/app/cloud/owned-clock.js.map +1 -0
  53. package/app/cloud/owned-runtime.d.ts +188 -0
  54. package/app/cloud/owned-runtime.js +1041 -0
  55. package/app/cloud/owned-runtime.js.map +1 -0
  56. package/app/cloud/product-import-tabular.d.ts +1 -1
  57. package/app/cloud/product-import-tabular.js +263 -36
  58. package/app/cloud/product-import-tabular.js.map +1 -1
  59. package/app/cloud/product-source.d.ts +6 -1
  60. package/app/cloud/product-source.js +47 -15
  61. package/app/cloud/product-source.js.map +1 -1
  62. package/app/cloud-sample/products.json +3 -3
  63. package/app/commerce/data-source.d.ts +4 -0
  64. package/app/commerce/data-source.js.map +1 -1
  65. package/app/commerce/shopping-cli-source.js +4 -0
  66. package/app/commerce/shopping-cli-source.js.map +1 -1
  67. package/app/demo/demo-runner.js +6 -0
  68. package/app/demo/demo-runner.js.map +1 -1
  69. package/app/discovery/catalog-source/kiwi-source.d.ts +2 -0
  70. package/app/discovery/catalog-source/kiwi-source.js +4 -0
  71. package/app/discovery/catalog-source/kiwi-source.js.map +1 -1
  72. package/app/handoff/destination.d.ts +2 -0
  73. package/app/handoff/destination.js +4 -0
  74. package/app/handoff/destination.js.map +1 -1
  75. package/app/handoff/index.d.ts +2 -1
  76. package/app/handoff/index.js +1 -0
  77. package/app/handoff/index.js.map +1 -1
  78. package/app/handoff/launch-marketplace-policy.d.ts +149 -0
  79. package/app/handoff/launch-marketplace-policy.js +301 -0
  80. package/app/handoff/launch-marketplace-policy.js.map +1 -0
  81. package/app/handoff/marketplace-product-link.d.ts +18 -0
  82. package/app/handoff/marketplace-product-link.js +71 -0
  83. package/app/handoff/marketplace-product-link.js.map +1 -0
  84. package/app/handoff/transaction.d.ts +30 -0
  85. package/app/handoff/transaction.js +64 -0
  86. package/app/handoff/transaction.js.map +1 -1
  87. package/app/handoff/url-safety.d.ts +3 -0
  88. package/app/handoff/url-safety.js +4 -0
  89. package/app/handoff/url-safety.js.map +1 -1
  90. package/app/http/merchant-management/page.js +176 -45
  91. package/app/http/merchant-management/page.js.map +1 -1
  92. package/app/i18n.d.ts +1 -0
  93. package/app/i18n.js +3 -0
  94. package/app/i18n.js.map +1 -1
  95. package/app/lifecycle/close.d.ts +24 -0
  96. package/app/lifecycle/close.js +131 -0
  97. package/app/lifecycle/close.js.map +1 -0
  98. package/app/mcp/merchant-runtime-assembly.js +6 -4
  99. package/app/mcp/merchant-runtime-assembly.js.map +1 -1
  100. package/app/mcp/tools.js +17 -16
  101. package/app/mcp/tools.js.map +1 -1
  102. package/app/merchant/application/service.d.ts +4 -0
  103. package/app/merchant/application/service.js.map +1 -1
  104. package/app/merchant/stats-store.d.ts +3 -0
  105. package/app/merchant/stats-store.js +15 -1
  106. package/app/merchant/stats-store.js.map +1 -1
  107. package/app/merchant-core/rfq/data-source-adapter.d.ts +2 -10
  108. package/app/merchant-core/rfq/data-source-adapter.js +21 -9
  109. package/app/merchant-core/rfq/data-source-adapter.js.map +1 -1
  110. package/app/merchant-gateway/pinned-fetch.js +5 -2
  111. package/app/merchant-gateway/pinned-fetch.js.map +1 -1
  112. package/build-manifest.json +4103 -3123
  113. package/node_modules/@earendil-works/chord/CHANGELOG.md +20 -0
  114. package/node_modules/@earendil-works/chord/README.md +77 -194
  115. package/node_modules/@earendil-works/chord/dist/cell.d.ts +101 -0
  116. package/node_modules/@earendil-works/chord/dist/cell.d.ts.map +1 -0
  117. package/node_modules/@earendil-works/chord/dist/cell.js +316 -0
  118. package/node_modules/@earendil-works/chord/dist/cell.js.map +1 -0
  119. package/node_modules/@earendil-works/chord/dist/cluster.d.ts +26 -0
  120. package/node_modules/@earendil-works/chord/dist/cluster.d.ts.map +1 -0
  121. package/node_modules/@earendil-works/chord/dist/cluster.js +214 -0
  122. package/node_modules/@earendil-works/chord/dist/cluster.js.map +1 -0
  123. package/node_modules/@earendil-works/chord/dist/connection.d.ts +157 -0
  124. package/node_modules/@earendil-works/chord/dist/connection.d.ts.map +1 -0
  125. package/node_modules/@earendil-works/chord/dist/connection.js +757 -0
  126. package/node_modules/@earendil-works/chord/dist/connection.js.map +1 -0
  127. package/node_modules/@earendil-works/chord/dist/context/index.d.ts +12 -1
  128. package/node_modules/@earendil-works/chord/dist/context/index.d.ts.map +1 -1
  129. package/node_modules/@earendil-works/chord/dist/context/index.js.map +1 -1
  130. package/node_modules/@earendil-works/chord/dist/contract.d.ts +133 -0
  131. package/node_modules/@earendil-works/chord/dist/contract.d.ts.map +1 -0
  132. package/node_modules/@earendil-works/chord/dist/contract.js +157 -0
  133. package/node_modules/@earendil-works/chord/dist/contract.js.map +1 -0
  134. package/node_modules/@earendil-works/chord/dist/declare.d.ts +70 -0
  135. package/node_modules/@earendil-works/chord/dist/declare.d.ts.map +1 -0
  136. package/node_modules/@earendil-works/chord/dist/declare.js +22 -0
  137. package/node_modules/@earendil-works/chord/dist/declare.js.map +1 -0
  138. package/node_modules/@earendil-works/chord/dist/delta/apply-immutable-trusted.js.map +1 -1
  139. package/node_modules/@earendil-works/chord/dist/delta/diff.d.ts +1 -1
  140. package/node_modules/@earendil-works/chord/dist/delta/diff.d.ts.map +1 -1
  141. package/node_modules/@earendil-works/chord/dist/delta/diff.js.map +1 -1
  142. package/node_modules/@earendil-works/chord/dist/delta/index.d.ts +2 -2
  143. package/node_modules/@earendil-works/chord/dist/delta/index.d.ts.map +1 -1
  144. package/node_modules/@earendil-works/chord/dist/delta/index.js +41 -0
  145. package/node_modules/@earendil-works/chord/dist/delta/index.js.map +1 -1
  146. package/node_modules/@earendil-works/chord/dist/delta/revision-validator.d.ts +1 -1
  147. package/node_modules/@earendil-works/chord/dist/delta/revision-validator.d.ts.map +1 -1
  148. package/node_modules/@earendil-works/chord/dist/delta/revision-validator.js.map +1 -1
  149. package/node_modules/@earendil-works/chord/dist/delta/tracker.d.ts +1 -1
  150. package/node_modules/@earendil-works/chord/dist/delta/tracker.d.ts.map +1 -1
  151. package/node_modules/@earendil-works/chord/dist/delta/tracker.js +40 -4
  152. package/node_modules/@earendil-works/chord/dist/delta/tracker.js.map +1 -1
  153. package/node_modules/@earendil-works/chord/dist/errors.d.ts +27 -0
  154. package/node_modules/@earendil-works/chord/dist/errors.d.ts.map +1 -0
  155. package/node_modules/@earendil-works/chord/dist/errors.js +44 -0
  156. package/node_modules/@earendil-works/chord/dist/errors.js.map +1 -0
  157. package/node_modules/@earendil-works/chord/dist/host.d.ts +254 -0
  158. package/node_modules/@earendil-works/chord/dist/host.d.ts.map +1 -0
  159. package/node_modules/@earendil-works/chord/dist/host.js +795 -0
  160. package/node_modules/@earendil-works/chord/dist/host.js.map +1 -0
  161. package/node_modules/@earendil-works/chord/dist/index.d.ts +17 -10
  162. package/node_modules/@earendil-works/chord/dist/index.d.ts.map +1 -1
  163. package/node_modules/@earendil-works/chord/dist/index.js +8 -8
  164. package/node_modules/@earendil-works/chord/dist/index.js.map +1 -1
  165. package/node_modules/@earendil-works/chord/dist/json.d.ts +9 -1
  166. package/node_modules/@earendil-works/chord/dist/json.d.ts.map +1 -1
  167. package/node_modules/@earendil-works/chord/dist/json.js.map +1 -1
  168. package/node_modules/@earendil-works/chord/dist/link.d.ts +72 -0
  169. package/node_modules/@earendil-works/chord/dist/link.d.ts.map +1 -0
  170. package/node_modules/@earendil-works/chord/dist/link.js +169 -0
  171. package/node_modules/@earendil-works/chord/dist/link.js.map +1 -0
  172. package/node_modules/@earendil-works/chord/dist/loader.d.ts +4 -0
  173. package/node_modules/@earendil-works/chord/dist/loader.d.ts.map +1 -0
  174. package/node_modules/@earendil-works/chord/dist/loader.js +68 -0
  175. package/node_modules/@earendil-works/chord/dist/loader.js.map +1 -0
  176. package/node_modules/@earendil-works/chord/dist/manager.d.ts +115 -0
  177. package/node_modules/@earendil-works/chord/dist/manager.d.ts.map +1 -0
  178. package/node_modules/@earendil-works/chord/dist/manager.js +319 -0
  179. package/node_modules/@earendil-works/chord/dist/manager.js.map +1 -0
  180. package/node_modules/@earendil-works/chord/dist/node.d.ts +3 -4
  181. package/node_modules/@earendil-works/chord/dist/node.d.ts.map +1 -1
  182. package/node_modules/@earendil-works/chord/dist/node.js +3 -2
  183. package/node_modules/@earendil-works/chord/dist/node.js.map +1 -1
  184. package/node_modules/@earendil-works/chord/dist/publish.d.ts +5 -0
  185. package/node_modules/@earendil-works/chord/dist/publish.d.ts.map +1 -0
  186. package/node_modules/@earendil-works/chord/dist/publish.js +40 -0
  187. package/node_modules/@earendil-works/chord/dist/publish.js.map +1 -0
  188. package/node_modules/@earendil-works/chord/dist/record.d.ts +320 -0
  189. package/node_modules/@earendil-works/chord/dist/record.d.ts.map +1 -0
  190. package/node_modules/@earendil-works/chord/dist/record.js +1292 -0
  191. package/node_modules/@earendil-works/chord/dist/record.js.map +1 -0
  192. package/node_modules/@earendil-works/chord/dist/registry.d.ts +25 -0
  193. package/node_modules/@earendil-works/chord/dist/registry.d.ts.map +1 -0
  194. package/node_modules/@earendil-works/chord/dist/registry.js +6 -0
  195. package/node_modules/@earendil-works/chord/dist/registry.js.map +1 -0
  196. package/node_modules/@earendil-works/chord/dist/reload.d.ts +118 -0
  197. package/node_modules/@earendil-works/chord/dist/reload.d.ts.map +1 -0
  198. package/node_modules/@earendil-works/chord/dist/reload.js +589 -0
  199. package/node_modules/@earendil-works/chord/dist/reload.js.map +1 -0
  200. package/node_modules/@earendil-works/chord/dist/remote.d.ts +70 -0
  201. package/node_modules/@earendil-works/chord/dist/remote.d.ts.map +1 -0
  202. package/node_modules/@earendil-works/chord/dist/remote.js +308 -0
  203. package/node_modules/@earendil-works/chord/dist/remote.js.map +1 -0
  204. package/node_modules/@earendil-works/chord/dist/schema.d.ts +21 -0
  205. package/node_modules/@earendil-works/chord/dist/schema.d.ts.map +1 -0
  206. package/node_modules/@earendil-works/chord/dist/schema.js +228 -0
  207. package/node_modules/@earendil-works/chord/dist/schema.js.map +1 -0
  208. package/node_modules/@earendil-works/chord/dist/state.d.ts +92 -0
  209. package/node_modules/@earendil-works/chord/dist/state.d.ts.map +1 -0
  210. package/node_modules/@earendil-works/chord/dist/{services/state.js → state.js} +28 -138
  211. package/node_modules/@earendil-works/chord/dist/state.js.map +1 -0
  212. package/node_modules/@earendil-works/chord/dist/types.d.ts +62 -262
  213. package/node_modules/@earendil-works/chord/dist/types.d.ts.map +1 -1
  214. package/node_modules/@earendil-works/chord/dist/types.js.map +1 -1
  215. package/node_modules/@earendil-works/chord/dist/websocket.d.ts +16 -0
  216. package/node_modules/@earendil-works/chord/dist/websocket.d.ts.map +1 -0
  217. package/node_modules/@earendil-works/chord/dist/websocket.js +15 -0
  218. package/node_modules/@earendil-works/chord/dist/websocket.js.map +1 -0
  219. package/node_modules/@earendil-works/chord/dist/wire.d.ts +135 -0
  220. package/node_modules/@earendil-works/chord/dist/wire.d.ts.map +1 -0
  221. package/node_modules/@earendil-works/chord/dist/wire.js +112 -0
  222. package/node_modules/@earendil-works/chord/dist/wire.js.map +1 -0
  223. package/node_modules/@earendil-works/chord/docs/guide.md +750 -0
  224. package/node_modules/@earendil-works/chord/docs/spec.md +261 -0
  225. package/node_modules/@earendil-works/chord/docs/tutorial.md +909 -0
  226. package/node_modules/@earendil-works/chord/package.json +10 -11
  227. package/node_modules/@earendil-works/chord/src/delta/README.md +5 -3
  228. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
  229. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js +9 -1
  230. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js.map +1 -1
  231. package/node_modules/@earendil-works/pi-agent-core/dist/proxy.d.ts +2 -5
  232. package/node_modules/@earendil-works/pi-agent-core/dist/proxy.d.ts.map +1 -1
  233. package/node_modules/@earendil-works/pi-agent-core/dist/proxy.js +2 -14
  234. package/node_modules/@earendil-works/pi-agent-core/dist/proxy.js.map +1 -1
  235. package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts +4 -0
  236. package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts.map +1 -1
  237. package/node_modules/@earendil-works/pi-agent-core/dist/types.js.map +1 -1
  238. package/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
  239. package/node_modules/@earendil-works/pi-ai/README.md +14 -3
  240. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.d.ts.map +1 -1
  241. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +63 -22
  242. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js.map +1 -1
  243. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-config.d.ts +15 -0
  244. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-config.d.ts.map +1 -0
  245. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-config.js +76 -0
  246. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-config.js.map +1 -0
  247. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.d.ts +3 -6
  248. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.d.ts.map +1 -1
  249. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js +2 -74
  250. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js.map +1 -1
  251. package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js +33 -2
  252. package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js.map +1 -1
  253. package/node_modules/@earendil-works/pi-ai/dist/api/classifier-shared.d.ts +21 -0
  254. package/node_modules/@earendil-works/pi-ai/dist/api/classifier-shared.d.ts.map +1 -0
  255. package/node_modules/@earendil-works/pi-ai/dist/api/classifier-shared.js +98 -0
  256. package/node_modules/@earendil-works/pi-ai/dist/api/classifier-shared.js.map +1 -0
  257. package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-workers-ai-system-one.d.ts.map +1 -1
  258. package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-workers-ai-system-one.js +2 -1
  259. package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-workers-ai-system-one.js.map +1 -1
  260. package/node_modules/@earendil-works/pi-ai/dist/api/lazy.d.ts.map +1 -1
  261. package/node_modules/@earendil-works/pi-ai/dist/api/lazy.js +4 -3
  262. package/node_modules/@earendil-works/pi-ai/dist/api/lazy.js.map +1 -1
  263. package/node_modules/@earendil-works/pi-ai/dist/api/llama-cpp-classify.d.ts.map +1 -1
  264. package/node_modules/@earendil-works/pi-ai/dist/api/llama-cpp-classify.js +2 -0
  265. package/node_modules/@earendil-works/pi-ai/dist/api/llama-cpp-classify.js.map +1 -1
  266. package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.d.ts.map +1 -1
  267. package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js +31 -14
  268. package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js.map +1 -1
  269. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.d.ts.map +1 -1
  270. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js +7 -4
  271. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js.map +1 -1
  272. package/node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.d.ts +4 -0
  273. package/node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.d.ts.map +1 -0
  274. package/node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.js +162 -0
  275. package/node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.js.map +1 -0
  276. package/node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.lazy.d.ts +3 -0
  277. package/node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.lazy.d.ts.map +1 -0
  278. package/node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.lazy.js +4 -0
  279. package/node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.lazy.js.map +1 -0
  280. package/node_modules/@earendil-works/pi-ai/dist/api/system-one-shared.d.ts +0 -1
  281. package/node_modules/@earendil-works/pi-ai/dist/api/system-one-shared.d.ts.map +1 -1
  282. package/node_modules/@earendil-works/pi-ai/dist/api/system-one-shared.js +5 -89
  283. package/node_modules/@earendil-works/pi-ai/dist/api/system-one-shared.js.map +1 -1
  284. package/node_modules/@earendil-works/pi-ai/dist/api/typesafe-system-one.d.ts.map +1 -1
  285. package/node_modules/@earendil-works/pi-ai/dist/api/typesafe-system-one.js +2 -1
  286. package/node_modules/@earendil-works/pi-ai/dist/api/typesafe-system-one.js.map +1 -1
  287. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/anthropic.d.ts.map +1 -1
  288. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/anthropic.js +14 -6
  289. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/anthropic.js.map +1 -1
  290. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openai-chatgpt.js +1 -1
  291. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openai-chatgpt.js.map +1 -1
  292. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openai-codex.d.ts.map +1 -1
  293. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openai-codex.js +4 -4
  294. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openai-codex.js.map +1 -1
  295. package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.d.ts +16 -1
  296. package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.d.ts.map +1 -1
  297. package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js +51 -27
  298. package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js.map +1 -1
  299. package/node_modules/@earendil-works/pi-ai/dist/auth/types.d.ts +5 -0
  300. package/node_modules/@earendil-works/pi-ai/dist/auth/types.d.ts.map +1 -1
  301. package/node_modules/@earendil-works/pi-ai/dist/auth/types.js.map +1 -1
  302. package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js +1 -1
  303. package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js.map +1 -1
  304. package/node_modules/@earendil-works/pi-ai/dist/models.d.ts +5 -0
  305. package/node_modules/@earendil-works/pi-ai/dist/models.d.ts.map +1 -1
  306. package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts +4 -4
  307. package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts.map +1 -1
  308. package/node_modules/@earendil-works/pi-ai/dist/models.generated.js +4 -4
  309. package/node_modules/@earendil-works/pi-ai/dist/models.generated.js.map +1 -1
  310. package/node_modules/@earendil-works/pi-ai/dist/models.js +7 -8
  311. package/node_modules/@earendil-works/pi-ai/dist/models.js.map +1 -1
  312. package/node_modules/@earendil-works/pi-ai/dist/providers/all.js +2 -2
  313. package/node_modules/@earendil-works/pi-ai/dist/providers/all.js.map +1 -1
  314. package/node_modules/@earendil-works/pi-ai/dist/providers/azure.d.ts +3 -0
  315. package/node_modules/@earendil-works/pi-ai/dist/providers/azure.d.ts.map +1 -0
  316. package/node_modules/@earendil-works/pi-ai/dist/providers/azure.js +46 -0
  317. package/node_modules/@earendil-works/pi-ai/dist/providers/azure.js.map +1 -0
  318. package/node_modules/@earendil-works/pi-ai/dist/providers/azure.models.d.ts +6 -0
  319. package/node_modules/@earendil-works/pi-ai/dist/providers/azure.models.d.ts.map +1 -0
  320. package/node_modules/@earendil-works/pi-ai/dist/providers/azure.models.js +8 -0
  321. package/node_modules/@earendil-works/pi-ai/dist/providers/azure.models.js.map +1 -0
  322. package/node_modules/@earendil-works/pi-ai/dist/providers/compat-schema.d.ts +338 -0
  323. package/node_modules/@earendil-works/pi-ai/dist/providers/compat-schema.d.ts.map +1 -0
  324. package/node_modules/@earendil-works/pi-ai/dist/providers/compat-schema.js +375 -0
  325. package/node_modules/@earendil-works/pi-ai/dist/providers/compat-schema.js.map +1 -0
  326. package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
  327. package/node_modules/@earendil-works/pi-ai/dist/providers/data/amazon-bedrock.json +1 -1
  328. package/node_modules/@earendil-works/pi-ai/dist/providers/data/anthropic.json +1 -1
  329. package/node_modules/@earendil-works/pi-ai/dist/providers/data/azure.json +1 -0
  330. package/node_modules/@earendil-works/pi-ai/dist/providers/data/baseten.json +1 -1
  331. package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-ai-gateway.json +1 -1
  332. package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-workers-ai.json +1 -1
  333. package/node_modules/@earendil-works/pi-ai/dist/providers/data/github-copilot.json +1 -1
  334. package/node_modules/@earendil-works/pi-ai/dist/providers/data/google-vertex.json +1 -1
  335. package/node_modules/@earendil-works/pi-ai/dist/providers/data/google.json +1 -1
  336. package/node_modules/@earendil-works/pi-ai/dist/providers/data/huggingface.json +1 -1
  337. package/node_modules/@earendil-works/pi-ai/dist/providers/data/meta.json +1 -1
  338. package/node_modules/@earendil-works/pi-ai/dist/providers/data/minimax-cn.json +1 -1
  339. package/node_modules/@earendil-works/pi-ai/dist/providers/data/minimax.json +1 -1
  340. package/node_modules/@earendil-works/pi-ai/dist/providers/data/mistral.json +1 -1
  341. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai.json +1 -1
  342. package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode-go.json +1 -1
  343. package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode.json +1 -1
  344. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
  345. package/node_modules/@earendil-works/pi-ai/dist/providers/data/radius.json +1 -1
  346. package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
  347. package/node_modules/@earendil-works/pi-ai/dist/providers/faux.d.ts.map +1 -1
  348. package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js +25 -8
  349. package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js.map +1 -1
  350. package/node_modules/@earendil-works/pi-ai/dist/providers/model-schema.d.ts +91 -0
  351. package/node_modules/@earendil-works/pi-ai/dist/providers/model-schema.d.ts.map +1 -0
  352. package/node_modules/@earendil-works/pi-ai/dist/providers/model-schema.js +55 -0
  353. package/node_modules/@earendil-works/pi-ai/dist/providers/model-schema.js.map +1 -0
  354. package/node_modules/@earendil-works/pi-ai/dist/providers/openai.d.ts.map +1 -1
  355. package/node_modules/@earendil-works/pi-ai/dist/providers/openai.js +12 -3
  356. package/node_modules/@earendil-works/pi-ai/dist/providers/openai.js.map +1 -1
  357. package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter-api.d.ts +40 -0
  358. package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter-api.d.ts.map +1 -0
  359. package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter-api.js +41 -0
  360. package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter-api.js.map +1 -0
  361. package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.d.ts +11 -1
  362. package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.d.ts.map +1 -1
  363. package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.js +52 -1
  364. package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.js.map +1 -1
  365. package/node_modules/@earendil-works/pi-ai/dist/providers/radius.d.ts.map +1 -1
  366. package/node_modules/@earendil-works/pi-ai/dist/providers/radius.js +4 -12
  367. package/node_modules/@earendil-works/pi-ai/dist/providers/radius.js.map +1 -1
  368. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +22 -305
  369. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
  370. package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -1
  371. package/node_modules/@earendil-works/pi-ai/dist/utils/estimate.js +1 -1
  372. package/node_modules/@earendil-works/pi-ai/dist/utils/estimate.js.map +1 -1
  373. package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.d.ts +10 -1
  374. package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.d.ts.map +1 -1
  375. package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js +25 -0
  376. package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js.map +1 -1
  377. package/node_modules/@earendil-works/pi-ai/dist/utils/model-operations.d.ts +3 -1
  378. package/node_modules/@earendil-works/pi-ai/dist/utils/model-operations.d.ts.map +1 -1
  379. package/node_modules/@earendil-works/pi-ai/dist/utils/model-operations.js +6 -0
  380. package/node_modules/@earendil-works/pi-ai/dist/utils/model-operations.js.map +1 -1
  381. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.d.ts +2 -0
  382. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.d.ts.map +1 -1
  383. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.js +2 -0
  384. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.js.map +1 -1
  385. package/node_modules/@earendil-works/pi-ai/dist/utils/retry.d.ts.map +1 -1
  386. package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +8 -2
  387. package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js.map +1 -1
  388. package/node_modules/@earendil-works/pi-ai/package.json +2 -2
  389. package/node_modules/@earendil-works/pi-codemode/README.md +177 -11
  390. package/node_modules/@earendil-works/pi-codemode/dist/cloudflare.d.ts +53 -0
  391. package/node_modules/@earendil-works/pi-codemode/dist/cloudflare.d.ts.map +1 -0
  392. package/node_modules/@earendil-works/pi-codemode/dist/cloudflare.js +64 -0
  393. package/node_modules/@earendil-works/pi-codemode/dist/cloudflare.js.map +1 -0
  394. package/node_modules/@earendil-works/pi-codemode/dist/declarations.d.ts +6 -21
  395. package/node_modules/@earendil-works/pi-codemode/dist/declarations.d.ts.map +1 -1
  396. package/node_modules/@earendil-works/pi-codemode/dist/declarations.js +113 -127
  397. package/node_modules/@earendil-works/pi-codemode/dist/declarations.js.map +1 -1
  398. package/node_modules/@earendil-works/pi-codemode/dist/index.d.ts +5 -2
  399. package/node_modules/@earendil-works/pi-codemode/dist/index.d.ts.map +1 -1
  400. package/node_modules/@earendil-works/pi-codemode/dist/index.js +4 -1
  401. package/node_modules/@earendil-works/pi-codemode/dist/index.js.map +1 -1
  402. package/node_modules/@earendil-works/pi-codemode/dist/portable.d.ts +15 -0
  403. package/node_modules/@earendil-works/pi-codemode/dist/portable.d.ts.map +1 -0
  404. package/node_modules/@earendil-works/pi-codemode/dist/portable.js +12 -0
  405. package/node_modules/@earendil-works/pi-codemode/dist/portable.js.map +1 -0
  406. package/node_modules/@earendil-works/pi-codemode/dist/runtime/execution.d.ts +66 -0
  407. package/node_modules/@earendil-works/pi-codemode/dist/runtime/execution.d.ts.map +1 -0
  408. package/node_modules/@earendil-works/pi-codemode/dist/runtime/execution.js +494 -0
  409. package/node_modules/@earendil-works/pi-codemode/dist/runtime/execution.js.map +1 -0
  410. package/node_modules/@earendil-works/pi-codemode/dist/runtime/host.d.ts +8 -30
  411. package/node_modules/@earendil-works/pi-codemode/dist/runtime/host.d.ts.map +1 -1
  412. package/node_modules/@earendil-works/pi-codemode/dist/runtime/host.js +41 -283
  413. package/node_modules/@earendil-works/pi-codemode/dist/runtime/host.js.map +1 -1
  414. package/node_modules/@earendil-works/pi-codemode/dist/runtime/inline.d.ts +63 -0
  415. package/node_modules/@earendil-works/pi-codemode/dist/runtime/inline.d.ts.map +1 -0
  416. package/node_modules/@earendil-works/pi-codemode/dist/runtime/inline.js +80 -0
  417. package/node_modules/@earendil-works/pi-codemode/dist/runtime/inline.js.map +1 -0
  418. package/node_modules/@earendil-works/pi-codemode/dist/runtime/prelude-source.d.ts +9 -3
  419. package/node_modules/@earendil-works/pi-codemode/dist/runtime/prelude-source.d.ts.map +1 -1
  420. package/node_modules/@earendil-works/pi-codemode/dist/runtime/prelude-source.js +122 -12
  421. package/node_modules/@earendil-works/pi-codemode/dist/runtime/prelude-source.js.map +1 -1
  422. package/node_modules/@earendil-works/pi-codemode/dist/runtime/protocol.d.ts +47 -6
  423. package/node_modules/@earendil-works/pi-codemode/dist/runtime/protocol.d.ts.map +1 -1
  424. package/node_modules/@earendil-works/pi-codemode/dist/runtime/protocol.js +6 -1
  425. package/node_modules/@earendil-works/pi-codemode/dist/runtime/protocol.js.map +1 -1
  426. package/node_modules/@earendil-works/pi-codemode/dist/runtime/remote.d.ts +102 -0
  427. package/node_modules/@earendil-works/pi-codemode/dist/runtime/remote.d.ts.map +1 -0
  428. package/node_modules/@earendil-works/pi-codemode/dist/runtime/remote.js +175 -0
  429. package/node_modules/@earendil-works/pi-codemode/dist/runtime/remote.js.map +1 -0
  430. package/node_modules/@earendil-works/pi-codemode/dist/runtime/vm.d.ts +24 -0
  431. package/node_modules/@earendil-works/pi-codemode/dist/runtime/vm.d.ts.map +1 -0
  432. package/node_modules/@earendil-works/pi-codemode/dist/runtime/vm.js +293 -0
  433. package/node_modules/@earendil-works/pi-codemode/dist/runtime/vm.js.map +1 -0
  434. package/node_modules/@earendil-works/pi-codemode/dist/runtime/worker.js +11 -110
  435. package/node_modules/@earendil-works/pi-codemode/dist/runtime/worker.js.map +1 -1
  436. package/node_modules/@earendil-works/pi-codemode/dist/source.d.ts +2 -1
  437. package/node_modules/@earendil-works/pi-codemode/dist/source.d.ts.map +1 -1
  438. package/node_modules/@earendil-works/pi-codemode/dist/source.js +8 -2
  439. package/node_modules/@earendil-works/pi-codemode/dist/source.js.map +1 -1
  440. package/node_modules/@earendil-works/pi-codemode/dist/types.d.ts +101 -6
  441. package/node_modules/@earendil-works/pi-codemode/dist/types.d.ts.map +1 -1
  442. package/node_modules/@earendil-works/pi-codemode/dist/types.js.map +1 -1
  443. package/node_modules/@earendil-works/pi-codemode/package.json +15 -3
  444. package/node_modules/@earendil-works/pi-coding-agent/CHANGELOG.md +165 -0
  445. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/anthropic-messages-Q7SXESRX.js +6 -0
  446. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/anthropic.js +1 -1
  447. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/azure-openai-responses-LM52U7CK.js +2 -0
  448. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/bedrock-converse-stream.js +2 -2
  449. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-22CYIUS4.js +2 -0
  450. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-3ZATHNCK.js +9 -0
  451. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-5GTPJSRI.js +7 -0
  452. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-6MWTY2OB.js +130 -0
  453. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-6QGV3IWD.js +6 -0
  454. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-2KAZSACP.js → chunk-AKJ3ZOR3.js} +1 -1
  455. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-G7EDXK4D.js → chunk-CQ3XTLTY.js} +1 -1
  456. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-SYF2TF6W.js → chunk-D7PHKNBM.js} +29 -92
  457. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-DOST5PQW.js +82 -0
  458. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-DVQEBGVL.js +2 -0
  459. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-ZSI3BL5Q.js → chunk-GDR5JFDJ.js} +1 -1
  460. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-HACVPRBJ.js +11 -0
  461. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-ITZNWD4K.js +2 -0
  462. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-LPXNMA2W.js +2 -0
  463. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-LD2P6SFZ.js → chunk-PMRZO46Y.js} +1 -1
  464. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-RDZVAGPR.js +2 -0
  465. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-ZSBPJAJ2.js → chunk-TJXZSVTD.js} +116 -99
  466. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-BYB6ZAAQ.js → chunk-TN4NLWHF.js} +1 -1
  467. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-WBQBCFWG.js +2 -0
  468. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-WJUNYZC5.js +2 -0
  469. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-XIX7LUWI.js +2 -0
  470. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-ZBURYEWF.js +2 -0
  471. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{cli-KILDDGW3.js → cli-SWM4FQ6V.js} +4 -4
  472. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/cloudflare-workers-ai-system-one-UTBL2KOF.js +2 -0
  473. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/codemode-worker.js +117 -14
  474. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/easter-egg-3d-OX6RUCIS.js +2 -0
  475. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/execute-3CFUPDLS.js +499 -0
  476. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/github-copilot.js +1 -1
  477. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{google-generative-ai-ZOK6CV7D.js → google-generative-ai-DXKP72HC.js} +1 -1
  478. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{google-vertex-VKWZQ3AY.js → google-vertex-W6SIDOVV.js} +1 -1
  479. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/image-resize-worker.js +1 -1
  480. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{llama-cpp-classify-XT44PI3C.js → llama-cpp-classify-FYN623RH.js} +2 -2
  481. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/mistral-conversations-GBMHTSYF.js +5 -0
  482. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/openai-chatgpt.js +1 -1
  483. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/openai-codex-responses-RN6B5UPP.js +10 -0
  484. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/openai-codex.js +1 -1
  485. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{openai-completions-GWHGMQ3T.js → openai-completions-QW2B4SML.js} +1 -1
  486. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/openai-decisions-WVPMQ4JD.js +5 -0
  487. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{openai-responses-EZ7FJ2KL.js → openai-responses-KDJUSIU7.js} +1 -1
  488. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{openrouter-images-ZVXWCSIM.js → openrouter-images-DUPG5DZO.js} +1 -1
  489. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{pi-messages-TM5SOOIW.js → pi-messages-YHKPQIHC.js} +1 -1
  490. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/runtime-366HE7CW.js +2 -0
  491. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/typesafe-system-one-ZSK3RN4B.js +2 -0
  492. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/virtual-modules-GI6FRNLG.js +2 -0
  493. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/cli-runtime.js +1 -1
  494. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/index.js +1 -1
  495. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/rpc-entry.js +1 -1
  496. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.d.ts +2 -1
  497. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.d.ts.map +1 -1
  498. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.js +24 -5
  499. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.js.map +1 -1
  500. package/node_modules/@earendil-works/pi-coding-agent/dist/config.d.ts +18 -1
  501. package/node_modules/@earendil-works/pi-coding-agent/dist/config.d.ts.map +1 -1
  502. package/node_modules/@earendil-works/pi-coding-agent/dist/config.js +44 -6
  503. package/node_modules/@earendil-works/pi-coding-agent/dist/config.js.map +1 -1
  504. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.d.ts +47 -5
  505. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
  506. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js +148 -78
  507. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js.map +1 -1
  508. package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.d.ts.map +1 -1
  509. package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.js +20 -13
  510. package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.js.map +1 -1
  511. package/node_modules/@earendil-works/pi-coding-agent/dist/core/bash-executor.d.ts.map +1 -1
  512. package/node_modules/@earendil-works/pi-coding-agent/dist/core/bash-executor.js +42 -52
  513. package/node_modules/@earendil-works/pi-coding-agent/dist/core/bash-executor.js.map +1 -1
  514. package/node_modules/@earendil-works/pi-coding-agent/dist/core/bug-report.d.ts +9 -1
  515. package/node_modules/@earendil-works/pi-coding-agent/dist/core/bug-report.d.ts.map +1 -1
  516. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/utils.d.ts +6 -0
  517. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/utils.d.ts.map +1 -1
  518. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/utils.js +7 -8
  519. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/utils.js.map +1 -1
  520. package/node_modules/@earendil-works/pi-coding-agent/dist/core/export-html/tool-renderer.d.ts.map +1 -1
  521. package/node_modules/@earendil-works/pi-coding-agent/dist/core/export-html/tool-renderer.js +2 -0
  522. package/node_modules/@earendil-works/pi-coding-agent/dist/core/export-html/tool-renderer.js.map +1 -1
  523. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/index.d.ts +1 -1
  524. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/index.d.ts.map +1 -1
  525. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/index.js.map +1 -1
  526. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.d.ts +4 -2
  527. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.d.ts.map +1 -1
  528. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.js +2 -3
  529. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.js.map +1 -1
  530. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/types.d.ts +44 -7
  531. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/types.d.ts.map +1 -1
  532. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/types.js.map +1 -1
  533. package/node_modules/@earendil-works/pi-coding-agent/dist/core/key-id-schema.d.ts +6 -0
  534. package/node_modules/@earendil-works/pi-coding-agent/dist/core/key-id-schema.d.ts.map +1 -0
  535. package/node_modules/@earendil-works/pi-coding-agent/dist/core/key-id-schema.js +16 -0
  536. package/node_modules/@earendil-works/pi-coding-agent/dist/core/key-id-schema.js.map +1 -0
  537. package/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings-schema.d.ts +4 -0
  538. package/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings-schema.d.ts.map +1 -0
  539. package/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings-schema.js +16 -0
  540. package/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings-schema.js.map +1 -0
  541. package/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings.d.ts +198 -66
  542. package/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings.d.ts.map +1 -1
  543. package/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings.js +26 -23
  544. package/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings.js.map +1 -1
  545. package/node_modules/@earendil-works/pi-coding-agent/dist/core/mcp-servers.d.ts +8 -0
  546. package/node_modules/@earendil-works/pi-coding-agent/dist/core/mcp-servers.d.ts.map +1 -1
  547. package/node_modules/@earendil-works/pi-coding-agent/dist/core/mcp-servers.js +30 -7
  548. package/node_modules/@earendil-works/pi-coding-agent/dist/core/mcp-servers.js.map +1 -1
  549. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-config.d.ts +695 -74
  550. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-config.d.ts.map +1 -1
  551. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-config.js +16 -166
  552. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-config.js.map +1 -1
  553. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.js +1 -1
  554. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.js.map +1 -1
  555. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-runtime.d.ts.map +1 -1
  556. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-runtime.js +13 -7
  557. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-runtime.js.map +1 -1
  558. package/node_modules/@earendil-works/pi-coding-agent/dist/core/nested-tool-calls.d.ts +1 -0
  559. package/node_modules/@earendil-works/pi-coding-agent/dist/core/nested-tool-calls.d.ts.map +1 -1
  560. package/node_modules/@earendil-works/pi-coding-agent/dist/core/nested-tool-calls.js +1 -0
  561. package/node_modules/@earendil-works/pi-coding-agent/dist/core/nested-tool-calls.js.map +1 -1
  562. package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.d.ts.map +1 -1
  563. package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.js +3 -3
  564. package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.js.map +1 -1
  565. package/node_modules/@earendil-works/pi-coding-agent/dist/core/project-trust.d.ts.map +1 -1
  566. package/node_modules/@earendil-works/pi-coding-agent/dist/core/project-trust.js +2 -1
  567. package/node_modules/@earendil-works/pi-coding-agent/dist/core/project-trust.js.map +1 -1
  568. package/node_modules/@earendil-works/pi-coding-agent/dist/core/remote-catalog-provider.d.ts +12 -1
  569. package/node_modules/@earendil-works/pi-coding-agent/dist/core/remote-catalog-provider.d.ts.map +1 -1
  570. package/node_modules/@earendil-works/pi-coding-agent/dist/core/remote-catalog-provider.js +82 -24
  571. package/node_modules/@earendil-works/pi-coding-agent/dist/core/remote-catalog-provider.js.map +1 -1
  572. package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.d.ts +3 -0
  573. package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.d.ts.map +1 -1
  574. package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.js +9 -4
  575. package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.js.map +1 -1
  576. package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.d.ts +13 -4
  577. package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.d.ts.map +1 -1
  578. package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.js +19 -6
  579. package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.js.map +1 -1
  580. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-defaults.d.ts +65 -0
  581. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-defaults.d.ts.map +1 -0
  582. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-defaults.js +66 -0
  583. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-defaults.js.map +1 -0
  584. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.d.ts +15 -145
  585. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -1
  586. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.js +85 -57
  587. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.js.map +1 -1
  588. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-schema.d.ts +228 -0
  589. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-schema.d.ts.map +1 -0
  590. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-schema.js +287 -0
  591. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-schema.js.map +1 -0
  592. package/node_modules/@earendil-works/pi-coding-agent/dist/core/skills.d.ts +4 -1
  593. package/node_modules/@earendil-works/pi-coding-agent/dist/core/skills.d.ts.map +1 -1
  594. package/node_modules/@earendil-works/pi-coding-agent/dist/core/skills.js +6 -1
  595. package/node_modules/@earendil-works/pi-coding-agent/dist/core/skills.js.map +1 -1
  596. package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.d.ts +6 -0
  597. package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.d.ts.map +1 -1
  598. package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.js +9 -4
  599. package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.js.map +1 -1
  600. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/output-accumulator.d.ts.map +1 -1
  601. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/output-accumulator.js +4 -10
  602. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/output-accumulator.js.map +1 -1
  603. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.d.ts +13 -0
  604. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.d.ts.map +1 -1
  605. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.js +18 -1
  606. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.js.map +1 -1
  607. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/render-utils.d.ts +18 -0
  608. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/render-utils.d.ts.map +1 -1
  609. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/render-utils.js +46 -0
  610. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/render-utils.js.map +1 -1
  611. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/renderers/bash.d.ts.map +1 -1
  612. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/renderers/bash.js +7 -35
  613. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/renderers/bash.js.map +1 -1
  614. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/renderers/edit.d.ts.map +1 -1
  615. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/renderers/edit.js +5 -4
  616. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/renderers/edit.js.map +1 -1
  617. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/execute.d.ts.map +1 -1
  618. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/execute.js +165 -48
  619. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/execute.js.map +1 -1
  620. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/index.d.ts.map +1 -1
  621. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/index.js +3 -1
  622. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/index.js.map +1 -1
  623. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/renderer.d.ts +2 -2
  624. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/renderer.d.ts.map +1 -1
  625. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/renderer.js +9 -3
  626. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/renderer.js.map +1 -1
  627. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/tool.d.ts +15 -14
  628. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/tool.d.ts.map +1 -1
  629. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/tool.js +58 -38
  630. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/tool.js.map +1 -1
  631. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/llama/provider.d.ts.map +1 -1
  632. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/llama/provider.js +34 -11
  633. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/llama/provider.js.map +1 -1
  634. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/cli.js +22 -31
  635. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/cli.js.map +1 -1
  636. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/index.d.ts.map +1 -1
  637. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/index.js +188 -84
  638. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/index.js.map +1 -1
  639. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/oauth.d.ts +5 -3
  640. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/oauth.d.ts.map +1 -1
  641. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/oauth.js +36 -10
  642. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/oauth.js.map +1 -1
  643. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/resources.d.ts +3 -10
  644. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/resources.d.ts.map +1 -1
  645. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/resources.js +4 -5
  646. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/resources.js.map +1 -1
  647. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/runtime.d.ts +7 -7
  648. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/runtime.d.ts.map +1 -1
  649. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/runtime.js +26 -44
  650. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/runtime.js.map +1 -1
  651. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/tools.d.ts +4 -4
  652. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/tools.d.ts.map +1 -1
  653. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/tools.js +68 -16
  654. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/tools.js.map +1 -1
  655. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/ui.d.ts +3 -3
  656. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/ui.d.ts.map +1 -1
  657. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/ui.js +10 -2
  658. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/ui.js.map +1 -1
  659. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/tool-search/tool.d.ts +0 -2
  660. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/tool-search/tool.d.ts.map +1 -1
  661. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/tool-search/tool.js +2 -4
  662. package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/tool-search/tool.js.map +1 -1
  663. package/node_modules/@earendil-works/pi-coding-agent/dist/index.d.ts +1 -1
  664. package/node_modules/@earendil-works/pi-coding-agent/dist/index.d.ts.map +1 -1
  665. package/node_modules/@earendil-works/pi-coding-agent/dist/index.js.map +1 -1
  666. package/node_modules/@earendil-works/pi-coding-agent/dist/main.d.ts.map +1 -1
  667. package/node_modules/@earendil-works/pi-coding-agent/dist/main.js +4 -3
  668. package/node_modules/@earendil-works/pi-coding-agent/dist/main.js.map +1 -1
  669. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/bash-execution.d.ts +5 -1
  670. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
  671. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/bash-execution.js +17 -14
  672. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/bash-execution.js.map +1 -1
  673. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/branch-summary-message.d.ts +2 -1
  674. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
  675. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/branch-summary-message.js +5 -2
  676. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
  677. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.d.ts +2 -1
  678. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
  679. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.js +5 -2
  680. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
  681. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-entry.d.ts +3 -1
  682. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
  683. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-entry.js +8 -2
  684. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-entry.js.map +1 -1
  685. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
  686. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-message.js +1 -0
  687. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-message.js.map +1 -1
  688. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  689. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-selector.js +4 -3
  690. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-selector.js.map +1 -1
  691. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.d.ts +2 -1
  692. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
  693. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.js +5 -2
  694. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
  695. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/status-indicator.d.ts +1 -1
  696. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
  697. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/status-indicator.js +2 -2
  698. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/status-indicator.js.map +1 -1
  699. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts +5 -0
  700. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  701. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +10 -0
  702. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
  703. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +9 -0
  704. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  705. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js +103 -40
  706. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
  707. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/program-status-reporter.d.ts +34 -0
  708. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/program-status-reporter.d.ts.map +1 -0
  709. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/program-status-reporter.js +110 -0
  710. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/program-status-reporter.js.map +1 -0
  711. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/dark.json +1 -1
  712. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/light.json +1 -1
  713. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-schema.d.ts +28 -0
  714. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-schema.d.ts.map +1 -0
  715. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-schema.js +105 -0
  716. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-schema.js.map +1 -0
  717. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-tokens.d.ts +257 -0
  718. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-tokens.d.ts.map +1 -0
  719. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-tokens.js +94 -0
  720. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-tokens.js.map +1 -0
  721. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts +13 -16
  722. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  723. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme.js +22 -29
  724. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme.js.map +1 -1
  725. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/print-mode.d.ts.map +1 -1
  726. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/print-mode.js +4 -0
  727. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/print-mode.js.map +1 -1
  728. package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.d.ts.map +1 -1
  729. package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.js +24 -0
  730. package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.js.map +1 -1
  731. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/ansi.d.ts +8 -0
  732. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/ansi.d.ts.map +1 -1
  733. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/ansi.js +30 -11
  734. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/ansi.js.map +1 -1
  735. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/clipboard.d.ts.map +1 -1
  736. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/clipboard.js +18 -12
  737. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/clipboard.js.map +1 -1
  738. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-core.d.ts +12 -0
  739. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-core.d.ts.map +1 -1
  740. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-core.js +5 -0
  741. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-core.js.map +1 -1
  742. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-worker.js +3 -2
  743. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-worker.js.map +1 -1
  744. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize.d.ts.map +1 -1
  745. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize.js +9 -10
  746. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize.js.map +1 -1
  747. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/output-files.d.ts +15 -0
  748. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/output-files.d.ts.map +1 -0
  749. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/output-files.js +30 -0
  750. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/output-files.js.map +1 -0
  751. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/syntax-highlight.d.ts.map +1 -1
  752. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/syntax-highlight.js +6 -1
  753. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/syntax-highlight.js.map +1 -1
  754. package/node_modules/@earendil-works/pi-coding-agent/docs/cli-integration.md +1 -1
  755. package/node_modules/@earendil-works/pi-coding-agent/docs/cli.md +19 -7
  756. package/node_modules/@earendil-works/pi-coding-agent/docs/codemode.md +30 -9
  757. package/node_modules/@earendil-works/pi-coding-agent/docs/compaction.md +2 -2
  758. package/node_modules/@earendil-works/pi-coding-agent/docs/environment-variables.md +3 -1
  759. package/node_modules/@earendil-works/pi-coding-agent/docs/extensions.md +7 -4
  760. package/node_modules/@earendil-works/pi-coding-agent/docs/json.md +3 -3
  761. package/node_modules/@earendil-works/pi-coding-agent/docs/keybindings.md +5 -4
  762. package/node_modules/@earendil-works/pi-coding-agent/docs/llama-cpp.md +8 -1
  763. package/node_modules/@earendil-works/pi-coding-agent/docs/mcp.md +4 -2
  764. package/node_modules/@earendil-works/pi-coding-agent/docs/message-types.md +22 -4
  765. package/node_modules/@earendil-works/pi-coding-agent/docs/models.md +5 -1
  766. package/node_modules/@earendil-works/pi-coding-agent/docs/providers.md +47 -0
  767. package/node_modules/@earendil-works/pi-coding-agent/docs/settings.md +6 -4
  768. package/node_modules/@earendil-works/pi-coding-agent/docs/terminal-setup.md +14 -0
  769. package/node_modules/@earendil-works/pi-coding-agent/docs/themes.md +4 -2
  770. package/node_modules/@earendil-works/pi-coding-agent/docs/tui.md +1 -1
  771. package/node_modules/@earendil-works/pi-coding-agent/examples/README.md +0 -3
  772. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  773. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-anthropic/package.json +1 -1
  774. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  775. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/dynamic-resources/dynamic.json +1 -1
  776. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/gondolin/package-lock.json +2 -2
  777. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/gondolin/package.json +1 -1
  778. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/overlay-test.ts +2 -2
  779. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/plan-mode/index.ts +6 -2
  780. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/sandbox/package-lock.json +2 -2
  781. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/sandbox/package.json +1 -1
  782. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/with-deps/package-lock.json +2 -2
  783. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/with-deps/package.json +1 -1
  784. package/node_modules/@earendil-works/pi-coding-agent/package.json +10 -21
  785. package/node_modules/@earendil-works/pi-coding-agent/schemas/keybindings.schema.json +393 -0
  786. package/node_modules/@earendil-works/pi-coding-agent/schemas/models.schema.json +1157 -0
  787. package/node_modules/@earendil-works/pi-coding-agent/schemas/settings.schema.json +765 -0
  788. package/node_modules/@earendil-works/pi-coding-agent/schemas/theme.schema.json +365 -0
  789. package/node_modules/@earendil-works/pi-durable/CHANGELOG.md +114 -0
  790. package/node_modules/@earendil-works/pi-durable/README.md +164 -12
  791. package/node_modules/@earendil-works/pi-durable/dist/codemode/codemode.d.ts +173 -0
  792. package/node_modules/@earendil-works/pi-durable/dist/codemode/codemode.d.ts.map +1 -0
  793. package/node_modules/@earendil-works/pi-durable/dist/codemode/codemode.js +886 -0
  794. package/node_modules/@earendil-works/pi-durable/dist/codemode/codemode.js.map +1 -0
  795. package/node_modules/@earendil-works/pi-durable/dist/codemode/describe.d.ts +38 -0
  796. package/node_modules/@earendil-works/pi-durable/dist/codemode/describe.d.ts.map +1 -0
  797. package/node_modules/@earendil-works/pi-durable/dist/codemode/describe.js +119 -0
  798. package/node_modules/@earendil-works/pi-durable/dist/codemode/describe.js.map +1 -0
  799. package/node_modules/@earendil-works/pi-durable/dist/codemode/index.d.ts +3 -0
  800. package/node_modules/@earendil-works/pi-durable/dist/codemode/index.d.ts.map +1 -0
  801. package/node_modules/@earendil-works/pi-durable/dist/codemode/index.js +3 -0
  802. package/node_modules/@earendil-works/pi-durable/dist/codemode/index.js.map +1 -0
  803. package/node_modules/@earendil-works/pi-durable/dist/codemode/models.d.ts +28 -0
  804. package/node_modules/@earendil-works/pi-durable/dist/codemode/models.d.ts.map +1 -0
  805. package/node_modules/@earendil-works/pi-durable/dist/codemode/models.js +231 -0
  806. package/node_modules/@earendil-works/pi-durable/dist/codemode/models.js.map +1 -0
  807. package/node_modules/@earendil-works/pi-durable/dist/codemode/output.d.ts +41 -0
  808. package/node_modules/@earendil-works/pi-durable/dist/codemode/output.d.ts.map +1 -0
  809. package/node_modules/@earendil-works/pi-durable/dist/codemode/output.js +167 -0
  810. package/node_modules/@earendil-works/pi-durable/dist/codemode/output.js.map +1 -0
  811. package/node_modules/@earendil-works/pi-durable/dist/env/decode.d.ts +16 -0
  812. package/node_modules/@earendil-works/pi-durable/dist/env/decode.d.ts.map +1 -0
  813. package/node_modules/@earendil-works/pi-durable/dist/env/decode.js +28 -0
  814. package/node_modules/@earendil-works/pi-durable/dist/env/decode.js.map +1 -0
  815. package/node_modules/@earendil-works/pi-durable/dist/env/index.d.ts +197 -3
  816. package/node_modules/@earendil-works/pi-durable/dist/env/index.d.ts.map +1 -1
  817. package/node_modules/@earendil-works/pi-durable/dist/env/index.js +2 -0
  818. package/node_modules/@earendil-works/pi-durable/dist/env/index.js.map +1 -1
  819. package/node_modules/@earendil-works/pi-durable/dist/env/line-scan.d.ts +13 -0
  820. package/node_modules/@earendil-works/pi-durable/dist/env/line-scan.d.ts.map +1 -0
  821. package/node_modules/@earendil-works/pi-durable/dist/env/line-scan.js +147 -0
  822. package/node_modules/@earendil-works/pi-durable/dist/env/line-scan.js.map +1 -0
  823. package/node_modules/@earendil-works/pi-durable/dist/env/node-watch.d.ts +29 -0
  824. package/node_modules/@earendil-works/pi-durable/dist/env/node-watch.d.ts.map +1 -0
  825. package/node_modules/@earendil-works/pi-durable/dist/env/node-watch.js +485 -0
  826. package/node_modules/@earendil-works/pi-durable/dist/env/node-watch.js.map +1 -0
  827. package/node_modules/@earendil-works/pi-durable/dist/env/node.d.ts +11 -2
  828. package/node_modules/@earendil-works/pi-durable/dist/env/node.d.ts.map +1 -1
  829. package/node_modules/@earendil-works/pi-durable/dist/env/node.js +284 -21
  830. package/node_modules/@earendil-works/pi-durable/dist/env/node.js.map +1 -1
  831. package/node_modules/@earendil-works/pi-durable/dist/errors.d.ts +20 -3
  832. package/node_modules/@earendil-works/pi-durable/dist/errors.d.ts.map +1 -1
  833. package/node_modules/@earendil-works/pi-durable/dist/errors.js +34 -5
  834. package/node_modules/@earendil-works/pi-durable/dist/errors.js.map +1 -1
  835. package/node_modules/@earendil-works/pi-durable/dist/harness/agent.d.ts +7 -3
  836. package/node_modules/@earendil-works/pi-durable/dist/harness/agent.d.ts.map +1 -1
  837. package/node_modules/@earendil-works/pi-durable/dist/harness/agent.js +81 -25
  838. package/node_modules/@earendil-works/pi-durable/dist/harness/agent.js.map +1 -1
  839. package/node_modules/@earendil-works/pi-durable/dist/harness/compaction.d.ts +6 -1
  840. package/node_modules/@earendil-works/pi-durable/dist/harness/compaction.d.ts.map +1 -1
  841. package/node_modules/@earendil-works/pi-durable/dist/harness/compaction.js +11 -8
  842. package/node_modules/@earendil-works/pi-durable/dist/harness/compaction.js.map +1 -1
  843. package/node_modules/@earendil-works/pi-durable/dist/harness/context.d.ts +29 -1
  844. package/node_modules/@earendil-works/pi-durable/dist/harness/context.d.ts.map +1 -1
  845. package/node_modules/@earendil-works/pi-durable/dist/harness/context.js +125 -24
  846. package/node_modules/@earendil-works/pi-durable/dist/harness/context.js.map +1 -1
  847. package/node_modules/@earendil-works/pi-durable/dist/harness/events.d.ts +35 -15
  848. package/node_modules/@earendil-works/pi-durable/dist/harness/events.d.ts.map +1 -1
  849. package/node_modules/@earendil-works/pi-durable/dist/harness/events.js +77 -23
  850. package/node_modules/@earendil-works/pi-durable/dist/harness/events.js.map +1 -1
  851. package/node_modules/@earendil-works/pi-durable/dist/harness/generation.d.ts +2 -0
  852. package/node_modules/@earendil-works/pi-durable/dist/harness/generation.d.ts.map +1 -1
  853. package/node_modules/@earendil-works/pi-durable/dist/harness/generation.js +40 -16
  854. package/node_modules/@earendil-works/pi-durable/dist/harness/generation.js.map +1 -1
  855. package/node_modules/@earendil-works/pi-durable/dist/harness/harness.d.ts +7 -0
  856. package/node_modules/@earendil-works/pi-durable/dist/harness/harness.d.ts.map +1 -1
  857. package/node_modules/@earendil-works/pi-durable/dist/harness/harness.js +56 -28
  858. package/node_modules/@earendil-works/pi-durable/dist/harness/harness.js.map +1 -1
  859. package/node_modules/@earendil-works/pi-durable/dist/harness/inbox.d.ts +16 -4
  860. package/node_modules/@earendil-works/pi-durable/dist/harness/inbox.d.ts.map +1 -1
  861. package/node_modules/@earendil-works/pi-durable/dist/harness/inbox.js +26 -3
  862. package/node_modules/@earendil-works/pi-durable/dist/harness/inbox.js.map +1 -1
  863. package/node_modules/@earendil-works/pi-durable/dist/harness/live.d.ts +74 -17
  864. package/node_modules/@earendil-works/pi-durable/dist/harness/live.d.ts.map +1 -1
  865. package/node_modules/@earendil-works/pi-durable/dist/harness/live.js +66 -14
  866. package/node_modules/@earendil-works/pi-durable/dist/harness/live.js.map +1 -1
  867. package/node_modules/@earendil-works/pi-durable/dist/harness/output.d.ts +13 -6
  868. package/node_modules/@earendil-works/pi-durable/dist/harness/output.d.ts.map +1 -1
  869. package/node_modules/@earendil-works/pi-durable/dist/harness/output.js +75 -18
  870. package/node_modules/@earendil-works/pi-durable/dist/harness/output.js.map +1 -1
  871. package/node_modules/@earendil-works/pi-durable/dist/harness/scheduler.d.ts +18 -5
  872. package/node_modules/@earendil-works/pi-durable/dist/harness/scheduler.d.ts.map +1 -1
  873. package/node_modules/@earendil-works/pi-durable/dist/harness/scheduler.js +794 -168
  874. package/node_modules/@earendil-works/pi-durable/dist/harness/scheduler.js.map +1 -1
  875. package/node_modules/@earendil-works/pi-durable/dist/harness/submissions.d.ts +7 -4
  876. package/node_modules/@earendil-works/pi-durable/dist/harness/submissions.d.ts.map +1 -1
  877. package/node_modules/@earendil-works/pi-durable/dist/harness/submissions.js +32 -13
  878. package/node_modules/@earendil-works/pi-durable/dist/harness/submissions.js.map +1 -1
  879. package/node_modules/@earendil-works/pi-durable/dist/harness/task-graph.d.ts +1 -1
  880. package/node_modules/@earendil-works/pi-durable/dist/harness/task-graph.d.ts.map +1 -1
  881. package/node_modules/@earendil-works/pi-durable/dist/harness/task-graph.js +15 -10
  882. package/node_modules/@earendil-works/pi-durable/dist/harness/task-graph.js.map +1 -1
  883. package/node_modules/@earendil-works/pi-durable/dist/harness/tool.d.ts +45 -5
  884. package/node_modules/@earendil-works/pi-durable/dist/harness/tool.d.ts.map +1 -1
  885. package/node_modules/@earendil-works/pi-durable/dist/harness/tool.js +400 -67
  886. package/node_modules/@earendil-works/pi-durable/dist/harness/tool.js.map +1 -1
  887. package/node_modules/@earendil-works/pi-durable/dist/harness/types.d.ts +194 -17
  888. package/node_modules/@earendil-works/pi-durable/dist/harness/types.d.ts.map +1 -1
  889. package/node_modules/@earendil-works/pi-durable/dist/harness/types.js.map +1 -1
  890. package/node_modules/@earendil-works/pi-durable/dist/harness/util.d.ts +6 -1
  891. package/node_modules/@earendil-works/pi-durable/dist/harness/util.d.ts.map +1 -1
  892. package/node_modules/@earendil-works/pi-durable/dist/harness/util.js +5 -2
  893. package/node_modules/@earendil-works/pi-durable/dist/harness/util.js.map +1 -1
  894. package/node_modules/@earendil-works/pi-durable/dist/harness/view.d.ts +6 -2
  895. package/node_modules/@earendil-works/pi-durable/dist/harness/view.d.ts.map +1 -1
  896. package/node_modules/@earendil-works/pi-durable/dist/harness/view.js +22 -12
  897. package/node_modules/@earendil-works/pi-durable/dist/harness/view.js.map +1 -1
  898. package/node_modules/@earendil-works/pi-durable/dist/images/cloudflare.d.ts +4 -0
  899. package/node_modules/@earendil-works/pi-durable/dist/images/cloudflare.d.ts.map +1 -0
  900. package/node_modules/@earendil-works/pi-durable/dist/images/cloudflare.js +9 -0
  901. package/node_modules/@earendil-works/pi-durable/dist/images/cloudflare.js.map +1 -0
  902. package/node_modules/@earendil-works/pi-durable/dist/images/exif.d.ts +3 -0
  903. package/node_modules/@earendil-works/pi-durable/dist/images/exif.d.ts.map +1 -0
  904. package/node_modules/@earendil-works/pi-durable/dist/images/exif.js +71 -0
  905. package/node_modules/@earendil-works/pi-durable/dist/images/exif.js.map +1 -0
  906. package/node_modules/@earendil-works/pi-durable/dist/images/index.d.ts +18 -0
  907. package/node_modules/@earendil-works/pi-durable/dist/images/index.d.ts.map +1 -0
  908. package/node_modules/@earendil-works/pi-durable/dist/images/index.js +125 -0
  909. package/node_modules/@earendil-works/pi-durable/dist/images/index.js.map +1 -0
  910. package/node_modules/@earendil-works/pi-durable/dist/images/node-worker.d.ts +17 -0
  911. package/node_modules/@earendil-works/pi-durable/dist/images/node-worker.d.ts.map +1 -0
  912. package/node_modules/@earendil-works/pi-durable/dist/images/node-worker.js +16 -0
  913. package/node_modules/@earendil-works/pi-durable/dist/images/node-worker.js.map +1 -0
  914. package/node_modules/@earendil-works/pi-durable/dist/images/node.d.ts +21 -0
  915. package/node_modules/@earendil-works/pi-durable/dist/images/node.d.ts.map +1 -0
  916. package/node_modules/@earendil-works/pi-durable/dist/images/node.js +121 -0
  917. package/node_modules/@earendil-works/pi-durable/dist/images/node.js.map +1 -0
  918. package/node_modules/@earendil-works/pi-durable/dist/index.d.ts +7 -7
  919. package/node_modules/@earendil-works/pi-durable/dist/index.d.ts.map +1 -1
  920. package/node_modules/@earendil-works/pi-durable/dist/index.js +4 -4
  921. package/node_modules/@earendil-works/pi-durable/dist/index.js.map +1 -1
  922. package/node_modules/@earendil-works/pi-durable/dist/search.d.ts +13 -0
  923. package/node_modules/@earendil-works/pi-durable/dist/search.d.ts.map +1 -0
  924. package/node_modules/@earendil-works/pi-durable/dist/search.js +85 -0
  925. package/node_modules/@earendil-works/pi-durable/dist/search.js.map +1 -0
  926. package/node_modules/@earendil-works/pi-durable/dist/session/observation.d.ts +10 -3
  927. package/node_modules/@earendil-works/pi-durable/dist/session/observation.d.ts.map +1 -1
  928. package/node_modules/@earendil-works/pi-durable/dist/session/observation.js +24 -34
  929. package/node_modules/@earendil-works/pi-durable/dist/session/observation.js.map +1 -1
  930. package/node_modules/@earendil-works/pi-durable/dist/session/session.d.ts +71 -6
  931. package/node_modules/@earendil-works/pi-durable/dist/session/session.d.ts.map +1 -1
  932. package/node_modules/@earendil-works/pi-durable/dist/session/session.js +463 -50
  933. package/node_modules/@earendil-works/pi-durable/dist/session/session.js.map +1 -1
  934. package/node_modules/@earendil-works/pi-durable/dist/session/transaction.d.ts +2 -0
  935. package/node_modules/@earendil-works/pi-durable/dist/session/transaction.d.ts.map +1 -1
  936. package/node_modules/@earendil-works/pi-durable/dist/session/transaction.js +19 -1
  937. package/node_modules/@earendil-works/pi-durable/dist/session/transaction.js.map +1 -1
  938. package/node_modules/@earendil-works/pi-durable/dist/storage/jsonl/storage.d.ts +8 -0
  939. package/node_modules/@earendil-works/pi-durable/dist/storage/jsonl/storage.d.ts.map +1 -1
  940. package/node_modules/@earendil-works/pi-durable/dist/storage/jsonl/storage.js +2 -1
  941. package/node_modules/@earendil-works/pi-durable/dist/storage/jsonl/storage.js.map +1 -1
  942. package/node_modules/@earendil-works/pi-durable/dist/storage/memory.d.ts +2 -0
  943. package/node_modules/@earendil-works/pi-durable/dist/storage/memory.d.ts.map +1 -1
  944. package/node_modules/@earendil-works/pi-durable/dist/storage/memory.js +79 -27
  945. package/node_modules/@earendil-works/pi-durable/dist/storage/memory.js.map +1 -1
  946. package/node_modules/@earendil-works/pi-durable/dist/storage/scan.d.ts +18 -0
  947. package/node_modules/@earendil-works/pi-durable/dist/storage/scan.d.ts.map +1 -0
  948. package/node_modules/@earendil-works/pi-durable/dist/storage/scan.js +29 -0
  949. package/node_modules/@earendil-works/pi-durable/dist/storage/scan.js.map +1 -0
  950. package/node_modules/@earendil-works/pi-durable/dist/storage/sqlite/cloudflare.d.ts +46 -0
  951. package/node_modules/@earendil-works/pi-durable/dist/storage/sqlite/cloudflare.d.ts.map +1 -0
  952. package/node_modules/@earendil-works/pi-durable/dist/storage/sqlite/cloudflare.js +106 -0
  953. package/node_modules/@earendil-works/pi-durable/dist/storage/sqlite/cloudflare.js.map +1 -0
  954. package/node_modules/@earendil-works/pi-durable/dist/storage/sqlite/storage.d.ts +2 -0
  955. package/node_modules/@earendil-works/pi-durable/dist/storage/sqlite/storage.d.ts.map +1 -1
  956. package/node_modules/@earendil-works/pi-durable/dist/storage/sqlite/storage.js +77 -27
  957. package/node_modules/@earendil-works/pi-durable/dist/storage/sqlite/storage.js.map +1 -1
  958. package/node_modules/@earendil-works/pi-durable/dist/testing/env-conformance.d.ts +7 -0
  959. package/node_modules/@earendil-works/pi-durable/dist/testing/env-conformance.d.ts.map +1 -0
  960. package/node_modules/@earendil-works/pi-durable/dist/testing/env-conformance.js +531 -0
  961. package/node_modules/@earendil-works/pi-durable/dist/testing/env-conformance.js.map +1 -0
  962. package/node_modules/@earendil-works/pi-durable/dist/testing/index.d.ts +3 -2
  963. package/node_modules/@earendil-works/pi-durable/dist/testing/index.d.ts.map +1 -1
  964. package/node_modules/@earendil-works/pi-durable/dist/testing/index.js +2 -1
  965. package/node_modules/@earendil-works/pi-durable/dist/testing/index.js.map +1 -1
  966. package/node_modules/@earendil-works/pi-durable/dist/testing/runner.d.ts +4 -2
  967. package/node_modules/@earendil-works/pi-durable/dist/testing/runner.d.ts.map +1 -1
  968. package/node_modules/@earendil-works/pi-durable/dist/testing/runner.js +9 -0
  969. package/node_modules/@earendil-works/pi-durable/dist/testing/runner.js.map +1 -1
  970. package/node_modules/@earendil-works/pi-durable/dist/testing/storage-conformance.d.ts.map +1 -1
  971. package/node_modules/@earendil-works/pi-durable/dist/testing/storage-conformance.js +61 -2
  972. package/node_modules/@earendil-works/pi-durable/dist/testing/storage-conformance.js.map +1 -1
  973. package/node_modules/@earendil-works/pi-durable/dist/testing/types.d.ts +20 -0
  974. package/node_modules/@earendil-works/pi-durable/dist/testing/types.d.ts.map +1 -1
  975. package/node_modules/@earendil-works/pi-durable/dist/testing/types.js.map +1 -1
  976. package/node_modules/@earendil-works/pi-durable/dist/tool-search/index.d.ts +2 -0
  977. package/node_modules/@earendil-works/pi-durable/dist/tool-search/index.d.ts.map +1 -0
  978. package/node_modules/@earendil-works/pi-durable/dist/tool-search/index.js +2 -0
  979. package/node_modules/@earendil-works/pi-durable/dist/tool-search/index.js.map +1 -0
  980. package/node_modules/@earendil-works/pi-durable/dist/tool-search/tool-search.d.ts +23 -0
  981. package/node_modules/@earendil-works/pi-durable/dist/tool-search/tool-search.d.ts.map +1 -0
  982. package/node_modules/@earendil-works/pi-durable/dist/tool-search/tool-search.js +84 -0
  983. package/node_modules/@earendil-works/pi-durable/dist/tool-search/tool-search.js.map +1 -0
  984. package/node_modules/@earendil-works/pi-durable/dist/tools/bash.d.ts +30 -3
  985. package/node_modules/@earendil-works/pi-durable/dist/tools/bash.d.ts.map +1 -1
  986. package/node_modules/@earendil-works/pi-durable/dist/tools/bash.js +105 -37
  987. package/node_modules/@earendil-works/pi-durable/dist/tools/bash.js.map +1 -1
  988. package/node_modules/@earendil-works/pi-durable/dist/tools/edit.js +1 -1
  989. package/node_modules/@earendil-works/pi-durable/dist/tools/edit.js.map +1 -1
  990. package/node_modules/@earendil-works/pi-durable/dist/tools/image-processor.d.ts +47 -0
  991. package/node_modules/@earendil-works/pi-durable/dist/tools/image-processor.d.ts.map +1 -0
  992. package/node_modules/@earendil-works/pi-durable/dist/tools/image-processor.js +30 -0
  993. package/node_modules/@earendil-works/pi-durable/dist/tools/image-processor.js.map +1 -0
  994. package/node_modules/@earendil-works/pi-durable/dist/tools/image.d.ts +18 -0
  995. package/node_modules/@earendil-works/pi-durable/dist/tools/image.d.ts.map +1 -1
  996. package/node_modules/@earendil-works/pi-durable/dist/tools/image.js +86 -0
  997. package/node_modules/@earendil-works/pi-durable/dist/tools/image.js.map +1 -1
  998. package/node_modules/@earendil-works/pi-durable/dist/tools/index.d.ts +26 -3
  999. package/node_modules/@earendil-works/pi-durable/dist/tools/index.d.ts.map +1 -1
  1000. package/node_modules/@earendil-works/pi-durable/dist/tools/index.js +14 -6
  1001. package/node_modules/@earendil-works/pi-durable/dist/tools/index.js.map +1 -1
  1002. package/node_modules/@earendil-works/pi-durable/dist/tools/read.d.ts +10 -2
  1003. package/node_modules/@earendil-works/pi-durable/dist/tools/read.d.ts.map +1 -1
  1004. package/node_modules/@earendil-works/pi-durable/dist/tools/read.js +212 -78
  1005. package/node_modules/@earendil-works/pi-durable/dist/tools/read.js.map +1 -1
  1006. package/node_modules/@earendil-works/pi-durable/dist/tools/write.js +1 -1
  1007. package/node_modules/@earendil-works/pi-durable/dist/tools/write.js.map +1 -1
  1008. package/node_modules/@earendil-works/pi-durable/dist/truncate.d.ts +9 -0
  1009. package/node_modules/@earendil-works/pi-durable/dist/truncate.d.ts.map +1 -1
  1010. package/node_modules/@earendil-works/pi-durable/dist/truncate.js +12 -4
  1011. package/node_modules/@earendil-works/pi-durable/dist/truncate.js.map +1 -1
  1012. package/node_modules/@earendil-works/pi-durable/dist/types.d.ts +89 -12
  1013. package/node_modules/@earendil-works/pi-durable/dist/types.d.ts.map +1 -1
  1014. package/node_modules/@earendil-works/pi-durable/dist/types.js.map +1 -1
  1015. package/node_modules/@earendil-works/pi-durable/package.json +50 -5
  1016. package/node_modules/@earendil-works/pi-mcp/CHANGELOG.md +29 -0
  1017. package/node_modules/@earendil-works/pi-mcp/dist/auth-provider.d.ts +4 -0
  1018. package/node_modules/@earendil-works/pi-mcp/dist/auth-provider.d.ts.map +1 -1
  1019. package/node_modules/@earendil-works/pi-mcp/dist/auth-provider.js.map +1 -1
  1020. package/node_modules/@earendil-works/pi-mcp/dist/client.d.ts.map +1 -1
  1021. package/node_modules/@earendil-works/pi-mcp/dist/client.js +9 -5
  1022. package/node_modules/@earendil-works/pi-mcp/dist/client.js.map +1 -1
  1023. package/node_modules/@earendil-works/pi-mcp/dist/index.d.ts +1 -1
  1024. package/node_modules/@earendil-works/pi-mcp/dist/index.d.ts.map +1 -1
  1025. package/node_modules/@earendil-works/pi-mcp/dist/index.js.map +1 -1
  1026. package/node_modules/@earendil-works/pi-mcp/dist/oauth/discovery.d.ts +3 -0
  1027. package/node_modules/@earendil-works/pi-mcp/dist/oauth/discovery.d.ts.map +1 -1
  1028. package/node_modules/@earendil-works/pi-mcp/dist/oauth/discovery.js +8 -5
  1029. package/node_modules/@earendil-works/pi-mcp/dist/oauth/discovery.js.map +1 -1
  1030. package/node_modules/@earendil-works/pi-mcp/dist/oauth/errors.d.ts +3 -2
  1031. package/node_modules/@earendil-works/pi-mcp/dist/oauth/errors.d.ts.map +1 -1
  1032. package/node_modules/@earendil-works/pi-mcp/dist/oauth/errors.js +3 -1
  1033. package/node_modules/@earendil-works/pi-mcp/dist/oauth/errors.js.map +1 -1
  1034. package/node_modules/@earendil-works/pi-mcp/dist/oauth/flow.d.ts +4 -0
  1035. package/node_modules/@earendil-works/pi-mcp/dist/oauth/flow.d.ts.map +1 -1
  1036. package/node_modules/@earendil-works/pi-mcp/dist/oauth/flow.js +35 -7
  1037. package/node_modules/@earendil-works/pi-mcp/dist/oauth/flow.js.map +1 -1
  1038. package/node_modules/@earendil-works/pi-mcp/dist/oauth/types.d.ts +5 -0
  1039. package/node_modules/@earendil-works/pi-mcp/dist/oauth/types.d.ts.map +1 -1
  1040. package/node_modules/@earendil-works/pi-mcp/dist/oauth/types.js.map +1 -1
  1041. package/node_modules/@earendil-works/pi-mcp/dist/protocol/content.d.ts +2 -1
  1042. package/node_modules/@earendil-works/pi-mcp/dist/protocol/content.d.ts.map +1 -1
  1043. package/node_modules/@earendil-works/pi-mcp/dist/protocol/content.js.map +1 -1
  1044. package/node_modules/@earendil-works/pi-mcp/dist/transports/streamable-http.d.ts +9 -2
  1045. package/node_modules/@earendil-works/pi-mcp/dist/transports/streamable-http.d.ts.map +1 -1
  1046. package/node_modules/@earendil-works/pi-mcp/dist/transports/streamable-http.js +28 -19
  1047. package/node_modules/@earendil-works/pi-mcp/dist/transports/streamable-http.js.map +1 -1
  1048. package/node_modules/@earendil-works/pi-mcp/dist/transports/transport.d.ts +9 -1
  1049. package/node_modules/@earendil-works/pi-mcp/dist/transports/transport.d.ts.map +1 -1
  1050. package/node_modules/@earendil-works/pi-mcp/dist/transports/transport.js.map +1 -1
  1051. package/node_modules/@earendil-works/pi-mcp/package.json +2 -2
  1052. package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
  1053. package/node_modules/@earendil-works/pi-tui/README.md +5 -3
  1054. package/node_modules/@earendil-works/pi-tui/dist/components/box.d.ts +1 -0
  1055. package/node_modules/@earendil-works/pi-tui/dist/components/box.d.ts.map +1 -1
  1056. package/node_modules/@earendil-works/pi-tui/dist/components/box.js +4 -0
  1057. package/node_modules/@earendil-works/pi-tui/dist/components/box.js.map +1 -1
  1058. package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts.map +1 -1
  1059. package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +3 -3
  1060. package/node_modules/@earendil-works/pi-tui/dist/components/editor.js.map +1 -1
  1061. package/node_modules/@earendil-works/pi-tui/dist/components/input.d.ts.map +1 -1
  1062. package/node_modules/@earendil-works/pi-tui/dist/components/input.js +4 -4
  1063. package/node_modules/@earendil-works/pi-tui/dist/components/input.js.map +1 -1
  1064. package/node_modules/@earendil-works/pi-tui/dist/components/text.d.ts +1 -0
  1065. package/node_modules/@earendil-works/pi-tui/dist/components/text.d.ts.map +1 -1
  1066. package/node_modules/@earendil-works/pi-tui/dist/components/text.js +4 -0
  1067. package/node_modules/@earendil-works/pi-tui/dist/components/text.js.map +1 -1
  1068. package/node_modules/@earendil-works/pi-tui/dist/index.d.ts +2 -1
  1069. package/node_modules/@earendil-works/pi-tui/dist/index.d.ts.map +1 -1
  1070. package/node_modules/@earendil-works/pi-tui/dist/index.js +3 -1
  1071. package/node_modules/@earendil-works/pi-tui/dist/index.js.map +1 -1
  1072. package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts +4 -4
  1073. package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts.map +1 -1
  1074. package/node_modules/@earendil-works/pi-tui/dist/keybindings.js +4 -4
  1075. package/node_modules/@earendil-works/pi-tui/dist/keybindings.js.map +1 -1
  1076. package/node_modules/@earendil-works/pi-tui/dist/keys.d.ts.map +1 -1
  1077. package/node_modules/@earendil-works/pi-tui/dist/keys.js +52 -20
  1078. package/node_modules/@earendil-works/pi-tui/dist/keys.js.map +1 -1
  1079. package/node_modules/@earendil-works/pi-tui/dist/program-status.d.ts +23 -0
  1080. package/node_modules/@earendil-works/pi-tui/dist/program-status.d.ts.map +1 -0
  1081. package/node_modules/@earendil-works/pi-tui/dist/program-status.js +43 -0
  1082. package/node_modules/@earendil-works/pi-tui/dist/program-status.js.map +1 -0
  1083. package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.d.ts +4 -2
  1084. package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.d.ts.map +1 -1
  1085. package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.js +36 -1
  1086. package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.js.map +1 -1
  1087. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts.map +1 -1
  1088. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js +5 -0
  1089. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js.map +1 -1
  1090. package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts +17 -0
  1091. package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts.map +1 -1
  1092. package/node_modules/@earendil-works/pi-tui/dist/terminal.js +46 -2
  1093. package/node_modules/@earendil-works/pi-tui/dist/terminal.js.map +1 -1
  1094. package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.d.ts +2 -0
  1095. package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.d.ts.map +1 -1
  1096. package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.js +8 -4
  1097. package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.js.map +1 -1
  1098. package/node_modules/@earendil-works/pi-tui/dist/tui-main-screen.d.ts.map +1 -1
  1099. package/node_modules/@earendil-works/pi-tui/dist/tui-main-screen.js +2 -1
  1100. package/node_modules/@earendil-works/pi-tui/dist/tui-main-screen.js.map +1 -1
  1101. package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts +11 -0
  1102. package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts.map +1 -1
  1103. package/node_modules/@earendil-works/pi-tui/dist/tui.js +23 -1
  1104. package/node_modules/@earendil-works/pi-tui/dist/tui.js.map +1 -1
  1105. package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts.map +1 -1
  1106. package/node_modules/@earendil-works/pi-tui/dist/utils.js +5 -2
  1107. package/node_modules/@earendil-works/pi-tui/dist/utils.js.map +1 -1
  1108. package/node_modules/@earendil-works/pi-tui/package.json +1 -1
  1109. package/node_modules/@silvia-odwyer/photon/LICENSE.md +201 -0
  1110. package/node_modules/@silvia-odwyer/photon/README.md +158 -0
  1111. package/node_modules/@silvia-odwyer/photon/package.json +23 -0
  1112. package/node_modules/@silvia-odwyer/photon/photon_rs.d.ts +3443 -0
  1113. package/node_modules/@silvia-odwyer/photon/photon_rs.js +4572 -0
  1114. package/node_modules/@silvia-odwyer/photon/photon_rs_bg.wasm +0 -0
  1115. package/node_modules/@types/node/README.md +1 -1
  1116. package/node_modules/@types/node/crypto.d.ts +2 -2
  1117. package/node_modules/@types/node/dgram.d.ts +1 -1
  1118. package/node_modules/@types/node/package.json +2 -2
  1119. package/node_modules/@types/node/util.d.ts +6 -3
  1120. package/node_modules/@types/node/zlib.d.ts +6 -0
  1121. package/node_modules/hono/README.md +1 -1
  1122. package/node_modules/hono/dist/_virtual/_rolldown/runtime.js +13 -0
  1123. package/node_modules/hono/dist/adapter/aws-lambda/conninfo.js +42 -23
  1124. package/node_modules/hono/dist/adapter/aws-lambda/handler.js +320 -342
  1125. package/node_modules/hono/dist/adapter/aws-lambda/index.js +2 -8
  1126. package/node_modules/hono/dist/adapter/aws-lambda/types.js +1 -0
  1127. package/node_modules/hono/dist/adapter/bun/conninfo.js +20 -25
  1128. package/node_modules/hono/dist/adapter/bun/index.js +3 -13
  1129. package/node_modules/hono/dist/adapter/bun/serve-static.js +27 -27
  1130. package/node_modules/hono/dist/adapter/bun/server.js +11 -5
  1131. package/node_modules/hono/dist/adapter/bun/ssg.js +25 -15
  1132. package/node_modules/hono/dist/adapter/bun/websocket.js +61 -68
  1133. package/node_modules/hono/dist/adapter/cloudflare-pages/conninfo.js +24 -9
  1134. package/node_modules/hono/dist/adapter/cloudflare-pages/handler.js +59 -62
  1135. package/node_modules/hono/dist/adapter/cloudflare-pages/index.js +2 -8
  1136. package/node_modules/hono/dist/adapter/cloudflare-workers/conninfo.js +7 -9
  1137. package/node_modules/hono/dist/adapter/cloudflare-workers/index.js +3 -8
  1138. package/node_modules/hono/dist/adapter/cloudflare-workers/serve-static-module.js +5 -6
  1139. package/node_modules/hono/dist/adapter/cloudflare-workers/serve-static.js +26 -20
  1140. package/node_modules/hono/dist/adapter/cloudflare-workers/utils.js +21 -34
  1141. package/node_modules/hono/dist/adapter/cloudflare-workers/websocket.js +31 -39
  1142. package/node_modules/hono/dist/adapter/deno/conninfo.js +16 -13
  1143. package/node_modules/hono/dist/adapter/deno/deno.d.js +1 -0
  1144. package/node_modules/hono/dist/adapter/deno/index.js +3 -10
  1145. package/node_modules/hono/dist/adapter/deno/serve-static.js +33 -38
  1146. package/node_modules/hono/dist/adapter/deno/ssg.js +27 -16
  1147. package/node_modules/hono/dist/adapter/deno/websocket.js +30 -30
  1148. package/node_modules/hono/dist/adapter/lambda-edge/conninfo.js +7 -9
  1149. package/node_modules/hono/dist/adapter/lambda-edge/handler.js +102 -87
  1150. package/node_modules/hono/dist/adapter/lambda-edge/index.js +2 -6
  1151. package/node_modules/hono/dist/adapter/netlify/conninfo.js +24 -9
  1152. package/node_modules/hono/dist/adapter/netlify/handler.js +10 -8
  1153. package/node_modules/hono/dist/adapter/netlify/index.js +3 -2
  1154. package/node_modules/hono/dist/adapter/netlify/mod.js +2 -6
  1155. package/node_modules/hono/dist/adapter/service-worker/handler.js +15 -19
  1156. package/node_modules/hono/dist/adapter/service-worker/index.js +23 -7
  1157. package/node_modules/hono/dist/adapter/service-worker/types.js +1 -0
  1158. package/node_modules/hono/dist/adapter/vercel/conninfo.js +7 -10
  1159. package/node_modules/hono/dist/adapter/vercel/handler.js +8 -6
  1160. package/node_modules/hono/dist/adapter/vercel/index.js +2 -6
  1161. package/node_modules/hono/dist/cjs/_virtual/_rolldown/runtime.js +33 -0
  1162. package/node_modules/hono/dist/cjs/adapter/aws-lambda/conninfo.js +42 -44
  1163. package/node_modules/hono/dist/cjs/adapter/aws-lambda/handler.js +328 -371
  1164. package/node_modules/hono/dist/cjs/adapter/aws-lambda/index.js +7 -34
  1165. package/node_modules/hono/dist/cjs/adapter/aws-lambda/types.js +0 -15
  1166. package/node_modules/hono/dist/cjs/adapter/bun/conninfo.js +21 -47
  1167. package/node_modules/hono/dist/cjs/adapter/bun/index.js +14 -45
  1168. package/node_modules/hono/dist/cjs/adapter/bun/serve-static.js +29 -50
  1169. package/node_modules/hono/dist/cjs/adapter/bun/server.js +11 -26
  1170. package/node_modules/hono/dist/cjs/adapter/bun/ssg.js +24 -35
  1171. package/node_modules/hono/dist/cjs/adapter/bun/websocket.js +63 -91
  1172. package/node_modules/hono/dist/cjs/adapter/cloudflare-pages/conninfo.js +25 -31
  1173. package/node_modules/hono/dist/cjs/adapter/cloudflare-pages/handler.js +61 -85
  1174. package/node_modules/hono/dist/cjs/adapter/cloudflare-pages/index.js +7 -34
  1175. package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/conninfo.js +8 -31
  1176. package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/index.js +7 -33
  1177. package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/serve-static-module.js +7 -29
  1178. package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/serve-static.js +27 -42
  1179. package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/utils.js +21 -55
  1180. package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/websocket.js +33 -62
  1181. package/node_modules/hono/dist/cjs/adapter/deno/conninfo.js +16 -34
  1182. package/node_modules/hono/dist/cjs/adapter/deno/index.js +10 -38
  1183. package/node_modules/hono/dist/cjs/adapter/deno/serve-static.js +33 -59
  1184. package/node_modules/hono/dist/cjs/adapter/deno/ssg.js +27 -37
  1185. package/node_modules/hono/dist/cjs/adapter/deno/websocket.js +32 -53
  1186. package/node_modules/hono/dist/cjs/adapter/lambda-edge/conninfo.js +8 -31
  1187. package/node_modules/hono/dist/cjs/adapter/lambda-edge/handler.js +105 -119
  1188. package/node_modules/hono/dist/cjs/adapter/lambda-edge/index.js +5 -30
  1189. package/node_modules/hono/dist/cjs/adapter/netlify/conninfo.js +25 -31
  1190. package/node_modules/hono/dist/cjs/adapter/netlify/handler.js +10 -29
  1191. package/node_modules/hono/dist/cjs/adapter/netlify/index.js +5 -21
  1192. package/node_modules/hono/dist/cjs/adapter/netlify/mod.js +5 -30
  1193. package/node_modules/hono/dist/cjs/adapter/service-worker/handler.js +16 -41
  1194. package/node_modules/hono/dist/cjs/adapter/service-worker/index.js +25 -30
  1195. package/node_modules/hono/dist/cjs/adapter/service-worker/types.js +0 -15
  1196. package/node_modules/hono/dist/cjs/adapter/vercel/conninfo.js +8 -32
  1197. package/node_modules/hono/dist/cjs/adapter/vercel/handler.js +8 -27
  1198. package/node_modules/hono/dist/cjs/adapter/vercel/index.js +5 -30
  1199. package/node_modules/hono/dist/cjs/client/client.js +139 -212
  1200. package/node_modules/hono/dist/cjs/client/fetch-result-please.js +62 -80
  1201. package/node_modules/hono/dist/cjs/client/index.js +7 -32
  1202. package/node_modules/hono/dist/cjs/client/types.js +0 -15
  1203. package/node_modules/hono/dist/cjs/client/utils.js +54 -92
  1204. package/node_modules/hono/dist/cjs/compose.js +49 -66
  1205. package/node_modules/hono/dist/cjs/context.js +379 -450
  1206. package/node_modules/hono/dist/cjs/helper/accepts/accepts.js +47 -70
  1207. package/node_modules/hono/dist/cjs/helper/accepts/index.js +3 -27
  1208. package/node_modules/hono/dist/cjs/helper/adapter/index.js +33 -73
  1209. package/node_modules/hono/dist/cjs/helper/conninfo/index.js +0 -15
  1210. package/node_modules/hono/dist/cjs/helper/conninfo/types.js +0 -15
  1211. package/node_modules/hono/dist/cjs/helper/cookie/index.js +75 -116
  1212. package/node_modules/hono/dist/cjs/helper/css/common.js +165 -244
  1213. package/node_modules/hono/dist/cjs/helper/css/index.js +136 -151
  1214. package/node_modules/hono/dist/cjs/helper/dev/index.js +45 -71
  1215. package/node_modules/hono/dist/cjs/helper/factory/index.js +30 -51
  1216. package/node_modules/hono/dist/cjs/helper/html/index.js +32 -62
  1217. package/node_modules/hono/dist/cjs/helper/proxy/index.js +113 -106
  1218. package/node_modules/hono/dist/cjs/helper/route/index.js +123 -66
  1219. package/node_modules/hono/dist/cjs/helper/ssg/index.js +19 -43
  1220. package/node_modules/hono/dist/cjs/helper/ssg/middleware.js +56 -64
  1221. package/node_modules/hono/dist/cjs/helper/ssg/plugins.js +55 -57
  1222. package/node_modules/hono/dist/cjs/helper/ssg/ssg.js +196 -296
  1223. package/node_modules/hono/dist/cjs/helper/ssg/utils.js +47 -90
  1224. package/node_modules/hono/dist/cjs/helper/streaming/index.js +8 -35
  1225. package/node_modules/hono/dist/cjs/helper/streaming/sse.js +53 -85
  1226. package/node_modules/hono/dist/cjs/helper/streaming/stream.js +23 -53
  1227. package/node_modules/hono/dist/cjs/helper/streaming/text.js +10 -32
  1228. package/node_modules/hono/dist/cjs/helper/streaming/utils.js +13 -32
  1229. package/node_modules/hono/dist/cjs/helper/testing/index.js +16 -31
  1230. package/node_modules/hono/dist/cjs/helper/websocket/index.js +51 -76
  1231. package/node_modules/hono/dist/cjs/hono-base.js +345 -403
  1232. package/node_modules/hono/dist/cjs/hono.js +28 -42
  1233. package/node_modules/hono/dist/cjs/http-exception.js +55 -56
  1234. package/node_modules/hono/dist/cjs/index.js +22 -30
  1235. package/node_modules/hono/dist/cjs/jsx/base.js +237 -366
  1236. package/node_modules/hono/dist/cjs/jsx/children.js +16 -41
  1237. package/node_modules/hono/dist/cjs/jsx/components.js +119 -192
  1238. package/node_modules/hono/dist/cjs/jsx/constants.js +15 -42
  1239. package/node_modules/hono/dist/cjs/jsx/context.js +144 -162
  1240. package/node_modules/hono/dist/cjs/jsx/dom/client.js +49 -69
  1241. package/node_modules/hono/dist/cjs/jsx/dom/components.js +23 -52
  1242. package/node_modules/hono/dist/cjs/jsx/dom/context.js +39 -67
  1243. package/node_modules/hono/dist/cjs/jsx/dom/css.js +143 -158
  1244. package/node_modules/hono/dist/cjs/jsx/dom/hooks/index.js +55 -64
  1245. package/node_modules/hono/dist/cjs/jsx/dom/index.js +114 -173
  1246. package/node_modules/hono/dist/cjs/jsx/dom/intrinsic-element/components.js +282 -375
  1247. package/node_modules/hono/dist/cjs/jsx/dom/jsx-dev-runtime.js +14 -49
  1248. package/node_modules/hono/dist/cjs/jsx/dom/jsx-runtime.js +5 -32
  1249. package/node_modules/hono/dist/cjs/jsx/dom/render.js +471 -589
  1250. package/node_modules/hono/dist/cjs/jsx/dom/server.js +37 -64
  1251. package/node_modules/hono/dist/cjs/jsx/dom/utils.js +7 -30
  1252. package/node_modules/hono/dist/cjs/jsx/hooks/index.js +225 -318
  1253. package/node_modules/hono/dist/cjs/jsx/index.js +86 -135
  1254. package/node_modules/hono/dist/cjs/jsx/intrinsic-element/common.js +20 -43
  1255. package/node_modules/hono/dist/cjs/jsx/intrinsic-element/components.js +117 -168
  1256. package/node_modules/hono/dist/cjs/jsx/intrinsic-elements.js +0 -15
  1257. package/node_modules/hono/dist/cjs/jsx/jsx-dev-runtime.js +14 -39
  1258. package/node_modules/hono/dist/cjs/jsx/jsx-runtime.js +34 -68
  1259. package/node_modules/hono/dist/cjs/jsx/streaming.js +123 -166
  1260. package/node_modules/hono/dist/cjs/jsx/types.js +0 -15
  1261. package/node_modules/hono/dist/cjs/jsx/utils.js +91 -175
  1262. package/node_modules/hono/dist/cjs/middleware/basic-auth/index.js +98 -86
  1263. package/node_modules/hono/dist/cjs/middleware/bearer-auth/index.js +92 -109
  1264. package/node_modules/hono/dist/cjs/middleware/body-limit/index.js +66 -72
  1265. package/node_modules/hono/dist/cjs/middleware/cache/index.js +153 -199
  1266. package/node_modules/hono/dist/cjs/middleware/combine/index.js +133 -95
  1267. package/node_modules/hono/dist/cjs/middleware/compress/index.js +73 -88
  1268. package/node_modules/hono/dist/cjs/middleware/context-storage/index.js +49 -41
  1269. package/node_modules/hono/dist/cjs/middleware/cors/index.js +107 -107
  1270. package/node_modules/hono/dist/cjs/middleware/csrf/index.js +101 -72
  1271. package/node_modules/hono/dist/cjs/middleware/etag/digest.js +58 -97
  1272. package/node_modules/hono/dist/cjs/middleware/etag/index.js +71 -91
  1273. package/node_modules/hono/dist/cjs/middleware/ip-restriction/index.js +161 -169
  1274. package/node_modules/hono/dist/cjs/middleware/jsx-renderer/index.js +99 -77
  1275. package/node_modules/hono/dist/cjs/middleware/jwk/index.js +3 -27
  1276. package/node_modules/hono/dist/cjs/middleware/jwk/jwk.js +118 -135
  1277. package/node_modules/hono/dist/cjs/middleware/jwt/index.js +9 -38
  1278. package/node_modules/hono/dist/cjs/middleware/jwt/jwt.js +120 -141
  1279. package/node_modules/hono/dist/cjs/middleware/language/index.js +7 -35
  1280. package/node_modules/hono/dist/cjs/middleware/language/language.js +184 -179
  1281. package/node_modules/hono/dist/cjs/middleware/logger/index.js +41 -62
  1282. package/node_modules/hono/dist/cjs/middleware/method-not-allowed/index.js +82 -88
  1283. package/node_modules/hono/dist/cjs/middleware/method-override/index.js +101 -102
  1284. package/node_modules/hono/dist/cjs/middleware/powered-by/index.js +23 -30
  1285. package/node_modules/hono/dist/cjs/middleware/pretty-json/index.js +38 -36
  1286. package/node_modules/hono/dist/cjs/middleware/request-id/index.js +3 -27
  1287. package/node_modules/hono/dist/cjs/middleware/request-id/request-id.js +34 -42
  1288. package/node_modules/hono/dist/cjs/middleware/secure-headers/index.js +4 -29
  1289. package/node_modules/hono/dist/cjs/middleware/secure-headers/permissions-policy.js +0 -15
  1290. package/node_modules/hono/dist/cjs/middleware/secure-headers/secure-headers.js +142 -174
  1291. package/node_modules/hono/dist/cjs/middleware/serve-static/index.js +56 -93
  1292. package/node_modules/hono/dist/cjs/middleware/serve-static/path.js +15 -38
  1293. package/node_modules/hono/dist/cjs/middleware/timeout/index.js +40 -45
  1294. package/node_modules/hono/dist/cjs/middleware/timing/index.js +7 -35
  1295. package/node_modules/hono/dist/cjs/middleware/timing/timing.js +177 -118
  1296. package/node_modules/hono/dist/cjs/middleware/trailing-slash/index.js +85 -58
  1297. package/node_modules/hono/dist/cjs/preset/quick.js +18 -37
  1298. package/node_modules/hono/dist/cjs/preset/tiny.js +15 -33
  1299. package/node_modules/hono/dist/cjs/request/constants.js +5 -27
  1300. package/node_modules/hono/dist/cjs/request.js +334 -343
  1301. package/node_modules/hono/dist/cjs/router/linear-router/index.js +3 -27
  1302. package/node_modules/hono/dist/cjs/router/linear-router/router.js +95 -143
  1303. package/node_modules/hono/dist/cjs/router/pattern-router/index.js +3 -27
  1304. package/node_modules/hono/dist/cjs/router/pattern-router/router.js +41 -63
  1305. package/node_modules/hono/dist/cjs/router/reg-exp-router/index.js +7 -34
  1306. package/node_modules/hono/dist/cjs/router/reg-exp-router/matcher.js +18 -45
  1307. package/node_modules/hono/dist/cjs/router/reg-exp-router/node.js +91 -135
  1308. package/node_modules/hono/dist/cjs/router/reg-exp-router/prepared-router.js +92 -161
  1309. package/node_modules/hono/dist/cjs/router/reg-exp-router/router.js +98 -147
  1310. package/node_modules/hono/dist/cjs/router/reg-exp-router/trie.js +73 -89
  1311. package/node_modules/hono/dist/cjs/router/smart-router/index.js +3 -27
  1312. package/node_modules/hono/dist/cjs/router/smart-router/router.js +49 -79
  1313. package/node_modules/hono/dist/cjs/router/trie-router/index.js +3 -27
  1314. package/node_modules/hono/dist/cjs/router/trie-router/node.js +134 -186
  1315. package/node_modules/hono/dist/cjs/router/trie-router/router.js +15 -39
  1316. package/node_modules/hono/dist/cjs/router/utils.js +5 -27
  1317. package/node_modules/hono/dist/cjs/router.js +37 -37
  1318. package/node_modules/hono/dist/cjs/types.js +5 -28
  1319. package/node_modules/hono/dist/cjs/utils/accept.js +177 -228
  1320. package/node_modules/hono/dist/cjs/utils/basic-auth.js +16 -40
  1321. package/node_modules/hono/dist/cjs/utils/body.js +84 -110
  1322. package/node_modules/hono/dist/cjs/utils/buffer.js +43 -91
  1323. package/node_modules/hono/dist/cjs/utils/color.js +35 -44
  1324. package/node_modules/hono/dist/cjs/utils/compress.js +11 -26
  1325. package/node_modules/hono/dist/cjs/utils/concurrent.js +29 -59
  1326. package/node_modules/hono/dist/cjs/utils/constants.js +7 -26
  1327. package/node_modules/hono/dist/cjs/utils/cookie.js +107 -177
  1328. package/node_modules/hono/dist/cjs/utils/crypto.js +30 -61
  1329. package/node_modules/hono/dist/cjs/utils/encode.js +31 -48
  1330. package/node_modules/hono/dist/cjs/utils/filepath.js +23 -54
  1331. package/node_modules/hono/dist/cjs/utils/handler.js +11 -33
  1332. package/node_modules/hono/dist/cjs/utils/headers.js +0 -15
  1333. package/node_modules/hono/dist/cjs/utils/html.js +96 -137
  1334. package/node_modules/hono/dist/cjs/utils/http-status.js +0 -15
  1335. package/node_modules/hono/dist/cjs/utils/ipaddr.js +213 -286
  1336. package/node_modules/hono/dist/cjs/utils/jwt/index.js +14 -27
  1337. package/node_modules/hono/dist/cjs/utils/jwt/jwa.js +25 -42
  1338. package/node_modules/hono/dist/cjs/utils/jwt/jws.js +119 -199
  1339. package/node_modules/hono/dist/cjs/utils/jwt/jwt.js +122 -205
  1340. package/node_modules/hono/dist/cjs/utils/jwt/types.js +122 -159
  1341. package/node_modules/hono/dist/cjs/utils/jwt/utf8.js +9 -28
  1342. package/node_modules/hono/dist/cjs/utils/mime.js +75 -101
  1343. package/node_modules/hono/dist/cjs/utils/stream.js +88 -111
  1344. package/node_modules/hono/dist/cjs/utils/types.js +0 -15
  1345. package/node_modules/hono/dist/cjs/utils/url.js +185 -234
  1346. package/node_modules/hono/dist/cjs/validator/index.js +3 -27
  1347. package/node_modules/hono/dist/cjs/validator/utils.js +0 -15
  1348. package/node_modules/hono/dist/cjs/validator/validator.js +60 -103
  1349. package/node_modules/hono/dist/client/client.js +138 -197
  1350. package/node_modules/hono/dist/client/fetch-result-please.js +59 -56
  1351. package/node_modules/hono/dist/client/index.js +3 -7
  1352. package/node_modules/hono/dist/client/types.js +1 -0
  1353. package/node_modules/hono/dist/client/utils.js +51 -68
  1354. package/node_modules/hono/dist/compose.js +49 -45
  1355. package/node_modules/hono/dist/context.js +376 -426
  1356. package/node_modules/hono/dist/helper/accepts/accepts.js +47 -49
  1357. package/node_modules/hono/dist/helper/accepts/index.js +1 -4
  1358. package/node_modules/hono/dist/helper/adapter/index.js +33 -52
  1359. package/node_modules/hono/dist/helper/conninfo/index.js +1 -0
  1360. package/node_modules/hono/dist/helper/conninfo/types.js +1 -0
  1361. package/node_modules/hono/dist/helper/cookie/index.js +74 -94
  1362. package/node_modules/hono/dist/helper/css/common.js +167 -225
  1363. package/node_modules/hono/dist/helper/css/index.js +132 -137
  1364. package/node_modules/hono/dist/helper/dev/index.js +44 -49
  1365. package/node_modules/hono/dist/helper/factory/index.js +27 -27
  1366. package/node_modules/hono/dist/helper/html/index.js +30 -39
  1367. package/node_modules/hono/dist/helper/proxy/index.js +116 -88
  1368. package/node_modules/hono/dist/helper/route/index.js +121 -43
  1369. package/node_modules/hono/dist/helper/ssg/index.js +3 -18
  1370. package/node_modules/hono/dist/helper/ssg/middleware.js +53 -40
  1371. package/node_modules/hono/dist/helper/ssg/plugins.js +55 -36
  1372. package/node_modules/hono/dist/helper/ssg/ssg.js +198 -283
  1373. package/node_modules/hono/dist/helper/ssg/utils.js +53 -75
  1374. package/node_modules/hono/dist/helper/streaming/index.js +2 -8
  1375. package/node_modules/hono/dist/helper/streaming/sse.js +50 -61
  1376. package/node_modules/hono/dist/helper/streaming/stream.js +22 -31
  1377. package/node_modules/hono/dist/helper/streaming/text.js +9 -10
  1378. package/node_modules/hono/dist/helper/streaming/utils.js +9 -12
  1379. package/node_modules/hono/dist/helper/testing/index.js +16 -10
  1380. package/node_modules/hono/dist/helper/websocket/index.js +49 -53
  1381. package/node_modules/hono/dist/hono-base.js +342 -379
  1382. package/node_modules/hono/dist/hono.js +27 -20
  1383. package/node_modules/hono/dist/http-exception.js +53 -33
  1384. package/node_modules/hono/dist/index.js +19 -6
  1385. package/node_modules/hono/dist/jsx/base.js +231 -340
  1386. package/node_modules/hono/dist/jsx/children.js +16 -20
  1387. package/node_modules/hono/dist/jsx/components.js +118 -170
  1388. package/node_modules/hono/dist/jsx/constants.js +9 -15
  1389. package/node_modules/hono/dist/jsx/context.js +153 -150
  1390. package/node_modules/hono/dist/jsx/dom/client.js +45 -48
  1391. package/node_modules/hono/dist/jsx/dom/components.js +21 -29
  1392. package/node_modules/hono/dist/jsx/dom/context.js +37 -44
  1393. package/node_modules/hono/dist/jsx/dom/css.js +142 -147
  1394. package/node_modules/hono/dist/jsx/dom/hooks/index.js +52 -40
  1395. package/node_modules/hono/dist/jsx/dom/index.js +71 -134
  1396. package/node_modules/hono/dist/jsx/dom/intrinsic-element/components.js +275 -359
  1397. package/node_modules/hono/dist/jsx/dom/jsx-dev-runtime.js +14 -18
  1398. package/node_modules/hono/dist/jsx/dom/jsx-runtime.js +2 -8
  1399. package/node_modules/hono/dist/jsx/dom/render.js +492 -595
  1400. package/node_modules/hono/dist/jsx/dom/server.js +32 -32
  1401. package/node_modules/hono/dist/jsx/dom/utils.js +6 -8
  1402. package/node_modules/hono/dist/jsx/hooks/index.js +236 -308
  1403. package/node_modules/hono/dist/jsx/index.js +45 -98
  1404. package/node_modules/hono/dist/jsx/intrinsic-element/common.js +20 -22
  1405. package/node_modules/hono/dist/jsx/intrinsic-element/components.js +113 -154
  1406. package/node_modules/hono/dist/jsx/intrinsic-elements.js +1 -0
  1407. package/node_modules/hono/dist/jsx/jsx-dev-runtime.js +12 -16
  1408. package/node_modules/hono/dist/jsx/jsx-runtime.js +29 -42
  1409. package/node_modules/hono/dist/jsx/streaming.js +120 -142
  1410. package/node_modules/hono/dist/jsx/types.js +1 -0
  1411. package/node_modules/hono/dist/jsx/utils.js +105 -168
  1412. package/node_modules/hono/dist/middleware/basic-auth/index.js +96 -63
  1413. package/node_modules/hono/dist/middleware/bearer-auth/index.js +93 -89
  1414. package/node_modules/hono/dist/middleware/body-limit/index.js +66 -51
  1415. package/node_modules/hono/dist/middleware/cache/index.js +165 -190
  1416. package/node_modules/hono/dist/middleware/combine/index.js +132 -73
  1417. package/node_modules/hono/dist/middleware/compress/index.js +75 -69
  1418. package/node_modules/hono/dist/middleware/context-storage/index.js +49 -19
  1419. package/node_modules/hono/dist/middleware/cors/index.js +107 -86
  1420. package/node_modules/hono/dist/middleware/csrf/index.js +103 -53
  1421. package/node_modules/hono/dist/middleware/etag/digest.js +59 -77
  1422. package/node_modules/hono/dist/middleware/etag/index.js +71 -70
  1423. package/node_modules/hono/dist/middleware/ip-restriction/index.js +163 -158
  1424. package/node_modules/hono/dist/middleware/jsx-renderer/index.js +97 -54
  1425. package/node_modules/hono/dist/middleware/jwk/index.js +1 -4
  1426. package/node_modules/hono/dist/middleware/jwk/jwk.js +116 -112
  1427. package/node_modules/hono/dist/middleware/jwt/index.js +2 -10
  1428. package/node_modules/hono/dist/middleware/jwt/jwt.js +114 -114
  1429. package/node_modules/hono/dist/middleware/language/index.js +2 -15
  1430. package/node_modules/hono/dist/middleware/language/language.js +180 -154
  1431. package/node_modules/hono/dist/middleware/logger/index.js +43 -37
  1432. package/node_modules/hono/dist/middleware/method-not-allowed/index.js +81 -66
  1433. package/node_modules/hono/dist/middleware/method-override/index.js +101 -81
  1434. package/node_modules/hono/dist/middleware/powered-by/index.js +23 -9
  1435. package/node_modules/hono/dist/middleware/pretty-json/index.js +39 -16
  1436. package/node_modules/hono/dist/middleware/request-id/index.js +1 -4
  1437. package/node_modules/hono/dist/middleware/request-id/request-id.js +33 -20
  1438. package/node_modules/hono/dist/middleware/secure-headers/index.js +1 -5
  1439. package/node_modules/hono/dist/middleware/secure-headers/permissions-policy.js +1 -0
  1440. package/node_modules/hono/dist/middleware/secure-headers/secure-headers.js +144 -155
  1441. package/node_modules/hono/dist/middleware/serve-static/index.js +56 -72
  1442. package/node_modules/hono/dist/middleware/serve-static/path.js +15 -17
  1443. package/node_modules/hono/dist/middleware/timeout/index.js +40 -23
  1444. package/node_modules/hono/dist/middleware/timing/index.js +2 -9
  1445. package/node_modules/hono/dist/middleware/timing/timing.js +177 -97
  1446. package/node_modules/hono/dist/middleware/trailing-slash/index.js +85 -37
  1447. package/node_modules/hono/dist/preset/quick.js +17 -15
  1448. package/node_modules/hono/dist/preset/tiny.js +14 -11
  1449. package/node_modules/hono/dist/request/constants.js +4 -5
  1450. package/node_modules/hono/dist/request.js +328 -316
  1451. package/node_modules/hono/dist/router/linear-router/index.js +1 -4
  1452. package/node_modules/hono/dist/router/linear-router/router.js +93 -120
  1453. package/node_modules/hono/dist/router/pattern-router/index.js +1 -4
  1454. package/node_modules/hono/dist/router/pattern-router/router.js +39 -40
  1455. package/node_modules/hono/dist/router/reg-exp-router/index.js +1 -7
  1456. package/node_modules/hono/dist/router/reg-exp-router/matcher.js +17 -23
  1457. package/node_modules/hono/dist/router/reg-exp-router/node.js +87 -110
  1458. package/node_modules/hono/dist/router/reg-exp-router/prepared-router.js +89 -137
  1459. package/node_modules/hono/dist/router/reg-exp-router/router.js +92 -129
  1460. package/node_modules/hono/dist/router/reg-exp-router/trie.js +69 -64
  1461. package/node_modules/hono/dist/router/smart-router/index.js +1 -4
  1462. package/node_modules/hono/dist/router/smart-router/router.js +46 -55
  1463. package/node_modules/hono/dist/router/trie-router/index.js +1 -4
  1464. package/node_modules/hono/dist/router/trie-router/node.js +131 -162
  1465. package/node_modules/hono/dist/router/trie-router/router.js +11 -14
  1466. package/node_modules/hono/dist/router/utils.js +4 -5
  1467. package/node_modules/hono/dist/router.js +35 -14
  1468. package/node_modules/hono/dist/types/adapter/aws-lambda/conninfo.d.ts +4 -1
  1469. package/node_modules/hono/dist/types/adapter/aws-lambda/handler.d.ts +150 -105
  1470. package/node_modules/hono/dist/types/adapter/aws-lambda/index.d.ts +4 -8
  1471. package/node_modules/hono/dist/types/adapter/aws-lambda/types.d.ts +152 -123
  1472. package/node_modules/hono/dist/types/adapter/bun/conninfo.d.ts +4 -1
  1473. package/node_modules/hono/dist/types/adapter/bun/index.d.ts +6 -10
  1474. package/node_modules/hono/dist/types/adapter/bun/serve-static.d.ts +7 -2
  1475. package/node_modules/hono/dist/types/adapter/bun/server.d.ts +4 -5
  1476. package/node_modules/hono/dist/types/adapter/bun/ssg.d.ts +5 -1
  1477. package/node_modules/hono/dist/types/adapter/bun/websocket.d.ts +31 -17
  1478. package/node_modules/hono/dist/types/adapter/cloudflare-pages/conninfo.d.ts +4 -1
  1479. package/node_modules/hono/dist/types/adapter/cloudflare-pages/handler.d.ts +29 -18
  1480. package/node_modules/hono/dist/types/adapter/cloudflare-pages/index.d.ts +3 -7
  1481. package/node_modules/hono/dist/types/adapter/cloudflare-workers/conninfo.d.ts +6 -1
  1482. package/node_modules/hono/dist/types/adapter/cloudflare-workers/index.d.ts +4 -7
  1483. package/node_modules/hono/dist/types/adapter/cloudflare-workers/serve-static-module.d.ts +5 -3
  1484. package/node_modules/hono/dist/types/adapter/cloudflare-workers/serve-static.d.ts +10 -5
  1485. package/node_modules/hono/dist/types/adapter/cloudflare-workers/utils.d.ts +10 -2
  1486. package/node_modules/hono/dist/types/adapter/cloudflare-workers/websocket.d.ts +6 -1
  1487. package/node_modules/hono/dist/types/adapter/deno/conninfo.d.ts +4 -1
  1488. package/node_modules/hono/dist/types/adapter/deno/deno.d.ts +1 -0
  1489. package/node_modules/hono/dist/types/adapter/deno/index.d.ts +5 -8
  1490. package/node_modules/hono/dist/types/adapter/deno/serve-static.d.ts +7 -2
  1491. package/node_modules/hono/dist/types/adapter/deno/ssg.d.ts +5 -1
  1492. package/node_modules/hono/dist/types/adapter/deno/websocket.d.ts +6 -1
  1493. package/node_modules/hono/dist/types/adapter/lambda-edge/conninfo.d.ts +6 -1
  1494. package/node_modules/hono/dist/types/adapter/lambda-edge/handler.d.ts +83 -58
  1495. package/node_modules/hono/dist/types/adapter/lambda-edge/index.d.ts +3 -7
  1496. package/node_modules/hono/dist/types/adapter/netlify/conninfo.d.ts +4 -1
  1497. package/node_modules/hono/dist/types/adapter/netlify/handler.d.ts +6 -1
  1498. package/node_modules/hono/dist/types/adapter/netlify/index.d.ts +3 -5
  1499. package/node_modules/hono/dist/types/adapter/netlify/mod.d.ts +3 -2
  1500. package/node_modules/hono/dist/types/adapter/service-worker/handler.d.ts +9 -8
  1501. package/node_modules/hono/dist/types/adapter/service-worker/index.d.ts +6 -9
  1502. package/node_modules/hono/dist/types/adapter/service-worker/types.d.ts +12 -8
  1503. package/node_modules/hono/dist/types/adapter/vercel/conninfo.d.ts +6 -1
  1504. package/node_modules/hono/dist/types/adapter/vercel/handler.d.ts +6 -1
  1505. package/node_modules/hono/dist/types/adapter/vercel/index.d.ts +3 -6
  1506. package/node_modules/hono/dist/types/client/client.d.ts +5 -3
  1507. package/node_modules/hono/dist/types/client/fetch-result-please.d.ts +21 -19
  1508. package/node_modules/hono/dist/types/client/index.d.ts +5 -7
  1509. package/node_modules/hono/dist/types/client/types.d.ts +134 -160
  1510. package/node_modules/hono/dist/types/client/utils.d.ts +6 -4
  1511. package/node_modules/hono/dist/types/compose.d.ts +4 -2
  1512. package/node_modules/hono/dist/types/context.d.ts +335 -336
  1513. package/node_modules/hono/dist/types/helper/accepts/accepts.d.ts +11 -9
  1514. package/node_modules/hono/dist/types/helper/accepts/index.d.ts +2 -5
  1515. package/node_modules/hono/dist/types/helper/adapter/index.d.ts +4 -6
  1516. package/node_modules/hono/dist/types/helper/conninfo/index.d.ts +2 -5
  1517. package/node_modules/hono/dist/types/helper/conninfo/types.d.ts +25 -23
  1518. package/node_modules/hono/dist/types/helper/cookie/index.d.ts +10 -13
  1519. package/node_modules/hono/dist/types/helper/css/common.d.ts +11 -10
  1520. package/node_modules/hono/dist/types/helper/css/index.d.ts +25 -28
  1521. package/node_modules/hono/dist/types/helper/dev/index.d.ts +10 -13
  1522. package/node_modules/hono/dist/types/helper/factory/index.d.ts +26 -74
  1523. package/node_modules/hono/dist/types/helper/html/index.d.ts +4 -7
  1524. package/node_modules/hono/dist/types/helper/proxy/index.d.ts +20 -23
  1525. package/node_modules/hono/dist/types/helper/route/index.d.ts +6 -4
  1526. package/node_modules/hono/dist/types/helper/ssg/index.d.ts +4 -7
  1527. package/node_modules/hono/dist/types/helper/ssg/middleware.d.ts +8 -7
  1528. package/node_modules/hono/dist/types/helper/ssg/plugins.d.ts +3 -1
  1529. package/node_modules/hono/dist/types/helper/ssg/ssg.d.ts +38 -36
  1530. package/node_modules/hono/dist/types/helper/ssg/utils.d.ts +5 -4
  1531. package/node_modules/hono/dist/types/helper/streaming/index.d.ts +4 -8
  1532. package/node_modules/hono/dist/types/helper/streaming/sse.d.ts +10 -8
  1533. package/node_modules/hono/dist/types/helper/streaming/stream.d.ts +4 -2
  1534. package/node_modules/hono/dist/types/helper/streaming/text.d.ts +4 -2
  1535. package/node_modules/hono/dist/types/helper/streaming/utils.d.ts +2 -0
  1536. package/node_modules/hono/dist/types/helper/testing/index.d.ts +7 -10
  1537. package/node_modules/hono/dist/types/helper/websocket/index.d.ts +30 -33
  1538. package/node_modules/hono/dist/types/hono-base.d.ts +208 -211
  1539. package/node_modules/hono/dist/types/hono.d.ts +11 -10
  1540. package/node_modules/hono/dist/types/http-exception.d.ts +20 -23
  1541. package/node_modules/hono/dist/types/index.d.ts +6 -37
  1542. package/node_modules/hono/dist/types/jsx/base.d.ts +36 -35
  1543. package/node_modules/hono/dist/types/jsx/children.d.ts +8 -6
  1544. package/node_modules/hono/dist/types/jsx/components.d.ts +8 -5
  1545. package/node_modules/hono/dist/types/jsx/constants.d.ts +2 -0
  1546. package/node_modules/hono/dist/types/jsx/context.d.ts +9 -7
  1547. package/node_modules/hono/dist/types/jsx/dom/client.d.ts +8 -10
  1548. package/node_modules/hono/dist/types/jsx/dom/components.d.ts +9 -6
  1549. package/node_modules/hono/dist/types/jsx/dom/context.d.ts +3 -1
  1550. package/node_modules/hono/dist/types/jsx/dom/css.d.ts +26 -30
  1551. package/node_modules/hono/dist/types/jsx/dom/hooks/index.d.ts +11 -13
  1552. package/node_modules/hono/dist/types/jsx/dom/index.d.ts +78 -83
  1553. package/node_modules/hono/dist/types/jsx/dom/intrinsic-element/components.d.ts +9 -5
  1554. package/node_modules/hono/dist/types/jsx/dom/jsx-dev-runtime.d.ts +4 -6
  1555. package/node_modules/hono/dist/types/jsx/dom/jsx-runtime.d.ts +3 -7
  1556. package/node_modules/hono/dist/types/jsx/dom/render.d.ts +32 -51
  1557. package/node_modules/hono/dist/types/jsx/dom/server.d.ts +86 -85
  1558. package/node_modules/hono/dist/types/jsx/dom/utils.d.ts +2 -0
  1559. package/node_modules/hono/dist/types/jsx/hooks/index.d.ts +16 -17
  1560. package/node_modules/hono/dist/types/jsx/index.d.ts +70 -73
  1561. package/node_modules/hono/dist/types/jsx/intrinsic-element/common.d.ts +3 -1
  1562. package/node_modules/hono/dist/types/jsx/intrinsic-element/components.d.ts +7 -4
  1563. package/node_modules/hono/dist/types/jsx/intrinsic-elements.d.ts +708 -708
  1564. package/node_modules/hono/dist/types/jsx/jsx-dev-runtime.d.ts +4 -7
  1565. package/node_modules/hono/dist/types/jsx/jsx-runtime.d.ts +7 -10
  1566. package/node_modules/hono/dist/types/jsx/streaming.d.ts +9 -10
  1567. package/node_modules/hono/dist/types/jsx/types.d.ts +11 -13
  1568. package/node_modules/hono/dist/types/jsx/utils.d.ts +2 -0
  1569. package/node_modules/hono/dist/types/middleware/basic-auth/index.d.ts +17 -20
  1570. package/node_modules/hono/dist/types/middleware/bearer-auth/index.d.ts +46 -49
  1571. package/node_modules/hono/dist/types/middleware/body-limit/index.d.ts +6 -9
  1572. package/node_modules/hono/dist/types/middleware/cache/index.d.ts +13 -15
  1573. package/node_modules/hono/dist/types/middleware/combine/index.d.ts +7 -8
  1574. package/node_modules/hono/dist/types/middleware/compress/index.d.ts +8 -10
  1575. package/node_modules/hono/dist/types/middleware/context-storage/index.d.ts +4 -6
  1576. package/node_modules/hono/dist/types/middleware/cors/index.d.ts +10 -13
  1577. package/node_modules/hono/dist/types/middleware/csrf/index.d.ts +6 -9
  1578. package/node_modules/hono/dist/types/middleware/etag/digest.d.ts +2 -0
  1579. package/node_modules/hono/dist/types/middleware/etag/index.d.ts +6 -9
  1580. package/node_modules/hono/dist/types/middleware/ip-restriction/index.d.ts +11 -13
  1581. package/node_modules/hono/dist/types/middleware/jsx-renderer/index.d.ts +11 -12
  1582. package/node_modules/hono/dist/types/middleware/jwk/index.d.ts +2 -1
  1583. package/node_modules/hono/dist/types/middleware/jwk/jwk.d.ts +20 -23
  1584. package/node_modules/hono/dist/types/middleware/jwt/index.d.ts +6 -6
  1585. package/node_modules/hono/dist/types/middleware/jwt/jwt.d.ts +28 -30
  1586. package/node_modules/hono/dist/types/middleware/language/index.d.ts +5 -5
  1587. package/node_modules/hono/dist/types/middleware/language/language.d.ts +42 -44
  1588. package/node_modules/hono/dist/types/middleware/logger/index.d.ts +3 -6
  1589. package/node_modules/hono/dist/types/middleware/method-not-allowed/index.d.ts +7 -10
  1590. package/node_modules/hono/dist/types/middleware/method-override/index.d.ts +14 -17
  1591. package/node_modules/hono/dist/types/middleware/powered-by/index.d.ts +8 -11
  1592. package/node_modules/hono/dist/types/middleware/pretty-json/index.d.ts +18 -21
  1593. package/node_modules/hono/dist/types/middleware/request-id/index.d.ts +5 -5
  1594. package/node_modules/hono/dist/types/middleware/request-id/request-id.d.ts +9 -11
  1595. package/node_modules/hono/dist/types/middleware/secure-headers/index.d.ts +5 -6
  1596. package/node_modules/hono/dist/types/middleware/secure-headers/permissions-policy.d.ts +2 -1
  1597. package/node_modules/hono/dist/types/middleware/secure-headers/secure-headers.d.ts +55 -58
  1598. package/node_modules/hono/dist/types/middleware/serve-static/index.d.ts +24 -24
  1599. package/node_modules/hono/dist/types/middleware/serve-static/path.d.ts +2 -0
  1600. package/node_modules/hono/dist/types/middleware/timeout/index.d.ts +5 -7
  1601. package/node_modules/hono/dist/types/middleware/timing/index.d.ts +5 -5
  1602. package/node_modules/hono/dist/types/middleware/timing/timing.d.ts +17 -21
  1603. package/node_modules/hono/dist/types/middleware/trailing-slash/index.d.ts +35 -38
  1604. package/node_modules/hono/dist/types/preset/quick.d.ts +6 -9
  1605. package/node_modules/hono/dist/types/preset/tiny.d.ts +6 -9
  1606. package/node_modules/hono/dist/types/request/constants.d.ts +2 -0
  1607. package/node_modules/hono/dist/types/request.d.ts +288 -287
  1608. package/node_modules/hono/dist/types/router/linear-router/index.d.ts +2 -5
  1609. package/node_modules/hono/dist/types/router/linear-router/router.d.ts +7 -5
  1610. package/node_modules/hono/dist/types/router/pattern-router/index.d.ts +2 -5
  1611. package/node_modules/hono/dist/types/router/pattern-router/router.d.ts +7 -5
  1612. package/node_modules/hono/dist/types/router/reg-exp-router/index.d.ts +3 -6
  1613. package/node_modules/hono/dist/types/router/reg-exp-router/matcher.d.ts +3 -1
  1614. package/node_modules/hono/dist/types/router/reg-exp-router/node.d.ts +6 -4
  1615. package/node_modules/hono/dist/types/router/reg-exp-router/prepared-router.d.ts +11 -11
  1616. package/node_modules/hono/dist/types/router/reg-exp-router/router.d.ts +10 -9
  1617. package/node_modules/hono/dist/types/router/reg-exp-router/trie.d.ts +7 -5
  1618. package/node_modules/hono/dist/types/router/smart-router/index.d.ts +2 -5
  1619. package/node_modules/hono/dist/types/router/smart-router/router.d.ts +11 -9
  1620. package/node_modules/hono/dist/types/router/trie-router/index.d.ts +2 -5
  1621. package/node_modules/hono/dist/types/router/trie-router/node.d.ts +6 -4
  1622. package/node_modules/hono/dist/types/router/trie-router/router.d.ts +7 -5
  1623. package/node_modules/hono/dist/types/router/utils.d.ts +2 -0
  1624. package/node_modules/hono/dist/types/router.d.ts +23 -22
  1625. package/node_modules/hono/dist/types/types.d.ts +146 -506
  1626. package/node_modules/hono/dist/types/utils/accept.d.ts +5 -3
  1627. package/node_modules/hono/dist/types/utils/basic-auth.d.ts +4 -2
  1628. package/node_modules/hono/dist/types/utils/body.d.ts +46 -51
  1629. package/node_modules/hono/dist/types/utils/buffer.d.ts +7 -6
  1630. package/node_modules/hono/dist/types/utils/color.d.ts +2 -0
  1631. package/node_modules/hono/dist/types/utils/compress.d.ts +2 -0
  1632. package/node_modules/hono/dist/types/utils/concurrent.d.ts +6 -4
  1633. package/node_modules/hono/dist/types/utils/constants.d.ts +2 -0
  1634. package/node_modules/hono/dist/types/utils/cookie.d.ts +20 -19
  1635. package/node_modules/hono/dist/types/utils/crypto.d.ts +5 -8
  1636. package/node_modules/hono/dist/types/utils/encode.d.ts +2 -0
  1637. package/node_modules/hono/dist/types/utils/filepath.d.ts +5 -4
  1638. package/node_modules/hono/dist/types/utils/handler.d.ts +2 -0
  1639. package/node_modules/hono/dist/types/utils/headers.d.ts +2 -0
  1640. package/node_modules/hono/dist/types/utils/html.d.ts +11 -10
  1641. package/node_modules/hono/dist/types/utils/http-status.d.ts +2 -0
  1642. package/node_modules/hono/dist/types/utils/ipaddr.d.ts +4 -6
  1643. package/node_modules/hono/dist/types/utils/jwt/index.d.ts +18 -12
  1644. package/node_modules/hono/dist/types/utils/jwt/jwa.d.ts +15 -13
  1645. package/node_modules/hono/dist/types/utils/jwt/jws.d.ts +4 -7
  1646. package/node_modules/hono/dist/types/utils/jwt/jwt.d.ts +26 -29
  1647. package/node_modules/hono/dist/types/utils/jwt/types.d.ts +48 -45
  1648. package/node_modules/hono/dist/types/utils/jwt/utf8.d.ts +2 -0
  1649. package/node_modules/hono/dist/types/utils/mime.d.ts +59 -57
  1650. package/node_modules/hono/dist/types/utils/stream.d.ts +27 -25
  1651. package/node_modules/hono/dist/types/utils/types.d.ts +15 -28
  1652. package/node_modules/hono/dist/types/utils/url.d.ts +2 -1
  1653. package/node_modules/hono/dist/types/validator/index.d.ts +3 -7
  1654. package/node_modules/hono/dist/types/validator/utils.d.ts +6 -9
  1655. package/node_modules/hono/dist/types/validator/validator.d.ts +11 -10
  1656. package/node_modules/hono/dist/types.js +4 -6
  1657. package/node_modules/hono/dist/utils/accept.js +185 -215
  1658. package/node_modules/hono/dist/utils/basic-auth.js +18 -21
  1659. package/node_modules/hono/dist/utils/body.js +87 -92
  1660. package/node_modules/hono/dist/utils/buffer.js +44 -71
  1661. package/node_modules/hono/dist/utils/color.js +33 -21
  1662. package/node_modules/hono/dist/utils/compress.js +11 -5
  1663. package/node_modules/hono/dist/utils/concurrent.js +29 -38
  1664. package/node_modules/hono/dist/utils/constants.js +7 -5
  1665. package/node_modules/hono/dist/utils/cookie.js +114 -163
  1666. package/node_modules/hono/dist/utils/crypto.js +30 -40
  1667. package/node_modules/hono/dist/utils/encode.js +30 -26
  1668. package/node_modules/hono/dist/utils/filepath.js +23 -33
  1669. package/node_modules/hono/dist/utils/handler.js +10 -11
  1670. package/node_modules/hono/dist/utils/headers.js +1 -0
  1671. package/node_modules/hono/dist/utils/html.js +97 -117
  1672. package/node_modules/hono/dist/utils/http-status.js +1 -0
  1673. package/node_modules/hono/dist/utils/ipaddr.js +227 -279
  1674. package/node_modules/hono/dist/utils/jwt/index.js +12 -4
  1675. package/node_modules/hono/dist/utils/jwt/jwa.js +24 -20
  1676. package/node_modules/hono/dist/utils/jwt/jws.js +115 -174
  1677. package/node_modules/hono/dist/utils/jwt/jwt.js +120 -197
  1678. package/node_modules/hono/dist/utils/jwt/types.js +79 -95
  1679. package/node_modules/hono/dist/utils/jwt/utf8.js +9 -7
  1680. package/node_modules/hono/dist/utils/mime.js +74 -79
  1681. package/node_modules/hono/dist/utils/stream.js +86 -88
  1682. package/node_modules/hono/dist/utils/types.js +1 -0
  1683. package/node_modules/hono/dist/utils/url.js +187 -215
  1684. package/node_modules/hono/dist/validator/index.js +1 -4
  1685. package/node_modules/hono/dist/validator/utils.js +1 -0
  1686. package/node_modules/hono/dist/validator/validator.js +61 -83
  1687. package/node_modules/hono/package.json +27 -27
  1688. package/package.json +7 -8
  1689. package/prepare.mjs +109 -4
  1690. package/runtime-package.json +7 -9
  1691. package/scripts/check-install-toolchain.mjs +64 -40
  1692. package/shipping-sbom.cdx.json +134 -168
  1693. package/shipping-source.json +15 -15
  1694. package/node_modules/@earendil-works/chord/dist/api.d.ts +0 -20
  1695. package/node_modules/@earendil-works/chord/dist/api.d.ts.map +0 -1
  1696. package/node_modules/@earendil-works/chord/dist/api.js +0 -77
  1697. package/node_modules/@earendil-works/chord/dist/api.js.map +0 -1
  1698. package/node_modules/@earendil-works/chord/dist/bundler.d.ts +0 -6
  1699. package/node_modules/@earendil-works/chord/dist/bundler.d.ts.map +0 -1
  1700. package/node_modules/@earendil-works/chord/dist/bundler.js +0 -3
  1701. package/node_modules/@earendil-works/chord/dist/bundler.js.map +0 -1
  1702. package/node_modules/@earendil-works/chord/dist/facets/host.d.ts +0 -12
  1703. package/node_modules/@earendil-works/chord/dist/facets/host.d.ts.map +0 -1
  1704. package/node_modules/@earendil-works/chord/dist/facets/host.js +0 -763
  1705. package/node_modules/@earendil-works/chord/dist/facets/host.js.map +0 -1
  1706. package/node_modules/@earendil-works/chord/dist/facets/loader.d.ts +0 -3
  1707. package/node_modules/@earendil-works/chord/dist/facets/loader.d.ts.map +0 -1
  1708. package/node_modules/@earendil-works/chord/dist/facets/loader.js +0 -5
  1709. package/node_modules/@earendil-works/chord/dist/facets/loader.js.map +0 -1
  1710. package/node_modules/@earendil-works/chord/dist/node/bundle-loader.d.ts +0 -30
  1711. package/node_modules/@earendil-works/chord/dist/node/bundle-loader.d.ts.map +0 -1
  1712. package/node_modules/@earendil-works/chord/dist/node/bundle-loader.js +0 -377
  1713. package/node_modules/@earendil-works/chord/dist/node/bundle-loader.js.map +0 -1
  1714. package/node_modules/@earendil-works/chord/dist/node/bundle.d.ts +0 -26
  1715. package/node_modules/@earendil-works/chord/dist/node/bundle.d.ts.map +0 -1
  1716. package/node_modules/@earendil-works/chord/dist/node/bundle.js +0 -183
  1717. package/node_modules/@earendil-works/chord/dist/node/bundle.js.map +0 -1
  1718. package/node_modules/@earendil-works/chord/dist/node/manifest.d.ts +0 -36
  1719. package/node_modules/@earendil-works/chord/dist/node/manifest.d.ts.map +0 -1
  1720. package/node_modules/@earendil-works/chord/dist/node/manifest.js +0 -6
  1721. package/node_modules/@earendil-works/chord/dist/node/manifest.js.map +0 -1
  1722. package/node_modules/@earendil-works/chord/dist/node/package.d.ts +0 -15
  1723. package/node_modules/@earendil-works/chord/dist/node/package.d.ts.map +0 -1
  1724. package/node_modules/@earendil-works/chord/dist/node/package.js +0 -199
  1725. package/node_modules/@earendil-works/chord/dist/node/package.js.map +0 -1
  1726. package/node_modules/@earendil-works/chord/dist/services/consumer.d.ts +0 -11
  1727. package/node_modules/@earendil-works/chord/dist/services/consumer.d.ts.map +0 -1
  1728. package/node_modules/@earendil-works/chord/dist/services/consumer.js +0 -585
  1729. package/node_modules/@earendil-works/chord/dist/services/consumer.js.map +0 -1
  1730. package/node_modules/@earendil-works/chord/dist/services/errors.d.ts +0 -8
  1731. package/node_modules/@earendil-works/chord/dist/services/errors.d.ts.map +0 -1
  1732. package/node_modules/@earendil-works/chord/dist/services/errors.js +0 -22
  1733. package/node_modules/@earendil-works/chord/dist/services/errors.js.map +0 -1
  1734. package/node_modules/@earendil-works/chord/dist/services/handle.d.ts +0 -15
  1735. package/node_modules/@earendil-works/chord/dist/services/handle.d.ts.map +0 -1
  1736. package/node_modules/@earendil-works/chord/dist/services/handle.js +0 -101
  1737. package/node_modules/@earendil-works/chord/dist/services/handle.js.map +0 -1
  1738. package/node_modules/@earendil-works/chord/dist/services/instances.d.ts +0 -26
  1739. package/node_modules/@earendil-works/chord/dist/services/instances.d.ts.map +0 -1
  1740. package/node_modules/@earendil-works/chord/dist/services/instances.js +0 -140
  1741. package/node_modules/@earendil-works/chord/dist/services/instances.js.map +0 -1
  1742. package/node_modules/@earendil-works/chord/dist/services/loopback.d.ts +0 -5
  1743. package/node_modules/@earendil-works/chord/dist/services/loopback.d.ts.map +0 -1
  1744. package/node_modules/@earendil-works/chord/dist/services/loopback.js +0 -15
  1745. package/node_modules/@earendil-works/chord/dist/services/loopback.js.map +0 -1
  1746. package/node_modules/@earendil-works/chord/dist/services/provider.d.ts +0 -37
  1747. package/node_modules/@earendil-works/chord/dist/services/provider.d.ts.map +0 -1
  1748. package/node_modules/@earendil-works/chord/dist/services/provider.js +0 -521
  1749. package/node_modules/@earendil-works/chord/dist/services/provider.js.map +0 -1
  1750. package/node_modules/@earendil-works/chord/dist/services/state-codec.d.ts +0 -15
  1751. package/node_modules/@earendil-works/chord/dist/services/state-codec.d.ts.map +0 -1
  1752. package/node_modules/@earendil-works/chord/dist/services/state-codec.js +0 -133
  1753. package/node_modules/@earendil-works/chord/dist/services/state-codec.js.map +0 -1
  1754. package/node_modules/@earendil-works/chord/dist/services/state-internals.d.ts +0 -13
  1755. package/node_modules/@earendil-works/chord/dist/services/state-internals.d.ts.map +0 -1
  1756. package/node_modules/@earendil-works/chord/dist/services/state-internals.js +0 -10
  1757. package/node_modules/@earendil-works/chord/dist/services/state-internals.js.map +0 -1
  1758. package/node_modules/@earendil-works/chord/dist/services/state.d.ts +0 -28
  1759. package/node_modules/@earendil-works/chord/dist/services/state.d.ts.map +0 -1
  1760. package/node_modules/@earendil-works/chord/dist/services/state.js.map +0 -1
  1761. package/node_modules/@earendil-works/chord/dist/services/wire.d.ts +0 -63
  1762. package/node_modules/@earendil-works/chord/dist/services/wire.d.ts.map +0 -1
  1763. package/node_modules/@earendil-works/chord/dist/services/wire.js +0 -186
  1764. package/node_modules/@earendil-works/chord/dist/services/wire.js.map +0 -1
  1765. package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.d.ts +0 -3
  1766. package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.d.ts.map +0 -1
  1767. package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js +0 -14
  1768. package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js.map +0 -1
  1769. package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.models.d.ts +0 -6
  1770. package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.models.d.ts.map +0 -1
  1771. package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.models.js +0 -8
  1772. package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.models.js.map +0 -1
  1773. package/node_modules/@earendil-works/pi-ai/dist/providers/data/azure-openai-responses.json +0 -1
  1774. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/anthropic-messages-MVG2FL56.js +0 -6
  1775. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/azure-openai-responses-7AMFUIWJ.js +0 -2
  1776. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-6FX7UEPL.js +0 -132
  1777. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-7JGR3GZN.js +0 -11
  1778. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-A3JYRWB6.js +0 -2
  1779. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-IKZJX7ZT.js +0 -2
  1780. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-OSKPX3Z5.js +0 -2
  1781. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-OYBSLV7Y.js +0 -16
  1782. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-PDFMCAOZ.js +0 -19
  1783. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-U7B62NSC.js +0 -2
  1784. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-VIV3CWXG.js +0 -2
  1785. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-WCQZGZ6I.js +0 -82
  1786. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/cloudflare-workers-ai-system-one-X5PVWWYJ.js +0 -2
  1787. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/easter-egg-3d-T5FFWIBR.js +0 -2
  1788. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/execute-RYVK27GT.js +0 -388
  1789. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/mistral-conversations-7DAUEE4N.js +0 -5
  1790. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/openai-codex-responses-TC3OK7B4.js +0 -10
  1791. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/runtime-D5I2NTIF.js +0 -2
  1792. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/typesafe-system-one-A4CZTQWZ.js +0 -2
  1793. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/virtual-modules-KVWJD3T3.js +0 -2
  1794. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-json.d.ts +0 -85
  1795. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-json.d.ts.map +0 -1
  1796. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-json.js +0 -132
  1797. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-json.js.map +0 -1
  1798. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-schema.json +0 -361
  1799. package/node_modules/@earendil-works/pi-coding-agent/examples/plugins/pi-example-plugin/README.md +0 -38
  1800. package/node_modules/@earendil-works/pi-coding-agent/examples/plugins/pi-example-plugin/package.json +0 -10
  1801. package/node_modules/@earendil-works/pi-coding-agent/examples/plugins/pi-example-plugin/src/contract.ts +0 -13
  1802. package/node_modules/@earendil-works/pi-coding-agent/examples/plugins/pi-example-plugin/src/session.ts +0 -24
  1803. package/node_modules/@earendil-works/pi-coding-agent/examples/plugins/pi-example-plugin/src/tui.ts +0 -31
  1804. package/node_modules/@esbuild/linux-x64/README.md +0 -3
  1805. package/node_modules/@esbuild/linux-x64/bin/esbuild +0 -0
  1806. package/node_modules/@esbuild/linux-x64/package.json +0 -20
  1807. package/node_modules/esbuild/LICENSE.md +0 -21
  1808. package/node_modules/esbuild/README.md +0 -3
  1809. package/node_modules/esbuild/bin/esbuild +0 -223
  1810. package/node_modules/esbuild/install.js +0 -300
  1811. package/node_modules/esbuild/lib/main.d.ts +0 -720
  1812. package/node_modules/esbuild/lib/main.js +0 -2536
  1813. package/node_modules/esbuild/package.json +0 -74
@@ -1 +1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AK,CAAC;QACb,CAAC;QACD,OAAO,OAAO,CAAC;IAChB,CAAC;CACD,CAAC","sourcesContent":["import type { AttachedReplicatedState, Context, JsonValue } from \"@earendil-works/chord\";\nimport { withAbortSignal, withoutAbortSignal } from \"@earendil-works/chord/context\";\nimport { ResetEntry } from \"../entries.ts\";\nimport type { ExecutionEnv } from \"../env/index.ts\";\nimport { SessionImpl } from \"../session/session.ts\";\nimport type { Transaction } from \"../session/transaction.ts\";\nimport type {\n\tConversationId,\n\tConversationOwnership,\n\tConversationRecord,\n\tCursor,\n\tEntryId,\n\tEntryQuery,\n\tEntryRecord,\n\tPage,\n\tStorage,\n\tSubmissionId,\n\tTaskId,\n\tTaskRecord,\n\tTx,\n} from \"../types.ts\";\nimport { ROOT_CONVERSATION_ID } from \"../types.ts\";\nimport { AgentDoc, configure, createAgent, resolveAgent, resolveSettings } from \"./agent.ts\";\nimport { createCompaction } from \"./compaction.ts\";\nimport { readContext } from \"./context.ts\";\nimport { InboxDoc, withdrawQueuedInputs } from \"./inbox.ts\";\nimport { LiveDoc, settleSchedulerOutcome } from \"./live.ts\";\nimport { ProviderDoc } from \"./provider.ts\";\nimport { BUILTIN_TASKS } from \"./registry.ts\";\nimport { type InvocationBinding, TaskScheduler } from \"./scheduler.ts\";\nimport { Submissions } from \"./submissions.ts\";\nimport { type TaskGraph, TaskGraphView, type TaskGraphWatch } from \"./task-graph.ts\";\nimport type {\n\tAgent,\n\tAgentChange,\n\tCompactionResult,\n\tContextView,\n\tConversation,\n\tConversationAbortOptions,\n\tConversationCreateOptions,\n\tConversationHandle,\n\tConversationInit,\n\tConversationWatch,\n\tHarnessInspection,\n\tHarnessOptions,\n\tHarness as HarnessType,\n\tRegistrySnapshot,\n\tSettledTask,\n\tSubmission,\n\tSubmissionDraft,\n\tToolRegistration,\n} from \"./types.ts\";\nimport { addUsageState, UsageDoc, type UsageState } from \"./usage.ts\";\nimport { scanAll } from \"./util.ts\";\nimport { type ConversationView, ConversationViews } from \"./view.ts\";\n\nconst SCAN_PAGE_SIZE = 256;\n\ntype CreateTarget =\n\t| { readonly kind: \"root\" }\n\t| { readonly kind: \"independent\"; readonly ownership: ConversationOwnership }\n\t| {\n\t\t\treadonly kind: \"fork\";\n\t\t\treadonly parentId: ConversationId;\n\t\t\treadonly at: EntryId;\n\t\t\treadonly ownership: ConversationOwnership;\n\t };\n\n/** What the conveniences apply in the creating commit, after the creation hook. */\ntype CreateOptions = { readonly agent?: AgentChange; readonly init?: ConversationInit };\n\n/** Harness-private services used by Conversation handles. */\ntype ConversationHost<Tool extends ToolRegistration> = {\n\treadonly harness: HarnessImpl<Tool>;\n\treadonly storage: Storage;\n\treadonly tasks: TaskScheduler;\n\treadonly submissions: Submissions;\n\treadonly views: ConversationViews;\n\treadonly now: () => number;\n\tcreate(target: CreateTarget, options: CreateOptions, context: Context): Promise<Conversation>;\n};\n\nclass ConversationImpl<Tool extends ToolRegistration> implements Conversation {\n\treadonly id: ConversationId;\n\treadonly #host: ConversationHost<Tool>;\n\n\tconstructor(id: ConversationId, host: ConversationHost<Tool>) {\n\t\tthis.id = id;\n\t\tthis.#host = host;\n\t}\n\n\tagent(context: Context): Promise<Agent> {\n\t\treturn this.#host.harness.resolveAgent(this.id, undefined, context);\n\t}\n\n\tconfigure(change: AgentChange, context: Context): Promise<void> {\n\t\treturn this.#host.harness.commitWith((tx) => configure(tx, this.id, change), context);\n\t}\n\n\tsubmit(submission: SubmissionDraft, context: Context): Promise<Submission> {\n\t\treturn this.#host.submissions.submit(this.id, submission, context);\n\t}\n\n\tcompact(instructions: string | undefined, context: Context): Promise<TaskId<CompactionResult>> {\n\t\tthis.#host.tasks.resume();\n\t\tconst input = { reason: \"manual\", ...(instructions === undefined ? {} : { instructions }) } as const;\n\t\treturn this.#host.harness.commitWith((tx) => createCompaction(tx, this.id, input), context);\n\t}\n\n\tasync reset(handoff: string | undefined, context: Context): Promise<void> {\n\t\tconst model =\n\t\t\thandoff === undefined\n\t\t\t\t? {}\n\t\t\t\t: { model: [{ role: \"user\", content: handoff, timestamp: this.#host.now() } as const] };\n\t\tconst entry = { kind: ResetEntry.kind, head: \"self\", ...model } as const;\n\t\tawait this.#host.submissions.submit(this.id, { type: \"write\", entry }, context);\n\t}\n\n\tcommit<T>(change: (tx: Tx) => T | Promise<T>, context: Context): Promise<T> {\n\t\treturn this.#host.harness.commitWith(change, context, { conversationId: this.id });\n\t}\n\n\tcontext(context: Context): Promise<ContextView> {\n\t\treturn readContext(this.#host.harness, this.#host.storage, this.id, context);\n\t}\n\n\tentries(\n\t\tquery: Omit<EntryQuery, \"conversationId\">,\n\t\tlimit: number,\n\t\tcursor: Cursor | undefined,\n\t\tcontext: Context,\n\t): Promise<Page<EntryRecord, Cursor>> {\n\t\tconst bounded: EntryQuery = {\n\t\t\tconversationId: this.id,\n\t\t\t...(query.minEntryId === undefined ? {} : { minEntryId: query.minEntryId }),\n\t\t\t...(query.maxEntryId === undefined ? {} : { maxEntryId: query.maxEntryId }),\n\t\t};\n\t\treturn this.#host.harness.readOnLine(() => this.#host.storage.scanEntries(bounded, limit, cursor, context));\n\t}\n\n\tfork(at: EntryId, options: ConversationCreateOptions, context: Context): Promise<Conversation> {\n\t\treturn this.#host.create({ kind: \"fork\", parentId: this.id, at, ownership: options.ownership }, options, context);\n\t}\n\n\tabort(context: Context, options?: ConversationAbortOptions): Promise<void> {\n\t\tthis.#host.tasks.resume();\n\t\treturn this.#host.tasks.abortConversation(this.id, options?.background === true, context);\n\t}\n\n\twaitForIdle(context: Context): Promise<void> {\n\t\tthis.#host.tasks.resume();\n\t\treturn this.#host.tasks.waitForIdle(this.id, context);\n\t}\n\n\tviewState(context: Context): Promise<AttachedReplicatedState<ConversationView>> {\n\t\treturn this.#host.views.state(this.id, context);\n\t}\n\n\twatch(context: Context): Promise<ConversationWatch> {\n\t\treturn this.#host.views.watch(this.id, context);\n\t}\n}\n\n/** Session kernel extended with conversation handles and a registry. */\nclass HarnessImpl<Tool extends ToolRegistration> extends SessionImpl implements HarnessType {\n\treadonly #storage: Storage;\n\treadonly #options: HarnessOptions<Tool>;\n\treadonly #report: (error: unknown) => void;\n\treadonly #host: ConversationHost<Tool>;\n\treadonly #tasks: TaskScheduler;\n\treadonly #submissions: Submissions;\n\treadonly #taskGraph: TaskGraphView;\n\t#closed = false;\n\n\tconstructor(storage: Storage, options: HarnessOptions<Tool>, context: Context) {\n\t\tsuper(storage);\n\t\tthis.#storage = storage;\n\t\tthis.#options = options;\n\t\tthis.#report = options.onReport ?? (() => {});\n\t\tconst now = options.now ?? Date.now;\n\t\tconst settings = () => resolveSettings(options.settings);\n\t\tthis.#tasks = new TaskScheduler({\n\t\t\tsession: this,\n\t\t\tstorage,\n\t\t\tregistry: options.registry,\n\t\t\tmodels: options.models,\n\t\t\tagent: (id, snapshot, callContext) => this.resolveAgent(id, snapshot as RegistrySnapshot<Tool>, callContext),\n\t\t\tsettings,\n\t\t\tenv: (id, callContext) => this.buildEnv(id, callContext),\n\t\t\tnow,\n\t\t\treport: this.#report,\n\t\t\tsettleOutcome: settleSchedulerOutcome,\n\t\t\twithdrawInputs: withdrawQueuedInputs,\n\t\t\tconversation: async (id, binding, callContext) => {\n\t\t\t\tconst record = await this.readOnLine(() => storage.conversation(id, callContext));\n\t\t\t\treturn record === undefined ? undefined : boundConversation(id, binding, this.#submissions, this.#tasks);\n\t\t\t},\n\t\t\tcontext: withoutAbortSignal(context),\n\t\t});\n\t\tthis.#submissions = new Submissions(this, storage, now, settings, () => this.#tasks.resume());\n\t\tthis.#taskGraph = new TaskGraphView(this, storage);\n\t\tthis.#host = {\n\t\t\tharness: this,\n\t\t\tstorage,\n\t\t\ttasks: this.#tasks,\n\t\t\tsubmissions: this.#submissions,\n\t\t\tviews: new ConversationViews(this, storage),\n\t\t\tnow,\n\t\t\tcreate: (target, createOptions, context) => this.#create(target, createOptions, context),\n\t\t};\n\t}\n\n\t/** Resolve a conversation's committed `pi.agent` against `snapshot`, or the current one, and the current settings. */\n\tasync resolveAgent(\n\t\tid: ConversationId,\n\t\tsnapshot: RegistrySnapshot<Tool> | undefined,\n\t\tcontext: Context,\n\t): Promise<Agent<Tool>> {\n\t\tconst registry = snapshot ?? this.#options.registry.snapshot();\n\t\tconst state = await this.snapshot(AgentDoc, id, context);\n\t\treturn resolveAgent(state, registry, resolveSettings(this.#options.settings), this.#report);\n\t}\n\n\t/** Build a conversation's environment from its current `cwd`; `undefined` without an `env` option. */\n\tasync buildEnv(id: ConversationId, context: Context): Promise<ExecutionEnv | undefined> {\n\t\tconst build = this.#options.env;\n\t\tif (build === undefined) return undefined;\n\t\tconst cwd = (await this.snapshot(AgentDoc, id, context))?.cwd;\n\t\treturn build({ conversationId: id, ...(cwd === undefined ? {} : { cwd }), read: this }, context);\n\t}\n\n\t/** Reconcile surviving `running` tasks to `pending`; part of open. */\n\topenTasks(context: Context): Promise<void> {\n\t\treturn this.#tasks.open(context);\n\t}\n\n\tresume(): void {\n\t\tthis.#assertOpen();\n\t\tthis.#tasks.resume();\n\t}\n\n\tgetTask<R>(id: TaskId<R>, context: Context): Promise<TaskRecord<JsonValue, JsonValue, R> | undefined> {\n\t\treturn this.readOnLine(() => this.#storage.task(id, context)) as Promise<\n\t\t\tTaskRecord<JsonValue, JsonValue, R> | undefined\n\t\t>;\n\t}\n\n\tinspect(context: Context): Promise<HarnessInspection> {\n\t\treturn this.readOnLine(async () => {\n\t\t\tconst { scheduling, tasks } = await this.#tasks.inspect(this.#options.registry.snapshot());\n\t\t\tconst scan = (status: \"queued\" | \"placed\") =>\n\t\t\t\tscanAll((cursor) => this.#storage.scanSubmissions({ status }, SCAN_PAGE_SIZE, cursor, context));\n\t\t\tconst submissions = [...(await scan(\"queued\")), ...(await scan(\"placed\"))].sort((a, b) => a.id - b.id);\n\t\t\treturn { scheduling, tasks, submissions };\n\t\t});\n\t}\n\n\tsubmission(id: SubmissionId, context: Context): Promise<Submission | undefined> {\n\t\treturn this.#submissions.get(id, context);\n\t}\n\n\tabortSubmission(\n\t\tid: SubmissionId,\n\t\tcontext: Context,\n\t\tconversationId?: ConversationId,\n\t): Promise<\"aborted\" | \"already_placed\" | \"settled\" | \"not_found\"> {\n\t\treturn this.#submissions.abort(id, context, conversationId);\n\t}\n\n\tabortTask(id: TaskId, context: Context): Promise<\"marked\" | \"terminal\"> {\n\t\treturn this.#tasks.abort(id, context);\n\t}\n\n\twaitForTask<R>(id: TaskId<R>, context: Context): Promise<SettledTask<R>> {\n\t\tthis.#tasks.resume();\n\t\treturn this.#tasks.waitForTask(id, context) as Promise<SettledTask<R>>;\n\t}\n\n\twaitForIdle(context: Context): Promise<void> {\n\t\tthis.#tasks.resume();\n\t\treturn this.#tasks.waitForIdle(undefined, context);\n\t}\n\n\t/** Sum every conversation's committed `pi.usage`. Each document is read at its own point; totals only grow. */\n\tasync usage(context: Context): Promise<UsageState> {\n\t\tconst conversations = await this.readOnLine(() =>\n\t\t\tscanAll((cursor) => this.#storage.scanConversations({}, SCAN_PAGE_SIZE, cursor, context)),\n\t\t);\n\t\tconst total = UsageDoc.definition.initial();\n\t\tfor (const { id } of conversations) {\n\t\t\tconst state = await this.snapshot(UsageDoc, id, context);\n\t\t\tif (state !== undefined) addUsageState(total, state);\n\t\t}\n\t\treturn total;\n\t}\n\n\ttaskGraph(context: Context): Promise<AttachedReplicatedState<TaskGraph>> {\n\t\treturn this.#taskGraph.state(context);\n\t}\n\n\twatchTaskGraph(context: Context): Promise<TaskGraphWatch> {\n\t\treturn this.#taskGraph.watch(context);\n\t}\n\n\troot(\n\t\tcontext: Context,\n\t\toptions?: { readonly agent?: AgentChange; readonly init?: ConversationInit },\n\t): Promise<Conversation> {\n\t\treturn this.#create({ kind: \"root\" }, options ?? {}, context);\n\t}\n\n\tasync conversation(id: ConversationId, context: Context): Promise<Conversation | undefined> {\n\t\tthis.#assertOpen();\n\t\tconst record = await this.readOnLine(() => this.#storage.conversation(id, context));\n\t\treturn record === undefined ? undefined : new ConversationImpl(record.id, this.#host);\n\t}\n\n\tcreateConversation(options: ConversationCreateOptions, context: Context): Promise<Conversation> {\n\t\treturn this.#create({ kind: \"independent\", ownership: options.ownership }, options, context);\n\t}\n\n\toverride close(context: Context): Promise<void> {\n\t\tthis.#closed = true;\n\t\treturn super.close(context);\n\t}\n\n\t/** Join task invocations after admission is sealed and before Storage closes; writes no task outcome. */\n\tprotected override beforeClose(): Promise<void> {\n\t\treturn this.#tasks.join();\n\t}\n\n\tasync #create(target: CreateTarget, options: CreateOptions, context: Context): Promise<Conversation> {\n\t\tthis.#assertOpen();\n\t\tconst id = await this.commitWith(async (tx) => {\n\t\t\tif (target.kind === \"root\" && (await tx.conversation(ROOT_CONVERSATION_ID)) !== undefined) {\n\t\t\t\treturn ROOT_CONVERSATION_ID;\n\t\t\t}\n\t\t\tconst record =\n\t\t\t\ttarget.kind === \"root\"\n\t\t\t\t\t? await tx.createRootConversation()\n\t\t\t\t\t: target.kind === \"fork\"\n\t\t\t\t\t\t? await tx.forkConversation(target.parentId, target.at, { ownership: target.ownership })\n\t\t\t\t\t\t: await tx.createConversation({ ownership: target.ownership });\n\t\t\tif (options.agent !== undefined) await configure(tx, record.id, options.agent);\n\t\t\tif (options.init !== undefined) await options.init(tx, record.id);\n\t\t\treturn record.id;\n\t\t}, context);\n\t\treturn new ConversationImpl(id, this.#host);\n\t}\n\n\t/**\n\t * The built-in creation hook, in every commit that creates or forks a conversation: empty `pi.live`, `pi.inbox`, and\n\t * `pi.usage`, a fresh `pi.provider`, the conversation's `pi.agent` (see `createAgent()`), then\n\t * `HarnessOptions.conversationCreated`.\n\t */\n\tprotected override async conversationCreated(tx: Transaction, record: ConversationRecord): Promise<void> {\n\t\tawait tx.doc(LiveDoc, record.id);\n\t\tawait tx.doc(InboxDoc, record.id);\n\t\tawait tx.doc(UsageDoc, record.id);\n\t\tawait tx.doc(ProviderDoc, record.id);\n\t\tawait createAgent(tx, record);\n\t\tawait this.#options.conversationCreated?.(tx, record);\n\t}\n\n\t#assertOpen(): void {\n\t\tif (this.#closed) throw new Error(\"Harness is closed\");\n\t}\n}\n\n/**\n * Invocation-bound handle for tasks and tools. Every operation, and every operation of a submission it returns, first\n * checks the invocation and runs under its signal, so it rejects once the invocation ends; admitted work stays durable.\n */\nfunction boundConversation(\n\tid: ConversationId,\n\tbinding: InvocationBinding,\n\tsubmissions: Submissions,\n\ttasks: TaskScheduler,\n): ConversationHandle {\n\tconst bind = (context: Context): Context => withAbortSignal(binding.signal, context);\n\tconst bound = <T>(operation: (context: Context) => Promise<T>) => {\n\t\treturn async (context: Context): Promise<T> => {\n\t\t\tbinding.check();\n\t\t\treturn operation(bind(context));\n\t\t};\n\t};\n\treturn {\n\t\tid,\n\t\tsubmit: async (draft, context) => {\n\t\t\tbinding.check();\n\t\t\tconst submission = await submissions.submit(id, draft, bind(context));\n\t\t\treturn {\n\t\t\t\tid: submission.id,\n\t\t\t\tstatus: bound((callContext) => submission.status(callContext)),\n\t\t\t\twait: bound((callContext) => submission.wait(callContext)),\n\t\t\t\tabort: bound((callContext) => submission.abort(callContext)),\n\t\t\t};\n\t\t},\n\t\tabort: async (context, options) => {\n\t\t\tbinding.check();\n\t\t\treturn tasks.abortConversation(id, options?.background === true, bind(context));\n\t\t},\n\t\twaitForIdle: bound((callContext) => tasks.waitForIdle(id, callContext)),\n\t};\n}\n\n/** Durable agent harness over one Session. */\nexport type Harness = HarnessType;\n\nexport const Harness = {\n\t/** Open a Harness over storage. The registry may keep changing while the Harness runs. */\n\tasync open<Tool extends ToolRegistration>(\n\t\tstorage: Storage,\n\t\toptions: HarnessOptions<Tool>,\n\t\tcontext: Context,\n\t): Promise<Harness> {\n\t\tcontext.abortSignal?.throwIfAborted();\n\t\tconst snapshot = options.registry.snapshot();\n\t\tconst missing = BUILTIN_TASKS.filter((task) => snapshot.task(task.definition.name) === undefined);\n\t\tif (missing.length > 0) {\n\t\t\tconst names = missing.map((task) => task.definition.name).join(\", \");\n\t\t\tthrow new Error(`Registry lacks built-in tasks ${names}; create it with createRegistry()`);\n\t\t}\n\t\tconst harness = new HarnessImpl(storage, options, context);\n\t\ttry {\n\t\t\tawait harness.openTasks(context);\n\t\t} catch (error) {\n\t\t\t// The caller's context may be what failed open: close without it, and rethrow the open error.\n\t\t\tawait harness\n\t\t\t\t.close(withoutAbortSignal(context))\n\t\t\t\t.catch((closeError: unknown) => options.onReport?.(closeError));\n\t\t\tthrow error;\n\t\t}\n\t\treturn harness;\n\t},\n};\n"]}
1
+ {"version":3,"file":"harness.js","sourceRoot":"","sources":["../../src/harness/harness.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACpF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAiB/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7F,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAA0B,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAkB,aAAa,EAAuB,MAAM,iBAAiB,CAAC;AAqBrF,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAmB,MAAM,YAAY,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,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C;QACD,OAAO,OAAO,CAAC;IAChB,CAAC;CACD,CAAC","sourcesContent":["import type { AttachedReplicatedState, Context, JsonValue } from \"@earendil-works/chord\";\nimport { withAbortSignal, withoutAbortSignal } from \"@earendil-works/chord/context\";\nimport { ResetEntry } from \"../entries.ts\";\nimport type { ExecutionEnv } from \"../env/index.ts\";\nimport { contained, SessionImpl } from \"../session/session.ts\";\nimport type { Transaction } from \"../session/transaction.ts\";\nimport type {\n\tConversationId,\n\tConversationOwnership,\n\tConversationRecord,\n\tCursor,\n\tEntryId,\n\tEntryQuery,\n\tEntryRecord,\n\tPage,\n\tStorage,\n\tSubmissionId,\n\tTaskId,\n\tTaskRecord,\n\tTx,\n} from \"../types.ts\";\nimport { ROOT_CONVERSATION_ID } from \"../types.ts\";\nimport { AgentDoc, configure, createAgent, resolveAgent, resolveSettings } from \"./agent.ts\";\nimport { createCompaction } from \"./compaction.ts\";\nimport { readContext } from \"./context.ts\";\nimport { InboxDoc, withdrawQueuedInputs } from \"./inbox.ts\";\nimport { LiveDoc, settleSchedulerOutcome } from \"./live.ts\";\nimport { ProviderDoc } from \"./provider.ts\";\nimport { BUILTIN_TASKS } from \"./registry.ts\";\nimport { type InvocationBinding, TaskScheduler } from \"./scheduler.ts\";\nimport { Submissions } from \"./submissions.ts\";\nimport { type TaskGraph, TaskGraphView, type TaskGraphWatch } from \"./task-graph.ts\";\nimport type {\n\tAgent,\n\tAgentChange,\n\tCompactionResult,\n\tContextView,\n\tConversation,\n\tConversationAbortOptions,\n\tConversationCreateOptions,\n\tConversationHandle,\n\tConversationInit,\n\tConversationWatch,\n\tHarnessInspection,\n\tHarnessOptions,\n\tHarness as HarnessType,\n\tRegistrySnapshot,\n\tSettledTask,\n\tSubmission,\n\tSubmissionDraft,\n\tToolRegistration,\n} from \"./types.ts\";\nimport { addUsageState, UsageDoc, type UsageState } from \"./usage.ts\";\nimport { scanAll } from \"./util.ts\";\nimport { type ConversationView, ConversationViews } from \"./view.ts\";\n\nconst SCAN_PAGE_SIZE = 256;\n\ntype CreateTarget =\n\t| { readonly kind: \"root\" }\n\t| { readonly kind: \"independent\"; readonly ownership: ConversationOwnership }\n\t| {\n\t\t\treadonly kind: \"fork\";\n\t\t\treadonly parentId: ConversationId;\n\t\t\treadonly at: EntryId;\n\t\t\treadonly ownership: ConversationOwnership;\n\t };\n\n/** What the conveniences apply in the creating commit, after the creation hook. */\ntype CreateOptions = { readonly agent?: AgentChange; readonly init?: ConversationInit };\n\n/** Harness-private services used by Conversation handles. */\ntype ConversationHost<Tool extends ToolRegistration> = {\n\treadonly harness: HarnessImpl<Tool>;\n\treadonly storage: Storage;\n\treadonly tasks: TaskScheduler;\n\treadonly submissions: Submissions;\n\treadonly views: ConversationViews;\n\treadonly now: () => number;\n\tcreate(target: CreateTarget, options: CreateOptions, context: Context): Promise<Conversation>;\n};\n\n/** Key of the Harness's internal index-size getter, for tests. */\nexport const SCHEDULER_INDEX_SIZES = Symbol.for(\"pi-durable.schedulerIndexSizes\");\n\nclass ConversationImpl<Tool extends ToolRegistration> implements Conversation {\n\treadonly id: ConversationId;\n\treadonly #host: ConversationHost<Tool>;\n\n\tconstructor(id: ConversationId, host: ConversationHost<Tool>) {\n\t\tthis.id = id;\n\t\tthis.#host = host;\n\t}\n\n\tagent(context: Context): Promise<Agent> {\n\t\treturn this.#host.harness.resolveAgent(this.id, undefined, context);\n\t}\n\n\tconfigure(change: AgentChange, context: Context): Promise<void> {\n\t\treturn this.#host.harness.commitWith((tx) => configure(tx, this.id, change), context);\n\t}\n\n\tsubmit(submission: SubmissionDraft, context: Context): Promise<Submission> {\n\t\treturn this.#host.submissions.submit(this.id, submission, context);\n\t}\n\n\tcompact(instructions: string | undefined, context: Context): Promise<TaskId<CompactionResult>> {\n\t\tthis.#host.tasks.resume();\n\t\tconst input = { reason: \"manual\", ...(instructions === undefined ? {} : { instructions }) } as const;\n\t\treturn this.#host.harness.commitWith((tx) => createCompaction(tx, this.id, input), context);\n\t}\n\n\tasync reset(handoff: string | undefined, context: Context): Promise<void> {\n\t\tconst model =\n\t\t\thandoff === undefined\n\t\t\t\t? {}\n\t\t\t\t: { model: [{ role: \"user\", content: handoff, timestamp: this.#host.now() } as const] };\n\t\tconst entry = { kind: ResetEntry.kind, head: \"self\", ...model } as const;\n\t\tawait this.#host.submissions.submit(this.id, { type: \"write\", entry }, context);\n\t}\n\n\tcommit<T>(change: (tx: Tx) => T | Promise<T>, context: Context): Promise<T> {\n\t\treturn this.#host.harness.commitWith(change, context, { conversationId: this.id });\n\t}\n\n\tcontext(context: Context, options?: { readonly at?: EntryId }): Promise<ContextView> {\n\t\treturn readContext(this.#host.harness, this.#host.storage, this.id, context, options?.at);\n\t}\n\n\tentries(\n\t\tquery: Omit<EntryQuery, \"conversationId\">,\n\t\tlimit: number,\n\t\tcursor: Cursor | undefined,\n\t\tcontext: Context,\n\t): Promise<Page<EntryRecord, Cursor>> {\n\t\tconst bounded: EntryQuery = {\n\t\t\tconversationId: this.id,\n\t\t\t...(query.minEntryId === undefined ? {} : { minEntryId: query.minEntryId }),\n\t\t\t...(query.maxEntryId === undefined ? {} : { maxEntryId: query.maxEntryId }),\n\t\t\t...(query.order === undefined ? {} : { order: query.order }),\n\t\t};\n\t\treturn this.#host.harness.readOnLine(() => this.#host.storage.scanEntries(bounded, limit, cursor, context));\n\t}\n\n\tfork(at: EntryId, options: ConversationCreateOptions, context: Context): Promise<Conversation> {\n\t\treturn this.#host.create({ kind: \"fork\", parentId: this.id, at, ownership: options.ownership }, options, context);\n\t}\n\n\tabort(context: Context, options?: ConversationAbortOptions): Promise<void> {\n\t\tthis.#host.tasks.resume();\n\t\treturn this.#host.tasks.abortConversation(this.id, options?.background === true, context);\n\t}\n\n\twaitForIdle(context: Context): Promise<void> {\n\t\tthis.#host.tasks.resume();\n\t\treturn this.#host.tasks.waitForIdle(this.id, context);\n\t}\n\n\tviewState(context: Context): Promise<AttachedReplicatedState<ConversationView>> {\n\t\treturn this.#host.views.state(this.id, context);\n\t}\n\n\twatch(context: Context): Promise<ConversationWatch> {\n\t\treturn this.#host.views.watch(this.id, context);\n\t}\n}\n\n/** Session kernel extended with conversation handles and a registry. */\nclass HarnessImpl<Tool extends ToolRegistration> extends SessionImpl implements HarnessType {\n\treadonly #options: HarnessOptions<Tool>;\n\treadonly #report: (error: unknown) => void;\n\treadonly #host: ConversationHost<Tool>;\n\treadonly #tasks: TaskScheduler;\n\treadonly #submissions: Submissions;\n\treadonly #taskGraph: TaskGraphView;\n\n\tconstructor(rawStorage: Storage, options: HarnessOptions<Tool>, context: Context) {\n\t\tconst report = safeReport(options.onReport);\n\t\tconst now = safeNow(options.now, report);\n\t\t// Read at each use, as all settings are, but only this field: it is read on every commit.\n\t\tsuper(rawStorage, now, () => options.settings?.documentRetentionMs);\n\t\t// Every component reads and writes through the Session's failure guard: `rawStorage` serves only `super()`.\n\t\tconst storage = this.storage;\n\t\tthis.#options = options;\n\t\tthis.#report = report;\n\t\tconst settings = () => resolveSettings(options.settings);\n\t\tthis.#tasks = new TaskScheduler({\n\t\t\tsession: this,\n\t\t\tstorage,\n\t\t\tregistry: options.registry,\n\t\t\tmodels: options.models,\n\t\t\tagent: (id, snapshot, callContext) => this.resolveAgent(id, snapshot as RegistrySnapshot<Tool>, callContext),\n\t\t\tsettings,\n\t\t\tenv: (id, callContext) => this.buildEnv(id, callContext),\n\t\t\tnow,\n\t\t\treport: this.#report,\n\t\t\tsettleOutcome: settleSchedulerOutcome,\n\t\t\twithdrawInputs: withdrawQueuedInputs,\n\t\t\tconversation: async (id, binding, callContext) => {\n\t\t\t\tconst record = await this.readOnLine(() => storage.conversation(id, callContext));\n\t\t\t\treturn record === undefined ? undefined : boundConversation(id, binding, this.#submissions, this.#tasks);\n\t\t\t},\n\t\t\tcontext: withoutAbortSignal(context),\n\t\t});\n\t\tthis.#submissions = new Submissions(this, storage, now, settings, () => this.#tasks.resume());\n\t\tthis.#taskGraph = new TaskGraphView(this, storage);\n\t\tthis.#host = {\n\t\t\tharness: this,\n\t\t\tstorage,\n\t\t\ttasks: this.#tasks,\n\t\t\tsubmissions: this.#submissions,\n\t\t\tviews: new ConversationViews(this, storage),\n\t\t\tnow,\n\t\t\tcreate: (target, createOptions, context) => this.#create(target, createOptions, context),\n\t\t};\n\t}\n\n\t/** Resolve a conversation's committed `pi.agent` against `snapshot`, or the current one, and the current settings. */\n\tasync resolveAgent(\n\t\tid: ConversationId,\n\t\tsnapshot: RegistrySnapshot<Tool> | undefined,\n\t\tcontext: Context,\n\t): Promise<Agent<Tool>> {\n\t\tconst registry = snapshot ?? this.#options.registry.snapshot();\n\t\tconst state = await this.snapshot(AgentDoc, id, context);\n\t\treturn resolveAgent(state, registry, resolveSettings(this.#options.settings), this.#report);\n\t}\n\n\t/** Build a conversation's environment from its current `cwd`; `undefined` without an `env` option. */\n\tasync buildEnv(id: ConversationId, context: Context): Promise<ExecutionEnv | undefined> {\n\t\tconst build = this.#options.env;\n\t\tif (build === undefined) return undefined;\n\t\tconst cwd = (await this.snapshot(AgentDoc, id, context))?.cwd;\n\t\treturn build({ conversationId: id, ...(cwd === undefined ? {} : { cwd }), read: this }, context);\n\t}\n\n\t/** Reconcile surviving `running` tasks to `pending`; part of open. */\n\topenTasks(context: Context): Promise<void> {\n\t\treturn this.#tasks.open(context);\n\t}\n\n\tresume(): void {\n\t\tthis.assertUsable();\n\t\tthis.#tasks.resume();\n\t}\n\n\tgetTask<R>(id: TaskId<R>, context: Context): Promise<TaskRecord<JsonValue, JsonValue, R> | undefined> {\n\t\treturn this.readOnLine(() => this.storage.task(id, context)) as Promise<\n\t\t\tTaskRecord<JsonValue, JsonValue, R> | undefined\n\t\t>;\n\t}\n\n\t/** Internal, for tests: sizes of the scheduler's ownership indexes. */\n\tget [SCHEDULER_INDEX_SIZES](): TaskScheduler[\"indexSizes\"] {\n\t\treturn this.#tasks.indexSizes;\n\t}\n\n\tinspect(context: Context): Promise<HarnessInspection> {\n\t\treturn this.readOnLine(async () => {\n\t\t\tconst { scheduling, tasks } = await this.#tasks.inspect(this.#options.registry.snapshot());\n\t\t\tconst scan = (status: \"queued\" | \"placed\") =>\n\t\t\t\tscanAll((cursor) => this.storage.scanSubmissions({ status }, SCAN_PAGE_SIZE, cursor, context));\n\t\t\tconst submissions = [...(await scan(\"queued\")), ...(await scan(\"placed\"))].sort((a, b) => a.id - b.id);\n\t\t\treturn { scheduling, tasks, submissions };\n\t\t});\n\t}\n\n\tsubmission(id: SubmissionId, context: Context): Promise<Submission | undefined> {\n\t\treturn this.#submissions.get(id, context);\n\t}\n\n\tabortSubmission(\n\t\tid: SubmissionId,\n\t\tcontext: Context,\n\t\tconversationId?: ConversationId,\n\t): Promise<\"aborted\" | \"already_placed\" | \"settled\" | \"not_found\"> {\n\t\treturn this.#submissions.abort(id, context, conversationId);\n\t}\n\n\tabortTask(id: TaskId, context: Context): Promise<\"marked\" | \"terminal\"> {\n\t\treturn this.#tasks.abort(id, context);\n\t}\n\n\twaitForTask<R>(id: TaskId<R>, context: Context): Promise<SettledTask<R>> {\n\t\tthis.#tasks.resume();\n\t\treturn this.#tasks.waitForTask(id, context) as Promise<SettledTask<R>>;\n\t}\n\n\twaitForIdle(context: Context): Promise<void> {\n\t\tthis.#tasks.resume();\n\t\treturn this.#tasks.waitForIdle(undefined, context);\n\t}\n\n\t/** Sum every conversation's committed `pi.usage`. Each document is read at its own point; totals only grow. */\n\tasync usage(context: Context): Promise<UsageState> {\n\t\tconst conversations = await this.readOnLine(() =>\n\t\t\tscanAll((cursor) => this.storage.scanConversations({}, SCAN_PAGE_SIZE, cursor, context)),\n\t\t);\n\t\tconst total = UsageDoc.definition.initial();\n\t\tfor (const { id } of conversations) {\n\t\t\tconst state = await this.snapshot(UsageDoc, id, context);\n\t\t\tif (state !== undefined) addUsageState(total, state);\n\t\t}\n\t\treturn total;\n\t}\n\n\ttaskGraph(context: Context): Promise<AttachedReplicatedState<TaskGraph>> {\n\t\treturn this.#taskGraph.state(context);\n\t}\n\n\twatchTaskGraph(context: Context): Promise<TaskGraphWatch> {\n\t\treturn this.#taskGraph.watch(context);\n\t}\n\n\troot(\n\t\tcontext: Context,\n\t\toptions?: { readonly agent?: AgentChange; readonly init?: ConversationInit },\n\t): Promise<Conversation> {\n\t\treturn this.#create({ kind: \"root\" }, options ?? {}, context);\n\t}\n\n\tasync conversation(id: ConversationId, context: Context): Promise<Conversation | undefined> {\n\t\tthis.assertUsable();\n\t\tconst record = await this.readOnLine(() => this.storage.conversation(id, context));\n\t\treturn record === undefined ? undefined : new ConversationImpl(record.id, this.#host);\n\t}\n\n\tcreateConversation(options: ConversationCreateOptions, context: Context): Promise<Conversation> {\n\t\treturn this.#create({ kind: \"independent\", ownership: options.ownership }, options, context);\n\t}\n\n\toverride report(error: unknown): void {\n\t\tthis.#report(error);\n\t}\n\n\t/** Signal and join task invocations after the close listeners and before Storage closes; writes no task outcome. */\n\tprotected override beforeClose(): Promise<void> {\n\t\treturn this.#tasks.join();\n\t}\n\n\tasync #create(target: CreateTarget, options: CreateOptions, context: Context): Promise<Conversation> {\n\t\tthis.assertUsable();\n\t\tconst id = await this.commitWith(async (tx) => {\n\t\t\tif (target.kind === \"root\" && (await tx.conversation(ROOT_CONVERSATION_ID)) !== undefined) {\n\t\t\t\treturn ROOT_CONVERSATION_ID;\n\t\t\t}\n\t\t\tconst record =\n\t\t\t\ttarget.kind === \"root\"\n\t\t\t\t\t? await tx.createRootConversation()\n\t\t\t\t\t: target.kind === \"fork\"\n\t\t\t\t\t\t? await tx.forkConversation(target.parentId, target.at, { ownership: target.ownership })\n\t\t\t\t\t\t: await tx.createConversation({ ownership: target.ownership });\n\t\t\tif (options.agent !== undefined) await configure(tx, record.id, options.agent);\n\t\t\tif (options.init !== undefined) await options.init(tx, record.id);\n\t\t\treturn record.id;\n\t\t}, context);\n\t\treturn new ConversationImpl(id, this.#host);\n\t}\n\n\t/**\n\t * The built-in creation hook, in every commit that creates or forks a conversation: empty `pi.live`, `pi.inbox`, and\n\t * `pi.usage`, a fresh `pi.provider`, the conversation's `pi.agent` (see `createAgent()`), then\n\t * `HarnessOptions.conversationCreated`.\n\t */\n\tprotected override async conversationCreated(tx: Transaction, record: ConversationRecord): Promise<void> {\n\t\tawait tx.doc(LiveDoc, record.id);\n\t\tawait tx.doc(InboxDoc, record.id);\n\t\tawait tx.doc(UsageDoc, record.id);\n\t\tawait tx.doc(ProviderDoc, record.id);\n\t\tawait createAgent(tx, record);\n\t\tawait this.#options.conversationCreated?.(tx, record);\n\t}\n}\n\n/** `onReport` that cannot fail: it is the last place an error goes, so its own throw or rejection is dropped. */\nfunction safeReport(onReport: ((error: unknown) => void) | undefined): (error: unknown) => void {\n\treturn (error) =>\n\t\tcontained(\n\t\t\t() => onReport?.(error),\n\t\t\t() => {},\n\t\t);\n}\n\n/**\n * The host clock, falling back to `Date.now` when it throws: a broken clock must not stop commits. The first throw is\n * reported; the clock is read in every task change, so later ones are not.\n */\nexport function safeNow(now: (() => number) | undefined, report: (error: unknown) => void): () => number {\n\tif (now === undefined) return Date.now;\n\tlet reported = false;\n\treturn () => {\n\t\ttry {\n\t\t\treturn now();\n\t\t} catch (error) {\n\t\t\t// Set first: a report handler that reads the clock again must not report again.\n\t\t\tif (!reported) {\n\t\t\t\treported = true;\n\t\t\t\treport(error);\n\t\t\t}\n\t\t\treturn Date.now();\n\t\t}\n\t};\n}\n\n/**\n * Invocation-bound handle for tasks and tools. Every operation, and every operation of a submission it returns, first\n * checks the invocation and runs under its signal, so it rejects once the invocation ends; admitted work stays durable.\n */\nfunction boundConversation(\n\tid: ConversationId,\n\tbinding: InvocationBinding,\n\tsubmissions: Submissions,\n\ttasks: TaskScheduler,\n): ConversationHandle {\n\tconst bind = (context: Context): Context => withAbortSignal(binding.signal, context);\n\tconst bound = <T>(operation: (context: Context) => Promise<T>) => {\n\t\treturn async (context: Context): Promise<T> => {\n\t\t\tbinding.check();\n\t\t\treturn operation(bind(context));\n\t\t};\n\t};\n\treturn {\n\t\tid,\n\t\tsubmit: async (draft, context) => {\n\t\t\tbinding.check();\n\t\t\tconst submission = await submissions.submit(id, draft, bind(context));\n\t\t\treturn {\n\t\t\t\tid: submission.id,\n\t\t\t\tstatus: bound((callContext) => submission.status(callContext)),\n\t\t\t\twait: bound((callContext) => submission.wait(callContext)),\n\t\t\t\tabort: bound((callContext) => submission.abort(callContext)),\n\t\t\t};\n\t\t},\n\t\tabort: async (context, options) => {\n\t\t\tbinding.check();\n\t\t\treturn tasks.abortConversation(id, options?.background === true, bind(context));\n\t\t},\n\t\twaitForIdle: bound((callContext) => tasks.waitForIdle(id, callContext)),\n\t};\n}\n\n/** Durable agent harness over one Session. */\nexport type Harness = HarnessType;\n\nexport const Harness = {\n\t/** Open a Harness over storage. The registry may keep changing while the Harness runs. */\n\tasync open<Tool extends ToolRegistration>(\n\t\tstorage: Storage,\n\t\toptions: HarnessOptions<Tool>,\n\t\tcontext: Context,\n\t): Promise<Harness> {\n\t\tcontext.abortSignal?.throwIfAborted();\n\t\tconst snapshot = options.registry.snapshot();\n\t\tconst missing = BUILTIN_TASKS.filter((task) => snapshot.task(task.definition.name) === undefined);\n\t\tif (missing.length > 0) {\n\t\t\tconst names = missing.map((task) => task.definition.name).join(\", \");\n\t\t\tthrow new Error(`Registry lacks built-in tasks ${names}; create it with createRegistry()`);\n\t\t}\n\t\tconst harness = new HarnessImpl(storage, options, context);\n\t\ttry {\n\t\t\tawait harness.openTasks(context);\n\t\t} catch (error) {\n\t\t\t// The caller's context may be what failed open: close without it, and rethrow the open error.\n\t\t\t// A failing Storage close fails the Session, which reports it.\n\t\t\tawait harness.close(withoutAbortSignal(context)).catch(() => {});\n\t\t\tthrow error;\n\t\t}\n\t\treturn harness;\n\t},\n};\n"]}
@@ -1,11 +1,12 @@
1
- import type { Draft, JsonRepresentation } from "@earendil-works/chord";
2
- import type { ConversationId, EntryDraft, EntryId, JsonObject, SubmissionId, Tx } from "../types.ts";
3
- import type { QueueMode, Settings, UserInput } from "./types.ts";
4
- /** A queued submission: user input for a run, or a passive entry write. */
1
+ import { type Draft, type JsonRepresentation } from "@earendil-works/chord";
2
+ import type { ConversationId, EntryDraft, EntryId, EntryRecord, JsonObject, SubmissionId, Tx } from "../types.ts";
3
+ import type { InputEntry, QueueMode, Settings, UserInput } from "./types.ts";
4
+ /** A queued submission: user input for a run, with the entry it is placed as when not `pi.user`, or an entry write. */
5
5
  export type InboxItem = {
6
6
  id: SubmissionId;
7
7
  mode: "steer" | "followUp";
8
8
  content: JsonRepresentation<UserInput>;
9
+ entry?: JsonRepresentation<InputEntry>;
9
10
  }
10
11
  /** `entry` is an `EntryDraft`, stored as plain JSON. */
11
12
  | {
@@ -47,6 +48,17 @@ export declare function prepareBoundary(tx: Tx, conversationId: ConversationId,
47
48
  * stale items are removed positionally.
48
49
  */
49
50
  export declare function applyBoundary(tx: Tx, boundary: Boundary, at: "postTools" | "final", now: number): Promise<BoundaryResult>;
51
+ /** Append the entry an input is placed as: `entry`'s kind and data, or `pi.user`, with the user message of `content`. */
52
+ export declare function appendInput(tx: Tx, conversationId: ConversationId, content: UserInput, entry: InputEntry | undefined, now: number): Promise<EntryRecord>;
53
+ /** The kind and data of an input's entry as strict JSON, without other fields an untyped caller might pass. */
54
+ export declare function pickInputEntry({ kind, data }: InputEntry): JsonRepresentation<InputEntry>;
55
+ /**
56
+ * Whether a write is display-only: it has no `model`, `head`, or `edits` (present counts, even if empty), so it changes
57
+ * nothing the model sees and needs no boundary.
58
+ */
59
+ export declare function isDisplayOnly(entry: EntryDraft): boolean;
60
+ /** Whether a reset (`head: "self"` write) is queued; entries appended before it leave the active range when it lands. */
61
+ export declare function hasQueuedReset(items: readonly InboxItem[]): boolean;
50
62
  /** Whether a head write targets an entry before the active range, so placing it would bring back cut history. */
51
63
  export declare function isStale(boundary: Boundary, entry: EntryDraft): boolean;
52
64
  /** Remove a withdrawn submission's item; the caller settles the submission. */
@@ -1 +1 @@
1
- {"version":3,"file":"inbox.d.ts","sourceRoot":"","sources":["../../src/harness/inbox.ts"],"names":[],"mappings":"AAAA,OAAO,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;AAED,yHAAyH;AACzH,wBAAgB,WAAW,CAC1B,EAAE,EAAE,EAAE,EACN,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,SAAS,EAClB,KAAK,EAAE,UAAU,GAAG,SAAS,EAC7B,GAAG,EAAE,MAAM,GACT,OAAO,CAAC,WAAW,CAAC,CAItB;AAED,+GAA+G;AAC/G,wBAAgB,cAAc,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,UAAU,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAGzF;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAExD;AAED,yHAAyH;AACzH,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,SAAS,EAAE,GAAG,OAAO,CAEnE;AAED,iHAAiH;AACjH,wBAAgB,OAAO,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,GAAG,OAAO,CAEtE;AAED,+EAA+E;AAC/E,wBAAsB,eAAe,CAAC,EAAE,EAAE,EAAE,EAAE,cAAc,EAAE,cAAc,EAAE,EAAE,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAI7G;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CAAC,EAAE,EAAE,EAAE,EAAE,cAAc,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAQhG"}
@@ -1,3 +1,4 @@
1
+ import { copyJson } from "@earendil-works/chord";
1
2
  import { defineDoc } from "../documents.js";
2
3
  import { UserEntry } from "../entries.js";
3
4
  export const InboxDoc = defineDoc({
@@ -34,7 +35,7 @@ export async function prepareBoundary(tx, conversationId, modes) {
34
35
  export async function applyBoundary(tx, boundary, at, now) {
35
36
  const { conversationId, inbox } = boundary;
36
37
  const items = inbox.items;
37
- const reset = items.some((item) => item.mode === "write" && item.entry.head === "self");
38
+ const reset = hasQueuedReset(items);
38
39
  const final = at === "final" || reset;
39
40
  const pick = (mode, queueMode) => {
40
41
  const indexes = items.flatMap((item, index) => (item.mode === mode ? [index] : []));
@@ -59,8 +60,7 @@ export async function applyBoundary(tx, boundary, at, now) {
59
60
  const placed = [];
60
61
  for (const index of users) {
61
62
  const item = items[index];
62
- const message = { role: "user", content: item.content, timestamp: now };
63
- const entry = await tx.appendEntry(UserEntry, conversationId, { model: [message] });
63
+ const entry = await appendInput(tx, conversationId, item.content, item.entry, now);
64
64
  tx.placeSubmission(item.id, entry.id);
65
65
  placed.push(item.id);
66
66
  }
@@ -69,6 +69,29 @@ export async function applyBoundary(tx, boundary, at, now) {
69
69
  items.splice(index, 1);
70
70
  return { users: placed, reset };
71
71
  }
72
+ /** Append the entry an input is placed as: `entry`'s kind and data, or `pi.user`, with the user message of `content`. */
73
+ export function appendInput(tx, conversationId, content, entry, now) {
74
+ const message = { role: "user", content, timestamp: now };
75
+ if (entry === undefined)
76
+ return tx.appendEntry(UserEntry, conversationId, { model: [message] });
77
+ return tx.appendEntry(conversationId, { ...pickInputEntry(entry), model: [message] });
78
+ }
79
+ /** The kind and data of an input's entry as strict JSON, without other fields an untyped caller might pass. */
80
+ export function pickInputEntry({ kind, data }) {
81
+ const picked = data === undefined ? { kind } : { kind, data };
82
+ return copyJson(picked, { omitUndefinedProperties: true });
83
+ }
84
+ /**
85
+ * Whether a write is display-only: it has no `model`, `head`, or `edits` (present counts, even if empty), so it changes
86
+ * nothing the model sees and needs no boundary.
87
+ */
88
+ export function isDisplayOnly(entry) {
89
+ return entry.model === undefined && entry.head === undefined && entry.edits === undefined;
90
+ }
91
+ /** Whether a reset (`head: "self"` write) is queued; entries appended before it leave the active range when it lands. */
92
+ export function hasQueuedReset(items) {
93
+ return items.some((item) => item.mode === "write" && item.entry.head === "self");
94
+ }
72
95
  /** Whether a head write targets an entry before the active range, so placing it would bring back cut history. */
73
96
  export function isStale(boundary, entry) {
74
97
  return typeof entry.head === "number" && boundary.head !== undefined && entry.head < boundary.head;
@@ -1 +1 @@
1
- {"version":3,"file":"inbox.js","sourceRo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,CAAC,IAAI,KAAK,OAAO;YAAE,SAAS;QACpC,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;QAC1E,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IACxB,CAAC;AACF,CAAC","sourcesContent":["import type { Draft, JsonRepresentation } from \"@earendil-works/chord\";\nimport { defineDoc } from \"../documents.ts\";\nimport { UserEntry } from \"../entries.ts\";\nimport type { ConversationId, EntryDraft, EntryId, JsonObject, SubmissionId, Tx } from \"../types.ts\";\nimport type { QueueMode, Settings, UserInput } from \"./types.ts\";\n\n/** A queued submission: user input for a run, or a passive entry write. */\nexport type InboxItem =\n\t| { id: SubmissionId; mode: \"steer\" | \"followUp\"; content: JsonRepresentation<UserInput> }\n\t/** `entry` is an `EntryDraft`, stored as plain JSON. */\n\t| { id: SubmissionId; mode: \"write\"; entry: JsonObject };\n\n/** Built-in queue of one conversation's submissions waiting for a boundary, in ID order. */\nexport type InboxState = { items: InboxItem[] };\n\nexport const InboxDoc = defineDoc<InboxState>({\n\tkind: \"pi.inbox\",\n\tversion: 1,\n\tscope: \"conversation\",\n\thistory: \"latest\",\n\tfork: \"initial\",\n\tinitial: () => ({ items: [] }),\n\tcheckpointWhen: (value) => value.items.length === 0,\n});\n\n/** The settings a boundary reads, on the Session line. */\nexport type QueueModes = Pick<Settings, \"steeringMode\" | \"followUpMode\">;\n\n/** What a boundary reads before the commit's first table write, and the newest head it has seen so far. */\nexport type Boundary = {\n\treadonly conversationId: ConversationId;\n\treadonly inbox: Draft<InboxState>;\n\treadonly steeringMode: QueueMode;\n\treadonly followUpMode: QueueMode;\n\t/** Start of the active range, the newest head marker's `head`; advanced by heads written in this commit. */\n\thead: EntryId | undefined;\n};\n\n/** Selected user items, in ID order, and whether a `head: \"self\"` write (a reset) was placed. */\nexport type BoundaryResult = { readonly users: SubmissionId[]; readonly reset: boolean };\n\n/**\n * Read what a boundary needs. Table reads must precede the commit's first table write, so callers prepare the\n * boundary at the start of their commit.\n */\nexport async function prepareBoundary(tx: Tx, conversationId: ConversationId, modes: QueueModes): Promise<Boundary> {\n\tconst head = (await tx.latestHeadMarker(conversationId))?.head;\n\tconst inbox = await tx.doc(InboxDoc, conversationId);\n\treturn {\n\t\tconversationId,\n\t\tinbox,\n\t\tsteeringMode: modes.steeringMode,\n\t\tfollowUpMode: modes.followUpMode,\n\t\thead,\n\t};\n}\n\n/**\n * Place the queued items a boundary selects (spec §6): every write, the first or all steers, and at `final` the first\n * or all follow-ups. A selected reset turns a `postTools` boundary into `final`. Writes are placed first and user\n * items after them, each in ID order, so user items queued before a reset run in the new context. A write whose head\n * targets an entry before the active range, including a range started earlier in this commit, is stale. Selected and\n * stale items are removed positionally.\n */\nexport async function applyBoundary(\n\ttx: Tx,\n\tboundary: Boundary,\n\tat: \"postTools\" | \"final\",\n\tnow: number,\n): Promise<BoundaryResult> {\n\tconst { conversationId, inbox } = boundary;\n\tconst items = inbox.items;\n\tconst reset = items.some((item) => item.mode === \"write\" && item.entry.head === \"self\");\n\tconst final = at === \"final\" || reset;\n\tconst pick = (mode: \"steer\" | \"followUp\", queueMode: QueueMode): number[] => {\n\t\tconst indexes = items.flatMap((item, index) => (item.mode === mode ? [index] : []));\n\t\treturn queueMode === \"all\" ? indexes : indexes.slice(0, 1);\n\t};\n\tconst writes = items.flatMap((item, index) => (item.mode === \"write\" ? [index] : []));\n\tconst users = [...pick(\"steer\", boundary.steeringMode), ...(final ? pick(\"followUp\", boundary.followUpMode) : [])];\n\tusers.sort((a, b) => a - b);\n\n\t// `appendEntry()` copies the drafts' values; the items are removed only afterwards.\n\tfor (const index of writes) {\n\t\tconst item = items[index] as Draft<Extract<InboxItem, { mode: \"write\" }>>;\n\t\tconst draft = item.entry as unknown as EntryDraft;\n\t\tif (isStale(boundary, draft)) {\n\t\t\ttx.settleSubmission(item.id, { status: \"unanswered\", reason: \"stale\" });\n\t\t\tcontinue;\n\t\t}\n\t\tconst entry = await tx.appendEntry(conversationId, draft);\n\t\tif (draft.head !== undefined) boundary.head = draft.head === \"self\" ? entry.id : draft.head;\n\t\ttx.placeSubmission(item.id, entry.id);\n\t}\n\tconst placed: SubmissionId[] = [];\n\tfor (const index of users) {\n\t\tconst item = items[index] as Draft<Extract<InboxItem, { mode: \"steer\" | \"followUp\" }>>;\n\t\tconst message = { role: \"user\", content: item.content as UserInput, timestamp: now } as const;\n\t\tconst entry = await tx.appendEntry(UserEntry, conversationId, { model: [message] });\n\t\ttx.placeSubmission(item.id, entry.id);\n\t\tplaced.push(item.id);\n\t}\n\tconst removed = [...writes, ...users].sort((a, b) => b - a);\n\tfor (const index of removed) items.splice(index, 1);\n\treturn { users: placed, reset };\n}\n\n/** Whether a head write targets an entry before the active range, so placing it would bring back cut history. */\nexport function isStale(boundary: Boundary, entry: EntryDraft): boolean {\n\treturn typeof entry.head === \"number\" && boundary.head !== undefined && entry.head < boundary.head;\n}\n\n/** Remove a withdrawn submission's item; the caller settles the submission. */\nexport async function removeInboxItem(tx: Tx, conversationId: ConversationId, id: SubmissionId): Promise<void> {\n\tconst items = (await tx.doc(InboxDoc, conversationId)).items;\n\tconst index = items.findIndex((item) => item.id === id);\n\tif (index >= 0) items.splice(index, 1);\n}\n\n/**\n * Withdraw every queued input of a conversation, as `Conversation.abort()` and abort cascades do: each settles\n * `unanswered` with `aborted` and leaves the inbox; queued writes stay for later placement.\n */\nexport async function withdrawQueuedInputs(tx: Tx, conversationId: ConversationId): Promise<void> {\n\tconst items = (await tx.doc(InboxDoc, conversationId)).items;\n\tfor (let index = items.length - 1; index >= 0; index--) {\n\t\tconst item = items[index]!;\n\t\tif (item.mode === \"write\") continue;\n\t\ttx.settleSubmission(item.id, { status: \"unanswered\", reason: \"aborted\" });\n\t\titems.splice(index, 1);\n\t}\n}\n"]}
1
+ {"version":3,"file":"inbox.js","sourceRoot":"","sources":["../../src/harness/inbox.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;AACF,CAAC","sourcesContent":["import { copyJson, type Draft, type JsonRepresentation } from \"@earendil-works/chord\";\nimport { defineDoc } from \"../documents.ts\";\nimport { UserEntry } from \"../entries.ts\";\nimport type { ConversationId, EntryDraft, EntryId, EntryRecord, JsonObject, SubmissionId, Tx } from \"../types.ts\";\nimport type { InputEntry, QueueMode, Settings, UserInput } from \"./types.ts\";\n\n/** A queued submission: user input for a run, with the entry it is placed as when not `pi.user`, or an entry write. */\nexport type InboxItem =\n\t| {\n\t\t\tid: SubmissionId;\n\t\t\tmode: \"steer\" | \"followUp\";\n\t\t\tcontent: JsonRepresentation<UserInput>;\n\t\t\tentry?: JsonRepresentation<InputEntry>;\n\t }\n\t/** `entry` is an `EntryDraft`, stored as plain JSON. */\n\t| { id: SubmissionId; mode: \"write\"; entry: JsonObject };\n\n/** Built-in queue of one conversation's submissions waiting for a boundary, in ID order. */\nexport type InboxState = { items: InboxItem[] };\n\nexport const InboxDoc = defineDoc<InboxState>({\n\tkind: \"pi.inbox\",\n\tversion: 1,\n\tscope: \"conversation\",\n\thistory: \"latest\",\n\tfork: \"initial\",\n\tinitial: () => ({ items: [] }),\n\tcheckpointWhen: (value) => value.items.length === 0,\n});\n\n/** The settings a boundary reads, on the Session line. */\nexport type QueueModes = Pick<Settings, \"steeringMode\" | \"followUpMode\">;\n\n/** What a boundary reads before the commit's first table write, and the newest head it has seen so far. */\nexport type Boundary = {\n\treadonly conversationId: ConversationId;\n\treadonly inbox: Draft<InboxState>;\n\treadonly steeringMode: QueueMode;\n\treadonly followUpMode: QueueMode;\n\t/** Start of the active range, the newest head marker's `head`; advanced by heads written in this commit. */\n\thead: EntryId | undefined;\n};\n\n/** Selected user items, in ID order, and whether a `head: \"self\"` write (a reset) was placed. */\nexport type BoundaryResult = { readonly users: SubmissionId[]; readonly reset: boolean };\n\n/**\n * Read what a boundary needs. Table reads must precede the commit's first table write, so callers prepare the\n * boundary at the start of their commit.\n */\nexport async function prepareBoundary(tx: Tx, conversationId: ConversationId, modes: QueueModes): Promise<Boundary> {\n\tconst head = (await tx.latestHeadMarker(conversationId))?.head;\n\tconst inbox = await tx.doc(InboxDoc, conversationId);\n\treturn {\n\t\tconversationId,\n\t\tinbox,\n\t\tsteeringMode: modes.steeringMode,\n\t\tfollowUpMode: modes.followUpMode,\n\t\thead,\n\t};\n}\n\n/**\n * Place the queued items a boundary selects (spec §6): every write, the first or all steers, and at `final` the first\n * or all follow-ups. A selected reset turns a `postTools` boundary into `final`. Writes are placed first and user\n * items after them, each in ID order, so user items queued before a reset run in the new context. A write whose head\n * targets an entry before the active range, including a range started earlier in this commit, is stale. Selected and\n * stale items are removed positionally.\n */\nexport async function applyBoundary(\n\ttx: Tx,\n\tboundary: Boundary,\n\tat: \"postTools\" | \"final\",\n\tnow: number,\n): Promise<BoundaryResult> {\n\tconst { conversationId, inbox } = boundary;\n\tconst items = inbox.items;\n\tconst reset = hasQueuedReset(items);\n\tconst final = at === \"final\" || reset;\n\tconst pick = (mode: \"steer\" | \"followUp\", queueMode: QueueMode): number[] => {\n\t\tconst indexes = items.flatMap((item, index) => (item.mode === mode ? [index] : []));\n\t\treturn queueMode === \"all\" ? indexes : indexes.slice(0, 1);\n\t};\n\tconst writes = items.flatMap((item, index) => (item.mode === \"write\" ? [index] : []));\n\tconst users = [...pick(\"steer\", boundary.steeringMode), ...(final ? pick(\"followUp\", boundary.followUpMode) : [])];\n\tusers.sort((a, b) => a - b);\n\n\t// `appendEntry()` copies the drafts' values; the items are removed only afterwards.\n\tfor (const index of writes) {\n\t\tconst item = items[index] as Draft<Extract<InboxItem, { mode: \"write\" }>>;\n\t\tconst draft = item.entry as unknown as EntryDraft;\n\t\tif (isStale(boundary, draft)) {\n\t\t\ttx.settleSubmission(item.id, { status: \"unanswered\", reason: \"stale\" });\n\t\t\tcontinue;\n\t\t}\n\t\tconst entry = await tx.appendEntry(conversationId, draft);\n\t\tif (draft.head !== undefined) boundary.head = draft.head === \"self\" ? entry.id : draft.head;\n\t\ttx.placeSubmission(item.id, entry.id);\n\t}\n\tconst placed: SubmissionId[] = [];\n\tfor (const index of users) {\n\t\tconst item = items[index] as Draft<Extract<InboxItem, { mode: \"steer\" | \"followUp\" }>>;\n\t\tconst entry = await appendInput(tx, conversationId, item.content as UserInput, item.entry as InputEntry, now);\n\t\ttx.placeSubmission(item.id, entry.id);\n\t\tplaced.push(item.id);\n\t}\n\tconst removed = [...writes, ...users].sort((a, b) => b - a);\n\tfor (const index of removed) items.splice(index, 1);\n\treturn { users: placed, reset };\n}\n\n/** Append the entry an input is placed as: `entry`'s kind and data, or `pi.user`, with the user message of `content`. */\nexport function appendInput(\n\ttx: Tx,\n\tconversationId: ConversationId,\n\tcontent: UserInput,\n\tentry: InputEntry | undefined,\n\tnow: number,\n): Promise<EntryRecord> {\n\tconst message = { role: \"user\", content, timestamp: now } as const;\n\tif (entry === undefined) return tx.appendEntry(UserEntry, conversationId, { model: [message] });\n\treturn tx.appendEntry(conversationId, { ...pickInputEntry(entry), model: [message] });\n}\n\n/** The kind and data of an input's entry as strict JSON, without other fields an untyped caller might pass. */\nexport function pickInputEntry({ kind, data }: InputEntry): JsonRepresentation<InputEntry> {\n\tconst picked = data === undefined ? { kind } : { kind, data };\n\treturn copyJson(picked, { omitUndefinedProperties: true }) as JsonRepresentation<InputEntry>;\n}\n\n/**\n * Whether a write is display-only: it has no `model`, `head`, or `edits` (present counts, even if empty), so it changes\n * nothing the model sees and needs no boundary.\n */\nexport function isDisplayOnly(entry: EntryDraft): boolean {\n\treturn entry.model === undefined && entry.head === undefined && entry.edits === undefined;\n}\n\n/** Whether a reset (`head: \"self\"` write) is queued; entries appended before it leave the active range when it lands. */\nexport function hasQueuedReset(items: readonly InboxItem[]): boolean {\n\treturn items.some((item) => item.mode === \"write\" && item.entry.head === \"self\");\n}\n\n/** Whether a head write targets an entry before the active range, so placing it would bring back cut history. */\nexport function isStale(boundary: Boundary, entry: EntryDraft): boolean {\n\treturn typeof entry.head === \"number\" && boundary.head !== undefined && entry.head < boundary.head;\n}\n\n/** Remove a withdrawn submission's item; the caller settles the submission. */\nexport async function removeInboxItem(tx: Tx, conversationId: ConversationId, id: SubmissionId): Promise<void> {\n\tconst items = (await tx.doc(InboxDoc, conversationId)).items;\n\tconst index = items.findIndex((item) => item.id === id);\n\tif (index >= 0) items.splice(index, 1);\n}\n\n/**\n * Withdraw every queued input of a conversation, as `Conversation.abort()` and abort cascades do: each settles\n * `unanswered` with `aborted` and leaves the inbox; queued writes stay for later placement.\n */\nexport async function withdrawQueuedInputs(tx: Tx, conversationId: ConversationId): Promise<void> {\n\tconst items = (await tx.doc(InboxDoc, conversationId)).items;\n\tfor (let index = items.length - 1; index >= 0; index--) {\n\t\tconst item = items[index]!;\n\t\tif (item.mode === \"write\") continue;\n\t\ttx.settleSubmission(item.id, { status: \"unanswered\", reason: \"aborted\" });\n\t\titems.splice(index, 1);\n\t}\n}\n"]}
@@ -1,18 +1,13 @@
1
1
  import type { Draft, JsonRepresentation, JsonValue } from "@earendil-works/chord";
2
- import type { AssistantMessage } from "@earendil-works/pi-ai";
2
+ import type { AssistantMessage, Usage } from "@earendil-works/pi-ai";
3
3
  import type { Transaction } from "../session/transaction.ts";
4
- import type { EntryId, SubmissionId, SubmissionSettlement, TaskId, TaskRecord, Tx } from "../types.ts";
4
+ import type { EntryId, JsonObject, SubmissionId, SubmissionSettlement, TaskId, TaskRecord, Tx } from "../types.ts";
5
5
  import type { SchedulerOutcome } from "./scheduler.ts";
6
6
  import type { CompactionReason, CompactionResult, ToolDiagnostic } from "./types.ts";
7
- /** Presentation of one tool call of the current round. */
8
- export type ToolSlot = {
7
+ /** What a running tool call publishes, shared by model-issued and nested calls. */
8
+ type SlotProgress = {
9
9
  callId: string;
10
10
  name: string;
11
- /**
12
- * Absent for a call not started yet (sequential round) and for a call its request did not offer, which starts `done`
13
- * with the `entry` generation wrote.
14
- */
15
- taskId?: TaskId;
16
11
  status: "pending" | "running" | "done";
17
12
  /** Retained running output and what the bounds dropped. */
18
13
  output?: string;
@@ -22,9 +17,41 @@ export type ToolSlot = {
22
17
  details?: JsonValue;
23
18
  /** Diagnostics recorded through `api.diagnostic()`. */
24
19
  diagnostics?: ToolDiagnostic[];
20
+ };
21
+ /** Presentation of one tool call of the current round. */
22
+ export type ToolSlot = SlotProgress & {
23
+ /**
24
+ * Absent for a call not started yet (sequential round) and for a call its request did not offer, which starts `done`
25
+ * with the `entry` generation wrote.
26
+ */
27
+ taskId?: TaskId;
25
28
  /** Result entry once done; absent when the tool task faulted or was orphaned. */
26
29
  entry?: EntryId;
27
30
  };
31
+ /**
32
+ * Presentation of one nested call: a call a running tool made through `executeTool()`. `callId` is
33
+ * `<parentCallId>/<key>`, the call's ID in tool events and unique because keys contain no `/`. The Harness relates
34
+ * slots by task ID: `taskId` is the call's tool task, `parentTaskId` the calling one, model-issued or nested.
35
+ */
36
+ export type NestedToolSlot = SlotProgress & {
37
+ parentCallId: string;
38
+ parentTaskId: TaskId;
39
+ taskId: TaskId;
40
+ /**
41
+ * What the call was made with, replaced by the arguments it runs with, after repair, `beforeTool`, and coercion,
42
+ * once it starts executing. A model-issued call's arguments are in its assistant entry instead.
43
+ */
44
+ arguments: JsonObject;
45
+ /** Once done: how the call ended, for a status line. The result itself is in the caller's `NestedCallDoc`. */
46
+ summary?: NestedToolSummary;
47
+ };
48
+ /** How a nested call ended: an error flag, its execution time, its spend, and up to 500 characters of error text. */
49
+ export type NestedToolSummary = {
50
+ isError: boolean;
51
+ durationMs?: number;
52
+ usage?: JsonRepresentation<Usage>;
53
+ error?: string;
54
+ };
28
55
  /** Presentation of one live compaction task (spec §8.7). */
29
56
  export type CompactionStatus = {
30
57
  taskId: TaskId<CompactionResult>;
@@ -38,6 +65,13 @@ export type CompactionStatus = {
38
65
  error: string;
39
66
  };
40
67
  };
68
+ /** The newest compaction that failed since a compaction last produced a summary (spec §8.7). */
69
+ export type CompactionFailure = {
70
+ taskId: TaskId<CompactionResult>;
71
+ reason: CompactionReason;
72
+ /** The failed or faulted outcome's error message, or why the scheduler orphaned the task. */
73
+ error: string;
74
+ };
41
75
  /** Built-in live conversation state: run control and presentation of the current generation and tool round. */
42
76
  export type LiveState = {
43
77
  /** Run control: the task that settles the run's inputs, and those inputs; present exactly while busy. */
@@ -62,13 +96,23 @@ export type LiveState = {
62
96
  };
63
97
  /** The current tool round in call order, from the tool-calling answer until the generation's `tools` phase ends it. */
64
98
  tools?: ToolSlot[];
99
+ /**
100
+ * Nested calls of running tool calls, in creation order, so a parent precedes its children and task IDs ascend. A
101
+ * call's nested slots are removed when the call settles.
102
+ */
103
+ nestedTools?: NestedToolSlot[];
65
104
  /** Live compaction tasks in task ID order; absent when none. */
66
105
  compactions?: CompactionStatus[];
106
+ /**
107
+ * The newest compaction failure, so a client can show it after the task ended. A compaction that produces a summary
108
+ * removes it; one that is aborted or finds nothing to compact leaves it.
109
+ */
110
+ compactionFailure?: CompactionFailure;
67
111
  };
68
112
  export declare const LiveDoc: import("../types.ts").ConversationDocToken<LiveState>;
69
113
  /**
70
- * End the run owned by `taskId`: settle each of its inputs and remove `run`. Always removes `generation` and `tools`,
71
- * whose presentation belongs to the ending run.
114
+ * End the run owned by `taskId`: settle each of its inputs and remove `run`. Always removes `generation`, `tools`, and
115
+ * `nestedTools`, whose presentation belongs to the ending run.
72
116
  */
73
117
  export declare function endRun(tx: Tx, live: Draft<LiveState>, taskId: TaskId, settlement: SubmissionSettlement): void;
74
118
  /** Add the status of a compaction task created in this commit; statuses stay in task ID order. */
@@ -77,16 +121,28 @@ export declare function addCompactionStatus(live: Draft<LiveState>, status: Comp
77
121
  export declare function compactionStatus(live: Draft<LiveState>, taskId: TaskId): Draft<CompactionStatus> | undefined;
78
122
  /** Remove the status of compaction task `taskId`, and the list once empty. */
79
123
  export declare function removeCompactionStatus(live: Draft<LiveState>, taskId: TaskId): void;
80
- /** The slot of tool task `taskId` in the current round, if the round still lists it. */
81
- export declare function toolSlot(live: Draft<LiveState>, taskId: TaskId): Draft<ToolSlot> | undefined;
82
- /** Mark a slot done: the result entry, if any, now carries its running output, details, and diagnostics. */
83
- export declare function finishSlot(slot: Draft<ToolSlot>, entry: EntryId | undefined): void;
124
+ /** Remove the status of compaction task `taskId` and record that it failed with `error`. */
125
+ export declare function failCompactionStatus(live: Draft<LiveState>, taskId: TaskId, error: string): void;
126
+ /**
127
+ * The slot of tool task `taskId`, model-issued or nested, if `pi.live` still lists it. Nested slots are found by binary
128
+ * search: a tool may make thousands of nested calls, each of which looks up its slot in several commits, and every
129
+ * element a search reads costs a node in the draft's change tracker. Their task IDs ascend: each slot is appended in
130
+ * the commit that creates its task, task IDs ascend in commit order, and removal keeps the order.
131
+ */
132
+ export declare function toolSlot(live: Draft<LiveState>, taskId: TaskId): Draft<ToolSlot | NestedToolSlot> | undefined;
133
+ /**
134
+ * Mark a slot done and clear its running output; the caller sets a model-issued call's result `entry`, or a nested
135
+ * call's `summary`. Neither is set when the task faulted or was orphaned.
136
+ */
137
+ export declare function finishSlot(slot: Draft<ToolSlot | NestedToolSlot>): void;
138
+ /** Remove the nested slots below tool task `taskId`, transitively; the list holds parents before their children. */
139
+ export declare function removeNestedSlots(live: Draft<LiveState>, taskId: TaskId): void;
84
140
  /** Remove what a tool published while running; its result entry or a rerun replaces it. */
85
- export declare function clearProgress(slot: Draft<ToolSlot>): void;
141
+ export declare function clearProgress(slot: Draft<SlotProgress>): void;
86
142
  /**
87
143
  * Harness cleanup for a terminal outcome the scheduler writes itself (`faulted` or `orphaned`). A run task ends its
88
144
  * run; a tool task's slot is marked done without an entry, and context derivation synthesizes the missing result; a
89
- * compaction task's status is removed.
145
+ * compaction task's status is removed and its failure recorded.
90
146
  * Ignores other kinds so it never creates `pi.live` elsewhere. The scheduler calls this without knowing task kinds;
91
147
  * the Harness passes it in (spec §5.4).
92
148
  * REMINDER: a committed generation partial becomes an aborted assistant entry here, exactly as in the generation abort
@@ -96,4 +152,5 @@ export declare function clearProgress(slot: Draft<ToolSlot>): void;
96
152
  * uncertain storage failure poisons the Session instead and writes no outcome.
97
153
  */
98
154
  export declare function settleSchedulerOutcome(tx: Transaction, record: TaskRecord<JsonValue, JsonValue, JsonValue>, outcome: SchedulerOutcome): Promise<void>;
155
+ export {};
99
156
  //# sourceMappingURL=live.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"live.d.ts","sourceRoot":"","sources":["../../src/harness/live.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEvG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAErF,0DAA0D;AAC1D,MAAM,MAAM,QAAQ,GAAG;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;IACvC,2DAA2D;IAC3D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,8BAA8B;IAC9B,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,uDAAuD;IACvD,WAAW,CAAC,EAAE,cAAc,EAAE,CAAC;IAC/B,iFAAiF;IACjF,KAAK,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,4DAA4D;AAC5D,MAAM,MAAM,g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2F;AAC3F,wBAAgB,aAAa,CAAC,IAAI,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,IAAI,CAM7D;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,sBAAsB,CAC3C,EAAE,EAAE,WAAW,EACf,MAAM,EAAE,UAAU,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,EACnD,OAAO,EAAE,gBAAgB,GACvB,OAAO,CAAC,IAAI,CAAC,CAyBf"}
@@ -10,16 +10,19 @@ export const LiveDoc = defineDoc({
10
10
  // REMINDER: a complete base whenever nothing runs (spec §8.2): no generation and no running tool slot. That holds
11
11
  // while idle, in the commit handing a generation over to its tool round, and between tools, so the delta chain
12
12
  // spans at most one generation or the overlapping execution of one round's tools. A slot holds output only while
13
- // running, so every base is small. Do not add a delta-count bound; the tool output benchmark checks this rule.
14
- checkpointWhen: (value) => value.generation === undefined && !(value.tools ?? []).some((slot) => slot.status === "running"),
13
+ // running, so every base is small; a nested call's result lives in its caller's task documents, never here. Do not
14
+ // add a delta-count bound; the tool output benchmark checks this rule.
15
+ checkpointWhen: (value) => value.generation === undefined &&
16
+ !(value.tools ?? []).some((slot) => slot.status === "running") &&
17
+ !(value.nestedTools ?? []).some((slot) => slot.status === "running"),
15
18
  });
16
19
  /** Built-in task kinds that can own `pi.live.run`. */
17
20
  const RUN_TASK_KINDS = new Set(["pi.generation"]);
18
21
  const TOOL_TASK_KIND = "pi.tool";
19
22
  const COMPACTION_TASK_KIND = "pi.compaction";
20
23
  /**
21
- * End the run owned by `taskId`: settle each of its inputs and remove `run`. Always removes `generation` and `tools`,
22
- * whose presentation belongs to the ending run.
24
+ * End the run owned by `taskId`: settle each of its inputs and remove `run`. Always removes `generation`, `tools`, and
25
+ * `nestedTools`, whose presentation belongs to the ending run.
23
26
  */
24
27
  export function endRun(tx, live, taskId, settlement) {
25
28
  if (live.run?.taskId === taskId) {
@@ -29,6 +32,7 @@ export function endRun(tx, live, taskId, settlement) {
29
32
  }
30
33
  delete live.generation;
31
34
  delete live.tools;
35
+ delete live.nestedTools;
32
36
  }
33
37
  /** Add the status of a compaction task created in this commit; statuses stay in task ID order. */
34
38
  export function addCompactionStatus(live, status) {
@@ -50,17 +54,62 @@ export function removeCompactionStatus(live, taskId) {
50
54
  if (statuses.length === 0)
51
55
  delete live.compactions;
52
56
  }
53
- /** The slot of tool task `taskId` in the current round, if the round still lists it. */
57
+ /** Remove the status of compaction task `taskId` and record that it failed with `error`. */
58
+ export function failCompactionStatus(live, taskId, error) {
59
+ const status = compactionStatus(live, taskId);
60
+ if (status !== undefined)
61
+ live.compactionFailure = { taskId: status.taskId, reason: status.reason, error };
62
+ removeCompactionStatus(live, taskId);
63
+ }
64
+ /**
65
+ * The slot of tool task `taskId`, model-issued or nested, if `pi.live` still lists it. Nested slots are found by binary
66
+ * search: a tool may make thousands of nested calls, each of which looks up its slot in several commits, and every
67
+ * element a search reads costs a node in the draft's change tracker. Their task IDs ascend: each slot is appended in
68
+ * the commit that creates its task, task IDs ascend in commit order, and removal keeps the order.
69
+ */
54
70
  export function toolSlot(live, taskId) {
55
- return live.tools?.find((slot) => slot.taskId === taskId);
71
+ const slot = live.tools?.find((each) => each.taskId === taskId);
72
+ if (slot !== undefined || live.nestedTools === undefined)
73
+ return slot;
74
+ const nested = live.nestedTools;
75
+ let low = 0;
76
+ let high = nested.length - 1;
77
+ while (low <= high) {
78
+ const middle = (low + high) >>> 1;
79
+ const candidate = nested[middle];
80
+ if (candidate.taskId === taskId)
81
+ return candidate;
82
+ if (candidate.taskId < taskId)
83
+ low = middle + 1;
84
+ else
85
+ high = middle - 1;
86
+ }
87
+ return undefined;
56
88
  }
57
- /** Mark a slot done: the result entry, if any, now carries its running output, details, and diagnostics. */
58
- export function finishSlot(slot, entry) {
89
+ /**
90
+ * Mark a slot done and clear its running output; the caller sets a model-issued call's result `entry`, or a nested
91
+ * call's `summary`. Neither is set when the task faulted or was orphaned.
92
+ */
93
+ export function finishSlot(slot) {
59
94
  slot.status = "done";
60
- if (entry !== undefined)
61
- slot.entry = entry;
62
95
  clearProgress(slot);
63
96
  }
97
+ /** Remove the nested slots below tool task `taskId`, transitively; the list holds parents before their children. */
98
+ export function removeNestedSlots(live, taskId) {
99
+ const nested = live.nestedTools;
100
+ if (nested === undefined)
101
+ return;
102
+ const removed = new Set([taskId]);
103
+ for (const slot of nested)
104
+ if (removed.has(slot.parentTaskId))
105
+ removed.add(slot.taskId);
106
+ for (let index = nested.length - 1; index >= 0; index--) {
107
+ if (removed.has(nested[index].parentTaskId))
108
+ nested.splice(index, 1);
109
+ }
110
+ if (nested.length === 0)
111
+ delete live.nestedTools;
112
+ }
64
113
  /** Remove what a tool published while running; its result entry or a rerun replaces it. */
65
114
  export function clearProgress(slot) {
66
115
  delete slot.output;
@@ -72,7 +121,7 @@ export function clearProgress(slot) {
72
121
  /**
73
122
  * Harness cleanup for a terminal outcome the scheduler writes itself (`faulted` or `orphaned`). A run task ends its
74
123
  * run; a tool task's slot is marked done without an entry, and context derivation synthesizes the missing result; a
75
- * compaction task's status is removed.
124
+ * compaction task's status is removed and its failure recorded.
76
125
  * Ignores other kinds so it never creates `pi.live` elsewhere. The scheduler calls this without knowing task kinds;
77
126
  * the Harness passes it in (spec §5.4).
78
127
  * REMINDER: a committed generation partial becomes an aborted assistant entry here, exactly as in the generation abort
@@ -83,13 +132,16 @@ export function clearProgress(slot) {
83
132
  */
84
133
  export async function settleSchedulerOutcome(tx, record, outcome) {
85
134
  if (record.kind === TOOL_TASK_KIND) {
86
- const slot = toolSlot(await tx.doc(LiveDoc, record.conversationId), record.id);
135
+ const live = await tx.doc(LiveDoc, record.conversationId);
136
+ const slot = toolSlot(live, record.id);
87
137
  if (slot !== undefined)
88
- finishSlot(slot, undefined);
138
+ finishSlot(slot);
139
+ removeNestedSlots(live, record.id);
89
140
  return;
90
141
  }
91
142
  if (record.kind === COMPACTION_TASK_KIND) {
92
- removeCompactionStatus(await tx.doc(LiveDoc, record.conversationId), record.id);
143
+ const error = outcome.status === "faulted" ? outcome.error.message : outcome.reason;
144
+ failCompactionStatus(await tx.doc(LiveDoc, record.conversationId), record.id, error);
93
145
  return;
94
146
  }
95
147
  if (!RUN_TASK_KINDS.has(record.kind))