@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,EAAE,CAAC,IAAY,EAAE,QAAiB,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACxF,KAAK,EAAE,CAAC,IAAY,EAAE,QAAiB,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAC3G,WAAW,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC;QACpD,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC;QAChC,IAAI,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC;KAC7C,CAAC;AACH,CAAC","sourcesContent":["import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport type { ThinkingLevel } from \"@earendil-works/pi-agent-core\";\nimport {\n\tbackgroundAnsi,\n\ttype Color,\n\tcolorToHex,\n\tcolorToOklch,\n\ttype EditorTheme,\n\tforegroundAnsi,\n\tgetTerminalColorMode,\n\tindexedColor,\n\ttype MarkdownTheme,\n\tmixColors,\n\tparseColor,\n\ttype RgbColor,\n\trgbColor,\n\ttype SelectListTheme,\n\ttype SettingsListTheme,\n\tstyleTextWithAnsi,\n\ttype TerminalColorMode,\n\ttype TerminalColors,\n\ttype TextAttributes,\n} from \"@earendil-works/pi-tui\";\nimport chalk from \"chalk\";\nimport { getCustomThemesDir, getThemesDir } from \"../../../config.ts\";\nimport type { SourceInfo } from \"../../../core/source-info.ts\";\nimport { closeWatcher, watchWithErrorHandler } from \"../../../utils/fs-watch.ts\";\nimport { highlight, supportsLanguage } from \"../../../utils/syntax-highlight.ts\";\nimport { stripBom } from \"../../../utils/text.ts\";\nimport { generateSystemThemeColors, SYSTEM_THEME_NAME, terminalAppearance } from \"./system-theme.ts\";\n\nexport { SYSTEM_THEME_NAME } from \"./system-theme.ts\";\n\n// ============================================================================\n// Types & Schema\n// ============================================================================\n\n/** The schema that validates this shape lives in `theme-json.ts`; importing the type is free. */\nimport type { ThemeColorValue as ColorValue, ValidatedThemeJson as ThemeJson } from \"./theme-json.ts\";\n\nexport type { ValidatedThemeJson as ThemeJson } from \"./theme-json.ts\";\n\nexport type ThemeJsonValidator = (label: string, json: unknown) => ThemeJson;\n\nlet themeJsonValidator: ThemeJsonValidator | undefined;\n\n/**\n * Install full theme validation. Without it, documents are accepted as-is, which is what built-in\n * themes already do: validating user-authored JSON needs typebox, and a presentation that only uses\n * built-in themes should not pay ~17 MB of module graph for it.\n */\nexport function setThemeJsonValidator(validator: ThemeJsonValidator): void {\n\tthemeJsonValidator = validator;\n}\n\nexport type ThemeColor =\n\t| \"accent\"\n\t| \"border\"\n\t| \"borderAccent\"\n\t| \"borderMuted\"\n\t| \"success\"\n\t| \"error\"\n\t| \"warning\"\n\t| \"muted\"\n\t| \"dim\"\n\t| \"text\"\n\t| \"thinkingText\"\n\t| \"scrollbarTrack\"\n\t| \"scrollbarThumb\"\n\t| \"searchMatchText\"\n\t| \"userMessageText\"\n\t| \"customMessageText\"\n\t| \"customMessageLabel\"\n\t| \"toolTitle\"\n\t| \"toolOutput\"\n\t| \"mdHeading\"\n\t| \"mdLink\"\n\t| \"mdLinkUrl\"\n\t| \"mdCode\"\n\t| \"mdCodeBlock\"\n\t| \"mdCodeBlockBorder\"\n\t| \"mdQuote\"\n\t| \"mdQuoteBorder\"\n\t| \"mdHr\"\n\t| \"mdListBullet\"\n\t| \"toolDiffAdded\"\n\t| \"toolDiffRemoved\"\n\t| \"toolDiffContext\"\n\t| \"syntaxComment\"\n\t| \"syntaxKeyword\"\n\t| \"syntaxFunction\"\n\t| \"syntaxVariable\"\n\t| \"syntaxString\"\n\t| \"syntaxNumber\"\n\t| \"syntaxType\"\n\t| \"syntaxOperator\"\n\t| \"syntaxPunctuation\"\n\t| \"thinkingOff\"\n\t| \"thinkingMinimal\"\n\t| \"thinkingLow\"\n\t| \"thinkingMedium\"\n\t| \"thinkingHigh\"\n\t| \"thinkingXhigh\"\n\t| \"thinkingMax\"\n\t| \"bashMode\";\n\nexport type ThemeBg =\n\t| \"selectedBg\"\n\t| \"searchMatchBg\"\n\t| \"userMessageBg\"\n\t| \"customMessageBg\"\n\t| \"toolPendingBg\"\n\t| \"toolSuccessBg\"\n\t| \"toolErrorBg\";\n\nexport type ThemeToken = ThemeColor | ThemeBg;\n\n/**\n * Tokens are only accepted in their own slot, because \"\" (terminal default) means the default foreground\n * or background depending on the slot. Use `theme.colors[token]` to use a token's color in the other slot.\n */\nexport interface ThemeStyle extends TextAttributes {\n\tfg?: ThemeColor | Color;\n\tbg?: ThemeBg | Color;\n}\n\ntype OptionalThemeColor = \"scrollbarTrack\" | \"scrollbarThumb\" | \"thinkingMax\" | \"searchMatchText\";\ntype OptionalThemeBg = \"searchMatchBg\";\n\n// ============================================================================\n// Color Utilities\n// ============================================================================\n\nfunction resolveVarRefs(\n\tvalue: ColorValue,\n\tvars: Record<string, ColorValue>,\n\tvisited = new Set<string>(),\n): string | number {\n\tif (typeof value === \"number\" || value === \"\" || value.startsWith(\"#\") || /^ok(lch|hsl)\\(/i.test(value)) {\n\t\treturn value;\n\t}\n\tif (visited.has(value)) {\n\t\tthrow new Error(`Circular variable reference detected: ${value}`);\n\t}\n\tif (!(value in vars)) {\n\t\tthrow new Error(`Variable reference not found: ${value}`);\n\t}\n\tvisited.add(value);\n\treturn resolveVarRefs(vars[value], vars, visited);\n}\n\nfunction resolveThemeColors<T extends Record<string, ColorValue>>(\n\tcolors: T,\n\tvars: Record<string, ColorValue> = {},\n): Record<keyof T, string | number> {\n\tconst resolved: Record<string, string | number> = {};\n\tfor (const [key, value] of Object.entries(colors)) {\n\t\tresolved[key] = resolveVarRefs(value, vars);\n\t}\n\treturn resolved as Record<keyof T, string | number>;\n}\n\nfunction withThemeColorFallbacks(colors: ThemeJson[\"colors\"]): ThemeJson[\"colors\"] & {\n\tscrollbarTrack: ColorValue;\n\tscrollbarThumb: ColorValue;\n\tthinkingMax: ColorValue;\n\tsearchMatchBg: ColorValue;\n\tsearchMatchText: ColorValue;\n} {\n\treturn {\n\t\t...colors,\n\t\tscrollbarTrack: colors.scrollbarTrack ?? colors.muted,\n\t\tscrollbarThumb: colors.scrollbarThumb ?? colors.text,\n\t\tthinkingMax: colors.thinkingMax ?? colors.thinkingXhigh,\n\t\tsearchMatchBg: colors.searchMatchBg ?? colors.selectedBg,\n\t\tsearchMatchText: colors.searchMatchText ?? colors.text,\n\t};\n}\n\n// ============================================================================\n// Appearance & Terminal Default Colors\n// ============================================================================\n\n/** The background a theme is designed for. */\nexport type ThemeAppearance = TerminalTheme;\n\n// The terminal's reported colors. Replaced (never mutated) on update, so themes can cache resolved colors\n// by identity.\nlet terminalColors: TerminalColors = {};\n// While the terminal color query is in flight, the system theme renders in grayscale.\nlet terminalColorsPending = false;\n// The terminal's last light/dark report (mode 2031). Only used while it has not reported a background.\nlet terminalColorScheme: TerminalTheme | undefined;\n\n/**\n * Record the terminal's reported colors. Themes use the default colors for tokens set to \"\" (terminal\n * default); the system theme is generated from all of them. Ends the pending state.\n */\nexport function setTerminalColors(colors: TerminalColors): void {\n\tterminalColors = { ...colors };\n\tterminalColorsPending = false;\n}\n\n/** Record the terminal's light/dark report, the fallback for terminals that do not report their background. */\nexport function setTerminalColorScheme(scheme: TerminalTheme | undefined): void {\n\tterminalColorScheme = scheme;\n}\n\n/** Render the system theme in grayscale until `setTerminalColors()` reports the terminal's colors. */\nexport function markTerminalColorsPending(): void {\n\tterminalColorsPending = true;\n}\n\n/** Assumed terminal default colors when the terminal does not report them. */\nconst GUESSED_DEFAULT_COLORS: Record<ThemeAppearance, { foreground: Color; background: Color }> = {\n\tdark: { foreground: parseColor(\"#e5e5e7\"), background: parseColor(\"#000000\") },\n\tlight: { foreground: parseColor(\"#000000\"), background: parseColor(\"#ffffff\") },\n};\n\nfunction averageLightness(colors: Color[]): number | undefined {\n\t// Palette colors 0-15 follow the user's terminal palette, so they say nothing about the theme.\n\tconst fixed = colors.filter((color) => color.kind !== \"indexed\" || color.index >= 16);\n\tif (fixed.length === 0) return undefined;\n\treturn fixed.reduce((sum, color) => sum + colorToOklch(color).l, 0) / fixed.length;\n}\n\n/** Detect the background a theme is designed for from the lightness of its own colors. */\nfunction detectAppearance(foregrounds: Color[], backgrounds: Color[]): ThemeAppearance | undefined {\n\tconst fg = averageLightness(foregrounds);\n\tconst bg = averageLightness(backgrounds);\n\tif (fg !== undefined && bg !== undefined) return bg < fg ? \"dark\" : \"light\";\n\tif (bg !== undefined) return bg < 0.5 ? \"dark\" : \"light\";\n\tif (fg !== undefined) return fg > 0.5 ? \"dark\" : \"light\";\n\treturn undefined;\n}\n\n// ============================================================================\n// Theme Class\n// ============================================================================\n\nexport class Theme {\n\treadonly name?: string;\n\treadonly sourcePath?: string;\n\tsourceInfo?: SourceInfo;\n\tprivate mode: TerminalColorMode;\n\t// Precomputed escape sequences keep fg()/bg() on the render hot path to a lookup and concat.\n\tprivate readonly fgAnsi = new Map<ThemeColor, string>();\n\tprivate readonly bgAnsi = new Map<ThemeBg, string>();\n\t// Tokens set to \"\" have no color of their own; `colors` fills them from the terminal defaults.\n\tprivate readonly concreteColors: Partial<Record<ThemeToken, Color>> = {};\n\tprivate readonly defaultForegroundTokens: ThemeToken[] = [];\n\tprivate readonly defaultBackgroundTokens: ThemeToken[] = [];\n\t// Foreground tokens rendered faint (SGR 2) on top of their color.\n\tprivate readonly dimTokens: ReadonlySet<ThemeColor>;\n\tprivate readonly ownAppearance: ThemeAppearance | undefined;\n\tprivate resolvedColors: { terminal: TerminalColors; colors: Readonly<Record<ThemeToken, Color>> } | undefined;\n\n\tconstructor(\n\t\tfgColors: Record<Exclude<ThemeColor, OptionalThemeColor>, string | number> &\n\t\t\tPartial<Record<OptionalThemeColor, string | number>>,\n\t\tbgColors: Record<Exclude<ThemeBg, OptionalThemeBg>, string | number> &\n\t\t\tPartial<Record<OptionalThemeBg, string | number>>,\n\t\tmode: TerminalColorMode,\n\t\toptions: {\n\t\t\tname?: string;\n\t\t\tsourcePath?: string;\n\t\t\tsourceInfo?: SourceInfo;\n\t\t\tappearance?: ThemeAppearance;\n\t\t\t/** Foreground tokens to render faint (SGR 2). */\n\t\t\tdim?: readonly ThemeColor[];\n\t\t} = {},\n\t) {\n\t\tthis.name = options.name;\n\t\tthis.sourcePath = options.sourcePath;\n\t\tthis.sourceInfo = options.sourceInfo;\n\t\tthis.mode = mode;\n\t\tthis.dimTokens = new Set(options.dim);\n\t\tconst foregrounds = {\n\t\t\t...fgColors,\n\t\t\tscrollbarTrack: fgColors.scrollbarTrack ?? fgColors.muted,\n\t\t\tscrollbarThumb: fgColors.scrollbarThumb ?? fgColors.text,\n\t\t\tthinkingMax: fgColors.thinkingMax ?? fgColors.thinkingXhigh,\n\t\t\tsearchMatchText: fgColors.searchMatchText ?? fgColors.text,\n\t\t};\n\t\tconst backgrounds = { ...bgColors, searchMatchBg: bgColors.searchMatchBg ?? bgColors.selectedBg };\n\t\tconst concreteForegrounds: Color[] = [];\n\t\tconst concreteBackgrounds: Color[] = [];\n\t\t// Returns the escape sequence for the token's own slot.\n\t\tconst addToken = (token: ThemeToken, value: string | number, isBackground: boolean): string => {\n\t\t\tif (value === \"\") {\n\t\t\t\t(isBackground ? this.defaultBackgroundTokens : this.defaultForegroundTokens).push(token);\n\t\t\t\treturn isBackground ? \"\\x1b[49m\" : \"\\x1b[39m\";\n\t\t\t}\n\t\t\tconst color = parseColor(value);\n\t\t\tthis.concreteColors[token] = color;\n\t\t\t(isBackground ? concreteBackgrounds : concreteForegrounds).push(color);\n\t\t\treturn isBackground ? backgroundAnsi(color, mode) : foregroundAnsi(color, mode);\n\t\t};\n\t\tfor (const [token, value] of Object.entries(foregrounds) as [ThemeColor, string | number][]) {\n\t\t\tthis.fgAnsi.set(token, addToken(token, value, false));\n\t\t}\n\t\tfor (const [token, value] of Object.entries(backgrounds) as [ThemeBg, string | number][]) {\n\t\t\tthis.bgAnsi.set(token, addToken(token, value, true));\n\t\t}\n\t\tthis.ownAppearance = options.appearance ?? detectAppearance(concreteForegrounds, concreteBackgrounds);\n\t}\n\n\t/**\n\t * The background the theme is designed for: declared in the theme JSON, detected from its colors,\n\t * or, for themes without usable colors, the terminal's appearance.\n\t */\n\tget appearance(): ThemeAppearance {\n\t\treturn this.ownAppearance ?? getTerminalTheme();\n\t}\n\n\t/**\n\t * Concrete colors for all tokens. Tokens set to \"\" (terminal default) use the terminal's reported\n\t * default colors, or a guess based on `appearance` when the terminal did not report them. Faint\n\t * tokens are approximated by mixing their color toward the background.\n\t */\n\tget colors(): Readonly<Record<ThemeToken, Color>> {\n\t\tconst terminal = terminalColors;\n\t\tif (this.resolvedColors?.terminal !== terminal) {\n\t\t\tconst guess = GUESSED_DEFAULT_COLORS[this.appearance];\n\t\t\tconst toColor = (rgb: RgbColor | undefined, fallback: Color) =>\n\t\t\t\trgb ? rgbColor(rgb.r, rgb.g, rgb.b) : fallback;\n\t\t\tconst foreground = toColor(terminal.foreground, guess.foreground);\n\t\t\tconst background = toColor(terminal.background, guess.background);\n\t\t\tconst colors = { ...this.concreteColors };\n\t\t\tfor (const token of this.defaultForegroundTokens) colors[token] = foreground;\n\t\t\tfor (const token of this.defaultBackgroundTokens) colors[token] = background;\n\t\t\tfor (const token of this.dimTokens) {\n\t\t\t\tconst color = colors[token];\n\t\t\t\tif (color) colors[token] = mixColors(color, background, 0.4);\n\t\t\t}\n\t\t\tthis.resolvedColors = { terminal, colors: Object.freeze(colors as Record<ThemeToken, Color>) };\n\t\t}\n\t\treturn this.resolvedColors.colors;\n\t}\n\n\tstyle(text: string, options: ThemeStyle): string {\n\t\tconst { fg, bg } = options;\n\t\tif (typeof fg === \"string\" && this.dimTokens.has(fg)) options = { ...options, dim: true };\n\t\treturn styleTextWithAnsi(\n\t\t\ttext,\n\t\t\tfg === undefined\n\t\t\t\t? undefined\n\t\t\t\t: typeof fg === \"string\"\n\t\t\t\t\t? this.tokenAnsi(this.fgAnsi, fg)\n\t\t\t\t\t: foregroundAnsi(fg, this.mode),\n\t\t\tbg === undefined\n\t\t\t\t? undefined\n\t\t\t\t: typeof bg === \"string\"\n\t\t\t\t\t? this.tokenAnsi(this.bgAnsi, bg)\n\t\t\t\t\t: backgroundAnsi(bg, this.mode),\n\t\t\toptions,\n\t\t);\n\t}\n\n\tfg(color: ThemeColor, text: string): string {\n\t\tconst ansi = this.tokenAnsi(this.fgAnsi, color);\n\t\tif (this.dimTokens.has(color)) return `${ansi}\\x1b[2m${text}\\x1b[22;39m`;\n\t\treturn `${ansi}${text}\\x1b[39m`;\n\t}\n\n\tbg(color: ThemeBg, text: string): string {\n\t\tconst ansi = this.tokenAnsi(this.bgAnsi, color);\n\t\treturn `${ansi}${text}\\x1b[49m`;\n\t}\n\n\tprivate tokenAnsi<T extends ThemeToken>(ansi: Map<T, string>, token: T): string {\n\t\tconst value = ansi.get(token);\n\t\tif (value === undefined) throw new Error(`Unknown theme color: ${token}`);\n\t\treturn value;\n\t}\n\n\tbold(text: string): string {\n\t\treturn chalk.bold(text);\n\t}\n\n\titalic(text: string): string {\n\t\treturn chalk.italic(text);\n\t}\n\n\tunderline(text: string): string {\n\t\treturn chalk.underline(text);\n\t}\n\n\tinverse(text: string): string {\n\t\treturn chalk.inverse(text);\n\t}\n\n\tstrikethrough(text: string): string {\n\t\treturn chalk.strikethrough(text);\n\t}\n\n\t/** Opening escape sequence for a foreground token. Faint tokens include SGR 2, which `\\x1b[22m` closes. */\n\tgetFgAnsi(color: ThemeColor): string {\n\t\tconst ansi = this.tokenAnsi(this.fgAnsi, color);\n\t\treturn this.dimTokens.has(color) ? `${ansi}\\x1b[2m` : ansi;\n\t}\n\n\tgetBgAnsi(color: ThemeBg): string {\n\t\treturn this.tokenAnsi(this.bgAnsi, color);\n\t}\n\n\tgetColorMode(): TerminalColorMode {\n\t\treturn this.mode;\n\t}\n\n\tgetThinkingBorderColor(level: ThinkingLevel): (str: string) => string {\n\t\t// Map thinking levels to dedicated theme colors\n\t\tswitch (level) {\n\t\t\tcase \"off\":\n\t\t\t\treturn (str: string) => this.fg(\"thinkingOff\", str);\n\t\t\tcase \"minimal\":\n\t\t\t\treturn (str: string) => this.fg(\"thinkingMinimal\", str);\n\t\t\tcase \"low\":\n\t\t\t\treturn (str: string) => this.fg(\"thinkingLow\", str);\n\t\t\tcase \"medium\":\n\t\t\t\treturn (str: string) => this.fg(\"thinkingMedium\", str);\n\t\t\tcase \"high\":\n\t\t\t\treturn (str: string) => this.fg(\"thinkingHigh\", str);\n\t\t\tcase \"xhigh\":\n\t\t\t\treturn (str: string) => this.fg(\"thinkingXhigh\", str);\n\t\t\tcase \"max\":\n\t\t\t\treturn (str: string) => this.fg(\"thinkingMax\", str);\n\t\t\tdefault:\n\t\t\t\treturn (str: string) => this.fg(\"thinkingOff\", str);\n\t\t}\n\t}\n\n\tgetBashModeBorderColor(): (str: string) => string {\n\t\treturn (str: string) => this.fg(\"bashMode\", str);\n\t}\n}\n\n// ============================================================================\n// Theme Loading\n// ============================================================================\n\nlet BUILTIN_THEMES: Record<string, ThemeJson> | undefined;\n\nfunction getBuiltinThemes(): Record<string, ThemeJson> {\n\tif (!BUILTIN_THEMES) {\n\t\tconst themesDir = getThemesDir();\n\t\tconst darkPath = path.join(themesDir, \"dark.json\");\n\t\tconst lightPath = path.join(themesDir, \"light.json\");\n\t\tBUILTIN_THEMES = {\n\t\t\tdark: JSON.parse(stripBom(fs.readFileSync(darkPath, \"utf-8\"))) as ThemeJson,\n\t\t\tlight: JSON.parse(stripBom(fs.readFileSync(lightPath, \"utf-8\"))) as ThemeJson,\n\t\t};\n\t}\n\treturn BUILTIN_THEMES;\n}\n\nexport function getAvailableThemes(): string[] {\n\treturn getAvailableThemesWithPaths().map(({ name }) => name);\n}\n\nexport interface ThemeInfo {\n\tname: string;\n\tpath: string | undefined;\n}\n\nexport function getAvailableThemesWithPaths(): ThemeInfo[] {\n\tconst themesDir = getThemesDir();\n\tconst result: ThemeInfo[] = [];\n\tconst seen = new Set<string>();\n\tconst addTheme = (themeInfo: ThemeInfo) => {\n\t\tif (seen.has(themeInfo.name)) {\n\t\t\treturn;\n\t\t}\n\t\tseen.add(themeInfo.name);\n\t\tresult.push(themeInfo);\n\t};\n\n\t// Built-in themes. The system theme is generated, so it has no file.\n\taddTheme({ name: SYSTEM_THEME_NAME, path: undefined });\n\tfor (const name of Object.keys(getBuiltinThemes())) {\n\t\taddTheme({ name, path: path.join(themesDir, `${name}.json`) });\n\t}\n\n\t// Custom themes\n\tfor (const themeInfo of getCustomThemeInfos()) {\n\t\taddTheme(themeInfo);\n\t}\n\n\tfor (const [name, theme] of registeredThemes.entries()) {\n\t\taddTheme({ name, path: theme.sourcePath });\n\t}\n\n\t// The system theme comes first: it is the default and adapts to every terminal.\n\treturn result.sort((a, b) =>\n\t\ta.name === SYSTEM_THEME_NAME ? -1 : b.name === SYSTEM_THEME_NAME ? 1 : a.name.localeCompare(b.name),\n\t);\n}\n\nfunction getCustomThemeInfos(): ThemeInfo[] {\n\tconst customThemesDir = getCustomThemesDir();\n\tconst result: ThemeInfo[] = [];\n\tif (!fs.existsSync(customThemesDir)) {\n\t\treturn result;\n\t}\n\n\tfor (const file of fs.readdirSync(customThemesDir)) {\n\t\tif (!file.endsWith(\".json\")) {\n\t\t\tcontinue;\n\t\t}\n\t\tconst themePath = path.join(customThemesDir, file);\n\t\ttry {\n\t\t\tconst customTheme = loadThemeFromPath(themePath);\n\t\t\tif (customTheme.name) {\n\t\t\t\tresult.push({ name: customTheme.name, path: themePath });\n\t\t\t}\n\t\t} catch {\n\t\t\t// Invalid themes are ignored here; the resource loader reports them\n\t\t\t// during normal startup/reload.\n\t\t}\n\t}\n\treturn result;\n}\n\nfunction assertThemeNameIsValid(name: string): void {\n\tif (name.includes(\"/\")) {\n\t\tthrow new Error(\n\t\t\t`Invalid theme name \"${name}\": theme names cannot contain \"/\" because it is reserved for automatic light/dark theme settings.`,\n\t\t);\n\t}\n}\n\nfunction parseThemeJson(label: string, json: unknown): ThemeJson {\n\tif (themeJsonValidator) return themeJsonValidator(label, json);\n\tif (typeof json !== \"object\" || json === null || !(\"colors\" in json)) {\n\t\tthrow new Error(`Invalid theme \"${label}\": expected an object with a \"colors\" map.`);\n\t}\n\treturn json as ThemeJson;\n}\n\nfunction parseThemeJsonContent(label: string, content: string): ThemeJson {\n\tlet json: unknown;\n\ttry {\n\t\tjson = JSON.parse(stripBom(content));\n\t} catch (error) {\n\t\tthrow new Error(`Failed to parse theme ${label}: ${error}`);\n\t}\n\treturn parseThemeJson(label, json);\n}\n\nfunction loadThemeJson(name: string): ThemeJson {\n\tconst builtinThemes = getBuiltinThemes();\n\tif (name in builtinThemes) {\n\t\treturn builtinThemes[name];\n\t}\n\tconst registeredTheme = registeredThemes.get(name);\n\tif (registeredTheme?.sourcePath) {\n\t\tconst content = fs.readFileSync(registeredTheme.sourcePath, \"utf-8\");\n\t\treturn parseThemeJsonContent(registeredTheme.sourcePath, content);\n\t}\n\tif (registeredTheme) {\n\t\tthrow new Error(`Theme \"${name}\" does not have a source path for export`);\n\t}\n\tconst customThemesDir = getCustomThemesDir();\n\tconst themePath = path.join(customThemesDir, `${name}.json`);\n\tif (!fs.existsSync(themePath)) {\n\t\tthrow new Error(`Theme not found: ${name}`);\n\t}\n\tconst content = fs.readFileSync(themePath, \"utf-8\");\n\treturn parseThemeJsonContent(name, content);\n}\n\nconst BACKGROUND_TOKENS: ReadonlySet<string> = new Set<ThemeBg>([\n\t\"selectedBg\",\n\t\"searchMatchBg\",\n\t\"userMessageBg\",\n\t\"customMessageBg\",\n\t\"toolPendingBg\",\n\t\"toolSuccessBg\",\n\t\"toolErrorBg\",\n]);\n\nfunction splitThemeColors(colors: Record<string, string | number>): {\n\tfgColors: Record<ThemeColor, string | number>;\n\tbgColors: Record<ThemeBg, string | number>;\n} {\n\tconst fgColors = {} as Record<ThemeColor, string | number>;\n\tconst bgColors = {} as Record<ThemeBg, string | number>;\n\tfor (const [key, value] of Object.entries(colors)) {\n\t\tif (BACKGROUND_TOKENS.has(key)) {\n\t\t\tbgColors[key as ThemeBg] = value;\n\t\t} else {\n\t\t\tfgColors[key as ThemeColor] = value;\n\t\t}\n\t}\n\treturn { fgColors, bgColors };\n}\n\nfunction createTheme(themeJson: ThemeJson, mode?: TerminalColorMode, sourcePath?: string): Theme {\n\tconst colorMode = mode ?? getTerminalColorMode();\n\tconst resolvedColors = resolveThemeColors(withThemeColorFallbacks(themeJson.colors), themeJson.vars);\n\tconst { fgColors, bgColors } = splitThemeColors(resolvedColors);\n\treturn new Theme(fgColors, bgColors, colorMode, {\n\t\tname: themeJson.name,\n\t\tsourcePath,\n\t\tappearance: themeJson.appearance,\n\t});\n}\n\n/** Generate the system theme from the terminal's reported colors (grayscale while they are pending). */\nfunction createSystemTheme(mode?: TerminalColorMode): Theme {\n\tconst generated = generateSystemThemeColors({\n\t\t...terminalColors,\n\t\tsaturation: terminalColorsPending ? 0 : 1,\n\t\tappearanceHint: getTerminalTheme(),\n\t});\n\tconst { fgColors, bgColors } = splitThemeColors(generated.colors);\n\treturn new Theme(fgColors, bgColors, mode ?? getTerminalColorMode(), {\n\t\tname: SYSTEM_THEME_NAME,\n\t\tappearance: generated.appearance,\n\t\tdim: generated.dim,\n\t});\n}\n\nexport function loadThemeFromPath(themePath: string, mode?: TerminalColorMode): Theme {\n\tconst content = fs.readFileSync(themePath, \"utf-8\");\n\tconst themeJson = parseThemeJsonContent(themePath, content);\n\treturn createTheme(themeJson, mode, themePath);\n}\n\nfunction loadTheme(name: string, mode?: TerminalColorMode): Theme {\n\t// The system theme name is reserved: it takes precedence over custom themes of the same name.\n\tif (name === SYSTEM_THEME_NAME) return createSystemTheme(mode);\n\tconst registeredTheme = registeredThemes.get(name);\n\tif (registeredTheme) {\n\t\treturn registeredTheme;\n\t}\n\tconst themeJson = loadThemeJson(name);\n\treturn createTheme(themeJson, mode);\n}\n\nexport function getThemeByName(name: string): Theme | undefined {\n\ttry {\n\t\treturn loadTheme(name);\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\nexport type TerminalTheme = \"dark\" | \"light\";\n\nexport function parseAutoThemeSetting(\n\tthemeSetting: string | undefined,\n): { lightTheme: string; darkTheme: string } | undefined {\n\tif (!themeSetting) return undefined;\n\tconst slashIndex = themeSetting.indexOf(\"/\");\n\tif (slashIndex === -1 || themeSetting.indexOf(\"/\", slashIndex + 1) !== -1) {\n\t\treturn undefined;\n\t}\n\n\tconst lightTheme = themeSetting.slice(0, slashIndex).trim();\n\tconst darkTheme = themeSetting.slice(slashIndex + 1).trim();\n\tif (!lightTheme || !darkTheme) {\n\t\treturn undefined;\n\t}\n\treturn { lightTheme, darkTheme };\n}\n\nexport function resolveThemeSetting(\n\tthemeSetting: string | undefined,\n\tterminalTheme: TerminalTheme,\n): string | undefined {\n\tconst autoTheme = parseAutoThemeSetting(themeSetting);\n\tif (autoTheme) {\n\t\treturn terminalTheme === \"light\" ? autoTheme.lightTheme : autoTheme.darkTheme;\n\t}\n\tif (themeSetting?.includes(\"/\")) return undefined;\n\tif (typeof themeSetting === \"string\") return themeSetting;\n\treturn undefined;\n}\n\n/**\n * Dark or light from the `COLORFGBG` environment variable some terminals set, or undefined without a\n * usable background index. The value is `fg;bg` or `fg;xpm;bg` (rxvt), where a field is an ANSI color\n * index or `default` when the color is not in the palette. The index refers to the terminal's own palette,\n * whose colors are unknown here, so it is classified by index like Vim does: 0-6 and 8 (bright black, e.g.\n * Solarized Dark's background) are dark, 7 and 9-15 are light.\n */\nexport function detectColorFgBgTheme(env: NodeJS.ProcessEnv = process.env): TerminalTheme | undefined {\n\tconst bg = env.COLORFGBG?.split(\";\").at(-1)?.trim();\n\tif (!bg || !/^\\d{1,2}$/.test(bg)) return undefined;\n\tconst index = Number(bg);\n\tif (index > 15) return undefined;\n\treturn index <= 6 || index === 8 ? \"dark\" : \"light\";\n}\n\n/**\n * Whether the terminal is dark or light. The background it renders decides, classified the same way the\n * system theme does. Without a reported background: the terminal's light/dark report, then COLORFGBG,\n * then dark.\n */\nexport function detectTerminalTheme(\n\tcolors: TerminalColors = {},\n\treportedScheme?: TerminalTheme,\n\tenv: NodeJS.ProcessEnv = process.env,\n): TerminalTheme {\n\tconst { background, foreground } = colors;\n\tif (background) return terminalAppearance(background, foreground);\n\treturn reportedScheme ?? detectColorFgBgTheme(env) ?? \"dark\";\n}\n\n/** Whether the terminal is dark or light, from everything it reported so far. See `detectTerminalTheme()`. */\nexport function getTerminalTheme(): TerminalTheme {\n\treturn detectTerminalTheme(terminalColors, terminalColorScheme);\n}\n\n// ============================================================================\n// Global Theme Instance\n// ============================================================================\n\n// Use globalThis to share theme across module loaders (node + jiti in dev mode)\nconst THEME_KEY = Symbol.for(\"@earendil-works/pi-coding-agent:theme\");\nconst THEME_KEY_OLD = Symbol.for(\"@mariozechner/pi-coding-agent:theme\");\n\n// Export theme as a getter that reads from globalThis\n// This ensures all module instances (node, jiti) see the same theme\nexport const theme: Theme = new Proxy({} as Theme, {\n\tget(_target, prop) {\n\t\tconst t = (globalThis as Record<symbol, Theme>)[THEME_KEY];\n\t\tif (!t) throw new Error(\"Theme not initialized. Call initTheme() first.\");\n\t\treturn (t as unknown as Record<string | symbol, unknown>)[prop];\n\t},\n});\n\nfunction setGlobalTheme(t: Theme): void {\n\t(globalThis as Record<symbol, Theme>)[THEME_KEY] = t;\n\t(globalThis as Record<symbol, Theme>)[THEME_KEY_OLD] = t;\n}\n\nlet currentThemeName: string | undefined;\nlet themeWatcher: fs.FSWatcher | undefined;\nlet themeReloadTimer: NodeJS.Timeout | undefined;\nlet onThemeChangeCallback: (() => void) | undefined;\nconst registeredThemes = new Map<string, Theme>();\n\nexport function setRegisteredThemes(themes: Theme[]): void {\n\tregisteredThemes.clear();\n\tfor (const theme of themes) {\n\t\tif (theme.name) {\n\t\t\tassertThemeNameIsValid(theme.name);\n\t\t\tregisteredThemes.set(theme.name, theme);\n\t\t}\n\t}\n}\n\nexport function initTheme(themeName?: string, enableWatcher: boolean = false): void {\n\tconst name = themeName ?? SYSTEM_THEME_NAME;\n\tcurrentThemeName = name;\n\ttry {\n\t\tsetGlobalTheme(loadTheme(name));\n\t\tif (enableWatcher) {\n\t\t\tstartThemeWatcher();\n\t\t}\n\t} catch (_error) {\n\t\t// Theme is invalid - fall back to the system theme silently\n\t\tcurrentThemeName = SYSTEM_THEME_NAME;\n\t\tsetGlobalTheme(loadTheme(SYSTEM_THEME_NAME));\n\t\t// Don't start watcher for fallback theme\n\t}\n}\n\nexport function setTheme(name: string, enableWatcher: boolean = false): { success: boolean; error?: string } {\n\tcurrentThemeName = name;\n\ttry {\n\t\tsetGlobalTheme(loadTheme(name));\n\t\tif (enableWatcher) {\n\t\t\tstartThemeWatcher();\n\t\t}\n\t\tif (onThemeChangeCallback) {\n\t\t\tonThemeChangeCallback();\n\t\t}\n\t\treturn { success: true };\n\t} catch (error) {\n\t\t// Theme is invalid - fall back to the system theme\n\t\tcurrentThemeName = SYSTEM_THEME_NAME;\n\t\tsetGlobalTheme(loadTheme(SYSTEM_THEME_NAME));\n\t\t// Don't start watcher for fallback theme\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\terror: error instanceof Error ? error.message : String(error),\n\t\t};\n\t}\n}\n\nexport function setThemeInstance(themeInstance: Theme): void {\n\tsetGlobalTheme(themeInstance);\n\tcurrentThemeName = \"<in-memory>\";\n\tstopThemeWatcher(); // Can't watch a direct instance\n\tif (onThemeChangeCallback) {\n\t\tonThemeChangeCallback();\n\t}\n}\n\nexport function onThemeChange(callback: () => void): void {\n\tonThemeChangeCallback = callback;\n}\n\nfunction startThemeWatcher(): void {\n\tstopThemeWatcher();\n\n\t// Only watch if it's a custom theme (not built-in)\n\tif (\n\t\t!currentThemeName ||\n\t\tcurrentThemeName === \"dark\" ||\n\t\tcurrentThemeName === \"light\" ||\n\t\tcurrentThemeName === SYSTEM_THEME_NAME\n\t) {\n\t\treturn;\n\t}\n\n\tconst customThemesDir = getCustomThemesDir();\n\tconst watchedThemeName = currentThemeName;\n\tconst watchedFileName = `${watchedThemeName}.json`;\n\tconst themeFile = path.join(customThemesDir, watchedFileName);\n\n\t// Only watch if the file exists\n\tif (!fs.existsSync(themeFile)) {\n\t\treturn;\n\t}\n\n\tconst scheduleReload = () => {\n\t\tif (themeReloadTimer) {\n\t\t\tclearTimeout(themeReloadTimer);\n\t\t}\n\t\tthemeReloadTimer = setTimeout(() => {\n\t\t\tthemeReloadTimer = undefined;\n\n\t\t\t// Ignore stale timers after switching themes or stopping the watcher\n\t\t\tif (currentThemeName !== watchedThemeName) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Keep the last successfully loaded theme active if the file is temporarily missing\n\t\t\tif (!fs.existsSync(themeFile)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\t// Reload the theme from disk and refresh the registry cache\n\t\t\t\tconst reloadedTheme = loadThemeFromPath(themeFile);\n\t\t\t\tregisteredThemes.set(watchedThemeName, reloadedTheme);\n\t\t\t\tsetGlobalTheme(reloadedTheme);\n\t\t\t\t// Notify callback (to invalidate UI)\n\t\t\t\tif (onThemeChangeCallback) {\n\t\t\t\t\tonThemeChangeCallback();\n\t\t\t\t}\n\t\t\t} catch (_error) {\n\t\t\t\t// Ignore errors (file might be in invalid state while being edited)\n\t\t\t}\n\t\t}, 100);\n\t};\n\n\tthemeWatcher =\n\t\twatchWithErrorHandler(\n\t\t\tcustomThemesDir,\n\t\t\t(_eventType, filename) => {\n\t\t\t\tif (currentThemeName !== watchedThemeName) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (!filename) {\n\t\t\t\t\tscheduleReload();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (filename !== watchedFileName) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tscheduleReload();\n\t\t\t},\n\t\t\t() => {\n\t\t\t\tcloseWatcher(themeWatcher);\n\t\t\t\tthemeWatcher = undefined;\n\t\t\t},\n\t\t) ?? undefined;\n}\n\nexport function stopThemeWatcher(): void {\n\tif (themeReloadTimer) {\n\t\tclearTimeout(themeReloadTimer);\n\t\tthemeReloadTimer = undefined;\n\t}\n\tcloseWatcher(themeWatcher);\n\tthemeWatcher = undefined;\n}\n\n// ============================================================================\n// HTML Export Helpers\n// ============================================================================\n\n/**\n * Get resolved theme colors as CSS-compatible hex strings.\n * Used by HTML export to generate CSS custom properties.\n */\nexport function getResolvedThemeColors(themeName?: string): Record<string, string> {\n\tconst colors = loadTheme(themeName ?? currentThemeName ?? SYSTEM_THEME_NAME).colors;\n\treturn Object.fromEntries(Object.entries(colors).map(([token, color]) => [token, colorToHex(color)]));\n}\n\n/**\n * Check if a theme is a \"light\" theme (for CSS that needs light/dark variants).\n */\nexport function isLightTheme(themeName?: string): boolean {\n\treturn loadTheme(themeName ?? currentThemeName ?? SYSTEM_THEME_NAME).appearance === \"light\";\n}\n\n/**\n * Get explicit export colors from theme JSON, if specified.\n * Returns undefined for each color that isn't explicitly set.\n */\nexport function getThemeExportColors(themeName?: string): {\n\tpageBg?: string;\n\tcardBg?: string;\n\tinfoBg?: string;\n} {\n\tconst name = themeName ?? currentThemeName ?? SYSTEM_THEME_NAME;\n\tif (name === SYSTEM_THEME_NAME) return {};\n\ttry {\n\t\tconst themeJson = loadThemeJson(name);\n\t\tconst exportSection = themeJson.export;\n\t\tif (!exportSection) return {};\n\n\t\tconst vars = themeJson.vars ?? {};\n\t\t// Export colors end up in CSS, which understands hex and oklch() values directly but not okhsl().\n\t\tconst resolve = (value: ColorValue | undefined): string | undefined => {\n\t\t\tif (value === undefined) return undefined;\n\t\t\tconst resolved = resolveVarRefs(value, vars);\n\t\t\tif (typeof resolved === \"number\") return colorToHex(indexedColor(resolved));\n\t\t\tif (resolved === \"\") return undefined;\n\t\t\tif (/^okhsl\\(/i.test(resolved)) return colorToHex(parseColor(resolved));\n\t\t\treturn resolved;\n\t\t};\n\n\t\treturn {\n\t\t\tpageBg: resolve(exportSection.pageBg),\n\t\t\tcardBg: resolve(exportSection.cardBg),\n\t\t\tinfoBg: resolve(exportSection.infoBg),\n\t\t};\n\t} catch {\n\t\treturn {};\n\t}\n}\n\n// ============================================================================\n// TUI Helpers\n// ============================================================================\n\ntype CliHighlightTheme = Record<string, (s: string) => string>;\n\nlet cachedHighlightThemeFor: Theme | undefined;\nlet cachedCliHighlightTheme: CliHighlightTheme | undefined;\n\nfunction buildCliHighlightTheme(t: Theme): CliHighlightTheme {\n\treturn {\n\t\tkeyword: (s: string) => t.fg(\"syntaxKeyword\", s),\n\t\tbuilt_in: (s: string) => t.fg(\"syntaxType\", s),\n\t\tliteral: (s: string) => t.fg(\"syntaxNumber\", s),\n\t\tnumber: (s: string) => t.fg(\"syntaxNumber\", s),\n\t\tregexp: (s: string) => t.fg(\"syntaxString\", s),\n\t\tstring: (s: string) => t.fg(\"syntaxString\", s),\n\t\tcomment: (s: string) => t.fg(\"syntaxComment\", s),\n\t\tdoctag: (s: string) => t.fg(\"syntaxComment\", s),\n\t\tmeta: (s: string) => t.fg(\"muted\", s),\n\t\tfunction: (s: string) => t.fg(\"syntaxFunction\", s),\n\t\ttitle: (s: string) => t.fg(\"syntaxFunction\", s),\n\t\tclass: (s: string) => t.fg(\"syntaxType\", s),\n\t\ttype: (s: string) => t.fg(\"syntaxType\", s),\n\t\ttag: (s: string) => t.fg(\"syntaxPunctuation\", s),\n\t\tname: (s: string) => t.fg(\"syntaxKeyword\", s),\n\t\tattr: (s: string) => t.fg(\"syntaxVariable\", s),\n\t\tvariable: (s: string) => t.fg(\"syntaxVariable\", s),\n\t\tparams: (s: string) => t.fg(\"syntaxVariable\", s),\n\t\toperator: (s: string) => t.fg(\"syntaxOperator\", s),\n\t\tpunctuation: (s: string) => t.fg(\"syntaxPunctuation\", s),\n\t\temphasis: (s: string) => t.italic(s),\n\t\tstrong: (s: string) => t.bold(s),\n\t\tlink: (s: string) => t.underline(s),\n\t\taddition: (s: string) => t.fg(\"toolDiffAdded\", s),\n\t\tdeletion: (s: string) => t.fg(\"toolDiffRemoved\", s),\n\t};\n}\n\nfunction getCliHighlightTheme(t: Theme): CliHighlightTheme {\n\tif (cachedHighlightThemeFor !== t || !cachedCliHighlightTheme) {\n\t\tcachedHighlightThemeFor = t;\n\t\tcachedCliHighlightTheme = buildCliHighlightTheme(t);\n\t}\n\treturn cachedCliHighlightTheme;\n}\n\n/**\n * Highlight code with syntax coloring based on file extension or language.\n * Returns array of highlighted lines.\n */\nexport function highlightCode(code: string, lang?: string): string[] {\n\t// Validate language before highlighting to avoid stderr spam from cli-highlight\n\tconst validLang = lang && supportsLanguage(lang) ? lang : undefined;\n\t// Skip highlighting when no valid language is specified. cli-highlight's\n\t// auto-detection is unreliable and can misidentify prose as AppleScript,\n\t// LiveCodeServer, etc., coloring random English words as keywords.\n\tif (!validLang) {\n\t\treturn code.split(\"\\n\").map((line) => theme.fg(\"mdCodeBlock\", line));\n\t}\n\tconst opts = {\n\t\tlanguage: validLang,\n\t\tignoreIllegals: true,\n\t\ttheme: getCliHighlightTheme(theme),\n\t};\n\ttry {\n\t\treturn highlight(code, opts).split(\"\\n\");\n\t} catch {\n\t\treturn code.split(\"\\n\");\n\t}\n}\n\n/**\n * Get language identifier from file path extension.\n */\nexport function getLanguageFromPath(filePath: string): string | undefined {\n\tconst ext = filePath.split(\".\").pop()?.toLowerCase();\n\tif (!ext) return undefined;\n\n\tconst extToLang: Record<string, string> = {\n\t\tts: \"typescript\",\n\t\ttsx: \"typescript\",\n\t\tjs: \"javascript\",\n\t\tjsx: \"javascript\",\n\t\tmjs: \"javascript\",\n\t\tcjs: \"javascript\",\n\t\tpy: \"python\",\n\t\trb: \"ruby\",\n\t\trs: \"rust\",\n\t\tgo: \"go\",\n\t\tjava: \"java\",\n\t\tkt: \"kotlin\",\n\t\tswift: \"swift\",\n\t\tc: \"c\",\n\t\th: \"c\",\n\t\tcpp: \"cpp\",\n\t\tcc: \"cpp\",\n\t\tcxx: \"cpp\",\n\t\thpp: \"cpp\",\n\t\tcs: \"csharp\",\n\t\tphp: \"php\",\n\t\tsh: \"bash\",\n\t\tbash: \"bash\",\n\t\tzsh: \"bash\",\n\t\tfish: \"fish\",\n\t\tps1: \"powershell\",\n\t\tsql: \"sql\",\n\t\thtml: \"html\",\n\t\thtm: \"html\",\n\t\tcss: \"css\",\n\t\tscss: \"scss\",\n\t\tsass: \"sass\",\n\t\tless: \"less\",\n\t\tjson: \"json\",\n\t\tyaml: \"yaml\",\n\t\tyml: \"yaml\",\n\t\ttoml: \"toml\",\n\t\txml: \"xml\",\n\t\tmd: \"markdown\",\n\t\tmarkdown: \"markdown\",\n\t\tdockerfile: \"dockerfile\",\n\t\tmakefile: \"makefile\",\n\t\tcmake: \"cmake\",\n\t\tlua: \"lua\",\n\t\tperl: \"perl\",\n\t\tr: \"r\",\n\t\tscala: \"scala\",\n\t\tclj: \"clojure\",\n\t\tex: \"elixir\",\n\t\texs: \"elixir\",\n\t\terl: \"erlang\",\n\t\ths: \"haskell\",\n\t\tml: \"ocaml\",\n\t\tvim: \"vim\",\n\t\tgraphql: \"graphql\",\n\t\tproto: \"protobuf\",\n\t\ttf: \"hcl\",\n\t\thcl: \"hcl\",\n\t};\n\n\treturn extToLang[ext];\n}\n\nexport function getMarkdownTheme(): MarkdownTheme {\n\treturn {\n\t\theading: (text: string) => theme.fg(\"mdHeading\", text),\n\t\tlink: (text: string) => theme.fg(\"mdLink\", text),\n\t\tlinkUrl: (text: string) => theme.fg(\"mdLinkUrl\", text),\n\t\tcode: (text: string) => theme.fg(\"mdCode\", text),\n\t\tcodeBlock: (text: string) => theme.fg(\"mdCodeBlock\", text),\n\t\tcodeBlockBorder: (text: string) => theme.fg(\"mdCodeBlockBorder\", text),\n\t\tquote: (text: string) => theme.fg(\"mdQuote\", text),\n\t\tquoteBorder: (text: string) => theme.fg(\"mdQuoteBorder\", text),\n\t\thr: (text: string) => theme.fg(\"mdHr\", text),\n\t\tlistBullet: (text: string) => theme.fg(\"mdListBullet\", text),\n\t\tbold: (text: string) => theme.bold(text),\n\t\titalic: (text: string) => theme.italic(text),\n\t\tunderline: (text: string) => theme.underline(text),\n\t\tstrikethrough: (text: string) => theme.strikethrough(text),\n\t\thighlightCode: (code: string, lang?: string): string[] => {\n\t\t\t// Validate language before highlighting to avoid stderr spam from cli-highlight\n\t\t\tconst validLang = lang && supportsLanguage(lang) ? lang : undefined;\n\t\t\t// Skip highlighting when no valid language is specified. cli-highlight's\n\t\t\t// auto-detection is unreliable and can misidentify prose as AppleScript,\n\t\t\t// LiveCodeServer, etc., coloring random English words as keywords.\n\t\t\tif (!validLang) {\n\t\t\t\treturn code.split(\"\\n\").map((line) => theme.fg(\"mdCodeBlock\", line));\n\t\t\t}\n\t\t\tconst opts = {\n\t\t\t\tlanguage: validLang,\n\t\t\t\tignoreIllegals: true,\n\t\t\t\ttheme: getCliHighlightTheme(theme),\n\t\t\t};\n\t\t\ttry {\n\t\t\t\treturn highlight(code, opts).split(\"\\n\");\n\t\t\t} catch {\n\t\t\t\treturn code.split(\"\\n\").map((line) => theme.fg(\"mdCodeBlock\", line));\n\t\t\t}\n\t\t},\n\t};\n}\n\nexport function getSelectListTheme(): SelectListTheme {\n\treturn {\n\t\tselectedPrefix: (text: string) => theme.fg(\"accent\", text),\n\t\tselectedText: (text: string) => theme.fg(\"accent\", text),\n\t\tdescription: (text: string) => theme.fg(\"muted\", text),\n\t\tscrollInfo: (text: string) => theme.fg(\"muted\", text),\n\t\tnoMatch: (text: string) => theme.fg(\"muted\", text),\n\t};\n}\n\nexport function getEditorTheme(): EditorTheme {\n\treturn {\n\t\tborderColor: (text: string) => theme.fg(\"borderMuted\", text),\n\t\tselectList: getSelectListTheme(),\n\t};\n}\n\nexport function getSettingsListTheme(): SettingsListTheme {\n\treturn {\n\t\tlabel: (text: string, selected: boolean) => (selected ? theme.fg(\"accent\", text) : text),\n\t\tvalue: (text: string, selected: boolean) => (selected ? theme.fg(\"accent\", text) : theme.fg(\"muted\", text)),\n\t\tdescription: (text: string) => theme.fg(\"dim\", text),\n\t\tcursor: theme.fg(\"accent\", \"→ \"),\n\t\thint: (text: string) => theme.fg(\"dim\", text),\n\t};\n}\n"]}
1
+ {"version":3,"file":"theme.js","sourceRoot":"","sources":["../../../../src/modes/interactive/theme/theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EACN,cAAc,EAEd,UAAU,EACV,YAAY,EAEZ,cAAc,EACd,oBAAoB,EACpB,YAAY,EAEZ,SAAS,EACT,UAAU,EAEV,QAAQ,EAGR,iBAAiB,GAIjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEtE,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACjF,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACrG,OAAO,EAEN,YAAY,GAKZ,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAuBtD,IAAI,kBAAkD,CAAC;AAEvD;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,SAA6B;IAClE,kBAAkB,GAAG,SAAS,CAAC;AAChC,CAAC;AAED,+EAA+E;AAC/E,kBAAkB;AAClB,+EAA+E;AAE/E,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D,OAAO,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC;KAClD,CAAC;AACH,CAAC;AAED,MAAM,UAAU,cAAc;IAC7B,OAAO;QACN,WAAW,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,aAAa,EAAE,IAAI,CAAC;QAC5D,UAAU,EAAE,kBAAkB,EAAE;KAChC,CAAC;AACH,CAAC;AAED,MAAM,UAAU,oBAAoB;IACnC,OAAO;QACN,KAAK,EAAE,CAAC,IAAY,EAAE,QAAiB,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACxF,KAAK,EAAE,CAAC,IAAY,EAAE,QAAiB,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAC3G,WAAW,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC;QACpD,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC;QAChC,IAAI,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC;KAC7C,CAAC;AACH,CAAC","sourcesContent":["import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport type { ThinkingLevel } from \"@earendil-works/pi-agent-core\";\nimport {\n\tbackgroundAnsi,\n\ttype Color,\n\tcolorToHex,\n\tcolorToOklch,\n\ttype EditorTheme,\n\tforegroundAnsi,\n\tgetTerminalColorMode,\n\tindexedColor,\n\ttype MarkdownTheme,\n\tmixColors,\n\tparseColor,\n\ttype RgbColor,\n\trgbColor,\n\ttype SelectListTheme,\n\ttype SettingsListTheme,\n\tstyleTextWithAnsi,\n\ttype TerminalColorMode,\n\ttype TerminalColors,\n\ttype TextAttributes,\n} from \"@earendil-works/pi-tui\";\nimport chalk from \"chalk\";\nimport { getCustomThemesDir, getThemesDir } from \"../../../config.ts\";\nimport type { SourceInfo } from \"../../../core/source-info.ts\";\nimport { closeWatcher, watchWithErrorHandler } from \"../../../utils/fs-watch.ts\";\nimport { highlight, supportsLanguage } from \"../../../utils/syntax-highlight.ts\";\nimport { stripBom } from \"../../../utils/text.ts\";\nimport { generateSystemThemeColors, SYSTEM_THEME_NAME, terminalAppearance } from \"./system-theme.ts\";\nimport {\n\ttype ResolvedThemeColorValues,\n\tTHEME_TOKENS,\n\ttype ThemeBg,\n\ttype ThemeColor,\n\ttype ThemeColorValues,\n\ttype ThemeToken,\n} from \"./theme-tokens.ts\";\n\nexport { SYSTEM_THEME_NAME } from \"./system-theme.ts\";\n\n// ============================================================================\n// Types & Schema\n// ============================================================================\n\n/** The schema that validates this shape lives in `theme-schema.ts`; importing the type is free. */\nimport type { ThemeColorValue as ColorValue, ValidatedThemeJson as ThemeJson } from \"./theme-schema.ts\";\n\nexport type { ValidatedThemeJson as ThemeJson } from \"./theme-schema.ts\";\nexport type { ThemeBg, ThemeColor, ThemeToken } from \"./theme-tokens.ts\";\n\n/**\n * Tokens are only accepted in their own slot, because \"\" (terminal default) means the default foreground\n * or background depending on the slot. Use `theme.colors[token]` to use a token's color in the other slot.\n */\nexport interface ThemeStyle extends TextAttributes {\n\tfg?: ThemeColor | Color;\n\tbg?: ThemeBg | Color;\n}\n\nexport type ThemeJsonValidator = (label: string, json: unknown) => ThemeJson;\n\nlet themeJsonValidator: ThemeJsonValidator | undefined;\n\n/**\n * Install full theme validation. Without it, documents are accepted as-is, which is what built-in\n * themes already do: validating user-authored JSON needs typebox, and a presentation that only uses\n * built-in themes should not pay ~17 MB of module graph for it.\n */\nexport function setThemeJsonValidator(validator: ThemeJsonValidator): void {\n\tthemeJsonValidator = validator;\n}\n\n// ============================================================================\n// Color Utilities\n// ============================================================================\n\nfunction resolveVarRefs(\n\tvalue: ColorValue,\n\tvars: Record<string, ColorValue>,\n\tvisited = new Set<string>(),\n): string | number {\n\tif (typeof value === \"number\" || value === \"\" || value.startsWith(\"#\") || /^ok(lch|hsl)\\(/i.test(value)) {\n\t\treturn value;\n\t}\n\tif (visited.has(value)) {\n\t\tthrow new Error(`Circular variable reference detected: ${value}`);\n\t}\n\tif (!(value in vars)) {\n\t\tthrow new Error(`Variable reference not found: ${value}`);\n\t}\n\tvisited.add(value);\n\treturn resolveVarRefs(vars[value], vars, visited);\n}\n\nfunction resolveThemeColors<T extends Record<string, ColorValue>>(\n\tcolors: T,\n\tvars: Record<string, ColorValue> = {},\n): Record<keyof T, string | number> {\n\tconst resolved: Record<string, string | number> = {};\n\tfor (const [key, value] of Object.entries(colors)) {\n\t\tresolved[key] = resolveVarRefs(value, vars);\n\t}\n\treturn resolved as Record<keyof T, string | number>;\n}\n\nfunction withThemeTokenFallbacks<Value>(values: ThemeColorValues<Value>): ResolvedThemeColorValues<Value> {\n\tconst resolved = { ...values } as Partial<ResolvedThemeColorValues<Value>>;\n\tfor (const [rawName, descriptor] of Object.entries(THEME_TOKENS)) {\n\t\tif (!(\"fallback\" in descriptor)) continue;\n\t\tconst name = rawName as ThemeToken;\n\t\tif (resolved[name] !== undefined) continue;\n\t\tconst fallback = descriptor.fallback as ThemeToken;\n\t\tconst fallbackValue = resolved[fallback];\n\t\tif (fallbackValue === undefined) {\n\t\t\tthrow new Error(`Theme token ${rawName} has unresolved fallback ${descriptor.fallback}`);\n\t\t}\n\t\tresolved[name] = fallbackValue;\n\t}\n\treturn resolved as ResolvedThemeColorValues<Value>;\n}\n\n// ============================================================================\n// Appearance & Terminal Default Colors\n// ============================================================================\n\n/** The background a theme is designed for. */\nexport type ThemeAppearance = TerminalTheme;\n\n// The terminal's reported colors. Replaced (never mutated) on update, so themes can cache resolved colors\n// by identity.\nlet terminalColors: TerminalColors = {};\n// While the terminal color query is in flight, the system theme renders in grayscale.\nlet terminalColorsPending = false;\n// The terminal's last light/dark report (mode 2031). Only used while it has not reported a background.\nlet terminalColorScheme: TerminalTheme | undefined;\n\n/**\n * Record the terminal's reported colors. Themes use the default colors for tokens set to \"\" (terminal\n * default); the system theme is generated from all of them. Ends the pending state.\n */\nexport function setTerminalColors(colors: TerminalColors): void {\n\tterminalColors = { ...colors };\n\tterminalColorsPending = false;\n}\n\n/** Record the terminal's light/dark report, the fallback for terminals that do not report their background. */\nexport function setTerminalColorScheme(scheme: TerminalTheme | undefined): void {\n\tterminalColorScheme = scheme;\n}\n\n/** Render the system theme in grayscale until `setTerminalColors()` reports the terminal's colors. */\nexport function markTerminalColorsPending(): void {\n\tterminalColorsPending = true;\n}\n\n/** Assumed terminal default colors when the terminal does not report them. */\nconst GUESSED_DEFAULT_COLORS: Record<ThemeAppearance, { foreground: Color; background: Color }> = {\n\tdark: { foreground: parseColor(\"#e5e5e7\"), background: parseColor(\"#000000\") },\n\tlight: { foreground: parseColor(\"#000000\"), background: parseColor(\"#ffffff\") },\n};\n\nfunction averageLightness(colors: Color[]): number | undefined {\n\t// Palette colors 0-15 follow the user's terminal palette, so they say nothing about the theme.\n\tconst fixed = colors.filter((color) => color.kind !== \"indexed\" || color.index >= 16);\n\tif (fixed.length === 0) return undefined;\n\treturn fixed.reduce((sum, color) => sum + colorToOklch(color).l, 0) / fixed.length;\n}\n\n/** Detect the background a theme is designed for from the lightness of its own colors. */\nfunction detectAppearance(foregrounds: Color[], backgrounds: Color[]): ThemeAppearance | undefined {\n\tconst fg = averageLightness(foregrounds);\n\tconst bg = averageLightness(backgrounds);\n\tif (fg !== undefined && bg !== undefined) return bg < fg ? \"dark\" : \"light\";\n\tif (bg !== undefined) return bg < 0.5 ? \"dark\" : \"light\";\n\tif (fg !== undefined) return fg > 0.5 ? \"dark\" : \"light\";\n\treturn undefined;\n}\n\n// ============================================================================\n// Theme Class\n// ============================================================================\n\nexport class Theme {\n\treadonly name?: string;\n\treadonly sourcePath?: string;\n\tsourceInfo?: SourceInfo;\n\tprivate mode: TerminalColorMode;\n\t// Precomputed escape sequences keep fg()/bg() on the render hot path to a lookup and concat.\n\tprivate readonly fgAnsi = new Map<ThemeColor, string>();\n\tprivate readonly bgAnsi = new Map<ThemeBg, string>();\n\t// Tokens set to \"\" have no color of their own; `colors` fills them from the terminal defaults.\n\tprivate readonly concreteColors: Partial<Record<ThemeToken, Color>> = {};\n\tprivate readonly defaultForegroundTokens: ThemeToken[] = [];\n\tprivate readonly defaultBackgroundTokens: ThemeToken[] = [];\n\t// Foreground tokens rendered faint (SGR 2) on top of their color.\n\tprivate readonly dimTokens: ReadonlySet<ThemeColor>;\n\tprivate readonly ownAppearance: ThemeAppearance | undefined;\n\tprivate resolvedColors: { terminal: TerminalColors; colors: Readonly<Record<ThemeToken, Color>> } | undefined;\n\n\tconstructor(\n\t\tfgColors: Pick<ThemeColorValues<string | number>, ThemeColor>,\n\t\tbgColors: Pick<ThemeColorValues<string | number>, ThemeBg>,\n\t\tmode: TerminalColorMode,\n\t\toptions: {\n\t\t\tname?: string;\n\t\t\tsourcePath?: string;\n\t\t\tsourceInfo?: SourceInfo;\n\t\t\tappearance?: ThemeAppearance;\n\t\t\t/** Foreground tokens to render faint (SGR 2). */\n\t\t\tdim?: readonly ThemeColor[];\n\t\t} = {},\n\t) {\n\t\tthis.name = options.name;\n\t\tthis.sourcePath = options.sourcePath;\n\t\tthis.sourceInfo = options.sourceInfo;\n\t\tthis.mode = mode;\n\t\tthis.dimTokens = new Set(options.dim);\n\t\tconst { fgColors: foregrounds, bgColors: backgrounds } = splitThemeColors(\n\t\t\twithThemeTokenFallbacks({ ...fgColors, ...bgColors }),\n\t\t);\n\t\tconst concreteForegrounds: Color[] = [];\n\t\tconst concreteBackgrounds: Color[] = [];\n\t\t// Returns the escape sequence for the token's own slot.\n\t\tconst addToken = (token: ThemeToken, value: string | number, isBackground: boolean): string => {\n\t\t\tif (value === \"\") {\n\t\t\t\t(isBackground ? this.defaultBackgroundTokens : this.defaultForegroundTokens).push(token);\n\t\t\t\treturn isBackground ? \"\\x1b[49m\" : \"\\x1b[39m\";\n\t\t\t}\n\t\t\tconst color = parseColor(value);\n\t\t\tthis.concreteColors[token] = color;\n\t\t\t(isBackground ? concreteBackgrounds : concreteForegrounds).push(color);\n\t\t\treturn isBackground ? backgroundAnsi(color, mode) : foregroundAnsi(color, mode);\n\t\t};\n\t\tfor (const [token, value] of Object.entries(foregrounds) as [ThemeColor, string | number][]) {\n\t\t\tthis.fgAnsi.set(token, addToken(token, value, false));\n\t\t}\n\t\tfor (const [token, value] of Object.entries(backgrounds) as [ThemeBg, string | number][]) {\n\t\t\tthis.bgAnsi.set(token, addToken(token, value, true));\n\t\t}\n\t\tthis.ownAppearance = options.appearance ?? detectAppearance(concreteForegrounds, concreteBackgrounds);\n\t}\n\n\t/**\n\t * The background the theme is designed for: declared in the theme JSON, detected from its colors,\n\t * or, for themes without usable colors, the terminal's appearance.\n\t */\n\tget appearance(): ThemeAppearance {\n\t\treturn this.ownAppearance ?? getTerminalTheme();\n\t}\n\n\t/**\n\t * Concrete colors for all tokens. Tokens set to \"\" (terminal default) use the terminal's reported\n\t * default colors, or a guess based on `appearance` when the terminal did not report them. Faint\n\t * tokens are approximated by mixing their color toward the background.\n\t */\n\tget colors(): Readonly<Record<ThemeToken, Color>> {\n\t\tconst terminal = terminalColors;\n\t\tif (this.resolvedColors?.terminal !== terminal) {\n\t\t\tconst guess = GUESSED_DEFAULT_COLORS[this.appearance];\n\t\t\tconst toColor = (rgb: RgbColor | undefined, fallback: Color) =>\n\t\t\t\trgb ? rgbColor(rgb.r, rgb.g, rgb.b) : fallback;\n\t\t\tconst foreground = toColor(terminal.foreground, guess.foreground);\n\t\t\tconst background = toColor(terminal.background, guess.background);\n\t\t\tconst colors = { ...this.concreteColors };\n\t\t\tfor (const token of this.defaultForegroundTokens) colors[token] = foreground;\n\t\t\tfor (const token of this.defaultBackgroundTokens) colors[token] = background;\n\t\t\tfor (const token of this.dimTokens) {\n\t\t\t\tconst color = colors[token];\n\t\t\t\tif (color) colors[token] = mixColors(color, background, 0.4);\n\t\t\t}\n\t\t\tthis.resolvedColors = { terminal, colors: Object.freeze(colors as Record<ThemeToken, Color>) };\n\t\t}\n\t\treturn this.resolvedColors.colors;\n\t}\n\n\tstyle(text: string, options: ThemeStyle): string {\n\t\tconst { fg, bg } = options;\n\t\tif (typeof fg === \"string\" && this.dimTokens.has(fg)) options = { ...options, dim: true };\n\t\treturn styleTextWithAnsi(\n\t\t\ttext,\n\t\t\tfg === undefined\n\t\t\t\t? undefined\n\t\t\t\t: typeof fg === \"string\"\n\t\t\t\t\t? this.tokenAnsi(this.fgAnsi, fg)\n\t\t\t\t\t: foregroundAnsi(fg, this.mode),\n\t\t\tbg === undefined\n\t\t\t\t? undefined\n\t\t\t\t: typeof bg === \"string\"\n\t\t\t\t\t? this.tokenAnsi(this.bgAnsi, bg)\n\t\t\t\t\t: backgroundAnsi(bg, this.mode),\n\t\t\toptions,\n\t\t);\n\t}\n\n\tfg(color: ThemeColor, text: string): string {\n\t\tconst ansi = this.tokenAnsi(this.fgAnsi, color);\n\t\tif (this.dimTokens.has(color)) return `${ansi}\\x1b[2m${text}\\x1b[22;39m`;\n\t\treturn `${ansi}${text}\\x1b[39m`;\n\t}\n\n\tbg(color: ThemeBg, text: string): string {\n\t\tconst ansi = this.tokenAnsi(this.bgAnsi, color);\n\t\treturn `${ansi}${text}\\x1b[49m`;\n\t}\n\n\tprivate tokenAnsi<T extends ThemeToken>(ansi: Map<T, string>, token: T): string {\n\t\tconst value = ansi.get(token);\n\t\tif (value === undefined) throw new Error(`Unknown theme color: ${token}`);\n\t\treturn value;\n\t}\n\n\tbold(text: string): string {\n\t\treturn chalk.bold(text);\n\t}\n\n\titalic(text: string): string {\n\t\treturn chalk.italic(text);\n\t}\n\n\tunderline(text: string): string {\n\t\treturn chalk.underline(text);\n\t}\n\n\tinverse(text: string): string {\n\t\treturn chalk.inverse(text);\n\t}\n\n\tstrikethrough(text: string): string {\n\t\treturn chalk.strikethrough(text);\n\t}\n\n\t/** Opening escape sequence for a foreground token. Faint tokens include SGR 2, which `\\x1b[22m` closes. */\n\tgetFgAnsi(color: ThemeColor): string {\n\t\tconst ansi = this.tokenAnsi(this.fgAnsi, color);\n\t\treturn this.dimTokens.has(color) ? `${ansi}\\x1b[2m` : ansi;\n\t}\n\n\tgetBgAnsi(color: ThemeBg): string {\n\t\treturn this.tokenAnsi(this.bgAnsi, color);\n\t}\n\n\tgetColorMode(): TerminalColorMode {\n\t\treturn this.mode;\n\t}\n\n\tgetThinkingBorderColor(level: ThinkingLevel): (str: string) => string {\n\t\t// Map thinking levels to dedicated theme colors\n\t\tswitch (level) {\n\t\t\tcase \"off\":\n\t\t\t\treturn (str: string) => this.fg(\"thinkingOff\", str);\n\t\t\tcase \"minimal\":\n\t\t\t\treturn (str: string) => this.fg(\"thinkingMinimal\", str);\n\t\t\tcase \"low\":\n\t\t\t\treturn (str: string) => this.fg(\"thinkingLow\", str);\n\t\t\tcase \"medium\":\n\t\t\t\treturn (str: string) => this.fg(\"thinkingMedium\", str);\n\t\t\tcase \"high\":\n\t\t\t\treturn (str: string) => this.fg(\"thinkingHigh\", str);\n\t\t\tcase \"xhigh\":\n\t\t\t\treturn (str: string) => this.fg(\"thinkingXhigh\", str);\n\t\t\tcase \"max\":\n\t\t\t\treturn (str: string) => this.fg(\"thinkingMax\", str);\n\t\t\tdefault:\n\t\t\t\treturn (str: string) => this.fg(\"thinkingOff\", str);\n\t\t}\n\t}\n\n\tgetBashModeBorderColor(): (str: string) => string {\n\t\treturn (str: string) => this.fg(\"bashMode\", str);\n\t}\n}\n\n// ============================================================================\n// Theme Loading\n// ============================================================================\n\nlet BUILTIN_THEMES: Record<string, ThemeJson> | undefined;\n\nfunction getBuiltinThemes(): Record<string, ThemeJson> {\n\tif (!BUILTIN_THEMES) {\n\t\tconst themesDir = getThemesDir();\n\t\tconst darkPath = path.join(themesDir, \"dark.json\");\n\t\tconst lightPath = path.join(themesDir, \"light.json\");\n\t\tBUILTIN_THEMES = {\n\t\t\tdark: JSON.parse(stripBom(fs.readFileSync(darkPath, \"utf-8\"))) as ThemeJson,\n\t\t\tlight: JSON.parse(stripBom(fs.readFileSync(lightPath, \"utf-8\"))) as ThemeJson,\n\t\t};\n\t}\n\treturn BUILTIN_THEMES;\n}\n\nexport function getAvailableThemes(): string[] {\n\treturn getAvailableThemesWithPaths().map(({ name }) => name);\n}\n\nexport interface ThemeInfo {\n\tname: string;\n\tpath: string | undefined;\n}\n\nexport function getAvailableThemesWithPaths(): ThemeInfo[] {\n\tconst themesDir = getThemesDir();\n\tconst result: ThemeInfo[] = [];\n\tconst seen = new Set<string>();\n\tconst addTheme = (themeInfo: ThemeInfo) => {\n\t\tif (seen.has(themeInfo.name)) {\n\t\t\treturn;\n\t\t}\n\t\tseen.add(themeInfo.name);\n\t\tresult.push(themeInfo);\n\t};\n\n\t// Built-in themes. The system theme is generated, so it has no file.\n\taddTheme({ name: SYSTEM_THEME_NAME, path: undefined });\n\tfor (const name of Object.keys(getBuiltinThemes())) {\n\t\taddTheme({ name, path: path.join(themesDir, `${name}.json`) });\n\t}\n\n\t// Custom themes\n\tfor (const themeInfo of getCustomThemeInfos()) {\n\t\taddTheme(themeInfo);\n\t}\n\n\tfor (const [name, theme] of registeredThemes.entries()) {\n\t\taddTheme({ name, path: theme.sourcePath });\n\t}\n\n\t// The system theme comes first: it is the default and adapts to every terminal.\n\treturn result.sort((a, b) =>\n\t\ta.name === SYSTEM_THEME_NAME ? -1 : b.name === SYSTEM_THEME_NAME ? 1 : a.name.localeCompare(b.name),\n\t);\n}\n\nfunction getCustomThemeInfos(): ThemeInfo[] {\n\tconst customThemesDir = getCustomThemesDir();\n\tconst result: ThemeInfo[] = [];\n\tif (!fs.existsSync(customThemesDir)) {\n\t\treturn result;\n\t}\n\n\tfor (const file of fs.readdirSync(customThemesDir)) {\n\t\tif (!file.endsWith(\".json\")) {\n\t\t\tcontinue;\n\t\t}\n\t\tconst themePath = path.join(customThemesDir, file);\n\t\ttry {\n\t\t\tconst customTheme = loadThemeFromPath(themePath);\n\t\t\tif (customTheme.name) {\n\t\t\t\tresult.push({ name: customTheme.name, path: themePath });\n\t\t\t}\n\t\t} catch {\n\t\t\t// Invalid themes are ignored here; the resource loader reports them\n\t\t\t// during normal startup/reload.\n\t\t}\n\t}\n\treturn result;\n}\n\nfunction assertThemeNameIsValid(name: string): void {\n\tif (name.includes(\"/\")) {\n\t\tthrow new Error(\n\t\t\t`Invalid theme name \"${name}\": theme names cannot contain \"/\" because it is reserved for automatic light/dark theme settings.`,\n\t\t);\n\t}\n}\n\nfunction parseThemeJson(label: string, json: unknown): ThemeJson {\n\tif (themeJsonValidator) return themeJsonValidator(label, json);\n\tif (typeof json !== \"object\" || json === null || !(\"colors\" in json)) {\n\t\tthrow new Error(`Invalid theme \"${label}\": expected an object with a \"colors\" map.`);\n\t}\n\treturn json as ThemeJson;\n}\n\nfunction parseThemeJsonContent(label: string, content: string): ThemeJson {\n\tlet json: unknown;\n\ttry {\n\t\tjson = JSON.parse(stripBom(content));\n\t} catch (error) {\n\t\tthrow new Error(`Failed to parse theme ${label}: ${error}`);\n\t}\n\treturn parseThemeJson(label, json);\n}\n\nfunction loadThemeJson(name: string): ThemeJson {\n\tconst builtinThemes = getBuiltinThemes();\n\tif (name in builtinThemes) {\n\t\treturn builtinThemes[name];\n\t}\n\tconst registeredTheme = registeredThemes.get(name);\n\tif (registeredTheme?.sourcePath) {\n\t\tconst content = fs.readFileSync(registeredTheme.sourcePath, \"utf-8\");\n\t\treturn parseThemeJsonContent(registeredTheme.sourcePath, content);\n\t}\n\tif (registeredTheme) {\n\t\tthrow new Error(`Theme \"${name}\" does not have a source path for export`);\n\t}\n\tconst customThemesDir = getCustomThemesDir();\n\tconst themePath = path.join(customThemesDir, `${name}.json`);\n\tif (!fs.existsSync(themePath)) {\n\t\tthrow new Error(`Theme not found: ${name}`);\n\t}\n\tconst content = fs.readFileSync(themePath, \"utf-8\");\n\treturn parseThemeJsonContent(name, content);\n}\n\nfunction splitThemeColors(colors: ResolvedThemeColorValues<string | number>): {\n\tfgColors: Record<ThemeColor, string | number>;\n\tbgColors: Record<ThemeBg, string | number>;\n} {\n\tconst fgColors = {} as Record<ThemeColor, string | number>;\n\tconst bgColors = {} as Record<ThemeBg, string | number>;\n\tfor (const [key, value] of Object.entries(colors)) {\n\t\tif (THEME_TOKENS[key as ThemeToken].slot === \"background\") {\n\t\t\tbgColors[key as ThemeBg] = value;\n\t\t} else {\n\t\t\tfgColors[key as ThemeColor] = value;\n\t\t}\n\t}\n\treturn { fgColors, bgColors };\n}\n\nfunction createTheme(themeJson: ThemeJson, mode?: TerminalColorMode, sourcePath?: string): Theme {\n\tconst colorMode = mode ?? getTerminalColorMode();\n\tconst resolvedColors = withThemeTokenFallbacks(resolveThemeColors(themeJson.colors, themeJson.vars));\n\tconst { fgColors, bgColors } = splitThemeColors(resolvedColors);\n\treturn new Theme(fgColors, bgColors, colorMode, {\n\t\tname: themeJson.name,\n\t\tsourcePath,\n\t\tappearance: themeJson.appearance,\n\t});\n}\n\n/** Generate the system theme from the terminal's reported colors (grayscale while they are pending). */\nfunction createSystemTheme(mode?: TerminalColorMode): Theme {\n\tconst generated = generateSystemThemeColors({\n\t\t...terminalColors,\n\t\tsaturation: terminalColorsPending ? 0 : 1,\n\t\tappearanceHint: getTerminalTheme(),\n\t});\n\tconst { fgColors, bgColors } = splitThemeColors(withThemeTokenFallbacks(generated.colors));\n\treturn new Theme(fgColors, bgColors, mode ?? getTerminalColorMode(), {\n\t\tname: SYSTEM_THEME_NAME,\n\t\tappearance: generated.appearance,\n\t\tdim: generated.dim,\n\t});\n}\n\nexport function loadThemeFromPath(themePath: string, mode?: TerminalColorMode): Theme {\n\tconst content = fs.readFileSync(themePath, \"utf-8\");\n\tconst themeJson = parseThemeJsonContent(themePath, content);\n\treturn createTheme(themeJson, mode, themePath);\n}\n\nfunction loadTheme(name: string, mode?: TerminalColorMode): Theme {\n\t// The system theme name is reserved: it takes precedence over custom themes of the same name.\n\tif (name === SYSTEM_THEME_NAME) return createSystemTheme(mode);\n\tconst registeredTheme = registeredThemes.get(name);\n\tif (registeredTheme) {\n\t\treturn registeredTheme;\n\t}\n\tconst themeJson = loadThemeJson(name);\n\treturn createTheme(themeJson, mode);\n}\n\nexport function getThemeByName(name: string): Theme | undefined {\n\ttry {\n\t\treturn loadTheme(name);\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\nexport type TerminalTheme = \"dark\" | \"light\";\n\nexport function parseAutoThemeSetting(\n\tthemeSetting: string | undefined,\n): { lightTheme: string; darkTheme: string } | undefined {\n\tif (!themeSetting) return undefined;\n\tconst slashIndex = themeSetting.indexOf(\"/\");\n\tif (slashIndex === -1 || themeSetting.indexOf(\"/\", slashIndex + 1) !== -1) {\n\t\treturn undefined;\n\t}\n\n\tconst lightTheme = themeSetting.slice(0, slashIndex).trim();\n\tconst darkTheme = themeSetting.slice(slashIndex + 1).trim();\n\tif (!lightTheme || !darkTheme) {\n\t\treturn undefined;\n\t}\n\treturn { lightTheme, darkTheme };\n}\n\nexport function resolveThemeSetting(\n\tthemeSetting: string | undefined,\n\tterminalTheme: TerminalTheme,\n): string | undefined {\n\tconst autoTheme = parseAutoThemeSetting(themeSetting);\n\tif (autoTheme) {\n\t\treturn terminalTheme === \"light\" ? autoTheme.lightTheme : autoTheme.darkTheme;\n\t}\n\tif (themeSetting?.includes(\"/\")) return undefined;\n\tif (typeof themeSetting === \"string\") return themeSetting;\n\treturn undefined;\n}\n\n/**\n * Dark or light from the `COLORFGBG` environment variable some terminals set, or undefined without a\n * usable background index. The value is `fg;bg` or `fg;xpm;bg` (rxvt), where a field is an ANSI color\n * index or `default` when the color is not in the palette. The index refers to the terminal's own palette,\n * whose colors are unknown here, so it is classified by index like Vim does: 0-6 and 8 (bright black, e.g.\n * Solarized Dark's background) are dark, 7 and 9-15 are light.\n */\nexport function detectColorFgBgTheme(env: NodeJS.ProcessEnv = process.env): TerminalTheme | undefined {\n\tconst bg = env.COLORFGBG?.split(\";\").at(-1)?.trim();\n\tif (!bg || !/^\\d{1,2}$/.test(bg)) return undefined;\n\tconst index = Number(bg);\n\tif (index > 15) return undefined;\n\treturn index <= 6 || index === 8 ? \"dark\" : \"light\";\n}\n\n/**\n * Whether the terminal is dark or light. The background it renders decides, classified the same way the\n * system theme does. Without a reported background: the terminal's light/dark report, then COLORFGBG,\n * then dark.\n */\nexport function detectTerminalTheme(\n\tcolors: TerminalColors = {},\n\treportedScheme?: TerminalTheme,\n\tenv: NodeJS.ProcessEnv = process.env,\n): TerminalTheme {\n\tconst { background, foreground } = colors;\n\tif (background) return terminalAppearance(background, foreground);\n\treturn reportedScheme ?? detectColorFgBgTheme(env) ?? \"dark\";\n}\n\n/** Whether the terminal is dark or light, from everything it reported so far. See `detectTerminalTheme()`. */\nexport function getTerminalTheme(): TerminalTheme {\n\treturn detectTerminalTheme(terminalColors, terminalColorScheme);\n}\n\n// ============================================================================\n// Global Theme Instance\n// ============================================================================\n\n// Use globalThis to share theme across module loaders (node + jiti in dev mode)\nconst THEME_KEY = Symbol.for(\"@earendil-works/pi-coding-agent:theme\");\nconst THEME_KEY_OLD = Symbol.for(\"@mariozechner/pi-coding-agent:theme\");\n\n// Export theme as a getter that reads from globalThis\n// This ensures all module instances (node, jiti) see the same theme\nexport const theme: Theme = new Proxy({} as Theme, {\n\tget(_target, prop) {\n\t\tconst t = (globalThis as Record<symbol, Theme>)[THEME_KEY];\n\t\tif (!t) throw new Error(\"Theme not initialized. Call initTheme() first.\");\n\t\treturn (t as unknown as Record<string | symbol, unknown>)[prop];\n\t},\n});\n\nfunction setGlobalTheme(t: Theme): void {\n\t(globalThis as Record<symbol, Theme>)[THEME_KEY] = t;\n\t(globalThis as Record<symbol, Theme>)[THEME_KEY_OLD] = t;\n}\n\nlet currentThemeName: string | undefined;\nlet themeWatcher: fs.FSWatcher | undefined;\nlet themeReloadTimer: NodeJS.Timeout | undefined;\nlet onThemeChangeCallback: (() => void) | undefined;\nconst registeredThemes = new Map<string, Theme>();\n\nexport function setRegisteredThemes(themes: Theme[]): void {\n\tregisteredThemes.clear();\n\tfor (const theme of themes) {\n\t\tif (theme.name) {\n\t\t\tassertThemeNameIsValid(theme.name);\n\t\t\tregisteredThemes.set(theme.name, theme);\n\t\t}\n\t}\n}\n\nexport function initTheme(themeName?: string, enableWatcher: boolean = false): void {\n\tconst name = themeName ?? SYSTEM_THEME_NAME;\n\tcurrentThemeName = name;\n\ttry {\n\t\tsetGlobalTheme(loadTheme(name));\n\t\tif (enableWatcher) {\n\t\t\tstartThemeWatcher();\n\t\t}\n\t} catch (_error) {\n\t\t// Theme is invalid - fall back to the system theme silently\n\t\tcurrentThemeName = SYSTEM_THEME_NAME;\n\t\tsetGlobalTheme(loadTheme(SYSTEM_THEME_NAME));\n\t\t// Don't start watcher for fallback theme\n\t}\n}\n\nexport function setTheme(name: string, enableWatcher: boolean = false): { success: boolean; error?: string } {\n\tcurrentThemeName = name;\n\ttry {\n\t\tsetGlobalTheme(loadTheme(name));\n\t\tif (enableWatcher) {\n\t\t\tstartThemeWatcher();\n\t\t}\n\t\tif (onThemeChangeCallback) {\n\t\t\tonThemeChangeCallback();\n\t\t}\n\t\treturn { success: true };\n\t} catch (error) {\n\t\t// Theme is invalid - fall back to the system theme\n\t\tcurrentThemeName = SYSTEM_THEME_NAME;\n\t\tsetGlobalTheme(loadTheme(SYSTEM_THEME_NAME));\n\t\t// Don't start watcher for fallback theme\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\terror: error instanceof Error ? error.message : String(error),\n\t\t};\n\t}\n}\n\nexport function setThemeInstance(themeInstance: Theme): void {\n\tsetGlobalTheme(themeInstance);\n\tcurrentThemeName = \"<in-memory>\";\n\tstopThemeWatcher(); // Can't watch a direct instance\n\tif (onThemeChangeCallback) {\n\t\tonThemeChangeCallback();\n\t}\n}\n\nexport function onThemeChange(callback: () => void): void {\n\tonThemeChangeCallback = callback;\n}\n\nfunction startThemeWatcher(): void {\n\tstopThemeWatcher();\n\n\t// Only watch if it's a custom theme (not built-in)\n\tif (\n\t\t!currentThemeName ||\n\t\tcurrentThemeName === \"dark\" ||\n\t\tcurrentThemeName === \"light\" ||\n\t\tcurrentThemeName === SYSTEM_THEME_NAME\n\t) {\n\t\treturn;\n\t}\n\n\tconst customThemesDir = getCustomThemesDir();\n\tconst watchedThemeName = currentThemeName;\n\tconst watchedFileName = `${watchedThemeName}.json`;\n\tconst themeFile = path.join(customThemesDir, watchedFileName);\n\n\t// Only watch if the file exists\n\tif (!fs.existsSync(themeFile)) {\n\t\treturn;\n\t}\n\n\tconst scheduleReload = () => {\n\t\tif (themeReloadTimer) {\n\t\t\tclearTimeout(themeReloadTimer);\n\t\t}\n\t\tthemeReloadTimer = setTimeout(() => {\n\t\t\tthemeReloadTimer = undefined;\n\n\t\t\t// Ignore stale timers after switching themes or stopping the watcher\n\t\t\tif (currentThemeName !== watchedThemeName) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Keep the last successfully loaded theme active if the file is temporarily missing\n\t\t\tif (!fs.existsSync(themeFile)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\t// Reload the theme from disk and refresh the registry cache\n\t\t\t\tconst reloadedTheme = loadThemeFromPath(themeFile);\n\t\t\t\tregisteredThemes.set(watchedThemeName, reloadedTheme);\n\t\t\t\tsetGlobalTheme(reloadedTheme);\n\t\t\t\t// Notify callback (to invalidate UI)\n\t\t\t\tif (onThemeChangeCallback) {\n\t\t\t\t\tonThemeChangeCallback();\n\t\t\t\t}\n\t\t\t} catch (_error) {\n\t\t\t\t// Ignore errors (file might be in invalid state while being edited)\n\t\t\t}\n\t\t}, 100);\n\t};\n\n\tthemeWatcher =\n\t\twatchWithErrorHandler(\n\t\t\tcustomThemesDir,\n\t\t\t(_eventType, filename) => {\n\t\t\t\tif (currentThemeName !== watchedThemeName) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (!filename) {\n\t\t\t\t\tscheduleReload();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (filename !== watchedFileName) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tscheduleReload();\n\t\t\t},\n\t\t\t() => {\n\t\t\t\tcloseWatcher(themeWatcher);\n\t\t\t\tthemeWatcher = undefined;\n\t\t\t},\n\t\t) ?? undefined;\n}\n\nexport function stopThemeWatcher(): void {\n\tif (themeReloadTimer) {\n\t\tclearTimeout(themeReloadTimer);\n\t\tthemeReloadTimer = undefined;\n\t}\n\tcloseWatcher(themeWatcher);\n\tthemeWatcher = undefined;\n}\n\n// ============================================================================\n// HTML Export Helpers\n// ============================================================================\n\n/**\n * Get resolved theme colors as CSS-compatible hex strings.\n * Used by HTML export to generate CSS custom properties.\n */\nexport function getResolvedThemeColors(themeName?: string): Record<string, string> {\n\tconst colors = loadTheme(themeName ?? currentThemeName ?? SYSTEM_THEME_NAME).colors;\n\treturn Object.fromEntries(Object.entries(colors).map(([token, color]) => [token, colorToHex(color)]));\n}\n\n/**\n * Check if a theme is a \"light\" theme (for CSS that needs light/dark variants).\n */\nexport function isLightTheme(themeName?: string): boolean {\n\treturn loadTheme(themeName ?? currentThemeName ?? SYSTEM_THEME_NAME).appearance === \"light\";\n}\n\n/**\n * Get explicit export colors from theme JSON, if specified.\n * Returns undefined for each color that isn't explicitly set.\n */\nexport function getThemeExportColors(themeName?: string): {\n\tpageBg?: string;\n\tcardBg?: string;\n\tinfoBg?: string;\n} {\n\tconst name = themeName ?? currentThemeName ?? SYSTEM_THEME_NAME;\n\tif (name === SYSTEM_THEME_NAME) return {};\n\ttry {\n\t\tconst themeJson = loadThemeJson(name);\n\t\tconst exportSection = themeJson.export;\n\t\tif (!exportSection) return {};\n\n\t\tconst vars = themeJson.vars ?? {};\n\t\t// Export colors end up in CSS, which understands hex and oklch() values directly but not okhsl().\n\t\tconst resolve = (value: ColorValue | undefined): string | undefined => {\n\t\t\tif (value === undefined) return undefined;\n\t\t\tconst resolved = resolveVarRefs(value, vars);\n\t\t\tif (typeof resolved === \"number\") return colorToHex(indexedColor(resolved));\n\t\t\tif (resolved === \"\") return undefined;\n\t\t\tif (/^okhsl\\(/i.test(resolved)) return colorToHex(parseColor(resolved));\n\t\t\treturn resolved;\n\t\t};\n\n\t\treturn {\n\t\t\tpageBg: resolve(exportSection.pageBg),\n\t\t\tcardBg: resolve(exportSection.cardBg),\n\t\t\tinfoBg: resolve(exportSection.infoBg),\n\t\t};\n\t} catch {\n\t\treturn {};\n\t}\n}\n\n// ============================================================================\n// TUI Helpers\n// ============================================================================\n\ntype CliHighlightTheme = Record<string, (s: string) => string>;\n\nlet cachedHighlightThemeFor: Theme | undefined;\nlet cachedCliHighlightTheme: CliHighlightTheme | undefined;\n\nfunction buildCliHighlightTheme(t: Theme): CliHighlightTheme {\n\treturn {\n\t\tkeyword: (s: string) => t.fg(\"syntaxKeyword\", s),\n\t\tbuilt_in: (s: string) => t.fg(\"syntaxType\", s),\n\t\tliteral: (s: string) => t.fg(\"syntaxNumber\", s),\n\t\tnumber: (s: string) => t.fg(\"syntaxNumber\", s),\n\t\tregexp: (s: string) => t.fg(\"syntaxString\", s),\n\t\tstring: (s: string) => t.fg(\"syntaxString\", s),\n\t\tsubst: (s: string) => t.fg(\"text\", s),\n\t\tcomment: (s: string) => t.fg(\"syntaxComment\", s),\n\t\tdoctag: (s: string) => t.fg(\"syntaxComment\", s),\n\t\tmeta: (s: string) => t.fg(\"muted\", s),\n\t\tfunction: (s: string) => t.fg(\"syntaxFunction\", s),\n\t\ttitle: (s: string) => t.fg(\"syntaxFunction\", s),\n\t\tclass: (s: string) => t.fg(\"syntaxType\", s),\n\t\ttype: (s: string) => t.fg(\"syntaxType\", s),\n\t\ttag: (s: string) => t.fg(\"syntaxPunctuation\", s),\n\t\tname: (s: string) => t.fg(\"syntaxKeyword\", s),\n\t\tattr: (s: string) => t.fg(\"syntaxVariable\", s),\n\t\tvariable: (s: string) => t.fg(\"syntaxVariable\", s),\n\t\tparams: (s: string) => t.fg(\"syntaxVariable\", s),\n\t\toperator: (s: string) => t.fg(\"syntaxOperator\", s),\n\t\tpunctuation: (s: string) => t.fg(\"syntaxPunctuation\", s),\n\t\temphasis: (s: string) => t.italic(s),\n\t\tstrong: (s: string) => t.bold(s),\n\t\tlink: (s: string) => t.underline(s),\n\t\taddition: (s: string) => t.fg(\"toolDiffAdded\", s),\n\t\tdeletion: (s: string) => t.fg(\"toolDiffRemoved\", s),\n\t};\n}\n\nfunction getCliHighlightTheme(t: Theme): CliHighlightTheme {\n\tif (cachedHighlightThemeFor !== t || !cachedCliHighlightTheme) {\n\t\tcachedHighlightThemeFor = t;\n\t\tcachedCliHighlightTheme = buildCliHighlightTheme(t);\n\t}\n\treturn cachedCliHighlightTheme;\n}\n\n/**\n * Highlight code with syntax coloring based on file extension or language.\n * Returns array of highlighted lines.\n */\nexport function highlightCode(code: string, lang?: string): string[] {\n\t// Validate language before highlighting to avoid stderr spam from cli-highlight\n\tconst validLang = lang && supportsLanguage(lang) ? lang : undefined;\n\t// Skip highlighting when no valid language is specified. cli-highlight's\n\t// auto-detection is unreliable and can misidentify prose as AppleScript,\n\t// LiveCodeServer, etc., coloring random English words as keywords.\n\tif (!validLang) {\n\t\treturn code.split(\"\\n\").map((line) => theme.fg(\"mdCodeBlock\", line));\n\t}\n\tconst opts = {\n\t\tlanguage: validLang,\n\t\tignoreIllegals: true,\n\t\ttheme: getCliHighlightTheme(theme),\n\t};\n\ttry {\n\t\treturn highlight(code, opts).split(\"\\n\");\n\t} catch {\n\t\treturn code.split(\"\\n\");\n\t}\n}\n\n/**\n * Get language identifier from file path extension.\n */\nexport function getLanguageFromPath(filePath: string): string | undefined {\n\tconst ext = filePath.split(\".\").pop()?.toLowerCase();\n\tif (!ext) return undefined;\n\n\tconst extToLang: Record<string, string> = {\n\t\tts: \"typescript\",\n\t\ttsx: \"typescript\",\n\t\tjs: \"javascript\",\n\t\tjsx: \"javascript\",\n\t\tmjs: \"javascript\",\n\t\tcjs: \"javascript\",\n\t\tpy: \"python\",\n\t\trb: \"ruby\",\n\t\trs: \"rust\",\n\t\tgo: \"go\",\n\t\tjava: \"java\",\n\t\tkt: \"kotlin\",\n\t\tswift: \"swift\",\n\t\tc: \"c\",\n\t\th: \"c\",\n\t\tcpp: \"cpp\",\n\t\tcc: \"cpp\",\n\t\tcxx: \"cpp\",\n\t\thpp: \"cpp\",\n\t\tcs: \"csharp\",\n\t\tphp: \"php\",\n\t\tsh: \"bash\",\n\t\tbash: \"bash\",\n\t\tzsh: \"bash\",\n\t\tfish: \"fish\",\n\t\tps1: \"powershell\",\n\t\tsql: \"sql\",\n\t\thtml: \"html\",\n\t\thtm: \"html\",\n\t\tcss: \"css\",\n\t\tscss: \"scss\",\n\t\tsass: \"sass\",\n\t\tless: \"less\",\n\t\tjson: \"json\",\n\t\tyaml: \"yaml\",\n\t\tyml: \"yaml\",\n\t\ttoml: \"toml\",\n\t\txml: \"xml\",\n\t\tmd: \"markdown\",\n\t\tmarkdown: \"markdown\",\n\t\tdockerfile: \"dockerfile\",\n\t\tmakefile: \"makefile\",\n\t\tcmake: \"cmake\",\n\t\tlua: \"lua\",\n\t\tperl: \"perl\",\n\t\tr: \"r\",\n\t\tscala: \"scala\",\n\t\tclj: \"clojure\",\n\t\tex: \"elixir\",\n\t\texs: \"elixir\",\n\t\terl: \"erlang\",\n\t\ths: \"haskell\",\n\t\tml: \"ocaml\",\n\t\tvim: \"vim\",\n\t\tgraphql: \"graphql\",\n\t\tproto: \"protobuf\",\n\t\ttf: \"hcl\",\n\t\thcl: \"hcl\",\n\t};\n\n\treturn extToLang[ext];\n}\n\nexport function getMarkdownTheme(): MarkdownTheme {\n\treturn {\n\t\theading: (text: string) => theme.fg(\"mdHeading\", text),\n\t\tlink: (text: string) => theme.fg(\"mdLink\", text),\n\t\tlinkUrl: (text: string) => theme.fg(\"mdLinkUrl\", text),\n\t\tcode: (text: string) => theme.fg(\"mdCode\", text),\n\t\tcodeBlock: (text: string) => theme.fg(\"mdCodeBlock\", text),\n\t\tcodeBlockBorder: (text: string) => theme.fg(\"mdCodeBlockBorder\", text),\n\t\tquote: (text: string) => theme.fg(\"mdQuote\", text),\n\t\tquoteBorder: (text: string) => theme.fg(\"mdQuoteBorder\", text),\n\t\thr: (text: string) => theme.fg(\"mdHr\", text),\n\t\tlistBullet: (text: string) => theme.fg(\"mdListBullet\", text),\n\t\tbold: (text: string) => theme.bold(text),\n\t\titalic: (text: string) => theme.italic(text),\n\t\tunderline: (text: string) => theme.underline(text),\n\t\tstrikethrough: (text: string) => theme.strikethrough(text),\n\t\thighlightCode: (code: string, lang?: string): string[] => {\n\t\t\t// Validate language before highlighting to avoid stderr spam from cli-highlight\n\t\t\tconst validLang = lang && supportsLanguage(lang) ? lang : undefined;\n\t\t\t// Skip highlighting when no valid language is specified. cli-highlight's\n\t\t\t// auto-detection is unreliable and can misidentify prose as AppleScript,\n\t\t\t// LiveCodeServer, etc., coloring random English words as keywords.\n\t\t\tif (!validLang) {\n\t\t\t\treturn code.split(\"\\n\").map((line) => theme.fg(\"mdCodeBlock\", line));\n\t\t\t}\n\t\t\tconst opts = {\n\t\t\t\tlanguage: validLang,\n\t\t\t\tignoreIllegals: true,\n\t\t\t\ttheme: getCliHighlightTheme(theme),\n\t\t\t};\n\t\t\ttry {\n\t\t\t\treturn highlight(code, opts).split(\"\\n\");\n\t\t\t} catch {\n\t\t\t\treturn code.split(\"\\n\").map((line) => theme.fg(\"mdCodeBlock\", line));\n\t\t\t}\n\t\t},\n\t};\n}\n\nexport function getSelectListTheme(): SelectListTheme {\n\treturn {\n\t\tselectedPrefix: (text: string) => theme.fg(\"accent\", text),\n\t\tselectedText: (text: string) => theme.fg(\"accent\", text),\n\t\tdescription: (text: string) => theme.fg(\"muted\", text),\n\t\tscrollInfo: (text: string) => theme.fg(\"muted\", text),\n\t\tnoMatch: (text: string) => theme.fg(\"muted\", text),\n\t};\n}\n\nexport function getEditorTheme(): EditorTheme {\n\treturn {\n\t\tborderColor: (text: string) => theme.fg(\"borderMuted\", text),\n\t\tselectList: getSelectListTheme(),\n\t};\n}\n\nexport function getSettingsListTheme(): SettingsListTheme {\n\treturn {\n\t\tlabel: (text: string, selected: boolean) => (selected ? theme.fg(\"accent\", text) : text),\n\t\tvalue: (text: string, selected: boolean) => (selected ? theme.fg(\"accent\", text) : theme.fg(\"muted\", text)),\n\t\tdescription: (text: string) => theme.fg(\"dim\", text),\n\t\tcursor: theme.fg(\"accent\", \"→ \"),\n\t\thint: (text: string) => theme.fg(\"dim\", text),\n\t};\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"print-mode.d.ts","sourceRoot":"","sources":["../../src/modes/print-mode.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAoB,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAK5E;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC,yEAAyE;IACzE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,wDAAwD;IACxD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,8CAA8C;IAC9C,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;CAC/B;AAED;;;GAGG;AACH,wBAAsB,YAAY,CAAC,WAAW,EAAE,mBAAmB,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,CAwI/G"}
1
+ {"version":3,"file":"print-mode.d.ts","sourceRoot":"","sources":["../../src/modes/print-mode.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAoB,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAK5E;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC,yEAAyE;IACzE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,wDAAwD;IACxD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,8CAA8C;IAC9C,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;CAC/B;AAED;;;GAGG;AACH,wBAAsB,YAAY,CAAC,WAAW,EAAE,mBAAmB,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,CA4I/G"}
@@ -122,6 +122,10 @@ export async function runPrintMode(runtimeHost, options) {
122
122
  writeRawStdout(`${content.text}\n`);
123
123
  }
124
124
  }
125
+ if (assistantMsg.stopReason === "length") {
126
+ console.error("Response was truncated: the model reached its output token limit.");
127
+ exitCode = 1;
128
+ }
125
129
  }
126
130
  }
127
131
  }
@@ -1 +1 @@
1
- {"version":3,"file":"print-mode.js","sourceRoot":"","sources":["../../src/modes/print-mode.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,cAAc,EAAE,4BAA4B,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACvG,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAgB9C;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,WAAgC,EAAE,OAAyB;IAC7F,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,EAAE,EAAE,cAAc,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC;IACvE,IAAI,QAAQ,GAAG,CAAC,CAAC;IACjB,IAAI,OAAO,GAAG,WAAW,CAAC,OAAO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used for:\n * - `pi -p \"prompt\"` - text output\n * - `pi --mode json \"prompt\"` - JSON event stream\n */\n\nimport type { AssistantMessage, ImageContent } from \"@earendil-works/pi-ai\";\nimport type { AgentSessionRuntime } from \"../core/agent-session-runtime.ts\";\nimport { flushRawStdout, waitForRawStdoutBackpressure, writeRawStdout } from \"../core/output-guard.ts\";\nimport { killTrackedDetachedChildren } from \"../utils/shell.ts\";\nimport { toJsonEvent } from \"./json-event.ts\";\n\n/**\n * Options for print mode.\n */\nexport interface PrintModeOptions {\n\t/** Output mode: \"text\" for final response only, \"json\" for all events */\n\tmode: \"text\" | \"json\";\n\t/** Array of additional prompts to send after initialMessage */\n\tmessages?: string[];\n\t/** First message to send (may contain @file content) */\n\tinitialMessage?: string;\n\t/** Images to attach to the initial message */\n\tinitialImages?: ImageContent[];\n}\n\n/**\n * Run in print (single-shot) mode.\n * Sends prompts to the agent and outputs the result.\n */\nexport async function runPrintMode(runtimeHost: AgentSessionRuntime, options: PrintModeOptions): Promise<number> {\n\tconst { mode, messages = [], initialMessage, initialImages } = options;\n\tlet exitCode = 0;\n\tlet session = runtimeHost.session;\n\tlet unsubscribe: (() => void) | undefined;\n\tlet unsubscribeBackpressure: (() => void) | undefined;\n\tlet disposed = false;\n\tconst signalCleanupHandlers: Array<() => void> = [];\n\n\tconst disposeRuntime = async (): Promise<void> => {\n\t\tif (disposed) return;\n\t\tdisposed = true;\n\t\tunsubscribe?.();\n\t\tunsubscribeBackpressure?.();\n\t\tawait runtimeHost.dispose();\n\t};\n\n\tconst registerSignalHandlers = (): void => {\n\t\tconst signals: NodeJS.Signals[] = [\"SIGTERM\"];\n\t\tif (process.platform !== \"win32\") {\n\t\t\tsignals.push(\"SIGHUP\");\n\t\t}\n\n\t\tfor (const signal of signals) {\n\t\t\tconst handler = () => {\n\t\t\t\tkillTrackedDetachedChildren();\n\t\t\t\tvoid disposeRuntime().finally(() => {\n\t\t\t\t\tprocess.exit(signal === \"SIGHUP\" ? 129 : 143);\n\t\t\t\t});\n\t\t\t};\n\t\t\tprocess.on(signal, handler);\n\t\t\tsignalCleanupHandlers.push(() => process.off(signal, handler));\n\t\t}\n\t};\n\n\tregisterSignalHandlers();\n\n\truntimeHost.setRebindSession(async () => {\n\t\tawait rebindSession();\n\t});\n\n\tconst rebindSession = async (): Promise<void> => {\n\t\tsession = runtimeHost.session;\n\t\tawait session.bindExtensions({\n\t\t\tmode: mode === \"json\" ? \"json\" : \"print\",\n\t\t\tcommandContextActions: {\n\t\t\t\twaitForIdle: () => session.waitForIdle(),\n\t\t\t\tnewSession: async (newSessionOptions) => runtimeHost.newSession(newSessionOptions),\n\t\t\t\tfork: async (entryId, forkOptions) => {\n\t\t\t\t\tconst result = await runtimeHost.fork(entryId, forkOptions);\n\t\t\t\t\treturn { cancelled: result.cancelled };\n\t\t\t\t},\n\t\t\t\tnavigateTree: async (targetId, navigateOptions) => {\n\t\t\t\t\tconst result = await session.navigateTree(targetId, {\n\t\t\t\t\t\tsummarize: navigateOptions?.summarize,\n\t\t\t\t\t\tcustomInstructions: navigateOptions?.customInstructions,\n\t\t\t\t\t\treplaceInstructions: navigateOptions?.replaceInstructions,\n\t\t\t\t\t\tlabel: navigateOptions?.label,\n\t\t\t\t\t});\n\t\t\t\t\treturn { cancelled: result.cancelled };\n\t\t\t\t},\n\t\t\t\tswitchSession: async (sessionPath, switchOptions) => {\n\t\t\t\t\treturn runtimeHost.switchSession(sessionPath, switchOptions);\n\t\t\t\t},\n\t\t\t\treload: async () => {\n\t\t\t\t\tawait session.reload();\n\t\t\t\t},\n\t\t\t},\n\t\t\tonError: (err) => {\n\t\t\t\tconsole.error(`Extension error (${err.extensionPath}): ${err.error}`);\n\t\t\t},\n\t\t});\n\n\t\tunsubscribe?.();\n\t\tunsubscribeBackpressure?.();\n\t\tunsubscribe = session.subscribe((event) => {\n\t\t\tif (mode === \"json\") {\n\t\t\t\twriteRawStdout(`${JSON.stringify(toJsonEvent(event))}\\n`);\n\t\t\t}\n\t\t});\n\t\tunsubscribeBackpressure =\n\t\t\tmode === \"json\"\n\t\t\t\t? session.agent.subscribe(async () => {\n\t\t\t\t\t\tawait waitForRawStdoutBackpressure();\n\t\t\t\t\t})\n\t\t\t\t: undefined;\n\t};\n\n\ttry {\n\t\tif (mode === \"json\") {\n\t\t\tconst header = session.sessionManager.getHeader();\n\t\t\tif (header) {\n\t\t\t\twriteRawStdout(`${JSON.stringify(header)}\\n`);\n\t\t\t}\n\t\t}\n\n\t\tawait rebindSession();\n\n\t\tif (initialMessage) {\n\t\t\tawait session.prompt(initialMessage, { images: initialImages });\n\t\t}\n\n\t\tfor (const message of messages) {\n\t\t\tawait session.prompt(message);\n\t\t}\n\n\t\tif (mode === \"text\") {\n\t\t\tconst state = session.state;\n\t\t\tconst lastMessage = state.messages[state.messages.length - 1];\n\n\t\t\tif (lastMessage?.role === \"assistant\") {\n\t\t\t\tconst assistantMsg = lastMessage as AssistantMessage;\n\t\t\t\tif (assistantMsg.stopReason === \"error\" || assistantMsg.stopReason === \"aborted\") {\n\t\t\t\t\tconsole.error(assistantMsg.errorMessage || `Request ${assistantMsg.stopReason}`);\n\t\t\t\t\texitCode = 1;\n\t\t\t\t} else {\n\t\t\t\t\tfor (const content of assistantMsg.content) {\n\t\t\t\t\t\tif (content.type === \"text\") {\n\t\t\t\t\t\t\twriteRawStdout(`${content.text}\\n`);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn exitCode;\n\t} catch (error: unknown) {\n\t\tconsole.error(error instanceof Error ? error.message : String(error));\n\t\treturn 1;\n\t} finally {\n\t\tfor (const cleanup of signalCleanupHandlers) {\n\t\t\tcleanup();\n\t\t}\n\t\tawait disposeRuntime();\n\t\tawait flushRawStdout();\n\t}\n}\n"]}
1
+ {"version":3,"file":"print-mode.js","sourceRoot":"","sources":["../../src/modes/print-mode.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,cAAc,EAAE,4BA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,CAAC;wBACnF,QAAQ,GAAG,CAAC,CAAC;oBACd,CAAC;gBACF,CAAC;YACF,CAAC;QACF,CAAC;QAED,OAAO,QAAQ,CAAC;IACjB,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACzB,OAAO,CAAC,KAAK,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACtE,OAAO,CAAC,CAAC;IACV,CAAC;YAAS,CAAC;QACV,KAAK,MAAM,OAAO,IAAI,qBAAqB,EAAE,CAAC;YAC7C,OAAO,EAAE,CAAC;QACX,CAAC;QACD,MAAM,cAAc,EAAE,CAAC;QACvB,MAAM,cAAc,EAAE,CAAC;IACxB,CAAC;AACF,CAAC","sourcesContent":["/**\n * Print mode (single-shot): Send prompts, output result, exit.\n *\n * Used for:\n * - `pi -p \"prompt\"` - text output\n * - `pi --mode json \"prompt\"` - JSON event stream\n */\n\nimport type { AssistantMessage, ImageContent } from \"@earendil-works/pi-ai\";\nimport type { AgentSessionRuntime } from \"../core/agent-session-runtime.ts\";\nimport { flushRawStdout, waitForRawStdoutBackpressure, writeRawStdout } from \"../core/output-guard.ts\";\nimport { killTrackedDetachedChildren } from \"../utils/shell.ts\";\nimport { toJsonEvent } from \"./json-event.ts\";\n\n/**\n * Options for print mode.\n */\nexport interface PrintModeOptions {\n\t/** Output mode: \"text\" for final response only, \"json\" for all events */\n\tmode: \"text\" | \"json\";\n\t/** Array of additional prompts to send after initialMessage */\n\tmessages?: string[];\n\t/** First message to send (may contain @file content) */\n\tinitialMessage?: string;\n\t/** Images to attach to the initial message */\n\tinitialImages?: ImageContent[];\n}\n\n/**\n * Run in print (single-shot) mode.\n * Sends prompts to the agent and outputs the result.\n */\nexport async function runPrintMode(runtimeHost: AgentSessionRuntime, options: PrintModeOptions): Promise<number> {\n\tconst { mode, messages = [], initialMessage, initialImages } = options;\n\tlet exitCode = 0;\n\tlet session = runtimeHost.session;\n\tlet unsubscribe: (() => void) | undefined;\n\tlet unsubscribeBackpressure: (() => void) | undefined;\n\tlet disposed = false;\n\tconst signalCleanupHandlers: Array<() => void> = [];\n\n\tconst disposeRuntime = async (): Promise<void> => {\n\t\tif (disposed) return;\n\t\tdisposed = true;\n\t\tunsubscribe?.();\n\t\tunsubscribeBackpressure?.();\n\t\tawait runtimeHost.dispose();\n\t};\n\n\tconst registerSignalHandlers = (): void => {\n\t\tconst signals: NodeJS.Signals[] = [\"SIGTERM\"];\n\t\tif (process.platform !== \"win32\") {\n\t\t\tsignals.push(\"SIGHUP\");\n\t\t}\n\n\t\tfor (const signal of signals) {\n\t\t\tconst handler = () => {\n\t\t\t\tkillTrackedDetachedChildren();\n\t\t\t\tvoid disposeRuntime().finally(() => {\n\t\t\t\t\tprocess.exit(signal === \"SIGHUP\" ? 129 : 143);\n\t\t\t\t});\n\t\t\t};\n\t\t\tprocess.on(signal, handler);\n\t\t\tsignalCleanupHandlers.push(() => process.off(signal, handler));\n\t\t}\n\t};\n\n\tregisterSignalHandlers();\n\n\truntimeHost.setRebindSession(async () => {\n\t\tawait rebindSession();\n\t});\n\n\tconst rebindSession = async (): Promise<void> => {\n\t\tsession = runtimeHost.session;\n\t\tawait session.bindExtensions({\n\t\t\tmode: mode === \"json\" ? \"json\" : \"print\",\n\t\t\tcommandContextActions: {\n\t\t\t\twaitForIdle: () => session.waitForIdle(),\n\t\t\t\tnewSession: async (newSessionOptions) => runtimeHost.newSession(newSessionOptions),\n\t\t\t\tfork: async (entryId, forkOptions) => {\n\t\t\t\t\tconst result = await runtimeHost.fork(entryId, forkOptions);\n\t\t\t\t\treturn { cancelled: result.cancelled };\n\t\t\t\t},\n\t\t\t\tnavigateTree: async (targetId, navigateOptions) => {\n\t\t\t\t\tconst result = await session.navigateTree(targetId, {\n\t\t\t\t\t\tsummarize: navigateOptions?.summarize,\n\t\t\t\t\t\tcustomInstructions: navigateOptions?.customInstructions,\n\t\t\t\t\t\treplaceInstructions: navigateOptions?.replaceInstructions,\n\t\t\t\t\t\tlabel: navigateOptions?.label,\n\t\t\t\t\t});\n\t\t\t\t\treturn { cancelled: result.cancelled };\n\t\t\t\t},\n\t\t\t\tswitchSession: async (sessionPath, switchOptions) => {\n\t\t\t\t\treturn runtimeHost.switchSession(sessionPath, switchOptions);\n\t\t\t\t},\n\t\t\t\treload: async () => {\n\t\t\t\t\tawait session.reload();\n\t\t\t\t},\n\t\t\t},\n\t\t\tonError: (err) => {\n\t\t\t\tconsole.error(`Extension error (${err.extensionPath}): ${err.error}`);\n\t\t\t},\n\t\t});\n\n\t\tunsubscribe?.();\n\t\tunsubscribeBackpressure?.();\n\t\tunsubscribe = session.subscribe((event) => {\n\t\t\tif (mode === \"json\") {\n\t\t\t\twriteRawStdout(`${JSON.stringify(toJsonEvent(event))}\\n`);\n\t\t\t}\n\t\t});\n\t\tunsubscribeBackpressure =\n\t\t\tmode === \"json\"\n\t\t\t\t? session.agent.subscribe(async () => {\n\t\t\t\t\t\tawait waitForRawStdoutBackpressure();\n\t\t\t\t\t})\n\t\t\t\t: undefined;\n\t};\n\n\ttry {\n\t\tif (mode === \"json\") {\n\t\t\tconst header = session.sessionManager.getHeader();\n\t\t\tif (header) {\n\t\t\t\twriteRawStdout(`${JSON.stringify(header)}\\n`);\n\t\t\t}\n\t\t}\n\n\t\tawait rebindSession();\n\n\t\tif (initialMessage) {\n\t\t\tawait session.prompt(initialMessage, { images: initialImages });\n\t\t}\n\n\t\tfor (const message of messages) {\n\t\t\tawait session.prompt(message);\n\t\t}\n\n\t\tif (mode === \"text\") {\n\t\t\tconst state = session.state;\n\t\t\tconst lastMessage = state.messages[state.messages.length - 1];\n\n\t\t\tif (lastMessage?.role === \"assistant\") {\n\t\t\t\tconst assistantMsg = lastMessage as AssistantMessage;\n\t\t\t\tif (assistantMsg.stopReason === \"error\" || assistantMsg.stopReason === \"aborted\") {\n\t\t\t\t\tconsole.error(assistantMsg.errorMessage || `Request ${assistantMsg.stopReason}`);\n\t\t\t\t\texitCode = 1;\n\t\t\t\t} else {\n\t\t\t\t\tfor (const content of assistantMsg.content) {\n\t\t\t\t\t\tif (content.type === \"text\") {\n\t\t\t\t\t\t\twriteRawStdout(`${content.text}\\n`);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (assistantMsg.stopReason === \"length\") {\n\t\t\t\t\t\tconsole.error(\"Response was truncated: the model reached its output token limit.\");\n\t\t\t\t\t\texitCode = 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn exitCode;\n\t} catch (error: unknown) {\n\t\tconsole.error(error instanceof Error ? error.message : String(error));\n\t\treturn 1;\n\t} finally {\n\t\tfor (const cleanup of signalCleanupHandlers) {\n\t\t\tcleanup();\n\t\t}\n\t\tawait disposeRuntime();\n\t\tawait flushRawStdout();\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"package-manager-cli.d.ts","sourceRoot":"","sources":["../src/package-manager-cli.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAgBlE,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC;AAwGtE,wBAAgB,qBAAqB,IAAI,IAAI,CAmB5C;AA2iBD,MAAM,WAAW,4BAA4B;IAC5C,kBAAkB,CAAC,EAAE,eAAe,EAAE,CAAC;CACvC;AAiED,wBAAsB,mBAAmB,CACxC,IAAI,EAAE,MAAM,EAAE,EACd,cAAc,GAAE,4BAAiC,GAC/C,OAAO,CAAC,OAAO,CAAC,CAwElB;AAED,wBAAsB,oBAAoB,CACzC,IAAI,EAAE,MAAM,EAAE,EACd,cAAc,GAAE,4BAAiC,GAC/C,OAAO,CAAC,OAAO,CAAC,CAwPlB"}
1
+ {"version":3,"file":"package-manager-cli.d.ts","sourceRoot":"","sources":["../src/package-manager-cli.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAgBlE,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC;AA4HtE,wBAAgB,qBAAqB,IAAI,IAAI,CAmB5C;AA6iBD,MAAM,WAAW,4BAA4B;IAC5C,kBAAkB,CAAC,EAAE,eAAe,EAAE,CAAC;CACvC;AAiED,wBAAsB,mBAAmB,CACxC,IAAI,EAAE,MAAM,EAAE,EACd,cAAc,GAAE,4BAAiC,GAC/C,OAAO,CAAC,OAAO,CAAC,CAwElB;AAED,wBAAsB,oBAAoB,CACzC,IAAI,EAAE,MAAM,EAAE,EACd,cAAc,GAAE,4BAAiC,GAC/C,OAAO,CAAC,OAAO,CAAC,CAwPlB"}
@@ -91,6 +91,28 @@ function activateManagedRelease(managedRoot, version) {
91
91
  rmSync(temporaryPath, { force: true });
92
92
  }
93
93
  }
94
+ // Keep the active release and the one running this update, which other open
95
+ // sessions likely still use and which allows rolling back by editing current-version.
96
+ function pruneManagedReleases(managedRoot, activeVersion) {
97
+ const releasesRoot = join(managedRoot, "releases");
98
+ let entries;
99
+ try {
100
+ entries = readdirSync(releasesRoot);
101
+ }
102
+ catch {
103
+ return;
104
+ }
105
+ for (const entry of entries) {
106
+ if (entry === activeVersion || entry === VERSION || !MANAGED_RELEASE_VERSION_RE.test(entry))
107
+ continue;
108
+ try {
109
+ rmSync(join(releasesRoot, entry), { force: true, recursive: true });
110
+ }
111
+ catch {
112
+ // Files may be in use (e.g. loaded native modules on Windows); retry on the next update.
113
+ }
114
+ }
115
+ }
94
116
  function cleanupManagedStaging(managedRoot) {
95
117
  const stagingRoot = join(managedRoot, "staging");
96
118
  try {
@@ -153,6 +175,7 @@ async function runManagedSelfUpdate(managedRoot, version) {
153
175
  if (existsSync(releaseDir)) {
154
176
  verifyManagedRelease(releaseDir, version);
155
177
  activateManagedRelease(managedRoot, version);
178
+ pruneManagedReleases(managedRoot, version);
156
179
  return;
157
180
  }
158
181
  mkdirSync(stagingRoot, { recursive: true });
@@ -167,6 +190,7 @@ async function runManagedSelfUpdate(managedRoot, version) {
167
190
  verifyManagedRelease(stageDir, version);
168
191
  renameSync(stageDir, releaseDir);
169
192
  activateManagedRelease(managedRoot, version);
193
+ pruneManagedReleases(managedRoot, version);
170
194
  }
171
195
  finally {
172
196
  if (stageDir)