voratiq 0.1.0-beta.21 → 0.1.0-beta.23
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/README.md +19 -23
- package/dist/agents/launch/chat.d.ts +3 -1
- package/dist/agents/launch/chat.js +2 -0
- package/dist/agents/runtime/policy.js +2 -1
- package/dist/auth/providers/utils.js +1 -1
- package/dist/bin.js +28 -7
- package/dist/cli/auto.js +4 -16
- package/dist/cli/contract.d.ts +26 -17
- package/dist/cli/contract.js +3 -1
- package/dist/cli/doctor.d.ts +12 -0
- package/dist/cli/doctor.js +115 -0
- package/dist/cli/list.js +5 -1
- package/dist/cli/message.js +16 -11
- package/dist/cli/operator-envelope.d.ts +27 -7
- package/dist/cli/operator-envelope.js +95 -3
- package/dist/cli/option-parsers.d.ts +2 -0
- package/dist/cli/option-parsers.js +7 -0
- package/dist/cli/output.d.ts +1 -5
- package/dist/cli/reduce.js +5 -13
- package/dist/cli/run.js +5 -12
- package/dist/cli/spec.js +4 -10
- package/dist/cli/verify.d.ts +1 -1
- package/dist/cli/verify.js +51 -22
- package/dist/commands/auto/command.d.ts +1 -0
- package/dist/commands/auto/command.js +22 -15
- package/dist/commands/auto/errors.js +1 -1
- package/dist/commands/auto/validation.js +3 -1
- package/dist/commands/doctor/agents.d.ts +5 -0
- package/dist/commands/{init → doctor}/agents.js +40 -20
- package/dist/commands/doctor/command.d.ts +22 -0
- package/dist/commands/doctor/command.js +100 -0
- package/dist/commands/doctor/environment.d.ts +2 -0
- package/dist/commands/{init → doctor}/environment.js +41 -7
- package/dist/commands/{init/types.d.ts → doctor/fix-types.d.ts} +30 -9
- package/dist/commands/doctor/fix.d.ts +2 -0
- package/dist/commands/{init/command.js → doctor/fix.js} +109 -11
- package/dist/commands/doctor/reconcile.d.ts +2 -0
- package/dist/commands/doctor/reconcile.js +103 -0
- package/dist/commands/interactive/lifecycle.d.ts +2 -0
- package/dist/commands/interactive/lifecycle.js +16 -0
- package/dist/commands/list/command.d.ts +1 -0
- package/dist/commands/list/command.js +241 -361
- package/dist/commands/list/normalization.d.ts +51 -0
- package/dist/commands/list/normalization.js +309 -0
- package/dist/commands/list/records.d.ts +9 -0
- package/dist/commands/list/records.js +6 -0
- package/dist/commands/message/command.d.ts +2 -2
- package/dist/commands/message/command.js +29 -16
- package/dist/commands/message/errors.d.ts +12 -3
- package/dist/commands/message/errors.js +19 -3
- package/dist/commands/prune/command.js +4 -1
- package/dist/commands/reduce/command.js +16 -17
- package/dist/commands/reduce/errors.d.ts +2 -2
- package/dist/commands/reduce/errors.js +3 -3
- package/dist/commands/reduce/targets.js +12 -3
- package/dist/commands/root-launcher/command.js +12 -6
- package/dist/commands/run/command.d.ts +1 -0
- package/dist/commands/run/command.js +4 -1
- package/dist/commands/run/record-init.d.ts +2 -0
- package/dist/commands/run/record-init.js +8 -1
- package/dist/commands/run/spec-provenance.d.ts +37 -0
- package/dist/commands/run/spec-provenance.js +384 -0
- package/dist/commands/run/validation.d.ts +4 -0
- package/dist/commands/run/validation.js +25 -62
- package/dist/commands/shared/resolve-stage-competitors.js +2 -1
- package/dist/commands/spec/command.js +64 -138
- package/dist/commands/spec/errors.d.ts +5 -0
- package/dist/commands/spec/errors.js +9 -0
- package/dist/commands/verify/agents.d.ts +4 -2
- package/dist/commands/verify/agents.js +4 -11
- package/dist/commands/verify/command.js +23 -6
- package/dist/commands/verify/errors.d.ts +12 -0
- package/dist/commands/verify/errors.js +22 -0
- package/dist/commands/verify/lifecycle.js +1 -1
- package/dist/commands/verify/targets.js +108 -12
- package/dist/competition/shared/preflight.d.ts +1 -1
- package/dist/competition/shared/preflight.js +15 -2
- package/dist/competition/shared/teardown.d.ts +7 -0
- package/dist/competition/shared/teardown.js +6 -0
- package/dist/configs/agents/defaults.js +13 -44
- package/dist/configs/agents/loader.js +1 -1
- package/dist/configs/environment/loader.js +2 -1
- package/dist/configs/orchestration/loader.js +2 -1
- package/dist/configs/sandbox/loader.js +2 -1
- package/dist/configs/settings/loader.js +1 -1
- package/dist/configs/verification/loader.js +2 -1
- package/dist/contracts/list.d.ts +129 -149
- package/dist/contracts/list.js +47 -99
- package/dist/domain/interactive/model/types.d.ts +2 -0
- package/dist/domain/interactive/model/types.js +16 -1
- package/dist/domain/interactive/persistence/adapter.d.ts +23 -0
- package/dist/domain/interactive/persistence/adapter.js +67 -5
- package/dist/domain/interactive/prompt.d.ts +1 -1
- package/dist/domain/interactive/prompt.js +1 -1
- package/dist/domain/interactive/session-env.d.ts +10 -0
- package/dist/domain/interactive/session-env.js +25 -0
- package/dist/domain/message/competition/adapter.js +3 -9
- package/dist/domain/message/model/types.d.ts +32 -1
- package/dist/domain/message/model/types.js +25 -1
- package/dist/domain/reduce/competition/adapter.js +30 -16
- package/dist/domain/reduce/competition/finalize.d.ts +7 -0
- package/dist/domain/reduce/competition/finalize.js +19 -0
- package/dist/domain/reduce/model/types.d.ts +3 -3
- package/dist/domain/run/competition/agents/artifacts.js +4 -2
- package/dist/domain/run/competition/agents/lifecycle.js +1 -1
- package/dist/domain/run/competition/agents/workspace.js +2 -1
- package/dist/domain/run/competition/errors.d.ts +1 -1
- package/dist/domain/run/competition/errors.js +4 -7
- package/dist/domain/run/competition/reports.js +2 -1
- package/dist/domain/run/model/enhanced.d.ts +1 -1
- package/dist/domain/run/model/enhanced.js +2 -1
- package/dist/domain/run/model/types.d.ts +384 -0
- package/dist/domain/run/model/types.js +87 -0
- package/dist/domain/spec/competition/adapter.d.ts +1 -0
- package/dist/domain/spec/competition/adapter.js +9 -10
- package/dist/domain/spec/model/mutators.d.ts +20 -0
- package/dist/domain/spec/model/mutators.js +146 -0
- package/dist/domain/spec/model/types.d.ts +3 -0
- package/dist/domain/spec/model/types.js +5 -0
- package/dist/domain/spec/persistence/adapter.d.ts +1 -0
- package/dist/domain/spec/persistence/adapter.js +7 -2
- package/dist/domain/verify/competition/adapter.d.ts +1 -1
- package/dist/domain/verify/competition/adapter.js +4 -9
- package/dist/domain/verify/competition/finalize.d.ts +9 -0
- package/dist/domain/verify/competition/finalize.js +22 -3
- package/dist/domain/verify/competition/programmatic.js +2 -1
- package/dist/domain/verify/competition/prompt.js +1 -1
- package/dist/domain/verify/competition/shared-layout.js +1 -1
- package/dist/domain/verify/model/types.d.ts +2 -2
- package/dist/interactive/providers/launch.d.ts +2 -0
- package/dist/interactive/providers/launch.js +19 -2
- package/dist/interactive/providers/mcp.d.ts +1 -0
- package/dist/interactive/providers/mcp.js +45 -7
- package/dist/interactive/substrate.js +32 -5
- package/dist/mcp/server.d.ts +1 -0
- package/dist/mcp/server.js +337 -44
- package/dist/policy/auto.d.ts +0 -1
- package/dist/policy/auto.js +3 -14
- package/dist/policy/verification.js +18 -1
- package/dist/preflight/agents.d.ts +24 -0
- package/dist/preflight/agents.js +71 -0
- package/dist/preflight/environment.d.ts +6 -0
- package/dist/preflight/environment.js +17 -0
- package/dist/preflight/formatting.d.ts +5 -0
- package/dist/preflight/formatting.js +20 -0
- package/dist/preflight/index.d.ts +2 -0
- package/dist/preflight/index.js +6 -9
- package/dist/preflight/operator.d.ts +32 -0
- package/dist/preflight/operator.js +40 -0
- package/dist/preflight/settings.d.ts +2 -0
- package/dist/preflight/settings.js +17 -0
- package/dist/render/transcripts/apply.js +2 -1
- package/dist/render/transcripts/interactive.d.ts +16 -0
- package/dist/render/transcripts/interactive.js +42 -0
- package/dist/render/transcripts/list.d.ts +41 -0
- package/dist/render/transcripts/list.js +152 -3
- package/dist/render/transcripts/message.d.ts +3 -5
- package/dist/render/transcripts/message.js +29 -74
- package/dist/render/transcripts/reduce.d.ts +2 -4
- package/dist/render/transcripts/reduce.js +31 -75
- package/dist/render/transcripts/root-launcher.js +2 -12
- package/dist/render/transcripts/run.d.ts +4 -4
- package/dist/render/transcripts/run.js +36 -47
- package/dist/render/transcripts/spec.d.ts +1 -4
- package/dist/render/transcripts/spec.js +15 -62
- package/dist/render/transcripts/verify.d.ts +6 -7
- package/dist/render/transcripts/verify.js +54 -85
- package/dist/render/utils/cli-writer.d.ts +4 -0
- package/dist/render/utils/cli-writer.js +1 -0
- package/dist/render/utils/duration.d.ts +5 -0
- package/dist/render/utils/duration.js +6 -0
- package/dist/render/utils/progressive-render.d.ts +3 -0
- package/dist/render/utils/progressive-render.js +44 -0
- package/dist/render/utils/runs.d.ts +1 -0
- package/dist/render/utils/runs.js +1 -0
- package/dist/render/utils/transcript-shell.d.ts +2 -1
- package/dist/render/utils/transcript-shell.js +19 -6
- package/dist/utils/diff.d.ts +2 -0
- package/dist/utils/diff.js +1 -0
- package/dist/utils/errors.d.ts +2 -1
- package/dist/utils/errors.js +3 -1
- package/dist/utils/git.d.ts +1 -1
- package/dist/utils/git.js +25 -2
- package/dist/utils/list-target.d.ts +4 -0
- package/dist/utils/list-target.js +35 -0
- package/dist/utils/swarm-session-ack.d.ts +9 -0
- package/dist/utils/swarm-session-ack.js +17 -0
- package/dist/utils/terminal.d.ts +1 -0
- package/dist/utils/terminal.js +11 -0
- package/dist/workspace/artifact-paths.d.ts +55 -0
- package/dist/workspace/artifact-paths.js +106 -0
- package/dist/workspace/chat/artifacts.d.ts +7 -0
- package/dist/workspace/chat/artifacts.js +95 -4
- package/dist/workspace/chat/native-usage.js +1 -1
- package/dist/workspace/chat/sources.d.ts +2 -5
- package/dist/workspace/chat/sources.js +4 -4
- package/dist/workspace/constants.d.ts +47 -0
- package/dist/workspace/constants.js +47 -0
- package/dist/workspace/errors.js +2 -2
- package/dist/workspace/layout.js +3 -1
- package/dist/workspace/managed-state.d.ts +32 -0
- package/dist/workspace/managed-state.js +104 -0
- package/dist/workspace/path-formatters.d.ts +9 -0
- package/dist/workspace/path-formatters.js +46 -0
- package/dist/workspace/path-resolvers.d.ts +1 -0
- package/dist/workspace/path-resolvers.js +5 -0
- package/dist/workspace/session-paths.d.ts +16 -0
- package/dist/workspace/session-paths.js +59 -0
- package/dist/workspace/setup.js +67 -2
- package/dist/workspace/shim.d.ts +1 -0
- package/dist/workspace/shim.js +3 -3
- package/package.json +2 -2
- package/dist/cli/init.d.ts +0 -15
- package/dist/cli/init.js +0 -70
- package/dist/commands/init/agents.d.ts +0 -4
- package/dist/commands/init/command.d.ts +0 -2
- package/dist/commands/init/environment.d.ts +0 -2
- package/dist/render/transcripts/init.d.ts +0 -7
- package/dist/render/transcripts/init.js +0 -83
- package/dist/workspace/structure.d.ts +0 -143
- package/dist/workspace/structure.js +0 -319
- /package/dist/commands/{init/types.js → doctor/fix-types.js} +0 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { ListJsonArtifact, ListJsonChanges, ListJsonTargetRef, ListOperator } from "../../contracts/list.js";
|
|
2
|
+
export { formatTargetDisplay, formatTargetTablePreview, TARGET_TABLE_PREVIEW_LENGTH, } from "../../utils/list-target.js";
|
|
3
|
+
import { type ListRecord } from "./records.js";
|
|
4
|
+
export type ListTargetOperator = ListOperator;
|
|
5
|
+
export type ListSessionTarget = {
|
|
6
|
+
kind: ListTargetOperator;
|
|
7
|
+
sessionId: string;
|
|
8
|
+
};
|
|
9
|
+
export type ListLaneTarget = {
|
|
10
|
+
kind: Exclude<ListTargetOperator, "interactive">;
|
|
11
|
+
sessionId: string;
|
|
12
|
+
agentId: string;
|
|
13
|
+
};
|
|
14
|
+
export type ListFileTarget = {
|
|
15
|
+
kind: "file";
|
|
16
|
+
path: string;
|
|
17
|
+
};
|
|
18
|
+
export type ListTarget = ListSessionTarget | ListLaneTarget | ListFileTarget;
|
|
19
|
+
export type ListOperatorRecord = ListRecord;
|
|
20
|
+
export interface NormalizedListSession {
|
|
21
|
+
operator: ListOperator;
|
|
22
|
+
sessionId: string;
|
|
23
|
+
status: string;
|
|
24
|
+
createdAt: string;
|
|
25
|
+
target?: ListTarget;
|
|
26
|
+
description?: string | null;
|
|
27
|
+
}
|
|
28
|
+
export interface NormalizedListAgent {
|
|
29
|
+
agentId: string | null;
|
|
30
|
+
status: string;
|
|
31
|
+
startedAt?: string;
|
|
32
|
+
completedAt?: string;
|
|
33
|
+
verifier?: string;
|
|
34
|
+
diffStatistics?: string;
|
|
35
|
+
changes?: ListJsonChanges;
|
|
36
|
+
outputPath?: string;
|
|
37
|
+
dataPath?: string;
|
|
38
|
+
errorLine?: string;
|
|
39
|
+
artifacts: ListJsonArtifact[];
|
|
40
|
+
}
|
|
41
|
+
export interface NormalizedListDetailSession extends NormalizedListSession {
|
|
42
|
+
startedAt?: string;
|
|
43
|
+
completedAt?: string;
|
|
44
|
+
workspacePath: string;
|
|
45
|
+
agents: NormalizedListAgent[];
|
|
46
|
+
}
|
|
47
|
+
export declare function normalizeListSession(operator: ListOperator, record: ListOperatorRecord): NormalizedListSession;
|
|
48
|
+
export declare function normalizeListDetailSession(operator: ListOperator, record: ListOperatorRecord): NormalizedListDetailSession;
|
|
49
|
+
export declare function normalizeListTarget(operator: ListOperator, record: ListOperatorRecord): ListTarget | undefined;
|
|
50
|
+
export declare function toListJsonTargetRef(target: ListTarget): ListJsonTargetRef;
|
|
51
|
+
export declare function normalizeDescription(description: string | null | undefined): string | null;
|
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
import { buildRunRecordEnhanced } from "../../domain/run/model/enhanced.js";
|
|
2
|
+
import { extractStat } from "../../utils/diff.js";
|
|
3
|
+
import { getInteractiveSessionDirectoryPath, getMessageSessionDirectoryPath, getReductionSessionDirectoryPath, getRunDirectoryPath, getSpecSessionDirectoryPath, getVerificationSessionDirectoryPath, } from "../../workspace/session-paths.js";
|
|
4
|
+
export { formatTargetDisplay, formatTargetTablePreview, TARGET_TABLE_PREVIEW_LENGTH, } from "../../utils/list-target.js";
|
|
5
|
+
import { getListRecordId } from "./records.js";
|
|
6
|
+
const FILES_CHANGED_PATTERN = /(\d+)\s+file/u;
|
|
7
|
+
const INSERTIONS_PATTERN = /(\d+)\s+insertion/u;
|
|
8
|
+
const DELETIONS_PATTERN = /(\d+)\s+deletion/u;
|
|
9
|
+
export function normalizeListSession(operator, record) {
|
|
10
|
+
return {
|
|
11
|
+
operator,
|
|
12
|
+
sessionId: getListRecordId(operator, record),
|
|
13
|
+
status: getRecordStatus(record),
|
|
14
|
+
createdAt: getRecordCreatedAt(record),
|
|
15
|
+
target: normalizeListTarget(operator, record),
|
|
16
|
+
...(operator === "spec"
|
|
17
|
+
? {
|
|
18
|
+
description: normalizeDescription(record.description),
|
|
19
|
+
}
|
|
20
|
+
: {}),
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export function normalizeListDetailSession(operator, record) {
|
|
24
|
+
const session = normalizeListSession(operator, record);
|
|
25
|
+
if (operator === "run") {
|
|
26
|
+
const runRecord = record;
|
|
27
|
+
const enhancedRunRecord = buildRunRecordEnhanced(runRecord);
|
|
28
|
+
return {
|
|
29
|
+
...session,
|
|
30
|
+
startedAt: runRecord.startedAt,
|
|
31
|
+
completedAt: runRecord.completedAt,
|
|
32
|
+
workspacePath: getRunDirectoryPath(runRecord.runId),
|
|
33
|
+
agents: enhancedRunRecord.agents.map((agent) => ({
|
|
34
|
+
agentId: agent.agentId,
|
|
35
|
+
status: agent.status,
|
|
36
|
+
startedAt: agent.startedAt,
|
|
37
|
+
completedAt: agent.completedAt,
|
|
38
|
+
diffStatistics: agent.diffStatistics,
|
|
39
|
+
changes: parseDiffStatistics(agent.diffStatistics),
|
|
40
|
+
outputPath: agent.assets.diffPath,
|
|
41
|
+
errorLine: agent.error ?? undefined,
|
|
42
|
+
artifacts: agent.assets.diffPath
|
|
43
|
+
? [
|
|
44
|
+
{
|
|
45
|
+
kind: "diff",
|
|
46
|
+
role: "output",
|
|
47
|
+
path: agent.assets.diffPath,
|
|
48
|
+
},
|
|
49
|
+
]
|
|
50
|
+
: [],
|
|
51
|
+
})),
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
if (operator === "spec") {
|
|
55
|
+
const specRecord = record;
|
|
56
|
+
return {
|
|
57
|
+
...session,
|
|
58
|
+
startedAt: specRecord.startedAt,
|
|
59
|
+
completedAt: specRecord.completedAt,
|
|
60
|
+
workspacePath: getSpecSessionDirectoryPath(specRecord.sessionId),
|
|
61
|
+
agents: specRecord.agents.map((agent) => ({
|
|
62
|
+
agentId: agent.agentId,
|
|
63
|
+
status: agent.status,
|
|
64
|
+
startedAt: agent.startedAt,
|
|
65
|
+
completedAt: agent.completedAt,
|
|
66
|
+
outputPath: agent.outputPath,
|
|
67
|
+
dataPath: agent.dataPath,
|
|
68
|
+
errorLine: agent.error ?? undefined,
|
|
69
|
+
artifacts: [
|
|
70
|
+
...(agent.outputPath
|
|
71
|
+
? [
|
|
72
|
+
{
|
|
73
|
+
kind: "spec",
|
|
74
|
+
role: "output",
|
|
75
|
+
path: agent.outputPath,
|
|
76
|
+
},
|
|
77
|
+
]
|
|
78
|
+
: []),
|
|
79
|
+
...(agent.dataPath
|
|
80
|
+
? [
|
|
81
|
+
{
|
|
82
|
+
kind: "spec",
|
|
83
|
+
role: "data",
|
|
84
|
+
path: agent.dataPath,
|
|
85
|
+
},
|
|
86
|
+
]
|
|
87
|
+
: []),
|
|
88
|
+
],
|
|
89
|
+
})),
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
if (operator === "reduce") {
|
|
93
|
+
const reductionRecord = record;
|
|
94
|
+
return {
|
|
95
|
+
...session,
|
|
96
|
+
startedAt: reductionRecord.startedAt,
|
|
97
|
+
completedAt: reductionRecord.completedAt,
|
|
98
|
+
workspacePath: getReductionSessionDirectoryPath(reductionRecord.sessionId),
|
|
99
|
+
agents: reductionRecord.reducers.map((reducer) => ({
|
|
100
|
+
agentId: reducer.agentId,
|
|
101
|
+
status: reducer.status,
|
|
102
|
+
startedAt: reducer.startedAt,
|
|
103
|
+
completedAt: reducer.completedAt,
|
|
104
|
+
outputPath: reducer.outputPath,
|
|
105
|
+
dataPath: reducer.dataPath,
|
|
106
|
+
errorLine: reducer.error ?? undefined,
|
|
107
|
+
artifacts: [
|
|
108
|
+
...(reducer.outputPath
|
|
109
|
+
? [
|
|
110
|
+
{
|
|
111
|
+
kind: "reduction",
|
|
112
|
+
role: "output",
|
|
113
|
+
path: reducer.outputPath,
|
|
114
|
+
},
|
|
115
|
+
]
|
|
116
|
+
: []),
|
|
117
|
+
...(reducer.dataPath
|
|
118
|
+
? [
|
|
119
|
+
{
|
|
120
|
+
kind: "reduction",
|
|
121
|
+
role: "data",
|
|
122
|
+
path: reducer.dataPath,
|
|
123
|
+
},
|
|
124
|
+
]
|
|
125
|
+
: []),
|
|
126
|
+
],
|
|
127
|
+
})),
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
if (operator === "message") {
|
|
131
|
+
const messageRecord = record;
|
|
132
|
+
return {
|
|
133
|
+
...session,
|
|
134
|
+
startedAt: messageRecord.startedAt,
|
|
135
|
+
completedAt: messageRecord.completedAt,
|
|
136
|
+
workspacePath: getMessageSessionDirectoryPath(messageRecord.sessionId),
|
|
137
|
+
agents: messageRecord.recipients.map((recipient) => ({
|
|
138
|
+
agentId: recipient.agentId,
|
|
139
|
+
status: recipient.status,
|
|
140
|
+
startedAt: recipient.startedAt,
|
|
141
|
+
completedAt: recipient.completedAt,
|
|
142
|
+
outputPath: recipient.outputPath,
|
|
143
|
+
errorLine: recipient.error ?? undefined,
|
|
144
|
+
artifacts: recipient.outputPath
|
|
145
|
+
? [
|
|
146
|
+
{
|
|
147
|
+
kind: "response",
|
|
148
|
+
role: "output",
|
|
149
|
+
path: recipient.outputPath,
|
|
150
|
+
},
|
|
151
|
+
]
|
|
152
|
+
: [],
|
|
153
|
+
})),
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
if (operator === "interactive") {
|
|
157
|
+
const interactiveRecord = record;
|
|
158
|
+
return {
|
|
159
|
+
...session,
|
|
160
|
+
startedAt: interactiveRecord.startedAt,
|
|
161
|
+
completedAt: interactiveRecord.completedAt,
|
|
162
|
+
workspacePath: getInteractiveSessionDirectoryPath(interactiveRecord.sessionId),
|
|
163
|
+
agents: [
|
|
164
|
+
{
|
|
165
|
+
agentId: interactiveRecord.agentId,
|
|
166
|
+
status: interactiveRecord.status,
|
|
167
|
+
startedAt: interactiveRecord.startedAt,
|
|
168
|
+
completedAt: interactiveRecord.completedAt,
|
|
169
|
+
outputPath: interactiveRecord.chat?.captured
|
|
170
|
+
? interactiveRecord.chat.artifactPath
|
|
171
|
+
: undefined,
|
|
172
|
+
artifacts: interactiveRecord.chat?.captured &&
|
|
173
|
+
interactiveRecord.chat.artifactPath
|
|
174
|
+
? [
|
|
175
|
+
{
|
|
176
|
+
kind: "chat",
|
|
177
|
+
role: "output",
|
|
178
|
+
path: interactiveRecord.chat.artifactPath,
|
|
179
|
+
},
|
|
180
|
+
]
|
|
181
|
+
: [],
|
|
182
|
+
},
|
|
183
|
+
],
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
const verificationRecord = record;
|
|
187
|
+
return {
|
|
188
|
+
...session,
|
|
189
|
+
startedAt: verificationRecord.startedAt,
|
|
190
|
+
completedAt: verificationRecord.completedAt,
|
|
191
|
+
workspacePath: getVerificationSessionDirectoryPath(verificationRecord.sessionId),
|
|
192
|
+
agents: verificationRecord.methods.map(normalizeVerificationMethod),
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
export function normalizeListTarget(operator, record) {
|
|
196
|
+
if (operator === "spec" || operator === "interactive") {
|
|
197
|
+
return undefined;
|
|
198
|
+
}
|
|
199
|
+
if (operator === "message") {
|
|
200
|
+
return normalizeMessageTarget(record);
|
|
201
|
+
}
|
|
202
|
+
if (operator === "run") {
|
|
203
|
+
return normalizeRunTarget(record);
|
|
204
|
+
}
|
|
205
|
+
if (operator === "reduce") {
|
|
206
|
+
const reductionRecord = record;
|
|
207
|
+
return {
|
|
208
|
+
kind: reductionRecord.target.type,
|
|
209
|
+
sessionId: reductionRecord.target.id,
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
const verificationRecord = record;
|
|
213
|
+
return {
|
|
214
|
+
kind: verificationRecord.target.kind,
|
|
215
|
+
sessionId: verificationRecord.target.sessionId,
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
export function toListJsonTargetRef(target) {
|
|
219
|
+
return target.kind === "file"
|
|
220
|
+
? target
|
|
221
|
+
: {
|
|
222
|
+
kind: target.kind,
|
|
223
|
+
sessionId: target.sessionId,
|
|
224
|
+
...("agentId" in target && target.agentId
|
|
225
|
+
? { agentId: target.agentId }
|
|
226
|
+
: {}),
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
export function normalizeDescription(description) {
|
|
230
|
+
if (typeof description !== "string") {
|
|
231
|
+
return null;
|
|
232
|
+
}
|
|
233
|
+
const normalized = description.replace(/\s+/gu, " ").trim();
|
|
234
|
+
return normalized.length > 0 ? normalized : null;
|
|
235
|
+
}
|
|
236
|
+
function normalizeRunTarget(record) {
|
|
237
|
+
if (record.spec.target?.kind === "spec") {
|
|
238
|
+
return {
|
|
239
|
+
kind: "spec",
|
|
240
|
+
sessionId: record.spec.target.sessionId,
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
return {
|
|
244
|
+
kind: "file",
|
|
245
|
+
path: record.spec.path,
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
function normalizeMessageTarget(record) {
|
|
249
|
+
if (!record.target) {
|
|
250
|
+
return undefined;
|
|
251
|
+
}
|
|
252
|
+
if (record.target.agentId) {
|
|
253
|
+
return {
|
|
254
|
+
kind: record.target.kind,
|
|
255
|
+
sessionId: record.target.sessionId,
|
|
256
|
+
agentId: record.target.agentId,
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
return {
|
|
260
|
+
kind: record.target.kind,
|
|
261
|
+
sessionId: record.target.sessionId,
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
function normalizeVerificationMethod(method) {
|
|
265
|
+
return {
|
|
266
|
+
agentId: method.verifierId ?? null,
|
|
267
|
+
verifier: method.method === "programmatic"
|
|
268
|
+
? "programmatic"
|
|
269
|
+
: (method.template ?? "rubric"),
|
|
270
|
+
status: method.status,
|
|
271
|
+
startedAt: method.startedAt,
|
|
272
|
+
completedAt: method.completedAt,
|
|
273
|
+
outputPath: method.artifactPath,
|
|
274
|
+
errorLine: method.error ?? undefined,
|
|
275
|
+
artifacts: method.artifactPath
|
|
276
|
+
? [
|
|
277
|
+
{
|
|
278
|
+
kind: "verification-result",
|
|
279
|
+
role: "output",
|
|
280
|
+
path: method.artifactPath,
|
|
281
|
+
},
|
|
282
|
+
]
|
|
283
|
+
: [],
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
function parseDiffStatistics(value) {
|
|
287
|
+
if (!value) {
|
|
288
|
+
return undefined;
|
|
289
|
+
}
|
|
290
|
+
const filesChanged = extractStat(FILES_CHANGED_PATTERN, value);
|
|
291
|
+
const insertions = extractStat(INSERTIONS_PATTERN, value);
|
|
292
|
+
const deletions = extractStat(DELETIONS_PATTERN, value);
|
|
293
|
+
if (filesChanged === undefined &&
|
|
294
|
+
insertions === undefined &&
|
|
295
|
+
deletions === undefined) {
|
|
296
|
+
return undefined;
|
|
297
|
+
}
|
|
298
|
+
return {
|
|
299
|
+
...(filesChanged !== undefined ? { filesChanged } : {}),
|
|
300
|
+
...(insertions !== undefined ? { insertions } : {}),
|
|
301
|
+
...(deletions !== undefined ? { deletions } : {}),
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
function getRecordStatus(record) {
|
|
305
|
+
return record.status;
|
|
306
|
+
}
|
|
307
|
+
function getRecordCreatedAt(record) {
|
|
308
|
+
return record.createdAt;
|
|
309
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ListOperator } from "../../contracts/list.js";
|
|
2
|
+
import type { InteractiveSessionRecord } from "../../domain/interactive/model/types.js";
|
|
3
|
+
import type { MessageRecord } from "../../domain/message/model/types.js";
|
|
4
|
+
import type { ReductionRecord } from "../../domain/reduce/model/types.js";
|
|
5
|
+
import type { RunRecord } from "../../domain/run/model/types.js";
|
|
6
|
+
import type { SpecRecord } from "../../domain/spec/model/types.js";
|
|
7
|
+
import type { VerificationRecord } from "../../domain/verify/model/types.js";
|
|
8
|
+
export type ListRecord = InteractiveSessionRecord | RunRecord | SpecRecord | MessageRecord | ReductionRecord | VerificationRecord;
|
|
9
|
+
export declare function getListRecordId(operator: ListOperator, record: ListRecord): string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ResolvedExtraContextFile } from "../../competition/shared/extra-context.js";
|
|
2
2
|
import { type MessageCompetitionExecution } from "../../domain/message/competition/adapter.js";
|
|
3
|
-
import { type MessageRecipientEntry, type MessageRecord } from "../../domain/message/model/types.js";
|
|
3
|
+
import { type MessageRecipientEntry, type MessageRecord, type MessageTarget } from "../../domain/message/model/types.js";
|
|
4
4
|
import type { MessageProgressRenderer } from "../../render/transcripts/message.js";
|
|
5
5
|
export interface ExecuteMessageCommandInput {
|
|
6
6
|
root: string;
|
|
@@ -11,7 +11,7 @@ export interface ExecuteMessageCommandInput {
|
|
|
11
11
|
profileName?: string;
|
|
12
12
|
maxParallel?: number;
|
|
13
13
|
extraContextFiles?: readonly ResolvedExtraContextFile[];
|
|
14
|
-
|
|
14
|
+
target?: MessageTarget;
|
|
15
15
|
renderer?: MessageProgressRenderer;
|
|
16
16
|
}
|
|
17
17
|
export interface ExecuteMessageCommandResult {
|
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import { verifyAgentProviders } from "../../agents/runtime/auth.js";
|
|
2
1
|
import { executeCompetitionWithAdapter } from "../../competition/command-adapter.js";
|
|
3
2
|
import { createTeardownController } from "../../competition/shared/teardown.js";
|
|
4
3
|
import { AgentNotFoundError } from "../../configs/agents/errors.js";
|
|
5
|
-
import { loadEnvironmentConfig } from "../../configs/environment/loader.js";
|
|
6
4
|
import { createMessageCompetitionAdapter, } from "../../domain/message/competition/adapter.js";
|
|
7
5
|
import { createMessageRecordMutators } from "../../domain/message/model/mutators.js";
|
|
8
6
|
import { deriveMessageStatusFromRecipients, } from "../../domain/message/model/types.js";
|
|
9
7
|
import { appendMessageRecord, flushMessageRecordBuffer, } from "../../domain/message/persistence/adapter.js";
|
|
10
8
|
import { buildPersistedExtraContextFields } from "../../extra-context/contract.js";
|
|
9
|
+
import { loadOperatorEnvironment } from "../../preflight/environment.js";
|
|
10
|
+
import { prepareConfiguredOperatorReadiness } from "../../preflight/operator.js";
|
|
11
11
|
import { toErrorMessage } from "../../utils/errors.js";
|
|
12
12
|
import { getHeadRevision } from "../../utils/git.js";
|
|
13
|
-
import {
|
|
13
|
+
import { emitSwarmSessionAcknowledgement } from "../../utils/swarm-session-ack.js";
|
|
14
|
+
import { VORATIQ_MESSAGE_DIR, VORATIQ_REDUCTION_DIR, VORATIQ_RUN_DIR, VORATIQ_SPEC_DIR, VORATIQ_VERIFICATION_DIR, } from "../../workspace/constants.js";
|
|
14
15
|
import { resolveEffectiveMaxParallel } from "../shared/max-parallel.js";
|
|
15
16
|
import { resolveStageCompetitors } from "../shared/resolve-stage-competitors.js";
|
|
16
17
|
import { generateSessionId } from "../shared/session-id.js";
|
|
17
|
-
import { MessageAgentNotFoundError, MessageGenerationFailedError, MessageInvocationContextError, } from "./errors.js";
|
|
18
|
+
import { MessageAgentNotFoundError, MessageGenerationFailedError, MessageInvocationContextError, MessagePreflightError, } from "./errors.js";
|
|
18
19
|
import { finalizeActiveMessage, registerActiveMessage } from "./lifecycle.js";
|
|
19
20
|
export async function executeMessageCommand(input) {
|
|
20
21
|
assertMessageInvocationContext();
|
|
21
|
-
const { root, messagesFilePath, prompt, agentIds, agentOverrideFlag, profileName, maxParallel: requestedMaxParallel, extraContextFiles = [],
|
|
22
|
-
let
|
|
22
|
+
const { root, messagesFilePath, prompt, agentIds, agentOverrideFlag, profileName, maxParallel: requestedMaxParallel, extraContextFiles = [], target, renderer, } = input;
|
|
23
|
+
let resolvedAgentIds;
|
|
23
24
|
try {
|
|
24
25
|
const resolution = resolveStageCompetitors({
|
|
25
26
|
root,
|
|
@@ -27,8 +28,9 @@ export async function executeMessageCommand(input) {
|
|
|
27
28
|
cliAgentIds: agentIds,
|
|
28
29
|
cliOverrideFlag: agentOverrideFlag,
|
|
29
30
|
profileName,
|
|
31
|
+
includeDefinitions: false,
|
|
30
32
|
});
|
|
31
|
-
|
|
33
|
+
resolvedAgentIds = resolution.agentIds;
|
|
32
34
|
}
|
|
33
35
|
catch (error) {
|
|
34
36
|
if (error instanceof AgentNotFoundError) {
|
|
@@ -36,12 +38,21 @@ export async function executeMessageCommand(input) {
|
|
|
36
38
|
}
|
|
37
39
|
throw error;
|
|
38
40
|
}
|
|
39
|
-
await
|
|
40
|
-
|
|
41
|
+
const preflight = await prepareConfiguredOperatorReadiness({
|
|
42
|
+
root,
|
|
43
|
+
resolvedAgentIds,
|
|
44
|
+
includeEnvironment: false,
|
|
45
|
+
});
|
|
46
|
+
if (preflight.issues.length > 0) {
|
|
47
|
+
throw new MessagePreflightError(preflight.issues, preflight.preProviderIssueCount);
|
|
48
|
+
}
|
|
49
|
+
const competitors = preflight.agents;
|
|
50
|
+
const environment = loadOperatorEnvironment({ root });
|
|
41
51
|
const baseRevisionSha = await getHeadRevision(root);
|
|
42
52
|
const messageId = generateSessionId();
|
|
43
53
|
const createdAt = new Date().toISOString();
|
|
44
54
|
const startedAt = createdAt;
|
|
55
|
+
const persistedTarget = resolveMessageTarget({ target });
|
|
45
56
|
const effectiveMaxParallel = resolveEffectiveMaxParallel({
|
|
46
57
|
competitorCount: competitors.length,
|
|
47
58
|
requestedMaxParallel,
|
|
@@ -62,9 +73,14 @@ export async function executeMessageCommand(input) {
|
|
|
62
73
|
prompt,
|
|
63
74
|
recipients: initialRecipients,
|
|
64
75
|
...buildPersistedExtraContextFields(extraContextFiles),
|
|
65
|
-
...(
|
|
76
|
+
...(persistedTarget ? { target: persistedTarget } : {}),
|
|
66
77
|
},
|
|
67
78
|
});
|
|
79
|
+
await emitSwarmSessionAcknowledgement({
|
|
80
|
+
operator: "message",
|
|
81
|
+
sessionId: messageId,
|
|
82
|
+
status: "running",
|
|
83
|
+
});
|
|
68
84
|
renderer?.begin({
|
|
69
85
|
messageId,
|
|
70
86
|
createdAt,
|
|
@@ -187,12 +203,6 @@ function toRecipientEntry(execution) {
|
|
|
187
203
|
error: execution.error ?? null,
|
|
188
204
|
};
|
|
189
205
|
}
|
|
190
|
-
async function assertMessagePreflight(agents) {
|
|
191
|
-
const providerIssues = await verifyAgentProviders(agents.map((agent) => ({ id: agent.id, provider: agent.provider })));
|
|
192
|
-
if (providerIssues.length > 0) {
|
|
193
|
-
throw new MessageGenerationFailedError(providerIssues.map((issue) => `${issue.agentId}: ${issue.message}`));
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
206
|
function assertMessageInvocationContext() {
|
|
197
207
|
const cwd = process.cwd().replace(/\\/gu, "/");
|
|
198
208
|
const batchDomains = [
|
|
@@ -213,3 +223,6 @@ function collectRecipientErrors(recipients) {
|
|
|
213
223
|
.map((recipient) => `${recipient.agentId}: ${recipient.error}`);
|
|
214
224
|
return details.length > 0 ? details.join("; ") : undefined;
|
|
215
225
|
}
|
|
226
|
+
function resolveMessageTarget(options) {
|
|
227
|
+
return options.target;
|
|
228
|
+
}
|
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
import { CliError } from "../../cli/errors.js";
|
|
2
|
+
import type { PreflightIssue } from "../../competition/shared/preflight.js";
|
|
3
|
+
export declare class MessageError extends CliError {
|
|
4
|
+
constructor(headline: string, detailLines?: readonly string[], hintLines?: readonly string[]);
|
|
5
|
+
}
|
|
6
|
+
export declare class MessageAgentNotFoundError extends MessageError {
|
|
2
7
|
constructor(agentId: string);
|
|
3
8
|
}
|
|
4
|
-
export declare class MessageGenerationFailedError extends
|
|
9
|
+
export declare class MessageGenerationFailedError extends MessageError {
|
|
5
10
|
constructor(details: readonly string[]);
|
|
6
11
|
}
|
|
7
|
-
export declare class
|
|
12
|
+
export declare class MessagePreflightError extends MessageError {
|
|
13
|
+
readonly issues: readonly PreflightIssue[];
|
|
14
|
+
constructor(issues: readonly PreflightIssue[], preProviderIssueCount: number);
|
|
15
|
+
}
|
|
16
|
+
export declare class MessageInvocationContextError extends MessageError {
|
|
8
17
|
constructor();
|
|
9
18
|
}
|
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
import { CliError } from "../../cli/errors.js";
|
|
2
|
+
import { formatOperatorPreflightIssueLines, resolveOperatorPreflightHintLines, } from "../../preflight/formatting.js";
|
|
3
|
+
export class MessageError extends CliError {
|
|
4
|
+
constructor(headline, detailLines = [], hintLines = []) {
|
|
5
|
+
super(headline, detailLines, hintLines);
|
|
6
|
+
this.name = "MessageError";
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export class MessageAgentNotFoundError extends MessageError {
|
|
2
10
|
constructor(agentId) {
|
|
3
11
|
super(`Message agent not found: ${agentId}`);
|
|
4
12
|
this.name = "MessageAgentNotFoundError";
|
|
5
13
|
}
|
|
6
14
|
}
|
|
7
|
-
export class MessageGenerationFailedError extends
|
|
15
|
+
export class MessageGenerationFailedError extends MessageError {
|
|
8
16
|
constructor(details) {
|
|
9
17
|
super(details.length > 0
|
|
10
18
|
? `Message execution failed: ${details.join("; ")}`
|
|
@@ -12,7 +20,15 @@ export class MessageGenerationFailedError extends Error {
|
|
|
12
20
|
this.name = "MessageGenerationFailedError";
|
|
13
21
|
}
|
|
14
22
|
}
|
|
15
|
-
export class
|
|
23
|
+
export class MessagePreflightError extends MessageError {
|
|
24
|
+
issues;
|
|
25
|
+
constructor(issues, preProviderIssueCount) {
|
|
26
|
+
super("Preflight failed. Aborting message.", formatOperatorPreflightIssueLines(issues), resolveOperatorPreflightHintLines(issues, preProviderIssueCount) ?? []);
|
|
27
|
+
this.issues = Array.from(issues);
|
|
28
|
+
this.name = "MessagePreflightError";
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export class MessageInvocationContextError extends MessageError {
|
|
16
32
|
constructor() {
|
|
17
33
|
super("`message` cannot be invoked from inside a batch agent workspace.");
|
|
18
34
|
this.name = "MessageInvocationContextError";
|
|
@@ -7,8 +7,11 @@ import { toErrorMessage } from "../../utils/errors.js";
|
|
|
7
7
|
import { pathExists } from "../../utils/fs.js";
|
|
8
8
|
import { getGitStderr, runGitCommand } from "../../utils/git.js";
|
|
9
9
|
import { normalizePathForDisplay, resolveDisplayPath, resolvePath, } from "../../utils/path.js";
|
|
10
|
+
import { buildAgentArtifactPaths, getAgentWorkspaceDirectoryPath, } from "../../workspace/artifact-paths.js";
|
|
11
|
+
import { VORATIQ_RUN_SESSIONS_DIR } from "../../workspace/constants.js";
|
|
12
|
+
import { resolveWorkspacePath } from "../../workspace/path-resolvers.js";
|
|
10
13
|
import { deriveAgentBranches, removeRunDirectory, removeWorkspaceEntry, } from "../../workspace/prune.js";
|
|
11
|
-
import {
|
|
14
|
+
import { getAgentDirectoryPath, getRunDirectoryPath, } from "../../workspace/session-paths.js";
|
|
12
15
|
import { fetchRunSafely } from "../fetch.js";
|
|
13
16
|
import { PruneBranchDeletionError, PruneRunDeletedError, RunMetadataMissingError, } from "./errors.js";
|
|
14
17
|
export async function executePruneCommand(input) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { verifyAgentProviders } from "../../agents/runtime/auth.js";
|
|
2
1
|
import { executeCompetitionWithAdapter } from "../../competition/command-adapter.js";
|
|
3
2
|
import { AgentNotFoundError } from "../../configs/agents/errors.js";
|
|
4
|
-
import { loadEnvironmentConfig } from "../../configs/environment/loader.js";
|
|
5
3
|
import { createReduceCompetitionAdapter, } from "../../domain/reduce/competition/adapter.js";
|
|
6
4
|
import { flushReductionRecordBuffer, readReductionRecords, } from "../../domain/reduce/persistence/adapter.js";
|
|
5
|
+
import { loadOperatorEnvironment } from "../../preflight/environment.js";
|
|
6
|
+
import { prepareConfiguredOperatorReadiness } from "../../preflight/operator.js";
|
|
7
7
|
import { toErrorMessage } from "../../utils/errors.js";
|
|
8
8
|
import { resolveEffectiveMaxParallel } from "../shared/max-parallel.js";
|
|
9
9
|
import { resolveReductionCompetitors } from "../shared/resolve-reduction-competitors.js";
|
|
@@ -21,14 +21,22 @@ export async function executeReduceCommand(input) {
|
|
|
21
21
|
verificationsFilePath,
|
|
22
22
|
target,
|
|
23
23
|
});
|
|
24
|
-
const
|
|
24
|
+
const reducerPlan = resolveReduceAgentPlan({
|
|
25
25
|
root,
|
|
26
26
|
agentIds,
|
|
27
27
|
agentOverrideFlag,
|
|
28
28
|
profileName,
|
|
29
29
|
});
|
|
30
|
-
await
|
|
31
|
-
|
|
30
|
+
const preflight = await prepareConfiguredOperatorReadiness({
|
|
31
|
+
root,
|
|
32
|
+
resolvedAgentIds: reducerPlan.agentIds,
|
|
33
|
+
includeEnvironment: false,
|
|
34
|
+
});
|
|
35
|
+
if (preflight.issues.length > 0) {
|
|
36
|
+
throw new ReducePreflightError(preflight.issues, preflight.preProviderIssueCount);
|
|
37
|
+
}
|
|
38
|
+
const reducers = preflight.agents;
|
|
39
|
+
const environment = loadOperatorEnvironment({ root });
|
|
32
40
|
const reductionId = generateSessionId();
|
|
33
41
|
const createdAt = new Date().toISOString();
|
|
34
42
|
const effectiveMaxParallel = resolveEffectiveMaxParallel({
|
|
@@ -106,16 +114,16 @@ export async function executeReduceCommand(input) {
|
|
|
106
114
|
reductions: reductionResults,
|
|
107
115
|
};
|
|
108
116
|
}
|
|
109
|
-
function
|
|
117
|
+
function resolveReduceAgentPlan(options) {
|
|
110
118
|
const { agentIds, root, agentOverrideFlag, profileName } = options;
|
|
111
119
|
try {
|
|
112
|
-
|
|
120
|
+
return resolveReductionCompetitors({
|
|
113
121
|
root,
|
|
114
122
|
cliAgentIds: agentIds,
|
|
115
123
|
cliOverrideFlag: agentOverrideFlag,
|
|
116
124
|
profileName,
|
|
125
|
+
includeDefinitions: false,
|
|
117
126
|
});
|
|
118
|
-
return [...resolution.competitors];
|
|
119
127
|
}
|
|
120
128
|
catch (error) {
|
|
121
129
|
if (error instanceof AgentNotFoundError) {
|
|
@@ -124,15 +132,6 @@ function resolveReduceAgents(options) {
|
|
|
124
132
|
throw error;
|
|
125
133
|
}
|
|
126
134
|
}
|
|
127
|
-
async function assertReducePreflight(agents) {
|
|
128
|
-
const providerIssues = await verifyAgentProviders(agents.map((agent) => ({
|
|
129
|
-
id: agent.id,
|
|
130
|
-
provider: agent.provider,
|
|
131
|
-
})));
|
|
132
|
-
if (providerIssues.length > 0) {
|
|
133
|
-
throw new ReducePreflightError(providerIssues, []);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
135
|
async function readReductionSessionRecord(options) {
|
|
137
136
|
const { root, reductionsFilePath, reductionId } = options;
|
|
138
137
|
const records = await readReductionRecords({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CliError } from "../../cli/errors.js";
|
|
2
|
-
import {
|
|
2
|
+
import type { PreflightIssue } from "../../competition/shared/preflight.js";
|
|
3
3
|
export type ReducePreflightIssue = PreflightIssue;
|
|
4
4
|
export declare class ReduceError extends CliError {
|
|
5
5
|
constructor(headline: string, detailLines?: readonly string[], hintLines?: readonly string[]);
|
|
@@ -10,7 +10,7 @@ export declare class ReduceAgentNotFoundError extends ReduceError {
|
|
|
10
10
|
}
|
|
11
11
|
export declare class ReducePreflightError extends ReduceError {
|
|
12
12
|
readonly issues: readonly ReducePreflightIssue[];
|
|
13
|
-
constructor(issues: readonly ReducePreflightIssue[],
|
|
13
|
+
constructor(issues: readonly ReducePreflightIssue[], preProviderIssueCount?: number);
|
|
14
14
|
}
|
|
15
15
|
export declare class ReduceGenerationFailedError extends ReduceError {
|
|
16
16
|
constructor(detailLines?: readonly string[]);
|