@omniviewdev/runtime 0.1.11 → 0.2.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 (42) hide show
  1. package/dist/Client-BRYjLBXY.cjs +1 -0
  2. package/dist/{Client-DRRyPmcf.js → Client-RGYOEzh2.js} +312 -275
  3. package/dist/api.cjs +1 -1
  4. package/dist/api.d.ts +1 -0
  5. package/dist/api.js +95 -51
  6. package/dist/context/drawer/types.d.ts +1 -1
  7. package/dist/errors/types.d.ts +2 -0
  8. package/dist/hooks/connection/useConnectionStatus.d.ts +3 -3
  9. package/dist/hooks/connection/useConnections.d.ts +2 -2
  10. package/dist/hooks/resource/index.d.ts +2 -1
  11. package/dist/hooks/resource/useActiveSyncs.d.ts +2 -2
  12. package/dist/hooks/resource/useEditorSchemas.d.ts +2 -2
  13. package/dist/hooks/resource/useEventBatcher.d.ts +55 -0
  14. package/dist/hooks/resource/useResource.d.ts +9 -21
  15. package/dist/hooks/resource/useResourceActions.d.ts +3 -3
  16. package/dist/hooks/resource/useResourceGroups.d.ts +1 -1
  17. package/dist/hooks/resource/useResourceMutations.d.ts +14 -7
  18. package/dist/hooks/resource/useResourceSearch.d.ts +1 -1
  19. package/dist/hooks/resource/useResourceType.d.ts +1 -1
  20. package/dist/hooks/resource/useResourceTypes.d.ts +1 -1
  21. package/dist/hooks/resource/useResources.d.ts +14 -22
  22. package/dist/hooks/resource/useWatchState.d.ts +28 -0
  23. package/dist/index.cjs +2 -2
  24. package/dist/index.d.ts +1 -0
  25. package/dist/index.js +1406 -1295
  26. package/dist/models.cjs +1 -1
  27. package/dist/models.js +1343 -972
  28. package/dist/types/index.d.ts +1 -1
  29. package/dist/types/watch.d.ts +29 -0
  30. package/dist/utils/activeSyncAggregator.d.ts +13 -8
  31. package/dist/utils/resourceKey.d.ts +12 -0
  32. package/dist/wailsjs/go/devserver/DevServerManager.d.ts +2 -0
  33. package/dist/wailsjs/go/models.d.ts +400 -214
  34. package/dist/wailsjs/go/plugin/pluginManager.d.ts +3 -1
  35. package/dist/wailsjs/go/pluginlog/Manager.d.ts +18 -0
  36. package/dist/wailsjs/go/resource/Client.d.ts +39 -23
  37. package/package.json +1 -1
  38. package/dist/Client-BtQwAB3N.cjs +0 -1
  39. package/dist/errors/parseAppError.test.d.ts +0 -1
  40. package/dist/hooks/resource/useInformerState.d.ts +0 -24
  41. package/dist/types/informer.d.ts +0 -49
  42. package/dist/utils/activeSyncAggregator.test.d.ts +0 -1
package/dist/api.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./Client-BtQwAB3N.cjs");function i(e){return window.go.utils.Client.DetectLanguage(e)}const o=Object.freeze(Object.defineProperty({__proto__:null,DetectLanguage:i},Symbol.toStringTag,{value:"Module"}));function a(e,n){return window.go.diagnostics.DiagnosticsClient.Debug(e,n)}function g(e,n){return window.go.diagnostics.DiagnosticsClient.Error(e,n)}function v(e,n){return window.go.diagnostics.DiagnosticsClient.Info(e,n)}function l(e,n,r){return window.go.diagnostics.DiagnosticsClient.Log(e,n,r)}function u(e){return window.go.diagnostics.DiagnosticsClient.ReadLog(e)}function s(e){return window.go.diagnostics.DiagnosticsClient.StartTail(e)}function c(e){return window.go.diagnostics.DiagnosticsClient.StopTail(e)}function S(e,n){return window.go.diagnostics.DiagnosticsClient.Warn(e,n)}const d=Object.freeze(Object.defineProperty({__proto__:null,Debug:a,Error:g,Info:v,Log:l,ReadLog:u,StartTail:s,StopTail:c,Warn:S},Symbol.toStringTag,{value:"Module"}));function w(e,n){return window.go.devserver.DevServerManager.GetDevServerLogs(e,n)}function D(e){return window.go.devserver.DevServerManager.GetDevServerState(e)}function f(e){return window.go.devserver.DevServerManager.GetExternalPluginInfo(e)}function C(e){return window.go.devserver.DevServerManager.Initialize(e)}function p(e){return window.go.devserver.DevServerManager.IsManaged(e)}function M(){return window.go.devserver.DevServerManager.ListDevServerStates()}function b(e){return window.go.devserver.DevServerManager.RestartDevServer(e)}function O(){return window.go.devserver.DevServerManager.Shutdown()}function _(e){return window.go.devserver.DevServerManager.StartDevServer(e)}function m(e,n){return window.go.devserver.DevServerManager.StartDevServerForPath(e,n)}function y(e){return window.go.devserver.DevServerManager.StopDevServer(e)}const F=Object.freeze(Object.defineProperty({__proto__:null,GetDevServerLogs:w,GetDevServerState:D,GetExternalPluginInfo:f,Initialize:C,IsManaged:p,ListDevServerStates:M,RestartDevServer:b,Shutdown:O,StartDevServer:_,StartDevServerForPath:m,StopDevServer:y},Symbol.toStringTag,{value:"Module"}));function L(){return window.go.main.App.GetOperatingSystem()}function P(e){return window.go.main.App.OpenFileSelectionDialog(e)}function G(e){return window.go.main.App.SaveFileDialog(e)}function I(e,n){return window.go.main.App.WriteFileContent(e,n)}exports.ExecClient=t.Client;exports.LogsClient=t.Client$5;exports.MetricClient=t.Client$6;exports.NetworkerClient=t.Client$1;exports.PluginManager=t.pluginManager;exports.ResourceClient=t.Client$2;exports.SettingsClient=t.Client$3;exports.SettingsProvider=t.provider;exports.UIClient=t.Client$4;exports.DevServerManager=F;exports.DiagnosticsClient=d;exports.GetOperatingSystem=L;exports.OpenFileSelectionDialog=P;exports.SaveFileDialog=G;exports.UtilsClient=o;exports.WriteFileContent=I;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./Client-BRYjLBXY.cjs");function i(e){return window.go.utils.Client.DetectLanguage(e)}const o=Object.freeze(Object.defineProperty({__proto__:null,DetectLanguage:i},Symbol.toStringTag,{value:"Module"}));function g(e,n){return window.go.diagnostics.DiagnosticsClient.Debug(e,n)}function a(e,n){return window.go.diagnostics.DiagnosticsClient.Error(e,n)}function u(e,n){return window.go.diagnostics.DiagnosticsClient.Info(e,n)}function l(e,n,t){return window.go.diagnostics.DiagnosticsClient.Log(e,n,t)}function s(e){return window.go.diagnostics.DiagnosticsClient.ReadLog(e)}function v(e){return window.go.diagnostics.DiagnosticsClient.StartTail(e)}function c(e){return window.go.diagnostics.DiagnosticsClient.StopTail(e)}function d(e,n){return window.go.diagnostics.DiagnosticsClient.Warn(e,n)}const S=Object.freeze(Object.defineProperty({__proto__:null,Debug:g,Error:a,Info:u,Log:l,ReadLog:s,StartTail:v,StopTail:c,Warn:d},Symbol.toStringTag,{value:"Module"}));function w(e,n){return window.go.devserver.DevServerManager.GetDevServerLogs(e,n)}function D(e){return window.go.devserver.DevServerManager.GetDevServerState(e)}function f(e){return window.go.devserver.DevServerManager.GetExternalPluginInfo(e)}function p(e){return window.go.devserver.DevServerManager.Initialize(e)}function M(e){return window.go.devserver.DevServerManager.IsManaged(e)}function C(){return window.go.devserver.DevServerManager.ListDevServerStates()}function b(e){return window.go.devserver.DevServerManager.RebuildPlugin(e)}function L(e){return window.go.devserver.DevServerManager.RestartDevServer(e)}function m(){return window.go.devserver.DevServerManager.Shutdown()}function O(e){return window.go.devserver.DevServerManager.StartDevServer(e)}function _(e,n){return window.go.devserver.DevServerManager.StartDevServerForPath(e,n)}function P(e){return window.go.devserver.DevServerManager.StopDevServer(e)}const y=Object.freeze(Object.defineProperty({__proto__:null,GetDevServerLogs:w,GetDevServerState:D,GetExternalPluginInfo:f,Initialize:p,IsManaged:M,ListDevServerStates:C,RebuildPlugin:b,RestartDevServer:L,Shutdown:m,StartDevServer:O,StartDevServerForPath:_,StopDevServer:P},Symbol.toStringTag,{value:"Module"}));function F(){return window.go.pluginlog.Manager.Close()}function G(e,n){return window.go.pluginlog.Manager.GetLogs(e,n)}function j(){return window.go.pluginlog.Manager.ListStreams()}function I(){return window.go.pluginlog.Manager.LogDir()}function T(e){return window.go.pluginlog.Manager.OnEmit(e)}function E(e,n){return window.go.pluginlog.Manager.SearchLogs(e,n)}function R(e){return window.go.pluginlog.Manager.Stream(e)}function $(e){return window.go.pluginlog.Manager.Subscribe(e)}function h(e){return window.go.pluginlog.Manager.Unsubscribe(e)}const z=Object.freeze(Object.defineProperty({__proto__:null,Close:F,GetLogs:G,ListStreams:j,LogDir:I,OnEmit:T,SearchLogs:E,Stream:R,Subscribe:$,Unsubscribe:h},Symbol.toStringTag,{value:"Module"}));function W(){return window.go.main.App.GetOperatingSystem()}function A(e){return window.go.main.App.OpenFileSelectionDialog(e)}function U(e){return window.go.main.App.SaveFileDialog(e)}function x(e,n){return window.go.main.App.WriteFileContent(e,n)}exports.ExecClient=r.Client;exports.LogsClient=r.Client$5;exports.MetricClient=r.Client$6;exports.NetworkerClient=r.Client$1;exports.PluginManager=r.pluginManager;exports.ResourceClient=r.Client$2;exports.SettingsClient=r.Client$3;exports.SettingsProvider=r.provider;exports.UIClient=r.Client$4;exports.DevServerManager=y;exports.DiagnosticsClient=S;exports.GetOperatingSystem=W;exports.OpenFileSelectionDialog=A;exports.PluginLogManager=z;exports.SaveFileDialog=U;exports.UtilsClient=o;exports.WriteFileContent=x;
package/dist/api.d.ts CHANGED
@@ -10,4 +10,5 @@ export * as DiagnosticsClient from './wailsjs/go/diagnostics/DiagnosticsClient';
10
10
  export * as LogsClient from './wailsjs/go/logs/Client';
11
11
  export * as MetricClient from './wailsjs/go/metric/Client';
12
12
  export * as DevServerManager from './wailsjs/go/devserver/DevServerManager';
13
+ export * as PluginLogManager from './wailsjs/go/pluginlog/Manager';
13
14
  export * from './wailsjs/go/main/App';
package/dist/api.js CHANGED
@@ -1,15 +1,15 @@
1
- import { C as j, f as x, g as z, a as E, p as R, b as h, c as A, d as W, e as U } from "./Client-DRRyPmcf.js";
1
+ import { C as q, f as B, g as H, a as J, p as K, b as Q, c as V, d as X, e as Y } from "./Client-RGYOEzh2.js";
2
2
  function t(e) {
3
3
  return window.go.utils.Client.DetectLanguage(e);
4
4
  }
5
- const L = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5
+ const E = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
6
6
  __proto__: null,
7
7
  DetectLanguage: t
8
8
  }, Symbol.toStringTag, { value: "Module" }));
9
- function i(e, n) {
9
+ function o(e, n) {
10
10
  return window.go.diagnostics.DiagnosticsClient.Debug(e, n);
11
11
  }
12
- function o(e, n) {
12
+ function i(e, n) {
13
13
  return window.go.diagnostics.DiagnosticsClient.Error(e, n);
14
14
  }
15
15
  function a(e, n) {
@@ -18,28 +18,28 @@ function a(e, n) {
18
18
  function g(e, n, r) {
19
19
  return window.go.diagnostics.DiagnosticsClient.Log(e, n, r);
20
20
  }
21
- function v(e) {
21
+ function u(e) {
22
22
  return window.go.diagnostics.DiagnosticsClient.ReadLog(e);
23
23
  }
24
24
  function s(e) {
25
25
  return window.go.diagnostics.DiagnosticsClient.StartTail(e);
26
26
  }
27
- function u(e) {
27
+ function l(e) {
28
28
  return window.go.diagnostics.DiagnosticsClient.StopTail(e);
29
29
  }
30
- function l(e, n) {
30
+ function v(e, n) {
31
31
  return window.go.diagnostics.DiagnosticsClient.Warn(e, n);
32
32
  }
33
- const m = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
33
+ const R = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
34
34
  __proto__: null,
35
- Debug: i,
36
- Error: o,
35
+ Debug: o,
36
+ Error: i,
37
37
  Info: a,
38
38
  Log: g,
39
- ReadLog: v,
39
+ ReadLog: u,
40
40
  StartTail: s,
41
- StopTail: u,
42
- Warn: l
41
+ StopTail: l,
42
+ Warn: v
43
43
  }, Symbol.toStringTag, { value: "Module" }));
44
44
  function c(e, n) {
45
45
  return window.go.devserver.DevServerManager.GetDevServerLogs(e, n);
@@ -47,74 +47,118 @@ function c(e, n) {
47
47
  function d(e) {
48
48
  return window.go.devserver.DevServerManager.GetDevServerState(e);
49
49
  }
50
- function S(e) {
50
+ function w(e) {
51
51
  return window.go.devserver.DevServerManager.GetExternalPluginInfo(e);
52
52
  }
53
- function w(e) {
53
+ function S(e) {
54
54
  return window.go.devserver.DevServerManager.Initialize(e);
55
55
  }
56
- function D(e) {
56
+ function f(e) {
57
57
  return window.go.devserver.DevServerManager.IsManaged(e);
58
58
  }
59
- function f() {
59
+ function D() {
60
60
  return window.go.devserver.DevServerManager.ListDevServerStates();
61
61
  }
62
62
  function p(e) {
63
+ return window.go.devserver.DevServerManager.RebuildPlugin(e);
64
+ }
65
+ function M(e) {
63
66
  return window.go.devserver.DevServerManager.RestartDevServer(e);
64
67
  }
65
- function C() {
68
+ function b() {
66
69
  return window.go.devserver.DevServerManager.Shutdown();
67
70
  }
68
- function M(e) {
71
+ function C(e) {
69
72
  return window.go.devserver.DevServerManager.StartDevServer(e);
70
73
  }
71
- function b(e, n) {
74
+ function L(e, n) {
72
75
  return window.go.devserver.DevServerManager.StartDevServerForPath(e, n);
73
76
  }
74
- function _(e) {
77
+ function m(e) {
75
78
  return window.go.devserver.DevServerManager.StopDevServer(e);
76
79
  }
77
- const O = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
80
+ const h = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
78
81
  __proto__: null,
79
82
  GetDevServerLogs: c,
80
83
  GetDevServerState: d,
81
- GetExternalPluginInfo: S,
82
- Initialize: w,
83
- IsManaged: D,
84
- ListDevServerStates: f,
85
- RestartDevServer: p,
86
- Shutdown: C,
87
- StartDevServer: M,
88
- StartDevServerForPath: b,
89
- StopDevServer: _
84
+ GetExternalPluginInfo: w,
85
+ Initialize: S,
86
+ IsManaged: f,
87
+ ListDevServerStates: D,
88
+ RebuildPlugin: p,
89
+ RestartDevServer: M,
90
+ Shutdown: b,
91
+ StartDevServer: C,
92
+ StartDevServerForPath: L,
93
+ StopDevServer: m
94
+ }, Symbol.toStringTag, { value: "Module" }));
95
+ function _() {
96
+ return window.go.pluginlog.Manager.Close();
97
+ }
98
+ function O(e, n) {
99
+ return window.go.pluginlog.Manager.GetLogs(e, n);
100
+ }
101
+ function P() {
102
+ return window.go.pluginlog.Manager.ListStreams();
103
+ }
104
+ function y() {
105
+ return window.go.pluginlog.Manager.LogDir();
106
+ }
107
+ function G(e) {
108
+ return window.go.pluginlog.Manager.OnEmit(e);
109
+ }
110
+ function I(e, n) {
111
+ return window.go.pluginlog.Manager.SearchLogs(e, n);
112
+ }
113
+ function j(e) {
114
+ return window.go.pluginlog.Manager.Stream(e);
115
+ }
116
+ function F(e) {
117
+ return window.go.pluginlog.Manager.Subscribe(e);
118
+ }
119
+ function T(e) {
120
+ return window.go.pluginlog.Manager.Unsubscribe(e);
121
+ }
122
+ const z = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
123
+ __proto__: null,
124
+ Close: _,
125
+ GetLogs: O,
126
+ ListStreams: P,
127
+ LogDir: y,
128
+ OnEmit: G,
129
+ SearchLogs: I,
130
+ Stream: j,
131
+ Subscribe: F,
132
+ Unsubscribe: T
90
133
  }, Symbol.toStringTag, { value: "Module" }));
91
- function I() {
134
+ function x() {
92
135
  return window.go.main.App.GetOperatingSystem();
93
136
  }
94
- function P(e) {
137
+ function A(e) {
95
138
  return window.go.main.App.OpenFileSelectionDialog(e);
96
139
  }
97
- function y(e) {
140
+ function U(e) {
98
141
  return window.go.main.App.SaveFileDialog(e);
99
142
  }
100
- function F(e, n) {
143
+ function W(e, n) {
101
144
  return window.go.main.App.WriteFileContent(e, n);
102
145
  }
103
146
  export {
104
- O as DevServerManager,
105
- m as DiagnosticsClient,
106
- j as ExecClient,
107
- I as GetOperatingSystem,
108
- x as LogsClient,
109
- z as MetricClient,
110
- E as NetworkerClient,
111
- P as OpenFileSelectionDialog,
112
- R as PluginManager,
113
- h as ResourceClient,
114
- y as SaveFileDialog,
115
- A as SettingsClient,
116
- W as SettingsProvider,
117
- U as UIClient,
118
- L as UtilsClient,
119
- F as WriteFileContent
147
+ h as DevServerManager,
148
+ R as DiagnosticsClient,
149
+ q as ExecClient,
150
+ x as GetOperatingSystem,
151
+ B as LogsClient,
152
+ H as MetricClient,
153
+ J as NetworkerClient,
154
+ A as OpenFileSelectionDialog,
155
+ z as PluginLogManager,
156
+ K as PluginManager,
157
+ Q as ResourceClient,
158
+ U as SaveFileDialog,
159
+ V as SettingsClient,
160
+ X as SettingsProvider,
161
+ Y as UIClient,
162
+ E as UtilsClient,
163
+ W as WriteFileContent
120
164
  };
@@ -148,7 +148,7 @@ export type BottomDrawerTab = {
148
148
  createdAt: Date;
149
149
  updatedAt: Date;
150
150
  icon?: string | React.ReactNode;
151
- variant: 'terminal' | 'logs' | 'editor' | 'browser' | 'file' | 'devbuild' | 'editor-debug' | 'other';
151
+ variant: 'terminal' | 'logs' | 'editor' | 'browser' | 'file' | 'devbuild' | 'plugin-logs' | 'editor-debug' | 'other';
152
152
  properties?: Record<string, unknown>;
153
153
  };
154
154
  export type FindTabOpts = {
@@ -31,6 +31,8 @@ export declare const ErrorTypes: {
31
31
  readonly RESOURCE_TIMEOUT: "omniview:resource/timeout";
32
32
  readonly CONNECTION_NOT_FOUND: "omniview:connection/not-found";
33
33
  readonly CONNECTION_FAILED: "omniview:connection/failed";
34
+ readonly RESOURCE_CONNECTION_ERROR: "omniview:resource/connection-error";
35
+ readonly RESOURCE_CERTIFICATE_ERROR: "omniview:resource/certificate-error";
34
36
  readonly SESSION_NOT_FOUND: "omniview:session/not-found";
35
37
  readonly SESSION_FAILED: "omniview:session/failed";
36
38
  readonly CANCELLED: "omniview:cancelled";
@@ -19,11 +19,11 @@ export interface ConnectionStatusSummary {
19
19
  aggregateProgress: number;
20
20
  /** Disconnect a connection by plugin/connection ID */
21
21
  disconnect: (pluginID: string, connectionID: string) => Promise<void>;
22
- /** Retry informer sync for a connection */
23
- retryInformer: (pluginID: string, connectionID: string) => Promise<void>;
22
+ /** Retry watch sync for a connection */
23
+ retryWatch: (pluginID: string, connectionID: string) => Promise<void>;
24
24
  }
25
25
  /**
26
26
  * Unified hook that tracks connection status across all plugins.
27
- * Combines ListAllConnections query + connection/status events + informer/STATE events.
27
+ * Combines ListAllConnections query + connection/status events + watch/STATE events.
28
28
  */
29
29
  export declare function useConnectionStatus(): ConnectionStatusSummary;
@@ -12,7 +12,7 @@ export declare const connectionListQueryKey: (plugin: string) => string[];
12
12
  */
13
13
  export declare const useConnections: ({ plugin: explicitPlugin }: UseConnectionsOptions) => {
14
14
  connections: import('@tanstack/react-query').UseQueryResult<types.Connection[], Error>;
15
- startInformer: import('@tanstack/react-query').UseMutateAsyncFunction<void, unknown, types.Connection, unknown>;
16
- stopInformer: import('@tanstack/react-query').UseMutateAsyncFunction<void, unknown, types.Connection, unknown>;
15
+ startWatch: import('@tanstack/react-query').UseMutateAsyncFunction<void, unknown, types.Connection, unknown>;
16
+ stopWatch: import('@tanstack/react-query').UseMutateAsyncFunction<void, unknown, types.Connection, unknown>;
17
17
  };
18
18
  export {};
@@ -8,6 +8,7 @@ export * from './useResources';
8
8
  export * from './useResourceMutations';
9
9
  export * from './useResourceActions';
10
10
  export * from './useEditorSchemas';
11
- export * from './useInformerState';
11
+ export * from './useWatchState';
12
12
  export * from './useActiveSyncs';
13
13
  export * from './useStreamAction';
14
+ export * from './useEventBatcher';
@@ -1,8 +1,8 @@
1
1
  import { ActiveSync } from '../../utils/activeSyncAggregator';
2
2
  export type { ActiveSync };
3
3
  /**
4
- * useActiveSyncs aggregates informer sync state across all connections.
5
- * Subscribes to the global `informer/STATE` event topic.
4
+ * useActiveSyncs aggregates watch sync state across all connections.
5
+ * Subscribes to the global `watch/STATE` event topic.
6
6
  */
7
7
  export declare const useActiveSyncs: () => {
8
8
  /** All tracked syncs */
@@ -14,9 +14,9 @@ type UseEditorSchemasOptions = {
14
14
  * the SchemaRegistry (which lives in the host app's monaco provider).
15
15
  */
16
16
  export declare const useEditorSchemas: ({ pluginID: explicitPluginID, connectionID, enabled, }: UseEditorSchemasOptions) => {
17
- schemas: import("../../models").types.EditorSchema[];
17
+ schemas: import("../../models").resource.EditorSchema[];
18
18
  isLoading: boolean;
19
19
  error: Error | null;
20
- refetch: (options?: import('@tanstack/react-query').RefetchOptions) => Promise<import('@tanstack/react-query').QueryObserverResult<import("../../models").types.EditorSchema[], Error>>;
20
+ refetch: (options?: import('@tanstack/react-query').RefetchOptions) => Promise<import('@tanstack/react-query').QueryObserverResult<import("../../models").resource.EditorSchema[], Error>>;
21
21
  };
22
22
  export default useEditorSchemas;
@@ -0,0 +1,55 @@
1
+ import { QueryClient, QueryKey } from '@tanstack/react-query';
2
+ import { WatchState } from '../../types/watch';
3
+ export type AddPayload = {
4
+ data: any;
5
+ key: string;
6
+ connection: string;
7
+ id: string;
8
+ namespace: string;
9
+ };
10
+ export type UpdatePayload = {
11
+ data: any;
12
+ key: string;
13
+ connection: string;
14
+ id: string;
15
+ namespace: string;
16
+ };
17
+ export type DeletePayload = {
18
+ data: any;
19
+ key: string;
20
+ connection: string;
21
+ id: string;
22
+ namespace: string;
23
+ };
24
+ export type ResourceEvent = {
25
+ type: 'ADD';
26
+ payload: AddPayload;
27
+ } | {
28
+ type: 'UPDATE';
29
+ payload: UpdatePayload;
30
+ } | {
31
+ type: 'DELETE';
32
+ payload: DeletePayload;
33
+ };
34
+ /**
35
+ * Apply a batch of resource events to a list query cache entry.
36
+ * Extracted for testability — this is the core batching logic.
37
+ */
38
+ export declare function applyBatch(oldData: any, events: ResourceEvent[], idAccessor: string): any;
39
+ /**
40
+ * Adaptive two-mode event batcher for resource watch events.
41
+ *
42
+ * **Mode 1 — Initial Sync (SYNCING state):** Uses `setTimeout` with a larger
43
+ * window (default 500ms) to batch the initial ADD flood into 1-2 flushes.
44
+ * Satisfies REQ-BATCH-2.
45
+ *
46
+ * **Mode 2 — Live Updates (all other states):** Uses `requestAnimationFrame`
47
+ * to align cache updates with the browser repaint cycle (~16ms), providing
48
+ * the lowest-latency batching for live updates. Satisfies REQ-BATCH-1.
49
+ *
50
+ * Mode transitions happen automatically when `watchState` changes.
51
+ * Pending timers flush normally; subsequent events use the new scheduling.
52
+ */
53
+ export declare function useEventBatcher(queryClient: QueryClient, queryKey: QueryKey, getResourceKey: (id: string, ns: string) => QueryKey, idAccessor: string | undefined, watchState: WatchState, options?: {
54
+ syncWindowMs?: number;
55
+ }): (event: ResourceEvent) => void;
@@ -1,4 +1,4 @@
1
- import { types } from '../../wailsjs/go/models';
1
+ import { resource } from '../../wailsjs/go/models';
2
2
  type UseResourceOptions = {
3
3
  /**
4
4
  * The ID of the plugin responsible for this resource
@@ -26,22 +26,6 @@ type UseResourceOptions = {
26
26
  * @example "default"
27
27
  */
28
28
  namespace?: string;
29
- /**
30
- * Optional parameters to pass to the resource fetch
31
- * @example { labelSelector: "app=nginx" }
32
- */
33
- getParams?: Record<string, unknown>;
34
- /**
35
- * Optional parameters to pass to the resource update
36
- * @example { dryRun: true }
37
- */
38
- updateParams?: Record<string, unknown>;
39
- /**
40
- * Optional parameters to pass to the resource delete
41
- * @example { cascade: true }
42
- * @example { force: true }
43
- */
44
- deleteParams?: Record<string, unknown>;
45
29
  };
46
30
  /**
47
31
  * The useResource hook returns a hook, scoped to the desired resource and connection, that allows for interacting
@@ -50,25 +34,29 @@ type UseResourceOptions = {
50
34
  * It should be noted that this hook does not perform any logic to ensure that either the resource exists,
51
35
  * @throws If the resourceID is invalid
52
36
  */
53
- export declare const useResource: ({ pluginID: explicitPluginID, connectionID, resourceKey, resourceID, namespace, getParams, updateParams, deleteParams, }: UseResourceOptions) => {
37
+ export declare const useResource: ({ pluginID: explicitPluginID, connectionID, resourceKey, resourceID, namespace, }: UseResourceOptions) => {
54
38
  /**
55
39
  * Fetch result for the resource. The client will automatically cache the result, and update the cache
56
40
  * when the resource is updated or deleted via the returned update and remove mutation functions.
57
41
  */
58
- resource: import('@tanstack/react-query').UseQueryResult<types.GetResult, Error>;
42
+ resource: import('@tanstack/react-query').UseQueryResult<resource.GetResult, Error>;
59
43
  /**
60
44
  * Update an existing resource. A set of optional parameters can be passed to customize the update behavior,
61
45
  * which if specified, will add additional default behavior set via the hook options.
62
46
  *
63
47
  * @params opts Optional parameters to pass to the resource update
64
48
  */
65
- update: import('@tanstack/react-query').UseMutateAsyncFunction<types.UpdateResult, unknown, Partial<types.UpdateInput>, unknown>;
49
+ update: import('@tanstack/react-query').UseMutateAsyncFunction<resource.UpdateResult, unknown, {
50
+ input?: any;
51
+ }, unknown>;
66
52
  /**
67
53
  * Delete an existing resource. A set of optional parameters can be passed to customize the delete behavior,
68
54
  * which if specified, will add additional default behavior set via the hook options.
69
55
  *
70
56
  * @params {object} opts Optional parameters to pass to the resource delete
71
57
  */
72
- remove: import('@tanstack/react-query').UseMutateAsyncFunction<types.DeleteResult, unknown, Partial<types.DeleteInput>, unknown>;
58
+ remove: import('@tanstack/react-query').UseMutateAsyncFunction<resource.DeleteResult, unknown, {
59
+ gracePeriodSeconds?: number;
60
+ } | undefined, unknown>;
73
61
  };
74
62
  export default useResource;
@@ -1,4 +1,4 @@
1
- import { types } from '../../wailsjs/go/models';
1
+ import { resource } from '../../wailsjs/go/models';
2
2
  type UseResourceActionsOptions = {
3
3
  /**
4
4
  * The ID of the plugin responsible for this resource
@@ -26,7 +26,7 @@ type UseResourceActionsOptions = {
26
26
  * Returns the list of ActionDescriptors that the backend reports for the given resource key.
27
27
  */
28
28
  export declare const useResourceActions: ({ pluginID: explicitPluginID, connectionID, resourceKey, enabled, }: UseResourceActionsOptions) => {
29
- actions: types.ActionDescriptor[];
29
+ actions: resource.ActionDescriptor[];
30
30
  isLoading: boolean;
31
31
  error: Error | null;
32
32
  };
@@ -62,7 +62,7 @@ type ExecuteActionParams = {
62
62
  * Returns a mutate function that can be called with action details.
63
63
  */
64
64
  export declare const useExecuteAction: ({ pluginID: explicitPluginID, connectionID, resourceKey, }: UseExecuteActionOptions) => {
65
- executeAction: import('@tanstack/react-query').UseMutateAsyncFunction<types.ActionResult, unknown, ExecuteActionParams, unknown>;
65
+ executeAction: import('@tanstack/react-query').UseMutateAsyncFunction<resource.ActionResult, unknown, ExecuteActionParams, unknown>;
66
66
  isExecuting: boolean;
67
67
  error: unknown;
68
68
  };
@@ -17,6 +17,6 @@ export declare const useResourceGroups: ({ pluginID: explicitPluginID, connectio
17
17
  /**
18
18
  * The current settings from the provider.
19
19
  */
20
- groups: import('@tanstack/react-query').UseQueryResult<Record<string, import("../../models").types.ResourceGroup>, Error>;
20
+ groups: import('@tanstack/react-query').UseQueryResult<Record<string, import("../../models").resource.ResourceGroup>, Error>;
21
21
  };
22
22
  export default useResourceGroups;
@@ -1,4 +1,4 @@
1
- import { types } from '../../wailsjs/go/models';
1
+ import { resource } from '../../wailsjs/go/models';
2
2
  type ResourceMutationOptions = {
3
3
  /**
4
4
  * The connection ID to scope the resource to
@@ -42,17 +42,24 @@ type UseResourceMutationsOptions = {
42
42
  * @throws If the resourceID is invalid
43
43
  */
44
44
  export declare const useResourceMutations: ({ pluginID: explicitPluginID }: UseResourceMutationsOptions) => {
45
- create: import('@tanstack/react-query').UseMutateAsyncFunction<types.CreateResult, unknown, {
45
+ create: import('@tanstack/react-query').UseMutateAsyncFunction<resource.CreateResult, unknown, {
46
46
  opts: ResourceMutationOptions;
47
- input: Partial<types.CreateInput>;
47
+ input: {
48
+ input?: any;
49
+ namespace?: string;
50
+ };
48
51
  }, unknown>;
49
- update: import('@tanstack/react-query').UseMutateAsyncFunction<types.UpdateResult, unknown, {
52
+ update: import('@tanstack/react-query').UseMutateAsyncFunction<resource.UpdateResult, unknown, {
50
53
  opts: ResourceMutationOptions;
51
- input: Partial<types.UpdateInput>;
54
+ input: {
55
+ input?: any;
56
+ };
52
57
  }, unknown>;
53
- remove: import('@tanstack/react-query').UseMutateAsyncFunction<types.DeleteResult, unknown, {
58
+ remove: import('@tanstack/react-query').UseMutateAsyncFunction<resource.DeleteResult, unknown, {
54
59
  opts: ResourceMutationOptions;
55
- input: Partial<types.DeleteInput>;
60
+ input: {
61
+ gracePeriodSeconds?: number;
62
+ };
56
63
  }, unknown>;
57
64
  };
58
65
  export default useResourceMutations;
@@ -32,5 +32,5 @@ type ResourceSearchEntry = {
32
32
  * The useResourceSearch is a utility hook to search across multiple resources and/or namespaces. This hook is currently
33
33
  * limited searching within a single plugin, and a single connection.
34
34
  */
35
- export declare const useResourceSearch: ({ pluginID: explicitPluginID, connectionID, searches, }: UseResourceSearchOptions) => import('@tanstack/react-query').UseQueryResult<any[], Error>[];
35
+ export declare const useResourceSearch: ({ pluginID: explicitPluginID, connectionID, searches, }: UseResourceSearchOptions) => import('@tanstack/react-query').UseQueryResult<number[][], Error>[];
36
36
  export default useResourceSearch;
@@ -17,6 +17,6 @@ export declare const useResourceType: ({ pluginID: explicitPluginID, resourceKey
17
17
  /**
18
18
  * The current settings from the provider.
19
19
  */
20
- resourceType: import('@tanstack/react-query').UseQueryResult<import("../../models").types.ResourceMeta, Error>;
20
+ resourceType: import('@tanstack/react-query').UseQueryResult<import("../../models").resource.ResourceMeta, Error>;
21
21
  };
22
22
  export default useResourceType;
@@ -17,6 +17,6 @@ export declare const useResourceTypes: ({ pluginID: explicitPluginID, connection
17
17
  /**
18
18
  * The current settings from the provider.
19
19
  */
20
- types: import('@tanstack/react-query').UseQueryResult<Record<string, import("../../models").types.ResourceMeta>, Error>;
20
+ types: import('@tanstack/react-query').UseQueryResult<Record<string, import("../../models").resource.ResourceMeta>, Error>;
21
21
  };
22
22
  export {};
@@ -1,5 +1,4 @@
1
- import { types } from '../../wailsjs/go/models';
2
- import { InformerResourceState } from '../../types/informer';
1
+ import { resource as resourceModels } from '../../wailsjs/go/models';
3
2
  type UseResourcesOptions = {
4
3
  /**
5
4
  * The ID of the plugin responsible for this resource
@@ -25,20 +24,10 @@ type UseResourcesOptions = {
25
24
  */
26
25
  namespaces?: string[];
27
26
  /**
28
- * The dot-delimited path on which id's can be used for updates. In order for the informer
27
+ * The dot-delimited path on which id's can be used for updates. In order for the watch
29
28
  * live functionality to work, this must be set to the path on which the ID is located.
30
29
  */
31
30
  idAccessor?: string;
32
- /**
33
- * Optional parameters to pass to the resource fetch
34
- * @example { labelSelector: "app=nginx" }
35
- */
36
- listParams?: Record<string, unknown>;
37
- /**
38
- * Optional parameters to pass to the resource create
39
- * @example { dryRun: true }
40
- */
41
- createParams?: Record<string, unknown>;
42
31
  };
43
32
  /**
44
33
  * The useResource hook returns a hook, scoped to the desired resource and connection, that allows for interacting
@@ -47,27 +36,30 @@ type UseResourcesOptions = {
47
36
  * It should be noted that this hook does not perform any logic to ensure that either the resource exists,
48
37
  * @throws If the resourceID is invalid
49
38
  */
50
- export declare const useResources: ({ pluginID: explicitPluginID, connectionID, resourceKey, idAccessor, namespaces, listParams, createParams, }: UseResourcesOptions) => {
39
+ export declare const useResources: ({ pluginID: explicitPluginID, connectionID, resourceKey, idAccessor, namespaces, }: UseResourcesOptions) => {
51
40
  /**
52
41
  * Fetch result for the resource. The client will automatically cache the result, and update the cache
53
42
  * when the resources are updated or deleted via the returned create and remove mutation functions, or
54
43
  * the per-resource hook mutation functions.
55
44
  */
56
- resources: import('@tanstack/react-query').UseQueryResult<types.ListResult, Error>;
45
+ resources: import('@tanstack/react-query').UseQueryResult<resourceModels.ListResult, Error>;
57
46
  /**
58
47
  * Create a new resource. A set of optional parameters can be passed to customize the create behavior,
59
48
  * which if specified, will add additional default behavior set via the hook options.
60
49
  *
61
50
  * @params opts Optional parameters to pass to the resource create operation
62
51
  */
63
- create: import('@tanstack/react-query').UseMutateAsyncFunction<types.CreateResult, unknown, Partial<types.CreateInput>, unknown>;
64
- /** Current informer state for this resource type */
65
- informerState: InformerResourceState;
66
- /** Whether the informer is currently syncing */
52
+ create: import('@tanstack/react-query').UseMutateAsyncFunction<resourceModels.CreateResult, unknown, {
53
+ input?: any;
54
+ namespace?: string;
55
+ }, unknown>;
56
+ /** Current watch state for this resource type */
57
+ watchState: resourceModels.WatchState;
58
+ /** Whether the watch is currently syncing */
67
59
  isSyncing: boolean;
68
- /** Whether the informer has fully synced */
60
+ /** Whether the watch has fully synced */
69
61
  isSynced: boolean;
70
- /** Whether the informer encountered an error */
71
- informerError: boolean;
62
+ /** Whether the watch encountered an error */
63
+ watchError: boolean;
72
64
  };
73
65
  export {};
@@ -0,0 +1,28 @@
1
+ import { WatchConnectionSummary, WatchState } from '../../types/watch';
2
+ type UseWatchStateOptions = {
3
+ pluginID?: string;
4
+ connectionID: string;
5
+ enabled?: boolean;
6
+ };
7
+ /**
8
+ * useWatchState provides real-time watch state for a connection.
9
+ * It fetches the initial summary via Wails binding and subscribes to
10
+ * state change events for live updates.
11
+ *
12
+ * Events that arrive before the initial fetch completes are buffered
13
+ * and replayed once the query cache is populated, preventing the race
14
+ * condition where early SYNCED events are silently dropped.
15
+ */
16
+ export declare const useWatchState: ({ pluginID: explicitPluginID, connectionID, enabled, }: UseWatchStateOptions) => {
17
+ /** Full summary query result */
18
+ summary: import('@tanstack/react-query').UseQueryResult<WatchConnectionSummary, Error>;
19
+ /** Get the state of a specific resource type's watch */
20
+ getResourceState: (key: string) => WatchState | undefined;
21
+ /** Whether all registered watches have reached a terminal state */
22
+ isFullySynced: boolean;
23
+ /** Sync progress as a 0-1 fraction (terminal states / total) */
24
+ syncProgress: number;
25
+ /** Number of watches that encountered errors */
26
+ errorCount: number;
27
+ };
28
+ export {};