@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,755 @@
|
|
|
1
|
+
import { buildAgentArtifactBrowserToolArgs, buildAgentArtifactExportToolArgs, buildAgentArtifactPackageToolArgs, buildAgentArtifactPromoteKnowledgeToolArgs, buildAgentArtifactShowToolArgs } from '../input/agent-workspace-artifact-browser-editor.ts';
|
|
2
|
+
import { buildAgentDocumentReviewerReadinessToolArgs, buildAgentDocumentReviewPacketPresetRefreshToolArgs, buildAgentDocumentReviewPacketPresetToolArgs, buildAgentDocumentReviewPacketShareToolArgs, buildAgentDocumentReviewPacketWizardToolArgs } from '../input/agent-workspace-document-ops-editor.ts';
|
|
3
|
+
import { buildAgentDocumentToolArgs } from '../input/agent-workspace-document-editor.ts';
|
|
4
|
+
import { buildAgentWorkspaceCommandEditorSubmission, isAgentWorkspaceCommandEditorKind } from '../input/agent-workspace-command-editor.ts';
|
|
5
|
+
import { buildAgentModelCompareAnalyticsToolArgs, buildAgentModelCompareApplyToolArgs, buildAgentModelCompareExportToolArgs, buildAgentModelCompareHandoffDiffToolArgs, buildAgentModelCompareJudgmentToolArgs, buildAgentModelCompareReviewToolArgs, buildAgentModelCompareRouteDecisionToolArgs, buildAgentModelCompareToolArgs } from '../input/agent-workspace-model-compare-editor.ts';
|
|
6
|
+
import { buildAgentResearchReportToolArgs } from '../input/agent-workspace-research-report-editor.ts';
|
|
7
|
+
import { buildAgentResearchRunToolArgs } from '../input/agent-workspace-research-run-editor.ts';
|
|
8
|
+
import { buildAgentResearchSourceToolArgs } from '../input/agent-workspace-research-source-editor.ts';
|
|
9
|
+
import { isAffirmative, splitList } from '../input/agent-workspace-editors.ts';
|
|
10
|
+
import { createAgentWorkspaceLearnedBehavior } from '../input/agent-workspace-learned-behavior.ts';
|
|
11
|
+
import type { AgentWorkspaceAction, AgentWorkspaceLocalEditor } from '../input/agent-workspace-types.ts';
|
|
12
|
+
import { describeDocumentOpsLane } from './agent-harness-document-ops.ts';
|
|
13
|
+
import { runLocalWorkspaceEditorAction } from './agent-harness-local-operations.ts';
|
|
14
|
+
import { describeWorkspaceEditorModelExecution } from './agent-harness-workspace-editor-execution.ts';
|
|
15
|
+
import { describeWorkspaceEditor } from './agent-harness-workspace-actions.ts';
|
|
16
|
+
import { runCommand } from './agent-harness-command-runner.ts';
|
|
17
|
+
import type { AgentHarnessToolArgs, AgentHarnessToolDeps } from './agent-harness-tool-types.ts';
|
|
18
|
+
import { error, output, readFieldMap, readString, requireConfirmedAction } from './agent-harness-tool-utils.ts';
|
|
19
|
+
|
|
20
|
+
function fieldReader(editor: AgentWorkspaceLocalEditor, fields: Readonly<Record<string, string>>): (fieldId: string) => string {
|
|
21
|
+
return (fieldId: string) => fields[fieldId] ?? editor.fields.find((field) => field.id === fieldId)?.value ?? '';
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function missingRequiredEditorFields(editor: AgentWorkspaceLocalEditor, fields: Readonly<Record<string, string>>): readonly string[] {
|
|
25
|
+
const readField = fieldReader(editor, fields);
|
|
26
|
+
return editor.fields
|
|
27
|
+
.filter((field) => field.required && !readField(field.id).trim())
|
|
28
|
+
.map((field) => field.id);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export async function runWorkspaceEditorAction(
|
|
32
|
+
deps: AgentHarnessToolDeps,
|
|
33
|
+
action: AgentWorkspaceAction,
|
|
34
|
+
editor: AgentWorkspaceLocalEditor,
|
|
35
|
+
args: AgentHarnessToolArgs,
|
|
36
|
+
): Promise<{ readonly success: boolean; readonly output?: string; readonly error?: string }> {
|
|
37
|
+
const fields = readFieldMap(args.fields);
|
|
38
|
+
const missing = missingRequiredEditorFields(editor, fields);
|
|
39
|
+
if (missing.length > 0) {
|
|
40
|
+
return output({
|
|
41
|
+
status: 'missing_required_fields',
|
|
42
|
+
missing,
|
|
43
|
+
action: action.id,
|
|
44
|
+
editor: describeWorkspaceEditor(editor),
|
|
45
|
+
modelExecution: describeWorkspaceEditorModelExecution(editor.kind),
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (editor.kind === 'learned-behavior') {
|
|
50
|
+
const confirmationError = requireConfirmedAction(args, 'Workspace learned-behavior capture');
|
|
51
|
+
if (confirmationError) return error(confirmationError);
|
|
52
|
+
const shellPaths = deps.commandContext.workspace.shellPaths;
|
|
53
|
+
if (!shellPaths) return error('Agent shell paths are unavailable.');
|
|
54
|
+
const readField = fieldReader(editor, fields);
|
|
55
|
+
const target = readField('target').trim().toLowerCase();
|
|
56
|
+
if (target !== 'skill' && target !== 'routine' && target !== 'persona') {
|
|
57
|
+
return error('learned-behavior target must be skill, routine, or persona.');
|
|
58
|
+
}
|
|
59
|
+
const created = createAgentWorkspaceLearnedBehavior(shellPaths, {
|
|
60
|
+
target,
|
|
61
|
+
name: readField('name'),
|
|
62
|
+
description: readField('description'),
|
|
63
|
+
notes: readField('notes'),
|
|
64
|
+
tags: splitList(readField('tags')),
|
|
65
|
+
triggers: splitList(readField('triggers')),
|
|
66
|
+
enable: isAffirmative(readField('enable')),
|
|
67
|
+
});
|
|
68
|
+
return output({
|
|
69
|
+
status: 'created',
|
|
70
|
+
kind: created.kind,
|
|
71
|
+
id: created.id,
|
|
72
|
+
name: created.name,
|
|
73
|
+
policy: 'Agent-local behavior only; no connected-host mutation, default knowledge write, or delegated job was created.',
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (editor.kind === 'profile') {
|
|
78
|
+
const readField = fieldReader(editor, fields);
|
|
79
|
+
const name = readField('name');
|
|
80
|
+
const template = readField('template');
|
|
81
|
+
const parts = ['/agent-profile', 'create', name];
|
|
82
|
+
if (template.trim() && template.trim().toLowerCase() !== 'none') parts.push('--template', template);
|
|
83
|
+
parts.push('--yes');
|
|
84
|
+
return runCommand(deps, {
|
|
85
|
+
...args,
|
|
86
|
+
command: parts.map((part, index) => index < 2 || part.startsWith('--') ? part : JSON.stringify(part)).join(' '),
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (editor.kind === 'artifact-browser') {
|
|
91
|
+
const artifactsToolArgs = buildAgentArtifactBrowserToolArgs(fieldReader(editor, fields));
|
|
92
|
+
const result = await deps.toolRegistry.execute(
|
|
93
|
+
'agent-harness-workspace-artifact-browser',
|
|
94
|
+
'agent_artifacts',
|
|
95
|
+
artifactsToolArgs as unknown as Record<string, unknown>,
|
|
96
|
+
);
|
|
97
|
+
return output({
|
|
98
|
+
status: result.success ? 'executed_model_tool' : 'model_tool_failed',
|
|
99
|
+
action: action.id,
|
|
100
|
+
tool: 'agent_artifacts',
|
|
101
|
+
output: result.output ?? null,
|
|
102
|
+
error: result.error ?? null,
|
|
103
|
+
modelExecution: describeWorkspaceEditorModelExecution(editor.kind),
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (editor.kind === 'artifact-show') {
|
|
108
|
+
const artifactToolArgs = buildAgentArtifactShowToolArgs(fieldReader(editor, fields));
|
|
109
|
+
const result = await deps.toolRegistry.execute(
|
|
110
|
+
'agent-harness-workspace-artifact-show',
|
|
111
|
+
'agent_artifacts',
|
|
112
|
+
artifactToolArgs as unknown as Record<string, unknown>,
|
|
113
|
+
);
|
|
114
|
+
return output({
|
|
115
|
+
status: result.success ? 'executed_model_tool' : 'model_tool_failed',
|
|
116
|
+
action: action.id,
|
|
117
|
+
tool: 'agent_artifacts',
|
|
118
|
+
output: result.output ?? null,
|
|
119
|
+
error: result.error ?? null,
|
|
120
|
+
modelExecution: describeWorkspaceEditorModelExecution(editor.kind),
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
if (editor.kind === 'artifact-export-file') {
|
|
125
|
+
const confirmationError = requireConfirmedAction(args, 'Workspace artifact export');
|
|
126
|
+
if (confirmationError) return error(confirmationError);
|
|
127
|
+
const formConfirmation = fieldReader(editor, fields)('confirm').trim().toLowerCase();
|
|
128
|
+
if (formConfirmation !== 'yes' && formConfirmation !== 'true') {
|
|
129
|
+
return output({
|
|
130
|
+
status: 'not_confirmed',
|
|
131
|
+
action: action.id,
|
|
132
|
+
editor: describeWorkspaceEditor(editor),
|
|
133
|
+
modelExecution: describeWorkspaceEditorModelExecution(editor.kind),
|
|
134
|
+
note: 'Type yes in the editor confirmation field before exporting the artifact to a workspace file.',
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
const artifactToolArgs = buildAgentArtifactExportToolArgs(
|
|
138
|
+
fieldReader(editor, fields),
|
|
139
|
+
readString(args.explicitUserRequest) || 'Export a reviewed saved Agent artifact to a workspace file.',
|
|
140
|
+
);
|
|
141
|
+
const result = await deps.toolRegistry.execute(
|
|
142
|
+
'agent-harness-workspace-artifact-export',
|
|
143
|
+
'agent_artifacts',
|
|
144
|
+
artifactToolArgs as unknown as Record<string, unknown>,
|
|
145
|
+
);
|
|
146
|
+
return output({
|
|
147
|
+
status: result.success ? 'executed_model_tool' : 'model_tool_failed',
|
|
148
|
+
action: action.id,
|
|
149
|
+
tool: 'agent_artifacts',
|
|
150
|
+
output: result.output ?? null,
|
|
151
|
+
error: result.error ?? null,
|
|
152
|
+
modelExecution: describeWorkspaceEditorModelExecution(editor.kind),
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
if (editor.kind === 'artifact-export-package') {
|
|
157
|
+
const confirmationError = requireConfirmedAction(args, 'Workspace artifact package export');
|
|
158
|
+
if (confirmationError) return error(confirmationError);
|
|
159
|
+
const readField = fieldReader(editor, fields);
|
|
160
|
+
const formConfirmation = readField('confirm').trim().toLowerCase();
|
|
161
|
+
if (formConfirmation !== 'yes' && formConfirmation !== 'true') {
|
|
162
|
+
return output({
|
|
163
|
+
status: 'not_confirmed',
|
|
164
|
+
action: action.id,
|
|
165
|
+
editor: describeWorkspaceEditor(editor),
|
|
166
|
+
modelExecution: describeWorkspaceEditorModelExecution(editor.kind),
|
|
167
|
+
note: 'Type yes in the editor confirmation field before exporting the selected artifacts to a package output.',
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
const packageFormat = readField('packageFormat').trim().toLowerCase();
|
|
171
|
+
const defaultRequest = packageFormat === 'zip' || packageFormat === 'archive'
|
|
172
|
+
? 'Export reviewed saved Agent artifacts to a workspace ZIP archive.'
|
|
173
|
+
: 'Export reviewed saved Agent artifacts to a workspace package directory.';
|
|
174
|
+
const artifactToolArgs = buildAgentArtifactPackageToolArgs(
|
|
175
|
+
readField,
|
|
176
|
+
readString(args.explicitUserRequest) || defaultRequest,
|
|
177
|
+
);
|
|
178
|
+
const result = await deps.toolRegistry.execute(
|
|
179
|
+
'agent-harness-workspace-artifact-package-export',
|
|
180
|
+
'agent_artifacts',
|
|
181
|
+
artifactToolArgs as unknown as Record<string, unknown>,
|
|
182
|
+
);
|
|
183
|
+
return output({
|
|
184
|
+
status: result.success ? 'executed_model_tool' : 'model_tool_failed',
|
|
185
|
+
action: action.id,
|
|
186
|
+
tool: 'agent_artifacts',
|
|
187
|
+
output: result.output ?? null,
|
|
188
|
+
error: result.error ?? null,
|
|
189
|
+
modelExecution: describeWorkspaceEditorModelExecution(editor.kind),
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
if (editor.kind === 'artifact-promote-knowledge') {
|
|
194
|
+
const confirmationError = requireConfirmedAction(args, 'Workspace artifact Knowledge promotion');
|
|
195
|
+
if (confirmationError) return error(confirmationError);
|
|
196
|
+
const formConfirmation = fieldReader(editor, fields)('confirm').trim().toLowerCase();
|
|
197
|
+
if (formConfirmation !== 'yes' && formConfirmation !== 'true') {
|
|
198
|
+
return output({
|
|
199
|
+
status: 'not_confirmed',
|
|
200
|
+
action: action.id,
|
|
201
|
+
editor: describeWorkspaceEditor(editor),
|
|
202
|
+
modelExecution: describeWorkspaceEditorModelExecution(editor.kind),
|
|
203
|
+
note: 'Type yes in the editor confirmation field before ingesting the artifact into Agent Knowledge.',
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
const ingestToolArgs = buildAgentArtifactPromoteKnowledgeToolArgs(
|
|
207
|
+
fieldReader(editor, fields),
|
|
208
|
+
readString(args.explicitUserRequest) || 'Promote a reviewed saved Agent artifact into isolated Agent Knowledge.',
|
|
209
|
+
);
|
|
210
|
+
const result = await deps.toolRegistry.execute(
|
|
211
|
+
'agent-harness-workspace-artifact-promote-knowledge',
|
|
212
|
+
'agent_knowledge_ingest',
|
|
213
|
+
ingestToolArgs as unknown as Record<string, unknown>,
|
|
214
|
+
);
|
|
215
|
+
return output({
|
|
216
|
+
status: result.success ? 'executed_model_tool' : 'model_tool_failed',
|
|
217
|
+
action: action.id,
|
|
218
|
+
tool: 'agent_knowledge_ingest',
|
|
219
|
+
output: result.output ?? null,
|
|
220
|
+
error: result.error ?? null,
|
|
221
|
+
modelExecution: describeWorkspaceEditorModelExecution(editor.kind),
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
if (editor.kind === 'research-report') {
|
|
226
|
+
const confirmationError = requireConfirmedAction(args, 'Workspace research report artifact save');
|
|
227
|
+
if (confirmationError) return error(confirmationError);
|
|
228
|
+
const formConfirmation = fieldReader(editor, fields)('confirm').trim().toLowerCase();
|
|
229
|
+
if (formConfirmation !== 'yes' && formConfirmation !== 'true') {
|
|
230
|
+
return output({
|
|
231
|
+
status: 'not_confirmed',
|
|
232
|
+
action: action.id,
|
|
233
|
+
editor: describeWorkspaceEditor(editor),
|
|
234
|
+
modelExecution: describeWorkspaceEditorModelExecution(editor.kind),
|
|
235
|
+
note: 'Type yes in the editor confirmation field before saving the sourced research report artifact.',
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
const researchToolArgs = buildAgentResearchReportToolArgs(
|
|
239
|
+
fieldReader(editor, fields),
|
|
240
|
+
readString(args.explicitUserRequest) || 'Save a reviewed source-grounded research report as an Agent artifact.',
|
|
241
|
+
);
|
|
242
|
+
const result = await deps.toolRegistry.execute(
|
|
243
|
+
'agent-harness-workspace-research-report',
|
|
244
|
+
'agent_research_report',
|
|
245
|
+
researchToolArgs as unknown as Record<string, unknown>,
|
|
246
|
+
);
|
|
247
|
+
return output({
|
|
248
|
+
status: result.success ? 'executed_model_tool' : 'model_tool_failed',
|
|
249
|
+
action: action.id,
|
|
250
|
+
tool: 'agent_research_report',
|
|
251
|
+
output: result.output ?? null,
|
|
252
|
+
error: result.error ?? null,
|
|
253
|
+
modelExecution: describeWorkspaceEditorModelExecution(editor.kind),
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
if (editor.kind === 'research-run') {
|
|
258
|
+
const confirmationError = requireConfirmedAction(args, 'Workspace research run creation');
|
|
259
|
+
if (confirmationError) return error(confirmationError);
|
|
260
|
+
const formConfirmation = fieldReader(editor, fields)('confirm').trim().toLowerCase();
|
|
261
|
+
if (formConfirmation !== 'yes' && formConfirmation !== 'true') {
|
|
262
|
+
return output({
|
|
263
|
+
status: 'not_confirmed',
|
|
264
|
+
action: action.id,
|
|
265
|
+
editor: describeWorkspaceEditor(editor),
|
|
266
|
+
modelExecution: describeWorkspaceEditorModelExecution(editor.kind),
|
|
267
|
+
note: 'Type yes in the editor confirmation field before creating the visible local research run.',
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
const runToolArgs = buildAgentResearchRunToolArgs(
|
|
271
|
+
fieldReader(editor, fields),
|
|
272
|
+
readString(args.explicitUserRequest) || 'Create one visible checkpointable local research run.',
|
|
273
|
+
);
|
|
274
|
+
const result = await deps.toolRegistry.execute(
|
|
275
|
+
'agent-harness-workspace-research-run',
|
|
276
|
+
'agent_research_runs',
|
|
277
|
+
runToolArgs as unknown as Record<string, unknown>,
|
|
278
|
+
);
|
|
279
|
+
return output({
|
|
280
|
+
status: result.success ? 'executed_model_tool' : 'model_tool_failed',
|
|
281
|
+
action: action.id,
|
|
282
|
+
tool: 'agent_research_runs',
|
|
283
|
+
output: result.output ?? null,
|
|
284
|
+
error: result.error ?? null,
|
|
285
|
+
modelExecution: describeWorkspaceEditorModelExecution(editor.kind),
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
if (editor.kind === 'research-source') {
|
|
290
|
+
const confirmationError = requireConfirmedAction(args, 'Workspace research source queue add');
|
|
291
|
+
if (confirmationError) return error(confirmationError);
|
|
292
|
+
const formConfirmation = fieldReader(editor, fields)('confirm').trim().toLowerCase();
|
|
293
|
+
if (formConfirmation !== 'yes' && formConfirmation !== 'true') {
|
|
294
|
+
return output({
|
|
295
|
+
status: 'not_confirmed',
|
|
296
|
+
action: action.id,
|
|
297
|
+
editor: describeWorkspaceEditor(editor),
|
|
298
|
+
modelExecution: describeWorkspaceEditorModelExecution(editor.kind),
|
|
299
|
+
note: 'Type yes in the editor confirmation field before adding the source to the local research queue.',
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
const sourceToolArgs = buildAgentResearchSourceToolArgs(
|
|
303
|
+
fieldReader(editor, fields),
|
|
304
|
+
readString(args.explicitUserRequest) || 'Add one source to the project-local research queue.',
|
|
305
|
+
);
|
|
306
|
+
const result = await deps.toolRegistry.execute(
|
|
307
|
+
'agent-harness-workspace-research-source',
|
|
308
|
+
'agent_research_sources',
|
|
309
|
+
sourceToolArgs as unknown as Record<string, unknown>,
|
|
310
|
+
);
|
|
311
|
+
return output({
|
|
312
|
+
status: result.success ? 'executed_model_tool' : 'model_tool_failed',
|
|
313
|
+
action: action.id,
|
|
314
|
+
tool: 'agent_research_sources',
|
|
315
|
+
output: result.output ?? null,
|
|
316
|
+
error: result.error ?? null,
|
|
317
|
+
modelExecution: describeWorkspaceEditorModelExecution(editor.kind),
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
if (
|
|
322
|
+
editor.kind === 'document-browse'
|
|
323
|
+
|| editor.kind === 'document-show'
|
|
324
|
+
|| editor.kind === 'document-create'
|
|
325
|
+
|| editor.kind === 'document-update'
|
|
326
|
+
|| editor.kind === 'document-review'
|
|
327
|
+
|| editor.kind === 'document-comment'
|
|
328
|
+
|| editor.kind === 'document-resolve-comment'
|
|
329
|
+
|| editor.kind === 'document-suggest'
|
|
330
|
+
|| editor.kind === 'document-accept-suggestion'
|
|
331
|
+
|| editor.kind === 'document-reject-suggestion'
|
|
332
|
+
|| editor.kind === 'document-insert-artifact'
|
|
333
|
+
|| editor.kind === 'document-attach-artifact'
|
|
334
|
+
|| editor.kind === 'document-export'
|
|
335
|
+
) {
|
|
336
|
+
const isMutation = editor.kind !== 'document-browse' && editor.kind !== 'document-show';
|
|
337
|
+
if (isMutation) {
|
|
338
|
+
const confirmationError = requireConfirmedAction(args, 'Workspace Agent document action');
|
|
339
|
+
if (confirmationError) return error(confirmationError);
|
|
340
|
+
const formConfirmation = fieldReader(editor, fields)('confirm').trim().toLowerCase();
|
|
341
|
+
if (formConfirmation !== 'yes' && formConfirmation !== 'true') {
|
|
342
|
+
return output({
|
|
343
|
+
status: 'not_confirmed',
|
|
344
|
+
action: action.id,
|
|
345
|
+
editor: describeWorkspaceEditor(editor),
|
|
346
|
+
modelExecution: describeWorkspaceEditorModelExecution(editor.kind),
|
|
347
|
+
note: 'Type yes in the editor confirmation field before changing Agent document drafts.',
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
const documentToolArgs = buildAgentDocumentToolArgs(
|
|
352
|
+
editor,
|
|
353
|
+
fieldReader(editor, fields),
|
|
354
|
+
readString(args.explicitUserRequest) || 'Run the Agent document workspace action.',
|
|
355
|
+
);
|
|
356
|
+
const result = await deps.toolRegistry.execute(
|
|
357
|
+
'agent-harness-workspace-document',
|
|
358
|
+
'agent_documents',
|
|
359
|
+
documentToolArgs as unknown as Record<string, unknown>,
|
|
360
|
+
);
|
|
361
|
+
return output({
|
|
362
|
+
status: result.success ? 'executed_model_tool' : 'model_tool_failed',
|
|
363
|
+
action: action.id,
|
|
364
|
+
tool: 'agent_documents',
|
|
365
|
+
output: result.output ?? null,
|
|
366
|
+
error: result.error ?? null,
|
|
367
|
+
modelExecution: describeWorkspaceEditorModelExecution(editor.kind),
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
if (editor.kind === 'document-reviewer-readiness') {
|
|
372
|
+
const readinessArgs = buildAgentDocumentReviewerReadinessToolArgs(fieldReader(editor, fields));
|
|
373
|
+
const resolved = describeDocumentOpsLane(deps.commandContext, readinessArgs);
|
|
374
|
+
if (resolved.status !== 'found') {
|
|
375
|
+
return error(resolved.status === 'ambiguous'
|
|
376
|
+
? `Ambiguous Document Ops lane reviewer_readiness. Candidates: ${JSON.stringify(resolved.candidates)}`
|
|
377
|
+
: resolved.usage);
|
|
378
|
+
}
|
|
379
|
+
return output({
|
|
380
|
+
status: 'executed_harness_lane',
|
|
381
|
+
action: action.id,
|
|
382
|
+
tool: 'agent_harness',
|
|
383
|
+
output: resolved.lane,
|
|
384
|
+
modelExecution: describeWorkspaceEditorModelExecution(editor.kind),
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
if (editor.kind === 'document-review-packet-wizard') {
|
|
388
|
+
const wizardArgs = buildAgentDocumentReviewPacketWizardToolArgs(fieldReader(editor, fields));
|
|
389
|
+
const resolved = describeDocumentOpsLane(deps.commandContext, wizardArgs);
|
|
390
|
+
if (resolved.status !== 'found') {
|
|
391
|
+
return error(resolved.status === 'ambiguous'
|
|
392
|
+
? `Ambiguous Document Ops lane review_packet_wizard. Candidates: ${JSON.stringify(resolved.candidates)}`
|
|
393
|
+
: resolved.usage);
|
|
394
|
+
}
|
|
395
|
+
return output({
|
|
396
|
+
status: 'executed_harness_lane',
|
|
397
|
+
action: action.id,
|
|
398
|
+
tool: 'agent_harness',
|
|
399
|
+
output: resolved.lane,
|
|
400
|
+
modelExecution: describeWorkspaceEditorModelExecution(editor.kind),
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
if (editor.kind === 'document-review-packet-preset') {
|
|
404
|
+
const confirmationError = requireConfirmedAction(args, 'Workspace review packet preset save');
|
|
405
|
+
if (confirmationError) return error(confirmationError);
|
|
406
|
+
const formConfirmation = fieldReader(editor, fields)('confirm').trim().toLowerCase();
|
|
407
|
+
if (formConfirmation !== 'yes' && formConfirmation !== 'true') {
|
|
408
|
+
return output({
|
|
409
|
+
status: 'not_confirmed',
|
|
410
|
+
action: action.id,
|
|
411
|
+
editor: describeWorkspaceEditor(editor),
|
|
412
|
+
modelExecution: describeWorkspaceEditorModelExecution(editor.kind),
|
|
413
|
+
note: 'Type yes in the editor confirmation field before saving a review packet preset artifact.',
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
const presetArgs = buildAgentDocumentReviewPacketPresetToolArgs(
|
|
417
|
+
fieldReader(editor, fields),
|
|
418
|
+
readString(args.explicitUserRequest) || 'Save the current Document Ops review packet preset from an Agent workspace action.',
|
|
419
|
+
);
|
|
420
|
+
const result = await deps.toolRegistry.execute(
|
|
421
|
+
'agent-harness-workspace-review-packet-preset',
|
|
422
|
+
'agent_review_packet_presets',
|
|
423
|
+
presetArgs as unknown as Record<string, unknown>,
|
|
424
|
+
);
|
|
425
|
+
return output({
|
|
426
|
+
status: result.success ? 'executed_model_tool' : 'model_tool_failed',
|
|
427
|
+
action: action.id,
|
|
428
|
+
tool: 'agent_review_packet_presets',
|
|
429
|
+
output: result.output ?? null,
|
|
430
|
+
error: result.error ?? null,
|
|
431
|
+
modelExecution: describeWorkspaceEditorModelExecution(editor.kind),
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
if (editor.kind === 'document-review-packet-preset-refresh') {
|
|
435
|
+
const confirmationError = requireConfirmedAction(args, 'Workspace review packet preset refresh');
|
|
436
|
+
if (confirmationError) return error(confirmationError);
|
|
437
|
+
const formConfirmation = fieldReader(editor, fields)('confirm').trim().toLowerCase();
|
|
438
|
+
if (formConfirmation !== 'yes' && formConfirmation !== 'true') {
|
|
439
|
+
return output({
|
|
440
|
+
status: 'not_confirmed',
|
|
441
|
+
action: action.id,
|
|
442
|
+
editor: describeWorkspaceEditor(editor),
|
|
443
|
+
modelExecution: describeWorkspaceEditorModelExecution(editor.kind),
|
|
444
|
+
note: 'Type yes in the editor confirmation field before refreshing a review packet preset artifact.',
|
|
445
|
+
});
|
|
446
|
+
}
|
|
447
|
+
const presetArgs = buildAgentDocumentReviewPacketPresetRefreshToolArgs(
|
|
448
|
+
fieldReader(editor, fields),
|
|
449
|
+
readString(args.explicitUserRequest) || 'Refresh the Document Ops review packet preset from an Agent workspace action.',
|
|
450
|
+
);
|
|
451
|
+
const result = await deps.toolRegistry.execute(
|
|
452
|
+
'agent-harness-workspace-review-packet-preset-refresh',
|
|
453
|
+
'agent_review_packet_presets',
|
|
454
|
+
presetArgs as unknown as Record<string, unknown>,
|
|
455
|
+
);
|
|
456
|
+
return output({
|
|
457
|
+
status: result.success ? 'executed_model_tool' : 'model_tool_failed',
|
|
458
|
+
action: action.id,
|
|
459
|
+
tool: 'agent_review_packet_presets',
|
|
460
|
+
output: result.output ?? null,
|
|
461
|
+
error: result.error ?? null,
|
|
462
|
+
modelExecution: describeWorkspaceEditorModelExecution(editor.kind),
|
|
463
|
+
});
|
|
464
|
+
}
|
|
465
|
+
if (editor.kind === 'document-review-packet-share') {
|
|
466
|
+
const confirmationError = requireConfirmedAction(args, 'Workspace review packet share');
|
|
467
|
+
if (confirmationError) return error(confirmationError);
|
|
468
|
+
const formConfirmation = fieldReader(editor, fields)('confirm').trim().toLowerCase();
|
|
469
|
+
if (formConfirmation !== 'yes' && formConfirmation !== 'true') {
|
|
470
|
+
return output({
|
|
471
|
+
status: 'not_confirmed',
|
|
472
|
+
action: action.id,
|
|
473
|
+
editor: describeWorkspaceEditor(editor),
|
|
474
|
+
modelExecution: describeWorkspaceEditorModelExecution(editor.kind),
|
|
475
|
+
note: 'Type yes in the editor confirmation field before sharing a review packet archive reference.',
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
const shareArgs = buildAgentDocumentReviewPacketShareToolArgs(
|
|
479
|
+
fieldReader(editor, fields),
|
|
480
|
+
readString(args.explicitUserRequest) || 'Share the Document Ops review packet archive from an Agent workspace action.',
|
|
481
|
+
);
|
|
482
|
+
const result = await deps.toolRegistry.execute(
|
|
483
|
+
'agent-harness-workspace-review-packet-share',
|
|
484
|
+
'agent_review_packet_share',
|
|
485
|
+
shareArgs as unknown as Record<string, unknown>,
|
|
486
|
+
);
|
|
487
|
+
return output({
|
|
488
|
+
status: result.success ? 'executed_model_tool' : 'model_tool_failed',
|
|
489
|
+
action: action.id,
|
|
490
|
+
tool: 'agent_review_packet_share',
|
|
491
|
+
output: result.output ?? null,
|
|
492
|
+
error: result.error ?? null,
|
|
493
|
+
modelExecution: describeWorkspaceEditorModelExecution(editor.kind),
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
if (editor.kind === 'model-compare' || editor.kind === 'local-model-benchmark') {
|
|
498
|
+
const confirmationError = requireConfirmedAction(args, 'Workspace blind model comparison');
|
|
499
|
+
if (confirmationError) return error(confirmationError);
|
|
500
|
+
const formConfirmation = fieldReader(editor, fields)('confirm').trim().toLowerCase();
|
|
501
|
+
if (formConfirmation !== 'yes' && formConfirmation !== 'true') {
|
|
502
|
+
return output({
|
|
503
|
+
status: 'not_confirmed',
|
|
504
|
+
action: action.id,
|
|
505
|
+
editor: describeWorkspaceEditor(editor),
|
|
506
|
+
modelExecution: describeWorkspaceEditorModelExecution(editor.kind),
|
|
507
|
+
note: 'Type yes in the editor confirmation field before spending model tokens.',
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
const compareToolArgs = buildAgentModelCompareToolArgs(
|
|
511
|
+
fieldReader(editor, fields),
|
|
512
|
+
readString(args.explicitUserRequest) || 'Run the blind model comparison from an Agent workspace action.',
|
|
513
|
+
);
|
|
514
|
+
const result = await deps.toolRegistry.execute(
|
|
515
|
+
'agent-harness-workspace-model-compare',
|
|
516
|
+
'agent_model_compare',
|
|
517
|
+
compareToolArgs as unknown as Record<string, unknown>,
|
|
518
|
+
);
|
|
519
|
+
return output({
|
|
520
|
+
status: result.success ? 'executed_model_tool' : 'model_tool_failed',
|
|
521
|
+
action: action.id,
|
|
522
|
+
tool: 'agent_model_compare',
|
|
523
|
+
output: result.output ?? null,
|
|
524
|
+
error: result.error ?? null,
|
|
525
|
+
modelExecution: describeWorkspaceEditorModelExecution(editor.kind),
|
|
526
|
+
});
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
if (editor.kind === 'model-compare-review') {
|
|
530
|
+
const reviewToolArgs = buildAgentModelCompareReviewToolArgs(fieldReader(editor, fields));
|
|
531
|
+
const result = await deps.toolRegistry.execute(
|
|
532
|
+
'agent-harness-workspace-model-compare-review',
|
|
533
|
+
'agent_model_compare',
|
|
534
|
+
reviewToolArgs as unknown as Record<string, unknown>,
|
|
535
|
+
);
|
|
536
|
+
return output({
|
|
537
|
+
status: result.success ? 'executed_model_tool' : 'model_tool_failed',
|
|
538
|
+
action: action.id,
|
|
539
|
+
tool: 'agent_model_compare',
|
|
540
|
+
output: result.output ?? null,
|
|
541
|
+
error: result.error ?? null,
|
|
542
|
+
modelExecution: describeWorkspaceEditorModelExecution(editor.kind),
|
|
543
|
+
});
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
if (editor.kind === 'model-compare-handoff-diff') {
|
|
547
|
+
const handoffDiffArgs = buildAgentModelCompareHandoffDiffToolArgs(fieldReader(editor, fields));
|
|
548
|
+
const result = await deps.toolRegistry.execute(
|
|
549
|
+
'agent-harness-workspace-model-compare-handoff-diff',
|
|
550
|
+
'agent_model_compare',
|
|
551
|
+
handoffDiffArgs as unknown as Record<string, unknown>,
|
|
552
|
+
);
|
|
553
|
+
return output({
|
|
554
|
+
status: result.success ? 'executed_model_tool' : 'model_tool_failed',
|
|
555
|
+
action: action.id,
|
|
556
|
+
tool: 'agent_model_compare',
|
|
557
|
+
output: result.output ?? null,
|
|
558
|
+
error: result.error ?? null,
|
|
559
|
+
modelExecution: describeWorkspaceEditorModelExecution(editor.kind),
|
|
560
|
+
});
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
if (editor.kind === 'model-compare-judge') {
|
|
564
|
+
const confirmationError = requireConfirmedAction(args, 'Workspace comparison judgment');
|
|
565
|
+
if (confirmationError) return error(confirmationError);
|
|
566
|
+
const formConfirmation = fieldReader(editor, fields)('confirm').trim().toLowerCase();
|
|
567
|
+
if (formConfirmation !== 'yes' && formConfirmation !== 'true') {
|
|
568
|
+
return output({
|
|
569
|
+
status: 'not_confirmed',
|
|
570
|
+
action: action.id,
|
|
571
|
+
editor: describeWorkspaceEditor(editor),
|
|
572
|
+
modelExecution: describeWorkspaceEditorModelExecution(editor.kind),
|
|
573
|
+
note: 'Type yes in the editor confirmation field before saving the judgment artifact.',
|
|
574
|
+
});
|
|
575
|
+
}
|
|
576
|
+
const judgmentToolArgs = buildAgentModelCompareJudgmentToolArgs(
|
|
577
|
+
fieldReader(editor, fields),
|
|
578
|
+
readString(args.explicitUserRequest) || 'Save the blind model comparison judgment from an Agent workspace action.',
|
|
579
|
+
);
|
|
580
|
+
const result = await deps.toolRegistry.execute(
|
|
581
|
+
'agent-harness-workspace-model-compare-judge',
|
|
582
|
+
'agent_model_compare',
|
|
583
|
+
judgmentToolArgs as unknown as Record<string, unknown>,
|
|
584
|
+
);
|
|
585
|
+
return output({
|
|
586
|
+
status: result.success ? 'executed_model_tool' : 'model_tool_failed',
|
|
587
|
+
action: action.id,
|
|
588
|
+
tool: 'agent_model_compare',
|
|
589
|
+
output: result.output ?? null,
|
|
590
|
+
error: result.error ?? null,
|
|
591
|
+
modelExecution: describeWorkspaceEditorModelExecution(editor.kind),
|
|
592
|
+
});
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
if (editor.kind === 'model-compare-apply') {
|
|
596
|
+
const confirmationError = requireConfirmedAction(args, 'Workspace comparison route update');
|
|
597
|
+
if (confirmationError) return error(confirmationError);
|
|
598
|
+
const formConfirmation = fieldReader(editor, fields)('confirm').trim().toLowerCase();
|
|
599
|
+
if (formConfirmation !== 'yes' && formConfirmation !== 'true') {
|
|
600
|
+
return output({
|
|
601
|
+
status: 'not_confirmed',
|
|
602
|
+
action: action.id,
|
|
603
|
+
editor: describeWorkspaceEditor(editor),
|
|
604
|
+
modelExecution: describeWorkspaceEditorModelExecution(editor.kind),
|
|
605
|
+
note: 'Type yes in the editor confirmation field before applying the winning model route.',
|
|
606
|
+
});
|
|
607
|
+
}
|
|
608
|
+
const applyToolArgs = buildAgentModelCompareApplyToolArgs(
|
|
609
|
+
fieldReader(editor, fields),
|
|
610
|
+
readString(args.explicitUserRequest) || 'Apply the revealed blind model comparison judgment from an Agent workspace action.',
|
|
611
|
+
);
|
|
612
|
+
const result = await deps.toolRegistry.execute(
|
|
613
|
+
'agent-harness-workspace-model-compare-apply',
|
|
614
|
+
'agent_model_compare',
|
|
615
|
+
applyToolArgs as unknown as Record<string, unknown>,
|
|
616
|
+
);
|
|
617
|
+
return output({
|
|
618
|
+
status: result.success ? 'executed_model_tool' : 'model_tool_failed',
|
|
619
|
+
action: action.id,
|
|
620
|
+
tool: 'agent_model_compare',
|
|
621
|
+
output: result.output ?? null,
|
|
622
|
+
error: result.error ?? null,
|
|
623
|
+
modelExecution: describeWorkspaceEditorModelExecution(editor.kind),
|
|
624
|
+
});
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
if (editor.kind === 'model-compare-route-decision') {
|
|
628
|
+
const confirmationError = requireConfirmedAction(args, 'Workspace comparison route decision');
|
|
629
|
+
if (confirmationError) return error(confirmationError);
|
|
630
|
+
const formConfirmation = fieldReader(editor, fields)('confirm').trim().toLowerCase();
|
|
631
|
+
if (formConfirmation !== 'yes' && formConfirmation !== 'true') {
|
|
632
|
+
return output({
|
|
633
|
+
status: 'not_confirmed',
|
|
634
|
+
action: action.id,
|
|
635
|
+
editor: describeWorkspaceEditor(editor),
|
|
636
|
+
modelExecution: describeWorkspaceEditorModelExecution(editor.kind),
|
|
637
|
+
note: 'Type yes in the editor confirmation field before saving the route-decision receipt.',
|
|
638
|
+
});
|
|
639
|
+
}
|
|
640
|
+
const routeDecisionToolArgs = buildAgentModelCompareRouteDecisionToolArgs(
|
|
641
|
+
fieldReader(editor, fields),
|
|
642
|
+
readString(args.explicitUserRequest) || 'Record a leave-unchanged blind model comparison route decision from an Agent workspace action.',
|
|
643
|
+
);
|
|
644
|
+
const result = await deps.toolRegistry.execute(
|
|
645
|
+
'agent-harness-workspace-model-compare-route-decision',
|
|
646
|
+
'agent_model_compare',
|
|
647
|
+
routeDecisionToolArgs as unknown as Record<string, unknown>,
|
|
648
|
+
);
|
|
649
|
+
return output({
|
|
650
|
+
status: result.success ? 'executed_model_tool' : 'model_tool_failed',
|
|
651
|
+
action: action.id,
|
|
652
|
+
tool: 'agent_model_compare',
|
|
653
|
+
output: result.output ?? null,
|
|
654
|
+
error: result.error ?? null,
|
|
655
|
+
modelExecution: describeWorkspaceEditorModelExecution(editor.kind),
|
|
656
|
+
});
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
if (editor.kind === 'model-compare-export') {
|
|
660
|
+
const confirmationError = requireConfirmedAction(args, 'Workspace comparison export');
|
|
661
|
+
if (confirmationError) return error(confirmationError);
|
|
662
|
+
const formConfirmation = fieldReader(editor, fields)('confirm').trim().toLowerCase();
|
|
663
|
+
if (formConfirmation !== 'yes' && formConfirmation !== 'true') {
|
|
664
|
+
return output({
|
|
665
|
+
status: 'not_confirmed',
|
|
666
|
+
action: action.id,
|
|
667
|
+
editor: describeWorkspaceEditor(editor),
|
|
668
|
+
modelExecution: describeWorkspaceEditorModelExecution(editor.kind),
|
|
669
|
+
note: 'Type yes in the editor confirmation field before creating the markdown report artifact.',
|
|
670
|
+
});
|
|
671
|
+
}
|
|
672
|
+
const exportToolArgs = buildAgentModelCompareExportToolArgs(
|
|
673
|
+
fieldReader(editor, fields),
|
|
674
|
+
readString(args.explicitUserRequest) || 'Export the saved blind model comparison artifact from an Agent workspace action.',
|
|
675
|
+
);
|
|
676
|
+
const result = await deps.toolRegistry.execute(
|
|
677
|
+
'agent-harness-workspace-model-compare-export',
|
|
678
|
+
'agent_model_compare',
|
|
679
|
+
exportToolArgs as unknown as Record<string, unknown>,
|
|
680
|
+
);
|
|
681
|
+
return output({
|
|
682
|
+
status: result.success ? 'executed_model_tool' : 'model_tool_failed',
|
|
683
|
+
action: action.id,
|
|
684
|
+
tool: 'agent_model_compare',
|
|
685
|
+
output: result.output ?? null,
|
|
686
|
+
error: result.error ?? null,
|
|
687
|
+
modelExecution: describeWorkspaceEditorModelExecution(editor.kind),
|
|
688
|
+
});
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
if (editor.kind === 'model-compare-analytics') {
|
|
692
|
+
const analyticsToolArgs = buildAgentModelCompareAnalyticsToolArgs(fieldReader(editor, fields));
|
|
693
|
+
const result = await deps.toolRegistry.execute(
|
|
694
|
+
'agent-harness-workspace-model-compare-analytics',
|
|
695
|
+
'agent_model_compare',
|
|
696
|
+
analyticsToolArgs as unknown as Record<string, unknown>,
|
|
697
|
+
);
|
|
698
|
+
return output({
|
|
699
|
+
status: result.success ? 'executed_model_tool' : 'model_tool_failed',
|
|
700
|
+
action: action.id,
|
|
701
|
+
tool: 'agent_model_compare',
|
|
702
|
+
output: result.output ?? null,
|
|
703
|
+
error: result.error ?? null,
|
|
704
|
+
modelExecution: describeWorkspaceEditorModelExecution(editor.kind),
|
|
705
|
+
});
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
if (!isAgentWorkspaceCommandEditorKind(editor.kind)) {
|
|
709
|
+
if (
|
|
710
|
+
editor.kind === 'memory'
|
|
711
|
+
|| editor.kind === 'note'
|
|
712
|
+
|| editor.kind === 'persona'
|
|
713
|
+
|| editor.kind === 'skill'
|
|
714
|
+
|| editor.kind === 'routine'
|
|
715
|
+
) {
|
|
716
|
+
return runLocalWorkspaceEditorAction(deps, editor, args);
|
|
717
|
+
}
|
|
718
|
+
return output({
|
|
719
|
+
status: 'model_tool_required',
|
|
720
|
+
action: action.id,
|
|
721
|
+
editor: describeWorkspaceEditor(editor),
|
|
722
|
+
modelExecution: describeWorkspaceEditorModelExecution(editor.kind),
|
|
723
|
+
});
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
const submission = buildAgentWorkspaceCommandEditorSubmission(
|
|
727
|
+
editor,
|
|
728
|
+
fieldReader(editor, fields),
|
|
729
|
+
true,
|
|
730
|
+
true,
|
|
731
|
+
);
|
|
732
|
+
if (submission.kind === 'editor') {
|
|
733
|
+
return output({
|
|
734
|
+
status: submission.status,
|
|
735
|
+
action: action.id,
|
|
736
|
+
editor: describeWorkspaceEditor(submission.editor),
|
|
737
|
+
modelExecution: describeWorkspaceEditorModelExecution(editor.kind),
|
|
738
|
+
actionResult: submission.actionResult ?? null,
|
|
739
|
+
});
|
|
740
|
+
}
|
|
741
|
+
if (submission.kind === 'prompt') {
|
|
742
|
+
return output({
|
|
743
|
+
status: submission.status,
|
|
744
|
+
action: action.id,
|
|
745
|
+
prompt: submission.prompt,
|
|
746
|
+
actionResult: submission.actionResult,
|
|
747
|
+
modelExecution: describeWorkspaceEditorModelExecution(editor.kind),
|
|
748
|
+
note: 'This workspace action submits a normal main-conversation prompt in the TUI. In model-tool context, use the returned prompt as the conversation task instead of creating a hidden nested turn.',
|
|
749
|
+
});
|
|
750
|
+
}
|
|
751
|
+
return runCommand(deps, {
|
|
752
|
+
...args,
|
|
753
|
+
command: submission.command,
|
|
754
|
+
});
|
|
755
|
+
}
|