.github/9
ISSUE_TEMPLATE/3bug_report.md config.yml feature_request.md
workflows/3ci.yml clean-clone.yml release.yml
CODEOWNERS dependabot.yml pull_request_template.md
apps/630
api/250
src/243
common/30
__tests__/3authorize.test.ts bigint-serialization.interceptor.test.ts files-limits.test.ts
filters/1all-exceptions.filter.ts
guards/3auth.guard.ts internal-service.guard.ts rate-limit.guard.ts
interceptors/2actor-context.interceptor.ts bigint-serialization.interceptor.ts
middleware/2idempotency.test.ts idempotency.ts
pipes/1zod-validation.pipe.ts
actor-context.ts audit.service.ts cache.test.ts cache.ts cookies.ts core.module.ts deprecation.ts email.service.ts errors.ts event-bus.ts log-scrubber.test.ts log-scrubber.ts logger.ts permission-cache-bridge.ts prisma.service.ts redis.service.ts trace-metadata.ts types.ts
config/1env.ts
lib/11
__tests__/5crypto.test.ts filter-builder.test.ts jwt.test.ts pagination.test.ts positions.test.ts
authorize.ts crypto.ts filter-builder.ts jwt.ts pagination.ts positions.ts
modules/197
ai/28
__tests__/4ai-writing.test.ts database-ai.test.ts generate-executor.test.ts prompts.test.ts
generator/4executor.ts generate.controller.ts generate.dto.ts generate.service.ts
ai-chat.service.ts ai-rate-limit.ts ai-writing.controller.ts ai-writing.dto.ts ai-writing.service.ts ai.controller.ts ai.module.ts ai.service.ts budget-guard.service.ts database-ai.controller.ts database-ai.dto.ts database-ai.service.ts db-prompts.ts dto.ts gateway-provider.ts ledger.service.ts prompts.ts rag.controller.ts rag.dto.ts rag.service.ts
api-keys/3api-keys.controller.ts api-keys.module.ts api-keys.service.ts
audit/2audit-log.controller.ts audit.module.ts
auth/4auth.controller.ts auth.module.ts auth.service.ts dto.ts
automations/5automations.controller.ts automations.module.ts automations.service.ts dto.ts webhook-incoming.controller.ts
blocks/5
__tests__/1batch-version-cas.test.ts
block.service.ts blocks.controller.ts blocks.module.ts dto.ts
comments/4comments.controller.ts comments.module.ts comments.service.ts dto.ts
databases/9
__tests__/3normalize-select-options.test.ts option-id-canonicalization.test.ts record-open-query-shape.test.ts
database.service.ts databases.controller.ts databases.module.ts dto.ts property-cache-schema.ts query.service.ts
docs/2docs.controller.ts docs.module.ts
files/10
__tests__/1quota.test.ts
dto.ts files.controller.ts files.module.ts files.service.ts quota.ts record.ts s3.ts uploads.controller.ts uploads.service.ts
forms/18debug.controller.ts form.dto.ts forms.controller.ts forms.module.ts forms.service.ts markdown.test.ts markdown.ts optional-auth.guard.ts public-forms.controller.ts public-forms.service.ts question.dto.ts questions.service.ts rate-limit.ts recaptcha.ts slug.ts submissions.controller.ts submissions.service.ts submit-schema.ts
health/3health.controller.ts health.module.ts health.service.ts
integrations/3integrations.controller.ts integrations.module.ts integrations.service.ts
internal/12
__tests__/2flush-query-shape.test.ts internal.endpoints.test.ts
ai-test-seam.controller.ts ai-test-seam.dto.ts ai-test-seam.service.ts internal.controller.ts internal.dto.ts internal.module.ts internal.service.ts test-seam.controller.ts test-seam.dto.ts test-seam.service.ts
notifications/3notifications.controller.ts notifications.module.ts notifications.service.ts
oauth/6
__tests__/1oauth.scopes.test.ts
oauth.controller.ts oauth.module.ts oauth.service.ts scopes.ts token-keys.ts
org/15audit.service.ts embed-preview.controller.ts guards.ts members.service.ts org-admin.controller.ts org-policy.service.ts org.module.ts overview.service.ts policy-effective.controller.ts policy.schema.ts policy.test.ts retention.service.ts totp.test.ts totp.ts two-factor.service.ts
orgs/5dto.ts orgs.controller.ts orgs.module.ts orgs.service.ts util.ts
pages/4dto.ts page.service.ts pages.controller.ts pages.module.ts
scim/15
__tests__/3email-mapping.test.ts etag.test.ts filters.test.ts
etag.ts filters.ts groups.service.ts schemas.ts scim-admin.controller.ts scim-admin.service.ts scim-auth.guard.ts scim-auth.service.ts scim-errors.ts scim.controller.ts scim.module.ts users.service.ts
search/4
__tests__/1search.service.test.ts
search.controller.ts search.module.ts search.service.ts
sessions/3sessions.controller.ts sessions.module.ts sessions.service.ts
share/3share.controller.ts share.module.ts share.service.ts
sso/16
__tests__/4enforcement.test.ts oidc.verify.test.ts provisioning.test.ts saml.validate.test.ts
enforcement.ts oidc.controller.ts oidc.service.ts oidc.ts provisioning.service.ts saml.controller.ts saml.ts schemas.ts sso-admin.controller.ts sso-admin.service.ts sso-secrets.ts sso.module.ts
teams/4dto.ts teams.controller.ts teams.module.ts teams.service.ts
users/4dto.ts users.controller.ts users.module.ts users.service.ts
webhooks/3webhooks.controller.ts webhooks.module.ts webhooks.service.ts
workspaces/4dto.ts workspaces.controller.ts workspaces.module.ts workspaces.service.ts
types/1xmldom.d.ts
app.module.ts constants.ts main.ts
_probe_rawbody.cjs .env.example Dockerfile package.json README.md tsconfig.json vitest.config.ts
realtime/33
src/17auth.ts comments.ts config.ts event-source.ts http-store.ts index.ts metrics.ts notifications.ts page-updated-source.ts presence.ts prisma-store.ts protocol.ts rate-limit.ts room-key.ts rooms.ts server.ts update-log.ts
test/11auth.test.ts config.test.ts event-source.test.ts http-store.test.ts metrics-merge.test.ts page-updated-source.test.ts presence.test.ts protocol.test.ts rate-limit.test.ts rooms.test.ts task-0094-builders.test.ts
.env.example Dockerfile package.json README.md tsconfig.json
web/255
src/244
app/45
__tests__/1theme-tokens.test.ts
(app)/26
w/25
[workspace]/25
ask/1page.tsx
databases/1
[id]/1page.tsx
favorites/1page.tsx
files/1page.tsx
notifications/1page.tsx
page/4
[id]/4
[block]/1page.tsx
share/1page.tsx
layout.tsx page.tsx
search/1page.tsx
settings/10
appearance/1page.tsx
automations/3
[id]/1page.tsx
new/1page.tsx
page.tsx
billing/1page.tsx
developers/1page.tsx
members/1page.tsx
permissions/1page.tsx
teams/1page.tsx
page.tsx
shared/1page.tsx
templates/1page.tsx
trash/1page.tsx
layout.tsx page.tsx
layout.tsx
(auth)/4
login/1page.tsx
register/1page.tsx
reset-password/1page.tsx
layout.tsx
api/2
metrics/1route.ts
v1/1
health/1route.ts
f/1
[slug]/1page.tsx
health/1
ready/1route.ts
org/2
[orgId]/2
admin/2
integrations/1page.tsx
page.tsx
share/1
[id]/1page.tsx
error.tsx global-error.tsx globals.css layout.tsx not-found.tsx page.tsx providers.tsx
components/118
admin/10
org-admin/8ApiKeysTab.tsx AuditTab.tsx MembersTab.tsx OverviewTab.tsx PoliciesTab.tsx RetentionTab.tsx WebhooksTab.tsx WorkspacePicker.tsx
ScimCard.tsx SsoTabs.tsx
ai/6ai-panel.tsx ask-ai-submenu.tsx db-ai-dialog.tsx generate-page-dialog.tsx writing-actions-menu.tsx writing-diff.tsx
automations/5action-editor.tsx condition-editor.tsx lib.ts run-history.tsx trigger-editor.tsx
collaboration/6CursorLayer.tsx OfflineBanner.tsx PresenceBar.tsx README.md ReviewFailedDialog.tsx StatusChip.tsx
comments/3comment-panel.tsx comment-thread.tsx mention-input.tsx
database/27
__tests__/2cell-editor.test.tsx cell-renderer.test.tsx
AiExtractDialog.tsx AiFormulaDialog.tsx AiGenerateDialog.tsx board-view.tsx buttons-panel.tsx calendar-view.tsx cell-editor.tsx cell-renderer.tsx chart-view.tsx database-page-view.tsx database-toolbar.tsx database-view-renderer.tsx db-embedded.tsx filter-builder.tsx form-builder-view.tsx formula-editor.tsx gallery-view.tsx group-builder.tsx list-view.tsx property-editor.tsx record-header.tsx record-panel.tsx sort-builder.tsx table-view.tsx timeline-view.tsx
dialogs/7
__tests__/1move-to-dialog.test.tsx
create-dialog.tsx dialog.tsx file-permissions-dialog.tsx invite-dialog.tsx move-to-dialog.tsx share-dialog.tsx
editor/19
__tests__/3code-block-text.test.ts code-block.test.tsx expandable.test.tsx
block-card.tsx block-renderer.tsx block-save-queue.ts block-toolbar.tsx context-menu.tsx expandable.tsx history-popover.tsx inline-editor.tsx insert-dialog.tsx page-canvas.tsx page-spinner.tsx page-view.tsx selection-toolbar.tsx slash-menu.tsx template-dialog.tsx type-menu.tsx
files/4FileBlock.tsx FileBrowser.tsx FilePicker.tsx PreviewModal.tsx
form/4form-field.tsx form-renderer.tsx form-responses-view.tsx form-view.tsx
layout/8
__tests__/1page-tree-icon.test.tsx
command-palette.tsx factory-logo.tsx page-tree-node.tsx sidebar.tsx theme-provider.tsx topbar.tsx workspace-shell.tsx
mentions/3
__tests__/1mention-model.test.ts
mention-model.ts MentionPopup.tsx
search/3ask-ai-search.tsx results-list.tsx search-dialog.tsx
settings/10
api-keys/4ApiKeyCreateDialog.tsx ApiKeyRevealDialog.tsx ApiKeyTable.tsx ScopesBadge.tsx
webhooks/5CurlExamples.tsx DeliveryInspector.tsx EventExplorer.tsx OverviewTab.tsx WebhooksTab.tsx
settings-shell.tsx
ui/3confirm-dialog.tsx form.tsx toaster.tsx
hooks/21
__tests__/4realtime-frame-handler.test.ts use-blocks.test.ts use-database-options.test.ts use-workspace.test.tsx
realtime-frame-handler.ts use-ai-stream.ts use-auth.ts use-blocks.ts use-database.ts use-db-ai-stream.ts use-forms.ts use-members.ts use-mention-sources.ts use-notifications.ts use-offline-status.ts use-pages.ts use-presence-announcer.ts use-presence-toasts.ts use-presence.ts use-realtime.ts use-workspace.ts
lib/50
__tests__/21ai-database.test.ts ai-generate.test.ts ai-sse.test.ts ai-writing.test.ts api-keys.test.ts api-members.test.ts auth-refresh.test.ts auth-store.test.ts batch-queue-drop.test.ts block-content.test.ts clipboard-import.test.ts code-highlight.test.ts offline-status.test.ts presence-announcer.test.ts presence-color.test.ts presence-cursor.test.ts presence-emitter.test.ts realtime-url.test.ts search.test.ts utils.test.ts writing-diff.test.ts
files/7
__tests__/2picker.test.ts upload.test.ts
api.ts picker.ts upload-store.ts upload.ts use-file-uploads.ts
ai-database.ts ai.ts api-keys.ts api.ts auth-store.ts batch-queue.ts block-content.ts clipboard-import.ts code-highlight.ts constants.ts offline-status.ts org-admin.ts presence-announcer.ts presence-color.ts presence-cursor.ts presence-editor-views.ts presence-emitter.ts query-client.ts realtime.ts search.ts types.ts utils.ts
stores/8
__tests__/1block-patch-store.test.ts
block-patch-store.ts comment-pill-store.ts database-store.ts editor-store.ts offlineQueue.ts presence-store.ts ui-store.ts
instrumentation.ts middleware.ts
.env.example Dockerfile next-env.d.ts next.config.mjs package.json postcss.config.mjs README.md tailwind.config.ts tsconfig.json tsconfig.tsbuildinfo vitest.config.ts
worker/92
src/87
__tests__/13ai-embedding.test.ts ai-request.test.ts ai-usage-budget.test.ts audit-export.test.ts email-decision.test.ts encrypt.test.ts health-search-index-lag.test.ts mime.test.ts retention.test.ts s3-sign.test.ts search-index.test.ts smtp.test.ts webhook-sign.test.ts
health/1server.ts
lib/12
__tests__/1clamav.test.ts
clamav.ts encrypt.ts job-otel.ts mime.ts notify.ts prisma.ts redis-stream.ts redis.ts s3.ts sharp.ts smtp.ts
processors/56
automations/28
__tests__/3condition-evaluator.spec.ts executors.spec.ts run-pipeline.spec.ts
executors/17assign-user.ts call-integration.ts change-status.ts classify.ts create-notification.ts create-page.ts email-cap.ts helpers.ts integration-registry.ts permission.ts record-write.ts registry.ts run-ai-action.ts send-email.ts send-webhook.ts types.ts update-record.ts
condition-evaluator.ts dead-letter.ts log.ts matcher.ts pipeline.ts run-state.ts schedule.ts watchdog.ts
files/15
__tests__/4errors.test.ts scan-gate.test.ts status.test.ts temp.test.ts
steps/4finalize.ts metadata.ts scan.ts thumbnails.ts
cleanup.ts errors.ts generateThumbs.ts processor.ts status.ts temp.ts types.ts
search-index/4builders.ts grants.ts index.ts processor.ts
ai-embedding.ts ai.processor.ts audit-export.ts automations.processor.ts email-decision.processor.ts email.processor.ts maintenance.processor.ts retention.ts webhooks.processor.ts
config.ts events.ts index.ts logger.ts queues.ts
.env.example Dockerfile package.json README.md tsconfig.json
docs/73
api/17ai.md authentication.md automations.md blocks.md comments.md databases.md files.md forms.md openapi.yaml org-admin.md pages.md scim.md search.md sso.md versioning.md webhooks.md workspaces.md
architecture/10ai-architecture.md automation.md backend-architecture.md database-architecture.md frontend-architecture.md realtime-architecture.md search-architecture.md security-architecture.md storage.md system-architecture.md
database/2database-architecture.md redis-keys.md
development/8admin-guide.md coding-standards.md deployment.md development-guide.md files-pipeline.md perf-report.md performance.md testing.md
product/4functional-requirements.md non-functional-requirements.md product-requirements.md ux-requirements.md
requirements/1requirements-matrix.md
security/5audit-report.md files.md forms.md license-allowlist.md security-architecture.md
tasks/16phase-00-foundation.md phase-01-authentication.md phase-02-workspace.md phase-03-pages.md phase-04-editor.md phase-05-databases.md phase-06-relations.md phase-07-collaboration.md phase-08-search.md phase-09-files.md phase-10-forms.md phase-11-automation.md phase-12-ai.md phase-13-api.md phase-14-enterprise.md phase-15-production.md
ui/9ai.md automations.md design-system.md developers.md files.md forms.md org-admin.md scim.md sso.md
support-matrix.md
infrastructure/71
caddy/1Caddyfile
docker/6
init/101-extensions.sql
opensearch/1init-indices.json
.env.docker docker-compose.yml opensearch-init.sh README.md
kubernetes/40
observability/20
alertmanager/1alertmanager.yaml
grafana/8
dashboards/6ai.json api-overview.json infra.json realtime.json search.json workers-queues.json
provisioning/2
dashboards/1dashboards.yaml
datasources/1datasource.yaml
prometheus/3alerts.yaml recording-rules.yaml scrape.yaml
scripts/1sync-sources.mjs
alertmanager.yaml grafana.yaml kustomization.yaml namespace.yaml node-exporter.yaml otel-collector.yaml prometheus.yaml
postgres/7configmap.yaml cronjob-backup.yaml cronjob-opensearch-snapshot.yaml pgbouncer.yaml replica.yaml statefulset.yaml walg-iam-policy.yaml
api.yaml configmap.yaml ingress.yaml kustomization.yaml namespace.yaml networkpolicy.yaml pdb.yaml README.md realtime.yaml redis.yaml secret.example.yaml web.yaml worker.yaml
nginx/2nginx.conf README.md
observability/14
alertmanager/1alertmanager.yaml
grafana/8
dashboards/6ai.json api-overview.json infra.json realtime.json search.json workers-queues.json
provisioning/2
dashboards/1dashboards.yaml
datasources/1datasource.yaml
prometheus/3alerts.yaml recording-rules.yaml scrape.yaml
scripts/1dashboard-completeness.mjs
README.md
terraform/8compute.tf data.tf main.tf network.tf outputs.tf README.md security.tf variables.tf
packages/289
ai/24
src/20
providers/7anthropic.ts google.ts http.ts index.ts openai-compatible.ts rag.test.ts writing.test.ts
schemas/2database.ts generate.ts
adapters.test.ts config.test.ts config.ts gateway.test.ts gateway.ts index.ts tools.test.ts tools.ts types.ts usage.test.ts usage.ts
package.json README.md tsconfig.json vitest.config.ts
auth/11
src/7index.ts passwords.test.ts passwords.ts sessions.test.ts sessions.ts tokens.test.ts tokens.ts
package.json README.md tsconfig.json vitest.config.ts
collaboration/17
src/13awareness.ts codec.test.ts codec.ts index.ts lww.test.ts lww.ts mapping.ts offline.ts outbox.test.ts outbox.ts provider.test.ts provider.ts types.ts
package.json README.md tsconfig.json vitest.config.ts
config/7
src/4eslint.base.js index.ts prettier.base.json tsconfig.base.json
package.json README.md tsconfig.json
database-client/5
src/2index.test.ts index.ts
package.json README.md tsconfig.json
database-engine/33
src/29
filter/2filter.test.ts index.ts
formula/8evaluator.ts formula.test.ts functions.ts index.ts lexer.ts parser.ts types.ts validate.ts
query/6group.ts index.ts paginate.ts pivot.ts query.test.ts sort.ts
relations/2index.ts relations.test.ts
rollups/2index.ts rollups.test.ts
values/5dates.ts index.ts registry.ts types.ts values.test.ts
views/3buttons.ts index.ts views.test.ts
index.ts
package.json README.md tsconfig.json vitest.config.ts
editor/25
src/21
marks/1highlight.ts
nodes/2equation.ts mention.ts
autosave.test.ts autosave.ts clipboard.test.ts clipboard.ts codec.test.ts codec.ts context-menu.test.ts context-menu.ts diff.test.ts diff.ts factory.ts history.test.ts history.ts index.ts positions.ts slash.test.ts slash.ts types.ts
package.json README.md tsconfig.json vitest.config.ts
observability/20
src/16
__tests__/8db-redis-metrics.test.ts metrics.test.ts otel.test.ts pino-otel.test.ts prometheus.test.ts resource.test.ts scrubber.test.ts traceparent.test.ts
index.ts metrics.ts otel.ts pino-otel.ts prometheus.ts resource.ts scrubber.ts traceparent.ts
package.json README.md tsconfig.json vitest.config.ts
permissions/11
src/7index.ts levels.test.ts levels.ts resolve.test.ts resolve.ts rules.test.ts rules.ts
package.json README.md tsconfig.json vitest.config.ts
search/22
src/18chunking.test.ts chunking.ts client.test.ts client.ts embeddings.test.ts embeddings.ts hybrid.test.ts hybrid.ts index.ts indexer.test.ts indexer.ts mapping.test.ts mapping.ts queries.test.ts queries.ts rrf.test.ts rrf.ts types.ts
package.json README.md tsconfig.json vitest.config.ts
shared/61
src/57
dto/17ai.dto.ts auth.dto.test.ts auth.dto.ts block.dto.ts browser-safety.test.ts comment.dto.ts database.dto.test.ts database.dto.ts file.dto.ts formula-ast.ts index.ts notification.dto.ts page.dto.ts search.dto.ts share.dto.ts webhook.dto.ts workspace.dto.ts
events/8audit-catalog.test.ts audit-catalog.ts audit-csv.test.ts audit-csv.ts audit-scope.test.ts audit-scope.ts catalog.test.ts catalog.ts
realtime/6comment-events.ts frames.test.ts frames.ts notification-policy.ts notification-prefs.ts task-0094.test.ts
automation.test.ts automation.ts constants.ts crypto.test.ts crypto.ts env.ts errors.ts events.test.ts events.ts forms.test.ts forms.ts index.ts markdown.test.ts markdown.ts mentions.test.ts mentions.ts net.test.ts net.ts positions.test.ts positions.ts presence.test.ts presence.ts security-headers.ts webhook-delivery.test.ts webhook-delivery.ts webhook-events.ts
package.json README.md tsconfig.json vitest.config.ts
storage/16
src/12client.test.ts client.ts index.ts keys.test.ts keys.ts mime.test.ts mime.ts presign.test.ts presign.ts thumbnails.test.ts thumbnails.ts types.ts
package.json README.md tsconfig.json vitest.config.ts
ui/37
src/33
components/19avatar.tsx badge.tsx button.tsx checkbox.tsx command.tsx context-menu.tsx dialog.tsx dropdown-menu.tsx empty-state.tsx index.ts popover.tsx separator.tsx skeleton.tsx slider.tsx spinner.tsx switch.tsx tabs.tsx toast.tsx tooltip.tsx
color.ts command-filter.test.ts command-filter.ts focus.test.ts focus.ts formatters.test.ts formatters.ts index.ts theme.test.ts theme.ts toast-store.test.ts toast-store.ts tokens.test.ts tokens.ts
package.json README.md tsconfig.json vitest.config.ts
prisma/16
migrations/13
20260927000000_init/1migration.sql
20260928000000_search_documents_content_hash/1migration.sql
20260929000000_workspace_usage_storage_bytes/1migration.sql
20260930000000_form_submitted_notification_type/1migration.sql
20261001000000_ai_phase12/1migration.sql
20261002000000_webhooks_secret_encrypted_dlq/1migration.sql
20261002111436_webhook_delivery_latency/1migration.sql
20261002120000_org_admin_2fa_retention_unique/1migration.sql
20261002215124_audit_export/1migration.sql
20261003210000_perf_indexes_hot_paths/1migration.sql
20261004004500_perf_indexes_hot_paths_2/1migration.sql
migration_lock.toml README.md
schema.prisma seed.ts verify.ts
scripts/7backup-health.ts docs-completeness.mjs generate-openapi.mjs minio-init.ts opensearch-reindex.ts storage-orphans.ts verify-clean-clone.sh
tests/169
e2e/63
.auth/1user.json
fixtures/7
files/6clip.mp4 clip.wav clip.webm hero-1400.png note.docx note.txt
realtime.ts
mocks/2oidc-issuer.ts saml-idp.ts
playwright-report/3
data/2a6557bae9c2714a658968d4eb8534195c08ebda8.png e3092d07d00a16063e46385c02a559a9054fa847.webm
index.html
reports/1files-security.json
specs/34ai-database.spec.ts ai-generate.spec.ts ai-rag.spec.ts ai-security.spec.ts ai-writing.spec.ts ai.spec.ts api-keys.spec.ts appearance-theme.spec.ts auth.spec.ts automation.spec.ts collab-two-tab.spec.ts comments.spec.ts databases.spec.ts default-workspace-alias.spec.ts developers.spec.ts editor.spec.ts files.spec.ts final-flow.spec.ts forms.spec.ts oauth.spec.ts org-admin.spec.ts pages.spec.ts performance.spec.ts presence-cursors.spec.ts qa-paste-toggle.spec.ts realtime.spec.ts scim.spec.ts search-index-lag.spec.ts search.spec.ts sharing.spec.ts sso.spec.ts task-0094-comments-notifications.spec.ts webhooks.spec.ts workspace.spec.ts
test-results-final-flow/3
final-flow-Release-v1-0-fi-6c06b-w-state-carries-sequential--chromium-desktop/2test-failed-1.png trace.zip
.last-run.json
utils/4api.ts dnd.ts search-lag.ts wait.ts
.gitignore fixtures.ts global-setup.ts package.json playwright.config.ts playwright.final-flow.config.ts README.md tsconfig.json
fixtures/1
files/1make-sparse.ts
integration/60
ai-capability/2ai-app.capability.test.ts gateway.capability.test.ts
drill/2seed-drill.mjs verify-restore.mjs
fixtures/5
files/5clip.mp4 clip.wav doc.pdf hero-1400.png note.txt
helpers/3api.ts containers.ts seed.ts
realtime/11control-channel.test.ts convergence.test.ts flush-rebase-http.test.ts handshake.test.ts heartbeat-limits.test.ts lifecycle.test.ts presence.test.ts rebase.test.ts resume.test.ts rt-helpers.ts task-0094-fanout.test.ts
ai-chat.integration.test.ts ai-database.integration.test.ts ai-generate.integration.test.ts ai-rag.integration.test.ts ai-writing.integration.test.ts api-keys.integration.test.ts audit-completeness.integration.test.ts audit-export-s3.integration.test.ts auth.integration.test.ts automation-pipeline.integration.test.ts automations.integration.test.ts blocks.integration.test.ts cache-invalidation.integration.test.ts comments.integration.test.ts databases.integration.test.ts files-lifecycle.integration.test.ts files-pipeline.integration.test.ts files-security.integration.test.ts files.integration.test.ts forms-responses.integration.test.ts forms.integration.test.ts oauth.integration.test.ts openapi.contract.test.ts org-admin.integration.test.ts package.json pages.integration.test.ts permissions.integration.test.ts README.md replica-routing.integration.test.ts retention-engine.integration.test.ts scim.integration.test.ts search.integration.test.ts sso.integration.test.ts tsconfig.json vitest.config.ts webhooks.integration.test.ts workspace.integration.test.ts
performance/28
fixtures/1search-100k.ts
helpers/2seed-100k.mjs seed-1k-load.mjs
reports/7api-load-smoke.json database-load-smoke.json editor-local.json realtime-load.json search-full.json search-last.json search-reduced.json
api-load.js api.js archive.tar database-load.js database.js editor-local.mjs extract-100k-env.mjs package.json README.md realtime-1k.js realtime-load.js realtime.js run-realtime-load.sh search-search.k6.js search-summary.json seed-100k.mjs threshold-breach-demo.js verify-zero-op-loss.mjs
security/16
helpers/1app.ts
audit-report.test.ts auth-paths.test.ts deps.test.ts formula-fuzz.test.ts gitleaks-config.test.ts headers.test.ts images.test.ts oracle.ts package.json permission-fuzz.test.ts rate-limits.test.ts README.md tsconfig.json upload-abuse.test.ts vitest.config.ts
README.md
.dockerignore .env .env.bak-task0125 .env.example .eslintrc.json .gitignore .npmrc .prettierignore .prettierrc.json AGENTS.md ARCHITECTURE.md CHANGELOG.md CONTRIBUTING.md gitleaks.toml LICENSE package.json pnpm-lock.yaml pnpm-workspace.yaml PRODUCT-SPEC.md README.md ROADMAP.md SECURITY.md tsconfig.json turbo.json
uiMode.CDUVjusr.jstests/e2e/playwright-report/trace/uiMode.CDUVjusr.jsraw← trace34,473 B← Back to the app
1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./assets/xtermModule-BeNbaIVa.js","./xtermModule.DSXBckUd.css"])))=>i.map(i=>d[i]);
2import{u as Le,r as K,b as Fe,_ as Oe,d as We,e as Ue,j as r,R as h,s as we,f as ae,m as Ae,g as Y,T as D,M as ze,h as Ve,i as Ke,S as $e,a as He,c as qe}from"./assets/inspectorTab-B4Iw34Ow.js";import{T as Ye,W as Qe}from"./assets/testServerConnection-DeE2kSzz.js";import{E as Xe,t as Ge,T as Je,W as Ze}from"./assets/workbench-DFlGYqou.js";var et={};class oe{constructor(e,t={}){this.isListing=!1,this._tests=new Map,this._rootSuite=new Q("","root"),this._options=t,this._reporter=e}reset(){this._rootSuite._entries=[],this._tests.clear()}dispatch(e){const{method:t,params:s}=e;if(t==="onConfigure"){this._onConfigure(s.config);return}if(t==="onProject"){this._onProject(s.project);return}if(t==="onBegin"){this._onBegin();return}if(t==="onTestBegin"){this._onTestBegin(s.testId,s.result);return}if(t==="onTestEnd"){this._onTestEnd(s.test,s.result);return}if(t==="onStepBegin"){this._onStepBegin(s.testId,s.resultId,s.step);return}if(t==="onStepEnd"){this._onStepEnd(s.testId,s.resultId,s.step);return}if(t==="onError"){this._onError(s.error);return}if(t==="onStdIO"){this._onStdIO(s.type,s.testId,s.resultId,s.data,s.isBase64);return}if(t==="onEnd")return this._onEnd(s.result);if(t==="onExit")return this._onExit()}_onConfigure(e){var t,s;this._rootDir=e.rootDir,this._config=this._parseConfig(e),(s=(t=this._reporter).onConfigure)==null||s.call(t,this._config)}_onProject(e){let t=this._options.mergeProjects?this._rootSuite.suites.find(s=>s.project().name===e.name):void 0;t||(t=new Q(e.name,"project"),this._rootSuite._addSuite(t)),t._project=this._parseProject(e);for(const s of e.suites)this._mergeSuiteInto(s,t)}_onBegin(){var e,t;(t=(e=this._reporter).onBegin)==null||t.call(e,this._rootSuite)}_onTestBegin(e,t){var d,a;const s=this._tests.get(e);this._options.clearPreviousResultsWhenTestBegins&&(s.results=[]);const o=s._createTestResult(t.id);o.retry=t.retry,o.workerIndex=t.workerIndex,o.parallelIndex=t.parallelIndex,o.setStartTimeNumber(t.startTime),(a=(d=this._reporter).onTestBegin)==null||a.call(d,s,o)}_onTestEnd(e,t){var d,a,g;const s=this._tests.get(e.testId);s.timeout=e.timeout,s.expectedStatus=e.expectedStatus,s.annotations=e.annotations;const o=s.results.find(l=>l._id===t.id);o.duration=t.duration,o.status=t.status,o.errors=t.errors,o.error=(d=o.errors)==null?void 0:d[0],o.attachments=this._parseAttachments(t.attachments),(g=(a=this._reporter).onTestEnd)==null||g.call(a,s,o),o._stepMap=new Map}_onStepBegin(e,t,s){var m,n;const o=this._tests.get(e),d=o.results.find(f=>f._id===t),a=s.parentStepId?d._stepMap.get(s.parentStepId):void 0,g=this._absoluteLocation(s.location),l=new st(s,a,g);a?a.steps.push(l):d.steps.push(l),d._stepMap.set(s.id,l),(n=(m=this._reporter).onStepBegin)==null||n.call(m,o,d,l)}_onStepEnd(e,t,s){var g,l;const o=this._tests.get(e),d=o.results.find(m=>m._id===t),a=d._stepMap.get(s.id);a.duration=s.duration,a.error=s.error,(l=(g=this._reporter).onStepEnd)==null||l.call(g,o,d,a)}_onError(e){var t,s;(s=(t=this._reporter).onError)==null||s.call(t,e)}_onStdIO(e,t,s,o,d){var m,n,f,S;const a=d?globalThis.Buffer?Buffer.from(o,"base64"):atob(o):o,g=t?this._tests.get(t):void 0,l=g&&s?g.results.find(c=>c._id===s):void 0;e==="stdout"?(l==null||l.stdout.push(a),(n=(m=this._reporter).onStdOut)==null||n.call(m,a,g,l)):(l==null||l.stderr.push(a),(S=(f=this._reporter).onStdErr)==null||S.call(f,a,g,l))}async _onEnd(e){var t,s;await((s=(t=this._reporter).onEnd)==null?void 0:s.call(t,{status:e.status,startTime:new Date(e.startTime),duration:e.duration}))}_onExit(){var e,t;return(t=(e=this._reporter).onExit)==null?void 0:t.call(e)}_parseConfig(e){const t={...rt,...e};return this._options.configOverrides&&(t.configFile=this._options.configOverrides.configFile,t.reportSlowTests=this._options.configOverrides.reportSlowTests,t.quiet=this._options.configOverrides.quiet,t.reporter=[...this._options.configOverrides.reporter]),t}_parseProject(e){return{metadata:e.metadata,name:e.name,outputDir:this._absolutePath(e.outputDir),repeatEach:e.repeatEach,retries:e.retries,testDir:this._absolutePath(e.testDir),testIgnore:se(e.testIgnore),testMatch:se(e.testMatch),timeout:e.timeout,grep:se(e.grep),grepInvert:se(e.grepInvert),dependencies:e.dependencies,teardown:e.teardown,snapshotDir:this._absolutePath(e.snapshotDir),use:{}}}_parseAttachments(e){return e.map(t=>({...t,body:t.base64&&globalThis.Buffer?Buffer.from(t.base64,"base64"):void 0}))}_mergeSuiteInto(e,t){let s=t.suites.find(o=>o.title===e.title);s||(s=new Q(e.title,t.type==="project"?"file":"describe"),t._addSuite(s)),s.location=this._absoluteLocation(e.location),e.entries.forEach(o=>{"testId"in o?this._mergeTestInto(o,s):this._mergeSuiteInto(o,s)})}_mergeTestInto(e,t){let s=this._options.mergeTestCases?t.tests.find(o=>o.title===e.title&&o.repeatEachIndex===e.repeatEachIndex):void 0;s||(s=new tt(e.testId,e.title,this._absoluteLocation(e.location),e.repeatEachIndex),t._addTest(s),this._tests.set(s.id,s)),this._updateTest(e,s)}_updateTest(e,t){return t.id=e.testId,t.location=this._absoluteLocation(e.location),t.retries=e.retries,t.tags=e.tags??[],t.annotations=e.annotations??[],t}_absoluteLocation(e){return e&&{...e,file:this._absolutePath(e.file)}}_absolutePath(e){if(e!==void 0)return this._options.resolvePath?this._options.resolvePath(this._rootDir,e):this._rootDir+"/"+e}}class Q{constructor(e,t){this._entries=[],this._requireFile="",this._parallelMode="none",this.title=e,this._type=t}get type(){return this._type}get suites(){return this._entries.filter(e=>e.type!=="test")}get tests(){return this._entries.filter(e=>e.type==="test")}entries(){return this._entries}allTests(){const e=[],t=s=>{for(const o of s.entries())o.type==="test"?e.push(o):t(o)};return t(this),e}titlePath(){const e=this.parent?this.parent.titlePath():[];return(this.title||this._type!=="describe")&&e.push(this.title),e}project(){var e;return this._project??((e=this.parent)==null?void 0:e.project())}_addTest(e){e.parent=this,this._entries.push(e)}_addSuite(e){e.parent=this,this._entries.push(e)}}class tt{constructor(e,t,s,o){this.fn=()=>{},this.results=[],this.type="test",this.expectedStatus="passed",this.timeout=0,this.annotations=[],this.retries=0,this.tags=[],this.repeatEachIndex=0,this.id=e,this.title=t,this.location=s,this.repeatEachIndex=o}titlePath(){const e=this.parent?this.parent.titlePath():[];return e.push(this.title),e}outcome(){return ot(this)}ok(){const e=this.outcome();return e==="expected"||e==="flaky"||e==="skipped"}_createTestResult(e){const t=new it(this.results.length,e);return this.results.push(t),t}}class st{constructor(e,t,s){this.duration=-1,this.steps=[],this._startTime=0,this.title=e.title,this.category=e.category,this.location=s,this.parent=t,this._startTime=e.startTime}titlePath(){var t;return[...((t=this.parent)==null?void 0:t.titlePath())||[],this.title]}get startTime(){return new Date(this._startTime)}set startTime(e){this._startTime=+e}}class it{constructor(e,t){this.parallelIndex=-1,this.workerIndex=-1,this.duration=-1,this.stdout=[],this.stderr=[],this.attachments=[],this.status="skipped",this.steps=[],this.errors=[],this._stepMap=new Map,this._startTime=0,this.retry=e,this._id=t}setStartTimeNumber(e){this._startTime=e}get startTime(){return new Date(this._startTime)}set startTime(e){this._startTime=+e}}const rt={forbidOnly:!1,fullyParallel:!1,globalSetup:null,globalTeardown:null,globalTimeout:0,grep:/.*/,grepInvert:null,maxFailures:0,metadata:{},preserveOutput:"always",projects:[],reporter:[[et.CI?"dot":"list"]],reportSlowTests:{max:5,threshold:15e3},configFile:"",rootDir:"",quiet:!1,shard:null,updateSnapshots:"missing",version:"",workers:0,webServer:null};function se(i){return i.map(e=>e.s!==void 0?e.s:new RegExp(e.r.source,e.r.flags))}function ot(i){let e=0,t=0,s=0;for(const o of i.results)o.status==="interrupted"||(o.status==="skipped"&&i.expectedStatus==="skipped"?++e:o.status==="skipped"||(o.status===i.expectedStatus?++t:++s));return t===0&&s===0?"skipped":s===0?"expected":t===0&&e===0?"unexpected":"flaky"}class ne{constructor(e,t,s,o,d){this._treeItemById=new Map,this._treeItemByTestId=new Map;const a=o&&[...o.values()].some(Boolean);this.pathSeparator=d,this.rootItem={kind:"group",subKind:"folder",id:e,title:"",location:{file:"",line:0,column:0},duration:0,parent:void 0,children:[],status:"none",hasLoadErrors:!1},this._treeItemById.set(e,this.rootItem);const g=(l,m,n)=>{for(const f of m.suites){const S=f.title||"<anonymous>";let c=n.children.find(v=>v.kind==="group"&&v.title===S);c||(c={kind:"group",subKind:"describe",id:"suite:"+m.titlePath().join("")+""+S,title:S,location:f.location,duration:0,parent:n,children:[],status:"none",hasLoadErrors:!1},this._addChild(n,c)),g(l,f,c)}for(const f of m.tests){const S=f.title;let c=n.children.find(C=>C.kind!=="group"&&C.title===S);c||(c={kind:"case",id:"test:"+f.titlePath().join(""),title:S,parent:n,children:[],tests:[],location:f.location,duration:0,status:"none",project:void 0,test:void 0,tags:f.tags},this._addChild(n,c));const v=f.results[0];let x="none";(v==null?void 0:v[X])==="scheduled"?x="scheduled":(v==null?void 0:v[X])==="running"?x="running":(v==null?void 0:v.status)==="skipped"?x="skipped":(v==null?void 0:v.status)==="interrupted"?x="none":v&&f.outcome()!=="expected"?x="failed":v&&f.outcome()==="expected"&&(x="passed"),c.tests.push(f);const R={kind:"test",id:f.id,title:l.name,location:f.location,test:f,parent:c,children:[],status:x,duration:f.results.length?Math.max(0,f.results[0].duration):0,project:l};this._addChild(c,R),this._treeItemByTestId.set(f.id,R),c.duration=c.children.reduce((C,j)=>C+j.duration,0)}};for(const l of(t==null?void 0:t.suites)||[])if(!(a&&!o.get(l.title)))for(const m of l.suites){const n=this._fileItem(m.location.file.split(d),!0);g(l.project(),m,n)}for(const l of s){if(!l.location)continue;const m=this._fileItem(l.location.file.split(d),!0);m.hasLoadErrors=!0}}_addChild(e,t){e.children.push(t),t.parent=e,this._treeItemById.set(t.id,t)}filterTree(e,t,s){const o=e.trim().toLowerCase().split(" "),d=[...t.values()].some(Boolean),a=l=>{const m=[...l.tests[0].titlePath(),...l.tests[0].tags].join(" ").toLowerCase();return!o.every(n=>m.includes(n))&&!l.tests.some(n=>s==null?void 0:s.has(n.id))?!1:(l.children=l.children.filter(n=>!d||(s==null?void 0:s.has(n.test.id))||t.get(n.status)),l.tests=l.children.map(n=>n.test),!!l.children.length)},g=l=>{const m=[];for(const n of l.children)n.kind==="case"?a(n)&&m.push(n):(g(n),(n.children.length||n.hasLoadErrors)&&m.push(n));l.children=m};g(this.rootItem)}_fileItem(e,t){if(e.length===0)return this.rootItem;const s=e.join(this.pathSeparator),o=this._treeItemById.get(s);if(o)return o;const d=this._fileItem(e.slice(0,e.length-1),!1),a={kind:"group",subKind:t?"file":"folder",id:s,title:e[e.length-1],location:{file:s,line:0,column:0},duration:0,parent:d,children:[],status:"none",hasLoadErrors:!1};return this._addChild(d,a),a}sortAndPropagateStatus(){ve(this.rootItem)}flattenForSingleProject(){const e=t=>{t.kind==="case"&&t.children.length===1?(t.project=t.children[0].project,t.test=t.children[0].test,t.children=[],this._treeItemByTestId.set(t.test.id,t)):t.children.forEach(e)};e(this.rootItem)}shortenRoot(){let e=this.rootItem;for(;e.children.length===1&&e.children[0].kind==="group"&&e.children[0].subKind==="folder";)e=e.children[0];e.location=this.rootItem.location,this.rootItem=e}testIds(){const e=new Set,t=s=>{s.kind==="case"&&s.tests.forEach(o=>e.add(o.id)),s.children.forEach(t)};return t(this.rootItem),e}fileNames(){const e=new Set,t=s=>{s.kind==="group"&&s.subKind==="file"?e.add(s.id):s.children.forEach(t)};return t(this.rootItem),[...e]}flatTreeItems(){const e=[],t=s=>{e.push(s),s.children.forEach(t)};return t(this.rootItem),e}treeItemById(e){return this._treeItemById.get(e)}collectTestIds(e){return e?nt(e):new Set}}function ve(i){for(const a of i.children)ve(a);i.kind==="group"&&i.children.sort((a,g)=>a.location.file.localeCompare(g.location.file)||a.location.line-g.location.line);let e=i.children.length>0,t=i.children.length>0,s=!1,o=!1,d=!1;for(const a of i.children)t=t&&a.status==="skipped",e=e&&(a.status==="passed"||a.status==="skipped"),s=s||a.status==="failed",o=o||a.status==="running",d=d||a.status==="scheduled";o?i.status="running":d?i.status="scheduled":s?i.status="failed":t?i.status="skipped":e&&(i.status="passed")}function nt(i){const e=new Set,t=s=>{var o;s.kind==="case"?s.tests.map(d=>d.id).forEach(d=>e.add(d)):s.kind==="test"?e.add(s.id):(o=s.children)==null||o.forEach(t)};return t(i),e}const X=Symbol("statusEx");class at{constructor(e){this.loadErrors=[],this.progress={total:0,passed:0,failed:0,skipped:0},this._lastRunTestCount=0,this._receiver=new oe(this._createReporter(),{mergeProjects:!0,mergeTestCases:!0,resolvePath:(t,s)=>t+e.pathSeparator+s,clearPreviousResultsWhenTestBegins:!0}),this._options=e}_createReporter(){return{version:()=>"v2",onConfigure:e=>{this.config=e,this._lastRunReceiver=new oe({version:()=>"v2",onBegin:t=>{this._lastRunTestCount=t.allTests().length,this._lastRunReceiver=void 0}},{mergeProjects:!0,mergeTestCases:!1,resolvePath:(t,s)=>t+this._options.pathSeparator+s})},onBegin:e=>{var t;if(this.rootSuite||(this.rootSuite=e),this._testResultsSnapshot){for(const s of this.rootSuite.allTests())s.results=((t=this._testResultsSnapshot)==null?void 0:t.get(s.id))||s.results;this._testResultsSnapshot=void 0}this.progress.total=this._lastRunTestCount,this.progress.passed=0,this.progress.failed=0,this.progress.skipped=0,this._options.onUpdate(!0)},onEnd:()=>{this._options.onUpdate(!0)},onTestBegin:(e,t)=>{t[X]="running",this._options.onUpdate()},onTestEnd:(e,t)=>{e.outcome()==="skipped"?++this.progress.skipped:e.outcome()==="unexpected"?++this.progress.failed:++this.progress.passed,t[X]=t.status,this._options.onUpdate()},onError:e=>this._handleOnError(e),printsToStdio:()=>!1}}processGlobalReport(e){const t=new oe({version:()=>"v2",onConfigure:s=>{this.config=s},onError:s=>this._handleOnError(s)});for(const s of e)t.dispatch(s)}processListReport(e){var s;const t=((s=this.rootSuite)==null?void 0:s.allTests())||[];this._testResultsSnapshot=new Map(t.map(o=>[o.id,o.results])),this._receiver.reset();for(const o of e)this._receiver.dispatch(o)}processTestReportEvent(e){var t,s,o;(s=(t=this._lastRunReceiver)==null?void 0:t.dispatch(e))==null||s.catch(()=>{}),(o=this._receiver.dispatch(e))==null||o.catch(()=>{})}_handleOnError(e){var t,s;this.loadErrors.push(e),(s=(t=this._options).onError)==null||s.call(t,e),this._options.onUpdate()}asModel(){return{rootSuite:this.rootSuite||new Q("","root"),config:this.config,loadErrors:this.loadErrors,progress:this.progress}}}const lt=({source:i})=>{const[e,t]=Le(),[s,o]=K.useState(Fe()),[d]=K.useState(Oe(()=>import("./assets/xtermModule-BeNbaIVa.js"),__vite__mapDeps([0,1]),import.meta.url).then(g=>g.default)),a=K.useRef(null);return K.useEffect(()=>(We(o),()=>Ue(o)),[]),K.useEffect(()=>{const g=i.write,l=i.clear;return(async()=>{const{Terminal:m,FitAddon:n}=await d,f=t.current;if(!f)return;const S=s==="dark-mode"?dt:ct;if(a.current&&a.current.terminal.options.theme===S)return;a.current&&(f.textContent="");const c=new m({convertEol:!0,fontSize:13,scrollback:1e4,fontFamily:"var(--vscode-editor-font-family)",theme:S}),v=new n;c.loadAddon(v);for(const x of i.pending)c.write(x);i.write=x=>{i.pending.push(x),c.write(x)},i.clear=()=>{i.pending=[],c.clear()},c.open(f),v.fit(),a.current={terminal:c,fitAddon:v}})(),()=>{i.clear=l,i.write=g}},[d,a,t,i,s]),K.useEffect(()=>{setTimeout(()=>{a.current&&(a.current.fitAddon.fit(),i.resize(a.current.terminal.cols,a.current.terminal.rows))},250)},[e,i]),r.jsx("div",{"data-testid":"output",className:"xterm-wrapper",style:{flex:"auto"},ref:t})},ct={foreground:"#383a42",background:"#fafafa",cursor:"#383a42",black:"#000000",red:"#e45649",green:"#50a14f",yellow:"#c18401",blue:"#4078f2",magenta:"#a626a4",cyan:"#0184bc",white:"#a0a0a0",brightBlack:"#000000",brightRed:"#e06c75",brightGreen:"#98c379",brightYellow:"#d19a66",brightBlue:"#4078f2",brightMagenta:"#a626a4",brightCyan:"#0184bc",brightWhite:"#383a42",selectionBackground:"#d7d7d7",selectionForeground:"#383a42"},dt={foreground:"#f8f8f2",background:"#1e1e1e",cursor:"#f8f8f0",black:"#000000",red:"#ff5555",green:"#50fa7b",yellow:"#f1fa8c",blue:"#bd93f9",magenta:"#ff79c6",cyan:"#8be9fd",white:"#bfbfbf",brightBlack:"#4d4d4d",brightRed:"#ff6e6e",brightGreen:"#69ff94",brightYellow:"#ffffa5",brightBlue:"#d6acff",brightMagenta:"#ff92df",brightCyan:"#a4ffff",brightWhite:"#e6e6e6",selectionBackground:"#44475a",selectionForeground:"#f8f8f2"},ut=({filterText:i,setFilterText:e,statusFilters:t,setStatusFilters:s,projectFilters:o,setProjectFilters:d,testModel:a,runTests:g})=>{const[l,m]=h.useState(!1),n=h.useRef(null);h.useEffect(()=>{var c;(c=n.current)==null||c.focus()},[]);const f=[...t.entries()].filter(([c,v])=>v).map(([c])=>c).join(" ")||"all",S=[...o.entries()].filter(([c,v])=>v).map(([c])=>c).join(" ")||"all";return r.jsxs("div",{className:"filters",children:[r.jsx(Xe,{expanded:l,setExpanded:m,title:r.jsx("input",{ref:n,type:"search",placeholder:"Filter (e.g. text, @tag)",spellCheck:!1,value:i,onChange:c=>{e(c.target.value)},onKeyDown:c=>{c.key==="Enter"&&g()}})}),r.jsxs("div",{className:"filter-summary",title:"Status: "+f+`
3Projects: `+S,onClick:()=>m(!l),children:[r.jsx("span",{className:"filter-label",children:"Status:"})," ",f,r.jsx("span",{className:"filter-label",children:"Projects:"})," ",S]}),l&&r.jsxs("div",{className:"hbox",style:{marginLeft:14,maxHeight:200,overflowY:"auto"},children:[r.jsx("div",{className:"filter-list",role:"list","data-testid":"status-filters",children:[...t.entries()].map(([c,v])=>r.jsx("div",{className:"filter-entry",role:"listitem",children:r.jsxs("label",{children:[r.jsx("input",{type:"checkbox",checked:v,onClick:()=>{const x=new Map(t);x.set(c,!x.get(c)),s(x)}}),r.jsx("div",{children:c})]})},c))}),r.jsx("div",{className:"filter-list",role:"list","data-testid":"project-filters",children:[...o.entries()].map(([c,v])=>r.jsx("div",{className:"filter-entry",role:"listitem",children:r.jsxs("label",{children:[r.jsx("input",{type:"checkbox",checked:v,onClick:()=>{var C;const x=new Map(o);x.set(c,!x.get(c)),d(x);const R=(C=a==null?void 0:a.config)==null?void 0:C.configFile;R&&we.setObject(R+":projects",[...x.entries()].filter(([j,W])=>W).map(([j])=>j))}}),r.jsx("div",{children:c||"untitled"})]})},c))})]})]})},ht=({tag:i,style:e,onClick:t})=>r.jsx("span",{className:ae("tag",`tag-color-${ft(i)}`),onClick:t,style:{margin:"6px 0 0 6px",...e},title:`Click to filter by tag: ${i}`,children:i});function ft(i){let e=0;for(let t=0;t<i.length;t++)e=i.charCodeAt(t)+((e<<8)-e);return Math.abs(e%6)}const pt=Je,gt=({filterText:i,testModel:e,testServerConnection:t,testTree:s,runTests:o,runningState:d,watchAll:a,watchedTreeIds:g,setWatchedTreeIds:l,isLoading:m,onItemSelected:n,requestedCollapseAllCount:f,requestedExpandAllCount:S,setFilterText:c,onRevealSource:v})=>{const[x,R]=h.useState({expandedItems:new Map}),[C,j]=h.useState(),[W,L]=h.useState(f),[$,N]=h.useState(S);h.useEffect(()=>{if(W!==f){x.expandedItems.clear();for(const b of s.flatTreeItems())x.expandedItems.set(b.id,!1);L(f),j(void 0),R({...x});return}if($!==S){x.expandedItems.clear();for(const b of s.flatTreeItems())x.expandedItems.set(b.id,!0);N(S),j(void 0),R({...x});return}if(!d||d.itemSelectedByUser)return;let u;const E=b=>{var P;b.children.forEach(E),!u&&b.status==="failed"&&(b.kind==="test"&&d.testIds.has(b.test.id)||b.kind==="case"&&d.testIds.has((P=b.tests[0])==null?void 0:P.id))&&(u=b)};E(s.rootItem),u&&j(u.id)},[d,j,s,W,L,f,$,N,S,x,R]);const{selectedTreeItem:z}=h.useMemo(()=>{if(!e)return{selectedTreeItem:void 0};const u=C?s.treeItemById(C):void 0,E=mt(u,e);let b;return(u==null?void 0:u.kind)==="test"?b=u.test:(u==null?void 0:u.kind)==="case"&&u.tests.length===1&&(b=u.tests[0]),n({treeItem:u,testCase:b,testFile:E}),{selectedTreeItem:u}},[n,C,e,s]);h.useEffect(()=>{if(!m)if(a)t==null||t.watchNoReply({fileNames:s.fileNames()});else{const u=new Set;for(const E of g.value){const b=s.treeItemById(E),P=b==null?void 0:b.location.file;P&&u.add(P)}t==null||t.watchNoReply({fileNames:[...u]})}},[m,s,a,g,t]);const G=u=>{j(u.id),o("bounce-if-busy",s.collectTestIds(u))},H=(u,E)=>{if(u.preventDefault(),u.stopPropagation(),u.metaKey||u.ctrlKey){const b=i.split(" ");b.includes(E)?c(b.filter(P=>P!==E).join(" ").trim()):c((i+" "+E).trim())}else c((i.split(" ").filter(b=>!b.startsWith("@")).join(" ")+" "+E).trim())};return r.jsx(pt,{name:"tests",treeState:x,setTreeState:R,rootItem:s.rootItem,dataTestId:"test-tree",render:u=>{const E=u.id.replace(/[^\w\d-_]/g,"-"),b=E+"-label",P=E+"-time";return r.jsxs("div",{className:"hbox ui-mode-tree-item","aria-labelledby":`${b} ${P}`,children:[r.jsxs("div",{id:b,className:"ui-mode-tree-item-title",children:[r.jsx("span",{children:u.title}),u.kind==="case"?u.tags.map(q=>r.jsx(ht,{tag:q.slice(1),onClick:J=>H(J,q)},q)):null]}),!!u.duration&&u.status!=="skipped"&&r.jsx("div",{id:P,className:"ui-mode-tree-item-time",children:Ae(u.duration)}),r.jsxs(Y,{noMinHeight:!0,noShadow:!0,children:[r.jsx(D,{icon:"play",title:"Run",onClick:()=>G(u),disabled:!!d&&!d.completed}),r.jsx(D,{icon:"go-to-file",title:"Show source",onClick:v,style:u.kind==="group"&&u.subKind==="folder"?{visibility:"hidden"}:{}}),!a&&r.jsx(D,{icon:"eye",title:"Watch",onClick:()=>{g.value.has(u.id)?g.value.delete(u.id):g.value.add(u.id),l({...g})},toggled:g.value.has(u.id)})]})]})},icon:u=>Ge(u.status),title:u=>u.title,selectedItem:z,onAccepted:G,onSelected:u=>{d&&(d.itemSelectedByUser=!0),j(u.id)},isError:u=>u.kind==="group"?u.hasLoadErrors:!1,autoExpandDepth:i?5:1,noItemsMessage:m?"Loading…":"No tests"})};function mt(i,e){if(!(!i||!e))return{file:i.location.file,line:i.location.line,column:i.location.column,source:{errors:e.loadErrors.filter(t=>{var s;return((s=t.location)==null?void 0:s.file)===i.location.file}).map(t=>({line:t.location.line,message:t.message})),content:void 0}}}function _t(i){return`.playwright-artifacts-${i}`}const wt=({item:i,rootDir:e,onOpenExternally:t,revealSource:s,pathSeparator:o})=>{var f,S;const[d,a]=h.useState(),[g,l]=h.useState(0),m=h.useRef(null),{outputDir:n}=h.useMemo(()=>({outputDir:i.testCase?vt(i.testCase):void 0}),[i]);return h.useEffect(()=>{var R,C;m.current&&clearTimeout(m.current);const c=(R=i.testCase)==null?void 0:R.results[0];if(!c){a(void 0);return}const v=c&&c.duration>=0&&c.attachments.find(j=>j.name==="trace");if(v&&v.path){ge(v.path).then(j=>a({model:j,isLive:!1}));return}if(!n){a(void 0);return}const x=[n,_t(c.workerIndex),"traces",`${(C=i.testCase)==null?void 0:C.id}.json`].join(o);return m.current=setTimeout(async()=>{try{const j=await ge(x);a({model:j,isLive:!0})}catch{a(void 0)}finally{l(g+1)}},500),()=>{m.current&&clearTimeout(m.current)}},[n,i,a,g,l,o]),r.jsx(Ze,{model:d==null?void 0:d.model,showSourcesFirst:!0,rootDir:e,fallbackLocation:i.testFile,isLive:d==null?void 0:d.isLive,status:(f=i.treeItem)==null?void 0:f.status,annotations:((S=i.testCase)==null?void 0:S.annotations)||[],onOpenExternally:t,revealSource:s},"workbench")},vt=i=>{var e;for(let t=i.parent;t;t=t.parent)if(t.project())return(e=t.project())==null?void 0:e.outputDir};async function ge(i){const e=new URLSearchParams;e.set("trace",i),e.set("limit","1");const s=await(await fetch(`contexts?${e.toString()}`)).json();return new ze(s)}const xt=({settings:i})=>r.jsx("div",{className:"vbox settings-view",children:i.map(({value:e,set:t,title:s})=>r.jsx("div",{className:"setting",children:r.jsxs("label",{children:[r.jsx("input",{type:"checkbox",checked:e,onClick:()=>t(!e)}),s]})},s))});let me={cols:80,rows:24};const A={pending:[],clear:()=>{},write:i=>A.pending.push(i),resize:()=>{}},O=new URLSearchParams(window.location.search),St=O.get("ws"),xe=new URL(`../${St}`,window.location.toString());xe.protocol=window.location.protocol==="https:"?"wss:":"ws:";const I={args:O.getAll("arg"),grep:O.get("grep")||void 0,grepInvert:O.get("grepInvert")||void 0,projects:O.getAll("project"),workers:O.get("workers")||void 0,headed:O.has("headed"),updateSnapshots:O.get("updateSnapshots")||void 0,reporters:O.has("reporter")?O.getAll("reporter"):void 0,pathSeparator:O.get("pathSeparator")||"/"};I.updateSnapshots&&!["all","none","missing"].includes(I.updateSnapshots)&&(I.updateSnapshots=void 0);const _e=navigator.platform==="MacIntel",bt=({})=>{var pe;const[i,e]=h.useState(""),[t,s]=h.useState(!1),[o,d]=h.useState(!1),[a,g]=h.useState(new Map([["passed",!1],["failed",!1],["skipped",!1]])),[l,m]=h.useState(new Map),[n,f]=h.useState(),[S,c]=h.useState(),[v,x]=h.useState({}),[R,C]=h.useState(new Set),[j,W]=h.useState(!1),[L,$]=h.useState(),N=L&&!L.completed,[z,G]=Ve("watch-all",!1),[H,u]=h.useState({value:new Set}),E=h.useRef(Promise.resolve()),b=h.useRef(new Set),[P,q]=h.useState(0),[J,Se]=h.useState(0),[be,Te]=h.useState(!1),[le,ce]=h.useState(!0),[w,ke]=h.useState(),[Z,je]=h.useState(),[ee,ye]=h.useState(!1);h.useState(!1);const[Ee,de]=h.useState(!1),Ie=h.useCallback(()=>de(!0),[de]),Re=!1,[ue,Tt]=h.useState(!1),[he,kt]=h.useState(!1),[fe,jt]=h.useState(!1),[Ce,Be]=Ke(),Ne=h.useRef(null),te=h.useCallback(()=>{ke(new Ye(new Qe(xe)))},[]);h.useEffect(()=>{var _;(_=Ne.current)==null||_.focus(),W(!0),te()},[te]),h.useEffect(()=>{if(!w)return;const _=[w.onStdio(p=>{if(p.buffer){const T=atob(p.buffer);A.write(T)}else A.write(p.text);p.type==="stderr"&&d(!0)}),w.onClose(()=>Te(!0))];return A.resize=(p,T)=>{me={cols:p,rows:T},w.resizeTerminalNoReply({cols:p,rows:T})},()=>{for(const p of _)p.dispose()}},[w]),h.useEffect(()=>{if(!w)return;let _;const p=new at({onUpdate:T=>{clearTimeout(_),_=void 0,T?f(p.asModel()):_||(_=setTimeout(()=>{f(p.asModel())},250))},onError:T=>{A.write((T.stack||T.value||"")+`
4`),d(!0)},pathSeparator:I.pathSeparator});return je(p),f(void 0),W(!0),u({value:new Set}),(async()=>{try{await w.initialize({interceptStdio:!0,watchTestDirs:!0});const{status:T,report:y}=await w.runGlobalSetup({});if(p.processGlobalReport(y),T!=="passed")return;const B=await w.listTests({projects:I.projects,locations:I.args,grep:I.grep,grepInvert:I.grepInvert});p.processListReport(B.report),w.onReport(M=>{p.processTestReportEvent(M)});const{hasBrowsers:F}=await w.checkBrowsers({});ce(F)}finally{W(!1)}})(),()=>{clearTimeout(_)}},[w]),h.useEffect(()=>{if(!n)return;const{config:_,rootSuite:p}=n,T=_.configFile?we.getObject(_.configFile+":projects",void 0):void 0,y=new Map(l);for(const B of y.keys())p.suites.find(F=>F.title===B)||y.delete(B);for(const B of p.suites)y.has(B.title)||y.set(B.title,!!(T!=null&&T.includes(B.title)));!T&&y.size&&![...y.values()].includes(!0)&&y.set(y.entries().next().value[0],!0),(l.size!==y.size||[...l].some(([B,F])=>y.get(B)!==F))&&m(y)},[l,n]),h.useEffect(()=>{N&&(n!=null&&n.progress)?c(n.progress):n||c(void 0)},[n,N]);const{testTree:Pe}=h.useMemo(()=>{if(!n)return{testTree:new ne("",new Q("","root"),[],l,I.pathSeparator)};const _=new ne("",n.rootSuite,n.loadErrors,l,I.pathSeparator);return _.filterTree(i,a,N?L==null?void 0:L.testIds:void 0),_.sortAndPropagateStatus(),_.shortenRoot(),_.flattenForSingleProject(),C(_.testIds()),{testTree:_}},[i,n,a,l,C,L,N]),V=h.useCallback((_,p)=>{!w||!n||_==="bounce-if-busy"&&N||(b.current=new Set([...b.current,...p]),E.current=E.current.then(async()=>{var B,F,M;const T=b.current;if(b.current=new Set,!T.size)return;{for(const k of((B=n.rootSuite)==null?void 0:B.allTests())||[])if(T.has(k.id)){k.results=[];const U=k._createTestResult("pending");U[X]="scheduled"}f({...n})}const y="  ["+new Date().toLocaleTimeString()+"]";A.write("\x1B[2m—".repeat(Math.max(0,me.cols-y.length))+y+"\x1B[22m"),c({total:0,passed:0,failed:0,skipped:0}),$({testIds:T}),await w.runTests({locations:I.args,grep:I.grep,grepInvert:I.grepInvert,testIds:[...T],projects:[...l].filter(([k,U])=>U).map(([k])=>k),...ue?{workers:"1"}:{},...he?{headed:!0}:{},...fe?{updateSnapshots:"all"}:{},reporters:I.reporters,trace:"on"});for(const k of((F=n.rootSuite)==null?void 0:F.allTests())||[])((M=k.results[0])==null?void 0:M.duration)===-1&&(k.results=[]);f({...n}),$(k=>k?{...k,completed:!0}:void 0)}))},[l,N,n,w,ue,he,fe]);h.useEffect(()=>{if(!w||!Z)return;const _=w.onTestFilesChanged(async p=>{if(E.current=E.current.then(async()=>{W(!0);try{const M=await w.listTests({projects:I.projects,locations:I.args,grep:I.grep,grepInvert:I.grepInvert});Z.processListReport(M.report)}catch(M){console.log(M)}finally{W(!1)}}),await E.current,p.testFiles.length===0)return;const T=Z.asModel(),y=new ne("",T.rootSuite,T.loadErrors,l,I.pathSeparator),B=[],F=new Set(p.testFiles);if(z){const M=k=>{const U=k.location.file;U&&F.has(U)&&B.push(...y.collectTestIds(k)),k.kind==="group"&&k.subKind==="folder"&&k.children.forEach(M)};M(y.rootItem)}else for(const M of H.value){const k=y.treeItemById(M),U=k==null?void 0:k.location.file;U&&F.has(U)&&B.push(...y.collectTestIds(k))}V("queue-if-busy",new Set(B))});return()=>_.dispose()},[V,w,z,H,Z,l]),h.useEffect(()=>{if(!w)return;const _=p=>{p.code==="Backquote"&&p.ctrlKey?(p.preventDefault(),s(!t)):p.code==="F5"&&p.shiftKey?(p.preventDefault(),w==null||w.stopTestsNoReply({})):p.code==="F5"&&(p.preventDefault(),V("bounce-if-busy",R))};return addEventListener("keydown",_),()=>{removeEventListener("keydown",_)}},[V,te,w,R,t]);const ie=h.useRef(null),Me=h.useCallback(_=>{var p;_.preventDefault(),_.stopPropagation(),(p=ie.current)==null||p.showModal()},[]),re=h.useCallback(_=>{var p;_.preventDefault(),_.stopPropagation(),(p=ie.current)==null||p.close()},[]),De=h.useCallback(_=>{re(_),s(!0),w==null||w.installBrowsers({}).then(async()=>{s(!1);const{hasBrowsers:p}=await(w==null?void 0:w.checkBrowsers({}));ce(p)})},[re,w]);return r.jsxs("div",{className:"vbox ui-mode",children:[!le&&r.jsxs("dialog",{ref:ie,children:[r.jsxs("div",{className:"title",children:[r.jsx("span",{className:"codicon codicon-lightbulb"}),"Install browsers"]}),r.jsxs("div",{className:"body",children:["Playwright did not find installed browsers.",r.jsx("br",{}),"Would you like to run `playwright install`?",r.jsx("br",{}),r.jsx("button",{className:"button",onClick:De,children:"Install"}),r.jsx("button",{className:"button secondary",onClick:re,children:"Dismiss"})]})]}),be&&r.jsxs("div",{className:"disconnected",children:[r.jsx("div",{className:"title",children:"UI Mode disconnected"}),r.jsxs("div",{children:[r.jsx("a",{href:"#",onClick:()=>window.location.href="/",children:"Reload the page"})," to reconnect"]})]}),r.jsx($e,{sidebarSize:250,minSidebarSize:150,orientation:"horizontal",sidebarIsFirst:!0,settingName:"testListSidebar",main:r.jsxs("div",{className:"vbox",children:[r.jsxs("div",{className:ae("vbox",!t&&"hidden"),children:[r.jsxs(Y,{children:[r.jsx("div",{className:"section-title",style:{flex:"none"},children:"Output"}),r.jsx(D,{icon:"circle-slash",title:"Clear output",onClick:()=>{A.clear(),d(!1)}}),r.jsx("div",{className:"spacer"}),r.jsx(D,{icon:"close",title:"Close",onClick:()=>s(!1)})]}),r.jsx(lt,{source:A})]}),r.jsx("div",{className:ae("vbox",t&&"hidden"),children:r.jsx(wt,{pathSeparator:I.pathSeparator,item:v,rootDir:(pe=n==null?void 0:n.config)==null?void 0:pe.rootDir,revealSource:Ee,onOpenExternally:_=>w==null?void 0:w.openNoReply({location:{file:_.file,line:_.line,column:_.column}})})})]}),sidebar:r.jsxs("div",{className:"vbox ui-mode-sidebar",children:[r.jsxs(Y,{noShadow:!0,noMinHeight:!0,children:[r.jsx("img",{src:"playwright-logo.svg",alt:"Playwright logo"}),r.jsx("div",{className:"section-title",children:"Playwright"}),r.jsx(D,{icon:"refresh",title:"Reload",onClick:()=>te(),disabled:N||j}),r.jsxs("div",{style:{position:"relative"},children:[r.jsx(D,{icon:"terminal",title:"Toggle output — "+(_e?"⌃`":"Ctrl + `"),toggled:t,onClick:()=>{s(!t)}}),o&&r.jsx("div",{title:"Output contains error",style:{position:"absolute",top:2,right:2,width:7,height:7,borderRadius:"50%",backgroundColor:"var(--vscode-notificationsErrorIcon-foreground)"}})]}),!le&&r.jsx(D,{icon:"lightbulb-autofix",style:{color:"var(--vscode-list-warningForeground)"},title:"Playwright browsers are missing",onClick:Me})]}),r.jsx(ut,{filterText:i,setFilterText:e,statusFilters:a,setStatusFilters:g,projectFilters:l,setProjectFilters:m,testModel:n,runTests:()=>V("bounce-if-busy",R)}),r.jsxs(Y,{noMinHeight:!0,children:[!N&&!S&&r.jsx("div",{className:"section-title",children:"Tests"}),!N&&S&&r.jsx("div",{"data-testid":"status-line",className:"status-line",children:r.jsxs("div",{children:[S.passed,"/",S.total," passed (",S.passed/S.total*100|0,"%)"]})}),N&&S&&r.jsx("div",{"data-testid":"status-line",className:"status-line",children:r.jsxs("div",{children:["Running ",S.passed,"/",L.testIds.size," passed (",S.passed/L.testIds.size*100|0,"%)"]})}),r.jsx(D,{icon:"play",title:"Run all — F5",onClick:()=>V("bounce-if-busy",R),disabled:N||j}),r.jsx(D,{icon:"debug-stop",title:"Stop — "+(_e?"⇧F5":"Shift + F5"),onClick:()=>w==null?void 0:w.stopTests({}),disabled:!N||j}),r.jsx(D,{icon:"eye",title:"Watch all",toggled:z,onClick:()=>{u({value:new Set}),G(!z)}}),r.jsx(D,{icon:"collapse-all",title:"Collapse all",onClick:()=>{q(P+1)}}),r.jsx(D,{icon:"expand-all",title:"Expand all",onClick:()=>{Se(J+1)}})]}),r.jsx(gt,{filterText:i,testModel:n,testTree:Pe,testServerConnection:w,runningState:L,runTests:V,onItemSelected:x,watchAll:z,watchedTreeIds:H,setWatchedTreeIds:u,isLoading:j,requestedCollapseAllCount:P,requestedExpandAllCount:J,setFilterText:e,onRevealSource:Ie}),Re,r.jsxs(Y,{noShadow:!0,noMinHeight:!0,className:"settings-toolbar",onClick:()=>ye(!ee),children:[r.jsx("span",{className:`codicon codicon-${ee?"chevron-down":"chevron-right"}`,style:{marginLeft:5},title:ee?"Hide Settings":"Show Settings"}),r.jsx("div",{className:"section-title",children:"Settings"})]}),ee&&r.jsx(xt,{settings:[{value:Ce,set:Be,title:"Dark mode"}]})]})})]})};(async()=>{if(He(),window.location.protocol!=="file:"){if(window.location.href.includes("isUnderTest=true")&&await new Promise(i=>setTimeout(i,1e3)),!navigator.serviceWorker)throw new Error(`Service workers are not supported.
5Make sure to serve the website (${window.location}) via HTTPS or localhost.`);navigator.serviceWorker.register("sw.bundle.js"),navigator.serviceWorker.controller||await new Promise(i=>{navigator.serviceWorker.oncontrollerchange=()=>i()}),setInterval(function(){fetch("ping")},1e4)}qe(document.querySelector("#root")).render(r.jsx(bt,{}))})();
6