@myrialabs/clopen 0.4.38 → 0.4.39
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/backend/auth/permissions.ts +25 -0
- package/backend/chat/stream-manager.ts +1 -1
- package/backend/database/crypto/secret-columns.ts +5 -1
- package/backend/database/migrations/075_create_deploy_bindings.ts +54 -0
- package/backend/database/migrations/076_remove_memory_code_graph.ts +229 -0
- package/backend/database/migrations/077_create_integration_db_links.ts +150 -0
- package/backend/database/migrations/index.ts +21 -0
- package/backend/database/queries/db-client-connection-queries.ts +19 -0
- package/backend/database/queries/deploy-queries.ts +124 -0
- package/backend/database/queries/graph-queries.ts +291 -247
- package/backend/database/queries/index.ts +4 -0
- package/backend/database/queries/integration-db-link-queries.ts +168 -0
- package/backend/database/queries/integration-queries.ts +34 -6
- package/backend/db-client/integrations/index.ts +37 -0
- package/backend/db-client/integrations/links.ts +533 -0
- package/backend/db-client/integrations/projector.test.ts +280 -0
- package/backend/db-client/integrations/projector.ts +256 -0
- package/backend/db-client/integrations/supabase-service.ts +266 -0
- package/backend/db-client/providers/registry.ts +27 -0
- package/backend/db-client/providers/supabase/adapter.ts +500 -0
- package/backend/db-client/providers/supabase/api-types.ts +92 -0
- package/backend/db-client/providers/supabase/apply-migration.ts +104 -0
- package/backend/db-client/providers/supabase/client.ts +259 -0
- package/backend/db-client/providers/supabase/features.ts +502 -0
- package/backend/db-client/providers/supabase/local.test.ts +78 -0
- package/backend/db-client/providers/supabase/local.ts +137 -0
- package/backend/db-client/providers/types.ts +137 -0
- package/backend/deployments/bindings.test.ts +43 -0
- package/backend/deployments/bindings.ts +216 -0
- package/backend/deployments/index.ts +53 -0
- package/backend/deployments/log-streams.ts +214 -0
- package/backend/deployments/prompts.ts +70 -0
- package/backend/deployments/providers/vercel/adapter.ts +757 -0
- package/backend/deployments/providers/vercel/build-logs.test.ts +80 -0
- package/backend/deployments/providers/vercel/build-logs.ts +211 -0
- package/backend/deployments/providers/vercel/client.ts +203 -0
- package/backend/deployments/providers/vercel/list.test.ts +624 -0
- package/backend/deployments/providers/vercel/normalise.test.ts +115 -0
- package/backend/deployments/providers/vercel/normalise.ts +113 -0
- package/backend/deployments/providers/vercel/types.ts +104 -0
- package/backend/deployments/registry.ts +27 -0
- package/backend/deployments/service.ts +458 -0
- package/backend/deployments/types.ts +278 -0
- package/backend/index.ts +4 -0
- package/backend/integrations/projections/index.ts +0 -0
- package/backend/integrations/projections/mcp-projector.ts +7 -3
- package/backend/integrations/projections/types.ts +21 -9
- package/backend/integrations/registry/index.ts +5 -1
- package/backend/integrations/registry/providers/supabase.ts +61 -0
- package/backend/integrations/registry/providers/vercel.ts +46 -0
- package/backend/mcp/internal/servers/memory-graph/description.ts +3 -3
- package/backend/mcp/internal/servers/memory-graph/runner.ts +4 -9
- package/backend/mcp/internal/servers/memory-graph/schema.ts +0 -4
- package/backend/memory/README.md +57 -34
- package/backend/memory/compose.test.ts +3 -3
- package/backend/memory/compose.ts +6 -9
- package/backend/memory/config.ts +0 -5
- package/backend/memory/consolidate.ts +1 -2
- package/backend/memory/context.test.ts +8 -54
- package/backend/memory/context.ts +19 -25
- package/backend/memory/extract/episodic.ts +10 -12
- package/backend/memory/extract/index.ts +23 -52
- package/backend/memory/extract/scheduler.ts +3 -6
- package/backend/memory/index.ts +6 -5
- package/backend/memory/invalidate.ts +36 -48
- package/backend/memory/layout.ts +319 -130
- package/backend/memory/retention.ts +12 -42
- package/backend/memory/retrieval.eval.test.ts +2 -2
- package/backend/memory/retrieval.test.ts +228 -183
- package/backend/memory/retrieval.ts +22 -21
- package/backend/memory/revise.test.ts +62 -116
- package/backend/memory/revise.ts +0 -1
- package/backend/memory/view.ts +8 -5
- package/backend/snapshot/helpers.ts +35 -41
- package/backend/snapshot/snapshot-service.ts +90 -0
- package/backend/snapshot/turn-changes.test.ts +163 -0
- package/backend/snapshot/turn-changes.ts +131 -0
- package/backend/ws/db-client/accounts.ts +225 -0
- package/backend/ws/db-client/connections.ts +34 -3
- package/backend/ws/db-client/context.ts +37 -0
- package/backend/ws/db-client/index.ts +20 -1
- package/backend/ws/db-client/supabase.ts +188 -0
- package/backend/ws/deployments/actions.ts +360 -0
- package/backend/ws/deployments/context.ts +43 -0
- package/backend/ws/deployments/crud.ts +152 -0
- package/backend/ws/deployments/index.ts +15 -0
- package/backend/ws/deployments/schemas.ts +183 -0
- package/backend/ws/index.ts +6 -2
- package/backend/ws/memory/crud.ts +4 -16
- package/backend/ws/snapshot/changes.ts +279 -0
- package/backend/ws/snapshot/index.ts +4 -3
- package/dist/assets/{index-CyH7fSbR.js → index-BrF6nqld.js} +1 -1
- package/dist/assets/{index-DSHIANSy.js → index-C8Gi-b6U.js} +1 -1
- package/dist/assets/main-Bd3gb79F.css +1 -0
- package/dist/assets/main-Bo1hD7mt.js +1191 -0
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/shared/constants/tool-icons.ts +9 -0
- package/shared/types/db-client/connection.ts +6 -0
- package/shared/types/db-client/index.ts +2 -0
- package/shared/types/db-client/integrations.ts +174 -0
- package/shared/types/db-client/supabase.ts +131 -0
- package/shared/types/deployments.ts +382 -0
- package/shared/types/memory.ts +34 -51
- package/shared/types/ui/components.ts +1 -1
- package/shared/utils/diff-calculator.test.ts +89 -0
- package/shared/utils/diff-calculator.ts +30 -65
- package/shared/utils/logger.ts +1 -0
- package/backend/memory/extract/languages.ts +0 -176
- package/backend/memory/extract/structural.test.ts +0 -215
- package/backend/memory/extract/structural.ts +0 -364
- package/backend/ws/snapshot/content.ts +0 -85
- package/dist/assets/main-D2IOjftb.css +0 -1
- package/dist/assets/main-DM-tHKbW.js +0 -1152
package/dist/index.html
CHANGED
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
}
|
|
59
59
|
})();
|
|
60
60
|
</script>
|
|
61
|
-
<script type="module" crossorigin src="/assets/main-
|
|
62
|
-
<link rel="stylesheet" crossorigin href="/assets/main-
|
|
61
|
+
<script type="module" crossorigin src="/assets/main-Bo1hD7mt.js"></script>
|
|
62
|
+
<link rel="stylesheet" crossorigin href="/assets/main-Bd3gb79F.css">
|
|
63
63
|
</head>
|
|
64
64
|
<body
|
|
65
65
|
class="min-h-dvh bg-white text-slate-900 dark:bg-slate-950 dark:text-slate-100 transition-colors duration-200"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@myrialabs/clopen",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.39",
|
|
4
4
|
"description": "All-in-one web workspace for AI coding agents — Claude Code, OpenCode, Codex, Copilot, Qwen Code, Pi, Cline, and Cursor — with chat, terminal, git, browser preview, database client, checkpoints, and real-time collaboration",
|
|
5
5
|
"author": "Myria Labs",
|
|
6
6
|
"license": "MIT",
|
|
@@ -73,6 +73,15 @@ export const PROVIDER_ICONS: Record<string, ToolIcon> = {
|
|
|
73
73
|
// on the mark's own bounding box or it renders small and off-centre at 24px.
|
|
74
74
|
context7: { light: '<svg width="24" height="24" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="28" height="28" rx="4" fill="black"/><path d="M10.5724 15.2565C10.5724 17.5025 9.6613 19.3778 8.17805 21.1047H11.6319L11.6319 22.7786H6.33459V21.1895C7.95557 19.3566 8.58065 17.8628 8.58065 15.2565L10.5724 15.2565Z" fill="white"/><path d="M17.4276 15.2565C17.4276 17.5025 18.3387 19.3778 19.822 21.1047H16.3681V22.7786H21.6654V21.1895C20.0444 19.3566 19.4194 17.8628 19.4194 15.2565H17.4276Z" fill="white"/><path d="M10.5724 12.7435C10.5724 10.4975 9.66131 8.62224 8.17807 6.89532L11.6319 6.89532V5.22137L6.33461 5.22137V6.81056C7.95558 8.64343 8.58066 10.1373 8.58066 12.7435L10.5724 12.7435Z" fill="white"/><path d="M17.4276 12.7435C17.4276 10.4975 18.3387 8.62224 19.822 6.89532L16.3681 6.89532L16.3681 5.22138L21.6654 5.22138V6.81056C20.0445 8.64343 19.4194 10.1373 19.4194 12.7435H17.4276Z" fill="white"/></svg>', dark: '<svg width="24" height="24" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="28" height="28" rx="4" fill="white"/><path d="M10.5724 15.2565C10.5724 17.5025 9.6613 19.3778 8.17805 21.1047H11.6319L11.6319 22.7786H6.33459V21.1895C7.95557 19.3566 8.58065 17.8628 8.58065 15.2565L10.5724 15.2565Z" fill="black"/><path d="M17.4276 15.2565C17.4276 17.5025 18.3387 19.3778 19.822 21.1047H16.3681V22.7786H21.6654V21.1895C20.0444 19.3566 19.4194 17.8628 19.4194 15.2565H17.4276Z" fill="black"/><path d="M10.5724 12.7435C10.5724 10.4975 9.66131 8.62224 8.17807 6.89532L11.6319 6.89532V5.22137L6.33461 5.22137V6.81056C7.95558 8.64343 8.58066 10.1373 8.58066 12.7435L10.5724 12.7435Z" fill="black"/><path d="M17.4276 12.7435C17.4276 10.4975 18.3387 8.62224 19.822 6.89532L16.3681 6.89532L16.3681 5.22138L21.6654 5.22138V6.81056C20.0444 8.64343 19.4194 10.1373 19.4194 12.7435H17.4276Z" fill="black"/></svg>' },
|
|
75
75
|
firecrawl: { light: '<svg width="24" height="24" preserveAspectRatio="xMidYMid meet" viewBox="8 34 560 560" xmlns="http://www.w3.org/2000/svg"><g><g transform=" translate(293.035, 553.013) scale(0.97724, 0.97724) translate(-533.035, -800.013)"><path d=" M603.4 416.3 C581,433 586.6,450.2 583.9,466.6 C583.2,470.5 577.8,469.2 576.5,465.7 C559.5,447 549.5,423.6 559.3,394.4 C577.2,340.8 614.2,311.2 594.2,288.4 C591,284.8 591.8,284.3 590.2,288.8 C572.5,339 363,338 428,536 C430.9,544.8 430.2,555.2 429.5,565.8 C429.3,569 427.1,571.3 424.2,570.1 C401.5,560.8 395.4,525.8 390.4,516.3 C389,513.6 387.5,514.5 385.7,518 C381,524.1 377.9,532.3 374.2,538.5 C336.9,600.7 343.6,664.3 368,715 C368.9,716.9 369.9,718.7 370.9,720.6 C371.9,722.7 373.1,724.8 374.2,726.8 C391.8,758.3 416,783.8 439.8,799.3 C442.6,801.2 446.3,798.5 445.3,795.2 C437.1,767.6 642.8,744.8 634.7,795.2 C634.1,798.6 637.3,801.3 640.2,799.4 C659.9,786.5 680.2,766.8 695.2,742 C696.4,740 697.6,738 698.7,735.9 C699.5,734.5 700.2,733.1 701,731.6 C711.2,711.6 717.8,688.8 718.1,663.6 C718.3,643.8 714.6,622.5 705.5,600.1 C703.8,595.8 700.2,616.5 684.4,613.3 C682.9,613 691.2,586.1 692.1,570.6 C692.4,563.3 690.7,544.7 683.2,524.1 C667.8,481.1 615.5,466.2 609.6,417.3 C609.2,414.6 605.5,414.7 603.4,416.3z " fill="#fa5d19" fill-opacity="1" fill-rule="nonzero"></animate></path></g><g transform=" translate(300, 470.504) scale(0.9650799999999999, 0.9650799999999999) translate(-510.283, -685.815)"><path d=" M410.1 771.9 C412.9,773.7 416.6,771.1 415.6,767.8 C407.4,740.2 411.5,708.6 427.7,684.6 C455.3,643.2 510.6,603.1 501.8,548.7 C501.2,545.3 505.3,543 507.9,545.4 C546.9,581 554.6,629 548.2,672 C547.6,675.7 552.3,677.7 554.7,674.8 C560.6,667.3 567.9,660.7 575.9,655.8 C577.8,654.6 580.5,655.5 581.2,657.7 C594.2,695.6 617.7,725.6 605,767.8 C604,771.1 607.6,773.8 610.5,771.9 C610.5,771.9 610.5,827.2 610.5,827.2 C610.5,827.2 410.1,827.2 410.1,827.2 C410.1,827.2 410.1,771.9 410.1,771.9z " fill="#ffffff" fill-opacity="1" fill-rule="nonzero"></path></g></g></svg>', dark: '<svg width="24" height="24" preserveAspectRatio="xMidYMid meet" viewBox="8 34 560 560" xmlns="http://www.w3.org/2000/svg"><g><g transform=" translate(293.035, 553.013) scale(0.97724, 0.97724) translate(-533.035, -800.013)"><path d=" M603.4 416.3 C581,433 586.6,450.2 583.9,466.6 C583.2,470.5 577.8,469.2 576.5,465.7 C559.5,447 549.5,423.6 559.3,394.4 C577.2,340.8 614.2,311.2 594.2,288.4 C591,284.8 591.8,284.3 590.2,288.8 C572.5,339 363,338 428,536 C430.9,544.8 430.2,555.2 429.5,565.8 C429.3,569 427.1,571.3 424.2,570.1 C401.5,560.8 395.4,525.8 390.4,516.3 C389,513.6 387.5,514.5 385.7,518 C381,524.1 377.9,532.3 374.2,538.5 C336.9,600.7 343.6,664.3 368,715 C368.9,716.9 369.9,718.7 370.9,720.6 C371.9,722.7 373.1,724.8 374.2,726.8 C391.8,758.3 416,783.8 439.8,799.3 C442.6,801.2 446.3,798.5 445.3,795.2 C437.1,767.6 642.8,744.8 634.7,795.2 C634.1,798.6 637.3,801.3 640.2,799.4 C659.9,786.5 680.2,766.8 695.2,742 C696.4,740 697.6,738 698.7,735.9 C699.5,734.5 700.2,733.1 701,731.6 C711.2,711.6 717.8,688.8 718.1,663.6 C718.3,643.8 714.6,622.5 705.5,600.1 C703.8,595.8 700.2,616.5 684.4,613.3 C682.9,613 691.2,586.1 692.1,570.6 C692.4,563.3 690.7,544.7 683.2,524.1 C667.8,481.1 615.5,466.2 609.6,417.3 C609.2,414.6 605.5,414.7 603.4,416.3z " fill="#fa5d19" fill-opacity="1" fill-rule="nonzero"></animate></path></g><g transform=" translate(300, 470.504) scale(0.9650799999999999, 0.9650799999999999) translate(-510.283, -685.815)"><path d=" M410.1 771.9 C412.9,773.7 416.6,771.1 415.6,767.8 C407.4,740.2 411.5,708.6 427.7,684.6 C455.3,643.2 510.6,603.1 501.8,548.7 C501.2,545.3 505.3,543 507.9,545.4 C546.9,581 554.6,629 548.2,672 C547.6,675.7 552.3,677.7 554.7,674.8 C560.6,667.3 567.9,660.7 575.9,655.8 C577.8,654.6 580.5,655.5 581.2,657.7 C594.2,695.6 617.7,725.6 605,767.8 C604,771.1 607.6,773.8 610.5,771.9 C610.5,771.9 610.5,827.2 610.5,827.2 C610.5,827.2 410.1,827.2 410.1,827.2 C410.1,827.2 410.1,771.9 410.1,771.9z " fill="#0f172a" fill-opacity="1" fill-rule="nonzero"></path></g></g></svg>' },
|
|
76
|
+
// Vercel's mark is one triangle whose fill flips with the theme — their brand
|
|
77
|
+
// guidance is black on light and white on dark, so the two variants differ
|
|
78
|
+
// only in that fill.
|
|
79
|
+
// Supabase's mark is one artwork for both themes — the green reads on light
|
|
80
|
+
// and dark alike, which is what their own guidance assumes. Its gradient ids
|
|
81
|
+
// are namespaced: an inline SVG's `id` is document-global, so a bare
|
|
82
|
+
// `paint0_linear` would be captured by whichever mark rendered first.
|
|
83
|
+
supabase: { light: '<svg width="24" height="24" viewBox="0 0 109 113" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M63.7076 110.284C60.8481 113.885 55.0502 111.912 54.9813 107.314L53.9738 40.0625L99.1935 40.0625C107.384 40.0625 111.952 49.5226 106.859 55.9372L63.7076 110.284Z" fill="url(#supabase_a)"/><path d="M63.7076 110.284C60.8481 113.885 55.0502 111.912 54.9813 107.314L53.9738 40.0625L99.1935 40.0625C107.384 40.0625 111.952 49.5226 106.859 55.9372L63.7076 110.284Z" fill="url(#supabase_b)" fill-opacity="0.2"/><path d="M45.317 2.07103C48.1765 -1.53037 53.9745 0.442937 54.0434 5.041L54.4849 72.2922H9.83113C1.64038 72.2922 -2.92775 62.8321 2.1655 56.4175L45.317 2.07103Z" fill="#3ECF8E"/><defs><linearGradient id="supabase_a" x1="53.9738" y1="54.9738" x2="94.1635" y2="71.8293" gradientUnits="userSpaceOnUse"><stop stop-color="#249361"/><stop offset="1" stop-color="#3ECF8E"/></linearGradient><linearGradient id="supabase_b" x1="36.1558" y1="30.5779" x2="54.4844" y2="65.0804" gradientUnits="userSpaceOnUse"><stop/><stop offset="1" stop-opacity="0"/></linearGradient></defs></svg>', dark: '<svg width="24" height="24" viewBox="0 0 109 113" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M63.7076 110.284C60.8481 113.885 55.0502 111.912 54.9813 107.314L53.9738 40.0625L99.1935 40.0625C107.384 40.0625 111.952 49.5226 106.859 55.9372L63.7076 110.284Z" fill="url(#supabase_a)"/><path d="M63.7076 110.284C60.8481 113.885 55.0502 111.912 54.9813 107.314L53.9738 40.0625L99.1935 40.0625C107.384 40.0625 111.952 49.5226 106.859 55.9372L63.7076 110.284Z" fill="url(#supabase_b)" fill-opacity="0.2"/><path d="M45.317 2.07103C48.1765 -1.53037 53.9745 0.442937 54.0434 5.041L54.4849 72.2922H9.83113C1.64038 72.2922 -2.92775 62.8321 2.1655 56.4175L45.317 2.07103Z" fill="#3ECF8E"/><defs><linearGradient id="supabase_a" x1="53.9738" y1="54.9738" x2="94.1635" y2="71.8293" gradientUnits="userSpaceOnUse"><stop stop-color="#249361"/><stop offset="1" stop-color="#3ECF8E"/></linearGradient><linearGradient id="supabase_b" x1="36.1558" y1="30.5779" x2="54.4844" y2="65.0804" gradientUnits="userSpaceOnUse"><stop/><stop offset="1" stop-opacity="0"/></linearGradient></defs></svg>' },
|
|
84
|
+
vercel: { light: '<svg width="24" height="24" viewBox="0 0 76 65" xmlns="http://www.w3.org/2000/svg"><path d="M37.5274 0L75.0548 65H0L37.5274 0Z" fill="#000000"/></svg>', dark: '<svg width="24" height="24" viewBox="0 0 76 65" xmlns="http://www.w3.org/2000/svg"><path d="M37.5274 0L75.0548 65H0L37.5274 0Z" fill="#ffffff"/></svg>' },
|
|
76
85
|
github: { light: '<svg width="24" height="24" viewBox="0 0 98 96" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z" fill="#24292f"/></svg>', dark: '<svg width="24" height="24" viewBox="0 0 98 96" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z" fill="#ffffff"/></svg>' }
|
|
77
86
|
};
|
|
78
87
|
|
|
@@ -40,6 +40,12 @@ export interface DbClientConnection {
|
|
|
40
40
|
createdAt: string;
|
|
41
41
|
updatedAt: string;
|
|
42
42
|
lastUsedAt: string | null;
|
|
43
|
+
/**
|
|
44
|
+
* Set when this row was DERIVED from a connected account rather than typed
|
|
45
|
+
* into the form. Absent on an ordinary connection, so every existing caller
|
|
46
|
+
* is unaffected — see `shared/types/db-client/integrations.ts`.
|
|
47
|
+
*/
|
|
48
|
+
managedBy?: import('./integrations').DbClientManagedBy | null;
|
|
43
49
|
}
|
|
44
50
|
|
|
45
51
|
export interface DbClientConnectionInput {
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* db-client — account-backed connections.
|
|
3
|
+
*
|
|
4
|
+
* A connection can arrive two ways: typed into the form, or DERIVED from a
|
|
5
|
+
* connected third-party account. The second kind is a projection (see
|
|
6
|
+
* `backend/integrations/projections/`), and everything here is the vocabulary
|
|
7
|
+
* the panel needs to render one honestly: who owns it, which remote database it
|
|
8
|
+
* points at, and what the form is therefore not allowed to edit.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type { DbDriver } from './connection';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* How the connection reaches the database.
|
|
15
|
+
*
|
|
16
|
+
* A managed provider usually offers a pooled endpoint and a direct one. The
|
|
17
|
+
* trade-offs are real, but they are NOT a choice most users should be asked to
|
|
18
|
+
* make: for every provider so far exactly one mode is correct for a client like
|
|
19
|
+
* this, and the others exist for cases the default cannot reach.
|
|
20
|
+
*
|
|
21
|
+
* So `isDefault` is picked silently and `isAdvanced` marks the escape hatches,
|
|
22
|
+
* which the dialog keeps folded away. A form that opens with three radio
|
|
23
|
+
* buttons and three paragraphs asks the user to decide something they have no
|
|
24
|
+
* way to decide, before they have connected anything.
|
|
25
|
+
*/
|
|
26
|
+
export interface DbConnectionModeInfo {
|
|
27
|
+
id: string;
|
|
28
|
+
label: string;
|
|
29
|
+
help: string;
|
|
30
|
+
/** Chosen without asking when the user has expressed no preference. */
|
|
31
|
+
isDefault?: boolean;
|
|
32
|
+
/** Hidden behind the dialog's Advanced disclosure. */
|
|
33
|
+
isAdvanced?: boolean;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** One secret a link needs that the provider's API will not hand back. */
|
|
37
|
+
export interface DbLinkSecretField {
|
|
38
|
+
name: string;
|
|
39
|
+
label: string;
|
|
40
|
+
placeholder?: string;
|
|
41
|
+
help?: string;
|
|
42
|
+
isRequired: boolean;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** A database provider as the link dialog renders it. */
|
|
46
|
+
export interface DbProviderInfo {
|
|
47
|
+
/** Matches the integration provider id, so the brand mark is the same one. */
|
|
48
|
+
id: string;
|
|
49
|
+
name: string;
|
|
50
|
+
driver: DbDriver;
|
|
51
|
+
modes: DbConnectionModeInfo[];
|
|
52
|
+
secretFields: DbLinkSecretField[];
|
|
53
|
+
/** Copy shown above the picker — where to find things, what will happen. */
|
|
54
|
+
description: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** A remote database an account can reach but has not necessarily linked. */
|
|
58
|
+
export interface DbRemoteDatabase {
|
|
59
|
+
ref: string;
|
|
60
|
+
name: string;
|
|
61
|
+
/** Region, plan — whatever tells two similarly named databases apart. */
|
|
62
|
+
detail: string | null;
|
|
63
|
+
/**
|
|
64
|
+
* The owning container's name — Supabase's organisation, Turso's group.
|
|
65
|
+
*
|
|
66
|
+
* Separate from `detail` because it answers a different question: `detail`
|
|
67
|
+
* tells two similar rows apart, this one says which of the account's
|
|
68
|
+
* organisations will be billed for the row you are about to link.
|
|
69
|
+
*/
|
|
70
|
+
group: string | null;
|
|
71
|
+
/** Provider-reported state; a paused project cannot be connected to. */
|
|
72
|
+
status: string | null;
|
|
73
|
+
/**
|
|
74
|
+
* Whether it can be connected to right now.
|
|
75
|
+
*
|
|
76
|
+
* The ADAPTER decides, because "ready" is provider vocabulary: Supabase says
|
|
77
|
+
* `ACTIVE_HEALTHY`, and a project that is still coming up reports a state
|
|
78
|
+
* that looks fine in a list and refuses every connection.
|
|
79
|
+
*/
|
|
80
|
+
isReady: boolean;
|
|
81
|
+
/** True when this account already projects a connection for it. */
|
|
82
|
+
isLinked: boolean;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* What the create-a-database form needs, fetched from the provider.
|
|
87
|
+
*
|
|
88
|
+
* Provider-agnostic on purpose even though Supabase is the only implementation:
|
|
89
|
+
* every managed provider asks the same two questions — which account or
|
|
90
|
+
* organisation owns it, and where it should live — and they only differ in what
|
|
91
|
+
* those are called. Neon calls them projects and regions, Turso calls them
|
|
92
|
+
* groups and locations.
|
|
93
|
+
*/
|
|
94
|
+
/**
|
|
95
|
+
* One container a database could be created in.
|
|
96
|
+
*
|
|
97
|
+
* `isUnverified` is the honest middle ground between hiding a candidate and
|
|
98
|
+
* vouching for it. A token can be allowed to CREATE an organisation while being
|
|
99
|
+
* unable to READ one — they are separate permissions — so "we could not confirm
|
|
100
|
+
* this" is a real third state, and removing those options altogether took away
|
|
101
|
+
* a capability that may well work.
|
|
102
|
+
*/
|
|
103
|
+
export interface DbProviderCreateGroup {
|
|
104
|
+
value: string;
|
|
105
|
+
label: string;
|
|
106
|
+
detail?: string | null;
|
|
107
|
+
/** True when the provider would not confirm this token can act in it. */
|
|
108
|
+
isUnverified?: boolean;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export interface DbProviderCreateOptions {
|
|
112
|
+
/** What the owning container is called here — "Organisation", "Team". */
|
|
113
|
+
groupLabel: string;
|
|
114
|
+
groups: DbProviderCreateGroup[];
|
|
115
|
+
regionLabel: string;
|
|
116
|
+
regions: { value: string; label: string }[];
|
|
117
|
+
/** One sentence naming what creating one actually costs. */
|
|
118
|
+
notice: string;
|
|
119
|
+
/** Shown instead of the form when `groups` is empty, naming the real cause. */
|
|
120
|
+
emptyGroupsNotice: string;
|
|
121
|
+
/** True when the provider can create the owning container from here too. */
|
|
122
|
+
canCreateGroup: boolean;
|
|
123
|
+
/** One sentence naming what creating a container costs. */
|
|
124
|
+
createGroupNotice: string;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/** A link, as the panel sees it. Secret VALUES never cross this line. */
|
|
128
|
+
export interface DbAccountLinkInfo {
|
|
129
|
+
id: string;
|
|
130
|
+
accountId: string;
|
|
131
|
+
provider: string;
|
|
132
|
+
accountLabel: string;
|
|
133
|
+
remoteRef: string;
|
|
134
|
+
label: string;
|
|
135
|
+
driver: DbDriver;
|
|
136
|
+
mode: string;
|
|
137
|
+
/** The projected connection, or null when projection has not run yet. */
|
|
138
|
+
connectionId: string | null;
|
|
139
|
+
/** Which secret fields hold a value — never what they hold. */
|
|
140
|
+
configuredSecrets: string[];
|
|
141
|
+
detected: boolean;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Stamped onto a connection the panel did not create.
|
|
146
|
+
*
|
|
147
|
+
* Its presence is what makes the form read-only: the fields it describes are
|
|
148
|
+
* derived from the account, and editing them locally would produce a row that
|
|
149
|
+
* the next re-projection silently overwrites.
|
|
150
|
+
*/
|
|
151
|
+
export interface DbClientManagedBy {
|
|
152
|
+
accountId: string;
|
|
153
|
+
provider: string;
|
|
154
|
+
providerName: string;
|
|
155
|
+
accountLabel: string;
|
|
156
|
+
linkId: string | null;
|
|
157
|
+
remoteRef: string | null;
|
|
158
|
+
/**
|
|
159
|
+
* True when the row existed before the account did. The panel says so,
|
|
160
|
+
* because disconnecting will hand it back rather than delete it.
|
|
161
|
+
*/
|
|
162
|
+
adopted: boolean;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/** What DB Client knows about a Supabase-shaped connection. */
|
|
166
|
+
export interface SupabaseConnectionContext {
|
|
167
|
+
/** Project ref. Present for a linked project AND for a detected local stack. */
|
|
168
|
+
ref: string;
|
|
169
|
+
/** Null for a local stack with no connected account — API features are off. */
|
|
170
|
+
accountId: string | null;
|
|
171
|
+
projectName: string | null;
|
|
172
|
+
/** True when this is a `supabase start` stack on this machine. */
|
|
173
|
+
isLocal: boolean;
|
|
174
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Supabase inside DB Client.
|
|
3
|
+
*
|
|
4
|
+
* The split that shapes every type here: ANYTHING INSIDE THE DATABASE IS READ
|
|
5
|
+
* OVER SQL through the connection DB Client already holds, and only what lives
|
|
6
|
+
* outside it goes to the Management API. Policies, applied migrations, storage
|
|
7
|
+
* buckets and auth users are all ordinary Postgres rows, so they keep working
|
|
8
|
+
* for a `supabase start` stack that has no access token at all. Edge functions,
|
|
9
|
+
* generated types and the security advisor have no SQL equivalent, so they are
|
|
10
|
+
* the ones that go dark without an account, and each says so.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export interface SupabaseMigration {
|
|
14
|
+
version: string;
|
|
15
|
+
name: string | null;
|
|
16
|
+
/** True when the version is recorded in `supabase_migrations.schema_migrations`. */
|
|
17
|
+
isApplied: boolean;
|
|
18
|
+
/** Path of the local file, when the repository has one for this version. */
|
|
19
|
+
path: string | null;
|
|
20
|
+
/** Bytes of SQL in the local file. Null when only the remote knows this version. */
|
|
21
|
+
size: number | null;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface SupabaseMigrationsReport {
|
|
25
|
+
migrations: SupabaseMigration[];
|
|
26
|
+
/** Absolute path scanned for local migrations, or null when there is no project. */
|
|
27
|
+
localDir: string | null;
|
|
28
|
+
/** True when the remote has versions the working tree does not — someone else pushed. */
|
|
29
|
+
hasRemoteOnly: boolean;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface SupabasePolicy {
|
|
33
|
+
schema: string;
|
|
34
|
+
table: string;
|
|
35
|
+
name: string;
|
|
36
|
+
/** PERMISSIVE or RESTRICTIVE. */
|
|
37
|
+
permissive: string;
|
|
38
|
+
/** SELECT / INSERT / UPDATE / DELETE / ALL. */
|
|
39
|
+
command: string;
|
|
40
|
+
roles: string[];
|
|
41
|
+
using: string | null;
|
|
42
|
+
withCheck: string | null;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface SupabaseTableRls {
|
|
46
|
+
schema: string;
|
|
47
|
+
table: string;
|
|
48
|
+
rlsEnabled: boolean;
|
|
49
|
+
policyCount: number;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** One finding from `/advisors/security`. Account-only — there is no SQL for it. */
|
|
53
|
+
export interface SupabaseAdvisorLint {
|
|
54
|
+
name: string;
|
|
55
|
+
title: string;
|
|
56
|
+
level: string;
|
|
57
|
+
facing: string;
|
|
58
|
+
description: string;
|
|
59
|
+
detail: string | null;
|
|
60
|
+
remediation: string | null;
|
|
61
|
+
/** Which object the lint is about, when it names one. */
|
|
62
|
+
target: string | null;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface SupabaseRlsReport {
|
|
66
|
+
tables: SupabaseTableRls[];
|
|
67
|
+
policies: SupabasePolicy[];
|
|
68
|
+
/** Empty when there is no account to ask; `advisorError` then says why. */
|
|
69
|
+
lints: SupabaseAdvisorLint[];
|
|
70
|
+
advisorError: string | null;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface SupabaseEdgeFunction {
|
|
74
|
+
id: string;
|
|
75
|
+
slug: string;
|
|
76
|
+
name: string;
|
|
77
|
+
status: string;
|
|
78
|
+
version: number | null;
|
|
79
|
+
createdAt: string | null;
|
|
80
|
+
updatedAt: string | null;
|
|
81
|
+
verifyJwt: boolean | null;
|
|
82
|
+
entrypointPath: string | null;
|
|
83
|
+
/** True when this came from the working tree rather than the remote. */
|
|
84
|
+
isLocal: boolean;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export interface SupabaseBucket {
|
|
88
|
+
id: string;
|
|
89
|
+
name: string;
|
|
90
|
+
isPublic: boolean;
|
|
91
|
+
fileSizeLimit: number | null;
|
|
92
|
+
allowedMimeTypes: string[] | null;
|
|
93
|
+
objectCount: number | null;
|
|
94
|
+
createdAt: string | null;
|
|
95
|
+
updatedAt: string | null;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export interface SupabaseAuthUser {
|
|
99
|
+
id: string;
|
|
100
|
+
email: string | null;
|
|
101
|
+
phone: string | null;
|
|
102
|
+
providers: string[];
|
|
103
|
+
createdAt: string | null;
|
|
104
|
+
lastSignInAt: string | null;
|
|
105
|
+
confirmedAt: string | null;
|
|
106
|
+
isBanned: boolean;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export interface SupabaseAuthUsersPage {
|
|
110
|
+
users: SupabaseAuthUser[];
|
|
111
|
+
total: number;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* What the Management API last said about the remaining request budget.
|
|
116
|
+
*
|
|
117
|
+
* Null means "not reported", never "none left" — Supabase only sends these
|
|
118
|
+
* headers on some responses, and a surface that rendered absence as zero would
|
|
119
|
+
* alarm people about a limit they are nowhere near.
|
|
120
|
+
*/
|
|
121
|
+
export interface SupabaseRateLimitInfo {
|
|
122
|
+
remaining: number;
|
|
123
|
+
limit: number;
|
|
124
|
+
resetAt: string | null;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export interface SupabaseTypesResult {
|
|
128
|
+
types: string;
|
|
129
|
+
/** Where it would be written, resolved against the project root. */
|
|
130
|
+
suggestedPath: string;
|
|
131
|
+
}
|