@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,167 @@
|
|
|
1
|
+
import type { Tool } from '@pellux/goodvibes-sdk/platform/types';
|
|
2
|
+
import type { ToolRegistry } from '@pellux/goodvibes-sdk/platform/tools';
|
|
3
|
+
import type { CommandContext } from '../input/command-registry.ts';
|
|
4
|
+
import { backgroundProcessSummary, describeBackgroundProcess, runBackgroundProcessAction } from './agent-harness-background-processes.ts';
|
|
5
|
+
|
|
6
|
+
const READ_ONLY_PROCESS_ACTIONS = new Set(['list', 'status', 'poll', 'log', 'output', 'capabilities', 'doctor', 'parity']);
|
|
7
|
+
|
|
8
|
+
interface AgentTerminalToolArgs {
|
|
9
|
+
readonly command?: unknown;
|
|
10
|
+
readonly background?: unknown;
|
|
11
|
+
readonly cwd?: unknown;
|
|
12
|
+
readonly timeoutMs?: unknown;
|
|
13
|
+
readonly pty?: unknown;
|
|
14
|
+
readonly confirm?: unknown;
|
|
15
|
+
readonly explicitUserRequest?: unknown;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface AgentProcessToolArgs {
|
|
19
|
+
readonly action?: unknown;
|
|
20
|
+
readonly processAction?: unknown;
|
|
21
|
+
readonly processId?: unknown;
|
|
22
|
+
readonly processSessionId?: unknown;
|
|
23
|
+
readonly sessionId?: unknown;
|
|
24
|
+
readonly session_id?: unknown;
|
|
25
|
+
readonly command?: unknown;
|
|
26
|
+
readonly cwd?: unknown;
|
|
27
|
+
readonly timeoutMs?: unknown;
|
|
28
|
+
readonly pty?: unknown;
|
|
29
|
+
readonly data?: unknown;
|
|
30
|
+
readonly query?: unknown;
|
|
31
|
+
readonly target?: unknown;
|
|
32
|
+
readonly limit?: unknown;
|
|
33
|
+
readonly includeParameters?: unknown;
|
|
34
|
+
readonly confirm?: unknown;
|
|
35
|
+
readonly explicitUserRequest?: unknown;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function output(value: unknown): { readonly success: true; readonly output: string } {
|
|
39
|
+
return {
|
|
40
|
+
success: true,
|
|
41
|
+
output: typeof value === 'string' ? value : JSON.stringify(value, null, 2),
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function error(message: string): { readonly success: false; readonly error: string } {
|
|
46
|
+
return { success: false, error: message };
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function readString(value: unknown): string {
|
|
50
|
+
return typeof value === 'string' ? value.trim() : '';
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function readBoolean(value: unknown): boolean {
|
|
54
|
+
return value === true || (typeof value === 'string' && value.trim().toLowerCase() === 'true');
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function readProcessAction(args: AgentProcessToolArgs): string {
|
|
58
|
+
const action = readString(args.action) || readString(args.processAction);
|
|
59
|
+
if (action) return action.toLowerCase();
|
|
60
|
+
return readString(args.command) ? 'start' : 'list';
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function isReadOnlyProcessAction(action: string): boolean {
|
|
64
|
+
return READ_ONLY_PROCESS_ACTIONS.has(action);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function createAgentTerminalTool(commandContext: CommandContext): Tool {
|
|
68
|
+
return {
|
|
69
|
+
definition: {
|
|
70
|
+
name: 'terminal',
|
|
71
|
+
description: 'Start visible tracked background shell commands.',
|
|
72
|
+
parameters: {
|
|
73
|
+
type: 'object',
|
|
74
|
+
properties: {
|
|
75
|
+
command: { type: 'string', description: 'Shell command to start via the shared ProcessManager.' },
|
|
76
|
+
background: { type: 'boolean', description: 'Must be true. Foreground shell uses exec.' },
|
|
77
|
+
cwd: { type: 'string', description: 'Workspace-relative or absolute working directory.' },
|
|
78
|
+
timeoutMs: { type: 'number', description: 'Background process timeout in milliseconds.' },
|
|
79
|
+
pty: { type: 'boolean', description: 'Request PTY mode; returns unsupported until the SDK publishes a typed PTY contract.' },
|
|
80
|
+
confirm: { type: 'boolean', description: 'Required true for starting a process.' },
|
|
81
|
+
explicitUserRequest: { type: 'string', description: 'The user request authorizing the background command.' },
|
|
82
|
+
},
|
|
83
|
+
required: ['command', 'background'],
|
|
84
|
+
additionalProperties: false,
|
|
85
|
+
},
|
|
86
|
+
sideEffects: ['exec'],
|
|
87
|
+
concurrency: 'serial',
|
|
88
|
+
supportsProgress: true,
|
|
89
|
+
supportsStreamingOutput: true,
|
|
90
|
+
},
|
|
91
|
+
execute: async (args: Record<string, unknown>) => {
|
|
92
|
+
const input = args as AgentTerminalToolArgs;
|
|
93
|
+
if (!readBoolean(input.background)) {
|
|
94
|
+
return error('terminal is the tracked-background adapter. Use exec for bounded foreground shell commands, or call terminal with background:true, confirm:true, and explicitUserRequest.');
|
|
95
|
+
}
|
|
96
|
+
return output(await runBackgroundProcessAction(commandContext, {
|
|
97
|
+
...input,
|
|
98
|
+
processAction: 'start',
|
|
99
|
+
}));
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export function createAgentProcessTool(commandContext: CommandContext): Tool {
|
|
105
|
+
return {
|
|
106
|
+
definition: {
|
|
107
|
+
name: 'process',
|
|
108
|
+
description: 'List, poll, log, wait, stop tracked processes.',
|
|
109
|
+
parameters: {
|
|
110
|
+
type: 'object',
|
|
111
|
+
properties: {
|
|
112
|
+
action: {
|
|
113
|
+
type: 'string',
|
|
114
|
+
enum: ['list', 'poll', 'status', 'wait', 'log', 'output', 'kill', 'stop', 'cancel', 'write', 'start', 'capabilities', 'doctor', 'parity'],
|
|
115
|
+
description: 'Process lifecycle action. list/poll/log are read-only; wait/kill/write/start require confirmation.',
|
|
116
|
+
},
|
|
117
|
+
processAction: { type: 'string', description: 'Alias for action.' },
|
|
118
|
+
processId: { type: 'string', description: 'Tracked background process id.' },
|
|
119
|
+
processSessionId: { type: 'string', description: 'Process session id alias.' },
|
|
120
|
+
sessionId: { type: 'string', description: 'Process session id alias.' },
|
|
121
|
+
session_id: { type: 'string', description: 'Process session id alias.' },
|
|
122
|
+
command: { type: 'string', description: 'Shell command for action:start.' },
|
|
123
|
+
cwd: { type: 'string', description: 'Working directory for action:start.' },
|
|
124
|
+
timeoutMs: { type: 'number', description: 'Wait or background timeout in milliseconds.' },
|
|
125
|
+
pty: { type: 'boolean', description: 'Request PTY mode; reports unsupported until a typed contract exists.' },
|
|
126
|
+
data: { type: 'string', description: 'Input data for confirmed action:write when supported by the SDK.' },
|
|
127
|
+
query: { type: 'string', description: 'Search text for list or process lookup.' },
|
|
128
|
+
target: { type: 'string', description: 'Process lookup text.' },
|
|
129
|
+
limit: { type: 'number', description: 'Maximum list rows.' },
|
|
130
|
+
includeParameters: { type: 'boolean', description: 'Include full bounded command/output metadata.' },
|
|
131
|
+
confirm: { type: 'boolean', description: 'Required true for wait/kill/write/start.' },
|
|
132
|
+
explicitUserRequest: { type: 'string', description: 'The user request authorizing side-effecting process actions.' },
|
|
133
|
+
},
|
|
134
|
+
additionalProperties: false,
|
|
135
|
+
},
|
|
136
|
+
sideEffects: ['exec'],
|
|
137
|
+
concurrency: 'serial',
|
|
138
|
+
supportsProgress: true,
|
|
139
|
+
supportsStreamingOutput: true,
|
|
140
|
+
},
|
|
141
|
+
execute: async (args: Record<string, unknown>) => {
|
|
142
|
+
const input = args as AgentProcessToolArgs;
|
|
143
|
+
const action = readProcessAction(input);
|
|
144
|
+
|
|
145
|
+
if (action === 'list') return output(backgroundProcessSummary(commandContext, input));
|
|
146
|
+
if (isReadOnlyProcessAction(action) && action !== 'capabilities' && action !== 'doctor' && action !== 'parity') {
|
|
147
|
+
const resolved = describeBackgroundProcess(commandContext, {
|
|
148
|
+
...input,
|
|
149
|
+
processAction: action,
|
|
150
|
+
});
|
|
151
|
+
if (resolved.status === 'found') return output(resolved.process);
|
|
152
|
+
if (resolved.status === 'ambiguous') return error(`Ambiguous process ${resolved.input}. Candidates: ${JSON.stringify(resolved.candidates)}`);
|
|
153
|
+
return error(resolved.usage);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
return output(await runBackgroundProcessAction(commandContext, {
|
|
157
|
+
...input,
|
|
158
|
+
processAction: action,
|
|
159
|
+
}));
|
|
160
|
+
},
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export function registerAgentTerminalProcessTools(registry: ToolRegistry, commandContext: CommandContext): void {
|
|
165
|
+
if (!registry.has('terminal')) registry.register(createAgentTerminalTool(commandContext));
|
|
166
|
+
if (!registry.has('process')) registry.register(createAgentProcessTool(commandContext));
|
|
167
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
export type AgentToolArgs = {
|
|
2
|
+
readonly mode?: unknown;
|
|
3
|
+
readonly [key: string]: unknown;
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
export type ExecCommandArgs = {
|
|
7
|
+
readonly cmd?: unknown;
|
|
8
|
+
readonly background?: unknown;
|
|
9
|
+
readonly until?: unknown;
|
|
10
|
+
readonly [key: string]: unknown;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export type ExecToolArgs = {
|
|
14
|
+
readonly commands?: unknown;
|
|
15
|
+
readonly parallel?: unknown;
|
|
16
|
+
readonly file_ops?: unknown;
|
|
17
|
+
readonly [key: string]: unknown;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type ModeToolArgs = {
|
|
21
|
+
readonly mode?: unknown;
|
|
22
|
+
readonly createIfMissing?: unknown;
|
|
23
|
+
readonly [key: string]: unknown;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export type FetchToolArgs = {
|
|
27
|
+
readonly urls?: unknown;
|
|
28
|
+
readonly parallel?: unknown;
|
|
29
|
+
readonly sanitize_mode?: unknown;
|
|
30
|
+
readonly trusted_hosts?: unknown;
|
|
31
|
+
readonly [key: string]: unknown;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export type StateToolArgs = {
|
|
35
|
+
readonly mode?: unknown;
|
|
36
|
+
readonly memoryAction?: unknown;
|
|
37
|
+
readonly hookAction?: unknown;
|
|
38
|
+
readonly modeAction?: unknown;
|
|
39
|
+
readonly analyticsAction?: unknown;
|
|
40
|
+
readonly values?: unknown;
|
|
41
|
+
readonly clearKeys?: unknown;
|
|
42
|
+
readonly memoryValue?: unknown;
|
|
43
|
+
readonly hookDefinition?: unknown;
|
|
44
|
+
readonly modeName?: unknown;
|
|
45
|
+
readonly analyticsTool?: unknown;
|
|
46
|
+
readonly analyticsArgs?: unknown;
|
|
47
|
+
readonly analyticsResult?: unknown;
|
|
48
|
+
readonly analyticsDuration?: unknown;
|
|
49
|
+
readonly analyticsTokens?: unknown;
|
|
50
|
+
readonly analyticsFormat?: unknown;
|
|
51
|
+
readonly [key: string]: unknown;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export type InspectToolArgs = {
|
|
55
|
+
readonly mode?: unknown;
|
|
56
|
+
readonly dryRun?: unknown;
|
|
57
|
+
readonly [key: string]: unknown;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export type AgentToolPolicyGuardOptions = {
|
|
61
|
+
readonly getLastUserMessage?: () => string | null;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export type ModeRestrictedToolPolicy = {
|
|
65
|
+
readonly allowedModes: readonly string[];
|
|
66
|
+
readonly modeSet: ReadonlySet<string>;
|
|
67
|
+
readonly description: string;
|
|
68
|
+
readonly denial: string;
|
|
69
|
+
readonly removedProperties?: readonly string[];
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export interface AgentToolPolicyInvocationExplanation {
|
|
73
|
+
readonly status: 'allowed' | 'denied';
|
|
74
|
+
readonly layer: 'agent_tool_policy';
|
|
75
|
+
readonly reason: string;
|
|
76
|
+
readonly allowedModes?: readonly string[];
|
|
77
|
+
}
|
|
@@ -10,79 +10,37 @@ import {
|
|
|
10
10
|
import { wrapFindToolForAgentPolicy } from './agent-find-policy.ts';
|
|
11
11
|
import { wrapReadToolForAgentPolicy } from './agent-read-policy.ts';
|
|
12
12
|
import { wrapWebSearchToolForAgentPolicy } from './agent-web-search-policy.ts';
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
readonly file_ops?: unknown;
|
|
30
|
-
readonly [key: string]: unknown;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
type ModeToolArgs = {
|
|
34
|
-
readonly mode?: unknown;
|
|
35
|
-
readonly createIfMissing?: unknown;
|
|
36
|
-
readonly [key: string]: unknown;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
type FetchToolArgs = {
|
|
40
|
-
readonly urls?: unknown;
|
|
41
|
-
readonly parallel?: unknown;
|
|
42
|
-
readonly sanitize_mode?: unknown;
|
|
43
|
-
readonly trusted_hosts?: unknown;
|
|
44
|
-
readonly [key: string]: unknown;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
type StateToolArgs = {
|
|
48
|
-
readonly mode?: unknown;
|
|
49
|
-
readonly memoryAction?: unknown;
|
|
50
|
-
readonly hookAction?: unknown;
|
|
51
|
-
readonly modeAction?: unknown;
|
|
52
|
-
readonly analyticsAction?: unknown;
|
|
53
|
-
readonly values?: unknown;
|
|
54
|
-
readonly clearKeys?: unknown;
|
|
55
|
-
readonly memoryValue?: unknown;
|
|
56
|
-
readonly hookDefinition?: unknown;
|
|
57
|
-
readonly modeName?: unknown;
|
|
58
|
-
readonly analyticsTool?: unknown;
|
|
59
|
-
readonly analyticsArgs?: unknown;
|
|
60
|
-
readonly analyticsResult?: unknown;
|
|
61
|
-
readonly analyticsDuration?: unknown;
|
|
62
|
-
readonly analyticsTokens?: unknown;
|
|
63
|
-
readonly analyticsFormat?: unknown;
|
|
64
|
-
readonly [key: string]: unknown;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
type InspectToolArgs = {
|
|
68
|
-
readonly mode?: unknown;
|
|
69
|
-
readonly dryRun?: unknown;
|
|
70
|
-
readonly [key: string]: unknown;
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
type AgentToolPolicyGuardOptions = {
|
|
74
|
-
readonly getLastUserMessage?: () => string | null;
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
const BLOCKED_MAIN_CONVERSATION_TOOL_NAMES = ['write', 'edit', 'workflow', 'repl'] as const;
|
|
78
|
-
const AGENT_EXEC_BACKGROUND_COMMAND = /^\s*bg_(?:status|output|stop)\b/;
|
|
13
|
+
import type {
|
|
14
|
+
AgentToolArgs,
|
|
15
|
+
AgentToolPolicyGuardOptions,
|
|
16
|
+
AgentToolPolicyInvocationExplanation,
|
|
17
|
+
ExecCommandArgs,
|
|
18
|
+
ExecToolArgs,
|
|
19
|
+
FetchToolArgs,
|
|
20
|
+
InspectToolArgs,
|
|
21
|
+
ModeRestrictedToolPolicy,
|
|
22
|
+
ModeToolArgs,
|
|
23
|
+
StateToolArgs,
|
|
24
|
+
} from './agent-tool-policy-guard-types.ts';
|
|
25
|
+
export type { AgentToolPolicyInvocationExplanation } from './agent-tool-policy-guard-types.ts';
|
|
26
|
+
|
|
27
|
+
const BLOCKED_MAIN_CONVERSATION_TOOL_NAMES = [] as const;
|
|
28
|
+
const AGENT_EXEC_BACKGROUND_COMMAND = /^\s*bg_(?:list|status|output|stop)\b/;
|
|
79
29
|
|
|
80
30
|
const READ_ONLY_AGENT_TOOL_MODES = [
|
|
31
|
+
'spawn',
|
|
32
|
+
'batch-spawn',
|
|
81
33
|
'status',
|
|
34
|
+
'cancel',
|
|
82
35
|
'list',
|
|
83
36
|
'templates',
|
|
84
37
|
'get',
|
|
85
38
|
'budget',
|
|
39
|
+
'plan',
|
|
40
|
+
'wait',
|
|
41
|
+
'message',
|
|
42
|
+
'wrfc-chains',
|
|
43
|
+
'wrfc-history',
|
|
86
44
|
'cohort-status',
|
|
87
45
|
'cohort-report',
|
|
88
46
|
] as const;
|
|
@@ -122,21 +80,19 @@ const READ_ONLY_QUERY_TOOL_MODE_SET = new Set<string>(READ_ONLY_QUERY_TOOL_MODES
|
|
|
122
80
|
const READ_ONLY_CONTROL_TOOL_MODE_SET = new Set<string>(READ_ONLY_CONTROL_TOOL_MODES);
|
|
123
81
|
|
|
124
82
|
const LOCAL_AGENT_DENIAL = [
|
|
125
|
-
'GoodVibes Agent
|
|
126
|
-
'
|
|
127
|
-
'For explicit build/fix/review work, delegate one request to GoodVibes TUI through the public shared-session/build-delegation contract with the full original user ask.',
|
|
83
|
+
'GoodVibes Agent creates only visible, tracked Agent jobs.',
|
|
84
|
+
'Use a known agent mode and keep spawned work tied to the user request, visible status, and cancellable follow-up.',
|
|
128
85
|
].join(' ');
|
|
129
86
|
|
|
130
87
|
const LOCAL_CODING_TOOL_DENIAL = [
|
|
131
|
-
'
|
|
132
|
-
'
|
|
133
|
-
'For durable Agent memory, skills, personas, routines, and knowledge, use the Agent-owned commands and isolated Agent Knowledge routes.',
|
|
88
|
+
'This tool is not exposed directly in GoodVibes Agent.',
|
|
89
|
+
'Use a first-class visible Agent tool or a confirmed GoodVibes daemon operator method for the requested workflow.',
|
|
134
90
|
].join(' ');
|
|
135
91
|
|
|
136
92
|
const BACKGROUND_EXEC_DENIAL = [
|
|
137
93
|
'GoodVibes Agent only runs foreground, serial command-line work from the main conversation.',
|
|
138
|
-
'
|
|
139
|
-
'For long-running
|
|
94
|
+
'Raw exec background flags, parallel command batches, bg_* controls, and exec pre-command file operations are disabled here.',
|
|
95
|
+
'For user-approved long-running local commands, use execution action:"processes", terminal background:true, and process lifecycle actions. Delegate only when isolation, remote execution, or parallel work is the user benefit.',
|
|
140
96
|
].join(' ');
|
|
141
97
|
|
|
142
98
|
const REMOTE_MUTATION_DENIAL = [
|
|
@@ -460,14 +416,6 @@ export function normalizeInspectToolInvocationForAgentPolicy(args: InspectToolAr
|
|
|
460
416
|
return { ...args, dryRun: true };
|
|
461
417
|
}
|
|
462
418
|
|
|
463
|
-
type ModeRestrictedToolPolicy = {
|
|
464
|
-
readonly allowedModes: readonly string[];
|
|
465
|
-
readonly modeSet: ReadonlySet<string>;
|
|
466
|
-
readonly description: string;
|
|
467
|
-
readonly denial: string;
|
|
468
|
-
readonly removedProperties?: readonly string[];
|
|
469
|
-
};
|
|
470
|
-
|
|
471
419
|
export function wrapModeRestrictedToolForAgentPolicy(tool: Tool, policy: ModeRestrictedToolPolicy): void {
|
|
472
420
|
narrowModeToolDefinitionForAgentPolicy(tool, policy.allowedModes, policy.description);
|
|
473
421
|
if (policy.removedProperties) removeToolDefinitionProperties(tool, policy.removedProperties);
|
|
@@ -507,6 +455,80 @@ export function validateChannelToolInvocationForAgentPolicy(args: ModeToolArgs):
|
|
|
507
455
|
return null;
|
|
508
456
|
}
|
|
509
457
|
|
|
458
|
+
function allowedByAgentPolicy(reason: string, allowedModes?: readonly string[]): AgentToolPolicyInvocationExplanation {
|
|
459
|
+
return {
|
|
460
|
+
status: 'allowed',
|
|
461
|
+
layer: 'agent_tool_policy',
|
|
462
|
+
reason,
|
|
463
|
+
...(allowedModes ? { allowedModes } : {}),
|
|
464
|
+
};
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
function deniedByAgentPolicy(reason: string, allowedModes?: readonly string[]): AgentToolPolicyInvocationExplanation {
|
|
468
|
+
return {
|
|
469
|
+
status: 'denied',
|
|
470
|
+
layer: 'agent_tool_policy',
|
|
471
|
+
reason,
|
|
472
|
+
...(allowedModes ? { allowedModes } : {}),
|
|
473
|
+
};
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
function explainModeRestrictedAgentPolicy(
|
|
477
|
+
args: ModeToolArgs,
|
|
478
|
+
allowedModes: readonly string[],
|
|
479
|
+
modeSet: ReadonlySet<string>,
|
|
480
|
+
denial: string,
|
|
481
|
+
): AgentToolPolicyInvocationExplanation {
|
|
482
|
+
const denied = validateModeRestrictedToolInvocationForAgentPolicy(args, modeSet, denial);
|
|
483
|
+
if (denied) return deniedByAgentPolicy(denied, allowedModes);
|
|
484
|
+
const mode = typeof args.mode === 'string' && args.mode.trim() ? args.mode.trim() : '(default)';
|
|
485
|
+
return allowedByAgentPolicy(`Agent policy allows ${mode} for read-only inspection on this tool.`, allowedModes);
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
export function explainAgentToolPolicyInvocation(
|
|
489
|
+
toolName: string,
|
|
490
|
+
args: Record<string, unknown> = {},
|
|
491
|
+
): AgentToolPolicyInvocationExplanation {
|
|
492
|
+
if (BLOCKED_MAIN_CONVERSATION_TOOL_NAME_SET.has(toolName)) return deniedByAgentPolicy(LOCAL_CODING_TOOL_DENIAL);
|
|
493
|
+
if (toolName === 'agent') {
|
|
494
|
+
const denied = validateAgentToolInvocationForAgentPolicy(args as AgentToolArgs);
|
|
495
|
+
return denied ? deniedByAgentPolicy(denied, READ_ONLY_AGENT_TOOL_MODES) : allowedByAgentPolicy('Agent policy allows visible tracked Agent modes.', READ_ONLY_AGENT_TOOL_MODES);
|
|
496
|
+
}
|
|
497
|
+
if (toolName === 'exec') {
|
|
498
|
+
const denied = validateExecToolInvocationForAgentPolicy(args as ExecToolArgs);
|
|
499
|
+
return denied ? deniedByAgentPolicy(denied) : allowedByAgentPolicy('Agent policy allows foreground serial shell execution.');
|
|
500
|
+
}
|
|
501
|
+
if (toolName === 'remote') return explainModeRestrictedAgentPolicy(args as ModeToolArgs, READ_ONLY_REMOTE_TOOL_MODES, READ_ONLY_REMOTE_TOOL_MODE_SET, REMOTE_MUTATION_DENIAL);
|
|
502
|
+
if (toolName === 'channel') {
|
|
503
|
+
const modeDenied = validateModeRestrictedToolInvocationForAgentPolicy(args as ModeToolArgs, READ_ONLY_CHANNEL_TOOL_MODE_SET, CHANNEL_ACTION_DENIAL);
|
|
504
|
+
const channelDenied = modeDenied ?? validateChannelToolInvocationForAgentPolicy(args as ModeToolArgs);
|
|
505
|
+
return channelDenied
|
|
506
|
+
? deniedByAgentPolicy(channelDenied, READ_ONLY_CHANNEL_TOOL_MODES)
|
|
507
|
+
: allowedByAgentPolicy('Agent policy allows read-only channel inspection.', READ_ONLY_CHANNEL_TOOL_MODES);
|
|
508
|
+
}
|
|
509
|
+
if (toolName === 'mcp') return explainModeRestrictedAgentPolicy(args as ModeToolArgs, READ_ONLY_MCP_TOOL_MODES, READ_ONLY_MCP_TOOL_MODE_SET, MCP_SECURITY_MUTATION_DENIAL);
|
|
510
|
+
if (toolName === 'fetch') {
|
|
511
|
+
const denied = validateFetchToolInvocationForAgentPolicy(args as FetchToolArgs);
|
|
512
|
+
return denied ? deniedByAgentPolicy(denied, READ_ONLY_FETCH_METHODS) : allowedByAgentPolicy('Agent policy allows serial sanitized read-only HTTP fetches.', READ_ONLY_FETCH_METHODS);
|
|
513
|
+
}
|
|
514
|
+
if (toolName === 'state') {
|
|
515
|
+
const denied = validateStateToolInvocationForAgentPolicy(args as StateToolArgs);
|
|
516
|
+
return denied ? deniedByAgentPolicy(denied, READ_ONLY_STATE_TOOL_MODES) : allowedByAgentPolicy('Agent policy allows read-only runtime state inspection.', READ_ONLY_STATE_TOOL_MODES);
|
|
517
|
+
}
|
|
518
|
+
if (toolName === 'goodvibes_settings') return deniedByAgentPolicy(SETTINGS_MUTATION_DENIAL);
|
|
519
|
+
if (toolName === 'inspect') {
|
|
520
|
+
const denied = validateInspectToolInvocationForAgentPolicy(args as InspectToolArgs);
|
|
521
|
+
return denied ? deniedByAgentPolicy(denied) : allowedByAgentPolicy('Agent policy allows inspection and dry-run scaffolding only.');
|
|
522
|
+
}
|
|
523
|
+
if (toolName === 'control') return explainModeRestrictedAgentPolicy(args as ModeToolArgs, READ_ONLY_CONTROL_TOOL_MODES, READ_ONLY_CONTROL_TOOL_MODE_SET, CONTROL_MUTATION_DENIAL);
|
|
524
|
+
if (toolName === 'task') return explainModeRestrictedAgentPolicy(args as ModeToolArgs, READ_ONLY_TASK_TOOL_MODES, READ_ONLY_TASK_TOOL_MODE_SET, DURABLE_WORKFLOW_MUTATION_DENIAL);
|
|
525
|
+
if (toolName === 'team') return explainModeRestrictedAgentPolicy(args as ModeToolArgs, READ_ONLY_TEAM_TOOL_MODES, READ_ONLY_TEAM_TOOL_MODE_SET, DURABLE_WORKFLOW_MUTATION_DENIAL);
|
|
526
|
+
if (toolName === 'worklist') return explainModeRestrictedAgentPolicy(args as ModeToolArgs, READ_ONLY_WORKLIST_TOOL_MODES, READ_ONLY_WORKLIST_TOOL_MODE_SET, DURABLE_WORKFLOW_MUTATION_DENIAL);
|
|
527
|
+
if (toolName === 'packet') return explainModeRestrictedAgentPolicy(args as ModeToolArgs, READ_ONLY_PACKET_TOOL_MODES, READ_ONLY_PACKET_TOOL_MODE_SET, DURABLE_WORKFLOW_MUTATION_DENIAL);
|
|
528
|
+
if (toolName === 'query') return explainModeRestrictedAgentPolicy(args as ModeToolArgs, READ_ONLY_QUERY_TOOL_MODES, READ_ONLY_QUERY_TOOL_MODE_SET, DURABLE_WORKFLOW_MUTATION_DENIAL);
|
|
529
|
+
return allowedByAgentPolicy('No Agent-specific route guard blocks this invocation.');
|
|
530
|
+
}
|
|
531
|
+
|
|
510
532
|
export const AGENT_LOCAL_SPAWN_DENIAL_MESSAGE = LOCAL_AGENT_DENIAL;
|
|
511
533
|
export const AGENT_READ_ONLY_TOOL_MODES = READ_ONLY_AGENT_TOOL_MODES;
|
|
512
534
|
export const AGENT_BLOCKED_MAIN_CONVERSATION_TOOL_NAMES = BLOCKED_MAIN_CONVERSATION_TOOL_NAMES;
|
|
@@ -595,15 +617,14 @@ function isPresent(value: unknown): boolean {
|
|
|
595
617
|
}
|
|
596
618
|
|
|
597
619
|
function narrowAgentToolDefinitionForAgentPolicy(tool: Tool): void {
|
|
598
|
-
tool.definition.description = '
|
|
599
|
-
tool.definition.sideEffects = [];
|
|
620
|
+
tool.definition.description = 'Visible local Agent orchestration for GoodVibes Agent: spawn, inspect, message, wait, cancel, and report tracked autonomous work.';
|
|
600
621
|
|
|
601
622
|
const properties = tool.definition.parameters.properties;
|
|
602
623
|
if (!isRecord(properties)) return;
|
|
603
624
|
const modeProperty = properties.mode;
|
|
604
625
|
if (!isRecord(modeProperty)) return;
|
|
605
626
|
modeProperty.enum = [...READ_ONLY_AGENT_TOOL_MODES];
|
|
606
|
-
modeProperty.description = '
|
|
627
|
+
modeProperty.description = 'Agent orchestration mode. Spawned work is visible, tracked, and cancellable.';
|
|
607
628
|
}
|
|
608
629
|
|
|
609
630
|
function narrowExecToolDefinitionForAgentPolicy(tool: Tool): void {
|