@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,373 @@
|
|
|
1
|
+
import type { CommandContext } from '../input/command-registry.ts';
|
|
2
|
+
import { resolveRuntimeEndpointBinding } from '../cli/endpoints.ts';
|
|
3
|
+
import { AGENT_WORKSPACE_CATEGORIES } from '../input/agent-workspace-categories.ts';
|
|
4
|
+
import type { AgentSetupWizardDurableReceipt } from '../agent/setup-wizard.ts';
|
|
5
|
+
import { buildSetupWizardDurableReceipts } from '../agent/setup-wizard-artifact-receipts.ts';
|
|
6
|
+
import { mergeSetupWizardDurableReceipts, setupWizardLiveDurableReceipts } from '../input/setup-wizard-live-receipts.ts';
|
|
7
|
+
import { readOnboardingCompletionMarker } from '../runtime/onboarding/index.ts';
|
|
8
|
+
import {
|
|
9
|
+
browserPwaReadModelSnapshot,
|
|
10
|
+
certifiedBrowserPwaCategoryRouteForCategory,
|
|
11
|
+
certifiedBrowserPwaFirstRunReceipts,
|
|
12
|
+
isCertifiedBrowserPwaCategoryRoute,
|
|
13
|
+
type BrowserPwaCategoryRouteRecord,
|
|
14
|
+
type BrowserPwaReadModelSnapshot,
|
|
15
|
+
} from './agent-harness-browser-pwa-read-models.ts';
|
|
16
|
+
|
|
17
|
+
function browserConnectHost(host: string): string {
|
|
18
|
+
if (host === '0.0.0.0' || host === '::') return '127.0.0.1';
|
|
19
|
+
if (host.includes(':') && !host.startsWith('[')) return `[${host}]`;
|
|
20
|
+
return host || '127.0.0.1';
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const BROWSER_COCKPIT_EXPECTED_LANES = [
|
|
24
|
+
{
|
|
25
|
+
id: 'chat-and-sessions',
|
|
26
|
+
label: 'Chat and sessions',
|
|
27
|
+
categoryIds: ['home', 'conversation'],
|
|
28
|
+
userOutcome: 'Continue normal assistant chat, session review, prompt history, bookmarks, and current work from the browser.',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: 'setup-and-settings',
|
|
32
|
+
label: 'Setup and settings',
|
|
33
|
+
categoryIds: ['setup', 'account-model', 'assistant-behavior', 'tools-permissions', 'onboarding-display', 'finish'],
|
|
34
|
+
userOutcome: 'Finish first-run setup, choose models, adjust behavior, review permissions, and close onboarding without returning to terminal-only controls.',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
id: 'mobile-and-channels',
|
|
38
|
+
label: 'Mobile and channels',
|
|
39
|
+
categoryIds: ['onboarding-channels', 'onboarding-voice-media', 'channels', 'voice-media', 'personal-ops'],
|
|
40
|
+
userOutcome: 'Configure mobile-friendly messaging, notification, voice, phone, and daily personal-operation routes from one cockpit.',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
id: 'knowledge-and-memory',
|
|
44
|
+
label: 'Knowledge and memory',
|
|
45
|
+
categoryIds: ['onboarding-context', 'knowledge', 'profiles', 'memory', 'notes', 'personas', 'skills', 'routines'],
|
|
46
|
+
userOutcome: 'Review and curate user context, project knowledge, memories, notes, personas, skills, and routines with browser-native forms.',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: 'work-and-automation',
|
|
50
|
+
label: 'Work and automation',
|
|
51
|
+
categoryIds: ['work', 'automation', 'onboarding-automation', 'delegate'],
|
|
52
|
+
userOutcome: 'Approve, supervise, recover, schedule, and delegate autonomous work with touch-friendly controls and receipts.',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
id: 'research-and-artifacts',
|
|
56
|
+
label: 'Research and artifacts',
|
|
57
|
+
categoryIds: ['research', 'documents', 'artifacts'],
|
|
58
|
+
userOutcome: 'Run research, draft documents, review packets, browse artifacts, and export/share deliverables from the browser.',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
id: 'host-and-safety',
|
|
62
|
+
label: 'Host and safety',
|
|
63
|
+
categoryIds: ['tools', 'host'],
|
|
64
|
+
userOutcome: 'Inspect tool trust, MCP posture, connected-host repair, service health, support bundles, and recovery routes.',
|
|
65
|
+
},
|
|
66
|
+
] as const;
|
|
67
|
+
|
|
68
|
+
function confirmedCategoryRoute(categoryId: string, label: string): string {
|
|
69
|
+
return `agent_harness mode:"open_ui_surface" surfaceId:"agent-workspace" categoryId:"${categoryId}" confirm:true explicitUserRequest:"Open the ${label} workspace."`;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function browserPwaSetupReceipts(context: CommandContext): readonly AgentSetupWizardDurableReceipt[] {
|
|
73
|
+
const artifactReceipts = (() => {
|
|
74
|
+
try {
|
|
75
|
+
const artifacts = context.platform?.artifactStore?.list?.(100) ?? [];
|
|
76
|
+
return buildSetupWizardDurableReceipts(artifacts);
|
|
77
|
+
} catch {
|
|
78
|
+
return [];
|
|
79
|
+
}
|
|
80
|
+
})();
|
|
81
|
+
return mergeSetupWizardDurableReceipts(artifactReceipts, setupWizardLiveDurableReceipts(context))
|
|
82
|
+
.filter((receipt) => receipt.stepId === 'browser-pwa');
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function readyBrowserPwaSetupReceipt(receipts: readonly AgentSetupWizardDurableReceipt[]): AgentSetupWizardDurableReceipt | null {
|
|
86
|
+
return receipts.find((receipt) => receipt.status === 'ready') ?? null;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function routeCertificationSummary(route: BrowserPwaCategoryRouteRecord): Record<string, unknown> {
|
|
90
|
+
return {
|
|
91
|
+
id: route.id,
|
|
92
|
+
categoryIds: route.categoryIds,
|
|
93
|
+
route: route.route,
|
|
94
|
+
mobileReady: route.mobileReady,
|
|
95
|
+
pwaReady: route.pwaReady,
|
|
96
|
+
modelRoute: route.modelRoute,
|
|
97
|
+
sourcePath: route.sourcePath,
|
|
98
|
+
certification: route.certification,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function browserCockpitWorkspaceCoverage(
|
|
103
|
+
enabled: boolean,
|
|
104
|
+
includeDetails: boolean,
|
|
105
|
+
browserPwa: BrowserPwaReadModelSnapshot,
|
|
106
|
+
): Record<string, unknown> {
|
|
107
|
+
const categories = AGENT_WORKSPACE_CATEGORIES.map((category) => ({
|
|
108
|
+
id: category.id,
|
|
109
|
+
label: category.label,
|
|
110
|
+
group: category.group,
|
|
111
|
+
actions: category.actions.length,
|
|
112
|
+
certifiedRoute: enabled ? certifiedBrowserPwaCategoryRouteForCategory(browserPwa, category.id) : null,
|
|
113
|
+
agentRoute: confirmedCategoryRoute(category.id, category.label),
|
|
114
|
+
}));
|
|
115
|
+
const categoryById = new Map(categories.map((category) => [category.id, category]));
|
|
116
|
+
const coveredCategoryCount = categories.filter((category) => category.certifiedRoute).length;
|
|
117
|
+
const nativeCategoryRoutesPublished = enabled && coveredCategoryCount === categories.length;
|
|
118
|
+
const status = !enabled
|
|
119
|
+
? 'web-setup-needed'
|
|
120
|
+
: nativeCategoryRoutesPublished
|
|
121
|
+
? 'browser-native-ready'
|
|
122
|
+
: coveredCategoryCount > 0
|
|
123
|
+
? 'partial-browser-native-category-contracts'
|
|
124
|
+
: 'needs-browser-native-category-contracts';
|
|
125
|
+
const certifiedRoutes = browserPwa.categoryRoutes.filter(isCertifiedBrowserPwaCategoryRoute);
|
|
126
|
+
const categoryRows = categories.map((category) => {
|
|
127
|
+
const route = category.certifiedRoute;
|
|
128
|
+
return {
|
|
129
|
+
id: category.id,
|
|
130
|
+
label: category.label,
|
|
131
|
+
group: category.group,
|
|
132
|
+
actions: category.actions,
|
|
133
|
+
browserStatus: !enabled ? 'blocked-by-web-setup' : route ? 'browser-native-ready' : 'terminal-first',
|
|
134
|
+
browserRoute: route?.route ?? null,
|
|
135
|
+
...(route ? {
|
|
136
|
+
browserRouteId: route.id,
|
|
137
|
+
browserRouteSource: route.sourcePath,
|
|
138
|
+
browserRouteReceiptId: route.certification.receiptId ?? null,
|
|
139
|
+
mobileReady: route.mobileReady,
|
|
140
|
+
pwaReady: route.pwaReady,
|
|
141
|
+
} : {
|
|
142
|
+
neededContract: 'connected-host browser-native Agent workspace category route',
|
|
143
|
+
}),
|
|
144
|
+
agentRoute: category.agentRoute,
|
|
145
|
+
};
|
|
146
|
+
});
|
|
147
|
+
return {
|
|
148
|
+
status,
|
|
149
|
+
summary: !enabled
|
|
150
|
+
? 'The connected-host web endpoint is disabled, so browser-native workspace categories cannot be reached yet.'
|
|
151
|
+
: nativeCategoryRoutesPublished
|
|
152
|
+
? 'The connected host has published certified browser-native routes for every Agent workspace category.'
|
|
153
|
+
: coveredCategoryCount > 0
|
|
154
|
+
? `${coveredCategoryCount}/${categories.length} Agent workspace categories have certified browser-native routes; terminal workspace fallback remains available for the rest.`
|
|
155
|
+
: 'The connected-host web URL is openable, but Agent has not received a published browser-native route contract for workspace categories yet.',
|
|
156
|
+
categoryCount: categories.length,
|
|
157
|
+
coveredCategoryCount,
|
|
158
|
+
certifiedCategoryRouteCount: certifiedRoutes.length,
|
|
159
|
+
nativeCategoryRoutesPublished,
|
|
160
|
+
terminalFallback: nativeCategoryRoutesPublished
|
|
161
|
+
? 'The TUI Agent Workspace remains available as an equivalent local fallback.'
|
|
162
|
+
: 'Every Agent workspace category remains reachable through the TUI Agent Workspace while browser-native category routes are being published.',
|
|
163
|
+
laneCount: BROWSER_COCKPIT_EXPECTED_LANES.length,
|
|
164
|
+
...(includeDetails ? {
|
|
165
|
+
lanes: BROWSER_COCKPIT_EXPECTED_LANES.map((lane) => ({
|
|
166
|
+
id: lane.id,
|
|
167
|
+
label: lane.label,
|
|
168
|
+
categoryIds: lane.categoryIds,
|
|
169
|
+
userOutcome: lane.userOutcome,
|
|
170
|
+
coveredCategoryCount: lane.categoryIds.filter((categoryId) => categoryById.get(categoryId)?.certifiedRoute).length,
|
|
171
|
+
browserStatus: !enabled
|
|
172
|
+
? 'blocked-by-web-setup'
|
|
173
|
+
: lane.categoryIds.every((categoryId) => categoryById.get(categoryId)?.certifiedRoute)
|
|
174
|
+
? 'browser-native-ready'
|
|
175
|
+
: lane.categoryIds.some((categoryId) => categoryById.get(categoryId)?.certifiedRoute)
|
|
176
|
+
? 'partial-browser-native-contract'
|
|
177
|
+
: 'needs-browser-native-contract',
|
|
178
|
+
browserRoutes: lane.categoryIds
|
|
179
|
+
.map((categoryId) => categoryById.get(categoryId)?.certifiedRoute)
|
|
180
|
+
.filter((route): route is BrowserPwaCategoryRouteRecord => Boolean(route))
|
|
181
|
+
.map(routeCertificationSummary),
|
|
182
|
+
agentRoutes: lane.categoryIds
|
|
183
|
+
.map((categoryId) => categoryById.get(categoryId))
|
|
184
|
+
.filter((category): category is NonNullable<typeof category> => Boolean(category))
|
|
185
|
+
.map((category) => category.agentRoute),
|
|
186
|
+
})),
|
|
187
|
+
categories: categoryRows,
|
|
188
|
+
publishedCategoryRoutes: certifiedRoutes.slice(0, 20).map(routeCertificationSummary),
|
|
189
|
+
sourceCounts: browserPwa.sourceCounts,
|
|
190
|
+
} : {}),
|
|
191
|
+
policy: nativeCategoryRoutesPublished
|
|
192
|
+
? 'Workspace coverage is counted ready only from certified SDK/daemon browser-native category route records with exact routes, mobile/touch evidence, publication, provenance, and freshness cursor metadata.'
|
|
193
|
+
: 'Workspace coverage is a route contract map, not a claim that the connected-host browser already renders these Agent category controls.',
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
function browserCockpitMobileAffordances(
|
|
198
|
+
enabled: boolean,
|
|
199
|
+
includeDetails: boolean,
|
|
200
|
+
browserPwa: BrowserPwaReadModelSnapshot,
|
|
201
|
+
nativeCategoryRoutesPublished: boolean,
|
|
202
|
+
): Record<string, unknown> {
|
|
203
|
+
const certifiedFirstRun = certifiedBrowserPwaFirstRunReceipts(browserPwa);
|
|
204
|
+
const controls = [
|
|
205
|
+
{
|
|
206
|
+
id: 'open-browser-cockpit',
|
|
207
|
+
label: 'Open browser cockpit',
|
|
208
|
+
status: enabled ? 'ready' : 'blocked-by-web-setup',
|
|
209
|
+
modelRoute: 'agent_harness mode:"open_ui_surface" surfaceId:"connected-browser-cockpit" confirm:true explicitUserRequest:"..."',
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
id: 'inspect-web-endpoint',
|
|
213
|
+
label: 'Inspect web endpoint',
|
|
214
|
+
status: 'ready',
|
|
215
|
+
modelRoute: 'host action:"service" endpointId:"web" includeParameters:true',
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
id: 'inspect-device-map',
|
|
219
|
+
label: 'Inspect device capability map',
|
|
220
|
+
status: 'ready',
|
|
221
|
+
modelRoute: 'agent_harness mode:"pairing_route" pairingRouteId:"browser-cockpit-pwa"',
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
id: 'review-web-settings',
|
|
225
|
+
label: 'Review web settings',
|
|
226
|
+
status: 'ready',
|
|
227
|
+
modelRoute: 'settings action:"list" query:"web" includeHidden:true',
|
|
228
|
+
},
|
|
229
|
+
];
|
|
230
|
+
const laneControls = BROWSER_COCKPIT_EXPECTED_LANES.map((lane) => ({
|
|
231
|
+
id: lane.id,
|
|
232
|
+
label: lane.label,
|
|
233
|
+
status: nativeCategoryRoutesPublished ? 'ready' : enabled ? 'needs-browser-native-category-contracts' : 'blocked-by-web-setup',
|
|
234
|
+
categoryIds: lane.categoryIds,
|
|
235
|
+
}));
|
|
236
|
+
return {
|
|
237
|
+
status: enabled ? nativeCategoryRoutesPublished ? 'browser-native-ready' : 'openable' : 'setup-needed',
|
|
238
|
+
controlCount: controls.length,
|
|
239
|
+
nativeControlCount: laneControls.length,
|
|
240
|
+
...(includeDetails ? { controls, nativeControls: laneControls } : {}),
|
|
241
|
+
pwaInstall: {
|
|
242
|
+
status: certifiedFirstRun.length > 0 ? 'certified-live-receipt' : enabled ? 'browser-owned' : 'blocked-by-web-setup',
|
|
243
|
+
note: certifiedFirstRun.length > 0
|
|
244
|
+
? 'The connected host published certified browser/PWA first-run evidence for the browser runtime.'
|
|
245
|
+
: 'Agent can open the configured URL; installing the PWA remains a browser/connected-host UI action until a certified first-run receipt is published.',
|
|
246
|
+
},
|
|
247
|
+
touchControls: {
|
|
248
|
+
status: nativeCategoryRoutesPublished ? 'ready' : 'needs-browser-native-category-contracts',
|
|
249
|
+
note: nativeCategoryRoutesPublished
|
|
250
|
+
? 'Certified browser-native route contracts cover chat, setup, approvals, memory, channels, automation, research, and safety lanes with mobile/touch evidence.'
|
|
251
|
+
: 'Agent has not received a connected-host contract proving mobile-native controls for chat, setup, approvals, memory, channels, or automation.',
|
|
252
|
+
},
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
function browserCockpitReceipts(
|
|
257
|
+
context: CommandContext,
|
|
258
|
+
enabled: boolean,
|
|
259
|
+
includeDetails: boolean,
|
|
260
|
+
browserPwa: BrowserPwaReadModelSnapshot,
|
|
261
|
+
): Record<string, unknown> {
|
|
262
|
+
const marker = (() => {
|
|
263
|
+
try {
|
|
264
|
+
const shellPaths = context.workspace?.shellPaths;
|
|
265
|
+
if (!shellPaths) return { status: 'unavailable', exists: false, reason: 'Agent shell paths are unavailable in this runtime.' };
|
|
266
|
+
const completion = readOnboardingCompletionMarker(shellPaths, 'user');
|
|
267
|
+
return {
|
|
268
|
+
status: completion.exists ? 'complete' : 'missing',
|
|
269
|
+
exists: completion.exists,
|
|
270
|
+
path: completion.path,
|
|
271
|
+
updatedAt: completion.payload?.updatedAt ?? null,
|
|
272
|
+
source: completion.payload?.source ?? null,
|
|
273
|
+
mode: completion.payload?.mode ?? null,
|
|
274
|
+
};
|
|
275
|
+
} catch (error) {
|
|
276
|
+
return {
|
|
277
|
+
status: 'unavailable',
|
|
278
|
+
exists: false,
|
|
279
|
+
reason: error instanceof Error ? error.message : 'Unable to read Agent onboarding completion marker.',
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
})();
|
|
283
|
+
const certifiedFirstRun = certifiedBrowserPwaFirstRunReceipts(browserPwa);
|
|
284
|
+
const setupReceipts = browserPwaSetupReceipts(context);
|
|
285
|
+
const readySetupReceipt = readyBrowserPwaSetupReceipt(setupReceipts);
|
|
286
|
+
const browserFirstRunStatus = certifiedFirstRun.length > 0
|
|
287
|
+
? 'certified-live-receipt'
|
|
288
|
+
: readySetupReceipt
|
|
289
|
+
? 'published'
|
|
290
|
+
: 'not-published';
|
|
291
|
+
return {
|
|
292
|
+
status: browserFirstRunStatus !== 'not-published' && marker.exists === true
|
|
293
|
+
? 'ready'
|
|
294
|
+
: browserFirstRunStatus !== 'not-published'
|
|
295
|
+
? 'browser-ready-agent-onboarding-missing'
|
|
296
|
+
: marker.exists === true ? 'agent-complete-browser-receipt-missing' : 'needs-agent-closeout-and-browser-receipt',
|
|
297
|
+
agentOnboardingStatus: marker.status,
|
|
298
|
+
browserFirstRunStatus,
|
|
299
|
+
...(includeDetails ? {
|
|
300
|
+
agentOnboardingCompletion: marker,
|
|
301
|
+
browserFirstRunCompletion: certifiedFirstRun.length > 0
|
|
302
|
+
? {
|
|
303
|
+
status: 'certified-live-receipt',
|
|
304
|
+
webEnabled: enabled,
|
|
305
|
+
certifiedReadModelCount: certifiedFirstRun.length,
|
|
306
|
+
evidence: certifiedFirstRun[0],
|
|
307
|
+
setupReceiptEvidence: readySetupReceipt ?? null,
|
|
308
|
+
nextStep: 'Keep browser/PWA first-run receipts fresh with each connected-host browser runtime release.',
|
|
309
|
+
}
|
|
310
|
+
: readySetupReceipt
|
|
311
|
+
? {
|
|
312
|
+
status: 'published',
|
|
313
|
+
webEnabled: enabled,
|
|
314
|
+
evidence: readySetupReceipt,
|
|
315
|
+
certifiedReadModelCount: 0,
|
|
316
|
+
nextStep: 'Publish certified browser/PWA runtime read-model receipts to make cockpit readiness independently verifiable.',
|
|
317
|
+
}
|
|
318
|
+
: {
|
|
319
|
+
status: 'not-published',
|
|
320
|
+
webEnabled: enabled,
|
|
321
|
+
evidence: null,
|
|
322
|
+
certifiedReadModelCount: 0,
|
|
323
|
+
nextStep: 'Publish a connected-host browser/PWA completion receipt before using browser readiness as first-run closeout evidence.',
|
|
324
|
+
},
|
|
325
|
+
browserPwaSetupReceipts: setupReceipts.slice(0, 8),
|
|
326
|
+
} : {}),
|
|
327
|
+
setupCloseoutRoute: 'setup action:"status" includeParameters:true',
|
|
328
|
+
policy: 'Agent reports its own user onboarding marker separately from the connected-host browser/PWA receipt contract so setup closeout does not overclaim browser readiness.',
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
export function connectedBrowserCockpitRoute(context: CommandContext, options: { readonly includeWorkspaceCoverage?: boolean } = {}): Record<string, unknown> {
|
|
333
|
+
const configManager = context.platform?.configManager;
|
|
334
|
+
let enabled = false;
|
|
335
|
+
let binding = { hostMode: 'local', configuredHost: '127.0.0.1', host: '127.0.0.1', port: 3423 };
|
|
336
|
+
let publicBaseUrl = '';
|
|
337
|
+
if (configManager) {
|
|
338
|
+
try {
|
|
339
|
+
enabled = configManager.get('web.enabled') === true;
|
|
340
|
+
binding = resolveRuntimeEndpointBinding(configManager, 'web');
|
|
341
|
+
publicBaseUrl = String(configManager.get('web.publicBaseUrl') ?? '').trim();
|
|
342
|
+
} catch {
|
|
343
|
+
enabled = false;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
const url = publicBaseUrl || `http://${browserConnectHost(binding.host)}:${binding.port}`;
|
|
347
|
+
const browserPwa = browserPwaReadModelSnapshot(context);
|
|
348
|
+
const nativeCategoryRoutesPublished = enabled && AGENT_WORKSPACE_CATEGORIES.every((category) =>
|
|
349
|
+
Boolean(certifiedBrowserPwaCategoryRouteForCategory(browserPwa, category.id))
|
|
350
|
+
);
|
|
351
|
+
const browserFirstRunCertified = certifiedBrowserPwaFirstRunReceipts(browserPwa).length > 0;
|
|
352
|
+
return {
|
|
353
|
+
enabled,
|
|
354
|
+
readiness: enabled ? nativeCategoryRoutesPublished && browserFirstRunCertified ? 'browser-native-ready' : 'ready' : 'setup-needed',
|
|
355
|
+
url,
|
|
356
|
+
source: publicBaseUrl ? 'web.publicBaseUrl' : 'web endpoint binding',
|
|
357
|
+
endpoint: {
|
|
358
|
+
id: 'web',
|
|
359
|
+
binding,
|
|
360
|
+
settings: ['web.enabled', 'web.hostMode', 'web.host', 'web.port', 'web.publicBaseUrl'],
|
|
361
|
+
},
|
|
362
|
+
workspaceCoverage: browserCockpitWorkspaceCoverage(enabled, options.includeWorkspaceCoverage === true, browserPwa),
|
|
363
|
+
mobile: browserCockpitMobileAffordances(enabled, options.includeWorkspaceCoverage === true, browserPwa, nativeCategoryRoutesPublished),
|
|
364
|
+
receipts: browserCockpitReceipts(context, enabled, options.includeWorkspaceCoverage === true, browserPwa),
|
|
365
|
+
setupRoutes: {
|
|
366
|
+
inspectEndpoint: 'host action:"service" endpointId:"web" includeParameters:true',
|
|
367
|
+
servicePosture: 'host action:"services" includeParameters:true',
|
|
368
|
+
connectedHostStatus: 'host action:"status" includeParameters:true',
|
|
369
|
+
settings: 'settings action:"list" query:"web" includeHidden:true',
|
|
370
|
+
},
|
|
371
|
+
policy: 'Opens the connected GoodVibes browser cockpit only after explicit user confirmation. Agent does not host a separate browser app or bypass connected-host setup.',
|
|
372
|
+
};
|
|
373
|
+
}
|