@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,523 @@
1
+ import type { AgentWorkspaceActionResult, AgentWorkspaceLocalEditor, AgentWorkspaceReviewPacketDefaults } from './agent-workspace-types.ts';
2
+
3
+ type AgentWorkspaceFieldReader = (fieldId: string) => string;
4
+
5
+ export interface AgentDocumentReviewerReadinessToolArgs {
6
+ readonly mode: 'document_ops_lane';
7
+ readonly laneId: 'reviewer_readiness' | 'review_packet_wizard';
8
+ readonly includeParameters: boolean;
9
+ }
10
+
11
+ export interface AgentDocumentReviewPacketPresetToolArgs {
12
+ readonly mode: 'save';
13
+ readonly name: string;
14
+ readonly documentId?: string;
15
+ readonly documentTitle?: string;
16
+ readonly documentExportArtifactId?: string;
17
+ readonly comparisonArtifactId?: string;
18
+ readonly judgmentArtifactId?: string;
19
+ readonly revealedJudgmentArtifactId?: string;
20
+ readonly routeDecisionArtifactId?: string;
21
+ readonly routeDecision?: string;
22
+ readonly handoffArtifactId?: string;
23
+ readonly handoffArchiveArtifactId?: string;
24
+ readonly relatedArtifactIds: readonly string[];
25
+ readonly summary?: string;
26
+ readonly confirm: boolean;
27
+ readonly explicitUserRequest: string;
28
+ }
29
+
30
+ export interface AgentDocumentReviewPacketPresetRefreshToolArgs {
31
+ readonly mode: 'refresh';
32
+ readonly artifactId: string;
33
+ readonly name?: string;
34
+ readonly summary?: string;
35
+ readonly confirm: boolean;
36
+ readonly explicitUserRequest: string;
37
+ }
38
+
39
+ export interface AgentDocumentReviewPacketShareToolArgs {
40
+ readonly archiveArtifactId: string;
41
+ readonly title?: string;
42
+ readonly message?: string;
43
+ readonly channel?: string;
44
+ readonly route?: string;
45
+ readonly webhook?: string;
46
+ readonly link?: string;
47
+ readonly confirm: boolean;
48
+ readonly explicitUserRequest: string;
49
+ }
50
+
51
+ export function createAgentDocumentReviewerReadinessEditor(): AgentWorkspaceLocalEditor {
52
+ return {
53
+ kind: 'document-reviewer-readiness',
54
+ mode: 'create',
55
+ title: 'Review Readiness Preflight',
56
+ selectedFieldIndex: 0,
57
+ message: 'Inspect unresolved document comments, proposed suggestions, missing source artifacts, unrevealed comparisons, route-change decisions, and reviewer handoff evidence before export, archive, or route update.',
58
+ fields: [
59
+ { id: 'scope', label: 'Scope', value: 'documents-and-compare', required: false, multiline: false, hint: 'Read-only preflight for Document Ops reviewer readiness.' },
60
+ { id: 'includeRoutes', label: 'Repair routes', value: 'yes', required: false, multiline: false, hint: 'yes/no. Yes includes exact inspect and repair routes for the next action.' },
61
+ ],
62
+ };
63
+ }
64
+
65
+ export function createAgentDocumentReviewPacketWizardEditor(): AgentWorkspaceLocalEditor {
66
+ return {
67
+ kind: 'document-review-packet-wizard',
68
+ mode: 'create',
69
+ title: 'Review Packet Wizard',
70
+ selectedFieldIndex: 0,
71
+ message: 'Walk the current reviewer packet through draft review, document export, comparison judgment, handoff, route decision, and final archive review. This is read-only and returns existing routes.',
72
+ fields: [
73
+ { id: 'focus', label: 'Focus', value: 'next', required: false, multiline: false, hint: 'next, all, blocked, backtrack, or final. The wizard never mutates state by itself.' },
74
+ { id: 'includeRoutes', label: 'Routes', value: 'yes', required: false, multiline: false, hint: 'yes/no. Yes includes exact user, model, action, and backtrack routes.' },
75
+ ],
76
+ };
77
+ }
78
+
79
+ export function createAgentDocumentReviewPacketPresetEditor(
80
+ defaults: AgentWorkspaceReviewPacketDefaults | null = null,
81
+ ): AgentWorkspaceLocalEditor {
82
+ const title = defaults?.documentTitle || defaults?.documentId || 'Current reviewer packet';
83
+ return {
84
+ kind: 'document-review-packet-preset',
85
+ mode: 'create',
86
+ title: 'Save Review Packet Preset',
87
+ selectedFieldIndex: 0,
88
+ message: 'Save the current document, comparison, judgment, route decision, handoff, archive, and related evidence ids as a reusable local preset artifact. This does not change the document, selected model, or archive state.',
89
+ fields: [
90
+ { id: 'name', label: 'Preset name', value: `${title} preset`, required: true, multiline: false, hint: 'Short user-visible name for reusing this review packet.' },
91
+ { id: 'documentId', label: 'Document id', value: defaults?.documentId ?? '', required: false, multiline: false, hint: 'Agent document draft id.' },
92
+ { id: 'documentTitle', label: 'Document title', value: defaults?.documentTitle ?? '', required: false, multiline: false, hint: 'Optional title shown in preset summaries.' },
93
+ { id: 'documentExportArtifactId', label: 'Document export', value: defaults?.documentExportArtifactId ?? '', required: false, multiline: false, hint: 'Exported document evidence artifact id.' },
94
+ { id: 'comparisonArtifactId', label: 'Comparison', value: defaults?.comparisonArtifactId ?? '', required: false, multiline: false, hint: 'Saved blind comparison artifact id.' },
95
+ { id: 'judgmentArtifactId', label: 'Judgment', value: defaults?.judgmentArtifactId ?? '', required: false, multiline: false, hint: 'Saved comparison judgment artifact id.' },
96
+ { id: 'revealedJudgmentArtifactId', label: 'Revealed judgment', value: defaults?.revealedJudgmentArtifactId ?? '', required: false, multiline: false, hint: 'Revealed judgment artifact id for route decisions.' },
97
+ { id: 'routeDecisionArtifactId', label: 'Route decision', value: defaults?.routeDecisionArtifactId ?? '', required: false, multiline: false, hint: 'Saved leave-unchanged or applied-winner route-decision receipt id.' },
98
+ { id: 'routeDecision', label: 'Decision label', value: defaults?.routeDecision ?? '', required: false, multiline: false, hint: 'left-unchanged or applied-winner when known.' },
99
+ { id: 'handoffArtifactId', label: 'Reviewer handoff', value: defaults?.handoffArtifactId ?? '', required: false, multiline: false, hint: 'Reviewer handoff artifact id.' },
100
+ { id: 'handoffArchiveArtifactId', label: 'Handoff archive', value: defaults?.handoffArchiveArtifactId ?? '', required: false, multiline: false, hint: 'Final reviewer handoff ZIP artifact id.' },
101
+ { id: 'relatedArtifactIds', label: 'Related artifacts', value: defaults?.relatedArtifactIds.join('\n') ?? '', required: false, multiline: true, hint: 'Comma- or newline-separated source, export, attachment, receipt, or evidence artifact ids.' },
102
+ { id: 'summary', label: 'Summary', value: defaults?.summary ?? '', required: false, multiline: false, hint: 'Short packet summary shown in list and timeline views.' },
103
+ { id: 'confirm', label: 'Confirm save', value: 'no', required: true, multiline: false, hint: 'Type yes only after the user explicitly asks to save this packet preset.' },
104
+ ],
105
+ };
106
+ }
107
+
108
+ export function createAgentDocumentReviewPacketPresetRefreshEditor(): AgentWorkspaceLocalEditor {
109
+ return {
110
+ kind: 'document-review-packet-preset-refresh',
111
+ mode: 'create',
112
+ title: 'Refresh Review Packet Preset',
113
+ selectedFieldIndex: 0,
114
+ message: 'Save a new preset artifact from an existing stale preset using its freshness recommendations. This keeps the source preset as audit history and does not change documents, model routing, handoffs, or archives.',
115
+ fields: [
116
+ { id: 'artifactId', label: 'Preset artifact id', value: '', required: true, multiline: false, hint: 'Existing review packet preset artifact id from list/show output.' },
117
+ { id: 'name', label: 'New preset name', value: '', required: false, multiline: false, hint: 'Optional. Defaults to the old preset name plus "refreshed".' },
118
+ { id: 'summary', label: 'New summary', value: '', required: false, multiline: false, hint: 'Optional. Defaults to the old summary with stale ids replaced when possible.' },
119
+ { id: 'confirm', label: 'Confirm refresh', value: 'no', required: true, multiline: false, hint: 'Type yes only after the user explicitly asks to refresh this packet preset.' },
120
+ ],
121
+ };
122
+ }
123
+
124
+ export function createAgentDocumentReviewPacketShareEditor(
125
+ defaults: AgentWorkspaceReviewPacketDefaults | null = null,
126
+ ): AgentWorkspaceLocalEditor {
127
+ return {
128
+ kind: 'document-review-packet-share',
129
+ mode: 'create',
130
+ title: 'Share Review Packet',
131
+ selectedFieldIndex: 0,
132
+ message: 'Share one saved reviewer handoff ZIP archive reference through a configured channel target. The tool validates the archive, includes packet evidence ids, and does not send ZIP bytes.',
133
+ fields: [
134
+ { id: 'archiveArtifactId', label: 'Archive artifact id', value: defaults?.handoffArchiveArtifactId ?? '', required: true, multiline: false, hint: defaults?.handoffArchiveArtifactId ? `Default from latest packet archive. Packet default: ${defaults.summary}.` : 'Saved reviewer handoff ZIP artifact id from the final archive step.' },
135
+ { id: 'title', label: 'Title', value: 'GoodVibes Agent review packet', required: false, multiline: false, hint: 'Optional delivery title.' },
136
+ { id: 'message', label: 'Message', value: '', required: false, multiline: true, hint: 'Optional note. The tool appends archive evidence, counts, ids, and export route automatically.' },
137
+ { id: 'channel', label: 'Channel target', value: '', required: false, multiline: false, hint: 'Optional surface[:route[:label]], such as slack:ops:Ops. Fill exactly one target field.' },
138
+ { id: 'route', label: 'Route target', value: '', required: false, multiline: false, hint: 'Optional route id or route:label. Fill exactly one target field.' },
139
+ { id: 'webhook', label: 'Webhook URL', value: '', required: false, multiline: false, hint: 'Optional http(s) webhook target. Fill exactly one target field.' },
140
+ { id: 'link', label: 'Link target', value: '', required: false, multiline: false, hint: 'Optional link delivery target. Fill exactly one target field.' },
141
+ { id: 'confirm', label: 'Confirm share', value: 'no', required: true, multiline: false, hint: 'Type yes only after the user explicitly asks to share this review packet.' },
142
+ ],
143
+ };
144
+ }
145
+
146
+ function isAffirmative(value: string): boolean {
147
+ const normalized = value.trim().toLowerCase();
148
+ return normalized === 'yes' || normalized === 'true';
149
+ }
150
+
151
+ function readList(value: string): readonly string[] {
152
+ const seen = new Set<string>();
153
+ const result: string[] = [];
154
+ for (const entry of value.split(/[,\n]/)) {
155
+ const trimmed = entry.trim();
156
+ if (!trimmed || seen.has(trimmed)) continue;
157
+ seen.add(trimmed);
158
+ result.push(trimmed);
159
+ }
160
+ return result;
161
+ }
162
+
163
+ function optionalField(readField: AgentWorkspaceFieldReader, fieldId: string): string | undefined {
164
+ const value = readField(fieldId).trim();
165
+ return value ? value : undefined;
166
+ }
167
+
168
+ export function buildAgentDocumentReviewerReadinessToolArgs(
169
+ readField: AgentWorkspaceFieldReader,
170
+ ): AgentDocumentReviewerReadinessToolArgs {
171
+ return {
172
+ mode: 'document_ops_lane',
173
+ laneId: 'reviewer_readiness',
174
+ includeParameters: isAffirmative(readField('includeRoutes')),
175
+ };
176
+ }
177
+
178
+ export function buildAgentDocumentReviewPacketWizardToolArgs(
179
+ readField: AgentWorkspaceFieldReader,
180
+ ): AgentDocumentReviewerReadinessToolArgs {
181
+ return {
182
+ mode: 'document_ops_lane',
183
+ laneId: 'review_packet_wizard',
184
+ includeParameters: isAffirmative(readField('includeRoutes')),
185
+ };
186
+ }
187
+
188
+ export function buildAgentDocumentReviewPacketPresetToolArgs(
189
+ readField: AgentWorkspaceFieldReader,
190
+ explicitUserRequest: string,
191
+ ): AgentDocumentReviewPacketPresetToolArgs {
192
+ const documentId = optionalField(readField, 'documentId');
193
+ const documentTitle = optionalField(readField, 'documentTitle');
194
+ const documentExportArtifactId = optionalField(readField, 'documentExportArtifactId');
195
+ const comparisonArtifactId = optionalField(readField, 'comparisonArtifactId');
196
+ const judgmentArtifactId = optionalField(readField, 'judgmentArtifactId');
197
+ const revealedJudgmentArtifactId = optionalField(readField, 'revealedJudgmentArtifactId');
198
+ const routeDecisionArtifactId = optionalField(readField, 'routeDecisionArtifactId');
199
+ const routeDecision = optionalField(readField, 'routeDecision');
200
+ const handoffArtifactId = optionalField(readField, 'handoffArtifactId');
201
+ const handoffArchiveArtifactId = optionalField(readField, 'handoffArchiveArtifactId');
202
+ const summary = optionalField(readField, 'summary');
203
+ return {
204
+ mode: 'save',
205
+ name: readField('name').trim() || 'Reviewer packet preset',
206
+ ...(documentId ? { documentId } : {}),
207
+ ...(documentTitle ? { documentTitle } : {}),
208
+ ...(documentExportArtifactId ? { documentExportArtifactId } : {}),
209
+ ...(comparisonArtifactId ? { comparisonArtifactId } : {}),
210
+ ...(judgmentArtifactId ? { judgmentArtifactId } : {}),
211
+ ...(revealedJudgmentArtifactId ? { revealedJudgmentArtifactId } : {}),
212
+ ...(routeDecisionArtifactId ? { routeDecisionArtifactId } : {}),
213
+ ...(routeDecision ? { routeDecision } : {}),
214
+ ...(handoffArtifactId ? { handoffArtifactId } : {}),
215
+ ...(handoffArchiveArtifactId ? { handoffArchiveArtifactId } : {}),
216
+ relatedArtifactIds: readList(readField('relatedArtifactIds')),
217
+ ...(summary ? { summary } : {}),
218
+ confirm: isAffirmative(readField('confirm')),
219
+ explicitUserRequest,
220
+ };
221
+ }
222
+
223
+ export function buildAgentDocumentReviewPacketPresetRefreshToolArgs(
224
+ readField: AgentWorkspaceFieldReader,
225
+ explicitUserRequest: string,
226
+ ): AgentDocumentReviewPacketPresetRefreshToolArgs {
227
+ const name = optionalField(readField, 'name');
228
+ const summary = optionalField(readField, 'summary');
229
+ return {
230
+ mode: 'refresh',
231
+ artifactId: readField('artifactId').trim(),
232
+ ...(name ? { name } : {}),
233
+ ...(summary ? { summary } : {}),
234
+ confirm: isAffirmative(readField('confirm')),
235
+ explicitUserRequest,
236
+ };
237
+ }
238
+
239
+ export function buildAgentDocumentReviewPacketShareToolArgs(
240
+ readField: AgentWorkspaceFieldReader,
241
+ explicitUserRequest: string,
242
+ ): AgentDocumentReviewPacketShareToolArgs {
243
+ const title = optionalField(readField, 'title');
244
+ const message = optionalField(readField, 'message');
245
+ const channel = optionalField(readField, 'channel');
246
+ const route = optionalField(readField, 'route');
247
+ const webhook = optionalField(readField, 'webhook');
248
+ const link = optionalField(readField, 'link');
249
+ return {
250
+ archiveArtifactId: readField('archiveArtifactId').trim(),
251
+ ...(title ? { title } : {}),
252
+ ...(message ? { message } : {}),
253
+ ...(channel ? { channel } : {}),
254
+ ...(route ? { route } : {}),
255
+ ...(webhook ? { webhook } : {}),
256
+ ...(link ? { link } : {}),
257
+ confirm: isAffirmative(readField('confirm')),
258
+ explicitUserRequest,
259
+ };
260
+ }
261
+
262
+ export function buildAgentDocumentReviewerReadinessPromptSubmission(
263
+ editor: AgentWorkspaceLocalEditor,
264
+ readField: AgentWorkspaceFieldReader,
265
+ promptDispatchAvailable: boolean,
266
+ ): {
267
+ readonly kind: 'editor';
268
+ readonly editor: AgentWorkspaceLocalEditor;
269
+ readonly status: string;
270
+ readonly actionResult: AgentWorkspaceActionResult;
271
+ } | {
272
+ readonly kind: 'prompt';
273
+ readonly prompt: string;
274
+ readonly status: string;
275
+ readonly actionResult: AgentWorkspaceActionResult;
276
+ } {
277
+ if (!promptDispatchAvailable) {
278
+ return {
279
+ kind: 'editor',
280
+ editor: {
281
+ ...editor,
282
+ message: 'Prompt dispatch is unavailable in this runtime. Use agent_harness mode:"run_workspace_action" with this editor schema.',
283
+ },
284
+ status: 'Prompt dispatch unavailable.',
285
+ actionResult: {
286
+ kind: 'error',
287
+ title: 'Prompt dispatch unavailable',
288
+ detail: 'This runtime cannot submit the reviewer-readiness preflight from the workspace form.',
289
+ safety: 'read-only',
290
+ },
291
+ };
292
+ }
293
+
294
+ const includeRoutes = isAffirmative(readField('includeRoutes'));
295
+ return {
296
+ kind: 'prompt',
297
+ prompt: [
298
+ 'Inspect Document Ops reviewer readiness with the `agent_harness` tool.',
299
+ 'Use mode:"document_ops_lane" and laneId:"reviewer_readiness".',
300
+ `Include exact repair routes: ${includeRoutes ? 'yes' : 'no'}.`,
301
+ 'Do not export, archive, reveal, apply a route update, or mutate a document from this preflight.',
302
+ ].join('\n'),
303
+ status: 'Submitting reviewer-readiness preflight.',
304
+ actionResult: {
305
+ kind: 'guidance',
306
+ title: 'Review readiness preflight',
307
+ detail: 'Submitted a read-only Document Ops readiness check before export, handoff archive, or route update.',
308
+ safety: 'read-only',
309
+ },
310
+ };
311
+ }
312
+
313
+ export function buildAgentDocumentReviewPacketPresetPromptSubmission(
314
+ editor: AgentWorkspaceLocalEditor,
315
+ readField: AgentWorkspaceFieldReader,
316
+ promptDispatchAvailable: boolean,
317
+ ): {
318
+ readonly kind: 'editor';
319
+ readonly editor: AgentWorkspaceLocalEditor;
320
+ readonly status: string;
321
+ readonly actionResult: AgentWorkspaceActionResult;
322
+ } | {
323
+ readonly kind: 'prompt';
324
+ readonly prompt: string;
325
+ readonly status: string;
326
+ readonly actionResult: AgentWorkspaceActionResult;
327
+ } {
328
+ if (!promptDispatchAvailable) {
329
+ return {
330
+ kind: 'editor',
331
+ editor: {
332
+ ...editor,
333
+ message: 'Prompt dispatch is unavailable in this runtime. Use agent_harness mode:"run_workspace_action" with this editor schema.',
334
+ },
335
+ status: 'Prompt dispatch unavailable.',
336
+ actionResult: {
337
+ kind: 'error',
338
+ title: 'Prompt dispatch unavailable',
339
+ detail: 'This runtime cannot submit the review packet preset save from the workspace form.',
340
+ safety: 'safe',
341
+ },
342
+ };
343
+ }
344
+
345
+ const toolArgs = buildAgentDocumentReviewPacketPresetToolArgs(
346
+ readField,
347
+ 'Save this Document Ops review packet preset from the workspace form.',
348
+ );
349
+ return {
350
+ kind: 'prompt',
351
+ prompt: [
352
+ 'Save a reusable Document Ops review packet preset with the `agent_review_packet_presets` tool.',
353
+ `Use these preset fields: ${JSON.stringify(toolArgs, null, 2)}.`,
354
+ 'Only call the tool with confirm:true when the user explicitly asked GoodVibes Agent to save this preset. The save creates one local preset artifact and must not mutate documents, model routing, handoffs, or archives.',
355
+ ].join('\n'),
356
+ status: 'Submitting review packet preset save.',
357
+ actionResult: {
358
+ kind: 'guidance',
359
+ title: 'Save review packet preset',
360
+ detail: 'Submitted a confirmed preset-save request for the current document/review packet artifact ids.',
361
+ safety: 'safe',
362
+ },
363
+ };
364
+ }
365
+
366
+ export function buildAgentDocumentReviewPacketPresetRefreshPromptSubmission(
367
+ editor: AgentWorkspaceLocalEditor,
368
+ readField: AgentWorkspaceFieldReader,
369
+ promptDispatchAvailable: boolean,
370
+ ): {
371
+ readonly kind: 'editor';
372
+ readonly editor: AgentWorkspaceLocalEditor;
373
+ readonly status: string;
374
+ readonly actionResult: AgentWorkspaceActionResult;
375
+ } | {
376
+ readonly kind: 'prompt';
377
+ readonly prompt: string;
378
+ readonly status: string;
379
+ readonly actionResult: AgentWorkspaceActionResult;
380
+ } {
381
+ if (!promptDispatchAvailable) {
382
+ return {
383
+ kind: 'editor',
384
+ editor: {
385
+ ...editor,
386
+ message: 'Prompt dispatch is unavailable in this runtime. Use agent_harness mode:"run_workspace_action" with this editor schema.',
387
+ },
388
+ status: 'Prompt dispatch unavailable.',
389
+ actionResult: {
390
+ kind: 'error',
391
+ title: 'Prompt dispatch unavailable',
392
+ detail: 'This runtime cannot submit the review packet preset refresh from the workspace form.',
393
+ safety: 'safe',
394
+ },
395
+ };
396
+ }
397
+
398
+ const toolArgs = buildAgentDocumentReviewPacketPresetRefreshToolArgs(
399
+ readField,
400
+ 'Refresh this Document Ops review packet preset from the workspace form.',
401
+ );
402
+ return {
403
+ kind: 'prompt',
404
+ prompt: [
405
+ 'Refresh a stale reusable Document Ops review packet preset with the `agent_review_packet_presets` tool.',
406
+ `Use these refresh fields: ${JSON.stringify(toolArgs, null, 2)}.`,
407
+ 'Only call the tool with confirm:true when the user explicitly asked GoodVibes Agent to refresh this preset. The refresh creates one new local preset artifact from freshness recommendations and must not mutate documents, model routing, handoffs, archives, or the source preset.',
408
+ ].join('\n'),
409
+ status: 'Submitting review packet preset refresh.',
410
+ actionResult: {
411
+ kind: 'guidance',
412
+ title: 'Refresh review packet preset',
413
+ detail: 'Submitted a confirmed preset-refresh request that saves a new local artifact from freshness recommendations.',
414
+ safety: 'safe',
415
+ },
416
+ };
417
+ }
418
+
419
+ export function buildAgentDocumentReviewPacketSharePromptSubmission(
420
+ editor: AgentWorkspaceLocalEditor,
421
+ readField: AgentWorkspaceFieldReader,
422
+ promptDispatchAvailable: boolean,
423
+ ): {
424
+ readonly kind: 'editor';
425
+ readonly editor: AgentWorkspaceLocalEditor;
426
+ readonly status: string;
427
+ readonly actionResult: AgentWorkspaceActionResult;
428
+ } | {
429
+ readonly kind: 'prompt';
430
+ readonly prompt: string;
431
+ readonly status: string;
432
+ readonly actionResult: AgentWorkspaceActionResult;
433
+ } {
434
+ if (!promptDispatchAvailable) {
435
+ return {
436
+ kind: 'editor',
437
+ editor: {
438
+ ...editor,
439
+ message: 'Prompt dispatch is unavailable in this runtime. Use agent_harness mode:"run_workspace_action" with this editor schema.',
440
+ },
441
+ status: 'Prompt dispatch unavailable.',
442
+ actionResult: {
443
+ kind: 'error',
444
+ title: 'Prompt dispatch unavailable',
445
+ detail: 'This runtime cannot submit the review packet share from the workspace form.',
446
+ safety: 'safe',
447
+ },
448
+ };
449
+ }
450
+
451
+ const toolArgs = buildAgentDocumentReviewPacketShareToolArgs(
452
+ readField,
453
+ 'Share this Document Ops review packet archive from the workspace form.',
454
+ );
455
+ return {
456
+ kind: 'prompt',
457
+ prompt: [
458
+ 'Share a saved Document Ops reviewer packet archive with the `agent_review_packet_share` tool.',
459
+ `Use these share fields: ${JSON.stringify(toolArgs, null, 2)}.`,
460
+ 'Only call the tool with confirm:true when the user explicitly asked GoodVibes Agent to share this packet. The tool validates the saved handoff archive, sends a plain-text archive reference through the configured target, and must not print or attach ZIP bytes.',
461
+ ].join('\n'),
462
+ status: 'Submitting review packet share.',
463
+ actionResult: {
464
+ kind: 'guidance',
465
+ title: 'Share review packet',
466
+ detail: 'Submitted a confirmed reviewer packet share request that sends a channel reference to the saved handoff archive.',
467
+ safety: 'safe',
468
+ },
469
+ };
470
+ }
471
+
472
+ export function buildAgentDocumentReviewPacketWizardPromptSubmission(
473
+ editor: AgentWorkspaceLocalEditor,
474
+ readField: AgentWorkspaceFieldReader,
475
+ promptDispatchAvailable: boolean,
476
+ ): {
477
+ readonly kind: 'editor';
478
+ readonly editor: AgentWorkspaceLocalEditor;
479
+ readonly status: string;
480
+ readonly actionResult: AgentWorkspaceActionResult;
481
+ } | {
482
+ readonly kind: 'prompt';
483
+ readonly prompt: string;
484
+ readonly status: string;
485
+ readonly actionResult: AgentWorkspaceActionResult;
486
+ } {
487
+ if (!promptDispatchAvailable) {
488
+ return {
489
+ kind: 'editor',
490
+ editor: {
491
+ ...editor,
492
+ message: 'Prompt dispatch is unavailable in this runtime. Use agent_harness mode:"run_workspace_action" with this editor schema.',
493
+ },
494
+ status: 'Prompt dispatch unavailable.',
495
+ actionResult: {
496
+ kind: 'error',
497
+ title: 'Prompt dispatch unavailable',
498
+ detail: 'This runtime cannot submit the review packet wizard from the workspace form.',
499
+ safety: 'read-only',
500
+ },
501
+ };
502
+ }
503
+
504
+ const focus = readField('focus').trim() || 'next';
505
+ const includeRoutes = isAffirmative(readField('includeRoutes'));
506
+ return {
507
+ kind: 'prompt',
508
+ prompt: [
509
+ 'Inspect the Document Ops review packet wizard with the `agent_harness` tool.',
510
+ 'Use mode:"document_ops_lane" and laneId:"review_packet_wizard".',
511
+ `Focus: ${focus}.`,
512
+ `Include exact routes: ${includeRoutes ? 'yes' : 'no'}.`,
513
+ 'Do not export, archive, reveal, apply a route update, or mutate a document from this wizard. Use the returned existing routes only after explicit user confirmation.',
514
+ ].join('\n'),
515
+ status: 'Submitting review packet wizard.',
516
+ actionResult: {
517
+ kind: 'guidance',
518
+ title: 'Review packet wizard',
519
+ detail: 'Submitted a read-only guided packet flow with progress, backtrack routes, route decision, and final evidence review.',
520
+ safety: 'read-only',
521
+ },
522
+ };
523
+ }
@@ -37,7 +37,7 @@ export const AGENT_WORKSPACE_HOST_CATEGORY: AgentWorkspaceCategory = {
37
37
  { id: 'host-provider-detail', label: 'Provider detail', detail: 'Open a provider-id form for account and provider configuration review.', editorKind: 'provider-inspect', kind: 'editor', safety: 'read-only' },
38
38
  { id: 'host-provider-routes', label: 'Provider routes', detail: 'Open a provider-id form for account, subscription, and route inspection.', editorKind: 'provider-routes', kind: 'editor', safety: 'read-only' },
39
39
  { id: 'host-provider-repair', label: 'Provider repair guidance', detail: 'Open a provider-id form for read-only provider repair guidance.', editorKind: 'provider-account-repair', kind: 'editor', safety: 'read-only' },
40
- { id: 'host-auth-owner', label: 'Connected-host auth owner', detail: 'Show that connected-host auth administration belongs to the owning GoodVibes host, not Agent.', command: '/auth local', kind: 'command', safety: 'read-only' },
40
+ { id: 'host-auth-owner', label: 'Connected-host auth owner', detail: 'Show connected-host auth ownership, local companion-token posture, and the confirmed Agent setup route that can create or repair its own operator token without printing it.', command: '/auth local', kind: 'command', safety: 'read-only' },
41
41
  { id: 'host-auth-review', label: 'Provider auth review', detail: 'Review provider auth posture without printing token values.', command: '/auth review', kind: 'command', safety: 'read-only' },
42
42
  { id: 'host-auth-detail', label: 'Provider auth detail', detail: 'Open a provider-id form for read-only provider auth inspection.', editorKind: 'auth-show', kind: 'editor', safety: 'read-only' },
43
43
  { id: 'host-auth-repair', label: 'Provider auth repair', detail: 'Open a provider-id form for provider auth repair guidance.', editorKind: 'auth-repair', kind: 'editor', safety: 'read-only' },