@zooid/runtime-docker 0.9.0 → 0.10.0

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/dist/index.js CHANGED
@@ -5,6 +5,7 @@ var DockerAcpRuntime = class {
5
5
  this.opts = opts;
6
6
  this.engine = opts.engine ?? "docker";
7
7
  }
8
+ opts;
8
9
  engine;
9
10
  buildArgv(spec) {
10
11
  const image = spec.image ?? this.opts.defaultImage;
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/docker-acp.ts"],"sourcesContent":["import { spawn, type ChildProcess } from 'node:child_process'\nimport type { AcpRuntime, AcpSpawnSpec } from '@zooid/core'\n\nexport interface DockerAcpRuntimeOptions {\n /** Default image when the spec doesn't specify one. */\n defaultImage?: string\n /** docker (default) or podman. */\n engine?: 'docker' | 'podman'\n}\n\n/**\n * DockerAcpRuntime spawns the ACP shim inside a container.\n *\n * argv shape: `<engine> run --rm -i [-w cwd] [-v ...] [-e ...] --entrypoint cmd image [args...]`\n *\n * The image comes from the spec (preferred) or the runtime's defaultImage.\n * If neither is set, spawn() throws.\n */\nexport class DockerAcpRuntime implements AcpRuntime {\n private readonly engine: 'docker' | 'podman'\n constructor(private readonly opts: DockerAcpRuntimeOptions = {}) {\n this.engine = opts.engine ?? 'docker'\n }\n\n buildArgv(spec: AcpSpawnSpec): string[] {\n const image = spec.image ?? this.opts.defaultImage\n if (!image) {\n throw new Error(\n 'DockerAcpRuntime: no image set (provide DockerAcpRuntimeOptions.defaultImage or AcpSpawnSpec.image)',\n )\n }\n const argv: string[] = ['run', '--rm', '-i']\n if (spec.cwd) {\n argv.push('-w', spec.cwd)\n }\n for (const m of spec.mounts ?? []) {\n argv.push('-v', `${m.path}:${m.target}:${m.mode}`)\n }\n const envEntries = Object.entries(spec.env ?? {}).sort(([a], [b]) => a.localeCompare(b))\n for (const [k, v] of envEntries) {\n argv.push('-e', `${k}=${v}`)\n }\n argv.push('--entrypoint', spec.command)\n argv.push(image)\n argv.push(...spec.args)\n return argv\n }\n\n spawn(spec: AcpSpawnSpec): ChildProcess {\n return spawn(this.engine, this.buildArgv(spec), {\n stdio: ['pipe', 'pipe', 'pipe'],\n })\n }\n}\n"],"mappings":";AAAA,SAAS,aAAgC;AAkBlC,IAAM,mBAAN,MAA6C;AAAA,EAElD,YAA6B,OAAgC,CAAC,GAAG;AAApC;AAC3B,SAAK,SAAS,KAAK,UAAU;AAAA,EAC/B;AAAA,EAHiB;AAAA,EAKjB,UAAU,MAA8B;AACtC,UAAM,QAAQ,KAAK,SAAS,KAAK,KAAK;AACtC,QAAI,CAAC,OAAO;AACV,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAAA,IACF;AACA,UAAM,OAAiB,CAAC,OAAO,QAAQ,IAAI;AAC3C,QAAI,KAAK,KAAK;AACZ,WAAK,KAAK,MAAM,KAAK,GAAG;AAAA,IAC1B;AACA,eAAW,KAAK,KAAK,UAAU,CAAC,GAAG;AACjC,WAAK,KAAK,MAAM,GAAG,EAAE,IAAI,IAAI,EAAE,MAAM,IAAI,EAAE,IAAI,EAAE;AAAA,IACnD;AACA,UAAM,aAAa,OAAO,QAAQ,KAAK,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;AACvF,eAAW,CAAC,GAAG,CAAC,KAAK,YAAY;AAC/B,WAAK,KAAK,MAAM,GAAG,CAAC,IAAI,CAAC,EAAE;AAAA,IAC7B;AACA,SAAK,KAAK,gBAAgB,KAAK,OAAO;AACtC,SAAK,KAAK,KAAK;AACf,SAAK,KAAK,GAAG,KAAK,IAAI;AACtB,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,MAAkC;AACtC,WAAO,MAAM,KAAK,QAAQ,KAAK,UAAU,IAAI,GAAG;AAAA,MAC9C,OAAO,CAAC,QAAQ,QAAQ,MAAM;AAAA,IAChC,CAAC;AAAA,EACH;AACF;","names":[]}
1
+ {"version":3,"sources":["../src/docker-acp.ts"],"sourcesContent":["import { spawn, type ChildProcess } from 'node:child_process'\nimport type { AcpRuntime, AcpSpawnSpec } from '@zooid/core'\n\nexport interface DockerAcpRuntimeOptions {\n /** Default image when the spec doesn't specify one. */\n defaultImage?: string\n /** docker (default) or podman. */\n engine?: 'docker' | 'podman'\n}\n\n/**\n * DockerAcpRuntime spawns the ACP shim inside a container.\n *\n * argv shape: `<engine> run --rm -i [-w cwd] [-v ...] [-e ...] --entrypoint cmd image [args...]`\n *\n * The image comes from the spec (preferred) or the runtime's defaultImage.\n * If neither is set, spawn() throws.\n */\nexport class DockerAcpRuntime implements AcpRuntime {\n private readonly engine: 'docker' | 'podman'\n constructor(private readonly opts: DockerAcpRuntimeOptions = {}) {\n this.engine = opts.engine ?? 'docker'\n }\n\n buildArgv(spec: AcpSpawnSpec): string[] {\n const image = spec.image ?? this.opts.defaultImage\n if (!image) {\n throw new Error(\n 'DockerAcpRuntime: no image set (provide DockerAcpRuntimeOptions.defaultImage or AcpSpawnSpec.image)',\n )\n }\n const argv: string[] = ['run', '--rm', '-i']\n if (spec.cwd) {\n argv.push('-w', spec.cwd)\n }\n for (const m of spec.mounts ?? []) {\n argv.push('-v', `${m.path}:${m.target}:${m.mode}`)\n }\n const envEntries = Object.entries(spec.env ?? {}).sort(([a], [b]) => a.localeCompare(b))\n for (const [k, v] of envEntries) {\n argv.push('-e', `${k}=${v}`)\n }\n argv.push('--entrypoint', spec.command)\n argv.push(image)\n argv.push(...spec.args)\n return argv\n }\n\n spawn(spec: AcpSpawnSpec): ChildProcess {\n return spawn(this.engine, this.buildArgv(spec), {\n stdio: ['pipe', 'pipe', 'pipe'],\n })\n }\n}\n"],"mappings":";AAAA,SAAS,aAAgC;AAkBlC,IAAM,mBAAN,MAA6C;AAAA,EAElD,YAA6B,OAAgC,CAAC,GAAG;AAApC;AAC3B,SAAK,SAAS,KAAK,UAAU;AAAA,EAC/B;AAAA,EAF6B;AAAA,EADZ;AAAA,EAKjB,UAAU,MAA8B;AACtC,UAAM,QAAQ,KAAK,SAAS,KAAK,KAAK;AACtC,QAAI,CAAC,OAAO;AACV,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAAA,IACF;AACA,UAAM,OAAiB,CAAC,OAAO,QAAQ,IAAI;AAC3C,QAAI,KAAK,KAAK;AACZ,WAAK,KAAK,MAAM,KAAK,GAAG;AAAA,IAC1B;AACA,eAAW,KAAK,KAAK,UAAU,CAAC,GAAG;AACjC,WAAK,KAAK,MAAM,GAAG,EAAE,IAAI,IAAI,EAAE,MAAM,IAAI,EAAE,IAAI,EAAE;AAAA,IACnD;AACA,UAAM,aAAa,OAAO,QAAQ,KAAK,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;AACvF,eAAW,CAAC,GAAG,CAAC,KAAK,YAAY;AAC/B,WAAK,KAAK,MAAM,GAAG,CAAC,IAAI,CAAC,EAAE;AAAA,IAC7B;AACA,SAAK,KAAK,gBAAgB,KAAK,OAAO;AACtC,SAAK,KAAK,KAAK;AACf,SAAK,KAAK,GAAG,KAAK,IAAI;AACtB,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,MAAkC;AACtC,WAAO,MAAM,KAAK,QAAQ,KAAK,UAAU,IAAI,GAAG;AAAA,MAC9C,OAAO,CAAC,QAAQ,QAAQ,MAAM;AAAA,IAChC,CAAC;AAAA,EACH;AACF;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zooid/runtime-docker",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "Docker runtime for zooid. Spawns the agent CLI inside a container with a workspace mount and an env allowlist.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -25,7 +25,7 @@
25
25
  "node": ">=22"
26
26
  },
27
27
  "dependencies": {
28
- "@zooid/core": "^0.9.0"
28
+ "@zooid/core": "^0.10.0"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/node": "^22.0.0",