@code-yeongyu/senpi 2026.9.12-2 → 2026.9.12-3

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 (1459) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/README.md +1 -1
  3. package/dist/bun/cli.d.ts +2 -1
  4. package/dist/bun/cli.d.ts.map +1 -1
  5. package/dist/bun/cli.js +5 -8
  6. package/dist/bun/cli.js.map +1 -1
  7. package/dist/bun/runtime-setup.d.ts +2 -0
  8. package/dist/bun/runtime-setup.d.ts.map +1 -0
  9. package/dist/bun/runtime-setup.js +9 -0
  10. package/dist/bun/runtime-setup.js.map +1 -0
  11. package/dist/bun/sandbox-env-setup.d.ts +2 -0
  12. package/dist/bun/sandbox-env-setup.d.ts.map +1 -0
  13. package/dist/bun/sandbox-env-setup.js +4 -0
  14. package/dist/bun/sandbox-env-setup.js.map +1 -0
  15. package/dist/cli/config-selector.d.ts.map +1 -1
  16. package/dist/cli/config-selector.js +2 -1
  17. package/dist/cli/config-selector.js.map +1 -1
  18. package/dist/cli/setup.d.ts +2 -0
  19. package/dist/cli/setup.d.ts.map +1 -0
  20. package/dist/cli/setup.js +12 -0
  21. package/dist/cli/setup.js.map +1 -0
  22. package/dist/cli.js +3 -0
  23. package/dist/cli.js.map +1 -1
  24. package/dist/client/index.d.ts +1 -2
  25. package/dist/client/index.d.ts.map +1 -1
  26. package/dist/client/index.js +1 -2
  27. package/dist/client/index.js.map +1 -1
  28. package/dist/config.d.ts +1 -0
  29. package/dist/config.d.ts.map +1 -1
  30. package/dist/config.js +1 -0
  31. package/dist/config.js.map +1 -1
  32. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  33. package/dist/core/agent-session-runtime.js +13 -5
  34. package/dist/core/agent-session-runtime.js.map +1 -1
  35. package/dist/core/agent-session.d.ts +41 -8
  36. package/dist/core/agent-session.d.ts.map +1 -1
  37. package/dist/core/agent-session.js +99 -36
  38. package/dist/core/agent-session.js.map +1 -1
  39. package/dist/core/compaction/branch-summarization.d.ts +1 -1
  40. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  41. package/dist/core/compaction/branch-summarization.js +6 -4
  42. package/dist/core/compaction/branch-summarization.js.map +1 -1
  43. package/dist/core/compaction-settings-access.d.ts +18 -2
  44. package/dist/core/compaction-settings-access.d.ts.map +1 -1
  45. package/dist/core/compaction-settings-access.js +35 -4
  46. package/dist/core/compaction-settings-access.js.map +1 -1
  47. package/dist/core/compaction-settings-resolver.d.ts +2 -2
  48. package/dist/core/compaction-settings-resolver.d.ts.map +1 -1
  49. package/dist/core/compaction-settings-resolver.js +6 -3
  50. package/dist/core/compaction-settings-resolver.js.map +1 -1
  51. package/dist/core/extensions/builtin/ask-user/extension.d.ts.map +1 -1
  52. package/dist/core/extensions/builtin/ask-user/extension.js +11 -0
  53. package/dist/core/extensions/builtin/ask-user/extension.js.map +1 -1
  54. package/dist/core/extensions/builtin/prompt-preset/presets.d.ts.map +1 -1
  55. package/dist/core/extensions/builtin/prompt-preset/presets.js +7 -1
  56. package/dist/core/extensions/builtin/prompt-preset/presets.js.map +1 -1
  57. package/dist/core/extensions/loader.d.ts.map +1 -1
  58. package/dist/core/extensions/loader.js +4 -2
  59. package/dist/core/extensions/loader.js.map +1 -1
  60. package/dist/core/keybindings.d.ts +10 -0
  61. package/dist/core/keybindings.d.ts.map +1 -1
  62. package/dist/core/keybindings.js +8 -0
  63. package/dist/core/keybindings.js.map +1 -1
  64. package/dist/core/messages.d.ts +1 -1
  65. package/dist/core/messages.d.ts.map +1 -1
  66. package/dist/core/messages.js.map +1 -1
  67. package/dist/core/model-registry.d.ts +5 -1
  68. package/dist/core/model-registry.d.ts.map +1 -1
  69. package/dist/core/model-registry.js +8 -0
  70. package/dist/core/model-registry.js.map +1 -1
  71. package/dist/core/model-resolver.d.ts.map +1 -1
  72. package/dist/core/model-resolver.js +2 -0
  73. package/dist/core/model-resolver.js.map +1 -1
  74. package/dist/core/model-runtime.d.ts +1 -0
  75. package/dist/core/model-runtime.d.ts.map +1 -1
  76. package/dist/core/model-runtime.js +5 -2
  77. package/dist/core/model-runtime.js.map +1 -1
  78. package/dist/core/retry-fallback/settings.d.ts +2 -0
  79. package/dist/core/retry-fallback/settings.d.ts.map +1 -1
  80. package/dist/core/retry-fallback/settings.js.map +1 -1
  81. package/dist/core/session-manager.d.ts +3 -2
  82. package/dist/core/session-manager.d.ts.map +1 -1
  83. package/dist/core/session-manager.js +47 -7
  84. package/dist/core/session-manager.js.map +1 -1
  85. package/dist/core/settings-manager.d.ts +12 -5
  86. package/dist/core/settings-manager.d.ts.map +1 -1
  87. package/dist/core/settings-manager.js +18 -6
  88. package/dist/core/settings-manager.js.map +1 -1
  89. package/dist/core/settings-public-types.d.ts +1 -1
  90. package/dist/core/settings-public-types.d.ts.map +1 -1
  91. package/dist/core/settings-public-types.js.map +1 -1
  92. package/dist/core/skills.d.ts +1 -1
  93. package/dist/core/skills.d.ts.map +1 -1
  94. package/dist/core/skills.js +6 -2
  95. package/dist/core/skills.js.map +1 -1
  96. package/dist/core/system-prompt.d.ts.map +1 -1
  97. package/dist/core/system-prompt.js +8 -9
  98. package/dist/core/system-prompt.js.map +1 -1
  99. package/dist/core/tools/bash.d.ts.map +1 -1
  100. package/dist/core/tools/bash.js +3 -142
  101. package/dist/core/tools/bash.js.map +1 -1
  102. package/dist/core/tools/edit.d.ts +1 -12
  103. package/dist/core/tools/edit.d.ts.map +1 -1
  104. package/dist/core/tools/edit.js +4 -168
  105. package/dist/core/tools/edit.js.map +1 -1
  106. package/dist/core/tools/find.d.ts.map +1 -1
  107. package/dist/core/tools/find.js +2 -53
  108. package/dist/core/tools/find.js.map +1 -1
  109. package/dist/core/tools/grep.d.ts.map +1 -1
  110. package/dist/core/tools/grep.js +2 -58
  111. package/dist/core/tools/grep.js.map +1 -1
  112. package/dist/core/tools/ls.d.ts.map +1 -1
  113. package/dist/core/tools/ls.js +2 -47
  114. package/dist/core/tools/ls.js.map +1 -1
  115. package/dist/core/tools/read.d.ts +1 -4
  116. package/dist/core/tools/read.d.ts.map +1 -1
  117. package/dist/core/tools/read.js +4 -141
  118. package/dist/core/tools/read.js.map +1 -1
  119. package/dist/core/tools/renderers/bash.d.ts +12 -0
  120. package/dist/core/tools/renderers/bash.d.ts.map +1 -0
  121. package/dist/core/tools/renderers/bash.js +156 -0
  122. package/dist/core/tools/renderers/bash.js.map +1 -0
  123. package/dist/core/tools/renderers/edit.d.ts +23 -0
  124. package/dist/core/tools/renderers/edit.d.ts.map +1 -0
  125. package/dist/core/tools/renderers/edit.js +172 -0
  126. package/dist/core/tools/renderers/edit.js.map +1 -0
  127. package/dist/core/tools/renderers/find.d.ts +10 -0
  128. package/dist/core/tools/renderers/find.d.ts.map +1 -0
  129. package/dist/core/tools/renderers/find.js +64 -0
  130. package/dist/core/tools/renderers/find.js.map +1 -0
  131. package/dist/core/tools/renderers/grep.d.ts +10 -0
  132. package/dist/core/tools/renderers/grep.d.ts.map +1 -0
  133. package/dist/core/tools/renderers/grep.js +69 -0
  134. package/dist/core/tools/renderers/grep.js.map +1 -0
  135. package/dist/core/tools/renderers/index.d.ts +28 -0
  136. package/dist/core/tools/renderers/index.d.ts.map +1 -0
  137. package/dist/core/tools/renderers/index.js +47 -0
  138. package/dist/core/tools/renderers/index.js.map +1 -0
  139. package/dist/core/tools/renderers/ls.d.ts +10 -0
  140. package/dist/core/tools/renderers/ls.d.ts.map +1 -0
  141. package/dist/core/tools/renderers/ls.js +58 -0
  142. package/dist/core/tools/renderers/ls.js.map +1 -0
  143. package/dist/core/tools/renderers/read.d.ts +19 -0
  144. package/dist/core/tools/renderers/read.d.ts.map +1 -0
  145. package/dist/core/tools/renderers/read.js +149 -0
  146. package/dist/core/tools/renderers/read.js.map +1 -0
  147. package/dist/core/tools/renderers/write.d.ts +10 -0
  148. package/dist/core/tools/renderers/write.d.ts.map +1 -0
  149. package/dist/core/tools/renderers/write.js +162 -0
  150. package/dist/core/tools/renderers/write.js.map +1 -0
  151. package/dist/core/tools/write.d.ts.map +1 -1
  152. package/dist/core/tools/write.js +4 -153
  153. package/dist/core/tools/write.js.map +1 -1
  154. package/dist/index.d.ts +2 -2
  155. package/dist/index.d.ts.map +1 -1
  156. package/dist/index.js.map +1 -1
  157. package/dist/migrations.d.ts.map +1 -1
  158. package/dist/migrations.js +2 -2
  159. package/dist/migrations.js.map +1 -1
  160. package/dist/modes/app-server/threads/turn-runtime.d.ts +3 -1
  161. package/dist/modes/app-server/threads/turn-runtime.d.ts.map +1 -1
  162. package/dist/modes/app-server/threads/turn-runtime.js.map +1 -1
  163. package/dist/modes/app-server/threads/turns.js +1 -1
  164. package/dist/modes/app-server/threads/turns.js.map +1 -1
  165. package/dist/modes/app-server/turn-adapter.js +4 -2
  166. package/dist/modes/app-server/turn-adapter.js.map +1 -1
  167. package/dist/modes/interactive/chat-viewport.d.ts +22 -0
  168. package/dist/modes/interactive/chat-viewport.d.ts.map +1 -0
  169. package/dist/modes/interactive/chat-viewport.js +29 -0
  170. package/dist/modes/interactive/chat-viewport.js.map +1 -0
  171. package/dist/modes/interactive/components/ask-user-answer-key.d.ts +14 -0
  172. package/dist/modes/interactive/components/ask-user-answer-key.d.ts.map +1 -0
  173. package/dist/modes/interactive/components/ask-user-answer-key.js +65 -0
  174. package/dist/modes/interactive/components/ask-user-answer-key.js.map +1 -0
  175. package/dist/modes/interactive/components/ask-user-async-widget.d.ts +17 -14
  176. package/dist/modes/interactive/components/ask-user-async-widget.d.ts.map +1 -1
  177. package/dist/modes/interactive/components/ask-user-async-widget.js +47 -39
  178. package/dist/modes/interactive/components/ask-user-async-widget.js.map +1 -1
  179. package/dist/modes/interactive/components/assistant-message.d.ts +7 -0
  180. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  181. package/dist/modes/interactive/components/assistant-message.js +26 -2
  182. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  183. package/dist/modes/interactive/components/assistant-render-descriptors.d.ts +4 -0
  184. package/dist/modes/interactive/components/assistant-render-descriptors.d.ts.map +1 -1
  185. package/dist/modes/interactive/components/assistant-render-descriptors.js +8 -5
  186. package/dist/modes/interactive/components/assistant-render-descriptors.js.map +1 -1
  187. package/dist/modes/interactive/components/custom-editor.d.ts +10 -1
  188. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
  189. package/dist/modes/interactive/components/custom-editor.js +37 -1
  190. package/dist/modes/interactive/components/custom-editor.js.map +1 -1
  191. package/dist/modes/interactive/components/index.d.ts +1 -1
  192. package/dist/modes/interactive/components/index.d.ts.map +1 -1
  193. package/dist/modes/interactive/components/index.js.map +1 -1
  194. package/dist/modes/interactive/components/scoped-models-selector.js +8 -8
  195. package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
  196. package/dist/modes/interactive/components/status-indicator.d.ts +4 -1
  197. package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
  198. package/dist/modes/interactive/components/status-indicator.js +14 -2
  199. package/dist/modes/interactive/components/status-indicator.js.map +1 -1
  200. package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
  201. package/dist/modes/interactive/components/thinking-selector.js +4 -4
  202. package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
  203. package/dist/modes/interactive/components/tool-execution-renderer.d.ts +4 -1
  204. package/dist/modes/interactive/components/tool-execution-renderer.d.ts.map +1 -1
  205. package/dist/modes/interactive/components/tool-execution-renderer.js +23 -10
  206. package/dist/modes/interactive/components/tool-execution-renderer.js.map +1 -1
  207. package/dist/modes/interactive/components/tool-execution-types.d.ts +18 -2
  208. package/dist/modes/interactive/components/tool-execution-types.d.ts.map +1 -1
  209. package/dist/modes/interactive/components/tool-execution-types.js.map +1 -1
  210. package/dist/modes/interactive/components/tool-execution.d.ts +3 -3
  211. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  212. package/dist/modes/interactive/components/tool-execution.js +5 -0
  213. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  214. package/dist/modes/interactive/interactive-mode.d.ts +10 -15
  215. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  216. package/dist/modes/interactive/interactive-mode.js +178 -138
  217. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  218. package/dist/modes/interactive/theme/dark.json +2 -1
  219. package/dist/modes/interactive/theme/grok-day.json +2 -1
  220. package/dist/modes/interactive/theme/grok-night.json +2 -1
  221. package/dist/modes/interactive/theme/light.json +2 -1
  222. package/dist/modes/interactive/theme/theme-controller.d.ts +1 -0
  223. package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -1
  224. package/dist/modes/interactive/theme/theme-controller.js +5 -0
  225. package/dist/modes/interactive/theme/theme-controller.js.map +1 -1
  226. package/dist/modes/interactive/theme/theme-json.d.ts +84 -0
  227. package/dist/modes/interactive/theme/theme-json.d.ts.map +1 -0
  228. package/dist/modes/interactive/theme/theme-json.js +130 -0
  229. package/dist/modes/interactive/theme/theme-json.js.map +1 -0
  230. package/dist/modes/interactive/theme/theme-schema.json +6 -2
  231. package/dist/modes/interactive/theme/theme.d.ts +10 -5
  232. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  233. package/dist/modes/interactive/theme/theme.js +14 -117
  234. package/dist/modes/interactive/theme/theme.js.map +1 -1
  235. package/dist/modes/interactive/tips/catalog/input-tips.d.ts +5 -0
  236. package/dist/modes/interactive/tips/catalog/input-tips.d.ts.map +1 -1
  237. package/dist/modes/interactive/tips/catalog/input-tips.js +5 -0
  238. package/dist/modes/interactive/tips/catalog/input-tips.js.map +1 -1
  239. package/dist/modes/interactive/tui-renderer.d.ts +21 -0
  240. package/dist/modes/interactive/tui-renderer.d.ts.map +1 -0
  241. package/dist/modes/interactive/tui-renderer.js +67 -0
  242. package/dist/modes/interactive/tui-renderer.js.map +1 -0
  243. package/dist/modes/rpc/connection-handler.d.ts.map +1 -1
  244. package/dist/modes/rpc/connection-handler.js +8 -2
  245. package/dist/modes/rpc/connection-handler.js.map +1 -1
  246. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  247. package/dist/modes/rpc/rpc-client.js +11 -1
  248. package/dist/modes/rpc/rpc-client.js.map +1 -1
  249. package/dist/senpi +3 -0
  250. package/dist/utils/clipboard-command.d.ts +7 -0
  251. package/dist/utils/clipboard-command.d.ts.map +1 -0
  252. package/dist/utils/clipboard-command.js +45 -0
  253. package/dist/utils/clipboard-command.js.map +1 -0
  254. package/dist/utils/clipboard-image.d.ts.map +1 -1
  255. package/dist/utils/clipboard-image.js +52 -69
  256. package/dist/utils/clipboard-image.js.map +1 -1
  257. package/dist/utils/clipboard.d.ts.map +1 -1
  258. package/dist/utils/clipboard.js +49 -126
  259. package/dist/utils/clipboard.js.map +1 -1
  260. package/dist/utils/exif-orientation.d.ts.map +1 -1
  261. package/dist/utils/exif-orientation.js +2 -3
  262. package/dist/utils/exif-orientation.js.map +1 -1
  263. package/dist/utils/tools-manager.d.ts +1 -0
  264. package/dist/utils/tools-manager.d.ts.map +1 -1
  265. package/dist/utils/tools-manager.js +41 -19
  266. package/dist/utils/tools-manager.js.map +1 -1
  267. package/docs/compaction.md +39 -13
  268. package/docs/containerization.md +45 -0
  269. package/docs/development.md +19 -0
  270. package/docs/docs.json +4 -0
  271. package/docs/environment-variables.md +2 -0
  272. package/docs/extensions.md +21 -10
  273. package/docs/keybindings.md +7 -2
  274. package/docs/models.md +1 -1
  275. package/docs/providers.md +1 -1
  276. package/docs/rpc.md +2 -2
  277. package/docs/sdk.md +7 -0
  278. package/docs/session-format.md +52 -38
  279. package/docs/settings.md +40 -4
  280. package/docs/skills.md +1 -1
  281. package/docs/termux.md +0 -1
  282. package/docs/themes.md +8 -6
  283. package/docs/tui.md +22 -3
  284. package/examples/README.md +3 -0
  285. package/examples/extensions/dynamic-resources/dynamic.json +2 -0
  286. package/examples/plugins/pi-example-plugin/README.md +38 -0
  287. package/examples/plugins/pi-example-plugin/package.json +10 -0
  288. package/examples/plugins/pi-example-plugin/src/contract.ts +13 -0
  289. package/examples/plugins/pi-example-plugin/src/session.ts +23 -0
  290. package/examples/plugins/pi-example-plugin/src/tui.ts +31 -0
  291. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-cjs/index.js +1 -1
  292. package/node_modules/@aws-sdk/client-bedrock-runtime/package.json +3 -3
  293. package/node_modules/@aws-sdk/core/dist-cjs/submodules/util/index.js +5 -0
  294. package/node_modules/@aws-sdk/core/dist-es/submodules/util/hasOwn.js +3 -0
  295. package/node_modules/@aws-sdk/core/dist-es/submodules/util/index.js +1 -0
  296. package/node_modules/@aws-sdk/core/dist-types/submodules/util/hasOwn.d.ts +4 -0
  297. package/node_modules/@aws-sdk/core/dist-types/submodules/util/index.d.ts +1 -0
  298. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/hasOwn.d.ts +1 -0
  299. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/index.d.ts +1 -0
  300. package/node_modules/@aws-sdk/core/package.json +1 -1
  301. package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
  302. package/node_modules/@aws-sdk/credential-provider-http/package.json +2 -2
  303. package/node_modules/@aws-sdk/credential-provider-ini/package.json +9 -9
  304. package/node_modules/@aws-sdk/credential-provider-login/package.json +3 -3
  305. package/node_modules/@aws-sdk/credential-provider-node/dist-cjs/index.js +2 -0
  306. package/node_modules/@aws-sdk/credential-provider-node/dist-es/runtime/memoize-chain.js +2 -0
  307. package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
  308. package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
  309. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/LICENSE +201 -0
  310. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/README.md +62 -0
  311. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-cjs/index.js +158 -0
  312. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/constants.js +2 -0
  313. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/fromEnvSigningName.js +16 -0
  314. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/fromSso.js +84 -0
  315. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/fromStatic.js +8 -0
  316. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/getNewSsoOidcToken.js +11 -0
  317. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/getSsoOidcClient.js +10 -0
  318. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/index.js +4 -0
  319. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/nodeProvider.js +5 -0
  320. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/validateTokenExpiry.js +7 -0
  321. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/validateTokenKey.js +7 -0
  322. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/writeSSOTokenToFile.js +8 -0
  323. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/constants.d.ts +8 -0
  324. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/fromEnvSigningName.d.ts +18 -0
  325. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/fromSso.d.ts +12 -0
  326. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/fromStatic.d.ts +9 -0
  327. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/getNewSsoOidcToken.d.ts +8 -0
  328. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/getSsoOidcClient.d.ts +7 -0
  329. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/index.d.ts +7 -0
  330. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/nodeProvider.d.ts +18 -0
  331. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/constants.d.ts +3 -0
  332. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/fromEnvSigningName.d.ts +8 -0
  333. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/fromSso.d.ts +10 -0
  334. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/fromStatic.d.ts +5 -0
  335. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/getNewSsoOidcToken.d.ts +9 -0
  336. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/getSsoOidcClient.d.ts +7 -0
  337. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/index.d.ts +7 -0
  338. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/nodeProvider.d.ts +3 -0
  339. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/validateTokenExpiry.d.ts +2 -0
  340. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/validateTokenKey.d.ts +1 -0
  341. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/writeSSOTokenToFile.d.ts +2 -0
  342. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/validateTokenExpiry.d.ts +5 -0
  343. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/validateTokenKey.d.ts +4 -0
  344. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/writeSSOTokenToFile.d.ts +5 -0
  345. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/package.json +69 -0
  346. package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
  347. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
  348. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
  349. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
  350. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
  351. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
  352. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
  353. package/node_modules/@aws-sdk/nested-clients/package.json +2 -2
  354. package/node_modules/@aws-sdk/token-providers/package.json +1 -1
  355. package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +12 -0
  356. package/node_modules/@code-yeongyu/senpi-codemode/package.json +5 -5
  357. package/node_modules/@earendil-works/chord/README.md +205 -0
  358. package/node_modules/@earendil-works/chord/dist/api.d.ts +15 -0
  359. package/node_modules/@earendil-works/chord/dist/api.d.ts.map +1 -0
  360. package/node_modules/@earendil-works/chord/dist/api.js +72 -0
  361. package/node_modules/@earendil-works/chord/dist/api.js.map +1 -0
  362. package/node_modules/@earendil-works/chord/dist/bundler.d.ts +6 -0
  363. package/node_modules/@earendil-works/chord/dist/bundler.d.ts.map +1 -0
  364. package/node_modules/@earendil-works/chord/dist/bundler.js +3 -0
  365. package/node_modules/@earendil-works/chord/dist/bundler.js.map +1 -0
  366. package/node_modules/@earendil-works/chord/dist/context/index.d.ts +24 -0
  367. package/node_modules/@earendil-works/chord/dist/context/index.d.ts.map +1 -0
  368. package/node_modules/@earendil-works/chord/dist/context/index.js +97 -0
  369. package/node_modules/@earendil-works/chord/dist/context/index.js.map +1 -0
  370. package/node_modules/@earendil-works/chord/dist/delta/index.d.ts +119 -0
  371. package/node_modules/@earendil-works/chord/dist/delta/index.d.ts.map +1 -0
  372. package/node_modules/@earendil-works/chord/dist/delta/index.js +1209 -0
  373. package/node_modules/@earendil-works/chord/dist/delta/index.js.map +1 -0
  374. package/node_modules/@earendil-works/chord/dist/facets/host.d.ts +12 -0
  375. package/node_modules/@earendil-works/chord/dist/facets/host.d.ts.map +1 -0
  376. package/node_modules/@earendil-works/chord/dist/facets/host.js +762 -0
  377. package/node_modules/@earendil-works/chord/dist/facets/host.js.map +1 -0
  378. package/node_modules/@earendil-works/chord/dist/facets/loader.d.ts +3 -0
  379. package/node_modules/@earendil-works/chord/dist/facets/loader.d.ts.map +1 -0
  380. package/node_modules/@earendil-works/chord/dist/facets/loader.js +5 -0
  381. package/node_modules/@earendil-works/chord/dist/facets/loader.js.map +1 -0
  382. package/node_modules/@earendil-works/chord/dist/index.d.ts +11 -0
  383. package/node_modules/@earendil-works/chord/dist/index.d.ts.map +1 -0
  384. package/node_modules/@earendil-works/chord/dist/index.js +10 -0
  385. package/node_modules/@earendil-works/chord/dist/index.js.map +1 -0
  386. package/node_modules/@earendil-works/chord/dist/json.d.ts +4 -0
  387. package/node_modules/@earendil-works/chord/dist/json.d.ts.map +1 -0
  388. package/node_modules/@earendil-works/chord/dist/json.js +57 -0
  389. package/node_modules/@earendil-works/chord/dist/json.js.map +1 -0
  390. package/node_modules/@earendil-works/chord/dist/node/bundle-loader.d.ts +30 -0
  391. package/node_modules/@earendil-works/chord/dist/node/bundle-loader.d.ts.map +1 -0
  392. package/node_modules/@earendil-works/chord/dist/node/bundle-loader.js +377 -0
  393. package/node_modules/@earendil-works/chord/dist/node/bundle-loader.js.map +1 -0
  394. package/node_modules/@earendil-works/chord/dist/node/bundle.d.ts +26 -0
  395. package/node_modules/@earendil-works/chord/dist/node/bundle.d.ts.map +1 -0
  396. package/node_modules/@earendil-works/chord/dist/node/bundle.js +183 -0
  397. package/node_modules/@earendil-works/chord/dist/node/bundle.js.map +1 -0
  398. package/node_modules/@earendil-works/chord/dist/node/manifest.d.ts +36 -0
  399. package/node_modules/@earendil-works/chord/dist/node/manifest.d.ts.map +1 -0
  400. package/node_modules/@earendil-works/chord/dist/node/manifest.js +6 -0
  401. package/node_modules/@earendil-works/chord/dist/node/manifest.js.map +1 -0
  402. package/node_modules/@earendil-works/chord/dist/node/package.d.ts +15 -0
  403. package/node_modules/@earendil-works/chord/dist/node/package.d.ts.map +1 -0
  404. package/node_modules/@earendil-works/chord/dist/node/package.js +199 -0
  405. package/node_modules/@earendil-works/chord/dist/node/package.js.map +1 -0
  406. package/node_modules/@earendil-works/chord/dist/node.d.ts +5 -0
  407. package/node_modules/@earendil-works/chord/dist/node.d.ts.map +1 -0
  408. package/node_modules/@earendil-works/chord/dist/node.js +3 -0
  409. package/node_modules/@earendil-works/chord/dist/node.js.map +1 -0
  410. package/node_modules/@earendil-works/chord/dist/services/consumer.d.ts +11 -0
  411. package/node_modules/@earendil-works/chord/dist/services/consumer.d.ts.map +1 -0
  412. package/node_modules/@earendil-works/chord/dist/services/consumer.js +535 -0
  413. package/node_modules/@earendil-works/chord/dist/services/consumer.js.map +1 -0
  414. package/node_modules/@earendil-works/chord/dist/services/errors.d.ts +8 -0
  415. package/node_modules/@earendil-works/chord/dist/services/errors.d.ts.map +1 -0
  416. package/node_modules/@earendil-works/chord/dist/services/errors.js +21 -0
  417. package/node_modules/@earendil-works/chord/dist/services/errors.js.map +1 -0
  418. package/node_modules/@earendil-works/chord/dist/services/handle.d.ts +15 -0
  419. package/node_modules/@earendil-works/chord/dist/services/handle.d.ts.map +1 -0
  420. package/node_modules/@earendil-works/chord/dist/services/handle.js +99 -0
  421. package/node_modules/@earendil-works/chord/dist/services/handle.js.map +1 -0
  422. package/node_modules/@earendil-works/chord/dist/services/instances.d.ts +25 -0
  423. package/node_modules/@earendil-works/chord/dist/services/instances.d.ts.map +1 -0
  424. package/node_modules/@earendil-works/chord/dist/services/instances.js +137 -0
  425. package/node_modules/@earendil-works/chord/dist/services/instances.js.map +1 -0
  426. package/node_modules/@earendil-works/chord/dist/services/loopback.d.ts +5 -0
  427. package/node_modules/@earendil-works/chord/dist/services/loopback.d.ts.map +1 -0
  428. package/node_modules/@earendil-works/chord/dist/services/loopback.js +15 -0
  429. package/node_modules/@earendil-works/chord/dist/services/loopback.js.map +1 -0
  430. package/node_modules/@earendil-works/chord/dist/services/provider.d.ts +37 -0
  431. package/node_modules/@earendil-works/chord/dist/services/provider.d.ts.map +1 -0
  432. package/node_modules/@earendil-works/chord/dist/services/provider.js +472 -0
  433. package/node_modules/@earendil-works/chord/dist/services/provider.js.map +1 -0
  434. package/node_modules/@earendil-works/chord/dist/services/state-codec.d.ts +15 -0
  435. package/node_modules/@earendil-works/chord/dist/services/state-codec.d.ts.map +1 -0
  436. package/node_modules/@earendil-works/chord/dist/services/state-codec.js +115 -0
  437. package/node_modules/@earendil-works/chord/dist/services/state-codec.js.map +1 -0
  438. package/node_modules/@earendil-works/chord/dist/services/state-internals.d.ts +11 -0
  439. package/node_modules/@earendil-works/chord/dist/services/state-internals.d.ts.map +1 -0
  440. package/node_modules/@earendil-works/chord/dist/services/state-internals.js +10 -0
  441. package/node_modules/@earendil-works/chord/dist/services/state-internals.js.map +1 -0
  442. package/node_modules/@earendil-works/chord/dist/services/state.d.ts +23 -0
  443. package/node_modules/@earendil-works/chord/dist/services/state.d.ts.map +1 -0
  444. package/node_modules/@earendil-works/chord/dist/services/state.js +124 -0
  445. package/node_modules/@earendil-works/chord/dist/services/state.js.map +1 -0
  446. package/node_modules/@earendil-works/chord/dist/services/wire.d.ts +60 -0
  447. package/node_modules/@earendil-works/chord/dist/services/wire.d.ts.map +1 -0
  448. package/node_modules/@earendil-works/chord/dist/services/wire.js +173 -0
  449. package/node_modules/@earendil-works/chord/dist/services/wire.js.map +1 -0
  450. package/node_modules/@earendil-works/chord/dist/types.d.ts +203 -0
  451. package/node_modules/@earendil-works/chord/dist/types.d.ts.map +1 -0
  452. package/node_modules/@earendil-works/chord/dist/types.js +2 -0
  453. package/node_modules/@earendil-works/chord/dist/types.js.map +1 -0
  454. package/node_modules/@earendil-works/chord/package.json +73 -0
  455. package/node_modules/@earendil-works/pi-agent-core/README.md +4 -0
  456. package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.d.ts +639 -384
  457. package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.d.ts.map +1 -1
  458. package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.js +5 -250
  459. package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.js.map +1 -1
  460. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.d.ts +12 -6
  461. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.d.ts.map +1 -1
  462. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.js +33 -27
  463. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.js.map +1 -1
  464. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.d.ts +30 -8
  465. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.d.ts.map +1 -1
  466. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js +53 -64
  467. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js.map +1 -1
  468. package/node_modules/@earendil-works/pi-agent-core/dist/harness/config.d.ts +9 -0
  469. package/node_modules/@earendil-works/pi-agent-core/dist/harness/config.d.ts.map +1 -0
  470. package/node_modules/@earendil-works/pi-agent-core/dist/harness/config.js +35 -0
  471. package/node_modules/@earendil-works/pi-agent-core/dist/harness/config.js.map +1 -0
  472. package/node_modules/@earendil-works/pi-agent-core/dist/harness/context.d.ts +9 -0
  473. package/node_modules/@earendil-works/pi-agent-core/dist/harness/context.d.ts.map +1 -0
  474. package/node_modules/@earendil-works/pi-agent-core/dist/harness/context.js +13 -0
  475. package/node_modules/@earendil-works/pi-agent-core/dist/harness/context.js.map +1 -0
  476. package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.d.ts +25 -28
  477. package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.d.ts.map +1 -1
  478. package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.js +368 -125
  479. package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.js.map +1 -1
  480. package/node_modules/@earendil-works/pi-agent-core/dist/harness/events.d.ts +20 -38
  481. package/node_modules/@earendil-works/pi-agent-core/dist/harness/events.d.ts.map +1 -1
  482. package/node_modules/@earendil-works/pi-agent-core/dist/harness/events.js +233 -55
  483. package/node_modules/@earendil-works/pi-agent-core/dist/harness/events.js.map +1 -1
  484. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/assistant.d.ts +42 -0
  485. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/assistant.d.ts.map +1 -0
  486. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/assistant.js +82 -0
  487. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/assistant.js.map +1 -0
  488. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/effect-gate.d.ts +22 -0
  489. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/effect-gate.d.ts.map +1 -0
  490. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/effect-gate.js +48 -0
  491. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/effect-gate.js.map +1 -0
  492. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/tools.d.ts +67 -0
  493. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/tools.d.ts.map +1 -0
  494. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/tools.js +121 -0
  495. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/tools.js.map +1 -0
  496. package/node_modules/@earendil-works/pi-agent-core/dist/harness/hooks.d.ts +38 -0
  497. package/node_modules/@earendil-works/pi-agent-core/dist/harness/hooks.d.ts.map +1 -0
  498. package/node_modules/@earendil-works/pi-agent-core/dist/harness/hooks.js +404 -0
  499. package/node_modules/@earendil-works/pi-agent-core/dist/harness/hooks.js.map +1 -0
  500. package/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.d.ts +2 -2
  501. package/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.d.ts.map +1 -1
  502. package/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.js.map +1 -1
  503. package/node_modules/@earendil-works/pi-agent-core/dist/harness/prompt-templates.d.ts +3 -2
  504. package/node_modules/@earendil-works/pi-agent-core/dist/harness/prompt-templates.d.ts.map +1 -1
  505. package/node_modules/@earendil-works/pi-agent-core/dist/harness/prompt-templates.js +17 -17
  506. package/node_modules/@earendil-works/pi-agent-core/dist/harness/prompt-templates.js.map +1 -1
  507. package/node_modules/@earendil-works/pi-agent-core/dist/harness/result.d.ts +93 -0
  508. package/node_modules/@earendil-works/pi-agent-core/dist/harness/result.d.ts.map +1 -1
  509. package/node_modules/@earendil-works/pi-agent-core/dist/harness/result.js +39 -0
  510. package/node_modules/@earendil-works/pi-agent-core/dist/harness/result.js.map +1 -1
  511. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/boundary.d.ts +28 -0
  512. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/boundary.d.ts.map +1 -0
  513. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/boundary.js +173 -0
  514. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/boundary.js.map +1 -0
  515. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/checkpoint.d.ts +8 -0
  516. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/checkpoint.d.ts.map +1 -0
  517. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/checkpoint.js +133 -0
  518. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/checkpoint.js.map +1 -0
  519. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/deferred.d.ts +15 -0
  520. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/deferred.d.ts.map +1 -0
  521. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/deferred.js +179 -0
  522. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/deferred.js.map +1 -0
  523. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/generation.d.ts +8 -0
  524. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/generation.d.ts.map +1 -0
  525. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/generation.js +205 -0
  526. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/generation.js.map +1 -0
  527. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/reconcile.d.ts +5 -0
  528. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/reconcile.d.ts.map +1 -0
  529. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/reconcile.js +140 -0
  530. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/reconcile.js.map +1 -0
  531. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/recovery.d.ts +8 -0
  532. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/recovery.d.ts.map +1 -0
  533. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/recovery.js +85 -0
  534. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/recovery.js.map +1 -0
  535. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/response.d.ts +23 -0
  536. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/response.d.ts.map +1 -0
  537. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/response.js +394 -0
  538. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/response.js.map +1 -0
  539. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/retry.d.ts +4 -0
  540. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/retry.d.ts.map +1 -0
  541. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/retry.js +34 -0
  542. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/retry.js.map +1 -0
  543. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/structural.d.ts +32 -0
  544. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/structural.d.ts.map +1 -0
  545. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/structural.js +929 -0
  546. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/structural.js.map +1 -0
  547. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/terminal.d.ts +7 -0
  548. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/terminal.d.ts.map +1 -0
  549. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/terminal.js +49 -0
  550. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/terminal.js.map +1 -0
  551. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/tool-placement.d.ts +14 -0
  552. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/tool-placement.d.ts.map +1 -0
  553. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/tool-placement.js +244 -0
  554. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/tool-placement.js.map +1 -0
  555. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/tools.d.ts +6 -0
  556. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/tools.d.ts.map +1 -0
  557. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/tools.js +449 -0
  558. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/tools.js.map +1 -0
  559. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive.d.ts +6 -0
  560. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive.d.ts.map +1 -0
  561. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive.js +93 -0
  562. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive.js.map +1 -0
  563. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/harness.d.ts +59 -0
  564. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/harness.d.ts.map +1 -0
  565. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/harness.js +302 -0
  566. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/harness.js.map +1 -0
  567. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/index.d.ts +2 -0
  568. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/index.d.ts.map +1 -0
  569. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/index.js +2 -0
  570. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/index.js.map +1 -0
  571. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/lane.d.ts +118 -0
  572. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/lane.d.ts.map +1 -0
  573. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/lane.js +1559 -0
  574. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/lane.js.map +1 -0
  575. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/progress.d.ts +15 -0
  576. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/progress.d.ts.map +1 -0
  577. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/progress.js +66 -0
  578. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/progress.js.map +1 -0
  579. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/reducer.d.ts +5 -0
  580. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/reducer.d.ts.map +1 -0
  581. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/reducer.js +240 -0
  582. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/reducer.js.map +1 -0
  583. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/restore.d.ts +24 -0
  584. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/restore.d.ts.map +1 -0
  585. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/restore.js +117 -0
  586. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/restore.js.map +1 -0
  587. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/transcript.d.ts +21 -0
  588. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/transcript.d.ts.map +1 -0
  589. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/transcript.js +72 -0
  590. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/transcript.js.map +1 -0
  591. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/types.d.ts +105 -0
  592. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/types.d.ts.map +1 -0
  593. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/types.js +50 -0
  594. package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/types.js.map +1 -0
  595. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/commit.d.ts +53 -0
  596. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/commit.d.ts.map +1 -0
  597. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/commit.js +57 -0
  598. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/commit.js.map +1 -0
  599. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/context.d.ts +6 -19
  600. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/context.d.ts.map +1 -1
  601. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/context.js +31 -53
  602. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/context.js.map +1 -1
  603. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork-policy.d.ts +21 -0
  604. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork-policy.d.ts.map +1 -0
  605. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork-policy.js +55 -0
  606. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork-policy.js.map +1 -0
  607. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.d.ts +16 -0
  608. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.d.ts.map +1 -0
  609. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.js +79 -0
  610. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.js.map +1 -0
  611. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/in-memory-storage-state.d.ts +39 -0
  612. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/in-memory-storage-state.d.ts.map +1 -0
  613. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/in-memory-storage-state.js +269 -0
  614. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/in-memory-storage-state.js.map +1 -0
  615. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/index.d.ts +9 -5
  616. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/index.d.ts.map +1 -1
  617. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/index.js +7 -4
  618. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/index.js.map +1 -1
  619. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/codec.d.ts +19 -8
  620. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/codec.d.ts.map +1 -1
  621. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/codec.js +34 -219
  622. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/codec.js.map +1 -1
  623. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/fork.d.ts +38 -0
  624. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/fork.d.ts.map +1 -0
  625. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/fork.js +266 -0
  626. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/fork.js.map +1 -0
  627. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/index.d.ts +4 -0
  628. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/index.d.ts.map +1 -0
  629. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/index.js +4 -0
  630. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/index.js.map +1 -0
  631. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/io.d.ts +14 -0
  632. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/io.d.ts.map +1 -0
  633. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/io.js +86 -0
  634. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/io.js.map +1 -0
  635. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/legacy-v3.d.ts +44 -0
  636. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/legacy-v3.d.ts.map +1 -0
  637. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/legacy-v3.js +454 -0
  638. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/legacy-v3.js.map +1 -0
  639. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/repo.d.ts +27 -24
  640. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/repo.d.ts.map +1 -1
  641. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/repo.js +276 -151
  642. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/repo.js.map +1 -1
  643. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/storage.d.ts +39 -41
  644. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/storage.d.ts.map +1 -1
  645. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/storage.js +175 -196
  646. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/storage.js.map +1 -1
  647. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/types.d.ts +23 -22
  648. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/types.d.ts.map +1 -1
  649. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/types.js +2 -1
  650. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/types.js.map +1 -1
  651. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory.d.ts +44 -40
  652. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory.d.ts.map +1 -1
  653. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory.js +333 -115
  654. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory.js.map +1 -1
  655. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/mutation-line.d.ts +8 -0
  656. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/mutation-line.d.ts.map +1 -0
  657. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/mutation-line.js +22 -0
  658. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/mutation-line.js.map +1 -0
  659. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.d.ts +78 -51
  660. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.d.ts.map +1 -1
  661. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.js +327 -207
  662. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.js.map +1 -1
  663. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/datasets.d.ts +12 -0
  664. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/datasets.d.ts.map +1 -0
  665. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/datasets.js +24 -0
  666. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/datasets.js.map +1 -0
  667. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/session-repo.d.ts +42 -0
  668. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/session-repo.d.ts.map +1 -0
  669. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/session-repo.js +127 -0
  670. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/session-repo.js.map +1 -0
  671. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/storage.d.ts +25 -0
  672. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/storage.d.ts.map +1 -0
  673. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/storage.js +114 -0
  674. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/storage.js.map +1 -0
  675. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance/session-repo.d.ts +23 -0
  676. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance/session-repo.d.ts.map +1 -0
  677. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance/session-repo.js +809 -0
  678. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance/session-repo.js.map +1 -0
  679. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance/storage.d.ts +4 -0
  680. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance/storage.d.ts.map +1 -0
  681. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance/storage.js +600 -0
  682. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance/storage.js.map +1 -0
  683. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/gating-storage.d.ts +26 -0
  684. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/gating-storage.d.ts.map +1 -0
  685. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/gating-storage.js +103 -0
  686. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/gating-storage.js.map +1 -0
  687. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/index.d.ts +9 -2
  688. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/index.d.ts.map +1 -1
  689. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/index.js +8 -1
  690. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/index.js.map +1 -1
  691. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/instrumented-storage.d.ts +11 -0
  692. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/instrumented-storage.d.ts.map +1 -0
  693. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/instrumented-storage.js +19 -0
  694. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/instrumented-storage.js.map +1 -0
  695. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/storage-decorator.d.ts +20 -0
  696. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/storage-decorator.d.ts.map +1 -0
  697. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/storage-decorator.js +40 -0
  698. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/storage-decorator.js.map +1 -0
  699. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/types.d.ts +5 -7
  700. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/types.d.ts.map +1 -1
  701. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/types.js.map +1 -1
  702. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/types.d.ts +425 -265
  703. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/types.d.ts.map +1 -1
  704. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/types.js +7 -7
  705. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/types.js.map +1 -1
  706. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/values.d.ts +95 -0
  707. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/values.d.ts.map +1 -0
  708. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/values.js +81 -0
  709. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/values.js.map +1 -0
  710. package/node_modules/@earendil-works/pi-agent-core/dist/harness/skills.d.ts +3 -2
  711. package/node_modules/@earendil-works/pi-agent-core/dist/harness/skills.d.ts.map +1 -1
  712. package/node_modules/@earendil-works/pi-agent-core/dist/harness/skills.js +29 -26
  713. package/node_modules/@earendil-works/pi-agent-core/dist/harness/skills.js.map +1 -1
  714. package/node_modules/@earendil-works/pi-agent-core/dist/harness/telemetry.d.ts +64 -43
  715. package/node_modules/@earendil-works/pi-agent-core/dist/harness/telemetry.d.ts.map +1 -1
  716. package/node_modules/@earendil-works/pi-agent-core/dist/harness/telemetry.js +45 -26
  717. package/node_modules/@earendil-works/pi-agent-core/dist/harness/telemetry.js.map +1 -1
  718. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/bash.d.ts +4 -4
  719. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/bash.d.ts.map +1 -1
  720. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/bash.js +66 -93
  721. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/bash.js.map +1 -1
  722. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/edit.d.ts.map +1 -1
  723. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/edit.js +17 -13
  724. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/edit.js.map +1 -1
  725. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/file-mutation-queue.d.ts +2 -1
  726. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/file-mutation-queue.d.ts.map +1 -1
  727. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/file-mutation-queue.js +5 -5
  728. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/file-mutation-queue.js.map +1 -1
  729. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/path-utils.d.ts +3 -2
  730. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/path-utils.d.ts.map +1 -1
  731. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/path-utils.js +5 -5
  732. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/path-utils.js.map +1 -1
  733. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/read.d.ts +2 -1
  734. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/read.d.ts.map +1 -1
  735. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/read.js +4 -6
  736. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/read.js.map +1 -1
  737. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/write.d.ts.map +1 -1
  738. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/write.js +12 -8
  739. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/write.js.map +1 -1
  740. package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.d.ts +128 -45
  741. package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.d.ts.map +1 -1
  742. package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.js.map +1 -1
  743. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/adaptive-publisher.d.ts +24 -0
  744. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/adaptive-publisher.d.ts.map +1 -0
  745. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/adaptive-publisher.js +79 -0
  746. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/adaptive-publisher.js.map +1 -0
  747. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/output-capture.d.ts +31 -0
  748. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/output-capture.d.ts.map +1 -0
  749. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/output-capture.js +217 -0
  750. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/output-capture.js.map +1 -0
  751. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.d.ts +19 -5
  752. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.d.ts.map +1 -1
  753. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.js +65 -192
  754. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.js.map +1 -1
  755. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/truncate.d.ts +1 -0
  756. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/truncate.d.ts.map +1 -1
  757. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/truncate.js +1 -1
  758. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/truncate.js.map +1 -1
  759. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/usage.d.ts +4 -0
  760. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/usage.d.ts.map +1 -0
  761. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/usage.js +33 -0
  762. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/usage.js.map +1 -0
  763. package/node_modules/@earendil-works/pi-agent-core/dist/index.d.ts +4 -1
  764. package/node_modules/@earendil-works/pi-agent-core/dist/index.d.ts.map +1 -1
  765. package/node_modules/@earendil-works/pi-agent-core/dist/index.js +3 -6
  766. package/node_modules/@earendil-works/pi-agent-core/dist/index.js.map +1 -1
  767. package/node_modules/@earendil-works/pi-agent-core/dist/search/index.d.ts +24 -16
  768. package/node_modules/@earendil-works/pi-agent-core/dist/search/index.d.ts.map +1 -1
  769. package/node_modules/@earendil-works/pi-agent-core/dist/search/index.js +1 -1
  770. package/node_modules/@earendil-works/pi-agent-core/dist/search/index.js.map +1 -1
  771. package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts +2 -0
  772. package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts.map +1 -1
  773. package/node_modules/@earendil-works/pi-agent-core/dist/types.js.map +1 -1
  774. package/node_modules/@earendil-works/pi-agent-core/package.json +27 -6
  775. package/node_modules/@earendil-works/pi-ai/README.md +39 -4
  776. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.d.ts.map +1 -1
  777. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +8 -1
  778. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js.map +1 -1
  779. package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-ai-binding.d.ts +77 -0
  780. package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-ai-binding.d.ts.map +1 -0
  781. package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-ai-binding.js +72 -0
  782. package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-ai-binding.js.map +1 -0
  783. package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js +4 -1
  784. package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js.map +1 -1
  785. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.d.ts.map +1 -1
  786. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js +6 -3
  787. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js.map +1 -1
  788. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.d.ts.map +1 -1
  789. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js +4 -1
  790. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js.map +1 -1
  791. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.d.ts.map +1 -1
  792. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js +13 -3
  793. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js.map +1 -1
  794. package/node_modules/@earendil-works/pi-ai/dist/index.d.ts +1 -0
  795. package/node_modules/@earendil-works/pi-ai/dist/index.d.ts.map +1 -1
  796. package/node_modules/@earendil-works/pi-ai/dist/index.js +1 -0
  797. package/node_modules/@earendil-works/pi-ai/dist/index.js.map +1 -1
  798. package/node_modules/@earendil-works/pi-ai/dist/models.d.ts +1 -0
  799. package/node_modules/@earendil-works/pi-ai/dist/models.d.ts.map +1 -1
  800. package/node_modules/@earendil-works/pi-ai/dist/models.js +5 -2
  801. package/node_modules/@earendil-works/pi-ai/dist/models.js.map +1 -1
  802. package/node_modules/@earendil-works/pi-ai/dist/openai-responses-compat.d.ts +1 -1
  803. package/node_modules/@earendil-works/pi-ai/dist/openai-responses-compat.d.ts.map +1 -1
  804. package/node_modules/@earendil-works/pi-ai/dist/openai-responses-compat.js.map +1 -1
  805. package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.d.ts.map +1 -1
  806. package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.js +4 -0
  807. package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.js.map +1 -1
  808. package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
  809. package/node_modules/@earendil-works/pi-ai/dist/providers/data/azure-openai-responses.json +1 -1
  810. package/node_modules/@earendil-works/pi-ai/dist/providers/data/baseten.json +1 -1
  811. package/node_modules/@earendil-works/pi-ai/dist/providers/data/deepseek.json +1 -1
  812. package/node_modules/@earendil-works/pi-ai/dist/providers/data/fireworks.json +1 -1
  813. package/node_modules/@earendil-works/pi-ai/dist/providers/data/github-copilot.json +1 -1
  814. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai-codex.json +1 -1
  815. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
  816. package/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan-cn.json +1 -1
  817. package/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan-individual.json +1 -1
  818. package/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan.json +1 -1
  819. package/node_modules/@earendil-works/pi-ai/dist/providers/data/xai.json +1 -1
  820. package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js +5 -5
  821. package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js.map +1 -1
  822. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.d.ts.map +1 -1
  823. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.js +4 -3
  824. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.js.map +1 -1
  825. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-headers.d.ts +4 -0
  826. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-headers.d.ts.map +1 -0
  827. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-headers.js +22 -0
  828. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-headers.js.map +1 -0
  829. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode.d.ts.map +1 -1
  830. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode.js +5 -4
  831. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode.js.map +1 -1
  832. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +16 -6
  833. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
  834. package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -1
  835. package/node_modules/@earendil-works/pi-ai/dist/utils/assistant-message-frame.d.ts +77 -0
  836. package/node_modules/@earendil-works/pi-ai/dist/utils/assistant-message-frame.d.ts.map +1 -0
  837. package/node_modules/@earendil-works/pi-ai/dist/utils/assistant-message-frame.js +427 -0
  838. package/node_modules/@earendil-works/pi-ai/dist/utils/assistant-message-frame.js.map +1 -0
  839. package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.d.ts.map +1 -1
  840. package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js +25 -5
  841. package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js.map +1 -1
  842. package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.d.ts +1 -1
  843. package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.d.ts.map +1 -1
  844. package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.js +5 -1
  845. package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.js.map +1 -1
  846. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/types.d.ts +10 -1
  847. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/types.d.ts.map +1 -1
  848. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/types.js.map +1 -1
  849. package/node_modules/@earendil-works/pi-ai/dist/utils/retry.d.ts +13 -2
  850. package/node_modules/@earendil-works/pi-ai/dist/utils/retry.d.ts.map +1 -1
  851. package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +18 -7
  852. package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js.map +1 -1
  853. package/node_modules/@earendil-works/pi-ai/dist/utils/uuid.d.ts +2 -2
  854. package/node_modules/@earendil-works/pi-ai/dist/utils/uuid.d.ts.map +1 -1
  855. package/node_modules/@earendil-works/pi-ai/dist/utils/uuid.js +36 -31
  856. package/node_modules/@earendil-works/pi-ai/dist/utils/uuid.js.map +1 -1
  857. package/node_modules/@earendil-works/pi-ai/package.json +6 -6
  858. package/node_modules/@earendil-works/pi-pty/package.json +1 -1
  859. package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
  860. package/node_modules/@earendil-works/pi-tui/README.md +53 -4
  861. package/node_modules/@earendil-works/pi-tui/dist/alt-screen-search.d.ts +21 -1
  862. package/node_modules/@earendil-works/pi-tui/dist/alt-screen-search.d.ts.map +1 -1
  863. package/node_modules/@earendil-works/pi-tui/dist/alt-screen-search.js +199 -42
  864. package/node_modules/@earendil-works/pi-tui/dist/alt-screen-search.js.map +1 -1
  865. package/node_modules/@earendil-works/pi-tui/dist/components/box.d.ts +3 -1
  866. package/node_modules/@earendil-works/pi-tui/dist/components/box.d.ts.map +1 -1
  867. package/node_modules/@earendil-works/pi-tui/dist/components/box.js +28 -0
  868. package/node_modules/@earendil-works/pi-tui/dist/components/box.js.map +1 -1
  869. package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts +6 -1
  870. package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts.map +1 -1
  871. package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +98 -18
  872. package/node_modules/@earendil-works/pi-tui/dist/components/editor.js.map +1 -1
  873. package/node_modules/@earendil-works/pi-tui/dist/components/input.d.ts +12 -1
  874. package/node_modules/@earendil-works/pi-tui/dist/components/input.d.ts.map +1 -1
  875. package/node_modules/@earendil-works/pi-tui/dist/components/input.js +40 -6
  876. package/node_modules/@earendil-works/pi-tui/dist/components/input.js.map +1 -1
  877. package/node_modules/@earendil-works/pi-tui/dist/components/latex.d.ts.map +1 -1
  878. package/node_modules/@earendil-works/pi-tui/dist/components/latex.js +7 -0
  879. package/node_modules/@earendil-works/pi-tui/dist/components/latex.js.map +1 -1
  880. package/node_modules/@earendil-works/pi-tui/dist/components/loader.d.ts +3 -0
  881. package/node_modules/@earendil-works/pi-tui/dist/components/loader.d.ts.map +1 -1
  882. package/node_modules/@earendil-works/pi-tui/dist/components/loader.js +20 -8
  883. package/node_modules/@earendil-works/pi-tui/dist/components/loader.js.map +1 -1
  884. package/node_modules/@earendil-works/pi-tui/dist/components/mouse-region.d.ts +12 -0
  885. package/node_modules/@earendil-works/pi-tui/dist/components/mouse-region.d.ts.map +1 -0
  886. package/node_modules/@earendil-works/pi-tui/dist/components/mouse-region.js +19 -0
  887. package/node_modules/@earendil-works/pi-tui/dist/components/mouse-region.js.map +1 -0
  888. package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.d.ts +6 -3
  889. package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.d.ts.map +1 -1
  890. package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.js +6 -1
  891. package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.js.map +1 -1
  892. package/node_modules/@earendil-works/pi-tui/dist/components/select-list.d.ts +4 -1
  893. package/node_modules/@earendil-works/pi-tui/dist/components/select-list.d.ts.map +1 -1
  894. package/node_modules/@earendil-works/pi-tui/dist/components/select-list.js +48 -2
  895. package/node_modules/@earendil-works/pi-tui/dist/components/select-list.js.map +1 -1
  896. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts +5 -1
  897. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts.map +1 -1
  898. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js +54 -5
  899. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js.map +1 -1
  900. package/node_modules/@earendil-works/pi-tui/dist/index.d.ts +3 -1
  901. package/node_modules/@earendil-works/pi-tui/dist/index.d.ts.map +1 -1
  902. package/node_modules/@earendil-works/pi-tui/dist/index.js +3 -0
  903. package/node_modules/@earendil-works/pi-tui/dist/index.js.map +1 -1
  904. package/node_modules/@earendil-works/pi-tui/dist/layout.d.ts +3 -1
  905. package/node_modules/@earendil-works/pi-tui/dist/layout.d.ts.map +1 -1
  906. package/node_modules/@earendil-works/pi-tui/dist/layout.js +32 -9
  907. package/node_modules/@earendil-works/pi-tui/dist/layout.js.map +1 -1
  908. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.d.ts +2 -1
  909. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.d.ts.map +1 -1
  910. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js +3 -44
  911. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js.map +1 -1
  912. package/node_modules/@earendil-works/pi-tui/dist/native-platform.d.ts +18 -0
  913. package/node_modules/@earendil-works/pi-tui/dist/native-platform.d.ts.map +1 -0
  914. package/node_modules/@earendil-works/pi-tui/dist/native-platform.js +42 -0
  915. package/node_modules/@earendil-works/pi-tui/dist/native-platform.js.map +1 -0
  916. package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts.map +1 -1
  917. package/node_modules/@earendil-works/pi-tui/dist/terminal.js +2 -20
  918. package/node_modules/@earendil-works/pi-tui/dist/terminal.js.map +1 -1
  919. package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.d.ts +31 -1
  920. package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.d.ts.map +1 -1
  921. package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.js +335 -41
  922. package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.js.map +1 -1
  923. package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts +83 -5
  924. package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts.map +1 -1
  925. package/node_modules/@earendil-works/pi-tui/dist/tui.js +118 -4
  926. package/node_modules/@earendil-works/pi-tui/dist/tui.js.map +1 -1
  927. package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts +2 -0
  928. package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts.map +1 -1
  929. package/node_modules/@earendil-works/pi-tui/dist/utils.js +9 -0
  930. package/node_modules/@earendil-works/pi-tui/dist/utils.js.map +1 -1
  931. package/node_modules/@earendil-works/pi-tui/native/clipboard.h +170 -0
  932. package/node_modules/@earendil-works/pi-tui/native/darwin/README.md +8 -6
  933. package/node_modules/@earendil-works/pi-tui/native/darwin/build.sh +12 -5
  934. package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-arm64/{darwin-modifiers.node → darwin-platform.node} +0 -0
  935. package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-x64/{darwin-modifiers.node → darwin-platform.node} +0 -0
  936. package/node_modules/@earendil-works/pi-tui/native/darwin/src/darwin-platform.m +93 -0
  937. package/node_modules/@earendil-works/pi-tui/native/linux/README.md +23 -0
  938. package/node_modules/@earendil-works/pi-tui/native/linux/build.sh +65 -0
  939. package/node_modules/@earendil-works/pi-tui/native/linux/prebuilds/linux-arm64/linux-platform-x11.node +0 -0
  940. package/node_modules/@earendil-works/pi-tui/native/linux/prebuilds/linux-x64/linux-platform-x11.node +0 -0
  941. package/node_modules/@earendil-works/pi-tui/native/linux/src/clipboard-worker.h +70 -0
  942. package/node_modules/@earendil-works/pi-tui/native/linux/src/linux-platform-x11.c +274 -0
  943. package/node_modules/@earendil-works/pi-tui/native/napi.h +89 -0
  944. package/node_modules/@earendil-works/pi-tui/native/win32/README.md +18 -7
  945. package/node_modules/@earendil-works/pi-tui/native/win32/build.mjs +7 -4
  946. package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-arm64/win32-platform.node +0 -0
  947. package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-x64/win32-platform.node +0 -0
  948. package/node_modules/@earendil-works/pi-tui/native/win32/src/win32-platform.c +241 -0
  949. package/node_modules/@earendil-works/pi-tui/package.json +10 -3
  950. package/node_modules/@google/genai/dist/genai.d.ts +1799 -289
  951. package/node_modules/@google/genai/dist/index.cjs +319 -299
  952. package/node_modules/@google/genai/dist/index.mjs +319 -299
  953. package/node_modules/@google/genai/dist/index.mjs.map +1 -1
  954. package/node_modules/@google/genai/dist/node/index.cjs +320 -300
  955. package/node_modules/@google/genai/dist/node/index.mjs +320 -300
  956. package/node_modules/@google/genai/dist/node/index.mjs.map +1 -1
  957. package/node_modules/@google/genai/dist/node/node.d.ts +1799 -289
  958. package/node_modules/@google/genai/dist/tokenizer/node.cjs +49 -2
  959. package/node_modules/@google/genai/dist/tokenizer/node.d.ts +43 -3
  960. package/node_modules/@google/genai/dist/tokenizer/node.mjs +49 -2
  961. package/node_modules/@google/genai/dist/tokenizer/node.mjs.map +1 -1
  962. package/node_modules/@google/genai/dist/vertex_internal/index.cjs +39 -3
  963. package/node_modules/@google/genai/dist/vertex_internal/index.cjs.map +1 -1
  964. package/node_modules/@google/genai/dist/vertex_internal/index.d.ts +51 -9
  965. package/node_modules/@google/genai/dist/vertex_internal/index.js +39 -3
  966. package/node_modules/@google/genai/dist/vertex_internal/index.js.map +1 -1
  967. package/node_modules/@google/genai/dist/web/index.mjs +319 -299
  968. package/node_modules/@google/genai/dist/web/index.mjs.map +1 -1
  969. package/node_modules/@google/genai/dist/web/web.d.ts +1799 -289
  970. package/node_modules/@google/genai/package.json +1 -1
  971. package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +11 -4
  972. package/node_modules/@smithy/node-http-handler/dist-es/http2/ClientHttp2SessionRef.js +1 -0
  973. package/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js +2 -3
  974. package/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +8 -1
  975. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/LICENSE +201 -0
  976. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/README.md +115 -0
  977. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-cjs/index.js +96 -0
  978. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/abort-handler.js +1 -0
  979. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/abort.js +1 -0
  980. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/auth/HttpApiKeyAuth.js +5 -0
  981. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/auth/HttpAuthScheme.js +1 -0
  982. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/auth/HttpAuthSchemeProvider.js +1 -0
  983. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/auth/HttpSigner.js +1 -0
  984. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/auth/IdentityProviderConfig.js +1 -0
  985. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/auth/auth.js +5 -0
  986. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/auth/index.js +2 -0
  987. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/blob/blob-payload-input-types.js +1 -0
  988. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/checksum.js +1 -0
  989. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/client.js +1 -0
  990. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/command.js +1 -0
  991. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/connection/config.js +1 -0
  992. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/connection/index.js +1 -0
  993. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/connection/manager.js +1 -0
  994. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/connection/pool.js +1 -0
  995. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/crypto.js +1 -0
  996. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/downlevel-ts3.4/transform/type-transform.js +1 -0
  997. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/encode.js +1 -0
  998. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/endpoint.js +5 -0
  999. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/endpoints/EndpointParameterInstructions.js +1 -0
  1000. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/endpoints/EndpointRuleObject.js +1 -0
  1001. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/endpoints/ErrorRuleObject.js +1 -0
  1002. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/endpoints/RuleSetObject.js +1 -0
  1003. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/endpoints/TreeRuleObject.js +1 -0
  1004. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/endpoints/index.js +1 -0
  1005. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/endpoints/shared.js +1 -0
  1006. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/eventStream.js +1 -0
  1007. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/extensions/checksum.js +38 -0
  1008. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/extensions/defaultClientConfiguration.js +7 -0
  1009. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/extensions/defaultExtensionConfiguration.js +1 -0
  1010. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/extensions/index.js +2 -0
  1011. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/extensions/retry.js +1 -0
  1012. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/externals-check/browser-externals-check.js +1 -0
  1013. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/feature-ids.js +1 -0
  1014. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/http/httpHandlerInitialization.js +1 -0
  1015. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/http.js +5 -0
  1016. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/identity/apiKeyIdentity.js +1 -0
  1017. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/identity/awsCredentialIdentity.js +1 -0
  1018. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/identity/identity.js +1 -0
  1019. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/identity/index.js +1 -0
  1020. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/identity/tokenIdentity.js +1 -0
  1021. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/index.js +7 -0
  1022. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/logger.js +1 -0
  1023. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/metrics.js +1 -0
  1024. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/middleware.js +1 -0
  1025. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/pagination.js +1 -0
  1026. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/profile.js +6 -0
  1027. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/response.js +1 -0
  1028. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/retry.js +1 -0
  1029. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/schema/schema-deprecated.js +1 -0
  1030. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/schema/schema.js +1 -0
  1031. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/schema/sentinels.js +1 -0
  1032. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/schema/static-schemas.js +1 -0
  1033. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/schema/traits.js +1 -0
  1034. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/serde.js +1 -0
  1035. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/shapes.js +1 -0
  1036. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/signature.js +1 -0
  1037. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/stream.js +1 -0
  1038. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-common-types.js +1 -0
  1039. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-payload-input-types.js +1 -0
  1040. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-payload-output-types.js +1 -0
  1041. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/transfer.js +6 -0
  1042. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/transform/client-method-transforms.js +1 -0
  1043. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/transform/client-payload-blob-type-narrow.js +1 -0
  1044. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/transform/exact.js +1 -0
  1045. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/transform/mutable.js +1 -0
  1046. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/transform/no-undefined.js +1 -0
  1047. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/transform/type-transform.js +1 -0
  1048. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/uri.js +1 -0
  1049. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/util.js +1 -0
  1050. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/waiter.js +1 -0
  1051. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/abort-handler.d.ts +7 -0
  1052. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/abort.d.ts +48 -0
  1053. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/auth/HttpApiKeyAuth.d.ts +7 -0
  1054. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/auth/HttpAuthScheme.d.ts +49 -0
  1055. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/auth/HttpAuthSchemeProvider.d.ts +20 -0
  1056. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/auth/HttpSigner.d.ts +41 -0
  1057. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/auth/IdentityProviderConfig.d.ts +14 -0
  1058. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/auth/auth.d.ts +59 -0
  1059. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/auth/index.d.ts +7 -0
  1060. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/blob/blob-payload-input-types.d.ts +37 -0
  1061. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/checksum.d.ts +61 -0
  1062. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/client.d.ts +57 -0
  1063. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/command.d.ts +28 -0
  1064. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/connection/config.d.ts +15 -0
  1065. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/connection/index.d.ts +3 -0
  1066. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/connection/manager.d.ts +34 -0
  1067. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/connection/pool.d.ts +32 -0
  1068. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/crypto.d.ts +58 -0
  1069. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/downlevel-ts3.4/transform/type-transform.d.ts +24 -0
  1070. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/encode.d.ts +31 -0
  1071. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/endpoint.d.ts +77 -0
  1072. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/endpoints/EndpointParameterInstructions.d.ts +41 -0
  1073. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/endpoints/EndpointRuleObject.d.ts +27 -0
  1074. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/endpoints/ErrorRuleObject.d.ts +10 -0
  1075. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/endpoints/RuleSetObject.d.ts +28 -0
  1076. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/endpoints/TreeRuleObject.d.ts +16 -0
  1077. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/endpoints/index.d.ts +5 -0
  1078. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/endpoints/shared.d.ts +55 -0
  1079. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/eventStream.d.ts +137 -0
  1080. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/extensions/checksum.d.ts +58 -0
  1081. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/extensions/defaultClientConfiguration.d.ts +32 -0
  1082. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/extensions/defaultExtensionConfiguration.d.ts +9 -0
  1083. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/extensions/index.d.ts +6 -0
  1084. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/extensions/retry.d.ts +18 -0
  1085. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/externals-check/browser-externals-check.d.ts +35 -0
  1086. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/feature-ids.d.ts +16 -0
  1087. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/http/httpHandlerInitialization.d.ts +142 -0
  1088. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/http.d.ts +110 -0
  1089. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/identity/apiKeyIdentity.d.ts +14 -0
  1090. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/identity/awsCredentialIdentity.d.ts +31 -0
  1091. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/identity/identity.d.ts +15 -0
  1092. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/identity/index.d.ts +4 -0
  1093. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/identity/tokenIdentity.d.ts +14 -0
  1094. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/index.d.ts +52 -0
  1095. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/logger.d.ts +13 -0
  1096. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/metrics.d.ts +93 -0
  1097. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/middleware.d.ts +541 -0
  1098. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/pagination.d.ts +33 -0
  1099. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/profile.d.ts +30 -0
  1100. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/response.d.ts +40 -0
  1101. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/retry.d.ts +162 -0
  1102. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/schema/schema-deprecated.d.ts +143 -0
  1103. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/schema/schema.d.ts +236 -0
  1104. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/schema/sentinels.d.ts +65 -0
  1105. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/schema/static-schemas.d.ts +99 -0
  1106. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/schema/traits.d.ts +46 -0
  1107. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/serde.d.ts +114 -0
  1108. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/shapes.d.ts +79 -0
  1109. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/signature.d.ts +172 -0
  1110. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/stream.d.ts +22 -0
  1111. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/streaming-payload/streaming-blob-common-types.d.ts +28 -0
  1112. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/streaming-payload/streaming-blob-payload-input-types.d.ts +54 -0
  1113. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/streaming-payload/streaming-blob-payload-output-types.d.ts +41 -0
  1114. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/transfer.d.ts +42 -0
  1115. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/transform/client-method-transforms.d.ts +26 -0
  1116. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/transform/client-payload-blob-type-narrow.d.ts +73 -0
  1117. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/transform/exact.d.ts +6 -0
  1118. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/transform/mutable.d.ts +6 -0
  1119. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/transform/no-undefined.d.ts +68 -0
  1120. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/transform/type-transform.d.ts +39 -0
  1121. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/abort-handler.d.ts +7 -0
  1122. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/abort.d.ts +45 -0
  1123. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/auth/HttpApiKeyAuth.d.ts +7 -0
  1124. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/auth/HttpAuthScheme.d.ts +49 -0
  1125. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/auth/HttpAuthSchemeProvider.d.ts +20 -0
  1126. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/auth/HttpSigner.d.ts +41 -0
  1127. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/auth/IdentityProviderConfig.d.ts +14 -0
  1128. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/auth/auth.d.ts +59 -0
  1129. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/auth/index.d.ts +7 -0
  1130. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/blob/blob-payload-input-types.d.ts +37 -0
  1131. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/checksum.d.ts +61 -0
  1132. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/client.d.ts +57 -0
  1133. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/command.d.ts +28 -0
  1134. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/connection/config.d.ts +15 -0
  1135. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/connection/index.d.ts +3 -0
  1136. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/connection/manager.d.ts +34 -0
  1137. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/connection/pool.d.ts +32 -0
  1138. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/crypto.d.ts +58 -0
  1139. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/downlevel-ts3.4/transform/type-transform.d.ts +40 -0
  1140. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/encode.d.ts +31 -0
  1141. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/endpoint.d.ts +77 -0
  1142. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/endpoints/EndpointParameterInstructions.d.ts +41 -0
  1143. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/endpoints/EndpointRuleObject.d.ts +27 -0
  1144. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/endpoints/ErrorRuleObject.d.ts +10 -0
  1145. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/endpoints/RuleSetObject.d.ts +28 -0
  1146. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/endpoints/TreeRuleObject.d.ts +16 -0
  1147. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/endpoints/index.d.ts +5 -0
  1148. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/endpoints/shared.d.ts +55 -0
  1149. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/eventStream.d.ts +137 -0
  1150. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/extensions/checksum.d.ts +58 -0
  1151. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/extensions/defaultClientConfiguration.d.ts +32 -0
  1152. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/extensions/defaultExtensionConfiguration.d.ts +9 -0
  1153. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/extensions/index.d.ts +6 -0
  1154. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/extensions/retry.d.ts +18 -0
  1155. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/externals-check/browser-externals-check.d.ts +35 -0
  1156. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/feature-ids.d.ts +16 -0
  1157. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/http/httpHandlerInitialization.d.ts +142 -0
  1158. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/http.d.ts +110 -0
  1159. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/identity/apiKeyIdentity.d.ts +14 -0
  1160. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/identity/awsCredentialIdentity.d.ts +31 -0
  1161. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/identity/identity.d.ts +15 -0
  1162. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/identity/index.d.ts +4 -0
  1163. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/identity/tokenIdentity.d.ts +14 -0
  1164. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/index.d.ts +52 -0
  1165. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/logger.d.ts +13 -0
  1166. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/metrics.d.ts +93 -0
  1167. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/middleware.d.ts +541 -0
  1168. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/pagination.d.ts +33 -0
  1169. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/profile.d.ts +30 -0
  1170. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/response.d.ts +40 -0
  1171. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/retry.d.ts +162 -0
  1172. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/schema/schema-deprecated.d.ts +149 -0
  1173. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/schema/schema.d.ts +251 -0
  1174. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/schema/sentinels.d.ts +65 -0
  1175. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/schema/static-schemas.d.ts +118 -0
  1176. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/schema/traits.d.ts +46 -0
  1177. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/serde.d.ts +114 -0
  1178. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/shapes.d.ts +79 -0
  1179. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/signature.d.ts +172 -0
  1180. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/stream.d.ts +22 -0
  1181. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/streaming-payload/streaming-blob-common-types.d.ts +28 -0
  1182. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/streaming-payload/streaming-blob-payload-input-types.d.ts +54 -0
  1183. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/streaming-payload/streaming-blob-payload-output-types.d.ts +41 -0
  1184. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/transfer.d.ts +42 -0
  1185. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/transform/client-method-transforms.d.ts +26 -0
  1186. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/transform/client-payload-blob-type-narrow.d.ts +77 -0
  1187. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/transform/exact.d.ts +14 -0
  1188. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/transform/mutable.d.ts +6 -0
  1189. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/transform/no-undefined.d.ts +88 -0
  1190. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/transform/type-transform.d.ts +40 -0
  1191. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/uri.d.ts +17 -0
  1192. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/util.d.ts +192 -0
  1193. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/waiter.d.ts +35 -0
  1194. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/uri.d.ts +17 -0
  1195. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/util.d.ts +176 -0
  1196. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/waiter.d.ts +35 -0
  1197. package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/package.json +50 -0
  1198. package/node_modules/@smithy/node-http-handler/package.json +2 -2
  1199. package/node_modules/esbuild/LICENSE.md +21 -0
  1200. package/node_modules/esbuild/README.md +3 -0
  1201. package/node_modules/esbuild/bin/esbuild +223 -0
  1202. package/node_modules/esbuild/install.js +300 -0
  1203. package/node_modules/esbuild/lib/main.d.ts +720 -0
  1204. package/node_modules/esbuild/lib/main.js +2536 -0
  1205. package/node_modules/esbuild/package.json +47 -0
  1206. package/node_modules/ignore/README.md +52 -0
  1207. package/node_modules/ignore/index.js +785 -129
  1208. package/node_modules/ignore/legacy.js +660 -98
  1209. package/node_modules/ignore/package.json +10 -4
  1210. package/node_modules/marked/README.md +1 -0
  1211. package/node_modules/marked/lib/marked.d.ts +7 -0
  1212. package/node_modules/marked/lib/marked.esm.js +30 -30
  1213. package/node_modules/marked/lib/marked.esm.js.map +3 -3
  1214. package/node_modules/marked/lib/marked.umd.js +30 -30
  1215. package/node_modules/marked/lib/marked.umd.js.map +3 -3
  1216. package/node_modules/marked/man/marked.1 +1 -1
  1217. package/node_modules/marked/package.json +2 -2
  1218. package/node_modules/typebox/build/compile/validator.d.mts +1 -1
  1219. package/node_modules/typebox/build/compile/validator.mjs +1 -1
  1220. package/node_modules/typebox/build/format/idna/idn-hostname.mjs +7 -5
  1221. package/node_modules/typebox/build/format/iri.mjs +5 -1
  1222. package/node_modules/typebox/build/guard/emit.mjs +2 -4
  1223. package/node_modules/typebox/build/guard/guard.mjs +6 -18
  1224. package/node_modules/typebox/build/guard/string.mjs +16 -24
  1225. package/node_modules/typebox/build/schema/compile.d.mts +3 -2
  1226. package/node_modules/typebox/build/schema/compile.mjs +8 -8
  1227. package/node_modules/typebox/build/schema/engine/_context.d.mts +1 -6
  1228. package/node_modules/typebox/build/schema/engine/_context.mjs +9 -14
  1229. package/node_modules/typebox/build/schema/engine/_functions.mjs +1 -1
  1230. package/node_modules/typebox/build/schema/engine/_stack.d.mts +6 -2
  1231. package/node_modules/typebox/build/schema/engine/_stack.mjs +135 -32
  1232. package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +16 -4
  1233. package/node_modules/typebox/build/schema/engine/allOf.mjs +2 -2
  1234. package/node_modules/typebox/build/schema/engine/anyOf.mjs +2 -2
  1235. package/node_modules/typebox/build/schema/engine/if.mjs +2 -2
  1236. package/node_modules/typebox/build/schema/engine/oneOf.mjs +2 -2
  1237. package/node_modules/typebox/build/schema/engine/propertyNames.mjs +1 -3
  1238. package/node_modules/typebox/build/schema/engine/ref.mjs +2 -2
  1239. package/node_modules/typebox/build/schema/engine/schema.mjs +6 -0
  1240. package/node_modules/typebox/build/schema/engine/unevaluatedItems.mjs +2 -2
  1241. package/node_modules/typebox/build/schema/engine/unevaluatedProperties.mjs +2 -2
  1242. package/node_modules/typebox/build/schema/errors.d.mts +2 -2
  1243. package/node_modules/typebox/build/schema/errors.mjs +7 -13
  1244. package/node_modules/typebox/build/schema/intern/index.d.mts +1 -0
  1245. package/node_modules/typebox/build/schema/intern/index.mjs +1 -0
  1246. package/node_modules/typebox/build/schema/intern/intern.d.mts +14 -0
  1247. package/node_modules/typebox/build/schema/intern/intern.mjs +259 -0
  1248. package/node_modules/typebox/build/schema/parse.d.mts +1 -0
  1249. package/node_modules/typebox/build/schema/parse.mjs +10 -5
  1250. package/node_modules/typebox/build/schema/resolve/resolve.d.mts +34 -3
  1251. package/node_modules/typebox/build/schema/resolve/resolve.mjs +198 -73
  1252. package/node_modules/typebox/build/schema/schema.d.mts +1 -0
  1253. package/node_modules/typebox/build/schema/schema.mjs +1 -0
  1254. package/node_modules/typebox/build/value/errors/errors.d.mts +2 -12
  1255. package/node_modules/typebox/build/value/errors/errors.mjs +2 -7
  1256. package/node_modules/typebox/package.json +1 -1
  1257. package/node_modules/typebox/readme.md +9 -5
  1258. package/node_modules/undici/docs/docs/api/Client.md +4 -0
  1259. package/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +3 -2
  1260. package/node_modules/undici/docs/docs/api/EventSource.md +4 -0
  1261. package/node_modules/undici/docs/docs/api/Interceptors.md +7 -3
  1262. package/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +7 -1
  1263. package/node_modules/undici/lib/cache/memory-cache-store.js +2 -2
  1264. package/node_modules/undici/lib/core/symbols.js +2 -0
  1265. package/node_modules/undici/lib/dispatcher/agent.js +7 -2
  1266. package/node_modules/undici/lib/dispatcher/balanced-pool.js +7 -4
  1267. package/node_modules/undici/lib/dispatcher/client-h1.js +12 -4
  1268. package/node_modules/undici/lib/dispatcher/client-h2.js +43 -3
  1269. package/node_modules/undici/lib/dispatcher/client.js +3 -2
  1270. package/node_modules/undici/lib/dispatcher/dispatcher-base.js +13 -1
  1271. package/node_modules/undici/lib/dispatcher/dispatcher.js +15 -1
  1272. package/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +3 -0
  1273. package/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +10 -3
  1274. package/node_modules/undici/lib/dispatcher/proxy-agent.js +18 -1
  1275. package/node_modules/undici/lib/dispatcher/retry-agent.js +3 -0
  1276. package/node_modules/undici/lib/dispatcher/round-robin-pool.js +1 -1
  1277. package/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +91 -21
  1278. package/node_modules/undici/lib/handler/cache-handler.js +29 -5
  1279. package/node_modules/undici/lib/handler/decorator-handler.js +7 -1
  1280. package/node_modules/undici/lib/handler/deduplication-handler.js +12 -6
  1281. package/node_modules/undici/lib/handler/redirect-handler.js +21 -4
  1282. package/node_modules/undici/lib/handler/retry-handler.js +148 -30
  1283. package/node_modules/undici/lib/interceptor/cache.js +65 -12
  1284. package/node_modules/undici/lib/interceptor/decompress.js +115 -13
  1285. package/node_modules/undici/lib/interceptor/deduplicate.js +5 -4
  1286. package/node_modules/undici/lib/interceptor/dns.js +7 -0
  1287. package/node_modules/undici/lib/interceptor/dump.js +10 -23
  1288. package/node_modules/undici/lib/mock/mock-agent.js +13 -1
  1289. package/node_modules/undici/lib/mock/mock-utils.js +11 -10
  1290. package/node_modules/undici/lib/util/cache.js +45 -3
  1291. package/node_modules/undici/lib/web/cookies/parse.js +150 -147
  1292. package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +28 -1
  1293. package/node_modules/undici/lib/web/eventsource/eventsource.js +13 -3
  1294. package/node_modules/undici/lib/web/fetch/index.js +6 -0
  1295. package/node_modules/undici/lib/web/fetch/request.js +2 -3
  1296. package/node_modules/undici/lib/web/fetch/util.js +6 -1
  1297. package/node_modules/undici/lib/web/webidl/index.js +3 -3
  1298. package/node_modules/undici/lib/web/websocket/connection.js +1 -1
  1299. package/node_modules/undici/lib/web/websocket/permessage-deflate.js +5 -0
  1300. package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +8 -10
  1301. package/node_modules/undici/package.json +3 -3
  1302. package/node_modules/undici/types/client.d.ts +10 -0
  1303. package/node_modules/undici/types/interceptors.d.ts +2 -0
  1304. package/node_modules/undici/types/mock-agent.d.ts +11 -10
  1305. package/node_modules/undici/types/socks5-proxy-agent.d.ts +2 -0
  1306. package/package.json +70 -49
  1307. package/vendor/pi-client/client.d.ts +20 -15
  1308. package/vendor/pi-client/client.d.ts.map +1 -1
  1309. package/vendor/pi-client/client.js +248 -245
  1310. package/vendor/pi-client/client.js.map +1 -1
  1311. package/vendor/pi-client/connection.d.ts +4 -3
  1312. package/vendor/pi-client/connection.d.ts.map +1 -1
  1313. package/vendor/pi-client/connection.js +13 -9
  1314. package/vendor/pi-client/connection.js.map +1 -1
  1315. package/vendor/pi-client/errors.d.ts +6 -15
  1316. package/vendor/pi-client/errors.d.ts.map +1 -1
  1317. package/vendor/pi-client/errors.js +10 -25
  1318. package/vendor/pi-client/errors.js.map +1 -1
  1319. package/vendor/pi-client/index.d.ts +3 -4
  1320. package/vendor/pi-client/index.d.ts.map +1 -1
  1321. package/vendor/pi-client/index.js +2 -2
  1322. package/vendor/pi-client/index.js.map +1 -1
  1323. package/vendor/pi-client/types.d.ts +14 -8
  1324. package/vendor/pi-client/types.d.ts.map +1 -1
  1325. package/vendor/pi-client/types.js.map +1 -1
  1326. package/vendor/pi-client/unix.d.ts +14 -1
  1327. package/vendor/pi-client/unix.d.ts.map +1 -1
  1328. package/vendor/pi-client/unix.js +138 -8
  1329. package/vendor/pi-client/unix.js.map +1 -1
  1330. package/vendor/pi-protocol/codec.d.ts +2 -4
  1331. package/vendor/pi-protocol/codec.d.ts.map +1 -1
  1332. package/vendor/pi-protocol/codec.js +7 -34
  1333. package/vendor/pi-protocol/codec.js.map +1 -1
  1334. package/vendor/pi-protocol/framing.d.ts +0 -2
  1335. package/vendor/pi-protocol/framing.d.ts.map +1 -1
  1336. package/vendor/pi-protocol/framing.js +0 -15
  1337. package/vendor/pi-protocol/framing.js.map +1 -1
  1338. package/vendor/pi-protocol/index.d.ts +1 -1
  1339. package/vendor/pi-protocol/index.d.ts.map +1 -1
  1340. package/vendor/pi-protocol/index.js +1 -1
  1341. package/vendor/pi-protocol/index.js.map +1 -1
  1342. package/vendor/pi-protocol/protocol.d.ts +167 -0
  1343. package/vendor/pi-protocol/protocol.d.ts.map +1 -0
  1344. package/vendor/pi-protocol/protocol.js +85 -0
  1345. package/vendor/pi-protocol/protocol.js.map +1 -0
  1346. package/dist/bun/register-bedrock.d.ts +0 -2
  1347. package/dist/bun/register-bedrock.d.ts.map +0 -1
  1348. package/dist/bun/register-bedrock.js +0 -4
  1349. package/dist/bun/register-bedrock.js.map +0 -1
  1350. package/dist/cli/experimental/auth.d.ts +0 -16
  1351. package/dist/cli/experimental/auth.d.ts.map +0 -1
  1352. package/dist/cli/experimental/auth.js +0 -13
  1353. package/dist/cli/experimental/auth.js.map +0 -1
  1354. package/dist/cli/experimental/cli.d.ts +0 -6
  1355. package/dist/cli/experimental/cli.d.ts.map +0 -1
  1356. package/dist/cli/experimental/cli.js +0 -5
  1357. package/dist/cli/experimental/cli.js.map +0 -1
  1358. package/dist/cli/experimental/command-options.d.ts +0 -17
  1359. package/dist/cli/experimental/command-options.d.ts.map +0 -1
  1360. package/dist/cli/experimental/command-options.js +0 -35
  1361. package/dist/cli/experimental/command-options.js.map +0 -1
  1362. package/dist/cli/experimental/command.d.ts +0 -63
  1363. package/dist/cli/experimental/command.d.ts.map +0 -1
  1364. package/dist/cli/experimental/command.js +0 -127
  1365. package/dist/cli/experimental/command.js.map +0 -1
  1366. package/dist/cli/experimental/commands/client.d.ts +0 -13
  1367. package/dist/cli/experimental/commands/client.d.ts.map +0 -1
  1368. package/dist/cli/experimental/commands/client.js +0 -25
  1369. package/dist/cli/experimental/commands/client.js.map +0 -1
  1370. package/dist/cli/experimental/commands/pi.d.ts +0 -15
  1371. package/dist/cli/experimental/commands/pi.d.ts.map +0 -1
  1372. package/dist/cli/experimental/commands/pi.js +0 -28
  1373. package/dist/cli/experimental/commands/pi.js.map +0 -1
  1374. package/dist/cli/experimental/commands/server.d.ts +0 -13
  1375. package/dist/cli/experimental/commands/server.d.ts.map +0 -1
  1376. package/dist/cli/experimental/commands/server.js +0 -25
  1377. package/dist/cli/experimental/commands/server.js.map +0 -1
  1378. package/dist/cli/experimental/transport-address.d.ts +0 -10
  1379. package/dist/cli/experimental/transport-address.d.ts.map +0 -1
  1380. package/dist/cli/experimental/transport-address.js +0 -38
  1381. package/dist/cli/experimental/transport-address.js.map +0 -1
  1382. package/dist/client/remote-session.d.ts +0 -53
  1383. package/dist/client/remote-session.d.ts.map +0 -1
  1384. package/dist/client/remote-session.js +0 -340
  1385. package/dist/client/remote-session.js.map +0 -1
  1386. package/dist/client/transcript.d.ts +0 -12
  1387. package/dist/client/transcript.d.ts.map +0 -1
  1388. package/dist/client/transcript.js +0 -98
  1389. package/dist/client/transcript.js.map +0 -1
  1390. package/dist/server/create-harness.d.ts +0 -26
  1391. package/dist/server/create-harness.d.ts.map +0 -1
  1392. package/dist/server/create-harness.js +0 -106
  1393. package/dist/server/create-harness.js.map +0 -1
  1394. package/dist/utils/clipboard-native.d.ts +0 -11
  1395. package/dist/utils/clipboard-native.d.ts.map +0 -1
  1396. package/dist/utils/clipboard-native.js +0 -20
  1397. package/dist/utils/clipboard-native.js.map +0 -1
  1398. package/docs/AGENTS.md +0 -67
  1399. package/node_modules/@earendil-works/pi-agent-core/dist/harness/reducer.d.ts +0 -100
  1400. package/node_modules/@earendil-works/pi-agent-core/dist/harness/reducer.d.ts.map +0 -1
  1401. package/node_modules/@earendil-works/pi-agent-core/dist/harness/reducer.js +0 -420
  1402. package/node_modules/@earendil-works/pi-agent-core/dist/harness/reducer.js.map +0 -1
  1403. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/errors.d.ts +0 -9
  1404. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/errors.d.ts.map +0 -1
  1405. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/errors.js +0 -18
  1406. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/errors.js.map +0 -1
  1407. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl.d.ts +0 -3
  1408. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl.d.ts.map +0 -1
  1409. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl.js +0 -2
  1410. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl.js.map +0 -1
  1411. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/state.d.ts +0 -65
  1412. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/state.d.ts.map +0 -1
  1413. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/state.js +0 -320
  1414. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/state.js.map +0 -1
  1415. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance.d.ts +0 -4
  1416. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance.d.ts.map +0 -1
  1417. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance.js +0 -762
  1418. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance.js.map +0 -1
  1419. package/node_modules/@earendil-works/pi-agent-core/dist/search/scanning.d.ts +0 -29
  1420. package/node_modules/@earendil-works/pi-agent-core/dist/search/scanning.d.ts.map +0 -1
  1421. package/node_modules/@earendil-works/pi-agent-core/dist/search/scanning.js +0 -103
  1422. package/node_modules/@earendil-works/pi-agent-core/dist/search/scanning.js.map +0 -1
  1423. package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-gateway-binding.d.ts +0 -69
  1424. package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-gateway-binding.d.ts.map +0 -1
  1425. package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-gateway-binding.js +0 -159
  1426. package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-gateway-binding.js.map +0 -1
  1427. package/node_modules/@earendil-works/pi-tui/native/darwin/src/darwin-modifiers.c +0 -70
  1428. package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-arm64/win32-console-mode.node +0 -0
  1429. package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-x64/win32-console-mode.node +0 -0
  1430. package/node_modules/@earendil-works/pi-tui/native/win32/src/win32-console-mode.c +0 -119
  1431. package/node_modules/@mariozechner/clipboard/.yarnrc.yml +0 -1
  1432. package/node_modules/@mariozechner/clipboard/Cargo.toml +0 -45
  1433. package/node_modules/@mariozechner/clipboard/README.md +0 -60
  1434. package/node_modules/@mariozechner/clipboard/build.rs +0 -5
  1435. package/node_modules/@mariozechner/clipboard/exp.ts +0 -12
  1436. package/node_modules/@mariozechner/clipboard/index.d.ts +0 -37
  1437. package/node_modules/@mariozechner/clipboard/index.js +0 -606
  1438. package/node_modules/@mariozechner/clipboard/package.json +0 -45
  1439. package/node_modules/@mariozechner/clipboard/src/clipboard_rs/common.rs +0 -307
  1440. package/node_modules/@mariozechner/clipboard/src/clipboard_rs/mod.rs +0 -93
  1441. package/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/ios.rs +0 -313
  1442. package/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/macos.rs +0 -471
  1443. package/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/mod.rs +0 -252
  1444. package/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/wayland.rs +0 -431
  1445. package/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/win.rs +0 -712
  1446. package/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/x11.rs +0 -916
  1447. package/node_modules/@mariozechner/clipboard/src/lib.rs +0 -194
  1448. package/vendor/pi-client/session-handle.d.ts +0 -54
  1449. package/vendor/pi-client/session-handle.d.ts.map +0 -1
  1450. package/vendor/pi-client/session-handle.js +0 -50
  1451. package/vendor/pi-client/session-handle.js.map +0 -1
  1452. package/vendor/pi-client/state.d.ts +0 -22
  1453. package/vendor/pi-client/state.d.ts.map +0 -1
  1454. package/vendor/pi-client/state.js +0 -145
  1455. package/vendor/pi-client/state.js.map +0 -1
  1456. package/vendor/pi-protocol/schemas.d.ts +0 -13739
  1457. package/vendor/pi-protocol/schemas.d.ts.map +0 -1
  1458. package/vendor/pi-protocol/schemas.js +0 -386
  1459. package/vendor/pi-protocol/schemas.js.map +0 -1
@@ -55,7 +55,7 @@ export interface GenerateBranchSummaryOptions {
55
55
  customInstructions?: string;
56
56
  /** If true, customInstructions replaces the default prompt instead of being appended */
57
57
  replaceInstructions?: boolean;
58
- /** Tokens reserved for prompt + LLM response (default 16384) */
58
+ /** Tokens reserved when selecting branch history (default 16384) */
59
59
  reserveTokens?: number;
60
60
  /** Extension runner used to emit session_before_compact for branch summaries */
61
61
  extensionRunner?: ExtensionRunner;
@@ -1 +1 @@
1
- {"version":3,"file":"branch-summarization.d.ts","sourceRoot":"","sources":["../../../src/core/compaction/branch-summarization.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,KAAK,EAAE,KAAK,EAAuB,KAAK,EAAE,MAAM,8BAA8B,CAAC;AACtF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAS/D,OAAO,KAAK,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGlF,OAAO,EAKN,KAAK,cAAc,EAInB,MAAM,YAAY,CAAC;AAUpB,MAAM,WAAW,mBAAmB;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;AAED,qEAAqE;AACrE,MAAM,WAAW,oBAAoB;IACpC,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,aAAa,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,WAAW,iBAAiB;IACjC,mEAAmE;IACnE,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,gDAAgD;IAChD,OAAO,EAAE,cAAc,CAAC;IACxB,yCAAyC;IACzC,WAAW,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACpC,mDAAmD;IACnD,OAAO,EAAE,YAAY,EAAE,CAAC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AO,EAAE,4BAA4B,GACnC,OAAO,CAAC,mBAAmB,CAAC,CA8G9B"}
1
+ {"version":3,"file":"branch-summarization.d.ts","sourceRoot":"","sources":["../../../src/core/compaction/branch-summarization.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,KAAK,EAAE,KAAK,EAAuB,KAAK,EAAE,MAAM,8BAA8B,CAAC;AACtF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAS/D,OAAO,KAAK,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGlF,OAAO,EAKN,KAAK,cAAc,EAInB,MAAM,YAAY,CAAC;AAUpB,MAAM,WAAW,mBAAmB;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;AAED,qEAAqE;AACrE,MAAM,WAAW,oBAAoB;IACpC,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,aAAa,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,WAAW,iBAAiB;IACjC,mEAAmE;IACnE,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,gDAAgD;IAChD,OAAO,EAAE,cAAc,CAAC;IACxB,yCAAyC;IACzC,WAAW,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACpC,mDAAmD;IACnD,OAAO,EAAE,YAAY,EAAE,CAAC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AO,EAAE,4BAA4B,GACnC,OAAO,CAAC,mBAAmB,CAAC,CAiH9B"}
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import { randomUUID } from "node:crypto";
8
8
  import { convertToLlm, createBranchSummaryMessage, createCompactionSummaryMessage, createCustomMessage, isContextExcludedCustomMessage, } from "../messages.js";
9
- import { completeSummarization, estimateTokens } from "./compaction.js";
9
+ import { completeSummarization, estimateTokens, getSummarizationFailure } from "./compaction.js";
10
10
  import { computeFileLists, contentTextForSummary, createFileOps, extractFileOpsFromMessage, formatFileOperations, SUMMARIZATION_SYSTEM_PROMPT, serializeConversation, } from "./utils.js";
11
11
  // ============================================================================
12
12
  // Entry Collection
@@ -257,19 +257,21 @@ export async function generateBranchSummary(entries, options) {
257
257
  timestamp: Date.now(),
258
258
  },
259
259
  ];
260
+ const maxTokens = Math.min(4096, model.maxTokens > 0 ? model.maxTokens : Number.POSITIVE_INFINITY);
260
261
  // Call LLM for summarization. Prefer the session stream function so SDK
261
262
  // request behavior (timeouts, retries, attribution headers) stays consistent
262
263
  // without running through agent state/events. Retried via completeSummarization
263
264
  // so transient stream drops reuse the configured retry policy.
264
265
  const context = { systemPrompt: SUMMARIZATION_SYSTEM_PROMPT, messages: summarizationMessages };
265
- const requestOptions = { apiKey, headers, extraBody, env, signal, maxTokens: 2048 };
266
+ const requestOptions = { apiKey, headers, extraBody, env, signal, maxTokens };
266
267
  const response = await completeSummarization(model, context, requestOptions, streamFn, retry, callbacks);
267
268
  // Check if aborted or errored
268
269
  if (response.stopReason === "aborted") {
269
270
  return { aborted: true };
270
271
  }
271
- if (response.stopReason === "error") {
272
- return { error: response.errorMessage || "Summarization failed" };
272
+ const failure = getSummarizationFailure(response, "Branch summarization");
273
+ if (failure) {
274
+ return { error: failure };
273
275
  }
274
276
  if (response.content.some((block) => block.type === "toolCall")) {
275
277
  return { error: "Branch summarization attempted to call a tool" };
@@ -1 +1 @@
1
- {"version":3,"file":"branch-summarization.js","sourceRoot":"","sources":["../../../src/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/F,MAAM,cAAc,GAA+B,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;IAChH,MAAM,QAAQ,GAAG,MAAM,qBAAqB,CAAC,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;IAEzG,8BAA8B;IAC9B,IAAI,QAAQ,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;QACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC1B,CAAC;IACD,IAAI,QAAQ,CAAC,UAAU,KAAK,OAAO,EAAE,CAAC;QACrC,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,YAAY,IAAI,sBAAsB,EAAE,CAAC;IACnE,CAAC;IACD,IAAI,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,UAAU,CAAC,EAAE,CAAC;QACjE,OAAO,EAAE,KAAK,EAAE,+CAA+C,EAAE,CAAC;IACnE,CAAC;IAED,IAAI,OAAO,GAAG,qBAAqB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAEtD,+DAA+D;IAC/D,OAAO,GAAG,uBAAuB,GAAG,OAAO,CAAC;IAE5C,2CAA2C;IAC3C,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC/D,OAAO,IAAI,oBAAoB,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;IAE1D,OAAO;QACN,OAAO,EAAE,OAAO,IAAI,sBAAsB;QAC1C,KAAK,EAAE,QAAQ,CAAC,KAAK;QACrB,SAAS;QACT,aAAa;KACb,CAAC;AACH,CAAC","sourcesContent":["/**\n * Branch summarization for tree navigation.\n *\n * When navigating to a different point in the session tree, this generates\n * a summary of the branch being left so context isn't lost.\n */\n\nimport { randomUUID } from \"node:crypto\";\nimport type { AgentMessage, StreamFn } from \"@earendil-works/pi-agent-core\";\nimport type { RetryCallbacks, RetryPolicy } from \"@earendil-works/pi-ai\";\nimport type { Model, SimpleStreamOptions, Usage } from \"@earendil-works/pi-ai/compat\";\nimport type { ExtensionRunner } from \"../extensions/runner.ts\";\nimport type { SessionBeforeCompactResult } from \"../extensions/types.ts\";\nimport {\n\tconvertToLlm,\n\tcreateBranchSummaryMessage,\n\tcreateCompactionSummaryMessage,\n\tcreateCustomMessage,\n\tisContextExcludedCustomMessage,\n} from \"../messages.ts\";\nimport type { ReadonlySessionManager, SessionEntry } from \"../session-manager.ts\";\nimport type { CompactionPreparation } from \"./compaction.ts\";\nimport { completeSummarization, estimateTokens } from \"./compaction.ts\";\nimport {\n\tcomputeFileLists,\n\tcontentTextForSummary,\n\tcreateFileOps,\n\textractFileOpsFromMessage,\n\ttype FileOperations,\n\tformatFileOperations,\n\tSUMMARIZATION_SYSTEM_PROMPT,\n\tserializeConversation,\n} from \"./utils.ts\";\n\ntype BranchSummaryStreamOptions = SimpleStreamOptions & {\n\treadonly env?: Record<string, string>;\n};\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface BranchSummaryResult {\n\tsummary?: string;\n\tusage?: Usage;\n\treadFiles?: string[];\n\tmodifiedFiles?: string[];\n\taborted?: boolean;\n\terror?: string;\n}\n\n/** Details stored in BranchSummaryEntry.details for file tracking */\nexport interface BranchSummaryDetails {\n\treadFiles: string[];\n\tmodifiedFiles: string[];\n}\n\nexport type { FileOperations } from \"./utils.ts\";\n\nexport interface BranchPreparation {\n\t/** Messages extracted for summarization, in chronological order */\n\tmessages: AgentMessage[];\n\t/** File operations extracted from tool calls */\n\tfileOps: FileOperations;\n\t/** Total estimated tokens in messages */\n\ttotalTokens: number;\n}\n\nexport interface CollectEntriesResult {\n\t/** Entries to summarize, in chronological order */\n\tentries: SessionEntry[];\n\t/** Common ancestor between old and new position, if any */\n\tcommonAncestorId: string | null;\n}\n\nexport interface GenerateBranchSummaryOptions {\n\t/** Model to use for summarization */\n\tmodel: Model<any>;\n\t/** API key for the model */\n\tapiKey?: string;\n\t/** Request headers for the model */\n\theaders?: Record<string, string>;\n\t/** Extra request body fields to merge into outgoing provider payload */\n\textraBody?: Record<string, unknown>;\n\t/** Provider-scoped environment values for the model */\n\tenv?: Record<string, string>;\n\t/** Abort signal for cancellation */\n\tsignal: AbortSignal;\n\t/** Optional custom instructions for summarization */\n\tcustomInstructions?: string;\n\t/** If true, customInstructions replaces the default prompt instead of being appended */\n\treplaceInstructions?: boolean;\n\t/** Tokens reserved for prompt + LLM response (default 16384) */\n\treserveTokens?: number;\n\t/** Extension runner used to emit session_before_compact for branch summaries */\n\textensionRunner?: ExtensionRunner;\n\t/** Optional session stream function. Used to preserve SDK request behavior without mutating agent state. */\n\tstreamFn?: StreamFn;\n\t/** Retry policy for transient summarization errors. Reuses coding-agent's `settings.retry`. */\n\tretry?: RetryPolicy;\n\t/** Optional callbacks for retry reporting (e.g. TUI retry indicators). */\n\tcallbacks?: RetryCallbacks;\n}\n\n// ============================================================================\n// Entry Collection\n// ============================================================================\n\n/**\n * Collect entries that should be summarized when navigating from one position to another.\n *\n * Walks from oldLeafId back to the common ancestor with targetId, collecting entries\n * along the way. Does NOT stop at compaction boundaries - those are included and their\n * summaries become context.\n *\n * @param session - Session manager (read-only access)\n * @param oldLeafId - Current position (where we're navigating from)\n * @param targetId - Target position (where we're navigating to)\n * @returns Entries to summarize and the common ancestor\n */\nexport function collectEntriesForBranchSummary(\n\tsession: ReadonlySessionManager,\n\toldLeafId: string | null,\n\ttargetId: string,\n): CollectEntriesResult {\n\t// If no old position, nothing to summarize\n\tif (!oldLeafId) {\n\t\treturn { entries: [], commonAncestorId: null };\n\t}\n\n\t// Find common ancestor (deepest node that's on both paths)\n\tconst oldPath = new Set(session.getBranch(oldLeafId).map((e) => e.id));\n\tconst targetPath = session.getBranch(targetId);\n\n\t// targetPath is root-first, so iterate backwards to find deepest common ancestor\n\tlet commonAncestorId: string | null = null;\n\tfor (let i = targetPath.length - 1; i >= 0; i--) {\n\t\tif (oldPath.has(targetPath[i].id)) {\n\t\t\tcommonAncestorId = targetPath[i].id;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t// Collect entries from old leaf back to common ancestor\n\tconst entries: SessionEntry[] = [];\n\tlet current: string | null = oldLeafId;\n\n\twhile (current && current !== commonAncestorId) {\n\t\tconst entry = session.getEntry(current);\n\t\tif (!entry) break;\n\t\tentries.push(entry);\n\t\tcurrent = entry.parentId;\n\t}\n\n\t// Reverse to get chronological order\n\tentries.reverse();\n\n\treturn { entries, commonAncestorId };\n}\n\n// ============================================================================\n// Entry to Message Conversion\n// ============================================================================\n\n/**\n * Extract AgentMessage from a session entry.\n * Similar to getMessageFromEntry in compaction.ts but also handles compaction entries.\n */\nfunction getMessageFromEntry(entry: SessionEntry): AgentMessage | undefined {\n\tswitch (entry.type) {\n\t\tcase \"message\":\n\t\t\t// Skip tool results - context is in assistant's tool call\n\t\t\tif (entry.message.role === \"toolResult\") return undefined;\n\t\t\treturn entry.message;\n\n\t\tcase \"custom_message\":\n\t\t\tif (isContextExcludedCustomMessage(entry.customType)) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\treturn createCustomMessage(entry.customType, entry.content, entry.display, entry.details, entry.timestamp);\n\n\t\tcase \"branch_summary\":\n\t\t\treturn createBranchSummaryMessage(entry.summary, entry.fromId, entry.timestamp);\n\n\t\tcase \"compaction\":\n\t\t\treturn createCompactionSummaryMessage(entry.summary, entry.tokensBefore, entry.timestamp);\n\n\t\t// These don't contribute to conversation content\n\t\tcase \"thinking_level_change\":\n\t\tcase \"model_change\":\n\t\tcase \"custom\":\n\t\tcase \"label\":\n\t\tcase \"session_info\":\n\t\t\treturn undefined;\n\t}\n}\n\n/**\n * Prepare entries for summarization with token budget.\n *\n * Walks entries from NEWEST to OLDEST, adding messages until we hit the token budget.\n * This ensures we keep the most recent context when the branch is too long.\n *\n * Also collects file operations from:\n * - Tool calls in assistant messages\n * - Existing branch_summary entries' details (for cumulative tracking)\n *\n * @param entries - Entries in chronological order\n * @param tokenBudget - Maximum tokens to include (0 = no limit)\n */\nexport function prepareBranchEntries(entries: SessionEntry[], tokenBudget: number = 0): BranchPreparation {\n\tconst messages: AgentMessage[] = [];\n\tconst fileOps = createFileOps();\n\tlet totalTokens = 0;\n\n\t// First pass: collect file ops from ALL entries (even if they don't fit in token budget)\n\t// This ensures we capture cumulative file tracking from nested branch summaries\n\t// Only extract from pi-generated summaries (fromHook !== true), not extension-generated ones\n\tfor (const entry of entries) {\n\t\tif (entry.type === \"branch_summary\" && !entry.fromHook && entry.details) {\n\t\t\tconst details = entry.details as BranchSummaryDetails;\n\t\t\tif (Array.isArray(details.readFiles)) {\n\t\t\t\tfor (const f of details.readFiles) fileOps.read.add(f);\n\t\t\t}\n\t\t\tif (Array.isArray(details.modifiedFiles)) {\n\t\t\t\t// Modified files go into both edited and written for proper deduplication\n\t\t\t\tfor (const f of details.modifiedFiles) {\n\t\t\t\t\tfileOps.edited.add(f);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Second pass: walk from newest to oldest, adding messages until token budget\n\tfor (let i = entries.length - 1; i >= 0; i--) {\n\t\tconst entry = entries[i];\n\t\tconst message = getMessageFromEntry(entry);\n\t\tif (!message) continue;\n\n\t\t// Extract file ops from assistant messages (tool calls)\n\t\textractFileOpsFromMessage(message, fileOps);\n\n\t\tconst tokens = estimateTokens(message);\n\n\t\t// Check budget before adding\n\t\tif (tokenBudget > 0 && totalTokens + tokens > tokenBudget) {\n\t\t\t// If this is a summary entry, try to fit it anyway as it's important context\n\t\t\tif (entry.type === \"compaction\" || entry.type === \"branch_summary\") {\n\t\t\t\tif (totalTokens < tokenBudget * 0.9) {\n\t\t\t\t\tmessages.unshift(message);\n\t\t\t\t\ttotalTokens += tokens;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Stop - we've hit the budget\n\t\t\tbreak;\n\t\t}\n\n\t\tmessages.unshift(message);\n\t\ttotalTokens += tokens;\n\t}\n\n\treturn { messages, fileOps, totalTokens };\n}\n\n// ============================================================================\n// Summary Generation\n// ============================================================================\n\nconst BRANCH_SUMMARY_PREAMBLE = `The user explored a different conversation branch before returning here.\nSummary of that exploration:\n\n`;\n\nconst BRANCH_SUMMARY_PROMPT = `Create a structured summary of this conversation branch for context when returning later.\n\nUse this EXACT format:\n\n## Goal\n[What was the user trying to accomplish in this branch?]\n\n## Constraints & Preferences\n- [Any constraints, preferences, or requirements mentioned]\n- [Or \"(none)\" if none were mentioned]\n\n## Progress\n### Done\n- [x] [Completed tasks/changes]\n\n### In Progress\n- [ ] [Work that was started but not finished]\n\n### Blocked\n- [Issues preventing progress, if any]\n\n## Key Decisions\n- **[Decision]**: [Brief rationale]\n\n## Next Steps\n1. [What should happen next to continue this work]\n\nKeep each section concise. Preserve exact file paths, function names, and error messages.`;\n\nfunction createBranchCompactionPreparation(\n\tentries: SessionEntry[],\n\tpreparation: BranchPreparation,\n\treserveTokens: number,\n): CompactionPreparation {\n\tconst firstEntry = entries[0];\n\n\treturn {\n\t\tfirstKeptEntryId: firstEntry?.id ?? \"\",\n\t\tmessagesToSummarize: preparation.messages,\n\t\tturnPrefixMessages: [],\n\t\tisSplitTurn: false,\n\t\ttokensBefore: preparation.totalTokens,\n\t\tfileOps: preparation.fileOps,\n\t\tsettings: {\n\t\t\tenabled: true,\n\t\t\treserveTokens,\n\t\t\tkeepRecentTokens: 0,\n\t\t},\n\t};\n}\n\n/**\n * Generate a summary of abandoned branch entries.\n *\n * @param entries - Session entries to summarize (chronological order)\n * @param options - Generation options\n */\nexport async function generateBranchSummary(\n\tentries: SessionEntry[],\n\toptions: GenerateBranchSummaryOptions,\n): Promise<BranchSummaryResult> {\n\tconst {\n\t\tmodel,\n\t\tapiKey,\n\t\theaders,\n\t\textraBody,\n\t\tenv,\n\t\tsignal,\n\t\tcustomInstructions,\n\t\treplaceInstructions,\n\t\treserveTokens = 16384,\n\t\textensionRunner,\n\t\tstreamFn,\n\t\tretry,\n\t\tcallbacks,\n\t} = options;\n\n\t// Token budget = context window minus reserved space for prompt + response\n\tconst contextWindow = model.contextWindow || 128000;\n\tconst tokenBudget = contextWindow - reserveTokens;\n\n\tconst branchPreparation = prepareBranchEntries(entries, tokenBudget);\n\tconst { messages, fileOps } = branchPreparation;\n\n\tif (messages.length === 0) {\n\t\treturn { summary: \"No content to summarize\" };\n\t}\n\n\tif (extensionRunner?.hasHandlers(\"session_before_compact\")) {\n\t\tconst preparation = createBranchCompactionPreparation(entries, branchPreparation, reserveTokens);\n\t\tconst result = (await extensionRunner.emit({\n\t\t\ttype: \"session_before_compact\",\n\t\t\treason: \"branch\",\n\t\t\twillRetry: false,\n\t\t\trequestId: randomUUID(),\n\t\t\tpreparation,\n\t\t\tbranchEntries: entries,\n\t\t\tcustomInstructions,\n\t\t\tsignal,\n\t\t})) as SessionBeforeCompactResult | undefined;\n\n\t\tif (result?.cancel) {\n\t\t\treturn { aborted: true };\n\t\t}\n\n\t\tif (result?.compaction) {\n\t\t\treturn {\n\t\t\t\tsummary: result.compaction.summary,\n\t\t\t};\n\t\t}\n\t}\n\n\t// Transform to LLM-compatible messages, then serialize to text\n\t// Serialization prevents the model from treating it as a conversation to continue\n\tconst llmMessages = convertToLlm(messages);\n\tconst conversationText = serializeConversation(llmMessages);\n\n\t// Build prompt\n\tlet instructions: string;\n\tif (replaceInstructions && customInstructions) {\n\t\tinstructions = customInstructions;\n\t} else if (customInstructions) {\n\t\tinstructions = `${BRANCH_SUMMARY_PROMPT}\\n\\nAdditional focus: ${customInstructions}`;\n\t} else {\n\t\tinstructions = BRANCH_SUMMARY_PROMPT;\n\t}\n\tconst promptText = `<conversation>\\n${conversationText}\\n</conversation>\\n\\n${instructions}`;\n\n\tconst summarizationMessages = [\n\t\t{\n\t\t\trole: \"user\" as const,\n\t\t\tcontent: [{ type: \"text\" as const, text: promptText }],\n\t\t\ttimestamp: Date.now(),\n\t\t},\n\t];\n\n\t// Call LLM for summarization. Prefer the session stream function so SDK\n\t// request behavior (timeouts, retries, attribution headers) stays consistent\n\t// without running through agent state/events. Retried via completeSummarization\n\t// so transient stream drops reuse the configured retry policy.\n\tconst context = { systemPrompt: SUMMARIZATION_SYSTEM_PROMPT, messages: summarizationMessages };\n\tconst requestOptions: BranchSummaryStreamOptions = { apiKey, headers, extraBody, env, signal, maxTokens: 2048 };\n\tconst response = await completeSummarization(model, context, requestOptions, streamFn, retry, callbacks);\n\n\t// Check if aborted or errored\n\tif (response.stopReason === \"aborted\") {\n\t\treturn { aborted: true };\n\t}\n\tif (response.stopReason === \"error\") {\n\t\treturn { error: response.errorMessage || \"Summarization failed\" };\n\t}\n\tif (response.content.some((block) => block.type === \"toolCall\")) {\n\t\treturn { error: \"Branch summarization attempted to call a tool\" };\n\t}\n\n\tlet summary = contentTextForSummary(response.content);\n\n\t// Prepend preamble to provide context about the branch summary\n\tsummary = BRANCH_SUMMARY_PREAMBLE + summary;\n\n\t// Compute file lists and append to summary\n\tconst { readFiles, modifiedFiles } = computeFileLists(fileOps);\n\tsummary += formatFileOperations(readFiles, modifiedFiles);\n\n\treturn {\n\t\tsummary: summary || \"No summary generated\",\n\t\tusage: response.usage,\n\t\treadFiles,\n\t\tmodifiedFiles,\n\t};\n}\n"]}
1
+ {"version":3,"file":"branch-summarization.js","sourceRoot":"","sources":["../../../src/core/compaction/branch-summarization.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAMzC,OAAO,EACN,YAAY,EACZ,0BAA0B,EAC1B,8BAA8B,EAC9B,mBAAmB,EACnB,8BAA8B,GAC9B,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AACjG,OAAO,EACN,gBAAgB,EAChB,qBAAqB,EACrB,aAAa,EACb,yBAAyB,EAEzB,oBAAo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,cAAc,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;IAEzG,8BAA8B;IAC9B,IAAI,QAAQ,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;QACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC1B,CAAC;IACD,MAAM,OAAO,GAAG,uBAAuB,CAAC,QAAQ,EAAE,sBAAsB,CAAC,CAAC;IAC1E,IAAI,OAAO,EAAE,CAAC;QACb,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;IAC3B,CAAC;IACD,IAAI,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,UAAU,CAAC,EAAE,CAAC;QACjE,OAAO,EAAE,KAAK,EAAE,+CAA+C,EAAE,CAAC;IACnE,CAAC;IAED,IAAI,OAAO,GAAG,qBAAqB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAEtD,+DAA+D;IAC/D,OAAO,GAAG,uBAAuB,GAAG,OAAO,CAAC;IAE5C,2CAA2C;IAC3C,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC/D,OAAO,IAAI,oBAAoB,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;IAE1D,OAAO;QACN,OAAO,EAAE,OAAO,IAAI,sBAAsB;QAC1C,KAAK,EAAE,QAAQ,CAAC,KAAK;QACrB,SAAS;QACT,aAAa;KACb,CAAC;AACH,CAAC","sourcesContent":["/**\n * Branch summarization for tree navigation.\n *\n * When navigating to a different point in the session tree, this generates\n * a summary of the branch being left so context isn't lost.\n */\n\nimport { randomUUID } from \"node:crypto\";\nimport type { AgentMessage, StreamFn } from \"@earendil-works/pi-agent-core\";\nimport type { RetryCallbacks, RetryPolicy } from \"@earendil-works/pi-ai\";\nimport type { Model, SimpleStreamOptions, Usage } from \"@earendil-works/pi-ai/compat\";\nimport type { ExtensionRunner } from \"../extensions/runner.ts\";\nimport type { SessionBeforeCompactResult } from \"../extensions/types.ts\";\nimport {\n\tconvertToLlm,\n\tcreateBranchSummaryMessage,\n\tcreateCompactionSummaryMessage,\n\tcreateCustomMessage,\n\tisContextExcludedCustomMessage,\n} from \"../messages.ts\";\nimport type { ReadonlySessionManager, SessionEntry } from \"../session-manager.ts\";\nimport type { CompactionPreparation } from \"./compaction.ts\";\nimport { completeSummarization, estimateTokens, getSummarizationFailure } from \"./compaction.ts\";\nimport {\n\tcomputeFileLists,\n\tcontentTextForSummary,\n\tcreateFileOps,\n\textractFileOpsFromMessage,\n\ttype FileOperations,\n\tformatFileOperations,\n\tSUMMARIZATION_SYSTEM_PROMPT,\n\tserializeConversation,\n} from \"./utils.ts\";\n\ntype BranchSummaryStreamOptions = SimpleStreamOptions & {\n\treadonly env?: Record<string, string>;\n};\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface BranchSummaryResult {\n\tsummary?: string;\n\tusage?: Usage;\n\treadFiles?: string[];\n\tmodifiedFiles?: string[];\n\taborted?: boolean;\n\terror?: string;\n}\n\n/** Details stored in BranchSummaryEntry.details for file tracking */\nexport interface BranchSummaryDetails {\n\treadFiles: string[];\n\tmodifiedFiles: string[];\n}\n\nexport type { FileOperations } from \"./utils.ts\";\n\nexport interface BranchPreparation {\n\t/** Messages extracted for summarization, in chronological order */\n\tmessages: AgentMessage[];\n\t/** File operations extracted from tool calls */\n\tfileOps: FileOperations;\n\t/** Total estimated tokens in messages */\n\ttotalTokens: number;\n}\n\nexport interface CollectEntriesResult {\n\t/** Entries to summarize, in chronological order */\n\tentries: SessionEntry[];\n\t/** Common ancestor between old and new position, if any */\n\tcommonAncestorId: string | null;\n}\n\nexport interface GenerateBranchSummaryOptions {\n\t/** Model to use for summarization */\n\tmodel: Model<any>;\n\t/** API key for the model */\n\tapiKey?: string;\n\t/** Request headers for the model */\n\theaders?: Record<string, string>;\n\t/** Extra request body fields to merge into outgoing provider payload */\n\textraBody?: Record<string, unknown>;\n\t/** Provider-scoped environment values for the model */\n\tenv?: Record<string, string>;\n\t/** Abort signal for cancellation */\n\tsignal: AbortSignal;\n\t/** Optional custom instructions for summarization */\n\tcustomInstructions?: string;\n\t/** If true, customInstructions replaces the default prompt instead of being appended */\n\treplaceInstructions?: boolean;\n\t/** Tokens reserved when selecting branch history (default 16384) */\n\treserveTokens?: number;\n\t/** Extension runner used to emit session_before_compact for branch summaries */\n\textensionRunner?: ExtensionRunner;\n\t/** Optional session stream function. Used to preserve SDK request behavior without mutating agent state. */\n\tstreamFn?: StreamFn;\n\t/** Retry policy for transient summarization errors. Reuses coding-agent's `settings.retry`. */\n\tretry?: RetryPolicy;\n\t/** Optional callbacks for retry reporting (e.g. TUI retry indicators). */\n\tcallbacks?: RetryCallbacks;\n}\n\n// ============================================================================\n// Entry Collection\n// ============================================================================\n\n/**\n * Collect entries that should be summarized when navigating from one position to another.\n *\n * Walks from oldLeafId back to the common ancestor with targetId, collecting entries\n * along the way. Does NOT stop at compaction boundaries - those are included and their\n * summaries become context.\n *\n * @param session - Session manager (read-only access)\n * @param oldLeafId - Current position (where we're navigating from)\n * @param targetId - Target position (where we're navigating to)\n * @returns Entries to summarize and the common ancestor\n */\nexport function collectEntriesForBranchSummary(\n\tsession: ReadonlySessionManager,\n\toldLeafId: string | null,\n\ttargetId: string,\n): CollectEntriesResult {\n\t// If no old position, nothing to summarize\n\tif (!oldLeafId) {\n\t\treturn { entries: [], commonAncestorId: null };\n\t}\n\n\t// Find common ancestor (deepest node that's on both paths)\n\tconst oldPath = new Set(session.getBranch(oldLeafId).map((e) => e.id));\n\tconst targetPath = session.getBranch(targetId);\n\n\t// targetPath is root-first, so iterate backwards to find deepest common ancestor\n\tlet commonAncestorId: string | null = null;\n\tfor (let i = targetPath.length - 1; i >= 0; i--) {\n\t\tif (oldPath.has(targetPath[i].id)) {\n\t\t\tcommonAncestorId = targetPath[i].id;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t// Collect entries from old leaf back to common ancestor\n\tconst entries: SessionEntry[] = [];\n\tlet current: string | null = oldLeafId;\n\n\twhile (current && current !== commonAncestorId) {\n\t\tconst entry = session.getEntry(current);\n\t\tif (!entry) break;\n\t\tentries.push(entry);\n\t\tcurrent = entry.parentId;\n\t}\n\n\t// Reverse to get chronological order\n\tentries.reverse();\n\n\treturn { entries, commonAncestorId };\n}\n\n// ============================================================================\n// Entry to Message Conversion\n// ============================================================================\n\n/**\n * Extract AgentMessage from a session entry.\n * Similar to getMessageFromEntry in compaction.ts but also handles compaction entries.\n */\nfunction getMessageFromEntry(entry: SessionEntry): AgentMessage | undefined {\n\tswitch (entry.type) {\n\t\tcase \"message\":\n\t\t\t// Skip tool results - context is in assistant's tool call\n\t\t\tif (entry.message.role === \"toolResult\") return undefined;\n\t\t\treturn entry.message;\n\n\t\tcase \"custom_message\":\n\t\t\tif (isContextExcludedCustomMessage(entry.customType)) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\treturn createCustomMessage(entry.customType, entry.content, entry.display, entry.details, entry.timestamp);\n\n\t\tcase \"branch_summary\":\n\t\t\treturn createBranchSummaryMessage(entry.summary, entry.fromId, entry.timestamp);\n\n\t\tcase \"compaction\":\n\t\t\treturn createCompactionSummaryMessage(entry.summary, entry.tokensBefore, entry.timestamp);\n\n\t\t// These don't contribute to conversation content\n\t\tcase \"thinking_level_change\":\n\t\tcase \"model_change\":\n\t\tcase \"custom\":\n\t\tcase \"label\":\n\t\tcase \"session_info\":\n\t\t\treturn undefined;\n\t}\n}\n\n/**\n * Prepare entries for summarization with token budget.\n *\n * Walks entries from NEWEST to OLDEST, adding messages until we hit the token budget.\n * This ensures we keep the most recent context when the branch is too long.\n *\n * Also collects file operations from:\n * - Tool calls in assistant messages\n * - Existing branch_summary entries' details (for cumulative tracking)\n *\n * @param entries - Entries in chronological order\n * @param tokenBudget - Maximum tokens to include (0 = no limit)\n */\nexport function prepareBranchEntries(entries: SessionEntry[], tokenBudget: number = 0): BranchPreparation {\n\tconst messages: AgentMessage[] = [];\n\tconst fileOps = createFileOps();\n\tlet totalTokens = 0;\n\n\t// First pass: collect file ops from ALL entries (even if they don't fit in token budget)\n\t// This ensures we capture cumulative file tracking from nested branch summaries\n\t// Only extract from pi-generated summaries (fromHook !== true), not extension-generated ones\n\tfor (const entry of entries) {\n\t\tif (entry.type === \"branch_summary\" && !entry.fromHook && entry.details) {\n\t\t\tconst details = entry.details as BranchSummaryDetails;\n\t\t\tif (Array.isArray(details.readFiles)) {\n\t\t\t\tfor (const f of details.readFiles) fileOps.read.add(f);\n\t\t\t}\n\t\t\tif (Array.isArray(details.modifiedFiles)) {\n\t\t\t\t// Modified files go into both edited and written for proper deduplication\n\t\t\t\tfor (const f of details.modifiedFiles) {\n\t\t\t\t\tfileOps.edited.add(f);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Second pass: walk from newest to oldest, adding messages until token budget\n\tfor (let i = entries.length - 1; i >= 0; i--) {\n\t\tconst entry = entries[i];\n\t\tconst message = getMessageFromEntry(entry);\n\t\tif (!message) continue;\n\n\t\t// Extract file ops from assistant messages (tool calls)\n\t\textractFileOpsFromMessage(message, fileOps);\n\n\t\tconst tokens = estimateTokens(message);\n\n\t\t// Check budget before adding\n\t\tif (tokenBudget > 0 && totalTokens + tokens > tokenBudget) {\n\t\t\t// If this is a summary entry, try to fit it anyway as it's important context\n\t\t\tif (entry.type === \"compaction\" || entry.type === \"branch_summary\") {\n\t\t\t\tif (totalTokens < tokenBudget * 0.9) {\n\t\t\t\t\tmessages.unshift(message);\n\t\t\t\t\ttotalTokens += tokens;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Stop - we've hit the budget\n\t\t\tbreak;\n\t\t}\n\n\t\tmessages.unshift(message);\n\t\ttotalTokens += tokens;\n\t}\n\n\treturn { messages, fileOps, totalTokens };\n}\n\n// ============================================================================\n// Summary Generation\n// ============================================================================\n\nconst BRANCH_SUMMARY_PREAMBLE = `The user explored a different conversation branch before returning here.\nSummary of that exploration:\n\n`;\n\nconst BRANCH_SUMMARY_PROMPT = `Create a structured summary of this conversation branch for context when returning later.\n\nUse this EXACT format:\n\n## Goal\n[What was the user trying to accomplish in this branch?]\n\n## Constraints & Preferences\n- [Any constraints, preferences, or requirements mentioned]\n- [Or \"(none)\" if none were mentioned]\n\n## Progress\n### Done\n- [x] [Completed tasks/changes]\n\n### In Progress\n- [ ] [Work that was started but not finished]\n\n### Blocked\n- [Issues preventing progress, if any]\n\n## Key Decisions\n- **[Decision]**: [Brief rationale]\n\n## Next Steps\n1. [What should happen next to continue this work]\n\nKeep each section concise. Preserve exact file paths, function names, and error messages.`;\n\nfunction createBranchCompactionPreparation(\n\tentries: SessionEntry[],\n\tpreparation: BranchPreparation,\n\treserveTokens: number,\n): CompactionPreparation {\n\tconst firstEntry = entries[0];\n\n\treturn {\n\t\tfirstKeptEntryId: firstEntry?.id ?? \"\",\n\t\tmessagesToSummarize: preparation.messages,\n\t\tturnPrefixMessages: [],\n\t\tisSplitTurn: false,\n\t\ttokensBefore: preparation.totalTokens,\n\t\tfileOps: preparation.fileOps,\n\t\tsettings: {\n\t\t\tenabled: true,\n\t\t\treserveTokens,\n\t\t\tkeepRecentTokens: 0,\n\t\t},\n\t};\n}\n\n/**\n * Generate a summary of abandoned branch entries.\n *\n * @param entries - Session entries to summarize (chronological order)\n * @param options - Generation options\n */\nexport async function generateBranchSummary(\n\tentries: SessionEntry[],\n\toptions: GenerateBranchSummaryOptions,\n): Promise<BranchSummaryResult> {\n\tconst {\n\t\tmodel,\n\t\tapiKey,\n\t\theaders,\n\t\textraBody,\n\t\tenv,\n\t\tsignal,\n\t\tcustomInstructions,\n\t\treplaceInstructions,\n\t\treserveTokens = 16384,\n\t\textensionRunner,\n\t\tstreamFn,\n\t\tretry,\n\t\tcallbacks,\n\t} = options;\n\n\t// Token budget = context window minus reserved space for prompt + response\n\tconst contextWindow = model.contextWindow || 128000;\n\tconst tokenBudget = contextWindow - reserveTokens;\n\n\tconst branchPreparation = prepareBranchEntries(entries, tokenBudget);\n\tconst { messages, fileOps } = branchPreparation;\n\n\tif (messages.length === 0) {\n\t\treturn { summary: \"No content to summarize\" };\n\t}\n\n\tif (extensionRunner?.hasHandlers(\"session_before_compact\")) {\n\t\tconst preparation = createBranchCompactionPreparation(entries, branchPreparation, reserveTokens);\n\t\tconst result = (await extensionRunner.emit({\n\t\t\ttype: \"session_before_compact\",\n\t\t\treason: \"branch\",\n\t\t\twillRetry: false,\n\t\t\trequestId: randomUUID(),\n\t\t\tpreparation,\n\t\t\tbranchEntries: entries,\n\t\t\tcustomInstructions,\n\t\t\tsignal,\n\t\t})) as SessionBeforeCompactResult | undefined;\n\n\t\tif (result?.cancel) {\n\t\t\treturn { aborted: true };\n\t\t}\n\n\t\tif (result?.compaction) {\n\t\t\treturn {\n\t\t\t\tsummary: result.compaction.summary,\n\t\t\t};\n\t\t}\n\t}\n\n\t// Transform to LLM-compatible messages, then serialize to text\n\t// Serialization prevents the model from treating it as a conversation to continue\n\tconst llmMessages = convertToLlm(messages);\n\tconst conversationText = serializeConversation(llmMessages);\n\n\t// Build prompt\n\tlet instructions: string;\n\tif (replaceInstructions && customInstructions) {\n\t\tinstructions = customInstructions;\n\t} else if (customInstructions) {\n\t\tinstructions = `${BRANCH_SUMMARY_PROMPT}\\n\\nAdditional focus: ${customInstructions}`;\n\t} else {\n\t\tinstructions = BRANCH_SUMMARY_PROMPT;\n\t}\n\tconst promptText = `<conversation>\\n${conversationText}\\n</conversation>\\n\\n${instructions}`;\n\n\tconst summarizationMessages = [\n\t\t{\n\t\t\trole: \"user\" as const,\n\t\t\tcontent: [{ type: \"text\" as const, text: promptText }],\n\t\t\ttimestamp: Date.now(),\n\t\t},\n\t];\n\n\tconst maxTokens = Math.min(4096, model.maxTokens > 0 ? model.maxTokens : Number.POSITIVE_INFINITY);\n\n\t// Call LLM for summarization. Prefer the session stream function so SDK\n\t// request behavior (timeouts, retries, attribution headers) stays consistent\n\t// without running through agent state/events. Retried via completeSummarization\n\t// so transient stream drops reuse the configured retry policy.\n\tconst context = { systemPrompt: SUMMARIZATION_SYSTEM_PROMPT, messages: summarizationMessages };\n\tconst requestOptions: BranchSummaryStreamOptions = { apiKey, headers, extraBody, env, signal, maxTokens };\n\tconst response = await completeSummarization(model, context, requestOptions, streamFn, retry, callbacks);\n\n\t// Check if aborted or errored\n\tif (response.stopReason === \"aborted\") {\n\t\treturn { aborted: true };\n\t}\n\tconst failure = getSummarizationFailure(response, \"Branch summarization\");\n\tif (failure) {\n\t\treturn { error: failure };\n\t}\n\tif (response.content.some((block) => block.type === \"toolCall\")) {\n\t\treturn { error: \"Branch summarization attempted to call a tool\" };\n\t}\n\n\tlet summary = contentTextForSummary(response.content);\n\n\t// Prepend preamble to provide context about the branch summary\n\tsummary = BRANCH_SUMMARY_PREAMBLE + summary;\n\n\t// Compute file lists and append to summary\n\tconst { readFiles, modifiedFiles } = computeFileLists(fileOps);\n\tsummary += formatFileOperations(readFiles, modifiedFiles);\n\n\treturn {\n\t\tsummary: summary || \"No summary generated\",\n\t\tusage: response.usage,\n\t\treadFiles,\n\t\tmodifiedFiles,\n\t};\n}\n"]}
@@ -1,4 +1,12 @@
1
+ import type { Model } from "@earendil-works/pi-ai";
1
2
  import type { IdealCompactionSettings } from "./compaction/ideal-compaction-settings.ts";
3
+ /** Token budgets overridden for one exact `provider/modelId` pair. */
4
+ export interface CompactionModelOverride {
5
+ reserveTokens?: number;
6
+ keepRecentTokens?: number;
7
+ }
8
+ /** The identity a compaction budget is resolved for; the session model satisfies it. */
9
+ export type CompactionModelSelector = Pick<Model<string>, "provider" | "id">;
2
10
  export interface CompactionSettings extends IdealCompactionSettings {
3
11
  enabled?: boolean;
4
12
  reserveTokens?: number;
@@ -18,8 +26,16 @@ export interface CompactionSettings extends IdealCompactionSettings {
18
26
  * cap); see `core/compaction/stream-watchdog.ts`.
19
27
  */
20
28
  summarizationMaxDurationMs?: number;
29
+ /** Per-model token budgets, keyed by the exact `provider/modelId` pair (no wildcards). */
30
+ modelOverrides?: Record<string, CompactionModelOverride>;
21
31
  }
22
32
  export declare function compactionEnabled(settings?: CompactionSettings): boolean;
23
- export declare function compactionReserveTokens(settings?: CompactionSettings): number;
24
- export declare function compactionKeepRecentTokens(settings?: CompactionSettings): number;
33
+ /**
34
+ * Resolve one token budget through the model override, then the ordinary setting,
35
+ * then the built-in default. A configured-but-invalid value is an error rather than
36
+ * a silent fallback, so a typo cannot quietly change the compaction budget.
37
+ */
38
+ export declare function compactionTokenSetting(settings: CompactionSettings | undefined, field: keyof CompactionModelOverride, forModel?: CompactionModelSelector): number;
39
+ export declare function compactionReserveTokens(settings?: CompactionSettings, forModel?: CompactionModelSelector): number;
40
+ export declare function compactionKeepRecentTokens(settings?: CompactionSettings, forModel?: CompactionModelSelector): number;
25
41
  //# sourceMappingURL=compaction-settings-access.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"compaction-settings-access.d.ts","sourceRoot":"","sources":["../../src/core/compaction-settings-access.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AAEzF,MAAM,WAAW,kBAAmB,SAAQ,uBAAuB;IAClE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;;;OAIG;IACH,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H,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,0FAA0F;IAC1F,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAC;CACzD;AAeD,wBAAgB,iBAAiB,CAAC,QAAQ,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAExE;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CACrC,QAAQ,EAAE,kBAAkB,GAAG,SAAS,EACxC,KAAK,EAAE,MAAM,uBAAuB,EACpC,QAAQ,CAAC,EAAE,uBAAuB,GAChC,MAAM,CAsBR;AAED,wBAAgB,uBAAuB,CAAC,QAAQ,CAAC,EAAE,kBAAkB,EAAE,QAAQ,CAAC,EAAE,uBAAuB,GAAG,MAAM,CAEjH;AACD,wBAAgB,0BAA0B,CAAC,QAAQ,CAAC,EAAE,kBAAkB,EAAE,QAAQ,CAAC,EAAE,uBAAuB,GAAG,MAAM,CAEpH"}
@@ -1,10 +1,41 @@
1
+ const DEFAULT_COMPACTION_TOKEN_SETTINGS = {
2
+ reserveTokens: 16384,
3
+ keepRecentTokens: 20000,
4
+ };
5
+ function isPlainObject(value) {
6
+ return typeof value === "object" && value !== null && !Array.isArray(value);
7
+ }
8
+ function isNonNegativeSafeInteger(value) {
9
+ return typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
10
+ }
1
11
  export function compactionEnabled(settings) {
2
12
  return settings?.enabled ?? true;
3
13
  }
4
- export function compactionReserveTokens(settings) {
5
- return settings?.reserveTokens ?? 16384;
14
+ /**
15
+ * Resolve one token budget through the model override, then the ordinary setting,
16
+ * then the built-in default. A configured-but-invalid value is an error rather than
17
+ * a silent fallback, so a typo cannot quietly change the compaction budget.
18
+ */
19
+ export function compactionTokenSetting(settings, field, forModel) {
20
+ const ordinary = settings?.[field];
21
+ if (ordinary !== undefined && !isNonNegativeSafeInteger(ordinary)) {
22
+ throw new Error(`Invalid compaction.${field} setting: ${String(ordinary)}. Expected a non-negative safe integer.`);
23
+ }
24
+ const modelKey = forModel ? `${forModel.provider}/${forModel.id}` : undefined;
25
+ const entry = modelKey !== undefined ? settings?.modelOverrides?.[modelKey] : undefined;
26
+ if (entry !== undefined && !isPlainObject(entry)) {
27
+ throw new Error(`Invalid compaction.modelOverrides["${modelKey}"] setting: ${String(entry)}. Expected an object.`);
28
+ }
29
+ const override = entry?.[field];
30
+ if (override !== undefined && !isNonNegativeSafeInteger(override)) {
31
+ throw new Error(`Invalid compaction.modelOverrides["${modelKey}"].${field} setting: ${String(override)}. Expected a non-negative safe integer.`);
32
+ }
33
+ return override ?? ordinary ?? DEFAULT_COMPACTION_TOKEN_SETTINGS[field];
34
+ }
35
+ export function compactionReserveTokens(settings, forModel) {
36
+ return compactionTokenSetting(settings, "reserveTokens", forModel);
6
37
  }
7
- export function compactionKeepRecentTokens(settings) {
8
- return settings?.keepRecentTokens ?? 20000;
38
+ export function compactionKeepRecentTokens(settings, forModel) {
39
+ return compactionTokenSetting(settings, "keepRecentTokens", forModel);
9
40
  }
10
41
  //# sourceMappingURL=compaction-settings-access.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"compaction-settings-access.js","sourceRoot":"","sources":["../../src/core/compaction-settings-access.ts"],"names":[],"mappings":"AAuBA,MAAM,UAAU,iBAAiB,CAAC,QAA6B;IAC9D,OAAO,QAAQ,EAAE,OAAO,IAAI,IAAI,CAAC;AAClC,CAAC;AACD,MAAM,UAAU,uBAAuB,CAAC,QAA6B;IACpE,OAAO,QAAQ,EAAE,aAAa,IAAI,KAAK,CAAC;AACzC,CAAC;AACD,MAAM,UAAU,0BAA0B,CAAC,QAA6B;IACvE,OAAO,QAAQ,EAAE,gBAAgB,IAAI,KAAK,CAAC;AAC5C,CAAC","sourcesContent":["import type { IdealCompactionSettings } from \"./compaction/ideal-compaction-settings.ts\";\n\nexport interface CompactionSettings extends IdealCompactionSettings {\n\tenabled?: boolean; // default: true\n\treserveTokens?: number; // default: 16384\n\tkeepRecentTokens?: number; // default: 20000\n\tspeculativeEnabled?: boolean; // default: true\n\tspeculativeFraction?: number; // default: 0.75\n\tspeculativeCooldownMs?: number; // default: 30000\n\trestorationEnabled?: boolean; // default: true\n\trestorationMaxItems?: number; // default: 10\n\trestorationMaxTokensPerItem?: number; // default: 5000\n\trestorationMaxTotalTokens?: number; // default: 50000\n\trestorationContextRatio?: number; // default: 0.15\n\tidleCompactionEnabled?: boolean; // default: true\n\t/**\n\t * Optional override for one summarization attempt's wall-clock budget.\n\t * Default: size-adaptive (120s floor, 2ms per estimated input token, 30min\n\t * cap); see `core/compaction/stream-watchdog.ts`.\n\t */\n\tsummarizationMaxDurationMs?: number;\n}\n\nexport function compactionEnabled(settings?: CompactionSettings): boolean {\n\treturn settings?.enabled ?? true;\n}\nexport function compactionReserveTokens(settings?: CompactionSettings): number {\n\treturn settings?.reserveTokens ?? 16384;\n}\nexport function compactionKeepRecentTokens(settings?: CompactionSettings): number {\n\treturn settings?.keepRecentTokens ?? 20000;\n}\n"]}
1
+ {"version":3,"file":"compaction-settings-access.js","sourceRoot":"","sources":["../../src/core/compaction-settings-access.ts"],"names":[],"mappings":"AAmCA,MAAM,iCAAiC,GAAsC;IAC5E,aAAa,EAAE,KAAK;IACpB,gBAAgB,EAAE,KAAK;CACvB,CAAC;AAEF,SAAS,aAAa,CAAC,KAAc;IACpC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC7E,CAAC;AAED,SAAS,wBAAwB,CAAC,KAAc;IAC/C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AAC/E,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,QAA6B;IAC9D,OAAO,QAAQ,EAAE,OAAO,IAAI,IAAI,CAAC;AAClC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CACrC,QA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UAAU,0BAA0B,CAAC,QAA6B,EAAE,QAAkC;IAC3G,OAAO,sBAAsB,CAAC,QAAQ,EAAE,kBAAkB,EAAE,QAAQ,CAAC,CAAC;AACvE,CAAC","sourcesContent":["import type { Model } from \"@earendil-works/pi-ai\";\nimport type { IdealCompactionSettings } from \"./compaction/ideal-compaction-settings.ts\";\n\n/** Token budgets overridden for one exact `provider/modelId` pair. */\nexport interface CompactionModelOverride {\n\treserveTokens?: number;\n\tkeepRecentTokens?: number;\n}\n\n/** The identity a compaction budget is resolved for; the session model satisfies it. */\nexport type CompactionModelSelector = Pick<Model<string>, \"provider\" | \"id\">;\n\nexport interface CompactionSettings extends IdealCompactionSettings {\n\tenabled?: boolean; // default: true\n\treserveTokens?: number; // default: 16384\n\tkeepRecentTokens?: number; // default: 20000\n\tspeculativeEnabled?: boolean; // default: true\n\tspeculativeFraction?: number; // default: 0.75\n\tspeculativeCooldownMs?: number; // default: 30000\n\trestorationEnabled?: boolean; // default: true\n\trestorationMaxItems?: number; // default: 10\n\trestorationMaxTokensPerItem?: number; // default: 5000\n\trestorationMaxTotalTokens?: number; // default: 50000\n\trestorationContextRatio?: number; // default: 0.15\n\tidleCompactionEnabled?: boolean; // default: true\n\t/**\n\t * Optional override for one summarization attempt's wall-clock budget.\n\t * Default: size-adaptive (120s floor, 2ms per estimated input token, 30min\n\t * cap); see `core/compaction/stream-watchdog.ts`.\n\t */\n\tsummarizationMaxDurationMs?: number;\n\t/** Per-model token budgets, keyed by the exact `provider/modelId` pair (no wildcards). */\n\tmodelOverrides?: Record<string, CompactionModelOverride>;\n}\n\nconst DEFAULT_COMPACTION_TOKEN_SETTINGS: Required<CompactionModelOverride> = {\n\treserveTokens: 16384,\n\tkeepRecentTokens: 20000,\n};\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction isNonNegativeSafeInteger(value: unknown): value is number {\n\treturn typeof value === \"number\" && Number.isSafeInteger(value) && value >= 0;\n}\n\nexport function compactionEnabled(settings?: CompactionSettings): boolean {\n\treturn settings?.enabled ?? true;\n}\n\n/**\n * Resolve one token budget through the model override, then the ordinary setting,\n * then the built-in default. A configured-but-invalid value is an error rather than\n * a silent fallback, so a typo cannot quietly change the compaction budget.\n */\nexport function compactionTokenSetting(\n\tsettings: CompactionSettings | undefined,\n\tfield: keyof CompactionModelOverride,\n\tforModel?: CompactionModelSelector,\n): number {\n\tconst ordinary = settings?.[field];\n\tif (ordinary !== undefined && !isNonNegativeSafeInteger(ordinary)) {\n\t\tthrow new Error(\n\t\t\t`Invalid compaction.${field} setting: ${String(ordinary)}. Expected a non-negative safe integer.`,\n\t\t);\n\t}\n\n\tconst modelKey = forModel ? `${forModel.provider}/${forModel.id}` : undefined;\n\tconst entry = modelKey !== undefined ? settings?.modelOverrides?.[modelKey] : undefined;\n\tif (entry !== undefined && !isPlainObject(entry)) {\n\t\tthrow new Error(\n\t\t\t`Invalid compaction.modelOverrides[\"${modelKey}\"] setting: ${String(entry)}. Expected an object.`,\n\t\t);\n\t}\n\tconst override = entry?.[field];\n\tif (override !== undefined && !isNonNegativeSafeInteger(override)) {\n\t\tthrow new Error(\n\t\t\t`Invalid compaction.modelOverrides[\"${modelKey}\"].${field} setting: ${String(override)}. Expected a non-negative safe integer.`,\n\t\t);\n\t}\n\treturn override ?? ordinary ?? DEFAULT_COMPACTION_TOKEN_SETTINGS[field];\n}\n\nexport function compactionReserveTokens(settings?: CompactionSettings, forModel?: CompactionModelSelector): number {\n\treturn compactionTokenSetting(settings, \"reserveTokens\", forModel);\n}\nexport function compactionKeepRecentTokens(settings?: CompactionSettings, forModel?: CompactionModelSelector): number {\n\treturn compactionTokenSetting(settings, \"keepRecentTokens\", forModel);\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { CompactionSettings } from "./compaction-settings-access.ts";
1
+ import { type CompactionModelSelector, type CompactionSettings } from "./compaction-settings-access.ts";
2
2
  export interface ResolvedCompactionSettings {
3
3
  enabled: boolean;
4
4
  reserveTokens: number;
@@ -20,5 +20,5 @@ export interface ResolvedCompactionSettings {
20
20
  /** Positive finite number, or undefined for the size-adaptive default. */
21
21
  summarizationMaxDurationMs?: number;
22
22
  }
23
- export declare function resolveCompactionSettings(settings?: CompactionSettings): ResolvedCompactionSettings;
23
+ export declare function resolveCompactionSettings(settings?: CompactionSettings, forModel?: CompactionModelSelector): ResolvedCompactionSettings;
24
24
  //# sourceMappingURL=compaction-settings-resolver.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"compaction-settings-resolver.d.ts","sourceRoot":"","sources":["../../src/core/compaction-settings-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAE1E,MAAM,WAAW,0BAA0B;IAC1C,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,2BAA2B,EAAE,MAAM,CAAC;IACpC,yBAAyB,EAAE,MAAM,CAAC;IAClC,uBAAuB,EAAE,MAAM,CAAC;IAChC,qBAAqB,EAAE,OAAO,CAAC;IAC/B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,eAAe,EAAE,OAAO,CAAC;IACzB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,0EAA0E;IAC1E,0BAA0B,CAAC,EAAE,MAAM,CAAC;CACpC;AAyBD,wBAAgB,yBAAyB,CAAC,QAAQ,CAAC,EAAE,kBAAkB,GAAG,0BAA0B,CAmCnG"}
1
+ {"version":3,"file":"compaction-settings-resolver.d.ts","sourceRoot":"","sources":["../../src/core/compaction-settings-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EAGvB,MAAM,iCAAiC,CAAC;AAEzC,MAAM,WAAW,0BAA0B;IAC1C,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,2BAA2B,EAAE,MAAM,CAAC;IACpC,yBAAyB,EAAE,MAAM,CAAC;IAClC,uBAAuB,EAAE,MAAM,CAAC;IAChC,qBAAqB,EAAE,OAAO,CAAC;IAC/B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,eAAe,EAAE,OAAO,CAAC;IACzB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,0EAA0E;IAC1E,0BAA0B,CAAC,EAAE,MAAM,CAAC;CACpC;AAyBD,wBAAgB,yBAAyB,CACxC,QAAQ,CAAC,EAAE,kBAAkB,EAC7B,QAAQ,CAAC,EAAE,uBAAuB,GAChC,0BAA0B,CAqC5B"}
@@ -1,3 +1,4 @@
1
+ import { compactionKeepRecentTokens, compactionReserveTokens, } from "./compaction-settings-access.js";
1
2
  const DEFAULTS = {
2
3
  enabled: true,
3
4
  reserveTokens: 16384,
@@ -19,12 +20,14 @@ const DEFAULTS = {
19
20
  function finiteNumber(value, fallback, minimum = 0) {
20
21
  return typeof value === "number" && Number.isFinite(value) ? Math.max(minimum, value) : fallback;
21
22
  }
22
- export function resolveCompactionSettings(settings) {
23
+ export function resolveCompactionSettings(settings, forModel) {
23
24
  const raw = settings;
24
25
  return {
25
26
  enabled: typeof raw?.enabled === "boolean" ? raw.enabled : DEFAULTS.enabled,
26
- reserveTokens: finiteNumber(raw?.reserveTokens, DEFAULTS.reserveTokens),
27
- keepRecentTokens: finiteNumber(raw?.keepRecentTokens, DEFAULTS.keepRecentTokens),
27
+ // Token budgets resolve through the per-model override table and reject invalid
28
+ // configuration instead of clamping it.
29
+ reserveTokens: compactionReserveTokens(settings, forModel),
30
+ keepRecentTokens: compactionKeepRecentTokens(settings, forModel),
28
31
  speculativeEnabled: typeof raw?.speculativeEnabled === "boolean" ? raw.speculativeEnabled : DEFAULTS.speculativeEnabled,
29
32
  speculativeFraction: finiteNumber(raw?.speculativeFraction, DEFAULTS.speculativeFraction),
30
33
  speculativeCooldownMs: finiteNumber(raw?.speculativeCooldownMs, DEFAULTS.speculativeCooldownMs),
@@ -1 +1 @@
1
- {"version":3,"file":"compaction-settings-resolver.js","sourceRoot":"","sources":["../../src/core/compaction-settings-resolver.ts"],"names":[],"mappings":"AAwBA,MAAM,QAAQ,GAAG;IAChB,OAAO,EAAE,IAAI;IACb,aAAa,EAAE,KAAK;IACpB,gBAAgB,EAAE,KAAK;IACvB,kBAAkB,EAAE,IAAI;IACxB,mBAAmB,EAAE,IAAI;IACzB,qBAAqB,EAAE,KAAK;IAC5B,kBAAkB,EAAE,IAAI;IACxB,mBAAmB,EAAE,EAAE;IACvB,2BAA2B,EAAE,IAAI;IACjC,yBAAyB,EAAE,MAAM;IACjC,uBAAuB,EAAE,IAAI;IAC7B,qBAAqB,EAAE,IAAI;IAC3B,gBAAgB,EAAE,IAAI;IACtB,oBAAoB,EAAE,IAAI;IAC1B,eAAe,EAAE,IAAI;IACrB,qBAAqB,EAAE,IAAI;CAClB,CAAC;AAEX,SAAS,YAAY,CAAC,KAAc,EAAE,QAAgB,EAAE,OAAO,GAAG,CAAC;IAClE,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAA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./compaction-settings-access.ts\";\n\nexport interface ResolvedCompactionSettings {\n\tenabled: boolean;\n\treserveTokens: number;\n\tkeepRecentTokens: number;\n\tspeculativeEnabled: boolean;\n\tspeculativeFraction: number;\n\tspeculativeCooldownMs: number;\n\trestorationEnabled: boolean;\n\trestorationMaxItems: number;\n\trestorationMaxTokensPerItem: number;\n\trestorationMaxTotalTokens: number;\n\trestorationContextRatio: number;\n\tidleCompactionEnabled: boolean;\n\tgraceBandEnabled: boolean;\n\ttoolAdmissionEnabled: boolean;\n\treminderEnabled: boolean;\n\treserveScalingEnabled: boolean;\n\tspeculativeLeadTokens?: number;\n\t/** Positive finite number, or undefined for the size-adaptive default. */\n\tsummarizationMaxDurationMs?: number;\n}\n\nconst DEFAULTS = {\n\tenabled: true,\n\treserveTokens: 16384,\n\tkeepRecentTokens: 20000,\n\tspeculativeEnabled: true,\n\tspeculativeFraction: 0.75,\n\tspeculativeCooldownMs: 30000,\n\trestorationEnabled: true,\n\trestorationMaxItems: 10,\n\trestorationMaxTokensPerItem: 5000,\n\trestorationMaxTotalTokens: 50_000,\n\trestorationContextRatio: 0.15,\n\tidleCompactionEnabled: true,\n\tgraceBandEnabled: true,\n\ttoolAdmissionEnabled: true,\n\treminderEnabled: true,\n\treserveScalingEnabled: true,\n} as const;\n\nfunction finiteNumber(value: unknown, fallback: number, minimum = 0): number {\n\treturn typeof value === \"number\" && Number.isFinite(value) ? Math.max(minimum, value) : fallback;\n}\n\nexport function resolveCompactionSettings(settings?: CompactionSettings): ResolvedCompactionSettings {\n\tconst raw = settings as Record<string, unknown> | undefined;\n\treturn {\n\t\tenabled: typeof raw?.enabled === \"boolean\" ? raw.enabled : DEFAULTS.enabled,\n\t\treserveTokens: finiteNumber(raw?.reserveTokens, DEFAULTS.reserveTokens),\n\t\tkeepRecentTokens: finiteNumber(raw?.keepRecentTokens, DEFAULTS.keepRecentTokens),\n\t\tspeculativeEnabled:\n\t\t\ttypeof raw?.speculativeEnabled === \"boolean\" ? raw.speculativeEnabled : DEFAULTS.speculativeEnabled,\n\t\tspeculativeFraction: finiteNumber(raw?.speculativeFraction, DEFAULTS.speculativeFraction),\n\t\tspeculativeCooldownMs: finiteNumber(raw?.speculativeCooldownMs, DEFAULTS.speculativeCooldownMs),\n\t\trestorationEnabled:\n\t\t\ttypeof raw?.restorationEnabled === \"boolean\" ? raw.restorationEnabled : DEFAULTS.restorationEnabled,\n\t\trestorationMaxItems: finiteNumber(raw?.restorationMaxItems, DEFAULTS.restorationMaxItems),\n\t\trestorationMaxTokensPerItem: finiteNumber(raw?.restorationMaxTokensPerItem, DEFAULTS.restorationMaxTokensPerItem),\n\t\trestorationMaxTotalTokens: finiteNumber(raw?.restorationMaxTotalTokens, DEFAULTS.restorationMaxTotalTokens),\n\t\trestorationContextRatio: finiteNumber(raw?.restorationContextRatio, DEFAULTS.restorationContextRatio),\n\t\tidleCompactionEnabled:\n\t\t\ttypeof raw?.idleCompactionEnabled === \"boolean\" ? raw.idleCompactionEnabled : DEFAULTS.idleCompactionEnabled,\n\t\tgraceBandEnabled: typeof raw?.graceBandEnabled === \"boolean\" ? raw.graceBandEnabled : DEFAULTS.graceBandEnabled,\n\t\ttoolAdmissionEnabled:\n\t\t\ttypeof raw?.toolAdmissionEnabled === \"boolean\" ? raw.toolAdmissionEnabled : DEFAULTS.toolAdmissionEnabled,\n\t\treminderEnabled: typeof raw?.reminderEnabled === \"boolean\" ? raw.reminderEnabled : DEFAULTS.reminderEnabled,\n\t\treserveScalingEnabled:\n\t\t\ttypeof raw?.reserveScalingEnabled === \"boolean\" ? raw.reserveScalingEnabled : DEFAULTS.reserveScalingEnabled,\n\t\tspeculativeLeadTokens:\n\t\t\ttypeof raw?.speculativeLeadTokens === \"number\" && Number.isFinite(raw.speculativeLeadTokens)\n\t\t\t\t? Math.max(0, raw.speculativeLeadTokens)\n\t\t\t\t: undefined,\n\t\tsummarizationMaxDurationMs:\n\t\t\ttypeof raw?.summarizationMaxDurationMs === \"number\" &&\n\t\t\tNumber.isFinite(raw.summarizationMaxDurationMs) &&\n\t\t\traw.summarizationMaxDurationMs > 0\n\t\t\t\t? raw.summarizationMaxDurationMs\n\t\t\t\t: undefined,\n\t};\n}\n"]}
1
+ {"version":3,"file":"compaction-settings-resolver.js","sourceRoot":"","sources":["../../src/core/compaction-settings-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,0BAA0B,EAC1B,uBAAuB,GACvB,MAAM,iCAAiC,CAAC;AAwBzC,MAAM,QAAQ,GAAG;IAChB,OAAO,EAAE,IAAI;IACb,aAAa,EAAE,KAAK;IACpB,gBAAgB,EAAE,KAAK;IACvB,kBAAkB,EAAE,IAAI;IACxB,mBAAmB,EAAE,IAAI;IACzB,qBAAqB,EAAE,KAAK;IAC5B,kBAAkB,EAAE,IAAI;IACxB,mBAAmB,EAAE,EAAE;IACvB,2BAA2B,EAAE,IAAI;IACjC,yBAAyB,EAAE,MAAM;IACjC,uBAAuB,EAAE,IAAI;IAC7B,qBAAqB,EAAE,IAAI;IAC3B,gBAAgB,EAAE,IAAI;IACtB,oBAAoB,EAAE,IAAI;IAC1B,eAAe,EAAE,IAAI;IACrB,qBAAqB,EAAE,IAAI;CAClB,CAAC;AAEX,SAAS,YAAY,CAAC,KAAc,EAAE,QAAgB,EAAE,OAAO,GAAG,CAAC;IAClE,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;AAClG,CAAC;AAED,MAAM,UAAU,yBAAyB,CACxC,QAA6B,EAC7B,QAAkC;IAElC,MAAM,GAAG,GAAG,QAA+C,CAAC;IAC5D,OAAO;QACN,OAAO,EAAE,OAAO,GAAG,EAAE,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO;QAC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oB,EACnB,OAAO,GAAG,EAAE,oBAAoB,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC,CAAC,QAAQ,CAAC,oBAAoB;QAC1G,eAAe,EAAE,OAAO,GAAG,EAAE,eAAe,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,QAAQ,CAAC,eAAe;QAC3G,qBAAqB,EACpB,OAAO,GAAG,EAAE,qBAAqB,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC,CAAC,QAAQ,CAAC,qBAAqB;QAC7G,qBAAqB,EACpB,OAAO,GAAG,EAAE,qBAAqB,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,qBAAqB,CAAC;YAC3F,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,qBAAqB,CAAC;YACxC,CAAC,CAAC,SAAS;QACb,0BAA0B,EACzB,OAAO,GAAG,EAAE,0BAA0B,KAAK,QAAQ;YACnD,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,0BAA0B,CAAC;YAC/C,GAAG,CAAC,0BAA0B,GAAG,CAAC;YACjC,CAAC,CAAC,GAAG,CAAC,0BAA0B;YAChC,CAAC,CAAC,SAAS;KACb,CAAC;AACH,CAAC","sourcesContent":["import {\n\ttype CompactionModelSelector,\n\ttype CompactionSettings,\n\tcompactionKeepRecentTokens,\n\tcompactionReserveTokens,\n} from \"./compaction-settings-access.ts\";\n\nexport interface ResolvedCompactionSettings {\n\tenabled: boolean;\n\treserveTokens: number;\n\tkeepRecentTokens: number;\n\tspeculativeEnabled: boolean;\n\tspeculativeFraction: number;\n\tspeculativeCooldownMs: number;\n\trestorationEnabled: boolean;\n\trestorationMaxItems: number;\n\trestorationMaxTokensPerItem: number;\n\trestorationMaxTotalTokens: number;\n\trestorationContextRatio: number;\n\tidleCompactionEnabled: boolean;\n\tgraceBandEnabled: boolean;\n\ttoolAdmissionEnabled: boolean;\n\treminderEnabled: boolean;\n\treserveScalingEnabled: boolean;\n\tspeculativeLeadTokens?: number;\n\t/** Positive finite number, or undefined for the size-adaptive default. */\n\tsummarizationMaxDurationMs?: number;\n}\n\nconst DEFAULTS = {\n\tenabled: true,\n\treserveTokens: 16384,\n\tkeepRecentTokens: 20000,\n\tspeculativeEnabled: true,\n\tspeculativeFraction: 0.75,\n\tspeculativeCooldownMs: 30000,\n\trestorationEnabled: true,\n\trestorationMaxItems: 10,\n\trestorationMaxTokensPerItem: 5000,\n\trestorationMaxTotalTokens: 50_000,\n\trestorationContextRatio: 0.15,\n\tidleCompactionEnabled: true,\n\tgraceBandEnabled: true,\n\ttoolAdmissionEnabled: true,\n\treminderEnabled: true,\n\treserveScalingEnabled: true,\n} as const;\n\nfunction finiteNumber(value: unknown, fallback: number, minimum = 0): number {\n\treturn typeof value === \"number\" && Number.isFinite(value) ? Math.max(minimum, value) : fallback;\n}\n\nexport function resolveCompactionSettings(\n\tsettings?: CompactionSettings,\n\tforModel?: CompactionModelSelector,\n): ResolvedCompactionSettings {\n\tconst raw = settings as Record<string, unknown> | undefined;\n\treturn {\n\t\tenabled: typeof raw?.enabled === \"boolean\" ? raw.enabled : DEFAULTS.enabled,\n\t\t// Token budgets resolve through the per-model override table and reject invalid\n\t\t// configuration instead of clamping it.\n\t\treserveTokens: compactionReserveTokens(settings, forModel),\n\t\tkeepRecentTokens: compactionKeepRecentTokens(settings, forModel),\n\t\tspeculativeEnabled:\n\t\t\ttypeof raw?.speculativeEnabled === \"boolean\" ? raw.speculativeEnabled : DEFAULTS.speculativeEnabled,\n\t\tspeculativeFraction: finiteNumber(raw?.speculativeFraction, DEFAULTS.speculativeFraction),\n\t\tspeculativeCooldownMs: finiteNumber(raw?.speculativeCooldownMs, DEFAULTS.speculativeCooldownMs),\n\t\trestorationEnabled:\n\t\t\ttypeof raw?.restorationEnabled === \"boolean\" ? raw.restorationEnabled : DEFAULTS.restorationEnabled,\n\t\trestorationMaxItems: finiteNumber(raw?.restorationMaxItems, DEFAULTS.restorationMaxItems),\n\t\trestorationMaxTokensPerItem: finiteNumber(raw?.restorationMaxTokensPerItem, DEFAULTS.restorationMaxTokensPerItem),\n\t\trestorationMaxTotalTokens: finiteNumber(raw?.restorationMaxTotalTokens, DEFAULTS.restorationMaxTotalTokens),\n\t\trestorationContextRatio: finiteNumber(raw?.restorationContextRatio, DEFAULTS.restorationContextRatio),\n\t\tidleCompactionEnabled:\n\t\t\ttypeof raw?.idleCompactionEnabled === \"boolean\" ? raw.idleCompactionEnabled : DEFAULTS.idleCompactionEnabled,\n\t\tgraceBandEnabled: typeof raw?.graceBandEnabled === \"boolean\" ? raw.graceBandEnabled : DEFAULTS.graceBandEnabled,\n\t\ttoolAdmissionEnabled:\n\t\t\ttypeof raw?.toolAdmissionEnabled === \"boolean\" ? raw.toolAdmissionEnabled : DEFAULTS.toolAdmissionEnabled,\n\t\treminderEnabled: typeof raw?.reminderEnabled === \"boolean\" ? raw.reminderEnabled : DEFAULTS.reminderEnabled,\n\t\treserveScalingEnabled:\n\t\t\ttypeof raw?.reserveScalingEnabled === \"boolean\" ? raw.reserveScalingEnabled : DEFAULTS.reserveScalingEnabled,\n\t\tspeculativeLeadTokens:\n\t\t\ttypeof raw?.speculativeLeadTokens === \"number\" && Number.isFinite(raw.speculativeLeadTokens)\n\t\t\t\t? Math.max(0, raw.speculativeLeadTokens)\n\t\t\t\t: undefined,\n\t\tsummarizationMaxDurationMs:\n\t\t\ttypeof raw?.summarizationMaxDurationMs === \"number\" &&\n\t\t\tNumber.isFinite(raw.summarizationMaxDurationMs) &&\n\t\t\traw.summarizationMaxDurationMs > 0\n\t\t\t\t? raw.summarizationMaxDurationMs\n\t\t\t\t: undefined,\n\t};\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"extension.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/ask-user/extension.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAoB,MAAM,gBAAgB,CAAC;AAMrE,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,CAwC/D"}
1
+ {"version":3,"file":"extension.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/ask-user/extension.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAoB,MAAM,gBAAgB,CAAC;AAMrE,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,CAqD/D"}
@@ -1,3 +1,4 @@
1
+ import { APP_NAME } from "../../../../config.js";
1
2
  import { pickVariant, TOOL_NAMES } from "./family.js";
2
3
  import { getPendingQuestions } from "./registry.js";
3
4
  import { resumeDanglingQuestion } from "./resume.js";
@@ -8,6 +9,16 @@ export default function askUserExtension(pi) {
8
9
  type: "boolean",
9
10
  default: false,
10
11
  });
12
+ pi.registerCommand("answer", {
13
+ description: "Open the pending question",
14
+ handler: async (_args, ctx) => {
15
+ if (ctx.mode !== "tui") {
16
+ ctx.ui.notify(`/answer opens the pending question in the TUI; run ${APP_NAME} in TUI mode to use it.`, "info");
17
+ return;
18
+ }
19
+ // In TUI mode interactive-mode's text dispatch handles /answer first.
20
+ },
21
+ });
11
22
  const state = { timedOut: false, unavailable: false };
12
23
  let registered = false;
13
24
  const cancelPending = (ctx, message) => {
@@ -1 +1 @@
1
- {"version":3,"file":"extension.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/ask-user/extension.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAqB,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEjE,MAAM,CAAC,OAAO,UAA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CAAC;YACxD,UAAU,GAAG,IAAI,CAAC;QACnB,CAAC;QACD,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACzF,CAAC,CAAC;IACF,EAAE,CAAC,EAAE,CAAC,eAAe,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE;QAC3C,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC;QACvB,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC;QAC1B,IAAI,CAAC,GAAG,CAAC,CAAC;QACV,KAAK,sBAAsB,CAAC,EAAE,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,EAAE,CAAC,cAAc,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE;QAC1C,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,EAAE,CAAC,WAAW,EAAE,KAAK,IAAI,EAAE;QAC7B,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC;IACxB,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,EAAE,CAAC,kBAAkB,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE;QAC/C,aAAa,CAAC,GAAG,EAAE,gEAAgE,CAAC,CAAC;IACtF,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import type { ExtensionAPI, ExtensionContext } from \"../../types.ts\";\nimport { pickVariant, TOOL_NAMES } from \"./family.ts\";\nimport { getPendingQuestions } from \"./registry.ts\";\nimport { resumeDanglingQuestion } from \"./resume.ts\";\nimport { type AskUserState, createAskUserTool } from \"./tool.ts\";\n\nexport default function askUserExtension(pi: ExtensionAPI): void {\n\tpi.registerFlag(\"no-ask-user\", {\n\t\tdescription: \"Disable the built-in question tool.\",\n\t\ttype: \"boolean\",\n\t\tdefault: false,\n\t});\n\tconst state: AskUserState = { timedOut: false, unavailable: false };\n\tlet registered = false;\n\tconst cancelPending = (ctx: ExtensionContext, message: string) => {\n\t\tfor (const entry of getPendingQuestions(ctx.sessionManager.getSessionId())) entry.cancel(message);\n\t};\n\tconst sync = (ctx: ExtensionContext, model = ctx.model) => {\n\t\tconst rest = pi.getActiveTools().filter((name) => !Object.values(TOOL_NAMES).includes(name));\n\t\tif (ctx.getAskUserSettings?.().enabled === false || pi.getFlag(\"no-ask-user\") === true) {\n\t\t\tcancelPending(ctx, \"The pending question was cancelled because ask-user is disabled.\");\n\t\t\tpi.setActiveTools(rest);\n\t\t\treturn;\n\t\t}\n\t\tif (!registered) {\n\t\t\tpi.registerTool(createAskUserTool(\"codex\", pi, state));\n\t\t\tpi.registerTool(createAskUserTool(\"claude\", pi, state));\n\t\t\tregistered = true;\n\t\t}\n\t\tpi.setActiveTools(state.unavailable ? rest : [...rest, TOOL_NAMES[pickVariant(model)]]);\n\t};\n\tpi.on(\"session_start\", async (event, ctx) => {\n\t\tstate.timedOut = false;\n\t\tstate.unavailable = false;\n\t\tsync(ctx);\n\t\tvoid resumeDanglingQuestion(pi, event, ctx);\n\t});\n\tpi.on(\"model_select\", async (event, ctx) => {\n\t\tsync(ctx, event.model);\n\t});\n\tpi.on(\"agent_end\", async () => {\n\t\tstate.timedOut = false;\n\t});\n\tpi.on(\"session_shutdown\", async (_event, ctx) => {\n\t\tcancelPending(ctx, \"The pending question was cancelled because the session closed.\");\n\t});\n}\n"]}
1
+ {"version":3,"file":"extension.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/ask-user/extension.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACtD,OA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CAAC,EAAE,CAAC,WAAW,EAAE,KAAK,IAAI,EAAE;QAC7B,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC;IACxB,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,EAAE,CAAC,kBAAkB,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE;QAC/C,aAAa,CAAC,GAAG,EAAE,gEAAgE,CAAC,CAAC;IACtF,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { APP_NAME } from \"../../../../config.ts\";\nimport type { ExtensionAPI, ExtensionContext } from \"../../types.ts\";\nimport { pickVariant, TOOL_NAMES } from \"./family.ts\";\nimport { getPendingQuestions } from \"./registry.ts\";\nimport { resumeDanglingQuestion } from \"./resume.ts\";\nimport { type AskUserState, createAskUserTool } from \"./tool.ts\";\n\nexport default function askUserExtension(pi: ExtensionAPI): void {\n\tpi.registerFlag(\"no-ask-user\", {\n\t\tdescription: \"Disable the built-in question tool.\",\n\t\ttype: \"boolean\",\n\t\tdefault: false,\n\t});\n\tpi.registerCommand(\"answer\", {\n\t\tdescription: \"Open the pending question\",\n\t\thandler: async (_args, ctx) => {\n\t\t\tif (ctx.mode !== \"tui\") {\n\t\t\t\tctx.ui.notify(\n\t\t\t\t\t`/answer opens the pending question in the TUI; run ${APP_NAME} in TUI mode to use it.`,\n\t\t\t\t\t\"info\",\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// In TUI mode interactive-mode's text dispatch handles /answer first.\n\t\t},\n\t});\n\tconst state: AskUserState = { timedOut: false, unavailable: false };\n\tlet registered = false;\n\tconst cancelPending = (ctx: ExtensionContext, message: string) => {\n\t\tfor (const entry of getPendingQuestions(ctx.sessionManager.getSessionId())) entry.cancel(message);\n\t};\n\tconst sync = (ctx: ExtensionContext, model = ctx.model) => {\n\t\tconst rest = pi.getActiveTools().filter((name) => !Object.values(TOOL_NAMES).includes(name));\n\t\tif (ctx.getAskUserSettings?.().enabled === false || pi.getFlag(\"no-ask-user\") === true) {\n\t\t\tcancelPending(ctx, \"The pending question was cancelled because ask-user is disabled.\");\n\t\t\tpi.setActiveTools(rest);\n\t\t\treturn;\n\t\t}\n\t\tif (!registered) {\n\t\t\tpi.registerTool(createAskUserTool(\"codex\", pi, state));\n\t\t\tpi.registerTool(createAskUserTool(\"claude\", pi, state));\n\t\t\tregistered = true;\n\t\t}\n\t\tpi.setActiveTools(state.unavailable ? rest : [...rest, TOOL_NAMES[pickVariant(model)]]);\n\t};\n\tpi.on(\"session_start\", async (event, ctx) => {\n\t\tstate.timedOut = false;\n\t\tstate.unavailable = false;\n\t\tsync(ctx);\n\t\tvoid resumeDanglingQuestion(pi, event, ctx);\n\t});\n\tpi.on(\"model_select\", async (event, ctx) => {\n\t\tsync(ctx, event.model);\n\t});\n\tpi.on(\"agent_end\", async () => {\n\t\tstate.timedOut = false;\n\t});\n\tpi.on(\"session_shutdown\", async (_event, ctx) => {\n\t\tcancelPending(ctx, \"The pending question was cancelled because the session closed.\");\n\t});\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"presets.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/presets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,kCAAkC,CAAC;AA0BxF,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,oBAAoB,EAAqB,MAAM,eAAe,CAAC;AAEpG,YAAY,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAE1D,KAAK,kBAAkB,GAAG,OAAO,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;AAC5D,KAAK,6BAA6B,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,GAAG,UAAU,CAAC,GAAG;IAC1E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAA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a,CAC5B,KAAK,EAAE,6BAA6B,EACpC,QAAQ,EAAE,oBAAoB,EAC9B,OAAO,CAAC,EAAE,OAAO,CAAC,+BAA+B,CAAC,GAChD,oBAAoB,GAAG,SAAS,CAMlC"}
@@ -76,6 +76,12 @@ function hasKimiK3Signal(value) {
76
76
  function isKimiK3Model(model) {
77
77
  return hasKimiK3Signal(model.id) || (model.name !== undefined && hasKimiK3Signal(model.name));
78
78
  }
79
+ function hasSWE2Signal(value) {
80
+ return /(?:^|[/@:._-])swe-2-(?:high|max|low|high-lite)(?:$|[/@:._-])/.test(normalizeModelId(value));
81
+ }
82
+ function isSWE2Model(model) {
83
+ return hasSWE2Signal(model.id) || (model.name !== undefined && hasSWE2Signal(model.name));
84
+ }
79
85
  // DeepSeek V4 id shapes verified against the OpenRouter live API, models.dev,
80
86
  // and senpi's generated provider catalogs (2026-07-31): deepseek-v4-flash,
81
87
  // deepseek/deepseek-v4-flash-0731, deepseek-ai/DeepSeek-V4-Pro,
@@ -196,7 +202,7 @@ export function resolvePresetName(model, settings) {
196
202
  if (gpt5Version) {
197
203
  return gpt5Version;
198
204
  }
199
- if (isKimiK3Model(model)) {
205
+ if (isSWE2Model(model) || isKimiK3Model(model)) {
200
206
  return "kimi-k3";
201
207
  }
202
208
  if (isKimiK27Model(model)) {
@@ -1 +1 @@
1
- {"version":3,"file":"presets.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/presets.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC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;QACxC,gBAAgB,EAAE,OAAO,CAAC,gBAAgB,IAAI,EAAE;QAChD,YAAY,EAAE,OAAO,CAAC,YAAY,IAAI,EAAE;QACxC,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,EAAE;KAC5B,CAAC;AACH,CAAC;AAED,MAAM,UAAU,aAAa,CAC5B,KAAoC,EACpC,QAA8B,EAC9B,OAAkD;IAElD,MAAM,IAAI,GAAG,iBAAiB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IAChD,IAAI,CAAC,IAAI,EAAE,CAAC;QACX,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,OAAO,WAAW,CAAC,IAAI,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC;AACjD,CAAC","sourcesContent":["import type { Api, Model } from \"@earendil-works/pi-ai\";\nimport type { BuildDynamicSystemPromptOptions } from \"../../../dynamic-prompt/build.ts\";\nimport { buildClaudeFable5Prompt } from \"./claude-fable-5.ts\";\nimport { buildClaudeFable51Prompt } from \"./claude-fable-5-1.ts\";\nimport { buildClaudeOpus45Prompt } from \"./claude-opus-4-5.ts\";\nimport { buildClaudeOpus46Prompt } from \"./claude-opus-4-6.ts\";\nimport { buildClaudeOpus47Prompt } from \"./claude-opus-4-7.ts\";\nimport { buildClaudeOpus48Prompt } from \"./claude-opus-4-8.ts\";\nimport { buildClaudeOpus5Prompt } from \"./claude-opus-5.ts\";\nimport { buildDeepseekV41FlashPrompt } from \"./deepseek-v4-1-flash.ts\";\nimport { buildDeepseekV4FlashPrompt } from \"./deepseek-v4-flash.ts\";\nimport { buildDeepseekV4Flash0731Prompt } from \"./deepseek-v4-flash-0731.ts\";\nimport { buildDeepseekV4ProPrompt } from \"./deepseek-v4-pro.ts\";\nimport { buildGlm52Prompt } from \"./glm-5-2.ts\";\nimport { buildGlm53Prompt } from \"./glm-5-3.ts\";\nimport { buildGpt52Prompt } from \"./gpt-5.2.ts\";\nimport { buildGpt53CodexPrompt } from \"./gpt-5.3-codex.ts\";\nimport { buildGpt54Prompt } from \"./gpt-5.4.ts\";\nimport { buildGpt55Prompt } from \"./gpt-5.5.ts\";\nimport { buildGpt56Prompt } from \"./gpt-5.6.ts\";\nimport { buildGpt5Prompt } from \"./gpt-5.ts\";\nimport { buildGpt6AstraPrompt } from \"./gpt-6-astra.ts\";\nimport { buildGrok45Prompt } from \"./grok-4.5.ts\";\nimport { buildGrok46Prompt } from \"./grok-4.6.ts\";\nimport { buildKimiK26Prompt } from \"./kimi-k2-6.ts\";\nimport { buildKimiK27Prompt } from \"./kimi-k2-7.ts\";\nimport { buildKimiK3Prompt } from \"./kimi-k3.ts\";\nimport { type PromptPresetName, type PromptPresetSettings, parsePromptPreset } from \"./settings.ts\";\n\nexport type { PromptPresetSettings } from \"./settings.ts\";\n\ntype ResolvedPresetName = Exclude<PromptPresetName, \"auto\">;\ntype ModelWithPromptPresetMetadata = Pick<Model<Api>, \"id\" | \"provider\"> & {\n\tname?: string;\n\tpromptPreset?: string;\n};\n\nexport interface ResolvedPromptPreset {\n\tname: ResolvedPresetName;\n\tprompt: string;\n}\n\nfunction normalizeModelId(modelId: string): string {\n\treturn modelId.toLowerCase().replace(/\\s+/g, \"-\");\n}\n\n// GPT-6 Astra id shapes verified against the OpenAI model page, codex's\n// models.json, and Bedrock's catalog (2026-09-04): gpt-6-astra, gpt-6-astra-fast,\n// dated snapshots, openai/gpt-6-astra, openai.gpt-6-astra, global.openai.gpt-6-astra,\n// and the display name \"GPT-6 Astra\". Bare \"gpt-6\" and \"astra\" stay out: the guide\n// names no other GPT-6 model, and a future sibling deserves its own preset.\nfunction hasGpt6AstraSignal(value: string): boolean {\n\treturn /(?:^|[/@:._-])gpt[._-]?6[._-]astra(?:$|[/@:._-])/.test(normalizeModelId(value));\n}\n\nfunction isGpt6AstraModel(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasGpt6AstraSignal(model.id) || (model.name !== undefined && hasGpt6AstraSignal(model.name));\n}\n\ntype Gpt5Version = \"gpt-5.2\" | \"gpt-5.3-codex\" | \"gpt-5.4\" | \"gpt-5.5\" | \"gpt-5.6\";\n\nfunction extractGpt5Version(modelId: string): Gpt5Version | undefined {\n\tconst normalized = normalizeModelId(modelId);\n\tif (normalized.includes(\"gpt-5.6\")) {\n\t\treturn \"gpt-5.6\";\n\t}\n\tif (normalized.includes(\"gpt-5.5\")) {\n\t\treturn \"gpt-5.5\";\n\t}\n\tif (normalized.includes(\"gpt-5.4\")) {\n\t\treturn \"gpt-5.4\";\n\t}\n\tif (normalized.includes(\"gpt-5.3\")) {\n\t\treturn \"gpt-5.3-codex\";\n\t}\n\tif (normalized.includes(\"gpt-5.2\")) {\n\t\treturn \"gpt-5.2\";\n\t}\n\treturn undefined;\n}\n\nfunction hasKimiK26Signal(value: string): boolean {\n\treturn /(?:^|[/@._-])kimi-k2(?:[._-]|p)6(?:$|[/@._:-])/.test(normalizeModelId(value));\n}\n\nfunction isKimiK26Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasKimiK26Signal(model.id) || (model.name !== undefined && hasKimiK26Signal(model.name));\n}\n\nfunction hasKimiK27Signal(value: string): boolean {\n\treturn /(?:^|[/@._-])kimi-k2(?:[._-]|p)7(?:$|[/@._:-])/.test(normalizeModelId(value));\n}\n\nfunction isKimiK27Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasKimiK27Signal(model.id) || (model.name !== undefined && hasKimiK27Signal(model.name));\n}\n\nfunction hasKimiK3Signal(value: string): boolean {\n\tconst normalized = normalizeModelId(value);\n\treturn normalized === \"k3\" || /(?:^|[/@._-])kimi-k3(?:$|[/@._:-])/.test(normalized);\n}\n\nfunction isKimiK3Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasKimiK3Signal(model.id) || (model.name !== undefined && hasKimiK3Signal(model.name));\n}\n\n// DeepSeek V4 id shapes verified against the OpenRouter live API, models.dev,\n// and senpi's generated provider catalogs (2026-07-31): deepseek-v4-flash,\n// deepseek/deepseek-v4-flash-0731, deepseek-ai/DeepSeek-V4-Pro,\n// accounts/fireworks/models/deepseek-v4-flash, aihubmix's alicloud-deepseek-v4-*,\n// and trailing tags (:free, -free, :thinking, -nothinking, -cheaper, -lightning, -el).\nfunction hasDeepseekV4Flash0731Signal(value: string): boolean {\n\treturn /(?:^|[/@:._-])deepseek[._-]v4[._-]flash[._-]0731(?:$|[/@:._-])/.test(normalizeModelId(value));\n}\n\nfunction isDeepseekV4Flash0731Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn (\n\t\thasDeepseekV4Flash0731Signal(model.id) || (model.name !== undefined && hasDeepseekV4Flash0731Signal(model.name))\n\t);\n}\n\nfunction hasDeepseekV4FlashSignal(value: string): boolean {\n\treturn /(?:^|[/@:._-])deepseek[._-]v4[._-]flash(?:$|[/@:._-])/.test(normalizeModelId(value));\n}\n\nfunction isDeepseekV4FlashModel(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasDeepseekV4FlashSignal(model.id) || (model.name !== undefined && hasDeepseekV4FlashSignal(model.name));\n}\n\n// DeepSeek V4.1 Flash id shapes verified against models.dev and the provider\n// catalogs (2026-09-11): deepseek-flash (the official API name, also opencode-go),\n// deepseek-v4.1-flash and deepseek/deepseek-v4.1-flash[:thinking] (OpenRouter,\n// Vercel, requesty, kilo, ...), deepseek-ai/DeepSeek-V4.1-Flash (Hugging Face,\n// DeepInfra), accounts/fireworks/models/deepseek-v4p1-flash, venice's\n// deepseek-v4-1-flash, and the display name \"DeepSeek V4.1 Flash\".\nfunction hasDeepseekV41FlashSignal(value: string): boolean {\n\tconst normalized = normalizeModelId(value);\n\treturn (\n\t\t/(?:^|[/@:._-])deepseek[._-]v4(?:[._-]1|p1)[._-]flash(?:$|[/@:._-])/.test(normalized) ||\n\t\t/(?:^|[/@:._-])deepseek[._-]flash(?:$|[/@:._-])/.test(normalized)\n\t);\n}\n\nconst DEEPSEEK_OFFICIAL_PROVIDER = \"deepseek\";\n\n// DeepSeek retired V4 Flash on 2026-09-10: on the official API, deepseek-v4-flash\n// and deepseek-v4-flash-vision-exp are served by V4.1 Flash. Every other\n// provider still hosts the V4 weights under those names.\nfunction isRetiredOfficialDeepseekV4FlashAlias(model: ModelWithPromptPresetMetadata): boolean {\n\treturn model.provider === DEEPSEEK_OFFICIAL_PROVIDER && hasDeepseekV4FlashSignal(model.id);\n}\n\nfunction isDeepseekV41FlashModel(model: ModelWithPromptPresetMetadata): boolean {\n\treturn (\n\t\thasDeepseekV41FlashSignal(model.id) ||\n\t\t(model.name !== undefined && hasDeepseekV41FlashSignal(model.name)) ||\n\t\tisRetiredOfficialDeepseekV4FlashAlias(model)\n\t);\n}\n\nfunction hasDeepseekV4ProSignal(value: string): boolean {\n\treturn /(?:^|[/@:._-])deepseek[._-]v4[._-]pro(?:$|[/@:._-])/.test(normalizeModelId(value));\n}\n\nfunction isDeepseekV4ProModel(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasDeepseekV4ProSignal(model.id) || (model.name !== undefined && hasDeepseekV4ProSignal(model.name));\n}\n\nfunction hasGlm52Signal(value: string): boolean {\n\treturn /(?:^|[/@._-])glm(?:[._-]|p)5(?:[._-]|p)2(?:$|[/@._:-])/.test(normalizeModelId(value));\n}\n\nfunction isGlm52Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasGlm52Signal(model.id) || (model.name !== undefined && hasGlm52Signal(model.name));\n}\n\nfunction hasGlm53Signal(value: string): boolean {\n\treturn /(?:^|[/@._-])glm(?:[._-]|p)5(?:[._-]|p)3(?:$|[/@._:-])/.test(normalizeModelId(value));\n}\n\nfunction isGlm53Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasGlm53Signal(model.id) || (model.name !== undefined && hasGlm53Signal(model.name));\n}\n\nfunction hasGrok45Signal(value: string): boolean {\n\t// Match any Grok 4.5 id shape: grok-4.5, grok4.5, grok45, grok-4p5, provider:model,\n\t// path/prefix ids, and trailing tags (:thinking, -latest). Keep 4.3 / 4.20 / 3 out.\n\treturn /(?:^|[/@:._-])grok(?:[._-]|p)?4(?:[._-]|p)?5(?:$|[/@._:-])/.test(normalizeModelId(value));\n}\n\nfunction isGrok45Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasGrok45Signal(model.id) || (model.name !== undefined && hasGrok45Signal(model.name));\n}\n\nfunction hasGrok46Signal(value: string): boolean {\n\t// Same id shapes as hasGrok45Signal with a 4.6 minor version. Keep 4.5 / 4.3 / 4.20 / 3 out.\n\treturn /(?:^|[/@:._-])grok(?:[._-]|p)?4(?:[._-]|p)?6(?:$|[/@._:-])/.test(normalizeModelId(value));\n}\n\nfunction isGrok46Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasGrok46Signal(model.id) || (model.name !== undefined && hasGrok46Signal(model.name));\n}\n\n// Claude Mythos shares each Fable release's prompting guide (\"Prompting Claude\n// Fable 5.1\" covers Fable 5.1 and Mythos 5.1; \"Prompting Claude Fable 5\"\n// covers Fable 5 and Mythos 5), so Mythos ids route to the matching Fable preset.\nconst CLAUDE_FABLE_51_MARKERS = [\"fable-5-1\", \"fable-5.1\", \"mythos-5-1\", \"mythos-5.1\"] as const;\nconst CLAUDE_FABLE_5_MARKERS = [\"fable-5\", \"mythos-5\"] as const;\n\nfunction isClaudeFable51Model(modelId: string): boolean {\n\tconst normalized = normalizeModelId(modelId);\n\treturn CLAUDE_FABLE_51_MARKERS.some((marker) => normalized.includes(marker));\n}\n\nfunction isClaudeFable5Model(modelId: string): boolean {\n\tconst normalized = normalizeModelId(modelId);\n\treturn CLAUDE_FABLE_5_MARKERS.some((marker) => normalized.includes(marker));\n}\n\nfunction isClaudeOpus5Model(modelId: string): boolean {\n\treturn normalizeModelId(modelId).includes(\"opus-5\");\n}\n\ntype ClaudeOpusVersion = \"claude-opus-4-8\" | \"claude-opus-4-7\" | \"claude-opus-4-6\" | \"claude-opus-4-5\";\n\nfunction extractClaudeOpusVersion(modelId: string): ClaudeOpusVersion | undefined {\n\tconst normalized = normalizeModelId(modelId);\n\tif (normalized.includes(\"opus-4-8\")) {\n\t\treturn \"claude-opus-4-8\";\n\t}\n\tif (normalized.includes(\"opus-4-7\")) {\n\t\treturn \"claude-opus-4-7\";\n\t}\n\tif (normalized.includes(\"opus-4-6\")) {\n\t\treturn \"claude-opus-4-6\";\n\t}\n\tif (normalized.includes(\"opus-4-5\") || normalized.includes(\"opus-4.5\")) {\n\t\treturn \"claude-opus-4-5\";\n\t}\n\treturn undefined;\n}\n\nexport function resolvePresetName(\n\tmodel: ModelWithPromptPresetMetadata,\n\tsettings: PromptPresetSettings,\n): ResolvedPresetName | undefined {\n\tif (settings.promptPreset !== \"auto\") {\n\t\treturn settings.promptPreset;\n\t}\n\n\tconst modelPromptPreset = parsePromptPreset(model.promptPreset);\n\tif (modelPromptPreset && modelPromptPreset !== \"auto\") {\n\t\treturn modelPromptPreset;\n\t}\n\n\tif (isGpt6AstraModel(model)) {\n\t\treturn \"gpt-6-astra\";\n\t}\n\tconst gpt5Version = extractGpt5Version(model.id);\n\tif (gpt5Version) {\n\t\treturn gpt5Version;\n\t}\n\tif (isKimiK3Model(model)) {\n\t\treturn \"kimi-k3\";\n\t}\n\tif (isKimiK27Model(model)) {\n\t\treturn \"kimi-k2-7\";\n\t}\n\tif (isKimiK26Model(model)) {\n\t\treturn \"kimi-k2-6\";\n\t}\n\t// The dotted release must resolve before the generic fable-5 substring.\n\tif (isClaudeFable51Model(model.id)) {\n\t\treturn \"claude-fable-5-1\";\n\t}\n\tif (isClaudeFable5Model(model.id)) {\n\t\treturn \"claude-fable-5\";\n\t}\n\tif (isClaudeOpus5Model(model.id)) {\n\t\treturn \"claude-opus-5\";\n\t}\n\tconst claudeVersion = extractClaudeOpusVersion(model.id);\n\tif (claudeVersion) {\n\t\treturn claudeVersion;\n\t}\n\tif (isGlm53Model(model)) {\n\t\treturn \"glm-5.3\";\n\t}\n\tif (isGlm52Model(model)) {\n\t\treturn \"glm-5.2\";\n\t}\n\t// The dated snapshot must resolve before the generic flash alias.\n\tif (isDeepseekV4Flash0731Model(model)) {\n\t\treturn \"deepseek-v4-flash-0731\";\n\t}\n\tif (isDeepseekV41FlashModel(model)) {\n\t\treturn \"deepseek-v4-1-flash\";\n\t}\n\tif (isDeepseekV4FlashModel(model)) {\n\t\treturn \"deepseek-v4-flash\";\n\t}\n\tif (isDeepseekV4ProModel(model)) {\n\t\treturn \"deepseek-v4-pro\";\n\t}\n\tif (isGrok46Model(model)) {\n\t\treturn \"grok-4.6\";\n\t}\n\tif (isGrok45Model(model)) {\n\t\treturn \"grok-4.5\";\n\t}\n\treturn undefined;\n}\n\nfunction buildPreset(name: ResolvedPresetName, options: BuildDynamicSystemPromptOptions): ResolvedPromptPreset {\n\tswitch (name) {\n\t\tcase \"gpt-6-astra\":\n\t\t\treturn { name, prompt: buildGpt6AstraPrompt(options) };\n\t\tcase \"gpt-5.6\":\n\t\t\treturn { name, prompt: buildGpt56Prompt(options) };\n\t\tcase \"gpt-5.5\":\n\t\t\treturn { name, prompt: buildGpt55Prompt(options) };\n\t\tcase \"gpt-5.4\":\n\t\t\treturn { name, prompt: buildGpt54Prompt(options) };\n\t\tcase \"gpt-5.3-codex\":\n\t\t\treturn { name, prompt: buildGpt53CodexPrompt(options) };\n\t\tcase \"gpt-5.2\":\n\t\t\treturn { name, prompt: buildGpt52Prompt(options) };\n\t\tcase \"gpt-5\":\n\t\t\treturn { name, prompt: buildGpt5Prompt(options) };\n\t\tcase \"glm-5.3\":\n\t\t\treturn { name, prompt: buildGlm53Prompt(options) };\n\t\tcase \"glm-5.2\":\n\t\t\treturn { name, prompt: buildGlm52Prompt(options) };\n\t\tcase \"deepseek-v4-flash\":\n\t\t\treturn { name, prompt: buildDeepseekV4FlashPrompt(options) };\n\t\tcase \"deepseek-v4-flash-0731\":\n\t\t\treturn { name, prompt: buildDeepseekV4Flash0731Prompt(options) };\n\t\tcase \"deepseek-v4-1-flash\":\n\t\t\treturn { name, prompt: buildDeepseekV41FlashPrompt(options) };\n\t\tcase \"deepseek-v4-pro\":\n\t\t\treturn { name, prompt: buildDeepseekV4ProPrompt(options) };\n\t\tcase \"grok-4.6\":\n\t\t\treturn { name, prompt: buildGrok46Prompt(options) };\n\t\tcase \"grok-4.5\":\n\t\t\treturn { name, prompt: buildGrok45Prompt(options) };\n\t\tcase \"kimi-k3\":\n\t\t\treturn { name, prompt: buildKimiK3Prompt(options) };\n\t\tcase \"kimi-k2-7\":\n\t\t\treturn { name, prompt: buildKimiK27Prompt(options) };\n\t\tcase \"kimi-k2-6\":\n\t\t\treturn { name, prompt: buildKimiK26Prompt(options) };\n\t\tcase \"claude-fable-5-1\":\n\t\t\treturn { name, prompt: buildClaudeFable51Prompt(options) };\n\t\tcase \"claude-fable-5\":\n\t\t\treturn { name, prompt: buildClaudeFable5Prompt(options) };\n\t\tcase \"claude-opus-5\":\n\t\t\treturn { name, prompt: buildClaudeOpus5Prompt(options) };\n\t\tcase \"claude-opus-4-8\":\n\t\t\treturn { name, prompt: buildClaudeOpus48Prompt(options) };\n\t\tcase \"claude-opus-4-7\":\n\t\t\treturn { name, prompt: buildClaudeOpus47Prompt(options) };\n\t\tcase \"claude-opus-4-6\":\n\t\t\treturn { name, prompt: buildClaudeOpus46Prompt(options) };\n\t\tcase \"claude-opus-4-5\":\n\t\t\treturn { name, prompt: buildClaudeOpus45Prompt(options) };\n\t}\n}\n\nfunction withDefaults(options: Partial<BuildDynamicSystemPromptOptions> = {}): BuildDynamicSystemPromptOptions {\n\treturn {\n\t\tcwd: options.cwd ?? \"\",\n\t\tselectedTools: options.selectedTools ?? [],\n\t\ttoolSnippets: options.toolSnippets ?? {},\n\t\tpromptGuidelines: options.promptGuidelines ?? [],\n\t\tcontextFiles: options.contextFiles ?? [],\n\t\tskills: options.skills ?? [],\n\t};\n}\n\nexport function resolvePreset(\n\tmodel: ModelWithPromptPresetMetadata,\n\tsettings: PromptPresetSettings,\n\toptions?: Partial<BuildDynamicSystemPromptOptions>,\n): ResolvedPromptPreset | undefined {\n\tconst name = resolvePresetName(model, settings);\n\tif (!name) {\n\t\treturn undefined;\n\t}\n\treturn buildPreset(name, withDefaults(options));\n}\n"]}
1
+ {"version":3,"file":"presets.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/presets.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CA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AC,CAAC;AACjD,CAAC","sourcesContent":["import type { Api, Model } from \"@earendil-works/pi-ai\";\nimport type { BuildDynamicSystemPromptOptions } from \"../../../dynamic-prompt/build.ts\";\nimport { buildClaudeFable5Prompt } from \"./claude-fable-5.ts\";\nimport { buildClaudeFable51Prompt } from \"./claude-fable-5-1.ts\";\nimport { buildClaudeOpus45Prompt } from \"./claude-opus-4-5.ts\";\nimport { buildClaudeOpus46Prompt } from \"./claude-opus-4-6.ts\";\nimport { buildClaudeOpus47Prompt } from \"./claude-opus-4-7.ts\";\nimport { buildClaudeOpus48Prompt } from \"./claude-opus-4-8.ts\";\nimport { buildClaudeOpus5Prompt } from \"./claude-opus-5.ts\";\nimport { buildDeepseekV41FlashPrompt } from \"./deepseek-v4-1-flash.ts\";\nimport { buildDeepseekV4FlashPrompt } from \"./deepseek-v4-flash.ts\";\nimport { buildDeepseekV4Flash0731Prompt } from \"./deepseek-v4-flash-0731.ts\";\nimport { buildDeepseekV4ProPrompt } from \"./deepseek-v4-pro.ts\";\nimport { buildGlm52Prompt } from \"./glm-5-2.ts\";\nimport { buildGlm53Prompt } from \"./glm-5-3.ts\";\nimport { buildGpt52Prompt } from \"./gpt-5.2.ts\";\nimport { buildGpt53CodexPrompt } from \"./gpt-5.3-codex.ts\";\nimport { buildGpt54Prompt } from \"./gpt-5.4.ts\";\nimport { buildGpt55Prompt } from \"./gpt-5.5.ts\";\nimport { buildGpt56Prompt } from \"./gpt-5.6.ts\";\nimport { buildGpt5Prompt } from \"./gpt-5.ts\";\nimport { buildGpt6AstraPrompt } from \"./gpt-6-astra.ts\";\nimport { buildGrok45Prompt } from \"./grok-4.5.ts\";\nimport { buildGrok46Prompt } from \"./grok-4.6.ts\";\nimport { buildKimiK26Prompt } from \"./kimi-k2-6.ts\";\nimport { buildKimiK27Prompt } from \"./kimi-k2-7.ts\";\nimport { buildKimiK3Prompt } from \"./kimi-k3.ts\";\nimport { type PromptPresetName, type PromptPresetSettings, parsePromptPreset } from \"./settings.ts\";\n\nexport type { PromptPresetSettings } from \"./settings.ts\";\n\ntype ResolvedPresetName = Exclude<PromptPresetName, \"auto\">;\ntype ModelWithPromptPresetMetadata = Pick<Model<Api>, \"id\" | \"provider\"> & {\n\tname?: string;\n\tpromptPreset?: string;\n};\n\nexport interface ResolvedPromptPreset {\n\tname: ResolvedPresetName;\n\tprompt: string;\n}\n\nfunction normalizeModelId(modelId: string): string {\n\treturn modelId.toLowerCase().replace(/\\s+/g, \"-\");\n}\n\n// GPT-6 Astra id shapes verified against the OpenAI model page, codex's\n// models.json, and Bedrock's catalog (2026-09-04): gpt-6-astra, gpt-6-astra-fast,\n// dated snapshots, openai/gpt-6-astra, openai.gpt-6-astra, global.openai.gpt-6-astra,\n// and the display name \"GPT-6 Astra\". Bare \"gpt-6\" and \"astra\" stay out: the guide\n// names no other GPT-6 model, and a future sibling deserves its own preset.\nfunction hasGpt6AstraSignal(value: string): boolean {\n\treturn /(?:^|[/@:._-])gpt[._-]?6[._-]astra(?:$|[/@:._-])/.test(normalizeModelId(value));\n}\n\nfunction isGpt6AstraModel(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasGpt6AstraSignal(model.id) || (model.name !== undefined && hasGpt6AstraSignal(model.name));\n}\n\ntype Gpt5Version = \"gpt-5.2\" | \"gpt-5.3-codex\" | \"gpt-5.4\" | \"gpt-5.5\" | \"gpt-5.6\";\n\nfunction extractGpt5Version(modelId: string): Gpt5Version | undefined {\n\tconst normalized = normalizeModelId(modelId);\n\tif (normalized.includes(\"gpt-5.6\")) {\n\t\treturn \"gpt-5.6\";\n\t}\n\tif (normalized.includes(\"gpt-5.5\")) {\n\t\treturn \"gpt-5.5\";\n\t}\n\tif (normalized.includes(\"gpt-5.4\")) {\n\t\treturn \"gpt-5.4\";\n\t}\n\tif (normalized.includes(\"gpt-5.3\")) {\n\t\treturn \"gpt-5.3-codex\";\n\t}\n\tif (normalized.includes(\"gpt-5.2\")) {\n\t\treturn \"gpt-5.2\";\n\t}\n\treturn undefined;\n}\n\nfunction hasKimiK26Signal(value: string): boolean {\n\treturn /(?:^|[/@._-])kimi-k2(?:[._-]|p)6(?:$|[/@._:-])/.test(normalizeModelId(value));\n}\n\nfunction isKimiK26Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasKimiK26Signal(model.id) || (model.name !== undefined && hasKimiK26Signal(model.name));\n}\n\nfunction hasKimiK27Signal(value: string): boolean {\n\treturn /(?:^|[/@._-])kimi-k2(?:[._-]|p)7(?:$|[/@._:-])/.test(normalizeModelId(value));\n}\n\nfunction isKimiK27Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasKimiK27Signal(model.id) || (model.name !== undefined && hasKimiK27Signal(model.name));\n}\n\nfunction hasKimiK3Signal(value: string): boolean {\n\tconst normalized = normalizeModelId(value);\n\treturn normalized === \"k3\" || /(?:^|[/@._-])kimi-k3(?:$|[/@._:-])/.test(normalized);\n}\n\nfunction isKimiK3Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasKimiK3Signal(model.id) || (model.name !== undefined && hasKimiK3Signal(model.name));\n}\n\nfunction hasSWE2Signal(value: string): boolean {\n\treturn /(?:^|[/@:._-])swe-2-(?:high|max|low|high-lite)(?:$|[/@:._-])/.test(normalizeModelId(value));\n}\n\nfunction isSWE2Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasSWE2Signal(model.id) || (model.name !== undefined && hasSWE2Signal(model.name));\n}\n\n// DeepSeek V4 id shapes verified against the OpenRouter live API, models.dev,\n// and senpi's generated provider catalogs (2026-07-31): deepseek-v4-flash,\n// deepseek/deepseek-v4-flash-0731, deepseek-ai/DeepSeek-V4-Pro,\n// accounts/fireworks/models/deepseek-v4-flash, aihubmix's alicloud-deepseek-v4-*,\n// and trailing tags (:free, -free, :thinking, -nothinking, -cheaper, -lightning, -el).\nfunction hasDeepseekV4Flash0731Signal(value: string): boolean {\n\treturn /(?:^|[/@:._-])deepseek[._-]v4[._-]flash[._-]0731(?:$|[/@:._-])/.test(normalizeModelId(value));\n}\n\nfunction isDeepseekV4Flash0731Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn (\n\t\thasDeepseekV4Flash0731Signal(model.id) || (model.name !== undefined && hasDeepseekV4Flash0731Signal(model.name))\n\t);\n}\n\nfunction hasDeepseekV4FlashSignal(value: string): boolean {\n\treturn /(?:^|[/@:._-])deepseek[._-]v4[._-]flash(?:$|[/@:._-])/.test(normalizeModelId(value));\n}\n\nfunction isDeepseekV4FlashModel(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasDeepseekV4FlashSignal(model.id) || (model.name !== undefined && hasDeepseekV4FlashSignal(model.name));\n}\n\n// DeepSeek V4.1 Flash id shapes verified against models.dev and the provider\n// catalogs (2026-09-11): deepseek-flash (the official API name, also opencode-go),\n// deepseek-v4.1-flash and deepseek/deepseek-v4.1-flash[:thinking] (OpenRouter,\n// Vercel, requesty, kilo, ...), deepseek-ai/DeepSeek-V4.1-Flash (Hugging Face,\n// DeepInfra), accounts/fireworks/models/deepseek-v4p1-flash, venice's\n// deepseek-v4-1-flash, and the display name \"DeepSeek V4.1 Flash\".\nfunction hasDeepseekV41FlashSignal(value: string): boolean {\n\tconst normalized = normalizeModelId(value);\n\treturn (\n\t\t/(?:^|[/@:._-])deepseek[._-]v4(?:[._-]1|p1)[._-]flash(?:$|[/@:._-])/.test(normalized) ||\n\t\t/(?:^|[/@:._-])deepseek[._-]flash(?:$|[/@:._-])/.test(normalized)\n\t);\n}\n\nconst DEEPSEEK_OFFICIAL_PROVIDER = \"deepseek\";\n\n// DeepSeek retired V4 Flash on 2026-09-10: on the official API, deepseek-v4-flash\n// and deepseek-v4-flash-vision-exp are served by V4.1 Flash. Every other\n// provider still hosts the V4 weights under those names.\nfunction isRetiredOfficialDeepseekV4FlashAlias(model: ModelWithPromptPresetMetadata): boolean {\n\treturn model.provider === DEEPSEEK_OFFICIAL_PROVIDER && hasDeepseekV4FlashSignal(model.id);\n}\n\nfunction isDeepseekV41FlashModel(model: ModelWithPromptPresetMetadata): boolean {\n\treturn (\n\t\thasDeepseekV41FlashSignal(model.id) ||\n\t\t(model.name !== undefined && hasDeepseekV41FlashSignal(model.name)) ||\n\t\tisRetiredOfficialDeepseekV4FlashAlias(model)\n\t);\n}\n\nfunction hasDeepseekV4ProSignal(value: string): boolean {\n\treturn /(?:^|[/@:._-])deepseek[._-]v4[._-]pro(?:$|[/@:._-])/.test(normalizeModelId(value));\n}\n\nfunction isDeepseekV4ProModel(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasDeepseekV4ProSignal(model.id) || (model.name !== undefined && hasDeepseekV4ProSignal(model.name));\n}\n\nfunction hasGlm52Signal(value: string): boolean {\n\treturn /(?:^|[/@._-])glm(?:[._-]|p)5(?:[._-]|p)2(?:$|[/@._:-])/.test(normalizeModelId(value));\n}\n\nfunction isGlm52Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasGlm52Signal(model.id) || (model.name !== undefined && hasGlm52Signal(model.name));\n}\n\nfunction hasGlm53Signal(value: string): boolean {\n\treturn /(?:^|[/@._-])glm(?:[._-]|p)5(?:[._-]|p)3(?:$|[/@._:-])/.test(normalizeModelId(value));\n}\n\nfunction isGlm53Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasGlm53Signal(model.id) || (model.name !== undefined && hasGlm53Signal(model.name));\n}\n\nfunction hasGrok45Signal(value: string): boolean {\n\t// Match any Grok 4.5 id shape: grok-4.5, grok4.5, grok45, grok-4p5, provider:model,\n\t// path/prefix ids, and trailing tags (:thinking, -latest). Keep 4.3 / 4.20 / 3 out.\n\treturn /(?:^|[/@:._-])grok(?:[._-]|p)?4(?:[._-]|p)?5(?:$|[/@._:-])/.test(normalizeModelId(value));\n}\n\nfunction isGrok45Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasGrok45Signal(model.id) || (model.name !== undefined && hasGrok45Signal(model.name));\n}\n\nfunction hasGrok46Signal(value: string): boolean {\n\t// Same id shapes as hasGrok45Signal with a 4.6 minor version. Keep 4.5 / 4.3 / 4.20 / 3 out.\n\treturn /(?:^|[/@:._-])grok(?:[._-]|p)?4(?:[._-]|p)?6(?:$|[/@._:-])/.test(normalizeModelId(value));\n}\n\nfunction isGrok46Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasGrok46Signal(model.id) || (model.name !== undefined && hasGrok46Signal(model.name));\n}\n\n// Claude Mythos shares each Fable release's prompting guide (\"Prompting Claude\n// Fable 5.1\" covers Fable 5.1 and Mythos 5.1; \"Prompting Claude Fable 5\"\n// covers Fable 5 and Mythos 5), so Mythos ids route to the matching Fable preset.\nconst CLAUDE_FABLE_51_MARKERS = [\"fable-5-1\", \"fable-5.1\", \"mythos-5-1\", \"mythos-5.1\"] as const;\nconst CLAUDE_FABLE_5_MARKERS = [\"fable-5\", \"mythos-5\"] as const;\n\nfunction isClaudeFable51Model(modelId: string): boolean {\n\tconst normalized = normalizeModelId(modelId);\n\treturn CLAUDE_FABLE_51_MARKERS.some((marker) => normalized.includes(marker));\n}\n\nfunction isClaudeFable5Model(modelId: string): boolean {\n\tconst normalized = normalizeModelId(modelId);\n\treturn CLAUDE_FABLE_5_MARKERS.some((marker) => normalized.includes(marker));\n}\n\nfunction isClaudeOpus5Model(modelId: string): boolean {\n\treturn normalizeModelId(modelId).includes(\"opus-5\");\n}\n\ntype ClaudeOpusVersion = \"claude-opus-4-8\" | \"claude-opus-4-7\" | \"claude-opus-4-6\" | \"claude-opus-4-5\";\n\nfunction extractClaudeOpusVersion(modelId: string): ClaudeOpusVersion | undefined {\n\tconst normalized = normalizeModelId(modelId);\n\tif (normalized.includes(\"opus-4-8\")) {\n\t\treturn \"claude-opus-4-8\";\n\t}\n\tif (normalized.includes(\"opus-4-7\")) {\n\t\treturn \"claude-opus-4-7\";\n\t}\n\tif (normalized.includes(\"opus-4-6\")) {\n\t\treturn \"claude-opus-4-6\";\n\t}\n\tif (normalized.includes(\"opus-4-5\") || normalized.includes(\"opus-4.5\")) {\n\t\treturn \"claude-opus-4-5\";\n\t}\n\treturn undefined;\n}\n\nexport function resolvePresetName(\n\tmodel: ModelWithPromptPresetMetadata,\n\tsettings: PromptPresetSettings,\n): ResolvedPresetName | undefined {\n\tif (settings.promptPreset !== \"auto\") {\n\t\treturn settings.promptPreset;\n\t}\n\n\tconst modelPromptPreset = parsePromptPreset(model.promptPreset);\n\tif (modelPromptPreset && modelPromptPreset !== \"auto\") {\n\t\treturn modelPromptPreset;\n\t}\n\n\tif (isGpt6AstraModel(model)) {\n\t\treturn \"gpt-6-astra\";\n\t}\n\tconst gpt5Version = extractGpt5Version(model.id);\n\tif (gpt5Version) {\n\t\treturn gpt5Version;\n\t}\n\tif (isSWE2Model(model) || isKimiK3Model(model)) {\n\t\treturn \"kimi-k3\";\n\t}\n\tif (isKimiK27Model(model)) {\n\t\treturn \"kimi-k2-7\";\n\t}\n\tif (isKimiK26Model(model)) {\n\t\treturn \"kimi-k2-6\";\n\t}\n\t// The dotted release must resolve before the generic fable-5 substring.\n\tif (isClaudeFable51Model(model.id)) {\n\t\treturn \"claude-fable-5-1\";\n\t}\n\tif (isClaudeFable5Model(model.id)) {\n\t\treturn \"claude-fable-5\";\n\t}\n\tif (isClaudeOpus5Model(model.id)) {\n\t\treturn \"claude-opus-5\";\n\t}\n\tconst claudeVersion = extractClaudeOpusVersion(model.id);\n\tif (claudeVersion) {\n\t\treturn claudeVersion;\n\t}\n\tif (isGlm53Model(model)) {\n\t\treturn \"glm-5.3\";\n\t}\n\tif (isGlm52Model(model)) {\n\t\treturn \"glm-5.2\";\n\t}\n\t// The dated snapshot must resolve before the generic flash alias.\n\tif (isDeepseekV4Flash0731Model(model)) {\n\t\treturn \"deepseek-v4-flash-0731\";\n\t}\n\tif (isDeepseekV41FlashModel(model)) {\n\t\treturn \"deepseek-v4-1-flash\";\n\t}\n\tif (isDeepseekV4FlashModel(model)) {\n\t\treturn \"deepseek-v4-flash\";\n\t}\n\tif (isDeepseekV4ProModel(model)) {\n\t\treturn \"deepseek-v4-pro\";\n\t}\n\tif (isGrok46Model(model)) {\n\t\treturn \"grok-4.6\";\n\t}\n\tif (isGrok45Model(model)) {\n\t\treturn \"grok-4.5\";\n\t}\n\treturn undefined;\n}\n\nfunction buildPreset(name: ResolvedPresetName, options: BuildDynamicSystemPromptOptions): ResolvedPromptPreset {\n\tswitch (name) {\n\t\tcase \"gpt-6-astra\":\n\t\t\treturn { name, prompt: buildGpt6AstraPrompt(options) };\n\t\tcase \"gpt-5.6\":\n\t\t\treturn { name, prompt: buildGpt56Prompt(options) };\n\t\tcase \"gpt-5.5\":\n\t\t\treturn { name, prompt: buildGpt55Prompt(options) };\n\t\tcase \"gpt-5.4\":\n\t\t\treturn { name, prompt: buildGpt54Prompt(options) };\n\t\tcase \"gpt-5.3-codex\":\n\t\t\treturn { name, prompt: buildGpt53CodexPrompt(options) };\n\t\tcase \"gpt-5.2\":\n\t\t\treturn { name, prompt: buildGpt52Prompt(options) };\n\t\tcase \"gpt-5\":\n\t\t\treturn { name, prompt: buildGpt5Prompt(options) };\n\t\tcase \"glm-5.3\":\n\t\t\treturn { name, prompt: buildGlm53Prompt(options) };\n\t\tcase \"glm-5.2\":\n\t\t\treturn { name, prompt: buildGlm52Prompt(options) };\n\t\tcase \"deepseek-v4-flash\":\n\t\t\treturn { name, prompt: buildDeepseekV4FlashPrompt(options) };\n\t\tcase \"deepseek-v4-flash-0731\":\n\t\t\treturn { name, prompt: buildDeepseekV4Flash0731Prompt(options) };\n\t\tcase \"deepseek-v4-1-flash\":\n\t\t\treturn { name, prompt: buildDeepseekV41FlashPrompt(options) };\n\t\tcase \"deepseek-v4-pro\":\n\t\t\treturn { name, prompt: buildDeepseekV4ProPrompt(options) };\n\t\tcase \"grok-4.6\":\n\t\t\treturn { name, prompt: buildGrok46Prompt(options) };\n\t\tcase \"grok-4.5\":\n\t\t\treturn { name, prompt: buildGrok45Prompt(options) };\n\t\tcase \"kimi-k3\":\n\t\t\treturn { name, prompt: buildKimiK3Prompt(options) };\n\t\tcase \"kimi-k2-7\":\n\t\t\treturn { name, prompt: buildKimiK27Prompt(options) };\n\t\tcase \"kimi-k2-6\":\n\t\t\treturn { name, prompt: buildKimiK26Prompt(options) };\n\t\tcase \"claude-fable-5-1\":\n\t\t\treturn { name, prompt: buildClaudeFable51Prompt(options) };\n\t\tcase \"claude-fable-5\":\n\t\t\treturn { name, prompt: buildClaudeFable5Prompt(options) };\n\t\tcase \"claude-opus-5\":\n\t\t\treturn { name, prompt: buildClaudeOpus5Prompt(options) };\n\t\tcase \"claude-opus-4-8\":\n\t\t\treturn { name, prompt: buildClaudeOpus48Prompt(options) };\n\t\tcase \"claude-opus-4-7\":\n\t\t\treturn { name, prompt: buildClaudeOpus47Prompt(options) };\n\t\tcase \"claude-opus-4-6\":\n\t\t\treturn { name, prompt: buildClaudeOpus46Prompt(options) };\n\t\tcase \"claude-opus-4-5\":\n\t\t\treturn { name, prompt: buildClaudeOpus45Prompt(options) };\n\t}\n}\n\nfunction withDefaults(options: Partial<BuildDynamicSystemPromptOptions> = {}): BuildDynamicSystemPromptOptions {\n\treturn {\n\t\tcwd: options.cwd ?? \"\",\n\t\tselectedTools: options.selectedTools ?? [],\n\t\ttoolSnippets: options.toolSnippets ?? {},\n\t\tpromptGuidelines: options.promptGuidelines ?? [],\n\t\tcontextFiles: options.contextFiles ?? [],\n\t\tskills: options.skills ?? [],\n\t};\n}\n\nexport function resolvePreset(\n\tmodel: ModelWithPromptPresetMetadata,\n\tsettings: PromptPresetSettings,\n\toptions?: Partial<BuildDynamicSystemPromptOptions>,\n): ResolvedPromptPreset | undefined {\n\tconst name = resolvePresetName(model, settings);\n\tif (!name) {\n\t\treturn undefined;\n\t}\n\treturn buildPreset(name, withDefaults(options));\n}\n"]}