voratiq 0.1.0-beta.21 → 0.1.0-beta.22
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 +18 -22
- package/dist/agents/launch/chat.d.ts +3 -1
- package/dist/agents/launch/chat.js +2 -0
- package/dist/bin.js +28 -7
- package/dist/cli/auto.js +1 -0
- 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 +4 -1
- package/dist/cli/operator-envelope.d.ts +19 -6
- package/dist/cli/operator-envelope.js +61 -1
- package/dist/cli/run.js +2 -0
- package/dist/cli/verify.d.ts +1 -1
- package/dist/cli/verify.js +48 -9
- package/dist/commands/auto/command.d.ts +1 -0
- package/dist/commands/auto/command.js +22 -12
- package/dist/commands/auto/errors.js +1 -1
- package/dist/commands/doctor/agents.d.ts +5 -0
- package/dist/commands/{init → doctor}/agents.js +37 -19
- package/dist/commands/doctor/command.d.ts +22 -0
- package/dist/commands/doctor/command.js +99 -0
- package/dist/commands/doctor/environment.d.ts +2 -0
- package/dist/commands/{init → doctor}/environment.js +38 -6
- 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} +106 -10
- package/dist/commands/doctor/reconcile.d.ts +2 -0
- package/dist/commands/doctor/reconcile.js +101 -0
- package/dist/commands/interactive/lifecycle.d.ts +2 -0
- package/dist/commands/interactive/lifecycle.js +8 -0
- package/dist/commands/list/command.d.ts +1 -0
- package/dist/commands/list/command.js +211 -352
- package/dist/commands/list/normalization.d.ts +56 -0
- package/dist/commands/list/normalization.js +317 -0
- package/dist/commands/message/command.d.ts +2 -1
- package/dist/commands/message/command.js +35 -14
- package/dist/commands/message/errors.d.ts +12 -3
- package/dist/commands/message/errors.js +19 -3
- 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 +11 -2
- 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 +2 -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/spec/command.js +19 -6
- 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 +15 -5
- package/dist/commands/verify/errors.d.ts +12 -0
- package/dist/commands/verify/errors.js +22 -0
- 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/contracts/list.d.ts +129 -149
- package/dist/contracts/list.js +47 -99
- package/dist/domain/interactive/persistence/adapter.d.ts +23 -0
- package/dist/domain/interactive/persistence/adapter.js +42 -0
- package/dist/domain/message/model/types.d.ts +32 -0
- package/dist/domain/message/model/types.js +25 -0
- package/dist/domain/reduce/competition/adapter.js +21 -7
- 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/errors.d.ts +1 -1
- package/dist/domain/run/competition/errors.js +4 -7
- 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 +6 -1
- package/dist/domain/spec/model/types.d.ts +3 -0
- package/dist/domain/spec/model/types.js +5 -0
- package/dist/domain/verify/competition/finalize.d.ts +9 -0
- package/dist/domain/verify/competition/finalize.js +22 -3
- package/dist/domain/verify/model/types.d.ts +2 -2
- package/dist/interactive/providers/mcp.d.ts +1 -0
- package/dist/interactive/providers/mcp.js +45 -7
- package/dist/interactive/substrate.js +20 -3
- package/dist/mcp/server.js +26 -9
- 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 +5 -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/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 +2 -1
- package/dist/render/transcripts/message.js +19 -20
- package/dist/render/transcripts/reduce.d.ts +1 -0
- package/dist/render/transcripts/reduce.js +21 -21
- package/dist/render/transcripts/root-launcher.js +2 -12
- package/dist/render/transcripts/run.d.ts +3 -0
- package/dist/render/transcripts/run.js +30 -4
- package/dist/render/transcripts/spec.js +5 -8
- package/dist/render/transcripts/verify.d.ts +5 -3
- package/dist/render/transcripts/verify.js +44 -31
- package/dist/render/utils/duration.d.ts +5 -0
- package/dist/render/utils/duration.js +6 -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/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/terminal.d.ts +1 -0
- package/dist/utils/terminal.js +11 -0
- package/dist/workspace/chat/artifacts.d.ts +7 -0
- package/dist/workspace/chat/artifacts.js +94 -3
- package/dist/workspace/errors.js +2 -2
- package/dist/workspace/managed-state.d.ts +32 -0
- package/dist/workspace/managed-state.js +103 -0
- package/dist/workspace/setup.js +66 -2
- package/dist/workspace/shim.d.ts +1 -0
- package/dist/workspace/shim.js +3 -3
- package/dist/workspace/structure.d.ts +1 -0
- package/dist/workspace/structure.js +1 -0
- 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/commands/{init/types.js → doctor/fix-types.js} +0 -0
package/README.md
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
# Voratiq
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Run workflows, delegate to swarms, and verify outputs before you apply them.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
No single model wins every task. Run several, keep the best result. [Here's why that works](https://voratiq.com/blog/selection-rather-than-prediction/).
|
|
5
|
+
Voratiq provides composable operators for structured multi-agent workflows, with durable artifacts and session history that keep each step inspectable as work unfolds.
|
|
8
6
|
|
|
9
7
|
## Installation
|
|
10
8
|
|
|
11
|
-
Install via npm:
|
|
12
|
-
|
|
13
9
|
```bash
|
|
14
10
|
npm install -g voratiq
|
|
15
11
|
```
|
|
@@ -23,7 +19,7 @@ npm install -g voratiq
|
|
|
23
19
|
- macOS: `ripgrep`
|
|
24
20
|
- Linux (Debian/Ubuntu): `bubblewrap`, `socat`, `ripgrep`
|
|
25
21
|
|
|
26
|
-
See the [sandbox runtime docs](https://github.com/anthropic-experimental/sandbox-runtime/blob/1bafa66a2c3ebc52569fc0c1a868e85e778f66a0/README.md#platform-specific-dependencies) for
|
|
22
|
+
See the [sandbox runtime docs](https://github.com/anthropic-experimental/sandbox-runtime/blob/1bafa66a2c3ebc52569fc0c1a868e85e778f66a0/README.md#platform-specific-dependencies) for platform-specific dependencies.
|
|
27
23
|
|
|
28
24
|
Windows is not currently supported.
|
|
29
25
|
|
|
@@ -31,40 +27,40 @@ Windows is not currently supported.
|
|
|
31
27
|
|
|
32
28
|
## Quick Start
|
|
33
29
|
|
|
34
|
-
|
|
30
|
+
From a git repo root, run:
|
|
35
31
|
|
|
36
32
|
```bash
|
|
37
33
|
voratiq
|
|
38
34
|
```
|
|
39
35
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
That agent gets access to Voratiq tools for orchestration and verification.
|
|
36
|
+
That opens an interactive agent session with access to Voratiq's operators.
|
|
43
37
|
|
|
44
|
-
|
|
38
|
+
From there, the agent can:
|
|
45
39
|
|
|
46
|
-
-
|
|
47
|
-
- delegate work to
|
|
48
|
-
- verify outputs
|
|
49
|
-
-
|
|
40
|
+
- run multi-step workflows with explicit stages
|
|
41
|
+
- delegate work to swarms of agents
|
|
42
|
+
- verify outputs before applying them
|
|
43
|
+
- use different workflow architectures for different tasks
|
|
44
|
+
- inspect session history and artifacts
|
|
50
45
|
|
|
51
|
-
|
|
46
|
+
For more information, see the [getting started](https://github.com/voratiq/voratiq/blob/main/docs/getting-started.md) guide.
|
|
52
47
|
|
|
53
48
|
## Documentation
|
|
54
49
|
|
|
55
50
|
Start here:
|
|
56
51
|
|
|
57
|
-
- [
|
|
52
|
+
- [Getting Started](https://github.com/voratiq/voratiq/blob/main/docs/getting-started.md) - Which workflow to use and how to run it
|
|
53
|
+
- [How It Works](https://github.com/voratiq/voratiq/blob/main/docs/how-it-works.md) - Operators, verification, and artifacts
|
|
58
54
|
- [CLI Reference](https://github.com/voratiq/voratiq/blob/main/docs/cli-reference.md) - Commands and options
|
|
59
|
-
- [
|
|
55
|
+
- [Troubleshooting](https://github.com/voratiq/voratiq/blob/main/docs/troubleshooting.md) - Common setup and runtime issues
|
|
60
56
|
|
|
61
57
|
Configuration:
|
|
62
58
|
|
|
63
59
|
- [Agents](https://github.com/voratiq/voratiq/blob/main/docs/configs/agents.md) - Agent catalog and invocation details
|
|
64
|
-
- [
|
|
65
|
-
- [Verification](https://github.com/voratiq/voratiq/blob/main/docs/configs/verification.md) - How agent outputs are checked and scored before selection
|
|
66
|
-
- [Environment](https://github.com/voratiq/voratiq/blob/main/docs/configs/environment.md) - Runtime dependencies for agents
|
|
60
|
+
- [Environment](https://github.com/voratiq/voratiq/blob/main/docs/configs/environment.md) - Runtime dependencies for agent execution
|
|
67
61
|
- [Sandbox](https://github.com/voratiq/voratiq/blob/main/docs/configs/sandbox.md) - Network and filesystem restrictions
|
|
62
|
+
- [Orchestration](https://github.com/voratiq/voratiq/blob/main/docs/configs/orchestration.md) - Which agents participate at each workflow stage
|
|
63
|
+
- [Verification](https://github.com/voratiq/voratiq/blob/main/docs/configs/verification.md) - How verification is configured across stages
|
|
68
64
|
|
|
69
65
|
## License
|
|
70
66
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ProviderTranscriptBaseline } from "../../workspace/chat/artifacts.js";
|
|
1
|
+
import { type ProviderTranscriptBaseline, type ProviderTranscriptSelectionHint } from "../../workspace/chat/artifacts.js";
|
|
2
2
|
import type { ChatArtifactFormat } from "../../workspace/chat/types.js";
|
|
3
3
|
export interface LaunchArtifactCaptureResult {
|
|
4
4
|
readonly captured: boolean;
|
|
@@ -10,11 +10,13 @@ export interface LaunchArtifactCaptureResult {
|
|
|
10
10
|
export interface LaunchArtifactCaptureContext {
|
|
11
11
|
readonly searchEnv?: NodeJS.ProcessEnv;
|
|
12
12
|
readonly baseline?: ProviderTranscriptBaseline;
|
|
13
|
+
readonly selectionHint?: ProviderTranscriptSelectionHint;
|
|
13
14
|
}
|
|
14
15
|
export declare function prepareProviderArtifactCaptureContext(options: {
|
|
15
16
|
providerId: string | undefined;
|
|
16
17
|
sessionRoot: string;
|
|
17
18
|
searchEnv?: NodeJS.ProcessEnv;
|
|
19
|
+
selectionHint?: ProviderTranscriptSelectionHint;
|
|
18
20
|
}): Promise<LaunchArtifactCaptureContext | undefined>;
|
|
19
21
|
export declare function collectProviderArtifacts(options: {
|
|
20
22
|
providerId: string | undefined;
|
|
@@ -11,6 +11,7 @@ export async function prepareProviderArtifactCaptureContext(options) {
|
|
|
11
11
|
agentRoot: options.sessionRoot,
|
|
12
12
|
searchEnv: options.searchEnv,
|
|
13
13
|
}),
|
|
14
|
+
selectionHint: options.selectionHint,
|
|
14
15
|
};
|
|
15
16
|
}
|
|
16
17
|
export async function collectProviderArtifacts(options) {
|
|
@@ -23,6 +24,7 @@ export async function collectProviderArtifacts(options) {
|
|
|
23
24
|
agentRoot: options.sessionRoot,
|
|
24
25
|
searchEnv: options.captureContext?.searchEnv,
|
|
25
26
|
baseline: options.captureContext?.baseline,
|
|
27
|
+
selectionHint: options.captureContext?.selectionHint,
|
|
26
28
|
});
|
|
27
29
|
const format = result.format;
|
|
28
30
|
if ((result.status === "captured" || result.status === "already-exists") &&
|
package/dist/bin.js
CHANGED
|
@@ -176,6 +176,21 @@ async function terminateActiveSessionsSafe(status, context) {
|
|
|
176
176
|
}
|
|
177
177
|
return errors[0] ?? null;
|
|
178
178
|
}
|
|
179
|
+
function renderRootLauncherGitGuidance(options) {
|
|
180
|
+
const lines = [];
|
|
181
|
+
if (options.reason === "not_repository_root") {
|
|
182
|
+
lines.push("Bare `voratiq` launches an interactive session from a repository root.", "", `Current directory: ${options.cwd}`);
|
|
183
|
+
if (options.repositoryRoot) {
|
|
184
|
+
lines.push(`Repository root: ${options.repositoryRoot}`);
|
|
185
|
+
}
|
|
186
|
+
lines.push("", "Next step:", options.repositoryRoot
|
|
187
|
+
? ` cd ${options.repositoryRoot} && voratiq`
|
|
188
|
+
: " Switch to the repository root and rerun `voratiq`.");
|
|
189
|
+
return lines.join("\n");
|
|
190
|
+
}
|
|
191
|
+
lines.push("Bare `voratiq` launches an interactive session from a git repository root.", "", `Current directory: ${options.cwd}`, "", "Next steps:", " git init", " voratiq", "", "Or switch to an existing repository root and rerun `voratiq`.");
|
|
192
|
+
return lines.join("\n");
|
|
193
|
+
}
|
|
179
194
|
export async function runCli(argv = process.argv) {
|
|
180
195
|
installProcessGuards();
|
|
181
196
|
const { Command, CommanderError } = await import("commander");
|
|
@@ -188,7 +203,7 @@ export async function runCli(argv = process.argv) {
|
|
|
188
203
|
const localVersion = (await import("./utils/version.js")).getVoratiqVersion();
|
|
189
204
|
program
|
|
190
205
|
.name("voratiq")
|
|
191
|
-
.description("
|
|
206
|
+
.description("Run workflows, delegate to swarms, and verify outputs before you apply them.")
|
|
192
207
|
.enablePositionalOptions()
|
|
193
208
|
.version(localVersion, "-v, --version", "print the Voratiq version")
|
|
194
209
|
.exitOverride()
|
|
@@ -254,7 +269,13 @@ export async function runCli(argv = process.argv) {
|
|
|
254
269
|
(error.reason === "no_repository" ||
|
|
255
270
|
error.reason === "not_repository_root")) {
|
|
256
271
|
const { writeCommandOutput } = await import("./cli/output.js");
|
|
257
|
-
writeCommandOutput({
|
|
272
|
+
writeCommandOutput({
|
|
273
|
+
body: renderRootLauncherGitGuidance({
|
|
274
|
+
cwd: process.cwd(),
|
|
275
|
+
reason: error.reason,
|
|
276
|
+
repositoryRoot: error.repositoryRoot,
|
|
277
|
+
}),
|
|
278
|
+
});
|
|
258
279
|
return;
|
|
259
280
|
}
|
|
260
281
|
const { toCliError } = await import("./cli/errors.js");
|
|
@@ -330,7 +351,6 @@ async function registerCommands(program, argv) {
|
|
|
330
351
|
const wantsHelp = argv.includes("--help") || argv.includes("-h");
|
|
331
352
|
const wantsVersion = argv.includes("--version") || argv.includes("-v");
|
|
332
353
|
const knownCommandNames = new Set([
|
|
333
|
-
"init",
|
|
334
354
|
"spec",
|
|
335
355
|
"run",
|
|
336
356
|
"reduce",
|
|
@@ -340,6 +360,7 @@ async function registerCommands(program, argv) {
|
|
|
340
360
|
"apply",
|
|
341
361
|
"list",
|
|
342
362
|
"prune",
|
|
363
|
+
"doctor",
|
|
343
364
|
"mcp",
|
|
344
365
|
]);
|
|
345
366
|
const loadAll = commandName === undefined ||
|
|
@@ -349,7 +370,6 @@ async function registerCommands(program, argv) {
|
|
|
349
370
|
return;
|
|
350
371
|
}
|
|
351
372
|
if (loadAll) {
|
|
352
|
-
program.addCommand((await import("./cli/init.js")).createInitCommand());
|
|
353
373
|
program.addCommand((await import("./cli/spec.js")).createSpecCommand());
|
|
354
374
|
program.addCommand((await import("./cli/run.js")).createRunCommand());
|
|
355
375
|
program.addCommand((await import("./cli/reduce.js")).createReduceCommand());
|
|
@@ -359,13 +379,11 @@ async function registerCommands(program, argv) {
|
|
|
359
379
|
program.addCommand((await import("./cli/apply.js")).createApplyCommand());
|
|
360
380
|
program.addCommand((await import("./cli/list.js")).createListCommand());
|
|
361
381
|
program.addCommand((await import("./cli/prune.js")).createPruneCommand());
|
|
382
|
+
program.addCommand((await import("./cli/doctor.js")).createDoctorCommand());
|
|
362
383
|
program.addCommand((await import("./cli/mcp.js")).createMcpCommand());
|
|
363
384
|
return;
|
|
364
385
|
}
|
|
365
386
|
switch (commandName) {
|
|
366
|
-
case "init":
|
|
367
|
-
program.addCommand((await import("./cli/init.js")).createInitCommand());
|
|
368
|
-
break;
|
|
369
387
|
case "spec":
|
|
370
388
|
program.addCommand((await import("./cli/spec.js")).createSpecCommand());
|
|
371
389
|
break;
|
|
@@ -393,6 +411,9 @@ async function registerCommands(program, argv) {
|
|
|
393
411
|
case "prune":
|
|
394
412
|
program.addCommand((await import("./cli/prune.js")).createPruneCommand());
|
|
395
413
|
break;
|
|
414
|
+
case "doctor":
|
|
415
|
+
program.addCommand((await import("./cli/doctor.js")).createDoctorCommand());
|
|
416
|
+
break;
|
|
396
417
|
case "mcp":
|
|
397
418
|
program.addCommand((await import("./cli/mcp.js")).createMcpCommand());
|
|
398
419
|
break;
|
package/dist/cli/auto.js
CHANGED
|
@@ -157,6 +157,7 @@ export async function runAutoCommand(options, runtime = {}) {
|
|
|
157
157
|
selectedSpecPath: result.selectedSpecPath,
|
|
158
158
|
selection: result.selection?.decision,
|
|
159
159
|
selectionWarnings: result.selection?.warnings,
|
|
160
|
+
warningMessage: result.warningMessage,
|
|
160
161
|
})),
|
|
161
162
|
runApplyStage: async (input) => runApplyCommand({
|
|
162
163
|
runId: input.runId,
|
package/dist/cli/contract.d.ts
CHANGED
|
@@ -2,26 +2,27 @@ import { type Command } from "commander";
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { type ListMode, type ListOperator } from "../contracts/list.js";
|
|
4
4
|
export declare const externalExecutionOperators: readonly ["spec", "run", "reduce", "verify", "message", "apply", "prune"];
|
|
5
|
-
export declare const externalInspectionOperators: readonly ["spec", "run", "reduce", "verify", "message"];
|
|
5
|
+
export declare const externalInspectionOperators: readonly ["spec", "run", "reduce", "verify", "message", "interactive"];
|
|
6
6
|
export declare const externalInspectionModes: readonly ["table", "detail"];
|
|
7
7
|
export type ExternalExecutionOperator = (typeof externalExecutionOperators)[number];
|
|
8
8
|
export type ExternalInspectionOperator = ListOperator;
|
|
9
9
|
export type ExternalInspectionMode = ListMode;
|
|
10
10
|
export declare const externalExecutionOperatorSchema: z.ZodEnum<{
|
|
11
11
|
message: "message";
|
|
12
|
+
spec: "spec";
|
|
12
13
|
reduce: "reduce";
|
|
13
14
|
apply: "apply";
|
|
14
|
-
spec: "spec";
|
|
15
15
|
run: "run";
|
|
16
16
|
verify: "verify";
|
|
17
17
|
prune: "prune";
|
|
18
18
|
}>;
|
|
19
19
|
export declare const externalInspectionOperatorSchema: z.ZodEnum<{
|
|
20
20
|
message: "message";
|
|
21
|
-
reduce: "reduce";
|
|
22
21
|
spec: "spec";
|
|
22
|
+
reduce: "reduce";
|
|
23
23
|
run: "run";
|
|
24
24
|
verify: "verify";
|
|
25
|
+
interactive: "interactive";
|
|
25
26
|
}>;
|
|
26
27
|
export declare const externalInspectionModeSchema: z.ZodEnum<{
|
|
27
28
|
detail: "detail";
|
|
@@ -47,8 +48,8 @@ export declare const externalReduceExecutionInputSchema: z.ZodObject<{
|
|
|
47
48
|
target: z.ZodObject<{
|
|
48
49
|
type: z.ZodEnum<{
|
|
49
50
|
message: "message";
|
|
50
|
-
reduce: "reduce";
|
|
51
51
|
spec: "spec";
|
|
52
|
+
reduce: "reduce";
|
|
52
53
|
run: "run";
|
|
53
54
|
verify: "verify";
|
|
54
55
|
}>;
|
|
@@ -70,8 +71,8 @@ export declare const externalVerifyExecutionInputSchema: z.ZodObject<{
|
|
|
70
71
|
target: z.ZodObject<{
|
|
71
72
|
kind: z.ZodEnum<{
|
|
72
73
|
message: "message";
|
|
73
|
-
reduce: "reduce";
|
|
74
74
|
spec: "spec";
|
|
75
|
+
reduce: "reduce";
|
|
75
76
|
run: "run";
|
|
76
77
|
}>;
|
|
77
78
|
sessionId: z.ZodString;
|
|
@@ -100,10 +101,11 @@ export declare const externalPruneExecutionInputSchema: z.ZodDiscriminatedUnion<
|
|
|
100
101
|
export declare const externalListTableInputSchema: z.ZodObject<{
|
|
101
102
|
operator: z.ZodEnum<{
|
|
102
103
|
message: "message";
|
|
103
|
-
reduce: "reduce";
|
|
104
104
|
spec: "spec";
|
|
105
|
+
reduce: "reduce";
|
|
105
106
|
run: "run";
|
|
106
107
|
verify: "verify";
|
|
108
|
+
interactive: "interactive";
|
|
107
109
|
}>;
|
|
108
110
|
verbose: z.ZodOptional<z.ZodBoolean>;
|
|
109
111
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
@@ -112,10 +114,11 @@ export declare const externalListTableInputSchema: z.ZodObject<{
|
|
|
112
114
|
export declare const externalListDetailInputSchema: z.ZodObject<{
|
|
113
115
|
operator: z.ZodEnum<{
|
|
114
116
|
message: "message";
|
|
115
|
-
reduce: "reduce";
|
|
116
117
|
spec: "spec";
|
|
118
|
+
reduce: "reduce";
|
|
117
119
|
run: "run";
|
|
118
120
|
verify: "verify";
|
|
121
|
+
interactive: "interactive";
|
|
119
122
|
}>;
|
|
120
123
|
verbose: z.ZodOptional<z.ZodBoolean>;
|
|
121
124
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
@@ -125,10 +128,11 @@ export declare const externalListDetailInputSchema: z.ZodObject<{
|
|
|
125
128
|
export declare const externalListInspectionInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
126
129
|
operator: z.ZodEnum<{
|
|
127
130
|
message: "message";
|
|
128
|
-
reduce: "reduce";
|
|
129
131
|
spec: "spec";
|
|
132
|
+
reduce: "reduce";
|
|
130
133
|
run: "run";
|
|
131
134
|
verify: "verify";
|
|
135
|
+
interactive: "interactive";
|
|
132
136
|
}>;
|
|
133
137
|
verbose: z.ZodOptional<z.ZodBoolean>;
|
|
134
138
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
@@ -136,10 +140,11 @@ export declare const externalListInspectionInputSchema: z.ZodDiscriminatedUnion<
|
|
|
136
140
|
}, z.core.$strict>, z.ZodObject<{
|
|
137
141
|
operator: z.ZodEnum<{
|
|
138
142
|
message: "message";
|
|
139
|
-
reduce: "reduce";
|
|
140
143
|
spec: "spec";
|
|
144
|
+
reduce: "reduce";
|
|
141
145
|
run: "run";
|
|
142
146
|
verify: "verify";
|
|
147
|
+
interactive: "interactive";
|
|
143
148
|
}>;
|
|
144
149
|
verbose: z.ZodOptional<z.ZodBoolean>;
|
|
145
150
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
@@ -167,8 +172,8 @@ export declare const externalExecutionInputSchemas: {
|
|
|
167
172
|
target: z.ZodObject<{
|
|
168
173
|
type: z.ZodEnum<{
|
|
169
174
|
message: "message";
|
|
170
|
-
reduce: "reduce";
|
|
171
175
|
spec: "spec";
|
|
176
|
+
reduce: "reduce";
|
|
172
177
|
run: "run";
|
|
173
178
|
verify: "verify";
|
|
174
179
|
}>;
|
|
@@ -183,8 +188,8 @@ export declare const externalExecutionInputSchemas: {
|
|
|
183
188
|
target: z.ZodObject<{
|
|
184
189
|
kind: z.ZodEnum<{
|
|
185
190
|
message: "message";
|
|
186
|
-
reduce: "reduce";
|
|
187
191
|
spec: "spec";
|
|
192
|
+
reduce: "reduce";
|
|
188
193
|
run: "run";
|
|
189
194
|
}>;
|
|
190
195
|
sessionId: z.ZodString;
|
|
@@ -223,10 +228,11 @@ export declare const externalInspectionInputSchemas: {
|
|
|
223
228
|
readonly table: z.ZodObject<{
|
|
224
229
|
operator: z.ZodEnum<{
|
|
225
230
|
message: "message";
|
|
226
|
-
reduce: "reduce";
|
|
227
231
|
spec: "spec";
|
|
232
|
+
reduce: "reduce";
|
|
228
233
|
run: "run";
|
|
229
234
|
verify: "verify";
|
|
235
|
+
interactive: "interactive";
|
|
230
236
|
}>;
|
|
231
237
|
verbose: z.ZodOptional<z.ZodBoolean>;
|
|
232
238
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
@@ -235,10 +241,11 @@ export declare const externalInspectionInputSchemas: {
|
|
|
235
241
|
readonly detail: z.ZodObject<{
|
|
236
242
|
operator: z.ZodEnum<{
|
|
237
243
|
message: "message";
|
|
238
|
-
reduce: "reduce";
|
|
239
244
|
spec: "spec";
|
|
245
|
+
reduce: "reduce";
|
|
240
246
|
run: "run";
|
|
241
247
|
verify: "verify";
|
|
248
|
+
interactive: "interactive";
|
|
242
249
|
}>;
|
|
243
250
|
verbose: z.ZodOptional<z.ZodBoolean>;
|
|
244
251
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
@@ -248,10 +255,11 @@ export declare const externalInspectionInputSchemas: {
|
|
|
248
255
|
readonly union: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
249
256
|
operator: z.ZodEnum<{
|
|
250
257
|
message: "message";
|
|
251
|
-
reduce: "reduce";
|
|
252
258
|
spec: "spec";
|
|
259
|
+
reduce: "reduce";
|
|
253
260
|
run: "run";
|
|
254
261
|
verify: "verify";
|
|
262
|
+
interactive: "interactive";
|
|
255
263
|
}>;
|
|
256
264
|
verbose: z.ZodOptional<z.ZodBoolean>;
|
|
257
265
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
@@ -259,10 +267,11 @@ export declare const externalInspectionInputSchemas: {
|
|
|
259
267
|
}, z.core.$strict>, z.ZodObject<{
|
|
260
268
|
operator: z.ZodEnum<{
|
|
261
269
|
message: "message";
|
|
262
|
-
reduce: "reduce";
|
|
263
270
|
spec: "spec";
|
|
271
|
+
reduce: "reduce";
|
|
264
272
|
run: "run";
|
|
265
273
|
verify: "verify";
|
|
274
|
+
interactive: "interactive";
|
|
266
275
|
}>;
|
|
267
276
|
verbose: z.ZodOptional<z.ZodBoolean>;
|
|
268
277
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
@@ -291,12 +300,12 @@ export declare const externalAdapterContractReference: {
|
|
|
291
300
|
readonly inspection: {
|
|
292
301
|
readonly command: "list";
|
|
293
302
|
readonly jsonOnly: true;
|
|
294
|
-
readonly operators: readonly ["spec", "run", "reduce", "verify", "message"];
|
|
303
|
+
readonly operators: readonly ["spec", "run", "reduce", "verify", "message", "interactive"];
|
|
295
304
|
readonly modes: readonly ["table", "detail"];
|
|
296
305
|
readonly authoritativeType: "ListJsonOutput";
|
|
297
306
|
readonly versioned: false;
|
|
298
307
|
};
|
|
299
|
-
readonly excludedCommands: readonly ["
|
|
308
|
+
readonly excludedCommands: readonly ["auto", "doctor"];
|
|
300
309
|
readonly compatibility: {
|
|
301
310
|
readonly additiveChangesAreNonBreaking: true;
|
|
302
311
|
readonly breakingChangesRequireExecutionEnvelopeVersionBump: true;
|
package/dist/cli/contract.js
CHANGED
|
@@ -154,7 +154,7 @@ export const externalAdapterContractReference = {
|
|
|
154
154
|
authoritativeType: "ListJsonOutput",
|
|
155
155
|
versioned: false,
|
|
156
156
|
},
|
|
157
|
-
excludedCommands: ["
|
|
157
|
+
excludedCommands: ["auto", "doctor"],
|
|
158
158
|
compatibility: {
|
|
159
159
|
additiveChangesAreNonBreaking: true,
|
|
160
160
|
breakingChangesRequireExecutionEnvelopeVersionBump: true,
|
|
@@ -249,6 +249,7 @@ const listCommandActionOptionsSchema = z
|
|
|
249
249
|
reduce: z.union([z.literal(true), nonEmptyStringSchema]).optional(),
|
|
250
250
|
verify: z.union([z.literal(true), nonEmptyStringSchema]).optional(),
|
|
251
251
|
message: z.union([z.literal(true), nonEmptyStringSchema]).optional(),
|
|
252
|
+
interactive: z.union([z.literal(true), nonEmptyStringSchema]).optional(),
|
|
252
253
|
limit: positiveIntegerSchema.optional(),
|
|
253
254
|
verbose: z.boolean().optional(),
|
|
254
255
|
json: z.boolean().optional(),
|
|
@@ -365,6 +366,7 @@ export function parseListInspectionCommandOptions(options, command) {
|
|
|
365
366
|
{ key: "reduce", flag: "--reduce", value: "reduce" },
|
|
366
367
|
{ key: "verify", flag: "--verify", value: "verify" },
|
|
367
368
|
{ key: "message", flag: "--message", value: "message" },
|
|
369
|
+
{ key: "interactive", flag: "--interactive", value: "interactive" },
|
|
368
370
|
], parsed, command, "operator flag");
|
|
369
371
|
return parseCommandOptions(externalListInspectionInputSchema, {
|
|
370
372
|
operator: selected.value,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import { type CommandOutputWriter } from "./output.js";
|
|
3
|
+
export interface DoctorCommandOptions {
|
|
4
|
+
fix?: boolean;
|
|
5
|
+
writeOutput?: CommandOutputWriter;
|
|
6
|
+
}
|
|
7
|
+
export interface RunDoctorCommandResult {
|
|
8
|
+
body: string;
|
|
9
|
+
exitCode: number;
|
|
10
|
+
}
|
|
11
|
+
export declare function runDoctorCommand(options?: DoctorCommandOptions): Promise<RunDoctorCommandResult>;
|
|
12
|
+
export declare function createDoctorCommand(): Command;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import { CliError } from "../cli/errors.js";
|
|
3
|
+
import { executeDoctorDiagnosis, executeDoctorFix, resolveDoctorFixMode, } from "../commands/doctor/command.js";
|
|
4
|
+
import { PREFLIGHT_HINT } from "../competition/shared/preflight.js";
|
|
5
|
+
import { resolveCliContext } from "../preflight/index.js";
|
|
6
|
+
import { renderCliError } from "../render/utils/errors.js";
|
|
7
|
+
import { colorize } from "../utils/colors.js";
|
|
8
|
+
import { isInteractiveShell } from "../utils/terminal.js";
|
|
9
|
+
import { createConfirmationWorkflow } from "./confirmation.js";
|
|
10
|
+
import { NonInteractiveShellError } from "./errors.js";
|
|
11
|
+
import { writeCommandOutput } from "./output.js";
|
|
12
|
+
export async function runDoctorCommand(options = {}) {
|
|
13
|
+
const { writeOutput = writeCommandOutput } = options;
|
|
14
|
+
const { root } = await resolveCliContext({ requireWorkspace: false });
|
|
15
|
+
const diagnosis = await executeDoctorDiagnosis({ root });
|
|
16
|
+
if (options.fix) {
|
|
17
|
+
if (diagnosis.healthy) {
|
|
18
|
+
return {
|
|
19
|
+
body: renderHealthyDoctorBody(),
|
|
20
|
+
exitCode: 0,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
const assumeYes = !isInteractiveShell();
|
|
24
|
+
const confirmation = createConfirmationWorkflow({
|
|
25
|
+
assumeYes,
|
|
26
|
+
onUnavailable: () => {
|
|
27
|
+
throw new NonInteractiveShellError();
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
try {
|
|
31
|
+
const mode = await resolveDoctorFixMode(root);
|
|
32
|
+
writeOutput({
|
|
33
|
+
alerts: [
|
|
34
|
+
{
|
|
35
|
+
severity: "info",
|
|
36
|
+
message: renderDoctorFixPathMessage(mode),
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
});
|
|
40
|
+
await executeDoctorFix({
|
|
41
|
+
root,
|
|
42
|
+
mode,
|
|
43
|
+
bootstrapOptions: {
|
|
44
|
+
preset: "pro",
|
|
45
|
+
interactive: confirmation.interactive,
|
|
46
|
+
assumeYes,
|
|
47
|
+
confirm: confirmation.confirm,
|
|
48
|
+
prompt: confirmation.prompt,
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
const postFixDiagnosis = await executeDoctorDiagnosis({ root });
|
|
52
|
+
if (postFixDiagnosis.healthy) {
|
|
53
|
+
return {
|
|
54
|
+
body: renderHealthyDoctorBody(),
|
|
55
|
+
exitCode: 0,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
body: renderDoctorIssues(postFixDiagnosis),
|
|
60
|
+
exitCode: 1,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
finally {
|
|
64
|
+
confirmation.close();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
if (diagnosis.healthy) {
|
|
68
|
+
return {
|
|
69
|
+
body: renderHealthyDoctorBody(),
|
|
70
|
+
exitCode: 0,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
return {
|
|
74
|
+
body: renderDoctorIssues(diagnosis),
|
|
75
|
+
exitCode: 1,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
export function createDoctorCommand() {
|
|
79
|
+
return new Command("doctor")
|
|
80
|
+
.description("Diagnose workspace and preflight setup issues")
|
|
81
|
+
.option("--fix", "Apply safe workspace and managed-config repairs")
|
|
82
|
+
.allowExcessArguments(false)
|
|
83
|
+
.action(async (options) => {
|
|
84
|
+
const result = await runDoctorCommand({
|
|
85
|
+
fix: Boolean(options.fix),
|
|
86
|
+
});
|
|
87
|
+
writeCommandOutput({
|
|
88
|
+
body: result.body,
|
|
89
|
+
exitCode: result.exitCode,
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
function renderDoctorFixPathMessage(mode) {
|
|
94
|
+
if (mode === "bootstrap-workspace") {
|
|
95
|
+
return "Workspace missing. This will bootstrap workspace and managed config.";
|
|
96
|
+
}
|
|
97
|
+
return "Workspace found. This will repair structure and reconcile managed config.";
|
|
98
|
+
}
|
|
99
|
+
function renderHealthyDoctorBody() {
|
|
100
|
+
return [
|
|
101
|
+
colorize("Workspace healthy, no issues found.", "green"),
|
|
102
|
+
"",
|
|
103
|
+
"Still having issues? Please reach out to support@voratiq.com.",
|
|
104
|
+
].join("\n");
|
|
105
|
+
}
|
|
106
|
+
function renderDoctorIssues(diagnosis) {
|
|
107
|
+
const detailLines = diagnosis.issueLines.length > 1 ? diagnosis.issueLines : [];
|
|
108
|
+
const headline = diagnosis.issueLines.length === 1
|
|
109
|
+
? stripDoctorIssuePrefix(diagnosis.issueLines[0] ?? "Workspace check failed.")
|
|
110
|
+
: "Workspace check failed.";
|
|
111
|
+
return renderCliError(new CliError(headline, detailLines, [PREFLIGHT_HINT]));
|
|
112
|
+
}
|
|
113
|
+
function stripDoctorIssuePrefix(line) {
|
|
114
|
+
return line.replace(/^- /u, "").trim();
|
|
115
|
+
}
|
package/dist/cli/list.js
CHANGED
|
@@ -2,7 +2,7 @@ import { Command } from "commander";
|
|
|
2
2
|
import { executeListCommand } from "../commands/list/command.js";
|
|
3
3
|
import { resolveCliContext } from "../preflight/index.js";
|
|
4
4
|
import { parsePositiveInteger } from "../utils/validators.js";
|
|
5
|
-
import { resolveWorkspacePath, VORATIQ_MESSAGE_FILE, VORATIQ_REDUCTION_FILE, VORATIQ_VERIFICATION_FILE, } from "../workspace/structure.js";
|
|
5
|
+
import { resolveWorkspacePath, VORATIQ_INTERACTIVE_FILE, VORATIQ_MESSAGE_FILE, VORATIQ_REDUCTION_FILE, VORATIQ_VERIFICATION_FILE, } from "../workspace/structure.js";
|
|
6
6
|
import { parseListInspectionCommandOptions } from "./contract.js";
|
|
7
7
|
import { writeCommandOutput } from "./output.js";
|
|
8
8
|
export async function runListCommand(options) {
|
|
@@ -19,6 +19,8 @@ export async function runListCommand(options) {
|
|
|
19
19
|
resolveWorkspacePath(root, VORATIQ_MESSAGE_FILE),
|
|
20
20
|
verificationsFilePath: workspacePaths.verificationsFile ??
|
|
21
21
|
resolveWorkspacePath(root, VORATIQ_VERIFICATION_FILE),
|
|
22
|
+
interactiveFilePath: workspacePaths.interactiveFile ??
|
|
23
|
+
resolveWorkspacePath(root, VORATIQ_INTERACTIVE_FILE),
|
|
22
24
|
operator: options.operator,
|
|
23
25
|
sessionId: options.sessionId,
|
|
24
26
|
limit: options.limit,
|
|
@@ -45,6 +47,7 @@ export function createListCommand() {
|
|
|
45
47
|
.option("--reduce [session-id]", "List reduction sessions or show one reduction session")
|
|
46
48
|
.option("--verify [session-id]", "List verification sessions or show one verification session")
|
|
47
49
|
.option("--message [session-id]", "List message sessions or show one message session")
|
|
50
|
+
.option("--interactive [session-id]", "List interactive sessions or show one interactive session")
|
|
48
51
|
.option("--limit <count>", "Show only the N most recent sessions (default: 10)", parseLimitOption)
|
|
49
52
|
.option("--verbose", "Show all statuses for the selected operator in table mode")
|
|
50
53
|
.option("--json", "Emit machine-readable list output")
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import type { ReductionTarget } from "../domain/reduce/model/types.js";
|
|
3
|
+
import type { RunSpecTarget } from "../domain/run/model/types.js";
|
|
3
4
|
import type { SelectionDecision } from "../policy/index.js";
|
|
4
5
|
import type { ReductionStatus, RunStatus, VerificationStatus } from "../status/index.js";
|
|
5
6
|
import { externalExecutionOperators } from "./contract.js";
|
|
@@ -11,6 +12,20 @@ export interface EnvelopeArtifactRef {
|
|
|
11
12
|
role?: string;
|
|
12
13
|
agentId?: string;
|
|
13
14
|
}
|
|
15
|
+
export interface EnvelopeTargetRef {
|
|
16
|
+
kind: string;
|
|
17
|
+
sessionId: string;
|
|
18
|
+
lineage?: string;
|
|
19
|
+
issueCode?: string;
|
|
20
|
+
currentContentHash?: string;
|
|
21
|
+
source?: {
|
|
22
|
+
kind?: string;
|
|
23
|
+
sessionId?: string;
|
|
24
|
+
agentId?: string;
|
|
25
|
+
outputPath?: string;
|
|
26
|
+
contentHash?: string;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
14
29
|
export interface OperatorResultEnvelope {
|
|
15
30
|
version: 1;
|
|
16
31
|
operator: EnvelopeOperator;
|
|
@@ -24,10 +39,7 @@ export interface OperatorResultEnvelope {
|
|
|
24
39
|
messageId?: string;
|
|
25
40
|
agentId?: string;
|
|
26
41
|
};
|
|
27
|
-
target?:
|
|
28
|
-
kind: string;
|
|
29
|
-
sessionId: string;
|
|
30
|
-
};
|
|
42
|
+
target?: EnvelopeTargetRef;
|
|
31
43
|
artifacts: EnvelopeArtifactRef[];
|
|
32
44
|
selection?: {
|
|
33
45
|
state: "resolvable" | "unresolved";
|
|
@@ -51,9 +63,9 @@ export declare const operatorResultEnvelopeSchema: z.ZodObject<{
|
|
|
51
63
|
version: z.ZodLiteral<1>;
|
|
52
64
|
operator: z.ZodEnum<{
|
|
53
65
|
message: "message";
|
|
66
|
+
spec: "spec";
|
|
54
67
|
reduce: "reduce";
|
|
55
68
|
apply: "apply";
|
|
56
|
-
spec: "spec";
|
|
57
69
|
run: "run";
|
|
58
70
|
verify: "verify";
|
|
59
71
|
prune: "prune";
|
|
@@ -114,7 +126,7 @@ export interface VerifyEnvelopeInput {
|
|
|
114
126
|
sessionId: string;
|
|
115
127
|
};
|
|
116
128
|
outputPath: string;
|
|
117
|
-
status: VerificationStatus;
|
|
129
|
+
status: VerificationStatus | "unresolved";
|
|
118
130
|
selection?: SelectionDecision;
|
|
119
131
|
selectedSpecPath?: string;
|
|
120
132
|
warningMessage?: string;
|
|
@@ -166,6 +178,7 @@ export declare function buildSpecOperatorEnvelope(options: {
|
|
|
166
178
|
export declare function buildRunOperatorEnvelope(options: {
|
|
167
179
|
runId: string;
|
|
168
180
|
specPath: string;
|
|
181
|
+
specTarget?: RunSpecTarget;
|
|
169
182
|
status: RunStatus;
|
|
170
183
|
}): OperatorResultEnvelope;
|
|
171
184
|
export declare function buildVerifyOperatorEnvelope(options: VerifyEnvelopeInput): OperatorResultEnvelope;
|