|
| 1 | +import assert from "node:assert/strict"; |
| 2 | +import { it } from "node:test"; |
| 3 | +import { |
| 4 | + assertSenpiPackedWorkspaceFiles, |
| 5 | + nativePrebuildFile, |
| 6 | + nativePrebuildTarget, |
| 7 | +} from "./prepare-senpi-bundled-workspaces.mjs"; |
| 8 | + |
| 9 | +it("accepts consumer-resolved platform optionals outside the packed bundle", () => { |
| 10 | + // Given: the portable SDK is bundled, while npm must install the target-native |
| 11 | + // optional package on the consumer machine. |
| 12 | + const hostPrebuild = nativePrebuildFile(nativePrebuildTarget()); |
| 13 | + const packed = { |
| 14 | + files: [ |
| 15 | + { path: "package/dist/cli.js" }, |
| 16 | + { path: "package/node_modules/@earendil-works/pi-agent-core/package.json" }, |
| 17 | + { path: "package/node_modules/@earendil-works/pi-agent-core/dist/index.js" }, |
| 18 | + { path: "package/node_modules/@earendil-works/pi-ai/package.json" }, |
| 19 | + { path: "package/node_modules/@earendil-works/pi-ai/dist/index.js" }, |
| 20 | + { path: "package/node_modules/@earendil-works/pi-pty/package.json" }, |
| 21 | + { path: "package/node_modules/@earendil-works/pi-pty/dist/index.js" }, |
| 22 | + { path: "package/node_modules/@earendil-works/pi-pty/native/index.js" }, |
| 23 | + { path: `package/node_modules/@earendil-works/pi-pty/${hostPrebuild}` }, |
| 24 | + { path: "package/node_modules/@earendil-works/pi-tui/package.json" }, |
| 25 | + { path: "package/node_modules/@earendil-works/pi-tui/dist/index.js" }, |
| 26 | + { path: "package/node_modules/@code-yeongyu/senpi-codemode/package.json" }, |
| 27 | + { path: "package/node_modules/@code-yeongyu/senpi-codemode/src/index.ts" }, |
| 28 | + { path: "package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/py/prelude.py" }, |
| 29 | + { path: "package/node_modules/@anthropic-ai/claude-agent-sdk/package.json" }, |
| 30 | + ], |
| 31 | + }; |
| 32 | + |
| 33 | + // When / Then |
| 34 | + assert.doesNotThrow(() => |
| 35 | + assertSenpiPackedWorkspaceFiles(packed, { |
| 36 | + runtimeDependencies: [ |
| 37 | + "@anthropic-ai/claude-agent-sdk", |
| 38 | + "@anthropic-ai/claude-agent-sdk-darwin-arm64", |
| 39 | + ], |
| 40 | + bundledDependencies: ["@anthropic-ai/claude-agent-sdk"], |
| 41 | + }), |
| 42 | + ); |
| 43 | +}); |
0 commit comments