@reddb-io/ui 0.4.0 → 0.4.1

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.
Files changed (28) hide show
  1. package/build/_app/immutable/chunks/{Bf0kgHHV.js → BOm0dWBE.js} +1 -1
  2. package/build/_app/immutable/chunks/{DkihsTT_.js → BjiIDQc5.js} +1 -1
  3. package/build/_app/immutable/chunks/{CQUazLlV.js → CraBVUa8.js} +1 -1
  4. package/build/_app/immutable/chunks/{DxlrWGyf.js → Dc8lKBnh.js} +6 -6
  5. package/build/_app/immutable/chunks/{kA3Jql_0.js → kV8hsQzl.js} +1 -1
  6. package/build/_app/immutable/chunks/{DEXJoNrJ.js → tI1T3IGL.js} +4 -4
  7. package/build/_app/immutable/entry/{app.DsWyVHHY.js → app.CqnCbx3-.js} +2 -2
  8. package/build/_app/immutable/entry/start.BHO_MY7Q.js +1 -0
  9. package/build/_app/immutable/nodes/{0.B3B9dr1W.js → 0.B0qC983k.js} +1 -1
  10. package/build/_app/immutable/nodes/{1.BRHK3-aW.js → 1.BALgKrlb.js} +1 -1
  11. package/build/_app/immutable/nodes/{10.DO83djGy.js → 10.Dg8SyeBS.js} +1 -1
  12. package/build/_app/immutable/nodes/{15.BMQezBh7.js → 15.UGiFEthu.js} +1 -1
  13. package/build/_app/version.json +1 -1
  14. package/build/index.html +10 -10
  15. package/dist/embed/{AnalyticsView-C_h8ScpB.js → AnalyticsView-g7iZKS88.js} +4 -4
  16. package/dist/embed/{AnalyticsView-C_h8ScpB.js.map → AnalyticsView-g7iZKS88.js.map} +1 -1
  17. package/dist/embed/{RedUiEmbedRoot-BlduSCNM.js → RedUiEmbedRoot-B0chjnkm.js} +5 -5
  18. package/dist/embed/{RedUiEmbedRoot-BlduSCNM.js.map → RedUiEmbedRoot-B0chjnkm.js.map} +1 -1
  19. package/dist/embed/{index-client-DelkELqi.js → index-client-DqhuzUPo.js} +2 -2
  20. package/dist/embed/{index-client-DelkELqi.js.map → index-client-DqhuzUPo.js.map} +1 -1
  21. package/dist/embed/{index-BSBRHtH4.js → index-dKxVhrdf.js} +161 -156
  22. package/dist/embed/{index-BSBRHtH4.js.map → index-dKxVhrdf.js.map} +1 -1
  23. package/dist/embed/index.js +1 -1
  24. package/dist/embed/{sigma.esm-D9VpQHRm.js → sigma.esm-BFfaH_Ia.js} +2 -2
  25. package/dist/embed/{sigma.esm-D9VpQHRm.js.map → sigma.esm-BFfaH_Ia.js.map} +1 -1
  26. package/package.json +3 -3
  27. package/src/lib/reddb/client.ts +20 -14
  28. package/build/_app/immutable/entry/start.JTS2dMkh.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reddb-io/ui",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "private": false,
5
5
  "description": "RedDB UI components and standalone web application.",
6
6
  "type": "module",
@@ -47,8 +47,8 @@
47
47
  },
48
48
  "dependencies": {
49
49
  "@aflsolutions/graphology-communities-leiden": "^1.1.1",
50
- "@reddb-io/ui-kit": "0.4.0",
51
- "@reddb-io/ui-mcp": "0.4.0",
50
+ "@reddb-io/ui-kit": "0.4.1",
51
+ "@reddb-io/ui-mcp": "0.4.1",
52
52
  "@sigma/edge-curve": "^3.1.0",
53
53
  "@sigma/node-border": "^3.0.0",
54
54
  "@tauri-apps/api": "^2.5.0",
@@ -223,17 +223,10 @@ function isUnsupportedCollectionMetadataRoute(e: unknown): boolean {
223
223
  return message.includes("route not found: GET /collections/");
224
224
  }
225
225
 
226
- /**
227
- * Generalised "the server doesn't have this route" check (#22). `json()`
228
- * throws `<METHOD> <path> → <status> <body>`, so a 404 or a "route not found"
229
- * body both signal an unsupported route. Distinct from auth/5xx/network errors
230
- * — but capability negotiation treats *any* probe failure as unsupported
231
- * (fail safe), so this is only used to tell "route absent" from "signal
232
- * present" when reading the stable `/capabilities` endpoint.
233
- */
226
+ /** Missing or unimplemented discovery routes may use compatibility probes. */
234
227
  function isUnsupportedRoute(e: unknown): boolean {
235
228
  const message = e instanceof Error ? e.message : String(e);
236
- return / → 404\b/.test(message) || message.includes("route not found");
229
+ return / → (404|405|501)\b/.test(message);
237
230
  }
238
231
 
239
232
  function unsupportedCollectionMetadataError(baseUrl: string): Error {
@@ -586,17 +579,30 @@ export class RedClient {
586
579
 
587
580
  /**
588
581
  * Resolve the server's capability map (#22). Prefers the stable
589
- * `/capabilities` signal; when that route is absent (older server), infers
590
- * from lightweight, side-effect-free GET probes. Any non-404 failure
591
- * (network, auth, 5xx) fails safe to the empty map, so the UI hides controls
582
+ * `/capabilities` signal; when that route is absent or returns structured
583
+ * discovery without UI feature flags, infers from lightweight, side-effect-free
584
+ * GET probes. Compatibility follows working APIs, not the server version.
585
+ * Other failures (network, authentication, unexpected HTTP status) fail safe
586
+ * to the empty map, so the UI hides controls
592
587
  * rather than showing ones the server can't honour.
593
588
  */
594
589
  async capabilities(): Promise<ServerCapabilities> {
595
590
  try {
596
591
  const raw = await this.json<RawCapabilities>("/capabilities");
597
- return capabilitiesFromSignal(raw);
592
+ if (
593
+ !raw ||
594
+ typeof raw !== "object" ||
595
+ Array.isArray(raw) ||
596
+ raw.ok === false
597
+ )
598
+ return { ...EMPTY_SERVER_CAPABILITIES };
599
+ // A flat declaration is authoritative, including explicit false/empty
600
+ // flags. Structured discovery reports build/deployment state instead;
601
+ // prove optional UI routes with read-only probes before enabling them.
602
+ if ("features" in raw || "capabilities" in raw)
603
+ return capabilitiesFromSignal(raw);
598
604
  } catch (e) {
599
- // Only an absent route falls through to inference; anything else (a
605
+ // Only an absent/unimplemented route falls through; anything else (a
600
606
  // flaky network, an auth wall, a 5xx) hides everything.
601
607
  if (!isUnsupportedRoute(e)) return { ...EMPTY_SERVER_CAPABILITIES };
602
608
  }
@@ -1 +0,0 @@
1
- import{l as o,s as r}from"../chunks/Bf0kgHHV.js";export{o as load_css,r as start};