diff --git a/packages/agent-runtime/index.d.ts b/packages/agent-runtime/index.d.ts new file mode 100644 index 0000000..0000b12 --- /dev/null +++ b/packages/agent-runtime/index.d.ts @@ -0,0 +1 @@ +export declare const AGENT_RUNTIME_PACKAGE = "agent-runtime"; diff --git a/packages/agent-runtime/index.js b/packages/agent-runtime/index.js new file mode 100644 index 0000000..2da7fd4 --- /dev/null +++ b/packages/agent-runtime/index.js @@ -0,0 +1 @@ +export const AGENT_RUNTIME_PACKAGE = "agent-runtime"; diff --git a/packages/agent-runtime/package.json b/packages/agent-runtime/package.json index 849a4e3..ae3fd7a 100644 --- a/packages/agent-runtime/package.json +++ b/packages/agent-runtime/package.json @@ -4,6 +4,9 @@ "private": true, "type": "module", "exports": { - ".": "./src/index.ts" + ".": { + "types": "./index.d.ts", + "default": "./index.js" + } } } diff --git a/packages/shared/src/smoke.test.ts b/packages/shared/src/smoke.test.ts index 28cbc53..f198d25 100644 --- a/packages/shared/src/smoke.test.ts +++ b/packages/shared/src/smoke.test.ts @@ -1,8 +1,28 @@ +import { execFile } from "node:child_process"; +import { promisify } from "node:util"; import { describe, expect, it } from "vitest"; import { AGENT_RUNTIME_PACKAGE } from "@aiquant/agent-runtime"; +const execFileAsync = promisify(execFile); + describe("workspace smoke test", () => { it("resolves cross-workspace package exports", () => { expect(AGENT_RUNTIME_PACKAGE).toBe("agent-runtime"); }); + + it("allows plain node to import the workspace package", async () => { + const { stdout } = await execFileAsync( + process.execPath, + [ + "--input-type=module", + "--eval", + "import('@aiquant/agent-runtime').then((mod) => console.log(mod.AGENT_RUNTIME_PACKAGE));", + ], + { + cwd: new URL("..", import.meta.url), + }, + ); + + expect(stdout.trim()).toBe("agent-runtime"); + }); });