@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,552 @@
|
|
|
1
|
+
import type { AgentWorkspaceActionResult, AgentWorkspaceLocalEditor } from './agent-workspace-types.ts';
|
|
2
|
+
import type { AgentWorkspaceFieldReader } from './agent-workspace-model-compare-types.ts';
|
|
3
|
+
import { compareExportMode, compareReviewMode, isAffirmative, quoteBlock, readList, readPositiveInteger } from './agent-workspace-model-compare-utils.ts';
|
|
4
|
+
|
|
5
|
+
type AgentModelComparePromptSubmissionResult = {
|
|
6
|
+
readonly kind: 'editor';
|
|
7
|
+
readonly editor: AgentWorkspaceLocalEditor;
|
|
8
|
+
readonly status: string;
|
|
9
|
+
readonly actionResult: AgentWorkspaceActionResult;
|
|
10
|
+
} | {
|
|
11
|
+
readonly kind: 'prompt';
|
|
12
|
+
readonly prompt: string;
|
|
13
|
+
readonly status: string;
|
|
14
|
+
readonly actionResult: AgentWorkspaceActionResult;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export function buildAgentModelComparePromptSubmission(
|
|
18
|
+
editor: AgentWorkspaceLocalEditor,
|
|
19
|
+
readField: AgentWorkspaceFieldReader,
|
|
20
|
+
promptDispatchAvailable: boolean,
|
|
21
|
+
): AgentModelComparePromptSubmissionResult {
|
|
22
|
+
if (!isAffirmative(readField('confirm'))) {
|
|
23
|
+
return {
|
|
24
|
+
kind: 'editor',
|
|
25
|
+
editor: {
|
|
26
|
+
...editor,
|
|
27
|
+
selectedFieldIndex: Math.max(0, editor.fields.findIndex((field) => field.id === 'confirm')),
|
|
28
|
+
message: 'Model comparison not confirmed. Type yes, then press Enter.',
|
|
29
|
+
},
|
|
30
|
+
status: 'Model comparison not confirmed.',
|
|
31
|
+
actionResult: {
|
|
32
|
+
kind: 'error',
|
|
33
|
+
title: 'Model comparison not confirmed',
|
|
34
|
+
detail: 'Type yes on the confirmation field before spending model tokens.',
|
|
35
|
+
safety: 'safe',
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
if (!promptDispatchAvailable) {
|
|
40
|
+
return {
|
|
41
|
+
kind: 'editor',
|
|
42
|
+
editor: {
|
|
43
|
+
...editor,
|
|
44
|
+
message: 'Prompt dispatch is unavailable in this runtime. Use agent_harness mode:"run_workspace_action" with this editor schema.',
|
|
45
|
+
},
|
|
46
|
+
status: 'Prompt dispatch unavailable.',
|
|
47
|
+
actionResult: {
|
|
48
|
+
kind: 'error',
|
|
49
|
+
title: 'Prompt dispatch unavailable',
|
|
50
|
+
detail: 'This runtime cannot submit the comparison request from the workspace form.',
|
|
51
|
+
safety: 'safe',
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const modelRefs = readList(readField('modelRefs'));
|
|
57
|
+
const artifactId = readField('artifactId').trim();
|
|
58
|
+
const candidateCount = readPositiveInteger(readField('candidateCount')) ?? 2;
|
|
59
|
+
const reveal = isAffirmative(readField('reveal'));
|
|
60
|
+
const rubric = readField('rubric').trim();
|
|
61
|
+
const systemPrompt = readField('systemPrompt').trim();
|
|
62
|
+
const maxTokens = readPositiveInteger(readField('maxTokens')) ?? 2048;
|
|
63
|
+
const benchmarkKind = readField('benchmarkKind').trim();
|
|
64
|
+
const taskType = readField('taskType').trim();
|
|
65
|
+
const documentId = readField('documentId').trim();
|
|
66
|
+
const explicitUserRequest = 'Run the blind model comparison from the Agent workspace form.';
|
|
67
|
+
const prompt = [
|
|
68
|
+
'Run a blind model comparison with the `agent_model_compare` tool.',
|
|
69
|
+
'Use confirm:true because this workspace form was explicitly confirmed by the user.',
|
|
70
|
+
`Use explicitUserRequest: ${JSON.stringify(explicitUserRequest)}.`,
|
|
71
|
+
'',
|
|
72
|
+
'Candidate prompt:',
|
|
73
|
+
quoteBlock(readField('prompt')),
|
|
74
|
+
'',
|
|
75
|
+
artifactId ? `Source artifact id: ${artifactId}.` : 'Source artifact id: none.',
|
|
76
|
+
'',
|
|
77
|
+
modelRefs.length > 0
|
|
78
|
+
? `Candidate models: ${modelRefs.join(', ')}.`
|
|
79
|
+
: `Candidate models: auto-select ${candidateCount} selectable models.`,
|
|
80
|
+
rubric ? `Rubric: ${rubric}` : 'Rubric: none.',
|
|
81
|
+
systemPrompt ? `System prompt: ${systemPrompt}` : 'System prompt: none.',
|
|
82
|
+
`Max tokens per candidate: ${maxTokens}.`,
|
|
83
|
+
benchmarkKind ? `Benchmark kind: ${benchmarkKind}.` : 'Benchmark kind: none.',
|
|
84
|
+
taskType ? `Task type: ${taskType}.` : 'Task type: none.',
|
|
85
|
+
documentId ? `Document id: ${documentId}.` : 'Document id: none.',
|
|
86
|
+
`Reveal identities immediately: ${reveal ? 'yes' : 'no'}.`,
|
|
87
|
+
'Do not change the selected model after the comparison unless the user asks for that route update separately.',
|
|
88
|
+
].join('\n');
|
|
89
|
+
|
|
90
|
+
return {
|
|
91
|
+
kind: 'prompt',
|
|
92
|
+
prompt,
|
|
93
|
+
status: 'Submitting blind model comparison request.',
|
|
94
|
+
actionResult: {
|
|
95
|
+
kind: 'guidance',
|
|
96
|
+
title: 'Blind model comparison',
|
|
97
|
+
detail: 'Submitted a confirmed request to run the first-class model comparison tool.',
|
|
98
|
+
safety: 'safe',
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export function buildAgentModelCompareReviewPromptSubmission(
|
|
104
|
+
editor: AgentWorkspaceLocalEditor,
|
|
105
|
+
readField: AgentWorkspaceFieldReader,
|
|
106
|
+
promptDispatchAvailable: boolean,
|
|
107
|
+
): AgentModelComparePromptSubmissionResult {
|
|
108
|
+
if (!promptDispatchAvailable) {
|
|
109
|
+
return {
|
|
110
|
+
kind: 'editor',
|
|
111
|
+
editor: {
|
|
112
|
+
...editor,
|
|
113
|
+
message: 'Prompt dispatch is unavailable in this runtime. Use agent_harness mode:"run_workspace_action" with this editor schema.',
|
|
114
|
+
},
|
|
115
|
+
status: 'Prompt dispatch unavailable.',
|
|
116
|
+
actionResult: {
|
|
117
|
+
kind: 'error',
|
|
118
|
+
title: 'Prompt dispatch unavailable',
|
|
119
|
+
detail: 'This runtime cannot submit the comparison review request from the workspace form.',
|
|
120
|
+
safety: 'read-only',
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const mode = compareReviewMode(readField('view'));
|
|
126
|
+
const artifactId = readField('artifactId').trim();
|
|
127
|
+
const comparisonId = readField('comparisonId').trim();
|
|
128
|
+
const leftArtifactId = readField('leftArtifactId').trim() || artifactId;
|
|
129
|
+
const rightArtifactId = readField('rightArtifactId').trim();
|
|
130
|
+
const relatedArtifactIds = readList(readField('relatedArtifactIds'));
|
|
131
|
+
const previewBytes = readPositiveInteger(readField('previewBytes')) ?? 2000;
|
|
132
|
+
const reveal = isAffirmative(readField('reveal'));
|
|
133
|
+
const prompt = [
|
|
134
|
+
mode === 'handoffDiff'
|
|
135
|
+
? 'Render a visual diff between two saved reviewer handoff artifacts with the `agent_model_compare` tool.'
|
|
136
|
+
: mode === 'sideBySide'
|
|
137
|
+
? 'Render a side-by-side reviewer view for a saved blind model comparison with the `agent_model_compare` tool.'
|
|
138
|
+
: 'Review a saved blind model comparison with the `agent_model_compare` tool.',
|
|
139
|
+
`Use mode:"${mode}".`,
|
|
140
|
+
artifactId ? `Use artifactId: ${JSON.stringify(artifactId)}.` : 'No artifactId was provided.',
|
|
141
|
+
comparisonId ? `Use comparisonId: ${JSON.stringify(comparisonId)}.` : 'No comparisonId was provided.',
|
|
142
|
+
mode === 'handoffDiff' && leftArtifactId ? `Use leftArtifactId: ${JSON.stringify(leftArtifactId)}.` : '',
|
|
143
|
+
mode === 'handoffDiff' && rightArtifactId ? `Use rightArtifactId: ${JSON.stringify(rightArtifactId)}.` : '',
|
|
144
|
+
relatedArtifactIds.length > 0 ? `Related artifact ids: ${relatedArtifactIds.join(', ')}.` : 'Related artifact ids: none.',
|
|
145
|
+
`Preview bytes: ${previewBytes}.`,
|
|
146
|
+
`Reveal identities in the review: ${reveal ? 'yes' : 'no'}.`,
|
|
147
|
+
mode === 'handoffDiff'
|
|
148
|
+
? 'If no handoff ids were provided, list recent saved reviewer handoff artifacts.'
|
|
149
|
+
: 'If no ids were provided, list recent saved comparison artifacts.',
|
|
150
|
+
'Do not change the selected model after the review unless the user asks for that route update separately.',
|
|
151
|
+
].filter(Boolean).join('\n');
|
|
152
|
+
|
|
153
|
+
return {
|
|
154
|
+
kind: 'prompt',
|
|
155
|
+
prompt,
|
|
156
|
+
status: `Submitting saved comparison ${mode} request.`,
|
|
157
|
+
actionResult: {
|
|
158
|
+
kind: 'guidance',
|
|
159
|
+
title: mode === 'handoffDiff'
|
|
160
|
+
? 'Reviewer handoff diff'
|
|
161
|
+
: mode === 'sideBySide'
|
|
162
|
+
? 'Side-by-side compare review'
|
|
163
|
+
: 'Saved comparison review',
|
|
164
|
+
detail: mode === 'handoffDiff'
|
|
165
|
+
? 'Submitted a read-only request to compare two saved reviewer handoff artifacts.'
|
|
166
|
+
: mode === 'sideBySide'
|
|
167
|
+
? 'Submitted a read-only request to compare related artifact excerpts with saved comparison evidence.'
|
|
168
|
+
: 'Submitted a read-only request to review saved blind comparison artifacts.',
|
|
169
|
+
safety: 'read-only',
|
|
170
|
+
},
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export function buildAgentModelCompareHandoffDiffPromptSubmission(
|
|
175
|
+
editor: AgentWorkspaceLocalEditor,
|
|
176
|
+
readField: AgentWorkspaceFieldReader,
|
|
177
|
+
promptDispatchAvailable: boolean,
|
|
178
|
+
): AgentModelComparePromptSubmissionResult {
|
|
179
|
+
if (!promptDispatchAvailable) {
|
|
180
|
+
return {
|
|
181
|
+
kind: 'editor',
|
|
182
|
+
editor: {
|
|
183
|
+
...editor,
|
|
184
|
+
message: 'Prompt dispatch is unavailable in this runtime. Use agent_harness mode:"run_workspace_action" with this editor schema.',
|
|
185
|
+
},
|
|
186
|
+
status: 'Prompt dispatch unavailable.',
|
|
187
|
+
actionResult: {
|
|
188
|
+
kind: 'error',
|
|
189
|
+
title: 'Prompt dispatch unavailable',
|
|
190
|
+
detail: 'This runtime cannot submit the reviewer handoff diff request from the workspace form.',
|
|
191
|
+
safety: 'read-only',
|
|
192
|
+
},
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
const leftArtifactId = readField('leftArtifactId').trim();
|
|
197
|
+
const rightArtifactId = readField('rightArtifactId').trim();
|
|
198
|
+
const sectionId = readField('sectionId').trim() || 'all';
|
|
199
|
+
const prompt = [
|
|
200
|
+
'Render a visual diff between two saved reviewer handoff artifacts with the `agent_model_compare` tool.',
|
|
201
|
+
'Use mode:"handoffDiff".',
|
|
202
|
+
leftArtifactId ? `Use leftArtifactId: ${JSON.stringify(leftArtifactId)}.` : 'No leftArtifactId was provided; list saved reviewer handoffs if either id is missing.',
|
|
203
|
+
rightArtifactId ? `Use rightArtifactId: ${JSON.stringify(rightArtifactId)}.` : 'No rightArtifactId was provided; list saved reviewer handoffs if either id is missing.',
|
|
204
|
+
`Use sectionId: ${JSON.stringify(sectionId)}.`,
|
|
205
|
+
'Use the existing split-pane Agent workspace path for the result; do not change the selected model.',
|
|
206
|
+
].join('\n');
|
|
207
|
+
|
|
208
|
+
return {
|
|
209
|
+
kind: 'prompt',
|
|
210
|
+
prompt,
|
|
211
|
+
status: 'Submitting reviewer handoff diff request.',
|
|
212
|
+
actionResult: {
|
|
213
|
+
kind: 'guidance',
|
|
214
|
+
title: 'Reviewer handoff diff',
|
|
215
|
+
detail: 'Submitted a read-only request to compare two reviewer handoff artifacts with section jump focus.',
|
|
216
|
+
safety: 'read-only',
|
|
217
|
+
},
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
export function buildAgentModelCompareJudgmentPromptSubmission(
|
|
222
|
+
editor: AgentWorkspaceLocalEditor,
|
|
223
|
+
readField: AgentWorkspaceFieldReader,
|
|
224
|
+
promptDispatchAvailable: boolean,
|
|
225
|
+
): AgentModelComparePromptSubmissionResult {
|
|
226
|
+
if (!isAffirmative(readField('confirm'))) {
|
|
227
|
+
return {
|
|
228
|
+
kind: 'editor',
|
|
229
|
+
editor: {
|
|
230
|
+
...editor,
|
|
231
|
+
selectedFieldIndex: Math.max(0, editor.fields.findIndex((field) => field.id === 'confirm')),
|
|
232
|
+
message: 'Judgment not confirmed. Type yes, then press Enter.',
|
|
233
|
+
},
|
|
234
|
+
status: 'Judgment not confirmed.',
|
|
235
|
+
actionResult: {
|
|
236
|
+
kind: 'error',
|
|
237
|
+
title: 'Judgment not confirmed',
|
|
238
|
+
detail: 'Type yes on the confirmation field before saving the judgment artifact.',
|
|
239
|
+
safety: 'safe',
|
|
240
|
+
},
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
if (!promptDispatchAvailable) {
|
|
244
|
+
return {
|
|
245
|
+
kind: 'editor',
|
|
246
|
+
editor: {
|
|
247
|
+
...editor,
|
|
248
|
+
message: 'Prompt dispatch is unavailable in this runtime. Use agent_harness mode:"run_workspace_action" with this editor schema.',
|
|
249
|
+
},
|
|
250
|
+
status: 'Prompt dispatch unavailable.',
|
|
251
|
+
actionResult: {
|
|
252
|
+
kind: 'error',
|
|
253
|
+
title: 'Prompt dispatch unavailable',
|
|
254
|
+
detail: 'This runtime cannot submit the comparison judgment request from the workspace form.',
|
|
255
|
+
safety: 'safe',
|
|
256
|
+
},
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
const artifactId = readField('artifactId').trim();
|
|
261
|
+
const comparisonId = readField('comparisonId').trim();
|
|
262
|
+
const winnerBlindId = readField('winnerBlindId').trim();
|
|
263
|
+
const reasons = readField('reasons').trim();
|
|
264
|
+
const notes = readField('notes').trim();
|
|
265
|
+
const reveal = isAffirmative(readField('reveal'));
|
|
266
|
+
const explicitUserRequest = 'Save the blind model comparison judgment from the Agent workspace form.';
|
|
267
|
+
const prompt = [
|
|
268
|
+
'Save a blind model comparison judgment with the `agent_model_compare` tool.',
|
|
269
|
+
'Use confirm:true because this workspace form was explicitly confirmed by the user.',
|
|
270
|
+
`Use explicitUserRequest: ${JSON.stringify(explicitUserRequest)}.`,
|
|
271
|
+
artifactId ? `Use artifactId: ${JSON.stringify(artifactId)}.` : 'No artifactId was provided.',
|
|
272
|
+
comparisonId ? `Use comparisonId: ${JSON.stringify(comparisonId)}.` : 'No comparisonId was provided.',
|
|
273
|
+
`Winner blind id: ${winnerBlindId || '(missing)'}.`,
|
|
274
|
+
`Reasons: ${reasons || '(missing)'}.`,
|
|
275
|
+
notes ? `Notes: ${notes}.` : 'Notes: none.',
|
|
276
|
+
`Reveal model identity in judgment: ${reveal ? 'yes' : 'no'}.`,
|
|
277
|
+
'Do not change the selected model after saving the judgment unless the user asks for that route update separately.',
|
|
278
|
+
].join('\n');
|
|
279
|
+
|
|
280
|
+
return {
|
|
281
|
+
kind: 'prompt',
|
|
282
|
+
prompt,
|
|
283
|
+
status: 'Submitting saved comparison judgment request.',
|
|
284
|
+
actionResult: {
|
|
285
|
+
kind: 'guidance',
|
|
286
|
+
title: 'Saved comparison judgment',
|
|
287
|
+
detail: 'Submitted a confirmed request to save a local comparison judgment artifact.',
|
|
288
|
+
safety: 'safe',
|
|
289
|
+
},
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
export function buildAgentModelCompareApplyPromptSubmission(
|
|
294
|
+
editor: AgentWorkspaceLocalEditor,
|
|
295
|
+
readField: AgentWorkspaceFieldReader,
|
|
296
|
+
promptDispatchAvailable: boolean,
|
|
297
|
+
): AgentModelComparePromptSubmissionResult {
|
|
298
|
+
if (!isAffirmative(readField('confirm'))) {
|
|
299
|
+
return {
|
|
300
|
+
kind: 'editor',
|
|
301
|
+
editor: {
|
|
302
|
+
...editor,
|
|
303
|
+
selectedFieldIndex: Math.max(0, editor.fields.findIndex((field) => field.id === 'confirm')),
|
|
304
|
+
message: 'Route update not confirmed. Type yes, then press Enter.',
|
|
305
|
+
},
|
|
306
|
+
status: 'Route update not confirmed.',
|
|
307
|
+
actionResult: {
|
|
308
|
+
kind: 'error',
|
|
309
|
+
title: 'Route update not confirmed',
|
|
310
|
+
detail: 'Type yes on the confirmation field before applying the winning model route.',
|
|
311
|
+
safety: 'safe',
|
|
312
|
+
},
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
if (!promptDispatchAvailable) {
|
|
316
|
+
return {
|
|
317
|
+
kind: 'editor',
|
|
318
|
+
editor: {
|
|
319
|
+
...editor,
|
|
320
|
+
message: 'Prompt dispatch is unavailable in this runtime. Use agent_harness mode:"run_workspace_action" with this editor schema.',
|
|
321
|
+
},
|
|
322
|
+
status: 'Prompt dispatch unavailable.',
|
|
323
|
+
actionResult: {
|
|
324
|
+
kind: 'error',
|
|
325
|
+
title: 'Prompt dispatch unavailable',
|
|
326
|
+
detail: 'This runtime cannot submit the comparison route update request from the workspace form.',
|
|
327
|
+
safety: 'safe',
|
|
328
|
+
},
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
const artifactId = readField('artifactId').trim();
|
|
333
|
+
const explicitUserRequest = 'Apply the revealed blind model comparison judgment from the Agent workspace form.';
|
|
334
|
+
const prompt = [
|
|
335
|
+
'Apply a revealed blind model comparison judgment with the `agent_model_compare` tool.',
|
|
336
|
+
'Use mode:"apply" and confirm:true because this workspace form was explicitly confirmed by the user.',
|
|
337
|
+
`Use explicitUserRequest: ${JSON.stringify(explicitUserRequest)}.`,
|
|
338
|
+
artifactId ? `Use artifactId: ${JSON.stringify(artifactId)}.` : 'No artifactId was provided.',
|
|
339
|
+
'Only proceed if the judgment artifact includes a revealed winner model.',
|
|
340
|
+
].join('\n');
|
|
341
|
+
|
|
342
|
+
return {
|
|
343
|
+
kind: 'prompt',
|
|
344
|
+
prompt,
|
|
345
|
+
status: 'Submitting comparison route update request.',
|
|
346
|
+
actionResult: {
|
|
347
|
+
kind: 'guidance',
|
|
348
|
+
title: 'Apply compare winner',
|
|
349
|
+
detail: 'Submitted a confirmed request to apply a revealed comparison judgment to the selected model route.',
|
|
350
|
+
safety: 'safe',
|
|
351
|
+
},
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
export function buildAgentModelCompareRouteDecisionPromptSubmission(
|
|
356
|
+
editor: AgentWorkspaceLocalEditor,
|
|
357
|
+
readField: AgentWorkspaceFieldReader,
|
|
358
|
+
promptDispatchAvailable: boolean,
|
|
359
|
+
): AgentModelComparePromptSubmissionResult {
|
|
360
|
+
if (!isAffirmative(readField('confirm'))) {
|
|
361
|
+
return {
|
|
362
|
+
kind: 'editor',
|
|
363
|
+
editor: {
|
|
364
|
+
...editor,
|
|
365
|
+
selectedFieldIndex: Math.max(0, editor.fields.findIndex((field) => field.id === 'confirm')),
|
|
366
|
+
message: 'Route decision not confirmed. Type yes, then press Enter.',
|
|
367
|
+
},
|
|
368
|
+
status: 'Route decision not confirmed.',
|
|
369
|
+
actionResult: {
|
|
370
|
+
kind: 'error',
|
|
371
|
+
title: 'Route decision not confirmed',
|
|
372
|
+
detail: 'Type yes on the confirmation field before saving a leave-unchanged route-decision receipt.',
|
|
373
|
+
safety: 'safe',
|
|
374
|
+
},
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
if (!promptDispatchAvailable) {
|
|
378
|
+
return {
|
|
379
|
+
kind: 'editor',
|
|
380
|
+
editor: {
|
|
381
|
+
...editor,
|
|
382
|
+
message: 'Prompt dispatch is unavailable in this runtime. Use agent_harness mode:"run_workspace_action" with this editor schema.',
|
|
383
|
+
},
|
|
384
|
+
status: 'Prompt dispatch unavailable.',
|
|
385
|
+
actionResult: {
|
|
386
|
+
kind: 'error',
|
|
387
|
+
title: 'Prompt dispatch unavailable',
|
|
388
|
+
detail: 'This runtime cannot submit the comparison route-decision receipt request from the workspace form.',
|
|
389
|
+
safety: 'safe',
|
|
390
|
+
},
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
const artifactId = readField('artifactId').trim();
|
|
395
|
+
const explicitUserRequest = 'Record that the revealed blind model comparison judgment should leave the current Agent model route unchanged.';
|
|
396
|
+
const prompt = [
|
|
397
|
+
'Record a blind model comparison route-decision receipt with the `agent_model_compare` tool.',
|
|
398
|
+
'Use mode:"routeDecision", decision:"left-unchanged", and confirm:true because this workspace form was explicitly confirmed by the user.',
|
|
399
|
+
`Use explicitUserRequest: ${JSON.stringify(explicitUserRequest)}.`,
|
|
400
|
+
artifactId ? `Use artifactId: ${JSON.stringify(artifactId)}.` : 'No artifactId was provided.',
|
|
401
|
+
'Do not change the selected model route from this form.',
|
|
402
|
+
].join('\n');
|
|
403
|
+
|
|
404
|
+
return {
|
|
405
|
+
kind: 'prompt',
|
|
406
|
+
prompt,
|
|
407
|
+
status: 'Submitting comparison route-decision receipt request.',
|
|
408
|
+
actionResult: {
|
|
409
|
+
kind: 'guidance',
|
|
410
|
+
title: 'Record route decision',
|
|
411
|
+
detail: 'Submitted a confirmed request to save a leave-unchanged comparison route-decision receipt.',
|
|
412
|
+
safety: 'safe',
|
|
413
|
+
},
|
|
414
|
+
};
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
export function buildAgentModelCompareExportPromptSubmission(
|
|
418
|
+
editor: AgentWorkspaceLocalEditor,
|
|
419
|
+
readField: AgentWorkspaceFieldReader,
|
|
420
|
+
promptDispatchAvailable: boolean,
|
|
421
|
+
): AgentModelComparePromptSubmissionResult {
|
|
422
|
+
if (!isAffirmative(readField('confirm'))) {
|
|
423
|
+
return {
|
|
424
|
+
kind: 'editor',
|
|
425
|
+
editor: {
|
|
426
|
+
...editor,
|
|
427
|
+
selectedFieldIndex: Math.max(0, editor.fields.findIndex((field) => field.id === 'confirm')),
|
|
428
|
+
message: 'Export not confirmed. Type yes, then press Enter.',
|
|
429
|
+
},
|
|
430
|
+
status: 'Export not confirmed.',
|
|
431
|
+
actionResult: {
|
|
432
|
+
kind: 'error',
|
|
433
|
+
title: 'Export not confirmed',
|
|
434
|
+
detail: 'Type yes on the confirmation field before creating the markdown report artifact.',
|
|
435
|
+
safety: 'safe',
|
|
436
|
+
},
|
|
437
|
+
};
|
|
438
|
+
}
|
|
439
|
+
if (!promptDispatchAvailable) {
|
|
440
|
+
return {
|
|
441
|
+
kind: 'editor',
|
|
442
|
+
editor: {
|
|
443
|
+
...editor,
|
|
444
|
+
message: 'Prompt dispatch is unavailable in this runtime. Use agent_harness mode:"run_workspace_action" with this editor schema.',
|
|
445
|
+
},
|
|
446
|
+
status: 'Prompt dispatch unavailable.',
|
|
447
|
+
actionResult: {
|
|
448
|
+
kind: 'error',
|
|
449
|
+
title: 'Prompt dispatch unavailable',
|
|
450
|
+
detail: 'This runtime cannot submit the comparison export request from the workspace form.',
|
|
451
|
+
safety: 'safe',
|
|
452
|
+
},
|
|
453
|
+
};
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
const mode = compareExportMode(readField('reportKind'));
|
|
457
|
+
const artifactId = readField('artifactId').trim();
|
|
458
|
+
const relatedArtifactIds = readList(readField('relatedArtifactIds'));
|
|
459
|
+
const reveal = isAffirmative(readField('reveal'));
|
|
460
|
+
const explicitUserRequest = mode === 'handoff'
|
|
461
|
+
? 'Create a reviewer handoff from the saved blind model comparison artifact in the Agent workspace form.'
|
|
462
|
+
: mode === 'handoffArchive'
|
|
463
|
+
? 'Create a reviewer handoff ZIP archive from the saved blind model comparison handoff artifact in the Agent workspace form.'
|
|
464
|
+
: 'Export the saved blind model comparison artifact from the Agent workspace form.';
|
|
465
|
+
const prompt = [
|
|
466
|
+
mode === 'handoff'
|
|
467
|
+
? 'Create a reviewer handoff for a saved blind model comparison or judgment artifact with the `agent_model_compare` tool.'
|
|
468
|
+
: mode === 'handoffArchive'
|
|
469
|
+
? 'Create a ZIP archive artifact from a saved blind model comparison reviewer handoff with the `agent_model_compare` tool.'
|
|
470
|
+
: 'Export a saved blind model comparison or judgment artifact with the `agent_model_compare` tool.',
|
|
471
|
+
`Use mode:"${mode}" and confirm:true because this workspace form was explicitly confirmed by the user.`,
|
|
472
|
+
`Use explicitUserRequest: ${JSON.stringify(explicitUserRequest)}.`,
|
|
473
|
+
artifactId ? `Use artifactId: ${JSON.stringify(artifactId)}.` : 'No artifactId was provided.',
|
|
474
|
+
relatedArtifactIds.length > 0 ? `Related artifact ids: ${relatedArtifactIds.join(', ')}.` : 'Related artifact ids: none.',
|
|
475
|
+
`Reveal model identities in comparison exports: ${reveal ? 'yes' : 'no'}.`,
|
|
476
|
+
mode === 'handoffArchive'
|
|
477
|
+
? 'Create one local ZIP artifact, keep the original handoff/source/evidence artifacts, and do not change model routing.'
|
|
478
|
+
: 'Create one local markdown artifact and do not change model routing.',
|
|
479
|
+
].join('\n');
|
|
480
|
+
|
|
481
|
+
return {
|
|
482
|
+
kind: 'prompt',
|
|
483
|
+
prompt,
|
|
484
|
+
status: `Submitting comparison ${mode} request.`,
|
|
485
|
+
actionResult: {
|
|
486
|
+
kind: 'guidance',
|
|
487
|
+
title: mode === 'handoff'
|
|
488
|
+
? 'Compare reviewer handoff'
|
|
489
|
+
: mode === 'handoffArchive'
|
|
490
|
+
? 'Archive reviewer handoff'
|
|
491
|
+
: 'Export compare report',
|
|
492
|
+
detail: mode === 'handoff'
|
|
493
|
+
? 'Submitted a confirmed request to create a reviewer handoff from saved comparison evidence.'
|
|
494
|
+
: mode === 'handoffArchive'
|
|
495
|
+
? 'Submitted a confirmed request to create a ZIP archive artifact from a saved reviewer handoff.'
|
|
496
|
+
: 'Submitted a confirmed request to export a saved comparison or judgment as markdown.',
|
|
497
|
+
safety: 'safe',
|
|
498
|
+
},
|
|
499
|
+
};
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
export function buildAgentModelCompareAnalyticsPromptSubmission(
|
|
503
|
+
editor: AgentWorkspaceLocalEditor,
|
|
504
|
+
readField: AgentWorkspaceFieldReader,
|
|
505
|
+
promptDispatchAvailable: boolean,
|
|
506
|
+
): AgentModelComparePromptSubmissionResult {
|
|
507
|
+
if (!promptDispatchAvailable) {
|
|
508
|
+
return {
|
|
509
|
+
kind: 'editor',
|
|
510
|
+
editor: {
|
|
511
|
+
...editor,
|
|
512
|
+
message: 'Prompt dispatch is unavailable in this runtime. Use agent_harness mode:"run_workspace_action" with this editor schema.',
|
|
513
|
+
},
|
|
514
|
+
status: 'Prompt dispatch unavailable.',
|
|
515
|
+
actionResult: {
|
|
516
|
+
kind: 'error',
|
|
517
|
+
title: 'Prompt dispatch unavailable',
|
|
518
|
+
detail: 'This runtime cannot submit the comparison analytics/synthesis request from the workspace form.',
|
|
519
|
+
safety: 'read-only',
|
|
520
|
+
},
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
const mode = readField('view').trim().toLowerCase() === 'synthesis' ? 'synthesis' : 'analytics';
|
|
525
|
+
const limit = readPositiveInteger(readField('limit')) ?? 20;
|
|
526
|
+
const benchmarkKind = readField('benchmarkKind').trim();
|
|
527
|
+
const taskType = readField('taskType').trim();
|
|
528
|
+
const documentId = readField('documentId').trim();
|
|
529
|
+
const includeReasons = isAffirmative(readField('includeReasons'));
|
|
530
|
+
const prompt = [
|
|
531
|
+
'Review saved blind model comparison judgments with the `agent_model_compare` tool.',
|
|
532
|
+
`Use mode:"${mode}".`,
|
|
533
|
+
`Judgment limit: ${limit}.`,
|
|
534
|
+
benchmarkKind ? `Benchmark kind filter: ${benchmarkKind}.` : 'Benchmark kind filter: none.',
|
|
535
|
+
taskType ? `Task type filter: ${taskType}.` : 'Task type filter: none.',
|
|
536
|
+
documentId ? `Document id filter: ${documentId}.` : 'Document id filter: none.',
|
|
537
|
+
`Include reason excerpts: ${includeReasons ? 'yes' : 'no'}.`,
|
|
538
|
+
'This is read-only and must not change model routing.',
|
|
539
|
+
].join('\n');
|
|
540
|
+
|
|
541
|
+
return {
|
|
542
|
+
kind: 'prompt',
|
|
543
|
+
prompt,
|
|
544
|
+
status: `Submitting comparison ${mode} request.`,
|
|
545
|
+
actionResult: {
|
|
546
|
+
kind: 'guidance',
|
|
547
|
+
title: mode === 'synthesis' ? 'Compare synthesis' : 'Compare analytics',
|
|
548
|
+
detail: `Submitted a read-only request to ${mode === 'synthesis' ? 'synthesize' : 'summarize'} saved comparison judgments.`,
|
|
549
|
+
safety: 'read-only',
|
|
550
|
+
},
|
|
551
|
+
};
|
|
552
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
export type AgentWorkspaceFieldReader = (fieldId: string) => string;
|
|
2
|
+
|
|
3
|
+
export interface AgentModelCompareWorkspaceToolArgs {
|
|
4
|
+
readonly mode: 'run';
|
|
5
|
+
readonly prompt: string;
|
|
6
|
+
readonly artifactId?: string;
|
|
7
|
+
readonly modelRefs?: readonly string[];
|
|
8
|
+
readonly candidateCount?: number;
|
|
9
|
+
readonly rubric?: string;
|
|
10
|
+
readonly systemPrompt?: string;
|
|
11
|
+
readonly maxTokens?: number;
|
|
12
|
+
readonly benchmarkKind?: string;
|
|
13
|
+
readonly taskType?: string;
|
|
14
|
+
readonly documentId?: string;
|
|
15
|
+
readonly reveal?: boolean;
|
|
16
|
+
readonly confirm: boolean;
|
|
17
|
+
readonly explicitUserRequest: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface AgentModelCompareReviewWorkspaceToolArgs {
|
|
21
|
+
readonly mode: 'review' | 'sideBySide' | 'handoffDiff';
|
|
22
|
+
readonly comparisonId?: string;
|
|
23
|
+
readonly artifactId?: string;
|
|
24
|
+
readonly leftArtifactId?: string;
|
|
25
|
+
readonly rightArtifactId?: string;
|
|
26
|
+
readonly sectionId?: string;
|
|
27
|
+
readonly relatedArtifactIds?: readonly string[];
|
|
28
|
+
readonly previewBytes?: number;
|
|
29
|
+
readonly reveal?: boolean;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface AgentModelCompareHandoffDiffWorkspaceToolArgs {
|
|
33
|
+
readonly mode: 'handoffDiff';
|
|
34
|
+
readonly leftArtifactId?: string;
|
|
35
|
+
readonly rightArtifactId?: string;
|
|
36
|
+
readonly sectionId?: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface AgentModelCompareJudgmentWorkspaceToolArgs {
|
|
40
|
+
readonly mode: 'judge';
|
|
41
|
+
readonly comparisonId?: string;
|
|
42
|
+
readonly artifactId?: string;
|
|
43
|
+
readonly winnerBlindId: string;
|
|
44
|
+
readonly reasons: string;
|
|
45
|
+
readonly notes?: string;
|
|
46
|
+
readonly reveal?: boolean;
|
|
47
|
+
readonly confirm: boolean;
|
|
48
|
+
readonly explicitUserRequest: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface AgentModelCompareApplyWorkspaceToolArgs {
|
|
52
|
+
readonly mode: 'apply';
|
|
53
|
+
readonly artifactId: string;
|
|
54
|
+
readonly confirm: boolean;
|
|
55
|
+
readonly explicitUserRequest: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface AgentModelCompareRouteDecisionWorkspaceToolArgs {
|
|
59
|
+
readonly mode: 'routeDecision';
|
|
60
|
+
readonly artifactId: string;
|
|
61
|
+
readonly decision: 'left-unchanged';
|
|
62
|
+
readonly confirm: boolean;
|
|
63
|
+
readonly explicitUserRequest: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface AgentModelCompareExportWorkspaceToolArgs {
|
|
67
|
+
readonly mode: 'export' | 'handoff' | 'handoffArchive';
|
|
68
|
+
readonly artifactId: string;
|
|
69
|
+
readonly relatedArtifactIds?: readonly string[];
|
|
70
|
+
readonly reveal?: boolean;
|
|
71
|
+
readonly confirm: boolean;
|
|
72
|
+
readonly explicitUserRequest: string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface AgentModelCompareAnalyticsWorkspaceToolArgs {
|
|
76
|
+
readonly mode: 'analytics' | 'synthesis';
|
|
77
|
+
readonly limit?: number;
|
|
78
|
+
readonly includeReasons?: boolean;
|
|
79
|
+
readonly benchmarkKind?: string;
|
|
80
|
+
readonly taskType?: string;
|
|
81
|
+
readonly documentId?: string;
|
|
82
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { AgentModelCompareExportWorkspaceToolArgs, AgentModelCompareReviewWorkspaceToolArgs } from './agent-workspace-model-compare-types.ts';
|
|
2
|
+
|
|
3
|
+
export function readList(value: string): readonly string[] {
|
|
4
|
+
return value.split(/[\n,]/).map((entry) => entry.trim()).filter(Boolean);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function readPositiveInteger(value: string): number | null {
|
|
8
|
+
if (!value.trim()) return null;
|
|
9
|
+
const parsed = Number(value);
|
|
10
|
+
if (!Number.isFinite(parsed)) return null;
|
|
11
|
+
return Math.max(1, Math.trunc(parsed));
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function isAffirmative(value: string): boolean {
|
|
15
|
+
const normalized = value.trim().toLowerCase();
|
|
16
|
+
return normalized === 'yes' || normalized === 'true';
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function compareExportMode(value: string): AgentModelCompareExportWorkspaceToolArgs['mode'] {
|
|
20
|
+
const normalized = value.trim().toLowerCase().replace(/[\s_-]+/g, '');
|
|
21
|
+
if (normalized === 'handoff' || normalized === 'reviewerhandoff') return 'handoff';
|
|
22
|
+
if (normalized === 'archive' || normalized === 'zip' || normalized === 'handoffarchive' || normalized === 'handoffzip') return 'handoffArchive';
|
|
23
|
+
return 'export';
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function compareReviewMode(value: string): AgentModelCompareReviewWorkspaceToolArgs['mode'] {
|
|
27
|
+
const normalized = value.trim().toLowerCase().replace(/[\s_-]+/g, '');
|
|
28
|
+
if (normalized === 'sidebyside' || normalized === 'side') return 'sideBySide';
|
|
29
|
+
if (normalized === 'handoffdiff' || normalized === 'diff' || normalized === 'visualdiff') return 'handoffDiff';
|
|
30
|
+
return 'review';
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function quoteBlock(value: string): string {
|
|
34
|
+
return value.trim() || '(blank)';
|
|
35
|
+
}
|