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
package/dist/utils/git.js
CHANGED
|
@@ -20,7 +20,7 @@ export async function assertGitRepository(root) {
|
|
|
20
20
|
const repoRoot = await getGitRepositoryRoot(root);
|
|
21
21
|
if (repoRoot !== null) {
|
|
22
22
|
// We're in a repo but not at the root
|
|
23
|
-
throw new GitRepositoryError("Run `voratiq
|
|
23
|
+
throw new GitRepositoryError("Run `voratiq` from the repository root.", "not_repository_root", repoRoot);
|
|
24
24
|
}
|
|
25
25
|
// No git repository exists at all
|
|
26
26
|
throw new GitRepositoryError("No git repository found. Run `git init` or switch to an existing repository.", "no_repository");
|
|
@@ -80,8 +80,15 @@ export async function removeWorktree(options) {
|
|
|
80
80
|
cwd: root,
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
|
-
export async function gitAddAll(cwd) {
|
|
83
|
+
export async function gitAddAll(cwd, excludedPaths) {
|
|
84
84
|
await runGitCommand(["add", "-A"], { cwd });
|
|
85
|
+
const existingExcludedPaths = await resolveExistingGitPaths(cwd, excludedPaths);
|
|
86
|
+
if (existingExcludedPaths.length === 0) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
await runGitCommand(["reset", "--quiet", "HEAD", "--", ...existingExcludedPaths], {
|
|
90
|
+
cwd,
|
|
91
|
+
});
|
|
85
92
|
}
|
|
86
93
|
export async function gitHasStagedChanges(cwd) {
|
|
87
94
|
const output = await runGitCommand(["diff", "--cached", "--name-only"], {
|
|
@@ -146,3 +153,19 @@ function isHeadMissing(error) {
|
|
|
146
153
|
const isHeadExitCode = code === 128 || code === "128";
|
|
147
154
|
return headMissingMessage || (isHeadExitCode && normalized.includes("head"));
|
|
148
155
|
}
|
|
156
|
+
async function resolveExistingGitPaths(cwd, paths) {
|
|
157
|
+
if (!paths || paths.length === 0) {
|
|
158
|
+
return [];
|
|
159
|
+
}
|
|
160
|
+
const existing = [];
|
|
161
|
+
for (const path of paths) {
|
|
162
|
+
try {
|
|
163
|
+
await access(join(cwd, path), F_OK);
|
|
164
|
+
existing.push(path);
|
|
165
|
+
}
|
|
166
|
+
catch {
|
|
167
|
+
// Ignore missing excluded paths so git add works across repos and tests.
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
return existing;
|
|
171
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ListJsonTargetRef } from "../contracts/list.js";
|
|
2
|
+
export declare const TARGET_TABLE_PREVIEW_LENGTH = 32;
|
|
3
|
+
export declare function formatTargetDisplay(target: ListJsonTargetRef): string;
|
|
4
|
+
export declare function formatTargetTablePreview(target: ListJsonTargetRef, maxLength?: number): string;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const TARGET_SEPARATOR = ":";
|
|
2
|
+
const TARGET_ELISION = "...";
|
|
3
|
+
export const TARGET_TABLE_PREVIEW_LENGTH = 32;
|
|
4
|
+
export function formatTargetDisplay(target) {
|
|
5
|
+
if (target.kind === "file") {
|
|
6
|
+
return `file:${target.path}`;
|
|
7
|
+
}
|
|
8
|
+
if (target.agentId) {
|
|
9
|
+
return `${target.kind}:${target.sessionId}:${target.agentId}`;
|
|
10
|
+
}
|
|
11
|
+
return `${target.kind}:${target.sessionId}`;
|
|
12
|
+
}
|
|
13
|
+
export function formatTargetTablePreview(target, maxLength = TARGET_TABLE_PREVIEW_LENGTH) {
|
|
14
|
+
const display = formatTargetDisplay(target);
|
|
15
|
+
return middleElideTargetDisplay(display, maxLength);
|
|
16
|
+
}
|
|
17
|
+
function middleElideTargetDisplay(display, maxLength) {
|
|
18
|
+
if (display.length <= maxLength) {
|
|
19
|
+
return display;
|
|
20
|
+
}
|
|
21
|
+
if (maxLength <= TARGET_ELISION.length) {
|
|
22
|
+
return display.slice(0, maxLength);
|
|
23
|
+
}
|
|
24
|
+
const separatorIndex = display.indexOf(TARGET_SEPARATOR);
|
|
25
|
+
const prefixLength = separatorIndex >= 0 ? separatorIndex + 1 : 0;
|
|
26
|
+
const prefix = display.slice(0, prefixLength);
|
|
27
|
+
const suffixSource = display.slice(prefixLength);
|
|
28
|
+
const availableSuffixLength = maxLength - prefix.length - TARGET_ELISION.length;
|
|
29
|
+
if (availableSuffixLength <= 0) {
|
|
30
|
+
const prefixBudget = Math.max(0, maxLength - TARGET_ELISION.length);
|
|
31
|
+
return `${display.slice(0, prefixBudget)}${TARGET_ELISION}`;
|
|
32
|
+
}
|
|
33
|
+
const suffix = suffixSource.slice(-availableSuffixLength);
|
|
34
|
+
return `${prefix}${TARGET_ELISION}${suffix}`;
|
|
35
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const VORATIQ_MCP_ACK_PATH_ENV = "VORATIQ_MCP_ACK_PATH";
|
|
2
|
+
export declare const VORATIQ_MCP_ACK_OPERATOR_ENV = "VORATIQ_MCP_ACK_OPERATOR";
|
|
3
|
+
export type SwarmAckOperator = "spec" | "run" | "reduce" | "verify" | "message";
|
|
4
|
+
export type SwarmAckStatus = "queued" | "running" | "succeeded" | "failed" | "unresolved";
|
|
5
|
+
export declare function emitSwarmSessionAcknowledgement(options: {
|
|
6
|
+
operator: SwarmAckOperator;
|
|
7
|
+
sessionId: string;
|
|
8
|
+
status: SwarmAckStatus;
|
|
9
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { rename, writeFile } from "node:fs/promises";
|
|
2
|
+
export const VORATIQ_MCP_ACK_PATH_ENV = "VORATIQ_MCP_ACK_PATH";
|
|
3
|
+
export const VORATIQ_MCP_ACK_OPERATOR_ENV = "VORATIQ_MCP_ACK_OPERATOR";
|
|
4
|
+
export async function emitSwarmSessionAcknowledgement(options) {
|
|
5
|
+
const ackPath = process.env[VORATIQ_MCP_ACK_PATH_ENV];
|
|
6
|
+
const ackOperator = process.env[VORATIQ_MCP_ACK_OPERATOR_ENV];
|
|
7
|
+
if (!ackPath || ackOperator !== options.operator) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
const tempPath = `${ackPath}.tmp`;
|
|
11
|
+
await writeFile(tempPath, JSON.stringify({
|
|
12
|
+
operator: options.operator,
|
|
13
|
+
sessionId: options.sessionId,
|
|
14
|
+
status: options.status,
|
|
15
|
+
}), "utf8");
|
|
16
|
+
await rename(tempPath, ackPath);
|
|
17
|
+
}
|
package/dist/utils/terminal.d.ts
CHANGED
|
@@ -3,3 +3,4 @@ export interface InteractiveShellOptions {
|
|
|
3
3
|
output?: NodeJS.WriteStream | null;
|
|
4
4
|
}
|
|
5
5
|
export declare function isInteractiveShell(options?: InteractiveShellOptions): boolean;
|
|
6
|
+
export declare function normalizeInteractiveTerm(env: NodeJS.ProcessEnv, options?: InteractiveShellOptions): string | undefined;
|
package/dist/utils/terminal.js
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
|
+
const FALLBACK_INTERACTIVE_TERM = "xterm-256color";
|
|
1
2
|
export function isInteractiveShell(options = {}) {
|
|
2
3
|
const input = options.input ?? process.stdin;
|
|
3
4
|
const output = options.output ?? process.stdout;
|
|
4
5
|
return Boolean(input?.isTTY && output?.isTTY);
|
|
5
6
|
}
|
|
7
|
+
export function normalizeInteractiveTerm(env, options = {}) {
|
|
8
|
+
if (!isInteractiveShell(options)) {
|
|
9
|
+
return env.TERM;
|
|
10
|
+
}
|
|
11
|
+
const term = env.TERM?.trim();
|
|
12
|
+
if (!term || term.toLowerCase() === "dumb") {
|
|
13
|
+
return FALLBACK_INTERACTIVE_TERM;
|
|
14
|
+
}
|
|
15
|
+
return env.TERM;
|
|
16
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { ChatArtifactFormat } from "./chat/types.js";
|
|
2
|
+
export declare function getVerificationProgrammaticResultPath(sessionId: string): string;
|
|
3
|
+
export declare function getVerificationRubricResultPath(options: {
|
|
4
|
+
sessionId: string;
|
|
5
|
+
verifierId: string;
|
|
6
|
+
template: string;
|
|
7
|
+
}): string;
|
|
8
|
+
export declare function getVerificationRubricExecutionDirectoryPath(options: {
|
|
9
|
+
sessionId: string;
|
|
10
|
+
verifierId: string;
|
|
11
|
+
template: string;
|
|
12
|
+
}): string;
|
|
13
|
+
export declare function getAgentSessionManifestPath(domain: string, sessionId: string, agentId: string): string;
|
|
14
|
+
export declare function getAgentSessionRuntimeDirectoryPath(domain: string, sessionId: string, agentId: string): string;
|
|
15
|
+
export declare function getAgentSessionStdoutPath(domain: string, sessionId: string, agentId: string): string;
|
|
16
|
+
export declare function getAgentSessionStderrPath(domain: string, sessionId: string, agentId: string): string;
|
|
17
|
+
export declare function getAgentSessionDiffPath(domain: string, sessionId: string, agentId: string): string;
|
|
18
|
+
export declare function getAgentSessionSummaryPath(domain: string, sessionId: string, agentId: string): string;
|
|
19
|
+
export declare function getAgentSessionChatArtifactPath(domain: string, sessionId: string, agentId: string, format: ChatArtifactFormat): string;
|
|
20
|
+
export declare function getAgentSessionSandboxDirectoryPath(domain: string, sessionId: string, agentId: string): string;
|
|
21
|
+
export declare function getAgentSessionSandboxHomePath(domain: string, sessionId: string, agentId: string): string;
|
|
22
|
+
export declare function getAgentSessionSandboxSettingsPath(domain: string, sessionId: string, agentId: string): string;
|
|
23
|
+
export declare function getAgentManifestPath(runId: string, agentId: string): string;
|
|
24
|
+
export declare function getAgentRuntimeDirectoryPath(runId: string, agentId: string): string;
|
|
25
|
+
export declare function getAgentWorkspaceDirectoryPath(runId: string, agentId: string): string;
|
|
26
|
+
export declare function getAgentContextDirectoryPath(runId: string, agentId: string): string;
|
|
27
|
+
export declare function getAgentArtifactsDirectoryPath(runId: string, agentId: string): string;
|
|
28
|
+
export declare function getAgentStdoutPath(runId: string, agentId: string): string;
|
|
29
|
+
export declare function getAgentStderrPath(runId: string, agentId: string): string;
|
|
30
|
+
export declare function getAgentDiffPath(runId: string, agentId: string): string;
|
|
31
|
+
export declare function getAgentSummaryPath(runId: string, agentId: string): string;
|
|
32
|
+
export declare function getAgentChatArtifactPath(runId: string, agentId: string, format: ChatArtifactFormat): string;
|
|
33
|
+
export interface AgentArtifactsSnapshot {
|
|
34
|
+
stdoutCaptured?: boolean;
|
|
35
|
+
stderrCaptured?: boolean;
|
|
36
|
+
diffCaptured?: boolean;
|
|
37
|
+
summaryCaptured?: boolean;
|
|
38
|
+
chatCaptured?: boolean;
|
|
39
|
+
chatFormat?: ChatArtifactFormat;
|
|
40
|
+
}
|
|
41
|
+
export interface AgentArtifactPaths {
|
|
42
|
+
stdoutPath?: string;
|
|
43
|
+
stderrPath?: string;
|
|
44
|
+
diffPath?: string;
|
|
45
|
+
summaryPath?: string;
|
|
46
|
+
chatPath?: string;
|
|
47
|
+
}
|
|
48
|
+
export declare function buildAgentArtifactPaths(options: {
|
|
49
|
+
runId: string;
|
|
50
|
+
agentId: string;
|
|
51
|
+
artifacts?: AgentArtifactsSnapshot | null;
|
|
52
|
+
}): AgentArtifactPaths;
|
|
53
|
+
export declare function getAgentSandboxDirectoryPath(runId: string, agentId: string): string;
|
|
54
|
+
export declare function getAgentSandboxHomePath(runId: string, agentId: string): string;
|
|
55
|
+
export declare function getAgentSandboxSettingsPath(runId: string, agentId: string): string;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { ARTIFACTS_DIRNAME, CHAT_JSON_FILENAME, CHAT_JSONL_FILENAME, DIFF_FILENAME, MANIFEST_FILENAME, PROGRAMMATIC_RESULT_FILENAME, RUNTIME_DIRNAME, SANDBOX_DIRNAME, SANDBOX_SETTINGS_FILENAME, STDERR_FILENAME, STDOUT_FILENAME, SUMMARY_FILENAME, VORATIQ_RUN_DIR, VORATIQ_VERIFICATION_DIR, } from "./constants.js";
|
|
2
|
+
import { assertPathSegment, formatAgentSessionScopedPath, formatSessionScopedPath, } from "./path-formatters.js";
|
|
3
|
+
import { getAgentSessionArtifactsDirectoryPath, getAgentSessionContextDirectoryPath, getAgentSessionWorkspaceDirectoryPath, } from "./session-paths.js";
|
|
4
|
+
export function getVerificationProgrammaticResultPath(sessionId) {
|
|
5
|
+
return formatSessionScopedPath(VORATIQ_VERIFICATION_DIR, sessionId, "programmatic", ARTIFACTS_DIRNAME, PROGRAMMATIC_RESULT_FILENAME);
|
|
6
|
+
}
|
|
7
|
+
export function getVerificationRubricResultPath(options) {
|
|
8
|
+
const { sessionId, verifierId, template } = options;
|
|
9
|
+
const safeTemplate = assertPathSegment("segment", template);
|
|
10
|
+
return formatAgentSessionScopedPath(VORATIQ_VERIFICATION_DIR, sessionId, verifierId, safeTemplate, ARTIFACTS_DIRNAME, "result.json");
|
|
11
|
+
}
|
|
12
|
+
export function getVerificationRubricExecutionDirectoryPath(options) {
|
|
13
|
+
const { sessionId, verifierId, template } = options;
|
|
14
|
+
const safeTemplate = assertPathSegment("segment", template);
|
|
15
|
+
return formatAgentSessionScopedPath(VORATIQ_VERIFICATION_DIR, sessionId, verifierId, safeTemplate);
|
|
16
|
+
}
|
|
17
|
+
export function getAgentSessionManifestPath(domain, sessionId, agentId) {
|
|
18
|
+
return formatAgentSessionScopedPath(domain, sessionId, agentId, RUNTIME_DIRNAME, MANIFEST_FILENAME);
|
|
19
|
+
}
|
|
20
|
+
export function getAgentSessionRuntimeDirectoryPath(domain, sessionId, agentId) {
|
|
21
|
+
return formatAgentSessionScopedPath(domain, sessionId, agentId, RUNTIME_DIRNAME);
|
|
22
|
+
}
|
|
23
|
+
export function getAgentSessionStdoutPath(domain, sessionId, agentId) {
|
|
24
|
+
return formatAgentSessionScopedPath(domain, sessionId, agentId, ARTIFACTS_DIRNAME, STDOUT_FILENAME);
|
|
25
|
+
}
|
|
26
|
+
export function getAgentSessionStderrPath(domain, sessionId, agentId) {
|
|
27
|
+
return formatAgentSessionScopedPath(domain, sessionId, agentId, ARTIFACTS_DIRNAME, STDERR_FILENAME);
|
|
28
|
+
}
|
|
29
|
+
export function getAgentSessionDiffPath(domain, sessionId, agentId) {
|
|
30
|
+
return formatAgentSessionScopedPath(domain, sessionId, agentId, ARTIFACTS_DIRNAME, DIFF_FILENAME);
|
|
31
|
+
}
|
|
32
|
+
export function getAgentSessionSummaryPath(domain, sessionId, agentId) {
|
|
33
|
+
return formatAgentSessionScopedPath(domain, sessionId, agentId, ARTIFACTS_DIRNAME, SUMMARY_FILENAME);
|
|
34
|
+
}
|
|
35
|
+
export function getAgentSessionChatArtifactPath(domain, sessionId, agentId, format) {
|
|
36
|
+
const filename = format === "json" ? CHAT_JSON_FILENAME : CHAT_JSONL_FILENAME;
|
|
37
|
+
return formatAgentSessionScopedPath(domain, sessionId, agentId, ARTIFACTS_DIRNAME, filename);
|
|
38
|
+
}
|
|
39
|
+
export function getAgentSessionSandboxDirectoryPath(domain, sessionId, agentId) {
|
|
40
|
+
return formatAgentSessionScopedPath(domain, sessionId, agentId, SANDBOX_DIRNAME);
|
|
41
|
+
}
|
|
42
|
+
export function getAgentSessionSandboxHomePath(domain, sessionId, agentId) {
|
|
43
|
+
return getAgentSessionSandboxDirectoryPath(domain, sessionId, agentId);
|
|
44
|
+
}
|
|
45
|
+
export function getAgentSessionSandboxSettingsPath(domain, sessionId, agentId) {
|
|
46
|
+
return formatAgentSessionScopedPath(domain, sessionId, agentId, RUNTIME_DIRNAME, SANDBOX_SETTINGS_FILENAME);
|
|
47
|
+
}
|
|
48
|
+
export function getAgentManifestPath(runId, agentId) {
|
|
49
|
+
return getAgentSessionManifestPath(VORATIQ_RUN_DIR, runId, agentId);
|
|
50
|
+
}
|
|
51
|
+
export function getAgentRuntimeDirectoryPath(runId, agentId) {
|
|
52
|
+
return getAgentSessionRuntimeDirectoryPath(VORATIQ_RUN_DIR, runId, agentId);
|
|
53
|
+
}
|
|
54
|
+
export function getAgentWorkspaceDirectoryPath(runId, agentId) {
|
|
55
|
+
return getAgentSessionWorkspaceDirectoryPath(VORATIQ_RUN_DIR, runId, agentId);
|
|
56
|
+
}
|
|
57
|
+
export function getAgentContextDirectoryPath(runId, agentId) {
|
|
58
|
+
return getAgentSessionContextDirectoryPath(VORATIQ_RUN_DIR, runId, agentId);
|
|
59
|
+
}
|
|
60
|
+
export function getAgentArtifactsDirectoryPath(runId, agentId) {
|
|
61
|
+
return getAgentSessionArtifactsDirectoryPath(VORATIQ_RUN_DIR, runId, agentId);
|
|
62
|
+
}
|
|
63
|
+
export function getAgentStdoutPath(runId, agentId) {
|
|
64
|
+
return getAgentSessionStdoutPath(VORATIQ_RUN_DIR, runId, agentId);
|
|
65
|
+
}
|
|
66
|
+
export function getAgentStderrPath(runId, agentId) {
|
|
67
|
+
return getAgentSessionStderrPath(VORATIQ_RUN_DIR, runId, agentId);
|
|
68
|
+
}
|
|
69
|
+
export function getAgentDiffPath(runId, agentId) {
|
|
70
|
+
return getAgentSessionDiffPath(VORATIQ_RUN_DIR, runId, agentId);
|
|
71
|
+
}
|
|
72
|
+
export function getAgentSummaryPath(runId, agentId) {
|
|
73
|
+
return getAgentSessionSummaryPath(VORATIQ_RUN_DIR, runId, agentId);
|
|
74
|
+
}
|
|
75
|
+
export function getAgentChatArtifactPath(runId, agentId, format) {
|
|
76
|
+
return getAgentSessionChatArtifactPath(VORATIQ_RUN_DIR, runId, agentId, format);
|
|
77
|
+
}
|
|
78
|
+
export function buildAgentArtifactPaths(options) {
|
|
79
|
+
const { runId, agentId, artifacts } = options;
|
|
80
|
+
const stdoutCaptured = artifacts?.stdoutCaptured ?? true;
|
|
81
|
+
const stderrCaptured = artifacts?.stderrCaptured ?? true;
|
|
82
|
+
const diffCaptured = artifacts?.diffCaptured ?? false;
|
|
83
|
+
const summaryCaptured = artifacts?.summaryCaptured ?? false;
|
|
84
|
+
const chatCaptured = artifacts?.chatCaptured ?? false;
|
|
85
|
+
const chatFormat = artifacts?.chatFormat ?? "jsonl";
|
|
86
|
+
return {
|
|
87
|
+
stdoutPath: stdoutCaptured ? getAgentStdoutPath(runId, agentId) : undefined,
|
|
88
|
+
stderrPath: stderrCaptured ? getAgentStderrPath(runId, agentId) : undefined,
|
|
89
|
+
diffPath: diffCaptured ? getAgentDiffPath(runId, agentId) : undefined,
|
|
90
|
+
summaryPath: summaryCaptured
|
|
91
|
+
? getAgentSummaryPath(runId, agentId)
|
|
92
|
+
: undefined,
|
|
93
|
+
chatPath: chatCaptured
|
|
94
|
+
? getAgentChatArtifactPath(runId, agentId, chatFormat)
|
|
95
|
+
: undefined,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
export function getAgentSandboxDirectoryPath(runId, agentId) {
|
|
99
|
+
return getAgentSessionSandboxDirectoryPath(VORATIQ_RUN_DIR, runId, agentId);
|
|
100
|
+
}
|
|
101
|
+
export function getAgentSandboxHomePath(runId, agentId) {
|
|
102
|
+
return getAgentSessionSandboxHomePath(VORATIQ_RUN_DIR, runId, agentId);
|
|
103
|
+
}
|
|
104
|
+
export function getAgentSandboxSettingsPath(runId, agentId) {
|
|
105
|
+
return getAgentSessionSandboxSettingsPath(VORATIQ_RUN_DIR, runId, agentId);
|
|
106
|
+
}
|
|
@@ -12,6 +12,7 @@ export interface PreserveChatArtifactsOptions {
|
|
|
12
12
|
agentRoot: string;
|
|
13
13
|
searchEnv?: NodeJS.ProcessEnv;
|
|
14
14
|
baseline?: ProviderTranscriptBaseline;
|
|
15
|
+
selectionHint?: ProviderTranscriptSelectionHint;
|
|
15
16
|
}
|
|
16
17
|
export interface ProviderTranscriptSnapshotEntry {
|
|
17
18
|
path: string;
|
|
@@ -19,5 +20,11 @@ export interface ProviderTranscriptSnapshotEntry {
|
|
|
19
20
|
mtimeMs: number;
|
|
20
21
|
}
|
|
21
22
|
export type ProviderTranscriptBaseline = readonly ProviderTranscriptSnapshotEntry[];
|
|
23
|
+
export interface CodexSessionMetaSelectionHint {
|
|
24
|
+
strategy: "codex-session-meta";
|
|
25
|
+
cwd: string;
|
|
26
|
+
minStartedAt?: string;
|
|
27
|
+
}
|
|
28
|
+
export type ProviderTranscriptSelectionHint = CodexSessionMetaSelectionHint;
|
|
22
29
|
export declare function snapshotProviderTranscripts(options: Omit<PreserveChatArtifactsOptions, "baseline">): Promise<ProviderTranscriptBaseline>;
|
|
23
30
|
export declare function preserveProviderChatTranscripts(options: PreserveChatArtifactsOptions): Promise<ChatArtifactCaptureResult>;
|
|
@@ -4,7 +4,7 @@ import { mkdir, readFile, rm, stat, writeFile } from "node:fs/promises";
|
|
|
4
4
|
import { dirname, relative, resolve } from "node:path";
|
|
5
5
|
import { finished } from "node:stream/promises";
|
|
6
6
|
import { pathExists } from "../../utils/fs.js";
|
|
7
|
-
import { ARTIFACTS_DIRNAME, CHAT_JSON_FILENAME, CHAT_JSONL_FILENAME, } from "../
|
|
7
|
+
import { ARTIFACTS_DIRNAME, CHAT_JSON_FILENAME, CHAT_JSONL_FILENAME, } from "../constants.js";
|
|
8
8
|
import { findProviderTranscripts } from "./sources.js";
|
|
9
9
|
export async function snapshotProviderTranscripts(options) {
|
|
10
10
|
const transcriptPaths = await findProviderTranscripts(options.providerId, {
|
|
@@ -42,7 +42,20 @@ export async function preserveProviderChatTranscripts(options) {
|
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
44
|
const existing = await locateExistingChatArtifact(agentRoot);
|
|
45
|
-
|
|
45
|
+
let selection;
|
|
46
|
+
try {
|
|
47
|
+
selection = await selectTranscriptFiles({
|
|
48
|
+
providerId,
|
|
49
|
+
transcriptPaths: candidatePaths,
|
|
50
|
+
selectionHint: options.selectionHint,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
return {
|
|
55
|
+
status: "error",
|
|
56
|
+
error: error instanceof Error ? error : new Error(String(error)),
|
|
57
|
+
};
|
|
58
|
+
}
|
|
46
59
|
if (!selection) {
|
|
47
60
|
if (existing !== undefined) {
|
|
48
61
|
return {
|
|
@@ -101,10 +114,21 @@ async function locateExistingChatArtifact(agentRoot) {
|
|
|
101
114
|
}
|
|
102
115
|
return undefined;
|
|
103
116
|
}
|
|
104
|
-
function selectTranscriptFiles(
|
|
117
|
+
async function selectTranscriptFiles(options) {
|
|
118
|
+
const { providerId, transcriptPaths, selectionHint } = options;
|
|
105
119
|
const jsonlFiles = transcriptPaths.filter((path) => path.toLowerCase().endsWith(".jsonl"));
|
|
106
120
|
if (jsonlFiles.length > 0) {
|
|
107
|
-
|
|
121
|
+
const selectedJsonlFiles = await filterJsonlTranscriptFilesByHint({
|
|
122
|
+
providerId,
|
|
123
|
+
files: jsonlFiles,
|
|
124
|
+
selectionHint,
|
|
125
|
+
});
|
|
126
|
+
if (selectedJsonlFiles.length > 0) {
|
|
127
|
+
return { format: "jsonl", files: selectedJsonlFiles };
|
|
128
|
+
}
|
|
129
|
+
if (selectionHint) {
|
|
130
|
+
return undefined;
|
|
131
|
+
}
|
|
108
132
|
}
|
|
109
133
|
const jsonFiles = transcriptPaths
|
|
110
134
|
.filter((path) => path.toLowerCase().endsWith(".json"))
|
|
@@ -114,6 +138,73 @@ function selectTranscriptFiles(transcriptPaths) {
|
|
|
114
138
|
}
|
|
115
139
|
return undefined;
|
|
116
140
|
}
|
|
141
|
+
async function filterJsonlTranscriptFilesByHint(options) {
|
|
142
|
+
const sortedFiles = [...options.files].sort();
|
|
143
|
+
const hint = options.selectionHint;
|
|
144
|
+
if (!hint) {
|
|
145
|
+
return sortedFiles;
|
|
146
|
+
}
|
|
147
|
+
if (options.providerId !== "codex" ||
|
|
148
|
+
hint.strategy !== "codex-session-meta") {
|
|
149
|
+
return sortedFiles;
|
|
150
|
+
}
|
|
151
|
+
const matchingFiles = [];
|
|
152
|
+
for (const file of sortedFiles) {
|
|
153
|
+
const metadata = await readCodexSessionMetadata(file);
|
|
154
|
+
if (!metadata) {
|
|
155
|
+
continue;
|
|
156
|
+
}
|
|
157
|
+
if (metadata.cwd !== hint.cwd) {
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
160
|
+
if (hint.minStartedAt &&
|
|
161
|
+
metadata.startedAt &&
|
|
162
|
+
metadata.startedAt < hint.minStartedAt) {
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
165
|
+
matchingFiles.push(file);
|
|
166
|
+
}
|
|
167
|
+
if (matchingFiles.length === 1) {
|
|
168
|
+
return matchingFiles;
|
|
169
|
+
}
|
|
170
|
+
if (matchingFiles.length > 1) {
|
|
171
|
+
throw new Error(`Ambiguous Codex transcript provenance for cwd \`${hint.cwd}\`: ${matchingFiles.join(", ")}`);
|
|
172
|
+
}
|
|
173
|
+
return [];
|
|
174
|
+
}
|
|
175
|
+
async function readCodexSessionMetadata(path) {
|
|
176
|
+
let raw;
|
|
177
|
+
try {
|
|
178
|
+
raw = await readFile(path, "utf8");
|
|
179
|
+
}
|
|
180
|
+
catch {
|
|
181
|
+
return undefined;
|
|
182
|
+
}
|
|
183
|
+
const lines = raw.split(/\r?\n/u);
|
|
184
|
+
for (const line of lines) {
|
|
185
|
+
const trimmed = line.trim();
|
|
186
|
+
if (!trimmed) {
|
|
187
|
+
continue;
|
|
188
|
+
}
|
|
189
|
+
let parsed;
|
|
190
|
+
try {
|
|
191
|
+
parsed = JSON.parse(trimmed);
|
|
192
|
+
}
|
|
193
|
+
catch {
|
|
194
|
+
continue;
|
|
195
|
+
}
|
|
196
|
+
const record = parsed;
|
|
197
|
+
if (record.type !== "session_meta") {
|
|
198
|
+
continue;
|
|
199
|
+
}
|
|
200
|
+
const payload = record.payload?.payload ?? record.payload;
|
|
201
|
+
return {
|
|
202
|
+
cwd: typeof payload?.cwd === "string" ? payload.cwd : undefined,
|
|
203
|
+
startedAt: typeof payload?.timestamp === "string" ? payload.timestamp : undefined,
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
return undefined;
|
|
207
|
+
}
|
|
117
208
|
async function bundleJsonTranscripts(options) {
|
|
118
209
|
const { files, artifactPath, agentRoot, providerId } = options;
|
|
119
210
|
if (files.length === 0) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { resolvePath } from "../../utils/path.js";
|
|
2
|
-
import { getAgentSessionChatArtifactPath } from "../
|
|
2
|
+
import { getAgentSessionChatArtifactPath } from "../artifact-paths.js";
|
|
3
3
|
import { extractChatUsageFromArtifact } from "./usage-extractor.js";
|
|
4
4
|
export async function extractProviderNativeTokenUsageForSession(options) {
|
|
5
5
|
const { root, domain, sessionId, agentId, provider, modelId, chatCaptured, format, artifactPath, } = options;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
interface ProviderTranscriptSearchOptions {
|
|
2
2
|
agentRoot: string;
|
|
3
3
|
env?: NodeJS.ProcessEnv;
|
|
4
4
|
}
|
|
5
|
-
export type TranscriptLocator = (options: ProviderTranscriptSearchOptions) => Promise<readonly string[]>;
|
|
6
5
|
export declare function findProviderTranscripts(providerId: string, options: ProviderTranscriptSearchOptions): Promise<readonly string[]>;
|
|
7
|
-
export
|
|
8
|
-
export declare function findCodexTranscripts(options: ProviderTranscriptSearchOptions): Promise<readonly string[]>;
|
|
9
|
-
export declare function findGeminiTranscripts(options: ProviderTranscriptSearchOptions): Promise<readonly string[]>;
|
|
6
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { readdir } from "node:fs/promises";
|
|
2
2
|
import { isAbsolute, resolve as resolvePath } from "node:path";
|
|
3
3
|
import { isMissing } from "../../utils/fs.js";
|
|
4
|
-
import { SANDBOX_DIRNAME } from "../
|
|
4
|
+
import { SANDBOX_DIRNAME } from "../constants.js";
|
|
5
5
|
const locatorMap = {
|
|
6
6
|
claude: findClaudeTranscripts,
|
|
7
7
|
codex: findCodexTranscripts,
|
|
@@ -14,19 +14,19 @@ export async function findProviderTranscripts(providerId, options) {
|
|
|
14
14
|
}
|
|
15
15
|
return locator(options);
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
async function findClaudeTranscripts(options) {
|
|
18
18
|
return await collectFilesFromRoots(resolveClaudeTranscriptRoots(options), {
|
|
19
19
|
extensions: [".jsonl"],
|
|
20
20
|
maxDepth: 2,
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
async function findCodexTranscripts(options) {
|
|
24
24
|
return await collectFilesFromRoots(resolveCodexTranscriptRoots(options), {
|
|
25
25
|
extensions: [".jsonl"],
|
|
26
26
|
maxDepth: 6,
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
|
-
|
|
29
|
+
async function findGeminiTranscripts(options) {
|
|
30
30
|
const transcripts = new Set();
|
|
31
31
|
for (const tmpRoot of resolveGeminiTranscriptRoots(options)) {
|
|
32
32
|
const entries = await safeReadDir(tmpRoot);
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export declare const VORATIQ_DIR = ".voratiq";
|
|
2
|
+
export declare const VORATIQ_SPEC_DIR = "spec";
|
|
3
|
+
export declare const VORATIQ_SPEC_FILE = "spec/index.json";
|
|
4
|
+
export declare const VORATIQ_SPEC_SESSIONS_DIR = "spec/sessions";
|
|
5
|
+
export declare const VORATIQ_RUN_DIR = "run";
|
|
6
|
+
export declare const VORATIQ_RUN_FILE = "run/index.json";
|
|
7
|
+
export declare const VORATIQ_RUN_SESSIONS_DIR = "run/sessions";
|
|
8
|
+
export declare const VORATIQ_REDUCTION_DIR = "reduce";
|
|
9
|
+
export declare const VORATIQ_REDUCTION_FILE = "reduce/index.json";
|
|
10
|
+
export declare const VORATIQ_REDUCTION_SESSIONS_DIR = "reduce/sessions";
|
|
11
|
+
export declare const VORATIQ_VERIFICATION_DIR = "verify";
|
|
12
|
+
export declare const VORATIQ_VERIFICATION_FILE = "verify/index.json";
|
|
13
|
+
export declare const VORATIQ_VERIFICATION_SESSIONS_DIR = "verify/sessions";
|
|
14
|
+
export declare const VORATIQ_VERIFICATION_TEMPLATES_DIR = "verify/templates";
|
|
15
|
+
export declare const VORATIQ_MESSAGE_DIR = "message";
|
|
16
|
+
export declare const VORATIQ_MESSAGE_FILE = "message/index.json";
|
|
17
|
+
export declare const VORATIQ_MESSAGE_SESSIONS_DIR = "message/sessions";
|
|
18
|
+
export declare const VORATIQ_INTERACTIVE_DIR = "interactive";
|
|
19
|
+
export declare const VORATIQ_INTERACTIVE_FILE = "interactive/index.json";
|
|
20
|
+
export declare const VORATIQ_INTERACTIVE_SESSIONS_DIR = "interactive/sessions";
|
|
21
|
+
export declare const VORATIQ_INDEX_FILENAME = "index.json";
|
|
22
|
+
export declare const VORATIQ_HISTORY_LOCK_FILENAME = "history.lock";
|
|
23
|
+
export declare const VORATIQ_SESSIONS_DIRNAME = "sessions";
|
|
24
|
+
export declare const VORATIQ_AGENTS_FILE = "agents.yaml";
|
|
25
|
+
export declare const VORATIQ_VERIFICATION_CONFIG_FILE = "verification.yaml";
|
|
26
|
+
export declare const VORATIQ_ENVIRONMENT_FILE = "environment.yaml";
|
|
27
|
+
export declare const VORATIQ_SANDBOX_FILE = "sandbox.yaml";
|
|
28
|
+
export declare const VORATIQ_ORCHESTRATION_FILE = "orchestration.yaml";
|
|
29
|
+
export declare const VORATIQ_MANAGED_STATE_FILE = "managed-state.json";
|
|
30
|
+
export declare const WORKSPACE_DIRNAME = "workspace";
|
|
31
|
+
export declare const CONTEXT_DIRNAME = "context";
|
|
32
|
+
export declare const STDOUT_FILENAME = "stdout.log";
|
|
33
|
+
export declare const STDERR_FILENAME = "stderr.log";
|
|
34
|
+
export declare const DIFF_FILENAME = "diff.patch";
|
|
35
|
+
export declare const SUMMARY_FILENAME = "summary.txt";
|
|
36
|
+
export declare const CHAT_JSON_FILENAME = "chat.json";
|
|
37
|
+
export declare const CHAT_JSONL_FILENAME = "chat.jsonl";
|
|
38
|
+
export declare const REDUCTION_FILENAME = "reduction.md";
|
|
39
|
+
export declare const REDUCTION_DATA_FILENAME = "reduction.json";
|
|
40
|
+
export declare const MESSAGE_RESPONSE_FILENAME = "response.md";
|
|
41
|
+
export declare const RUNTIME_DIRNAME = "runtime";
|
|
42
|
+
export declare const ARTIFACTS_DIRNAME = "artifacts";
|
|
43
|
+
export declare const MANIFEST_FILENAME = "manifest.json";
|
|
44
|
+
export declare const REDUCTION_ARTIFACT_INFO_FILENAME = "artifact-information.json";
|
|
45
|
+
export declare const SANDBOX_DIRNAME = "sandbox";
|
|
46
|
+
export declare const SANDBOX_SETTINGS_FILENAME = "sandbox.json";
|
|
47
|
+
export declare const PROGRAMMATIC_RESULT_FILENAME = "result.json";
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export const VORATIQ_DIR = ".voratiq";
|
|
2
|
+
export const VORATIQ_SPEC_DIR = "spec";
|
|
3
|
+
export const VORATIQ_SPEC_FILE = "spec/index.json";
|
|
4
|
+
export const VORATIQ_SPEC_SESSIONS_DIR = "spec/sessions";
|
|
5
|
+
export const VORATIQ_RUN_DIR = "run";
|
|
6
|
+
export const VORATIQ_RUN_FILE = "run/index.json";
|
|
7
|
+
export const VORATIQ_RUN_SESSIONS_DIR = "run/sessions";
|
|
8
|
+
export const VORATIQ_REDUCTION_DIR = "reduce";
|
|
9
|
+
export const VORATIQ_REDUCTION_FILE = "reduce/index.json";
|
|
10
|
+
export const VORATIQ_REDUCTION_SESSIONS_DIR = "reduce/sessions";
|
|
11
|
+
export const VORATIQ_VERIFICATION_DIR = "verify";
|
|
12
|
+
export const VORATIQ_VERIFICATION_FILE = "verify/index.json";
|
|
13
|
+
export const VORATIQ_VERIFICATION_SESSIONS_DIR = "verify/sessions";
|
|
14
|
+
export const VORATIQ_VERIFICATION_TEMPLATES_DIR = "verify/templates";
|
|
15
|
+
export const VORATIQ_MESSAGE_DIR = "message";
|
|
16
|
+
export const VORATIQ_MESSAGE_FILE = "message/index.json";
|
|
17
|
+
export const VORATIQ_MESSAGE_SESSIONS_DIR = "message/sessions";
|
|
18
|
+
export const VORATIQ_INTERACTIVE_DIR = "interactive";
|
|
19
|
+
export const VORATIQ_INTERACTIVE_FILE = "interactive/index.json";
|
|
20
|
+
export const VORATIQ_INTERACTIVE_SESSIONS_DIR = "interactive/sessions";
|
|
21
|
+
export const VORATIQ_INDEX_FILENAME = "index.json";
|
|
22
|
+
export const VORATIQ_HISTORY_LOCK_FILENAME = "history.lock";
|
|
23
|
+
export const VORATIQ_SESSIONS_DIRNAME = "sessions";
|
|
24
|
+
export const VORATIQ_AGENTS_FILE = "agents.yaml";
|
|
25
|
+
export const VORATIQ_VERIFICATION_CONFIG_FILE = "verification.yaml";
|
|
26
|
+
export const VORATIQ_ENVIRONMENT_FILE = "environment.yaml";
|
|
27
|
+
export const VORATIQ_SANDBOX_FILE = "sandbox.yaml";
|
|
28
|
+
export const VORATIQ_ORCHESTRATION_FILE = "orchestration.yaml";
|
|
29
|
+
export const VORATIQ_MANAGED_STATE_FILE = "managed-state.json";
|
|
30
|
+
export const WORKSPACE_DIRNAME = "workspace";
|
|
31
|
+
export const CONTEXT_DIRNAME = "context";
|
|
32
|
+
export const STDOUT_FILENAME = "stdout.log";
|
|
33
|
+
export const STDERR_FILENAME = "stderr.log";
|
|
34
|
+
export const DIFF_FILENAME = "diff.patch";
|
|
35
|
+
export const SUMMARY_FILENAME = "summary.txt";
|
|
36
|
+
export const CHAT_JSON_FILENAME = "chat.json";
|
|
37
|
+
export const CHAT_JSONL_FILENAME = "chat.jsonl";
|
|
38
|
+
export const REDUCTION_FILENAME = "reduction.md";
|
|
39
|
+
export const REDUCTION_DATA_FILENAME = "reduction.json";
|
|
40
|
+
export const MESSAGE_RESPONSE_FILENAME = "response.md";
|
|
41
|
+
export const RUNTIME_DIRNAME = "runtime";
|
|
42
|
+
export const ARTIFACTS_DIRNAME = "artifacts";
|
|
43
|
+
export const MANIFEST_FILENAME = "manifest.json";
|
|
44
|
+
export const REDUCTION_ARTIFACT_INFO_FILENAME = "artifact-information.json";
|
|
45
|
+
export const SANDBOX_DIRNAME = "sandbox";
|
|
46
|
+
export const SANDBOX_SETTINGS_FILENAME = "sandbox.json";
|
|
47
|
+
export const PROGRAMMATIC_RESULT_FILENAME = "result.json";
|
package/dist/workspace/errors.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HintedError } from "../utils/errors.js";
|
|
2
2
|
const DEFAULT_WORKSPACE_HINT = [
|
|
3
|
-
"Run `voratiq
|
|
3
|
+
"Run `voratiq doctor --fix` to repair workspace setup.",
|
|
4
4
|
];
|
|
5
5
|
export class WorkspaceError extends HintedError {
|
|
6
6
|
constructor(message, detailLines = [], hintLines = DEFAULT_WORKSPACE_HINT) {
|
|
@@ -29,7 +29,7 @@ export class WorkspaceWrongTypeEntryError extends WorkspaceError {
|
|
|
29
29
|
export class WorkspaceNotInitializedError extends WorkspaceError {
|
|
30
30
|
missingEntries;
|
|
31
31
|
constructor(missingEntries) {
|
|
32
|
-
super("Voratiq workspace is not initialized.", buildMissingEntryDetailLines(missingEntries), ["Run `voratiq
|
|
32
|
+
super("Voratiq workspace is not initialized.", buildMissingEntryDetailLines(missingEntries), ["Run `voratiq doctor --fix` to repair workspace setup."]);
|
|
33
33
|
this.missingEntries = missingEntries;
|
|
34
34
|
this.name = "WorkspaceNotInitializedError";
|
|
35
35
|
}
|
package/dist/workspace/layout.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
2
2
|
import { dirname } from "node:path";
|
|
3
3
|
import { normalizePathForDisplay, resolvePath } from "../utils/path.js";
|
|
4
|
-
import {
|
|
4
|
+
import { getAgentSessionManifestPath, getAgentSessionRuntimeDirectoryPath, getAgentSessionSandboxDirectoryPath, getAgentSessionSandboxHomePath, getAgentSessionSandboxSettingsPath, getAgentSessionStderrPath, getAgentSessionStdoutPath, } from "./artifact-paths.js";
|
|
5
|
+
import { ARTIFACTS_DIRNAME, CONTEXT_DIRNAME, MANIFEST_FILENAME, RUNTIME_DIRNAME, SANDBOX_DIRNAME, SANDBOX_SETTINGS_FILENAME, STDERR_FILENAME, STDOUT_FILENAME, VORATIQ_RUN_DIR, WORKSPACE_DIRNAME, } from "./constants.js";
|
|
6
|
+
import { getAgentSessionArtifactsDirectoryPath, getAgentSessionContextDirectoryPath, getAgentSessionDirectoryPath, getAgentSessionWorkspaceDirectoryPath, getRunDirectoryPath, } from "./session-paths.js";
|
|
5
7
|
export function resolveRunWorkspacePaths(root, runId) {
|
|
6
8
|
const relative = normalizePathForDisplay(getRunDirectoryPath(runId));
|
|
7
9
|
const absolute = resolvePath(root, relative);
|