@useatlas/create 0.0.5 → 0.0.7
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/LICENSE +21 -0
- package/README.md +1 -1
- package/index.ts +253 -36
- package/package.json +4 -4
- package/templates/docker/Dockerfile +1 -1
- package/templates/docker/Dockerfile.sidecar +1 -1
- package/templates/docker/bin/__tests__/duckdb-ingest.test.ts +17 -14
- package/templates/docker/bin/__tests__/failure-threshold.test.ts +148 -0
- package/templates/docker/bin/__tests__/fatal-error-propagation.test.ts +267 -0
- package/templates/docker/bin/__tests__/profiler-heuristics.test.ts +5 -5
- package/templates/docker/bin/__tests__/schema-drift.test.ts +39 -0
- package/templates/docker/bin/atlas.ts +981 -1819
- package/templates/docker/bin/benchmark.ts +14 -16
- package/templates/docker/bin/enrich.ts +7 -2
- package/templates/docker/brand.css +13 -0
- package/templates/docker/data/cybersec-semantic/catalog.yml +222 -0
- package/templates/docker/data/cybersec-semantic/entities/alerts.yml +195 -0
- package/templates/docker/data/cybersec-semantic/entities/assets.yml +191 -0
- package/templates/docker/data/cybersec-semantic/entities/compliance_assessments.yml +170 -0
- package/templates/docker/data/cybersec-semantic/entities/incidents.yml +219 -0
- package/templates/docker/data/cybersec-semantic/entities/organizations.yml +136 -0
- package/templates/docker/data/cybersec-semantic/entities/plans.yml +114 -0
- package/templates/docker/data/cybersec-semantic/entities/remediation_actions.yml +212 -0
- package/templates/docker/data/cybersec-semantic/entities/scan_results.yml +215 -0
- package/templates/docker/data/cybersec-semantic/entities/scans.yml +180 -0
- package/templates/docker/data/cybersec-semantic/entities/subscriptions.yml +184 -0
- package/templates/docker/data/cybersec-semantic/entities/users.yml +140 -0
- package/templates/docker/data/cybersec-semantic/entities/vulnerabilities.yml +154 -0
- package/templates/docker/data/cybersec-semantic/glossary.yml +207 -0
- package/templates/docker/data/cybersec-semantic/metrics/business.yml +148 -0
- package/templates/docker/data/cybersec-semantic/metrics/compliance.yml +138 -0
- package/templates/docker/data/cybersec-semantic/metrics/security.yml +181 -0
- package/templates/docker/data/cybersec.sql +8 -8
- package/templates/docker/data/demo.sql +3 -0
- package/templates/docker/data/ecommerce-semantic/catalog.yml +221 -0
- package/templates/docker/data/ecommerce-semantic/entities/categories.yml +91 -0
- package/templates/docker/data/ecommerce-semantic/entities/customers.yml +133 -0
- package/templates/docker/data/ecommerce-semantic/entities/email_campaigns.yml +119 -0
- package/templates/docker/data/ecommerce-semantic/entities/inventory_levels.yml +153 -0
- package/templates/docker/data/ecommerce-semantic/entities/order_items.yml +159 -0
- package/templates/docker/data/ecommerce-semantic/entities/orders.yml +199 -0
- package/templates/docker/data/ecommerce-semantic/entities/payments.yml +140 -0
- package/templates/docker/data/ecommerce-semantic/entities/product_reviews.yml +155 -0
- package/templates/docker/data/ecommerce-semantic/entities/products.yml +178 -0
- package/templates/docker/data/ecommerce-semantic/entities/promotions.yml +171 -0
- package/templates/docker/data/ecommerce-semantic/entities/returns.yml +144 -0
- package/templates/docker/data/ecommerce-semantic/entities/sellers.yml +124 -0
- package/templates/docker/data/ecommerce-semantic/entities/shipments.yml +159 -0
- package/templates/docker/data/ecommerce-semantic/glossary.yml +193 -0
- package/templates/docker/data/ecommerce-semantic/metrics/customers.yml +116 -0
- package/templates/docker/data/ecommerce-semantic/metrics/operations.yml +131 -0
- package/templates/docker/data/ecommerce-semantic/metrics/revenue.yml +120 -0
- package/templates/docker/docs/deploy.md +2 -1
- package/templates/docker/ee/src/__mocks__/internal.ts +170 -0
- package/templates/docker/ee/src/audit/purge-scheduler.ts +113 -0
- package/templates/docker/ee/src/audit/retention.ts +467 -0
- package/templates/docker/ee/src/auth/ip-allowlist.ts +367 -0
- package/templates/docker/ee/src/auth/roles.ts +562 -0
- package/templates/docker/ee/src/auth/scim.ts +343 -0
- package/templates/docker/ee/src/auth/sso.ts +538 -0
- package/templates/docker/ee/src/backups/engine.ts +355 -0
- package/templates/docker/ee/src/backups/index.ts +26 -0
- package/templates/docker/ee/src/backups/restore.ts +169 -0
- package/templates/docker/ee/src/backups/scheduler.ts +153 -0
- package/templates/docker/ee/src/backups/verify.ts +124 -0
- package/templates/docker/ee/src/branding/white-label.ts +228 -0
- package/templates/docker/ee/src/compliance/masking.ts +477 -0
- package/templates/docker/ee/src/compliance/patterns.ts +16 -0
- package/templates/docker/ee/src/compliance/pii-detection.ts +217 -0
- package/templates/docker/ee/src/compliance/reports.ts +402 -0
- package/templates/docker/ee/src/deploy-mode.ts +37 -0
- package/templates/docker/ee/src/governance/approval.ts +699 -0
- package/templates/docker/ee/src/index.ts +74 -0
- package/templates/docker/ee/src/platform/domains.ts +562 -0
- package/templates/docker/ee/src/platform/model-routing.ts +382 -0
- package/templates/docker/ee/src/platform/residency.ts +265 -0
- package/templates/docker/ee/src/sla/alerting.ts +382 -0
- package/templates/docker/ee/src/sla/index.ts +12 -0
- package/templates/docker/ee/src/sla/metrics.ts +275 -0
- package/templates/docker/ee/src/test-setup.ts +1 -0
- package/templates/docker/next.config.ts +4 -1
- package/templates/docker/package.json +49 -29
- package/templates/docker/sidecar/Dockerfile +1 -1
- package/templates/docker/src/api/index.ts +336 -24
- package/templates/docker/src/api/routes/actions.ts +443 -176
- package/templates/docker/src/api/routes/admin-abuse.ts +219 -0
- package/templates/docker/src/api/routes/admin-approval.ts +418 -0
- package/templates/docker/src/api/routes/admin-audit-retention.ts +405 -0
- package/templates/docker/src/api/routes/admin-auth.ts +122 -0
- package/templates/docker/src/api/routes/admin-branding.ts +252 -0
- package/templates/docker/src/api/routes/admin-compliance.ts +352 -0
- package/templates/docker/src/api/routes/admin-domains.ts +334 -0
- package/templates/docker/src/api/routes/admin-integrations.ts +2667 -0
- package/templates/docker/src/api/routes/admin-ip-allowlist.ts +261 -0
- package/templates/docker/src/api/routes/admin-learned-patterns.ts +525 -0
- package/templates/docker/src/api/routes/admin-model-config.ts +252 -0
- package/templates/docker/src/api/routes/admin-onboarding-emails.ts +145 -0
- package/templates/docker/src/api/routes/admin-orgs.ts +710 -0
- package/templates/docker/src/api/routes/admin-prompts.ts +694 -0
- package/templates/docker/src/api/routes/admin-residency.ts +570 -0
- package/templates/docker/src/api/routes/admin-roles.ts +296 -0
- package/templates/docker/src/api/routes/admin-router.ts +120 -0
- package/templates/docker/src/api/routes/admin-sandbox.ts +417 -0
- package/templates/docker/src/api/routes/admin-scim.ts +262 -0
- package/templates/docker/src/api/routes/admin-sso.ts +545 -0
- package/templates/docker/src/api/routes/admin-suggestions.ts +176 -0
- package/templates/docker/src/api/routes/admin-usage.ts +310 -0
- package/templates/docker/src/api/routes/admin.ts +4156 -898
- package/templates/docker/src/api/routes/auth-preamble.ts +105 -0
- package/templates/docker/src/api/routes/billing.ts +397 -0
- package/templates/docker/src/api/routes/chat.ts +597 -334
- package/templates/docker/src/api/routes/conversations.ts +987 -132
- package/templates/docker/src/api/routes/demo.ts +673 -0
- package/templates/docker/src/api/routes/discord.ts +274 -0
- package/templates/docker/src/api/routes/ee-error-handler.ts +32 -0
- package/templates/docker/src/api/routes/health.ts +129 -14
- package/templates/docker/src/api/routes/middleware.ts +244 -0
- package/templates/docker/src/api/routes/onboarding-emails.ts +134 -0
- package/templates/docker/src/api/routes/onboarding.ts +1109 -0
- package/templates/docker/src/api/routes/openapi.ts +184 -1597
- package/templates/docker/src/api/routes/platform-admin.ts +760 -0
- package/templates/docker/src/api/routes/platform-backups.ts +436 -0
- package/templates/docker/src/api/routes/platform-domains.ts +235 -0
- package/templates/docker/src/api/routes/platform-residency.ts +257 -0
- package/templates/docker/src/api/routes/platform-sla.ts +379 -0
- package/templates/docker/src/api/routes/prompts.ts +221 -0
- package/templates/docker/src/api/routes/public-branding.ts +106 -0
- package/templates/docker/src/api/routes/query.ts +330 -219
- package/templates/docker/src/api/routes/scheduled-tasks.ts +393 -297
- package/templates/docker/src/api/routes/semantic.ts +179 -0
- package/templates/docker/src/api/routes/sessions.ts +210 -0
- package/templates/docker/src/api/routes/shared-domains.ts +98 -0
- package/templates/docker/src/api/routes/shared-schemas.ts +139 -0
- package/templates/docker/src/api/routes/slack.ts +209 -52
- package/templates/docker/src/api/routes/suggestions.ts +233 -0
- package/templates/docker/src/api/routes/tables.ts +67 -0
- package/templates/docker/src/api/routes/teams.ts +222 -0
- package/templates/docker/src/api/routes/validate-sql.ts +188 -0
- package/templates/docker/src/api/routes/validation-hook.ts +62 -0
- package/templates/docker/src/api/routes/widget-loader.ts +356 -0
- package/templates/docker/src/api/routes/widget.ts +428 -0
- package/templates/docker/src/api/routes/wizard.ts +852 -0
- package/templates/docker/src/api/server.ts +187 -69
- package/templates/docker/src/app/error.tsx +5 -2
- package/templates/docker/src/app/globals.css +1 -1
- package/templates/docker/src/app/layout.tsx +7 -2
- package/templates/docker/src/app/page.tsx +39 -5
- package/templates/docker/src/components/data-table/data-table-column-header.tsx +99 -0
- package/templates/docker/src/components/data-table/data-table-date-filter.tsx +225 -0
- package/templates/docker/src/components/data-table/data-table-expandable.tsx +125 -0
- package/templates/docker/src/components/data-table/data-table-faceted-filter.tsx +189 -0
- package/templates/docker/src/components/data-table/data-table-pagination.tsx +112 -0
- package/templates/docker/src/components/data-table/data-table-range-filter.tsx +122 -0
- package/templates/docker/src/components/data-table/data-table-slider-filter.tsx +256 -0
- package/templates/docker/src/components/data-table/data-table-sort-list.tsx +407 -0
- package/templates/docker/src/components/data-table/data-table-toolbar.tsx +149 -0
- package/templates/docker/src/components/data-table/data-table-view-options.tsx +89 -0
- package/templates/docker/src/components/data-table/data-table.tsx +105 -0
- package/templates/docker/src/components/form-dialog.tsx +135 -0
- package/templates/docker/src/components/ui/accordion.tsx +66 -0
- package/templates/docker/src/components/ui/calendar.tsx +220 -0
- package/templates/docker/src/components/ui/checkbox.tsx +32 -0
- package/templates/docker/src/components/ui/faceted.tsx +283 -0
- package/templates/docker/src/components/ui/form.tsx +167 -0
- package/templates/docker/src/components/ui/label.tsx +24 -0
- package/templates/docker/src/components/ui/popover.tsx +89 -0
- package/templates/docker/src/components/ui/progress.tsx +31 -0
- package/templates/docker/src/components/ui/scroll-area.tsx +6 -2
- package/templates/docker/src/components/ui/slider.tsx +63 -0
- package/templates/docker/src/components/ui/sortable.tsx +581 -0
- package/templates/docker/src/components/ui/switch.tsx +35 -0
- package/templates/docker/src/components/ui/textarea.tsx +18 -0
- package/templates/docker/src/config/data-table.ts +82 -0
- package/templates/docker/src/env-check.ts +74 -0
- package/templates/docker/src/hooks/use-callback-ref.ts +27 -0
- package/templates/docker/src/hooks/use-data-table.ts +316 -0
- package/templates/docker/src/hooks/use-debounced-callback.ts +28 -0
- package/templates/docker/src/lib/action-types.ts +7 -41
- package/templates/docker/src/lib/agent-query.ts +4 -2
- package/templates/docker/src/lib/agent.ts +363 -31
- package/templates/docker/src/lib/auth/admin-permissions.ts +38 -0
- package/templates/docker/src/lib/auth/audit.ts +19 -4
- package/templates/docker/src/lib/auth/byot.ts +3 -3
- package/templates/docker/src/lib/auth/client.ts +33 -3
- package/templates/docker/src/lib/auth/detect.ts +29 -8
- package/templates/docker/src/lib/auth/managed.ts +104 -14
- package/templates/docker/src/lib/auth/middleware.ts +53 -6
- package/templates/docker/src/lib/auth/migrate.ts +140 -15
- package/templates/docker/src/lib/auth/oauth-state.ts +123 -0
- package/templates/docker/src/lib/auth/org-permissions.ts +55 -0
- package/templates/docker/src/lib/auth/permissions.ts +26 -19
- package/templates/docker/src/lib/auth/server.ts +355 -9
- package/templates/docker/src/lib/auth/simple-key.ts +3 -3
- package/templates/docker/src/lib/auth/types.ts +15 -21
- package/templates/docker/src/lib/billing/enforcement.ts +368 -0
- package/templates/docker/src/lib/billing/plans.ts +155 -0
- package/templates/docker/src/lib/cache/index.ts +92 -0
- package/templates/docker/src/lib/cache/keys.ts +30 -0
- package/templates/docker/src/lib/cache/lru.ts +79 -0
- package/templates/docker/src/lib/cache/types.ts +31 -0
- package/templates/docker/src/lib/compose-refs.ts +62 -0
- package/templates/docker/src/lib/config.ts +563 -11
- package/templates/docker/src/lib/connection-types.ts +9 -0
- package/templates/docker/src/lib/conversation-types.ts +1 -25
- package/templates/docker/src/lib/conversations.ts +345 -14
- package/templates/docker/src/lib/data-table.ts +61 -0
- package/templates/docker/src/lib/db/connection.ts +793 -39
- package/templates/docker/src/lib/db/internal.ts +985 -139
- package/templates/docker/src/lib/db/migrate.ts +295 -0
- package/templates/docker/src/lib/db/migrations/0000_baseline.sql +703 -0
- package/templates/docker/src/lib/db/migrations/0001_teams_installations.sql +14 -0
- package/templates/docker/src/lib/db/migrations/0002_discord_installations.sql +14 -0
- package/templates/docker/src/lib/db/migrations/0003_telegram_installations.sql +15 -0
- package/templates/docker/src/lib/db/migrations/0004_sandbox_credentials.sql +18 -0
- package/templates/docker/src/lib/db/migrations/0005_oauth_state.sql +16 -0
- package/templates/docker/src/lib/db/migrations/0006_byot_credentials.sql +14 -0
- package/templates/docker/src/lib/db/migrations/0007_gchat_installations.sql +15 -0
- package/templates/docker/src/lib/db/migrations/0008_github_installations.sql +14 -0
- package/templates/docker/src/lib/db/migrations/0009_linear_installations.sql +15 -0
- package/templates/docker/src/lib/db/migrations/0010_whatsapp_installations.sql +14 -0
- package/templates/docker/src/lib/db/migrations/0011_email_installations.sql +16 -0
- package/templates/docker/src/lib/db/migrations/0012_region_migrations.sql +25 -0
- package/templates/docker/src/lib/db/schema.ts +1120 -0
- package/templates/docker/src/lib/db/source-rate-limit.ts +89 -139
- package/templates/docker/src/lib/demo.ts +308 -0
- package/templates/docker/src/lib/discord/store.ts +225 -0
- package/templates/docker/src/lib/effect/ai.ts +243 -0
- package/templates/docker/src/lib/effect/errors.ts +234 -0
- package/templates/docker/src/lib/effect/hono.ts +454 -0
- package/templates/docker/src/lib/effect/index.ts +137 -0
- package/templates/docker/src/lib/effect/layers.ts +496 -0
- package/templates/docker/src/lib/effect/services.ts +776 -0
- package/templates/docker/src/lib/effect/sql.ts +178 -0
- package/templates/docker/src/lib/effect/toolkit.ts +123 -0
- package/templates/docker/src/lib/email/delivery.ts +232 -0
- package/templates/docker/src/lib/email/engine.ts +349 -0
- package/templates/docker/src/lib/email/hooks.ts +107 -0
- package/templates/docker/src/lib/email/index.ts +16 -0
- package/templates/docker/src/lib/email/scheduler.ts +72 -0
- package/templates/docker/src/lib/email/sequence.ts +73 -0
- package/templates/docker/src/lib/email/store.ts +163 -0
- package/templates/docker/src/lib/email/templates.ts +215 -0
- package/templates/docker/src/lib/format.ts +67 -0
- package/templates/docker/src/lib/gchat/store.ts +202 -0
- package/templates/docker/src/lib/github/store.ts +197 -0
- package/templates/docker/src/lib/id.ts +29 -0
- package/templates/docker/src/lib/integrations/types.ts +166 -0
- package/templates/docker/src/lib/learn/pattern-analyzer.ts +224 -0
- package/templates/docker/src/lib/learn/pattern-cache.ts +229 -0
- package/templates/docker/src/lib/learn/pattern-proposer.ts +87 -0
- package/templates/docker/src/lib/learn/suggestion-helpers.ts +34 -0
- package/templates/docker/src/lib/learn/suggestions.ts +139 -0
- package/templates/docker/src/lib/linear/store.ts +200 -0
- package/templates/docker/src/lib/logger.ts +35 -3
- package/templates/docker/src/lib/metering.ts +272 -0
- package/templates/docker/src/lib/parsers.ts +99 -0
- package/templates/docker/src/lib/plugins/hooks.ts +13 -11
- package/templates/docker/src/lib/plugins/index.ts +3 -1
- package/templates/docker/src/lib/plugins/registry.ts +58 -6
- package/templates/docker/src/lib/plugins/settings.ts +147 -0
- package/templates/docker/src/lib/plugins/wiring.ts +6 -9
- package/templates/docker/src/lib/profiler.ts +1665 -0
- package/templates/docker/src/lib/providers.ts +188 -13
- package/templates/docker/src/lib/rls.ts +172 -60
- package/templates/docker/src/lib/sandbox/credentials.ts +206 -0
- package/templates/docker/src/lib/sandbox/validate.ts +179 -0
- package/templates/docker/src/lib/scheduled-task-types.ts +26 -94
- package/templates/docker/src/lib/scheduled-tasks.ts +174 -34
- package/templates/docker/src/lib/scheduler/delivery.ts +248 -150
- package/templates/docker/src/lib/scheduler/engine.ts +190 -154
- package/templates/docker/src/lib/scheduler/executor.ts +74 -23
- package/templates/docker/src/lib/scheduler/preview.ts +72 -0
- package/templates/docker/src/lib/security/abuse.ts +463 -0
- package/templates/docker/src/lib/semantic/diff.ts +267 -0
- package/templates/docker/src/lib/semantic/entities.ts +167 -0
- package/templates/docker/src/lib/semantic/files.ts +283 -0
- package/templates/docker/src/lib/semantic/index.ts +27 -0
- package/templates/docker/src/lib/{semantic-index.ts → semantic/search.ts} +80 -9
- package/templates/docker/src/lib/semantic/sync.ts +581 -0
- package/templates/docker/src/lib/{semantic.ts → semantic/whitelist.ts} +189 -3
- package/templates/docker/src/lib/settings.ts +817 -0
- package/templates/docker/src/lib/sidecar-types.ts +13 -0
- package/templates/docker/src/lib/slack/store.ts +134 -25
- package/templates/docker/src/lib/startup.ts +528 -362
- package/templates/docker/src/lib/teams/store.ts +216 -0
- package/templates/docker/src/lib/telegram/store.ts +202 -0
- package/templates/docker/src/lib/telemetry.ts +40 -0
- package/templates/docker/src/lib/tools/actions/audit.ts +8 -5
- package/templates/docker/src/lib/tools/actions/email.ts +3 -1
- package/templates/docker/src/lib/tools/actions/handler.ts +276 -93
- package/templates/docker/src/lib/tools/actions/jira.ts +2 -2
- package/templates/docker/src/lib/tools/backends/detect.ts +16 -0
- package/templates/docker/src/lib/tools/backends/index.ts +11 -0
- package/templates/docker/src/lib/tools/backends/nsjail.ts +213 -0
- package/templates/docker/src/lib/tools/backends/shared.ts +103 -0
- package/templates/docker/src/lib/tools/backends/types.ts +26 -0
- package/templates/docker/src/lib/tools/explore-nsjail.ts +7 -228
- package/templates/docker/src/lib/tools/explore-sandbox.ts +4 -29
- package/templates/docker/src/lib/tools/explore-sidecar.ts +18 -2
- package/templates/docker/src/lib/tools/explore.ts +246 -54
- package/templates/docker/src/lib/tools/index.ts +17 -0
- package/templates/docker/src/lib/tools/python-nsjail.ts +11 -139
- package/templates/docker/src/lib/tools/python-sandbox.ts +9 -132
- package/templates/docker/src/lib/tools/python-sidecar.ts +184 -3
- package/templates/docker/src/lib/tools/python-stream.ts +33 -0
- package/templates/docker/src/lib/tools/python-wrapper.ts +129 -0
- package/templates/docker/src/lib/tools/python.ts +115 -15
- package/templates/docker/src/lib/tools/registry.ts +14 -2
- package/templates/docker/src/lib/tools/sql.ts +778 -362
- package/templates/docker/src/lib/tracing.ts +16 -0
- package/templates/docker/src/lib/whatsapp/store.ts +198 -0
- package/templates/docker/src/lib/workspace.ts +89 -0
- package/templates/docker/src/progress.ts +121 -0
- package/templates/docker/src/types/data-table.ts +48 -0
- package/templates/docker/src/ui/atlas-chat-reexport.ts +3 -0
- package/templates/docker/src/ui/components/actions/action-approval-card.tsx +26 -19
- package/templates/docker/src/ui/components/actions/action-status-badge.tsx +3 -3
- package/templates/docker/src/ui/components/admin/admin-layout.tsx +57 -39
- package/templates/docker/src/ui/components/admin/admin-sidebar.tsx +213 -35
- package/templates/docker/src/ui/components/admin/delivery-status-badge.tsx +53 -0
- package/templates/docker/src/ui/components/admin/empty-state.tsx +27 -6
- package/templates/docker/src/ui/components/admin/entity-detail.tsx +3 -52
- package/templates/docker/src/ui/components/admin/error-banner.tsx +2 -2
- package/templates/docker/src/ui/components/admin/feature-disabled.tsx +28 -5
- package/templates/docker/src/ui/components/admin-content-wrapper.tsx +87 -0
- package/templates/docker/src/ui/components/atlas-chat.tsx +449 -166
- package/templates/docker/src/ui/components/branding-head.tsx +41 -0
- package/templates/docker/src/ui/components/chart/chart-detection.ts +62 -5
- package/templates/docker/src/ui/components/chart/result-chart.tsx +316 -125
- package/templates/docker/src/ui/components/chat/api-key-bar.tsx +4 -4
- package/templates/docker/src/ui/components/chat/data-table.tsx +45 -4
- package/templates/docker/src/ui/components/chat/error-banner.tsx +86 -5
- package/templates/docker/src/ui/components/chat/follow-up-chips.tsx +29 -0
- package/templates/docker/src/ui/components/chat/markdown.tsx +24 -0
- package/templates/docker/src/ui/components/chat/prompt-library.tsx +206 -0
- package/templates/docker/src/ui/components/chat/python-result-card.tsx +106 -78
- package/templates/docker/src/ui/components/chat/result-card-base.tsx +101 -0
- package/templates/docker/src/ui/components/chat/share-dialog.tsx +377 -0
- package/templates/docker/src/ui/components/chat/sql-result-card.tsx +94 -73
- package/templates/docker/src/ui/components/chat/suggestion-chips.tsx +46 -0
- package/templates/docker/src/ui/components/chat/tool-part.tsx +16 -4
- package/templates/docker/src/ui/components/conversations/conversation-item.tsx +48 -17
- package/templates/docker/src/ui/components/conversations/conversation-list.tsx +38 -24
- package/templates/docker/src/ui/components/conversations/conversation-sidebar.tsx +66 -7
- package/templates/docker/src/ui/components/conversations/delete-confirmation.tsx +9 -2
- package/templates/docker/src/ui/components/error-boundary.tsx +66 -0
- package/templates/docker/src/ui/components/notebook/delete-cell-dialog.tsx +48 -0
- package/templates/docker/src/ui/components/notebook/fork-branch-selector.tsx +68 -0
- package/templates/docker/src/ui/components/notebook/notebook-cell-input.tsx +76 -0
- package/templates/docker/src/ui/components/notebook/notebook-cell-output.tsx +58 -0
- package/templates/docker/src/ui/components/notebook/notebook-cell-toolbar.tsx +91 -0
- package/templates/docker/src/ui/components/notebook/notebook-cell.tsx +119 -0
- package/templates/docker/src/ui/components/notebook/notebook-empty-state.tsx +19 -0
- package/templates/docker/src/ui/components/notebook/notebook-export.ts +287 -0
- package/templates/docker/src/ui/components/notebook/notebook-input-bar.tsx +49 -0
- package/templates/docker/src/ui/components/notebook/notebook-shell.tsx +266 -0
- package/templates/docker/src/ui/components/notebook/notebook-text-cell.tsx +152 -0
- package/templates/docker/src/ui/components/notebook/types.ts +39 -0
- package/templates/docker/src/ui/components/notebook/use-keyboard-nav.ts +109 -0
- package/templates/docker/src/ui/components/notebook/use-notebook.ts +684 -0
- package/templates/docker/src/ui/components/org-switcher.tsx +111 -0
- package/templates/docker/src/ui/components/region-picker.tsx +103 -0
- package/templates/docker/src/ui/components/schema-explorer/schema-explorer.tsx +522 -0
- package/templates/docker/src/ui/components/social-icons.tsx +26 -0
- package/templates/docker/src/ui/components/tour/guided-tour.tsx +81 -0
- package/templates/docker/src/ui/components/tour/index.ts +5 -0
- package/templates/docker/src/ui/components/tour/nav-bar.tsx +100 -0
- package/templates/docker/src/ui/components/tour/tour-overlay.tsx +298 -0
- package/templates/docker/src/ui/components/tour/tour-steps.ts +43 -0
- package/templates/docker/src/ui/components/tour/types.ts +21 -0
- package/templates/docker/src/ui/components/tour/use-tour.ts +193 -0
- package/templates/docker/src/ui/context-reexport.ts +3 -0
- package/templates/docker/src/ui/hooks/theme-init-script.ts +17 -0
- package/templates/docker/src/ui/hooks/use-admin-fetch.ts +38 -30
- package/templates/docker/src/ui/hooks/use-admin-mutation.ts +188 -0
- package/templates/docker/src/ui/hooks/use-atlas-transport.ts +225 -0
- package/templates/docker/src/ui/hooks/use-branding.ts +68 -0
- package/templates/docker/src/ui/hooks/use-conversations.ts +106 -83
- package/templates/docker/src/ui/hooks/use-dark-mode.ts +134 -10
- package/templates/docker/src/ui/hooks/use-deploy-mode.ts +36 -0
- package/templates/docker/src/ui/hooks/use-platform-admin-guard.ts +49 -0
- package/templates/docker/src/ui/lib/action-types.ts +11 -63
- package/templates/docker/src/ui/lib/admin-schemas.ts +744 -0
- package/templates/docker/src/ui/lib/fetch-client.ts +84 -0
- package/templates/docker/src/ui/lib/fetch-error.ts +54 -0
- package/templates/docker/src/ui/lib/helpers.ts +94 -1
- package/templates/docker/src/ui/lib/types.ts +149 -140
- package/templates/docker/tsconfig.json +4 -2
- package/templates/nextjs-standalone/bin/__tests__/duckdb-ingest.test.ts +17 -14
- package/templates/nextjs-standalone/bin/__tests__/failure-threshold.test.ts +148 -0
- package/templates/nextjs-standalone/bin/__tests__/fatal-error-propagation.test.ts +267 -0
- package/templates/nextjs-standalone/bin/__tests__/profiler-heuristics.test.ts +5 -5
- package/templates/nextjs-standalone/bin/__tests__/schema-drift.test.ts +39 -0
- package/templates/nextjs-standalone/bin/atlas.ts +981 -1819
- package/templates/nextjs-standalone/bin/benchmark.ts +14 -16
- package/templates/nextjs-standalone/bin/enrich.ts +7 -2
- package/templates/nextjs-standalone/brand.css +13 -0
- package/templates/nextjs-standalone/data/cybersec-semantic/catalog.yml +222 -0
- package/templates/nextjs-standalone/data/cybersec-semantic/entities/alerts.yml +195 -0
- package/templates/nextjs-standalone/data/cybersec-semantic/entities/assets.yml +191 -0
- package/templates/nextjs-standalone/data/cybersec-semantic/entities/compliance_assessments.yml +170 -0
- package/templates/nextjs-standalone/data/cybersec-semantic/entities/incidents.yml +219 -0
- package/templates/nextjs-standalone/data/cybersec-semantic/entities/organizations.yml +136 -0
- package/templates/nextjs-standalone/data/cybersec-semantic/entities/plans.yml +114 -0
- package/templates/nextjs-standalone/data/cybersec-semantic/entities/remediation_actions.yml +212 -0
- package/templates/nextjs-standalone/data/cybersec-semantic/entities/scan_results.yml +215 -0
- package/templates/nextjs-standalone/data/cybersec-semantic/entities/scans.yml +180 -0
- package/templates/nextjs-standalone/data/cybersec-semantic/entities/subscriptions.yml +184 -0
- package/templates/nextjs-standalone/data/cybersec-semantic/entities/users.yml +140 -0
- package/templates/nextjs-standalone/data/cybersec-semantic/entities/vulnerabilities.yml +154 -0
- package/templates/nextjs-standalone/data/cybersec-semantic/glossary.yml +207 -0
- package/templates/nextjs-standalone/data/cybersec-semantic/metrics/business.yml +148 -0
- package/templates/nextjs-standalone/data/cybersec-semantic/metrics/compliance.yml +138 -0
- package/templates/nextjs-standalone/data/cybersec-semantic/metrics/security.yml +181 -0
- package/templates/nextjs-standalone/data/cybersec.sql +8 -8
- package/templates/nextjs-standalone/data/demo.sql +3 -0
- package/templates/nextjs-standalone/data/ecommerce-semantic/catalog.yml +221 -0
- package/templates/nextjs-standalone/data/ecommerce-semantic/entities/categories.yml +91 -0
- package/templates/nextjs-standalone/data/ecommerce-semantic/entities/customers.yml +133 -0
- package/templates/nextjs-standalone/data/ecommerce-semantic/entities/email_campaigns.yml +119 -0
- package/templates/nextjs-standalone/data/ecommerce-semantic/entities/inventory_levels.yml +153 -0
- package/templates/nextjs-standalone/data/ecommerce-semantic/entities/order_items.yml +159 -0
- package/templates/nextjs-standalone/data/ecommerce-semantic/entities/orders.yml +199 -0
- package/templates/nextjs-standalone/data/ecommerce-semantic/entities/payments.yml +140 -0
- package/templates/nextjs-standalone/data/ecommerce-semantic/entities/product_reviews.yml +155 -0
- package/templates/nextjs-standalone/data/ecommerce-semantic/entities/products.yml +178 -0
- package/templates/nextjs-standalone/data/ecommerce-semantic/entities/promotions.yml +171 -0
- package/templates/nextjs-standalone/data/ecommerce-semantic/entities/returns.yml +144 -0
- package/templates/nextjs-standalone/data/ecommerce-semantic/entities/sellers.yml +124 -0
- package/templates/nextjs-standalone/data/ecommerce-semantic/entities/shipments.yml +159 -0
- package/templates/nextjs-standalone/data/ecommerce-semantic/glossary.yml +193 -0
- package/templates/nextjs-standalone/data/ecommerce-semantic/metrics/customers.yml +116 -0
- package/templates/nextjs-standalone/data/ecommerce-semantic/metrics/operations.yml +131 -0
- package/templates/nextjs-standalone/data/ecommerce-semantic/metrics/revenue.yml +120 -0
- package/templates/nextjs-standalone/docs/deploy.md +2 -1
- package/templates/nextjs-standalone/ee/src/__mocks__/internal.ts +170 -0
- package/templates/nextjs-standalone/ee/src/audit/purge-scheduler.ts +113 -0
- package/templates/nextjs-standalone/ee/src/audit/retention.ts +467 -0
- package/templates/nextjs-standalone/ee/src/auth/ip-allowlist.ts +367 -0
- package/templates/nextjs-standalone/ee/src/auth/roles.ts +562 -0
- package/templates/nextjs-standalone/ee/src/auth/scim.ts +343 -0
- package/templates/nextjs-standalone/ee/src/auth/sso.ts +538 -0
- package/templates/nextjs-standalone/ee/src/backups/engine.ts +355 -0
- package/templates/nextjs-standalone/ee/src/backups/index.ts +26 -0
- package/templates/nextjs-standalone/ee/src/backups/restore.ts +169 -0
- package/templates/nextjs-standalone/ee/src/backups/scheduler.ts +153 -0
- package/templates/nextjs-standalone/ee/src/backups/verify.ts +124 -0
- package/templates/nextjs-standalone/ee/src/branding/white-label.ts +228 -0
- package/templates/nextjs-standalone/ee/src/compliance/masking.ts +477 -0
- package/templates/nextjs-standalone/ee/src/compliance/patterns.ts +16 -0
- package/templates/nextjs-standalone/ee/src/compliance/pii-detection.ts +217 -0
- package/templates/nextjs-standalone/ee/src/compliance/reports.ts +402 -0
- package/templates/nextjs-standalone/ee/src/deploy-mode.ts +37 -0
- package/templates/nextjs-standalone/ee/src/governance/approval.ts +699 -0
- package/templates/nextjs-standalone/ee/src/index.ts +74 -0
- package/templates/nextjs-standalone/ee/src/platform/domains.ts +562 -0
- package/templates/nextjs-standalone/ee/src/platform/model-routing.ts +382 -0
- package/templates/nextjs-standalone/ee/src/platform/residency.ts +265 -0
- package/templates/nextjs-standalone/ee/src/sla/alerting.ts +382 -0
- package/templates/nextjs-standalone/ee/src/sla/index.ts +12 -0
- package/templates/nextjs-standalone/ee/src/sla/metrics.ts +275 -0
- package/templates/nextjs-standalone/ee/src/test-setup.ts +1 -0
- package/templates/nextjs-standalone/next.config.ts +1 -1
- package/templates/nextjs-standalone/package.json +50 -30
- package/templates/nextjs-standalone/src/api/index.ts +336 -24
- package/templates/nextjs-standalone/src/api/routes/actions.ts +443 -176
- package/templates/nextjs-standalone/src/api/routes/admin-abuse.ts +219 -0
- package/templates/nextjs-standalone/src/api/routes/admin-approval.ts +418 -0
- package/templates/nextjs-standalone/src/api/routes/admin-audit-retention.ts +405 -0
- package/templates/nextjs-standalone/src/api/routes/admin-auth.ts +122 -0
- package/templates/nextjs-standalone/src/api/routes/admin-branding.ts +252 -0
- package/templates/nextjs-standalone/src/api/routes/admin-compliance.ts +352 -0
- package/templates/nextjs-standalone/src/api/routes/admin-domains.ts +334 -0
- package/templates/nextjs-standalone/src/api/routes/admin-integrations.ts +2667 -0
- package/templates/nextjs-standalone/src/api/routes/admin-ip-allowlist.ts +261 -0
- package/templates/nextjs-standalone/src/api/routes/admin-learned-patterns.ts +525 -0
- package/templates/nextjs-standalone/src/api/routes/admin-model-config.ts +252 -0
- package/templates/nextjs-standalone/src/api/routes/admin-onboarding-emails.ts +145 -0
- package/templates/nextjs-standalone/src/api/routes/admin-orgs.ts +710 -0
- package/templates/nextjs-standalone/src/api/routes/admin-prompts.ts +694 -0
- package/templates/nextjs-standalone/src/api/routes/admin-residency.ts +570 -0
- package/templates/nextjs-standalone/src/api/routes/admin-roles.ts +296 -0
- package/templates/nextjs-standalone/src/api/routes/admin-router.ts +120 -0
- package/templates/nextjs-standalone/src/api/routes/admin-sandbox.ts +417 -0
- package/templates/nextjs-standalone/src/api/routes/admin-scim.ts +262 -0
- package/templates/nextjs-standalone/src/api/routes/admin-sso.ts +545 -0
- package/templates/nextjs-standalone/src/api/routes/admin-suggestions.ts +176 -0
- package/templates/nextjs-standalone/src/api/routes/admin-usage.ts +310 -0
- package/templates/nextjs-standalone/src/api/routes/admin.ts +4156 -898
- package/templates/nextjs-standalone/src/api/routes/auth-preamble.ts +105 -0
- package/templates/nextjs-standalone/src/api/routes/billing.ts +397 -0
- package/templates/nextjs-standalone/src/api/routes/chat.ts +597 -334
- package/templates/nextjs-standalone/src/api/routes/conversations.ts +987 -132
- package/templates/nextjs-standalone/src/api/routes/demo.ts +673 -0
- package/templates/nextjs-standalone/src/api/routes/discord.ts +274 -0
- package/templates/nextjs-standalone/src/api/routes/ee-error-handler.ts +32 -0
- package/templates/nextjs-standalone/src/api/routes/health.ts +129 -14
- package/templates/nextjs-standalone/src/api/routes/middleware.ts +244 -0
- package/templates/nextjs-standalone/src/api/routes/onboarding-emails.ts +134 -0
- package/templates/nextjs-standalone/src/api/routes/onboarding.ts +1109 -0
- package/templates/nextjs-standalone/src/api/routes/openapi.ts +184 -1597
- package/templates/nextjs-standalone/src/api/routes/platform-admin.ts +760 -0
- package/templates/nextjs-standalone/src/api/routes/platform-backups.ts +436 -0
- package/templates/nextjs-standalone/src/api/routes/platform-domains.ts +235 -0
- package/templates/nextjs-standalone/src/api/routes/platform-residency.ts +257 -0
- package/templates/nextjs-standalone/src/api/routes/platform-sla.ts +379 -0
- package/templates/nextjs-standalone/src/api/routes/prompts.ts +221 -0
- package/templates/nextjs-standalone/src/api/routes/public-branding.ts +106 -0
- package/templates/nextjs-standalone/src/api/routes/query.ts +330 -219
- package/templates/nextjs-standalone/src/api/routes/scheduled-tasks.ts +393 -297
- package/templates/nextjs-standalone/src/api/routes/semantic.ts +179 -0
- package/templates/nextjs-standalone/src/api/routes/sessions.ts +210 -0
- package/templates/nextjs-standalone/src/api/routes/shared-domains.ts +98 -0
- package/templates/nextjs-standalone/src/api/routes/shared-schemas.ts +139 -0
- package/templates/nextjs-standalone/src/api/routes/slack.ts +209 -52
- package/templates/nextjs-standalone/src/api/routes/suggestions.ts +233 -0
- package/templates/nextjs-standalone/src/api/routes/tables.ts +67 -0
- package/templates/nextjs-standalone/src/api/routes/teams.ts +222 -0
- package/templates/nextjs-standalone/src/api/routes/validate-sql.ts +188 -0
- package/templates/nextjs-standalone/src/api/routes/validation-hook.ts +62 -0
- package/templates/nextjs-standalone/src/api/routes/widget-loader.ts +356 -0
- package/templates/nextjs-standalone/src/api/routes/widget.ts +428 -0
- package/templates/nextjs-standalone/src/api/routes/wizard.ts +852 -0
- package/templates/nextjs-standalone/src/api/server.ts +187 -69
- package/templates/nextjs-standalone/src/app/error.tsx +5 -2
- package/templates/nextjs-standalone/src/app/globals.css +1 -1
- package/templates/nextjs-standalone/src/app/layout.tsx +7 -2
- package/templates/nextjs-standalone/src/app/page.tsx +39 -5
- package/templates/nextjs-standalone/src/components/data-table/data-table-column-header.tsx +99 -0
- package/templates/nextjs-standalone/src/components/data-table/data-table-date-filter.tsx +225 -0
- package/templates/nextjs-standalone/src/components/data-table/data-table-expandable.tsx +125 -0
- package/templates/nextjs-standalone/src/components/data-table/data-table-faceted-filter.tsx +189 -0
- package/templates/nextjs-standalone/src/components/data-table/data-table-pagination.tsx +112 -0
- package/templates/nextjs-standalone/src/components/data-table/data-table-range-filter.tsx +122 -0
- package/templates/nextjs-standalone/src/components/data-table/data-table-slider-filter.tsx +256 -0
- package/templates/nextjs-standalone/src/components/data-table/data-table-sort-list.tsx +407 -0
- package/templates/nextjs-standalone/src/components/data-table/data-table-toolbar.tsx +149 -0
- package/templates/nextjs-standalone/src/components/data-table/data-table-view-options.tsx +89 -0
- package/templates/nextjs-standalone/src/components/data-table/data-table.tsx +105 -0
- package/templates/nextjs-standalone/src/components/form-dialog.tsx +135 -0
- package/templates/nextjs-standalone/src/components/ui/accordion.tsx +66 -0
- package/templates/nextjs-standalone/src/components/ui/calendar.tsx +220 -0
- package/templates/nextjs-standalone/src/components/ui/checkbox.tsx +32 -0
- package/templates/nextjs-standalone/src/components/ui/faceted.tsx +283 -0
- package/templates/nextjs-standalone/src/components/ui/form.tsx +167 -0
- package/templates/nextjs-standalone/src/components/ui/label.tsx +24 -0
- package/templates/nextjs-standalone/src/components/ui/popover.tsx +89 -0
- package/templates/nextjs-standalone/src/components/ui/progress.tsx +31 -0
- package/templates/nextjs-standalone/src/components/ui/scroll-area.tsx +6 -2
- package/templates/nextjs-standalone/src/components/ui/slider.tsx +63 -0
- package/templates/nextjs-standalone/src/components/ui/sortable.tsx +581 -0
- package/templates/nextjs-standalone/src/components/ui/switch.tsx +35 -0
- package/templates/nextjs-standalone/src/components/ui/textarea.tsx +18 -0
- package/templates/nextjs-standalone/src/config/data-table.ts +82 -0
- package/templates/nextjs-standalone/src/env-check.ts +74 -0
- package/templates/nextjs-standalone/src/hooks/use-callback-ref.ts +27 -0
- package/templates/nextjs-standalone/src/hooks/use-data-table.ts +316 -0
- package/templates/nextjs-standalone/src/hooks/use-debounced-callback.ts +28 -0
- package/templates/nextjs-standalone/src/lib/action-types.ts +7 -41
- package/templates/nextjs-standalone/src/lib/agent-query.ts +4 -2
- package/templates/nextjs-standalone/src/lib/agent.ts +363 -31
- package/templates/nextjs-standalone/src/lib/api-url.ts +2 -3
- package/templates/nextjs-standalone/src/lib/auth/admin-permissions.ts +38 -0
- package/templates/nextjs-standalone/src/lib/auth/audit.ts +19 -4
- package/templates/nextjs-standalone/src/lib/auth/byot.ts +3 -3
- package/templates/nextjs-standalone/src/lib/auth/detect.ts +29 -8
- package/templates/nextjs-standalone/src/lib/auth/managed.ts +104 -14
- package/templates/nextjs-standalone/src/lib/auth/middleware.ts +53 -6
- package/templates/nextjs-standalone/src/lib/auth/migrate.ts +140 -15
- package/templates/nextjs-standalone/src/lib/auth/oauth-state.ts +123 -0
- package/templates/nextjs-standalone/src/lib/auth/org-permissions.ts +55 -0
- package/templates/nextjs-standalone/src/lib/auth/permissions.ts +26 -19
- package/templates/nextjs-standalone/src/lib/auth/server.ts +355 -9
- package/templates/nextjs-standalone/src/lib/auth/simple-key.ts +3 -3
- package/templates/nextjs-standalone/src/lib/auth/types.ts +15 -21
- package/templates/nextjs-standalone/src/lib/billing/enforcement.ts +368 -0
- package/templates/nextjs-standalone/src/lib/billing/plans.ts +155 -0
- package/templates/nextjs-standalone/src/lib/cache/index.ts +92 -0
- package/templates/nextjs-standalone/src/lib/cache/keys.ts +30 -0
- package/templates/nextjs-standalone/src/lib/cache/lru.ts +79 -0
- package/templates/nextjs-standalone/src/lib/cache/types.ts +31 -0
- package/templates/nextjs-standalone/src/lib/compose-refs.ts +62 -0
- package/templates/nextjs-standalone/src/lib/config.ts +563 -11
- package/templates/nextjs-standalone/src/lib/connection-types.ts +9 -0
- package/templates/nextjs-standalone/src/lib/conversation-types.ts +1 -25
- package/templates/nextjs-standalone/src/lib/conversations.ts +345 -14
- package/templates/nextjs-standalone/src/lib/data-table.ts +61 -0
- package/templates/nextjs-standalone/src/lib/db/connection.ts +793 -39
- package/templates/nextjs-standalone/src/lib/db/internal.ts +985 -139
- package/templates/nextjs-standalone/src/lib/db/migrate.ts +295 -0
- package/templates/nextjs-standalone/src/lib/db/migrations/0000_baseline.sql +703 -0
- package/templates/nextjs-standalone/src/lib/db/migrations/0001_teams_installations.sql +14 -0
- package/templates/nextjs-standalone/src/lib/db/migrations/0002_discord_installations.sql +14 -0
- package/templates/nextjs-standalone/src/lib/db/migrations/0003_telegram_installations.sql +15 -0
- package/templates/nextjs-standalone/src/lib/db/migrations/0004_sandbox_credentials.sql +18 -0
- package/templates/nextjs-standalone/src/lib/db/migrations/0005_oauth_state.sql +16 -0
- package/templates/nextjs-standalone/src/lib/db/migrations/0006_byot_credentials.sql +14 -0
- package/templates/nextjs-standalone/src/lib/db/migrations/0007_gchat_installations.sql +15 -0
- package/templates/nextjs-standalone/src/lib/db/migrations/0008_github_installations.sql +14 -0
- package/templates/nextjs-standalone/src/lib/db/migrations/0009_linear_installations.sql +15 -0
- package/templates/nextjs-standalone/src/lib/db/migrations/0010_whatsapp_installations.sql +14 -0
- package/templates/nextjs-standalone/src/lib/db/migrations/0011_email_installations.sql +16 -0
- package/templates/nextjs-standalone/src/lib/db/migrations/0012_region_migrations.sql +25 -0
- package/templates/nextjs-standalone/src/lib/db/schema.ts +1120 -0
- package/templates/nextjs-standalone/src/lib/db/source-rate-limit.ts +89 -139
- package/templates/nextjs-standalone/src/lib/demo.ts +308 -0
- package/templates/nextjs-standalone/src/lib/discord/store.ts +225 -0
- package/templates/nextjs-standalone/src/lib/effect/ai.ts +243 -0
- package/templates/nextjs-standalone/src/lib/effect/errors.ts +234 -0
- package/templates/nextjs-standalone/src/lib/effect/hono.ts +454 -0
- package/templates/nextjs-standalone/src/lib/effect/index.ts +137 -0
- package/templates/nextjs-standalone/src/lib/effect/layers.ts +496 -0
- package/templates/nextjs-standalone/src/lib/effect/services.ts +776 -0
- package/templates/nextjs-standalone/src/lib/effect/sql.ts +178 -0
- package/templates/nextjs-standalone/src/lib/effect/toolkit.ts +123 -0
- package/templates/nextjs-standalone/src/lib/email/delivery.ts +232 -0
- package/templates/nextjs-standalone/src/lib/email/engine.ts +349 -0
- package/templates/nextjs-standalone/src/lib/email/hooks.ts +107 -0
- package/templates/nextjs-standalone/src/lib/email/index.ts +16 -0
- package/templates/nextjs-standalone/src/lib/email/scheduler.ts +72 -0
- package/templates/nextjs-standalone/src/lib/email/sequence.ts +73 -0
- package/templates/nextjs-standalone/src/lib/email/store.ts +163 -0
- package/templates/nextjs-standalone/src/lib/email/templates.ts +215 -0
- package/templates/nextjs-standalone/src/lib/format.test.ts +117 -0
- package/templates/nextjs-standalone/src/lib/format.ts +67 -0
- package/templates/nextjs-standalone/src/lib/gchat/store.ts +202 -0
- package/templates/nextjs-standalone/src/lib/github/store.ts +197 -0
- package/templates/nextjs-standalone/src/lib/id.ts +29 -0
- package/templates/nextjs-standalone/src/lib/integrations/types.ts +166 -0
- package/templates/nextjs-standalone/src/lib/learn/pattern-analyzer.ts +224 -0
- package/templates/nextjs-standalone/src/lib/learn/pattern-cache.ts +229 -0
- package/templates/nextjs-standalone/src/lib/learn/pattern-proposer.ts +87 -0
- package/templates/nextjs-standalone/src/lib/learn/suggestion-helpers.ts +34 -0
- package/templates/nextjs-standalone/src/lib/learn/suggestions.ts +139 -0
- package/templates/nextjs-standalone/src/lib/linear/store.ts +200 -0
- package/templates/nextjs-standalone/src/lib/logger.ts +35 -3
- package/templates/nextjs-standalone/src/lib/metering.ts +272 -0
- package/templates/nextjs-standalone/src/lib/parsers.ts +99 -0
- package/templates/nextjs-standalone/src/lib/plugins/hooks.ts +13 -11
- package/templates/nextjs-standalone/src/lib/plugins/index.ts +3 -1
- package/templates/nextjs-standalone/src/lib/plugins/registry.ts +58 -6
- package/templates/nextjs-standalone/src/lib/plugins/settings.ts +147 -0
- package/templates/nextjs-standalone/src/lib/plugins/wiring.ts +6 -9
- package/templates/nextjs-standalone/src/lib/profiler.ts +1665 -0
- package/templates/nextjs-standalone/src/lib/providers.ts +188 -13
- package/templates/nextjs-standalone/src/lib/rls.ts +172 -60
- package/templates/nextjs-standalone/src/lib/sandbox/credentials.ts +206 -0
- package/templates/nextjs-standalone/src/lib/sandbox/validate.ts +179 -0
- package/templates/nextjs-standalone/src/lib/scheduled-task-types.ts +26 -94
- package/templates/nextjs-standalone/src/lib/scheduled-tasks.ts +174 -34
- package/templates/nextjs-standalone/src/lib/scheduler/delivery.ts +248 -150
- package/templates/nextjs-standalone/src/lib/scheduler/engine.ts +190 -154
- package/templates/nextjs-standalone/src/lib/scheduler/executor.ts +74 -23
- package/templates/nextjs-standalone/src/lib/scheduler/preview.ts +72 -0
- package/templates/nextjs-standalone/src/lib/security/abuse.ts +463 -0
- package/templates/nextjs-standalone/src/lib/semantic/diff.ts +267 -0
- package/templates/nextjs-standalone/src/lib/semantic/entities.ts +167 -0
- package/templates/nextjs-standalone/src/lib/semantic/files.ts +283 -0
- package/templates/nextjs-standalone/src/lib/semantic/index.ts +27 -0
- package/templates/nextjs-standalone/src/lib/{semantic-index.ts → semantic/search.ts} +80 -9
- package/templates/nextjs-standalone/src/lib/semantic/sync.ts +581 -0
- package/templates/nextjs-standalone/src/lib/{semantic.ts → semantic/whitelist.ts} +189 -3
- package/templates/nextjs-standalone/src/lib/settings.ts +817 -0
- package/templates/nextjs-standalone/src/lib/sidecar-types.ts +13 -0
- package/templates/nextjs-standalone/src/lib/slack/store.ts +134 -25
- package/templates/nextjs-standalone/src/lib/startup.ts +528 -362
- package/templates/nextjs-standalone/src/lib/teams/store.ts +216 -0
- package/templates/nextjs-standalone/src/lib/telegram/store.ts +202 -0
- package/templates/nextjs-standalone/src/lib/telemetry.ts +40 -0
- package/templates/nextjs-standalone/src/lib/tools/actions/audit.ts +8 -5
- package/templates/nextjs-standalone/src/lib/tools/actions/email.ts +3 -1
- package/templates/nextjs-standalone/src/lib/tools/actions/handler.ts +276 -93
- package/templates/nextjs-standalone/src/lib/tools/actions/jira.ts +2 -2
- package/templates/nextjs-standalone/src/lib/tools/backends/detect.ts +16 -0
- package/templates/nextjs-standalone/src/lib/tools/backends/index.ts +11 -0
- package/templates/nextjs-standalone/src/lib/tools/backends/nsjail.ts +213 -0
- package/templates/nextjs-standalone/src/lib/tools/backends/shared.ts +103 -0
- package/templates/nextjs-standalone/src/lib/tools/backends/types.ts +26 -0
- package/templates/nextjs-standalone/src/lib/tools/explore-nsjail.ts +7 -228
- package/templates/nextjs-standalone/src/lib/tools/explore-sandbox.ts +4 -29
- package/templates/nextjs-standalone/src/lib/tools/explore-sidecar.ts +18 -2
- package/templates/nextjs-standalone/src/lib/tools/explore.ts +246 -54
- package/templates/nextjs-standalone/src/lib/tools/index.ts +17 -0
- package/templates/nextjs-standalone/src/lib/tools/python-nsjail.ts +11 -139
- package/templates/nextjs-standalone/src/lib/tools/python-sandbox.ts +9 -132
- package/templates/nextjs-standalone/src/lib/tools/python-sidecar.ts +184 -3
- package/templates/nextjs-standalone/src/lib/tools/python-stream.ts +33 -0
- package/templates/nextjs-standalone/src/lib/tools/python-wrapper.ts +129 -0
- package/templates/nextjs-standalone/src/lib/tools/python.ts +115 -15
- package/templates/nextjs-standalone/src/lib/tools/registry.ts +14 -2
- package/templates/nextjs-standalone/src/lib/tools/sql.ts +778 -362
- package/templates/nextjs-standalone/src/lib/tracing.ts +16 -0
- package/templates/nextjs-standalone/src/lib/whatsapp/store.ts +198 -0
- package/templates/nextjs-standalone/src/lib/workspace.ts +89 -0
- package/templates/nextjs-standalone/src/progress.ts +121 -0
- package/templates/nextjs-standalone/src/types/data-table.ts +48 -0
- package/templates/nextjs-standalone/src/ui/atlas-chat-reexport.ts +3 -0
- package/templates/nextjs-standalone/src/ui/components/actions/action-approval-card.tsx +26 -19
- package/templates/nextjs-standalone/src/ui/components/actions/action-status-badge.tsx +3 -3
- package/templates/nextjs-standalone/src/ui/components/admin/admin-layout.tsx +57 -39
- package/templates/nextjs-standalone/src/ui/components/admin/admin-sidebar.tsx +213 -35
- package/templates/nextjs-standalone/src/ui/components/admin/delivery-status-badge.tsx +53 -0
- package/templates/nextjs-standalone/src/ui/components/admin/empty-state.tsx +27 -6
- package/templates/nextjs-standalone/src/ui/components/admin/entity-detail.tsx +3 -52
- package/templates/nextjs-standalone/src/ui/components/admin/error-banner.tsx +2 -2
- package/templates/nextjs-standalone/src/ui/components/admin/feature-disabled.tsx +28 -5
- package/templates/nextjs-standalone/src/ui/components/admin-content-wrapper.tsx +87 -0
- package/templates/nextjs-standalone/src/ui/components/atlas-chat.tsx +449 -166
- package/templates/nextjs-standalone/src/ui/components/branding-head.tsx +41 -0
- package/templates/nextjs-standalone/src/ui/components/chart/chart-detection.ts +62 -5
- package/templates/nextjs-standalone/src/ui/components/chart/result-chart.tsx +316 -125
- package/templates/nextjs-standalone/src/ui/components/chat/api-key-bar.tsx +4 -4
- package/templates/nextjs-standalone/src/ui/components/chat/data-table.tsx +45 -4
- package/templates/nextjs-standalone/src/ui/components/chat/error-banner.tsx +86 -5
- package/templates/nextjs-standalone/src/ui/components/chat/follow-up-chips.tsx +29 -0
- package/templates/nextjs-standalone/src/ui/components/chat/markdown.tsx +24 -0
- package/templates/nextjs-standalone/src/ui/components/chat/prompt-library.tsx +206 -0
- package/templates/nextjs-standalone/src/ui/components/chat/python-result-card.tsx +106 -78
- package/templates/nextjs-standalone/src/ui/components/chat/result-card-base.tsx +101 -0
- package/templates/nextjs-standalone/src/ui/components/chat/share-dialog.tsx +377 -0
- package/templates/nextjs-standalone/src/ui/components/chat/sql-result-card.tsx +94 -73
- package/templates/nextjs-standalone/src/ui/components/chat/suggestion-chips.tsx +46 -0
- package/templates/nextjs-standalone/src/ui/components/chat/tool-part.tsx +16 -4
- package/templates/nextjs-standalone/src/ui/components/conversations/conversation-item.tsx +48 -17
- package/templates/nextjs-standalone/src/ui/components/conversations/conversation-list.tsx +38 -24
- package/templates/nextjs-standalone/src/ui/components/conversations/conversation-sidebar.tsx +66 -7
- package/templates/nextjs-standalone/src/ui/components/conversations/delete-confirmation.tsx +9 -2
- package/templates/nextjs-standalone/src/ui/components/error-boundary.tsx +66 -0
- package/templates/nextjs-standalone/src/ui/components/notebook/delete-cell-dialog.tsx +48 -0
- package/templates/nextjs-standalone/src/ui/components/notebook/fork-branch-selector.tsx +68 -0
- package/templates/nextjs-standalone/src/ui/components/notebook/notebook-cell-input.tsx +76 -0
- package/templates/nextjs-standalone/src/ui/components/notebook/notebook-cell-output.tsx +58 -0
- package/templates/nextjs-standalone/src/ui/components/notebook/notebook-cell-toolbar.tsx +91 -0
- package/templates/nextjs-standalone/src/ui/components/notebook/notebook-cell.tsx +119 -0
- package/templates/nextjs-standalone/src/ui/components/notebook/notebook-empty-state.tsx +19 -0
- package/templates/nextjs-standalone/src/ui/components/notebook/notebook-export.ts +287 -0
- package/templates/nextjs-standalone/src/ui/components/notebook/notebook-input-bar.tsx +49 -0
- package/templates/nextjs-standalone/src/ui/components/notebook/notebook-shell.tsx +266 -0
- package/templates/nextjs-standalone/src/ui/components/notebook/notebook-text-cell.tsx +152 -0
- package/templates/nextjs-standalone/src/ui/components/notebook/types.ts +39 -0
- package/templates/nextjs-standalone/src/ui/components/notebook/use-keyboard-nav.ts +109 -0
- package/templates/nextjs-standalone/src/ui/components/notebook/use-notebook.ts +684 -0
- package/templates/nextjs-standalone/src/ui/components/org-switcher.tsx +111 -0
- package/templates/nextjs-standalone/src/ui/components/region-picker.tsx +103 -0
- package/templates/nextjs-standalone/src/ui/components/schema-explorer/schema-explorer.tsx +522 -0
- package/templates/nextjs-standalone/src/ui/components/social-icons.tsx +26 -0
- package/templates/nextjs-standalone/src/ui/components/tour/guided-tour.tsx +81 -0
- package/templates/nextjs-standalone/src/ui/components/tour/index.ts +5 -0
- package/templates/nextjs-standalone/src/ui/components/tour/nav-bar.tsx +100 -0
- package/templates/nextjs-standalone/src/ui/components/tour/tour-overlay.tsx +298 -0
- package/templates/nextjs-standalone/src/ui/components/tour/tour-steps.ts +43 -0
- package/templates/nextjs-standalone/src/ui/components/tour/types.ts +21 -0
- package/templates/nextjs-standalone/src/ui/components/tour/use-tour.ts +193 -0
- package/templates/nextjs-standalone/src/ui/context-reexport.ts +3 -0
- package/templates/nextjs-standalone/src/ui/hooks/theme-init-script.ts +17 -0
- package/templates/nextjs-standalone/src/ui/hooks/use-admin-fetch.ts +38 -30
- package/templates/nextjs-standalone/src/ui/hooks/use-admin-mutation.ts +188 -0
- package/templates/nextjs-standalone/src/ui/hooks/use-atlas-transport.ts +225 -0
- package/templates/nextjs-standalone/src/ui/hooks/use-branding.ts +68 -0
- package/templates/nextjs-standalone/src/ui/hooks/use-conversations.ts +106 -83
- package/templates/nextjs-standalone/src/ui/hooks/use-dark-mode.ts +134 -10
- package/templates/nextjs-standalone/src/ui/hooks/use-deploy-mode.ts +36 -0
- package/templates/nextjs-standalone/src/ui/hooks/use-platform-admin-guard.ts +49 -0
- package/templates/nextjs-standalone/src/ui/lib/action-types.ts +11 -63
- package/templates/nextjs-standalone/src/ui/lib/admin-schemas.ts +744 -0
- package/templates/nextjs-standalone/src/ui/lib/fetch-client.ts +84 -0
- package/templates/nextjs-standalone/src/ui/lib/fetch-error.ts +54 -0
- package/templates/nextjs-standalone/src/ui/lib/helpers.ts +94 -1
- package/templates/nextjs-standalone/src/ui/lib/types.ts +149 -140
- package/templates/nextjs-standalone/tsconfig.json +3 -2
- package/templates/docker/src/api/__tests__/actions.test.ts +0 -683
- package/templates/docker/src/api/__tests__/admin.test.ts +0 -820
- package/templates/docker/src/api/__tests__/auth.test.ts +0 -165
- package/templates/docker/src/api/__tests__/chat.test.ts +0 -376
- package/templates/docker/src/api/__tests__/conversations.test.ts +0 -555
- package/templates/docker/src/api/__tests__/cors.test.ts +0 -135
- package/templates/docker/src/api/__tests__/health-plugin.test.ts +0 -176
- package/templates/docker/src/api/__tests__/health.test.ts +0 -283
- package/templates/docker/src/api/__tests__/query.test.ts +0 -891
- package/templates/docker/src/api/__tests__/scheduled-tasks.test.ts +0 -601
- package/templates/docker/src/api/__tests__/slack.test.ts +0 -847
- package/templates/docker/src/lib/__tests__/agent-cache.test.ts +0 -439
- package/templates/docker/src/lib/__tests__/agent-dialect.test.ts +0 -131
- package/templates/docker/src/lib/__tests__/agent-health-annotations.test.ts +0 -166
- package/templates/docker/src/lib/__tests__/agent-integration.test.ts +0 -516
- package/templates/docker/src/lib/__tests__/config-actions.test.ts +0 -166
- package/templates/docker/src/lib/__tests__/config.test.ts +0 -1113
- package/templates/docker/src/lib/__tests__/conversations.test.ts +0 -589
- package/templates/docker/src/lib/__tests__/errors.test.ts +0 -256
- package/templates/docker/src/lib/__tests__/logger.test.ts +0 -200
- package/templates/docker/src/lib/__tests__/plugin-aware-validation.test.ts +0 -321
- package/templates/docker/src/lib/__tests__/providers.test.ts +0 -130
- package/templates/docker/src/lib/__tests__/rls.test.ts +0 -435
- package/templates/docker/src/lib/__tests__/scheduled-task-types.test.ts +0 -124
- package/templates/docker/src/lib/__tests__/scheduled-tasks.test.ts +0 -550
- package/templates/docker/src/lib/__tests__/semantic-index.test.ts +0 -547
- package/templates/docker/src/lib/__tests__/semantic-multisource.test.ts +0 -544
- package/templates/docker/src/lib/__tests__/semantic.test.ts +0 -363
- package/templates/docker/src/lib/__tests__/startup-actions.test.ts +0 -461
- package/templates/docker/src/lib/__tests__/startup-first-run.test.ts +0 -429
- package/templates/docker/src/lib/__tests__/startup.test.ts +0 -470
- package/templates/docker/src/lib/__tests__/tracing.test.ts +0 -28
- package/templates/docker/src/lib/auth/__tests__/audit.test.ts +0 -418
- package/templates/docker/src/lib/auth/__tests__/byot-integration.test.ts +0 -222
- package/templates/docker/src/lib/auth/__tests__/byot.test.ts +0 -366
- package/templates/docker/src/lib/auth/__tests__/detect.test.ts +0 -190
- package/templates/docker/src/lib/auth/__tests__/managed.test.ts +0 -173
- package/templates/docker/src/lib/auth/__tests__/middleware.test.ts +0 -456
- package/templates/docker/src/lib/auth/__tests__/migrate.test.ts +0 -203
- package/templates/docker/src/lib/auth/__tests__/permissions.test.ts +0 -225
- package/templates/docker/src/lib/auth/__tests__/server.test.ts +0 -34
- package/templates/docker/src/lib/auth/__tests__/simple-key.test.ts +0 -176
- package/templates/docker/src/lib/auth/__tests__/types.test.ts +0 -44
- package/templates/docker/src/lib/db/__tests__/connection.test.ts +0 -144
- package/templates/docker/src/lib/db/__tests__/internal.test.ts +0 -387
- package/templates/docker/src/lib/db/__tests__/registry-health.test.ts +0 -190
- package/templates/docker/src/lib/db/__tests__/registry-pool-limits.test.ts +0 -137
- package/templates/docker/src/lib/db/__tests__/registry.test.ts +0 -398
- package/templates/docker/src/lib/db/__tests__/source-rate-limit.test.ts +0 -130
- package/templates/docker/src/lib/errors.ts +0 -154
- package/templates/docker/src/lib/plugins/__tests__/hooks-integration.test.ts +0 -204
- package/templates/docker/src/lib/plugins/__tests__/hooks.test.ts +0 -529
- package/templates/docker/src/lib/plugins/__tests__/migrate.test.ts +0 -875
- package/templates/docker/src/lib/plugins/__tests__/registry.test.ts +0 -373
- package/templates/docker/src/lib/plugins/__tests__/tools.test.ts +0 -49
- package/templates/docker/src/lib/plugins/__tests__/wiring.test.ts +0 -799
- package/templates/docker/src/lib/scheduler/__tests__/delivery.test.ts +0 -192
- package/templates/docker/src/lib/scheduler/__tests__/engine.test.ts +0 -248
- package/templates/docker/src/lib/scheduler/__tests__/format-email.test.ts +0 -96
- package/templates/docker/src/lib/scheduler/__tests__/format-slack.test.ts +0 -78
- package/templates/docker/src/lib/scheduler/__tests__/format-webhook.test.ts +0 -78
- package/templates/docker/src/lib/scheduler/index.ts +0 -7
- package/templates/docker/src/lib/slack/__tests__/api.test.ts +0 -160
- package/templates/docker/src/lib/slack/__tests__/format.test.ts +0 -237
- package/templates/docker/src/lib/slack/__tests__/store.test.ts +0 -188
- package/templates/docker/src/lib/slack/__tests__/threads.test.ts +0 -112
- package/templates/docker/src/lib/slack/__tests__/verify.test.ts +0 -111
- package/templates/docker/src/lib/tools/__tests__/action-permissions.test.ts +0 -594
- package/templates/docker/src/lib/tools/__tests__/custom-validation.test.ts +0 -240
- package/templates/docker/src/lib/tools/__tests__/explore-backend.test.ts +0 -267
- package/templates/docker/src/lib/tools/__tests__/explore-nsjail.test.ts +0 -506
- package/templates/docker/src/lib/tools/__tests__/explore-plugin.test.ts +0 -374
- package/templates/docker/src/lib/tools/__tests__/explore-sdk-compat.test.ts +0 -82
- package/templates/docker/src/lib/tools/__tests__/explore-sidecar.test.ts +0 -210
- package/templates/docker/src/lib/tools/__tests__/python-nsjail.test.ts +0 -515
- package/templates/docker/src/lib/tools/__tests__/python-sandbox.test.ts +0 -397
- package/templates/docker/src/lib/tools/__tests__/python-sidecar.test.ts +0 -365
- package/templates/docker/src/lib/tools/__tests__/python.test.ts +0 -331
- package/templates/docker/src/lib/tools/__tests__/registry-actions.test.ts +0 -132
- package/templates/docker/src/lib/tools/__tests__/registry.test.ts +0 -242
- package/templates/docker/src/lib/tools/__tests__/sql-audit.test.ts +0 -227
- package/templates/docker/src/lib/tools/__tests__/sql-connection-whitelist.test.ts +0 -100
- package/templates/docker/src/lib/tools/__tests__/sql-ratelimit.test.ts +0 -227
- package/templates/docker/src/lib/tools/__tests__/sql.test.ts +0 -709
- package/templates/docker/src/lib/tools/actions/__tests__/audit.test.ts +0 -211
- package/templates/docker/src/lib/tools/actions/__tests__/email.test.ts +0 -378
- package/templates/docker/src/lib/tools/actions/__tests__/handler.test.ts +0 -681
- package/templates/docker/src/lib/tools/actions/__tests__/jira.test.ts +0 -427
- package/templates/docker/src/test-setup.ts +0 -38
- package/templates/docker/src/types/vercel-sandbox.d.ts +0 -61
- package/templates/docker/src/ui/components/chat/managed-auth-card.tsx +0 -116
- package/templates/nextjs-standalone/src/api/__tests__/actions.test.ts +0 -683
- package/templates/nextjs-standalone/src/api/__tests__/admin.test.ts +0 -820
- package/templates/nextjs-standalone/src/api/__tests__/auth.test.ts +0 -165
- package/templates/nextjs-standalone/src/api/__tests__/chat.test.ts +0 -376
- package/templates/nextjs-standalone/src/api/__tests__/conversations.test.ts +0 -555
- package/templates/nextjs-standalone/src/api/__tests__/cors.test.ts +0 -135
- package/templates/nextjs-standalone/src/api/__tests__/health-plugin.test.ts +0 -176
- package/templates/nextjs-standalone/src/api/__tests__/health.test.ts +0 -283
- package/templates/nextjs-standalone/src/api/__tests__/query.test.ts +0 -891
- package/templates/nextjs-standalone/src/api/__tests__/scheduled-tasks.test.ts +0 -601
- package/templates/nextjs-standalone/src/api/__tests__/slack.test.ts +0 -847
- package/templates/nextjs-standalone/src/app/global-error.tsx +0 -68
- package/templates/nextjs-standalone/src/lib/__tests__/agent-cache.test.ts +0 -439
- package/templates/nextjs-standalone/src/lib/__tests__/agent-dialect.test.ts +0 -131
- package/templates/nextjs-standalone/src/lib/__tests__/agent-health-annotations.test.ts +0 -166
- package/templates/nextjs-standalone/src/lib/__tests__/agent-integration.test.ts +0 -516
- package/templates/nextjs-standalone/src/lib/__tests__/config-actions.test.ts +0 -166
- package/templates/nextjs-standalone/src/lib/__tests__/config.test.ts +0 -1113
- package/templates/nextjs-standalone/src/lib/__tests__/conversations.test.ts +0 -589
- package/templates/nextjs-standalone/src/lib/__tests__/errors.test.ts +0 -256
- package/templates/nextjs-standalone/src/lib/__tests__/logger.test.ts +0 -200
- package/templates/nextjs-standalone/src/lib/__tests__/plugin-aware-validation.test.ts +0 -321
- package/templates/nextjs-standalone/src/lib/__tests__/providers.test.ts +0 -130
- package/templates/nextjs-standalone/src/lib/__tests__/rls.test.ts +0 -435
- package/templates/nextjs-standalone/src/lib/__tests__/scheduled-task-types.test.ts +0 -124
- package/templates/nextjs-standalone/src/lib/__tests__/scheduled-tasks.test.ts +0 -550
- package/templates/nextjs-standalone/src/lib/__tests__/semantic-index.test.ts +0 -547
- package/templates/nextjs-standalone/src/lib/__tests__/semantic-multisource.test.ts +0 -544
- package/templates/nextjs-standalone/src/lib/__tests__/semantic.test.ts +0 -363
- package/templates/nextjs-standalone/src/lib/__tests__/startup-actions.test.ts +0 -461
- package/templates/nextjs-standalone/src/lib/__tests__/startup-first-run.test.ts +0 -429
- package/templates/nextjs-standalone/src/lib/__tests__/startup.test.ts +0 -470
- package/templates/nextjs-standalone/src/lib/__tests__/tracing.test.ts +0 -28
- package/templates/nextjs-standalone/src/lib/auth/__tests__/audit.test.ts +0 -418
- package/templates/nextjs-standalone/src/lib/auth/__tests__/byot-integration.test.ts +0 -222
- package/templates/nextjs-standalone/src/lib/auth/__tests__/byot.test.ts +0 -366
- package/templates/nextjs-standalone/src/lib/auth/__tests__/detect.test.ts +0 -190
- package/templates/nextjs-standalone/src/lib/auth/__tests__/managed.test.ts +0 -173
- package/templates/nextjs-standalone/src/lib/auth/__tests__/middleware.test.ts +0 -456
- package/templates/nextjs-standalone/src/lib/auth/__tests__/migrate.test.ts +0 -203
- package/templates/nextjs-standalone/src/lib/auth/__tests__/permissions.test.ts +0 -225
- package/templates/nextjs-standalone/src/lib/auth/__tests__/server.test.ts +0 -34
- package/templates/nextjs-standalone/src/lib/auth/__tests__/simple-key.test.ts +0 -176
- package/templates/nextjs-standalone/src/lib/auth/__tests__/types.test.ts +0 -44
- package/templates/nextjs-standalone/src/lib/db/__tests__/connection.test.ts +0 -144
- package/templates/nextjs-standalone/src/lib/db/__tests__/internal.test.ts +0 -387
- package/templates/nextjs-standalone/src/lib/db/__tests__/registry-health.test.ts +0 -190
- package/templates/nextjs-standalone/src/lib/db/__tests__/registry-pool-limits.test.ts +0 -137
- package/templates/nextjs-standalone/src/lib/db/__tests__/registry.test.ts +0 -398
- package/templates/nextjs-standalone/src/lib/db/__tests__/source-rate-limit.test.ts +0 -130
- package/templates/nextjs-standalone/src/lib/errors.ts +0 -154
- package/templates/nextjs-standalone/src/lib/plugins/__tests__/hooks-integration.test.ts +0 -204
- package/templates/nextjs-standalone/src/lib/plugins/__tests__/hooks.test.ts +0 -529
- package/templates/nextjs-standalone/src/lib/plugins/__tests__/migrate.test.ts +0 -875
- package/templates/nextjs-standalone/src/lib/plugins/__tests__/registry.test.ts +0 -373
- package/templates/nextjs-standalone/src/lib/plugins/__tests__/tools.test.ts +0 -49
- package/templates/nextjs-standalone/src/lib/plugins/__tests__/wiring.test.ts +0 -799
- package/templates/nextjs-standalone/src/lib/scheduler/__tests__/delivery.test.ts +0 -192
- package/templates/nextjs-standalone/src/lib/scheduler/__tests__/engine.test.ts +0 -248
- package/templates/nextjs-standalone/src/lib/scheduler/__tests__/format-email.test.ts +0 -96
- package/templates/nextjs-standalone/src/lib/scheduler/__tests__/format-slack.test.ts +0 -78
- package/templates/nextjs-standalone/src/lib/scheduler/__tests__/format-webhook.test.ts +0 -78
- package/templates/nextjs-standalone/src/lib/scheduler/index.ts +0 -7
- package/templates/nextjs-standalone/src/lib/slack/__tests__/api.test.ts +0 -160
- package/templates/nextjs-standalone/src/lib/slack/__tests__/format.test.ts +0 -237
- package/templates/nextjs-standalone/src/lib/slack/__tests__/store.test.ts +0 -188
- package/templates/nextjs-standalone/src/lib/slack/__tests__/threads.test.ts +0 -112
- package/templates/nextjs-standalone/src/lib/slack/__tests__/verify.test.ts +0 -111
- package/templates/nextjs-standalone/src/lib/tools/__tests__/action-permissions.test.ts +0 -594
- package/templates/nextjs-standalone/src/lib/tools/__tests__/custom-validation.test.ts +0 -240
- package/templates/nextjs-standalone/src/lib/tools/__tests__/explore-backend.test.ts +0 -267
- package/templates/nextjs-standalone/src/lib/tools/__tests__/explore-nsjail.test.ts +0 -506
- package/templates/nextjs-standalone/src/lib/tools/__tests__/explore-plugin.test.ts +0 -374
- package/templates/nextjs-standalone/src/lib/tools/__tests__/explore-sdk-compat.test.ts +0 -82
- package/templates/nextjs-standalone/src/lib/tools/__tests__/explore-sidecar.test.ts +0 -210
- package/templates/nextjs-standalone/src/lib/tools/__tests__/python-nsjail.test.ts +0 -515
- package/templates/nextjs-standalone/src/lib/tools/__tests__/python-sandbox.test.ts +0 -397
- package/templates/nextjs-standalone/src/lib/tools/__tests__/python-sidecar.test.ts +0 -365
- package/templates/nextjs-standalone/src/lib/tools/__tests__/python.test.ts +0 -331
- package/templates/nextjs-standalone/src/lib/tools/__tests__/registry-actions.test.ts +0 -132
- package/templates/nextjs-standalone/src/lib/tools/__tests__/registry.test.ts +0 -242
- package/templates/nextjs-standalone/src/lib/tools/__tests__/sql-audit.test.ts +0 -227
- package/templates/nextjs-standalone/src/lib/tools/__tests__/sql-connection-whitelist.test.ts +0 -100
- package/templates/nextjs-standalone/src/lib/tools/__tests__/sql-ratelimit.test.ts +0 -227
- package/templates/nextjs-standalone/src/lib/tools/__tests__/sql.test.ts +0 -709
- package/templates/nextjs-standalone/src/lib/tools/actions/__tests__/audit.test.ts +0 -211
- package/templates/nextjs-standalone/src/lib/tools/actions/__tests__/email.test.ts +0 -378
- package/templates/nextjs-standalone/src/lib/tools/actions/__tests__/handler.test.ts +0 -681
- package/templates/nextjs-standalone/src/lib/tools/actions/__tests__/jira.test.ts +0 -427
- package/templates/nextjs-standalone/src/test-setup.ts +0 -38
- package/templates/nextjs-standalone/src/ui/components/chat/managed-auth-card.tsx +0 -116
|
@@ -0,0 +1,744 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schemas for types imported from @useatlas/types, used by admin page
|
|
3
|
+
* useAdminFetch calls for runtime response validation.
|
|
4
|
+
*
|
|
5
|
+
* Schemas use z.string() for string-literal unions (e.g. DBType) to remain
|
|
6
|
+
* resilient when the API adds new values. Type annotations ensure the
|
|
7
|
+
* schema output is assignable to the imported TypeScript interface.
|
|
8
|
+
*/
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
import type {
|
|
11
|
+
ConnectionInfo,
|
|
12
|
+
ConnectionHealth,
|
|
13
|
+
WorkspaceBranding,
|
|
14
|
+
WorkspaceModelConfig,
|
|
15
|
+
ApprovalRule,
|
|
16
|
+
ApprovalRequest,
|
|
17
|
+
AbuseStatus,
|
|
18
|
+
AbuseThresholdConfig,
|
|
19
|
+
PIIColumnClassification,
|
|
20
|
+
SemanticDiffResponse,
|
|
21
|
+
PlatformStats,
|
|
22
|
+
PlatformWorkspace,
|
|
23
|
+
PlatformWorkspaceUser,
|
|
24
|
+
NoisyNeighbor,
|
|
25
|
+
BackupEntry,
|
|
26
|
+
BackupConfig,
|
|
27
|
+
CustomDomain,
|
|
28
|
+
RegionMigration,
|
|
29
|
+
RegionPickerItem,
|
|
30
|
+
RegionStatus,
|
|
31
|
+
WorkspaceRegion,
|
|
32
|
+
WorkspaceSLASummary,
|
|
33
|
+
WorkspaceSLADetail,
|
|
34
|
+
SLAAlert,
|
|
35
|
+
SLAThresholds,
|
|
36
|
+
SLAMetricPoint,
|
|
37
|
+
} from "@/ui/lib/types";
|
|
38
|
+
|
|
39
|
+
// ── Connection ────────────────────────────────────────────────────
|
|
40
|
+
|
|
41
|
+
const ConnectionHealthSchema = z.object({
|
|
42
|
+
status: z.string(),
|
|
43
|
+
latencyMs: z.number(),
|
|
44
|
+
message: z.string().optional(),
|
|
45
|
+
checkedAt: z.string(),
|
|
46
|
+
}) as z.ZodType<ConnectionHealth>;
|
|
47
|
+
|
|
48
|
+
export const ConnectionInfoSchema = z.object({
|
|
49
|
+
id: z.string(),
|
|
50
|
+
dbType: z.string(),
|
|
51
|
+
description: z.string().nullable().optional(),
|
|
52
|
+
health: ConnectionHealthSchema.optional(),
|
|
53
|
+
}) as z.ZodType<ConnectionInfo>;
|
|
54
|
+
|
|
55
|
+
// ── Branding ──────────────────────────────────────────────────────
|
|
56
|
+
|
|
57
|
+
export const WorkspaceBrandingSchema = z.object({
|
|
58
|
+
id: z.string(),
|
|
59
|
+
orgId: z.string(),
|
|
60
|
+
logoUrl: z.string().nullable(),
|
|
61
|
+
logoText: z.string().nullable(),
|
|
62
|
+
primaryColor: z.string().nullable(),
|
|
63
|
+
faviconUrl: z.string().nullable(),
|
|
64
|
+
hideAtlasBranding: z.boolean(),
|
|
65
|
+
createdAt: z.string(),
|
|
66
|
+
updatedAt: z.string(),
|
|
67
|
+
}) as z.ZodType<WorkspaceBranding>;
|
|
68
|
+
|
|
69
|
+
// ── Model Config ──────────────────────────────────────────────────
|
|
70
|
+
|
|
71
|
+
export const WorkspaceModelConfigSchema = z.object({
|
|
72
|
+
id: z.string(),
|
|
73
|
+
orgId: z.string(),
|
|
74
|
+
provider: z.string(),
|
|
75
|
+
model: z.string(),
|
|
76
|
+
baseUrl: z.string().nullable(),
|
|
77
|
+
apiKeyMasked: z.string(),
|
|
78
|
+
createdAt: z.string(),
|
|
79
|
+
updatedAt: z.string(),
|
|
80
|
+
}) as z.ZodType<WorkspaceModelConfig>;
|
|
81
|
+
|
|
82
|
+
// ── Approval ──────────────────────────────────────────────────────
|
|
83
|
+
|
|
84
|
+
export const ApprovalRuleSchema = z.object({
|
|
85
|
+
id: z.string(),
|
|
86
|
+
orgId: z.string(),
|
|
87
|
+
name: z.string(),
|
|
88
|
+
ruleType: z.string(),
|
|
89
|
+
pattern: z.string(),
|
|
90
|
+
threshold: z.number().nullable(),
|
|
91
|
+
enabled: z.boolean(),
|
|
92
|
+
createdAt: z.string(),
|
|
93
|
+
updatedAt: z.string(),
|
|
94
|
+
}) as z.ZodType<ApprovalRule>;
|
|
95
|
+
|
|
96
|
+
export const ApprovalRequestSchema = z.object({
|
|
97
|
+
id: z.string(),
|
|
98
|
+
orgId: z.string(),
|
|
99
|
+
ruleId: z.string(),
|
|
100
|
+
ruleName: z.string(),
|
|
101
|
+
requesterId: z.string(),
|
|
102
|
+
requesterEmail: z.string().nullable(),
|
|
103
|
+
querySql: z.string(),
|
|
104
|
+
explanation: z.string().nullable(),
|
|
105
|
+
connectionId: z.string(),
|
|
106
|
+
tablesAccessed: z.array(z.string()),
|
|
107
|
+
columnsAccessed: z.array(z.string()),
|
|
108
|
+
status: z.string(),
|
|
109
|
+
reviewerId: z.string().nullable(),
|
|
110
|
+
reviewerEmail: z.string().nullable(),
|
|
111
|
+
reviewComment: z.string().nullable(),
|
|
112
|
+
reviewedAt: z.string().nullable(),
|
|
113
|
+
createdAt: z.string(),
|
|
114
|
+
expiresAt: z.string(),
|
|
115
|
+
}) as z.ZodType<ApprovalRequest>;
|
|
116
|
+
|
|
117
|
+
// ── Abuse ─────────────────────────────────────────────────────────
|
|
118
|
+
|
|
119
|
+
const AbuseEventSchema = z.object({
|
|
120
|
+
id: z.string(),
|
|
121
|
+
workspaceId: z.string(),
|
|
122
|
+
level: z.string(),
|
|
123
|
+
trigger: z.string(),
|
|
124
|
+
message: z.string(),
|
|
125
|
+
metadata: z.record(z.string(), z.unknown()),
|
|
126
|
+
createdAt: z.string(),
|
|
127
|
+
actor: z.string(),
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
export const AbuseStatusSchema = z.object({
|
|
131
|
+
workspaceId: z.string(),
|
|
132
|
+
workspaceName: z.string().nullable(),
|
|
133
|
+
level: z.string(),
|
|
134
|
+
trigger: z.string().nullable(),
|
|
135
|
+
message: z.string().nullable(),
|
|
136
|
+
updatedAt: z.string(),
|
|
137
|
+
events: z.array(AbuseEventSchema),
|
|
138
|
+
}) as z.ZodType<AbuseStatus>;
|
|
139
|
+
|
|
140
|
+
export const AbuseThresholdConfigSchema = z.object({
|
|
141
|
+
queryRateLimit: z.number(),
|
|
142
|
+
queryRateWindowSeconds: z.number(),
|
|
143
|
+
errorRateThreshold: z.number(),
|
|
144
|
+
uniqueTablesLimit: z.number(),
|
|
145
|
+
throttleDelayMs: z.number(),
|
|
146
|
+
}) as z.ZodType<AbuseThresholdConfig>;
|
|
147
|
+
|
|
148
|
+
// ── Compliance ────────────────────────────────────────────────────
|
|
149
|
+
|
|
150
|
+
export const PIIColumnClassificationSchema = z.object({
|
|
151
|
+
id: z.string(),
|
|
152
|
+
orgId: z.string(),
|
|
153
|
+
tableName: z.string(),
|
|
154
|
+
columnName: z.string(),
|
|
155
|
+
connectionId: z.string(),
|
|
156
|
+
category: z.string(),
|
|
157
|
+
confidence: z.string(),
|
|
158
|
+
maskingStrategy: z.string(),
|
|
159
|
+
reviewed: z.boolean(),
|
|
160
|
+
dismissed: z.boolean(),
|
|
161
|
+
createdAt: z.string(),
|
|
162
|
+
updatedAt: z.string(),
|
|
163
|
+
}) as z.ZodType<PIIColumnClassification>;
|
|
164
|
+
|
|
165
|
+
// ── Semantic Diff ─────────────────────────────────────────────────
|
|
166
|
+
|
|
167
|
+
const SemanticTableDiffSchema = z.object({
|
|
168
|
+
table: z.string(),
|
|
169
|
+
addedColumns: z.array(z.object({ name: z.string(), type: z.string() })),
|
|
170
|
+
removedColumns: z.array(z.object({ name: z.string(), type: z.string() })),
|
|
171
|
+
typeChanges: z.array(z.object({ name: z.string(), yamlType: z.string(), dbType: z.string() })),
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
export const SemanticDiffResponseSchema = z.object({
|
|
175
|
+
connection: z.string(),
|
|
176
|
+
newTables: z.array(z.string()),
|
|
177
|
+
removedTables: z.array(z.string()),
|
|
178
|
+
tableDiffs: z.array(SemanticTableDiffSchema),
|
|
179
|
+
unchangedCount: z.number(),
|
|
180
|
+
summary: z.object({
|
|
181
|
+
total: z.number(),
|
|
182
|
+
new: z.number(),
|
|
183
|
+
removed: z.number(),
|
|
184
|
+
changed: z.number(),
|
|
185
|
+
unchanged: z.number(),
|
|
186
|
+
}),
|
|
187
|
+
warnings: z.array(z.string()).optional(),
|
|
188
|
+
}) as z.ZodType<SemanticDiffResponse>;
|
|
189
|
+
|
|
190
|
+
// ── Connections list (shared by connections + schema-diff pages) ───
|
|
191
|
+
|
|
192
|
+
export const ConnectionsResponseSchema = z.object({
|
|
193
|
+
connections: z.array(ConnectionInfoSchema).optional(),
|
|
194
|
+
}).transform((r) => r.connections ?? []);
|
|
195
|
+
|
|
196
|
+
// ── Platform ─────────────────────────────────────────────────────
|
|
197
|
+
|
|
198
|
+
export const PlatformStatsSchema = z.object({
|
|
199
|
+
totalWorkspaces: z.number(),
|
|
200
|
+
activeWorkspaces: z.number(),
|
|
201
|
+
suspendedWorkspaces: z.number(),
|
|
202
|
+
totalUsers: z.number(),
|
|
203
|
+
totalQueries24h: z.number(),
|
|
204
|
+
mrr: z.number(),
|
|
205
|
+
}) as z.ZodType<PlatformStats>;
|
|
206
|
+
|
|
207
|
+
export const PlatformWorkspaceSchema = z.object({
|
|
208
|
+
id: z.string(),
|
|
209
|
+
name: z.string(),
|
|
210
|
+
slug: z.string(),
|
|
211
|
+
planTier: z.string(),
|
|
212
|
+
status: z.string(),
|
|
213
|
+
byot: z.boolean(),
|
|
214
|
+
members: z.number(),
|
|
215
|
+
connections: z.number(),
|
|
216
|
+
conversations: z.number(),
|
|
217
|
+
queriesLast24h: z.number(),
|
|
218
|
+
scheduledTasks: z.number(),
|
|
219
|
+
stripeCustomerId: z.string().nullable(),
|
|
220
|
+
trialEndsAt: z.string().nullable(),
|
|
221
|
+
suspendedAt: z.string().nullable(),
|
|
222
|
+
deletedAt: z.string().nullable(),
|
|
223
|
+
region: z.string().nullable(),
|
|
224
|
+
regionAssignedAt: z.string().nullable(),
|
|
225
|
+
createdAt: z.string(),
|
|
226
|
+
}) as z.ZodType<PlatformWorkspace>;
|
|
227
|
+
|
|
228
|
+
const PlatformWorkspaceUserSchema = z.object({
|
|
229
|
+
id: z.string(),
|
|
230
|
+
name: z.string(),
|
|
231
|
+
email: z.string(),
|
|
232
|
+
role: z.string(),
|
|
233
|
+
createdAt: z.string(),
|
|
234
|
+
}) as z.ZodType<PlatformWorkspaceUser>;
|
|
235
|
+
|
|
236
|
+
export const NoisyNeighborSchema = z.object({
|
|
237
|
+
workspaceId: z.string(),
|
|
238
|
+
workspaceName: z.string(),
|
|
239
|
+
planTier: z.string(),
|
|
240
|
+
metric: z.string(),
|
|
241
|
+
value: z.number(),
|
|
242
|
+
median: z.number(),
|
|
243
|
+
ratio: z.number(),
|
|
244
|
+
}) as z.ZodType<NoisyNeighbor>;
|
|
245
|
+
|
|
246
|
+
export const PlatformWorkspacesResponseSchema = z.object({
|
|
247
|
+
workspaces: z.array(PlatformWorkspaceSchema),
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
export const PlatformNeighborsResponseSchema = z.object({
|
|
251
|
+
neighbors: z.array(NoisyNeighborSchema),
|
|
252
|
+
medians: z.object({
|
|
253
|
+
queries: z.number(),
|
|
254
|
+
tokens: z.number(),
|
|
255
|
+
storage: z.number(),
|
|
256
|
+
}),
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
export const PlatformWorkspaceDetailResponseSchema = z.object({
|
|
260
|
+
workspace: PlatformWorkspaceSchema,
|
|
261
|
+
users: z.array(PlatformWorkspaceUserSchema),
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
// ── Backups ──────────────────────────────────────────────────────
|
|
265
|
+
|
|
266
|
+
export const BackupEntrySchema = z.object({
|
|
267
|
+
id: z.string(),
|
|
268
|
+
status: z.string(),
|
|
269
|
+
sizeBytes: z.number().nullable(),
|
|
270
|
+
storagePath: z.string(),
|
|
271
|
+
createdAt: z.string(),
|
|
272
|
+
retentionExpiresAt: z.string(),
|
|
273
|
+
errorMessage: z.string().nullable(),
|
|
274
|
+
}) as z.ZodType<BackupEntry>;
|
|
275
|
+
|
|
276
|
+
export const BackupConfigSchema = z.object({
|
|
277
|
+
schedule: z.string(),
|
|
278
|
+
retentionDays: z.number(),
|
|
279
|
+
storagePath: z.string(),
|
|
280
|
+
}) as z.ZodType<BackupConfig>;
|
|
281
|
+
|
|
282
|
+
export const BackupsResponseSchema = z.object({
|
|
283
|
+
backups: z.array(BackupEntrySchema),
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
// ── Custom Domain ────────────────────────────────────────────────
|
|
287
|
+
|
|
288
|
+
export const CustomDomainSchema = z.object({
|
|
289
|
+
id: z.string(),
|
|
290
|
+
workspaceId: z.string(),
|
|
291
|
+
domain: z.string(),
|
|
292
|
+
status: z.string(),
|
|
293
|
+
railwayDomainId: z.string().nullable(),
|
|
294
|
+
cnameTarget: z.string().nullable(),
|
|
295
|
+
certificateStatus: z.string().nullable(),
|
|
296
|
+
createdAt: z.string(),
|
|
297
|
+
verifiedAt: z.string().nullable(),
|
|
298
|
+
}) as z.ZodType<CustomDomain>;
|
|
299
|
+
|
|
300
|
+
export const DomainResponseSchema = z.object({
|
|
301
|
+
domain: CustomDomainSchema.nullable(),
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
export const DomainsResponseSchema = z.object({
|
|
305
|
+
domains: z.array(CustomDomainSchema),
|
|
306
|
+
});
|
|
307
|
+
|
|
308
|
+
// ── Region / Residency ───────────────────────────────────────────
|
|
309
|
+
|
|
310
|
+
export const RegionPickerItemSchema = z.object({
|
|
311
|
+
id: z.string(),
|
|
312
|
+
label: z.string(),
|
|
313
|
+
isDefault: z.boolean(),
|
|
314
|
+
}) as z.ZodType<RegionPickerItem>;
|
|
315
|
+
|
|
316
|
+
export const RegionStatusSchema = z.object({
|
|
317
|
+
region: z.string(),
|
|
318
|
+
label: z.string(),
|
|
319
|
+
workspaceCount: z.number(),
|
|
320
|
+
healthy: z.boolean(),
|
|
321
|
+
}) as z.ZodType<RegionStatus>;
|
|
322
|
+
|
|
323
|
+
export const WorkspaceRegionSchema = z.object({
|
|
324
|
+
workspaceId: z.string(),
|
|
325
|
+
region: z.string(),
|
|
326
|
+
assignedAt: z.string(),
|
|
327
|
+
}) as z.ZodType<WorkspaceRegion>;
|
|
328
|
+
|
|
329
|
+
export const RegionsResponseSchema = z.object({
|
|
330
|
+
regions: z.array(RegionStatusSchema),
|
|
331
|
+
defaultRegion: z.string(),
|
|
332
|
+
});
|
|
333
|
+
|
|
334
|
+
export const AssignmentsResponseSchema = z.object({
|
|
335
|
+
assignments: z.array(WorkspaceRegionSchema),
|
|
336
|
+
});
|
|
337
|
+
|
|
338
|
+
export const RegionMigrationSchema = z.object({
|
|
339
|
+
id: z.string(),
|
|
340
|
+
workspaceId: z.string(),
|
|
341
|
+
sourceRegion: z.string(),
|
|
342
|
+
targetRegion: z.string(),
|
|
343
|
+
status: z.enum(["pending", "in_progress", "completed", "failed"]),
|
|
344
|
+
requestedBy: z.string().nullable(),
|
|
345
|
+
requestedAt: z.string(),
|
|
346
|
+
completedAt: z.string().nullable(),
|
|
347
|
+
errorMessage: z.string().nullable(),
|
|
348
|
+
}) as z.ZodType<RegionMigration>;
|
|
349
|
+
|
|
350
|
+
export const MigrationStatusResponseSchema = z.object({
|
|
351
|
+
migration: RegionMigrationSchema.nullable(),
|
|
352
|
+
});
|
|
353
|
+
|
|
354
|
+
// ── SLA ──────────────────────────────────────────────────────────
|
|
355
|
+
|
|
356
|
+
export const WorkspaceSLASummarySchema = z.object({
|
|
357
|
+
workspaceId: z.string(),
|
|
358
|
+
workspaceName: z.string(),
|
|
359
|
+
latencyP50Ms: z.number(),
|
|
360
|
+
latencyP95Ms: z.number(),
|
|
361
|
+
latencyP99Ms: z.number(),
|
|
362
|
+
errorRatePct: z.number(),
|
|
363
|
+
uptimePct: z.number(),
|
|
364
|
+
totalQueries: z.number(),
|
|
365
|
+
failedQueries: z.number(),
|
|
366
|
+
lastQueryAt: z.string().nullable(),
|
|
367
|
+
}) as z.ZodType<WorkspaceSLASummary>;
|
|
368
|
+
|
|
369
|
+
const SLAMetricPointSchema = z.object({
|
|
370
|
+
timestamp: z.string(),
|
|
371
|
+
value: z.number(),
|
|
372
|
+
}) as z.ZodType<SLAMetricPoint>;
|
|
373
|
+
|
|
374
|
+
export const WorkspaceSLADetailSchema = z.object({
|
|
375
|
+
summary: WorkspaceSLASummarySchema,
|
|
376
|
+
latencyTimeline: z.array(SLAMetricPointSchema),
|
|
377
|
+
errorTimeline: z.array(SLAMetricPointSchema),
|
|
378
|
+
}) as z.ZodType<WorkspaceSLADetail>;
|
|
379
|
+
|
|
380
|
+
export const SLAAlertSchema = z.object({
|
|
381
|
+
id: z.string(),
|
|
382
|
+
workspaceId: z.string(),
|
|
383
|
+
workspaceName: z.string(),
|
|
384
|
+
type: z.string(),
|
|
385
|
+
status: z.string(),
|
|
386
|
+
message: z.string(),
|
|
387
|
+
currentValue: z.number(),
|
|
388
|
+
threshold: z.number(),
|
|
389
|
+
firedAt: z.string(),
|
|
390
|
+
resolvedAt: z.string().nullable(),
|
|
391
|
+
acknowledgedAt: z.string().nullable(),
|
|
392
|
+
acknowledgedBy: z.string().nullable(),
|
|
393
|
+
}) as z.ZodType<SLAAlert>;
|
|
394
|
+
|
|
395
|
+
export const SLAThresholdsSchema = z.object({
|
|
396
|
+
latencyP99Ms: z.number(),
|
|
397
|
+
errorRatePct: z.number(),
|
|
398
|
+
}) as z.ZodType<SLAThresholds>;
|
|
399
|
+
|
|
400
|
+
export const SLAWorkspacesResponseSchema = z.object({
|
|
401
|
+
workspaces: z.array(WorkspaceSLASummarySchema),
|
|
402
|
+
hoursBack: z.number(),
|
|
403
|
+
});
|
|
404
|
+
|
|
405
|
+
export const SLAAlertsResponseSchema = z.object({
|
|
406
|
+
alerts: z.array(SLAAlertSchema),
|
|
407
|
+
});
|
|
408
|
+
|
|
409
|
+
// ── Audit ────────────────────────────────────────────────────────
|
|
410
|
+
|
|
411
|
+
export const AuditStatsSchema = z.object({
|
|
412
|
+
totalQueries: z.number(),
|
|
413
|
+
totalErrors: z.number(),
|
|
414
|
+
errorRate: z.number(),
|
|
415
|
+
queriesPerDay: z.array(z.object({ day: z.string(), count: z.number() })),
|
|
416
|
+
});
|
|
417
|
+
|
|
418
|
+
export const AuditFacetsSchema = z.object({
|
|
419
|
+
tables: z.array(z.string()),
|
|
420
|
+
columns: z.array(z.string()),
|
|
421
|
+
});
|
|
422
|
+
|
|
423
|
+
export const AuditConnectionMetaSchema = z.object({
|
|
424
|
+
connections: z.array(z.object({
|
|
425
|
+
id: z.string(),
|
|
426
|
+
description: z.string().optional(),
|
|
427
|
+
})),
|
|
428
|
+
});
|
|
429
|
+
|
|
430
|
+
// ── Audit Analytics ──────────────────────────────────────────────
|
|
431
|
+
|
|
432
|
+
export const VolumePointSchema = z.object({
|
|
433
|
+
day: z.string(),
|
|
434
|
+
count: z.number(),
|
|
435
|
+
errors: z.number(),
|
|
436
|
+
});
|
|
437
|
+
|
|
438
|
+
export const SlowQuerySchema = z.object({
|
|
439
|
+
query: z.string(),
|
|
440
|
+
avgDuration: z.number(),
|
|
441
|
+
maxDuration: z.number(),
|
|
442
|
+
count: z.number(),
|
|
443
|
+
});
|
|
444
|
+
|
|
445
|
+
export const FrequentQuerySchema = z.object({
|
|
446
|
+
query: z.string(),
|
|
447
|
+
count: z.number(),
|
|
448
|
+
avgDuration: z.number(),
|
|
449
|
+
errorCount: z.number(),
|
|
450
|
+
});
|
|
451
|
+
|
|
452
|
+
export const ErrorGroupSchema = z.object({
|
|
453
|
+
error: z.string(),
|
|
454
|
+
count: z.number(),
|
|
455
|
+
});
|
|
456
|
+
|
|
457
|
+
export const AuditUserStatsSchema = z.object({
|
|
458
|
+
userId: z.string(),
|
|
459
|
+
userEmail: z.string().nullable().optional(),
|
|
460
|
+
count: z.number(),
|
|
461
|
+
avgDuration: z.number(),
|
|
462
|
+
errorCount: z.number(),
|
|
463
|
+
errorRate: z.number(),
|
|
464
|
+
});
|
|
465
|
+
|
|
466
|
+
export const AuditVolumeResponseSchema = z.object({
|
|
467
|
+
volume: z.array(VolumePointSchema),
|
|
468
|
+
});
|
|
469
|
+
|
|
470
|
+
export const AuditSlowResponseSchema = z.object({
|
|
471
|
+
queries: z.array(SlowQuerySchema),
|
|
472
|
+
});
|
|
473
|
+
|
|
474
|
+
export const AuditFrequentResponseSchema = z.object({
|
|
475
|
+
queries: z.array(FrequentQuerySchema),
|
|
476
|
+
});
|
|
477
|
+
|
|
478
|
+
export const AuditErrorsResponseSchema = z.object({
|
|
479
|
+
errors: z.array(ErrorGroupSchema),
|
|
480
|
+
});
|
|
481
|
+
|
|
482
|
+
export const AuditUsersResponseSchema = z.object({
|
|
483
|
+
users: z.array(AuditUserStatsSchema),
|
|
484
|
+
});
|
|
485
|
+
|
|
486
|
+
// ── Billing ──────────────────────────────────────────────────────
|
|
487
|
+
|
|
488
|
+
export const BillingStatusSchema = z.object({
|
|
489
|
+
workspaceId: z.string(),
|
|
490
|
+
plan: z.object({
|
|
491
|
+
tier: z.string(),
|
|
492
|
+
displayName: z.string(),
|
|
493
|
+
byot: z.boolean(),
|
|
494
|
+
trialEndsAt: z.string().nullable(),
|
|
495
|
+
}),
|
|
496
|
+
limits: z.object({
|
|
497
|
+
queriesPerMonth: z.number().nullable(),
|
|
498
|
+
tokensPerMonth: z.number().nullable(),
|
|
499
|
+
maxMembers: z.number().nullable(),
|
|
500
|
+
maxConnections: z.number().nullable(),
|
|
501
|
+
}),
|
|
502
|
+
usage: z.object({
|
|
503
|
+
queryCount: z.number(),
|
|
504
|
+
tokenCount: z.number(),
|
|
505
|
+
queryUsagePercent: z.number(),
|
|
506
|
+
tokenUsagePercent: z.number(),
|
|
507
|
+
queryOverageStatus: z.string(),
|
|
508
|
+
tokenOverageStatus: z.string(),
|
|
509
|
+
periodStart: z.string(),
|
|
510
|
+
periodEnd: z.string(),
|
|
511
|
+
}),
|
|
512
|
+
subscription: z.object({
|
|
513
|
+
stripeSubscriptionId: z.string(),
|
|
514
|
+
plan: z.string(),
|
|
515
|
+
status: z.string(),
|
|
516
|
+
}).nullable(),
|
|
517
|
+
});
|
|
518
|
+
|
|
519
|
+
// ── Sessions ─────────────────────────────────────────────────────
|
|
520
|
+
|
|
521
|
+
export const SessionStatsSchema = z.object({
|
|
522
|
+
total: z.number(),
|
|
523
|
+
active: z.number(),
|
|
524
|
+
uniqueUsers: z.number(),
|
|
525
|
+
});
|
|
526
|
+
|
|
527
|
+
// ── Token Usage ──────────────────────────────────────────────────
|
|
528
|
+
|
|
529
|
+
export const TokenSummarySchema = z.object({
|
|
530
|
+
totalPromptTokens: z.number(),
|
|
531
|
+
totalCompletionTokens: z.number(),
|
|
532
|
+
totalTokens: z.number(),
|
|
533
|
+
totalRequests: z.number(),
|
|
534
|
+
from: z.string(),
|
|
535
|
+
to: z.string(),
|
|
536
|
+
});
|
|
537
|
+
|
|
538
|
+
const UserTokenRowSchema = z.object({
|
|
539
|
+
userId: z.string(),
|
|
540
|
+
userEmail: z.string().nullable().optional(),
|
|
541
|
+
promptTokens: z.number(),
|
|
542
|
+
completionTokens: z.number(),
|
|
543
|
+
totalTokens: z.number(),
|
|
544
|
+
requestCount: z.number(),
|
|
545
|
+
});
|
|
546
|
+
|
|
547
|
+
const TrendPointSchema = z.object({
|
|
548
|
+
day: z.string(),
|
|
549
|
+
promptTokens: z.number(),
|
|
550
|
+
completionTokens: z.number(),
|
|
551
|
+
totalTokens: z.number(),
|
|
552
|
+
requestCount: z.number(),
|
|
553
|
+
});
|
|
554
|
+
|
|
555
|
+
export const TrendsResponseSchema = z.object({
|
|
556
|
+
trends: z.array(TrendPointSchema),
|
|
557
|
+
from: z.string(),
|
|
558
|
+
to: z.string(),
|
|
559
|
+
});
|
|
560
|
+
|
|
561
|
+
export const TokenUserResponseSchema = z.object({
|
|
562
|
+
users: z.array(UserTokenRowSchema),
|
|
563
|
+
});
|
|
564
|
+
|
|
565
|
+
// ── Usage ────────────────────────────────────────────────────────
|
|
566
|
+
|
|
567
|
+
const DailyUsagePointSchema = z.object({
|
|
568
|
+
period_start: z.string(),
|
|
569
|
+
query_count: z.number(),
|
|
570
|
+
token_count: z.number(),
|
|
571
|
+
active_users: z.number(),
|
|
572
|
+
});
|
|
573
|
+
|
|
574
|
+
const UserUsageRowSchema = z.object({
|
|
575
|
+
user_id: z.string(),
|
|
576
|
+
query_count: z.number(),
|
|
577
|
+
token_count: z.number(),
|
|
578
|
+
login_count: z.number(),
|
|
579
|
+
});
|
|
580
|
+
|
|
581
|
+
export const UsageSummarySchema = z.object({
|
|
582
|
+
workspaceId: z.string(),
|
|
583
|
+
current: z.object({
|
|
584
|
+
queryCount: z.number(),
|
|
585
|
+
tokenCount: z.number(),
|
|
586
|
+
activeUsers: z.number(),
|
|
587
|
+
periodStart: z.string(),
|
|
588
|
+
periodEnd: z.string(),
|
|
589
|
+
}),
|
|
590
|
+
plan: z.object({
|
|
591
|
+
tier: z.string(),
|
|
592
|
+
displayName: z.string(),
|
|
593
|
+
trialEndsAt: z.string().nullable(),
|
|
594
|
+
}),
|
|
595
|
+
limits: z.object({
|
|
596
|
+
queriesPerMonth: z.number().nullable(),
|
|
597
|
+
tokensPerMonth: z.number().nullable(),
|
|
598
|
+
maxMembers: z.number().nullable(),
|
|
599
|
+
maxConnections: z.number().nullable(),
|
|
600
|
+
}),
|
|
601
|
+
history: z.array(DailyUsagePointSchema),
|
|
602
|
+
users: z.array(UserUsageRowSchema),
|
|
603
|
+
hasStripe: z.boolean(),
|
|
604
|
+
});
|
|
605
|
+
|
|
606
|
+
// ── Users ────────────────────────────────────────────────────────
|
|
607
|
+
|
|
608
|
+
export const UserStatsSchema = z.object({
|
|
609
|
+
total: z.number(),
|
|
610
|
+
banned: z.number(),
|
|
611
|
+
byRole: z.record(z.string(), z.number()),
|
|
612
|
+
});
|
|
613
|
+
|
|
614
|
+
// ── API Keys ─────────────────────────────────────────────────────
|
|
615
|
+
|
|
616
|
+
const ApiKeyRowSchema = z.object({
|
|
617
|
+
id: z.string(),
|
|
618
|
+
name: z.string().nullable(),
|
|
619
|
+
start: z.string().nullable(),
|
|
620
|
+
prefix: z.string().nullable(),
|
|
621
|
+
createdAt: z.string(),
|
|
622
|
+
expiresAt: z.string().nullable(),
|
|
623
|
+
lastRequest: z.string().nullable(),
|
|
624
|
+
});
|
|
625
|
+
|
|
626
|
+
export const ListApiKeysResponseSchema = z.object({
|
|
627
|
+
apiKeys: z.array(ApiKeyRowSchema),
|
|
628
|
+
total: z.number(),
|
|
629
|
+
});
|
|
630
|
+
|
|
631
|
+
// ── Integrations ─────────────────────────────────────────────────
|
|
632
|
+
|
|
633
|
+
const SlackStatusSchema = z.object({
|
|
634
|
+
connected: z.boolean(),
|
|
635
|
+
teamId: z.string().nullable(),
|
|
636
|
+
workspaceName: z.string().nullable(),
|
|
637
|
+
installedAt: z.string().nullable(),
|
|
638
|
+
oauthConfigured: z.boolean(),
|
|
639
|
+
envConfigured: z.boolean(),
|
|
640
|
+
configurable: z.boolean(),
|
|
641
|
+
});
|
|
642
|
+
|
|
643
|
+
const TeamsStatusSchema = z.object({
|
|
644
|
+
connected: z.boolean(),
|
|
645
|
+
tenantId: z.string().nullable(),
|
|
646
|
+
tenantName: z.string().nullable(),
|
|
647
|
+
installedAt: z.string().nullable(),
|
|
648
|
+
configurable: z.boolean(),
|
|
649
|
+
});
|
|
650
|
+
|
|
651
|
+
const DiscordStatusSchema = z.object({
|
|
652
|
+
connected: z.boolean(),
|
|
653
|
+
guildId: z.string().nullable(),
|
|
654
|
+
guildName: z.string().nullable(),
|
|
655
|
+
installedAt: z.string().nullable(),
|
|
656
|
+
configurable: z.boolean(),
|
|
657
|
+
});
|
|
658
|
+
|
|
659
|
+
const TelegramStatusSchema = z.object({
|
|
660
|
+
connected: z.boolean(),
|
|
661
|
+
botId: z.string().nullable(),
|
|
662
|
+
botUsername: z.string().nullable(),
|
|
663
|
+
installedAt: z.string().nullable(),
|
|
664
|
+
configurable: z.boolean(),
|
|
665
|
+
});
|
|
666
|
+
|
|
667
|
+
const GChatStatusSchema = z.object({
|
|
668
|
+
connected: z.boolean(),
|
|
669
|
+
projectId: z.string().nullable(),
|
|
670
|
+
serviceAccountEmail: z.string().nullable(),
|
|
671
|
+
installedAt: z.string().nullable(),
|
|
672
|
+
configurable: z.boolean(),
|
|
673
|
+
});
|
|
674
|
+
|
|
675
|
+
const GitHubStatusSchema = z.object({
|
|
676
|
+
connected: z.boolean(),
|
|
677
|
+
username: z.string().nullable(),
|
|
678
|
+
installedAt: z.string().nullable(),
|
|
679
|
+
configurable: z.boolean(),
|
|
680
|
+
});
|
|
681
|
+
|
|
682
|
+
const LinearStatusSchema = z.object({
|
|
683
|
+
connected: z.boolean(),
|
|
684
|
+
userName: z.string().nullable(),
|
|
685
|
+
userEmail: z.string().nullable(),
|
|
686
|
+
installedAt: z.string().nullable(),
|
|
687
|
+
configurable: z.boolean(),
|
|
688
|
+
});
|
|
689
|
+
|
|
690
|
+
const WhatsAppStatusSchema = z.object({
|
|
691
|
+
connected: z.boolean(),
|
|
692
|
+
phoneNumberId: z.string().nullable(),
|
|
693
|
+
displayPhone: z.string().nullable(),
|
|
694
|
+
installedAt: z.string().nullable(),
|
|
695
|
+
configurable: z.boolean(),
|
|
696
|
+
});
|
|
697
|
+
|
|
698
|
+
const EmailStatusSchema = z.object({
|
|
699
|
+
connected: z.boolean(),
|
|
700
|
+
provider: z.string().nullable(),
|
|
701
|
+
senderAddress: z.string().nullable(),
|
|
702
|
+
installedAt: z.string().nullable(),
|
|
703
|
+
configurable: z.boolean(),
|
|
704
|
+
});
|
|
705
|
+
|
|
706
|
+
const WebhookStatusSchema = z.object({
|
|
707
|
+
activeCount: z.number(),
|
|
708
|
+
configurable: z.boolean(),
|
|
709
|
+
});
|
|
710
|
+
|
|
711
|
+
export const IntegrationStatusSchema = z.object({
|
|
712
|
+
slack: SlackStatusSchema,
|
|
713
|
+
teams: TeamsStatusSchema,
|
|
714
|
+
discord: DiscordStatusSchema,
|
|
715
|
+
telegram: TelegramStatusSchema,
|
|
716
|
+
gchat: GChatStatusSchema,
|
|
717
|
+
github: GitHubStatusSchema,
|
|
718
|
+
linear: LinearStatusSchema,
|
|
719
|
+
whatsapp: WhatsAppStatusSchema,
|
|
720
|
+
email: EmailStatusSchema,
|
|
721
|
+
webhooks: WebhookStatusSchema,
|
|
722
|
+
deliveryChannels: z.array(z.string()),
|
|
723
|
+
deployMode: z.string(),
|
|
724
|
+
hasInternalDB: z.boolean(),
|
|
725
|
+
});
|
|
726
|
+
|
|
727
|
+
// ── Plugins ──────────────────────────────────────────────────────
|
|
728
|
+
|
|
729
|
+
const PluginDescriptionSchema = z.object({
|
|
730
|
+
id: z.string(),
|
|
731
|
+
types: z.array(z.enum(["datasource", "context", "interaction", "action", "sandbox"])),
|
|
732
|
+
version: z.string(),
|
|
733
|
+
name: z.string(),
|
|
734
|
+
status: z.enum(["registered", "initializing", "healthy", "unhealthy", "teardown"]),
|
|
735
|
+
enabled: z.boolean(),
|
|
736
|
+
});
|
|
737
|
+
|
|
738
|
+
export const PluginListResponseSchema = z.object({
|
|
739
|
+
plugins: z.array(PluginDescriptionSchema).optional(),
|
|
740
|
+
manageable: z.boolean().optional(),
|
|
741
|
+
}).transform((r) => ({
|
|
742
|
+
plugins: r.plugins ?? [],
|
|
743
|
+
manageable: r.manageable ?? false,
|
|
744
|
+
}));
|