@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
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { clearSetupWizardCheckpoint, readSetupWizardCheckpoint, saveSetupWizardCheckpoint } from '../agent/setup-wizard-checkpoint.ts';
|
|
2
|
+
import type { CommandContext } from './command-registry.ts';
|
|
3
|
+
import { buildAgentWorkspaceRuntimeSnapshot } from './agent-workspace-snapshot.ts';
|
|
4
|
+
import type { AgentWorkspaceAction, AgentWorkspaceActionResult, AgentWorkspaceRuntimeSnapshot } from './agent-workspace-types.ts';
|
|
5
|
+
|
|
6
|
+
interface AgentWorkspaceSetupCheckpointTarget {
|
|
7
|
+
readonly context: CommandContext | null;
|
|
8
|
+
readonly runtimeSnapshot: AgentWorkspaceRuntimeSnapshot | null;
|
|
9
|
+
readonly setRuntimeSnapshot: (snapshot: AgentWorkspaceRuntimeSnapshot | null) => void;
|
|
10
|
+
readonly setStatus: (status: string) => void;
|
|
11
|
+
readonly setLastActionResult: (result: AgentWorkspaceActionResult) => void;
|
|
12
|
+
readonly clampSelection: () => void;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function applyAgentWorkspaceSetupCheckpointAction(
|
|
16
|
+
target: AgentWorkspaceSetupCheckpointTarget,
|
|
17
|
+
action: AgentWorkspaceAction,
|
|
18
|
+
requestRender?: () => void,
|
|
19
|
+
): void {
|
|
20
|
+
const shellPaths = target.context?.workspace?.shellPaths;
|
|
21
|
+
if (!shellPaths || typeof shellPaths.resolveUserPath !== 'function') {
|
|
22
|
+
target.setStatus('Setup checkpoint storage is unavailable.');
|
|
23
|
+
target.setLastActionResult({
|
|
24
|
+
kind: 'error',
|
|
25
|
+
title: 'Setup checkpoint unavailable',
|
|
26
|
+
detail: 'The Agent workspace cannot locate Agent shell paths for setup checkpoint storage.',
|
|
27
|
+
safety: action.safety,
|
|
28
|
+
});
|
|
29
|
+
requestRender?.();
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const refreshSnapshot = (): void => {
|
|
34
|
+
target.setRuntimeSnapshot(target.context ? buildAgentWorkspaceRuntimeSnapshot(target.context) : target.runtimeSnapshot);
|
|
35
|
+
target.clampSelection();
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
try {
|
|
39
|
+
const operation = action.setupCheckpointOperation ?? 'show';
|
|
40
|
+
if (operation === 'show') {
|
|
41
|
+
const checkpoint = readSetupWizardCheckpoint(shellPaths);
|
|
42
|
+
const detail = checkpoint.checkpoint
|
|
43
|
+
? `Saved setup checkpoint: ${checkpoint.checkpoint.currentStepLabel} (${checkpoint.checkpoint.currentStepId}) at ${checkpoint.checkpoint.savedAt}.`
|
|
44
|
+
: checkpoint.exists
|
|
45
|
+
? `Saved setup checkpoint could not be read: ${checkpoint.parseError ?? 'invalid checkpoint file'}.`
|
|
46
|
+
: 'No setup wizard checkpoint is saved yet.';
|
|
47
|
+
target.setStatus(checkpoint.checkpoint ? 'Setup checkpoint loaded.' : 'No setup checkpoint saved.');
|
|
48
|
+
target.setLastActionResult({
|
|
49
|
+
kind: checkpoint.exists && !checkpoint.checkpoint ? 'error' : 'guidance',
|
|
50
|
+
title: 'Setup checkpoint',
|
|
51
|
+
detail,
|
|
52
|
+
safety: action.safety,
|
|
53
|
+
});
|
|
54
|
+
requestRender?.();
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (operation === 'clear') {
|
|
59
|
+
const before = readSetupWizardCheckpoint(shellPaths);
|
|
60
|
+
const checkpoint = clearSetupWizardCheckpoint(shellPaths);
|
|
61
|
+
refreshSnapshot();
|
|
62
|
+
target.setStatus(before.exists ? 'Setup checkpoint cleared.' : 'No setup checkpoint was saved.');
|
|
63
|
+
target.setLastActionResult({
|
|
64
|
+
kind: 'refreshed',
|
|
65
|
+
title: 'Setup checkpoint cleared',
|
|
66
|
+
detail: before.exists
|
|
67
|
+
? `Cleared the Agent-owned setup wizard checkpoint at ${checkpoint.path}.`
|
|
68
|
+
: `No Agent-owned setup wizard checkpoint existed at ${checkpoint.path}.`,
|
|
69
|
+
safety: action.safety,
|
|
70
|
+
});
|
|
71
|
+
requestRender?.();
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const wizard = target.runtimeSnapshot?.setupWizard;
|
|
76
|
+
const current = wizard?.currentStepId
|
|
77
|
+
? wizard.steps.find((step) => step.id === wizard.currentStepId) ?? null
|
|
78
|
+
: null;
|
|
79
|
+
if (!current) {
|
|
80
|
+
target.setStatus('No current setup wizard step to save.');
|
|
81
|
+
target.setLastActionResult({
|
|
82
|
+
kind: 'guidance',
|
|
83
|
+
title: 'Setup checkpoint not saved',
|
|
84
|
+
detail: 'The setup wizard is complete or unavailable, so there is no current step to resume.',
|
|
85
|
+
safety: action.safety,
|
|
86
|
+
});
|
|
87
|
+
requestRender?.();
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (current.sourceStatus === 'ready') {
|
|
91
|
+
target.setStatus('Setup checkpoint not saved.');
|
|
92
|
+
target.setLastActionResult({
|
|
93
|
+
kind: 'guidance',
|
|
94
|
+
title: 'Setup checkpoint not saved',
|
|
95
|
+
detail: `${current.label} is already ready; use the next live setup step instead.`,
|
|
96
|
+
safety: action.safety,
|
|
97
|
+
});
|
|
98
|
+
requestRender?.();
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
const checkpoint = saveSetupWizardCheckpoint(shellPaths, {
|
|
102
|
+
currentStepId: current.id,
|
|
103
|
+
currentStepLabel: current.label,
|
|
104
|
+
source: 'workspace',
|
|
105
|
+
note: 'User-selected setup wizard checkpoint.',
|
|
106
|
+
});
|
|
107
|
+
refreshSnapshot();
|
|
108
|
+
target.setStatus(`Saved setup checkpoint for ${current.label}.`);
|
|
109
|
+
target.setLastActionResult({
|
|
110
|
+
kind: 'refreshed',
|
|
111
|
+
title: 'Setup checkpoint saved',
|
|
112
|
+
detail: `Saved ${current.label} (${current.id}) as the Agent-owned setup resume point at ${checkpoint.path}.`,
|
|
113
|
+
safety: action.safety,
|
|
114
|
+
});
|
|
115
|
+
requestRender?.();
|
|
116
|
+
} catch (error) {
|
|
117
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
118
|
+
target.setStatus('Setup checkpoint action failed.');
|
|
119
|
+
target.setLastActionResult({
|
|
120
|
+
kind: 'error',
|
|
121
|
+
title: 'Setup checkpoint action failed',
|
|
122
|
+
detail,
|
|
123
|
+
safety: action.safety,
|
|
124
|
+
});
|
|
125
|
+
requestRender?.();
|
|
126
|
+
}
|
|
127
|
+
}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import type { ArtifactDescriptor } from '@pellux/goodvibes-sdk/platform/artifacts';
|
|
2
|
+
import type { CommandContext } from './command-registry.ts';
|
|
3
|
+
import { readSetupWizardCheckpoint } from '../agent/setup-wizard-checkpoint.ts';
|
|
4
|
+
import { readOnboardingCompletionMarker } from '../runtime/onboarding/index.ts';
|
|
5
|
+
import { DEFAULT_AGENT_SETUP_WIZARD_CLEAR_CHECKPOINT_ROUTE, DEFAULT_AGENT_SETUP_WIZARD_INSPECT_CHECKPOINT_ROUTE, DEFAULT_AGENT_SETUP_WIZARD_MARK_CHECKPOINT_ROUTE, DEFAULT_AGENT_SETUP_WIZARD_RERUN_SMOKE_ROUTE, DEFAULT_AGENT_SETUP_WIZARD_SAVE_SMOKE_ROUTE, buildAgentSetupWizard, emptyAgentSetupSmokeHistory, emptyAgentSetupWizardCheckpoint, type AgentSetupWizard, type AgentSetupWizardBlockedCheckFrequency, type AgentSetupWizardCheckpoint, type AgentSetupWizardSmokeHistory, type AgentSetupWizardSourceItem } from '../agent/setup-wizard.ts';
|
|
6
|
+
import type { AgentWorkspaceSetupChecklistItem } from './agent-workspace-setup.ts';
|
|
7
|
+
import { readArtifactMetadataString, readArtifactMetadataStringList } from './agent-workspace-artifact-metadata.ts';
|
|
8
|
+
|
|
9
|
+
function isSetupSmokeEvidenceArtifact(artifact: ArtifactDescriptor): boolean {
|
|
10
|
+
return readArtifactMetadataString(artifact.metadata, 'purpose') === 'agent-setup-smoke-evidence';
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function setupSmokeEvidenceScore(artifact: ArtifactDescriptor): number {
|
|
14
|
+
const result = readArtifactMetadataString(artifact.metadata, 'result');
|
|
15
|
+
if (result === 'ready-for-user-run') return 2;
|
|
16
|
+
if (result === 'blocked') return 0;
|
|
17
|
+
return 1;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function setupSmokeEvidenceTrend(artifacts: readonly ArtifactDescriptor[]): string {
|
|
21
|
+
if (artifacts.length === 0) return 'none';
|
|
22
|
+
if (artifacts.length === 1) return 'first-run';
|
|
23
|
+
const latest = setupSmokeEvidenceScore(artifacts[0]!);
|
|
24
|
+
const previous = setupSmokeEvidenceScore(artifacts[1]!);
|
|
25
|
+
if (latest > previous) return 'improving';
|
|
26
|
+
if (latest < previous) return 'regressing';
|
|
27
|
+
const result = readArtifactMetadataString(artifacts[0]!.metadata, 'result');
|
|
28
|
+
if (result === 'ready-for-user-run') return 'unchanged-ready';
|
|
29
|
+
if (result === 'blocked') return 'unchanged-blocked';
|
|
30
|
+
return 'unchanged';
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function setupSmokeBlockedCheckFrequency(artifacts: readonly ArtifactDescriptor[]): readonly AgentSetupWizardBlockedCheckFrequency[] {
|
|
34
|
+
const counts = new Map<string, number>();
|
|
35
|
+
for (const artifact of artifacts) {
|
|
36
|
+
for (const checkId of readArtifactMetadataStringList(artifact.metadata, 'blockedChecks')) {
|
|
37
|
+
counts.set(checkId, (counts.get(checkId) ?? 0) + 1);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return [...counts.entries()]
|
|
41
|
+
.sort((left, right) => right[1] - left[1] || left[0].localeCompare(right[0]))
|
|
42
|
+
.slice(0, 8)
|
|
43
|
+
.map(([checkId, count]) => ({ checkId, count }));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function buildSetupSmokeHistory(artifacts: readonly ArtifactDescriptor[], artifactListAvailable: boolean): AgentSetupWizardSmokeHistory {
|
|
47
|
+
if (!artifactListAvailable) {
|
|
48
|
+
return {
|
|
49
|
+
...emptyAgentSetupSmokeHistory('Artifact list support is unavailable in this runtime.'),
|
|
50
|
+
status: 'unavailable',
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
const setupSmokeArtifacts = artifacts
|
|
54
|
+
.filter(isSetupSmokeEvidenceArtifact)
|
|
55
|
+
.sort((left, right) => (right.createdAt ?? 0) - (left.createdAt ?? 0));
|
|
56
|
+
if (setupSmokeArtifacts.length === 0) return emptyAgentSetupSmokeHistory();
|
|
57
|
+
const resultCounts = setupSmokeArtifacts.reduce<Record<string, number>>((counts, artifact) => {
|
|
58
|
+
const result = readArtifactMetadataString(artifact.metadata, 'result') || 'unknown';
|
|
59
|
+
counts[result] = (counts[result] ?? 0) + 1;
|
|
60
|
+
return counts;
|
|
61
|
+
}, {});
|
|
62
|
+
const latest = setupSmokeArtifacts[0]!;
|
|
63
|
+
const previous = setupSmokeArtifacts[1] ?? null;
|
|
64
|
+
return {
|
|
65
|
+
status: 'available',
|
|
66
|
+
total: setupSmokeArtifacts.length,
|
|
67
|
+
trend: setupSmokeEvidenceTrend(setupSmokeArtifacts),
|
|
68
|
+
latestResult: readArtifactMetadataString(latest.metadata, 'result') || 'unknown',
|
|
69
|
+
previousResult: previous ? readArtifactMetadataString(previous.metadata, 'result') || 'unknown' : null,
|
|
70
|
+
resultCounts,
|
|
71
|
+
blockedCheckFrequency: setupSmokeBlockedCheckFrequency(setupSmokeArtifacts),
|
|
72
|
+
inspectLatestRoute: `agent_artifacts show artifactId:"${latest.id}" includeContent:false`,
|
|
73
|
+
rerunRoute: DEFAULT_AGENT_SETUP_WIZARD_RERUN_SMOKE_ROUTE,
|
|
74
|
+
saveRoute: DEFAULT_AGENT_SETUP_WIZARD_SAVE_SMOKE_ROUTE,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function buildSetupWizardCheckpoint(context: CommandContext): AgentSetupWizardCheckpoint {
|
|
79
|
+
const shellPaths = context.workspace?.shellPaths;
|
|
80
|
+
if (!shellPaths || typeof shellPaths.resolveUserPath !== 'function') {
|
|
81
|
+
return {
|
|
82
|
+
...emptyAgentSetupWizardCheckpoint('Agent shell paths are unavailable; setup wizard checkpoint storage cannot be inspected.'),
|
|
83
|
+
status: 'unavailable',
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
const snapshot = readSetupWizardCheckpoint(shellPaths);
|
|
87
|
+
const routes = {
|
|
88
|
+
markCurrentRoute: DEFAULT_AGENT_SETUP_WIZARD_MARK_CHECKPOINT_ROUTE,
|
|
89
|
+
clearRoute: DEFAULT_AGENT_SETUP_WIZARD_CLEAR_CHECKPOINT_ROUTE,
|
|
90
|
+
inspectRoute: DEFAULT_AGENT_SETUP_WIZARD_INSPECT_CHECKPOINT_ROUTE,
|
|
91
|
+
};
|
|
92
|
+
if (!snapshot.exists) {
|
|
93
|
+
return {
|
|
94
|
+
...emptyAgentSetupWizardCheckpoint(),
|
|
95
|
+
...routes,
|
|
96
|
+
path: snapshot.path,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
if (!snapshot.checkpoint) {
|
|
100
|
+
return {
|
|
101
|
+
...emptyAgentSetupWizardCheckpoint(snapshot.parseError ?? 'Saved setup wizard checkpoint could not be read.'),
|
|
102
|
+
...routes,
|
|
103
|
+
status: 'unavailable',
|
|
104
|
+
path: snapshot.path,
|
|
105
|
+
...(snapshot.parseError ? { parseError: snapshot.parseError } : {}),
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
return {
|
|
109
|
+
status: 'available',
|
|
110
|
+
currentStepId: snapshot.checkpoint.currentStepId,
|
|
111
|
+
currentStepLabel: snapshot.checkpoint.currentStepLabel,
|
|
112
|
+
savedAt: snapshot.checkpoint.savedAt,
|
|
113
|
+
source: snapshot.checkpoint.source,
|
|
114
|
+
resumed: false,
|
|
115
|
+
summary: `Saved setup checkpoint for ${snapshot.checkpoint.currentStepLabel}.`,
|
|
116
|
+
path: snapshot.path,
|
|
117
|
+
...(snapshot.checkpoint.note ? { note: snapshot.checkpoint.note } : {}),
|
|
118
|
+
...routes,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function setupChecklistUserRoute(item: AgentWorkspaceSetupChecklistItem): string {
|
|
123
|
+
return item.command ?? 'Start';
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function setupChecklistModelRoute(item: AgentWorkspaceSetupChecklistItem): string {
|
|
127
|
+
if (item.id === 'runtime') return 'agent_harness mode:"setup_item" setupItemId:"connected-host-readiness"';
|
|
128
|
+
if (item.id === 'provider-model') return 'models action:"status"';
|
|
129
|
+
if (item.id === 'install-smoke') return DEFAULT_AGENT_SETUP_WIZARD_RERUN_SMOKE_ROUTE;
|
|
130
|
+
if (item.id === 'subscriptions') return 'models action:"providers"';
|
|
131
|
+
if (item.id === 'agent-knowledge') return 'agent_knowledge mode:"status"';
|
|
132
|
+
if (item.id === 'profile') return 'agent_harness mode:"workspace_action" actionId:"profile-template-show"';
|
|
133
|
+
if (item.id === 'persona') return 'agent_harness mode:"workspace" target:"personas"';
|
|
134
|
+
if (item.id === 'skills') return 'agent_harness mode:"workspace" target:"skills"';
|
|
135
|
+
if (item.id === 'routines') return 'agent_harness mode:"workspace" target:"routines"';
|
|
136
|
+
if (item.id === 'memory') return 'memory action:"status"';
|
|
137
|
+
if (item.id === 'notes') return 'personal_ops action:"lane" laneId:"notes"';
|
|
138
|
+
if (item.id === 'channels') return 'channels action:"status"';
|
|
139
|
+
if (item.id === 'voice-media') return 'device action:"voice"';
|
|
140
|
+
return `agent_harness mode:"setup_item" setupItemId:"${item.id}"`;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function setupChecklistActionId(item: AgentWorkspaceSetupChecklistItem): string {
|
|
144
|
+
if (item.id === 'provider-model') return 'setup-provider-model';
|
|
145
|
+
if (item.id === 'subscriptions') return 'subscription-login-start';
|
|
146
|
+
if (item.id === 'agent-knowledge') return 'knowledge-status';
|
|
147
|
+
if (item.id === 'profile') return 'profile-template-show';
|
|
148
|
+
if (item.id === 'persona') return 'persona-search';
|
|
149
|
+
if (item.id === 'skills') return 'skill-search';
|
|
150
|
+
if (item.id === 'routines') return 'routine-search';
|
|
151
|
+
if (item.id === 'channels') return 'channel-show';
|
|
152
|
+
if (item.id === 'voice-media') return 'voice-enable';
|
|
153
|
+
return item.id;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
const SETUP_WIZARD_SNAPSHOT_BLOCKER_ALIASES: Readonly<Record<string, readonly string[]>> = {
|
|
157
|
+
'agent-binary': ['runtime', 'install-smoke'],
|
|
158
|
+
'connected-host-status': ['runtime'],
|
|
159
|
+
'connected-host-auth': ['connected-host-auth'],
|
|
160
|
+
'provider-model': ['provider-model'],
|
|
161
|
+
'setup-posture': ['install-smoke'],
|
|
162
|
+
'first-assistant-turn': ['install-smoke'],
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
export function buildWorkspaceSetupWizard(
|
|
166
|
+
checklist: readonly AgentWorkspaceSetupChecklistItem[],
|
|
167
|
+
smokeHistory: AgentSetupWizardSmokeHistory,
|
|
168
|
+
checkpoint: AgentSetupWizardCheckpoint,
|
|
169
|
+
setupMarkerExists: boolean,
|
|
170
|
+
): AgentSetupWizard {
|
|
171
|
+
const items: AgentSetupWizardSourceItem[] = checklist.map((item) => ({
|
|
172
|
+
id: item.id,
|
|
173
|
+
label: item.label,
|
|
174
|
+
status: item.status,
|
|
175
|
+
detail: item.detail,
|
|
176
|
+
userRoute: setupChecklistUserRoute(item),
|
|
177
|
+
modelRoute: setupChecklistModelRoute(item),
|
|
178
|
+
actionId: setupChecklistActionId(item),
|
|
179
|
+
}));
|
|
180
|
+
return buildAgentSetupWizard({
|
|
181
|
+
items,
|
|
182
|
+
smokeHistory,
|
|
183
|
+
checkpoint,
|
|
184
|
+
closeoutCriticalStepIds: ['runtime', 'connected-host-auth', 'provider-model'],
|
|
185
|
+
setupMarkerExists,
|
|
186
|
+
repeatedBlockerAliases: SETUP_WIZARD_SNAPSHOT_BLOCKER_ALIASES,
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export function setupCompletionMarkerExists(context: CommandContext): boolean {
|
|
191
|
+
const shellPaths = context.workspace?.shellPaths;
|
|
192
|
+
if (!shellPaths || typeof shellPaths.resolveUserPath !== 'function') return false;
|
|
193
|
+
try {
|
|
194
|
+
return readOnboardingCompletionMarker(shellPaths, 'user').exists;
|
|
195
|
+
} catch {
|
|
196
|
+
return false;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
@@ -14,6 +14,10 @@ export interface AgentWorkspaceSetupChecklistInput {
|
|
|
14
14
|
readonly provider: string;
|
|
15
15
|
readonly model: string;
|
|
16
16
|
readonly runtimeBaseUrl: string;
|
|
17
|
+
readonly connectedHostTokenPresent: boolean;
|
|
18
|
+
readonly connectedHostTokenReadable: boolean;
|
|
19
|
+
readonly connectedHostTokenPath: string;
|
|
20
|
+
readonly connectedHostTokenError?: string | null;
|
|
17
21
|
readonly activeSubscriptionCount: number;
|
|
18
22
|
readonly pendingSubscriptionCount: number;
|
|
19
23
|
readonly availableSubscriptionProviderCount: number;
|
|
@@ -53,6 +57,13 @@ function sampleNames(summary: AgentBehaviorDiscoverySummary): string {
|
|
|
53
57
|
|
|
54
58
|
export function buildAgentWorkspaceSetupChecklist(input: AgentWorkspaceSetupChecklistInput): readonly AgentWorkspaceSetupChecklistItem[] {
|
|
55
59
|
const providerReady = input.provider !== 'unknown' && input.model !== 'unknown';
|
|
60
|
+
const tokenPathKnown = input.connectedHostTokenPath !== '(Agent home unavailable)';
|
|
61
|
+
const connectedHostAuthStatus: AgentWorkspaceSetupStatus = input.connectedHostTokenReadable
|
|
62
|
+
? 'ready'
|
|
63
|
+
: tokenPathKnown
|
|
64
|
+
? 'blocked'
|
|
65
|
+
: 'recommended';
|
|
66
|
+
const installSmokeReady = providerReady && input.connectedHostTokenReadable;
|
|
56
67
|
const hasActivePersona = input.activePersonaName !== '(none)' && input.activePersonaName !== '(unavailable)';
|
|
57
68
|
const discoveredBehaviorCount = input.discoveredPersonas.count + input.discoveredSkills.count + input.discoveredRoutines.count;
|
|
58
69
|
return [
|
|
@@ -60,9 +71,22 @@ export function buildAgentWorkspaceSetupChecklist(input: AgentWorkspaceSetupChec
|
|
|
60
71
|
id: 'runtime',
|
|
61
72
|
label: 'Connected host',
|
|
62
73
|
status: 'ready',
|
|
63
|
-
detail: `Agent will connect to ${input.runtimeBaseUrl};
|
|
74
|
+
detail: `Agent will connect to ${input.runtimeBaseUrl}; protected host routes also need the Agent companion token below.`,
|
|
64
75
|
command: 'Home -> Review health',
|
|
65
76
|
},
|
|
77
|
+
{
|
|
78
|
+
id: 'connected-host-auth',
|
|
79
|
+
label: 'Connected-host auth',
|
|
80
|
+
status: connectedHostAuthStatus,
|
|
81
|
+
detail: input.connectedHostTokenReadable
|
|
82
|
+
? `Agent has a readable connected-host operator token at ${input.connectedHostTokenPath}.`
|
|
83
|
+
: input.connectedHostTokenError
|
|
84
|
+
? `The connected-host operator token exists but cannot be read at ${input.connectedHostTokenPath}. Use the confirmed setup token provisioning route, then rerun auth review.`
|
|
85
|
+
: tokenPathKnown
|
|
86
|
+
? `Provision Agent's local connected-host operator token at ${input.connectedHostTokenPath} before pairing channels, Knowledge, schedules, or protected daemon routes.`
|
|
87
|
+
: 'Shell paths are unavailable in this runtime, so connected-host auth cannot be verified from the workspace snapshot.',
|
|
88
|
+
command: 'Host -> Connected-host auth owner',
|
|
89
|
+
},
|
|
66
90
|
{
|
|
67
91
|
id: 'provider-model',
|
|
68
92
|
label: 'Provider and model',
|
|
@@ -72,6 +96,15 @@ export function buildAgentWorkspaceSetupChecklist(input: AgentWorkspaceSetupChec
|
|
|
72
96
|
: 'Choose a provider and model before relying on assistant turns.',
|
|
73
97
|
command: 'Setup -> Provider and model',
|
|
74
98
|
},
|
|
99
|
+
{
|
|
100
|
+
id: 'install-smoke',
|
|
101
|
+
label: 'Install smoke',
|
|
102
|
+
status: installSmokeReady ? 'recommended' : tokenPathKnown ? 'blocked' : 'recommended',
|
|
103
|
+
detail: installSmokeReady
|
|
104
|
+
? 'Run setup smoke after install or migration to prove package start, connected host, auth, model route, setup posture, and first assistant turn.'
|
|
105
|
+
: 'Resolve connected-host auth and provider/model setup before treating the first assistant turn as install-ready.',
|
|
106
|
+
command: 'Start -> Install smoke',
|
|
107
|
+
},
|
|
75
108
|
{
|
|
76
109
|
id: 'subscriptions',
|
|
77
110
|
label: 'Provider subscriptions',
|