@pellux/goodvibes-agent 1.1.7 → 1.3.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 +329 -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 +138903 -91477
- 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 +58 -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 +116 -45
- package/docs/voice-and-live-tts.md +3 -1
- package/package.json +3 -2
- package/release/release-notes.md +142 -5
- package/release/release-readiness.json +124 -94
- 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 +294 -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-artifact-receipts.ts +366 -0
- package/src/agent/setup-wizard-checkpoint.ts +140 -0
- package/src/agent/setup-wizard.ts +683 -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 +313 -30
- package/src/input/agent-workspace-setup-checkpoint-action.ts +127 -0
- package/src/input/agent-workspace-setup-snapshot.ts +217 -0
- package/src/input/agent-workspace-setup.ts +61 -1
- package/src/input/agent-workspace-snapshot.ts +184 -149
- package/src/input/agent-workspace-types.ts +287 -2
- package/src/input/agent-workspace.ts +23 -1
- 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/input/setup-wizard-live-receipts.ts +76 -0
- package/src/main.ts +15 -15
- package/src/panels/qr-panel.ts +2 -2
- package/src/renderer/agent-workspace-context-lines.ts +701 -0
- package/src/renderer/agent-workspace.ts +68 -421
- 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-policy.ts +75 -0
- package/src/tools/agent-harness-agent-orchestration.ts +791 -0
- package/src/tools/agent-harness-autonomy-intake.ts +785 -0
- package/src/tools/agent-harness-autonomy-live-records.ts +742 -0
- package/src/tools/agent-harness-autonomy-queue-types.ts +88 -0
- package/src/tools/agent-harness-autonomy-queue.ts +571 -0
- package/src/tools/agent-harness-autonomy-watcher-read-models.ts +509 -0
- package/src/tools/agent-harness-background-processes-types.ts +35 -0
- package/src/tools/agent-harness-background-processes.ts +798 -0
- package/src/tools/agent-harness-browser-cockpit-route.ts +373 -0
- package/src/tools/agent-harness-browser-control.ts +346 -0
- package/src/tools/agent-harness-browser-pwa-read-models.ts +622 -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-device-live-read-models.ts +366 -0
- 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 +385 -0
- package/src/tools/agent-harness-file-recovery.ts +135 -0
- package/src/tools/agent-harness-interactive-runtime-records.ts +421 -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 +269 -0
- package/src/tools/agent-harness-local-model-cookbook.ts +238 -0
- package/src/tools/agent-harness-local-model-endpoints.ts +788 -0
- package/src/tools/agent-harness-local-model-smoke.ts +277 -0
- package/src/tools/agent-harness-local-model-url.ts +78 -0
- package/src/tools/agent-harness-media-posture.ts +223 -2
- package/src/tools/agent-harness-memory-external-providers.ts +796 -0
- package/src/tools/agent-harness-memory-posture.ts +672 -0
- package/src/tools/agent-harness-memory-provider-certification.ts +219 -0
- package/src/tools/agent-harness-memory-refinement.ts +340 -0
- package/src/tools/agent-harness-metadata.ts +100 -168
- package/src/tools/agent-harness-mode-catalog.ts +86 -33
- package/src/tools/agent-harness-model-catalog.ts +162 -0
- package/src/tools/agent-harness-model-provider-health.ts +283 -0
- package/src/tools/agent-harness-model-readiness.ts +432 -0
- package/src/tools/agent-harness-model-routing-types.ts +327 -0
- package/src/tools/agent-harness-model-routing-utils.ts +30 -0
- package/src/tools/agent-harness-model-routing.ts +165 -193
- package/src/tools/agent-harness-operator-methods.ts +115 -133
- package/src/tools/agent-harness-pairing-posture.ts +452 -18
- package/src/tools/agent-harness-personal-ops-certification.ts +116 -0
- 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 +270 -0
- package/src/tools/agent-harness-personal-ops-operations.ts +225 -0
- package/src/tools/agent-harness-personal-ops-provider-records.ts +358 -0
- package/src/tools/agent-harness-personal-ops-provider-task-records.ts +321 -0
- package/src/tools/agent-harness-personal-ops-records.ts +684 -0
- package/src/tools/agent-harness-personal-ops-runner.ts +637 -0
- package/src/tools/agent-harness-personal-ops-types.ts +240 -0
- package/src/tools/agent-harness-personal-ops.ts +613 -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-remote-read-models.ts +541 -0
- package/src/tools/agent-harness-research-briefing.ts +446 -0
- package/src/tools/agent-harness-research-live-read-models.ts +500 -0
- package/src/tools/agent-harness-research-queue.ts +250 -0
- package/src/tools/agent-harness-research-runs.ts +307 -0
- package/src/tools/agent-harness-research-workflow.ts +395 -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 +102 -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 +533 -0
- package/src/tools/agent-harness-sudo-posture.ts +114 -0
- package/src/tools/agent-harness-tool-schema.ts +142 -7
- package/src/tools/agent-harness-tool-types.ts +83 -0
- package/src/tools/agent-harness-tool-utils.ts +43 -0
- package/src/tools/agent-harness-tool.ts +319 -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 +253 -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 +735 -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-runner.ts +367 -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 +515 -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,346 @@
|
|
|
1
|
+
import type { ToolRegistry } from '@pellux/goodvibes-sdk/platform/tools';
|
|
2
|
+
import type { CommandContext } from '../input/command-registry.ts';
|
|
3
|
+
import { interactiveRuntimeCapabilitySummary, interactiveRuntimeParityStatus } from './agent-harness-interactive-runtime-records.ts';
|
|
4
|
+
import type { AgentHarnessInteractiveRuntimeRecord } from './agent-harness-interactive-runtime-records.ts';
|
|
5
|
+
|
|
6
|
+
type BrowserControlStatus = 'ready' | 'attention' | 'setup-needed';
|
|
7
|
+
type BrowserControlDecisionStatus = 'ready-to-inspect-tool' | 'review-connector-first' | 'setup-needed';
|
|
8
|
+
|
|
9
|
+
export interface BrowserControlRouteArgs {
|
|
10
|
+
readonly target?: unknown;
|
|
11
|
+
readonly query?: unknown;
|
|
12
|
+
readonly includeParameters?: unknown;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
interface BrowserControlMcpServer {
|
|
16
|
+
readonly name: string;
|
|
17
|
+
readonly connected: boolean;
|
|
18
|
+
readonly role: string;
|
|
19
|
+
readonly trustMode: string;
|
|
20
|
+
readonly schemaFreshness: string;
|
|
21
|
+
readonly readiness: 'ready' | 'attention';
|
|
22
|
+
readonly modelRoute: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface BrowserControlWorkflow {
|
|
26
|
+
readonly id: string;
|
|
27
|
+
readonly label: string;
|
|
28
|
+
readonly status: BrowserControlStatus;
|
|
29
|
+
readonly summary: string;
|
|
30
|
+
readonly next: string;
|
|
31
|
+
readonly inspectRoute: string;
|
|
32
|
+
readonly setupRoute: string;
|
|
33
|
+
readonly safety: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
interface BrowserControlDecision {
|
|
37
|
+
readonly id: string;
|
|
38
|
+
readonly status: BrowserControlDecisionStatus;
|
|
39
|
+
readonly modelRoute: string;
|
|
40
|
+
readonly userRoute: string;
|
|
41
|
+
readonly nextStep: string;
|
|
42
|
+
readonly reason: string;
|
|
43
|
+
readonly safety: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface BrowserControlPosture {
|
|
47
|
+
readonly status: BrowserControlStatus;
|
|
48
|
+
readonly configured: boolean;
|
|
49
|
+
readonly needsReview: boolean;
|
|
50
|
+
readonly toolMatches: readonly string[];
|
|
51
|
+
readonly mcpServers: readonly BrowserControlMcpServer[];
|
|
52
|
+
readonly certifiedRuntimeRecords: readonly AgentHarnessInteractiveRuntimeRecord[];
|
|
53
|
+
readonly runtime: Record<string, unknown>;
|
|
54
|
+
readonly workflows: readonly BrowserControlWorkflow[];
|
|
55
|
+
readonly setupChecklist: readonly string[];
|
|
56
|
+
readonly fallbackRoutes: readonly string[];
|
|
57
|
+
readonly executionRoute: string;
|
|
58
|
+
readonly setupRoute: string;
|
|
59
|
+
readonly recommendedRoute: string;
|
|
60
|
+
readonly policy: string;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
type McpServerRecord = ReturnType<NonNullable<NonNullable<CommandContext['clients']>['mcpApi']>['listServerSecurity']>[number];
|
|
64
|
+
|
|
65
|
+
const BROWSER_CONTROL_TERMS = ['browser', 'desktop', 'computer use', 'screenshot', 'screen recording'];
|
|
66
|
+
const POSTURE_ONLY_TOOL_NAMES = new Set(['agent_harness', 'computer', 'device', 'execution', 'route', 'workspace']);
|
|
67
|
+
|
|
68
|
+
function readString(value: unknown): string {
|
|
69
|
+
return typeof value === 'string' ? value.trim() : '';
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function quoteRouteValue(value: string): string {
|
|
73
|
+
return value.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function includesBrowserControlTerm(value: string): boolean {
|
|
77
|
+
const normalized = value.toLowerCase();
|
|
78
|
+
return BROWSER_CONTROL_TERMS.some((term) => normalized.includes(term));
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function safeToolDefinitions(toolRegistry: ToolRegistry | undefined): readonly ReturnType<ToolRegistry['getToolDefinitions']>[number][] {
|
|
82
|
+
if (!toolRegistry) return [];
|
|
83
|
+
try {
|
|
84
|
+
return toolRegistry.getToolDefinitions();
|
|
85
|
+
} catch {
|
|
86
|
+
return [];
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function safeMcpServers(context: CommandContext): readonly McpServerRecord[] {
|
|
91
|
+
try {
|
|
92
|
+
const api = context.clients?.mcpApi ?? context.extensions?.mcpRegistry;
|
|
93
|
+
return api?.listServerSecurity?.() ?? [];
|
|
94
|
+
} catch {
|
|
95
|
+
return [];
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function describeMcpServer(server: McpServerRecord): BrowserControlMcpServer {
|
|
100
|
+
const ready = server.connected && server.schemaFreshness === 'fresh' && server.trustMode !== 'blocked';
|
|
101
|
+
return {
|
|
102
|
+
name: server.name,
|
|
103
|
+
connected: server.connected,
|
|
104
|
+
role: server.role,
|
|
105
|
+
trustMode: server.trustMode,
|
|
106
|
+
schemaFreshness: server.schemaFreshness,
|
|
107
|
+
readiness: ready ? 'ready' : 'attention',
|
|
108
|
+
modelRoute: `agent_harness mode:"mcp_server" mcpServerId:"${server.name}"`,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function workflowStatus(configured: boolean, needsReview: boolean): BrowserControlStatus {
|
|
113
|
+
if (configured) return 'ready';
|
|
114
|
+
return needsReview ? 'attention' : 'setup-needed';
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function browserControlWorkflows(
|
|
118
|
+
configured: boolean,
|
|
119
|
+
needsReview: boolean,
|
|
120
|
+
recommendedRoute: string,
|
|
121
|
+
setupRoute: string,
|
|
122
|
+
): readonly BrowserControlWorkflow[] {
|
|
123
|
+
const status = workflowStatus(configured, needsReview);
|
|
124
|
+
const inspectRoute = configured ? recommendedRoute : setupRoute;
|
|
125
|
+
const next = configured
|
|
126
|
+
? 'Inspect the configured tool/server, then run the narrowest browser or desktop action needed for the user request.'
|
|
127
|
+
: needsReview
|
|
128
|
+
? 'Review trust/schema freshness before treating this browser or desktop connector as usable.'
|
|
129
|
+
: 'Configure a trusted browser/desktop MCP server or first-class tool before attempting live UI control.';
|
|
130
|
+
return [
|
|
131
|
+
{
|
|
132
|
+
id: 'browser-navigation',
|
|
133
|
+
label: 'Browser navigation',
|
|
134
|
+
status,
|
|
135
|
+
summary: 'Drive a real browser only when a trusted browser tool or MCP server is configured.',
|
|
136
|
+
next,
|
|
137
|
+
inspectRoute,
|
|
138
|
+
setupRoute,
|
|
139
|
+
safety: 'Use read-only web/fetch routes for research unless the user explicitly needs live browser state or authentication.',
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
id: 'screenshot-observation',
|
|
143
|
+
label: 'Screenshot or screen observation',
|
|
144
|
+
status,
|
|
145
|
+
summary: 'Capture or inspect the screen through configured screenshot/screen-recording tooling.',
|
|
146
|
+
next,
|
|
147
|
+
inspectRoute,
|
|
148
|
+
setupRoute,
|
|
149
|
+
safety: 'Screenshots can expose secrets or private data; inspect setup and ask before capturing sensitive surfaces.',
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
id: 'desktop-control',
|
|
153
|
+
label: 'Desktop control',
|
|
154
|
+
status,
|
|
155
|
+
summary: 'Use desktop/computer-control only after trust, host, and confirmation boundaries are clear.',
|
|
156
|
+
next,
|
|
157
|
+
inspectRoute,
|
|
158
|
+
setupRoute,
|
|
159
|
+
safety: 'Desktop actions are external effects; destructive or account-changing actions require explicit user confirmation.',
|
|
160
|
+
},
|
|
161
|
+
];
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export function browserControlPosture(context: CommandContext, toolRegistry?: ToolRegistry): BrowserControlPosture {
|
|
165
|
+
const registry = toolRegistry ?? context.extensions?.toolRegistry;
|
|
166
|
+
const toolMatches = safeToolDefinitions(registry)
|
|
167
|
+
.filter((tool) => !POSTURE_ONLY_TOOL_NAMES.has(tool.name))
|
|
168
|
+
.filter((tool) => includesBrowserControlTerm(`${tool.name}\n${tool.description}`))
|
|
169
|
+
.map((tool) => tool.name)
|
|
170
|
+
.sort((left, right) => left.localeCompare(right));
|
|
171
|
+
|
|
172
|
+
const mcpServers = safeMcpServers(context)
|
|
173
|
+
.filter((server) => includesBrowserControlTerm(`${server.name}\n${server.role}`))
|
|
174
|
+
.map(describeMcpServer)
|
|
175
|
+
.sort((left, right) => left.name.localeCompare(right.name));
|
|
176
|
+
|
|
177
|
+
const readyBrowserMcp = mcpServers.some((server) => server.readiness === 'ready');
|
|
178
|
+
const needsReview = mcpServers.some((server) => server.readiness === 'attention');
|
|
179
|
+
const runtime = interactiveRuntimeCapabilitySummary(context);
|
|
180
|
+
const runtimeParity = interactiveRuntimeParityStatus(context);
|
|
181
|
+
const configured = runtimeParity.browserDesktopControlContract || toolMatches.length > 0 || readyBrowserMcp;
|
|
182
|
+
const recommendedRoute = configured
|
|
183
|
+
? runtimeParity.browserDesktopRoute ?? 'execution action:"route" id:"browser-or-desktop-control"'
|
|
184
|
+
: needsReview
|
|
185
|
+
? 'agent_harness mode:"mcp_servers" query:"browser desktop"'
|
|
186
|
+
: 'agent_harness mode:"mcp_servers" query:"browser desktop"';
|
|
187
|
+
const setupRoute = 'setup action:"item" setupItemId:"browser-desktop-control"';
|
|
188
|
+
return {
|
|
189
|
+
status: configured ? 'ready' : needsReview ? 'attention' : 'setup-needed',
|
|
190
|
+
configured,
|
|
191
|
+
needsReview,
|
|
192
|
+
toolMatches,
|
|
193
|
+
mcpServers,
|
|
194
|
+
certifiedRuntimeRecords: runtimeParity.browserDesktopRecords.slice(0, 5),
|
|
195
|
+
runtime,
|
|
196
|
+
workflows: browserControlWorkflows(configured, needsReview, recommendedRoute, setupRoute),
|
|
197
|
+
setupChecklist: [
|
|
198
|
+
'Inspect browser/desktop MCP servers and first-class tools before attempting live UI control.',
|
|
199
|
+
'Prefer constrained trust, fresh schemas, and explicit allowed hosts/paths.',
|
|
200
|
+
'Use web_search or fetch instead when the task only needs public web information.',
|
|
201
|
+
'Ask for confirmation before screenshots, authenticated browsing, account changes, purchases, sends, or destructive desktop actions.',
|
|
202
|
+
],
|
|
203
|
+
fallbackRoutes: [
|
|
204
|
+
'execution action:"route" id:"web-fetch-research"',
|
|
205
|
+
'agent_harness mode:"mcp_servers" query:"browser desktop"',
|
|
206
|
+
],
|
|
207
|
+
executionRoute: 'execution action:"route" id:"browser-or-desktop-control"',
|
|
208
|
+
setupRoute,
|
|
209
|
+
recommendedRoute,
|
|
210
|
+
policy: 'Browser and desktop control stays explicit: no live UI control is assumed unless a trusted tool, fresh constrained MCP server, or certified daemon browser/desktop command receipt is configured.',
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
function workflowSearchText(workflow: BrowserControlWorkflow): string {
|
|
215
|
+
return [
|
|
216
|
+
workflow.id,
|
|
217
|
+
workflow.label,
|
|
218
|
+
workflow.summary,
|
|
219
|
+
workflow.next,
|
|
220
|
+
workflow.safety,
|
|
221
|
+
].join('\n').toLowerCase();
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
function selectBrowserControlWorkflow(posture: BrowserControlPosture, input: string): BrowserControlWorkflow {
|
|
225
|
+
const normalized = input.toLowerCase();
|
|
226
|
+
if (!normalized) return posture.workflows[0]!;
|
|
227
|
+
const tokens = normalized.split(/[^a-z0-9]+/).filter(Boolean);
|
|
228
|
+
const scored = posture.workflows
|
|
229
|
+
.map((workflow, index) => {
|
|
230
|
+
let score = 0;
|
|
231
|
+
const text = workflowSearchText(workflow);
|
|
232
|
+
if (workflow.id.includes(normalized) || workflow.label.toLowerCase().includes(normalized)) score += 1_000;
|
|
233
|
+
for (const token of tokens) {
|
|
234
|
+
if (workflow.id.includes(token)) score += 250;
|
|
235
|
+
if (workflow.label.toLowerCase().includes(token)) score += 200;
|
|
236
|
+
if (text.includes(token)) score += 40;
|
|
237
|
+
}
|
|
238
|
+
if (workflow.id === 'browser-navigation' && /browse|browser|navigate|url|page|click|form|login|web/.test(normalized)) score += 450;
|
|
239
|
+
if (workflow.id === 'screenshot-observation' && /screenshot|screen|observe|record|capture|visual|see/.test(normalized)) score += 450;
|
|
240
|
+
if (workflow.id === 'desktop-control' && /desktop|computer|app|window|keyboard|mouse|type|os/.test(normalized)) score += 450;
|
|
241
|
+
return { workflow, score, index };
|
|
242
|
+
})
|
|
243
|
+
.sort((left, right) => right.score - left.score || left.index - right.index);
|
|
244
|
+
return scored[0]?.workflow ?? posture.workflows[0]!;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
function toolCandidateRoutes(toolMatches: readonly string[]): readonly Record<string, unknown>[] {
|
|
248
|
+
return toolMatches.slice(0, 8).map((toolName) => ({
|
|
249
|
+
toolName,
|
|
250
|
+
inspectRoute: `agent_harness mode:"tool" toolName:"${quoteRouteValue(toolName)}" includeParameters:true`,
|
|
251
|
+
modelRoute: `${toolName} ...`,
|
|
252
|
+
safety: 'Inspect the tool schema and policy before invoking a live browser, screenshot, or desktop-control action.',
|
|
253
|
+
}));
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
function mcpCandidateRoutes(mcpServers: readonly BrowserControlMcpServer[]): readonly Record<string, unknown>[] {
|
|
257
|
+
return mcpServers.slice(0, 8).map((server) => ({
|
|
258
|
+
serverName: server.name,
|
|
259
|
+
readiness: server.readiness,
|
|
260
|
+
connected: server.connected,
|
|
261
|
+
trustMode: server.trustMode,
|
|
262
|
+
schemaFreshness: server.schemaFreshness,
|
|
263
|
+
inspectRoute: server.modelRoute,
|
|
264
|
+
safety: 'Review trust and schema freshness before using MCP browser or desktop-control tools.',
|
|
265
|
+
}));
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
function browserControlDecision(
|
|
269
|
+
posture: BrowserControlPosture,
|
|
270
|
+
workflow: BrowserControlWorkflow,
|
|
271
|
+
toolRoutes: readonly Record<string, unknown>[],
|
|
272
|
+
mcpRoutes: readonly Record<string, unknown>[],
|
|
273
|
+
): BrowserControlDecision {
|
|
274
|
+
const firstToolRoute = readString(toolRoutes[0]?.inspectRoute);
|
|
275
|
+
const firstReadyMcpRoute = readString(mcpRoutes.find((route) => route.readiness === 'ready')?.inspectRoute);
|
|
276
|
+
const firstReviewMcpRoute = readString(mcpRoutes[0]?.inspectRoute);
|
|
277
|
+
if (posture.configured) {
|
|
278
|
+
return {
|
|
279
|
+
id: 'inspect-configured-browser-control',
|
|
280
|
+
status: 'ready-to-inspect-tool',
|
|
281
|
+
modelRoute: firstToolRoute || firstReadyMcpRoute || posture.recommendedRoute || posture.executionRoute,
|
|
282
|
+
userRoute: 'Agent Workspace -> Work & Approvals or Tools & MCP',
|
|
283
|
+
nextStep: `Inspect the configured ${workflow.label.toLowerCase()} tool/server, then invoke the narrowest live-control tool only if the user request still needs it.`,
|
|
284
|
+
reason: 'A browser/desktop control tool or fresh trusted MCP server is configured.',
|
|
285
|
+
safety: workflow.safety,
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
if (posture.needsReview) {
|
|
289
|
+
return {
|
|
290
|
+
id: 'review-browser-control-connector',
|
|
291
|
+
status: 'review-connector-first',
|
|
292
|
+
modelRoute: firstReviewMcpRoute || 'computer action:"mcp" query:"browser desktop" includeParameters:true',
|
|
293
|
+
userRoute: 'Agent Workspace -> Tools & MCP',
|
|
294
|
+
nextStep: 'Review connector trust, connectivity, and schema freshness before treating browser or desktop control as available.',
|
|
295
|
+
reason: 'A browser/desktop connector exists but needs trust, connectivity, or schema review.',
|
|
296
|
+
safety: 'Do not use stale or untrusted browser/desktop connectors for screenshots, authenticated pages, or desktop actions.',
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
return {
|
|
300
|
+
id: 'setup-browser-control',
|
|
301
|
+
status: 'setup-needed',
|
|
302
|
+
modelRoute: posture.setupRoute,
|
|
303
|
+
userRoute: 'Agent Workspace -> Setup',
|
|
304
|
+
nextStep: 'Configure a trusted browser/desktop tool or MCP server, or use the public web/fetch fallback when live UI state is not required.',
|
|
305
|
+
reason: 'No trusted browser/desktop control tool or fresh MCP server is configured.',
|
|
306
|
+
safety: 'This planner does not open, observe, or control the browser or desktop.',
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
export function browserControlRouteSummary(
|
|
311
|
+
context: CommandContext,
|
|
312
|
+
toolRegistry: ToolRegistry,
|
|
313
|
+
args: BrowserControlRouteArgs,
|
|
314
|
+
): Record<string, unknown> {
|
|
315
|
+
const input = readString(args.query) || readString(args.target);
|
|
316
|
+
const includeParameters = args.includeParameters === true;
|
|
317
|
+
const posture = browserControlPosture(context, toolRegistry);
|
|
318
|
+
const workflow = selectBrowserControlWorkflow(posture, input);
|
|
319
|
+
const toolRoutes = toolCandidateRoutes(posture.toolMatches);
|
|
320
|
+
const mcpRoutes = mcpCandidateRoutes(posture.mcpServers);
|
|
321
|
+
const decision = browserControlDecision(posture, workflow, toolRoutes, mcpRoutes);
|
|
322
|
+
return {
|
|
323
|
+
mode: 'browser_control_route',
|
|
324
|
+
request: input || null,
|
|
325
|
+
status: posture.status,
|
|
326
|
+
configured: posture.configured,
|
|
327
|
+
needsReview: posture.needsReview,
|
|
328
|
+
workflow,
|
|
329
|
+
decision,
|
|
330
|
+
toolCandidates: toolRoutes,
|
|
331
|
+
mcpCandidates: mcpRoutes,
|
|
332
|
+
fallbackRoutes: posture.fallbackRoutes,
|
|
333
|
+
routes: {
|
|
334
|
+
controlPosture: 'computer action:"control" includeParameters:true',
|
|
335
|
+
setup: posture.setupRoute,
|
|
336
|
+
mcpReview: 'computer action:"mcp" query:"browser desktop" includeParameters:true',
|
|
337
|
+
publicWebFallback: posture.fallbackRoutes[0] ?? 'execution action:"route" id:"web-fetch-research"',
|
|
338
|
+
},
|
|
339
|
+
...(includeParameters ? { posture } : {}),
|
|
340
|
+
policy: {
|
|
341
|
+
effect: 'read-only-route-plan',
|
|
342
|
+
boundary: 'This route selects the safest browser/desktop control workflow only. It never opens a browser, captures a screenshot, controls the desktop, or invokes a browser/MCP tool by itself.',
|
|
343
|
+
confirmation: 'Live browser, screenshot, authenticated browsing, account-changing, purchase, send, or destructive desktop actions require the selected tool-specific confirmation boundary and explicit user request.',
|
|
344
|
+
},
|
|
345
|
+
};
|
|
346
|
+
}
|