@code-yeongyu/senpi 2026.7.31 → 2026.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1370) hide show
  1. package/CHANGELOG.md +270 -0
  2. package/README.md +1 -0
  3. package/dist/cli/args.d.ts +2 -0
  4. package/dist/cli/args.d.ts.map +1 -1
  5. package/dist/cli/args.js +27 -0
  6. package/dist/cli/args.js.map +1 -1
  7. package/dist/cli/credential-print.d.ts +23 -0
  8. package/dist/cli/credential-print.d.ts.map +1 -0
  9. package/dist/cli/credential-print.js +116 -0
  10. package/dist/cli/credential-print.js.map +1 -0
  11. package/dist/client/index.d.ts +3 -0
  12. package/dist/client/index.d.ts.map +1 -0
  13. package/dist/client/index.js +3 -0
  14. package/dist/client/index.js.map +1 -0
  15. package/dist/client/remote-session.d.ts +53 -0
  16. package/dist/client/remote-session.d.ts.map +1 -0
  17. package/dist/client/remote-session.js +340 -0
  18. package/dist/client/remote-session.js.map +1 -0
  19. package/dist/client/transcript.d.ts +12 -0
  20. package/dist/client/transcript.d.ts.map +1 -0
  21. package/dist/client/transcript.js +98 -0
  22. package/dist/client/transcript.js.map +1 -0
  23. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  24. package/dist/core/agent-session-runtime.js +3 -0
  25. package/dist/core/agent-session-runtime.js.map +1 -1
  26. package/dist/core/agent-session.d.ts +85 -14
  27. package/dist/core/agent-session.d.ts.map +1 -1
  28. package/dist/core/agent-session.js +445 -78
  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 +2 -4
  238. package/dist/core/extensions/builtin/goal/continuation.d.ts.map +1 -1
  239. package/dist/core/extensions/builtin/goal/continuation.js +2 -8
  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 +17 -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 +5 -1
  252. package/dist/core/extensions/builtin/goal/monitor-continuation.d.ts.map +1 -1
  253. package/dist/core/extensions/builtin/goal/monitor-continuation.js +94 -52
  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/gpt-apply-patch/apply.d.ts +1 -0
  264. package/dist/core/extensions/builtin/gpt-apply-patch/apply.d.ts.map +1 -1
  265. package/dist/core/extensions/builtin/gpt-apply-patch/apply.js +13 -1
  266. package/dist/core/extensions/builtin/gpt-apply-patch/apply.js.map +1 -1
  267. package/dist/core/extensions/builtin/gpt-apply-patch/extension.d.ts.map +1 -1
  268. package/dist/core/extensions/builtin/gpt-apply-patch/extension.js +15 -0
  269. package/dist/core/extensions/builtin/gpt-apply-patch/extension.js.map +1 -1
  270. package/dist/core/extensions/builtin/gpt-apply-patch/index.d.ts +1 -1
  271. package/dist/core/extensions/builtin/gpt-apply-patch/index.d.ts.map +1 -1
  272. package/dist/core/extensions/builtin/gpt-apply-patch/index.js +1 -1
  273. package/dist/core/extensions/builtin/gpt-apply-patch/index.js.map +1 -1
  274. package/dist/core/extensions/builtin/gpt-apply-patch/tool.d.ts +1 -0
  275. package/dist/core/extensions/builtin/gpt-apply-patch/tool.d.ts.map +1 -1
  276. package/dist/core/extensions/builtin/gpt-apply-patch/tool.js +53 -8
  277. package/dist/core/extensions/builtin/gpt-apply-patch/tool.js.map +1 -1
  278. package/dist/core/extensions/builtin/index.d.ts.map +1 -1
  279. package/dist/core/extensions/builtin/index.js +5 -2
  280. package/dist/core/extensions/builtin/index.js.map +1 -1
  281. package/dist/core/extensions/builtin/loop-guard/detectors.d.ts +31 -0
  282. package/dist/core/extensions/builtin/loop-guard/detectors.d.ts.map +1 -0
  283. package/dist/core/extensions/builtin/loop-guard/detectors.js +152 -0
  284. package/dist/core/extensions/builtin/loop-guard/detectors.js.map +1 -0
  285. package/dist/core/extensions/builtin/loop-guard/index.d.ts +3 -0
  286. package/dist/core/extensions/builtin/loop-guard/index.d.ts.map +1 -0
  287. package/dist/core/extensions/builtin/loop-guard/index.js +31 -0
  288. package/dist/core/extensions/builtin/loop-guard/index.js.map +1 -0
  289. package/dist/core/extensions/builtin/loop-guard/notice.d.ts +5 -0
  290. package/dist/core/extensions/builtin/loop-guard/notice.d.ts.map +1 -0
  291. package/dist/core/extensions/builtin/loop-guard/notice.js +42 -0
  292. package/dist/core/extensions/builtin/loop-guard/notice.js.map +1 -0
  293. package/dist/core/extensions/builtin/loop-guard/policy.d.ts +30 -0
  294. package/dist/core/extensions/builtin/loop-guard/policy.d.ts.map +1 -0
  295. package/dist/core/extensions/builtin/loop-guard/policy.js +30 -0
  296. package/dist/core/extensions/builtin/loop-guard/policy.js.map +1 -0
  297. package/dist/core/extensions/builtin/loop-guard/renderer.d.ts +4 -0
  298. package/dist/core/extensions/builtin/loop-guard/renderer.d.ts.map +1 -0
  299. package/dist/core/extensions/builtin/loop-guard/renderer.js +50 -0
  300. package/dist/core/extensions/builtin/loop-guard/renderer.js.map +1 -0
  301. package/dist/core/extensions/builtin/loop-guard/similarity.d.ts +13 -0
  302. package/dist/core/extensions/builtin/loop-guard/similarity.d.ts.map +1 -0
  303. package/dist/core/extensions/builtin/loop-guard/similarity.js +51 -0
  304. package/dist/core/extensions/builtin/loop-guard/similarity.js.map +1 -0
  305. package/dist/core/extensions/builtin/loop-guard/tracker.d.ts +13 -0
  306. package/dist/core/extensions/builtin/loop-guard/tracker.d.ts.map +1 -0
  307. package/dist/core/extensions/builtin/loop-guard/tracker.js +39 -0
  308. package/dist/core/extensions/builtin/loop-guard/tracker.js.map +1 -0
  309. package/dist/core/extensions/builtin/mcp/health.d.ts.map +1 -1
  310. package/dist/core/extensions/builtin/mcp/health.js +2 -1
  311. package/dist/core/extensions/builtin/mcp/health.js.map +1 -1
  312. package/dist/core/extensions/builtin/monitor-state-event.d.ts +10 -0
  313. package/dist/core/extensions/builtin/monitor-state-event.d.ts.map +1 -1
  314. package/dist/core/extensions/builtin/monitor-state-event.js.map +1 -1
  315. package/dist/core/extensions/builtin/prompt-preset/deepseek-v4-flash-0731.d.ts +3 -0
  316. package/dist/core/extensions/builtin/prompt-preset/deepseek-v4-flash-0731.d.ts.map +1 -0
  317. package/dist/core/extensions/builtin/prompt-preset/deepseek-v4-flash-0731.js +10 -0
  318. package/dist/core/extensions/builtin/prompt-preset/deepseek-v4-flash-0731.js.map +1 -0
  319. package/dist/core/extensions/builtin/prompt-preset/deepseek-v4-flash.d.ts +3 -0
  320. package/dist/core/extensions/builtin/prompt-preset/deepseek-v4-flash.d.ts.map +1 -0
  321. package/dist/core/extensions/builtin/prompt-preset/deepseek-v4-flash.js +10 -0
  322. package/dist/core/extensions/builtin/prompt-preset/deepseek-v4-flash.js.map +1 -0
  323. package/dist/core/extensions/builtin/prompt-preset/deepseek-v4-pro.d.ts +3 -0
  324. package/dist/core/extensions/builtin/prompt-preset/deepseek-v4-pro.d.ts.map +1 -0
  325. package/dist/core/extensions/builtin/prompt-preset/deepseek-v4-pro.js +11 -0
  326. package/dist/core/extensions/builtin/prompt-preset/deepseek-v4-pro.js.map +1 -0
  327. package/dist/core/extensions/builtin/prompt-preset/deepseek-v4.d.ts +13 -0
  328. package/dist/core/extensions/builtin/prompt-preset/deepseek-v4.d.ts.map +1 -0
  329. package/dist/core/extensions/builtin/prompt-preset/deepseek-v4.js +60 -0
  330. package/dist/core/extensions/builtin/prompt-preset/deepseek-v4.js.map +1 -0
  331. package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.d.ts +1 -1
  332. package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.d.ts.map +1 -1
  333. package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js +5 -3
  334. package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js.map +1 -1
  335. package/dist/core/extensions/builtin/prompt-preset/index.d.ts.map +1 -1
  336. package/dist/core/extensions/builtin/prompt-preset/index.js +8 -4
  337. package/dist/core/extensions/builtin/prompt-preset/index.js.map +1 -1
  338. package/dist/core/extensions/builtin/prompt-preset/kimi-k3.d.ts.map +1 -1
  339. package/dist/core/extensions/builtin/prompt-preset/kimi-k3.js +8 -1
  340. package/dist/core/extensions/builtin/prompt-preset/kimi-k3.js.map +1 -1
  341. package/dist/core/extensions/builtin/prompt-preset/presets.d.ts.map +1 -1
  342. package/dist/core/extensions/builtin/prompt-preset/presets.js +42 -0
  343. package/dist/core/extensions/builtin/prompt-preset/presets.js.map +1 -1
  344. package/dist/core/extensions/builtin/prompt-preset/settings.d.ts +1 -1
  345. package/dist/core/extensions/builtin/prompt-preset/settings.d.ts.map +1 -1
  346. package/dist/core/extensions/builtin/prompt-preset/settings.js +3 -0
  347. package/dist/core/extensions/builtin/prompt-preset/settings.js.map +1 -1
  348. package/dist/core/extensions/builtin/recommended-models/index.d.ts.map +1 -1
  349. package/dist/core/extensions/builtin/recommended-models/index.js +2 -1
  350. package/dist/core/extensions/builtin/recommended-models/index.js.map +1 -1
  351. package/dist/core/extensions/builtin/rules/index.js +4 -3
  352. package/dist/core/extensions/builtin/rules/index.js.map +1 -1
  353. package/dist/core/extensions/builtin/rules/rules/constants.d.ts +11 -0
  354. package/dist/core/extensions/builtin/rules/rules/constants.d.ts.map +1 -1
  355. package/dist/core/extensions/builtin/rules/rules/constants.js +11 -0
  356. package/dist/core/extensions/builtin/rules/rules/constants.js.map +1 -1
  357. package/dist/core/extensions/builtin/rules/rules/formatter.d.ts.map +1 -1
  358. package/dist/core/extensions/builtin/rules/rules/formatter.js +15 -1
  359. package/dist/core/extensions/builtin/rules/rules/formatter.js.map +1 -1
  360. package/dist/core/extensions/builtin/service-tier.d.ts.map +1 -1
  361. package/dist/core/extensions/builtin/service-tier.js +23 -21
  362. package/dist/core/extensions/builtin/service-tier.js.map +1 -1
  363. package/dist/core/extensions/builtin/terminal/extension.d.ts.map +1 -1
  364. package/dist/core/extensions/builtin/terminal/extension.js +21 -7
  365. package/dist/core/extensions/builtin/terminal/extension.js.map +1 -1
  366. package/dist/core/extensions/builtin/terminal/monitor-notify.d.ts.map +1 -1
  367. package/dist/core/extensions/builtin/terminal/monitor-notify.js +42 -5
  368. package/dist/core/extensions/builtin/terminal/monitor-notify.js.map +1 -1
  369. package/dist/core/extensions/builtin/terminal/monitor-registry.d.ts +2 -0
  370. package/dist/core/extensions/builtin/terminal/monitor-registry.d.ts.map +1 -1
  371. package/dist/core/extensions/builtin/terminal/monitor-registry.js +2 -0
  372. package/dist/core/extensions/builtin/terminal/monitor-registry.js.map +1 -1
  373. package/dist/core/extensions/builtin/terminal/monitor-status-ticker.d.ts +37 -0
  374. package/dist/core/extensions/builtin/terminal/monitor-status-ticker.d.ts.map +1 -0
  375. package/dist/core/extensions/builtin/terminal/monitor-status-ticker.js +61 -0
  376. package/dist/core/extensions/builtin/terminal/monitor-status-ticker.js.map +1 -0
  377. package/dist/core/extensions/builtin/terminal/monitor-status.d.ts +9 -1
  378. package/dist/core/extensions/builtin/terminal/monitor-status.d.ts.map +1 -1
  379. package/dist/core/extensions/builtin/terminal/monitor-status.js +35 -2
  380. package/dist/core/extensions/builtin/terminal/monitor-status.js.map +1 -1
  381. package/dist/core/extensions/builtin/terminal/tools/context.d.ts +1 -1
  382. package/dist/core/extensions/builtin/terminal/tools/context.d.ts.map +1 -1
  383. package/dist/core/extensions/builtin/terminal/tools/context.js.map +1 -1
  384. package/dist/core/extensions/builtin/terminal/tools/monitor.d.ts.map +1 -1
  385. package/dist/core/extensions/builtin/terminal/tools/monitor.js +2 -1
  386. package/dist/core/extensions/builtin/terminal/tools/monitor.js.map +1 -1
  387. package/dist/core/extensions/builtin/todotools/commands.d.ts +2 -2
  388. package/dist/core/extensions/builtin/todotools/commands.d.ts.map +1 -1
  389. package/dist/core/extensions/builtin/todotools/commands.js.map +1 -1
  390. package/dist/core/extensions/builtin/todotools/index.d.ts.map +1 -1
  391. package/dist/core/extensions/builtin/todotools/index.js +6 -3
  392. package/dist/core/extensions/builtin/todotools/index.js.map +1 -1
  393. package/dist/core/extensions/builtin/todotools/state.d.ts +1 -1
  394. package/dist/core/extensions/builtin/todotools/state.d.ts.map +1 -1
  395. package/dist/core/extensions/builtin/todotools/state.js +1 -1
  396. package/dist/core/extensions/builtin/todotools/state.js.map +1 -1
  397. package/dist/core/extensions/builtin/todotools/todo-widget-component.d.ts +19 -0
  398. package/dist/core/extensions/builtin/todotools/todo-widget-component.d.ts.map +1 -0
  399. package/dist/core/extensions/builtin/todotools/todo-widget-component.js +78 -0
  400. package/dist/core/extensions/builtin/todotools/todo-widget-component.js.map +1 -0
  401. package/dist/core/extensions/builtin/todotools/todo-widget.d.ts +13 -1
  402. package/dist/core/extensions/builtin/todotools/todo-widget.d.ts.map +1 -1
  403. package/dist/core/extensions/builtin/todotools/todo-widget.js +32 -14
  404. package/dist/core/extensions/builtin/todotools/todo-widget.js.map +1 -1
  405. package/dist/core/extensions/builtin/todotools/tools/todo.d.ts +2 -2
  406. package/dist/core/extensions/builtin/todotools/tools/todo.d.ts.map +1 -1
  407. package/dist/core/extensions/builtin/todotools/tools/todo.js +1 -1
  408. package/dist/core/extensions/builtin/todotools/tools/todo.js.map +1 -1
  409. package/dist/core/extensions/builtin/tool-pair-guard/index.d.ts.map +1 -1
  410. package/dist/core/extensions/builtin/tool-pair-guard/index.js +1 -1
  411. package/dist/core/extensions/builtin/tool-pair-guard/index.js.map +1 -1
  412. package/dist/core/extensions/builtin/tps.d.ts.map +1 -1
  413. package/dist/core/extensions/builtin/tps.js +5 -2
  414. package/dist/core/extensions/builtin/tps.js.map +1 -1
  415. package/dist/core/extensions/builtin/ttsr/builtin-rules.d.ts +4 -0
  416. package/dist/core/extensions/builtin/ttsr/builtin-rules.d.ts.map +1 -0
  417. package/dist/core/extensions/builtin/ttsr/builtin-rules.js +20 -0
  418. package/dist/core/extensions/builtin/ttsr/builtin-rules.js.map +1 -0
  419. package/dist/core/extensions/builtin/ttsr/commands.js +9 -1
  420. package/dist/core/extensions/builtin/ttsr/commands.js.map +1 -1
  421. package/dist/core/extensions/builtin/ttsr/index.d.ts.map +1 -1
  422. package/dist/core/extensions/builtin/ttsr/index.js +4 -3
  423. package/dist/core/extensions/builtin/ttsr/index.js.map +1 -1
  424. package/dist/core/extensions/builtin/ttsr/manager.js +1 -1
  425. package/dist/core/extensions/builtin/ttsr/manager.js.map +1 -1
  426. package/dist/core/extensions/builtin/websearch/websearch/config.d.ts.map +1 -1
  427. package/dist/core/extensions/builtin/websearch/websearch/config.js +1 -0
  428. package/dist/core/extensions/builtin/websearch/websearch/config.js.map +1 -1
  429. package/dist/core/extensions/builtin/websearch/websearch/native.d.ts.map +1 -1
  430. package/dist/core/extensions/builtin/websearch/websearch/native.js +16 -5
  431. package/dist/core/extensions/builtin/websearch/websearch/native.js.map +1 -1
  432. package/dist/core/extensions/builtin/websearch/websearch/provider-endpoints.d.ts.map +1 -1
  433. package/dist/core/extensions/builtin/websearch/websearch/provider-endpoints.js +1 -0
  434. package/dist/core/extensions/builtin/websearch/websearch/provider-endpoints.js.map +1 -1
  435. package/dist/core/extensions/builtin/websearch/websearch/providers/anthropic.d.ts +4 -1
  436. package/dist/core/extensions/builtin/websearch/websearch/providers/anthropic.d.ts.map +1 -1
  437. package/dist/core/extensions/builtin/websearch/websearch/providers/anthropic.js +44 -37
  438. package/dist/core/extensions/builtin/websearch/websearch/providers/anthropic.js.map +1 -1
  439. package/dist/core/extensions/builtin/websearch/websearch/providers/deepseek.d.ts +3 -0
  440. package/dist/core/extensions/builtin/websearch/websearch/providers/deepseek.d.ts.map +1 -0
  441. package/dist/core/extensions/builtin/websearch/websearch/providers/deepseek.js +12 -0
  442. package/dist/core/extensions/builtin/websearch/websearch/providers/deepseek.js.map +1 -0
  443. package/dist/core/extensions/builtin/websearch/websearch/providers.d.ts.map +1 -1
  444. package/dist/core/extensions/builtin/websearch/websearch/providers.js +2 -0
  445. package/dist/core/extensions/builtin/websearch/websearch/providers.js.map +1 -1
  446. package/dist/core/extensions/builtin/websearch/websearch/renderers.d.ts.map +1 -1
  447. package/dist/core/extensions/builtin/websearch/websearch/renderers.js +3 -3
  448. package/dist/core/extensions/builtin/websearch/websearch/renderers.js.map +1 -1
  449. package/dist/core/extensions/builtin/websearch/websearch/search.d.ts.map +1 -1
  450. package/dist/core/extensions/builtin/websearch/websearch/search.js +1 -3
  451. package/dist/core/extensions/builtin/websearch/websearch/search.js.map +1 -1
  452. package/dist/core/extensions/builtin/websearch/websearch/tool.js +2 -2
  453. package/dist/core/extensions/builtin/websearch/websearch/tool.js.map +1 -1
  454. package/dist/core/extensions/builtin/websearch/websearch/types.d.ts +1 -1
  455. package/dist/core/extensions/builtin/websearch/websearch/types.d.ts.map +1 -1
  456. package/dist/core/extensions/builtin/websearch/websearch/types.js.map +1 -1
  457. package/dist/core/extensions/index.d.ts +1 -1
  458. package/dist/core/extensions/index.d.ts.map +1 -1
  459. package/dist/core/extensions/index.js.map +1 -1
  460. package/dist/core/extensions/loader.d.ts.map +1 -1
  461. package/dist/core/extensions/loader.js +19 -18
  462. package/dist/core/extensions/loader.js.map +1 -1
  463. package/dist/core/extensions/runner.d.ts +5 -2
  464. package/dist/core/extensions/runner.d.ts.map +1 -1
  465. package/dist/core/extensions/runner.js +21 -1
  466. package/dist/core/extensions/runner.js.map +1 -1
  467. package/dist/core/extensions/types.d.ts +38 -2
  468. package/dist/core/extensions/types.d.ts.map +1 -1
  469. package/dist/core/extensions/types.js.map +1 -1
  470. package/dist/core/footer-data-provider.d.ts +10 -0
  471. package/dist/core/footer-data-provider.d.ts.map +1 -1
  472. package/dist/core/footer-data-provider.js +1 -1
  473. package/dist/core/footer-data-provider.js.map +1 -1
  474. package/dist/core/keybindings.d.ts +24 -0
  475. package/dist/core/keybindings.d.ts.map +1 -1
  476. package/dist/core/model-registry.d.ts +2 -1
  477. package/dist/core/model-registry.d.ts.map +1 -1
  478. package/dist/core/model-registry.js +3 -0
  479. package/dist/core/model-registry.js.map +1 -1
  480. package/dist/core/model-resolver.js +2 -2
  481. package/dist/core/model-resolver.js.map +1 -1
  482. package/dist/core/model-runtime.d.ts +2 -0
  483. package/dist/core/model-runtime.d.ts.map +1 -1
  484. package/dist/core/model-runtime.js.map +1 -1
  485. package/dist/core/package-manager.d.ts +0 -1
  486. package/dist/core/package-manager.d.ts.map +1 -1
  487. package/dist/core/package-manager.js +18 -34
  488. package/dist/core/package-manager.js.map +1 -1
  489. package/dist/core/pi-manifest.d.ts +9 -0
  490. package/dist/core/pi-manifest.d.ts.map +1 -0
  491. package/dist/core/pi-manifest.js +25 -0
  492. package/dist/core/pi-manifest.js.map +1 -0
  493. package/dist/core/resource-loader.d.ts +15 -0
  494. package/dist/core/resource-loader.d.ts.map +1 -1
  495. package/dist/core/resource-loader.js +55 -6
  496. package/dist/core/resource-loader.js.map +1 -1
  497. package/dist/core/retry-fallback/hint-policy.d.ts +29 -0
  498. package/dist/core/retry-fallback/hint-policy.d.ts.map +1 -0
  499. package/dist/core/retry-fallback/hint-policy.js +54 -0
  500. package/dist/core/retry-fallback/hint-policy.js.map +1 -0
  501. package/dist/core/retry-fallback/probe-scheduler.d.ts +60 -0
  502. package/dist/core/retry-fallback/probe-scheduler.d.ts.map +1 -0
  503. package/dist/core/retry-fallback/probe-scheduler.js +206 -0
  504. package/dist/core/retry-fallback/probe-scheduler.js.map +1 -0
  505. package/dist/core/retry-fallback/settings.d.ts +9 -0
  506. package/dist/core/retry-fallback/settings.d.ts.map +1 -1
  507. package/dist/core/retry-fallback/settings.js +14 -0
  508. package/dist/core/retry-fallback/settings.js.map +1 -1
  509. package/dist/core/settings-manager.d.ts +10 -1
  510. package/dist/core/settings-manager.d.ts.map +1 -1
  511. package/dist/core/settings-manager.js +21 -1
  512. package/dist/core/settings-manager.js.map +1 -1
  513. package/dist/core/thinking-levels.d.ts +5 -0
  514. package/dist/core/thinking-levels.d.ts.map +1 -1
  515. package/dist/core/thinking-levels.js +9 -39
  516. package/dist/core/thinking-levels.js.map +1 -1
  517. package/dist/extensions/llama/provider.js +1 -1
  518. package/dist/extensions/llama/provider.js.map +1 -1
  519. package/dist/index.d.ts +2 -2
  520. package/dist/index.d.ts.map +1 -1
  521. package/dist/index.js.map +1 -1
  522. package/dist/main.d.ts.map +1 -1
  523. package/dist/main.js +44 -0
  524. package/dist/main.js.map +1 -1
  525. package/dist/modes/app-server/server/account.d.ts +1 -1
  526. package/dist/modes/app-server/server/account.js +1 -1
  527. package/dist/modes/app-server/server/account.js.map +1 -1
  528. package/dist/modes/app-server/server/server-core.js +1 -1
  529. package/dist/modes/app-server/server/server-core.js.map +1 -1
  530. package/dist/modes/interactive/compaction-queue-transfer.d.ts +2 -0
  531. package/dist/modes/interactive/compaction-queue-transfer.d.ts.map +1 -1
  532. package/dist/modes/interactive/compaction-queue-transfer.js.map +1 -1
  533. package/dist/modes/interactive/components/assistant-message.d.ts +5 -2
  534. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  535. package/dist/modes/interactive/components/assistant-message.js +16 -4
  536. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  537. package/dist/modes/interactive/components/continuity-notice.d.ts +21 -0
  538. package/dist/modes/interactive/components/continuity-notice.d.ts.map +1 -0
  539. package/dist/modes/interactive/components/continuity-notice.js +58 -0
  540. package/dist/modes/interactive/components/continuity-notice.js.map +1 -0
  541. package/dist/modes/interactive/components/footer.d.ts.map +1 -1
  542. package/dist/modes/interactive/components/footer.js +9 -5
  543. package/dist/modes/interactive/components/footer.js.map +1 -1
  544. package/dist/modes/interactive/components/markdown-transform.d.ts +3 -0
  545. package/dist/modes/interactive/components/markdown-transform.d.ts.map +1 -0
  546. package/dist/modes/interactive/components/markdown-transform.js +19 -0
  547. package/dist/modes/interactive/components/markdown-transform.js.map +1 -0
  548. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  549. package/dist/modes/interactive/components/model-selector.js +4 -1
  550. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  551. package/dist/modes/interactive/components/settings-selector.d.ts +6 -2
  552. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  553. package/dist/modes/interactive/components/settings-selector.js +20 -0
  554. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  555. package/dist/modes/interactive/components/user-message.d.ts +3 -1
  556. package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
  557. package/dist/modes/interactive/components/user-message.js +8 -2
  558. package/dist/modes/interactive/components/user-message.js.map +1 -1
  559. package/dist/modes/interactive/help-content.d.ts.map +1 -1
  560. package/dist/modes/interactive/help-content.js +1 -0
  561. package/dist/modes/interactive/help-content.js.map +1 -1
  562. package/dist/modes/interactive/interactive-mode.d.ts +21 -0
  563. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  564. package/dist/modes/interactive/interactive-mode.js +189 -62
  565. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  566. package/dist/modes/interactive/risky-main-model-warning.d.ts +1 -1
  567. package/dist/modes/interactive/risky-main-model-warning.d.ts.map +1 -1
  568. package/dist/modes/interactive/risky-main-model-warning.js +1 -1
  569. package/dist/modes/interactive/risky-main-model-warning.js.map +1 -1
  570. package/dist/modes/interactive/theme/dark.json +1 -0
  571. package/dist/modes/interactive/theme/grok-day.json +1 -0
  572. package/dist/modes/interactive/theme/grok-night.json +1 -0
  573. package/dist/modes/interactive/theme/light.json +1 -0
  574. package/dist/modes/interactive/theme/theme-schema.json +5 -1
  575. package/dist/modes/interactive/theme/theme.d.ts +2 -2
  576. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  577. package/dist/modes/interactive/theme/theme.js +13 -3
  578. package/dist/modes/interactive/theme/theme.js.map +1 -1
  579. package/dist/modes/rpc/connection-handler.d.ts.map +1 -1
  580. package/dist/modes/rpc/connection-handler.js +16 -3
  581. package/dist/modes/rpc/connection-handler.js.map +1 -1
  582. package/dist/utils/clipboard.d.ts +1 -1
  583. package/dist/utils/clipboard.d.ts.map +1 -1
  584. package/dist/utils/clipboard.js +22 -2
  585. package/dist/utils/clipboard.js.map +1 -1
  586. package/docs/AGENTS.md +1 -6
  587. package/docs/custom-provider.md +10 -3
  588. package/docs/development.md +1 -2
  589. package/docs/extensions.md +34 -1
  590. package/docs/keybindings.md +13 -0
  591. package/docs/mcp.md +63 -4
  592. package/docs/models.md +1 -0
  593. package/docs/providers.md +41 -5
  594. package/docs/release-guide.md +7 -5
  595. package/docs/session-format.md +2 -0
  596. package/docs/settings.md +3 -1
  597. package/docs/skills.md +29 -0
  598. package/docs/themes.md +5 -3
  599. package/docs/usage.md +5 -0
  600. package/examples/extensions/custom-compaction.ts +1 -2
  601. package/examples/extensions/custom-provider-anthropic/index.ts +8 -2
  602. package/examples/extensions/doom-overlay/wad-finder.ts +7 -3
  603. package/examples/extensions/handoff.ts +2 -3
  604. package/examples/extensions/overlay-test.ts +1 -1
  605. package/examples/extensions/qna.ts +2 -2
  606. package/examples/rpc-extension-ui.ts +11 -2
  607. package/examples/sdk/02-custom-model.ts +1 -2
  608. package/examples/sdk/12-full-control.ts +2 -0
  609. package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +45 -0
  610. package/node_modules/@code-yeongyu/senpi-codemode/README.md +6 -3
  611. package/node_modules/@code-yeongyu/senpi-codemode/package.json +3 -3
  612. package/node_modules/@code-yeongyu/senpi-codemode/src/extension/eval-status-ticker.ts +79 -0
  613. package/node_modules/@code-yeongyu/senpi-codemode/src/extension/eval-status.ts +36 -3
  614. package/node_modules/@code-yeongyu/senpi-codemode/src/index.ts +26 -12
  615. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/cell-execution.ts +146 -0
  616. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/cell-handler.ts +21 -119
  617. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/cell-runtime.ts +157 -0
  618. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/detached-cell-manager.ts +62 -208
  619. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/detached-cell-notification.ts +98 -0
  620. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/detached-cell-snapshot.ts +81 -0
  621. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/detached-cell-state.ts +24 -0
  622. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/detached-eval-result.ts +140 -0
  623. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/detached-notification-queue.ts +53 -0
  624. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-request.ts +45 -0
  625. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool-options.ts +45 -0
  626. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool.ts +20 -342
  627. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
  628. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js +1 -0
  629. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js.map +1 -1
  630. package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.d.ts +14 -3
  631. package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.d.ts.map +1 -1
  632. package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.js +156 -67
  633. package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.js.map +1 -1
  634. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/array-session-reader.d.ts +3 -0
  635. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/array-session-reader.d.ts.map +1 -0
  636. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/array-session-reader.js +70 -0
  637. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/array-session-reader.js.map +1 -0
  638. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.d.ts +4 -0
  639. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.d.ts.map +1 -0
  640. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.js +22 -0
  641. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.js.map +1 -0
  642. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-store.d.ts +13 -0
  643. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-store.d.ts.map +1 -0
  644. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-store.js +304 -0
  645. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-store.js.map +1 -0
  646. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/keyed-operation-queue.d.ts +17 -0
  647. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/keyed-operation-queue.d.ts.map +1 -0
  648. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/keyed-operation-queue.js +60 -0
  649. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/keyed-operation-queue.js.map +1 -0
  650. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-store.d.ts +6 -0
  651. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-store.d.ts.map +1 -0
  652. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-store.js +107 -0
  653. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-store.js.map +1 -0
  654. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repository.d.ts +28 -0
  655. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repository.d.ts.map +1 -0
  656. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repository.js +61 -0
  657. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repository.js.map +1 -0
  658. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/search-backend.d.ts +8 -0
  659. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/search-backend.d.ts.map +1 -0
  660. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/search-backend.js +22 -0
  661. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/search-backend.js.map +1 -0
  662. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.d.ts +6 -10
  663. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.d.ts.map +1 -1
  664. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.js +154 -77
  665. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.js.map +1 -1
  666. package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.d.ts +49 -23
  667. package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.d.ts.map +1 -1
  668. package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.js.map +1 -1
  669. package/node_modules/@earendil-works/pi-agent-core/dist/index.d.ts +6 -6
  670. package/node_modules/@earendil-works/pi-agent-core/dist/index.d.ts.map +1 -1
  671. package/node_modules/@earendil-works/pi-agent-core/dist/index.js +6 -6
  672. package/node_modules/@earendil-works/pi-agent-core/dist/index.js.map +1 -1
  673. package/node_modules/@earendil-works/pi-agent-core/dist/proxy.js +1 -1
  674. package/node_modules/@earendil-works/pi-agent-core/dist/proxy.js.map +1 -1
  675. package/node_modules/@earendil-works/pi-agent-core/package.json +4 -4
  676. package/node_modules/@earendil-works/pi-ai/README.md +2 -1
  677. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.d.ts.map +1 -1
  678. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +56 -25
  679. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js.map +1 -1
  680. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-tool-pairs.d.ts +3 -0
  681. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-tool-pairs.d.ts.map +1 -0
  682. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-tool-pairs.js +134 -0
  683. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-tool-pairs.js.map +1 -0
  684. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.d.ts.map +1 -1
  685. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js +7 -3
  686. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js.map +1 -1
  687. package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.d.ts.map +1 -1
  688. package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js +64 -4
  689. package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js.map +1 -1
  690. package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.d.ts.map +1 -1
  691. package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js +12 -2
  692. package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js.map +1 -1
  693. package/node_modules/@earendil-works/pi-ai/dist/api/google-shared.d.ts.map +1 -1
  694. package/node_modules/@earendil-works/pi-ai/dist/api/google-shared.js +13 -6
  695. package/node_modules/@earendil-works/pi-ai/dist/api/google-shared.js.map +1 -1
  696. package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.d.ts.map +1 -1
  697. package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.js +12 -2
  698. package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.js.map +1 -1
  699. package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.d.ts.map +1 -1
  700. package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js +19 -10
  701. package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js.map +1 -1
  702. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses/fallback-state.d.ts +24 -0
  703. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses/fallback-state.d.ts.map +1 -0
  704. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses/fallback-state.js +70 -0
  705. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses/fallback-state.js.map +1 -0
  706. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.d.ts +2 -16
  707. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.d.ts.map +1 -1
  708. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js +94 -105
  709. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js.map +1 -1
  710. package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.d.ts.map +1 -1
  711. package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js +19 -10
  712. package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js.map +1 -1
  713. package/node_modules/@earendil-works/pi-ai/dist/api/openai-prompt-cache.d.ts +1 -0
  714. package/node_modules/@earendil-works/pi-ai/dist/api/openai-prompt-cache.d.ts.map +1 -1
  715. package/node_modules/@earendil-works/pi-ai/dist/api/openai-prompt-cache.js +7 -0
  716. package/node_modules/@earendil-works/pi-ai/dist/api/openai-prompt-cache.js.map +1 -1
  717. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.d.ts.map +1 -1
  718. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js +11 -1
  719. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js.map +1 -1
  720. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.d.ts.map +1 -1
  721. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js +9 -5
  722. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js.map +1 -1
  723. package/node_modules/@earendil-works/pi-ai/dist/api/openrouter-images.js +3 -2
  724. package/node_modules/@earendil-works/pi-ai/dist/api/openrouter-images.js.map +1 -1
  725. package/node_modules/@earendil-works/pi-ai/dist/api/pi-messages.js +2 -2
  726. package/node_modules/@earendil-works/pi-ai/dist/api/pi-messages.js.map +1 -1
  727. package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.d.ts.map +1 -1
  728. package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.js +1 -0
  729. package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.js.map +1 -1
  730. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openrouter.d.ts +3 -1
  731. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openrouter.d.ts.map +1 -1
  732. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openrouter.js +81 -26
  733. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openrouter.js.map +1 -1
  734. package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.d.ts +2 -0
  735. package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.d.ts.map +1 -1
  736. package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js +16 -8
  737. package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js.map +1 -1
  738. package/node_modules/@earendil-works/pi-ai/dist/index.d.ts +1 -0
  739. package/node_modules/@earendil-works/pi-ai/dist/index.d.ts.map +1 -1
  740. package/node_modules/@earendil-works/pi-ai/dist/index.js +1 -0
  741. package/node_modules/@earendil-works/pi-ai/dist/index.js.map +1 -1
  742. package/node_modules/@earendil-works/pi-ai/dist/model.d.ts +2 -1
  743. package/node_modules/@earendil-works/pi-ai/dist/model.d.ts.map +1 -1
  744. package/node_modules/@earendil-works/pi-ai/dist/model.js.map +1 -1
  745. package/node_modules/@earendil-works/pi-ai/dist/models.d.ts +14 -0
  746. package/node_modules/@earendil-works/pi-ai/dist/models.d.ts.map +1 -1
  747. package/node_modules/@earendil-works/pi-ai/dist/models.js +95 -19
  748. package/node_modules/@earendil-works/pi-ai/dist/models.js.map +1 -1
  749. package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
  750. package/node_modules/@earendil-works/pi-ai/dist/providers/data/amazon-bedrock.json +1 -1
  751. package/node_modules/@earendil-works/pi-ai/dist/providers/data/azure-openai-responses.json +1 -1
  752. package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-ai-gateway.json +1 -1
  753. package/node_modules/@earendil-works/pi-ai/dist/providers/data/fireworks.json +1 -1
  754. package/node_modules/@earendil-works/pi-ai/dist/providers/data/github-copilot.json +1 -1
  755. package/node_modules/@earendil-works/pi-ai/dist/providers/data/huggingface.json +1 -1
  756. package/node_modules/@earendil-works/pi-ai/dist/providers/data/mistral.json +1 -1
  757. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai-codex.json +1 -1
  758. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai.json +1 -1
  759. package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode-go.json +1 -1
  760. package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode.json +1 -1
  761. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
  762. package/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan-cn.json +1 -1
  763. package/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan.json +1 -1
  764. package/node_modules/@earendil-works/pi-ai/dist/providers/data/together.json +1 -1
  765. package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
  766. package/node_modules/@earendil-works/pi-ai/dist/providers/data/zai-coding-cn.json +1 -1
  767. package/node_modules/@earendil-works/pi-ai/dist/providers/data/zai.json +1 -1
  768. package/node_modules/@earendil-works/pi-ai/dist/providers/faux.d.ts.map +1 -1
  769. package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js +4 -1
  770. package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js.map +1 -1
  771. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.js +1 -1
  772. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.js.map +1 -1
  773. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +18 -1
  774. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
  775. package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -1
  776. package/node_modules/@earendil-works/pi-ai/dist/utils/error-body.d.ts.map +1 -1
  777. package/node_modules/@earendil-works/pi-ai/dist/utils/error-body.js +23 -4
  778. package/node_modules/@earendil-works/pi-ai/dist/utils/error-body.js.map +1 -1
  779. package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.d.ts.map +1 -1
  780. package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.js +10 -1
  781. package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.js.map +1 -1
  782. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.d.ts +3 -0
  783. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.d.ts.map +1 -1
  784. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.js +13 -12
  785. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.js.map +1 -1
  786. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-hint.d.ts +24 -0
  787. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-hint.d.ts.map +1 -0
  788. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-hint.js +233 -0
  789. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-hint.js.map +1 -0
  790. package/node_modules/@earendil-works/pi-ai/dist/utils/unavailable-tool-text.d.ts +3 -0
  791. package/node_modules/@earendil-works/pi-ai/dist/utils/unavailable-tool-text.d.ts.map +1 -0
  792. package/node_modules/@earendil-works/pi-ai/dist/utils/unavailable-tool-text.js +36 -0
  793. package/node_modules/@earendil-works/pi-ai/dist/utils/unavailable-tool-text.js.map +1 -0
  794. package/node_modules/@earendil-works/pi-ai/package.json +10 -6
  795. package/node_modules/@earendil-works/pi-client/CHANGELOG.md +7 -0
  796. package/node_modules/@earendil-works/pi-client/README.md +64 -0
  797. package/node_modules/@earendil-works/pi-client/dist/client.d.ts +25 -0
  798. package/node_modules/@earendil-works/pi-client/dist/client.d.ts.map +1 -0
  799. package/node_modules/@earendil-works/pi-client/dist/client.js +386 -0
  800. package/node_modules/@earendil-works/pi-client/dist/client.js.map +1 -0
  801. package/node_modules/@earendil-works/pi-client/dist/connection.d.ts +25 -0
  802. package/node_modules/@earendil-works/pi-client/dist/connection.d.ts.map +1 -0
  803. package/node_modules/@earendil-works/pi-client/dist/connection.js +204 -0
  804. package/node_modules/@earendil-works/pi-client/dist/connection.js.map +1 -0
  805. package/node_modules/@earendil-works/pi-client/dist/errors.d.ts +23 -0
  806. package/node_modules/@earendil-works/pi-client/dist/errors.d.ts.map +1 -0
  807. package/node_modules/@earendil-works/pi-client/dist/errors.js +42 -0
  808. package/node_modules/@earendil-works/pi-client/dist/errors.js.map +1 -0
  809. package/node_modules/@earendil-works/pi-client/dist/index.d.ts +6 -0
  810. package/node_modules/@earendil-works/pi-client/dist/index.d.ts.map +1 -0
  811. package/node_modules/@earendil-works/pi-client/dist/index.js +3 -0
  812. package/node_modules/@earendil-works/pi-client/dist/index.js.map +1 -0
  813. package/node_modules/@earendil-works/pi-client/dist/promise.d.ts +8 -0
  814. package/node_modules/@earendil-works/pi-client/dist/promise.d.ts.map +1 -0
  815. package/node_modules/@earendil-works/pi-client/dist/promise.js +11 -0
  816. package/node_modules/@earendil-works/pi-client/dist/promise.js.map +1 -0
  817. package/node_modules/@earendil-works/pi-client/dist/session-handle.d.ts +54 -0
  818. package/node_modules/@earendil-works/pi-client/dist/session-handle.d.ts.map +1 -0
  819. package/node_modules/@earendil-works/pi-client/dist/session-handle.js +50 -0
  820. package/node_modules/@earendil-works/pi-client/dist/session-handle.js.map +1 -0
  821. package/node_modules/@earendil-works/pi-client/dist/state.d.ts +22 -0
  822. package/node_modules/@earendil-works/pi-client/dist/state.d.ts.map +1 -0
  823. package/node_modules/@earendil-works/pi-client/dist/state.js +149 -0
  824. package/node_modules/@earendil-works/pi-client/dist/state.js.map +1 -0
  825. package/node_modules/@earendil-works/pi-client/dist/transport.d.ts +17 -0
  826. package/node_modules/@earendil-works/pi-client/dist/transport.d.ts.map +1 -0
  827. package/node_modules/@earendil-works/pi-client/dist/transport.js +2 -0
  828. package/node_modules/@earendil-works/pi-client/dist/transport.js.map +1 -0
  829. package/node_modules/@earendil-works/pi-client/dist/types.d.ts +23 -0
  830. package/node_modules/@earendil-works/pi-client/dist/types.d.ts.map +1 -0
  831. package/node_modules/@earendil-works/pi-client/dist/types.js +2 -0
  832. package/node_modules/@earendil-works/pi-client/dist/types.js.map +1 -0
  833. package/node_modules/@earendil-works/pi-client/dist/unix.d.ts +8 -0
  834. package/node_modules/@earendil-works/pi-client/dist/unix.d.ts.map +1 -0
  835. package/node_modules/@earendil-works/pi-client/dist/unix.js +151 -0
  836. package/node_modules/@earendil-works/pi-client/dist/unix.js.map +1 -0
  837. package/node_modules/@earendil-works/pi-client/package.json +56 -0
  838. package/node_modules/@earendil-works/pi-protocol/README.md +68 -0
  839. package/node_modules/@earendil-works/pi-protocol/dist/cbor/decoder.d.ts +4 -0
  840. package/node_modules/@earendil-works/pi-protocol/dist/cbor/decoder.d.ts.map +1 -0
  841. package/node_modules/@earendil-works/pi-protocol/dist/cbor/decoder.js +163 -0
  842. package/node_modules/@earendil-works/pi-protocol/dist/cbor/decoder.js.map +1 -0
  843. package/node_modules/@earendil-works/pi-protocol/dist/cbor/encoder.d.ts +4 -0
  844. package/node_modules/@earendil-works/pi-protocol/dist/cbor/encoder.d.ts.map +1 -0
  845. package/node_modules/@earendil-works/pi-protocol/dist/cbor/encoder.js +199 -0
  846. package/node_modules/@earendil-works/pi-protocol/dist/cbor/encoder.js.map +1 -0
  847. package/node_modules/@earendil-works/pi-protocol/dist/cbor/index.d.ts +4 -0
  848. package/node_modules/@earendil-works/pi-protocol/dist/cbor/index.d.ts.map +1 -0
  849. package/node_modules/@earendil-works/pi-protocol/dist/cbor/index.js +4 -0
  850. package/node_modules/@earendil-works/pi-protocol/dist/cbor/index.js.map +1 -0
  851. package/node_modules/@earendil-works/pi-protocol/dist/cbor/options.d.ts +26 -0
  852. package/node_modules/@earendil-works/pi-protocol/dist/cbor/options.d.ts.map +1 -0
  853. package/node_modules/@earendil-works/pi-protocol/dist/cbor/options.js +29 -0
  854. package/node_modules/@earendil-works/pi-protocol/dist/cbor/options.js.map +1 -0
  855. package/node_modules/@earendil-works/pi-protocol/dist/codec.d.ts +29 -0
  856. package/node_modules/@earendil-works/pi-protocol/dist/codec.d.ts.map +1 -0
  857. package/node_modules/@earendil-works/pi-protocol/dist/codec.js +140 -0
  858. package/node_modules/@earendil-works/pi-protocol/dist/codec.js.map +1 -0
  859. package/node_modules/@earendil-works/pi-protocol/dist/framing.d.ts +29 -0
  860. package/node_modules/@earendil-works/pi-protocol/dist/framing.d.ts.map +1 -0
  861. package/node_modules/@earendil-works/pi-protocol/dist/framing.js +152 -0
  862. package/node_modules/@earendil-works/pi-protocol/dist/framing.js.map +1 -0
  863. package/node_modules/@earendil-works/pi-protocol/dist/index.d.ts +5 -0
  864. package/node_modules/@earendil-works/pi-protocol/dist/index.d.ts.map +1 -0
  865. package/node_modules/@earendil-works/pi-protocol/dist/index.js +5 -0
  866. package/node_modules/@earendil-works/pi-protocol/dist/index.js.map +1 -0
  867. package/node_modules/@earendil-works/pi-protocol/dist/schemas.d.ts +13818 -0
  868. package/node_modules/@earendil-works/pi-protocol/dist/schemas.d.ts.map +1 -0
  869. package/node_modules/@earendil-works/pi-protocol/dist/schemas.js +382 -0
  870. package/node_modules/@earendil-works/pi-protocol/dist/schemas.js.map +1 -0
  871. package/node_modules/@earendil-works/pi-protocol/package.json +48 -0
  872. package/node_modules/@earendil-works/pi-pty/package.json +2 -2
  873. package/node_modules/@earendil-works/pi-tui/README.md +77 -14
  874. package/node_modules/@earendil-works/pi-tui/dist/TuiAltScreen.d.ts +83 -0
  875. package/node_modules/@earendil-works/pi-tui/dist/TuiAltScreen.d.ts.map +1 -0
  876. package/node_modules/@earendil-works/pi-tui/dist/TuiAltScreen.js +687 -0
  877. package/node_modules/@earendil-works/pi-tui/dist/TuiAltScreen.js.map +1 -0
  878. package/node_modules/@earendil-works/pi-tui/dist/TuiMainScreen.d.ts +5 -0
  879. package/node_modules/@earendil-works/pi-tui/dist/TuiMainScreen.d.ts.map +1 -0
  880. package/node_modules/@earendil-works/pi-tui/dist/TuiMainScreen.js +5 -0
  881. package/node_modules/@earendil-works/pi-tui/dist/TuiMainScreen.js.map +1 -0
  882. package/node_modules/@earendil-works/pi-tui/dist/components/alt-screen-flash.d.ts +13 -0
  883. package/node_modules/@earendil-works/pi-tui/dist/components/alt-screen-flash.d.ts.map +1 -0
  884. package/node_modules/@earendil-works/pi-tui/dist/components/alt-screen-flash.js +36 -0
  885. package/node_modules/@earendil-works/pi-tui/dist/components/alt-screen-flash.js.map +1 -0
  886. package/node_modules/@earendil-works/pi-tui/dist/components/h-stack.d.ts +7 -0
  887. package/node_modules/@earendil-works/pi-tui/dist/components/h-stack.d.ts.map +1 -0
  888. package/node_modules/@earendil-works/pi-tui/dist/components/h-stack.js +43 -0
  889. package/node_modules/@earendil-works/pi-tui/dist/components/h-stack.js.map +1 -0
  890. package/node_modules/@earendil-works/pi-tui/dist/components/image.d.ts.map +1 -1
  891. package/node_modules/@earendil-works/pi-tui/dist/components/image.js +4 -4
  892. package/node_modules/@earendil-works/pi-tui/dist/components/image.js.map +1 -1
  893. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts +2 -0
  894. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts.map +1 -1
  895. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js +3 -2
  896. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js.map +1 -1
  897. package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.d.ts +51 -0
  898. package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.d.ts.map +1 -0
  899. package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.js +163 -0
  900. package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.js.map +1 -0
  901. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts.map +1 -1
  902. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js +3 -6
  903. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js.map +1 -1
  904. package/node_modules/@earendil-works/pi-tui/dist/components/stack.d.ts +32 -0
  905. package/node_modules/@earendil-works/pi-tui/dist/components/stack.d.ts.map +1 -0
  906. package/node_modules/@earendil-works/pi-tui/dist/components/stack.js +109 -0
  907. package/node_modules/@earendil-works/pi-tui/dist/components/stack.js.map +1 -0
  908. package/node_modules/@earendil-works/pi-tui/dist/components/v-stack.d.ts +8 -0
  909. package/node_modules/@earendil-works/pi-tui/dist/components/v-stack.d.ts.map +1 -0
  910. package/node_modules/@earendil-works/pi-tui/dist/components/v-stack.js +21 -0
  911. package/node_modules/@earendil-works/pi-tui/dist/components/v-stack.js.map +1 -0
  912. package/node_modules/@earendil-works/pi-tui/dist/index.d.ts +10 -4
  913. package/node_modules/@earendil-works/pi-tui/dist/index.d.ts.map +1 -1
  914. package/node_modules/@earendil-works/pi-tui/dist/index.js +10 -4
  915. package/node_modules/@earendil-works/pi-tui/dist/index.js.map +1 -1
  916. package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts +30 -0
  917. package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts.map +1 -1
  918. package/node_modules/@earendil-works/pi-tui/dist/keybindings.js +18 -0
  919. package/node_modules/@earendil-works/pi-tui/dist/keybindings.js.map +1 -1
  920. package/node_modules/@earendil-works/pi-tui/dist/layout-node.d.ts +40 -0
  921. package/node_modules/@earendil-works/pi-tui/dist/layout-node.d.ts.map +1 -0
  922. package/node_modules/@earendil-works/pi-tui/dist/layout-node.js +6 -0
  923. package/node_modules/@earendil-works/pi-tui/dist/layout-node.js.map +1 -0
  924. package/node_modules/@earendil-works/pi-tui/dist/layout.d.ts +40 -0
  925. package/node_modules/@earendil-works/pi-tui/dist/layout.d.ts.map +1 -0
  926. package/node_modules/@earendil-works/pi-tui/dist/layout.js +315 -0
  927. package/node_modules/@earendil-works/pi-tui/dist/layout.js.map +1 -0
  928. package/node_modules/@earendil-works/pi-tui/dist/mux.js +1 -1
  929. package/node_modules/@earendil-works/pi-tui/dist/mux.js.map +1 -1
  930. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts +10 -0
  931. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts.map +1 -1
  932. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js +61 -3
  933. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js.map +1 -1
  934. package/node_modules/@earendil-works/pi-tui/dist/terminal-text.d.ts +1 -0
  935. package/node_modules/@earendil-works/pi-tui/dist/terminal-text.d.ts.map +1 -1
  936. package/node_modules/@earendil-works/pi-tui/dist/terminal-text.js +12 -2
  937. package/node_modules/@earendil-works/pi-tui/dist/terminal-text.js.map +1 -1
  938. package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts +37 -16
  939. package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts.map +1 -1
  940. package/node_modules/@earendil-works/pi-tui/dist/tui.js +89 -21
  941. package/node_modules/@earendil-works/pi-tui/dist/tui.js.map +1 -1
  942. package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts +10 -0
  943. package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts.map +1 -1
  944. package/node_modules/@earendil-works/pi-tui/dist/utils.js +95 -4
  945. package/node_modules/@earendil-works/pi-tui/dist/utils.js.map +1 -1
  946. package/node_modules/@earendil-works/pi-tui/package.json +2 -2
  947. package/node_modules/typebox/build/compile/validator.d.mts +3 -11
  948. package/node_modules/typebox/build/compile/validator.mjs +6 -36
  949. package/node_modules/typebox/build/error/errors.d.mts +1 -7
  950. package/node_modules/typebox/build/format/_idna.mjs +36 -6
  951. package/node_modules/typebox/build/format/_puny.mjs +4 -1
  952. package/node_modules/typebox/build/format/uuid.d.mts +2 -2
  953. package/node_modules/typebox/build/format/uuid.mjs +3 -3
  954. package/node_modules/typebox/build/guard/emit.d.mts +0 -4
  955. package/node_modules/typebox/build/guard/emit.mjs +0 -8
  956. package/node_modules/typebox/build/guard/guard.d.mts +5 -9
  957. package/node_modules/typebox/build/guard/guard.mjs +10 -15
  958. package/node_modules/typebox/build/guard/string.mjs +16 -4
  959. package/node_modules/typebox/build/schema/engine/_functions.mjs +34 -15
  960. package/node_modules/typebox/build/schema/engine/boolean.d.mts +3 -3
  961. package/node_modules/typebox/build/schema/engine/boolean.mjs +4 -4
  962. package/node_modules/typebox/build/schema/engine/index.d.mts +0 -1
  963. package/node_modules/typebox/build/schema/engine/index.mjs +0 -1
  964. package/node_modules/typebox/build/schema/engine/schema.mjs +6 -11
  965. package/node_modules/typebox/build/schema/engine/type.mjs +14 -18
  966. package/node_modules/typebox/build/schema/types/dependencies.mjs +1 -1
  967. package/node_modules/typebox/build/schema/types/index.d.mts +0 -1
  968. package/node_modules/typebox/build/schema/types/index.mjs +0 -1
  969. package/node_modules/typebox/build/schema/types/schema.d.mts +1 -1
  970. package/node_modules/typebox/build/schema/types/schema.mjs +2 -2
  971. package/node_modules/typebox/build/system/locale/ar_001.mjs +0 -1
  972. package/node_modules/typebox/build/system/locale/bn_BD.mjs +0 -1
  973. package/node_modules/typebox/build/system/locale/cs_CZ.mjs +0 -1
  974. package/node_modules/typebox/build/system/locale/de_DE.mjs +0 -1
  975. package/node_modules/typebox/build/system/locale/el_GR.mjs +0 -1
  976. package/node_modules/typebox/build/system/locale/en_US.mjs +0 -1
  977. package/node_modules/typebox/build/system/locale/es_419.mjs +0 -1
  978. package/node_modules/typebox/build/system/locale/es_AR.mjs +0 -1
  979. package/node_modules/typebox/build/system/locale/es_ES.mjs +0 -1
  980. package/node_modules/typebox/build/system/locale/es_MX.mjs +0 -1
  981. package/node_modules/typebox/build/system/locale/fa_IR.mjs +0 -1
  982. package/node_modules/typebox/build/system/locale/fil_PH.mjs +0 -1
  983. package/node_modules/typebox/build/system/locale/fr_CA.mjs +0 -1
  984. package/node_modules/typebox/build/system/locale/fr_FR.mjs +0 -1
  985. package/node_modules/typebox/build/system/locale/ha_NG.mjs +0 -1
  986. package/node_modules/typebox/build/system/locale/hi_IN.mjs +0 -1
  987. package/node_modules/typebox/build/system/locale/hu_HU.mjs +0 -1
  988. package/node_modules/typebox/build/system/locale/id_ID.mjs +0 -1
  989. package/node_modules/typebox/build/system/locale/it_IT.mjs +0 -1
  990. package/node_modules/typebox/build/system/locale/ja_JP.mjs +0 -1
  991. package/node_modules/typebox/build/system/locale/ko_KR.mjs +0 -1
  992. package/node_modules/typebox/build/system/locale/ms_MY.mjs +0 -1
  993. package/node_modules/typebox/build/system/locale/nl_NL.mjs +0 -1
  994. package/node_modules/typebox/build/system/locale/pl_PL.mjs +0 -1
  995. package/node_modules/typebox/build/system/locale/pt_BR.mjs +0 -1
  996. package/node_modules/typebox/build/system/locale/pt_PT.mjs +0 -1
  997. package/node_modules/typebox/build/system/locale/ro_RO.mjs +0 -1
  998. package/node_modules/typebox/build/system/locale/ru_RU.mjs +0 -1
  999. package/node_modules/typebox/build/system/locale/sv_SE.mjs +0 -1
  1000. package/node_modules/typebox/build/system/locale/sw_TZ.mjs +0 -1
  1001. package/node_modules/typebox/build/system/locale/th_TH.mjs +0 -1
  1002. package/node_modules/typebox/build/system/locale/tr_TR.mjs +0 -1
  1003. package/node_modules/typebox/build/system/locale/uk_UA.mjs +0 -1
  1004. package/node_modules/typebox/build/system/locale/ur_PK.mjs +0 -1
  1005. package/node_modules/typebox/build/system/locale/vi_VN.mjs +0 -1
  1006. package/node_modules/typebox/build/system/locale/yo_NG.mjs +0 -1
  1007. package/node_modules/typebox/build/system/locale/zh_Hans.mjs +0 -1
  1008. package/node_modules/typebox/build/system/locale/zh_Hant.mjs +0 -1
  1009. package/node_modules/typebox/build/system/memory/clone.d.mts +2 -3
  1010. package/node_modules/typebox/build/system/memory/clone.mjs +73 -26
  1011. package/node_modules/typebox/build/system/settings/settings.d.mts +15 -0
  1012. package/node_modules/typebox/build/system/settings/settings.mjs +3 -1
  1013. package/node_modules/typebox/build/type/action/_add_immutable.d.mts +11 -0
  1014. package/node_modules/typebox/build/type/action/_add_immutable.mjs +11 -0
  1015. package/node_modules/typebox/build/type/action/_add_optional.d.mts +11 -0
  1016. package/node_modules/typebox/build/type/action/_add_optional.mjs +11 -0
  1017. package/node_modules/typebox/build/type/action/_add_readonly.d.mts +11 -0
  1018. package/node_modules/typebox/build/type/action/_add_readonly.mjs +11 -0
  1019. package/node_modules/typebox/build/type/action/_remove_immutable.d.mts +11 -0
  1020. package/node_modules/typebox/build/type/action/_remove_immutable.mjs +11 -0
  1021. package/node_modules/typebox/build/type/action/_remove_optional.d.mts +11 -0
  1022. package/node_modules/typebox/build/type/action/_remove_optional.mjs +11 -0
  1023. package/node_modules/typebox/build/type/action/_remove_readonly.d.mts +11 -0
  1024. package/node_modules/typebox/build/type/action/_remove_readonly.mjs +11 -0
  1025. package/node_modules/typebox/build/type/action/conditional.d.mts +2 -3
  1026. package/node_modules/typebox/build/type/action/conditional.mjs +2 -1
  1027. package/node_modules/typebox/build/type/action/index.d.mts +7 -4
  1028. package/node_modules/typebox/build/type/action/index.mjs +7 -4
  1029. package/node_modules/typebox/build/type/action/mapped.d.mts +2 -3
  1030. package/node_modules/typebox/build/type/action/mapped.mjs +2 -1
  1031. package/node_modules/typebox/build/type/action/module.d.mts +8 -7
  1032. package/node_modules/typebox/build/type/action/module.mjs +7 -6
  1033. package/node_modules/typebox/build/type/action/readonly_object.mjs +3 -0
  1034. package/node_modules/typebox/build/type/action/with.d.mts +11 -0
  1035. package/node_modules/typebox/build/type/action/with.mjs +11 -0
  1036. package/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs +1 -1
  1037. package/node_modules/typebox/build/type/engine/call/instantiate.d.mts +1 -3
  1038. package/node_modules/typebox/build/type/engine/call/instantiate.mjs +3 -2
  1039. package/node_modules/typebox/build/type/engine/call/resolve_arguments.mjs +2 -2
  1040. package/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.d.mts +3 -4
  1041. package/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.mjs +2 -1
  1042. package/node_modules/typebox/build/type/engine/cyclic/candidates.d.mts +2 -3
  1043. package/node_modules/typebox/build/type/engine/cyclic/candidates.mjs +3 -6
  1044. package/node_modules/typebox/build/type/engine/cyclic/check.d.mts +6 -9
  1045. package/node_modules/typebox/build/type/engine/cyclic/check.mjs +10 -16
  1046. package/node_modules/typebox/build/type/engine/cyclic/dependencies.d.mts +1 -4
  1047. package/node_modules/typebox/build/type/engine/cyclic/dependencies.mjs +9 -15
  1048. package/node_modules/typebox/build/type/engine/cyclic/extends.d.mts +1 -4
  1049. package/node_modules/typebox/build/type/engine/cyclic/extends.mjs +8 -14
  1050. package/node_modules/typebox/build/type/engine/cyclic/instantiate.d.mts +2 -5
  1051. package/node_modules/typebox/build/type/engine/cyclic/instantiate.mjs +3 -2
  1052. package/node_modules/typebox/build/type/engine/enum/index.d.mts +0 -1
  1053. package/node_modules/typebox/build/type/engine/enum/index.mjs +0 -1
  1054. package/node_modules/typebox/build/type/engine/evaluate/broaden.d.mts +1 -2
  1055. package/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +2 -6
  1056. package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +10 -6
  1057. package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +10 -6
  1058. package/node_modules/typebox/build/type/engine/evaluate/distribute.d.mts +2 -1
  1059. package/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +3 -3
  1060. package/node_modules/typebox/build/type/engine/evaluate/evaluate.d.mts +17 -5
  1061. package/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +34 -8
  1062. package/node_modules/typebox/build/type/engine/exclude/operation.d.mts +5 -6
  1063. package/node_modules/typebox/build/type/engine/exclude/operation.mjs +11 -12
  1064. package/node_modules/typebox/build/type/engine/extract/operation.d.mts +5 -6
  1065. package/node_modules/typebox/build/type/engine/extract/operation.mjs +11 -12
  1066. package/node_modules/typebox/build/type/engine/immutable/instantiate_add.d.mts +10 -0
  1067. package/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs +14 -0
  1068. package/node_modules/typebox/build/type/engine/immutable/instantiate_remove.d.mts +10 -0
  1069. package/node_modules/typebox/build/type/engine/immutable/instantiate_remove.mjs +14 -0
  1070. package/node_modules/typebox/build/type/engine/index.d.mts +2 -2
  1071. package/node_modules/typebox/build/type/engine/index.mjs +2 -2
  1072. package/node_modules/typebox/build/type/engine/indexable/from_dependent.d.mts +5 -0
  1073. package/node_modules/typebox/build/type/engine/indexable/from_dependent.mjs +8 -0
  1074. package/node_modules/typebox/build/type/engine/indexable/from_enum.d.mts +3 -3
  1075. package/node_modules/typebox/build/type/engine/indexable/from_enum.mjs +4 -4
  1076. package/node_modules/typebox/build/type/engine/indexable/from_template_literal.d.mts +2 -2
  1077. package/node_modules/typebox/build/type/engine/indexable/from_template_literal.mjs +3 -3
  1078. package/node_modules/typebox/build/type/engine/indexable/from_type.d.mts +3 -1
  1079. package/node_modules/typebox/build/type/engine/indexable/from_type.mjs +9 -6
  1080. package/node_modules/typebox/build/type/engine/indexed/instantiate.d.mts +2 -1
  1081. package/node_modules/typebox/build/type/engine/indexed/instantiate.mjs +5 -2
  1082. package/node_modules/typebox/build/type/engine/instantiate.d.mts +44 -31
  1083. package/node_modules/typebox/build/type/engine/instantiate.mjs +82 -83
  1084. package/node_modules/typebox/build/type/engine/interface/instantiate.d.mts +3 -6
  1085. package/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.d.mts +2 -2
  1086. package/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.mjs +3 -3
  1087. package/node_modules/typebox/build/type/engine/keyof/instantiate.d.mts +2 -1
  1088. package/node_modules/typebox/build/type/engine/keyof/instantiate.mjs +5 -1
  1089. package/node_modules/typebox/build/type/engine/mapped/mapped_operation.d.mts +4 -4
  1090. package/node_modules/typebox/build/type/engine/mapped/mapped_operation.mjs +3 -3
  1091. package/node_modules/typebox/build/type/engine/mapped/mapped_variants.d.mts +5 -4
  1092. package/node_modules/typebox/build/type/engine/mapped/mapped_variants.mjs +10 -5
  1093. package/node_modules/typebox/build/type/engine/module/instantiate.d.mts +7 -9
  1094. package/node_modules/typebox/build/type/engine/module/instantiate.mjs +17 -15
  1095. package/node_modules/typebox/build/type/engine/object/from_dependent.d.mts +5 -0
  1096. package/node_modules/typebox/build/type/engine/object/from_dependent.mjs +8 -0
  1097. package/node_modules/typebox/build/type/engine/object/from_type.d.mts +3 -1
  1098. package/node_modules/typebox/build/type/engine/object/from_type.mjs +8 -5
  1099. package/node_modules/typebox/build/type/engine/object/from_union.mjs +2 -2
  1100. package/node_modules/typebox/build/type/engine/optional/instantiate_add.d.mts +10 -0
  1101. package/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs +14 -0
  1102. package/node_modules/typebox/build/type/engine/optional/instantiate_remove.d.mts +10 -0
  1103. package/node_modules/typebox/build/type/engine/optional/instantiate_remove.mjs +14 -0
  1104. package/node_modules/typebox/build/type/engine/parameters/instantiate.d.mts +3 -4
  1105. package/node_modules/typebox/build/type/engine/parameters/instantiate.mjs +2 -1
  1106. package/node_modules/typebox/build/type/engine/partial/from_dependent.d.mts +5 -0
  1107. package/node_modules/typebox/build/type/engine/partial/from_dependent.mjs +8 -0
  1108. package/node_modules/typebox/build/type/engine/partial/from_intersect.d.mts +1 -1
  1109. package/node_modules/typebox/build/type/engine/partial/from_intersect.mjs +3 -2
  1110. package/node_modules/typebox/build/type/engine/partial/from_object.d.mts +2 -2
  1111. package/node_modules/typebox/build/type/engine/partial/from_object.mjs +2 -2
  1112. package/node_modules/typebox/build/type/engine/partial/from_type.d.mts +3 -1
  1113. package/node_modules/typebox/build/type/engine/partial/from_type.mjs +7 -4
  1114. package/node_modules/typebox/build/type/engine/priority/index.d.mts +1 -0
  1115. package/node_modules/typebox/build/type/engine/priority/index.mjs +1 -0
  1116. package/node_modules/typebox/build/type/engine/priority/priority.d.mts +20 -0
  1117. package/node_modules/typebox/build/type/engine/priority/priority.mjs +28 -0
  1118. package/node_modules/typebox/build/type/engine/readonly/instantiate_add.d.mts +10 -0
  1119. package/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs +14 -0
  1120. package/node_modules/typebox/build/type/engine/readonly/instantiate_remove.d.mts +10 -0
  1121. package/node_modules/typebox/build/type/engine/readonly/instantiate_remove.mjs +14 -0
  1122. package/node_modules/typebox/build/type/engine/readonly_object/from_array.d.mts +2 -2
  1123. package/node_modules/typebox/build/type/engine/readonly_object/from_array.mjs +2 -2
  1124. package/node_modules/typebox/build/type/engine/readonly_object/from_dependent.d.mts +5 -0
  1125. package/node_modules/typebox/build/type/engine/readonly_object/from_dependent.mjs +8 -0
  1126. package/node_modules/typebox/build/type/engine/readonly_object/from_intersect.d.mts +1 -1
  1127. package/node_modules/typebox/build/type/engine/readonly_object/from_intersect.mjs +3 -2
  1128. package/node_modules/typebox/build/type/engine/readonly_object/from_object.d.mts +2 -2
  1129. package/node_modules/typebox/build/type/engine/readonly_object/from_object.mjs +2 -2
  1130. package/node_modules/typebox/build/type/engine/readonly_object/from_tuple.d.mts +2 -2
  1131. package/node_modules/typebox/build/type/engine/readonly_object/from_tuple.mjs +2 -2
  1132. package/node_modules/typebox/build/type/engine/readonly_object/from_type.d.mts +3 -1
  1133. package/node_modules/typebox/build/type/engine/readonly_object/from_type.mjs +8 -5
  1134. package/node_modules/typebox/build/type/engine/record/from_key_enum.d.mts +2 -2
  1135. package/node_modules/typebox/build/type/engine/record/from_key_enum.mjs +2 -2
  1136. package/node_modules/typebox/build/type/engine/record/from_key_template_literal.d.mts +2 -2
  1137. package/node_modules/typebox/build/type/engine/record/from_key_template_literal.mjs +2 -2
  1138. package/node_modules/typebox/build/type/engine/ref/instantiate.d.mts +3 -3
  1139. package/node_modules/typebox/build/type/engine/ref/instantiate.mjs +6 -6
  1140. package/node_modules/typebox/build/type/engine/required/from_dependent.d.mts +5 -0
  1141. package/node_modules/typebox/build/type/engine/required/from_dependent.mjs +8 -0
  1142. package/node_modules/typebox/build/type/engine/required/from_intersect.d.mts +1 -1
  1143. package/node_modules/typebox/build/type/engine/required/from_intersect.mjs +3 -2
  1144. package/node_modules/typebox/build/type/engine/required/from_object.d.mts +2 -2
  1145. package/node_modules/typebox/build/type/engine/required/from_object.mjs +2 -2
  1146. package/node_modules/typebox/build/type/engine/required/from_type.d.mts +3 -1
  1147. package/node_modules/typebox/build/type/engine/required/from_type.mjs +7 -4
  1148. package/node_modules/typebox/build/type/engine/template_literal/decode.mjs +3 -3
  1149. package/node_modules/typebox/build/type/engine/template_literal/encode.d.mts +2 -2
  1150. package/node_modules/typebox/build/type/engine/template_literal/encode.mjs +6 -6
  1151. package/node_modules/typebox/build/type/engine/template_literal/is_finite.mjs +1 -1
  1152. package/node_modules/typebox/build/type/engine/template_literal/is_pattern.mjs +1 -0
  1153. package/node_modules/typebox/build/type/engine/this/expand_this.d.mts +1 -4
  1154. package/node_modules/typebox/build/type/engine/this/expand_this.mjs +7 -13
  1155. package/node_modules/typebox/build/type/engine/with/instantiate.d.mts +8 -0
  1156. package/node_modules/typebox/build/type/engine/{options → with}/instantiate.mjs +5 -5
  1157. package/node_modules/typebox/build/type/extends/dependent.d.mts +6 -0
  1158. package/node_modules/typebox/build/type/extends/dependent.mjs +6 -0
  1159. package/node_modules/typebox/build/type/extends/enum.d.mts +4 -4
  1160. package/node_modules/typebox/build/type/extends/enum.mjs +3 -2
  1161. package/node_modules/typebox/build/type/extends/extends_left.d.mts +5 -7
  1162. package/node_modules/typebox/build/type/extends/extends_left.mjs +24 -27
  1163. package/node_modules/typebox/build/type/extends/extends_right.d.mts +7 -5
  1164. package/node_modules/typebox/build/type/extends/extends_right.mjs +20 -15
  1165. package/node_modules/typebox/build/type/extends/inference.mjs +1 -1
  1166. package/node_modules/typebox/build/type/extends/object.d.mts +8 -1
  1167. package/node_modules/typebox/build/type/extends/object.mjs +25 -3
  1168. package/node_modules/typebox/build/type/extends/parameters.mjs +2 -2
  1169. package/node_modules/typebox/build/type/extends/record.d.mts +13 -0
  1170. package/node_modules/typebox/build/type/extends/record.mjs +23 -0
  1171. package/node_modules/typebox/build/type/extends/template_literal.d.mts +3 -3
  1172. package/node_modules/typebox/build/type/extends/template_literal.mjs +3 -3
  1173. package/node_modules/typebox/build/type/extends/tuple.d.mts +3 -6
  1174. package/node_modules/typebox/build/type/extends/tuple.mjs +6 -5
  1175. package/node_modules/typebox/build/type/extends/union.mjs +2 -2
  1176. package/node_modules/typebox/build/type/script/mapping.d.mts +86 -98
  1177. package/node_modules/typebox/build/type/script/mapping.mjs +95 -92
  1178. package/node_modules/typebox/build/type/script/parser.d.mts +42 -40
  1179. package/node_modules/typebox/build/type/script/parser.mjs +23 -22
  1180. package/node_modules/typebox/build/type/script/script.d.mts +3 -4
  1181. package/node_modules/typebox/build/type/script/script.mjs +3 -2
  1182. package/node_modules/typebox/build/type/script/token/internal/guard.d.mts +1 -1
  1183. package/node_modules/typebox/build/type/script/token/internal/guard.mjs +1 -1
  1184. package/node_modules/typebox/build/type/script/token/internal/take.mjs +1 -1
  1185. package/node_modules/typebox/build/type/script/token/until.mjs +2 -2
  1186. package/node_modules/typebox/build/type/types/_codec.d.mts +12 -12
  1187. package/node_modules/typebox/build/type/types/_codec.mjs +0 -1
  1188. package/node_modules/typebox/build/type/types/_immutable.d.mts +2 -9
  1189. package/node_modules/typebox/build/type/types/_immutable.mjs +2 -10
  1190. package/node_modules/typebox/build/type/types/_optional.d.mts +2 -9
  1191. package/node_modules/typebox/build/type/types/_optional.mjs +2 -11
  1192. package/node_modules/typebox/build/type/types/_readonly.d.mts +2 -9
  1193. package/node_modules/typebox/build/type/types/_readonly.mjs +2 -10
  1194. package/node_modules/typebox/build/type/types/_refine.d.mts +8 -10
  1195. package/node_modules/typebox/build/type/types/_refine.mjs +1 -2
  1196. package/node_modules/typebox/build/type/types/call.d.mts +3 -3
  1197. package/node_modules/typebox/build/type/types/call.mjs +3 -2
  1198. package/node_modules/typebox/build/type/types/deferred.d.mts +1 -0
  1199. package/node_modules/typebox/build/type/types/deferred.mjs +1 -1
  1200. package/node_modules/typebox/build/type/types/dependent.d.mts +17 -0
  1201. package/node_modules/typebox/build/type/types/dependent.mjs +24 -0
  1202. package/node_modules/typebox/build/type/types/enum.d.mts +3 -1
  1203. package/node_modules/typebox/build/type/types/enum.mjs +5 -0
  1204. package/node_modules/typebox/build/type/types/index.d.mts +1 -4
  1205. package/node_modules/typebox/build/type/types/index.mjs +1 -4
  1206. package/node_modules/typebox/build/type/types/number.d.mts +1 -1
  1207. package/node_modules/typebox/build/type/types/number.mjs +1 -1
  1208. package/node_modules/typebox/build/type/types/record.d.mts +13 -7
  1209. package/node_modules/typebox/build/type/types/record.mjs +15 -9
  1210. package/node_modules/typebox/build/type/types/static.d.mts +2 -5
  1211. package/node_modules/typebox/build/typebox.d.mts +3 -7
  1212. package/node_modules/typebox/build/typebox.mjs +3 -7
  1213. package/node_modules/typebox/build/value/clean/clean.mjs +4 -2
  1214. package/node_modules/typebox/build/value/clean/from_intersect.mjs +2 -2
  1215. package/node_modules/typebox/build/value/clean/from_type.mjs +8 -10
  1216. package/node_modules/typebox/build/value/clean/from_union.d.mts +1 -1
  1217. package/node_modules/typebox/build/value/clean/from_union.mjs +1 -2
  1218. package/node_modules/typebox/build/value/clone/clone.mjs +2 -73
  1219. package/node_modules/typebox/build/value/codec/decode.mjs +4 -2
  1220. package/node_modules/typebox/build/value/codec/encode.mjs +4 -2
  1221. package/node_modules/typebox/build/value/codec/from_array.mjs +1 -4
  1222. package/node_modules/typebox/build/value/codec/from_object.mjs +1 -4
  1223. package/node_modules/typebox/build/value/codec/from_record.mjs +2 -7
  1224. package/node_modules/typebox/build/value/codec/from_tuple.mjs +1 -4
  1225. package/node_modules/typebox/build/value/codec/from_union.mjs +2 -3
  1226. package/node_modules/typebox/build/value/convert/from_enum.mjs +3 -4
  1227. package/node_modules/typebox/build/value/convert/from_template_literal.d.mts +1 -1
  1228. package/node_modules/typebox/build/value/convert/from_template_literal.mjs +2 -3
  1229. package/node_modules/typebox/build/value/convert/from_type.mjs +19 -21
  1230. package/node_modules/typebox/build/value/create/from_enum.mjs +2 -2
  1231. package/node_modules/typebox/build/value/create/from_type.mjs +23 -31
  1232. package/node_modules/typebox/build/value/default/from_object.mjs +1 -1
  1233. package/node_modules/typebox/build/value/default/from_type.mjs +8 -10
  1234. package/node_modules/typebox/build/value/errors/errors.d.mts +2 -2
  1235. package/node_modules/typebox/build/value/errors/errors.mjs +1 -1
  1236. package/node_modules/typebox/build/value/index.d.mts +0 -1
  1237. package/node_modules/typebox/build/value/index.mjs +0 -1
  1238. package/node_modules/typebox/build/value/repair/from_enum.mjs +2 -3
  1239. package/node_modules/typebox/build/value/repair/from_type.mjs +24 -22
  1240. package/node_modules/typebox/build/value/shared/union_priority_sort.d.mts +6 -2
  1241. package/node_modules/typebox/build/value/shared/union_priority_sort.mjs +62 -26
  1242. package/node_modules/typebox/build/value/value.d.mts +0 -1
  1243. package/node_modules/typebox/build/value/value.mjs +0 -1
  1244. package/node_modules/typebox/package.json +33 -33
  1245. package/node_modules/typebox/readme.md +117 -103
  1246. package/package.json +20 -10
  1247. package/dist/core/extensions/builtin/claude-agent-sdk/auth-lane.d.ts.map +0 -1
  1248. package/dist/core/extensions/builtin/claude-agent-sdk/auth-lane.js.map +0 -1
  1249. package/dist/core/extensions/builtin/claude-agent-sdk/guidance.d.ts +0 -6
  1250. package/dist/core/extensions/builtin/claude-agent-sdk/guidance.d.ts.map +0 -1
  1251. package/dist/core/extensions/builtin/claude-agent-sdk/guidance.js.map +0 -1
  1252. package/dist/core/extensions/builtin/claude-agent-sdk/index.d.ts +0 -4
  1253. package/dist/core/extensions/builtin/claude-agent-sdk/index.d.ts.map +0 -1
  1254. package/dist/core/extensions/builtin/claude-agent-sdk/index.js.map +0 -1
  1255. package/dist/core/extensions/builtin/claude-agent-sdk/oauth-login.js.map +0 -1
  1256. package/dist/core/extensions/builtin/claude-agent-sdk/options.d.ts +0 -16
  1257. package/dist/core/extensions/builtin/claude-agent-sdk/options.js.map +0 -1
  1258. package/dist/core/extensions/builtin/claude-agent-sdk/prompt-bridge.js.map +0 -1
  1259. package/dist/core/extensions/builtin/claude-agent-sdk/sdk-boundary.d.ts.map +0 -1
  1260. package/dist/core/extensions/builtin/claude-agent-sdk/settings.d.ts +0 -15
  1261. package/dist/core/extensions/builtin/claude-agent-sdk/settings.d.ts.map +0 -1
  1262. package/dist/core/extensions/builtin/claude-agent-sdk/settings.js +0 -41
  1263. package/dist/core/extensions/builtin/claude-agent-sdk/settings.js.map +0 -1
  1264. package/dist/core/extensions/builtin/claude-agent-sdk/stream.d.ts.map +0 -1
  1265. package/dist/core/extensions/builtin/claude-agent-sdk/stream.js +0 -229
  1266. package/dist/core/extensions/builtin/claude-agent-sdk/stream.js.map +0 -1
  1267. package/dist/core/extensions/builtin/claude-agent-sdk/tools.d.ts.map +0 -1
  1268. package/dist/core/extensions/builtin/claude-agent-sdk/tools.js.map +0 -1
  1269. package/dist/core/extensions/builtin/tool-pair-guard/sanitize-anthropic-payload.d.ts +0 -3
  1270. package/dist/core/extensions/builtin/tool-pair-guard/sanitize-anthropic-payload.d.ts.map +0 -1
  1271. package/dist/core/extensions/builtin/tool-pair-guard/sanitize-anthropic-payload.js +0 -75
  1272. package/dist/core/extensions/builtin/tool-pair-guard/sanitize-anthropic-payload.js.map +0 -1
  1273. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-repo.d.ts +0 -26
  1274. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-repo.d.ts.map +0 -1
  1275. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-repo.js +0 -100
  1276. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-repo.js.map +0 -1
  1277. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-storage.d.ts +0 -42
  1278. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-storage.d.ts.map +0 -1
  1279. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-storage.js +0 -286
  1280. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-storage.js.map +0 -1
  1281. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-repo.d.ts +0 -18
  1282. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-repo.d.ts.map +0 -1
  1283. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-repo.js +0 -44
  1284. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-repo.js.map +0 -1
  1285. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-storage.d.ts +0 -33
  1286. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-storage.d.ts.map +0 -1
  1287. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-storage.js +0 -163
  1288. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-storage.js.map +0 -1
  1289. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo-utils.d.ts +0 -11
  1290. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo-utils.d.ts.map +0 -1
  1291. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo-utils.js +0 -39
  1292. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo-utils.js.map +0 -1
  1293. package/node_modules/typebox/build/schema/engine/_guard.d.mts +0 -6
  1294. package/node_modules/typebox/build/schema/engine/_guard.mjs +0 -26
  1295. package/node_modules/typebox/build/schema/types/_guard.d.mts +0 -10
  1296. package/node_modules/typebox/build/schema/types/_guard.mjs +0 -16
  1297. package/node_modules/typebox/build/type/action/_optional.d.mts +0 -19
  1298. package/node_modules/typebox/build/type/action/_optional.mjs +0 -40
  1299. package/node_modules/typebox/build/type/action/_readonly.d.mts +0 -19
  1300. package/node_modules/typebox/build/type/action/_readonly.mjs +0 -40
  1301. package/node_modules/typebox/build/type/action/awaited.d.mts +0 -15
  1302. package/node_modules/typebox/build/type/action/awaited.mjs +0 -15
  1303. package/node_modules/typebox/build/type/action/options.d.mts +0 -11
  1304. package/node_modules/typebox/build/type/action/options.mjs +0 -11
  1305. package/node_modules/typebox/build/type/engine/awaited/instantiate.d.mts +0 -11
  1306. package/node_modules/typebox/build/type/engine/awaited/instantiate.mjs +0 -20
  1307. package/node_modules/typebox/build/type/engine/enum/enum_to_union.d.mts +0 -14
  1308. package/node_modules/typebox/build/type/engine/enum/enum_to_union.mjs +0 -24
  1309. package/node_modules/typebox/build/type/engine/options/index.d.mts +0 -1
  1310. package/node_modules/typebox/build/type/engine/options/index.mjs +0 -1
  1311. package/node_modules/typebox/build/type/engine/options/instantiate.d.mts +0 -8
  1312. package/node_modules/typebox/build/type/extends/async_iterator.d.mts +0 -7
  1313. package/node_modules/typebox/build/type/extends/async_iterator.mjs +0 -9
  1314. package/node_modules/typebox/build/type/extends/iterator.d.mts +0 -7
  1315. package/node_modules/typebox/build/type/extends/iterator.mjs +0 -9
  1316. package/node_modules/typebox/build/type/extends/promise.d.mts +0 -7
  1317. package/node_modules/typebox/build/type/extends/promise.mjs +0 -9
  1318. package/node_modules/typebox/build/type/types/async_iterator.d.mts +0 -20
  1319. package/node_modules/typebox/build/type/types/async_iterator.mjs +0 -28
  1320. package/node_modules/typebox/build/type/types/base.d.mts +0 -50
  1321. package/node_modules/typebox/build/type/types/base.mjs +0 -84
  1322. package/node_modules/typebox/build/type/types/iterator.d.mts +0 -20
  1323. package/node_modules/typebox/build/type/types/iterator.mjs +0 -28
  1324. package/node_modules/typebox/build/type/types/promise.d.mts +0 -21
  1325. package/node_modules/typebox/build/type/types/promise.mjs +0 -29
  1326. package/node_modules/typebox/build/value/clean/from_base.d.mts +0 -2
  1327. package/node_modules/typebox/build/value/clean/from_base.mjs +0 -4
  1328. package/node_modules/typebox/build/value/convert/from_base.d.mts +0 -2
  1329. package/node_modules/typebox/build/value/convert/from_base.mjs +0 -4
  1330. package/node_modules/typebox/build/value/create/from_async_iterator.d.mts +0 -2
  1331. package/node_modules/typebox/build/value/create/from_async_iterator.mjs +0 -5
  1332. package/node_modules/typebox/build/value/create/from_base.d.mts +0 -2
  1333. package/node_modules/typebox/build/value/create/from_base.mjs +0 -4
  1334. package/node_modules/typebox/build/value/create/from_iterator.d.mts +0 -2
  1335. package/node_modules/typebox/build/value/create/from_iterator.mjs +0 -5
  1336. package/node_modules/typebox/build/value/create/from_promise.d.mts +0 -2
  1337. package/node_modules/typebox/build/value/create/from_promise.mjs +0 -5
  1338. package/node_modules/typebox/build/value/default/from_base.d.mts +0 -2
  1339. package/node_modules/typebox/build/value/default/from_base.mjs +0 -5
  1340. package/node_modules/typebox/build/value/mutate/error.d.mts +0 -3
  1341. package/node_modules/typebox/build/value/mutate/error.mjs +0 -6
  1342. package/node_modules/typebox/build/value/mutate/from_array.d.mts +0 -2
  1343. package/node_modules/typebox/build/value/mutate/from_array.mjs +0 -16
  1344. package/node_modules/typebox/build/value/mutate/from_object.d.mts +0 -2
  1345. package/node_modules/typebox/build/value/mutate/from_object.mjs +0 -40
  1346. package/node_modules/typebox/build/value/mutate/from_unknown.d.mts +0 -2
  1347. package/node_modules/typebox/build/value/mutate/from_unknown.mjs +0 -7
  1348. package/node_modules/typebox/build/value/mutate/from_value.d.mts +0 -2
  1349. package/node_modules/typebox/build/value/mutate/from_value.mjs +0 -12
  1350. package/node_modules/typebox/build/value/mutate/index.d.mts +0 -1
  1351. package/node_modules/typebox/build/value/mutate/index.mjs +0 -1
  1352. package/node_modules/typebox/build/value/mutate/mutate.d.mts +0 -11
  1353. package/node_modules/typebox/build/value/mutate/mutate.mjs +0 -41
  1354. package/node_modules/typebox/build/value/repair/from_base.d.mts +0 -2
  1355. package/node_modules/typebox/build/value/repair/from_base.mjs +0 -8
  1356. /package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/account-events.d.ts +0 -0
  1357. /package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/account-events.js +0 -0
  1358. /package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/custom-tools-schema.d.ts +0 -0
  1359. /package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/custom-tools-schema.js +0 -0
  1360. /package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/custom-tools.d.ts +0 -0
  1361. /package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/custom-tools.js +0 -0
  1362. /package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/executable.d.ts +0 -0
  1363. /package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/executable.js +0 -0
  1364. /package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/failover.d.ts +0 -0
  1365. /package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/prompt-bridge.d.ts +0 -0
  1366. /package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/sdk-boundary.js +0 -0
  1367. /package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/stream-protocol.d.ts +0 -0
  1368. /package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/stream-protocol.js +0 -0
  1369. /package/node_modules/typebox/build/type/engine/{awaited → with}/index.d.mts +0 -0
  1370. /package/node_modules/typebox/build/type/engine/{awaited → with}/index.mjs +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notice.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/loop-guard/notice.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,6BAA6B,GAAG,mBAAmB,CAAC;AAIjE,MAAM,UAAU,sBAAsB,CAAC,SAA6B;IACnE,QAAQ,SAAS,CAAC,IAAI,EAAE,CAAC;QACxB,KAAK,WAAW,EAAE,CAAC;YAClB,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,SAAS,CAAC;YACtC,OAAO;gBACN,mBAAmB;gBACnB,mDAAmD,QAAQ,MAAM,KAAK,oPAAoP;gBAC1T,+DAA+D;gBAC/D,mJAAmJ;gBACnJ,kIAAkI;gBAClI,iBAAiB,QAAQ,oCAAoC;gBAC7D,oBAAoB;aACpB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACd,CAAC;QACD,KAAK,SAAS,EAAE,CAAC;YAChB,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,SAAS,CAAC;YAClD,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,GAAG,CAAC,CAAC;YAC7C,OAAO;gBACN,mBAAmB;gBACnB,qDAAqD,KAAK,eAAe,QAAQ,0BAA0B,OAAO,mKAAmK;gBACrR,oMAAoM;gBACpM,uJAAuJ;gBACvJ,iJAAiJ;gBACjJ,oBAAoB;aACpB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACd,CAAC;QACD,KAAK,OAAO,EAAE,CAAC;YACd,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,SAAS,CAAC;YAChD,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACxC,OAAO;gBACN,mBAAmB;gBACnB,sFAAsF,OAAO,KAAK,KAAK,kBAAkB,MAAM,uJAAuJ;gBACtR,kKAAkK;gBAClK,sMAAsM;gBACtM,yKAAyK;gBACzK,oBAAoB;aACpB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACd,CAAC;IACF,CAAC;AACF,CAAC","sourcesContent":["import type { LoopGuardDetection } from \"./detectors.ts\";\n\nexport const LOOP_GUARD_NOTICE_CUSTOM_TYPE = \"loop-guard:notice\";\n\nexport type LoopGuardNoticeDetails = LoopGuardDetection;\n\nexport function buildLoopGuardReminder(detection: LoopGuardDetection): string {\n\tswitch (detection.kind) {\n\t\tcase \"identical\": {\n\t\t\tconst { toolName, count } = detection;\n\t\t\treturn [\n\t\t\t\t`<system-reminder>`,\n\t\t\t\t`LOOP GUARD - IDENTICAL TOOL CALLS: you called \\`${toolName}\\` ${count} times in a row with the EXACT same arguments. This is the tool-call stream, not consecutive text - another tool ran between these calls and it changed nothing about your plan. Re-issuing the same call returns the same result. Snap out of it:`,\n\t\t\t\t`- reuse the result you already received from this exact call;`,\n\t\t\t\t`- if you were re-checking for new output or state, switch to the monitor/watch tool or change one parameter deliberately (filter, offset, query);`,\n\t\t\t\t`- if nothing is actually changing, stop calling this tool, state what is blocking you, and try a different tool or ask the user.`,\n\t\t\t\t`Do not call \\`${toolName}\\` again with identical arguments.`,\n\t\t\t\t`</system-reminder>`,\n\t\t\t].join(\"\\n\");\n\t\t}\n\t\tcase \"similar\": {\n\t\t\tconst { toolName, count, similarity } = detection;\n\t\t\tconst percent = Math.round(similarity * 100);\n\t\t\treturn [\n\t\t\t\t`<system-reminder>`,\n\t\t\t\t`LOOP GUARD - NEAR-IDENTICAL TOOL CALLS: your last ${count} calls to \\`${toolName}\\` had arguments about ${percent}% identical (bigram similarity over canonical args). This may be legitimate batch work - or it may be a lazy loop that only LOOKS like progress. Attention check:`,\n\t\t\t\t`- if these calls target genuinely different inputs (distinct files, queries, offsets), continue deliberately - but consider batching or widening the scope instead of one call per tiny variation;`,\n\t\t\t\t`- if you are scanning output incrementally (reads, peeks, polls), widen the window once or use the monitor/watch tool rather than nudging parameters;`,\n\t\t\t\t`- if the results keep saying the same thing, change strategy now - a different tool, a wider query, or asking the user beats a sixth near-copy.`,\n\t\t\t\t`</system-reminder>`,\n\t\t\t].join(\"\\n\");\n\t\t}\n\t\tcase \"cycle\": {\n\t\t\tconst { period, count, cycleTools } = detection;\n\t\t\tconst pattern = cycleTools.join(\" -> \");\n\t\t\treturn [\n\t\t\t\t`<system-reminder>`,\n\t\t\t\t`LOOP GUARD - REPEATING TOOL-CALL PATTERN: your recent tool calls repeat the cycle [${pattern}] ${count} times (period ${period}), with other calls possibly interleaved between repetitions. A fixed rotation usually means waiting, guessing, or searching without a discriminator:`,\n\t\t\t\t`- if this is a wait/poll rotation (spawn then peek, write then check), replace the rotation with the monitor/watch tool and react to the decisive event instead;`,\n\t\t\t\t`- if this is a search rotation, change ONE axis decisively: broader query, different tool, or a different source - repeating the same rotation at the same parameters will not find new information;`,\n\t\t\t\t`- if the cycle is genuinely progressing (each rotation moves distinct work forward), keep going - but say what each rotation accomplished so the next rotation can end.`,\n\t\t\t\t`</system-reminder>`,\n\t\t\t].join(\"\\n\");\n\t\t}\n\t}\n}\n"]}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Loop-guard thresholds.
3
+ *
4
+ * Evidence base (see changes.md for the full rationale):
5
+ * - gemini-cli LoopDetectionService: sha256(name+args) signatures, cycle periods 1..5,
6
+ * threshold 5 repetitions — but it HALTS the run. Loop-guard only steers a reminder,
7
+ * so it can afford to fire earlier.
8
+ * - OpenHands stuck detector: 4+ identical action-observation pairs, 3+ error cycles,
9
+ * 6+ alternating ping-pong cycles — also halting behavior.
10
+ * - Corpus of 400 real senpi sessions: productive same-tool runs (bash/eval/edit/todo)
11
+ * show mean adjacent-args bigram-Dice ~0.52-0.55 (p90 <= 0.72), while repetitive
12
+ * classes (read pagination, bash_output/task_output polling) sit at 0.84-0.93.
13
+ * 0.85 cleanly separates distinct work from near-identical repetition.
14
+ */
15
+ /** Max tool-call records kept per prompt segment. Covers 6-period cycles at escalated counts. */
16
+ export declare const TRACK_WINDOW = 64;
17
+ /** Consecutive byte-identical (tool + canonical args) calls before the firm reminder fires. */
18
+ export declare const IDENTICAL_RUN_THRESHOLD = 3;
19
+ /** Consecutive same-tool calls with near-identical args before the caution fires. */
20
+ export declare const SIMILAR_RUN_THRESHOLD = 5;
21
+ /** Mean adjacent bigram-Dice similarity over canonical args that counts as "near-identical". */
22
+ export declare const SIMILARITY_THRESHOLD = 0.85;
23
+ /** Cycle period bounds (period 1 is the identical detector's job). */
24
+ export declare const CYCLE_MIN_PERIOD = 2;
25
+ export declare const CYCLE_MAX_PERIOD = 6;
26
+ /** Full cycle repetitions before the pattern notice fires. */
27
+ export declare const CYCLE_REPETITION_THRESHOLD = 3;
28
+ /** A pattern that keeps growing re-notifies only when its count reaches this multiple of the last notice. */
29
+ export declare const ESCALATION_FACTOR = 2;
30
+ //# sourceMappingURL=policy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/loop-guard/policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,iGAAiG;AACjG,eAAO,MAAM,YAAY,KAAK,CAAC;AAE/B,+FAA+F;AAC/F,eAAO,MAAM,uBAAuB,IAAI,CAAC;AAEzC,qFAAqF;AACrF,eAAO,MAAM,qBAAqB,IAAI,CAAC;AAEvC,gGAAgG;AAChG,eAAO,MAAM,oBAAoB,OAAO,CAAC;AAEzC,sEAAsE;AACtE,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAClC,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAElC,8DAA8D;AAC9D,eAAO,MAAM,0BAA0B,IAAI,CAAC;AAE5C,6GAA6G;AAC7G,eAAO,MAAM,iBAAiB,IAAI,CAAC"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Loop-guard thresholds.
3
+ *
4
+ * Evidence base (see changes.md for the full rationale):
5
+ * - gemini-cli LoopDetectionService: sha256(name+args) signatures, cycle periods 1..5,
6
+ * threshold 5 repetitions — but it HALTS the run. Loop-guard only steers a reminder,
7
+ * so it can afford to fire earlier.
8
+ * - OpenHands stuck detector: 4+ identical action-observation pairs, 3+ error cycles,
9
+ * 6+ alternating ping-pong cycles — also halting behavior.
10
+ * - Corpus of 400 real senpi sessions: productive same-tool runs (bash/eval/edit/todo)
11
+ * show mean adjacent-args bigram-Dice ~0.52-0.55 (p90 <= 0.72), while repetitive
12
+ * classes (read pagination, bash_output/task_output polling) sit at 0.84-0.93.
13
+ * 0.85 cleanly separates distinct work from near-identical repetition.
14
+ */
15
+ /** Max tool-call records kept per prompt segment. Covers 6-period cycles at escalated counts. */
16
+ export const TRACK_WINDOW = 64;
17
+ /** Consecutive byte-identical (tool + canonical args) calls before the firm reminder fires. */
18
+ export const IDENTICAL_RUN_THRESHOLD = 3;
19
+ /** Consecutive same-tool calls with near-identical args before the caution fires. */
20
+ export const SIMILAR_RUN_THRESHOLD = 5;
21
+ /** Mean adjacent bigram-Dice similarity over canonical args that counts as "near-identical". */
22
+ export const SIMILARITY_THRESHOLD = 0.85;
23
+ /** Cycle period bounds (period 1 is the identical detector's job). */
24
+ export const CYCLE_MIN_PERIOD = 2;
25
+ export const CYCLE_MAX_PERIOD = 6;
26
+ /** Full cycle repetitions before the pattern notice fires. */
27
+ export const CYCLE_REPETITION_THRESHOLD = 3;
28
+ /** A pattern that keeps growing re-notifies only when its count reaches this multiple of the last notice. */
29
+ export const ESCALATION_FACTOR = 2;
30
+ //# sourceMappingURL=policy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"policy.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/loop-guard/policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,iGAAiG;AACjG,MAAM,CAAC,MAAM,YAAY,GAAG,EAAE,CAAC;AAE/B,+FAA+F;AAC/F,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC;AAEzC,qFAAqF;AACrF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAEvC,gGAAgG;AAChG,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC;AAEzC,sEAAsE;AACtE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAClC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAElC,8DAA8D;AAC9D,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC;AAE5C,6GAA6G;AAC7G,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC","sourcesContent":["/**\n * Loop-guard thresholds.\n *\n * Evidence base (see changes.md for the full rationale):\n * - gemini-cli LoopDetectionService: sha256(name+args) signatures, cycle periods 1..5,\n * threshold 5 repetitions — but it HALTS the run. Loop-guard only steers a reminder,\n * so it can afford to fire earlier.\n * - OpenHands stuck detector: 4+ identical action-observation pairs, 3+ error cycles,\n * 6+ alternating ping-pong cycles — also halting behavior.\n * - Corpus of 400 real senpi sessions: productive same-tool runs (bash/eval/edit/todo)\n * show mean adjacent-args bigram-Dice ~0.52-0.55 (p90 <= 0.72), while repetitive\n * classes (read pagination, bash_output/task_output polling) sit at 0.84-0.93.\n * 0.85 cleanly separates distinct work from near-identical repetition.\n */\n\n/** Max tool-call records kept per prompt segment. Covers 6-period cycles at escalated counts. */\nexport const TRACK_WINDOW = 64;\n\n/** Consecutive byte-identical (tool + canonical args) calls before the firm reminder fires. */\nexport const IDENTICAL_RUN_THRESHOLD = 3;\n\n/** Consecutive same-tool calls with near-identical args before the caution fires. */\nexport const SIMILAR_RUN_THRESHOLD = 5;\n\n/** Mean adjacent bigram-Dice similarity over canonical args that counts as \"near-identical\". */\nexport const SIMILARITY_THRESHOLD = 0.85;\n\n/** Cycle period bounds (period 1 is the identical detector's job). */\nexport const CYCLE_MIN_PERIOD = 2;\nexport const CYCLE_MAX_PERIOD = 6;\n\n/** Full cycle repetitions before the pattern notice fires. */\nexport const CYCLE_REPETITION_THRESHOLD = 3;\n\n/** A pattern that keeps growing re-notifies only when its count reaches this multiple of the last notice. */\nexport const ESCALATION_FACTOR = 2;\n"]}
@@ -0,0 +1,4 @@
1
+ import type { MessageRenderer } from "../../types.ts";
2
+ import type { LoopGuardDetection } from "./detectors.ts";
3
+ export declare const renderLoopGuardNotice: MessageRenderer<LoopGuardDetection>;
4
+ //# sourceMappingURL=renderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/loop-guard/renderer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAKzD,eAAO,MAAM,qBAAqB,EAAE,eAAe,CAAC,kBAAkB,CAUrE,CAAC"}
@@ -0,0 +1,50 @@
1
+ import { Box, Text } from "@earendil-works/pi-tui";
2
+ const BOLD = "\u001b[1m";
3
+ const BOLD_OFF = "\u001b[22m";
4
+ export const renderLoopGuardNotice = (message, options, theme) => {
5
+ const details = message.details;
6
+ if (details === undefined)
7
+ return undefined;
8
+ const box = new Box(1, 1, (text) => theme.bg("customMessageBg", text));
9
+ box.addChild(new Text(theme.fg("accent", `${BOLD}${titleLine(details)}${BOLD_OFF}`), 0, 0));
10
+ box.addChild(new Text(theme.fg("dim", whyLine(details)), 0, 0));
11
+ if (options.expanded) {
12
+ box.addChild(new Text(theme.fg("dim", expandedLine(details)), 0, 0));
13
+ }
14
+ return box;
15
+ };
16
+ function titleLine(detection) {
17
+ switch (detection.kind) {
18
+ case "identical":
19
+ return `⚠ Loop guard · identical calls ×${detection.count} (${detection.toolName})`;
20
+ case "similar":
21
+ return `⚠ Loop guard · near-identical calls ×${detection.count} (${detection.toolName})`;
22
+ case "cycle":
23
+ return `⚠ Loop guard · repeating pattern ×${detection.count} (period ${detection.period})`;
24
+ }
25
+ }
26
+ function whyLine(detection) {
27
+ switch (detection.kind) {
28
+ case "identical":
29
+ return "Same tool, same arguments, again. The agent was told to reuse the result or change the call.";
30
+ case "similar": {
31
+ const percent = Math.round(detection.similarity * 100);
32
+ return `Argument similarity ~${percent}%. The agent was told to verify this is distinct work, not a lazy loop.`;
33
+ }
34
+ case "cycle": {
35
+ const pattern = detection.cycleTools.join(" -> ");
36
+ return `Tool-call cycle [${pattern}]. The agent was told to break the rotation or justify the progress.`;
37
+ }
38
+ }
39
+ }
40
+ function expandedLine(detection) {
41
+ switch (detection.kind) {
42
+ case "identical":
43
+ return `tool ${detection.toolName} · ${detection.count} consecutive identical calls when the reminder fired`;
44
+ case "similar":
45
+ return `tool ${detection.toolName} · ${detection.count} consecutive same-tool calls at ~${Math.round(detection.similarity * 100)}% args similarity`;
46
+ case "cycle":
47
+ return `cycle ${detection.cycleTools.join(" -> ")} · ${detection.count} full repetitions in the tracked window`;
48
+ }
49
+ }
50
+ //# sourceMappingURL=renderer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderer.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/loop-guard/renderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAInD,MAAM,IAAI,GAAG,WAAW,CAAC;AACzB,MAAM,QAAQ,GAAG,YAAY,CAAC;AAE9B,MAAM,CAAC,MAAM,qBAAqB,GAAwC,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE;IACrG,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAChC,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC5C,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,E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IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,UAAU,GAAG,GAAG,CAAC,CAAC;YACvD,OAAO,wBAAwB,OAAO,yEAAyE,CAAC;QACjH,CAAC;QACD,KAAK,OAAO,EAAE,CAAC;YACd,MAAM,OAAO,GAAG,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAClD,OAAO,oBAAoB,OAAO,sEAAsE,CAAC;QAC1G,CAAC;IACF,CAAC;AACF,CAAC;AAED,SAAS,YAAY,CAAC,SAA6B;IAClD,QAAQ,SAAS,CAAC,IAAI,EAAE,CAAC;QACxB,KAAK,WAAW;YACf,OAAO,QAAQ,SAAS,CAAC,QAAQ,MAAM,SAAS,CAAC,KAAK,sDAAsD,CAAC;QAC9G,KAAK,SAAS;YACb,OAAO,QAAQ,SAAS,CAAC,QAAQ,MAAM,SAAS,CAAC,KAAK,oCAAoC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,UAAU,GAAG,GAAG,CAAC,mBAAmB,CAAC;QACrJ,KAAK,OAAO;YACX,OAAO,SAAS,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,SAAS,CAAC,KAAK,yCAAyC,CAAC;IAClH,CAAC;AACF,CAAC","sourcesContent":["import { Box, Text } from \"@earendil-works/pi-tui\";\nimport type { MessageRenderer } from \"../../types.ts\";\nimport type { LoopGuardDetection } from \"./detectors.ts\";\n\nconst BOLD = \"\\u001b[1m\";\nconst BOLD_OFF = \"\\u001b[22m\";\n\nexport const renderLoopGuardNotice: MessageRenderer<LoopGuardDetection> = (message, options, theme) => {\n\tconst details = message.details;\n\tif (details === undefined) return undefined;\n\tconst box = new Box(1, 1, (text) => theme.bg(\"customMessageBg\", text));\n\tbox.addChild(new Text(theme.fg(\"accent\", `${BOLD}${titleLine(details)}${BOLD_OFF}`), 0, 0));\n\tbox.addChild(new Text(theme.fg(\"dim\", whyLine(details)), 0, 0));\n\tif (options.expanded) {\n\t\tbox.addChild(new Text(theme.fg(\"dim\", expandedLine(details)), 0, 0));\n\t}\n\treturn box;\n};\n\nfunction titleLine(detection: LoopGuardDetection): string {\n\tswitch (detection.kind) {\n\t\tcase \"identical\":\n\t\t\treturn `⚠ Loop guard · identical calls ×${detection.count} (${detection.toolName})`;\n\t\tcase \"similar\":\n\t\t\treturn `⚠ Loop guard · near-identical calls ×${detection.count} (${detection.toolName})`;\n\t\tcase \"cycle\":\n\t\t\treturn `⚠ Loop guard · repeating pattern ×${detection.count} (period ${detection.period})`;\n\t}\n}\n\nfunction whyLine(detection: LoopGuardDetection): string {\n\tswitch (detection.kind) {\n\t\tcase \"identical\":\n\t\t\treturn \"Same tool, same arguments, again. The agent was told to reuse the result or change the call.\";\n\t\tcase \"similar\": {\n\t\t\tconst percent = Math.round(detection.similarity * 100);\n\t\t\treturn `Argument similarity ~${percent}%. The agent was told to verify this is distinct work, not a lazy loop.`;\n\t\t}\n\t\tcase \"cycle\": {\n\t\t\tconst pattern = detection.cycleTools.join(\" -> \");\n\t\t\treturn `Tool-call cycle [${pattern}]. The agent was told to break the rotation or justify the progress.`;\n\t\t}\n\t}\n}\n\nfunction expandedLine(detection: LoopGuardDetection): string {\n\tswitch (detection.kind) {\n\t\tcase \"identical\":\n\t\t\treturn `tool ${detection.toolName} · ${detection.count} consecutive identical calls when the reminder fired`;\n\t\tcase \"similar\":\n\t\t\treturn `tool ${detection.toolName} · ${detection.count} consecutive same-tool calls at ~${Math.round(detection.similarity * 100)}% args similarity`;\n\t\tcase \"cycle\":\n\t\t\treturn `cycle ${detection.cycleTools.join(\" -> \")} · ${detection.count} full repetitions in the tracked window`;\n\t}\n}\n"]}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Character-bigram Sørensen–Dice similarity over canonical argument JSON.
3
+ *
4
+ * Chosen over token-level or edit-distance metrics because canonical JSON keeps
5
+ * structure stable (sorted keys, fixed separators), making bigram overlap a cheap
6
+ * and order-insensitive-enough proxy for "same call shape, slightly different values".
7
+ */
8
+ export type BigramCounts = Map<string, number>;
9
+ export declare function bigramCounts(text: string): BigramCounts;
10
+ export declare function diceSimilarity(a: BigramCounts, b: BigramCounts): number;
11
+ /** Mean similarity between each adjacent pair of argument strings. */
12
+ export declare function meanAdjacentSimilarity(argStrings: readonly string[]): number;
13
+ //# sourceMappingURL=similarity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"similarity.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/loop-guard/similarity.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,MAAM,YAAY,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE/C,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAOvD;AAED,wBAAgB,cAAc,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,YAAY,GAAG,MAAM,CAcvE;AAED,sEAAsE;AACtE,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAW5E"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Character-bigram Sørensen–Dice similarity over canonical argument JSON.
3
+ *
4
+ * Chosen over token-level or edit-distance metrics because canonical JSON keeps
5
+ * structure stable (sorted keys, fixed separators), making bigram overlap a cheap
6
+ * and order-insensitive-enough proxy for "same call shape, slightly different values".
7
+ */
8
+ export function bigramCounts(text) {
9
+ const counts = new Map();
10
+ for (let i = 0; i < text.length - 1; i++) {
11
+ const gram = text.slice(i, i + 2);
12
+ counts.set(gram, (counts.get(gram) ?? 0) + 1);
13
+ }
14
+ return counts;
15
+ }
16
+ export function diceSimilarity(a, b) {
17
+ let totalA = 0;
18
+ for (const count of a.values())
19
+ totalA += count;
20
+ let totalB = 0;
21
+ for (const count of b.values())
22
+ totalB += count;
23
+ if (totalA === 0 && totalB === 0)
24
+ return 1;
25
+ if (totalA === 0 || totalB === 0)
26
+ return 0;
27
+ let intersection = 0;
28
+ const [small, large] = a.size <= b.size ? [a, b] : [b, a];
29
+ for (const [gram, count] of small) {
30
+ const other = large.get(gram);
31
+ if (other !== undefined)
32
+ intersection += Math.min(count, other);
33
+ }
34
+ return (2 * intersection) / (totalA + totalB);
35
+ }
36
+ /** Mean similarity between each adjacent pair of argument strings. */
37
+ export function meanAdjacentSimilarity(argStrings) {
38
+ if (argStrings.length < 2)
39
+ return 1;
40
+ const grams = argStrings.map(bigramCounts);
41
+ let total = 0;
42
+ for (let i = 0; i < grams.length - 1; i++) {
43
+ const current = grams[i];
44
+ const next = grams[i + 1];
45
+ if (current === undefined || next === undefined)
46
+ continue;
47
+ total += diceSimilarity(current, next);
48
+ }
49
+ return total / (grams.length - 1);
50
+ }
51
+ //# sourceMappingURL=similarity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"similarity.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/loop-guard/similarity.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,UAAU,YAAY,CAAC,IAAY;IACxC,MAAM,MAAM,GAAiB,IAAI,GAAG,EAAE,CAAC;IACvC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC1C,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QAClC,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/C,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,CAAe,EAAE,CAAe;IAC9D,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,KAAK,MAAM,KAAK,IAAI,CAAC,CAAC,MAAM,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC;IAChD,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AAC,CAAC;QACzB,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QAC1B,IAAI,OAAO,KAAK,SAAS,IAAI,IAAI,KAAK,SAAS;YAAE,SAAS;QAC1D,KAAK,IAAI,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACxC,CAAC;IACD,OAAO,KAAK,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AACnC,CAAC","sourcesContent":["/**\n * Character-bigram Sørensen–Dice similarity over canonical argument JSON.\n *\n * Chosen over token-level or edit-distance metrics because canonical JSON keeps\n * structure stable (sorted keys, fixed separators), making bigram overlap a cheap\n * and order-insensitive-enough proxy for \"same call shape, slightly different values\".\n */\n\nexport type BigramCounts = Map<string, number>;\n\nexport function bigramCounts(text: string): BigramCounts {\n\tconst counts: BigramCounts = new Map();\n\tfor (let i = 0; i < text.length - 1; i++) {\n\t\tconst gram = text.slice(i, i + 2);\n\t\tcounts.set(gram, (counts.get(gram) ?? 0) + 1);\n\t}\n\treturn counts;\n}\n\nexport function diceSimilarity(a: BigramCounts, b: BigramCounts): number {\n\tlet totalA = 0;\n\tfor (const count of a.values()) totalA += count;\n\tlet totalB = 0;\n\tfor (const count of b.values()) totalB += count;\n\tif (totalA === 0 && totalB === 0) return 1;\n\tif (totalA === 0 || totalB === 0) return 0;\n\tlet intersection = 0;\n\tconst [small, large] = a.size <= b.size ? [a, b] : [b, a];\n\tfor (const [gram, count] of small) {\n\t\tconst other = large.get(gram);\n\t\tif (other !== undefined) intersection += Math.min(count, other);\n\t}\n\treturn (2 * intersection) / (totalA + totalB);\n}\n\n/** Mean similarity between each adjacent pair of argument strings. */\nexport function meanAdjacentSimilarity(argStrings: readonly string[]): number {\n\tif (argStrings.length < 2) return 1;\n\tconst grams = argStrings.map(bigramCounts);\n\tlet total = 0;\n\tfor (let i = 0; i < grams.length - 1; i++) {\n\t\tconst current = grams[i];\n\t\tconst next = grams[i + 1];\n\t\tif (current === undefined || next === undefined) continue;\n\t\ttotal += diceSimilarity(current, next);\n\t}\n\treturn total / (grams.length - 1);\n}\n"]}
@@ -0,0 +1,13 @@
1
+ export interface ToolCallRecord {
2
+ readonly toolName: string;
3
+ readonly argsJson: string;
4
+ readonly signature: string;
5
+ }
6
+ export declare function canonicalizeArgs(args: unknown): string;
7
+ export declare class ToolCallTracker {
8
+ private calls;
9
+ record(toolName: string, args: unknown): void;
10
+ get records(): readonly ToolCallRecord[];
11
+ reset(): void;
12
+ }
13
+ //# sourceMappingURL=tracker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tracker.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/loop-guard/tracker.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC3B;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAEtD;AAgBD,qBAAa,eAAe;IAC3B,OAAO,CAAC,KAAK,CAAwB;IAErC,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,CAM5C;IAED,IAAI,OAAO,IAAI,SAAS,cAAc,EAAE,CAEvC;IAED,KAAK,IAAI,IAAI,CAEZ;CACD"}
@@ -0,0 +1,39 @@
1
+ import { TRACK_WINDOW } from "./policy.js";
2
+ export function canonicalizeArgs(args) {
3
+ return stableStringify(args ?? {});
4
+ }
5
+ function stableStringify(value) {
6
+ if (value === null || typeof value !== "object")
7
+ return JSON.stringify(value) ?? "null";
8
+ if (Array.isArray(value))
9
+ return `[${value.map((item) => stableStringify(item)).join(",")}]`;
10
+ const record = value;
11
+ const keys = Object.keys(record).sort();
12
+ const parts = [];
13
+ for (const key of keys) {
14
+ const entry = record[key];
15
+ if (entry === undefined)
16
+ continue;
17
+ parts.push(`${JSON.stringify(key)}:${stableStringify(entry)}`);
18
+ }
19
+ return `{${parts.join(",")}}`;
20
+ }
21
+ export class ToolCallTracker {
22
+ constructor() {
23
+ this.calls = [];
24
+ }
25
+ record(toolName, args) {
26
+ const argsJson = canonicalizeArgs(args);
27
+ this.calls.push({ toolName, argsJson, signature: `${toolName}\u0000${argsJson}` });
28
+ if (this.calls.length > TRACK_WINDOW) {
29
+ this.calls = this.calls.slice(-TRACK_WINDOW);
30
+ }
31
+ }
32
+ get records() {
33
+ return this.calls;
34
+ }
35
+ reset() {
36
+ this.calls = [];
37
+ }
38
+ }
39
+ //# sourceMappingURL=tracker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tracker.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/loop-guard/tracker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAQ3C,MAAM,UAAU,gBAAgB,CAAC,IAAa;IAC7C,OAAO,eAAe,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;AACpC,CAAC;AAED,SAAS,eAAe,CAAC,KAAc;IACtC,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC;IACxF,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;IAC7F,MAAM,MAAM,GAAG,KAAgC,CAAC;IAChD,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;IACxC,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACxB,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QAC1B,IAAI,KAAK,KAAK,SAAS;YAAE,SAAS;QAClC,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAChE,CAAC;IACD,OAAO,IAAI,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;AAC/B,CAAC;AAED,MAAM,OAAO,eAAe;IAA5B;QACS,UAAK,GAAqB,EAAE,CAAC;IAiBtC,CAAC;IAfA,MAAM,CAAC,QAAgB,EAAE,IAAa;QACrC,MAAM,QAAQ,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;QACxC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,QAAQ,SAAS,QAAQ,EAAE,EAAE,CAAC,CAAC;QACnF,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,YAAY,EAAE,CAAC;YACtC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC;QAC9C,CAAC;IACF,CAAC;IAED,IAAI,OAAO;QACV,OAAO,IAAI,CAAC,KAAK,CAAC;IACnB,CAAC;IAED,KAAK;QACJ,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;IACjB,CAAC;CACD","sourcesContent":["import { TRACK_WINDOW } from \"./policy.ts\";\n\nexport interface ToolCallRecord {\n\treadonly toolName: string;\n\treadonly argsJson: string;\n\treadonly signature: string;\n}\n\nexport function canonicalizeArgs(args: unknown): string {\n\treturn stableStringify(args ?? {});\n}\n\nfunction stableStringify(value: unknown): string {\n\tif (value === null || typeof value !== \"object\") return JSON.stringify(value) ?? \"null\";\n\tif (Array.isArray(value)) return `[${value.map((item) => stableStringify(item)).join(\",\")}]`;\n\tconst record = value as Record<string, unknown>;\n\tconst keys = Object.keys(record).sort();\n\tconst parts: string[] = [];\n\tfor (const key of keys) {\n\t\tconst entry = record[key];\n\t\tif (entry === undefined) continue;\n\t\tparts.push(`${JSON.stringify(key)}:${stableStringify(entry)}`);\n\t}\n\treturn `{${parts.join(\",\")}}`;\n}\n\nexport class ToolCallTracker {\n\tprivate calls: ToolCallRecord[] = [];\n\n\trecord(toolName: string, args: unknown): void {\n\t\tconst argsJson = canonicalizeArgs(args);\n\t\tthis.calls.push({ toolName, argsJson, signature: `${toolName}\\u0000${argsJson}` });\n\t\tif (this.calls.length > TRACK_WINDOW) {\n\t\t\tthis.calls = this.calls.slice(-TRACK_WINDOW);\n\t\t}\n\t}\n\n\tget records(): readonly ToolCallRecord[] {\n\t\treturn this.calls;\n\t}\n\n\treset(): void {\n\t\tthis.calls = [];\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/mcp/health.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EACN,SAAS,EAKT,MAAM,aAAa,CAAC;AAErB,eAAO,MAAM,iBAAiB,QAAS,CAAC;AACxC,eAAO,MAAM,mBAAmB,OAAQ,CAAC;AASzC,MAAM,MAAM,kBAAkB,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;AAExD,wBAAsB,2BAA2B,CAChD,UAAU,EAAE,gBAAgB,EAC5B,WAAW,CAAC,EAAE,kBAAkB,GAC9B,OAAO,CAAC,IAAI,CAAC,CA+Bf;AAED,wBAAsB,yBAAyB,CAAC,CAAC,EAChD,UAAU,EAAE,gBAAgB,EAC5B,SAAS,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACzB,OAAO,CAAC,CAAC,CAAC,CAgBZ;AAED,wBAAsB,+BAA+B,CAAC,CAAC,EACtD,UAAU,EAAE,gBAAgB,EAC5B,SAAS,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACzB,OAAO,CAAC,CAAC,CAAC,CAgBZ;AA6CD,wBAAgB,0BAA0B,CAAC,UAAU,EAAE,gBAAgB,EAAE,KAAK,EAAE,OAAO,GAAG,SAAS,GAAG,SAAS,CAK9G"}
1
+ {"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/mcp/health.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EACN,SAAS,EAKT,MAAM,aAAa,CAAC;AAGrB,eAAO,MAAM,iBAAiB,QAAS,CAAC;AACxC,eAAO,MAAM,mBAAmB,OAAQ,CAAC;AASzC,MAAM,MAAM,kBAAkB,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;AAExD,wBAAsB,2BAA2B,CAChD,UAAU,EAAE,gBAAgB,EAC5B,WAAW,CAAC,EAAE,kBAAkB,GAC9B,OAAO,CAAC,IAAI,CAAC,CA+Bf;AAED,wBAAsB,yBAAyB,CAAC,CAAC,EAChD,UAAU,EAAE,gBAAgB,EAC5B,SAAS,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACzB,OAAO,CAAC,CAAC,CAAC,CAgBZ;AAED,wBAAsB,+BAA+B,CAAC,CAAC,EACtD,UAAU,EAAE,gBAAgB,EAC5B,SAAS,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACzB,OAAO,CAAC,CAAC,CAAC,CAgBZ;AA6CD,wBAAgB,0BAA0B,CAAC,UAAU,EAAE,gBAAgB,EAAE,KAAK,EAAE,OAAO,GAAG,SAAS,GAAG,SAAS,CAK9G"}
@@ -1,6 +1,7 @@
1
1
  import { UnauthorizedError } from "@modelcontextprotocol/sdk/client/auth.js";
2
2
  import { OAuthFlowError } from "./auth/oauth-errors.js";
3
3
  import { AuthError, ConnectError, isMcpSessionExpiredError, isRetriableMcpError, SessionExpiredError, } from "./errors.js";
4
+ import { reconnectMcpNow } from "./reconnect.js";
4
5
  export const MCP_PING_STALE_MS = 30_000;
5
6
  export const MCP_PING_TIMEOUT_MS = 2_000;
6
7
  const healthByConnection = new WeakMap();
@@ -49,7 +50,7 @@ export async function withMcpSessionExpiryRetry(connection, operation) {
49
50
  if (!isMcpSessionExpiredError(error))
50
51
  throw error;
51
52
  connection.markDegraded(sessionExpiredError(connection, error, true));
52
- await connection.renew();
53
+ await reconnectMcpNow(connection);
53
54
  try {
54
55
  return await operation();
55
56
  }
@@ -1 +1 @@
1
- {"version":3,"file":"health.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/mcp/health.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,OAAO,EACN,SAAS,EACT,YAAY,EACZ,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,GACnB,MAAM,aAAa,CAAC;AAErB,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC;AACxC,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,CAAC;AAOzC,MAAM,kBAAkB,GAAG,IAAI,OAAO,EAAoC,CAAC;AAI3E,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAChD,UAA4B,EAC5B,WAAgC;IAEhC,MAAM,eAAe,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;IAC/C,MAAM,MAAM,GAAG,cAAc,CAAC,UAAU,CAAC,CAAC;IAC1C,IAAI,UAAU,CAAC,KAAK,KAAK,WAAW,EAAE,CAAC;QACtC,IAAI,UAAU,CAAC,KAAK,KAAK,MAAM,IAAI,UAAU,CAAC,KAAK,KAAK,YAAY,EAAE,CAAC;YACtE,IAAI,CAAC;gBACJ,MAAM,UAAU,CAAC,OAAO,EAAE,CAAC;YAC5B,CAAC;YAAC,OAAO,KAAK,EAAE,C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K,EAAE,SAAS;QAChB,SAAS;QACT,UAAU,EAAE,UAAU,CAAC,UAAU;KACjC,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,iBAAiB,CAAC,UAA4B,EAAE,KAAe;IACvE,OAAO,IAAI,SAAS,CACnB,cAAc,UAAU,CAAC,UAAU,6DAA6D,UAAU,CAAC,UAAU,2BAA2B,UAAU,CAAC,UAAU,kBAAkB,EACvL,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,CAAC,UAAU,EAAE,CAC3D,CAAC;AACH,CAAC;AAED,SAAS,gBAAgB,CAAC,KAAc,EAAE,KAAK,GAAG,CAAC;IAClD,IAAI,KAAK,YAAY,iBAAiB;QAAE,OAAO,IAAI,CAAC;IACpD,IAAI,KAAK,YAAY,cAAc;QAAE,OAAO,KAAK,CAAC,QAAQ,CAAC;IAC3D,IAAI,KAAK,GAAG,CAAC,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,IAAI,KAAK,EAAE,CAAC;QAClF,OAAO,gBAAgB,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;IACjD,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC","sourcesContent":["import { UnauthorizedError } from \"@modelcontextprotocol/sdk/client/auth.js\";\nimport { OAuthFlowError } from \"./auth/oauth-errors.ts\";\nimport type { ServerConnection } from \"./connection.ts\";\nimport {\n\tAuthError,\n\tConnectError,\n\tisMcpSessionExpiredError,\n\tisRetriableMcpError,\n\tSessionExpiredError,\n} from \"./errors.ts\";\n\nexport const MCP_PING_STALE_MS = 30_000;\nexport const MCP_PING_TIMEOUT_MS = 2_000;\n\ninterface McpHealthState {\n\tlastSuccessfulPingAtMs: number | undefined;\n\tpendingValidation: Promise<void> | undefined;\n}\n\nconst healthByConnection = new WeakMap<ServerConnection, McpHealthState>();\n\nexport type McpEnsureFreshAuth = () => Promise<unknown>;\n\nexport async function ensureMcpToolCallConnection(\n\tconnection: ServerConnection,\n\tensureFresh?: McpEnsureFreshAuth,\n): Promise<void> {\n\tawait ensureFreshAuth(connection, ensureFresh);\n\tconst health = healthStateFor(connection);\n\tif (connection.state !== \"connected\") {\n\t\tif (connection.state === \"idle\" || connection.state === \"connecting\") {\n\t\t\ttry {\n\t\t\t\tawait connection.connect();\n\t\t\t} catch (error) {\n\t\t\t\tif (isNeedsAuthError(error)) throw headlessAuthError(connection, error);\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t} else if (connection.state === \"needs_auth\") {\n\t\t\tthrow headlessAuthError(connection);\n\t\t} else {\n\t\t\tawait renewConnection(connection, health);\n\t\t\treturn;\n\t\t}\n\t}\n\tconst lastSuccessfulPingAtMs = health.lastSuccessfulPingAtMs;\n\tif (lastSuccessfulPingAtMs !== undefined && Date.now() - lastSuccessfulPingAtMs <= MCP_PING_STALE_MS) {\n\t\treturn;\n\t}\n\tif (health.pendingValidation !== undefined) {\n\t\tawait health.pendingValidation;\n\t\treturn;\n\t}\n\tconst pendingValidation = pingOrRenew(connection, health).finally(() => {\n\t\tif (health.pendingValidation === pendingValidation) health.pendingValidation = undefined;\n\t});\n\thealth.pendingValidation = pendingValidation;\n\tawait pendingValidation;\n}\n\nexport async function withMcpSessionExpiryRetry<T>(\n\tconnection: ServerConnection,\n\toperation: () => Promise<T>,\n): Promise<T> {\n\ttry {\n\t\treturn await operation();\n\t} catch (error) {\n\t\tif (!isMcpSessionExpiredError(error)) throw error;\n\t\tconnection.markDegraded(sessionExpiredError(connection, error, true));\n\t\tawait connection.renew();\n\t\ttry {\n\t\t\treturn await operation();\n\t\t} catch (retryError) {\n\t\t\tif (!isMcpSessionExpiredError(retryError)) throw retryError;\n\t\t\tconst expired = sessionExpiredError(connection, retryError, false);\n\t\t\tconnection.markSuspended(expired);\n\t\t\tthrow expired;\n\t\t}\n\t}\n}\n\nexport async function withMcpRetriableFailedSendRetry<T>(\n\tconnection: ServerConnection,\n\toperation: () => Promise<T>,\n): Promise<T> {\n\ttry {\n\t\treturn await operation();\n\t} catch (error) {\n\t\tif (!isRetriableFailedSendError(error)) throw error;\n\t\tconnection.markDegraded(failedSendError(connection, error, true));\n\t\tawait connection.renew();\n\t\ttry {\n\t\t\treturn await operation();\n\t\t} catch (retryError) {\n\t\t\tif (isRetriableFailedSendError(retryError)) {\n\t\t\t\tconnection.markDegraded(failedSendError(connection, retryError, false));\n\t\t\t}\n\t\t\tthrow retryError;\n\t\t}\n\t}\n}\n\nfunction healthStateFor(connection: ServerConnection): McpHealthState {\n\tlet health = healthByConnection.get(connection);\n\tif (health === undefined) {\n\t\thealth = { lastSuccessfulPingAtMs: undefined, pendingValidation: undefined };\n\t\thealthByConnection.set(connection, health);\n\t}\n\treturn health;\n}\n\nasync function pingOrRenew(connection: ServerConnection, health: McpHealthState): Promise<void> {\n\ttry {\n\t\tawait connection.client.ping({ timeout: MCP_PING_TIMEOUT_MS });\n\t\thealth.lastSuccessfulPingAtMs = Date.now();\n\t} catch (error) {\n\t\tconnection.markDegraded(error instanceof Error ? error : new Error(String(error)));\n\t\tawait renewConnection(connection, health);\n\t}\n}\n\nasync function renewConnection(connection: ServerConnection, health: McpHealthState): Promise<void> {\n\ttry {\n\t\tawait connection.renew();\n\t} catch (error) {\n\t\tif (isNeedsAuthError(error)) throw headlessAuthError(connection, error);\n\t\tthrow error;\n\t}\n\thealth.lastSuccessfulPingAtMs = Date.now();\n}\n\nasync function ensureFreshAuth(\n\tconnection: ServerConnection,\n\tensureFresh: McpEnsureFreshAuth | undefined,\n): Promise<void> {\n\tif (ensureFresh === undefined) return;\n\ttry {\n\t\tawait ensureFresh();\n\t} catch (error) {\n\t\tconst authError = markMcpConnectionNeedsAuth(connection, error);\n\t\tif (authError !== undefined) throw authError;\n\t\tthrow error;\n\t}\n}\n\nexport function markMcpConnectionNeedsAuth(connection: ServerConnection, error: unknown): AuthError | undefined {\n\tif (!isNeedsAuthError(error)) return undefined;\n\tconst authError = headlessAuthError(connection, error);\n\tconnection.markNeedsAuth(authError);\n\treturn authError;\n}\n\nfunction isRetriableFailedSendError(error: unknown): boolean {\n\treturn isRetriableMcpError(error) && !isMcpSessionExpiredError(error);\n}\n\nfunction failedSendError(connection: ServerConnection, cause: unknown, retriable: boolean): ConnectError {\n\tconst suffix = retriable\n\t\t? \"reconnecting once before retry\"\n\t\t: `post-reconnect retry also failed; run /mcp reconnect ${connection.serverName}`;\n\treturn new ConnectError(`MCP server ${connection.serverName} failed to send tool call; ${suffix}`, {\n\t\tcause,\n\t\tphase: \"call\",\n\t\tretriable,\n\t\tserverName: connection.serverName,\n\t});\n}\n\nfunction sessionExpiredError(connection: ServerConnection, cause: unknown, retriable: boolean): SessionExpiredError {\n\tconst suffix = retriable\n\t\t? \"reinitializing once\"\n\t\t: `reinitialize retry also expired; run /mcp reconnect ${connection.serverName}`;\n\treturn new SessionExpiredError(`MCP server ${connection.serverName} session expired; ${suffix}`, {\n\t\tcause,\n\t\tphase: \"session\",\n\t\tretriable,\n\t\tserverName: connection.serverName,\n\t});\n}\n\nfunction headlessAuthError(connection: ServerConnection, cause?: unknown): AuthError {\n\treturn new AuthError(\n\t\t`MCP server ${connection.serverName} needs OAuth. Run senpi interactive, then /mcp auth-start ${connection.serverName} and /mcp auth-complete ${connection.serverName} <redirect-url>.`,\n\t\t{ cause, phase: \"auth\", serverName: connection.serverName },\n\t);\n}\n\nfunction isNeedsAuthError(error: unknown, depth = 0): boolean {\n\tif (error instanceof UnauthorizedError) return true;\n\tif (error instanceof OAuthFlowError) return error.terminal;\n\tif (depth < 5 && error !== null && typeof error === \"object\" && \"cause\" in error) {\n\t\treturn isNeedsAuthError(error.cause, depth + 1);\n\t}\n\treturn false;\n}\n"]}
1
+ {"version":3,"file":"health.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/mcp/health.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAC7E,OAAO,EAAE,cAA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ACpD,IAAI,KAAK,YAAY,cAAc;QAAE,OAAO,KAAK,CAAC,QAAQ,CAAC;IAC3D,IAAI,KAAK,GAAG,CAAC,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,IAAI,KAAK,EAAE,CAAC;QAClF,OAAO,gBAAgB,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;IACjD,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC","sourcesContent":["import { UnauthorizedError } from \"@modelcontextprotocol/sdk/client/auth.js\";\nimport { OAuthFlowError } from \"./auth/oauth-errors.ts\";\nimport type { ServerConnection } from \"./connection.ts\";\nimport {\n\tAuthError,\n\tConnectError,\n\tisMcpSessionExpiredError,\n\tisRetriableMcpError,\n\tSessionExpiredError,\n} from \"./errors.ts\";\nimport { reconnectMcpNow } from \"./reconnect.ts\";\n\nexport const MCP_PING_STALE_MS = 30_000;\nexport const MCP_PING_TIMEOUT_MS = 2_000;\n\ninterface McpHealthState {\n\tlastSuccessfulPingAtMs: number | undefined;\n\tpendingValidation: Promise<void> | undefined;\n}\n\nconst healthByConnection = new WeakMap<ServerConnection, McpHealthState>();\n\nexport type McpEnsureFreshAuth = () => Promise<unknown>;\n\nexport async function ensureMcpToolCallConnection(\n\tconnection: ServerConnection,\n\tensureFresh?: McpEnsureFreshAuth,\n): Promise<void> {\n\tawait ensureFreshAuth(connection, ensureFresh);\n\tconst health = healthStateFor(connection);\n\tif (connection.state !== \"connected\") {\n\t\tif (connection.state === \"idle\" || connection.state === \"connecting\") {\n\t\t\ttry {\n\t\t\t\tawait connection.connect();\n\t\t\t} catch (error) {\n\t\t\t\tif (isNeedsAuthError(error)) throw headlessAuthError(connection, error);\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t} else if (connection.state === \"needs_auth\") {\n\t\t\tthrow headlessAuthError(connection);\n\t\t} else {\n\t\t\tawait renewConnection(connection, health);\n\t\t\treturn;\n\t\t}\n\t}\n\tconst lastSuccessfulPingAtMs = health.lastSuccessfulPingAtMs;\n\tif (lastSuccessfulPingAtMs !== undefined && Date.now() - lastSuccessfulPingAtMs <= MCP_PING_STALE_MS) {\n\t\treturn;\n\t}\n\tif (health.pendingValidation !== undefined) {\n\t\tawait health.pendingValidation;\n\t\treturn;\n\t}\n\tconst pendingValidation = pingOrRenew(connection, health).finally(() => {\n\t\tif (health.pendingValidation === pendingValidation) health.pendingValidation = undefined;\n\t});\n\thealth.pendingValidation = pendingValidation;\n\tawait pendingValidation;\n}\n\nexport async function withMcpSessionExpiryRetry<T>(\n\tconnection: ServerConnection,\n\toperation: () => Promise<T>,\n): Promise<T> {\n\ttry {\n\t\treturn await operation();\n\t} catch (error) {\n\t\tif (!isMcpSessionExpiredError(error)) throw error;\n\t\tconnection.markDegraded(sessionExpiredError(connection, error, true));\n\t\tawait reconnectMcpNow(connection);\n\t\ttry {\n\t\t\treturn await operation();\n\t\t} catch (retryError) {\n\t\t\tif (!isMcpSessionExpiredError(retryError)) throw retryError;\n\t\t\tconst expired = sessionExpiredError(connection, retryError, false);\n\t\t\tconnection.markSuspended(expired);\n\t\t\tthrow expired;\n\t\t}\n\t}\n}\n\nexport async function withMcpRetriableFailedSendRetry<T>(\n\tconnection: ServerConnection,\n\toperation: () => Promise<T>,\n): Promise<T> {\n\ttry {\n\t\treturn await operation();\n\t} catch (error) {\n\t\tif (!isRetriableFailedSendError(error)) throw error;\n\t\tconnection.markDegraded(failedSendError(connection, error, true));\n\t\tawait connection.renew();\n\t\ttry {\n\t\t\treturn await operation();\n\t\t} catch (retryError) {\n\t\t\tif (isRetriableFailedSendError(retryError)) {\n\t\t\t\tconnection.markDegraded(failedSendError(connection, retryError, false));\n\t\t\t}\n\t\t\tthrow retryError;\n\t\t}\n\t}\n}\n\nfunction healthStateFor(connection: ServerConnection): McpHealthState {\n\tlet health = healthByConnection.get(connection);\n\tif (health === undefined) {\n\t\thealth = { lastSuccessfulPingAtMs: undefined, pendingValidation: undefined };\n\t\thealthByConnection.set(connection, health);\n\t}\n\treturn health;\n}\n\nasync function pingOrRenew(connection: ServerConnection, health: McpHealthState): Promise<void> {\n\ttry {\n\t\tawait connection.client.ping({ timeout: MCP_PING_TIMEOUT_MS });\n\t\thealth.lastSuccessfulPingAtMs = Date.now();\n\t} catch (error) {\n\t\tconnection.markDegraded(error instanceof Error ? error : new Error(String(error)));\n\t\tawait renewConnection(connection, health);\n\t}\n}\n\nasync function renewConnection(connection: ServerConnection, health: McpHealthState): Promise<void> {\n\ttry {\n\t\tawait connection.renew();\n\t} catch (error) {\n\t\tif (isNeedsAuthError(error)) throw headlessAuthError(connection, error);\n\t\tthrow error;\n\t}\n\thealth.lastSuccessfulPingAtMs = Date.now();\n}\n\nasync function ensureFreshAuth(\n\tconnection: ServerConnection,\n\tensureFresh: McpEnsureFreshAuth | undefined,\n): Promise<void> {\n\tif (ensureFresh === undefined) return;\n\ttry {\n\t\tawait ensureFresh();\n\t} catch (error) {\n\t\tconst authError = markMcpConnectionNeedsAuth(connection, error);\n\t\tif (authError !== undefined) throw authError;\n\t\tthrow error;\n\t}\n}\n\nexport function markMcpConnectionNeedsAuth(connection: ServerConnection, error: unknown): AuthError | undefined {\n\tif (!isNeedsAuthError(error)) return undefined;\n\tconst authError = headlessAuthError(connection, error);\n\tconnection.markNeedsAuth(authError);\n\treturn authError;\n}\n\nfunction isRetriableFailedSendError(error: unknown): boolean {\n\treturn isRetriableMcpError(error) && !isMcpSessionExpiredError(error);\n}\n\nfunction failedSendError(connection: ServerConnection, cause: unknown, retriable: boolean): ConnectError {\n\tconst suffix = retriable\n\t\t? \"reconnecting once before retry\"\n\t\t: `post-reconnect retry also failed; run /mcp reconnect ${connection.serverName}`;\n\treturn new ConnectError(`MCP server ${connection.serverName} failed to send tool call; ${suffix}`, {\n\t\tcause,\n\t\tphase: \"call\",\n\t\tretriable,\n\t\tserverName: connection.serverName,\n\t});\n}\n\nfunction sessionExpiredError(connection: ServerConnection, cause: unknown, retriable: boolean): SessionExpiredError {\n\tconst suffix = retriable\n\t\t? \"reinitializing once\"\n\t\t: `reinitialize retry also expired; run /mcp reconnect ${connection.serverName}`;\n\treturn new SessionExpiredError(`MCP server ${connection.serverName} session expired; ${suffix}`, {\n\t\tcause,\n\t\tphase: \"session\",\n\t\tretriable,\n\t\tserverName: connection.serverName,\n\t});\n}\n\nfunction headlessAuthError(connection: ServerConnection, cause?: unknown): AuthError {\n\treturn new AuthError(\n\t\t`MCP server ${connection.serverName} needs OAuth. Run senpi interactive, then /mcp auth-start ${connection.serverName} and /mcp auth-complete ${connection.serverName} <redirect-url>.`,\n\t\t{ cause, phase: \"auth\", serverName: connection.serverName },\n\t);\n}\n\nfunction isNeedsAuthError(error: unknown, depth = 0): boolean {\n\tif (error instanceof UnauthorizedError) return true;\n\tif (error instanceof OAuthFlowError) return error.terminal;\n\tif (depth < 5 && error !== null && typeof error === \"object\" && \"cause\" in error) {\n\t\treturn isNeedsAuthError(error.cause, depth + 1);\n\t}\n\treturn false;\n}\n"]}
@@ -1,6 +1,16 @@
1
1
  export declare const TERMINAL_MONITOR_STATE_EVENT = "terminal_monitor_state";
2
+ /** One live watch as broadcast on the monitor state event; mirrors MonitorSnapshotEntry. */
3
+ export interface TerminalMonitorStateMonitorEntry {
4
+ readonly id: string;
5
+ readonly description: string;
6
+ readonly paused: boolean;
7
+ /** Epoch milliseconds when the watch registered; lets consumers render their own elapsed labels. */
8
+ readonly startedAtMs: number;
9
+ }
2
10
  export interface TerminalMonitorStateEvent {
3
11
  readonly activeCount: number;
12
+ /** Per-watch detail for consumers that need more than the count; absent in pre-enrichment payloads. */
13
+ readonly monitors?: readonly TerminalMonitorStateMonitorEntry[];
4
14
  }
5
15
  export declare function isTerminalMonitorStateEvent(data: unknown): data is TerminalMonitorStateEvent;
6
16
  //# sourceMappingURL=monitor-state-event.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"monitor-state-event.d.ts","sourceRoot":"","sources":["../../../../src/core/extensions/builtin/monitor-state-event.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B,2BAA2B,CAAC;AAErE,MAAM,WAAW,yBAAyB;IACzC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC7B;AAED,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,yBAAyB,CAS5F"}
1
+ {"version":3,"file":"monitor-state-event.d.ts","sourceRoot":"","sources":["../../../../src/core/extensions/builtin/monitor-state-event.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B,2BAA2B,CAAC;AAErE,4FAA4F;AAC5F,MAAM,WAAW,gCAAgC;IAChD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,oGAAoG;IACpG,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,yBAAyB;IACzC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,uGAAuG;IACvG,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,gCAAgC,EAAE,CAAC;CAChE;AAED,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,yBAAyB,CAS5F"}
@@ -1 +1 @@
1
- {"version":3,"file":"monitor-state-event.js","sourceRoot":"","sources":["../../../../src/core/extensions/builtin/monitor-state-event.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,4BAA4B,GAAG,wBAAwB,CAAC;AAMrE,MAAM,UAAU,2BAA2B,CAAC,IAAa;IACxD,OAAO,CACN,OAAO,IAAI,KAAK,QAAQ;QACxB,IAAI,KAAK,IAAI;QACb,aAAa,IAAI,IAAI;QACrB,OAAO,IAAI,CAAC,WAAW,KAAK,QAAQ;QACpC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC;QAClC,IAAI,CAAC,WAAW,IAAI,CAAC,CACrB,CAAC;AACH,CAAC","sourcesContent":["export const TERMINAL_MONITOR_STATE_EVENT = \"terminal_monitor_state\";\n\nexport interface TerminalMonitorStateEvent {\n\treadonly activeCount: number;\n}\n\nexport function isTerminalMonitorStateEvent(data: unknown): data is TerminalMonitorStateEvent {\n\treturn (\n\t\ttypeof data === \"object\" &&\n\t\tdata !== null &&\n\t\t\"activeCount\" in data &&\n\t\ttypeof data.activeCount === \"number\" &&\n\t\tNumber.isInteger(data.activeCount) &&\n\t\tdata.activeCount >= 0\n\t);\n}\n"]}
1
+ {"version":3,"file":"monitor-state-event.js","sourceRoot":"","sources":["../../../../src/core/extensions/builtin/monitor-state-event.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,4BAA4B,GAAG,wBAAwB,CAAC;AAiBrE,MAAM,UAAU,2BAA2B,CAAC,IAAa;IACxD,OAAO,CACN,OAAO,IAAI,KAAK,QAAQ;QACxB,IAAI,KAAK,IAAI;QACb,aAAa,IAAI,IAAI;QACrB,OAAO,IAAI,CAAC,WAAW,KAAK,QAAQ;QACpC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC;QAClC,IAAI,CAAC,WAAW,IAAI,CAAC,CACrB,CAAC;AACH,CAAC","sourcesContent":["export const TERMINAL_MONITOR_STATE_EVENT = \"terminal_monitor_state\";\n\n/** One live watch as broadcast on the monitor state event; mirrors MonitorSnapshotEntry. */\nexport interface TerminalMonitorStateMonitorEntry {\n\treadonly id: string;\n\treadonly description: string;\n\treadonly paused: boolean;\n\t/** Epoch milliseconds when the watch registered; lets consumers render their own elapsed labels. */\n\treadonly startedAtMs: number;\n}\n\nexport interface TerminalMonitorStateEvent {\n\treadonly activeCount: number;\n\t/** Per-watch detail for consumers that need more than the count; absent in pre-enrichment payloads. */\n\treadonly monitors?: readonly TerminalMonitorStateMonitorEntry[];\n}\n\nexport function isTerminalMonitorStateEvent(data: unknown): data is TerminalMonitorStateEvent {\n\treturn (\n\t\ttypeof data === \"object\" &&\n\t\tdata !== null &&\n\t\t\"activeCount\" in data &&\n\t\ttypeof data.activeCount === \"number\" &&\n\t\tNumber.isInteger(data.activeCount) &&\n\t\tdata.activeCount >= 0\n\t);\n}\n"]}
@@ -0,0 +1,3 @@
1
+ import { type BuildDynamicSystemPromptOptions } from "../../../dynamic-prompt/build.ts";
2
+ export declare function buildDeepseekV4Flash0731Prompt(options: BuildDynamicSystemPromptOptions): string;
3
+ //# sourceMappingURL=deepseek-v4-flash-0731.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deepseek-v4-flash-0731.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/deepseek-v4-flash-0731.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,+BAA+B,EAA4B,MAAM,kCAAkC,CAAC;AAGlH,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,+BAA+B,GAAG,MAAM,CAS/F"}
@@ -0,0 +1,10 @@
1
+ import { buildDynamicSystemPrompt } from "../../../dynamic-prompt/build.js";
2
+ import { buildDeepseekV4FlashIntro, buildDeepseekV4Tuning } from "./deepseek-v4.js";
3
+ export function buildDeepseekV4Flash0731Prompt(options) {
4
+ return buildDynamicSystemPrompt({
5
+ ...options,
6
+ tuningSection: buildDeepseekV4Tuning("deepseek-v4-flash-0731", buildDeepseekV4FlashIntro("DeepSeek V4 Flash (0731 snapshot)")),
7
+ workstationDialect: "claude",
8
+ });
9
+ }
10
+ //# sourceMappingURL=deepseek-v4-flash-0731.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deepseek-v4-flash-0731.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/deepseek-v4-flash-0731.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAClH,OAAO,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAEpF,MAAM,UAAU,8BAA8B,CAAC,OAAwC;IACtF,OAAO,wBAAwB,CAAC;QAC/B,GAAG,OAAO;QACV,aAAa,EAAE,qBAAqB,CACnC,wBAAwB,EACxB,yBAAyB,CAAC,mCAAmC,CAAC,CAC9D;QACD,kBAAkB,EAAE,QAAQ;KAC5B,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { type BuildDynamicSystemPromptOptions, buildDynamicSystemPrompt } from \"../../../dynamic-prompt/build.ts\";\nimport { buildDeepseekV4FlashIntro, buildDeepseekV4Tuning } from \"./deepseek-v4.ts\";\n\nexport function buildDeepseekV4Flash0731Prompt(options: BuildDynamicSystemPromptOptions): string {\n\treturn buildDynamicSystemPrompt({\n\t\t...options,\n\t\ttuningSection: buildDeepseekV4Tuning(\n\t\t\t\"deepseek-v4-flash-0731\",\n\t\t\tbuildDeepseekV4FlashIntro(\"DeepSeek V4 Flash (0731 snapshot)\"),\n\t\t),\n\t\tworkstationDialect: \"claude\",\n\t});\n}\n"]}
@@ -0,0 +1,3 @@
1
+ import { type BuildDynamicSystemPromptOptions } from "../../../dynamic-prompt/build.ts";
2
+ export declare function buildDeepseekV4FlashPrompt(options: BuildDynamicSystemPromptOptions): string;
3
+ //# sourceMappingURL=deepseek-v4-flash.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deepseek-v4-flash.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/deepseek-v4-flash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,+BAA+B,EAA4B,MAAM,kCAAkC,CAAC;AAGlH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,+BAA+B,GAAG,MAAM,CAM3F"}
@@ -0,0 +1,10 @@
1
+ import { buildDynamicSystemPrompt } from "../../../dynamic-prompt/build.js";
2
+ import { buildDeepseekV4FlashIntro, buildDeepseekV4Tuning } from "./deepseek-v4.js";
3
+ export function buildDeepseekV4FlashPrompt(options) {
4
+ return buildDynamicSystemPrompt({
5
+ ...options,
6
+ tuningSection: buildDeepseekV4Tuning("deepseek-v4-flash", buildDeepseekV4FlashIntro("DeepSeek V4 Flash")),
7
+ workstationDialect: "claude",
8
+ });
9
+ }
10
+ //# sourceMappingURL=deepseek-v4-flash.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deepseek-v4-flash.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/deepseek-v4-flash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAClH,OAAO,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAEpF,MAAM,UAAU,0BAA0B,CAAC,OAAwC;IAClF,OAAO,wBAAwB,CAAC;QAC/B,GAAG,OAAO;QACV,aAAa,EAAE,qBAAqB,CAAC,mBAAmB,EAAE,yBAAyB,CAAC,mBAAmB,CAAC,CAAC;QACzG,kBAAkB,EAAE,QAAQ;KAC5B,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { type BuildDynamicSystemPromptOptions, buildDynamicSystemPrompt } from \"../../../dynamic-prompt/build.ts\";\nimport { buildDeepseekV4FlashIntro, buildDeepseekV4Tuning } from \"./deepseek-v4.ts\";\n\nexport function buildDeepseekV4FlashPrompt(options: BuildDynamicSystemPromptOptions): string {\n\treturn buildDynamicSystemPrompt({\n\t\t...options,\n\t\ttuningSection: buildDeepseekV4Tuning(\"deepseek-v4-flash\", buildDeepseekV4FlashIntro(\"DeepSeek V4 Flash\")),\n\t\tworkstationDialect: \"claude\",\n\t});\n}\n"]}
@@ -0,0 +1,3 @@
1
+ import { type BuildDynamicSystemPromptOptions } from "../../../dynamic-prompt/build.ts";
2
+ export declare function buildDeepseekV4ProPrompt(options: BuildDynamicSystemPromptOptions): string;
3
+ //# sourceMappingURL=deepseek-v4-pro.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deepseek-v4-pro.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/deepseek-v4-pro.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,+BAA+B,EAA4B,MAAM,kCAAkC,CAAC;AAMlH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,+BAA+B,GAAG,MAAM,CAMzF"}
@@ -0,0 +1,11 @@
1
+ import { buildDynamicSystemPrompt } from "../../../dynamic-prompt/build.js";
2
+ import { buildDeepseekV4Tuning } from "./deepseek-v4.js";
3
+ const PRO_INTRO = "You are running on DeepSeek V4 Pro - a deep reasoner with a decisive finish. Reasoning depth is a budget spent on the problem, not a ritual: routine classification, file edits, and lookups are decided directly, while hard design and debugging work gets the full depth.";
4
+ export function buildDeepseekV4ProPrompt(options) {
5
+ return buildDynamicSystemPrompt({
6
+ ...options,
7
+ tuningSection: buildDeepseekV4Tuning("deepseek-v4-pro", PRO_INTRO),
8
+ workstationDialect: "claude",
9
+ });
10
+ }
11
+ //# sourceMappingURL=deepseek-v4-pro.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deepseek-v4-pro.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/deepseek-v4-pro.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAClH,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,MAAM,SAAS,GACd,8QAA8Q,CAAC;AAEhR,MAAM,UAAU,wBAAwB,CAAC,OAAwC;IAChF,OAAO,wBAAwB,CAAC;QAC/B,GAAG,OAAO;QACV,aAAa,EAAE,qBAAqB,CAAC,iBAAiB,EAAE,SAAS,CAAC;QAClE,kBAAkB,EAAE,QAAQ;KAC5B,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { type BuildDynamicSystemPromptOptions, buildDynamicSystemPrompt } from \"../../../dynamic-prompt/build.ts\";\nimport { buildDeepseekV4Tuning } from \"./deepseek-v4.ts\";\n\nconst PRO_INTRO =\n\t\"You are running on DeepSeek V4 Pro - a deep reasoner with a decisive finish. Reasoning depth is a budget spent on the problem, not a ritual: routine classification, file edits, and lookups are decided directly, while hard design and debugging work gets the full depth.\";\n\nexport function buildDeepseekV4ProPrompt(options: BuildDynamicSystemPromptOptions): string {\n\treturn buildDynamicSystemPrompt({\n\t\t...options,\n\t\ttuningSection: buildDeepseekV4Tuning(\"deepseek-v4-pro\", PRO_INTRO),\n\t\tworkstationDialect: \"claude\",\n\t});\n}\n"]}
@@ -0,0 +1,13 @@
1
+ export type DeepseekV4RuleId = "injected-directive-authority" | "todo-discipline" | "missing-info" | "settled-reading" | "reasoning-aim";
2
+ export type DeepseekV4Concern = "harness-contract" | "todo" | "grounding" | "deliberation";
3
+ export type DeepseekV4PresetName = "deepseek-v4-flash" | "deepseek-v4-flash-0731" | "deepseek-v4-pro";
4
+ export interface DeepseekV4Rule {
5
+ readonly id: DeepseekV4RuleId;
6
+ readonly concern: DeepseekV4Concern;
7
+ readonly presets: readonly DeepseekV4PresetName[];
8
+ readonly directive: string;
9
+ }
10
+ export declare const DEEPSEEK_V4_RULES: readonly DeepseekV4Rule[];
11
+ export declare function buildDeepseekV4FlashIntro(modelLabel: string): string;
12
+ export declare function buildDeepseekV4Tuning(preset: DeepseekV4PresetName, intro: string): string;
13
+ //# sourceMappingURL=deepseek-v4.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deepseek-v4.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/deepseek-v4.ts"],"names":[],"mappings":"AAmBA,MAAM,MAAM,gBAAgB,GACzB,8BAA8B,GAC9B,iBAAiB,GACjB,cAAc,GACd,iBAAiB,GACjB,eAAe,CAAC;AAEnB,MAAM,MAAM,iBAAiB,GAAG,kBAAkB,GAAG,MAAM,GAAG,WAAW,GAAG,cAAc,CAAC;AAE3F,MAAM,MAAM,oBAAoB,GAAG,mBAAmB,GAAG,wBAAwB,GAAG,iBAAiB,CAAC;AAEtG,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,EAAE,EAAE,gBAAgB,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE,iBAAiB,CAAC;IACpC,QAAQ,CAAC,OAAO,EAAE,SAAS,oBAAoB,EAAE,CAAC;IAClD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC3B;AAKD,eAAO,MAAM,iBAAiB,EAAE,SAAS,cAAc,EAoCtD,CAAC;AAEF,wBAAgB,yBAAyB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAEpE;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAGzF"}
@@ -0,0 +1,60 @@
1
+ // Shared DeepSeek V4 family tuning.
2
+ //
3
+ // DeepSeek V4 is a structure-follower: the chat-deep.ai prompt guide's live
4
+ // benchmark (2026-07-28) measured explicit task/constraint/verification
5
+ // structure lifting compliance from 7.1/10 to 9.6/10, and DeepSeek's own docs
6
+ // route behavior through settings, not incantations. The presets therefore
7
+ // stay thin tuningSection wrappers over the shared dynamic core and carry only
8
+ // trained-prior overrides, stated once each as typed rule data (gpt-5.6.ts
9
+ // precedent) so tests assert parsed rules instead of pinned sentences.
10
+ //
11
+ // The overrides come from observed failure transcripts on
12
+ // DeepSeek-V4-Flash-0731 (2026-07-31): the model audits the provenance of
13
+ // harness-injected directives ("the user didn't say ulw-loop... probably
14
+ // residual context"), downsizes mandated workflows as too heavy, oscillates on
15
+ // settled readings ("Actually wait - let me reconsider"), and never updates
16
+ // the todo list. Each rule replaces that prior with a positive decision rule
17
+ // and a terminal condition; none of them restate behavior the shared core
18
+ // already carries.
19
+ const ALL_PRESETS = ["deepseek-v4-flash", "deepseek-v4-flash-0731", "deepseek-v4-pro"];
20
+ const FLASH_LINE = ["deepseek-v4-flash", "deepseek-v4-flash-0731"];
21
+ export const DEEPSEEK_V4_RULES = [
22
+ {
23
+ id: "injected-directive-authority",
24
+ concern: "harness-contract",
25
+ presets: ALL_PRESETS,
26
+ directive: 'Injected directives are binding: skill contents, mode directives such as ultrawork or ulw-loop, and hook or system messages that appear in the conversation carry the same authority as words the user typed. Presence means it applies to the current task at its prescribed weight - the harness already decided by injecting it. Whether it was "really requested", is "residual context", or feels "too heavy" for the task are settled questions: spend zero reasoning on them and execute the directive as written.',
27
+ },
28
+ {
29
+ id: "todo-discipline",
30
+ concern: "todo",
31
+ presets: ALL_PRESETS,
32
+ directive: "On any multi-step task, write the todo list before the first edit and keep it live: one atomic item per step, exactly one item in progress, and each item marked completed the moment it finishes. Update the list at every state transition - never batch updates at the end, and never work a step the list does not show. A todo list that lags reality is a defect to fix before continuing, not an optimization to skip.",
33
+ },
34
+ {
35
+ id: "missing-info",
36
+ concern: "grounding",
37
+ presets: ALL_PRESETS,
38
+ directive: "When required information is missing, name it and get it - a file read, a tool call, or one specific question - instead of inventing it.",
39
+ },
40
+ {
41
+ id: "settled-reading",
42
+ concern: "deliberation",
43
+ presets: FLASH_LINE,
44
+ directive: 'Commit to one reading and act on it: once you settle an interpretation of the request or an instruction, reopen it only when a tool result contradicts it. "Wait, let me reconsider" loops over the same evidence add no information - decide, verify with a cheap tool call, and move on.',
45
+ },
46
+ {
47
+ id: "reasoning-aim",
48
+ concern: "deliberation",
49
+ presets: ["deepseek-v4-pro"],
50
+ directive: "Aim extended reasoning at the problem - the code, the design, the failure - and end it in an action. When reasoning stalls on a missing fact, stop deliberating and fetch the fact; a cheap read beats a long internal debate. Deliver a conclusion and a recommendation, not a survey of options.",
51
+ },
52
+ ];
53
+ export function buildDeepseekV4FlashIntro(modelLabel) {
54
+ return `You are running on ${modelLabel} - fast, literal, and structure-first. Read instructions as decision rules: literal scopes are literal ("every", "all", and "each" mean the full set), mechanical or already-specified work is executed directly, and deliberation is saved for genuine risk - ambiguity, failure, irreversible operations.`;
55
+ }
56
+ export function buildDeepseekV4Tuning(preset, intro) {
57
+ const directives = DEEPSEEK_V4_RULES.filter((rule) => rule.presets.includes(preset)).map((rule) => rule.directive);
58
+ return [intro, ...directives].join("\n\n");
59
+ }
60
+ //# sourceMappingURL=deepseek-v4.js.map