From 05df147007601c404686bf84546493376b9d6ed9 Mon Sep 17 00:00:00 2001 From: Mayakovsky Date: Tue, 21 Jul 2026 20:59:38 -0400 Subject: [PATCH] fix(m6-phase-d): run acp-adapter under `node --import tsx` (FDQ-70) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The @virtuals-protocol/acp-node-v2 SDK is ESM with extensionless relative imports (bun-authored: dist/index.js does `export * from "./acpAgent"`). bun tolerates these; strict Node ESM rejects them ("Cannot find module .../dist/acpAgent"). The adapter, designed as a standalone `node` process, therefore could not load the SDK. The tsx loader resolves extensionless ESM, so the unit runs under `node --import tsx`. - infra/systemd/grey-acp-adapter.service: ExecStart → `/usr/bin/node --import tsx …`. - adapters/acp-adapter/package.json: tsx devDependency → dependency (runtime requirement). Validated live in the Phase D cutover window (job #70220 accepted → delivered → completed under this runtime). Build isolation intact: typecheck + build green, tier-1 offline smoke green (SDK still out of the tsc type graph via the variable-specifier dynamic import). NOTE: the running box already carries this ExecStart (window fix). Once merged, the committed unit matches the box — until then, do not re-copy the old unit over it. Co-Authored-By: Claude Opus 4.8 --- adapters/acp-adapter/package.json | 4 +--- infra/systemd/grey-acp-adapter.service | 5 ++++- pnpm-lock.yaml | 7 +++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/adapters/acp-adapter/package.json b/adapters/acp-adapter/package.json index 9b4d1bb..6cdf8c9 100644 --- a/adapters/acp-adapter/package.json +++ b/adapters/acp-adapter/package.json @@ -18,9 +18,7 @@ "@grey/pipeline": "workspace:*", "@grey/x402-middleware": "workspace:*", "@virtuals-protocol/acp-node-v2": "^0.0.4", + "tsx": "^4.22.4", "viem": "^2.53.1" - }, - "devDependencies": { - "tsx": "^4.22.4" } } diff --git a/infra/systemd/grey-acp-adapter.service b/infra/systemd/grey-acp-adapter.service index 6353a0e..fc98c40 100644 --- a/infra/systemd/grey-acp-adapter.service +++ b/infra/systemd/grey-acp-adapter.service @@ -12,7 +12,10 @@ Wants=network-online.target Type=simple User=grey WorkingDirectory=/opt/grey/grey -ExecStart=/usr/bin/node adapters/acp-adapter/dist/main.js +# FDQ-70: the @virtuals-protocol/acp-node-v2 SDK ships ESM with EXTENSIONLESS relative +# imports (bun-authored; bun tolerates them, strict Node ESM does not). The tsx loader +# resolves them, so the adapter runs under `node --import tsx`. tsx is a runtime dependency. +ExecStart=/usr/bin/node --import tsx adapters/acp-adapter/dist/main.js EnvironmentFile=/etc/grey/acp-adapter.env Restart=on-failure RestartSec=5 diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2c8dcf4..bf1a085 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -59,13 +59,12 @@ importers: '@virtuals-protocol/acp-node-v2': specifier: ^0.0.4 version: 0.0.4(@solana/web3.js@1.98.4(bufferutil@4.1.0)(typescript@5.9.3)(utf-8-validate@6.0.6))(bufferutil@4.1.0)(typescript@5.9.3)(utf-8-validate@6.0.6)(zod@4.4.3) - viem: - specifier: ^2.53.1 - version: 2.53.1(bufferutil@4.1.0)(typescript@5.9.3)(utf-8-validate@6.0.6)(zod@4.4.3) - devDependencies: tsx: specifier: ^4.22.4 version: 4.22.4 + viem: + specifier: ^2.53.1 + version: 2.53.1(bufferutil@4.1.0)(typescript@5.9.3)(utf-8-validate@6.0.6)(zod@4.4.3) adapters/x402-middleware: dependencies: