@code-yeongyu/senpi 2026.7.31 → 2026.8.3-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 (1411) hide show
  1. package/CHANGELOG.md +311 -0
  2. package/README.md +10 -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 +28 -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 +89 -14
  27. package/dist/core/agent-session.d.ts.map +1 -1
  28. package/dist/core/agent-session.js +554 -90
  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/build.d.ts.map +1 -1
  35. package/dist/core/dynamic-prompt/build.js +4 -0
  36. package/dist/core/dynamic-prompt/build.js.map +1 -1
  37. package/dist/core/dynamic-prompt/verification.d.ts +2 -2
  38. package/dist/core/dynamic-prompt/verification.d.ts.map +1 -1
  39. package/dist/core/dynamic-prompt/verification.js +2 -2
  40. package/dist/core/dynamic-prompt/verification.js.map +1 -1
  41. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/account-command.d.ts +2 -2
  42. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/account-command.d.ts.map +1 -1
  43. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/account-command.js +25 -25
  44. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/account-command.js.map +1 -1
  45. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/account-events.d.ts.map +1 -1
  46. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/account-events.js.map +1 -1
  47. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/account-management.d.ts +1 -1
  48. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/account-management.d.ts.map +1 -1
  49. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/account-management.js +2 -2
  50. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/account-management.js.map +1 -1
  51. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/accounts.d.ts +9 -9
  52. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/accounts.d.ts.map +1 -1
  53. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/accounts.js +2 -2
  54. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/accounts.js.map +1 -1
  55. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/affinity.d.ts +1 -1
  56. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/affinity.d.ts.map +1 -1
  57. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/affinity.js +3 -3
  58. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/affinity.js.map +1 -1
  59. package/dist/core/extensions/builtin/claude-sdk-oauth/auth-attempt.d.ts +21 -0
  60. package/dist/core/extensions/builtin/claude-sdk-oauth/auth-attempt.d.ts.map +1 -0
  61. package/dist/core/extensions/builtin/claude-sdk-oauth/auth-attempt.js +30 -0
  62. package/dist/core/extensions/builtin/claude-sdk-oauth/auth-attempt.js.map +1 -0
  63. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/auth-lane.d.ts +8 -4
  64. package/dist/core/extensions/builtin/claude-sdk-oauth/auth-lane.d.ts.map +1 -0
  65. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/auth-lane.js +34 -25
  66. package/dist/core/extensions/builtin/claude-sdk-oauth/auth-lane.js.map +1 -0
  67. package/dist/core/extensions/builtin/claude-sdk-oauth/bounded-queue.d.ts +17 -0
  68. package/dist/core/extensions/builtin/claude-sdk-oauth/bounded-queue.d.ts.map +1 -0
  69. package/dist/core/extensions/builtin/claude-sdk-oauth/bounded-queue.js +56 -0
  70. package/dist/core/extensions/builtin/claude-sdk-oauth/bounded-queue.js.map +1 -0
  71. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/custom-tools-schema.d.ts.map +1 -1
  72. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/custom-tools-schema.js.map +1 -1
  73. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/custom-tools.d.ts.map +1 -1
  74. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/custom-tools.js.map +1 -1
  75. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/errors.d.ts +1 -1
  76. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/errors.d.ts.map +1 -1
  77. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/errors.js +1 -1
  78. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/errors.js.map +1 -1
  79. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/executable.d.ts.map +1 -1
  80. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/executable.js.map +1 -1
  81. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/failover.d.ts.map +1 -1
  82. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/failover.js +1 -1
  83. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/failover.js.map +1 -1
  84. package/dist/core/extensions/builtin/claude-sdk-oauth/guidance.d.ts +14 -0
  85. package/dist/core/extensions/builtin/claude-sdk-oauth/guidance.d.ts.map +1 -0
  86. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/guidance.js +37 -1
  87. package/dist/core/extensions/builtin/claude-sdk-oauth/guidance.js.map +1 -0
  88. package/dist/core/extensions/builtin/claude-sdk-oauth/index.d.ts +4 -0
  89. package/dist/core/extensions/builtin/claude-sdk-oauth/index.d.ts.map +1 -0
  90. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/index.js +12 -10
  91. package/dist/core/extensions/builtin/claude-sdk-oauth/index.js.map +1 -0
  92. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/oauth-login.d.ts +3 -3
  93. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/oauth-login.d.ts.map +1 -1
  94. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/oauth-login.js +2 -2
  95. package/dist/core/extensions/builtin/claude-sdk-oauth/oauth-login.js.map +1 -0
  96. package/dist/core/extensions/builtin/claude-sdk-oauth/options.d.ts +18 -0
  97. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/options.d.ts.map +1 -1
  98. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/options.js +70 -10
  99. package/dist/core/extensions/builtin/claude-sdk-oauth/options.js.map +1 -0
  100. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/prompt-bridge.d.ts.map +1 -1
  101. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/prompt-bridge.js +32 -19
  102. package/dist/core/extensions/builtin/claude-sdk-oauth/prompt-bridge.js.map +1 -0
  103. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/sdk-boundary.d.ts +2 -0
  104. package/dist/core/extensions/builtin/claude-sdk-oauth/sdk-boundary.d.ts.map +1 -0
  105. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/sdk-boundary.js.map +1 -1
  106. package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding.d.ts +32 -0
  107. package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding.d.ts.map +1 -0
  108. package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding.js +43 -0
  109. package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding.js.map +1 -0
  110. package/dist/core/extensions/builtin/claude-sdk-oauth/session-commit-boundary.d.ts +18 -0
  111. package/dist/core/extensions/builtin/claude-sdk-oauth/session-commit-boundary.d.ts.map +1 -0
  112. package/dist/core/extensions/builtin/claude-sdk-oauth/session-commit-boundary.js +46 -0
  113. package/dist/core/extensions/builtin/claude-sdk-oauth/session-commit-boundary.js.map +1 -0
  114. package/dist/core/extensions/builtin/claude-sdk-oauth/session-continuity.d.ts +81 -0
  115. package/dist/core/extensions/builtin/claude-sdk-oauth/session-continuity.d.ts.map +1 -0
  116. package/dist/core/extensions/builtin/claude-sdk-oauth/session-continuity.js +127 -0
  117. package/dist/core/extensions/builtin/claude-sdk-oauth/session-continuity.js.map +1 -0
  118. package/dist/core/extensions/builtin/claude-sdk-oauth/session-entry-annotations.d.ts +10 -0
  119. package/dist/core/extensions/builtin/claude-sdk-oauth/session-entry-annotations.d.ts.map +1 -0
  120. package/dist/core/extensions/builtin/claude-sdk-oauth/session-entry-annotations.js +34 -0
  121. package/dist/core/extensions/builtin/claude-sdk-oauth/session-entry-annotations.js.map +1 -0
  122. package/dist/core/extensions/builtin/claude-sdk-oauth/session-observability.d.ts +56 -0
  123. package/dist/core/extensions/builtin/claude-sdk-oauth/session-observability.d.ts.map +1 -0
  124. package/dist/core/extensions/builtin/claude-sdk-oauth/session-observability.js +174 -0
  125. package/dist/core/extensions/builtin/claude-sdk-oauth/session-observability.js.map +1 -0
  126. package/dist/core/extensions/builtin/claude-sdk-oauth/session-reaper.d.ts +24 -0
  127. package/dist/core/extensions/builtin/claude-sdk-oauth/session-reaper.d.ts.map +1 -0
  128. package/dist/core/extensions/builtin/claude-sdk-oauth/session-reaper.js +34 -0
  129. package/dist/core/extensions/builtin/claude-sdk-oauth/session-reaper.js.map +1 -0
  130. package/dist/core/extensions/builtin/claude-sdk-oauth/session-reattach.d.ts +34 -0
  131. package/dist/core/extensions/builtin/claude-sdk-oauth/session-reattach.d.ts.map +1 -0
  132. package/dist/core/extensions/builtin/claude-sdk-oauth/session-reattach.js +85 -0
  133. package/dist/core/extensions/builtin/claude-sdk-oauth/session-reattach.js.map +1 -0
  134. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-pump.d.ts +19 -0
  135. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-pump.d.ts.map +1 -0
  136. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-pump.js +176 -0
  137. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-pump.js.map +1 -0
  138. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-state.d.ts +18 -0
  139. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-state.d.ts.map +1 -0
  140. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-state.js +33 -0
  141. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-state.js.map +1 -0
  142. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-wiring.d.ts +3 -0
  143. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-wiring.d.ts.map +1 -0
  144. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-wiring.js +76 -0
  145. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-wiring.js.map +1 -0
  146. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry.d.ts +87 -0
  147. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry.d.ts.map +1 -0
  148. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry.js +259 -0
  149. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry.js.map +1 -0
  150. package/dist/core/extensions/builtin/claude-sdk-oauth/session-stream.d.ts +19 -0
  151. package/dist/core/extensions/builtin/claude-sdk-oauth/session-stream.d.ts.map +1 -0
  152. package/dist/core/extensions/builtin/claude-sdk-oauth/session-stream.js +192 -0
  153. package/dist/core/extensions/builtin/claude-sdk-oauth/session-stream.js.map +1 -0
  154. package/dist/core/extensions/builtin/claude-sdk-oauth/session-sync.d.ts +20 -0
  155. package/dist/core/extensions/builtin/claude-sdk-oauth/session-sync.d.ts.map +1 -0
  156. package/dist/core/extensions/builtin/claude-sdk-oauth/session-sync.js +132 -0
  157. package/dist/core/extensions/builtin/claude-sdk-oauth/session-sync.js.map +1 -0
  158. package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-claim.d.ts +14 -0
  159. package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-claim.d.ts.map +1 -0
  160. package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-claim.js +42 -0
  161. package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-claim.js.map +1 -0
  162. package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-types.d.ts +32 -0
  163. package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-types.d.ts.map +1 -0
  164. package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-types.js +8 -0
  165. package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-types.js.map +1 -0
  166. package/dist/core/extensions/builtin/claude-sdk-oauth/settings.d.ts +28 -0
  167. package/dist/core/extensions/builtin/claude-sdk-oauth/settings.d.ts.map +1 -0
  168. package/dist/core/extensions/builtin/claude-sdk-oauth/settings.js +107 -0
  169. package/dist/core/extensions/builtin/claude-sdk-oauth/settings.js.map +1 -0
  170. package/dist/core/extensions/builtin/claude-sdk-oauth/stream-events.d.ts +16 -0
  171. package/dist/core/extensions/builtin/claude-sdk-oauth/stream-events.d.ts.map +1 -0
  172. package/dist/core/extensions/builtin/claude-sdk-oauth/stream-events.js +92 -0
  173. package/dist/core/extensions/builtin/claude-sdk-oauth/stream-events.js.map +1 -0
  174. package/dist/core/extensions/builtin/claude-sdk-oauth/stream-guidance.d.ts +2 -0
  175. package/dist/core/extensions/builtin/claude-sdk-oauth/stream-guidance.d.ts.map +1 -0
  176. package/dist/core/extensions/builtin/claude-sdk-oauth/stream-guidance.js +10 -0
  177. package/dist/core/extensions/builtin/claude-sdk-oauth/stream-guidance.js.map +1 -0
  178. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/stream-protocol.d.ts.map +1 -1
  179. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/stream-protocol.js.map +1 -1
  180. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/stream.d.ts +1 -1
  181. package/dist/core/extensions/builtin/claude-sdk-oauth/stream.d.ts.map +1 -0
  182. package/dist/core/extensions/builtin/claude-sdk-oauth/stream.js +208 -0
  183. package/dist/core/extensions/builtin/claude-sdk-oauth/stream.js.map +1 -0
  184. package/dist/core/extensions/builtin/claude-sdk-oauth/system-prompt.d.ts +3 -0
  185. package/dist/core/extensions/builtin/claude-sdk-oauth/system-prompt.d.ts.map +1 -0
  186. package/dist/core/extensions/builtin/claude-sdk-oauth/system-prompt.js +25 -0
  187. package/dist/core/extensions/builtin/claude-sdk-oauth/system-prompt.js.map +1 -0
  188. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/tool-watch.d.ts +1 -1
  189. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/tool-watch.d.ts.map +1 -1
  190. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/tool-watch.js +2 -2
  191. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/tool-watch.js.map +1 -1
  192. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/tools.d.ts +1 -0
  193. package/dist/core/extensions/builtin/claude-sdk-oauth/tools.d.ts.map +1 -0
  194. package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/tools.js +1 -0
  195. package/dist/core/extensions/builtin/claude-sdk-oauth/tools.js.map +1 -0
  196. package/dist/core/extensions/builtin/compaction/checkpoint-state.d.ts +18 -1
  197. package/dist/core/extensions/builtin/compaction/checkpoint-state.d.ts.map +1 -1
  198. package/dist/core/extensions/builtin/compaction/checkpoint-state.js +32 -0
  199. package/dist/core/extensions/builtin/compaction/checkpoint-state.js.map +1 -1
  200. package/dist/core/extensions/builtin/compaction/deterministic-fallback.d.ts +18 -0
  201. package/dist/core/extensions/builtin/compaction/deterministic-fallback.d.ts.map +1 -0
  202. package/dist/core/extensions/builtin/compaction/deterministic-fallback.js +73 -0
  203. package/dist/core/extensions/builtin/compaction/deterministic-fallback.js.map +1 -0
  204. package/dist/core/extensions/builtin/compaction/idle-retry.d.ts +21 -0
  205. package/dist/core/extensions/builtin/compaction/idle-retry.d.ts.map +1 -0
  206. package/dist/core/extensions/builtin/compaction/idle-retry.js +24 -0
  207. package/dist/core/extensions/builtin/compaction/idle-retry.js.map +1 -0
  208. package/dist/core/extensions/builtin/compaction/index.d.ts.map +1 -1
  209. package/dist/core/extensions/builtin/compaction/index.js +119 -15
  210. package/dist/core/extensions/builtin/compaction/index.js.map +1 -1
  211. package/dist/core/extensions/builtin/compaction/lane-policy.d.ts +71 -0
  212. package/dist/core/extensions/builtin/compaction/lane-policy.d.ts.map +1 -0
  213. package/dist/core/extensions/builtin/compaction/lane-policy.js +94 -0
  214. package/dist/core/extensions/builtin/compaction/lane-policy.js.map +1 -0
  215. package/dist/core/extensions/builtin/compaction/log.d.ts.map +1 -1
  216. package/dist/core/extensions/builtin/compaction/log.js +1 -0
  217. package/dist/core/extensions/builtin/compaction/log.js.map +1 -1
  218. package/dist/core/extensions/builtin/compaction/overflow-retry.d.ts +59 -0
  219. package/dist/core/extensions/builtin/compaction/overflow-retry.d.ts.map +1 -0
  220. package/dist/core/extensions/builtin/compaction/overflow-retry.js +155 -0
  221. package/dist/core/extensions/builtin/compaction/overflow-retry.js.map +1 -0
  222. package/dist/core/extensions/builtin/compaction/speculative.d.ts +4 -1
  223. package/dist/core/extensions/builtin/compaction/speculative.d.ts.map +1 -1
  224. package/dist/core/extensions/builtin/compaction/speculative.js +39 -115
  225. package/dist/core/extensions/builtin/compaction/speculative.js.map +1 -1
  226. package/dist/core/extensions/builtin/compaction/task-intent.d.ts +2 -6
  227. package/dist/core/extensions/builtin/compaction/task-intent.d.ts.map +1 -1
  228. package/dist/core/extensions/builtin/compaction/task-intent.js +10 -9
  229. package/dist/core/extensions/builtin/compaction/task-intent.js.map +1 -1
  230. package/dist/core/extensions/builtin/compaction/transient-failure.d.ts.map +1 -1
  231. package/dist/core/extensions/builtin/compaction/transient-failure.js +3 -0
  232. package/dist/core/extensions/builtin/compaction/transient-failure.js.map +1 -1
  233. package/dist/core/extensions/builtin/goal/continuation-recovery.d.ts +6 -0
  234. package/dist/core/extensions/builtin/goal/continuation-recovery.d.ts.map +1 -0
  235. package/dist/core/extensions/builtin/goal/continuation-recovery.js +20 -0
  236. package/dist/core/extensions/builtin/goal/continuation-recovery.js.map +1 -0
  237. package/dist/core/extensions/builtin/goal/continuation.d.ts +1 -2
  238. package/dist/core/extensions/builtin/goal/continuation.d.ts.map +1 -1
  239. package/dist/core/extensions/builtin/goal/continuation.js +1 -6
  240. package/dist/core/extensions/builtin/goal/continuation.js.map +1 -1
  241. package/dist/core/extensions/builtin/goal/direct-input-lifecycle.d.ts +19 -0
  242. package/dist/core/extensions/builtin/goal/direct-input-lifecycle.d.ts.map +1 -0
  243. package/dist/core/extensions/builtin/goal/direct-input-lifecycle.js +48 -0
  244. package/dist/core/extensions/builtin/goal/direct-input-lifecycle.js.map +1 -0
  245. package/dist/core/extensions/builtin/goal/index.d.ts.map +1 -1
  246. package/dist/core/extensions/builtin/goal/index.js +30 -15
  247. package/dist/core/extensions/builtin/goal/index.js.map +1 -1
  248. package/dist/core/extensions/builtin/goal/lifecycle-helpers.d.ts.map +1 -1
  249. package/dist/core/extensions/builtin/goal/lifecycle-helpers.js +12 -10
  250. package/dist/core/extensions/builtin/goal/lifecycle-helpers.js.map +1 -1
  251. package/dist/core/extensions/builtin/goal/monitor-continuation.d.ts +7 -2
  252. package/dist/core/extensions/builtin/goal/monitor-continuation.d.ts.map +1 -1
  253. package/dist/core/extensions/builtin/goal/monitor-continuation.js +96 -11
  254. package/dist/core/extensions/builtin/goal/monitor-continuation.js.map +1 -1
  255. package/dist/core/extensions/builtin/goal/persistence.d.ts +16 -0
  256. package/dist/core/extensions/builtin/goal/persistence.d.ts.map +1 -1
  257. package/dist/core/extensions/builtin/goal/persistence.js +185 -11
  258. package/dist/core/extensions/builtin/goal/persistence.js.map +1 -1
  259. package/dist/core/extensions/builtin/goal/ui.d.ts +1 -0
  260. package/dist/core/extensions/builtin/goal/ui.d.ts.map +1 -1
  261. package/dist/core/extensions/builtin/goal/ui.js +11 -2
  262. package/dist/core/extensions/builtin/goal/ui.js.map +1 -1
  263. package/dist/core/extensions/builtin/goal/wait-progress.d.ts +11 -0
  264. package/dist/core/extensions/builtin/goal/wait-progress.d.ts.map +1 -0
  265. package/dist/core/extensions/builtin/goal/wait-progress.js +30 -0
  266. package/dist/core/extensions/builtin/goal/wait-progress.js.map +1 -0
  267. package/dist/core/extensions/builtin/goal/wait-ticker.d.ts +38 -0
  268. package/dist/core/extensions/builtin/goal/wait-ticker.d.ts.map +1 -0
  269. package/dist/core/extensions/builtin/goal/wait-ticker.js +71 -0
  270. package/dist/core/extensions/builtin/goal/wait-ticker.js.map +1 -0
  271. package/dist/core/extensions/builtin/gpt-apply-patch/apply.d.ts +1 -0
  272. package/dist/core/extensions/builtin/gpt-apply-patch/apply.d.ts.map +1 -1
  273. package/dist/core/extensions/builtin/gpt-apply-patch/apply.js +13 -1
  274. package/dist/core/extensions/builtin/gpt-apply-patch/apply.js.map +1 -1
  275. package/dist/core/extensions/builtin/gpt-apply-patch/extension.d.ts.map +1 -1
  276. package/dist/core/extensions/builtin/gpt-apply-patch/extension.js +15 -0
  277. package/dist/core/extensions/builtin/gpt-apply-patch/extension.js.map +1 -1
  278. package/dist/core/extensions/builtin/gpt-apply-patch/index.d.ts +1 -1
  279. package/dist/core/extensions/builtin/gpt-apply-patch/index.d.ts.map +1 -1
  280. package/dist/core/extensions/builtin/gpt-apply-patch/index.js +1 -1
  281. package/dist/core/extensions/builtin/gpt-apply-patch/index.js.map +1 -1
  282. package/dist/core/extensions/builtin/gpt-apply-patch/tool.d.ts +1 -0
  283. package/dist/core/extensions/builtin/gpt-apply-patch/tool.d.ts.map +1 -1
  284. package/dist/core/extensions/builtin/gpt-apply-patch/tool.js +53 -8
  285. package/dist/core/extensions/builtin/gpt-apply-patch/tool.js.map +1 -1
  286. package/dist/core/extensions/builtin/index.d.ts.map +1 -1
  287. package/dist/core/extensions/builtin/index.js +5 -2
  288. package/dist/core/extensions/builtin/index.js.map +1 -1
  289. package/dist/core/extensions/builtin/loop-guard/detectors.d.ts +31 -0
  290. package/dist/core/extensions/builtin/loop-guard/detectors.d.ts.map +1 -0
  291. package/dist/core/extensions/builtin/loop-guard/detectors.js +152 -0
  292. package/dist/core/extensions/builtin/loop-guard/detectors.js.map +1 -0
  293. package/dist/core/extensions/builtin/loop-guard/index.d.ts +3 -0
  294. package/dist/core/extensions/builtin/loop-guard/index.d.ts.map +1 -0
  295. package/dist/core/extensions/builtin/loop-guard/index.js +31 -0
  296. package/dist/core/extensions/builtin/loop-guard/index.js.map +1 -0
  297. package/dist/core/extensions/builtin/loop-guard/notice.d.ts +5 -0
  298. package/dist/core/extensions/builtin/loop-guard/notice.d.ts.map +1 -0
  299. package/dist/core/extensions/builtin/loop-guard/notice.js +42 -0
  300. package/dist/core/extensions/builtin/loop-guard/notice.js.map +1 -0
  301. package/dist/core/extensions/builtin/loop-guard/policy.d.ts +30 -0
  302. package/dist/core/extensions/builtin/loop-guard/policy.d.ts.map +1 -0
  303. package/dist/core/extensions/builtin/loop-guard/policy.js +30 -0
  304. package/dist/core/extensions/builtin/loop-guard/policy.js.map +1 -0
  305. package/dist/core/extensions/builtin/loop-guard/renderer.d.ts +4 -0
  306. package/dist/core/extensions/builtin/loop-guard/renderer.d.ts.map +1 -0
  307. package/dist/core/extensions/builtin/loop-guard/renderer.js +50 -0
  308. package/dist/core/extensions/builtin/loop-guard/renderer.js.map +1 -0
  309. package/dist/core/extensions/builtin/loop-guard/similarity.d.ts +13 -0
  310. package/dist/core/extensions/builtin/loop-guard/similarity.d.ts.map +1 -0
  311. package/dist/core/extensions/builtin/loop-guard/similarity.js +51 -0
  312. package/dist/core/extensions/builtin/loop-guard/similarity.js.map +1 -0
  313. package/dist/core/extensions/builtin/loop-guard/tracker.d.ts +13 -0
  314. package/dist/core/extensions/builtin/loop-guard/tracker.d.ts.map +1 -0
  315. package/dist/core/extensions/builtin/loop-guard/tracker.js +39 -0
  316. package/dist/core/extensions/builtin/loop-guard/tracker.js.map +1 -0
  317. package/dist/core/extensions/builtin/mcp/health.d.ts.map +1 -1
  318. package/dist/core/extensions/builtin/mcp/health.js +2 -1
  319. package/dist/core/extensions/builtin/mcp/health.js.map +1 -1
  320. package/dist/core/extensions/builtin/monitor-state-event.d.ts +10 -0
  321. package/dist/core/extensions/builtin/monitor-state-event.d.ts.map +1 -1
  322. package/dist/core/extensions/builtin/monitor-state-event.js.map +1 -1
  323. package/dist/core/extensions/builtin/prompt-preset/deepseek-v4-flash-0731.d.ts +3 -0
  324. package/dist/core/extensions/builtin/prompt-preset/deepseek-v4-flash-0731.d.ts.map +1 -0
  325. package/dist/core/extensions/builtin/prompt-preset/deepseek-v4-flash-0731.js +10 -0
  326. package/dist/core/extensions/builtin/prompt-preset/deepseek-v4-flash-0731.js.map +1 -0
  327. package/dist/core/extensions/builtin/prompt-preset/deepseek-v4-flash.d.ts +3 -0
  328. package/dist/core/extensions/builtin/prompt-preset/deepseek-v4-flash.d.ts.map +1 -0
  329. package/dist/core/extensions/builtin/prompt-preset/deepseek-v4-flash.js +10 -0
  330. package/dist/core/extensions/builtin/prompt-preset/deepseek-v4-flash.js.map +1 -0
  331. package/dist/core/extensions/builtin/prompt-preset/deepseek-v4-pro.d.ts +3 -0
  332. package/dist/core/extensions/builtin/prompt-preset/deepseek-v4-pro.d.ts.map +1 -0
  333. package/dist/core/extensions/builtin/prompt-preset/deepseek-v4-pro.js +11 -0
  334. package/dist/core/extensions/builtin/prompt-preset/deepseek-v4-pro.js.map +1 -0
  335. package/dist/core/extensions/builtin/prompt-preset/deepseek-v4.d.ts +13 -0
  336. package/dist/core/extensions/builtin/prompt-preset/deepseek-v4.d.ts.map +1 -0
  337. package/dist/core/extensions/builtin/prompt-preset/deepseek-v4.js +60 -0
  338. package/dist/core/extensions/builtin/prompt-preset/deepseek-v4.js.map +1 -0
  339. package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.d.ts +1 -1
  340. package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.d.ts.map +1 -1
  341. package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js +5 -3
  342. package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js.map +1 -1
  343. package/dist/core/extensions/builtin/prompt-preset/index.d.ts.map +1 -1
  344. package/dist/core/extensions/builtin/prompt-preset/index.js +8 -4
  345. package/dist/core/extensions/builtin/prompt-preset/index.js.map +1 -1
  346. package/dist/core/extensions/builtin/prompt-preset/kimi-k3.d.ts.map +1 -1
  347. package/dist/core/extensions/builtin/prompt-preset/kimi-k3.js +8 -1
  348. package/dist/core/extensions/builtin/prompt-preset/kimi-k3.js.map +1 -1
  349. package/dist/core/extensions/builtin/prompt-preset/presets.d.ts.map +1 -1
  350. package/dist/core/extensions/builtin/prompt-preset/presets.js +42 -0
  351. package/dist/core/extensions/builtin/prompt-preset/presets.js.map +1 -1
  352. package/dist/core/extensions/builtin/prompt-preset/settings.d.ts +1 -1
  353. package/dist/core/extensions/builtin/prompt-preset/settings.d.ts.map +1 -1
  354. package/dist/core/extensions/builtin/prompt-preset/settings.js +3 -0
  355. package/dist/core/extensions/builtin/prompt-preset/settings.js.map +1 -1
  356. package/dist/core/extensions/builtin/recommended-models/index.d.ts.map +1 -1
  357. package/dist/core/extensions/builtin/recommended-models/index.js +2 -1
  358. package/dist/core/extensions/builtin/recommended-models/index.js.map +1 -1
  359. package/dist/core/extensions/builtin/rules/config.d.ts +3 -0
  360. package/dist/core/extensions/builtin/rules/config.d.ts.map +1 -0
  361. package/dist/core/extensions/builtin/rules/config.js +24 -0
  362. package/dist/core/extensions/builtin/rules/config.js.map +1 -0
  363. package/dist/core/extensions/builtin/rules/index.d.ts.map +1 -1
  364. package/dist/core/extensions/builtin/rules/index.js +9 -6
  365. package/dist/core/extensions/builtin/rules/index.js.map +1 -1
  366. package/dist/core/extensions/builtin/rules/rules/constants.d.ts +11 -0
  367. package/dist/core/extensions/builtin/rules/rules/constants.d.ts.map +1 -1
  368. package/dist/core/extensions/builtin/rules/rules/constants.js +11 -0
  369. package/dist/core/extensions/builtin/rules/rules/constants.js.map +1 -1
  370. package/dist/core/extensions/builtin/rules/rules/formatter.d.ts.map +1 -1
  371. package/dist/core/extensions/builtin/rules/rules/formatter.js +33 -3
  372. package/dist/core/extensions/builtin/rules/rules/formatter.js.map +1 -1
  373. package/dist/core/extensions/builtin/rules/rules/types.d.ts +1 -1
  374. package/dist/core/extensions/builtin/rules/rules/types.js.map +1 -1
  375. package/dist/core/extensions/builtin/service-tier.d.ts.map +1 -1
  376. package/dist/core/extensions/builtin/service-tier.js +25 -24
  377. package/dist/core/extensions/builtin/service-tier.js.map +1 -1
  378. package/dist/core/extensions/builtin/terminal/extension.d.ts.map +1 -1
  379. package/dist/core/extensions/builtin/terminal/extension.js +21 -7
  380. package/dist/core/extensions/builtin/terminal/extension.js.map +1 -1
  381. package/dist/core/extensions/builtin/terminal/monitor-notify.d.ts.map +1 -1
  382. package/dist/core/extensions/builtin/terminal/monitor-notify.js +42 -5
  383. package/dist/core/extensions/builtin/terminal/monitor-notify.js.map +1 -1
  384. package/dist/core/extensions/builtin/terminal/monitor-registry.d.ts +2 -0
  385. package/dist/core/extensions/builtin/terminal/monitor-registry.d.ts.map +1 -1
  386. package/dist/core/extensions/builtin/terminal/monitor-registry.js +2 -0
  387. package/dist/core/extensions/builtin/terminal/monitor-registry.js.map +1 -1
  388. package/dist/core/extensions/builtin/terminal/monitor-status-ticker.d.ts +37 -0
  389. package/dist/core/extensions/builtin/terminal/monitor-status-ticker.d.ts.map +1 -0
  390. package/dist/core/extensions/builtin/terminal/monitor-status-ticker.js +61 -0
  391. package/dist/core/extensions/builtin/terminal/monitor-status-ticker.js.map +1 -0
  392. package/dist/core/extensions/builtin/terminal/monitor-status.d.ts +9 -1
  393. package/dist/core/extensions/builtin/terminal/monitor-status.d.ts.map +1 -1
  394. package/dist/core/extensions/builtin/terminal/monitor-status.js +35 -2
  395. package/dist/core/extensions/builtin/terminal/monitor-status.js.map +1 -1
  396. package/dist/core/extensions/builtin/terminal/tools/context.d.ts +1 -1
  397. package/dist/core/extensions/builtin/terminal/tools/context.d.ts.map +1 -1
  398. package/dist/core/extensions/builtin/terminal/tools/context.js.map +1 -1
  399. package/dist/core/extensions/builtin/terminal/tools/monitor.d.ts.map +1 -1
  400. package/dist/core/extensions/builtin/terminal/tools/monitor.js +2 -1
  401. package/dist/core/extensions/builtin/terminal/tools/monitor.js.map +1 -1
  402. package/dist/core/extensions/builtin/todotools/commands.d.ts +2 -2
  403. package/dist/core/extensions/builtin/todotools/commands.d.ts.map +1 -1
  404. package/dist/core/extensions/builtin/todotools/commands.js.map +1 -1
  405. package/dist/core/extensions/builtin/todotools/index.d.ts.map +1 -1
  406. package/dist/core/extensions/builtin/todotools/index.js +6 -3
  407. package/dist/core/extensions/builtin/todotools/index.js.map +1 -1
  408. package/dist/core/extensions/builtin/todotools/state.d.ts +1 -1
  409. package/dist/core/extensions/builtin/todotools/state.d.ts.map +1 -1
  410. package/dist/core/extensions/builtin/todotools/state.js +1 -1
  411. package/dist/core/extensions/builtin/todotools/state.js.map +1 -1
  412. package/dist/core/extensions/builtin/todotools/todo-widget-component.d.ts +19 -0
  413. package/dist/core/extensions/builtin/todotools/todo-widget-component.d.ts.map +1 -0
  414. package/dist/core/extensions/builtin/todotools/todo-widget-component.js +78 -0
  415. package/dist/core/extensions/builtin/todotools/todo-widget-component.js.map +1 -0
  416. package/dist/core/extensions/builtin/todotools/todo-widget.d.ts +13 -1
  417. package/dist/core/extensions/builtin/todotools/todo-widget.d.ts.map +1 -1
  418. package/dist/core/extensions/builtin/todotools/todo-widget.js +32 -14
  419. package/dist/core/extensions/builtin/todotools/todo-widget.js.map +1 -1
  420. package/dist/core/extensions/builtin/todotools/tools/todo.d.ts +2 -2
  421. package/dist/core/extensions/builtin/todotools/tools/todo.d.ts.map +1 -1
  422. package/dist/core/extensions/builtin/todotools/tools/todo.js +1 -1
  423. package/dist/core/extensions/builtin/todotools/tools/todo.js.map +1 -1
  424. package/dist/core/extensions/builtin/tool-pair-guard/index.d.ts.map +1 -1
  425. package/dist/core/extensions/builtin/tool-pair-guard/index.js +1 -1
  426. package/dist/core/extensions/builtin/tool-pair-guard/index.js.map +1 -1
  427. package/dist/core/extensions/builtin/tps.d.ts.map +1 -1
  428. package/dist/core/extensions/builtin/tps.js +5 -2
  429. package/dist/core/extensions/builtin/tps.js.map +1 -1
  430. package/dist/core/extensions/builtin/ttsr/builtin-rules.d.ts +4 -0
  431. package/dist/core/extensions/builtin/ttsr/builtin-rules.d.ts.map +1 -0
  432. package/dist/core/extensions/builtin/ttsr/builtin-rules.js +20 -0
  433. package/dist/core/extensions/builtin/ttsr/builtin-rules.js.map +1 -0
  434. package/dist/core/extensions/builtin/ttsr/commands.js +9 -1
  435. package/dist/core/extensions/builtin/ttsr/commands.js.map +1 -1
  436. package/dist/core/extensions/builtin/ttsr/index.d.ts.map +1 -1
  437. package/dist/core/extensions/builtin/ttsr/index.js +4 -3
  438. package/dist/core/extensions/builtin/ttsr/index.js.map +1 -1
  439. package/dist/core/extensions/builtin/ttsr/manager.js +1 -1
  440. package/dist/core/extensions/builtin/ttsr/manager.js.map +1 -1
  441. package/dist/core/extensions/builtin/websearch/websearch/config.d.ts.map +1 -1
  442. package/dist/core/extensions/builtin/websearch/websearch/config.js +1 -0
  443. package/dist/core/extensions/builtin/websearch/websearch/config.js.map +1 -1
  444. package/dist/core/extensions/builtin/websearch/websearch/native.d.ts.map +1 -1
  445. package/dist/core/extensions/builtin/websearch/websearch/native.js +16 -5
  446. package/dist/core/extensions/builtin/websearch/websearch/native.js.map +1 -1
  447. package/dist/core/extensions/builtin/websearch/websearch/provider-endpoints.d.ts.map +1 -1
  448. package/dist/core/extensions/builtin/websearch/websearch/provider-endpoints.js +1 -0
  449. package/dist/core/extensions/builtin/websearch/websearch/provider-endpoints.js.map +1 -1
  450. package/dist/core/extensions/builtin/websearch/websearch/providers/anthropic.d.ts +4 -1
  451. package/dist/core/extensions/builtin/websearch/websearch/providers/anthropic.d.ts.map +1 -1
  452. package/dist/core/extensions/builtin/websearch/websearch/providers/anthropic.js +44 -37
  453. package/dist/core/extensions/builtin/websearch/websearch/providers/anthropic.js.map +1 -1
  454. package/dist/core/extensions/builtin/websearch/websearch/providers/deepseek.d.ts +3 -0
  455. package/dist/core/extensions/builtin/websearch/websearch/providers/deepseek.d.ts.map +1 -0
  456. package/dist/core/extensions/builtin/websearch/websearch/providers/deepseek.js +12 -0
  457. package/dist/core/extensions/builtin/websearch/websearch/providers/deepseek.js.map +1 -0
  458. package/dist/core/extensions/builtin/websearch/websearch/providers.d.ts.map +1 -1
  459. package/dist/core/extensions/builtin/websearch/websearch/providers.js +2 -0
  460. package/dist/core/extensions/builtin/websearch/websearch/providers.js.map +1 -1
  461. package/dist/core/extensions/builtin/websearch/websearch/renderers.d.ts.map +1 -1
  462. package/dist/core/extensions/builtin/websearch/websearch/renderers.js +3 -3
  463. package/dist/core/extensions/builtin/websearch/websearch/renderers.js.map +1 -1
  464. package/dist/core/extensions/builtin/websearch/websearch/search.d.ts.map +1 -1
  465. package/dist/core/extensions/builtin/websearch/websearch/search.js +1 -3
  466. package/dist/core/extensions/builtin/websearch/websearch/search.js.map +1 -1
  467. package/dist/core/extensions/builtin/websearch/websearch/tool.js +2 -2
  468. package/dist/core/extensions/builtin/websearch/websearch/tool.js.map +1 -1
  469. package/dist/core/extensions/builtin/websearch/websearch/types.d.ts +1 -1
  470. package/dist/core/extensions/builtin/websearch/websearch/types.d.ts.map +1 -1
  471. package/dist/core/extensions/builtin/websearch/websearch/types.js.map +1 -1
  472. package/dist/core/extensions/index.d.ts +1 -1
  473. package/dist/core/extensions/index.d.ts.map +1 -1
  474. package/dist/core/extensions/index.js.map +1 -1
  475. package/dist/core/extensions/loader.d.ts.map +1 -1
  476. package/dist/core/extensions/loader.js +19 -18
  477. package/dist/core/extensions/loader.js.map +1 -1
  478. package/dist/core/extensions/runner.d.ts +5 -2
  479. package/dist/core/extensions/runner.d.ts.map +1 -1
  480. package/dist/core/extensions/runner.js +21 -1
  481. package/dist/core/extensions/runner.js.map +1 -1
  482. package/dist/core/extensions/types.d.ts +38 -2
  483. package/dist/core/extensions/types.d.ts.map +1 -1
  484. package/dist/core/extensions/types.js.map +1 -1
  485. package/dist/core/footer-data-provider.d.ts +10 -0
  486. package/dist/core/footer-data-provider.d.ts.map +1 -1
  487. package/dist/core/footer-data-provider.js +1 -1
  488. package/dist/core/footer-data-provider.js.map +1 -1
  489. package/dist/core/keybindings.d.ts +24 -0
  490. package/dist/core/keybindings.d.ts.map +1 -1
  491. package/dist/core/model-registry.d.ts +2 -1
  492. package/dist/core/model-registry.d.ts.map +1 -1
  493. package/dist/core/model-registry.js +3 -0
  494. package/dist/core/model-registry.js.map +1 -1
  495. package/dist/core/model-resolver.d.ts.map +1 -1
  496. package/dist/core/model-resolver.js +3 -2
  497. package/dist/core/model-resolver.js.map +1 -1
  498. package/dist/core/model-runtime.d.ts +2 -0
  499. package/dist/core/model-runtime.d.ts.map +1 -1
  500. package/dist/core/model-runtime.js +2 -2
  501. package/dist/core/model-runtime.js.map +1 -1
  502. package/dist/core/package-manager.d.ts +0 -1
  503. package/dist/core/package-manager.d.ts.map +1 -1
  504. package/dist/core/package-manager.js +18 -34
  505. package/dist/core/package-manager.js.map +1 -1
  506. package/dist/core/pi-manifest.d.ts +9 -0
  507. package/dist/core/pi-manifest.d.ts.map +1 -0
  508. package/dist/core/pi-manifest.js +25 -0
  509. package/dist/core/pi-manifest.js.map +1 -0
  510. package/dist/core/provider-composer.d.ts.map +1 -1
  511. package/dist/core/provider-composer.js +8 -3
  512. package/dist/core/provider-composer.js.map +1 -1
  513. package/dist/core/provider-display-names.d.ts.map +1 -1
  514. package/dist/core/provider-display-names.js +1 -0
  515. package/dist/core/provider-display-names.js.map +1 -1
  516. package/dist/core/resource-loader.d.ts +15 -0
  517. package/dist/core/resource-loader.d.ts.map +1 -1
  518. package/dist/core/resource-loader.js +55 -6
  519. package/dist/core/resource-loader.js.map +1 -1
  520. package/dist/core/retry-fallback/hint-policy.d.ts +29 -0
  521. package/dist/core/retry-fallback/hint-policy.d.ts.map +1 -0
  522. package/dist/core/retry-fallback/hint-policy.js +54 -0
  523. package/dist/core/retry-fallback/hint-policy.js.map +1 -0
  524. package/dist/core/retry-fallback/probe-scheduler.d.ts +60 -0
  525. package/dist/core/retry-fallback/probe-scheduler.d.ts.map +1 -0
  526. package/dist/core/retry-fallback/probe-scheduler.js +206 -0
  527. package/dist/core/retry-fallback/probe-scheduler.js.map +1 -0
  528. package/dist/core/retry-fallback/settings.d.ts +9 -0
  529. package/dist/core/retry-fallback/settings.d.ts.map +1 -1
  530. package/dist/core/retry-fallback/settings.js +14 -0
  531. package/dist/core/retry-fallback/settings.js.map +1 -1
  532. package/dist/core/session-log.js +1 -1
  533. package/dist/core/session-log.js.map +1 -1
  534. package/dist/core/settings-manager.d.ts +10 -1
  535. package/dist/core/settings-manager.d.ts.map +1 -1
  536. package/dist/core/settings-manager.js +21 -1
  537. package/dist/core/settings-manager.js.map +1 -1
  538. package/dist/core/thinking-levels.d.ts +5 -0
  539. package/dist/core/thinking-levels.d.ts.map +1 -1
  540. package/dist/core/thinking-levels.js +9 -39
  541. package/dist/core/thinking-levels.js.map +1 -1
  542. package/dist/extensions/llama/provider.js +1 -1
  543. package/dist/extensions/llama/provider.js.map +1 -1
  544. package/dist/index.d.ts +2 -2
  545. package/dist/index.d.ts.map +1 -1
  546. package/dist/index.js.map +1 -1
  547. package/dist/main.d.ts.map +1 -1
  548. package/dist/main.js +44 -0
  549. package/dist/main.js.map +1 -1
  550. package/dist/modes/app-server/server/account.d.ts +1 -1
  551. package/dist/modes/app-server/server/account.js +1 -1
  552. package/dist/modes/app-server/server/account.js.map +1 -1
  553. package/dist/modes/app-server/server/server-core.js +1 -1
  554. package/dist/modes/app-server/server/server-core.js.map +1 -1
  555. package/dist/modes/interactive/compaction-queue-transfer.d.ts +2 -0
  556. package/dist/modes/interactive/compaction-queue-transfer.d.ts.map +1 -1
  557. package/dist/modes/interactive/compaction-queue-transfer.js.map +1 -1
  558. package/dist/modes/interactive/components/assistant-message.d.ts +5 -2
  559. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  560. package/dist/modes/interactive/components/assistant-message.js +16 -4
  561. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  562. package/dist/modes/interactive/components/continuity-notice.d.ts +21 -0
  563. package/dist/modes/interactive/components/continuity-notice.d.ts.map +1 -0
  564. package/dist/modes/interactive/components/continuity-notice.js +58 -0
  565. package/dist/modes/interactive/components/continuity-notice.js.map +1 -0
  566. package/dist/modes/interactive/components/custom-editor.d.ts +5 -0
  567. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
  568. package/dist/modes/interactive/components/custom-editor.js +22 -1
  569. package/dist/modes/interactive/components/custom-editor.js.map +1 -1
  570. package/dist/modes/interactive/components/footer.d.ts.map +1 -1
  571. package/dist/modes/interactive/components/footer.js +9 -5
  572. package/dist/modes/interactive/components/footer.js.map +1 -1
  573. package/dist/modes/interactive/components/markdown-transform.d.ts +3 -0
  574. package/dist/modes/interactive/components/markdown-transform.d.ts.map +1 -0
  575. package/dist/modes/interactive/components/markdown-transform.js +19 -0
  576. package/dist/modes/interactive/components/markdown-transform.js.map +1 -0
  577. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  578. package/dist/modes/interactive/components/model-selector.js +4 -1
  579. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  580. package/dist/modes/interactive/components/settings-selector.d.ts +6 -2
  581. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  582. package/dist/modes/interactive/components/settings-selector.js +20 -0
  583. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  584. package/dist/modes/interactive/components/user-message.d.ts +3 -1
  585. package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
  586. package/dist/modes/interactive/components/user-message.js +8 -2
  587. package/dist/modes/interactive/components/user-message.js.map +1 -1
  588. package/dist/modes/interactive/help-content.d.ts.map +1 -1
  589. package/dist/modes/interactive/help-content.js +1 -0
  590. package/dist/modes/interactive/help-content.js.map +1 -1
  591. package/dist/modes/interactive/interactive-mode.d.ts +21 -0
  592. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  593. package/dist/modes/interactive/interactive-mode.js +189 -62
  594. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  595. package/dist/modes/interactive/risky-main-model-warning.d.ts +1 -1
  596. package/dist/modes/interactive/risky-main-model-warning.d.ts.map +1 -1
  597. package/dist/modes/interactive/risky-main-model-warning.js +1 -1
  598. package/dist/modes/interactive/risky-main-model-warning.js.map +1 -1
  599. package/dist/modes/interactive/theme/dark.json +1 -0
  600. package/dist/modes/interactive/theme/grok-day.json +1 -0
  601. package/dist/modes/interactive/theme/grok-night.json +1 -0
  602. package/dist/modes/interactive/theme/light.json +1 -0
  603. package/dist/modes/interactive/theme/theme-schema.json +5 -1
  604. package/dist/modes/interactive/theme/theme.d.ts +2 -2
  605. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  606. package/dist/modes/interactive/theme/theme.js +13 -3
  607. package/dist/modes/interactive/theme/theme.js.map +1 -1
  608. package/dist/modes/rpc/connection-handler.d.ts.map +1 -1
  609. package/dist/modes/rpc/connection-handler.js +16 -3
  610. package/dist/modes/rpc/connection-handler.js.map +1 -1
  611. package/dist/utils/clipboard.d.ts +1 -1
  612. package/dist/utils/clipboard.d.ts.map +1 -1
  613. package/dist/utils/clipboard.js +22 -2
  614. package/dist/utils/clipboard.js.map +1 -1
  615. package/docs/AGENTS.md +1 -6
  616. package/docs/custom-provider.md +10 -3
  617. package/docs/development.md +1 -2
  618. package/docs/extensions.md +34 -1
  619. package/docs/keybindings.md +13 -0
  620. package/docs/mcp.md +63 -4
  621. package/docs/models.md +1 -0
  622. package/docs/providers.md +60 -5
  623. package/docs/release-guide.md +7 -5
  624. package/docs/session-format.md +2 -0
  625. package/docs/settings.md +3 -1
  626. package/docs/skills.md +29 -0
  627. package/docs/themes.md +5 -3
  628. package/docs/usage.md +5 -0
  629. package/examples/extensions/custom-compaction.ts +1 -2
  630. package/examples/extensions/custom-provider-anthropic/index.ts +8 -2
  631. package/examples/extensions/doom-overlay/wad-finder.ts +7 -3
  632. package/examples/extensions/handoff.ts +2 -3
  633. package/examples/extensions/overlay-test.ts +1 -1
  634. package/examples/extensions/qna.ts +2 -2
  635. package/examples/rpc-extension-ui.ts +11 -2
  636. package/examples/sdk/02-custom-model.ts +1 -2
  637. package/examples/sdk/12-full-control.ts +2 -0
  638. package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +69 -0
  639. package/node_modules/@code-yeongyu/senpi-codemode/README.md +6 -3
  640. package/node_modules/@code-yeongyu/senpi-codemode/package.json +4 -4
  641. package/node_modules/@code-yeongyu/senpi-codemode/src/extension/eval-status-ticker.ts +79 -0
  642. package/node_modules/@code-yeongyu/senpi-codemode/src/extension/eval-status.ts +36 -3
  643. package/node_modules/@code-yeongyu/senpi-codemode/src/index.ts +26 -12
  644. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/cell-execution.ts +146 -0
  645. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/cell-handler.ts +21 -119
  646. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/cell-runtime.ts +157 -0
  647. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/detached-cell-manager.ts +62 -208
  648. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/detached-cell-notification.ts +98 -0
  649. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/detached-cell-snapshot.ts +81 -0
  650. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/detached-cell-state.ts +24 -0
  651. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/detached-eval-result.ts +140 -0
  652. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/detached-notification-queue.ts +53 -0
  653. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-request.ts +45 -0
  654. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool-options.ts +45 -0
  655. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool.ts +20 -342
  656. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
  657. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js +1 -0
  658. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js.map +1 -1
  659. package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.d.ts +14 -3
  660. package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.d.ts.map +1 -1
  661. package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.js +156 -67
  662. package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.js.map +1 -1
  663. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/array-session-reader.d.ts +3 -0
  664. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/array-session-reader.d.ts.map +1 -0
  665. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/array-session-reader.js +70 -0
  666. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/array-session-reader.js.map +1 -0
  667. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.d.ts +4 -0
  668. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.d.ts.map +1 -0
  669. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.js +22 -0
  670. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.js.map +1 -0
  671. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-store.d.ts +13 -0
  672. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-store.d.ts.map +1 -0
  673. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-store.js +304 -0
  674. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-store.js.map +1 -0
  675. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/keyed-operation-queue.d.ts +17 -0
  676. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/keyed-operation-queue.d.ts.map +1 -0
  677. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/keyed-operation-queue.js +60 -0
  678. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/keyed-operation-queue.js.map +1 -0
  679. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-store.d.ts +6 -0
  680. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-store.d.ts.map +1 -0
  681. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-store.js +107 -0
  682. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-store.js.map +1 -0
  683. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repository.d.ts +28 -0
  684. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repository.d.ts.map +1 -0
  685. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repository.js +61 -0
  686. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repository.js.map +1 -0
  687. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/search-backend.d.ts +8 -0
  688. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/search-backend.d.ts.map +1 -0
  689. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/search-backend.js +22 -0
  690. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/search-backend.js.map +1 -0
  691. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.d.ts +6 -10
  692. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.d.ts.map +1 -1
  693. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.js +154 -77
  694. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.js.map +1 -1
  695. package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.d.ts +49 -23
  696. package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.d.ts.map +1 -1
  697. package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.js.map +1 -1
  698. package/node_modules/@earendil-works/pi-agent-core/dist/index.d.ts +6 -6
  699. package/node_modules/@earendil-works/pi-agent-core/dist/index.d.ts.map +1 -1
  700. package/node_modules/@earendil-works/pi-agent-core/dist/index.js +6 -6
  701. package/node_modules/@earendil-works/pi-agent-core/dist/index.js.map +1 -1
  702. package/node_modules/@earendil-works/pi-agent-core/dist/proxy.js +1 -1
  703. package/node_modules/@earendil-works/pi-agent-core/dist/proxy.js.map +1 -1
  704. package/node_modules/@earendil-works/pi-agent-core/package.json +4 -4
  705. package/node_modules/@earendil-works/pi-ai/README.md +5 -2
  706. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.d.ts.map +1 -1
  707. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +56 -25
  708. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js.map +1 -1
  709. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-tool-pairs.d.ts +3 -0
  710. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-tool-pairs.d.ts.map +1 -0
  711. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-tool-pairs.js +134 -0
  712. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-tool-pairs.js.map +1 -0
  713. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.d.ts.map +1 -1
  714. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js +7 -3
  715. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js.map +1 -1
  716. package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.d.ts.map +1 -1
  717. package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js +64 -4
  718. package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js.map +1 -1
  719. package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.d.ts.map +1 -1
  720. package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js +12 -2
  721. package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js.map +1 -1
  722. package/node_modules/@earendil-works/pi-ai/dist/api/google-shared.d.ts.map +1 -1
  723. package/node_modules/@earendil-works/pi-ai/dist/api/google-shared.js +13 -6
  724. package/node_modules/@earendil-works/pi-ai/dist/api/google-shared.js.map +1 -1
  725. package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.d.ts.map +1 -1
  726. package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.js +12 -2
  727. package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.js.map +1 -1
  728. package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.d.ts.map +1 -1
  729. package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js +19 -10
  730. package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js.map +1 -1
  731. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses/fallback-state.d.ts +24 -0
  732. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses/fallback-state.d.ts.map +1 -0
  733. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses/fallback-state.js +70 -0
  734. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses/fallback-state.js.map +1 -0
  735. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.d.ts +2 -16
  736. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.d.ts.map +1 -1
  737. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js +94 -105
  738. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js.map +1 -1
  739. package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.d.ts.map +1 -1
  740. package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js +20 -11
  741. package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js.map +1 -1
  742. package/node_modules/@earendil-works/pi-ai/dist/api/openai-prompt-cache.d.ts +1 -0
  743. package/node_modules/@earendil-works/pi-ai/dist/api/openai-prompt-cache.d.ts.map +1 -1
  744. package/node_modules/@earendil-works/pi-ai/dist/api/openai-prompt-cache.js +7 -0
  745. package/node_modules/@earendil-works/pi-ai/dist/api/openai-prompt-cache.js.map +1 -1
  746. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.d.ts.map +1 -1
  747. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js +11 -1
  748. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js.map +1 -1
  749. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.d.ts.map +1 -1
  750. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js +9 -5
  751. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js.map +1 -1
  752. package/node_modules/@earendil-works/pi-ai/dist/api/openrouter-images.js +3 -2
  753. package/node_modules/@earendil-works/pi-ai/dist/api/openrouter-images.js.map +1 -1
  754. package/node_modules/@earendil-works/pi-ai/dist/api/pi-messages.js +2 -2
  755. package/node_modules/@earendil-works/pi-ai/dist/api/pi-messages.js.map +1 -1
  756. package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.d.ts.map +1 -1
  757. package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.js +1 -0
  758. package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.js.map +1 -1
  759. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openrouter.d.ts +3 -1
  760. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openrouter.d.ts.map +1 -1
  761. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openrouter.js +81 -26
  762. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openrouter.js.map +1 -1
  763. package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.d.ts +2 -0
  764. package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.d.ts.map +1 -1
  765. package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js +16 -8
  766. package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js.map +1 -1
  767. package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.d.ts.map +1 -1
  768. package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js +1 -0
  769. package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js.map +1 -1
  770. package/node_modules/@earendil-works/pi-ai/dist/index.d.ts +1 -0
  771. package/node_modules/@earendil-works/pi-ai/dist/index.d.ts.map +1 -1
  772. package/node_modules/@earendil-works/pi-ai/dist/index.js +1 -0
  773. package/node_modules/@earendil-works/pi-ai/dist/index.js.map +1 -1
  774. package/node_modules/@earendil-works/pi-ai/dist/model.d.ts +2 -1
  775. package/node_modules/@earendil-works/pi-ai/dist/model.d.ts.map +1 -1
  776. package/node_modules/@earendil-works/pi-ai/dist/model.js.map +1 -1
  777. package/node_modules/@earendil-works/pi-ai/dist/models.d.ts +14 -0
  778. package/node_modules/@earendil-works/pi-ai/dist/models.d.ts.map +1 -1
  779. package/node_modules/@earendil-works/pi-ai/dist/models.js +96 -20
  780. package/node_modules/@earendil-works/pi-ai/dist/models.js.map +1 -1
  781. package/node_modules/@earendil-works/pi-ai/dist/providers/all.d.ts +2 -1
  782. package/node_modules/@earendil-works/pi-ai/dist/providers/all.d.ts.map +1 -1
  783. package/node_modules/@earendil-works/pi-ai/dist/providers/all.js +3 -1
  784. package/node_modules/@earendil-works/pi-ai/dist/providers/all.js.map +1 -1
  785. package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
  786. package/node_modules/@earendil-works/pi-ai/dist/providers/data/amazon-bedrock.json +1 -1
  787. package/node_modules/@earendil-works/pi-ai/dist/providers/data/azure-openai-responses.json +1 -1
  788. package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-ai-gateway.json +1 -1
  789. package/node_modules/@earendil-works/pi-ai/dist/providers/data/fireworks.json +1 -1
  790. package/node_modules/@earendil-works/pi-ai/dist/providers/data/github-copilot.json +1 -1
  791. package/node_modules/@earendil-works/pi-ai/dist/providers/data/huggingface.json +1 -1
  792. package/node_modules/@earendil-works/pi-ai/dist/providers/data/mistral.json +1 -1
  793. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai-codex.json +1 -1
  794. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai.json +1 -1
  795. package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode-go.json +1 -1
  796. package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode.json +1 -1
  797. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
  798. package/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan-cn.json +1 -1
  799. package/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan.json +1 -1
  800. package/node_modules/@earendil-works/pi-ai/dist/providers/data/together.json +1 -1
  801. package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
  802. package/node_modules/@earendil-works/pi-ai/dist/providers/data/zai-coding-cn.json +1 -1
  803. package/node_modules/@earendil-works/pi-ai/dist/providers/data/zai.json +1 -1
  804. package/node_modules/@earendil-works/pi-ai/dist/providers/faux.d.ts.map +1 -1
  805. package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js +4 -1
  806. package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js.map +1 -1
  807. package/node_modules/@earendil-works/pi-ai/dist/providers/ollama.d.ts +9 -0
  808. package/node_modules/@earendil-works/pi-ai/dist/providers/ollama.d.ts.map +1 -0
  809. package/node_modules/@earendil-works/pi-ai/dist/providers/ollama.js +142 -0
  810. package/node_modules/@earendil-works/pi-ai/dist/providers/ollama.js.map +1 -0
  811. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.js +1 -1
  812. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.js.map +1 -1
  813. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +19 -2
  814. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
  815. package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -1
  816. package/node_modules/@earendil-works/pi-ai/dist/utils/error-body.d.ts.map +1 -1
  817. package/node_modules/@earendil-works/pi-ai/dist/utils/error-body.js +23 -4
  818. package/node_modules/@earendil-works/pi-ai/dist/utils/error-body.js.map +1 -1
  819. package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.d.ts.map +1 -1
  820. package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.js +10 -1
  821. package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.js.map +1 -1
  822. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.d.ts +3 -0
  823. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.d.ts.map +1 -1
  824. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.js +13 -12
  825. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.js.map +1 -1
  826. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-hint.d.ts +24 -0
  827. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-hint.d.ts.map +1 -0
  828. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-hint.js +233 -0
  829. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-hint.js.map +1 -0
  830. package/node_modules/@earendil-works/pi-ai/dist/utils/unavailable-tool-text.d.ts +3 -0
  831. package/node_modules/@earendil-works/pi-ai/dist/utils/unavailable-tool-text.d.ts.map +1 -0
  832. package/node_modules/@earendil-works/pi-ai/dist/utils/unavailable-tool-text.js +36 -0
  833. package/node_modules/@earendil-works/pi-ai/dist/utils/unavailable-tool-text.js.map +1 -0
  834. package/node_modules/@earendil-works/pi-ai/package.json +10 -6
  835. package/node_modules/@earendil-works/pi-pty/package.json +2 -2
  836. package/node_modules/@earendil-works/pi-tui/README.md +77 -14
  837. package/node_modules/@earendil-works/pi-tui/dist/TuiAltScreen.d.ts +83 -0
  838. package/node_modules/@earendil-works/pi-tui/dist/TuiAltScreen.d.ts.map +1 -0
  839. package/node_modules/@earendil-works/pi-tui/dist/TuiAltScreen.js +687 -0
  840. package/node_modules/@earendil-works/pi-tui/dist/TuiAltScreen.js.map +1 -0
  841. package/node_modules/@earendil-works/pi-tui/dist/TuiMainScreen.d.ts +5 -0
  842. package/node_modules/@earendil-works/pi-tui/dist/TuiMainScreen.d.ts.map +1 -0
  843. package/node_modules/@earendil-works/pi-tui/dist/TuiMainScreen.js +5 -0
  844. package/node_modules/@earendil-works/pi-tui/dist/TuiMainScreen.js.map +1 -0
  845. package/node_modules/@earendil-works/pi-tui/dist/components/alt-screen-flash.d.ts +13 -0
  846. package/node_modules/@earendil-works/pi-tui/dist/components/alt-screen-flash.d.ts.map +1 -0
  847. package/node_modules/@earendil-works/pi-tui/dist/components/alt-screen-flash.js +36 -0
  848. package/node_modules/@earendil-works/pi-tui/dist/components/alt-screen-flash.js.map +1 -0
  849. package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts.map +1 -1
  850. package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +5 -1
  851. package/node_modules/@earendil-works/pi-tui/dist/components/editor.js.map +1 -1
  852. package/node_modules/@earendil-works/pi-tui/dist/components/h-stack.d.ts +7 -0
  853. package/node_modules/@earendil-works/pi-tui/dist/components/h-stack.d.ts.map +1 -0
  854. package/node_modules/@earendil-works/pi-tui/dist/components/h-stack.js +43 -0
  855. package/node_modules/@earendil-works/pi-tui/dist/components/h-stack.js.map +1 -0
  856. package/node_modules/@earendil-works/pi-tui/dist/components/image.d.ts.map +1 -1
  857. package/node_modules/@earendil-works/pi-tui/dist/components/image.js +4 -4
  858. package/node_modules/@earendil-works/pi-tui/dist/components/image.js.map +1 -1
  859. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts +2 -0
  860. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts.map +1 -1
  861. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js +3 -2
  862. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js.map +1 -1
  863. package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.d.ts +51 -0
  864. package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.d.ts.map +1 -0
  865. package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.js +163 -0
  866. package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.js.map +1 -0
  867. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts.map +1 -1
  868. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js +3 -6
  869. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js.map +1 -1
  870. package/node_modules/@earendil-works/pi-tui/dist/components/stack.d.ts +32 -0
  871. package/node_modules/@earendil-works/pi-tui/dist/components/stack.d.ts.map +1 -0
  872. package/node_modules/@earendil-works/pi-tui/dist/components/stack.js +109 -0
  873. package/node_modules/@earendil-works/pi-tui/dist/components/stack.js.map +1 -0
  874. package/node_modules/@earendil-works/pi-tui/dist/components/v-stack.d.ts +8 -0
  875. package/node_modules/@earendil-works/pi-tui/dist/components/v-stack.d.ts.map +1 -0
  876. package/node_modules/@earendil-works/pi-tui/dist/components/v-stack.js +21 -0
  877. package/node_modules/@earendil-works/pi-tui/dist/components/v-stack.js.map +1 -0
  878. package/node_modules/@earendil-works/pi-tui/dist/index.d.ts +10 -4
  879. package/node_modules/@earendil-works/pi-tui/dist/index.d.ts.map +1 -1
  880. package/node_modules/@earendil-works/pi-tui/dist/index.js +10 -4
  881. package/node_modules/@earendil-works/pi-tui/dist/index.js.map +1 -1
  882. package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts +30 -0
  883. package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts.map +1 -1
  884. package/node_modules/@earendil-works/pi-tui/dist/keybindings.js +18 -0
  885. package/node_modules/@earendil-works/pi-tui/dist/keybindings.js.map +1 -1
  886. package/node_modules/@earendil-works/pi-tui/dist/layout-node.d.ts +40 -0
  887. package/node_modules/@earendil-works/pi-tui/dist/layout-node.d.ts.map +1 -0
  888. package/node_modules/@earendil-works/pi-tui/dist/layout-node.js +6 -0
  889. package/node_modules/@earendil-works/pi-tui/dist/layout-node.js.map +1 -0
  890. package/node_modules/@earendil-works/pi-tui/dist/layout.d.ts +40 -0
  891. package/node_modules/@earendil-works/pi-tui/dist/layout.d.ts.map +1 -0
  892. package/node_modules/@earendil-works/pi-tui/dist/layout.js +315 -0
  893. package/node_modules/@earendil-works/pi-tui/dist/layout.js.map +1 -0
  894. package/node_modules/@earendil-works/pi-tui/dist/mux.js +1 -1
  895. package/node_modules/@earendil-works/pi-tui/dist/mux.js.map +1 -1
  896. package/node_modules/@earendil-works/pi-tui/dist/slash-command-autocomplete.d.ts.map +1 -1
  897. package/node_modules/@earendil-works/pi-tui/dist/slash-command-autocomplete.js +36 -8
  898. package/node_modules/@earendil-works/pi-tui/dist/slash-command-autocomplete.js.map +1 -1
  899. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts +10 -0
  900. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts.map +1 -1
  901. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js +61 -3
  902. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js.map +1 -1
  903. package/node_modules/@earendil-works/pi-tui/dist/terminal-text.d.ts +1 -0
  904. package/node_modules/@earendil-works/pi-tui/dist/terminal-text.d.ts.map +1 -1
  905. package/node_modules/@earendil-works/pi-tui/dist/terminal-text.js +12 -2
  906. package/node_modules/@earendil-works/pi-tui/dist/terminal-text.js.map +1 -1
  907. package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts +39 -16
  908. package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts.map +1 -1
  909. package/node_modules/@earendil-works/pi-tui/dist/tui.js +138 -54
  910. package/node_modules/@earendil-works/pi-tui/dist/tui.js.map +1 -1
  911. package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts +10 -0
  912. package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts.map +1 -1
  913. package/node_modules/@earendil-works/pi-tui/dist/utils.js +95 -4
  914. package/node_modules/@earendil-works/pi-tui/dist/utils.js.map +1 -1
  915. package/node_modules/@earendil-works/pi-tui/package.json +2 -2
  916. package/node_modules/typebox/build/compile/validator.d.mts +3 -11
  917. package/node_modules/typebox/build/compile/validator.mjs +6 -36
  918. package/node_modules/typebox/build/error/errors.d.mts +1 -7
  919. package/node_modules/typebox/build/format/_idna.mjs +36 -6
  920. package/node_modules/typebox/build/format/_puny.mjs +4 -1
  921. package/node_modules/typebox/build/format/uuid.d.mts +2 -2
  922. package/node_modules/typebox/build/format/uuid.mjs +3 -3
  923. package/node_modules/typebox/build/guard/emit.d.mts +0 -4
  924. package/node_modules/typebox/build/guard/emit.mjs +0 -8
  925. package/node_modules/typebox/build/guard/guard.d.mts +5 -9
  926. package/node_modules/typebox/build/guard/guard.mjs +10 -15
  927. package/node_modules/typebox/build/guard/string.mjs +16 -4
  928. package/node_modules/typebox/build/schema/engine/_functions.mjs +34 -15
  929. package/node_modules/typebox/build/schema/engine/boolean.d.mts +3 -3
  930. package/node_modules/typebox/build/schema/engine/boolean.mjs +4 -4
  931. package/node_modules/typebox/build/schema/engine/index.d.mts +0 -1
  932. package/node_modules/typebox/build/schema/engine/index.mjs +0 -1
  933. package/node_modules/typebox/build/schema/engine/schema.mjs +6 -11
  934. package/node_modules/typebox/build/schema/engine/type.mjs +14 -18
  935. package/node_modules/typebox/build/schema/types/dependencies.mjs +1 -1
  936. package/node_modules/typebox/build/schema/types/index.d.mts +0 -1
  937. package/node_modules/typebox/build/schema/types/index.mjs +0 -1
  938. package/node_modules/typebox/build/schema/types/schema.d.mts +1 -1
  939. package/node_modules/typebox/build/schema/types/schema.mjs +2 -2
  940. package/node_modules/typebox/build/system/locale/ar_001.mjs +0 -1
  941. package/node_modules/typebox/build/system/locale/bn_BD.mjs +0 -1
  942. package/node_modules/typebox/build/system/locale/cs_CZ.mjs +0 -1
  943. package/node_modules/typebox/build/system/locale/de_DE.mjs +0 -1
  944. package/node_modules/typebox/build/system/locale/el_GR.mjs +0 -1
  945. package/node_modules/typebox/build/system/locale/en_US.mjs +0 -1
  946. package/node_modules/typebox/build/system/locale/es_419.mjs +0 -1
  947. package/node_modules/typebox/build/system/locale/es_AR.mjs +0 -1
  948. package/node_modules/typebox/build/system/locale/es_ES.mjs +0 -1
  949. package/node_modules/typebox/build/system/locale/es_MX.mjs +0 -1
  950. package/node_modules/typebox/build/system/locale/fa_IR.mjs +0 -1
  951. package/node_modules/typebox/build/system/locale/fil_PH.mjs +0 -1
  952. package/node_modules/typebox/build/system/locale/fr_CA.mjs +0 -1
  953. package/node_modules/typebox/build/system/locale/fr_FR.mjs +0 -1
  954. package/node_modules/typebox/build/system/locale/ha_NG.mjs +0 -1
  955. package/node_modules/typebox/build/system/locale/hi_IN.mjs +0 -1
  956. package/node_modules/typebox/build/system/locale/hu_HU.mjs +0 -1
  957. package/node_modules/typebox/build/system/locale/id_ID.mjs +0 -1
  958. package/node_modules/typebox/build/system/locale/it_IT.mjs +0 -1
  959. package/node_modules/typebox/build/system/locale/ja_JP.mjs +0 -1
  960. package/node_modules/typebox/build/system/locale/ko_KR.mjs +0 -1
  961. package/node_modules/typebox/build/system/locale/ms_MY.mjs +0 -1
  962. package/node_modules/typebox/build/system/locale/nl_NL.mjs +0 -1
  963. package/node_modules/typebox/build/system/locale/pl_PL.mjs +0 -1
  964. package/node_modules/typebox/build/system/locale/pt_BR.mjs +0 -1
  965. package/node_modules/typebox/build/system/locale/pt_PT.mjs +0 -1
  966. package/node_modules/typebox/build/system/locale/ro_RO.mjs +0 -1
  967. package/node_modules/typebox/build/system/locale/ru_RU.mjs +0 -1
  968. package/node_modules/typebox/build/system/locale/sv_SE.mjs +0 -1
  969. package/node_modules/typebox/build/system/locale/sw_TZ.mjs +0 -1
  970. package/node_modules/typebox/build/system/locale/th_TH.mjs +0 -1
  971. package/node_modules/typebox/build/system/locale/tr_TR.mjs +0 -1
  972. package/node_modules/typebox/build/system/locale/uk_UA.mjs +0 -1
  973. package/node_modules/typebox/build/system/locale/ur_PK.mjs +0 -1
  974. package/node_modules/typebox/build/system/locale/vi_VN.mjs +0 -1
  975. package/node_modules/typebox/build/system/locale/yo_NG.mjs +0 -1
  976. package/node_modules/typebox/build/system/locale/zh_Hans.mjs +0 -1
  977. package/node_modules/typebox/build/system/locale/zh_Hant.mjs +0 -1
  978. package/node_modules/typebox/build/system/memory/clone.d.mts +2 -3
  979. package/node_modules/typebox/build/system/memory/clone.mjs +73 -26
  980. package/node_modules/typebox/build/system/settings/settings.d.mts +15 -0
  981. package/node_modules/typebox/build/system/settings/settings.mjs +3 -1
  982. package/node_modules/typebox/build/type/action/_add_immutable.d.mts +11 -0
  983. package/node_modules/typebox/build/type/action/_add_immutable.mjs +11 -0
  984. package/node_modules/typebox/build/type/action/_add_optional.d.mts +11 -0
  985. package/node_modules/typebox/build/type/action/_add_optional.mjs +11 -0
  986. package/node_modules/typebox/build/type/action/_add_readonly.d.mts +11 -0
  987. package/node_modules/typebox/build/type/action/_add_readonly.mjs +11 -0
  988. package/node_modules/typebox/build/type/action/_remove_immutable.d.mts +11 -0
  989. package/node_modules/typebox/build/type/action/_remove_immutable.mjs +11 -0
  990. package/node_modules/typebox/build/type/action/_remove_optional.d.mts +11 -0
  991. package/node_modules/typebox/build/type/action/_remove_optional.mjs +11 -0
  992. package/node_modules/typebox/build/type/action/_remove_readonly.d.mts +11 -0
  993. package/node_modules/typebox/build/type/action/_remove_readonly.mjs +11 -0
  994. package/node_modules/typebox/build/type/action/conditional.d.mts +2 -3
  995. package/node_modules/typebox/build/type/action/conditional.mjs +2 -1
  996. package/node_modules/typebox/build/type/action/index.d.mts +7 -4
  997. package/node_modules/typebox/build/type/action/index.mjs +7 -4
  998. package/node_modules/typebox/build/type/action/mapped.d.mts +2 -3
  999. package/node_modules/typebox/build/type/action/mapped.mjs +2 -1
  1000. package/node_modules/typebox/build/type/action/module.d.mts +8 -7
  1001. package/node_modules/typebox/build/type/action/module.mjs +7 -6
  1002. package/node_modules/typebox/build/type/action/readonly_object.mjs +3 -0
  1003. package/node_modules/typebox/build/type/action/with.d.mts +11 -0
  1004. package/node_modules/typebox/build/type/action/with.mjs +11 -0
  1005. package/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs +1 -1
  1006. package/node_modules/typebox/build/type/engine/call/instantiate.d.mts +1 -3
  1007. package/node_modules/typebox/build/type/engine/call/instantiate.mjs +3 -2
  1008. package/node_modules/typebox/build/type/engine/call/resolve_arguments.mjs +2 -2
  1009. package/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.d.mts +3 -4
  1010. package/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.mjs +2 -1
  1011. package/node_modules/typebox/build/type/engine/cyclic/candidates.d.mts +2 -3
  1012. package/node_modules/typebox/build/type/engine/cyclic/candidates.mjs +3 -6
  1013. package/node_modules/typebox/build/type/engine/cyclic/check.d.mts +6 -9
  1014. package/node_modules/typebox/build/type/engine/cyclic/check.mjs +10 -16
  1015. package/node_modules/typebox/build/type/engine/cyclic/dependencies.d.mts +1 -4
  1016. package/node_modules/typebox/build/type/engine/cyclic/dependencies.mjs +9 -15
  1017. package/node_modules/typebox/build/type/engine/cyclic/extends.d.mts +1 -4
  1018. package/node_modules/typebox/build/type/engine/cyclic/extends.mjs +8 -14
  1019. package/node_modules/typebox/build/type/engine/cyclic/instantiate.d.mts +2 -5
  1020. package/node_modules/typebox/build/type/engine/cyclic/instantiate.mjs +3 -2
  1021. package/node_modules/typebox/build/type/engine/enum/index.d.mts +0 -1
  1022. package/node_modules/typebox/build/type/engine/enum/index.mjs +0 -1
  1023. package/node_modules/typebox/build/type/engine/evaluate/broaden.d.mts +1 -2
  1024. package/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +2 -6
  1025. package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +10 -6
  1026. package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +10 -6
  1027. package/node_modules/typebox/build/type/engine/evaluate/distribute.d.mts +2 -1
  1028. package/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +3 -3
  1029. package/node_modules/typebox/build/type/engine/evaluate/evaluate.d.mts +17 -5
  1030. package/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +34 -8
  1031. package/node_modules/typebox/build/type/engine/exclude/operation.d.mts +5 -6
  1032. package/node_modules/typebox/build/type/engine/exclude/operation.mjs +11 -12
  1033. package/node_modules/typebox/build/type/engine/extract/operation.d.mts +5 -6
  1034. package/node_modules/typebox/build/type/engine/extract/operation.mjs +11 -12
  1035. package/node_modules/typebox/build/type/engine/immutable/instantiate_add.d.mts +10 -0
  1036. package/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs +14 -0
  1037. package/node_modules/typebox/build/type/engine/immutable/instantiate_remove.d.mts +10 -0
  1038. package/node_modules/typebox/build/type/engine/immutable/instantiate_remove.mjs +14 -0
  1039. package/node_modules/typebox/build/type/engine/index.d.mts +2 -2
  1040. package/node_modules/typebox/build/type/engine/index.mjs +2 -2
  1041. package/node_modules/typebox/build/type/engine/indexable/from_dependent.d.mts +5 -0
  1042. package/node_modules/typebox/build/type/engine/indexable/from_dependent.mjs +8 -0
  1043. package/node_modules/typebox/build/type/engine/indexable/from_enum.d.mts +3 -3
  1044. package/node_modules/typebox/build/type/engine/indexable/from_enum.mjs +4 -4
  1045. package/node_modules/typebox/build/type/engine/indexable/from_template_literal.d.mts +2 -2
  1046. package/node_modules/typebox/build/type/engine/indexable/from_template_literal.mjs +3 -3
  1047. package/node_modules/typebox/build/type/engine/indexable/from_type.d.mts +3 -1
  1048. package/node_modules/typebox/build/type/engine/indexable/from_type.mjs +9 -6
  1049. package/node_modules/typebox/build/type/engine/indexed/instantiate.d.mts +2 -1
  1050. package/node_modules/typebox/build/type/engine/indexed/instantiate.mjs +5 -2
  1051. package/node_modules/typebox/build/type/engine/instantiate.d.mts +44 -31
  1052. package/node_modules/typebox/build/type/engine/instantiate.mjs +82 -83
  1053. package/node_modules/typebox/build/type/engine/interface/instantiate.d.mts +3 -6
  1054. package/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.d.mts +2 -2
  1055. package/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.mjs +3 -3
  1056. package/node_modules/typebox/build/type/engine/keyof/instantiate.d.mts +2 -1
  1057. package/node_modules/typebox/build/type/engine/keyof/instantiate.mjs +5 -1
  1058. package/node_modules/typebox/build/type/engine/mapped/mapped_operation.d.mts +4 -4
  1059. package/node_modules/typebox/build/type/engine/mapped/mapped_operation.mjs +3 -3
  1060. package/node_modules/typebox/build/type/engine/mapped/mapped_variants.d.mts +5 -4
  1061. package/node_modules/typebox/build/type/engine/mapped/mapped_variants.mjs +10 -5
  1062. package/node_modules/typebox/build/type/engine/module/instantiate.d.mts +7 -9
  1063. package/node_modules/typebox/build/type/engine/module/instantiate.mjs +17 -15
  1064. package/node_modules/typebox/build/type/engine/object/from_dependent.d.mts +5 -0
  1065. package/node_modules/typebox/build/type/engine/object/from_dependent.mjs +8 -0
  1066. package/node_modules/typebox/build/type/engine/object/from_type.d.mts +3 -1
  1067. package/node_modules/typebox/build/type/engine/object/from_type.mjs +8 -5
  1068. package/node_modules/typebox/build/type/engine/object/from_union.mjs +2 -2
  1069. package/node_modules/typebox/build/type/engine/optional/instantiate_add.d.mts +10 -0
  1070. package/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs +14 -0
  1071. package/node_modules/typebox/build/type/engine/optional/instantiate_remove.d.mts +10 -0
  1072. package/node_modules/typebox/build/type/engine/optional/instantiate_remove.mjs +14 -0
  1073. package/node_modules/typebox/build/type/engine/parameters/instantiate.d.mts +3 -4
  1074. package/node_modules/typebox/build/type/engine/parameters/instantiate.mjs +2 -1
  1075. package/node_modules/typebox/build/type/engine/partial/from_dependent.d.mts +5 -0
  1076. package/node_modules/typebox/build/type/engine/partial/from_dependent.mjs +8 -0
  1077. package/node_modules/typebox/build/type/engine/partial/from_intersect.d.mts +1 -1
  1078. package/node_modules/typebox/build/type/engine/partial/from_intersect.mjs +3 -2
  1079. package/node_modules/typebox/build/type/engine/partial/from_object.d.mts +2 -2
  1080. package/node_modules/typebox/build/type/engine/partial/from_object.mjs +2 -2
  1081. package/node_modules/typebox/build/type/engine/partial/from_type.d.mts +3 -1
  1082. package/node_modules/typebox/build/type/engine/partial/from_type.mjs +7 -4
  1083. package/node_modules/typebox/build/type/engine/priority/index.d.mts +1 -0
  1084. package/node_modules/typebox/build/type/engine/priority/index.mjs +1 -0
  1085. package/node_modules/typebox/build/type/engine/priority/priority.d.mts +20 -0
  1086. package/node_modules/typebox/build/type/engine/priority/priority.mjs +28 -0
  1087. package/node_modules/typebox/build/type/engine/readonly/instantiate_add.d.mts +10 -0
  1088. package/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs +14 -0
  1089. package/node_modules/typebox/build/type/engine/readonly/instantiate_remove.d.mts +10 -0
  1090. package/node_modules/typebox/build/type/engine/readonly/instantiate_remove.mjs +14 -0
  1091. package/node_modules/typebox/build/type/engine/readonly_object/from_array.d.mts +2 -2
  1092. package/node_modules/typebox/build/type/engine/readonly_object/from_array.mjs +2 -2
  1093. package/node_modules/typebox/build/type/engine/readonly_object/from_dependent.d.mts +5 -0
  1094. package/node_modules/typebox/build/type/engine/readonly_object/from_dependent.mjs +8 -0
  1095. package/node_modules/typebox/build/type/engine/readonly_object/from_intersect.d.mts +1 -1
  1096. package/node_modules/typebox/build/type/engine/readonly_object/from_intersect.mjs +3 -2
  1097. package/node_modules/typebox/build/type/engine/readonly_object/from_object.d.mts +2 -2
  1098. package/node_modules/typebox/build/type/engine/readonly_object/from_object.mjs +2 -2
  1099. package/node_modules/typebox/build/type/engine/readonly_object/from_tuple.d.mts +2 -2
  1100. package/node_modules/typebox/build/type/engine/readonly_object/from_tuple.mjs +2 -2
  1101. package/node_modules/typebox/build/type/engine/readonly_object/from_type.d.mts +3 -1
  1102. package/node_modules/typebox/build/type/engine/readonly_object/from_type.mjs +8 -5
  1103. package/node_modules/typebox/build/type/engine/record/from_key_enum.d.mts +2 -2
  1104. package/node_modules/typebox/build/type/engine/record/from_key_enum.mjs +2 -2
  1105. package/node_modules/typebox/build/type/engine/record/from_key_template_literal.d.mts +2 -2
  1106. package/node_modules/typebox/build/type/engine/record/from_key_template_literal.mjs +2 -2
  1107. package/node_modules/typebox/build/type/engine/ref/instantiate.d.mts +3 -3
  1108. package/node_modules/typebox/build/type/engine/ref/instantiate.mjs +6 -6
  1109. package/node_modules/typebox/build/type/engine/required/from_dependent.d.mts +5 -0
  1110. package/node_modules/typebox/build/type/engine/required/from_dependent.mjs +8 -0
  1111. package/node_modules/typebox/build/type/engine/required/from_intersect.d.mts +1 -1
  1112. package/node_modules/typebox/build/type/engine/required/from_intersect.mjs +3 -2
  1113. package/node_modules/typebox/build/type/engine/required/from_object.d.mts +2 -2
  1114. package/node_modules/typebox/build/type/engine/required/from_object.mjs +2 -2
  1115. package/node_modules/typebox/build/type/engine/required/from_type.d.mts +3 -1
  1116. package/node_modules/typebox/build/type/engine/required/from_type.mjs +7 -4
  1117. package/node_modules/typebox/build/type/engine/template_literal/decode.mjs +3 -3
  1118. package/node_modules/typebox/build/type/engine/template_literal/encode.d.mts +2 -2
  1119. package/node_modules/typebox/build/type/engine/template_literal/encode.mjs +6 -6
  1120. package/node_modules/typebox/build/type/engine/template_literal/is_finite.mjs +1 -1
  1121. package/node_modules/typebox/build/type/engine/template_literal/is_pattern.mjs +1 -0
  1122. package/node_modules/typebox/build/type/engine/this/expand_this.d.mts +1 -4
  1123. package/node_modules/typebox/build/type/engine/this/expand_this.mjs +7 -13
  1124. package/node_modules/typebox/build/type/engine/with/instantiate.d.mts +8 -0
  1125. package/node_modules/typebox/build/type/engine/{options → with}/instantiate.mjs +5 -5
  1126. package/node_modules/typebox/build/type/extends/dependent.d.mts +6 -0
  1127. package/node_modules/typebox/build/type/extends/dependent.mjs +6 -0
  1128. package/node_modules/typebox/build/type/extends/enum.d.mts +4 -4
  1129. package/node_modules/typebox/build/type/extends/enum.mjs +3 -2
  1130. package/node_modules/typebox/build/type/extends/extends_left.d.mts +5 -7
  1131. package/node_modules/typebox/build/type/extends/extends_left.mjs +24 -27
  1132. package/node_modules/typebox/build/type/extends/extends_right.d.mts +7 -5
  1133. package/node_modules/typebox/build/type/extends/extends_right.mjs +20 -15
  1134. package/node_modules/typebox/build/type/extends/inference.mjs +1 -1
  1135. package/node_modules/typebox/build/type/extends/object.d.mts +8 -1
  1136. package/node_modules/typebox/build/type/extends/object.mjs +25 -3
  1137. package/node_modules/typebox/build/type/extends/parameters.mjs +2 -2
  1138. package/node_modules/typebox/build/type/extends/record.d.mts +13 -0
  1139. package/node_modules/typebox/build/type/extends/record.mjs +23 -0
  1140. package/node_modules/typebox/build/type/extends/template_literal.d.mts +3 -3
  1141. package/node_modules/typebox/build/type/extends/template_literal.mjs +3 -3
  1142. package/node_modules/typebox/build/type/extends/tuple.d.mts +3 -6
  1143. package/node_modules/typebox/build/type/extends/tuple.mjs +6 -5
  1144. package/node_modules/typebox/build/type/extends/union.mjs +2 -2
  1145. package/node_modules/typebox/build/type/script/mapping.d.mts +86 -98
  1146. package/node_modules/typebox/build/type/script/mapping.mjs +95 -92
  1147. package/node_modules/typebox/build/type/script/parser.d.mts +42 -40
  1148. package/node_modules/typebox/build/type/script/parser.mjs +23 -22
  1149. package/node_modules/typebox/build/type/script/script.d.mts +3 -4
  1150. package/node_modules/typebox/build/type/script/script.mjs +3 -2
  1151. package/node_modules/typebox/build/type/script/token/internal/guard.d.mts +1 -1
  1152. package/node_modules/typebox/build/type/script/token/internal/guard.mjs +1 -1
  1153. package/node_modules/typebox/build/type/script/token/internal/take.mjs +1 -1
  1154. package/node_modules/typebox/build/type/script/token/until.mjs +2 -2
  1155. package/node_modules/typebox/build/type/types/_codec.d.mts +12 -12
  1156. package/node_modules/typebox/build/type/types/_codec.mjs +0 -1
  1157. package/node_modules/typebox/build/type/types/_immutable.d.mts +2 -9
  1158. package/node_modules/typebox/build/type/types/_immutable.mjs +2 -10
  1159. package/node_modules/typebox/build/type/types/_optional.d.mts +2 -9
  1160. package/node_modules/typebox/build/type/types/_optional.mjs +2 -11
  1161. package/node_modules/typebox/build/type/types/_readonly.d.mts +2 -9
  1162. package/node_modules/typebox/build/type/types/_readonly.mjs +2 -10
  1163. package/node_modules/typebox/build/type/types/_refine.d.mts +8 -10
  1164. package/node_modules/typebox/build/type/types/_refine.mjs +1 -2
  1165. package/node_modules/typebox/build/type/types/call.d.mts +3 -3
  1166. package/node_modules/typebox/build/type/types/call.mjs +3 -2
  1167. package/node_modules/typebox/build/type/types/deferred.d.mts +1 -0
  1168. package/node_modules/typebox/build/type/types/deferred.mjs +1 -1
  1169. package/node_modules/typebox/build/type/types/dependent.d.mts +17 -0
  1170. package/node_modules/typebox/build/type/types/dependent.mjs +24 -0
  1171. package/node_modules/typebox/build/type/types/enum.d.mts +3 -1
  1172. package/node_modules/typebox/build/type/types/enum.mjs +5 -0
  1173. package/node_modules/typebox/build/type/types/index.d.mts +1 -4
  1174. package/node_modules/typebox/build/type/types/index.mjs +1 -4
  1175. package/node_modules/typebox/build/type/types/number.d.mts +1 -1
  1176. package/node_modules/typebox/build/type/types/number.mjs +1 -1
  1177. package/node_modules/typebox/build/type/types/record.d.mts +13 -7
  1178. package/node_modules/typebox/build/type/types/record.mjs +15 -9
  1179. package/node_modules/typebox/build/type/types/static.d.mts +2 -5
  1180. package/node_modules/typebox/build/typebox.d.mts +3 -7
  1181. package/node_modules/typebox/build/typebox.mjs +3 -7
  1182. package/node_modules/typebox/build/value/clean/clean.mjs +4 -2
  1183. package/node_modules/typebox/build/value/clean/from_intersect.mjs +2 -2
  1184. package/node_modules/typebox/build/value/clean/from_type.mjs +8 -10
  1185. package/node_modules/typebox/build/value/clean/from_union.d.mts +1 -1
  1186. package/node_modules/typebox/build/value/clean/from_union.mjs +1 -2
  1187. package/node_modules/typebox/build/value/clone/clone.mjs +2 -73
  1188. package/node_modules/typebox/build/value/codec/decode.mjs +4 -2
  1189. package/node_modules/typebox/build/value/codec/encode.mjs +4 -2
  1190. package/node_modules/typebox/build/value/codec/from_array.mjs +1 -4
  1191. package/node_modules/typebox/build/value/codec/from_object.mjs +1 -4
  1192. package/node_modules/typebox/build/value/codec/from_record.mjs +2 -7
  1193. package/node_modules/typebox/build/value/codec/from_tuple.mjs +1 -4
  1194. package/node_modules/typebox/build/value/codec/from_union.mjs +2 -3
  1195. package/node_modules/typebox/build/value/convert/from_enum.mjs +3 -4
  1196. package/node_modules/typebox/build/value/convert/from_template_literal.d.mts +1 -1
  1197. package/node_modules/typebox/build/value/convert/from_template_literal.mjs +2 -3
  1198. package/node_modules/typebox/build/value/convert/from_type.mjs +19 -21
  1199. package/node_modules/typebox/build/value/create/from_enum.mjs +2 -2
  1200. package/node_modules/typebox/build/value/create/from_type.mjs +23 -31
  1201. package/node_modules/typebox/build/value/default/from_object.mjs +1 -1
  1202. package/node_modules/typebox/build/value/default/from_type.mjs +8 -10
  1203. package/node_modules/typebox/build/value/errors/errors.d.mts +2 -2
  1204. package/node_modules/typebox/build/value/errors/errors.mjs +1 -1
  1205. package/node_modules/typebox/build/value/index.d.mts +0 -1
  1206. package/node_modules/typebox/build/value/index.mjs +0 -1
  1207. package/node_modules/typebox/build/value/repair/from_enum.mjs +2 -3
  1208. package/node_modules/typebox/build/value/repair/from_type.mjs +24 -22
  1209. package/node_modules/typebox/build/value/shared/union_priority_sort.d.mts +6 -2
  1210. package/node_modules/typebox/build/value/shared/union_priority_sort.mjs +62 -26
  1211. package/node_modules/typebox/build/value/value.d.mts +0 -1
  1212. package/node_modules/typebox/build/value/value.mjs +0 -1
  1213. package/node_modules/typebox/package.json +33 -33
  1214. package/node_modules/typebox/readme.md +117 -103
  1215. package/package.json +16 -11
  1216. package/vendor/pi-client/client.d.ts +25 -0
  1217. package/vendor/pi-client/client.d.ts.map +1 -0
  1218. package/vendor/pi-client/client.js +386 -0
  1219. package/vendor/pi-client/client.js.map +1 -0
  1220. package/vendor/pi-client/connection.d.ts +25 -0
  1221. package/vendor/pi-client/connection.d.ts.map +1 -0
  1222. package/vendor/pi-client/connection.js +204 -0
  1223. package/vendor/pi-client/connection.js.map +1 -0
  1224. package/vendor/pi-client/errors.d.ts +23 -0
  1225. package/vendor/pi-client/errors.d.ts.map +1 -0
  1226. package/vendor/pi-client/errors.js +42 -0
  1227. package/vendor/pi-client/errors.js.map +1 -0
  1228. package/vendor/pi-client/index.d.ts +6 -0
  1229. package/vendor/pi-client/index.d.ts.map +1 -0
  1230. package/vendor/pi-client/index.js +3 -0
  1231. package/vendor/pi-client/index.js.map +1 -0
  1232. package/vendor/pi-client/promise.d.ts +8 -0
  1233. package/vendor/pi-client/promise.d.ts.map +1 -0
  1234. package/vendor/pi-client/promise.js +11 -0
  1235. package/vendor/pi-client/promise.js.map +1 -0
  1236. package/vendor/pi-client/session-handle.d.ts +54 -0
  1237. package/vendor/pi-client/session-handle.d.ts.map +1 -0
  1238. package/vendor/pi-client/session-handle.js +50 -0
  1239. package/vendor/pi-client/session-handle.js.map +1 -0
  1240. package/vendor/pi-client/state.d.ts +22 -0
  1241. package/vendor/pi-client/state.d.ts.map +1 -0
  1242. package/vendor/pi-client/state.js +149 -0
  1243. package/vendor/pi-client/state.js.map +1 -0
  1244. package/vendor/pi-client/transport.d.ts +17 -0
  1245. package/vendor/pi-client/transport.d.ts.map +1 -0
  1246. package/vendor/pi-client/transport.js +2 -0
  1247. package/vendor/pi-client/transport.js.map +1 -0
  1248. package/vendor/pi-client/types.d.ts +23 -0
  1249. package/vendor/pi-client/types.d.ts.map +1 -0
  1250. package/vendor/pi-client/types.js +2 -0
  1251. package/vendor/pi-client/types.js.map +1 -0
  1252. package/vendor/pi-client/unix.d.ts +8 -0
  1253. package/vendor/pi-client/unix.d.ts.map +1 -0
  1254. package/vendor/pi-client/unix.js +151 -0
  1255. package/vendor/pi-client/unix.js.map +1 -0
  1256. package/vendor/pi-protocol/cbor/decoder.d.ts +4 -0
  1257. package/vendor/pi-protocol/cbor/decoder.d.ts.map +1 -0
  1258. package/vendor/pi-protocol/cbor/decoder.js +163 -0
  1259. package/vendor/pi-protocol/cbor/decoder.js.map +1 -0
  1260. package/vendor/pi-protocol/cbor/encoder.d.ts +4 -0
  1261. package/vendor/pi-protocol/cbor/encoder.d.ts.map +1 -0
  1262. package/vendor/pi-protocol/cbor/encoder.js +199 -0
  1263. package/vendor/pi-protocol/cbor/encoder.js.map +1 -0
  1264. package/vendor/pi-protocol/cbor/index.d.ts +4 -0
  1265. package/vendor/pi-protocol/cbor/index.d.ts.map +1 -0
  1266. package/vendor/pi-protocol/cbor/index.js +4 -0
  1267. package/vendor/pi-protocol/cbor/index.js.map +1 -0
  1268. package/vendor/pi-protocol/cbor/options.d.ts +26 -0
  1269. package/vendor/pi-protocol/cbor/options.d.ts.map +1 -0
  1270. package/vendor/pi-protocol/cbor/options.js +29 -0
  1271. package/vendor/pi-protocol/cbor/options.js.map +1 -0
  1272. package/vendor/pi-protocol/codec.d.ts +29 -0
  1273. package/vendor/pi-protocol/codec.d.ts.map +1 -0
  1274. package/vendor/pi-protocol/codec.js +140 -0
  1275. package/vendor/pi-protocol/codec.js.map +1 -0
  1276. package/vendor/pi-protocol/framing.d.ts +29 -0
  1277. package/vendor/pi-protocol/framing.d.ts.map +1 -0
  1278. package/vendor/pi-protocol/framing.js +152 -0
  1279. package/vendor/pi-protocol/framing.js.map +1 -0
  1280. package/vendor/pi-protocol/index.d.ts +5 -0
  1281. package/vendor/pi-protocol/index.d.ts.map +1 -0
  1282. package/vendor/pi-protocol/index.js +5 -0
  1283. package/vendor/pi-protocol/index.js.map +1 -0
  1284. package/vendor/pi-protocol/schemas.d.ts +13818 -0
  1285. package/vendor/pi-protocol/schemas.d.ts.map +1 -0
  1286. package/vendor/pi-protocol/schemas.js +382 -0
  1287. package/vendor/pi-protocol/schemas.js.map +1 -0
  1288. package/dist/core/extensions/builtin/claude-agent-sdk/auth-lane.d.ts.map +0 -1
  1289. package/dist/core/extensions/builtin/claude-agent-sdk/auth-lane.js.map +0 -1
  1290. package/dist/core/extensions/builtin/claude-agent-sdk/guidance.d.ts +0 -6
  1291. package/dist/core/extensions/builtin/claude-agent-sdk/guidance.d.ts.map +0 -1
  1292. package/dist/core/extensions/builtin/claude-agent-sdk/guidance.js.map +0 -1
  1293. package/dist/core/extensions/builtin/claude-agent-sdk/index.d.ts +0 -4
  1294. package/dist/core/extensions/builtin/claude-agent-sdk/index.d.ts.map +0 -1
  1295. package/dist/core/extensions/builtin/claude-agent-sdk/index.js.map +0 -1
  1296. package/dist/core/extensions/builtin/claude-agent-sdk/oauth-login.js.map +0 -1
  1297. package/dist/core/extensions/builtin/claude-agent-sdk/options.d.ts +0 -16
  1298. package/dist/core/extensions/builtin/claude-agent-sdk/options.js.map +0 -1
  1299. package/dist/core/extensions/builtin/claude-agent-sdk/prompt-bridge.js.map +0 -1
  1300. package/dist/core/extensions/builtin/claude-agent-sdk/sdk-boundary.d.ts.map +0 -1
  1301. package/dist/core/extensions/builtin/claude-agent-sdk/settings.d.ts +0 -15
  1302. package/dist/core/extensions/builtin/claude-agent-sdk/settings.d.ts.map +0 -1
  1303. package/dist/core/extensions/builtin/claude-agent-sdk/settings.js +0 -41
  1304. package/dist/core/extensions/builtin/claude-agent-sdk/settings.js.map +0 -1
  1305. package/dist/core/extensions/builtin/claude-agent-sdk/stream.d.ts.map +0 -1
  1306. package/dist/core/extensions/builtin/claude-agent-sdk/stream.js +0 -229
  1307. package/dist/core/extensions/builtin/claude-agent-sdk/stream.js.map +0 -1
  1308. package/dist/core/extensions/builtin/claude-agent-sdk/tools.d.ts.map +0 -1
  1309. package/dist/core/extensions/builtin/claude-agent-sdk/tools.js.map +0 -1
  1310. package/dist/core/extensions/builtin/tool-pair-guard/sanitize-anthropic-payload.d.ts +0 -3
  1311. package/dist/core/extensions/builtin/tool-pair-guard/sanitize-anthropic-payload.d.ts.map +0 -1
  1312. package/dist/core/extensions/builtin/tool-pair-guard/sanitize-anthropic-payload.js +0 -75
  1313. package/dist/core/extensions/builtin/tool-pair-guard/sanitize-anthropic-payload.js.map +0 -1
  1314. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-repo.d.ts +0 -26
  1315. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-repo.d.ts.map +0 -1
  1316. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-repo.js +0 -100
  1317. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-repo.js.map +0 -1
  1318. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-storage.d.ts +0 -42
  1319. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-storage.d.ts.map +0 -1
  1320. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-storage.js +0 -286
  1321. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-storage.js.map +0 -1
  1322. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-repo.d.ts +0 -18
  1323. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-repo.d.ts.map +0 -1
  1324. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-repo.js +0 -44
  1325. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-repo.js.map +0 -1
  1326. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-storage.d.ts +0 -33
  1327. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-storage.d.ts.map +0 -1
  1328. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-storage.js +0 -163
  1329. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-storage.js.map +0 -1
  1330. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo-utils.d.ts +0 -11
  1331. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo-utils.d.ts.map +0 -1
  1332. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo-utils.js +0 -39
  1333. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo-utils.js.map +0 -1
  1334. package/node_modules/typebox/build/schema/engine/_guard.d.mts +0 -6
  1335. package/node_modules/typebox/build/schema/engine/_guard.mjs +0 -26
  1336. package/node_modules/typebox/build/schema/types/_guard.d.mts +0 -10
  1337. package/node_modules/typebox/build/schema/types/_guard.mjs +0 -16
  1338. package/node_modules/typebox/build/type/action/_optional.d.mts +0 -19
  1339. package/node_modules/typebox/build/type/action/_optional.mjs +0 -40
  1340. package/node_modules/typebox/build/type/action/_readonly.d.mts +0 -19
  1341. package/node_modules/typebox/build/type/action/_readonly.mjs +0 -40
  1342. package/node_modules/typebox/build/type/action/awaited.d.mts +0 -15
  1343. package/node_modules/typebox/build/type/action/awaited.mjs +0 -15
  1344. package/node_modules/typebox/build/type/action/options.d.mts +0 -11
  1345. package/node_modules/typebox/build/type/action/options.mjs +0 -11
  1346. package/node_modules/typebox/build/type/engine/awaited/instantiate.d.mts +0 -11
  1347. package/node_modules/typebox/build/type/engine/awaited/instantiate.mjs +0 -20
  1348. package/node_modules/typebox/build/type/engine/enum/enum_to_union.d.mts +0 -14
  1349. package/node_modules/typebox/build/type/engine/enum/enum_to_union.mjs +0 -24
  1350. package/node_modules/typebox/build/type/engine/options/index.d.mts +0 -1
  1351. package/node_modules/typebox/build/type/engine/options/index.mjs +0 -1
  1352. package/node_modules/typebox/build/type/engine/options/instantiate.d.mts +0 -8
  1353. package/node_modules/typebox/build/type/extends/async_iterator.d.mts +0 -7
  1354. package/node_modules/typebox/build/type/extends/async_iterator.mjs +0 -9
  1355. package/node_modules/typebox/build/type/extends/iterator.d.mts +0 -7
  1356. package/node_modules/typebox/build/type/extends/iterator.mjs +0 -9
  1357. package/node_modules/typebox/build/type/extends/promise.d.mts +0 -7
  1358. package/node_modules/typebox/build/type/extends/promise.mjs +0 -9
  1359. package/node_modules/typebox/build/type/types/async_iterator.d.mts +0 -20
  1360. package/node_modules/typebox/build/type/types/async_iterator.mjs +0 -28
  1361. package/node_modules/typebox/build/type/types/base.d.mts +0 -50
  1362. package/node_modules/typebox/build/type/types/base.mjs +0 -84
  1363. package/node_modules/typebox/build/type/types/iterator.d.mts +0 -20
  1364. package/node_modules/typebox/build/type/types/iterator.mjs +0 -28
  1365. package/node_modules/typebox/build/type/types/promise.d.mts +0 -21
  1366. package/node_modules/typebox/build/type/types/promise.mjs +0 -29
  1367. package/node_modules/typebox/build/value/clean/from_base.d.mts +0 -2
  1368. package/node_modules/typebox/build/value/clean/from_base.mjs +0 -4
  1369. package/node_modules/typebox/build/value/convert/from_base.d.mts +0 -2
  1370. package/node_modules/typebox/build/value/convert/from_base.mjs +0 -4
  1371. package/node_modules/typebox/build/value/create/from_async_iterator.d.mts +0 -2
  1372. package/node_modules/typebox/build/value/create/from_async_iterator.mjs +0 -5
  1373. package/node_modules/typebox/build/value/create/from_base.d.mts +0 -2
  1374. package/node_modules/typebox/build/value/create/from_base.mjs +0 -4
  1375. package/node_modules/typebox/build/value/create/from_iterator.d.mts +0 -2
  1376. package/node_modules/typebox/build/value/create/from_iterator.mjs +0 -5
  1377. package/node_modules/typebox/build/value/create/from_promise.d.mts +0 -2
  1378. package/node_modules/typebox/build/value/create/from_promise.mjs +0 -5
  1379. package/node_modules/typebox/build/value/default/from_base.d.mts +0 -2
  1380. package/node_modules/typebox/build/value/default/from_base.mjs +0 -5
  1381. package/node_modules/typebox/build/value/mutate/error.d.mts +0 -3
  1382. package/node_modules/typebox/build/value/mutate/error.mjs +0 -6
  1383. package/node_modules/typebox/build/value/mutate/from_array.d.mts +0 -2
  1384. package/node_modules/typebox/build/value/mutate/from_array.mjs +0 -16
  1385. package/node_modules/typebox/build/value/mutate/from_object.d.mts +0 -2
  1386. package/node_modules/typebox/build/value/mutate/from_object.mjs +0 -40
  1387. package/node_modules/typebox/build/value/mutate/from_unknown.d.mts +0 -2
  1388. package/node_modules/typebox/build/value/mutate/from_unknown.mjs +0 -7
  1389. package/node_modules/typebox/build/value/mutate/from_value.d.mts +0 -2
  1390. package/node_modules/typebox/build/value/mutate/from_value.mjs +0 -12
  1391. package/node_modules/typebox/build/value/mutate/index.d.mts +0 -1
  1392. package/node_modules/typebox/build/value/mutate/index.mjs +0 -1
  1393. package/node_modules/typebox/build/value/mutate/mutate.d.mts +0 -11
  1394. package/node_modules/typebox/build/value/mutate/mutate.mjs +0 -41
  1395. package/node_modules/typebox/build/value/repair/from_base.d.mts +0 -2
  1396. package/node_modules/typebox/build/value/repair/from_base.mjs +0 -8
  1397. /package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/account-events.d.ts +0 -0
  1398. /package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/account-events.js +0 -0
  1399. /package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/custom-tools-schema.d.ts +0 -0
  1400. /package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/custom-tools-schema.js +0 -0
  1401. /package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/custom-tools.d.ts +0 -0
  1402. /package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/custom-tools.js +0 -0
  1403. /package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/executable.d.ts +0 -0
  1404. /package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/executable.js +0 -0
  1405. /package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/failover.d.ts +0 -0
  1406. /package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/prompt-bridge.d.ts +0 -0
  1407. /package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/sdk-boundary.js +0 -0
  1408. /package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/stream-protocol.d.ts +0 -0
  1409. /package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/stream-protocol.js +0 -0
  1410. /package/node_modules/typebox/build/type/engine/{awaited → with}/index.d.mts +0 -0
  1411. /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";
@@ -195,10 +199,15 @@ export class AgentSession {
195
199
  this._isAgentRunActive = false;
196
200
  this._toolExecutionDepth = 0;
197
201
  this._promptStartPending = false;
202
+ this._nextInputId = 0;
198
203
  /** Tracks pending steering messages for UI display. Removed when delivered. */
199
204
  this._steeringMessages = [];
200
205
  /** Tracks pending follow-up messages for UI display. Removed when delivered. */
201
206
  this._followUpMessages = [];
207
+ /** Recovery-only order across both native queue modes and TUI compaction ownership. */
208
+ this._queuedInputOrder = [];
209
+ this._nextQueuedInputOrder = 0;
210
+ this._supersededCompactionLogAttemptIds = new Set();
202
211
  /** Messages queued to be included with the next user prompt as context ("asides"). */
203
212
  this._pendingNextTurnMessages = [];
204
213
  // Queues held while the first post-compaction response is classified. Agent
@@ -229,16 +238,19 @@ export class AgentSession {
229
238
  this._retryAbortController = undefined;
230
239
  this._retryAttempt = 0;
231
240
  this._consecutiveProviderStreamStalls = 0;
241
+ this._probePhase = "idle";
242
+ this._hintDeadlineMs = undefined;
243
+ this._cumulativeHintedWaitMs = 0;
232
244
  this._retryPromise = undefined;
233
245
  this._retryResolve = undefined;
234
246
  this._userAbortPromise = undefined;
235
247
  this._agentAbortSource = undefined;
236
248
  this._suppressQueuedContinuationAfterUserAbort = false;
237
- /** Set when clearQueue() drains non-empty queues, so abort() can detect the gap even after queues are cleared. */
249
+ /** Set when clearQueue({ abortWillFollow: true }) drains queues immediately before abort(). */
238
250
  this._hadClearedQueuedMessages = false;
239
251
  this._extensionEventSignal = undefined;
240
252
  // Bash execution state
241
- this._bashAbortController = undefined;
253
+ this._bashAbortControllers = new Set();
242
254
  this._pendingBashMessages = [];
243
255
  this._turnIndex = 0;
244
256
  this._baseToolDefinitions = new Map();
@@ -252,7 +264,8 @@ export class AgentSession {
252
264
  // Base system prompt (without extension appends) - used to apply fresh appends each turn
253
265
  this._baseSystemPrompt = "";
254
266
  this._currentServiceTier = undefined;
255
- this._lastHighReasoningWarningKey = undefined;
267
+ this._sessionFastMode = false;
268
+ this._shownHighReasoningWarningKeys = new Set();
256
269
  // Track last assistant message for auto-compaction check
257
270
  this._lastAssistantMessage = undefined;
258
271
  /** Internal handler for agent events - shared by subscribe and reconnect */
@@ -301,7 +314,6 @@ export class AgentSession {
301
314
  this.agent = config.agent;
302
315
  this.sessionManager = config.sessionManager;
303
316
  this.settingsManager = config.settingsManager;
304
- this.agent.abortServerSideFallback = this.settingsManager.getAbortServerSideFallback();
305
317
  const noModelFallback = config.resourceLoader.getExtensions().runtime.flagValues.get("no-model-fallback") === true ||
306
318
  process.env.SENPI_NO_FALLBACK === "1";
307
319
  if (noModelFallback) {
@@ -318,16 +330,19 @@ export class AgentSession {
318
330
  }
319
331
  this._modelRuntime = modelRuntime;
320
332
  this._modelRegistry = config.modelRegistry ?? new ModelRegistry(modelRuntime);
321
- const fallbackLogger = createFallbackLogger(config.agentDir ?? getAgentDir());
322
- this._sessionLogger = createSessionLogger(config.agentDir ?? getAgentDir());
333
+ this._agentDir = config.agentDir ?? getAgentDir();
334
+ const fallbackLogger = createFallbackLogger(this._agentDir);
335
+ this._sessionLogger = createSessionLogger(this._agentDir);
323
336
  this._fallbackValidationWarnings = validateFallbackChains(this.settingsManager.getRawFallbackChains(), this._modelRegistry);
324
337
  for (const warning of this._fallbackValidationWarnings) {
325
338
  fallbackLogger.warn("validation_warning", { warning });
326
339
  }
340
+ this._selectorCooldowns = new SelectorCooldowns(config.fallbackNow ?? (() => Date.now()));
341
+ this._fallbackNow = config.fallbackNow ?? (() => Date.now());
327
342
  this._retryFallback = new RetryFallbackController({
328
343
  getSettings: () => this.settingsManager.getRetryFallbackSettings(),
329
344
  registry: this._modelRegistry,
330
- cooldowns: new SelectorCooldowns(config.fallbackNow ?? (() => Date.now())),
345
+ cooldowns: this._selectorCooldowns,
331
346
  logger: fallbackLogger,
332
347
  switchModel: async (model, thinking, reason) => {
333
348
  await this._switchActiveModel(model, {
@@ -344,6 +359,9 @@ export class AgentSession {
344
359
  getCurrentSelector: () => (this.model ? { model: this.model, thinkingLevel: this.thinkingLevel } : undefined),
345
360
  isAuthAvailable: (provider) => this._modelRuntime.hasConfiguredAuth(provider),
346
361
  });
362
+ this._probeBackScheduler = new ProbeBackScheduler({
363
+ now: this._fallbackNow,
364
+ });
347
365
  this._extensionRunnerRef = config.extensionRunnerRef;
348
366
  this._initialActiveToolNames = config.initialActiveToolNames;
349
367
  this._allowedToolNames = config.allowedToolNames ? new Set(config.allowedToolNames) : undefined;
@@ -614,15 +632,77 @@ export class AgentSession {
614
632
  }
615
633
  /** Mirror stuck-prone lifecycle transitions into logs/session.log (content-free). */
616
634
  _logSessionEvent(event) {
635
+ if (event.type === "compaction_start") {
636
+ const previousAttempt = this._activeCompactionLogAttempt;
637
+ if (previousAttempt) {
638
+ const tokensAfter = this._estimateCompactionLogTokens("persisted");
639
+ this._sessionLogger.info("compaction_decision", {
640
+ attemptId: previousAttempt.id,
641
+ reason: previousAttempt.reason,
642
+ mode: previousAttempt.reason === "manual" ? "manual" : "auto",
643
+ action: "compact",
644
+ disposition: "superseded",
645
+ accepted: false,
646
+ skipped: true,
647
+ aborted: true,
648
+ willRetry: false,
649
+ tokensBefore: previousAttempt.tokensBefore,
650
+ tokensAfter,
651
+ });
652
+ this._supersededCompactionLogAttemptIds.add(previousAttempt.id);
653
+ }
654
+ const attempt = {
655
+ id: event.requestId ?? randomUUID(),
656
+ reason: event.reason,
657
+ tokensBefore: this._estimateCompactionLogTokens("persisted"),
658
+ };
659
+ this._activeCompactionLogAttempt = attempt;
660
+ this._sessionLogger.info("compaction_start", {
661
+ attemptId: attempt.id,
662
+ reason: event.reason,
663
+ mode: event.reason === "manual" ? "manual" : "auto",
664
+ action: "compact",
665
+ tokensBefore: attempt.tokensBefore,
666
+ });
667
+ return;
668
+ }
617
669
  if (event.type === "compaction_end") {
670
+ if (event.requestId && this._supersededCompactionLogAttemptIds.delete(event.requestId))
671
+ return;
672
+ const activeAttempt = this._activeCompactionLogAttempt;
673
+ const attempt = event.requestId !== undefined && activeAttempt?.id === event.requestId ? activeAttempt : undefined;
674
+ const accepted = event.accepted ?? event.result !== undefined;
675
+ const rejected = event.rejectionCause !== undefined;
676
+ const skipped = !accepted && (attempt === undefined || (!rejected && !event.aborted && !event.errorMessage));
677
+ const disposition = accepted
678
+ ? "committed"
679
+ : attempt === undefined
680
+ ? "skipped"
681
+ : rejected
682
+ ? "rejected"
683
+ : event.aborted
684
+ ? "aborted"
685
+ : event.errorMessage
686
+ ? "failed"
687
+ : "skipped";
688
+ const tokensAfter = this._estimateCompactionLogTokens(accepted ? "active" : "persisted");
618
689
  this._sessionLogger.info("compaction_decision", {
690
+ attemptId: attempt?.id ?? event.requestId,
619
691
  reason: event.reason,
620
- accepted: event.accepted ?? event.result !== undefined,
692
+ mode: event.reason === "manual" ? "manual" : "auto",
693
+ action: accepted || attempt ? "compact" : "none",
694
+ disposition,
695
+ accepted,
696
+ skipped,
621
697
  aborted: event.aborted,
622
698
  willRetry: event.willRetry,
623
699
  rejectionCause: event.rejectionCause,
624
700
  error: event.errorMessage,
701
+ tokensBefore: attempt?.tokensBefore ?? tokensAfter,
702
+ tokensAfter,
625
703
  });
704
+ if (attempt)
705
+ this._activeCompactionLogAttempt = undefined;
626
706
  return;
627
707
  }
628
708
  if (event.type === "message_end" && event.message.role === "assistant") {
@@ -637,6 +717,15 @@ export class AgentSession {
637
717
  this._sessionLogger.warn("provider_error", { kind, error: message.errorMessage });
638
718
  }
639
719
  }
720
+ _estimateCompactionLogTokens(source) {
721
+ try {
722
+ const messages = source === "active" ? this.agent.state.messages : this.sessionManager.buildSessionContext().messages;
723
+ return estimateMessagesTokens(filterContextExcludedMessages(messages));
724
+ }
725
+ catch {
726
+ return undefined;
727
+ }
728
+ }
640
729
  _emitQueueUpdate() {
641
730
  this._emit({
642
731
  type: "queue_update",
@@ -651,6 +740,10 @@ export class AgentSession {
651
740
  getMessageRevision() {
652
741
  return this._messageRevision;
653
742
  }
743
+ /** Resolved agent state directory for this session. */
744
+ get agentDir() {
745
+ return this._agentDir;
746
+ }
654
747
  async _waitForSettledSessionWork() {
655
748
  await this._sessionWorkBarrier.waitForSettled(() => this._agentEventQueue);
656
749
  }
@@ -711,6 +804,8 @@ export class AgentSession {
711
804
  async _promptAgent(messages) {
712
805
  this._isAgentRunActive = true;
713
806
  this._requiredCompactionAdmissionError = undefined;
807
+ this.agent.abortServerSideFallback =
808
+ this.settingsManager.getAbortServerSideFallback() && this._retryFallback.hasConfiguredChain();
714
809
  try {
715
810
  await this.agent.prompt(messages);
716
811
  // AgentSession's subscriber intentionally queues event work instead of
@@ -733,7 +828,9 @@ export class AgentSession {
733
828
  this.agent.steer(message);
734
829
  const userMessage = queuedMessages.find((message) => message.role === "user");
735
830
  if (userMessage?.role === "user") {
736
- this._steeringMessages.push(this._extractUserMessageText(userMessage.content));
831
+ const text = this._extractUserMessageText(userMessage.content);
832
+ this._steeringMessages.push(text);
833
+ this._recordQueuedInput(text, "steer");
737
834
  this._emitQueueUpdate();
738
835
  }
739
836
  return;
@@ -941,6 +1038,7 @@ export class AgentSession {
941
1038
  const steeringIndex = this._steeringMessages.indexOf(messageText);
942
1039
  if (steeringIndex !== -1) {
943
1040
  this._steeringMessages.splice(steeringIndex, 1);
1041
+ this._removeQueuedInput(messageText, "steer");
944
1042
  this._emitQueueUpdate();
945
1043
  }
946
1044
  else {
@@ -948,6 +1046,7 @@ export class AgentSession {
948
1046
  const followUpIndex = this._followUpMessages.indexOf(messageText);
949
1047
  if (followUpIndex !== -1) {
950
1048
  this._followUpMessages.splice(followUpIndex, 1);
1049
+ this._removeQueuedInput(messageText, "followUp");
951
1050
  this._emitQueueUpdate();
952
1051
  }
953
1052
  }
@@ -1009,6 +1108,7 @@ export class AgentSession {
1009
1108
  attempt: this._retryAttempt,
1010
1109
  });
1011
1110
  this._retryAttempt = 0;
1111
+ this._resetHintTierState();
1012
1112
  }
1013
1113
  }
1014
1114
  }
@@ -1098,6 +1198,77 @@ export class AgentSession {
1098
1198
  this._retryPromise = undefined;
1099
1199
  }
1100
1200
  }
1201
+ _resetHintTierState() {
1202
+ this._probePhase = "idle";
1203
+ this._hintDeadlineMs = undefined;
1204
+ this._cumulativeHintedWaitMs = 0;
1205
+ }
1206
+ /**
1207
+ * Arm the probe-back scheduler for a tier-2 demoted selector. The scheduler
1208
+ * will fire at most two probes (half-hint, then deadline) and clear the
1209
+ * selector cooldown on success so maybeRestorePrimary reverts at the next
1210
+ * turn boundary.
1211
+ */
1212
+ _armProbeBackForDemotedSelector(selector, hintMs) {
1213
+ if (!selector)
1214
+ return;
1215
+ // Guard: skip when the demoted selector is the ACTIVE model.
1216
+ const currentModel = this.model;
1217
+ if (currentModel && formatSelector(currentModel) === selector)
1218
+ return;
1219
+ // Guard: skip when auth is unavailable at arm time.
1220
+ const parts = selector.split("/");
1221
+ if (parts.length < 2)
1222
+ return;
1223
+ const provider = parts[0];
1224
+ if (!this._modelRuntime.hasConfiguredAuth(provider))
1225
+ return;
1226
+ const now = this._fallbackNow();
1227
+ const schedule = probeBackSchedule(hintMs, now);
1228
+ const modelId = parts.slice(1).join("/");
1229
+ const demotedModel = this._modelRuntime.getModel(provider, modelId);
1230
+ if (!demotedModel)
1231
+ return;
1232
+ this._probeBackScheduler.arm({
1233
+ selector,
1234
+ firstAtMs: schedule.firstAtMs,
1235
+ deadlineMs: schedule.deadlineMs,
1236
+ authAvailable: () => this._modelRuntime.hasConfiguredAuth(provider),
1237
+ runProbe: async (signal) => {
1238
+ try {
1239
+ const result = await this._modelRuntime.completeSimple(demotedModel, {
1240
+ systemPrompt: "Reply with OK.",
1241
+ messages: [{ role: "user", content: [{ type: "text", text: "OK" }], timestamp: now }],
1242
+ }, { maxTokens: 1, signal });
1243
+ return result.stopReason !== "error" && result.stopReason !== "aborted";
1244
+ }
1245
+ catch {
1246
+ return false;
1247
+ }
1248
+ },
1249
+ onCleared: (sel) => {
1250
+ this._selectorCooldowns.clear(sel);
1251
+ },
1252
+ emit: (event) => {
1253
+ if (event.type === "retry_probe_scheduled") {
1254
+ this._emit({
1255
+ type: "retry_probe_scheduled",
1256
+ selector: event.selector,
1257
+ atMs: event.atMs,
1258
+ probeIndex: event.probeIndex,
1259
+ });
1260
+ }
1261
+ else {
1262
+ this._emit({
1263
+ type: "retry_probe_result",
1264
+ selector: event.selector,
1265
+ ok: event.ok,
1266
+ errorMessage: event.errorMessage,
1267
+ });
1268
+ }
1269
+ },
1270
+ });
1271
+ }
1101
1272
  /** Find the last assistant message in agent state (including aborted ones) */
1102
1273
  _findLastAssistantMessage() {
1103
1274
  const messages = this.agent.state.messages;
@@ -1309,6 +1480,7 @@ export class AgentSession {
1309
1480
  */
1310
1481
  dispose() {
1311
1482
  try {
1483
+ this._probeBackScheduler.cancel("dispose");
1312
1484
  this.abortRetry();
1313
1485
  this.abortCompaction();
1314
1486
  this.abortBranchSummary();
@@ -1342,6 +1514,22 @@ export class AgentSession {
1342
1514
  get serviceTier() {
1343
1515
  return this._currentServiceTier;
1344
1516
  }
1517
+ /**
1518
+ * True when the active model is served at the priority ("fast") tier: either the model
1519
+ * itself is configured for it (an `openai` `-fast` catalog variant, a scoped
1520
+ * `provider/id:priority`) or an extension turned fast mode on for this session.
1521
+ *
1522
+ * Display-only: it never feeds request composition, so an extension toggling fast mode
1523
+ * for one provider cannot leak `service_tier` into another provider's payload.
1524
+ * `serviceTier` stays the single request-side source.
1525
+ */
1526
+ isFastModeActive() {
1527
+ return this._sessionFastMode || this._currentServiceTier === "priority";
1528
+ }
1529
+ /** Session-scoped fast-mode indicator; never persisted, reset on session start. */
1530
+ setSessionFastMode(enabled) {
1531
+ this._sessionFastMode = enabled;
1532
+ }
1345
1533
  /**
1346
1534
  * Explicit scoped/favorite tiers win; otherwise fall back to the model's
1347
1535
  * configured serviceTier from models.json/extension compatibility config.
@@ -1683,6 +1871,12 @@ export class AgentSession {
1683
1871
  let messages;
1684
1872
  let titlePrompt;
1685
1873
  let consumedNextTurnMessages;
1874
+ let inputId;
1875
+ const emitInputDisposition = async (disposition) => {
1876
+ if (inputId === undefined)
1877
+ return;
1878
+ await this._extensionRunner.emit({ type: "input_disposition", inputId, disposition });
1879
+ };
1686
1880
  try {
1687
1881
  // Handle extension commands first (execute immediately, even during streaming)
1688
1882
  // Extension commands manage their own LLM interaction via pi.sendMessage()
@@ -1700,9 +1894,11 @@ export class AgentSession {
1700
1894
  let currentText = text;
1701
1895
  let currentImages = options?.images;
1702
1896
  if (this._extensionRunner.hasHandlers("input")) {
1703
- const inputResult = await this._extensionRunner.emitInput(currentText, currentImages, options?.source ?? "interactive", this.isStreaming ? options?.streamingBehavior : undefined);
1897
+ inputId = `${this.sessionManager.getSessionId()}:${++this._nextInputId}`;
1898
+ const inputResult = await this._extensionRunner.emitInput(currentText, currentImages, options?.source ?? "interactive", this.isStreaming ? options?.streamingBehavior : undefined, inputId);
1704
1899
  throwIfCancelled();
1705
1900
  if (inputResult.action === "handled") {
1901
+ await emitInputDisposition("handled");
1706
1902
  promptDisposition?.("handled");
1707
1903
  preflightResult?.(true);
1708
1904
  return;
@@ -1733,6 +1929,7 @@ export class AgentSession {
1733
1929
  else {
1734
1930
  await this._queueSteer(expandedText, currentImages);
1735
1931
  }
1932
+ await emitInputDisposition("queued");
1736
1933
  promptDisposition?.("queued");
1737
1934
  preflightResult?.(true);
1738
1935
  return;
@@ -1750,6 +1947,7 @@ export class AgentSession {
1750
1947
  else {
1751
1948
  await this._queueSteer(expandedText, currentImages);
1752
1949
  }
1950
+ await emitInputDisposition("queued");
1753
1951
  promptDisposition?.("queued");
1754
1952
  preflightResult?.(true);
1755
1953
  return;
@@ -1773,6 +1971,7 @@ export class AgentSession {
1773
1971
  else {
1774
1972
  await this._queueSteer(expandedText, currentImages);
1775
1973
  }
1974
+ await emitInputDisposition("queued");
1776
1975
  promptDisposition?.("queued");
1777
1976
  preflightResult?.(true);
1778
1977
  return;
@@ -1793,6 +1992,7 @@ export class AgentSession {
1793
1992
  else {
1794
1993
  await this._queueSteer(expandedText, currentImages);
1795
1994
  }
1995
+ await emitInputDisposition("queued");
1796
1996
  promptDisposition?.("queued");
1797
1997
  preflightResult?.(true);
1798
1998
  return;
@@ -1866,8 +2066,11 @@ export class AgentSession {
1866
2066
  // next-turn, and before_agent_start additions are also provider-visible,
1867
2067
  // so make one final admission decision against the complete request.
1868
2068
  await this._enforceFinalProviderAdmission(messages);
2069
+ throwIfCancelled();
2070
+ await emitInputDisposition("started");
1869
2071
  }
1870
2072
  catch (error) {
2073
+ await emitInputDisposition("rejected");
1871
2074
  if (consumedNextTurnMessages && consumedNextTurnMessages.length > 0) {
1872
2075
  this._pendingNextTurnMessages = [...consumedNextTurnMessages, ...this._pendingNextTurnMessages];
1873
2076
  }
@@ -1881,7 +2084,6 @@ export class AgentSession {
1881
2084
  if (!messages) {
1882
2085
  return;
1883
2086
  }
1884
- throwIfCancelled();
1885
2087
  promptDisposition?.("started");
1886
2088
  preflightResult?.(true);
1887
2089
  if (options?.thinkingLevel !== undefined) {
@@ -2001,7 +2203,7 @@ export class AgentSession {
2001
2203
  * @param images Optional image attachments to include with the message
2002
2204
  * @throws Error if text is an extension command
2003
2205
  */
2004
- async steer(text, images) {
2206
+ async steer(text, images, recovery) {
2005
2207
  // Check for extension commands (cannot be queued)
2006
2208
  if (text.startsWith("/")) {
2007
2209
  this._throwIfExtensionCommand(text);
@@ -2009,7 +2211,7 @@ export class AgentSession {
2009
2211
  // Expand skill commands and prompt templates
2010
2212
  let expandedText = this._expandSkillCommand(text);
2011
2213
  expandedText = expandPromptTemplate(expandedText, [...this.promptTemplates]);
2012
- await this._queueSteer(expandedText, images);
2214
+ await this._queueSteer(expandedText, images, recovery?.enqueueOrder);
2013
2215
  }
2014
2216
  /**
2015
2217
  * Queue a follow-up message to be processed after the agent finishes.
@@ -2018,7 +2220,7 @@ export class AgentSession {
2018
2220
  * @param images Optional image attachments to include with the message
2019
2221
  * @throws Error if text is an extension command
2020
2222
  */
2021
- async followUp(text, images) {
2223
+ async followUp(text, images, recovery) {
2022
2224
  // Check for extension commands (cannot be queued)
2023
2225
  if (text.startsWith("/")) {
2024
2226
  this._throwIfExtensionCommand(text);
@@ -2026,7 +2228,7 @@ export class AgentSession {
2026
2228
  // Expand skill commands and prompt templates
2027
2229
  let expandedText = this._expandSkillCommand(text);
2028
2230
  expandedText = expandPromptTemplate(expandedText, [...this.promptTemplates]);
2029
- await this._queueFollowUp(expandedText, images);
2231
+ await this._queueFollowUp(expandedText, images, recovery?.enqueueOrder);
2030
2232
  }
2031
2233
  _startSessionTitleGeneration(firstPrompt) {
2032
2234
  if (!this._autoTitleSessions || this.sessionManager.getSessionName() || shouldSkipSessionTitle(firstPrompt)) {
@@ -2100,8 +2302,9 @@ export class AgentSession {
2100
2302
  /**
2101
2303
  * Internal: Queue a steering message (already expanded, no extension command check).
2102
2304
  */
2103
- async _queueSteer(text, images) {
2305
+ async _queueSteer(text, images, enqueueOrder) {
2104
2306
  this._steeringMessages.push(text);
2307
+ this._recordQueuedInput(text, "steer", enqueueOrder);
2105
2308
  this._sessionLogger.debug("queue_enqueue", { mode: "steer", count: this._steeringMessages.length });
2106
2309
  this._emitQueueUpdate();
2107
2310
  const content = [{ type: "text", text }];
@@ -2118,8 +2321,9 @@ export class AgentSession {
2118
2321
  /**
2119
2322
  * Internal: Queue a follow-up message (already expanded, no extension command check).
2120
2323
  */
2121
- async _queueFollowUp(text, images) {
2324
+ async _queueFollowUp(text, images, enqueueOrder) {
2122
2325
  this._followUpMessages.push(text);
2326
+ this._recordQueuedInput(text, "followUp", enqueueOrder);
2123
2327
  this._sessionLogger.debug("queue_enqueue", { mode: "followUp", count: this._followUpMessages.length });
2124
2328
  this._emitQueueUpdate();
2125
2329
  const content = [{ type: "text", text }];
@@ -2212,8 +2416,23 @@ export class AgentSession {
2212
2416
  }
2213
2417
  }
2214
2418
  else if (options?.triggerTurn) {
2215
- await this._enforceCompactionBeforeProvider(this._findLastAssistantMessage(), false, "pre_prompt");
2216
- await this._enforceFinalProviderAdmission([appMessage]);
2419
+ try {
2420
+ await this._enforceCompactionBeforeProvider(this._findLastAssistantMessage(), false, "pre_prompt");
2421
+ await this._enforceFinalProviderAdmission([appMessage]);
2422
+ }
2423
+ catch (error) {
2424
+ // Mirror sendUserMessage's retention contract: an admission
2425
+ // rejection must retain the message for later delivery instead
2426
+ // of silently dropping it (the fire-and-forget extension action
2427
+ // swallows this rejection).
2428
+ if (options.deliverAs === "followUp") {
2429
+ this.agent.followUp(appMessage);
2430
+ }
2431
+ else {
2432
+ this.agent.steer(appMessage);
2433
+ }
2434
+ throw error;
2435
+ }
2217
2436
  await this._promptAgent(appMessage);
2218
2437
  }
2219
2438
  else {
@@ -2311,26 +2530,46 @@ export class AgentSession {
2311
2530
  finishSessionWork?.();
2312
2531
  }
2313
2532
  }
2533
+ /** Reserve a global order for input temporarily owned outside the native queues. */
2534
+ reserveQueuedInputOrder() {
2535
+ this._nextQueuedInputOrder += 1;
2536
+ return this._nextQueuedInputOrder;
2537
+ }
2538
+ _recordQueuedInput(text, mode, enqueueOrder) {
2539
+ const order = enqueueOrder ?? this.reserveQueuedInputOrder();
2540
+ this._nextQueuedInputOrder = Math.max(this._nextQueuedInputOrder, order);
2541
+ this._queuedInputOrder.push({ text, mode, enqueueOrder: order });
2542
+ }
2543
+ _removeQueuedInput(text, mode) {
2544
+ const index = this._queuedInputOrder.findIndex((message) => message.mode === mode && message.text === text);
2545
+ if (index !== -1)
2546
+ this._queuedInputOrder.splice(index, 1);
2547
+ }
2314
2548
  /**
2315
- * Clear all queued messages and return them.
2316
- * Useful for restoring to editor when user aborts.
2317
- * @returns Object with steering and followUp arrays
2549
+ * Clear all queued messages and return them. The non-enumerable `ordered`
2550
+ * view preserves legacy object equality and native queue semantics.
2551
+ * @param options.abortWillFollow Mark a non-empty drain so an immediately following abort can emit session_abort.
2318
2552
  */
2319
- clearQueue() {
2553
+ clearQueue(options = { abortWillFollow: false }) {
2320
2554
  const steering = [...this._steeringMessages];
2321
2555
  const followUp = [...this._followUpMessages];
2322
- if (steering.length > 0 || followUp.length > 0)
2556
+ const ordered = [...this._queuedInputOrder].sort((a, b) => a.enqueueOrder - b.enqueueOrder);
2557
+ if (options.abortWillFollow && (steering.length > 0 || followUp.length > 0)) {
2323
2558
  this._hadClearedQueuedMessages = true;
2559
+ }
2324
2560
  // Clear every queue synchronously. Deferred post-compaction messages are
2325
2561
  // already represented in visible bookkeeping, so they must not be returned
2326
2562
  // a second time or later resurrected into Agent's native queues.
2327
2563
  this._steeringMessages = [];
2328
2564
  this._followUpMessages = [];
2565
+ this._queuedInputOrder = [];
2329
2566
  this._postCompactionDeferredSteeringMessages = [];
2330
2567
  this._postCompactionDeferredFollowUpMessages = [];
2331
2568
  this.agent.clearAllQueues();
2332
2569
  this._emitQueueUpdate();
2333
- return { steering, followUp };
2570
+ const cleared = { steering, followUp };
2571
+ Object.defineProperty(cleared, "ordered", { value: ordered, enumerable: false });
2572
+ return cleared;
2334
2573
  }
2335
2574
  /** Number of pending messages (includes both steering and follow-up) */
2336
2575
  get pendingMessageCount() {
@@ -2448,6 +2687,7 @@ export class AgentSession {
2448
2687
  // A manual model change abandons any active fallback window; if a fallback
2449
2688
  // retry sleep is still pending, cancel it so no surprise continuation fires.
2450
2689
  const hadActiveFallback = this._retryFallback.activeState !== undefined;
2690
+ this._probeBackScheduler.cancel("manual-model-change");
2451
2691
  this._retryFallback.clearForManualModelChange(model);
2452
2692
  if (hadActiveFallback && this._retryAbortController) {
2453
2693
  this.abortRetry();
@@ -2476,6 +2716,8 @@ export class AgentSession {
2476
2716
  }
2477
2717
  const thinkingLevel = this._getThinkingLevelForModelSwitch(opts.ephemeralThinkingLevel);
2478
2718
  this.agent.state.model = model;
2719
+ this.agent.abortServerSideFallback =
2720
+ this.settingsManager.getAbortServerSideFallback() && this._retryFallback.hasConfiguredChain();
2479
2721
  if (opts.appendSessionEntry) {
2480
2722
  this.sessionManager.appendModelChange(model.provider, model.id, opts.entryReason, previousModel?.provider, previousModel?.id);
2481
2723
  }
@@ -2487,9 +2729,6 @@ export class AgentSession {
2487
2729
  if (opts.ephemeralThinkingLevel !== undefined) {
2488
2730
  this._applyEphemeralThinkingLevel(thinkingLevel);
2489
2731
  }
2490
- else if (opts.persistDefault) {
2491
- this.setThinkingLevel(thinkingLevel);
2492
- }
2493
2732
  else {
2494
2733
  this.setSessionThinkingLevel(thinkingLevel);
2495
2734
  }
@@ -2536,6 +2775,7 @@ export class AgentSession {
2536
2775
  if (invalidatesCompaction) {
2537
2776
  this._invalidateCompactionForModelSelection();
2538
2777
  }
2778
+ this._probeBackScheduler.cancel("manual-model-change");
2539
2779
  this._retryFallback.clearForManualModelChange(next.model);
2540
2780
  const thinkingLevel = this._getThinkingLevelForModelSwitch(next.thinkingLevel);
2541
2781
  this.agent.state.model = next.model;
@@ -2543,10 +2783,10 @@ export class AgentSession {
2543
2783
  this.settingsManager.setDefaultModelAndProvider(next.model.provider, next.model.id);
2544
2784
  this._currentServiceTier = this._resolveServiceTier(next.model, next.serviceTier);
2545
2785
  // Apply thinking level.
2546
- // - Explicit favorite model thinking level overrides current session level
2547
- // - Undefined favorite model thinking level inherits the current session preference
2548
- // setThinkingLevel clamps to model capabilities.
2549
- this.setThinkingLevel(thinkingLevel);
2786
+ // - Explicit favorite model thinking level overrides the effective session level
2787
+ // - Undefined favorite model thinking level restores the remembered user preference
2788
+ // setSessionThinkingLevel clamps without replacing that preference.
2789
+ this.setSessionThinkingLevel(thinkingLevel);
2550
2790
  const systemPromptChange = await this._emitModelSelect(next.model, currentModel, "cycle");
2551
2791
  const cycleResult = { model: next.model, thinkingLevel: this.thinkingLevel, isScoped: true };
2552
2792
  if (systemPromptChange) {
@@ -2599,15 +2839,12 @@ export class AgentSession {
2599
2839
  _emitHighReasoningWarningIfNeeded() {
2600
2840
  const model = this.model;
2601
2841
  const level = this.thinkingLevel;
2602
- if (!model || !shouldWarnHighReasoning(model, level)) {
2603
- this._lastHighReasoningWarningKey = undefined;
2842
+ if (!model || !shouldWarnHighReasoning(model, level))
2604
2843
  return;
2605
- }
2606
- const key = `${model.provider}/${model.id}:${level}`;
2607
- if (this._lastHighReasoningWarningKey === key) {
2844
+ const key = `${model.provider}/${model.id}`;
2845
+ if (this._shownHighReasoningWarningKeys.has(key))
2608
2846
  return;
2609
- }
2610
- this._lastHighReasoningWarningKey = key;
2847
+ this._shownHighReasoningWarningKeys.add(key);
2611
2848
  this._emit({
2612
2849
  type: "high_reasoning_warning",
2613
2850
  modelId: model.id,
@@ -2660,10 +2897,7 @@ export class AgentSession {
2660
2897
  if (explicitLevel !== undefined) {
2661
2898
  return explicitLevel;
2662
2899
  }
2663
- if (!this.supportsThinking()) {
2664
- return this.settingsManager.getDefaultThinkingLevel() ?? DEFAULT_THINKING_LEVEL;
2665
- }
2666
- return this.thinkingLevel;
2900
+ return this.settingsManager.getDefaultThinkingLevel() ?? this.thinkingLevel ?? DEFAULT_THINKING_LEVEL;
2667
2901
  }
2668
2902
  _clampThinkingLevel(level, availableLevels) {
2669
2903
  const available = new Set(availableLevels);
@@ -2803,6 +3037,7 @@ export class AgentSession {
2803
3037
  async compact(customInstructions) {
2804
3038
  const admission = this._claimPendingCompactionAdmission();
2805
3039
  const controller = admission.controller;
3040
+ const requestId = randomUUID();
2806
3041
  let outcome = "failed";
2807
3042
  let disconnected = false;
2808
3043
  try {
@@ -2812,11 +3047,12 @@ export class AgentSession {
2812
3047
  await this._abortActiveAgentAndRetry("system");
2813
3048
  this._disconnectFromAgent();
2814
3049
  disconnected = true;
2815
- this._emit({ type: "compaction_start", reason: "manual" });
3050
+ this._emit({ type: "compaction_start", reason: "manual", requestId });
2816
3051
  const execution = await this._executeCompaction({
2817
3052
  controller,
2818
3053
  owner: "compaction",
2819
3054
  reason: "manual",
3055
+ requestId,
2820
3056
  customInstructions,
2821
3057
  willRetry: false,
2822
3058
  });
@@ -2842,6 +3078,7 @@ export class AgentSession {
2842
3078
  result: undefined,
2843
3079
  aborted,
2844
3080
  willRetry: false,
3081
+ requestId,
2845
3082
  errorMessage: aborted ? undefined : `Compaction failed: ${message}`,
2846
3083
  });
2847
3084
  throw error;
@@ -2853,6 +3090,8 @@ export class AgentSession {
2853
3090
  this._releasePendingCompactionAdmission(admission, outcome);
2854
3091
  if (disconnected && !this.isCompacting)
2855
3092
  this._reconnectToAgent();
3093
+ if (outcome === "completed")
3094
+ this._resumeQueuedMessagesAfterCompaction();
2856
3095
  }
2857
3096
  }
2858
3097
  async applyCompaction(precomputed, options) {
@@ -2863,9 +3102,13 @@ export class AgentSession {
2863
3102
  return { applied: false, reason: "stale" };
2864
3103
  }
2865
3104
  const ownsController = this._compactionAbortController === undefined;
3105
+ const lifecycleState = this._compactionLifecycle.state;
3106
+ const requestId = !ownsController && lifecycleState.status === "running" && lifecycleState.stage === "feedback"
3107
+ ? lifecycleState.operationId
3108
+ : randomUUID();
2866
3109
  if (ownsController) {
2867
3110
  this._claimCompactionController(new AbortController(), "compaction");
2868
- this._emit({ type: "compaction_start", reason: options.reason });
3111
+ this._emit({ type: "compaction_start", reason: options.reason, requestId });
2869
3112
  }
2870
3113
  const controller = this._compactionAbortController;
2871
3114
  if (!controller)
@@ -2876,12 +3119,14 @@ export class AgentSession {
2876
3119
  controller,
2877
3120
  owner: "compaction",
2878
3121
  reason: options.reason,
3122
+ requestId,
2879
3123
  willRetry: false,
2880
3124
  precomputed,
2881
3125
  });
2882
3126
  if (!execution.accepted) {
2883
3127
  return { applied: false, reason: "rejected" };
2884
3128
  }
3129
+ this._resumeQueuedMessagesAfterCompaction();
2885
3130
  return { applied: true, reason: "ok" };
2886
3131
  }
2887
3132
  catch (error) {
@@ -2896,6 +3141,7 @@ export class AgentSession {
2896
3141
  result: undefined,
2897
3142
  aborted,
2898
3143
  willRetry: false,
3144
+ requestId,
2899
3145
  errorMessage: aborted ? undefined : `Compaction failed: ${message}`,
2900
3146
  });
2901
3147
  return { applied: false, reason: "rejected" };
@@ -2910,14 +3156,15 @@ export class AgentSession {
2910
3156
  const controller = new AbortController();
2911
3157
  this._claimCompactionController(controller, "compaction");
2912
3158
  const model = this.model;
3159
+ const requestId = randomUUID();
2913
3160
  this._compactionLifecycle.begin({
2914
- operationId: randomUUID(),
3161
+ operationId: requestId,
2915
3162
  stage: "feedback",
2916
3163
  reason,
2917
3164
  model: model ? { provider: model.provider, id: model.id } : undefined,
2918
3165
  startedRevision: this._messageRevision,
2919
3166
  }, controller);
2920
- this._emit({ type: "compaction_start", reason });
3167
+ this._emit({ type: "compaction_start", reason, requestId });
2921
3168
  return controller.signal;
2922
3169
  }
2923
3170
  _updateExtensionCompactionFeedback(options) {
@@ -2955,7 +3202,8 @@ export class AgentSession {
2955
3202
  result: undefined,
2956
3203
  aborted,
2957
3204
  willRetry: false,
2958
- errorMessage: aborted ? undefined : options.errorMessage,
3205
+ requestId: operation.operationId,
3206
+ errorMessage: aborted ? undefined : (options.errorMessage ?? "Compaction did not apply"),
2959
3207
  });
2960
3208
  this._releaseCompactionController(options.signal);
2961
3209
  }
@@ -2970,7 +3218,7 @@ export class AgentSession {
2970
3218
  if (!this._ownsCompactionController(controller, request.owner)) {
2971
3219
  throw new CompactionExecutionError(new CompactionCancelledError(), false, true);
2972
3220
  }
2973
- const requestId = randomUUID();
3221
+ const requestId = request.requestId ?? randomUUID();
2974
3222
  const operationId = this._compactionLifecycle.begin({
2975
3223
  operationId: requestId,
2976
3224
  stage: "execution",
@@ -3225,6 +3473,10 @@ export class AgentSession {
3225
3473
  * Cancel in-progress compaction (manual or auto).
3226
3474
  */
3227
3475
  abortCompaction() {
3476
+ const lifecycleState = this._compactionLifecycle.state;
3477
+ const activeFeedbackRequestId = lifecycleState.status === "running" && lifecycleState.stage === "feedback"
3478
+ ? lifecycleState.operationId
3479
+ : undefined;
3228
3480
  const feedbackOperation = this._compactionLifecycle.abort(this._messageRevision);
3229
3481
  this._compactionAbortController?.abort();
3230
3482
  this._autoCompactionAbortController?.abort();
@@ -3236,6 +3488,7 @@ export class AgentSession {
3236
3488
  result: undefined,
3237
3489
  aborted: true,
3238
3490
  willRetry: false,
3491
+ requestId: activeFeedbackRequestId,
3239
3492
  });
3240
3493
  }
3241
3494
  }
@@ -3287,6 +3540,8 @@ export class AgentSession {
3287
3540
  if (compacted)
3288
3541
  return true;
3289
3542
  }
3543
+ if (this._isCompactionOnCooldown())
3544
+ return false;
3290
3545
  throw new RequiredCompactionError();
3291
3546
  }
3292
3547
  /**
@@ -3325,6 +3580,8 @@ export class AgentSession {
3325
3580
  throw new RequiredCompactionError();
3326
3581
  }
3327
3582
  const compacted = await this._runPrePromptCompaction(lastAssistantMessage, false, "pre_prompt");
3583
+ if (!compacted && !isOversized() && this._isCompactionOnCooldown())
3584
+ return;
3328
3585
  if (!compacted || isOversized()) {
3329
3586
  throw new RequiredCompactionError();
3330
3587
  }
@@ -3470,15 +3727,21 @@ export class AgentSession {
3470
3727
  }
3471
3728
  return false;
3472
3729
  }
3730
+ _isCompactionOnCooldown() {
3731
+ const state = this._compactionLifecycle.state;
3732
+ return state.status === "failed" && state.rejectionCause === "circuit-breaker";
3733
+ }
3473
3734
  async _runPrePromptCompaction(lastAssistantMessage, skipAbortedCheck, reason = "pre_prompt", willRetry = false, allowSummaryOnly = false) {
3474
3735
  const controller = new AbortController();
3736
+ const requestId = randomUUID();
3475
3737
  this._claimCompactionController(controller, "compaction");
3476
- this._emit({ type: "compaction_start", reason });
3738
+ this._emit({ type: "compaction_start", reason, requestId });
3477
3739
  try {
3478
3740
  const execution = await this._executeCompaction({
3479
3741
  controller,
3480
3742
  owner: "compaction",
3481
3743
  reason,
3744
+ requestId,
3482
3745
  willRetry,
3483
3746
  lastAssistantMessage,
3484
3747
  skipAbortedCheck,
@@ -3506,6 +3769,7 @@ export class AgentSession {
3506
3769
  result: undefined,
3507
3770
  aborted,
3508
3771
  willRetry: false,
3772
+ requestId,
3509
3773
  errorMessage: aborted ? undefined : `Pre-prompt compaction failed: ${errorMessage}`,
3510
3774
  });
3511
3775
  return false;
@@ -3530,8 +3794,11 @@ export class AgentSession {
3530
3794
  if (!shouldCompact(contextTokens, model.contextWindow, settings))
3531
3795
  return;
3532
3796
  const compacted = await this._runPrePromptCompaction(this._findLastAssistantMessage(), true, "pre_prompt");
3533
- if (!compacted)
3797
+ if (!compacted) {
3798
+ if (this._isCompactionOnCooldown())
3799
+ return;
3534
3800
  throw new RequiredCompactionError();
3801
+ }
3535
3802
  this._scheduledContinuationRecompacted = true;
3536
3803
  }
3537
3804
  async _continueAgentAfterCurrentRun(options = {}) {
@@ -3570,6 +3837,18 @@ export class AgentSession {
3570
3837
  this._scheduledContinuationRecompacted = false;
3571
3838
  }
3572
3839
  }
3840
+ /**
3841
+ * Mirror _runAutoCompaction's post-success recovery for non-auto compaction
3842
+ * owners (manual, extension action, extension apply): a custom triggerTurn
3843
+ * message sent while the compaction was running is parked in the agent-level
3844
+ * queues without starting a turn, so a settled compaction must deliver it or
3845
+ * hidden continuations (e.g. goal) wedge until manual user input.
3846
+ */
3847
+ _resumeQueuedMessagesAfterCompaction() {
3848
+ if (this.pendingMessageCount > 0 || this.agent.hasQueuedMessages()) {
3849
+ this._scheduleContinuationAfterCurrentEvent();
3850
+ }
3851
+ }
3573
3852
  _scheduleContinuationAfterCurrentEvent(options = {}, retryContinuation = false) {
3574
3853
  // Tool hooks wait for queued message persistence, so continue() cannot run inside this event promise.
3575
3854
  const currentEventQueue = this._agentEventQueue;
@@ -3603,9 +3882,10 @@ export class AgentSession {
3603
3882
  const finishCompactionWork = this._sessionWorkBarrier.begin();
3604
3883
  const agentMessagesAtStart = this.agent.state.messages.slice();
3605
3884
  const autoCompactionController = new AbortController();
3885
+ const requestId = randomUUID();
3606
3886
  this._claimCompactionController(autoCompactionController, "auto");
3607
3887
  const endBeforeExecution = () => {
3608
- this._emit({ type: "compaction_start", reason });
3888
+ this._emit({ type: "compaction_start", reason, requestId });
3609
3889
  if (reason === "overflow" && this._autoCompactionAbortController === autoCompactionController) {
3610
3890
  this._overflowRecoveryAttempted = false;
3611
3891
  }
@@ -3622,6 +3902,7 @@ export class AgentSession {
3622
3902
  result: undefined,
3623
3903
  aborted: autoCompactionController.signal.aborted,
3624
3904
  willRetry: false,
3905
+ requestId,
3625
3906
  });
3626
3907
  return false;
3627
3908
  };
@@ -3649,11 +3930,12 @@ export class AgentSession {
3649
3930
  }
3650
3931
  if (!this._ownsCompactionController(autoCompactionController, "auto"))
3651
3932
  return false;
3652
- this._emit({ type: "compaction_start", reason });
3933
+ this._emit({ type: "compaction_start", reason, requestId });
3653
3934
  const execution = await this._executeCompaction({
3654
3935
  controller: autoCompactionController,
3655
3936
  owner: "auto",
3656
3937
  reason,
3938
+ requestId,
3657
3939
  willRetry,
3658
3940
  agentMessagesAtStart,
3659
3941
  });
@@ -3699,6 +3981,7 @@ export class AgentSession {
3699
3981
  result: undefined,
3700
3982
  aborted,
3701
3983
  willRetry: false,
3984
+ requestId,
3702
3985
  errorMessage: aborted
3703
3986
  ? undefined
3704
3987
  : reason === "overflow"
@@ -3909,10 +4192,13 @@ export class AgentSession {
3909
4192
  return true;
3910
4193
  },
3911
4194
  setSessionThinkingLevel: (level) => this.setSessionThinkingLevel(level),
4195
+ setSessionFastMode: (enabled) => this.setSessionFastMode(enabled),
3912
4196
  }, {
3913
4197
  getModel: () => this.model,
3914
4198
  getServiceTier: () => this.serviceTier,
4199
+ getScopedModels: () => this._scopedModels,
3915
4200
  isIdle: () => this.isIdle,
4201
+ getAgentDir: () => this._agentDir,
3916
4202
  isProjectTrusted: () => this.settingsManager.isProjectTrusted(),
3917
4203
  getSignal: () => this._extensionEventSignal ?? this.agent.signal,
3918
4204
  abort: () => {
@@ -3977,23 +4263,27 @@ export class AgentSession {
3977
4263
  compact: (options) => {
3978
4264
  const admission = this._claimPendingCompactionAdmission();
3979
4265
  const controller = admission.controller;
4266
+ const requestId = randomUUID();
3980
4267
  void (async () => {
3981
4268
  let outcome = "failed";
4269
+ let compactionCompleted = false;
3982
4270
  let disconnected = false;
3983
4271
  try {
3984
4272
  await this._abortActiveAgentAndRetry("system");
3985
4273
  this._disconnectFromAgent();
3986
4274
  disconnected = true;
3987
- this._emit({ type: "compaction_start", reason: "extension" });
4275
+ this._emit({ type: "compaction_start", reason: "extension", requestId });
3988
4276
  const execution = await this._executeCompaction({
3989
4277
  controller,
3990
4278
  owner: "compaction",
3991
4279
  reason: "extension",
4280
+ requestId,
3992
4281
  customInstructions: options?.customInstructions,
3993
4282
  willRetry: false,
3994
4283
  });
3995
4284
  if (execution.accepted) {
3996
4285
  outcome = "completed";
4286
+ compactionCompleted = true;
3997
4287
  options?.onComplete?.(execution.result);
3998
4288
  }
3999
4289
  else {
@@ -4014,6 +4304,7 @@ export class AgentSession {
4014
4304
  result: undefined,
4015
4305
  aborted,
4016
4306
  willRetry: false,
4307
+ requestId,
4017
4308
  errorMessage: aborted ? undefined : `Compaction failed: ${message}`,
4018
4309
  });
4019
4310
  const err = error instanceof Error ? error : new Error(String(error));
@@ -4027,6 +4318,10 @@ export class AgentSession {
4027
4318
  this._releasePendingCompactionAdmission(admission, outcome);
4028
4319
  if (disconnected && !this.isCompacting)
4029
4320
  this._reconnectToAgent();
4321
+ // A throwing onComplete consumer overwrites outcome in the catch
4322
+ // block, so recovery keys off whether compaction itself succeeded.
4323
+ if (compactionCompleted)
4324
+ this._resumeQueuedMessagesAfterCompaction();
4030
4325
  }
4031
4326
  })();
4032
4327
  },
@@ -4288,32 +4583,11 @@ export class AgentSession {
4288
4583
  this._retryFallback.canTryFallback());
4289
4584
  }
4290
4585
  _getProviderRetryDelayMs(errorMessage) {
4291
- const retryAfterMsMatch = errorMessage.match(/\bretry[-_ ]?after[-_ ]?ms\s*[:=]\s*(\d+(?:\.\d+)?)/i);
4292
- if (retryAfterMsMatch) {
4293
- const delayMs = Math.ceil(Number(retryAfterMsMatch[1]));
4294
- return Number.isFinite(delayMs) && delayMs > 0 ? delayMs : undefined;
4295
- }
4296
- const retryAfterSecondsMatch = errorMessage.match(/\bretry[-_ ]?after\s*[:=]\s*(\d+(?:\.\d+)?)/i);
4297
- if (retryAfterSecondsMatch) {
4298
- const delayMs = Math.ceil(Number(retryAfterSecondsMatch[1]) * 1000);
4299
- return Number.isFinite(delayMs) && delayMs > 0 ? delayMs : undefined;
4300
- }
4301
- 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);
4302
- if (!retryInMatch) {
4303
- return undefined;
4304
- }
4305
- const value = Number(retryInMatch[1]);
4306
- if (!Number.isFinite(value) || value <= 0) {
4307
- return undefined;
4308
- }
4309
- const unit = retryInMatch[2].toLowerCase();
4310
- if (unit === "m" || unit.startsWith("min")) {
4311
- return Math.ceil(value * 60_000);
4312
- }
4313
- if (unit.startsWith("s")) {
4314
- return Math.ceil(value * 1000);
4315
- }
4316
- return Math.ceil(value);
4586
+ const markerMs = parseRetryAfterMsMarker(errorMessage);
4587
+ if (markerMs !== undefined)
4588
+ return markerMs;
4589
+ const hintMs = extract429RetryAfterMs({ bodyText: errorMessage });
4590
+ return hintMs;
4317
4591
  }
4318
4592
  _getProviderTimeoutRetryOptions(message) {
4319
4593
  if (!isProviderTimeoutError(message))
@@ -4381,6 +4655,8 @@ export class AgentSession {
4381
4655
  const isRefusal = isClassifierRefusal(message);
4382
4656
  const hardErrorFallback = options.hardErrorFallback === true;
4383
4657
  let switchedFallback = false;
4658
+ let is429TierRouted = false;
4659
+ let hintTierDelayMs;
4384
4660
  if (hardErrorFallback) {
4385
4661
  // A non-retryable provider failure must never replay on the same model.
4386
4662
  // Billing-class failures never recover on this account, so the fallback
@@ -4398,6 +4674,16 @@ export class AgentSession {
4398
4674
  // Refusals are only retried through a new chain candidate. They never use
4399
4675
  // same-model retries or the transient over-budget fallback escape hatch.
4400
4676
  if (this._retryAttempt + 1 > settings.maxRetries) {
4677
+ if (this._retryAttempt > 0) {
4678
+ this._emit({
4679
+ type: "auto_retry_end",
4680
+ success: false,
4681
+ attempt: this._retryAttempt,
4682
+ finalError: message.errorMessage,
4683
+ });
4684
+ }
4685
+ this._retryAttempt = 0;
4686
+ this._resetHintTierState();
4401
4687
  this._resolveRetry();
4402
4688
  return "not-handled";
4403
4689
  }
@@ -4407,6 +4693,16 @@ export class AgentSession {
4407
4693
  if (exhaustedChainKey) {
4408
4694
  this._emit({ type: "retry_fallback_exhausted", chainKey: exhaustedChainKey, lastError: errorMessage });
4409
4695
  }
4696
+ if (this._retryAttempt > 0) {
4697
+ this._emit({
4698
+ type: "auto_retry_end",
4699
+ success: false,
4700
+ attempt: this._retryAttempt,
4701
+ finalError: message.errorMessage,
4702
+ });
4703
+ }
4704
+ this._retryAttempt = 0;
4705
+ this._resetHintTierState();
4410
4706
  this._resolveRetry();
4411
4707
  return "not-handled";
4412
4708
  }
@@ -4426,8 +4722,159 @@ export class AgentSession {
4426
4722
  const stallError = isProviderStreamStallError(message);
4427
4723
  const escalateAfterRepeatedStall = stallError && this._consecutiveProviderStreamStalls > 0;
4428
4724
  this._consecutiveProviderStreamStalls = stallError ? this._consecutiveProviderStreamStalls + 1 : 0;
4429
- this._retryAttempt++;
4430
- if (this._retryAttempt > settings.maxRetries || escalateAfterRepeatedStall) {
4725
+ // 429-class detection: retryable AND message carries rate-limit markers.
4726
+ const is429Class = !stallError &&
4727
+ /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);
4728
+ if (is429Class) {
4729
+ const hintMs = this._getProviderRetryDelayMs(errorMessage);
4730
+ const hintSettings = this.settingsManager.getHintPolicySettings();
4731
+ const tier = classifyRateLimitedWait(hintMs, hintSettings);
4732
+ is429TierRouted = true;
4733
+ if (tier === "no-hint-fast-fallback") {
4734
+ // Skip same-model retries entirely; fall back immediately.
4735
+ switchedFallback = await this._retryFallback.tryFallback("transient", { errorMessage });
4736
+ if (switchedFallback) {
4737
+ this._retryAttempt = 1;
4738
+ }
4739
+ else {
4740
+ const exhaustedChainKey = this._retryFallback.exhaustedChainKey;
4741
+ if (exhaustedChainKey) {
4742
+ this._emit({
4743
+ type: "retry_fallback_exhausted",
4744
+ chainKey: exhaustedChainKey,
4745
+ lastError: errorMessage,
4746
+ });
4747
+ }
4748
+ this._emit({
4749
+ type: "auto_retry_end",
4750
+ success: false,
4751
+ attempt: 0,
4752
+ finalError: message.errorMessage,
4753
+ });
4754
+ this._retryAttempt = 0;
4755
+ this._resetHintTierState();
4756
+ this._resolveRetry();
4757
+ return "not-handled";
4758
+ }
4759
+ }
4760
+ else if (tier === "tier1-in-turn") {
4761
+ this._retryAttempt++;
4762
+ if (this._retryAttempt > settings.maxRetries) {
4763
+ // Budget exhausted within tier1; fall back.
4764
+ switchedFallback = await this._retryFallback.tryFallback("transient", {
4765
+ errorMessage,
4766
+ retryAfterMs: this._getProviderRetryDelayMs(errorMessage),
4767
+ });
4768
+ if (switchedFallback) {
4769
+ this._retryAttempt = 1;
4770
+ }
4771
+ else {
4772
+ const exhaustedChainKey = this._retryFallback.exhaustedChainKey;
4773
+ if (exhaustedChainKey) {
4774
+ this._emit({
4775
+ type: "retry_fallback_exhausted",
4776
+ chainKey: exhaustedChainKey,
4777
+ lastError: errorMessage,
4778
+ });
4779
+ }
4780
+ this._emit({
4781
+ type: "auto_retry_end",
4782
+ success: false,
4783
+ attempt: this._retryAttempt - 1,
4784
+ finalError: message.errorMessage,
4785
+ });
4786
+ this._retryAttempt = 0;
4787
+ this._resetHintTierState();
4788
+ this._resolveRetry();
4789
+ return "not-handled";
4790
+ }
4791
+ }
4792
+ else {
4793
+ const inTurnResult = nextInTurnDelayMs({
4794
+ probePhase: this._probePhase,
4795
+ hintDeadlineMs: this._hintDeadlineMs,
4796
+ attempt: this._retryAttempt,
4797
+ cumulativeHintedWaitMs: this._cumulativeHintedWaitMs,
4798
+ }, hintMs, settings.baseDelayMs, hintSettings.hintedWaitCapMs, Date.now());
4799
+ this._probePhase = inTurnResult.probePhase;
4800
+ this._hintDeadlineMs = inTurnResult.hintDeadlineMs;
4801
+ this._cumulativeHintedWaitMs = inTurnResult.cumulativeHintedWaitMs;
4802
+ if (inTurnResult.demoteToProbeBack) {
4803
+ // Cumulative hinted wait exceeded cap; demote to tier2 fallback path.
4804
+ const remainingHintMs = Math.max(0, (this._hintDeadlineMs ?? Date.now()) - Date.now());
4805
+ switchedFallback = await this._retryFallback.tryFallback("transient", {
4806
+ errorMessage,
4807
+ retryAfterMs: remainingHintMs,
4808
+ });
4809
+ if (switchedFallback) {
4810
+ this._retryAttempt = 1;
4811
+ }
4812
+ else {
4813
+ const exhaustedChainKey = this._retryFallback.exhaustedChainKey;
4814
+ if (exhaustedChainKey) {
4815
+ this._emit({
4816
+ type: "retry_fallback_exhausted",
4817
+ chainKey: exhaustedChainKey,
4818
+ lastError: errorMessage,
4819
+ });
4820
+ }
4821
+ this._emit({
4822
+ type: "auto_retry_end",
4823
+ success: false,
4824
+ attempt: this._retryAttempt - 1,
4825
+ finalError: message.errorMessage,
4826
+ });
4827
+ this._retryAttempt = 0;
4828
+ this._resetHintTierState();
4829
+ this._resolveRetry();
4830
+ return "not-handled";
4831
+ }
4832
+ }
4833
+ else {
4834
+ hintTierDelayMs = inTurnResult.delayMs;
4835
+ }
4836
+ }
4837
+ }
4838
+ else {
4839
+ // tier2-fallback-probe-back or tier3-fallback-only: immediate fallback.
4840
+ const remainingHintMs = hintMs ?? 0;
4841
+ switchedFallback = await this._retryFallback.tryFallback("transient", {
4842
+ errorMessage,
4843
+ retryAfterMs: remainingHintMs,
4844
+ });
4845
+ if (switchedFallback) {
4846
+ this._retryAttempt = 1;
4847
+ if (tier === "tier2-fallback-probe-back") {
4848
+ const selector = this._retryFallback.activeState?.originalSelector ?? "";
4849
+ this._armProbeBackForDemotedSelector(selector, remainingHintMs);
4850
+ }
4851
+ }
4852
+ else {
4853
+ const exhaustedChainKey = this._retryFallback.exhaustedChainKey;
4854
+ if (exhaustedChainKey) {
4855
+ this._emit({
4856
+ type: "retry_fallback_exhausted",
4857
+ chainKey: exhaustedChainKey,
4858
+ lastError: errorMessage,
4859
+ });
4860
+ }
4861
+ this._emit({
4862
+ type: "auto_retry_end",
4863
+ success: false,
4864
+ attempt: 0,
4865
+ finalError: message.errorMessage,
4866
+ });
4867
+ this._retryAttempt = 0;
4868
+ this._resetHintTierState();
4869
+ this._resolveRetry();
4870
+ return "not-handled";
4871
+ }
4872
+ }
4873
+ }
4874
+ if (!is429TierRouted) {
4875
+ this._retryAttempt++;
4876
+ }
4877
+ if (!is429TierRouted && (this._retryAttempt > settings.maxRetries || escalateAfterRepeatedStall)) {
4431
4878
  switchedFallback = await this._retryFallback.tryFallback("transient", {
4432
4879
  errorMessage,
4433
4880
  retryAfterMs: this._getProviderRetryDelayMs(errorMessage),
@@ -4452,6 +4899,7 @@ export class AgentSession {
4452
4899
  finalError: message.errorMessage,
4453
4900
  });
4454
4901
  this._retryAttempt = 0;
4902
+ this._resetHintTierState();
4455
4903
  this._resolveRetry();
4456
4904
  return "not-handled";
4457
4905
  }
@@ -4462,7 +4910,8 @@ export class AgentSession {
4462
4910
  }
4463
4911
  const providerDelayMs = isRefusal || hardErrorFallback ? undefined : this._getProviderRetryDelayMs(errorMessage);
4464
4912
  const maxRetryDelayMs = this.settingsManager.getProviderRetrySettings().maxRetryDelayMs;
4465
- if (providerDelayMs !== undefined && providerDelayMs > maxRetryDelayMs) {
4913
+ // For 429-class failures the tier routing replaces the over-budget gate.
4914
+ if (!is429TierRouted && providerDelayMs !== undefined && providerDelayMs > maxRetryDelayMs) {
4466
4915
  // A wait this long means the model is unavailable rather than busy, so the
4467
4916
  // configured chain beats failing the turn. The switch is gated: the over-budget
4468
4917
  // branch above may have already switched on this same error, and hopping again
@@ -4484,6 +4933,7 @@ export class AgentSession {
4484
4933
  finalError: `Provider requested retry delay ${providerDelayMs}ms, exceeding configured maximum ${maxRetryDelayMs}ms`,
4485
4934
  });
4486
4935
  this._retryAttempt = 0;
4936
+ this._resetHintTierState();
4487
4937
  this._resolveRetry();
4488
4938
  return "not-handled";
4489
4939
  }
@@ -4493,7 +4943,12 @@ export class AgentSession {
4493
4943
  // reach this point with a fallback already applied (hard-error, refusal) set
4494
4944
  // switchedFallback first and force providerDelayMs undefined, so no branch may
4495
4945
  // be reordered to fall through here expecting an implicit switch.
4496
- const delayMs = switchedFallback ? 0 : (providerDelayMs ?? settings.baseDelayMs * 2 ** (this._retryAttempt - 1));
4946
+ const nonTierProviderDelayMs = providerDelayMs === 0 ? undefined : providerDelayMs;
4947
+ const delayMs = switchedFallback
4948
+ ? 0
4949
+ : is429TierRouted
4950
+ ? (hintTierDelayMs ?? providerDelayMs ?? settings.baseDelayMs * 2 ** (this._retryAttempt - 1))
4951
+ : (nonTierProviderDelayMs ?? settings.baseDelayMs * 2 ** (this._retryAttempt - 1));
4497
4952
  // Prepare before auto_retry_start so an immediate Esc can cancel the retry sleep.
4498
4953
  this._retryAbortController = new AbortController();
4499
4954
  this._emit({
@@ -4517,6 +4972,7 @@ export class AgentSession {
4517
4972
  // Aborted during sleep - emit end event so UI can clean up
4518
4973
  const attempt = this._retryAttempt;
4519
4974
  this._retryAttempt = 0;
4975
+ this._resetHintTierState();
4520
4976
  this._retryAbortController = undefined;
4521
4977
  await this._emitAgentSettled();
4522
4978
  this._emit({
@@ -4541,9 +4997,11 @@ export class AgentSession {
4541
4997
  if (compactionSettings.enabled &&
4542
4998
  model &&
4543
4999
  shouldCompact(contextTokens, model.contextWindow, compactionSettings)) {
4544
- if (!(await this._runPrePromptCompaction(message, true, "threshold", true, true))) {
5000
+ const preRetryCompaction = await this._runPrePromptCompaction(message, true, "threshold", true, true);
5001
+ if (!preRetryCompaction && !this._isCompactionOnCooldown()) {
4545
5002
  const attempt = this._retryAttempt;
4546
5003
  this._retryAttempt = 0;
5004
+ this._resetHintTierState();
4547
5005
  this._emit({
4548
5006
  type: "auto_retry_end",
4549
5007
  success: false,
@@ -4612,7 +5070,8 @@ export class AgentSession {
4612
5070
  * @param options.operations Custom BashOperations for remote execution
4613
5071
  */
4614
5072
  async executeBash(command, onChunk, options) {
4615
- this._bashAbortController = new AbortController();
5073
+ const abortController = new AbortController();
5074
+ this._bashAbortControllers.add(abortController);
4616
5075
  // Apply command prefix if configured (e.g., "shopt -s expand_aliases" for alias support)
4617
5076
  const prefix = this.settingsManager.getShellCommandPrefix();
4618
5077
  const shellPath = this.settingsManager.getShellPath();
@@ -4623,13 +5082,13 @@ export class AgentSession {
4623
5082
  onChunk?.(delta);
4624
5083
  this._emit({ type: "bash_execution_update", id: options?.id, delta });
4625
5084
  },
4626
- signal: this._bashAbortController.signal,
5085
+ signal: abortController.signal,
4627
5086
  });
4628
5087
  this.recordBashResult(command, result, options);
4629
5088
  return result;
4630
5089
  }
4631
5090
  finally {
4632
- this._bashAbortController = undefined;
5091
+ this._bashAbortControllers.delete(abortController);
4633
5092
  }
4634
5093
  }
4635
5094
  /**
@@ -4665,11 +5124,13 @@ export class AgentSession {
4665
5124
  * Cancel running bash command.
4666
5125
  */
4667
5126
  abortBash() {
4668
- this._bashAbortController?.abort();
5127
+ for (const abortController of [...this._bashAbortControllers]) {
5128
+ abortController.abort();
5129
+ }
4669
5130
  }
4670
5131
  /** Whether a bash command is currently running */
4671
5132
  get isBashRunning() {
4672
- return this._bashAbortController !== undefined;
5133
+ return this._bashAbortControllers.size > 0;
4673
5134
  }
4674
5135
  /** Whether there are pending bash messages waiting to be flushed */
4675
5136
  get hasPendingBashMessages() {
@@ -4718,6 +5179,9 @@ export class AgentSession {
4718
5179
  * @returns Result with editorText (if user message) and cancelled status
4719
5180
  */
4720
5181
  async navigateTree(targetId, options = {}) {
5182
+ if (this.isStreaming) {
5183
+ throw new Error("Wait for the current response to finish before navigating the session tree.");
5184
+ }
4721
5185
  const oldLeafId = this.sessionManager.getLeafId();
4722
5186
  // No-op if already at target
4723
5187
  if (targetId === oldLeafId) {