@omniviewdev/runtime 0.4.2 → 0.5.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.
Files changed (29) hide show
  1. package/dist/api.cjs +1 -1
  2. package/dist/api.js +246 -113
  3. package/dist/bindings/events/index.d.ts +140 -0
  4. package/dist/bindings/github.com/omniviewdev/omniview/appservice.d.ts +5 -0
  5. package/dist/bindings/github.com/omniviewdev/omniview/backend/pkg/plugin/devserver/index.d.ts +1 -1
  6. package/dist/bindings/github.com/omniviewdev/omniview/backend/pkg/plugin/devserver/models.d.ts +24 -26
  7. package/dist/bindings/github.com/omniviewdev/omniview/backend/pkg/plugin/devserver/servicewrapper.d.ts +0 -1
  8. package/dist/bindings/github.com/omniviewdev/omniview/backend/pkg/plugin/servicewrapper.d.ts +2 -0
  9. package/dist/bindings/github.com/omniviewdev/omniview/internal/devcontract/index.d.ts +1 -0
  10. package/dist/bindings/github.com/omniviewdev/omniview/internal/devcontract/models.d.ts +101 -0
  11. package/dist/bindings/github.com/omniviewdev/plugin-sdk/pkg/config/index.d.ts +1 -1
  12. package/dist/bindings/github.com/omniviewdev/plugin-sdk/pkg/config/models.d.ts +31 -0
  13. package/dist/errors/types.d.ts +2 -0
  14. package/dist/graphservice-Cb7rr7SB.cjs +1 -0
  15. package/dist/graphservice-DloOtC_7.js +739 -0
  16. package/dist/index.cjs +2 -2
  17. package/dist/index.js +566 -539
  18. package/dist/models-8-4Ny_ft.cjs +1 -0
  19. package/dist/{models-3V1aa9YT.js → models-BlTzZkmp.js} +46 -60
  20. package/dist/models-CGYstu7u.cjs +1 -0
  21. package/dist/{models-B97zjrHu.js → models-D-vu7j83.js} +442 -411
  22. package/dist/models.cjs +1 -1
  23. package/dist/models.d.ts +1 -1
  24. package/dist/models.js +39 -38
  25. package/package.json +5 -5
  26. package/dist/graphservice-2kgAuCnt.cjs +0 -1
  27. package/dist/graphservice-5kuEPkCT.js +0 -731
  28. package/dist/models-BPmIMpct.cjs +0 -1
  29. package/dist/models-sJV1iQbd.cjs +0 -1
package/dist/index.js CHANGED
@@ -1,17 +1,17 @@
1
1
  var at = Object.defineProperty;
2
2
  var ct = (t, e, n) => e in t ? at(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var A = (t, e, n) => ct(t, typeof e != "symbol" ? e + "" : e, n);
3
+ var D = (t, e, n) => ct(t, typeof e != "symbol" ? e + "" : e, n);
4
4
  import { jsx as x, jsxs as X } from "react/jsx-runtime";
5
- import b, { useContext as Y, createContext as re, useState as G, useCallback as L, useSyncExternalStore as ut, useRef as q, useEffect as U, useMemo as lt } from "react";
6
- import { Link as dt, useNavigate as ft, useLocation as pt, createMemoryRouter as yt, RouterProvider as gt } from "react-router-dom";
7
- import { P as ht, G as mt, V as St, S as _t, a as Pe, U as Et, R as wt, b as Ct, c as Oe, d as bt, L as vt, e as Rt, f as Ft, g as It, h as Pt, i as Ot, j as Tt, C as At, k as xt, l as Dt, m as Nt, n as kt, Q as Lt, o as Mt, p as Ce, q as $t, r as Te, F as qt, s as Ut, t as Ae, D as xe, u as Wt, v as Gt, w as jt, x as De, y as Qt, z as Kt, A as Ne, B as Ht, E as Bt, H as zt, I as Yt, J as Jt, K as Zt, M as Xt, N as Vt, O as en, T as tn } from "./graphservice-5kuEPkCT.js";
8
- import { P as nn, W as rn, S as sn, C as on, L as an, F as cn, a as un, U as ke, D as Le, G as ln, b as Me, c as $e, A as qe } from "./models-B97zjrHu.js";
9
- import { useQueryClient as j, useMutation as T, useQuery as O, keepPreviousData as Ue, useQueries as dn } from "@tanstack/react-query";
10
- import { useToast as fn } from "@omniviewdev/base-ui";
5
+ import w, { useContext as Y, createContext as re, useState as G, useRef as q, useCallback as k, useSyncExternalStore as ut, useEffect as $, useMemo as lt } from "react";
6
+ import { Link as dt, useNavigate as ft, useLocation as pt, createMemoryRouter as gt, RouterProvider as yt } from "react-router-dom";
11
7
  import "./index-D2mKAO8s.js";
12
- import { O as D, a as We, b as ae } from "./events-DDTGFACO.js";
8
+ import { P as ht, G as mt, V as St, S as _t, a as Pe, U as Et, R as wt, b as Ct, c as Oe, d as bt, L as vt, e as Rt, f as Ft, g as It, h as Pt, i as Ot, j as Tt, C as At, k as Dt, l as xt, m as Nt, n as kt, Q as Lt, o as Mt, p as Ce, q as qt, r as Te, F as Ut, s as $t, t as Ae, D as De, u as Wt, v as Gt, w as jt, x as xe, y as Qt, z as Kt, A as Ne, B as Ht, E as Bt, H as zt, I as Yt, J as Jt, K as Zt, M as Xt, N as Vt, O as en, T as tn } from "./graphservice-DloOtC_7.js";
9
+ import { P as nn, W as rn, S as sn, C as on, L as an, F as cn, a as un, U as ke, D as Le, G as ln, b as Me, c as qe, A as Ue } from "./models-D-vu7j83.js";
10
+ import { O, a as $e, b as ae } from "./events-DDTGFACO.js";
11
+ import { useQueryClient as j, useMutation as A, useQuery as T, keepPreviousData as We, useQueries as dn } from "@tanstack/react-query";
12
+ import { useToast as fn } from "@omniviewdev/base-ui";
13
13
  import { w as pn } from "./legacyEnum-DORXlU_y.js";
14
- const ye = b.createContext(void 0), $ = {
14
+ const ge = w.createContext(void 0), U = {
15
15
  // Plugin
16
16
  PLUGIN_NOT_FOUND: "omniview:plugin/not-found",
17
17
  PLUGIN_NOT_LOADED: "omniview:plugin/not-loaded",
@@ -19,6 +19,8 @@ const ye = b.createContext(void 0), $ = {
19
19
  PLUGIN_INSTALL_FAILED: "omniview:plugin/install-failed",
20
20
  PLUGIN_LOAD_FAILED: "omniview:plugin/load-failed",
21
21
  PLUGIN_BUILD_FAILED: "omniview:plugin/build-failed",
22
+ PLUGIN_COMMITTED_CLEANUP_PENDING: "omniview:plugin/committed-cleanup-pending",
23
+ PLUGIN_COMMIT_UNCERTAIN: "omniview:plugin/commit-uncertain",
22
24
  // Settings
23
25
  SETTINGS_MISSING_CONFIG: "omniview:settings/missing-config",
24
26
  SETTINGS_INVALID_CONFIG: "omniview:settings/invalid-config",
@@ -42,31 +44,31 @@ const ye = b.createContext(void 0), $ = {
42
44
  VALIDATION: "omniview:validation",
43
45
  NOT_IMPLEMENTED: "omniview:not-implemented"
44
46
  };
45
- function yn(t) {
47
+ function gn(t) {
46
48
  switch (t) {
47
49
  case "NOT_FOUND":
48
- return { typeUri: $.RESOURCE_NOT_FOUND, status: 404 };
50
+ return { typeUri: U.RESOURCE_NOT_FOUND, status: 404 };
49
51
  case "FORBIDDEN":
50
- return { typeUri: $.RESOURCE_FORBIDDEN, status: 403 };
52
+ return { typeUri: U.RESOURCE_FORBIDDEN, status: 403 };
51
53
  case "UNAUTHORIZED":
52
- return { typeUri: $.RESOURCE_UNAUTHORIZED, status: 401 };
54
+ return { typeUri: U.RESOURCE_UNAUTHORIZED, status: 401 };
53
55
  case "CONFLICT":
54
56
  case "ALREADY_EXISTS":
55
- return { typeUri: $.RESOURCE_CONFLICT, status: 409 };
57
+ return { typeUri: U.RESOURCE_CONFLICT, status: 409 };
56
58
  case "TIMEOUT":
57
- return { typeUri: $.RESOURCE_TIMEOUT, status: 408 };
59
+ return { typeUri: U.RESOURCE_TIMEOUT, status: 408 };
58
60
  case "CONNECTION_ERROR":
59
- return { typeUri: $.RESOURCE_CONNECTION_ERROR, status: 503 };
61
+ return { typeUri: U.RESOURCE_CONNECTION_ERROR, status: 503 };
60
62
  case "CERTIFICATE_ERROR":
61
- return { typeUri: $.RESOURCE_CERTIFICATE_ERROR, status: 502 };
63
+ return { typeUri: U.RESOURCE_CERTIFICATE_ERROR, status: 502 };
62
64
  default:
63
- return { typeUri: $.INTERNAL, status: 500 };
65
+ return { typeUri: U.INTERNAL, status: 500 };
64
66
  }
65
67
  }
66
68
  function Q(t) {
67
69
  if (t == null)
68
70
  return {
69
- type: $.INTERNAL,
71
+ type: U.INTERNAL,
70
72
  title: "Unknown error",
71
73
  status: 500,
72
74
  detail: "An unknown error occurred."
@@ -78,7 +80,7 @@ function Q(t) {
78
80
  if (typeof n.type == "string" && typeof n.title == "string" && typeof n.status == "number" && typeof n.detail == "string")
79
81
  return n;
80
82
  if (typeof n.code == "string" && typeof n.title == "string" && typeof n.message == "string") {
81
- const { typeUri: r, status: s } = yn(n.code);
83
+ const { typeUri: r, status: s } = gn(n.code);
82
84
  return {
83
85
  type: r,
84
86
  title: n.title,
@@ -90,16 +92,16 @@ function Q(t) {
90
92
  } catch {
91
93
  }
92
94
  return {
93
- type: $.INTERNAL,
95
+ type: U.INTERNAL,
94
96
  title: "Error",
95
97
  status: 500,
96
98
  detail: e
97
99
  };
98
100
  }
99
101
  function Ge(t) {
100
- return t == null ? !1 : (typeof t == "string" ? t : t instanceof Error ? t.message : String(t)) === "cancelled" ? !0 : Q(t).type === $.CANCELLED;
102
+ return t == null ? !1 : (typeof t == "string" ? t : t instanceof Error ? t.message : String(t)) === "cancelled" ? !0 : Q(t).type === U.CANCELLED;
101
103
  }
102
- function gn(t) {
104
+ function yn(t) {
103
105
  switch (t.type) {
104
106
  case "navigate":
105
107
  return {
@@ -147,7 +149,7 @@ function je(t, e) {
147
149
  message: e || (t.title !== "Error" ? t.title : "Operation failed"),
148
150
  status: "error",
149
151
  details: n,
150
- actions: (i = t.actions) == null ? void 0 : i.map(gn)
152
+ actions: (i = t.actions) == null ? void 0 : i.map(yn)
151
153
  };
152
154
  }
153
155
  function z(t, e, n) {
@@ -155,7 +157,7 @@ function z(t, e, n) {
155
157
  const r = Q(e);
156
158
  t(je(r, n));
157
159
  }
158
- function k(t, e) {
160
+ function L(t, e) {
159
161
  return (n) => {
160
162
  if (Ge(n)) return;
161
163
  const r = Q(n);
@@ -163,30 +165,51 @@ function k(t, e) {
163
165
  };
164
166
  }
165
167
  function zr(t) {
166
- const { children: e, pluginId: n } = t, [r, s] = b.useState({}), [i, o] = b.useState(new nn()), [a, c] = b.useState(!1), [l, u] = b.useState(null);
168
+ const { children: e, pluginId: n } = t, [r, s] = w.useState({}), [i, o] = w.useState(new nn()), [a, c] = w.useState(!1), [l, u] = w.useState(null), f = w.useRef(0), d = w.useRef(0);
167
169
  console.debug("[PluginContextProvider] render", { pluginId: n, metaLoaded: a, metaError: !!l });
168
- const p = () => {
169
- n === void 0 || n === "" || (console.debug(`[PluginContextProvider] fetching settings for "${n}"`), ht(n).then((d) => {
170
- console.debug(`[PluginContextProvider] settings loaded for "${n}"`, Object.keys(d)), s(d);
171
- }).catch((d) => {
172
- const y = Q(d);
170
+ const p = w.useCallback(() => {
171
+ if (n === void 0 || n === "")
172
+ return;
173
+ const S = ++f.current;
174
+ console.debug(`[PluginContextProvider] fetching settings for "${n}"`), ht(n).then((m) => {
175
+ S === f.current && (console.debug(`[PluginContextProvider] settings loaded for "${n}"`, Object.keys(m)), s(m));
176
+ }).catch((m) => {
177
+ if (S !== f.current) return;
178
+ const y = Q(m);
173
179
  console.error(`[PluginContextProvider] error fetching settings for "${n}":`, y.detail);
174
- }));
175
- }, f = () => {
180
+ });
181
+ }, [n]), g = w.useCallback(() => {
176
182
  if (n === void 0 || n === "") {
177
183
  console.debug("[PluginContextProvider] skipping meta fetch — empty pluginId");
178
184
  return;
179
185
  }
180
- console.debug(`[PluginContextProvider] fetching meta for "${n}"`), u(null), mt(n).then((d) => {
181
- console.debug(`[PluginContextProvider] meta loaded for "${n}"`, { name: d == null ? void 0 : d.name, version: d == null ? void 0 : d.version }), o(d), c(!0);
182
- }).catch((d) => {
183
- const y = Q(d);
186
+ const S = ++d.current;
187
+ console.debug(`[PluginContextProvider] fetching meta for "${n}"`), u(null), mt(n).then((m) => {
188
+ S === d.current && (console.debug(`[PluginContextProvider] meta loaded for "${n}"`, { name: m == null ? void 0 : m.name, version: m == null ? void 0 : m.version }), o(m), c(!0));
189
+ }).catch((m) => {
190
+ if (S !== d.current) return;
191
+ const y = Q(m);
184
192
  console.error(`[PluginContextProvider] error fetching meta for "${n}":`, y.detail), u(y.detail), c(!1);
185
193
  });
186
- };
187
- return b.useEffect(() => {
188
- console.debug(`[PluginContextProvider] useEffect — pluginId changed to "${n}"`), p(), f();
189
- }, [n]), l ? /* @__PURE__ */ x("div", { style: {
194
+ }, [n]);
195
+ return w.useEffect(() => {
196
+ if (a) return;
197
+ const S = () => {
198
+ p(), g();
199
+ }, m = [
200
+ O("plugin/init_complete", S),
201
+ O("plugin/dev_install_complete", (y) => {
202
+ var _;
203
+ ((_ = y.data) == null ? void 0 : _.id) === n && S();
204
+ }),
205
+ O("plugin/inventory_changed", S)
206
+ ];
207
+ return () => {
208
+ for (const y of m) y();
209
+ };
210
+ }, [n, a, p, g]), w.useEffect(() => (console.debug(`[PluginContextProvider] useEffect — pluginId changed to "${n}"`), c(!1), u(null), s({}), p(), g(), () => {
211
+ ++f.current, ++d.current;
212
+ }), [n, p, g]), l ? /* @__PURE__ */ x("div", { style: {
190
213
  display: "flex",
191
214
  flex: 1,
192
215
  alignItems: "center",
@@ -213,7 +236,7 @@ function zr(t) {
213
236
  /* @__PURE__ */ x(
214
237
  "button",
215
238
  {
216
- onClick: () => f(),
239
+ onClick: () => g(),
217
240
  style: {
218
241
  background: "transparent",
219
242
  color: "#F87171",
@@ -227,7 +250,7 @@ function zr(t) {
227
250
  children: "Retry"
228
251
  }
229
252
  )
230
- ] }) }) : a ? /* @__PURE__ */ x(ye.Provider, { value: { pluginId: n, settings: r, meta: i }, children: e }) : /* @__PURE__ */ X("div", { style: {
253
+ ] }) }) : a ? /* @__PURE__ */ x(ge.Provider, { value: { pluginId: n, settings: r, meta: i }, children: e }) : /* @__PURE__ */ X("div", { style: {
231
254
  display: "flex",
232
255
  flex: 1,
233
256
  alignItems: "center",
@@ -244,30 +267,34 @@ function zr(t) {
244
267
  /* @__PURE__ */ x("style", { children: "@keyframes plugin-spin { to { transform: rotate(360deg); } }" })
245
268
  ] });
246
269
  }
247
- function ge() {
248
- const t = Y(ye);
270
+ function ye() {
271
+ const t = Y(ge);
249
272
  if (!t)
250
273
  throw new Error("usePluginContext must be used within a PluginContextProvider");
251
274
  return t;
252
275
  }
253
276
  function Yr() {
254
- return ge().settings;
277
+ return ye().settings;
255
278
  }
256
279
  const Qe = re(void 0), Jr = ({ children: t }) => {
257
- const [e, n] = G({}), r = () => {
258
- St().then((i) => {
259
- console.log("Fetched settings:", i), n(i);
260
- }).catch((i) => {
261
- console.error("Error fetching settings:", i);
280
+ const [e, n] = G({}), r = q(0), s = k(() => {
281
+ const o = r.current + 1;
282
+ r.current = o, St().then((a) => {
283
+ o === r.current && n(a);
284
+ }).catch((a) => {
285
+ o === r.current && console.error("Error fetching settings:", a);
262
286
  });
263
- };
264
- b.useEffect(() => {
265
- r();
266
287
  }, []);
267
- const s = () => {
268
- r();
269
- };
270
- return /* @__PURE__ */ x(Qe.Provider, { value: { settings: e, reload: s }, children: t });
288
+ w.useEffect(() => {
289
+ const o = O("settings/changed", () => s());
290
+ return s(), () => {
291
+ r.current += 1, o();
292
+ };
293
+ }, [s]);
294
+ const i = k(() => {
295
+ s();
296
+ }, [s]);
297
+ return /* @__PURE__ */ x(Qe.Provider, { value: { settings: e, reload: i }, children: t });
271
298
  }, hn = {
272
299
  height: 32,
273
300
  focused: 0,
@@ -292,17 +319,17 @@ const Qe = re(void 0), Jr = ({ children: t }) => {
292
319
  },
293
320
  fullscreenDrawer: () => {
294
321
  }
295
- }, mn = b.createContext(hn), Sn = re(void 0), _n = b.createContext(void 0), Ke = b.createContext(void 0), En = 3e4, Zr = ({ children: t }) => {
296
- const [e, n] = b.useState([]), r = b.useCallback((a) => {
322
+ }, mn = w.createContext(hn), Sn = re(void 0), _n = w.createContext(void 0), Ke = w.createContext(void 0), En = 3e4, Zr = ({ children: t }) => {
323
+ const [e, n] = w.useState([]), r = w.useCallback((a) => {
297
324
  n((c) => [a, ...c]);
298
- }, []), s = b.useCallback((a, c) => {
325
+ }, []), s = w.useCallback((a, c) => {
299
326
  n(
300
327
  (l) => l.map((u) => u.id === a ? { ...u, ...c } : u)
301
328
  );
302
- }, []), i = b.useCallback((a) => {
329
+ }, []), i = w.useCallback((a) => {
303
330
  n((c) => c.filter((l) => l.id !== a));
304
331
  }, []);
305
- b.useEffect(() => {
332
+ w.useEffect(() => {
306
333
  const a = [];
307
334
  for (const c of e)
308
335
  if (c.status === "completed" || c.status === "error") {
@@ -311,7 +338,7 @@ const Qe = re(void 0), Jr = ({ children: t }) => {
311
338
  }
312
339
  return () => a.forEach(clearTimeout);
313
340
  }, [e, i]);
314
- const o = b.useMemo(
341
+ const o = w.useMemo(
315
342
  () => ({ operations: e, addOperation: r, updateOperation: s, removeOperation: i }),
316
343
  [e, r, s, i]
317
344
  );
@@ -365,7 +392,7 @@ function V(t) {
365
392
  })(fe || (fe = {}));
366
393
  const Be = re(void 0), Rn = () => Y(Be);
367
394
  function Xr(t) {
368
- const e = Rn(), n = b.useRef(null), r = e == null ? void 0 : e.getExtensionPoint(t), s = L(
395
+ const e = Rn(), n = w.useRef(null), r = e == null ? void 0 : e.getExtensionPoint(t), s = k(
369
396
  (o) => {
370
397
  const a = [];
371
398
  return e && a.push(e.subscribe(o)), r && a.push(r.subscribe(o)), () => {
@@ -374,7 +401,7 @@ function Xr(t) {
374
401
  };
375
402
  },
376
403
  [e, t, r]
377
- ), i = L(() => {
404
+ ), i = k(() => {
378
405
  const o = e == null ? void 0 : e.getExtensionPoint(t);
379
406
  if (!o) {
380
407
  if (n.current && n.current.store === void 0)
@@ -391,7 +418,7 @@ function Xr(t) {
391
418
  return ut(s, i), e == null ? void 0 : e.getExtensionPoint(t);
392
419
  }
393
420
  const Vr = ({ registry: t, children: e }) => {
394
- const n = b.useRef(t);
421
+ const n = w.useRef(t);
395
422
  return fe(
396
423
  n.current === t,
397
424
  "You can't change the extension registry after it has been rendered"
@@ -403,15 +430,15 @@ const Vr = ({ registry: t, children: e }) => {
403
430
  };
404
431
  class Fn {
405
432
  constructor(e) {
406
- A(this, "id");
407
- A(this, "mode");
408
- A(this, "_pluginId");
409
- A(this, "_version", 0);
410
- A(this, "_contributions", /* @__PURE__ */ new Map());
411
- A(this, "_lookupCache", /* @__PURE__ */ new Map());
412
- A(this, "_matcher");
413
- A(this, "_select");
414
- A(this, "_listeners", /* @__PURE__ */ new Set());
433
+ D(this, "id");
434
+ D(this, "mode");
435
+ D(this, "_pluginId");
436
+ D(this, "_version", 0);
437
+ D(this, "_contributions", /* @__PURE__ */ new Map());
438
+ D(this, "_lookupCache", /* @__PURE__ */ new Map());
439
+ D(this, "_matcher");
440
+ D(this, "_select");
441
+ D(this, "_listeners", /* @__PURE__ */ new Set());
415
442
  this.id = e.id, this.mode = e.mode ?? "multiple", this._pluginId = e.pluginId, this._matcher = e.matcher, this._select = e.select;
416
443
  }
417
444
  get pluginId() {
@@ -523,9 +550,9 @@ class Fn {
523
550
  }
524
551
  class es {
525
552
  constructor(e) {
526
- A(this, "_stores", /* @__PURE__ */ new Map());
527
- A(this, "_storeUnsubs", /* @__PURE__ */ new Map());
528
- A(this, "_listeners", /* @__PURE__ */ new Set());
553
+ D(this, "_stores", /* @__PURE__ */ new Map());
554
+ D(this, "_storeUnsubs", /* @__PURE__ */ new Map());
555
+ D(this, "_listeners", /* @__PURE__ */ new Set());
529
556
  if (e != null && e.initialStores)
530
557
  for (const n of e.initialStores)
531
558
  this.addExtensionPoint(n);
@@ -604,25 +631,25 @@ const ze = re(void 0), In = {
604
631
  warning: "warning",
605
632
  error: "danger"
606
633
  }, ts = ({ children: t }) => {
607
- const { toast: e } = fn(), [n, r] = b.useState([]), s = (o) => {
634
+ const { toast: e } = fn(), [n, r] = w.useState([]), s = (o) => {
608
635
  r((a) => [...a, o]);
609
636
  }, i = (o, a, c) => {
610
637
  const l = typeof o == "object";
611
- let u = "", p = "info", f, d = 5e3, y;
638
+ let u = "", f = "info", d, p = 5e3, g;
612
639
  if (l) {
613
640
  if (u = o.message, o.showOnce) {
614
641
  if (n.includes(u))
615
642
  return;
616
643
  s(u);
617
644
  }
618
- p = o.status, f = o.details, d = o.autoHideDuration ?? 5e3, y = o.actions;
645
+ f = o.status, d = o.details, p = o.autoHideDuration ?? 5e3, g = o.actions;
619
646
  } else
620
- u = o, p = a, f = c;
621
- e(f ?? u, {
622
- severity: In[p] ?? "info",
623
- title: f ? u : void 0,
624
- duration: d,
625
- action: y == null ? void 0 : y[0]
647
+ u = o, f = a, d = c;
648
+ e(d ?? u, {
649
+ severity: In[f] ?? "info",
650
+ title: d ? u : void 0,
651
+ duration: p,
652
+ action: g == null ? void 0 : g[0]
626
653
  });
627
654
  };
628
655
  return /* @__PURE__ */ x(ze.Provider, { value: { showSnackbar: i }, children: t });
@@ -633,7 +660,7 @@ const ze = re(void 0), In = {
633
660
  return t;
634
661
  };
635
662
  function P(t) {
636
- const e = Y(ye), n = (e == null ? void 0 : e.pluginId) ?? t;
663
+ const e = Y(ge), n = (e == null ? void 0 : e.pluginId) ?? t;
637
664
  if (!n)
638
665
  throw new Error(
639
666
  "pluginID must be provided either via PluginContext or as an explicit parameter"
@@ -641,44 +668,44 @@ function P(t) {
641
668
  return n;
642
669
  }
643
670
  const ns = ({ pluginID: t, connectionID: e }) => {
644
- const n = P(t), r = j(), { showSnackbar: s } = W(), i = [n, "connection", "detail", e], { mutateAsync: o } = T({
671
+ const n = P(t), r = j(), { showSnackbar: s } = W(), i = [n, "connection", "detail", e], { mutateAsync: o } = A({
645
672
  mutationFn: async () => _t(n, e),
646
- onSuccess(p) {
647
- r.setQueryData(i, p), r.invalidateQueries({
673
+ onSuccess(f) {
674
+ r.setQueryData(i, f), r.invalidateQueries({
648
675
  queryKey: ["EDITOR_SCHEMAS", n, e]
649
676
  });
650
677
  },
651
- onError: k(s, "Failed to start connection")
652
- }), { mutateAsync: a } = T({
678
+ onError: L(s, "Failed to start connection")
679
+ }), { mutateAsync: a } = A({
653
680
  mutationFn: async () => Pe(n, e),
654
- onSuccess(p) {
655
- r.setQueryData(i, p);
681
+ onSuccess(f) {
682
+ r.setQueryData(i, f);
656
683
  },
657
- onError: k(s, "Failed to stop connection")
658
- }), { mutateAsync: c } = T({
659
- mutationFn: async (p) => Et(n, p),
660
- onSuccess(p, { name: f }) {
661
- s({ message: `Connection ${f} successfully updated`, status: "success" }), r.setQueryData(i, p), r.setQueriesData(
684
+ onError: L(s, "Failed to stop connection")
685
+ }), { mutateAsync: c } = A({
686
+ mutationFn: async (f) => Et(n, f),
687
+ onSuccess(f, { name: d }) {
688
+ s({ message: `Connection ${d} successfully updated`, status: "success" }), r.setQueryData(i, f), r.setQueriesData(
662
689
  { queryKey: [n, "connection", "list"] },
663
- (d) => d == null ? void 0 : d.map((y) => y.id === e ? p : y)
690
+ (p) => p == null ? void 0 : p.map((g) => g.id === e ? f : g)
664
691
  );
665
692
  },
666
- onError: k(s, "Failed to update connection")
667
- }), { mutateAsync: l } = T({
693
+ onError: L(s, "Failed to update connection")
694
+ }), { mutateAsync: l } = A({
668
695
  mutationFn: async () => wt(n, e),
669
696
  onSuccess() {
670
697
  s({ message: "Connection successfully removed", status: "success" }), r.setQueryData(i, void 0), r.setQueriesData(
671
698
  { queryKey: [n, "connection", "list"] },
672
- (p) => p == null ? void 0 : p.filter((f) => f.id !== e)
699
+ (f) => f == null ? void 0 : f.filter((d) => d.id !== e)
673
700
  );
674
701
  },
675
- onError: k(s, "Failed to remove connection")
702
+ onError: L(s, "Failed to remove connection")
676
703
  });
677
704
  return {
678
705
  /**
679
706
  * Get the connection
680
707
  */
681
- connection: O({
708
+ connection: T({
682
709
  queryKey: i,
683
710
  queryFn: async () => Ct(n, e)
684
711
  }),
@@ -700,34 +727,34 @@ const ns = ({ pluginID: t, connectionID: e }) => {
700
727
  deleteConnection: l
701
728
  };
702
729
  }, Pn = (t) => [t, "connection", "list"], rs = ({ plugin: t }) => {
703
- const e = P(t), n = j(), { showSnackbar: r } = W(), s = Pn(e), { mutateAsync: i } = T({
730
+ const e = P(t), n = j(), { showSnackbar: r } = W(), s = Pn(e), { mutateAsync: i } = A({
704
731
  mutationFn: async (l) => Oe(e, l.id),
705
- onError: k(r, "Failed to start connection watch")
706
- }), { mutateAsync: o } = T({
732
+ onError: L(r, "Failed to start connection watch")
733
+ }), { mutateAsync: o } = A({
707
734
  mutationFn: async (l) => bt(e, l.id),
708
- onError: k(r, "Failed to stop connection watch")
709
- }), a = b.useCallback((l) => {
735
+ onError: L(r, "Failed to stop connection watch")
736
+ }), a = w.useCallback((l) => {
710
737
  const u = l.data;
711
738
  console.log("got update to connections", u), n.setQueryData(s, u);
712
739
  }, [n, s]);
713
- return b.useEffect(() => {
714
- const l = D(`${e}/connection/sync`, a);
740
+ return w.useEffect(() => {
741
+ const l = O(`${e}/connection/sync`, a);
715
742
  return () => {
716
743
  l();
717
744
  };
718
745
  }, [e, a]), {
719
- connections: O({
746
+ connections: T({
720
747
  queryKey: s,
721
748
  queryFn: async () => {
722
749
  try {
723
750
  return await vt(e);
724
751
  } catch (l) {
725
- console.log(l), k(r, "Failed to load connections")(l);
752
+ console.log(l), L(r, "Failed to load connections")(l);
726
753
  }
727
754
  return [];
728
755
  },
729
756
  staleTime: 3e4,
730
- placeholderData: Ue
757
+ placeholderData: We
731
758
  }),
732
759
  startWatch: i,
733
760
  stopWatch: o
@@ -738,7 +765,7 @@ const ns = ({ pluginID: t, connectionID: e }) => {
738
765
  /**
739
766
  * Get the connection
740
767
  */
741
- namespaces: O({
768
+ namespaces: T({
742
769
  queryKey: [n, "connection", "namespaces", e],
743
770
  queryFn: async () => Rt(n, e)
744
771
  })
@@ -790,143 +817,143 @@ function Ze(t, e) {
790
817
  }
791
818
  function os() {
792
819
  const [t, e] = G(/* @__PURE__ */ new Set()), [n, r] = G({}), [s, i] = G(/* @__PURE__ */ new Map()), o = q(/* @__PURE__ */ new Map()), [a, c] = G(/* @__PURE__ */ new Map());
793
- U(() => {
794
- const g = D("plugin/crash_recovery_failed", (R) => {
795
- const E = R.data, S = E == null ? void 0 : E.pluginID;
796
- S && c((w) => {
797
- const I = new Map(w);
798
- return I.set(S, E.error ?? "Crash recovery failed"), I;
820
+ $(() => {
821
+ const h = O("plugin/crash_recovery_failed", (R) => {
822
+ const C = R.data, E = C == null ? void 0 : C.pluginID;
823
+ E && c((b) => {
824
+ const I = new Map(b);
825
+ return I.set(E, C.error ?? "Crash recovery failed"), I;
799
826
  });
800
- }), v = D("plugin/recovered", (R) => {
801
- const E = R.data, S = E == null ? void 0 : E.pluginID;
802
- S && c((w) => {
803
- if (!w.has(S)) return w;
804
- const I = new Map(w);
805
- return I.delete(S), I;
827
+ }), v = O("plugin/recovered", (R) => {
828
+ const C = R.data, E = C == null ? void 0 : C.pluginID;
829
+ E && c((b) => {
830
+ if (!b.has(E)) return b;
831
+ const I = new Map(b);
832
+ return I.delete(E), I;
806
833
  });
807
834
  });
808
835
  return () => {
809
- g(), v();
836
+ h(), v();
810
837
  };
811
- }, []), U(() => {
812
- Ft().then((g) => {
813
- if (!g) return;
814
- const v = {}, R = /* @__PURE__ */ new Set(), E = /* @__PURE__ */ new Map();
815
- for (const [S, w] of Object.entries(g))
816
- if (w) {
817
- v[S] = w.map((I) => I.connection);
818
- for (const I of w) {
838
+ }, []), $(() => {
839
+ Ft().then((h) => {
840
+ if (!h) return;
841
+ const v = {}, R = /* @__PURE__ */ new Set(), C = /* @__PURE__ */ new Map();
842
+ for (const [E, b] of Object.entries(h))
843
+ if (b) {
844
+ v[E] = b.map((I) => I.connection);
845
+ for (const I of b) {
819
846
  if (!I.started) continue;
820
- const M = `${S}/${I.connection.id}`;
847
+ const M = `${E}/${I.connection.id}`;
821
848
  R.add(M);
822
849
  const N = {
823
- pluginID: S,
850
+ pluginID: E,
824
851
  connectionID: I.connection.id,
825
852
  states: {}
826
853
  };
827
854
  if (I.resources)
828
855
  for (const [ie, it] of Object.entries(I.resources))
829
856
  N.states[ie] = it;
830
- o.current.set(M, N), E.set(M, pe(N));
857
+ o.current.set(M, N), C.set(M, pe(N));
831
858
  }
832
859
  }
833
- r(v), e(R), i(E);
860
+ r(v), e(R), i(C);
834
861
  }).catch(() => {
835
862
  });
836
- }, []), U(() => D("connection/status", (v) => {
837
- const R = v.data, E = `${R.pluginID}/${R.connectionID}`;
838
- R.status === "DISCONNECTED" ? (e((S) => {
839
- const w = new Set(S);
840
- return w.delete(E), w;
841
- }), i((S) => {
842
- const w = new Map(S);
843
- return w.delete(E), w;
844
- }), o.current.delete(E)) : e((S) => {
845
- const w = new Set(S);
846
- return w.add(E), w;
847
- }), Pt().then((S) => {
848
- if (!S) return;
849
- const w = {};
850
- for (const [I, M] of Object.entries(S))
851
- M != null && (w[I] = M);
852
- r(w);
863
+ }, []), $(() => O("connection/status", (v) => {
864
+ const R = v.data, C = `${R.pluginID}/${R.connectionID}`;
865
+ R.status === "DISCONNECTED" ? (e((E) => {
866
+ const b = new Set(E);
867
+ return b.delete(C), b;
868
+ }), i((E) => {
869
+ const b = new Map(E);
870
+ return b.delete(C), b;
871
+ }), o.current.delete(C)) : e((E) => {
872
+ const b = new Set(E);
873
+ return b.add(C), b;
874
+ }), Pt().then((E) => {
875
+ if (!E) return;
876
+ const b = {};
877
+ for (const [I, M] of Object.entries(E))
878
+ M != null && (b[I] = M);
879
+ r(b);
853
880
  }).catch(() => {
854
881
  });
855
882
  }), []);
856
- const l = L((g) => {
857
- const v = g.data, R = he(v);
858
- e((w) => {
859
- if (w.has(R)) return w;
860
- const I = new Set(w);
883
+ const l = k((h) => {
884
+ const v = h.data, R = he(v);
885
+ e((b) => {
886
+ if (b.has(R)) return b;
887
+ const I = new Set(b);
861
888
  return I.add(R), I;
862
889
  });
863
- const E = Ze(o.current, v), S = pe(E);
864
- i((w) => {
865
- const I = new Map(w);
866
- return I.set(R, S), I;
890
+ const C = Ze(o.current, v), E = pe(C);
891
+ i((b) => {
892
+ const I = new Map(b);
893
+ return I.set(R, E), I;
867
894
  });
868
895
  }, []);
869
- U(() => D("watch/STATE", l), [l]);
870
- const u = L(async (g, v) => {
871
- await Pe(g, v);
872
- }, []), p = L(async (g, v) => {
873
- await Oe(g, v);
874
- }, []), f = L(async (g) => {
875
- const v = a.get(g);
896
+ $(() => O("watch/STATE", l), [l]);
897
+ const u = k(async (h, v) => {
898
+ await Pe(h, v);
899
+ }, []), f = k(async (h, v) => {
900
+ await Oe(h, v);
901
+ }, []), d = k(async (h) => {
902
+ const v = a.get(h);
876
903
  c((R) => {
877
- if (!R.has(g)) return R;
878
- const E = new Map(R);
879
- return E.delete(g), E;
904
+ if (!R.has(h)) return R;
905
+ const C = new Map(R);
906
+ return C.delete(h), C;
880
907
  });
881
908
  try {
882
- await It(g);
909
+ await It(h);
883
910
  } catch (R) {
884
- throw c((E) => {
885
- const S = new Map(E);
886
- return S.set(g, v ?? "Reload failed"), S;
911
+ throw c((C) => {
912
+ const E = new Map(C);
913
+ return E.set(h, v ?? "Reload failed"), E;
887
914
  }), R;
888
915
  }
889
- }, [a]), d = [];
890
- for (const g of t) {
891
- const [v, R] = g.split("/", 2), S = (n[v] ?? []).find((ie) => ie.id === R), w = s.get(g), I = w != null && !ne(w), M = w != null && w.errorCount > 0, N = a.get(v);
892
- d.push({
916
+ }, [a]), p = [];
917
+ for (const h of t) {
918
+ const [v, R] = h.split("/", 2), E = (n[v] ?? []).find((ie) => ie.id === R), b = s.get(h), I = b != null && !ne(b), M = b != null && b.errorCount > 0, N = a.get(v);
919
+ p.push({
893
920
  pluginID: v,
894
921
  connectionID: R,
895
- name: (S == null ? void 0 : S.name) ?? R,
896
- avatar: (S == null ? void 0 : S.avatar) ?? "",
922
+ name: (E == null ? void 0 : E.name) ?? R,
923
+ avatar: (E == null ? void 0 : E.avatar) ?? "",
897
924
  isStarted: !0,
898
- sync: w,
925
+ sync: b,
899
926
  isSyncing: I,
900
927
  hasErrors: M || N != null,
901
928
  pluginFailed: N != null,
902
929
  pluginError: N
903
930
  });
904
931
  }
905
- const y = /* @__PURE__ */ new Map();
906
- for (const g of d) {
907
- const v = y.get(g.pluginID) ?? [];
908
- v.push(g), y.set(g.pluginID, v);
932
+ const g = /* @__PURE__ */ new Map();
933
+ for (const h of p) {
934
+ const v = g.get(h.pluginID) ?? [];
935
+ v.push(h), g.set(h.pluginID, v);
909
936
  }
910
- const _ = Array.from(s.values()), C = d.filter((g) => g.isSyncing), h = d.filter((g) => g.hasErrors), m = d.filter((g) => g.pluginFailed);
937
+ const S = Array.from(s.values()), m = p.filter((h) => h.isSyncing), y = p.filter((h) => h.hasErrors), _ = p.filter((h) => h.pluginFailed);
911
938
  return {
912
- entries: d,
913
- grouped: y,
914
- connectedCount: d.length,
915
- syncingCount: C.length,
916
- errorCount: h.length,
917
- failedCount: m.length,
918
- hasSyncing: Ye(_),
919
- aggregateProgress: Je(_),
939
+ entries: p,
940
+ grouped: g,
941
+ connectedCount: p.length,
942
+ syncingCount: m.length,
943
+ errorCount: y.length,
944
+ failedCount: _.length,
945
+ hasSyncing: Ye(S),
946
+ aggregateProgress: Je(S),
920
947
  disconnect: u,
921
- retryWatch: p,
922
- retryPlugin: f
948
+ retryWatch: f,
949
+ retryPlugin: d
923
950
  };
924
951
  }
925
952
  function On(t, e) {
926
953
  return e === null ? t === null : Array.isArray(e) ? Array.isArray(t) : typeof e == "object" ? typeof t == "object" && t !== null && !Array.isArray(t) : typeof t == typeof e;
927
954
  }
928
955
  function is(t, e, n) {
929
- const r = P(t), s = j(), i = [r, "data", e], o = O({
956
+ const r = P(t), s = j(), i = [r, "data", e], o = T({
930
957
  queryKey: i,
931
958
  queryFn: async () => {
932
959
  const c = await Ot(r, e);
@@ -934,7 +961,7 @@ function is(t, e, n) {
934
961
  `[usePluginData] stored value for "${e}" has unexpected type (expected ${Array.isArray(n) ? "array" : typeof n}, got ${Array.isArray(c) ? "array" : typeof c}). Using default.`
935
962
  ), n);
936
963
  }
937
- }), a = T({
964
+ }), a = A({
938
965
  mutationFn: async (c) => {
939
966
  await Tt(r, e, c);
940
967
  },
@@ -970,7 +997,7 @@ const as = () => {
970
997
  }, cs = ({ pluginID: t }) => {
971
998
  const e = P(t), { showSnackbar: n } = W(), { createTab: r, updateTab: s } = Xe();
972
999
  return {
973
- createSession: T({
1000
+ createSession: A({
974
1001
  mutationFn: async ({ connectionID: o, icon: a, label: c, opts: l }) => {
975
1002
  const u = `pending-${crypto.randomUUID()}`;
976
1003
  r({
@@ -985,94 +1012,94 @@ const as = () => {
985
1012
  opts: { ...l }
986
1013
  }
987
1014
  });
988
- const p = sn.createFrom({
1015
+ const f = sn.createFrom({
989
1016
  command: ["/bin/bash"],
990
1017
  tty: !0,
991
1018
  ...l
992
1019
  });
993
1020
  try {
994
- const f = await At(e, o, p);
995
- if (!f) throw new Error("Failed to create session: null response");
1021
+ const d = await At(e, o, f);
1022
+ if (!d) throw new Error("Failed to create session: null response");
996
1023
  s(
997
1024
  { id: u },
998
1025
  {
999
- id: f.id,
1000
- title: c ?? `Session ${f.id.substring(0, 8)}`,
1026
+ id: d.id,
1027
+ title: c ?? `Session ${d.id.substring(0, 8)}`,
1001
1028
  properties: { status: "connected", pluginID: e, connectionID: o, opts: { ...l } }
1002
1029
  }
1003
1030
  );
1004
- } catch (f) {
1005
- const d = Q(f);
1031
+ } catch (d) {
1032
+ const p = Q(d);
1006
1033
  s(
1007
1034
  { id: u },
1008
1035
  {
1009
- properties: { status: "error", error: d.detail, pluginID: e, connectionID: o, opts: { ...l } }
1036
+ properties: { status: "error", error: p.detail, pluginID: e, connectionID: o, opts: { ...l } }
1010
1037
  }
1011
- ), z(n, f, "Failed to start session");
1038
+ ), z(n, d, "Failed to start session");
1012
1039
  }
1013
1040
  }
1014
1041
  }).mutateAsync
1015
1042
  };
1016
1043
  }, us = ({ pluginID: t }) => {
1017
- const e = P(t), { showSnackbar: n } = W(), { createTab: r } = Xe(), s = T({
1044
+ const e = P(t), { showSnackbar: n } = W(), { createTab: r } = Xe(), s = A({
1018
1045
  mutationFn: async ({
1019
1046
  connectionID: o,
1020
1047
  resourceKey: a,
1021
1048
  resourceID: c,
1022
1049
  resourceData: l,
1023
1050
  icon: u,
1024
- label: p,
1025
- target: f,
1026
- follow: d = !0,
1027
- tailLines: y = 1e3,
1028
- params: _
1051
+ label: f,
1052
+ target: d,
1053
+ follow: p = !0,
1054
+ tailLines: g = 1e3,
1055
+ params: S
1029
1056
  }) => {
1030
- const C = on.createFrom({
1057
+ const m = on.createFrom({
1031
1058
  resource_key: a,
1032
1059
  resource_id: c,
1033
1060
  resource_data: l,
1034
1061
  options: an.createFrom({
1035
- target: f ?? "",
1036
- follow: d,
1062
+ target: d ?? "",
1063
+ follow: p,
1037
1064
  include_previous: !1,
1038
1065
  include_timestamps: !0,
1039
- tail_lines: y,
1066
+ tail_lines: g,
1040
1067
  since_seconds: 0,
1041
1068
  limit_bytes: 0,
1042
1069
  include_source_events: !0,
1043
- params: _ ?? {}
1070
+ params: S ?? {}
1044
1071
  })
1045
- }), h = await xt(e, o, C);
1046
- if (!h) throw new Error("Failed to create log session: null response");
1072
+ }), y = await Dt(e, o, m);
1073
+ if (!y) throw new Error("Failed to create log session: null response");
1047
1074
  return r({
1048
- id: h.id,
1049
- title: p ?? `Logs ${h.id.substring(0, 8)}`,
1075
+ id: y.id,
1076
+ title: f ?? `Logs ${y.id.substring(0, 8)}`,
1050
1077
  variant: "logs",
1051
1078
  icon: u ?? "LuLogs"
1052
- }), h;
1079
+ }), y;
1053
1080
  },
1054
- onError: k(n, "Failed to start log session")
1055
- }), i = T({
1081
+ onError: L(n, "Failed to start log session")
1082
+ }), i = A({
1056
1083
  mutationFn: async (o) => {
1057
- await Dt(o);
1084
+ await xt(o);
1058
1085
  },
1059
- onError: k(n, "Failed to close log session")
1086
+ onError: L(n, "Failed to close log session")
1060
1087
  });
1061
1088
  return {
1062
1089
  createLogSession: s.mutateAsync,
1063
1090
  closeLogSession: i.mutateAsync
1064
1091
  };
1065
- }, ls = () => O({
1092
+ }, ls = () => T({
1066
1093
  queryKey: ["metric", "providers"],
1067
1094
  queryFn: Nt,
1068
1095
  staleTime: 3e4
1069
- }), Tn = (t) => O({
1096
+ }), Tn = (t) => T({
1070
1097
  queryKey: ["metric", "providers", t],
1071
1098
  queryFn: () => kt(t),
1072
1099
  enabled: !!t,
1073
1100
  staleTime: 3e4
1074
1101
  }), ds = (t) => {
1075
- var C, h;
1102
+ var m, y;
1076
1103
  const {
1077
1104
  connectionID: e,
1078
1105
  resourceKey: n,
@@ -1086,12 +1113,12 @@ const as = () => {
1086
1113
  refreshInterval: l = 0,
1087
1114
  enabled: u = !0
1088
1115
  } = t, {
1089
- data: p,
1090
- isLoading: f
1091
- } = Tn(n), d = p ?? [], y = c ? Math.max(
1116
+ data: f,
1117
+ isLoading: d
1118
+ } = Tn(n), p = f ?? [], g = c ? Math.max(
1092
1119
  Math.floor((c.end.getTime() - c.start.getTime()) / 250),
1093
1120
  15e3
1094
- ) * 1e6 : 0, _ = O({
1121
+ ) * 1e6 : 0, S = T({
1095
1122
  queryKey: [
1096
1123
  "metric",
1097
1124
  "query",
@@ -1101,11 +1128,11 @@ const as = () => {
1101
1128
  s,
1102
1129
  o,
1103
1130
  a,
1104
- (C = c == null ? void 0 : c.start) == null ? void 0 : C.getTime(),
1105
- (h = c == null ? void 0 : c.end) == null ? void 0 : h.getTime()
1131
+ (m = c == null ? void 0 : c.start) == null ? void 0 : m.getTime(),
1132
+ (y = c == null ? void 0 : c.end) == null ? void 0 : y.getTime()
1106
1133
  ],
1107
1134
  queryFn: async () => {
1108
- const m = await Lt(
1135
+ const _ = await Lt(
1109
1136
  e,
1110
1137
  n,
1111
1138
  r,
@@ -1115,25 +1142,25 @@ const as = () => {
1115
1142
  a,
1116
1143
  ((c == null ? void 0 : c.start) ?? /* @__PURE__ */ new Date(0)).toISOString(),
1117
1144
  ((c == null ? void 0 : c.end) ?? /* @__PURE__ */ new Date(0)).toISOString(),
1118
- y
1119
- ), g = {};
1120
- for (const [v, R] of Object.entries(m))
1121
- R != null && (g[v] = R);
1122
- return g;
1145
+ g
1146
+ ), h = {};
1147
+ for (const [v, R] of Object.entries(_))
1148
+ R != null && (h[v] = R);
1149
+ return h;
1123
1150
  },
1124
- enabled: u && !!e && !!n && (n.startsWith("cluster::") || !!r) && d.length > 0,
1151
+ enabled: u && !!e && !!n && (n.startsWith("cluster::") || !!r) && p.length > 0,
1125
1152
  refetchInterval: l > 0 ? l : void 0,
1126
1153
  staleTime: 5e3,
1127
1154
  // Keep previous data visible while fetching new data (e.g. on time range change)
1128
1155
  // to prevent the chart from blinking empty.
1129
- placeholderData: Ue
1156
+ placeholderData: We
1130
1157
  });
1131
1158
  return {
1132
- data: _.data ?? void 0,
1133
- providers: d,
1134
- isLoading: f || _.isLoading,
1135
- error: _.error,
1136
- refetch: _.refetch
1159
+ data: S.data ?? void 0,
1160
+ providers: p,
1161
+ isLoading: d || S.isLoading,
1162
+ error: S.error,
1163
+ refetch: S.refetch
1137
1164
  };
1138
1165
  }, fs = (t) => {
1139
1166
  const {
@@ -1146,10 +1173,10 @@ const as = () => {
1146
1173
  metricIDs: a = [],
1147
1174
  interval: c = 1e4,
1148
1175
  enabled: l = !0
1149
- } = t, u = P(e), [p, f] = G(null), [d, y] = G(null), [_, C] = G(!1), [h, m] = G(null), g = q(null), v = L(async () => {
1176
+ } = t, u = P(e), [f, d] = G(null), [p, g] = G(null), [S, m] = G(!1), [y, _] = G(null), h = q(null), v = k(async () => {
1150
1177
  if (!(!l || !u || !n || !r || !s))
1151
1178
  try {
1152
- const E = await Mt(u, n, {
1179
+ const C = await Mt(u, n, {
1153
1180
  resource_key: r,
1154
1181
  resource_id: s,
1155
1182
  resource_namespace: i,
@@ -1158,72 +1185,72 @@ const as = () => {
1158
1185
  interval: c * 1e6
1159
1186
  // ms to nanoseconds for Go time.Duration
1160
1187
  });
1161
- y(E), C(!0), m(null);
1162
- const S = D(`core/metrics/data/${E}`, (I) => {
1188
+ g(C), m(!0), _(null);
1189
+ const E = O(`core/metrics/data/${C}`, (I) => {
1163
1190
  const M = I.data;
1164
1191
  try {
1165
1192
  const N = JSON.parse(M);
1166
- N.results && f(N.results);
1193
+ N.results && d(N.results);
1167
1194
  } catch (N) {
1168
1195
  console.error("Failed to parse metric stream data:", N);
1169
1196
  }
1170
- }), w = D(`core/metrics/error/${E}`, (I) => {
1197
+ }), b = O(`core/metrics/error/${C}`, (I) => {
1171
1198
  const M = I.data;
1172
1199
  try {
1173
1200
  const N = JSON.parse(M);
1174
- m(N.error || "Unknown error");
1201
+ _(N.error || "Unknown error");
1175
1202
  } catch {
1176
- m("Failed to parse metric stream error");
1203
+ _("Failed to parse metric stream error");
1177
1204
  }
1178
1205
  });
1179
- g.current = () => {
1180
- S(), w();
1206
+ h.current = () => {
1207
+ E(), b();
1181
1208
  };
1182
- } catch (E) {
1183
- m(E instanceof Error ? E.message : String(E));
1209
+ } catch (C) {
1210
+ _(C instanceof Error ? C.message : String(C));
1184
1211
  }
1185
- }, [u, n, r, s, i, a, c, l]), R = L(async () => {
1186
- if (d)
1212
+ }, [u, n, r, s, i, a, c, l]), R = k(async () => {
1213
+ if (p)
1187
1214
  try {
1188
- await Ce(d);
1189
- } catch (E) {
1190
- console.error("Failed to unsubscribe:", E);
1215
+ await Ce(p);
1216
+ } catch (C) {
1217
+ console.error("Failed to unsubscribe:", C);
1191
1218
  }
1192
- g.current && (g.current(), g.current = null), y(null), C(!1);
1193
- }, [d]);
1194
- return U(() => () => {
1195
- d && Ce(d).catch(console.error), g.current && g.current();
1196
- }, [d]), {
1197
- data: p,
1198
- subscriptionID: d,
1199
- isStreaming: _,
1200
- error: h,
1219
+ h.current && (h.current(), h.current = null), g(null), m(!1);
1220
+ }, [p]);
1221
+ return $(() => () => {
1222
+ p && Ce(p).catch(console.error), h.current && h.current();
1223
+ }, [p]), {
1224
+ data: f,
1225
+ subscriptionID: p,
1226
+ isStreaming: S,
1227
+ error: y,
1201
1228
  start: v,
1202
1229
  stop: R
1203
1230
  };
1204
1231
  }, B = ["networker", "portforward", "all-sessions"];
1205
1232
  function ps() {
1206
- const { showSnackbar: t } = W(), e = j(), n = O({
1233
+ const { showSnackbar: t } = W(), e = j(), n = T({
1207
1234
  queryKey: [...B],
1208
- queryFn: async () => $t().catch((i) => {
1235
+ queryFn: async () => qt().catch((i) => {
1209
1236
  if (Q(i).detail.includes("not found")) return [];
1210
1237
  throw i;
1211
1238
  }),
1212
1239
  retry: !1
1213
1240
  });
1214
- U(() => {
1215
- const i = D("core/networker/portforward/created", () => {
1241
+ $(() => {
1242
+ const i = O("core/networker/portforward/created", () => {
1216
1243
  e.invalidateQueries({ queryKey: [...B] });
1217
- }), o = D("core/networker/portforward/closed", () => {
1244
+ }), o = O("core/networker/portforward/closed", () => {
1218
1245
  e.invalidateQueries({ queryKey: [...B] });
1219
1246
  });
1220
1247
  return () => {
1221
1248
  i(), o();
1222
1249
  };
1223
1250
  }, [e]);
1224
- const r = n.data ?? [], s = T({
1251
+ const r = n.data ?? [], s = A({
1225
1252
  mutationFn: async (i) => Te(i),
1226
- onError: k(t, "Failed to close port forwarding session"),
1253
+ onError: L(t, "Failed to close port forwarding session"),
1227
1254
  onSuccess: async () => {
1228
1255
  await e.invalidateQueries({ queryKey: [...B] });
1229
1256
  }
@@ -1232,23 +1259,23 @@ function ps() {
1232
1259
  sessions: n,
1233
1260
  activeSessions: r,
1234
1261
  closeSession: s.mutateAsync,
1235
- openInBrowser: (i) => We(`http://localhost:${i}`)
1262
+ openInBrowser: (i) => $e(`http://localhost:${i}`)
1236
1263
  };
1237
1264
  }
1238
- function ys({ pluginID: t, connectionID: e, resourceID: n }) {
1239
- const r = P(t), s = ["networker", "portforward", "sessions", r, e, n], { showSnackbar: i } = W(), o = j(), a = O({
1265
+ function gs({ pluginID: t, connectionID: e, resourceID: n }) {
1266
+ const r = P(t), s = ["networker", "portforward", "sessions", r, e, n], { showSnackbar: i } = W(), o = j(), a = T({
1240
1267
  queryKey: s,
1241
- queryFn: async () => qt(r, e, cn.createFrom({
1268
+ queryFn: async () => Ut(r, e, cn.createFrom({
1242
1269
  resource_id: n,
1243
1270
  connection_id: e
1244
1271
  })).catch((u) => {
1245
- const p = Q(u);
1246
- return p.detail.includes("not found") ? [] : (i({ message: "Failed to fetch port forward sessions", status: "error", details: p.detail }), []);
1272
+ const f = Q(u);
1273
+ return f.detail.includes("not found") ? [] : (i({ message: "Failed to fetch port forward sessions", status: "error", details: f.detail }), []);
1247
1274
  }),
1248
1275
  retry: !1
1249
- }), c = T({
1276
+ }), c = A({
1250
1277
  mutationFn: async ({ opts: u }) => {
1251
- const p = un.createFrom({
1278
+ const f = un.createFrom({
1252
1279
  local_port: u.localPort || 0,
1253
1280
  remote_port: u.remotePort,
1254
1281
  protocol: u.protocol || "TCP",
@@ -1262,20 +1289,20 @@ function ys({ pluginID: t, connectionID: e, resourceID: n }) {
1262
1289
  },
1263
1290
  labels: u.labels ?? {},
1264
1291
  params: u.parameters ?? {}
1265
- }), f = await Ut(r, e, p);
1266
- if (!f) throw new Error("Failed to start port forwarding: null response");
1267
- return u.openInBrowser && We(`http://localhost:${f.local_port}`), f;
1292
+ }), d = await $t(r, e, f);
1293
+ if (!d) throw new Error("Failed to start port forwarding: null response");
1294
+ return u.openInBrowser && $e(`http://localhost:${d.local_port}`), d;
1268
1295
  },
1269
- onError: k(i, "Failed to start port forwarding session"),
1296
+ onError: L(i, "Failed to start port forwarding session"),
1270
1297
  onSuccess: async () => {
1271
1298
  await Promise.all([
1272
1299
  o.invalidateQueries({ queryKey: s }),
1273
1300
  o.invalidateQueries({ queryKey: [...B] })
1274
1301
  ]);
1275
1302
  }
1276
- }), l = T({
1303
+ }), l = A({
1277
1304
  mutationFn: async ({ opts: u }) => Te(u.sessionID),
1278
- onError: k(i, "Failed to close port forwarding session"),
1305
+ onError: L(i, "Failed to close port forwarding session"),
1279
1306
  onSuccess: async () => {
1280
1307
  await Promise.all([
1281
1308
  o.invalidateQueries({ queryKey: s }),
@@ -1289,8 +1316,8 @@ function ys({ pluginID: t, connectionID: e, resourceID: n }) {
1289
1316
  close: l.mutateAsync
1290
1317
  };
1291
1318
  }
1292
- const gs = () => {
1293
- const t = b.useContext(_n);
1319
+ const ys = () => {
1320
+ const t = w.useContext(_n);
1294
1321
  if (!t) throw new Error("useConfirmationModal must be used within a ConfirmationModalProvider");
1295
1322
  return t;
1296
1323
  }, hs = ({
@@ -1300,33 +1327,33 @@ const gs = () => {
1300
1327
  resourceID: r,
1301
1328
  namespace: s = ""
1302
1329
  }) => {
1303
- const i = P(t), o = j(), { showSnackbar: a } = W(), c = ["RESOURCE", i, e, n, r, s], { mutateAsync: l } = T({
1304
- mutationFn: async (f) => Ae(i, e, n, ke.createFrom({
1305
- input: f.input,
1330
+ const i = P(t), o = j(), { showSnackbar: a } = W(), c = ["RESOURCE", i, e, n, r, s], { mutateAsync: l } = A({
1331
+ mutationFn: async (d) => Ae(i, e, n, ke.createFrom({
1332
+ input: d.input,
1306
1333
  id: r,
1307
1334
  namespace: s
1308
1335
  })),
1309
1336
  onSuccess: async () => {
1310
1337
  a(`Resource ${r} updated`, "success"), await o.invalidateQueries({ queryKey: c });
1311
1338
  },
1312
- onError: k(a, `Failed to update resource ${r}`)
1313
- }), { mutateAsync: u } = T({
1314
- mutationFn: async (f = {}) => xe(i, e, n, Le.createFrom({
1339
+ onError: L(a, `Failed to update resource ${r}`)
1340
+ }), { mutateAsync: u } = A({
1341
+ mutationFn: async (d = {}) => De(i, e, n, Le.createFrom({
1315
1342
  id: r,
1316
1343
  namespace: s,
1317
- gracePeriodSeconds: f.gracePeriodSeconds
1344
+ gracePeriodSeconds: d.gracePeriodSeconds
1318
1345
  })),
1319
1346
  onSuccess: async () => {
1320
1347
  a(`Resource ${r} deleted`, "success"), await o.invalidateQueries({ queryKey: c });
1321
1348
  },
1322
- onError: k(a, `Failed to delete resource ${r}`)
1349
+ onError: L(a, `Failed to delete resource ${r}`)
1323
1350
  });
1324
1351
  return {
1325
1352
  /**
1326
1353
  * Fetch result for the resource. The client will automatically cache the result, and update the cache
1327
1354
  * when the resource is updated or deleted via the returned update and remove mutation functions.
1328
1355
  */
1329
- resource: O({
1356
+ resource: T({
1330
1357
  queryKey: c,
1331
1358
  queryFn: async () => Wt(i, e, n, ln.createFrom({
1332
1359
  id: r,
@@ -1356,7 +1383,7 @@ const gs = () => {
1356
1383
  * Fetch result for the resource. The client will automatically cache the result, and update the cache
1357
1384
  * when the resource is updated or deleted via the returned update and remove mutation functions.
1358
1385
  */
1359
- component: O({
1386
+ component: T({
1360
1387
  queryKey: e,
1361
1388
  queryFn: async () => Gt(t)
1362
1389
  })
@@ -1367,7 +1394,7 @@ const gs = () => {
1367
1394
  /**
1368
1395
  * The resource groups for the given plugin and connection.
1369
1396
  */
1370
- groups: O({
1397
+ groups: T({
1371
1398
  queryKey: [n, "resource_groups", "list"],
1372
1399
  queryFn: async () => jt(n, e),
1373
1400
  retry: !1
@@ -1382,7 +1409,7 @@ const gs = () => {
1382
1409
  return dn({
1383
1410
  queries: n.map((o) => ({
1384
1411
  queryKey: s(o),
1385
- queryFn: async () => De(r, e, o.key, Me.createFrom({
1412
+ queryFn: async () => xe(r, e, o.key, Me.createFrom({
1386
1413
  order: [{ field: "name", descending: !1 }],
1387
1414
  pagination: { page: 1, pageSize: 200 },
1388
1415
  namespaces: o.namespaces
@@ -1396,7 +1423,7 @@ const gs = () => {
1396
1423
  /**
1397
1424
  * The current settings from the provider.
1398
1425
  */
1399
- resourceType: O({
1426
+ resourceType: T({
1400
1427
  queryKey: [n, "resources", e],
1401
1428
  queryFn: async () => Qt(n, e),
1402
1429
  retry: !1
@@ -1408,7 +1435,7 @@ const gs = () => {
1408
1435
  /**
1409
1436
  * The resource types for the given plugin and connection.
1410
1437
  */
1411
- types: O({
1438
+ types: T({
1412
1439
  queryKey: [n, "resources", "list", e],
1413
1440
  queryFn: async () => Kt(n, e),
1414
1441
  retry: !1
@@ -1419,7 +1446,7 @@ var ee = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
1419
1446
  function An(t) {
1420
1447
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
1421
1448
  }
1422
- var xn = "Expected a function", Ve = "__lodash_hash_undefined__", Dn = "[object Function]", Nn = "[object GeneratorFunction]", kn = "[object Symbol]", Ln = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Mn = /^\w*$/, $n = /^\./, qn = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, Un = /[\\^$.*+?()[\]{}|]/g, Wn = /\\(\\)?/g, Gn = /^\[object .+?Constructor\]$/, jn = typeof ee == "object" && ee && ee.Object === Object && ee, Qn = typeof self == "object" && self && self.Object === Object && self, me = jn || Qn || Function("return this")();
1449
+ var Dn = "Expected a function", Ve = "__lodash_hash_undefined__", xn = "[object Function]", Nn = "[object GeneratorFunction]", kn = "[object Symbol]", Ln = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Mn = /^\w*$/, qn = /^\./, Un = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, $n = /[\\^$.*+?()[\]{}|]/g, Wn = /\\(\\)?/g, Gn = /^\[object .+?Constructor\]$/, jn = typeof ee == "object" && ee && ee.Object === Object && ee, Qn = typeof self == "object" && self && self.Object === Object && self, me = jn || Qn || Function("return this")();
1423
1450
  function Kn(t, e) {
1424
1451
  return t == null ? void 0 : t[e];
1425
1452
  }
@@ -1436,7 +1463,7 @@ var Bn = Array.prototype, zn = Function.prototype, et = Object.prototype, le = m
1436
1463
  var t = /[^.]+$/.exec(le && le.keys && le.keys.IE_PROTO || "");
1437
1464
  return t ? "Symbol(src)_1." + t : "";
1438
1465
  }(), tt = zn.toString, Se = et.hasOwnProperty, nt = et.toString, Yn = RegExp(
1439
- "^" + tt.call(Se).replace(Un, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
1466
+ "^" + tt.call(Se).replace($n, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
1440
1467
  ), Re = me.Symbol, Jn = Bn.splice, Zn = rt(me, "Map"), Z = rt(Object, "create"), Fe = Re ? Re.prototype : void 0, Ie = Fe ? Fe.toString : void 0;
1441
1468
  function K(t) {
1442
1469
  var e = -1, n = t ? t.length : 0;
@@ -1548,13 +1575,13 @@ function pr(t, e) {
1548
1575
  t = t[wr(e[n++])];
1549
1576
  return n && n == r ? t : void 0;
1550
1577
  }
1551
- function yr(t) {
1578
+ function gr(t) {
1552
1579
  if (!ot(t) || _r(t))
1553
1580
  return !1;
1554
1581
  var e = vr(t) || Hn(t) ? Yn : Gn;
1555
1582
  return e.test(Cr(t));
1556
1583
  }
1557
- function gr(t) {
1584
+ function yr(t) {
1558
1585
  if (typeof t == "string")
1559
1586
  return t;
1560
1587
  if (Ee(t))
@@ -1571,7 +1598,7 @@ function oe(t, e) {
1571
1598
  }
1572
1599
  function rt(t, e) {
1573
1600
  var n = Kn(t, e);
1574
- return yr(n) ? n : void 0;
1601
+ return gr(n) ? n : void 0;
1575
1602
  }
1576
1603
  function mr(t, e) {
1577
1604
  if (st(t))
@@ -1589,7 +1616,7 @@ function _r(t) {
1589
1616
  var Er = _e(function(t) {
1590
1617
  t = Fr(t);
1591
1618
  var e = [];
1592
- return $n.test(t) && e.push(""), t.replace(qn, function(n, r, s, i) {
1619
+ return qn.test(t) && e.push(""), t.replace(Un, function(n, r, s, i) {
1593
1620
  e.push(s ? i.replace(Wn, "$1") : r || n);
1594
1621
  }), e;
1595
1622
  });
@@ -1614,7 +1641,7 @@ function Cr(t) {
1614
1641
  }
1615
1642
  function _e(t, e) {
1616
1643
  if (typeof t != "function" || e && typeof e != "function")
1617
- throw new TypeError(xn);
1644
+ throw new TypeError(Dn);
1618
1645
  var n = function() {
1619
1646
  var r = arguments, s = e ? e.apply(this, r) : r[0], i = n.cache;
1620
1647
  if (i.has(s))
@@ -1631,7 +1658,7 @@ function br(t, e) {
1631
1658
  var st = Array.isArray;
1632
1659
  function vr(t) {
1633
1660
  var e = ot(t) ? nt.call(t) : "";
1634
- return e == Dn || e == Nn;
1661
+ return e == xn || e == Nn;
1635
1662
  }
1636
1663
  function ot(t) {
1637
1664
  var e = typeof t;
@@ -1644,7 +1671,7 @@ function Ee(t) {
1644
1671
  return typeof t == "symbol" || Rr(t) && nt.call(t) == kn;
1645
1672
  }
1646
1673
  function Fr(t) {
1647
- return t == null ? "" : gr(t);
1674
+ return t == null ? "" : yr(t);
1648
1675
  }
1649
1676
  function Ir(t, e, n) {
1650
1677
  var r = t == null ? void 0 : pr(t, e);
@@ -1678,28 +1705,28 @@ function Or(t, e, n) {
1678
1705
  function Tr(t, e, n, r, s, i) {
1679
1706
  const o = (i == null ? void 0 : i.syncWindowMs) ?? 500, a = q([]), c = q(null), l = q(null), u = q(s);
1680
1707
  u.current = s;
1681
- const p = L(() => {
1682
- const d = a.current;
1683
- if (a.current = [], c.current = null, l.current = null, !(d.length === 0 || !r)) {
1708
+ const f = k(() => {
1709
+ const p = a.current;
1710
+ if (a.current = [], c.current = null, l.current = null, !(p.length === 0 || !r)) {
1684
1711
  t.setQueryData(
1685
1712
  e,
1686
- (y) => Or(y, d, r)
1713
+ (g) => Or(g, p, r)
1687
1714
  );
1688
- for (const y of d)
1689
- (y.type === "ADD" || y.type === "UPDATE") && t.setQueryData(
1690
- n(y.payload.id, y.payload.namespace),
1691
- { result: y.payload.data }
1715
+ for (const g of p)
1716
+ (g.type === "ADD" || g.type === "UPDATE") && t.setQueryData(
1717
+ n(g.payload.id, g.payload.namespace),
1718
+ { result: g.payload.data }
1692
1719
  );
1693
1720
  }
1694
- }, [t, e, n, r]), f = L(
1695
- (d) => {
1696
- a.current.push(d), !(c.current !== null || l.current !== null) && (u.current === 1 ? c.current = setTimeout(p, o) : l.current = requestAnimationFrame(p));
1721
+ }, [t, e, n, r]), d = k(
1722
+ (p) => {
1723
+ a.current.push(p), !(c.current !== null || l.current !== null) && (u.current === 1 ? c.current = setTimeout(f, o) : l.current = requestAnimationFrame(f));
1697
1724
  },
1698
- [p, o]
1725
+ [f, o]
1699
1726
  );
1700
- return U(() => () => {
1727
+ return $(() => () => {
1701
1728
  c.current !== null && (clearTimeout(c.current), c.current = null), l.current !== null && (cancelAnimationFrame(l.current), l.current = null);
1702
- }, []), f;
1729
+ }, []), d;
1703
1730
  }
1704
1731
  const Cs = ({
1705
1732
  pluginID: t,
@@ -1708,93 +1735,93 @@ const Cs = ({
1708
1735
  idAccessor: r,
1709
1736
  namespaces: s
1710
1737
  }) => {
1711
- const i = P(t), o = j(), { showSnackbar: a } = W(), c = b.useMemo(() => s ?? [], [s]), l = b.useMemo(
1738
+ const i = P(t), o = j(), { showSnackbar: a } = W(), c = w.useMemo(() => s ?? [], [s]), l = w.useMemo(
1712
1739
  () => [i, e, n, c, "list"],
1713
1740
  [i, e, n, c]
1714
- ), u = b.useCallback(
1715
- (C, h) => [i, e, n, h, C],
1741
+ ), u = w.useCallback(
1742
+ (m, y) => [i, e, n, y, m],
1716
1743
  [i, e, n]
1717
- ), { mutateAsync: p } = T({
1718
- mutationFn: async (C) => Ne(i, e, n, $e.createFrom({
1719
- input: C.input,
1720
- namespace: C.namespace ?? (c.length === 1 ? c[0] : "")
1744
+ ), { mutateAsync: f } = A({
1745
+ mutationFn: async (m) => Ne(i, e, n, qe.createFrom({
1746
+ input: m.input,
1747
+ namespace: m.namespace ?? (c.length === 1 ? c[0] : "")
1721
1748
  })),
1722
- onSuccess: async (C) => {
1749
+ onSuccess: async (m) => {
1723
1750
  var v;
1724
- const h = C == null ? void 0 : C.result;
1725
- let m = "";
1726
- (v = h == null ? void 0 : h.metadata) != null && v.name ? m = h.metadata.name : h != null && h.id ? m = h.id : h != null && h.name ? m = h.name : h != null && h.ID ? m = h.ID : h != null && h.Name && (m = h.Name);
1727
- const g = m ? `Resource ${m} created` : "Resource created";
1728
- a(g, "success"), await o.invalidateQueries({ queryKey: l });
1751
+ const y = m == null ? void 0 : m.result;
1752
+ let _ = "";
1753
+ (v = y == null ? void 0 : y.metadata) != null && v.name ? _ = y.metadata.name : y != null && y.id ? _ = y.id : y != null && y.name ? _ = y.name : y != null && y.ID ? _ = y.ID : y != null && y.Name && (_ = y.Name);
1754
+ const h = _ ? `Resource ${_} created` : "Resource created";
1755
+ a(h, "success"), await o.invalidateQueries({ queryKey: l });
1729
1756
  },
1730
- onError: k(a, "Failed to create resource")
1731
- }), f = O({
1757
+ onError: L(a, "Failed to create resource")
1758
+ }), d = T({
1732
1759
  queryKey: l,
1733
- queryFn: async () => De(i, e, n, Me.createFrom({
1760
+ queryFn: async () => xe(i, e, n, Me.createFrom({
1734
1761
  order: [{ field: "name", descending: !1 }],
1735
1762
  pagination: { page: 1, pageSize: 200 },
1736
1763
  namespaces: c
1737
1764
  })),
1738
- placeholderData: (C, h) => C,
1765
+ placeholderData: (m, y) => m,
1739
1766
  retry: !1
1740
- }), [d, y] = b.useState(
1767
+ }), [p, g] = w.useState(
1741
1768
  F.WatchStateIdle
1742
1769
  );
1743
- b.useEffect(() => D(
1770
+ w.useEffect(() => O(
1744
1771
  `${i}/${e}/watch/STATE`,
1745
- (h) => {
1746
- const m = h.data;
1747
- m.resourceKey === n && y(m.state);
1772
+ (y) => {
1773
+ const _ = y.data;
1774
+ _.resourceKey === n && g(_.state);
1748
1775
  }
1749
1776
  ), [i, e, n]);
1750
- const _ = Tr(o, l, u, r, d);
1751
- return b.useEffect(() => {
1777
+ const S = Tr(o, l, u, r, p);
1778
+ return w.useEffect(() => {
1752
1779
  if (!r)
1753
1780
  return;
1754
1781
  Ht(i, e, n);
1755
- const C = D(
1782
+ const m = O(
1756
1783
  `${i}/${e}/${n}/ADD`,
1757
- (g) => _({ type: "ADD", payload: g.data })
1758
- ), h = D(
1784
+ (h) => S({ type: "ADD", payload: h.data })
1785
+ ), y = O(
1759
1786
  `${i}/${e}/${n}/UPDATE`,
1760
- (g) => _({ type: "UPDATE", payload: g.data })
1761
- ), m = D(
1787
+ (h) => S({ type: "UPDATE", payload: h.data })
1788
+ ), _ = O(
1762
1789
  `${i}/${e}/${n}/DELETE`,
1763
- (g) => _({ type: "DELETE", payload: g.data })
1790
+ (h) => S({ type: "DELETE", payload: h.data })
1764
1791
  );
1765
1792
  return () => {
1766
- C(), h(), m(), Bt(i, e, n);
1793
+ m(), y(), _(), Bt(i, e, n);
1767
1794
  };
1768
- }, [i, e, n, _]), {
1795
+ }, [i, e, n, S]), {
1769
1796
  /**
1770
1797
  * Fetch result for the resource. The client will automatically cache the result, and update the cache
1771
1798
  * when the resources are updated or deleted via the returned create and remove mutation functions, or
1772
1799
  * the per-resource hook mutation functions.
1773
1800
  */
1774
- resources: f,
1801
+ resources: d,
1775
1802
  /**
1776
1803
  * Create a new resource. A set of optional parameters can be passed to customize the create behavior,
1777
1804
  * which if specified, will add additional default behavior set via the hook options.
1778
1805
  *
1779
1806
  * @params opts Optional parameters to pass to the resource create operation
1780
1807
  */
1781
- create: p,
1808
+ create: f,
1782
1809
  /** Current watch state for this resource type */
1783
- watchState: d,
1810
+ watchState: p,
1784
1811
  /** Whether the watch is currently syncing */
1785
- isSyncing: d === F.WatchStateSyncing,
1812
+ isSyncing: p === F.WatchStateSyncing,
1786
1813
  /** Whether the watch has fully synced */
1787
- isSynced: d === F.WatchStateSynced,
1814
+ isSynced: p === F.WatchStateSynced,
1788
1815
  /** Whether the watch encountered an error */
1789
- watchError: d === F.WatchStateError
1816
+ watchError: p === F.WatchStateError
1790
1817
  };
1791
1818
  }, bs = ({ pluginID: t }) => {
1792
- const e = P(t), { showSnackbar: n } = W(), r = T({
1819
+ const e = P(t), { showSnackbar: n } = W(), r = A({
1793
1820
  mutationFn: async ({ opts: o, input: a }) => Ne(
1794
1821
  e,
1795
1822
  o.connectionID,
1796
1823
  o.resourceKey,
1797
- $e.createFrom({
1824
+ qe.createFrom({
1798
1825
  input: a.input,
1799
1826
  namespace: a.namespace ?? o.namespace ?? ""
1800
1827
  })
@@ -1805,7 +1832,7 @@ const Cs = ({
1805
1832
  onError(o, { opts: a }) {
1806
1833
  z(n, o, `Failed to create resource ${a.resourceID}`);
1807
1834
  }
1808
- }), s = T({
1835
+ }), s = A({
1809
1836
  mutationFn: async ({ opts: o, input: a }) => Ae(
1810
1837
  e,
1811
1838
  o.connectionID,
@@ -1822,8 +1849,8 @@ const Cs = ({
1822
1849
  onError(o, { opts: a }) {
1823
1850
  z(n, o, `Failed to update resource ${a.resourceID}`);
1824
1851
  }
1825
- }), i = T({
1826
- mutationFn: async ({ opts: o, input: a }) => xe(
1852
+ }), i = A({
1853
+ mutationFn: async ({ opts: o, input: a }) => De(
1827
1854
  e,
1828
1855
  o.connectionID,
1829
1856
  o.resourceKey,
@@ -1851,7 +1878,7 @@ const Cs = ({
1851
1878
  resourceKey: n,
1852
1879
  enabled: r = !0
1853
1880
  }) => {
1854
- const s = P(t), i = O({
1881
+ const s = P(t), i = T({
1855
1882
  queryKey: ["RESOURCE_ACTIONS", s, e, n],
1856
1883
  queryFn: () => zt(s, e, n),
1857
1884
  enabled: r && !!s && !!e && !!n,
@@ -1868,13 +1895,13 @@ const Cs = ({
1868
1895
  connectionID: e,
1869
1896
  resourceKey: n
1870
1897
  }) => {
1871
- const r = P(t), s = j(), { showSnackbar: i } = W(), o = T({
1898
+ const r = P(t), s = j(), { showSnackbar: i } = W(), o = A({
1872
1899
  mutationFn: async ({ actionID: a, id: c = "", namespace: l = "", params: u = {} }) => Yt(
1873
1900
  r,
1874
1901
  e,
1875
1902
  n,
1876
1903
  a,
1877
- qe.createFrom({ id: c, namespace: l, params: u })
1904
+ Ue.createFrom({ id: c, namespace: l, params: u })
1878
1905
  ),
1879
1906
  onSuccess: (a) => {
1880
1907
  a != null && a.message && i(a.message, "success"), s.invalidateQueries({
@@ -1895,7 +1922,7 @@ const Cs = ({
1895
1922
  connectionID: e,
1896
1923
  enabled: n = !0
1897
1924
  }) => {
1898
- const r = P(t), s = O({
1925
+ const r = P(t), s = T({
1899
1926
  queryKey: ["EDITOR_SCHEMAS", r, e],
1900
1927
  queryFn: () => Jt(r, e),
1901
1928
  enabled: n && !!r && !!e,
@@ -1914,103 +1941,103 @@ const Cs = ({
1914
1941
  connectionID: e,
1915
1942
  enabled: n = !0
1916
1943
  }) => {
1917
- const r = P(t), s = j(), i = [r, e, "watch-state"], o = q([]), a = q(!1), c = L((f) => {
1918
- s.setQueryData(i, (d) => {
1919
- if (!d) return d;
1920
- const y = { ...d.resources, [f.resourceKey]: f.state }, _ = { ...d.resourceCounts, [f.resourceKey]: f.resourceCount };
1921
- let C = 0, h = 0;
1922
- for (const m of Object.values(y))
1923
- m === F.WatchStateSynced && C++, (m === F.WatchStateError || m === F.WatchStateFailed) && h++;
1924
- return { ...d, resources: y, resourceCounts: _, totalResources: Object.keys(y).length, syncedCount: C, errorCount: h };
1944
+ const r = P(t), s = j(), i = [r, e, "watch-state"], o = q([]), a = q(!1), c = k((d) => {
1945
+ s.setQueryData(i, (p) => {
1946
+ if (!p) return p;
1947
+ const g = { ...p.resources, [d.resourceKey]: d.state }, S = { ...p.resourceCounts, [d.resourceKey]: d.resourceCount };
1948
+ let m = 0, y = 0;
1949
+ for (const _ of Object.values(g))
1950
+ _ === F.WatchStateSynced && m++, (_ === F.WatchStateError || _ === F.WatchStateFailed) && y++;
1951
+ return { ...p, resources: g, resourceCounts: S, totalResources: Object.keys(g).length, syncedCount: m, errorCount: y };
1925
1952
  });
1926
- }, [s, r, e]), l = O({
1953
+ }, [s, r, e]), l = T({
1927
1954
  queryKey: i,
1928
1955
  queryFn: async () => {
1929
- const f = await Zt(r, e);
1930
- if (!f) throw new Error("Failed to get watch state: null response");
1931
- const d = {};
1932
- let y = 0, _ = 0;
1933
- for (const [h, m] of Object.entries(f.resources ?? {}))
1934
- m != null && (d[h] = m, m === F.WatchStateSynced && y++, m === F.WatchStateError && _++);
1935
- const C = {};
1936
- for (const [h, m] of Object.entries(f.resourceCounts ?? {}))
1937
- m != null && (C[h] = m);
1956
+ const d = await Zt(r, e);
1957
+ if (!d) throw new Error("Failed to get watch state: null response");
1958
+ const p = {};
1959
+ let g = 0, S = 0;
1960
+ for (const [y, _] of Object.entries(d.resources ?? {}))
1961
+ _ != null && (p[y] = _, _ === F.WatchStateSynced && g++, _ === F.WatchStateError && S++);
1962
+ const m = {};
1963
+ for (const [y, _] of Object.entries(d.resourceCounts ?? {}))
1964
+ _ != null && (m[y] = _);
1938
1965
  return {
1939
- connection: f.connectionId,
1940
- resources: d,
1941
- resourceCounts: C,
1942
- totalResources: Object.keys(d).length,
1943
- syncedCount: y,
1944
- errorCount: _
1966
+ connection: d.connectionId,
1967
+ resources: p,
1968
+ resourceCounts: m,
1969
+ totalResources: Object.keys(p).length,
1970
+ syncedCount: g,
1971
+ errorCount: S
1945
1972
  };
1946
1973
  },
1947
1974
  enabled: n && !!r && !!e,
1948
- refetchInterval: (f) => {
1949
- const d = f.state.data;
1950
- if (!d || d.totalResources === 0) return 3e3;
1951
- let y = 0;
1952
- for (const _ of Object.values(d.resources))
1953
- (_ === F.WatchStateSynced || _ === F.WatchStateError || _ === F.WatchStateStopped || _ === F.WatchStateFailed || _ === F.WatchStateForbidden || _ === F.WatchStateSkipped) && y++;
1954
- return y >= d.totalResources ? !1 : 3e3;
1975
+ refetchInterval: (d) => {
1976
+ const p = d.state.data;
1977
+ if (!p || p.totalResources === 0) return 3e3;
1978
+ let g = 0;
1979
+ for (const S of Object.values(p.resources))
1980
+ (S === F.WatchStateSynced || S === F.WatchStateError || S === F.WatchStateStopped || S === F.WatchStateFailed || S === F.WatchStateForbidden || S === F.WatchStateSkipped) && g++;
1981
+ return g >= p.totalResources ? !1 : 3e3;
1955
1982
  }
1956
1983
  });
1957
- U(() => {
1984
+ $(() => {
1958
1985
  if (!l.data || a.current) return;
1959
1986
  a.current = !0;
1960
- const f = o.current;
1987
+ const d = o.current;
1961
1988
  o.current = [];
1962
- for (const d of f)
1963
- c(d);
1964
- }, [l.data, c]), U(() => {
1989
+ for (const p of d)
1990
+ c(p);
1991
+ }, [l.data, c]), $(() => {
1965
1992
  if (!n || !r || !e)
1966
1993
  return;
1967
1994
  a.current = !1, o.current = [];
1968
- const f = D(
1995
+ const d = O(
1969
1996
  `${r}/${e}/watch/STATE`,
1970
- (d) => {
1971
- const y = d.data;
1972
- a.current ? c(y) : o.current.push(y);
1997
+ (p) => {
1998
+ const g = p.data;
1999
+ a.current ? c(g) : o.current.push(g);
1973
2000
  }
1974
2001
  );
1975
2002
  return () => {
1976
- f(), a.current = !1, o.current = [];
2003
+ d(), a.current = !1, o.current = [];
1977
2004
  };
1978
2005
  }, [r, e, n, c]);
1979
2006
  const u = l.data;
1980
- let p = 0;
2007
+ let f = 0;
1981
2008
  if (u != null && u.resources)
1982
- for (const f of Object.values(u.resources))
1983
- (f === F.WatchStateSynced || f === F.WatchStateError || f === F.WatchStateStopped || f === F.WatchStateFailed || f === F.WatchStateForbidden || f === F.WatchStateSkipped) && p++;
2009
+ for (const d of Object.values(u.resources))
2010
+ (d === F.WatchStateSynced || d === F.WatchStateError || d === F.WatchStateStopped || d === F.WatchStateFailed || d === F.WatchStateForbidden || d === F.WatchStateSkipped) && f++;
1984
2011
  return {
1985
2012
  /** Full summary query result */
1986
2013
  summary: l,
1987
2014
  /** Get the state of a specific resource type's watch */
1988
- getResourceState: (f) => u == null ? void 0 : u.resources[f],
2015
+ getResourceState: (d) => u == null ? void 0 : u.resources[d],
1989
2016
  /** Whether all registered watches have reached a terminal state */
1990
- isFullySynced: u ? u.totalResources > 0 && p === u.totalResources : !1,
2017
+ isFullySynced: u ? u.totalResources > 0 && f === u.totalResources : !1,
1991
2018
  /** Sync progress as a 0-1 fraction (terminal states / total) */
1992
- syncProgress: u && u.totalResources > 0 ? p / u.totalResources : 0,
2019
+ syncProgress: u && u.totalResources > 0 ? f / u.totalResources : 0,
1993
2020
  /** Number of watches that encountered errors */
1994
2021
  errorCount: (u == null ? void 0 : u.errorCount) ?? 0
1995
2022
  };
1996
2023
  }, Ps = () => {
1997
- const [t, e] = G(/* @__PURE__ */ new Map()), n = q(/* @__PURE__ */ new Map()), r = q(/* @__PURE__ */ new Map()), s = L((l) => {
1998
- const u = l.data, p = he(u), f = Ze(n.current, u), d = pe(f);
1999
- if (e((y) => {
2000
- const _ = new Map(y);
2001
- return _.set(p, d), _;
2002
- }), r.current.has(p) && (clearTimeout(r.current.get(p)), r.current.delete(p)), ne(d)) {
2003
- const y = setTimeout(() => {
2004
- e((_) => {
2005
- const C = new Map(_);
2006
- return C.delete(p), C;
2007
- }), n.current.delete(p), r.current.delete(p);
2024
+ const [t, e] = G(/* @__PURE__ */ new Map()), n = q(/* @__PURE__ */ new Map()), r = q(/* @__PURE__ */ new Map()), s = k((l) => {
2025
+ const u = l.data, f = he(u), d = Ze(n.current, u), p = pe(d);
2026
+ if (e((g) => {
2027
+ const S = new Map(g);
2028
+ return S.set(f, p), S;
2029
+ }), r.current.has(f) && (clearTimeout(r.current.get(f)), r.current.delete(f)), ne(p)) {
2030
+ const g = setTimeout(() => {
2031
+ e((S) => {
2032
+ const m = new Map(S);
2033
+ return m.delete(f), m;
2034
+ }), n.current.delete(f), r.current.delete(f);
2008
2035
  }, 5e3);
2009
- r.current.set(p, y);
2036
+ r.current.set(f, g);
2010
2037
  }
2011
2038
  }, []);
2012
- U(() => {
2013
- const l = D("watch/STATE", s);
2039
+ $(() => {
2040
+ const l = O("watch/STATE", s);
2014
2041
  return () => {
2015
2042
  l();
2016
2043
  for (const u of r.current.values())
@@ -2029,7 +2056,7 @@ const Cs = ({
2029
2056
  aggregateProgress: c
2030
2057
  };
2031
2058
  }, Ar = () => {
2032
- const t = b.useContext(Ke);
2059
+ const t = w.useContext(Ke);
2033
2060
  if (!t) throw new Error("useOperations must be used within an OperationsProvider");
2034
2061
  return t;
2035
2062
  }, Os = ({
@@ -2037,78 +2064,78 @@ const Cs = ({
2037
2064
  connectionID: e,
2038
2065
  resourceKey: n
2039
2066
  }) => {
2040
- const r = P(t), { showSnackbar: s } = W(), { addOperation: i, updateOperation: o } = Ar(), a = b.useRef([]);
2041
- return b.useEffect(() => () => {
2067
+ const r = P(t), { showSnackbar: s } = W(), { addOperation: i, updateOperation: o } = Ar(), a = w.useRef([]);
2068
+ return w.useEffect(() => () => {
2042
2069
  a.current.forEach((l) => l());
2043
- }, []), { startStreamAction: b.useCallback(
2044
- async ({ actionID: l, id: u, namespace: p, label: f, params: d = {} }) => {
2070
+ }, []), { startStreamAction: w.useCallback(
2071
+ async ({ actionID: l, id: u, namespace: f, label: d, params: p = {} }) => {
2045
2072
  try {
2046
- const y = await Xt(
2073
+ const g = await Xt(
2047
2074
  r,
2048
2075
  e,
2049
2076
  n,
2050
2077
  l,
2051
- qe.createFrom({ id: u, namespace: p, params: d })
2078
+ Ue.createFrom({ id: u, namespace: f, params: p })
2052
2079
  );
2053
2080
  i({
2054
- id: y,
2055
- label: f,
2081
+ id: g,
2082
+ label: d,
2056
2083
  resourceKey: n,
2057
2084
  resourceName: u,
2058
- namespace: p,
2085
+ namespace: f,
2059
2086
  connectionID: e,
2060
2087
  status: "running",
2061
2088
  startedAt: Date.now()
2062
2089
  });
2063
- const _ = `action/stream/${y}`, C = D(_, (h) => {
2064
- var g, v, R, E;
2065
- const m = h.data;
2066
- switch (m.type) {
2090
+ const S = `action/stream/${g}`, m = O(S, (y) => {
2091
+ var h, v, R, C;
2092
+ const _ = y.data;
2093
+ switch (_.type) {
2067
2094
  case "progress": {
2068
- const S = m.data ?? {};
2069
- o(y, {
2070
- message: S.message,
2071
- progress: S.ready !== void 0 && S.desired !== void 0 ? { ready: S.ready, desired: S.desired } : void 0
2095
+ const E = _.data ?? {};
2096
+ o(g, {
2097
+ message: E.message,
2098
+ progress: E.ready !== void 0 && E.desired !== void 0 ? { ready: E.ready, desired: E.desired } : void 0
2072
2099
  });
2073
2100
  break;
2074
2101
  }
2075
2102
  case "complete":
2076
- o(y, {
2103
+ o(g, {
2077
2104
  status: "completed",
2078
- message: ((g = m.data) == null ? void 0 : g.message) ?? "Completed",
2105
+ message: ((h = _.data) == null ? void 0 : h.message) ?? "Completed",
2079
2106
  completedAt: Date.now()
2080
- }), s(((v = m.data) == null ? void 0 : v.message) ?? f + " completed", "success"), ae(_);
2107
+ }), s(((v = _.data) == null ? void 0 : v.message) ?? d + " completed", "success"), ae(S);
2081
2108
  break;
2082
2109
  case "error":
2083
- o(y, {
2110
+ o(g, {
2084
2111
  status: "error",
2085
- message: ((R = m.data) == null ? void 0 : R.message) ?? "Failed",
2112
+ message: ((R = _.data) == null ? void 0 : R.message) ?? "Failed",
2086
2113
  completedAt: Date.now()
2087
- }), s(((E = m.data) == null ? void 0 : E.message) ?? f + " failed", "error"), ae(_);
2114
+ }), s(((C = _.data) == null ? void 0 : C.message) ?? d + " failed", "error"), ae(S);
2088
2115
  break;
2089
2116
  }
2090
2117
  });
2091
2118
  return a.current.push(() => {
2092
- C(), ae(_);
2093
- }), y;
2094
- } catch (y) {
2095
- throw z(s, y, `Failed to start "${l}"`), y;
2119
+ m(), ae(S);
2120
+ }), g;
2121
+ } catch (g) {
2122
+ throw z(s, g, `Failed to start "${l}"`), g;
2096
2123
  }
2097
2124
  },
2098
2125
  [r, e, n, i, o, s]
2099
2126
  ) };
2100
2127
  };
2101
- function xr(t, e) {
2128
+ function Dr(t, e) {
2102
2129
  return `${t}/${e}/graph/CHANGED`;
2103
2130
  }
2104
2131
  function we(t, e, n, r) {
2105
2132
  const s = j(), i = q(n);
2106
2133
  i.current = n;
2107
2134
  const o = JSON.stringify(n);
2108
- U(() => {
2135
+ $(() => {
2109
2136
  if (!r || !t || !e)
2110
2137
  return;
2111
- const a = D(xr(t, e), () => {
2138
+ const a = O(Dr(t, e), () => {
2112
2139
  s.invalidateQueries({ queryKey: i.current, exact: !0 });
2113
2140
  });
2114
2141
  return () => {
@@ -2116,7 +2143,7 @@ function we(t, e, n, r) {
2116
2143
  };
2117
2144
  }, [s, t, e, o, r]);
2118
2145
  }
2119
- const Dr = {
2146
+ const xr = {
2120
2147
  owns: { outgoing: "Owns", incoming: "Owned by" },
2121
2148
  runs_on: { outgoing: "Runs on", incoming: "Running here" },
2122
2149
  uses: { outgoing: "Uses", incoming: "Used by" },
@@ -2126,7 +2153,7 @@ const Dr = {
2126
2153
  selects: { outgoing: "Selects", incoming: "Selected by" }
2127
2154
  };
2128
2155
  function Ts(t, e) {
2129
- const n = Dr[t];
2156
+ const n = xr[t];
2130
2157
  if (n)
2131
2158
  return n[e];
2132
2159
  const r = t.replace(/_/g, " ");
@@ -2157,31 +2184,31 @@ const As = ({
2157
2184
  enabled: a = !0,
2158
2185
  refetchInterval: c = !1
2159
2186
  }) => {
2160
- const l = P(t), u = ["RESOURCE_RELATED", l, e, n, s, r, i, o ?? null], p = a && !!l && !!e && !!n && !!r;
2161
- we(l, e, u, p);
2162
- const f = O({
2187
+ const l = P(t), u = ["RESOURCE_RELATED", l, e, n, s, r, i, o ?? null], f = a && !!l && !!e && !!n && !!r;
2188
+ we(l, e, u, f);
2189
+ const d = T({
2163
2190
  queryKey: u,
2164
2191
  queryFn: async () => Vt(l, e, n, s, r, i, o ?? null),
2165
- enabled: p,
2192
+ enabled: f,
2166
2193
  refetchInterval: c
2167
- }), d = {
2194
+ }), p = {
2168
2195
  pluginId: l,
2169
2196
  connectionId: e,
2170
2197
  resourceKey: n,
2171
2198
  id: r,
2172
2199
  namespace: s
2173
- }, y = f.data ?? [];
2200
+ }, g = d.data ?? [];
2174
2201
  return {
2175
2202
  /** One entry per edge, from the viewed resource's side. */
2176
- related: kr(d, y),
2203
+ related: kr(p, g),
2177
2204
  /** The raw graph edges. */
2178
- edges: y,
2179
- isLoading: f.isLoading,
2180
- isFetching: f.isFetching,
2181
- error: f.error,
2182
- refetch: f.refetch
2205
+ edges: g,
2206
+ isLoading: d.isLoading,
2207
+ isFetching: d.isFetching,
2208
+ error: d.error,
2209
+ refetch: d.refetch
2183
2210
  };
2184
- }, xs = ({
2211
+ }, Ds = ({
2185
2212
  pluginID: t,
2186
2213
  connectionID: e,
2187
2214
  resourceKey: n,
@@ -2193,20 +2220,20 @@ const As = ({
2193
2220
  }) => {
2194
2221
  const c = P(t), l = ["RESOURCE_DEPENDENCY_TREE", c, e, n, s, r, i], u = o && !!c && !!e && !!n && !!r;
2195
2222
  we(c, e, l, u);
2196
- const p = O({
2223
+ const f = T({
2197
2224
  queryKey: l,
2198
2225
  queryFn: async () => en(c, e, n, s, r, i),
2199
2226
  enabled: u,
2200
2227
  refetchInterval: a
2201
2228
  });
2202
2229
  return {
2203
- tree: p.data ?? null,
2204
- isLoading: p.isLoading,
2205
- isFetching: p.isFetching,
2206
- error: p.error,
2207
- refetch: p.refetch
2230
+ tree: f.data ?? null,
2231
+ isLoading: f.isLoading,
2232
+ isFetching: f.isFetching,
2233
+ error: f.error,
2234
+ refetch: f.refetch
2208
2235
  };
2209
- }, Ds = ({
2236
+ }, xs = ({
2210
2237
  pluginID: t,
2211
2238
  connectionID: e,
2212
2239
  resourceKey: n,
@@ -2218,33 +2245,33 @@ const As = ({
2218
2245
  }) => {
2219
2246
  const c = P(t), l = ["RESOURCE_GRAPH", c, e, n, s, r, i, o], u = a && !!c && !!e && !!n && !!r;
2220
2247
  we(c, e, l, u);
2221
- const p = O({
2248
+ const f = T({
2222
2249
  queryKey: l,
2223
2250
  queryFn: async () => tn(c, e, n, s, r, i, o),
2224
2251
  enabled: u
2225
2252
  });
2226
2253
  return {
2227
- graph: p.data ?? null,
2228
- isLoading: p.isLoading,
2229
- isFetching: p.isFetching,
2230
- error: p.error,
2231
- refetch: p.refetch
2254
+ graph: f.data ?? null,
2255
+ isLoading: f.isLoading,
2256
+ isFetching: f.isFetching,
2257
+ error: f.error,
2258
+ refetch: f.refetch
2232
2259
  };
2233
2260
  }, Ns = () => {
2234
- const t = b.useContext(Qe);
2261
+ const t = w.useContext(Qe);
2235
2262
  if (!t)
2236
2263
  throw new Error("useSettings must be used within a SettingsProvider");
2237
2264
  return t;
2238
2265
  }, ks = ({ to: t, withinContext: e, ...n }) => {
2239
- const { pluginId: r } = ge();
2266
+ const { pluginId: r } = ye();
2240
2267
  r || console.error("Link used outside of a plugin context");
2241
2268
  const s = `/_plugin/${r}${t.startsWith("/") ? "" : "/"}${t}`;
2242
- return b.useMemo(() => /* @__PURE__ */ x(dt, { style: { textDecoration: "none", color: "inherit" }, ...n, to: s }), [n, s]);
2269
+ return w.useMemo(() => /* @__PURE__ */ x(dt, { style: { textDecoration: "none", color: "inherit" }, ...n, to: s }), [n, s]);
2243
2270
  };
2244
2271
  function Ls() {
2245
- const t = ft(), e = pt(), { pluginId: n } = ge();
2272
+ const t = ft(), e = pt(), { pluginId: n } = ye();
2246
2273
  n || console.error("usePluginRouter used outside of a plugin context");
2247
- const r = `/_plugin/${n}`, s = e.pathname.startsWith(r) ? e.pathname.slice(r.length) || "/" : e.pathname, i = L((o, a) => {
2274
+ const r = `/_plugin/${n}`, s = e.pathname.startsWith(r) ? e.pathname.slice(r.length) || "/" : e.pathname, i = k((o, a) => {
2248
2275
  const { ...c } = a ?? {};
2249
2276
  o.startsWith("/") ? t(`${r}${o}`, c) : t(o, c);
2250
2277
  }, [t, r]);
@@ -2256,13 +2283,13 @@ function Ls() {
2256
2283
  }
2257
2284
  class Ms {
2258
2285
  }
2259
- class $s {
2286
+ class qs {
2260
2287
  constructor() {
2261
- A(this, "_extensions");
2288
+ D(this, "_extensions");
2262
2289
  /**
2263
2290
  * The root component to render for the application window.
2264
2291
  */
2265
- A(this, "root");
2292
+ D(this, "root");
2266
2293
  /**
2267
2294
  * Various pages to render under the root component. These can be navigated to using
2268
2295
  * the built-in navigation system both programatically and through Links.
@@ -2292,8 +2319,8 @@ class $s {
2292
2319
  * ```
2293
2320
  *
2294
2321
  */
2295
- A(this, "pages");
2296
- A(this, "_routes");
2322
+ D(this, "pages");
2323
+ D(this, "_routes");
2297
2324
  }
2298
2325
  get extensions() {
2299
2326
  return this._extensions || [];
@@ -2316,8 +2343,8 @@ class $s {
2316
2343
  get Window() {
2317
2344
  if (!this._routes && this.root)
2318
2345
  return /* @__PURE__ */ x(this.root, {});
2319
- const e = yt(this._routes || []);
2320
- return /* @__PURE__ */ x(gt, { router: e });
2346
+ const e = gt(this._routes || []);
2347
+ return /* @__PURE__ */ x(yt, { router: e });
2321
2348
  }
2322
2349
  /**
2323
2350
  * Register extension points for other plugins to extend the functionality
@@ -2350,56 +2377,56 @@ class $s {
2350
2377
  }
2351
2378
  }
2352
2379
  var Lr = /* @__PURE__ */ ((t) => (t.MISSING_MANIFEST = "MISSING_MANIFEST", t.MISSING_PLUGIN = "MISSING_PLUGIN", t.MISSING_ENTRYPOINT = "MISSING_ENTRYPOINT", t))(Lr || {});
2353
- const qs = (t) => {
2380
+ const Us = (t) => {
2354
2381
  const e = t.split("::");
2355
2382
  return e.length === 1 ? { group: "core", version: "", kind: e[0] } : {
2356
2383
  group: e[0] || "core",
2357
2384
  version: e[1] || "",
2358
2385
  kind: e[2] || e[0]
2359
2386
  };
2360
- }, Us = (t) => !t || t === "core" ? "Core" : t.charAt(0).toUpperCase() + t.slice(1);
2387
+ }, $s = (t) => !t || t === "core" ? "Core" : t.charAt(0).toUpperCase() + t.slice(1);
2361
2388
  export {
2362
2389
  B as ALL_SESSIONS_KEY,
2363
2390
  mn as BottomDrawerContext,
2364
2391
  _n as ConfirmationModalContext,
2365
- $ as ErrorTypes,
2392
+ U as ErrorTypes,
2366
2393
  es as ExtensionPointRegistry,
2367
2394
  Fn as ExtensionPointStore,
2368
2395
  Vr as ExtensionProvider,
2369
2396
  ks as Link,
2370
2397
  Ke as OperationsContext,
2371
2398
  Zr as OperationsProvider,
2372
- ye as PluginContext,
2399
+ ge as PluginContext,
2373
2400
  zr as PluginContextProvider,
2374
2401
  Lr as PluginErrorCode,
2375
- $s as PluginWindow,
2402
+ qs as PluginWindow,
2376
2403
  Ms as PluginWindowRootProps,
2377
2404
  Sn as RightDrawerContext,
2378
2405
  Qe as SettingsContext,
2379
2406
  Jr as SettingsProvider,
2380
2407
  ts as SnackbarProvider,
2381
2408
  F as WatchState,
2382
- gn as actionToSnackbar,
2409
+ yn as actionToSnackbar,
2383
2410
  Or as applyBatch,
2384
2411
  Pn as connectionListQueryKey,
2385
- k as createErrorHandler,
2412
+ L as createErrorHandler,
2386
2413
  hn as defaultState,
2387
- Us as formatGroup,
2388
- xr as graphChangedEvent,
2414
+ $s as formatGroup,
2415
+ Dr as graphChangedEvent,
2389
2416
  Ge as isCancelledError,
2390
2417
  Q as parseAppError,
2391
- qs as parseResourceKey,
2418
+ Us as parseResourceKey,
2392
2419
  Ts as relationshipLabel,
2393
2420
  z as showAppError,
2394
2421
  kr as toRelatedResources,
2395
2422
  Ps as useActiveSyncs,
2396
2423
  Xe as useBottomDrawer,
2397
- gs as useConfirmationModal,
2424
+ ys as useConfirmationModal,
2398
2425
  ns as useConnection,
2399
2426
  ss as useConnectionNamespaces,
2400
2427
  os as useConnectionStatus,
2401
2428
  rs as useConnections,
2402
- xs as useDependencyTree,
2429
+ Ds as useDependencyTree,
2403
2430
  Fs as useEditorSchemas,
2404
2431
  Tr as useEventBatcher,
2405
2432
  cs as useExec,
@@ -2411,7 +2438,7 @@ export {
2411
2438
  Tn as useMetricProvidersForResource,
2412
2439
  fs as useMetricStream,
2413
2440
  Ar as useOperations,
2414
- ge as usePluginContext,
2441
+ ye as usePluginContext,
2415
2442
  is as usePluginData,
2416
2443
  Ls as usePluginRouter,
2417
2444
  Yr as usePluginSettings,
@@ -2422,11 +2449,11 @@ export {
2422
2449
  hs as useResource,
2423
2450
  vs as useResourceActions,
2424
2451
  ms as useResourceAreaComponent,
2425
- Ds as useResourceGraph,
2452
+ xs as useResourceGraph,
2426
2453
  Ss as useResourceGroups,
2427
2454
  ds as useResourceMetrics,
2428
2455
  bs as useResourceMutations,
2429
- ys as useResourcePortForwarder,
2456
+ gs as useResourcePortForwarder,
2430
2457
  _s as useResourceSearch,
2431
2458
  Es as useResourceType,
2432
2459
  ws as useResourceTypes,