@pellux/goodvibes-agent 1.1.6 → 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 (256) hide show
  1. package/CHANGELOG.md +176 -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 +132662 -91399
  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 +43 -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 +287 -0
  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 +267 -10
  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 +110 -89
  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/tools/tool-execution-safety.ts +41 -0
  256. package/src/version.ts +1 -1
@@ -0,0 +1,322 @@
1
+ import type { CommandContext } from '../input/command-registry.ts';
2
+ import {
3
+ AgentResearchRunRegistry,
4
+ researchRunLogTail,
5
+ researchRunReportLine,
6
+ type AgentResearchRunRecord,
7
+ } from '../agent/research-run-registry.ts';
8
+ import {
9
+ AgentResearchSourceRegistry,
10
+ researchSourceReportLine,
11
+ type AgentResearchSourceRecord,
12
+ } from '../agent/research-source-registry.ts';
13
+ import { browserControlPosture } from './agent-harness-browser-control.ts';
14
+ import { previewHarnessText } from './agent-harness-text.ts';
15
+
16
+ interface AgentHarnessResearchWorkflowArgs {
17
+ readonly query?: unknown;
18
+ readonly target?: unknown;
19
+ readonly runId?: unknown;
20
+ readonly includeParameters?: unknown;
21
+ }
22
+
23
+ function readString(value: unknown): string {
24
+ return typeof value === 'string' ? value.trim() : '';
25
+ }
26
+
27
+ function quote(value: string): string {
28
+ return JSON.stringify(value);
29
+ }
30
+
31
+ function fallbackTitle(question: string): string {
32
+ const cleaned = question.trim().replace(/\s+/g, ' ');
33
+ if (!cleaned) return 'Deep research run';
34
+ return cleaned.length <= 72 ? cleaned : `${cleaned.slice(0, 71).trimEnd()}...`;
35
+ }
36
+
37
+ function runSearchText(run: AgentResearchRunRecord): string {
38
+ return [
39
+ run.id,
40
+ run.title,
41
+ run.question,
42
+ run.goal,
43
+ run.status,
44
+ run.phase,
45
+ run.note ?? '',
46
+ run.error ?? '',
47
+ run.reportArtifactId ?? '',
48
+ ...run.plan,
49
+ ...run.nextSteps,
50
+ ...run.sourceIds,
51
+ ].join('\n').toLowerCase();
52
+ }
53
+
54
+ function sourceSearchText(source: AgentResearchSourceRecord): string {
55
+ return [
56
+ source.id,
57
+ source.question,
58
+ source.title,
59
+ source.url ?? '',
60
+ source.publisher ?? '',
61
+ source.summary,
62
+ source.evidence ?? '',
63
+ source.credibility,
64
+ source.status,
65
+ source.note ?? '',
66
+ ...source.tags,
67
+ ].join('\n').toLowerCase();
68
+ }
69
+
70
+ function resolveRun(runs: readonly AgentResearchRunRecord[], input: string): AgentResearchRunRecord | null {
71
+ const normalized = input.toLowerCase();
72
+ if (!normalized) {
73
+ return runs.find((run) => run.status === 'running' || run.status === 'blocked' || run.status === 'paused' || run.status === 'planned') ?? null;
74
+ }
75
+ return runs.find((run) => run.id.toLowerCase() === normalized || run.title.toLowerCase() === normalized)
76
+ ?? runs.find((run) => runSearchText(run).includes(normalized))
77
+ ?? null;
78
+ }
79
+
80
+ function relatedSources(
81
+ sources: readonly AgentResearchSourceRecord[],
82
+ run: AgentResearchRunRecord | null,
83
+ question: string,
84
+ ): readonly AgentResearchSourceRecord[] {
85
+ const sourceIds = new Set(run?.sourceIds.map((id) => id.toLowerCase()) ?? []);
86
+ const query = question.toLowerCase();
87
+ return sources.filter((source) => (
88
+ sourceIds.has(source.id.toLowerCase())
89
+ || (!!query && sourceSearchText(source).includes(query))
90
+ || (!!run && source.question.toLowerCase() === run.question.toLowerCase())
91
+ ));
92
+ }
93
+
94
+ function runSummary(run: AgentResearchRunRecord, includeParameters: boolean): Record<string, unknown> {
95
+ return {
96
+ runId: run.id,
97
+ title: run.title,
98
+ status: run.status,
99
+ phase: run.phase,
100
+ progress: run.progress,
101
+ sources: run.sourceIds.length,
102
+ inspectRoute: `research action:"run" runId:${quote(run.id)}`,
103
+ checkpointRoute: `research action:"checkpoint" id:${quote(run.id)} phase:"reading" progress:${Math.max(run.progress, 25)} note:"..." sourceIds:["..."] confirm:true explicitUserRequest:"..."`,
104
+ cancelRoute: `research action:"cancel" id:${quote(run.id)} note:"..." confirm:true explicitUserRequest:"..."`,
105
+ completeRoute: `research action:"complete" id:${quote(run.id)} reportArtifactId:"..." confirm:true explicitUserRequest:"..."`,
106
+ runLine: researchRunReportLine(run),
107
+ ...(includeParameters ? {
108
+ question: run.question,
109
+ goal: run.goal,
110
+ plan: run.plan,
111
+ nextSteps: run.nextSteps,
112
+ sourceIds: run.sourceIds,
113
+ logTail: researchRunLogTail(run, 5),
114
+ } : {}),
115
+ };
116
+ }
117
+
118
+ function sourceSummary(source: AgentResearchSourceRecord): Record<string, unknown> {
119
+ return {
120
+ sourceId: source.id,
121
+ title: source.title,
122
+ status: source.status,
123
+ credibility: source.credibility,
124
+ score: source.score,
125
+ inspectRoute: `research action:"source" sourceId:${quote(source.id)}`,
126
+ reviewRoute: `research action:"review_source" id:${quote(source.id)} credibility:"high|medium|mixed|low" score:80 note:"..." confirm:true explicitUserRequest:"..."`,
127
+ reportLine: researchSourceReportLine(source),
128
+ };
129
+ }
130
+
131
+ function browserRunnerContract(browser: ReturnType<typeof browserControlPosture>): Record<string, unknown> {
132
+ return {
133
+ status: browser.configured ? 'ready-with-confirmation' : 'setup-contract-needed',
134
+ userOutcome: 'Run browser-backed research only when live browser state, authenticated pages, or interactive source discovery are necessary.',
135
+ currentState: browser.configured
136
+ ? 'A reviewed browser/desktop route is configured; use it only after the user accepts the browser-backed research scope.'
137
+ : 'No reviewed browser-backed research runner is configured, so public web_search/fetch stays the current safe route.',
138
+ requiredContracts: [
139
+ 'Trusted browser or desktop-control route with setup posture status ready.',
140
+ 'Visible run id, phase/progress, current URL/task scope, checkpoint route, and pause/resume/cancel controls for every browser-backed research run.',
141
+ 'Source-capture receipt for each accepted source with URL/title/publisher/summary/provenance.',
142
+ 'Bounded log/output records suitable for the autonomy queue and research run log tail.',
143
+ 'Report draft/save handoff that preserves reviewed source ids and citation coverage requirements.',
144
+ 'No credential or page-content leakage outside bounded redacted source summaries.',
145
+ ],
146
+ setupRoutes: [
147
+ 'computer action:"control" includeParameters:true',
148
+ 'computer action:"setup" includeParameters:true',
149
+ browser.setupRoute,
150
+ ...browser.fallbackRoutes,
151
+ ],
152
+ recommendedRoute: browser.recommendedRoute,
153
+ fallbackRoutes: browser.fallbackRoutes,
154
+ policy: 'Browser-backed research is not started by this workflow plan. Use bounded public web/fetch routes until the browser runner contract is ready and the user explicitly confirms the scope.',
155
+ };
156
+ }
157
+
158
+ function visualReportContract(options: {
159
+ readonly reviewedSources: number;
160
+ readonly reportRoute: string;
161
+ readonly bundleRoute: string;
162
+ readonly question: string;
163
+ }): Record<string, unknown> {
164
+ return {
165
+ status: options.reviewedSources > 0 ? 'visual-report-packet-ready' : 'waiting-for-reviewed-sources',
166
+ userOutcome: 'Produce an inspectable research report with source-backed findings, citations, caveats, and handoff/export routes.',
167
+ currentRoute: options.reviewedSources > 0 ? options.reportRoute : options.bundleRoute,
168
+ currentState: options.reviewedSources > 0
169
+ ? 'Agent can save a citation-covered markdown report artifact with a visual report packet now; browser/PWA rendering remains an optional view over the same artifact.'
170
+ : 'Review at least one source before saving a report or visual packet.',
171
+ requiredSections: [
172
+ 'at-a-glance summary',
173
+ 'evidence matrix',
174
+ 'findings board',
175
+ 'dated source or comparison view',
176
+ 'source map',
177
+ 'citation coverage',
178
+ 'confidence and caveats',
179
+ 'open questions',
180
+ 'next actions',
181
+ 'handoff checklist',
182
+ ],
183
+ acceptanceCriteria: [
184
+ 'Every material claim maps to a reviewed source line or an explicit caveat.',
185
+ 'The report artifact includes citation coverage metadata and repair hints.',
186
+ 'The visual report packet is generated by research action:"report" visualReport:true over the same saved report/source artifacts, not a separate uncited answer.',
187
+ 'Knowledge ingest remains a separate confirmed action after report review.',
188
+ ],
189
+ routes: {
190
+ reviewedSourceBundle: options.bundleRoute,
191
+ saveVisualReport: options.reportRoute,
192
+ saveMarkdownReport: options.reportRoute,
193
+ reviewPacketWizard: 'agent_harness mode:"document_ops_lane" laneId:"review_packet_wizard"',
194
+ archiveArtifacts: 'agent_artifacts mode:"archive" artifactIds:["..."] destinationPath:"exports/research-report.zip" confirm:true explicitUserRequest:"..."',
195
+ },
196
+ fallbackRoutes: [
197
+ options.bundleRoute,
198
+ options.reportRoute,
199
+ 'agent_harness mode:"document_ops_lane" laneId:"review_packet_wizard"',
200
+ 'agent_artifacts mode:"archive" artifactIds:["..."] destinationPath:"exports/research-report.zip" confirm:true explicitUserRequest:"..."',
201
+ ],
202
+ policy: `This contract is read-only planning for ${previewHarnessText(options.question, 96)}; saving reports, exports, packages, shares, or Knowledge ingest stay on separate confirmed routes.`,
203
+ };
204
+ }
205
+
206
+ export function researchWorkflowSummary(context: CommandContext, args: AgentHarnessResearchWorkflowArgs): Record<string, unknown> {
207
+ const includeParameters = args.includeParameters === true;
208
+ const lookup = readString(args.runId) || readString(args.target) || readString(args.query);
209
+ const shellPaths = context.workspace?.shellPaths;
210
+ const runs = shellPaths ? AgentResearchRunRegistry.fromShellPaths(shellPaths).list() : [];
211
+ const sources = shellPaths ? AgentResearchSourceRegistry.fromShellPaths(shellPaths).list() : [];
212
+ const run = resolveRun(runs, lookup);
213
+ const question = run?.question || lookup || 'Research question goes here';
214
+ const title = run?.title || fallbackTitle(question);
215
+ const matchedSources = relatedSources(sources, run, question);
216
+ const reviewedSources = matchedSources.filter((source) => source.status === 'reviewed' || source.status === 'used');
217
+ const candidateSources = matchedSources.filter((source) => source.status === 'candidate');
218
+ const browser = browserControlPosture(context);
219
+ const status = !shellPaths
220
+ ? 'unavailable'
221
+ : run?.status === 'completed'
222
+ ? 'report-saved'
223
+ : reviewedSources.length > 0
224
+ ? 'ready-to-report'
225
+ : candidateSources.length > 0
226
+ ? 'needs-source-review'
227
+ : run
228
+ ? 'needs-source-collection'
229
+ : 'needs-visible-run';
230
+
231
+ const createRoute = `research action:"create_run" title:${quote(title)} question:${quote(question)} plan:["Search bounded public web sources","Capture candidate sources","Review credibility and citation value","Save sourced report artifact"] nextSteps:["Run bounded web_search/fetch and capture source candidates"] confirm:true explicitUserRequest:"..."`;
232
+ const sourceQuery = question;
233
+ const reportTitle = run ? `${run.title} report` : `${title} report`;
234
+ const reportRoute = `research action:"report" title:${quote(reportTitle)} question:${quote(question)} sources:[...] visualReport:true requireCitationCoverage:true confirm:true explicitUserRequest:"..."`;
235
+ const bundleRoute = `research action:"bundle" query:${quote(sourceQuery)} includeReportLines:true`;
236
+
237
+ return {
238
+ status,
239
+ question: previewHarnessText(question, includeParameters ? 220 : 120),
240
+ ...(run ? { run: runSummary(run, includeParameters) } : {}),
241
+ sourcePosture: {
242
+ matched: matchedSources.length,
243
+ candidates: candidateSources.length,
244
+ reviewed: reviewedSources.length,
245
+ used: matchedSources.filter((source) => source.status === 'used').length,
246
+ queueRoute: `research action:"sources" query:${quote(sourceQuery)}`,
247
+ bundleRoute,
248
+ captureRoute: `research action:"add_source" question:${quote(question)} title:"..." url:"..." summary:"..." credibility:"unreviewed" tags:["research"] confirm:true explicitUserRequest:"..."`,
249
+ reviewRoute: 'research action:"review_source" id:"..." credibility:"high|medium|mixed|low" score:80 note:"..." confirm:true explicitUserRequest:"..."',
250
+ reportReadySources: reviewedSources.slice(0, includeParameters ? 8 : 3).map(sourceSummary),
251
+ candidateSources: candidateSources.slice(0, includeParameters ? 8 : 3).map(sourceSummary),
252
+ },
253
+ browserBackedResearch: {
254
+ status: browser.status,
255
+ configured: browser.configured,
256
+ recommendedRoute: browser.recommendedRoute,
257
+ fallbackRoutes: browser.fallbackRoutes,
258
+ next: browser.configured
259
+ ? 'Use reviewed browser/desktop tooling only when live browser state or authenticated pages are necessary.'
260
+ : 'Use bounded public web_search/fetch routes now; inspect setup before browser-backed execution.',
261
+ },
262
+ browserRunnerContract: browserRunnerContract(browser),
263
+ visualReportContract: visualReportContract({
264
+ reviewedSources: reviewedSources.length,
265
+ reportRoute,
266
+ bundleRoute,
267
+ question,
268
+ }),
269
+ workflow: [
270
+ {
271
+ id: 'visible-run',
272
+ status: run ? 'ready' : 'needed',
273
+ next: run ? 'Use the existing visible run record for checkpoints and cancellation.' : 'Create a visible run before multi-step research so the user can inspect or cancel it.',
274
+ route: run ? `research action:"run" runId:${quote(run.id)}` : createRoute,
275
+ confirmationBoundary: run ? 'Read-only inspection unless checkpoint/cancel/complete route is used.' : 'Creates local visible run state only; no web request, report, Knowledge ingest, or delivery.',
276
+ },
277
+ {
278
+ id: 'collect-sources',
279
+ status: reviewedSources.length > 0 || candidateSources.length > 0 ? 'started' : 'needed',
280
+ next: browser.configured
281
+ ? 'Collect bounded sources, preferring primary/current sources, then capture each useful source in the queue.'
282
+ : 'Use web_search/fetch for public sources and capture each useful source in the queue.',
283
+ route: 'web_search query:"..." verbosity:"evidence" maxResults:10 evidenceTopN:3 or fetch urls:[...]',
284
+ captureRoute: `research action:"add_source" question:${quote(question)} title:"..." url:"..." summary:"..." credibility:"unreviewed" tags:["research"] confirm:true explicitUserRequest:"..."`,
285
+ },
286
+ {
287
+ id: 'review-sources',
288
+ status: candidateSources.length > 0 ? 'needed' : reviewedSources.length > 0 ? 'ready' : 'waiting',
289
+ next: candidateSources.length > 0 ? 'Review candidate source credibility, score, and citation value.' : 'Wait until sources are captured, then review them before report generation.',
290
+ route: `research action:"sources" query:${quote(sourceQuery)} includeParameters:true`,
291
+ reviewRoute: 'research action:"review_source" id:"..." credibility:"high|medium|mixed|low" score:80 note:"..." confirm:true explicitUserRequest:"..."',
292
+ },
293
+ {
294
+ id: 'save-report',
295
+ status: reviewedSources.length > 0 ? 'ready' : 'waiting',
296
+ next: reviewedSources.length > 0 ? 'Use the reviewed-source bundle and save a citation-covered visual report packet artifact.' : 'Save the report only after reviewed or used sources exist.',
297
+ route: reviewedSources.length > 0 ? bundleRoute : `research action:"sources" query:${quote(sourceQuery)}`,
298
+ reportRoute,
299
+ },
300
+ {
301
+ id: 'promote-knowledge',
302
+ status: run?.reportArtifactId ? 'ready' : 'waiting',
303
+ next: run?.reportArtifactId ? 'Promote the reviewed report artifact only if the user wants it durable in Agent Knowledge.' : 'Wait for a saved report artifact before Knowledge promotion.',
304
+ route: run?.reportArtifactId
305
+ ? `agent_knowledge_ingest sourceKind:"artifact" artifactId:${quote(run.reportArtifactId)} confirm:true explicitUserRequest:"..."`
306
+ : 'agent_knowledge_ingest sourceKind:"artifact" artifactId:"..." confirm:true explicitUserRequest:"..."',
307
+ },
308
+ ],
309
+ routes: {
310
+ createRun: createRoute,
311
+ inspectRuns: 'research action:"runs"',
312
+ inspectSources: `research action:"sources" query:${quote(sourceQuery)}`,
313
+ bundleSources: bundleRoute,
314
+ saveReport: reportRoute,
315
+ ...(run ? {
316
+ checkpointRun: `research action:"checkpoint" id:${quote(run.id)} phase:"reading" progress:${Math.max(run.progress, 25)} note:"..." sourceIds:["..."] confirm:true explicitUserRequest:"..."`,
317
+ completeRun: `research action:"complete" id:${quote(run.id)} reportArtifactId:"..." confirm:true explicitUserRequest:"..."`,
318
+ } : {}),
319
+ },
320
+ policy: 'This is a read-only workflow plan. It does not search the web, mutate run/source state, save a report, ingest Knowledge, or send external messages. Use the returned confirmed routes for each separate effect.',
321
+ };
322
+ }
@@ -159,11 +159,11 @@ function describeFindingCandidate(finding: SecurityFinding): Record<string, unkn
159
159
  }
160
160
 
161
161
  function securityFindingModelRoute(): string {
162
- return 'agent_harness mode:"security_finding" or mode:"run_command"';
162
+ return 'security action:"finding" or workspace action:"run_command"';
163
163
  }
164
164
 
165
165
  function supportBundleModelRoute(): string {
166
- return 'agent_harness mode:"support_bundle" or mode:"run_workspace_action"';
166
+ return 'support action:"bundle" or workspace action:"run"';
167
167
  }
168
168
 
169
169
  function describeFinding(finding: SecurityFinding, includeParameters: boolean, lookup?: Record<string, unknown>): Record<string, unknown> {
@@ -83,8 +83,8 @@ function describeEndpoint(
83
83
  policy: {
84
84
  effect: 'read-only',
85
85
  modelOperation: 'Inspect endpoint binding, network-facing posture, and optional reachability only.',
86
- lifecycle: 'GoodVibes Agent does not start, stop, restart, install, expose, or mutate connected-host listeners.',
87
- settings: 'Use agent_harness mode:"settings" or mode:"get_setting" for read-only inspection of endpoint settings; connected-host lifecycle/listener settings stay locked in Agent.',
86
+ lifecycle: 'Use setup or confirmed GoodVibes daemon operator methods for service lifecycle/listener changes.',
87
+ settings: 'Use settings action:"list|get" for endpoint settings; raw danger toggles stay protected.',
88
88
  },
89
89
  } : {}),
90
90
  };
@@ -101,7 +101,7 @@ function describeEndpointCandidate(endpoint: CliServiceEndpointPosture): Record<
101
101
  }
102
102
 
103
103
  function serviceEndpointModelRoute(): string {
104
- return 'agent_harness mode:"service_endpoint" or mode:"settings"';
104
+ return 'host action:"service" or settings action:"get"';
105
105
  }
106
106
 
107
107
  function endpointLookupFromArgs(args: AgentHarnessServicePostureArgs): { readonly source: ServiceEndpointLookupSource; readonly input: string } | null {
@@ -174,7 +174,7 @@ export function servicePostureCatalogStatus(): Record<string, unknown> {
174
174
  modes: ['service_posture', 'service_endpoint'],
175
175
  endpointIds: SERVICE_ENDPOINT_IDS,
176
176
  readOnly: true,
177
- lifecycle: 'Connected-host and listener lifecycle stay outside GoodVibes Agent.',
177
+ lifecycle: 'Service posture is diagnostic; lifecycle/listener changes require setup or confirmed daemon operator methods.',
178
178
  };
179
179
  }
180
180
 
@@ -185,9 +185,9 @@ export async function servicePostureSummary(
185
185
  const includeDetails = args.includeParameters === true;
186
186
  const posture = await buildCliServicePosture(servicePostureRuntime(context), servicePostureOptions(args));
187
187
  return {
188
- ownership: 'external-connected-host',
188
+ ownership: 'goodvibes-daemon',
189
189
  readOnly: true,
190
- lifecycle: 'GoodVibes Agent reports connected-host/service posture but does not start, stop, restart, install, expose, or mutate host listeners.',
190
+ lifecycle: 'GoodVibes Agent reports service posture here. Lifecycle/listener changes require setup or confirmed daemon operator methods.',
191
191
  modelRoute: serviceEndpointModelRoute(),
192
192
  config: posture.config,
193
193
  managed: posture.managed,
@@ -195,9 +195,9 @@ export async function servicePostureSummary(
195
195
  log: summarizeLog(posture, includeDetails),
196
196
  issues: posture.issues,
197
197
  ...(includeDetails ? { modelAccess: {
198
- endpointLookup: 'Use mode:"service_endpoint" with endpointId, target, or query to inspect one endpoint.',
199
- settings: 'Use mode:"settings" with includeHidden:true for endpoint setting descriptors. Host-owned listener settings remain read-only.',
200
- liveHostStatus: 'Use mode:"connected_host_status" for token posture and Agent Knowledge route readiness.',
198
+ endpointLookup: 'Use host action:"service" with endpointId, target, or query to inspect one endpoint.',
199
+ settings: 'Use settings action:"list" includeHidden:true for endpoint setting descriptors. Host-owned listener settings remain read-only.',
200
+ liveHostStatus: 'Use host action:"status" for token posture and Agent Knowledge route readiness.',
201
201
  } } : {}),
202
202
  };
203
203
  }
@@ -95,7 +95,7 @@ function describeSessionCandidate(session: SessionInfoLike, currentSessionId: st
95
95
  }
96
96
 
97
97
  function sessionModelRoute(): string {
98
- return 'agent_harness mode:"session" or mode:"run_command"';
98
+ return 'sessions action:"get" or workspace action:"run_command"';
99
99
  }
100
100
 
101
101
  function bookmarkModelRoute(): string {
@@ -132,8 +132,8 @@ function describeSession(
132
132
  ...(options.includeParameters ? {
133
133
  filePath: session.filePath,
134
134
  modelRoutes: {
135
- inspectSessions: 'agent_harness mode:"sessions"',
136
- inspectSession: 'agent_harness mode:"session"',
135
+ inspectSessions: 'sessions action:"list"',
136
+ inspectSession: 'sessions action:"get"',
137
137
  resumeSession: '/session resume <session-id-or-name>',
138
138
  saveSession: '/session save [name]',
139
139
  exportSession: '/session export <session-id> markdown',