@pellux/goodvibes-agent 1.1.7 → 1.3.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 (274) hide show
  1. package/CHANGELOG.md +329 -0
  2. package/README.md +46 -30
  3. package/dist/package/{ast-grep-napi.linux-x64-gnu-mkk8xwww.node → ast-grep-napi.linux-x64-gnu-swtppvy9.node} +0 -0
  4. package/dist/package/{ast-grep-napi.linux-x64-musl-ryqtgdv6.node → ast-grep-napi.linux-x64-musl-ttfcdtap.node} +0 -0
  5. package/dist/package/main.js +138903 -91477
  6. package/docs/README.md +14 -7
  7. package/docs/channels-remote-and-api.md +8 -5
  8. package/docs/connected-host.md +14 -12
  9. package/docs/getting-started.md +58 -30
  10. package/docs/knowledge-artifacts-and-multimodal.md +7 -5
  11. package/docs/project-planning.md +2 -2
  12. package/docs/providers-and-routing.md +11 -3
  13. package/docs/tools-and-commands.md +116 -45
  14. package/docs/voice-and-live-tts.md +3 -1
  15. package/package.json +3 -2
  16. package/release/release-notes.md +142 -5
  17. package/release/release-readiness.json +124 -94
  18. package/src/agent/assistant-cockpit.ts +247 -0
  19. package/src/agent/autonomy-schedule-format.ts +96 -0
  20. package/src/agent/autonomy-schedule.ts +514 -0
  21. package/src/agent/channel-delivery-receipts.ts +292 -0
  22. package/src/agent/competitive-feature-inventory.ts +294 -0
  23. package/src/agent/document-registry-types.ts +106 -0
  24. package/src/agent/document-registry.ts +734 -0
  25. package/src/agent/harness-control.ts +2 -2
  26. package/src/agent/memory-prompt.ts +2 -2
  27. package/src/agent/operator-actions.ts +50 -6
  28. package/src/agent/persona-registry.ts +8 -0
  29. package/src/agent/project-context-files.ts +273 -0
  30. package/src/agent/prompt-context-receipts.ts +502 -0
  31. package/src/agent/reminder-schedule-format.ts +16 -2
  32. package/src/agent/research-run-registry.ts +582 -0
  33. package/src/agent/research-source-registry.ts +441 -0
  34. package/src/agent/routine-registry.ts +19 -3
  35. package/src/agent/routine-schedule-format.ts +27 -2
  36. package/src/agent/runtime-profile-starters.ts +7 -0
  37. package/src/agent/runtime-profile.ts +106 -4
  38. package/src/agent/schedule-edit-format.ts +129 -0
  39. package/src/agent/schedule-edit.ts +496 -0
  40. package/src/agent/schedule-next-routes.ts +42 -0
  41. package/src/agent/setup-wizard-artifact-receipts.ts +366 -0
  42. package/src/agent/setup-wizard-checkpoint.ts +140 -0
  43. package/src/agent/setup-wizard.ts +683 -0
  44. package/src/agent/skill-registry-types.ts +102 -0
  45. package/src/agent/skill-registry.ts +81 -107
  46. package/src/agent/vibe-confirmation-routes.ts +62 -0
  47. package/src/agent/vibe-file.ts +285 -0
  48. package/src/cli/agent-knowledge-command.ts +45 -2
  49. package/src/cli/help.ts +3 -0
  50. package/src/cli/profiles-command.ts +25 -11
  51. package/src/config/agent-settings-policy.ts +1 -18
  52. package/src/input/agent-workspace-activation.ts +53 -0
  53. package/src/input/agent-workspace-artifact-browser-editor.ts +494 -0
  54. package/src/input/agent-workspace-artifact-metadata.ts +17 -0
  55. package/src/input/agent-workspace-basic-command-editors.ts +5 -1
  56. package/src/input/agent-workspace-categories.ts +153 -155
  57. package/src/input/agent-workspace-channel-triage.ts +481 -0
  58. package/src/input/agent-workspace-channels.ts +263 -0
  59. package/src/input/agent-workspace-command-editor.ts +152 -0
  60. package/src/input/agent-workspace-context-snapshot.ts +349 -0
  61. package/src/input/agent-workspace-delegation-editor-submission.ts +8 -0
  62. package/src/input/agent-workspace-document-editor.ts +502 -0
  63. package/src/input/agent-workspace-document-ops-editor.ts +523 -0
  64. package/src/input/agent-workspace-host-category.ts +1 -1
  65. package/src/input/agent-workspace-local-library-snapshot.ts +167 -0
  66. package/src/input/agent-workspace-model-compare-editor.ts +376 -0
  67. package/src/input/agent-workspace-model-compare-prompt-submission.ts +552 -0
  68. package/src/input/agent-workspace-model-compare-types.ts +82 -0
  69. package/src/input/agent-workspace-model-compare-utils.ts +35 -0
  70. package/src/input/agent-workspace-onboarding-categories.ts +141 -0
  71. package/src/input/agent-workspace-operations-command-editor-submission.ts +53 -0
  72. package/src/input/agent-workspace-operations-command-editors.ts +22 -0
  73. package/src/input/agent-workspace-research-report-editor.ts +212 -0
  74. package/src/input/agent-workspace-research-run-editor.ts +144 -0
  75. package/src/input/agent-workspace-research-source-editor.ts +167 -0
  76. package/src/input/agent-workspace-review-packet-snapshot.ts +593 -0
  77. package/src/input/agent-workspace-review-packet-utils.ts +265 -0
  78. package/src/input/agent-workspace-settings.ts +313 -30
  79. package/src/input/agent-workspace-setup-checkpoint-action.ts +127 -0
  80. package/src/input/agent-workspace-setup-snapshot.ts +217 -0
  81. package/src/input/agent-workspace-setup.ts +61 -1
  82. package/src/input/agent-workspace-snapshot.ts +184 -149
  83. package/src/input/agent-workspace-types.ts +287 -2
  84. package/src/input/agent-workspace.ts +23 -1
  85. package/src/input/command-registry.ts +9 -2
  86. package/src/input/commands/agent-runtime-profile-runtime.ts +28 -13
  87. package/src/input/commands/channels-runtime.ts +102 -114
  88. package/src/input/commands/delegation-runtime.ts +87 -24
  89. package/src/input/commands/knowledge-browser-flags.ts +12 -0
  90. package/src/input/commands/knowledge.ts +28 -14
  91. package/src/input/commands/operator-actions-runtime.ts +6 -3
  92. package/src/input/commands/schedule-runtime.ts +71 -14
  93. package/src/input/commands/session-content.ts +2 -2
  94. package/src/input/commands/shell-core.ts +2 -0
  95. package/src/input/commands/vibe-runtime.ts +140 -0
  96. package/src/input/commands.ts +2 -0
  97. package/src/input/connected-host-routes.ts +123 -0
  98. package/src/input/settings-modal-types.ts +14 -0
  99. package/src/input/setup-wizard-live-receipts.ts +76 -0
  100. package/src/main.ts +15 -15
  101. package/src/panels/qr-panel.ts +2 -2
  102. package/src/renderer/agent-workspace-context-lines.ts +701 -0
  103. package/src/renderer/agent-workspace.ts +68 -421
  104. package/src/renderer/settings-modal-helpers.ts +12 -0
  105. package/src/renderer/settings-modal.ts +12 -0
  106. package/src/runtime/bootstrap-command-context.ts +11 -1
  107. package/src/runtime/bootstrap-command-parts.ts +14 -3
  108. package/src/runtime/bootstrap-core.ts +39 -1
  109. package/src/runtime/bootstrap-shell.ts +6 -0
  110. package/src/runtime/bootstrap.ts +113 -30
  111. package/src/runtime/connected-host-auth.ts +3 -2
  112. package/src/runtime/execution-ledger.ts +231 -0
  113. package/src/runtime/services.ts +88 -10
  114. package/src/runtime/tool-permission-safety.ts +199 -5
  115. package/src/shell/session-continuity-hints.ts +39 -0
  116. package/src/tools/agent-artifacts-tool.ts +606 -0
  117. package/src/tools/agent-audit-tool.ts +155 -0
  118. package/src/tools/agent-autonomy-schedule-tool.ts +238 -0
  119. package/src/tools/agent-autonomy-tool.ts +140 -0
  120. package/src/tools/agent-channel-send-tool.ts +24 -2
  121. package/src/tools/agent-channels-tool.ts +140 -0
  122. package/src/tools/agent-computer-tool.ts +168 -0
  123. package/src/tools/agent-context-policy.ts +137 -7
  124. package/src/tools/agent-context-tool.ts +143 -0
  125. package/src/tools/agent-delegation-tool.ts +128 -0
  126. package/src/tools/agent-device-tool.ts +240 -0
  127. package/src/tools/agent-documents-tool.ts +684 -0
  128. package/src/tools/agent-execution-tool.ts +230 -0
  129. package/src/tools/agent-harness-agent-orchestration-policy.ts +75 -0
  130. package/src/tools/agent-harness-agent-orchestration.ts +791 -0
  131. package/src/tools/agent-harness-autonomy-intake.ts +785 -0
  132. package/src/tools/agent-harness-autonomy-live-records.ts +742 -0
  133. package/src/tools/agent-harness-autonomy-queue-types.ts +88 -0
  134. package/src/tools/agent-harness-autonomy-queue.ts +571 -0
  135. package/src/tools/agent-harness-autonomy-watcher-read-models.ts +509 -0
  136. package/src/tools/agent-harness-background-processes-types.ts +35 -0
  137. package/src/tools/agent-harness-background-processes.ts +798 -0
  138. package/src/tools/agent-harness-browser-cockpit-route.ts +373 -0
  139. package/src/tools/agent-harness-browser-control.ts +346 -0
  140. package/src/tools/agent-harness-browser-pwa-read-models.ts +622 -0
  141. package/src/tools/agent-harness-channel-metadata.ts +168 -10
  142. package/src/tools/agent-harness-cli-command-policy.ts +110 -0
  143. package/src/tools/agent-harness-command-catalog.ts +4 -2
  144. package/src/tools/agent-harness-command-runner.ts +42 -0
  145. package/src/tools/agent-harness-connected-host-status.ts +7 -4
  146. package/src/tools/agent-harness-delegation-posture.ts +234 -19
  147. package/src/tools/agent-harness-device-live-read-models.ts +366 -0
  148. package/src/tools/agent-harness-document-ops-reviewer-readiness.ts +234 -0
  149. package/src/tools/agent-harness-document-ops-types.ts +72 -0
  150. package/src/tools/agent-harness-document-ops.ts +671 -0
  151. package/src/tools/agent-harness-execution-history.ts +489 -0
  152. package/src/tools/agent-harness-execution-posture.ts +385 -0
  153. package/src/tools/agent-harness-file-recovery.ts +135 -0
  154. package/src/tools/agent-harness-interactive-runtime-records.ts +421 -0
  155. package/src/tools/agent-harness-keybinding-metadata.ts +16 -12
  156. package/src/tools/agent-harness-learning-curator-common.ts +102 -0
  157. package/src/tools/agent-harness-learning-curator-consolidation.ts +295 -0
  158. package/src/tools/agent-harness-learning-curator-proposals.ts +606 -0
  159. package/src/tools/agent-harness-learning-curator-types.ts +151 -0
  160. package/src/tools/agent-harness-learning-curator.ts +417 -0
  161. package/src/tools/agent-harness-local-model-benchmarks.ts +269 -0
  162. package/src/tools/agent-harness-local-model-cookbook.ts +238 -0
  163. package/src/tools/agent-harness-local-model-endpoints.ts +788 -0
  164. package/src/tools/agent-harness-local-model-smoke.ts +277 -0
  165. package/src/tools/agent-harness-local-model-url.ts +78 -0
  166. package/src/tools/agent-harness-media-posture.ts +223 -2
  167. package/src/tools/agent-harness-memory-external-providers.ts +796 -0
  168. package/src/tools/agent-harness-memory-posture.ts +672 -0
  169. package/src/tools/agent-harness-memory-provider-certification.ts +219 -0
  170. package/src/tools/agent-harness-memory-refinement.ts +340 -0
  171. package/src/tools/agent-harness-metadata.ts +100 -168
  172. package/src/tools/agent-harness-mode-catalog.ts +86 -33
  173. package/src/tools/agent-harness-model-catalog.ts +162 -0
  174. package/src/tools/agent-harness-model-provider-health.ts +283 -0
  175. package/src/tools/agent-harness-model-readiness.ts +432 -0
  176. package/src/tools/agent-harness-model-routing-types.ts +327 -0
  177. package/src/tools/agent-harness-model-routing-utils.ts +30 -0
  178. package/src/tools/agent-harness-model-routing.ts +165 -193
  179. package/src/tools/agent-harness-operator-methods.ts +115 -133
  180. package/src/tools/agent-harness-pairing-posture.ts +452 -18
  181. package/src/tools/agent-harness-personal-ops-certification.ts +116 -0
  182. package/src/tools/agent-harness-personal-ops-discovery.ts +533 -0
  183. package/src/tools/agent-harness-personal-ops-intake.ts +385 -0
  184. package/src/tools/agent-harness-personal-ops-lanes.ts +270 -0
  185. package/src/tools/agent-harness-personal-ops-operations.ts +225 -0
  186. package/src/tools/agent-harness-personal-ops-provider-records.ts +358 -0
  187. package/src/tools/agent-harness-personal-ops-provider-task-records.ts +321 -0
  188. package/src/tools/agent-harness-personal-ops-records.ts +684 -0
  189. package/src/tools/agent-harness-personal-ops-runner.ts +637 -0
  190. package/src/tools/agent-harness-personal-ops-types.ts +240 -0
  191. package/src/tools/agent-harness-personal-ops.ts +613 -0
  192. package/src/tools/agent-harness-project-context.ts +144 -0
  193. package/src/tools/agent-harness-prompt-context.ts +589 -0
  194. package/src/tools/agent-harness-provider-account-metadata.ts +2 -2
  195. package/src/tools/agent-harness-release-evidence.ts +9 -7
  196. package/src/tools/agent-harness-release-readiness.ts +9 -7
  197. package/src/tools/agent-harness-remote-read-models.ts +541 -0
  198. package/src/tools/agent-harness-research-briefing.ts +446 -0
  199. package/src/tools/agent-harness-research-live-read-models.ts +500 -0
  200. package/src/tools/agent-harness-research-queue.ts +250 -0
  201. package/src/tools/agent-harness-research-runs.ts +307 -0
  202. package/src/tools/agent-harness-research-workflow.ts +395 -0
  203. package/src/tools/agent-harness-security-posture.ts +2 -2
  204. package/src/tools/agent-harness-service-posture.ts +9 -9
  205. package/src/tools/agent-harness-session-metadata.ts +3 -3
  206. package/src/tools/agent-harness-setup-connected-host.ts +501 -0
  207. package/src/tools/agent-harness-setup-describe.ts +557 -0
  208. package/src/tools/agent-harness-setup-handoffs.ts +502 -0
  209. package/src/tools/agent-harness-setup-model-helpers.ts +102 -0
  210. package/src/tools/agent-harness-setup-plan.ts +253 -0
  211. package/src/tools/agent-harness-setup-posture-types.ts +218 -0
  212. package/src/tools/agent-harness-setup-posture-utils.ts +173 -0
  213. package/src/tools/agent-harness-setup-posture.ts +449 -221
  214. package/src/tools/agent-harness-setup-smoke.ts +533 -0
  215. package/src/tools/agent-harness-sudo-posture.ts +114 -0
  216. package/src/tools/agent-harness-tool-schema.ts +142 -7
  217. package/src/tools/agent-harness-tool-types.ts +83 -0
  218. package/src/tools/agent-harness-tool-utils.ts +43 -0
  219. package/src/tools/agent-harness-tool.ts +319 -370
  220. package/src/tools/agent-harness-ui-surface-metadata.ts +76 -69
  221. package/src/tools/agent-harness-ui-surface-types.ts +46 -0
  222. package/src/tools/agent-harness-vibe-health.ts +105 -0
  223. package/src/tools/agent-harness-workspace-action-runner.ts +149 -0
  224. package/src/tools/agent-harness-workspace-actions.ts +114 -8
  225. package/src/tools/agent-harness-workspace-editor-execution.ts +214 -0
  226. package/src/tools/agent-harness-workspace-editor-runner.ts +755 -0
  227. package/src/tools/agent-host-tool.ts +159 -0
  228. package/src/tools/agent-knowledge-ingest-tool.ts +34 -1
  229. package/src/tools/agent-learning-consolidation-core.ts +327 -0
  230. package/src/tools/agent-learning-consolidation-tool.ts +758 -0
  231. package/src/tools/agent-memory-tool.ts +253 -0
  232. package/src/tools/agent-model-compare-export.ts +315 -0
  233. package/src/tools/agent-model-compare-handoff.ts +592 -0
  234. package/src/tools/agent-model-compare-judgment.ts +633 -0
  235. package/src/tools/agent-model-compare-run.ts +735 -0
  236. package/src/tools/agent-model-compare-tool.ts +698 -0
  237. package/src/tools/agent-model-compare-types.ts +191 -0
  238. package/src/tools/agent-model-compare-utils.ts +93 -0
  239. package/src/tools/agent-models-tool.ts +208 -0
  240. package/src/tools/agent-operator-action-tool.ts +1 -1
  241. package/src/tools/agent-operator-method-tool.ts +643 -0
  242. package/src/tools/agent-personal-ops-tool.ts +197 -0
  243. package/src/tools/agent-policy-explanation.ts +415 -0
  244. package/src/tools/agent-research-report-tool.ts +608 -0
  245. package/src/tools/agent-research-runner.ts +367 -0
  246. package/src/tools/agent-research-runs-tool.ts +434 -0
  247. package/src/tools/agent-research-sources-tool.ts +443 -0
  248. package/src/tools/agent-research-tool.ts +515 -0
  249. package/src/tools/agent-review-packet-presets-core.ts +757 -0
  250. package/src/tools/agent-review-packet-presets-tool.ts +466 -0
  251. package/src/tools/agent-review-packet-share-tool.ts +305 -0
  252. package/src/tools/agent-route-planner-candidates-setup.ts +411 -0
  253. package/src/tools/agent-route-planner-candidates-surfaces.ts +432 -0
  254. package/src/tools/agent-route-planner-candidates-work.ts +251 -0
  255. package/src/tools/agent-route-planner-helpers.ts +667 -0
  256. package/src/tools/agent-route-planner.ts +185 -0
  257. package/src/tools/agent-route-tool.ts +105 -0
  258. package/src/tools/agent-schedule-edit-tool.ts +210 -0
  259. package/src/tools/agent-schedule-tool.ts +282 -0
  260. package/src/tools/agent-security-tool.ts +145 -0
  261. package/src/tools/agent-sessions-tool.ts +122 -0
  262. package/src/tools/agent-settings-import-tool.ts +104 -0
  263. package/src/tools/agent-settings-tool.ts +176 -0
  264. package/src/tools/agent-setup-tool.ts +226 -0
  265. package/src/tools/agent-support-tool.ts +122 -0
  266. package/src/tools/agent-terminal-process-tools.ts +167 -0
  267. package/src/tools/agent-tool-policy-guard-types.ts +77 -0
  268. package/src/tools/agent-tool-policy-guard.ts +106 -85
  269. package/src/tools/agent-vibe-tool.ts +297 -0
  270. package/src/tools/agent-work-plan-tool.ts +265 -6
  271. package/src/tools/agent-workspace-tool.ts +305 -0
  272. package/src/tools/artifact-archive.ts +169 -0
  273. package/src/tools/tool-definition-compaction.ts +36 -0
  274. package/src/version.ts +1 -1
@@ -10,6 +10,7 @@ import type { OpsApi } from '@/runtime/index.ts';
10
10
  import type { MutableRuntimeState } from '@/runtime/index.ts';
11
11
  import type { ProviderRegistry } from '@pellux/goodvibes-sdk/platform/providers';
12
12
  import type { CommandContext } from '../input/command-registry.ts';
13
+ import type { AgentPromptContextReceiptStore } from '../agent/prompt-context-receipts.ts';
13
14
  import type { KeybindingsManager } from '../input/keybindings.ts';
14
15
  import type { PermissionRequestHandler } from '@pellux/goodvibes-sdk/platform/permissions';
15
16
  import type { ToolRegistry } from '@pellux/goodvibes-sdk/platform/tools';
@@ -41,6 +42,7 @@ import type { VoiceProviderRegistry, VoiceService } from '@pellux/goodvibes-sdk/
41
42
  import type { MediaProviderRegistry } from '@pellux/goodvibes-sdk/platform/media';
42
43
  import type { ArtifactStore } from '@pellux/goodvibes-sdk/platform/artifacts';
43
44
  import type { ChannelDeliveryRouter } from '@pellux/goodvibes-sdk/platform/channels';
45
+ import type { AgentExecutionLedger } from './execution-ledger.ts';
44
46
  import {
45
47
  createBootstrapCommandActions,
46
48
  createBootstrapCommandClientsSection,
@@ -74,6 +76,8 @@ export type CreateBootstrapCommandContextOptions = {
74
76
  remoteRuntime?: RemoteCommandService;
75
77
  planRuntime?: PlanRuntimeService;
76
78
  fileUndoManager: FileUndoManager;
79
+ processManager?: import('@pellux/goodvibes-sdk/platform/tools').ProcessManager;
80
+ executionLedger?: AgentExecutionLedger;
77
81
  memoryRegistry?: MemoryRegistry;
78
82
  integrationHelpers?: IntegrationHelperService;
79
83
  automationManager?: ShellAutomationManagerRuntimeService;
@@ -107,6 +111,7 @@ export type CreateBootstrapCommandContextOptions = {
107
111
  operatorClient?: OperatorClient;
108
112
  peerClient?: PeerClient;
109
113
  agentKnowledgeApi?: KnowledgeApi;
114
+ promptContextReceipts?: AgentPromptContextReceiptStore;
110
115
  hookApi?: HookApi;
111
116
  mcpApi?: McpApi;
112
117
  opsApi?: OpsApi;
@@ -146,6 +151,8 @@ export function createBootstrapCommandContext(
146
151
  remoteRuntime,
147
152
  planRuntime,
148
153
  fileUndoManager,
154
+ processManager,
155
+ executionLedger,
149
156
  memoryRegistry,
150
157
  integrationHelpers,
151
158
  automationManager,
@@ -180,6 +187,7 @@ export function createBootstrapCommandContext(
180
187
  operatorClient,
181
188
  peerClient,
182
189
  agentKnowledgeApi,
190
+ promptContextReceipts,
183
191
  hookApi,
184
192
  mcpApi,
185
193
  opsApi,
@@ -240,6 +248,7 @@ export function createBootstrapCommandContext(
240
248
  keybindingsManager,
241
249
  fileUndoManager,
242
250
  panelManager,
251
+ processManager,
243
252
  profileManager,
244
253
  bookmarkManager,
245
254
  projectPlanningService,
@@ -255,6 +264,7 @@ export function createBootstrapCommandContext(
255
264
  operatorClient,
256
265
  peerClient,
257
266
  agentKnowledgeApi,
267
+ promptContextReceipts,
258
268
  providerApi,
259
269
  hookApi,
260
270
  mcpApi,
@@ -279,7 +289,7 @@ export function createBootstrapCommandContext(
279
289
  provider,
280
290
  workspace,
281
291
  platform,
282
- ops: createBootstrapCommandOpsSection(shellServices),
292
+ ops: createBootstrapCommandOpsSection(shellServices, { executionLedger }),
283
293
  extensions,
284
294
  clients,
285
295
  ...actions,
@@ -3,6 +3,7 @@ import type { ConfigManager } from '@pellux/goodvibes-sdk/platform/config';
3
3
  import type { AdaptivePlanner } from '@pellux/goodvibes-sdk/platform/core';
4
4
  import type { ConversationManager } from '../core/conversation';
5
5
  import type { KnowledgeApi } from '@pellux/goodvibes-sdk/platform/knowledge';
6
+ import type { AgentPromptContextReceiptStore } from '../agent/prompt-context-receipts.ts';
6
7
  import type { HookApi } from '@pellux/goodvibes-sdk/platform/hooks';
7
8
  import type { McpApi } from '@pellux/goodvibes-sdk/platform/mcp';
8
9
  import type { PanelManager } from '../panels/panel-manager.ts';
@@ -44,6 +45,7 @@ import type { VoiceProviderRegistry, VoiceService } from '@pellux/goodvibes-sdk/
44
45
  import type { MediaProviderRegistry } from '@pellux/goodvibes-sdk/platform/media';
45
46
  import type { ArtifactStore } from '@pellux/goodvibes-sdk/platform/artifacts';
46
47
  import type { ChannelDeliveryRouter } from '@pellux/goodvibes-sdk/platform/channels';
48
+ import type { AgentExecutionLedger } from './execution-ledger.ts';
47
49
  import { summarizeError } from '@pellux/goodvibes-sdk/platform/utils';
48
50
 
49
51
  export type BootstrapCommandSessionSection = CommandContext['session'];
@@ -73,6 +75,7 @@ export interface BootstrapCommandSectionOptions {
73
75
  readonly conversation: ConversationManager;
74
76
  readonly runtime: MutableRuntimeState;
75
77
  readonly keybindingsManager?: KeybindingsManager;
78
+ readonly processManager?: import('@pellux/goodvibes-sdk/platform/tools').ProcessManager;
76
79
  readonly panelManager: PanelManager;
77
80
  readonly requestRender: () => void;
78
81
  readonly requestPermission: PermissionRequestHandler;
@@ -88,6 +91,7 @@ export interface BootstrapCommandSectionOptions {
88
91
  readonly readModels: UiReadModels;
89
92
  readonly shellPaths: ShellPathService;
90
93
  readonly fileUndoManager: FileUndoManager;
94
+ readonly executionLedger?: AgentExecutionLedger;
91
95
  readonly memoryRegistry?: MemoryRegistry;
92
96
  readonly integrationHelpers?: IntegrationHelperService;
93
97
  readonly knowledgeService?: KnowledgeService;
@@ -124,6 +128,7 @@ export interface BootstrapCommandSectionOptions {
124
128
  readonly peerClient?: PeerClient;
125
129
  readonly providerApi?: ProviderApi;
126
130
  readonly agentKnowledgeApi?: KnowledgeApi;
131
+ readonly promptContextReceipts?: AgentPromptContextReceiptStore;
127
132
  readonly hookApi?: HookApi;
128
133
  readonly mcpApi?: McpApi;
129
134
  readonly opsApi?: OpsApi;
@@ -291,7 +296,7 @@ export function createBootstrapCommandWorkspaceSection(
291
296
  options: Pick<
292
297
  BootstrapCommandSectionOptions,
293
298
  'keybindingsManager' | 'fileUndoManager' | 'panelManager' | 'profileManager' | 'bookmarkManager'
294
- | 'projectPlanningService' | 'projectPlanningProjectId' | 'workPlanStore'
299
+ | 'processManager' | 'projectPlanningService' | 'projectPlanningProjectId' | 'workPlanStore'
295
300
  >,
296
301
  shellServices: BootstrapCommandShellServices,
297
302
  ): BootstrapCommandWorkspaceSection {
@@ -299,6 +304,7 @@ export function createBootstrapCommandWorkspaceSection(
299
304
  keybindingsManager: options.keybindingsManager,
300
305
  fileUndoManager: options.fileUndoManager,
301
306
  panelManager: options.panelManager,
307
+ processManager: options.processManager,
302
308
  profileManager: options.profileManager,
303
309
  bookmarkManager: options.bookmarkManager,
304
310
  projectPlanningService: options.projectPlanningService,
@@ -329,8 +335,12 @@ export function createBootstrapCommandPlatformSection(
329
335
 
330
336
  export function createBootstrapCommandOpsSection(
331
337
  shellServices: BootstrapCommandShellServices,
338
+ options: Pick<BootstrapCommandSectionOptions, 'executionLedger'> = {},
332
339
  ): BootstrapCommandOpsSection {
333
- return shellServices.ops;
340
+ return {
341
+ ...shellServices.ops,
342
+ executionLedger: options.executionLedger,
343
+ };
334
344
  }
335
345
 
336
346
  export function createBootstrapCommandExtensionsSection(
@@ -352,7 +362,7 @@ export function createBootstrapCommandExtensionsSection(
352
362
  export function createBootstrapCommandClientsSection(
353
363
  options: Pick<
354
364
  BootstrapCommandSectionOptions,
355
- 'operatorClient' | 'peerClient' | 'providerApi' | 'agentKnowledgeApi' | 'hookApi' | 'mcpApi' | 'opsApi' | 'directTransport'
365
+ 'operatorClient' | 'peerClient' | 'providerApi' | 'agentKnowledgeApi' | 'promptContextReceipts' | 'hookApi' | 'mcpApi' | 'opsApi' | 'directTransport'
356
366
  >,
357
367
  ): BootstrapCommandClientSection {
358
368
  return {
@@ -360,6 +370,7 @@ export function createBootstrapCommandClientsSection(
360
370
  peer: options.peerClient,
361
371
  providerApi: options.providerApi,
362
372
  agentKnowledgeApi: options.agentKnowledgeApi,
373
+ promptContextReceipts: options.promptContextReceipts,
363
374
  hookApi: options.hookApi,
364
375
  mcpApi: options.mcpApi,
365
376
  opsApi: options.opsApi,
@@ -30,14 +30,27 @@ import { createRuntimeServices, type RuntimeServices } from './services.ts';
30
30
  import { createUiRuntimeServices, type UiRuntimeServices } from './ui-services.ts';
31
31
  import { installAgentToolPolicyGuard } from '../tools/agent-tool-policy-guard.ts';
32
32
  import { registerAgentChannelSendTool } from '../tools/agent-channel-send-tool.ts';
33
+ import { registerAgentAutonomyScheduleTool } from '../tools/agent-autonomy-schedule-tool.ts';
34
+ import { registerAgentArtifactsTool } from '../tools/agent-artifacts-tool.ts';
35
+ import { registerAgentDocumentsTool } from '../tools/agent-documents-tool.ts';
33
36
  import { registerAgentKnowledgeIngestTool } from '../tools/agent-knowledge-ingest-tool.ts';
34
37
  import { registerAgentKnowledgeTool } from '../tools/agent-knowledge-tool.ts';
38
+ import { registerAgentLearningConsolidationTool } from '../tools/agent-learning-consolidation-tool.ts';
35
39
  import { registerAgentLocalRegistryTool } from '../tools/agent-local-registry-tool.ts';
36
40
  import { registerAgentMediaGenerateTool } from '../tools/agent-media-generate-tool.ts';
41
+ import { registerAgentModelCompareTool } from '../tools/agent-model-compare-tool.ts';
37
42
  import { registerAgentNotifyTool } from '../tools/agent-notify-tool.ts';
38
43
  import { registerAgentOperatorActionTool } from '../tools/agent-operator-action-tool.ts';
39
44
  import { registerAgentOperatorBriefingTool } from '../tools/agent-operator-briefing-tool.ts';
45
+ import { registerAgentOperatorMethodTool } from '../tools/agent-operator-method-tool.ts';
40
46
  import { registerAgentReminderScheduleTool } from '../tools/agent-reminder-schedule-tool.ts';
47
+ import { registerAgentReviewPacketPresetsTool } from '../tools/agent-review-packet-presets-tool.ts';
48
+ import { registerAgentReviewPacketShareTool } from '../tools/agent-review-packet-share-tool.ts';
49
+ import { registerAgentResearchReportTool } from '../tools/agent-research-report-tool.ts';
50
+ import { registerAgentResearchRunsTool } from '../tools/agent-research-runs-tool.ts';
51
+ import { registerAgentResearchSourcesTool } from '../tools/agent-research-sources-tool.ts';
52
+ import { registerAgentScheduleEditTool } from '../tools/agent-schedule-edit-tool.ts';
53
+ import { registerAgentScheduleTool } from '../tools/agent-schedule-tool.ts';
41
54
  import { getTerminalSize } from '../shell/terminal-size.ts';
42
55
  import { registerAgentWorkPlanTool } from '../tools/agent-work-plan-tool.ts';
43
56
  import { compactRegisteredToolDefinitions } from '../tools/tool-definition-compaction.ts';
@@ -240,15 +253,40 @@ export async function initializeBootstrapCore(
240
253
  overflowHandler: services.overflowHandler,
241
254
  changeTracker: services.sessionChangeTracker,
242
255
  });
256
+ registerAgentArtifactsTool(toolRegistry, services.artifactStore, { projectRoot: services.shellPaths.workingDirectory });
257
+ registerAgentDocumentsTool(toolRegistry, services.shellPaths, services.artifactStore);
243
258
  registerAgentKnowledgeIngestTool(toolRegistry, services.shellPaths, configManager);
244
- registerAgentChannelSendTool(toolRegistry, services.channelDeliveryRouter);
259
+ registerAgentChannelSendTool(toolRegistry, services.channelDeliveryRouter, { shellPaths: services.shellPaths });
245
260
  registerAgentKnowledgeTool(toolRegistry, services.shellPaths, configManager);
261
+ registerAgentLearningConsolidationTool(toolRegistry, services.shellPaths, services.memoryRegistry);
246
262
  registerAgentLocalRegistryTool(toolRegistry, services.shellPaths, services.memoryRegistry);
247
263
  registerAgentMediaGenerateTool(toolRegistry, services.mediaProviders, services.artifactStore);
264
+ registerAgentResearchRunsTool(toolRegistry, services.shellPaths);
265
+ registerAgentResearchSourcesTool(toolRegistry, services.shellPaths);
266
+ registerAgentResearchReportTool(toolRegistry, services.artifactStore);
267
+ registerAgentReviewPacketPresetsTool(toolRegistry, services.artifactStore);
268
+ registerAgentReviewPacketShareTool(toolRegistry, services.artifactStore, services.channelDeliveryRouter);
269
+ registerAgentModelCompareTool(toolRegistry, {
270
+ modelCatalog: services.providerRegistry,
271
+ providerRegistry: services.providerRegistry,
272
+ artifactStore: services.artifactStore,
273
+ applyModelRoute: (registryKey) => {
274
+ const previousModel = String(configManager.get('provider.model') ?? '').trim();
275
+ configManager.set('provider.model', registryKey);
276
+ return {
277
+ ...(previousModel ? { previousModel } : {}),
278
+ selectedModel: registryKey,
279
+ };
280
+ },
281
+ });
248
282
  registerAgentNotifyTool(toolRegistry, configManager, services.webhookNotifier);
249
283
  registerAgentOperatorActionTool(toolRegistry, services.shellPaths, configManager);
250
284
  registerAgentOperatorBriefingTool(toolRegistry, services.shellPaths, configManager);
285
+ registerAgentOperatorMethodTool(toolRegistry, services.shellPaths, configManager);
286
+ registerAgentAutonomyScheduleTool(toolRegistry, services.shellPaths, configManager);
251
287
  registerAgentReminderScheduleTool(toolRegistry, services.shellPaths, configManager);
288
+ registerAgentScheduleEditTool(toolRegistry, services.shellPaths, configManager);
289
+ registerAgentScheduleTool(toolRegistry, services.shellPaths, configManager);
252
290
  registerAgentWorkPlanTool(toolRegistry, services.workPlanStore);
253
291
  installAgentToolPolicyGuard(toolRegistry, {
254
292
  getLastUserMessage: () => conversation.getLastUserMessage(),
@@ -7,6 +7,7 @@ import type { MutableRuntimeState } from '@/runtime/index.ts';
7
7
  import type { RuntimeStore } from './store/index.ts';
8
8
  import type { RuntimeServices } from './services.ts';
9
9
  import type { CommandContext } from '../input/command-registry.ts';
10
+ import type { AgentPromptContextReceiptStore } from '../agent/prompt-context-receipts.ts';
10
11
  import type { OpsControlPlane } from '@/runtime/index.ts';
11
12
  import { CommandRegistry } from '../input/command-registry.ts';
12
13
  import { registerBuiltinCommands } from '../input/commands.ts';
@@ -54,6 +55,7 @@ export interface BootstrapShellOptions {
54
55
  readonly writeLastSessionPointer: (sessionId: string) => void;
55
56
  readonly getControlPlaneRecentEvents: (limit: number) => readonly ControlPlaneRecentEvent[];
56
57
  readonly toolRegistry: ToolRegistry;
58
+ readonly promptContextReceipts?: AgentPromptContextReceiptStore;
57
59
  readonly forensicsRegistry: ForensicsRegistry;
58
60
  readonly policyRuntimeState: PolicyRuntimeState;
59
61
  readonly uiServices: UiRuntimeServices;
@@ -114,6 +116,7 @@ export function createBootstrapShell(options: BootstrapShellOptions): BootstrapS
114
116
  writeLastSessionPointer,
115
117
  getControlPlaneRecentEvents,
116
118
  toolRegistry,
119
+ promptContextReceipts,
117
120
  forensicsRegistry,
118
121
  policyRuntimeState,
119
122
  uiServices,
@@ -243,6 +246,8 @@ export function createBootstrapShell(options: BootstrapShellOptions): BootstrapS
243
246
  remoteRuntime,
244
247
  planRuntime,
245
248
  fileUndoManager: services.fileUndoManager,
249
+ processManager: services.processManager,
250
+ executionLedger: services.executionLedger,
246
251
  memoryRegistry: services.memoryRegistry,
247
252
  integrationHelpers: services.integrationHelpers,
248
253
  automationManager: services.automationManager,
@@ -277,6 +282,7 @@ export function createBootstrapShell(options: BootstrapShellOptions): BootstrapS
277
282
  operatorClient: directTransport.operator,
278
283
  peerClient: directTransport.peer,
279
284
  agentKnowledgeApi,
285
+ promptContextReceipts,
280
286
  hookApi,
281
287
  mcpApi,
282
288
  opsApi,
@@ -10,7 +10,6 @@
10
10
  * - lifecycle.ts: save/shutdown helpers
11
11
  */
12
12
  import { Orchestrator, type OrchestratorUserInputOptions } from '../core/orchestrator.ts';
13
- import { getTierPromptSupplement, getTierForContextWindow } from '@pellux/goodvibes-sdk/platform/providers';
14
13
  import { logger } from '@pellux/goodvibes-sdk/platform/utils';
15
14
  import type { PermissionRequestHandler } from '@pellux/goodvibes-sdk/platform/permissions';
16
15
  import type { CommandContext } from '../input/command-registry.ts';
@@ -30,7 +29,7 @@ import {
30
29
  } from '@/runtime/index.ts';
31
30
  import { scheduleBackgroundMcpDiscovery, startBackgroundProviderRegistration } from '@/runtime/index.ts';
32
31
  import { restoreSavedModel } from '@/runtime/index.ts';
33
- import type { ExternalServicesHandle, HostServiceStatus } from '@/runtime/index.ts';
32
+ import type { ExternalServicesHandle, HostServiceStatus, TurnEvent } from '@/runtime/index.ts';
34
33
  import type { UiRuntimeServices } from './ui-services.ts';
35
34
  import { createDeferredStartupCoordinator } from '@/runtime/index.ts';
36
35
  import { initializeBootstrapCore } from './bootstrap-core.ts';
@@ -38,32 +37,50 @@ import { createBootstrapShell } from './bootstrap-shell.ts';
38
37
  import { summarizeError } from '@pellux/goodvibes-sdk/platform/utils';
39
38
  import { startMcpConfigAutoReload } from '../mcp/runtime-reload.ts';
40
39
  import { GOODVIBES_AGENT_SURFACE_ROOT } from '../config/surface.ts';
41
- import { buildActivePersonaPrompt } from '../agent/persona-registry.ts';
42
- import { buildEnabledSkillsPrompt } from '../agent/skill-registry.ts';
43
- import { buildEnabledRoutinesPrompt } from '../agent/routine-registry.ts';
44
- import { buildReviewedMemoryPrompt } from '../agent/memory-prompt.ts';
40
+ import { AgentPromptContextReceiptStore, composeRuntimePromptWithReceipt } from '../agent/prompt-context-receipts.ts';
41
+ import { registerAgentAuditTool } from '../tools/agent-audit-tool.ts';
42
+ import { registerAgentAutonomyTool } from '../tools/agent-autonomy-tool.ts';
43
+ import { registerAgentChannelsTool } from '../tools/agent-channels-tool.ts';
44
+ import { registerAgentComputerTool } from '../tools/agent-computer-tool.ts';
45
+ import { registerAgentContextTool } from '../tools/agent-context-tool.ts';
46
+ import { registerAgentDelegationTool } from '../tools/agent-delegation-tool.ts';
47
+ import { registerAgentDeviceTool } from '../tools/agent-device-tool.ts';
48
+ import { registerAgentExecutionTool } from '../tools/agent-execution-tool.ts';
45
49
  import { registerAgentHarnessTool } from '../tools/agent-harness-tool.ts';
50
+ import { registerAgentHostTool } from '../tools/agent-host-tool.ts';
51
+ import { registerAgentMemoryTool } from '../tools/agent-memory-tool.ts';
52
+ import { registerAgentModelsTool } from '../tools/agent-models-tool.ts';
53
+ import { registerAgentPersonalOpsTool } from '../tools/agent-personal-ops-tool.ts';
54
+ import { registerAgentResearchTool } from '../tools/agent-research-tool.ts';
55
+ import { registerAgentRouteTool } from '../tools/agent-route-tool.ts';
56
+ import { registerAgentSecurityTool } from '../tools/agent-security-tool.ts';
57
+ import { registerAgentSessionsTool } from '../tools/agent-sessions-tool.ts';
58
+ import { registerAgentSetupTool } from '../tools/agent-setup-tool.ts';
59
+ import { registerAgentSettingsImportTool } from '../tools/agent-settings-import-tool.ts';
60
+ import { registerAgentSettingsTool } from '../tools/agent-settings-tool.ts';
61
+ import { registerAgentSupportTool } from '../tools/agent-support-tool.ts';
62
+ import { registerAgentTerminalProcessTools } from '../tools/agent-terminal-process-tools.ts';
63
+ import { registerAgentVibeTool } from '../tools/agent-vibe-tool.ts';
64
+ import { registerAgentWorkspaceTool } from '../tools/agent-workspace-tool.ts';
46
65
  import { compactRegisteredToolDefinitions } from '../tools/tool-definition-compaction.ts';
47
66
 
48
67
  const GOODVIBES_AGENT_OPERATOR_POLICY = [
49
68
  '## GoodVibes Agent Operator Policy',
50
- '- Work serially in the main conversation by default: answer, inspect, summarize, remember useful non-secret facts, configure Agent-local state, and use safe read-only connected-host/operator routes.',
51
- '- Connected-host lifecycle is external. Do not start, stop, restart, install, expose, or mutate host listeners/network posture from Agent.',
52
- '- Read tools: `agent_operator_briefing` for connected work/approvals/automation/schedules, `agent_knowledge` for isolated Agent Knowledge, `agent_harness` for harness catalogs/settings/status.',
53
- '- Harness access: use `agent_harness` modes `commands`/`run_command`, `workspace_actions`/`run_workspace_action`, and `settings`/`set_setting`/`reset_setting` to use the same surfaces the user can use.',
54
- '- State tools: `agent_work_plan` for visible local work items; `agent_local_registry` for Agent-local notes, memory, personas, skills, bundles, and routines. Keep records non-secret, sourced, and reviewable.',
55
- '- Confirmed tools: use `agent_operator_action`, `agent_knowledge_ingest`, `agent_media_generate`, `agent_notify`, `agent_channel_send`, and `agent_reminder_schedule` only for explicit user requests with confirm:true and explicitUserRequest.',
69
+ '- Act as one user-facing autonomous assistant. Prefer the lowest-friction safe path that completes the user outcome; do not expose internal package or host ownership unless it is needed for diagnosis, setup, or safety.',
70
+ '- Work serially in the main conversation by default for ordinary chat, research, planning, setup, local context, and short tool work. Use visible schedules, work plans, operator actions, or delegated/remote routes for durable or long-running autonomy.',
71
+ '- Connected-host lifecycle is not ambient. If the host is unavailable, explain the shortest user action to make the assistant reachable; do not pretend a missing host route worked.',
72
+ '- Read tools: `route action:"plan|status"`, `schedule action:"list"`, `setup action:"status|item|repair|checkpoint"`, `settings action:"list|get"`, `vibe action:"status|show"`, `context action:"status|files|file|prompt|receipts|receipt"`, `memory action:"status|provider|curator|candidate|list|search|get"`, `channels action:"status|channel|setup|triage|deliveries"`, `models action:"status|route|local|providers|provider"`, `personal_ops action:"briefing|status|queue|intake|lane"`, `autonomy action:"intake|queue|item|status"`, `delegation action:"status|routes|route"`, `execution action:"status|route|history|record|processes|process_capabilities|process|recovery"`, `security action:"status|finding|explain"`, `support action:"status|bundle"`, `sessions action:"list|get"`, `audit action:"readiness|item|evidence|artifact"`, `computer action:"status|plan|control|browser|setup|mcp"`, `research action:"plan|search|runner|runs|run|sources|source|bundle|reports|report_artifact"`, `device action:"status|capability|browser|control|voice|provider"`, `workspace action:"status|actions|action|surfaces|surface|panels|panel|shortcuts|keybindings|keybinding|commands|command|cli_commands|cli_command"`, `host action:"status|capabilities|capability|services|service|methods|method"`, `import_goodvibes_settings action:"preview"`, and `agent_operator_briefing` for connected work/approvals/automation/schedules, `agent_knowledge` for isolated Agent Knowledge, and `agent_harness` for harness catalogs/status/capability discovery. Use `agent_artifacts` for saved artifact list/preview/export/package/archive; write modes are confirmation-gated.',
73
+ '- Harness access: use `settings action:"set|reset|import"` and `workspace action:"run|run_command|open|open_panel|run_keybinding|set_keybinding|reset_keybinding"` to use the same surfaces the user can use; lower-level `agent_harness` modes remain for detail inspection and compatibility.',
74
+ '- State tools: `agent_work_plan` for visible local work items; `agent_local_registry` for Agent-local notes, memory, personas, skills, bundles, and routines; `agent_learning_consolidation` for confirmed duplicate cleanup phases; `agent_documents` for versioned Agent document drafts. Keep records non-secret, sourced, and reviewable.',
75
+ '- Confirmed tools: use `schedule`, `setup action:"save_checkpoint|clear_checkpoint|token|smoke|finish|import_settings"`, `vibe action:"init|import_persona"`, `models action:"smoke"` for local model server checks, `personal_ops action:"read"` for one live read-only inbox/calendar connector operation, `research action:"create_run|start_run|checkpoint|pause|resume|cancel|complete|fail|delete_run|add_source|review_source|reject_source|use_source|delete_source|report"`, `computer action:"open_browser"`, `device action:"open_browser|open_tts_provider|open_tts_voice"`, `workspace action:"run|run_command|open|open_panel|run_keybinding|set_keybinding|reset_keybinding"`, `import_goodvibes_settings`, `agent_operator_action`, `agent_artifacts` export/package/archive, `agent_documents`, `agent_review_packet_presets` save/refresh, `agent_review_packet_share`, `agent_knowledge_ingest`, `agent_learning_consolidation`, `agent_media_generate`, `agent_model_compare`, `agent_research_runs`, `agent_research_sources`, `agent_research_report`, `agent_notify`, `agent_channel_send`, `agent_autonomy_schedule`, `agent_reminder_schedule`, and `agent_schedule_edit` only for explicit user requests with confirm:true and explicitUserRequest.',
56
76
  '- Agent Knowledge must use only `/api/goodvibes-agent/knowledge/*` and fail closed. Do not use default knowledge or non-Agent knowledge spaces.',
57
77
  '- External delivery, media generation, reminders, settings writes, slash-command mirrors, workspace action mirrors, and destructive local changes require explicit user intent and the owning tool/command confirmation.',
58
- '- Routines run in this serial conversation unless explicitly promoted to a connected schedule. Do not create hidden Agent jobs or local scheduler jobs.',
59
- '- Do not delegate planning, research, operations, knowledge, memory, configuration, approvals, observability, or ordinary assistant work.',
60
- '- For explicit build, implement, fix, patch, or review requests, preserve the full original ask and use the public shared-session/build-delegation route. If that route is unavailable, report the missing route instead of pretending to perform the work locally.',
78
+ '- Autonomous work must be visible, reviewable, and cancellable. Never create silent hidden jobs; when work should continue later, create or use an explicit schedule, reminder, work-plan item, operator action, or delegated/remote task route.',
79
+ '- Do not delegate planning, research, operations, knowledge, memory, configuration, approvals, observability, or ordinary assistant work when an Agent-owned route can satisfy the user directly.',
80
+ '- When the safest user route is not obvious, call `route action:"plan"` with the plain user task, then follow the preferred visible route and confirmation boundary returned there.',
81
+ '- For explicit build, implement, fix, patch, or review requests, choose the route that best serves the user: use available local read/edit/exec tools when the current Agent workspace and permissions are sufficient; use public shared-session/build-delegation for isolation, remote execution, parallelism, or connected coding workflows. Preserve the full original ask when delegating.',
61
82
  ].join('\n');
62
83
 
63
- function joinPromptParts(...parts: Array<string | null | undefined>): string {
64
- return parts.map((part) => part?.trim()).filter((part): part is string => Boolean(part)).join('\n\n');
65
- }
66
-
67
84
  // ── Bootstrap context type ──────────────────────────────────────────────────
68
85
 
69
86
  /**
@@ -179,6 +196,44 @@ export async function bootstrapRuntime(
179
196
  runtimeSessionIdRef,
180
197
  } = await initializeBootstrapCore(stdout, options, (limit) => controlPlaneRecentEventsRef.value(limit));
181
198
  const providerRegistry = services.providerRegistry;
199
+ const promptContextReceipts = new AgentPromptContextReceiptStore(
200
+ services.shellPaths.resolveUserPath(GOODVIBES_AGENT_SURFACE_ROOT, 'prompt-context-receipts.jsonl'),
201
+ );
202
+ let activePromptTurnId: string | null = null;
203
+ runtimeUnsubs.push(
204
+ runtimeBus.on<Extract<TurnEvent, { type: 'TURN_SUBMITTED' }>>('TURN_SUBMITTED', (event) => {
205
+ activePromptTurnId = event.payload.turnId;
206
+ }),
207
+ runtimeBus.on<Extract<TurnEvent, { type: 'TURN_COMPLETED' }>>('TURN_COMPLETED', (event) => {
208
+ promptContextReceipts.recordTurnOutcome({
209
+ turnId: event.payload.turnId,
210
+ status: 'completed',
211
+ terminalEvent: 'TURN_COMPLETED',
212
+ stopReason: event.payload.stopReason,
213
+ });
214
+ if (activePromptTurnId === event.payload.turnId) activePromptTurnId = null;
215
+ }),
216
+ runtimeBus.on<Extract<TurnEvent, { type: 'TURN_ERROR' }>>('TURN_ERROR', (event) => {
217
+ promptContextReceipts.recordTurnOutcome({
218
+ turnId: event.payload.turnId,
219
+ status: 'error',
220
+ terminalEvent: 'TURN_ERROR',
221
+ stopReason: event.payload.stopReason,
222
+ detail: event.payload.error,
223
+ });
224
+ if (activePromptTurnId === event.payload.turnId) activePromptTurnId = null;
225
+ }),
226
+ runtimeBus.on<Extract<TurnEvent, { type: 'TURN_CANCEL' }>>('TURN_CANCEL', (event) => {
227
+ promptContextReceipts.recordTurnOutcome({
228
+ turnId: event.payload.turnId,
229
+ status: 'cancelled',
230
+ terminalEvent: 'TURN_CANCEL',
231
+ stopReason: event.payload.stopReason,
232
+ detail: event.payload.reason,
233
+ });
234
+ if (activePromptTurnId === event.payload.turnId) activePromptTurnId = null;
235
+ }),
236
+ );
182
237
  const {
183
238
  automationManager,
184
239
  hookDispatcher,
@@ -205,17 +260,20 @@ export async function bootstrapRuntime(
205
260
  getSystemPrompt: () => {
206
261
  const currentModel = providerRegistry.getCurrentModel();
207
262
  const contextWindow = providerRegistry.getContextWindowForModel(currentModel);
208
- const tier = getTierForContextWindow(contextWindow);
209
- const supplement = getTierPromptSupplement(tier);
210
- return joinPromptParts(
211
- runtime.systemPrompt,
212
- GOODVIBES_AGENT_OPERATOR_POLICY,
213
- buildReviewedMemoryPrompt(services.memoryRegistry),
214
- buildEnabledRoutinesPrompt(services.shellPaths),
215
- buildEnabledSkillsPrompt(services.shellPaths),
216
- buildActivePersonaPrompt(services.shellPaths),
217
- supplement,
218
- );
263
+ const composed = composeRuntimePromptWithReceipt({
264
+ sessionId: runtime.sessionId,
265
+ turnId: activePromptTurnId,
266
+ source: activePromptTurnId ? 'turn' : 'follow_up',
267
+ provider: runtime.provider,
268
+ model: currentModel,
269
+ contextWindow,
270
+ runtimePrompt: runtime.systemPrompt,
271
+ operatorPolicy: GOODVIBES_AGENT_OPERATOR_POLICY,
272
+ shellPaths: services.shellPaths,
273
+ memoryRegistry: services.memoryRegistry,
274
+ });
275
+ promptContextReceipts.record(composed.receipt);
276
+ return composed.prompt;
219
277
  },
220
278
  hookDispatcher,
221
279
  flagManager: services.featureFlags,
@@ -267,6 +325,7 @@ export async function bootstrapRuntime(
267
325
  writeLastSessionPointer,
268
326
  getControlPlaneRecentEvents: (limit) => controlPlaneRecentEventsRef.value(limit),
269
327
  toolRegistry,
328
+ promptContextReceipts,
270
329
  forensicsRegistry,
271
330
  policyRuntimeState: services.policyRuntimeState,
272
331
  uiServices,
@@ -282,6 +341,29 @@ export async function bootstrapRuntime(
282
341
  const commandContext = shell.commandContext;
283
342
  const inputHistory = shell.inputHistory;
284
343
  registerAgentHarnessTool(toolRegistry, commandRegistry, commandContext);
344
+ registerAgentAuditTool(toolRegistry, commandRegistry, commandContext);
345
+ registerAgentAutonomyTool(toolRegistry, commandRegistry, commandContext);
346
+ registerAgentChannelsTool(toolRegistry, commandRegistry, commandContext);
347
+ registerAgentComputerTool(toolRegistry, commandRegistry, commandContext);
348
+ registerAgentContextTool(toolRegistry, commandRegistry, commandContext);
349
+ registerAgentDelegationTool(toolRegistry, commandRegistry, commandContext);
350
+ registerAgentDeviceTool(toolRegistry, commandRegistry, commandContext);
351
+ registerAgentExecutionTool(toolRegistry, commandRegistry, commandContext);
352
+ registerAgentHostTool(toolRegistry, commandRegistry, commandContext);
353
+ registerAgentMemoryTool(toolRegistry, commandRegistry, commandContext);
354
+ registerAgentModelsTool(toolRegistry, commandRegistry, commandContext);
355
+ registerAgentPersonalOpsTool(toolRegistry, commandRegistry, commandContext);
356
+ registerAgentResearchTool(toolRegistry, commandRegistry, commandContext);
357
+ registerAgentRouteTool(toolRegistry, commandContext);
358
+ registerAgentSecurityTool(toolRegistry, commandRegistry, commandContext);
359
+ registerAgentSessionsTool(toolRegistry, commandRegistry, commandContext);
360
+ registerAgentSetupTool(toolRegistry, commandRegistry, commandContext);
361
+ registerAgentSettingsTool(toolRegistry, commandRegistry, commandContext);
362
+ registerAgentSupportTool(toolRegistry, commandRegistry, commandContext);
363
+ registerAgentVibeTool(toolRegistry, commandContext);
364
+ registerAgentWorkspaceTool(toolRegistry, commandRegistry, commandContext);
365
+ registerAgentSettingsImportTool(toolRegistry, commandContext);
366
+ registerAgentTerminalProcessTools(toolRegistry, commandContext);
285
367
  compactRegisteredToolDefinitions(toolRegistry);
286
368
  const pluginCommandRegistry = {
287
369
  register(command: {
@@ -522,6 +604,7 @@ export async function bootstrapRuntime(
522
604
  runtimeUnsubs.forEach((fn) => fn());
523
605
  runtimeUnsubs.length = 0;
524
606
  forensicsCollector.dispose();
607
+ services.executionLedger.dispose();
525
608
  await deferredStartup.drain(100);
526
609
  await externalServices.stop();
527
610
  // Clear agent status interval via ref (consistent with agentStatusIntervalRef usage)
@@ -57,7 +57,8 @@ export function connectedHostTokenRequiredMessage(path: string): string {
57
57
  return [
58
58
  'Connected-host operator token is required.',
59
59
  ` token path ${path}`,
60
- ' Agent does not create or rotate connected-host auth tokens.',
61
- ' Provision or repair connected-host access through the owning GoodVibes host, then rerun this command.',
60
+ ' Agent can create or repair the local canonical token only through the confirmed setup route:',
61
+ ' agent_harness mode:"provision_connected_host_token" setupItemId:"connected-host-auth" confirm:true explicitUserRequest:"..."',
62
+ ' Then rerun this command or inspect agent_harness mode:"connected_host_status".',
62
63
  ].join('\n');
63
64
  }