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.
Files changed (222) hide show
  1. package/README.md +19 -23
  2. package/dist/agents/launch/chat.d.ts +3 -1
  3. package/dist/agents/launch/chat.js +2 -0
  4. package/dist/agents/runtime/policy.js +2 -1
  5. package/dist/auth/providers/utils.js +1 -1
  6. package/dist/bin.js +28 -7
  7. package/dist/cli/auto.js +4 -16
  8. package/dist/cli/contract.d.ts +26 -17
  9. package/dist/cli/contract.js +3 -1
  10. package/dist/cli/doctor.d.ts +12 -0
  11. package/dist/cli/doctor.js +115 -0
  12. package/dist/cli/list.js +5 -1
  13. package/dist/cli/message.js +16 -11
  14. package/dist/cli/operator-envelope.d.ts +27 -7
  15. package/dist/cli/operator-envelope.js +95 -3
  16. package/dist/cli/option-parsers.d.ts +2 -0
  17. package/dist/cli/option-parsers.js +7 -0
  18. package/dist/cli/output.d.ts +1 -5
  19. package/dist/cli/reduce.js +5 -13
  20. package/dist/cli/run.js +5 -12
  21. package/dist/cli/spec.js +4 -10
  22. package/dist/cli/verify.d.ts +1 -1
  23. package/dist/cli/verify.js +51 -22
  24. package/dist/commands/auto/command.d.ts +1 -0
  25. package/dist/commands/auto/command.js +22 -15
  26. package/dist/commands/auto/errors.js +1 -1
  27. package/dist/commands/auto/validation.js +3 -1
  28. package/dist/commands/doctor/agents.d.ts +5 -0
  29. package/dist/commands/{init → doctor}/agents.js +40 -20
  30. package/dist/commands/doctor/command.d.ts +22 -0
  31. package/dist/commands/doctor/command.js +100 -0
  32. package/dist/commands/doctor/environment.d.ts +2 -0
  33. package/dist/commands/{init → doctor}/environment.js +41 -7
  34. package/dist/commands/{init/types.d.ts → doctor/fix-types.d.ts} +30 -9
  35. package/dist/commands/doctor/fix.d.ts +2 -0
  36. package/dist/commands/{init/command.js → doctor/fix.js} +109 -11
  37. package/dist/commands/doctor/reconcile.d.ts +2 -0
  38. package/dist/commands/doctor/reconcile.js +103 -0
  39. package/dist/commands/interactive/lifecycle.d.ts +2 -0
  40. package/dist/commands/interactive/lifecycle.js +16 -0
  41. package/dist/commands/list/command.d.ts +1 -0
  42. package/dist/commands/list/command.js +241 -361
  43. package/dist/commands/list/normalization.d.ts +51 -0
  44. package/dist/commands/list/normalization.js +309 -0
  45. package/dist/commands/list/records.d.ts +9 -0
  46. package/dist/commands/list/records.js +6 -0
  47. package/dist/commands/message/command.d.ts +2 -2
  48. package/dist/commands/message/command.js +29 -16
  49. package/dist/commands/message/errors.d.ts +12 -3
  50. package/dist/commands/message/errors.js +19 -3
  51. package/dist/commands/prune/command.js +4 -1
  52. package/dist/commands/reduce/command.js +16 -17
  53. package/dist/commands/reduce/errors.d.ts +2 -2
  54. package/dist/commands/reduce/errors.js +3 -3
  55. package/dist/commands/reduce/targets.js +12 -3
  56. package/dist/commands/root-launcher/command.js +12 -6
  57. package/dist/commands/run/command.d.ts +1 -0
  58. package/dist/commands/run/command.js +4 -1
  59. package/dist/commands/run/record-init.d.ts +2 -0
  60. package/dist/commands/run/record-init.js +8 -1
  61. package/dist/commands/run/spec-provenance.d.ts +37 -0
  62. package/dist/commands/run/spec-provenance.js +384 -0
  63. package/dist/commands/run/validation.d.ts +4 -0
  64. package/dist/commands/run/validation.js +25 -62
  65. package/dist/commands/shared/resolve-stage-competitors.js +2 -1
  66. package/dist/commands/spec/command.js +64 -138
  67. package/dist/commands/spec/errors.d.ts +5 -0
  68. package/dist/commands/spec/errors.js +9 -0
  69. package/dist/commands/verify/agents.d.ts +4 -2
  70. package/dist/commands/verify/agents.js +4 -11
  71. package/dist/commands/verify/command.js +23 -6
  72. package/dist/commands/verify/errors.d.ts +12 -0
  73. package/dist/commands/verify/errors.js +22 -0
  74. package/dist/commands/verify/lifecycle.js +1 -1
  75. package/dist/commands/verify/targets.js +108 -12
  76. package/dist/competition/shared/preflight.d.ts +1 -1
  77. package/dist/competition/shared/preflight.js +15 -2
  78. package/dist/competition/shared/teardown.d.ts +7 -0
  79. package/dist/competition/shared/teardown.js +6 -0
  80. package/dist/configs/agents/defaults.js +13 -44
  81. package/dist/configs/agents/loader.js +1 -1
  82. package/dist/configs/environment/loader.js +2 -1
  83. package/dist/configs/orchestration/loader.js +2 -1
  84. package/dist/configs/sandbox/loader.js +2 -1
  85. package/dist/configs/settings/loader.js +1 -1
  86. package/dist/configs/verification/loader.js +2 -1
  87. package/dist/contracts/list.d.ts +129 -149
  88. package/dist/contracts/list.js +47 -99
  89. package/dist/domain/interactive/model/types.d.ts +2 -0
  90. package/dist/domain/interactive/model/types.js +16 -1
  91. package/dist/domain/interactive/persistence/adapter.d.ts +23 -0
  92. package/dist/domain/interactive/persistence/adapter.js +67 -5
  93. package/dist/domain/interactive/prompt.d.ts +1 -1
  94. package/dist/domain/interactive/prompt.js +1 -1
  95. package/dist/domain/interactive/session-env.d.ts +10 -0
  96. package/dist/domain/interactive/session-env.js +25 -0
  97. package/dist/domain/message/competition/adapter.js +3 -9
  98. package/dist/domain/message/model/types.d.ts +32 -1
  99. package/dist/domain/message/model/types.js +25 -1
  100. package/dist/domain/reduce/competition/adapter.js +30 -16
  101. package/dist/domain/reduce/competition/finalize.d.ts +7 -0
  102. package/dist/domain/reduce/competition/finalize.js +19 -0
  103. package/dist/domain/reduce/model/types.d.ts +3 -3
  104. package/dist/domain/run/competition/agents/artifacts.js +4 -2
  105. package/dist/domain/run/competition/agents/lifecycle.js +1 -1
  106. package/dist/domain/run/competition/agents/workspace.js +2 -1
  107. package/dist/domain/run/competition/errors.d.ts +1 -1
  108. package/dist/domain/run/competition/errors.js +4 -7
  109. package/dist/domain/run/competition/reports.js +2 -1
  110. package/dist/domain/run/model/enhanced.d.ts +1 -1
  111. package/dist/domain/run/model/enhanced.js +2 -1
  112. package/dist/domain/run/model/types.d.ts +384 -0
  113. package/dist/domain/run/model/types.js +87 -0
  114. package/dist/domain/spec/competition/adapter.d.ts +1 -0
  115. package/dist/domain/spec/competition/adapter.js +9 -10
  116. package/dist/domain/spec/model/mutators.d.ts +20 -0
  117. package/dist/domain/spec/model/mutators.js +146 -0
  118. package/dist/domain/spec/model/types.d.ts +3 -0
  119. package/dist/domain/spec/model/types.js +5 -0
  120. package/dist/domain/spec/persistence/adapter.d.ts +1 -0
  121. package/dist/domain/spec/persistence/adapter.js +7 -2
  122. package/dist/domain/verify/competition/adapter.d.ts +1 -1
  123. package/dist/domain/verify/competition/adapter.js +4 -9
  124. package/dist/domain/verify/competition/finalize.d.ts +9 -0
  125. package/dist/domain/verify/competition/finalize.js +22 -3
  126. package/dist/domain/verify/competition/programmatic.js +2 -1
  127. package/dist/domain/verify/competition/prompt.js +1 -1
  128. package/dist/domain/verify/competition/shared-layout.js +1 -1
  129. package/dist/domain/verify/model/types.d.ts +2 -2
  130. package/dist/interactive/providers/launch.d.ts +2 -0
  131. package/dist/interactive/providers/launch.js +19 -2
  132. package/dist/interactive/providers/mcp.d.ts +1 -0
  133. package/dist/interactive/providers/mcp.js +45 -7
  134. package/dist/interactive/substrate.js +32 -5
  135. package/dist/mcp/server.d.ts +1 -0
  136. package/dist/mcp/server.js +337 -44
  137. package/dist/policy/auto.d.ts +0 -1
  138. package/dist/policy/auto.js +3 -14
  139. package/dist/policy/verification.js +18 -1
  140. package/dist/preflight/agents.d.ts +24 -0
  141. package/dist/preflight/agents.js +71 -0
  142. package/dist/preflight/environment.d.ts +6 -0
  143. package/dist/preflight/environment.js +17 -0
  144. package/dist/preflight/formatting.d.ts +5 -0
  145. package/dist/preflight/formatting.js +20 -0
  146. package/dist/preflight/index.d.ts +2 -0
  147. package/dist/preflight/index.js +6 -9
  148. package/dist/preflight/operator.d.ts +32 -0
  149. package/dist/preflight/operator.js +40 -0
  150. package/dist/preflight/settings.d.ts +2 -0
  151. package/dist/preflight/settings.js +17 -0
  152. package/dist/render/transcripts/apply.js +2 -1
  153. package/dist/render/transcripts/interactive.d.ts +16 -0
  154. package/dist/render/transcripts/interactive.js +42 -0
  155. package/dist/render/transcripts/list.d.ts +41 -0
  156. package/dist/render/transcripts/list.js +152 -3
  157. package/dist/render/transcripts/message.d.ts +3 -5
  158. package/dist/render/transcripts/message.js +29 -74
  159. package/dist/render/transcripts/reduce.d.ts +2 -4
  160. package/dist/render/transcripts/reduce.js +31 -75
  161. package/dist/render/transcripts/root-launcher.js +2 -12
  162. package/dist/render/transcripts/run.d.ts +4 -4
  163. package/dist/render/transcripts/run.js +36 -47
  164. package/dist/render/transcripts/spec.d.ts +1 -4
  165. package/dist/render/transcripts/spec.js +15 -62
  166. package/dist/render/transcripts/verify.d.ts +6 -7
  167. package/dist/render/transcripts/verify.js +54 -85
  168. package/dist/render/utils/cli-writer.d.ts +4 -0
  169. package/dist/render/utils/cli-writer.js +1 -0
  170. package/dist/render/utils/duration.d.ts +5 -0
  171. package/dist/render/utils/duration.js +6 -0
  172. package/dist/render/utils/progressive-render.d.ts +3 -0
  173. package/dist/render/utils/progressive-render.js +44 -0
  174. package/dist/render/utils/runs.d.ts +1 -0
  175. package/dist/render/utils/runs.js +1 -0
  176. package/dist/render/utils/transcript-shell.d.ts +2 -1
  177. package/dist/render/utils/transcript-shell.js +19 -6
  178. package/dist/utils/diff.d.ts +2 -0
  179. package/dist/utils/diff.js +1 -0
  180. package/dist/utils/errors.d.ts +2 -1
  181. package/dist/utils/errors.js +3 -1
  182. package/dist/utils/git.d.ts +1 -1
  183. package/dist/utils/git.js +25 -2
  184. package/dist/utils/list-target.d.ts +4 -0
  185. package/dist/utils/list-target.js +35 -0
  186. package/dist/utils/swarm-session-ack.d.ts +9 -0
  187. package/dist/utils/swarm-session-ack.js +17 -0
  188. package/dist/utils/terminal.d.ts +1 -0
  189. package/dist/utils/terminal.js +11 -0
  190. package/dist/workspace/artifact-paths.d.ts +55 -0
  191. package/dist/workspace/artifact-paths.js +106 -0
  192. package/dist/workspace/chat/artifacts.d.ts +7 -0
  193. package/dist/workspace/chat/artifacts.js +95 -4
  194. package/dist/workspace/chat/native-usage.js +1 -1
  195. package/dist/workspace/chat/sources.d.ts +2 -5
  196. package/dist/workspace/chat/sources.js +4 -4
  197. package/dist/workspace/constants.d.ts +47 -0
  198. package/dist/workspace/constants.js +47 -0
  199. package/dist/workspace/errors.js +2 -2
  200. package/dist/workspace/layout.js +3 -1
  201. package/dist/workspace/managed-state.d.ts +32 -0
  202. package/dist/workspace/managed-state.js +104 -0
  203. package/dist/workspace/path-formatters.d.ts +9 -0
  204. package/dist/workspace/path-formatters.js +46 -0
  205. package/dist/workspace/path-resolvers.d.ts +1 -0
  206. package/dist/workspace/path-resolvers.js +5 -0
  207. package/dist/workspace/session-paths.d.ts +16 -0
  208. package/dist/workspace/session-paths.js +59 -0
  209. package/dist/workspace/setup.js +67 -2
  210. package/dist/workspace/shim.d.ts +1 -0
  211. package/dist/workspace/shim.js +3 -3
  212. package/package.json +2 -2
  213. package/dist/cli/init.d.ts +0 -15
  214. package/dist/cli/init.js +0 -70
  215. package/dist/commands/init/agents.d.ts +0 -4
  216. package/dist/commands/init/command.d.ts +0 -2
  217. package/dist/commands/init/environment.d.ts +0 -2
  218. package/dist/render/transcripts/init.d.ts +0 -7
  219. package/dist/render/transcripts/init.js +0 -83
  220. package/dist/workspace/structure.d.ts +0 -143
  221. package/dist/workspace/structure.js +0 -319
  222. /package/dist/commands/{init/types.js → doctor/fix-types.js} +0 -0
@@ -1,143 +0,0 @@
1
- import type { ChatArtifactFormat } from "./chat/types.js";
2
- export declare const VORATIQ_DIR = ".voratiq";
3
- export declare const VORATIQ_SPEC_DIR = "spec";
4
- export declare const VORATIQ_SPEC_FILE = "spec/index.json";
5
- export declare const VORATIQ_SPEC_SESSIONS_DIR = "spec/sessions";
6
- export declare const VORATIQ_RUN_DIR = "run";
7
- export declare const VORATIQ_RUN_FILE = "run/index.json";
8
- export declare const VORATIQ_RUN_SESSIONS_DIR = "run/sessions";
9
- export declare const VORATIQ_REDUCTION_DIR = "reduce";
10
- export declare const VORATIQ_REDUCTION_FILE = "reduce/index.json";
11
- export declare const VORATIQ_REDUCTION_SESSIONS_DIR = "reduce/sessions";
12
- export declare const VORATIQ_VERIFICATION_DIR = "verify";
13
- export declare const VORATIQ_VERIFICATION_FILE = "verify/index.json";
14
- export declare const VORATIQ_VERIFICATION_SESSIONS_DIR = "verify/sessions";
15
- export declare const VORATIQ_VERIFICATION_TEMPLATES_DIR = "verify/templates";
16
- export declare const VORATIQ_MESSAGE_DIR = "message";
17
- export declare const VORATIQ_MESSAGE_FILE = "message/index.json";
18
- export declare const VORATIQ_MESSAGE_SESSIONS_DIR = "message/sessions";
19
- export declare const VORATIQ_INTERACTIVE_DIR = "interactive";
20
- export declare const VORATIQ_INTERACTIVE_FILE = "interactive/index.json";
21
- export declare const VORATIQ_INTERACTIVE_SESSIONS_DIR = "interactive/sessions";
22
- export declare const VORATIQ_INDEX_FILENAME = "index.json";
23
- export declare const VORATIQ_HISTORY_LOCK_FILENAME = "history.lock";
24
- export declare const VORATIQ_SESSIONS_DIRNAME = "sessions";
25
- export declare const VORATIQ_AGENTS_FILE = "agents.yaml";
26
- export declare const VORATIQ_VERIFICATION_CONFIG_FILE = "verification.yaml";
27
- export declare const VORATIQ_ENVIRONMENT_FILE = "environment.yaml";
28
- export declare const VORATIQ_SANDBOX_FILE = "sandbox.yaml";
29
- export declare const VORATIQ_ORCHESTRATION_FILE = "orchestration.yaml";
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";
48
- export declare function resolveWorkspacePath(root: string, ...segments: string[]): string;
49
- export declare function formatWorkspacePath(...segments: string[]): string;
50
- export declare function getDomainDirectoryPath(domain: string): string;
51
- export declare function getDomainIndexPath(domain: string): string;
52
- export declare function getDomainHistoryLockPath(domain: string): string;
53
- export declare function getSpecDirectoryPath(): string;
54
- export declare function getSpecIndexPath(): string;
55
- export declare function getSpecHistoryLockPath(): string;
56
- export declare function getSpecSessionsDirectoryPath(): string;
57
- export declare function getReductionDirectoryPath(): string;
58
- export declare function getReductionIndexPath(): string;
59
- export declare function getReductionSessionsDirectoryPath(): string;
60
- export declare function getVerificationDirectoryPath(): string;
61
- export declare function getVerificationIndexPath(): string;
62
- export declare function getVerificationSessionsDirectoryPath(): string;
63
- export declare function getMessageDirectoryPath(): string;
64
- export declare function getMessageIndexPath(): string;
65
- export declare function getMessageSessionsDirectoryPath(): string;
66
- export declare function getInteractiveDirectoryPath(): string;
67
- export declare function getInteractiveIndexPath(): string;
68
- export declare function getInteractiveHistoryLockPath(): string;
69
- export declare function getInteractiveSessionsDirectoryPath(): string;
70
- export declare function getInteractiveSessionDirectoryPath(sessionId: string): string;
71
- export declare function getInteractiveSessionRecordPath(sessionId: string): string;
72
- export declare function getInteractiveSessionArtifactsDirectoryPath(sessionId: string): string;
73
- export declare function getDomainSessionsDirectoryPath(domain: string): string;
74
- export declare function getSessionDirectoryPath(domain: string, sessionId: string): string;
75
- export declare function getSpecSessionDirectoryPath(sessionId: string): string;
76
- export declare function getReductionSessionDirectoryPath(sessionId: string): string;
77
- export declare function getMessageSessionDirectoryPath(sessionId: string): string;
78
- export declare function getVerificationSessionDirectoryPath(sessionId: string): string;
79
- export declare function getVerificationSessionArtifactsDirectoryPath(sessionId: string): string;
80
- export declare function getVerificationSessionRecordPath(sessionId: string): string;
81
- export declare function getVerificationProgrammaticResultPath(sessionId: string): string;
82
- export declare function getVerificationRubricResultPath(options: {
83
- sessionId: string;
84
- verifierId: string;
85
- template: string;
86
- }): string;
87
- export declare function getVerificationRubricExecutionDirectoryPath(options: {
88
- sessionId: string;
89
- verifierId: string;
90
- template: string;
91
- }): string;
92
- export declare function getAgentSessionDirectoryPath(domain: string, sessionId: string, agentId: string): string;
93
- export declare function getSpecAgentSessionDirectoryPath(sessionId: string, agentId: string): string;
94
- export declare function getAgentSessionManifestPath(domain: string, sessionId: string, agentId: string): string;
95
- export declare function getAgentSessionRuntimeDirectoryPath(domain: string, sessionId: string, agentId: string): string;
96
- export declare function getAgentSessionWorkspaceDirectoryPath(domain: string, sessionId: string, agentId: string): string;
97
- export declare function getAgentSessionContextDirectoryPath(domain: string, sessionId: string, agentId: string): string;
98
- export declare function getAgentSessionArtifactsDirectoryPath(domain: string, sessionId: string, agentId: string): string;
99
- export declare function getAgentSessionStdoutPath(domain: string, sessionId: string, agentId: string): string;
100
- export declare function getAgentSessionStderrPath(domain: string, sessionId: string, agentId: string): string;
101
- export declare function getAgentSessionDiffPath(domain: string, sessionId: string, agentId: string): string;
102
- export declare function getAgentSessionSummaryPath(domain: string, sessionId: string, agentId: string): string;
103
- export declare function getAgentSessionReductionPath(domain: string, sessionId: string, agentId: string): string;
104
- export declare function getAgentSessionReductionDataPath(domain: string, sessionId: string, agentId: string): string;
105
- export declare function getAgentSessionChatArtifactPath(domain: string, sessionId: string, agentId: string, format: ChatArtifactFormat): string;
106
- export declare function getAgentSessionSandboxDirectoryPath(domain: string, sessionId: string, agentId: string): string;
107
- export declare function getAgentSessionSandboxHomePath(domain: string, sessionId: string, agentId: string): string;
108
- export declare function getAgentSessionSandboxSettingsPath(domain: string, sessionId: string, agentId: string): string;
109
- export declare function getRunDirectoryPath(runId: string): string;
110
- export declare function getAgentDirectoryPath(runId: string, agentId: string): string;
111
- export declare function getAgentManifestPath(runId: string, agentId: string): string;
112
- export declare function getAgentRuntimeDirectoryPath(runId: string, agentId: string): string;
113
- export declare function getAgentWorkspaceDirectoryPath(runId: string, agentId: string): string;
114
- export declare function getAgentContextDirectoryPath(runId: string, agentId: string): string;
115
- export declare function getAgentArtifactsDirectoryPath(runId: string, agentId: string): string;
116
- export declare function getAgentStdoutPath(runId: string, agentId: string): string;
117
- export declare function getAgentStderrPath(runId: string, agentId: string): string;
118
- export declare function getAgentDiffPath(runId: string, agentId: string): string;
119
- export declare function getAgentSummaryPath(runId: string, agentId: string): string;
120
- export declare function getAgentChatArtifactPath(runId: string, agentId: string, format: ChatArtifactFormat): string;
121
- export interface AgentArtifactsSnapshot {
122
- stdoutCaptured?: boolean;
123
- stderrCaptured?: boolean;
124
- diffCaptured?: boolean;
125
- summaryCaptured?: boolean;
126
- chatCaptured?: boolean;
127
- chatFormat?: ChatArtifactFormat;
128
- }
129
- export interface AgentArtifactPaths {
130
- stdoutPath?: string;
131
- stderrPath?: string;
132
- diffPath?: string;
133
- summaryPath?: string;
134
- chatPath?: string;
135
- }
136
- export declare function buildAgentArtifactPaths(options: {
137
- runId: string;
138
- agentId: string;
139
- artifacts?: AgentArtifactsSnapshot | null;
140
- }): AgentArtifactPaths;
141
- export declare function getAgentSandboxDirectoryPath(runId: string, agentId: string): string;
142
- export declare function getAgentSandboxHomePath(runId: string, agentId: string): string;
143
- export declare function getAgentSandboxSettingsPath(runId: string, agentId: string): string;
@@ -1,319 +0,0 @@
1
- import { agentIdSchema } from "../configs/agents/types.js";
2
- import { assertRepoRelativePath, resolvePathWithinRoot, } from "../utils/path.js";
3
- export const VORATIQ_DIR = ".voratiq";
4
- export const VORATIQ_SPEC_DIR = "spec";
5
- export const VORATIQ_SPEC_FILE = "spec/index.json";
6
- export const VORATIQ_SPEC_SESSIONS_DIR = "spec/sessions";
7
- export const VORATIQ_RUN_DIR = "run";
8
- export const VORATIQ_RUN_FILE = "run/index.json";
9
- export const VORATIQ_RUN_SESSIONS_DIR = "run/sessions";
10
- export const VORATIQ_REDUCTION_DIR = "reduce";
11
- export const VORATIQ_REDUCTION_FILE = "reduce/index.json";
12
- export const VORATIQ_REDUCTION_SESSIONS_DIR = "reduce/sessions";
13
- export const VORATIQ_VERIFICATION_DIR = "verify";
14
- export const VORATIQ_VERIFICATION_FILE = "verify/index.json";
15
- export const VORATIQ_VERIFICATION_SESSIONS_DIR = "verify/sessions";
16
- export const VORATIQ_VERIFICATION_TEMPLATES_DIR = "verify/templates";
17
- export const VORATIQ_MESSAGE_DIR = "message";
18
- export const VORATIQ_MESSAGE_FILE = "message/index.json";
19
- export const VORATIQ_MESSAGE_SESSIONS_DIR = "message/sessions";
20
- export const VORATIQ_INTERACTIVE_DIR = "interactive";
21
- export const VORATIQ_INTERACTIVE_FILE = "interactive/index.json";
22
- export const VORATIQ_INTERACTIVE_SESSIONS_DIR = "interactive/sessions";
23
- export const VORATIQ_INDEX_FILENAME = "index.json";
24
- export const VORATIQ_HISTORY_LOCK_FILENAME = "history.lock";
25
- export const VORATIQ_SESSIONS_DIRNAME = "sessions";
26
- export const VORATIQ_AGENTS_FILE = "agents.yaml";
27
- export const VORATIQ_VERIFICATION_CONFIG_FILE = "verification.yaml";
28
- export const VORATIQ_ENVIRONMENT_FILE = "environment.yaml";
29
- export const VORATIQ_SANDBOX_FILE = "sandbox.yaml";
30
- export const VORATIQ_ORCHESTRATION_FILE = "orchestration.yaml";
31
- export const WORKSPACE_DIRNAME = "workspace";
32
- export const CONTEXT_DIRNAME = "context";
33
- export const STDOUT_FILENAME = "stdout.log";
34
- export const STDERR_FILENAME = "stderr.log";
35
- export const DIFF_FILENAME = "diff.patch";
36
- export const SUMMARY_FILENAME = "summary.txt";
37
- export const CHAT_JSON_FILENAME = "chat.json";
38
- export const CHAT_JSONL_FILENAME = "chat.jsonl";
39
- export const REDUCTION_FILENAME = "reduction.md";
40
- export const REDUCTION_DATA_FILENAME = "reduction.json";
41
- export const MESSAGE_RESPONSE_FILENAME = "response.md";
42
- export const RUNTIME_DIRNAME = "runtime";
43
- export const ARTIFACTS_DIRNAME = "artifacts";
44
- export const MANIFEST_FILENAME = "manifest.json";
45
- export const REDUCTION_ARTIFACT_INFO_FILENAME = "artifact-information.json";
46
- export const SANDBOX_DIRNAME = "sandbox";
47
- export const SANDBOX_SETTINGS_FILENAME = "sandbox.json";
48
- export const PROGRAMMATIC_RESULT_FILENAME = "result.json";
49
- export function resolveWorkspacePath(root, ...segments) {
50
- return resolvePathWithinRoot(root, [VORATIQ_DIR, ...segments]);
51
- }
52
- export function formatWorkspacePath(...segments) {
53
- return [VORATIQ_DIR, ...segments].join("/");
54
- }
55
- function assertPathSegment(label, value) {
56
- if (typeof value !== "string") {
57
- throw new Error(`${label} must be a string`);
58
- }
59
- if (value.length === 0) {
60
- throw new Error(`${label} must be non-empty`);
61
- }
62
- if (value.includes("/") || value.includes("\\") || value.includes("..")) {
63
- throw new Error(`${label} \`${value}\` must not contain path separators`);
64
- }
65
- return value;
66
- }
67
- function assertDomainSegment(domain) {
68
- return assertPathSegment("domain", domain);
69
- }
70
- function assertSessionId(sessionId) {
71
- return assertPathSegment("sessionId", sessionId);
72
- }
73
- function formatDomainScopedPath(domain, ...segments) {
74
- const safeDomain = assertDomainSegment(domain);
75
- const scoped = formatWorkspacePath(safeDomain, ...segments);
76
- return assertRepoRelativePath(scoped);
77
- }
78
- function formatSessionScopedPath(domain, sessionId, ...segments) {
79
- const safeSessionId = assertSessionId(sessionId);
80
- return formatDomainScopedPath(domain, VORATIQ_SESSIONS_DIRNAME, safeSessionId, ...segments);
81
- }
82
- function formatAgentSessionScopedPath(domain, sessionId, agentId, ...segments) {
83
- const safeAgentId = agentIdSchema.parse(agentId);
84
- return formatSessionScopedPath(domain, sessionId, safeAgentId, ...segments);
85
- }
86
- function formatRunScopedPath(runId, ...segments) {
87
- const safeRunId = assertPathSegment("runId", runId);
88
- const scoped = formatDomainScopedPath(VORATIQ_RUN_DIR, VORATIQ_SESSIONS_DIRNAME, safeRunId, ...segments);
89
- return assertRepoRelativePath(scoped);
90
- }
91
- function formatAgentScopedPath(runId, agentId, ...segments) {
92
- const safeAgentId = agentIdSchema.parse(agentId);
93
- return formatRunScopedPath(runId, safeAgentId, ...segments);
94
- }
95
- export function getDomainDirectoryPath(domain) {
96
- return formatDomainScopedPath(domain);
97
- }
98
- export function getDomainIndexPath(domain) {
99
- return formatDomainScopedPath(domain, VORATIQ_INDEX_FILENAME);
100
- }
101
- export function getDomainHistoryLockPath(domain) {
102
- return formatDomainScopedPath(domain, VORATIQ_HISTORY_LOCK_FILENAME);
103
- }
104
- export function getSpecDirectoryPath() {
105
- return getDomainDirectoryPath(VORATIQ_SPEC_DIR);
106
- }
107
- export function getSpecIndexPath() {
108
- return getDomainIndexPath(VORATIQ_SPEC_DIR);
109
- }
110
- export function getSpecHistoryLockPath() {
111
- return getDomainHistoryLockPath(VORATIQ_SPEC_DIR);
112
- }
113
- export function getSpecSessionsDirectoryPath() {
114
- return getDomainSessionsDirectoryPath(VORATIQ_SPEC_DIR);
115
- }
116
- export function getReductionDirectoryPath() {
117
- return getDomainDirectoryPath(VORATIQ_REDUCTION_DIR);
118
- }
119
- export function getReductionIndexPath() {
120
- return getDomainIndexPath(VORATIQ_REDUCTION_DIR);
121
- }
122
- export function getReductionSessionsDirectoryPath() {
123
- return getDomainSessionsDirectoryPath(VORATIQ_REDUCTION_DIR);
124
- }
125
- export function getVerificationDirectoryPath() {
126
- return getDomainDirectoryPath(VORATIQ_VERIFICATION_DIR);
127
- }
128
- export function getVerificationIndexPath() {
129
- return getDomainIndexPath(VORATIQ_VERIFICATION_DIR);
130
- }
131
- export function getVerificationSessionsDirectoryPath() {
132
- return getDomainSessionsDirectoryPath(VORATIQ_VERIFICATION_DIR);
133
- }
134
- export function getMessageDirectoryPath() {
135
- return getDomainDirectoryPath(VORATIQ_MESSAGE_DIR);
136
- }
137
- export function getMessageIndexPath() {
138
- return getDomainIndexPath(VORATIQ_MESSAGE_DIR);
139
- }
140
- export function getMessageSessionsDirectoryPath() {
141
- return getDomainSessionsDirectoryPath(VORATIQ_MESSAGE_DIR);
142
- }
143
- export function getInteractiveDirectoryPath() {
144
- return getDomainDirectoryPath(VORATIQ_INTERACTIVE_DIR);
145
- }
146
- export function getInteractiveIndexPath() {
147
- return getDomainIndexPath(VORATIQ_INTERACTIVE_DIR);
148
- }
149
- export function getInteractiveHistoryLockPath() {
150
- return formatDomainScopedPath(VORATIQ_INTERACTIVE_DIR, "history.lock");
151
- }
152
- export function getInteractiveSessionsDirectoryPath() {
153
- return getDomainSessionsDirectoryPath(VORATIQ_INTERACTIVE_DIR);
154
- }
155
- export function getInteractiveSessionDirectoryPath(sessionId) {
156
- return getSessionDirectoryPath(VORATIQ_INTERACTIVE_DIR, sessionId);
157
- }
158
- export function getInteractiveSessionRecordPath(sessionId) {
159
- return formatSessionScopedPath(VORATIQ_INTERACTIVE_DIR, sessionId, "record.json");
160
- }
161
- export function getInteractiveSessionArtifactsDirectoryPath(sessionId) {
162
- return formatSessionScopedPath(VORATIQ_INTERACTIVE_DIR, sessionId, ARTIFACTS_DIRNAME);
163
- }
164
- export function getDomainSessionsDirectoryPath(domain) {
165
- return formatDomainScopedPath(domain, VORATIQ_SESSIONS_DIRNAME);
166
- }
167
- export function getSessionDirectoryPath(domain, sessionId) {
168
- return formatSessionScopedPath(domain, sessionId);
169
- }
170
- export function getSpecSessionDirectoryPath(sessionId) {
171
- return getSessionDirectoryPath(VORATIQ_SPEC_DIR, sessionId);
172
- }
173
- export function getReductionSessionDirectoryPath(sessionId) {
174
- return getSessionDirectoryPath(VORATIQ_REDUCTION_DIR, sessionId);
175
- }
176
- export function getMessageSessionDirectoryPath(sessionId) {
177
- return getSessionDirectoryPath(VORATIQ_MESSAGE_DIR, sessionId);
178
- }
179
- export function getVerificationSessionDirectoryPath(sessionId) {
180
- return getSessionDirectoryPath(VORATIQ_VERIFICATION_DIR, sessionId);
181
- }
182
- export function getVerificationSessionArtifactsDirectoryPath(sessionId) {
183
- return formatSessionScopedPath(VORATIQ_VERIFICATION_DIR, sessionId, ARTIFACTS_DIRNAME);
184
- }
185
- export function getVerificationSessionRecordPath(sessionId) {
186
- return formatSessionScopedPath(VORATIQ_VERIFICATION_DIR, sessionId, "record.json");
187
- }
188
- export function getVerificationProgrammaticResultPath(sessionId) {
189
- return formatSessionScopedPath(VORATIQ_VERIFICATION_DIR, sessionId, "programmatic", ARTIFACTS_DIRNAME, PROGRAMMATIC_RESULT_FILENAME);
190
- }
191
- export function getVerificationRubricResultPath(options) {
192
- const { sessionId, verifierId, template } = options;
193
- const safeVerifierId = agentIdSchema.parse(verifierId);
194
- const safeTemplate = assertPathSegment("segment", template);
195
- return formatAgentSessionScopedPath(VORATIQ_VERIFICATION_DIR, sessionId, safeVerifierId, safeTemplate, ARTIFACTS_DIRNAME, "result.json");
196
- }
197
- export function getVerificationRubricExecutionDirectoryPath(options) {
198
- const { sessionId, verifierId, template } = options;
199
- const safeVerifierId = agentIdSchema.parse(verifierId);
200
- const safeTemplate = assertPathSegment("segment", template);
201
- return formatAgentSessionScopedPath(VORATIQ_VERIFICATION_DIR, sessionId, safeVerifierId, safeTemplate);
202
- }
203
- export function getAgentSessionDirectoryPath(domain, sessionId, agentId) {
204
- return formatAgentSessionScopedPath(domain, sessionId, agentId);
205
- }
206
- export function getSpecAgentSessionDirectoryPath(sessionId, agentId) {
207
- return getAgentSessionDirectoryPath(VORATIQ_SPEC_DIR, sessionId, agentId);
208
- }
209
- export function getAgentSessionManifestPath(domain, sessionId, agentId) {
210
- return formatAgentSessionScopedPath(domain, sessionId, agentId, RUNTIME_DIRNAME, MANIFEST_FILENAME);
211
- }
212
- export function getAgentSessionRuntimeDirectoryPath(domain, sessionId, agentId) {
213
- return formatAgentSessionScopedPath(domain, sessionId, agentId, RUNTIME_DIRNAME);
214
- }
215
- export function getAgentSessionWorkspaceDirectoryPath(domain, sessionId, agentId) {
216
- return formatAgentSessionScopedPath(domain, sessionId, agentId, WORKSPACE_DIRNAME);
217
- }
218
- export function getAgentSessionContextDirectoryPath(domain, sessionId, agentId) {
219
- return formatAgentSessionScopedPath(domain, sessionId, agentId, CONTEXT_DIRNAME);
220
- }
221
- export function getAgentSessionArtifactsDirectoryPath(domain, sessionId, agentId) {
222
- return formatAgentSessionScopedPath(domain, sessionId, agentId, ARTIFACTS_DIRNAME);
223
- }
224
- export function getAgentSessionStdoutPath(domain, sessionId, agentId) {
225
- return formatAgentSessionScopedPath(domain, sessionId, agentId, ARTIFACTS_DIRNAME, STDOUT_FILENAME);
226
- }
227
- export function getAgentSessionStderrPath(domain, sessionId, agentId) {
228
- return formatAgentSessionScopedPath(domain, sessionId, agentId, ARTIFACTS_DIRNAME, STDERR_FILENAME);
229
- }
230
- export function getAgentSessionDiffPath(domain, sessionId, agentId) {
231
- return formatAgentSessionScopedPath(domain, sessionId, agentId, ARTIFACTS_DIRNAME, DIFF_FILENAME);
232
- }
233
- export function getAgentSessionSummaryPath(domain, sessionId, agentId) {
234
- return formatAgentSessionScopedPath(domain, sessionId, agentId, ARTIFACTS_DIRNAME, SUMMARY_FILENAME);
235
- }
236
- export function getAgentSessionReductionPath(domain, sessionId, agentId) {
237
- return formatAgentSessionScopedPath(domain, sessionId, agentId, ARTIFACTS_DIRNAME, REDUCTION_FILENAME);
238
- }
239
- export function getAgentSessionReductionDataPath(domain, sessionId, agentId) {
240
- return formatAgentSessionScopedPath(domain, sessionId, agentId, ARTIFACTS_DIRNAME, REDUCTION_DATA_FILENAME);
241
- }
242
- export function getAgentSessionChatArtifactPath(domain, sessionId, agentId, format) {
243
- const filename = format === "json" ? CHAT_JSON_FILENAME : CHAT_JSONL_FILENAME;
244
- return formatAgentSessionScopedPath(domain, sessionId, agentId, ARTIFACTS_DIRNAME, filename);
245
- }
246
- export function getAgentSessionSandboxDirectoryPath(domain, sessionId, agentId) {
247
- return formatAgentSessionScopedPath(domain, sessionId, agentId, SANDBOX_DIRNAME);
248
- }
249
- export function getAgentSessionSandboxHomePath(domain, sessionId, agentId) {
250
- return getAgentSessionSandboxDirectoryPath(domain, sessionId, agentId);
251
- }
252
- export function getAgentSessionSandboxSettingsPath(domain, sessionId, agentId) {
253
- return formatAgentSessionScopedPath(domain, sessionId, agentId, RUNTIME_DIRNAME, SANDBOX_SETTINGS_FILENAME);
254
- }
255
- export function getRunDirectoryPath(runId) {
256
- return formatRunScopedPath(runId);
257
- }
258
- export function getAgentDirectoryPath(runId, agentId) {
259
- return formatAgentScopedPath(runId, agentId);
260
- }
261
- export function getAgentManifestPath(runId, agentId) {
262
- return getAgentSessionManifestPath(VORATIQ_RUN_DIR, runId, agentId);
263
- }
264
- export function getAgentRuntimeDirectoryPath(runId, agentId) {
265
- return getAgentSessionRuntimeDirectoryPath(VORATIQ_RUN_DIR, runId, agentId);
266
- }
267
- export function getAgentWorkspaceDirectoryPath(runId, agentId) {
268
- return getAgentSessionWorkspaceDirectoryPath(VORATIQ_RUN_DIR, runId, agentId);
269
- }
270
- export function getAgentContextDirectoryPath(runId, agentId) {
271
- return getAgentSessionContextDirectoryPath(VORATIQ_RUN_DIR, runId, agentId);
272
- }
273
- export function getAgentArtifactsDirectoryPath(runId, agentId) {
274
- return getAgentSessionArtifactsDirectoryPath(VORATIQ_RUN_DIR, runId, agentId);
275
- }
276
- export function getAgentStdoutPath(runId, agentId) {
277
- return getAgentSessionStdoutPath(VORATIQ_RUN_DIR, runId, agentId);
278
- }
279
- export function getAgentStderrPath(runId, agentId) {
280
- return getAgentSessionStderrPath(VORATIQ_RUN_DIR, runId, agentId);
281
- }
282
- export function getAgentDiffPath(runId, agentId) {
283
- return getAgentSessionDiffPath(VORATIQ_RUN_DIR, runId, agentId);
284
- }
285
- export function getAgentSummaryPath(runId, agentId) {
286
- return getAgentSessionSummaryPath(VORATIQ_RUN_DIR, runId, agentId);
287
- }
288
- export function getAgentChatArtifactPath(runId, agentId, format) {
289
- return getAgentSessionChatArtifactPath(VORATIQ_RUN_DIR, runId, agentId, format);
290
- }
291
- export function buildAgentArtifactPaths(options) {
292
- const { runId, agentId, artifacts } = options;
293
- const stdoutCaptured = artifacts?.stdoutCaptured ?? true;
294
- const stderrCaptured = artifacts?.stderrCaptured ?? true;
295
- const diffCaptured = artifacts?.diffCaptured ?? false;
296
- const summaryCaptured = artifacts?.summaryCaptured ?? false;
297
- const chatCaptured = artifacts?.chatCaptured ?? false;
298
- const chatFormat = artifacts?.chatFormat ?? "jsonl";
299
- return {
300
- stdoutPath: stdoutCaptured ? getAgentStdoutPath(runId, agentId) : undefined,
301
- stderrPath: stderrCaptured ? getAgentStderrPath(runId, agentId) : undefined,
302
- diffPath: diffCaptured ? getAgentDiffPath(runId, agentId) : undefined,
303
- summaryPath: summaryCaptured
304
- ? getAgentSummaryPath(runId, agentId)
305
- : undefined,
306
- chatPath: chatCaptured
307
- ? getAgentChatArtifactPath(runId, agentId, chatFormat)
308
- : undefined,
309
- };
310
- }
311
- export function getAgentSandboxDirectoryPath(runId, agentId) {
312
- return getAgentSessionSandboxDirectoryPath(VORATIQ_RUN_DIR, runId, agentId);
313
- }
314
- export function getAgentSandboxHomePath(runId, agentId) {
315
- return getAgentSessionSandboxHomePath(VORATIQ_RUN_DIR, runId, agentId);
316
- }
317
- export function getAgentSandboxSettingsPath(runId, agentId) {
318
- return getAgentSessionSandboxSettingsPath(VORATIQ_RUN_DIR, runId, agentId);
319
- }