@qduc/term2 0.21.0 → 0.22.1

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 (681) hide show
  1. package/dist/agent.d.ts +2 -0
  2. package/dist/agent.d.ts.map +1 -1
  3. package/dist/agent.js +32 -10
  4. package/dist/agent.js.map +1 -1
  5. package/dist/app.d.ts.map +1 -1
  6. package/dist/app.js +83 -6
  7. package/dist/app.js.map +1 -1
  8. package/dist/cli.js +84 -2
  9. package/dist/cli.js.map +1 -1
  10. package/dist/components/InputBox.js +2 -3
  11. package/dist/components/InputBox.js.map +1 -1
  12. package/dist/components/common/MenuContainer.d.ts +15 -0
  13. package/dist/components/common/MenuContainer.d.ts.map +1 -1
  14. package/dist/components/common/MenuContainer.js +66 -32
  15. package/dist/components/common/MenuContainer.js.map +1 -1
  16. package/dist/components/input/MentorPoolMenuSession.d.ts.map +1 -1
  17. package/dist/components/input/MentorPoolMenuSession.js +5 -8
  18. package/dist/components/input/MentorPoolMenuSession.js.map +1 -1
  19. package/dist/components/input/MenuSurface.d.ts.map +1 -1
  20. package/dist/components/input/MenuSurface.js +12 -2
  21. package/dist/components/input/MenuSurface.js.map +1 -1
  22. package/dist/components/input/ModelMenuSession.d.ts.map +1 -1
  23. package/dist/components/input/ModelMenuSession.js +71 -34
  24. package/dist/components/input/ModelMenuSession.js.map +1 -1
  25. package/dist/components/input/SettingsMenuSession.d.ts.map +1 -1
  26. package/dist/components/input/SettingsMenuSession.js +56 -17
  27. package/dist/components/input/SettingsMenuSession.js.map +1 -1
  28. package/dist/components/input/SettingsValueMenuSession.d.ts.map +1 -1
  29. package/dist/components/input/SettingsValueMenuSession.js +33 -3
  30. package/dist/components/input/SettingsValueMenuSession.js.map +1 -1
  31. package/dist/components/input/menu-types.d.ts +1 -1
  32. package/dist/components/input/menu-types.d.ts.map +1 -1
  33. package/dist/components/input/triggers.js +2 -2
  34. package/dist/components/input/triggers.js.map +1 -1
  35. package/dist/components/layout/BackgroundTasksPanel.d.ts +0 -1
  36. package/dist/components/layout/BackgroundTasksPanel.d.ts.map +1 -1
  37. package/dist/components/layout/BackgroundTasksPanel.js +4 -112
  38. package/dist/components/layout/BackgroundTasksPanel.js.map +1 -1
  39. package/dist/components/menu/ModelSelectionMenu.d.ts +10 -0
  40. package/dist/components/menu/ModelSelectionMenu.d.ts.map +1 -1
  41. package/dist/components/menu/ModelSelectionMenu.js +86 -17
  42. package/dist/components/menu/ModelSelectionMenu.js.map +1 -1
  43. package/dist/components/menu/ProfileSelectionMenu.d.ts.map +1 -1
  44. package/dist/components/menu/ProfileSelectionMenu.js +15 -14
  45. package/dist/components/menu/ProfileSelectionMenu.js.map +1 -1
  46. package/dist/components/menu/ResumeSelectionMenu.d.ts.map +1 -1
  47. package/dist/components/menu/ResumeSelectionMenu.js +13 -15
  48. package/dist/components/menu/ResumeSelectionMenu.js.map +1 -1
  49. package/dist/components/menu/SettingsSelectionMenu.d.ts.map +1 -1
  50. package/dist/components/menu/SettingsSelectionMenu.js +4 -32
  51. package/dist/components/menu/SettingsSelectionMenu.js.map +1 -1
  52. package/dist/components/menu/SettingsValueSelectionMenu.d.ts.map +1 -1
  53. package/dist/components/menu/SettingsValueSelectionMenu.js +12 -5
  54. package/dist/components/menu/SettingsValueSelectionMenu.js.map +1 -1
  55. package/dist/components/menu/SkillSelectionMenu.d.ts.map +1 -1
  56. package/dist/components/menu/SkillSelectionMenu.js +13 -16
  57. package/dist/components/menu/SkillSelectionMenu.js.map +1 -1
  58. package/dist/components/menu/SlashCommandMenu.d.ts +8 -0
  59. package/dist/components/menu/SlashCommandMenu.d.ts.map +1 -1
  60. package/dist/components/menu/SlashCommandMenu.js +16 -6
  61. package/dist/components/menu/SlashCommandMenu.js.map +1 -1
  62. package/dist/components/menu/StandaloneModelPickerApp.d.ts +40 -0
  63. package/dist/components/menu/StandaloneModelPickerApp.d.ts.map +1 -0
  64. package/dist/components/menu/StandaloneModelPickerApp.js +105 -0
  65. package/dist/components/menu/StandaloneModelPickerApp.js.map +1 -0
  66. package/dist/components/menu/settings-value-formatter.d.ts +11 -0
  67. package/dist/components/menu/settings-value-formatter.d.ts.map +1 -0
  68. package/dist/components/menu/settings-value-formatter.js +214 -0
  69. package/dist/components/menu/settings-value-formatter.js.map +1 -0
  70. package/dist/components/message/CommandMessage.d.ts.map +1 -1
  71. package/dist/components/message/CommandMessage.js +22 -17
  72. package/dist/components/message/CommandMessage.js.map +1 -1
  73. package/dist/components/message/MessageList.d.ts +2 -1
  74. package/dist/components/message/MessageList.d.ts.map +1 -1
  75. package/dist/components/message/MessageList.js +25 -40
  76. package/dist/components/message/MessageList.js.map +1 -1
  77. package/dist/components/message/RunCodeRenderer.d.ts +16 -0
  78. package/dist/components/message/RunCodeRenderer.d.ts.map +1 -0
  79. package/dist/components/message/RunCodeRenderer.js +25 -0
  80. package/dist/components/message/RunCodeRenderer.js.map +1 -0
  81. package/dist/components/message/command-message-helpers.d.ts +30 -0
  82. package/dist/components/message/command-message-helpers.d.ts.map +1 -1
  83. package/dist/components/message/command-message-helpers.js +85 -0
  84. package/dist/components/message/command-message-helpers.js.map +1 -1
  85. package/dist/components/prompt/ApprovalPrompt.d.ts.map +1 -1
  86. package/dist/components/prompt/ApprovalPrompt.js +12 -21
  87. package/dist/components/prompt/ApprovalPrompt.js.map +1 -1
  88. package/dist/components/theme.d.ts +1 -0
  89. package/dist/components/theme.d.ts.map +1 -1
  90. package/dist/components/theme.js +1 -0
  91. package/dist/components/theme.js.map +1 -1
  92. package/dist/contracts/streamed-model-turn.d.ts +6 -0
  93. package/dist/contracts/streamed-model-turn.d.ts.map +1 -1
  94. package/dist/hooks/conversation-ui-reducer.d.ts.map +1 -1
  95. package/dist/hooks/conversation-ui-reducer.js +5 -2
  96. package/dist/hooks/conversation-ui-reducer.js.map +1 -1
  97. package/dist/hooks/settings-completion-config.d.ts +1 -1
  98. package/dist/hooks/settings-completion-config.d.ts.map +1 -1
  99. package/dist/hooks/settings-completion-config.js +4 -122
  100. package/dist/hooks/settings-completion-config.js.map +1 -1
  101. package/dist/hooks/settings-completion-logic.d.ts +1 -1
  102. package/dist/hooks/settings-completion-logic.d.ts.map +1 -1
  103. package/dist/hooks/settings-completion-logic.js.map +1 -1
  104. package/dist/hooks/use-app-keyboard-shortcuts.d.ts.map +1 -1
  105. package/dist/hooks/use-app-keyboard-shortcuts.js +33 -20
  106. package/dist/hooks/use-app-keyboard-shortcuts.js.map +1 -1
  107. package/dist/hooks/use-conversation.d.ts +3 -0
  108. package/dist/hooks/use-conversation.d.ts.map +1 -1
  109. package/dist/hooks/use-conversation.js +107 -16
  110. package/dist/hooks/use-conversation.js.map +1 -1
  111. package/dist/hooks/use-mentor-pool-selection.d.ts +5 -3
  112. package/dist/hooks/use-mentor-pool-selection.d.ts.map +1 -1
  113. package/dist/hooks/use-mentor-pool-selection.js +63 -51
  114. package/dist/hooks/use-mentor-pool-selection.js.map +1 -1
  115. package/dist/hooks/use-model-selection.d.ts +33 -4
  116. package/dist/hooks/use-model-selection.d.ts.map +1 -1
  117. package/dist/hooks/use-model-selection.js +204 -114
  118. package/dist/hooks/use-model-selection.js.map +1 -1
  119. package/dist/hooks/use-settings-completion.d.ts.map +1 -1
  120. package/dist/hooks/use-settings-completion.js +1 -6
  121. package/dist/hooks/use-settings-completion.js.map +1 -1
  122. package/dist/hooks/use-settings-value-completion.d.ts +1 -8
  123. package/dist/hooks/use-settings-value-completion.d.ts.map +1 -1
  124. package/dist/hooks/use-settings-value-completion.js +10 -100
  125. package/dist/hooks/use-settings-value-completion.js.map +1 -1
  126. package/dist/hooks/use-slash-commands.d.ts.map +1 -1
  127. package/dist/hooks/use-slash-commands.js +19 -13
  128. package/dist/hooks/use-slash-commands.js.map +1 -1
  129. package/dist/hooks/use-standalone-model-picker.d.ts +64 -0
  130. package/dist/hooks/use-standalone-model-picker.d.ts.map +1 -0
  131. package/dist/hooks/use-standalone-model-picker.js +310 -0
  132. package/dist/hooks/use-standalone-model-picker.js.map +1 -0
  133. package/dist/lib/agent-client.d.ts +17 -1
  134. package/dist/lib/agent-client.d.ts.map +1 -1
  135. package/dist/lib/agent-client.js +173 -53
  136. package/dist/lib/agent-client.js.map +1 -1
  137. package/dist/lib/agent-configuration.d.ts +12 -3
  138. package/dist/lib/agent-configuration.d.ts.map +1 -1
  139. package/dist/lib/agent-configuration.js +26 -7
  140. package/dist/lib/agent-configuration.js.map +1 -1
  141. package/dist/lib/agent-factory.d.ts +3 -0
  142. package/dist/lib/agent-factory.d.ts.map +1 -1
  143. package/dist/lib/agent-factory.js +49 -7
  144. package/dist/lib/agent-factory.js.map +1 -1
  145. package/dist/lib/ask-user-answer-store.d.ts +1 -0
  146. package/dist/lib/ask-user-answer-store.d.ts.map +1 -1
  147. package/dist/lib/ask-user-answer-store.js +3 -0
  148. package/dist/lib/ask-user-answer-store.js.map +1 -1
  149. package/dist/lib/tool-invoke.d.ts +1 -0
  150. package/dist/lib/tool-invoke.d.ts.map +1 -1
  151. package/dist/lib/tool-invoke.js +1 -0
  152. package/dist/lib/tool-invoke.js.map +1 -1
  153. package/dist/non-interactive.d.ts +23 -0
  154. package/dist/non-interactive.d.ts.map +1 -1
  155. package/dist/non-interactive.js +225 -31
  156. package/dist/non-interactive.js.map +1 -1
  157. package/dist/prompts/background-shell.d.ts.map +1 -1
  158. package/dist/prompts/background-shell.js +4 -2
  159. package/dist/prompts/background-shell.js.map +1 -1
  160. package/dist/prompts/background-shell.ts +4 -2
  161. package/dist/prompts/codex.md +1 -3
  162. package/dist/prompts/fragments/gpt-6-astra.md +13 -0
  163. package/dist/prompts/gpt-5-modern.md +1 -3
  164. package/dist/prompts/gpt-5.4-mini.md +0 -2
  165. package/dist/prompts/gpt-5.5.md +0 -2
  166. package/dist/prompts/gpt-5.6.md +0 -1
  167. package/dist/prompts/lite.md +1 -6
  168. package/dist/prompts/memory.md +2 -2
  169. package/dist/prompts/orchestrator.md +4 -4
  170. package/dist/prompts/prompt-constructor.d.ts +2 -0
  171. package/dist/prompts/prompt-constructor.d.ts.map +1 -1
  172. package/dist/prompts/prompt-constructor.js +4 -2
  173. package/dist/prompts/prompt-constructor.js.map +1 -1
  174. package/dist/prompts/prompt-constructor.test.ts +178 -5
  175. package/dist/prompts/prompt-constructor.ts +7 -1
  176. package/dist/prompts/prompt-profiles.d.ts.map +1 -1
  177. package/dist/prompts/prompt-profiles.js +6 -0
  178. package/dist/prompts/prompt-profiles.js.map +1 -1
  179. package/dist/prompts/prompt-profiles.test.ts +6 -4
  180. package/dist/prompts/prompt-profiles.ts +6 -0
  181. package/dist/prompts/session-browser.md +4 -2
  182. package/dist/prompts/shell-auto-approval.d.ts +1 -1
  183. package/dist/prompts/shell-auto-approval.d.ts.map +1 -1
  184. package/dist/prompts/shell-auto-approval.js +2 -2
  185. package/dist/prompts/shell-auto-approval.ts +2 -2
  186. package/dist/prompts/subagent-delegation.js +3 -3
  187. package/dist/prompts/subagent-delegation.js.map +1 -1
  188. package/dist/prompts/subagent-delegation.test.ts +3 -3
  189. package/dist/prompts/subagent-delegation.ts +3 -3
  190. package/dist/prompts/subagents/librarian.md +4 -4
  191. package/dist/prompts/subagents/worker-prompt.test.ts +7 -0
  192. package/dist/prompts/tool-surface-guidance.d.ts +4 -0
  193. package/dist/prompts/tool-surface-guidance.d.ts.map +1 -0
  194. package/dist/prompts/tool-surface-guidance.js +19 -0
  195. package/dist/prompts/tool-surface-guidance.js.map +1 -0
  196. package/dist/prompts/tool-surface-guidance.ts +20 -0
  197. package/dist/providers/codex-compact.d.ts +2 -0
  198. package/dist/providers/codex-compact.d.ts.map +1 -1
  199. package/dist/providers/codex-compact.js +14 -0
  200. package/dist/providers/codex-compact.js.map +1 -1
  201. package/dist/providers/codex-responses-model.d.ts +23 -3
  202. package/dist/providers/codex-responses-model.d.ts.map +1 -1
  203. package/dist/providers/codex-responses-model.js +121 -33
  204. package/dist/providers/codex-responses-model.js.map +1 -1
  205. package/dist/providers/codex.provider.d.ts +2 -0
  206. package/dist/providers/codex.provider.d.ts.map +1 -1
  207. package/dist/providers/codex.provider.js +3 -2
  208. package/dist/providers/codex.provider.js.map +1 -1
  209. package/dist/providers/grok.provider.d.ts.map +1 -1
  210. package/dist/providers/grok.provider.js +5 -2
  211. package/dist/providers/grok.provider.js.map +1 -1
  212. package/dist/providers/model-catalog/catalog.generated.d.ts +453 -309
  213. package/dist/providers/model-catalog/catalog.generated.d.ts.map +1 -1
  214. package/dist/providers/model-catalog/catalog.generated.js +453 -309
  215. package/dist/providers/model-catalog/catalog.generated.js.map +1 -1
  216. package/dist/providers/opencode-session.d.ts.map +1 -1
  217. package/dist/providers/opencode-session.js +5 -0
  218. package/dist/providers/opencode-session.js.map +1 -1
  219. package/dist/providers/openrouter.provider.js +8 -1
  220. package/dist/providers/openrouter.provider.js.map +1 -1
  221. package/dist/providers/responses-websocket-sessions.d.ts +10 -0
  222. package/dist/providers/responses-websocket-sessions.d.ts.map +1 -1
  223. package/dist/providers/responses-websocket-sessions.js +9 -4
  224. package/dist/providers/responses-websocket-sessions.js.map +1 -1
  225. package/dist/providers/retrying-model.d.ts +2 -1
  226. package/dist/providers/retrying-model.d.ts.map +1 -1
  227. package/dist/providers/retrying-model.js +3 -0
  228. package/dist/providers/retrying-model.js.map +1 -1
  229. package/dist/services/agent-runtime/application-run-loop.d.ts +8 -1
  230. package/dist/services/agent-runtime/application-run-loop.d.ts.map +1 -1
  231. package/dist/services/agent-runtime/application-run-loop.js +30 -6
  232. package/dist/services/agent-runtime/application-run-loop.js.map +1 -1
  233. package/dist/services/agent-runtime/context-compaction/index.d.ts +2 -0
  234. package/dist/services/agent-runtime/context-compaction/index.d.ts.map +1 -1
  235. package/dist/services/agent-runtime/context-compaction/index.js +30 -4
  236. package/dist/services/agent-runtime/context-compaction/index.js.map +1 -1
  237. package/dist/services/agent-runtime/context-compaction/local-context-compactor.d.ts +3 -0
  238. package/dist/services/agent-runtime/context-compaction/local-context-compactor.d.ts.map +1 -1
  239. package/dist/services/agent-runtime/context-compaction/local-context-compactor.js +15 -9
  240. package/dist/services/agent-runtime/context-compaction/local-context-compactor.js.map +1 -1
  241. package/dist/services/agent-runtime/model-resolver.d.ts.map +1 -1
  242. package/dist/services/agent-runtime/model-resolver.js +1 -23
  243. package/dist/services/agent-runtime/model-resolver.js.map +1 -1
  244. package/dist/services/agent-runtime/tool-invocation-context.d.ts +12 -0
  245. package/dist/services/agent-runtime/tool-invocation-context.d.ts.map +1 -1
  246. package/dist/services/agent-runtime/workflow/workflow-evaluator.d.ts +7 -1
  247. package/dist/services/agent-runtime/workflow/workflow-evaluator.d.ts.map +1 -1
  248. package/dist/services/agent-runtime/workflow/workflow-evaluator.js +78 -183
  249. package/dist/services/agent-runtime/workflow/workflow-evaluator.js.map +1 -1
  250. package/dist/services/agent-runtime/workflow/workflow-sandbox.d.ts +4 -3
  251. package/dist/services/agent-runtime/workflow/workflow-sandbox.d.ts.map +1 -1
  252. package/dist/services/agent-runtime/workflow/workflow-sandbox.js +9 -7
  253. package/dist/services/agent-runtime/workflow/workflow-sandbox.js.map +1 -1
  254. package/dist/services/agent-runtime/workflow/workflow-types.d.ts +1 -1
  255. package/dist/services/agent-runtime/workflow/workflow-types.d.ts.map +1 -1
  256. package/dist/services/agent-runtime/workflow/workflow-types.js.map +1 -1
  257. package/dist/services/approval/approval-decision-executor.d.ts +2 -1
  258. package/dist/services/approval/approval-decision-executor.d.ts.map +1 -1
  259. package/dist/services/approval/approval-decision-executor.js +22 -116
  260. package/dist/services/approval/approval-decision-executor.js.map +1 -1
  261. package/dist/services/approval/approval-descriptor.d.ts +10 -0
  262. package/dist/services/approval/approval-descriptor.d.ts.map +1 -0
  263. package/dist/services/approval/approval-descriptor.js +23 -0
  264. package/dist/services/approval/approval-descriptor.js.map +1 -0
  265. package/dist/services/approval/approval-flow-coordinator.d.ts +2 -1
  266. package/dist/services/approval/approval-flow-coordinator.d.ts.map +1 -1
  267. package/dist/services/approval/approval-flow-coordinator.js +2 -1
  268. package/dist/services/approval/approval-flow-coordinator.js.map +1 -1
  269. package/dist/services/approval/approval-grant-executor.d.ts +25 -0
  270. package/dist/services/approval/approval-grant-executor.d.ts.map +1 -0
  271. package/dist/services/approval/approval-grant-executor.js +125 -0
  272. package/dist/services/approval/approval-grant-executor.js.map +1 -0
  273. package/dist/services/approval/background-subagent-approval-controller.d.ts +2 -1
  274. package/dist/services/approval/background-subagent-approval-controller.d.ts.map +1 -1
  275. package/dist/services/approval/background-subagent-approval-controller.js.map +1 -1
  276. package/dist/services/approval/nested-approval-owner.d.ts +52 -0
  277. package/dist/services/approval/nested-approval-owner.d.ts.map +1 -0
  278. package/dist/services/approval/nested-approval-owner.js +194 -0
  279. package/dist/services/approval/nested-approval-owner.js.map +1 -0
  280. package/dist/services/approval/non-interactive-approval-policy.js +1 -1
  281. package/dist/services/approval/non-interactive-approval-policy.js.map +1 -1
  282. package/dist/services/approval/shell-auto-approval-evaluator.d.ts.map +1 -1
  283. package/dist/services/approval/shell-auto-approval-evaluator.js +2 -4
  284. package/dist/services/approval/shell-auto-approval-evaluator.js.map +1 -1
  285. package/dist/services/approval/shell-auto-approval-resolver.d.ts.map +1 -1
  286. package/dist/services/approval/shell-auto-approval-resolver.js +4 -0
  287. package/dist/services/approval/shell-auto-approval-resolver.js.map +1 -1
  288. package/dist/services/approval/tool-approval-batch-coordinator.d.ts +10 -3
  289. package/dist/services/approval/tool-approval-batch-coordinator.d.ts.map +1 -1
  290. package/dist/services/approval/tool-approval-batch-coordinator.js +16 -5
  291. package/dist/services/approval/tool-approval-batch-coordinator.js.map +1 -1
  292. package/dist/services/approval/tool-approval-policy-registry.d.ts +13 -0
  293. package/dist/services/approval/tool-approval-policy-registry.d.ts.map +1 -1
  294. package/dist/services/approval/tool-approval-policy-registry.js +16 -1
  295. package/dist/services/approval/tool-approval-policy-registry.js.map +1 -1
  296. package/dist/services/conversation/conversation-adapter-factory.d.ts +3 -1
  297. package/dist/services/conversation/conversation-adapter-factory.d.ts.map +1 -1
  298. package/dist/services/conversation/conversation-adapter-factory.js +3 -3
  299. package/dist/services/conversation/conversation-adapter-factory.js.map +1 -1
  300. package/dist/services/conversation/conversation-adapter.d.ts +3 -2
  301. package/dist/services/conversation/conversation-adapter.d.ts.map +1 -1
  302. package/dist/services/conversation/conversation-adapter.js +32 -23
  303. package/dist/services/conversation/conversation-adapter.js.map +1 -1
  304. package/dist/services/conversation/conversation-orchestrator.d.ts +11 -0
  305. package/dist/services/conversation/conversation-orchestrator.d.ts.map +1 -1
  306. package/dist/services/conversation/conversation-orchestrator.js +107 -64
  307. package/dist/services/conversation/conversation-orchestrator.js.map +1 -1
  308. package/dist/services/conversation/conversation-persistence.d.ts +6 -1
  309. package/dist/services/conversation/conversation-persistence.d.ts.map +1 -1
  310. package/dist/services/conversation/conversation-persistence.js +68 -19
  311. package/dist/services/conversation/conversation-persistence.js.map +1 -1
  312. package/dist/services/conversation/conversation-result-builder.d.ts +3 -0
  313. package/dist/services/conversation/conversation-result-builder.d.ts.map +1 -1
  314. package/dist/services/conversation/conversation-result-builder.js +27 -23
  315. package/dist/services/conversation/conversation-result-builder.js.map +1 -1
  316. package/dist/services/conversation/conversation-runtime-factory.d.ts +5 -0
  317. package/dist/services/conversation/conversation-runtime-factory.d.ts.map +1 -1
  318. package/dist/services/conversation/conversation-runtime-factory.js +1 -0
  319. package/dist/services/conversation/conversation-runtime-factory.js.map +1 -1
  320. package/dist/services/conversation/conversation-service.d.ts +11 -1
  321. package/dist/services/conversation/conversation-service.d.ts.map +1 -1
  322. package/dist/services/conversation/conversation-service.js +68 -17
  323. package/dist/services/conversation/conversation-service.js.map +1 -1
  324. package/dist/services/conversation/session-browser.d.ts +34 -27
  325. package/dist/services/conversation/session-browser.d.ts.map +1 -1
  326. package/dist/services/conversation/session-browser.js +221 -60
  327. package/dist/services/conversation/session-browser.js.map +1 -1
  328. package/dist/services/conversation/session-index/session-index-database.d.ts +138 -0
  329. package/dist/services/conversation/session-index/session-index-database.d.ts.map +1 -0
  330. package/dist/services/conversation/session-index/session-index-database.js +684 -0
  331. package/dist/services/conversation/session-index/session-index-database.js.map +1 -0
  332. package/dist/services/conversation/session-index/session-index-schema.d.ts +35 -0
  333. package/dist/services/conversation/session-index/session-index-schema.d.ts.map +1 -0
  334. package/dist/services/conversation/session-index/session-index-schema.js +156 -0
  335. package/dist/services/conversation/session-index/session-index-schema.js.map +1 -0
  336. package/dist/services/conversation/session-index/session-index-service.d.ts +30 -0
  337. package/dist/services/conversation/session-index/session-index-service.d.ts.map +1 -0
  338. package/dist/services/conversation/session-index/session-index-service.js +234 -0
  339. package/dist/services/conversation/session-index/session-index-service.js.map +1 -0
  340. package/dist/services/conversation/session-index/session-index-worker-client.d.ts +36 -0
  341. package/dist/services/conversation/session-index/session-index-worker-client.d.ts.map +1 -0
  342. package/dist/services/conversation/session-index/session-index-worker-client.js +143 -0
  343. package/dist/services/conversation/session-index/session-index-worker-client.js.map +1 -0
  344. package/dist/services/conversation/session-index/session-index-worker.d.ts +56 -0
  345. package/dist/services/conversation/session-index/session-index-worker.d.ts.map +1 -0
  346. package/dist/services/conversation/session-index/session-index-worker.js +96 -0
  347. package/dist/services/conversation/session-index/session-index-worker.js.map +1 -0
  348. package/dist/services/conversation/session-search-helpers.d.ts +4 -0
  349. package/dist/services/conversation/session-search-helpers.d.ts.map +1 -0
  350. package/dist/services/conversation/session-search-helpers.js +13 -0
  351. package/dist/services/conversation/session-search-helpers.js.map +1 -0
  352. package/dist/services/conversation-agent-client.d.ts +8 -0
  353. package/dist/services/conversation-agent-client.d.ts.map +1 -1
  354. package/dist/services/execution-context.js +2 -2
  355. package/dist/services/execution-context.js.map +1 -1
  356. package/dist/services/hooks/hook-event-factory.d.ts +2 -1
  357. package/dist/services/hooks/hook-event-factory.d.ts.map +1 -1
  358. package/dist/services/hooks/hook-event-factory.js +2 -1
  359. package/dist/services/hooks/hook-event-factory.js.map +1 -1
  360. package/dist/services/logging/conversation-log-writer.d.ts.map +1 -1
  361. package/dist/services/logging/conversation-log-writer.js +50 -26
  362. package/dist/services/logging/conversation-log-writer.js.map +1 -1
  363. package/dist/services/logging/logging-service.d.ts.map +1 -1
  364. package/dist/services/logging/logging-service.js +1 -0
  365. package/dist/services/logging/logging-service.js.map +1 -1
  366. package/dist/services/logging/provider-traffic.d.ts +22 -2
  367. package/dist/services/logging/provider-traffic.d.ts.map +1 -1
  368. package/dist/services/logging/provider-traffic.js +147 -12
  369. package/dist/services/logging/provider-traffic.js.map +1 -1
  370. package/dist/services/model-service.d.ts +42 -0
  371. package/dist/services/model-service.d.ts.map +1 -1
  372. package/dist/services/model-service.js +161 -26
  373. package/dist/services/model-service.js.map +1 -1
  374. package/dist/services/models/model-catalog-session.d.ts.map +1 -1
  375. package/dist/services/models/model-catalog-session.js +11 -7
  376. package/dist/services/models/model-catalog-session.js.map +1 -1
  377. package/dist/services/models/model-favorites.d.ts +56 -0
  378. package/dist/services/models/model-favorites.d.ts.map +1 -0
  379. package/dist/services/models/model-favorites.js +93 -0
  380. package/dist/services/models/model-favorites.js.map +1 -0
  381. package/dist/services/models/model-listing.d.ts +40 -0
  382. package/dist/services/models/model-listing.d.ts.map +1 -1
  383. package/dist/services/models/model-listing.js +35 -2
  384. package/dist/services/models/model-listing.js.map +1 -1
  385. package/dist/services/models/model-nicknames.d.ts +113 -0
  386. package/dist/services/models/model-nicknames.d.ts.map +1 -0
  387. package/dist/services/models/model-nicknames.js +182 -0
  388. package/dist/services/models/model-nicknames.js.map +1 -0
  389. package/dist/services/models/model-picker-host.d.ts +72 -0
  390. package/dist/services/models/model-picker-host.d.ts.map +1 -0
  391. package/dist/services/models/model-picker-host.js +86 -0
  392. package/dist/services/models/model-picker-host.js.map +1 -0
  393. package/dist/services/models/model-resolution.d.ts +35 -3
  394. package/dist/services/models/model-resolution.d.ts.map +1 -1
  395. package/dist/services/models/model-resolution.js +276 -47
  396. package/dist/services/models/model-resolution.js.map +1 -1
  397. package/dist/services/models/reasoning-effort.d.ts +20 -0
  398. package/dist/services/models/reasoning-effort.d.ts.map +1 -0
  399. package/dist/services/models/reasoning-effort.js +28 -0
  400. package/dist/services/models/reasoning-effort.js.map +1 -0
  401. package/dist/services/models/unified-model-catalog.d.ts +4 -0
  402. package/dist/services/models/unified-model-catalog.d.ts.map +1 -0
  403. package/dist/services/models/unified-model-catalog.js +54 -0
  404. package/dist/services/models/unified-model-catalog.js.map +1 -0
  405. package/dist/services/retry/provider-failure-classification.d.ts +16 -0
  406. package/dist/services/retry/provider-failure-classification.d.ts.map +1 -1
  407. package/dist/services/retry/provider-failure-classification.js +45 -0
  408. package/dist/services/retry/provider-failure-classification.js.map +1 -1
  409. package/dist/services/retry/retry-recovery-budget.d.ts +26 -1
  410. package/dist/services/retry/retry-recovery-budget.d.ts.map +1 -1
  411. package/dist/services/retry/retry-recovery-budget.js +33 -1
  412. package/dist/services/retry/retry-recovery-budget.js.map +1 -1
  413. package/dist/services/sandboxed-code-host/host-types.d.ts +135 -0
  414. package/dist/services/sandboxed-code-host/host-types.d.ts.map +1 -0
  415. package/dist/services/sandboxed-code-host/host-types.js +6 -0
  416. package/dist/services/sandboxed-code-host/host-types.js.map +1 -0
  417. package/dist/services/sandboxed-code-host/host-worker.d.ts +9 -0
  418. package/dist/services/sandboxed-code-host/host-worker.d.ts.map +1 -0
  419. package/dist/services/sandboxed-code-host/host-worker.js +351 -0
  420. package/dist/services/sandboxed-code-host/host-worker.js.map +1 -0
  421. package/dist/services/sandboxed-code-host/sandbox.d.ts +16 -0
  422. package/dist/services/sandboxed-code-host/sandbox.d.ts.map +1 -0
  423. package/dist/services/sandboxed-code-host/sandbox.js +21 -0
  424. package/dist/services/sandboxed-code-host/sandbox.js.map +1 -0
  425. package/dist/services/sandboxed-code-host/sandboxed-code-host.d.ts +17 -0
  426. package/dist/services/sandboxed-code-host/sandboxed-code-host.d.ts.map +1 -0
  427. package/dist/services/sandboxed-code-host/sandboxed-code-host.js +347 -0
  428. package/dist/services/sandboxed-code-host/sandboxed-code-host.js.map +1 -0
  429. package/dist/services/service-interfaces.d.ts +32 -0
  430. package/dist/services/service-interfaces.d.ts.map +1 -1
  431. package/dist/services/session/background-task-control.d.ts +3 -1
  432. package/dist/services/session/background-task-control.d.ts.map +1 -1
  433. package/dist/services/session/background-task-control.js +4 -0
  434. package/dist/services/session/background-task-control.js.map +1 -1
  435. package/dist/services/session/continuation-plan-applier.d.ts +2 -1
  436. package/dist/services/session/continuation-plan-applier.d.ts.map +1 -1
  437. package/dist/services/session/continuation-plan-applier.js.map +1 -1
  438. package/dist/services/session/continuation-recovery-handler.d.ts +2 -1
  439. package/dist/services/session/continuation-recovery-handler.d.ts.map +1 -1
  440. package/dist/services/session/continuation-recovery-handler.js +49 -5
  441. package/dist/services/session/continuation-recovery-handler.js.map +1 -1
  442. package/dist/services/session/initial-input-preparer.d.ts +2 -1
  443. package/dist/services/session/initial-input-preparer.d.ts.map +1 -1
  444. package/dist/services/session/initial-input-preparer.js +2 -1
  445. package/dist/services/session/initial-input-preparer.js.map +1 -1
  446. package/dist/services/session/initial-turn-recovery-handler.d.ts +2 -1
  447. package/dist/services/session/initial-turn-recovery-handler.d.ts.map +1 -1
  448. package/dist/services/session/initial-turn-recovery-handler.js +51 -16
  449. package/dist/services/session/initial-turn-recovery-handler.js.map +1 -1
  450. package/dist/services/session/post-execute-pending-registry.d.ts +2 -1
  451. package/dist/services/session/post-execute-pending-registry.d.ts.map +1 -1
  452. package/dist/services/session/post-execute-pending-registry.js +3 -2
  453. package/dist/services/session/post-execute-pending-registry.js.map +1 -1
  454. package/dist/services/session/session-client-factory.d.ts +4 -0
  455. package/dist/services/session/session-client-factory.d.ts.map +1 -1
  456. package/dist/services/session/session-client-factory.js +12 -4
  457. package/dist/services/session/session-client-factory.js.map +1 -1
  458. package/dist/services/session/session-composition.d.ts +26 -2
  459. package/dist/services/session/session-composition.d.ts.map +1 -1
  460. package/dist/services/session/session-composition.js +97 -18
  461. package/dist/services/session/session-composition.js.map +1 -1
  462. package/dist/services/session/session-continuity-reset.d.ts +2 -1
  463. package/dist/services/session/session-continuity-reset.d.ts.map +1 -1
  464. package/dist/services/session/session-continuity-reset.js +5 -2
  465. package/dist/services/session/session-continuity-reset.js.map +1 -1
  466. package/dist/services/session/session-identity.d.ts +20 -0
  467. package/dist/services/session/session-identity.d.ts.map +1 -0
  468. package/dist/services/session/session-identity.js +43 -0
  469. package/dist/services/session/session-identity.js.map +1 -0
  470. package/dist/services/session/session-lifecycle.d.ts +5 -1
  471. package/dist/services/session/session-lifecycle.d.ts.map +1 -1
  472. package/dist/services/session/session-lifecycle.js +5 -1
  473. package/dist/services/session/session-lifecycle.js.map +1 -1
  474. package/dist/services/session/session-stream-processor.d.ts +2 -1
  475. package/dist/services/session/session-stream-processor.d.ts.map +1 -1
  476. package/dist/services/session/session-stream-processor.js +5 -4
  477. package/dist/services/session/session-stream-processor.js.map +1 -1
  478. package/dist/services/session/test-helpers/conversation-session-fixtures.d.ts.map +1 -1
  479. package/dist/services/session/test-helpers/conversation-session-fixtures.js +14 -9
  480. package/dist/services/session/test-helpers/conversation-session-fixtures.js.map +1 -1
  481. package/dist/services/session/turn-coordinator.d.ts +2 -1
  482. package/dist/services/session/turn-coordinator.d.ts.map +1 -1
  483. package/dist/services/session/turn-coordinator.js +3 -0
  484. package/dist/services/session/turn-coordinator.js.map +1 -1
  485. package/dist/services/session/turn-workflow.d.ts +4 -1
  486. package/dist/services/session/turn-workflow.d.ts.map +1 -1
  487. package/dist/services/session/turn-workflow.js +58 -21
  488. package/dist/services/session/turn-workflow.js.map +1 -1
  489. package/dist/services/session-rollover/session-rollover-brief.d.ts +8 -1
  490. package/dist/services/session-rollover/session-rollover-brief.d.ts.map +1 -1
  491. package/dist/services/session-rollover/session-rollover-brief.js +14 -1
  492. package/dist/services/session-rollover/session-rollover-brief.js.map +1 -1
  493. package/dist/services/settings/setting-schema-utils.d.ts +2 -0
  494. package/dist/services/settings/setting-schema-utils.d.ts.map +1 -1
  495. package/dist/services/settings/setting-schema-utils.js +15 -27
  496. package/dist/services/settings/setting-schema-utils.js.map +1 -1
  497. package/dist/services/settings/settings-schema.d.ts +8 -0
  498. package/dist/services/settings/settings-schema.d.ts.map +1 -1
  499. package/dist/services/settings/settings-schema.js +23 -6
  500. package/dist/services/settings/settings-schema.js.map +1 -1
  501. package/dist/services/settings/settings-sources.d.ts +207 -0
  502. package/dist/services/settings/settings-sources.d.ts.map +1 -1
  503. package/dist/services/settings/settings-sources.js +48 -1
  504. package/dist/services/settings/settings-sources.js.map +1 -1
  505. package/dist/services/settings/settings-ui-metadata.d.ts +27 -0
  506. package/dist/services/settings/settings-ui-metadata.d.ts.map +1 -0
  507. package/dist/services/settings/settings-ui-metadata.js +283 -0
  508. package/dist/services/settings/settings-ui-metadata.js.map +1 -0
  509. package/dist/services/settings/test-helpers/settings-consumer-inventory.d.ts +10 -0
  510. package/dist/services/settings/test-helpers/settings-consumer-inventory.d.ts.map +1 -1
  511. package/dist/services/settings/test-helpers/settings-consumer-inventory.js +46 -0
  512. package/dist/services/settings/test-helpers/settings-consumer-inventory.js.map +1 -1
  513. package/dist/services/subagents/execution-runner.d.ts.map +1 -1
  514. package/dist/services/subagents/execution-runner.js +8 -0
  515. package/dist/services/subagents/execution-runner.js.map +1 -1
  516. package/dist/services/subagents/role-loader.d.ts.map +1 -1
  517. package/dist/services/subagents/role-loader.js +4 -0
  518. package/dist/services/subagents/role-loader.js.map +1 -1
  519. package/dist/services/subagents/subagent-client-types.d.ts +7 -0
  520. package/dist/services/subagents/subagent-client-types.d.ts.map +1 -1
  521. package/dist/services/subagents/subagent-manager.d.ts.map +1 -1
  522. package/dist/services/subagents/subagent-manager.js +4 -1
  523. package/dist/services/subagents/subagent-manager.js.map +1 -1
  524. package/dist/services/subagents/subagent-notification-store.d.ts +2 -0
  525. package/dist/services/subagents/subagent-notification-store.d.ts.map +1 -1
  526. package/dist/services/subagents/subagent-notification-store.js +4 -0
  527. package/dist/services/subagents/subagent-notification-store.js.map +1 -1
  528. package/dist/services/subagents/test-helpers/subagent-manager-fixtures.d.ts.map +1 -1
  529. package/dist/services/subagents/test-helpers/subagent-manager-fixtures.js +2 -1
  530. package/dist/services/subagents/test-helpers/subagent-manager-fixtures.js.map +1 -1
  531. package/dist/services/subagents/tool-policy.d.ts +8 -0
  532. package/dist/services/subagents/tool-policy.d.ts.map +1 -1
  533. package/dist/services/subagents/tool-policy.js +289 -41
  534. package/dist/services/subagents/tool-policy.js.map +1 -1
  535. package/dist/services/subagents/types.d.ts +2 -1
  536. package/dist/services/subagents/types.d.ts.map +1 -1
  537. package/dist/services/subagents/types.js.map +1 -1
  538. package/dist/test-helpers/conversation-session-with-adapter.d.ts +1 -1
  539. package/dist/test-helpers/conversation-session-with-adapter.d.ts.map +1 -1
  540. package/dist/test-helpers/conversation-session-with-adapter.js +6 -1
  541. package/dist/test-helpers/conversation-session-with-adapter.js.map +1 -1
  542. package/dist/test-helpers/vitest-cache-isolation.d.ts +2 -0
  543. package/dist/test-helpers/vitest-cache-isolation.d.ts.map +1 -0
  544. package/dist/test-helpers/vitest-cache-isolation.js +17 -0
  545. package/dist/test-helpers/vitest-cache-isolation.js.map +1 -0
  546. package/dist/tools/agent/activate-skill.d.ts.map +1 -1
  547. package/dist/tools/agent/activate-skill.js +1 -0
  548. package/dist/tools/agent/activate-skill.js.map +1 -1
  549. package/dist/tools/agent/configure-task-check-in.d.ts.map +1 -1
  550. package/dist/tools/agent/configure-task-check-in.js +1 -0
  551. package/dist/tools/agent/configure-task-check-in.js.map +1 -1
  552. package/dist/tools/agent/run-subagent-async.d.ts.map +1 -1
  553. package/dist/tools/agent/run-subagent-async.js +16 -12
  554. package/dist/tools/agent/run-subagent-async.js.map +1 -1
  555. package/dist/tools/file/apply-patch.d.ts.map +1 -1
  556. package/dist/tools/file/apply-patch.js +9 -11
  557. package/dist/tools/file/apply-patch.js.map +1 -1
  558. package/dist/tools/file/code-context.d.ts.map +1 -1
  559. package/dist/tools/file/code-context.js +40 -5
  560. package/dist/tools/file/code-context.js.map +1 -1
  561. package/dist/tools/file/create-file.d.ts.map +1 -1
  562. package/dist/tools/file/create-file.js +13 -8
  563. package/dist/tools/file/create-file.js.map +1 -1
  564. package/dist/tools/file/edit-healing.d.ts.map +1 -1
  565. package/dist/tools/file/edit-healing.js +1 -4
  566. package/dist/tools/file/edit-healing.js.map +1 -1
  567. package/dist/tools/file/glob.d.ts.map +1 -1
  568. package/dist/tools/file/glob.js +49 -11
  569. package/dist/tools/file/glob.js.map +1 -1
  570. package/dist/tools/file/grep.d.ts.map +1 -1
  571. package/dist/tools/file/grep.js +32 -8
  572. package/dist/tools/file/grep.js.map +1 -1
  573. package/dist/tools/file/patch-healing.d.ts.map +1 -1
  574. package/dist/tools/file/patch-healing.js +1 -4
  575. package/dist/tools/file/patch-healing.js.map +1 -1
  576. package/dist/tools/file/read-file.d.ts.map +1 -1
  577. package/dist/tools/file/read-file.js +109 -6
  578. package/dist/tools/file/read-file.js.map +1 -1
  579. package/dist/tools/file/search-replace.d.ts.map +1 -1
  580. package/dist/tools/file/search-replace.js +5 -7
  581. package/dist/tools/file/search-replace.js.map +1 -1
  582. package/dist/tools/file/upstream-apply-patch.d.ts.map +1 -1
  583. package/dist/tools/file/upstream-apply-patch.js +4 -1
  584. package/dist/tools/file/upstream-apply-patch.js.map +1 -1
  585. package/dist/tools/memory/memory-tools.d.ts.map +1 -1
  586. package/dist/tools/memory/memory-tools.js +19 -1
  587. package/dist/tools/memory/memory-tools.js.map +1 -1
  588. package/dist/tools/session-browser/session-browser-tools.d.ts.map +1 -1
  589. package/dist/tools/session-browser/session-browser-tools.js +24 -8
  590. package/dist/tools/session-browser/session-browser-tools.js.map +1 -1
  591. package/dist/tools/session-rollover/session-rollover-tool.d.ts.map +1 -1
  592. package/dist/tools/session-rollover/session-rollover-tool.js +8 -2
  593. package/dist/tools/session-rollover/session-rollover-tool.js.map +1 -1
  594. package/dist/tools/system/run-code/index.d.ts +2 -0
  595. package/dist/tools/system/run-code/index.d.ts.map +1 -0
  596. package/dist/tools/system/run-code/index.js +2 -0
  597. package/dist/tools/system/run-code/index.js.map +1 -0
  598. package/dist/tools/system/run-code/run-code-telemetry.d.ts +92 -0
  599. package/dist/tools/system/run-code/run-code-telemetry.d.ts.map +1 -0
  600. package/dist/tools/system/run-code/run-code-telemetry.js +189 -0
  601. package/dist/tools/system/run-code/run-code-telemetry.js.map +1 -0
  602. package/dist/tools/system/run-code/run-code.d.ts +98 -0
  603. package/dist/tools/system/run-code/run-code.d.ts.map +1 -0
  604. package/dist/tools/system/run-code/run-code.js +1078 -0
  605. package/dist/tools/system/run-code/run-code.js.map +1 -0
  606. package/dist/tools/system/run-code/tools-header.d.ts +25 -0
  607. package/dist/tools/system/run-code/tools-header.d.ts.map +1 -0
  608. package/dist/tools/system/run-code/tools-header.js +136 -0
  609. package/dist/tools/system/run-code/tools-header.js.map +1 -0
  610. package/dist/tools/system/shell.d.ts.map +1 -1
  611. package/dist/tools/system/shell.js +58 -9
  612. package/dist/tools/system/shell.js.map +1 -1
  613. package/dist/tools/system/worktree.js +2 -2
  614. package/dist/tools/system/worktree.js.map +1 -1
  615. package/dist/tools/types.d.ts +24 -0
  616. package/dist/tools/types.d.ts.map +1 -1
  617. package/dist/tools/types.js.map +1 -1
  618. package/dist/tools/utils.d.ts +10 -0
  619. package/dist/tools/utils.d.ts.map +1 -1
  620. package/dist/tools/utils.js +13 -0
  621. package/dist/tools/utils.js.map +1 -1
  622. package/dist/tools/web/web-fetch.d.ts.map +1 -1
  623. package/dist/tools/web/web-fetch.js +14 -6
  624. package/dist/tools/web/web-fetch.js.map +1 -1
  625. package/dist/tools/web/web-search.d.ts.map +1 -1
  626. package/dist/tools/web/web-search.js +2 -1
  627. package/dist/tools/web/web-search.js.map +1 -1
  628. package/dist/utils/ai/model-settings.d.ts.map +1 -1
  629. package/dist/utils/ai/model-settings.js +0 -47
  630. package/dist/utils/ai/model-settings.js.map +1 -1
  631. package/dist/utils/conversation/apply-conversation-result.d.ts.map +1 -1
  632. package/dist/utils/conversation/apply-conversation-result.js +13 -0
  633. package/dist/utils/conversation/apply-conversation-result.js.map +1 -1
  634. package/dist/utils/conversation/conversation-utils.d.ts.map +1 -1
  635. package/dist/utils/conversation/conversation-utils.js +14 -0
  636. package/dist/utils/conversation/conversation-utils.js.map +1 -1
  637. package/dist/utils/conversation/static-commit-policy.d.ts +38 -0
  638. package/dist/utils/conversation/static-commit-policy.d.ts.map +1 -0
  639. package/dist/utils/conversation/static-commit-policy.js +76 -0
  640. package/dist/utils/conversation/static-commit-policy.js.map +1 -0
  641. package/dist/utils/output/bound-tool-result.d.ts +23 -0
  642. package/dist/utils/output/bound-tool-result.d.ts.map +1 -1
  643. package/dist/utils/output/bound-tool-result.js +27 -0
  644. package/dist/utils/output/bound-tool-result.js.map +1 -1
  645. package/dist/utils/settings-command.d.ts +8 -0
  646. package/dist/utils/settings-command.d.ts.map +1 -1
  647. package/dist/utils/settings-command.js +45 -30
  648. package/dist/utils/settings-command.js.map +1 -1
  649. package/dist/utils/shell/execute-shell.d.ts +18 -0
  650. package/dist/utils/shell/execute-shell.d.ts.map +1 -1
  651. package/dist/utils/shell/execute-shell.js +48 -6
  652. package/dist/utils/shell/execute-shell.js.map +1 -1
  653. package/dist/utils/shell/shell-output.d.ts +7 -1
  654. package/dist/utils/shell/shell-output.d.ts.map +1 -1
  655. package/dist/utils/shell/shell-output.js +37 -7
  656. package/dist/utils/shell/shell-output.js.map +1 -1
  657. package/dist/utils/streaming/streaming-session-factory.d.ts +9 -0
  658. package/dist/utils/streaming/streaming-session-factory.d.ts.map +1 -1
  659. package/dist/utils/streaming/streaming-session-factory.js +1 -1
  660. package/dist/utils/streaming/streaming-session-factory.js.map +1 -1
  661. package/dist/utils/tool-args-display.d.ts +21 -0
  662. package/dist/utils/tool-args-display.d.ts.map +1 -0
  663. package/dist/utils/tool-args-display.js +34 -0
  664. package/dist/utils/tool-args-display.js.map +1 -0
  665. package/dist/utils/value-suggestions.d.ts +4 -10
  666. package/dist/utils/value-suggestions.d.ts.map +1 -1
  667. package/dist/utils/value-suggestions.js +77 -144
  668. package/dist/utils/value-suggestions.js.map +1 -1
  669. package/dist/utils/worker-bootstrap.d.ts +3 -0
  670. package/dist/utils/worker-bootstrap.d.ts.map +1 -0
  671. package/dist/utils/worker-bootstrap.js +7 -0
  672. package/dist/utils/worker-bootstrap.js.map +1 -0
  673. package/dist/utils/worker-cwd-preload.cjs +23 -0
  674. package/dist/utils/worker-cwd-preload.cjs.map +1 -0
  675. package/dist/utils/worker-cwd-preload.d.cts +2 -0
  676. package/dist/utils/worker-cwd-preload.d.cts.map +1 -0
  677. package/package.json +5 -2
  678. package/dist/services/agent-runtime/workflow/workflow-worker.d.ts +0 -4
  679. package/dist/services/agent-runtime/workflow/workflow-worker.d.ts.map +0 -1
  680. package/dist/services/agent-runtime/workflow/workflow-worker.js +0 -55
  681. package/dist/services/agent-runtime/workflow/workflow-worker.js.map +0 -1
@@ -5,8 +5,18 @@ import { randomUUID } from 'node:crypto';
5
5
  import { NonInteractiveApprovalPolicy } from './services/approval/non-interactive-approval-policy.js';
6
6
  import { pruneStaleTempArtifacts } from './utils/shell/temp-sweep.js';
7
7
  import { primeActiveProfileNoticeIfActive } from './services/mode-notices.js';
8
+ import { formatBackgroundSubagentNotifications } from './services/conversation/conversation-orchestrator.js';
9
+ export const DEFAULT_NON_INTERACTIVE_BACKGROUND_WAIT_MS = 5 * 60 * 1000;
10
+ const MAX_NON_INTERACTIVE_BACKGROUND_WAIT_MS = 24 * 60 * 60 * 1000;
8
11
  export { NON_INTERACTIVE_REJECTION_REASON } from './services/approval/non-interactive-approval-policy.js';
9
12
  export const createNonInteractiveSessionId = () => `non-interactive-${randomUUID()}`;
13
+ const normalizeBackgroundWaitTimeout = (value) => {
14
+ if (value === undefined)
15
+ return DEFAULT_NON_INTERACTIVE_BACKGROUND_WAIT_MS;
16
+ if (!Number.isFinite(value))
17
+ return DEFAULT_NON_INTERACTIVE_BACKGROUND_WAIT_MS;
18
+ return Math.min(MAX_NON_INTERACTIVE_BACKGROUND_WAIT_MS, Math.max(1, Math.floor(value)));
19
+ };
10
20
  const safePreview = (value, maxLen = 500) => {
11
21
  try {
12
22
  if (typeof value === 'string') {
@@ -128,47 +138,186 @@ export async function runWithSession(session, config) {
128
138
  stderr.write(line);
129
139
  }
130
140
  };
141
+ const backgroundWork = config.backgroundWork;
142
+ const backgroundWaitTimeoutMs = normalizeBackgroundWaitTimeout(config.backgroundWaitTimeoutMs);
143
+ let receivedSignal = null;
144
+ let backgroundCancellationRequested = false;
145
+ let wakeBackgroundWaiter = null;
146
+ const cancelBackgroundWork = () => {
147
+ config.abort?.();
148
+ if (backgroundWork && !backgroundCancellationRequested) {
149
+ backgroundCancellationRequested = true;
150
+ backgroundWork.cancel();
151
+ }
152
+ };
153
+ const onSignal = (signal) => {
154
+ if (receivedSignal)
155
+ return;
156
+ receivedSignal = signal;
157
+ cancelBackgroundWork();
158
+ wakeBackgroundWaiter?.();
159
+ };
160
+ const onSigint = () => onSignal('SIGINT');
161
+ const onSigterm = () => onSignal('SIGTERM');
162
+ if (backgroundWork) {
163
+ process.once('SIGINT', onSigint);
164
+ process.once('SIGTERM', onSigterm);
165
+ backgroundWork.notifications.setObserver?.(() => wakeBackgroundWaiter?.());
166
+ }
167
+ const reportBackgroundFailure = (code, outstanding) => {
168
+ const signal = receivedSignal ?? undefined;
169
+ const message = signal
170
+ ? 'Background work interrupted by ' + signal + '; unfinished work was cancelled.'
171
+ : 'Background work did not finish within ' + backgroundWaitTimeoutMs + 'ms; unfinished work was cancelled.';
172
+ const payload = {
173
+ type: 'error',
174
+ code,
175
+ error: message,
176
+ ...(signal ? { signal } : {}),
177
+ outstanding,
178
+ pendingNotifications: backgroundWork?.notifications.pendingCount ?? 0,
179
+ };
180
+ config.logger?.warn('Non-interactive background work did not finish', {
181
+ eventType: code,
182
+ category: 'subagent',
183
+ ...payload,
184
+ });
185
+ if (config.json) {
186
+ stdout.write(JSON.stringify(payload) + '\n');
187
+ }
188
+ else {
189
+ const details = outstanding.map((work) => work.kind + ' ' + work.id + ' (' + work.status + ')').join(', ');
190
+ stderr.write('error ' + message + ' Outstanding: ' + (details || 'none') + '\n');
191
+ }
192
+ return 1;
193
+ };
131
194
  try {
132
195
  const supportsPersistentEventSink = typeof session.setEventSink === 'function';
133
196
  if (supportsPersistentEventSink) {
134
197
  session.setEventSink(onEvent);
135
198
  }
136
- let result;
137
- result = supportsPersistentEventSink
138
- ? await session.sendMessage(config.prompt)
139
- : await session.sendMessage(config.prompt, { onEvent });
140
- while (result?.type === 'approval_required') {
141
- const decision = await approvalPolicy.decide({
142
- autoApprove: config.autoApprove,
143
- approval: result.approval,
144
- getHistory: () => session.exportState?.().history ?? [],
145
- });
146
- const rejectionReason = decision.answer === 'n' ? decision.rejectionReason : undefined;
147
- if (decision.answer === 'n' && decision.reportRejection) {
148
- if (config.json) {
149
- stdout.write(JSON.stringify({ type: 'approval_rejected', reason: rejectionReason }) + '\n');
199
+ const sendTurn = async (input, suppressUserMessageDisplay = false) => {
200
+ streamedTextLength = 0;
201
+ return supportsPersistentEventSink
202
+ ? await session.sendMessage(input, suppressUserMessageDisplay ? { suppressUserMessageDisplay } : undefined)
203
+ : await session.sendMessage(input, { onEvent, suppressUserMessageDisplay });
204
+ };
205
+ const sendTurnAndResolveApprovals = async (input, suppressUserMessageDisplay = false) => {
206
+ let result = await sendTurn(input, suppressUserMessageDisplay);
207
+ while (result?.type === 'approval_required') {
208
+ const decision = await approvalPolicy.decide({
209
+ autoApprove: config.autoApprove,
210
+ approval: result.approval,
211
+ getHistory: () => session.exportState?.().history ?? [],
212
+ });
213
+ const rejectionReason = decision.answer === 'n' ? decision.rejectionReason : undefined;
214
+ if (decision.answer === 'n' && decision.reportRejection) {
215
+ if (config.json) {
216
+ stdout.write(JSON.stringify({ type: 'approval_rejected', reason: rejectionReason }) + '\n');
217
+ }
218
+ else {
219
+ stderr.write('Approval Rejected: ' + rejectionReason + '\n');
220
+ }
150
221
  }
151
- else {
152
- stderr.write(`Approval Rejected: ${rejectionReason}\n`);
222
+ result = supportsPersistentEventSink
223
+ ? await session.handleApprovalDecision(decision.answer, rejectionReason)
224
+ : await session.handleApprovalDecision(decision.answer, rejectionReason, { onEvent });
225
+ if (result === null) {
226
+ if (config.json) {
227
+ stdout.write(JSON.stringify({
228
+ type: 'error',
229
+ error: 'No pending approval context (unexpected in non-interactive mode).',
230
+ }) + '\n');
231
+ }
232
+ else {
233
+ stderr.write('error No pending approval context (unexpected in non-interactive mode).\n');
234
+ }
235
+ return null;
153
236
  }
154
237
  }
155
- result = supportsPersistentEventSink
156
- ? await session.handleApprovalDecision(decision.answer, rejectionReason)
157
- : await session.handleApprovalDecision(decision.answer, rejectionReason, { onEvent });
158
- if (result === null) {
159
- if (config.json) {
160
- stdout.write(JSON.stringify({
161
- type: 'error',
162
- error: 'No pending approval context (unexpected in non-interactive mode).',
163
- }) + '\n');
164
- }
165
- else {
166
- stderr.write('error No pending approval context (unexpected in non-interactive mode).\n');
238
+ return result;
239
+ };
240
+ let result = await sendTurnAndResolveApprovals(config.prompt);
241
+ if (result === null)
242
+ return 1;
243
+ if (result?.type === 'response') {
244
+ if (backgroundWork) {
245
+ const deadline = Date.now() + backgroundWaitTimeoutMs;
246
+ while (true) {
247
+ if (receivedSignal) {
248
+ const outstanding = backgroundWork.getOutstanding();
249
+ cancelBackgroundWork();
250
+ return reportBackgroundFailure('background_work_interrupted', outstanding);
251
+ }
252
+ const outstanding = backgroundWork.getOutstanding();
253
+ if (backgroundWork.notifications.pendingCount > 0) {
254
+ const notifications = backgroundWork.notifications.drain();
255
+ if (notifications.length > 0) {
256
+ const remainingForTurn = deadline - Date.now();
257
+ if (remainingForTurn <= 0) {
258
+ cancelBackgroundWork();
259
+ return reportBackgroundFailure('background_work_timeout', outstanding);
260
+ }
261
+ let timeoutHandle;
262
+ const notificationResult = await Promise.race([
263
+ sendTurnAndResolveApprovals(formatBackgroundSubagentNotifications(notifications), true).then((value) => ({ timedOut: false, value })),
264
+ new Promise((resolve) => {
265
+ timeoutHandle = setTimeout(() => resolve({ timedOut: true }), remainingForTurn);
266
+ }),
267
+ ]);
268
+ if (timeoutHandle)
269
+ clearTimeout(timeoutHandle);
270
+ if (notificationResult.timedOut) {
271
+ cancelBackgroundWork();
272
+ return reportBackgroundFailure('background_work_timeout', backgroundWork.getOutstanding());
273
+ }
274
+ result = notificationResult.value;
275
+ if (result === null)
276
+ return 1;
277
+ if (result?.type !== 'response') {
278
+ if (config.json) {
279
+ stdout.write(JSON.stringify({ type: 'error', error: 'Unexpected conversation result.' }) + '\n');
280
+ }
281
+ else {
282
+ stderr.write('error Unexpected conversation result.\n');
283
+ }
284
+ return 1;
285
+ }
286
+ continue;
287
+ }
288
+ }
289
+ if (outstanding.length === 0)
290
+ break;
291
+ const remainingMs = deadline - Date.now();
292
+ if (remainingMs <= 0) {
293
+ cancelBackgroundWork();
294
+ return reportBackgroundFailure('background_work_timeout', outstanding);
295
+ }
296
+ const woke = await new Promise((resolve) => {
297
+ let settled = false;
298
+ const timer = setTimeout(() => {
299
+ if (settled)
300
+ return;
301
+ settled = true;
302
+ wakeBackgroundWaiter = null;
303
+ resolve('deadline');
304
+ }, remainingMs);
305
+ wakeBackgroundWaiter = () => {
306
+ if (settled)
307
+ return;
308
+ settled = true;
309
+ clearTimeout(timer);
310
+ wakeBackgroundWaiter = null;
311
+ resolve('woke');
312
+ };
313
+ });
314
+ if (woke === 'deadline') {
315
+ const stillOutstanding = backgroundWork.getOutstanding();
316
+ cancelBackgroundWork();
317
+ return reportBackgroundFailure('background_work_timeout', stillOutstanding);
318
+ }
167
319
  }
168
- return 1;
169
320
  }
170
- }
171
- if (result?.type === 'response') {
172
321
  if (config.json) {
173
322
  stdout.write(JSON.stringify({ type: 'completed', finalText: result.finalText }) + '\n');
174
323
  }
@@ -186,6 +335,9 @@ export async function runWithSession(session, config) {
186
335
  return 1;
187
336
  }
188
337
  catch (error) {
338
+ if (receivedSignal && backgroundWork) {
339
+ return reportBackgroundFailure('background_work_interrupted', backgroundWork.getOutstanding());
340
+ }
189
341
  const message = error instanceof Error ? error.message : String(error);
190
342
  if (config.json) {
191
343
  stdout.write(JSON.stringify({ type: 'error', error: message }) + '\n');
@@ -196,6 +348,11 @@ export async function runWithSession(session, config) {
196
348
  return 1;
197
349
  }
198
350
  finally {
351
+ if (backgroundWork) {
352
+ backgroundWork.notifications.setObserver?.(null);
353
+ process.removeListener('SIGINT', onSigint);
354
+ process.removeListener('SIGTERM', onSigterm);
355
+ }
199
356
  if (typeof session.setEventSink === 'function') {
200
357
  session.setEventSink(null);
201
358
  }
@@ -222,6 +379,21 @@ export async function runNonInteractive(config) {
222
379
  params.background === true) {
223
380
  return 'Error: Background shell execution is unavailable in non-interactive mode.';
224
381
  }
382
+ // run_subagent expresses the supported background capability through its
383
+ // execution parameter. It is deliberately allowed here; runWithSession
384
+ // owns the wait/notification lifecycle instead of rejecting the launch.
385
+ if (name === 'run_subagent') {
386
+ const execution = params !== null && typeof params === 'object' && !Array.isArray(params)
387
+ ? params.execution
388
+ : undefined;
389
+ if (execution === 'background')
390
+ return null;
391
+ // Foreground is also governed by the tool schema/capability; neither
392
+ // parameterized execution mode is rejected by this lifecycle guard.
393
+ return null;
394
+ }
395
+ // This is the legacy standalone async tool name, not the parameterized
396
+ // run_subagent capability above, and remains unavailable headlessly.
225
397
  if (name === 'run_subagent_async') {
226
398
  return 'Error: Asynchronous subagent execution is unavailable in non-interactive mode. Use synchronous run_subagent instead.';
227
399
  }
@@ -235,6 +407,7 @@ export async function runNonInteractive(config) {
235
407
  try {
236
408
  const createdRuntime = createConversationRuntime({
237
409
  sessionId,
410
+ enableNestedApproval: false,
238
411
  agentClient: clientHandle.agentClient,
239
412
  toolOwnership: clientHandle.toolOwnership,
240
413
  deps: {
@@ -263,6 +436,27 @@ export async function runNonInteractive(config) {
263
436
  ...config,
264
437
  agentClient: clientHandle.agentClient,
265
438
  sessionContextService,
439
+ abort: () => clientHandle.agentClient.abort(),
440
+ backgroundWork: {
441
+ notifications: createdRuntime.runtime.backgroundSubagentNotifications,
442
+ getOutstanding: () => createdRuntime.runtime.backgroundTaskControl
443
+ .listDetails()
444
+ .filter((details) => details.status === 'running' || details.status === 'cancelling')
445
+ .map((details) => details.kind === 'subagent'
446
+ ? {
447
+ id: details.id,
448
+ kind: details.kind,
449
+ status: details.status,
450
+ ...(details.name === undefined ? {} : { name: details.name }),
451
+ role: details.role,
452
+ task: details.task,
453
+ }
454
+ : { id: details.id, kind: details.kind, status: details.status }),
455
+ cancel: () => {
456
+ clientHandle.agentClient.cancelBackgroundRuns?.();
457
+ clientHandle.agentClient.cancelBackgroundShellJobs?.();
458
+ },
459
+ },
266
460
  });
267
461
  }
268
462
  catch (error) {
@@ -1 +1 @@
1
- {"version":3,"file":"non-interactive.js","sourceRoot":"","sources":["../source/non-interactive.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,yDAAyD,CAAC;AACpG,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AACtF,OAAO,EACL,qCAAqC,GAEtC,MAAM,8CAA8C,CAAC;AAUtD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,4BAA4B,EAAE,MAAM,wDAAwD,CAAC;AAGtG,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,gCAAgC,EAAE,MAAM,4BAA4B,CAAC;AAuB9E,OAAO,EAAE,gCAAgC,EAAE,MAAM,wDAAwD,CAAC;AAE1G,MAAM,CAAC,MAAM,6BAA6B,GAAG,GAAW,EAAE,CAAC,mBAAmB,UAAU,EAAE,EAAE,CAAC;AAa7F,MAAM,WAAW,GAAG,CAAC,KAAc,EAAE,MAAM,GAAG,GAAG,EAAU,EAAE;IAC3D,IAAI,CAAC;QACH,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,OAAO,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,KA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/prompts/background-shell.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,wBAAgB,0BAA0B,IAAI,MAAM,CAQnD"}
1
+ {"version":3,"file":"background-shell.d.ts","sourceRoot":"","sources":["../../source/prompts/background-shell.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,wBAAgB,0BAA0B,IAAI,MAAM,CAUnD"}
@@ -4,8 +4,10 @@ export function getBackgroundShellAddendum() {
4
4
 
5
5
  Use \`shell\` with \`background: true\` only for work that can continue after you return control. A successful launch returns \`{ jobId, status: "running" }\`.
6
6
 
7
- - A \`status: "running"\` handle means the job launched successfully. Do NOT call \`get_shell_job\` as a polling loop and do not run \`sleep\` merely to wait.
7
+ - A \`status: "running"\` handle means the job launched successfully. Inside \`run_code\`, do NOT call \`tools.get_shell_job(...)\` as a polling loop and do not run \`sleep\` merely to wait.
8
8
  - End the current turn and wait for the automatic completion notification. It arrives when the job settles and includes its terminal status and bounded output, so continue from that notification.
9
- - Use \`get_shell_job\` only when a later user instruction requires an early status check for a specific job. Use \`cancel_shell_job\` only when the user asks to stop that job or the task requires cancellation.`;
9
+ - Inside \`run_code\`, use \`tools.get_shell_job(...)\` only when a later user instruction requires an early status check for a specific job. Use \`tools.cancel_shell_job(...)\` only when the user asks to stop that job or the task requires cancellation.
10
+ - Timeouts are a launch decision, not a fixed harness fact: the 30-minute background default terminates any job that outlives it, so known long-lived work (a watcher, a full-suite validation) must pass an explicit finite \`timeout_ms\` sized to the expected horizon (for example two hours for a watcher, 15 minutes for a full-suite gate). A deadline reached is a failure to diagnose, not a license to extend automatically; stop the job through its job id when you replace it so two writers never share one output baseline, and never detach a job with nohup to escape the registry.
11
+ - Attach \`monitor\` in the same launch call when you need progress notifications, and rely on the automatic completion notification rather than polling.`;
10
12
  }
11
13
  //# sourceMappingURL=background-shell.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"background-shell.js","sourceRoot":"","sources":["../../source/prompts/background-shell.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,MAAM,UAAU,0BAA0B;IACxC,OAAO;;;;;;mNAM0M,CAAC;AACpN,CAAC"}
1
+ {"version":3,"file":"background-shell.js","sourceRoot":"","sources":["../../source/prompts/background-shell.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,MAAM,UAAU,0BAA0B;IACxC,OAAO;;;;;;;;0JAQiJ,CAAC;AAC3J,CAAC"}
@@ -4,7 +4,9 @@ export function getBackgroundShellAddendum(): string {
4
4
 
5
5
  Use \`shell\` with \`background: true\` only for work that can continue after you return control. A successful launch returns \`{ jobId, status: "running" }\`.
6
6
 
7
- - A \`status: "running"\` handle means the job launched successfully. Do NOT call \`get_shell_job\` as a polling loop and do not run \`sleep\` merely to wait.
7
+ - A \`status: "running"\` handle means the job launched successfully. Inside \`run_code\`, do NOT call \`tools.get_shell_job(...)\` as a polling loop and do not run \`sleep\` merely to wait.
8
8
  - End the current turn and wait for the automatic completion notification. It arrives when the job settles and includes its terminal status and bounded output, so continue from that notification.
9
- - Use \`get_shell_job\` only when a later user instruction requires an early status check for a specific job. Use \`cancel_shell_job\` only when the user asks to stop that job or the task requires cancellation.`;
9
+ - Inside \`run_code\`, use \`tools.get_shell_job(...)\` only when a later user instruction requires an early status check for a specific job. Use \`tools.cancel_shell_job(...)\` only when the user asks to stop that job or the task requires cancellation.
10
+ - Timeouts are a launch decision, not a fixed harness fact: the 30-minute background default terminates any job that outlives it, so known long-lived work (a watcher, a full-suite validation) must pass an explicit finite \`timeout_ms\` sized to the expected horizon (for example two hours for a watcher, 15 minutes for a full-suite gate). A deadline reached is a failure to diagnose, not a license to extend automatically; stop the job through its job id when you replace it so two writers never share one output baseline, and never detach a job with nohup to escape the registry.
11
+ - Attach \`monitor\` in the same launch call when you need progress notifications, and rely on the automatic completion notification rather than polling.`;
10
12
  }
@@ -26,15 +26,13 @@ You are a deeply pragmatic, effective software engineer. You take engineering qu
26
26
  As an expert coding agent, your primary focus is writing code, answering questions, and helping the user complete tasks in the current environment. Build context by examining the codebase first without making assumptions.
27
27
 
28
28
  - **Tools**:
29
- - Search files using `rg` or `rg --files` (prefer over `grep`).
29
+ - Search files using `rg` or `rg --files` (prefer over older recursive search commands).
30
30
  - Parallelize tool calls whenever possible (e.g., `cat`, `rg`, `sed`, `ls`, `git show`, `nl`, `wc`) using `multi_tool_use.parallel`.
31
31
  - Never chain bash commands with separators like `echo "====";`.
32
32
  - Unsandboxed shell commands require explicit user approval and must be run directly by the main agent. Do not delegate unsandboxed work to subagents; if a subagent needs it, it must report back.
33
33
  - **Editing Constraints**:
34
34
  - Default to ASCII; only use Unicode if justified by the file's existing content.
35
35
  - Add succinct code comments only for complex blocks that require parsing.
36
- - Use `apply_patch` for all code edits. Do not use `cat` or other commands for creation/edits.
37
- - Do not use Python for file I/O when shell commands or `apply_patch` suffice.
38
36
  - **Git/Filesystem**:
39
37
  - You may be in a dirty git worktree. Never revert changes you did not make. If unrelated changes exist, ignore them.
40
38
  - Do not amend commits unless requested.
@@ -0,0 +1,13 @@
1
+ # Follow-through and clarification
2
+
3
+ Treat requests such as "can you fix" or "help me build" as instructions to do the work. Make reasonable assumptions for routine implementation details. If clarification could materially change the outcome, ask a focused question and continue any independently actionable, already-authorized work. Wait for the answer before doing work that depends on it. Complete the authorized preparation needed to make an approval decision concrete and reviewable; use the harness approval mechanism described below.
4
+
5
+ # Skills and instruction conflicts
6
+
7
+ The user's explicit instructions take precedence over guidelines in skills. Do not infer additional approval requirements from a skill when the requested work is already authorized. This does not override harness safety rules, tool restrictions, or active mode constraints.
8
+
9
+ If a skill causes you to pause, seek confirmation, or leave requested work unfinished, name and link to the exact SKILL.md, quote the relevant instruction, and explain how it applies. Distinguish an explicit requirement from your interpretation of a guideline.
10
+
11
+ # Proportionate verification
12
+
13
+ Run the checks appropriate to the change and complete the project's required checks. Once they pass, broaden or repeat validation only when new changes, failures, or unresolved concerns justify it. Add tests when they verify meaningful behavior; avoid tests that merely mirror implementation for reversible, low-impact edits.
@@ -21,14 +21,12 @@ You may challenge the user to raise their technical bar, but you never patronize
21
21
  # General
22
22
  As an expert coding agent, your primary focus is writing code, answering questions, and helping the user complete their task in the current environment. You build context by examining the codebase first without making assumptions or jumping to conclusions. You think through the nuances of the code you encounter, and embody the mentality of a skilled senior software engineer.
23
23
 
24
- - When searching for text or files, prefer using `rg` or `rg --files` respectively because `rg` is much faster than alternatives like `grep`. (If the `rg` command is not found, then use alternatives.)
24
+ - When searching for text or files, prefer using `rg` or `rg --files` respectively because `rg` is much faster than older recursive search commands. (If the `rg` command is not found, then use alternatives.)
25
25
 
26
26
  ## Editing constraints
27
27
 
28
28
  - Default to ASCII when editing or creating files. Only introduce non-ASCII or other Unicode characters when there is a clear justification and the file already uses them.
29
29
  - Add succinct code comments that explain what is going on if code is not self-explanatory. You should not add comments like \"Assigns the value to the variable\", but a brief comment might be useful ahead of a complex code block that the user would otherwise have to spend time parsing out. Usage of these comments should be rare.
30
- - Always use apply_patch for manual code edits. Do not use cat or any other commands when creating or editing files. Formatting commands or bulk edits don't need to be done with apply_patch.
31
- - Do not use Python to read/write files when a simple shell command or apply_patch would suffice.
32
30
  - Unsandboxed shell commands require explicit user approval and must be run directly by the main agent. Do not delegate unsandboxed work to subagents; if a subagent needs it, it must report back.
33
31
  - You may be in a dirty git worktree.
34
32
  * NEVER revert existing changes you did not make unless explicitly requested, since these changes were made by the user.
@@ -25,8 +25,6 @@ As an expert coding agent, your primary focus is writing code, answering questio
25
25
 
26
26
  - Default to ASCII when editing or creating files. Only introduce non-ASCII or other Unicode characters when there is a clear justification and the file already uses them.
27
27
  - Add succinct code comments that explain what is going on if code is not self-explanatory. You should not add comments like \"Assigns the value to the variable\", but a brief comment might be useful ahead of a complex code block that the user would otherwise have to spend time parsing out. Usage of these comments should be rare.
28
- - Always use apply_patch for manual code edits. Do not use cat or any other commands when creating or editing files. Formatting commands or bulk edits don't need to be done with apply_patch.
29
- - Do not use Python to read/write files when a simple shell command or apply_patch would suffice.
30
28
  - You may be in a dirty git worktree.
31
29
  * NEVER revert existing changes you did not make unless explicitly requested, since these changes were made by the user.
32
30
  * If asked to make a commit or code edits and there are unrelated changes to your work or changes that you didn't make in those files, don't revert those changes.
@@ -34,8 +34,6 @@ When the user leaves implementation details open, you choose conservatively and
34
34
 
35
35
  - You default to ASCII when editing or creating files. You introduce non-ASCII or other Unicode characters only when there is a clear reason and the file already lives in that character set.
36
36
  - You add succinct code comments only where the code is not self-explanatory. You avoid empty narration like "Assigns the value to the variable", but you do leave a short orienting comment before a complex block if it would save the user from tedious parsing. You use that tool sparingly.
37
- - Use `apply_patch` for manual code edits. Do not create or edit files with `cat` or other shell write tricks. Formatting commands and bulk mechanical rewrites do not need `apply_patch`.
38
- - Do not use Python to read or write files when a simple shell command or `apply_patch` is enough.
39
37
  - Unsandboxed shell commands require explicit user approval and must be run directly by the main agent. Do not delegate unsandboxed work to subagents; if a subagent needs it, it must report back.
40
38
  - You may be in a dirty git worktree.
41
39
  * NEVER revert existing changes you did not make unless explicitly requested, since these changes were made by the user.
@@ -23,7 +23,6 @@ When the user leaves implementation details open, choose conservatively and in s
23
23
 
24
24
  # Editing
25
25
 
26
- - Use `apply_patch` for code edits. Do not write files with `cat`, heredocs, or other shell tricks. Bulk mechanical rewrites and formatter runs do not need `apply_patch`.
27
26
  - Read a file before proposing changes to it. Verify paths and APIs rather than recalling them.
28
27
  - Add comments only where the code is not self-explanatory, and match the comment density of the surrounding file.
29
28
  - Default to ASCII unless the file already uses a broader character set.
@@ -11,9 +11,4 @@ You are a lightweight terminal assistant for shell commands, troubleshooting, an
11
11
  # Tools
12
12
 
13
13
  - `Shell`: run terminal commands, builds, package commands, git, and scripts.
14
- - `read_file`: inspect file contents.
15
- - `apply_patch`: modify files with patches when available.
16
- - `create_file`: create or overwrite files when available.
17
- - `search_replace`: make precise replacements when available.
18
- - `web_search`: find current external information.
19
- - `web_fetch`: read a specific web page when needed.
14
+ - File, search, and web tools follow the routing section below.
@@ -1,8 +1,8 @@
1
1
  ### Persistent memory
2
2
 
3
- You have access to persistent memory. The initial index lists every fitting memory by title, with full summaries for the most recent entries; a listed memory without a summary had it omitted for budget — read it with memory_get before treating it as irrelevant.
3
+ You have access to persistent memory. The initial index lists every fitting memory by title, with full summaries for the most recent entries; a listed memory without a summary had it omitted for budget — inside `run_code`, read it with `tools.memory_get(...)` before treating it as irrelevant.
4
4
 
5
- Memory has global and project scopes. Use global for cross-project preferences and reusable knowledge; use project for repository-specific decisions and conventions. Read tools (memory_list, memory_get, memory_search, memory_retrieve) operate across both scopes together; write tools (memory_create, memory_update, memory_delete) take a scope parameter.
5
+ Memory has global and project scopes. Use global for cross-project preferences and reusable knowledge; use project for repository-specific decisions and conventions. Inside `run_code`, use `tools.memory_list(...)`, `tools.memory_get(...)`, `tools.memory_search(...)`, and `tools.memory_retrieve(...)` for reads across both scopes; use `tools.memory_create(...)`, `tools.memory_update(...)`, and `tools.memory_delete(...)` for writes with a scope parameter.
6
6
 
7
7
  When you encounter uncertainty about prior conversations, user preferences, project decisions, or established conventions, consider retrieving relevant memories before making assumptions. Retrieve memory when it could materially improve correctness or avoid repeating work — not mechanically.
8
8
 
@@ -50,15 +50,15 @@ Do not redo completed work without reason. If a result looks wrong, inspect the
50
50
 
51
51
  ## Observing delegated work
52
52
 
53
- `get_subagent_status` gives you a non-blocking answer to "what is it doing right now." Omit the runId to list all live runs at once. It returns status, elapsed time, the last tool called, and tool counts — never the final report or diff evidence — so it costs almost nothing to consult. Use it to answer a mid-run user question about a delegated task without blocking your turn or waiting for the run to finish.
53
+ Inside `run_code`, `tools.get_subagent_status(...)` gives you a non-blocking answer to "what is it doing right now." Omit the runId to list all live runs at once. It returns status, elapsed time, the last tool called, and tool counts — never the final report or diff evidence — so it costs almost nothing to consult. Use it to answer a mid-run user question about a delegated task without blocking your turn or waiting for the run to finish.
54
54
 
55
- Peek is on-demand, not a substitute for the async completion discipline. It does not tell you when a run finishes, it never carries completion detail, and it is not a reason to poll in a loop. When a run settles, the harness completion notification inlines the full result — status, validation evidence, diff stat, and final text — so you can continue directly without calling `get_subagent_result`.
55
+ Peek is on-demand, not a substitute for the async completion discipline. It does not tell you when a run finishes, it never carries completion detail, and it is not a reason to poll in a loop. When a run settles, the harness completion notification inlines the full result — status, validation evidence, diff stat, and final text — so you can continue directly without calling `tools.get_subagent_result(...)` inside `run_code`.
56
56
 
57
57
  ## Steering or cancelling delegated work
58
58
 
59
- Address active runs by their optional name or canonical runId. Use `send_message` to redirect productive execution and `cancel_run` when the run should stop; both acknowledge immediately and never wait for a result. Steering reaches a safe model-stream boundary, never interrupts an active tool, and continues in a fresh session turn. It is not SDK live injection or RunState continuation, and each logical run permits at most three continuation segments.
59
+ Address active runs by their optional name or canonical runId. Inside `run_code`, use `tools.send_message(...)` to redirect productive execution and `tools.cancel_run(...)` when the run should stop; both acknowledge immediately and never wait for a result. Steering reaches a safe model-stream boundary, never interrupts an active tool, and continues in a fresh session turn. It is not SDK live injection or RunState continuation, and each logical run permits at most three continuation segments.
60
60
 
61
- If a worker or explorer is waiting on `ask_orchestrator`, answer its specific `messageId` through `send_message` with `reply_to`. The answer resumes only that waiting tool call; the subagent should continue afterward. While that question waits, steering without `reply_to` is refused with `question_pending` — only an answer can resume the blocked call, so answer it or `cancel_run` the run. Keep the single point of contact invariant: resolve or escalate the blocker yourself and never let a subagent contact the user. Mentor runs cannot be steered; `cancel_run` remains available. After either control acknowledgement, do not immediately call `get_subagent_result`; the completion notification inlines the full result.
61
+ If a worker or explorer is waiting on `ask_orchestrator`, answer its specific `messageId` inside `run_code` through `tools.send_message({ target, reply_to: messageId, message })`. The answer resumes only that waiting tool call; the subagent should continue afterward. While that question waits, steering without `reply_to` is refused with `question_pending` — only an answer can resume the blocked call, so answer it or use `tools.cancel_run(...)` inside `run_code` to stop the run. Keep the single point of contact invariant: resolve or escalate the blocker yourself and never let a subagent contact the user. Mentor runs cannot be steered; `tools.cancel_run(...)` remains available inside `run_code`. After either control acknowledgement, do not immediately call `tools.get_subagent_result(...)`; the completion notification inlines the full result.
62
62
 
63
63
  ## Verifying and reporting
64
64
 
@@ -15,6 +15,8 @@ export type PromptConstructorOptions = {
15
15
  memoryGuidance?: string;
16
16
  sessionBrowserEnabled?: boolean;
17
17
  executionContext?: ExecutionContext;
18
+ /** Same effective-shell gate that registers run_code. */
19
+ runCodeEnabled?: boolean;
18
20
  };
19
21
  export type PromptSpec = {
20
22
  basePromptFile?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"prompt-constructor.d.ts","sourceRoot":"","sources":["../../source/prompts/prompt-constructor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAOrE,MAAM,MAAM,wBAAwB,GAAG;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,eAAe,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B,CAAC;AAEF,wBAAgB,aAAa,CAAC,OA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AmG7E"}
@@ -3,17 +3,18 @@ import { getSearchViaShellAddendum } from './search-via-shell.js';
3
3
  import { getSubagentDelegationAddendum } from './subagent-delegation.js';
4
4
  import { getShellSandboxAddendum } from './shell-sandbox.js';
5
5
  import { getBackgroundShellAddendum } from './background-shell.js';
6
+ import { getDirectEditorToolsAddendum, getScriptPrimaryToolsAddendum } from './tool-surface-guidance.js';
6
7
  export function isLiteProfile(profile) {
7
8
  return profile.instructions.identity.kind === 'markdown';
8
9
  }
9
10
  export function buildPromptSpec(options) {
10
- const { model, profile, searchViaShell = false, runSubagentEnabled = false, runSubagentForegroundEnabled = false, runSubagentAsyncEnabled = false, asyncSubagentControlsEnabled = false, backgroundShellEnabled = false, sandboxEnabled = true, memoryEnabled = false, memoryGuidance = '', sessionBrowserEnabled = false, executionContext, } = options;
11
+ const { model, profile, searchViaShell = false, runSubagentEnabled = false, runSubagentForegroundEnabled = false, runSubagentAsyncEnabled = false, asyncSubagentControlsEnabled = false, backgroundShellEnabled = false, sandboxEnabled = true, memoryEnabled = false, memoryGuidance = '', sessionBrowserEnabled = false, executionContext, runCodeEnabled = false, } = options;
11
12
  const liteMode = isLiteProfile(profile);
12
13
  // Runtime modes are intentionally absent from model-family profile selection.
13
14
  // Their full workflows ride on the next user turn so rebuilding the agent does
14
15
  // not invalidate the provider's instruction prefix.
15
16
  const promptProfile = selectPromptProfile({ model, liteMode: false });
16
- const fragmentFiles = [...(promptProfile.fragmentFiles ?? [])];
17
+ const fragmentFiles = liteMode ? [] : [...(promptProfile.fragmentFiles ?? [])];
17
18
  const inlineSections = [];
18
19
  const isRegularMode = !liteMode;
19
20
  // Orchestrators can directly modify the worktree, so every non-lite prompt
@@ -63,6 +64,7 @@ export function buildPromptSpec(options) {
63
64
  if (memoryGuidance) {
64
65
  inlineSections.push(memoryGuidance);
65
66
  }
67
+ inlineSections.push(runCodeEnabled ? getScriptPrimaryToolsAddendum() : getDirectEditorToolsAddendum());
66
68
  return {
67
69
  ...(liteMode
68
70
  ? {