sql-preview 0.6.7 → 0.6.11

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/Changelog.md CHANGED
@@ -1,5 +1,37 @@
1
1
  # Changelog
2
2
 
3
+ ## [Unreleased]
4
+
5
+ ## [0.6.11] - 2026-07-14
6
+
7
+ ### Added
8
+
9
+ - Consolidated the CI release pipeline into one gated workflow and added release note generation.
10
+
11
+ ### Changed
12
+
13
+ - DuckDB is now a managed, auto-provisioned runtime inside the daemon; the legacy "Install @duckdb/node-api" flow has been removed and Local Files is a built-in connection. (RFC-075)
14
+ - Enhanced RFC tooling to recognize `deferred/` lifecycle and enforce independent close-out verification.
15
+
16
+ ## [0.6.10] - 2026-07-12
17
+
18
+ ### Fixed
19
+
20
+ - Fixed Trino integration tests failing on `listSchemas` and improved initial polling.
21
+ - Fixed Postgres `testConnection` memory leak and config cache fix.
22
+
23
+ ## [0.6.8] - 2026-07-12
24
+
25
+ ### Added
26
+
27
+ - Comprehensive query telemetry (RFC-068): query events now carry a closed-enum `connector` dimension; a layered, connector-aware error classifier replaces the old substring matching (previously ~95% of failures were `unknown`); MCP tool calls and agent/web-originated queries are now telemetered daemon-side (fail-closed, consent inherited from the extension or explicit `SQL_PREVIEW_TELEMETRY=1` standalone opt-in); a new `mcp_tool_invoked` event measures agent usage. Telemetry schema `2.1` (additive).
28
+ - Internal/dev traffic isolation: telemetry is suppressed in Extension Development/Test hosts (override with `SQL_PREVIEW_POSTHOG_TOKEN` for debug projects), a new `sqlPreview.telemetry.internal` setting (or `SQL_PREVIEW_TELEMETRY_INTERNAL=1`) stamps every event with `internal_user`, and `SQL Preview: Show Telemetry Status` now displays the anonymous install ID for PostHog exclusion filters.
29
+
30
+ ### Changed
31
+
32
+ - Query error payloads now include an advisory machine-readable `errorKind` alongside the existing message/details (no SQL text or message content is ever sent to telemetry; only the classified enum).
33
+ - Fully implemented MCP Streamable HTTP Spec compliance (RFC-072). The `/mcp` HTTP endpoint now strictly follows the `@modelcontextprotocol/sdk` (pinned to 1.27.1) stateful session specifications, properly supporting Claude Code HTTP transports and standard MCP external clients.
34
+
3
35
  ## [0.6.7] - 2026-07-08
4
36
 
5
37
  ### Changed
package/dist/mcp-app.html CHANGED
@@ -12574,6 +12574,8 @@ const useAppStore = create((set, get) => ({
12574
12574
  mcpEnabled: false,
12575
12575
  mcpSafeMode: true,
12576
12576
  mcpPort: null,
12577
+ daemonVersion: null,
12578
+ daemonPid: null,
12577
12579
  currentVersion: null,
12578
12580
  latestVersion: null,
12579
12581
  settingsPanelTab: null,
@@ -12620,7 +12622,7 @@ const useAppStore = create((set, get) => ({
12620
12622
  showGuideHub: (state) => set({ guideHub: state, settingsPanelTab: null }),
12621
12623
  closeGuideHub: () => set({ guideHub: null }),
12622
12624
  applyConfig: (c) => set((state) => {
12623
- var _a3;
12625
+ var _a3, _b2, _c3;
12624
12626
  const newState = { ...state };
12625
12627
  if (c.fontSize !== void 0) {
12626
12628
  newState.fontSize = c.fontSize != null && c.fontSize > 0 ? c.fontSize : null;
@@ -12637,8 +12639,10 @@ const useAppStore = create((set, get) => ({
12637
12639
  if (c.mcpSafeMode !== void 0) {
12638
12640
  newState.mcpSafeMode = c.mcpSafeMode;
12639
12641
  }
12640
- if (((_a3 = c.mcpStatus) == null ? void 0 : _a3.port) !== void 0) {
12641
- newState.mcpPort = c.mcpStatus.port;
12642
+ if (c.mcpStatus !== void 0) {
12643
+ newState.mcpPort = ((_a3 = c.mcpStatus) == null ? void 0 : _a3.port) ?? null;
12644
+ newState.daemonVersion = ((_b2 = c.mcpStatus) == null ? void 0 : _b2.version) ?? null;
12645
+ newState.daemonPid = ((_c3 = c.mcpStatus) == null ? void 0 : _c3.pid) ?? null;
12642
12646
  }
12643
12647
  return newState;
12644
12648
  }),
@@ -12678,7 +12682,9 @@ const useAppStore = create((set, get) => ({
12678
12682
  setActiveTab: (id) => set({ activeTabId: id }),
12679
12683
  updateTab: (id, updates) => set((state) => ({
12680
12684
  tabs: state.tabs.map((tab) => {
12681
- if (tab.id !== id) return tab;
12685
+ if (tab.id !== id) {
12686
+ return tab;
12687
+ }
12682
12688
  const next = { ...tab, ...updates };
12683
12689
  if (updates.isLoading === true && !tab.isLoading) {
12684
12690
  next.loadingStartedAt = Date.now();
@@ -74583,12 +74589,6 @@ function TestElapsed({ since }) {
74583
74589
  ] });
74584
74590
  }
74585
74591
  const OPTIONAL_DEPENDENCY_ADVICE = [
74586
- {
74587
- dependency: "@duckdb/node-api",
74588
- installCommand: "npm install @duckdb/node-api",
74589
- title: "DUCKDB support is required",
74590
- guidance: "Local file queries require optional DuckDB support, but the DuckDB native module is not available in this extension runtime."
74591
- },
74592
74592
  {
74593
74593
  dependency: "snowflake-sdk",
74594
74594
  installCommand: "npm install snowflake-sdk",
@@ -74606,9 +74606,6 @@ function getOptionalDependencyAdvice(message) {
74606
74606
  if (message.includes(advice.dependency)) {
74607
74607
  return true;
74608
74608
  }
74609
- if (advice.dependency === "@duckdb/node-api") {
74610
- return lowerMessage.includes("duckdb native module");
74611
- }
74612
74609
  if (advice.dependency === "snowflake-sdk") {
74613
74610
  return lowerMessage.includes("snowflake sdk") || lowerMessage.includes("sdk is not available");
74614
74611
  }
@@ -74780,7 +74777,7 @@ const ConnectionsManager = () => {
74780
74777
  (_b2 = toastRef.current) == null ? void 0 : _b2.focus({ preventScroll: true });
74781
74778
  });
74782
74779
  }, [toast]);
74783
- const handleTestConnection = async (connectionId) => {
74780
+ const handleTestConnection = async (connectionId, provisionRuntime = false) => {
74784
74781
  var _a3;
74785
74782
  if (!isReady) {
74786
74783
  return false;
@@ -74793,7 +74790,10 @@ const ConnectionsManager = () => {
74793
74790
  setTestStartedAt((prev) => ({ ...prev, [connectionId]: Date.now() }));
74794
74791
  try {
74795
74792
  const result = await withTestTimeout(
74796
- callServerTool("test_connection", { connectionId }),
74793
+ callServerTool("test_connection", {
74794
+ connectionId,
74795
+ ...provisionRuntime ? { provisionRuntime: true } : {}
74796
+ }),
74797
74797
  CONNECTION_TEST_TIMEOUT_MS
74798
74798
  );
74799
74799
  if (isStale()) {
@@ -75099,41 +75099,56 @@ const ConnectionsManager = () => {
75099
75099
  )
75100
75100
  ] });
75101
75101
  }
75102
- if (!statusMsg) {
75103
- return null;
75102
+ if (statusMsg) {
75103
+ const advice = getOptionalDependencyAdvice(statusMsg);
75104
+ if (advice) {
75105
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sp-conn-status-message sp-conn-status-message-warning", role: "alert", children: [
75106
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sp-conn-warning-content", children: [
75107
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "sp-conn-warning-title", children: advice.title }),
75108
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "sp-conn-warning-guidance", children: advice.guidance }),
75109
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("details", { className: "sp-conn-warning-details", children: [
75110
+ /* @__PURE__ */ jsxRuntimeExports.jsx("summary", { children: "Technical details" }),
75111
+ /* @__PURE__ */ jsxRuntimeExports.jsx("code", { children: getOptionalDependencyDetails(statusMsg) })
75112
+ ] })
75113
+ ] }),
75114
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
75115
+ "button",
75116
+ {
75117
+ className: "sp-btn sp-btn-primary sp-conn-status-action",
75118
+ onClick: () => handleInstallOptionalDependency(advice),
75119
+ children: [
75120
+ "Install ",
75121
+ advice.dependency
75122
+ ]
75123
+ }
75124
+ )
75125
+ ] });
75126
+ }
75127
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
75128
+ "div",
75129
+ {
75130
+ className: `sp-conn-status-message sp-conn-status-message-${status}`,
75131
+ role: status === "error" ? "alert" : "status",
75132
+ children: statusMsg
75133
+ }
75134
+ );
75104
75135
  }
75105
- const advice = getOptionalDependencyAdvice(statusMsg);
75106
- if (advice) {
75107
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sp-conn-status-message sp-conn-status-message-warning", role: "alert", children: [
75108
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sp-conn-warning-content", children: [
75109
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "sp-conn-warning-title", children: advice.title }),
75110
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "sp-conn-warning-guidance", children: advice.guidance }),
75111
- /* @__PURE__ */ jsxRuntimeExports.jsxs("details", { className: "sp-conn-warning-details", children: [
75112
- /* @__PURE__ */ jsxRuntimeExports.jsx("summary", { children: "Technical details" }),
75113
- /* @__PURE__ */ jsxRuntimeExports.jsx("code", { children: getOptionalDependencyDetails(statusMsg) })
75114
- ] })
75115
- ] }),
75116
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
75136
+ if (connection.id === "built-in-duckdb" && connection.engineState) {
75137
+ const message = connection.engineState === "ready" ? "Ready" : connection.engineState === "provisioning" ? "Preparing engine… (downloading, one-time)" : connection.engineErrorReason === "disabled" ? "Managed engine is disabled by the rollout setting" : connection.engineErrorMessage || "Unavailable — retrying automatically";
75138
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sp-conn-status-message", role: "status", children: [
75139
+ message,
75140
+ connection.engineErrorReason === "disabled" && /* @__PURE__ */ jsxRuntimeExports.jsx(
75117
75141
  "button",
75118
75142
  {
75119
- className: "sp-btn sp-btn-primary sp-conn-status-action",
75120
- onClick: () => handleInstallOptionalDependency(advice),
75121
- children: [
75122
- "Install ",
75123
- advice.dependency
75124
- ]
75143
+ type: "button",
75144
+ className: "sp-btn sp-conn-status-action",
75145
+ onClick: () => void handleTestConnection(connection.id, true),
75146
+ children: "Download engine"
75125
75147
  }
75126
75148
  )
75127
75149
  ] });
75128
75150
  }
75129
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
75130
- "div",
75131
- {
75132
- className: `sp-conn-status-message sp-conn-status-message-${status}`,
75133
- role: status === "error" ? "alert" : "status",
75134
- children: statusMsg
75135
- }
75136
- );
75151
+ return null;
75137
75152
  };
75138
75153
  const renderConnectionForm = () => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sp-detail", children: [
75139
75154
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sp-conn-detail-header", children: [
@@ -75238,37 +75253,60 @@ const ConnectionsManager = () => {
75238
75253
  ] });
75239
75254
  };
75240
75255
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sp-detail", children: [
75241
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sp-conn-detail-header", style: { display: "flex", justifyContent: "space-between", alignItems: "center", flexWrap: "wrap", gap: "16px", paddingBottom: "16px", borderBottom: "1px solid var(--sp-border)", marginBottom: "16px" }, children: [
75242
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "12px", flexWrap: "wrap" }, children: [
75243
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { fontWeight: 600, fontSize: "14px", color: "var(--sp-fg)" }, children: selectedConnection ? "Edit Connection" : "New Connection" }),
75244
- selectedConnection && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
75245
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "sp-conn-type-badge", children: selectedConnection.type }),
75246
- isActive && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "sp-conn-active-badge", children: "Active" }),
75247
- selectedConnection.builtIn && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "sp-conn-built-in-label", children: "Built-in" })
75248
- ] })
75249
- ] }),
75250
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sp-conn-detail-actions", style: { display: "flex", gap: "8px", flexWrap: "wrap" }, children: [
75251
- supportsActiveConnection && /* @__PURE__ */ jsxRuntimeExports.jsx(
75252
- "button",
75253
- {
75254
- className: `sp-btn${isActive ? " sp-btn-primary" : ""}`,
75255
- onClick: () => handleSetActiveConnection(selectedConnection),
75256
- disabled: isActive || status === "testing",
75257
- "aria-label": `Set ${selectedConnection.name} as the active connection for queries`,
75258
- children: isActive ? "Active" : "Set active"
75259
- }
75260
- ),
75261
- !selectedConnection.builtIn && /* @__PURE__ */ jsxRuntimeExports.jsx(
75262
- "button",
75263
- {
75264
- className: "sp-btn sp-btn-ghost-danger",
75265
- onClick: () => handleDeleteConnection(selectedConnection.id, selectedConnection.name),
75266
- "aria-label": `Delete connection ${selectedConnection.name}`,
75267
- children: "Delete"
75268
- }
75269
- )
75270
- ] })
75271
- ] }),
75256
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
75257
+ "div",
75258
+ {
75259
+ className: "sp-conn-detail-header",
75260
+ style: {
75261
+ display: "flex",
75262
+ justifyContent: "space-between",
75263
+ alignItems: "center",
75264
+ flexWrap: "wrap",
75265
+ gap: "16px",
75266
+ paddingBottom: "16px",
75267
+ borderBottom: "1px solid var(--sp-border)",
75268
+ marginBottom: "16px"
75269
+ },
75270
+ children: [
75271
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "12px", flexWrap: "wrap" }, children: [
75272
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { fontWeight: 600, fontSize: "14px", color: "var(--sp-fg)" }, children: selectedConnection ? "Edit Connection" : "New Connection" }),
75273
+ selectedConnection && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
75274
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "sp-conn-type-badge", children: selectedConnection.type }),
75275
+ isActive && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "sp-conn-active-badge", children: "Active" }),
75276
+ selectedConnection.builtIn && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "sp-conn-built-in-label", children: "Built-in" })
75277
+ ] })
75278
+ ] }),
75279
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
75280
+ "div",
75281
+ {
75282
+ className: "sp-conn-detail-actions",
75283
+ style: { display: "flex", gap: "8px", flexWrap: "wrap" },
75284
+ children: [
75285
+ supportsActiveConnection && /* @__PURE__ */ jsxRuntimeExports.jsx(
75286
+ "button",
75287
+ {
75288
+ className: `sp-btn${isActive ? " sp-btn-primary" : ""}`,
75289
+ onClick: () => handleSetActiveConnection(selectedConnection),
75290
+ disabled: isActive || status === "testing",
75291
+ "aria-label": `Set ${selectedConnection.name} as the active connection for queries`,
75292
+ children: isActive ? "Active" : "Set active"
75293
+ }
75294
+ ),
75295
+ !selectedConnection.builtIn && /* @__PURE__ */ jsxRuntimeExports.jsx(
75296
+ "button",
75297
+ {
75298
+ className: "sp-btn sp-btn-ghost-danger",
75299
+ onClick: () => handleDeleteConnection(selectedConnection.id, selectedConnection.name),
75300
+ "aria-label": `Delete connection ${selectedConnection.name}`,
75301
+ children: "Delete"
75302
+ }
75303
+ )
75304
+ ]
75305
+ }
75306
+ )
75307
+ ]
75308
+ }
75309
+ ),
75272
75310
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sp-conn-detail-body", children: [
75273
75311
  renderToast(),
75274
75312
  modeAwareEditSchema ? /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -75299,7 +75337,24 @@ const ConnectionsManager = () => {
75299
75337
  disabled: isLoading,
75300
75338
  "aria-label": "Refresh connections",
75301
75339
  title: "Refresh",
75302
- children: /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { width: "14", height: "14", viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M4.681 3H2V2h3.5l.5.5V6H5V4a5 5 0 1 0 4.53-.761l.302-.953A6 6 0 1 1 4.681 3z" }) })
75340
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
75341
+ "svg",
75342
+ {
75343
+ width: "14",
75344
+ height: "14",
75345
+ viewBox: "0 0 16 16",
75346
+ xmlns: "http://www.w3.org/2000/svg",
75347
+ fill: "currentColor",
75348
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
75349
+ "path",
75350
+ {
75351
+ fillRule: "evenodd",
75352
+ clipRule: "evenodd",
75353
+ d: "M4.681 3H2V2h3.5l.5.5V6H5V4a5 5 0 1 0 4.53-.761l.302-.953A6 6 0 1 1 4.681 3z"
75354
+ }
75355
+ )
75356
+ }
75357
+ )
75303
75358
  }
75304
75359
  ),
75305
75360
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -75313,48 +75368,118 @@ const ConnectionsManager = () => {
75313
75368
  )
75314
75369
  ] })
75315
75370
  ] }),
75316
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sp-conn-grid", style: { display: "grid", gridTemplateColumns: "repeat(auto-fill, minmax(260px, 1fr))", gap: "12px" }, children: connections.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sp-conn-empty", style: { gridColumn: "1 / -1" }, children: "No connections configured." }) : connections.map((c) => {
75317
- const status = statuses[c.id] || "unknown";
75318
- const isActive = supportsActiveConnection && activeConnectionId === c.id;
75319
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(
75320
- "div",
75321
- {
75322
- className: "sp-conn-card",
75323
- style: {
75324
- border: "1px solid var(--sp-border)",
75325
- borderRadius: "6px",
75326
- padding: "12px",
75327
- background: "var(--sp-header-bg)",
75328
- cursor: "pointer",
75329
- display: "flex",
75330
- flexDirection: "column",
75331
- gap: "8px"
75332
- },
75333
- onClick: () => {
75334
- setSelectedConnectionId(c.id);
75335
- setIsFormOpen(false);
75336
- },
75337
- children: [
75338
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px", fontWeight: 600 }, children: [
75339
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { display: "flex", width: 16, height: 16, alignItems: "center", justifyContent: "center", color: "var(--sp-btn-bg)" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ConnectorGlyph, { type: c.type }) }),
75340
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: c.name })
75341
- ] }) }),
75342
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { fontSize: "12px", color: "var(--sp-muted-fg)" }, children: c.type.toUpperCase() }),
75343
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "6px", fontSize: "11px", marginTop: "4px" }, children: [
75344
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `sp-dot sp-dot-${status}` }),
75345
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { color: "var(--sp-muted-fg)" }, children: status === "ok" ? "Connected" : status === "error" ? "Error" : status === "testing" ? "Testing..." : "Disconnected" }),
75346
- isActive && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "sp-pill", style: { marginLeft: "auto" }, children: "Active" })
75347
- ] })
75348
- ]
75371
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
75372
+ "div",
75373
+ {
75374
+ className: "sp-conn-grid",
75375
+ style: {
75376
+ display: "grid",
75377
+ gridTemplateColumns: "repeat(auto-fill, minmax(260px, 1fr))",
75378
+ gap: "12px"
75349
75379
  },
75350
- c.id
75351
- );
75352
- }) })
75380
+ children: connections.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sp-conn-empty", style: { gridColumn: "1 / -1" }, children: "No connections configured." }) : connections.map((c) => {
75381
+ const testedStatus = statuses[c.id];
75382
+ const runtimeStatus = c.id === "built-in-duckdb" && c.engineState ? c.engineState === "ready" ? "ok" : c.engineState === "provisioning" ? "testing" : "error" : void 0;
75383
+ const status = testedStatus || runtimeStatus || "unknown";
75384
+ const statusLabel = !testedStatus && c.id === "built-in-duckdb" && c.engineState ? c.engineState === "ready" ? "Ready" : c.engineState === "provisioning" ? "Preparing engine..." : "Unavailable" : status === "ok" ? "Connected" : status === "error" ? "Error" : status === "testing" ? "Testing..." : "Disconnected";
75385
+ const isActive = supportsActiveConnection && activeConnectionId === c.id;
75386
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
75387
+ "div",
75388
+ {
75389
+ className: "sp-conn-card",
75390
+ style: {
75391
+ border: "1px solid var(--sp-border)",
75392
+ borderRadius: "6px",
75393
+ padding: "12px",
75394
+ background: "var(--sp-header-bg)",
75395
+ cursor: "pointer",
75396
+ display: "flex",
75397
+ flexDirection: "column",
75398
+ gap: "8px"
75399
+ },
75400
+ onClick: () => {
75401
+ setSelectedConnectionId(c.id);
75402
+ setIsFormOpen(false);
75403
+ },
75404
+ children: [
75405
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
75406
+ "div",
75407
+ {
75408
+ style: { display: "flex", justifyContent: "space-between", alignItems: "center" },
75409
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
75410
+ "div",
75411
+ {
75412
+ style: { display: "flex", alignItems: "center", gap: "8px", fontWeight: 600 },
75413
+ children: [
75414
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
75415
+ "span",
75416
+ {
75417
+ style: {
75418
+ display: "flex",
75419
+ width: 16,
75420
+ height: 16,
75421
+ alignItems: "center",
75422
+ justifyContent: "center",
75423
+ color: "var(--sp-btn-bg)"
75424
+ },
75425
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(ConnectorGlyph, { type: c.type })
75426
+ }
75427
+ ),
75428
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: c.name })
75429
+ ]
75430
+ }
75431
+ )
75432
+ }
75433
+ ),
75434
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { fontSize: "12px", color: "var(--sp-muted-fg)" }, children: c.type.toUpperCase() }),
75435
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
75436
+ "div",
75437
+ {
75438
+ style: {
75439
+ display: "flex",
75440
+ alignItems: "center",
75441
+ gap: "6px",
75442
+ fontSize: "11px",
75443
+ marginTop: "4px"
75444
+ },
75445
+ children: [
75446
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `sp-dot sp-dot-${status}` }),
75447
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { color: "var(--sp-muted-fg)" }, children: statusLabel }),
75448
+ isActive && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "sp-pill", style: { marginLeft: "auto" }, children: "Active" })
75449
+ ]
75450
+ }
75451
+ )
75452
+ ]
75453
+ },
75454
+ c.id
75455
+ );
75456
+ })
75457
+ }
75458
+ )
75353
75459
  ] });
75354
75460
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sp-conn-page", children: [
75355
75461
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sp-conn", children: !isFormOpen && !selectedConnectionId ? renderGrid() : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
75356
- /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "sp-btn", onClick: closeForm, style: { marginBottom: 12, alignSelf: "flex-start" }, children: "← Back to connections" }),
75357
- /* @__PURE__ */ jsxRuntimeExports.jsx("section", { "aria-label": "Connection details", style: { background: "var(--sp-bg)", border: "1px solid var(--sp-border)", borderRadius: 6 }, children: isFormOpen ? renderConnectionForm() : renderConnectionDetails() })
75462
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
75463
+ "button",
75464
+ {
75465
+ className: "sp-btn",
75466
+ onClick: closeForm,
75467
+ style: { marginBottom: 12, alignSelf: "flex-start" },
75468
+ children: "← Back to connections"
75469
+ }
75470
+ ),
75471
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
75472
+ "section",
75473
+ {
75474
+ "aria-label": "Connection details",
75475
+ style: {
75476
+ background: "var(--sp-bg)",
75477
+ border: "1px solid var(--sp-border)",
75478
+ borderRadius: 6
75479
+ },
75480
+ children: isFormOpen ? renderConnectionForm() : renderConnectionDetails()
75481
+ }
75482
+ )
75358
75483
  ] }) }),
75359
75484
  /* @__PURE__ */ jsxRuntimeExports.jsx(
75360
75485
  ConfirmDialog,