@pellux/goodvibes-agent 1.1.6 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +176 -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 +132662 -91399
- 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 +43 -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 +287 -0
- 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 +267 -10
- 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 +110 -89
- 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/tools/tool-execution-safety.ts +41 -0
- package/src/version.ts +1 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { OPERATOR_ACTIONS } from '../agent/operator-actions.ts';
|
|
1
|
+
import { getOperatorContract } from '@pellux/goodvibes-sdk/contracts';
|
|
3
2
|
import { previewHarnessText } from './agent-harness-text.ts';
|
|
4
3
|
|
|
5
4
|
export interface AgentHarnessOperatorMethodArgs {
|
|
@@ -13,19 +12,37 @@ export interface AgentHarnessOperatorMethodArgs {
|
|
|
13
12
|
type OperatorMethodEffect =
|
|
14
13
|
| 'read-only-network'
|
|
15
14
|
| 'confirmed-connected-host-state'
|
|
16
|
-
| 'confirmed-
|
|
15
|
+
| 'confirmed-admin-connected-host-state';
|
|
17
16
|
|
|
18
17
|
type OperatorMethodLookupSource = 'methodId' | 'target' | 'query';
|
|
19
18
|
|
|
19
|
+
interface OperatorContractMethod {
|
|
20
|
+
readonly id: string;
|
|
21
|
+
readonly title?: string;
|
|
22
|
+
readonly description?: string;
|
|
23
|
+
readonly category?: string;
|
|
24
|
+
readonly access?: string;
|
|
25
|
+
readonly scopes?: readonly string[];
|
|
26
|
+
readonly http?: {
|
|
27
|
+
readonly method?: string;
|
|
28
|
+
readonly path?: string;
|
|
29
|
+
};
|
|
30
|
+
readonly inputSchema?: Record<string, unknown>;
|
|
31
|
+
readonly invokable?: boolean;
|
|
32
|
+
}
|
|
33
|
+
|
|
20
34
|
interface OperatorMethodDescriptor {
|
|
21
35
|
readonly id: string;
|
|
22
36
|
readonly label: string;
|
|
23
37
|
readonly route: string;
|
|
24
38
|
readonly effect: OperatorMethodEffect;
|
|
25
|
-
readonly owner: '
|
|
39
|
+
readonly owner: 'goodvibes-daemon';
|
|
26
40
|
readonly preferredModelTool: string;
|
|
27
41
|
readonly confirmation: string;
|
|
28
42
|
readonly boundary: string;
|
|
43
|
+
readonly category: string;
|
|
44
|
+
readonly access: string;
|
|
45
|
+
readonly scopes: readonly string[];
|
|
29
46
|
readonly parameters?: readonly Record<string, unknown>[];
|
|
30
47
|
}
|
|
31
48
|
|
|
@@ -34,72 +51,7 @@ type OperatorMethodResolution =
|
|
|
34
51
|
| { readonly status: 'ambiguous'; readonly input: string; readonly candidates: readonly Record<string, unknown>[] }
|
|
35
52
|
| { readonly status: 'missing_lookup'; readonly usage: string };
|
|
36
53
|
|
|
37
|
-
const
|
|
38
|
-
{
|
|
39
|
-
id: 'projectPlanning.workPlan.snapshot',
|
|
40
|
-
label: 'Read work-plan snapshot.',
|
|
41
|
-
route: '/api/projects/planning/work-plan',
|
|
42
|
-
effect: 'read-only-network',
|
|
43
|
-
owner: 'connected-host',
|
|
44
|
-
preferredModelTool: 'agent_operator_briefing',
|
|
45
|
-
confirmation: 'Read-only; use the owning first-class tool.',
|
|
46
|
-
boundary: 'Public operator read route only; no work-plan mutation or hidden task creation.',
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
id: 'approvals.list',
|
|
50
|
-
label: 'List approval posture.',
|
|
51
|
-
route: '/api/approvals',
|
|
52
|
-
effect: 'read-only-network',
|
|
53
|
-
owner: 'connected-host',
|
|
54
|
-
preferredModelTool: 'agent_operator_briefing',
|
|
55
|
-
confirmation: 'Read-only; use the owning first-class tool.',
|
|
56
|
-
boundary: 'Public operator read route only; approval mutations must use explicit allowlisted actions.',
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
id: 'automation.integration.snapshot',
|
|
60
|
-
label: 'Read automation posture.',
|
|
61
|
-
route: '/api/automation',
|
|
62
|
-
effect: 'read-only-network',
|
|
63
|
-
owner: 'connected-host',
|
|
64
|
-
preferredModelTool: 'agent_operator_briefing',
|
|
65
|
-
confirmation: 'Read-only; use the owning first-class tool.',
|
|
66
|
-
boundary: 'Public operator read route only; automation definition creation and lifecycle ownership stay blocked.',
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
id: 'schedules.list',
|
|
70
|
-
label: 'List connected schedules.',
|
|
71
|
-
route: '/api/automation/schedules',
|
|
72
|
-
effect: 'read-only-network',
|
|
73
|
-
owner: 'connected-host',
|
|
74
|
-
preferredModelTool: 'agent_operator_briefing',
|
|
75
|
-
confirmation: 'Read-only; use the owning first-class tool.',
|
|
76
|
-
boundary: 'Public operator read route only; schedule creation/run requires explicit user intent through allowed tools.',
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
id: 'scheduler.capacity',
|
|
80
|
-
label: 'Read scheduler capacity.',
|
|
81
|
-
route: '/api/runtime/scheduler',
|
|
82
|
-
effect: 'read-only-network',
|
|
83
|
-
owner: 'connected-host',
|
|
84
|
-
preferredModelTool: 'agent_operator_briefing',
|
|
85
|
-
confirmation: 'Read-only; use the owning first-class tool.',
|
|
86
|
-
boundary: 'Public operator read route only; no local scheduler or host lifecycle mutation.',
|
|
87
|
-
},
|
|
88
|
-
];
|
|
89
|
-
|
|
90
|
-
const AGENT_KNOWLEDGE_READ_KEYS = new Set([
|
|
91
|
-
'status',
|
|
92
|
-
'ask',
|
|
93
|
-
'search',
|
|
94
|
-
'sourcesList',
|
|
95
|
-
'nodesList',
|
|
96
|
-
'issuesList',
|
|
97
|
-
'itemGet',
|
|
98
|
-
'map',
|
|
99
|
-
'connectorsList',
|
|
100
|
-
'connectorGet',
|
|
101
|
-
'connectorDoctor',
|
|
102
|
-
]);
|
|
54
|
+
const READ_ONLY_HTTP_METHODS = new Set(['GET', 'HEAD', 'OPTIONS']);
|
|
103
55
|
|
|
104
56
|
function readString(value: unknown): string {
|
|
105
57
|
return typeof value === 'string' ? value.trim() : '';
|
|
@@ -111,69 +63,85 @@ function readLimit(value: unknown, fallback: number): number {
|
|
|
111
63
|
return Math.max(1, Math.min(500, Math.trunc(parsed)));
|
|
112
64
|
}
|
|
113
65
|
|
|
114
|
-
function
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
owner: 'connected-host',
|
|
123
|
-
preferredModelTool: readOnly ? 'agent_knowledge' : key === 'reindex' ? 'agent_harness mode:"run_command"' : 'agent_knowledge_ingest',
|
|
124
|
-
confirmation: readOnly ? 'Read-only; use the owning first-class tool.' : 'Requires explicit user request and confirmation through the owning tool or command route.',
|
|
125
|
-
boundary: 'Isolated Agent Knowledge route family only; default knowledge and non-Agent knowledge segments are forbidden.',
|
|
126
|
-
...(readOnly ? {} : {
|
|
127
|
-
parameters: [
|
|
128
|
-
{ name: 'confirm', required: true },
|
|
129
|
-
{ name: 'explicitUserRequest', required: true },
|
|
130
|
-
],
|
|
131
|
-
}),
|
|
132
|
-
} satisfies OperatorMethodDescriptor;
|
|
133
|
-
});
|
|
66
|
+
function operatorContractMethods(): readonly OperatorContractMethod[] {
|
|
67
|
+
const contract = getOperatorContract();
|
|
68
|
+
const methods = Array.isArray(contract.operator?.methods)
|
|
69
|
+
? contract.operator.methods as OperatorContractMethod[]
|
|
70
|
+
: [];
|
|
71
|
+
return methods
|
|
72
|
+
.filter((method) => method.id && method.http?.method && method.http.path)
|
|
73
|
+
.sort((a, b) => a.id.localeCompare(b.id));
|
|
134
74
|
}
|
|
135
75
|
|
|
136
|
-
function
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
76
|
+
function methodIsReadOnly(method: OperatorContractMethod): boolean {
|
|
77
|
+
const httpMethod = method.http?.method?.toUpperCase();
|
|
78
|
+
if (httpMethod && READ_ONLY_HTTP_METHODS.has(httpMethod)) return true;
|
|
79
|
+
const scopes = method.scopes ?? [];
|
|
80
|
+
return scopes.length > 0 && scopes.every((scope) => scope.startsWith('read:'));
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function methodEffect(method: OperatorContractMethod): OperatorMethodEffect {
|
|
84
|
+
if (methodIsReadOnly(method)) return 'read-only-network';
|
|
85
|
+
return method.access === 'admin'
|
|
86
|
+
? 'confirmed-admin-connected-host-state'
|
|
87
|
+
: 'confirmed-connected-host-state';
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function confirmationFor(effect: OperatorMethodEffect): string {
|
|
91
|
+
if (effect === 'read-only-network') return 'Read-only; confirmation is not required.';
|
|
92
|
+
if (effect === 'confirmed-admin-connected-host-state') {
|
|
93
|
+
return 'Admin route. Requires confirm:true and explicitUserRequest naming the requested change.';
|
|
94
|
+
}
|
|
95
|
+
return 'Mutation route. Requires confirm:true and explicitUserRequest naming the requested change.';
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function preferredToolFor(effect: OperatorMethodEffect): string {
|
|
99
|
+
if (effect === 'read-only-network') return 'agent_operator_method';
|
|
100
|
+
return 'agent_operator_method with confirm:true and explicitUserRequest';
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function parametersFromInputSchema(method: OperatorContractMethod): readonly Record<string, unknown>[] {
|
|
104
|
+
const schema = method.inputSchema;
|
|
105
|
+
const properties = schema?.properties;
|
|
106
|
+
if (!properties || typeof properties !== 'object' || Array.isArray(properties)) return [];
|
|
107
|
+
const required = Array.isArray(schema.required)
|
|
108
|
+
? new Set(schema.required.filter((entry): entry is string => typeof entry === 'string'))
|
|
109
|
+
: new Set<string>();
|
|
110
|
+
return Object.entries(properties as Record<string, Record<string, unknown>>)
|
|
111
|
+
.slice(0, 48)
|
|
112
|
+
.map(([name, property]) => ({
|
|
113
|
+
name,
|
|
114
|
+
required: required.has(name),
|
|
115
|
+
type: typeof property?.type === 'string' ? property.type : undefined,
|
|
116
|
+
enum: Array.isArray(property?.enum) ? property.enum : undefined,
|
|
117
|
+
}));
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function toDescriptor(method: OperatorContractMethod): OperatorMethodDescriptor {
|
|
121
|
+
const httpMethod = method.http?.method?.toUpperCase() ?? 'GET';
|
|
122
|
+
const path = method.http?.path ?? '/';
|
|
123
|
+
const effect = methodEffect(method);
|
|
124
|
+
const label = method.title ?? method.description ?? method.id;
|
|
125
|
+
return {
|
|
126
|
+
id: method.id,
|
|
127
|
+
label,
|
|
128
|
+
route: `${httpMethod} ${path}`,
|
|
129
|
+
effect,
|
|
130
|
+
owner: 'goodvibes-daemon',
|
|
131
|
+
preferredModelTool: preferredToolFor(effect),
|
|
132
|
+
confirmation: confirmationFor(effect),
|
|
133
|
+
boundary: effect === 'read-only-network'
|
|
134
|
+
? 'Reads the connected GoodVibes daemon operator route and returns a redacted response.'
|
|
135
|
+
: 'Runs a confirmed connected GoodVibes daemon operator route. The model must keep the action visible, reversible when possible, and tied to the user request.',
|
|
136
|
+
category: method.category ?? 'uncategorized',
|
|
137
|
+
access: method.access ?? 'authenticated',
|
|
138
|
+
scopes: method.scopes ?? [],
|
|
139
|
+
parameters: parametersFromInputSchema(method),
|
|
140
|
+
};
|
|
152
141
|
}
|
|
153
142
|
|
|
154
143
|
function allOperatorMethods(): readonly OperatorMethodDescriptor[] {
|
|
155
|
-
return
|
|
156
|
-
...OPERATOR_BRIEFING_METHODS,
|
|
157
|
-
...operatorActionMethods(),
|
|
158
|
-
...agentKnowledgeMethods(),
|
|
159
|
-
{
|
|
160
|
-
id: 'schedules.create',
|
|
161
|
-
label: 'Create one connected reminder or routine schedule.',
|
|
162
|
-
route: '/api/automation/schedules',
|
|
163
|
-
effect: 'confirmed-connected-host-state',
|
|
164
|
-
owner: 'connected-host',
|
|
165
|
-
preferredModelTool: 'agent_reminder_schedule or agent_harness mode:"run_workspace_action"',
|
|
166
|
-
confirmation: 'Requires explicit user request and confirmation.',
|
|
167
|
-
boundary: 'Connected schedule creation only; no hidden local scheduler or separate Agent job.',
|
|
168
|
-
parameters: [
|
|
169
|
-
{ name: 'scheduleKind', required: true },
|
|
170
|
-
{ name: 'scheduleValue', required: true },
|
|
171
|
-
{ name: 'message', required: true },
|
|
172
|
-
{ name: 'confirm', required: true },
|
|
173
|
-
{ name: 'explicitUserRequest', required: true },
|
|
174
|
-
],
|
|
175
|
-
} satisfies OperatorMethodDescriptor,
|
|
176
|
-
].sort((a, b) => a.id.localeCompare(b.id));
|
|
144
|
+
return operatorContractMethods().map(toDescriptor);
|
|
177
145
|
}
|
|
178
146
|
|
|
179
147
|
function methodSearchText(method: OperatorMethodDescriptor): string {
|
|
@@ -184,6 +152,9 @@ function methodSearchText(method: OperatorMethodDescriptor): string {
|
|
|
184
152
|
method.effect,
|
|
185
153
|
method.preferredModelTool,
|
|
186
154
|
method.boundary,
|
|
155
|
+
method.category,
|
|
156
|
+
method.access,
|
|
157
|
+
method.scopes.join(' '),
|
|
187
158
|
].join('\n').toLowerCase();
|
|
188
159
|
}
|
|
189
160
|
|
|
@@ -194,14 +165,17 @@ function describeMethod(
|
|
|
194
165
|
return {
|
|
195
166
|
id: method.id,
|
|
196
167
|
label: method.label,
|
|
168
|
+
category: method.category,
|
|
169
|
+
access: method.access,
|
|
197
170
|
effect: method.effect,
|
|
198
171
|
owner: method.owner,
|
|
172
|
+
route: method.route,
|
|
199
173
|
modelRoute: previewHarnessText(method.preferredModelTool),
|
|
174
|
+
scopes: method.scopes,
|
|
175
|
+
confirmation: method.confirmation,
|
|
200
176
|
...(options.lookup ? { lookup: options.lookup } : {}),
|
|
201
177
|
...(options.includeParameters ? {
|
|
202
|
-
route: method.route,
|
|
203
178
|
preferredModelTool: method.preferredModelTool,
|
|
204
|
-
confirmation: method.confirmation,
|
|
205
179
|
boundary: method.boundary,
|
|
206
180
|
parameters: method.parameters ?? [],
|
|
207
181
|
} : {
|
|
@@ -213,7 +187,9 @@ function describeMethod(
|
|
|
213
187
|
function describeCandidate(method: OperatorMethodDescriptor): Record<string, unknown> {
|
|
214
188
|
return {
|
|
215
189
|
methodId: method.id,
|
|
190
|
+
category: method.category,
|
|
216
191
|
effect: method.effect,
|
|
192
|
+
route: method.route,
|
|
217
193
|
modelRoute: previewHarnessText(method.preferredModelTool),
|
|
218
194
|
};
|
|
219
195
|
}
|
|
@@ -229,12 +205,18 @@ function lookupFromArgs(args: AgentHarnessOperatorMethodArgs): { readonly source
|
|
|
229
205
|
|
|
230
206
|
export function operatorMethodCatalogStatus(): Record<string, unknown> {
|
|
231
207
|
const methods = allOperatorMethods();
|
|
208
|
+
const categories = methods.reduce<Record<string, number>>((acc, method) => {
|
|
209
|
+
acc[method.category] = (acc[method.category] ?? 0) + 1;
|
|
210
|
+
return acc;
|
|
211
|
+
}, {});
|
|
232
212
|
return {
|
|
233
213
|
modes: ['operator_methods', 'operator_method'],
|
|
234
214
|
methods: methods.length,
|
|
235
215
|
readOnlyMethods: methods.filter((method) => method.effect === 'read-only-network').length,
|
|
236
216
|
confirmedMethods: methods.filter((method) => method.effect !== 'read-only-network').length,
|
|
237
|
-
|
|
217
|
+
adminMethods: methods.filter((method) => method.effect === 'confirmed-admin-connected-host-state').length,
|
|
218
|
+
categories,
|
|
219
|
+
policy: 'Full GoodVibes SDK operator contract. Read-only routes can run through agent_operator_method; write/admin routes require confirm:true and explicitUserRequest.',
|
|
238
220
|
};
|
|
239
221
|
}
|
|
240
222
|
|
|
@@ -250,7 +232,7 @@ export function operatorMethodSummary(args: AgentHarnessOperatorMethodArgs): Rec
|
|
|
250
232
|
methods,
|
|
251
233
|
returned: methods.length,
|
|
252
234
|
total: allOperatorMethods().length,
|
|
253
|
-
policy: '
|
|
235
|
+
policy: 'Dynamic GoodVibes daemon operator catalog. Prefer simpler first-class tools when available; use agent_operator_method for exact contract parity.',
|
|
254
236
|
};
|
|
255
237
|
}
|
|
256
238
|
|
|
@@ -285,6 +267,6 @@ export function describeHarnessOperatorMethod(args: AgentHarnessOperatorMethodAr
|
|
|
285
267
|
}
|
|
286
268
|
return {
|
|
287
269
|
status: 'missing_lookup',
|
|
288
|
-
usage: `Unknown operator method ${lookup.input}. Use
|
|
270
|
+
usage: `Unknown operator method ${lookup.input}. Use host action:"methods" to inspect available methods.`,
|
|
289
271
|
};
|
|
290
272
|
}
|