@omniviewdev/runtime 0.27.0 → 0.27.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.
@@ -0,0 +1,858 @@
1
+ import { B as ie, N as v, M as P, A as f, a as g } from "./index-zyAgCXOO.js";
2
+ import { a as Q, H as se, b as ce, c as ae, P as ue, D as le, V as fe, R as pe, A as he, C as ge, d as de, e as ye, f as $e, g as Se, L as me, h as Te, i as be, Q as we, j as ve, k as Pe, I as Ge } from "./models-BwT6PfKo.js";
3
+ import { B as r, a as y, O as q } from "./events-CgnLM6iV.js";
4
+ function d(e, t = []) {
5
+ let u = 0;
6
+ for (const s of t) {
7
+ if (s.length > 65536) throw new RangeError("Request routing byte limit");
8
+ u += new TextEncoder().encode(JSON.stringify(s)).length + 1;
9
+ }
10
+ if (u > 57344) throw new RangeError("Request routing byte limit");
11
+ let w = 0, G = 2, b = 0, $ = 0;
12
+ const m = [], p = (s) => {
13
+ for (let l = 0; l < s.length; l++) {
14
+ const c = s.charCodeAt(l);
15
+ let S = c < 128 ? 1 : c < 2048 ? 2 : 3;
16
+ if (c >= 55296 && c <= 56319) {
17
+ const C = s.charCodeAt(++l);
18
+ if (!(C >= 56320 && C <= 57343)) throw new TypeError("Invalid Unicode");
19
+ S = 4;
20
+ } else if (c >= 56320 && c <= 57343) throw new TypeError("Invalid Unicode");
21
+ if (w += S, G += c === 34 || c === 92 ? 2 : S, w > 33554432 || G > 67043328) throw new RangeError("Request JSON byte limit");
22
+ }
23
+ m.push(s);
24
+ }, h = (s) => {
25
+ if (s.length > 33554432) throw new RangeError("Request JSON byte limit");
26
+ for (let l = 0; l < s.length; l++) {
27
+ const c = s.charCodeAt(l);
28
+ if (c >= 55296 && c <= 56319) {
29
+ const S = s.charCodeAt(++l);
30
+ if (!(S >= 56320 && S <= 57343)) throw new TypeError("Invalid Unicode");
31
+ } else if (c >= 56320 && c <= 57343) throw new TypeError("Invalid Unicode");
32
+ }
33
+ p(JSON.stringify(s));
34
+ }, a = (s, l) => {
35
+ if (++b > 262144 || l > 64) throw new RangeError("Request JSON structural limit");
36
+ if (s === null) {
37
+ p("null");
38
+ return;
39
+ }
40
+ if (typeof s == "string") {
41
+ h(s);
42
+ return;
43
+ }
44
+ if (typeof s == "boolean") {
45
+ p(s ? "true" : "false");
46
+ return;
47
+ }
48
+ if (typeof s == "number") {
49
+ if (!Number.isFinite(s)) throw new TypeError("Request numbers must be finite");
50
+ p(Object.is(s, -0) ? "-0" : JSON.stringify(s));
51
+ return;
52
+ }
53
+ if (Array.isArray(s)) {
54
+ p("[");
55
+ for (let c = 0; c < s.length; c++) {
56
+ if (++$ > 1048576) throw new RangeError("Request JSON field limit");
57
+ c && p(","), a(s[c], l + 1);
58
+ }
59
+ p("]");
60
+ return;
61
+ }
62
+ if (typeof s == "object") {
63
+ p("{");
64
+ let c = !0;
65
+ for (const [S, C] of Object.entries(s))
66
+ if (C !== void 0) {
67
+ if (++$ > 1048576) throw new RangeError("Request JSON field limit");
68
+ c || p(","), c = !1, h(S), p(":"), a(C, l + 1);
69
+ }
70
+ p("}");
71
+ return;
72
+ }
73
+ throw new TypeError("Unsupported request JSON value");
74
+ };
75
+ return a(e, 0), m.join("");
76
+ }
77
+ function Re(e) {
78
+ return r(93318075, e).then((t) => (t[0] = F(t[0]), t[1] = ie(t[1]), t));
79
+ }
80
+ function Ce(e) {
81
+ return r(1353297556, e);
82
+ }
83
+ function Fe(e) {
84
+ return r(4182196712, e).then((t) => F(t));
85
+ }
86
+ function _e(e) {
87
+ return r(3993344525, e).then((t) => F(t));
88
+ }
89
+ function Oe(e, t) {
90
+ return r(1779192716, e, t).then((n) => Je(n));
91
+ }
92
+ function Ee() {
93
+ return r(4033362541).then((e) => Be(e));
94
+ }
95
+ function Ae() {
96
+ return r(3434119522);
97
+ }
98
+ function Le(e) {
99
+ return r(2619212338, e).then((t) => X(t));
100
+ }
101
+ function Ne(e) {
102
+ return r(1371268636, e).then((t) => F(t));
103
+ }
104
+ function je(e) {
105
+ return r(3881019319, e);
106
+ }
107
+ function Me() {
108
+ return r(3006426324).then((e) => ze(e));
109
+ }
110
+ function ke() {
111
+ return r(265791345).then((e) => xe(e));
112
+ }
113
+ function He(e, t, n) {
114
+ return r(1492965384, e, t, n);
115
+ }
116
+ function De(e, t) {
117
+ return r(486465741, e, t);
118
+ }
119
+ const Ve = Q.createFrom, F = v(Ve), W = se.createFrom, Je = v(W), X = P(g, W), Be = P(g, X), ze = f(g), xe = f(F);
120
+ function qe(e, t, n) {
121
+ return y("github.com/omniviewdev/omniview/backend/pkg/plugin/exec.ServiceWrapper.CreateSession", e, t, d(n, [e, t])).then((o) => o === null ? null : Q.createFrom(o));
122
+ }
123
+ function Ue(e, t, n) {
124
+ return y("github.com/omniviewdev/omniview/backend/pkg/plugin/exec.ServiceWrapper.OpenNativeSession", e, t, d(n, [e, t]));
125
+ }
126
+ const so = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
127
+ __proto__: null,
128
+ AttachSession: Re,
129
+ CloseSession: Ce,
130
+ CreateSession: qe,
131
+ CreateTerminal: Fe,
132
+ DetachSession: _e,
133
+ GetHandler: Oe,
134
+ GetHandlers: Ee,
135
+ GetNativeTerminalSupport: Ae,
136
+ GetPluginHandlers: Le,
137
+ GetSession: Ne,
138
+ HasPlugin: je,
139
+ ListPlugins: Me,
140
+ ListSessions: ke,
141
+ OpenNativeSession: Ue,
142
+ ResizeSession: He,
143
+ WriteSession: De
144
+ }, Symbol.toStringTag, { value: "Module" }));
145
+ function Ie(e) {
146
+ return r(182596922, e).then((t) => j(t));
147
+ }
148
+ function Qe(e, t, n) {
149
+ return r(981100722, e, t, n).then((o) => M(o));
150
+ }
151
+ function We(e) {
152
+ return r(2157304970, e).then((t) => j(t));
153
+ }
154
+ function Xe(e) {
155
+ return r(650882, e).then((t) => K(t));
156
+ }
157
+ function Ke(e) {
158
+ return r(3624690437, e);
159
+ }
160
+ function Ye() {
161
+ return r(2195697754).then((e) => M(e));
162
+ }
163
+ function Ze() {
164
+ return r(167463150).then((e) => K(e));
165
+ }
166
+ function et(e, t) {
167
+ return r(2090415403, e, t).then((n) => M(n));
168
+ }
169
+ const tt = ce.createFrom, j = v(tt), M = f(j), K = f(g);
170
+ function nt(e, t, n) {
171
+ return y("github.com/omniviewdev/omniview/backend/pkg/plugin/networker.ServiceWrapper.StartResourcePortForwardingSession", e, t, d(n, [e, t]));
172
+ }
173
+ const co = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
174
+ __proto__: null,
175
+ ClosePortForwardSession: Ie,
176
+ FindPortForwardSessions: Qe,
177
+ GetPortForwardSession: We,
178
+ GetSupportedPortForwardTargets: Xe,
179
+ HasPlugin: Ke,
180
+ ListAllPortForwardSessions: Ye,
181
+ ListPlugins: Ze,
182
+ ListPortForwardSessions: et,
183
+ StartResourcePortForwardingSession: nt
184
+ }, Symbol.toStringTag, { value: "Module" }));
185
+ class k {
186
+ pluginID;
187
+ running;
188
+ url;
189
+ error;
190
+ supported;
191
+ pid;
192
+ /** Creates a new PluginProfilingStatus instance. */
193
+ constructor(t = {}) {
194
+ "pluginID" in t || (this.pluginID = ""), "running" in t || (this.running = !1), "url" in t || (this.url = ""), "error" in t || (this.error = ""), "supported" in t || (this.supported = !1), "pid" in t || (this.pid = 0), Object.assign(this, t);
195
+ }
196
+ /**
197
+ * Creates a new PluginProfilingStatus instance from a string or object.
198
+ */
199
+ static createFrom(t = {}) {
200
+ let n = typeof t == "string" ? JSON.parse(t) : t;
201
+ return new k(n);
202
+ }
203
+ }
204
+ function rt(e) {
205
+ return r(3150413499, e).then((t) => T(t));
206
+ }
207
+ function ot(e) {
208
+ return r(1152913314, e).then((t) => Ct(t));
209
+ }
210
+ function it(e) {
211
+ return r(111194374, e).then((t) => H(t));
212
+ }
213
+ function st() {
214
+ return r(1083754477).then((e) => _t(e));
215
+ }
216
+ function ct(e) {
217
+ return r(3945933305, e);
218
+ }
219
+ function at(e) {
220
+ return r(2859775056, e).then((t) => Y(t));
221
+ }
222
+ function ut(e, t) {
223
+ return r(2209599792, e, t).then((n) => At(n));
224
+ }
225
+ function lt(e) {
226
+ return r(3963363730, e).then((t) => Y(t));
227
+ }
228
+ function ft(e) {
229
+ return r(1357029266, e).then((t) => T(t));
230
+ }
231
+ function pt() {
232
+ return r(2477486666).then((e) => E(e));
233
+ }
234
+ function ht() {
235
+ return r(976517756).then((e) => E(e));
236
+ }
237
+ function gt(e) {
238
+ return r(1020548995, e).then((t) => E(t));
239
+ }
240
+ function dt(e, t) {
241
+ return r(2004740384, e, t).then((n) => E(n));
242
+ }
243
+ function yt() {
244
+ return r(873697101).then((e) => Z(e));
245
+ }
246
+ function $t() {
247
+ return r(637134283).then((e) => Nt(e));
248
+ }
249
+ function St() {
250
+ return r(550607756).then((e) => jt(e));
251
+ }
252
+ function mt(e, t) {
253
+ return r(288660195, e, t).then((n) => T(n));
254
+ }
255
+ function Tt(e) {
256
+ return r(1771013494, e).then((t) => T(t));
257
+ }
258
+ function bt(e) {
259
+ return r(2433379724, e).then((t) => T(t));
260
+ }
261
+ function wt(e, t, n) {
262
+ return r(2783597264, e, t, n).then((o) => Z(o));
263
+ }
264
+ function vt(e, t) {
265
+ return r(2179374748, e, t).then((n) => T(n));
266
+ }
267
+ function Pt(e) {
268
+ return r(1369550929, e).then((t) => T(t));
269
+ }
270
+ function Gt(e) {
271
+ return r(3828800061, e).then((t) => T(t));
272
+ }
273
+ const T = ae.createFrom, Rt = le.createFrom, Ct = v(Rt), H = ue.createFrom, Ft = k.createFrom, _t = f(Ft), Ot = fe.createFrom, Y = f(Ot), Et = pe.createFrom, At = f(Et), E = v(H), Lt = he.createFrom, Z = f(Lt), Nt = f(H), jt = f(T), ao = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
274
+ __proto__: null,
275
+ GetPlugin: rt,
276
+ GetPluginDownloadStats: ot,
277
+ GetPluginMeta: it,
278
+ GetPluginProfilingStatuses: st,
279
+ GetPluginReadme: ct,
280
+ GetPluginReleaseHistory: at,
281
+ GetPluginReviews: ut,
282
+ GetPluginVersions: lt,
283
+ InstallDevPluginFromPath: ft,
284
+ InstallFromPathPrompt: pt,
285
+ InstallInDevMode: ht,
286
+ InstallPluginFromPath: gt,
287
+ InstallPluginVersion: dt,
288
+ ListAvailablePlugins: yt,
289
+ ListPluginMetas: $t,
290
+ ListPlugins: St,
291
+ LoadPlugin: mt,
292
+ ReloadPlugin: Tt,
293
+ RetryFailedPlugin: bt,
294
+ SearchPlugins: wt,
295
+ SetPluginEnabled: vt,
296
+ UninstallPlugin: Pt,
297
+ UnlinkDevPlugin: Gt
298
+ }, Symbol.toStringTag, { value: "Module" }));
299
+ function Mt(e, t) {
300
+ return r(1688967279, e, t).then((n) => ee(n));
301
+ }
302
+ function kt(e, t) {
303
+ return r(950535743, e, t).then((n) => D(n));
304
+ }
305
+ function Ht(e) {
306
+ return r(854008408, e);
307
+ }
308
+ function Dt() {
309
+ return r(1598984489).then((e) => qt(e));
310
+ }
311
+ function Vt(e) {
312
+ return r(1775572154, e).then((t) => V(t));
313
+ }
314
+ function Jt() {
315
+ return r(3217612415).then((e) => Ut(e));
316
+ }
317
+ function Bt(e) {
318
+ return r(2037329938, e).then((t) => V(t));
319
+ }
320
+ function zt(e, t) {
321
+ return r(3276991559, e, t).then((n) => ee(n));
322
+ }
323
+ function xt(e, t) {
324
+ return r(794258089, e, t).then((n) => D(n));
325
+ }
326
+ const ee = ge.createFrom, D = de.createFrom, V = f(D), qt = P(g, V), Ut = f(g), It = "github.com/omniviewdev/omniview/backend/pkg/plugin/resource.ServiceWrapper";
327
+ function i(e, ...t) {
328
+ return y(`${It}.${e}`, ...t);
329
+ }
330
+ const Qt = (e) => i("Features", e), Wt = (e, t) => i("GetConnectionMetadata", e, t), Xt = (e, t) => i("RefreshConnectionMetadata", e, t), Kt = (e, t) => i("Catalog", e, t), Yt = (e, t) => i("Get", e, t), Zt = (e, t) => i("Enumerate", e, t), en = (e, t) => i("NativeQuery", e, d(t, [e])), tn = (e, t) => i("Mutate", e, d(t, [e])), nn = (e, t) => i("Action", e, d(t, [e])), rn = (e, t) => i("ResolveTarget", e, t), on = (e, t) => i("ResolveReference", e, t), sn = (e, t, n) => i("GetSchemaDocument", e, t, n), cn = () => i("GetAllConnectionStates"), an = (e) => i("ListConnectionProfiles", e), un = (e, t, n) => i("SaveConnectionProfile", e, d(t, [e]), n ?? null), ln = (e, t) => i("ImportConnectionProfile", e, t), fn = (e, t) => i("ResetConnectionProfile", e, t), pn = (e, t) => i("RemoveConnection", e, t), hn = (e, t) => i("GetResourceGroups", e, t), gn = (e, t, n) => i("GetResourceDefinition", e, t, n), dn = (e, t) => i("GetSchemaFields", e, t), yn = (e, t) => i("GetEditorSchemas", e, t), $n = (e, t, n) => i("GetEditorSchemaDocument", e, t, n), Sn = (e, t, n) => i("GetRelationships", e, t, n), mn = (e, t) => i("ResolveRelationships", e, t), Tn = (e, t, n) => i("GetHealth", e, d({
331
+ request: t,
332
+ body: n
333
+ }, [e])), bn = (e, t, n) => i("GetResourceEvents", e, t, n), wn = (e, t, n) => i("GetActions", e, t, n), vn = (e, t) => i("StreamAction", e, d(t, [e])), Pn = (e) => i("AttachStreamAction", e), Gn = (e) => i("CancelStreamAction", e), Rn = (e, t) => i("OpenSourceView", e, t), Cn = (e, t) => i("SyncSourceView", e, t), Fn = (e, t) => i("RefreshSourceView", e, t), _n = (e, t) => i("CloseSourceView", e, t), On = (e, t) => i("GetSourceStates", e, t), En = (e, t) => i("RetryConnectionSources", e, t), An = (e, t, n) => i("ScopeValues", e, t, n), uo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
334
+ __proto__: null,
335
+ Action: nn,
336
+ AttachStreamAction: Pn,
337
+ CancelStreamAction: Gn,
338
+ Catalog: Kt,
339
+ CheckConnection: Mt,
340
+ CloseSourceView: _n,
341
+ Enumerate: Zt,
342
+ Features: Qt,
343
+ Get: Yt,
344
+ GetActions: wn,
345
+ GetAllConnectionStates: cn,
346
+ GetConnection: kt,
347
+ GetConnectionMetadata: Wt,
348
+ GetEditorSchemaDocument: $n,
349
+ GetEditorSchemas: yn,
350
+ GetHealth: Tn,
351
+ GetRelationships: Sn,
352
+ GetResourceDefinition: gn,
353
+ GetResourceEvents: bn,
354
+ GetResourceGroups: hn,
355
+ GetSchemaDocument: sn,
356
+ GetSchemaFields: dn,
357
+ GetSourceStates: On,
358
+ HasPlugin: Ht,
359
+ ImportConnectionProfile: ln,
360
+ ListAllConnections: Dt,
361
+ ListConnectionProfiles: an,
362
+ ListConnections: Vt,
363
+ ListPlugins: Jt,
364
+ LoadConnections: Bt,
365
+ Mutate: tn,
366
+ NativeQuery: en,
367
+ OpenSourceView: Rn,
368
+ RefreshConnectionMetadata: Xt,
369
+ RefreshSourceView: Fn,
370
+ RemoveConnection: pn,
371
+ ResetConnectionProfile: fn,
372
+ ResolveReference: on,
373
+ ResolveRelationships: mn,
374
+ ResolveTarget: rn,
375
+ RetryConnectionSources: En,
376
+ SaveConnectionProfile: un,
377
+ ScopeValues: An,
378
+ StartConnection: zt,
379
+ StopConnection: xt,
380
+ StreamAction: vn,
381
+ SyncSourceView: Cn
382
+ }, Symbol.toStringTag, { value: "Module" })), A = "github.com/omniviewdev/omniview/backend/pkg/plugin/resource.GraphService";
383
+ function Ln(e, t, n, o, u) {
384
+ return y(`${A}.GetRelated`, e, t, n, o, u);
385
+ }
386
+ function Nn(e, t, n, o, u) {
387
+ return y(`${A}.GetRelationshipChain`, e, t, n, o, u);
388
+ }
389
+ function jn(e, t, n, o) {
390
+ return y(`${A}.GetDependencyTree`, e, t, n, o);
391
+ }
392
+ function Mn(e, t, n, o, u) {
393
+ return y(`${A}.GetSubgraph`, e, t, n, o, u);
394
+ }
395
+ const lo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
396
+ __proto__: null,
397
+ GetDependencyTree: jn,
398
+ GetRelated: Ln,
399
+ GetRelationshipChain: Nn,
400
+ GetSubgraph: Mn
401
+ }, Symbol.toStringTag, { value: "Module" }));
402
+ class J {
403
+ snapshot;
404
+ applied;
405
+ uncertain;
406
+ message;
407
+ /** Creates a new CommitResult instance. */
408
+ constructor(t = {}) {
409
+ "snapshot" in t || (this.snapshot = new _()), "applied" in t || (this.applied = !1), "uncertain" in t || (this.uncertain = !1), "message" in t || (this.message = ""), Object.assign(this, t);
410
+ }
411
+ /**
412
+ * Creates a new CommitResult instance from a string or object.
413
+ */
414
+ static createFrom(t = {}) {
415
+ const n = kn;
416
+ let o = typeof t == "string" ? JSON.parse(t) : t;
417
+ return "snapshot" in o && (o.snapshot = n(o.snapshot)), new J(o);
418
+ }
419
+ }
420
+ class L {
421
+ kind;
422
+ pluginId;
423
+ /** Creates a new Scope instance. */
424
+ constructor(t = {}) {
425
+ "kind" in t || (this.kind = ""), Object.assign(this, t);
426
+ }
427
+ /**
428
+ * Creates a new Scope instance from a string or object.
429
+ */
430
+ static createFrom(t = {}) {
431
+ let n = typeof t == "string" ? JSON.parse(t) : t;
432
+ return new L(n);
433
+ }
434
+ }
435
+ class _ {
436
+ scope;
437
+ categories;
438
+ /** Creates a new Snapshot instance. */
439
+ constructor(t = {}) {
440
+ "scope" in t || (this.scope = new L()), "categories" in t || (this.categories = {}), Object.assign(this, t);
441
+ }
442
+ /**
443
+ * Creates a new Snapshot instance from a string or object.
444
+ */
445
+ static createFrom(t = {}) {
446
+ const n = Hn, o = O;
447
+ let u = typeof t == "string" ? JSON.parse(t) : t;
448
+ return "scope" in u && (u.scope = n(u.scope)), "categories" in u && (u.categories = o(u.categories)), new _(u);
449
+ }
450
+ }
451
+ const kn = _.createFrom, Hn = L.createFrom;
452
+ var O = function e(...t) {
453
+ return O === e && (O = Vn), O(...t);
454
+ };
455
+ const Dn = ye.createFrom, Vn = P(g, Dn);
456
+ function Jn(e, t) {
457
+ return r(1766083910, e, t).then((n) => xn(n));
458
+ }
459
+ function Bn(e) {
460
+ return r(3969198041, e).then((t) => qn(t));
461
+ }
462
+ function zn(e, t, n) {
463
+ return r(3964153809, e, t, n).then((o) => Un(o));
464
+ }
465
+ const xn = J.createFrom, qn = _.createFrom, Un = $e.createFrom, fo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
466
+ __proto__: null,
467
+ Commit: Jn,
468
+ GetSnapshot: Bn,
469
+ Validate: zn
470
+ }, Symbol.toStringTag, { value: "Module" }));
471
+ function In(e) {
472
+ return r(2106300110, e).then((t) => Xn(t));
473
+ }
474
+ function Qn(e) {
475
+ return r(765209827, e).then((t) => Kn(t));
476
+ }
477
+ function Wn(e) {
478
+ return r(2355436169, e).then((t) => ne(t));
479
+ }
480
+ const te = Se.createFrom, ne = f(te), Xn = P(g, ne), Kn = v(te), po = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
481
+ __proto__: null,
482
+ GetPluginComponents: In,
483
+ GetResourceAreaComponent: Qn,
484
+ GetResourceComponents: Wn
485
+ }, Symbol.toStringTag, { value: "Module" })), R = /* @__PURE__ */ new Map(), Yn = 1e4, U = 8 * 1024 * 1024, Zn = new TextEncoder(), er = 100;
486
+ function I(e) {
487
+ const t = Array.isArray(e) && e.length === 1 && typeof e[0] == "string" ? e[0] : e;
488
+ return typeof t == "string" ? JSON.parse(t) : t;
489
+ }
490
+ function N(e, t) {
491
+ const n = q(`core/logs/lines/${e}`, (o) => t.onLines(o.data));
492
+ try {
493
+ const o = q(`core/logs/event/${e}`, (u) => t.onEvent(u.data));
494
+ return () => {
495
+ n(), o();
496
+ };
497
+ } catch (o) {
498
+ throw n(), o;
499
+ }
500
+ }
501
+ function tr(e) {
502
+ if (R.has(e)) throw new Error("Log session ID is already in use.");
503
+ const t = [];
504
+ let n = 0;
505
+ const o = [], u = /* @__PURE__ */ new Map();
506
+ let w = 0;
507
+ const G = N(e, {
508
+ onLines(h) {
509
+ try {
510
+ const a = I(h);
511
+ if (!Array.isArray(a)) return;
512
+ for (const s of a) {
513
+ const l = Zn.encode(JSON.stringify(s)).byteLength;
514
+ for (; t.length && (t.length >= Yn || n + l > U); )
515
+ n -= t.shift().bytes;
516
+ l <= U && (t.push({
517
+ data: s,
518
+ bytes: l
519
+ }), n += l);
520
+ }
521
+ } catch (a) {
522
+ console.error("Failed to parse log lines:", a);
523
+ }
524
+ },
525
+ onEvent(h) {
526
+ try {
527
+ const a = I(h), s = {
528
+ data: a,
529
+ order: w++
530
+ };
531
+ a && typeof a == "object" && "source_id" in a && a.source_id === "" && "type" in a && typeof a.type == "number" && Number.isInteger(a.type) && a.type >= 0 && a.type <= 6 ? u.set(a.type, s) : (o.push(s), o.length > er && o.shift());
532
+ } catch (a) {
533
+ console.error("Failed to parse log event:", a);
534
+ }
535
+ }
536
+ });
537
+ let b;
538
+ const $ = () => {
539
+ clearTimeout(b), G(), R.get(e) === p && R.delete(e), t.length = 0, n = 0, o.length = 0, u.clear();
540
+ }, m = () => {
541
+ R.get(e) === p && (b ??= setTimeout($, 6e4));
542
+ }, p = {
543
+ connect(h) {
544
+ const a = t.map((c) => c.data), s = [...o, ...u.values()].sort((c, S) => c.order - S.order);
545
+ $();
546
+ const l = N(e, h);
547
+ try {
548
+ a.length && h.onLines(a);
549
+ for (const c of s) h.onEvent(c.data);
550
+ return l;
551
+ } catch (c) {
552
+ throw l(), c;
553
+ }
554
+ }
555
+ };
556
+ return R.set(e, p), {
557
+ release: $,
558
+ settled: m
559
+ };
560
+ }
561
+ function nr(e, t) {
562
+ return R.get(e)?.connect(t) ?? N(e, t);
563
+ }
564
+ function rr(e) {
565
+ return r(2776241946, e);
566
+ }
567
+ function or(e) {
568
+ return r(1474987050, e).then((t) => B(t));
569
+ }
570
+ function ir(e) {
571
+ return r(3156347865, e).then((t) => hr(t));
572
+ }
573
+ function sr(e) {
574
+ return r(1444002509, e);
575
+ }
576
+ function cr() {
577
+ return r(3104582886).then((e) => gr(e));
578
+ }
579
+ function ar() {
580
+ return r(2249742267).then((e) => dr(e));
581
+ }
582
+ function ur(e, t) {
583
+ return r(1212190993, e, t);
584
+ }
585
+ function lr(e, t) {
586
+ return r(2177127885, e, t).then((n) => B(n));
587
+ }
588
+ const fr = me.createFrom, B = v(fr), pr = Te.createFrom, hr = f(pr), gr = f(g), dr = f(B);
589
+ function yr(e, t, n) {
590
+ const o = n.session_id ?? crypto.randomUUID(), u = d({
591
+ ...n,
592
+ session_id: o
593
+ }, [e, t]), {
594
+ release: w,
595
+ settled: G
596
+ } = tr(o);
597
+ let b;
598
+ const $ = () => {
599
+ clearTimeout(b), w();
600
+ };
601
+ try {
602
+ const m = y("github.com/omniviewdev/omniview/backend/pkg/plugin/logs.ServiceWrapper.CreateSession", e, t, u), p = new Error("Log session creation timed out after 120 seconds.");
603
+ return b = setTimeout(() => {
604
+ m.cancel(p);
605
+ }, 12e4), m.then((h) => {
606
+ if (clearTimeout(b), !h || h.id !== o)
607
+ throw w(), new Error("Log provider returned an invalid session.");
608
+ return G(), h;
609
+ }, (h) => {
610
+ throw $(), h?.cause === p ? p : h;
611
+ }, $);
612
+ } catch (m) {
613
+ throw $(), m;
614
+ }
615
+ }
616
+ const ho = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
617
+ __proto__: null,
618
+ CloseSession: rr,
619
+ CreateSession: yr,
620
+ GetSession: or,
621
+ GetSupportedResources: ir,
622
+ HasPlugin: sr,
623
+ ListPlugins: cr,
624
+ ListSessions: ar,
625
+ SendCommand: ur,
626
+ SubscribeSessionEvents: nr,
627
+ UpdateSessionOptions: lr
628
+ }, Symbol.toStringTag, { value: "Module" }));
629
+ class z {
630
+ plugin_id;
631
+ provider_id;
632
+ name;
633
+ icon;
634
+ description;
635
+ handlers;
636
+ /** Creates a new MetricProviderSummary instance. */
637
+ constructor(t = {}) {
638
+ "plugin_id" in t || (this.plugin_id = ""), "provider_id" in t || (this.provider_id = ""), "name" in t || (this.name = ""), "icon" in t || (this.icon = ""), "description" in t || (this.description = ""), "handlers" in t || (this.handlers = []), Object.assign(this, t);
639
+ }
640
+ /**
641
+ * Creates a new MetricProviderSummary instance from a string or object.
642
+ */
643
+ static createFrom(t = {}) {
644
+ const n = Sr;
645
+ let o = typeof t == "string" ? JSON.parse(t) : t;
646
+ return "handlers" in o && (o.handlers = n(o.handlers)), new z(o);
647
+ }
648
+ }
649
+ const $r = be.createFrom, Sr = f($r);
650
+ function mr() {
651
+ return r(3919346639).then((e) => re(e));
652
+ }
653
+ function Tr(e) {
654
+ return r(3953821778, e).then((t) => re(t));
655
+ }
656
+ function br(e) {
657
+ return r(1815388456, e);
658
+ }
659
+ function wr() {
660
+ return r(2730149903).then((e) => Gr(e));
661
+ }
662
+ function vr(e) {
663
+ return r(3994236150, e);
664
+ }
665
+ const Pr = z.createFrom, re = f(Pr), Gr = f(g);
666
+ we.createFrom;
667
+ const x = "github.com/omniviewdev/omniview/backend/pkg/plugin/metric.ServiceWrapper";
668
+ function Rr(e, t, n) {
669
+ return y(`${x}.Query`, e, t, d(n, [e, t]));
670
+ }
671
+ function Cr(e, t) {
672
+ return y(`${x}.QueryAll`, e, d(t, [e]));
673
+ }
674
+ function Fr(e, t, n) {
675
+ return y(`${x}.Subscribe`, e, t, d(n, [e, t]));
676
+ }
677
+ const go = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
678
+ __proto__: null,
679
+ GetProviders: mr,
680
+ GetProvidersForResource: Tr,
681
+ HasPlugin: br,
682
+ ListPlugins: wr,
683
+ Query: Rr,
684
+ QueryAll: Cr,
685
+ Subscribe: Fr,
686
+ Unsubscribe: vr
687
+ }, Symbol.toStringTag, { value: "Module" }));
688
+ function _r(e, t) {
689
+ return r(3653639550, e, t);
690
+ }
691
+ function Or(e, t) {
692
+ return r(851823419, e, t);
693
+ }
694
+ function Er(e) {
695
+ return r(2991415449, e).then((t) => Lr(t));
696
+ }
697
+ function Ar(e, t, n) {
698
+ return r(2695679023, e, t, n);
699
+ }
700
+ const Lr = f(g), yo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
701
+ __proto__: null,
702
+ Delete: _r,
703
+ Get: Or,
704
+ Keys: Er,
705
+ Set: Ar
706
+ }, Symbol.toStringTag, { value: "Module" }));
707
+ function Nr(e) {
708
+ return r(584261046, e);
709
+ }
710
+ function jr(e) {
711
+ return r(3098255555, e);
712
+ }
713
+ function Mr(e) {
714
+ return r(903698361, e);
715
+ }
716
+ function kr(e, t, n) {
717
+ return r(1235170530, e, t, n).then((o) => Yr(o));
718
+ }
719
+ function Hr(e) {
720
+ return r(3199298309, e);
721
+ }
722
+ function Dr() {
723
+ return r(2119827301).then((e) => Zr(e));
724
+ }
725
+ function Vr(e) {
726
+ return r(2822783534, e).then((t) => oe(t));
727
+ }
728
+ function Jr() {
729
+ return r(1563865534);
730
+ }
731
+ function Br() {
732
+ return r(914742443).then((e) => to(e));
733
+ }
734
+ function zr() {
735
+ return r(3392737293).then((e) => no(e));
736
+ }
737
+ function xr(e, t, n) {
738
+ return r(1474486628, e, t, n);
739
+ }
740
+ function qr(e, t, n) {
741
+ return r(2366942716, e, t, n);
742
+ }
743
+ function Ur(e) {
744
+ return r(4008581935, e);
745
+ }
746
+ function Ir(e) {
747
+ return r(520255202, e);
748
+ }
749
+ function Qr(e, t, n) {
750
+ return r(958877691, e, t, n);
751
+ }
752
+ function Wr(e, t, n) {
753
+ return r(1772958861, e, t, n);
754
+ }
755
+ function Xr(e, t, n) {
756
+ return r(728919203, e, t, n);
757
+ }
758
+ function Kr(e, t) {
759
+ return r(1547965995, e, t);
760
+ }
761
+ const Yr = ve.createFrom, Zr = Pe.createFrom, oe = P(g, g), eo = Ge.createFrom, to = f(eo), no = P(g, oe), $o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
762
+ __proto__: null,
763
+ BeginDrag: Nr,
764
+ CancelDrag: jr,
765
+ Close: Mr,
766
+ EndDrag: kr,
767
+ Focus: Hr,
768
+ GetSettingsState: Dr,
769
+ GetState: Vr,
770
+ HideSettings: Jr,
771
+ List: Br,
772
+ ListStates: zr,
773
+ MoveDrag: xr,
774
+ MoveToPointer: qr,
775
+ Open: Ur,
776
+ OpenSettings: Ir,
777
+ ReportViewport: Qr,
778
+ RespondDrop: Wr,
779
+ SaveState: Xr,
780
+ SetSettingsLocation: Kr
781
+ }, Symbol.toStringTag, { value: "Module" }));
782
+ export {
783
+ Qn as $,
784
+ Ar as A,
785
+ qe as B,
786
+ Jn as C,
787
+ Ae as D,
788
+ Oe as E,
789
+ Hr as F,
790
+ Bn as G,
791
+ Ue as H,
792
+ ln as I,
793
+ yr as J,
794
+ rr as K,
795
+ Vt as L,
796
+ mr as M,
797
+ Tr as N,
798
+ Ir as O,
799
+ Fr as P,
800
+ Cr as Q,
801
+ fn as R,
802
+ xt as S,
803
+ Ye as T,
804
+ vr as U,
805
+ zn as V,
806
+ Ie as W,
807
+ Qe as X,
808
+ nt as Y,
809
+ tn as Z,
810
+ Yt as _,
811
+ ao as a,
812
+ hn as a0,
813
+ en as a1,
814
+ Kt as a2,
815
+ Rn as a3,
816
+ Cn as a4,
817
+ _n as a5,
818
+ Fn as a6,
819
+ Zt as a7,
820
+ wn as a8,
821
+ nn as a9,
822
+ yn as aa,
823
+ $n as ab,
824
+ dn as ac,
825
+ On as ad,
826
+ Gn as ae,
827
+ vn as af,
828
+ Pn as ag,
829
+ Ln as ah,
830
+ jn as ai,
831
+ Mn as aj,
832
+ rn as ak,
833
+ fo as b,
834
+ uo as c,
835
+ po as d,
836
+ so as e,
837
+ $o as f,
838
+ lo as g,
839
+ it as h,
840
+ Mt as i,
841
+ zt as j,
842
+ un as k,
843
+ ho as l,
844
+ go as m,
845
+ co as n,
846
+ pn as o,
847
+ kt as p,
848
+ An as q,
849
+ cn as r,
850
+ yo as s,
851
+ En as t,
852
+ bt as u,
853
+ Dt as v,
854
+ an as w,
855
+ Wt as x,
856
+ Xt as y,
857
+ Or as z
858
+ };