diff --git a/.changeset/cyan-ties-create.md b/.changeset/cyan-ties-create.md new file mode 100644 index 0000000..9a656bb --- /dev/null +++ b/.changeset/cyan-ties-create.md @@ -0,0 +1,5 @@ +--- +"@callstack/tracesift": patch +--- + +bundle dynamically imported pi files diff --git a/next.config.ts b/next.config.ts index cea13ce..c547930 100644 --- a/next.config.ts +++ b/next.config.ts @@ -8,6 +8,11 @@ const nextConfig: NextConfig = { // server bundle and load it with native Node resolution. serverExternalPackages: ["@callstack/tracesift", "@earendil-works/pi-coding-agent", "agent-react-devtools"], outputFileTracingIncludes: { + "/api/model/oauth": [ + // pi-ai loads provider OAuth implementations from computed module paths, + // which Next.js output tracing cannot discover statically. + "./node_modules/**/@earendil-works/pi-ai/dist/auth/oauth/**/*.js", + ], "/api/analyze/react": [ "./node_modules/agent-react-devtools/dist/**/*.js", "./node_modules/agent-react-devtools/dist/profile-offline-LICENSE.txt", diff --git a/scripts/package-standalone.mjs b/scripts/package-standalone.mjs index a5a5875..584f867 100644 --- a/scripts/package-standalone.mjs +++ b/scripts/package-standalone.mjs @@ -63,6 +63,8 @@ async function main() { await assertDirectory(join(root, '.next/static')); await assertDirectory(join(root, 'public')); await assertFile(join(source, 'node_modules/@earendil-works/pi-coding-agent/package.json')); + await assertFile(join(source, 'node_modules/@earendil-works/pi-coding-agent/node_modules/@earendil-works/pi-ai/dist/auth/oauth/anthropic.js')); + await assertFile(join(source, 'node_modules/@earendil-works/pi-coding-agent/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openai-codex.js')); await assertFile(join(source, 'node_modules/agent-react-devtools/package.json')); await assertFile(join(source, 'node_modules/agent-react-devtools/dist/profile-offline.js')); await assertFile(join(source, 'node_modules/agent-react-devtools/dist/profile-offline-LICENSE.txt')); @@ -86,6 +88,8 @@ async function main() { 'node_modules/@callstack/tracesift/src/bootstrap.js', 'node_modules/@callstack/tracesift/src/runtime.js', 'node_modules/@earendil-works/pi-coding-agent/package.json', + 'node_modules/@earendil-works/pi-coding-agent/node_modules/@earendil-works/pi-ai/dist/auth/oauth/anthropic.js', + 'node_modules/@earendil-works/pi-coding-agent/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openai-codex.js', 'node_modules/agent-react-devtools/dist/profile-offline.js', ]) await assertFile(join(stage, file)); diff --git a/src/app/page.tsx b/src/app/page.tsx index cb344b2..d2f8797 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -773,9 +773,9 @@ function InspectorApp() { if (next.event?.type === 'auth_url' && next.event.url && oauthPopup.current && !oauthPopupNavigated.current) { oauthPopupNavigated.current = true; oauthPopup.current.location.href = next.event.url; } if (next.status === 'complete' && settings) { setModelStatus(settings); - oauthPopup.current?.close(); setModelSettingsMessage({ tone: 'success', text: 'Subscription connected. Choose a model and save it to use this connection.' }); } + if (next.status !== 'pending') oauthPopup.current?.close(); // Keep the attempt pending until refreshed settings are ready. Changing it // earlier tears down this effect and discards the settings response. setOauthAttempt(next);