@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,207 @@
|
|
|
1
|
+
terms:
|
|
2
|
+
CVSS:
|
|
3
|
+
status: defined
|
|
4
|
+
definition: >
|
|
5
|
+
Common Vulnerability Scoring System. A numeric score (0.0–10.0) rating
|
|
6
|
+
the severity of a vulnerability. Stored in vulnerabilities.cvss_score.
|
|
7
|
+
Note: ~30% of vulnerabilities have NULL cvss_score — use COALESCE or
|
|
8
|
+
filter NULLs when aggregating.
|
|
9
|
+
tables:
|
|
10
|
+
- vulnerabilities
|
|
11
|
+
|
|
12
|
+
CVE:
|
|
13
|
+
status: defined
|
|
14
|
+
definition: >
|
|
15
|
+
Common Vulnerabilities and Exposures. A unique identifier for a known
|
|
16
|
+
security vulnerability (e.g. CVE-2024-1234). Stored in vulnerabilities.cve_id.
|
|
17
|
+
tables:
|
|
18
|
+
- vulnerabilities
|
|
19
|
+
|
|
20
|
+
severity:
|
|
21
|
+
status: ambiguous
|
|
22
|
+
note: >
|
|
23
|
+
"severity" appears on vulnerabilities, incidents, and alerts. ASK the
|
|
24
|
+
user which entity they mean. Vulnerability severity is a text enum
|
|
25
|
+
(critical/high/medium/low/info). Incident severity is similar but
|
|
26
|
+
independent. Alert severity can be NULL.
|
|
27
|
+
possible_mappings:
|
|
28
|
+
- vulnerabilities.severity
|
|
29
|
+
- incidents.severity
|
|
30
|
+
- alerts.severity
|
|
31
|
+
|
|
32
|
+
MTTR:
|
|
33
|
+
status: defined
|
|
34
|
+
definition: >
|
|
35
|
+
Mean Time To Remediate (or Resolve). For scan results, calculated as
|
|
36
|
+
AVG(resolved_at - found_at) where resolved_at IS NOT NULL. For incidents,
|
|
37
|
+
calculated as AVG(resolved_at - created_at) where resolved_at IS NOT NULL.
|
|
38
|
+
Always specify which entity when discussing MTTR.
|
|
39
|
+
tables:
|
|
40
|
+
- scan_results
|
|
41
|
+
- incidents
|
|
42
|
+
|
|
43
|
+
MRR:
|
|
44
|
+
status: defined
|
|
45
|
+
definition: >
|
|
46
|
+
Monthly Recurring Revenue. The sum of mrr_cents across all active
|
|
47
|
+
subscriptions, divided by 100 for dollars. Use subscriptions.mrr_cents
|
|
48
|
+
and filter by status = 'active' for current MRR.
|
|
49
|
+
tables:
|
|
50
|
+
- subscriptions
|
|
51
|
+
|
|
52
|
+
ARR:
|
|
53
|
+
status: defined
|
|
54
|
+
definition: >
|
|
55
|
+
Annual Recurring Revenue. MRR * 12. Not stored directly — calculate
|
|
56
|
+
from subscriptions.mrr_cents.
|
|
57
|
+
tables:
|
|
58
|
+
- subscriptions
|
|
59
|
+
|
|
60
|
+
churn:
|
|
61
|
+
status: defined
|
|
62
|
+
definition: >
|
|
63
|
+
A subscription with status = 'canceled' or 'past_due' that has not
|
|
64
|
+
recovered. Churned subscriptions typically have mrr_cents = 0 or are
|
|
65
|
+
approaching zero. Analyze using subscription_events for transition history.
|
|
66
|
+
tables:
|
|
67
|
+
- subscriptions
|
|
68
|
+
|
|
69
|
+
SLA:
|
|
70
|
+
status: defined
|
|
71
|
+
definition: >
|
|
72
|
+
Service Level Agreement. In this context, refers to remediation SLA —
|
|
73
|
+
the expected time to complete a remediation action based on priority.
|
|
74
|
+
Track via remediation_actions.due_date vs completed_at.
|
|
75
|
+
tables:
|
|
76
|
+
- remediation_actions
|
|
77
|
+
|
|
78
|
+
IOC:
|
|
79
|
+
status: defined
|
|
80
|
+
definition: >
|
|
81
|
+
Indicator of Compromise. Observable artifacts (IP addresses, file hashes,
|
|
82
|
+
domains, URLs) that indicate a system may have been compromised. Stored
|
|
83
|
+
in indicators_of_compromise with type and value fields.
|
|
84
|
+
tables:
|
|
85
|
+
- indicators_of_compromise
|
|
86
|
+
|
|
87
|
+
risk_level:
|
|
88
|
+
status: defined
|
|
89
|
+
definition: >
|
|
90
|
+
A numeric score (1–10) assigned to scan results indicating the risk
|
|
91
|
+
a specific finding poses. Higher = more critical. Stored in
|
|
92
|
+
scan_results.risk_level. Distinct from CVSS (which rates the
|
|
93
|
+
vulnerability itself) — risk_level accounts for asset context.
|
|
94
|
+
tables:
|
|
95
|
+
- scan_results
|
|
96
|
+
|
|
97
|
+
status:
|
|
98
|
+
status: ambiguous
|
|
99
|
+
note: >
|
|
100
|
+
"status" appears on many entities with different meanings. ASK for
|
|
101
|
+
context. Common uses: subscriptions (active/canceled/past_due/trialing),
|
|
102
|
+
scans (pending/running/completed/failed), scan_results (open/resolved/
|
|
103
|
+
false_positive), incidents (open/investigating/contained/resolved/closed),
|
|
104
|
+
remediation_actions (open/in_progress/completed/deferred).
|
|
105
|
+
possible_mappings:
|
|
106
|
+
- subscriptions.status
|
|
107
|
+
- scans.status
|
|
108
|
+
- scan_results.status
|
|
109
|
+
- incidents.status
|
|
110
|
+
- remediation_actions.status
|
|
111
|
+
- alerts.status
|
|
112
|
+
- compliance_assessments.status
|
|
113
|
+
|
|
114
|
+
asset:
|
|
115
|
+
status: defined
|
|
116
|
+
definition: >
|
|
117
|
+
An IT resource monitored by Sentinel Security — servers, workstations,
|
|
118
|
+
network devices, containers, or cloud instances. Each asset belongs to
|
|
119
|
+
one organization and has a type, OS, environment, and activity timestamps.
|
|
120
|
+
tables:
|
|
121
|
+
- assets
|
|
122
|
+
|
|
123
|
+
finding:
|
|
124
|
+
status: defined
|
|
125
|
+
definition: >
|
|
126
|
+
A specific vulnerability detected on a specific asset during a scan.
|
|
127
|
+
Stored in scan_results. Each finding has a risk_level, status, and
|
|
128
|
+
timestamps for discovery (found_at) and resolution (resolved_at).
|
|
129
|
+
tables:
|
|
130
|
+
- scan_results
|
|
131
|
+
|
|
132
|
+
scan:
|
|
133
|
+
status: defined
|
|
134
|
+
definition: >
|
|
135
|
+
A vulnerability scan execution. Can be full, incremental, or compliance
|
|
136
|
+
type. Runs against an organization's assets and produces scan_results
|
|
137
|
+
(findings). Track coverage via assets_scanned and findings_count.
|
|
138
|
+
tables:
|
|
139
|
+
- scans
|
|
140
|
+
|
|
141
|
+
incident:
|
|
142
|
+
status: defined
|
|
143
|
+
definition: >
|
|
144
|
+
A security incident requiring investigation and response. Has severity
|
|
145
|
+
(critical/high/medium/low), status lifecycle (open → investigating →
|
|
146
|
+
contained → resolved → closed), and optional assignment to a user.
|
|
147
|
+
tables:
|
|
148
|
+
- incidents
|
|
149
|
+
|
|
150
|
+
remediation:
|
|
151
|
+
status: defined
|
|
152
|
+
definition: >
|
|
153
|
+
The process of fixing a vulnerability finding. Tracked via
|
|
154
|
+
remediation_actions with priority (critical/high/medium/low),
|
|
155
|
+
assignment, due date, and completion date. Links to vulnerability_instances.
|
|
156
|
+
tables:
|
|
157
|
+
- remediation_actions
|
|
158
|
+
|
|
159
|
+
compliance_framework:
|
|
160
|
+
status: defined
|
|
161
|
+
definition: >
|
|
162
|
+
A regulatory or industry standard (SOC 2, ISO 27001, HIPAA, PCI DSS,
|
|
163
|
+
NIST CSF, GDPR, CIS Benchmarks). Organizations are assessed against
|
|
164
|
+
frameworks via compliance_assessments which produce a score.
|
|
165
|
+
tables:
|
|
166
|
+
- compliance_frameworks
|
|
167
|
+
- compliance_assessments
|
|
168
|
+
|
|
169
|
+
environment:
|
|
170
|
+
status: defined
|
|
171
|
+
definition: >
|
|
172
|
+
The deployment environment of an asset. Values: production, staging,
|
|
173
|
+
development. Use assets.environment to filter or segment analysis.
|
|
174
|
+
Production assets typically receive higher priority for remediation.
|
|
175
|
+
tables:
|
|
176
|
+
- assets
|
|
177
|
+
|
|
178
|
+
name:
|
|
179
|
+
status: ambiguous
|
|
180
|
+
note: >
|
|
181
|
+
"name" appears in many entities — organizations.name, users.full_name,
|
|
182
|
+
plans.name, vulnerabilities.title, incidents.title. ASK the user
|
|
183
|
+
which entity they mean.
|
|
184
|
+
possible_mappings:
|
|
185
|
+
- organizations.name
|
|
186
|
+
- users.full_name
|
|
187
|
+
- plans.name
|
|
188
|
+
- plans.display_name
|
|
189
|
+
|
|
190
|
+
plan:
|
|
191
|
+
status: defined
|
|
192
|
+
definition: >
|
|
193
|
+
Subscription tier. Plans include starter, professional, enterprise,
|
|
194
|
+
and custom tiers with varying asset limits, user limits, and features.
|
|
195
|
+
Pricing stored in plans.price_cents.
|
|
196
|
+
tables:
|
|
197
|
+
- plans
|
|
198
|
+
- subscriptions
|
|
199
|
+
|
|
200
|
+
size_tier:
|
|
201
|
+
status: defined
|
|
202
|
+
definition: >
|
|
203
|
+
Organization size classification. Values typically: small, medium,
|
|
204
|
+
large, enterprise. Stored in organizations.size_tier. Determines
|
|
205
|
+
expected asset counts and appropriate plan recommendations.
|
|
206
|
+
tables:
|
|
207
|
+
- organizations
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
metrics:
|
|
2
|
+
- id: total_mrr
|
|
3
|
+
label: Total MRR
|
|
4
|
+
description: Total Monthly Recurring Revenue across all active subscriptions (in dollars).
|
|
5
|
+
type: atomic
|
|
6
|
+
unit: USD
|
|
7
|
+
source:
|
|
8
|
+
entity: Subscriptions
|
|
9
|
+
measure: total_mrr_cents
|
|
10
|
+
sql: |-
|
|
11
|
+
SELECT SUM(mrr_cents) / 100.0 AS total_mrr_dollars
|
|
12
|
+
FROM subscriptions
|
|
13
|
+
WHERE status = 'active'
|
|
14
|
+
aggregation: sum
|
|
15
|
+
objective: maximize
|
|
16
|
+
|
|
17
|
+
- id: total_arr
|
|
18
|
+
label: Total ARR
|
|
19
|
+
description: Annual Recurring Revenue — MRR * 12. Calculated from active subscriptions.
|
|
20
|
+
type: derived
|
|
21
|
+
unit: USD
|
|
22
|
+
sql: |-
|
|
23
|
+
SELECT SUM(mrr_cents) / 100.0 * 12 AS total_arr_dollars
|
|
24
|
+
FROM subscriptions
|
|
25
|
+
WHERE status = 'active'
|
|
26
|
+
aggregation: sum
|
|
27
|
+
objective: maximize
|
|
28
|
+
|
|
29
|
+
- id: active_customers
|
|
30
|
+
label: Active Customers
|
|
31
|
+
description: Number of active organizations on the platform.
|
|
32
|
+
type: atomic
|
|
33
|
+
source:
|
|
34
|
+
entity: Organizations
|
|
35
|
+
measure: active_org_count
|
|
36
|
+
sql: |-
|
|
37
|
+
SELECT COUNT(*) AS active_customers
|
|
38
|
+
FROM organizations
|
|
39
|
+
WHERE is_active = true
|
|
40
|
+
aggregation: count
|
|
41
|
+
objective: maximize
|
|
42
|
+
|
|
43
|
+
- id: active_subscriptions
|
|
44
|
+
label: Active Subscriptions
|
|
45
|
+
description: Number of subscriptions with status 'active'.
|
|
46
|
+
type: atomic
|
|
47
|
+
sql: |-
|
|
48
|
+
SELECT COUNT(*) AS active_subscriptions
|
|
49
|
+
FROM subscriptions
|
|
50
|
+
WHERE status = 'active'
|
|
51
|
+
aggregation: count
|
|
52
|
+
|
|
53
|
+
- id: arpa
|
|
54
|
+
label: ARPA (Avg Revenue Per Account)
|
|
55
|
+
description: Average MRR per active subscription (in dollars).
|
|
56
|
+
type: derived
|
|
57
|
+
unit: USD
|
|
58
|
+
sql: |-
|
|
59
|
+
SELECT AVG(mrr_cents) / 100.0 AS arpa_dollars
|
|
60
|
+
FROM subscriptions
|
|
61
|
+
WHERE status = 'active'
|
|
62
|
+
aggregation: avg
|
|
63
|
+
|
|
64
|
+
- id: churn_rate
|
|
65
|
+
label: Churn Rate
|
|
66
|
+
description: Percentage of all subscriptions that have been canceled.
|
|
67
|
+
type: derived
|
|
68
|
+
unit: percent
|
|
69
|
+
sql: |-
|
|
70
|
+
SELECT ROUND(100.0 * COUNT(*) FILTER (WHERE status = 'canceled') / COUNT(*), 1) AS churn_rate
|
|
71
|
+
FROM subscriptions
|
|
72
|
+
aggregation: ratio
|
|
73
|
+
objective: minimize
|
|
74
|
+
|
|
75
|
+
- id: mrr_by_plan
|
|
76
|
+
label: MRR by Plan
|
|
77
|
+
description: MRR breakdown by subscription plan tier.
|
|
78
|
+
type: breakdown
|
|
79
|
+
unit: USD
|
|
80
|
+
sql: |-
|
|
81
|
+
SELECT plan_name,
|
|
82
|
+
SUM(mrr_cents) / 100.0 AS total_mrr_dollars,
|
|
83
|
+
COUNT(*) AS subscription_count,
|
|
84
|
+
AVG(mrr_cents) / 100.0 AS avg_mrr_dollars
|
|
85
|
+
FROM subscriptions
|
|
86
|
+
WHERE status = 'active'
|
|
87
|
+
GROUP BY plan_name
|
|
88
|
+
ORDER BY total_mrr_dollars DESC
|
|
89
|
+
|
|
90
|
+
- id: churn_by_plan
|
|
91
|
+
label: Churn Rate by Plan
|
|
92
|
+
description: Churn rate broken down by plan tier.
|
|
93
|
+
type: breakdown
|
|
94
|
+
unit: percent
|
|
95
|
+
sql: |-
|
|
96
|
+
SELECT plan_name,
|
|
97
|
+
COUNT(*) FILTER (WHERE status = 'canceled') AS churned,
|
|
98
|
+
COUNT(*) AS total,
|
|
99
|
+
ROUND(100.0 * COUNT(*) FILTER (WHERE status = 'canceled') / COUNT(*), 1) AS churn_pct
|
|
100
|
+
FROM subscriptions
|
|
101
|
+
GROUP BY plan_name
|
|
102
|
+
ORDER BY churn_pct DESC
|
|
103
|
+
objective: minimize
|
|
104
|
+
|
|
105
|
+
- id: mrr_by_industry
|
|
106
|
+
label: MRR by Industry
|
|
107
|
+
description: MRR breakdown by customer industry vertical.
|
|
108
|
+
type: breakdown
|
|
109
|
+
unit: USD
|
|
110
|
+
sql: |-
|
|
111
|
+
SELECT o.industry,
|
|
112
|
+
SUM(s.mrr_cents) / 100.0 AS total_mrr_dollars,
|
|
113
|
+
COUNT(DISTINCT o.id) AS org_count
|
|
114
|
+
FROM subscriptions s
|
|
115
|
+
JOIN organizations o ON s.organization_id = o.id
|
|
116
|
+
WHERE s.status = 'active'
|
|
117
|
+
GROUP BY o.industry
|
|
118
|
+
ORDER BY total_mrr_dollars DESC
|
|
119
|
+
|
|
120
|
+
- id: mrr_by_size_tier
|
|
121
|
+
label: MRR by Organization Size
|
|
122
|
+
description: MRR breakdown by organization size tier.
|
|
123
|
+
type: breakdown
|
|
124
|
+
unit: USD
|
|
125
|
+
sql: |-
|
|
126
|
+
SELECT o.size_tier,
|
|
127
|
+
SUM(s.mrr_cents) / 100.0 AS total_mrr_dollars,
|
|
128
|
+
COUNT(DISTINCT o.id) AS org_count,
|
|
129
|
+
AVG(s.mrr_cents) / 100.0 AS avg_mrr_dollars
|
|
130
|
+
FROM subscriptions s
|
|
131
|
+
JOIN organizations o ON s.organization_id = o.id
|
|
132
|
+
WHERE s.status = 'active'
|
|
133
|
+
GROUP BY o.size_tier
|
|
134
|
+
ORDER BY total_mrr_dollars DESC
|
|
135
|
+
|
|
136
|
+
- id: subscription_cohort
|
|
137
|
+
label: Subscription Cohort Analysis
|
|
138
|
+
description: MRR and subscription count by cohort (start year-month).
|
|
139
|
+
type: breakdown
|
|
140
|
+
unit: USD
|
|
141
|
+
sql: |-
|
|
142
|
+
SELECT TO_CHAR(started_at, 'YYYY-MM') AS cohort_month,
|
|
143
|
+
COUNT(*) AS subscriptions,
|
|
144
|
+
SUM(mrr_cents) / 100.0 AS total_mrr_dollars,
|
|
145
|
+
COUNT(*) FILTER (WHERE status = 'canceled') AS churned
|
|
146
|
+
FROM subscriptions
|
|
147
|
+
GROUP BY cohort_month
|
|
148
|
+
ORDER BY cohort_month
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
metrics:
|
|
2
|
+
- id: avg_compliance_score
|
|
3
|
+
label: Average Compliance Score
|
|
4
|
+
description: Average compliance assessment score across all completed assessments.
|
|
5
|
+
type: atomic
|
|
6
|
+
source:
|
|
7
|
+
entity: Compliance Assessments
|
|
8
|
+
measure: avg_score
|
|
9
|
+
sql: |-
|
|
10
|
+
SELECT AVG(score) AS avg_compliance_score
|
|
11
|
+
FROM compliance_assessments
|
|
12
|
+
WHERE status = 'completed'
|
|
13
|
+
aggregation: avg
|
|
14
|
+
objective: maximize
|
|
15
|
+
|
|
16
|
+
- id: compliance_pass_rate
|
|
17
|
+
label: Compliance Pass Rate
|
|
18
|
+
description: >
|
|
19
|
+
Percentage of completed assessments that scored 70 or above (passing threshold).
|
|
20
|
+
type: derived
|
|
21
|
+
unit: percent
|
|
22
|
+
sql: |-
|
|
23
|
+
SELECT ROUND(100.0 * COUNT(*) FILTER (WHERE score >= 70) / COUNT(*), 1) AS pass_rate
|
|
24
|
+
FROM compliance_assessments
|
|
25
|
+
WHERE status = 'completed'
|
|
26
|
+
aggregation: ratio
|
|
27
|
+
objective: maximize
|
|
28
|
+
|
|
29
|
+
- id: assessments_completed
|
|
30
|
+
label: Assessments Completed
|
|
31
|
+
description: Total number of completed compliance assessments.
|
|
32
|
+
type: atomic
|
|
33
|
+
source:
|
|
34
|
+
entity: Compliance Assessments
|
|
35
|
+
measure: completed_count
|
|
36
|
+
sql: |-
|
|
37
|
+
SELECT COUNT(*) AS assessments_completed
|
|
38
|
+
FROM compliance_assessments
|
|
39
|
+
WHERE status = 'completed'
|
|
40
|
+
aggregation: count
|
|
41
|
+
|
|
42
|
+
- id: avg_score_by_framework
|
|
43
|
+
label: Avg Score by Framework
|
|
44
|
+
description: Average compliance score broken down by regulatory framework.
|
|
45
|
+
type: breakdown
|
|
46
|
+
sql: |-
|
|
47
|
+
SELECT cf.name AS framework,
|
|
48
|
+
COUNT(ca.id) AS assessment_count,
|
|
49
|
+
AVG(ca.score) AS avg_score,
|
|
50
|
+
MIN(ca.score) AS min_score,
|
|
51
|
+
MAX(ca.score) AS max_score,
|
|
52
|
+
ROUND(100.0 * COUNT(*) FILTER (WHERE ca.score >= 70) / COUNT(*), 1) AS pass_rate
|
|
53
|
+
FROM compliance_assessments ca
|
|
54
|
+
JOIN compliance_frameworks cf ON ca.framework_id = cf.id
|
|
55
|
+
WHERE ca.status = 'completed'
|
|
56
|
+
GROUP BY cf.name
|
|
57
|
+
ORDER BY avg_score DESC
|
|
58
|
+
objective: maximize
|
|
59
|
+
|
|
60
|
+
- id: framework_coverage
|
|
61
|
+
label: Framework Coverage
|
|
62
|
+
description: >
|
|
63
|
+
Number of organizations that have been assessed against each framework,
|
|
64
|
+
and what percentage of all active organizations that represents.
|
|
65
|
+
type: breakdown
|
|
66
|
+
sql: |-
|
|
67
|
+
SELECT cf.name AS framework,
|
|
68
|
+
COUNT(DISTINCT ca.organization_id) AS orgs_assessed,
|
|
69
|
+
(SELECT COUNT(*) FROM organizations WHERE is_active = true) AS total_active_orgs,
|
|
70
|
+
ROUND(100.0 * COUNT(DISTINCT ca.organization_id) /
|
|
71
|
+
(SELECT COUNT(*) FROM organizations WHERE is_active = true), 1) AS coverage_pct
|
|
72
|
+
FROM compliance_assessments ca
|
|
73
|
+
JOIN compliance_frameworks cf ON ca.framework_id = cf.id
|
|
74
|
+
GROUP BY cf.name
|
|
75
|
+
ORDER BY orgs_assessed DESC
|
|
76
|
+
objective: maximize
|
|
77
|
+
|
|
78
|
+
- id: compliance_by_industry
|
|
79
|
+
label: Compliance Score by Industry
|
|
80
|
+
description: Average compliance score broken down by customer industry.
|
|
81
|
+
type: breakdown
|
|
82
|
+
sql: |-
|
|
83
|
+
SELECT o.industry,
|
|
84
|
+
COUNT(ca.id) AS assessment_count,
|
|
85
|
+
AVG(ca.score) AS avg_score,
|
|
86
|
+
ROUND(100.0 * COUNT(*) FILTER (WHERE ca.score >= 70) / COUNT(*), 1) AS pass_rate
|
|
87
|
+
FROM compliance_assessments ca
|
|
88
|
+
JOIN organizations o ON ca.organization_id = o.id
|
|
89
|
+
WHERE ca.status = 'completed'
|
|
90
|
+
GROUP BY o.industry
|
|
91
|
+
ORDER BY avg_score DESC
|
|
92
|
+
|
|
93
|
+
- id: compliance_by_size_tier
|
|
94
|
+
label: Compliance Score by Org Size
|
|
95
|
+
description: Average compliance score broken down by organization size tier.
|
|
96
|
+
type: breakdown
|
|
97
|
+
sql: |-
|
|
98
|
+
SELECT o.size_tier,
|
|
99
|
+
COUNT(ca.id) AS assessment_count,
|
|
100
|
+
AVG(ca.score) AS avg_score,
|
|
101
|
+
ROUND(100.0 * COUNT(*) FILTER (WHERE ca.score >= 70) / COUNT(*), 1) AS pass_rate
|
|
102
|
+
FROM compliance_assessments ca
|
|
103
|
+
JOIN organizations o ON ca.organization_id = o.id
|
|
104
|
+
WHERE ca.status = 'completed'
|
|
105
|
+
GROUP BY o.size_tier
|
|
106
|
+
ORDER BY avg_score DESC
|
|
107
|
+
|
|
108
|
+
- id: compliance_trend
|
|
109
|
+
label: Compliance Score Trend
|
|
110
|
+
description: Monthly average compliance score trend for completed assessments.
|
|
111
|
+
type: breakdown
|
|
112
|
+
sql: |-
|
|
113
|
+
SELECT TO_CHAR(completed_at, 'YYYY-MM') AS month,
|
|
114
|
+
COUNT(*) AS assessments_completed,
|
|
115
|
+
AVG(score) AS avg_score,
|
|
116
|
+
ROUND(100.0 * COUNT(*) FILTER (WHERE score >= 70) / COUNT(*), 1) AS pass_rate
|
|
117
|
+
FROM compliance_assessments
|
|
118
|
+
WHERE status = 'completed' AND completed_at IS NOT NULL
|
|
119
|
+
GROUP BY month
|
|
120
|
+
ORDER BY month
|
|
121
|
+
|
|
122
|
+
- id: low_scoring_orgs
|
|
123
|
+
label: Low-Scoring Organizations
|
|
124
|
+
description: Organizations with average compliance score below 50 — need attention.
|
|
125
|
+
type: breakdown
|
|
126
|
+
sql: |-
|
|
127
|
+
SELECT o.name AS organization,
|
|
128
|
+
o.industry,
|
|
129
|
+
o.size_tier,
|
|
130
|
+
COUNT(ca.id) AS assessment_count,
|
|
131
|
+
AVG(ca.score) AS avg_score
|
|
132
|
+
FROM compliance_assessments ca
|
|
133
|
+
JOIN organizations o ON ca.organization_id = o.id
|
|
134
|
+
WHERE ca.status = 'completed'
|
|
135
|
+
GROUP BY o.name, o.industry, o.size_tier
|
|
136
|
+
HAVING AVG(ca.score) < 50
|
|
137
|
+
ORDER BY avg_score
|
|
138
|
+
objective: minimize
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
metrics:
|
|
2
|
+
- id: open_findings
|
|
3
|
+
label: Open Findings
|
|
4
|
+
description: Total number of vulnerability findings with status 'open' across all organizations.
|
|
5
|
+
type: atomic
|
|
6
|
+
source:
|
|
7
|
+
entity: Scan Results
|
|
8
|
+
measure: open_finding_count
|
|
9
|
+
sql: |-
|
|
10
|
+
SELECT COUNT(*) AS open_findings
|
|
11
|
+
FROM scan_results
|
|
12
|
+
WHERE status = 'open'
|
|
13
|
+
aggregation: count
|
|
14
|
+
objective: minimize
|
|
15
|
+
|
|
16
|
+
- id: total_findings
|
|
17
|
+
label: Total Findings
|
|
18
|
+
description: Total number of vulnerability findings across all statuses.
|
|
19
|
+
type: atomic
|
|
20
|
+
source:
|
|
21
|
+
entity: Scan Results
|
|
22
|
+
measure: finding_count
|
|
23
|
+
sql: |-
|
|
24
|
+
SELECT COUNT(*) AS total_findings
|
|
25
|
+
FROM scan_results
|
|
26
|
+
aggregation: count
|
|
27
|
+
|
|
28
|
+
- id: finding_resolution_rate
|
|
29
|
+
label: Finding Resolution Rate
|
|
30
|
+
description: Percentage of all findings that have been resolved.
|
|
31
|
+
type: derived
|
|
32
|
+
unit: percent
|
|
33
|
+
sql: |-
|
|
34
|
+
SELECT ROUND(100.0 * COUNT(*) FILTER (WHERE status = 'resolved') / COUNT(*), 1) AS resolution_rate
|
|
35
|
+
FROM scan_results
|
|
36
|
+
aggregation: ratio
|
|
37
|
+
objective: maximize
|
|
38
|
+
|
|
39
|
+
- id: mttr_findings
|
|
40
|
+
label: MTTR (Findings)
|
|
41
|
+
description: >
|
|
42
|
+
Mean Time To Remediate for scan result findings. Average days between
|
|
43
|
+
found_at and resolved_at for resolved findings.
|
|
44
|
+
type: derived
|
|
45
|
+
unit: days
|
|
46
|
+
sql: |-
|
|
47
|
+
SELECT AVG(EXTRACT(DAY FROM (resolved_at - found_at))) AS mttr_days
|
|
48
|
+
FROM scan_results
|
|
49
|
+
WHERE resolved_at IS NOT NULL
|
|
50
|
+
aggregation: avg
|
|
51
|
+
objective: minimize
|
|
52
|
+
|
|
53
|
+
- id: mttr_findings_by_risk
|
|
54
|
+
label: MTTR by Risk Tier
|
|
55
|
+
description: Mean time to remediate broken down by risk level tier.
|
|
56
|
+
type: breakdown
|
|
57
|
+
unit: days
|
|
58
|
+
sql: |-
|
|
59
|
+
SELECT CASE
|
|
60
|
+
WHEN risk_level >= 9 THEN 'Critical (9-10)'
|
|
61
|
+
WHEN risk_level >= 7 THEN 'High (7-8)'
|
|
62
|
+
WHEN risk_level >= 4 THEN 'Medium (4-6)'
|
|
63
|
+
ELSE 'Low (1-3)'
|
|
64
|
+
END AS risk_tier,
|
|
65
|
+
COUNT(*) AS finding_count,
|
|
66
|
+
AVG(EXTRACT(DAY FROM (resolved_at - found_at))) AS mttr_days
|
|
67
|
+
FROM scan_results
|
|
68
|
+
WHERE resolved_at IS NOT NULL
|
|
69
|
+
GROUP BY risk_tier
|
|
70
|
+
ORDER BY MIN(risk_level) DESC
|
|
71
|
+
objective: minimize
|
|
72
|
+
|
|
73
|
+
- id: open_incidents
|
|
74
|
+
label: Open Incidents
|
|
75
|
+
description: Number of incidents that are not yet resolved or closed.
|
|
76
|
+
type: atomic
|
|
77
|
+
source:
|
|
78
|
+
entity: Incidents
|
|
79
|
+
measure: open_incident_count
|
|
80
|
+
sql: |-
|
|
81
|
+
SELECT COUNT(*) AS open_incidents
|
|
82
|
+
FROM incidents
|
|
83
|
+
WHERE status NOT IN ('resolved', 'closed')
|
|
84
|
+
aggregation: count
|
|
85
|
+
objective: minimize
|
|
86
|
+
|
|
87
|
+
- id: mttr_incidents
|
|
88
|
+
label: MTTR (Incidents)
|
|
89
|
+
description: >
|
|
90
|
+
Mean Time To Resolve for security incidents. Average hours between
|
|
91
|
+
created_at and resolved_at for resolved incidents.
|
|
92
|
+
type: derived
|
|
93
|
+
unit: hours
|
|
94
|
+
sql: |-
|
|
95
|
+
SELECT AVG(EXTRACT(EPOCH FROM (resolved_at - created_at)) / 3600.0) AS mttr_hours
|
|
96
|
+
FROM incidents
|
|
97
|
+
WHERE resolved_at IS NOT NULL
|
|
98
|
+
aggregation: avg
|
|
99
|
+
objective: minimize
|
|
100
|
+
|
|
101
|
+
- id: mttr_incidents_by_severity
|
|
102
|
+
label: Incident MTTR by Severity
|
|
103
|
+
description: Mean time to resolve incidents broken down by severity.
|
|
104
|
+
type: breakdown
|
|
105
|
+
unit: hours
|
|
106
|
+
sql: |-
|
|
107
|
+
SELECT severity,
|
|
108
|
+
COUNT(*) AS incident_count,
|
|
109
|
+
AVG(EXTRACT(EPOCH FROM (resolved_at - created_at)) / 3600.0) AS mttr_hours
|
|
110
|
+
FROM incidents
|
|
111
|
+
WHERE resolved_at IS NOT NULL
|
|
112
|
+
GROUP BY severity
|
|
113
|
+
ORDER BY MIN(CASE severity
|
|
114
|
+
WHEN 'critical' THEN 1 WHEN 'high' THEN 2
|
|
115
|
+
WHEN 'medium' THEN 3 WHEN 'low' THEN 4 ELSE 5 END)
|
|
116
|
+
objective: minimize
|
|
117
|
+
|
|
118
|
+
- id: alert_escalation_rate
|
|
119
|
+
label: Alert Escalation Rate
|
|
120
|
+
description: Percentage of alerts that are linked to an incident (escalated).
|
|
121
|
+
type: derived
|
|
122
|
+
unit: percent
|
|
123
|
+
sql: |-
|
|
124
|
+
SELECT ROUND(100.0 * COUNT(*) FILTER (WHERE incident_id IS NOT NULL) / COUNT(*), 1) AS escalation_rate
|
|
125
|
+
FROM alerts
|
|
126
|
+
aggregation: ratio
|
|
127
|
+
|
|
128
|
+
- id: avg_alert_ack_time
|
|
129
|
+
label: Avg Alert Acknowledgment Time
|
|
130
|
+
description: Average minutes between alert creation and first acknowledgment.
|
|
131
|
+
type: derived
|
|
132
|
+
unit: minutes
|
|
133
|
+
sql: |-
|
|
134
|
+
SELECT AVG(EXTRACT(EPOCH FROM (acknowledged_at - created_at)) / 60.0) AS avg_ack_minutes
|
|
135
|
+
FROM alerts
|
|
136
|
+
WHERE acknowledged_at IS NOT NULL
|
|
137
|
+
aggregation: avg
|
|
138
|
+
objective: minimize
|
|
139
|
+
|
|
140
|
+
- id: overdue_remediations
|
|
141
|
+
label: Overdue Remediations
|
|
142
|
+
description: Number of remediation actions past their due date that are not completed.
|
|
143
|
+
type: atomic
|
|
144
|
+
source:
|
|
145
|
+
entity: Remediation Actions
|
|
146
|
+
measure: overdue_count
|
|
147
|
+
sql: |-
|
|
148
|
+
SELECT COUNT(*) AS overdue_count
|
|
149
|
+
FROM remediation_actions
|
|
150
|
+
WHERE status NOT IN ('completed', 'deferred')
|
|
151
|
+
AND due_date < CURRENT_DATE
|
|
152
|
+
aggregation: count
|
|
153
|
+
objective: minimize
|
|
154
|
+
|
|
155
|
+
- id: remediation_completion_rate
|
|
156
|
+
label: Remediation Completion Rate
|
|
157
|
+
description: Percentage of all remediation actions that have been completed.
|
|
158
|
+
type: derived
|
|
159
|
+
unit: percent
|
|
160
|
+
sql: |-
|
|
161
|
+
SELECT ROUND(100.0 * COUNT(*) FILTER (WHERE status = 'completed') / COUNT(*), 1) AS completion_rate
|
|
162
|
+
FROM remediation_actions
|
|
163
|
+
aggregation: ratio
|
|
164
|
+
objective: maximize
|
|
165
|
+
|
|
166
|
+
- id: vulnerability_density_by_org
|
|
167
|
+
label: Vulnerability Density by Organization
|
|
168
|
+
description: Average open findings per active asset, by organization.
|
|
169
|
+
type: breakdown
|
|
170
|
+
sql: |-
|
|
171
|
+
SELECT o.name AS organization,
|
|
172
|
+
COUNT(DISTINCT a.id) AS active_assets,
|
|
173
|
+
COUNT(sr.id) FILTER (WHERE sr.status = 'open') AS open_findings,
|
|
174
|
+
ROUND(COUNT(sr.id) FILTER (WHERE sr.status = 'open')::NUMERIC /
|
|
175
|
+
NULLIF(COUNT(DISTINCT a.id), 0), 2) AS findings_per_asset
|
|
176
|
+
FROM organizations o
|
|
177
|
+
JOIN assets a ON a.organization_id = o.id AND a.is_active = true
|
|
178
|
+
LEFT JOIN scan_results sr ON sr.asset_id = a.id
|
|
179
|
+
GROUP BY o.name
|
|
180
|
+
ORDER BY findings_per_asset DESC
|
|
181
|
+
objective: minimize
|