@useatlas/create 0.0.6 → 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
|
@@ -23,7 +23,7 @@ DROP TABLE IF EXISTS notifications_backup CASCADE;
|
|
|
23
23
|
DROP TABLE IF EXISTS feature_flags_legacy CASCADE;
|
|
24
24
|
DROP TABLE IF EXISTS temp_asset_import_2024 CASCADE;
|
|
25
25
|
DROP TABLE IF EXISTS old_scan_results_v2 CASCADE;
|
|
26
|
-
DROP TABLE IF EXISTS
|
|
26
|
+
DROP TABLE IF EXISTS sec_audit_log CASCADE;
|
|
27
27
|
DROP TABLE IF EXISTS integration_events CASCADE;
|
|
28
28
|
DROP TABLE IF EXISTS integrations CASCADE;
|
|
29
29
|
DROP TABLE IF EXISTS dashboard_widgets CASCADE;
|
|
@@ -72,7 +72,7 @@ DROP TABLE IF EXISTS invoices CASCADE;
|
|
|
72
72
|
DROP TABLE IF EXISTS subscription_events CASCADE;
|
|
73
73
|
DROP TABLE IF EXISTS subscriptions CASCADE;
|
|
74
74
|
DROP TABLE IF EXISTS plans CASCADE;
|
|
75
|
-
DROP TABLE IF EXISTS
|
|
75
|
+
DROP TABLE IF EXISTS sec_invitations CASCADE;
|
|
76
76
|
DROP TABLE IF EXISTS team_memberships CASCADE;
|
|
77
77
|
DROP TABLE IF EXISTS teams CASCADE;
|
|
78
78
|
DROP TABLE IF EXISTS users CASCADE;
|
|
@@ -145,7 +145,7 @@ CREATE TABLE team_memberships (
|
|
|
145
145
|
PRIMARY KEY (user_id, team_id)
|
|
146
146
|
);
|
|
147
147
|
|
|
148
|
-
CREATE TABLE
|
|
148
|
+
CREATE TABLE sec_invitations (
|
|
149
149
|
id SERIAL PRIMARY KEY,
|
|
150
150
|
organization_id INTEGER NOT NULL REFERENCES organizations(id),
|
|
151
151
|
email TEXT NOT NULL,
|
|
@@ -709,7 +709,7 @@ CREATE TABLE integration_events (
|
|
|
709
709
|
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
|
|
710
710
|
);
|
|
711
711
|
|
|
712
|
-
CREATE TABLE
|
|
712
|
+
CREATE TABLE sec_audit_log (
|
|
713
713
|
id SERIAL PRIMARY KEY,
|
|
714
714
|
organization_id INTEGER, -- no FK (standalone audit)
|
|
715
715
|
user_id INTEGER, -- no FK
|
|
@@ -810,8 +810,8 @@ CREATE INDEX idx_subscriptions_org ON subscriptions(organization_id);
|
|
|
810
810
|
CREATE INDEX idx_compliance_findings_assessment ON compliance_findings(assessment_id);
|
|
811
811
|
CREATE INDEX idx_api_requests_created ON api_requests(created_at);
|
|
812
812
|
CREATE INDEX idx_login_events_user ON login_events(user_id);
|
|
813
|
-
CREATE INDEX
|
|
814
|
-
CREATE INDEX
|
|
813
|
+
CREATE INDEX idx_sec_audit_log_org ON sec_audit_log(organization_id);
|
|
814
|
+
CREATE INDEX idx_sec_audit_log_created ON sec_audit_log(created_at);
|
|
815
815
|
CREATE INDEX idx_scan_results_denorm_org ON scan_results_denormalized(organization_id);
|
|
816
816
|
CREATE INDEX idx_scan_results_denorm_found ON scan_results_denormalized(found_at);
|
|
817
817
|
|
|
@@ -1016,7 +1016,7 @@ FROM (
|
|
|
1016
1016
|
) AS src;
|
|
1017
1017
|
|
|
1018
1018
|
-- ---------- Invitations (150) ----------
|
|
1019
|
-
INSERT INTO
|
|
1019
|
+
INSERT INTO sec_invitations (organization_id, email, role_name, invited_by, status, created_at, expires_at)
|
|
1020
1020
|
SELECT
|
|
1021
1021
|
1 + floor(random() * 200)::int,
|
|
1022
1022
|
'invite' || g || '@example.com',
|
|
@@ -1859,7 +1859,7 @@ SELECT
|
|
|
1859
1859
|
FROM generate_series(1, 5000) AS g;
|
|
1860
1860
|
|
|
1861
1861
|
-- ---------- Audit Log (25,000) ----------
|
|
1862
|
-
INSERT INTO
|
|
1862
|
+
INSERT INTO sec_audit_log (organization_id, user_id, action, resource_type, resource_id, details, ip_address, created_at)
|
|
1863
1863
|
SELECT
|
|
1864
1864
|
1 + floor(random() * 200)::int, -- no FK
|
|
1865
1865
|
1 + floor(random() * 2000)::int, -- no FK
|
|
@@ -35,6 +35,9 @@ CREATE TABLE IF NOT EXISTS accounts (
|
|
|
35
35
|
contract_end DATE
|
|
36
36
|
);
|
|
37
37
|
|
|
38
|
+
-- Ensure idempotent seeding (safe to re-run without doubling rows)
|
|
39
|
+
TRUNCATE TABLE accounts, people, companies RESTART IDENTITY CASCADE;
|
|
40
|
+
|
|
38
41
|
-- Seed data: 50 companies
|
|
39
42
|
INSERT INTO companies (name, industry, employee_count, founded_year, country, revenue, valuation) VALUES
|
|
40
43
|
('Acme Corp', 'Technology', 450, 2010, 'US', 85000000, 340000000),
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
version: "1.0"
|
|
2
|
+
name: NovaMart — E-Commerce DTC Brand
|
|
3
|
+
description: |
|
|
4
|
+
Direct-to-consumer e-commerce marketplace dataset for NovaMart. Covers the full
|
|
5
|
+
lifecycle: product catalog with multi-seller marketplace, customer acquisition and
|
|
6
|
+
loyalty, orders and payments, shipping and fulfillment, returns, marketing campaigns,
|
|
7
|
+
product reviews, and inventory management. Use this dataset to explore revenue
|
|
8
|
+
analysis, conversion funnels, customer lifetime value, fulfillment performance,
|
|
9
|
+
marketplace seller health, and marketing attribution.
|
|
10
|
+
|
|
11
|
+
Note: The database contains 52 tables total, but 4 are legacy/abandoned
|
|
12
|
+
(old_orders_v1, temp_product_import_2023, legacy_analytics_events,
|
|
13
|
+
payment_methods_backup) and several are low-value junction or cache tables.
|
|
14
|
+
This semantic layer covers the 13 most important entities.
|
|
15
|
+
|
|
16
|
+
entities:
|
|
17
|
+
- name: Customers
|
|
18
|
+
file: entities/customers.yml
|
|
19
|
+
grain: one row per customer
|
|
20
|
+
description: >
|
|
21
|
+
Registered customers with contact info, acquisition source, and activity status.
|
|
22
|
+
Central dimension for all customer-level analysis.
|
|
23
|
+
use_for:
|
|
24
|
+
- Customer segmentation by acquisition source
|
|
25
|
+
- Active vs inactive customer analysis
|
|
26
|
+
- Cohort analysis by signup date
|
|
27
|
+
common_questions:
|
|
28
|
+
- How many active customers do we have?
|
|
29
|
+
- What are our top acquisition channels?
|
|
30
|
+
- How has customer growth trended month over month?
|
|
31
|
+
- What percentage of customers are inactive?
|
|
32
|
+
|
|
33
|
+
- name: Products
|
|
34
|
+
file: entities/products.yml
|
|
35
|
+
grain: one row per product
|
|
36
|
+
description: >
|
|
37
|
+
Product catalog with pricing, category, seller, and status. Some products
|
|
38
|
+
have seller_id for marketplace items. price is in dollars; price_cents is
|
|
39
|
+
sometimes NULL.
|
|
40
|
+
use_for:
|
|
41
|
+
- Product catalog analysis by category and seller
|
|
42
|
+
- Pricing distribution and tier analysis
|
|
43
|
+
- Product status and lifecycle tracking
|
|
44
|
+
common_questions:
|
|
45
|
+
- How many active products do we have?
|
|
46
|
+
- What is the average product price by category?
|
|
47
|
+
- Which sellers have the most products listed?
|
|
48
|
+
- How many products have missing price_cents values?
|
|
49
|
+
|
|
50
|
+
- name: Categories
|
|
51
|
+
file: entities/categories.yml
|
|
52
|
+
grain: one row per category
|
|
53
|
+
description: >
|
|
54
|
+
Hierarchical product categories with self-referencing parent_id.
|
|
55
|
+
Used to organize the product catalog.
|
|
56
|
+
use_for:
|
|
57
|
+
- Category hierarchy navigation
|
|
58
|
+
- Product distribution across categories
|
|
59
|
+
common_questions:
|
|
60
|
+
- How many top-level categories exist?
|
|
61
|
+
- Which categories have the most products?
|
|
62
|
+
|
|
63
|
+
- name: Orders
|
|
64
|
+
file: entities/orders.yml
|
|
65
|
+
grain: one row per order
|
|
66
|
+
description: >
|
|
67
|
+
Customer orders with monetary totals (in cents), status, shipping address,
|
|
68
|
+
and optional promotion. shipping_cost uses mixed units (dollars and cents).
|
|
69
|
+
use_for:
|
|
70
|
+
- Revenue and GMV analysis
|
|
71
|
+
- Order status and fulfillment tracking
|
|
72
|
+
- Promotion impact analysis
|
|
73
|
+
common_questions:
|
|
74
|
+
- What is our total GMV this quarter?
|
|
75
|
+
- What is the average order value?
|
|
76
|
+
- What percentage of orders used a promotion?
|
|
77
|
+
- How does order volume trend by month?
|
|
78
|
+
|
|
79
|
+
- name: Order Items
|
|
80
|
+
file: entities/order_items.yml
|
|
81
|
+
grain: one row per line item in an order
|
|
82
|
+
description: >
|
|
83
|
+
Individual line items within orders. Contains product name (denormalized),
|
|
84
|
+
quantity, and pricing in cents. product_variant_id has no foreign key constraint.
|
|
85
|
+
use_for:
|
|
86
|
+
- Product-level revenue attribution
|
|
87
|
+
- Basket analysis and cross-sell patterns
|
|
88
|
+
- Average items per order
|
|
89
|
+
common_questions:
|
|
90
|
+
- What are the top-selling products by revenue?
|
|
91
|
+
- What is the average number of items per order?
|
|
92
|
+
- Which products are most frequently purchased together?
|
|
93
|
+
|
|
94
|
+
- name: Payments
|
|
95
|
+
file: entities/payments.yml
|
|
96
|
+
grain: one row per payment transaction
|
|
97
|
+
description: >
|
|
98
|
+
Payment transactions for orders. Multiple payments can exist per order
|
|
99
|
+
(split payments, retries). order_id has no foreign key constraint.
|
|
100
|
+
use_for:
|
|
101
|
+
- Payment method analysis
|
|
102
|
+
- Payment success/failure rate tracking
|
|
103
|
+
- Revenue reconciliation
|
|
104
|
+
common_questions:
|
|
105
|
+
- What is our payment success rate?
|
|
106
|
+
- Which payment methods are most popular?
|
|
107
|
+
- How much revenue is pending vs captured?
|
|
108
|
+
|
|
109
|
+
- name: Returns
|
|
110
|
+
file: entities/returns.yml
|
|
111
|
+
grain: one row per return request
|
|
112
|
+
description: >
|
|
113
|
+
Return requests with reason (case-inconsistent values), status, and
|
|
114
|
+
resolution timing. Linked to orders and customers.
|
|
115
|
+
use_for:
|
|
116
|
+
- Return rate analysis
|
|
117
|
+
- Return reason categorization
|
|
118
|
+
- Resolution time tracking
|
|
119
|
+
common_questions:
|
|
120
|
+
- What is our overall return rate?
|
|
121
|
+
- What are the most common return reasons?
|
|
122
|
+
- What is the average time to resolve a return?
|
|
123
|
+
|
|
124
|
+
- name: Shipments
|
|
125
|
+
file: entities/shipments.yml
|
|
126
|
+
grain: one row per shipment
|
|
127
|
+
description: >
|
|
128
|
+
Shipment tracking with carrier, warehouse origin, and delivery timestamps.
|
|
129
|
+
carrier is a text field; carrier_id has no foreign key constraint.
|
|
130
|
+
use_for:
|
|
131
|
+
- Fulfillment speed analysis
|
|
132
|
+
- Carrier performance comparison
|
|
133
|
+
- Warehouse throughput tracking
|
|
134
|
+
common_questions:
|
|
135
|
+
- What is our average delivery time?
|
|
136
|
+
- Which carrier has the best on-time rate?
|
|
137
|
+
- How does fulfillment time vary by warehouse?
|
|
138
|
+
|
|
139
|
+
- name: Sellers
|
|
140
|
+
file: entities/sellers.yml
|
|
141
|
+
grain: one row per marketplace seller
|
|
142
|
+
description: >
|
|
143
|
+
Third-party marketplace sellers with commission rates and status.
|
|
144
|
+
Products link to sellers via seller_id.
|
|
145
|
+
use_for:
|
|
146
|
+
- Marketplace seller health and performance
|
|
147
|
+
- Commission rate analysis
|
|
148
|
+
- Seller onboarding and retention tracking
|
|
149
|
+
common_questions:
|
|
150
|
+
- How many active sellers are on the marketplace?
|
|
151
|
+
- What is the average commission rate?
|
|
152
|
+
- Which sellers generate the most GMV?
|
|
153
|
+
|
|
154
|
+
- name: Promotions
|
|
155
|
+
file: entities/promotions.yml
|
|
156
|
+
grain: one row per promotion
|
|
157
|
+
description: >
|
|
158
|
+
Discount codes and promotions with type, value, usage tracking,
|
|
159
|
+
and validity period.
|
|
160
|
+
use_for:
|
|
161
|
+
- Promotion effectiveness analysis
|
|
162
|
+
- Discount impact on revenue
|
|
163
|
+
- Usage rate and capacity tracking
|
|
164
|
+
common_questions:
|
|
165
|
+
- Which promotions have the highest usage?
|
|
166
|
+
- What is the average discount value applied?
|
|
167
|
+
- How many promotions are currently active?
|
|
168
|
+
|
|
169
|
+
- name: Product Reviews
|
|
170
|
+
file: entities/product_reviews.yml
|
|
171
|
+
grain: one row per review
|
|
172
|
+
description: >
|
|
173
|
+
Customer product reviews with 1-5 rating, optional decimal rating
|
|
174
|
+
(70% NULL), title, body, and verification status.
|
|
175
|
+
use_for:
|
|
176
|
+
- Product quality and sentiment analysis
|
|
177
|
+
- Review volume and rating trends
|
|
178
|
+
- Verified vs unverified review comparison
|
|
179
|
+
common_questions:
|
|
180
|
+
- What is the average product rating?
|
|
181
|
+
- Which products have the lowest ratings?
|
|
182
|
+
- What percentage of reviews are verified purchases?
|
|
183
|
+
|
|
184
|
+
- name: Email Campaigns
|
|
185
|
+
file: entities/email_campaigns.yml
|
|
186
|
+
grain: one row per email campaign
|
|
187
|
+
description: >
|
|
188
|
+
Marketing email campaigns with type, status, and send date.
|
|
189
|
+
Linked to email_sends for per-recipient delivery tracking.
|
|
190
|
+
use_for:
|
|
191
|
+
- Campaign performance analysis (open rate, click rate)
|
|
192
|
+
- Campaign type comparison
|
|
193
|
+
- Send volume and cadence tracking
|
|
194
|
+
common_questions:
|
|
195
|
+
- What are our average open and click rates?
|
|
196
|
+
- Which campaign types perform best?
|
|
197
|
+
- How many campaigns did we send this month?
|
|
198
|
+
|
|
199
|
+
- name: Inventory Levels
|
|
200
|
+
file: entities/inventory_levels.yml
|
|
201
|
+
grain: one row per variant-warehouse combination
|
|
202
|
+
description: >
|
|
203
|
+
Current inventory quantities per product variant per warehouse.
|
|
204
|
+
variant_id has no foreign key constraint. Includes reorder point thresholds.
|
|
205
|
+
use_for:
|
|
206
|
+
- Stock level monitoring and low-stock alerts
|
|
207
|
+
- Inventory distribution across warehouses
|
|
208
|
+
- Reorder point analysis
|
|
209
|
+
common_questions:
|
|
210
|
+
- Which variants are below reorder point?
|
|
211
|
+
- What is total inventory by warehouse?
|
|
212
|
+
- How is stock distributed across locations?
|
|
213
|
+
|
|
214
|
+
glossary: glossary.yml
|
|
215
|
+
metrics:
|
|
216
|
+
- file: metrics/revenue.yml
|
|
217
|
+
description: Revenue metrics (GMV, AOV, revenue by category/channel, refund rate)
|
|
218
|
+
- file: metrics/customers.yml
|
|
219
|
+
description: Customer metrics (LTV, repeat rate, cohort retention, acquisition)
|
|
220
|
+
- file: metrics/operations.yml
|
|
221
|
+
description: Operations metrics (fulfillment time, return rate, inventory turnover)
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
name: Categories
|
|
2
|
+
type: dimension_table
|
|
3
|
+
table: categories
|
|
4
|
+
grain: one row per category
|
|
5
|
+
description: |
|
|
6
|
+
Hierarchical product categories for the NovaMart catalog. Categories can have a
|
|
7
|
+
parent_id pointing to another category (self-referencing) to form a tree structure.
|
|
8
|
+
Top-level categories have parent_id = NULL. Used to organize and navigate products.
|
|
9
|
+
|
|
10
|
+
dimensions:
|
|
11
|
+
- name: id
|
|
12
|
+
sql: id
|
|
13
|
+
type: number
|
|
14
|
+
description: Primary key — unique category identifier
|
|
15
|
+
primary_key: true
|
|
16
|
+
|
|
17
|
+
- name: name
|
|
18
|
+
sql: name
|
|
19
|
+
type: string
|
|
20
|
+
description: Category display name
|
|
21
|
+
sample_values: [Electronics, Clothing, Home & Garden, Sports, Beauty]
|
|
22
|
+
|
|
23
|
+
- name: parent_id
|
|
24
|
+
sql: parent_id
|
|
25
|
+
type: number
|
|
26
|
+
description: |
|
|
27
|
+
Self-referencing foreign key to parent category.
|
|
28
|
+
NULL = top-level category.
|
|
29
|
+
|
|
30
|
+
- name: slug
|
|
31
|
+
sql: slug
|
|
32
|
+
type: string
|
|
33
|
+
description: URL-safe category identifier
|
|
34
|
+
|
|
35
|
+
- name: description
|
|
36
|
+
sql: description
|
|
37
|
+
type: string
|
|
38
|
+
description: Category description text
|
|
39
|
+
|
|
40
|
+
- name: created_at
|
|
41
|
+
sql: created_at
|
|
42
|
+
type: timestamp
|
|
43
|
+
description: When the category was created
|
|
44
|
+
|
|
45
|
+
- name: is_top_level
|
|
46
|
+
sql: CASE WHEN parent_id IS NULL THEN true ELSE false END
|
|
47
|
+
type: boolean
|
|
48
|
+
description: Whether this is a top-level (root) category
|
|
49
|
+
virtual: true
|
|
50
|
+
|
|
51
|
+
measures:
|
|
52
|
+
- name: category_count
|
|
53
|
+
sql: id
|
|
54
|
+
type: count_distinct
|
|
55
|
+
description: Number of unique categories
|
|
56
|
+
|
|
57
|
+
joins:
|
|
58
|
+
- target_entity: Categories
|
|
59
|
+
relationship: many_to_one
|
|
60
|
+
join_columns:
|
|
61
|
+
from: parent_id
|
|
62
|
+
to: id
|
|
63
|
+
description: Self-join to parent category for hierarchy traversal
|
|
64
|
+
|
|
65
|
+
use_cases:
|
|
66
|
+
- Product catalog organization and navigation
|
|
67
|
+
- Revenue and sales analysis by category hierarchy
|
|
68
|
+
- Category-level inventory and stock analysis
|
|
69
|
+
- Join to products for category performance metrics
|
|
70
|
+
|
|
71
|
+
query_patterns:
|
|
72
|
+
- name: top_level_categories
|
|
73
|
+
description: List all top-level categories with product counts
|
|
74
|
+
sql: |-
|
|
75
|
+
SELECT c.name AS category,
|
|
76
|
+
COUNT(p.id) AS product_count
|
|
77
|
+
FROM categories c
|
|
78
|
+
LEFT JOIN products p ON p.category_id = c.id AND p.status = 'active'
|
|
79
|
+
WHERE c.parent_id IS NULL
|
|
80
|
+
GROUP BY c.name
|
|
81
|
+
ORDER BY product_count DESC
|
|
82
|
+
|
|
83
|
+
- name: category_hierarchy
|
|
84
|
+
description: Categories with their parent category names
|
|
85
|
+
sql: |-
|
|
86
|
+
SELECT child.name AS category,
|
|
87
|
+
parent.name AS parent_category,
|
|
88
|
+
child.slug
|
|
89
|
+
FROM categories child
|
|
90
|
+
LEFT JOIN categories parent ON child.parent_id = parent.id
|
|
91
|
+
ORDER BY parent.name NULLS FIRST, child.name
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
name: Customers
|
|
2
|
+
type: dimension_table
|
|
3
|
+
table: customers
|
|
4
|
+
grain: one row per customer
|
|
5
|
+
description: |
|
|
6
|
+
Registered NovaMart customers. Contains contact information, acquisition channel,
|
|
7
|
+
and activity status. Each customer can have multiple orders, returns, reviews, and
|
|
8
|
+
loyalty transactions. This is the central dimension for all customer-level analysis.
|
|
9
|
+
|
|
10
|
+
Data quality note: acquisition_source has case inconsistencies (e.g. 'Organic' vs
|
|
11
|
+
'organic'). Use LOWER(acquisition_source) for reliable grouping.
|
|
12
|
+
|
|
13
|
+
dimensions:
|
|
14
|
+
- name: id
|
|
15
|
+
sql: id
|
|
16
|
+
type: number
|
|
17
|
+
description: Primary key — unique customer identifier
|
|
18
|
+
primary_key: true
|
|
19
|
+
|
|
20
|
+
- name: email
|
|
21
|
+
sql: email
|
|
22
|
+
type: string
|
|
23
|
+
description: Customer email address — unique per customer
|
|
24
|
+
|
|
25
|
+
- name: full_name
|
|
26
|
+
sql: full_name
|
|
27
|
+
type: string
|
|
28
|
+
description: Customer full name
|
|
29
|
+
|
|
30
|
+
- name: phone
|
|
31
|
+
sql: phone
|
|
32
|
+
type: string
|
|
33
|
+
description: Primary phone number (landline or unspecified)
|
|
34
|
+
|
|
35
|
+
- name: mobile_phone
|
|
36
|
+
sql: mobile_phone
|
|
37
|
+
type: string
|
|
38
|
+
description: Mobile phone number — may differ from phone
|
|
39
|
+
|
|
40
|
+
- name: acquisition_source
|
|
41
|
+
sql: acquisition_source
|
|
42
|
+
type: string
|
|
43
|
+
description: |
|
|
44
|
+
How this customer was acquired. WARNING: case-inconsistent values.
|
|
45
|
+
Use LOWER(acquisition_source) for reliable grouping.
|
|
46
|
+
sample_values: [organic, paid_search, social, referral, email, direct]
|
|
47
|
+
|
|
48
|
+
- name: created_at
|
|
49
|
+
sql: created_at
|
|
50
|
+
type: timestamp
|
|
51
|
+
description: When the customer account was created (signup date)
|
|
52
|
+
|
|
53
|
+
- name: updated_at
|
|
54
|
+
sql: updated_at
|
|
55
|
+
type: timestamp
|
|
56
|
+
description: Last update to the customer record
|
|
57
|
+
|
|
58
|
+
- name: is_active
|
|
59
|
+
sql: is_active
|
|
60
|
+
type: boolean
|
|
61
|
+
description: Whether the customer is currently active
|
|
62
|
+
|
|
63
|
+
- name: acquisition_source_normalized
|
|
64
|
+
sql: LOWER(acquisition_source)
|
|
65
|
+
type: string
|
|
66
|
+
description: Acquisition source normalized to lowercase for consistent grouping
|
|
67
|
+
virtual: true
|
|
68
|
+
sample_values: [organic, paid_search, social, referral, email, direct]
|
|
69
|
+
|
|
70
|
+
- name: signup_month
|
|
71
|
+
sql: TO_CHAR(created_at, 'YYYY-MM')
|
|
72
|
+
type: string
|
|
73
|
+
description: Year-month the customer signed up — useful for cohort analysis
|
|
74
|
+
virtual: true
|
|
75
|
+
|
|
76
|
+
- name: signup_year
|
|
77
|
+
sql: EXTRACT(YEAR FROM created_at)
|
|
78
|
+
type: number
|
|
79
|
+
description: Year the customer signed up
|
|
80
|
+
virtual: true
|
|
81
|
+
|
|
82
|
+
- name: has_phone
|
|
83
|
+
sql: CASE WHEN phone IS NOT NULL OR mobile_phone IS NOT NULL THEN true ELSE false END
|
|
84
|
+
type: boolean
|
|
85
|
+
description: Whether the customer has any phone number on file
|
|
86
|
+
virtual: true
|
|
87
|
+
|
|
88
|
+
measures:
|
|
89
|
+
- name: customer_count
|
|
90
|
+
sql: id
|
|
91
|
+
type: count_distinct
|
|
92
|
+
description: Number of unique customers
|
|
93
|
+
|
|
94
|
+
- name: active_customer_count
|
|
95
|
+
sql: CASE WHEN is_active THEN id END
|
|
96
|
+
type: count_distinct
|
|
97
|
+
description: Number of active customers
|
|
98
|
+
|
|
99
|
+
use_cases:
|
|
100
|
+
- Customer segmentation by acquisition source and signup cohort
|
|
101
|
+
- Active vs inactive customer analysis and re-engagement targeting
|
|
102
|
+
- Growth tracking — new signups over time
|
|
103
|
+
- Join to orders for purchase behavior and LTV analysis
|
|
104
|
+
- Join to product_reviews for review engagement by customer segment
|
|
105
|
+
|
|
106
|
+
query_patterns:
|
|
107
|
+
- name: customers_by_acquisition_source
|
|
108
|
+
description: Customer count by normalized acquisition channel
|
|
109
|
+
sql: |-
|
|
110
|
+
SELECT LOWER(acquisition_source) AS channel,
|
|
111
|
+
COUNT(*) AS customer_count,
|
|
112
|
+
COUNT(*) FILTER (WHERE is_active) AS active_count
|
|
113
|
+
FROM customers
|
|
114
|
+
GROUP BY LOWER(acquisition_source)
|
|
115
|
+
ORDER BY customer_count DESC
|
|
116
|
+
|
|
117
|
+
- name: customer_signups_by_month
|
|
118
|
+
description: Monthly signup trend
|
|
119
|
+
sql: |-
|
|
120
|
+
SELECT TO_CHAR(created_at, 'YYYY-MM') AS signup_month,
|
|
121
|
+
COUNT(*) AS new_customers
|
|
122
|
+
FROM customers
|
|
123
|
+
GROUP BY TO_CHAR(created_at, 'YYYY-MM')
|
|
124
|
+
ORDER BY signup_month
|
|
125
|
+
|
|
126
|
+
- name: active_vs_inactive_customers
|
|
127
|
+
description: Breakdown of active vs inactive customers
|
|
128
|
+
sql: |-
|
|
129
|
+
SELECT is_active,
|
|
130
|
+
COUNT(*) AS customer_count,
|
|
131
|
+
ROUND(100.0 * COUNT(*) / SUM(COUNT(*)) OVER (), 1) AS pct
|
|
132
|
+
FROM customers
|
|
133
|
+
GROUP BY is_active
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
name: Email Campaigns
|
|
2
|
+
type: fact_table
|
|
3
|
+
table: email_campaigns
|
|
4
|
+
grain: one row per email campaign
|
|
5
|
+
description: |
|
|
6
|
+
Marketing email campaigns sent to customers. Each campaign has a type (promotional,
|
|
7
|
+
transactional, newsletter, etc.), status, and send timestamp. Per-recipient delivery
|
|
8
|
+
details are in the email_sends table (campaign_id -> email_sends.campaign_id).
|
|
9
|
+
|
|
10
|
+
dimensions:
|
|
11
|
+
- name: id
|
|
12
|
+
sql: id
|
|
13
|
+
type: number
|
|
14
|
+
description: Primary key — unique campaign identifier
|
|
15
|
+
primary_key: true
|
|
16
|
+
|
|
17
|
+
- name: name
|
|
18
|
+
sql: name
|
|
19
|
+
type: string
|
|
20
|
+
description: Internal campaign name
|
|
21
|
+
|
|
22
|
+
- name: subject
|
|
23
|
+
sql: subject
|
|
24
|
+
type: string
|
|
25
|
+
description: Email subject line
|
|
26
|
+
|
|
27
|
+
- name: type
|
|
28
|
+
sql: type
|
|
29
|
+
type: string
|
|
30
|
+
description: Campaign type/category
|
|
31
|
+
sample_values: [promotional, transactional, newsletter, abandoned_cart, welcome]
|
|
32
|
+
|
|
33
|
+
- name: status
|
|
34
|
+
sql: status
|
|
35
|
+
type: string
|
|
36
|
+
description: Campaign status
|
|
37
|
+
sample_values: [draft, scheduled, sending, sent, cancelled]
|
|
38
|
+
|
|
39
|
+
- name: sent_at
|
|
40
|
+
sql: sent_at
|
|
41
|
+
type: timestamp
|
|
42
|
+
description: When the campaign was sent (NULL if draft/scheduled)
|
|
43
|
+
|
|
44
|
+
- name: created_at
|
|
45
|
+
sql: created_at
|
|
46
|
+
type: timestamp
|
|
47
|
+
description: When the campaign was created
|
|
48
|
+
|
|
49
|
+
- name: sent_month
|
|
50
|
+
sql: TO_CHAR(sent_at, 'YYYY-MM')
|
|
51
|
+
type: string
|
|
52
|
+
description: Year-month the campaign was sent
|
|
53
|
+
virtual: true
|
|
54
|
+
|
|
55
|
+
- name: is_sent
|
|
56
|
+
sql: CASE WHEN status = 'sent' THEN true ELSE false END
|
|
57
|
+
type: boolean
|
|
58
|
+
description: Whether the campaign has been sent
|
|
59
|
+
virtual: true
|
|
60
|
+
|
|
61
|
+
measures:
|
|
62
|
+
- name: campaign_count
|
|
63
|
+
sql: id
|
|
64
|
+
type: count_distinct
|
|
65
|
+
description: Number of unique campaigns
|
|
66
|
+
|
|
67
|
+
- name: sent_campaign_count
|
|
68
|
+
sql: CASE WHEN status = 'sent' THEN id END
|
|
69
|
+
type: count_distinct
|
|
70
|
+
description: Number of campaigns that have been sent
|
|
71
|
+
|
|
72
|
+
use_cases:
|
|
73
|
+
- Campaign performance analysis — open rates, click rates (via email_sends join)
|
|
74
|
+
- Campaign type comparison — which types drive the most engagement
|
|
75
|
+
- Send cadence and volume tracking over time
|
|
76
|
+
- Campaign status pipeline — draft to sent
|
|
77
|
+
- Join to email_sends for per-recipient delivery metrics
|
|
78
|
+
|
|
79
|
+
query_patterns:
|
|
80
|
+
- name: campaign_performance
|
|
81
|
+
description: Campaign open and click rates (requires email_sends join)
|
|
82
|
+
sql: |-
|
|
83
|
+
SELECT ec.name AS campaign,
|
|
84
|
+
ec.type,
|
|
85
|
+
ec.sent_at,
|
|
86
|
+
COUNT(es.id) AS total_sends,
|
|
87
|
+
COUNT(es.opened_at) AS opens,
|
|
88
|
+
COUNT(es.clicked_at) AS clicks,
|
|
89
|
+
ROUND(100.0 * COUNT(es.opened_at) / NULLIF(COUNT(es.id), 0), 1) AS open_rate,
|
|
90
|
+
ROUND(100.0 * COUNT(es.clicked_at) / NULLIF(COUNT(es.id), 0), 1) AS click_rate
|
|
91
|
+
FROM email_campaigns ec
|
|
92
|
+
JOIN email_sends es ON es.campaign_id = ec.id
|
|
93
|
+
WHERE ec.status = 'sent'
|
|
94
|
+
GROUP BY ec.name, ec.type, ec.sent_at
|
|
95
|
+
ORDER BY ec.sent_at DESC
|
|
96
|
+
|
|
97
|
+
- name: campaigns_by_type
|
|
98
|
+
description: Campaign count and avg engagement by type
|
|
99
|
+
sql: |-
|
|
100
|
+
SELECT ec.type,
|
|
101
|
+
COUNT(DISTINCT ec.id) AS campaign_count,
|
|
102
|
+
COUNT(es.id) AS total_sends,
|
|
103
|
+
ROUND(100.0 * COUNT(es.opened_at) / NULLIF(COUNT(es.id), 0), 1) AS avg_open_rate,
|
|
104
|
+
ROUND(100.0 * COUNT(es.clicked_at) / NULLIF(COUNT(es.id), 0), 1) AS avg_click_rate
|
|
105
|
+
FROM email_campaigns ec
|
|
106
|
+
JOIN email_sends es ON es.campaign_id = ec.id
|
|
107
|
+
WHERE ec.status = 'sent'
|
|
108
|
+
GROUP BY ec.type
|
|
109
|
+
ORDER BY campaign_count DESC
|
|
110
|
+
|
|
111
|
+
- name: monthly_send_volume
|
|
112
|
+
description: Monthly campaign send volume
|
|
113
|
+
sql: |-
|
|
114
|
+
SELECT TO_CHAR(sent_at, 'YYYY-MM') AS month,
|
|
115
|
+
COUNT(*) AS campaigns_sent
|
|
116
|
+
FROM email_campaigns
|
|
117
|
+
WHERE status = 'sent'
|
|
118
|
+
GROUP BY TO_CHAR(sent_at, 'YYYY-MM')
|
|
119
|
+
ORDER BY month
|