@sayknow-cli/coding-agent 0.7.11 → 0.7.13

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 (427) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/types/async/result-formatting.d.ts +2 -0
  3. package/dist/types/capability/fs.d.ts +22 -3
  4. package/dist/types/capability/mcp.d.ts +2 -0
  5. package/dist/types/cli/append-system-prompt.d.ts +6 -0
  6. package/dist/types/cli/update-cli.d.ts +3 -0
  7. package/dist/types/commands/contribution-prep.d.ts +0 -3
  8. package/dist/types/commands/migrate.d.ts +1 -1
  9. package/dist/types/commands/sdk.d.ts +9 -0
  10. package/dist/types/commit/changelog/index.d.ts +1 -0
  11. package/dist/types/config/settings-schema.d.ts +14 -0
  12. package/dist/types/config/settings.d.ts +7 -1
  13. package/dist/types/coordinator-mcp/session-reaper.d.ts +5 -0
  14. package/dist/types/cursor-delete-path.d.ts +1 -0
  15. package/dist/types/cursor-mcp-name.d.ts +8 -0
  16. package/dist/types/dap/config.d.ts +8 -4
  17. package/dist/types/dap/session.d.ts +11 -2
  18. package/dist/types/debug/report-bundle-parent.d.ts +2 -0
  19. package/dist/types/debug/system-info.d.ts +6 -1
  20. package/dist/types/discovery/helpers.d.ts +11 -3
  21. package/dist/types/discovery/mcp-json.d.ts +1 -0
  22. package/dist/types/edit/file-read-cache.d.ts +4 -0
  23. package/dist/types/edit/modes/patch.d.ts +14 -0
  24. package/dist/types/edit/modes/replace.d.ts +8 -0
  25. package/dist/types/eval/py/runtime.d.ts +9 -0
  26. package/dist/types/exa/mcp-client.d.ts +11 -6
  27. package/dist/types/exec/bash-executor.d.ts +18 -1
  28. package/dist/types/export/html/css-color.d.ts +2 -0
  29. package/dist/types/export/html/html-export-destination.d.ts +2 -0
  30. package/dist/types/export/html/template.generated.d.ts +1 -1
  31. package/dist/types/extensibility/custom-tools/loader.d.ts +3 -2
  32. package/dist/types/extensibility/custom-tools/types.d.ts +3 -1
  33. package/dist/types/extensibility/plugins/marketplace/cache.d.ts +2 -0
  34. package/dist/types/extensibility/plugins/plugin-link-path.d.ts +2 -0
  35. package/dist/types/goals/runtime.d.ts +6 -0
  36. package/dist/types/harness-control-plane/receipt-spool.d.ts +4 -0
  37. package/dist/types/hindsight/content.d.ts +5 -6
  38. package/dist/types/internal-urls/skill-path.d.ts +1 -0
  39. package/dist/types/internal-urls/types.d.ts +2 -0
  40. package/dist/types/lsp/clients/swiftlint-client.d.ts +0 -4
  41. package/dist/types/lsp/config.d.ts +8 -5
  42. package/dist/types/lsp/workspace-path.d.ts +1 -0
  43. package/dist/types/migrate/adapters/codex.d.ts +2 -1
  44. package/dist/types/migrate/adapters/index.d.ts +10 -1
  45. package/dist/types/migrate/executor.d.ts +3 -1
  46. package/dist/types/migrate/types.d.ts +15 -3
  47. package/dist/types/modes/components/custom-editor.d.ts +6 -0
  48. package/dist/types/modes/components/extensions/state-manager.d.ts +4 -3
  49. package/dist/types/modes/components/model-selector.d.ts +46 -0
  50. package/dist/types/modes/controllers/input-controller.d.ts +9 -0
  51. package/dist/types/modes/interactive-mode.d.ts +1 -0
  52. package/dist/types/modes/utils/macos-option-forwarding.d.ts +17 -0
  53. package/dist/types/runtime-mcp/content-limits.d.ts +4 -0
  54. package/dist/types/runtime-mcp/manager.d.ts +9 -1
  55. package/dist/types/runtime-mcp/mcp-redirect.d.ts +9 -0
  56. package/dist/types/runtime-mcp/oauth-public-url.d.ts +1 -0
  57. package/dist/types/runtime-mcp/plugin-mcp-name-filter.d.ts +22 -0
  58. package/dist/types/runtime-mcp/plugin-network-boundary.d.ts +1 -0
  59. package/dist/types/runtime-mcp/project-host-values.d.ts +33 -0
  60. package/dist/types/runtime-mcp/smithery-registry.d.ts +24 -0
  61. package/dist/types/runtime-mcp/tool-bridge.d.ts +4 -0
  62. package/dist/types/runtime-mcp/types.d.ts +6 -0
  63. package/dist/types/sdk/broker/ensure.d.ts +2 -0
  64. package/dist/types/sdk/broker/lifecycle-ledger.d.ts +5 -1
  65. package/dist/types/sdk/broker/runtime.d.ts +1 -1
  66. package/dist/types/sdk/bus/chat-daemon-control.d.ts +3 -1
  67. package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +3 -1
  68. package/dist/types/sdk/bus/telegram-daemon.d.ts +1 -0
  69. package/dist/types/sdk/host/events.d.ts +4 -0
  70. package/dist/types/session/agent-session.d.ts +22 -2
  71. package/dist/types/session/auto-resume.d.ts +5 -0
  72. package/dist/types/session/messages.d.ts +5 -1
  73. package/dist/types/session/session-manager.d.ts +13 -0
  74. package/dist/types/session/session-storage.d.ts +8 -0
  75. package/dist/types/session/streaming-output.d.ts +11 -0
  76. package/dist/types/session-import/redact.d.ts +1 -1
  77. package/dist/types/skc-runtime/managed-owner-admission.d.ts +3 -0
  78. package/dist/types/skc-runtime/psmux-detect.d.ts +5 -4
  79. package/dist/types/skc-runtime/ralplan-runtime.d.ts +5 -0
  80. package/dist/types/skc-runtime/sidecar-bootstrap-env.d.ts +6 -0
  81. package/dist/types/skc-runtime/state-writer.d.ts +4 -1
  82. package/dist/types/skc-runtime/tmux-sessions.d.ts +24 -0
  83. package/dist/types/skc-runtime/ultragoal-runtime.d.ts +4 -0
  84. package/dist/types/skill-state/workflow-mutation-guard.d.ts +20 -1
  85. package/dist/types/slash-commands/helpers/mcp.d.ts +5 -0
  86. package/dist/types/ssh/ssh-executor.d.ts +3 -1
  87. package/dist/types/system-prompt.d.ts +5 -2
  88. package/dist/types/task/executor.d.ts +17 -3
  89. package/dist/types/task/isolation-dir.d.ts +26 -0
  90. package/dist/types/task/role-body.d.ts +11 -0
  91. package/dist/types/task/token-log-mode.test.d.ts +1 -0
  92. package/dist/types/tools/ask.d.ts +77 -254
  93. package/dist/types/tools/ast-edit-write-path.d.ts +23 -0
  94. package/dist/types/tools/atomic-file-write.d.ts +74 -0
  95. package/dist/types/tools/auto-generated-guard.d.ts +5 -2
  96. package/dist/types/tools/bash-allowed-prefixes.d.ts +16 -0
  97. package/dist/types/tools/bash-interactive.d.ts +2 -0
  98. package/dist/types/tools/bash-skill-urls.d.ts +5 -1
  99. package/dist/types/tools/bash.d.ts +1 -0
  100. package/dist/types/tools/browser/cdp-url.d.ts +2 -0
  101. package/dist/types/tools/browser/tab-worker.d.ts +2 -0
  102. package/dist/types/tools/debug.d.ts +2 -2
  103. package/dist/types/tools/explicit-artifact.d.ts +8 -0
  104. package/dist/types/tools/fetch.d.ts +7 -4
  105. package/dist/types/tools/github-side-effect.d.ts +22 -0
  106. package/dist/types/tools/index.d.ts +3 -0
  107. package/dist/types/tools/monitor-mutation.d.ts +9 -0
  108. package/dist/types/tools/recipe/index.d.ts +2 -0
  109. package/dist/types/tools/recipe/recipe-guard.d.ts +7 -0
  110. package/dist/types/tools/restricted-cwd.d.ts +1 -0
  111. package/dist/types/tools/reverse-engineer.d.ts +81 -0
  112. package/dist/types/tools/search-tool-bm25.d.ts +2 -0
  113. package/dist/types/tools/tmux-self-injection-guard.d.ts +17 -0
  114. package/dist/types/tools/untrusted-content.d.ts +12 -0
  115. package/dist/types/utils/file-mentions.d.ts +5 -0
  116. package/dist/types/utils/open.d.ts +0 -1
  117. package/dist/types/utils/shell-snapshot.d.ts +2 -0
  118. package/dist/types/utils/title-generator.d.ts +12 -2
  119. package/dist/types/utils/tools-checksum.d.ts +7 -0
  120. package/dist/types/utils/xml-escape.d.ts +2 -0
  121. package/dist/types/web/scrapers/types.d.ts +8 -1
  122. package/dist/types/web/search/providers/codex.d.ts +6 -7
  123. package/dist/types/web/search/providers/insane.d.ts +7 -1
  124. package/dist/types/web/search/providers/kimi.d.ts +2 -0
  125. package/dist/types/web/search/providers/searxng.d.ts +7 -0
  126. package/dist/types/web/search/providers/xai.d.ts +2 -0
  127. package/package.json +7 -7
  128. package/scripts/generate-sdk-operation-inventory.ts +4 -0
  129. package/src/async/job-manager.ts +23 -9
  130. package/src/async/result-formatting.ts +40 -0
  131. package/src/capability/fs.ts +78 -11
  132. package/src/capability/mcp.ts +2 -0
  133. package/src/cli/append-system-prompt.ts +12 -0
  134. package/src/cli/auth-broker-cli.ts +22 -12
  135. package/src/cli/config-cli.ts +8 -18
  136. package/src/cli/migrate-cli.ts +7 -5
  137. package/src/cli/ssh-cli.ts +6 -3
  138. package/src/cli/stats-cli.ts +9 -4
  139. package/src/cli/update-cli.ts +42 -0
  140. package/src/cli/web-search-cli.ts +9 -3
  141. package/src/cli.ts +5 -9
  142. package/src/commands/commit.ts +2 -2
  143. package/src/commands/contribution-prep.ts +1 -3
  144. package/src/commands/harness.ts +25 -15
  145. package/src/commands/launch.ts +1 -1
  146. package/src/commands/migrate.ts +3 -3
  147. package/src/commands/sdk.ts +115 -14
  148. package/src/commands/ultragoal.ts +14 -8
  149. package/src/commit/agentic/agent.ts +6 -6
  150. package/src/commit/analysis/conventional.ts +14 -5
  151. package/src/commit/changelog/index.ts +39 -1
  152. package/src/commit/message.ts +10 -3
  153. package/src/config/config-file.ts +106 -3
  154. package/src/config/keybindings.ts +154 -7
  155. package/src/config/mcp-schema.json +4 -0
  156. package/src/config/model-registry.ts +10 -2
  157. package/src/config/settings-schema.ts +18 -0
  158. package/src/config/settings.ts +32 -4
  159. package/src/coordinator-mcp/policy.ts +14 -4
  160. package/src/coordinator-mcp/server.ts +44 -4
  161. package/src/coordinator-mcp/session-reaper.ts +9 -1
  162. package/src/cursor-delete-path.ts +10 -0
  163. package/src/cursor-mcp-name.ts +15 -0
  164. package/src/cursor.ts +13 -2
  165. package/src/dap/client.ts +9 -2
  166. package/src/dap/config.ts +33 -13
  167. package/src/dap/defaults.json +1 -1
  168. package/src/dap/session.ts +161 -36
  169. package/src/debug/crash-diagnostics.ts +89 -6
  170. package/src/debug/report-bundle-parent.ts +22 -0
  171. package/src/debug/report-bundle.ts +100 -3
  172. package/src/debug/system-info.ts +21 -4
  173. package/src/defaults/skc/extensions/grok-cli-vendor/src/shared/base-url.ts +21 -7
  174. package/src/defaults/skc/skills/deep-interview/SKILL.md +1 -1
  175. package/src/discovery/agents-md.ts +3 -2
  176. package/src/discovery/agents.ts +3 -2
  177. package/src/discovery/builtin.ts +21 -11
  178. package/src/discovery/claude.ts +5 -4
  179. package/src/discovery/cline.ts +2 -2
  180. package/src/discovery/codex.ts +6 -5
  181. package/src/discovery/cursor.ts +11 -2
  182. package/src/discovery/gemini.ts +4 -3
  183. package/src/discovery/github.ts +2 -2
  184. package/src/discovery/helpers.ts +51 -11
  185. package/src/discovery/mcp-json.ts +28 -12
  186. package/src/discovery/opencode.ts +2 -1
  187. package/src/discovery/ssh.ts +11 -6
  188. package/src/discovery/substitute-plugin-root.ts +3 -1
  189. package/src/discovery/vscode.ts +3 -3
  190. package/src/edit/apply-patch/index.ts +12 -1
  191. package/src/edit/file-read-cache.ts +24 -6
  192. package/src/edit/index.ts +90 -20
  193. package/src/edit/modes/patch.ts +215 -9
  194. package/src/edit/modes/replace.ts +141 -0
  195. package/src/eval/js/context-manager.ts +29 -3
  196. package/src/eval/js/worker-entry.ts +51 -18
  197. package/src/eval/py/runner.py +144 -5
  198. package/src/eval/py/runtime.ts +44 -4
  199. package/src/eval/py/tool-bridge.ts +4 -0
  200. package/src/exa/mcp-client.ts +53 -11
  201. package/src/exec/bash-executor.ts +87 -4
  202. package/src/exec/non-interactive-env.ts +0 -1
  203. package/src/export/html/css-color.ts +9 -0
  204. package/src/export/html/html-export-destination.ts +16 -0
  205. package/src/export/html/index.ts +102 -8
  206. package/src/export/html/template.generated.ts +1 -1
  207. package/src/extensibility/custom-tools/loader.ts +13 -3
  208. package/src/extensibility/custom-tools/types.ts +3 -1
  209. package/src/extensibility/custom-tools/wrapper.ts +3 -1
  210. package/src/extensibility/plugins/manager.ts +3 -2
  211. package/src/extensibility/plugins/marketplace/cache.ts +15 -0
  212. package/src/extensibility/plugins/marketplace/fetcher.ts +2 -2
  213. package/src/extensibility/plugins/marketplace/manager.ts +5 -3
  214. package/src/extensibility/plugins/plugin-link-path.ts +12 -0
  215. package/src/extensibility/skc-plugins/mcp-policy.ts +2 -1
  216. package/src/goals/runtime.ts +30 -8
  217. package/src/harness-control-plane/finalize.ts +10 -0
  218. package/src/harness-control-plane/operate.ts +12 -4
  219. package/src/harness-control-plane/owner.ts +8 -1
  220. package/src/harness-control-plane/receipt-spool.ts +105 -28
  221. package/src/harness-control-plane/storage.ts +124 -6
  222. package/src/hashline/execute.ts +3 -3
  223. package/src/hashline/recovery.ts +85 -2
  224. package/src/hindsight/config.ts +9 -3
  225. package/src/hindsight/content.ts +116 -16
  226. package/src/hindsight/mental-models.ts +22 -10
  227. package/src/hindsight/state.ts +7 -4
  228. package/src/hooks/native-skill-hook.ts +17 -12
  229. package/src/i18n/messages/de.settings.ts +3 -0
  230. package/src/i18n/messages/es.settings.ts +3 -0
  231. package/src/i18n/messages/fr.settings.ts +3 -0
  232. package/src/i18n/messages/ja.settings.ts +3 -0
  233. package/src/i18n/messages/ko.settings.ts +3 -0
  234. package/src/i18n/messages/zh.settings.ts +3 -0
  235. package/src/internal-urls/artifact-protocol.ts +3 -1
  236. package/src/internal-urls/docs-index.generated.ts +10 -10
  237. package/src/internal-urls/local-protocol.ts +167 -8
  238. package/src/internal-urls/skill-path.ts +18 -0
  239. package/src/internal-urls/skill-protocol.ts +2 -0
  240. package/src/internal-urls/types.ts +2 -0
  241. package/src/lsp/client.ts +2 -1
  242. package/src/lsp/clients/biome-client.ts +2 -0
  243. package/src/lsp/clients/swiftlint-client.ts +2 -0
  244. package/src/lsp/config.ts +18 -62
  245. package/src/lsp/edits.ts +6 -0
  246. package/src/lsp/index.ts +29 -0
  247. package/src/lsp/workspace-path.ts +75 -0
  248. package/src/main.ts +33 -11
  249. package/src/memories/index.ts +141 -9
  250. package/src/migrate/action-planner.ts +57 -0
  251. package/src/migrate/adapters/claude-code.ts +23 -4
  252. package/src/migrate/adapters/codex.ts +22 -4
  253. package/src/migrate/adapters/index.ts +22 -4
  254. package/src/migrate/adapters/opencode.ts +6 -1
  255. package/src/migrate/executor.ts +84 -7
  256. package/src/migrate/report.ts +19 -2
  257. package/src/migrate/types.ts +14 -4
  258. package/src/modes/DESIGN.md +5 -0
  259. package/src/modes/acp/acp-agent.ts +35 -2
  260. package/src/modes/acp/permission-mode.ts +18 -1
  261. package/src/modes/components/custom-editor.ts +14 -0
  262. package/src/modes/components/extensions/extension-dashboard.ts +2 -2
  263. package/src/modes/components/extensions/inspector-panel.ts +9 -5
  264. package/src/modes/components/extensions/state-manager.ts +15 -5
  265. package/src/modes/components/model-selector.ts +144 -94
  266. package/src/modes/components/welcome.ts +3 -2
  267. package/src/modes/controllers/command-controller.ts +300 -9
  268. package/src/modes/controllers/event-controller.ts +1 -1
  269. package/src/modes/controllers/extension-ui-controller.ts +32 -19
  270. package/src/modes/controllers/input-controller.ts +62 -26
  271. package/src/modes/controllers/plan-mode-controller.ts +17 -7
  272. package/src/modes/controllers/runtime-mcp-command-controller.ts +25 -20
  273. package/src/modes/controllers/ssh-command-controller.ts +3 -1
  274. package/src/modes/interactive-mode.ts +10 -0
  275. package/src/modes/utils/macos-option-forwarding.ts +80 -0
  276. package/src/prompts/system/irc-incoming.md +3 -1
  277. package/src/prompts/system/project-prompt.md +19 -0
  278. package/src/prompts/system/system-prompt.md +3 -0
  279. package/src/prompts/tools/ask.md +2 -0
  280. package/src/prompts/tools/debug.md +1 -1
  281. package/src/prompts/tools/monitor.md +7 -5
  282. package/src/prompts/tools/reverse-engineer.md +29 -0
  283. package/src/runtime-credential-selector.ts +2 -2
  284. package/src/runtime-mcp/config-writer.ts +10 -6
  285. package/src/runtime-mcp/config.ts +1 -0
  286. package/src/runtime-mcp/content-limits.ts +7 -0
  287. package/src/runtime-mcp/json-rpc.ts +2 -1
  288. package/src/runtime-mcp/manager.ts +57 -9
  289. package/src/runtime-mcp/mcp-redirect.ts +73 -0
  290. package/src/runtime-mcp/oauth-flow.ts +43 -5
  291. package/src/runtime-mcp/oauth-public-url.ts +8 -0
  292. package/src/runtime-mcp/plugin-mcp-name-filter.ts +62 -0
  293. package/src/runtime-mcp/plugin-network-boundary.ts +4 -0
  294. package/src/runtime-mcp/project-host-values.ts +50 -0
  295. package/src/runtime-mcp/render.ts +16 -1
  296. package/src/runtime-mcp/smithery-registry.ts +22 -3
  297. package/src/runtime-mcp/tool-bridge.ts +194 -21
  298. package/src/runtime-mcp/transports/http.ts +4 -3
  299. package/src/runtime-mcp/transports/stdio.ts +2 -1
  300. package/src/runtime-mcp/types.ts +6 -0
  301. package/src/sdk/broker/broker.ts +11 -2
  302. package/src/sdk/broker/ensure.ts +131 -10
  303. package/src/sdk/broker/lifecycle-ledger.ts +18 -3
  304. package/src/sdk/broker/lifecycle.ts +21 -19
  305. package/src/sdk/broker/runtime.ts +1 -1
  306. package/src/sdk/bus/chat-daemon-cli.ts +38 -1
  307. package/src/sdk/bus/chat-daemon-control.ts +5 -3
  308. package/src/sdk/bus/index.ts +5 -3
  309. package/src/sdk/bus/lifecycle-control-runtime.ts +9 -2
  310. package/src/sdk/bus/session-control.ts +2 -0
  311. package/src/sdk/bus/slack-daemon.ts +8 -1
  312. package/src/sdk/bus/slack-live-provider.ts +3 -1
  313. package/src/sdk/bus/telegram-daemon-contract.ts +3 -1
  314. package/src/sdk/bus/telegram-daemon-control.ts +17 -12
  315. package/src/sdk/bus/telegram-daemon.ts +41 -1
  316. package/src/sdk/host/events.ts +67 -4
  317. package/src/sdk/mcp/server.ts +16 -3
  318. package/src/sdk/protocol/operation-inventory.generated.json +22 -0
  319. package/src/sdk/session.ts +18 -25
  320. package/src/secrets/obfuscator.ts +92 -12
  321. package/src/session/agent-session.ts +466 -100
  322. package/src/session/artifacts.ts +3 -1
  323. package/src/session/auto-resume.ts +45 -8
  324. package/src/session/history-storage.ts +172 -8
  325. package/src/session/internal/managed-session-scope.ts +130 -52
  326. package/src/session/messages.ts +47 -6
  327. package/src/session/session-manager.ts +116 -8
  328. package/src/session/session-storage.ts +31 -1
  329. package/src/session/streaming-output.ts +263 -4
  330. package/src/session-import/redact.ts +76 -3
  331. package/src/setup/hermes-setup.ts +4 -1
  332. package/src/skc-runtime/gc-runtime.ts +26 -4
  333. package/src/skc-runtime/launch-tmux.ts +21 -11
  334. package/src/skc-runtime/launch-worktree.ts +42 -3
  335. package/src/skc-runtime/managed-owner-admission.ts +46 -2
  336. package/src/skc-runtime/psmux-detect.ts +29 -5
  337. package/src/skc-runtime/ralplan-runtime.ts +14 -1
  338. package/src/skc-runtime/session-resolution.ts +38 -6
  339. package/src/skc-runtime/sidecar-bootstrap-env.ts +19 -0
  340. package/src/skc-runtime/state-writer.ts +134 -16
  341. package/src/skc-runtime/tmux-sessions.ts +85 -4
  342. package/src/skc-runtime/ultragoal-change-set.ts +18 -2
  343. package/src/skc-runtime/ultragoal-guard.ts +9 -1
  344. package/src/skc-runtime/ultragoal-runtime.ts +26 -9
  345. package/src/skill-state/active-state.ts +13 -0
  346. package/src/skill-state/workflow-mutation-guard.ts +3297 -180
  347. package/src/slash-commands/builtin-registry.ts +14 -8
  348. package/src/slash-commands/helpers/mcp.ts +20 -7
  349. package/src/ssh/ssh-executor.ts +3 -1
  350. package/src/stt/recorder.ts +26 -9
  351. package/src/system-prompt.ts +65 -16
  352. package/src/task/commands.ts +3 -1
  353. package/src/task/executor.ts +52 -7
  354. package/src/task/index.ts +28 -0
  355. package/src/task/isolation-dir.ts +143 -0
  356. package/src/task/role-body.ts +84 -0
  357. package/src/task/token-log-mode.test.ts +162 -0
  358. package/src/task/token-log.ts +91 -2
  359. package/src/task/worktree.ts +16 -7
  360. package/src/tools/archive-reader.ts +653 -31
  361. package/src/tools/ask.ts +86 -14
  362. package/src/tools/ast-edit-write-path.ts +133 -0
  363. package/src/tools/ast-edit.ts +27 -1
  364. package/src/tools/ast-grep.ts +7 -2
  365. package/src/tools/atomic-file-write.ts +625 -0
  366. package/src/tools/auto-generated-guard.ts +28 -8
  367. package/src/tools/bash-allowed-prefixes.ts +225 -6
  368. package/src/tools/bash-interactive.ts +12 -0
  369. package/src/tools/bash-skill-urls.ts +113 -7
  370. package/src/tools/bash.ts +152 -20
  371. package/src/tools/browser/cdp-url.ts +18 -0
  372. package/src/tools/browser/tab-worker.ts +49 -14
  373. package/src/tools/browser.ts +25 -8
  374. package/src/tools/cron.ts +10 -1
  375. package/src/tools/debug.ts +16 -8
  376. package/src/tools/eval.ts +71 -34
  377. package/src/tools/explicit-artifact.ts +89 -0
  378. package/src/tools/fetch.ts +26 -17
  379. package/src/tools/gh.ts +40 -12
  380. package/src/tools/github-side-effect.ts +112 -0
  381. package/src/tools/image-gen.ts +24 -10
  382. package/src/tools/index.ts +6 -0
  383. package/src/tools/monitor-mutation.ts +27 -0
  384. package/src/tools/monitor.ts +28 -1
  385. package/src/tools/output-meta.ts +74 -5
  386. package/src/tools/read.ts +24 -36
  387. package/src/tools/recipe/index.ts +12 -0
  388. package/src/tools/recipe/recipe-guard.ts +19 -0
  389. package/src/tools/recipe/runner.ts +23 -12
  390. package/src/tools/render-utils.ts +2 -2
  391. package/src/tools/restricted-cwd.ts +10 -0
  392. package/src/tools/reverse-engineer.ts +497 -0
  393. package/src/tools/search-tool-bm25.ts +14 -3
  394. package/src/tools/search.ts +3 -2
  395. package/src/tools/ssh.ts +235 -8
  396. package/src/tools/subagent-render.ts +43 -7
  397. package/src/tools/subagent.ts +7 -3
  398. package/src/tools/tmux-self-injection-guard.ts +3538 -0
  399. package/src/tools/todo-write.ts +41 -3
  400. package/src/tools/untrusted-content.ts +23 -0
  401. package/src/tools/vim.ts +2 -2
  402. package/src/tools/write.ts +37 -4
  403. package/src/tui/tree-list.ts +15 -1
  404. package/src/utils/commit-message-generator.ts +9 -2
  405. package/src/utils/external-editor.ts +21 -7
  406. package/src/utils/file-mentions.ts +75 -7
  407. package/src/utils/git.ts +38 -7
  408. package/src/utils/open.ts +73 -4
  409. package/src/utils/shell-snapshot.ts +9 -1
  410. package/src/utils/title-generator.ts +61 -16
  411. package/src/utils/tools-checksum.ts +34 -0
  412. package/src/utils/tools-manager.ts +24 -6
  413. package/src/utils/xml-escape.ts +14 -0
  414. package/src/web/insane/url-guard.ts +2 -1
  415. package/src/web/scrapers/types.ts +8 -0
  416. package/src/web/scrapers/youtube.ts +3 -2
  417. package/src/web/search/index.ts +4 -3
  418. package/src/web/search/providers/anthropic.ts +4 -4
  419. package/src/web/search/providers/codex.ts +31 -34
  420. package/src/web/search/providers/insane.ts +145 -28
  421. package/src/web/search/providers/kimi.ts +15 -5
  422. package/src/web/search/providers/searxng.ts +47 -4
  423. package/src/web/search/providers/xai.ts +7 -2
  424. package/dist/types/cli/shell-cli.d.ts +0 -8
  425. package/dist/types/commands/shell.d.ts +0 -21
  426. package/src/cli/shell-cli.ts +0 -176
  427. package/src/commands/shell.ts +0 -29
@@ -16,7 +16,9 @@ export type ChatDaemonAction = "stop" | "reload";
16
16
  * when deleting an observed owner-lock lease. Generation 12 refreshes retained
17
17
  * native path and process authority semantics. Generation 13 rejects special
18
18
  * files before retained native authority opens. Generation 14 reloads shared
19
- * chat daemons after notification configuration parsing changes.
19
+ * chat daemons after notification configuration parsing changes. Generation 15
20
+ * retires a running owner once its notifications are definitely disabled.
21
+ * Slack generation 16 reclaims the daemon's own expired root publication lease.
20
22
  */
21
23
  export declare const CHAT_DAEMON_GENERATIONS: Readonly<Record<ChatDaemonKind, number>>;
22
24
  export declare function chatDaemonGeneration(kind: ChatDaemonKind): number;
@@ -39,8 +39,10 @@ export declare const NOTIFICATION_PROTOCOL_VERSION = 3;
39
39
  * and Bot API cooldown structural fixes (#2956, #2960, #3048).
40
40
  * Generation 30 adds opt-in tool activity delivery, closed lifecycle phases,
41
41
  * and capability-versioned mixed-host compatibility.
42
+ * Generation 31 lets a Windows controller wait for a cooperative stop and has
43
+ * the owner watch its control request during a long poll (upstream #6174).
42
44
  */
43
- export declare const DAEMON_GENERATION = 30;
45
+ export declare const DAEMON_GENERATION = 31;
44
46
  /**
45
47
  * Serving-compatibility boundary for daemon lifecycle requests. Epoch 1 covers
46
48
  * all builds published before this field existed; epoch 2 covered generation 29;
@@ -1127,4 +1127,5 @@ export declare class TelegramNotificationDaemon {
1127
1127
  run(): Promise<void>;
1128
1128
  /** True when a signal-driven stop or an owner-scoped control request asks the loop to exit. */
1129
1129
  private controlStopRequested;
1130
+ private checkControlStopRequested;
1130
1131
  }
@@ -19,6 +19,8 @@ export interface EventReplay {
19
19
  events: EventFrame[];
20
20
  gap?: EventReplayGap;
21
21
  }
22
+ /** Notification policy refresh records the live redaction bit for one session ring. */
23
+ export declare function setSessionOutboundRedact(sessionId: string, enabled: boolean): void;
22
24
  export declare class SessionEventStream {
23
25
  #private;
24
26
  constructor(options?: {
@@ -28,6 +30,8 @@ export declare class SessionEventStream {
28
30
  });
29
31
  get generation(): number;
30
32
  get sequence(): number;
33
+ /** Follow the session redaction bit. Replay then drops kinds emit sites already suppress. */
34
+ setOutboundRedact(enabled: boolean): void;
31
35
  restart(): number;
32
36
  emit(frame: SdkFrame): EventFrame;
33
37
  /** Replays retained current-generation events and reports any required resynchronization. */
@@ -82,7 +82,7 @@ import type { CustomTool } from "../extensibility/custom-tools/types";
82
82
  import type { ExtensionRunner } from "../extensibility/extensions";
83
83
  import type { CompactOptions, ContextUsage, ExtensionTranscriptEntry } from "../extensibility/extensions/types";
84
84
  import type { SessionSwitchEvent } from "../extensibility/shared-events";
85
- import { type Skill, type SkillWarning } from "../extensibility/skills";
85
+ import { type ParsedSkillInvocation, type Skill, type SkillWarning } from "../extensibility/skills";
86
86
  import { type FileSlashCommand } from "../extensibility/slash-commands";
87
87
  import { GoalRuntime } from "../goals/runtime";
88
88
  import type { Goal, GoalModeState } from "../goals/state";
@@ -806,6 +806,11 @@ export declare class AgentSession {
806
806
  */
807
807
  get hasPostPromptWork(): boolean;
808
808
  /** All messages including custom types like BashExecutionMessage */
809
+ /**
810
+ * All messages including custom types like BashExecutionMessage. Request-scoped
811
+ * ephemeral copies are retained only in `agent.state.messages` to keep the provider
812
+ * cache prefix stable; they are never part of this public view.
813
+ */
809
814
  get messages(): AgentMessage[];
810
815
  get transcriptPromptGeneration(): number;
811
816
  static restoreFromMemoryGuardCheckpoint(input: AgentSessionMemoryGuardRestoreInput): Promise<AgentMemoryGuardRestoreResult>;
@@ -892,6 +897,20 @@ export declare class AgentSession {
892
897
  get customCommands(): ReadonlyArray<LoadedCustomCommand>;
893
898
  /** Update the MCP prompt commands list. Called when server prompts are (re)loaded. */
894
899
  setMCPPromptCommands(commands: LoadedCustomCommand[]): void;
900
+ /**
901
+ * The loaded skill a prompt's text dispatches to, or undefined when `prompt`
902
+ * would submit it as ordinary text (unknown or disabled `/skill:` names,
903
+ * chains, or attached images). Single source for dispatch and for callers
904
+ * that must mirror it, such as startup title seeding.
905
+ */
906
+ resolvePromptSkillInvocation(text: string, images?: readonly unknown[]): ParsedSkillInvocation | undefined;
907
+ /**
908
+ * Whether `prompt` intercepts this slash text as an extension or custom/MCP
909
+ * command. Used to keep command arguments away from the title model. Mirrors the
910
+ * command lookup in `#tryExecuteExtensionCommand` / `#tryExecuteCustomCommand`
911
+ * without executing anything.
912
+ */
913
+ isLocallyHandledSlashCommand(text: string): boolean;
895
914
  prompt(text: string, options?: PromptOptions): Promise<void>;
896
915
  promptCustomMessage<T = unknown>(message: Pick<CustomMessage<T>, "customType" | "content" | "display" | "details" | "attribution">, options?: Pick<PromptOptions, "streamingBehavior" | "toolChoice" | "followUpQueuePolicy" | "onPreflightAccepted" | "onPreflightAcceptCommit">): Promise<void>;
897
916
  /**
@@ -1274,7 +1293,8 @@ export declare class AgentSession {
1274
1293
  * left by a non-graceful process exit after the user/custom/tool-result message
1275
1294
  * was persisted but before the agent emitted a terminal assistant response.
1276
1295
  * Removes only a failed/aborted assistant tail with no visible output or tool
1277
- * calls, then re-attempts with a fresh retry budget.
1296
+ * calls, or a failed tail whose cut-off tool calls never ran (with their placeholder
1297
+ * results), then re-attempts with a fresh retry budget.
1278
1298
  * @returns false when the agent is busy, no retryable tail exists, the tail shows
1279
1299
  * output or tool calls, a persisted recovery is unresolved, or the step dispatched
1280
1300
  * unobservable remote work; true when a retry/resume was scheduled.
@@ -40,6 +40,11 @@ export interface AutoResumeMarker {
40
40
  * recovery drops it and asks the same model again instead of stopping.
41
41
  */
42
42
  export declare function isThinkingOnlyFailure(message: AgentMessage | undefined): boolean;
43
+ /**
44
+ * The transcript before its trailing unexecuted tool-call failure, without the error
45
+ * placeholder results paired with its calls; undefined when the tail is anything else.
46
+ */
47
+ export declare function dropUnexecutedToolCallFailure(messages: readonly AgentMessage[]): AgentMessage[] | undefined;
43
48
  /**
44
49
  * Restart-safe means: an instance of a built-in read-only tool class (seen through
45
50
  * extension/hook interception wrappers) whose wire name is unique among the selected
@@ -104,8 +104,12 @@ export declare const PRE_ADMISSION_ARTIFACT_SPILL_TAIL_BYTES = 4096;
104
104
  * Build the deterministic inline receipt for a tool result saved before the
105
105
  * next provider context is constructed. Byte boundaries never split UTF-8
106
106
  * code points, so head/tail recovery remains readable for emoji and CJK text.
107
+ *
108
+ * `redact` runs on the complete text before the cut. The digest stays the
109
+ * caller's hash of the stored artifact; the omitted count is the redacted
110
+ * preview's omitted bytes.
107
111
  */
108
- export declare function createPreAdmissionArtifactSpillPreview(fullText: string, artifactId: string, digest: string): string;
112
+ export declare function createPreAdmissionArtifactSpillPreview(fullText: string, artifactId: string, digest: string, redact?: (text: string) => string): string;
109
113
  /**
110
114
  * Message type for bash executions via the ! command.
111
115
  */
@@ -584,10 +584,23 @@ export interface UsageStatistics {
584
584
  premiumRequests: number;
585
585
  cost: number;
586
586
  }
587
+ /**
588
+ * Resident text is a second plaintext copy of assistant and tool output. A cache
589
+ * directory inside a Git worktree can be staged by a later `git add`, so that
590
+ * cache stays in memory. Both the lexical and the canonical directory are
591
+ * classified: a symlink outside the worktree must not hide a target inside it.
592
+ * No existing directory within 64 ancestors, or a resolver error, stays in memory.
593
+ */
594
+ export declare function residentTextCacheRootAllowsDisk(cacheRoot: string): boolean;
587
595
  export interface ResolvedSessionMatch {
588
596
  session: SessionInfo;
589
597
  scope: "local" | "global";
590
598
  }
599
+ /**
600
+ * Equal session id first, the same `id ===` check managed resume already uses.
601
+ * Prefix matching stays for every other argument, in list order.
602
+ */
603
+ export declare function pickResumableSession(sessions: readonly SessionInfo[], sessionArg: string): SessionInfo | undefined;
591
604
  export declare function resolveResumableSession(sessionArg: string, cwd: string, sessionDir?: string, storage?: SessionStorage, managedAgentDir?: string): Promise<ResolvedSessionMatch | undefined>;
592
605
  interface SessionManagerStateSnapshot {
593
606
  sessionId: string;
@@ -269,6 +269,14 @@ export type NativeDirectoryTreeSnapshot = {
269
269
  rootIno: string;
270
270
  entries: NativeDirectoryTreeEntry[];
271
271
  };
272
+ /**
273
+ * Replace an explicit file owned by this user. Creation mode `0600` does not
274
+ * install a Windows owner-only DACL, so this applies and verifies the same
275
+ * native path a primary transcript uses when it has no managed security
276
+ * context. POSIX mode stays `0600`, and a final-component symlink fails the
277
+ * open (`O_NOFOLLOW`).
278
+ */
279
+ export declare function writeExplicitOwnerOnlyTextSync(pathname: string, content: string): void;
272
280
  /** Reject a symlink/junction/reparse component before a storage path is created or opened. */
273
281
  declare function assertNoReparsePath(pathname: string): void;
274
282
  /** @internal Exported for tests. */
@@ -3,6 +3,8 @@ export declare const DEFAULT_MAX_LINES = 3000;
3
3
  export declare const DEFAULT_MAX_BYTES: number;
4
4
  export declare const DEFAULT_MAX_COLUMN = 1024;
5
5
  export declare const DEFAULT_ARTIFACT_MAX_BYTES: number;
6
+ /** Run `fn` while column caps can see these plain secrets. */
7
+ export declare function runWithOutputRedaction<T>(plainSecrets: readonly string[], fn: () => T): T;
6
8
  export interface OutputSummary {
7
9
  output: string;
8
10
  truncated: boolean;
@@ -136,6 +138,15 @@ export declare function truncateLine(line: string, maxChars?: number): {
136
138
  text: string;
137
139
  wasTruncated: boolean;
138
140
  };
141
+ /**
142
+ * Truncate each line to max characters without leaving a configured plain-secret
143
+ * prefix in the retained text. Prior uncapped lines remain in scope because a
144
+ * later line's cut can split a multiline secret.
145
+ */
146
+ export declare function truncateTextWithSecretAwareness(text: string, maxChars?: number, secrets?: readonly string[]): {
147
+ text: string;
148
+ wasTruncated: boolean;
149
+ };
139
150
  /** Shared helper to build a no-truncation result. */
140
151
  export declare function noTruncResult(content: string, totalLines?: number, totalBytes?: number): TruncationResult;
141
152
  /**
@@ -8,7 +8,7 @@
8
8
  */
9
9
  export declare const IMPORT_REDACTED_PLACEHOLDER = "[REDACTED]";
10
10
  /** Bumped when patterns change; persisted in import provenance. */
11
- export declare const IMPORT_SANITIZER_VERSION = 5;
11
+ export declare const IMPORT_SANITIZER_VERSION = 6;
12
12
  export interface ImportRedactionResult {
13
13
  value: string;
14
14
  redacted: number;
@@ -5,6 +5,9 @@ export declare const MANAGED_OWNER_PREDECESSOR_GENERATION_ENV = "SKC_MANAGED_OWN
5
5
  export declare const MANAGED_OWNER_PREDECESSOR_RUN_ID_ENV = "SKC_MANAGED_OWNER_PREDECESSOR_RUN_ID";
6
6
  export declare const MANAGED_OWNER_PREDECESSOR_INCARNATION_ENV = "SKC_MANAGED_OWNER_PREDECESSOR_INCARNATION";
7
7
  export declare const MANAGED_OWNER_TRANSCRIPT_PATH_ENV = "SKC_MANAGED_OWNER_TRANSCRIPT_PATH";
8
+ export declare function trustedManagedOwnerTranscriptPath(env?: NodeJS.ProcessEnv, cwd?: string): string;
9
+ /** Session file forwarded to a replacement child. Same provenance rule. */
10
+ export declare function trustedManagedOwnerLaunchSessionFile(env: NodeJS.ProcessEnv, cwd: string): string;
8
11
  export interface ManagedOwnerRecoveryContext {
9
12
  root: string;
10
13
  binding: ManagedOwnerBinding;
@@ -61,10 +61,11 @@ export interface ResolvedTmuxBinary {
61
61
  viaExplicitOverride: boolean;
62
62
  }
63
63
  /**
64
- * Resolve the tmux command SKC should invoke. Honors the existing
65
- * SKC_TMUX_COMMAND / SKC_TEAM_TMUX_COMMAND overrides; on Windows when no
66
- * override is set, psmux (installed as psmux, pmux, or tmux) is picked
67
- * automatically so the default skc --tmux flow lands on a real multiplexer.
64
+ * Resolve the tmux command SKC should invoke. Honors an operator
65
+ * SKC_TMUX_COMMAND / SKC_TEAM_TMUX_COMMAND override; a project dotenv value is
66
+ * ignored. On Windows when no override is set, psmux (installed as psmux,
67
+ * pmux, or tmux) is picked automatically so the default skc --tmux flow lands
68
+ * on a real multiplexer.
68
69
  */
69
70
  export declare function resolveSkcTmuxBinary(options?: ResolveSkcTmuxBinaryOptions): ResolvedTmuxBinary;
70
71
  /** Test-only helper: drop the in-process detection cache. */
@@ -134,4 +134,9 @@ export declare function resolveRalplanMaxReviewPassesPerLane(cwd: string): Promi
134
134
  source: string;
135
135
  }>;
136
136
  export declare function isRalplanArtifactWriteInvocation(args: readonly string[]): boolean;
137
+ /**
138
+ * Credential scrub for a ralplan stage body. The result is what
139
+ * `skc ralplan --write` hashes and stores.
140
+ */
141
+ export declare function scrubRalplanPersistedBody(content: string): string;
137
142
  export declare function runNativeRalplanCommand(args: string[], cwd?: string): Promise<RalplanCommandResult>;
@@ -0,0 +1,6 @@
1
+ import { type ProjectEnvSnapshot } from "@sayknow-cli/utils/env-file";
2
+ /**
3
+ * Operator environment only. A value that matches the project dotenv snapshot
4
+ * was loaded by Bun from the repository and must not become signing material.
5
+ */
6
+ export declare function trustedCoordinatorEnv(name: string, env?: NodeJS.ProcessEnv, snapshot?: ProjectEnvSnapshot): string | undefined;
@@ -1,4 +1,4 @@
1
- import type { Stats } from "node:fs";
1
+ import { type Stats } from "node:fs";
2
2
  import { type FileLockOptions } from "../config/file-lock";
3
3
  import type { SkillActiveEntry } from "../skill-state/active-state";
4
4
  import { type AuditEntry, type CanonicalSkcWorkflowSkill, type WorkflowStateMutationOwner } from "../skill-state/workflow-state-contract";
@@ -146,6 +146,9 @@ export type StrictMutationReadResult = {
146
146
  export declare function readExistingStateForMutation(filePath: string): Promise<StrictMutationReadResult>;
147
147
  export declare function workflowEnvelopeContentSha256(value: unknown): string;
148
148
  export declare function stampWorkflowEnvelopeChecksum<T>(value: T, filePath: string, computedAt?: string): T;
149
+ export type WorkflowEnvelopeChecksumStatus = "absent" | "match" | "mismatch";
150
+ /** Compare a parsed envelope to its writer-stamped `content_sha256`, when one is present. */
151
+ export declare function workflowEnvelopeChecksumStatus(value: unknown): WorkflowEnvelopeChecksumStatus;
149
152
  export declare function detectWorkflowEnvelopeIntegrityMismatch(filePath: string): Promise<WorkflowEnvelopeIntegrityMismatch | undefined>;
150
153
  type ActiveStateCacheInvalidator = (cwd?: string, sessionId?: string) => void;
151
154
  export declare function setActiveStateCacheInvalidator(invalidator: ActiveStateCacheInvalidator): void;
@@ -1,3 +1,4 @@
1
+ import { type ProjectEnvSnapshot } from "@sayknow-cli/utils/env-file";
1
2
  import { type AbandonedIdentityCensus, type IdentityCreateKey, type IdentityCreateReservationResult, type OwnerIsolationProbeSync, type PlanResponse, type TmuxOwnerIsolationExecutionDependencies, type TmuxOwnerIsolationExecutionResult } from "./tmux-owner-isolation";
2
3
  export interface SkcTmuxSessionStatus {
3
4
  name: string;
@@ -108,6 +109,29 @@ export declare function statusSkcTmuxSession(sessionName: string, env?: NodeJS.P
108
109
  */
109
110
  export declare function settleAbandonedIdentity(reserved: IdentityCreateReservationResult, identityKey: IdentityCreateKey, census: AbandonedIdentityCensus): IdentityCreateReservationResult;
110
111
  export declare function abandonedIdentityCensus(tmuxCommand: string, env: NodeJS.ProcessEnv, stateFile: string): AbandonedIdentityCensus;
112
+ /**
113
+ * Drop project-dotenv copies of the tmux session name, coordinator id, and
114
+ * state-file path. A pin is kept only when every snapshot accepts it, so a
115
+ * declaration Bun loaded before `chdir` is refused even if the launch cwd no
116
+ * longer contains that file. Acceptance uses the shared helper, but the
117
+ * original string stays: callers trim at use, and a later check must see the
118
+ * same value that was accepted.
119
+ */
120
+ export declare function trustedTmuxLaunchIdentityEnv(env: NodeJS.ProcessEnv, snapshots: readonly ProjectEnvSnapshot[]): NodeJS.ProcessEnv;
121
+ export declare function tmuxLaunchIdentityEnv(env: NodeJS.ProcessEnv, cwd: string): NodeJS.ProcessEnv;
122
+ /**
123
+ * Session id the launched child must see. A trusted pin is passed through.
124
+ * A rejected project pin is replaced by the same fallback the launch plan uses
125
+ * for the session root, which also stops Bun from reloading that dotenv value
126
+ * (`SKC_TMUX_LAUNCHED=1` skips the planner filter). An omitted id stays omitted.
127
+ */
128
+ export declare function resolvedChildSkcSessionId(input: {
129
+ trusted: string | undefined;
130
+ inherited: string | undefined;
131
+ projectDeclared: boolean;
132
+ fallback: string;
133
+ }): string | undefined;
134
+ export declare function childSkcSessionIdAssignment(env: NodeJS.ProcessEnv, identityEnv: NodeJS.ProcessEnv, cwd: string, fallbackSessionId: string): Record<string, string>;
111
135
  export declare function createSkcTmuxSession(env?: NodeJS.ProcessEnv, options?: CreateSkcTmuxSessionOptions): SkcTmuxSessionStatus;
112
136
  /** Proves a managed reusable name still resolves to one immutable session on one server. */
113
137
  export declare function proveSkcTmuxSessionMutationTarget(sessionName: string, env?: NodeJS.ProcessEnv): ProvenTmuxSessionIdentity;
@@ -247,6 +247,7 @@ export declare function resolveUltragoalNudgeBudget(cwd: string): Promise<{
247
247
  export declare function selectUltragoalNudgeTarget(plan: UltragoalPlan, options?: {
248
248
  currentGoalObjective?: string;
249
249
  retryFailed?: boolean;
250
+ excludedGoalIds?: readonly string[];
250
251
  }): UltragoalNudgeTarget | null;
251
252
  /**
252
253
  * Atomic consuming writer. Locks the ledger path, rereads + counts nudge rows for the
@@ -308,6 +309,9 @@ export declare function createUltragoalPlan(input: {
308
309
  validationBatches?: UltragoalValidationBatchInput[];
309
310
  validationBatchJson?: string;
310
311
  }): Promise<UltragoalPlan>;
312
+ export declare function selectNextSchedulableGoal<T extends {
313
+ status: UltragoalGoalStatus;
314
+ }>(goals: readonly T[], retryFailed: boolean): T | undefined;
311
315
  export interface UltragoalRunCompletionState {
312
316
  requiredGoals: UltragoalGoal[];
313
317
  incompleteGoals: UltragoalGoal[];
@@ -1,9 +1,16 @@
1
1
  import type { AgentTool } from "@sayknow-cli/agent-core";
2
- import { readVisibleSkillActiveState } from "./active-state";
2
+ import { readVisibleSkillActiveState, type SkillActiveEntry } from "./active-state";
3
3
  export declare const DEEP_INTERVIEW_MUTATION_BLOCK_MESSAGE = "Deep-interview phase boundary: continue gathering context/questions/risks and emit a handoff/spec before code edits. Mutation tools and patch execution are blocked while deep-interview is active; finalize specs through `skc deep-interview --write --stage final` or hand off to an execution phase.";
4
4
  export declare const WORKFLOW_STATE_MUTATION_BLOCK_MESSAGE = ".skc workflow state and artifacts are runtime-owned. Agent mutation tools cannot edit `.skc/**`; use the sanctioned `skc` CLI instead.";
5
5
  export declare const RALPLAN_MUTATION_BLOCK_MESSAGE = "Ralplan planning phase boundary: keep refining the consensus plan and persist plan artifacts through `skc ralplan --write` (stage scratch files under a temp dir if needed). Product-code mutation tools and patch execution are blocked while ralplan is active; mutate only after the plan is approved and execution begins.";
6
6
  export declare const ULTRAGOAL_GOAL_PLANNING_MUTATION_BLOCK_MESSAGE = "Ultragoal goal-planning phase boundary: finish goal planning and record goals through `skc ultragoal` before editing code. Product-code mutation tools and patch execution are blocked until goal planning completes and execution begins.";
7
+ /**
8
+ * Tools whose execute path can mutate product state. `github` is included so
9
+ * side-effect ops share this guard. `eval` and `python` run code that can write
10
+ * files without going through edit, write, or bash.
11
+ */
12
+ export declare const WORKFLOW_MUTATION_TOOL_NAMES: readonly ["edit", "write", "ast_edit", "bash", "github", "eval", "python"];
13
+ export declare function isWorkflowMutationTool(name: string): boolean;
7
14
  type ToolWithEditMode = AgentTool & {
8
15
  mode?: unknown;
9
16
  customWireName?: unknown;
@@ -41,6 +48,18 @@ export declare function readWorkflowGuardContext(cwd: string, options?: {
41
48
  sessionId?: string;
42
49
  threadId?: string;
43
50
  }): Promise<WorkflowGuardContext>;
51
+ /**
52
+ * Pick the single CURRENT workflow entry among active entries.
53
+ *
54
+ * Steady state has exactly one active workflow skill (handoff demotes the prior
55
+ * to `active:false`, which `listActiveSkills` already filters out). If several
56
+ * are momentarily active, prefer the most-recently-updated entry so a stale
57
+ * planning row (e.g. a still-active ralplan `final`) can never be selected over a
58
+ * newer executor (ultragoal), and a planning *return* (newer `updated_at`)
59
+ * reliably wins. Ties fall back to the resolved top-level `skill`, then to the
60
+ * first entry, matching how the HUD/chain guard pick `activeSkills[0]`.
61
+ */
62
+ export declare function resolveCurrentWorkflowEntry(entries: SkillActiveEntry[], topLevelSkill: string): SkillActiveEntry;
44
63
  export declare function assertWorkflowMutationRawPathsAllowed(input: {
45
64
  cwd: string;
46
65
  sessionId?: string;
@@ -1,3 +1,8 @@
1
1
  import type { ParsedSlashCommand, SlashCommandResult, SlashCommandRuntime } from "../types";
2
+ /**
3
+ * One terminal row for an untrusted MCP server or tool name.
4
+ * Ordinary names are unchanged. Controls, OSC, and line breaks are not.
5
+ */
6
+ export declare function mcpTerminalLabel(value: string): string;
2
7
  /** ACP/text-mode `/mcp` handler. Shared by both dispatchers via the spec. */
3
8
  export declare function handleMcpAcp(command: ParsedSlashCommand, runtime: SlashCommandRuntime): Promise<SlashCommandResult>;
@@ -31,7 +31,9 @@ export interface SSHResult {
31
31
  outputLines: number;
32
32
  /** Number of bytes included in the output text */
33
33
  outputBytes: number;
34
- /** Artifact ID if full output was saved to artifact storage */
34
+ /** Artifact ID if output was saved to artifact storage. */
35
35
  artifactId?: string;
36
+ /** Bytes omitted from artifact storage after its hard cap was reached. */
37
+ artifactTruncatedBytes?: number;
36
38
  }
37
39
  export declare function executeSSH(host: SSHConnectionTarget, command: string, options?: SSHExecutorOptions): Promise<SSHResult>;
@@ -30,8 +30,9 @@ export declare function loadProjectContextFiles(options?: LoadContextFilesOption
30
30
  depth?: number;
31
31
  }>>;
32
32
  /**
33
- * Load the effective system prompt customization from SYSTEM.md.
34
- * Project-level SYSTEM.md overrides user-level SYSTEM.md.
33
+ * Load the user system prompt customization from SYSTEM.md.
34
+ * A repository SYSTEM.md is untrusted project text. It must not replace the
35
+ * user file or become the customization block.
35
36
  */
36
37
  export declare function loadSystemPromptFiles(options?: LoadContextFilesOptions): Promise<string | null>;
37
38
  export interface SystemPromptToolMetadata {
@@ -77,6 +78,8 @@ export interface BuildSystemPromptOptions {
77
78
  intentField?: string;
78
79
  /** Whether built-in tool discovery is active; enables the tool-discovery prompt block. */
79
80
  toolDiscoveryActive?: boolean;
81
+ /** Whether the discoverable `reverse_engineer` tool is registered; enables its routing hint. */
82
+ reverseEngineerAvailable?: boolean;
80
83
  /** Encourage the agent to delegate via tasks unless changes are trivial. */
81
84
  eagerTasks?: boolean;
82
85
  /** Rules with alwaysApply=true — their full content is injected into the prompt. */
@@ -11,10 +11,12 @@ import { Settings } from "../config/settings";
11
11
  import { type Skill } from "../extensibility/skills";
12
12
  import type { HindsightSessionState } from "../hindsight/state";
13
13
  import type { LocalProtocolOptions } from "../internal-urls";
14
+ import type { PlanModeState } from "../plan-mode/state";
14
15
  import { AgentRegistry } from "../registry/agent-registry";
15
16
  import type { ForkContextSeed } from "../session/agent-session";
16
17
  import type { ArtifactManager } from "../session/artifacts";
17
18
  import type { AuthStorage } from "../session/auth-storage";
19
+ import type { ClientBridge } from "../session/client-bridge";
18
20
  import type { DetectedLanguage } from "../session/response-language";
19
21
  import { SessionManager } from "../session/session-manager";
20
22
  import type { ContextFileEntry } from "../tools";
@@ -80,6 +82,21 @@ export interface ExecutorOptions {
80
82
  * subagents, and a main-model fast-mode auto-disable does not clobber it.
81
83
  */
82
84
  inheritedServiceTier?: ServiceTier;
85
+ /**
86
+ * Parent ACP/SDK approval mode. `deny` and `prompt` replace the child
87
+ * default (`allow`) before the first prompt. `allow` is that default.
88
+ */
89
+ sdkPermissionMode?: "prompt" | "allow" | "deny";
90
+ /**
91
+ * Parent plan-mode state. Copied onto the child before the first prompt so
92
+ * `enforcePlanModeWrite` still refuses product-file writes.
93
+ */
94
+ planModeState?: PlanModeState;
95
+ /**
96
+ * Parent client bridge. Only `requestPermission` is copied onto the child.
97
+ * Terminal, filesystem, and deferAgentInitiatedTurns stay on the parent.
98
+ */
99
+ clientBridge?: ClientBridge;
83
100
  /** Override local:// protocol options so subagent shares parent's local:// root */
84
101
  localProtocolOptions?: LocalProtocolOptions;
85
102
  /**
@@ -140,8 +157,5 @@ export declare const SUBAGENT_WARNING_MISSING_YIELD = "SYSTEM WARNING: Subagent
140
157
  export declare const SUBAGENT_WARNING_PLACEHOLDER_YIELD = "SYSTEM WARNING: Subagent yield data contains a placeholder instead of the actual result.";
141
158
  export declare function finalizeSubprocessOutput(args: FinalizeSubprocessOutputArgs): FinalizeSubprocessOutputResult;
142
159
  export declare function createSubagentSettings(baseSettings: Settings, inheritedServiceTier?: ServiceTier): Settings;
143
- /**
144
- * Run a single agent in-process.
145
- */
146
160
  export declare function runSubprocess(options: ExecutorOptions): Promise<SingleResult>;
147
161
  export {};
@@ -0,0 +1,26 @@
1
+ import * as path from "node:path";
2
+ type PathApi = Pick<typeof path, "dirname" | "isAbsolute" | "relative" | "resolve" | "sep">;
3
+ /**
4
+ * Parent directory of `mergedDir`, but only when it is a single entry inside
5
+ * `worktreeRoot`. Root, empty, nested, and escaped paths are refused so
6
+ * cleanup cannot delete the worktree root or another session's tree by
7
+ * walking up.
8
+ */
9
+ export declare function resolveIsolationRemovalTarget(mergedDir: string, worktreeRoot: string, pathApi?: PathApi): string;
10
+ /**
11
+ * Create an exclusive directory next to `canonicalBaseDir`. Never removes
12
+ * `canonicalBaseDir` or any path that already exists.
13
+ */
14
+ export declare function allocateDisjointIsolationDir(canonicalBaseDir: string, tokenFactory?: () => string): Promise<string>;
15
+ /**
16
+ * Confirm native teardown may see `mergedDir`.
17
+ *
18
+ * `isoStop` deletes that path. The parent entry and `merged` itself must
19
+ * already be real directories, because native removal follows symlinks.
20
+ * A missing parent means there is nothing to stop. This does not close a
21
+ * replacement that happens after the lstat returns.
22
+ */
23
+ export declare function assertIsolationTeardownTarget(mergedDir: string, worktreeRoot: string): Promise<"stop" | "skip">;
24
+ /** Remove the isolation directory that owns `mergedDir`. Missing directories are ignored. */
25
+ export declare function removeIsolationDirectory(mergedDir: string, worktreeRoot: string): Promise<void>;
26
+ export {};
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Keep a subagent role body inside the host [ROLE] block.
3
+ *
4
+ * The body is the agent instruction. It is inserted between host [ROLE] and
5
+ * [/ROLE]. A literal framing tag would end that block early. Only the four
6
+ * host framing names are rewritten; other brackets stay literal.
7
+ *
8
+ * One left-to-right scan: a gap run, a slash only when it is present, then
9
+ * one more gap run, then the word. A non-matching "[" does not hide a later tag.
10
+ */
11
+ export declare function containSubagentRoleBody(body: string): string;
@@ -0,0 +1 @@
1
+ export {};