@useatlas/create 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +231 -0
- package/index.ts +829 -0
- package/package.json +38 -0
- package/templates/docker/.env.example +67 -0
- package/templates/docker/Dockerfile +52 -0
- package/templates/docker/bin/__tests__/benchmark.test.ts +598 -0
- package/templates/docker/bin/__tests__/duckdb-ingest.test.ts +171 -0
- package/templates/docker/bin/__tests__/eval.test.ts +434 -0
- package/templates/docker/bin/__tests__/matview-partition.test.ts +615 -0
- package/templates/docker/bin/__tests__/multi-source.test.ts +113 -0
- package/templates/docker/bin/__tests__/plugin-cli.test.ts +322 -0
- package/templates/docker/bin/__tests__/profiler-heuristics.test.ts +608 -0
- package/templates/docker/bin/__tests__/query.test.ts +240 -0
- package/templates/docker/bin/__tests__/schema-drift.test.ts +542 -0
- package/templates/docker/bin/__tests__/view-yaml-generation.test.ts +146 -0
- package/templates/docker/bin/atlas.ts +5044 -0
- package/templates/docker/bin/benchmark.ts +695 -0
- package/templates/docker/bin/enrich.ts +559 -0
- package/templates/docker/bin/eval.ts +770 -0
- package/templates/docker/bin/smoke.ts +438 -0
- package/templates/docker/data/.gitkeep +0 -0
- package/templates/docker/data/cybersec.sql +1961 -0
- package/templates/docker/data/demo-semantic/catalog.yml +40 -0
- package/templates/docker/data/demo-semantic/entities/accounts.yml +170 -0
- package/templates/docker/data/demo-semantic/entities/companies.yml +207 -0
- package/templates/docker/data/demo-semantic/entities/people.yml +145 -0
- package/templates/docker/data/demo-semantic/glossary.yml +22 -0
- package/templates/docker/data/demo-semantic/metrics/accounts.yml +38 -0
- package/templates/docker/data/demo-semantic/metrics/companies.yml +89 -0
- package/templates/docker/data/demo.sql +373 -0
- package/templates/docker/data/ecommerce.sql +1690 -0
- package/templates/docker/data/init-demo-db.sql +8 -0
- package/templates/docker/docker-compose.yml +34 -0
- package/templates/docker/docs/deploy.md +390 -0
- package/templates/docker/eslint.config.mjs +18 -0
- package/templates/docker/gitignore +5 -0
- package/templates/docker/next.config.ts +9 -0
- package/templates/docker/package.json +59 -0
- package/templates/docker/postcss.config.mjs +8 -0
- package/templates/docker/public/.gitkeep +0 -0
- package/templates/docker/public/favicon.svg +4 -0
- package/templates/docker/railway.json +13 -0
- package/templates/docker/render.yaml +34 -0
- package/templates/docker/semantic/catalog.yml +5 -0
- package/templates/docker/semantic/entities/.gitkeep +0 -0
- package/templates/docker/semantic/glossary.yml +6 -0
- package/templates/docker/semantic/metrics/.gitkeep +0 -0
- package/templates/docker/sidecar/Dockerfile +28 -0
- package/templates/docker/sidecar/railway.json +14 -0
- package/templates/docker/sidecar/server.ts +188 -0
- package/templates/docker/src/api/__tests__/actions.test.ts +683 -0
- package/templates/docker/src/api/__tests__/admin.test.ts +820 -0
- package/templates/docker/src/api/__tests__/auth.test.ts +165 -0
- package/templates/docker/src/api/__tests__/chat.test.ts +376 -0
- package/templates/docker/src/api/__tests__/conversations.test.ts +555 -0
- package/templates/docker/src/api/__tests__/cors.test.ts +135 -0
- package/templates/docker/src/api/__tests__/health-plugin.test.ts +169 -0
- package/templates/docker/src/api/__tests__/health.test.ts +261 -0
- package/templates/docker/src/api/__tests__/query.test.ts +891 -0
- package/templates/docker/src/api/__tests__/scheduled-tasks.test.ts +601 -0
- package/templates/docker/src/api/__tests__/slack.test.ts +847 -0
- package/templates/docker/src/api/index.ts +117 -0
- package/templates/docker/src/api/routes/actions.ts +274 -0
- package/templates/docker/src/api/routes/admin.ts +757 -0
- package/templates/docker/src/api/routes/auth.ts +48 -0
- package/templates/docker/src/api/routes/chat.ts +465 -0
- package/templates/docker/src/api/routes/conversations.ts +266 -0
- package/templates/docker/src/api/routes/health.ts +287 -0
- package/templates/docker/src/api/routes/openapi.ts +390 -0
- package/templates/docker/src/api/routes/query.ts +318 -0
- package/templates/docker/src/api/routes/scheduled-tasks.ts +467 -0
- package/templates/docker/src/api/routes/slack.ts +611 -0
- package/templates/docker/src/api/server.ts +226 -0
- package/templates/docker/src/app/api/[...route]/route.ts +33 -0
- package/templates/docker/src/app/error.tsx +24 -0
- package/templates/docker/src/app/globals.css +126 -0
- package/templates/docker/src/app/layout.tsx +19 -0
- package/templates/docker/src/app/page.tsx +14 -0
- package/templates/docker/src/global.d.ts +1 -0
- package/templates/docker/src/lib/__tests__/agent-cache.test.ts +437 -0
- package/templates/docker/src/lib/__tests__/agent-dialect.test.ts +114 -0
- package/templates/docker/src/lib/__tests__/agent-health-annotations.test.ts +164 -0
- package/templates/docker/src/lib/__tests__/agent-integration.test.ts +514 -0
- package/templates/docker/src/lib/__tests__/config-actions.test.ts +166 -0
- package/templates/docker/src/lib/__tests__/config.test.ts +1063 -0
- package/templates/docker/src/lib/__tests__/conversations.test.ts +589 -0
- package/templates/docker/src/lib/__tests__/errors.test.ts +256 -0
- package/templates/docker/src/lib/__tests__/logger.test.ts +200 -0
- package/templates/docker/src/lib/__tests__/providers.test.ts +99 -0
- package/templates/docker/src/lib/__tests__/rls.test.ts +435 -0
- package/templates/docker/src/lib/__tests__/scheduled-task-types.test.ts +124 -0
- package/templates/docker/src/lib/__tests__/scheduled-tasks.test.ts +550 -0
- package/templates/docker/src/lib/__tests__/semantic-index.test.ts +547 -0
- package/templates/docker/src/lib/__tests__/semantic-multisource.test.ts +544 -0
- package/templates/docker/src/lib/__tests__/semantic.test.ts +363 -0
- package/templates/docker/src/lib/__tests__/startup-actions.test.ts +452 -0
- package/templates/docker/src/lib/__tests__/startup.test.ts +465 -0
- package/templates/docker/src/lib/__tests__/tracing.test.ts +28 -0
- package/templates/docker/src/lib/action-types.ts +95 -0
- package/templates/docker/src/lib/agent-query.ts +178 -0
- package/templates/docker/src/lib/agent.ts +505 -0
- package/templates/docker/src/lib/api-url.ts +2 -0
- package/templates/docker/src/lib/auth/__tests__/audit.test.ts +418 -0
- package/templates/docker/src/lib/auth/__tests__/byot-integration.test.ts +222 -0
- package/templates/docker/src/lib/auth/__tests__/byot.test.ts +366 -0
- package/templates/docker/src/lib/auth/__tests__/detect.test.ts +190 -0
- package/templates/docker/src/lib/auth/__tests__/managed.test.ts +173 -0
- package/templates/docker/src/lib/auth/__tests__/middleware.test.ts +456 -0
- package/templates/docker/src/lib/auth/__tests__/migrate.test.ts +201 -0
- package/templates/docker/src/lib/auth/__tests__/permissions.test.ts +225 -0
- package/templates/docker/src/lib/auth/__tests__/server.test.ts +34 -0
- package/templates/docker/src/lib/auth/__tests__/simple-key.test.ts +176 -0
- package/templates/docker/src/lib/auth/__tests__/types.test.ts +44 -0
- package/templates/docker/src/lib/auth/audit.ts +89 -0
- package/templates/docker/src/lib/auth/byot.ts +158 -0
- package/templates/docker/src/lib/auth/client.ts +35 -0
- package/templates/docker/src/lib/auth/detect.ts +83 -0
- package/templates/docker/src/lib/auth/managed.ts +73 -0
- package/templates/docker/src/lib/auth/middleware.ts +208 -0
- package/templates/docker/src/lib/auth/migrate.ts +111 -0
- package/templates/docker/src/lib/auth/permissions.ts +156 -0
- package/templates/docker/src/lib/auth/server.ts +142 -0
- package/templates/docker/src/lib/auth/simple-key.ts +92 -0
- package/templates/docker/src/lib/auth/types.ts +49 -0
- package/templates/docker/src/lib/config.ts +704 -0
- package/templates/docker/src/lib/conversation-types.ts +29 -0
- package/templates/docker/src/lib/conversations.ts +270 -0
- package/templates/docker/src/lib/db/__tests__/connection.test.ts +69 -0
- package/templates/docker/src/lib/db/__tests__/duckdb.test.ts +141 -0
- package/templates/docker/src/lib/db/__tests__/internal.test.ts +387 -0
- package/templates/docker/src/lib/db/__tests__/registry-health.test.ts +207 -0
- package/templates/docker/src/lib/db/__tests__/registry-pool-limits.test.ts +156 -0
- package/templates/docker/src/lib/db/__tests__/registry.test.ts +595 -0
- package/templates/docker/src/lib/db/__tests__/salesforce.test.ts +339 -0
- package/templates/docker/src/lib/db/__tests__/snowflake.test.ts +217 -0
- package/templates/docker/src/lib/db/__tests__/source-rate-limit.test.ts +130 -0
- package/templates/docker/src/lib/db/connection.ts +753 -0
- package/templates/docker/src/lib/db/duckdb.ts +122 -0
- package/templates/docker/src/lib/db/internal.ts +273 -0
- package/templates/docker/src/lib/db/salesforce.ts +342 -0
- package/templates/docker/src/lib/db/source-rate-limit.ts +191 -0
- package/templates/docker/src/lib/errors.ts +154 -0
- package/templates/docker/src/lib/logger.ts +98 -0
- package/templates/docker/src/lib/plugins/__tests__/hooks-integration.test.ts +202 -0
- package/templates/docker/src/lib/plugins/__tests__/hooks.test.ts +529 -0
- package/templates/docker/src/lib/plugins/__tests__/migrate.test.ts +521 -0
- package/templates/docker/src/lib/plugins/__tests__/registry.test.ts +346 -0
- package/templates/docker/src/lib/plugins/__tests__/tools.test.ts +49 -0
- package/templates/docker/src/lib/plugins/__tests__/wiring.test.ts +585 -0
- package/templates/docker/src/lib/plugins/hooks.ts +162 -0
- package/templates/docker/src/lib/plugins/index.ts +9 -0
- package/templates/docker/src/lib/plugins/migrate.ts +309 -0
- package/templates/docker/src/lib/plugins/registry.ts +231 -0
- package/templates/docker/src/lib/plugins/tools.ts +39 -0
- package/templates/docker/src/lib/plugins/wiring.ts +291 -0
- package/templates/docker/src/lib/providers.ts +102 -0
- package/templates/docker/src/lib/rls.ts +321 -0
- package/templates/docker/src/lib/scheduled-task-types.ts +132 -0
- package/templates/docker/src/lib/scheduled-tasks.ts +475 -0
- package/templates/docker/src/lib/scheduler/__tests__/delivery.test.ts +192 -0
- package/templates/docker/src/lib/scheduler/__tests__/engine.test.ts +248 -0
- package/templates/docker/src/lib/scheduler/__tests__/format-email.test.ts +96 -0
- package/templates/docker/src/lib/scheduler/__tests__/format-slack.test.ts +78 -0
- package/templates/docker/src/lib/scheduler/__tests__/format-webhook.test.ts +78 -0
- package/templates/docker/src/lib/scheduler/delivery.ts +248 -0
- package/templates/docker/src/lib/scheduler/engine.ts +317 -0
- package/templates/docker/src/lib/scheduler/executor.ts +73 -0
- package/templates/docker/src/lib/scheduler/format-email.ts +109 -0
- package/templates/docker/src/lib/scheduler/format-slack.ts +35 -0
- package/templates/docker/src/lib/scheduler/format-webhook.ts +37 -0
- package/templates/docker/src/lib/scheduler/index.ts +7 -0
- package/templates/docker/src/lib/security.ts +11 -0
- package/templates/docker/src/lib/semantic-index.ts +503 -0
- package/templates/docker/src/lib/semantic.ts +387 -0
- package/templates/docker/src/lib/sidecar-types.ts +16 -0
- package/templates/docker/src/lib/slack/__tests__/api.test.ts +160 -0
- package/templates/docker/src/lib/slack/__tests__/format.test.ts +237 -0
- package/templates/docker/src/lib/slack/__tests__/store.test.ts +188 -0
- package/templates/docker/src/lib/slack/__tests__/threads.test.ts +112 -0
- package/templates/docker/src/lib/slack/__tests__/verify.test.ts +111 -0
- package/templates/docker/src/lib/slack/api.ts +102 -0
- package/templates/docker/src/lib/slack/format.ts +209 -0
- package/templates/docker/src/lib/slack/store.ts +107 -0
- package/templates/docker/src/lib/slack/threads.ts +64 -0
- package/templates/docker/src/lib/slack/verify.ts +71 -0
- package/templates/docker/src/lib/startup.ts +730 -0
- package/templates/docker/src/lib/tools/__tests__/action-permissions.test.ts +594 -0
- package/templates/docker/src/lib/tools/__tests__/custom-validation.test.ts +238 -0
- package/templates/docker/src/lib/tools/__tests__/explore-backend.test.ts +267 -0
- package/templates/docker/src/lib/tools/__tests__/explore-nsjail.test.ts +492 -0
- package/templates/docker/src/lib/tools/__tests__/explore-plugin.test.ts +374 -0
- package/templates/docker/src/lib/tools/__tests__/explore-sdk-compat.test.ts +82 -0
- package/templates/docker/src/lib/tools/__tests__/explore-sidecar.test.ts +208 -0
- package/templates/docker/src/lib/tools/__tests__/registry-actions.test.ts +144 -0
- package/templates/docker/src/lib/tools/__tests__/registry.test.ts +235 -0
- package/templates/docker/src/lib/tools/__tests__/salesforce-tool.test.ts +154 -0
- package/templates/docker/src/lib/tools/__tests__/soql-validation.test.ts +303 -0
- package/templates/docker/src/lib/tools/__tests__/sql-audit.test.ts +225 -0
- package/templates/docker/src/lib/tools/__tests__/sql-connection-whitelist.test.ts +98 -0
- package/templates/docker/src/lib/tools/__tests__/sql-duckdb.test.ts +233 -0
- package/templates/docker/src/lib/tools/__tests__/sql-ratelimit.test.ts +225 -0
- package/templates/docker/src/lib/tools/__tests__/sql.test.ts +1012 -0
- package/templates/docker/src/lib/tools/actions/__tests__/audit.test.ts +211 -0
- package/templates/docker/src/lib/tools/actions/__tests__/email.test.ts +378 -0
- package/templates/docker/src/lib/tools/actions/__tests__/handler.test.ts +681 -0
- package/templates/docker/src/lib/tools/actions/__tests__/jira.test.ts +427 -0
- package/templates/docker/src/lib/tools/actions/audit.ts +47 -0
- package/templates/docker/src/lib/tools/actions/email.ts +191 -0
- package/templates/docker/src/lib/tools/actions/handler.ts +591 -0
- package/templates/docker/src/lib/tools/actions/index.ts +23 -0
- package/templates/docker/src/lib/tools/actions/jira.ts +220 -0
- package/templates/docker/src/lib/tools/explore-nsjail.ts +343 -0
- package/templates/docker/src/lib/tools/explore-sandbox.ts +264 -0
- package/templates/docker/src/lib/tools/explore-sidecar.ts +163 -0
- package/templates/docker/src/lib/tools/explore.ts +379 -0
- package/templates/docker/src/lib/tools/registry.ts +221 -0
- package/templates/docker/src/lib/tools/salesforce.ts +138 -0
- package/templates/docker/src/lib/tools/soql-validation.ts +172 -0
- package/templates/docker/src/lib/tools/sql.ts +680 -0
- package/templates/docker/src/lib/tracing.ts +40 -0
- package/templates/docker/src/lib/utils.ts +6 -0
- package/templates/docker/src/test-setup.ts +38 -0
- package/templates/docker/src/types/vercel-sandbox.d.ts +54 -0
- package/templates/docker/src/ui/components/actions/action-approval-card.tsx +295 -0
- package/templates/docker/src/ui/components/actions/action-status-badge.tsx +50 -0
- package/templates/docker/src/ui/components/admin/admin-layout.tsx +26 -0
- package/templates/docker/src/ui/components/admin/admin-sidebar.tsx +96 -0
- package/templates/docker/src/ui/components/admin/empty-state.tsx +24 -0
- package/templates/docker/src/ui/components/admin/entity-detail.tsx +233 -0
- package/templates/docker/src/ui/components/admin/entity-list.tsx +96 -0
- package/templates/docker/src/ui/components/admin/error-banner.tsx +22 -0
- package/templates/docker/src/ui/components/admin/feature-disabled.tsx +44 -0
- package/templates/docker/src/ui/components/admin/health-badge.tsx +30 -0
- package/templates/docker/src/ui/components/admin/loading-state.tsx +14 -0
- package/templates/docker/src/ui/components/admin/stat-card.tsx +32 -0
- package/templates/docker/src/ui/components/atlas-chat.tsx +370 -0
- package/templates/docker/src/ui/components/chart/chart-detection.ts +261 -0
- package/templates/docker/src/ui/components/chart/result-chart.tsx +375 -0
- package/templates/docker/src/ui/components/chat/api-key-bar.tsx +66 -0
- package/templates/docker/src/ui/components/chat/copy-button.tsx +25 -0
- package/templates/docker/src/ui/components/chat/data-table.tsx +102 -0
- package/templates/docker/src/ui/components/chat/error-banner.tsx +32 -0
- package/templates/docker/src/ui/components/chat/explore-card.tsx +41 -0
- package/templates/docker/src/ui/components/chat/loading-card.tsx +10 -0
- package/templates/docker/src/ui/components/chat/managed-auth-card.tsx +116 -0
- package/templates/docker/src/ui/components/chat/markdown.tsx +72 -0
- package/templates/docker/src/ui/components/chat/sql-block.tsx +30 -0
- package/templates/docker/src/ui/components/chat/sql-result-card.tsx +144 -0
- package/templates/docker/src/ui/components/chat/starter-prompts.ts +6 -0
- package/templates/docker/src/ui/components/chat/tool-part.tsx +40 -0
- package/templates/docker/src/ui/components/chat/typing-indicator.tsx +19 -0
- package/templates/docker/src/ui/components/conversations/conversation-item.tsx +120 -0
- package/templates/docker/src/ui/components/conversations/conversation-list.tsx +66 -0
- package/templates/docker/src/ui/components/conversations/conversation-sidebar.tsx +78 -0
- package/templates/docker/src/ui/components/conversations/delete-confirmation.tsx +27 -0
- package/templates/docker/src/ui/context.tsx +78 -0
- package/templates/docker/src/ui/hooks/use-admin-fetch.ts +104 -0
- package/templates/docker/src/ui/hooks/use-conversations.ts +184 -0
- package/templates/docker/src/ui/hooks/use-dark-mode.ts +17 -0
- package/templates/docker/src/ui/lib/action-types.ts +63 -0
- package/templates/docker/src/ui/lib/helpers.ts +104 -0
- package/templates/docker/src/ui/lib/types.ts +145 -0
- package/templates/docker/tsconfig.json +41 -0
- package/templates/docker/vercel.json +3 -0
- package/templates/nextjs-standalone/.env.example +68 -0
- package/templates/nextjs-standalone/bin/__tests__/benchmark.test.ts +598 -0
- package/templates/nextjs-standalone/bin/__tests__/duckdb-ingest.test.ts +171 -0
- package/templates/nextjs-standalone/bin/__tests__/eval.test.ts +434 -0
- package/templates/nextjs-standalone/bin/__tests__/matview-partition.test.ts +615 -0
- package/templates/nextjs-standalone/bin/__tests__/multi-source.test.ts +113 -0
- package/templates/nextjs-standalone/bin/__tests__/plugin-cli.test.ts +322 -0
- package/templates/nextjs-standalone/bin/__tests__/profiler-heuristics.test.ts +608 -0
- package/templates/nextjs-standalone/bin/__tests__/query.test.ts +240 -0
- package/templates/nextjs-standalone/bin/__tests__/schema-drift.test.ts +542 -0
- package/templates/nextjs-standalone/bin/__tests__/view-yaml-generation.test.ts +146 -0
- package/templates/nextjs-standalone/bin/atlas.ts +5044 -0
- package/templates/nextjs-standalone/bin/benchmark.ts +695 -0
- package/templates/nextjs-standalone/bin/enrich.ts +559 -0
- package/templates/nextjs-standalone/bin/eval.ts +770 -0
- package/templates/nextjs-standalone/bin/smoke.ts +438 -0
- package/templates/nextjs-standalone/data/.gitkeep +0 -0
- package/templates/nextjs-standalone/data/cybersec.sql +1961 -0
- package/templates/nextjs-standalone/data/demo-semantic/catalog.yml +40 -0
- package/templates/nextjs-standalone/data/demo-semantic/entities/accounts.yml +170 -0
- package/templates/nextjs-standalone/data/demo-semantic/entities/companies.yml +207 -0
- package/templates/nextjs-standalone/data/demo-semantic/entities/people.yml +145 -0
- package/templates/nextjs-standalone/data/demo-semantic/glossary.yml +22 -0
- package/templates/nextjs-standalone/data/demo-semantic/metrics/accounts.yml +38 -0
- package/templates/nextjs-standalone/data/demo-semantic/metrics/companies.yml +89 -0
- package/templates/nextjs-standalone/data/demo.sql +373 -0
- package/templates/nextjs-standalone/data/ecommerce.sql +1690 -0
- package/templates/nextjs-standalone/data/init-demo-db.sql +8 -0
- package/templates/nextjs-standalone/docs/deploy.md +390 -0
- package/templates/nextjs-standalone/eslint.config.mjs +18 -0
- package/templates/nextjs-standalone/gitignore +5 -0
- package/templates/nextjs-standalone/next.config.ts +10 -0
- package/templates/nextjs-standalone/package.json +63 -0
- package/templates/nextjs-standalone/postcss.config.mjs +8 -0
- package/templates/nextjs-standalone/semantic/catalog.yml +5 -0
- package/templates/nextjs-standalone/semantic/entities/.gitkeep +0 -0
- package/templates/nextjs-standalone/semantic/glossary.yml +6 -0
- package/templates/nextjs-standalone/semantic/metrics/.gitkeep +0 -0
- package/templates/nextjs-standalone/src/api/__tests__/actions.test.ts +683 -0
- package/templates/nextjs-standalone/src/api/__tests__/admin.test.ts +820 -0
- package/templates/nextjs-standalone/src/api/__tests__/auth.test.ts +165 -0
- package/templates/nextjs-standalone/src/api/__tests__/chat.test.ts +376 -0
- package/templates/nextjs-standalone/src/api/__tests__/conversations.test.ts +555 -0
- package/templates/nextjs-standalone/src/api/__tests__/cors.test.ts +135 -0
- package/templates/nextjs-standalone/src/api/__tests__/health-plugin.test.ts +169 -0
- package/templates/nextjs-standalone/src/api/__tests__/health.test.ts +261 -0
- package/templates/nextjs-standalone/src/api/__tests__/query.test.ts +891 -0
- package/templates/nextjs-standalone/src/api/__tests__/scheduled-tasks.test.ts +601 -0
- package/templates/nextjs-standalone/src/api/__tests__/slack.test.ts +847 -0
- package/templates/nextjs-standalone/src/api/index.ts +117 -0
- package/templates/nextjs-standalone/src/api/routes/actions.ts +274 -0
- package/templates/nextjs-standalone/src/api/routes/admin.ts +757 -0
- package/templates/nextjs-standalone/src/api/routes/auth.ts +48 -0
- package/templates/nextjs-standalone/src/api/routes/chat.ts +465 -0
- package/templates/nextjs-standalone/src/api/routes/conversations.ts +266 -0
- package/templates/nextjs-standalone/src/api/routes/health.ts +287 -0
- package/templates/nextjs-standalone/src/api/routes/openapi.ts +390 -0
- package/templates/nextjs-standalone/src/api/routes/query.ts +318 -0
- package/templates/nextjs-standalone/src/api/routes/scheduled-tasks.ts +467 -0
- package/templates/nextjs-standalone/src/api/routes/slack.ts +611 -0
- package/templates/nextjs-standalone/src/api/server.ts +226 -0
- package/templates/nextjs-standalone/src/app/api/[...route]/route.ts +33 -0
- package/templates/nextjs-standalone/src/app/error.tsx +24 -0
- package/templates/nextjs-standalone/src/app/global-error.tsx +68 -0
- package/templates/nextjs-standalone/src/app/globals.css +126 -0
- package/templates/nextjs-standalone/src/app/layout.tsx +19 -0
- package/templates/nextjs-standalone/src/app/page.tsx +14 -0
- package/templates/nextjs-standalone/src/lib/__tests__/agent-cache.test.ts +437 -0
- package/templates/nextjs-standalone/src/lib/__tests__/agent-dialect.test.ts +114 -0
- package/templates/nextjs-standalone/src/lib/__tests__/agent-health-annotations.test.ts +164 -0
- package/templates/nextjs-standalone/src/lib/__tests__/agent-integration.test.ts +514 -0
- package/templates/nextjs-standalone/src/lib/__tests__/config-actions.test.ts +166 -0
- package/templates/nextjs-standalone/src/lib/__tests__/config.test.ts +1063 -0
- package/templates/nextjs-standalone/src/lib/__tests__/conversations.test.ts +589 -0
- package/templates/nextjs-standalone/src/lib/__tests__/errors.test.ts +256 -0
- package/templates/nextjs-standalone/src/lib/__tests__/logger.test.ts +200 -0
- package/templates/nextjs-standalone/src/lib/__tests__/providers.test.ts +99 -0
- package/templates/nextjs-standalone/src/lib/__tests__/rls.test.ts +435 -0
- package/templates/nextjs-standalone/src/lib/__tests__/scheduled-task-types.test.ts +124 -0
- package/templates/nextjs-standalone/src/lib/__tests__/scheduled-tasks.test.ts +550 -0
- package/templates/nextjs-standalone/src/lib/__tests__/semantic-index.test.ts +547 -0
- package/templates/nextjs-standalone/src/lib/__tests__/semantic-multisource.test.ts +544 -0
- package/templates/nextjs-standalone/src/lib/__tests__/semantic.test.ts +363 -0
- package/templates/nextjs-standalone/src/lib/__tests__/startup-actions.test.ts +452 -0
- package/templates/nextjs-standalone/src/lib/__tests__/startup.test.ts +465 -0
- package/templates/nextjs-standalone/src/lib/__tests__/tracing.test.ts +28 -0
- package/templates/nextjs-standalone/src/lib/action-types.ts +95 -0
- package/templates/nextjs-standalone/src/lib/agent-query.ts +178 -0
- package/templates/nextjs-standalone/src/lib/agent.ts +505 -0
- package/templates/nextjs-standalone/src/lib/api-url.ts +3 -0
- package/templates/nextjs-standalone/src/lib/auth/__tests__/audit.test.ts +418 -0
- package/templates/nextjs-standalone/src/lib/auth/__tests__/byot-integration.test.ts +222 -0
- package/templates/nextjs-standalone/src/lib/auth/__tests__/byot.test.ts +366 -0
- package/templates/nextjs-standalone/src/lib/auth/__tests__/detect.test.ts +190 -0
- package/templates/nextjs-standalone/src/lib/auth/__tests__/managed.test.ts +173 -0
- package/templates/nextjs-standalone/src/lib/auth/__tests__/middleware.test.ts +456 -0
- package/templates/nextjs-standalone/src/lib/auth/__tests__/migrate.test.ts +201 -0
- package/templates/nextjs-standalone/src/lib/auth/__tests__/permissions.test.ts +225 -0
- package/templates/nextjs-standalone/src/lib/auth/__tests__/server.test.ts +34 -0
- package/templates/nextjs-standalone/src/lib/auth/__tests__/simple-key.test.ts +176 -0
- package/templates/nextjs-standalone/src/lib/auth/__tests__/types.test.ts +44 -0
- package/templates/nextjs-standalone/src/lib/auth/audit.ts +89 -0
- package/templates/nextjs-standalone/src/lib/auth/byot.ts +158 -0
- package/templates/nextjs-standalone/src/lib/auth/client.ts +23 -0
- package/templates/nextjs-standalone/src/lib/auth/detect.ts +83 -0
- package/templates/nextjs-standalone/src/lib/auth/managed.ts +73 -0
- package/templates/nextjs-standalone/src/lib/auth/middleware.ts +208 -0
- package/templates/nextjs-standalone/src/lib/auth/migrate.ts +111 -0
- package/templates/nextjs-standalone/src/lib/auth/permissions.ts +156 -0
- package/templates/nextjs-standalone/src/lib/auth/server.ts +142 -0
- package/templates/nextjs-standalone/src/lib/auth/simple-key.ts +92 -0
- package/templates/nextjs-standalone/src/lib/auth/types.ts +49 -0
- package/templates/nextjs-standalone/src/lib/config.ts +704 -0
- package/templates/nextjs-standalone/src/lib/conversation-types.ts +29 -0
- package/templates/nextjs-standalone/src/lib/conversations.ts +270 -0
- package/templates/nextjs-standalone/src/lib/db/__tests__/connection.test.ts +69 -0
- package/templates/nextjs-standalone/src/lib/db/__tests__/duckdb.test.ts +141 -0
- package/templates/nextjs-standalone/src/lib/db/__tests__/internal.test.ts +387 -0
- package/templates/nextjs-standalone/src/lib/db/__tests__/registry-health.test.ts +207 -0
- package/templates/nextjs-standalone/src/lib/db/__tests__/registry-pool-limits.test.ts +156 -0
- package/templates/nextjs-standalone/src/lib/db/__tests__/registry.test.ts +595 -0
- package/templates/nextjs-standalone/src/lib/db/__tests__/salesforce.test.ts +339 -0
- package/templates/nextjs-standalone/src/lib/db/__tests__/snowflake.test.ts +217 -0
- package/templates/nextjs-standalone/src/lib/db/__tests__/source-rate-limit.test.ts +130 -0
- package/templates/nextjs-standalone/src/lib/db/connection.ts +753 -0
- package/templates/nextjs-standalone/src/lib/db/duckdb.ts +122 -0
- package/templates/nextjs-standalone/src/lib/db/internal.ts +273 -0
- package/templates/nextjs-standalone/src/lib/db/salesforce.ts +342 -0
- package/templates/nextjs-standalone/src/lib/db/source-rate-limit.ts +191 -0
- package/templates/nextjs-standalone/src/lib/errors.ts +154 -0
- package/templates/nextjs-standalone/src/lib/logger.ts +98 -0
- package/templates/nextjs-standalone/src/lib/plugins/__tests__/hooks-integration.test.ts +202 -0
- package/templates/nextjs-standalone/src/lib/plugins/__tests__/hooks.test.ts +529 -0
- package/templates/nextjs-standalone/src/lib/plugins/__tests__/migrate.test.ts +521 -0
- package/templates/nextjs-standalone/src/lib/plugins/__tests__/registry.test.ts +346 -0
- package/templates/nextjs-standalone/src/lib/plugins/__tests__/tools.test.ts +49 -0
- package/templates/nextjs-standalone/src/lib/plugins/__tests__/wiring.test.ts +585 -0
- package/templates/nextjs-standalone/src/lib/plugins/hooks.ts +162 -0
- package/templates/nextjs-standalone/src/lib/plugins/index.ts +9 -0
- package/templates/nextjs-standalone/src/lib/plugins/migrate.ts +309 -0
- package/templates/nextjs-standalone/src/lib/plugins/registry.ts +231 -0
- package/templates/nextjs-standalone/src/lib/plugins/tools.ts +39 -0
- package/templates/nextjs-standalone/src/lib/plugins/wiring.ts +291 -0
- package/templates/nextjs-standalone/src/lib/providers.ts +102 -0
- package/templates/nextjs-standalone/src/lib/rls.ts +321 -0
- package/templates/nextjs-standalone/src/lib/scheduled-task-types.ts +132 -0
- package/templates/nextjs-standalone/src/lib/scheduled-tasks.ts +475 -0
- package/templates/nextjs-standalone/src/lib/scheduler/__tests__/delivery.test.ts +192 -0
- package/templates/nextjs-standalone/src/lib/scheduler/__tests__/engine.test.ts +248 -0
- package/templates/nextjs-standalone/src/lib/scheduler/__tests__/format-email.test.ts +96 -0
- package/templates/nextjs-standalone/src/lib/scheduler/__tests__/format-slack.test.ts +78 -0
- package/templates/nextjs-standalone/src/lib/scheduler/__tests__/format-webhook.test.ts +78 -0
- package/templates/nextjs-standalone/src/lib/scheduler/delivery.ts +248 -0
- package/templates/nextjs-standalone/src/lib/scheduler/engine.ts +317 -0
- package/templates/nextjs-standalone/src/lib/scheduler/executor.ts +73 -0
- package/templates/nextjs-standalone/src/lib/scheduler/format-email.ts +109 -0
- package/templates/nextjs-standalone/src/lib/scheduler/format-slack.ts +35 -0
- package/templates/nextjs-standalone/src/lib/scheduler/format-webhook.ts +37 -0
- package/templates/nextjs-standalone/src/lib/scheduler/index.ts +7 -0
- package/templates/nextjs-standalone/src/lib/security.ts +11 -0
- package/templates/nextjs-standalone/src/lib/semantic-index.ts +503 -0
- package/templates/nextjs-standalone/src/lib/semantic.ts +387 -0
- package/templates/nextjs-standalone/src/lib/sidecar-types.ts +16 -0
- package/templates/nextjs-standalone/src/lib/slack/__tests__/api.test.ts +160 -0
- package/templates/nextjs-standalone/src/lib/slack/__tests__/format.test.ts +237 -0
- package/templates/nextjs-standalone/src/lib/slack/__tests__/store.test.ts +188 -0
- package/templates/nextjs-standalone/src/lib/slack/__tests__/threads.test.ts +112 -0
- package/templates/nextjs-standalone/src/lib/slack/__tests__/verify.test.ts +111 -0
- package/templates/nextjs-standalone/src/lib/slack/api.ts +102 -0
- package/templates/nextjs-standalone/src/lib/slack/format.ts +209 -0
- package/templates/nextjs-standalone/src/lib/slack/store.ts +107 -0
- package/templates/nextjs-standalone/src/lib/slack/threads.ts +64 -0
- package/templates/nextjs-standalone/src/lib/slack/verify.ts +71 -0
- package/templates/nextjs-standalone/src/lib/startup.ts +730 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/action-permissions.test.ts +594 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/custom-validation.test.ts +238 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/explore-backend.test.ts +267 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/explore-nsjail.test.ts +492 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/explore-plugin.test.ts +374 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/explore-sdk-compat.test.ts +82 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/explore-sidecar.test.ts +208 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/registry-actions.test.ts +144 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/registry.test.ts +235 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/salesforce-tool.test.ts +154 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/soql-validation.test.ts +303 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/sql-audit.test.ts +225 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/sql-connection-whitelist.test.ts +98 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/sql-duckdb.test.ts +233 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/sql-ratelimit.test.ts +225 -0
- package/templates/nextjs-standalone/src/lib/tools/__tests__/sql.test.ts +1012 -0
- package/templates/nextjs-standalone/src/lib/tools/actions/__tests__/audit.test.ts +211 -0
- package/templates/nextjs-standalone/src/lib/tools/actions/__tests__/email.test.ts +378 -0
- package/templates/nextjs-standalone/src/lib/tools/actions/__tests__/handler.test.ts +681 -0
- package/templates/nextjs-standalone/src/lib/tools/actions/__tests__/jira.test.ts +427 -0
- package/templates/nextjs-standalone/src/lib/tools/actions/audit.ts +47 -0
- package/templates/nextjs-standalone/src/lib/tools/actions/email.ts +191 -0
- package/templates/nextjs-standalone/src/lib/tools/actions/handler.ts +591 -0
- package/templates/nextjs-standalone/src/lib/tools/actions/index.ts +23 -0
- package/templates/nextjs-standalone/src/lib/tools/actions/jira.ts +220 -0
- package/templates/nextjs-standalone/src/lib/tools/explore-nsjail.ts +343 -0
- package/templates/nextjs-standalone/src/lib/tools/explore-sandbox.ts +264 -0
- package/templates/nextjs-standalone/src/lib/tools/explore-sidecar.ts +163 -0
- package/templates/nextjs-standalone/src/lib/tools/explore.ts +379 -0
- package/templates/nextjs-standalone/src/lib/tools/registry.ts +221 -0
- package/templates/nextjs-standalone/src/lib/tools/salesforce.ts +138 -0
- package/templates/nextjs-standalone/src/lib/tools/soql-validation.ts +172 -0
- package/templates/nextjs-standalone/src/lib/tools/sql.ts +680 -0
- package/templates/nextjs-standalone/src/lib/tracing.ts +40 -0
- package/templates/nextjs-standalone/src/lib/utils.ts +6 -0
- package/templates/nextjs-standalone/src/test-setup.ts +38 -0
- package/templates/nextjs-standalone/src/ui/components/actions/action-approval-card.tsx +295 -0
- package/templates/nextjs-standalone/src/ui/components/actions/action-status-badge.tsx +50 -0
- package/templates/nextjs-standalone/src/ui/components/admin/admin-layout.tsx +26 -0
- package/templates/nextjs-standalone/src/ui/components/admin/admin-sidebar.tsx +96 -0
- package/templates/nextjs-standalone/src/ui/components/admin/empty-state.tsx +24 -0
- package/templates/nextjs-standalone/src/ui/components/admin/entity-detail.tsx +233 -0
- package/templates/nextjs-standalone/src/ui/components/admin/entity-list.tsx +96 -0
- package/templates/nextjs-standalone/src/ui/components/admin/error-banner.tsx +22 -0
- package/templates/nextjs-standalone/src/ui/components/admin/feature-disabled.tsx +44 -0
- package/templates/nextjs-standalone/src/ui/components/admin/health-badge.tsx +30 -0
- package/templates/nextjs-standalone/src/ui/components/admin/loading-state.tsx +14 -0
- package/templates/nextjs-standalone/src/ui/components/admin/stat-card.tsx +32 -0
- package/templates/nextjs-standalone/src/ui/components/atlas-chat.tsx +370 -0
- package/templates/nextjs-standalone/src/ui/components/chart/chart-detection.ts +261 -0
- package/templates/nextjs-standalone/src/ui/components/chart/result-chart.tsx +375 -0
- package/templates/nextjs-standalone/src/ui/components/chat/api-key-bar.tsx +66 -0
- package/templates/nextjs-standalone/src/ui/components/chat/copy-button.tsx +25 -0
- package/templates/nextjs-standalone/src/ui/components/chat/data-table.tsx +102 -0
- package/templates/nextjs-standalone/src/ui/components/chat/error-banner.tsx +32 -0
- package/templates/nextjs-standalone/src/ui/components/chat/explore-card.tsx +41 -0
- package/templates/nextjs-standalone/src/ui/components/chat/loading-card.tsx +10 -0
- package/templates/nextjs-standalone/src/ui/components/chat/managed-auth-card.tsx +116 -0
- package/templates/nextjs-standalone/src/ui/components/chat/markdown.tsx +72 -0
- package/templates/nextjs-standalone/src/ui/components/chat/sql-block.tsx +30 -0
- package/templates/nextjs-standalone/src/ui/components/chat/sql-result-card.tsx +144 -0
- package/templates/nextjs-standalone/src/ui/components/chat/starter-prompts.ts +6 -0
- package/templates/nextjs-standalone/src/ui/components/chat/tool-part.tsx +40 -0
- package/templates/nextjs-standalone/src/ui/components/chat/typing-indicator.tsx +19 -0
- package/templates/nextjs-standalone/src/ui/components/conversations/conversation-item.tsx +120 -0
- package/templates/nextjs-standalone/src/ui/components/conversations/conversation-list.tsx +66 -0
- package/templates/nextjs-standalone/src/ui/components/conversations/conversation-sidebar.tsx +78 -0
- package/templates/nextjs-standalone/src/ui/components/conversations/delete-confirmation.tsx +27 -0
- package/templates/nextjs-standalone/src/ui/context.tsx +78 -0
- package/templates/nextjs-standalone/src/ui/hooks/use-admin-fetch.ts +104 -0
- package/templates/nextjs-standalone/src/ui/hooks/use-conversations.ts +184 -0
- package/templates/nextjs-standalone/src/ui/hooks/use-dark-mode.ts +17 -0
- package/templates/nextjs-standalone/src/ui/lib/action-types.ts +63 -0
- package/templates/nextjs-standalone/src/ui/lib/helpers.ts +104 -0
- package/templates/nextjs-standalone/src/ui/lib/types.ts +145 -0
- package/templates/nextjs-standalone/tsconfig.json +32 -0
- package/templates/nextjs-standalone/vercel.json +4 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
-- Create the demo analytics database alongside the Atlas internal DB.
|
|
2
|
+
-- Runs as superuser during postgres container initialization (mounted as 00-init.sql).
|
|
3
|
+
-- demo.sql is mounted at /data/demo.sql (outside docker-entrypoint-initdb.d
|
|
4
|
+
-- to prevent Docker from also running it against the default 'atlas' database).
|
|
5
|
+
CREATE DATABASE atlas_demo;
|
|
6
|
+
GRANT ALL PRIVILEGES ON DATABASE atlas_demo TO atlas;
|
|
7
|
+
\connect atlas_demo;
|
|
8
|
+
\i /data/demo.sql
|
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
# Deploy Guides
|
|
2
|
+
|
|
3
|
+
Atlas provides two example deployment topologies plus a static landing page. Deploy configs live in `examples/` and `apps/`, not at the repo root.
|
|
4
|
+
|
|
5
|
+
| Example | What's included | Use when |
|
|
6
|
+
|---------|----------------|----------|
|
|
7
|
+
| [`examples/docker/`](../examples/docker/) | Hono API + Docker + optional nsjail | Self-hosted deployment (Railway, Render, Docker Compose) |
|
|
8
|
+
| [`examples/nextjs-standalone/`](../examples/nextjs-standalone/) | Next.js + embedded Hono API | You want to deploy to Vercel with zero infrastructure |
|
|
9
|
+
| [`apps/www/`](../apps/www/) | Static landing page (Next.js export + Bun server) | Marketing site at useatlas.dev |
|
|
10
|
+
|
|
11
|
+
See each example's README for architecture details and quick start instructions.
|
|
12
|
+
|
|
13
|
+
### Production subdomain topology (useatlas.dev)
|
|
14
|
+
|
|
15
|
+
| Subdomain | Source | Platform | What's running |
|
|
16
|
+
|-----------|--------|----------|----------------|
|
|
17
|
+
| `useatlas.dev` | `apps/www` | Railway (NIXPACKS) | Bun static server (`serve.ts`) |
|
|
18
|
+
| `app.useatlas.dev` | `packages/web` + Hono API | Railway (Docker) | Next.js + Hono API |
|
|
19
|
+
| `demo.useatlas.dev` | `examples/docker` | Railway (Docker) | Hono API |
|
|
20
|
+
| `next.useatlas.dev` | `examples/nextjs-standalone` | Vercel | Next.js + embedded Hono API |
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Quick Deploy: Railway
|
|
25
|
+
|
|
26
|
+
Go from zero to production with managed Postgres included.
|
|
27
|
+
|
|
28
|
+
1. **Scaffold your project:**
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
bun create atlas-agent my-app
|
|
32
|
+
cd my-app
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
2. **Push to GitHub:**
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
git init && git add -A && git commit -m "Initial commit"
|
|
39
|
+
gh repo create my-app --public --source=. --push
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
3. **Create a Railway project:** Go to the [Railway Dashboard](https://railway.app/) and click **New Project**.
|
|
43
|
+
|
|
44
|
+
4. **Add a Postgres plugin:** Click **+ New** inside the project and add **Database > PostgreSQL**. Link it to your web service -- Railway injects `DATABASE_URL` automatically (this becomes Atlas's internal database).
|
|
45
|
+
|
|
46
|
+
5. **Connect your repo:** Click **+ New > GitHub Repo** and select your repo. Railway detects `railway.json` in `examples/docker/` and builds from the Dockerfile.
|
|
47
|
+
|
|
48
|
+
6. **Set environment variables** in the Railway service settings (`DATABASE_URL` is already set by the Postgres plugin):
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
ATLAS_PROVIDER=anthropic
|
|
52
|
+
ANTHROPIC_API_KEY=sk-ant-...
|
|
53
|
+
ATLAS_DATASOURCE_URL=postgresql://user:pass@your-analytics-host:5432/mydb
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
> `DATABASE_URL` (auto-set by Railway) is Atlas's internal Postgres. `ATLAS_DATASOURCE_URL` is the analytics database you want to query.
|
|
57
|
+
|
|
58
|
+
7. **Seed your data.** Choose a demo dataset or generate a semantic layer from your own tables:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
# Option A: Simple demo (3 tables, ~330 rows)
|
|
62
|
+
psql "$ATLAS_DATASOURCE_URL" < data/demo.sql
|
|
63
|
+
|
|
64
|
+
# Option B: Cybersec SaaS demo (62 tables, ~500K rows)
|
|
65
|
+
psql "$ATLAS_DATASOURCE_URL" < data/cybersec.sql
|
|
66
|
+
|
|
67
|
+
# Option C: Your own data
|
|
68
|
+
ATLAS_DATASOURCE_URL="$ATLAS_DATASOURCE_URL" bun run atlas -- init
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
8. **Deploy.** Railway builds and starts the container automatically.
|
|
72
|
+
|
|
73
|
+
9. **Verify:** `https://<your-app>.up.railway.app/api/health` -- should return `{"status":"ok"}`
|
|
74
|
+
|
|
75
|
+
**What happens automatically on Railway:**
|
|
76
|
+
|
|
77
|
+
- `DATABASE_URL` is injected by the Postgres plugin (used as Atlas's internal DB)
|
|
78
|
+
- `railway.json` configures Dockerfile builds, health checks, and restart policy
|
|
79
|
+
- The Docker `HEALTHCHECK` polls `/api/health` every 30 seconds
|
|
80
|
+
|
|
81
|
+
For more details, see the [full Railway section](#railway) below.
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Required environment variables
|
|
86
|
+
|
|
87
|
+
Every deployment needs these:
|
|
88
|
+
|
|
89
|
+
| Variable | Example | Purpose |
|
|
90
|
+
|----------|---------|---------|
|
|
91
|
+
| `ATLAS_PROVIDER` | `anthropic` | LLM provider |
|
|
92
|
+
| Provider API key | `ANTHROPIC_API_KEY=sk-ant-...` | Authentication for LLM |
|
|
93
|
+
| `ATLAS_DATASOURCE_URL` | `postgresql://...` or `mysql://...` | Analytics database to query |
|
|
94
|
+
| `DATABASE_URL` | `postgresql://atlas:atlas@host:5432/atlas` | Atlas internal Postgres (auth, audit) — auto-set on most platforms |
|
|
95
|
+
|
|
96
|
+
Optional variables (safe defaults for most deployments):
|
|
97
|
+
|
|
98
|
+
| Variable | Default | Description |
|
|
99
|
+
|----------|---------|-------------|
|
|
100
|
+
| `ATLAS_MODEL` | Provider default | Override the LLM model |
|
|
101
|
+
| `ATLAS_ROW_LIMIT` | `1000` | Max rows returned per query |
|
|
102
|
+
| `ATLAS_QUERY_TIMEOUT` | `30000` | Query timeout in ms |
|
|
103
|
+
| `PORT` | `3000` | Set automatically by most platforms |
|
|
104
|
+
|
|
105
|
+
### Authentication (optional)
|
|
106
|
+
|
|
107
|
+
Auth is opt-in. Set one of these to enable:
|
|
108
|
+
|
|
109
|
+
| Variable | Auth mode | Description |
|
|
110
|
+
|----------|-----------|-------------|
|
|
111
|
+
| `ATLAS_API_KEY` | Simple key | Single shared key, validated via `Authorization: Bearer <key>` |
|
|
112
|
+
| `BETTER_AUTH_SECRET` | Managed | Full user management (email/password). Min 32 chars. Requires `DATABASE_URL` |
|
|
113
|
+
| `ATLAS_AUTH_JWKS_URL` | BYOT | Stateless JWT verification against an external JWKS endpoint |
|
|
114
|
+
|
|
115
|
+
Additional auth variables:
|
|
116
|
+
|
|
117
|
+
| Variable | Default | Description |
|
|
118
|
+
|----------|---------|-------------|
|
|
119
|
+
| `ATLAS_AUTH_ISSUER` | — | Required with BYOT: expected JWT `iss` claim |
|
|
120
|
+
| `ATLAS_AUTH_AUDIENCE` | — | Optional with BYOT: expected JWT `aud` claim |
|
|
121
|
+
| `BETTER_AUTH_URL` | auto-detect | Base URL for Better Auth (recommended for production) |
|
|
122
|
+
| `ATLAS_RATE_LIMIT_RPM` | disabled | Max requests per minute per user (0 or unset = disabled) |
|
|
123
|
+
| `ATLAS_TRUST_PROXY` | `false` | Trust `X-Forwarded-For`/`X-Real-IP` for client IP. Set to `true` behind a reverse proxy |
|
|
124
|
+
|
|
125
|
+
When no auth vars are set, Atlas runs in open-access mode (identical to pre-v0.5 behavior). See [auth-design.md](auth-design.md) for details.
|
|
126
|
+
|
|
127
|
+
## Security & Isolation
|
|
128
|
+
|
|
129
|
+
Atlas runs agent-generated commands (filesystem exploration, future code execution) in a sandboxed environment. The level of isolation depends on your deployment platform — Atlas auto-detects the best available option and falls back gracefully.
|
|
130
|
+
|
|
131
|
+
### Sandbox tiers
|
|
132
|
+
|
|
133
|
+
| Tier | Backend | Platforms | Isolation level |
|
|
134
|
+
|------|---------|-----------|-----------------|
|
|
135
|
+
| 1 | Vercel Sandbox | Vercel | Firecracker microVM (hardware-level). No network, ephemeral filesystem |
|
|
136
|
+
| 2 | nsjail | Self-hosted Docker/VM | Linux namespaces. No network, read-only mount, separate PID/user space |
|
|
137
|
+
| 3 | Sidecar service | Railway, Render (planned) | Separate container with no secrets. Process-level isolation via private networking |
|
|
138
|
+
| 4 | just-bash | Everywhere (fallback) | In-memory OverlayFS + path-traversal protection. No process isolation |
|
|
139
|
+
|
|
140
|
+
### What's right for you?
|
|
141
|
+
|
|
142
|
+
**Self-hosted for your own team** — You're deploying Atlas behind a VPN or with API key auth, and all users are employees. Any tier works. Even just-bash is reasonable — the explore tool only reads YAML files, and all SQL is validated through 4 security layers (regex, AST parse, table whitelist, auto-LIMIT). You're defending against prompt injection edge cases, not hostile tenants.
|
|
143
|
+
|
|
144
|
+
**Public-facing or multi-tenant** — Users from different organizations query through the same Atlas instance. Use Tier 1 (Vercel) or Tier 2 (nsjail on self-hosted Docker/VM). These provide real process/VM isolation so one user's request can't affect another's.
|
|
145
|
+
|
|
146
|
+
### What Atlas already does regardless of tier
|
|
147
|
+
|
|
148
|
+
These protections are always active, independent of the sandbox:
|
|
149
|
+
|
|
150
|
+
- **SQL is SELECT-only** — INSERT, UPDATE, DELETE, DROP, and all other mutations are blocked by AST-level validation
|
|
151
|
+
- **Table whitelist** — Only tables defined in the semantic layer are queryable
|
|
152
|
+
- **Secrets never enter the sandbox** — The explore tool runs with `PATH`, `HOME`, `LANG` only. No database credentials, no API keys
|
|
153
|
+
- **Auto-LIMIT** — Every query gets a row limit (default 1000) and statement timeout (default 30s)
|
|
154
|
+
- **Read-only filesystem** — The explore tool can only read `semantic/*.yml` files, never write
|
|
155
|
+
|
|
156
|
+
### Overriding the auto-detected tier
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
ATLAS_SANDBOX=nsjail # Enforce nsjail (hard fail if unavailable)
|
|
160
|
+
ATLAS_SANDBOX_URL=http://sandbox:8080 # Use a sidecar service (planned)
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
The health endpoint (`GET /api/health`) reports which backend is active in the `explore.backend` field.
|
|
164
|
+
|
|
165
|
+
For the full sandbox architecture and threat model, see [sandbox-architecture-design.md](sandbox-architecture-design.md).
|
|
166
|
+
|
|
167
|
+
## Health check
|
|
168
|
+
|
|
169
|
+
All deployments should verify with the health endpoint:
|
|
170
|
+
|
|
171
|
+
```
|
|
172
|
+
GET /api/health
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Returns JSON with status `"ok"`, `"degraded"`, or `"error"` and sub-checks for datasource connectivity, provider configuration, semantic layer presence, auth mode, and internal DB status. Returns HTTP 200 when status is `"ok"` or `"degraded"`, and HTTP 503 when status is `"error"` (database unreachable). The health endpoint is always public (no auth required).
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## Docker
|
|
180
|
+
|
|
181
|
+
### Self-hosted (Docker)
|
|
182
|
+
|
|
183
|
+
The `examples/docker/Dockerfile` builds a single-process container with the Hono API server and optional nsjail isolation.
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
docker build -f examples/docker/Dockerfile -t atlas .
|
|
187
|
+
docker run -p 3001:3001 \
|
|
188
|
+
-e ATLAS_PROVIDER=anthropic \
|
|
189
|
+
-e ANTHROPIC_API_KEY=sk-ant-... \
|
|
190
|
+
-e ATLAS_DATASOURCE_URL=postgresql://user:pass@host:5432/dbname \
|
|
191
|
+
atlas
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
To build without nsjail (smaller image, no process isolation):
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
docker build --build-arg INSTALL_NSJAIL=false -f examples/docker/Dockerfile -t atlas .
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### Verify
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
curl http://localhost:3001/api/health
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
The Dockerfile includes a built-in `HEALTHCHECK` that polls `/api/health` every 30 seconds.
|
|
207
|
+
|
|
208
|
+
### Notes
|
|
209
|
+
|
|
210
|
+
- Images are based on `oven/bun:1.3`
|
|
211
|
+
- The semantic layer (`semantic/`) must be generated before building — run `atlas init` locally first. It gets baked into the image at build time; rebuild if you update YAMLs
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
## Railway
|
|
216
|
+
|
|
217
|
+
Railway auto-detects the `Dockerfile` via `railway.json` in the example directory.
|
|
218
|
+
|
|
219
|
+
### Steps
|
|
220
|
+
|
|
221
|
+
1. Create a new Railway project
|
|
222
|
+
2. Add a **Postgres** plugin (or use an external database)
|
|
223
|
+
3. Connect your GitHub repo -- Railway detects `examples/docker/railway.json` and builds from the Dockerfile
|
|
224
|
+
4. Set environment variables in the Railway dashboard:
|
|
225
|
+
|
|
226
|
+
```
|
|
227
|
+
ATLAS_PROVIDER=anthropic
|
|
228
|
+
ANTHROPIC_API_KEY=sk-ant-...
|
|
229
|
+
ATLAS_DATASOURCE_URL=postgresql://user:pass@your-analytics-host:5432/mydb
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
> Railway auto-sets `DATABASE_URL` via the Postgres plugin (Atlas internal DB). You only need to add `ATLAS_DATASOURCE_URL` for the analytics database.
|
|
233
|
+
|
|
234
|
+
5. Seed the database (choose one):
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
# Option A: Simple demo (3 tables, ~330 rows)
|
|
238
|
+
psql "$ATLAS_DATASOURCE_URL" < data/demo.sql
|
|
239
|
+
|
|
240
|
+
# Option B: Cybersec SaaS demo (62 tables, ~500K rows)
|
|
241
|
+
psql "$ATLAS_DATASOURCE_URL" < data/cybersec.sql
|
|
242
|
+
|
|
243
|
+
# Option C: Your own data (skip seeding, just generate semantic layer)
|
|
244
|
+
ATLAS_DATASOURCE_URL="$ATLAS_DATASOURCE_URL" bun run atlas -- init
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
6. Deploy -- Railway builds and starts the container automatically
|
|
248
|
+
|
|
249
|
+
### Configuration
|
|
250
|
+
|
|
251
|
+
The `examples/docker/railway.json` config sets:
|
|
252
|
+
|
|
253
|
+
- Dockerfile-based builds with `dockerfileContext: "../.."`
|
|
254
|
+
- Health check at `/api/health` with a 60-second timeout
|
|
255
|
+
- Restart on failure (max 10 retries)
|
|
256
|
+
|
|
257
|
+
### Verify
|
|
258
|
+
|
|
259
|
+
Railway exposes a public URL. Check health at `https://<your-app>.up.railway.app/api/health`.
|
|
260
|
+
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
## Render
|
|
264
|
+
|
|
265
|
+
Atlas includes a `render.yaml` Blueprint in `examples/docker/`.
|
|
266
|
+
|
|
267
|
+
### Steps
|
|
268
|
+
|
|
269
|
+
1. Go to the [Render Dashboard](https://dashboard.render.com/) and click **New > Blueprint**
|
|
270
|
+
2. Connect your GitHub repo -- Render reads `examples/docker/render.yaml`
|
|
271
|
+
3. Set the prompted environment variables:
|
|
272
|
+
- `ATLAS_DATASOURCE_URL` -- your analytics database connection string
|
|
273
|
+
- `ANTHROPIC_API_KEY` -- your API key
|
|
274
|
+
4. Deploy
|
|
275
|
+
|
|
276
|
+
### Using Render Postgres
|
|
277
|
+
|
|
278
|
+
1. Create a Render Postgres instance from the dashboard
|
|
279
|
+
2. Copy the **Internal Connection String**
|
|
280
|
+
3. Set it as `DATABASE_URL` (Atlas internal) and create a separate database for `ATLAS_DATASOURCE_URL` (analytics)
|
|
281
|
+
|
|
282
|
+
### Configuration
|
|
283
|
+
|
|
284
|
+
The `examples/docker/render.yaml` configures:
|
|
285
|
+
|
|
286
|
+
- Docker-based deployment using the example's Dockerfile
|
|
287
|
+
- Health check at `/api/health`
|
|
288
|
+
- Starter plan
|
|
289
|
+
- `ATLAS_PROVIDER` defaults to `anthropic`
|
|
290
|
+
- `autoDeploy` is disabled -- trigger deploys manually from the Render dashboard, or set `autoDeploy: true` in `render.yaml` to deploy on every push
|
|
291
|
+
|
|
292
|
+
### Verify
|
|
293
|
+
|
|
294
|
+
```bash
|
|
295
|
+
curl https://<your-app>.onrender.com/api/health
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
---
|
|
299
|
+
|
|
300
|
+
## Vercel
|
|
301
|
+
|
|
302
|
+
Atlas provides a Next.js standalone example that embeds the Hono API via a catch-all route — deploy to Vercel with zero infrastructure. The explore tool automatically uses Vercel Sandbox (Firecracker VM isolation) when running on Vercel.
|
|
303
|
+
|
|
304
|
+
### Scaffold a new project
|
|
305
|
+
|
|
306
|
+
```bash
|
|
307
|
+
bun create atlas-agent my-app --platform vercel
|
|
308
|
+
cd my-app
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
### Deploy from the monorepo
|
|
312
|
+
|
|
313
|
+
1. Import your repo in the [Vercel Dashboard](https://vercel.com/new)
|
|
314
|
+
2. Set **Root Directory** to `examples/nextjs-standalone`
|
|
315
|
+
3. Set environment variables:
|
|
316
|
+
|
|
317
|
+
```
|
|
318
|
+
# Option A: Vercel AI Gateway (recommended — single key, built-in observability)
|
|
319
|
+
ATLAS_PROVIDER=gateway
|
|
320
|
+
AI_GATEWAY_API_KEY=... # Create at https://vercel.com/~/ai/api-keys
|
|
321
|
+
|
|
322
|
+
# Option B: Direct provider
|
|
323
|
+
ATLAS_PROVIDER=anthropic
|
|
324
|
+
ANTHROPIC_API_KEY=sk-ant-...
|
|
325
|
+
|
|
326
|
+
# Required for both options
|
|
327
|
+
ATLAS_DATASOURCE_URL=postgresql://user:pass@host:5432/dbname
|
|
328
|
+
DATABASE_URL=postgresql://user:pass@host:5432/atlas
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
4. Deploy — `vercel.json` declares the Next.js framework for Vercel
|
|
332
|
+
|
|
333
|
+
### Configuration notes
|
|
334
|
+
|
|
335
|
+
- **`@vercel/sandbox`** — Auto-detected on Vercel via the `VERCEL` env var. The explore tool runs bash commands in a Firecracker microVM with `networkPolicy: "deny-all"` — no network access, ephemeral filesystem
|
|
336
|
+
- **AI Gateway** — `ATLAS_PROVIDER=gateway` routes through [Vercel's AI Gateway](https://vercel.com/docs/ai-gateway). Uses a single `AI_GATEWAY_API_KEY` to access Claude, GPT, and other major providers with usage tracking in the Vercel dashboard
|
|
337
|
+
- **`serverExternalPackages`** — `pg`, `mysql2`, `just-bash`, `pino`, `pino-pretty` are excluded from bundling (native bindings / worker threads)
|
|
338
|
+
- **`maxDuration`** — The catch-all route sets `maxDuration = 60` for multi-step agent loops. Increase based on your [Vercel plan](https://vercel.com/docs/functions/configuring-functions/duration) for complex queries that need more steps
|
|
339
|
+
- **No `output: "standalone"`** — Vercel uses its own build pipeline
|
|
340
|
+
|
|
341
|
+
### Semantic layer on Vercel
|
|
342
|
+
|
|
343
|
+
The `vercel.json` build command copies the demo semantic layer from `packages/cli/data/demo-semantic` into the project at build time (same approach the Docker builds use). For your own data, replace this with your generated semantic layer files.
|
|
344
|
+
|
|
345
|
+
### Verify
|
|
346
|
+
|
|
347
|
+
```bash
|
|
348
|
+
curl https://<your-app>.vercel.app/api/health
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
---
|
|
352
|
+
|
|
353
|
+
## Landing Page (apps/www)
|
|
354
|
+
|
|
355
|
+
The marketing site at `useatlas.dev` is a Next.js static export served by a lightweight Bun static file server. No nginx, no Docker.
|
|
356
|
+
|
|
357
|
+
### Architecture
|
|
358
|
+
|
|
359
|
+
```
|
|
360
|
+
Next.js (output: "export") → static HTML/CSS/JS in out/
|
|
361
|
+
Bun.serve() (serve.ts) → serves out/ with security headers + /health endpoint
|
|
362
|
+
Railway (NIXPACKS) → builds with bun, starts serve.ts
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
### Deploy to Railway
|
|
366
|
+
|
|
367
|
+
1. Connect your GitHub repo in Railway
|
|
368
|
+
2. Railway detects `apps/www/railway.json` — NIXPACKS builder
|
|
369
|
+
3. Build: `bun install && bun run --filter '@atlas/www' build`
|
|
370
|
+
4. Start: `cd apps/www && bun serve.ts`
|
|
371
|
+
5. No environment variables required (static site, no API calls)
|
|
372
|
+
|
|
373
|
+
### Local development
|
|
374
|
+
|
|
375
|
+
```bash
|
|
376
|
+
bun run dev:www # http://localhost:3002 (Turbopack dev server)
|
|
377
|
+
bun run build:www # Produces apps/www/out/
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
### Configuration
|
|
381
|
+
|
|
382
|
+
- **`serve.ts`** — Bun static file server with security headers (`X-Frame-Options: DENY`, `X-Content-Type-Options: nosniff`, `Referrer-Policy: strict-origin-when-cross-origin`), `/health` endpoint, and proper 404 responses
|
|
383
|
+
- **`railway.json`** — NIXPACKS builder, health check at `/health`, restart on failure
|
|
384
|
+
- **`PORT`** — Configurable via environment (default 8080)
|
|
385
|
+
|
|
386
|
+
### Verify
|
|
387
|
+
|
|
388
|
+
```bash
|
|
389
|
+
curl https://useatlas.dev/health
|
|
390
|
+
```
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import js from "@eslint/js";
|
|
2
|
+
import tseslint from "typescript-eslint";
|
|
3
|
+
import nextPlugin from "@next/eslint-plugin-next";
|
|
4
|
+
|
|
5
|
+
export default tseslint.config(
|
|
6
|
+
js.configs.recommended,
|
|
7
|
+
tseslint.configs.recommended,
|
|
8
|
+
{
|
|
9
|
+
plugins: { "@next/next": nextPlugin },
|
|
10
|
+
rules: {
|
|
11
|
+
...nextPlugin.configs.recommended.rules,
|
|
12
|
+
...nextPlugin.configs["core-web-vitals"].rules,
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
ignores: [".next/", "node_modules/"],
|
|
17
|
+
}
|
|
18
|
+
);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { NextConfig } from "next";
|
|
2
|
+
|
|
3
|
+
const nextConfig: NextConfig = {
|
|
4
|
+
// Vercel uses its own build pipeline — no `output: "standalone"` needed
|
|
5
|
+
serverExternalPackages: ["pg", "mysql2", "@clickhouse/client", "@duckdb/node-api", "snowflake-sdk", "jsforce", "just-bash", "pino", "pino-pretty"],
|
|
6
|
+
// Type checking is handled by `bun run type` (tsgo); skip during Next.js build
|
|
7
|
+
typescript: { ignoreBuildErrors: true },
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export default nextConfig;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "%PROJECT_NAME%",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"description": "Atlas text-to-SQL data analyst agent (Next.js + Vercel)",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "next dev --turbopack",
|
|
8
|
+
"build": "bun run type && next build",
|
|
9
|
+
"start": "next start",
|
|
10
|
+
"lint": "eslint src/",
|
|
11
|
+
"type": "tsgo --noEmit",
|
|
12
|
+
"atlas": "bun bin/atlas.ts",
|
|
13
|
+
"test": "bun test"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@ai-sdk/amazon-bedrock": "^4.0.63",
|
|
17
|
+
"@ai-sdk/anthropic": "^3.0.46",
|
|
18
|
+
"@ai-sdk/openai": "^3.0.31",
|
|
19
|
+
"@ai-sdk/react": "^3.0.99",
|
|
20
|
+
"ai": "^6.0.97",
|
|
21
|
+
"@better-auth/api-key": "^1.5.1",
|
|
22
|
+
"clsx": "^2.1.1",
|
|
23
|
+
"better-auth": "^1.5.1",
|
|
24
|
+
"hono": "^4.12.3",
|
|
25
|
+
"jose": "^6.1.3",
|
|
26
|
+
"js-yaml": "^4.1.1",
|
|
27
|
+
"just-bash": "^2.10.2",
|
|
28
|
+
"lucide-react": "^0.576.0",
|
|
29
|
+
"mysql2": "^3.18.0",
|
|
30
|
+
"next": "^16.1.6",
|
|
31
|
+
"node-sql-parser": "^5.4.0",
|
|
32
|
+
"pg": "^8.18.0",
|
|
33
|
+
"pino": "^10.3.1",
|
|
34
|
+
"pino-pretty": "^13.1.3",
|
|
35
|
+
"react": "^19.2.4",
|
|
36
|
+
"react-dom": "^19.2.4",
|
|
37
|
+
"react-markdown": "^10.1.0",
|
|
38
|
+
"react-syntax-highlighter": "^16.1.0",
|
|
39
|
+
"recharts": "^3.7.0",
|
|
40
|
+
"tailwind-merge": "^3.5.0",
|
|
41
|
+
"tw-animate-css": "^1.4.0",
|
|
42
|
+
"zod": "^4.3.6"
|
|
43
|
+
},
|
|
44
|
+
"optionalDependencies": {
|
|
45
|
+
"@vercel/sandbox": "^1"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@eslint/js": "^10.0.1",
|
|
49
|
+
"@next/eslint-plugin-next": "^16.1.6",
|
|
50
|
+
"@tailwindcss/postcss": "^4.2.1",
|
|
51
|
+
"@types/js-yaml": "^4.0.9",
|
|
52
|
+
"@types/node": "^25.3.2",
|
|
53
|
+
"@types/pg": "^8.16.0",
|
|
54
|
+
"@types/react": "^19.2.14",
|
|
55
|
+
"@types/react-dom": "^19.2.3",
|
|
56
|
+
"@types/react-syntax-highlighter": "^15.5.13",
|
|
57
|
+
"@typescript/native-preview": "^7.0.0-dev.20260226.1",
|
|
58
|
+
"eslint": "^10.0.2",
|
|
59
|
+
"tailwindcss": "^4.2.1",
|
|
60
|
+
"typescript": "^5.9.3",
|
|
61
|
+
"typescript-eslint": "^8.56.1"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
File without changes
|
|
File without changes
|