Fix fleet serve JS node loading in standalone CLI

Merged
KH
4mo ago
+339-14

Summary

  • load JavaScript fleet node definition files with native dynamic import instead of constructing jiti
  • lazy-load jiti only for TypeScript-like node definition files
  • validate loaded fleet node definitions with the local marker check so the Bun-compiled CLI avoids another runtime SDK import failure
  • add regression coverage and changelog entry

Closes #1169.

Validation

  • npx vitest run packages/cli/src/cli/commands/fleet.test.ts
  • npm run build:sdk
  • npm --prefix packages/cli run build
  • npm --prefix packages/cli run lint (passes with existing warnings)
  • bun build --compile --minify --target=bun-darwin-arm64 --external=better-sqlite3 --external=cpu-features --external=node-pty --define=process.env.AGENT_RELAY_VERSION="8.9.0-test" ./packages/cli/dist/cli/index.js --outfile /tmp/agent-relay-fleet-1169
  • /tmp/agent-relay-fleet-1169 fleet serve --enrollment-url https://agentrelay.com/api/v1/fleet/register -> expected: --enrollment-url requires --enrollment-token.