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,1379 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thin Console client for ui-next — setup + session against the real kernel.
|
|
3
|
+
* Same-origin `/console/*` (no mocks).
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { Manifest } from "../../../manifest/types.ts";
|
|
7
|
+
|
|
8
|
+
/** Session access token key (matches current Console SPA). */
|
|
9
|
+
export const ACCESS_TOKEN_KEY = "oke_console_at";
|
|
10
|
+
|
|
11
|
+
/** Operator identity key (name/email from claim or login / session/me). */
|
|
12
|
+
export const OPERATOR_KEY = "oke_console_operator";
|
|
13
|
+
|
|
14
|
+
let accessToken: string | null = null;
|
|
15
|
+
|
|
16
|
+
/** Setup / login / session-probe paths — a 401 here is not a mid-shell expiry. */
|
|
17
|
+
const AUTH_ENTRY_PATHS = new Set([
|
|
18
|
+
"/console/setup/status",
|
|
19
|
+
"/console/setup/claim",
|
|
20
|
+
"/console/session/login",
|
|
21
|
+
"/console/session/me",
|
|
22
|
+
"/console/session/logout",
|
|
23
|
+
]);
|
|
24
|
+
|
|
25
|
+
let sessionExpired = false;
|
|
26
|
+
let onSessionExpired: ((returnTo: string) => void) | null = null;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Register the SPA handler that sends an expired operator back to `/`.
|
|
30
|
+
*
|
|
31
|
+
* @param handler - Receives the current `pathname + search`, or null to clear
|
|
32
|
+
*/
|
|
33
|
+
export function setSessionExpiredHandler(handler: ((returnTo: string) => void) | null): void {
|
|
34
|
+
onSessionExpired = handler;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* True when a Console API error means the operator session is gone.
|
|
39
|
+
* Skips claim/login/`session/me` so the route guard can own that redirect.
|
|
40
|
+
*
|
|
41
|
+
* @param path - `/console/...` request path
|
|
42
|
+
* @param error - API error envelope, if any
|
|
43
|
+
*/
|
|
44
|
+
export function shouldExpireSession(path: string, error: ConsoleApiError | null): boolean {
|
|
45
|
+
return error?.code === "Unauthorized" && !AUTH_ENTRY_PATHS.has(path);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function expireSessionIfNeeded(path: string, error: ConsoleApiError | null): void {
|
|
49
|
+
if (sessionExpired || !shouldExpireSession(path, error)) return;
|
|
50
|
+
sessionExpired = true;
|
|
51
|
+
setAccessToken(null);
|
|
52
|
+
const returnTo =
|
|
53
|
+
typeof window === "undefined" ? "/" : `${window.location.pathname}${window.location.search}`;
|
|
54
|
+
onSessionExpired?.(returnTo);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Store the operator access token after a successful claim or login.
|
|
59
|
+
*
|
|
60
|
+
* @param token - Access token or null to clear
|
|
61
|
+
*/
|
|
62
|
+
export function setAccessToken(token: string | null): void {
|
|
63
|
+
accessToken = token;
|
|
64
|
+
if (token) {
|
|
65
|
+
sessionExpired = false;
|
|
66
|
+
sessionStorage.setItem(ACCESS_TOKEN_KEY, token);
|
|
67
|
+
} else {
|
|
68
|
+
sessionStorage.removeItem(ACCESS_TOKEN_KEY);
|
|
69
|
+
sessionStorage.removeItem(OPERATOR_KEY);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Restore the access token from sessionStorage (tab lifetime).
|
|
75
|
+
*/
|
|
76
|
+
export function restoreAccessToken(): void {
|
|
77
|
+
accessToken = sessionStorage.getItem(ACCESS_TOKEN_KEY);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Current in-memory access token, if any.
|
|
82
|
+
*/
|
|
83
|
+
export function getAccessToken(): string | null {
|
|
84
|
+
return accessToken;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** Operator identity shown in the shell footer. */
|
|
88
|
+
export type SessionOperator = {
|
|
89
|
+
readonly operatorId: string;
|
|
90
|
+
readonly email: string;
|
|
91
|
+
readonly name: string;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Persist operator identity alongside the access token.
|
|
96
|
+
*
|
|
97
|
+
* @param operator - Operator from claim/login/`session/me`, or null to clear
|
|
98
|
+
*/
|
|
99
|
+
export function setSessionOperator(operator: SessionOperator | null): void {
|
|
100
|
+
if (operator) {
|
|
101
|
+
sessionStorage.setItem(OPERATOR_KEY, JSON.stringify(operator));
|
|
102
|
+
} else {
|
|
103
|
+
sessionStorage.removeItem(OPERATOR_KEY);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Read persisted operator identity from sessionStorage.
|
|
109
|
+
*/
|
|
110
|
+
export function getSessionOperator(): SessionOperator | null {
|
|
111
|
+
const raw = sessionStorage.getItem(OPERATOR_KEY);
|
|
112
|
+
if (!raw) return null;
|
|
113
|
+
try {
|
|
114
|
+
const parsed = JSON.parse(raw) as Partial<SessionOperator>;
|
|
115
|
+
if (
|
|
116
|
+
typeof parsed.operatorId === "string" &&
|
|
117
|
+
typeof parsed.email === "string" &&
|
|
118
|
+
typeof parsed.name === "string"
|
|
119
|
+
) {
|
|
120
|
+
return {
|
|
121
|
+
operatorId: parsed.operatorId,
|
|
122
|
+
email: parsed.email,
|
|
123
|
+
name: parsed.name,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
} catch {
|
|
127
|
+
// ignore corrupt storage
|
|
128
|
+
}
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Apply a successful claim or login session (token + operator identity).
|
|
134
|
+
*
|
|
135
|
+
* @param session - SessionOut from claim or login
|
|
136
|
+
*/
|
|
137
|
+
export function applySession(session: SessionOut): void {
|
|
138
|
+
setAccessToken(session.accessToken);
|
|
139
|
+
setSessionOperator({
|
|
140
|
+
operatorId: session.operatorId,
|
|
141
|
+
email: session.email,
|
|
142
|
+
name: session.name,
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/** Console API error envelope. */
|
|
147
|
+
export type ConsoleApiError = {
|
|
148
|
+
readonly code: string;
|
|
149
|
+
readonly message?: string;
|
|
150
|
+
readonly data?: unknown;
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
/** Console API result envelope. */
|
|
154
|
+
export type ConsoleApiResult<T> = {
|
|
155
|
+
readonly data: T | null;
|
|
156
|
+
readonly error: ConsoleApiError | null;
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
/** Setup status payload. */
|
|
160
|
+
export type SetupStatus = {
|
|
161
|
+
readonly setupClosed: boolean;
|
|
162
|
+
readonly claimRequired: boolean;
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
/** Claim request body (matches server ClaimIn). */
|
|
166
|
+
export type SetupClaimInput = {
|
|
167
|
+
readonly claimCode: string;
|
|
168
|
+
readonly email: string;
|
|
169
|
+
readonly name: string;
|
|
170
|
+
readonly password: string;
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Session success payload (claim + login — matches server SessionOut).
|
|
175
|
+
*/
|
|
176
|
+
export type SessionOut = {
|
|
177
|
+
readonly operatorId: string;
|
|
178
|
+
readonly email: string;
|
|
179
|
+
readonly name: string;
|
|
180
|
+
readonly accessToken: string;
|
|
181
|
+
readonly refreshToken: string;
|
|
182
|
+
readonly accessExpiresAt: number;
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
/** Claim success payload alias (matches server SessionOut). */
|
|
186
|
+
export type SetupClaimResult = SessionOut;
|
|
187
|
+
|
|
188
|
+
/** Login request body (matches server LoginIn). */
|
|
189
|
+
export type SessionLoginInput = {
|
|
190
|
+
readonly email: string;
|
|
191
|
+
readonly password: string;
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
/** GET /console/session/me payload (matches server MeOut). */
|
|
195
|
+
export type SessionMe = {
|
|
196
|
+
readonly operatorId: string;
|
|
197
|
+
readonly email: string;
|
|
198
|
+
readonly name: string;
|
|
199
|
+
readonly setupClosed: boolean;
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Prefer human message / reason over a bare error code (matches current Wizard).
|
|
204
|
+
*
|
|
205
|
+
* @param error - API error envelope
|
|
206
|
+
*/
|
|
207
|
+
export function clientErrorText(error: ConsoleApiError): string {
|
|
208
|
+
if (typeof error.message === "string" && error.message.trim().length > 0) {
|
|
209
|
+
return error.message;
|
|
210
|
+
}
|
|
211
|
+
if (error.data !== null && typeof error.data === "object") {
|
|
212
|
+
const data = error.data as { message?: unknown; reason?: unknown };
|
|
213
|
+
if (typeof data.message === "string" && data.message.trim().length > 0) {
|
|
214
|
+
return data.message;
|
|
215
|
+
}
|
|
216
|
+
if (typeof data.reason === "string" && data.reason.trim().length > 0) {
|
|
217
|
+
return data.reason;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
return error.code;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
async function consoleFetch<T>(path: string, init?: RequestInit): Promise<ConsoleApiResult<T>> {
|
|
224
|
+
const headers = new Headers(init?.headers);
|
|
225
|
+
if (!headers.has("content-type") && init?.body) {
|
|
226
|
+
headers.set("content-type", "application/json");
|
|
227
|
+
}
|
|
228
|
+
if (accessToken && !headers.has("authorization")) {
|
|
229
|
+
headers.set("authorization", `Bearer ${accessToken}`);
|
|
230
|
+
}
|
|
231
|
+
const res = await fetch(path, { ...init, headers });
|
|
232
|
+
const body = (await res.json()) as ConsoleApiResult<T>;
|
|
233
|
+
expireSessionIfNeeded(path, body.error);
|
|
234
|
+
return body;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* GET /console/setup/status
|
|
239
|
+
*/
|
|
240
|
+
export async function setupStatus(): Promise<ConsoleApiResult<SetupStatus>> {
|
|
241
|
+
return consoleFetch<SetupStatus>("/console/setup/status");
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* POST /console/setup/claim
|
|
246
|
+
*
|
|
247
|
+
* @param body - Claim payload
|
|
248
|
+
*/
|
|
249
|
+
export async function setupClaim(body: SetupClaimInput): Promise<ConsoleApiResult<SessionOut>> {
|
|
250
|
+
return consoleFetch<SessionOut>("/console/setup/claim", {
|
|
251
|
+
method: "POST",
|
|
252
|
+
body: JSON.stringify(body),
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* POST /console/session/login
|
|
258
|
+
*
|
|
259
|
+
* @param body - Email + password
|
|
260
|
+
*/
|
|
261
|
+
export async function sessionLogin(body: SessionLoginInput): Promise<ConsoleApiResult<SessionOut>> {
|
|
262
|
+
return consoleFetch<SessionOut>("/console/session/login", {
|
|
263
|
+
method: "POST",
|
|
264
|
+
body: JSON.stringify(body),
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* GET /console/session/me — validate the current operator session.
|
|
270
|
+
*/
|
|
271
|
+
export async function sessionMe(): Promise<ConsoleApiResult<SessionMe>> {
|
|
272
|
+
return consoleFetch<SessionMe>("/console/session/me");
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/** POST /console/session/logout payload (matches server `{ ok: true }`). */
|
|
276
|
+
export type SessionLogout = {
|
|
277
|
+
readonly ok: true;
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* POST /console/session/logout — end the operator session and clear cookies.
|
|
282
|
+
*/
|
|
283
|
+
export async function sessionLogout(): Promise<ConsoleApiResult<SessionLogout>> {
|
|
284
|
+
return consoleFetch<SessionLogout>("/console/session/logout", { method: "POST" });
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/** Manifest snapshot payload (`GET /console/manifest`). */
|
|
288
|
+
export type ManifestPayload = {
|
|
289
|
+
readonly manifest: Manifest | null;
|
|
290
|
+
};
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* GET /console/manifest — Manifest snapshot for the Flow graph.
|
|
294
|
+
*/
|
|
295
|
+
export async function manifestGet(): Promise<ConsoleApiResult<ManifestPayload>> {
|
|
296
|
+
return consoleFetch<ManifestPayload>("/console/manifest");
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/** One Gate row from `GET /console/gates`. */
|
|
300
|
+
export type GatesListGate = {
|
|
301
|
+
readonly name: string;
|
|
302
|
+
readonly description?: string;
|
|
303
|
+
readonly kind: "policy" | "rate";
|
|
304
|
+
readonly scopes: readonly string[];
|
|
305
|
+
readonly roles: readonly string[];
|
|
306
|
+
readonly attachedTo: readonly string[];
|
|
307
|
+
};
|
|
308
|
+
|
|
309
|
+
/** One principal row from `GET /console/gates`. */
|
|
310
|
+
export type GatesListPrincipal = {
|
|
311
|
+
readonly kind: "role" | "key" | "user";
|
|
312
|
+
readonly id: string;
|
|
313
|
+
readonly name: string;
|
|
314
|
+
readonly plane: "user" | "operator";
|
|
315
|
+
readonly scopes: readonly string[];
|
|
316
|
+
};
|
|
317
|
+
|
|
318
|
+
/** Gates panel payload (`GET /console/gates`). */
|
|
319
|
+
export type GatesListPayload = {
|
|
320
|
+
readonly moduleActions: readonly string[];
|
|
321
|
+
readonly gates: readonly GatesListGate[];
|
|
322
|
+
readonly principals: readonly GatesListPrincipal[];
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* GET /console/gates — Module:Action catalog, declared gates, Access principals.
|
|
327
|
+
*/
|
|
328
|
+
export async function gatesList(): Promise<ConsoleApiResult<GatesListPayload>> {
|
|
329
|
+
return consoleFetch<GatesListPayload>("/console/gates");
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
/** Effect entry on a run row (matches server `RunsListOut`). */
|
|
333
|
+
export type RunEffect = {
|
|
334
|
+
readonly kind: "read" | "write" | "emit" | "send" | "ask" | "secret" | "call";
|
|
335
|
+
readonly resource: string;
|
|
336
|
+
readonly timestamp: number;
|
|
337
|
+
readonly duration: number;
|
|
338
|
+
readonly reversibility:
|
|
339
|
+
| "none"
|
|
340
|
+
| "reversible"
|
|
341
|
+
| "deferred"
|
|
342
|
+
| "irreversible"
|
|
343
|
+
| "capability"
|
|
344
|
+
| "portal";
|
|
345
|
+
};
|
|
346
|
+
|
|
347
|
+
/** Log line on a run row (matches server `RunsListOut`). */
|
|
348
|
+
export type RunLog = {
|
|
349
|
+
readonly level: "debug" | "info" | "warn" | "error";
|
|
350
|
+
readonly message: string;
|
|
351
|
+
readonly data?: Record<string, unknown>;
|
|
352
|
+
readonly at: number;
|
|
353
|
+
};
|
|
354
|
+
|
|
355
|
+
/** One run row from `GET /console/runs` (matches server `projectRun`). */
|
|
356
|
+
export type RunRow = {
|
|
357
|
+
readonly id: string;
|
|
358
|
+
readonly parentId: string | null;
|
|
359
|
+
readonly flow: string;
|
|
360
|
+
readonly unit: string | null;
|
|
361
|
+
readonly trigger: string;
|
|
362
|
+
readonly plane: string;
|
|
363
|
+
readonly tenant: string | null;
|
|
364
|
+
readonly principal: string | null;
|
|
365
|
+
readonly gates: readonly string[];
|
|
366
|
+
readonly cache: "hit" | "miss" | "none";
|
|
367
|
+
readonly replica: "primary" | "replica" | null;
|
|
368
|
+
readonly replicaLagMs: number | null;
|
|
369
|
+
readonly cost: number | null;
|
|
370
|
+
readonly inputTokens: number | null;
|
|
371
|
+
readonly outputTokens: number | null;
|
|
372
|
+
readonly promptVersion: number | null;
|
|
373
|
+
readonly buildVersion: string | null;
|
|
374
|
+
readonly startedAt: number;
|
|
375
|
+
readonly endedAt: number;
|
|
376
|
+
readonly durationMs: number;
|
|
377
|
+
readonly error: string | null;
|
|
378
|
+
/** Optional human message paired with {@link error}. */
|
|
379
|
+
readonly errorMessage: string | null;
|
|
380
|
+
readonly sampled: "full" | "error" | "sample" | "boost";
|
|
381
|
+
readonly effects: readonly RunEffect[];
|
|
382
|
+
readonly logs: readonly RunLog[];
|
|
383
|
+
readonly dimensions: Record<string, string | number | boolean | null>;
|
|
384
|
+
/**
|
|
385
|
+
* Validated flow input snapshot (powers replay). `null` when the run has
|
|
386
|
+
* no stored input.
|
|
387
|
+
*/
|
|
388
|
+
readonly input: unknown;
|
|
389
|
+
/**
|
|
390
|
+
* Flow return value snapshot. `null` when the run has no stored output
|
|
391
|
+
* (failures, sleeps, or legacy rows).
|
|
392
|
+
*/
|
|
393
|
+
readonly output: unknown;
|
|
394
|
+
};
|
|
395
|
+
|
|
396
|
+
/** Runs list payload (`GET /console/runs`). */
|
|
397
|
+
export type RunsListPayload = {
|
|
398
|
+
readonly runs: RunRow[];
|
|
399
|
+
};
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* GET /console/runs — recent wide events for the Traces pane.
|
|
403
|
+
*/
|
|
404
|
+
export async function runsList(): Promise<ConsoleApiResult<RunsListPayload>> {
|
|
405
|
+
return consoleFetch<RunsListPayload>("/console/runs");
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
/** Request body for `POST /console/runs/query`. */
|
|
409
|
+
export type RunsQueryInput = {
|
|
410
|
+
readonly sql: string;
|
|
411
|
+
readonly revealPii?: boolean;
|
|
412
|
+
};
|
|
413
|
+
|
|
414
|
+
/** Success payload from `POST /console/runs/query`. */
|
|
415
|
+
export type RunsQueryResult = {
|
|
416
|
+
readonly rows: ReadonlyArray<Readonly<Record<string, unknown>>>;
|
|
417
|
+
readonly truncated: boolean;
|
|
418
|
+
readonly rowCount: number;
|
|
419
|
+
readonly masked: "column-keys";
|
|
420
|
+
readonly durationMs: number;
|
|
421
|
+
readonly limitation: "RunsQueryPiiProjectionGap";
|
|
422
|
+
readonly injectedLimit: boolean;
|
|
423
|
+
};
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* POST /console/runs/query — sandboxed DuckDB SQL over persisted runs.
|
|
427
|
+
* PII masking is column-key only (`RunsQueryPiiProjectionGap`).
|
|
428
|
+
*
|
|
429
|
+
* @param body - SQL + optional reveal
|
|
430
|
+
*/
|
|
431
|
+
export async function runsQuery(body: RunsQueryInput): Promise<ConsoleApiResult<RunsQueryResult>> {
|
|
432
|
+
return consoleFetch<RunsQueryResult>("/console/runs/query", {
|
|
433
|
+
method: "POST",
|
|
434
|
+
body: JSON.stringify(body),
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
/** Request body for `POST /console/traces/replay`. */
|
|
439
|
+
export type TracesReplayInput = {
|
|
440
|
+
readonly rootId: string;
|
|
441
|
+
readonly dryRun: boolean;
|
|
442
|
+
};
|
|
443
|
+
|
|
444
|
+
/** Success payload from `POST /console/traces/replay`. */
|
|
445
|
+
export type TracesReplayResult = {
|
|
446
|
+
readonly ok: true;
|
|
447
|
+
readonly rootId: string;
|
|
448
|
+
readonly dryRun: boolean;
|
|
449
|
+
readonly at: number;
|
|
450
|
+
readonly flow: string;
|
|
451
|
+
};
|
|
452
|
+
|
|
453
|
+
/**
|
|
454
|
+
* POST /console/traces/replay — re-invoke a past run via the same path as `oke replay`.
|
|
455
|
+
*
|
|
456
|
+
* @param body - Root run id + dry-run preference
|
|
457
|
+
*/
|
|
458
|
+
export async function tracesReplay(
|
|
459
|
+
body: TracesReplayInput,
|
|
460
|
+
): Promise<ConsoleApiResult<TracesReplayResult>> {
|
|
461
|
+
return consoleFetch<TracesReplayResult>("/console/traces/replay", {
|
|
462
|
+
method: "POST",
|
|
463
|
+
body: JSON.stringify(body),
|
|
464
|
+
});
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
/** One identity from `GET /console/flows/identities`. */
|
|
468
|
+
export type FlowIdentity = {
|
|
469
|
+
readonly id: string;
|
|
470
|
+
readonly email: string;
|
|
471
|
+
readonly name: string;
|
|
472
|
+
readonly status: string;
|
|
473
|
+
readonly scopes: readonly string[];
|
|
474
|
+
};
|
|
475
|
+
|
|
476
|
+
/** Identities list payload. */
|
|
477
|
+
export type FlowsIdentitiesPayload = {
|
|
478
|
+
readonly identities: readonly FlowIdentity[];
|
|
479
|
+
};
|
|
480
|
+
|
|
481
|
+
/**
|
|
482
|
+
* GET /console/flows/identities — invoke-as picker.
|
|
483
|
+
*/
|
|
484
|
+
export async function flowsIdentities(): Promise<ConsoleApiResult<FlowsIdentitiesPayload>> {
|
|
485
|
+
return consoleFetch<FlowsIdentitiesPayload>("/console/flows/identities");
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
/** Request body for `POST /console/flows/invoke`. */
|
|
489
|
+
export type FlowsInvokeInput = {
|
|
490
|
+
readonly flowId: string;
|
|
491
|
+
readonly body: unknown;
|
|
492
|
+
/** Seeded identity id when Invoke As → User. Omit for Operator / Public / policy. */
|
|
493
|
+
readonly asUserId?: string;
|
|
494
|
+
/** `public` or a policy Gate name. Omit for Operator bypass. */
|
|
495
|
+
readonly asGate?: string;
|
|
496
|
+
readonly pathParams?: Readonly<Record<string, string>>;
|
|
497
|
+
readonly confirmation?: string;
|
|
498
|
+
readonly reason?: string;
|
|
499
|
+
/** Return classified PII in the handler response (audited). */
|
|
500
|
+
readonly revealPii?: boolean;
|
|
501
|
+
};
|
|
502
|
+
|
|
503
|
+
/** Success payload from `POST /console/flows/invoke`. */
|
|
504
|
+
export type FlowsInvokeResult = {
|
|
505
|
+
readonly ok: true;
|
|
506
|
+
readonly flowId: string;
|
|
507
|
+
readonly asUserId: string;
|
|
508
|
+
readonly asGate?: string | null;
|
|
509
|
+
readonly trigger: string;
|
|
510
|
+
readonly response: unknown;
|
|
511
|
+
/** True when classified PII keys were redacted. */
|
|
512
|
+
readonly masked: boolean;
|
|
513
|
+
readonly status?: number;
|
|
514
|
+
readonly failure?: {
|
|
515
|
+
readonly code: string;
|
|
516
|
+
readonly data?: unknown;
|
|
517
|
+
readonly message?: string;
|
|
518
|
+
};
|
|
519
|
+
readonly runId?: string;
|
|
520
|
+
/** Host telemetry cache dimension when the invoke adapter reported one. */
|
|
521
|
+
readonly cache?: "hit" | "miss" | "none";
|
|
522
|
+
/** Handler duration from the host execute (high-res ms). */
|
|
523
|
+
readonly durationMs?: number;
|
|
524
|
+
readonly peakTier: string;
|
|
525
|
+
readonly auditedAt: number;
|
|
526
|
+
};
|
|
527
|
+
|
|
528
|
+
/**
|
|
529
|
+
* POST /console/flows/invoke — real host invoke-as (operator session).
|
|
530
|
+
*
|
|
531
|
+
* @param body - Flow id, body, assumed identity
|
|
532
|
+
*/
|
|
533
|
+
export async function flowsInvoke(
|
|
534
|
+
body: FlowsInvokeInput,
|
|
535
|
+
): Promise<ConsoleApiResult<FlowsInvokeResult>> {
|
|
536
|
+
return consoleFetch<FlowsInvokeResult>("/console/flows/invoke", {
|
|
537
|
+
method: "POST",
|
|
538
|
+
body: JSON.stringify(body),
|
|
539
|
+
});
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
/** Cron health from `GET /console/clock`. */
|
|
543
|
+
export type ClockCronHealth = {
|
|
544
|
+
readonly driftMs: number | null;
|
|
545
|
+
readonly overdue: boolean;
|
|
546
|
+
readonly missedRuns: number;
|
|
547
|
+
readonly catchUp: "one";
|
|
548
|
+
readonly leaderInstanceId?: string;
|
|
549
|
+
readonly leaderLeaseUntil?: number;
|
|
550
|
+
};
|
|
551
|
+
|
|
552
|
+
/** One cron row from `GET /console/clock`. */
|
|
553
|
+
export type ClockListCron = {
|
|
554
|
+
readonly name: string;
|
|
555
|
+
readonly status: "active" | "paused" | "orphaned";
|
|
556
|
+
readonly health: ClockCronHealth;
|
|
557
|
+
};
|
|
558
|
+
|
|
559
|
+
/** Clock list payload (`GET /console/clock`). */
|
|
560
|
+
export type ClockListPayload = {
|
|
561
|
+
readonly now: number;
|
|
562
|
+
readonly crons: readonly ClockListCron[];
|
|
563
|
+
};
|
|
564
|
+
|
|
565
|
+
/**
|
|
566
|
+
* GET /console/clock — cron health + lease holder (not a fleet registry).
|
|
567
|
+
*/
|
|
568
|
+
export async function clockList(): Promise<ConsoleApiResult<ClockListPayload>> {
|
|
569
|
+
return consoleFetch<ClockListPayload>("/console/clock");
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
/** Clock lease currently held by an instance (`GET /console/instances`). */
|
|
573
|
+
export type InstanceClockLease = {
|
|
574
|
+
readonly name: string;
|
|
575
|
+
readonly leaseUntil: number;
|
|
576
|
+
};
|
|
577
|
+
|
|
578
|
+
/** Journal run lease currently held by an instance (`GET /console/instances`). */
|
|
579
|
+
export type InstanceJournalLease = {
|
|
580
|
+
readonly runId: string;
|
|
581
|
+
readonly flow: string;
|
|
582
|
+
readonly leaseUntil: number;
|
|
583
|
+
};
|
|
584
|
+
|
|
585
|
+
/** One live instance from `GET /console/instances`. */
|
|
586
|
+
export type InstanceDetail = {
|
|
587
|
+
readonly id: string;
|
|
588
|
+
readonly startedAt: number;
|
|
589
|
+
readonly heartbeatAt: number;
|
|
590
|
+
readonly leaseExpiresAt: number;
|
|
591
|
+
readonly env: "dev" | "test" | "prod";
|
|
592
|
+
readonly pid?: number;
|
|
593
|
+
readonly clock: readonly InstanceClockLease[];
|
|
594
|
+
readonly journal: readonly InstanceJournalLease[];
|
|
595
|
+
};
|
|
596
|
+
|
|
597
|
+
/** Registry unbound — not a zero count. */
|
|
598
|
+
export type InstancesListEmpty = {
|
|
599
|
+
readonly kind: "empty";
|
|
600
|
+
};
|
|
601
|
+
|
|
602
|
+
/** Live fleet snapshot. */
|
|
603
|
+
export type InstancesListFleet = {
|
|
604
|
+
readonly kind: "fleet";
|
|
605
|
+
readonly now: number;
|
|
606
|
+
readonly alive: number;
|
|
607
|
+
readonly instances: readonly InstanceDetail[];
|
|
608
|
+
};
|
|
609
|
+
|
|
610
|
+
/** Fleet list payload (`GET /console/instances`). */
|
|
611
|
+
export type InstancesListPayload = InstancesListEmpty | InstancesListFleet;
|
|
612
|
+
|
|
613
|
+
/**
|
|
614
|
+
* GET /console/instances — live process count + lease ownership snapshot.
|
|
615
|
+
*/
|
|
616
|
+
export async function instancesList(): Promise<ConsoleApiResult<InstancesListPayload>> {
|
|
617
|
+
return consoleFetch<InstancesListPayload>("/console/instances");
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
/** One signal row from `GET /console/signals`. */
|
|
621
|
+
export type SignalsListRow = {
|
|
622
|
+
readonly name: string;
|
|
623
|
+
readonly pending: number;
|
|
624
|
+
readonly inflight: number;
|
|
625
|
+
readonly dead: number;
|
|
626
|
+
readonly outboxLagMs: number | null;
|
|
627
|
+
};
|
|
628
|
+
|
|
629
|
+
/** Signals list payload (`GET /console/signals`). */
|
|
630
|
+
export type SignalsListPayload = {
|
|
631
|
+
readonly signals: readonly SignalsListRow[];
|
|
632
|
+
};
|
|
633
|
+
|
|
634
|
+
/**
|
|
635
|
+
* GET /console/signals — queue lag / depth from the Console host bus.
|
|
636
|
+
*/
|
|
637
|
+
export async function signalsList(): Promise<ConsoleApiResult<SignalsListPayload>> {
|
|
638
|
+
return consoleFetch<SignalsListPayload>("/console/signals");
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
/** Per-prompt-version metrics from `GET /console/ai`. */
|
|
642
|
+
export type AiListVersion = {
|
|
643
|
+
readonly prompt: string;
|
|
644
|
+
readonly version: number;
|
|
645
|
+
readonly sampleCount: number;
|
|
646
|
+
readonly cost: {
|
|
647
|
+
readonly mean: number;
|
|
648
|
+
readonly p95: number;
|
|
649
|
+
};
|
|
650
|
+
};
|
|
651
|
+
|
|
652
|
+
/** AI list payload (`GET /console/ai`). */
|
|
653
|
+
export type AiListPayload = {
|
|
654
|
+
readonly prompts: ReadonlyArray<{ readonly name: string }>;
|
|
655
|
+
readonly versions: readonly AiListVersion[];
|
|
656
|
+
};
|
|
657
|
+
|
|
658
|
+
/**
|
|
659
|
+
* GET /console/ai — catalogue + journal metrics (often empty on a real host).
|
|
660
|
+
*/
|
|
661
|
+
export async function aiList(): Promise<ConsoleApiResult<AiListPayload>> {
|
|
662
|
+
return consoleFetch<AiListPayload>("/console/ai");
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
/** Request body for `POST /console/clock/run-now`. */
|
|
666
|
+
export type ClockRunNowInput = {
|
|
667
|
+
readonly name: string;
|
|
668
|
+
readonly confirmation?: string;
|
|
669
|
+
readonly reason?: string;
|
|
670
|
+
};
|
|
671
|
+
|
|
672
|
+
/** Success payload from `POST /console/clock/run-now`. */
|
|
673
|
+
export type ClockRunNowResult = {
|
|
674
|
+
readonly ok: true;
|
|
675
|
+
readonly name: string;
|
|
676
|
+
readonly ran: boolean;
|
|
677
|
+
readonly at: number;
|
|
678
|
+
};
|
|
679
|
+
|
|
680
|
+
/**
|
|
681
|
+
* POST /console/clock/run-now — lease-gated cron tick (Clock panel).
|
|
682
|
+
*
|
|
683
|
+
* @param body - Clock name + optional typed confirmation
|
|
684
|
+
*/
|
|
685
|
+
export async function clockRunNow(
|
|
686
|
+
body: ClockRunNowInput,
|
|
687
|
+
): Promise<ConsoleApiResult<ClockRunNowResult>> {
|
|
688
|
+
return consoleFetch<ClockRunNowResult>("/console/clock/run-now", {
|
|
689
|
+
method: "POST",
|
|
690
|
+
body: JSON.stringify(body),
|
|
691
|
+
});
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
/** Store facet from `GET /console/store` / query. */
|
|
695
|
+
export type StoreFacet = "sql" | "kv" | "files" | "index";
|
|
696
|
+
|
|
697
|
+
/** Will-not-fire projection on a store child (matches server `WillNotFireOut`). */
|
|
698
|
+
export type StoreWillNotFire = {
|
|
699
|
+
readonly writerFlowIds: readonly string[];
|
|
700
|
+
readonly signals: readonly string[];
|
|
701
|
+
readonly channels: readonly string[];
|
|
702
|
+
};
|
|
703
|
+
|
|
704
|
+
/** Cache sub-view on a store child. */
|
|
705
|
+
export type StoreChildCache = {
|
|
706
|
+
readonly producedByRead: string;
|
|
707
|
+
readonly invalidatedByWrites: readonly string[];
|
|
708
|
+
readonly invalidatingFlowIds: readonly string[];
|
|
709
|
+
};
|
|
710
|
+
|
|
711
|
+
/** Child resource under a store (table / namespace / bucket / index). */
|
|
712
|
+
export type StoreListChild = {
|
|
713
|
+
readonly name: string;
|
|
714
|
+
readonly effectRef: string;
|
|
715
|
+
readonly kind?: "table" | "index" | "function" | "trigger" | "extension" | "policy";
|
|
716
|
+
readonly writers: readonly string[];
|
|
717
|
+
readonly readers: readonly string[];
|
|
718
|
+
readonly cache: StoreChildCache;
|
|
719
|
+
readonly willNotFire: StoreWillNotFire;
|
|
720
|
+
readonly piiColumns: readonly string[];
|
|
721
|
+
readonly columnDescriptions: Readonly<Record<string, string>>;
|
|
722
|
+
/** Live RLS when the engine reported `pg_class.relrowsecurity`. */
|
|
723
|
+
readonly rls?: boolean;
|
|
724
|
+
};
|
|
725
|
+
|
|
726
|
+
/** One store row from `GET /console/store` (matches server `StoreListOut`). */
|
|
727
|
+
export type StoreListStore = {
|
|
728
|
+
readonly ref: string;
|
|
729
|
+
readonly facet: StoreFacet;
|
|
730
|
+
readonly name: string;
|
|
731
|
+
readonly description?: string;
|
|
732
|
+
readonly children: readonly StoreListChild[];
|
|
733
|
+
readonly replicaLagMs: number | null;
|
|
734
|
+
readonly migrationDrift: {
|
|
735
|
+
readonly declared: string;
|
|
736
|
+
readonly applied: string | null;
|
|
737
|
+
readonly drifted: boolean;
|
|
738
|
+
} | null;
|
|
739
|
+
readonly contentAddressed: boolean;
|
|
740
|
+
/** Files driver when the Console could open the handle. */
|
|
741
|
+
readonly driverId?: "memory" | "fs" | "s3";
|
|
742
|
+
readonly warnings: ReadonlyArray<{
|
|
743
|
+
readonly code: string;
|
|
744
|
+
readonly message: string;
|
|
745
|
+
readonly key: string;
|
|
746
|
+
}>;
|
|
747
|
+
};
|
|
748
|
+
|
|
749
|
+
/** Store list payload (`GET /console/store`). */
|
|
750
|
+
export type StoreListPayload = {
|
|
751
|
+
readonly tenancyDeclared: boolean;
|
|
752
|
+
readonly tenants: readonly string[];
|
|
753
|
+
readonly stores: readonly StoreListStore[];
|
|
754
|
+
};
|
|
755
|
+
|
|
756
|
+
/**
|
|
757
|
+
* GET /console/store — projected Manifest stores for operator browse.
|
|
758
|
+
*/
|
|
759
|
+
export async function storeList(): Promise<ConsoleApiResult<StoreListPayload>> {
|
|
760
|
+
return consoleFetch<StoreListPayload>("/console/store");
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
/** Request body for `QUERY /console/store/query`. */
|
|
764
|
+
export type StoreQueryInput = {
|
|
765
|
+
readonly ref: string;
|
|
766
|
+
readonly child?: string;
|
|
767
|
+
readonly tenant?: string;
|
|
768
|
+
readonly prefix?: string;
|
|
769
|
+
readonly limit?: number;
|
|
770
|
+
readonly vector?: readonly number[];
|
|
771
|
+
readonly q?: string;
|
|
772
|
+
readonly topK?: number;
|
|
773
|
+
/** When true, SQL browse returns PII cleartext (audited). Default masks. */
|
|
774
|
+
readonly revealPii?: boolean;
|
|
775
|
+
};
|
|
776
|
+
|
|
777
|
+
/** Success payload from `QUERY /console/store/query` (matches server `StoreQueryOut`). */
|
|
778
|
+
export type StoreQueryResult = {
|
|
779
|
+
readonly facet: StoreFacet;
|
|
780
|
+
readonly rows?: ReadonlyArray<Readonly<Record<string, unknown>>>;
|
|
781
|
+
readonly keys?: ReadonlyArray<{
|
|
782
|
+
readonly key: string;
|
|
783
|
+
readonly value?: unknown;
|
|
784
|
+
readonly ttlMs?: number | null;
|
|
785
|
+
readonly sizeBytes?: number;
|
|
786
|
+
readonly originalName?: string;
|
|
787
|
+
readonly warnings?: ReadonlyArray<{ readonly code: string; readonly message: string }>;
|
|
788
|
+
}>;
|
|
789
|
+
readonly hits?: ReadonlyArray<{
|
|
790
|
+
readonly id: string;
|
|
791
|
+
readonly score: number;
|
|
792
|
+
readonly meta?: Readonly<Record<string, unknown>>;
|
|
793
|
+
}>;
|
|
794
|
+
readonly masked: boolean;
|
|
795
|
+
readonly routedRole?: "primary" | "replica";
|
|
796
|
+
};
|
|
797
|
+
|
|
798
|
+
/**
|
|
799
|
+
* QUERY /console/store/query — browse rows / keys / hits (PII masked unless `revealPii`).
|
|
800
|
+
*
|
|
801
|
+
* @param body - Store ref + child + browse options
|
|
802
|
+
*/
|
|
803
|
+
export async function storeQuery(
|
|
804
|
+
body: StoreQueryInput,
|
|
805
|
+
): Promise<ConsoleApiResult<StoreQueryResult>> {
|
|
806
|
+
return consoleFetch<StoreQueryResult>("/console/store/query", {
|
|
807
|
+
method: "QUERY",
|
|
808
|
+
body: JSON.stringify(body),
|
|
809
|
+
});
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
/** Request body for `POST /console/store/reveal`. */
|
|
813
|
+
export type StoreRevealInput = {
|
|
814
|
+
readonly ref: string;
|
|
815
|
+
readonly child?: string;
|
|
816
|
+
readonly tenant?: string;
|
|
817
|
+
readonly id: string;
|
|
818
|
+
readonly column: string;
|
|
819
|
+
};
|
|
820
|
+
|
|
821
|
+
/** Success payload from `POST /console/store/reveal` (matches server `StoreRevealOut`). */
|
|
822
|
+
export type StoreRevealResult = {
|
|
823
|
+
readonly ok: true;
|
|
824
|
+
readonly value: unknown;
|
|
825
|
+
readonly at: number;
|
|
826
|
+
};
|
|
827
|
+
|
|
828
|
+
/**
|
|
829
|
+
* POST /console/store/reveal — audited cleartext for one masked PII cell.
|
|
830
|
+
*
|
|
831
|
+
* @param body - Row id + column under a store child
|
|
832
|
+
*/
|
|
833
|
+
export async function storeReveal(
|
|
834
|
+
body: StoreRevealInput,
|
|
835
|
+
): Promise<ConsoleApiResult<StoreRevealResult>> {
|
|
836
|
+
return consoleFetch<StoreRevealResult>("/console/store/reveal", {
|
|
837
|
+
method: "POST",
|
|
838
|
+
body: JSON.stringify(body),
|
|
839
|
+
});
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
/** Request body for `POST /console/store/edit` (and `/preview`). */
|
|
843
|
+
export type StoreEditInput = {
|
|
844
|
+
readonly ref: string;
|
|
845
|
+
readonly child?: string;
|
|
846
|
+
readonly tenant?: string;
|
|
847
|
+
/** Existing row id. Omit to INSERT; `patch` must include `id`. */
|
|
848
|
+
readonly id?: string;
|
|
849
|
+
readonly key?: string;
|
|
850
|
+
readonly patch: Record<string, unknown>;
|
|
851
|
+
readonly confirmation?: string;
|
|
852
|
+
readonly reason?: string;
|
|
853
|
+
readonly commit?: boolean;
|
|
854
|
+
};
|
|
855
|
+
|
|
856
|
+
/** Success payload from `POST /console/store/edit` (matches server). */
|
|
857
|
+
export type StoreEditResult = {
|
|
858
|
+
readonly ok: true;
|
|
859
|
+
readonly dryRun: boolean;
|
|
860
|
+
readonly applied: boolean;
|
|
861
|
+
readonly willNotFire: StoreWillNotFire;
|
|
862
|
+
readonly wouldHaveFired: ReadonlyArray<{
|
|
863
|
+
readonly kind: "send" | "ask";
|
|
864
|
+
readonly resource: string;
|
|
865
|
+
}>;
|
|
866
|
+
readonly at: number;
|
|
867
|
+
};
|
|
868
|
+
|
|
869
|
+
/**
|
|
870
|
+
* POST /console/store/edit — dry-run by default; `commit: true` applies.
|
|
871
|
+
*
|
|
872
|
+
* @param body - Edit payload (typed confirmation required in production)
|
|
873
|
+
*/
|
|
874
|
+
export async function storeEdit(body: StoreEditInput): Promise<ConsoleApiResult<StoreEditResult>> {
|
|
875
|
+
return consoleFetch<StoreEditResult>("/console/store/edit", {
|
|
876
|
+
method: "POST",
|
|
877
|
+
body: JSON.stringify(body),
|
|
878
|
+
});
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
/**
|
|
882
|
+
* POST /console/store/preview — always dry-run; inspect willNotFire before commit.
|
|
883
|
+
*
|
|
884
|
+
* @param body - Edit payload without confirmation
|
|
885
|
+
*/
|
|
886
|
+
export async function storePreview(
|
|
887
|
+
body: Omit<StoreEditInput, "confirmation" | "reason" | "commit">,
|
|
888
|
+
): Promise<ConsoleApiResult<StoreEditResult>> {
|
|
889
|
+
return consoleFetch<StoreEditResult>("/console/store/preview", {
|
|
890
|
+
method: "POST",
|
|
891
|
+
body: JSON.stringify(body),
|
|
892
|
+
});
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
/** Request body for `POST /console/store/delete`. */
|
|
896
|
+
export type StoreDeleteInput = {
|
|
897
|
+
readonly ref: string;
|
|
898
|
+
readonly child?: string;
|
|
899
|
+
readonly tenant?: string;
|
|
900
|
+
readonly ids?: readonly string[];
|
|
901
|
+
readonly keys?: readonly string[];
|
|
902
|
+
readonly confirmation?: string;
|
|
903
|
+
readonly reason?: string;
|
|
904
|
+
};
|
|
905
|
+
|
|
906
|
+
/** Success payload from `POST /console/store/delete`. */
|
|
907
|
+
export type StoreDeleteResult = {
|
|
908
|
+
readonly ok: true;
|
|
909
|
+
readonly deleted: number;
|
|
910
|
+
readonly at: number;
|
|
911
|
+
};
|
|
912
|
+
|
|
913
|
+
/**
|
|
914
|
+
* POST /console/store/delete — delete rows/keys (typed confirmation in production).
|
|
915
|
+
*
|
|
916
|
+
* @param body - Delete payload
|
|
917
|
+
*/
|
|
918
|
+
export async function storeDelete(
|
|
919
|
+
body: StoreDeleteInput,
|
|
920
|
+
): Promise<ConsoleApiResult<StoreDeleteResult>> {
|
|
921
|
+
return consoleFetch<StoreDeleteResult>("/console/store/delete", {
|
|
922
|
+
method: "POST",
|
|
923
|
+
body: JSON.stringify(body),
|
|
924
|
+
});
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
/** Request body for `POST /console/store/sql`. */
|
|
928
|
+
export type StoreSqlInput = {
|
|
929
|
+
readonly ref: string;
|
|
930
|
+
readonly sql: string;
|
|
931
|
+
readonly tenant?: string;
|
|
932
|
+
readonly allowWrite?: boolean;
|
|
933
|
+
/** When true, classified columns return cleartext (audited). Default masks. */
|
|
934
|
+
readonly revealPii?: boolean;
|
|
935
|
+
/** View rows as this Gate (`oke.gate` on postgres / pglite). */
|
|
936
|
+
readonly asGate?: string;
|
|
937
|
+
};
|
|
938
|
+
|
|
939
|
+
/** Success payload from `POST /console/store/sql` (matches server `StoreSqlOut`). */
|
|
940
|
+
export type StoreSqlResult = {
|
|
941
|
+
readonly rows: ReadonlyArray<Readonly<Record<string, unknown>>>;
|
|
942
|
+
readonly masked: boolean;
|
|
943
|
+
readonly routedRole: "primary" | "replica";
|
|
944
|
+
readonly asGate: string | null;
|
|
945
|
+
readonly gateApplied: boolean;
|
|
946
|
+
};
|
|
947
|
+
|
|
948
|
+
/**
|
|
949
|
+
* POST /console/store/sql — raw SQL console (read-only unless `allowWrite`).
|
|
950
|
+
* PII-classified columns stay masked unless `revealPii` is true.
|
|
951
|
+
*
|
|
952
|
+
* @param body - Store ref + SQL
|
|
953
|
+
*/
|
|
954
|
+
export async function storeSql(body: StoreSqlInput): Promise<ConsoleApiResult<StoreSqlResult>> {
|
|
955
|
+
return consoleFetch<StoreSqlResult>("/console/store/sql", {
|
|
956
|
+
method: "POST",
|
|
957
|
+
body: JSON.stringify(body),
|
|
958
|
+
});
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
/** Named limitation for engine-native query text. */
|
|
962
|
+
export const STORE_SQL_STATS_PII_GAP = "StoreSqlStatsQueryTextGap" as const;
|
|
963
|
+
|
|
964
|
+
/** Request body for `QUERY /console/store/sql/stats`. */
|
|
965
|
+
export type StoreSqlStatsInput = {
|
|
966
|
+
readonly ref: string;
|
|
967
|
+
readonly tenant?: string;
|
|
968
|
+
};
|
|
969
|
+
|
|
970
|
+
/** One pg_stat_statements row from the stats endpoint. */
|
|
971
|
+
export type StoreSqlStatementRow = {
|
|
972
|
+
readonly queryid: string | null;
|
|
973
|
+
readonly query: string | null;
|
|
974
|
+
readonly calls: number;
|
|
975
|
+
readonly totalExecMs: number;
|
|
976
|
+
readonly meanExecMs: number;
|
|
977
|
+
readonly minExecMs: number;
|
|
978
|
+
readonly maxExecMs: number;
|
|
979
|
+
readonly rows: number;
|
|
980
|
+
readonly sharedBlksHit: number;
|
|
981
|
+
readonly sharedBlksRead: number;
|
|
982
|
+
readonly cacheHitRate: number | null;
|
|
983
|
+
};
|
|
984
|
+
|
|
985
|
+
/** Success payload from `QUERY /console/store/sql/stats`. */
|
|
986
|
+
export type StoreSqlStatsResult = {
|
|
987
|
+
readonly statements: readonly StoreSqlStatementRow[];
|
|
988
|
+
readonly kpis: {
|
|
989
|
+
readonly slowQueries: number;
|
|
990
|
+
readonly cacheHitRate: number | null;
|
|
991
|
+
readonly avgRowsPerCall: number | null;
|
|
992
|
+
};
|
|
993
|
+
readonly limitation: typeof STORE_SQL_STATS_PII_GAP;
|
|
994
|
+
readonly rowCount: number;
|
|
995
|
+
readonly truncated: boolean;
|
|
996
|
+
readonly advisor: {
|
|
997
|
+
readonly available: boolean;
|
|
998
|
+
readonly installed: boolean;
|
|
999
|
+
readonly hypopgAvailable: boolean;
|
|
1000
|
+
};
|
|
1001
|
+
};
|
|
1002
|
+
|
|
1003
|
+
/**
|
|
1004
|
+
* QUERY /console/store/sql/stats — pg_stat_statements + KPIs.
|
|
1005
|
+
*
|
|
1006
|
+
* @param body - SQL store ref
|
|
1007
|
+
*/
|
|
1008
|
+
export async function storeSqlStats(
|
|
1009
|
+
body: StoreSqlStatsInput,
|
|
1010
|
+
): Promise<ConsoleApiResult<StoreSqlStatsResult>> {
|
|
1011
|
+
return consoleFetch<StoreSqlStatsResult>("/console/store/sql/stats", {
|
|
1012
|
+
method: "QUERY",
|
|
1013
|
+
body: JSON.stringify(body),
|
|
1014
|
+
});
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
/** Request body for `QUERY /console/store/sql/locks`. */
|
|
1018
|
+
export type StoreSqlLocksInput = {
|
|
1019
|
+
readonly ref: string;
|
|
1020
|
+
readonly tenant?: string;
|
|
1021
|
+
readonly revealPii?: boolean;
|
|
1022
|
+
};
|
|
1023
|
+
|
|
1024
|
+
/** One blocking pair from the locks endpoint. */
|
|
1025
|
+
export type StoreSqlLockRow = {
|
|
1026
|
+
readonly blockedPid: number | null;
|
|
1027
|
+
readonly blockedUser: string | null;
|
|
1028
|
+
readonly blockedQuery: string | null;
|
|
1029
|
+
readonly blockedAt: string | null;
|
|
1030
|
+
readonly blockingPid: number | null;
|
|
1031
|
+
readonly blockingUser: string | null;
|
|
1032
|
+
readonly blockingQuery: string | null;
|
|
1033
|
+
readonly blockingState: string | null;
|
|
1034
|
+
readonly waitEventType: string | null;
|
|
1035
|
+
readonly waitEvent: string | null;
|
|
1036
|
+
};
|
|
1037
|
+
|
|
1038
|
+
/** Success payload from `QUERY /console/store/sql/locks`. */
|
|
1039
|
+
export type StoreSqlLocksResult = {
|
|
1040
|
+
readonly rows: readonly StoreSqlLockRow[];
|
|
1041
|
+
readonly masked: boolean;
|
|
1042
|
+
readonly limitation: typeof STORE_SQL_STATS_PII_GAP;
|
|
1043
|
+
readonly pollingMs: number;
|
|
1044
|
+
};
|
|
1045
|
+
|
|
1046
|
+
/**
|
|
1047
|
+
* QUERY /console/store/sql/locks — who's blocking whom.
|
|
1048
|
+
*
|
|
1049
|
+
* @param body - SQL store ref + optional reveal
|
|
1050
|
+
*/
|
|
1051
|
+
export async function storeSqlLocks(
|
|
1052
|
+
body: StoreSqlLocksInput,
|
|
1053
|
+
): Promise<ConsoleApiResult<StoreSqlLocksResult>> {
|
|
1054
|
+
return consoleFetch<StoreSqlLocksResult>("/console/store/sql/locks", {
|
|
1055
|
+
method: "QUERY",
|
|
1056
|
+
body: JSON.stringify(body),
|
|
1057
|
+
});
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
/** Request body for `POST /console/store/sql/advise`. */
|
|
1061
|
+
export type StoreSqlAdviseInput = {
|
|
1062
|
+
readonly ref: string;
|
|
1063
|
+
readonly query: string;
|
|
1064
|
+
readonly tenant?: string;
|
|
1065
|
+
};
|
|
1066
|
+
|
|
1067
|
+
/** Success payload from `POST /console/store/sql/advise`. */
|
|
1068
|
+
export type StoreSqlAdviseResult = {
|
|
1069
|
+
readonly startupCostBefore: unknown;
|
|
1070
|
+
readonly startupCostAfter: unknown;
|
|
1071
|
+
readonly totalCostBefore: unknown;
|
|
1072
|
+
readonly totalCostAfter: unknown;
|
|
1073
|
+
readonly indexStatements: readonly string[];
|
|
1074
|
+
readonly errors: readonly string[];
|
|
1075
|
+
};
|
|
1076
|
+
|
|
1077
|
+
/**
|
|
1078
|
+
* POST /console/store/sql/advise — `index_advisor(query)`.
|
|
1079
|
+
*
|
|
1080
|
+
* @param body - Store ref + captured statement text
|
|
1081
|
+
*/
|
|
1082
|
+
export async function storeSqlAdvise(
|
|
1083
|
+
body: StoreSqlAdviseInput,
|
|
1084
|
+
): Promise<ConsoleApiResult<StoreSqlAdviseResult>> {
|
|
1085
|
+
return consoleFetch<StoreSqlAdviseResult>("/console/store/sql/advise", {
|
|
1086
|
+
method: "POST",
|
|
1087
|
+
body: JSON.stringify(body),
|
|
1088
|
+
});
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
/** Named limitation: INFO is instance-wide, not `oke:kv:{ns}:`. */
|
|
1092
|
+
export const STORE_KV_STATS_SERVER_WIDE_GAP = "StoreKvStatsServerWideGap" as const;
|
|
1093
|
+
|
|
1094
|
+
/** Named limitation: SLOWLOG args include keys and values. */
|
|
1095
|
+
export const STORE_KV_STATS_SLOWLOG_ARGS_GAP = "StoreKvStatsSlowlogArgsGap" as const;
|
|
1096
|
+
|
|
1097
|
+
/** Request body for `QUERY /console/store/kv/stats`. */
|
|
1098
|
+
export type StoreKvStatsInput = {
|
|
1099
|
+
readonly ref: string;
|
|
1100
|
+
readonly tenant?: string;
|
|
1101
|
+
readonly revealPii?: boolean;
|
|
1102
|
+
};
|
|
1103
|
+
|
|
1104
|
+
/** One INFO commandstats row. */
|
|
1105
|
+
export type StoreKvCommandStatRow = {
|
|
1106
|
+
readonly command: string;
|
|
1107
|
+
readonly calls: number;
|
|
1108
|
+
readonly usec: number;
|
|
1109
|
+
readonly usecPerCall: number | null;
|
|
1110
|
+
};
|
|
1111
|
+
|
|
1112
|
+
/** One SLOWLOG row (args collapsed unless reveal). */
|
|
1113
|
+
export type StoreKvSlowlogRow = {
|
|
1114
|
+
readonly id: number;
|
|
1115
|
+
readonly timestamp: number;
|
|
1116
|
+
readonly durationUs: number;
|
|
1117
|
+
readonly command: string;
|
|
1118
|
+
readonly args: readonly string[];
|
|
1119
|
+
};
|
|
1120
|
+
|
|
1121
|
+
/** Success payload from `QUERY /console/store/kv/stats`. */
|
|
1122
|
+
export type StoreKvStatsResult = {
|
|
1123
|
+
readonly engine: "redis" | "memory";
|
|
1124
|
+
readonly kpis: {
|
|
1125
|
+
readonly hitRate: number | null;
|
|
1126
|
+
readonly opsPerSec: number | null;
|
|
1127
|
+
readonly evictedKeys: number | null;
|
|
1128
|
+
readonly expiredKeys: number | null;
|
|
1129
|
+
};
|
|
1130
|
+
readonly commands: readonly StoreKvCommandStatRow[];
|
|
1131
|
+
readonly slowlog: readonly StoreKvSlowlogRow[];
|
|
1132
|
+
readonly latency: ReadonlyArray<{
|
|
1133
|
+
readonly event: string;
|
|
1134
|
+
readonly latestUs: number | null;
|
|
1135
|
+
readonly allTimeUs: number | null;
|
|
1136
|
+
}>;
|
|
1137
|
+
readonly limitation: typeof STORE_KV_STATS_SERVER_WIDE_GAP;
|
|
1138
|
+
readonly slowlogLimitation: typeof STORE_KV_STATS_SLOWLOG_ARGS_GAP;
|
|
1139
|
+
readonly masked: boolean;
|
|
1140
|
+
readonly namespacePrefix: string;
|
|
1141
|
+
};
|
|
1142
|
+
|
|
1143
|
+
/**
|
|
1144
|
+
* QUERY /console/store/kv/stats — Redis-wire INFO / COMMANDSTATS / SLOWLOG.
|
|
1145
|
+
*
|
|
1146
|
+
* @param body - KV store ref + optional reveal
|
|
1147
|
+
*/
|
|
1148
|
+
export async function storeKvStats(
|
|
1149
|
+
body: StoreKvStatsInput,
|
|
1150
|
+
): Promise<ConsoleApiResult<StoreKvStatsResult>> {
|
|
1151
|
+
return consoleFetch<StoreKvStatsResult>("/console/store/kv/stats", {
|
|
1152
|
+
method: "QUERY",
|
|
1153
|
+
body: JSON.stringify(body),
|
|
1154
|
+
});
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
/** Request body for `POST /console/store/object`. */
|
|
1158
|
+
export type StoreFileGetInput = {
|
|
1159
|
+
readonly ref: string;
|
|
1160
|
+
readonly key: string;
|
|
1161
|
+
readonly tenant?: string;
|
|
1162
|
+
};
|
|
1163
|
+
|
|
1164
|
+
/** Success payload from `POST /console/store/object`. */
|
|
1165
|
+
export type StoreFileObject = {
|
|
1166
|
+
readonly key: string;
|
|
1167
|
+
readonly sizeBytes: number;
|
|
1168
|
+
readonly contentType: string;
|
|
1169
|
+
readonly encoding: "utf8" | "base64";
|
|
1170
|
+
readonly body: string;
|
|
1171
|
+
readonly truncated: boolean;
|
|
1172
|
+
readonly originalName?: string;
|
|
1173
|
+
readonly warnings: ReadonlyArray<{ readonly code: string; readonly message: string }>;
|
|
1174
|
+
};
|
|
1175
|
+
|
|
1176
|
+
/**
|
|
1177
|
+
* POST /console/store/object — read one files object for preview / download.
|
|
1178
|
+
*
|
|
1179
|
+
* @param body - Store ref + object key
|
|
1180
|
+
*/
|
|
1181
|
+
export async function storeFileGet(
|
|
1182
|
+
body: StoreFileGetInput,
|
|
1183
|
+
): Promise<ConsoleApiResult<StoreFileObject>> {
|
|
1184
|
+
return consoleFetch<StoreFileObject>("/console/store/object", {
|
|
1185
|
+
method: "POST",
|
|
1186
|
+
body: JSON.stringify(body),
|
|
1187
|
+
});
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
/** Resolution layer from `GET /console/vault`. */
|
|
1191
|
+
export type VaultResolutionSource = "process.env" | ".env.local" | "driver" | "dev-fallback";
|
|
1192
|
+
|
|
1193
|
+
/** One vault contract from `GET /console/vault`. */
|
|
1194
|
+
export type VaultListRow = {
|
|
1195
|
+
readonly name: string;
|
|
1196
|
+
readonly kind: "secret" | "config";
|
|
1197
|
+
readonly sensitive: boolean;
|
|
1198
|
+
readonly description?: string;
|
|
1199
|
+
readonly rotate?: string;
|
|
1200
|
+
readonly fingerprints: Readonly<Record<string, string>>;
|
|
1201
|
+
readonly fingerprint: string | null;
|
|
1202
|
+
readonly cleartext: string | null;
|
|
1203
|
+
readonly winner: VaultResolutionSource | null;
|
|
1204
|
+
readonly resolution: ReadonlyArray<{
|
|
1205
|
+
readonly source: VaultResolutionSource;
|
|
1206
|
+
readonly present: boolean;
|
|
1207
|
+
readonly won: boolean;
|
|
1208
|
+
}>;
|
|
1209
|
+
readonly readers: readonly string[];
|
|
1210
|
+
readonly blastRadius: {
|
|
1211
|
+
readonly count: number;
|
|
1212
|
+
readonly longestWakeAt: number | null;
|
|
1213
|
+
readonly longestOutstandingMs: number | null;
|
|
1214
|
+
readonly runIds: readonly string[];
|
|
1215
|
+
};
|
|
1216
|
+
readonly lastReadAt: number | null;
|
|
1217
|
+
readonly sharedFingerprintEnvs: readonly string[];
|
|
1218
|
+
readonly origin?: "source" | "console";
|
|
1219
|
+
};
|
|
1220
|
+
|
|
1221
|
+
/** Built-in backend status from `GET /console/vault`. */
|
|
1222
|
+
export type VaultBuiltinStatus = {
|
|
1223
|
+
readonly initialized: boolean;
|
|
1224
|
+
readonly sealed: boolean;
|
|
1225
|
+
readonly masterKeyPresent: boolean;
|
|
1226
|
+
readonly kekVersion: number;
|
|
1227
|
+
readonly secretCount: number;
|
|
1228
|
+
readonly sealCount: number;
|
|
1229
|
+
readonly lastSealedAt: number | null;
|
|
1230
|
+
readonly lastUnsealedAt: number | null;
|
|
1231
|
+
readonly rewrapTargetKekVersion: number | null;
|
|
1232
|
+
};
|
|
1233
|
+
|
|
1234
|
+
/** Backend badge from `GET /console/vault`. */
|
|
1235
|
+
export type VaultBackend = {
|
|
1236
|
+
readonly driverId: "env" | "vault" | "managed" | "memory";
|
|
1237
|
+
readonly builtin: boolean;
|
|
1238
|
+
readonly status: VaultBuiltinStatus | null;
|
|
1239
|
+
readonly unavailable: string | null;
|
|
1240
|
+
readonly provider: string | null;
|
|
1241
|
+
};
|
|
1242
|
+
|
|
1243
|
+
/** Vault list payload (`GET /console/vault`). */
|
|
1244
|
+
export type VaultListPayload = {
|
|
1245
|
+
readonly secrets: readonly VaultListRow[];
|
|
1246
|
+
readonly env: string;
|
|
1247
|
+
readonly backend: VaultBackend | null;
|
|
1248
|
+
};
|
|
1249
|
+
|
|
1250
|
+
/**
|
|
1251
|
+
* GET /console/vault — fingerprints only; never secret values.
|
|
1252
|
+
*/
|
|
1253
|
+
export async function vaultList(): Promise<ConsoleApiResult<VaultListPayload>> {
|
|
1254
|
+
return consoleFetch<VaultListPayload>("/console/vault");
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
/** Request body for `POST /console/vault/set` and `/rotate`. */
|
|
1258
|
+
export type VaultWriteInput = {
|
|
1259
|
+
readonly name: string;
|
|
1260
|
+
readonly value: string;
|
|
1261
|
+
readonly reason: string;
|
|
1262
|
+
readonly confirmation?: string;
|
|
1263
|
+
};
|
|
1264
|
+
|
|
1265
|
+
/** Success payload from vault set / rotate. */
|
|
1266
|
+
export type VaultWriteResult = {
|
|
1267
|
+
readonly ok: true;
|
|
1268
|
+
readonly name: string;
|
|
1269
|
+
readonly fingerprint: string | null;
|
|
1270
|
+
readonly at: number;
|
|
1271
|
+
};
|
|
1272
|
+
|
|
1273
|
+
/**
|
|
1274
|
+
* POST /console/vault/set — write a contract value (reason required).
|
|
1275
|
+
*
|
|
1276
|
+
* @param body - Name + value + reason
|
|
1277
|
+
*/
|
|
1278
|
+
export async function vaultSet(body: VaultWriteInput): Promise<ConsoleApiResult<VaultWriteResult>> {
|
|
1279
|
+
return consoleFetch<VaultWriteResult>("/console/vault/set", {
|
|
1280
|
+
method: "POST",
|
|
1281
|
+
body: JSON.stringify(body),
|
|
1282
|
+
});
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
/** Request body for `POST /console/vault/create`. */
|
|
1286
|
+
export type VaultCreateInput = {
|
|
1287
|
+
readonly name: string;
|
|
1288
|
+
readonly value: string;
|
|
1289
|
+
readonly kind: "secret" | "config";
|
|
1290
|
+
readonly description?: string;
|
|
1291
|
+
readonly rotate?: string;
|
|
1292
|
+
};
|
|
1293
|
+
|
|
1294
|
+
/**
|
|
1295
|
+
* POST /console/vault/create — declare a contract from Console and set its value.
|
|
1296
|
+
*
|
|
1297
|
+
* @param body - Kind + name + value
|
|
1298
|
+
*/
|
|
1299
|
+
export async function vaultCreate(
|
|
1300
|
+
body: VaultCreateInput,
|
|
1301
|
+
): Promise<ConsoleApiResult<VaultWriteResult>> {
|
|
1302
|
+
return consoleFetch<VaultWriteResult>("/console/vault/create", {
|
|
1303
|
+
method: "POST",
|
|
1304
|
+
body: JSON.stringify(body),
|
|
1305
|
+
});
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1308
|
+
/**
|
|
1309
|
+
* POST /console/vault/rotate — rotate a contract value (reason required).
|
|
1310
|
+
*
|
|
1311
|
+
* @param body - Name + value + reason
|
|
1312
|
+
*/
|
|
1313
|
+
export async function vaultRotate(
|
|
1314
|
+
body: VaultWriteInput,
|
|
1315
|
+
): Promise<ConsoleApiResult<VaultWriteResult>> {
|
|
1316
|
+
return consoleFetch<VaultWriteResult>("/console/vault/rotate", {
|
|
1317
|
+
method: "POST",
|
|
1318
|
+
body: JSON.stringify(body),
|
|
1319
|
+
});
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1322
|
+
/** Request body for `POST /console/vault/rotate-master`. */
|
|
1323
|
+
export type VaultRotateMasterInput = {
|
|
1324
|
+
readonly confirmation?: string;
|
|
1325
|
+
readonly reason?: string;
|
|
1326
|
+
};
|
|
1327
|
+
|
|
1328
|
+
/** Success payload from `POST /console/vault/rotate-master`. */
|
|
1329
|
+
export type VaultRotateMasterResult = {
|
|
1330
|
+
readonly ok: true;
|
|
1331
|
+
readonly kekVersion: number;
|
|
1332
|
+
readonly remaining: number;
|
|
1333
|
+
readonly masterKey: string | null;
|
|
1334
|
+
readonly at: number;
|
|
1335
|
+
};
|
|
1336
|
+
|
|
1337
|
+
/**
|
|
1338
|
+
* POST /console/vault/rotate-master — one KEK rewrap batch.
|
|
1339
|
+
*
|
|
1340
|
+
* @param body - Typed confirm
|
|
1341
|
+
*/
|
|
1342
|
+
export async function vaultRotateMaster(
|
|
1343
|
+
body: VaultRotateMasterInput,
|
|
1344
|
+
): Promise<ConsoleApiResult<VaultRotateMasterResult>> {
|
|
1345
|
+
return consoleFetch<VaultRotateMasterResult>("/console/vault/rotate-master", {
|
|
1346
|
+
method: "POST",
|
|
1347
|
+
body: JSON.stringify(body),
|
|
1348
|
+
});
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
/** Operator-safe audit row from `GET /console/vault/audit/verify`. */
|
|
1352
|
+
export type VaultAuditRow = {
|
|
1353
|
+
readonly id: string;
|
|
1354
|
+
readonly seq: number;
|
|
1355
|
+
readonly action: string;
|
|
1356
|
+
readonly path: string | null;
|
|
1357
|
+
readonly actorType: string;
|
|
1358
|
+
readonly actorId: string | null;
|
|
1359
|
+
readonly success: boolean;
|
|
1360
|
+
readonly errorCode: string | null;
|
|
1361
|
+
readonly errorMessage: string | null;
|
|
1362
|
+
readonly requestId: string | null;
|
|
1363
|
+
readonly createdAt: number;
|
|
1364
|
+
};
|
|
1365
|
+
|
|
1366
|
+
/** Success payload from `GET /console/vault/audit/verify`. */
|
|
1367
|
+
export type VaultAuditVerifyResult = {
|
|
1368
|
+
readonly ok: boolean;
|
|
1369
|
+
readonly brokenAt: string | null;
|
|
1370
|
+
readonly reason: "link" | "payload" | null;
|
|
1371
|
+
readonly row: VaultAuditRow | null;
|
|
1372
|
+
};
|
|
1373
|
+
|
|
1374
|
+
/**
|
|
1375
|
+
* GET /console/vault/audit/verify — walk the hash chain (sealed).
|
|
1376
|
+
*/
|
|
1377
|
+
export async function vaultAuditVerify(): Promise<ConsoleApiResult<VaultAuditVerifyResult>> {
|
|
1378
|
+
return consoleFetch<VaultAuditVerifyResult>("/console/vault/audit/verify");
|
|
1379
|
+
}
|