@omniviewdev/runtime 0.7.2 → 0.7.4
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.
- package/dist/context/drawer/RightDrawerContext.d.ts +3 -1
- package/dist/context/plugins/PluginContextProvider.d.ts +3 -1
- package/dist/index.cjs +4 -4
- package/dist/index.d.ts +3 -0
- package/dist/index.js +942 -896
- package/dist/resourceIcons.d.ts +19 -0
- package/dist/resourceQueryKeys.d.ts +6 -0
- package/dist/search.d.ts +159 -0
- package/package.json +3 -3
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ComponentType, ReactNode } from 'react';
|
|
2
|
+
export declare const RESOURCE_ICON_EXTENSION_POINT_ID = "omniview/resource/icons";
|
|
3
|
+
export type ResourceIconProps = {
|
|
4
|
+
size?: number;
|
|
5
|
+
className?: string;
|
|
6
|
+
'aria-hidden'?: boolean | 'true' | 'false';
|
|
7
|
+
};
|
|
8
|
+
/** Resource keys are opaque outside the contributing plugin. */
|
|
9
|
+
export type ResourceIconSetV1 = {
|
|
10
|
+
schemaVersion: 1;
|
|
11
|
+
resolve(resourceKey: string): ComponentType<ResourceIconProps> | undefined;
|
|
12
|
+
};
|
|
13
|
+
export type ResourceIconComponentProps = ResourceIconProps & {
|
|
14
|
+
pluginId: string;
|
|
15
|
+
resourceKey: string;
|
|
16
|
+
fallback?: ReactNode;
|
|
17
|
+
};
|
|
18
|
+
/** Uses only sets registered by the requested plugin; registry mutations invalidate rendering. */
|
|
19
|
+
export declare function ResourceIcon({ pluginId, resourceKey, fallback, ...props }: ResourceIconComponentProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Shared keys for native ListResult/GetResult snapshots, never display labels or search text. */
|
|
2
|
+
export declare const resourceQueryKeys: {
|
|
3
|
+
scope: (pluginId: string, connectionId: string, resourceKey: string) => readonly [string, string, string];
|
|
4
|
+
list: (pluginId: string, connectionId: string, resourceKey: string, namespaces?: readonly string[]) => readonly [string, string, string, readonly string[], "list"];
|
|
5
|
+
resource: (pluginId: string, connectionId: string, resourceKey: string, resourceId: string, namespace?: string) => readonly [string, string, string, string, string];
|
|
6
|
+
};
|
package/dist/search.d.ts
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
/** Native IDs remain opaque. `namespace` is a real provider namespace, never a synthetic region or node. */
|
|
3
|
+
export type SearchScopeV1 = {
|
|
4
|
+
kind: 'connection';
|
|
5
|
+
pluginId: string;
|
|
6
|
+
connectionId: string;
|
|
7
|
+
label: string;
|
|
8
|
+
} | {
|
|
9
|
+
kind: 'resource-type';
|
|
10
|
+
pluginId: string;
|
|
11
|
+
connectionId: string;
|
|
12
|
+
resourceKey: string;
|
|
13
|
+
label: string;
|
|
14
|
+
namespaces?: readonly string[];
|
|
15
|
+
/** Display label only; never part of native lookup identity. */
|
|
16
|
+
scopeLabel?: string;
|
|
17
|
+
} | {
|
|
18
|
+
kind: 'resource';
|
|
19
|
+
pluginId: string;
|
|
20
|
+
connectionId: string;
|
|
21
|
+
resourceKey: string;
|
|
22
|
+
resourceId: string;
|
|
23
|
+
namespace: string;
|
|
24
|
+
/** Optional immutable incarnation, validated by the owning provider. */
|
|
25
|
+
uid?: string;
|
|
26
|
+
label: string;
|
|
27
|
+
scopeLabel?: string;
|
|
28
|
+
};
|
|
29
|
+
/** Stable provider-owned action ID. `query` carries literal search text, not arbitrary action parameters. */
|
|
30
|
+
export type SearchActionReferenceV1 = {
|
|
31
|
+
id: string;
|
|
32
|
+
target: SearchScopeV1;
|
|
33
|
+
query?: string;
|
|
34
|
+
/** Permit connection recovery without dropping resource or resource-type scopes. */
|
|
35
|
+
recovery?: 'connection';
|
|
36
|
+
};
|
|
37
|
+
export type SearchExecutionContextV1 = {
|
|
38
|
+
signal: AbortSignal;
|
|
39
|
+
generation: number;
|
|
40
|
+
openResource(target: Extract<SearchScopeV1, {
|
|
41
|
+
kind: 'resource';
|
|
42
|
+
}>): Promise<void>;
|
|
43
|
+
navigate(target: NavigationTargetV1): void;
|
|
44
|
+
};
|
|
45
|
+
export type SearchProviderStatusV1 = 'ready' | 'disconnected' | 'connecting' | 'authentication-required' | 'forbidden' | 'unavailable' | 'partial';
|
|
46
|
+
export type AvailabilityV1 = {
|
|
47
|
+
state: 'enabled';
|
|
48
|
+
} | {
|
|
49
|
+
state: 'disabled';
|
|
50
|
+
reason: string;
|
|
51
|
+
};
|
|
52
|
+
export type SettingTargetV1 = {
|
|
53
|
+
section: 'core';
|
|
54
|
+
categoryId: string;
|
|
55
|
+
settingId?: string;
|
|
56
|
+
} | {
|
|
57
|
+
section: 'plugins';
|
|
58
|
+
pluginId: string;
|
|
59
|
+
settingId?: string;
|
|
60
|
+
} | {
|
|
61
|
+
section: 'extensions';
|
|
62
|
+
};
|
|
63
|
+
export type NavigationTargetV1 = {
|
|
64
|
+
kind: 'core';
|
|
65
|
+
path: '/' | '/plugins';
|
|
66
|
+
} | {
|
|
67
|
+
kind: 'plugin';
|
|
68
|
+
pluginId: string;
|
|
69
|
+
path: string;
|
|
70
|
+
};
|
|
71
|
+
export type HostCommandV1 = {
|
|
72
|
+
kind: 'reload-connections';
|
|
73
|
+
pluginId: string;
|
|
74
|
+
};
|
|
75
|
+
export type SearchEntryV1 = {
|
|
76
|
+
schemaVersion: 1;
|
|
77
|
+
description?: string;
|
|
78
|
+
keywords?: readonly string[];
|
|
79
|
+
availability?: AvailabilityV1;
|
|
80
|
+
scope?: SearchScopeV1;
|
|
81
|
+
} & ({
|
|
82
|
+
kind: 'command';
|
|
83
|
+
command: HostCommandV1;
|
|
84
|
+
} | {
|
|
85
|
+
kind: 'setting';
|
|
86
|
+
target: SettingTargetV1;
|
|
87
|
+
} | {
|
|
88
|
+
kind: 'navigation';
|
|
89
|
+
target: NavigationTargetV1;
|
|
90
|
+
} | {
|
|
91
|
+
kind: 'action';
|
|
92
|
+
action: SearchActionReferenceV1;
|
|
93
|
+
});
|
|
94
|
+
export type SearchProviderItemV1 = {
|
|
95
|
+
id: string;
|
|
96
|
+
label: string;
|
|
97
|
+
value: SearchEntryV1;
|
|
98
|
+
};
|
|
99
|
+
export type SearchProviderResponseV1 = {
|
|
100
|
+
items: readonly SearchProviderItemV1[];
|
|
101
|
+
completion: 'complete' | 'truncated';
|
|
102
|
+
status?: SearchProviderStatusV1;
|
|
103
|
+
message?: string;
|
|
104
|
+
};
|
|
105
|
+
export type SearchProviderRequestV1 = {
|
|
106
|
+
query: string;
|
|
107
|
+
signal: AbortSignal;
|
|
108
|
+
limit: number;
|
|
109
|
+
scopes: readonly SearchScopeV1[];
|
|
110
|
+
generation: number;
|
|
111
|
+
};
|
|
112
|
+
export type SearchProviderV1 = {
|
|
113
|
+
schemaVersion: 1;
|
|
114
|
+
kind: 'provider';
|
|
115
|
+
/** Headless action/dialog root. Receives the owner's plugin context; memo and lazy components work. */
|
|
116
|
+
Context?: ComponentType;
|
|
117
|
+
connectionTarget?: (connectionID: string) => NavigationTargetV1;
|
|
118
|
+
/** Pure synchronous routing before bounded scheduling. Return false for unsupported scope depths. */
|
|
119
|
+
supportsScope?: (scopes: readonly SearchScopeV1[]) => boolean;
|
|
120
|
+
/** Defaults to host. `connectionTarget` changes navigation, not recovery ownership. */
|
|
121
|
+
connectionRecovery?: 'host' | 'provider';
|
|
122
|
+
/** Validate provider-specific object identity after the host's native Get. Required when a UID is supplied. */
|
|
123
|
+
validateResource?: (target: Extract<SearchScopeV1, {
|
|
124
|
+
kind: 'resource';
|
|
125
|
+
}>, data: unknown) => boolean;
|
|
126
|
+
/** Cancellable, side-effect-free discovery. Respect limit and report partial/truncated results honestly. */
|
|
127
|
+
search(request: SearchProviderRequestV1): Promise<SearchProviderResponseV1>;
|
|
128
|
+
/** Revalidate native identity and permissions here; the host never confirms destructive actions for plugins. */
|
|
129
|
+
executeAction?: (action: SearchActionReferenceV1, context: SearchExecutionContextV1) => Promise<void | {
|
|
130
|
+
keepOpen: true;
|
|
131
|
+
}>;
|
|
132
|
+
validateAction?: (action: SearchActionReferenceV1, context: SearchExecutionContextV1) => Promise<boolean>;
|
|
133
|
+
};
|
|
134
|
+
/** Action references are executable only as responses from their owning provider. */
|
|
135
|
+
export type GlobalSearchContributionV1 = Exclude<SearchEntryV1, {
|
|
136
|
+
kind: 'action';
|
|
137
|
+
}> | SearchProviderV1;
|
|
138
|
+
/** Plugin-relative route data supplied by the host, without provider-specific parameter assumptions. */
|
|
139
|
+
export type SearchRouteContextV1 = {
|
|
140
|
+
pluginId: string;
|
|
141
|
+
params: Readonly<Record<string, string | undefined>>;
|
|
142
|
+
pathname: string;
|
|
143
|
+
search: string;
|
|
144
|
+
};
|
|
145
|
+
/** Attach to React Router's route `handle`. Only connections seed automatic scope; null explicitly opts out. */
|
|
146
|
+
export type SearchRouteHandleV1 = {
|
|
147
|
+
searchScope?: Extract<SearchScopeV1, {
|
|
148
|
+
kind: 'connection';
|
|
149
|
+
}> | null | ((context: SearchRouteContextV1) => Extract<SearchScopeV1, {
|
|
150
|
+
kind: 'connection';
|
|
151
|
+
}> | null | undefined);
|
|
152
|
+
};
|
|
153
|
+
/** Host-owned event; plugins request search without installing global key listeners. */
|
|
154
|
+
export declare const GLOBAL_SEARCH_OPEN_EVENT = "omniview/global-search/open";
|
|
155
|
+
/** Omitted scope follows the active route context; null explicitly searches everywhere. */
|
|
156
|
+
export type OpenGlobalSearchOptions = {
|
|
157
|
+
scope?: SearchScopeV1 | null;
|
|
158
|
+
};
|
|
159
|
+
export declare function openGlobalSearch(options?: OpenGlobalSearchOptions): void;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"author": "Omniview",
|
|
3
3
|
"license": "AGPL-3.0-only",
|
|
4
4
|
"name": "@omniviewdev/runtime",
|
|
5
|
-
"version": "0.7.
|
|
5
|
+
"version": "0.7.4",
|
|
6
6
|
"description": "Runtime shared library for Omniview",
|
|
7
7
|
"sideEffects": false,
|
|
8
8
|
"type": "module",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"omniview"
|
|
53
53
|
],
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@omniviewdev/base-ui": "~0.7.
|
|
55
|
+
"@omniviewdev/base-ui": "~0.7.1",
|
|
56
56
|
"@tanstack/react-query": "^5.76.1",
|
|
57
57
|
"@types/node": "^25.5.0",
|
|
58
58
|
"@types/react": "^19.0.0",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"vite-plugin-dts": "^4.5.3"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
|
-
"@omniviewdev/base-ui": "~0.7.
|
|
69
|
+
"@omniviewdev/base-ui": "~0.7.1"
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
72
|
"@wailsio/runtime": "3.0.0-beta.34",
|