@omniviewdev/runtime 0.0.0-nightly.20260225

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 (111) hide show
  1. package/LICENSE +661 -0
  2. package/dist/Client-DGdSmmVk.js +585 -0
  3. package/dist/Client-ES-O5dCV.cjs +1 -0
  4. package/dist/api.cjs +1 -0
  5. package/dist/api.d.ts +13 -0
  6. package/dist/api.js +120 -0
  7. package/dist/context/drawer/BottomDrawerContext.d.ts +20 -0
  8. package/dist/context/drawer/RightDrawerContext.d.ts +15 -0
  9. package/dist/context/drawer/index.d.ts +3 -0
  10. package/dist/context/drawer/types.d.ts +222 -0
  11. package/dist/context/index.d.ts +5 -0
  12. package/dist/context/modal/ConfirmationModalContext.d.ts +12 -0
  13. package/dist/context/modal/index.d.ts +1 -0
  14. package/dist/context/operations/OperationsContext.d.ts +27 -0
  15. package/dist/context/plugins/PluginContext.d.ts +9 -0
  16. package/dist/context/plugins/PluginContextProvider.d.ts +5 -0
  17. package/dist/context/plugins/index.d.ts +3 -0
  18. package/dist/context/plugins/usePluginContext.d.ts +3 -0
  19. package/dist/context/settings/SettingsContext.d.ts +9 -0
  20. package/dist/context/settings/index.d.ts +1 -0
  21. package/dist/errors/index.d.ts +3 -0
  22. package/dist/errors/parseAppError.d.ts +51 -0
  23. package/dist/errors/parseAppError.test.d.ts +1 -0
  24. package/dist/errors/types.d.ts +40 -0
  25. package/dist/extensions/index.d.ts +2 -0
  26. package/dist/extensions/points/resource/helpers.d.ts +19 -0
  27. package/dist/extensions/points/resource/types.d.ts +6 -0
  28. package/dist/extensions/provider.d.ts +18 -0
  29. package/dist/extensions/registry.d.ts +30 -0
  30. package/dist/extensions/utils.d.ts +4 -0
  31. package/dist/hooks/connection/index.d.ts +4 -0
  32. package/dist/hooks/connection/useConnection.d.ts +37 -0
  33. package/dist/hooks/connection/useConnectionNamespaces.d.ts +20 -0
  34. package/dist/hooks/connection/useConnectionStatus.d.ts +29 -0
  35. package/dist/hooks/connection/useConnections.d.ts +18 -0
  36. package/dist/hooks/data/index.d.ts +1 -0
  37. package/dist/hooks/data/usePluginData.d.ts +11 -0
  38. package/dist/hooks/drawer/index.d.ts +2 -0
  39. package/dist/hooks/drawer/useBottomDrawer.d.ts +1 -0
  40. package/dist/hooks/drawer/useRightDrawer.d.ts +5 -0
  41. package/dist/hooks/exec/index.d.ts +1 -0
  42. package/dist/hooks/exec/useExecSession.d.ts +21 -0
  43. package/dist/hooks/index.d.ts +13 -0
  44. package/dist/hooks/logs/index.d.ts +1 -0
  45. package/dist/hooks/logs/useLogSession.d.ts +21 -0
  46. package/dist/hooks/metric/index.d.ts +3 -0
  47. package/dist/hooks/metric/useMetricProviders.d.ts +9 -0
  48. package/dist/hooks/metric/useMetricStream.d.ts +40 -0
  49. package/dist/hooks/metric/useResourceMetrics.d.ts +46 -0
  50. package/dist/hooks/modal/index.d.ts +1 -0
  51. package/dist/hooks/modal/useConfirmationModal.d.ts +5 -0
  52. package/dist/hooks/networker/index.d.ts +3 -0
  53. package/dist/hooks/networker/types.d.ts +50 -0
  54. package/dist/hooks/networker/usePortForwardSessions.d.ts +13 -0
  55. package/dist/hooks/networker/useResourcePortForwarder.d.ts +21 -0
  56. package/dist/hooks/operations/useOperations.d.ts +1 -0
  57. package/dist/hooks/resource/index.d.ts +13 -0
  58. package/dist/hooks/resource/useActiveSyncs.d.ts +16 -0
  59. package/dist/hooks/resource/useEditorSchemas.d.ts +22 -0
  60. package/dist/hooks/resource/useInformerState.d.ts +24 -0
  61. package/dist/hooks/resource/useResource.d.ts +74 -0
  62. package/dist/hooks/resource/useResourceActions.d.ts +69 -0
  63. package/dist/hooks/resource/useResourceAreaComponent.d.ts +9 -0
  64. package/dist/hooks/resource/useResourceGroups.d.ts +22 -0
  65. package/dist/hooks/resource/useResourceMutations.d.ts +58 -0
  66. package/dist/hooks/resource/useResourceSearch.d.ts +36 -0
  67. package/dist/hooks/resource/useResourceType.d.ts +22 -0
  68. package/dist/hooks/resource/useResourceTypes.d.ts +22 -0
  69. package/dist/hooks/resource/useResources.d.ts +73 -0
  70. package/dist/hooks/resource/useStreamAction.d.ts +21 -0
  71. package/dist/hooks/settings/index.d.ts +1 -0
  72. package/dist/hooks/settings/useSettings.d.ts +2 -0
  73. package/dist/hooks/snackbar/index.d.ts +1 -0
  74. package/dist/hooks/snackbar/useSnackbar.d.ts +24 -0
  75. package/dist/hooks/useResolvedPluginId.d.ts +8 -0
  76. package/dist/index.cjs +2 -0
  77. package/dist/index.d.ts +6 -0
  78. package/dist/index.js +2593 -0
  79. package/dist/models.cjs +1 -0
  80. package/dist/models.d.ts +1 -0
  81. package/dist/models.js +1915 -0
  82. package/dist/router/Link.d.ts +24 -0
  83. package/dist/router/index.d.ts +11 -0
  84. package/dist/router/usePluginRouter.d.ts +40 -0
  85. package/dist/runtime.cjs +1 -0
  86. package/dist/runtime.d.ts +1 -0
  87. package/dist/runtime.js +215 -0
  88. package/dist/types/app.d.ts +73 -0
  89. package/dist/types/extensions.d.ts +186 -0
  90. package/dist/types/index.d.ts +4 -0
  91. package/dist/types/informer.d.ts +49 -0
  92. package/dist/types/plugin.d.ts +5 -0
  93. package/dist/utils/activeSyncAggregator.d.ts +29 -0
  94. package/dist/utils/activeSyncAggregator.test.d.ts +1 -0
  95. package/dist/wailsjs/go/data/Client.d.ts +10 -0
  96. package/dist/wailsjs/go/devserver/DevServerManager.d.ts +22 -0
  97. package/dist/wailsjs/go/diagnostics/DiagnosticsClient.d.ts +18 -0
  98. package/dist/wailsjs/go/exec/Client.d.ts +26 -0
  99. package/dist/wailsjs/go/logs/Client.d.ts +16 -0
  100. package/dist/wailsjs/go/main/App.d.ts +8 -0
  101. package/dist/wailsjs/go/metric/Client.d.ts +12 -0
  102. package/dist/wailsjs/go/models.d.ts +894 -0
  103. package/dist/wailsjs/go/networker/Client.d.ts +14 -0
  104. package/dist/wailsjs/go/plugin/pluginManager.d.ts +52 -0
  105. package/dist/wailsjs/go/resource/Client.d.ts +68 -0
  106. package/dist/wailsjs/go/settings/Client.d.ts +14 -0
  107. package/dist/wailsjs/go/settings/provider.d.ts +46 -0
  108. package/dist/wailsjs/go/ui/Client.d.ts +6 -0
  109. package/dist/wailsjs/go/utils/Client.d.ts +2 -0
  110. package/dist/wailsjs/runtime/runtime.d.ts +249 -0
  111. package/package.json +68 -0
package/dist/api.js ADDED
@@ -0,0 +1,120 @@
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-DGdSmmVk.js";
2
+ function t(e) {
3
+ return window.go.utils.Client.DetectLanguage(e);
4
+ }
5
+ const L = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
6
+ __proto__: null,
7
+ DetectLanguage: t
8
+ }, Symbol.toStringTag, { value: "Module" }));
9
+ function i(e, n) {
10
+ return window.go.diagnostics.DiagnosticsClient.Debug(e, n);
11
+ }
12
+ function o(e, n) {
13
+ return window.go.diagnostics.DiagnosticsClient.Error(e, n);
14
+ }
15
+ function a(e, n) {
16
+ return window.go.diagnostics.DiagnosticsClient.Info(e, n);
17
+ }
18
+ function g(e, n, r) {
19
+ return window.go.diagnostics.DiagnosticsClient.Log(e, n, r);
20
+ }
21
+ function v(e) {
22
+ return window.go.diagnostics.DiagnosticsClient.ReadLog(e);
23
+ }
24
+ function s(e) {
25
+ return window.go.diagnostics.DiagnosticsClient.StartTail(e);
26
+ }
27
+ function u(e) {
28
+ return window.go.diagnostics.DiagnosticsClient.StopTail(e);
29
+ }
30
+ function l(e, n) {
31
+ return window.go.diagnostics.DiagnosticsClient.Warn(e, n);
32
+ }
33
+ const m = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
34
+ __proto__: null,
35
+ Debug: i,
36
+ Error: o,
37
+ Info: a,
38
+ Log: g,
39
+ ReadLog: v,
40
+ StartTail: s,
41
+ StopTail: u,
42
+ Warn: l
43
+ }, Symbol.toStringTag, { value: "Module" }));
44
+ function c(e, n) {
45
+ return window.go.devserver.DevServerManager.GetDevServerLogs(e, n);
46
+ }
47
+ function d(e) {
48
+ return window.go.devserver.DevServerManager.GetDevServerState(e);
49
+ }
50
+ function S(e) {
51
+ return window.go.devserver.DevServerManager.GetExternalPluginInfo(e);
52
+ }
53
+ function w(e) {
54
+ return window.go.devserver.DevServerManager.Initialize(e);
55
+ }
56
+ function D(e) {
57
+ return window.go.devserver.DevServerManager.IsManaged(e);
58
+ }
59
+ function f() {
60
+ return window.go.devserver.DevServerManager.ListDevServerStates();
61
+ }
62
+ function p(e) {
63
+ return window.go.devserver.DevServerManager.RestartDevServer(e);
64
+ }
65
+ function C() {
66
+ return window.go.devserver.DevServerManager.Shutdown();
67
+ }
68
+ function M(e) {
69
+ return window.go.devserver.DevServerManager.StartDevServer(e);
70
+ }
71
+ function b(e, n) {
72
+ return window.go.devserver.DevServerManager.StartDevServerForPath(e, n);
73
+ }
74
+ function _(e) {
75
+ return window.go.devserver.DevServerManager.StopDevServer(e);
76
+ }
77
+ const O = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
78
+ __proto__: null,
79
+ GetDevServerLogs: c,
80
+ 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: _
90
+ }, Symbol.toStringTag, { value: "Module" }));
91
+ function I() {
92
+ return window.go.main.App.GetOperatingSystem();
93
+ }
94
+ function P(e) {
95
+ return window.go.main.App.OpenFileSelectionDialog(e);
96
+ }
97
+ function y(e) {
98
+ return window.go.main.App.SaveFileDialog(e);
99
+ }
100
+ function F(e, n) {
101
+ return window.go.main.App.WriteFileContent(e, n);
102
+ }
103
+ 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
120
+ };
@@ -0,0 +1,20 @@
1
+ import { default as React } from 'react';
2
+ import { CreateTab, FocusTab, CloseDrawer, FullscreenDrawer, CloseTab, ResizeDrawer, BottomDrawerTab, CreateTabs, CloseTabs, ReorderTab, UpdateTab } from './types';
3
+ export type BottomDrawerContextType = {
4
+ height: number;
5
+ focused: number;
6
+ tabs: BottomDrawerTab[];
7
+ createTab: CreateTab;
8
+ createTabs: CreateTabs;
9
+ updateTab: UpdateTab;
10
+ focusTab: FocusTab;
11
+ closeTab: CloseTab;
12
+ closeTabs: CloseTabs;
13
+ reorderTab: ReorderTab;
14
+ resizeDrawer: ResizeDrawer;
15
+ closeDrawer: CloseDrawer;
16
+ fullscreenDrawer: FullscreenDrawer;
17
+ };
18
+ export declare const defaultState: BottomDrawerContextType;
19
+ export declare const BottomDrawerContext: React.Context<BottomDrawerContextType>;
20
+ export default BottomDrawerContext;
@@ -0,0 +1,15 @@
1
+ import { DrawerComponent, DrawerContext } from './types';
2
+ export type ShowResourceSidebarParams = {
3
+ pluginID: string;
4
+ connectionID: string;
5
+ resourceKey: string;
6
+ resourceID: string;
7
+ namespace?: string;
8
+ };
9
+ export interface RightDrawerContextType {
10
+ openDrawer: (component: DrawerComponent, ctx: DrawerContext) => void;
11
+ closeDrawer: () => void;
12
+ showResourceSidebar: (params: ShowResourceSidebarParams) => void;
13
+ isOpen: boolean;
14
+ }
15
+ export declare const RightDrawerContext: import('react').Context<RightDrawerContextType | undefined>;
@@ -0,0 +1,3 @@
1
+ export * from './types';
2
+ export * from './BottomDrawerContext';
3
+ export * from './RightDrawerContext';
@@ -0,0 +1,222 @@
1
+ import { ReactNode } from 'react';
2
+ /**
3
+ * A factory function that produces a DrawerComponent for a given resource.
4
+ * Plugins export these keyed by resource key so the host can build the full
5
+ * sidebar (views + actions) for linked-resource navigation, ref-chip clicks, etc.
6
+ *
7
+ * The factory receives a close callback so actions can dismiss the drawer.
8
+ */
9
+ export type DrawerFactory<T = any> = (closeDrawer: () => void) => DrawerComponent<T>;
10
+ export type DrawerComponent<T = any> = {
11
+ /**
12
+ * The title to display in the drawer header
13
+ */
14
+ title: string | ReactNode;
15
+ /**
16
+ * The icon to display in the drawer header to the left of the the title
17
+ */
18
+ icon?: ReactNode;
19
+ /**
20
+ * The various views to display within the drawer. This should be used to
21
+ * allow other plugins to extend the current functionality.
22
+ *
23
+ * There must be at least one view within the drawer.
24
+ */
25
+ views: Array<DrawerComponentView<T>>;
26
+ /**
27
+ * Functions that can be triggered upon clicking the component. These items
28
+ * do not change what is in the viewport of the drawer, but instead trigger
29
+ * other actions (such as starting a terminal session, modifying a resource,
30
+ * etc.)
31
+ *
32
+ * There must be at least one action within the drawer.
33
+ */
34
+ actions: Array<DrawerComponentAction<T>>;
35
+ };
36
+ export type DrawerComponentView<T = any> = {
37
+ /**
38
+ * The title to display for the drawer header tooltip
39
+ */
40
+ title: string | ReactNode;
41
+ /**
42
+ * The icon to display in the drawer's pages section
43
+ */
44
+ icon?: ReactNode;
45
+ /**
46
+ * The component to display in the viewport upon click.
47
+ *
48
+ * When a plugin is extending with a page, the component may choose to
49
+ * pass data about what is inside the component. This is typically the case
50
+ * with drawers that display resource information.
51
+ */
52
+ component: (ctx: DrawerContext<T>) => ReactNode;
53
+ };
54
+ /**
55
+ * An action that can be run on a resource.
56
+ */
57
+ export type DrawerComponentAction<T = any> = {
58
+ /**
59
+ * The title to display for the drawer header tooltip
60
+ */
61
+ title: string | ReactNode;
62
+ /**
63
+ * The icon to display in the drawer header to the left of the the title
64
+ */
65
+ icon?: ReactNode;
66
+ /**
67
+ * Determines whether the action should be shown. This is useful when the action
68
+ * is only applicable if the resource has certain parameters, should only be
69
+ * done for certain connections, or should be available only for certain resource
70
+ * types.
71
+ */
72
+ enabled?: ((ctx: DrawerContext<T>) => boolean) | boolean;
73
+ /**
74
+ * The function to run for the drawer component on click.
75
+ *
76
+ * When a plugin is extending with an action, the component may choose to
77
+ * pass data about what is inside the component. This is typically the case
78
+ * with drawers that display resource information.
79
+ */
80
+ action?: (ctx: DrawerContext<T>) => void;
81
+ /**
82
+ * Have the action provide a list of actions underneath when clicked rather than
83
+ * initiation the action directly on click.
84
+ */
85
+ list?: ((ctx: DrawerContext<T>) => Array<DrawerComponentActionListItem>) | Array<DrawerComponentActionListItem>;
86
+ };
87
+ /**
88
+ * Displays a list item under the action
89
+ */
90
+ export type DrawerComponentActionListItem<T = any> = {
91
+ /**
92
+ * The title to display for the drawer header tooltip
93
+ */
94
+ title: string | ReactNode;
95
+ /**
96
+ * The icon to display in list item to the left of the the name
97
+ */
98
+ icon?: ReactNode;
99
+ /**
100
+ * The function to run for the action list item on click.
101
+ *
102
+ * When a plugin is extending with an action, the component may choose to
103
+ * pass data about what is inside the component. This is typically the case
104
+ * with drawers that display resource information.
105
+ */
106
+ action: (ctx: DrawerContext<T>) => void;
107
+ };
108
+ /**
109
+ * Context that can be passed to the drawer instantiation
110
+ */
111
+ export type DrawerContext<T = any> = {
112
+ /**
113
+ * Generic data supplied to the drawer. For resource displays, this should be
114
+ * the generic object data for the resource in question.
115
+ */
116
+ data?: T;
117
+ /**
118
+ * Resource information (if this drawer is being displayed as part of a resource)
119
+ */
120
+ resource?: {
121
+ /**
122
+ * The id of the resource in question
123
+ */
124
+ id: string;
125
+ /**
126
+ * The resource key that defines the globally-recognizable key
127
+ */
128
+ key: string;
129
+ /**
130
+ * A connection id, if this drawer is displaying something in the context
131
+ * of a connection.
132
+ */
133
+ connectionID: string;
134
+ /**
135
+ * The plugin that owns this resource. When provided, host-level features
136
+ * like the Events tab can be injected automatically.
137
+ */
138
+ pluginID?: string;
139
+ };
140
+ };
141
+ export type BottomDrawerTab = {
142
+ id: string;
143
+ title: string;
144
+ createdAt: Date;
145
+ updatedAt: Date;
146
+ icon?: string | React.ReactNode;
147
+ variant: 'terminal' | 'logs' | 'editor' | 'browser' | 'file' | 'devbuild' | 'other';
148
+ properties?: Record<string, unknown>;
149
+ };
150
+ export type FindTabOpts = {
151
+ /** ID of the tab to focus, if known */
152
+ id?: string;
153
+ /** Index of the tab, if known. If provided, it will be prioritized over all other options */
154
+ index?: number;
155
+ /** Properties to match against */
156
+ properties?: Record<string, unknown>;
157
+ /**
158
+ * Customize the behavior when multiple tabs match the properties. The options are:
159
+ * - 'first': Perform on the first matching tab.
160
+ * - 'newest': Perform the most recently created tab.
161
+ * - 'oldest': Perform the oldest tab
162
+ * - 'none': Do nothing
163
+ */
164
+ actionOnMultiple?: 'first' | 'newest' | 'oldest' | 'none';
165
+ };
166
+ export type CreateTabOpts = Pick<BottomDrawerTab, 'title' | 'icon' | 'variant' | 'properties'> & {
167
+ id?: string;
168
+ };
169
+ /**
170
+ * Create a new tab in the bottom drawer.
171
+ */
172
+ export type CreateTab = (opts: CreateTabOpts) => void;
173
+ /**
174
+ * Create multiple tabs in the bottom drawer.
175
+ */
176
+ export type CreateTabs = (opts: CreateTabOpts[]) => void;
177
+ /**
178
+ * Focus on a tab in the bottom drawer. If multiple tabs match the search criteria, the 'newest' tab will be focused.
179
+ */
180
+ export type FocusTab = (opts: FindTabOpts) => void;
181
+ /**
182
+ * Reorder a tab in the bottom drawer, given the 'from' and 'to' indexes.
183
+ */
184
+ export type ReorderTab = (from: number, to: number) => void;
185
+ /**
186
+ * Close a tab in the bottom drawer. If multiple tabs match the search criteria, no tabs will be closed.
187
+ */
188
+ export type CloseTab = (opts: FindTabOpts) => void;
189
+ /**
190
+ * Close multiple tabs in the bottom drawer.
191
+ */
192
+ export type CloseTabs = (opts: FindTabOpts[]) => void;
193
+ /**
194
+ * Resize the height of the bottom drawer programatically, in pixels.
195
+ */
196
+ export type ResizeDrawer = (height: number) => void;
197
+ /**
198
+ * Expand the bottom drawer to take up the full height of view.
199
+ */
200
+ export type FullscreenDrawer = () => void;
201
+ /**
202
+ * Collapse the bottom drawer to its default height.
203
+ */
204
+ export type CloseDrawer = () => void;
205
+ /**
206
+ * Options for updating an existing tab in the bottom drawer.
207
+ * The tab is located using FindTabOpts, then the remaining fields are applied.
208
+ */
209
+ export type UpdateTabOpts = {
210
+ /** New ID to replace the existing tab ID */
211
+ id?: string;
212
+ /** New title */
213
+ title?: string;
214
+ /** New icon */
215
+ icon?: string | React.ReactNode;
216
+ /** Properties to merge into the tab's existing properties */
217
+ properties?: Record<string, unknown>;
218
+ };
219
+ /**
220
+ * Update an existing tab in the bottom drawer, located by FindTabOpts.
221
+ */
222
+ export type UpdateTab = (find: FindTabOpts, updates: UpdateTabOpts) => void;
@@ -0,0 +1,5 @@
1
+ export * from './plugins';
2
+ export * from './settings';
3
+ export * from './drawer';
4
+ export * from './modal';
5
+ export * from './operations/OperationsContext';
@@ -0,0 +1,12 @@
1
+ import { default as React } from 'react';
2
+ export type ConfirmationModalProps = {
3
+ title?: string | React.ReactNode;
4
+ body?: string | React.ReactNode;
5
+ confirmLabel?: string;
6
+ cancelLabel?: string;
7
+ onConfirm: () => Promise<void> | void;
8
+ };
9
+ export type ConfirmationModalContextType = {
10
+ show: (props: ConfirmationModalProps) => void;
11
+ };
12
+ export declare const ConfirmationModalContext: React.Context<ConfirmationModalContextType | undefined>;
@@ -0,0 +1 @@
1
+ export * from './ConfirmationModalContext';
@@ -0,0 +1,27 @@
1
+ import { default as React } from 'react';
2
+ export type Operation = {
3
+ id: string;
4
+ label: string;
5
+ resourceKey: string;
6
+ resourceName: string;
7
+ namespace: string;
8
+ connectionID: string;
9
+ status: 'running' | 'completed' | 'error';
10
+ progress?: {
11
+ ready: number;
12
+ desired: number;
13
+ };
14
+ message?: string;
15
+ startedAt: number;
16
+ completedAt?: number;
17
+ };
18
+ export type OperationsContextType = {
19
+ operations: Operation[];
20
+ addOperation: (op: Operation) => void;
21
+ updateOperation: (id: string, updates: Partial<Operation>) => void;
22
+ removeOperation: (id: string) => void;
23
+ };
24
+ export declare const OperationsContext: React.Context<OperationsContextType | undefined>;
25
+ export declare const OperationsProvider: React.FC<{
26
+ children: React.ReactNode;
27
+ }>;
@@ -0,0 +1,9 @@
1
+ import { default as React } from 'react';
2
+ import { config } from '../../wailsjs/go/models';
3
+ export interface PluginContextType {
4
+ /** The runtime instance ID for this plugin (e.g. "kubernetes-dev" or "kubernetes"). */
5
+ pluginId: string;
6
+ meta: config.PluginMeta;
7
+ settings: Record<string, any>;
8
+ }
9
+ export declare const PluginContext: React.Context<PluginContextType | undefined>;
@@ -0,0 +1,5 @@
1
+ import { default as React } from 'react';
2
+ export type PluginContextProviderProps = {
3
+ pluginId: string;
4
+ };
5
+ export declare function PluginContextProvider(props: React.PropsWithChildren<PluginContextProviderProps>): React.ReactElement;
@@ -0,0 +1,3 @@
1
+ export * from './PluginContext';
2
+ export * from './PluginContextProvider';
3
+ export * from './usePluginContext';
@@ -0,0 +1,3 @@
1
+ import { PluginContextType } from './PluginContext';
2
+ export declare function usePluginContext(): PluginContextType;
3
+ export declare function usePluginSettings(): Record<string, any>;
@@ -0,0 +1,9 @@
1
+ import { default as React } from 'react';
2
+ export interface SettingsContextType {
3
+ settings: Record<string, any>;
4
+ reload: () => void;
5
+ }
6
+ export declare const SettingsContext: React.Context<SettingsContextType | undefined>;
7
+ export declare const SettingsProvider: ({ children }: {
8
+ children: React.ReactNode;
9
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './SettingsContext';
@@ -0,0 +1,3 @@
1
+ export { parseAppError, isCancelledError, actionToSnackbar, createErrorHandler, showAppError } from './parseAppError';
2
+ export { ErrorTypes } from './types';
3
+ export type { AppError, AppErrorAction } from './types';
@@ -0,0 +1,51 @@
1
+ import { AppError, AppErrorAction } from './types';
2
+ /**
3
+ * Parse any error shape from the Wails boundary into a structured AppError.
4
+ *
5
+ * Handles:
6
+ * - JSON string from AppError.Error() → parsed into typed AppError
7
+ * - Plain string from old fmt.Errorf → wrapped as internal error
8
+ * - Error object → extracts .message, tries JSON parse
9
+ * - null/undefined → generic "Unknown error"
10
+ *
11
+ * NEVER returns null.
12
+ */
13
+ export declare function parseAppError(error: unknown): AppError;
14
+ /**
15
+ * Detects both new format (type === "omniview:cancelled") and legacy ("cancelled" string).
16
+ */
17
+ export declare function isCancelledError(error: unknown): boolean;
18
+ /**
19
+ * Converts an AppErrorAction into a { label, onClick } suitable for snackbar actions.
20
+ */
21
+ export declare function actionToSnackbar(action: AppErrorAction): {
22
+ label: string;
23
+ onClick: () => void;
24
+ };
25
+ type ShowSnackbarFn = (options: {
26
+ message: string;
27
+ status: 'error' | 'warning' | 'info' | 'success' | 'default';
28
+ details?: string;
29
+ actions?: Array<{
30
+ label: string;
31
+ onClick: () => void;
32
+ }>;
33
+ }) => void;
34
+ /**
35
+ * Show a structured error snackbar from any Wails error.
36
+ * Parses the error, suppresses cancellations, and displays
37
+ * the full title/detail/suggestions/actions in the snackbar.
38
+ *
39
+ * @param showSnackbar - The snackbar function
40
+ * @param error - The raw error from Wails
41
+ * @param contextMessage - Optional context (e.g. "Failed to delete pod-1")
42
+ */
43
+ export declare function showAppError(showSnackbar: ShowSnackbarFn, error: unknown, contextMessage?: string): void;
44
+ /**
45
+ * Creates a drop-in onError handler that:
46
+ * - Suppresses cancelled errors
47
+ * - Parses structured AppError fields
48
+ * - Shows a snackbar with title, detail, suggestions, and actions
49
+ */
50
+ export declare function createErrorHandler(showSnackbar: ShowSnackbarFn, fallbackTitle: string): (error: unknown) => void;
51
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,40 @@
1
+ /** A frontend-renderable action attached to a structured error. */
2
+ export interface AppErrorAction {
3
+ type: 'navigate' | 'retry' | 'open-url' | 'copy';
4
+ label: string;
5
+ target?: string;
6
+ }
7
+ /** Structured error matching the Go apperror.AppError JSON shape. */
8
+ export interface AppError {
9
+ type: string;
10
+ title: string;
11
+ status: number;
12
+ detail: string;
13
+ instance?: string;
14
+ suggestions?: string[];
15
+ actions?: AppErrorAction[];
16
+ }
17
+ /** Error type URI constants matching Go apperror/types.go. */
18
+ export declare const ErrorTypes: {
19
+ readonly PLUGIN_NOT_FOUND: "omniview:plugin/not-found";
20
+ readonly PLUGIN_NOT_LOADED: "omniview:plugin/not-loaded";
21
+ readonly PLUGIN_ALREADY_LOADED: "omniview:plugin/already-loaded";
22
+ readonly PLUGIN_INSTALL_FAILED: "omniview:plugin/install-failed";
23
+ readonly PLUGIN_LOAD_FAILED: "omniview:plugin/load-failed";
24
+ readonly PLUGIN_BUILD_FAILED: "omniview:plugin/build-failed";
25
+ readonly SETTINGS_MISSING_CONFIG: "omniview:settings/missing-config";
26
+ readonly SETTINGS_INVALID_CONFIG: "omniview:settings/invalid-config";
27
+ readonly RESOURCE_NOT_FOUND: "omniview:resource/not-found";
28
+ readonly RESOURCE_FORBIDDEN: "omniview:resource/forbidden";
29
+ readonly RESOURCE_UNAUTHORIZED: "omniview:resource/unauthorized";
30
+ readonly RESOURCE_CONFLICT: "omniview:resource/conflict";
31
+ readonly RESOURCE_TIMEOUT: "omniview:resource/timeout";
32
+ readonly CONNECTION_NOT_FOUND: "omniview:connection/not-found";
33
+ readonly CONNECTION_FAILED: "omniview:connection/failed";
34
+ readonly SESSION_NOT_FOUND: "omniview:session/not-found";
35
+ readonly SESSION_FAILED: "omniview:session/failed";
36
+ readonly CANCELLED: "omniview:cancelled";
37
+ readonly INTERNAL: "omniview:internal";
38
+ readonly VALIDATION: "omniview:validation";
39
+ readonly NOT_IMPLEMENTED: "omniview:not-implemented";
40
+ };
@@ -0,0 +1,2 @@
1
+ export * from './provider';
2
+ export * from './registry';
@@ -0,0 +1,19 @@
1
+ /**
2
+ * A resource parts object for matching a resource key.
3
+ */
4
+ type ResourceParts = {
5
+ /** The group the resource belongs to */
6
+ group: string | string[];
7
+ /** The version of the resource */
8
+ version: string | string[];
9
+ /** The kind of the resource */
10
+ kind: string | string[];
11
+ };
12
+ /**
13
+ * Check if a resource matches the given parts.
14
+ * @param extensionId The extension ID to cache the result for
15
+ * @param resource The resource to check
16
+ * @param parts The parts to match
17
+ */
18
+ export declare const matchesResource: (cache: Map<string, boolean>, extensionId: string, resource: string, matcher: string | string[] | RegExp | ResourceParts) => boolean;
19
+ export {};
@@ -0,0 +1,6 @@
1
+ export type ResourceViewRegistry<T> = {
2
+ register(opts: T): void;
3
+ unregister(id: string): void;
4
+ get(id: string): T | undefined;
5
+ getViews(plugin: string, resource: string): T[];
6
+ };
@@ -0,0 +1,18 @@
1
+ import { default as React } from 'react';
2
+ import { ExtensionPointRegistry } from './registry';
3
+ import { ExtensionPointStore } from '../types';
4
+ type ExtensionProviderProps = {
5
+ /** Allow passing in a custom registry, purely for testing purposes */
6
+ registry: ExtensionPointRegistry;
7
+ children: React.ReactNode;
8
+ };
9
+ export type ExtensionProviderType = React.FC<ExtensionProviderProps>;
10
+ export declare const useExtensionRegistry: () => ExtensionPointRegistry | undefined;
11
+ export declare const useExtensionPoint: <T>(id: string) => ExtensionPointStore<T> | undefined;
12
+ export declare const useExtensionPointComponents: <T>(id: string) => Array<React.Component<T>>;
13
+ /**
14
+ * ExtensionProvider houses the various locations where components from other plugins can inject
15
+ * functionality (such as components).
16
+ */
17
+ export declare const ExtensionProvider: React.FC<ExtensionProviderProps>;
18
+ export default ExtensionProvider;
@@ -0,0 +1,30 @@
1
+ import { CreateExtensionPointOptions, ExtensionPointStore, ExtensionPointSettings } from '../types/extensions';
2
+ type CreateExtensionPointRegistryOptions = {
3
+ initialStores: Array<CreateExtensionPointOptions<any>>;
4
+ };
5
+ /**
6
+ * A registry for extension points.
7
+ */
8
+ export declare class ExtensionPointRegistry {
9
+ private store;
10
+ constructor({ initialStores }: CreateExtensionPointRegistryOptions);
11
+ /**
12
+ * Add a new extension point to the registry. If the extension point already exists, it will not be
13
+ * added again.
14
+ * @param opts The settings for the extension point
15
+ */
16
+ addExtensionPoint<T>(opts: ExtensionPointSettings): void;
17
+ /**
18
+ * Get an extension point from the registry.
19
+ */
20
+ getExtensionPoint<T>(name: string): ExtensionPointStore<T> | undefined;
21
+ /**
22
+ * List all extension points in the registry.
23
+ */
24
+ listExtensionPointIds(): string[];
25
+ /**
26
+ * List all extensions in the registry.
27
+ */
28
+ listExtensionPoints(): ExtensionPointSettings[];
29
+ }
30
+ export {};
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Validate the extension name to ensure it matches
3
+ */
4
+ export declare const validateExtensionName: (value: any) => string;
@@ -0,0 +1,4 @@
1
+ export * from './useConnection';
2
+ export * from './useConnections';
3
+ export * from './useConnectionNamespaces';
4
+ export * from './useConnectionStatus';