okengine 0.11.2 → 0.12.0
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/manifest.v1.schema.json +1 -1
- package/package.json +57 -3
- package/site/content/docs/ai/index.mdx +2 -2
- package/site/content/docs/ai/llms-txt.mdx +21 -16
- package/site/content/docs/ai/mcp.mdx +1 -1
- package/site/content/docs/ai/skills.mdx +16 -14
- package/site/content/docs/deployment/docker-swarm.mdx +7 -8
- package/site/content/docs/deployment/docker.mdx +20 -12
- package/site/content/docs/deployment/index.mdx +2 -2
- package/site/content/docs/deployment/kubernetes.mdx +2 -2
- package/site/content/docs/deployment/reverse-proxy.mdx +39 -21
- package/site/content/docs/elements/ai.mdx +25 -15
- package/site/content/docs/elements/channel.mdx +2 -2
- package/site/content/docs/elements/clock.mdx +11 -1
- package/site/content/docs/elements/flow.mdx +66 -16
- package/site/content/docs/elements/gate.mdx +47 -39
- package/site/content/docs/elements/signal.mdx +2 -2
- package/site/content/docs/elements/store.mdx +191 -48
- package/site/content/docs/elements/vault.mdx +126 -41
- package/site/content/docs/get-started/basic-usage.mdx +14 -6
- package/site/content/docs/get-started/installation.mdx +24 -16
- package/site/content/docs/plugins/cors.mdx +9 -9
- package/site/content/docs/plugins/csrf.mdx +1 -1
- package/site/content/docs/providers/cockroachdb.mdx +13 -0
- package/site/content/docs/providers/neon.mdx +22 -0
- package/site/content/docs/providers/supabase.mdx +17 -0
- package/site/content/docs/providers/yugabytedb.mdx +15 -0
- package/site/content/docs/recipes/caddy.mdx +3 -3
- package/site/content/docs/recipes/cockroachdb.mdx +8 -2
- package/site/content/docs/recipes/index.mdx +6 -1
- package/site/content/docs/recipes/llama-cpp.mdx +5 -6
- package/site/content/docs/recipes/mailpit.mdx +3 -3
- package/site/content/docs/recipes/meilisearch.mdx +4 -4
- package/site/content/docs/recipes/meta.json +1 -0
- package/site/content/docs/recipes/nginx.mdx +117 -0
- package/site/content/docs/recipes/ollama.mdx +3 -3
- package/site/content/docs/recipes/pgdog.mdx +1 -1
- package/site/content/docs/recipes/postgres.mdx +44 -8
- package/site/content/docs/recipes/redis.mdx +7 -2
- package/site/content/docs/recipes/rustfs.mdx +4 -4
- package/site/content/docs/recipes/sglang.mdx +2 -2
- package/site/content/docs/recipes/supabase-docker.mdx +24 -0
- package/site/content/docs/recipes/timescale.mdx +30 -6
- package/site/content/docs/recipes/traefik.mdx +10 -7
- package/site/content/docs/recipes/vllm.mdx +2 -2
- package/site/content/docs/recipes/yugabytedb.mdx +7 -1
- package/site/content/docs/reference/cli.md +67 -34
- package/site/content/docs/reference/client.mdx +39 -20
- package/site/content/docs/reference/configuration.mdx +31 -24
- package/site/content/docs/reference/environment-variables.mdx +23 -20
- package/site/content/docs/reference/errors.mdx +25 -20
- package/site/content/docs/reference/fx.mdx +19 -12
- package/site/content/docs/reference/plugins.mdx +2 -2
- package/site/content/docs/reference/security.md +16 -7
- package/src/auth/auth.test.ts +2 -2
- package/src/auth/bindings.ts +5 -5
- package/src/auth/config.ts +8 -0
- package/src/auth/gate-auth.test.ts +5 -5
- package/src/auth/index.ts +3 -0
- package/src/auth/operator.ts +1 -1
- package/src/auth/password-policy.test.ts +142 -5
- package/src/auth/password-policy.ts +128 -12
- package/src/auth/plugin.ts +2 -2
- package/src/cli/ai-setup/ai-setup.test.ts +1 -1
- package/src/cli/ai-setup/apply.ts +3 -18
- package/src/cli/ai-setup/index.ts +4 -4
- package/src/cli/ai-setup/prompts.ts +1 -1
- package/src/cli/ask-seed.test.ts +27 -0
- package/src/cli/ask-seed.ts +11 -7
- package/src/cli/attach-host-console.test.ts +134 -0
- package/src/cli/attach-host-console.ts +100 -0
- package/src/cli/console-cmd.test.ts +81 -0
- package/src/cli/console-cmd.ts +107 -0
- package/src/cli/db-seed.ts +14 -3
- package/src/cli/db.test.ts +37 -2
- package/src/cli/db.ts +26 -0
- package/src/cli/dev-app-runner.ts +6 -40
- package/src/cli/dev-console-vite.test.ts +86 -0
- package/src/cli/dev-console-vite.ts +164 -0
- package/src/cli/dev-schema-sync.ts +2 -2
- package/src/cli/dev.test.ts +78 -2
- package/src/cli/dev.ts +170 -56
- package/src/cli/docker-cli.test.ts +2 -2
- package/src/cli/docker.ts +1 -1
- package/src/cli/doctor.ts +2 -1
- package/src/cli/drizzle-env.test.ts +4 -9
- package/src/cli/drizzle-env.ts +2 -2
- package/src/cli/hero-meta.test.ts +37 -0
- package/src/cli/hero-meta.ts +30 -9
- package/src/cli/index.ts +5 -0
- package/src/cli/load-config.images.test.ts +12 -12
- package/src/cli/load-config.ts +1 -1
- package/src/cli/project-state.test.ts +6 -2
- package/src/cli/project-state.ts +27 -11
- package/src/cli/registry.ts +11 -0
- package/src/cli/replay.ts +7 -2
- package/src/cli/vault-cmd.test.ts +2 -0
- package/src/cli/vault-cmd.ts +7 -2
- package/src/client/create.test.ts +38 -2
- package/src/client/create.ts +16 -11
- package/src/client/index.ts +6 -0
- package/src/client/pager.test.ts +66 -0
- package/src/client/pager.ts +138 -0
- package/src/client/transport.ts +9 -6
- package/src/client/types.ts +58 -10
- package/src/compiler/aot.test.ts +12 -2
- package/src/compiler/effects-infer.ts +13 -4
- package/src/compiler/extract.test.ts +243 -5
- package/src/compiler/extract.ts +323 -58
- package/src/compiler/fixtures/skyport/src/flows/bookings/index.ts +2 -2
- package/src/compiler/fixtures/skyport/src/gates.ts +2 -0
- package/src/compiler/fixtures/skyport.expected.json +4 -0
- package/src/config/driver-defaults.test.ts +3 -0
- package/src/config/driver-defaults.ts +14 -0
- package/src/config/index.ts +5 -0
- package/src/console/budget.test.ts +27 -37
- package/src/console/index.ts +3 -0
- package/src/console/password-policy.ts +89 -0
- package/src/console/server/app.ts +138 -12
- package/src/console/server/auth-rate.test.ts +3 -3
- package/src/console/server/auth-store.test.ts +222 -0
- package/src/console/server/auth-store.ts +499 -0
- package/src/console/server/bind.ts +2 -3
- package/src/console/server/channels.test.ts +1 -1
- package/src/console/server/claim.test.ts +60 -1
- package/src/console/server/claim.ts +137 -2
- package/src/console/server/console.test.ts +102 -6
- package/src/console/server/dry-run.audit.test.ts +5 -2
- package/src/console/server/files-catalog.test.ts +51 -0
- package/src/console/server/files-catalog.ts +122 -0
- package/src/console/server/flows-invoke.test.ts +655 -38
- package/src/console/server/flows.ts +907 -90
- package/src/console/server/gates.test.ts +59 -0
- package/src/console/server/gates.ts +17 -14
- package/src/console/server/i18n.ts +7 -4
- package/src/console/server/index-search.test.ts +57 -0
- package/src/console/server/index-search.ts +102 -0
- package/src/console/server/index.ts +32 -1
- package/src/console/server/instances.test.ts +68 -0
- package/src/console/server/instances.ts +58 -0
- package/src/console/server/invoke-user-flow.test.ts +206 -0
- package/src/console/server/invoke-user-flow.ts +367 -0
- package/src/console/server/live.test.ts +44 -1
- package/src/console/server/live.ts +16 -0
- package/src/console/server/operator-db.test.ts +5 -5
- package/src/console/server/operator-db.ts +2 -2
- package/src/console/server/panel-load.ts +1 -0
- package/src/console/server/plugin.ts +12 -2
- package/src/console/server/runs-history.test.ts +143 -0
- package/src/console/server/runs-ingest.test.ts +379 -0
- package/src/console/server/runs-ingest.ts +127 -0
- package/src/console/server/runs-list-nesting.test.ts +97 -0
- package/src/console/server/runs-pii.test.ts +69 -0
- package/src/console/server/runs-pii.ts +50 -4
- package/src/console/server/runs-query-guard.test.ts +75 -0
- package/src/console/server/runs-query-guard.ts +224 -0
- package/src/console/server/runs-query-mask.test.ts +37 -0
- package/src/console/server/runs-query-mask.ts +82 -0
- package/src/console/server/runs-query.test.ts +287 -0
- package/src/console/server/runs-query.ts +107 -0
- package/src/console/server/security-headers.ts +21 -2
- package/src/console/server/security.gate.test.ts +306 -3
- package/src/console/server/serve.ts +138 -9
- package/src/console/server/spa-paths.test.ts +36 -0
- package/src/console/server/spa-proxy.test.ts +86 -0
- package/src/console/server/sql-catalog.ts +572 -0
- package/src/console/server/sql-extension.test.ts +19 -0
- package/src/console/server/sql-rls.test.ts +44 -0
- package/src/console/server/state.ts +445 -7
- package/src/console/server/store-kv-stats.test.ts +178 -0
- package/src/console/server/store-kv-stats.ts +339 -0
- package/src/console/server/store-stats.test.ts +165 -0
- package/src/console/server/store-stats.ts +526 -0
- package/src/console/server/store.test.ts +930 -0
- package/src/console/server/store.ts +859 -76
- package/src/console/server/traces-replay.test.ts +212 -0
- package/src/console/server/vault-http.test.ts +458 -0
- package/src/console/server/vault-overlay.test.ts +49 -0
- package/src/console/server/vault-overlay.ts +99 -0
- package/src/console/server/vault.test.ts +75 -0
- package/src/console/server/vault.ts +443 -27
- package/src/console/ui-next/components.json +26 -0
- package/src/console/ui-next/dist/assets/bash-CLZ0U2zV.js +1 -0
- package/src/console/ui-next/dist/assets/cache-glyph-CLPBqZeb.js +1 -0
- package/src/console/ui-next/dist/assets/call-pii-button-bqkxMrJH.js +1 -0
- package/src/console/ui-next/dist/assets/collapsible-DYb0xU8C.js +1 -0
- package/src/console/ui-next/dist/assets/confirm-sheet-DDCRmG62.js +1 -0
- package/src/console/ui-next/dist/assets/dagre.esm-ZwcdTuZZ.js +1 -0
- package/src/console/ui-next/dist/assets/duration-tone-oiRxPVsZ.js +9 -0
- package/src/console/ui-next/dist/assets/explorer-empty-HjTnVQoR.js +1 -0
- package/src/console/ui-next/dist/assets/flows-page-C_Tas1E1.js +1 -0
- package/src/console/ui-next/dist/assets/github-dark-C-LZuMrd.js +1 -0
- package/src/console/ui-next/dist/assets/github-light-EUqPIrTm.js +1 -0
- package/src/console/ui-next/dist/assets/highlighted-json-CvDPvveV.js +154 -0
- package/src/console/ui-next/dist/assets/http-method-BJ92Z_ke.js +1 -0
- package/src/console/ui-next/dist/assets/index-D4Ldtj79.css +2 -0
- package/src/console/ui-next/dist/assets/index-DX248G39.js +66 -0
- package/src/console/ui-next/dist/assets/json-qhed-kSA.js +1 -0
- package/src/console/ui-next/dist/assets/link-DF7SZ9Ek.js +1 -0
- package/src/console/ui-next/dist/assets/observability-page-BwVS5Jvm.js +4 -0
- package/src/console/ui-next/dist/assets/preload-helper-oH4irX4C.js +1 -0
- package/src/console/ui-next/dist/assets/query-gate-parts-1m8m1iNp.js +2 -0
- package/src/console/ui-next/dist/assets/react-B1ML8gxg.js +1 -0
- package/src/console/ui-next/dist/assets/react-dom-Bph1y7z7.js +9 -0
- package/src/console/ui-next/dist/assets/replica-lag-C8_BRt2x.js +18 -0
- package/src/console/ui-next/dist/assets/rolldown-runtime-hePW80VL.js +1 -0
- package/src/console/ui-next/dist/assets/sheet-form-D-ata7jy.js +1 -0
- package/src/console/ui-next/dist/assets/shortcut-Cgzuv4k1.js +1 -0
- package/src/console/ui-next/dist/assets/shortcut-keys-DO4IsVqv.js +1 -0
- package/src/console/ui-next/dist/assets/skeleton-CL_X0GCj.js +1 -0
- package/src/console/ui-next/dist/assets/sql-BskegiFM.js +1 -0
- package/src/console/ui-next/dist/assets/store-page-v3LXdYpr.js +45 -0
- package/src/console/ui-next/dist/assets/trace-detail-sheet-D16lWQMt.js +2 -0
- package/src/console/ui-next/dist/assets/tsx-udAQXfEw.js +1 -0
- package/src/console/ui-next/dist/assets/typescript-bsJCZSQ-.js +1 -0
- package/src/console/ui-next/dist/assets/units-page-C5KOI7qG.js +1 -0
- package/src/console/ui-next/dist/assets/use-vault-list-Cl79j_ku.js +1 -0
- package/src/console/ui-next/dist/assets/vault-page-CSOYMHhO.js +2 -0
- package/src/console/ui-next/dist/assets/xyflow-D7n4g6go.js +7 -0
- package/src/console/ui-next/dist/assets/xyflow-DZ0Ws1xk.css +1 -0
- package/src/console/ui-next/dist/favicon.svg +6 -0
- package/src/console/ui-next/dist/index.html +56 -0
- package/src/console/ui-next/index.html +45 -0
- package/src/console/ui-next/public/favicon.svg +6 -0
- package/src/console/ui-next/seed-invoke-host.test.ts +47 -0
- package/src/console/ui-next/seed-invoke-host.ts +199 -0
- package/src/console/ui-next/seed-invoke-ops.test.ts +280 -0
- package/src/console/ui-next/seed-invoke-ops.ts +587 -0
- package/src/console/ui-next/src/client-session.test.ts +22 -0
- package/src/console/ui-next/src/client.ts +1379 -0
- package/src/console/ui-next/src/components/agents/agent-code.tsx +207 -0
- package/src/console/ui-next/src/components/agents/agent-disclosure.tsx +63 -0
- package/src/console/ui-next/src/components/agents/file-diff.tsx +271 -0
- package/src/console/ui-next/src/components/auth-card.tsx +298 -0
- package/src/console/ui-next/src/components/charts/animation.ts +36 -0
- package/src/console/ui-next/src/components/charts/area-chart-loading.tsx +115 -0
- package/src/console/ui-next/src/components/charts/area-chart.tsx +261 -0
- package/src/console/ui-next/src/components/charts/area-gradient-defs.tsx +98 -0
- package/src/console/ui-next/src/components/charts/area.tsx +349 -0
- package/src/console/ui-next/src/components/charts/chart-child-passthrough.ts +110 -0
- package/src/console/ui-next/src/components/charts/chart-config-context.tsx +81 -0
- package/src/console/ui-next/src/components/charts/chart-context.tsx +414 -0
- package/src/console/ui-next/src/components/charts/chart-defs.ts +61 -0
- package/src/console/ui-next/src/components/charts/chart-formatters.ts +26 -0
- package/src/console/ui-next/src/components/charts/chart-legend-hover.tsx +41 -0
- package/src/console/ui-next/src/components/charts/chart-loading-label.tsx +56 -0
- package/src/console/ui-next/src/components/charts/chart-phase.ts +52 -0
- package/src/console/ui-next/src/components/charts/chart-reveal-clip.tsx +87 -0
- package/src/console/ui-next/src/components/charts/composed-chart.tsx +333 -0
- package/src/console/ui-next/src/components/charts/dash-tail-stroke.tsx +75 -0
- package/src/console/ui-next/src/components/charts/decimate-time-series.ts +134 -0
- package/src/console/ui-next/src/components/charts/fade-edges.ts +52 -0
- package/src/console/ui-next/src/components/charts/filter-data-by-x-domain.ts +59 -0
- package/src/console/ui-next/src/components/charts/generate-chart-skeleton-data.ts +42 -0
- package/src/console/ui-next/src/components/charts/grid.tsx +299 -0
- package/src/console/ui-next/src/components/charts/highlight-segment-bounds.ts +68 -0
- package/src/console/ui-next/src/components/charts/highlight-segment.tsx +65 -0
- package/src/console/ui-next/src/components/charts/indicator-fade.ts +62 -0
- package/src/console/ui-next/src/components/charts/line-chart-loading.tsx +111 -0
- package/src/console/ui-next/src/components/charts/line-chart.tsx +293 -0
- package/src/console/ui-next/src/components/charts/line-loading-pulse.tsx +201 -0
- package/src/console/ui-next/src/components/charts/line-loading-timing.ts +12 -0
- package/src/console/ui-next/src/components/charts/line-series-terminal-marker.tsx +91 -0
- package/src/console/ui-next/src/components/charts/line.tsx +384 -0
- package/src/console/ui-next/src/components/charts/loading-sweep.tsx +452 -0
- package/src/console/ui-next/src/components/charts/motion-utils.ts +47 -0
- package/src/console/ui-next/src/components/charts/path-stroke-utils.ts +82 -0
- package/src/console/ui-next/src/components/charts/pattern-area.tsx +45 -0
- package/src/console/ui-next/src/components/charts/projection-config.ts +112 -0
- package/src/console/ui-next/src/components/charts/projection-line-end-marker.tsx +51 -0
- package/src/console/ui-next/src/components/charts/projection-line.tsx +208 -0
- package/src/console/ui-next/src/components/charts/projection-utils.ts +378 -0
- package/src/console/ui-next/src/components/charts/reference-area-config.ts +59 -0
- package/src/console/ui-next/src/components/charts/reference-area-geometry.ts +136 -0
- package/src/console/ui-next/src/components/charts/reference-area-registration-context.tsx +16 -0
- package/src/console/ui-next/src/components/charts/series-bar-layout.ts +60 -0
- package/src/console/ui-next/src/components/charts/series-bar.tsx +304 -0
- package/src/console/ui-next/src/components/charts/series-dash-tail-overlay.tsx +82 -0
- package/src/console/ui-next/src/components/charts/series-highlight-layer.tsx +49 -0
- package/src/console/ui-next/src/components/charts/series-hover-dim.tsx +57 -0
- package/src/console/ui-next/src/components/charts/series-markers.tsx +267 -0
- package/src/console/ui-next/src/components/charts/series-path-utils.ts +103 -0
- package/src/console/ui-next/src/components/charts/series-point-marker.tsx +205 -0
- package/src/console/ui-next/src/components/charts/static-chart-preview-context.tsx +16 -0
- package/src/console/ui-next/src/components/charts/time-series-chart-shell.tsx +644 -0
- package/src/console/ui-next/src/components/charts/tooltip/chart-tooltip.tsx +400 -0
- package/src/console/ui-next/src/components/charts/tooltip/date-ticker.tsx +140 -0
- package/src/console/ui-next/src/components/charts/tooltip/index.ts +10 -0
- package/src/console/ui-next/src/components/charts/tooltip/tooltip-box.tsx +227 -0
- package/src/console/ui-next/src/components/charts/tooltip/tooltip-content.tsx +58 -0
- package/src/console/ui-next/src/components/charts/tooltip/tooltip-dot.tsx +173 -0
- package/src/console/ui-next/src/components/charts/tooltip/tooltip-indicator.tsx +191 -0
- package/src/console/ui-next/src/components/charts/use-animated-series-path.ts +155 -0
- package/src/console/ui-next/src/components/charts/use-animated-y-domains.ts +227 -0
- package/src/console/ui-next/src/components/charts/use-chart-interaction.ts +343 -0
- package/src/console/ui-next/src/components/charts/use-chart-phase-orchestrator.ts +173 -0
- package/src/console/ui-next/src/components/charts/use-enter-complete.ts +28 -0
- package/src/console/ui-next/src/components/charts/use-grid-shimmer.ts +101 -0
- package/src/console/ui-next/src/components/charts/use-highlight-segment.ts +58 -0
- package/src/console/ui-next/src/components/charts/use-mount-progress.ts +29 -0
- package/src/console/ui-next/src/components/charts/use-scheduled-tooltip.ts +97 -0
- package/src/console/ui-next/src/components/charts/x-axis.tsx +635 -0
- package/src/console/ui-next/src/components/charts/y-axis-scales.ts +108 -0
- package/src/console/ui-next/src/components/charts/y-axis-ticks.ts +25 -0
- package/src/console/ui-next/src/components/charts/y-axis.tsx +151 -0
- package/src/console/ui-next/src/components/charts/y-domain-utils.ts +120 -0
- package/src/console/ui-next/src/components/console-chrome.tsx +50 -0
- package/src/console/ui-next/src/components/document-title.tsx +18 -0
- package/src/console/ui-next/src/components/explorer/copy-inline-button.tsx +57 -0
- package/src/console/ui-next/src/components/explorer/detail-header.tsx +82 -0
- package/src/console/ui-next/src/components/explorer/explorer-chrome.ts +123 -0
- package/src/console/ui-next/src/components/explorer/explorer-empty.tsx +67 -0
- package/src/console/ui-next/src/components/explorer/explorer-search.tsx +20 -0
- package/src/console/ui-next/src/components/explorer/explorer-start-toggle.tsx +52 -0
- package/src/console/ui-next/src/components/explorer/section-head.tsx +33 -0
- package/src/console/ui-next/src/components/explorer/tree-expand-toggle.tsx +69 -0
- package/src/console/ui-next/src/components/explorer/use-explorer-start-panel.ts +34 -0
- package/src/console/ui-next/src/components/gate-list.tsx +70 -0
- package/src/console/ui-next/src/components/generate-password-button.tsx +76 -0
- package/src/console/ui-next/src/components/highlighted-json.tsx +73 -0
- package/src/console/ui-next/src/components/http-method-badge.tsx +35 -0
- package/src/console/ui-next/src/components/mode-toggle.tsx +84 -0
- package/src/console/ui-next/src/components/motion/button/base.tsx +145 -0
- package/src/console/ui-next/src/components/motion/button/expanding-arrow.tsx +167 -0
- package/src/console/ui-next/src/components/motion/button/index.ts +12 -0
- package/src/console/ui-next/src/components/motion/button/stateful.tsx +243 -0
- package/src/console/ui-next/src/components/motion/checkbox.tsx +120 -0
- package/src/console/ui-next/src/components/motion/select.tsx +436 -0
- package/src/console/ui-next/src/components/motion/switch.tsx +108 -0
- package/src/console/ui-next/src/components/motion/table/editable-cell.tsx +98 -0
- package/src/console/ui-next/src/components/motion/table/index.tsx +404 -0
- package/src/console/ui-next/src/components/motion/table/row-handle.tsx +95 -0
- package/src/console/ui-next/src/components/motion/table/skeleton-rows.tsx +52 -0
- package/src/console/ui-next/src/components/motion/table/table-header.tsx +337 -0
- package/src/console/ui-next/src/components/motion/table/table-menu.tsx +130 -0
- package/src/console/ui-next/src/components/motion/table/types.ts +109 -0
- package/src/console/ui-next/src/components/motion/table/use-cell-range.ts +145 -0
- package/src/console/ui-next/src/components/motion/table/use-column-reorder.ts +112 -0
- package/src/console/ui-next/src/components/motion/table/use-column-resize.ts +83 -0
- package/src/console/ui-next/src/components/motion/table/use-column-sort.ts +73 -0
- package/src/console/ui-next/src/components/motion/table/use-row-selection.ts +70 -0
- package/src/console/ui-next/src/components/motion/table/utils.ts +138 -0
- package/src/console/ui-next/src/components/oke-logo.tsx +65 -0
- package/src/console/ui-next/src/components/password-input.tsx +67 -0
- package/src/console/ui-next/src/components/password-strength.tsx +160 -0
- package/src/console/ui-next/src/components/shell/app-sidebar.tsx +117 -0
- package/src/console/ui-next/src/components/shell/command-items.test.ts +30 -0
- package/src/console/ui-next/src/components/shell/command-items.ts +144 -0
- package/src/console/ui-next/src/components/shell/command-match.test.ts +37 -0
- package/src/console/ui-next/src/components/shell/command-match.ts +45 -0
- package/src/console/ui-next/src/components/shell/command-palette.tsx +334 -0
- package/src/console/ui-next/src/components/shell/nav-footer.tsx +109 -0
- package/src/console/ui-next/src/components/shell/section-empty.tsx +42 -0
- package/src/console/ui-next/src/components/shell/settings-dialog.tsx +65 -0
- package/src/console/ui-next/src/components/shell/shell-layout.tsx +100 -0
- package/src/console/ui-next/src/components/shimmering-text.tsx +87 -0
- package/src/console/ui-next/src/components/signal-delivery-badge.tsx +38 -0
- package/src/console/ui-next/src/components/theme-provider.tsx +86 -0
- package/src/console/ui-next/src/components/ui/alert-dialog.tsx +147 -0
- package/src/console/ui-next/src/components/ui/avatar.tsx +91 -0
- package/src/console/ui-next/src/components/ui/badge.tsx +54 -0
- package/src/console/ui-next/src/components/ui/breadcrumb.tsx +104 -0
- package/src/console/ui-next/src/components/ui/button.tsx +58 -0
- package/src/console/ui-next/src/components/ui/card.tsx +88 -0
- package/src/console/ui-next/src/components/ui/collapsible.tsx +15 -0
- package/src/console/ui-next/src/components/ui/confirm-sheet.tsx +149 -0
- package/src/console/ui-next/src/components/ui/dialog.tsx +144 -0
- package/src/console/ui-next/src/components/ui/dropdown-menu.tsx +265 -0
- package/src/console/ui-next/src/components/ui/empty.tsx +95 -0
- package/src/console/ui-next/src/components/ui/field.tsx +224 -0
- package/src/console/ui-next/src/components/ui/input.tsx +30 -0
- package/src/console/ui-next/src/components/ui/kbd.tsx +41 -0
- package/src/console/ui-next/src/components/ui/label.tsx +20 -0
- package/src/console/ui-next/src/components/ui/progress.tsx +66 -0
- package/src/console/ui-next/src/components/ui/resizable.tsx +74 -0
- package/src/console/ui-next/src/components/ui/select.tsx +230 -0
- package/src/console/ui-next/src/components/ui/separator.tsx +21 -0
- package/src/console/ui-next/src/components/ui/sheet-form.tsx +337 -0
- package/src/console/ui-next/src/components/ui/sheet.tsx +130 -0
- package/src/console/ui-next/src/components/ui/sidebar.tsx +691 -0
- package/src/console/ui-next/src/components/ui/skeleton.tsx +20 -0
- package/src/console/ui-next/src/components/ui/toggle-group.tsx +87 -0
- package/src/console/ui-next/src/components/ui/toggle.tsx +46 -0
- package/src/console/ui-next/src/components/ui/toolbar-tip.tsx +41 -0
- package/src/console/ui-next/src/components/ui/tooltip.tsx +74 -0
- package/src/console/ui-next/src/features/auth/auth-redirect.test.ts +119 -0
- package/src/console/ui-next/src/features/auth/auth-redirect.ts +153 -0
- package/src/console/ui-next/src/features/auth/login-form.tsx +234 -0
- package/src/console/ui-next/src/features/auth/logout.ts +17 -0
- package/src/console/ui-next/src/features/flows/data/console-live-session.test.ts +329 -0
- package/src/console/ui-next/src/features/flows/data/console-live-session.ts +210 -0
- package/src/console/ui-next/src/features/flows/data/use-console-live.ts +79 -0
- package/src/console/ui-next/src/features/flows/data/use-manifest.ts +23 -0
- package/src/console/ui-next/src/features/flows/data/use-runs.ts +24 -0
- package/src/console/ui-next/src/features/flows/fixture.ts +81 -0
- package/src/console/ui-next/src/features/flows/flows-page.tsx +227 -0
- package/src/console/ui-next/src/features/flows/graph/build-flow-graph.test.ts +236 -0
- package/src/console/ui-next/src/features/flows/graph/build-flow-graph.ts +530 -0
- package/src/console/ui-next/src/features/flows/graph/element-map.test.ts +443 -0
- package/src/console/ui-next/src/features/flows/graph/element-map.ts +1077 -0
- package/src/console/ui-next/src/features/flows/graph/flow-graph-nodes.tsx +486 -0
- package/src/console/ui-next/src/features/flows/graph/flow-graph-theme.ts +143 -0
- package/src/console/ui-next/src/features/flows/graph/flow-graph.tsx +268 -0
- package/src/console/ui-next/src/features/flows/graph/neighborhood.test.ts +64 -0
- package/src/console/ui-next/src/features/flows/graph/neighborhood.ts +82 -0
- package/src/console/ui-next/src/features/flows/graph/orchestra.test.ts +97 -0
- package/src/console/ui-next/src/features/flows/graph/orchestra.ts +86 -0
- package/src/console/ui-next/src/features/flows/graph/use-overview-orchestra.ts +95 -0
- package/src/console/ui-next/src/features/flows/state/flows-selection.test.ts +24 -0
- package/src/console/ui-next/src/features/flows/state/flows-selection.ts +92 -0
- package/src/console/ui-next/src/features/flows/traces/advanced-filters.tsx +222 -0
- package/src/console/ui-next/src/features/flows/traces/cache-glyph.tsx +42 -0
- package/src/console/ui-next/src/features/flows/traces/cache-icon.test.ts +27 -0
- package/src/console/ui-next/src/features/flows/traces/cache-icon.ts +48 -0
- package/src/console/ui-next/src/features/flows/traces/dimension-query.test.ts +100 -0
- package/src/console/ui-next/src/features/flows/traces/dimension-query.ts +325 -0
- package/src/console/ui-next/src/features/flows/traces/duration-tone.test.ts +71 -0
- package/src/console/ui-next/src/features/flows/traces/duration-tone.ts +128 -0
- package/src/console/ui-next/src/features/flows/traces/effect-kind.ts +106 -0
- package/src/console/ui-next/src/features/flows/traces/effect-summary.ts +193 -0
- package/src/console/ui-next/src/features/flows/traces/filter-runs.test.ts +98 -0
- package/src/console/ui-next/src/features/flows/traces/filter-runs.ts +68 -0
- package/src/console/ui-next/src/features/flows/traces/format-duration.test.ts +47 -0
- package/src/console/ui-next/src/features/flows/traces/format-duration.ts +25 -0
- package/src/console/ui-next/src/features/flows/traces/graph-filter.test.ts +192 -0
- package/src/console/ui-next/src/features/flows/traces/graph-filter.ts +175 -0
- package/src/console/ui-next/src/features/flows/traces/http-method.ts +134 -0
- package/src/console/ui-next/src/features/flows/traces/replay-playback.test.ts +101 -0
- package/src/console/ui-next/src/features/flows/traces/replay-playback.ts +107 -0
- package/src/console/ui-next/src/features/flows/traces/request-input-view.test.ts +60 -0
- package/src/console/ui-next/src/features/flows/traces/request-input-view.ts +108 -0
- package/src/console/ui-next/src/features/flows/traces/request-meta.ts +62 -0
- package/src/console/ui-next/src/features/flows/traces/scope-runs.test.ts +51 -0
- package/src/console/ui-next/src/features/flows/traces/scope-runs.ts +23 -0
- package/src/console/ui-next/src/features/flows/traces/trace-actions.test.ts +80 -0
- package/src/console/ui-next/src/features/flows/traces/trace-actions.ts +57 -0
- package/src/console/ui-next/src/features/flows/traces/trace-chain.test.ts +68 -0
- package/src/console/ui-next/src/features/flows/traces/trace-chain.ts +59 -0
- package/src/console/ui-next/src/features/flows/traces/trace-detail-sheet.tsx +1003 -0
- package/src/console/ui-next/src/features/flows/traces/trace-detail.test.ts +357 -0
- package/src/console/ui-next/src/features/flows/traces/trace-gates.ts +90 -0
- package/src/console/ui-next/src/features/flows/traces/trace-request-section.tsx +574 -0
- package/src/console/ui-next/src/features/flows/traces/trace-row-meta.test.ts +42 -0
- package/src/console/ui-next/src/features/flows/traces/trace-row-meta.ts +47 -0
- package/src/console/ui-next/src/features/flows/traces/trace-row.tsx +149 -0
- package/src/console/ui-next/src/features/flows/traces/traces-pane.tsx +289 -0
- package/src/console/ui-next/src/features/flows/traces/trigger-icon.test.ts +42 -0
- package/src/console/ui-next/src/features/flows/traces/trigger-icon.ts +53 -0
- package/src/console/ui-next/src/features/flows/traces/waterfall-bars.test.ts +93 -0
- package/src/console/ui-next/src/features/flows/traces/waterfall-bars.ts +80 -0
- package/src/console/ui-next/src/features/flows/traces/waterfall-timeline.test.ts +121 -0
- package/src/console/ui-next/src/features/flows/traces/waterfall-timeline.ts +230 -0
- package/src/console/ui-next/src/features/flows/traces/waterfall-tooltip.test.ts +51 -0
- package/src/console/ui-next/src/features/flows/traces/waterfall-tooltip.ts +20 -0
- package/src/console/ui-next/src/features/not-found/not-found-page.tsx +23 -0
- package/src/console/ui-next/src/features/observability/data/use-ai-list.ts +26 -0
- package/src/console/ui-next/src/features/observability/data/use-clock-list.ts +27 -0
- package/src/console/ui-next/src/features/observability/data/use-instances-list.ts +27 -0
- package/src/console/ui-next/src/features/observability/data/use-runs-query.ts +39 -0
- package/src/console/ui-next/src/features/observability/data/use-signals-list.ts +25 -0
- package/src/console/ui-next/src/features/observability/detail/ai-rail.tsx +77 -0
- package/src/console/ui-next/src/features/observability/detail/instance-fleet-sheet.tsx +111 -0
- package/src/console/ui-next/src/features/observability/detail/metrics-chart.tsx +111 -0
- package/src/console/ui-next/src/features/observability/detail/metrics-panel.tsx +154 -0
- package/src/console/ui-next/src/features/observability/explorer/error-list.tsx +139 -0
- package/src/console/ui-next/src/features/observability/explorer/error-row.tsx +84 -0
- package/src/console/ui-next/src/features/observability/explorer/health-strip.tsx +146 -0
- package/src/console/ui-next/src/features/observability/lib/ask-count.test.ts +47 -0
- package/src/console/ui-next/src/features/observability/lib/ask-count.ts +44 -0
- package/src/console/ui-next/src/features/observability/lib/health-cells.test.ts +243 -0
- package/src/console/ui-next/src/features/observability/lib/health-cells.ts +207 -0
- package/src/console/ui-next/src/features/observability/lib/run-fixture.ts +43 -0
- package/src/console/ui-next/src/features/observability/lib/time-buckets.test.ts +61 -0
- package/src/console/ui-next/src/features/observability/lib/time-buckets.ts +126 -0
- package/src/console/ui-next/src/features/observability/lib/token-count.test.ts +75 -0
- package/src/console/ui-next/src/features/observability/lib/token-count.ts +70 -0
- package/src/console/ui-next/src/features/observability/lib/top-errors.test.ts +89 -0
- package/src/console/ui-next/src/features/observability/lib/top-errors.ts +135 -0
- package/src/console/ui-next/src/features/observability/lib/window-stats.test.ts +62 -0
- package/src/console/ui-next/src/features/observability/lib/window-stats.ts +124 -0
- package/src/console/ui-next/src/features/observability/observability-page.tsx +217 -0
- package/src/console/ui-next/src/features/observability/query/runs-query-panel.tsx +91 -0
- package/src/console/ui-next/src/features/observability/state/observability-selection.test.ts +27 -0
- package/src/console/ui-next/src/features/observability/state/observability-selection.ts +121 -0
- package/src/console/ui-next/src/features/setup/auth-gate.test.ts +17 -0
- package/src/console/ui-next/src/features/setup/auth-gate.ts +21 -0
- package/src/console/ui-next/src/features/setup/claim-page.tsx +418 -0
- package/src/console/ui-next/src/features/store/data/use-gates.ts +26 -0
- package/src/console/ui-next/src/features/store/data/use-store-edit.ts +92 -0
- package/src/console/ui-next/src/features/store/data/use-store-files.ts +96 -0
- package/src/console/ui-next/src/features/store/data/use-store-kv-stats.ts +47 -0
- package/src/console/ui-next/src/features/store/data/use-store-query.test.ts +42 -0
- package/src/console/ui-next/src/features/store/data/use-store-query.ts +68 -0
- package/src/console/ui-next/src/features/store/data/use-store-reveal.ts +28 -0
- package/src/console/ui-next/src/features/store/data/use-store-sql-advise.ts +39 -0
- package/src/console/ui-next/src/features/store/data/use-store-sql-locks.ts +51 -0
- package/src/console/ui-next/src/features/store/data/use-store-sql-stats.ts +47 -0
- package/src/console/ui-next/src/features/store/data/use-store-sql.ts +39 -0
- package/src/console/ui-next/src/features/store/data/use-stores-list.ts +24 -0
- package/src/console/ui-next/src/features/store/detail/browse-section.tsx +692 -0
- package/src/console/ui-next/src/features/store/detail/json-value-sheet.tsx +470 -0
- package/src/console/ui-next/src/features/store/detail/resource-panel.tsx +325 -0
- package/src/console/ui-next/src/features/store/detail/reveal-cell.tsx +137 -0
- package/src/console/ui-next/src/features/store/detail/store-row-detail-sheet.tsx +225 -0
- package/src/console/ui-next/src/features/store/detail/touched-by-section.tsx +101 -0
- package/src/console/ui-next/src/features/store/explorer/store-tree.tsx +1044 -0
- package/src/console/ui-next/src/features/store/files/file-explorer.tsx +563 -0
- package/src/console/ui-next/src/features/store/files/file-kind-icon.tsx +70 -0
- package/src/console/ui-next/src/features/store/files/file-preview.tsx +338 -0
- package/src/console/ui-next/src/features/store/files/file-upload-sheet.tsx +190 -0
- package/src/console/ui-next/src/features/store/grid/catalog-advanced.tsx +80 -0
- package/src/console/ui-next/src/features/store/grid/extension-library-sheet.tsx +761 -0
- package/src/console/ui-next/src/features/store/grid/kv-add-sheet.tsx +165 -0
- package/src/console/ui-next/src/features/store/grid/pending-changes-sheet.tsx +219 -0
- package/src/console/ui-next/src/features/store/grid/rls-policy-sheet.tsx +875 -0
- package/src/console/ui-next/src/features/store/grid/sql-function-sheet.tsx +473 -0
- package/src/console/ui-next/src/features/store/grid/sql-index-sheet.tsx +355 -0
- package/src/console/ui-next/src/features/store/grid/sql-insert-sheet.tsx +177 -0
- package/src/console/ui-next/src/features/store/grid/sql-trigger-sheet.tsx +445 -0
- package/src/console/ui-next/src/features/store/grid/store-confirm-sheet.tsx +73 -0
- package/src/console/ui-next/src/features/store/grid/store-data-grid.tsx +1844 -0
- package/src/console/ui-next/src/features/store/grid/store-edit-sheet.tsx +329 -0
- package/src/console/ui-next/src/features/store/grid/store-grid-context-menu.tsx +111 -0
- package/src/console/ui-next/src/features/store/grid/store-grid-shortcuts.tsx +124 -0
- package/src/console/ui-next/src/features/store/lib/cell-selection.test.ts +125 -0
- package/src/console/ui-next/src/features/store/lib/cell-selection.ts +115 -0
- package/src/console/ui-next/src/features/store/lib/confirmation.test.ts +48 -0
- package/src/console/ui-next/src/features/store/lib/confirmation.ts +63 -0
- package/src/console/ui-next/src/features/store/lib/edit-history.test.ts +60 -0
- package/src/console/ui-next/src/features/store/lib/edit-history.ts +64 -0
- package/src/console/ui-next/src/features/store/lib/fields-from-table.ts +94 -0
- package/src/console/ui-next/src/features/store/lib/files-body.test.ts +16 -0
- package/src/console/ui-next/src/features/store/lib/files-body.ts +79 -0
- package/src/console/ui-next/src/features/store/lib/files-meta.test.ts +75 -0
- package/src/console/ui-next/src/features/store/lib/files-meta.ts +259 -0
- package/src/console/ui-next/src/features/store/lib/files-origin.test.ts +69 -0
- package/src/console/ui-next/src/features/store/lib/files-origin.ts +53 -0
- package/src/console/ui-next/src/features/store/lib/files-tree.test.ts +123 -0
- package/src/console/ui-next/src/features/store/lib/files-tree.ts +233 -0
- package/src/console/ui-next/src/features/store/lib/grid-model.test.ts +127 -0
- package/src/console/ui-next/src/features/store/lib/grid-model.ts +219 -0
- package/src/console/ui-next/src/features/store/lib/grid-transfer.test.ts +123 -0
- package/src/console/ui-next/src/features/store/lib/grid-transfer.ts +217 -0
- package/src/console/ui-next/src/features/store/lib/index-query.test.ts +30 -0
- package/src/console/ui-next/src/features/store/lib/index-query.ts +57 -0
- package/src/console/ui-next/src/features/store/lib/json-value.test.ts +141 -0
- package/src/console/ui-next/src/features/store/lib/json-value.ts +266 -0
- package/src/console/ui-next/src/features/store/lib/kv-format.test.ts +44 -0
- package/src/console/ui-next/src/features/store/lib/kv-format.ts +103 -0
- package/src/console/ui-next/src/features/store/lib/kv-meta.test.ts +43 -0
- package/src/console/ui-next/src/features/store/lib/kv-meta.ts +63 -0
- package/src/console/ui-next/src/features/store/lib/kv-query.test.ts +128 -0
- package/src/console/ui-next/src/features/store/lib/kv-query.ts +303 -0
- package/src/console/ui-next/src/features/store/lib/parse-resource-ref.ts +38 -0
- package/src/console/ui-next/src/features/store/lib/patch.test.ts +99 -0
- package/src/console/ui-next/src/features/store/lib/patch.ts +129 -0
- package/src/console/ui-next/src/features/store/lib/pending-edits.test.ts +125 -0
- package/src/console/ui-next/src/features/store/lib/pending-edits.ts +150 -0
- package/src/console/ui-next/src/features/store/lib/pending-sql.test.ts +108 -0
- package/src/console/ui-next/src/features/store/lib/pending-sql.ts +136 -0
- package/src/console/ui-next/src/features/store/lib/pg-extension-library.test.ts +117 -0
- package/src/console/ui-next/src/features/store/lib/pg-extension-library.ts +277 -0
- package/src/console/ui-next/src/features/store/lib/query-defaults.test.ts +78 -0
- package/src/console/ui-next/src/features/store/lib/query-defaults.ts +77 -0
- package/src/console/ui-next/src/features/store/lib/query-gate.test.ts +132 -0
- package/src/console/ui-next/src/features/store/lib/query-gate.ts +187 -0
- package/src/console/ui-next/src/features/store/lib/query-highlight.test.ts +103 -0
- package/src/console/ui-next/src/features/store/lib/query-highlight.ts +382 -0
- package/src/console/ui-next/src/features/store/lib/query-schema.test.ts +139 -0
- package/src/console/ui-next/src/features/store/lib/query-schema.ts +128 -0
- package/src/console/ui-next/src/features/store/lib/query-session.test.ts +91 -0
- package/src/console/ui-next/src/features/store/lib/query-session.ts +330 -0
- package/src/console/ui-next/src/features/store/lib/replica-lag.test.ts +101 -0
- package/src/console/ui-next/src/features/store/lib/replica-lag.ts +31 -0
- package/src/console/ui-next/src/features/store/lib/resource-effects.ts +12 -0
- package/src/console/ui-next/src/features/store/lib/rls-gate-catalog.test.ts +131 -0
- package/src/console/ui-next/src/features/store/lib/rls-gate-catalog.ts +274 -0
- package/src/console/ui-next/src/features/store/lib/rls-policy.test.ts +95 -0
- package/src/console/ui-next/src/features/store/lib/rls-policy.ts +290 -0
- package/src/console/ui-next/src/features/store/lib/rtl.test.ts +17 -0
- package/src/console/ui-next/src/features/store/lib/rtl.ts +15 -0
- package/src/console/ui-next/src/features/store/lib/schema-color.test.ts +91 -0
- package/src/console/ui-next/src/features/store/lib/schema-color.ts +216 -0
- package/src/console/ui-next/src/features/store/lib/schema-graph.test.ts +435 -0
- package/src/console/ui-next/src/features/store/lib/schema-graph.ts +566 -0
- package/src/console/ui-next/src/features/store/lib/sql-catalog.test.ts +60 -0
- package/src/console/ui-next/src/features/store/lib/sql-catalog.ts +98 -0
- package/src/console/ui-next/src/features/store/lib/sql-complete.test.ts +109 -0
- package/src/console/ui-next/src/features/store/lib/sql-complete.ts +385 -0
- package/src/console/ui-next/src/features/store/lib/sql-format.test.ts +35 -0
- package/src/console/ui-next/src/features/store/lib/sql-format.ts +85 -0
- package/src/console/ui-next/src/features/store/lib/sql-function.test.ts +141 -0
- package/src/console/ui-next/src/features/store/lib/sql-function.ts +195 -0
- package/src/console/ui-next/src/features/store/lib/sql-index.test.ts +101 -0
- package/src/console/ui-next/src/features/store/lib/sql-index.ts +151 -0
- package/src/console/ui-next/src/features/store/lib/sql-statements.test.ts +114 -0
- package/src/console/ui-next/src/features/store/lib/sql-statements.ts +205 -0
- package/src/console/ui-next/src/features/store/lib/sql-trigger.test.ts +125 -0
- package/src/console/ui-next/src/features/store/lib/sql-trigger.ts +210 -0
- package/src/console/ui-next/src/features/store/lib/store-tree.test.ts +220 -0
- package/src/console/ui-next/src/features/store/lib/store-tree.ts +314 -0
- package/src/console/ui-next/src/features/store/performance/advisor-enable.test.ts +16 -0
- package/src/console/ui-next/src/features/store/performance/advisor-enable.ts +26 -0
- package/src/console/ui-next/src/features/store/performance/kv-performance-panel.tsx +223 -0
- package/src/console/ui-next/src/features/store/performance/performance-panel.tsx +442 -0
- package/src/console/ui-next/src/features/store/query/query-complete.tsx +131 -0
- package/src/console/ui-next/src/features/store/query/query-console.tsx +1159 -0
- package/src/console/ui-next/src/features/store/query/query-editor.tsx +300 -0
- package/src/console/ui-next/src/features/store/query/query-gate-menu.tsx +178 -0
- package/src/console/ui-next/src/features/store/query/query-gate-parts.tsx +344 -0
- package/src/console/ui-next/src/features/store/query/query-gate-viz.tsx +166 -0
- package/src/console/ui-next/src/features/store/query/query-highlight-view.tsx +61 -0
- package/src/console/ui-next/src/features/store/query/query-results.tsx +369 -0
- package/src/console/ui-next/src/features/store/query/query-schema-panel.tsx +300 -0
- package/src/console/ui-next/src/features/store/query/sql-style-editor.tsx +73 -0
- package/src/console/ui-next/src/features/store/schema/schema-constraint-icon.tsx +108 -0
- package/src/console/ui-next/src/features/store/schema/schema-relation-edge.tsx +76 -0
- package/src/console/ui-next/src/features/store/schema/schema-relation-icon.tsx +84 -0
- package/src/console/ui-next/src/features/store/schema/schema-table-node.tsx +199 -0
- package/src/console/ui-next/src/features/store/schema/schema-visualizer.tsx +273 -0
- package/src/console/ui-next/src/features/store/state/store-selection.test.ts +38 -0
- package/src/console/ui-next/src/features/store/state/store-selection.ts +154 -0
- package/src/console/ui-next/src/features/store/store-page.tsx +180 -0
- package/src/console/ui-next/src/features/units/call/call-api-panel.tsx +1247 -0
- package/src/console/ui-next/src/features/units/call/call-identity-menu.tsx +226 -0
- package/src/console/ui-next/src/features/units/call/call-pii-button.tsx +60 -0
- package/src/console/ui-next/src/features/units/data/use-flows-invoke.ts +75 -0
- package/src/console/ui-next/src/features/units/detail/effects-summary.tsx +80 -0
- package/src/console/ui-next/src/features/units/detail/errors-section.tsx +64 -0
- package/src/console/ui-next/src/features/units/detail/flow-activity-strip.tsx +119 -0
- package/src/console/ui-next/src/features/units/detail/flow-contract-panel.tsx +335 -0
- package/src/console/ui-next/src/features/units/detail/schema-fields.tsx +149 -0
- package/src/console/ui-next/src/features/units/detail/validation-section.tsx +66 -0
- package/src/console/ui-next/src/features/units/explorer/units-tree.tsx +644 -0
- package/src/console/ui-next/src/features/units/lib/call-invoke-as.test.ts +40 -0
- package/src/console/ui-next/src/features/units/lib/call-read-safe.test.ts +38 -0
- package/src/console/ui-next/src/features/units/lib/call-read-safe.ts +32 -0
- package/src/console/ui-next/src/features/units/lib/call-timing.test.ts +28 -0
- package/src/console/ui-next/src/features/units/lib/call-timing.ts +34 -0
- package/src/console/ui-next/src/features/units/lib/contract-input.test.ts +47 -0
- package/src/console/ui-next/src/features/units/lib/contract-input.ts +68 -0
- package/src/console/ui-next/src/features/units/lib/fields-from-schema.test.ts +119 -0
- package/src/console/ui-next/src/features/units/lib/fields-from-schema.ts +329 -0
- package/src/console/ui-next/src/features/units/lib/fk-lookup.test.ts +103 -0
- package/src/console/ui-next/src/features/units/lib/fk-lookup.ts +175 -0
- package/src/console/ui-next/src/features/units/lib/flow-activity.test.ts +76 -0
- package/src/console/ui-next/src/features/units/lib/flow-activity.ts +68 -0
- package/src/console/ui-next/src/features/units/lib/flow-trigger.test.ts +63 -0
- package/src/console/ui-next/src/features/units/lib/flow-trigger.ts +120 -0
- package/src/console/ui-next/src/features/units/lib/invoke-cache.test.ts +31 -0
- package/src/console/ui-next/src/features/units/lib/invoke-cache.ts +22 -0
- package/src/console/ui-next/src/features/units/lib/invoke-response.test.ts +76 -0
- package/src/console/ui-next/src/features/units/lib/invoke-response.ts +70 -0
- package/src/console/ui-next/src/features/units/lib/path-params.test.ts +43 -0
- package/src/console/ui-next/src/features/units/lib/path-params.ts +75 -0
- package/src/console/ui-next/src/features/units/lib/resolve-clock.test.ts +106 -0
- package/src/console/ui-next/src/features/units/lib/resolve-clock.ts +79 -0
- package/src/console/ui-next/src/features/units/lib/schema-type-visual.ts +28 -0
- package/src/console/ui-next/src/features/units/lib/signal-delivery.test.ts +29 -0
- package/src/console/ui-next/src/features/units/lib/signal-delivery.ts +67 -0
- package/src/console/ui-next/src/features/units/lib/unit-tree.test.ts +289 -0
- package/src/console/ui-next/src/features/units/lib/unit-tree.ts +307 -0
- package/src/console/ui-next/src/features/units/lib/validate-contract.ts +103 -0
- package/src/console/ui-next/src/features/units/state/units-selection.ts +49 -0
- package/src/console/ui-next/src/features/units/units-page.tsx +120 -0
- package/src/console/ui-next/src/features/vault/data/use-vault-list.ts +27 -0
- package/src/console/ui-next/src/features/vault/detail/vault-detail.tsx +831 -0
- package/src/console/ui-next/src/features/vault/detail/vault-overview.tsx +71 -0
- package/src/console/ui-next/src/features/vault/explorer/vault-list.tsx +291 -0
- package/src/console/ui-next/src/features/vault/explorer/vault-posture-strip.tsx +131 -0
- package/src/console/ui-next/src/features/vault/explorer/vault-search.tsx +126 -0
- package/src/console/ui-next/src/features/vault/lib/backend.test.ts +147 -0
- package/src/console/ui-next/src/features/vault/lib/backend.ts +216 -0
- package/src/console/ui-next/src/features/vault/lib/blast-radius.ts +53 -0
- package/src/console/ui-next/src/features/vault/lib/confirmation.test.ts +41 -0
- package/src/console/ui-next/src/features/vault/lib/confirmation.ts +50 -0
- package/src/console/ui-next/src/features/vault/lib/contract-ops.test.ts +35 -0
- package/src/console/ui-next/src/features/vault/lib/contract-ops.ts +94 -0
- package/src/console/ui-next/src/features/vault/lib/dormant.ts +28 -0
- package/src/console/ui-next/src/features/vault/lib/export-safe.test.ts +25 -0
- package/src/console/ui-next/src/features/vault/lib/export-safe.ts +62 -0
- package/src/console/ui-next/src/features/vault/lib/fixture.ts +92 -0
- package/src/console/ui-next/src/features/vault/lib/group.test.ts +31 -0
- package/src/console/ui-next/src/features/vault/lib/group.ts +43 -0
- package/src/console/ui-next/src/features/vault/lib/posture.test.ts +137 -0
- package/src/console/ui-next/src/features/vault/lib/posture.ts +275 -0
- package/src/console/ui-next/src/features/vault/lib/progress.test.ts +36 -0
- package/src/console/ui-next/src/features/vault/lib/progress.ts +51 -0
- package/src/console/ui-next/src/features/vault/lib/search.test.ts +139 -0
- package/src/console/ui-next/src/features/vault/lib/search.ts +403 -0
- package/src/console/ui-next/src/features/vault/lib/theme.ts +14 -0
- package/src/console/ui-next/src/features/vault/lib/types.ts +114 -0
- package/src/console/ui-next/src/features/vault/lib/write-review.test.ts +139 -0
- package/src/console/ui-next/src/features/vault/lib/write-review.ts +115 -0
- package/src/console/ui-next/src/features/vault/sheets/vault-create-sheet.tsx +209 -0
- package/src/console/ui-next/src/features/vault/sheets/vault-master-key-sheet.tsx +87 -0
- package/src/console/ui-next/src/features/vault/sheets/vault-rotate-master-sheet.tsx +43 -0
- package/src/console/ui-next/src/features/vault/sheets/vault-security-sheet.tsx +205 -0
- package/src/console/ui-next/src/features/vault/sheets/vault-verify-sheet.tsx +103 -0
- package/src/console/ui-next/src/features/vault/sheets/vault-write-review-dialog.test.tsx +175 -0
- package/src/console/ui-next/src/features/vault/sheets/vault-write-review-dialog.tsx +135 -0
- package/src/console/ui-next/src/features/vault/sheets/vault-write-sheet.tsx +224 -0
- package/src/console/ui-next/src/features/vault/state/vault-selection.test.ts +20 -0
- package/src/console/ui-next/src/features/vault/state/vault-selection.ts +87 -0
- package/src/console/ui-next/src/features/vault/vault-page.tsx +439 -0
- package/src/console/ui-next/src/hooks/use-mobile.ts +22 -0
- package/src/console/ui-next/src/lib/document-meta.test.ts +43 -0
- package/src/console/ui-next/src/lib/document-meta.ts +34 -0
- package/src/console/ui-next/src/lib/ease.ts +59 -0
- package/src/console/ui-next/src/lib/element-icons.test.ts +38 -0
- package/src/console/ui-next/src/lib/element-icons.ts +75 -0
- package/src/console/ui-next/src/lib/highlight.test.ts +30 -0
- package/src/console/ui-next/src/lib/highlight.ts +39 -0
- package/src/console/ui-next/src/lib/hooks/use-hover-capable.ts +30 -0
- package/src/console/ui-next/src/lib/last-module-search.test.ts +47 -0
- package/src/console/ui-next/src/lib/last-module-search.ts +164 -0
- package/src/console/ui-next/src/lib/motion.ts +16 -0
- package/src/console/ui-next/src/lib/shiki.ts +42 -0
- package/src/console/ui-next/src/lib/shortcut-keys.tsx +47 -0
- package/src/console/ui-next/src/lib/shortcut.test.ts +70 -0
- package/src/console/ui-next/src/lib/shortcut.ts +111 -0
- package/src/console/ui-next/src/lib/use-console-shortcuts.ts +56 -0
- package/src/console/ui-next/src/lib/use-last-module-search.ts +37 -0
- package/src/console/ui-next/src/lib/utils.ts +15 -0
- package/src/console/ui-next/src/main.tsx +44 -0
- package/src/console/ui-next/src/router.tsx +175 -0
- package/src/console/ui-next/src/styles.css +384 -0
- package/src/console/ui-next/src/vite-env.d.ts +17 -0
- package/src/console/ui-next/tsconfig.json +25 -0
- package/src/console/ui-next/ui-next-dev-operator.test.ts +76 -0
- package/src/console/ui-next/ui-next-dev-operator.ts +81 -0
- package/src/console/ui-next/ui-next-seed-app-schema.ts +526 -0
- package/src/console/ui-next/ui-next-seed-manifest-surface.ts +882 -0
- package/src/console/ui-next/ui-next-seed-manifest.ts +635 -0
- package/src/console/ui-next/ui-next-seed-runs.ts +1429 -0
- package/src/console/ui-next/ui-next-seed-store.ts +1125 -0
- package/src/console/ui-next/ui-next-seed.test.ts +511 -0
- package/src/console/ui-next/ui-next-seed.ts +122 -0
- package/src/console/ui-next/vite-console-kernel-plugin.ts +195 -0
- package/src/console/ui-next/vite.config.ts +88 -0
- package/src/console/xss.gate.test.ts +21 -26
- package/src/docker/compose.ts +26 -7
- package/src/docker/derive.ts +67 -13
- package/src/docker/docker.test.ts +219 -27
- package/src/docker/helpers.ts +20 -0
- package/src/docker/images-config.test.ts +29 -22
- package/src/docker/index.ts +8 -0
- package/src/docker/postgres-advisor.integration.test.ts +163 -0
- package/src/docker/query-passthrough.integration.test.ts +212 -0
- package/src/docker/recipes/index.ts +13 -0
- package/src/docker/recipes/llama-cpp.ts +3 -3
- package/src/docker/recipes/nginx.ts +61 -0
- package/src/docker/recipes/ollama.ts +1 -1
- package/src/docker/recipes/postgres-advisor.ts +58 -0
- package/src/docker/recipes/postgres.ts +6 -2
- package/src/docker/recipes/sglang.ts +1 -1
- package/src/docker/recipes/timescale.ts +6 -2
- package/src/docker/recipes/traefik.ts +1 -0
- package/src/docker/recipes/vllm.ts +1 -1
- package/src/docker/stack-id.test.ts +5 -14
- package/src/docker/stack-id.ts +15 -35
- package/src/docker/stack.integration.test.ts +2 -2
- package/src/docker/types.ts +16 -7
- package/src/drivers/ai-mock.ts +41 -1
- package/src/drivers/ai-openai-compatible.ts +19 -1
- package/src/drivers/index.ts +32 -0
- package/src/drivers/instances-postgres.ts +154 -0
- package/src/drivers/meilisearch.integration.test.ts +9 -0
- package/src/drivers/meilisearch.test.ts +134 -6
- package/src/drivers/meilisearch.ts +77 -8
- package/src/drivers/memory.ts +384 -24
- package/src/drivers/pg-extensions.test.ts +50 -0
- package/src/drivers/pg-extensions.ts +1054 -0
- package/src/drivers/pg-rls.test.ts +71 -0
- package/src/drivers/pg-rls.ts +234 -0
- package/src/drivers/pgvector.ts +24 -0
- package/src/drivers/redis.ts +12 -0
- package/src/drivers/s3-ensure-bucket.test.ts +88 -0
- package/src/drivers/s3-ensure-bucket.ts +152 -0
- package/src/drivers/s3.ts +34 -2
- package/src/drivers/types.ts +28 -0
- package/src/drivers/vault-1password.test.ts +164 -0
- package/src/drivers/vault-1password.ts +351 -0
- package/src/drivers/vault-aws-secrets-manager.ts +15 -94
- package/src/drivers/vault-azure-key-vault.test.ts +137 -0
- package/src/drivers/vault-azure-key-vault.ts +243 -0
- package/src/drivers/vault-doppler.test.ts +133 -0
- package/src/drivers/vault-doppler.ts +202 -0
- package/src/drivers/vault-dotenv-parse.ts +32 -0
- package/src/drivers/vault-env.ts +1 -1
- package/src/drivers/vault-gcp-secret-manager.test.ts +127 -0
- package/src/drivers/vault-gcp-secret-manager.ts +291 -0
- package/src/drivers/vault-managed.test.ts +23 -26
- package/src/drivers/vault-managed.ts +58 -20
- package/src/drivers/vault-remote-bag.ts +242 -0
- package/src/drivers/vault-types.ts +9 -7
- package/src/elements/ai/runtime.ts +100 -8
- package/src/elements/ai/schema.test.ts +133 -0
- package/src/elements/ai/schema.ts +156 -11
- package/src/elements/ai.test.ts +53 -0
- package/src/elements/ai.ts +1 -0
- package/src/elements/clock/runtime.ts +31 -13
- package/src/elements/clock.test.ts +49 -0
- package/src/elements/gate/config.ts +18 -3
- package/src/elements/gate/declare.ts +25 -5
- package/src/elements/gate/flatten.ts +74 -0
- package/src/elements/gate/permissions.ts +1 -0
- package/src/elements/gate/runtime.ts +16 -4
- package/src/elements/gate.test.ts +32 -0
- package/src/elements/gate.ts +9 -1
- package/src/elements/store/cache.test.ts +79 -0
- package/src/elements/store/cache.ts +176 -0
- package/src/elements/store/classify.ts +79 -4
- package/src/elements/store/emit-drizzle.ts +3 -1
- package/src/elements/store/files-policy.test.ts +36 -1
- package/src/elements/store/files-policy.ts +151 -0
- package/src/elements/store/resource-list-docs.fixture.ts +0 -2
- package/src/elements/store/resource-list-docs.test.ts +3 -0
- package/src/elements/store/resource.test.ts +62 -2
- package/src/elements/store/resource.ts +279 -62
- package/src/elements/store/runtime.ts +53 -2
- package/src/elements/store/schema-decl.test.ts +49 -0
- package/src/elements/store/schema-decl.ts +29 -9
- package/src/elements/store/seed.test.ts +22 -1
- package/src/elements/store/seed.ts +46 -1
- package/src/elements/store/sql-session.ts +32 -7
- package/src/elements/store/table.ts +17 -1
- package/src/elements/store/upsert-app.test.ts +1 -1
- package/src/elements/store.test.ts +21 -0
- package/src/elements/store.ts +26 -3
- package/src/elements/vault/boot-chain.test.ts +108 -10
- package/src/elements/vault/boot-chain.ts +15 -15
- package/src/elements/vault/builtin-adapter.test.ts +1 -0
- package/src/elements/vault/builtin-adapter.ts +12 -0
- package/src/elements/vault/chain.ts +6 -20
- package/src/elements/vault/declare.ts +5 -2
- package/src/elements/vault/runtime.ts +47 -13
- package/src/elements/vault/storage.ts +35 -4
- package/src/elements/vault.test.ts +1 -0
- package/src/elements/vault.ts +2 -0
- package/src/full.ts +10 -0
- package/src/http.ts +1 -1
- package/src/index.ts +8 -0
- package/src/kernel/adopt-barrel-fresh.test.ts +1 -2
- package/src/kernel/app-auth.ts +8 -1
- package/src/kernel/app.ts +245 -25
- package/src/kernel/auth-resolve.ts +51 -0
- package/src/kernel/auto-cache.test.ts +270 -0
- package/src/kernel/boot-bind/ai.test.ts +34 -1
- package/src/kernel/boot-bind/ai.ts +15 -2
- package/src/kernel/boot-bind/channel.test.ts +1 -1
- package/src/kernel/boot-bind/channel.ts +1 -1
- package/src/kernel/boot-bind/clock.ts +9 -7
- package/src/kernel/boot-bind/gate.ts +1 -1
- package/src/kernel/boot-bind/honor-config.test.ts +70 -3
- package/src/kernel/boot-bind/instances.ts +58 -0
- package/src/kernel/boot-bind/journal.ts +3 -2
- package/src/kernel/boot-bind/runs.ts +63 -5
- package/src/kernel/boot-bind/signal.ts +1 -1
- package/src/kernel/boot-bind/store.ts +4 -4
- package/src/kernel/boot.test.ts +9 -9
- package/src/kernel/boot.ts +115 -16
- package/src/kernel/capability.test.ts +42 -0
- package/src/kernel/capability.ts +44 -2
- package/src/kernel/compensate.test.ts +34 -1
- package/src/kernel/compensate.ts +19 -0
- package/src/kernel/effect-timing.test.ts +16 -0
- package/src/kernel/effects-stamping.test.ts +3 -3
- package/src/kernel/effects.test.ts +15 -0
- package/src/kernel/effects.ts +39 -5
- package/src/kernel/elapsed.test.ts +26 -0
- package/src/kernel/elapsed.ts +23 -0
- package/src/kernel/errors.ts +26 -3
- package/src/kernel/flow.ts +5 -1
- package/src/kernel/fx-ask-telemetry.test.ts +114 -0
- package/src/kernel/fx.test.ts +143 -2
- package/src/kernel/fx.ts +136 -19
- package/src/kernel/graceful-shutdown.test.ts +20 -0
- package/src/kernel/graceful-shutdown.ts +9 -3
- package/src/kernel/horizontal-child.ts +4 -4
- package/src/kernel/http-query.test.ts +184 -0
- package/src/kernel/http-resource.ts +55 -0
- package/src/kernel/index.ts +43 -0
- package/src/kernel/instance-id.ts +23 -0
- package/src/kernel/instances-chaos-child.ts +73 -0
- package/src/kernel/instances.chaos.test.ts +238 -0
- package/src/kernel/instances.test.ts +85 -0
- package/src/kernel/instances.ts +372 -0
- package/src/kernel/lazy-require.ts +20 -0
- package/src/kernel/list-page.test.ts +194 -0
- package/src/kernel/list-page.ts +515 -0
- package/src/kernel/list-query.ts +469 -0
- package/src/kernel/pipeline-api-key.test.ts +266 -0
- package/src/kernel/pipeline.test.ts +164 -2
- package/src/kernel/pipeline.ts +13 -1
- package/src/kernel/plugin-elements.test.ts +1 -1
- package/src/kernel/plugin-needs.test.ts +1 -1
- package/src/kernel/plugin.ts +5 -5
- package/src/kernel/ready.test.ts +22 -2
- package/src/kernel/registry.ts +8 -4
- package/src/kernel/resource-mount.test.ts +75 -0
- package/src/kernel/router/index.ts +2 -0
- package/src/kernel/router/linear.ts +7 -0
- package/src/kernel/router/regexp.ts +8 -0
- package/src/kernel/router/smart.ts +7 -3
- package/src/kernel/router/trie.ts +7 -0
- package/src/kernel/router/types.ts +41 -1
- package/src/kernel/router.test.ts +27 -0
- package/src/kernel/router.ts +2 -0
- package/src/kernel/run-duration.test.ts +92 -0
- package/src/kernel/run-telemetry.ts +8 -2
- package/src/kernel/triggers.ts +95 -74
- package/src/manifest/sql-resource.test.ts +29 -0
- package/src/manifest/sql-resource.ts +20 -4
- package/src/manifest/types.ts +8 -3
- package/src/plugins/auth-delivery.mailpit.integration.test.ts +1 -1
- package/src/plugins/auth-methods.security.test.ts +3 -3
- package/src/plugins/auth-methods.test.ts +2 -2
- package/src/plugins/cors.test.ts +4 -2
- package/src/plugins/cors.ts +11 -2
- package/src/plugins/csrf.test.ts +17 -0
- package/src/plugins/csrf.ts +1 -1
- package/src/plugins/username-policy.test.ts +8 -8
- package/src/plugins/username.ts +1 -1
- package/src/release/build-lib.ts +7 -1
- package/src/release/limits.ts +2 -2
- package/src/release/measure.ts +7 -10
- package/src/runs/bridge-to-console.ts +99 -0
- package/src/runs/collect.test.ts +68 -0
- package/src/runs/collect.ts +29 -2
- package/src/runs/drivers/clickhouse.ts +4 -1
- package/src/runs/drivers/files.ts +138 -33
- package/src/runs/drivers/memory.ts +46 -7
- package/src/runs/drivers/postgres.ts +4 -1
- package/src/runs/duckdb.test.ts +33 -0
- package/src/runs/duckdb.ts +41 -0
- package/src/runs/history.ts +61 -0
- package/src/runs/index.ts +29 -1
- package/src/runs/parquet.test.ts +110 -0
- package/src/runs/parquet.ts +129 -8
- package/src/runs/retention.test.ts +24 -0
- package/src/runs/retention.ts +42 -0
- package/src/runs/runs.test.ts +101 -0
- package/src/runs/runtime.ts +5 -3
- package/src/runs/types.ts +33 -4
- package/src/runtime/bun.ts +61 -4
- package/src/runtime/dev-request-log.test.ts +4 -0
- package/src/runtime/dev-request-log.ts +19 -2
- package/src/runtime/index.ts +8 -1
- package/src/runtime/json-code-block.test.ts +355 -0
- package/src/runtime/json-code-block.ts +961 -0
- package/src/runtime/serve.test.ts +49 -4
- package/src/term.test.ts +89 -1
- package/src/term.ts +103 -29
- package/src/test/create-test-app.ts +3 -1
- package/src/console/ui/access/AccessA11yView.tsx +0 -222
- package/src/console/ui/access/a11y.test.tsx +0 -113
- package/src/console/ui/access/acknowledgement.test.ts +0 -10
- package/src/console/ui/access/acknowledgement.ts +0 -33
- package/src/console/ui/access/blast-radius.test.ts +0 -26
- package/src/console/ui/access/blast-radius.ts +0 -38
- package/src/console/ui/access/confirmation.test.ts +0 -34
- package/src/console/ui/access/confirmation.ts +0 -33
- package/src/console/ui/access/fixture.ts +0 -199
- package/src/console/ui/access/grantable.test.ts +0 -15
- package/src/console/ui/access/grantable.ts +0 -31
- package/src/console/ui/access/hygiene.test.ts +0 -12
- package/src/console/ui/access/hygiene.ts +0 -39
- package/src/console/ui/access/index.ts +0 -47
- package/src/console/ui/access/provenance.test.ts +0 -10
- package/src/console/ui/access/provenance.ts +0 -25
- package/src/console/ui/access/search.test.ts +0 -13
- package/src/console/ui/access/search.ts +0 -68
- package/src/console/ui/access/types.ts +0 -111
- package/src/console/ui/ai/AiA11yView.tsx +0 -254
- package/src/console/ui/ai/a11y.test.tsx +0 -96
- package/src/console/ui/ai/findings.ts +0 -41
- package/src/console/ui/ai/fixture.ts +0 -177
- package/src/console/ui/ai/format.ts +0 -88
- package/src/console/ui/ai/group.test.ts +0 -35
- package/src/console/ui/ai/group.ts +0 -80
- package/src/console/ui/ai/index.ts +0 -59
- package/src/console/ui/ai/promotion.test.ts +0 -72
- package/src/console/ui/ai/promotion.ts +0 -141
- package/src/console/ui/ai/search.test.ts +0 -31
- package/src/console/ui/ai/search.ts +0 -79
- package/src/console/ui/ai/types.ts +0 -132
- package/src/console/ui/architecture/ArchitectureA11yView.tsx +0 -142
- package/src/console/ui/architecture/a11y.test.tsx +0 -96
- package/src/console/ui/architecture/boundary.ts +0 -42
- package/src/console/ui/architecture/declared.ts +0 -161
- package/src/console/ui/architecture/fixture.ts +0 -74
- package/src/console/ui/architecture/index.ts +0 -56
- package/src/console/ui/architecture/layers.ts +0 -64
- package/src/console/ui/architecture/layout.ts +0 -66
- package/src/console/ui/architecture/pathologies.ts +0 -251
- package/src/console/ui/architecture/search.ts +0 -136
- package/src/console/ui/architecture/traffic.ts +0 -92
- package/src/console/ui/architecture/types.ts +0 -136
- package/src/console/ui/architecture/view.test.ts +0 -153
- package/src/console/ui/architecture/view.ts +0 -489
- package/src/console/ui/channels/ChannelsA11yView.tsx +0 -171
- package/src/console/ui/channels/a11y.test.tsx +0 -95
- package/src/console/ui/channels/confirmation.test.ts +0 -34
- package/src/console/ui/channels/confirmation.ts +0 -24
- package/src/console/ui/channels/fallback.test.ts +0 -15
- package/src/console/ui/channels/fallback.ts +0 -20
- package/src/console/ui/channels/findings.ts +0 -34
- package/src/console/ui/channels/fixture.ts +0 -134
- package/src/console/ui/channels/group.ts +0 -25
- package/src/console/ui/channels/index.ts +0 -51
- package/src/console/ui/channels/locale.test.ts +0 -15
- package/src/console/ui/channels/locale.ts +0 -25
- package/src/console/ui/channels/mask.test.ts +0 -14
- package/src/console/ui/channels/mask.ts +0 -12
- package/src/console/ui/channels/search.ts +0 -49
- package/src/console/ui/channels/taxonomy.test.ts +0 -17
- package/src/console/ui/channels/taxonomy.ts +0 -47
- package/src/console/ui/channels/types.ts +0 -118
- package/src/console/ui/clock/ClockA11yView.tsx +0 -165
- package/src/console/ui/clock/a11y.test.tsx +0 -96
- package/src/console/ui/clock/confirmation.test.ts +0 -30
- package/src/console/ui/clock/confirmation.ts +0 -31
- package/src/console/ui/clock/findings.ts +0 -37
- package/src/console/ui/clock/fixture.ts +0 -111
- package/src/console/ui/clock/health.test.ts +0 -25
- package/src/console/ui/clock/health.ts +0 -56
- package/src/console/ui/clock/index.ts +0 -41
- package/src/console/ui/clock/search.test.ts +0 -37
- package/src/console/ui/clock/search.ts +0 -72
- package/src/console/ui/clock/timeline.test.ts +0 -42
- package/src/console/ui/clock/timeline.ts +0 -41
- package/src/console/ui/clock/types.ts +0 -79
- package/src/console/ui/clock/waiting-on.test.ts +0 -30
- package/src/console/ui/clock/waiting-on.ts +0 -78
- package/src/console/ui/confirmation.unify.test.ts +0 -92
- package/src/console/ui/diff/DiffA11yView.tsx +0 -76
- package/src/console/ui/diff/a11y.test.tsx +0 -96
- package/src/console/ui/diff/fixture.ts +0 -85
- package/src/console/ui/diff/group.test.ts +0 -48
- package/src/console/ui/diff/group.ts +0 -91
- package/src/console/ui/diff/index.ts +0 -32
- package/src/console/ui/diff/search.test.ts +0 -28
- package/src/console/ui/diff/search.ts +0 -63
- package/src/console/ui/diff/summary.ts +0 -73
- package/src/console/ui/diff/types.ts +0 -48
- package/src/console/ui/display.test.ts +0 -14
- package/src/console/ui/display.ts +0 -9
- package/src/console/ui/dist/assets/index--Y0Uaz-m.js +0 -10
- package/src/console/ui/dist/assets/panel-access-ri1X9Otj.js +0 -64
- package/src/console/ui/dist/assets/panel-ai-DLHjRoJk.js +0 -1
- package/src/console/ui/dist/assets/panel-architecture-DI3bQF3J.js +0 -1
- package/src/console/ui/dist/assets/panel-channels-BDYWX29p.js +0 -1
- package/src/console/ui/dist/assets/panel-clock-i-JpTjVB.js +0 -1
- package/src/console/ui/dist/assets/panel-diff-CFuWxiXy.js +0 -1
- package/src/console/ui/dist/assets/panel-flows-B8TRhcoe.js +0 -48
- package/src/console/ui/dist/assets/panel-gates-CfkBgco7.js +0 -1
- package/src/console/ui/dist/assets/panel-overview-CW0CQEc2.js +0 -1
- package/src/console/ui/dist/assets/panel-plugins-DDJwTehL.js +0 -1
- package/src/console/ui/dist/assets/panel-runs-BxuyDI3x.js +0 -1
- package/src/console/ui/dist/assets/panel-signals-BXofbj7v.js +0 -1
- package/src/console/ui/dist/assets/panel-store-B8mH-arU.js +0 -1
- package/src/console/ui/dist/assets/panel-traces-DSA-ZWnf.js +0 -1
- package/src/console/ui/dist/assets/panel-vault-BkZdJPX8.js +0 -1
- package/src/console/ui/dist/assets/rolldown-runtime-B0Z9INg1.js +0 -1
- package/src/console/ui/dist/assets/style-C3L349iZ.css +0 -3
- package/src/console/ui/dist/favicon.svg +0 -7
- package/src/console/ui/dist/index.html +0 -15
- package/src/console/ui/flows/FlowsA11yView.tsx +0 -140
- package/src/console/ui/flows/a11y.test.tsx +0 -99
- package/src/console/ui/flows/buffer.test.ts +0 -83
- package/src/console/ui/flows/buffer.ts +0 -111
- package/src/console/ui/flows/confirmation.ts +0 -129
- package/src/console/ui/flows/contract.test.ts +0 -85
- package/src/console/ui/flows/contract.ts +0 -329
- package/src/console/ui/flows/fixture.ts +0 -81
- package/src/console/ui/flows/graph.test.ts +0 -93
- package/src/console/ui/flows/graph.ts +0 -539
- package/src/console/ui/flows/index.ts +0 -82
- package/src/console/ui/flows/save-as-test.test.ts +0 -47
- package/src/console/ui/flows/save-as-test.ts +0 -97
- package/src/console/ui/flows/search.ts +0 -238
- package/src/console/ui/flows/tiers.ts +0 -133
- package/src/console/ui/gates/GatesA11yView.tsx +0 -183
- package/src/console/ui/gates/a11y.test.tsx +0 -113
- package/src/console/ui/gates/audit.test.ts +0 -40
- package/src/console/ui/gates/audit.ts +0 -61
- package/src/console/ui/gates/denial.test.ts +0 -34
- package/src/console/ui/gates/denial.ts +0 -43
- package/src/console/ui/gates/findings.ts +0 -17
- package/src/console/ui/gates/fixture.ts +0 -193
- package/src/console/ui/gates/group.test.ts +0 -30
- package/src/console/ui/gates/group.ts +0 -94
- package/src/console/ui/gates/index.ts +0 -39
- package/src/console/ui/gates/search.test.ts +0 -49
- package/src/console/ui/gates/search.ts +0 -108
- package/src/console/ui/gates/types.ts +0 -124
- package/src/console/ui/overview/OverviewA11yView.tsx +0 -134
- package/src/console/ui/overview/a11y.test.tsx +0 -112
- package/src/console/ui/overview/busiest.ts +0 -24
- package/src/console/ui/overview/compose.ts +0 -121
- package/src/console/ui/overview/cost.test.ts +0 -39
- package/src/console/ui/overview/cost.ts +0 -134
- package/src/console/ui/overview/fixture.ts +0 -156
- package/src/console/ui/overview/golden.ts +0 -47
- package/src/console/ui/overview/index.ts +0 -52
- package/src/console/ui/overview/rank.test.ts +0 -129
- package/src/console/ui/overview/rank.ts +0 -205
- package/src/console/ui/overview/slo.test.ts +0 -69
- package/src/console/ui/overview/slo.ts +0 -240
- package/src/console/ui/overview/types.ts +0 -127
- package/src/console/ui/overview/verdict.ts +0 -124
- package/src/console/ui/plugins/PluginsA11yView.tsx +0 -217
- package/src/console/ui/plugins/a11y.test.tsx +0 -96
- package/src/console/ui/plugins/command.test.ts +0 -22
- package/src/console/ui/plugins/command.ts +0 -27
- package/src/console/ui/plugins/findings.ts +0 -39
- package/src/console/ui/plugins/fixture.ts +0 -238
- package/src/console/ui/plugins/group.test.ts +0 -36
- package/src/console/ui/plugins/group.ts +0 -62
- package/src/console/ui/plugins/index.ts +0 -30
- package/src/console/ui/plugins/search.ts +0 -55
- package/src/console/ui/plugins/types.ts +0 -118
- package/src/console/ui/runs/RunsA11yView.tsx +0 -252
- package/src/console/ui/runs/a11y.test.tsx +0 -96
- package/src/console/ui/runs/errors.test.ts +0 -53
- package/src/console/ui/runs/errors.ts +0 -88
- package/src/console/ui/runs/explain.test.ts +0 -23
- package/src/console/ui/runs/explain.ts +0 -28
- package/src/console/ui/runs/fixture.ts +0 -189
- package/src/console/ui/runs/group.test.ts +0 -24
- package/src/console/ui/runs/group.ts +0 -76
- package/src/console/ui/runs/histogram.test.ts +0 -22
- package/src/console/ui/runs/histogram.ts +0 -82
- package/src/console/ui/runs/index.ts +0 -69
- package/src/console/ui/runs/project.ts +0 -118
- package/src/console/ui/runs/query.test.ts +0 -48
- package/src/console/ui/runs/query.ts +0 -260
- package/src/console/ui/runs/search.test.ts +0 -45
- package/src/console/ui/runs/search.ts +0 -143
- package/src/console/ui/runs/trace-link.test.ts +0 -26
- package/src/console/ui/runs/trace-link.ts +0 -87
- package/src/console/ui/runs/types.ts +0 -135
- package/src/console/ui/shell/App.tsx +0 -88
- package/src/console/ui/shell/client.ts +0 -1642
- package/src/console/ui/shell/components/oke-logo.tsx +0 -40
- package/src/console/ui/shell/components/ui.tsx +0 -111
- package/src/console/ui/shell/index.html +0 -13
- package/src/console/ui/shell/layout/Shell.tsx +0 -92
- package/src/console/ui/shell/main.tsx +0 -216
- package/src/console/ui/shell/panels/Access.tsx +0 -5
- package/src/console/ui/shell/panels/Ai.tsx +0 -5
- package/src/console/ui/shell/panels/Architecture.tsx +0 -5
- package/src/console/ui/shell/panels/Channels.tsx +0 -5
- package/src/console/ui/shell/panels/Clock.tsx +0 -5
- package/src/console/ui/shell/panels/Diff.tsx +0 -5
- package/src/console/ui/shell/panels/Flows.tsx +0 -5
- package/src/console/ui/shell/panels/Gates.tsx +0 -5
- package/src/console/ui/shell/panels/Overview.tsx +0 -6
- package/src/console/ui/shell/panels/Plugins.tsx +0 -5
- package/src/console/ui/shell/panels/Runs.tsx +0 -5
- package/src/console/ui/shell/panels/Signals.tsx +0 -5
- package/src/console/ui/shell/panels/Store.tsx +0 -5
- package/src/console/ui/shell/panels/Traces.tsx +0 -5
- package/src/console/ui/shell/panels/Vault.tsx +0 -5
- package/src/console/ui/shell/panels/access/AccessPanel.tsx +0 -749
- package/src/console/ui/shell/panels/ai/AiPanel.tsx +0 -492
- package/src/console/ui/shell/panels/architecture/ArchitecturePanel.tsx +0 -329
- package/src/console/ui/shell/panels/channels/ChannelsPanel.tsx +0 -422
- package/src/console/ui/shell/panels/clock/ClockPanel.tsx +0 -454
- package/src/console/ui/shell/panels/diff/DiffPanel.tsx +0 -234
- package/src/console/ui/shell/panels/flows/ContractEditor.tsx +0 -284
- package/src/console/ui/shell/panels/flows/FlowDrawer.tsx +0 -335
- package/src/console/ui/shell/panels/flows/FlowsPanel.tsx +0 -482
- package/src/console/ui/shell/panels/gates/GatesPanel.tsx +0 -433
- package/src/console/ui/shell/panels/overview/OverviewPanel.tsx +0 -398
- package/src/console/ui/shell/panels/plugins/PluginsPanel.tsx +0 -402
- package/src/console/ui/shell/panels/runs/RunsPanel.tsx +0 -652
- package/src/console/ui/shell/panels/signals/SignalsPanel.tsx +0 -788
- package/src/console/ui/shell/panels/store/StorePanel.tsx +0 -755
- package/src/console/ui/shell/panels/traces/TracesPanel.tsx +0 -478
- package/src/console/ui/shell/panels/vault/VaultPanel.tsx +0 -477
- package/src/console/ui/shell/plugin/Sandbox.tsx +0 -29
- package/src/console/ui/shell/public/favicon.svg +0 -7
- package/src/console/ui/shell/setup/Wizard.tsx +0 -211
- package/src/console/ui/shell/styles.css +0 -74
- package/src/console/ui/signals/SignalsA11yView.tsx +0 -252
- package/src/console/ui/signals/a11y.test.tsx +0 -96
- package/src/console/ui/signals/confirmation.test.ts +0 -35
- package/src/console/ui/signals/confirmation.ts +0 -59
- package/src/console/ui/signals/dry-run.test.ts +0 -18
- package/src/console/ui/signals/dry-run.ts +0 -34
- package/src/console/ui/signals/durable.test.ts +0 -22
- package/src/console/ui/signals/durable.ts +0 -39
- package/src/console/ui/signals/findings.ts +0 -31
- package/src/console/ui/signals/fixture.ts +0 -242
- package/src/console/ui/signals/group.test.ts +0 -26
- package/src/console/ui/signals/group.ts +0 -41
- package/src/console/ui/signals/index.ts +0 -49
- package/src/console/ui/signals/monitor.test.ts +0 -30
- package/src/console/ui/signals/monitor.ts +0 -74
- package/src/console/ui/signals/schema-form.test.ts +0 -23
- package/src/console/ui/signals/schema-form.ts +0 -109
- package/src/console/ui/signals/search.ts +0 -93
- package/src/console/ui/signals/types.ts +0 -72
- package/src/console/ui/store/StoreA11yView.tsx +0 -193
- package/src/console/ui/store/a11y.test.tsx +0 -96
- package/src/console/ui/store/cache-view.test.ts +0 -13
- package/src/console/ui/store/cache-view.ts +0 -36
- package/src/console/ui/store/confirmation.test.ts +0 -36
- package/src/console/ui/store/confirmation.ts +0 -52
- package/src/console/ui/store/dry-run.test.ts +0 -15
- package/src/console/ui/store/dry-run.ts +0 -26
- package/src/console/ui/store/fixture.ts +0 -167
- package/src/console/ui/store/group.test.ts +0 -16
- package/src/console/ui/store/group.ts +0 -38
- package/src/console/ui/store/index.ts +0 -36
- package/src/console/ui/store/search.ts +0 -74
- package/src/console/ui/store/types.ts +0 -67
- package/src/console/ui/store/will-not-fire.test.ts +0 -19
- package/src/console/ui/store/will-not-fire.ts +0 -39
- package/src/console/ui/traces/TracesA11yView.tsx +0 -181
- package/src/console/ui/traces/a11y.test.tsx +0 -96
- package/src/console/ui/traces/chain.test.ts +0 -47
- package/src/console/ui/traces/chain.ts +0 -142
- package/src/console/ui/traces/critical-path.test.ts +0 -22
- package/src/console/ui/traces/critical-path.ts +0 -55
- package/src/console/ui/traces/filter.test.ts +0 -74
- package/src/console/ui/traces/filter.ts +0 -104
- package/src/console/ui/traces/fixture.ts +0 -126
- package/src/console/ui/traces/fold.test.ts +0 -59
- package/src/console/ui/traces/fold.ts +0 -168
- package/src/console/ui/traces/index.ts +0 -64
- package/src/console/ui/traces/mini.ts +0 -63
- package/src/console/ui/traces/replay.test.ts +0 -22
- package/src/console/ui/traces/replay.ts +0 -33
- package/src/console/ui/traces/sampling.test.ts +0 -26
- package/src/console/ui/traces/sampling.ts +0 -63
- package/src/console/ui/traces/search.ts +0 -135
- package/src/console/ui/traces/tier.ts +0 -70
- package/src/console/ui/traces/types.ts +0 -125
- package/src/console/ui/tsconfig.json +0 -20
- package/src/console/ui/vault/VaultA11yView.tsx +0 -197
- package/src/console/ui/vault/a11y.test.tsx +0 -96
- package/src/console/ui/vault/backend.test.ts +0 -75
- package/src/console/ui/vault/backend.ts +0 -117
- package/src/console/ui/vault/blast-radius.ts +0 -53
- package/src/console/ui/vault/confirmation.test.ts +0 -37
- package/src/console/ui/vault/confirmation.ts +0 -36
- package/src/console/ui/vault/dormant.ts +0 -28
- package/src/console/ui/vault/export-safe.test.ts +0 -26
- package/src/console/ui/vault/export-safe.ts +0 -62
- package/src/console/ui/vault/fixture.ts +0 -94
- package/src/console/ui/vault/group.test.ts +0 -25
- package/src/console/ui/vault/group.ts +0 -49
- package/src/console/ui/vault/index.ts +0 -47
- package/src/console/ui/vault/search.ts +0 -58
- package/src/console/ui/vault/types.ts +0 -83
- package/src/console/ui/vite.config.ts +0 -84
- /package/src/console/{ui/vault → ui-next/src/features/vault/lib}/blast-radius.test.ts +0 -0
- /package/src/console/{ui/vault → ui-next/src/features/vault/lib}/dormant.test.ts +0 -0
|
@@ -0,0 +1,1077 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Overview map — radial hub, not a column of units.
|
|
3
|
+
*
|
|
4
|
+
* Center is the law (OKE). Eight element discs sit on the inner orbit.
|
|
5
|
+
* Each element's kinds cluster on that element's spoke (Store
|
|
6
|
+
* SQL/KV/Files/Index, Gate policy/scope/rate/flag, …) — not a shared
|
|
7
|
+
* second ring. Units sit on the outer ring. Couplings run unit → type
|
|
8
|
+
* → element → law. Live heat comes from the Traces ledger.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type { Edge } from "@xyflow/react";
|
|
12
|
+
import type { Flow, Gate, Manifest, SecretContract } from "../../../../../../manifest/types.ts";
|
|
13
|
+
import type { RunRow } from "@/client.ts";
|
|
14
|
+
import { ELEMENT_ICONS, type OkeElement } from "@/lib/element-icons.ts";
|
|
15
|
+
import {
|
|
16
|
+
FLOW_TRIGGER_KIND_SPECS,
|
|
17
|
+
FLOW_TRIGGER_KINDS,
|
|
18
|
+
flowTriggerKind,
|
|
19
|
+
} from "@/features/units/lib/flow-trigger.ts";
|
|
20
|
+
import {
|
|
21
|
+
actionOfFlowId,
|
|
22
|
+
unitOfFlowId,
|
|
23
|
+
type FlowGraphEdge,
|
|
24
|
+
type FlowGraphNode,
|
|
25
|
+
} from "./build-flow-graph.ts";
|
|
26
|
+
import {
|
|
27
|
+
EDGE_STROKE,
|
|
28
|
+
GRAPH_Z,
|
|
29
|
+
HUB_LAYOUT,
|
|
30
|
+
MAP_BOX,
|
|
31
|
+
NODE_ACCENT,
|
|
32
|
+
NODE_BOX,
|
|
33
|
+
} from "./flow-graph-theme.ts";
|
|
34
|
+
|
|
35
|
+
/** Manifesto order — the eight elements, always. */
|
|
36
|
+
export const OKE_ELEMENTS: readonly OkeElement[] = [
|
|
37
|
+
"flow",
|
|
38
|
+
"signal",
|
|
39
|
+
"store",
|
|
40
|
+
"clock",
|
|
41
|
+
"gate",
|
|
42
|
+
"vault",
|
|
43
|
+
"channel",
|
|
44
|
+
"ai",
|
|
45
|
+
];
|
|
46
|
+
|
|
47
|
+
/** One bundled unit → element coupling. */
|
|
48
|
+
export type ElementCoupling = {
|
|
49
|
+
readonly unit: string;
|
|
50
|
+
readonly element: OkeElement;
|
|
51
|
+
readonly flowCount: number;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/** Unit row on the overview map. */
|
|
55
|
+
export type UnitMapRow = {
|
|
56
|
+
readonly unit: string;
|
|
57
|
+
readonly flowCount: number;
|
|
58
|
+
readonly elements: readonly OkeElement[];
|
|
59
|
+
readonly live: number;
|
|
60
|
+
readonly errors: number;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/** Element hub on the overview map. */
|
|
64
|
+
export type ElementHubRow = {
|
|
65
|
+
readonly element: OkeElement;
|
|
66
|
+
readonly resourceCount: number;
|
|
67
|
+
readonly flowCount: number;
|
|
68
|
+
readonly live: number;
|
|
69
|
+
readonly errors: number;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
/** A resource leaf shown when an element hub is focused. */
|
|
73
|
+
export type ElementResource = {
|
|
74
|
+
readonly id: string;
|
|
75
|
+
readonly label: string;
|
|
76
|
+
readonly badge?: string;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Polar top-left for a box centered on a ring.
|
|
81
|
+
*
|
|
82
|
+
* @param angle - Radians, 0 = east, −π/2 = north
|
|
83
|
+
* @param radius - Ring radius
|
|
84
|
+
* @param box - Node box
|
|
85
|
+
*/
|
|
86
|
+
export function radialPoint(
|
|
87
|
+
angle: number,
|
|
88
|
+
radius: number,
|
|
89
|
+
box: { readonly width: number; readonly height: number },
|
|
90
|
+
): { readonly x: number; readonly y: number } {
|
|
91
|
+
return {
|
|
92
|
+
x: HUB_LAYOUT.cx + radius * Math.cos(angle) - box.width / 2,
|
|
93
|
+
y: HUB_LAYOUT.cy + radius * Math.sin(angle) - box.height / 2,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Evenly spaced ring angles starting at 12 o'clock.
|
|
99
|
+
*
|
|
100
|
+
* @param count - Slots
|
|
101
|
+
*/
|
|
102
|
+
export function ringAngles(count: number): readonly number[] {
|
|
103
|
+
if (count <= 0) return [];
|
|
104
|
+
const step = (2 * Math.PI) / count;
|
|
105
|
+
return Array.from({ length: count }, (_, i) => -Math.PI / 2 + i * step);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const ELEMENT_SECTOR = (2 * Math.PI) / OKE_ELEMENTS.length;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Fan `count` angles around a home heading, packed to chip width.
|
|
112
|
+
*
|
|
113
|
+
* @param home - Element disc angle
|
|
114
|
+
* @param count - Types in this row
|
|
115
|
+
* @param radius - Row radius (for chip spacing)
|
|
116
|
+
*/
|
|
117
|
+
export function fanAngles(
|
|
118
|
+
home: number,
|
|
119
|
+
count: number,
|
|
120
|
+
radius: number = HUB_LAYOUT.typeRing,
|
|
121
|
+
): readonly number[] {
|
|
122
|
+
if (count <= 0) return [];
|
|
123
|
+
if (count === 1) return [home];
|
|
124
|
+
const step = (MAP_BOX.type.width + 10) / radius;
|
|
125
|
+
const span = Math.min(step * (count - 1), ELEMENT_SECTOR * 0.7);
|
|
126
|
+
return Array.from({ length: count }, (_, i) => home - span / 2 + (i / (count - 1)) * span);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/** Polar slot for one type chip in an element's cluster. */
|
|
130
|
+
export type TypeSlot = {
|
|
131
|
+
readonly angle: number;
|
|
132
|
+
readonly radius: number;
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Compact cluster on an element's spoke — one row for ≤3 kinds, two
|
|
137
|
+
* rows for the rest, so types stay with their parent instead of
|
|
138
|
+
* smearing around a shared ring.
|
|
139
|
+
*
|
|
140
|
+
* @param home - Element disc angle
|
|
141
|
+
* @param count - Types in this cluster
|
|
142
|
+
*/
|
|
143
|
+
export function typeClusterSlots(home: number, count: number): readonly TypeSlot[] {
|
|
144
|
+
if (count <= 0) return [];
|
|
145
|
+
const near = HUB_LAYOUT.typeRing;
|
|
146
|
+
const far = HUB_LAYOUT.typeRing + HUB_LAYOUT.typeRow;
|
|
147
|
+
if (count === 1) return [{ angle: home, radius: near }];
|
|
148
|
+
if (count === 4) return typeGrid2x2(home, near, far);
|
|
149
|
+
if (count <= 3) {
|
|
150
|
+
return fanAngles(home, count, near).map((angle) => ({ angle, radius: near }));
|
|
151
|
+
}
|
|
152
|
+
const innerCount = Math.ceil(count / 2);
|
|
153
|
+
const outerCount = count - innerCount;
|
|
154
|
+
return [
|
|
155
|
+
...fanAngles(home, innerCount, near).map((angle) => ({ angle, radius: near })),
|
|
156
|
+
...fanAngles(home, outerCount, far).map((angle) => ({ angle, radius: far })),
|
|
157
|
+
];
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Chip size along the tangent at `home` — height at east/west (Store,
|
|
162
|
+
* Channel), width at north/south (Flow, Gate) so a 2×2 does not overlap.
|
|
163
|
+
*
|
|
164
|
+
* @param home - Element disc angle
|
|
165
|
+
*/
|
|
166
|
+
function tangentChipSize(home: number): number {
|
|
167
|
+
return (
|
|
168
|
+
Math.abs(Math.cos(home)) * MAP_BOX.type.height + Math.abs(Math.sin(home)) * MAP_BOX.type.width
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/** 2×2 on the spoke — Store / Channel / Gate / AI. Spaced by chip box. */
|
|
173
|
+
function typeGrid2x2(home: number, near: number, far: number): readonly TypeSlot[] {
|
|
174
|
+
const step = (tangentChipSize(home) + 24) / near;
|
|
175
|
+
return [
|
|
176
|
+
{ angle: home - step / 2, radius: near },
|
|
177
|
+
{ angle: home + step / 2, radius: near },
|
|
178
|
+
{ angle: home - step / 2, radius: far },
|
|
179
|
+
{ angle: home + step / 2, radius: far },
|
|
180
|
+
];
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Elements a flow declares — trigger, gates, and effects.
|
|
185
|
+
*
|
|
186
|
+
* `flow` is always present. `calls` stay inside flow (they do not add a
|
|
187
|
+
* second element).
|
|
188
|
+
*
|
|
189
|
+
* @param flow - Manifest flow
|
|
190
|
+
*/
|
|
191
|
+
export function elementsOfFlow(flow: Flow): readonly OkeElement[] {
|
|
192
|
+
const out = new Set<OkeElement>(["flow"]);
|
|
193
|
+
const trigger = flow.trigger;
|
|
194
|
+
if (trigger?.cron || trigger?.every) out.add("clock");
|
|
195
|
+
if (trigger?.signal) out.add("signal");
|
|
196
|
+
if ((flow.gates?.length ?? 0) > 0) out.add("gate");
|
|
197
|
+
const effects = flow.effects;
|
|
198
|
+
if ((effects?.reads?.length ?? 0) > 0 || (effects?.writes?.length ?? 0) > 0) {
|
|
199
|
+
out.add("store");
|
|
200
|
+
}
|
|
201
|
+
if ((effects?.emits?.length ?? 0) > 0) out.add("signal");
|
|
202
|
+
if ((effects?.sends?.length ?? 0) > 0) out.add("channel");
|
|
203
|
+
if ((effects?.asks?.length ?? 0) > 0) out.add("ai");
|
|
204
|
+
if ((effects?.secrets?.length ?? 0) > 0) out.add("vault");
|
|
205
|
+
return OKE_ELEMENTS.filter((element) => out.has(element));
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Elements a run actually touched (ledger, not Manifest).
|
|
210
|
+
*
|
|
211
|
+
* @param run - Projected run row
|
|
212
|
+
*/
|
|
213
|
+
export function elementsOfRun(run: RunRow): readonly OkeElement[] {
|
|
214
|
+
const out = new Set<OkeElement>(["flow"]);
|
|
215
|
+
if (run.trigger === "cron" || run.trigger === "every") out.add("clock");
|
|
216
|
+
if (run.trigger === "signal") out.add("signal");
|
|
217
|
+
if (run.gates.length > 0) out.add("gate");
|
|
218
|
+
for (const effect of run.effects) {
|
|
219
|
+
switch (effect.kind) {
|
|
220
|
+
case "read":
|
|
221
|
+
case "write":
|
|
222
|
+
out.add("store");
|
|
223
|
+
break;
|
|
224
|
+
case "emit":
|
|
225
|
+
out.add("signal");
|
|
226
|
+
break;
|
|
227
|
+
case "send":
|
|
228
|
+
out.add("channel");
|
|
229
|
+
break;
|
|
230
|
+
case "ask":
|
|
231
|
+
out.add("ai");
|
|
232
|
+
break;
|
|
233
|
+
case "secret":
|
|
234
|
+
out.add("vault");
|
|
235
|
+
break;
|
|
236
|
+
case "call":
|
|
237
|
+
break;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
return OKE_ELEMENTS.filter((element) => out.has(element));
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Unique resources an element owns — catalogue plus declared effect refs.
|
|
245
|
+
*
|
|
246
|
+
* @param manifest - Live Manifest
|
|
247
|
+
* @param element - Element to list
|
|
248
|
+
*/
|
|
249
|
+
export function resourcesOfElement(
|
|
250
|
+
manifest: Manifest,
|
|
251
|
+
element: OkeElement,
|
|
252
|
+
): readonly ElementResource[] {
|
|
253
|
+
const byId = new Map<string, ElementResource>();
|
|
254
|
+
const add = (id: string, label: string, badge?: string) => {
|
|
255
|
+
if (byId.has(id)) return;
|
|
256
|
+
byId.set(id, badge !== undefined ? { id, label, badge } : { id, label });
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
switch (element) {
|
|
260
|
+
case "flow":
|
|
261
|
+
for (const flowId of Object.keys(manifest.flows ?? {}).sort()) {
|
|
262
|
+
add(`flow:${flowId}`, actionOfFlowId(flowId), unitOfFlowId(flowId));
|
|
263
|
+
}
|
|
264
|
+
break;
|
|
265
|
+
case "signal":
|
|
266
|
+
for (const name of Object.keys(manifest.signals ?? {}).sort()) {
|
|
267
|
+
add(`signal:${name}`, name, "signal");
|
|
268
|
+
}
|
|
269
|
+
for (const flow of Object.values(manifest.flows ?? {})) {
|
|
270
|
+
if (flow.trigger?.signal)
|
|
271
|
+
add(`signal:${flow.trigger.signal}`, flow.trigger.signal, "signal");
|
|
272
|
+
for (const name of flow.effects?.emits ?? []) add(`signal:${name}`, name, "signal");
|
|
273
|
+
}
|
|
274
|
+
break;
|
|
275
|
+
case "store":
|
|
276
|
+
for (const [storeName, store] of Object.entries(manifest.stores ?? {})) {
|
|
277
|
+
const facet = store.facet;
|
|
278
|
+
for (const table of Object.keys(store.tables ?? {}).sort()) {
|
|
279
|
+
add(`${facet}:${table}`, table, facet);
|
|
280
|
+
}
|
|
281
|
+
const namespaces = store.namespaces && store.namespaces.length > 0 ? store.namespaces : [];
|
|
282
|
+
if (facet === "kv" && namespaces.length === 0) add(`kv:${storeName}`, storeName, "kv");
|
|
283
|
+
for (const name of [...namespaces].sort()) add(`kv:${name}`, name, "kv");
|
|
284
|
+
for (const name of [...(store.buckets ?? [])].sort()) add(`files:${name}`, name, "files");
|
|
285
|
+
for (const name of [...(store.indexes ?? [])].sort()) add(`index:${name}`, name, "index");
|
|
286
|
+
}
|
|
287
|
+
for (const flow of Object.values(manifest.flows ?? {})) {
|
|
288
|
+
for (const ref of [...(flow.effects?.reads ?? []), ...(flow.effects?.writes ?? [])]) {
|
|
289
|
+
const spec = storeRefSpec(ref);
|
|
290
|
+
if (spec) add(spec.id, spec.label, spec.badge);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
break;
|
|
294
|
+
case "clock":
|
|
295
|
+
for (const [name, clock] of Object.entries(manifest.clocks ?? {}).sort(([a], [b]) =>
|
|
296
|
+
a.localeCompare(b),
|
|
297
|
+
)) {
|
|
298
|
+
add(`clock:${name}`, name, clock.cron ? "cron" : clock.every ? "every" : "clock");
|
|
299
|
+
}
|
|
300
|
+
for (const [flowId, flow] of Object.entries(manifest.flows ?? {})) {
|
|
301
|
+
if (flow.trigger?.cron) add(`clock:${flowId}`, flow.trigger.cron, "cron");
|
|
302
|
+
if (flow.trigger?.every) add(`clock:${flowId}`, flow.trigger.every, "every");
|
|
303
|
+
}
|
|
304
|
+
break;
|
|
305
|
+
case "gate":
|
|
306
|
+
for (const name of Object.keys(manifest.gates ?? {}).sort()) {
|
|
307
|
+
add(`gate:${name}`, name, "gate");
|
|
308
|
+
}
|
|
309
|
+
for (const flow of Object.values(manifest.flows ?? {})) {
|
|
310
|
+
for (const name of flow.gates ?? []) add(`gate:${name}`, name, "gate");
|
|
311
|
+
}
|
|
312
|
+
break;
|
|
313
|
+
case "vault":
|
|
314
|
+
for (const name of Object.keys(manifest.vault ?? {}).sort()) {
|
|
315
|
+
add(`vault:${name}`, name, "vault");
|
|
316
|
+
}
|
|
317
|
+
for (const flow of Object.values(manifest.flows ?? {})) {
|
|
318
|
+
for (const name of flow.effects?.secrets ?? []) add(`vault:${name}`, name, "vault");
|
|
319
|
+
}
|
|
320
|
+
break;
|
|
321
|
+
case "channel":
|
|
322
|
+
for (const name of Object.keys(manifest.channels ?? {}).sort()) {
|
|
323
|
+
add(`channel:${name}`, name, "channel");
|
|
324
|
+
}
|
|
325
|
+
for (const flow of Object.values(manifest.flows ?? {})) {
|
|
326
|
+
for (const name of flow.effects?.sends ?? []) add(`channel:${name}`, name, "channel");
|
|
327
|
+
}
|
|
328
|
+
break;
|
|
329
|
+
case "ai":
|
|
330
|
+
for (const name of Object.keys(manifest.ai?.prompts ?? {}).sort()) {
|
|
331
|
+
add(`ai:${name}`, name, "prompt");
|
|
332
|
+
}
|
|
333
|
+
for (const name of Object.keys(manifest.ai?.agents ?? {}).sort()) {
|
|
334
|
+
add(`ai:${name}`, name, "agent");
|
|
335
|
+
}
|
|
336
|
+
for (const flow of Object.values(manifest.flows ?? {})) {
|
|
337
|
+
for (const name of flow.effects?.asks ?? []) add(`ai:${name}`, name, "prompt");
|
|
338
|
+
}
|
|
339
|
+
break;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
return [...byId.values()].sort((a, b) => a.label.localeCompare(b.label));
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
function storeRefSpec(ref: string): ElementResource | null {
|
|
346
|
+
if (ref.startsWith("sql:")) return { id: ref, label: ref.slice(4), badge: "sql" };
|
|
347
|
+
if (ref.startsWith("kv:")) return { id: ref, label: ref.slice(3), badge: "kv" };
|
|
348
|
+
if (ref.startsWith("files:")) return { id: ref, label: ref.slice(6), badge: "files" };
|
|
349
|
+
if (ref.startsWith("index:")) return { id: ref, label: ref.slice(6), badge: "index" };
|
|
350
|
+
return null;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
/** One kind an element owns — Store facet, Gate kind, Channel medium, … */
|
|
354
|
+
export type ElementTypeKind = {
|
|
355
|
+
readonly kind: string;
|
|
356
|
+
readonly label: string;
|
|
357
|
+
};
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* Fixed type vocabulary per element — the middle orbit, never named
|
|
361
|
+
* catalogue rows (those fan on element focus).
|
|
362
|
+
*/
|
|
363
|
+
export const ELEMENT_TYPE_KINDS: Record<OkeElement, readonly ElementTypeKind[]> = {
|
|
364
|
+
flow: FLOW_TRIGGER_KINDS.map((kind) => ({
|
|
365
|
+
kind,
|
|
366
|
+
label: FLOW_TRIGGER_KIND_SPECS[kind].label,
|
|
367
|
+
})),
|
|
368
|
+
signal: [
|
|
369
|
+
{ kind: "once", label: "once" },
|
|
370
|
+
{ kind: "broadcast", label: "broadcast" },
|
|
371
|
+
{ kind: "live", label: "live" },
|
|
372
|
+
],
|
|
373
|
+
store: [
|
|
374
|
+
{ kind: "sql", label: "SQL" },
|
|
375
|
+
{ kind: "kv", label: "KV" },
|
|
376
|
+
{ kind: "files", label: "Files" },
|
|
377
|
+
{ kind: "index", label: "Index" },
|
|
378
|
+
],
|
|
379
|
+
clock: [
|
|
380
|
+
{ kind: "cron", label: "cron" },
|
|
381
|
+
{ kind: "every", label: "every" },
|
|
382
|
+
],
|
|
383
|
+
gate: [
|
|
384
|
+
{ kind: "policy", label: "policy" },
|
|
385
|
+
{ kind: "scope", label: "scope" },
|
|
386
|
+
{ kind: "rate", label: "rate" },
|
|
387
|
+
{ kind: "flag", label: "flag" },
|
|
388
|
+
],
|
|
389
|
+
vault: [
|
|
390
|
+
{ kind: "secret", label: "secret" },
|
|
391
|
+
{ kind: "config", label: "config" },
|
|
392
|
+
{ kind: "env", label: "env" },
|
|
393
|
+
],
|
|
394
|
+
channel: [
|
|
395
|
+
{ kind: "email", label: "email" },
|
|
396
|
+
{ kind: "sms", label: "SMS" },
|
|
397
|
+
{ kind: "whatsapp", label: "WA" },
|
|
398
|
+
{ kind: "push", label: "Push" },
|
|
399
|
+
],
|
|
400
|
+
ai: [
|
|
401
|
+
{ kind: "model", label: "model" },
|
|
402
|
+
{ kind: "prompt", label: "prompt" },
|
|
403
|
+
{ kind: "embed", label: "embed" },
|
|
404
|
+
{ kind: "agent", label: "agent" },
|
|
405
|
+
],
|
|
406
|
+
};
|
|
407
|
+
|
|
408
|
+
/**
|
|
409
|
+
* Types an element owns — the element's kind vocabulary, always.
|
|
410
|
+
*
|
|
411
|
+
* Named catalogue rows (KV namespaces, tables, prompts) stay off this
|
|
412
|
+
* orbit and fan only when the element is focused. Store kinds are the
|
|
413
|
+
* four facets (`sql` · `kv` · `files` · `index`) — cache lives on KV.
|
|
414
|
+
*
|
|
415
|
+
* @param _manifest - Live Manifest (kinds are fixed per element)
|
|
416
|
+
* @param element - Element to list
|
|
417
|
+
*/
|
|
418
|
+
export function typesOfElement(
|
|
419
|
+
_manifest: Manifest,
|
|
420
|
+
element: OkeElement,
|
|
421
|
+
): readonly ElementResource[] {
|
|
422
|
+
return ELEMENT_TYPE_KINDS[element].map((type) => ({
|
|
423
|
+
id: `type:${element}:${type.kind}`,
|
|
424
|
+
label: type.label,
|
|
425
|
+
badge: type.kind,
|
|
426
|
+
}));
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
function gateTypeKind(name: string, gate: Gate | undefined): string {
|
|
430
|
+
if (gate?.kind === "rate" || name.startsWith("rate:")) return "rate";
|
|
431
|
+
if (name.startsWith("flag:")) return "flag";
|
|
432
|
+
if ((gate?.scopes?.length ?? 0) > 0) return "scope";
|
|
433
|
+
return "policy";
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
function vaultTypeKind(contract: SecretContract | undefined): string {
|
|
437
|
+
return contract?.sensitive === false ? "config" : "secret";
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
function aiTypeKind(manifest: Manifest, name: string): string {
|
|
441
|
+
const bare = name.split("@")[0] ?? name;
|
|
442
|
+
if (manifest.ai?.agents?.[bare]) return "agent";
|
|
443
|
+
if (manifest.ai?.models?.[bare]) return "model";
|
|
444
|
+
return "prompt";
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
/**
|
|
448
|
+
* Type node ids a flow actually uses on one element.
|
|
449
|
+
*
|
|
450
|
+
* @param manifest - Live Manifest
|
|
451
|
+
* @param flow - Manifest flow
|
|
452
|
+
* @param element - Element the flow touches
|
|
453
|
+
*/
|
|
454
|
+
export function typeIdsUsedByFlow(
|
|
455
|
+
manifest: Manifest,
|
|
456
|
+
flow: Flow,
|
|
457
|
+
element: OkeElement,
|
|
458
|
+
): readonly string[] {
|
|
459
|
+
const prefix = `type:${element}:`;
|
|
460
|
+
switch (element) {
|
|
461
|
+
case "flow":
|
|
462
|
+
return [`${prefix}${flowTriggerKind(flow.trigger)}`];
|
|
463
|
+
case "store": {
|
|
464
|
+
const facets = new Set<string>();
|
|
465
|
+
for (const ref of [...(flow.effects?.reads ?? []), ...(flow.effects?.writes ?? [])]) {
|
|
466
|
+
const spec = storeRefSpec(ref);
|
|
467
|
+
if (spec?.badge) facets.add(spec.badge);
|
|
468
|
+
}
|
|
469
|
+
return [...facets].map((facet) => `${prefix}${facet}`);
|
|
470
|
+
}
|
|
471
|
+
case "signal": {
|
|
472
|
+
const names = [
|
|
473
|
+
...(flow.trigger?.signal ? [flow.trigger.signal] : []),
|
|
474
|
+
...(flow.effects?.emits ?? []),
|
|
475
|
+
];
|
|
476
|
+
const kinds = new Set<string>();
|
|
477
|
+
for (const name of names) {
|
|
478
|
+
const delivery = manifest.signals?.[name]?.delivery;
|
|
479
|
+
if (delivery) kinds.add(delivery);
|
|
480
|
+
}
|
|
481
|
+
return [...kinds].map((kind) => `${prefix}${kind}`);
|
|
482
|
+
}
|
|
483
|
+
case "clock": {
|
|
484
|
+
const kinds: string[] = [];
|
|
485
|
+
if (flow.trigger?.cron) kinds.push(`${prefix}cron`);
|
|
486
|
+
if (flow.trigger?.every) kinds.push(`${prefix}every`);
|
|
487
|
+
return kinds;
|
|
488
|
+
}
|
|
489
|
+
case "gate":
|
|
490
|
+
return [
|
|
491
|
+
...new Set((flow.gates ?? []).map((name) => gateTypeKind(name, manifest.gates?.[name]))),
|
|
492
|
+
].map((kind) => `${prefix}${kind}`);
|
|
493
|
+
case "vault":
|
|
494
|
+
return [
|
|
495
|
+
...new Set(
|
|
496
|
+
(flow.effects?.secrets ?? []).map((name) => vaultTypeKind(manifest.vault?.[name])),
|
|
497
|
+
),
|
|
498
|
+
].map((kind) => `${prefix}${kind}`);
|
|
499
|
+
case "channel": {
|
|
500
|
+
const kinds = new Set<string>();
|
|
501
|
+
for (const name of flow.effects?.sends ?? []) {
|
|
502
|
+
const medium = manifest.channels?.[name]?.medium;
|
|
503
|
+
if (medium && medium !== "any") kinds.add(medium);
|
|
504
|
+
}
|
|
505
|
+
return [...kinds].map((kind) => `${prefix}${kind}`);
|
|
506
|
+
}
|
|
507
|
+
case "ai":
|
|
508
|
+
return [...new Set((flow.effects?.asks ?? []).map((name) => aiTypeKind(manifest, name)))].map(
|
|
509
|
+
(kind) => `${prefix}${kind}`,
|
|
510
|
+
);
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
/**
|
|
515
|
+
* Unit → element couplings from Manifest structure.
|
|
516
|
+
*
|
|
517
|
+
* @param manifest - Live Manifest
|
|
518
|
+
*/
|
|
519
|
+
export function couplingsOfManifest(manifest: Manifest | null | undefined): {
|
|
520
|
+
readonly units: readonly UnitMapRow[];
|
|
521
|
+
readonly hubs: readonly ElementHubRow[];
|
|
522
|
+
readonly couplings: readonly ElementCoupling[];
|
|
523
|
+
} {
|
|
524
|
+
const flows = manifest?.flows ?? {};
|
|
525
|
+
const byUnit = new Map<string, string[]>();
|
|
526
|
+
for (const flowId of Object.keys(flows).sort()) {
|
|
527
|
+
const unit = unitOfFlowId(flowId);
|
|
528
|
+
const list = byUnit.get(unit) ?? [];
|
|
529
|
+
list.push(flowId);
|
|
530
|
+
byUnit.set(unit, list);
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
const coupleCount = new Map<string, number>();
|
|
534
|
+
const unitElements = new Map<string, Set<OkeElement>>();
|
|
535
|
+
const elementFlows = new Map<OkeElement, Set<string>>();
|
|
536
|
+
|
|
537
|
+
for (const [unit, ids] of byUnit) {
|
|
538
|
+
const touched = new Set<OkeElement>();
|
|
539
|
+
for (const flowId of ids) {
|
|
540
|
+
const flow = flows[flowId];
|
|
541
|
+
if (!flow) continue;
|
|
542
|
+
for (const element of elementsOfFlow(flow)) {
|
|
543
|
+
touched.add(element);
|
|
544
|
+
const key = `${unit}\0${element}`;
|
|
545
|
+
coupleCount.set(key, (coupleCount.get(key) ?? 0) + 1);
|
|
546
|
+
const flowSet = elementFlows.get(element) ?? new Set();
|
|
547
|
+
flowSet.add(flowId);
|
|
548
|
+
elementFlows.set(element, flowSet);
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
unitElements.set(unit, touched);
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
const units: UnitMapRow[] = [...byUnit.entries()]
|
|
555
|
+
.sort(([a], [b]) => a.localeCompare(b))
|
|
556
|
+
.map(([unit, ids]) => ({
|
|
557
|
+
unit,
|
|
558
|
+
flowCount: ids.length,
|
|
559
|
+
elements: OKE_ELEMENTS.filter((element) => unitElements.get(unit)?.has(element)),
|
|
560
|
+
live: 0,
|
|
561
|
+
errors: 0,
|
|
562
|
+
}));
|
|
563
|
+
|
|
564
|
+
const hubs: ElementHubRow[] = OKE_ELEMENTS.map((element) => ({
|
|
565
|
+
element,
|
|
566
|
+
resourceCount: manifest ? resourcesOfElement(manifest, element).length : 0,
|
|
567
|
+
flowCount: elementFlows.get(element)?.size ?? 0,
|
|
568
|
+
live: 0,
|
|
569
|
+
errors: 0,
|
|
570
|
+
}));
|
|
571
|
+
|
|
572
|
+
const couplings: ElementCoupling[] = [];
|
|
573
|
+
for (const unit of units) {
|
|
574
|
+
for (const element of unit.elements) {
|
|
575
|
+
couplings.push({
|
|
576
|
+
unit: unit.unit,
|
|
577
|
+
element,
|
|
578
|
+
flowCount: coupleCount.get(`${unit.unit}\0${element}`) ?? 0,
|
|
579
|
+
});
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
return { units, hubs, couplings };
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
/**
|
|
587
|
+
* Paint live / error counts from the Traces ledger onto map rows.
|
|
588
|
+
*
|
|
589
|
+
* @param rows - Structural map rows
|
|
590
|
+
* @param runs - Recent runs (already scoped to this app)
|
|
591
|
+
*/
|
|
592
|
+
export function applyLiveHeat(
|
|
593
|
+
rows: {
|
|
594
|
+
readonly units: readonly UnitMapRow[];
|
|
595
|
+
readonly hubs: readonly ElementHubRow[];
|
|
596
|
+
readonly couplings: readonly ElementCoupling[];
|
|
597
|
+
},
|
|
598
|
+
runs: readonly RunRow[],
|
|
599
|
+
): {
|
|
600
|
+
readonly units: readonly UnitMapRow[];
|
|
601
|
+
readonly hubs: readonly ElementHubRow[];
|
|
602
|
+
readonly couplings: readonly ElementCoupling[];
|
|
603
|
+
} {
|
|
604
|
+
const unitLive = new Map<string, number>();
|
|
605
|
+
const unitErrors = new Map<string, number>();
|
|
606
|
+
const hubLive = new Map<OkeElement, number>();
|
|
607
|
+
const hubErrors = new Map<OkeElement, number>();
|
|
608
|
+
|
|
609
|
+
for (const run of runs) {
|
|
610
|
+
const unit = run.unit ?? unitOfFlowId(run.flow);
|
|
611
|
+
unitLive.set(unit, (unitLive.get(unit) ?? 0) + 1);
|
|
612
|
+
if (run.error) unitErrors.set(unit, (unitErrors.get(unit) ?? 0) + 1);
|
|
613
|
+
for (const element of elementsOfRun(run)) {
|
|
614
|
+
hubLive.set(element, (hubLive.get(element) ?? 0) + 1);
|
|
615
|
+
if (run.error) hubErrors.set(element, (hubErrors.get(element) ?? 0) + 1);
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
return {
|
|
620
|
+
couplings: rows.couplings,
|
|
621
|
+
units: rows.units.map((row) => ({
|
|
622
|
+
...row,
|
|
623
|
+
live: unitLive.get(row.unit) ?? 0,
|
|
624
|
+
errors: unitErrors.get(row.unit) ?? 0,
|
|
625
|
+
})),
|
|
626
|
+
hubs: rows.hubs.map((row) => ({
|
|
627
|
+
...row,
|
|
628
|
+
live: hubLive.get(row.element) ?? 0,
|
|
629
|
+
errors: hubErrors.get(row.element) ?? 0,
|
|
630
|
+
})),
|
|
631
|
+
};
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
/** Focus that stays on the bipartite map (overview or one element). */
|
|
635
|
+
export type MapFocus = { readonly kind: "element"; readonly element: OkeElement } | null;
|
|
636
|
+
|
|
637
|
+
/**
|
|
638
|
+
* Build the overview (or element-isolated) React Flow graph.
|
|
639
|
+
*
|
|
640
|
+
* @param manifest - Live Manifest
|
|
641
|
+
* @param runs - Recent runs for live heat
|
|
642
|
+
* @param focus - `null` = eight hubs; element = that element's resources
|
|
643
|
+
*/
|
|
644
|
+
export function buildElementMap(
|
|
645
|
+
manifest: Manifest | null | undefined,
|
|
646
|
+
runs: readonly RunRow[] = [],
|
|
647
|
+
focus: MapFocus = null,
|
|
648
|
+
): {
|
|
649
|
+
readonly nodes: FlowGraphNode[];
|
|
650
|
+
readonly edges: FlowGraphEdge[];
|
|
651
|
+
readonly units: readonly UnitMapRow[];
|
|
652
|
+
readonly hubs: readonly ElementHubRow[];
|
|
653
|
+
} {
|
|
654
|
+
if (!manifest || Object.keys(manifest.flows ?? {}).length === 0) {
|
|
655
|
+
return { nodes: [], edges: [], units: [], hubs: [] };
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
const heated = applyLiveHeat(couplingsOfManifest(manifest), runs);
|
|
659
|
+
const isolate = focus?.element;
|
|
660
|
+
const liveTotal = heated.hubs.find((row) => row.element === "flow")?.live ?? 0;
|
|
661
|
+
const liveErrors = heated.hubs.find((row) => row.element === "flow")?.errors ?? 0;
|
|
662
|
+
|
|
663
|
+
const nodes: FlowGraphNode[] = [];
|
|
664
|
+
const edges: FlowGraphEdge[] = [];
|
|
665
|
+
|
|
666
|
+
nodes.push(orbitNode("orbit:elements", HUB_LAYOUT.elementRing));
|
|
667
|
+
nodes.push(orbitNode("orbit:types", HUB_LAYOUT.typeRing));
|
|
668
|
+
nodes.push(orbitNode("orbit:spokes", HUB_LAYOUT.spokeRing));
|
|
669
|
+
nodes.push({
|
|
670
|
+
id: "law:oke",
|
|
671
|
+
type: "law",
|
|
672
|
+
position: {
|
|
673
|
+
x: HUB_LAYOUT.cx - MAP_BOX.law.width / 2,
|
|
674
|
+
y: HUB_LAYOUT.cy - MAP_BOX.law.height / 2,
|
|
675
|
+
},
|
|
676
|
+
data: {
|
|
677
|
+
kind: "law",
|
|
678
|
+
label: manifest.app,
|
|
679
|
+
refId: "oke",
|
|
680
|
+
badge: String(heated.units.reduce((n, row) => n + row.flowCount, 0)),
|
|
681
|
+
live: liveTotal,
|
|
682
|
+
errors: liveErrors,
|
|
683
|
+
},
|
|
684
|
+
selectable: false,
|
|
685
|
+
draggable: false,
|
|
686
|
+
zIndex: GRAPH_Z.leaf,
|
|
687
|
+
width: MAP_BOX.law.width,
|
|
688
|
+
height: MAP_BOX.law.height,
|
|
689
|
+
style: {
|
|
690
|
+
width: MAP_BOX.law.width,
|
|
691
|
+
height: MAP_BOX.law.height,
|
|
692
|
+
overflow: "visible",
|
|
693
|
+
},
|
|
694
|
+
});
|
|
695
|
+
|
|
696
|
+
const hubAngles = ringAngles(OKE_ELEMENTS.length);
|
|
697
|
+
heated.hubs.forEach((row, index) => {
|
|
698
|
+
const angle = hubAngles[index] ?? 0;
|
|
699
|
+
const box = MAP_BOX.hub;
|
|
700
|
+
nodes.push({
|
|
701
|
+
id: `element:${row.element}`,
|
|
702
|
+
type: "element",
|
|
703
|
+
position: radialPoint(angle, HUB_LAYOUT.elementRing, box),
|
|
704
|
+
data: {
|
|
705
|
+
kind: "element",
|
|
706
|
+
label: ELEMENT_ICONS[row.element].symbol,
|
|
707
|
+
refId: row.element,
|
|
708
|
+
badge: String(row.resourceCount),
|
|
709
|
+
live: row.live,
|
|
710
|
+
errors: row.errors,
|
|
711
|
+
dimmed: isolate != null && row.element !== isolate,
|
|
712
|
+
},
|
|
713
|
+
draggable: false,
|
|
714
|
+
zIndex: GRAPH_Z.leaf,
|
|
715
|
+
width: box.width,
|
|
716
|
+
height: box.height,
|
|
717
|
+
style: { width: box.width, height: box.height },
|
|
718
|
+
});
|
|
719
|
+
edges.push(coupleEdge(`element:${row.element}`, "law:oke", row.element, 1, true));
|
|
720
|
+
});
|
|
721
|
+
|
|
722
|
+
if (!isolate || isolate === "flow") {
|
|
723
|
+
const typeBox = MAP_BOX.type;
|
|
724
|
+
heated.hubs.forEach((row, index) => {
|
|
725
|
+
const home = hubAngles[index] ?? 0;
|
|
726
|
+
const types = typesOfElement(manifest, row.element);
|
|
727
|
+
const slots = typeClusterSlots(home, types.length);
|
|
728
|
+
types.forEach((resource, typeIndex) => {
|
|
729
|
+
const slot = slots[typeIndex] ?? { angle: home, radius: HUB_LAYOUT.typeRing };
|
|
730
|
+
nodes.push({
|
|
731
|
+
id: resource.id,
|
|
732
|
+
type: "typeChip",
|
|
733
|
+
position: radialPoint(slot.angle, slot.radius, typeBox),
|
|
734
|
+
data: {
|
|
735
|
+
kind: row.element,
|
|
736
|
+
label: resource.label,
|
|
737
|
+
refId: resource.id,
|
|
738
|
+
...(resource.badge !== undefined
|
|
739
|
+
? { badge: resource.badge, facet: resource.badge }
|
|
740
|
+
: {}),
|
|
741
|
+
},
|
|
742
|
+
draggable: false,
|
|
743
|
+
zIndex: GRAPH_Z.leaf,
|
|
744
|
+
width: typeBox.width,
|
|
745
|
+
height: typeBox.height,
|
|
746
|
+
style: { width: typeBox.width, height: typeBox.height },
|
|
747
|
+
});
|
|
748
|
+
edges.push(coupleEdge(resource.id, `element:${row.element}`, row.element, 1));
|
|
749
|
+
});
|
|
750
|
+
});
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
if (isolate && isolate !== "flow") {
|
|
754
|
+
const resources = resourcesOfElement(manifest, isolate);
|
|
755
|
+
const box = NODE_BOX.store;
|
|
756
|
+
const angles = ringAngles(resources.length);
|
|
757
|
+
resources.forEach((resource, index) => {
|
|
758
|
+
const angle = angles[index] ?? 0;
|
|
759
|
+
nodes.push({
|
|
760
|
+
id: resource.id,
|
|
761
|
+
type: isolate,
|
|
762
|
+
position: radialPoint(angle, HUB_LAYOUT.spokeRing, box),
|
|
763
|
+
data: {
|
|
764
|
+
kind: isolate,
|
|
765
|
+
label: resource.label,
|
|
766
|
+
refId: resource.id,
|
|
767
|
+
...(resource.badge !== undefined ? { badge: resource.badge, facet: resource.badge } : {}),
|
|
768
|
+
},
|
|
769
|
+
draggable: false,
|
|
770
|
+
zIndex: GRAPH_Z.leaf,
|
|
771
|
+
width: box.width,
|
|
772
|
+
height: box.height,
|
|
773
|
+
style: { width: box.width, height: box.height },
|
|
774
|
+
});
|
|
775
|
+
edges.push(coupleEdge(resource.id, `element:${isolate}`, isolate, 1));
|
|
776
|
+
});
|
|
777
|
+
} else {
|
|
778
|
+
const box = MAP_BOX.unit;
|
|
779
|
+
const angles = ringAngles(heated.units.length);
|
|
780
|
+
heated.units.forEach((row, index) => {
|
|
781
|
+
const angle = angles[index] ?? 0;
|
|
782
|
+
nodes.push({
|
|
783
|
+
id: `unit:${row.unit}`,
|
|
784
|
+
type: "unitChip",
|
|
785
|
+
position: radialPoint(angle, HUB_LAYOUT.spokeRing, box),
|
|
786
|
+
data: {
|
|
787
|
+
kind: "unit",
|
|
788
|
+
label: row.unit,
|
|
789
|
+
refId: row.unit,
|
|
790
|
+
badge: String(row.flowCount),
|
|
791
|
+
elements: row.elements.filter((element) => element !== "flow"),
|
|
792
|
+
live: row.live,
|
|
793
|
+
errors: row.errors,
|
|
794
|
+
},
|
|
795
|
+
draggable: false,
|
|
796
|
+
zIndex: GRAPH_Z.leaf,
|
|
797
|
+
width: box.width,
|
|
798
|
+
height: box.height,
|
|
799
|
+
style: { width: box.width, height: box.height },
|
|
800
|
+
});
|
|
801
|
+
});
|
|
802
|
+
|
|
803
|
+
const flowsByUnit = new Map<string, string[]>();
|
|
804
|
+
for (const flowId of Object.keys(manifest.flows ?? {}).sort()) {
|
|
805
|
+
const unit = unitOfFlowId(flowId);
|
|
806
|
+
const list = flowsByUnit.get(unit) ?? [];
|
|
807
|
+
list.push(flowId);
|
|
808
|
+
flowsByUnit.set(unit, list);
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
for (const row of heated.units) {
|
|
812
|
+
const typeCount = new Map<string, number>();
|
|
813
|
+
const fallback = new Set<OkeElement>();
|
|
814
|
+
for (const flowId of flowsByUnit.get(row.unit) ?? []) {
|
|
815
|
+
const flow = manifest.flows?.[flowId];
|
|
816
|
+
if (!flow) continue;
|
|
817
|
+
for (const element of elementsOfFlow(flow)) {
|
|
818
|
+
if (isolate === "flow" && element !== "flow") continue;
|
|
819
|
+
const typeIds = typeIdsUsedByFlow(manifest, flow, element);
|
|
820
|
+
if (typeIds.length === 0) fallback.add(element);
|
|
821
|
+
for (const typeId of typeIds) {
|
|
822
|
+
typeCount.set(typeId, (typeCount.get(typeId) ?? 0) + 1);
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
for (const [typeId, flowCount] of typeCount) {
|
|
827
|
+
const element = typeId.slice("type:".length).split(":")[0];
|
|
828
|
+
if (!element || !(element in NODE_ACCENT)) continue;
|
|
829
|
+
edges.push(coupleEdge(`unit:${row.unit}`, typeId, element as OkeElement, flowCount));
|
|
830
|
+
}
|
|
831
|
+
for (const element of fallback) {
|
|
832
|
+
edges.push(coupleEdge(`unit:${row.unit}`, `element:${element}`, element, 1));
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
return { nodes, edges, units: heated.units, hubs: heated.hubs };
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
function orbitNode(id: string, radius: number): FlowGraphNode {
|
|
841
|
+
const size = radius * 2;
|
|
842
|
+
return {
|
|
843
|
+
id,
|
|
844
|
+
type: "orbit",
|
|
845
|
+
position: { x: HUB_LAYOUT.cx - radius, y: HUB_LAYOUT.cy - radius },
|
|
846
|
+
data: { kind: "law", label: "", refId: id },
|
|
847
|
+
selectable: false,
|
|
848
|
+
draggable: false,
|
|
849
|
+
zIndex: GRAPH_Z.edge,
|
|
850
|
+
width: size,
|
|
851
|
+
height: size,
|
|
852
|
+
style: { width: size, height: size },
|
|
853
|
+
};
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
function coupleRole(source: string, target: string): "trunk" | "bind" | "spoke" {
|
|
857
|
+
if (target === "law:oke") return "trunk";
|
|
858
|
+
if (source.startsWith("type:") && target.startsWith("element:")) return "bind";
|
|
859
|
+
return "spoke";
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
function coupleIdleOpacity(role: "trunk" | "bind" | "spoke"): number {
|
|
863
|
+
if (role === "trunk") return 0.14;
|
|
864
|
+
if (role === "bind") return 0.2;
|
|
865
|
+
return 0;
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
function coupleEdge(
|
|
869
|
+
source: string,
|
|
870
|
+
target: string,
|
|
871
|
+
_element: OkeElement,
|
|
872
|
+
flowCount: number,
|
|
873
|
+
trunk = false,
|
|
874
|
+
): FlowGraphEdge {
|
|
875
|
+
const role = trunk ? "trunk" : coupleRole(source, target);
|
|
876
|
+
const width = role === "trunk" ? 1.15 : 1 + Math.min(1.25, Math.log2(1 + flowCount) * 0.45);
|
|
877
|
+
return {
|
|
878
|
+
id: `couple:${source}->${target}`,
|
|
879
|
+
source,
|
|
880
|
+
target,
|
|
881
|
+
sourceHandle: "center",
|
|
882
|
+
targetHandle: "center",
|
|
883
|
+
type: "straight",
|
|
884
|
+
data: { kind: "couple" },
|
|
885
|
+
style: {
|
|
886
|
+
stroke: EDGE_STROKE.couple,
|
|
887
|
+
strokeWidth: width,
|
|
888
|
+
opacity: coupleIdleOpacity(role),
|
|
889
|
+
},
|
|
890
|
+
zIndex: GRAPH_Z.edge,
|
|
891
|
+
};
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
function elementOfNodeId(id: string): OkeElement | null {
|
|
895
|
+
if (id.startsWith("element:")) {
|
|
896
|
+
const element = id.slice("element:".length);
|
|
897
|
+
return element in NODE_ACCENT ? (element as OkeElement) : null;
|
|
898
|
+
}
|
|
899
|
+
if (id.startsWith("type:")) {
|
|
900
|
+
const element = id.slice("type:".length).split(":")[0];
|
|
901
|
+
return element && element in NODE_ACCENT ? (element as OkeElement) : null;
|
|
902
|
+
}
|
|
903
|
+
return null;
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
function coupleAccent(source: string, target: string): string {
|
|
907
|
+
for (const id of [target, source]) {
|
|
908
|
+
const element = elementOfNodeId(id);
|
|
909
|
+
if (element) return NODE_ACCENT[element].accent;
|
|
910
|
+
}
|
|
911
|
+
return EDGE_STROKE.couple;
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
/** Extra hover / chain emphasis for the overview map. */
|
|
915
|
+
export interface MapHighlightOptions {
|
|
916
|
+
readonly hoverNodeId?: string | null;
|
|
917
|
+
readonly highlightedFlowIds?: ReadonlySet<string>;
|
|
918
|
+
readonly highlightedNodeIds?: ReadonlySet<string>;
|
|
919
|
+
/** Manifest — required to light only the types a flow actually uses. */
|
|
920
|
+
readonly manifest?: Manifest | null;
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
/**
|
|
924
|
+
* Exact overview path for one or more flows: unit → used types →
|
|
925
|
+
* elements → law. Not the unit's whole catalogue.
|
|
926
|
+
*
|
|
927
|
+
* @param manifest - Live Manifest
|
|
928
|
+
* @param flowIds - Flows to paint
|
|
929
|
+
*/
|
|
930
|
+
export function mapPathForFlows(
|
|
931
|
+
manifest: Manifest | null | undefined,
|
|
932
|
+
flowIds: ReadonlySet<string>,
|
|
933
|
+
): { readonly nodeIds: ReadonlySet<string>; readonly edgeIds: ReadonlySet<string> } {
|
|
934
|
+
const nodeIds = new Set<string>();
|
|
935
|
+
const edgeIds = new Set<string>();
|
|
936
|
+
const couple = (source: string, target: string) => {
|
|
937
|
+
edgeIds.add(`couple:${source}->${target}`);
|
|
938
|
+
};
|
|
939
|
+
if (!manifest) return { nodeIds, edgeIds };
|
|
940
|
+
for (const flowId of flowIds) {
|
|
941
|
+
const flow = manifest.flows?.[flowId];
|
|
942
|
+
if (!flow) continue;
|
|
943
|
+
const unit = `unit:${unitOfFlowId(flowId)}`;
|
|
944
|
+
nodeIds.add(unit);
|
|
945
|
+
for (const element of elementsOfFlow(flow)) {
|
|
946
|
+
const elementId = `element:${element}`;
|
|
947
|
+
nodeIds.add(elementId);
|
|
948
|
+
nodeIds.add("law:oke");
|
|
949
|
+
couple(elementId, "law:oke");
|
|
950
|
+
const types = typeIdsUsedByFlow(manifest, flow, element);
|
|
951
|
+
if (types.length === 0) couple(unit, elementId);
|
|
952
|
+
for (const typeId of types) {
|
|
953
|
+
nodeIds.add(typeId);
|
|
954
|
+
couple(unit, typeId);
|
|
955
|
+
couple(typeId, elementId);
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
return { nodeIds, edgeIds };
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
/**
|
|
963
|
+
* Dim / emphasize overview nodes and bundled edges.
|
|
964
|
+
*
|
|
965
|
+
* Hover wins for edge emphasis. A selected / orchestra flow lights
|
|
966
|
+
* only the types that flow uses — not every coupling on its unit.
|
|
967
|
+
*
|
|
968
|
+
* @param nodes - Map nodes
|
|
969
|
+
* @param edges - Bundled couple edges
|
|
970
|
+
* @param options - Hover + chain
|
|
971
|
+
*/
|
|
972
|
+
export function applyMapHighlight(
|
|
973
|
+
nodes: readonly FlowGraphNode[],
|
|
974
|
+
edges: readonly FlowGraphEdge[],
|
|
975
|
+
options: MapHighlightOptions = {},
|
|
976
|
+
): { readonly nodes: FlowGraphNode[]; readonly edges: FlowGraphEdge[] } {
|
|
977
|
+
const hover = options.hoverNodeId ?? null;
|
|
978
|
+
const chainFlows = options.highlightedFlowIds ?? new Set();
|
|
979
|
+
const chainNodes = options.highlightedNodeIds ?? new Set();
|
|
980
|
+
const flowPath = mapPathForFlows(options.manifest, chainFlows);
|
|
981
|
+
const chainActive = flowPath.nodeIds.size > 0 || chainNodes.size > 0;
|
|
982
|
+
const hoverActive = hover != null;
|
|
983
|
+
const hoverPath = hover != null ? hoverPathIds(hover, edges) : null;
|
|
984
|
+
|
|
985
|
+
const nextNodes = nodes.map((node) => {
|
|
986
|
+
if (node.type === "orbit") {
|
|
987
|
+
return { ...node, data: { ...node.data, highlighted: false, dimmed: false } };
|
|
988
|
+
}
|
|
989
|
+
const inChain =
|
|
990
|
+
flowPath.nodeIds.has(node.id) || chainNodes.has(node.id) || chainFlows.has(node.data.refId);
|
|
991
|
+
const hovered = hoverPath?.has(node.id) === true;
|
|
992
|
+
return {
|
|
993
|
+
...node,
|
|
994
|
+
data: {
|
|
995
|
+
...node.data,
|
|
996
|
+
highlighted: inChain || (hoverActive && node.id === hover),
|
|
997
|
+
dimmed:
|
|
998
|
+
node.id === "law:oke" ? false : (chainActive && !inChain) || (hoverActive && !hovered),
|
|
999
|
+
},
|
|
1000
|
+
};
|
|
1001
|
+
});
|
|
1002
|
+
|
|
1003
|
+
const nextEdges = edges.map((edge) => {
|
|
1004
|
+
const onHover = hoverPath != null && hoverPath.has(edge.source) && hoverPath.has(edge.target);
|
|
1005
|
+
const onChain = chainActive && flowPath.edgeIds.has(edge.id);
|
|
1006
|
+
const hot = hoverActive ? onHover : onChain;
|
|
1007
|
+
const role = coupleRole(edge.source, edge.target);
|
|
1008
|
+
const idle = !(hoverActive || chainActive);
|
|
1009
|
+
const opacity = idle ? coupleIdleOpacity(role) : hot ? 1 : coupleIdleOpacity(role) * 0.35;
|
|
1010
|
+
return {
|
|
1011
|
+
...edge,
|
|
1012
|
+
animated: hot,
|
|
1013
|
+
style: {
|
|
1014
|
+
...edge.style,
|
|
1015
|
+
stroke: hot ? coupleAccent(edge.source, edge.target) : EDGE_STROKE.couple,
|
|
1016
|
+
opacity,
|
|
1017
|
+
strokeWidth: hot ? 2.25 : edge.style?.strokeWidth,
|
|
1018
|
+
},
|
|
1019
|
+
} satisfies FlowGraphEdge;
|
|
1020
|
+
});
|
|
1021
|
+
|
|
1022
|
+
return { nodes: nextNodes, edges: nextEdges };
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
function neighborsOf(edges: readonly Edge[], id: string): readonly string[] {
|
|
1026
|
+
const out: string[] = [];
|
|
1027
|
+
for (const edge of edges) {
|
|
1028
|
+
if (edge.source === id) out.push(edge.target);
|
|
1029
|
+
else if (edge.target === id) out.push(edge.source);
|
|
1030
|
+
}
|
|
1031
|
+
return out;
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
/**
|
|
1035
|
+
* Unit → types → elements → law (and the reverse from a type / element).
|
|
1036
|
+
*
|
|
1037
|
+
* @param hover - Hovered node id
|
|
1038
|
+
* @param edges - Couple edges
|
|
1039
|
+
*/
|
|
1040
|
+
function hoverPathIds(hover: string, edges: readonly Edge[]): ReadonlySet<string> {
|
|
1041
|
+
const ids = new Set<string>([hover]);
|
|
1042
|
+
const add = (id: string) => ids.add(id);
|
|
1043
|
+
if (hover.startsWith("unit:")) {
|
|
1044
|
+
for (const next of neighborsOf(edges, hover)) {
|
|
1045
|
+
add(next);
|
|
1046
|
+
if (next.startsWith("type:")) {
|
|
1047
|
+
for (const element of neighborsOf(edges, next)) {
|
|
1048
|
+
if (!element.startsWith("element:")) continue;
|
|
1049
|
+
add(element);
|
|
1050
|
+
for (const law of neighborsOf(edges, element)) {
|
|
1051
|
+
if (law === "law:oke") add(law);
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
if (next.startsWith("element:")) {
|
|
1056
|
+
for (const law of neighborsOf(edges, next)) {
|
|
1057
|
+
if (law === "law:oke") add(law);
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
return ids;
|
|
1062
|
+
}
|
|
1063
|
+
if (hover.startsWith("type:")) {
|
|
1064
|
+
for (const next of neighborsOf(edges, hover)) add(next);
|
|
1065
|
+
const element = [...ids].find((id) => id.startsWith("element:"));
|
|
1066
|
+
if (element) {
|
|
1067
|
+
for (const law of neighborsOf(edges, element)) {
|
|
1068
|
+
if (law === "law:oke") add(law);
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
return ids;
|
|
1072
|
+
}
|
|
1073
|
+
if (hover.startsWith("element:") || hover === "law:oke") {
|
|
1074
|
+
for (const next of neighborsOf(edges, hover)) add(next);
|
|
1075
|
+
}
|
|
1076
|
+
return ids;
|
|
1077
|
+
}
|