mirror of
https://github.com/CopilotKit/CopilotKit.git
synced 2026-09-14 16:26:20 +08:00
2983bbc69d
claude-sdk-python was the last integration still on the legacy auth-first shape: an authenticated-on-load page guarded by a class-based `ChatErrorBoundary`, a `useDemoAuth` exposing `authenticate`/`authenticated`, an `auth-banner` with an `onAuthenticate` prop and bespoke buttons, and NO `sign-in-card`. The byte-identical `auth.spec.ts` (which asserts an unauthenticated-first `SignInCard` with `auth-sign-in-button` / `auth-demo-token`) therefore failed all six cases against it. Port the four auth files verbatim from the langgraph-python gold standard (adapting nothing — the per-integration wiring, `agent="auth-demo"` and `runtimeUrl="/api/copilotkit-auth"`, was already identical): - use-demo-auth.ts: unauth-first, localStorage-backed, exposes `isAuthenticated`/`hasEverSignedIn`/`signIn`/`signOut`. - page.tsx: render `SignInCard` until first sign-in, then keep `<CopilotKit>` mounted across the sign-out cycle; shared `handleAuthError` on BOTH the provider and agent-scoped `<CopilotChat onError>`; clear-on-auth effect; amber `auth-demo-error` surface. - auth-banner.tsx: shared `<Button>`, `onSignIn`/`onSignOut` props. - sign-in-card.tsx: new, ported from the gold standard. Add the shared shadcn primitives the gold-standard frontend depends on and which claude-sdk-python was missing (`src/lib/utils.ts`, `src/components/ui/button.tsx`, `src/components/ui/card.tsx`) plus the `radix-ui` dependency they require, matching the claude-sdk-typescript peer. Red/green on the real surfaces: against the legacy frontend `auth.spec.ts` fails 6/6 (every test times out waiting for `auth-sign-in-button`); against the rebuilt frontend it passes 6/6 and the `--d5 --isolate` auth probe is green.
47 lines
1.3 KiB
JSON
47 lines
1.3 KiB
JSON
{
|
|
"name": "@copilotkit/showcase-claude-sdk-python",
|
|
"version": "0.1.0",
|
|
"private": true,
|
|
"scripts": {
|
|
"dev": "concurrently \"next dev --turbopack\" \"PYTHONPATH=. python -m uvicorn agent_server:app --host 0.0.0.0 --port 8000 --reload\"",
|
|
"build": "next build",
|
|
"start": "next start",
|
|
"lint": "next lint",
|
|
"test:e2e": "playwright test"
|
|
},
|
|
"dependencies": {
|
|
"@ag-ui/client": "0.0.57",
|
|
"@ag-ui/core": "0.0.57",
|
|
"@copilotkit/a2ui-renderer": "1.61.2",
|
|
"@copilotkit/react-core": "1.61.2",
|
|
"@copilotkit/runtime": "1.61.2",
|
|
"@copilotkit/shared": "1.61.2",
|
|
"@copilotkit/voice": "1.61.2",
|
|
"@hashbrownai/core": "0.5.0-beta.4",
|
|
"@hashbrownai/react": "0.5.0-beta.4",
|
|
"@json-render/core": "0.18.0",
|
|
"@json-render/react": "0.18.0",
|
|
"class-variance-authority": "^0.7.1",
|
|
"clsx": "^2.1.1",
|
|
"lucide-react": "^1.14.0",
|
|
"next": "^15.5.15",
|
|
"openai": "^5.9.0",
|
|
"radix-ui": "^1.4.3",
|
|
"react": "^19.0.0",
|
|
"react-dom": "^19.0.0",
|
|
"recharts": "^2.15.0",
|
|
"tailwind-merge": "^3.5.0",
|
|
"zod": "^4.0.0"
|
|
},
|
|
"devDependencies": {
|
|
"@playwright/test": "^1.50.0",
|
|
"@tailwindcss/postcss": "^4.0.0",
|
|
"@types/node": "^22.0.0",
|
|
"@types/react": "^19.0.0",
|
|
"concurrently": "^9.1.0",
|
|
"postcss": "^8.5.0",
|
|
"tailwindcss": "^4.0.0",
|
|
"typescript": "^5.7.0"
|
|
}
|
|
}
|