@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.
- package/CHANGELOG.md +170 -0
- package/README.md +46 -30
- package/dist/package/{ast-grep-napi.linux-x64-gnu-mkk8xwww.node → ast-grep-napi.linux-x64-gnu-swtppvy9.node} +0 -0
- package/dist/package/{ast-grep-napi.linux-x64-musl-ryqtgdv6.node → ast-grep-napi.linux-x64-musl-ttfcdtap.node} +0 -0
- package/dist/package/main.js +132577 -91483
- package/docs/README.md +14 -7
- package/docs/channels-remote-and-api.md +8 -5
- package/docs/connected-host.md +14 -12
- package/docs/getting-started.md +56 -30
- package/docs/knowledge-artifacts-and-multimodal.md +7 -5
- package/docs/project-planning.md +2 -2
- package/docs/providers-and-routing.md +11 -3
- package/docs/tools-and-commands.md +114 -45
- package/docs/voice-and-live-tts.md +3 -1
- package/package.json +3 -2
- package/release/release-notes.md +130 -5
- package/release/release-readiness.json +120 -90
- package/src/agent/assistant-cockpit.ts +247 -0
- package/src/agent/autonomy-schedule-format.ts +96 -0
- package/src/agent/autonomy-schedule.ts +514 -0
- package/src/agent/channel-delivery-receipts.ts +292 -0
- package/src/agent/competitive-feature-inventory.ts +296 -0
- package/src/agent/document-registry-types.ts +106 -0
- package/src/agent/document-registry.ts +734 -0
- package/src/agent/harness-control.ts +2 -2
- package/src/agent/memory-prompt.ts +2 -2
- package/src/agent/operator-actions.ts +50 -6
- package/src/agent/persona-registry.ts +8 -0
- package/src/agent/project-context-files.ts +273 -0
- package/src/agent/prompt-context-receipts.ts +502 -0
- package/src/agent/reminder-schedule-format.ts +16 -2
- package/src/agent/research-run-registry.ts +582 -0
- package/src/agent/research-source-registry.ts +441 -0
- package/src/agent/routine-registry.ts +19 -3
- package/src/agent/routine-schedule-format.ts +27 -2
- package/src/agent/runtime-profile-starters.ts +7 -0
- package/src/agent/runtime-profile.ts +106 -4
- package/src/agent/schedule-edit-format.ts +129 -0
- package/src/agent/schedule-edit.ts +496 -0
- package/src/agent/schedule-next-routes.ts +42 -0
- package/src/agent/setup-wizard-checkpoint.ts +140 -0
- package/src/agent/setup-wizard.ts +447 -0
- package/src/agent/skill-registry-types.ts +102 -0
- package/src/agent/skill-registry.ts +81 -107
- package/src/agent/vibe-confirmation-routes.ts +62 -0
- package/src/agent/vibe-file.ts +285 -0
- package/src/cli/agent-knowledge-command.ts +45 -2
- package/src/cli/help.ts +3 -0
- package/src/cli/profiles-command.ts +25 -11
- package/src/config/agent-settings-policy.ts +1 -18
- package/src/input/agent-workspace-activation.ts +53 -0
- package/src/input/agent-workspace-artifact-browser-editor.ts +494 -0
- package/src/input/agent-workspace-artifact-metadata.ts +17 -0
- package/src/input/agent-workspace-basic-command-editors.ts +5 -1
- package/src/input/agent-workspace-categories.ts +153 -155
- package/src/input/agent-workspace-channel-triage.ts +481 -0
- package/src/input/agent-workspace-channels.ts +263 -0
- package/src/input/agent-workspace-command-editor.ts +152 -0
- package/src/input/agent-workspace-context-snapshot.ts +349 -0
- package/src/input/agent-workspace-delegation-editor-submission.ts +8 -0
- package/src/input/agent-workspace-document-editor.ts +502 -0
- package/src/input/agent-workspace-document-ops-editor.ts +523 -0
- package/src/input/agent-workspace-host-category.ts +1 -1
- package/src/input/agent-workspace-local-library-snapshot.ts +167 -0
- package/src/input/agent-workspace-model-compare-editor.ts +376 -0
- package/src/input/agent-workspace-model-compare-prompt-submission.ts +552 -0
- package/src/input/agent-workspace-model-compare-types.ts +82 -0
- package/src/input/agent-workspace-model-compare-utils.ts +35 -0
- package/src/input/agent-workspace-onboarding-categories.ts +141 -0
- package/src/input/agent-workspace-operations-command-editor-submission.ts +53 -0
- package/src/input/agent-workspace-operations-command-editors.ts +22 -0
- package/src/input/agent-workspace-research-report-editor.ts +212 -0
- package/src/input/agent-workspace-research-run-editor.ts +144 -0
- package/src/input/agent-workspace-research-source-editor.ts +167 -0
- package/src/input/agent-workspace-review-packet-snapshot.ts +593 -0
- package/src/input/agent-workspace-review-packet-utils.ts +265 -0
- package/src/input/agent-workspace-settings.ts +262 -30
- package/src/input/agent-workspace-setup-checkpoint-action.ts +127 -0
- package/src/input/agent-workspace-setup-snapshot.ts +198 -0
- package/src/input/agent-workspace-setup.ts +34 -1
- package/src/input/agent-workspace-snapshot.ts +162 -147
- package/src/input/agent-workspace-types.ts +287 -2
- package/src/input/agent-workspace.ts +18 -0
- package/src/input/command-registry.ts +9 -2
- package/src/input/commands/agent-runtime-profile-runtime.ts +28 -13
- package/src/input/commands/channels-runtime.ts +102 -114
- package/src/input/commands/delegation-runtime.ts +87 -24
- package/src/input/commands/knowledge-browser-flags.ts +12 -0
- package/src/input/commands/knowledge.ts +28 -14
- package/src/input/commands/operator-actions-runtime.ts +6 -3
- package/src/input/commands/schedule-runtime.ts +71 -14
- package/src/input/commands/session-content.ts +2 -2
- package/src/input/commands/shell-core.ts +2 -0
- package/src/input/commands/vibe-runtime.ts +140 -0
- package/src/input/commands.ts +2 -0
- package/src/input/connected-host-routes.ts +123 -0
- package/src/input/settings-modal-types.ts +14 -0
- package/src/main.ts +15 -15
- package/src/panels/qr-panel.ts +2 -2
- package/src/renderer/agent-workspace-context-lines.ts +686 -0
- package/src/renderer/agent-workspace.ts +30 -419
- package/src/renderer/settings-modal-helpers.ts +12 -0
- package/src/renderer/settings-modal.ts +12 -0
- package/src/runtime/bootstrap-command-context.ts +11 -1
- package/src/runtime/bootstrap-command-parts.ts +14 -3
- package/src/runtime/bootstrap-core.ts +39 -1
- package/src/runtime/bootstrap-shell.ts +6 -0
- package/src/runtime/bootstrap.ts +113 -30
- package/src/runtime/connected-host-auth.ts +3 -2
- package/src/runtime/execution-ledger.ts +231 -0
- package/src/runtime/services.ts +88 -10
- package/src/runtime/tool-permission-safety.ts +199 -5
- package/src/shell/session-continuity-hints.ts +39 -0
- package/src/tools/agent-artifacts-tool.ts +606 -0
- package/src/tools/agent-audit-tool.ts +155 -0
- package/src/tools/agent-autonomy-schedule-tool.ts +238 -0
- package/src/tools/agent-autonomy-tool.ts +140 -0
- package/src/tools/agent-channel-send-tool.ts +24 -2
- package/src/tools/agent-channels-tool.ts +140 -0
- package/src/tools/agent-computer-tool.ts +168 -0
- package/src/tools/agent-context-policy.ts +137 -7
- package/src/tools/agent-context-tool.ts +143 -0
- package/src/tools/agent-delegation-tool.ts +128 -0
- package/src/tools/agent-device-tool.ts +240 -0
- package/src/tools/agent-documents-tool.ts +684 -0
- package/src/tools/agent-execution-tool.ts +230 -0
- package/src/tools/agent-harness-agent-orchestration.ts +703 -0
- package/src/tools/agent-harness-autonomy-intake.ts +785 -0
- package/src/tools/agent-harness-autonomy-live-records.ts +588 -0
- package/src/tools/agent-harness-autonomy-queue-types.ts +88 -0
- package/src/tools/agent-harness-autonomy-queue.ts +560 -0
- package/src/tools/agent-harness-background-processes-types.ts +35 -0
- package/src/tools/agent-harness-background-processes.ts +794 -0
- package/src/tools/agent-harness-browser-cockpit-route.ts +219 -0
- package/src/tools/agent-harness-browser-control.ts +338 -0
- package/src/tools/agent-harness-channel-metadata.ts +168 -10
- package/src/tools/agent-harness-cli-command-policy.ts +110 -0
- package/src/tools/agent-harness-command-catalog.ts +4 -2
- package/src/tools/agent-harness-command-runner.ts +42 -0
- package/src/tools/agent-harness-connected-host-status.ts +7 -4
- package/src/tools/agent-harness-delegation-posture.ts +234 -19
- package/src/tools/agent-harness-document-ops-reviewer-readiness.ts +234 -0
- package/src/tools/agent-harness-document-ops-types.ts +72 -0
- package/src/tools/agent-harness-document-ops.ts +671 -0
- package/src/tools/agent-harness-execution-history.ts +489 -0
- package/src/tools/agent-harness-execution-posture.ts +382 -0
- package/src/tools/agent-harness-file-recovery.ts +135 -0
- package/src/tools/agent-harness-keybinding-metadata.ts +16 -12
- package/src/tools/agent-harness-learning-curator-common.ts +102 -0
- package/src/tools/agent-harness-learning-curator-consolidation.ts +295 -0
- package/src/tools/agent-harness-learning-curator-proposals.ts +606 -0
- package/src/tools/agent-harness-learning-curator-types.ts +151 -0
- package/src/tools/agent-harness-learning-curator.ts +417 -0
- package/src/tools/agent-harness-local-model-benchmarks.ts +199 -0
- package/src/tools/agent-harness-local-model-cookbook.ts +238 -0
- package/src/tools/agent-harness-local-model-endpoints.ts +673 -0
- package/src/tools/agent-harness-media-posture.ts +208 -2
- package/src/tools/agent-harness-memory-posture.ts +556 -0
- package/src/tools/agent-harness-metadata.ts +100 -168
- package/src/tools/agent-harness-mode-catalog.ts +84 -33
- package/src/tools/agent-harness-model-catalog.ts +162 -0
- package/src/tools/agent-harness-model-provider-health.ts +186 -0
- package/src/tools/agent-harness-model-readiness.ts +406 -0
- package/src/tools/agent-harness-model-routing-types.ts +266 -0
- package/src/tools/agent-harness-model-routing-utils.ts +30 -0
- package/src/tools/agent-harness-model-routing.ts +137 -190
- package/src/tools/agent-harness-operator-methods.ts +115 -133
- package/src/tools/agent-harness-pairing-posture.ts +431 -18
- package/src/tools/agent-harness-personal-ops-discovery.ts +533 -0
- package/src/tools/agent-harness-personal-ops-intake.ts +385 -0
- package/src/tools/agent-harness-personal-ops-lanes.ts +204 -0
- package/src/tools/agent-harness-personal-ops-records.ts +732 -0
- package/src/tools/agent-harness-personal-ops-runner.ts +637 -0
- package/src/tools/agent-harness-personal-ops-types.ts +222 -0
- package/src/tools/agent-harness-personal-ops.ts +606 -0
- package/src/tools/agent-harness-project-context.ts +144 -0
- package/src/tools/agent-harness-prompt-context.ts +589 -0
- package/src/tools/agent-harness-provider-account-metadata.ts +2 -2
- package/src/tools/agent-harness-release-evidence.ts +9 -7
- package/src/tools/agent-harness-release-readiness.ts +9 -7
- package/src/tools/agent-harness-research-briefing.ts +427 -0
- package/src/tools/agent-harness-research-queue.ts +250 -0
- package/src/tools/agent-harness-research-runs.ts +295 -0
- package/src/tools/agent-harness-research-workflow.ts +322 -0
- package/src/tools/agent-harness-security-posture.ts +2 -2
- package/src/tools/agent-harness-service-posture.ts +9 -9
- package/src/tools/agent-harness-session-metadata.ts +3 -3
- package/src/tools/agent-harness-setup-connected-host.ts +501 -0
- package/src/tools/agent-harness-setup-describe.ts +557 -0
- package/src/tools/agent-harness-setup-handoffs.ts +502 -0
- package/src/tools/agent-harness-setup-model-helpers.ts +101 -0
- package/src/tools/agent-harness-setup-plan.ts +253 -0
- package/src/tools/agent-harness-setup-posture-types.ts +218 -0
- package/src/tools/agent-harness-setup-posture-utils.ts +173 -0
- package/src/tools/agent-harness-setup-posture.ts +449 -221
- package/src/tools/agent-harness-setup-smoke.ts +508 -0
- package/src/tools/agent-harness-sudo-posture.ts +114 -0
- package/src/tools/agent-harness-tool-schema.ts +120 -7
- package/src/tools/agent-harness-tool-types.ts +78 -0
- package/src/tools/agent-harness-tool-utils.ts +43 -0
- package/src/tools/agent-harness-tool.ts +311 -370
- package/src/tools/agent-harness-ui-surface-metadata.ts +76 -69
- package/src/tools/agent-harness-ui-surface-types.ts +46 -0
- package/src/tools/agent-harness-vibe-health.ts +105 -0
- package/src/tools/agent-harness-workspace-action-runner.ts +149 -0
- package/src/tools/agent-harness-workspace-actions.ts +114 -8
- package/src/tools/agent-harness-workspace-editor-execution.ts +214 -0
- package/src/tools/agent-harness-workspace-editor-runner.ts +755 -0
- package/src/tools/agent-host-tool.ts +159 -0
- package/src/tools/agent-knowledge-ingest-tool.ts +34 -1
- package/src/tools/agent-learning-consolidation-core.ts +327 -0
- package/src/tools/agent-learning-consolidation-tool.ts +758 -0
- package/src/tools/agent-memory-tool.ts +214 -0
- package/src/tools/agent-model-compare-export.ts +315 -0
- package/src/tools/agent-model-compare-handoff.ts +592 -0
- package/src/tools/agent-model-compare-judgment.ts +633 -0
- package/src/tools/agent-model-compare-run.ts +722 -0
- package/src/tools/agent-model-compare-tool.ts +698 -0
- package/src/tools/agent-model-compare-types.ts +191 -0
- package/src/tools/agent-model-compare-utils.ts +93 -0
- package/src/tools/agent-models-tool.ts +208 -0
- package/src/tools/agent-operator-action-tool.ts +1 -1
- package/src/tools/agent-operator-method-tool.ts +643 -0
- package/src/tools/agent-personal-ops-tool.ts +197 -0
- package/src/tools/agent-policy-explanation.ts +415 -0
- package/src/tools/agent-research-report-tool.ts +608 -0
- package/src/tools/agent-research-runs-tool.ts +434 -0
- package/src/tools/agent-research-sources-tool.ts +443 -0
- package/src/tools/agent-research-tool.ts +687 -0
- package/src/tools/agent-review-packet-presets-core.ts +757 -0
- package/src/tools/agent-review-packet-presets-tool.ts +466 -0
- package/src/tools/agent-review-packet-share-tool.ts +305 -0
- package/src/tools/agent-route-planner-candidates-setup.ts +411 -0
- package/src/tools/agent-route-planner-candidates-surfaces.ts +432 -0
- package/src/tools/agent-route-planner-candidates-work.ts +251 -0
- package/src/tools/agent-route-planner-helpers.ts +667 -0
- package/src/tools/agent-route-planner.ts +185 -0
- package/src/tools/agent-route-tool.ts +105 -0
- package/src/tools/agent-schedule-edit-tool.ts +210 -0
- package/src/tools/agent-schedule-tool.ts +282 -0
- package/src/tools/agent-security-tool.ts +145 -0
- package/src/tools/agent-sessions-tool.ts +122 -0
- package/src/tools/agent-settings-import-tool.ts +104 -0
- package/src/tools/agent-settings-tool.ts +176 -0
- package/src/tools/agent-setup-tool.ts +226 -0
- package/src/tools/agent-support-tool.ts +122 -0
- package/src/tools/agent-terminal-process-tools.ts +167 -0
- package/src/tools/agent-tool-policy-guard-types.ts +77 -0
- package/src/tools/agent-tool-policy-guard.ts +106 -85
- package/src/tools/agent-vibe-tool.ts +297 -0
- package/src/tools/agent-work-plan-tool.ts +265 -6
- package/src/tools/agent-workspace-tool.ts +305 -0
- package/src/tools/artifact-archive.ts +169 -0
- package/src/tools/tool-definition-compaction.ts +36 -0
- package/src/version.ts +1 -1
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import type { Tool } from '@pellux/goodvibes-sdk/platform/types';
|
|
2
|
+
import type { ToolRegistry } from '@pellux/goodvibes-sdk/platform/tools';
|
|
3
|
+
import type { CommandContext, CommandRegistry } from '../input/command-registry.ts';
|
|
4
|
+
import { createAgentHarnessTool } from './agent-harness-tool.ts';
|
|
5
|
+
|
|
6
|
+
type AgentExecutionAction =
|
|
7
|
+
| 'status'
|
|
8
|
+
| 'route'
|
|
9
|
+
| 'history'
|
|
10
|
+
| 'record'
|
|
11
|
+
| 'processes'
|
|
12
|
+
| 'process_capabilities'
|
|
13
|
+
| 'process'
|
|
14
|
+
| 'recovery';
|
|
15
|
+
|
|
16
|
+
interface AgentExecutionToolArgs {
|
|
17
|
+
readonly action?: unknown;
|
|
18
|
+
readonly mode?: unknown;
|
|
19
|
+
readonly id?: unknown;
|
|
20
|
+
readonly routeId?: unknown;
|
|
21
|
+
readonly executionRouteId?: unknown;
|
|
22
|
+
readonly recordId?: unknown;
|
|
23
|
+
readonly executionRecordId?: unknown;
|
|
24
|
+
readonly processId?: unknown;
|
|
25
|
+
readonly processSessionId?: unknown;
|
|
26
|
+
readonly sessionId?: unknown;
|
|
27
|
+
readonly session_id?: unknown;
|
|
28
|
+
readonly target?: unknown;
|
|
29
|
+
readonly query?: unknown;
|
|
30
|
+
readonly includeParameters?: unknown;
|
|
31
|
+
readonly limit?: unknown;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
interface AgentExecutionToolDeps {
|
|
35
|
+
readonly commandRegistry: CommandRegistry;
|
|
36
|
+
readonly commandContext: CommandContext;
|
|
37
|
+
readonly toolRegistry: ToolRegistry;
|
|
38
|
+
readonly harnessTool?: Tool;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function error(message: string): { readonly success: false; readonly error: string } {
|
|
42
|
+
return { success: false, error: message };
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function readString(value: unknown): string {
|
|
46
|
+
return typeof value === 'string' ? value.trim() : '';
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function normalizeExecutionAction(value: unknown): AgentExecutionAction | null {
|
|
50
|
+
const action = readString(value).toLowerCase().replace(/-/g, '_');
|
|
51
|
+
if (!action) return null;
|
|
52
|
+
if (action === 'status' || action === 'summary' || action === 'overview' || action === 'routes' || action === 'posture' || action === 'execution_posture') return 'status';
|
|
53
|
+
if (action === 'route' || action === 'show_route' || action === 'inspect_route' || action === 'execution_route') return 'route';
|
|
54
|
+
if (action === 'history' || action === 'activity' || action === 'records' || action === 'execution_history') return 'history';
|
|
55
|
+
if (action === 'record' || action === 'item' || action === 'show' || action === 'inspect' || action === 'execution_history_item') return 'record';
|
|
56
|
+
if (action === 'processes' || action === 'background' || action === 'backgrounds' || action === 'background_processes') return 'processes';
|
|
57
|
+
if (action === 'capabilities' || action === 'doctor' || action === 'parity' || action === 'process_capabilities' || action === 'process_doctor' || action === 'process_parity') return 'process_capabilities';
|
|
58
|
+
if (action === 'process' || action === 'background_process') return 'process';
|
|
59
|
+
if (action === 'recovery' || action === 'file_recovery' || action === 'undo_redo') return 'recovery';
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function readAction(args: AgentExecutionToolArgs): AgentExecutionAction | null {
|
|
64
|
+
const explicit = readString(args.action) || readString(args.mode);
|
|
65
|
+
if (explicit) return normalizeExecutionAction(explicit);
|
|
66
|
+
const id = readString(args.id);
|
|
67
|
+
if (readString(args.processId) || readString(args.processSessionId) || readString(args.sessionId) || readString(args.session_id)) return 'process';
|
|
68
|
+
if (readString(args.executionRecordId) || readString(args.recordId)) return 'record';
|
|
69
|
+
if (/^(bg|proc|process|session)[_-]/i.test(id)) return 'process';
|
|
70
|
+
if (readString(args.executionRouteId) || readString(args.routeId) || id) return 'route';
|
|
71
|
+
return 'status';
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function compactArgs(entries: Record<string, unknown>): Record<string, unknown> {
|
|
75
|
+
return Object.fromEntries(Object.entries(entries).filter(([, value]) => value !== undefined && value !== ''));
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function routeId(args: AgentExecutionToolArgs): string {
|
|
79
|
+
return readString(args.executionRouteId) || readString(args.routeId) || readString(args.id);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function recordId(args: AgentExecutionToolArgs): string {
|
|
83
|
+
return readString(args.executionRecordId) || readString(args.recordId) || readString(args.id);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function processLookup(args: AgentExecutionToolArgs): Record<string, unknown> {
|
|
87
|
+
const id = readString(args.processId) || readString(args.processSessionId) || readString(args.sessionId) || readString(args.session_id) || readString(args.id);
|
|
88
|
+
return compactArgs({
|
|
89
|
+
processId: id,
|
|
90
|
+
target: id ? undefined : args.target,
|
|
91
|
+
query: id ? undefined : args.query,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function statusArgs(args: AgentExecutionToolArgs): Record<string, unknown> {
|
|
96
|
+
return compactArgs({
|
|
97
|
+
mode: 'execution_posture',
|
|
98
|
+
query: args.query ?? args.target,
|
|
99
|
+
limit: args.limit,
|
|
100
|
+
includeParameters: args.includeParameters,
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function routeArgs(args: AgentExecutionToolArgs): Record<string, unknown> {
|
|
105
|
+
const executionRouteId = routeId(args);
|
|
106
|
+
return compactArgs({
|
|
107
|
+
mode: 'execution_route',
|
|
108
|
+
executionRouteId,
|
|
109
|
+
target: executionRouteId ? undefined : args.target,
|
|
110
|
+
query: executionRouteId ? undefined : args.query,
|
|
111
|
+
includeParameters: args.includeParameters,
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function historyArgs(args: AgentExecutionToolArgs): Record<string, unknown> {
|
|
116
|
+
return compactArgs({
|
|
117
|
+
mode: 'execution_history',
|
|
118
|
+
query: args.query ?? args.target,
|
|
119
|
+
limit: args.limit,
|
|
120
|
+
includeParameters: args.includeParameters,
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function recordArgs(args: AgentExecutionToolArgs): Record<string, unknown> {
|
|
125
|
+
const executionRecordId = recordId(args);
|
|
126
|
+
return compactArgs({
|
|
127
|
+
mode: 'execution_history_item',
|
|
128
|
+
executionRecordId,
|
|
129
|
+
target: executionRecordId ? undefined : args.target,
|
|
130
|
+
query: executionRecordId ? undefined : args.query,
|
|
131
|
+
includeParameters: args.includeParameters,
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function processesArgs(args: AgentExecutionToolArgs): Record<string, unknown> {
|
|
136
|
+
return compactArgs({
|
|
137
|
+
mode: 'background_processes',
|
|
138
|
+
query: args.query ?? args.target,
|
|
139
|
+
limit: args.limit,
|
|
140
|
+
includeParameters: args.includeParameters,
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function processCapabilitiesArgs(): Record<string, unknown> {
|
|
145
|
+
return {
|
|
146
|
+
mode: 'run_background_process',
|
|
147
|
+
processAction: 'capabilities',
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function processArgs(args: AgentExecutionToolArgs): Record<string, unknown> {
|
|
152
|
+
return compactArgs({
|
|
153
|
+
mode: 'background_process',
|
|
154
|
+
...processLookup(args),
|
|
155
|
+
includeParameters: args.includeParameters,
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
function recoveryArgs(args: AgentExecutionToolArgs): Record<string, unknown> {
|
|
160
|
+
return compactArgs({
|
|
161
|
+
mode: 'file_recovery',
|
|
162
|
+
includeParameters: args.includeParameters,
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export function createAgentExecutionTool(deps: AgentExecutionToolDeps): Tool {
|
|
167
|
+
const harnessTool = deps.harnessTool ?? createAgentHarnessTool({
|
|
168
|
+
commandRegistry: deps.commandRegistry,
|
|
169
|
+
commandContext: deps.commandContext,
|
|
170
|
+
toolRegistry: deps.toolRegistry,
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
return {
|
|
174
|
+
definition: {
|
|
175
|
+
name: 'execution',
|
|
176
|
+
description: 'Inspect local work routes, history, and recovery.',
|
|
177
|
+
parameters: {
|
|
178
|
+
type: 'object',
|
|
179
|
+
properties: {
|
|
180
|
+
action: {
|
|
181
|
+
type: 'string',
|
|
182
|
+
enum: ['status', 'route', 'history', 'record', 'processes', 'process_capabilities', 'process', 'recovery', 'capabilities', 'doctor', 'parity'],
|
|
183
|
+
description: 'Read-only execution posture, route, history, process, or recovery view.',
|
|
184
|
+
},
|
|
185
|
+
mode: { type: 'string', description: 'Alias for action.' },
|
|
186
|
+
id: { type: 'string', description: 'Generic route, record, process, or session id.' },
|
|
187
|
+
routeId: { type: 'string', description: 'Alias for executionRouteId.' },
|
|
188
|
+
executionRouteId: { type: 'string', description: 'Execution route id.' },
|
|
189
|
+
recordId: { type: 'string', description: 'Alias for executionRecordId.' },
|
|
190
|
+
executionRecordId: { type: 'string', description: 'Execution history record id.' },
|
|
191
|
+
processId: { type: 'string', description: 'Tracked local background process id.' },
|
|
192
|
+
processSessionId: { type: 'string', description: 'Tracked process session id alias.' },
|
|
193
|
+
sessionId: { type: 'string', description: 'Tracked process session id alias.' },
|
|
194
|
+
session_id: { type: 'string', description: 'Tracked process session id alias.' },
|
|
195
|
+
target: { type: 'string', description: 'Lookup target or search text.' },
|
|
196
|
+
query: { type: 'string', description: 'Search text.' },
|
|
197
|
+
includeParameters: { type: 'boolean', description: 'Include detailed route, evidence, and policy metadata.' },
|
|
198
|
+
limit: { type: 'number', description: 'Maximum rows returned.' },
|
|
199
|
+
},
|
|
200
|
+
additionalProperties: false,
|
|
201
|
+
},
|
|
202
|
+
sideEffects: [],
|
|
203
|
+
concurrency: 'parallel',
|
|
204
|
+
},
|
|
205
|
+
execute: async (rawArgs: unknown) => {
|
|
206
|
+
const args = (rawArgs && typeof rawArgs === 'object' && !Array.isArray(rawArgs) ? rawArgs : {}) as AgentExecutionToolArgs;
|
|
207
|
+
const action = readAction(args);
|
|
208
|
+
if (!action) return error('Unknown execution action. Use action:"status" for local route posture or action:"history" for recent work.');
|
|
209
|
+
|
|
210
|
+
if (action === 'status') return harnessTool.execute(statusArgs(args));
|
|
211
|
+
if (action === 'route') return harnessTool.execute(routeArgs(args));
|
|
212
|
+
if (action === 'history') return harnessTool.execute(historyArgs(args));
|
|
213
|
+
if (action === 'record') return harnessTool.execute(recordArgs(args));
|
|
214
|
+
if (action === 'processes') return harnessTool.execute(processesArgs(args));
|
|
215
|
+
if (action === 'process_capabilities') return harnessTool.execute(processCapabilitiesArgs());
|
|
216
|
+
if (action === 'process') return harnessTool.execute(processArgs(args));
|
|
217
|
+
if (action === 'recovery') return harnessTool.execute(recoveryArgs(args));
|
|
218
|
+
|
|
219
|
+
return error('Unknown execution action. Use action:"status" for local route posture or action:"history" for recent work.');
|
|
220
|
+
},
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export function registerAgentExecutionTool(
|
|
225
|
+
registry: ToolRegistry,
|
|
226
|
+
commandRegistry: CommandRegistry,
|
|
227
|
+
commandContext: CommandContext,
|
|
228
|
+
): void {
|
|
229
|
+
if (!registry.has('execution')) registry.register(createAgentExecutionTool({ commandRegistry, commandContext, toolRegistry: registry }));
|
|
230
|
+
}
|