@code-yeongyu/senpi 2026.8.1 → 2026.8.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 (988) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +1 -0
  3. package/dist/cli/args.d.ts +2 -0
  4. package/dist/cli/args.d.ts.map +1 -1
  5. package/dist/cli/args.js +27 -0
  6. package/dist/cli/args.js.map +1 -1
  7. package/dist/cli/credential-print.d.ts +23 -0
  8. package/dist/cli/credential-print.d.ts.map +1 -0
  9. package/dist/cli/credential-print.js +116 -0
  10. package/dist/cli/credential-print.js.map +1 -0
  11. package/dist/client/index.d.ts +3 -0
  12. package/dist/client/index.d.ts.map +1 -0
  13. package/dist/client/index.js +3 -0
  14. package/dist/client/index.js.map +1 -0
  15. package/dist/client/remote-session.d.ts +53 -0
  16. package/dist/client/remote-session.d.ts.map +1 -0
  17. package/dist/client/remote-session.js +340 -0
  18. package/dist/client/remote-session.js.map +1 -0
  19. package/dist/client/transcript.d.ts +12 -0
  20. package/dist/client/transcript.d.ts.map +1 -0
  21. package/dist/client/transcript.js +98 -0
  22. package/dist/client/transcript.js.map +1 -0
  23. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  24. package/dist/core/agent-session-runtime.js +3 -0
  25. package/dist/core/agent-session-runtime.js.map +1 -1
  26. package/dist/core/agent-session.d.ts +36 -1
  27. package/dist/core/agent-session.d.ts.map +1 -1
  28. package/dist/core/agent-session.js +325 -41
  29. package/dist/core/agent-session.js.map +1 -1
  30. package/dist/core/auth-storage.d.ts +5 -0
  31. package/dist/core/auth-storage.d.ts.map +1 -1
  32. package/dist/core/auth-storage.js +72 -11
  33. package/dist/core/auth-storage.js.map +1 -1
  34. package/dist/core/dynamic-prompt/verification.d.ts +2 -2
  35. package/dist/core/dynamic-prompt/verification.d.ts.map +1 -1
  36. package/dist/core/dynamic-prompt/verification.js +2 -2
  37. package/dist/core/dynamic-prompt/verification.js.map +1 -1
  38. package/dist/core/extensions/builtin/claude-sdk-oauth/bounded-queue.d.ts +17 -0
  39. package/dist/core/extensions/builtin/claude-sdk-oauth/bounded-queue.d.ts.map +1 -0
  40. package/dist/core/extensions/builtin/claude-sdk-oauth/bounded-queue.js +56 -0
  41. package/dist/core/extensions/builtin/claude-sdk-oauth/bounded-queue.js.map +1 -0
  42. package/dist/core/extensions/builtin/claude-sdk-oauth/sdk-boundary.d.ts +1 -0
  43. package/dist/core/extensions/builtin/claude-sdk-oauth/sdk-boundary.d.ts.map +1 -1
  44. package/dist/core/extensions/builtin/claude-sdk-oauth/sdk-boundary.js.map +1 -1
  45. package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding.d.ts +32 -0
  46. package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding.d.ts.map +1 -0
  47. package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding.js +43 -0
  48. package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding.js.map +1 -0
  49. package/dist/core/extensions/builtin/claude-sdk-oauth/session-commit-boundary.d.ts +18 -0
  50. package/dist/core/extensions/builtin/claude-sdk-oauth/session-commit-boundary.d.ts.map +1 -0
  51. package/dist/core/extensions/builtin/claude-sdk-oauth/session-commit-boundary.js +46 -0
  52. package/dist/core/extensions/builtin/claude-sdk-oauth/session-commit-boundary.js.map +1 -0
  53. package/dist/core/extensions/builtin/claude-sdk-oauth/session-continuity.d.ts +81 -0
  54. package/dist/core/extensions/builtin/claude-sdk-oauth/session-continuity.d.ts.map +1 -0
  55. package/dist/core/extensions/builtin/claude-sdk-oauth/session-continuity.js +127 -0
  56. package/dist/core/extensions/builtin/claude-sdk-oauth/session-continuity.js.map +1 -0
  57. package/dist/core/extensions/builtin/claude-sdk-oauth/session-entry-annotations.d.ts +10 -0
  58. package/dist/core/extensions/builtin/claude-sdk-oauth/session-entry-annotations.d.ts.map +1 -0
  59. package/dist/core/extensions/builtin/claude-sdk-oauth/session-entry-annotations.js +34 -0
  60. package/dist/core/extensions/builtin/claude-sdk-oauth/session-entry-annotations.js.map +1 -0
  61. package/dist/core/extensions/builtin/claude-sdk-oauth/session-observability.d.ts +56 -0
  62. package/dist/core/extensions/builtin/claude-sdk-oauth/session-observability.d.ts.map +1 -0
  63. package/dist/core/extensions/builtin/claude-sdk-oauth/session-observability.js +174 -0
  64. package/dist/core/extensions/builtin/claude-sdk-oauth/session-observability.js.map +1 -0
  65. package/dist/core/extensions/builtin/claude-sdk-oauth/session-reaper.d.ts +24 -0
  66. package/dist/core/extensions/builtin/claude-sdk-oauth/session-reaper.d.ts.map +1 -0
  67. package/dist/core/extensions/builtin/claude-sdk-oauth/session-reaper.js +34 -0
  68. package/dist/core/extensions/builtin/claude-sdk-oauth/session-reaper.js.map +1 -0
  69. package/dist/core/extensions/builtin/claude-sdk-oauth/session-reattach.d.ts +34 -0
  70. package/dist/core/extensions/builtin/claude-sdk-oauth/session-reattach.d.ts.map +1 -0
  71. package/dist/core/extensions/builtin/claude-sdk-oauth/session-reattach.js +85 -0
  72. package/dist/core/extensions/builtin/claude-sdk-oauth/session-reattach.js.map +1 -0
  73. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-pump.d.ts +2 -13
  74. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-pump.d.ts.map +1 -1
  75. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-pump.js +34 -55
  76. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-pump.js.map +1 -1
  77. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-wiring.d.ts.map +1 -1
  78. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-wiring.js +35 -93
  79. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-wiring.js.map +1 -1
  80. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry.d.ts +13 -11
  81. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry.d.ts.map +1 -1
  82. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry.js +44 -55
  83. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry.js.map +1 -1
  84. package/dist/core/extensions/builtin/claude-sdk-oauth/session-stream.d.ts +3 -1
  85. package/dist/core/extensions/builtin/claude-sdk-oauth/session-stream.d.ts.map +1 -1
  86. package/dist/core/extensions/builtin/claude-sdk-oauth/session-stream.js +101 -126
  87. package/dist/core/extensions/builtin/claude-sdk-oauth/session-stream.js.map +1 -1
  88. package/dist/core/extensions/builtin/claude-sdk-oauth/session-sync.d.ts +2 -31
  89. package/dist/core/extensions/builtin/claude-sdk-oauth/session-sync.d.ts.map +1 -1
  90. package/dist/core/extensions/builtin/claude-sdk-oauth/session-sync.js +26 -98
  91. package/dist/core/extensions/builtin/claude-sdk-oauth/session-sync.js.map +1 -1
  92. package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-claim.d.ts +14 -0
  93. package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-claim.d.ts.map +1 -0
  94. package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-claim.js +42 -0
  95. package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-claim.js.map +1 -0
  96. package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-types.d.ts +32 -0
  97. package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-types.d.ts.map +1 -0
  98. package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-types.js +8 -0
  99. package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-types.js.map +1 -0
  100. package/dist/core/extensions/builtin/claude-sdk-oauth/stream-events.d.ts +16 -0
  101. package/dist/core/extensions/builtin/claude-sdk-oauth/stream-events.d.ts.map +1 -0
  102. package/dist/core/extensions/builtin/claude-sdk-oauth/stream-events.js +92 -0
  103. package/dist/core/extensions/builtin/claude-sdk-oauth/stream-events.js.map +1 -0
  104. package/dist/core/extensions/builtin/claude-sdk-oauth/stream.d.ts.map +1 -1
  105. package/dist/core/extensions/builtin/claude-sdk-oauth/stream.js +48 -88
  106. package/dist/core/extensions/builtin/claude-sdk-oauth/stream.js.map +1 -1
  107. package/dist/core/extensions/builtin/claude-sdk-oauth/tools.d.ts +1 -0
  108. package/dist/core/extensions/builtin/claude-sdk-oauth/tools.d.ts.map +1 -1
  109. package/dist/core/extensions/builtin/claude-sdk-oauth/tools.js +1 -0
  110. package/dist/core/extensions/builtin/claude-sdk-oauth/tools.js.map +1 -1
  111. package/dist/core/extensions/builtin/compaction/checkpoint-state.d.ts +18 -1
  112. package/dist/core/extensions/builtin/compaction/checkpoint-state.d.ts.map +1 -1
  113. package/dist/core/extensions/builtin/compaction/checkpoint-state.js +32 -0
  114. package/dist/core/extensions/builtin/compaction/checkpoint-state.js.map +1 -1
  115. package/dist/core/extensions/builtin/compaction/deterministic-fallback.d.ts +1 -1
  116. package/dist/core/extensions/builtin/compaction/deterministic-fallback.d.ts.map +1 -1
  117. package/dist/core/extensions/builtin/compaction/deterministic-fallback.js +4 -0
  118. package/dist/core/extensions/builtin/compaction/deterministic-fallback.js.map +1 -1
  119. package/dist/core/extensions/builtin/compaction/idle-retry.d.ts +21 -0
  120. package/dist/core/extensions/builtin/compaction/idle-retry.d.ts.map +1 -0
  121. package/dist/core/extensions/builtin/compaction/idle-retry.js +24 -0
  122. package/dist/core/extensions/builtin/compaction/idle-retry.js.map +1 -0
  123. package/dist/core/extensions/builtin/compaction/index.d.ts.map +1 -1
  124. package/dist/core/extensions/builtin/compaction/index.js +91 -13
  125. package/dist/core/extensions/builtin/compaction/index.js.map +1 -1
  126. package/dist/core/extensions/builtin/compaction/lane-policy.d.ts +71 -0
  127. package/dist/core/extensions/builtin/compaction/lane-policy.d.ts.map +1 -0
  128. package/dist/core/extensions/builtin/compaction/lane-policy.js +94 -0
  129. package/dist/core/extensions/builtin/compaction/lane-policy.js.map +1 -0
  130. package/dist/core/extensions/builtin/compaction/log.d.ts.map +1 -1
  131. package/dist/core/extensions/builtin/compaction/log.js +1 -0
  132. package/dist/core/extensions/builtin/compaction/log.js.map +1 -1
  133. package/dist/core/extensions/builtin/compaction/overflow-retry.d.ts +59 -0
  134. package/dist/core/extensions/builtin/compaction/overflow-retry.d.ts.map +1 -0
  135. package/dist/core/extensions/builtin/compaction/overflow-retry.js +155 -0
  136. package/dist/core/extensions/builtin/compaction/overflow-retry.js.map +1 -0
  137. package/dist/core/extensions/builtin/compaction/speculative.d.ts.map +1 -1
  138. package/dist/core/extensions/builtin/compaction/speculative.js +17 -98
  139. package/dist/core/extensions/builtin/compaction/speculative.js.map +1 -1
  140. package/dist/core/extensions/builtin/compaction/transient-failure.d.ts.map +1 -1
  141. package/dist/core/extensions/builtin/compaction/transient-failure.js +3 -0
  142. package/dist/core/extensions/builtin/compaction/transient-failure.js.map +1 -1
  143. package/dist/core/extensions/builtin/gpt-apply-patch/apply.d.ts +1 -0
  144. package/dist/core/extensions/builtin/gpt-apply-patch/apply.d.ts.map +1 -1
  145. package/dist/core/extensions/builtin/gpt-apply-patch/apply.js +13 -1
  146. package/dist/core/extensions/builtin/gpt-apply-patch/apply.js.map +1 -1
  147. package/dist/core/extensions/builtin/gpt-apply-patch/index.d.ts +1 -1
  148. package/dist/core/extensions/builtin/gpt-apply-patch/index.d.ts.map +1 -1
  149. package/dist/core/extensions/builtin/gpt-apply-patch/index.js +1 -1
  150. package/dist/core/extensions/builtin/gpt-apply-patch/index.js.map +1 -1
  151. package/dist/core/extensions/builtin/gpt-apply-patch/tool.d.ts +1 -0
  152. package/dist/core/extensions/builtin/gpt-apply-patch/tool.d.ts.map +1 -1
  153. package/dist/core/extensions/builtin/gpt-apply-patch/tool.js +23 -5
  154. package/dist/core/extensions/builtin/gpt-apply-patch/tool.js.map +1 -1
  155. package/dist/core/extensions/builtin/loop-guard/detectors.d.ts.map +1 -1
  156. package/dist/core/extensions/builtin/loop-guard/detectors.js +42 -1
  157. package/dist/core/extensions/builtin/loop-guard/detectors.js.map +1 -1
  158. package/dist/core/extensions/builtin/mcp/health.d.ts.map +1 -1
  159. package/dist/core/extensions/builtin/mcp/health.js +2 -1
  160. package/dist/core/extensions/builtin/mcp/health.js.map +1 -1
  161. package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.d.ts +1 -1
  162. package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.d.ts.map +1 -1
  163. package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js +5 -3
  164. package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js.map +1 -1
  165. package/dist/core/extensions/builtin/prompt-preset/kimi-k3.d.ts.map +1 -1
  166. package/dist/core/extensions/builtin/prompt-preset/kimi-k3.js +8 -1
  167. package/dist/core/extensions/builtin/prompt-preset/kimi-k3.js.map +1 -1
  168. package/dist/core/extensions/builtin/terminal/tools/context.d.ts +1 -1
  169. package/dist/core/extensions/builtin/terminal/tools/context.d.ts.map +1 -1
  170. package/dist/core/extensions/builtin/terminal/tools/context.js.map +1 -1
  171. package/dist/core/extensions/builtin/terminal/tools/monitor.d.ts.map +1 -1
  172. package/dist/core/extensions/builtin/terminal/tools/monitor.js +1 -0
  173. package/dist/core/extensions/builtin/terminal/tools/monitor.js.map +1 -1
  174. package/dist/core/extensions/builtin/tool-pair-guard/index.d.ts.map +1 -1
  175. package/dist/core/extensions/builtin/tool-pair-guard/index.js +1 -1
  176. package/dist/core/extensions/builtin/tool-pair-guard/index.js.map +1 -1
  177. package/dist/core/extensions/index.d.ts +1 -1
  178. package/dist/core/extensions/index.d.ts.map +1 -1
  179. package/dist/core/extensions/index.js.map +1 -1
  180. package/dist/core/extensions/loader.d.ts.map +1 -1
  181. package/dist/core/extensions/loader.js +14 -18
  182. package/dist/core/extensions/loader.js.map +1 -1
  183. package/dist/core/extensions/runner.d.ts +4 -1
  184. package/dist/core/extensions/runner.d.ts.map +1 -1
  185. package/dist/core/extensions/runner.js +18 -0
  186. package/dist/core/extensions/runner.js.map +1 -1
  187. package/dist/core/extensions/types.d.ts +16 -1
  188. package/dist/core/extensions/types.d.ts.map +1 -1
  189. package/dist/core/extensions/types.js.map +1 -1
  190. package/dist/core/footer-data-provider.d.ts +10 -0
  191. package/dist/core/footer-data-provider.d.ts.map +1 -1
  192. package/dist/core/footer-data-provider.js +1 -1
  193. package/dist/core/footer-data-provider.js.map +1 -1
  194. package/dist/core/keybindings.d.ts +24 -0
  195. package/dist/core/keybindings.d.ts.map +1 -1
  196. package/dist/core/model-registry.d.ts +2 -1
  197. package/dist/core/model-registry.d.ts.map +1 -1
  198. package/dist/core/model-registry.js +3 -0
  199. package/dist/core/model-registry.js.map +1 -1
  200. package/dist/core/model-runtime.d.ts +2 -0
  201. package/dist/core/model-runtime.d.ts.map +1 -1
  202. package/dist/core/model-runtime.js.map +1 -1
  203. package/dist/core/package-manager.d.ts +0 -1
  204. package/dist/core/package-manager.d.ts.map +1 -1
  205. package/dist/core/package-manager.js +18 -34
  206. package/dist/core/package-manager.js.map +1 -1
  207. package/dist/core/pi-manifest.d.ts +9 -0
  208. package/dist/core/pi-manifest.d.ts.map +1 -0
  209. package/dist/core/pi-manifest.js +25 -0
  210. package/dist/core/pi-manifest.js.map +1 -0
  211. package/dist/core/resource-loader.d.ts +15 -0
  212. package/dist/core/resource-loader.d.ts.map +1 -1
  213. package/dist/core/resource-loader.js +55 -6
  214. package/dist/core/resource-loader.js.map +1 -1
  215. package/dist/core/retry-fallback/hint-policy.d.ts +29 -0
  216. package/dist/core/retry-fallback/hint-policy.d.ts.map +1 -0
  217. package/dist/core/retry-fallback/hint-policy.js +54 -0
  218. package/dist/core/retry-fallback/hint-policy.js.map +1 -0
  219. package/dist/core/retry-fallback/probe-scheduler.d.ts +60 -0
  220. package/dist/core/retry-fallback/probe-scheduler.d.ts.map +1 -0
  221. package/dist/core/retry-fallback/probe-scheduler.js +206 -0
  222. package/dist/core/retry-fallback/probe-scheduler.js.map +1 -0
  223. package/dist/core/retry-fallback/settings.d.ts +9 -0
  224. package/dist/core/retry-fallback/settings.d.ts.map +1 -1
  225. package/dist/core/retry-fallback/settings.js +14 -0
  226. package/dist/core/retry-fallback/settings.js.map +1 -1
  227. package/dist/core/settings-manager.d.ts +10 -1
  228. package/dist/core/settings-manager.d.ts.map +1 -1
  229. package/dist/core/settings-manager.js +21 -1
  230. package/dist/core/settings-manager.js.map +1 -1
  231. package/dist/extensions/llama/provider.js +1 -1
  232. package/dist/extensions/llama/provider.js.map +1 -1
  233. package/dist/index.d.ts +2 -2
  234. package/dist/index.d.ts.map +1 -1
  235. package/dist/index.js.map +1 -1
  236. package/dist/main.d.ts.map +1 -1
  237. package/dist/main.js +44 -0
  238. package/dist/main.js.map +1 -1
  239. package/dist/modes/interactive/components/assistant-message.d.ts +5 -2
  240. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  241. package/dist/modes/interactive/components/assistant-message.js +16 -4
  242. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  243. package/dist/modes/interactive/components/continuity-notice.d.ts +21 -0
  244. package/dist/modes/interactive/components/continuity-notice.d.ts.map +1 -0
  245. package/dist/modes/interactive/components/continuity-notice.js +58 -0
  246. package/dist/modes/interactive/components/continuity-notice.js.map +1 -0
  247. package/dist/modes/interactive/components/markdown-transform.d.ts +3 -0
  248. package/dist/modes/interactive/components/markdown-transform.d.ts.map +1 -0
  249. package/dist/modes/interactive/components/markdown-transform.js +19 -0
  250. package/dist/modes/interactive/components/markdown-transform.js.map +1 -0
  251. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  252. package/dist/modes/interactive/components/model-selector.js +4 -1
  253. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  254. package/dist/modes/interactive/components/settings-selector.d.ts +6 -2
  255. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  256. package/dist/modes/interactive/components/settings-selector.js +20 -0
  257. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  258. package/dist/modes/interactive/components/user-message.d.ts +3 -1
  259. package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
  260. package/dist/modes/interactive/components/user-message.js +8 -2
  261. package/dist/modes/interactive/components/user-message.js.map +1 -1
  262. package/dist/modes/interactive/help-content.d.ts.map +1 -1
  263. package/dist/modes/interactive/help-content.js +1 -0
  264. package/dist/modes/interactive/help-content.js.map +1 -1
  265. package/dist/modes/interactive/interactive-mode.d.ts +21 -0
  266. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  267. package/dist/modes/interactive/interactive-mode.js +151 -50
  268. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  269. package/dist/modes/interactive/theme/dark.json +1 -0
  270. package/dist/modes/interactive/theme/grok-day.json +1 -0
  271. package/dist/modes/interactive/theme/grok-night.json +1 -0
  272. package/dist/modes/interactive/theme/light.json +1 -0
  273. package/dist/modes/interactive/theme/theme-schema.json +5 -1
  274. package/dist/modes/interactive/theme/theme.d.ts +2 -2
  275. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  276. package/dist/modes/interactive/theme/theme.js +13 -3
  277. package/dist/modes/interactive/theme/theme.js.map +1 -1
  278. package/dist/modes/rpc/connection-handler.d.ts.map +1 -1
  279. package/dist/modes/rpc/connection-handler.js +13 -0
  280. package/dist/modes/rpc/connection-handler.js.map +1 -1
  281. package/dist/utils/clipboard.d.ts +1 -1
  282. package/dist/utils/clipboard.d.ts.map +1 -1
  283. package/dist/utils/clipboard.js +22 -2
  284. package/dist/utils/clipboard.js.map +1 -1
  285. package/docs/AGENTS.md +1 -6
  286. package/docs/custom-provider.md +10 -3
  287. package/docs/development.md +1 -2
  288. package/docs/extensions.md +24 -1
  289. package/docs/keybindings.md +13 -0
  290. package/docs/mcp.md +63 -4
  291. package/docs/models.md +1 -0
  292. package/docs/providers.md +20 -0
  293. package/docs/release-guide.md +5 -3
  294. package/docs/session-format.md +2 -0
  295. package/docs/settings.md +2 -0
  296. package/docs/skills.md +29 -0
  297. package/docs/themes.md +5 -3
  298. package/docs/usage.md +5 -0
  299. package/examples/extensions/custom-compaction.ts +1 -2
  300. package/examples/extensions/custom-provider-anthropic/index.ts +8 -2
  301. package/examples/extensions/doom-overlay/wad-finder.ts +7 -3
  302. package/examples/extensions/handoff.ts +2 -3
  303. package/examples/extensions/qna.ts +2 -2
  304. package/examples/rpc-extension-ui.ts +11 -2
  305. package/examples/sdk/02-custom-model.ts +1 -2
  306. package/examples/sdk/12-full-control.ts +2 -0
  307. package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +12 -0
  308. package/node_modules/@code-yeongyu/senpi-codemode/package.json +3 -3
  309. package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.d.ts +14 -3
  310. package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.d.ts.map +1 -1
  311. package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.js +156 -67
  312. package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.js.map +1 -1
  313. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/array-session-reader.d.ts +3 -0
  314. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/array-session-reader.d.ts.map +1 -0
  315. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/array-session-reader.js +70 -0
  316. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/array-session-reader.js.map +1 -0
  317. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.d.ts +4 -0
  318. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.d.ts.map +1 -0
  319. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.js +22 -0
  320. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.js.map +1 -0
  321. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-store.d.ts +13 -0
  322. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-store.d.ts.map +1 -0
  323. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-store.js +304 -0
  324. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-store.js.map +1 -0
  325. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/keyed-operation-queue.d.ts +17 -0
  326. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/keyed-operation-queue.d.ts.map +1 -0
  327. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/keyed-operation-queue.js +60 -0
  328. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/keyed-operation-queue.js.map +1 -0
  329. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-store.d.ts +6 -0
  330. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-store.d.ts.map +1 -0
  331. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-store.js +107 -0
  332. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-store.js.map +1 -0
  333. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repository.d.ts +28 -0
  334. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repository.d.ts.map +1 -0
  335. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repository.js +61 -0
  336. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repository.js.map +1 -0
  337. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/search-backend.d.ts +8 -0
  338. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/search-backend.d.ts.map +1 -0
  339. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/search-backend.js +22 -0
  340. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/search-backend.js.map +1 -0
  341. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.d.ts +6 -10
  342. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.d.ts.map +1 -1
  343. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.js +154 -77
  344. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.js.map +1 -1
  345. package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.d.ts +49 -23
  346. package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.d.ts.map +1 -1
  347. package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.js.map +1 -1
  348. package/node_modules/@earendil-works/pi-agent-core/dist/index.d.ts +6 -6
  349. package/node_modules/@earendil-works/pi-agent-core/dist/index.d.ts.map +1 -1
  350. package/node_modules/@earendil-works/pi-agent-core/dist/index.js +6 -6
  351. package/node_modules/@earendil-works/pi-agent-core/dist/index.js.map +1 -1
  352. package/node_modules/@earendil-works/pi-agent-core/dist/proxy.js +1 -1
  353. package/node_modules/@earendil-works/pi-agent-core/dist/proxy.js.map +1 -1
  354. package/node_modules/@earendil-works/pi-agent-core/package.json +4 -4
  355. package/node_modules/@earendil-works/pi-ai/README.md +2 -1
  356. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.d.ts.map +1 -1
  357. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +46 -10
  358. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js.map +1 -1
  359. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-tool-pairs.d.ts +3 -0
  360. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-tool-pairs.d.ts.map +1 -0
  361. package/{dist/core/extensions/builtin/tool-pair-guard/sanitize-anthropic-payload.js → node_modules/@earendil-works/pi-ai/dist/api/anthropic-tool-pairs.js} +3 -3
  362. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-tool-pairs.js.map +1 -0
  363. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.d.ts.map +1 -1
  364. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js +5 -1
  365. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js.map +1 -1
  366. package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.d.ts.map +1 -1
  367. package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js +64 -4
  368. package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js.map +1 -1
  369. package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.d.ts.map +1 -1
  370. package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js +12 -2
  371. package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js.map +1 -1
  372. package/node_modules/@earendil-works/pi-ai/dist/api/google-shared.d.ts.map +1 -1
  373. package/node_modules/@earendil-works/pi-ai/dist/api/google-shared.js +13 -6
  374. package/node_modules/@earendil-works/pi-ai/dist/api/google-shared.js.map +1 -1
  375. package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.d.ts.map +1 -1
  376. package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.js +12 -2
  377. package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.js.map +1 -1
  378. package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.d.ts.map +1 -1
  379. package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js +19 -10
  380. package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js.map +1 -1
  381. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.d.ts.map +1 -1
  382. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js +84 -47
  383. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js.map +1 -1
  384. package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.d.ts.map +1 -1
  385. package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js +17 -8
  386. package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js.map +1 -1
  387. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.d.ts.map +1 -1
  388. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js +11 -1
  389. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js.map +1 -1
  390. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.d.ts.map +1 -1
  391. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js +7 -3
  392. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js.map +1 -1
  393. package/node_modules/@earendil-works/pi-ai/dist/api/openrouter-images.js +3 -2
  394. package/node_modules/@earendil-works/pi-ai/dist/api/openrouter-images.js.map +1 -1
  395. package/node_modules/@earendil-works/pi-ai/dist/api/pi-messages.js +2 -2
  396. package/node_modules/@earendil-works/pi-ai/dist/api/pi-messages.js.map +1 -1
  397. package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.d.ts.map +1 -1
  398. package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.js +1 -0
  399. package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.js.map +1 -1
  400. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openrouter.d.ts +3 -1
  401. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openrouter.d.ts.map +1 -1
  402. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openrouter.js +81 -26
  403. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openrouter.js.map +1 -1
  404. package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.d.ts +2 -0
  405. package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.d.ts.map +1 -1
  406. package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js +16 -8
  407. package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js.map +1 -1
  408. package/node_modules/@earendil-works/pi-ai/dist/index.d.ts +1 -0
  409. package/node_modules/@earendil-works/pi-ai/dist/index.d.ts.map +1 -1
  410. package/node_modules/@earendil-works/pi-ai/dist/index.js +1 -0
  411. package/node_modules/@earendil-works/pi-ai/dist/index.js.map +1 -1
  412. package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
  413. package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-ai-gateway.json +1 -1
  414. package/node_modules/@earendil-works/pi-ai/dist/providers/data/fireworks.json +1 -1
  415. package/node_modules/@earendil-works/pi-ai/dist/providers/data/github-copilot.json +1 -1
  416. package/node_modules/@earendil-works/pi-ai/dist/providers/data/huggingface.json +1 -1
  417. package/node_modules/@earendil-works/pi-ai/dist/providers/data/mistral.json +1 -1
  418. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai-codex.json +1 -1
  419. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai.json +1 -1
  420. package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode.json +1 -1
  421. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
  422. package/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan-cn.json +1 -1
  423. package/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan.json +1 -1
  424. package/node_modules/@earendil-works/pi-ai/dist/providers/data/together.json +1 -1
  425. package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
  426. package/node_modules/@earendil-works/pi-ai/dist/providers/data/zai-coding-cn.json +1 -1
  427. package/node_modules/@earendil-works/pi-ai/dist/providers/data/zai.json +1 -1
  428. package/node_modules/@earendil-works/pi-ai/dist/providers/faux.d.ts.map +1 -1
  429. package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js +4 -1
  430. package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js.map +1 -1
  431. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.js +1 -1
  432. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.js.map +1 -1
  433. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +13 -1
  434. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
  435. package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -1
  436. package/node_modules/@earendil-works/pi-ai/dist/utils/error-body.d.ts.map +1 -1
  437. package/node_modules/@earendil-works/pi-ai/dist/utils/error-body.js +23 -4
  438. package/node_modules/@earendil-works/pi-ai/dist/utils/error-body.js.map +1 -1
  439. package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.d.ts.map +1 -1
  440. package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.js +10 -1
  441. package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.js.map +1 -1
  442. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.d.ts +3 -0
  443. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.d.ts.map +1 -1
  444. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.js +13 -12
  445. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.js.map +1 -1
  446. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-hint.d.ts +24 -0
  447. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-hint.d.ts.map +1 -0
  448. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-hint.js +233 -0
  449. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-hint.js.map +1 -0
  450. package/node_modules/@earendil-works/pi-ai/package.json +10 -6
  451. package/node_modules/@earendil-works/pi-client/CHANGELOG.md +7 -0
  452. package/node_modules/@earendil-works/pi-client/README.md +64 -0
  453. package/node_modules/@earendil-works/pi-client/dist/client.d.ts +25 -0
  454. package/node_modules/@earendil-works/pi-client/dist/client.d.ts.map +1 -0
  455. package/node_modules/@earendil-works/pi-client/dist/client.js +386 -0
  456. package/node_modules/@earendil-works/pi-client/dist/client.js.map +1 -0
  457. package/node_modules/@earendil-works/pi-client/dist/connection.d.ts +25 -0
  458. package/node_modules/@earendil-works/pi-client/dist/connection.d.ts.map +1 -0
  459. package/node_modules/@earendil-works/pi-client/dist/connection.js +204 -0
  460. package/node_modules/@earendil-works/pi-client/dist/connection.js.map +1 -0
  461. package/node_modules/@earendil-works/pi-client/dist/errors.d.ts +23 -0
  462. package/node_modules/@earendil-works/pi-client/dist/errors.d.ts.map +1 -0
  463. package/node_modules/@earendil-works/pi-client/dist/errors.js +42 -0
  464. package/node_modules/@earendil-works/pi-client/dist/errors.js.map +1 -0
  465. package/node_modules/@earendil-works/pi-client/dist/index.d.ts +6 -0
  466. package/node_modules/@earendil-works/pi-client/dist/index.d.ts.map +1 -0
  467. package/node_modules/@earendil-works/pi-client/dist/index.js +3 -0
  468. package/node_modules/@earendil-works/pi-client/dist/index.js.map +1 -0
  469. package/node_modules/@earendil-works/pi-client/dist/promise.d.ts +8 -0
  470. package/node_modules/@earendil-works/pi-client/dist/promise.d.ts.map +1 -0
  471. package/node_modules/@earendil-works/pi-client/dist/promise.js +11 -0
  472. package/node_modules/@earendil-works/pi-client/dist/promise.js.map +1 -0
  473. package/node_modules/@earendil-works/pi-client/dist/session-handle.d.ts +54 -0
  474. package/node_modules/@earendil-works/pi-client/dist/session-handle.d.ts.map +1 -0
  475. package/node_modules/@earendil-works/pi-client/dist/session-handle.js +50 -0
  476. package/node_modules/@earendil-works/pi-client/dist/session-handle.js.map +1 -0
  477. package/node_modules/@earendil-works/pi-client/dist/state.d.ts +22 -0
  478. package/node_modules/@earendil-works/pi-client/dist/state.d.ts.map +1 -0
  479. package/node_modules/@earendil-works/pi-client/dist/state.js +149 -0
  480. package/node_modules/@earendil-works/pi-client/dist/state.js.map +1 -0
  481. package/node_modules/@earendil-works/pi-client/dist/transport.d.ts +17 -0
  482. package/node_modules/@earendil-works/pi-client/dist/transport.d.ts.map +1 -0
  483. package/node_modules/@earendil-works/pi-client/dist/transport.js +2 -0
  484. package/node_modules/@earendil-works/pi-client/dist/transport.js.map +1 -0
  485. package/node_modules/@earendil-works/pi-client/dist/types.d.ts +23 -0
  486. package/node_modules/@earendil-works/pi-client/dist/types.d.ts.map +1 -0
  487. package/node_modules/@earendil-works/pi-client/dist/types.js +2 -0
  488. package/node_modules/@earendil-works/pi-client/dist/types.js.map +1 -0
  489. package/node_modules/@earendil-works/pi-client/dist/unix.d.ts +8 -0
  490. package/node_modules/@earendil-works/pi-client/dist/unix.d.ts.map +1 -0
  491. package/node_modules/@earendil-works/pi-client/dist/unix.js +151 -0
  492. package/node_modules/@earendil-works/pi-client/dist/unix.js.map +1 -0
  493. package/node_modules/@earendil-works/pi-client/package.json +56 -0
  494. package/node_modules/@earendil-works/pi-protocol/README.md +68 -0
  495. package/node_modules/@earendil-works/pi-protocol/dist/cbor/decoder.d.ts +4 -0
  496. package/node_modules/@earendil-works/pi-protocol/dist/cbor/decoder.d.ts.map +1 -0
  497. package/node_modules/@earendil-works/pi-protocol/dist/cbor/decoder.js +163 -0
  498. package/node_modules/@earendil-works/pi-protocol/dist/cbor/decoder.js.map +1 -0
  499. package/node_modules/@earendil-works/pi-protocol/dist/cbor/encoder.d.ts +4 -0
  500. package/node_modules/@earendil-works/pi-protocol/dist/cbor/encoder.d.ts.map +1 -0
  501. package/node_modules/@earendil-works/pi-protocol/dist/cbor/encoder.js +199 -0
  502. package/node_modules/@earendil-works/pi-protocol/dist/cbor/encoder.js.map +1 -0
  503. package/node_modules/@earendil-works/pi-protocol/dist/cbor/index.d.ts +4 -0
  504. package/node_modules/@earendil-works/pi-protocol/dist/cbor/index.d.ts.map +1 -0
  505. package/node_modules/@earendil-works/pi-protocol/dist/cbor/index.js +4 -0
  506. package/node_modules/@earendil-works/pi-protocol/dist/cbor/index.js.map +1 -0
  507. package/node_modules/@earendil-works/pi-protocol/dist/cbor/options.d.ts +26 -0
  508. package/node_modules/@earendil-works/pi-protocol/dist/cbor/options.d.ts.map +1 -0
  509. package/node_modules/@earendil-works/pi-protocol/dist/cbor/options.js +29 -0
  510. package/node_modules/@earendil-works/pi-protocol/dist/cbor/options.js.map +1 -0
  511. package/node_modules/@earendil-works/pi-protocol/dist/codec.d.ts +29 -0
  512. package/node_modules/@earendil-works/pi-protocol/dist/codec.d.ts.map +1 -0
  513. package/node_modules/@earendil-works/pi-protocol/dist/codec.js +140 -0
  514. package/node_modules/@earendil-works/pi-protocol/dist/codec.js.map +1 -0
  515. package/node_modules/@earendil-works/pi-protocol/dist/framing.d.ts +29 -0
  516. package/node_modules/@earendil-works/pi-protocol/dist/framing.d.ts.map +1 -0
  517. package/node_modules/@earendil-works/pi-protocol/dist/framing.js +152 -0
  518. package/node_modules/@earendil-works/pi-protocol/dist/framing.js.map +1 -0
  519. package/node_modules/@earendil-works/pi-protocol/dist/index.d.ts +5 -0
  520. package/node_modules/@earendil-works/pi-protocol/dist/index.d.ts.map +1 -0
  521. package/node_modules/@earendil-works/pi-protocol/dist/index.js +5 -0
  522. package/node_modules/@earendil-works/pi-protocol/dist/index.js.map +1 -0
  523. package/node_modules/@earendil-works/pi-protocol/dist/schemas.d.ts +13818 -0
  524. package/node_modules/@earendil-works/pi-protocol/dist/schemas.d.ts.map +1 -0
  525. package/node_modules/@earendil-works/pi-protocol/dist/schemas.js +382 -0
  526. package/node_modules/@earendil-works/pi-protocol/dist/schemas.js.map +1 -0
  527. package/node_modules/@earendil-works/pi-protocol/package.json +48 -0
  528. package/node_modules/@earendil-works/pi-pty/package.json +2 -2
  529. package/node_modules/@earendil-works/pi-tui/README.md +77 -14
  530. package/node_modules/@earendil-works/pi-tui/dist/TuiAltScreen.d.ts +83 -0
  531. package/node_modules/@earendil-works/pi-tui/dist/TuiAltScreen.d.ts.map +1 -0
  532. package/node_modules/@earendil-works/pi-tui/dist/TuiAltScreen.js +687 -0
  533. package/node_modules/@earendil-works/pi-tui/dist/TuiAltScreen.js.map +1 -0
  534. package/node_modules/@earendil-works/pi-tui/dist/TuiMainScreen.d.ts +5 -0
  535. package/node_modules/@earendil-works/pi-tui/dist/TuiMainScreen.d.ts.map +1 -0
  536. package/node_modules/@earendil-works/pi-tui/dist/TuiMainScreen.js +5 -0
  537. package/node_modules/@earendil-works/pi-tui/dist/TuiMainScreen.js.map +1 -0
  538. package/node_modules/@earendil-works/pi-tui/dist/components/alt-screen-flash.d.ts +13 -0
  539. package/node_modules/@earendil-works/pi-tui/dist/components/alt-screen-flash.d.ts.map +1 -0
  540. package/node_modules/@earendil-works/pi-tui/dist/components/alt-screen-flash.js +36 -0
  541. package/node_modules/@earendil-works/pi-tui/dist/components/alt-screen-flash.js.map +1 -0
  542. package/node_modules/@earendil-works/pi-tui/dist/components/h-stack.d.ts +7 -0
  543. package/node_modules/@earendil-works/pi-tui/dist/components/h-stack.d.ts.map +1 -0
  544. package/node_modules/@earendil-works/pi-tui/dist/components/h-stack.js +43 -0
  545. package/node_modules/@earendil-works/pi-tui/dist/components/h-stack.js.map +1 -0
  546. package/node_modules/@earendil-works/pi-tui/dist/components/image.d.ts.map +1 -1
  547. package/node_modules/@earendil-works/pi-tui/dist/components/image.js +4 -4
  548. package/node_modules/@earendil-works/pi-tui/dist/components/image.js.map +1 -1
  549. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts +2 -0
  550. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts.map +1 -1
  551. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js +3 -2
  552. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js.map +1 -1
  553. package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.d.ts +51 -0
  554. package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.d.ts.map +1 -0
  555. package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.js +163 -0
  556. package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.js.map +1 -0
  557. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts.map +1 -1
  558. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js +3 -6
  559. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js.map +1 -1
  560. package/node_modules/@earendil-works/pi-tui/dist/components/stack.d.ts +32 -0
  561. package/node_modules/@earendil-works/pi-tui/dist/components/stack.d.ts.map +1 -0
  562. package/node_modules/@earendil-works/pi-tui/dist/components/stack.js +109 -0
  563. package/node_modules/@earendil-works/pi-tui/dist/components/stack.js.map +1 -0
  564. package/node_modules/@earendil-works/pi-tui/dist/components/v-stack.d.ts +8 -0
  565. package/node_modules/@earendil-works/pi-tui/dist/components/v-stack.d.ts.map +1 -0
  566. package/node_modules/@earendil-works/pi-tui/dist/components/v-stack.js +21 -0
  567. package/node_modules/@earendil-works/pi-tui/dist/components/v-stack.js.map +1 -0
  568. package/node_modules/@earendil-works/pi-tui/dist/index.d.ts +10 -4
  569. package/node_modules/@earendil-works/pi-tui/dist/index.d.ts.map +1 -1
  570. package/node_modules/@earendil-works/pi-tui/dist/index.js +10 -4
  571. package/node_modules/@earendil-works/pi-tui/dist/index.js.map +1 -1
  572. package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts +30 -0
  573. package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts.map +1 -1
  574. package/node_modules/@earendil-works/pi-tui/dist/keybindings.js +18 -0
  575. package/node_modules/@earendil-works/pi-tui/dist/keybindings.js.map +1 -1
  576. package/node_modules/@earendil-works/pi-tui/dist/layout-node.d.ts +40 -0
  577. package/node_modules/@earendil-works/pi-tui/dist/layout-node.d.ts.map +1 -0
  578. package/node_modules/@earendil-works/pi-tui/dist/layout-node.js +6 -0
  579. package/node_modules/@earendil-works/pi-tui/dist/layout-node.js.map +1 -0
  580. package/node_modules/@earendil-works/pi-tui/dist/layout.d.ts +40 -0
  581. package/node_modules/@earendil-works/pi-tui/dist/layout.d.ts.map +1 -0
  582. package/node_modules/@earendil-works/pi-tui/dist/layout.js +315 -0
  583. package/node_modules/@earendil-works/pi-tui/dist/layout.js.map +1 -0
  584. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts +10 -0
  585. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts.map +1 -1
  586. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js +61 -3
  587. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js.map +1 -1
  588. package/node_modules/@earendil-works/pi-tui/dist/terminal-text.d.ts +1 -0
  589. package/node_modules/@earendil-works/pi-tui/dist/terminal-text.d.ts.map +1 -1
  590. package/node_modules/@earendil-works/pi-tui/dist/terminal-text.js +12 -2
  591. package/node_modules/@earendil-works/pi-tui/dist/terminal-text.js.map +1 -1
  592. package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts +36 -16
  593. package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts.map +1 -1
  594. package/node_modules/@earendil-works/pi-tui/dist/tui.js +72 -18
  595. package/node_modules/@earendil-works/pi-tui/dist/tui.js.map +1 -1
  596. package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts +10 -0
  597. package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts.map +1 -1
  598. package/node_modules/@earendil-works/pi-tui/dist/utils.js +95 -4
  599. package/node_modules/@earendil-works/pi-tui/dist/utils.js.map +1 -1
  600. package/node_modules/@earendil-works/pi-tui/package.json +2 -2
  601. package/node_modules/typebox/build/compile/validator.d.mts +3 -11
  602. package/node_modules/typebox/build/compile/validator.mjs +6 -36
  603. package/node_modules/typebox/build/error/errors.d.mts +1 -7
  604. package/node_modules/typebox/build/format/_idna.mjs +36 -6
  605. package/node_modules/typebox/build/format/_puny.mjs +4 -1
  606. package/node_modules/typebox/build/format/uuid.d.mts +2 -2
  607. package/node_modules/typebox/build/format/uuid.mjs +3 -3
  608. package/node_modules/typebox/build/guard/emit.d.mts +0 -4
  609. package/node_modules/typebox/build/guard/emit.mjs +0 -8
  610. package/node_modules/typebox/build/guard/guard.d.mts +5 -9
  611. package/node_modules/typebox/build/guard/guard.mjs +10 -15
  612. package/node_modules/typebox/build/guard/string.mjs +16 -4
  613. package/node_modules/typebox/build/schema/engine/_functions.mjs +34 -15
  614. package/node_modules/typebox/build/schema/engine/boolean.d.mts +3 -3
  615. package/node_modules/typebox/build/schema/engine/boolean.mjs +4 -4
  616. package/node_modules/typebox/build/schema/engine/index.d.mts +0 -1
  617. package/node_modules/typebox/build/schema/engine/index.mjs +0 -1
  618. package/node_modules/typebox/build/schema/engine/schema.mjs +6 -11
  619. package/node_modules/typebox/build/schema/engine/type.mjs +14 -18
  620. package/node_modules/typebox/build/schema/types/dependencies.mjs +1 -1
  621. package/node_modules/typebox/build/schema/types/index.d.mts +0 -1
  622. package/node_modules/typebox/build/schema/types/index.mjs +0 -1
  623. package/node_modules/typebox/build/schema/types/schema.d.mts +1 -1
  624. package/node_modules/typebox/build/schema/types/schema.mjs +2 -2
  625. package/node_modules/typebox/build/system/locale/ar_001.mjs +0 -1
  626. package/node_modules/typebox/build/system/locale/bn_BD.mjs +0 -1
  627. package/node_modules/typebox/build/system/locale/cs_CZ.mjs +0 -1
  628. package/node_modules/typebox/build/system/locale/de_DE.mjs +0 -1
  629. package/node_modules/typebox/build/system/locale/el_GR.mjs +0 -1
  630. package/node_modules/typebox/build/system/locale/en_US.mjs +0 -1
  631. package/node_modules/typebox/build/system/locale/es_419.mjs +0 -1
  632. package/node_modules/typebox/build/system/locale/es_AR.mjs +0 -1
  633. package/node_modules/typebox/build/system/locale/es_ES.mjs +0 -1
  634. package/node_modules/typebox/build/system/locale/es_MX.mjs +0 -1
  635. package/node_modules/typebox/build/system/locale/fa_IR.mjs +0 -1
  636. package/node_modules/typebox/build/system/locale/fil_PH.mjs +0 -1
  637. package/node_modules/typebox/build/system/locale/fr_CA.mjs +0 -1
  638. package/node_modules/typebox/build/system/locale/fr_FR.mjs +0 -1
  639. package/node_modules/typebox/build/system/locale/ha_NG.mjs +0 -1
  640. package/node_modules/typebox/build/system/locale/hi_IN.mjs +0 -1
  641. package/node_modules/typebox/build/system/locale/hu_HU.mjs +0 -1
  642. package/node_modules/typebox/build/system/locale/id_ID.mjs +0 -1
  643. package/node_modules/typebox/build/system/locale/it_IT.mjs +0 -1
  644. package/node_modules/typebox/build/system/locale/ja_JP.mjs +0 -1
  645. package/node_modules/typebox/build/system/locale/ko_KR.mjs +0 -1
  646. package/node_modules/typebox/build/system/locale/ms_MY.mjs +0 -1
  647. package/node_modules/typebox/build/system/locale/nl_NL.mjs +0 -1
  648. package/node_modules/typebox/build/system/locale/pl_PL.mjs +0 -1
  649. package/node_modules/typebox/build/system/locale/pt_BR.mjs +0 -1
  650. package/node_modules/typebox/build/system/locale/pt_PT.mjs +0 -1
  651. package/node_modules/typebox/build/system/locale/ro_RO.mjs +0 -1
  652. package/node_modules/typebox/build/system/locale/ru_RU.mjs +0 -1
  653. package/node_modules/typebox/build/system/locale/sv_SE.mjs +0 -1
  654. package/node_modules/typebox/build/system/locale/sw_TZ.mjs +0 -1
  655. package/node_modules/typebox/build/system/locale/th_TH.mjs +0 -1
  656. package/node_modules/typebox/build/system/locale/tr_TR.mjs +0 -1
  657. package/node_modules/typebox/build/system/locale/uk_UA.mjs +0 -1
  658. package/node_modules/typebox/build/system/locale/ur_PK.mjs +0 -1
  659. package/node_modules/typebox/build/system/locale/vi_VN.mjs +0 -1
  660. package/node_modules/typebox/build/system/locale/yo_NG.mjs +0 -1
  661. package/node_modules/typebox/build/system/locale/zh_Hans.mjs +0 -1
  662. package/node_modules/typebox/build/system/locale/zh_Hant.mjs +0 -1
  663. package/node_modules/typebox/build/system/memory/clone.d.mts +2 -3
  664. package/node_modules/typebox/build/system/memory/clone.mjs +73 -26
  665. package/node_modules/typebox/build/system/settings/settings.d.mts +15 -0
  666. package/node_modules/typebox/build/system/settings/settings.mjs +3 -1
  667. package/node_modules/typebox/build/type/action/_add_immutable.d.mts +11 -0
  668. package/node_modules/typebox/build/type/action/_add_immutable.mjs +11 -0
  669. package/node_modules/typebox/build/type/action/_add_optional.d.mts +11 -0
  670. package/node_modules/typebox/build/type/action/_add_optional.mjs +11 -0
  671. package/node_modules/typebox/build/type/action/_add_readonly.d.mts +11 -0
  672. package/node_modules/typebox/build/type/action/_add_readonly.mjs +11 -0
  673. package/node_modules/typebox/build/type/action/_remove_immutable.d.mts +11 -0
  674. package/node_modules/typebox/build/type/action/_remove_immutable.mjs +11 -0
  675. package/node_modules/typebox/build/type/action/_remove_optional.d.mts +11 -0
  676. package/node_modules/typebox/build/type/action/_remove_optional.mjs +11 -0
  677. package/node_modules/typebox/build/type/action/_remove_readonly.d.mts +11 -0
  678. package/node_modules/typebox/build/type/action/_remove_readonly.mjs +11 -0
  679. package/node_modules/typebox/build/type/action/conditional.d.mts +2 -3
  680. package/node_modules/typebox/build/type/action/conditional.mjs +2 -1
  681. package/node_modules/typebox/build/type/action/index.d.mts +7 -4
  682. package/node_modules/typebox/build/type/action/index.mjs +7 -4
  683. package/node_modules/typebox/build/type/action/mapped.d.mts +2 -3
  684. package/node_modules/typebox/build/type/action/mapped.mjs +2 -1
  685. package/node_modules/typebox/build/type/action/module.d.mts +8 -7
  686. package/node_modules/typebox/build/type/action/module.mjs +7 -6
  687. package/node_modules/typebox/build/type/action/readonly_object.mjs +3 -0
  688. package/node_modules/typebox/build/type/action/with.d.mts +11 -0
  689. package/node_modules/typebox/build/type/action/with.mjs +11 -0
  690. package/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs +1 -1
  691. package/node_modules/typebox/build/type/engine/call/instantiate.d.mts +1 -3
  692. package/node_modules/typebox/build/type/engine/call/instantiate.mjs +3 -2
  693. package/node_modules/typebox/build/type/engine/call/resolve_arguments.mjs +2 -2
  694. package/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.d.mts +3 -4
  695. package/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.mjs +2 -1
  696. package/node_modules/typebox/build/type/engine/cyclic/candidates.d.mts +2 -3
  697. package/node_modules/typebox/build/type/engine/cyclic/candidates.mjs +3 -6
  698. package/node_modules/typebox/build/type/engine/cyclic/check.d.mts +6 -9
  699. package/node_modules/typebox/build/type/engine/cyclic/check.mjs +10 -16
  700. package/node_modules/typebox/build/type/engine/cyclic/dependencies.d.mts +1 -4
  701. package/node_modules/typebox/build/type/engine/cyclic/dependencies.mjs +9 -15
  702. package/node_modules/typebox/build/type/engine/cyclic/extends.d.mts +1 -4
  703. package/node_modules/typebox/build/type/engine/cyclic/extends.mjs +8 -14
  704. package/node_modules/typebox/build/type/engine/cyclic/instantiate.d.mts +2 -5
  705. package/node_modules/typebox/build/type/engine/cyclic/instantiate.mjs +3 -2
  706. package/node_modules/typebox/build/type/engine/enum/index.d.mts +0 -1
  707. package/node_modules/typebox/build/type/engine/enum/index.mjs +0 -1
  708. package/node_modules/typebox/build/type/engine/evaluate/broaden.d.mts +1 -2
  709. package/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +2 -6
  710. package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +10 -6
  711. package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +10 -6
  712. package/node_modules/typebox/build/type/engine/evaluate/distribute.d.mts +2 -1
  713. package/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +3 -3
  714. package/node_modules/typebox/build/type/engine/evaluate/evaluate.d.mts +17 -5
  715. package/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +34 -8
  716. package/node_modules/typebox/build/type/engine/exclude/operation.d.mts +5 -6
  717. package/node_modules/typebox/build/type/engine/exclude/operation.mjs +11 -12
  718. package/node_modules/typebox/build/type/engine/extract/operation.d.mts +5 -6
  719. package/node_modules/typebox/build/type/engine/extract/operation.mjs +11 -12
  720. package/node_modules/typebox/build/type/engine/immutable/instantiate_add.d.mts +10 -0
  721. package/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs +14 -0
  722. package/node_modules/typebox/build/type/engine/immutable/instantiate_remove.d.mts +10 -0
  723. package/node_modules/typebox/build/type/engine/immutable/instantiate_remove.mjs +14 -0
  724. package/node_modules/typebox/build/type/engine/index.d.mts +2 -2
  725. package/node_modules/typebox/build/type/engine/index.mjs +2 -2
  726. package/node_modules/typebox/build/type/engine/indexable/from_dependent.d.mts +5 -0
  727. package/node_modules/typebox/build/type/engine/indexable/from_dependent.mjs +8 -0
  728. package/node_modules/typebox/build/type/engine/indexable/from_enum.d.mts +3 -3
  729. package/node_modules/typebox/build/type/engine/indexable/from_enum.mjs +4 -4
  730. package/node_modules/typebox/build/type/engine/indexable/from_template_literal.d.mts +2 -2
  731. package/node_modules/typebox/build/type/engine/indexable/from_template_literal.mjs +3 -3
  732. package/node_modules/typebox/build/type/engine/indexable/from_type.d.mts +3 -1
  733. package/node_modules/typebox/build/type/engine/indexable/from_type.mjs +9 -6
  734. package/node_modules/typebox/build/type/engine/indexed/instantiate.d.mts +2 -1
  735. package/node_modules/typebox/build/type/engine/indexed/instantiate.mjs +5 -2
  736. package/node_modules/typebox/build/type/engine/instantiate.d.mts +44 -31
  737. package/node_modules/typebox/build/type/engine/instantiate.mjs +82 -83
  738. package/node_modules/typebox/build/type/engine/interface/instantiate.d.mts +3 -6
  739. package/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.d.mts +2 -2
  740. package/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.mjs +3 -3
  741. package/node_modules/typebox/build/type/engine/keyof/instantiate.d.mts +2 -1
  742. package/node_modules/typebox/build/type/engine/keyof/instantiate.mjs +5 -1
  743. package/node_modules/typebox/build/type/engine/mapped/mapped_operation.d.mts +4 -4
  744. package/node_modules/typebox/build/type/engine/mapped/mapped_operation.mjs +3 -3
  745. package/node_modules/typebox/build/type/engine/mapped/mapped_variants.d.mts +5 -4
  746. package/node_modules/typebox/build/type/engine/mapped/mapped_variants.mjs +10 -5
  747. package/node_modules/typebox/build/type/engine/module/instantiate.d.mts +7 -9
  748. package/node_modules/typebox/build/type/engine/module/instantiate.mjs +17 -15
  749. package/node_modules/typebox/build/type/engine/object/from_dependent.d.mts +5 -0
  750. package/node_modules/typebox/build/type/engine/object/from_dependent.mjs +8 -0
  751. package/node_modules/typebox/build/type/engine/object/from_type.d.mts +3 -1
  752. package/node_modules/typebox/build/type/engine/object/from_type.mjs +8 -5
  753. package/node_modules/typebox/build/type/engine/object/from_union.mjs +2 -2
  754. package/node_modules/typebox/build/type/engine/optional/instantiate_add.d.mts +10 -0
  755. package/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs +14 -0
  756. package/node_modules/typebox/build/type/engine/optional/instantiate_remove.d.mts +10 -0
  757. package/node_modules/typebox/build/type/engine/optional/instantiate_remove.mjs +14 -0
  758. package/node_modules/typebox/build/type/engine/parameters/instantiate.d.mts +3 -4
  759. package/node_modules/typebox/build/type/engine/parameters/instantiate.mjs +2 -1
  760. package/node_modules/typebox/build/type/engine/partial/from_dependent.d.mts +5 -0
  761. package/node_modules/typebox/build/type/engine/partial/from_dependent.mjs +8 -0
  762. package/node_modules/typebox/build/type/engine/partial/from_intersect.d.mts +1 -1
  763. package/node_modules/typebox/build/type/engine/partial/from_intersect.mjs +3 -2
  764. package/node_modules/typebox/build/type/engine/partial/from_object.d.mts +2 -2
  765. package/node_modules/typebox/build/type/engine/partial/from_object.mjs +2 -2
  766. package/node_modules/typebox/build/type/engine/partial/from_type.d.mts +3 -1
  767. package/node_modules/typebox/build/type/engine/partial/from_type.mjs +7 -4
  768. package/node_modules/typebox/build/type/engine/priority/index.d.mts +1 -0
  769. package/node_modules/typebox/build/type/engine/priority/index.mjs +1 -0
  770. package/node_modules/typebox/build/type/engine/priority/priority.d.mts +20 -0
  771. package/node_modules/typebox/build/type/engine/priority/priority.mjs +28 -0
  772. package/node_modules/typebox/build/type/engine/readonly/instantiate_add.d.mts +10 -0
  773. package/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs +14 -0
  774. package/node_modules/typebox/build/type/engine/readonly/instantiate_remove.d.mts +10 -0
  775. package/node_modules/typebox/build/type/engine/readonly/instantiate_remove.mjs +14 -0
  776. package/node_modules/typebox/build/type/engine/readonly_object/from_array.d.mts +2 -2
  777. package/node_modules/typebox/build/type/engine/readonly_object/from_array.mjs +2 -2
  778. package/node_modules/typebox/build/type/engine/readonly_object/from_dependent.d.mts +5 -0
  779. package/node_modules/typebox/build/type/engine/readonly_object/from_dependent.mjs +8 -0
  780. package/node_modules/typebox/build/type/engine/readonly_object/from_intersect.d.mts +1 -1
  781. package/node_modules/typebox/build/type/engine/readonly_object/from_intersect.mjs +3 -2
  782. package/node_modules/typebox/build/type/engine/readonly_object/from_object.d.mts +2 -2
  783. package/node_modules/typebox/build/type/engine/readonly_object/from_object.mjs +2 -2
  784. package/node_modules/typebox/build/type/engine/readonly_object/from_tuple.d.mts +2 -2
  785. package/node_modules/typebox/build/type/engine/readonly_object/from_tuple.mjs +2 -2
  786. package/node_modules/typebox/build/type/engine/readonly_object/from_type.d.mts +3 -1
  787. package/node_modules/typebox/build/type/engine/readonly_object/from_type.mjs +8 -5
  788. package/node_modules/typebox/build/type/engine/record/from_key_enum.d.mts +2 -2
  789. package/node_modules/typebox/build/type/engine/record/from_key_enum.mjs +2 -2
  790. package/node_modules/typebox/build/type/engine/record/from_key_template_literal.d.mts +2 -2
  791. package/node_modules/typebox/build/type/engine/record/from_key_template_literal.mjs +2 -2
  792. package/node_modules/typebox/build/type/engine/ref/instantiate.d.mts +3 -3
  793. package/node_modules/typebox/build/type/engine/ref/instantiate.mjs +6 -6
  794. package/node_modules/typebox/build/type/engine/required/from_dependent.d.mts +5 -0
  795. package/node_modules/typebox/build/type/engine/required/from_dependent.mjs +8 -0
  796. package/node_modules/typebox/build/type/engine/required/from_intersect.d.mts +1 -1
  797. package/node_modules/typebox/build/type/engine/required/from_intersect.mjs +3 -2
  798. package/node_modules/typebox/build/type/engine/required/from_object.d.mts +2 -2
  799. package/node_modules/typebox/build/type/engine/required/from_object.mjs +2 -2
  800. package/node_modules/typebox/build/type/engine/required/from_type.d.mts +3 -1
  801. package/node_modules/typebox/build/type/engine/required/from_type.mjs +7 -4
  802. package/node_modules/typebox/build/type/engine/template_literal/decode.mjs +3 -3
  803. package/node_modules/typebox/build/type/engine/template_literal/encode.d.mts +2 -2
  804. package/node_modules/typebox/build/type/engine/template_literal/encode.mjs +6 -6
  805. package/node_modules/typebox/build/type/engine/template_literal/is_finite.mjs +1 -1
  806. package/node_modules/typebox/build/type/engine/template_literal/is_pattern.mjs +1 -0
  807. package/node_modules/typebox/build/type/engine/this/expand_this.d.mts +1 -4
  808. package/node_modules/typebox/build/type/engine/this/expand_this.mjs +7 -13
  809. package/node_modules/typebox/build/type/engine/with/instantiate.d.mts +8 -0
  810. package/node_modules/typebox/build/type/engine/{options → with}/instantiate.mjs +5 -5
  811. package/node_modules/typebox/build/type/extends/dependent.d.mts +6 -0
  812. package/node_modules/typebox/build/type/extends/dependent.mjs +6 -0
  813. package/node_modules/typebox/build/type/extends/enum.d.mts +4 -4
  814. package/node_modules/typebox/build/type/extends/enum.mjs +3 -2
  815. package/node_modules/typebox/build/type/extends/extends_left.d.mts +5 -7
  816. package/node_modules/typebox/build/type/extends/extends_left.mjs +24 -27
  817. package/node_modules/typebox/build/type/extends/extends_right.d.mts +7 -5
  818. package/node_modules/typebox/build/type/extends/extends_right.mjs +20 -15
  819. package/node_modules/typebox/build/type/extends/inference.mjs +1 -1
  820. package/node_modules/typebox/build/type/extends/object.d.mts +8 -1
  821. package/node_modules/typebox/build/type/extends/object.mjs +25 -3
  822. package/node_modules/typebox/build/type/extends/parameters.mjs +2 -2
  823. package/node_modules/typebox/build/type/extends/record.d.mts +13 -0
  824. package/node_modules/typebox/build/type/extends/record.mjs +23 -0
  825. package/node_modules/typebox/build/type/extends/template_literal.d.mts +3 -3
  826. package/node_modules/typebox/build/type/extends/template_literal.mjs +3 -3
  827. package/node_modules/typebox/build/type/extends/tuple.d.mts +3 -6
  828. package/node_modules/typebox/build/type/extends/tuple.mjs +6 -5
  829. package/node_modules/typebox/build/type/extends/union.mjs +2 -2
  830. package/node_modules/typebox/build/type/script/mapping.d.mts +86 -98
  831. package/node_modules/typebox/build/type/script/mapping.mjs +95 -92
  832. package/node_modules/typebox/build/type/script/parser.d.mts +42 -40
  833. package/node_modules/typebox/build/type/script/parser.mjs +23 -22
  834. package/node_modules/typebox/build/type/script/script.d.mts +3 -4
  835. package/node_modules/typebox/build/type/script/script.mjs +3 -2
  836. package/node_modules/typebox/build/type/script/token/internal/guard.d.mts +1 -1
  837. package/node_modules/typebox/build/type/script/token/internal/guard.mjs +1 -1
  838. package/node_modules/typebox/build/type/script/token/internal/take.mjs +1 -1
  839. package/node_modules/typebox/build/type/script/token/until.mjs +2 -2
  840. package/node_modules/typebox/build/type/types/_codec.d.mts +12 -12
  841. package/node_modules/typebox/build/type/types/_codec.mjs +0 -1
  842. package/node_modules/typebox/build/type/types/_immutable.d.mts +2 -9
  843. package/node_modules/typebox/build/type/types/_immutable.mjs +2 -10
  844. package/node_modules/typebox/build/type/types/_optional.d.mts +2 -9
  845. package/node_modules/typebox/build/type/types/_optional.mjs +2 -11
  846. package/node_modules/typebox/build/type/types/_readonly.d.mts +2 -9
  847. package/node_modules/typebox/build/type/types/_readonly.mjs +2 -10
  848. package/node_modules/typebox/build/type/types/_refine.d.mts +8 -10
  849. package/node_modules/typebox/build/type/types/_refine.mjs +1 -2
  850. package/node_modules/typebox/build/type/types/call.d.mts +3 -3
  851. package/node_modules/typebox/build/type/types/call.mjs +3 -2
  852. package/node_modules/typebox/build/type/types/deferred.d.mts +1 -0
  853. package/node_modules/typebox/build/type/types/deferred.mjs +1 -1
  854. package/node_modules/typebox/build/type/types/dependent.d.mts +17 -0
  855. package/node_modules/typebox/build/type/types/dependent.mjs +24 -0
  856. package/node_modules/typebox/build/type/types/enum.d.mts +3 -1
  857. package/node_modules/typebox/build/type/types/enum.mjs +5 -0
  858. package/node_modules/typebox/build/type/types/index.d.mts +1 -4
  859. package/node_modules/typebox/build/type/types/index.mjs +1 -4
  860. package/node_modules/typebox/build/type/types/number.d.mts +1 -1
  861. package/node_modules/typebox/build/type/types/number.mjs +1 -1
  862. package/node_modules/typebox/build/type/types/record.d.mts +13 -7
  863. package/node_modules/typebox/build/type/types/record.mjs +15 -9
  864. package/node_modules/typebox/build/type/types/static.d.mts +2 -5
  865. package/node_modules/typebox/build/typebox.d.mts +3 -7
  866. package/node_modules/typebox/build/typebox.mjs +3 -7
  867. package/node_modules/typebox/build/value/clean/clean.mjs +4 -2
  868. package/node_modules/typebox/build/value/clean/from_intersect.mjs +2 -2
  869. package/node_modules/typebox/build/value/clean/from_type.mjs +8 -10
  870. package/node_modules/typebox/build/value/clean/from_union.d.mts +1 -1
  871. package/node_modules/typebox/build/value/clean/from_union.mjs +1 -2
  872. package/node_modules/typebox/build/value/clone/clone.mjs +2 -73
  873. package/node_modules/typebox/build/value/codec/decode.mjs +4 -2
  874. package/node_modules/typebox/build/value/codec/encode.mjs +4 -2
  875. package/node_modules/typebox/build/value/codec/from_array.mjs +1 -4
  876. package/node_modules/typebox/build/value/codec/from_object.mjs +1 -4
  877. package/node_modules/typebox/build/value/codec/from_record.mjs +2 -7
  878. package/node_modules/typebox/build/value/codec/from_tuple.mjs +1 -4
  879. package/node_modules/typebox/build/value/codec/from_union.mjs +2 -3
  880. package/node_modules/typebox/build/value/convert/from_enum.mjs +3 -4
  881. package/node_modules/typebox/build/value/convert/from_template_literal.d.mts +1 -1
  882. package/node_modules/typebox/build/value/convert/from_template_literal.mjs +2 -3
  883. package/node_modules/typebox/build/value/convert/from_type.mjs +19 -21
  884. package/node_modules/typebox/build/value/create/from_enum.mjs +2 -2
  885. package/node_modules/typebox/build/value/create/from_type.mjs +23 -31
  886. package/node_modules/typebox/build/value/default/from_object.mjs +1 -1
  887. package/node_modules/typebox/build/value/default/from_type.mjs +8 -10
  888. package/node_modules/typebox/build/value/errors/errors.d.mts +2 -2
  889. package/node_modules/typebox/build/value/errors/errors.mjs +1 -1
  890. package/node_modules/typebox/build/value/index.d.mts +0 -1
  891. package/node_modules/typebox/build/value/index.mjs +0 -1
  892. package/node_modules/typebox/build/value/repair/from_enum.mjs +2 -3
  893. package/node_modules/typebox/build/value/repair/from_type.mjs +24 -22
  894. package/node_modules/typebox/build/value/shared/union_priority_sort.d.mts +6 -2
  895. package/node_modules/typebox/build/value/shared/union_priority_sort.mjs +62 -26
  896. package/node_modules/typebox/build/value/value.d.mts +0 -1
  897. package/node_modules/typebox/build/value/value.mjs +0 -1
  898. package/node_modules/typebox/package.json +33 -33
  899. package/node_modules/typebox/readme.md +117 -103
  900. package/package.json +20 -10
  901. package/dist/core/extensions/builtin/tool-pair-guard/sanitize-anthropic-payload.d.ts +0 -3
  902. package/dist/core/extensions/builtin/tool-pair-guard/sanitize-anthropic-payload.d.ts.map +0 -1
  903. package/dist/core/extensions/builtin/tool-pair-guard/sanitize-anthropic-payload.js.map +0 -1
  904. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-repo.d.ts +0 -26
  905. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-repo.d.ts.map +0 -1
  906. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-repo.js +0 -100
  907. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-repo.js.map +0 -1
  908. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-storage.d.ts +0 -42
  909. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-storage.d.ts.map +0 -1
  910. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-storage.js +0 -286
  911. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-storage.js.map +0 -1
  912. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-repo.d.ts +0 -18
  913. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-repo.d.ts.map +0 -1
  914. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-repo.js +0 -44
  915. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-repo.js.map +0 -1
  916. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-storage.d.ts +0 -33
  917. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-storage.d.ts.map +0 -1
  918. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-storage.js +0 -163
  919. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-storage.js.map +0 -1
  920. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo-utils.d.ts +0 -11
  921. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo-utils.d.ts.map +0 -1
  922. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo-utils.js +0 -39
  923. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo-utils.js.map +0 -1
  924. package/node_modules/typebox/build/schema/engine/_guard.d.mts +0 -6
  925. package/node_modules/typebox/build/schema/engine/_guard.mjs +0 -26
  926. package/node_modules/typebox/build/schema/types/_guard.d.mts +0 -10
  927. package/node_modules/typebox/build/schema/types/_guard.mjs +0 -16
  928. package/node_modules/typebox/build/type/action/_optional.d.mts +0 -19
  929. package/node_modules/typebox/build/type/action/_optional.mjs +0 -40
  930. package/node_modules/typebox/build/type/action/_readonly.d.mts +0 -19
  931. package/node_modules/typebox/build/type/action/_readonly.mjs +0 -40
  932. package/node_modules/typebox/build/type/action/awaited.d.mts +0 -15
  933. package/node_modules/typebox/build/type/action/awaited.mjs +0 -15
  934. package/node_modules/typebox/build/type/action/options.d.mts +0 -11
  935. package/node_modules/typebox/build/type/action/options.mjs +0 -11
  936. package/node_modules/typebox/build/type/engine/awaited/instantiate.d.mts +0 -11
  937. package/node_modules/typebox/build/type/engine/awaited/instantiate.mjs +0 -20
  938. package/node_modules/typebox/build/type/engine/enum/enum_to_union.d.mts +0 -14
  939. package/node_modules/typebox/build/type/engine/enum/enum_to_union.mjs +0 -24
  940. package/node_modules/typebox/build/type/engine/options/index.d.mts +0 -1
  941. package/node_modules/typebox/build/type/engine/options/index.mjs +0 -1
  942. package/node_modules/typebox/build/type/engine/options/instantiate.d.mts +0 -8
  943. package/node_modules/typebox/build/type/extends/async_iterator.d.mts +0 -7
  944. package/node_modules/typebox/build/type/extends/async_iterator.mjs +0 -9
  945. package/node_modules/typebox/build/type/extends/iterator.d.mts +0 -7
  946. package/node_modules/typebox/build/type/extends/iterator.mjs +0 -9
  947. package/node_modules/typebox/build/type/extends/promise.d.mts +0 -7
  948. package/node_modules/typebox/build/type/extends/promise.mjs +0 -9
  949. package/node_modules/typebox/build/type/types/async_iterator.d.mts +0 -20
  950. package/node_modules/typebox/build/type/types/async_iterator.mjs +0 -28
  951. package/node_modules/typebox/build/type/types/base.d.mts +0 -50
  952. package/node_modules/typebox/build/type/types/base.mjs +0 -84
  953. package/node_modules/typebox/build/type/types/iterator.d.mts +0 -20
  954. package/node_modules/typebox/build/type/types/iterator.mjs +0 -28
  955. package/node_modules/typebox/build/type/types/promise.d.mts +0 -21
  956. package/node_modules/typebox/build/type/types/promise.mjs +0 -29
  957. package/node_modules/typebox/build/value/clean/from_base.d.mts +0 -2
  958. package/node_modules/typebox/build/value/clean/from_base.mjs +0 -4
  959. package/node_modules/typebox/build/value/convert/from_base.d.mts +0 -2
  960. package/node_modules/typebox/build/value/convert/from_base.mjs +0 -4
  961. package/node_modules/typebox/build/value/create/from_async_iterator.d.mts +0 -2
  962. package/node_modules/typebox/build/value/create/from_async_iterator.mjs +0 -5
  963. package/node_modules/typebox/build/value/create/from_base.d.mts +0 -2
  964. package/node_modules/typebox/build/value/create/from_base.mjs +0 -4
  965. package/node_modules/typebox/build/value/create/from_iterator.d.mts +0 -2
  966. package/node_modules/typebox/build/value/create/from_iterator.mjs +0 -5
  967. package/node_modules/typebox/build/value/create/from_promise.d.mts +0 -2
  968. package/node_modules/typebox/build/value/create/from_promise.mjs +0 -5
  969. package/node_modules/typebox/build/value/default/from_base.d.mts +0 -2
  970. package/node_modules/typebox/build/value/default/from_base.mjs +0 -5
  971. package/node_modules/typebox/build/value/mutate/error.d.mts +0 -3
  972. package/node_modules/typebox/build/value/mutate/error.mjs +0 -6
  973. package/node_modules/typebox/build/value/mutate/from_array.d.mts +0 -2
  974. package/node_modules/typebox/build/value/mutate/from_array.mjs +0 -16
  975. package/node_modules/typebox/build/value/mutate/from_object.d.mts +0 -2
  976. package/node_modules/typebox/build/value/mutate/from_object.mjs +0 -40
  977. package/node_modules/typebox/build/value/mutate/from_unknown.d.mts +0 -2
  978. package/node_modules/typebox/build/value/mutate/from_unknown.mjs +0 -7
  979. package/node_modules/typebox/build/value/mutate/from_value.d.mts +0 -2
  980. package/node_modules/typebox/build/value/mutate/from_value.mjs +0 -12
  981. package/node_modules/typebox/build/value/mutate/index.d.mts +0 -1
  982. package/node_modules/typebox/build/value/mutate/index.mjs +0 -1
  983. package/node_modules/typebox/build/value/mutate/mutate.d.mts +0 -11
  984. package/node_modules/typebox/build/value/mutate/mutate.mjs +0 -41
  985. package/node_modules/typebox/build/value/repair/from_base.d.mts +0 -2
  986. package/node_modules/typebox/build/value/repair/from_base.mjs +0 -8
  987. /package/node_modules/typebox/build/type/engine/{awaited → with}/index.d.mts +0 -0
  988. /package/node_modules/typebox/build/type/engine/{awaited → with}/index.mjs +0 -0
@@ -18,6 +18,7 @@ import { basename, dirname } from "node:path";
18
18
  import { prepareAgentToolCall } from "@earendil-works/pi-agent-core";
19
19
  import { contentText, SERVER_FALLBACK_ABORTED_DIAGNOSTIC } from "@earendil-works/pi-ai";
20
20
  import { cleanupSessionResources, isClassifierRefusal, isContextOverflow, isProviderStreamStallError, isProviderTimeoutError, isRetryableAssistantError, modelsAreEqual, resetApiProviders, streamSimple, } from "@earendil-works/pi-ai/compat";
21
+ import { extract429RetryAfterMs, parseRetryAfterMsMarker } from "@earendil-works/pi-ai/utils/retry-hint";
21
22
  import { getAgentDir } from "../config.js";
22
23
  import { getThemeByName, theme } from "../modes/interactive/theme/theme.js";
23
24
  import { stripFrontmatter } from "../utils/frontmatter.js";
@@ -41,9 +42,12 @@ import { getModelNarrowingPatterns, resolveModelScope } from "./model-resolver.j
41
42
  import { PROMPT_CACHE_SAFE_WAIT_ENV, resolvePromptCacheSafeWaitSeconds } from "./prompt-cache-budget.js";
42
43
  import { expandPromptTemplate } from "./prompt-templates.js";
43
44
  import { isBillingErrorMessage } from "./retry-fallback/billing.js";
45
+ import { formatSelector } from "./retry-fallback/chains.js";
44
46
  import { RetryFallbackController } from "./retry-fallback/controller.js";
45
47
  import { SelectorCooldowns } from "./retry-fallback/cooldown.js";
48
+ import { classifyRateLimitedWait, nextInTurnDelayMs, probeBackSchedule, } from "./retry-fallback/hint-policy.js";
46
49
  import { createFallbackLogger } from "./retry-fallback/log.js";
50
+ import { ProbeBackScheduler } from "./retry-fallback/probe-scheduler.js";
47
51
  import { validateFallbackChains } from "./retry-fallback/validate.js";
48
52
  import { createSessionLogger } from "./session-log.js";
49
53
  import { buildSessionContext, CURRENT_SESSION_VERSION, getLatestCompactionEntry, } from "./session-manager.js";
@@ -233,6 +237,9 @@ export class AgentSession {
233
237
  this._retryAbortController = undefined;
234
238
  this._retryAttempt = 0;
235
239
  this._consecutiveProviderStreamStalls = 0;
240
+ this._probePhase = "idle";
241
+ this._hintDeadlineMs = undefined;
242
+ this._cumulativeHintedWaitMs = 0;
236
243
  this._retryPromise = undefined;
237
244
  this._retryResolve = undefined;
238
245
  this._userAbortPromise = undefined;
@@ -242,7 +249,7 @@ export class AgentSession {
242
249
  this._hadClearedQueuedMessages = false;
243
250
  this._extensionEventSignal = undefined;
244
251
  // Bash execution state
245
- this._bashAbortController = undefined;
252
+ this._bashAbortControllers = new Set();
246
253
  this._pendingBashMessages = [];
247
254
  this._turnIndex = 0;
248
255
  this._baseToolDefinitions = new Map();
@@ -323,16 +330,19 @@ export class AgentSession {
323
330
  }
324
331
  this._modelRuntime = modelRuntime;
325
332
  this._modelRegistry = config.modelRegistry ?? new ModelRegistry(modelRuntime);
326
- const fallbackLogger = createFallbackLogger(config.agentDir ?? getAgentDir());
327
- this._sessionLogger = createSessionLogger(config.agentDir ?? getAgentDir());
333
+ this._agentDir = config.agentDir ?? getAgentDir();
334
+ const fallbackLogger = createFallbackLogger(this._agentDir);
335
+ this._sessionLogger = createSessionLogger(this._agentDir);
328
336
  this._fallbackValidationWarnings = validateFallbackChains(this.settingsManager.getRawFallbackChains(), this._modelRegistry);
329
337
  for (const warning of this._fallbackValidationWarnings) {
330
338
  fallbackLogger.warn("validation_warning", { warning });
331
339
  }
340
+ this._selectorCooldowns = new SelectorCooldowns(config.fallbackNow ?? (() => Date.now()));
341
+ this._fallbackNow = config.fallbackNow ?? (() => Date.now());
332
342
  this._retryFallback = new RetryFallbackController({
333
343
  getSettings: () => this.settingsManager.getRetryFallbackSettings(),
334
344
  registry: this._modelRegistry,
335
- cooldowns: new SelectorCooldowns(config.fallbackNow ?? (() => Date.now())),
345
+ cooldowns: this._selectorCooldowns,
336
346
  logger: fallbackLogger,
337
347
  switchModel: async (model, thinking, reason) => {
338
348
  await this._switchActiveModel(model, {
@@ -349,6 +359,9 @@ export class AgentSession {
349
359
  getCurrentSelector: () => (this.model ? { model: this.model, thinkingLevel: this.thinkingLevel } : undefined),
350
360
  isAuthAvailable: (provider) => this._modelRuntime.hasConfiguredAuth(provider),
351
361
  });
362
+ this._probeBackScheduler = new ProbeBackScheduler({
363
+ now: this._fallbackNow,
364
+ });
352
365
  this._extensionRunnerRef = config.extensionRunnerRef;
353
366
  this._initialActiveToolNames = config.initialActiveToolNames;
354
367
  this._allowedToolNames = config.allowedToolNames ? new Set(config.allowedToolNames) : undefined;
@@ -619,6 +632,10 @@ export class AgentSession {
619
632
  }
620
633
  /** Mirror stuck-prone lifecycle transitions into logs/session.log (content-free). */
621
634
  _logSessionEvent(event) {
635
+ if (event.type === "compaction_start") {
636
+ this._sessionLogger.info("compaction_start", { reason: event.reason });
637
+ return;
638
+ }
622
639
  if (event.type === "compaction_end") {
623
640
  this._sessionLogger.info("compaction_decision", {
624
641
  reason: event.reason,
@@ -656,6 +673,10 @@ export class AgentSession {
656
673
  getMessageRevision() {
657
674
  return this._messageRevision;
658
675
  }
676
+ /** Resolved agent state directory for this session. */
677
+ get agentDir() {
678
+ return this._agentDir;
679
+ }
659
680
  async _waitForSettledSessionWork() {
660
681
  await this._sessionWorkBarrier.waitForSettled(() => this._agentEventQueue);
661
682
  }
@@ -1018,6 +1039,7 @@ export class AgentSession {
1018
1039
  attempt: this._retryAttempt,
1019
1040
  });
1020
1041
  this._retryAttempt = 0;
1042
+ this._resetHintTierState();
1021
1043
  }
1022
1044
  }
1023
1045
  }
@@ -1107,6 +1129,77 @@ export class AgentSession {
1107
1129
  this._retryPromise = undefined;
1108
1130
  }
1109
1131
  }
1132
+ _resetHintTierState() {
1133
+ this._probePhase = "idle";
1134
+ this._hintDeadlineMs = undefined;
1135
+ this._cumulativeHintedWaitMs = 0;
1136
+ }
1137
+ /**
1138
+ * Arm the probe-back scheduler for a tier-2 demoted selector. The scheduler
1139
+ * will fire at most two probes (half-hint, then deadline) and clear the
1140
+ * selector cooldown on success so maybeRestorePrimary reverts at the next
1141
+ * turn boundary.
1142
+ */
1143
+ _armProbeBackForDemotedSelector(selector, hintMs) {
1144
+ if (!selector)
1145
+ return;
1146
+ // Guard: skip when the demoted selector is the ACTIVE model.
1147
+ const currentModel = this.model;
1148
+ if (currentModel && formatSelector(currentModel) === selector)
1149
+ return;
1150
+ // Guard: skip when auth is unavailable at arm time.
1151
+ const parts = selector.split("/");
1152
+ if (parts.length < 2)
1153
+ return;
1154
+ const provider = parts[0];
1155
+ if (!this._modelRuntime.hasConfiguredAuth(provider))
1156
+ return;
1157
+ const now = this._fallbackNow();
1158
+ const schedule = probeBackSchedule(hintMs, now);
1159
+ const modelId = parts.slice(1).join("/");
1160
+ const demotedModel = this._modelRuntime.getModel(provider, modelId);
1161
+ if (!demotedModel)
1162
+ return;
1163
+ this._probeBackScheduler.arm({
1164
+ selector,
1165
+ firstAtMs: schedule.firstAtMs,
1166
+ deadlineMs: schedule.deadlineMs,
1167
+ authAvailable: () => this._modelRuntime.hasConfiguredAuth(provider),
1168
+ runProbe: async (signal) => {
1169
+ try {
1170
+ const result = await this._modelRuntime.completeSimple(demotedModel, {
1171
+ systemPrompt: "Reply with OK.",
1172
+ messages: [{ role: "user", content: [{ type: "text", text: "OK" }], timestamp: now }],
1173
+ }, { maxTokens: 1, signal });
1174
+ return result.stopReason !== "error" && result.stopReason !== "aborted";
1175
+ }
1176
+ catch {
1177
+ return false;
1178
+ }
1179
+ },
1180
+ onCleared: (sel) => {
1181
+ this._selectorCooldowns.clear(sel);
1182
+ },
1183
+ emit: (event) => {
1184
+ if (event.type === "retry_probe_scheduled") {
1185
+ this._emit({
1186
+ type: "retry_probe_scheduled",
1187
+ selector: event.selector,
1188
+ atMs: event.atMs,
1189
+ probeIndex: event.probeIndex,
1190
+ });
1191
+ }
1192
+ else {
1193
+ this._emit({
1194
+ type: "retry_probe_result",
1195
+ selector: event.selector,
1196
+ ok: event.ok,
1197
+ errorMessage: event.errorMessage,
1198
+ });
1199
+ }
1200
+ },
1201
+ });
1202
+ }
1110
1203
  /** Find the last assistant message in agent state (including aborted ones) */
1111
1204
  _findLastAssistantMessage() {
1112
1205
  const messages = this.agent.state.messages;
@@ -1318,6 +1411,7 @@ export class AgentSession {
1318
1411
  */
1319
1412
  dispose() {
1320
1413
  try {
1414
+ this._probeBackScheduler.cancel("dispose");
1321
1415
  this.abortRetry();
1322
1416
  this.abortCompaction();
1323
1417
  this.abortBranchSummary();
@@ -2253,8 +2347,23 @@ export class AgentSession {
2253
2347
  }
2254
2348
  }
2255
2349
  else if (options?.triggerTurn) {
2256
- await this._enforceCompactionBeforeProvider(this._findLastAssistantMessage(), false, "pre_prompt");
2257
- await this._enforceFinalProviderAdmission([appMessage]);
2350
+ try {
2351
+ await this._enforceCompactionBeforeProvider(this._findLastAssistantMessage(), false, "pre_prompt");
2352
+ await this._enforceFinalProviderAdmission([appMessage]);
2353
+ }
2354
+ catch (error) {
2355
+ // Mirror sendUserMessage's retention contract: an admission
2356
+ // rejection must retain the message for later delivery instead
2357
+ // of silently dropping it (the fire-and-forget extension action
2358
+ // swallows this rejection).
2359
+ if (options.deliverAs === "followUp") {
2360
+ this.agent.followUp(appMessage);
2361
+ }
2362
+ else {
2363
+ this.agent.steer(appMessage);
2364
+ }
2365
+ throw error;
2366
+ }
2258
2367
  await this._promptAgent(appMessage);
2259
2368
  }
2260
2369
  else {
@@ -2509,6 +2618,7 @@ export class AgentSession {
2509
2618
  // A manual model change abandons any active fallback window; if a fallback
2510
2619
  // retry sleep is still pending, cancel it so no surprise continuation fires.
2511
2620
  const hadActiveFallback = this._retryFallback.activeState !== undefined;
2621
+ this._probeBackScheduler.cancel("manual-model-change");
2512
2622
  this._retryFallback.clearForManualModelChange(model);
2513
2623
  if (hadActiveFallback && this._retryAbortController) {
2514
2624
  this.abortRetry();
@@ -2594,6 +2704,7 @@ export class AgentSession {
2594
2704
  if (invalidatesCompaction) {
2595
2705
  this._invalidateCompactionForModelSelection();
2596
2706
  }
2707
+ this._probeBackScheduler.cancel("manual-model-change");
2597
2708
  this._retryFallback.clearForManualModelChange(next.model);
2598
2709
  const thinkingLevel = this._getThinkingLevelForModelSwitch(next.thinkingLevel);
2599
2710
  this.agent.state.model = next.model;
@@ -2905,6 +3016,8 @@ export class AgentSession {
2905
3016
  this._releasePendingCompactionAdmission(admission, outcome);
2906
3017
  if (disconnected && !this.isCompacting)
2907
3018
  this._reconnectToAgent();
3019
+ if (outcome === "completed")
3020
+ this._resumeQueuedMessagesAfterCompaction();
2908
3021
  }
2909
3022
  }
2910
3023
  async applyCompaction(precomputed, options) {
@@ -2934,6 +3047,7 @@ export class AgentSession {
2934
3047
  if (!execution.accepted) {
2935
3048
  return { applied: false, reason: "rejected" };
2936
3049
  }
3050
+ this._resumeQueuedMessagesAfterCompaction();
2937
3051
  return { applied: true, reason: "ok" };
2938
3052
  }
2939
3053
  catch (error) {
@@ -3633,6 +3747,18 @@ export class AgentSession {
3633
3747
  this._scheduledContinuationRecompacted = false;
3634
3748
  }
3635
3749
  }
3750
+ /**
3751
+ * Mirror _runAutoCompaction's post-success recovery for non-auto compaction
3752
+ * owners (manual, extension action, extension apply): a custom triggerTurn
3753
+ * message sent while the compaction was running is parked in the agent-level
3754
+ * queues without starting a turn, so a settled compaction must deliver it or
3755
+ * hidden continuations (e.g. goal) wedge until manual user input.
3756
+ */
3757
+ _resumeQueuedMessagesAfterCompaction() {
3758
+ if (this.pendingMessageCount > 0 || this.agent.hasQueuedMessages()) {
3759
+ this._scheduleContinuationAfterCurrentEvent();
3760
+ }
3761
+ }
3636
3762
  _scheduleContinuationAfterCurrentEvent(options = {}, retryContinuation = false) {
3637
3763
  // Tool hooks wait for queued message persistence, so continue() cannot run inside this event promise.
3638
3764
  const currentEventQueue = this._agentEventQueue;
@@ -3976,7 +4102,9 @@ export class AgentSession {
3976
4102
  }, {
3977
4103
  getModel: () => this.model,
3978
4104
  getServiceTier: () => this.serviceTier,
4105
+ getScopedModels: () => this._scopedModels,
3979
4106
  isIdle: () => this.isIdle,
4107
+ getAgentDir: () => this._agentDir,
3980
4108
  isProjectTrusted: () => this.settingsManager.isProjectTrusted(),
3981
4109
  getSignal: () => this._extensionEventSignal ?? this.agent.signal,
3982
4110
  abort: () => {
@@ -4043,6 +4171,7 @@ export class AgentSession {
4043
4171
  const controller = admission.controller;
4044
4172
  void (async () => {
4045
4173
  let outcome = "failed";
4174
+ let compactionCompleted = false;
4046
4175
  let disconnected = false;
4047
4176
  try {
4048
4177
  await this._abortActiveAgentAndRetry("system");
@@ -4058,6 +4187,7 @@ export class AgentSession {
4058
4187
  });
4059
4188
  if (execution.accepted) {
4060
4189
  outcome = "completed";
4190
+ compactionCompleted = true;
4061
4191
  options?.onComplete?.(execution.result);
4062
4192
  }
4063
4193
  else {
@@ -4091,6 +4221,10 @@ export class AgentSession {
4091
4221
  this._releasePendingCompactionAdmission(admission, outcome);
4092
4222
  if (disconnected && !this.isCompacting)
4093
4223
  this._reconnectToAgent();
4224
+ // A throwing onComplete consumer overwrites outcome in the catch
4225
+ // block, so recovery keys off whether compaction itself succeeded.
4226
+ if (compactionCompleted)
4227
+ this._resumeQueuedMessagesAfterCompaction();
4094
4228
  }
4095
4229
  })();
4096
4230
  },
@@ -4352,32 +4486,11 @@ export class AgentSession {
4352
4486
  this._retryFallback.canTryFallback());
4353
4487
  }
4354
4488
  _getProviderRetryDelayMs(errorMessage) {
4355
- const retryAfterMsMatch = errorMessage.match(/\bretry[-_ ]?after[-_ ]?ms\s*[:=]\s*(\d+(?:\.\d+)?)/i);
4356
- if (retryAfterMsMatch) {
4357
- const delayMs = Math.ceil(Number(retryAfterMsMatch[1]));
4358
- return Number.isFinite(delayMs) && delayMs > 0 ? delayMs : undefined;
4359
- }
4360
- const retryAfterSecondsMatch = errorMessage.match(/\bretry[-_ ]?after\s*[:=]\s*(\d+(?:\.\d+)?)/i);
4361
- if (retryAfterSecondsMatch) {
4362
- const delayMs = Math.ceil(Number(retryAfterSecondsMatch[1]) * 1000);
4363
- return Number.isFinite(delayMs) && delayMs > 0 ? delayMs : undefined;
4364
- }
4365
- const retryInMatch = errorMessage.match(/\b(?:retry|try again|wait)\s+(?:after|in)\s*(\d+(?:\.\d+)?)\s*(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m)\b/i);
4366
- if (!retryInMatch) {
4367
- return undefined;
4368
- }
4369
- const value = Number(retryInMatch[1]);
4370
- if (!Number.isFinite(value) || value <= 0) {
4371
- return undefined;
4372
- }
4373
- const unit = retryInMatch[2].toLowerCase();
4374
- if (unit === "m" || unit.startsWith("min")) {
4375
- return Math.ceil(value * 60_000);
4376
- }
4377
- if (unit.startsWith("s")) {
4378
- return Math.ceil(value * 1000);
4379
- }
4380
- return Math.ceil(value);
4489
+ const markerMs = parseRetryAfterMsMarker(errorMessage);
4490
+ if (markerMs !== undefined)
4491
+ return markerMs;
4492
+ const hintMs = extract429RetryAfterMs({ bodyText: errorMessage });
4493
+ return hintMs;
4381
4494
  }
4382
4495
  _getProviderTimeoutRetryOptions(message) {
4383
4496
  if (!isProviderTimeoutError(message))
@@ -4445,6 +4558,8 @@ export class AgentSession {
4445
4558
  const isRefusal = isClassifierRefusal(message);
4446
4559
  const hardErrorFallback = options.hardErrorFallback === true;
4447
4560
  let switchedFallback = false;
4561
+ let is429TierRouted = false;
4562
+ let hintTierDelayMs;
4448
4563
  if (hardErrorFallback) {
4449
4564
  // A non-retryable provider failure must never replay on the same model.
4450
4565
  // Billing-class failures never recover on this account, so the fallback
@@ -4471,6 +4586,7 @@ export class AgentSession {
4471
4586
  });
4472
4587
  }
4473
4588
  this._retryAttempt = 0;
4589
+ this._resetHintTierState();
4474
4590
  this._resolveRetry();
4475
4591
  return "not-handled";
4476
4592
  }
@@ -4489,6 +4605,7 @@ export class AgentSession {
4489
4605
  });
4490
4606
  }
4491
4607
  this._retryAttempt = 0;
4608
+ this._resetHintTierState();
4492
4609
  this._resolveRetry();
4493
4610
  return "not-handled";
4494
4611
  }
@@ -4508,8 +4625,159 @@ export class AgentSession {
4508
4625
  const stallError = isProviderStreamStallError(message);
4509
4626
  const escalateAfterRepeatedStall = stallError && this._consecutiveProviderStreamStalls > 0;
4510
4627
  this._consecutiveProviderStreamStalls = stallError ? this._consecutiveProviderStreamStalls + 1 : 0;
4511
- this._retryAttempt++;
4512
- if (this._retryAttempt > settings.maxRetries || escalateAfterRepeatedStall) {
4628
+ // 429-class detection: retryable AND message carries rate-limit markers.
4629
+ const is429Class = !stallError &&
4630
+ /rate.?limit|(?:^429(?=\s+\{)|(?:\bHTTP\/1\.[01]\s+|\bHTTP\s+|\bstatus(?:\s+code)?\s+|\berror\s+|\bcode\s+)429\b)|too many requests|resource.?exhausted/i.test(errorMessage);
4631
+ if (is429Class) {
4632
+ const hintMs = this._getProviderRetryDelayMs(errorMessage);
4633
+ const hintSettings = this.settingsManager.getHintPolicySettings();
4634
+ const tier = classifyRateLimitedWait(hintMs, hintSettings);
4635
+ is429TierRouted = true;
4636
+ if (tier === "no-hint-fast-fallback") {
4637
+ // Skip same-model retries entirely; fall back immediately.
4638
+ switchedFallback = await this._retryFallback.tryFallback("transient", { errorMessage });
4639
+ if (switchedFallback) {
4640
+ this._retryAttempt = 1;
4641
+ }
4642
+ else {
4643
+ const exhaustedChainKey = this._retryFallback.exhaustedChainKey;
4644
+ if (exhaustedChainKey) {
4645
+ this._emit({
4646
+ type: "retry_fallback_exhausted",
4647
+ chainKey: exhaustedChainKey,
4648
+ lastError: errorMessage,
4649
+ });
4650
+ }
4651
+ this._emit({
4652
+ type: "auto_retry_end",
4653
+ success: false,
4654
+ attempt: 0,
4655
+ finalError: message.errorMessage,
4656
+ });
4657
+ this._retryAttempt = 0;
4658
+ this._resetHintTierState();
4659
+ this._resolveRetry();
4660
+ return "not-handled";
4661
+ }
4662
+ }
4663
+ else if (tier === "tier1-in-turn") {
4664
+ this._retryAttempt++;
4665
+ if (this._retryAttempt > settings.maxRetries) {
4666
+ // Budget exhausted within tier1; fall back.
4667
+ switchedFallback = await this._retryFallback.tryFallback("transient", {
4668
+ errorMessage,
4669
+ retryAfterMs: this._getProviderRetryDelayMs(errorMessage),
4670
+ });
4671
+ if (switchedFallback) {
4672
+ this._retryAttempt = 1;
4673
+ }
4674
+ else {
4675
+ const exhaustedChainKey = this._retryFallback.exhaustedChainKey;
4676
+ if (exhaustedChainKey) {
4677
+ this._emit({
4678
+ type: "retry_fallback_exhausted",
4679
+ chainKey: exhaustedChainKey,
4680
+ lastError: errorMessage,
4681
+ });
4682
+ }
4683
+ this._emit({
4684
+ type: "auto_retry_end",
4685
+ success: false,
4686
+ attempt: this._retryAttempt - 1,
4687
+ finalError: message.errorMessage,
4688
+ });
4689
+ this._retryAttempt = 0;
4690
+ this._resetHintTierState();
4691
+ this._resolveRetry();
4692
+ return "not-handled";
4693
+ }
4694
+ }
4695
+ else {
4696
+ const inTurnResult = nextInTurnDelayMs({
4697
+ probePhase: this._probePhase,
4698
+ hintDeadlineMs: this._hintDeadlineMs,
4699
+ attempt: this._retryAttempt,
4700
+ cumulativeHintedWaitMs: this._cumulativeHintedWaitMs,
4701
+ }, hintMs, settings.baseDelayMs, hintSettings.hintedWaitCapMs, Date.now());
4702
+ this._probePhase = inTurnResult.probePhase;
4703
+ this._hintDeadlineMs = inTurnResult.hintDeadlineMs;
4704
+ this._cumulativeHintedWaitMs = inTurnResult.cumulativeHintedWaitMs;
4705
+ if (inTurnResult.demoteToProbeBack) {
4706
+ // Cumulative hinted wait exceeded cap; demote to tier2 fallback path.
4707
+ const remainingHintMs = Math.max(0, (this._hintDeadlineMs ?? Date.now()) - Date.now());
4708
+ switchedFallback = await this._retryFallback.tryFallback("transient", {
4709
+ errorMessage,
4710
+ retryAfterMs: remainingHintMs,
4711
+ });
4712
+ if (switchedFallback) {
4713
+ this._retryAttempt = 1;
4714
+ }
4715
+ else {
4716
+ const exhaustedChainKey = this._retryFallback.exhaustedChainKey;
4717
+ if (exhaustedChainKey) {
4718
+ this._emit({
4719
+ type: "retry_fallback_exhausted",
4720
+ chainKey: exhaustedChainKey,
4721
+ lastError: errorMessage,
4722
+ });
4723
+ }
4724
+ this._emit({
4725
+ type: "auto_retry_end",
4726
+ success: false,
4727
+ attempt: this._retryAttempt - 1,
4728
+ finalError: message.errorMessage,
4729
+ });
4730
+ this._retryAttempt = 0;
4731
+ this._resetHintTierState();
4732
+ this._resolveRetry();
4733
+ return "not-handled";
4734
+ }
4735
+ }
4736
+ else {
4737
+ hintTierDelayMs = inTurnResult.delayMs;
4738
+ }
4739
+ }
4740
+ }
4741
+ else {
4742
+ // tier2-fallback-probe-back or tier3-fallback-only: immediate fallback.
4743
+ const remainingHintMs = hintMs ?? 0;
4744
+ switchedFallback = await this._retryFallback.tryFallback("transient", {
4745
+ errorMessage,
4746
+ retryAfterMs: remainingHintMs,
4747
+ });
4748
+ if (switchedFallback) {
4749
+ this._retryAttempt = 1;
4750
+ if (tier === "tier2-fallback-probe-back") {
4751
+ const selector = this._retryFallback.activeState?.originalSelector ?? "";
4752
+ this._armProbeBackForDemotedSelector(selector, remainingHintMs);
4753
+ }
4754
+ }
4755
+ else {
4756
+ const exhaustedChainKey = this._retryFallback.exhaustedChainKey;
4757
+ if (exhaustedChainKey) {
4758
+ this._emit({
4759
+ type: "retry_fallback_exhausted",
4760
+ chainKey: exhaustedChainKey,
4761
+ lastError: errorMessage,
4762
+ });
4763
+ }
4764
+ this._emit({
4765
+ type: "auto_retry_end",
4766
+ success: false,
4767
+ attempt: 0,
4768
+ finalError: message.errorMessage,
4769
+ });
4770
+ this._retryAttempt = 0;
4771
+ this._resetHintTierState();
4772
+ this._resolveRetry();
4773
+ return "not-handled";
4774
+ }
4775
+ }
4776
+ }
4777
+ if (!is429TierRouted) {
4778
+ this._retryAttempt++;
4779
+ }
4780
+ if (!is429TierRouted && (this._retryAttempt > settings.maxRetries || escalateAfterRepeatedStall)) {
4513
4781
  switchedFallback = await this._retryFallback.tryFallback("transient", {
4514
4782
  errorMessage,
4515
4783
  retryAfterMs: this._getProviderRetryDelayMs(errorMessage),
@@ -4534,6 +4802,7 @@ export class AgentSession {
4534
4802
  finalError: message.errorMessage,
4535
4803
  });
4536
4804
  this._retryAttempt = 0;
4805
+ this._resetHintTierState();
4537
4806
  this._resolveRetry();
4538
4807
  return "not-handled";
4539
4808
  }
@@ -4544,7 +4813,8 @@ export class AgentSession {
4544
4813
  }
4545
4814
  const providerDelayMs = isRefusal || hardErrorFallback ? undefined : this._getProviderRetryDelayMs(errorMessage);
4546
4815
  const maxRetryDelayMs = this.settingsManager.getProviderRetrySettings().maxRetryDelayMs;
4547
- if (providerDelayMs !== undefined && providerDelayMs > maxRetryDelayMs) {
4816
+ // For 429-class failures the tier routing replaces the over-budget gate.
4817
+ if (!is429TierRouted && providerDelayMs !== undefined && providerDelayMs > maxRetryDelayMs) {
4548
4818
  // A wait this long means the model is unavailable rather than busy, so the
4549
4819
  // configured chain beats failing the turn. The switch is gated: the over-budget
4550
4820
  // branch above may have already switched on this same error, and hopping again
@@ -4566,6 +4836,7 @@ export class AgentSession {
4566
4836
  finalError: `Provider requested retry delay ${providerDelayMs}ms, exceeding configured maximum ${maxRetryDelayMs}ms`,
4567
4837
  });
4568
4838
  this._retryAttempt = 0;
4839
+ this._resetHintTierState();
4569
4840
  this._resolveRetry();
4570
4841
  return "not-handled";
4571
4842
  }
@@ -4575,7 +4846,12 @@ export class AgentSession {
4575
4846
  // reach this point with a fallback already applied (hard-error, refusal) set
4576
4847
  // switchedFallback first and force providerDelayMs undefined, so no branch may
4577
4848
  // be reordered to fall through here expecting an implicit switch.
4578
- const delayMs = switchedFallback ? 0 : (providerDelayMs ?? settings.baseDelayMs * 2 ** (this._retryAttempt - 1));
4849
+ const nonTierProviderDelayMs = providerDelayMs === 0 ? undefined : providerDelayMs;
4850
+ const delayMs = switchedFallback
4851
+ ? 0
4852
+ : is429TierRouted
4853
+ ? (hintTierDelayMs ?? providerDelayMs ?? settings.baseDelayMs * 2 ** (this._retryAttempt - 1))
4854
+ : (nonTierProviderDelayMs ?? settings.baseDelayMs * 2 ** (this._retryAttempt - 1));
4579
4855
  // Prepare before auto_retry_start so an immediate Esc can cancel the retry sleep.
4580
4856
  this._retryAbortController = new AbortController();
4581
4857
  this._emit({
@@ -4599,6 +4875,7 @@ export class AgentSession {
4599
4875
  // Aborted during sleep - emit end event so UI can clean up
4600
4876
  const attempt = this._retryAttempt;
4601
4877
  this._retryAttempt = 0;
4878
+ this._resetHintTierState();
4602
4879
  this._retryAbortController = undefined;
4603
4880
  await this._emitAgentSettled();
4604
4881
  this._emit({
@@ -4627,6 +4904,7 @@ export class AgentSession {
4627
4904
  if (!preRetryCompaction && !this._isCompactionOnCooldown()) {
4628
4905
  const attempt = this._retryAttempt;
4629
4906
  this._retryAttempt = 0;
4907
+ this._resetHintTierState();
4630
4908
  this._emit({
4631
4909
  type: "auto_retry_end",
4632
4910
  success: false,
@@ -4695,7 +4973,8 @@ export class AgentSession {
4695
4973
  * @param options.operations Custom BashOperations for remote execution
4696
4974
  */
4697
4975
  async executeBash(command, onChunk, options) {
4698
- this._bashAbortController = new AbortController();
4976
+ const abortController = new AbortController();
4977
+ this._bashAbortControllers.add(abortController);
4699
4978
  // Apply command prefix if configured (e.g., "shopt -s expand_aliases" for alias support)
4700
4979
  const prefix = this.settingsManager.getShellCommandPrefix();
4701
4980
  const shellPath = this.settingsManager.getShellPath();
@@ -4706,13 +4985,13 @@ export class AgentSession {
4706
4985
  onChunk?.(delta);
4707
4986
  this._emit({ type: "bash_execution_update", id: options?.id, delta });
4708
4987
  },
4709
- signal: this._bashAbortController.signal,
4988
+ signal: abortController.signal,
4710
4989
  });
4711
4990
  this.recordBashResult(command, result, options);
4712
4991
  return result;
4713
4992
  }
4714
4993
  finally {
4715
- this._bashAbortController = undefined;
4994
+ this._bashAbortControllers.delete(abortController);
4716
4995
  }
4717
4996
  }
4718
4997
  /**
@@ -4748,11 +5027,13 @@ export class AgentSession {
4748
5027
  * Cancel running bash command.
4749
5028
  */
4750
5029
  abortBash() {
4751
- this._bashAbortController?.abort();
5030
+ for (const abortController of [...this._bashAbortControllers]) {
5031
+ abortController.abort();
5032
+ }
4752
5033
  }
4753
5034
  /** Whether a bash command is currently running */
4754
5035
  get isBashRunning() {
4755
- return this._bashAbortController !== undefined;
5036
+ return this._bashAbortControllers.size > 0;
4756
5037
  }
4757
5038
  /** Whether there are pending bash messages waiting to be flushed */
4758
5039
  get hasPendingBashMessages() {
@@ -4801,6 +5082,9 @@ export class AgentSession {
4801
5082
  * @returns Result with editorText (if user message) and cancelled status
4802
5083
  */
4803
5084
  async navigateTree(targetId, options = {}) {
5085
+ if (this.isStreaming) {
5086
+ throw new Error("Wait for the current response to finish before navigating the session tree.");
5087
+ }
4804
5088
  const oldLeafId = this.sessionManager.getLeafId();
4805
5089
  // No-op if already at target
4806
5090
  if (targetId === oldLeafId) {