@useatlas/create 0.0.5 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +1 -1
- package/index.ts +253 -36
- package/package.json +4 -4
- package/templates/docker/Dockerfile +1 -1
- package/templates/docker/Dockerfile.sidecar +1 -1
- package/templates/docker/bin/__tests__/duckdb-ingest.test.ts +17 -14
- package/templates/docker/bin/__tests__/failure-threshold.test.ts +148 -0
- package/templates/docker/bin/__tests__/fatal-error-propagation.test.ts +267 -0
- package/templates/docker/bin/__tests__/profiler-heuristics.test.ts +5 -5
- package/templates/docker/bin/__tests__/schema-drift.test.ts +39 -0
- package/templates/docker/bin/atlas.ts +981 -1819
- package/templates/docker/bin/benchmark.ts +14 -16
- package/templates/docker/bin/enrich.ts +7 -2
- package/templates/docker/brand.css +13 -0
- package/templates/docker/data/cybersec-semantic/catalog.yml +222 -0
- package/templates/docker/data/cybersec-semantic/entities/alerts.yml +195 -0
- package/templates/docker/data/cybersec-semantic/entities/assets.yml +191 -0
- package/templates/docker/data/cybersec-semantic/entities/compliance_assessments.yml +170 -0
- package/templates/docker/data/cybersec-semantic/entities/incidents.yml +219 -0
- package/templates/docker/data/cybersec-semantic/entities/organizations.yml +136 -0
- package/templates/docker/data/cybersec-semantic/entities/plans.yml +114 -0
- package/templates/docker/data/cybersec-semantic/entities/remediation_actions.yml +212 -0
- package/templates/docker/data/cybersec-semantic/entities/scan_results.yml +215 -0
- package/templates/docker/data/cybersec-semantic/entities/scans.yml +180 -0
- package/templates/docker/data/cybersec-semantic/entities/subscriptions.yml +184 -0
- package/templates/docker/data/cybersec-semantic/entities/users.yml +140 -0
- package/templates/docker/data/cybersec-semantic/entities/vulnerabilities.yml +154 -0
- package/templates/docker/data/cybersec-semantic/glossary.yml +207 -0
- package/templates/docker/data/cybersec-semantic/metrics/business.yml +148 -0
- package/templates/docker/data/cybersec-semantic/metrics/compliance.yml +138 -0
- package/templates/docker/data/cybersec-semantic/metrics/security.yml +181 -0
- package/templates/docker/data/cybersec.sql +8 -8
- package/templates/docker/data/demo.sql +3 -0
- package/templates/docker/data/ecommerce-semantic/catalog.yml +221 -0
- package/templates/docker/data/ecommerce-semantic/entities/categories.yml +91 -0
- package/templates/docker/data/ecommerce-semantic/entities/customers.yml +133 -0
- package/templates/docker/data/ecommerce-semantic/entities/email_campaigns.yml +119 -0
- package/templates/docker/data/ecommerce-semantic/entities/inventory_levels.yml +153 -0
- package/templates/docker/data/ecommerce-semantic/entities/order_items.yml +159 -0
- package/templates/docker/data/ecommerce-semantic/entities/orders.yml +199 -0
- package/templates/docker/data/ecommerce-semantic/entities/payments.yml +140 -0
- package/templates/docker/data/ecommerce-semantic/entities/product_reviews.yml +155 -0
- package/templates/docker/data/ecommerce-semantic/entities/products.yml +178 -0
- package/templates/docker/data/ecommerce-semantic/entities/promotions.yml +171 -0
- package/templates/docker/data/ecommerce-semantic/entities/returns.yml +144 -0
- package/templates/docker/data/ecommerce-semantic/entities/sellers.yml +124 -0
- package/templates/docker/data/ecommerce-semantic/entities/shipments.yml +159 -0
- package/templates/docker/data/ecommerce-semantic/glossary.yml +193 -0
- package/templates/docker/data/ecommerce-semantic/metrics/customers.yml +116 -0
- package/templates/docker/data/ecommerce-semantic/metrics/operations.yml +131 -0
- package/templates/docker/data/ecommerce-semantic/metrics/revenue.yml +120 -0
- package/templates/docker/docs/deploy.md +2 -1
- package/templates/docker/ee/src/__mocks__/internal.ts +170 -0
- package/templates/docker/ee/src/audit/purge-scheduler.ts +113 -0
- package/templates/docker/ee/src/audit/retention.ts +467 -0
- package/templates/docker/ee/src/auth/ip-allowlist.ts +367 -0
- package/templates/docker/ee/src/auth/roles.ts +562 -0
- package/templates/docker/ee/src/auth/scim.ts +343 -0
- package/templates/docker/ee/src/auth/sso.ts +538 -0
- package/templates/docker/ee/src/backups/engine.ts +355 -0
- package/templates/docker/ee/src/backups/index.ts +26 -0
- package/templates/docker/ee/src/backups/restore.ts +169 -0
- package/templates/docker/ee/src/backups/scheduler.ts +153 -0
- package/templates/docker/ee/src/backups/verify.ts +124 -0
- package/templates/docker/ee/src/branding/white-label.ts +228 -0
- package/templates/docker/ee/src/compliance/masking.ts +477 -0
- package/templates/docker/ee/src/compliance/patterns.ts +16 -0
- package/templates/docker/ee/src/compliance/pii-detection.ts +217 -0
- package/templates/docker/ee/src/compliance/reports.ts +402 -0
- package/templates/docker/ee/src/deploy-mode.ts +37 -0
- package/templates/docker/ee/src/governance/approval.ts +699 -0
- package/templates/docker/ee/src/index.ts +74 -0
- package/templates/docker/ee/src/platform/domains.ts +562 -0
- package/templates/docker/ee/src/platform/model-routing.ts +382 -0
- package/templates/docker/ee/src/platform/residency.ts +265 -0
- package/templates/docker/ee/src/sla/alerting.ts +382 -0
- package/templates/docker/ee/src/sla/index.ts +12 -0
- package/templates/docker/ee/src/sla/metrics.ts +275 -0
- package/templates/docker/ee/src/test-setup.ts +1 -0
- package/templates/docker/next.config.ts +4 -1
- package/templates/docker/package.json +49 -29
- package/templates/docker/sidecar/Dockerfile +1 -1
- package/templates/docker/src/api/index.ts +336 -24
- package/templates/docker/src/api/routes/actions.ts +443 -176
- package/templates/docker/src/api/routes/admin-abuse.ts +219 -0
- package/templates/docker/src/api/routes/admin-approval.ts +418 -0
- package/templates/docker/src/api/routes/admin-audit-retention.ts +405 -0
- package/templates/docker/src/api/routes/admin-auth.ts +122 -0
- package/templates/docker/src/api/routes/admin-branding.ts +252 -0
- package/templates/docker/src/api/routes/admin-compliance.ts +352 -0
- package/templates/docker/src/api/routes/admin-domains.ts +334 -0
- package/templates/docker/src/api/routes/admin-integrations.ts +2667 -0
- package/templates/docker/src/api/routes/admin-ip-allowlist.ts +261 -0
- package/templates/docker/src/api/routes/admin-learned-patterns.ts +525 -0
- package/templates/docker/src/api/routes/admin-model-config.ts +252 -0
- package/templates/docker/src/api/routes/admin-onboarding-emails.ts +145 -0
- package/templates/docker/src/api/routes/admin-orgs.ts +710 -0
- package/templates/docker/src/api/routes/admin-prompts.ts +694 -0
- package/templates/docker/src/api/routes/admin-residency.ts +570 -0
- package/templates/docker/src/api/routes/admin-roles.ts +296 -0
- package/templates/docker/src/api/routes/admin-router.ts +120 -0
- package/templates/docker/src/api/routes/admin-sandbox.ts +417 -0
- package/templates/docker/src/api/routes/admin-scim.ts +262 -0
- package/templates/docker/src/api/routes/admin-sso.ts +545 -0
- package/templates/docker/src/api/routes/admin-suggestions.ts +176 -0
- package/templates/docker/src/api/routes/admin-usage.ts +310 -0
- package/templates/docker/src/api/routes/admin.ts +4156 -898
- package/templates/docker/src/api/routes/auth-preamble.ts +105 -0
- package/templates/docker/src/api/routes/billing.ts +397 -0
- package/templates/docker/src/api/routes/chat.ts +597 -334
- package/templates/docker/src/api/routes/conversations.ts +987 -132
- package/templates/docker/src/api/routes/demo.ts +673 -0
- package/templates/docker/src/api/routes/discord.ts +274 -0
- package/templates/docker/src/api/routes/ee-error-handler.ts +32 -0
- package/templates/docker/src/api/routes/health.ts +129 -14
- package/templates/docker/src/api/routes/middleware.ts +244 -0
- package/templates/docker/src/api/routes/onboarding-emails.ts +134 -0
- package/templates/docker/src/api/routes/onboarding.ts +1109 -0
- package/templates/docker/src/api/routes/openapi.ts +184 -1597
- package/templates/docker/src/api/routes/platform-admin.ts +760 -0
- package/templates/docker/src/api/routes/platform-backups.ts +436 -0
- package/templates/docker/src/api/routes/platform-domains.ts +235 -0
- package/templates/docker/src/api/routes/platform-residency.ts +257 -0
- package/templates/docker/src/api/routes/platform-sla.ts +379 -0
- package/templates/docker/src/api/routes/prompts.ts +221 -0
- package/templates/docker/src/api/routes/public-branding.ts +106 -0
- package/templates/docker/src/api/routes/query.ts +330 -219
- package/templates/docker/src/api/routes/scheduled-tasks.ts +393 -297
- package/templates/docker/src/api/routes/semantic.ts +179 -0
- package/templates/docker/src/api/routes/sessions.ts +210 -0
- package/templates/docker/src/api/routes/shared-domains.ts +98 -0
- package/templates/docker/src/api/routes/shared-schemas.ts +139 -0
- package/templates/docker/src/api/routes/slack.ts +209 -52
- package/templates/docker/src/api/routes/suggestions.ts +233 -0
- package/templates/docker/src/api/routes/tables.ts +67 -0
- package/templates/docker/src/api/routes/teams.ts +222 -0
- package/templates/docker/src/api/routes/validate-sql.ts +188 -0
- package/templates/docker/src/api/routes/validation-hook.ts +62 -0
- package/templates/docker/src/api/routes/widget-loader.ts +356 -0
- package/templates/docker/src/api/routes/widget.ts +428 -0
- package/templates/docker/src/api/routes/wizard.ts +852 -0
- package/templates/docker/src/api/server.ts +187 -69
- package/templates/docker/src/app/error.tsx +5 -2
- package/templates/docker/src/app/globals.css +1 -1
- package/templates/docker/src/app/layout.tsx +7 -2
- package/templates/docker/src/app/page.tsx +39 -5
- package/templates/docker/src/components/data-table/data-table-column-header.tsx +99 -0
- package/templates/docker/src/components/data-table/data-table-date-filter.tsx +225 -0
- package/templates/docker/src/components/data-table/data-table-expandable.tsx +125 -0
- package/templates/docker/src/components/data-table/data-table-faceted-filter.tsx +189 -0
- package/templates/docker/src/components/data-table/data-table-pagination.tsx +112 -0
- package/templates/docker/src/components/data-table/data-table-range-filter.tsx +122 -0
- package/templates/docker/src/components/data-table/data-table-slider-filter.tsx +256 -0
- package/templates/docker/src/components/data-table/data-table-sort-list.tsx +407 -0
- package/templates/docker/src/components/data-table/data-table-toolbar.tsx +149 -0
- package/templates/docker/src/components/data-table/data-table-view-options.tsx +89 -0
- package/templates/docker/src/components/data-table/data-table.tsx +105 -0
- package/templates/docker/src/components/form-dialog.tsx +135 -0
- package/templates/docker/src/components/ui/accordion.tsx +66 -0
- package/templates/docker/src/components/ui/calendar.tsx +220 -0
- package/templates/docker/src/components/ui/checkbox.tsx +32 -0
- package/templates/docker/src/components/ui/faceted.tsx +283 -0
- package/templates/docker/src/components/ui/form.tsx +167 -0
- package/templates/docker/src/components/ui/label.tsx +24 -0
- package/templates/docker/src/components/ui/popover.tsx +89 -0
- package/templates/docker/src/components/ui/progress.tsx +31 -0
- package/templates/docker/src/components/ui/scroll-area.tsx +6 -2
- package/templates/docker/src/components/ui/slider.tsx +63 -0
- package/templates/docker/src/components/ui/sortable.tsx +581 -0
- package/templates/docker/src/components/ui/switch.tsx +35 -0
- package/templates/docker/src/components/ui/textarea.tsx +18 -0
- package/templates/docker/src/config/data-table.ts +82 -0
- package/templates/docker/src/env-check.ts +74 -0
- package/templates/docker/src/hooks/use-callback-ref.ts +27 -0
- package/templates/docker/src/hooks/use-data-table.ts +316 -0
- package/templates/docker/src/hooks/use-debounced-callback.ts +28 -0
- package/templates/docker/src/lib/action-types.ts +7 -41
- package/templates/docker/src/lib/agent-query.ts +4 -2
- package/templates/docker/src/lib/agent.ts +363 -31
- package/templates/docker/src/lib/auth/admin-permissions.ts +38 -0
- package/templates/docker/src/lib/auth/audit.ts +19 -4
- package/templates/docker/src/lib/auth/byot.ts +3 -3
- package/templates/docker/src/lib/auth/client.ts +33 -3
- package/templates/docker/src/lib/auth/detect.ts +29 -8
- package/templates/docker/src/lib/auth/managed.ts +104 -14
- package/templates/docker/src/lib/auth/middleware.ts +53 -6
- package/templates/docker/src/lib/auth/migrate.ts +140 -15
- package/templates/docker/src/lib/auth/oauth-state.ts +123 -0
- package/templates/docker/src/lib/auth/org-permissions.ts +55 -0
- package/templates/docker/src/lib/auth/permissions.ts +26 -19
- package/templates/docker/src/lib/auth/server.ts +355 -9
- package/templates/docker/src/lib/auth/simple-key.ts +3 -3
- package/templates/docker/src/lib/auth/types.ts +15 -21
- package/templates/docker/src/lib/billing/enforcement.ts +368 -0
- package/templates/docker/src/lib/billing/plans.ts +155 -0
- package/templates/docker/src/lib/cache/index.ts +92 -0
- package/templates/docker/src/lib/cache/keys.ts +30 -0
- package/templates/docker/src/lib/cache/lru.ts +79 -0
- package/templates/docker/src/lib/cache/types.ts +31 -0
- package/templates/docker/src/lib/compose-refs.ts +62 -0
- package/templates/docker/src/lib/config.ts +563 -11
- package/templates/docker/src/lib/connection-types.ts +9 -0
- package/templates/docker/src/lib/conversation-types.ts +1 -25
- package/templates/docker/src/lib/conversations.ts +345 -14
- package/templates/docker/src/lib/data-table.ts +61 -0
- package/templates/docker/src/lib/db/connection.ts +793 -39
- package/templates/docker/src/lib/db/internal.ts +985 -139
- package/templates/docker/src/lib/db/migrate.ts +295 -0
- package/templates/docker/src/lib/db/migrations/0000_baseline.sql +703 -0
- package/templates/docker/src/lib/db/migrations/0001_teams_installations.sql +14 -0
- package/templates/docker/src/lib/db/migrations/0002_discord_installations.sql +14 -0
- package/templates/docker/src/lib/db/migrations/0003_telegram_installations.sql +15 -0
- package/templates/docker/src/lib/db/migrations/0004_sandbox_credentials.sql +18 -0
- package/templates/docker/src/lib/db/migrations/0005_oauth_state.sql +16 -0
- package/templates/docker/src/lib/db/migrations/0006_byot_credentials.sql +14 -0
- package/templates/docker/src/lib/db/migrations/0007_gchat_installations.sql +15 -0
- package/templates/docker/src/lib/db/migrations/0008_github_installations.sql +14 -0
- package/templates/docker/src/lib/db/migrations/0009_linear_installations.sql +15 -0
- package/templates/docker/src/lib/db/migrations/0010_whatsapp_installations.sql +14 -0
- package/templates/docker/src/lib/db/migrations/0011_email_installations.sql +16 -0
- package/templates/docker/src/lib/db/migrations/0012_region_migrations.sql +25 -0
- package/templates/docker/src/lib/db/schema.ts +1120 -0
- package/templates/docker/src/lib/db/source-rate-limit.ts +89 -139
- package/templates/docker/src/lib/demo.ts +308 -0
- package/templates/docker/src/lib/discord/store.ts +225 -0
- package/templates/docker/src/lib/effect/ai.ts +243 -0
- package/templates/docker/src/lib/effect/errors.ts +234 -0
- package/templates/docker/src/lib/effect/hono.ts +454 -0
- package/templates/docker/src/lib/effect/index.ts +137 -0
- package/templates/docker/src/lib/effect/layers.ts +496 -0
- package/templates/docker/src/lib/effect/services.ts +776 -0
- package/templates/docker/src/lib/effect/sql.ts +178 -0
- package/templates/docker/src/lib/effect/toolkit.ts +123 -0
- package/templates/docker/src/lib/email/delivery.ts +232 -0
- package/templates/docker/src/lib/email/engine.ts +349 -0
- package/templates/docker/src/lib/email/hooks.ts +107 -0
- package/templates/docker/src/lib/email/index.ts +16 -0
- package/templates/docker/src/lib/email/scheduler.ts +72 -0
- package/templates/docker/src/lib/email/sequence.ts +73 -0
- package/templates/docker/src/lib/email/store.ts +163 -0
- package/templates/docker/src/lib/email/templates.ts +215 -0
- package/templates/docker/src/lib/format.ts +67 -0
- package/templates/docker/src/lib/gchat/store.ts +202 -0
- package/templates/docker/src/lib/github/store.ts +197 -0
- package/templates/docker/src/lib/id.ts +29 -0
- package/templates/docker/src/lib/integrations/types.ts +166 -0
- package/templates/docker/src/lib/learn/pattern-analyzer.ts +224 -0
- package/templates/docker/src/lib/learn/pattern-cache.ts +229 -0
- package/templates/docker/src/lib/learn/pattern-proposer.ts +87 -0
- package/templates/docker/src/lib/learn/suggestion-helpers.ts +34 -0
- package/templates/docker/src/lib/learn/suggestions.ts +139 -0
- package/templates/docker/src/lib/linear/store.ts +200 -0
- package/templates/docker/src/lib/logger.ts +35 -3
- package/templates/docker/src/lib/metering.ts +272 -0
- package/templates/docker/src/lib/parsers.ts +99 -0
- package/templates/docker/src/lib/plugins/hooks.ts +13 -11
- package/templates/docker/src/lib/plugins/index.ts +3 -1
- package/templates/docker/src/lib/plugins/registry.ts +58 -6
- package/templates/docker/src/lib/plugins/settings.ts +147 -0
- package/templates/docker/src/lib/plugins/wiring.ts +6 -9
- package/templates/docker/src/lib/profiler.ts +1665 -0
- package/templates/docker/src/lib/providers.ts +188 -13
- package/templates/docker/src/lib/rls.ts +172 -60
- package/templates/docker/src/lib/sandbox/credentials.ts +206 -0
- package/templates/docker/src/lib/sandbox/validate.ts +179 -0
- package/templates/docker/src/lib/scheduled-task-types.ts +26 -94
- package/templates/docker/src/lib/scheduled-tasks.ts +174 -34
- package/templates/docker/src/lib/scheduler/delivery.ts +248 -150
- package/templates/docker/src/lib/scheduler/engine.ts +190 -154
- package/templates/docker/src/lib/scheduler/executor.ts +74 -23
- package/templates/docker/src/lib/scheduler/preview.ts +72 -0
- package/templates/docker/src/lib/security/abuse.ts +463 -0
- package/templates/docker/src/lib/semantic/diff.ts +267 -0
- package/templates/docker/src/lib/semantic/entities.ts +167 -0
- package/templates/docker/src/lib/semantic/files.ts +283 -0
- package/templates/docker/src/lib/semantic/index.ts +27 -0
- package/templates/docker/src/lib/{semantic-index.ts → semantic/search.ts} +80 -9
- package/templates/docker/src/lib/semantic/sync.ts +581 -0
- package/templates/docker/src/lib/{semantic.ts → semantic/whitelist.ts} +189 -3
- package/templates/docker/src/lib/settings.ts +817 -0
- package/templates/docker/src/lib/sidecar-types.ts +13 -0
- package/templates/docker/src/lib/slack/store.ts +134 -25
- package/templates/docker/src/lib/startup.ts +528 -362
- package/templates/docker/src/lib/teams/store.ts +216 -0
- package/templates/docker/src/lib/telegram/store.ts +202 -0
- package/templates/docker/src/lib/telemetry.ts +40 -0
- package/templates/docker/src/lib/tools/actions/audit.ts +8 -5
- package/templates/docker/src/lib/tools/actions/email.ts +3 -1
- package/templates/docker/src/lib/tools/actions/handler.ts +276 -93
- package/templates/docker/src/lib/tools/actions/jira.ts +2 -2
- package/templates/docker/src/lib/tools/backends/detect.ts +16 -0
- package/templates/docker/src/lib/tools/backends/index.ts +11 -0
- package/templates/docker/src/lib/tools/backends/nsjail.ts +213 -0
- package/templates/docker/src/lib/tools/backends/shared.ts +103 -0
- package/templates/docker/src/lib/tools/backends/types.ts +26 -0
- package/templates/docker/src/lib/tools/explore-nsjail.ts +7 -228
- package/templates/docker/src/lib/tools/explore-sandbox.ts +4 -29
- package/templates/docker/src/lib/tools/explore-sidecar.ts +18 -2
- package/templates/docker/src/lib/tools/explore.ts +246 -54
- package/templates/docker/src/lib/tools/index.ts +17 -0
- package/templates/docker/src/lib/tools/python-nsjail.ts +11 -139
- package/templates/docker/src/lib/tools/python-sandbox.ts +9 -132
- package/templates/docker/src/lib/tools/python-sidecar.ts +184 -3
- package/templates/docker/src/lib/tools/python-stream.ts +33 -0
- package/templates/docker/src/lib/tools/python-wrapper.ts +129 -0
- package/templates/docker/src/lib/tools/python.ts +115 -15
- package/templates/docker/src/lib/tools/registry.ts +14 -2
- package/templates/docker/src/lib/tools/sql.ts +778 -362
- package/templates/docker/src/lib/tracing.ts +16 -0
- package/templates/docker/src/lib/whatsapp/store.ts +198 -0
- package/templates/docker/src/lib/workspace.ts +89 -0
- package/templates/docker/src/progress.ts +121 -0
- package/templates/docker/src/types/data-table.ts +48 -0
- package/templates/docker/src/ui/atlas-chat-reexport.ts +3 -0
- package/templates/docker/src/ui/components/actions/action-approval-card.tsx +26 -19
- package/templates/docker/src/ui/components/actions/action-status-badge.tsx +3 -3
- package/templates/docker/src/ui/components/admin/admin-layout.tsx +57 -39
- package/templates/docker/src/ui/components/admin/admin-sidebar.tsx +213 -35
- package/templates/docker/src/ui/components/admin/delivery-status-badge.tsx +53 -0
- package/templates/docker/src/ui/components/admin/empty-state.tsx +27 -6
- package/templates/docker/src/ui/components/admin/entity-detail.tsx +3 -52
- package/templates/docker/src/ui/components/admin/error-banner.tsx +2 -2
- package/templates/docker/src/ui/components/admin/feature-disabled.tsx +28 -5
- package/templates/docker/src/ui/components/admin-content-wrapper.tsx +87 -0
- package/templates/docker/src/ui/components/atlas-chat.tsx +449 -166
- package/templates/docker/src/ui/components/branding-head.tsx +41 -0
- package/templates/docker/src/ui/components/chart/chart-detection.ts +62 -5
- package/templates/docker/src/ui/components/chart/result-chart.tsx +316 -125
- package/templates/docker/src/ui/components/chat/api-key-bar.tsx +4 -4
- package/templates/docker/src/ui/components/chat/data-table.tsx +45 -4
- package/templates/docker/src/ui/components/chat/error-banner.tsx +86 -5
- package/templates/docker/src/ui/components/chat/follow-up-chips.tsx +29 -0
- package/templates/docker/src/ui/components/chat/markdown.tsx +24 -0
- package/templates/docker/src/ui/components/chat/prompt-library.tsx +206 -0
- package/templates/docker/src/ui/components/chat/python-result-card.tsx +106 -78
- package/templates/docker/src/ui/components/chat/result-card-base.tsx +101 -0
- package/templates/docker/src/ui/components/chat/share-dialog.tsx +377 -0
- package/templates/docker/src/ui/components/chat/sql-result-card.tsx +94 -73
- package/templates/docker/src/ui/components/chat/suggestion-chips.tsx +46 -0
- package/templates/docker/src/ui/components/chat/tool-part.tsx +16 -4
- package/templates/docker/src/ui/components/conversations/conversation-item.tsx +48 -17
- package/templates/docker/src/ui/components/conversations/conversation-list.tsx +38 -24
- package/templates/docker/src/ui/components/conversations/conversation-sidebar.tsx +66 -7
- package/templates/docker/src/ui/components/conversations/delete-confirmation.tsx +9 -2
- package/templates/docker/src/ui/components/error-boundary.tsx +66 -0
- package/templates/docker/src/ui/components/notebook/delete-cell-dialog.tsx +48 -0
- package/templates/docker/src/ui/components/notebook/fork-branch-selector.tsx +68 -0
- package/templates/docker/src/ui/components/notebook/notebook-cell-input.tsx +76 -0
- package/templates/docker/src/ui/components/notebook/notebook-cell-output.tsx +58 -0
- package/templates/docker/src/ui/components/notebook/notebook-cell-toolbar.tsx +91 -0
- package/templates/docker/src/ui/components/notebook/notebook-cell.tsx +119 -0
- package/templates/docker/src/ui/components/notebook/notebook-empty-state.tsx +19 -0
- package/templates/docker/src/ui/components/notebook/notebook-export.ts +287 -0
- package/templates/docker/src/ui/components/notebook/notebook-input-bar.tsx +49 -0
- package/templates/docker/src/ui/components/notebook/notebook-shell.tsx +266 -0
- package/templates/docker/src/ui/components/notebook/notebook-text-cell.tsx +152 -0
- package/templates/docker/src/ui/components/notebook/types.ts +39 -0
- package/templates/docker/src/ui/components/notebook/use-keyboard-nav.ts +109 -0
- package/templates/docker/src/ui/components/notebook/use-notebook.ts +684 -0
- package/templates/docker/src/ui/components/org-switcher.tsx +111 -0
- package/templates/docker/src/ui/components/region-picker.tsx +103 -0
- package/templates/docker/src/ui/components/schema-explorer/schema-explorer.tsx +522 -0
- package/templates/docker/src/ui/components/social-icons.tsx +26 -0
- package/templates/docker/src/ui/components/tour/guided-tour.tsx +81 -0
- package/templates/docker/src/ui/components/tour/index.ts +5 -0
- package/templates/docker/src/ui/components/tour/nav-bar.tsx +100 -0
- package/templates/docker/src/ui/components/tour/tour-overlay.tsx +298 -0
- package/templates/docker/src/ui/components/tour/tour-steps.ts +43 -0
- package/templates/docker/src/ui/components/tour/types.ts +21 -0
- package/templates/docker/src/ui/components/tour/use-tour.ts +193 -0
- package/templates/docker/src/ui/context-reexport.ts +3 -0
- package/templates/docker/src/ui/hooks/theme-init-script.ts +17 -0
- package/templates/docker/src/ui/hooks/use-admin-fetch.ts +38 -30
- package/templates/docker/src/ui/hooks/use-admin-mutation.ts +188 -0
- package/templates/docker/src/ui/hooks/use-atlas-transport.ts +225 -0
- package/templates/docker/src/ui/hooks/use-branding.ts +68 -0
- package/templates/docker/src/ui/hooks/use-conversations.ts +106 -83
- package/templates/docker/src/ui/hooks/use-dark-mode.ts +134 -10
- package/templates/docker/src/ui/hooks/use-deploy-mode.ts +36 -0
- package/templates/docker/src/ui/hooks/use-platform-admin-guard.ts +49 -0
- package/templates/docker/src/ui/lib/action-types.ts +11 -63
- package/templates/docker/src/ui/lib/admin-schemas.ts +744 -0
- package/templates/docker/src/ui/lib/fetch-client.ts +84 -0
- package/templates/docker/src/ui/lib/fetch-error.ts +54 -0
- package/templates/docker/src/ui/lib/helpers.ts +94 -1
- package/templates/docker/src/ui/lib/types.ts +149 -140
- package/templates/docker/tsconfig.json +4 -2
- package/templates/nextjs-standalone/bin/__tests__/duckdb-ingest.test.ts +17 -14
- package/templates/nextjs-standalone/bin/__tests__/failure-threshold.test.ts +148 -0
- package/templates/nextjs-standalone/bin/__tests__/fatal-error-propagation.test.ts +267 -0
- package/templates/nextjs-standalone/bin/__tests__/profiler-heuristics.test.ts +5 -5
- package/templates/nextjs-standalone/bin/__tests__/schema-drift.test.ts +39 -0
- package/templates/nextjs-standalone/bin/atlas.ts +981 -1819
- package/templates/nextjs-standalone/bin/benchmark.ts +14 -16
- package/templates/nextjs-standalone/bin/enrich.ts +7 -2
- package/templates/nextjs-standalone/brand.css +13 -0
- package/templates/nextjs-standalone/data/cybersec-semantic/catalog.yml +222 -0
- package/templates/nextjs-standalone/data/cybersec-semantic/entities/alerts.yml +195 -0
- package/templates/nextjs-standalone/data/cybersec-semantic/entities/assets.yml +191 -0
- package/templates/nextjs-standalone/data/cybersec-semantic/entities/compliance_assessments.yml +170 -0
- package/templates/nextjs-standalone/data/cybersec-semantic/entities/incidents.yml +219 -0
- package/templates/nextjs-standalone/data/cybersec-semantic/entities/organizations.yml +136 -0
- package/templates/nextjs-standalone/data/cybersec-semantic/entities/plans.yml +114 -0
- package/templates/nextjs-standalone/data/cybersec-semantic/entities/remediation_actions.yml +212 -0
- package/templates/nextjs-standalone/data/cybersec-semantic/entities/scan_results.yml +215 -0
- package/templates/nextjs-standalone/data/cybersec-semantic/entities/scans.yml +180 -0
- package/templates/nextjs-standalone/data/cybersec-semantic/entities/subscriptions.yml +184 -0
- package/templates/nextjs-standalone/data/cybersec-semantic/entities/users.yml +140 -0
- package/templates/nextjs-standalone/data/cybersec-semantic/entities/vulnerabilities.yml +154 -0
- package/templates/nextjs-standalone/data/cybersec-semantic/glossary.yml +207 -0
- package/templates/nextjs-standalone/data/cybersec-semantic/metrics/business.yml +148 -0
- package/templates/nextjs-standalone/data/cybersec-semantic/metrics/compliance.yml +138 -0
- package/templates/nextjs-standalone/data/cybersec-semantic/metrics/security.yml +181 -0
- package/templates/nextjs-standalone/data/cybersec.sql +8 -8
- package/templates/nextjs-standalone/data/demo.sql +3 -0
- package/templates/nextjs-standalone/data/ecommerce-semantic/catalog.yml +221 -0
- package/templates/nextjs-standalone/data/ecommerce-semantic/entities/categories.yml +91 -0
- package/templates/nextjs-standalone/data/ecommerce-semantic/entities/customers.yml +133 -0
- package/templates/nextjs-standalone/data/ecommerce-semantic/entities/email_campaigns.yml +119 -0
- package/templates/nextjs-standalone/data/ecommerce-semantic/entities/inventory_levels.yml +153 -0
- package/templates/nextjs-standalone/data/ecommerce-semantic/entities/order_items.yml +159 -0
- package/templates/nextjs-standalone/data/ecommerce-semantic/entities/orders.yml +199 -0
- package/templates/nextjs-standalone/data/ecommerce-semantic/entities/payments.yml +140 -0
- package/templates/nextjs-standalone/data/ecommerce-semantic/entities/product_reviews.yml +155 -0
- package/templates/nextjs-standalone/data/ecommerce-semantic/entities/products.yml +178 -0
- package/templates/nextjs-standalone/data/ecommerce-semantic/entities/promotions.yml +171 -0
- package/templates/nextjs-standalone/data/ecommerce-semantic/entities/returns.yml +144 -0
- package/templates/nextjs-standalone/data/ecommerce-semantic/entities/sellers.yml +124 -0
- package/templates/nextjs-standalone/data/ecommerce-semantic/entities/shipments.yml +159 -0
- package/templates/nextjs-standalone/data/ecommerce-semantic/glossary.yml +193 -0
- package/templates/nextjs-standalone/data/ecommerce-semantic/metrics/customers.yml +116 -0
- package/templates/nextjs-standalone/data/ecommerce-semantic/metrics/operations.yml +131 -0
- package/templates/nextjs-standalone/data/ecommerce-semantic/metrics/revenue.yml +120 -0
- package/templates/nextjs-standalone/docs/deploy.md +2 -1
- package/templates/nextjs-standalone/ee/src/__mocks__/internal.ts +170 -0
- package/templates/nextjs-standalone/ee/src/audit/purge-scheduler.ts +113 -0
- package/templates/nextjs-standalone/ee/src/audit/retention.ts +467 -0
- package/templates/nextjs-standalone/ee/src/auth/ip-allowlist.ts +367 -0
- package/templates/nextjs-standalone/ee/src/auth/roles.ts +562 -0
- package/templates/nextjs-standalone/ee/src/auth/scim.ts +343 -0
- package/templates/nextjs-standalone/ee/src/auth/sso.ts +538 -0
- package/templates/nextjs-standalone/ee/src/backups/engine.ts +355 -0
- package/templates/nextjs-standalone/ee/src/backups/index.ts +26 -0
- package/templates/nextjs-standalone/ee/src/backups/restore.ts +169 -0
- package/templates/nextjs-standalone/ee/src/backups/scheduler.ts +153 -0
- package/templates/nextjs-standalone/ee/src/backups/verify.ts +124 -0
- package/templates/nextjs-standalone/ee/src/branding/white-label.ts +228 -0
- package/templates/nextjs-standalone/ee/src/compliance/masking.ts +477 -0
- package/templates/nextjs-standalone/ee/src/compliance/patterns.ts +16 -0
- package/templates/nextjs-standalone/ee/src/compliance/pii-detection.ts +217 -0
- package/templates/nextjs-standalone/ee/src/compliance/reports.ts +402 -0
- package/templates/nextjs-standalone/ee/src/deploy-mode.ts +37 -0
- package/templates/nextjs-standalone/ee/src/governance/approval.ts +699 -0
- package/templates/nextjs-standalone/ee/src/index.ts +74 -0
- package/templates/nextjs-standalone/ee/src/platform/domains.ts +562 -0
- package/templates/nextjs-standalone/ee/src/platform/model-routing.ts +382 -0
- package/templates/nextjs-standalone/ee/src/platform/residency.ts +265 -0
- package/templates/nextjs-standalone/ee/src/sla/alerting.ts +382 -0
- package/templates/nextjs-standalone/ee/src/sla/index.ts +12 -0
- package/templates/nextjs-standalone/ee/src/sla/metrics.ts +275 -0
- package/templates/nextjs-standalone/ee/src/test-setup.ts +1 -0
- package/templates/nextjs-standalone/next.config.ts +1 -1
- package/templates/nextjs-standalone/package.json +50 -30
- package/templates/nextjs-standalone/src/api/index.ts +336 -24
- package/templates/nextjs-standalone/src/api/routes/actions.ts +443 -176
- package/templates/nextjs-standalone/src/api/routes/admin-abuse.ts +219 -0
- package/templates/nextjs-standalone/src/api/routes/admin-approval.ts +418 -0
- package/templates/nextjs-standalone/src/api/routes/admin-audit-retention.ts +405 -0
- package/templates/nextjs-standalone/src/api/routes/admin-auth.ts +122 -0
- package/templates/nextjs-standalone/src/api/routes/admin-branding.ts +252 -0
- package/templates/nextjs-standalone/src/api/routes/admin-compliance.ts +352 -0
- package/templates/nextjs-standalone/src/api/routes/admin-domains.ts +334 -0
- package/templates/nextjs-standalone/src/api/routes/admin-integrations.ts +2667 -0
- package/templates/nextjs-standalone/src/api/routes/admin-ip-allowlist.ts +261 -0
- package/templates/nextjs-standalone/src/api/routes/admin-learned-patterns.ts +525 -0
- package/templates/nextjs-standalone/src/api/routes/admin-model-config.ts +252 -0
- package/templates/nextjs-standalone/src/api/routes/admin-onboarding-emails.ts +145 -0
- package/templates/nextjs-standalone/src/api/routes/admin-orgs.ts +710 -0
- package/templates/nextjs-standalone/src/api/routes/admin-prompts.ts +694 -0
- package/templates/nextjs-standalone/src/api/routes/admin-residency.ts +570 -0
- package/templates/nextjs-standalone/src/api/routes/admin-roles.ts +296 -0
- package/templates/nextjs-standalone/src/api/routes/admin-router.ts +120 -0
- package/templates/nextjs-standalone/src/api/routes/admin-sandbox.ts +417 -0
- package/templates/nextjs-standalone/src/api/routes/admin-scim.ts +262 -0
- package/templates/nextjs-standalone/src/api/routes/admin-sso.ts +545 -0
- package/templates/nextjs-standalone/src/api/routes/admin-suggestions.ts +176 -0
- package/templates/nextjs-standalone/src/api/routes/admin-usage.ts +310 -0
- package/templates/nextjs-standalone/src/api/routes/admin.ts +4156 -898
- package/templates/nextjs-standalone/src/api/routes/auth-preamble.ts +105 -0
- package/templates/nextjs-standalone/src/api/routes/billing.ts +397 -0
- package/templates/nextjs-standalone/src/api/routes/chat.ts +597 -334
- package/templates/nextjs-standalone/src/api/routes/conversations.ts +987 -132
- package/templates/nextjs-standalone/src/api/routes/demo.ts +673 -0
- package/templates/nextjs-standalone/src/api/routes/discord.ts +274 -0
- package/templates/nextjs-standalone/src/api/routes/ee-error-handler.ts +32 -0
- package/templates/nextjs-standalone/src/api/routes/health.ts +129 -14
- package/templates/nextjs-standalone/src/api/routes/middleware.ts +244 -0
- package/templates/nextjs-standalone/src/api/routes/onboarding-emails.ts +134 -0
- package/templates/nextjs-standalone/src/api/routes/onboarding.ts +1109 -0
- package/templates/nextjs-standalone/src/api/routes/openapi.ts +184 -1597
- package/templates/nextjs-standalone/src/api/routes/platform-admin.ts +760 -0
- package/templates/nextjs-standalone/src/api/routes/platform-backups.ts +436 -0
- package/templates/nextjs-standalone/src/api/routes/platform-domains.ts +235 -0
- package/templates/nextjs-standalone/src/api/routes/platform-residency.ts +257 -0
- package/templates/nextjs-standalone/src/api/routes/platform-sla.ts +379 -0
- package/templates/nextjs-standalone/src/api/routes/prompts.ts +221 -0
- package/templates/nextjs-standalone/src/api/routes/public-branding.ts +106 -0
- package/templates/nextjs-standalone/src/api/routes/query.ts +330 -219
- package/templates/nextjs-standalone/src/api/routes/scheduled-tasks.ts +393 -297
- package/templates/nextjs-standalone/src/api/routes/semantic.ts +179 -0
- package/templates/nextjs-standalone/src/api/routes/sessions.ts +210 -0
- package/templates/nextjs-standalone/src/api/routes/shared-domains.ts +98 -0
- package/templates/nextjs-standalone/src/api/routes/shared-schemas.ts +139 -0
- package/templates/nextjs-standalone/src/api/routes/slack.ts +209 -52
- package/templates/nextjs-standalone/src/api/routes/suggestions.ts +233 -0
- package/templates/nextjs-standalone/src/api/routes/tables.ts +67 -0
- package/templates/nextjs-standalone/src/api/routes/teams.ts +222 -0
- package/templates/nextjs-standalone/src/api/routes/validate-sql.ts +188 -0
- package/templates/nextjs-standalone/src/api/routes/validation-hook.ts +62 -0
- package/templates/nextjs-standalone/src/api/routes/widget-loader.ts +356 -0
- package/templates/nextjs-standalone/src/api/routes/widget.ts +428 -0
- package/templates/nextjs-standalone/src/api/routes/wizard.ts +852 -0
- package/templates/nextjs-standalone/src/api/server.ts +187 -69
- package/templates/nextjs-standalone/src/app/error.tsx +5 -2
- package/templates/nextjs-standalone/src/app/globals.css +1 -1
- package/templates/nextjs-standalone/src/app/layout.tsx +7 -2
- package/templates/nextjs-standalone/src/app/page.tsx +39 -5
- package/templates/nextjs-standalone/src/components/data-table/data-table-column-header.tsx +99 -0
- package/templates/nextjs-standalone/src/components/data-table/data-table-date-filter.tsx +225 -0
- package/templates/nextjs-standalone/src/components/data-table/data-table-expandable.tsx +125 -0
- package/templates/nextjs-standalone/src/components/data-table/data-table-faceted-filter.tsx +189 -0
- package/templates/nextjs-standalone/src/components/data-table/data-table-pagination.tsx +112 -0
- package/templates/nextjs-standalone/src/components/data-table/data-table-range-filter.tsx +122 -0
- package/templates/nextjs-standalone/src/components/data-table/data-table-slider-filter.tsx +256 -0
- package/templates/nextjs-standalone/src/components/data-table/data-table-sort-list.tsx +407 -0
- package/templates/nextjs-standalone/src/components/data-table/data-table-toolbar.tsx +149 -0
- package/templates/nextjs-standalone/src/components/data-table/data-table-view-options.tsx +89 -0
- package/templates/nextjs-standalone/src/components/data-table/data-table.tsx +105 -0
- package/templates/nextjs-standalone/src/components/form-dialog.tsx +135 -0
- package/templates/nextjs-standalone/src/components/ui/accordion.tsx +66 -0
- package/templates/nextjs-standalone/src/components/ui/calendar.tsx +220 -0
- package/templates/nextjs-standalone/src/components/ui/checkbox.tsx +32 -0
- package/templates/nextjs-standalone/src/components/ui/faceted.tsx +283 -0
- package/templates/nextjs-standalone/src/components/ui/form.tsx +167 -0
- package/templates/nextjs-standalone/src/components/ui/label.tsx +24 -0
- package/templates/nextjs-standalone/src/components/ui/popover.tsx +89 -0
- package/templates/nextjs-standalone/src/components/ui/progress.tsx +31 -0
- package/templates/nextjs-standalone/src/components/ui/scroll-area.tsx +6 -2
- package/templates/nextjs-standalone/src/components/ui/slider.tsx +63 -0
- package/templates/nextjs-standalone/src/components/ui/sortable.tsx +581 -0
- package/templates/nextjs-standalone/src/components/ui/switch.tsx +35 -0
- package/templates/nextjs-standalone/src/components/ui/textarea.tsx +18 -0
- package/templates/nextjs-standalone/src/config/data-table.ts +82 -0
- package/templates/nextjs-standalone/src/env-check.ts +74 -0
- package/templates/nextjs-standalone/src/hooks/use-callback-ref.ts +27 -0
- package/templates/nextjs-standalone/src/hooks/use-data-table.ts +316 -0
- package/templates/nextjs-standalone/src/hooks/use-debounced-callback.ts +28 -0
- package/templates/nextjs-standalone/src/lib/action-types.ts +7 -41
- package/templates/nextjs-standalone/src/lib/agent-query.ts +4 -2
- package/templates/nextjs-standalone/src/lib/agent.ts +363 -31
- package/templates/nextjs-standalone/src/lib/api-url.ts +2 -3
- package/templates/nextjs-standalone/src/lib/auth/admin-permissions.ts +38 -0
- package/templates/nextjs-standalone/src/lib/auth/audit.ts +19 -4
- package/templates/nextjs-standalone/src/lib/auth/byot.ts +3 -3
- package/templates/nextjs-standalone/src/lib/auth/detect.ts +29 -8
- package/templates/nextjs-standalone/src/lib/auth/managed.ts +104 -14
- package/templates/nextjs-standalone/src/lib/auth/middleware.ts +53 -6
- package/templates/nextjs-standalone/src/lib/auth/migrate.ts +140 -15
- package/templates/nextjs-standalone/src/lib/auth/oauth-state.ts +123 -0
- package/templates/nextjs-standalone/src/lib/auth/org-permissions.ts +55 -0
- package/templates/nextjs-standalone/src/lib/auth/permissions.ts +26 -19
- package/templates/nextjs-standalone/src/lib/auth/server.ts +355 -9
- package/templates/nextjs-standalone/src/lib/auth/simple-key.ts +3 -3
- package/templates/nextjs-standalone/src/lib/auth/types.ts +15 -21
- package/templates/nextjs-standalone/src/lib/billing/enforcement.ts +368 -0
- package/templates/nextjs-standalone/src/lib/billing/plans.ts +155 -0
- package/templates/nextjs-standalone/src/lib/cache/index.ts +92 -0
- package/templates/nextjs-standalone/src/lib/cache/keys.ts +30 -0
- package/templates/nextjs-standalone/src/lib/cache/lru.ts +79 -0
- package/templates/nextjs-standalone/src/lib/cache/types.ts +31 -0
- package/templates/nextjs-standalone/src/lib/compose-refs.ts +62 -0
- package/templates/nextjs-standalone/src/lib/config.ts +563 -11
- package/templates/nextjs-standalone/src/lib/connection-types.ts +9 -0
- package/templates/nextjs-standalone/src/lib/conversation-types.ts +1 -25
- package/templates/nextjs-standalone/src/lib/conversations.ts +345 -14
- package/templates/nextjs-standalone/src/lib/data-table.ts +61 -0
- package/templates/nextjs-standalone/src/lib/db/connection.ts +793 -39
- package/templates/nextjs-standalone/src/lib/db/internal.ts +985 -139
- package/templates/nextjs-standalone/src/lib/db/migrate.ts +295 -0
- package/templates/nextjs-standalone/src/lib/db/migrations/0000_baseline.sql +703 -0
- package/templates/nextjs-standalone/src/lib/db/migrations/0001_teams_installations.sql +14 -0
- package/templates/nextjs-standalone/src/lib/db/migrations/0002_discord_installations.sql +14 -0
- package/templates/nextjs-standalone/src/lib/db/migrations/0003_telegram_installations.sql +15 -0
- package/templates/nextjs-standalone/src/lib/db/migrations/0004_sandbox_credentials.sql +18 -0
- package/templates/nextjs-standalone/src/lib/db/migrations/0005_oauth_state.sql +16 -0
- package/templates/nextjs-standalone/src/lib/db/migrations/0006_byot_credentials.sql +14 -0
- package/templates/nextjs-standalone/src/lib/db/migrations/0007_gchat_installations.sql +15 -0
- package/templates/nextjs-standalone/src/lib/db/migrations/0008_github_installations.sql +14 -0
- package/templates/nextjs-standalone/src/lib/db/migrations/0009_linear_installations.sql +15 -0
- package/templates/nextjs-standalone/src/lib/db/migrations/0010_whatsapp_installations.sql +14 -0
- package/templates/nextjs-standalone/src/lib/db/migrations/0011_email_installations.sql +16 -0
- package/templates/nextjs-standalone/src/lib/db/migrations/0012_region_migrations.sql +25 -0
- package/templates/nextjs-standalone/src/lib/db/schema.ts +1120 -0
- package/templates/nextjs-standalone/src/lib/db/source-rate-limit.ts +89 -139
- package/templates/nextjs-standalone/src/lib/demo.ts +308 -0
- package/templates/nextjs-standalone/src/lib/discord/store.ts +225 -0
- package/templates/nextjs-standalone/src/lib/effect/ai.ts +243 -0
- package/templates/nextjs-standalone/src/lib/effect/errors.ts +234 -0
- package/templates/nextjs-standalone/src/lib/effect/hono.ts +454 -0
- package/templates/nextjs-standalone/src/lib/effect/index.ts +137 -0
- package/templates/nextjs-standalone/src/lib/effect/layers.ts +496 -0
- package/templates/nextjs-standalone/src/lib/effect/services.ts +776 -0
- package/templates/nextjs-standalone/src/lib/effect/sql.ts +178 -0
- package/templates/nextjs-standalone/src/lib/effect/toolkit.ts +123 -0
- package/templates/nextjs-standalone/src/lib/email/delivery.ts +232 -0
- package/templates/nextjs-standalone/src/lib/email/engine.ts +349 -0
- package/templates/nextjs-standalone/src/lib/email/hooks.ts +107 -0
- package/templates/nextjs-standalone/src/lib/email/index.ts +16 -0
- package/templates/nextjs-standalone/src/lib/email/scheduler.ts +72 -0
- package/templates/nextjs-standalone/src/lib/email/sequence.ts +73 -0
- package/templates/nextjs-standalone/src/lib/email/store.ts +163 -0
- package/templates/nextjs-standalone/src/lib/email/templates.ts +215 -0
- package/templates/nextjs-standalone/src/lib/format.test.ts +117 -0
- package/templates/nextjs-standalone/src/lib/format.ts +67 -0
- package/templates/nextjs-standalone/src/lib/gchat/store.ts +202 -0
- package/templates/nextjs-standalone/src/lib/github/store.ts +197 -0
- package/templates/nextjs-standalone/src/lib/id.ts +29 -0
- package/templates/nextjs-standalone/src/lib/integrations/types.ts +166 -0
- package/templates/nextjs-standalone/src/lib/learn/pattern-analyzer.ts +224 -0
- package/templates/nextjs-standalone/src/lib/learn/pattern-cache.ts +229 -0
- package/templates/nextjs-standalone/src/lib/learn/pattern-proposer.ts +87 -0
- package/templates/nextjs-standalone/src/lib/learn/suggestion-helpers.ts +34 -0
- package/templates/nextjs-standalone/src/lib/learn/suggestions.ts +139 -0
- package/templates/nextjs-standalone/src/lib/linear/store.ts +200 -0
- package/templates/nextjs-standalone/src/lib/logger.ts +35 -3
- package/templates/nextjs-standalone/src/lib/metering.ts +272 -0
- package/templates/nextjs-standalone/src/lib/parsers.ts +99 -0
- package/templates/nextjs-standalone/src/lib/plugins/hooks.ts +13 -11
- package/templates/nextjs-standalone/src/lib/plugins/index.ts +3 -1
- package/templates/nextjs-standalone/src/lib/plugins/registry.ts +58 -6
- package/templates/nextjs-standalone/src/lib/plugins/settings.ts +147 -0
- package/templates/nextjs-standalone/src/lib/plugins/wiring.ts +6 -9
- package/templates/nextjs-standalone/src/lib/profiler.ts +1665 -0
- package/templates/nextjs-standalone/src/lib/providers.ts +188 -13
- package/templates/nextjs-standalone/src/lib/rls.ts +172 -60
- package/templates/nextjs-standalone/src/lib/sandbox/credentials.ts +206 -0
- package/templates/nextjs-standalone/src/lib/sandbox/validate.ts +179 -0
- package/templates/nextjs-standalone/src/lib/scheduled-task-types.ts +26 -94
- package/templates/nextjs-standalone/src/lib/scheduled-tasks.ts +174 -34
- package/templates/nextjs-standalone/src/lib/scheduler/delivery.ts +248 -150
- package/templates/nextjs-standalone/src/lib/scheduler/engine.ts +190 -154
- package/templates/nextjs-standalone/src/lib/scheduler/executor.ts +74 -23
- package/templates/nextjs-standalone/src/lib/scheduler/preview.ts +72 -0
- package/templates/nextjs-standalone/src/lib/security/abuse.ts +463 -0
- package/templates/nextjs-standalone/src/lib/semantic/diff.ts +267 -0
- package/templates/nextjs-standalone/src/lib/semantic/entities.ts +167 -0
- package/templates/nextjs-standalone/src/lib/semantic/files.ts +283 -0
- package/templates/nextjs-standalone/src/lib/semantic/index.ts +27 -0
- package/templates/nextjs-standalone/src/lib/{semantic-index.ts → semantic/search.ts} +80 -9
- package/templates/nextjs-standalone/src/lib/semantic/sync.ts +581 -0
- package/templates/nextjs-standalone/src/lib/{semantic.ts → semantic/whitelist.ts} +189 -3
- package/templates/nextjs-standalone/src/lib/settings.ts +817 -0
- package/templates/nextjs-standalone/src/lib/sidecar-types.ts +13 -0
- package/templates/nextjs-standalone/src/lib/slack/store.ts +134 -25
- package/templates/nextjs-standalone/src/lib/startup.ts +528 -362
- package/templates/nextjs-standalone/src/lib/teams/store.ts +216 -0
- package/templates/nextjs-standalone/src/lib/telegram/store.ts +202 -0
- package/templates/nextjs-standalone/src/lib/telemetry.ts +40 -0
- package/templates/nextjs-standalone/src/lib/tools/actions/audit.ts +8 -5
- package/templates/nextjs-standalone/src/lib/tools/actions/email.ts +3 -1
- package/templates/nextjs-standalone/src/lib/tools/actions/handler.ts +276 -93
- package/templates/nextjs-standalone/src/lib/tools/actions/jira.ts +2 -2
- package/templates/nextjs-standalone/src/lib/tools/backends/detect.ts +16 -0
- package/templates/nextjs-standalone/src/lib/tools/backends/index.ts +11 -0
- package/templates/nextjs-standalone/src/lib/tools/backends/nsjail.ts +213 -0
- package/templates/nextjs-standalone/src/lib/tools/backends/shared.ts +103 -0
- package/templates/nextjs-standalone/src/lib/tools/backends/types.ts +26 -0
- package/templates/nextjs-standalone/src/lib/tools/explore-nsjail.ts +7 -228
- package/templates/nextjs-standalone/src/lib/tools/explore-sandbox.ts +4 -29
- package/templates/nextjs-standalone/src/lib/tools/explore-sidecar.ts +18 -2
- package/templates/nextjs-standalone/src/lib/tools/explore.ts +246 -54
- package/templates/nextjs-standalone/src/lib/tools/index.ts +17 -0
- package/templates/nextjs-standalone/src/lib/tools/python-nsjail.ts +11 -139
- package/templates/nextjs-standalone/src/lib/tools/python-sandbox.ts +9 -132
- package/templates/nextjs-standalone/src/lib/tools/python-sidecar.ts +184 -3
- package/templates/nextjs-standalone/src/lib/tools/python-stream.ts +33 -0
- package/templates/nextjs-standalone/src/lib/tools/python-wrapper.ts +129 -0
- package/templates/nextjs-standalone/src/lib/tools/python.ts +115 -15
- package/templates/nextjs-standalone/src/lib/tools/registry.ts +14 -2
- package/templates/nextjs-standalone/src/lib/tools/sql.ts +778 -362
- package/templates/nextjs-standalone/src/lib/tracing.ts +16 -0
- package/templates/nextjs-standalone/src/lib/whatsapp/store.ts +198 -0
- package/templates/nextjs-standalone/src/lib/workspace.ts +89 -0
- package/templates/nextjs-standalone/src/progress.ts +121 -0
- package/templates/nextjs-standalone/src/types/data-table.ts +48 -0
- package/templates/nextjs-standalone/src/ui/atlas-chat-reexport.ts +3 -0
- package/templates/nextjs-standalone/src/ui/components/actions/action-approval-card.tsx +26 -19
- package/templates/nextjs-standalone/src/ui/components/actions/action-status-badge.tsx +3 -3
- package/templates/nextjs-standalone/src/ui/components/admin/admin-layout.tsx +57 -39
- package/templates/nextjs-standalone/src/ui/components/admin/admin-sidebar.tsx +213 -35
- package/templates/nextjs-standalone/src/ui/components/admin/delivery-status-badge.tsx +53 -0
- package/templates/nextjs-standalone/src/ui/components/admin/empty-state.tsx +27 -6
- package/templates/nextjs-standalone/src/ui/components/admin/entity-detail.tsx +3 -52
- package/templates/nextjs-standalone/src/ui/components/admin/error-banner.tsx +2 -2
- package/templates/nextjs-standalone/src/ui/components/admin/feature-disabled.tsx +28 -5
- package/templates/nextjs-standalone/src/ui/components/admin-content-wrapper.tsx +87 -0
- package/templates/nextjs-standalone/src/ui/components/atlas-chat.tsx +449 -166
- package/templates/nextjs-standalone/src/ui/components/branding-head.tsx +41 -0
- package/templates/nextjs-standalone/src/ui/components/chart/chart-detection.ts +62 -5
- package/templates/nextjs-standalone/src/ui/components/chart/result-chart.tsx +316 -125
- package/templates/nextjs-standalone/src/ui/components/chat/api-key-bar.tsx +4 -4
- package/templates/nextjs-standalone/src/ui/components/chat/data-table.tsx +45 -4
- package/templates/nextjs-standalone/src/ui/components/chat/error-banner.tsx +86 -5
- package/templates/nextjs-standalone/src/ui/components/chat/follow-up-chips.tsx +29 -0
- package/templates/nextjs-standalone/src/ui/components/chat/markdown.tsx +24 -0
- package/templates/nextjs-standalone/src/ui/components/chat/prompt-library.tsx +206 -0
- package/templates/nextjs-standalone/src/ui/components/chat/python-result-card.tsx +106 -78
- package/templates/nextjs-standalone/src/ui/components/chat/result-card-base.tsx +101 -0
- package/templates/nextjs-standalone/src/ui/components/chat/share-dialog.tsx +377 -0
- package/templates/nextjs-standalone/src/ui/components/chat/sql-result-card.tsx +94 -73
- package/templates/nextjs-standalone/src/ui/components/chat/suggestion-chips.tsx +46 -0
- package/templates/nextjs-standalone/src/ui/components/chat/tool-part.tsx +16 -4
- package/templates/nextjs-standalone/src/ui/components/conversations/conversation-item.tsx +48 -17
- package/templates/nextjs-standalone/src/ui/components/conversations/conversation-list.tsx +38 -24
- package/templates/nextjs-standalone/src/ui/components/conversations/conversation-sidebar.tsx +66 -7
- package/templates/nextjs-standalone/src/ui/components/conversations/delete-confirmation.tsx +9 -2
- package/templates/nextjs-standalone/src/ui/components/error-boundary.tsx +66 -0
- package/templates/nextjs-standalone/src/ui/components/notebook/delete-cell-dialog.tsx +48 -0
- package/templates/nextjs-standalone/src/ui/components/notebook/fork-branch-selector.tsx +68 -0
- package/templates/nextjs-standalone/src/ui/components/notebook/notebook-cell-input.tsx +76 -0
- package/templates/nextjs-standalone/src/ui/components/notebook/notebook-cell-output.tsx +58 -0
- package/templates/nextjs-standalone/src/ui/components/notebook/notebook-cell-toolbar.tsx +91 -0
- package/templates/nextjs-standalone/src/ui/components/notebook/notebook-cell.tsx +119 -0
- package/templates/nextjs-standalone/src/ui/components/notebook/notebook-empty-state.tsx +19 -0
- package/templates/nextjs-standalone/src/ui/components/notebook/notebook-export.ts +287 -0
- package/templates/nextjs-standalone/src/ui/components/notebook/notebook-input-bar.tsx +49 -0
- package/templates/nextjs-standalone/src/ui/components/notebook/notebook-shell.tsx +266 -0
- package/templates/nextjs-standalone/src/ui/components/notebook/notebook-text-cell.tsx +152 -0
- package/templates/nextjs-standalone/src/ui/components/notebook/types.ts +39 -0
- package/templates/nextjs-standalone/src/ui/components/notebook/use-keyboard-nav.ts +109 -0
- package/templates/nextjs-standalone/src/ui/components/notebook/use-notebook.ts +684 -0
- package/templates/nextjs-standalone/src/ui/components/org-switcher.tsx +111 -0
- package/templates/nextjs-standalone/src/ui/components/region-picker.tsx +103 -0
- package/templates/nextjs-standalone/src/ui/components/schema-explorer/schema-explorer.tsx +522 -0
- package/templates/nextjs-standalone/src/ui/components/social-icons.tsx +26 -0
- package/templates/nextjs-standalone/src/ui/components/tour/guided-tour.tsx +81 -0
- package/templates/nextjs-standalone/src/ui/components/tour/index.ts +5 -0
- package/templates/nextjs-standalone/src/ui/components/tour/nav-bar.tsx +100 -0
- package/templates/nextjs-standalone/src/ui/components/tour/tour-overlay.tsx +298 -0
- package/templates/nextjs-standalone/src/ui/components/tour/tour-steps.ts +43 -0
- package/templates/nextjs-standalone/src/ui/components/tour/types.ts +21 -0
- package/templates/nextjs-standalone/src/ui/components/tour/use-tour.ts +193 -0
- package/templates/nextjs-standalone/src/ui/context-reexport.ts +3 -0
- package/templates/nextjs-standalone/src/ui/hooks/theme-init-script.ts +17 -0
- package/templates/nextjs-standalone/src/ui/hooks/use-admin-fetch.ts +38 -30
- package/templates/nextjs-standalone/src/ui/hooks/use-admin-mutation.ts +188 -0
- package/templates/nextjs-standalone/src/ui/hooks/use-atlas-transport.ts +225 -0
- package/templates/nextjs-standalone/src/ui/hooks/use-branding.ts +68 -0
- package/templates/nextjs-standalone/src/ui/hooks/use-conversations.ts +106 -83
- package/templates/nextjs-standalone/src/ui/hooks/use-dark-mode.ts +134 -10
- package/templates/nextjs-standalone/src/ui/hooks/use-deploy-mode.ts +36 -0
- package/templates/nextjs-standalone/src/ui/hooks/use-platform-admin-guard.ts +49 -0
- package/templates/nextjs-standalone/src/ui/lib/action-types.ts +11 -63
- package/templates/nextjs-standalone/src/ui/lib/admin-schemas.ts +744 -0
- package/templates/nextjs-standalone/src/ui/lib/fetch-client.ts +84 -0
- package/templates/nextjs-standalone/src/ui/lib/fetch-error.ts +54 -0
- package/templates/nextjs-standalone/src/ui/lib/helpers.ts +94 -1
- package/templates/nextjs-standalone/src/ui/lib/types.ts +149 -140
- package/templates/nextjs-standalone/tsconfig.json +3 -2
- package/templates/docker/src/api/__tests__/actions.test.ts +0 -683
- package/templates/docker/src/api/__tests__/admin.test.ts +0 -820
- package/templates/docker/src/api/__tests__/auth.test.ts +0 -165
- package/templates/docker/src/api/__tests__/chat.test.ts +0 -376
- package/templates/docker/src/api/__tests__/conversations.test.ts +0 -555
- package/templates/docker/src/api/__tests__/cors.test.ts +0 -135
- package/templates/docker/src/api/__tests__/health-plugin.test.ts +0 -176
- package/templates/docker/src/api/__tests__/health.test.ts +0 -283
- package/templates/docker/src/api/__tests__/query.test.ts +0 -891
- package/templates/docker/src/api/__tests__/scheduled-tasks.test.ts +0 -601
- package/templates/docker/src/api/__tests__/slack.test.ts +0 -847
- package/templates/docker/src/lib/__tests__/agent-cache.test.ts +0 -439
- package/templates/docker/src/lib/__tests__/agent-dialect.test.ts +0 -131
- package/templates/docker/src/lib/__tests__/agent-health-annotations.test.ts +0 -166
- package/templates/docker/src/lib/__tests__/agent-integration.test.ts +0 -516
- package/templates/docker/src/lib/__tests__/config-actions.test.ts +0 -166
- package/templates/docker/src/lib/__tests__/config.test.ts +0 -1113
- package/templates/docker/src/lib/__tests__/conversations.test.ts +0 -589
- package/templates/docker/src/lib/__tests__/errors.test.ts +0 -256
- package/templates/docker/src/lib/__tests__/logger.test.ts +0 -200
- package/templates/docker/src/lib/__tests__/plugin-aware-validation.test.ts +0 -321
- package/templates/docker/src/lib/__tests__/providers.test.ts +0 -130
- package/templates/docker/src/lib/__tests__/rls.test.ts +0 -435
- package/templates/docker/src/lib/__tests__/scheduled-task-types.test.ts +0 -124
- package/templates/docker/src/lib/__tests__/scheduled-tasks.test.ts +0 -550
- package/templates/docker/src/lib/__tests__/semantic-index.test.ts +0 -547
- package/templates/docker/src/lib/__tests__/semantic-multisource.test.ts +0 -544
- package/templates/docker/src/lib/__tests__/semantic.test.ts +0 -363
- package/templates/docker/src/lib/__tests__/startup-actions.test.ts +0 -461
- package/templates/docker/src/lib/__tests__/startup-first-run.test.ts +0 -429
- package/templates/docker/src/lib/__tests__/startup.test.ts +0 -470
- package/templates/docker/src/lib/__tests__/tracing.test.ts +0 -28
- package/templates/docker/src/lib/auth/__tests__/audit.test.ts +0 -418
- package/templates/docker/src/lib/auth/__tests__/byot-integration.test.ts +0 -222
- package/templates/docker/src/lib/auth/__tests__/byot.test.ts +0 -366
- package/templates/docker/src/lib/auth/__tests__/detect.test.ts +0 -190
- package/templates/docker/src/lib/auth/__tests__/managed.test.ts +0 -173
- package/templates/docker/src/lib/auth/__tests__/middleware.test.ts +0 -456
- package/templates/docker/src/lib/auth/__tests__/migrate.test.ts +0 -203
- package/templates/docker/src/lib/auth/__tests__/permissions.test.ts +0 -225
- package/templates/docker/src/lib/auth/__tests__/server.test.ts +0 -34
- package/templates/docker/src/lib/auth/__tests__/simple-key.test.ts +0 -176
- package/templates/docker/src/lib/auth/__tests__/types.test.ts +0 -44
- package/templates/docker/src/lib/db/__tests__/connection.test.ts +0 -144
- package/templates/docker/src/lib/db/__tests__/internal.test.ts +0 -387
- package/templates/docker/src/lib/db/__tests__/registry-health.test.ts +0 -190
- package/templates/docker/src/lib/db/__tests__/registry-pool-limits.test.ts +0 -137
- package/templates/docker/src/lib/db/__tests__/registry.test.ts +0 -398
- package/templates/docker/src/lib/db/__tests__/source-rate-limit.test.ts +0 -130
- package/templates/docker/src/lib/errors.ts +0 -154
- package/templates/docker/src/lib/plugins/__tests__/hooks-integration.test.ts +0 -204
- package/templates/docker/src/lib/plugins/__tests__/hooks.test.ts +0 -529
- package/templates/docker/src/lib/plugins/__tests__/migrate.test.ts +0 -875
- package/templates/docker/src/lib/plugins/__tests__/registry.test.ts +0 -373
- package/templates/docker/src/lib/plugins/__tests__/tools.test.ts +0 -49
- package/templates/docker/src/lib/plugins/__tests__/wiring.test.ts +0 -799
- package/templates/docker/src/lib/scheduler/__tests__/delivery.test.ts +0 -192
- package/templates/docker/src/lib/scheduler/__tests__/engine.test.ts +0 -248
- package/templates/docker/src/lib/scheduler/__tests__/format-email.test.ts +0 -96
- package/templates/docker/src/lib/scheduler/__tests__/format-slack.test.ts +0 -78
- package/templates/docker/src/lib/scheduler/__tests__/format-webhook.test.ts +0 -78
- package/templates/docker/src/lib/scheduler/index.ts +0 -7
- package/templates/docker/src/lib/slack/__tests__/api.test.ts +0 -160
- package/templates/docker/src/lib/slack/__tests__/format.test.ts +0 -237
- package/templates/docker/src/lib/slack/__tests__/store.test.ts +0 -188
- package/templates/docker/src/lib/slack/__tests__/threads.test.ts +0 -112
- package/templates/docker/src/lib/slack/__tests__/verify.test.ts +0 -111
- package/templates/docker/src/lib/tools/__tests__/action-permissions.test.ts +0 -594
- package/templates/docker/src/lib/tools/__tests__/custom-validation.test.ts +0 -240
- package/templates/docker/src/lib/tools/__tests__/explore-backend.test.ts +0 -267
- package/templates/docker/src/lib/tools/__tests__/explore-nsjail.test.ts +0 -506
- package/templates/docker/src/lib/tools/__tests__/explore-plugin.test.ts +0 -374
- package/templates/docker/src/lib/tools/__tests__/explore-sdk-compat.test.ts +0 -82
- package/templates/docker/src/lib/tools/__tests__/explore-sidecar.test.ts +0 -210
- package/templates/docker/src/lib/tools/__tests__/python-nsjail.test.ts +0 -515
- package/templates/docker/src/lib/tools/__tests__/python-sandbox.test.ts +0 -397
- package/templates/docker/src/lib/tools/__tests__/python-sidecar.test.ts +0 -365
- package/templates/docker/src/lib/tools/__tests__/python.test.ts +0 -331
- package/templates/docker/src/lib/tools/__tests__/registry-actions.test.ts +0 -132
- package/templates/docker/src/lib/tools/__tests__/registry.test.ts +0 -242
- package/templates/docker/src/lib/tools/__tests__/sql-audit.test.ts +0 -227
- package/templates/docker/src/lib/tools/__tests__/sql-connection-whitelist.test.ts +0 -100
- package/templates/docker/src/lib/tools/__tests__/sql-ratelimit.test.ts +0 -227
- package/templates/docker/src/lib/tools/__tests__/sql.test.ts +0 -709
- package/templates/docker/src/lib/tools/actions/__tests__/audit.test.ts +0 -211
- package/templates/docker/src/lib/tools/actions/__tests__/email.test.ts +0 -378
- package/templates/docker/src/lib/tools/actions/__tests__/handler.test.ts +0 -681
- package/templates/docker/src/lib/tools/actions/__tests__/jira.test.ts +0 -427
- package/templates/docker/src/test-setup.ts +0 -38
- package/templates/docker/src/types/vercel-sandbox.d.ts +0 -61
- package/templates/docker/src/ui/components/chat/managed-auth-card.tsx +0 -116
- package/templates/nextjs-standalone/src/api/__tests__/actions.test.ts +0 -683
- package/templates/nextjs-standalone/src/api/__tests__/admin.test.ts +0 -820
- package/templates/nextjs-standalone/src/api/__tests__/auth.test.ts +0 -165
- package/templates/nextjs-standalone/src/api/__tests__/chat.test.ts +0 -376
- package/templates/nextjs-standalone/src/api/__tests__/conversations.test.ts +0 -555
- package/templates/nextjs-standalone/src/api/__tests__/cors.test.ts +0 -135
- package/templates/nextjs-standalone/src/api/__tests__/health-plugin.test.ts +0 -176
- package/templates/nextjs-standalone/src/api/__tests__/health.test.ts +0 -283
- package/templates/nextjs-standalone/src/api/__tests__/query.test.ts +0 -891
- package/templates/nextjs-standalone/src/api/__tests__/scheduled-tasks.test.ts +0 -601
- package/templates/nextjs-standalone/src/api/__tests__/slack.test.ts +0 -847
- package/templates/nextjs-standalone/src/app/global-error.tsx +0 -68
- package/templates/nextjs-standalone/src/lib/__tests__/agent-cache.test.ts +0 -439
- package/templates/nextjs-standalone/src/lib/__tests__/agent-dialect.test.ts +0 -131
- package/templates/nextjs-standalone/src/lib/__tests__/agent-health-annotations.test.ts +0 -166
- package/templates/nextjs-standalone/src/lib/__tests__/agent-integration.test.ts +0 -516
- package/templates/nextjs-standalone/src/lib/__tests__/config-actions.test.ts +0 -166
- package/templates/nextjs-standalone/src/lib/__tests__/config.test.ts +0 -1113
- package/templates/nextjs-standalone/src/lib/__tests__/conversations.test.ts +0 -589
- package/templates/nextjs-standalone/src/lib/__tests__/errors.test.ts +0 -256
- package/templates/nextjs-standalone/src/lib/__tests__/logger.test.ts +0 -200
- package/templates/nextjs-standalone/src/lib/__tests__/plugin-aware-validation.test.ts +0 -321
- package/templates/nextjs-standalone/src/lib/__tests__/providers.test.ts +0 -130
- package/templates/nextjs-standalone/src/lib/__tests__/rls.test.ts +0 -435
- package/templates/nextjs-standalone/src/lib/__tests__/scheduled-task-types.test.ts +0 -124
- package/templates/nextjs-standalone/src/lib/__tests__/scheduled-tasks.test.ts +0 -550
- package/templates/nextjs-standalone/src/lib/__tests__/semantic-index.test.ts +0 -547
- package/templates/nextjs-standalone/src/lib/__tests__/semantic-multisource.test.ts +0 -544
- package/templates/nextjs-standalone/src/lib/__tests__/semantic.test.ts +0 -363
- package/templates/nextjs-standalone/src/lib/__tests__/startup-actions.test.ts +0 -461
- package/templates/nextjs-standalone/src/lib/__tests__/startup-first-run.test.ts +0 -429
- package/templates/nextjs-standalone/src/lib/__tests__/startup.test.ts +0 -470
- package/templates/nextjs-standalone/src/lib/__tests__/tracing.test.ts +0 -28
- package/templates/nextjs-standalone/src/lib/auth/__tests__/audit.test.ts +0 -418
- package/templates/nextjs-standalone/src/lib/auth/__tests__/byot-integration.test.ts +0 -222
- package/templates/nextjs-standalone/src/lib/auth/__tests__/byot.test.ts +0 -366
- package/templates/nextjs-standalone/src/lib/auth/__tests__/detect.test.ts +0 -190
- package/templates/nextjs-standalone/src/lib/auth/__tests__/managed.test.ts +0 -173
- package/templates/nextjs-standalone/src/lib/auth/__tests__/middleware.test.ts +0 -456
- package/templates/nextjs-standalone/src/lib/auth/__tests__/migrate.test.ts +0 -203
- package/templates/nextjs-standalone/src/lib/auth/__tests__/permissions.test.ts +0 -225
- package/templates/nextjs-standalone/src/lib/auth/__tests__/server.test.ts +0 -34
- package/templates/nextjs-standalone/src/lib/auth/__tests__/simple-key.test.ts +0 -176
- package/templates/nextjs-standalone/src/lib/auth/__tests__/types.test.ts +0 -44
- package/templates/nextjs-standalone/src/lib/db/__tests__/connection.test.ts +0 -144
- package/templates/nextjs-standalone/src/lib/db/__tests__/internal.test.ts +0 -387
- package/templates/nextjs-standalone/src/lib/db/__tests__/registry-health.test.ts +0 -190
- package/templates/nextjs-standalone/src/lib/db/__tests__/registry-pool-limits.test.ts +0 -137
- package/templates/nextjs-standalone/src/lib/db/__tests__/registry.test.ts +0 -398
- package/templates/nextjs-standalone/src/lib/db/__tests__/source-rate-limit.test.ts +0 -130
- package/templates/nextjs-standalone/src/lib/errors.ts +0 -154
- package/templates/nextjs-standalone/src/lib/plugins/__tests__/hooks-integration.test.ts +0 -204
- package/templates/nextjs-standalone/src/lib/plugins/__tests__/hooks.test.ts +0 -529
- package/templates/nextjs-standalone/src/lib/plugins/__tests__/migrate.test.ts +0 -875
- package/templates/nextjs-standalone/src/lib/plugins/__tests__/registry.test.ts +0 -373
- package/templates/nextjs-standalone/src/lib/plugins/__tests__/tools.test.ts +0 -49
- package/templates/nextjs-standalone/src/lib/plugins/__tests__/wiring.test.ts +0 -799
- package/templates/nextjs-standalone/src/lib/scheduler/__tests__/delivery.test.ts +0 -192
- package/templates/nextjs-standalone/src/lib/scheduler/__tests__/engine.test.ts +0 -248
- package/templates/nextjs-standalone/src/lib/scheduler/__tests__/format-email.test.ts +0 -96
- package/templates/nextjs-standalone/src/lib/scheduler/__tests__/format-slack.test.ts +0 -78
- package/templates/nextjs-standalone/src/lib/scheduler/__tests__/format-webhook.test.ts +0 -78
- package/templates/nextjs-standalone/src/lib/scheduler/index.ts +0 -7
- package/templates/nextjs-standalone/src/lib/slack/__tests__/api.test.ts +0 -160
- package/templates/nextjs-standalone/src/lib/slack/__tests__/format.test.ts +0 -237
- package/templates/nextjs-standalone/src/lib/slack/__tests__/store.test.ts +0 -188
- package/templates/nextjs-standalone/src/lib/slack/__tests__/threads.test.ts +0 -112
- package/templates/nextjs-standalone/src/lib/slack/__tests__/verify.test.ts +0 -111
- package/templates/nextjs-standalone/src/lib/tools/__tests__/action-permissions.test.ts +0 -594
- package/templates/nextjs-standalone/src/lib/tools/__tests__/custom-validation.test.ts +0 -240
- package/templates/nextjs-standalone/src/lib/tools/__tests__/explore-backend.test.ts +0 -267
- package/templates/nextjs-standalone/src/lib/tools/__tests__/explore-nsjail.test.ts +0 -506
- package/templates/nextjs-standalone/src/lib/tools/__tests__/explore-plugin.test.ts +0 -374
- package/templates/nextjs-standalone/src/lib/tools/__tests__/explore-sdk-compat.test.ts +0 -82
- package/templates/nextjs-standalone/src/lib/tools/__tests__/explore-sidecar.test.ts +0 -210
- package/templates/nextjs-standalone/src/lib/tools/__tests__/python-nsjail.test.ts +0 -515
- package/templates/nextjs-standalone/src/lib/tools/__tests__/python-sandbox.test.ts +0 -397
- package/templates/nextjs-standalone/src/lib/tools/__tests__/python-sidecar.test.ts +0 -365
- package/templates/nextjs-standalone/src/lib/tools/__tests__/python.test.ts +0 -331
- package/templates/nextjs-standalone/src/lib/tools/__tests__/registry-actions.test.ts +0 -132
- package/templates/nextjs-standalone/src/lib/tools/__tests__/registry.test.ts +0 -242
- package/templates/nextjs-standalone/src/lib/tools/__tests__/sql-audit.test.ts +0 -227
- package/templates/nextjs-standalone/src/lib/tools/__tests__/sql-connection-whitelist.test.ts +0 -100
- package/templates/nextjs-standalone/src/lib/tools/__tests__/sql-ratelimit.test.ts +0 -227
- package/templates/nextjs-standalone/src/lib/tools/__tests__/sql.test.ts +0 -709
- package/templates/nextjs-standalone/src/lib/tools/actions/__tests__/audit.test.ts +0 -211
- package/templates/nextjs-standalone/src/lib/tools/actions/__tests__/email.test.ts +0 -378
- package/templates/nextjs-standalone/src/lib/tools/actions/__tests__/handler.test.ts +0 -681
- package/templates/nextjs-standalone/src/lib/tools/actions/__tests__/jira.test.ts +0 -427
- package/templates/nextjs-standalone/src/test-setup.ts +0 -38
- package/templates/nextjs-standalone/src/ui/components/chat/managed-auth-card.tsx +0 -116
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
name: Assets
|
|
2
|
+
type: dimension_table
|
|
3
|
+
table: assets
|
|
4
|
+
grain: one row per IT asset
|
|
5
|
+
description: |
|
|
6
|
+
IT assets monitored by the Sentinel Security platform. Includes servers,
|
|
7
|
+
workstations, network devices, containers, and cloud instances. Each asset
|
|
8
|
+
belongs to one organization and has a type, OS, environment classification,
|
|
9
|
+
and activity timestamps. display_name is NULL for ~40% of assets — use
|
|
10
|
+
hostname as the primary identifier. Assets are linked to scan_results and
|
|
11
|
+
vulnerability_instances for security analysis.
|
|
12
|
+
|
|
13
|
+
dimensions:
|
|
14
|
+
- name: id
|
|
15
|
+
sql: id
|
|
16
|
+
type: number
|
|
17
|
+
description: Primary key — unique asset identifier
|
|
18
|
+
primary_key: true
|
|
19
|
+
|
|
20
|
+
- name: organization_id
|
|
21
|
+
sql: organization_id
|
|
22
|
+
type: number
|
|
23
|
+
description: Foreign key to organizations — which customer owns this asset
|
|
24
|
+
|
|
25
|
+
- name: hostname
|
|
26
|
+
sql: hostname
|
|
27
|
+
type: string
|
|
28
|
+
description: Network hostname of the asset (always populated)
|
|
29
|
+
sample_values: [web-prod-01, db-staging-03, app-dev-12, fw-edge-01]
|
|
30
|
+
|
|
31
|
+
- name: display_name
|
|
32
|
+
sql: display_name
|
|
33
|
+
type: string
|
|
34
|
+
description: |
|
|
35
|
+
Human-readable display name. NULL for ~40% of assets — fall back to
|
|
36
|
+
hostname when display_name is not set.
|
|
37
|
+
|
|
38
|
+
- name: asset_type
|
|
39
|
+
sql: asset_type
|
|
40
|
+
type: string
|
|
41
|
+
description: Type of IT asset
|
|
42
|
+
sample_values: [server, workstation, network_device, container, cloud_instance]
|
|
43
|
+
|
|
44
|
+
- name: ip_address
|
|
45
|
+
sql: ip_address
|
|
46
|
+
type: string
|
|
47
|
+
description: IP address of the asset
|
|
48
|
+
|
|
49
|
+
- name: os
|
|
50
|
+
sql: os
|
|
51
|
+
type: string
|
|
52
|
+
description: Operating system
|
|
53
|
+
sample_values: [Linux, Windows, macOS, Ubuntu, CentOS, RHEL, Debian]
|
|
54
|
+
|
|
55
|
+
- name: os_version
|
|
56
|
+
sql: os_version
|
|
57
|
+
type: string
|
|
58
|
+
description: Operating system version string
|
|
59
|
+
|
|
60
|
+
- name: environment
|
|
61
|
+
sql: environment
|
|
62
|
+
type: string
|
|
63
|
+
description: Deployment environment classification
|
|
64
|
+
sample_values: [production, staging, development]
|
|
65
|
+
|
|
66
|
+
- name: is_active
|
|
67
|
+
sql: is_active
|
|
68
|
+
type: boolean
|
|
69
|
+
description: Whether the asset is currently being monitored
|
|
70
|
+
|
|
71
|
+
- name: first_seen
|
|
72
|
+
sql: first_seen
|
|
73
|
+
type: timestamp
|
|
74
|
+
description: When the asset was first discovered by the platform
|
|
75
|
+
|
|
76
|
+
- name: last_seen
|
|
77
|
+
sql: last_seen
|
|
78
|
+
type: timestamp
|
|
79
|
+
description: When the asset was last observed / checked in
|
|
80
|
+
|
|
81
|
+
- name: created_at
|
|
82
|
+
sql: created_at
|
|
83
|
+
type: timestamp
|
|
84
|
+
description: When the asset record was created
|
|
85
|
+
|
|
86
|
+
- name: effective_name
|
|
87
|
+
sql: COALESCE(display_name, hostname)
|
|
88
|
+
type: string
|
|
89
|
+
description: Display name if set, otherwise hostname — use this for user-facing labels
|
|
90
|
+
virtual: true
|
|
91
|
+
|
|
92
|
+
- name: days_since_last_seen
|
|
93
|
+
sql: EXTRACT(DAY FROM (CURRENT_TIMESTAMP - last_seen))
|
|
94
|
+
type: number
|
|
95
|
+
description: Days since the asset was last observed — high values indicate stale/offline assets
|
|
96
|
+
virtual: true
|
|
97
|
+
|
|
98
|
+
- name: staleness_bucket
|
|
99
|
+
sql: |-
|
|
100
|
+
CASE
|
|
101
|
+
WHEN last_seen >= CURRENT_TIMESTAMP - INTERVAL '1 day' THEN 'Active (today)'
|
|
102
|
+
WHEN last_seen >= CURRENT_TIMESTAMP - INTERVAL '7 days' THEN 'Recent (this week)'
|
|
103
|
+
WHEN last_seen >= CURRENT_TIMESTAMP - INTERVAL '30 days' THEN 'Stale (this month)'
|
|
104
|
+
ELSE 'Offline (30+ days)'
|
|
105
|
+
END
|
|
106
|
+
type: string
|
|
107
|
+
description: Staleness bucket based on last_seen
|
|
108
|
+
virtual: true
|
|
109
|
+
sample_values: [Active (today), Recent (this week), Stale (this month), Offline (30+ days)]
|
|
110
|
+
|
|
111
|
+
- name: os_family
|
|
112
|
+
sql: |-
|
|
113
|
+
CASE
|
|
114
|
+
WHEN os IN ('Linux', 'Ubuntu', 'CentOS', 'RHEL', 'Debian') THEN 'Linux'
|
|
115
|
+
WHEN os = 'Windows' THEN 'Windows'
|
|
116
|
+
WHEN os = 'macOS' THEN 'macOS'
|
|
117
|
+
ELSE 'Other'
|
|
118
|
+
END
|
|
119
|
+
type: string
|
|
120
|
+
description: Simplified OS family grouping
|
|
121
|
+
virtual: true
|
|
122
|
+
sample_values: [Linux, Windows, macOS, Other]
|
|
123
|
+
|
|
124
|
+
measures:
|
|
125
|
+
- name: asset_count
|
|
126
|
+
sql: id
|
|
127
|
+
type: count_distinct
|
|
128
|
+
description: Number of unique assets
|
|
129
|
+
|
|
130
|
+
- name: active_asset_count
|
|
131
|
+
sql: CASE WHEN is_active THEN id END
|
|
132
|
+
type: count_distinct
|
|
133
|
+
description: Number of active (monitored) assets
|
|
134
|
+
|
|
135
|
+
joins:
|
|
136
|
+
- target_entity: Organizations
|
|
137
|
+
relationship: many_to_one
|
|
138
|
+
join_columns:
|
|
139
|
+
from: organization_id
|
|
140
|
+
to: id
|
|
141
|
+
description: Each asset belongs to one organization
|
|
142
|
+
|
|
143
|
+
use_cases:
|
|
144
|
+
- Asset inventory and coverage analysis by organization
|
|
145
|
+
- Environment breakdown (production vs staging vs development)
|
|
146
|
+
- OS distribution and version tracking for patch management
|
|
147
|
+
- Stale asset detection — assets not seen recently
|
|
148
|
+
- Join to scan_results for per-asset vulnerability density
|
|
149
|
+
|
|
150
|
+
query_patterns:
|
|
151
|
+
- name: assets_by_type
|
|
152
|
+
description: Asset count by type
|
|
153
|
+
sql: |-
|
|
154
|
+
SELECT asset_type,
|
|
155
|
+
COUNT(*) AS asset_count,
|
|
156
|
+
COUNT(*) FILTER (WHERE is_active) AS active_count
|
|
157
|
+
FROM assets
|
|
158
|
+
GROUP BY asset_type
|
|
159
|
+
ORDER BY asset_count DESC
|
|
160
|
+
|
|
161
|
+
- name: assets_by_environment
|
|
162
|
+
description: Asset distribution by environment
|
|
163
|
+
sql: |-
|
|
164
|
+
SELECT environment,
|
|
165
|
+
COUNT(*) AS asset_count,
|
|
166
|
+
COUNT(*) FILTER (WHERE is_active) AS active_count
|
|
167
|
+
FROM assets
|
|
168
|
+
GROUP BY environment
|
|
169
|
+
ORDER BY asset_count DESC
|
|
170
|
+
|
|
171
|
+
- name: assets_per_org
|
|
172
|
+
description: Asset density per organization
|
|
173
|
+
sql: |-
|
|
174
|
+
SELECT o.name AS organization,
|
|
175
|
+
COUNT(a.id) AS asset_count,
|
|
176
|
+
COUNT(DISTINCT a.asset_type) AS asset_types,
|
|
177
|
+
COUNT(*) FILTER (WHERE a.environment = 'production') AS prod_assets
|
|
178
|
+
FROM assets a
|
|
179
|
+
JOIN organizations o ON a.organization_id = o.id
|
|
180
|
+
WHERE a.is_active = true
|
|
181
|
+
GROUP BY o.name
|
|
182
|
+
ORDER BY asset_count DESC
|
|
183
|
+
|
|
184
|
+
- name: stale_assets
|
|
185
|
+
description: Assets not seen in the last 30 days
|
|
186
|
+
sql: |-
|
|
187
|
+
SELECT hostname, asset_type, os, environment, last_seen
|
|
188
|
+
FROM assets
|
|
189
|
+
WHERE is_active = true
|
|
190
|
+
AND last_seen < CURRENT_TIMESTAMP - INTERVAL '30 days'
|
|
191
|
+
ORDER BY last_seen
|
package/templates/nextjs-standalone/data/cybersec-semantic/entities/compliance_assessments.yml
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
name: Compliance Assessments
|
|
2
|
+
type: fact_table
|
|
3
|
+
table: compliance_assessments
|
|
4
|
+
grain: one row per compliance assessment
|
|
5
|
+
description: |
|
|
6
|
+
Compliance assessments conducted against regulatory frameworks for customer
|
|
7
|
+
organizations. Each assessment evaluates an organization against a specific
|
|
8
|
+
framework (SOC 2, ISO 27001, HIPAA, etc.) and produces a score. Tracks
|
|
9
|
+
assessment lifecycle from initiation to completion. Use for compliance
|
|
10
|
+
readiness analysis, score trending, and framework coverage tracking.
|
|
11
|
+
|
|
12
|
+
dimensions:
|
|
13
|
+
- name: id
|
|
14
|
+
sql: id
|
|
15
|
+
type: number
|
|
16
|
+
description: Primary key — unique assessment identifier
|
|
17
|
+
primary_key: true
|
|
18
|
+
|
|
19
|
+
- name: organization_id
|
|
20
|
+
sql: organization_id
|
|
21
|
+
type: number
|
|
22
|
+
description: Foreign key to organizations — which customer was assessed
|
|
23
|
+
|
|
24
|
+
- name: framework_id
|
|
25
|
+
sql: framework_id
|
|
26
|
+
type: number
|
|
27
|
+
description: Foreign key to compliance_frameworks — which framework was assessed against
|
|
28
|
+
|
|
29
|
+
- name: status
|
|
30
|
+
sql: status
|
|
31
|
+
type: string
|
|
32
|
+
description: Current assessment status
|
|
33
|
+
sample_values: [pending, in_progress, completed, failed]
|
|
34
|
+
|
|
35
|
+
- name: started_at
|
|
36
|
+
sql: started_at
|
|
37
|
+
type: timestamp
|
|
38
|
+
description: When the assessment began
|
|
39
|
+
|
|
40
|
+
- name: completed_at
|
|
41
|
+
sql: completed_at
|
|
42
|
+
type: timestamp
|
|
43
|
+
description: When the assessment was completed (NULL if still in progress)
|
|
44
|
+
|
|
45
|
+
- name: score
|
|
46
|
+
sql: score
|
|
47
|
+
type: number
|
|
48
|
+
description: |
|
|
49
|
+
Compliance score (0–100) representing the organization's compliance
|
|
50
|
+
level against the framework. Higher = more compliant. NULL if the
|
|
51
|
+
assessment has not been completed.
|
|
52
|
+
|
|
53
|
+
- name: created_at
|
|
54
|
+
sql: created_at
|
|
55
|
+
type: timestamp
|
|
56
|
+
description: When the assessment record was created
|
|
57
|
+
|
|
58
|
+
- name: score_tier
|
|
59
|
+
sql: |-
|
|
60
|
+
CASE
|
|
61
|
+
WHEN score IS NULL THEN 'Not Scored'
|
|
62
|
+
WHEN score >= 90 THEN 'Excellent (90-100)'
|
|
63
|
+
WHEN score >= 70 THEN 'Good (70-89)'
|
|
64
|
+
WHEN score >= 50 THEN 'Fair (50-69)'
|
|
65
|
+
ELSE 'Poor (0-49)'
|
|
66
|
+
END
|
|
67
|
+
type: string
|
|
68
|
+
description: Compliance score tier bucket
|
|
69
|
+
virtual: true
|
|
70
|
+
sample_values: [Not Scored, Excellent (90-100), Good (70-89), Fair (50-69), Poor (0-49)]
|
|
71
|
+
|
|
72
|
+
- name: is_completed
|
|
73
|
+
sql: CASE WHEN status = 'completed' THEN true ELSE false END
|
|
74
|
+
type: boolean
|
|
75
|
+
description: Whether the assessment has been completed
|
|
76
|
+
virtual: true
|
|
77
|
+
|
|
78
|
+
- name: is_passing
|
|
79
|
+
sql: CASE WHEN score >= 70 THEN true ELSE false END
|
|
80
|
+
type: boolean
|
|
81
|
+
description: Whether the assessment score meets the passing threshold (70+)
|
|
82
|
+
virtual: true
|
|
83
|
+
|
|
84
|
+
- name: duration_days
|
|
85
|
+
sql: |-
|
|
86
|
+
CASE
|
|
87
|
+
WHEN completed_at IS NOT NULL AND started_at IS NOT NULL
|
|
88
|
+
THEN EXTRACT(DAY FROM (completed_at - started_at))
|
|
89
|
+
END
|
|
90
|
+
type: number
|
|
91
|
+
description: Assessment duration in days (NULL if not completed)
|
|
92
|
+
virtual: true
|
|
93
|
+
|
|
94
|
+
- name: completed_month
|
|
95
|
+
sql: |-
|
|
96
|
+
CASE
|
|
97
|
+
WHEN completed_at IS NOT NULL
|
|
98
|
+
THEN TO_CHAR(completed_at, 'YYYY-MM')
|
|
99
|
+
END
|
|
100
|
+
type: string
|
|
101
|
+
description: Year-month the assessment was completed
|
|
102
|
+
virtual: true
|
|
103
|
+
|
|
104
|
+
measures:
|
|
105
|
+
- name: assessment_count
|
|
106
|
+
sql: id
|
|
107
|
+
type: count_distinct
|
|
108
|
+
description: Number of unique assessments
|
|
109
|
+
|
|
110
|
+
- name: completed_count
|
|
111
|
+
sql: CASE WHEN status = 'completed' THEN id END
|
|
112
|
+
type: count_distinct
|
|
113
|
+
description: Number of completed assessments
|
|
114
|
+
|
|
115
|
+
- name: avg_score
|
|
116
|
+
sql: score
|
|
117
|
+
type: avg
|
|
118
|
+
description: Average compliance score (excludes NULLs)
|
|
119
|
+
|
|
120
|
+
joins:
|
|
121
|
+
- target_entity: Organizations
|
|
122
|
+
relationship: many_to_one
|
|
123
|
+
join_columns:
|
|
124
|
+
from: organization_id
|
|
125
|
+
to: id
|
|
126
|
+
description: Each assessment belongs to one organization
|
|
127
|
+
|
|
128
|
+
use_cases:
|
|
129
|
+
- Compliance score tracking by framework across organizations
|
|
130
|
+
- Assessment completion rate and pipeline analysis
|
|
131
|
+
- Organization compliance readiness comparison
|
|
132
|
+
- Score trending over time (improvement tracking)
|
|
133
|
+
- Framework coverage analysis (which frameworks have assessments)
|
|
134
|
+
|
|
135
|
+
query_patterns:
|
|
136
|
+
- name: avg_score_by_framework
|
|
137
|
+
description: Average compliance score by framework
|
|
138
|
+
sql: |-
|
|
139
|
+
SELECT cf.name AS framework,
|
|
140
|
+
COUNT(ca.id) AS assessment_count,
|
|
141
|
+
AVG(ca.score) AS avg_score,
|
|
142
|
+
MIN(ca.score) AS min_score,
|
|
143
|
+
MAX(ca.score) AS max_score
|
|
144
|
+
FROM compliance_assessments ca
|
|
145
|
+
JOIN compliance_frameworks cf ON ca.framework_id = cf.id
|
|
146
|
+
WHERE ca.status = 'completed'
|
|
147
|
+
GROUP BY cf.name
|
|
148
|
+
ORDER BY avg_score DESC
|
|
149
|
+
|
|
150
|
+
- name: org_compliance_overview
|
|
151
|
+
description: Compliance score overview by organization
|
|
152
|
+
sql: |-
|
|
153
|
+
SELECT o.name AS organization,
|
|
154
|
+
COUNT(ca.id) AS total_assessments,
|
|
155
|
+
COUNT(*) FILTER (WHERE ca.status = 'completed') AS completed,
|
|
156
|
+
AVG(ca.score) FILTER (WHERE ca.status = 'completed') AS avg_score
|
|
157
|
+
FROM compliance_assessments ca
|
|
158
|
+
JOIN organizations o ON ca.organization_id = o.id
|
|
159
|
+
GROUP BY o.name
|
|
160
|
+
ORDER BY avg_score
|
|
161
|
+
|
|
162
|
+
- name: assessment_status_breakdown
|
|
163
|
+
description: Assessment count by status
|
|
164
|
+
sql: |-
|
|
165
|
+
SELECT status,
|
|
166
|
+
COUNT(*) AS count,
|
|
167
|
+
AVG(score) AS avg_score
|
|
168
|
+
FROM compliance_assessments
|
|
169
|
+
GROUP BY status
|
|
170
|
+
ORDER BY count DESC
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
name: Incidents
|
|
2
|
+
type: fact_table
|
|
3
|
+
table: incidents
|
|
4
|
+
grain: one row per security incident
|
|
5
|
+
description: |
|
|
6
|
+
Security incidents reported across customer organizations. Each incident
|
|
7
|
+
has a severity, status lifecycle, optional assignment, and resolution
|
|
8
|
+
timestamps. organization_name is denormalized from organizations.
|
|
9
|
+
Core table for incident response metrics, MTTR analysis, and workload
|
|
10
|
+
tracking. Incidents may be linked from alerts via alerts.incident_id.
|
|
11
|
+
|
|
12
|
+
dimensions:
|
|
13
|
+
- name: id
|
|
14
|
+
sql: id
|
|
15
|
+
type: number
|
|
16
|
+
description: Primary key — unique incident identifier
|
|
17
|
+
primary_key: true
|
|
18
|
+
|
|
19
|
+
- name: organization_id
|
|
20
|
+
sql: organization_id
|
|
21
|
+
type: number
|
|
22
|
+
description: Foreign key to organizations — which customer reported this incident
|
|
23
|
+
|
|
24
|
+
- name: organization_name
|
|
25
|
+
sql: organization_name
|
|
26
|
+
type: string
|
|
27
|
+
description: Denormalized organization name (from organizations table)
|
|
28
|
+
|
|
29
|
+
- name: title
|
|
30
|
+
sql: title
|
|
31
|
+
type: string
|
|
32
|
+
description: Short description / title of the incident
|
|
33
|
+
|
|
34
|
+
- name: description
|
|
35
|
+
sql: description
|
|
36
|
+
type: string
|
|
37
|
+
description: Detailed description of the incident
|
|
38
|
+
|
|
39
|
+
- name: severity
|
|
40
|
+
sql: severity
|
|
41
|
+
type: string
|
|
42
|
+
description: Incident severity level
|
|
43
|
+
sample_values: [critical, high, medium, low]
|
|
44
|
+
|
|
45
|
+
- name: status
|
|
46
|
+
sql: status
|
|
47
|
+
type: string
|
|
48
|
+
description: |
|
|
49
|
+
Incident lifecycle status. Progresses through: open → investigating →
|
|
50
|
+
contained → resolved → closed. Not all incidents pass through every stage.
|
|
51
|
+
sample_values: [open, investigating, contained, resolved, closed]
|
|
52
|
+
|
|
53
|
+
- name: assigned_to
|
|
54
|
+
sql: assigned_to
|
|
55
|
+
type: number
|
|
56
|
+
description: Foreign key to users — who is assigned to handle this incident (may be NULL)
|
|
57
|
+
|
|
58
|
+
- name: created_at
|
|
59
|
+
sql: created_at
|
|
60
|
+
type: timestamp
|
|
61
|
+
description: When the incident was created / reported
|
|
62
|
+
|
|
63
|
+
- name: updated_at
|
|
64
|
+
sql: updated_at
|
|
65
|
+
type: timestamp
|
|
66
|
+
description: Last time the incident record was modified
|
|
67
|
+
|
|
68
|
+
- name: resolved_at
|
|
69
|
+
sql: resolved_at
|
|
70
|
+
type: timestamp
|
|
71
|
+
description: When the incident was resolved (NULL if still open)
|
|
72
|
+
|
|
73
|
+
- name: severity_rank
|
|
74
|
+
sql: |-
|
|
75
|
+
CASE severity
|
|
76
|
+
WHEN 'critical' THEN 1
|
|
77
|
+
WHEN 'high' THEN 2
|
|
78
|
+
WHEN 'medium' THEN 3
|
|
79
|
+
WHEN 'low' THEN 4
|
|
80
|
+
ELSE 5
|
|
81
|
+
END
|
|
82
|
+
type: number
|
|
83
|
+
description: Numeric severity rank for sorting (1 = most severe)
|
|
84
|
+
virtual: true
|
|
85
|
+
|
|
86
|
+
- name: is_open
|
|
87
|
+
sql: CASE WHEN status NOT IN ('resolved', 'closed') THEN true ELSE false END
|
|
88
|
+
type: boolean
|
|
89
|
+
description: Whether the incident is still open (not resolved or closed)
|
|
90
|
+
virtual: true
|
|
91
|
+
|
|
92
|
+
- name: is_resolved
|
|
93
|
+
sql: CASE WHEN status IN ('resolved', 'closed') THEN true ELSE false END
|
|
94
|
+
type: boolean
|
|
95
|
+
description: Whether the incident has been resolved or closed
|
|
96
|
+
virtual: true
|
|
97
|
+
|
|
98
|
+
- name: resolution_hours
|
|
99
|
+
sql: |-
|
|
100
|
+
CASE
|
|
101
|
+
WHEN resolved_at IS NOT NULL
|
|
102
|
+
THEN EXTRACT(EPOCH FROM (resolved_at - created_at)) / 3600.0
|
|
103
|
+
END
|
|
104
|
+
type: number
|
|
105
|
+
description: Hours between creation and resolution (NULL if still open)
|
|
106
|
+
virtual: true
|
|
107
|
+
|
|
108
|
+
- name: resolution_days
|
|
109
|
+
sql: |-
|
|
110
|
+
CASE
|
|
111
|
+
WHEN resolved_at IS NOT NULL
|
|
112
|
+
THEN EXTRACT(DAY FROM (resolved_at - created_at))
|
|
113
|
+
END
|
|
114
|
+
type: number
|
|
115
|
+
description: Days between creation and resolution (NULL if still open)
|
|
116
|
+
virtual: true
|
|
117
|
+
|
|
118
|
+
- name: created_date
|
|
119
|
+
sql: created_at::DATE
|
|
120
|
+
type: date
|
|
121
|
+
description: Date the incident was created (for daily grouping)
|
|
122
|
+
virtual: true
|
|
123
|
+
|
|
124
|
+
- name: created_month
|
|
125
|
+
sql: TO_CHAR(created_at, 'YYYY-MM')
|
|
126
|
+
type: string
|
|
127
|
+
description: Year-month the incident was created
|
|
128
|
+
virtual: true
|
|
129
|
+
|
|
130
|
+
- name: age_days
|
|
131
|
+
sql: |-
|
|
132
|
+
CASE
|
|
133
|
+
WHEN resolved_at IS NULL
|
|
134
|
+
THEN EXTRACT(DAY FROM (CURRENT_TIMESTAMP - created_at))
|
|
135
|
+
ELSE EXTRACT(DAY FROM (resolved_at - created_at))
|
|
136
|
+
END
|
|
137
|
+
type: number
|
|
138
|
+
description: Age in days — time to resolve (if resolved) or time since creation (if open)
|
|
139
|
+
virtual: true
|
|
140
|
+
|
|
141
|
+
- name: is_assigned
|
|
142
|
+
sql: CASE WHEN assigned_to IS NOT NULL THEN true ELSE false END
|
|
143
|
+
type: boolean
|
|
144
|
+
description: Whether the incident has been assigned to someone
|
|
145
|
+
virtual: true
|
|
146
|
+
|
|
147
|
+
measures:
|
|
148
|
+
- name: incident_count
|
|
149
|
+
sql: id
|
|
150
|
+
type: count_distinct
|
|
151
|
+
description: Number of unique incidents
|
|
152
|
+
|
|
153
|
+
- name: open_incident_count
|
|
154
|
+
sql: CASE WHEN status NOT IN ('resolved', 'closed') THEN id END
|
|
155
|
+
type: count_distinct
|
|
156
|
+
description: Number of currently open incidents
|
|
157
|
+
|
|
158
|
+
- name: avg_resolution_hours
|
|
159
|
+
sql: CASE WHEN resolved_at IS NOT NULL THEN EXTRACT(EPOCH FROM (resolved_at - created_at)) / 3600.0 END
|
|
160
|
+
type: avg
|
|
161
|
+
description: Average hours to resolve an incident (MTTR)
|
|
162
|
+
|
|
163
|
+
joins:
|
|
164
|
+
- target_entity: Organizations
|
|
165
|
+
relationship: many_to_one
|
|
166
|
+
join_columns:
|
|
167
|
+
from: organization_id
|
|
168
|
+
to: id
|
|
169
|
+
description: Each incident belongs to one organization
|
|
170
|
+
|
|
171
|
+
- target_entity: Users
|
|
172
|
+
relationship: many_to_one
|
|
173
|
+
join_columns:
|
|
174
|
+
from: assigned_to
|
|
175
|
+
to: id
|
|
176
|
+
description: Each incident may be assigned to one user
|
|
177
|
+
|
|
178
|
+
use_cases:
|
|
179
|
+
- Incident volume and severity trending over time
|
|
180
|
+
- Mean time to resolve (MTTR) analysis by severity
|
|
181
|
+
- Assignment workload and unassigned incident tracking
|
|
182
|
+
- Organization-level incident comparison
|
|
183
|
+
- Incident status pipeline analysis (open → investigating → resolved)
|
|
184
|
+
|
|
185
|
+
query_patterns:
|
|
186
|
+
- name: incidents_by_severity
|
|
187
|
+
description: Incident count and MTTR by severity
|
|
188
|
+
sql: |-
|
|
189
|
+
SELECT severity,
|
|
190
|
+
COUNT(*) AS incident_count,
|
|
191
|
+
COUNT(*) FILTER (WHERE status NOT IN ('resolved', 'closed')) AS open_count,
|
|
192
|
+
AVG(EXTRACT(EPOCH FROM (resolved_at - created_at)) / 3600.0)
|
|
193
|
+
FILTER (WHERE resolved_at IS NOT NULL) AS avg_mttr_hours
|
|
194
|
+
FROM incidents
|
|
195
|
+
GROUP BY severity
|
|
196
|
+
ORDER BY MIN(CASE severity
|
|
197
|
+
WHEN 'critical' THEN 1 WHEN 'high' THEN 2
|
|
198
|
+
WHEN 'medium' THEN 3 WHEN 'low' THEN 4 ELSE 5 END)
|
|
199
|
+
|
|
200
|
+
- name: incidents_by_org
|
|
201
|
+
description: Incident volume per organization
|
|
202
|
+
sql: |-
|
|
203
|
+
SELECT organization_name,
|
|
204
|
+
COUNT(*) AS total_incidents,
|
|
205
|
+
COUNT(*) FILTER (WHERE severity = 'critical') AS critical_count,
|
|
206
|
+
COUNT(*) FILTER (WHERE status NOT IN ('resolved', 'closed')) AS open_count
|
|
207
|
+
FROM incidents
|
|
208
|
+
GROUP BY organization_name
|
|
209
|
+
ORDER BY total_incidents DESC
|
|
210
|
+
|
|
211
|
+
- name: incident_trend
|
|
212
|
+
description: Monthly incident trend
|
|
213
|
+
sql: |-
|
|
214
|
+
SELECT TO_CHAR(created_at, 'YYYY-MM') AS month,
|
|
215
|
+
COUNT(*) AS incident_count,
|
|
216
|
+
COUNT(*) FILTER (WHERE severity IN ('critical', 'high')) AS high_sev_count
|
|
217
|
+
FROM incidents
|
|
218
|
+
GROUP BY month
|
|
219
|
+
ORDER BY month
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
name: Organizations
|
|
2
|
+
type: dimension_table
|
|
3
|
+
table: organizations
|
|
4
|
+
grain: one row per customer organization
|
|
5
|
+
description: |
|
|
6
|
+
Customer organizations using the Sentinel Security platform. Contains
|
|
7
|
+
firmographic data including industry vertical, company size tier, country,
|
|
8
|
+
domain, and active status. Each organization can have multiple users, assets,
|
|
9
|
+
subscriptions, scans, incidents, and compliance assessments. This is the
|
|
10
|
+
central dimension table for customer-level analysis and security posture
|
|
11
|
+
comparison.
|
|
12
|
+
|
|
13
|
+
dimensions:
|
|
14
|
+
- name: id
|
|
15
|
+
sql: id
|
|
16
|
+
type: number
|
|
17
|
+
description: Primary key — unique organization identifier
|
|
18
|
+
primary_key: true
|
|
19
|
+
|
|
20
|
+
- name: name
|
|
21
|
+
sql: name
|
|
22
|
+
type: string
|
|
23
|
+
description: Organization name
|
|
24
|
+
sample_values: [Acme Industries, NovaTech Solutions, GlobalBank Corp, HealthFirst Inc]
|
|
25
|
+
|
|
26
|
+
- name: industry
|
|
27
|
+
sql: industry
|
|
28
|
+
type: string
|
|
29
|
+
description: Business sector / vertical
|
|
30
|
+
sample_values: [Technology, Finance, Healthcare, Manufacturing, Retail, Energy, Government, Education]
|
|
31
|
+
|
|
32
|
+
- name: size_tier
|
|
33
|
+
sql: size_tier
|
|
34
|
+
type: string
|
|
35
|
+
description: Organization size classification based on employee count
|
|
36
|
+
sample_values: [small, medium, large, enterprise]
|
|
37
|
+
|
|
38
|
+
- name: domain
|
|
39
|
+
sql: domain
|
|
40
|
+
type: string
|
|
41
|
+
description: Primary domain name of the organization
|
|
42
|
+
|
|
43
|
+
- name: country
|
|
44
|
+
sql: country
|
|
45
|
+
type: string
|
|
46
|
+
description: Country where the organization is headquartered
|
|
47
|
+
sample_values: [US, UK, DE, CA, AU, JP, SG, FR, BR, IN]
|
|
48
|
+
|
|
49
|
+
- name: created_at
|
|
50
|
+
sql: created_at
|
|
51
|
+
type: timestamp
|
|
52
|
+
description: When the organization was onboarded to the platform
|
|
53
|
+
|
|
54
|
+
- name: updated_at
|
|
55
|
+
sql: updated_at
|
|
56
|
+
type: timestamp
|
|
57
|
+
description: Last time the organization record was modified
|
|
58
|
+
|
|
59
|
+
- name: is_active
|
|
60
|
+
sql: is_active
|
|
61
|
+
type: boolean
|
|
62
|
+
description: Whether the organization is currently active on the platform
|
|
63
|
+
|
|
64
|
+
- name: created_year
|
|
65
|
+
sql: EXTRACT(YEAR FROM created_at)
|
|
66
|
+
type: number
|
|
67
|
+
description: Year the organization was onboarded — useful for cohort analysis
|
|
68
|
+
virtual: true
|
|
69
|
+
|
|
70
|
+
- name: created_month
|
|
71
|
+
sql: TO_CHAR(created_at, 'YYYY-MM')
|
|
72
|
+
type: string
|
|
73
|
+
description: Year-month the organization was onboarded
|
|
74
|
+
virtual: true
|
|
75
|
+
|
|
76
|
+
- name: size_category
|
|
77
|
+
sql: |-
|
|
78
|
+
CASE
|
|
79
|
+
WHEN size_tier IN ('small', 'medium') THEN 'SMB'
|
|
80
|
+
WHEN size_tier = 'large' THEN 'Mid-Market'
|
|
81
|
+
WHEN size_tier = 'enterprise' THEN 'Enterprise'
|
|
82
|
+
ELSE 'Unknown'
|
|
83
|
+
END
|
|
84
|
+
type: string
|
|
85
|
+
description: Simplified size grouping for segmentation (SMB / Mid-Market / Enterprise)
|
|
86
|
+
virtual: true
|
|
87
|
+
sample_values: [SMB, Mid-Market, Enterprise]
|
|
88
|
+
|
|
89
|
+
measures:
|
|
90
|
+
- name: org_count
|
|
91
|
+
sql: id
|
|
92
|
+
type: count_distinct
|
|
93
|
+
description: Number of unique organizations
|
|
94
|
+
|
|
95
|
+
- name: active_org_count
|
|
96
|
+
sql: CASE WHEN is_active THEN id END
|
|
97
|
+
type: count_distinct
|
|
98
|
+
description: Number of active organizations
|
|
99
|
+
|
|
100
|
+
use_cases:
|
|
101
|
+
- Customer segmentation by industry, size tier, and geography
|
|
102
|
+
- Organization-level security posture comparison
|
|
103
|
+
- Customer onboarding cohort analysis
|
|
104
|
+
- Active vs inactive customer analysis
|
|
105
|
+
- Join to subscriptions for revenue-per-organization analysis
|
|
106
|
+
|
|
107
|
+
query_patterns:
|
|
108
|
+
- name: orgs_by_industry
|
|
109
|
+
description: Customer count by industry vertical
|
|
110
|
+
sql: |-
|
|
111
|
+
SELECT industry,
|
|
112
|
+
COUNT(*) AS org_count,
|
|
113
|
+
COUNT(*) FILTER (WHERE is_active) AS active_count
|
|
114
|
+
FROM organizations
|
|
115
|
+
GROUP BY industry
|
|
116
|
+
ORDER BY org_count DESC
|
|
117
|
+
|
|
118
|
+
- name: orgs_by_size_tier
|
|
119
|
+
description: Organization distribution by size tier
|
|
120
|
+
sql: |-
|
|
121
|
+
SELECT size_tier,
|
|
122
|
+
COUNT(*) AS org_count,
|
|
123
|
+
COUNT(*) FILTER (WHERE is_active) AS active_count
|
|
124
|
+
FROM organizations
|
|
125
|
+
GROUP BY size_tier
|
|
126
|
+
ORDER BY org_count DESC
|
|
127
|
+
|
|
128
|
+
- name: orgs_by_country
|
|
129
|
+
description: Customer distribution by country
|
|
130
|
+
sql: |-
|
|
131
|
+
SELECT country,
|
|
132
|
+
COUNT(*) AS org_count
|
|
133
|
+
FROM organizations
|
|
134
|
+
WHERE is_active = true
|
|
135
|
+
GROUP BY country
|
|
136
|
+
ORDER BY org_count DESC
|