@agent-vm/worker-gateway 0.0.70 → 0.0.72

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/worker-lifecycle.ts"],"mappings":";;;cAaa,eAAA,EAAiB,gBAAA"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/worker-lifecycle.ts"],"mappings":";;;cAca,eAAA,EAAiB,gBAAA"}
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { buildGatewaySessionLabel, controllerVmHost, gatewayVmAllowedHosts, splitResolvedGatewaySecrets } from "@agent-vm/gateway-interface";
1
+ import { buildGatewaySessionLabel, composeNodeOptions, controllerVmHost, gatewayVmAllowedHosts, splitResolvedGatewaySecrets } from "@agent-vm/gateway-interface";
2
2
  //#region src/worker-lifecycle.ts
3
3
  const workerLifecycle = {
4
4
  buildVmSpec({ controllerPort, projectNamespace, resolvedSecrets, zone }) {
@@ -22,7 +22,8 @@ const workerLifecycle = {
22
22
  pnpm_config_store_dir: "/work/cache/pnpm/store",
23
23
  PIP_CACHE_DIR: "/work/cache/pip",
24
24
  UV_CACHE_DIR: "/work/cache/uv",
25
- ...environmentSecrets
25
+ ...environmentSecrets,
26
+ NODE_OPTIONS: composeNodeOptions(environmentSecrets.NODE_OPTIONS)
26
27
  },
27
28
  mediatedSecrets,
28
29
  rootfsMode: "cow",
@@ -37,7 +38,7 @@ const workerLifecycle = {
37
38
  buildProcessSpec() {
38
39
  return {
39
40
  bootstrapCommand: "mkdir -p /work/repos /work/tmp /work/cache/npm /work/cache/pnpm/store /work/cache/pip /work/cache/uv && if [ -f /state/agent-vm-worker.tgz ]; then npm install -g --force @openai/codex /state/agent-vm-worker.tgz; fi",
40
- startCommand: "cd /work && nohup agent-vm-worker serve --port 18789 --config /state/effective-worker.json --state-dir /state > /tmp/agent-vm-worker.log 2>&1 &",
41
+ startCommand: `{ printf 'worker-boot: NODE_OPTIONS=%s\\n' "$NODE_OPTIONS" > /tmp/agent-vm-worker.log; } && cd /work && nohup agent-vm-worker serve --port 18789 --config /state/effective-worker.json --state-dir /state >> /tmp/agent-vm-worker.log 2>&1 &`,
41
42
  healthCheck: {
42
43
  type: "http",
43
44
  port: 18789,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/worker-lifecycle.ts"],"sourcesContent":["import type {\n\tBuildGatewayVmSpecOptions,\n\tGatewayLifecycle,\n\tGatewayProcessSpec,\n\tGatewayVmSpec,\n} from '@agent-vm/gateway-interface';\nimport {\n\tbuildGatewaySessionLabel,\n\tcontrollerVmHost,\n\tgatewayVmAllowedHosts,\n\tsplitResolvedGatewaySecrets,\n} from '@agent-vm/gateway-interface';\n\nexport const workerLifecycle: GatewayLifecycle = {\n\tbuildVmSpec({\n\t\tcontrollerPort,\n\t\tprojectNamespace,\n\t\tresolvedSecrets,\n\t\tzone,\n\t}: BuildGatewayVmSpecOptions): GatewayVmSpec {\n\t\tif (zone.gateway.type !== 'worker') {\n\t\t\tthrow new Error(`Worker lifecycle cannot build gateway type '${zone.gateway.type}'.`);\n\t\t}\n\t\tconst { environmentSecrets, mediatedSecrets } = splitResolvedGatewaySecrets(\n\t\t\tzone,\n\t\t\tresolvedSecrets,\n\t\t);\n\n\t\treturn {\n\t\t\tallowedHosts: gatewayVmAllowedHosts(zone.egressHosts),\n\t\t\tenvironment: {\n\t\t\t\tHOME: '/home/coder',\n\t\t\t\tCONTROLLER_BASE_URL: 'http://controller.vm.host:18800',\n\t\t\t\tNODE_EXTRA_CA_CERTS: '/run/gondolin/ca-certificates.crt',\n\t\t\t\tAGENT_VM_ZONE_ID: zone.id,\n\t\t\t\tSTATE_DIR: '/state',\n\t\t\t\tWORKER_CONFIG_PATH: '/state/effective-worker.json',\n\t\t\t\tWORK_DIR: '/work',\n\t\t\t\tREPOS_DIR: '/work/repos',\n\t\t\t\tTMPDIR: '/work/tmp',\n\t\t\t\tTMP: '/work/tmp',\n\t\t\t\tTEMP: '/work/tmp',\n\t\t\t\tnpm_config_cache: '/work/cache/npm',\n\t\t\t\tpnpm_config_store_dir: '/work/cache/pnpm/store',\n\t\t\t\tPIP_CACHE_DIR: '/work/cache/pip',\n\t\t\t\tUV_CACHE_DIR: '/work/cache/uv',\n\t\t\t\t...environmentSecrets,\n\t\t\t},\n\t\t\tmediatedSecrets,\n\t\t\trootfsMode: 'cow',\n\t\t\tsessionLabel: buildGatewaySessionLabel(projectNamespace, zone.id),\n\t\t\ttcpHosts: {\n\t\t\t\t[`${controllerVmHost}:18800`]: `127.0.0.1:${controllerPort}`,\n\t\t\t},\n\t\t\tvfsMounts: {\n\t\t\t\t'/state': {\n\t\t\t\t\thostPath: zone.gateway.stateDir,\n\t\t\t\t\tkind: 'realfs',\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t},\n\n\tbuildProcessSpec(): GatewayProcessSpec {\n\t\treturn {\n\t\t\tbootstrapCommand:\n\t\t\t\t'mkdir -p /work/repos /work/tmp /work/cache/npm /work/cache/pnpm/store /work/cache/pip /work/cache/uv && if [ -f /state/agent-vm-worker.tgz ]; then npm install -g --force @openai/codex /state/agent-vm-worker.tgz; fi',\n\t\t\tstartCommand:\n\t\t\t\t'cd /work && nohup agent-vm-worker serve --port 18789 --config /state/effective-worker.json --state-dir /state > /tmp/agent-vm-worker.log 2>&1 &',\n\t\t\thealthCheck: { type: 'http', port: 18789, path: '/health' },\n\t\t\tguestListenPort: 18789,\n\t\t\tlogPath: '/tmp/agent-vm-worker.log',\n\t\t};\n\t},\n};\n"],"mappings":";;AAaA,MAAa,kBAAoC;CAChD,YAAY,EACX,gBACA,kBACA,iBACA,QAC4C;EAC5C,IAAI,KAAK,QAAQ,SAAS,UACzB,MAAM,IAAI,MAAM,+CAA+C,KAAK,QAAQ,KAAK,IAAI;EAEtF,MAAM,EAAE,oBAAoB,oBAAoB,4BAC/C,MACA,gBACA;EAED,OAAO;GACN,cAAc,sBAAsB,KAAK,YAAY;GACrD,aAAa;IACZ,MAAM;IACN,qBAAqB;IACrB,qBAAqB;IACrB,kBAAkB,KAAK;IACvB,WAAW;IACX,oBAAoB;IACpB,UAAU;IACV,WAAW;IACX,QAAQ;IACR,KAAK;IACL,MAAM;IACN,kBAAkB;IAClB,uBAAuB;IACvB,eAAe;IACf,cAAc;IACd,GAAG;IACH;GACD;GACA,YAAY;GACZ,cAAc,yBAAyB,kBAAkB,KAAK,GAAG;GACjE,UAAU,GACR,GAAG,iBAAiB,UAAU,aAAa,kBAC5C;GACD,WAAW,EACV,UAAU;IACT,UAAU,KAAK,QAAQ;IACvB,MAAM;IACN,EACD;GACD;;CAGF,mBAAuC;EACtC,OAAO;GACN,kBACC;GACD,cACC;GACD,aAAa;IAAE,MAAM;IAAQ,MAAM;IAAO,MAAM;IAAW;GAC3D,iBAAiB;GACjB,SAAS;GACT;;CAEF"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/worker-lifecycle.ts"],"sourcesContent":["import type {\n\tBuildGatewayVmSpecOptions,\n\tGatewayLifecycle,\n\tGatewayProcessSpec,\n\tGatewayVmSpec,\n} from '@agent-vm/gateway-interface';\nimport {\n\tbuildGatewaySessionLabel,\n\tcomposeNodeOptions,\n\tcontrollerVmHost,\n\tgatewayVmAllowedHosts,\n\tsplitResolvedGatewaySecrets,\n} from '@agent-vm/gateway-interface';\n\nexport const workerLifecycle: GatewayLifecycle = {\n\tbuildVmSpec({\n\t\tcontrollerPort,\n\t\tprojectNamespace,\n\t\tresolvedSecrets,\n\t\tzone,\n\t}: BuildGatewayVmSpecOptions): GatewayVmSpec {\n\t\tif (zone.gateway.type !== 'worker') {\n\t\t\tthrow new Error(`Worker lifecycle cannot build gateway type '${zone.gateway.type}'.`);\n\t\t}\n\t\tconst { environmentSecrets, mediatedSecrets } = splitResolvedGatewaySecrets(\n\t\t\tzone,\n\t\t\tresolvedSecrets,\n\t\t);\n\n\t\treturn {\n\t\t\tallowedHosts: gatewayVmAllowedHosts(zone.egressHosts),\n\t\t\tenvironment: {\n\t\t\t\tHOME: '/home/coder',\n\t\t\t\tCONTROLLER_BASE_URL: 'http://controller.vm.host:18800',\n\t\t\t\tNODE_EXTRA_CA_CERTS: '/run/gondolin/ca-certificates.crt',\n\t\t\t\tAGENT_VM_ZONE_ID: zone.id,\n\t\t\t\tSTATE_DIR: '/state',\n\t\t\t\tWORKER_CONFIG_PATH: '/state/effective-worker.json',\n\t\t\t\tWORK_DIR: '/work',\n\t\t\t\tREPOS_DIR: '/work/repos',\n\t\t\t\tTMPDIR: '/work/tmp',\n\t\t\t\tTMP: '/work/tmp',\n\t\t\t\tTEMP: '/work/tmp',\n\t\t\t\tnpm_config_cache: '/work/cache/npm',\n\t\t\t\tpnpm_config_store_dir: '/work/cache/pnpm/store',\n\t\t\t\tPIP_CACHE_DIR: '/work/cache/pip',\n\t\t\t\tUV_CACHE_DIR: '/work/cache/uv',\n\t\t\t\t...environmentSecrets,\n\t\t\t\t// NODE_OPTIONS goes AFTER the spread so a user-supplied\n\t\t\t\t// NODE_OPTIONS in environmentSecrets cannot drop the\n\t\t\t\t// forced IPv4-preference flags. composeNodeOptions\n\t\t\t\t// preserves the user value as additional flags.\n\t\t\t\tNODE_OPTIONS: composeNodeOptions(environmentSecrets.NODE_OPTIONS),\n\t\t\t},\n\t\t\tmediatedSecrets,\n\t\t\trootfsMode: 'cow',\n\t\t\tsessionLabel: buildGatewaySessionLabel(projectNamespace, zone.id),\n\t\t\ttcpHosts: {\n\t\t\t\t[`${controllerVmHost}:18800`]: `127.0.0.1:${controllerPort}`,\n\t\t\t},\n\t\t\tvfsMounts: {\n\t\t\t\t'/state': {\n\t\t\t\t\thostPath: zone.gateway.stateDir,\n\t\t\t\t\tkind: 'realfs',\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t},\n\n\tbuildProcessSpec(): GatewayProcessSpec {\n\t\treturn {\n\t\t\tbootstrapCommand:\n\t\t\t\t'mkdir -p /work/repos /work/tmp /work/cache/npm /work/cache/pnpm/store /work/cache/pip /work/cache/uv && if [ -f /state/agent-vm-worker.tgz ]; then npm install -g --force @openai/codex /state/agent-vm-worker.tgz; fi',\n\t\t\t// printf NODE_OPTIONS into the boot log so an env-loss regression\n\t\t\t// is visible in the log stream without SSHing into the VM.\n\t\t\t// See FORCE_IPV4_EGRESS_NODE_OPTIONS in @agent-vm/gateway-interface.\n\t\t\tstartCommand: `{ printf 'worker-boot: NODE_OPTIONS=%s\\\\n' \"$NODE_OPTIONS\" > /tmp/agent-vm-worker.log; } && cd /work && nohup agent-vm-worker serve --port 18789 --config /state/effective-worker.json --state-dir /state >> /tmp/agent-vm-worker.log 2>&1 &`,\n\t\t\thealthCheck: { type: 'http', port: 18789, path: '/health' },\n\t\t\tguestListenPort: 18789,\n\t\t\tlogPath: '/tmp/agent-vm-worker.log',\n\t\t};\n\t},\n};\n"],"mappings":";;AAcA,MAAa,kBAAoC;CAChD,YAAY,EACX,gBACA,kBACA,iBACA,QAC4C;EAC5C,IAAI,KAAK,QAAQ,SAAS,UACzB,MAAM,IAAI,MAAM,+CAA+C,KAAK,QAAQ,KAAK,IAAI;EAEtF,MAAM,EAAE,oBAAoB,oBAAoB,4BAC/C,MACA,gBACA;EAED,OAAO;GACN,cAAc,sBAAsB,KAAK,YAAY;GACrD,aAAa;IACZ,MAAM;IACN,qBAAqB;IACrB,qBAAqB;IACrB,kBAAkB,KAAK;IACvB,WAAW;IACX,oBAAoB;IACpB,UAAU;IACV,WAAW;IACX,QAAQ;IACR,KAAK;IACL,MAAM;IACN,kBAAkB;IAClB,uBAAuB;IACvB,eAAe;IACf,cAAc;IACd,GAAG;IAKH,cAAc,mBAAmB,mBAAmB,aAAa;IACjE;GACD;GACA,YAAY;GACZ,cAAc,yBAAyB,kBAAkB,KAAK,GAAG;GACjE,UAAU,GACR,GAAG,iBAAiB,UAAU,aAAa,kBAC5C;GACD,WAAW,EACV,UAAU;IACT,UAAU,KAAK,QAAQ;IACvB,MAAM;IACN,EACD;GACD;;CAGF,mBAAuC;EACtC,OAAO;GACN,kBACC;GAID,cAAc;GACd,aAAa;IAAE,MAAM;IAAQ,MAAM;IAAO,MAAM;IAAW;GAC3D,iBAAiB;GACjB,SAAS;GACT;;CAEF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-vm/worker-gateway",
3
- "version": "0.0.70",
3
+ "version": "0.0.72",
4
4
  "description": "Worker gateway lifecycle: boots a Gondolin VM and drives @agent-vm/agent-vm-worker for autonomous coding tasks.",
5
5
  "homepage": "https://github.com/ShravanSunder/agent-vm#readme",
6
6
  "bugs": {
@@ -29,8 +29,8 @@
29
29
  "access": "public"
30
30
  },
31
31
  "dependencies": {
32
- "@agent-vm/gateway-interface": "0.0.70",
33
- "@agent-vm/gondolin-adapter": "0.0.70"
32
+ "@agent-vm/gondolin-adapter": "0.0.72",
33
+ "@agent-vm/gateway-interface": "0.0.72"
34
34
  },
35
35
  "scripts": {
36
36
  "build": "tsdown",