@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
|
@@ -1,131 +1,64 @@
|
|
|
1
1
|
import type { Tool } from '@pellux/goodvibes-sdk/platform/types';
|
|
2
2
|
import type { ToolRegistry } from '@pellux/goodvibes-sdk/platform/tools';
|
|
3
3
|
import type { CommandContext, CommandRegistry } from '../input/command-registry.ts';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import { channelReadinessCatalogStatus, describeHarnessChannel, listHarnessChannels } from './agent-harness-channel-metadata.ts';
|
|
4
|
+
import { agentOrchestrationCatalogStatus, agentOrchestrationSummary, describeAgentOrchestrationAgent } from './agent-harness-agent-orchestration.ts';
|
|
5
|
+
import { autonomyIntakeSummary } from './agent-harness-autonomy-intake.ts';
|
|
6
|
+
import { autonomyQueueCatalogStatus, autonomyQueueSummary, describeAutonomyQueueItem } from './agent-harness-autonomy-queue.ts';
|
|
7
|
+
import { channelReadinessCatalogStatus, describeHarnessChannel, describeHarnessChannelDeliveries, describeHarnessChannelSetupGuide, describeHarnessChannelTriage, listHarnessChannels } from './agent-harness-channel-metadata.ts';
|
|
9
8
|
import { blockedHarnessCliCommandTokens, describeHarnessCliCommand, listHarnessCliCommands, totalHarnessCliCommands } from './agent-harness-cli-metadata.ts';
|
|
10
|
-
import { describeHarnessCommand, listHarnessCommands
|
|
9
|
+
import { describeHarnessCommand, listHarnessCommands } from './agent-harness-command-catalog.ts';
|
|
10
|
+
import { describeLearningCandidate, learningCuratorCatalogStatus, learningCuratorSummary } from './agent-harness-learning-curator.ts';
|
|
11
11
|
import { delegationPostureCatalogStatus, delegationPostureSummary, describeHarnessDelegationRoute } from './agent-harness-delegation-posture.ts';
|
|
12
12
|
import { describeHarnessKeybinding, listHarnessKeybindings, listHarnessShortcuts, resetHarnessKeybinding, runHarnessKeybinding, setHarnessKeybinding, totalHarnessKeybindings, totalHarnessShortcuts } from './agent-harness-keybinding-metadata.ts';
|
|
13
13
|
import { describeHarnessMediaProvider, mediaPostureCatalogStatus, mediaPostureSummary } from './agent-harness-media-posture.ts';
|
|
14
14
|
import { describeHarnessNotificationTarget, listHarnessNotificationTargets, notificationTargetCatalogStatus } from './agent-harness-notification-metadata.ts';
|
|
15
15
|
import { describeHarnessPanel, listHarnessPanels, openHarnessPanel, totalHarnessPanels } from './agent-harness-panel-metadata.ts';
|
|
16
16
|
import { connectedHostStatusSummary } from './agent-harness-connected-host-status.ts';
|
|
17
|
-
import {
|
|
17
|
+
import { backgroundProcessCatalogStatus, backgroundProcessSummary, describeBackgroundProcess, runBackgroundProcessAction } from './agent-harness-background-processes.ts';
|
|
18
|
+
import { describeDocumentOpsLane, documentOpsCatalogStatus, documentOpsSummary } from './agent-harness-document-ops.ts';
|
|
19
|
+
import { browserControlRouteSummary } from './agent-harness-browser-control.ts';
|
|
20
|
+
import { describeExecutionHistoryItem, executionHistoryCatalogStatus, executionHistorySummary } from './agent-harness-execution-history.ts';
|
|
21
|
+
import { describeHarnessExecutionRoute, executionPostureCatalogStatus, executionPostureSummary } from './agent-harness-execution-posture.ts';
|
|
22
|
+
import { fileRecoveryCatalogStatus, fileRecoverySummary, runFileRecovery } from './agent-harness-file-recovery.ts';
|
|
18
23
|
import { describeHarnessMcpServer, mcpServerCatalogStatus, mcpServerSummary } from './agent-harness-mcp-metadata.ts';
|
|
19
|
-
import { describeHarnessModelRoute, modelRoutingCatalogStatus, modelRoutingSummary } from './agent-harness-model-routing.ts';
|
|
24
|
+
import { describeHarnessModelRoute, modelRoutingCatalogStatus, modelRoutingSummary, runLocalModelServerSmoke } from './agent-harness-model-routing.ts';
|
|
20
25
|
import { describeHarnessModelTool, listHarnessModelTools } from './agent-harness-model-tool-catalog.ts';
|
|
26
|
+
import { describeMemoryProvider, memoryPostureCatalogStatus, memoryPostureSummary } from './agent-harness-memory-posture.ts';
|
|
27
|
+
import { memoryRefinementCatalogStatus, memoryRefinementSummary, runMemoryRefinement } from './agent-harness-memory-refinement.ts';
|
|
21
28
|
import { describeHarnessOperatorMethod, operatorMethodCatalogStatus, operatorMethodSummary } from './agent-harness-operator-methods.ts';
|
|
29
|
+
import { describePersonalOpsLane, personalOpsBriefingSummary, personalOpsCatalogStatus, personalOpsIntakeSummary, personalOpsQueueSummary, personalOpsSummary, runPersonalOpsRead } from './agent-harness-personal-ops.ts';
|
|
22
30
|
import { describeHarnessPairingRoute, pairingPostureCatalogStatus, pairingPostureSummary } from './agent-harness-pairing-posture.ts';
|
|
31
|
+
import { explainAgentPolicyDecision } from './agent-policy-explanation.ts';
|
|
32
|
+
import { promptContextCatalogStatus, promptContextSummary } from './agent-harness-prompt-context.ts';
|
|
33
|
+
import { describeProjectContextFile, projectContextCatalogStatus, projectContextSummary } from './agent-harness-project-context.ts';
|
|
23
34
|
import { describeHarnessProviderAccount, providerAccountCatalogStatus, providerAccountSummary } from './agent-harness-provider-account-metadata.ts';
|
|
35
|
+
import { planAgentTaskRoute } from './agent-route-planner.ts';
|
|
24
36
|
import { describeHarnessReleaseEvidenceArtifact, releaseEvidenceBundleStatus, releaseEvidenceSummary } from './agent-harness-release-evidence.ts';
|
|
25
37
|
import { describeHarnessReleaseReadinessItem, releaseReadinessInventoryStatus, releaseReadinessSummary } from './agent-harness-release-readiness.ts';
|
|
38
|
+
import { researchBriefingCatalogStatus, researchBriefingSummary } from './agent-harness-research-briefing.ts';
|
|
39
|
+
import { describeResearchRun, researchRunsCatalogStatus, researchRunsSummary } from './agent-harness-research-runs.ts';
|
|
40
|
+
import { researchWorkflowSummary } from './agent-harness-research-workflow.ts';
|
|
41
|
+
import { describeResearchSource, researchQueueCatalogStatus, researchQueueSummary } from './agent-harness-research-queue.ts';
|
|
26
42
|
import { describeHarnessSecurityFinding, describeHarnessSupportBundle, securityPostureCatalogStatus, securityPostureSummary, supportBundleCatalogStatus, supportBundleSummary } from './agent-harness-security-posture.ts';
|
|
27
43
|
import { describeHarnessSession, sessionCatalogStatus, sessionSummary } from './agent-harness-session-metadata.ts';
|
|
28
44
|
import { describeHarnessServiceEndpoint, servicePostureCatalogStatus, servicePostureSummary } from './agent-harness-service-posture.ts';
|
|
29
|
-
import { describeHarnessSetupItem, setupPostureCatalogStatus, setupPostureSummary } from './agent-harness-setup-posture.ts';
|
|
45
|
+
import { clearSetupCheckpoint, describeHarnessSetupItem, markSetupCheckpoint, provisionConnectedHostOperatorToken, runSetupInstallSmoke, setupCheckpointSummary, setupPostureCatalogStatus, setupPostureSummary, setupRepairSummary } from './agent-harness-setup-posture.ts';
|
|
30
46
|
import { AGENT_HARNESS_MODES, AGENT_HARNESS_PARAMETER_PROPERTIES } from './agent-harness-tool-schema.ts';
|
|
47
|
+
import { runCommand } from './agent-harness-command-runner.ts';
|
|
48
|
+
import { runWorkspaceAction } from './agent-harness-workspace-action-runner.ts';
|
|
49
|
+
import type { AgentHarnessToolArgs, AgentHarnessToolDeps } from './agent-harness-tool-types.ts';
|
|
50
|
+
import { error, output, readLimit, readString, requireConfirmedAction, settingLookupArgs } from './agent-harness-tool-utils.ts';
|
|
31
51
|
import { describeHarnessMode, HARNESS_MODE_DESCRIPTORS, listHarnessModes, type AgentHarnessMode } from './agent-harness-mode-catalog.ts';
|
|
32
52
|
import { describeHarnessUiSurface, listHarnessUiSurfaces, openHarnessUiSurface, totalHarnessUiSurfaces } from './agent-harness-ui-surface-metadata.ts';
|
|
33
|
-
import { AGENT_WORKSPACE_CATEGORIES, allWorkspaceActions, buildWorkspaceEditorContext,
|
|
34
|
-
import { describeWorkspaceEditorModelExecution } from './agent-harness-workspace-editor-execution.ts';
|
|
53
|
+
import { AGENT_WORKSPACE_CATEGORIES, allWorkspaceActions, buildWorkspaceEditorContext, describeWorkspaceAction, describeWorkspaceCategory, listWorkspaceActions, resolveWorkspaceActionDetail } from './agent-harness-workspace-actions.ts';
|
|
35
54
|
import { connectedHostSummary, describeConnectedHostCapability, settingsPolicySummary } from './agent-harness-metadata.ts';
|
|
36
55
|
import { countHarnessSettings, formatHarnessError, listHarnessSettings, resetHarnessSetting, resolveHarnessSetting, setHarnessSetting } from '../agent/harness-control.ts';
|
|
37
|
-
|
|
38
|
-
interface AgentHarnessToolArgs {
|
|
39
|
-
readonly mode?: unknown;
|
|
40
|
-
readonly query?: unknown;
|
|
41
|
-
readonly command?: unknown;
|
|
42
|
-
readonly cliCommand?: unknown;
|
|
43
|
-
readonly commandName?: unknown;
|
|
44
|
-
readonly args?: unknown;
|
|
45
|
-
readonly channelId?: unknown;
|
|
46
|
-
readonly notificationTargetId?: unknown;
|
|
47
|
-
readonly providerId?: unknown;
|
|
48
|
-
readonly mcpServerId?: unknown;
|
|
49
|
-
readonly setupItemId?: unknown;
|
|
50
|
-
readonly modelRouteId?: unknown;
|
|
51
|
-
readonly pairingRouteId?: unknown;
|
|
52
|
-
readonly delegationRouteId?: unknown;
|
|
53
|
-
readonly findingId?: unknown;
|
|
54
|
-
readonly bundlePath?: unknown;
|
|
55
|
-
readonly mediaProviderId?: unknown;
|
|
56
|
-
readonly sessionId?: unknown;
|
|
57
|
-
readonly categoryId?: unknown;
|
|
58
|
-
readonly panelId?: unknown;
|
|
59
|
-
readonly actionId?: unknown;
|
|
60
|
-
readonly recordId?: unknown;
|
|
61
|
-
readonly fields?: unknown;
|
|
62
|
-
readonly combo?: unknown;
|
|
63
|
-
readonly combos?: unknown;
|
|
64
|
-
readonly surfaceId?: unknown;
|
|
65
|
-
readonly key?: unknown;
|
|
66
|
-
readonly value?: unknown;
|
|
67
|
-
readonly target?: unknown;
|
|
68
|
-
readonly artifactId?: unknown;
|
|
69
|
-
readonly itemId?: unknown;
|
|
70
|
-
readonly methodId?: unknown;
|
|
71
|
-
readonly endpointId?: unknown;
|
|
72
|
-
readonly capabilityId?: unknown;
|
|
73
|
-
readonly toolName?: unknown;
|
|
74
|
-
readonly category?: unknown;
|
|
75
|
-
readonly prefix?: unknown;
|
|
76
|
-
readonly includeHidden?: unknown;
|
|
77
|
-
readonly includeParameters?: unknown;
|
|
78
|
-
readonly limit?: unknown;
|
|
79
|
-
readonly pane?: unknown;
|
|
80
|
-
readonly confirm?: unknown;
|
|
81
|
-
readonly explicitUserRequest?: unknown;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
interface AgentHarnessToolDeps {
|
|
85
|
-
readonly commandRegistry: CommandRegistry;
|
|
86
|
-
readonly commandContext: CommandContext;
|
|
87
|
-
readonly toolRegistry: ToolRegistry;
|
|
88
|
-
}
|
|
56
|
+
import { buildAssistantCockpitFromSummaries } from '../agent/assistant-cockpit.ts';
|
|
89
57
|
|
|
90
58
|
function isMode(value: unknown): value is AgentHarnessMode {
|
|
91
59
|
return typeof value === 'string' && AGENT_HARNESS_MODES.includes(value as AgentHarnessMode);
|
|
92
60
|
}
|
|
93
61
|
|
|
94
|
-
function readString(value: unknown): string {
|
|
95
|
-
return typeof value === 'string' ? value.trim() : '';
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
function settingLookupArgs(args: AgentHarnessToolArgs) {
|
|
99
|
-
return {
|
|
100
|
-
key: readString(args.key) || undefined,
|
|
101
|
-
target: readString(args.target) || undefined,
|
|
102
|
-
query: readString(args.query) || undefined,
|
|
103
|
-
category: readString(args.category) || undefined,
|
|
104
|
-
prefix: readString(args.prefix) || undefined,
|
|
105
|
-
includeHidden: args.includeHidden === true,
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
function readLimit(value: unknown, fallback: number): number {
|
|
110
|
-
const parsed = typeof value === 'string' && value.trim() ? Number(value) : value;
|
|
111
|
-
if (typeof parsed !== 'number' || !Number.isFinite(parsed)) return fallback;
|
|
112
|
-
return Math.max(1, Math.min(500, Math.trunc(parsed)));
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
function readFieldMap(value: unknown): Readonly<Record<string, string>> {
|
|
116
|
-
if (typeof value !== 'object' || value === null || Array.isArray(value)) return {};
|
|
117
|
-
return Object.fromEntries(Object.entries(value).map(([key, entry]) => [key, typeof entry === 'string' ? entry : String(entry)]));
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
function output(value: unknown): { readonly success: true; readonly output: string } {
|
|
121
|
-
return {
|
|
122
|
-
success: true,
|
|
123
|
-
output: typeof value === 'string' ? value : JSON.stringify(value, null, 2),
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
function error(message: string): { readonly success: false; readonly error: string } { return { success: false, error: message }; }
|
|
128
|
-
|
|
129
62
|
function harnessModeIdsByKind(kind: AgentHarnessModeGuideKind): readonly AgentHarnessMode[] {
|
|
130
63
|
return HARNESS_MODE_DESCRIPTORS
|
|
131
64
|
.filter((descriptor) => descriptor.kind === kind)
|
|
@@ -147,254 +80,53 @@ function compactHarnessModeGuide(): Record<string, unknown> {
|
|
|
147
80
|
|
|
148
81
|
function detailedHarnessModelAccessGuide(): Record<string, string> {
|
|
149
82
|
return {
|
|
150
|
-
cliCommands: '
|
|
151
|
-
panels: '
|
|
152
|
-
uiSurfaces: '
|
|
153
|
-
shortcuts: '
|
|
154
|
-
slashCommands: '
|
|
155
|
-
channels: '
|
|
83
|
+
cliCommands: 'Prefer workspace action:"cli_commands|cli_command" for CLI discovery. Lower-level cli command modes remain available.',
|
|
84
|
+
panels: 'Prefer workspace action:"panels|panel|open_panel"; visible navigation needs confirm:true and explicitUserRequest.',
|
|
85
|
+
uiSurfaces: 'Prefer workspace action:"surfaces|surface|open" for visible UI and computer action:"browser|open_browser" for browser/PWA. Lower-level UI modes remain available.',
|
|
86
|
+
shortcuts: 'Prefer workspace action:"shortcuts|keybindings|keybinding|run_keybinding|set_keybinding|reset_keybinding"; effects need confirmation.',
|
|
87
|
+
slashCommands: 'Prefer workspace action:"commands|command|run_command"; slash-command execution needs confirmation.',
|
|
88
|
+
channels: 'Prefer channels action:"status|channel|setup|triage|deliveries"; deliver with agent_channel_send and confirmation. Lower-level channel harness modes remain available for detail.',
|
|
156
89
|
notifications: 'List mode:"notifications"; inspect mode:"notification_target"; deliver with agent_notify and confirmation.',
|
|
157
|
-
providerAccounts: '
|
|
90
|
+
providerAccounts: 'Prefer models action:"providers|provider" for account and subscription posture. Lower-level mode:"provider_accounts" and mode:"provider_account" remain available; auth changes stay confirmed workspace/command flows.',
|
|
158
91
|
mcpServers: 'List mode:"mcp_servers"; inspect mode:"mcp_server"; trust/server changes stay confirmed workspace/command flows.',
|
|
159
|
-
setupPosture: '
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
92
|
+
setupPosture: 'Prefer setup action:"status|item|repair|checkpoint|token|smoke|finish"; lower-level setup_* modes remain available for detailed harness inspection.',
|
|
93
|
+
routeDecision: 'Prefer route action:"plan" before choosing a specialized tool when the user task could map to setup, Personal Ops, research, autonomy, execution, delegation, computer/browser, workspace, host, or device routes.',
|
|
94
|
+
projectContext: 'Prefer context action:"files|file"; lower-level project_context modes remain available for detail. Context files are read-only and secret-scanned.',
|
|
95
|
+
promptContext: 'Prefer context action:"prompt|receipts|receipt" for prompt composition, selected/suppressed records, token budget, and prompt receipt outcomes.',
|
|
96
|
+
agentOrchestration: 'List mode:"agent_orchestration" for managed plan and closeout cards; dispatch approved plan items with agent_work_plan action:"dispatch_agents"; inspect mode:"agent_orchestration_agent"; spawn/message/wait/cancel stay on first-class agent.',
|
|
97
|
+
modelRouting: 'Prefer models action:"status|local|route|smoke" for model choice, local cookbook, route inspection, and confirmed local server checks. Lower-level mode:"model_routing", mode:"model_route", and mode:"run_local_model_smoke" remain available; changes stay visible.',
|
|
98
|
+
executionPosture: 'Prefer execution action:"status|route"; use computer action:"plan" for browser, screenshot, or desktop-control route planning; use local read/edit/exec when current workspace is sufficient, delegation for isolation/parallel/remote.',
|
|
99
|
+
backgroundProcesses: 'Use execution action:"processes|process|capabilities" to inspect tracked local commands and process parity, terminal background:true to start visible tracked commands, and process action:list|poll|log|wait|kill|write to manage them. Lower-level background_* modes remain for compatibility. process action:"capabilities" probes SDK/daemon interactive contracts; write dispatches only when a safe ProcessManager stdin method exists and is explicitly confirmed; PTY/sudo stay typed-contract or foreground-only boundaries.',
|
|
100
|
+
executionHistory: 'Prefer execution action:"history|record" for activity cards and records; use returned verification, supervision, and recovery routes.',
|
|
101
|
+
fileRecovery: 'Prefer execution action:"recovery"; apply local file undo/redo snapshots with mode:"run_file_recovery" and confirmation.',
|
|
102
|
+
personalOps: 'Prefer personal_ops action:"briefing|status|queue|intake|lane|read"; lower-level modes personal_ops_briefing/personal_ops/personal_ops_queue/personal_ops_intake/personal_ops_lane/run_personal_ops_read remain available for harness inspection.',
|
|
103
|
+
memoryPosture: 'Prefer memory action:"status|provider|refinement|run_refinement|curator|candidate|list|search|get"; run_refinement, memory writes, vector rebuilds, and embedding-provider changes stay on confirmed existing routes.',
|
|
104
|
+
autonomyQueue: 'Prefer autonomy action:"intake|queue|item" for ongoing work and visible autonomous work; lower-level autonomy_* modes remain available for detail. Effects stay confirmed on the owning route.',
|
|
105
|
+
learningCurator: 'Prefer memory action:"curator|candidate"; writes stay on reviewed Agent-local routes.',
|
|
106
|
+
researchWorkflow: 'Prefer research action:"briefing" for the current next-action queue, action:"plan" for deep-research route planning, action:"search" for bounded public source candidates, and action:"runner" for browser-runner readiness; lower-level mode:"research_workflow" sequences visible run, web/fetch or browser posture, source queue, report, and Knowledge promotion routes.',
|
|
107
|
+
researchRuns: 'Prefer research action:"runs|run"; lower-level mode:"research_runs" and mode:"research_run" inspect run posture; checkpoint/cancel/complete stays confirmed.',
|
|
108
|
+
researchQueue: 'Prefer research action:"sources|source|bundle|reports|report_artifact"; lower-level research modes inspect source posture; capture/review/report/ingest stay confirmed.',
|
|
109
|
+
documentOps: 'List mode:"document_ops"; inspect mode:"document_ops_lane"; browse saved artifacts with agent_artifacts; use returned routes for documents, review packet wizard, reviewer readiness, uploads, exports, source checks, artifacts, and blind compare.',
|
|
110
|
+
pairingPosture: 'Prefer device action:"status|capability" for device maps. Lower-level mode:"pairing_posture" and mode:"pairing_route" remain available; raw token/QR and pairing effects stay visible user flows.',
|
|
111
|
+
delegationPosture: 'Prefer delegation action:"status|routes|route"; delegated submission stays confirmed visible flow.',
|
|
112
|
+
securityPosture: 'Prefer security action:"status|finding|explain"; lower-level security modes remain available for detail.',
|
|
113
|
+
supportBundles: 'Prefer support action:"status|bundle"; lower-level support-bundle modes remain available; export/import stays confirmation-gated.',
|
|
114
|
+
mediaPosture: 'Prefer device action:"voice|provider" for voice/media posture. Lower-level mode:"media_posture" and mode:"media_provider" remain available; generate with agent_media_generate and confirmation.',
|
|
115
|
+
sessions: 'Prefer sessions action:"list|get"; lower-level session modes remain available; save/resume/export/delete stays visible confirmed flow.',
|
|
116
|
+
workspace: 'Prefer workspace action:"status|actions|action|run|surfaces|surface|open|commands|command|run_command"; includeParameters:true inlines editor schemas.',
|
|
117
|
+
settings: 'Prefer settings action:"list|get|set|reset|import"; list accepts category|prefix|query|includeHidden:true; lower-level settings modes remain for compatibility.',
|
|
169
118
|
tools: 'List mode:"tools" with query|limit|includeParameters:true; inspect mode:"tool" with toolName|target|query.',
|
|
170
119
|
modeCatalog: 'Search mode:"modes" with query|target; inspect one contract with mode:"mode" target:"...".',
|
|
171
|
-
releaseEvidence: 'Operator/audit:
|
|
172
|
-
releaseReadiness: 'Operator/audit:
|
|
173
|
-
operatorMethods: '
|
|
174
|
-
servicePosture: '
|
|
175
|
-
connectedHost: '
|
|
176
|
-
connectedHostStatus: '
|
|
177
|
-
daemon: 'Daemon aliases route to
|
|
120
|
+
releaseEvidence: 'Operator/audit: prefer audit action:"evidence|artifact"; includeParameters:true inlines artifact detail.',
|
|
121
|
+
releaseReadiness: 'Operator/audit: prefer audit action:"readiness|item"; includeParameters:true inlines item detail.',
|
|
122
|
+
operatorMethods: 'Prefer host action:"methods|method"; lower-level mode:"operator_methods|operator_method" remains for detail. Run exact daemon methods with agent_operator_method; write/admin routes require confirmation.',
|
|
123
|
+
servicePosture: 'Prefer host action:"services|service"; lower-level mode:"service_posture|service_endpoint" remains for probes and redacted log tail.',
|
|
124
|
+
connectedHost: 'Prefer host action:"capabilities|capability"; lower-level mode:"connected_host|connected_host_capability" remains for route-family detail.',
|
|
125
|
+
connectedHostStatus: 'Prefer host action:"status" for host reachability, token posture, and Knowledge readiness.',
|
|
126
|
+
daemon: 'Daemon aliases route to host action:"capabilities|status"; use agent_operator_method for exact confirmed contract calls.',
|
|
178
127
|
};
|
|
179
128
|
}
|
|
180
129
|
|
|
181
|
-
function requireConfirmedAction(args: AgentHarnessToolArgs, action: string): string | null {
|
|
182
|
-
const explicitUserRequest = readString(args.explicitUserRequest);
|
|
183
|
-
if (!explicitUserRequest) return `${action} requires explicitUserRequest with the user's exact request or a short faithful summary.`;
|
|
184
|
-
if (args.confirm !== true) return `${action} requires confirm:true after an explicit user request.`;
|
|
185
|
-
return null;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
function invocationArgsFromLookup(lookup: CommandDetailLookup): readonly string[] {
|
|
189
|
-
return lookup.resolvedBy === 'description' ? [] : lookup.parsedArgs;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
function safeCommandDisplay(name: string): string {
|
|
193
|
-
return `/${name}`;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
async function runCommand(deps: AgentHarnessToolDeps, args: AgentHarnessToolArgs): Promise<{ readonly success: boolean; readonly output?: string; readonly error?: string }> {
|
|
197
|
-
const confirmationError = requireConfirmedAction(args, 'Slash command invocation');
|
|
198
|
-
if (confirmationError) return error(confirmationError);
|
|
199
|
-
const resolved = resolveHarnessCommandDetail(deps.commandRegistry, args);
|
|
200
|
-
if (resolved?.status === 'ambiguous') {
|
|
201
|
-
return error(`Ambiguous slash command ${resolved.input}. Candidates: ${JSON.stringify(resolved.candidates)}`);
|
|
202
|
-
}
|
|
203
|
-
if (!resolved) return error('run_command requires a valid command, commandName, target, or query. Use mode:"commands" to inspect available commands.');
|
|
204
|
-
|
|
205
|
-
const printed: string[] = [];
|
|
206
|
-
const toolContext: CommandContext = {
|
|
207
|
-
...deps.commandContext,
|
|
208
|
-
print: (text: string) => {
|
|
209
|
-
printed.push(text);
|
|
210
|
-
},
|
|
211
|
-
renderRequest: () => {},
|
|
212
|
-
executeCommand: async (name: string, commandArgs: string[]) => {
|
|
213
|
-
return deps.commandRegistry.execute(name, commandArgs, toolContext);
|
|
214
|
-
},
|
|
215
|
-
};
|
|
216
|
-
const commandArgs = invocationArgsFromLookup(resolved.lookup);
|
|
217
|
-
const handled = await deps.commandRegistry.execute(resolved.command.name, [...commandArgs], toolContext);
|
|
218
|
-
if (!handled) return error(`Unknown slash command /${resolved.command.name}.`);
|
|
219
|
-
return output([
|
|
220
|
-
`Command ${safeCommandDisplay(resolved.command.name)} completed.`,
|
|
221
|
-
`Resolved by ${resolved.lookup.source} ${resolved.lookup.resolvedBy}.`,
|
|
222
|
-
printed.length > 0 ? printed.join('\n') : '(no text output)',
|
|
223
|
-
].join('\n'));
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
function fieldReader(editor: AgentWorkspaceLocalEditor, fields: Readonly<Record<string, string>>): (fieldId: string) => string {
|
|
227
|
-
return (fieldId: string) => fields[fieldId] ?? editor.fields.find((field) => field.id === fieldId)?.value ?? '';
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
function missingRequiredEditorFields(editor: AgentWorkspaceLocalEditor, fields: Readonly<Record<string, string>>): readonly string[] {
|
|
231
|
-
const readField = fieldReader(editor, fields);
|
|
232
|
-
return editor.fields
|
|
233
|
-
.filter((field) => field.required && !readField(field.id).trim())
|
|
234
|
-
.map((field) => field.id);
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
async function runWorkspaceEditorAction(
|
|
238
|
-
deps: AgentHarnessToolDeps,
|
|
239
|
-
action: AgentWorkspaceAction,
|
|
240
|
-
editor: AgentWorkspaceLocalEditor,
|
|
241
|
-
args: AgentHarnessToolArgs,
|
|
242
|
-
): Promise<{ readonly success: boolean; readonly output?: string; readonly error?: string }> {
|
|
243
|
-
const fields = readFieldMap(args.fields);
|
|
244
|
-
const missing = missingRequiredEditorFields(editor, fields);
|
|
245
|
-
if (missing.length > 0) {
|
|
246
|
-
return output({
|
|
247
|
-
status: 'missing_required_fields',
|
|
248
|
-
missing,
|
|
249
|
-
action: action.id,
|
|
250
|
-
editor: describeWorkspaceEditor(editor),
|
|
251
|
-
modelExecution: describeWorkspaceEditorModelExecution(editor.kind),
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
if (editor.kind === 'learned-behavior') {
|
|
256
|
-
const confirmationError = requireConfirmedAction(args, 'Workspace learned-behavior capture');
|
|
257
|
-
if (confirmationError) return error(confirmationError);
|
|
258
|
-
const shellPaths = deps.commandContext.workspace.shellPaths;
|
|
259
|
-
if (!shellPaths) return error('Agent shell paths are unavailable.');
|
|
260
|
-
const readField = fieldReader(editor, fields);
|
|
261
|
-
const target = readField('target').trim().toLowerCase();
|
|
262
|
-
if (target !== 'skill' && target !== 'routine' && target !== 'persona') {
|
|
263
|
-
return error('learned-behavior target must be skill, routine, or persona.');
|
|
264
|
-
}
|
|
265
|
-
const created = createAgentWorkspaceLearnedBehavior(shellPaths, {
|
|
266
|
-
target,
|
|
267
|
-
name: readField('name'),
|
|
268
|
-
description: readField('description'),
|
|
269
|
-
notes: readField('notes'),
|
|
270
|
-
tags: splitList(readField('tags')),
|
|
271
|
-
triggers: splitList(readField('triggers')),
|
|
272
|
-
enable: isAffirmative(readField('enable')),
|
|
273
|
-
});
|
|
274
|
-
return output({
|
|
275
|
-
status: 'created',
|
|
276
|
-
kind: created.kind,
|
|
277
|
-
id: created.id,
|
|
278
|
-
name: created.name,
|
|
279
|
-
policy: 'Agent-local behavior only; no connected-host mutation, default knowledge write, or delegated job was created.',
|
|
280
|
-
});
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
if (editor.kind === 'profile') {
|
|
284
|
-
const readField = fieldReader(editor, fields);
|
|
285
|
-
const name = readField('name');
|
|
286
|
-
const template = readField('template');
|
|
287
|
-
const parts = ['/agent-profile', 'create', name];
|
|
288
|
-
if (template.trim() && template.trim().toLowerCase() !== 'none') parts.push('--template', template);
|
|
289
|
-
parts.push('--yes');
|
|
290
|
-
return runCommand(deps, {
|
|
291
|
-
...args,
|
|
292
|
-
command: parts.map((part, index) => index < 2 || part.startsWith('--') ? part : JSON.stringify(part)).join(' '),
|
|
293
|
-
});
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
if (!isAgentWorkspaceCommandEditorKind(editor.kind)) {
|
|
297
|
-
if (
|
|
298
|
-
editor.kind === 'memory'
|
|
299
|
-
|| editor.kind === 'note'
|
|
300
|
-
|| editor.kind === 'persona'
|
|
301
|
-
|| editor.kind === 'skill'
|
|
302
|
-
|| editor.kind === 'routine'
|
|
303
|
-
) {
|
|
304
|
-
return runLocalWorkspaceEditorAction(deps, editor, args);
|
|
305
|
-
}
|
|
306
|
-
return output({
|
|
307
|
-
status: 'model_tool_required',
|
|
308
|
-
action: action.id,
|
|
309
|
-
editor: describeWorkspaceEditor(editor),
|
|
310
|
-
modelExecution: describeWorkspaceEditorModelExecution(editor.kind),
|
|
311
|
-
});
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
const submission = buildAgentWorkspaceCommandEditorSubmission(
|
|
315
|
-
editor,
|
|
316
|
-
fieldReader(editor, fields),
|
|
317
|
-
true,
|
|
318
|
-
true,
|
|
319
|
-
);
|
|
320
|
-
if (submission.kind === 'editor') {
|
|
321
|
-
return output({
|
|
322
|
-
status: submission.status,
|
|
323
|
-
action: action.id,
|
|
324
|
-
editor: describeWorkspaceEditor(submission.editor),
|
|
325
|
-
modelExecution: describeWorkspaceEditorModelExecution(editor.kind),
|
|
326
|
-
actionResult: submission.actionResult ?? null,
|
|
327
|
-
});
|
|
328
|
-
}
|
|
329
|
-
if (submission.kind === 'prompt') {
|
|
330
|
-
return output({
|
|
331
|
-
status: submission.status,
|
|
332
|
-
action: action.id,
|
|
333
|
-
prompt: submission.prompt,
|
|
334
|
-
actionResult: submission.actionResult,
|
|
335
|
-
modelExecution: describeWorkspaceEditorModelExecution(editor.kind),
|
|
336
|
-
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.',
|
|
337
|
-
});
|
|
338
|
-
}
|
|
339
|
-
return runCommand(deps, {
|
|
340
|
-
...args,
|
|
341
|
-
command: submission.command,
|
|
342
|
-
});
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
async function runWorkspaceAction(
|
|
346
|
-
deps: AgentHarnessToolDeps,
|
|
347
|
-
args: AgentHarnessToolArgs,
|
|
348
|
-
): Promise<{ readonly success: boolean; readonly output?: string; readonly error?: string }> {
|
|
349
|
-
const resolved = resolveWorkspaceActionDetail(args);
|
|
350
|
-
if (resolved?.status === 'ambiguous') return error(`Ambiguous Agent workspace action ${resolved.input}. Candidates: ${JSON.stringify(resolved.candidates)}`);
|
|
351
|
-
if (!resolved) return error('run_workspace_action requires a valid actionId, command, target, or query. Use mode:"workspace_actions" to inspect available actions.');
|
|
352
|
-
const { category, action, lookup } = resolved;
|
|
353
|
-
|
|
354
|
-
if (action.safety === 'blocked') {
|
|
355
|
-
return error(`Workspace action ${action.id} is blocked in Agent: ${action.detail}`);
|
|
356
|
-
}
|
|
357
|
-
if (action.kind === 'guidance') {
|
|
358
|
-
const editorContext = buildWorkspaceEditorContext(deps.commandContext, args);
|
|
359
|
-
return output({
|
|
360
|
-
status: 'guidance',
|
|
361
|
-
action: describeWorkspaceAction(category, action, { includeEditor: true, editorContext, lookup }),
|
|
362
|
-
});
|
|
363
|
-
}
|
|
364
|
-
if (action.kind === 'workspace' && action.targetCategoryId) {
|
|
365
|
-
const target = AGENT_WORKSPACE_CATEGORIES.find((entry) => entry.id === action.targetCategoryId);
|
|
366
|
-
return output({
|
|
367
|
-
status: 'workspace_target',
|
|
368
|
-
action: describeWorkspaceAction(category, action, { lookup }),
|
|
369
|
-
targetCategory: target ? describeWorkspaceCategory(target) : action.targetCategoryId,
|
|
370
|
-
targetActions: target ? target.actions.map((entry) => describeWorkspaceAction(target, entry)).slice(0, 40) : [],
|
|
371
|
-
});
|
|
372
|
-
}
|
|
373
|
-
if (action.kind === 'command' && action.command) {
|
|
374
|
-
if (/<[^>\s]+(?:\s+[^>]*)?>/.test(action.command)) {
|
|
375
|
-
return output({
|
|
376
|
-
status: 'needs_concrete_command',
|
|
377
|
-
action: describeWorkspaceAction(category, action, { lookup }),
|
|
378
|
-
note: 'This workspace action is a command template. Provide concrete values with mode:"run_command" once the exact command is known.',
|
|
379
|
-
});
|
|
380
|
-
}
|
|
381
|
-
return runCommand(deps, { ...args, command: action.command });
|
|
382
|
-
}
|
|
383
|
-
if (action.kind === 'editor' && action.editorKind) {
|
|
384
|
-
const editor = createWorkspaceEditor(action.editorKind, buildWorkspaceEditorContext(deps.commandContext, args));
|
|
385
|
-
if (!editor) return error(`No workspace editor route exists for ${action.editorKind}.`);
|
|
386
|
-
return runWorkspaceEditorAction(deps, action, editor, args);
|
|
387
|
-
}
|
|
388
|
-
if (action.kind === 'local-selection' || action.kind === 'local-operation') {
|
|
389
|
-
return runLocalWorkspaceAction(deps, action, args);
|
|
390
|
-
}
|
|
391
|
-
const editorContext = buildWorkspaceEditorContext(deps.commandContext, args);
|
|
392
|
-
return output({
|
|
393
|
-
status: 'no_direct_effect',
|
|
394
|
-
action: describeWorkspaceAction(category, action, { includeEditor: true, editorContext, lookup }),
|
|
395
|
-
});
|
|
396
|
-
}
|
|
397
|
-
|
|
398
130
|
export function createAgentHarnessTool(deps: AgentHarnessToolDeps): Tool {
|
|
399
131
|
return {
|
|
400
132
|
definition: {
|
|
@@ -414,7 +146,71 @@ export function createAgentHarnessTool(deps: AgentHarnessToolDeps): Tool {
|
|
|
414
146
|
if (!isMode(args.mode)) return error(`Unknown agent_harness mode: ${String(args.mode)}`);
|
|
415
147
|
try {
|
|
416
148
|
if (args.mode === 'summary') {
|
|
149
|
+
const channelReadiness = channelReadinessCatalogStatus(deps.commandContext);
|
|
150
|
+
const notificationTargets = notificationTargetCatalogStatus(deps.commandContext);
|
|
151
|
+
const providerAccounts = await providerAccountCatalogStatus(deps.commandContext).catch((err) => ({
|
|
152
|
+
modes: ['provider_accounts', 'provider_account'],
|
|
153
|
+
status: 'unavailable',
|
|
154
|
+
error: formatHarnessError(err),
|
|
155
|
+
}));
|
|
156
|
+
const mcpServers = mcpServerCatalogStatus(deps.commandContext);
|
|
157
|
+
const setupPosture = await setupPostureCatalogStatus(deps.commandContext).catch((err) => ({
|
|
158
|
+
modes: ['setup_posture', 'setup_item', 'setup_repair', 'setup_checkpoint', 'mark_setup_checkpoint', 'clear_setup_checkpoint', 'provision_connected_host_token', 'run_setup_smoke'],
|
|
159
|
+
status: 'unavailable',
|
|
160
|
+
error: formatHarnessError(err),
|
|
161
|
+
}));
|
|
162
|
+
const projectContext = projectContextCatalogStatus(deps.commandContext);
|
|
163
|
+
const promptContext = promptContextCatalogStatus(deps.commandContext);
|
|
164
|
+
const agentOrchestration = agentOrchestrationCatalogStatus(deps.commandContext, deps.toolRegistry);
|
|
165
|
+
const modelRouting = await modelRoutingCatalogStatus(deps.commandContext).catch((err) => ({
|
|
166
|
+
modes: ['model_routing', 'model_route'],
|
|
167
|
+
status: 'unavailable',
|
|
168
|
+
error: formatHarnessError(err),
|
|
169
|
+
}));
|
|
170
|
+
const executionPosture = executionPostureCatalogStatus(deps.commandContext, deps.toolRegistry);
|
|
171
|
+
const backgroundProcesses = backgroundProcessCatalogStatus(deps.commandContext);
|
|
172
|
+
const executionHistory = executionHistoryCatalogStatus(deps.commandContext);
|
|
173
|
+
const fileRecovery = fileRecoveryCatalogStatus(deps.commandContext);
|
|
174
|
+
const personalOps = personalOpsCatalogStatus(deps.commandContext);
|
|
175
|
+
const memoryPosture = await memoryPostureCatalogStatus(deps.commandContext).catch((err) => ({
|
|
176
|
+
modes: ['memory_posture', 'memory_provider'],
|
|
177
|
+
status: 'unavailable',
|
|
178
|
+
error: formatHarnessError(err),
|
|
179
|
+
}));
|
|
180
|
+
const memoryRefinement = memoryRefinementCatalogStatus(deps.commandContext);
|
|
181
|
+
const autonomyQueue = autonomyQueueCatalogStatus(deps.commandContext);
|
|
182
|
+
const learningCurator = learningCuratorCatalogStatus(deps.commandContext);
|
|
183
|
+
const researchBriefing = researchBriefingCatalogStatus(deps.commandContext);
|
|
184
|
+
const researchRuns = researchRunsCatalogStatus(deps.commandContext);
|
|
185
|
+
const researchQueue = researchQueueCatalogStatus(deps.commandContext);
|
|
186
|
+
const documentOps = documentOpsCatalogStatus(deps.commandContext);
|
|
187
|
+
const pairingPosture = pairingPostureCatalogStatus(deps.commandContext);
|
|
188
|
+
const delegationPosture = delegationPostureCatalogStatus(deps.commandContext);
|
|
189
|
+
const securityPosture = securityPostureCatalogStatus(deps.commandContext);
|
|
190
|
+
const supportBundles = supportBundleCatalogStatus();
|
|
191
|
+
const mediaPosture = mediaPostureCatalogStatus(deps.commandContext);
|
|
192
|
+
const sessions = sessionCatalogStatus(deps.commandContext);
|
|
193
|
+
const releaseEvidence = releaseEvidenceBundleStatus();
|
|
194
|
+
const releaseReadiness = releaseReadinessInventoryStatus();
|
|
195
|
+
const operatorMethods = operatorMethodCatalogStatus();
|
|
196
|
+
const servicePosture = servicePostureCatalogStatus();
|
|
197
|
+
const connectedHost = connectedHostSummary(deps.commandContext, deps.toolRegistry, {
|
|
198
|
+
includeParameters: args.includeParameters === true,
|
|
199
|
+
});
|
|
417
200
|
return output({
|
|
201
|
+
assistant: buildAssistantCockpitFromSummaries({
|
|
202
|
+
setupPosture,
|
|
203
|
+
projectContext,
|
|
204
|
+
agentOrchestration,
|
|
205
|
+
modelRouting,
|
|
206
|
+
executionPosture,
|
|
207
|
+
backgroundProcesses,
|
|
208
|
+
personalOps,
|
|
209
|
+
autonomyQueue,
|
|
210
|
+
researchRuns,
|
|
211
|
+
documentOps,
|
|
212
|
+
securityPosture,
|
|
213
|
+
}),
|
|
418
214
|
harnessModes: HARNESS_MODE_DESCRIPTORS.length,
|
|
419
215
|
cliCommands: totalHarnessCliCommands(),
|
|
420
216
|
blockedCliCommandTokens: blockedHarnessCliCommandTokens(),
|
|
@@ -423,44 +219,46 @@ export function createAgentHarnessTool(deps: AgentHarnessToolDeps): Tool {
|
|
|
423
219
|
shortcuts: totalHarnessShortcuts(deps.commandContext),
|
|
424
220
|
keybindings: totalHarnessKeybindings(deps.commandContext),
|
|
425
221
|
commands: deps.commandRegistry.list().length,
|
|
426
|
-
channelReadiness
|
|
427
|
-
notificationTargets
|
|
428
|
-
providerAccounts
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
222
|
+
channelReadiness,
|
|
223
|
+
notificationTargets,
|
|
224
|
+
providerAccounts,
|
|
225
|
+
mcpServers,
|
|
226
|
+
setupPosture,
|
|
227
|
+
projectContext,
|
|
228
|
+
promptContext,
|
|
229
|
+
agentOrchestration,
|
|
230
|
+
modelRouting,
|
|
231
|
+
executionPosture,
|
|
232
|
+
backgroundProcesses,
|
|
233
|
+
executionHistory,
|
|
234
|
+
fileRecovery,
|
|
235
|
+
personalOps,
|
|
236
|
+
memoryPosture,
|
|
237
|
+
memoryRefinement,
|
|
238
|
+
autonomyQueue,
|
|
239
|
+
learningCurator,
|
|
240
|
+
researchBriefing,
|
|
241
|
+
researchRuns,
|
|
242
|
+
researchQueue,
|
|
243
|
+
documentOps,
|
|
244
|
+
pairingPosture,
|
|
245
|
+
delegationPosture,
|
|
246
|
+
securityPosture,
|
|
247
|
+
supportBundles,
|
|
248
|
+
mediaPosture,
|
|
249
|
+
sessions,
|
|
450
250
|
settings: deps.commandContext.platform.configManager.getSchema().length,
|
|
451
251
|
workspaceCategories: AGENT_WORKSPACE_CATEGORIES.length,
|
|
452
252
|
workspaceActions: allWorkspaceActions().length,
|
|
453
253
|
tools: deps.toolRegistry.getToolDefinitions().length,
|
|
454
|
-
releaseEvidence
|
|
455
|
-
releaseReadiness
|
|
456
|
-
operatorMethods
|
|
457
|
-
servicePosture
|
|
254
|
+
releaseEvidence,
|
|
255
|
+
releaseReadiness,
|
|
256
|
+
operatorMethods,
|
|
257
|
+
servicePosture,
|
|
458
258
|
modeGuide: compactHarnessModeGuide(),
|
|
459
259
|
...(args.includeParameters === true ? { modelAccess: detailedHarnessModelAccessGuide() } : {}),
|
|
460
260
|
settingsPolicy: settingsPolicySummary(),
|
|
461
|
-
connectedHost
|
|
462
|
-
includeParameters: args.includeParameters === true,
|
|
463
|
-
}),
|
|
261
|
+
connectedHost,
|
|
464
262
|
});
|
|
465
263
|
}
|
|
466
264
|
if (args.mode === 'modes') return output(listHarnessModes(args));
|
|
@@ -470,6 +268,7 @@ export function createAgentHarnessTool(deps: AgentHarnessToolDeps): Tool {
|
|
|
470
268
|
if (mode.status === 'missing_lookup') return error(String(mode.usage));
|
|
471
269
|
return output(mode.mode);
|
|
472
270
|
}
|
|
271
|
+
if (args.mode === 'route_decision') return output(planAgentTaskRoute(deps.commandContext, args));
|
|
473
272
|
if (args.mode === 'cli_commands') {
|
|
474
273
|
const commands = listHarnessCliCommands(args);
|
|
475
274
|
return output({
|
|
@@ -551,6 +350,14 @@ export function createAgentHarnessTool(deps: AgentHarnessToolDeps): Tool {
|
|
|
551
350
|
if (resolved.status === 'ambiguous') return error(`Ambiguous channel ${resolved.input}. Candidates: ${JSON.stringify(resolved.candidates)}`);
|
|
552
351
|
return error(resolved.usage);
|
|
553
352
|
}
|
|
353
|
+
if (args.mode === 'channel_setup_guide') {
|
|
354
|
+
const resolved = describeHarnessChannelSetupGuide(deps.commandContext, args);
|
|
355
|
+
if (resolved.status === 'found') return output(resolved.guide);
|
|
356
|
+
if (resolved.status === 'ambiguous') return error(`Ambiguous channel setup guide target ${resolved.input}. Candidates: ${JSON.stringify(resolved.candidates)}`);
|
|
357
|
+
return error(resolved.usage);
|
|
358
|
+
}
|
|
359
|
+
if (args.mode === 'channel_triage') return output(await describeHarnessChannelTriage(deps.commandContext, args));
|
|
360
|
+
if (args.mode === 'channel_deliveries') return output(describeHarnessChannelDeliveries(deps.commandContext, args));
|
|
554
361
|
if (args.mode === 'notifications') return output(listHarnessNotificationTargets(deps.commandContext, args));
|
|
555
362
|
if (args.mode === 'notification_target') {
|
|
556
363
|
const resolved = describeHarnessNotificationTarget(deps.commandContext, args);
|
|
@@ -579,6 +386,49 @@ export function createAgentHarnessTool(deps: AgentHarnessToolDeps): Tool {
|
|
|
579
386
|
if (resolved.status === 'ambiguous') return error(`Ambiguous setup item ${resolved.input}. Candidates: ${JSON.stringify(resolved.candidates)}`);
|
|
580
387
|
return error(resolved.usage);
|
|
581
388
|
}
|
|
389
|
+
if (args.mode === 'setup_repair') return output(await setupRepairSummary(deps.commandContext, args));
|
|
390
|
+
if (args.mode === 'setup_checkpoint') return output(await setupCheckpointSummary(deps.commandContext));
|
|
391
|
+
if (args.mode === 'mark_setup_checkpoint') {
|
|
392
|
+
const confirmationError = requireConfirmedAction(args, 'Setup wizard checkpoint save');
|
|
393
|
+
if (confirmationError) return error(confirmationError);
|
|
394
|
+
return output(await markSetupCheckpoint(deps.commandContext, args));
|
|
395
|
+
}
|
|
396
|
+
if (args.mode === 'clear_setup_checkpoint') {
|
|
397
|
+
const confirmationError = requireConfirmedAction(args, 'Setup wizard checkpoint clear');
|
|
398
|
+
if (confirmationError) return error(confirmationError);
|
|
399
|
+
return output(clearSetupCheckpoint(deps.commandContext, args));
|
|
400
|
+
}
|
|
401
|
+
if (args.mode === 'project_context') return output(projectContextSummary(deps.commandContext, args));
|
|
402
|
+
if (args.mode === 'project_context_file') {
|
|
403
|
+
const resolved = describeProjectContextFile(deps.commandContext, args);
|
|
404
|
+
if (resolved.status === 'found') return output(resolved.file);
|
|
405
|
+
if (resolved.status === 'ambiguous') return error(`Ambiguous project context file ${resolved.input}. Candidates: ${JSON.stringify(resolved.candidates)}`);
|
|
406
|
+
return error(resolved.usage);
|
|
407
|
+
}
|
|
408
|
+
if (args.mode === 'prompt_context') return output(promptContextSummary(deps.commandContext, args));
|
|
409
|
+
if (args.mode === 'agent_orchestration') return output(agentOrchestrationSummary(deps.commandContext, deps.toolRegistry, args));
|
|
410
|
+
if (args.mode === 'agent_orchestration_agent') {
|
|
411
|
+
const resolved = describeAgentOrchestrationAgent(deps.commandContext, args);
|
|
412
|
+
if (resolved.status === 'found') return output(resolved.agent);
|
|
413
|
+
if (resolved.status === 'ambiguous') return error(`Ambiguous visible Agent ${resolved.input}. Candidates: ${JSON.stringify(resolved.candidates)}`);
|
|
414
|
+
return error(resolved.usage);
|
|
415
|
+
}
|
|
416
|
+
if (args.mode === 'provision_connected_host_token') {
|
|
417
|
+
const confirmationError = requireConfirmedAction(args, 'Connected-host token provisioning');
|
|
418
|
+
if (confirmationError) return error(confirmationError);
|
|
419
|
+
const setupItemId = readString(args.setupItemId);
|
|
420
|
+
if (setupItemId && setupItemId !== 'connected-host-auth') {
|
|
421
|
+
return error('provision_connected_host_token supports setupItemId:"connected-host-auth" only.');
|
|
422
|
+
}
|
|
423
|
+
return output(provisionConnectedHostOperatorToken(deps.commandContext, args));
|
|
424
|
+
}
|
|
425
|
+
if (args.mode === 'run_setup_smoke') {
|
|
426
|
+
const confirmationError = requireConfirmedAction(args, 'Setup smoke');
|
|
427
|
+
if (confirmationError) return error(confirmationError);
|
|
428
|
+
const setupItemId = readString(args.setupItemId);
|
|
429
|
+
if (setupItemId && setupItemId !== 'install-smoke') return error('run_setup_smoke currently supports setupItemId:"install-smoke" only.');
|
|
430
|
+
return output(await runSetupInstallSmoke(deps.commandContext, args));
|
|
431
|
+
}
|
|
582
432
|
if (args.mode === 'model_routing') return output(await modelRoutingSummary(deps.commandContext, args));
|
|
583
433
|
if (args.mode === 'model_route') {
|
|
584
434
|
const resolved = await describeHarnessModelRoute(deps.commandContext, args);
|
|
@@ -586,6 +436,99 @@ export function createAgentHarnessTool(deps: AgentHarnessToolDeps): Tool {
|
|
|
586
436
|
if (resolved.status === 'ambiguous') return error(`Ambiguous model route ${resolved.input}. Candidates: ${JSON.stringify(resolved.candidates)}`);
|
|
587
437
|
return error(resolved.usage);
|
|
588
438
|
}
|
|
439
|
+
if (args.mode === 'run_local_model_smoke') {
|
|
440
|
+
const confirmationError = requireConfirmedAction(args, 'Local model smoke');
|
|
441
|
+
return confirmationError ? error(confirmationError) : output(await runLocalModelServerSmoke(deps.commandContext, args));
|
|
442
|
+
}
|
|
443
|
+
if (args.mode === 'execution_posture') return output(executionPostureSummary(deps.commandContext, deps.toolRegistry, args));
|
|
444
|
+
if (args.mode === 'browser_control_route') return output(browserControlRouteSummary(deps.commandContext, deps.toolRegistry, args));
|
|
445
|
+
if (args.mode === 'execution_route') {
|
|
446
|
+
const resolved = describeHarnessExecutionRoute(deps.commandContext, deps.toolRegistry, args);
|
|
447
|
+
if (resolved.status === 'found') return output(resolved.route);
|
|
448
|
+
if (resolved.status === 'ambiguous') return error(`Ambiguous execution route ${resolved.input}. Candidates: ${JSON.stringify(resolved.candidates)}`);
|
|
449
|
+
return error(resolved.usage);
|
|
450
|
+
}
|
|
451
|
+
if (args.mode === 'background_processes') return output(backgroundProcessSummary(deps.commandContext, args));
|
|
452
|
+
if (args.mode === 'background_process') {
|
|
453
|
+
const resolved = describeBackgroundProcess(deps.commandContext, args);
|
|
454
|
+
if (resolved.status === 'found') return output(resolved.process);
|
|
455
|
+
if (resolved.status === 'ambiguous') return error(`Ambiguous background process ${resolved.input}. Candidates: ${JSON.stringify(resolved.candidates)}`);
|
|
456
|
+
return error(resolved.usage);
|
|
457
|
+
}
|
|
458
|
+
if (args.mode === 'run_background_process') return output(await runBackgroundProcessAction(deps.commandContext, args));
|
|
459
|
+
if (args.mode === 'execution_history') return output(executionHistorySummary(deps.commandContext, args));
|
|
460
|
+
if (args.mode === 'execution_history_item') {
|
|
461
|
+
const resolved = describeExecutionHistoryItem(deps.commandContext, args);
|
|
462
|
+
if (resolved.status === 'found') return output(resolved.record);
|
|
463
|
+
if (resolved.status === 'ambiguous') return error(`Ambiguous execution history record ${resolved.input}. Candidates: ${JSON.stringify(resolved.candidates)}`);
|
|
464
|
+
return error(resolved.usage);
|
|
465
|
+
}
|
|
466
|
+
if (args.mode === 'file_recovery') return output(fileRecoverySummary(deps.commandContext, args));
|
|
467
|
+
if (args.mode === 'run_file_recovery') {
|
|
468
|
+
const confirmationError = requireConfirmedAction(args, 'File recovery');
|
|
469
|
+
return confirmationError ? error(confirmationError) : output(runFileRecovery(deps.commandContext, args));
|
|
470
|
+
}
|
|
471
|
+
if (args.mode === 'personal_ops_briefing') return output(await personalOpsBriefingSummary(deps.commandContext, args));
|
|
472
|
+
if (args.mode === 'personal_ops') return output(await personalOpsSummary(deps.commandContext, args));
|
|
473
|
+
if (args.mode === 'personal_ops_queue') return output(await personalOpsQueueSummary(deps.commandContext, args));
|
|
474
|
+
if (args.mode === 'personal_ops_intake') return output(await personalOpsIntakeSummary(deps.commandContext, args));
|
|
475
|
+
if (args.mode === 'personal_ops_lane') {
|
|
476
|
+
const resolved = await describePersonalOpsLane(deps.commandContext, args);
|
|
477
|
+
if (resolved.status === 'found') return output(resolved.lane);
|
|
478
|
+
if (resolved.status === 'ambiguous') return error(`Ambiguous Personal Ops lane ${resolved.input}. Candidates: ${JSON.stringify(resolved.candidates)}`);
|
|
479
|
+
return error(resolved.usage);
|
|
480
|
+
}
|
|
481
|
+
if (args.mode === 'run_personal_ops_read') return output(await runPersonalOpsRead(deps.commandContext, args));
|
|
482
|
+
if (args.mode === 'memory_posture') return output(await memoryPostureSummary(deps.commandContext, args));
|
|
483
|
+
if (args.mode === 'memory_provider') {
|
|
484
|
+
const resolved = await describeMemoryProvider(deps.commandContext, args);
|
|
485
|
+
if (resolved.status === 'found') return output(resolved.provider);
|
|
486
|
+
if (resolved.status === 'ambiguous') return error(`Ambiguous memory provider ${resolved.input}. Candidates: ${JSON.stringify(resolved.candidates)}`);
|
|
487
|
+
return error(resolved.usage);
|
|
488
|
+
}
|
|
489
|
+
if (args.mode === 'memory_refinement') return output(memoryRefinementSummary(deps.commandContext, args));
|
|
490
|
+
if (args.mode === 'run_memory_refinement') {
|
|
491
|
+
const confirmationError = requireConfirmedAction(args, 'Agent Knowledge semantic refinement');
|
|
492
|
+
return confirmationError ? error(confirmationError) : output(await runMemoryRefinement(deps.commandContext, args));
|
|
493
|
+
}
|
|
494
|
+
if (args.mode === 'autonomy_intake') return output(autonomyIntakeSummary(deps.commandContext, args));
|
|
495
|
+
if (args.mode === 'autonomy_queue') return output(autonomyQueueSummary(deps.commandContext, args));
|
|
496
|
+
if (args.mode === 'autonomy_queue_item') {
|
|
497
|
+
const resolved = describeAutonomyQueueItem(deps.commandContext, args);
|
|
498
|
+
if (resolved.status === 'found') return output(resolved.item);
|
|
499
|
+
if (resolved.status === 'ambiguous') return error(`Ambiguous autonomy queue item ${resolved.input}. Candidates: ${JSON.stringify(resolved.candidates)}`);
|
|
500
|
+
return error(resolved.usage);
|
|
501
|
+
}
|
|
502
|
+
if (args.mode === 'learning_curator') return output(learningCuratorSummary(deps.commandContext, args));
|
|
503
|
+
if (args.mode === 'learning_candidate') {
|
|
504
|
+
const resolved = describeLearningCandidate(deps.commandContext, args);
|
|
505
|
+
if (resolved.status === 'found') return output(resolved.candidate);
|
|
506
|
+
if (resolved.status === 'ambiguous') return error(`Ambiguous learning candidate ${resolved.input}. Candidates: ${JSON.stringify(resolved.candidates)}`);
|
|
507
|
+
return error(resolved.usage);
|
|
508
|
+
}
|
|
509
|
+
if (args.mode === 'research_briefing') return output(researchBriefingSummary(deps.commandContext, args));
|
|
510
|
+
if (args.mode === 'research_workflow') return output(researchWorkflowSummary(deps.commandContext, args));
|
|
511
|
+
if (args.mode === 'research_runs') return output(researchRunsSummary(deps.commandContext, args));
|
|
512
|
+
if (args.mode === 'research_run') {
|
|
513
|
+
const resolved = describeResearchRun(deps.commandContext, args);
|
|
514
|
+
if (resolved.status === 'found') return output(resolved.run);
|
|
515
|
+
if (resolved.status === 'ambiguous') return error(`Ambiguous research run ${resolved.input}. Candidates: ${JSON.stringify(resolved.candidates)}`);
|
|
516
|
+
return error(resolved.usage);
|
|
517
|
+
}
|
|
518
|
+
if (args.mode === 'research_queue') return output(researchQueueSummary(deps.commandContext, args));
|
|
519
|
+
if (args.mode === 'research_source') {
|
|
520
|
+
const resolved = describeResearchSource(deps.commandContext, args);
|
|
521
|
+
if (resolved.status === 'found') return output(resolved.source);
|
|
522
|
+
if (resolved.status === 'ambiguous') return error(`Ambiguous research source ${resolved.input}. Candidates: ${JSON.stringify(resolved.candidates)}`);
|
|
523
|
+
return error(resolved.usage);
|
|
524
|
+
}
|
|
525
|
+
if (args.mode === 'document_ops') return output(documentOpsSummary(deps.commandContext, args));
|
|
526
|
+
if (args.mode === 'document_ops_lane') {
|
|
527
|
+
const resolved = describeDocumentOpsLane(deps.commandContext, args);
|
|
528
|
+
if (resolved.status === 'found') return output(resolved.lane);
|
|
529
|
+
if (resolved.status === 'ambiguous') return error(`Ambiguous Document Ops lane ${resolved.input}. Candidates: ${JSON.stringify(resolved.candidates)}`);
|
|
530
|
+
return error(resolved.usage);
|
|
531
|
+
}
|
|
589
532
|
if (args.mode === 'pairing_posture') return output(pairingPostureSummary(deps.commandContext, args));
|
|
590
533
|
if (args.mode === 'pairing_route') {
|
|
591
534
|
const resolved = describeHarnessPairingRoute(deps.commandContext, args);
|
|
@@ -607,6 +550,12 @@ export function createAgentHarnessTool(deps: AgentHarnessToolDeps): Tool {
|
|
|
607
550
|
if (resolved.status === 'ambiguous') return error(`Ambiguous security finding ${resolved.input}. Candidates: ${JSON.stringify(resolved.candidates)}`);
|
|
608
551
|
return error(resolved.usage);
|
|
609
552
|
}
|
|
553
|
+
if (args.mode === 'policy_explain') {
|
|
554
|
+
const resolved = explainAgentPolicyDecision(deps.commandContext, deps.toolRegistry, args);
|
|
555
|
+
if (resolved.status === 'found') return output(resolved.explanation);
|
|
556
|
+
if (resolved.status === 'ambiguous') return error(`Ambiguous policy explanation target ${resolved.input}. Candidates: ${JSON.stringify(resolved.candidates)}`);
|
|
557
|
+
return error(resolved.usage);
|
|
558
|
+
}
|
|
610
559
|
if (args.mode === 'support_bundles') return output(supportBundleSummary(args));
|
|
611
560
|
if (args.mode === 'support_bundle') {
|
|
612
561
|
const resolved = describeHarnessSupportBundle(deps.commandContext, args);
|