@kenkaiiii/ggcoder 6.4.0 → 7.1.0

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 (1120) hide show
  1. package/README.md +9 -8
  2. package/dist/app-sidecar/app-settings.d.ts +1 -1
  3. package/dist/app-sidecar/app-settings.js +3 -4
  4. package/dist/app-sidecar/app-settings.js.map +1 -1
  5. package/dist/app-sidecar/attachments.js +1 -1
  6. package/dist/app-sidecar/attachments.js.map +1 -1
  7. package/dist/app-sidecar/auth-routes.js +2 -5
  8. package/dist/app-sidecar/auth-routes.js.map +1 -1
  9. package/dist/app-sidecar/autopilot-runner.d.ts +8 -8
  10. package/dist/app-sidecar/autopilot-runner.js +8 -8
  11. package/dist/app-sidecar/autopilot-runner.js.map +1 -1
  12. package/dist/app-sidecar/branch-routes.d.ts +10 -1
  13. package/dist/app-sidecar/branch-routes.js +170 -2
  14. package/dist/app-sidecar/branch-routes.js.map +1 -1
  15. package/dist/app-sidecar/detached-sessions.d.ts +2 -10
  16. package/dist/app-sidecar/detached-sessions.js.map +1 -1
  17. package/dist/app-sidecar/file-search.js +1 -1
  18. package/dist/app-sidecar/file-search.js.map +1 -1
  19. package/dist/app-sidecar/git-branches.d.ts +18 -1
  20. package/dist/app-sidecar/git-branches.js +24 -6
  21. package/dist/app-sidecar/git-branches.js.map +1 -1
  22. package/dist/app-sidecar/git-ship.d.ts +42 -0
  23. package/dist/app-sidecar/git-ship.js +349 -0
  24. package/dist/app-sidecar/git-ship.js.map +1 -0
  25. package/dist/app-sidecar/git-target.d.ts +2 -2
  26. package/dist/app-sidecar/git-target.js +2 -2
  27. package/dist/app-sidecar/git-target.js.map +1 -1
  28. package/dist/app-sidecar/goal-routes.d.ts +1 -1
  29. package/dist/app-sidecar/goal-routes.js +5 -6
  30. package/dist/app-sidecar/goal-routes.js.map +1 -1
  31. package/dist/app-sidecar/hf-pull-manager.d.ts +5 -4
  32. package/dist/app-sidecar/hf-pull-manager.js +1 -1
  33. package/dist/app-sidecar/hf-pull-manager.js.map +1 -1
  34. package/dist/app-sidecar/history-routes.js +19 -6
  35. package/dist/app-sidecar/history-routes.js.map +1 -1
  36. package/dist/app-sidecar/history.d.ts +7 -2
  37. package/dist/app-sidecar/history.js.map +1 -1
  38. package/dist/app-sidecar/integration-routes.js +4 -6
  39. package/dist/app-sidecar/integration-routes.js.map +1 -1
  40. package/dist/app-sidecar/keep-awake.d.ts +1 -1
  41. package/dist/app-sidecar/keep-awake.js +1 -1
  42. package/dist/app-sidecar/keep-awake.js.map +1 -1
  43. package/dist/app-sidecar/ken-context.d.ts +2 -2
  44. package/dist/app-sidecar/ken-context.js +1 -1
  45. package/dist/app-sidecar/ken-context.js.map +1 -1
  46. package/dist/app-sidecar/live-preview/dev-url.d.ts +1 -1
  47. package/dist/app-sidecar/live-preview/manager.d.ts +2 -14
  48. package/dist/app-sidecar/live-preview/manager.js.map +1 -1
  49. package/dist/app-sidecar/live-preview/routes.js +1 -1
  50. package/dist/app-sidecar/live-preview/routes.js.map +1 -1
  51. package/dist/app-sidecar/live-preview/servers.js +1 -1
  52. package/dist/app-sidecar/live-preview/servers.js.map +1 -1
  53. package/dist/app-sidecar/mcp-routes.js +2 -2
  54. package/dist/app-sidecar/mcp-routes.js.map +1 -1
  55. package/dist/app-sidecar/mcp-rows.d.ts +3 -15
  56. package/dist/app-sidecar/mcp-rows.js +7 -2
  57. package/dist/app-sidecar/mcp-rows.js.map +1 -1
  58. package/dist/app-sidecar/mcp-shell-command.d.ts +1 -1
  59. package/dist/app-sidecar/mcp-shell-command.js +3 -3
  60. package/dist/app-sidecar/mcp-shell-command.js.map +1 -1
  61. package/dist/app-sidecar/mcp-sync.d.ts +2 -2
  62. package/dist/app-sidecar/mcp-sync.js +3 -3
  63. package/dist/app-sidecar/mcp-sync.js.map +1 -1
  64. package/dist/app-sidecar/pr-card.d.ts +33 -0
  65. package/dist/app-sidecar/pr-card.js +95 -0
  66. package/dist/app-sidecar/pr-card.js.map +1 -0
  67. package/dist/app-sidecar/progress-manager.d.ts +1 -1
  68. package/dist/app-sidecar/progress-manager.js +6 -6
  69. package/dist/app-sidecar/progress-manager.js.map +1 -1
  70. package/dist/app-sidecar/prompt-routes.js +12 -5
  71. package/dist/app-sidecar/prompt-routes.js.map +1 -1
  72. package/dist/app-sidecar/repo-polls.d.ts +3 -3
  73. package/dist/app-sidecar/repo-polls.js +4 -4
  74. package/dist/app-sidecar/repo-polls.js.map +1 -1
  75. package/dist/app-sidecar/route-context.d.ts +20 -17
  76. package/dist/app-sidecar/run-control-routes.js +2 -5
  77. package/dist/app-sidecar/run-control-routes.js.map +1 -1
  78. package/dist/app-sidecar/session-file-routes.d.ts +1 -1
  79. package/dist/app-sidecar/session-file-routes.js +2 -2
  80. package/dist/app-sidecar/session-file-routes.js.map +1 -1
  81. package/dist/app-sidecar/session-routes.js +3 -4
  82. package/dist/app-sidecar/session-routes.js.map +1 -1
  83. package/dist/app-sidecar/session-types.d.ts +5 -13
  84. package/dist/app-sidecar/shell-routes.js +1 -1
  85. package/dist/app-sidecar/shell-routes.js.map +1 -1
  86. package/dist/app-sidecar/shell-runs.js +2 -2
  87. package/dist/app-sidecar/shell-runs.js.map +1 -1
  88. package/dist/app-sidecar/shell-suggestions.d.ts +2 -8
  89. package/dist/app-sidecar/shell-suggestions.js +1 -1
  90. package/dist/app-sidecar/shell-suggestions.js.map +1 -1
  91. package/dist/app-sidecar/task-routes.js +5 -5
  92. package/dist/app-sidecar/task-routes.js.map +1 -1
  93. package/dist/app-sidecar/trophy-manager.d.ts +2 -2
  94. package/dist/app-sidecar/trophy-manager.js +3 -3
  95. package/dist/app-sidecar/trophy-manager.js.map +1 -1
  96. package/dist/app-sidecar/usage.d.ts +1 -1
  97. package/dist/app-sidecar/usage.js +3 -2
  98. package/dist/app-sidecar/usage.js.map +1 -1
  99. package/dist/app-sidecar/workspace-routes.js +4 -4
  100. package/dist/app-sidecar/workspace-routes.js.map +1 -1
  101. package/dist/app-sidecar/worktrees.js +1 -1
  102. package/dist/app-sidecar/worktrees.js.map +1 -1
  103. package/dist/app-sidecar-sessions.d.ts +2 -5
  104. package/dist/app-sidecar-sessions.js +1 -1
  105. package/dist/app-sidecar-sessions.js.map +1 -1
  106. package/dist/app-sidecar.d.ts +1 -1
  107. package/dist/app-sidecar.js +86 -47
  108. package/dist/app-sidecar.js.map +1 -1
  109. package/dist/chat-agents/general.d.ts +1 -1
  110. package/dist/chat-agents/index.d.ts +1 -1
  111. package/dist/chat-agents/jiwa.d.ts +2 -9
  112. package/dist/chat-agents/jiwa.js +1 -0
  113. package/dist/chat-agents/jiwa.js.map +1 -1
  114. package/dist/chat-agents/memory.d.ts +2 -9
  115. package/dist/chat-agents/memory.js +1 -0
  116. package/dist/chat-agents/memory.js.map +1 -1
  117. package/dist/chat-agents/research.d.ts +1 -1
  118. package/dist/chat-agents/shared.d.ts +1 -1
  119. package/dist/chat-agents/shared.js +1 -1
  120. package/dist/chat-agents/shared.js.map +1 -1
  121. package/dist/chat-agents/therapist.d.ts +1 -1
  122. package/dist/chat-agents/types.d.ts +2 -1
  123. package/dist/chat-agents/types.js +6 -1
  124. package/dist/chat-agents/types.js.map +1 -1
  125. package/dist/cli/auth.js +3 -6
  126. package/dist/cli/auth.js.map +1 -1
  127. package/dist/cli/mcp.js +4 -3
  128. package/dist/cli/mcp.js.map +1 -1
  129. package/dist/cli.d.ts +1 -0
  130. package/dist/cli.js +26 -27
  131. package/dist/cli.js.map +1 -1
  132. package/dist/goals-agent/goal-team.d.ts +1 -1
  133. package/dist/goals-agent/goals-agent.d.ts +3 -3
  134. package/dist/goals-agent/goals-agent.js +5 -5
  135. package/dist/goals-agent/goals-agent.js.map +1 -1
  136. package/dist/hf-pull.d.ts +2 -1
  137. package/dist/hf-pull.js +0 -1
  138. package/dist/hf-pull.js.map +1 -1
  139. package/dist/index.d.ts +0 -8
  140. package/dist/index.js +1 -14
  141. package/dist/index.js.map +1 -1
  142. package/dist/modes/acp-autopilot.js +3 -3
  143. package/dist/modes/acp-autopilot.js.map +1 -1
  144. package/dist/modes/acp-goals.d.ts +2 -2
  145. package/dist/modes/acp-goals.js +3 -3
  146. package/dist/modes/acp-goals.js.map +1 -1
  147. package/dist/modes/acp-mode.d.ts +6 -6
  148. package/dist/modes/acp-mode.js +22 -23
  149. package/dist/modes/acp-mode.js.map +1 -1
  150. package/dist/modes/agent-home-mode.js +7 -8
  151. package/dist/modes/agent-home-mode.js.map +1 -1
  152. package/dist/modes/json-mode.js +4 -4
  153. package/dist/modes/json-mode.js.map +1 -1
  154. package/dist/modes/print-mode.js +4 -3
  155. package/dist/modes/print-mode.js.map +1 -1
  156. package/dist/modes/rpc-mode.js +2 -2
  157. package/dist/modes/rpc-mode.js.map +1 -1
  158. package/dist/modes/serve-mode.js +10 -11
  159. package/dist/modes/serve-mode.js.map +1 -1
  160. package/dist/modes/subagent-worker-mode.d.ts +1 -1
  161. package/dist/modes/subagent-worker-mode.js +8 -8
  162. package/dist/modes/subagent-worker-mode.js.map +1 -1
  163. package/dist/motion-agent/motion-agent.d.ts +3 -2
  164. package/dist/motion-agent/motion-agent.js +3 -2
  165. package/dist/motion-agent/motion-agent.js.map +1 -1
  166. package/dist/motion-agent/motion-bundle.d.ts +18 -0
  167. package/dist/motion-agent/motion-bundle.js +34 -0
  168. package/dist/motion-agent/motion-bundle.js.map +1 -0
  169. package/dist/subagent-entry-path.d.ts +1 -0
  170. package/dist/subagent-entry-path.js +13 -0
  171. package/dist/subagent-entry-path.js.map +1 -0
  172. package/dist/subagent-entry.d.ts +1 -1
  173. package/dist/subagent-entry.js +2 -1
  174. package/dist/subagent-entry.js.map +1 -1
  175. package/dist/ui/App.d.ts +8 -8
  176. package/dist/ui/App.js +20 -21
  177. package/dist/ui/App.js.map +1 -1
  178. package/dist/ui/app-items.d.ts +1 -1
  179. package/dist/ui/components/BackgroundTasksBar.d.ts +1 -1
  180. package/dist/ui/components/Banner.js +1 -1
  181. package/dist/ui/components/Banner.js.map +1 -1
  182. package/dist/ui/components/ChatFooterPane.d.ts +1 -1
  183. package/dist/ui/components/ChatScreen.d.ts +4 -4
  184. package/dist/ui/components/Footer.d.ts +1 -1
  185. package/dist/ui/components/Footer.js +1 -1
  186. package/dist/ui/components/Footer.js.map +1 -1
  187. package/dist/ui/components/FooterStatusRow.d.ts +1 -1
  188. package/dist/ui/components/InputArea.d.ts +2 -2
  189. package/dist/ui/components/InputArea.js +2 -2
  190. package/dist/ui/components/InputArea.js.map +1 -1
  191. package/dist/ui/components/ModelSelector.js +1 -1
  192. package/dist/ui/components/ModelSelector.js.map +1 -1
  193. package/dist/ui/components/RewindOverlay.d.ts +1 -1
  194. package/dist/ui/components/RewindOverlay.js.map +1 -1
  195. package/dist/ui/components/SessionSelector.d.ts +1 -1
  196. package/dist/ui/components/SettingsSelector.d.ts +1 -1
  197. package/dist/ui/components/SkillsOverlay.js +2 -2
  198. package/dist/ui/components/SkillsOverlay.js.map +1 -1
  199. package/dist/ui/components/StreamingArea.js +1 -1
  200. package/dist/ui/components/StreamingArea.js.map +1 -1
  201. package/dist/ui/components/TaskPickerMenu.d.ts +1 -1
  202. package/dist/ui/components/ToolExecution.js +1 -1
  203. package/dist/ui/components/ToolExecution.js.map +1 -1
  204. package/dist/ui/error-item.js +2 -2
  205. package/dist/ui/error-item.js.map +1 -1
  206. package/dist/ui/hooks/useAgentLoop.d.ts +2 -2
  207. package/dist/ui/hooks/useAgentLoop.js +8 -8
  208. package/dist/ui/hooks/useAgentLoop.js.map +1 -1
  209. package/dist/ui/hooks/useChatLayoutMeasurements.d.ts +1 -1
  210. package/dist/ui/hooks/useContextCompaction.d.ts +3 -3
  211. package/dist/ui/hooks/useContextCompaction.js +6 -7
  212. package/dist/ui/hooks/useContextCompaction.js.map +1 -1
  213. package/dist/ui/hooks/useModeState.d.ts +2 -2
  214. package/dist/ui/hooks/useModeState.js +2 -2
  215. package/dist/ui/hooks/useModeState.js.map +1 -1
  216. package/dist/ui/hooks/useSessionPersistence.d.ts +1 -1
  217. package/dist/ui/hooks/useSessionPersistence.js +3 -3
  218. package/dist/ui/hooks/useSessionPersistence.js.map +1 -1
  219. package/dist/ui/hooks/useTaskPickerController.d.ts +1 -1
  220. package/dist/ui/hooks/useTaskPickerController.js +1 -1
  221. package/dist/ui/hooks/useTaskPickerController.js.map +1 -1
  222. package/dist/ui/hooks/useTranscriptHistory.d.ts +1 -1
  223. package/dist/ui/item-helpers.js +1 -1
  224. package/dist/ui/item-helpers.js.map +1 -1
  225. package/dist/ui/language-pack-update.d.ts +1 -1
  226. package/dist/ui/language-pack-update.js +1 -1
  227. package/dist/ui/language-pack-update.js.map +1 -1
  228. package/dist/ui/login.js +1 -1
  229. package/dist/ui/login.js.map +1 -1
  230. package/dist/ui/mcp.d.ts +1 -1
  231. package/dist/ui/prompt-routing.d.ts +3 -3
  232. package/dist/ui/prompt-routing.js +3 -3
  233. package/dist/ui/prompt-routing.js.map +1 -1
  234. package/dist/ui/render.d.ts +8 -8
  235. package/dist/ui/sessions.js +1 -1
  236. package/dist/ui/sessions.js.map +1 -1
  237. package/dist/ui/stores/taskbar-store.d.ts +1 -1
  238. package/dist/ui/stores/taskbar-store.js.map +1 -1
  239. package/dist/ui/submit-prompt-command.d.ts +2 -2
  240. package/dist/ui/submit-prompt-command.js +2 -3
  241. package/dist/ui/submit-prompt-command.js.map +1 -1
  242. package/dist/ui/terminal-history-status-renderers.d.ts +1 -1
  243. package/dist/ui/terminal-history.js +2 -3
  244. package/dist/ui/terminal-history.js.map +1 -1
  245. package/dist/ui/theme/theme.d.ts +2 -1
  246. package/dist/ui/theme/theme.js.map +1 -1
  247. package/dist/ui/thinking-level.d.ts +1 -1
  248. package/dist/ui/thinking-level.js +1 -1
  249. package/dist/ui/thinking-level.js.map +1 -1
  250. package/dist/ui/tool-line-summary.js +1 -1
  251. package/dist/ui/tool-line-summary.js.map +1 -1
  252. package/dist/ui/transcript/presentation.js +1 -1
  253. package/dist/ui/transcript/presentation.js.map +1 -1
  254. package/dist/ui/utils/text-utils.js +1 -1
  255. package/dist/ui/utils/text-utils.js.map +1 -1
  256. package/dist/utils/git-overview.d.ts +2 -23
  257. package/dist/utils/git-overview.js +8 -1
  258. package/dist/utils/git-overview.js.map +1 -1
  259. package/package.json +13 -103
  260. package/assets/skills/bulletproof/SKILL.md +0 -132
  261. package/assets/skills/bulletproof/references/agent-surface.md +0 -113
  262. package/assets/skills/bulletproof/references/attack-classes.md +0 -226
  263. package/assets/skills/bulletproof/references/audit-protocol.md +0 -232
  264. package/assets/skills/bulletproof/references/platform-playbooks.md +0 -196
  265. package/assets/skills/bulletproof/references/provenance.md +0 -146
  266. package/assets/skills/bulletproof/references/secure-defaults.md +0 -137
  267. package/assets/skills/bulletproof/references/supply-chain.md +0 -84
  268. package/assets/skills/bulletproof/references/threat-landscape.md +0 -66
  269. package/assets/skills/bulletproof/references/verification.md +0 -74
  270. package/assets/skills/compliance-guard/SKILL.md +0 -115
  271. package/assets/skills/compliance-guard/references/artifacts.md +0 -199
  272. package/assets/skills/compliance-guard/references/eu-uk.md +0 -162
  273. package/assets/skills/compliance-guard/references/exposure-triage.md +0 -177
  274. package/assets/skills/compliance-guard/references/full-review.md +0 -155
  275. package/assets/skills/compliance-guard/references/lawsuit-vectors.md +0 -153
  276. package/assets/skills/compliance-guard/references/provenance.md +0 -135
  277. package/assets/skills/compliance-guard/references/sector-gates.md +0 -187
  278. package/assets/skills/compliance-guard/references/security-baseline.md +0 -117
  279. package/assets/skills/compliance-guard/references/trigger-map.md +0 -177
  280. package/assets/skills/compliance-guard/references/us.md +0 -194
  281. package/assets/skills/durable/SKILL.md +0 -114
  282. package/assets/skills/durable/references/agent-db-safety.md +0 -76
  283. package/assets/skills/durable/references/backups-and-runtime.md +0 -93
  284. package/assets/skills/durable/references/migrations-and-schema.md +0 -87
  285. package/assets/skills/gg-guide/SKILL.md +0 -43
  286. package/assets/skills/gg-guide/references/chat-motion-goals.md +0 -217
  287. package/assets/skills/gg-guide/references/checklist-and-safety.md +0 -177
  288. package/assets/skills/gg-guide/references/code-mode.md +0 -268
  289. package/assets/skills/gg-guide/references/getting-started.md +0 -290
  290. package/assets/skills/gg-guide/references/ken-and-autopilot.md +0 -172
  291. package/assets/skills/gg-guide/references/mcp-and-skills.md +0 -204
  292. package/assets/skills/gg-guide/references/models-and-sign-in.md +0 -200
  293. package/assets/skills/gg-guide/references/sessions-and-history.md +0 -213
  294. package/assets/skills/gg-guide/references/settings.md +0 -193
  295. package/assets/skills/gg-guide/references/troubleshooting-and-data.md +0 -186
  296. package/assets/skills/lean/SKILL.md +0 -117
  297. package/assets/skills/lean/references/memory-and-processes.md +0 -99
  298. package/assets/skills/lean/references/playbooks.md +0 -134
  299. package/dist/app-error.d.ts +0 -22
  300. package/dist/app-error.js +0 -41
  301. package/dist/app-error.js.map +0 -1
  302. package/dist/config.d.ts +0 -90
  303. package/dist/config.js +0 -240
  304. package/dist/config.js.map +0 -1
  305. package/dist/core/acceptance-checks.d.ts +0 -48
  306. package/dist/core/acceptance-checks.js +0 -151
  307. package/dist/core/acceptance-checks.js.map +0 -1
  308. package/dist/core/action-threats.d.ts +0 -68
  309. package/dist/core/action-threats.js +0 -894
  310. package/dist/core/action-threats.js.map +0 -1
  311. package/dist/core/agent-notifications.d.ts +0 -79
  312. package/dist/core/agent-notifications.js +0 -125
  313. package/dist/core/agent-notifications.js.map +0 -1
  314. package/dist/core/agent-session/helpers.d.ts +0 -26
  315. package/dist/core/agent-session/helpers.js +0 -47
  316. package/dist/core/agent-session/helpers.js.map +0 -1
  317. package/dist/core/agent-session/mcp-tools.d.ts +0 -87
  318. package/dist/core/agent-session/mcp-tools.js +0 -227
  319. package/dist/core/agent-session/mcp-tools.js.map +0 -1
  320. package/dist/core/agent-session/run-loop-monitor.d.ts +0 -63
  321. package/dist/core/agent-session/run-loop-monitor.js +0 -164
  322. package/dist/core/agent-session/run-loop-monitor.js.map +0 -1
  323. package/dist/core/agent-session/transcript-markers.d.ts +0 -57
  324. package/dist/core/agent-session/transcript-markers.js +0 -166
  325. package/dist/core/agent-session/transcript-markers.js.map +0 -1
  326. package/dist/core/agent-session/verification-tracker.d.ts +0 -71
  327. package/dist/core/agent-session/verification-tracker.js +0 -295
  328. package/dist/core/agent-session/verification-tracker.js.map +0 -1
  329. package/dist/core/agent-session.d.ts +0 -1398
  330. package/dist/core/agent-session.js +0 -5123
  331. package/dist/core/agent-session.js.map +0 -1
  332. package/dist/core/agents.d.ts +0 -63
  333. package/dist/core/agents.js +0 -160
  334. package/dist/core/agents.js.map +0 -1
  335. package/dist/core/ask-user.d.ts +0 -163
  336. package/dist/core/ask-user.js +0 -178
  337. package/dist/core/ask-user.js.map +0 -1
  338. package/dist/core/auth/index.d.ts +0 -11
  339. package/dist/core/auth/index.js +0 -11
  340. package/dist/core/auth/index.js.map +0 -1
  341. package/dist/core/auth-providers.d.ts +0 -2
  342. package/dist/core/auth-providers.js +0 -5
  343. package/dist/core/auth-providers.js.map +0 -1
  344. package/dist/core/auth-storage.d.ts +0 -1
  345. package/dist/core/auth-storage.js +0 -4
  346. package/dist/core/auth-storage.js.map +0 -1
  347. package/dist/core/auto-update.d.ts +0 -6
  348. package/dist/core/auto-update.js +0 -15
  349. package/dist/core/auto-update.js.map +0 -1
  350. package/dist/core/autopilot-cycle.d.ts +0 -127
  351. package/dist/core/autopilot-cycle.js +0 -182
  352. package/dist/core/autopilot-cycle.js.map +0 -1
  353. package/dist/core/autopilot-gate.d.ts +0 -106
  354. package/dist/core/autopilot-gate.js +0 -192
  355. package/dist/core/autopilot-gate.js.map +0 -1
  356. package/dist/core/autopilot-verdict.d.ts +0 -55
  357. package/dist/core/autopilot-verdict.js +0 -226
  358. package/dist/core/autopilot-verdict.js.map +0 -1
  359. package/dist/core/blocked-packages-file.d.ts +0 -33
  360. package/dist/core/blocked-packages-file.js +0 -274
  361. package/dist/core/blocked-packages-file.js.map +0 -1
  362. package/dist/core/bundled-agents.d.ts +0 -2
  363. package/dist/core/bundled-agents.js +0 -253
  364. package/dist/core/bundled-agents.js.map +0 -1
  365. package/dist/core/cache-diagnostics.d.ts +0 -72
  366. package/dist/core/cache-diagnostics.js +0 -200
  367. package/dist/core/cache-diagnostics.js.map +0 -1
  368. package/dist/core/cache-expiry.d.ts +0 -89
  369. package/dist/core/cache-expiry.js +0 -117
  370. package/dist/core/cache-expiry.js.map +0 -1
  371. package/dist/core/checklist-detection.d.ts +0 -11
  372. package/dist/core/checklist-detection.js +0 -238
  373. package/dist/core/checklist-detection.js.map +0 -1
  374. package/dist/core/checklist-git.d.ts +0 -19
  375. package/dist/core/checklist-git.js +0 -54
  376. package/dist/core/checklist-git.js.map +0 -1
  377. package/dist/core/checklist-items.d.ts +0 -181
  378. package/dist/core/checklist-items.js +0 -230
  379. package/dist/core/checklist-items.js.map +0 -1
  380. package/dist/core/checklist-prompt.d.ts +0 -14
  381. package/dist/core/checklist-prompt.js +0 -64
  382. package/dist/core/checklist-prompt.js.map +0 -1
  383. package/dist/core/checklist-snapshot.d.ts +0 -17
  384. package/dist/core/checklist-snapshot.js +0 -46
  385. package/dist/core/checklist-snapshot.js.map +0 -1
  386. package/dist/core/checklist-store.d.ts +0 -63
  387. package/dist/core/checklist-store.js +0 -273
  388. package/dist/core/checklist-store.js.map +0 -1
  389. package/dist/core/checkout-record.d.ts +0 -22
  390. package/dist/core/checkout-record.js +0 -68
  391. package/dist/core/checkout-record.js.map +0 -1
  392. package/dist/core/checkpoint-store.d.ts +0 -109
  393. package/dist/core/checkpoint-store.js +0 -260
  394. package/dist/core/checkpoint-store.js.map +0 -1
  395. package/dist/core/claude-code/complete.d.ts +0 -35
  396. package/dist/core/claude-code/complete.js +0 -125
  397. package/dist/core/claude-code/complete.js.map +0 -1
  398. package/dist/core/claude-code/events.d.ts +0 -67
  399. package/dist/core/claude-code/events.js +0 -460
  400. package/dist/core/claude-code/events.js.map +0 -1
  401. package/dist/core/claude-code/live-session.d.ts +0 -94
  402. package/dist/core/claude-code/live-session.js +0 -525
  403. package/dist/core/claude-code/live-session.js.map +0 -1
  404. package/dist/core/claude-code/loop.d.ts +0 -9
  405. package/dist/core/claude-code/loop.js +0 -15
  406. package/dist/core/claude-code/loop.js.map +0 -1
  407. package/dist/core/claude-code/session-sync.d.ts +0 -28
  408. package/dist/core/claude-code/session-sync.js +0 -53
  409. package/dist/core/claude-code/session-sync.js.map +0 -1
  410. package/dist/core/claude-code/tool-bridge.d.ts +0 -49
  411. package/dist/core/claude-code/tool-bridge.js +0 -352
  412. package/dist/core/claude-code/tool-bridge.js.map +0 -1
  413. package/dist/core/claude-code/transcripts.d.ts +0 -39
  414. package/dist/core/claude-code/transcripts.js +0 -195
  415. package/dist/core/claude-code/transcripts.js.map +0 -1
  416. package/dist/core/code-retrieval-chunkers.d.ts +0 -26
  417. package/dist/core/code-retrieval-chunkers.js +0 -264
  418. package/dist/core/code-retrieval-chunkers.js.map +0 -1
  419. package/dist/core/code-retrieval.d.ts +0 -18
  420. package/dist/core/code-retrieval.js +0 -124
  421. package/dist/core/code-retrieval.js.map +0 -1
  422. package/dist/core/codex-request-shape.d.ts +0 -7
  423. package/dist/core/codex-request-shape.js +0 -19
  424. package/dist/core/codex-request-shape.js.map +0 -1
  425. package/dist/core/compaction/active-context.d.ts +0 -16
  426. package/dist/core/compaction/active-context.js +0 -20
  427. package/dist/core/compaction/active-context.js.map +0 -1
  428. package/dist/core/compaction/compactor.d.ts +0 -281
  429. package/dist/core/compaction/compactor.js +0 -1452
  430. package/dist/core/compaction/compactor.js.map +0 -1
  431. package/dist/core/compaction/plan-step-policy.d.ts +0 -46
  432. package/dist/core/compaction/plan-step-policy.js +0 -57
  433. package/dist/core/compaction/plan-step-policy.js.map +0 -1
  434. package/dist/core/compaction/policy.d.ts +0 -36
  435. package/dist/core/compaction/policy.js +0 -144
  436. package/dist/core/compaction/policy.js.map +0 -1
  437. package/dist/core/compaction/query-aware-selector.d.ts +0 -32
  438. package/dist/core/compaction/query-aware-selector.js +0 -202
  439. package/dist/core/compaction/query-aware-selector.js.map +0 -1
  440. package/dist/core/compaction/token-estimator.d.ts +0 -36
  441. package/dist/core/compaction/token-estimator.js +0 -180
  442. package/dist/core/compaction/token-estimator.js.map +0 -1
  443. package/dist/core/compaction/tool-result-pruner.d.ts +0 -90
  444. package/dist/core/compaction/tool-result-pruner.js +0 -238
  445. package/dist/core/compaction/tool-result-pruner.js.map +0 -1
  446. package/dist/core/completion-review.d.ts +0 -24
  447. package/dist/core/completion-review.js +0 -2
  448. package/dist/core/completion-review.js.map +0 -1
  449. package/dist/core/context-files.d.ts +0 -8
  450. package/dist/core/context-files.js +0 -46
  451. package/dist/core/context-files.js.map +0 -1
  452. package/dist/core/context-limits.d.ts +0 -40
  453. package/dist/core/context-limits.js +0 -43
  454. package/dist/core/context-limits.js.map +0 -1
  455. package/dist/core/custom-commands.d.ts +0 -18
  456. package/dist/core/custom-commands.js +0 -57
  457. package/dist/core/custom-commands.js.map +0 -1
  458. package/dist/core/destructive-git-guard.d.ts +0 -113
  459. package/dist/core/destructive-git-guard.js +0 -874
  460. package/dist/core/destructive-git-guard.js.map +0 -1
  461. package/dist/core/encode-cwd.d.ts +0 -41
  462. package/dist/core/encode-cwd.js +0 -53
  463. package/dist/core/encode-cwd.js.map +0 -1
  464. package/dist/core/env-delta.d.ts +0 -34
  465. package/dist/core/env-delta.js +0 -84
  466. package/dist/core/env-delta.js.map +0 -1
  467. package/dist/core/event-bus.d.ts +0 -178
  468. package/dist/core/event-bus.js +0 -171
  469. package/dist/core/event-bus.js.map +0 -1
  470. package/dist/core/extensions/loader.d.ts +0 -7
  471. package/dist/core/extensions/loader.js +0 -68
  472. package/dist/core/extensions/loader.js.map +0 -1
  473. package/dist/core/extensions/plugin-bundles.d.ts +0 -13
  474. package/dist/core/extensions/plugin-bundles.js +0 -45
  475. package/dist/core/extensions/plugin-bundles.js.map +0 -1
  476. package/dist/core/extensions/types.d.ts +0 -18
  477. package/dist/core/extensions/types.js +0 -2
  478. package/dist/core/extensions/types.js.map +0 -1
  479. package/dist/core/foreign-session-import.d.ts +0 -119
  480. package/dist/core/foreign-session-import.js +0 -598
  481. package/dist/core/foreign-session-import.js.map +0 -1
  482. package/dist/core/foreign-transcript-blocks.d.ts +0 -50
  483. package/dist/core/foreign-transcript-blocks.js +0 -151
  484. package/dist/core/foreign-transcript-blocks.js.map +0 -1
  485. package/dist/core/frontmatter.d.ts +0 -22
  486. package/dist/core/frontmatter.js +0 -90
  487. package/dist/core/frontmatter.js.map +0 -1
  488. package/dist/core/goal-run-marker.d.ts +0 -32
  489. package/dist/core/goal-run-marker.js +0 -178
  490. package/dist/core/goal-run-marker.js.map +0 -1
  491. package/dist/core/goal-summary.d.ts +0 -32
  492. package/dist/core/goal-summary.js +0 -110
  493. package/dist/core/goal-summary.js.map +0 -1
  494. package/dist/core/goals-store.d.ts +0 -215
  495. package/dist/core/goals-store.js +0 -577
  496. package/dist/core/goals-store.js.map +0 -1
  497. package/dist/core/hashline.d.ts +0 -51
  498. package/dist/core/hashline.js +0 -76
  499. package/dist/core/hashline.js.map +0 -1
  500. package/dist/core/idle-wake.d.ts +0 -62
  501. package/dist/core/idle-wake.js +0 -103
  502. package/dist/core/idle-wake.js.map +0 -1
  503. package/dist/core/index.d.ts +0 -14
  504. package/dist/core/index.js +0 -14
  505. package/dist/core/index.js.map +0 -1
  506. package/dist/core/injection-detect.d.ts +0 -39
  507. package/dist/core/injection-detect.js +0 -241
  508. package/dist/core/injection-detect.js.map +0 -1
  509. package/dist/core/installed-threats.d.ts +0 -23
  510. package/dist/core/installed-threats.js +0 -71
  511. package/dist/core/installed-threats.js.map +0 -1
  512. package/dist/core/internal-diagnostics.d.ts +0 -159
  513. package/dist/core/internal-diagnostics.js +0 -495
  514. package/dist/core/internal-diagnostics.js.map +0 -1
  515. package/dist/core/keep-awake.d.ts +0 -88
  516. package/dist/core/keep-awake.js +0 -251
  517. package/dist/core/keep-awake.js.map +0 -1
  518. package/dist/core/ken-ask-answer.d.ts +0 -24
  519. package/dist/core/ken-ask-answer.js +0 -96
  520. package/dist/core/ken-ask-answer.js.map +0 -1
  521. package/dist/core/ken-context.d.ts +0 -119
  522. package/dist/core/ken-context.js +0 -447
  523. package/dist/core/ken-context.js.map +0 -1
  524. package/dist/core/ken-model.d.ts +0 -45
  525. package/dist/core/ken-model.js +0 -26
  526. package/dist/core/ken-model.js.map +0 -1
  527. package/dist/core/ken-prompt.d.ts +0 -21
  528. package/dist/core/ken-prompt.js +0 -370
  529. package/dist/core/ken-prompt.js.map +0 -1
  530. package/dist/core/language-detector.d.ts +0 -41
  531. package/dist/core/language-detector.js +0 -293
  532. package/dist/core/language-detector.js.map +0 -1
  533. package/dist/core/live-preview.d.ts +0 -26
  534. package/dist/core/live-preview.js +0 -80
  535. package/dist/core/live-preview.js.map +0 -1
  536. package/dist/core/local-endpoint-store.d.ts +0 -53
  537. package/dist/core/local-endpoint-store.js +0 -221
  538. package/dist/core/local-endpoint-store.js.map +0 -1
  539. package/dist/core/logger.d.ts +0 -22
  540. package/dist/core/logger.js +0 -95
  541. package/dist/core/logger.js.map +0 -1
  542. package/dist/core/loop-breaker.d.ts +0 -89
  543. package/dist/core/loop-breaker.js +0 -204
  544. package/dist/core/loop-breaker.js.map +0 -1
  545. package/dist/core/lsp/client.d.ts +0 -206
  546. package/dist/core/lsp/client.js +0 -685
  547. package/dist/core/lsp/client.js.map +0 -1
  548. package/dist/core/lsp/edit-telemetry.d.ts +0 -26
  549. package/dist/core/lsp/edit-telemetry.js +0 -52
  550. package/dist/core/lsp/edit-telemetry.js.map +0 -1
  551. package/dist/core/lsp/format.d.ts +0 -11
  552. package/dist/core/lsp/format.js +0 -30
  553. package/dist/core/lsp/format.js.map +0 -1
  554. package/dist/core/lsp/jsonrpc.d.ts +0 -68
  555. package/dist/core/lsp/jsonrpc.js +0 -153
  556. package/dist/core/lsp/jsonrpc.js.map +0 -1
  557. package/dist/core/lsp/manager.d.ts +0 -188
  558. package/dist/core/lsp/manager.js +0 -576
  559. package/dist/core/lsp/manager.js.map +0 -1
  560. package/dist/core/lsp/pool.d.ts +0 -114
  561. package/dist/core/lsp/pool.js +0 -259
  562. package/dist/core/lsp/pool.js.map +0 -1
  563. package/dist/core/lsp/project-root.d.ts +0 -9
  564. package/dist/core/lsp/project-root.js +0 -75
  565. package/dist/core/lsp/project-root.js.map +0 -1
  566. package/dist/core/lsp/reference-project.d.ts +0 -6
  567. package/dist/core/lsp/reference-project.js +0 -110
  568. package/dist/core/lsp/reference-project.js.map +0 -1
  569. package/dist/core/lsp/servers.d.ts +0 -44
  570. package/dist/core/lsp/servers.js +0 -289
  571. package/dist/core/lsp/servers.js.map +0 -1
  572. package/dist/core/lsp/test-support.d.ts +0 -17
  573. package/dist/core/lsp/test-support.js +0 -27
  574. package/dist/core/lsp/test-support.js.map +0 -1
  575. package/dist/core/mcp/catalog-cache.d.ts +0 -64
  576. package/dist/core/mcp/catalog-cache.js +0 -167
  577. package/dist/core/mcp/catalog-cache.js.map +0 -1
  578. package/dist/core/mcp/client.d.ts +0 -317
  579. package/dist/core/mcp/client.js +0 -1168
  580. package/dist/core/mcp/client.js.map +0 -1
  581. package/dist/core/mcp/content.d.ts +0 -23
  582. package/dist/core/mcp/content.js +0 -194
  583. package/dist/core/mcp/content.js.map +0 -1
  584. package/dist/core/mcp/defaults.d.ts +0 -26
  585. package/dist/core/mcp/defaults.js +0 -81
  586. package/dist/core/mcp/defaults.js.map +0 -1
  587. package/dist/core/mcp/deferred-catalog.d.ts +0 -53
  588. package/dist/core/mcp/deferred-catalog.js +0 -117
  589. package/dist/core/mcp/deferred-catalog.js.map +0 -1
  590. package/dist/core/mcp/elicitation-bridge.d.ts +0 -40
  591. package/dist/core/mcp/elicitation-bridge.js +0 -36
  592. package/dist/core/mcp/elicitation-bridge.js.map +0 -1
  593. package/dist/core/mcp/index.d.ts +0 -16
  594. package/dist/core/mcp/index.js +0 -10
  595. package/dist/core/mcp/index.js.map +0 -1
  596. package/dist/core/mcp/loopback.d.ts +0 -26
  597. package/dist/core/mcp/loopback.js +0 -66
  598. package/dist/core/mcp/loopback.js.map +0 -1
  599. package/dist/core/mcp/oauth-provider.d.ts +0 -55
  600. package/dist/core/mcp/oauth-provider.js +0 -106
  601. package/dist/core/mcp/oauth-provider.js.map +0 -1
  602. package/dist/core/mcp/oauth-store.d.ts +0 -44
  603. package/dist/core/mcp/oauth-store.js +0 -77
  604. package/dist/core/mcp/oauth-store.js.map +0 -1
  605. package/dist/core/mcp/parse-add-command.d.ts +0 -50
  606. package/dist/core/mcp/parse-add-command.js +0 -391
  607. package/dist/core/mcp/parse-add-command.js.map +0 -1
  608. package/dist/core/mcp/resolve-stdio.d.ts +0 -77
  609. package/dist/core/mcp/resolve-stdio.js +0 -359
  610. package/dist/core/mcp/resolve-stdio.js.map +0 -1
  611. package/dist/core/mcp/shared-pool.d.ts +0 -157
  612. package/dist/core/mcp/shared-pool.js +0 -236
  613. package/dist/core/mcp/shared-pool.js.map +0 -1
  614. package/dist/core/mcp/store.d.ts +0 -100
  615. package/dist/core/mcp/store.js +0 -202
  616. package/dist/core/mcp/store.js.map +0 -1
  617. package/dist/core/mcp/tool-guard.d.ts +0 -58
  618. package/dist/core/mcp/tool-guard.js +0 -215
  619. package/dist/core/mcp/tool-guard.js.map +0 -1
  620. package/dist/core/mcp/types.d.ts +0 -57
  621. package/dist/core/mcp/types.js +0 -2
  622. package/dist/core/mcp/types.js.map +0 -1
  623. package/dist/core/message-images.d.ts +0 -11
  624. package/dist/core/message-images.js +0 -52
  625. package/dist/core/message-images.js.map +0 -1
  626. package/dist/core/model-registry.d.ts +0 -1
  627. package/dist/core/model-registry.js +0 -5
  628. package/dist/core/model-registry.js.map +0 -1
  629. package/dist/core/model-unavailable.d.ts +0 -14
  630. package/dist/core/model-unavailable.js +0 -23
  631. package/dist/core/model-unavailable.js.map +0 -1
  632. package/dist/core/network-guard.d.ts +0 -28
  633. package/dist/core/network-guard.js +0 -251
  634. package/dist/core/network-guard.js.map +0 -1
  635. package/dist/core/node-debugger.d.ts +0 -148
  636. package/dist/core/node-debugger.js +0 -642
  637. package/dist/core/node-debugger.js.map +0 -1
  638. package/dist/core/oauth/openai.d.ts +0 -1
  639. package/dist/core/oauth/openai.js +0 -3
  640. package/dist/core/oauth/openai.js.map +0 -1
  641. package/dist/core/oauth/types.d.ts +0 -1
  642. package/dist/core/oauth/types.js +0 -2
  643. package/dist/core/oauth/types.js.map +0 -1
  644. package/dist/core/opencode-catalog-store.d.ts +0 -20
  645. package/dist/core/opencode-catalog-store.js +0 -82
  646. package/dist/core/opencode-catalog-store.js.map +0 -1
  647. package/dist/core/openrouter-catalog-store.d.ts +0 -24
  648. package/dist/core/openrouter-catalog-store.js +0 -140
  649. package/dist/core/openrouter-catalog-store.js.map +0 -1
  650. package/dist/core/package-cooldown.d.ts +0 -69
  651. package/dist/core/package-cooldown.js +0 -297
  652. package/dist/core/package-cooldown.js.map +0 -1
  653. package/dist/core/package-threats.d.ts +0 -92
  654. package/dist/core/package-threats.js +0 -1340
  655. package/dist/core/package-threats.js.map +0 -1
  656. package/dist/core/parked-requests.d.ts +0 -43
  657. package/dist/core/parked-requests.js +0 -34
  658. package/dist/core/parked-requests.js.map +0 -1
  659. package/dist/core/persistent-shell.d.ts +0 -81
  660. package/dist/core/persistent-shell.js +0 -452
  661. package/dist/core/persistent-shell.js.map +0 -1
  662. package/dist/core/plan-delta.d.ts +0 -23
  663. package/dist/core/plan-delta.js +0 -36
  664. package/dist/core/plan-delta.js.map +0 -1
  665. package/dist/core/plan-handoff.d.ts +0 -38
  666. package/dist/core/plan-handoff.js +0 -21
  667. package/dist/core/plan-handoff.js.map +0 -1
  668. package/dist/core/plan-submission-gate.d.ts +0 -28
  669. package/dist/core/plan-submission-gate.js +0 -27
  670. package/dist/core/plan-submission-gate.js.map +0 -1
  671. package/dist/core/platform-clis.d.ts +0 -15
  672. package/dist/core/platform-clis.js +0 -299
  673. package/dist/core/platform-clis.js.map +0 -1
  674. package/dist/core/process-gate.d.ts +0 -61
  675. package/dist/core/process-gate.js +0 -103
  676. package/dist/core/process-gate.js.map +0 -1
  677. package/dist/core/process-manager.d.ts +0 -242
  678. package/dist/core/process-manager.js +0 -902
  679. package/dist/core/process-manager.js.map +0 -1
  680. package/dist/core/progress/engine.d.ts +0 -22
  681. package/dist/core/progress/engine.js +0 -131
  682. package/dist/core/progress/engine.js.map +0 -1
  683. package/dist/core/progress/git-xp.d.ts +0 -15
  684. package/dist/core/progress/git-xp.js +0 -100
  685. package/dist/core/progress/git-xp.js.map +0 -1
  686. package/dist/core/progress/ranks.d.ts +0 -31
  687. package/dist/core/progress/ranks.js +0 -310
  688. package/dist/core/progress/ranks.js.map +0 -1
  689. package/dist/core/progress/rebuild.d.ts +0 -8
  690. package/dist/core/progress/rebuild.js +0 -125
  691. package/dist/core/progress/rebuild.js.map +0 -1
  692. package/dist/core/progress/store.d.ts +0 -34
  693. package/dist/core/progress/store.js +0 -200
  694. package/dist/core/progress/store.js.map +0 -1
  695. package/dist/core/progress/types.d.ts +0 -108
  696. package/dist/core/progress/types.js +0 -3
  697. package/dist/core/progress/types.js.map +0 -1
  698. package/dist/core/project-discovery.d.ts +0 -88
  699. package/dist/core/project-discovery.js +0 -907
  700. package/dist/core/project-discovery.js.map +0 -1
  701. package/dist/core/project-files.d.ts +0 -15
  702. package/dist/core/project-files.js +0 -37
  703. package/dist/core/project-files.js.map +0 -1
  704. package/dist/core/project-health-scan.d.ts +0 -109
  705. package/dist/core/project-health-scan.js +0 -673
  706. package/dist/core/project-health-scan.js.map +0 -1
  707. package/dist/core/project-health-score.d.ts +0 -41
  708. package/dist/core/project-health-score.js +0 -257
  709. package/dist/core/project-health-score.js.map +0 -1
  710. package/dist/core/prompt-command-expansion.d.ts +0 -13
  711. package/dist/core/prompt-command-expansion.js +0 -48
  712. package/dist/core/prompt-command-expansion.js.map +0 -1
  713. package/dist/core/prompt-commands.d.ts +0 -13
  714. package/dist/core/prompt-commands.js +0 -370
  715. package/dist/core/prompt-commands.js.map +0 -1
  716. package/dist/core/radio-players.d.ts +0 -28
  717. package/dist/core/radio-players.js +0 -133
  718. package/dist/core/radio-players.js.map +0 -1
  719. package/dist/core/radio.d.ts +0 -50
  720. package/dist/core/radio.js +0 -480
  721. package/dist/core/radio.js.map +0 -1
  722. package/dist/core/regrounding.d.ts +0 -37
  723. package/dist/core/regrounding.js +0 -89
  724. package/dist/core/regrounding.js.map +0 -1
  725. package/dist/core/resolve-start.d.ts +0 -28
  726. package/dist/core/resolve-start.js +0 -35
  727. package/dist/core/resolve-start.js.map +0 -1
  728. package/dist/core/run-claim.d.ts +0 -36
  729. package/dist/core/run-claim.js +0 -46
  730. package/dist/core/run-claim.js.map +0 -1
  731. package/dist/core/run-lifecycle.d.ts +0 -58
  732. package/dist/core/run-lifecycle.js +0 -104
  733. package/dist/core/run-lifecycle.js.map +0 -1
  734. package/dist/core/run-status.d.ts +0 -17
  735. package/dist/core/run-status.js +0 -28
  736. package/dist/core/run-status.js.map +0 -1
  737. package/dist/core/runtime-mode.d.ts +0 -21
  738. package/dist/core/runtime-mode.js +0 -43
  739. package/dist/core/runtime-mode.js.map +0 -1
  740. package/dist/core/sandbox-domains.d.ts +0 -13
  741. package/dist/core/sandbox-domains.js +0 -76
  742. package/dist/core/sandbox-domains.js.map +0 -1
  743. package/dist/core/sandbox-feedback.d.ts +0 -21
  744. package/dist/core/sandbox-feedback.js +0 -69
  745. package/dist/core/sandbox-feedback.js.map +0 -1
  746. package/dist/core/sandbox.d.ts +0 -106
  747. package/dist/core/sandbox.js +0 -383
  748. package/dist/core/sandbox.js.map +0 -1
  749. package/dist/core/semantic-loop-check.d.ts +0 -58
  750. package/dist/core/semantic-loop-check.js +0 -103
  751. package/dist/core/semantic-loop-check.js.map +0 -1
  752. package/dist/core/session-compaction.d.ts +0 -23
  753. package/dist/core/session-compaction.js +0 -54
  754. package/dist/core/session-compaction.js.map +0 -1
  755. package/dist/core/session-export.d.ts +0 -97
  756. package/dist/core/session-export.js +0 -368
  757. package/dist/core/session-export.js.map +0 -1
  758. package/dist/core/session-history.d.ts +0 -160
  759. package/dist/core/session-history.js +0 -467
  760. package/dist/core/session-history.js.map +0 -1
  761. package/dist/core/session-manager.d.ts +0 -509
  762. package/dist/core/session-manager.js +0 -1367
  763. package/dist/core/session-manager.js.map +0 -1
  764. package/dist/core/session-preview.d.ts +0 -12
  765. package/dist/core/session-preview.js +0 -58
  766. package/dist/core/session-preview.js.map +0 -1
  767. package/dist/core/session-storage.d.ts +0 -78
  768. package/dist/core/session-storage.js +0 -659
  769. package/dist/core/session-storage.js.map +0 -1
  770. package/dist/core/session-summary-index.d.ts +0 -51
  771. package/dist/core/session-summary-index.js +0 -192
  772. package/dist/core/session-summary-index.js.map +0 -1
  773. package/dist/core/settings-manager.d.ts +0 -113
  774. package/dist/core/settings-manager.js +0 -281
  775. package/dist/core/settings-manager.js.map +0 -1
  776. package/dist/core/shared-checkout-guard.d.ts +0 -78
  777. package/dist/core/shared-checkout-guard.js +0 -219
  778. package/dist/core/shared-checkout-guard.js.map +0 -1
  779. package/dist/core/shell-path.d.ts +0 -13
  780. package/dist/core/shell-path.js +0 -175
  781. package/dist/core/shell-path.js.map +0 -1
  782. package/dist/core/shell-threats-popular-packages.d.ts +0 -11
  783. package/dist/core/shell-threats-popular-packages.js +0 -675
  784. package/dist/core/shell-threats-popular-packages.js.map +0 -1
  785. package/dist/core/shell-threats.d.ts +0 -21
  786. package/dist/core/shell-threats.js +0 -235
  787. package/dist/core/shell-threats.js.map +0 -1
  788. package/dist/core/shell.d.ts +0 -54
  789. package/dist/core/shell.js +0 -99
  790. package/dist/core/shell.js.map +0 -1
  791. package/dist/core/shutdown.d.ts +0 -70
  792. package/dist/core/shutdown.js +0 -144
  793. package/dist/core/shutdown.js.map +0 -1
  794. package/dist/core/skill-scan.d.ts +0 -112
  795. package/dist/core/skill-scan.js +0 -781
  796. package/dist/core/skill-scan.js.map +0 -1
  797. package/dist/core/skills.d.ts +0 -100
  798. package/dist/core/skills.js +0 -299
  799. package/dist/core/skills.js.map +0 -1
  800. package/dist/core/slash-commands.d.ts +0 -58
  801. package/dist/core/slash-commands.js +0 -242
  802. package/dist/core/slash-commands.js.map +0 -1
  803. package/dist/core/steering.d.ts +0 -47
  804. package/dist/core/steering.js +0 -65
  805. package/dist/core/steering.js.map +0 -1
  806. package/dist/core/steroids.d.ts +0 -66
  807. package/dist/core/steroids.js +0 -243
  808. package/dist/core/steroids.js.map +0 -1
  809. package/dist/core/stream-diag-level.d.ts +0 -3
  810. package/dist/core/stream-diag-level.js +0 -24
  811. package/dist/core/stream-diag-level.js.map +0 -1
  812. package/dist/core/stream-rules.d.ts +0 -30
  813. package/dist/core/stream-rules.js +0 -151
  814. package/dist/core/stream-rules.js.map +0 -1
  815. package/dist/core/subagent-manager.d.ts +0 -239
  816. package/dist/core/subagent-manager.js +0 -1060
  817. package/dist/core/subagent-manager.js.map +0 -1
  818. package/dist/core/subagent-policy.d.ts +0 -9
  819. package/dist/core/subagent-policy.js +0 -41
  820. package/dist/core/subagent-policy.js.map +0 -1
  821. package/dist/core/subagent-receipt.d.ts +0 -54
  822. package/dist/core/subagent-receipt.js +0 -274
  823. package/dist/core/subagent-receipt.js.map +0 -1
  824. package/dist/core/subagent-store.d.ts +0 -41
  825. package/dist/core/subagent-store.js +0 -284
  826. package/dist/core/subagent-store.js.map +0 -1
  827. package/dist/core/subagent-turn-record.d.ts +0 -18
  828. package/dist/core/subagent-turn-record.js +0 -82
  829. package/dist/core/subagent-turn-record.js.map +0 -1
  830. package/dist/core/tasks-store.d.ts +0 -31
  831. package/dist/core/tasks-store.js +0 -97
  832. package/dist/core/tasks-store.js.map +0 -1
  833. package/dist/core/telegram-config.d.ts +0 -20
  834. package/dist/core/telegram-config.js +0 -52
  835. package/dist/core/telegram-config.js.map +0 -1
  836. package/dist/core/telegram.d.ts +0 -1
  837. package/dist/core/telegram.js +0 -3
  838. package/dist/core/telegram.js.map +0 -1
  839. package/dist/core/temp-paths.d.ts +0 -5
  840. package/dist/core/temp-paths.js +0 -50
  841. package/dist/core/temp-paths.js.map +0 -1
  842. package/dist/core/test-impact.d.ts +0 -73
  843. package/dist/core/test-impact.js +0 -467
  844. package/dist/core/test-impact.js.map +0 -1
  845. package/dist/core/thinking-level.d.ts +0 -1
  846. package/dist/core/thinking-level.js +0 -4
  847. package/dist/core/thinking-level.js.map +0 -1
  848. package/dist/core/threat-feed.d.ts +0 -65
  849. package/dist/core/threat-feed.js +0 -335
  850. package/dist/core/threat-feed.js.map +0 -1
  851. package/dist/core/trophies/catalog-more.d.ts +0 -2
  852. package/dist/core/trophies/catalog-more.js +0 -837
  853. package/dist/core/trophies/catalog-more.js.map +0 -1
  854. package/dist/core/trophies/catalog.d.ts +0 -4
  855. package/dist/core/trophies/catalog.js +0 -649
  856. package/dist/core/trophies/catalog.js.map +0 -1
  857. package/dist/core/trophies/engine.d.ts +0 -70
  858. package/dist/core/trophies/engine.js +0 -347
  859. package/dist/core/trophies/engine.js.map +0 -1
  860. package/dist/core/trophies/store.d.ts +0 -17
  861. package/dist/core/trophies/store.js +0 -113
  862. package/dist/core/trophies/store.js.map +0 -1
  863. package/dist/core/trophies/types.d.ts +0 -119
  864. package/dist/core/trophies/types.js +0 -76
  865. package/dist/core/trophies/types.js.map +0 -1
  866. package/dist/core/ui-adoption.d.ts +0 -32
  867. package/dist/core/ui-adoption.js +0 -302
  868. package/dist/core/ui-adoption.js.map +0 -1
  869. package/dist/core/ui-compatibility.d.ts +0 -10
  870. package/dist/core/ui-compatibility.js +0 -51
  871. package/dist/core/ui-compatibility.js.map +0 -1
  872. package/dist/core/ui-registry.d.ts +0 -101
  873. package/dist/core/ui-registry.js +0 -292
  874. package/dist/core/ui-registry.js.map +0 -1
  875. package/dist/core/user-shell-context.d.ts +0 -8
  876. package/dist/core/user-shell-context.js +0 -12
  877. package/dist/core/user-shell-context.js.map +0 -1
  878. package/dist/core/verification-evidence.d.ts +0 -49
  879. package/dist/core/verification-evidence.js +0 -816
  880. package/dist/core/verification-evidence.js.map +0 -1
  881. package/dist/core/verification-gate.d.ts +0 -77
  882. package/dist/core/verification-gate.js +0 -504
  883. package/dist/core/verification-gate.js.map +0 -1
  884. package/dist/core/verification-snapshot.d.ts +0 -7
  885. package/dist/core/verification-snapshot.js +0 -109
  886. package/dist/core/verification-snapshot.js.map +0 -1
  887. package/dist/core/verify-commands.d.ts +0 -34
  888. package/dist/core/verify-commands.js +0 -203
  889. package/dist/core/verify-commands.js.map +0 -1
  890. package/dist/core/voice-transcriber.d.ts +0 -1
  891. package/dist/core/voice-transcriber.js +0 -4
  892. package/dist/core/voice-transcriber.js.map +0 -1
  893. package/dist/core/workspace-guard.d.ts +0 -56
  894. package/dist/core/workspace-guard.js +0 -334
  895. package/dist/core/workspace-guard.js.map +0 -1
  896. package/dist/session.d.ts +0 -44
  897. package/dist/session.js +0 -105
  898. package/dist/session.js.map +0 -1
  899. package/dist/system-prompt.d.ts +0 -104
  900. package/dist/system-prompt.js +0 -480
  901. package/dist/system-prompt.js.map +0 -1
  902. package/dist/test-support/fake-home.d.ts +0 -19
  903. package/dist/test-support/fake-home.js +0 -37
  904. package/dist/test-support/fake-home.js.map +0 -1
  905. package/dist/test-support/keep-alive.d.ts +0 -14
  906. package/dist/test-support/keep-alive.js +0 -17
  907. package/dist/test-support/keep-alive.js.map +0 -1
  908. package/dist/test-support/slow-git.d.ts +0 -1
  909. package/dist/test-support/slow-git.js +0 -21
  910. package/dist/test-support/slow-git.js.map +0 -1
  911. package/dist/test-support/system-tools.d.ts +0 -6
  912. package/dist/test-support/system-tools.js +0 -36
  913. package/dist/test-support/system-tools.js.map +0 -1
  914. package/dist/tools/ask-user.d.ts +0 -34
  915. package/dist/tools/ask-user.js +0 -99
  916. package/dist/tools/ask-user.js.map +0 -1
  917. package/dist/tools/background-watch-lint.d.ts +0 -18
  918. package/dist/tools/background-watch-lint.js +0 -102
  919. package/dist/tools/background-watch-lint.js.map +0 -1
  920. package/dist/tools/bash-read-evidence.d.ts +0 -23
  921. package/dist/tools/bash-read-evidence.js +0 -180
  922. package/dist/tools/bash-read-evidence.js.map +0 -1
  923. package/dist/tools/bash.d.ts +0 -64
  924. package/dist/tools/bash.js +0 -552
  925. package/dist/tools/bash.js.map +0 -1
  926. package/dist/tools/browser-api.d.ts +0 -27
  927. package/dist/tools/browser-api.js +0 -449
  928. package/dist/tools/browser-api.js.map +0 -1
  929. package/dist/tools/browser-sandbox.d.ts +0 -16
  930. package/dist/tools/browser-sandbox.js +0 -158
  931. package/dist/tools/browser-sandbox.js.map +0 -1
  932. package/dist/tools/browser-session.d.ts +0 -84
  933. package/dist/tools/browser-session.js +0 -304
  934. package/dist/tools/browser-session.js.map +0 -1
  935. package/dist/tools/browser-snapshot.d.ts +0 -19
  936. package/dist/tools/browser-snapshot.js +0 -109
  937. package/dist/tools/browser-snapshot.js.map +0 -1
  938. package/dist/tools/browser.d.ts +0 -11
  939. package/dist/tools/browser.js +0 -106
  940. package/dist/tools/browser.js.map +0 -1
  941. package/dist/tools/checklist.d.ts +0 -49
  942. package/dist/tools/checklist.js +0 -154
  943. package/dist/tools/checklist.js.map +0 -1
  944. package/dist/tools/compress.d.ts +0 -56
  945. package/dist/tools/compress.js +0 -226
  946. package/dist/tools/compress.js.map +0 -1
  947. package/dist/tools/debug.d.ts +0 -54
  948. package/dist/tools/debug.js +0 -230
  949. package/dist/tools/debug.js.map +0 -1
  950. package/dist/tools/document-text.d.ts +0 -6
  951. package/dist/tools/document-text.js +0 -154
  952. package/dist/tools/document-text.js.map +0 -1
  953. package/dist/tools/edit-diff.d.ts +0 -123
  954. package/dist/tools/edit-diff.js +0 -476
  955. package/dist/tools/edit-diff.js.map +0 -1
  956. package/dist/tools/edit-targets.d.ts +0 -10
  957. package/dist/tools/edit-targets.js +0 -31
  958. package/dist/tools/edit-targets.js.map +0 -1
  959. package/dist/tools/edit.d.ts +0 -38
  960. package/dist/tools/edit.js +0 -695
  961. package/dist/tools/edit.js.map +0 -1
  962. package/dist/tools/enter-plan.d.ts +0 -7
  963. package/dist/tools/enter-plan.js +0 -20
  964. package/dist/tools/enter-plan.js.map +0 -1
  965. package/dist/tools/exit-plan.d.ts +0 -7
  966. package/dist/tools/exit-plan.js +0 -51
  967. package/dist/tools/exit-plan.js.map +0 -1
  968. package/dist/tools/find.d.ts +0 -17
  969. package/dist/tools/find.js +0 -100
  970. package/dist/tools/find.js.map +0 -1
  971. package/dist/tools/generate-image.d.ts +0 -83
  972. package/dist/tools/generate-image.js +0 -625
  973. package/dist/tools/generate-image.js.map +0 -1
  974. package/dist/tools/grep-scan.d.ts +0 -96
  975. package/dist/tools/grep-scan.js +0 -283
  976. package/dist/tools/grep-scan.js.map +0 -1
  977. package/dist/tools/grep.d.ts +0 -48
  978. package/dist/tools/grep.js +0 -1013
  979. package/dist/tools/grep.js.map +0 -1
  980. package/dist/tools/html-extract.d.ts +0 -57
  981. package/dist/tools/html-extract.js +0 -130
  982. package/dist/tools/html-extract.js.map +0 -1
  983. package/dist/tools/index.d.ts +0 -198
  984. package/dist/tools/index.js +0 -216
  985. package/dist/tools/index.js.map +0 -1
  986. package/dist/tools/live-preview.d.ts +0 -23
  987. package/dist/tools/live-preview.js +0 -41
  988. package/dist/tools/live-preview.js.map +0 -1
  989. package/dist/tools/ls.d.ts +0 -9
  990. package/dist/tools/ls.js +0 -59
  991. package/dist/tools/ls.js.map +0 -1
  992. package/dist/tools/operations.d.ts +0 -86
  993. package/dist/tools/operations.js +0 -117
  994. package/dist/tools/operations.js.map +0 -1
  995. package/dist/tools/overflow.d.ts +0 -17
  996. package/dist/tools/overflow.js +0 -68
  997. package/dist/tools/overflow.js.map +0 -1
  998. package/dist/tools/path-utils.d.ts +0 -30
  999. package/dist/tools/path-utils.js +0 -74
  1000. package/dist/tools/path-utils.js.map +0 -1
  1001. package/dist/tools/pdf-extract.d.ts +0 -17
  1002. package/dist/tools/pdf-extract.js +0 -43
  1003. package/dist/tools/pdf-extract.js.map +0 -1
  1004. package/dist/tools/prompt-hints.d.ts +0 -46
  1005. package/dist/tools/prompt-hints.js +0 -171
  1006. package/dist/tools/prompt-hints.js.map +0 -1
  1007. package/dist/tools/read-only-bash.d.ts +0 -31
  1008. package/dist/tools/read-only-bash.js +0 -338
  1009. package/dist/tools/read-only-bash.js.map +0 -1
  1010. package/dist/tools/read-tracker.d.ts +0 -43
  1011. package/dist/tools/read-tracker.js +0 -120
  1012. package/dist/tools/read-tracker.js.map +0 -1
  1013. package/dist/tools/read.d.ts +0 -18
  1014. package/dist/tools/read.js +0 -316
  1015. package/dist/tools/read.js.map +0 -1
  1016. package/dist/tools/redaction-guard.d.ts +0 -10
  1017. package/dist/tools/redaction-guard.js +0 -55
  1018. package/dist/tools/redaction-guard.js.map +0 -1
  1019. package/dist/tools/routine-output.d.ts +0 -39
  1020. package/dist/tools/routine-output.js +0 -281
  1021. package/dist/tools/routine-output.js.map +0 -1
  1022. package/dist/tools/safe-env.d.ts +0 -1
  1023. package/dist/tools/safe-env.js +0 -79
  1024. package/dist/tools/safe-env.js.map +0 -1
  1025. package/dist/tools/session-stats.d.ts +0 -26
  1026. package/dist/tools/session-stats.js +0 -51
  1027. package/dist/tools/session-stats.js.map +0 -1
  1028. package/dist/tools/side-web-search.d.ts +0 -34
  1029. package/dist/tools/side-web-search.js +0 -146
  1030. package/dist/tools/side-web-search.js.map +0 -1
  1031. package/dist/tools/skill.d.ts +0 -12
  1032. package/dist/tools/skill.js +0 -94
  1033. package/dist/tools/skill.js.map +0 -1
  1034. package/dist/tools/source-path.d.ts +0 -8
  1035. package/dist/tools/source-path.js +0 -128
  1036. package/dist/tools/source-path.js.map +0 -1
  1037. package/dist/tools/steroids.d.ts +0 -44
  1038. package/dist/tools/steroids.js +0 -356
  1039. package/dist/tools/steroids.js.map +0 -1
  1040. package/dist/tools/subagent-control.d.ts +0 -5
  1041. package/dist/tools/subagent-control.js +0 -211
  1042. package/dist/tools/subagent-control.js.map +0 -1
  1043. package/dist/tools/subagent-shared.d.ts +0 -110
  1044. package/dist/tools/subagent-shared.js +0 -180
  1045. package/dist/tools/subagent-shared.js.map +0 -1
  1046. package/dist/tools/subagent.d.ts +0 -37
  1047. package/dist/tools/subagent.js +0 -406
  1048. package/dist/tools/subagent.js.map +0 -1
  1049. package/dist/tools/task-output.d.ts +0 -10
  1050. package/dist/tools/task-output.js +0 -74
  1051. package/dist/tools/task-output.js.map +0 -1
  1052. package/dist/tools/task-send.d.ts +0 -11
  1053. package/dist/tools/task-send.js +0 -36
  1054. package/dist/tools/task-send.js.map +0 -1
  1055. package/dist/tools/task-stop.d.ts +0 -8
  1056. package/dist/tools/task-stop.js +0 -15
  1057. package/dist/tools/task-stop.js.map +0 -1
  1058. package/dist/tools/tasks.d.ts +0 -15
  1059. package/dist/tools/tasks.js +0 -94
  1060. package/dist/tools/tasks.js.map +0 -1
  1061. package/dist/tools/tool-search.d.ts +0 -26
  1062. package/dist/tools/tool-search.js +0 -81
  1063. package/dist/tools/tool-search.js.map +0 -1
  1064. package/dist/tools/tool-tiers.d.ts +0 -65
  1065. package/dist/tools/tool-tiers.js +0 -121
  1066. package/dist/tools/tool-tiers.js.map +0 -1
  1067. package/dist/tools/truncate.d.ts +0 -39
  1068. package/dist/tools/truncate.js +0 -242
  1069. package/dist/tools/truncate.js.map +0 -1
  1070. package/dist/tools/ui-adopt.d.ts +0 -16
  1071. package/dist/tools/ui-adopt.js +0 -66
  1072. package/dist/tools/ui-adopt.js.map +0 -1
  1073. package/dist/tools/ui-registry.d.ts +0 -15
  1074. package/dist/tools/ui-registry.js +0 -39
  1075. package/dist/tools/ui-registry.js.map +0 -1
  1076. package/dist/tools/verification-review.d.ts +0 -2
  1077. package/dist/tools/verification-review.js +0 -41
  1078. package/dist/tools/verification-review.js.map +0 -1
  1079. package/dist/tools/web-fetch.d.ts +0 -52
  1080. package/dist/tools/web-fetch.js +0 -986
  1081. package/dist/tools/web-fetch.js.map +0 -1
  1082. package/dist/tools/web-search.d.ts +0 -35
  1083. package/dist/tools/web-search.js +0 -926
  1084. package/dist/tools/web-search.js.map +0 -1
  1085. package/dist/tools/write.d.ts +0 -16
  1086. package/dist/tools/write.js +0 -196
  1087. package/dist/tools/write.js.map +0 -1
  1088. package/dist/types.d.ts +0 -44
  1089. package/dist/types.js +0 -2
  1090. package/dist/types.js.map +0 -1
  1091. package/dist/utils/git.d.ts +0 -102
  1092. package/dist/utils/git.js +0 -325
  1093. package/dist/utils/git.js.map +0 -1
  1094. package/dist/utils/github-ci.d.ts +0 -18
  1095. package/dist/utils/github-ci.js +0 -138
  1096. package/dist/utils/github-ci.js.map +0 -1
  1097. package/dist/utils/github.d.ts +0 -19
  1098. package/dist/utils/github.js +0 -67
  1099. package/dist/utils/github.js.map +0 -1
  1100. package/dist/utils/image.d.ts +0 -166
  1101. package/dist/utils/image.js +0 -673
  1102. package/dist/utils/image.js.map +0 -1
  1103. package/dist/utils/open-browser.d.ts +0 -13
  1104. package/dist/utils/open-browser.js +0 -31
  1105. package/dist/utils/open-browser.js.map +0 -1
  1106. package/dist/utils/plan-steps.d.ts +0 -90
  1107. package/dist/utils/plan-steps.js +0 -209
  1108. package/dist/utils/plan-steps.js.map +0 -1
  1109. package/dist/utils/process.d.ts +0 -48
  1110. package/dist/utils/process.js +0 -175
  1111. package/dist/utils/process.js.map +0 -1
  1112. package/dist/utils/prompt-enhancer.d.ts +0 -53
  1113. package/dist/utils/prompt-enhancer.js +0 -178
  1114. package/dist/utils/prompt-enhancer.js.map +0 -1
  1115. package/dist/utils/text.d.ts +0 -61
  1116. package/dist/utils/text.js +0 -68
  1117. package/dist/utils/text.js.map +0 -1
  1118. package/dist/web.d.ts +0 -5
  1119. package/dist/web.js +0 -5
  1120. package/dist/web.js.map +0 -1
@@ -1,1398 +0,0 @@
1
- import { type AgentTool, type ToolExecuteResult } from "@kenkaiiii/gg-agent";
2
- import { type Message, type MessageProvenance, type Provider, type Usage, type ThinkingLevel, type TextContent, type ImageContent, type VideoContent } from "@kenkaiiii/gg-ai";
3
- import { EventBus } from "./event-bus.js";
4
- import { type InstalledThreat } from "./installed-threats.js";
5
- import type { PackageCheckOptions } from "./package-threats.js";
6
- import { type CompletionReview } from "./completion-review.js";
7
- import { SlashCommandRegistry } from "./slash-commands.js";
8
- import { type CustomCommand } from "./custom-commands.js";
9
- import { type BranchInfo, type KenTurnPayload, type AutopilotMarkerPayload, type AppMarkerPayload, type RunOutcome, type TurnMetricPayload } from "./session-manager.js";
10
- import { type BlockedSkill, type Skill } from "./skills.js";
11
- import type { BackgroundProcess } from "./process-manager.js";
12
- import { type ChildModelPick, type SubAgentSnapshot } from "./subagent-manager.js";
13
- import type { MCPElicitHandler } from "./mcp/index.js";
14
- import type { MCPServerConfig } from "./mcp/types.js";
15
- import { type ContextLimits } from "./context-limits.js";
16
- import { type ImportForeignTranscriptResult } from "./foreign-session-import.js";
17
- import { type CacheExpiryStatus } from "./cache-expiry.js";
18
- import { type AgentDefinition } from "./agents.js";
19
- import { type EnhanceResult } from "../utils/prompt-enhancer.js";
20
- import { type CheckoutRecord } from "./checkout-record.js";
21
- import type { VerificationEvidence } from "./verification-evidence.js";
22
- /**
23
- * The output cap to send on a request. A model's output ceiling can equal its
24
- * whole window (Kimi K2.7 Code: 262,144 of 262,144), and providers that count
25
- * prompt + max_tokens against the window reject every request with a real
26
- * prompt. Cap it at the room the model's TOTAL window leaves once the context
27
- * reaches this session's compaction trigger — the largest prompt it lets build
28
- * up. The total window, not the route's: the ChatGPT/Codex route's 272K
29
- * window is an input budget, and GPT-6's 128K output sits outside it.
30
- */
31
- export declare function outputCapForRequest(options: {
32
- provider: Provider;
33
- model: string;
34
- maxTokens: number;
35
- threshold: number;
36
- accountId?: string;
37
- }): number;
38
- /**
39
- * Reply for chat bridges (Telegram, agent home) that have no confirmation step.
40
- * Generic on purpose: every paid model (Claude fast mode, MiMo UltraSpeed) is
41
- * refused here, so the reason must not name one of them.
42
- */
43
- export declare function paidModelRefusal(modelName: string): string;
44
- /**
45
- * Thrown by {@link AgentSession.switchModel} when the target model spends real
46
- * money and the caller didn't pass the user's explicit confirmation.
47
- */
48
- export declare class PaidModelConfirmationError extends Error {
49
- readonly modelName: string;
50
- readonly detail: string;
51
- constructor(modelName: string, detail: string);
52
- }
53
- /** A chat attachment (image / video / other file) prepared for the model. The
54
- * raw base64 `data` rides native blocks; `path` (when persisted to disk) lets
55
- * the agent's tools open the file directly. */
56
- /** What applying one MCP config change did in a session. */
57
- export interface McpServerChange {
58
- name: string;
59
- removed: boolean;
60
- connected: boolean;
61
- toolCount: number;
62
- error?: string;
63
- requiresAuth?: boolean;
64
- }
65
- export interface SessionAttachment {
66
- kind: "image" | "video" | "file";
67
- mediaType: string;
68
- data: string;
69
- name: string;
70
- path?: string;
71
- }
72
- /** Per-prompt run controls. */
73
- export interface PromptRunOptions {
74
- /** Offer the model no tools for this prompt. */
75
- disableTools?: boolean;
76
- /** Hold reasoning effort at the plan-mode ceiling for this prompt. */
77
- capThinking?: boolean;
78
- }
79
- export interface AgentSessionOptions {
80
- provider: Provider;
81
- model: string;
82
- cwd: string;
83
- baseUrl?: string;
84
- /**
85
- * Who else works in the git checkout rooted at a path: other app windows, or
86
- * a worker's parent agent. Lets the bash tool refuse a branch switch that
87
- * would move them too (core/shared-checkout-guard.ts). Unset in a lone CLI.
88
- */
89
- getCheckoutSharers?: (root: string) => Promise<string | null>;
90
- /** Replaces the whole system prompt — nothing else is rendered. */
91
- systemPrompt?: string;
92
- /**
93
- * A sub-agent definition's body, COMPOSED with the standard scaffolding
94
- * (Tools, project context, return contract, Environment) instead of replacing
95
- * it — see `buildSubAgentSystemPrompt`.
96
- *
97
- * Prefer this over `systemPrompt` for delegated children: a bare replacement
98
- * leaves the child with no Tools section and no Environment facts, which is
99
- * precisely how a sub-agent ends up misusing tools it was never told it had.
100
- * Ignored when `systemPrompt` is set.
101
- */
102
- agentPrompt?: string;
103
- /** Whether `agentPrompt` composition includes project instruction files. Default `"project"`. */
104
- agentContext?: "project" | "none";
105
- /**
106
- * Who `agentPrompt` speaks to. `"subagent"` (default) appends the delegated
107
- * child's return contract; `"primary"` is a user-facing specialist (Motion)
108
- * that keeps the Tools/Environment scaffolding but answers the user directly.
109
- */
110
- agentRole?: "subagent" | "primary";
111
- /** Synchronous volatile prompt suffix, refreshed immediately before every run. */
112
- getSystemPromptTail?: () => string;
113
- sessionId?: string;
114
- continueRecent?: boolean;
115
- maxTokens?: number;
116
- maxTurns?: number;
117
- /**
118
- * How many times the turn budget may be extended when the agent is still
119
- * making progress. Defaults to the agent-loop default (2); sub-agents pass a
120
- * stricter cap because a child's extensions multiply against the parent's
121
- * own budget.
122
- */
123
- maxTurnExtensions?: number;
124
- thinkingLevel?: ThinkingLevel;
125
- /**
126
- * Whether Claude Code sessions return a readable summary of the model's
127
- * thinking ("summarized") or none ("omitted", Claude Code's default). For
128
- * hosts that show reasoning; GG Coder's own UI doesn't.
129
- */
130
- thinkingDisplay?: "summarized" | "omitted";
131
- signal?: AbortSignal;
132
- /** Prefix used for provider prompt-cache routing keys. */
133
- promptCacheKeyPrefix?: string;
134
- /**
135
- * Explicit prompt-cache routing key. When set, overrides the
136
- * `${promptCacheKeyPrefix}:${sessionId}` default so spawned sub-agents can
137
- * inherit a stable parent-scoped key — without this, each sub-agent process
138
- * generates a fresh sessionId and starts with a cold cache.
139
- */
140
- promptCacheKey?: string;
141
- /**
142
- * If true, this session does NOT create a `.jsonl` session file or persist
143
- * any messages. Used by subagent spawns (`--json` mode) so their transcripts
144
- * don't leak into `ggcoder continue` for the parent project. Subagent runs
145
- * are one-shot, NDJSON-streamed to the parent over stdout, and have no
146
- * resumable identity.
147
- */
148
- transient?: boolean;
149
- /** Pre-open the provider connection at session start / model switch / prewarm.
150
- * Default: on, except transient sessions and under the test runner. */
151
- preconnect?: boolean;
152
- /**
153
- * Told when an agent loop starts (true) and when the outermost one ends
154
- * (false), however it ended. Nested loops (a template prompt inside a run)
155
- * don't repeat it. GG Goals uses it to tell other processes the goal is
156
- * being worked on (`core/goal-run-marker.ts`). A throwing listener is
157
- * ignored: it must never fail or wedge a run.
158
- */
159
- onRunActive?: (active: boolean) => void;
160
- /**
161
- * If true, `initialize()` returns WITHOUT waiting for MCP servers to connect —
162
- * the connection runs in the background and tools are appended when ready.
163
- * Hosts whose readiness is gated on `initialize()` (the gg-app sidecar, which
164
- * can't emit its listening handshake until init resolves) set this so a slow
165
- * or hanging stdio MCP server (e.g. a first-run `npx -y …` download) can't
166
- * delay the session from becoming usable. Default (false) keeps the CLI's
167
- * connect-before-ready behavior so MCP tools are present on the first turn.
168
- */
169
- backgroundMcpConnect?: boolean;
170
- /**
171
- * Handler for a server-initiated MCP `elicitation/create` — a request for user
172
- * input in the middle of a tool call. Hosts that can render a form (the
173
- * gg-app sidecar) supply this; without it the session declares no elicitation
174
- * capability and servers fall back to their no-input behavior.
175
- */
176
- onMcpElicit?: MCPElicitHandler;
177
- /**
178
- * If true, an over-context restored session is NOT compacted inline during
179
- * `loadExistingSession()` — the existing pre-run auto-compaction in
180
- * `runLoop()` handles it on the first prompt instead (with proper
181
- * compaction_start/_end events). The inline load compaction makes a summary
182
- * LLM call with a 30s timeout, and hosts whose readiness is gated on
183
- * `initialize()` (the gg-app sidecar: waitForReady blocks the whole webview)
184
- * would freeze the UI for that entire call. Default (false) keeps the
185
- * compact-on-load behavior for CLI resume/`ggcoder continue`.
186
- */
187
- deferLoadCompaction?: boolean;
188
- /**
189
- * Plan-mode callbacks. When provided, the `enter_plan`/`exit_plan` tools are
190
- * registered and the session manages plan-mode restrictions + system-prompt
191
- * rebuilds. Hosts (e.g. the gg-app sidecar) use these to surface plan-mode
192
- * UI. Omitted by callers that don't want plan mode (CLI wires its own).
193
- */
194
- onEnterPlan?: (reason?: string) => void | Promise<void>;
195
- /**
196
- * Built-in tools to keep in the core set instead of the deferred
197
- * tool_search catalog: for a specialist whose job is a deferred tool (GG
198
- * Goals orchestrates with spawn_agent and friends). Fixed for the session.
199
- */
200
- coreTools?: readonly string[];
201
- /**
202
- * Default provider/model for the workers this session spawns, when their
203
- * agent names no model of its own. Read at spawn time.
204
- */
205
- getChildModel?: () => ChildModelPick | undefined;
206
- /**
207
- * Wrap each built-in tool once, at registration. Must keep the tool's name,
208
- * description and parameters (only `execute` may change), so the tool block
209
- * stays prompt-cache stable. Used by GG Goals to gate its own editing.
210
- */
211
- wrapTool?: (tool: AgentTool) => AgentTool;
212
- /**
213
- * Built-in tools this session never has, removed at registration (before
214
- * tiering) and left out of the system prompt's Tools section. Unlike
215
- * `allowedTools`, the rest of the tool set and its tiering are untouched.
216
- * Fixed for the session, so the cached tool block never changes. Used by
217
- * GG Goals, which never edits or runs anything itself.
218
- */
219
- withoutTools?: readonly string[];
220
- /**
221
- * A fixed team of sub-agents, replacing agent discovery (project, global
222
- * and bundled): the only agents spawn_agent and subagent can start. Used by
223
- * GG Goals, whose workers follow their own rules (goals-agent/goal-team.ts).
224
- */
225
- subAgents?: readonly AgentDefinition[];
226
- /**
227
- * Start every spawned child with this session's extra workspace roots too
228
- * (less the folder it works in), so it can read and change all of them.
229
- * GG Goals' workers work across all of a goal's attached folders.
230
- */
231
- shareRootsWithSubAgents?: boolean;
232
- /** The sub-agent a spawned child is when the spawn names none (one of `subAgents`). */
233
- defaultSubAgent?: string;
234
- onExitPlan?: (planPath: string) => Promise<ToolExecuteResult>;
235
- /**
236
- * If provided, the session's tool set is filtered to ONLY these tool names
237
- * after `createTools()` runs, and the system prompt's Tools section lists only
238
- * them. Used by read-only advisory sessions (e.g. the Ken mentor agent) to
239
- * register a safe subset — excluded mutating tools (write/edit/bash/…) are
240
- * never registered, so a hallucinated call can't change the repo. Default
241
- * (undefined) = all tools, preserving every existing caller's behavior.
242
- */
243
- allowedTools?: string[];
244
- /**
245
- * MCP server names whose tools are allowed in an allow-listed session. Only
246
- * meaningful alongside `allowedTools`. With it set, the session connects ONLY
247
- * these named MCP servers (not the full configured set) and every tool they
248
- * expose (`mcp__<server>__*`) passes the allow-list, so a read-only agent can
249
- * be handed one research server while still being barred from every mutating
250
- * tool. Empty/undefined → an allow-listed session skips
251
- * MCP entirely (its dynamic tool names could never match a fixed allow-list).
252
- */
253
- allowedMcpServers?: string[];
254
- /**
255
- * Force 1-h prompt-cache TTL + pre-warm regardless of the user's global
256
- * `speedProfile` setting. Bursty read-only advisory sessions (the Ken
257
- * mentor + autopilot reviewer) call the same static system prompt on a
258
- * schedule that routinely exceeds the default 5-min cache window — a
259
- * dropped cache there resends the whole cached prefix at full price right
260
- * when it matters most, independent of whatever the user picked for the
261
- * main build session. Default (undefined) = follow `speedProfile`.
262
- */
263
- forceLongCacheRetention?: boolean;
264
- /** Hidden persistent subagent workers omit the async orchestration tool suite. */
265
- subagentWorker?: boolean;
266
- /** Session storage root override. Chat agents use a dedicated namespace. */
267
- sessionRootDir?: string;
268
- /** Register GG Coder built-in/prompt/custom slash commands. Defaults to true. */
269
- coderSlashCommands?: boolean;
270
- /** Enable loop-break and re-grounding hooks. Defaults to true. */
271
- selfCorrectionHooks?: boolean;
272
- /** Override the semantic-loop judge LLM call (tests). Receives the finished
273
- * prompt, returns the model's raw reply. Default: one-shot `stream()` call
274
- * on the session's ACTIVE model. */
275
- semanticLoopJudge?: (prompt: string) => Promise<string>;
276
- /** Load project skills/agents and create local .gg directories. Defaults to true. */
277
- projectCustomization?: boolean;
278
- /**
279
- * Use exactly this skill set instead of discovering bundled/global/project
280
- * skills. A mode with a private skill bundle (Motion) passes its own list so
281
- * its skills stay invisible to every other mode, and vice versa.
282
- */
283
- skills?: readonly Skill[];
284
- /** Skills the caller's own discovery refused, shown alongside `skills`. */
285
- blockedSkills?: readonly BlockedSkill[];
286
- /**
287
- * Background check of the project's lockfiles for packages flagged as
288
- * malware after install. Default on, except under vitest.
289
- */
290
- installedPackageWatch?: boolean;
291
- /** Delay before the first installed-package check (default 5 s). */
292
- installedPackageWatchDelayMs?: number;
293
- /** Options for the installed-package check (tests inject fetch/feed). */
294
- installedPackageCheck?: PackageCheckOptions;
295
- /**
296
- * Record refused packages in the project's instruction file (AGENTS.md /
297
- * CLAUDE.md) so later sessions know them. Default on for project sessions,
298
- * except under vitest.
299
- */
300
- blockedPackagesFile?: boolean;
301
- /**
302
- * Mode-specific defaults for prompt byte budgets. The user's `contextLimits`
303
- * setting still overrides these. Motion raises its skill-catalog budget
304
- * because its skill set is a fixed, bundled one (never untrusted files).
305
- */
306
- contextLimits?: Partial<ContextLimits>;
307
- /** Register global + bundled subagents without loading project customization. */
308
- globalSubagents?: boolean;
309
- /** Load GG Coder extensions. Defaults to true. */
310
- loadExtensions?: boolean;
311
- /** Inject GG Coder's model-specific subagent orchestration prompt. Defaults to true. */
312
- orchestrationPrompt?: boolean;
313
- /** Host-provided tools appended to this session only (for example, chat delegation). */
314
- additionalTools?: AgentTool[];
315
- /** Mode-owned completion policy; absent in Coder/chat/worker sessions. */
316
- completionReview?: CompletionReview;
317
- /** Remind the agent to submit its plan (exit_plan) when a run is about to
318
- * stop still in plan mode. Desktop only: an unsubmitted plan there leaves
319
- * nothing to review. See plan-submission-gate.ts. */
320
- planSubmissionGate?: boolean;
321
- }
322
- export { resolveSessionToolResultCharLimit, resolveSessionTurnToolResultCharLimit, } from "./agent-session/helpers.js";
323
- export interface AgentSessionState {
324
- provider: Provider;
325
- model: string;
326
- cwd: string;
327
- sessionId: string;
328
- sessionPath: string;
329
- messageCount: number;
330
- planMode: boolean;
331
- /** accountId from the most recently resolved credentials, if any — lets
332
- * callers compute the transport-specific context window (e.g. OpenAI Codex
333
- * OAuth) without re-resolving credentials. */
334
- accountId?: string;
335
- }
336
- /** A prompt that asks for the live web (see AgentSession.attachWebSearchIfAsked). */
337
- /** True when the transcript holds a native (server-side) `web_search` call. */
338
- export declare function historyUsesNativeWebSearch(messages: readonly Message[]): boolean;
339
- /** How long dispose waits for a post-turn compaction before aborting it. */
340
- export declare const DISPOSE_COMPACTION_WAIT_MS = 2500;
341
- /**
342
- * A chat row's target: first line, no control or bidi-override characters
343
- * (they could make a command look like another), at most 120 chars.
344
- */
345
- export declare function securityRowTarget(raw: string): string;
346
- /** Not the home folder or a filesystem root (those are never a project). */
347
- export declare function isScannableProjectDir(dir: string, home?: string): boolean;
348
- export declare class AgentSession {
349
- readonly eventBus: EventBus;
350
- readonly slashCommands: SlashCommandRegistry;
351
- private settingsManager;
352
- private authStorage;
353
- private sessionManager;
354
- private extensionLoader;
355
- private messages;
356
- private readonly markers;
357
- private readonly cacheDiagnostics;
358
- /** Internal-only (GG_INTERNAL): live per-session cost/reliability recorder.
359
- * Absent entirely in public builds — see core/internal-diagnostics.ts. */
360
- private diagnosticsRecorder?;
361
- private tools;
362
- /** Rebuilds the read tool for a new model (video byte cap is baked in at
363
- * creation). Called from switchModel so video-capable models get the
364
- * read-tool's native-video path after a mid-session model change. */
365
- private rebuildReadTool;
366
- /** Forgets every file read; called whenever the conversation is replaced or
367
- * rewound, so the model must re-read a file before changing it. */
368
- private clearReadTracker;
369
- private recordBashReads;
370
- private skills;
371
- /** Skills discovery refused to load (safety scan); shown to the user, named by the skill tool. */
372
- private blockedSkills;
373
- /** Lockfile entries now known to be malware (background check), for the app/CLI to show. */
374
- private installedThreats;
375
- private installedWatchStop;
376
- private installedStamp;
377
- private installedScanRunning;
378
- private installedWatchStopped;
379
- /** rule\0target of the security rows already shown this run. */
380
- private securityRowsThisRun;
381
- /** Project session (code mode): the only kind that writes the "don't install" list. */
382
- private projectSession;
383
- private cacheKeyLogged;
384
- private readonly loopMonitor;
385
- private regroundingInjected;
386
- /**
387
- * The environment as the cached system prompt currently describes it.
388
- * Re-recorded on every prompt build, so a rebuild (e.g. `/add-dir`) needs no
389
- * delta; anything that changes WITHOUT one is caught by the hook below.
390
- */
391
- private renderedEnvironment;
392
- /** Project files as of the first prompt build (undefined until then). */
393
- private projectFiles;
394
- /** `git ls-files` started at the top of initialize(), overlapping the rest of setup. */
395
- private projectFilesPending?;
396
- /** Wall-clock start of the current run; scopes the background-process gate. */
397
- private runStartedAt;
398
- /** Gate injections spent this run, capped by MAX_PROCESS_GATE_INJECTIONS. */
399
- private processGateInjected;
400
- /** Plan-submission reminders spent this run (plan-submission-gate.ts). */
401
- private planSubmissionNudges;
402
- /** Verification evidence: code edited this run, and what has proved it since.
403
- * Passive tracking only — it feeds run status and autopilot, never a turn. */
404
- private readonly verificationGate;
405
- /** Host-observed evidence (edited files, in-flight and background checks) feeding the gate. */
406
- private readonly verificationTracker;
407
- /** Mirror of the last `hook_armed` value, so the event fires only on an edge. */
408
- private preFinalArmed;
409
- private compactionOccurred;
410
- /**
411
- * Re-grounding carry-over for post-turn compaction. `resetHookState` clears
412
- * `compactionOccurred` at run start — before the injection point — so a
413
- * background compaction that finished after the final response parks its
414
- * "re-ground next turn" signal here for pickup at the next run start.
415
- */
416
- private compactionArmedForNextRun;
417
- /** In-flight post-turn (background) compaction, if any. */
418
- private postTurnCompaction?;
419
- /** Aborts the in-flight post-turn compaction (dispose caps its wait). */
420
- private postTurnCompactionAbort?;
421
- private lastCompactionCompacted;
422
- private compactionRetryAfter;
423
- /**
424
- * SoL-Pi plan-step compaction bookkeeping (see compaction/plan-step-policy.ts).
425
- * Step progress comes from `[DONE:n]` markers in assistant text — the same
426
- * contract the approved-plan UI tracks.
427
- */
428
- private planStepState;
429
- /** A restored oversized checkpoint must be canonicalized before its first prompt is persisted. */
430
- private deferredCompactionPending;
431
- /** Latest provider count, anchored to the assistant response it measured. */
432
- private providerContext;
433
- /** Where the last prune made history stable; becomes the cache anchor on the next step. */
434
- private pendingCacheAnchor;
435
- /** The message currently carrying `cacheAnchor` (see applyPendingCacheAnchor). */
436
- private cacheAnchored;
437
- /** See {@link toolDefinitionChars}. */
438
- private toolCharsCache;
439
- private originalRequest;
440
- /** The user's own ask_user answers this run; they scope the pinned request. */
441
- private runUserDecisions;
442
- private userQueue;
443
- private askAnswerSteering;
444
- private deliveringQueue;
445
- private queueSeq;
446
- /** Monotonic count of human-originated prompts; idle-wake budgets reset on it. */
447
- private humanPromptSeq;
448
- /** Instant interrupt: the running loop's preempt listeners, fired on queueMessage. */
449
- private steeringListeners;
450
- private processManager?;
451
- private lspManager?;
452
- private debugManager?;
453
- private browserManager?;
454
- private subAgentManager?;
455
- /**
456
- * Out-of-band push notifications (finished children, background-process
457
- * progress). Producers enqueue; `getHookSteeringMessages` drains into the
458
- * live turn so the agent never has to spend a turn asking.
459
- */
460
- private readonly notifications;
461
- private managerAbortSignal?;
462
- private readonly managerAbortHandler;
463
- /** MCP client, deferred tool_search catalog and cached-stub reconcile state. */
464
- private readonly mcp;
465
- /** Resolved prompt-injection byte budgets (contextLimits setting). */
466
- private contextLimits;
467
- /**
468
- * Built-in tools held in the catalog instead of the live toolset. Their names
469
- * still render as one-line hints in the prompt's Tools section, so the model
470
- * can discover and promote them; a promoted name drops out of this list.
471
- */
472
- private deferredBuiltinToolNames;
473
- /** Deferred built-ins in tier order, fixed at session start. Sent as the
474
- * provider's on-demand catalog (see gg-ai `deferredTools`) so promoting one
475
- * loads it through the transcript and the cached tools block stays put. */
476
- private deferredToolCatalog;
477
- private provider;
478
- private model;
479
- private cwd;
480
- /** accountId from the most recently resolved credentials — cached so sync
481
- * callers (e.g. the app-sidecar's context-window footer stat) can reflect
482
- * transport-specific windows (e.g. OpenAI Codex OAuth's smaller window)
483
- * without re-resolving credentials on every poll. */
484
- private lastAccountId?;
485
- /** The branch and checkout this conversation is on (core/checkout-record.ts). */
486
- private checkoutRecord;
487
- private baseUrl?;
488
- private maxTokens;
489
- private thinkingLevel?;
490
- private readonly thinkingDisplay?;
491
- private customSystemPrompt?;
492
- /** Sub-agent definition body composed into the standard prompt scaffolding. */
493
- private agentPrompt?;
494
- /** Stable prompt prefix retained separately from the volatile uncached tail. */
495
- private baseSystemPrompt;
496
- /** Plan state rendered into the cached system prompt. */
497
- private promptPlanState;
498
- /** Plan state the model has been told (prompt or appended notice). */
499
- private seenPlanState;
500
- /** Plan notice waiting for the next request, with the state it describes. */
501
- private pendingPlanNotice;
502
- /** Latest plan notice appended — re-announced if compaction drops it. */
503
- private lastPlanNotice;
504
- /**
505
- * Project languages whose verify commands are in the standard prompt.
506
- * Only ever grows within a session (same policy as the terminal UI): a
507
- * section disappearing mid-task would rewrite the cached prefix
508
- * for no benefit.
509
- */
510
- private activeLanguages;
511
- /** Languages the model has already been given guidance for, via the system
512
- * prompt or an appended language update. */
513
- private announcedLanguages;
514
- /** Shared with the tool layer so plan-mode restrictions read live state. */
515
- private planModeRef;
516
- /** Path of the approved plan currently being implemented, or undefined. When
517
- * set, the system prompt carries the `[DONE:n]` progress contract so the
518
- * model emits step-completion markers the UI's plan-progress widget reads. */
519
- private approvedPlanPath?;
520
- /** Extra workspace roots added with `/add-dir` (resolved, de-duplicated). */
521
- private additionalRoots;
522
- private sessionId;
523
- private checkpointGeneration;
524
- /** Stable identity shared by compaction and approved-plan checkpoint files. */
525
- private conversationId;
526
- /** Original user-authored prompt, retained when internal messages replace history. */
527
- private sessionPreview;
528
- /** Runtime conversation identity for provider transport headers. Transient
529
- * children need one even though they intentionally have no persisted session. */
530
- private readonly transportSessionId;
531
- private sessionPath;
532
- private lastPersistedIndex;
533
- /**
534
- * The array `agentLoop` is currently mutating, while a run is in flight.
535
- *
536
- * Normally identical to `this.messages`, but a mid-loop compaction rebinds
537
- * `this.messages` to the compacted result while the loop keeps appending to
538
- * its own array. Step-boundary flushes must follow the loop's array or they
539
- * would silently persist nothing for the rest of the run.
540
- */
541
- private activeLoopMessages;
542
- /**
543
- * Number of non-system messages guaranteed to be in the session file — the
544
- * anchor base for transcript markers (Ken turns, autopilot verdicts, app
545
- * markers). `this.messages` can run ahead of the file: the agent loop
546
- * appends assistant/tool/steering messages in place but they are only
547
- * persisted when the run SUCCEEDS, so after a failed run the in-memory list
548
- * carries an unpersisted tail. Markers anchored against that tail point past
549
- * their real position on resume — the row (notably an error) renders lower
550
- * in the transcript than it happened, bunching at the bottom, or gets
551
- * dropped as out-of-range. Anchoring to the persisted prefix keeps resume
552
- * placement 1:1 with where the row appeared live.
553
- */
554
- /** Commands the user ran themselves, held until their next message. */
555
- private pendingUserShell;
556
- /** MCP servers the user added or removed mid-session, not yet told to the model. */
557
- private pendingMcpNotices;
558
- private persistedTranscriptCount;
559
- /** Current leaf entry ID in the session DAG — used to chain parentIds for branching. */
560
- private currentLeafId;
561
- private opts;
562
- constructor(options: AgentSessionOptions);
563
- /**
564
- * Derive the output-token cap for a model. Follows the active model's
565
- * `maxOutputTokens` so a session booted on a large-output model (e.g. Kimi's
566
- * 256K) doesn't carry that cap to a smaller one (e.g. Opus's 128K) after a
567
- * model switch — that mismatch surfaces from the provider as
568
- * `max_tokens: 262144 > 128000, which is the maximum allowed …`. An explicit
569
- * `maxTokens` override is honored but clamped to the model's ceiling.
570
- */
571
- private resolveMaxTokens;
572
- /** {@link outputCapForRequest} for this session's live model and settings. */
573
- private requestMaxTokens;
574
- initialize(): Promise<void>;
575
- /**
576
- * Whether a tool name is permitted for this session. With no `allowedTools`
577
- * everything passes (default behavior). Otherwise a tool is allowed when its
578
- * name is in `allowedTools`, OR it's an MCP tool (`mcp__<server>__<tool>`)
579
- * whose `<server>` is in `allowedMcpServers`. The MCP-prefix rule lets a
580
- * whitelisted research server expose all its tools
581
- * without hard-coding each one, while every other tool stays blocked.
582
- */
583
- private isToolAllowed;
584
- /**
585
- * Connect all configured MCP servers and append their tools to `this.tools`.
586
- * Resolves the GLM api key first (Z.AI's bundled servers need it). Never
587
- * throws — a failed connect is logged and skipped — so it is safe to either
588
- * `await` (CLI: tools ready before the first turn) or fire-and-forget
589
- * (sidecar: `backgroundMcpConnect`, so a slow stdio server can't stall
590
- * startup). Tools are pushed onto the live array the agent loop reads each
591
- * turn, so background-connected servers become available on the next prompt.
592
- */
593
- private connectMcpServers;
594
- /**
595
- * The user added, changed or removed one MCP server mid-session: connect,
596
- * reconnect or drop just that server, without a restart. `config` is its
597
- * current effective config, or undefined when it is gone (or not allowed).
598
- *
599
- * Append-only for the prompt cache: new tools go into the tool_search
600
- * catalog (or are appended when deferral is off), and the model learns about
601
- * the change from a hidden note with the next message, never from a
602
- * re-rendered system prompt. Returns null when nothing changed here.
603
- */
604
- applyMcpServerChange(name: string, config: MCPServerConfig | undefined): Promise<McpServerChange | null>;
605
- private takeMcpNotice;
606
- /** Persist `cwd` as a trusted project for project-scope MCP. Called by the
607
- * sidecar's `/mcp/add` handler when a user adds a project-scope server via
608
- * the MCP modal — the explicit add is itself the trust signal. The next
609
- * session load connects its `.gg/mcp.json` servers. */
610
- trustProject(cwd: string): Promise<void>;
611
- /**
612
- * Route freshly connected MCP tools: deferred into the tool_search catalog
613
- * (default — keeps ~8k tokens of schema out of every cache-miss turn) or
614
- * pushed eagerly when the user opted out.
615
- * Allow-listed sessions (Ken) always get the eager path — their fixed tool
616
- * expectations predate the catalog, and tool_search isn't allow-listed.
617
- */
618
- private addMcpTools;
619
- /**
620
- * Deferred follow-up tools whose need is certain once a trigger succeeds.
621
- * `wait_agent` follows nearly every `spawn_agent`, and loading it through
622
- * `tool_search` cost a whole turn (bench 41: ~6 s per fan-out). Likewise a
623
- * background `bash` is always followed by `task_output` (and sometimes
624
- * `task_send`/`task_stop`). Promote them as soon as the trigger succeeds: the
625
- * tool list grows exactly as it would after that `tool_search`, one turn
626
- * earlier, and sessions that never trigger keep the smaller prefix.
627
- * Call before tier partitioning so a deferred trigger is wrapped too.
628
- */
629
- private promoteFollowUpTools;
630
- /**
631
- * Whether provider-native web search rides along with this request.
632
- *
633
- * Anthropic's `web_search_20250305` server tool costs ~2.5k prefix tokens on
634
- * every request (count_tokens: 6,628 vs 4,098 for the GG prefix without it),
635
- * yet web search is reached in ~6% of sessions — the reason the client tool
636
- * is deferred everywhere else. So on a tiered Anthropic session it is only
637
- * attached once the model has promoted `web_search` (tool_search or a direct
638
- * call). The server tool is appended last, so the tool block stays
639
- * append-only. Untiered sessions and other providers keep it always on.
640
- */
641
- private nativeWebSearchOn;
642
- /**
643
- * A human prompt that plainly asks for the web gets native web search from
644
- * its first request. Without this, an on-demand web_search costs an extra
645
- * round trip (tool_search or a client search) before the native tool is
646
- * attached — slower than the always-on tool it replaced for exactly the
647
- * sessions that need it. Conservative on purpose: a miss only costs that
648
- * one discovery turn, a false hit only the ~2.5k-token schema.
649
- */
650
- private attachWebSearchIfAsked;
651
- private runSideWebSearch;
652
- private maybeCompactPreRun;
653
- private compactionTransport;
654
- /** One run on the Claude subscription route: Claude Code drives the loop with our prompt and tools. */
655
- private runClaudeCodeLoop;
656
- /**
657
- * The Claude Code process for this run: the chat's live one when it holds
658
- * exactly our history with the same settings, else a new one (the old one is
659
- * closed first, so a chat never keeps two).
660
- */
661
- private claudeCodeLiveFor;
662
- private closeClaudeCodeLive;
663
- private recordClaudeCodeSession;
664
- /** Claude Code settings when this session runs on a Claude subscription, else null. */
665
- private claudeCodeProcess;
666
- /** Append a deferred built-in to the live tool list (append-only). */
667
- private promoteDeferredBuiltin;
668
- private reloadUsedTools;
669
- private wrapToPromote;
670
- /**
671
- * Publish cached tool definitions into the deferred catalog so `tool_search`
672
- * answers correctly on turn 1 (see {@link McpToolRegistry.seedFromCache}).
673
- */
674
- private seedMcpCatalogFromCache;
675
- /**
676
- * Resolve a `/name [args]` input to the prompt template it expands into, or
677
- * null when it isn't a prompt-template command for THIS session (an ordinary
678
- * message, a registry/action command, or any slash input on a non-coder
679
- * agent). Shared by {@link prompt} and {@link willExpandPromptTemplate} so
680
- * callers can't drift from the expansion that actually happens.
681
- */
682
- private resolveSlashInput;
683
- /**
684
- * Whether {@link prompt} would expand this input into a template body and
685
- * persist it as a user message. Hosts use it to record the typed `/name` for
686
- * transcript restore — gating on anything looser risks tagging an unrelated
687
- * message when the command turns out NOT to expand.
688
- */
689
- willExpandPromptTemplate(content: string): Promise<boolean>;
690
- /**
691
- * Process user input. Handles slash commands or runs agent loop.
692
- * `capThinking` holds reasoning effort at the plan-mode ceiling for this
693
- * prompt — for turns that must answer quickly from what is already known.
694
- */
695
- prompt(content: string, provenance?: MessageProvenance, options?: PromptRunOptions): Promise<void>;
696
- /**
697
- * Prompt with multimodal attachments (images / videos) alongside optional
698
- * text. Images and videos become native content blocks the model can see;
699
- * non-media files are surfaced as a text note with their saved path so the
700
- * agent can open them with its tools. Slash-command parsing is skipped —
701
- * attachments are always a direct conversational turn.
702
- */
703
- promptWithAttachments(text: string, attachments: SessionAttachment[]): Promise<void>;
704
- /** A typed reply's attachments as blocks for the question it answers (ask_user). */
705
- askReplyAttachmentParts(attachments: SessionAttachment[]): Array<TextContent | ImageContent | VideoContent>;
706
- /**
707
- * Build the native content blocks (text + image/video notes + file notes) for
708
- * a user message with attachments. Shared by {@link promptWithAttachments} and
709
- * the mid-run steering drain so queued media is delivered identically.
710
- */
711
- private buildAttachmentParts;
712
- /**
713
- * Reset per-run self-correction hook state. Mirrors the TUI's run_start
714
- * resets so each run evaluates the hooks from a clean slate. `originalRequest`
715
- * is the verbatim user ask, pinned for post-compaction re-grounding.
716
- */
717
- private resetHookState;
718
- /** The context was just summarized: arm a fresh re-ground note, even if one already ran this run. */
719
- private markCompacted;
720
- /**
721
- * Fold one agent event into the hook stat accumulators. Pure bookkeeping —
722
- * the same signals the TUI's useAgentLoop collects, so loop-break decisions
723
- * match across the CLI and the app.
724
- */
725
- private trackHookEvent;
726
- /** Drop delivered queued messages and announce the new queue depth. */
727
- private settleDeliveredMessages;
728
- /**
729
- * Count full-file `cat` output from the step that just finished as reads, so
730
- * an edit after `cat` does not cost a second read. Uses the step's results as
731
- * stored in the transcript (after per-turn trimming): only bytes the model
732
- * actually received count.
733
- */
734
- private creditBashReads;
735
- /**
736
- * Append every message added since the last flush to the session file.
737
- *
738
- * Safe to call mid-run: `agentLoop` mutates its message array in place, so
739
- * the slice from `lastPersistedIndex` is always exactly the new tail.
740
- * Transient sessions (subagent spawns) have no session file and
741
- * `persistMessage` no-ops for them.
742
- *
743
- * Persistence failures must never take down a live run — the post-loop flush
744
- * retries the same range.
745
- */
746
- private flushPendingMessages;
747
- /**
748
- * Mid-loop steering hook: delivers pushed notifications and queued user
749
- * steering, fires the loop-breaker when the agent looks stuck, then
750
- * post-compaction re-grounding. At most one loop-break/re-grounding per run.
751
- * Mirrors the TUI's getSteeringMessages ordering.
752
- */
753
- private getHookSteeringMessages;
754
- /** Fire the semantic loop judge when deterministic evidence is suspicious but
755
- * the deterministic breaker stayed quiet — the syntactic blind spot where
756
- * every retry differs slightly and the run still makes no progress.
757
- * Fire-and-forget: the call runs while the next turn streams, and a finished
758
- * verdict is consumed by the NEXT steering poll — never blocking a turn. */
759
- private maybeStartSemanticLoopCheck;
760
- /** Fresh image-only critique context, using the active transport and auth routing. */
761
- private callCompletionReviewer;
762
- /** One-shot judge call on the session's ACTIVE model — deliberately not a
763
- * cheaper routing: judging a model's own failure patterns with a weaker
764
- * model swaps false negatives for false positives. */
765
- private callSemanticLoopJudge;
766
- /**
767
- * Turn-budget extension gate. The loop consults this instead of stopping
768
- * mid-task when it exhausts `maxTurns`. Grant ONLY on evidence of progress —
769
- * handing more turns to a spinning agent just buys it more tokens to spin
770
- * with — so reuse the same stuck signals that drive the loop-breaker.
771
- */
772
- private shouldExtendTurnBudget;
773
- /** Would a stop right now inject a pre-final follow-up? Only queued LSP
774
- * diagnostics (real errors injected below) or a mode-owned completion
775
- * review can, so clients hold the candidate answer only then. */
776
- private wouldInjectBeforeFinal;
777
- /** Broadcast pre-final hook arming on change. Both edges matter: armed=false
778
- * after the hook fires is what lets a client stream the final answer live
779
- * again. Callable before `initialize()`, when no manager exists yet. */
780
- private refreshHookArming;
781
- /**
782
- * Pre-stop follow-ups: LSP errors, unread child agents and background
783
- * processes, and a mode-owned completion review. Verification evidence is
784
- * tracked passively for run status; it never forces another turn.
785
- */
786
- private getHookFollowUpMessages;
787
- /**
788
- * The model often runs its tests inside a longer command (`npm test 2>&1 |
789
- * tail; node -e '…'`) whose exit status belongs to a later part, so the
790
- * tests can pass without counting. When the turn would end unverified that
791
- * way, run that check once more on its own, through the same bash tool, and
792
- * record its real exit status. No model turn and nothing in the transcript:
793
- * only the run's verification status changes.
794
- */
795
- private rerunRefusedCheck;
796
- /** Wraps the real run: cancels an in-flight cache prewarm and tracks run
797
- * activity / last real request time for {@link prewarm}. */
798
- private runLoop;
799
- /** `opts.onRunActive`, never allowed to throw into the run. */
800
- private notifyRunActive;
801
- /** Auto-compact if needed, run agent loop with auth retry, and persist messages. */
802
- private runLoopInner;
803
- /**
804
- * Switch the session's model. A model that spends real money (Claude fast
805
- * mode bills usage credits) is refused unless `confirmPaid` carries the
806
- * user's explicit yes, so no caller can switch onto one by accident: every
807
- * path (app, CLI, editors, chat bridges, RPC) fails closed by default.
808
- */
809
- switchModel(provider: string, model: string, options?: {
810
- confirmPaid?: boolean;
811
- }): Promise<void>;
812
- /**
813
- * Record the switch as its own trailing message at the point it happened,
814
- * rather than by rewriting the system prompt. Two reasons: the system prompt
815
- * is the cached prefix and rewriting it costs a full cache write, and a
816
- * resumed transcript can only attribute output to the right model if the
817
- * switch sits in message order.
818
- *
819
- * Skipped before the conversation starts (nothing to disambiguate) and while
820
- * an assistant turn has unresolved tool calls, where inserting a user message
821
- * would break tool_use/tool_result pairing.
822
- */
823
- private appendModelSwitchNote;
824
- private adoptCompactionCheckpoint;
825
- /** Canonicalize a deferred restore before a new prompt can fork stale history. */
826
- private adoptDeferredCheckpointBeforePrompt;
827
- private persistCompactionCheckpoint;
828
- /**
829
- * Wait out any in-flight post-turn background compaction before a new
830
- * entry point mutates `this.messages` (prompt, attachments, model switch).
831
- * The background compact() snapshots and then REPLACES the array, so a
832
- * message pushed while it runs would be silently dropped from the live
833
- * history — the pre-run await in runLoop() sits after the push and cannot
834
- * protect it.
835
- */
836
- private settlePostTurnCompaction;
837
- /**
838
- * Advance plan-step bookkeeping over the messages added since the last
839
- * observation and, when a plan step was newly completed (`[DONE:n]`), run
840
- * the SoL-Pi cost rule. Called between model steps (in-flight) and once
841
- * after the run; `scanIndex` and `doneSteps` make each message and each
842
- * step count once across both paths. Returns undefined when no step
843
- * completed since the last observation.
844
- */
845
- private observePlanStepProgress;
846
- /**
847
- * Plan-step bookkeeping after ANY successful compaction (as in the bench:
848
- * every compaction leaves a cache-write cost to be repaid by later savings).
849
- */
850
- private recordPlanStepCompaction;
851
- /**
852
- * Post-turn compaction: once the final response has been delivered, compact
853
- * in the background while the user reads the answer, instead of making the
854
- * next prompt pay the summarizer latency up front (the pre-run path stays as
855
- * the backstop, so a skipped or failed attempt costs nothing). Mirrors the
856
- * Codex `model_post_turn_compact_threshold_percent` guards: skip when user
857
- * input is already queued (it would race the next turn), when the run was
858
- * aborted, or during the failure cooldown — and never let a compaction
859
- * error surface in the completed turn. Besides the size trigger, a newly
860
- * completed approved-plan step may compact when the cache-cost rule in
861
- * compaction/plan-step-policy.ts says the shrink pays for itself.
862
- */
863
- private maybeCompactPostTurn;
864
- private withLiveAccessToken;
865
- compact(existingCredentials?: {
866
- accessToken: string;
867
- accountId?: string;
868
- baseUrl?: string;
869
- }, mode?: "manual" | "automatic" | "forced",
870
- /** User-stated focus (`/compact <focus>`): what must survive verbatim. */
871
- focus?: string,
872
- /** Extra abort source (post-turn compaction, cancelled by dispose). */
873
- abortSignal?: AbortSignal): Promise<void>;
874
- newSession(preserveConversation?: boolean): Promise<void>;
875
- loadSession(sessionPath: string): Promise<void>;
876
- /**
877
- * Create a branch at a specific point in the conversation.
878
- * Rewinds the message history to the given entry and sets the leaf
879
- * so new messages fork from that point.
880
- *
881
- * @param stepsBack Number of messages to rewind (default: 2 — backs up past last assistant + tool)
882
- */
883
- branch(stepsBack?: number): Promise<{
884
- branchedFrom: number;
885
- messagesKept: number;
886
- }>;
887
- /**
888
- * List all branches in the current session.
889
- */
890
- listBranches(): Promise<BranchInfo[]>;
891
- /** The session's first user-authored prompt, or "" before there is one. */
892
- getSessionPreview(): string;
893
- /**
894
- * Give the session a title of the user's choosing. Saved as a label entry
895
- * (the newest wins over the first prompt) and kept for any checkpoint this
896
- * session writes later.
897
- */
898
- renameSession(title: string): Promise<void>;
899
- /** Skills the safety scan kept out of this session, for the app/CLI to show. */
900
- getBlockedSkills(): readonly BlockedSkill[];
901
- /** Installed packages (project lockfiles) now known to be malware. */
902
- getInstalledThreats(): readonly InstalledThreat[];
903
- /**
904
- * Background check of the project's lockfiles for packages flagged as
905
- * malware after they were installed: shortly after start, after each daily
906
- * threat-feed update, and after a run that changed a lockfile. Never awaited
907
- * by anything; a new hit is shown to the user once (security_notice) and told
908
- * to the agent at its next turn. Off under vitest unless a test opts in.
909
- */
910
- private startInstalledPackageWatch;
911
- private rescanIfLockfilesChanged;
912
- /**
913
- * A guard refused a tool call: a lasting chat row (live event + persisted
914
- * marker, so a reopened session shows it too) and, for packages, an entry in
915
- * the project's "don't install" list. All fire-and-forget; never blocks.
916
- */
917
- private recordSafetyBlock;
918
- /**
919
- * One row per distinct block per run: an agent retrying the same blocked
920
- * install 30 times leaves one row, and a run hitting 100 blocks leaves at
921
- * most MAX_SECURITY_ROWS_PER_RUN (the session file stays small).
922
- */
923
- private emitSecurityRow;
924
- private recordBlockedList;
925
- /** Exposed for tests; safe to call any time (one scan at a time, never throws). */
926
- scanInstalledPackages(): Promise<void>;
927
- getState(): AgentSessionState;
928
- /**
929
- * Tokens currently in context and the window they are measured against.
930
- *
931
- * Uses the same accounting as the compaction decision: authoritative provider
932
- * usage when we have it (it includes the system prompt and tool schemas),
933
- * plus a local estimate of anything appended after that sample. A client
934
- * reading this right after a compaction sees the drop, because compaction
935
- * clears the retained provider sample along with the messages it measured.
936
- *
937
- * `costUsd` is present only when EVERY recorded turn has an authoritative
938
- * price; a partial sum would read as a full session cost and understate it.
939
- */
940
- getContextUsage(): {
941
- used: number;
942
- size: number;
943
- costUsd?: number;
944
- };
945
- /**
946
- * Whether the provider's prompt cache has likely lapsed since the last
947
- * successful request, and how many tokens the next message would re-read at
948
- * full price. Null when the route has no known TTL or the chat is empty.
949
- */
950
- getCacheExpiryStatus(now?: number): CacheExpiryStatus | null;
951
- getPlanMode(): boolean;
952
- /** Queue a user message (optionally with attachments) to be injected mid-run
953
- * as steering. Returns the new queue length. No-op semantics are the caller's
954
- * concern. */
955
- queueMessage(text: string, attachments?: SessionAttachment[], opts?: {
956
- answeredAsk?: boolean;
957
- }): number;
958
- /**
959
- * Hold the output of a command the user ran themselves (`!cmd` in the app)
960
- * so it reaches the agent with their next message: a prompt, or a message
961
- * queued as steering. Never on its own, and never mid-run without one.
962
- */
963
- addUserShellContext(runId: string, text: string): void;
964
- /** Run ids of user commands still waiting for the next message. */
965
- getPendingUserShellRunIds(): string[];
966
- private takeUserShellContext;
967
- /** Persist pending user command output just ahead of the human message. */
968
- private deliverUserShellContext;
969
- /** Pending queued messages (id + text), oldest first, for client display.
970
- * `delivering` ones are already with the agent and can no longer be cancelled. */
971
- listQueuedMessages(): Array<{
972
- id: string;
973
- text: string;
974
- delivering?: true;
975
- }>;
976
- /** Cancel one pending message by id. Returns true if it was still queued.
977
- * A false return is the normal race rather than an error: the message drained
978
- * into the run between the client rendering the cancel affordance and the
979
- * click arriving. */
980
- cancelQueuedMessage(id: string): boolean;
981
- /** Number of messages currently queued. */
982
- getQueuedCount(): number;
983
- /** Remove and return the oldest queued message (text + attachments), or null.
984
- * Used by the sidecar to run a message that queued while autopilot was
985
- * reviewing (no run in flight to steer it into) — unlike {@link drainQueue},
986
- * attachments survive so queued media isn't silently dropped. */
987
- takeNextQueuedMessage(): {
988
- text: string;
989
- attachments: SessionAttachment[];
990
- } | null;
991
- /** Clear the queue, returning the combined text (to restore to the composer).
992
- * Queued attachments are dropped on cancel — the composer only restores text. */
993
- drainQueue(): string;
994
- /**
995
- * Tell the agent a new fact at its next turn, as a short hidden message
996
- * appended after the cached prompt (the same channel as a finished worker),
997
- * so a mid-session change reaches it without re-rendering the prompt. A
998
- * later note with the same id replaces one not yet delivered.
999
- */
1000
- notify(id: string, text: string): void;
1001
- /**
1002
- * Observe urgent background alerts — a background task failed or exited
1003
- * non-zero, or a child agent finished — as they are queued. Hosts use this to
1004
- * wake an idle session (see {@link continueFromNotifications}); a live run
1005
- * already receives them at its next steering boundary. Returns unsubscribe.
1006
- */
1007
- onBackgroundAlert(listener: () => void): () => void;
1008
- /**
1009
- * Characters of the tool definitions sent with every request (name,
1010
- * description, JSON schema), for estimator calibration. Cached by tool count:
1011
- * the tool array is append-only.
1012
- */
1013
- private toolDefinitionChars;
1014
- /** True while an urgent background alert is waiting to be delivered. */
1015
- hasPendingBackgroundAlert(): boolean;
1016
- /** Monotonic count of human-originated prompts this session has run. */
1017
- getHumanPromptSeq(): number;
1018
- /**
1019
- * Start a run from pending background notifications, for a session that had
1020
- * already finished its turn. The notifications become one hidden runtime
1021
- * message (never shown as something the user typed), and the agent decides
1022
- * whether they need action. Returns false, starting nothing, when no urgent
1023
- * alert is pending — a live run may have delivered it in the meantime.
1024
- */
1025
- continueFromNotifications(): Promise<boolean>;
1026
- /** This session's sub-agents (workers), newest-state, including ones restored after a restart. */
1027
- listSubAgents(): SubAgentSnapshot[];
1028
- /** Snapshot of background processes (bash run_in_background), newest-state. */
1029
- listBackgroundProcesses(): BackgroundProcess[];
1030
- /**
1031
- * Start a background process on the host's behalf (a new worktree's setup),
1032
- * listed with the agent's own background tasks. Null without a process manager.
1033
- */
1034
- startBackgroundProcess(command: string, cwd?: string): Promise<{
1035
- id: string;
1036
- pid: number;
1037
- } | null>;
1038
- /** Stop a background process by id. Returns a human-readable status string. */
1039
- killBackgroundProcess(id: string): Promise<string>;
1040
- /**
1041
- * Force-stop every background process tree, synchronously. Background
1042
- * commands run in their own process group, so the daemon's group kill on
1043
- * quit never reaches them: this is the only thing that does. Callers on a
1044
- * shutdown deadline run it before awaiting anything that can hang.
1045
- */
1046
- stopBackgroundProcesses(): void;
1047
- /** Replace a host-owned system prompt in place without resetting conversation history. */
1048
- setCustomSystemPrompt(systemPrompt: string, promptCacheKeyPrefix?: string): void;
1049
- /**
1050
- * Toggle plan mode: flips the shared ref (so tools enforce read-only
1051
- * restrictions) and rebuilds the system prompt in place so the model is told
1052
- * about the mode change on its next turn. No-op when a custom system prompt
1053
- * is in force (the host owns the prompt then).
1054
- */
1055
- setPlanMode(active: boolean): Promise<void>;
1056
- /**
1057
- * Bake an approved plan into the system prompt so the model is told to emit
1058
- * `[DONE:n]` markers as it completes each step (the contract the UI's
1059
- * plan-progress widget reads). Pass `undefined` to clear it. No-op when a
1060
- * custom system prompt is in force (the host owns the prompt then).
1061
- */
1062
- setApprovedPlan(approvedPlanPath: string | undefined): Promise<void>;
1063
- /**
1064
- * Before the conversation starts, render plan state into the prompt. After,
1065
- * the prompt is a cached prefix: queue an appended notice instead, so the
1066
- * cached bytes stay identical (a rebuild re-sent the whole history).
1067
- */
1068
- private applyPlanStateChange;
1069
- /** The plan notice to append now, if any (pending, or a compacted-away one). */
1070
- private takePlanNotice;
1071
- /** Extra workspace roots added with `/add-dir`, in the order added. */
1072
- getAdditionalRoots(): string[];
1073
- /**
1074
- * The custom `.gg/commands` slash commands this session can run: the
1075
- * project's, then those of every added root (a goal's attached repos too).
1076
- * Read fresh, so a new command file is picked up without a restart.
1077
- */
1078
- loadCustomCommands(): Promise<CustomCommand[]>;
1079
- /**
1080
- * Add another workspace root. Tools already accept absolute paths, so this
1081
- * only widens the write guard and tells the model the root exists. Rebuilding
1082
- * the system prompt costs one cache-miss turn — the alternative (an uncached
1083
- * suffix) would drift from the tool behaviour it describes.
1084
- *
1085
- * @returns the resolved root, or an error message for the user.
1086
- */
1087
- addDirectory(dir: string): Promise<{
1088
- ok: true;
1089
- root: string;
1090
- } | {
1091
- ok: false;
1092
- error: string;
1093
- }>;
1094
- /** Remove an exact root previously added with `/add-dir`. */
1095
- removeDirectory(dir: string): Promise<{
1096
- ok: true;
1097
- root: string;
1098
- } | {
1099
- ok: false;
1100
- error: string;
1101
- }>;
1102
- /**
1103
- * Name a root change in the prompt only while there is no conversation yet.
1104
- * Mid-conversation the env-delta note tells the model instead: the roots sit
1105
- * in the Environment section, and rewriting it would invalidate every cached
1106
- * message after it (a goal attaching a folder re-sent ~75k tokens).
1107
- */
1108
- private refreshPromptForRoots;
1109
- /**
1110
- * Names to advertise as available-on-demand. A tool the model already
1111
- * promoted lives in `this.tools` and carries its own schema, so it drops out
1112
- * of the index rather than being listed twice.
1113
- */
1114
- private deferredToolNamesForPrompt;
1115
- /**
1116
- * The environment about to be rendered into a prompt, remembered as the
1117
- * truth the model has been told. Pairs with the env-delta hook: whatever the
1118
- * prompt states, the model is only corrected when reality moves away from it.
1119
- */
1120
- private recordRenderedEnvironment;
1121
- /** Environment facts that vary per session rather than per host. */
1122
- private promptEnvironment;
1123
- /**
1124
- * Build the stable system-prompt prefix for the current tool set and state.
1125
- *
1126
- * Three modes, in precedence order: a full replacement (`systemPrompt`), a
1127
- * composed sub-agent prompt (`agentPrompt` — agent body plus Tools, project
1128
- * context, return contract and Environment), or the standard prompt.
1129
- */
1130
- private buildBasePrompt;
1131
- /**
1132
- * Bring the system prompt to the exact state the next provider request will
1133
- * send. Shared by real runs and {@link prewarm} so both see one prefix.
1134
- *
1135
- * Languages are re-detected at each task boundary. Before the first reply
1136
- * nothing is cached worth keeping, so a new language simply rebuilds the
1137
- * prompt. After that the prompt is a cached prefix and is left alone: the
1138
- * new language is announced by {@link announceNewLanguages} instead.
1139
- */
1140
- private prepareSystemPromptForRequest;
1141
- private hasReply;
1142
- /**
1143
- * Give the model verify commands for languages that appeared after its prompt
1144
- * was cached (e.g. the previous task scaffolded a TypeScript project), as a
1145
- * hidden message appended to the history rather than a prompt re-render that
1146
- * would throw away the whole cache. Runs just before a new user message is
1147
- * added, so the user's request stays the last thing the model reads and the
1148
- * update is saved in order with the rest of the conversation.
1149
- */
1150
- private announceNewLanguages;
1151
- /**
1152
- * Whether this session renders language packs: the standard prompt, and a
1153
- * code-writing child (a sub-agent prompt with project context). A verbatim
1154
- * custom prompt never does, nor do user-facing specialist agents (Motion,
1155
- * goals) or recon children without project context.
1156
- */
1157
- private languagesApply;
1158
- /** Add newly detected project languages. Returns true when the set grew. */
1159
- private refreshActiveLanguages;
1160
- /** Rebuild messages[0] from current plan-mode + approved-plan state. */
1161
- private rebuildSystemPromptInPlace;
1162
- /**
1163
- * Compose the system message: stable prefix, then everything volatile behind
1164
- * the `<!-- uncached -->` marker that providers split on for cache control.
1165
- *
1166
- * Anything that varies with the live model/provider/thinking level belongs in
1167
- * the tail. Putting it in the prefix means every model switch rewrites cached
1168
- * bytes and the next turn pays a full cache write instead of a read.
1169
- */
1170
- private withSystemPromptTail;
1171
- /**
1172
- * Sol/Terra async-orchestration guidance for the CURRENT model and thinking
1173
- * level. Per-switch volatile by definition, so it is rendered as a tail part
1174
- * rather than spliced into the cached prefix.
1175
- */
1176
- private orchestrationPolicyTail;
1177
- /**
1178
- * Re-render the uncached tail of messages[0] in place. The cached prefix is
1179
- * byte-identical afterwards, so this is safe to call on every model /
1180
- * thinking-level change.
1181
- */
1182
- private refreshSystemPromptTail;
1183
- getMessages(): Message[];
1184
- getTurnMetrics(): TurnMetricPayload[];
1185
- private persistTurnMetric;
1186
- /** Ken Kai (mentor) turns recorded against this session, in record order. Used
1187
- * by the host to interleave Ken's advisory exchanges back into the transcript
1188
- * on resume. Never part of the LLM message history. */
1189
- getKenTurns(): KenTurnPayload[];
1190
- /** Autopilot verdict markers recorded against this session, in record order.
1191
- * Used by the host to interleave the auto-review loop's markers back into
1192
- * the transcript on resume, mirroring `getKenTurns`. */
1193
- getAutopilotMarkers(): AutopilotMarkerPayload[];
1194
- /** Non-system messages that are actually on disk. Transcript markers anchor
1195
- * against this (not the in-memory list, which can run ahead after a failed
1196
- * run), so hosts computing marker-derived values must use the same base. */
1197
- getPersistedTranscriptCount(): number;
1198
- /**
1199
- * Rebase every transcript anchor (Ken turns, autopilot verdicts, app markers)
1200
- * onto a freshly compacted message list. Called right after `this.messages`
1201
- * is replaced and before the markers are re-persisted into the continuation
1202
- * file, so the new file carries positions that match its own transcript.
1203
- */
1204
- private remapMarkerAnchors;
1205
- /**
1206
- * Record one Ken Kai (mentor agent) turn against this build session: the
1207
- * user's question + Ken's reply. Kept in memory for the live transcript and
1208
- * persisted as a `custom` entry (parentId null, so it's never on the message
1209
- * DAG and never seen by the LLM, and can't race the build session's leaf while
1210
- * Ken runs concurrently). `afterMessageCount` anchors it among the messages so
1211
- * the host can interleave it chronologically. No-op persistence for transient
1212
- * sessions (kept in memory only). Best-effort: a write failure is swallowed by
1213
- * appendEntry's own handling.
1214
- */
1215
- persistKenTurn(question: string, reply: string): Promise<void>;
1216
- /**
1217
- * Record one autopilot verdict marker (prompted / done / human / capped)
1218
- * against this build session. Kept in memory for the live transcript and
1219
- * persisted as a `custom` entry (parentId null, same as Ken turns) so a
1220
- * resumed session renders the exact same Ken bubble the live run showed
1221
- * instead of dropping the marker or falling back to a raw verdict string.
1222
- * No-op persistence for transient sessions (kept in memory only).
1223
- */
1224
- getVerificationEvidence(): VerificationEvidence[];
1225
- /** Current request activity, separate from persistent workspace verification debt. */
1226
- getRunVerificationActivity(): {
1227
- changed: boolean;
1228
- checked: boolean;
1229
- evidence: VerificationEvidence[];
1230
- };
1231
- getVerificationProblem(): string | null;
1232
- private persistCompletionReviewState;
1233
- /**
1234
- * A chat row saying where this conversation now works ("Opened on branch x in
1235
- * its own worktree"), live and on every later restore of the transcript.
1236
- */
1237
- noteCheckout(text: string): void;
1238
- /** The branch and checkout this conversation last recorded, or null. */
1239
- getCheckoutRecord(): CheckoutRecord | null;
1240
- /**
1241
- * Remember the branch this conversation is on, so resuming it later opens
1242
- * that branch (see core/checkout-record.ts). Unchanged records write nothing.
1243
- */
1244
- recordCheckout(record: CheckoutRecord): Promise<void>;
1245
- private persistCheckoutRecord;
1246
- private persistVerificationState;
1247
- persistAutopilotMarker(phase: AutopilotMarkerPayload["phase"], extra?: {
1248
- reason?: string;
1249
- body?: string;
1250
- }): Promise<void>;
1251
- /** App transcript markers recorded against this session, in record order.
1252
- * Used by the host to interleave display-only rows (plan banner, task
1253
- * header, errors, user-bubble hints) back into the transcript on resume. */
1254
- getAppMarkers(): AppMarkerPayload[];
1255
- /**
1256
- * Record one app transcript marker (display-only row) against this session.
1257
- * Same treatment as autopilot markers: kept in memory for the live
1258
- * transcript, persisted as a `custom` entry (parentId null, never on the
1259
- * message DAG) so a resumed session shows the identical row. `anchorOffset`
1260
- * shifts the recorded `afterMessageCount` — pass +1 for a marker that should
1261
- * attach to the user message about to be pushed by the imminent prompt.
1262
- * No-op persistence for transient sessions.
1263
- */
1264
- persistAppMarker(kind: AppMarkerPayload["kind"], data: Record<string, unknown>, anchorOffset?: number): Promise<void>;
1265
- /**
1266
- * Open the run journal for one `RunLifecycle` generation.
1267
- *
1268
- * Never throws and never blocks the run: a session with no file (transient
1269
- * children) writes nothing, and a write failure just means the run isn't
1270
- * journalled — which is strictly better than failing the run over it.
1271
- */
1272
- persistRunStarted(generation: number): Promise<void>;
1273
- /** Close the run journal. Its absence is what marks a run as crashed. */
1274
- persistRunFinished(generation: number, outcome: RunOutcome): Promise<void>;
1275
- /**
1276
- * Rewrite a draft prompt into a tighter, terminology-correct version using
1277
- * the ACTIVE provider/model. A stateless one-off LLM call (no agent loop, no
1278
- * tools, no session mutation) — safe to run even mid-run. Returns the plain
1279
- * enhanced text plus typed segments marking each corrected term. Errors throw
1280
- * so the caller can surface them.
1281
- */
1282
- enhancePrompt(text: string): Promise<EnhanceResult>;
1283
- /** Current reasoning/thinking level, or undefined when thinking is off. */
1284
- getThinkingLevel(): ThinkingLevel | undefined;
1285
- /** Set the reasoning/thinking level (undefined turns thinking off). Takes
1286
- * effect on the next prompt, since the in-flight loop reads it at start. */
1287
- setThinkingLevel(level: ThinkingLevel | undefined): void;
1288
- /** Replace the abort signal (e.g. after cancellation). */
1289
- setSignal(signal: AbortSignal): void;
1290
- private bindManagerCancellation;
1291
- private runLoopDepth;
1292
- private lastRealRequestAt;
1293
- private lastPrewarmAt;
1294
- /** Last connection pre-open per provider origin (see {@link preconnect}). */
1295
- private readonly preconnectedAt;
1296
- /**
1297
- * Fire-and-forget: open the TLS connection to the active provider before the
1298
- * first request, through the shared keep-alive pool. Zero tokens — an
1299
- * unauthenticated HEAD; skipped for local endpoints and throttled per origin.
1300
- * Transient sessions (one-shot tools) and test runs never touch the network here.
1301
- */
1302
- private preconnect;
1303
- private prewarmController;
1304
- /** Claude Code session that has seen this history (Claude subscription route). */
1305
- private claudeCodeSession;
1306
- private releaseClaudeCodeTranscript;
1307
- /** Keep the retention pass off the transcript this chat would resume. */
1308
- private holdClaudeCodeTranscript;
1309
- /** This chat's running Claude Code process, reused while `key` (its start settings) matches. */
1310
- private claudeCodeLive;
1311
- /**
1312
- * Context size between runs: the last provider usage plus messages appended
1313
- * after it, or undefined when there is no usable sample (callers estimate).
1314
- * Same measurement the pre-run compaction check makes.
1315
- */
1316
- private idleActiveContextTokens;
1317
- /**
1318
- * Prune stale tool outputs in place once the context is big enough for the
1319
- * freed tokens to be worth a cache rewrite (a larger share on a warm cache,
1320
- * see pruneMinimumTokens). In-place mutation preserves usage anchors; the
1321
- * retained usage is dropped since it counted the pruned content. Shared by
1322
- * the in-flight context transform and prewarm so both send the same prefix.
1323
- * Returns the freed tokens (0 when nothing was pruned).
1324
- */
1325
- private pruneToolOutputsIfDue;
1326
- /**
1327
- * Mark where the last prune made history stable (`Message.cacheAnchor`), so
1328
- * the provider can keep a cache breakpoint there. Without it every prune on a
1329
- * 5-min route re-sent everything after the last entry the tail's lookback
1330
- * finds; in live sessions a prune freed ~24K tokens and re-wrote ~400K. gg-ai
1331
- * decides per route whether the hint is used (not on 1-h routes). Returns
1332
- * true when the anchor moved.
1333
- */
1334
- private applyPendingCacheAnchor;
1335
- /**
1336
- * Apply the next request's context policy before warming: report when its
1337
- * pre-run check will compact, otherwise prune now exactly as its first model
1338
- * step would. The cache is cold here (prewarm only runs once it has lapsed),
1339
- * so the prune uses the cold-cache floor, as the request would without the
1340
- * prewarm; afterwards the warm cache's larger floor keeps that request from
1341
- * pruning again. Prewarm is Anthropic-only, so the cached account id never
1342
- * changes the window.
1343
- */
1344
- private prepareContextForPrewarm;
1345
- /**
1346
- * Best-effort Anthropic prompt-cache prewarm before the user's next turn
1347
- * (desktop app calls this on the first keystroke after opening a chat or an
1348
- * idle pause). Sends the exact request prefix the next real turn will use —
1349
- * same system/tools/thinking/cache options — with `max_tokens: 1`, so the
1350
- * first real reply is a cache read instead of a cold write.
1351
- */
1352
- prewarm(signal?: AbortSignal): Promise<{
1353
- ok: boolean;
1354
- reason: string;
1355
- usage?: Usage;
1356
- }>;
1357
- private codexShapeSetting;
1358
- /** True when speedProfile is "optimized" (1-h cache TTL + pre-warm), or the
1359
- * session was constructed with `forceLongCacheRetention` (Ken sessions). */
1360
- private isSpeedOptimized;
1361
- /**
1362
- * Ordered auth-storage keys the current (provider, model) pair tries, first
1363
- * match wins. Almost always just the provider id; Xiaomi models can prefer
1364
- * one endpoint and fall back to another the user configured instead (e.g.
1365
- * every MiMo model prefers the Token Plan, falls back to API Credits).
1366
- */
1367
- private currentAuthStorageKeys;
1368
- private getPromptCacheKey;
1369
- /** Stable cache-routing key for downstream sub-agent processes. */
1370
- getCurrentCacheKey(): string | undefined;
1371
- dispose(): Promise<void>;
1372
- private setSessionPath;
1373
- private createNewSession;
1374
- private loadExistingSession;
1375
- /**
1376
- * Surface runs that died mid-flight, without resuming them.
1377
- *
1378
- * Deliberately NOT auto-resumed: the dead run's tools already wrote files,
1379
- * ran commands and made commits. Replaying it would duplicate those effects.
1380
- * The user gets a transcript row and decides.
1381
- *
1382
- * Each detected run is also closed as `aborted`, so reopening the session
1383
- * reports it once rather than on every load.
1384
- */
1385
- private recordInterruptedRuns;
1386
- private prepareDynamicContext;
1387
- private persistMessage;
1388
- private createSlashCommandContext;
1389
- /**
1390
- * Import a Claude Code / Codex / Cursor transcript as a resumable GG Coder
1391
- * session in this session's sessions directory. Never throws — a bad path or
1392
- * an unrecognized format comes back as `{ ok: false, error }` so both the CLI
1393
- * and the desktop app can show it verbatim.
1394
- */
1395
- importForeignTranscript(filePath: string, opts?: {
1396
- cwd?: string;
1397
- }): Promise<ImportForeignTranscriptResult>;
1398
- }