@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,560 @@
1
+ import { getOperatorContract } from '@pellux/goodvibes-sdk/contracts';
2
+ import type { CommandContext } from '../input/command-registry.ts';
3
+ import { buildAgentWorkspaceRuntimeSnapshot } from '../input/agent-workspace-snapshot.ts';
4
+ import { automationRunLiveRecords, approvalLiveRecords, controlAvailable, firstAvailableControlRoute, researchRunLiveRecords, scheduleLiveRecords, taskLiveRecords } from './agent-harness-autonomy-live-records.ts';
5
+ import type { AgentHarnessAutonomyQueueArgs, AutonomyQueueItem, AutonomyQueueLiveRecord, AutonomyQueueRecordControl, AutonomyQueueRecordOutput, AutonomyQueueResolution, AutonomyQueueStatus, OperatorContractMethod } from './agent-harness-autonomy-queue-types.ts';
6
+ export type { AutonomyQueueResolution } from './agent-harness-autonomy-queue-types.ts';
7
+ import { previewHarnessText } from './agent-harness-text.ts';
8
+
9
+ function readString(value: unknown): string {
10
+ return typeof value === 'string' ? value.trim() : '';
11
+ }
12
+
13
+ function readLimit(value: unknown, fallback: number): number {
14
+ const parsed = typeof value === 'string' && value.trim() ? Number(value) : value;
15
+ if (typeof parsed !== 'number' || !Number.isFinite(parsed)) return fallback;
16
+ return Math.max(1, Math.min(200, Math.trunc(parsed)));
17
+ }
18
+
19
+ function operatorContractMethods(): readonly OperatorContractMethod[] {
20
+ const contract = getOperatorContract();
21
+ const methods = Array.isArray(contract.operator?.methods)
22
+ ? contract.operator.methods as OperatorContractMethod[]
23
+ : [];
24
+ return methods.filter((method) => method.id);
25
+ }
26
+
27
+ function methodSearchText(method: OperatorContractMethod): string {
28
+ return [
29
+ method.id,
30
+ method.title,
31
+ method.description,
32
+ method.category,
33
+ method.http?.method,
34
+ method.http?.path,
35
+ ].filter(Boolean).join('\n').toLowerCase();
36
+ }
37
+
38
+ function methodIdsMatching(tokens: readonly string[]): readonly string[] {
39
+ if (tokens.length === 0) return [];
40
+ return operatorContractMethods()
41
+ .filter((method) => {
42
+ const text = methodSearchText(method);
43
+ return tokens.some((token) => text.includes(token));
44
+ })
45
+ .map((method) => method.id)
46
+ .sort((left, right) => left.localeCompare(right));
47
+ }
48
+
49
+ function statusRank(status: AutonomyQueueStatus): number {
50
+ if (status === 'attention') return 5;
51
+ if (status === 'active') return 4;
52
+ if (status === 'needs-setup') return 3;
53
+ if (status === 'ready') return 2;
54
+ return 1;
55
+ }
56
+
57
+ function itemSearchText(item: AutonomyQueueItem): string {
58
+ return [
59
+ item.id,
60
+ item.label,
61
+ item.status,
62
+ item.owner,
63
+ item.kind,
64
+ item.current,
65
+ item.next,
66
+ item.inspectRoute,
67
+ item.modelRoute,
68
+ item.cancelRoute ?? '',
69
+ item.createRoute ?? '',
70
+ item.batchCreateRoute ?? '',
71
+ item.methodIds?.join('\n') ?? '',
72
+ item.liveRecords?.flatMap((record) => [
73
+ record.id,
74
+ record.label,
75
+ record.status,
76
+ record.phase ?? '',
77
+ record.summary,
78
+ record.inspectRoute,
79
+ record.cancelRoute ?? '',
80
+ record.checkpointRoute ?? '',
81
+ record.pauseRoute ?? '',
82
+ record.resumeRoute ?? '',
83
+ record.nextSteps?.join('\n') ?? '',
84
+ record.sourceIds?.join('\n') ?? '',
85
+ record.logTail?.join('\n') ?? '',
86
+ record.output ? [
87
+ record.output.status,
88
+ record.output.route,
89
+ record.output.source,
90
+ record.output.preview ?? '',
91
+ record.output.policy,
92
+ ].join('\n') : '',
93
+ record.diagnostics?.join('\n') ?? '',
94
+ record.controls?.map((control) => [
95
+ control.id,
96
+ control.label,
97
+ control.state,
98
+ control.effect,
99
+ control.modelRoute ?? '',
100
+ control.reason ?? '',
101
+ ].join(' ')).join('\n') ?? '',
102
+ ]).join('\n') ?? '',
103
+ ].join('\n').toLowerCase();
104
+ }
105
+
106
+ function describeControl(control: AutonomyQueueRecordControl): Record<string, unknown> {
107
+ return {
108
+ id: control.id,
109
+ label: control.label,
110
+ state: control.state,
111
+ effect: control.effect,
112
+ confirmationRequired: control.confirmationRequired,
113
+ ...(control.modelRoute ? { modelRoute: control.modelRoute } : {}),
114
+ ...(control.reason ? { reason: previewHarnessText(control.reason, 120) } : {}),
115
+ };
116
+ }
117
+
118
+ function describeOutput(output: AutonomyQueueRecordOutput, includeParameters: boolean): Record<string, unknown> {
119
+ return {
120
+ status: output.status,
121
+ route: output.route,
122
+ source: output.source,
123
+ ...(output.preview ? { preview: previewHarnessText(output.preview, includeParameters ? 220 : 96) } : {}),
124
+ policy: previewHarnessText(output.policy, includeParameters ? 180 : 96),
125
+ };
126
+ }
127
+
128
+ function describeLiveRecord(record: AutonomyQueueLiveRecord, includeParameters: boolean): Record<string, unknown> {
129
+ const availableControls = record.controls
130
+ ?.filter((control) => control.state === 'available')
131
+ .map((control) => control.id);
132
+ return {
133
+ id: record.id,
134
+ label: record.label,
135
+ status: record.status,
136
+ ...(record.phase ? { phase: record.phase } : {}),
137
+ ...(typeof record.progress === 'number' ? { progress: record.progress } : {}),
138
+ ...(record.updatedAt ? { updatedAt: record.updatedAt } : {}),
139
+ summary: previewHarnessText(record.summary, includeParameters ? 180 : 96),
140
+ inspectRoute: record.inspectRoute,
141
+ ...(record.cancelRoute ? { cancelRoute: record.cancelRoute } : {}),
142
+ ...(record.checkpointRoute ? { checkpointRoute: record.checkpointRoute } : {}),
143
+ ...(record.pauseRoute ? { pauseRoute: record.pauseRoute } : {}),
144
+ ...(record.resumeRoute ? { resumeRoute: record.resumeRoute } : {}),
145
+ ...(record.nextSteps && record.nextSteps.length > 0 ? { nextSteps: record.nextSteps.slice(0, includeParameters ? 8 : 3) } : {}),
146
+ ...(record.sourceIds && record.sourceIds.length > 0 ? { sourceIds: record.sourceIds.slice(0, includeParameters ? 12 : 4) } : {}),
147
+ ...(record.logTail && record.logTail.length > 0 ? { logTail: record.logTail.slice(-(includeParameters ? 5 : 2)) } : {}),
148
+ ...(record.output ? { output: describeOutput(record.output, includeParameters) } : {}),
149
+ ...(record.diagnostics && record.diagnostics.length > 0 ? { diagnostics: record.diagnostics.slice(0, includeParameters ? 10 : 3).map((line) => previewHarnessText(line, includeParameters ? 160 : 96)) } : {}),
150
+ ...(availableControls && availableControls.length > 0 ? { availableControls: availableControls.slice(0, includeParameters ? 8 : 4) } : {}),
151
+ ...(includeParameters && record.controls && record.controls.length > 0 ? { controls: record.controls.map(describeControl) } : {}),
152
+ };
153
+ }
154
+
155
+ function describeItem(item: AutonomyQueueItem, includeParameters: boolean, lookup?: Record<string, unknown>): Record<string, unknown> {
156
+ return {
157
+ queueItemId: item.id,
158
+ label: item.label,
159
+ status: item.status,
160
+ owner: item.owner,
161
+ kind: item.kind,
162
+ visible: item.visible,
163
+ cancellable: item.cancellable,
164
+ count: item.count,
165
+ current: previewHarnessText(item.current, includeParameters ? 180 : 96),
166
+ next: previewHarnessText(item.next, includeParameters ? 180 : 96),
167
+ modelRoute: item.modelRoute,
168
+ inspectRoute: item.inspectRoute,
169
+ ...(item.cancelRoute ? { cancelRoute: item.cancelRoute } : {}),
170
+ ...(item.createRoute ? { createRoute: item.createRoute } : {}),
171
+ ...(item.batchCreateRoute ? { batchCreateRoute: item.batchCreateRoute } : {}),
172
+ ...(item.liveRecords && item.liveRecords.length > 0 ? { liveRecords: item.liveRecords.slice(0, includeParameters ? 8 : 3).map((record) => describeLiveRecord(record, includeParameters)) } : {}),
173
+ ...(lookup ? { lookup } : {}),
174
+ ...(includeParameters ? {
175
+ routes: {
176
+ inspect: item.inspectRoute,
177
+ model: item.modelRoute,
178
+ cancel: item.cancelRoute ?? null,
179
+ create: item.createRoute ?? null,
180
+ batchCreate: item.batchCreateRoute ?? null,
181
+ },
182
+ methodIds: item.methodIds ?? [],
183
+ policy: 'Queue rows are read-only. Create, run, pause, resume, cancel, approve, deny, send, and schedule effects stay on their owning confirmed route.',
184
+ } : {}),
185
+ };
186
+ }
187
+
188
+ function buildQueueItems(context: CommandContext): readonly AutonomyQueueItem[] {
189
+ const snapshot = buildAgentWorkspaceRuntimeSnapshot(context);
190
+ const approvalMethods = methodIdsMatching(['approval']);
191
+ const automationMethods = methodIdsMatching(['automation']);
192
+ const scheduleMethods = methodIdsMatching(['schedule', 'reminder']);
193
+ const taskMethods = methodIdsMatching(['task', 'work-plan', 'workplan']);
194
+ const readyChannels = snapshot.channels.filter((channel) => channel.ready).length;
195
+ const configuredTargets = snapshot.channels.filter((channel) => channel.defaultTarget === 'configured').length;
196
+ const researchRuns = researchRunLiveRecords(snapshot);
197
+ const taskRecords = taskLiveRecords(context);
198
+ const approvalRecords = approvalLiveRecords(context);
199
+ const automationRecords = automationRunLiveRecords(context);
200
+ const scheduleRecords = scheduleLiveRecords(context);
201
+ const latestResearchRun = researchRuns[0];
202
+ const taskCancelRoute = firstAvailableControlRoute(taskRecords, 'cancel');
203
+ const taskStatus: AutonomyQueueStatus = taskRecords.some((record) => record.status === 'blocked' || record.status === 'failed')
204
+ ? 'attention'
205
+ : taskRecords.some((record) => record.status === 'running' || record.status === 'queued')
206
+ ? 'active'
207
+ : taskMethods.length > 0
208
+ ? 'ready'
209
+ : 'needs-setup';
210
+ const approvalStatus: AutonomyQueueStatus = approvalRecords.some((record) => record.status === 'pending' || record.status === 'claimed')
211
+ ? 'attention'
212
+ : approvalMethods.length > 0
213
+ ? 'ready'
214
+ : 'needs-setup';
215
+ const automationStatus: AutonomyQueueStatus = automationRecords.some((record) => record.status === 'failed')
216
+ ? 'attention'
217
+ : automationRecords.some((record) => record.status === 'queued' || record.status === 'running')
218
+ ? 'active'
219
+ : automationMethods.length > 0
220
+ ? 'ready'
221
+ : 'needs-setup';
222
+ const scheduleStatus: AutonomyQueueStatus = scheduleRecords.some((record) => record.status === 'error')
223
+ ? 'attention'
224
+ : scheduleRecords.some((record) => record.status === 'enabled')
225
+ ? 'active'
226
+ : scheduleMethods.length > 0
227
+ ? 'ready'
228
+ : 'needs-setup';
229
+ const scheduleReadyRoutines = snapshot.localRoutines.filter((routine) => (
230
+ routine.enabled === true
231
+ && routine.reviewState === 'reviewed'
232
+ && (routine.missingRequirementCount ?? 0) === 0
233
+ )).length;
234
+ const routineReceiptStatus: AutonomyQueueStatus = snapshot.failedRoutineScheduleReceiptCount > 0
235
+ ? 'attention'
236
+ : snapshot.successfulRoutineScheduleReceiptCount > 0
237
+ ? 'active'
238
+ : scheduleReadyRoutines > 0
239
+ ? 'ready'
240
+ : 'needs-setup';
241
+
242
+ const items: AutonomyQueueItem[] = [
243
+ {
244
+ id: 'visible-work-plan',
245
+ label: 'Visible work plan',
246
+ status: 'ready',
247
+ owner: 'agent',
248
+ kind: 'work-plan',
249
+ visible: true,
250
+ cancellable: true,
251
+ count: taskMethods.length,
252
+ current: `Work-plan actions are available in the Agent workspace; ${taskMethods.length} task/work-plan daemon method(s) are discoverable.`,
253
+ next: 'Track ongoing user work here first, then update status to active, blocked, done, failed, or cancelled from the confirmed form.',
254
+ inspectRoute: 'workspace action:"action" actionId:"workplan-show"',
255
+ modelRoute: 'agent_work_plan',
256
+ cancelRoute: 'workspace action:"run" actionId:"workplan-status" confirm:true explicitUserRequest:"..."',
257
+ createRoute: 'workspace action:"run" actionId:"workplan-add" confirm:true explicitUserRequest:"..."',
258
+ methodIds: taskMethods,
259
+ },
260
+ {
261
+ id: 'research-runs',
262
+ label: 'Research runs',
263
+ status: snapshot.researchRunBlockedCount > 0
264
+ ? 'attention'
265
+ : snapshot.researchRunRunningCount > 0
266
+ ? 'active'
267
+ : snapshot.researchRunPausedCount > 0 || snapshot.researchRunPlannedCount > 0
268
+ ? 'ready'
269
+ : 'needs-setup',
270
+ owner: 'agent',
271
+ kind: 'research-run',
272
+ visible: true,
273
+ cancellable: snapshot.researchRunRunningCount + snapshot.researchRunPausedCount + snapshot.researchRunPlannedCount + snapshot.researchRunBlockedCount > 0,
274
+ count: snapshot.researchRunCount,
275
+ current: [
276
+ `${snapshot.researchRunCount} run(s), ${snapshot.researchRunRunningCount} running, ${snapshot.researchRunPausedCount} paused, ${snapshot.researchRunBlockedCount} blocked, ${snapshot.researchRunPlannedCount} planned.`,
277
+ latestResearchRun ? `Latest visible run: ${latestResearchRun.label} (${latestResearchRun.status}${typeof latestResearchRun.progress === 'number' ? ` ${latestResearchRun.progress}%` : ''}).` : '',
278
+ ].filter(Boolean).join(' '),
279
+ next: snapshot.researchRunBlockedCount > 0
280
+ ? 'Inspect blocked research runs, then checkpoint, resume, cancel, or complete one exact run.'
281
+ : snapshot.researchRunRunningCount > 0
282
+ ? 'Checkpoint progress, source ids, and next steps before switching tasks or saving a report.'
283
+ : 'Create a visible research run when the user wants resumable deep research.',
284
+ inspectRoute: 'research action:"runs"',
285
+ modelRoute: 'research action:"runs"',
286
+ cancelRoute: 'research action:"cancel" id="..." note="..." confirm:true explicitUserRequest="..."',
287
+ createRoute: 'research action:"create_run" title:"..." question:"..." confirm:true explicitUserRequest:"..."',
288
+ liveRecords: researchRuns,
289
+ },
290
+ {
291
+ id: 'connected-host-tasks',
292
+ label: 'Connected-host tasks',
293
+ status: taskStatus,
294
+ owner: 'connected-host',
295
+ kind: 'host-task',
296
+ visible: true,
297
+ cancellable: taskRecords.some((record) => controlAvailable(record, 'cancel')),
298
+ count: taskRecords.length > 0 ? taskRecords.length : taskMethods.length,
299
+ current: taskRecords.length > 0
300
+ ? `${taskRecords.length} live connected-host task record(s); active cancellable tasks expose exact confirmed daemon controls. ${taskMethods.length} task-like daemon method(s) are discoverable.`
301
+ : `${taskMethods.length} task-like daemon method(s) are present; Agent exposes read-only host task inspection.`,
302
+ next: taskRecords.some((record) => record.status === 'blocked' || record.status === 'failed')
303
+ ? 'Inspect failed or blocked host tasks, then use the exact retry control when useful or update Agent workplan state from the visible work-plan route.'
304
+ : taskCancelRoute
305
+ ? 'Inspect active host tasks; cancel only the exact host task id through its confirmed daemon control when the user authorizes it.'
306
+ : taskRecords.some((record) => record.status === 'running' || record.status === 'queued')
307
+ ? 'Inspect active host tasks before changing any work plan, delegation, or automation state.'
308
+ : taskMethods.length > 0
309
+ ? 'Inspect host tasks before changing any work plan or automation state.'
310
+ : 'Update the connected GoodVibes host or connector set until task inspection methods are present.',
311
+ inspectRoute: 'workspace action:"action" actionId:"tasks-list"',
312
+ modelRoute: 'host action:"methods" query:"task"',
313
+ ...(taskCancelRoute ? { cancelRoute: taskCancelRoute } : {}),
314
+ methodIds: taskMethods,
315
+ liveRecords: taskRecords,
316
+ },
317
+ {
318
+ id: 'pending-approvals',
319
+ label: 'Pending approvals',
320
+ status: approvalStatus,
321
+ owner: 'connected-host',
322
+ kind: 'approval',
323
+ visible: true,
324
+ cancellable: true,
325
+ count: approvalRecords.length > 0 ? approvalRecords.length : approvalMethods.length,
326
+ current: approvalRecords.length > 0
327
+ ? `${approvalRecords.length} recent approval record(s); pending or claimed approvals require explicit user-visible decisions.`
328
+ : `${approvalMethods.length} approval daemon method(s) are present; approval decisions remain explicit and reviewable.`,
329
+ next: approvalRecords.some((record) => record.status === 'pending' || record.status === 'claimed')
330
+ ? 'Review pending approval records, risk, and args; approve, deny, or cancel exactly one id only when the user asks.'
331
+ : 'Review the matrix, then approve, deny, or cancel one exact approval id only when the user asks.',
332
+ inspectRoute: 'workspace action:"action" actionId:"approvals"',
333
+ modelRoute: 'host action:"methods" query:"approval"',
334
+ cancelRoute: 'workspace action:"run" actionId:"approval-cancel" confirm:true explicitUserRequest:"..."',
335
+ methodIds: approvalMethods,
336
+ liveRecords: approvalRecords,
337
+ },
338
+ {
339
+ id: 'automation-runs',
340
+ label: 'Automation runs',
341
+ status: automationStatus,
342
+ owner: 'connected-host',
343
+ kind: 'automation-run',
344
+ visible: true,
345
+ cancellable: true,
346
+ count: automationRecords.length > 0 ? automationRecords.length : automationMethods.length,
347
+ current: automationRecords.length > 0
348
+ ? `${automationRecords.length} recent automation run record(s); active, failed, and retryable runs expose exact control routes.`
349
+ : `${automationMethods.length} automation daemon method(s) are present; run, pause, resume, cancel, and retry actions are confirmed forms.`,
350
+ next: automationRecords.some((record) => record.status === 'failed')
351
+ ? 'Inspect failed automation runs, then retry or leave them alone only through exact confirmed run routes.'
352
+ : automationRecords.some((record) => record.status === 'queued' || record.status === 'running')
353
+ ? 'Inspect active automation runs and cancel only the exact run id the user authorizes.'
354
+ : 'Inspect automation posture first. Use exact run/job ids for confirmed run control.',
355
+ inspectRoute: 'host action:"methods" query:"automation"',
356
+ modelRoute: 'workspace action:"actions" categoryId:"automation"',
357
+ cancelRoute: 'workspace action:"run" actionId:"automation-run-cancel" confirm:true explicitUserRequest:"..."',
358
+ methodIds: automationMethods,
359
+ liveRecords: automationRecords,
360
+ },
361
+ {
362
+ id: 'autonomous-schedule-requests',
363
+ label: 'Autonomous schedule requests',
364
+ status: scheduleMethods.length > 0 ? 'ready' : 'needs-setup',
365
+ owner: 'agent-and-connected-host',
366
+ kind: 'schedule',
367
+ visible: true,
368
+ cancellable: false,
369
+ count: scheduleMethods.length,
370
+ current: `${scheduleMethods.length} schedule/reminder daemon method(s); autonomous schedules require explicit task, cadence, success criteria, and user request provenance.`,
371
+ next: scheduleMethods.length > 0
372
+ ? 'Create one visible autonomous schedule only after the user gives exact timing and success criteria.'
373
+ : 'Update the connected GoodVibes host until schedules.create is available.',
374
+ inspectRoute: 'autonomy action:"intake" query:"..."',
375
+ modelRoute: 'schedule action:"create"',
376
+ createRoute: 'schedule action:"create" task:"..." successCriteria:"..." scheduleKind:"..." scheduleValue:"..." confirm:true explicitUserRequest:"..."',
377
+ methodIds: scheduleMethods,
378
+ },
379
+ {
380
+ id: 'connected-schedules',
381
+ label: 'Connected schedules',
382
+ status: scheduleStatus,
383
+ owner: 'connected-host',
384
+ kind: 'schedule',
385
+ visible: true,
386
+ cancellable: true,
387
+ count: scheduleRecords.length > 0 ? scheduleRecords.length : scheduleMethods.length,
388
+ current: scheduleRecords.length > 0
389
+ ? `${scheduleRecords.length} live connected schedule record(s); edit, run-now, enable, disable, and delete remain explicit confirmed actions.`
390
+ : `${scheduleMethods.length} schedule/reminder daemon method(s) are present; schedule inspection, edit, and lifecycle controls are visible.`,
391
+ next: scheduleRecords.some((record) => record.status === 'error')
392
+ ? 'Inspect schedule errors before running, enabling, disabling, deleting, or creating more schedules.'
393
+ : scheduleRecords.length > 0
394
+ ? 'Review live schedules or reconcile routine receipts before controlling one exact schedule id.'
395
+ : 'List schedules or reconcile routine receipts before controlling one schedule by id.',
396
+ inspectRoute: 'workspace action:"action" actionId:"schedule-list"',
397
+ modelRoute: 'schedule action:"list|edit|run|pause|resume|delete"',
398
+ cancelRoute: 'schedule action:"pause" scheduleId:"..." confirm:true explicitUserRequest:"..."',
399
+ createRoute: 'schedule action:"create" task:"..." successCriteria:"..." scheduleKind:"..." scheduleValue:"..." confirm:true explicitUserRequest:"..."',
400
+ methodIds: scheduleMethods,
401
+ liveRecords: scheduleRecords,
402
+ },
403
+ {
404
+ id: 'reminder-requests',
405
+ label: 'Reminder requests',
406
+ status: scheduleMethods.length > 0 ? readyChannels > 0 || configuredTargets > 0 ? 'ready' : 'needs-setup' : 'needs-setup',
407
+ owner: 'agent-and-connected-host',
408
+ kind: 'reminder',
409
+ visible: true,
410
+ cancellable: false,
411
+ count: configuredTargets,
412
+ current: `${configuredTargets} configured delivery target(s), ${readyChannels} ready channel(s), ${scheduleMethods.length} schedule/reminder method(s).`,
413
+ next: readyChannels > 0 || configuredTargets > 0
414
+ ? 'Create one reminder only after the user gives real timing and delivery scope.'
415
+ : 'Configure at least one delivery target before relying on reminder delivery.',
416
+ inspectRoute: 'personal_ops action:"lane" laneId:"reminders"',
417
+ modelRoute: 'schedule action:"remind"',
418
+ createRoute: 'schedule action:"remind" message:"..." scheduleKind:"..." scheduleValue:"..." confirm:true explicitUserRequest:"..."',
419
+ methodIds: scheduleMethods,
420
+ },
421
+ {
422
+ id: 'routine-schedule-promotions',
423
+ label: 'Routine schedule promotions',
424
+ status: routineReceiptStatus,
425
+ owner: 'agent-and-connected-host',
426
+ kind: 'routine-schedule',
427
+ visible: true,
428
+ cancellable: false,
429
+ count: snapshot.routineScheduleReceiptCount,
430
+ current: `${snapshot.routineScheduleReceiptCount} receipt(s), ${snapshot.successfulRoutineScheduleReceiptCount} created, ${snapshot.failedRoutineScheduleReceiptCount} failed, ${scheduleReadyRoutines} schedule-ready routine(s).`,
431
+ next: snapshot.failedRoutineScheduleReceiptCount > 0
432
+ ? 'Reconcile failed receipts before creating more routine schedules.'
433
+ : scheduleReadyRoutines > 0
434
+ ? 'Promote one reviewed routine only when the user asks for recurrence.'
435
+ : 'Create, enable, and review a routine before schedule promotion.',
436
+ inspectRoute: 'workspace action:"action" actionId:"schedule-receipts"',
437
+ modelRoute: 'workspace action:"actions" categoryId:"routines"',
438
+ createRoute: 'workspace action:"run" actionId:"schedule-promote-routine" confirm:true explicitUserRequest:"..."',
439
+ methodIds: scheduleMethods,
440
+ },
441
+ {
442
+ id: 'delegated-subagents',
443
+ label: 'Delegated subagents',
444
+ status: 'ready',
445
+ owner: 'agent',
446
+ kind: 'delegated-agent',
447
+ visible: true,
448
+ cancellable: true,
449
+ count: 0,
450
+ current: 'Subagent and delegation routes are visible and cancellable; ordinary chat remains serial by default.',
451
+ next: 'Use visible delegation only when isolation, parallelism, remote execution, or an explicit build/fix/review handoff helps the user.',
452
+ inspectRoute: 'agent_harness mode:"agent_orchestration"',
453
+ modelRoute: 'agent_harness mode:"agent_orchestration"',
454
+ cancelRoute: 'agent { mode: "cancel", agentId: "..." }',
455
+ createRoute: 'agent { mode: "spawn", task: "..." }',
456
+ batchCreateRoute: 'agent { mode: "batch-spawn", tasks: [...] }',
457
+ },
458
+ {
459
+ id: 'delivery-followups',
460
+ label: 'Delivery follow-ups',
461
+ status: readyChannels > 0 ? 'ready' : 'needs-setup',
462
+ owner: 'agent-and-connected-host',
463
+ kind: 'delivery',
464
+ visible: true,
465
+ cancellable: false,
466
+ count: readyChannels,
467
+ current: `${readyChannels}/${snapshot.channels.length} channel(s) ready; ${configuredTargets} configured default target(s).`,
468
+ next: readyChannels > 0
469
+ ? 'Use confirmed notification or channel send tools only after the user asks for delivery.'
470
+ : 'Pair or configure a delivery channel before promising proactive follow-up.',
471
+ inspectRoute: 'channels action:"status"',
472
+ modelRoute: 'channels action:"status"',
473
+ createRoute: 'workspace action:"run" actionId:"personal-ops-channels" confirm:true explicitUserRequest:"..."',
474
+ },
475
+ ];
476
+ return items.sort((left, right) => statusRank(right.status) - statusRank(left.status) || left.label.localeCompare(right.label));
477
+ }
478
+
479
+ function nextActions(items: readonly AutonomyQueueItem[]): readonly string[] {
480
+ return items
481
+ .filter((item) => item.status === 'attention' || item.status === 'needs-setup' || item.status === 'active')
482
+ .map((item) => `${item.label}: ${item.next}`)
483
+ .slice(0, 5);
484
+ }
485
+
486
+ export function autonomyQueueCatalogStatus(context: CommandContext): Record<string, unknown> {
487
+ const items = buildQueueItems(context);
488
+ const counts = items.reduce<Record<AutonomyQueueStatus, number>>((acc, item) => {
489
+ acc[item.status] += 1;
490
+ return acc;
491
+ }, { ready: 0, active: 0, 'needs-setup': 0, attention: 0, blocked: 0 });
492
+ return {
493
+ modes: ['autonomy_queue', 'autonomy_queue_item'],
494
+ items: items.length,
495
+ cancellable: items.filter((item) => item.cancellable).length,
496
+ ...counts,
497
+ readOnly: true,
498
+ };
499
+ }
500
+
501
+ export function autonomyQueueSummary(context: CommandContext, args: AgentHarnessAutonomyQueueArgs): Record<string, unknown> {
502
+ const includeParameters = args.includeParameters === true;
503
+ const query = readString(args.query).toLowerCase();
504
+ const limit = readLimit(args.limit, 100);
505
+ const all = buildQueueItems(context);
506
+ const filtered = all.filter((item) => !query || itemSearchText(item).includes(query));
507
+ return {
508
+ summary: {
509
+ items: all.length,
510
+ visible: all.filter((item) => item.visible).length,
511
+ cancellable: all.filter((item) => item.cancellable).length,
512
+ attention: all.filter((item) => item.status === 'attention').length,
513
+ needsSetup: all.filter((item) => item.status === 'needs-setup').length,
514
+ active: all.filter((item) => item.status === 'active').length,
515
+ ready: all.filter((item) => item.status === 'ready').length,
516
+ },
517
+ queue: filtered.slice(0, limit).map((item) => describeItem(item, includeParameters)),
518
+ returned: Math.min(filtered.length, limit),
519
+ total: all.length,
520
+ nextActions: nextActions(all),
521
+ policy: 'Visible autonomy queue is read-only. Autonomous work must have a visible owner, status/progress route, inspect route, and cancellation or recovery route when the owning surface supports one.',
522
+ };
523
+ }
524
+
525
+ export function describeAutonomyQueueItem(context: CommandContext, args: AgentHarnessAutonomyQueueArgs): AutonomyQueueResolution {
526
+ const queueItemId = readString(args.queueItemId);
527
+ const target = readString(args.target);
528
+ const query = readString(args.query);
529
+ const input = queueItemId || target || query;
530
+ if (!input) {
531
+ return {
532
+ status: 'missing_lookup',
533
+ usage: 'autonomy action:"item" requires queueItemId, target, or query. Use action:"queue" to inspect queue item ids.',
534
+ };
535
+ }
536
+ const normalized = input.toLowerCase();
537
+ const items = buildQueueItems(context);
538
+ const exact = items.find((item) => item.id === input);
539
+ if (exact) return { status: 'found', item: describeItem(exact, true, { source: queueItemId ? 'queueItemId' : target ? 'target' : 'query', input, resolvedBy: 'id' }) };
540
+ const insensitive = items.find((item) => item.id.toLowerCase() === normalized);
541
+ if (insensitive) return { status: 'found', item: describeItem(insensitive, true, { source: queueItemId ? 'queueItemId' : target ? 'target' : 'query', input, resolvedBy: 'case-insensitive-id' }) };
542
+ const matches = items.filter((item) => itemSearchText(item).includes(normalized));
543
+ if (matches.length === 1) return { status: 'found', item: describeItem(matches[0]!, true, { source: queueItemId ? 'queueItemId' : target ? 'target' : 'query', input, resolvedBy: 'search' }) };
544
+ if (matches.length > 1) {
545
+ return {
546
+ status: 'ambiguous',
547
+ input,
548
+ candidates: matches.slice(0, 8).map((item) => ({
549
+ queueItemId: item.id,
550
+ label: item.label,
551
+ status: item.status,
552
+ modelRoute: item.modelRoute,
553
+ })),
554
+ };
555
+ }
556
+ return {
557
+ status: 'missing_lookup',
558
+ usage: `Unknown autonomy queue item ${input}. Use autonomy action:"queue" to inspect queue item ids.`,
559
+ };
560
+ }
@@ -0,0 +1,35 @@
1
+ export interface AgentHarnessBackgroundProcessArgs {
2
+ readonly processId?: unknown;
3
+ readonly processSessionId?: unknown;
4
+ readonly sessionId?: unknown;
5
+ readonly session_id?: unknown;
6
+ readonly action?: unknown;
7
+ readonly processAction?: unknown;
8
+ readonly command?: unknown;
9
+ readonly target?: unknown;
10
+ readonly query?: unknown;
11
+ readonly cwd?: unknown;
12
+ readonly timeoutMs?: unknown;
13
+ readonly pty?: unknown;
14
+ readonly data?: unknown;
15
+ readonly fields?: unknown;
16
+ readonly includeParameters?: unknown;
17
+ readonly limit?: unknown;
18
+ readonly confirm?: unknown;
19
+ readonly explicitUserRequest?: unknown;
20
+ }
21
+
22
+ export type BackgroundProcessLookupSource =
23
+ | 'processId'
24
+ | 'processSessionId'
25
+ | 'sessionId'
26
+ | 'session_id'
27
+ | 'target'
28
+ | 'query';
29
+
30
+ export type ProcessCapabilityStatus = 'supported' | 'contract-discovered' | 'blocked-contract-gap' | 'visible-only';
31
+
32
+ export type BackgroundProcessResolution =
33
+ | { readonly status: 'found'; readonly process: Record<string, unknown> }
34
+ | { readonly status: 'ambiguous'; readonly input: string; readonly candidates: readonly Record<string, unknown>[] }
35
+ | { readonly status: 'missing_lookup'; readonly usage: string };