@pellux/goodvibes-agent 1.1.7 → 1.2.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 (255) hide show
  1. package/CHANGELOG.md +170 -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 +132577 -91483
  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 +56 -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 +114 -45
  14. package/docs/voice-and-live-tts.md +3 -1
  15. package/package.json +3 -2
  16. package/release/release-notes.md +130 -5
  17. package/release/release-readiness.json +120 -90
  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 +296 -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-checkpoint.ts +140 -0
  42. package/src/agent/setup-wizard.ts +447 -0
  43. package/src/agent/skill-registry-types.ts +102 -0
  44. package/src/agent/skill-registry.ts +81 -107
  45. package/src/agent/vibe-confirmation-routes.ts +62 -0
  46. package/src/agent/vibe-file.ts +285 -0
  47. package/src/cli/agent-knowledge-command.ts +45 -2
  48. package/src/cli/help.ts +3 -0
  49. package/src/cli/profiles-command.ts +25 -11
  50. package/src/config/agent-settings-policy.ts +1 -18
  51. package/src/input/agent-workspace-activation.ts +53 -0
  52. package/src/input/agent-workspace-artifact-browser-editor.ts +494 -0
  53. package/src/input/agent-workspace-artifact-metadata.ts +17 -0
  54. package/src/input/agent-workspace-basic-command-editors.ts +5 -1
  55. package/src/input/agent-workspace-categories.ts +153 -155
  56. package/src/input/agent-workspace-channel-triage.ts +481 -0
  57. package/src/input/agent-workspace-channels.ts +263 -0
  58. package/src/input/agent-workspace-command-editor.ts +152 -0
  59. package/src/input/agent-workspace-context-snapshot.ts +349 -0
  60. package/src/input/agent-workspace-delegation-editor-submission.ts +8 -0
  61. package/src/input/agent-workspace-document-editor.ts +502 -0
  62. package/src/input/agent-workspace-document-ops-editor.ts +523 -0
  63. package/src/input/agent-workspace-host-category.ts +1 -1
  64. package/src/input/agent-workspace-local-library-snapshot.ts +167 -0
  65. package/src/input/agent-workspace-model-compare-editor.ts +376 -0
  66. package/src/input/agent-workspace-model-compare-prompt-submission.ts +552 -0
  67. package/src/input/agent-workspace-model-compare-types.ts +82 -0
  68. package/src/input/agent-workspace-model-compare-utils.ts +35 -0
  69. package/src/input/agent-workspace-onboarding-categories.ts +141 -0
  70. package/src/input/agent-workspace-operations-command-editor-submission.ts +53 -0
  71. package/src/input/agent-workspace-operations-command-editors.ts +22 -0
  72. package/src/input/agent-workspace-research-report-editor.ts +212 -0
  73. package/src/input/agent-workspace-research-run-editor.ts +144 -0
  74. package/src/input/agent-workspace-research-source-editor.ts +167 -0
  75. package/src/input/agent-workspace-review-packet-snapshot.ts +593 -0
  76. package/src/input/agent-workspace-review-packet-utils.ts +265 -0
  77. package/src/input/agent-workspace-settings.ts +262 -30
  78. package/src/input/agent-workspace-setup-checkpoint-action.ts +127 -0
  79. package/src/input/agent-workspace-setup-snapshot.ts +198 -0
  80. package/src/input/agent-workspace-setup.ts +34 -1
  81. package/src/input/agent-workspace-snapshot.ts +162 -147
  82. package/src/input/agent-workspace-types.ts +287 -2
  83. package/src/input/agent-workspace.ts +18 -0
  84. package/src/input/command-registry.ts +9 -2
  85. package/src/input/commands/agent-runtime-profile-runtime.ts +28 -13
  86. package/src/input/commands/channels-runtime.ts +102 -114
  87. package/src/input/commands/delegation-runtime.ts +87 -24
  88. package/src/input/commands/knowledge-browser-flags.ts +12 -0
  89. package/src/input/commands/knowledge.ts +28 -14
  90. package/src/input/commands/operator-actions-runtime.ts +6 -3
  91. package/src/input/commands/schedule-runtime.ts +71 -14
  92. package/src/input/commands/session-content.ts +2 -2
  93. package/src/input/commands/shell-core.ts +2 -0
  94. package/src/input/commands/vibe-runtime.ts +140 -0
  95. package/src/input/commands.ts +2 -0
  96. package/src/input/connected-host-routes.ts +123 -0
  97. package/src/input/settings-modal-types.ts +14 -0
  98. package/src/main.ts +15 -15
  99. package/src/panels/qr-panel.ts +2 -2
  100. package/src/renderer/agent-workspace-context-lines.ts +686 -0
  101. package/src/renderer/agent-workspace.ts +30 -419
  102. package/src/renderer/settings-modal-helpers.ts +12 -0
  103. package/src/renderer/settings-modal.ts +12 -0
  104. package/src/runtime/bootstrap-command-context.ts +11 -1
  105. package/src/runtime/bootstrap-command-parts.ts +14 -3
  106. package/src/runtime/bootstrap-core.ts +39 -1
  107. package/src/runtime/bootstrap-shell.ts +6 -0
  108. package/src/runtime/bootstrap.ts +113 -30
  109. package/src/runtime/connected-host-auth.ts +3 -2
  110. package/src/runtime/execution-ledger.ts +231 -0
  111. package/src/runtime/services.ts +88 -10
  112. package/src/runtime/tool-permission-safety.ts +199 -5
  113. package/src/shell/session-continuity-hints.ts +39 -0
  114. package/src/tools/agent-artifacts-tool.ts +606 -0
  115. package/src/tools/agent-audit-tool.ts +155 -0
  116. package/src/tools/agent-autonomy-schedule-tool.ts +238 -0
  117. package/src/tools/agent-autonomy-tool.ts +140 -0
  118. package/src/tools/agent-channel-send-tool.ts +24 -2
  119. package/src/tools/agent-channels-tool.ts +140 -0
  120. package/src/tools/agent-computer-tool.ts +168 -0
  121. package/src/tools/agent-context-policy.ts +137 -7
  122. package/src/tools/agent-context-tool.ts +143 -0
  123. package/src/tools/agent-delegation-tool.ts +128 -0
  124. package/src/tools/agent-device-tool.ts +240 -0
  125. package/src/tools/agent-documents-tool.ts +684 -0
  126. package/src/tools/agent-execution-tool.ts +230 -0
  127. package/src/tools/agent-harness-agent-orchestration.ts +703 -0
  128. package/src/tools/agent-harness-autonomy-intake.ts +785 -0
  129. package/src/tools/agent-harness-autonomy-live-records.ts +588 -0
  130. package/src/tools/agent-harness-autonomy-queue-types.ts +88 -0
  131. package/src/tools/agent-harness-autonomy-queue.ts +560 -0
  132. package/src/tools/agent-harness-background-processes-types.ts +35 -0
  133. package/src/tools/agent-harness-background-processes.ts +794 -0
  134. package/src/tools/agent-harness-browser-cockpit-route.ts +219 -0
  135. package/src/tools/agent-harness-browser-control.ts +338 -0
  136. package/src/tools/agent-harness-channel-metadata.ts +168 -10
  137. package/src/tools/agent-harness-cli-command-policy.ts +110 -0
  138. package/src/tools/agent-harness-command-catalog.ts +4 -2
  139. package/src/tools/agent-harness-command-runner.ts +42 -0
  140. package/src/tools/agent-harness-connected-host-status.ts +7 -4
  141. package/src/tools/agent-harness-delegation-posture.ts +234 -19
  142. package/src/tools/agent-harness-document-ops-reviewer-readiness.ts +234 -0
  143. package/src/tools/agent-harness-document-ops-types.ts +72 -0
  144. package/src/tools/agent-harness-document-ops.ts +671 -0
  145. package/src/tools/agent-harness-execution-history.ts +489 -0
  146. package/src/tools/agent-harness-execution-posture.ts +382 -0
  147. package/src/tools/agent-harness-file-recovery.ts +135 -0
  148. package/src/tools/agent-harness-keybinding-metadata.ts +16 -12
  149. package/src/tools/agent-harness-learning-curator-common.ts +102 -0
  150. package/src/tools/agent-harness-learning-curator-consolidation.ts +295 -0
  151. package/src/tools/agent-harness-learning-curator-proposals.ts +606 -0
  152. package/src/tools/agent-harness-learning-curator-types.ts +151 -0
  153. package/src/tools/agent-harness-learning-curator.ts +417 -0
  154. package/src/tools/agent-harness-local-model-benchmarks.ts +199 -0
  155. package/src/tools/agent-harness-local-model-cookbook.ts +238 -0
  156. package/src/tools/agent-harness-local-model-endpoints.ts +673 -0
  157. package/src/tools/agent-harness-media-posture.ts +208 -2
  158. package/src/tools/agent-harness-memory-posture.ts +556 -0
  159. package/src/tools/agent-harness-metadata.ts +100 -168
  160. package/src/tools/agent-harness-mode-catalog.ts +84 -33
  161. package/src/tools/agent-harness-model-catalog.ts +162 -0
  162. package/src/tools/agent-harness-model-provider-health.ts +186 -0
  163. package/src/tools/agent-harness-model-readiness.ts +406 -0
  164. package/src/tools/agent-harness-model-routing-types.ts +266 -0
  165. package/src/tools/agent-harness-model-routing-utils.ts +30 -0
  166. package/src/tools/agent-harness-model-routing.ts +137 -190
  167. package/src/tools/agent-harness-operator-methods.ts +115 -133
  168. package/src/tools/agent-harness-pairing-posture.ts +431 -18
  169. package/src/tools/agent-harness-personal-ops-discovery.ts +533 -0
  170. package/src/tools/agent-harness-personal-ops-intake.ts +385 -0
  171. package/src/tools/agent-harness-personal-ops-lanes.ts +204 -0
  172. package/src/tools/agent-harness-personal-ops-records.ts +732 -0
  173. package/src/tools/agent-harness-personal-ops-runner.ts +637 -0
  174. package/src/tools/agent-harness-personal-ops-types.ts +222 -0
  175. package/src/tools/agent-harness-personal-ops.ts +606 -0
  176. package/src/tools/agent-harness-project-context.ts +144 -0
  177. package/src/tools/agent-harness-prompt-context.ts +589 -0
  178. package/src/tools/agent-harness-provider-account-metadata.ts +2 -2
  179. package/src/tools/agent-harness-release-evidence.ts +9 -7
  180. package/src/tools/agent-harness-release-readiness.ts +9 -7
  181. package/src/tools/agent-harness-research-briefing.ts +427 -0
  182. package/src/tools/agent-harness-research-queue.ts +250 -0
  183. package/src/tools/agent-harness-research-runs.ts +295 -0
  184. package/src/tools/agent-harness-research-workflow.ts +322 -0
  185. package/src/tools/agent-harness-security-posture.ts +2 -2
  186. package/src/tools/agent-harness-service-posture.ts +9 -9
  187. package/src/tools/agent-harness-session-metadata.ts +3 -3
  188. package/src/tools/agent-harness-setup-connected-host.ts +501 -0
  189. package/src/tools/agent-harness-setup-describe.ts +557 -0
  190. package/src/tools/agent-harness-setup-handoffs.ts +502 -0
  191. package/src/tools/agent-harness-setup-model-helpers.ts +101 -0
  192. package/src/tools/agent-harness-setup-plan.ts +253 -0
  193. package/src/tools/agent-harness-setup-posture-types.ts +218 -0
  194. package/src/tools/agent-harness-setup-posture-utils.ts +173 -0
  195. package/src/tools/agent-harness-setup-posture.ts +449 -221
  196. package/src/tools/agent-harness-setup-smoke.ts +508 -0
  197. package/src/tools/agent-harness-sudo-posture.ts +114 -0
  198. package/src/tools/agent-harness-tool-schema.ts +120 -7
  199. package/src/tools/agent-harness-tool-types.ts +78 -0
  200. package/src/tools/agent-harness-tool-utils.ts +43 -0
  201. package/src/tools/agent-harness-tool.ts +311 -370
  202. package/src/tools/agent-harness-ui-surface-metadata.ts +76 -69
  203. package/src/tools/agent-harness-ui-surface-types.ts +46 -0
  204. package/src/tools/agent-harness-vibe-health.ts +105 -0
  205. package/src/tools/agent-harness-workspace-action-runner.ts +149 -0
  206. package/src/tools/agent-harness-workspace-actions.ts +114 -8
  207. package/src/tools/agent-harness-workspace-editor-execution.ts +214 -0
  208. package/src/tools/agent-harness-workspace-editor-runner.ts +755 -0
  209. package/src/tools/agent-host-tool.ts +159 -0
  210. package/src/tools/agent-knowledge-ingest-tool.ts +34 -1
  211. package/src/tools/agent-learning-consolidation-core.ts +327 -0
  212. package/src/tools/agent-learning-consolidation-tool.ts +758 -0
  213. package/src/tools/agent-memory-tool.ts +214 -0
  214. package/src/tools/agent-model-compare-export.ts +315 -0
  215. package/src/tools/agent-model-compare-handoff.ts +592 -0
  216. package/src/tools/agent-model-compare-judgment.ts +633 -0
  217. package/src/tools/agent-model-compare-run.ts +722 -0
  218. package/src/tools/agent-model-compare-tool.ts +698 -0
  219. package/src/tools/agent-model-compare-types.ts +191 -0
  220. package/src/tools/agent-model-compare-utils.ts +93 -0
  221. package/src/tools/agent-models-tool.ts +208 -0
  222. package/src/tools/agent-operator-action-tool.ts +1 -1
  223. package/src/tools/agent-operator-method-tool.ts +643 -0
  224. package/src/tools/agent-personal-ops-tool.ts +197 -0
  225. package/src/tools/agent-policy-explanation.ts +415 -0
  226. package/src/tools/agent-research-report-tool.ts +608 -0
  227. package/src/tools/agent-research-runs-tool.ts +434 -0
  228. package/src/tools/agent-research-sources-tool.ts +443 -0
  229. package/src/tools/agent-research-tool.ts +687 -0
  230. package/src/tools/agent-review-packet-presets-core.ts +757 -0
  231. package/src/tools/agent-review-packet-presets-tool.ts +466 -0
  232. package/src/tools/agent-review-packet-share-tool.ts +305 -0
  233. package/src/tools/agent-route-planner-candidates-setup.ts +411 -0
  234. package/src/tools/agent-route-planner-candidates-surfaces.ts +432 -0
  235. package/src/tools/agent-route-planner-candidates-work.ts +251 -0
  236. package/src/tools/agent-route-planner-helpers.ts +667 -0
  237. package/src/tools/agent-route-planner.ts +185 -0
  238. package/src/tools/agent-route-tool.ts +105 -0
  239. package/src/tools/agent-schedule-edit-tool.ts +210 -0
  240. package/src/tools/agent-schedule-tool.ts +282 -0
  241. package/src/tools/agent-security-tool.ts +145 -0
  242. package/src/tools/agent-sessions-tool.ts +122 -0
  243. package/src/tools/agent-settings-import-tool.ts +104 -0
  244. package/src/tools/agent-settings-tool.ts +176 -0
  245. package/src/tools/agent-setup-tool.ts +226 -0
  246. package/src/tools/agent-support-tool.ts +122 -0
  247. package/src/tools/agent-terminal-process-tools.ts +167 -0
  248. package/src/tools/agent-tool-policy-guard-types.ts +77 -0
  249. package/src/tools/agent-tool-policy-guard.ts +106 -85
  250. package/src/tools/agent-vibe-tool.ts +297 -0
  251. package/src/tools/agent-work-plan-tool.ts +265 -6
  252. package/src/tools/agent-workspace-tool.ts +305 -0
  253. package/src/tools/artifact-archive.ts +169 -0
  254. package/src/tools/tool-definition-compaction.ts +36 -0
  255. package/src/version.ts +1 -1
@@ -0,0 +1,247 @@
1
+ import type { AgentWorkspaceRuntimeSnapshot } from '../input/agent-workspace-types.ts';
2
+
3
+ export type AssistantCockpitLaneState = 'ready' | 'attention' | 'setup';
4
+ export type AssistantCockpitStatus = 'ready' | 'ready-with-optional-setup' | 'attention';
5
+
6
+ export interface AssistantCockpitLane {
7
+ readonly id:
8
+ | 'setup'
9
+ | 'chat-and-model'
10
+ | 'work-and-files'
11
+ | 'personal-ops'
12
+ | 'research-and-docs'
13
+ | 'background-work'
14
+ | 'safety-and-recovery';
15
+ readonly label: string;
16
+ readonly state: AssistantCockpitLaneState;
17
+ readonly summary: string;
18
+ readonly nextAction: string;
19
+ readonly routes: readonly string[];
20
+ }
21
+
22
+ export interface AssistantCockpit {
23
+ readonly status: AssistantCockpitStatus;
24
+ readonly primaryNextAction: string;
25
+ readonly lanes: readonly AssistantCockpitLane[];
26
+ readonly boundaryPolicy: string;
27
+ }
28
+
29
+ export interface AssistantCockpitMetrics {
30
+ readonly setupBlockers: number;
31
+ readonly setupSmokeResult?: string;
32
+ readonly setupSmokeTrend?: string;
33
+ readonly modelStatus: string;
34
+ readonly executionRoutes: number;
35
+ readonly personalGaps: number;
36
+ readonly runningWork: number;
37
+ readonly researchRuns: number;
38
+ readonly documentLanes: number;
39
+ readonly documentGaps: number;
40
+ readonly securityFindings: number;
41
+ }
42
+
43
+ function readRecord(value: unknown): Record<string, unknown> {
44
+ return value && typeof value === 'object' && !Array.isArray(value) ? value as Record<string, unknown> : {};
45
+ }
46
+
47
+ function readNumber(record: Record<string, unknown>, key: string): number {
48
+ const value = record[key];
49
+ return typeof value === 'number' && Number.isFinite(value) ? value : 0;
50
+ }
51
+
52
+ function readString(record: Record<string, unknown>, key: string): string {
53
+ return typeof record[key] === 'string' ? String(record[key]) : '';
54
+ }
55
+
56
+ function readNestedRecord(record: Record<string, unknown>, key: string): Record<string, unknown> {
57
+ return readRecord(record[key]);
58
+ }
59
+
60
+ function lane(options: AssistantCockpitLane): AssistantCockpitLane {
61
+ return options;
62
+ }
63
+
64
+ function setupLaneSummary(metrics: AssistantCockpitMetrics): string {
65
+ const base = metrics.setupBlockers > 0
66
+ ? `${metrics.setupBlockers} setup blocker(s) before autonomous work.`
67
+ : 'First-run setup has no blocking assistant issue.';
68
+ const latest = metrics.setupSmokeResult ? ` Last smoke ${metrics.setupSmokeResult}.` : '';
69
+ const trend = metrics.setupSmokeTrend && metrics.setupSmokeTrend !== 'none'
70
+ ? ` Trend ${metrics.setupSmokeTrend}.`
71
+ : '';
72
+ return `${base}${latest}${trend}`;
73
+ }
74
+
75
+ function setupLaneNextAction(metrics: AssistantCockpitMetrics): string {
76
+ if (metrics.setupSmokeTrend === 'regressing') return 'Review recent smoke history, fix new blockers, then rerun setup smoke.';
77
+ if (metrics.setupSmokeResult === 'blocked') return 'Review the saved smoke artifact, resolve blockers, then rerun setup smoke.';
78
+ if (metrics.setupSmokeResult === 'ready-for-user-run') return 'Complete remaining user-run smoke checks, then start the user task.';
79
+ if (metrics.setupBlockers === 0 && !metrics.setupSmokeResult) return 'Run setup smoke before trusting ongoing autonomous work.';
80
+ return 'Use setup posture for the next visible setup step.';
81
+ }
82
+
83
+ export function buildAssistantCockpitFromMetrics(metrics: AssistantCockpitMetrics): AssistantCockpit {
84
+ const status: AssistantCockpitStatus = metrics.setupBlockers > 0 || metrics.modelStatus === 'degraded'
85
+ ? 'attention'
86
+ : metrics.personalGaps > 0
87
+ ? 'ready-with-optional-setup'
88
+ : 'ready';
89
+ const primaryNextAction = metrics.setupBlockers > 0
90
+ ? 'Finish first-run setup blockers before trusting autonomous work.'
91
+ : metrics.modelStatus === 'degraded'
92
+ ? 'Review provider and model routing before starting a new assistant task.'
93
+ : metrics.runningWork > 0
94
+ ? 'Review visible background work before starting another long-running task.'
95
+ : 'Start with the user task; route details are available only when needed.';
96
+
97
+ return {
98
+ status,
99
+ primaryNextAction,
100
+ lanes: [
101
+ lane({
102
+ id: 'setup',
103
+ label: 'Get the assistant working',
104
+ state: metrics.setupBlockers > 0 ? 'attention' : 'ready',
105
+ summary: setupLaneSummary(metrics),
106
+ nextAction: setupLaneNextAction(metrics),
107
+ routes: [
108
+ 'setup action:"status"',
109
+ 'setup action:"item"',
110
+ 'setup action:"checkpoint"',
111
+ 'setup action:"save_checkpoint"',
112
+ 'setup action:"clear_checkpoint"',
113
+ 'setup action:"token"',
114
+ 'setup action:"smoke"',
115
+ ],
116
+ }),
117
+ lane({
118
+ id: 'chat-and-model',
119
+ label: 'Talk and choose models',
120
+ state: metrics.modelStatus === 'degraded' ? 'attention' : 'ready',
121
+ summary: metrics.modelStatus === 'degraded' ? 'Model/provider API is degraded; routing still has diagnostics.' : 'Model route posture is available.',
122
+ nextAction: 'Inspect routing only when model choice, cost, privacy, or local setup matters.',
123
+ routes: ['models action:"status"', 'models action:"providers"', 'models action:"local"'],
124
+ }),
125
+ lane({
126
+ id: 'work-and-files',
127
+ label: 'Work in this project',
128
+ state: metrics.executionRoutes > 0 ? 'ready' : 'setup',
129
+ summary: metrics.executionRoutes > 0 ? 'Local read/edit/exec and recovery posture is inspectable.' : 'Execution posture needs tool availability review.',
130
+ nextAction: 'Use local work routes first; delegate only for isolation, remote work, or explicit review.',
131
+ routes: ['context action:"files"', 'agent_harness mode:"execution_posture"', 'agent_harness mode:"file_recovery"'],
132
+ }),
133
+ lane({
134
+ id: 'personal-ops',
135
+ label: 'Handle personal operations',
136
+ state: metrics.personalGaps > 0 ? 'attention' : 'ready',
137
+ summary: metrics.personalGaps > 0 ? `${metrics.personalGaps} personal-ops lane(s) need setup.` : 'Personal Ops lanes are available or safely identified.',
138
+ nextAction: 'Use Personal Ops lanes and queue for inbox, calendar, notes, tasks, and delivery readiness.',
139
+ routes: ['personal_ops action:"briefing"', 'personal_ops action:"queue"', 'personal_ops action:"intake" query:"..."', 'personal_ops action:"lane" laneId:"..."'],
140
+ }),
141
+ lane({
142
+ id: 'research-and-docs',
143
+ label: 'Research and write',
144
+ state: metrics.documentGaps > 0 ? 'attention' : 'ready',
145
+ summary: `${metrics.researchRuns} research run(s); ${metrics.documentLanes} document lane(s).`,
146
+ nextAction: 'Start with the research briefing, then use source queues, reports, documents, artifacts, and blind compare as one writing path.',
147
+ routes: ['research action:"briefing"', 'research action:"plan"', 'research action:"search"', 'research action:"runner"', 'research action:"reports"', 'agent_harness mode:"document_ops"'],
148
+ }),
149
+ lane({
150
+ id: 'background-work',
151
+ label: 'Supervise background work',
152
+ state: metrics.runningWork > 0 ? 'attention' : 'ready',
153
+ summary: metrics.runningWork > 0 ? `${metrics.runningWork} running item(s) need visible supervision.` : 'No running background work reported by the summary.',
154
+ nextAction: 'Inspect the autonomy queue, visible agents, and tracked local processes before starting, pausing, resuming, or canceling ongoing work.',
155
+ routes: ['agent_harness mode:"autonomy_queue"', 'agent_harness mode:"agent_orchestration"', 'agent_harness mode:"background_processes"', 'agent_harness mode:"autonomy_intake"'],
156
+ }),
157
+ lane({
158
+ id: 'safety-and-recovery',
159
+ label: 'Stay safe and recover',
160
+ state: metrics.securityFindings > 0 ? 'attention' : 'ready',
161
+ summary: metrics.securityFindings > 0 ? `${metrics.securityFindings} safety finding(s) need review.` : 'Security and recovery posture is inspectable.',
162
+ nextAction: 'Use security, support bundle, execution history, and file recovery routes when risk or rollback matters.',
163
+ routes: ['agent_harness mode:"security_posture"', 'agent_harness mode:"support_bundles"', 'agent_harness mode:"execution_history"'],
164
+ }),
165
+ ],
166
+ boundaryPolicy: 'Primary UX is one assistant. Host, daemon, provider, MCP, and delegation details are diagnostics and confirmation boundaries, not first questions for the user.',
167
+ };
168
+ }
169
+
170
+ export function buildAssistantCockpitFromSummaries(input: {
171
+ readonly setupPosture: unknown;
172
+ readonly projectContext?: unknown;
173
+ readonly agentOrchestration?: unknown;
174
+ readonly modelRouting: unknown;
175
+ readonly executionPosture: unknown;
176
+ readonly backgroundProcesses?: unknown;
177
+ readonly personalOps: unknown;
178
+ readonly autonomyQueue: unknown;
179
+ readonly researchRuns: unknown;
180
+ readonly documentOps: unknown;
181
+ readonly securityPosture: unknown;
182
+ }): AssistantCockpit {
183
+ const setup = readRecord(input.setupPosture);
184
+ const model = readRecord(input.modelRouting);
185
+ const execution = readRecord(input.executionPosture);
186
+ const agentOrchestration = readRecord(input.agentOrchestration);
187
+ const backgroundProcesses = readRecord(input.backgroundProcesses);
188
+ const personal = readRecord(input.personalOps);
189
+ const autonomy = readRecord(input.autonomyQueue);
190
+ const research = readRecord(input.researchRuns);
191
+ const documents = readRecord(input.documentOps);
192
+ const security = readRecord(input.securityPosture);
193
+ const setupSmokeEvidence = readNestedRecord(setup, 'setupSmokeEvidence');
194
+ const setupSmokeHistory = readNestedRecord(setup, 'setupSmokeHistory');
195
+ return buildAssistantCockpitFromMetrics({
196
+ setupBlockers: readNumber(setup, 'autonomyBlockers') || readNumber(setup, 'blockedPlanItems'),
197
+ setupSmokeResult: readString(setupSmokeEvidence, 'result') || undefined,
198
+ setupSmokeTrend: readString(setupSmokeHistory, 'trend') || undefined,
199
+ modelStatus: readString(model, 'status'),
200
+ executionRoutes: readNumber(execution, 'routes'),
201
+ personalGaps: readNumber(personal, 'gap'),
202
+ runningWork: readNumber(autonomy, 'running') || readNumber(agentOrchestration, 'running') || readNumber(research, 'running') || readNumber(backgroundProcesses, 'running'),
203
+ researchRuns: readNumber(research, 'runs'),
204
+ documentLanes: readNumber(documents, 'lanes'),
205
+ documentGaps: readNumber(documents, 'gap'),
206
+ securityFindings: readNumber(security, 'findings'),
207
+ });
208
+ }
209
+
210
+ export function buildAssistantCockpitFromWorkspaceSnapshot(snapshot: AgentWorkspaceRuntimeSnapshot): AssistantCockpit {
211
+ const setupBlockers = snapshot.setupChecklist.filter((item) => item.status === 'blocked').length;
212
+ const modelStatus = snapshot.provider === 'unknown' || snapshot.model === 'unknown' ? 'degraded' : 'ready';
213
+ const readyChannels = snapshot.channels.filter((channel) => channel.ready).length;
214
+ const enabledChannels = snapshot.channels.filter((channel) => channel.enabled).length;
215
+ const scheduleReadyRoutines = snapshot.localRoutines.filter((routine) => (
216
+ routine.enabled === true
217
+ && routine.reviewState === 'reviewed'
218
+ && (routine.missingRequirementCount ?? 0) === 0
219
+ )).length;
220
+ const personalGaps = [
221
+ enabledChannels > 0 && readyChannels === 0,
222
+ snapshot.localRoutineCount > 0 && scheduleReadyRoutines === 0,
223
+ ].filter(Boolean).length;
224
+ const runningWork = snapshot.researchRunRunningCount + snapshot.researchRunBlockedCount;
225
+ const securityFindings = [
226
+ snapshot.permissionMode === 'allow-all',
227
+ snapshot.rawPromptTelemetry,
228
+ snapshot.browserToolExposureEnabled,
229
+ snapshot.mcpQuarantinedServerCount > 0,
230
+ snapshot.mcpAllowAllServerCount > 0,
231
+ snapshot.failedRoutineScheduleReceiptCount > 0,
232
+ ].filter(Boolean).length;
233
+
234
+ return buildAssistantCockpitFromMetrics({
235
+ setupBlockers,
236
+ setupSmokeResult: undefined,
237
+ setupSmokeTrend: undefined,
238
+ modelStatus,
239
+ executionRoutes: 1,
240
+ personalGaps,
241
+ runningWork,
242
+ researchRuns: snapshot.researchRunCount,
243
+ documentLanes: 7,
244
+ documentGaps: 0,
245
+ securityFindings,
246
+ });
247
+ }
@@ -0,0 +1,96 @@
1
+ import {
2
+ AUTONOMY_SCHEDULE_METHOD,
3
+ type AutonomyScheduleFailure,
4
+ type AutonomySchedulePreview,
5
+ type AutonomyScheduleSuccess,
6
+ } from './autonomy-schedule.ts';
7
+ import { scheduleConfirmationRouteLines, scheduleNextRouteLines, scheduleRouteArg } from './schedule-next-routes.ts';
8
+
9
+ function isRecord(value: unknown): value is Record<string, unknown> {
10
+ return Boolean(value) && typeof value === 'object' && !Array.isArray(value);
11
+ }
12
+
13
+ function readString(record: Record<string, unknown>, key: string): string | null {
14
+ const value = record[key];
15
+ return typeof value === 'string' ? value : null;
16
+ }
17
+
18
+ function scheduleValue(preview: AutonomySchedulePreview): string {
19
+ if (preview.payload.kind === 'cron') {
20
+ return `${preview.payload.cron}${preview.payload.timezone ? ` [${preview.payload.timezone}]` : ''}`;
21
+ }
22
+ if (preview.payload.kind === 'every') return String(preview.payload.every);
23
+ return String(preview.payload.at);
24
+ }
25
+
26
+ function createScheduleRouteArgs(preview: AutonomySchedulePreview): string {
27
+ const args = [
28
+ `scheduleKind:${scheduleRouteArg(String(preview.payload.kind ?? ''))}`,
29
+ `scheduleValue:${scheduleRouteArg(scheduleValue(preview))}`,
30
+ ];
31
+ if (typeof preview.payload.timezone === 'string' && preview.payload.timezone) {
32
+ args.push(`timezone:${scheduleRouteArg(preview.payload.timezone)}`);
33
+ }
34
+ return args.join(' ');
35
+ }
36
+
37
+ function formatAutonomyScheduleFailureKind(kind: string): string {
38
+ if (kind === 'auth_required') return 'authorization required';
39
+ if (kind === 'connected_host_unavailable') return 'connected host unavailable';
40
+ if (kind === 'connected_host_incompatible') return 'connected host incompatible';
41
+ if (kind === 'connected_host_route_unavailable') return 'connected host route unavailable';
42
+ if (kind === 'connected_host_error') return 'connected host error';
43
+ return kind.replace(/[_-]+/g, ' ');
44
+ }
45
+
46
+ export function formatAutonomySchedulePreview(preview: AutonomySchedulePreview): string {
47
+ const delivery = preview.payload.delivery;
48
+ const deliveryTargetCount = delivery?.targets.length ?? 0;
49
+ return [
50
+ 'GoodVibes schedule preview for autonomous Agent work',
51
+ ` route ${preview.method} ${preview.route}`,
52
+ ` name ${String(preview.payload.name ?? '(service default)')}`,
53
+ ` task ${preview.task}`,
54
+ ` success ${preview.successCriteria}`,
55
+ ` schedule ${preview.payload.kind} ${scheduleValue(preview)}`,
56
+ ` enabled ${preview.payload.enabled === false ? 'no' : 'yes'}`,
57
+ ` delivery ${delivery?.mode ?? 'none'}${deliveryTargetCount > 0 ? ` (${deliveryTargetCount} target${deliveryTargetCount === 1 ? '' : 's'})` : ''}`,
58
+ ' target connected GoodVibes host/main conversation route',
59
+ ' policy visible scheduled automation; isolated Agent Knowledge only; no default knowledge/non-Agent fallback; approvals required for risky effects',
60
+ ...scheduleConfirmationRouteLines({
61
+ model: `schedule action:"create" task:${scheduleRouteArg(preview.task)} successCriteria:${scheduleRouteArg(preview.successCriteria)} ${createScheduleRouteArgs(preview)} confirm:true explicitUserRequest:"..."`,
62
+ }),
63
+ ].join('\n');
64
+ }
65
+
66
+ export function formatAutonomyScheduleSuccess(result: AutonomyScheduleSuccess): string {
67
+ const record: Record<string, unknown> = isRecord(result.schedule) ? result.schedule : {};
68
+ const id = readString(record, 'id') ?? '(unknown)';
69
+ const status = readString(record, 'status') ?? (record.enabled === false ? 'paused' : 'enabled');
70
+ return [
71
+ 'Created GoodVibes schedule for autonomous Agent work',
72
+ ` schedule ${id}`,
73
+ ` status ${status}`,
74
+ ` route ${result.kind} ${result.route}`,
75
+ ` task ${result.task}`,
76
+ ...scheduleNextRouteLines(id),
77
+ ].join('\n');
78
+ }
79
+
80
+ export function formatAutonomyScheduleFailure(failure: AutonomyScheduleFailure): string {
81
+ return [
82
+ `GoodVibes autonomous schedule error ${formatAutonomyScheduleFailureKind(failure.kind)}`,
83
+ ` ${failure.error}`,
84
+ failure.baseUrl ? ` connected host ${failure.baseUrl}` : null,
85
+ ` route ${AUTONOMY_SCHEDULE_METHOD} ${failure.route}`,
86
+ failure.kind === 'auth_required'
87
+ ? ' next pair/authenticate with the connected GoodVibes host, then retry with confirm:true.'
88
+ : null,
89
+ failure.kind === 'connected_host_unavailable'
90
+ ? ' next make the connected GoodVibes host available outside Agent, then retry.'
91
+ : null,
92
+ failure.kind === 'connected_host_incompatible' || failure.kind === 'connected_host_route_unavailable'
93
+ ? ' next update the connected GoodVibes host so public schedules.create is available.'
94
+ : null,
95
+ ].filter((line): line is string => Boolean(line)).join('\n');
96
+ }