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
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { verifyAgentProviders } from "../agents/runtime/auth.js";
|
|
2
|
+
import { loadAgentCatalogDiagnostics } from "../configs/agents/loader.js";
|
|
3
|
+
import { collectSettingsPreflightIssues } from "./settings.js";
|
|
4
|
+
export async function collectConfiguredAgentReadiness(input) {
|
|
5
|
+
const { root, resolvedAgentIds, includeSettings = true } = input;
|
|
6
|
+
const catalogDiagnostics = loadAgentCatalogDiagnostics({ root });
|
|
7
|
+
const settingsIssues = includeSettings
|
|
8
|
+
? [...collectSettingsPreflightIssues(root)]
|
|
9
|
+
: [];
|
|
10
|
+
if (resolvedAgentIds) {
|
|
11
|
+
if (resolvedAgentIds.length === 0) {
|
|
12
|
+
return {
|
|
13
|
+
agents: [],
|
|
14
|
+
issues: settingsIssues,
|
|
15
|
+
preProviderIssueCount: settingsIssues.length,
|
|
16
|
+
noAgentsEnabled: true,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
const selectedAgentIds = new Set(resolvedAgentIds);
|
|
20
|
+
const catalogById = new Map(catalogDiagnostics.catalog.map((agent) => [agent.id, agent]));
|
|
21
|
+
const agents = resolvedAgentIds.flatMap((agentId) => {
|
|
22
|
+
const agent = catalogById.get(agentId);
|
|
23
|
+
return agent ? [agent] : [];
|
|
24
|
+
});
|
|
25
|
+
const catalogIssues = catalogDiagnostics.issues.filter((issue) => selectedAgentIds.has(issue.agentId));
|
|
26
|
+
const readiness = await collectResolvedAgentReadiness({
|
|
27
|
+
root,
|
|
28
|
+
agents,
|
|
29
|
+
includeSettings,
|
|
30
|
+
});
|
|
31
|
+
return {
|
|
32
|
+
agents,
|
|
33
|
+
issues: [...catalogIssues, ...readiness.issues],
|
|
34
|
+
preProviderIssueCount: catalogIssues.length + readiness.preProviderIssueCount,
|
|
35
|
+
noAgentsEnabled: false,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
if (catalogDiagnostics.enabledAgents.length === 0) {
|
|
39
|
+
return {
|
|
40
|
+
agents: [],
|
|
41
|
+
issues: settingsIssues,
|
|
42
|
+
preProviderIssueCount: settingsIssues.length,
|
|
43
|
+
noAgentsEnabled: true,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
const readiness = await collectResolvedAgentReadiness({
|
|
47
|
+
root,
|
|
48
|
+
agents: catalogDiagnostics.catalog,
|
|
49
|
+
includeSettings,
|
|
50
|
+
});
|
|
51
|
+
return {
|
|
52
|
+
agents: catalogDiagnostics.catalog,
|
|
53
|
+
issues: [...catalogDiagnostics.issues, ...readiness.issues],
|
|
54
|
+
preProviderIssueCount: catalogDiagnostics.issues.length + readiness.preProviderIssueCount,
|
|
55
|
+
noAgentsEnabled: false,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
export async function collectResolvedAgentReadiness(input) {
|
|
59
|
+
const { root, agents, includeSettings = true } = input;
|
|
60
|
+
const preProviderIssues = includeSettings
|
|
61
|
+
? [...collectSettingsPreflightIssues(root)]
|
|
62
|
+
: [];
|
|
63
|
+
const providerIssues = await verifyAgentProviders(agents.map((agent) => ({
|
|
64
|
+
id: agent.id,
|
|
65
|
+
provider: agent.provider,
|
|
66
|
+
})));
|
|
67
|
+
return {
|
|
68
|
+
issues: [...preProviderIssues, ...providerIssues],
|
|
69
|
+
preProviderIssueCount: preProviderIssues.length,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { EnvironmentConfig } from "../configs/environment/types.js";
|
|
2
|
+
export interface LoadOperatorEnvironmentOptions {
|
|
3
|
+
readonly root: string;
|
|
4
|
+
readonly errorMode?: "raw" | "workspace-missing";
|
|
5
|
+
}
|
|
6
|
+
export declare function loadOperatorEnvironment(options: LoadOperatorEnvironmentOptions): EnvironmentConfig;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { EnvironmentConfigParseError, MissingEnvironmentConfigError, } from "../configs/environment/errors.js";
|
|
2
|
+
import { DEFAULT_ENVIRONMENT_FILE_DISPLAY, loadEnvironmentConfig, } from "../configs/environment/loader.js";
|
|
3
|
+
import { WorkspaceMissingEntryError } from "../workspace/errors.js";
|
|
4
|
+
export function loadOperatorEnvironment(options) {
|
|
5
|
+
const { root, errorMode = "raw" } = options;
|
|
6
|
+
try {
|
|
7
|
+
return loadEnvironmentConfig({ root });
|
|
8
|
+
}
|
|
9
|
+
catch (error) {
|
|
10
|
+
if (errorMode === "workspace-missing" &&
|
|
11
|
+
(error instanceof MissingEnvironmentConfigError ||
|
|
12
|
+
error instanceof EnvironmentConfigParseError)) {
|
|
13
|
+
throw new WorkspaceMissingEntryError(DEFAULT_ENVIRONMENT_FILE_DISPLAY);
|
|
14
|
+
}
|
|
15
|
+
throw error;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type PreflightIssue } from "../competition/shared/preflight.js";
|
|
2
|
+
export declare const OPERATOR_PREFLIGHT_UNLABELED_AGENT_IDS: readonly ["settings"];
|
|
3
|
+
export declare const SETTINGS_PREFLIGHT_HINT: "Review `settings.yaml` and correct invalid values.";
|
|
4
|
+
export declare function formatOperatorPreflightIssueLines(issues: readonly PreflightIssue[]): string[];
|
|
5
|
+
export declare function resolveOperatorPreflightHintLines(issues: readonly PreflightIssue[], preProviderIssueCount: number): readonly string[] | undefined;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { formatPreflightIssueLines, PREFLIGHT_HINT, } from "../competition/shared/preflight.js";
|
|
2
|
+
export const OPERATOR_PREFLIGHT_UNLABELED_AGENT_IDS = ["settings"];
|
|
3
|
+
export const SETTINGS_PREFLIGHT_HINT = "Review `settings.yaml` and correct invalid values.";
|
|
4
|
+
export function formatOperatorPreflightIssueLines(issues) {
|
|
5
|
+
return formatPreflightIssueLines(issues, {
|
|
6
|
+
unlabeledAgentIds: OPERATOR_PREFLIGHT_UNLABELED_AGENT_IDS,
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
export function resolveOperatorPreflightHintLines(issues, preProviderIssueCount) {
|
|
10
|
+
const preProviderIssues = issues.slice(0, preProviderIssueCount);
|
|
11
|
+
const hasSettingsIssue = preProviderIssues.some((issue) => issue.agentId === "settings");
|
|
12
|
+
const hasRepairableWorkspaceIssue = preProviderIssues.some((issue) => issue.agentId !== "settings");
|
|
13
|
+
if (hasSettingsIssue) {
|
|
14
|
+
return [SETTINGS_PREFLIGHT_HINT];
|
|
15
|
+
}
|
|
16
|
+
if (hasRepairableWorkspaceIssue) {
|
|
17
|
+
return [PREFLIGHT_HINT];
|
|
18
|
+
}
|
|
19
|
+
return [];
|
|
20
|
+
}
|
package/dist/preflight/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { isAbsolute, resolve } from "node:path";
|
|
2
|
-
import {
|
|
2
|
+
import { executeDoctorReconcile } from "../commands/doctor/reconcile.js";
|
|
3
3
|
import { ensureFileExists, pathExists } from "../utils/fs.js";
|
|
4
4
|
import { assertGitRepository, runGitCommand, } from "../utils/git.js";
|
|
5
5
|
import { relativeToRoot } from "../utils/path.js";
|
|
6
6
|
import { collectMissingSandboxDependencies, formatSandboxDependencyList, } from "../workspace/sandbox-requirements.js";
|
|
7
7
|
import { repairWorkspaceStructure, validateWorkspace, } from "../workspace/setup.js";
|
|
8
|
-
import { resolveWorkspacePath, VORATIQ_MESSAGE_DIR, VORATIQ_MESSAGE_FILE, VORATIQ_REDUCTION_DIR, VORATIQ_REDUCTION_FILE, VORATIQ_RUN_DIR, VORATIQ_RUN_FILE, VORATIQ_SPEC_DIR, VORATIQ_SPEC_FILE, VORATIQ_VERIFICATION_DIR, VORATIQ_VERIFICATION_FILE, } from "../workspace/structure.js";
|
|
8
|
+
import { resolveWorkspacePath, VORATIQ_INTERACTIVE_DIR, VORATIQ_INTERACTIVE_FILE, VORATIQ_MESSAGE_DIR, VORATIQ_MESSAGE_FILE, VORATIQ_REDUCTION_DIR, VORATIQ_REDUCTION_FILE, VORATIQ_RUN_DIR, VORATIQ_RUN_FILE, VORATIQ_SPEC_DIR, VORATIQ_SPEC_FILE, VORATIQ_VERIFICATION_DIR, VORATIQ_VERIFICATION_FILE, } from "../workspace/structure.js";
|
|
9
9
|
import { DirtyWorkingTreeError, SandboxDependenciesError, SpecNotFoundError, } from "./errors.js";
|
|
10
10
|
export async function resolveCliContext(options = {}) {
|
|
11
11
|
const { requireWorkspace = true, workspaceAutoInitMode = "never", restoreShippedVerificationTemplates = true, } = options;
|
|
@@ -18,13 +18,7 @@ export async function resolveCliContext(options = {}) {
|
|
|
18
18
|
if (requireWorkspace) {
|
|
19
19
|
let workspaceMissing = !initialWorkspaceExists;
|
|
20
20
|
if (workspaceAutoInitMode === "when-missing" && workspaceMissing) {
|
|
21
|
-
await
|
|
22
|
-
root,
|
|
23
|
-
preset: "pro",
|
|
24
|
-
presetProvided: false,
|
|
25
|
-
assumeYes: true,
|
|
26
|
-
interactive: false,
|
|
27
|
-
});
|
|
21
|
+
await executeDoctorReconcile({ root });
|
|
28
22
|
workspaceAutoInitialized = true;
|
|
29
23
|
workspaceMissing = false;
|
|
30
24
|
}
|
|
@@ -45,6 +39,8 @@ export async function resolveCliContext(options = {}) {
|
|
|
45
39
|
reductionsFile: resolveWorkspacePath(root, VORATIQ_REDUCTION_FILE),
|
|
46
40
|
messagesDir: resolveWorkspacePath(root, VORATIQ_MESSAGE_DIR),
|
|
47
41
|
messagesFile: resolveWorkspacePath(root, VORATIQ_MESSAGE_FILE),
|
|
42
|
+
interactiveDir: resolveWorkspacePath(root, VORATIQ_INTERACTIVE_DIR),
|
|
43
|
+
interactiveFile: resolveWorkspacePath(root, VORATIQ_INTERACTIVE_FILE),
|
|
48
44
|
specsDir: resolveWorkspacePath(root, VORATIQ_SPEC_DIR),
|
|
49
45
|
specsFile: resolveWorkspacePath(root, VORATIQ_SPEC_FILE),
|
|
50
46
|
verificationsDir: resolveWorkspacePath(root, VORATIQ_VERIFICATION_DIR),
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { PreflightIssue } from "../competition/shared/preflight.js";
|
|
2
|
+
import type { AgentDefinition } from "../configs/agents/types.js";
|
|
3
|
+
import type { EnvironmentConfig } from "../configs/environment/types.js";
|
|
4
|
+
export interface PrepareConfiguredOperatorReadinessInput {
|
|
5
|
+
readonly root: string;
|
|
6
|
+
readonly resolvedAgentIds?: readonly string[];
|
|
7
|
+
readonly includeSettings?: boolean;
|
|
8
|
+
readonly includeEnvironment?: boolean;
|
|
9
|
+
readonly environmentErrorMode?: "raw" | "workspace-missing";
|
|
10
|
+
}
|
|
11
|
+
export interface PreparedConfiguredOperatorReadiness {
|
|
12
|
+
readonly agents: readonly AgentDefinition[];
|
|
13
|
+
readonly issues: readonly PreflightIssue[];
|
|
14
|
+
readonly preProviderIssueCount: number;
|
|
15
|
+
readonly noAgentsEnabled: boolean;
|
|
16
|
+
readonly environment?: EnvironmentConfig;
|
|
17
|
+
}
|
|
18
|
+
export interface PrepareResolvedOperatorReadinessInput {
|
|
19
|
+
readonly root: string;
|
|
20
|
+
readonly agents: readonly AgentDefinition[];
|
|
21
|
+
readonly includeSettings?: boolean;
|
|
22
|
+
readonly includeEnvironment?: boolean;
|
|
23
|
+
readonly environmentErrorMode?: "raw" | "workspace-missing";
|
|
24
|
+
}
|
|
25
|
+
export interface PreparedResolvedOperatorReadiness {
|
|
26
|
+
readonly agents: readonly AgentDefinition[];
|
|
27
|
+
readonly issues: readonly PreflightIssue[];
|
|
28
|
+
readonly preProviderIssueCount: number;
|
|
29
|
+
readonly environment?: EnvironmentConfig;
|
|
30
|
+
}
|
|
31
|
+
export declare function prepareConfiguredOperatorReadiness(input: PrepareConfiguredOperatorReadinessInput): Promise<PreparedConfiguredOperatorReadiness>;
|
|
32
|
+
export declare function prepareResolvedOperatorReadiness(input: PrepareResolvedOperatorReadinessInput): Promise<PreparedResolvedOperatorReadiness>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { collectConfiguredAgentReadiness, collectResolvedAgentReadiness, } from "./agents.js";
|
|
2
|
+
import { loadOperatorEnvironment } from "./environment.js";
|
|
3
|
+
export async function prepareConfiguredOperatorReadiness(input) {
|
|
4
|
+
const { root, resolvedAgentIds, includeSettings = true, includeEnvironment = false, environmentErrorMode = "raw", } = input;
|
|
5
|
+
const readiness = await collectConfiguredAgentReadiness({
|
|
6
|
+
root,
|
|
7
|
+
resolvedAgentIds,
|
|
8
|
+
includeSettings,
|
|
9
|
+
});
|
|
10
|
+
const environment = includeEnvironment
|
|
11
|
+
? loadOperatorEnvironment({
|
|
12
|
+
root,
|
|
13
|
+
errorMode: environmentErrorMode,
|
|
14
|
+
})
|
|
15
|
+
: undefined;
|
|
16
|
+
return {
|
|
17
|
+
...readiness,
|
|
18
|
+
...(environment ? { environment } : {}),
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export async function prepareResolvedOperatorReadiness(input) {
|
|
22
|
+
const { root, agents, includeSettings = true, includeEnvironment = false, environmentErrorMode = "raw", } = input;
|
|
23
|
+
const readiness = await collectResolvedAgentReadiness({
|
|
24
|
+
root,
|
|
25
|
+
agents,
|
|
26
|
+
includeSettings,
|
|
27
|
+
});
|
|
28
|
+
const environment = includeEnvironment
|
|
29
|
+
? loadOperatorEnvironment({
|
|
30
|
+
root,
|
|
31
|
+
errorMode: environmentErrorMode,
|
|
32
|
+
})
|
|
33
|
+
: undefined;
|
|
34
|
+
return {
|
|
35
|
+
agents,
|
|
36
|
+
issues: readiness.issues,
|
|
37
|
+
preProviderIssueCount: readiness.preProviderIssueCount,
|
|
38
|
+
...(environment ? { environment } : {}),
|
|
39
|
+
};
|
|
40
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { loadRepoSettings } from "../configs/settings/loader.js";
|
|
2
|
+
import { toErrorMessage } from "../utils/errors.js";
|
|
3
|
+
const SETTINGS_ISSUE_AGENT_ID = "settings";
|
|
4
|
+
export function collectSettingsPreflightIssues(root) {
|
|
5
|
+
try {
|
|
6
|
+
loadRepoSettings({ root });
|
|
7
|
+
return [];
|
|
8
|
+
}
|
|
9
|
+
catch (error) {
|
|
10
|
+
return [
|
|
11
|
+
{
|
|
12
|
+
agentId: SETTINGS_ISSUE_AGENT_ID,
|
|
13
|
+
message: toErrorMessage(error),
|
|
14
|
+
},
|
|
15
|
+
];
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface InteractiveTranscriptAgentBlock {
|
|
2
|
+
agentId: string;
|
|
3
|
+
status: "running" | "succeeded" | "failed";
|
|
4
|
+
duration: string;
|
|
5
|
+
outputPath?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface InteractiveTranscriptOptions {
|
|
8
|
+
sessionId: string;
|
|
9
|
+
createdAt: string;
|
|
10
|
+
elapsed: string;
|
|
11
|
+
workspacePath: string;
|
|
12
|
+
status: "running" | "succeeded" | "failed";
|
|
13
|
+
agents: readonly InteractiveTranscriptAgentBlock[];
|
|
14
|
+
isTty?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare function renderInteractiveTranscript(options: InteractiveTranscriptOptions): string;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { getAgentStatusStyle, getRunStatusStyle } from "../../status/colors.js";
|
|
2
|
+
import { renderTranscript } from "../utils/transcript.js";
|
|
3
|
+
import { buildStandardSessionShellSection, formatTranscriptStatusLabel, renderTranscriptStatusTable, resolveTranscriptShellStyle, } from "../utils/transcript-shell.js";
|
|
4
|
+
const DASH = "—";
|
|
5
|
+
export function renderInteractiveTranscript(options) {
|
|
6
|
+
const style = { isTty: options.isTty };
|
|
7
|
+
const resolvedStyle = resolveTranscriptShellStyle(style);
|
|
8
|
+
const sections = [];
|
|
9
|
+
sections.push(buildStandardSessionShellSection({
|
|
10
|
+
badgeText: options.sessionId,
|
|
11
|
+
badgeVariant: "interactive",
|
|
12
|
+
status: {
|
|
13
|
+
value: options.status,
|
|
14
|
+
color: getRunStatusStyle(options.status).cli,
|
|
15
|
+
},
|
|
16
|
+
elapsed: options.elapsed,
|
|
17
|
+
createdAt: options.createdAt,
|
|
18
|
+
workspacePath: options.workspacePath,
|
|
19
|
+
style,
|
|
20
|
+
}));
|
|
21
|
+
if (options.agents.length > 0) {
|
|
22
|
+
sections.push(renderTranscriptStatusTable({
|
|
23
|
+
rows: options.agents,
|
|
24
|
+
agent: (row) => row.agentId,
|
|
25
|
+
status: (row) => formatTranscriptStatusLabel(row.status, getAgentStatusStyle(row.status).cli, resolvedStyle),
|
|
26
|
+
duration: (row) => row.duration,
|
|
27
|
+
}));
|
|
28
|
+
sections.push(["---"]);
|
|
29
|
+
}
|
|
30
|
+
options.agents.forEach((agent, index) => {
|
|
31
|
+
const block = [
|
|
32
|
+
`Agent: ${agent.agentId}`,
|
|
33
|
+
"",
|
|
34
|
+
`Output: ${agent.outputPath ?? DASH}`,
|
|
35
|
+
];
|
|
36
|
+
if (index < options.agents.length - 1) {
|
|
37
|
+
block.push("", "---");
|
|
38
|
+
}
|
|
39
|
+
sections.push(block);
|
|
40
|
+
});
|
|
41
|
+
return renderTranscript({ sections });
|
|
42
|
+
}
|
|
@@ -3,10 +3,51 @@ import type { ReductionRecord } from "../../domain/reduce/model/types.js";
|
|
|
3
3
|
import type { RunRecord } from "../../domain/run/model/types.js";
|
|
4
4
|
import type { SpecRecord } from "../../domain/spec/model/types.js";
|
|
5
5
|
import type { VerificationRecord } from "../../domain/verify/model/types.js";
|
|
6
|
+
export interface RunListTableSession {
|
|
7
|
+
id: string;
|
|
8
|
+
target: string;
|
|
9
|
+
status: string;
|
|
10
|
+
createdAt: string;
|
|
11
|
+
}
|
|
12
|
+
export interface SpecListTableSession {
|
|
13
|
+
id: string;
|
|
14
|
+
description: string | null;
|
|
15
|
+
status: string;
|
|
16
|
+
createdAt: string;
|
|
17
|
+
}
|
|
18
|
+
export interface ReduceListTableSession {
|
|
19
|
+
id: string;
|
|
20
|
+
target: string;
|
|
21
|
+
status: string;
|
|
22
|
+
createdAt: string;
|
|
23
|
+
}
|
|
24
|
+
export interface VerifyListTableSession {
|
|
25
|
+
id: string;
|
|
26
|
+
target: string;
|
|
27
|
+
status: string;
|
|
28
|
+
createdAt: string;
|
|
29
|
+
}
|
|
30
|
+
export interface MessageListTableSession {
|
|
31
|
+
id: string;
|
|
32
|
+
target: string;
|
|
33
|
+
status: string;
|
|
34
|
+
createdAt: string;
|
|
35
|
+
}
|
|
36
|
+
export interface InteractiveListTableSession {
|
|
37
|
+
id: string;
|
|
38
|
+
status: string;
|
|
39
|
+
createdAt: string;
|
|
40
|
+
}
|
|
6
41
|
export declare function renderRunList(records: readonly RunRecord[]): string;
|
|
42
|
+
export declare function renderRunListTable(sessions: readonly RunListTableSession[]): string;
|
|
7
43
|
export declare function renderListTranscript(records: readonly RunRecord[]): string;
|
|
8
44
|
export declare function renderSpecList(records: readonly SpecRecord[]): string;
|
|
45
|
+
export declare function renderSpecListTable(sessions: readonly SpecListTableSession[]): string;
|
|
9
46
|
export declare function renderReduceList(records: readonly ReductionRecord[]): string;
|
|
47
|
+
export declare function renderReduceListTable(sessions: readonly ReduceListTableSession[]): string;
|
|
10
48
|
export declare function renderMessageList(records: readonly MessageRecord[]): string;
|
|
49
|
+
export declare function renderMessageListTable(sessions: readonly MessageListTableSession[]): string;
|
|
50
|
+
export declare function renderInteractiveListTable(sessions: readonly InteractiveListTableSession[]): string;
|
|
11
51
|
export declare function renderVerifyList(records: readonly VerificationRecord[]): string;
|
|
52
|
+
export declare function renderVerifyListTable(sessions: readonly VerifyListTableSession[]): string;
|
|
12
53
|
export declare function renderListTableTranscript(tableOutput: string): string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { formatTargetTablePreview } from "../../utils/list-target.js";
|
|
1
2
|
import { formatRunTimestamp } from "../utils/records.js";
|
|
2
3
|
import { renderTable } from "../utils/table.js";
|
|
3
4
|
import { renderTranscript } from "../utils/transcript.js";
|
|
4
5
|
const DASH = "—";
|
|
5
6
|
const SPEC_DESCRIPTION_PREVIEW_LENGTH = 32;
|
|
6
|
-
const MESSAGE_PROMPT_PREVIEW_LENGTH = 32;
|
|
7
7
|
export function renderRunList(records) {
|
|
8
8
|
const rows = records.map((record) => ({
|
|
9
9
|
run: record.runId,
|
|
@@ -25,6 +25,29 @@ export function renderRunList(records) {
|
|
|
25
25
|
];
|
|
26
26
|
return renderTable({ columns, rows }).join("\n");
|
|
27
27
|
}
|
|
28
|
+
export function renderRunListTable(sessions) {
|
|
29
|
+
return renderTable({
|
|
30
|
+
columns: [
|
|
31
|
+
{
|
|
32
|
+
header: "RUN",
|
|
33
|
+
accessor: (session) => session.id,
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
header: "TARGET",
|
|
37
|
+
accessor: (session) => session.target,
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
header: "STATUS",
|
|
41
|
+
accessor: (session) => session.status.toUpperCase(),
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
header: "CREATED",
|
|
45
|
+
accessor: (session) => formatRunTimestamp(session.createdAt),
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
rows: sessions,
|
|
49
|
+
}).join("\n");
|
|
50
|
+
}
|
|
28
51
|
export function renderListTranscript(records) {
|
|
29
52
|
if (records.length === 0) {
|
|
30
53
|
return "";
|
|
@@ -55,6 +78,29 @@ export function renderSpecList(records) {
|
|
|
55
78
|
rows: records,
|
|
56
79
|
}).join("\n");
|
|
57
80
|
}
|
|
81
|
+
export function renderSpecListTable(sessions) {
|
|
82
|
+
return renderTable({
|
|
83
|
+
columns: [
|
|
84
|
+
{
|
|
85
|
+
header: "SPEC",
|
|
86
|
+
accessor: (session) => session.id,
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
header: "DESCRIPTION",
|
|
90
|
+
accessor: (session) => truncatePreview(session.description, SPEC_DESCRIPTION_PREVIEW_LENGTH),
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
header: "STATUS",
|
|
94
|
+
accessor: (session) => session.status.toUpperCase(),
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
header: "CREATED",
|
|
98
|
+
accessor: (session) => formatRunTimestamp(session.createdAt),
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
rows: sessions,
|
|
102
|
+
}).join("\n");
|
|
103
|
+
}
|
|
58
104
|
export function renderReduceList(records) {
|
|
59
105
|
return renderTable({
|
|
60
106
|
columns: [
|
|
@@ -78,6 +124,29 @@ export function renderReduceList(records) {
|
|
|
78
124
|
rows: records,
|
|
79
125
|
}).join("\n");
|
|
80
126
|
}
|
|
127
|
+
export function renderReduceListTable(sessions) {
|
|
128
|
+
return renderTable({
|
|
129
|
+
columns: [
|
|
130
|
+
{
|
|
131
|
+
header: "REDUCE",
|
|
132
|
+
accessor: (session) => session.id,
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
header: "TARGET",
|
|
136
|
+
accessor: (session) => session.target,
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
header: "STATUS",
|
|
140
|
+
accessor: (session) => session.status.toUpperCase(),
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
header: "CREATED",
|
|
144
|
+
accessor: (session) => formatRunTimestamp(session.createdAt),
|
|
145
|
+
},
|
|
146
|
+
],
|
|
147
|
+
rows: sessions,
|
|
148
|
+
}).join("\n");
|
|
149
|
+
}
|
|
81
150
|
export function renderMessageList(records) {
|
|
82
151
|
return renderTable({
|
|
83
152
|
columns: [
|
|
@@ -86,8 +155,8 @@ export function renderMessageList(records) {
|
|
|
86
155
|
accessor: (record) => record.sessionId,
|
|
87
156
|
},
|
|
88
157
|
{
|
|
89
|
-
header: "
|
|
90
|
-
accessor: (record) =>
|
|
158
|
+
header: "TARGET",
|
|
159
|
+
accessor: (record) => normalizeMessageTargetPreview(record),
|
|
91
160
|
},
|
|
92
161
|
{
|
|
93
162
|
header: "STATUS",
|
|
@@ -101,6 +170,48 @@ export function renderMessageList(records) {
|
|
|
101
170
|
rows: records,
|
|
102
171
|
}).join("\n");
|
|
103
172
|
}
|
|
173
|
+
export function renderMessageListTable(sessions) {
|
|
174
|
+
return renderTable({
|
|
175
|
+
columns: [
|
|
176
|
+
{
|
|
177
|
+
header: "MESSAGE",
|
|
178
|
+
accessor: (session) => session.id,
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
header: "TARGET",
|
|
182
|
+
accessor: (session) => session.target,
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
header: "STATUS",
|
|
186
|
+
accessor: (session) => session.status.toUpperCase(),
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
header: "CREATED",
|
|
190
|
+
accessor: (session) => formatRunTimestamp(session.createdAt),
|
|
191
|
+
},
|
|
192
|
+
],
|
|
193
|
+
rows: sessions,
|
|
194
|
+
}).join("\n");
|
|
195
|
+
}
|
|
196
|
+
export function renderInteractiveListTable(sessions) {
|
|
197
|
+
return renderTable({
|
|
198
|
+
columns: [
|
|
199
|
+
{
|
|
200
|
+
header: "INTERACTIVE",
|
|
201
|
+
accessor: (session) => session.id,
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
header: "STATUS",
|
|
205
|
+
accessor: (session) => session.status.toUpperCase(),
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
header: "CREATED",
|
|
209
|
+
accessor: (session) => formatRunTimestamp(session.createdAt),
|
|
210
|
+
},
|
|
211
|
+
],
|
|
212
|
+
rows: sessions,
|
|
213
|
+
}).join("\n");
|
|
214
|
+
}
|
|
104
215
|
export function renderVerifyList(records) {
|
|
105
216
|
return renderTable({
|
|
106
217
|
columns: [
|
|
@@ -124,6 +235,29 @@ export function renderVerifyList(records) {
|
|
|
124
235
|
rows: records,
|
|
125
236
|
}).join("\n");
|
|
126
237
|
}
|
|
238
|
+
export function renderVerifyListTable(sessions) {
|
|
239
|
+
return renderTable({
|
|
240
|
+
columns: [
|
|
241
|
+
{
|
|
242
|
+
header: "VERIFY",
|
|
243
|
+
accessor: (session) => session.id,
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
header: "TARGET",
|
|
247
|
+
accessor: (session) => session.target,
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
header: "STATUS",
|
|
251
|
+
accessor: (session) => session.status.toUpperCase(),
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
header: "CREATED",
|
|
255
|
+
accessor: (session) => formatRunTimestamp(session.createdAt),
|
|
256
|
+
},
|
|
257
|
+
],
|
|
258
|
+
rows: sessions,
|
|
259
|
+
}).join("\n");
|
|
260
|
+
}
|
|
127
261
|
export function renderListTableTranscript(tableOutput) {
|
|
128
262
|
if (tableOutput.trim().length === 0) {
|
|
129
263
|
return "";
|
|
@@ -148,3 +282,18 @@ function truncatePreview(value, maxLength) {
|
|
|
148
282
|
}
|
|
149
283
|
return `${normalized.slice(0, maxLength - 3).trimEnd()}...`;
|
|
150
284
|
}
|
|
285
|
+
function normalizeMessageTargetPreview(record) {
|
|
286
|
+
if (!record.target) {
|
|
287
|
+
return DASH;
|
|
288
|
+
}
|
|
289
|
+
return formatTargetTablePreview(record.target.agentId
|
|
290
|
+
? {
|
|
291
|
+
kind: record.target.kind,
|
|
292
|
+
sessionId: record.target.sessionId,
|
|
293
|
+
agentId: record.target.agentId,
|
|
294
|
+
}
|
|
295
|
+
: {
|
|
296
|
+
kind: record.target.kind,
|
|
297
|
+
sessionId: record.target.sessionId,
|
|
298
|
+
});
|
|
299
|
+
}
|
|
@@ -44,6 +44,7 @@ export interface MessageTranscriptOptions {
|
|
|
44
44
|
elapsed: string;
|
|
45
45
|
workspacePath: string;
|
|
46
46
|
status: "queued" | "running" | "succeeded" | "failed" | "aborted";
|
|
47
|
+
targetDisplay?: string;
|
|
47
48
|
recipients: readonly MessageTranscriptRecipientBlock[];
|
|
48
49
|
isTty?: boolean;
|
|
49
50
|
includeSummarySection?: boolean;
|
|
@@ -68,5 +69,5 @@ export declare function formatMessageRecipientDuration(input: {
|
|
|
68
69
|
startedAt?: string;
|
|
69
70
|
completedAt?: string;
|
|
70
71
|
now?: number;
|
|
71
|
-
}): string
|
|
72
|
+
}): string;
|
|
72
73
|
export {};
|