agentv 4.10.0 → 4.11.2-next.1

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 (37) hide show
  1. package/dist/{chunk-XOSNETAV.js → chunk-BAUNAXHT.js} +1 -1
  2. package/dist/chunk-BPGJ4HBU.js +183 -0
  3. package/dist/chunk-BPGJ4HBU.js.map +1 -0
  4. package/dist/{chunk-KF6BABQ5.js → chunk-DHWFLK6T.js} +1090 -303
  5. package/dist/chunk-DHWFLK6T.js.map +1 -0
  6. package/dist/{chunk-SE73HJZG.js → chunk-FQGY6QXQ.js} +780 -346
  7. package/dist/chunk-FQGY6QXQ.js.map +1 -0
  8. package/dist/chunk-NPVGBFF6.js +151 -0
  9. package/dist/chunk-NPVGBFF6.js.map +1 -0
  10. package/dist/{chunk-VA64NETD.js → chunk-YLVQNF23.js} +1120 -731
  11. package/dist/chunk-YLVQNF23.js.map +1 -0
  12. package/dist/cli.js +6 -4
  13. package/dist/cli.js.map +1 -1
  14. package/dist/{dist-XDNB4WDT.js → dist-HNSXNRVK.js} +36 -3
  15. package/dist/docker-workspace-RPPXBT27-B4AQHVWA.js +11 -0
  16. package/dist/{esm-CZAWIY6F.js → esm-UYZ3HJBU.js} +2 -2
  17. package/dist/esm-UYZ3HJBU.js.map +1 -0
  18. package/dist/exec-AR6JUUN5-6MBPURPR.js +11 -0
  19. package/dist/exec-AR6JUUN5-6MBPURPR.js.map +1 -0
  20. package/dist/index.js +6 -4
  21. package/dist/{interactive-SNKK6VCV.js → interactive-OPHUF2UP.js} +6 -4
  22. package/dist/{interactive-SNKK6VCV.js.map → interactive-OPHUF2UP.js.map} +1 -1
  23. package/dist/{src-ML4D2MC2.js → src-PXDA7QIS.js} +2 -2
  24. package/dist/studio/assets/index-Bi-KHfNm.js +65 -0
  25. package/dist/studio/assets/index-D_j-w4UO.css +1 -0
  26. package/dist/studio/assets/{index-DcwjOyrk.js → index-VyDFrnoK.js} +1 -1
  27. package/dist/studio/index.html +2 -2
  28. package/package.json +1 -1
  29. package/dist/chunk-KF6BABQ5.js.map +0 -1
  30. package/dist/chunk-SE73HJZG.js.map +0 -1
  31. package/dist/chunk-VA64NETD.js.map +0 -1
  32. package/dist/studio/assets/index-DHxVz6M9.css +0 -1
  33. package/dist/studio/assets/index-Y5InSvcS.js +0 -65
  34. /package/dist/{chunk-XOSNETAV.js.map → chunk-BAUNAXHT.js.map} +0 -0
  35. /package/dist/{dist-XDNB4WDT.js.map → dist-HNSXNRVK.js.map} +0 -0
  36. /package/dist/{esm-CZAWIY6F.js.map → docker-workspace-RPPXBT27-B4AQHVWA.js.map} +0 -0
  37. /package/dist/{src-ML4D2MC2.js.map → src-PXDA7QIS.js.map} +0 -0
@@ -562,4 +562,4 @@ export {
562
562
  serviceInstanceIdDetector,
563
563
  init_esm4 as init_esm
564
564
  };
565
- //# sourceMappingURL=chunk-XOSNETAV.js.map
565
+ //# sourceMappingURL=chunk-BAUNAXHT.js.map
@@ -0,0 +1,183 @@
1
+ import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
2
+
3
+ // ../../packages/core/dist/chunk-SDIANPEY.js
4
+ var DefaultCommandExecutor = class {
5
+ async exec(argv, options = {}) {
6
+ const { execFileWithStdin } = await import("./exec-AR6JUUN5-6MBPURPR.js");
7
+ return execFileWithStdin(argv, options.stdin ?? "", {
8
+ timeoutMs: options.timeoutMs
9
+ });
10
+ }
11
+ };
12
+ var DEFAULT_TIMEOUT_S = 1800;
13
+ function buildGitCommand(target, args) {
14
+ if (!target?.path) {
15
+ return ["git", ...args];
16
+ }
17
+ return ["git", "-C", target.path, ...args];
18
+ }
19
+ var DockerWorkspaceProvider = class {
20
+ config;
21
+ executor;
22
+ timeoutMs;
23
+ constructor(config, executor) {
24
+ this.config = config;
25
+ this.executor = executor ?? new DefaultCommandExecutor();
26
+ this.timeoutMs = (config.timeout ?? DEFAULT_TIMEOUT_S) * 1e3;
27
+ }
28
+ /** Check whether the Docker CLI is available on the host. */
29
+ async isDockerAvailable() {
30
+ try {
31
+ const result = await this.executor.exec(
32
+ ["docker", "version", "--format", "{{.Server.Version}}"],
33
+ {
34
+ timeoutMs: 1e4
35
+ }
36
+ );
37
+ return result.exitCode === 0;
38
+ } catch {
39
+ return false;
40
+ }
41
+ }
42
+ /** Pull the configured Docker image. No-op if already cached locally. */
43
+ async pullImage() {
44
+ const inspectResult = await this.executor.exec(
45
+ ["docker", "image", "inspect", this.config.image],
46
+ {
47
+ timeoutMs: 1e4
48
+ }
49
+ );
50
+ if (inspectResult.exitCode === 0) {
51
+ return;
52
+ }
53
+ const result = await this.executor.exec(["docker", "pull", this.config.image], {
54
+ timeoutMs: this.timeoutMs
55
+ });
56
+ if (result.exitCode !== 0) {
57
+ throw new Error(`docker pull failed (exit ${result.exitCode}): ${result.stderr.trim()}`);
58
+ }
59
+ }
60
+ /** Create a stopped container from the configured image with resource limits. Returns container ID. */
61
+ async createContainer() {
62
+ const argv = ["docker", "create"];
63
+ if (this.config.memory) {
64
+ argv.push(`--memory=${this.config.memory}`);
65
+ }
66
+ if (this.config.cpus !== void 0) {
67
+ argv.push(`--cpus=${this.config.cpus}`);
68
+ }
69
+ argv.push(this.config.image, "sleep", "infinity");
70
+ const result = await this.executor.exec(argv, { timeoutMs: 3e4 });
71
+ if (result.exitCode !== 0) {
72
+ throw new Error(`docker create failed (exit ${result.exitCode}): ${result.stderr.trim()}`);
73
+ }
74
+ return result.stdout.trim();
75
+ }
76
+ /** Start a previously created container. */
77
+ async startContainer(containerId) {
78
+ const result = await this.executor.exec(["docker", "start", containerId], {
79
+ timeoutMs: 3e4
80
+ });
81
+ if (result.exitCode !== 0) {
82
+ throw new Error(`docker start failed (exit ${result.exitCode}): ${result.stderr.trim()}`);
83
+ }
84
+ }
85
+ /**
86
+ * Reset the container checkout to the specified target refs, if any.
87
+ * This is used for SWE-bench images where the repo state must match the
88
+ * dataset's base snapshot before grading begins.
89
+ */
90
+ async resetContainerCheckout(containerId, repoCheckouts) {
91
+ if (!repoCheckouts || repoCheckouts.length === 0) {
92
+ return;
93
+ }
94
+ for (const target of repoCheckouts) {
95
+ const resetResult = await this.execInContainer({
96
+ containerId,
97
+ command: buildGitCommand(target, ["reset", "--hard", target.ref])
98
+ });
99
+ if (resetResult.exitCode !== 0) {
100
+ throw new Error(
101
+ `docker git reset failed (exit ${resetResult.exitCode}): ${resetResult.stderr.trim()}`
102
+ );
103
+ }
104
+ const verifyResult = await this.execInContainer({
105
+ containerId,
106
+ command: buildGitCommand(target, ["rev-parse", "HEAD"]),
107
+ timeoutMs: 3e4
108
+ });
109
+ if (verifyResult.exitCode !== 0) {
110
+ throw new Error(
111
+ `docker checkout verification failed (exit ${verifyResult.exitCode}): ${verifyResult.stderr.trim()}`
112
+ );
113
+ }
114
+ const head = verifyResult.stdout.trim();
115
+ if (head !== target.ref) {
116
+ throw new Error(
117
+ `docker checkout verification failed: expected ${target.ref} but found ${head || "<empty>"}`
118
+ );
119
+ }
120
+ }
121
+ }
122
+ /** Copy a local file or directory into a running container. */
123
+ async copyToContainer(containerId, localPath, containerPath) {
124
+ const result = await this.executor.exec(
125
+ ["docker", "cp", localPath, `${containerId}:${containerPath}`],
126
+ { timeoutMs: 6e4 }
127
+ );
128
+ if (result.exitCode !== 0) {
129
+ throw new Error(`docker cp failed (exit ${result.exitCode}): ${result.stderr.trim()}`);
130
+ }
131
+ }
132
+ /**
133
+ * Execute a command inside a running container.
134
+ * If stdin is provided, it is piped via `docker exec -i`.
135
+ */
136
+ async execInContainer(options) {
137
+ const { containerId, command, timeoutMs, stdin } = options;
138
+ const argv = ["docker", "exec"];
139
+ if (stdin !== void 0) {
140
+ argv.push("-i");
141
+ }
142
+ argv.push(containerId, ...command);
143
+ return this.executor.exec(argv, {
144
+ timeoutMs: timeoutMs ?? this.timeoutMs,
145
+ stdin
146
+ });
147
+ }
148
+ /** Force-remove a container (always succeeds, even if container doesn't exist). */
149
+ async removeContainer(containerId) {
150
+ try {
151
+ await this.executor.exec(["docker", "rm", "-f", containerId], {
152
+ timeoutMs: 3e4
153
+ });
154
+ } catch {
155
+ }
156
+ }
157
+ /** Full lifecycle: create → start → exec → cleanup. Convenience for single-command grading. */
158
+ async runGraderInContainer(options) {
159
+ const containerId = await this.createContainer();
160
+ try {
161
+ await this.startContainer(containerId);
162
+ await this.resetContainerCheckout(containerId, options.repoCheckouts);
163
+ if (options.copyFiles) {
164
+ for (const file of options.copyFiles) {
165
+ await this.copyToContainer(containerId, file.localPath, file.containerPath);
166
+ }
167
+ }
168
+ return await this.execInContainer({
169
+ containerId,
170
+ command: options.command,
171
+ stdin: options.stdin
172
+ });
173
+ } finally {
174
+ await this.removeContainer(containerId);
175
+ }
176
+ }
177
+ };
178
+
179
+ export {
180
+ DefaultCommandExecutor,
181
+ DockerWorkspaceProvider
182
+ };
183
+ //# sourceMappingURL=chunk-BPGJ4HBU.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../packages/core/src/evaluation/workspace/docker-workspace.ts"],"sourcesContent":["/**\n * Docker workspace provider — manages Docker container lifecycle for eval grading.\n *\n * Flow: pull image → create container → copy files in → exec grader → parse output → destroy container.\n * All Docker commands use `execFile` (no shell) for security.\n *\n * To add a new Docker command: add a method that calls `this.exec(...)` with the appropriate argv.\n *\n * Design decisions:\n * - CommandExecutor interface for testability (mock `execFile` in tests)\n * - Always `docker rm -f` in cleanup, even on errors (try/finally)\n * - Lazy-loaded: non-Docker evals never import this module\n */\n\nimport type { DockerWorkspaceConfig } from '../types.js';\nimport type { RepoCheckoutTarget } from './repo-checkout.js';\n\n/** Result of a command execution */\nexport interface ExecResult {\n readonly stdout: string;\n readonly stderr: string;\n readonly exitCode: number;\n}\n\n/** Abstraction over process execution for testability */\nexport interface CommandExecutor {\n exec(\n argv: readonly string[],\n options?: { timeoutMs?: number; stdin?: string },\n ): Promise<ExecResult>;\n}\n\n/**\n * Default command executor using Bun.spawn / Node child_process.\n * Mirrors the pattern in runtime/exec.ts.\n */\nexport class DefaultCommandExecutor implements CommandExecutor {\n async exec(\n argv: readonly string[],\n options: { timeoutMs?: number; stdin?: string } = {},\n ): Promise<ExecResult> {\n const { execFileWithStdin } = await import('../../runtime/exec.js');\n return execFileWithStdin(argv, options.stdin ?? '', {\n timeoutMs: options.timeoutMs,\n });\n }\n}\n\n/** Options for creating a Docker container */\nexport interface CreateContainerOptions {\n readonly image: string;\n readonly memory?: string;\n readonly cpus?: number;\n}\n\n/** Options for executing a command inside a container */\nexport interface ExecInContainerOptions {\n readonly containerId: string;\n readonly command: readonly string[];\n readonly timeoutMs?: number;\n readonly stdin?: string;\n}\n\nconst DEFAULT_TIMEOUT_S = 1800;\n\nfunction buildGitCommand(\n target: RepoCheckoutTarget | undefined,\n args: readonly string[],\n): string[] {\n if (!target?.path) {\n return ['git', ...args];\n }\n return ['git', '-C', target.path, ...args];\n}\n\n/**\n * Manages Docker container lifecycle for workspace-based evaluations.\n *\n * Usage:\n * const docker = new DockerWorkspaceProvider(config);\n * await docker.pullImage();\n * const containerId = await docker.createContainer();\n * try {\n * await docker.copyToContainer(containerId, localPath, containerPath);\n * const output = await docker.execInContainer({ containerId, command: [...] });\n * // parse output...\n * } finally {\n * await docker.removeContainer(containerId);\n * }\n */\nexport class DockerWorkspaceProvider {\n private readonly config: DockerWorkspaceConfig;\n private readonly executor: CommandExecutor;\n private readonly timeoutMs: number;\n\n constructor(config: DockerWorkspaceConfig, executor?: CommandExecutor) {\n this.config = config;\n this.executor = executor ?? new DefaultCommandExecutor();\n this.timeoutMs = (config.timeout ?? DEFAULT_TIMEOUT_S) * 1000;\n }\n\n /** Check whether the Docker CLI is available on the host. */\n async isDockerAvailable(): Promise<boolean> {\n try {\n const result = await this.executor.exec(\n ['docker', 'version', '--format', '{{.Server.Version}}'],\n {\n timeoutMs: 10_000,\n },\n );\n return result.exitCode === 0;\n } catch {\n return false;\n }\n }\n\n /** Pull the configured Docker image. No-op if already cached locally. */\n async pullImage(): Promise<void> {\n // Skip pull if image already exists locally (e.g. locally-built images)\n const inspectResult = await this.executor.exec(\n ['docker', 'image', 'inspect', this.config.image],\n {\n timeoutMs: 10_000,\n },\n );\n if (inspectResult.exitCode === 0) {\n return; // Image exists locally, no pull needed\n }\n\n const result = await this.executor.exec(['docker', 'pull', this.config.image], {\n timeoutMs: this.timeoutMs,\n });\n if (result.exitCode !== 0) {\n throw new Error(`docker pull failed (exit ${result.exitCode}): ${result.stderr.trim()}`);\n }\n }\n\n /** Create a stopped container from the configured image with resource limits. Returns container ID. */\n async createContainer(): Promise<string> {\n const argv: string[] = ['docker', 'create'];\n\n if (this.config.memory) {\n argv.push(`--memory=${this.config.memory}`);\n }\n if (this.config.cpus !== undefined) {\n argv.push(`--cpus=${this.config.cpus}`);\n }\n\n // Keep the container alive with a long sleep so we can exec into it\n argv.push(this.config.image, 'sleep', 'infinity');\n\n const result = await this.executor.exec(argv, { timeoutMs: 30_000 });\n if (result.exitCode !== 0) {\n throw new Error(`docker create failed (exit ${result.exitCode}): ${result.stderr.trim()}`);\n }\n return result.stdout.trim();\n }\n\n /** Start a previously created container. */\n async startContainer(containerId: string): Promise<void> {\n const result = await this.executor.exec(['docker', 'start', containerId], {\n timeoutMs: 30_000,\n });\n if (result.exitCode !== 0) {\n throw new Error(`docker start failed (exit ${result.exitCode}): ${result.stderr.trim()}`);\n }\n }\n\n /**\n * Reset the container checkout to the specified target refs, if any.\n * This is used for SWE-bench images where the repo state must match the\n * dataset's base snapshot before grading begins.\n */\n async resetContainerCheckout(\n containerId: string,\n repoCheckouts?: readonly RepoCheckoutTarget[],\n ): Promise<void> {\n if (!repoCheckouts || repoCheckouts.length === 0) {\n return;\n }\n\n for (const target of repoCheckouts) {\n const resetResult = await this.execInContainer({\n containerId,\n command: buildGitCommand(target, ['reset', '--hard', target.ref]),\n });\n if (resetResult.exitCode !== 0) {\n throw new Error(\n `docker git reset failed (exit ${resetResult.exitCode}): ${resetResult.stderr.trim()}`,\n );\n }\n\n const verifyResult = await this.execInContainer({\n containerId,\n command: buildGitCommand(target, ['rev-parse', 'HEAD']),\n timeoutMs: 30_000,\n });\n if (verifyResult.exitCode !== 0) {\n throw new Error(\n `docker checkout verification failed (exit ${verifyResult.exitCode}): ${verifyResult.stderr.trim()}`,\n );\n }\n\n const head = verifyResult.stdout.trim();\n if (head !== target.ref) {\n throw new Error(\n `docker checkout verification failed: expected ${target.ref} but found ${head || '<empty>'}`,\n );\n }\n }\n }\n\n /** Copy a local file or directory into a running container. */\n async copyToContainer(\n containerId: string,\n localPath: string,\n containerPath: string,\n ): Promise<void> {\n const result = await this.executor.exec(\n ['docker', 'cp', localPath, `${containerId}:${containerPath}`],\n { timeoutMs: 60_000 },\n );\n if (result.exitCode !== 0) {\n throw new Error(`docker cp failed (exit ${result.exitCode}): ${result.stderr.trim()}`);\n }\n }\n\n /**\n * Execute a command inside a running container.\n * If stdin is provided, it is piped via `docker exec -i`.\n */\n async execInContainer(options: ExecInContainerOptions): Promise<ExecResult> {\n const { containerId, command, timeoutMs, stdin } = options;\n const argv: string[] = ['docker', 'exec'];\n\n if (stdin !== undefined) {\n argv.push('-i');\n }\n\n argv.push(containerId, ...command);\n\n return this.executor.exec(argv, {\n timeoutMs: timeoutMs ?? this.timeoutMs,\n stdin,\n });\n }\n\n /** Force-remove a container (always succeeds, even if container doesn't exist). */\n async removeContainer(containerId: string): Promise<void> {\n try {\n await this.executor.exec(['docker', 'rm', '-f', containerId], {\n timeoutMs: 30_000,\n });\n } catch {\n // Best-effort cleanup — don't throw on removal failure\n }\n }\n\n /** Full lifecycle: create → start → exec → cleanup. Convenience for single-command grading. */\n async runGraderInContainer(options: {\n readonly command: readonly string[];\n readonly stdin?: string;\n readonly copyFiles?: ReadonlyArray<{ localPath: string; containerPath: string }>;\n readonly repoCheckouts?: readonly RepoCheckoutTarget[];\n }): Promise<ExecResult> {\n const containerId = await this.createContainer();\n try {\n await this.startContainer(containerId);\n await this.resetContainerCheckout(containerId, options.repoCheckouts);\n\n if (options.copyFiles) {\n for (const file of options.copyFiles) {\n await this.copyToContainer(containerId, file.localPath, file.containerPath);\n }\n }\n\n return await this.execInContainer({\n containerId,\n command: options.command,\n stdin: options.stdin,\n });\n } finally {\n await this.removeContainer(containerId);\n }\n }\n}\n"],"mappings":";;;AAoCO,IAAM,yBAAN,MAAwD;EAC7D,MAAM,KACJ,MACA,UAAkD,CAAC,GAC9B;AACrB,UAAM,EAAE,kBAAkB,IAAI,MAAM,OAAO,6BAAuB;AAClE,WAAO,kBAAkB,MAAM,QAAQ,SAAS,IAAI;MAClD,WAAW,QAAQ;IACrB,CAAC;EACH;AACF;AAiBA,IAAM,oBAAoB;AAE1B,SAAS,gBACP,QACA,MACU;AACV,MAAI,CAAC,QAAQ,MAAM;AACjB,WAAO,CAAC,OAAO,GAAG,IAAI;EACxB;AACA,SAAO,CAAC,OAAO,MAAM,OAAO,MAAM,GAAG,IAAI;AAC3C;AAiBO,IAAM,0BAAN,MAA8B;EAClB;EACA;EACA;EAEjB,YAAY,QAA+B,UAA4B;AACrE,SAAK,SAAS;AACd,SAAK,WAAW,YAAY,IAAI,uBAAuB;AACvD,SAAK,aAAa,OAAO,WAAW,qBAAqB;EAC3D;;EAGA,MAAM,oBAAsC;AAC1C,QAAI;AACF,YAAM,SAAS,MAAM,KAAK,SAAS;QACjC,CAAC,UAAU,WAAW,YAAY,qBAAqB;QACvD;UACE,WAAW;QACb;MACF;AACA,aAAO,OAAO,aAAa;IAC7B,QAAQ;AACN,aAAO;IACT;EACF;;EAGA,MAAM,YAA2B;AAE/B,UAAM,gBAAgB,MAAM,KAAK,SAAS;MACxC,CAAC,UAAU,SAAS,WAAW,KAAK,OAAO,KAAK;MAChD;QACE,WAAW;MACb;IACF;AACA,QAAI,cAAc,aAAa,GAAG;AAChC;IACF;AAEA,UAAM,SAAS,MAAM,KAAK,SAAS,KAAK,CAAC,UAAU,QAAQ,KAAK,OAAO,KAAK,GAAG;MAC7E,WAAW,KAAK;IAClB,CAAC;AACD,QAAI,OAAO,aAAa,GAAG;AACzB,YAAM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