diff --git a/bun.lock b/bun.lock index 01060820..f3ca07eb 100644 --- a/bun.lock +++ b/bun.lock @@ -26,7 +26,7 @@ "@earendil-works/pi-durable": "1.0.2", "proper-lockfile": "4.1.2", "typebox": "1.3.34", - "undici": "8.10.2", + "undici": "8.11.2", "web-push": "^3.6.7", }, }, @@ -89,6 +89,7 @@ }, "overrides": { "highlight.js": "11.12.0", + "undici": "8.11.2", }, "packages": { "@anthropic-ai/sdk": ["@anthropic-ai/sdk@0.129.0", "", { "dependencies": { "json-schema-to-ts": "^3.1.1", "standardwebhooks": "^1.0.0" }, "peerDependencies": { "zod": "^3.25.0 || ^4.0.0" }, "optionalPeers": ["zod"], "bin": { "anthropic-ai-sdk": "bin/cli" } }, "sha512-MH7LB20kNpGLUpPTe2OG5XvL/KhX8HUO9XyBaFjgFk6TLS4Xjt0VPIuMKywe7POKKPslX+QxSlVok9e+8kG5Nw=="], @@ -919,7 +920,7 @@ "typescript": ["typescript@7.0.2", "", { "optionalDependencies": { "@typescript/typescript-aix-ppc64": "7.0.2", "@typescript/typescript-darwin-arm64": "7.0.2", "@typescript/typescript-darwin-x64": "7.0.2", "@typescript/typescript-freebsd-arm64": "7.0.2", "@typescript/typescript-freebsd-x64": "7.0.2", "@typescript/typescript-linux-arm": "7.0.2", "@typescript/typescript-linux-arm64": "7.0.2", "@typescript/typescript-linux-loong64": "7.0.2", "@typescript/typescript-linux-mips64el": "7.0.2", "@typescript/typescript-linux-ppc64": "7.0.2", "@typescript/typescript-linux-riscv64": "7.0.2", "@typescript/typescript-linux-s390x": "7.0.2", "@typescript/typescript-linux-x64": "7.0.2", "@typescript/typescript-netbsd-arm64": "7.0.2", "@typescript/typescript-netbsd-x64": "7.0.2", "@typescript/typescript-openbsd-arm64": "7.0.2", "@typescript/typescript-openbsd-x64": "7.0.2", "@typescript/typescript-sunos-x64": "7.0.2", "@typescript/typescript-win32-arm64": "7.0.2", "@typescript/typescript-win32-x64": "7.0.2" }, "bin": { "tsc": "bin/tsc" } }, "sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA=="], - "undici": ["undici@8.10.2", "", {}, "sha512-/y4/bH9YNU5hi9NIrpOuvGXFcxrj3CMrV+/AYpowAYTpHn8gX/XPFjNy766FPoYY0miQhdW977JFWKGNhBdwyQ=="], + "undici": ["undici@8.11.2", "", {}, "sha512-u4UB2/IrKdU6lFxumHmmo1a3fCQO5tzQllRorfoRS63txhrB7xTpSn1PftwC4qEHkOaqP95fCWW4lJzwErwzhQ=="], "undici-types": ["undici-types@8.11.2", "", {}, "sha512-iMVNmWZ0leK/goS6eXMizSzmm9CDWtyphwbaCms3DNLqRxDL+mMoNVcZMTyyVgXP0N+Z8neAMzDoUOUJL8veKg=="], @@ -1011,8 +1012,6 @@ "gaxios/https-proxy-agent": ["https-proxy-agent@7.0.6", "", { "dependencies": { "agent-base": "^7.1.2", "debug": "4" } }, "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw=="], - "jsdom/undici": ["undici@8.11.2", "", {}, "sha512-u4UB2/IrKdU6lFxumHmmo1a3fCQO5tzQllRorfoRS63txhrB7xTpSn1PftwC4qEHkOaqP95fCWW4lJzwErwzhQ=="], - "jsdom/whatwg-mimetype": ["whatwg-mimetype@5.0.0", "", {}, "sha512-sXcNcHOC51uPGF0P/D4NVtrkjSU2fNsm9iog4ZvZJsL3rjoDAzXZhkm2MWt1y+PUdggKAYVoMAIYcs78wJ51Cw=="], "p-retry/retry": ["retry@0.13.1", "", {}, "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg=="], diff --git a/package.json b/package.json index 593e3220..7bd5cf67 100644 --- a/package.json +++ b/package.json @@ -77,6 +77,7 @@ "typescript": "^7.0.2" }, "overrides": { - "highlight.js": "11.12.0" + "highlight.js": "11.12.0", + "undici": "8.11.2" } } diff --git a/scripts/standalone.test.ts b/scripts/standalone.test.ts index b302dfae..7be6c010 100644 --- a/scripts/standalone.test.ts +++ b/scripts/standalone.test.ts @@ -4,6 +4,7 @@ import { tmpdir } from "node:os"; import { basename, join } from "node:path"; import { fileURLToPath } from "node:url"; import serverPackage from "../server/package.json"; +import rootPackage from "../package.json"; async function run(argv: string[], cwd: string, env = process.env) { const child = Bun.spawn(argv, { @@ -211,6 +212,10 @@ test( 45_000, ); +test("standalone OAuth keeps the SDK undici override aligned with the server", () => { + expect(rootPackage.overrides.undici).toBe(serverPackage.dependencies.undici); +}); + test("standalone Ranger emits Kimi device codes and saves OAuth credentials in either store", async () => { const dir = await mkdtemp(join(tmpdir(), "roamgate-oauth-")); const entry = join(dir, "oauth.ts"); diff --git a/server/package.json b/server/package.json index 89c20d64..89d14c96 100644 --- a/server/package.json +++ b/server/package.json @@ -35,7 +35,7 @@ "@earendil-works/pi-durable": "1.0.2", "proper-lockfile": "4.1.2", "typebox": "1.3.34", - "undici": "8.10.2", + "undici": "8.11.2", "web-push": "^3.6.7" } } diff --git a/server/src/assistant/pi-driver.ts b/server/src/assistant/pi-driver.ts index c0fca9aa..86780c40 100644 --- a/server/src/assistant/pi-driver.ts +++ b/server/src/assistant/pi-driver.ts @@ -221,7 +221,8 @@ export function createPiDriver( directory: string, loadSdk = async () => { // Embed Pi's otherwise opaque OAuth imports for standalone executables. - // Keep undici aligned with the SDK so Bun resolves one pi-ai peer context. + // The root undici override keeps SDK and server on one pi-ai peer context. + // Split contexts leave the SDK OAuth loaders unregistered in Bun bundles. const { registerBunOAuthFlows } = await import( "@earendil-works/pi-ai/bun-oauth" );