mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-13 21:01:21 +08:00
This PR implements unified AI endpoint and custom dashboards. **Unified AI Endpoint** We now use a single endpoint throughout the codebase that makes the call to openrouter. Specifically, email drafts, email templates, email themes, wysiwyg, cmd centre ai search and docs ai, all use this unified ai endpoint. All the tools are defined in the backend, all the prompts exist in the backend. How to review this PR for unified ai endpoint: This PR will be easier to review if we look at the different folders that were affected. under packages - We added streaming functionality, and made renaming changes under docs - there are three files that have changed package.json - we updated the package (we were previously using a very old version of the package) route.ts - we changed the call from a direct call to openrouter to the unified ai endpoint ai-chat.tsx - because of updating the package, we had to make changes to adapt to the latest versions of the package under backend route.ts - the main unified ai endpoint. this endpoint uses various support files forward.ts - this is the forward to production functionality models.ts - consists of the models, and the rules for selecting those models prompts.ts - consists of the base prompt + specific system prompts depending upon the usage schema.ts every single file under ai/tools folder - which as the name suggests, consists of the implementations of the different tools that can be provided to the llm route-handlers - added support for streaming to SmartRoute and response under dashboard ai-search/route.ts - refactored the file to use unified ai endpoint chat-adapters.ts - refactored the file to use unified ai endpoint and created extra checks for the ai generated code **Custom Dashboards** We let the user write their query in english. We then use AI to create dashboards that are interactive, live and savable. This PR includes a new package called dashboard-ui-components. This package has components that are used in the dashboard and more importantly, these components are being imported from esm in the ai generated code for custom dashboards. We also change the bar at the top for the products pages. How to review this PR: Review the new package (package/dashboard-ui-components), the setup and the files inside it. Review the schema changes in stack-shared/src Review the changes in dashboard. The following changes have been made Updated the design-components folder since we moved the dashboard components to the new package Updated imports for these components accordingly Updated the title bar of the product pages Created the files for custom dashboards under the dashboards folder and components under commands/create-dashboard Created a script under dashboard/scripts that generates the file with type definitions that would go to the llm Review the backend Started using unified ai endpoint <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added custom dashboards feature allowing users to create and manage personalized dashboards with AI assistance. * Integrated AI-assisted dashboard code generation with visual preview and editing capabilities. * Introduced new AI query endpoints supporting stream and generate modes with configurable model quality/speed settings. * **Improvements** * Reorganized UI components into a dedicated component library package for better code reuse. * Enhanced chat architecture with improved message handling and tool integration. * Updated AI provider integration with improved configuration management. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Konsti Wohlwend <n2d4xc@gmail.com> Co-authored-by: Bilal Godil <bg2002@gmail.com> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
138 lines
6.8 KiB
JSON
138 lines
6.8 KiB
JSON
{
|
|
"name": "@stackframe/backend",
|
|
"version": "2.8.75",
|
|
"repository": "https://github.com/stack-auth/stack-auth",
|
|
"private": true,
|
|
"type": "module",
|
|
"scripts": {
|
|
"clean": "rimraf src/generated && rimraf .next && rimraf node_modules",
|
|
"typecheck": "tsc --noEmit",
|
|
"with-env": "dotenv -c --",
|
|
"with-env:dev": "dotenv -c development --",
|
|
"with-env:prod": "dotenv -c production --",
|
|
"with-env:test": "dotenv -c test --",
|
|
"dev": "concurrently -n \"dev,codegen,prisma-studio,email-queue,cron-jobs\" -k \"next dev --port ${NEXT_PUBLIC_STACK_PORT_PREFIX:-81}02 ${STACK_BACKEND_DEV_EXTRA_ARGS:-}\" \"pnpm run codegen:watch\" \"pnpm run prisma-studio\" \"pnpm run run-email-queue\" \"pnpm run run-cron-jobs\"",
|
|
"dev:inspect": "STACK_BACKEND_DEV_EXTRA_ARGS=\"--inspect\" pnpm run dev",
|
|
"dev:profile": "STACK_BACKEND_DEV_EXTRA_ARGS=\"--experimental-cpu-prof\" pnpm run dev",
|
|
"build": "pnpm run codegen && next build",
|
|
"docker-build": "pnpm run codegen && next build --experimental-build-mode compile",
|
|
"build-self-host-migration-script": "tsdown --config scripts/db-migrations.tsdown.config.ts",
|
|
"analyze-bundle": "next experimental-analyze",
|
|
"start": "next start --port ${NEXT_PUBLIC_STACK_PORT_PREFIX:-81}02",
|
|
"codegen-prisma": "STACK_DATABASE_CONNECTION_STRING=\"${STACK_DATABASE_CONNECTION_STRING:-placeholder-database-connection-string}\" pnpm run prisma generate",
|
|
"codegen-prisma:watch": "STACK_DATABASE_CONNECTION_STRING=\"${STACK_DATABASE_CONNECTION_STRING:-placeholder-database-connection-string}\" pnpm run prisma generate --watch",
|
|
"codegen-route-info": "pnpm run with-env tsx scripts/generate-route-info.ts",
|
|
"codegen-route-info:watch": "pnpm run with-env tsx watch --clear-screen=false scripts/generate-route-info.ts",
|
|
"codegen": "pnpm run with-env pnpm run generate-migration-imports && pnpm run with-env bash -c 'if [ \"$STACK_ACCELERATE_ENABLED\" = \"true\" ]; then pnpm run prisma generate --no-engine; else pnpm run codegen-prisma; fi' && pnpm run codegen-docs && pnpm run codegen-route-info",
|
|
"codegen:watch": "concurrently -n \"prisma,docs,route-info,migration-imports\" -k \"pnpm run codegen-prisma:watch\" \"pnpm run codegen-docs:watch\" \"pnpm run codegen-route-info:watch\" \"pnpm run generate-migration-imports:watch\"",
|
|
"psql-inner": "psql $(echo $STACK_DATABASE_CONNECTION_STRING | sed 's/\\?.*$//')",
|
|
"clickhouse": "pnpm run with-env clickhouse-client --host localhost --port ${NEXT_PUBLIC_STACK_PORT_PREFIX:-81}37 --user stackframe --password PASSWORD-PLACEHOLDER--9gKyMxJeMx",
|
|
"psql": "pnpm run with-env:dev pnpm run psql-inner",
|
|
"prisma-studio": "pnpm run with-env:dev prisma studio --port ${NEXT_PUBLIC_STACK_PORT_PREFIX:-81}06 --browser none",
|
|
"prisma:dev": "pnpm run with-env:dev prisma",
|
|
"prisma": "pnpm run with-env prisma",
|
|
"db:migration-gen": "pnpm run with-env:dev tsx scripts/db-migrations.ts generate-migration-file",
|
|
"db:reset": "pnpm run with-env:dev tsx scripts/db-migrations.ts reset",
|
|
"db:seed": "pnpm run with-env:dev tsx scripts/db-migrations.ts seed",
|
|
"db:init": "pnpm run with-env:dev tsx scripts/db-migrations.ts init",
|
|
"db:migrate": "pnpm run with-env:dev tsx scripts/db-migrations.ts migrate",
|
|
"generate-migration-imports": "pnpm run with-env tsx scripts/generate-migration-imports.ts",
|
|
"generate-migration-imports:watch": "chokidar 'prisma/migrations/**/*.sql' -c 'pnpm run generate-migration-imports'",
|
|
"lint": "eslint .",
|
|
"codegen-docs": "pnpm run with-env tsx scripts/generate-openapi-fumadocs.ts",
|
|
"codegen-docs:watch": "pnpm run with-env tsx watch --exclude '**/node_modules/**' --clear-screen=false scripts/generate-openapi-fumadocs.ts",
|
|
"generate-keys": "pnpm run with-env tsx scripts/generate-keys.ts",
|
|
"db-seed-script": "pnpm run db:seed",
|
|
"run-cron-jobs": "pnpm run with-env:dev tsx scripts/run-cron-jobs.ts",
|
|
"run-cron-jobs:test": "pnpm run with-env:test tsx scripts/run-cron-jobs.ts",
|
|
"verify-data-integrity": "pnpm run with-env:dev tsx scripts/verify-data-integrity/index.ts",
|
|
"run-email-queue": "pnpm run with-env:dev tsx scripts/run-email-queue.ts"
|
|
},
|
|
"prisma": {
|
|
"seed": "pnpm run db-seed-script"
|
|
},
|
|
"dependencies": {
|
|
"@ai-sdk/mcp": "^1.0.21",
|
|
"@ai-sdk/openai": "^3.0.29",
|
|
"@aws-sdk/client-s3": "^3.855.0",
|
|
"@clickhouse/client": "^1.14.0",
|
|
"@node-oauth/oauth2-server": "^5.1.0",
|
|
"@openrouter/ai-sdk-provider": "2.2.3",
|
|
"@opentelemetry/api": "^1.9.0",
|
|
"@opentelemetry/api-logs": "^0.53.0",
|
|
"@opentelemetry/auto-instrumentations-node": "^0.67.3",
|
|
"@opentelemetry/context-async-hooks": "^1.26.0",
|
|
"@opentelemetry/core": "^1.26.0",
|
|
"@opentelemetry/exporter-trace-otlp-http": "^0.53.0",
|
|
"@opentelemetry/instrumentation": "^0.53.0",
|
|
"@opentelemetry/resources": "^1.26.0",
|
|
"@opentelemetry/sdk-logs": "^0.53.0",
|
|
"@opentelemetry/sdk-trace-base": "^1.26.0",
|
|
"@opentelemetry/sdk-trace-node": "^1.26.0",
|
|
"@opentelemetry/semantic-conventions": "^1.27.0",
|
|
"@oslojs/otp": "^1.1.0",
|
|
"@prisma/adapter-neon": "^7.0.0",
|
|
"@prisma/adapter-pg": "^7.0.0",
|
|
"@prisma/client": "^7.0.0",
|
|
"@prisma/extension-read-replicas": "^0.5.0",
|
|
"@prisma/instrumentation": "^7.0.0",
|
|
"@react-email/render": "^1.2.1",
|
|
"@sentry/nextjs": "^10.11.0",
|
|
"@simplewebauthn/server": "^11.0.0",
|
|
"@stackframe/stack": "workspace:*",
|
|
"@stackframe/stack-shared": "workspace:*",
|
|
"@upstash/qstash": "^2.8.2",
|
|
"@vercel/functions": "^2.0.0",
|
|
"@vercel/otel": "^1.10.4",
|
|
"@vercel/sandbox": "^1.2.0",
|
|
"ai": "^6.0.0",
|
|
"bcrypt": "^5.1.1",
|
|
"cel-js": "^0.8.2",
|
|
"chokidar-cli": "^3.0.0",
|
|
"dotenv": "^16.4.5",
|
|
"dotenv-cli": "^7.3.0",
|
|
"freestyle-sandboxes": "^0.1.6",
|
|
"jiti": "^2.6.1",
|
|
"jose": "^6.1.3",
|
|
"json-diff": "^1.0.6",
|
|
"next": "16.1.5",
|
|
"nodemailer": "^6.9.10",
|
|
"oidc-provider": "^8.5.1",
|
|
"openid-client": "5.6.4",
|
|
"pg": "^8.16.3",
|
|
"postgres": "^3.4.5",
|
|
"posthog-node": "^4.1.0",
|
|
"react": "19.2.3",
|
|
"react-dom": "19.2.3",
|
|
"resend": "^6.0.1",
|
|
"semver": "^7.6.3",
|
|
"sharp": "^0.34.4",
|
|
"stripe": "^18.3.0",
|
|
"svix": "^1.25.0",
|
|
"vite": "^6.1.0",
|
|
"yaml": "^2.4.5",
|
|
"yup": "^1.7.1",
|
|
"zod": "^3.23.8"
|
|
},
|
|
"devDependencies": {
|
|
"@simplewebauthn/types": "^11.0.0",
|
|
"@types/json-diff": "^1.0.3",
|
|
"@types/node": "20.17.6",
|
|
"@types/nodemailer": "^6.4.14",
|
|
"@types/oidc-provider": "^8.5.1",
|
|
"@types/pg": "^8.16.0",
|
|
"@types/react": "19.2.7",
|
|
"@types/react-dom": "19.2.3",
|
|
"@types/semver": "^7.5.8",
|
|
"concurrently": "^8.2.2",
|
|
"glob": "^10.4.1",
|
|
"import-in-the-middle": "1.14.2",
|
|
"prisma": "^7.0.0",
|
|
"require-in-the-middle": "^7.4.0",
|
|
"rimraf": "^5.0.5",
|
|
"tsdown": "^0.20.3",
|
|
"tsx": "^4.7.2"
|
|
},
|
|
"packageManager": "pnpm@10.23.0"
|
|
}
|