@clipbus/plugin-sdk 0.9.8 → 0.10.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.
- package/API.md +94 -27
- package/CHANGELOG.md +84 -0
- package/README.md +11 -3
- package/SPECIFICATION.md +3 -2
- package/dist/dom/index.cjs +29 -34
- package/dist/dom/index.js +29 -34
- package/dist/dom/topicAdapter.d.ts +1 -1
- package/dist/generated/capabilities.generated.d.ts +355 -0
- package/dist/generated/data.generated.d.ts +33 -0
- package/dist/generated/hostClients.generated.d.ts +8 -5
- package/dist/generated/hostEvents.generated.d.ts +68 -0
- package/dist/generated/nodeIPC.generated.d.ts +106 -0
- package/dist/generated/{runtime.definePlugin.generated.d.ts → runtime.registry.generated.d.ts} +2 -2
- package/dist/generated/ui.clipbus.generated.d.ts +19 -20
- package/dist/generated/wireConstants.generated.d.ts +21 -0
- package/dist/internal/capabilities.d.ts +1 -1
- package/dist/internal/hostEvents.d.ts +15 -0
- package/dist/internal/pluginCall.d.ts +11 -0
- package/dist/internal/pluginContext.d.ts +6 -0
- package/dist/preview/index.cjs +41 -48
- package/dist/preview/index.js +41 -48
- package/dist/preview/wire.d.ts +2 -2
- package/dist/runtime/defineMessage.d.ts +1 -1
- package/dist/runtime/definePlugin.d.ts +2 -0
- package/dist/runtime/index.cjs +10 -82
- package/dist/runtime/index.d.cts +7 -1
- package/dist/runtime/index.d.ts +7 -1
- package/dist/runtime/index.js +9 -80
- package/dist/ui/index.cjs +107 -169
- package/dist/ui/index.d.cts +5 -1
- package/dist/ui/index.d.ts +5 -1
- package/dist/ui/index.js +107 -169
- package/dist/validate/index.d.cts +5 -4
- package/dist/validate/index.d.ts +5 -4
- package/docs/authoring.md +1 -1
- package/docs/capability-detection.md +2 -2
- package/docs/entry.md +4 -3
- package/docs/item-context.md +5 -3
- package/docs/permissions.md +1 -1
- package/package.json +7 -5
- package/dist/generated/INDEX.runtime.generated.d.ts +0 -6
- package/dist/generated/INDEX.ui.generated.d.ts +0 -4
- package/dist/generated/capabilityClients.generated.d.ts +0 -231
- package/dist/generated/hostBootstrap.generated.d.ts +0 -23
- package/dist/generated/runtime.host.generated.d.ts +0 -39
- package/dist/generated/topicSubscribers.generated.d.ts +0 -39
- package/dist/generated/ui.bootstrap.generated.d.ts +0 -17
- package/dist/internal/ipcBus.d.ts +0 -48
- package/dist/internal/runtimeInvokeClient.d.ts +0 -3
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
import type { PluginActionResult, PluginAttachmentMutationEntry, PluginConsoleLogLevel, PluginDiagnosticEvent, PluginDiagnosticReason, PluginInfoPanelDocument, PluginSearchExtensionEntry } from './data.generated.js';
|
|
2
|
+
export interface PluginRuntimeInvokePayload {
|
|
3
|
+
key: string;
|
|
4
|
+
payload: unknown;
|
|
5
|
+
timeoutMs?: number;
|
|
6
|
+
}
|
|
7
|
+
export interface PluginRuntimeInvokeResponse {
|
|
8
|
+
response: unknown;
|
|
9
|
+
}
|
|
10
|
+
export interface PluginItemSetTagsPayload {
|
|
11
|
+
tags: string[];
|
|
12
|
+
}
|
|
13
|
+
export interface PluginItemSetTagsResponse {
|
|
14
|
+
tags: string[];
|
|
15
|
+
}
|
|
16
|
+
export interface PluginItemAddTagsPayload {
|
|
17
|
+
tags: string[];
|
|
18
|
+
}
|
|
19
|
+
export interface PluginItemAddTagsResponse {
|
|
20
|
+
tags: string[];
|
|
21
|
+
}
|
|
22
|
+
export interface PluginItemRemoveTagsPayload {
|
|
23
|
+
tags: string[];
|
|
24
|
+
}
|
|
25
|
+
export interface PluginItemRemoveTagsResponse {
|
|
26
|
+
tags: string[];
|
|
27
|
+
}
|
|
28
|
+
export interface PluginItemSetPinnedPayload {
|
|
29
|
+
pinned: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface PluginItemSetPinnedResponse {
|
|
32
|
+
pinned: boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface PluginItemSetAttachmentsPayload {
|
|
35
|
+
owner: string;
|
|
36
|
+
attachmentType: string;
|
|
37
|
+
attachments: PluginAttachmentMutationEntry[];
|
|
38
|
+
}
|
|
39
|
+
export interface PluginItemSetAttachmentsResponse {
|
|
40
|
+
}
|
|
41
|
+
export interface PluginItemSetSearchExtensionPayload {
|
|
42
|
+
scope: string;
|
|
43
|
+
owner: string;
|
|
44
|
+
entries: PluginSearchExtensionEntry[];
|
|
45
|
+
}
|
|
46
|
+
export interface PluginItemSetSearchExtensionResponse {
|
|
47
|
+
}
|
|
48
|
+
export interface PluginItemMaterializeImagePathPayload {
|
|
49
|
+
}
|
|
50
|
+
export interface PluginItemMaterializeImagePathResponse {
|
|
51
|
+
path: string;
|
|
52
|
+
}
|
|
53
|
+
export interface PluginItemReadAttachmentPayload {
|
|
54
|
+
attachmentType: string;
|
|
55
|
+
attachmentKey: string;
|
|
56
|
+
}
|
|
57
|
+
export interface PluginItemReadAttachmentResponse {
|
|
58
|
+
payloadJson?: string;
|
|
59
|
+
}
|
|
60
|
+
export interface PluginAssetCurrentItemImageUrlPayload {
|
|
61
|
+
}
|
|
62
|
+
export interface PluginAssetCurrentItemImageUrlResponse {
|
|
63
|
+
url?: string;
|
|
64
|
+
}
|
|
65
|
+
export interface PluginAssetPathReferenceImageUrlPayload {
|
|
66
|
+
index: number;
|
|
67
|
+
}
|
|
68
|
+
export interface PluginAssetPathReferenceImageUrlResponse {
|
|
69
|
+
url?: string;
|
|
70
|
+
}
|
|
71
|
+
export interface PluginAssetCurrentActionInputImageUrlPayload {
|
|
72
|
+
}
|
|
73
|
+
export interface PluginAssetCurrentActionInputImageUrlResponse {
|
|
74
|
+
url?: string;
|
|
75
|
+
}
|
|
76
|
+
export interface PluginAssetCurrentActionInputPathReferenceImageUrlPayload {
|
|
77
|
+
index: number;
|
|
78
|
+
}
|
|
79
|
+
export interface PluginAssetCurrentActionInputPathReferenceImageUrlResponse {
|
|
80
|
+
url?: string;
|
|
81
|
+
}
|
|
82
|
+
export interface PluginAssetAllocateImageTempPathPayload {
|
|
83
|
+
formatHint: string;
|
|
84
|
+
}
|
|
85
|
+
export interface PluginAssetAllocateImageTempPathResponse {
|
|
86
|
+
path: string;
|
|
87
|
+
}
|
|
88
|
+
export interface PluginAssetRegisterImagePayload {
|
|
89
|
+
path: string;
|
|
90
|
+
}
|
|
91
|
+
export interface PluginAssetRegisterImageResponse {
|
|
92
|
+
url: string;
|
|
93
|
+
}
|
|
94
|
+
export interface PluginClipboardCopyTextPayload {
|
|
95
|
+
text: string;
|
|
96
|
+
}
|
|
97
|
+
export interface PluginClipboardCopyTextResponse {
|
|
98
|
+
}
|
|
99
|
+
export interface PluginNavigationOpenUrlPayload {
|
|
100
|
+
url: string;
|
|
101
|
+
}
|
|
102
|
+
export interface PluginNavigationOpenUrlResponse {
|
|
103
|
+
}
|
|
104
|
+
export interface PluginNavigationRevealInFinderPayload {
|
|
105
|
+
path: string;
|
|
106
|
+
}
|
|
107
|
+
export interface PluginNavigationRevealInFinderResponse {
|
|
108
|
+
}
|
|
109
|
+
export interface PluginNavigationOpenFilePathPayload {
|
|
110
|
+
path: string;
|
|
111
|
+
}
|
|
112
|
+
export interface PluginNavigationOpenFilePathResponse {
|
|
113
|
+
}
|
|
114
|
+
export interface PluginActionAllocateImageTempPathPayload {
|
|
115
|
+
formatHint: string;
|
|
116
|
+
}
|
|
117
|
+
export interface PluginActionAllocateImageTempPathResponse {
|
|
118
|
+
path: string;
|
|
119
|
+
}
|
|
120
|
+
export interface PluginActionMaterializeInputImagePathPayload {
|
|
121
|
+
}
|
|
122
|
+
export interface PluginActionMaterializeInputImagePathResponse {
|
|
123
|
+
path: string;
|
|
124
|
+
}
|
|
125
|
+
export interface PluginActionAllocateOutputFilePathPayload {
|
|
126
|
+
suggestedName?: string;
|
|
127
|
+
}
|
|
128
|
+
export interface PluginActionAllocateOutputFilePathResponse {
|
|
129
|
+
path: string;
|
|
130
|
+
}
|
|
131
|
+
export interface PluginActionSetButtonsPayload {
|
|
132
|
+
buttons: {
|
|
133
|
+
id: string;
|
|
134
|
+
title: string;
|
|
135
|
+
isEnabled?: boolean;
|
|
136
|
+
}[];
|
|
137
|
+
}
|
|
138
|
+
export interface PluginActionSetButtonsResponse {
|
|
139
|
+
}
|
|
140
|
+
export interface PluginActionCompletePayload {
|
|
141
|
+
result: PluginActionResult;
|
|
142
|
+
userMessage?: string;
|
|
143
|
+
}
|
|
144
|
+
export interface PluginActionCompleteResponse {
|
|
145
|
+
}
|
|
146
|
+
export interface PluginAttachmentRendererSetButtonsPayload {
|
|
147
|
+
buttons: {
|
|
148
|
+
id: string;
|
|
149
|
+
title: string;
|
|
150
|
+
isEnabled?: boolean;
|
|
151
|
+
}[];
|
|
152
|
+
}
|
|
153
|
+
export interface PluginAttachmentRendererSetButtonsResponse {
|
|
154
|
+
}
|
|
155
|
+
export interface PluginWindowSetHeightPayload {
|
|
156
|
+
height: number;
|
|
157
|
+
}
|
|
158
|
+
export interface PluginWindowSetHeightResponse {
|
|
159
|
+
}
|
|
160
|
+
export interface PluginWindowAutoFitPayload {
|
|
161
|
+
}
|
|
162
|
+
export interface PluginWindowAutoFitResponse {
|
|
163
|
+
}
|
|
164
|
+
export interface PluginInfoPanelOpenPayload {
|
|
165
|
+
document: PluginInfoPanelDocument;
|
|
166
|
+
}
|
|
167
|
+
export interface PluginInfoPanelOpenResponse {
|
|
168
|
+
panelID: string;
|
|
169
|
+
}
|
|
170
|
+
export interface PluginInfoPanelClosePayload {
|
|
171
|
+
panelID: string;
|
|
172
|
+
}
|
|
173
|
+
export interface PluginInfoPanelCloseResponse {
|
|
174
|
+
}
|
|
175
|
+
export interface PluginSettingsGetPayload {
|
|
176
|
+
key: string;
|
|
177
|
+
}
|
|
178
|
+
export interface PluginSettingsGetResponse {
|
|
179
|
+
value: unknown | null;
|
|
180
|
+
}
|
|
181
|
+
export interface PluginSettingsGetAllPayload {
|
|
182
|
+
}
|
|
183
|
+
export interface PluginSettingsGetAllResponse {
|
|
184
|
+
settings: Record<string, unknown>;
|
|
185
|
+
}
|
|
186
|
+
export interface PluginConsoleLogPayload {
|
|
187
|
+
level: PluginConsoleLogLevel;
|
|
188
|
+
message: string;
|
|
189
|
+
}
|
|
190
|
+
export interface PluginConsoleLogResponse {
|
|
191
|
+
}
|
|
192
|
+
export interface PluginConsoleDiagnosticPayload {
|
|
193
|
+
level: PluginConsoleLogLevel;
|
|
194
|
+
event: PluginDiagnosticEvent;
|
|
195
|
+
reason: PluginDiagnosticReason;
|
|
196
|
+
count: number;
|
|
197
|
+
durationMs: number;
|
|
198
|
+
}
|
|
199
|
+
export interface PluginConsoleDiagnosticResponse {
|
|
200
|
+
}
|
|
201
|
+
export interface PluginTextInputStateChangedPayload {
|
|
202
|
+
isFocused: boolean;
|
|
203
|
+
isComposing: boolean;
|
|
204
|
+
}
|
|
205
|
+
export interface PluginTextInputStateChangedResponse {
|
|
206
|
+
}
|
|
207
|
+
export interface PluginLocaleGetPayload {
|
|
208
|
+
}
|
|
209
|
+
export interface PluginLocaleGetResponse {
|
|
210
|
+
locale: string;
|
|
211
|
+
}
|
|
212
|
+
export declare const CAPABILITY_METHOD_NAMES: readonly ["runtime.invoke", "item.setTags", "item.addTags", "item.removeTags", "item.setPinned", "item.setAttachments", "item.setSearchExtension", "item.materializeImagePath", "item.readAttachment", "asset.currentItemImageUrl", "asset.pathReferenceImageUrl", "asset.currentActionInputImageUrl", "asset.currentActionInputPathReferenceImageUrl", "asset.allocateImageTempPath", "asset.registerImage", "clipboard.copyText", "navigation.openUrl", "navigation.revealInFinder", "navigation.openFilePath", "action.allocateImageTempPath", "action.materializeInputImagePath", "action.allocateOutputFilePath", "action.setButtons", "action.complete", "attachmentRenderer.setButtons", "window.setHeight", "window.autoFit", "infoPanel.open", "infoPanel.close", "settings.get", "settings.getAll", "console.log", "console.diagnostic", "textInput.stateChanged", "locale.get"];
|
|
213
|
+
export type CapabilityMethodName = (typeof CAPABILITY_METHOD_NAMES)[number];
|
|
214
|
+
export interface PluginCapabilityMap {
|
|
215
|
+
'runtime.invoke': {
|
|
216
|
+
payload: PluginRuntimeInvokePayload;
|
|
217
|
+
response: PluginRuntimeInvokeResponse;
|
|
218
|
+
};
|
|
219
|
+
'item.setTags': {
|
|
220
|
+
payload: PluginItemSetTagsPayload;
|
|
221
|
+
response: PluginItemSetTagsResponse;
|
|
222
|
+
};
|
|
223
|
+
'item.addTags': {
|
|
224
|
+
payload: PluginItemAddTagsPayload;
|
|
225
|
+
response: PluginItemAddTagsResponse;
|
|
226
|
+
};
|
|
227
|
+
'item.removeTags': {
|
|
228
|
+
payload: PluginItemRemoveTagsPayload;
|
|
229
|
+
response: PluginItemRemoveTagsResponse;
|
|
230
|
+
};
|
|
231
|
+
'item.setPinned': {
|
|
232
|
+
payload: PluginItemSetPinnedPayload;
|
|
233
|
+
response: PluginItemSetPinnedResponse;
|
|
234
|
+
};
|
|
235
|
+
'item.setAttachments': {
|
|
236
|
+
payload: PluginItemSetAttachmentsPayload;
|
|
237
|
+
response: PluginItemSetAttachmentsResponse;
|
|
238
|
+
};
|
|
239
|
+
'item.setSearchExtension': {
|
|
240
|
+
payload: PluginItemSetSearchExtensionPayload;
|
|
241
|
+
response: PluginItemSetSearchExtensionResponse;
|
|
242
|
+
};
|
|
243
|
+
'item.materializeImagePath': {
|
|
244
|
+
payload: PluginItemMaterializeImagePathPayload;
|
|
245
|
+
response: PluginItemMaterializeImagePathResponse;
|
|
246
|
+
};
|
|
247
|
+
'item.readAttachment': {
|
|
248
|
+
payload: PluginItemReadAttachmentPayload;
|
|
249
|
+
response: PluginItemReadAttachmentResponse;
|
|
250
|
+
};
|
|
251
|
+
'asset.currentItemImageUrl': {
|
|
252
|
+
payload: PluginAssetCurrentItemImageUrlPayload;
|
|
253
|
+
response: PluginAssetCurrentItemImageUrlResponse;
|
|
254
|
+
};
|
|
255
|
+
'asset.pathReferenceImageUrl': {
|
|
256
|
+
payload: PluginAssetPathReferenceImageUrlPayload;
|
|
257
|
+
response: PluginAssetPathReferenceImageUrlResponse;
|
|
258
|
+
};
|
|
259
|
+
'asset.currentActionInputImageUrl': {
|
|
260
|
+
payload: PluginAssetCurrentActionInputImageUrlPayload;
|
|
261
|
+
response: PluginAssetCurrentActionInputImageUrlResponse;
|
|
262
|
+
};
|
|
263
|
+
'asset.currentActionInputPathReferenceImageUrl': {
|
|
264
|
+
payload: PluginAssetCurrentActionInputPathReferenceImageUrlPayload;
|
|
265
|
+
response: PluginAssetCurrentActionInputPathReferenceImageUrlResponse;
|
|
266
|
+
};
|
|
267
|
+
'asset.allocateImageTempPath': {
|
|
268
|
+
payload: PluginAssetAllocateImageTempPathPayload;
|
|
269
|
+
response: PluginAssetAllocateImageTempPathResponse;
|
|
270
|
+
};
|
|
271
|
+
'asset.registerImage': {
|
|
272
|
+
payload: PluginAssetRegisterImagePayload;
|
|
273
|
+
response: PluginAssetRegisterImageResponse;
|
|
274
|
+
};
|
|
275
|
+
'clipboard.copyText': {
|
|
276
|
+
payload: PluginClipboardCopyTextPayload;
|
|
277
|
+
response: PluginClipboardCopyTextResponse;
|
|
278
|
+
};
|
|
279
|
+
'navigation.openUrl': {
|
|
280
|
+
payload: PluginNavigationOpenUrlPayload;
|
|
281
|
+
response: PluginNavigationOpenUrlResponse;
|
|
282
|
+
};
|
|
283
|
+
'navigation.revealInFinder': {
|
|
284
|
+
payload: PluginNavigationRevealInFinderPayload;
|
|
285
|
+
response: PluginNavigationRevealInFinderResponse;
|
|
286
|
+
};
|
|
287
|
+
'navigation.openFilePath': {
|
|
288
|
+
payload: PluginNavigationOpenFilePathPayload;
|
|
289
|
+
response: PluginNavigationOpenFilePathResponse;
|
|
290
|
+
};
|
|
291
|
+
'action.allocateImageTempPath': {
|
|
292
|
+
payload: PluginActionAllocateImageTempPathPayload;
|
|
293
|
+
response: PluginActionAllocateImageTempPathResponse;
|
|
294
|
+
};
|
|
295
|
+
'action.materializeInputImagePath': {
|
|
296
|
+
payload: PluginActionMaterializeInputImagePathPayload;
|
|
297
|
+
response: PluginActionMaterializeInputImagePathResponse;
|
|
298
|
+
};
|
|
299
|
+
'action.allocateOutputFilePath': {
|
|
300
|
+
payload: PluginActionAllocateOutputFilePathPayload;
|
|
301
|
+
response: PluginActionAllocateOutputFilePathResponse;
|
|
302
|
+
};
|
|
303
|
+
'action.setButtons': {
|
|
304
|
+
payload: PluginActionSetButtonsPayload;
|
|
305
|
+
response: PluginActionSetButtonsResponse;
|
|
306
|
+
};
|
|
307
|
+
'action.complete': {
|
|
308
|
+
payload: PluginActionCompletePayload;
|
|
309
|
+
response: PluginActionCompleteResponse;
|
|
310
|
+
};
|
|
311
|
+
'attachmentRenderer.setButtons': {
|
|
312
|
+
payload: PluginAttachmentRendererSetButtonsPayload;
|
|
313
|
+
response: PluginAttachmentRendererSetButtonsResponse;
|
|
314
|
+
};
|
|
315
|
+
'window.setHeight': {
|
|
316
|
+
payload: PluginWindowSetHeightPayload;
|
|
317
|
+
response: PluginWindowSetHeightResponse;
|
|
318
|
+
};
|
|
319
|
+
'window.autoFit': {
|
|
320
|
+
payload: PluginWindowAutoFitPayload;
|
|
321
|
+
response: PluginWindowAutoFitResponse;
|
|
322
|
+
};
|
|
323
|
+
'infoPanel.open': {
|
|
324
|
+
payload: PluginInfoPanelOpenPayload;
|
|
325
|
+
response: PluginInfoPanelOpenResponse;
|
|
326
|
+
};
|
|
327
|
+
'infoPanel.close': {
|
|
328
|
+
payload: PluginInfoPanelClosePayload;
|
|
329
|
+
response: PluginInfoPanelCloseResponse;
|
|
330
|
+
};
|
|
331
|
+
'settings.get': {
|
|
332
|
+
payload: PluginSettingsGetPayload;
|
|
333
|
+
response: PluginSettingsGetResponse;
|
|
334
|
+
};
|
|
335
|
+
'settings.getAll': {
|
|
336
|
+
payload: PluginSettingsGetAllPayload;
|
|
337
|
+
response: PluginSettingsGetAllResponse;
|
|
338
|
+
};
|
|
339
|
+
'console.log': {
|
|
340
|
+
payload: PluginConsoleLogPayload;
|
|
341
|
+
response: PluginConsoleLogResponse;
|
|
342
|
+
};
|
|
343
|
+
'console.diagnostic': {
|
|
344
|
+
payload: PluginConsoleDiagnosticPayload;
|
|
345
|
+
response: PluginConsoleDiagnosticResponse;
|
|
346
|
+
};
|
|
347
|
+
'textInput.stateChanged': {
|
|
348
|
+
payload: PluginTextInputStateChangedPayload;
|
|
349
|
+
response: PluginTextInputStateChangedResponse;
|
|
350
|
+
};
|
|
351
|
+
'locale.get': {
|
|
352
|
+
payload: PluginLocaleGetPayload;
|
|
353
|
+
response: PluginLocaleGetResponse;
|
|
354
|
+
};
|
|
355
|
+
}
|
|
@@ -88,6 +88,8 @@ export interface PluginInfoPanelDocument {
|
|
|
88
88
|
actions: PluginInfoPanelAction[];
|
|
89
89
|
}
|
|
90
90
|
export type PluginConsoleLogLevel = 'debug' | 'info' | 'warn' | 'error';
|
|
91
|
+
export type PluginDiagnosticEvent = 'action_started' | 'action_completed' | 'action_failed' | 'renderer_ready' | 'renderer_failed' | 'detector_completed' | 'detector_failed' | 'runtime_ready' | 'runtime_failed';
|
|
92
|
+
export type PluginDiagnosticReason = 'none' | 'invalid_input' | 'unsupported' | 'timeout' | 'unavailable' | 'failed';
|
|
91
93
|
export interface PluginClipboardItem {
|
|
92
94
|
id: string;
|
|
93
95
|
type: string;
|
|
@@ -223,3 +225,34 @@ export interface PluginActionOperationResult {
|
|
|
223
225
|
result: PluginActionResult;
|
|
224
226
|
userMessage?: string;
|
|
225
227
|
}
|
|
228
|
+
export interface PluginNodeIPCRequestFrame {
|
|
229
|
+
id: string;
|
|
230
|
+
method: string;
|
|
231
|
+
request: unknown;
|
|
232
|
+
}
|
|
233
|
+
export interface PluginNodeIPCResponseFrame {
|
|
234
|
+
id?: string;
|
|
235
|
+
response?: unknown;
|
|
236
|
+
error?: unknown;
|
|
237
|
+
}
|
|
238
|
+
export interface PluginNodeIPCErrorFrame {
|
|
239
|
+
name: string;
|
|
240
|
+
message: string;
|
|
241
|
+
data?: unknown;
|
|
242
|
+
}
|
|
243
|
+
export interface PluginRuntimePluginDescriptor {
|
|
244
|
+
id: string;
|
|
245
|
+
title: string;
|
|
246
|
+
version: string;
|
|
247
|
+
}
|
|
248
|
+
export type PluginRuntimeHostPlatform = 'macos' | 'windows';
|
|
249
|
+
export interface PluginRuntimeHostDescriptor {
|
|
250
|
+
platform: PluginRuntimeHostPlatform;
|
|
251
|
+
hostVersion: string;
|
|
252
|
+
devMode: boolean;
|
|
253
|
+
}
|
|
254
|
+
export interface PluginRuntimeLaunchContext {
|
|
255
|
+
plugin: PluginRuntimePluginDescriptor;
|
|
256
|
+
host: PluginRuntimeHostDescriptor;
|
|
257
|
+
supportedCapabilities: string[];
|
|
258
|
+
}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import type { PluginActionAllocateImageTempPathPayload, PluginActionAllocateImageTempPathResponse, PluginActionAllocateOutputFilePathPayload, PluginActionAllocateOutputFilePathResponse, PluginActionMaterializeInputImagePathResponse, PluginAssetRegisterImagePayload, PluginAssetRegisterImageResponse, PluginClipboardCopyTextPayload, PluginClipboardCopyTextResponse, PluginConsoleLogPayload, PluginConsoleLogResponse, PluginItemAddTagsPayload, PluginItemAddTagsResponse, PluginItemMaterializeImagePathResponse, PluginItemReadAttachmentPayload, PluginItemReadAttachmentResponse, PluginItemRemoveTagsPayload, PluginItemRemoveTagsResponse, PluginItemSetAttachmentsPayload, PluginItemSetAttachmentsResponse, PluginItemSetPinnedPayload, PluginItemSetPinnedResponse, PluginItemSetSearchExtensionPayload, PluginItemSetSearchExtensionResponse, PluginItemSetTagsPayload, PluginItemSetTagsResponse, PluginLocaleGetResponse, PluginNavigationOpenFilePathPayload, PluginNavigationOpenFilePathResponse, PluginNavigationOpenUrlPayload, PluginNavigationOpenUrlResponse, PluginNavigationRevealInFinderPayload, PluginNavigationRevealInFinderResponse, PluginSettingsGetAllResponse, PluginSettingsGetPayload, PluginSettingsGetResponse } from './
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
}
|
|
1
|
+
import type { PluginActionAllocateImageTempPathPayload, PluginActionAllocateImageTempPathResponse, PluginActionAllocateOutputFilePathPayload, PluginActionAllocateOutputFilePathResponse, PluginActionMaterializeInputImagePathResponse, PluginAssetAllocateImageTempPathPayload, PluginAssetAllocateImageTempPathResponse, PluginAssetRegisterImagePayload, PluginAssetRegisterImageResponse, PluginClipboardCopyTextPayload, PluginClipboardCopyTextResponse, PluginConsoleDiagnosticPayload, PluginConsoleDiagnosticResponse, PluginConsoleLogPayload, PluginConsoleLogResponse, PluginItemAddTagsPayload, PluginItemAddTagsResponse, PluginItemMaterializeImagePathResponse, PluginItemReadAttachmentPayload, PluginItemReadAttachmentResponse, PluginItemRemoveTagsPayload, PluginItemRemoveTagsResponse, PluginItemSetAttachmentsPayload, PluginItemSetAttachmentsResponse, PluginItemSetPinnedPayload, PluginItemSetPinnedResponse, PluginItemSetSearchExtensionPayload, PluginItemSetSearchExtensionResponse, PluginItemSetTagsPayload, PluginItemSetTagsResponse, PluginLocaleGetResponse, PluginNavigationOpenFilePathPayload, PluginNavigationOpenFilePathResponse, PluginNavigationOpenUrlPayload, PluginNavigationOpenUrlResponse, PluginNavigationRevealInFinderPayload, PluginNavigationRevealInFinderResponse, PluginSettingsGetAllResponse, PluginSettingsGetPayload, PluginSettingsGetResponse } from './capabilities.generated.js';
|
|
2
|
+
export declare const RUNTIME_HOST_METHOD_NAMES: readonly ["item.setTags", "item.addTags", "item.removeTags", "item.setPinned", "item.setAttachments", "item.setSearchExtension", "item.materializeImagePath", "item.readAttachment", "asset.allocateImageTempPath", "asset.registerImage", "clipboard.copyText", "navigation.openUrl", "navigation.revealInFinder", "navigation.openFilePath", "action.allocateImageTempPath", "action.materializeInputImagePath", "action.allocateOutputFilePath", "settings.get", "settings.getAll", "console.log", "console.diagnostic", "locale.get"];
|
|
3
|
+
export type RuntimeHostMethodName = (typeof RUNTIME_HOST_METHOD_NAMES)[number];
|
|
5
4
|
export interface HostClient {
|
|
5
|
+
capabilities: {
|
|
6
|
+
has(name: RuntimeHostMethodName): boolean;
|
|
7
|
+
};
|
|
6
8
|
action: {
|
|
7
9
|
allocateImageTempPath(payload: PluginActionAllocateImageTempPathPayload): Promise<PluginActionAllocateImageTempPathResponse>;
|
|
8
10
|
materializeInputImagePath(): Promise<PluginActionMaterializeInputImagePathResponse>;
|
|
9
11
|
allocateOutputFilePath(payload: PluginActionAllocateOutputFilePathPayload): Promise<PluginActionAllocateOutputFilePathResponse>;
|
|
10
12
|
};
|
|
11
13
|
asset: {
|
|
14
|
+
allocateImageTempPath(payload: PluginAssetAllocateImageTempPathPayload): Promise<PluginAssetAllocateImageTempPathResponse>;
|
|
12
15
|
registerImage(payload: PluginAssetRegisterImagePayload): Promise<PluginAssetRegisterImageResponse>;
|
|
13
16
|
};
|
|
14
17
|
clipboard: {
|
|
@@ -16,6 +19,7 @@ export interface HostClient {
|
|
|
16
19
|
};
|
|
17
20
|
console: {
|
|
18
21
|
log(payload: PluginConsoleLogPayload): Promise<PluginConsoleLogResponse>;
|
|
22
|
+
diagnostic(payload: PluginConsoleDiagnosticPayload): Promise<PluginConsoleDiagnosticResponse>;
|
|
19
23
|
};
|
|
20
24
|
item: {
|
|
21
25
|
setTags(payload: PluginItemSetTagsPayload): Promise<PluginItemSetTagsResponse>;
|
|
@@ -40,4 +44,3 @@ export interface HostClient {
|
|
|
40
44
|
getAll(): Promise<PluginSettingsGetAllResponse>;
|
|
41
45
|
};
|
|
42
46
|
}
|
|
43
|
-
export declare function createHostClient(bus: IPCBus): HostClient;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { PluginActionUIInput, PluginAttachmentPayload, PluginClipboardItem, PluginThemeTokenSnapshot } from './data.generated.js';
|
|
2
|
+
export interface PluginContextPayload {
|
|
3
|
+
mode: 'attachmentRenderer' | 'action';
|
|
4
|
+
pluginID: string;
|
|
5
|
+
}
|
|
6
|
+
export interface PluginAttachmentHostInvokePayload {
|
|
7
|
+
buttonID: string;
|
|
8
|
+
}
|
|
9
|
+
export interface PluginActionHostInvokePayload {
|
|
10
|
+
buttonID: string;
|
|
11
|
+
}
|
|
12
|
+
export interface PluginInfoPanelOnActionPayload {
|
|
13
|
+
panelID: string;
|
|
14
|
+
buttonID: string;
|
|
15
|
+
}
|
|
16
|
+
export interface PluginInfoPanelOnClosePayload {
|
|
17
|
+
panelID: string;
|
|
18
|
+
}
|
|
19
|
+
export interface PluginLocalePayload {
|
|
20
|
+
locale: string;
|
|
21
|
+
}
|
|
22
|
+
export interface PluginHostEventMap {
|
|
23
|
+
'clipbus-plugin-context': PluginContextPayload;
|
|
24
|
+
'clipbus-plugin-item': PluginClipboardItem;
|
|
25
|
+
'clipbus-plugin-attachment': PluginAttachmentPayload;
|
|
26
|
+
'clipbus-plugin-draft': Record<string, unknown>;
|
|
27
|
+
'clipbus-plugin-action-input': PluginActionUIInput;
|
|
28
|
+
'clipbus-plugin-theme': PluginThemeTokenSnapshot;
|
|
29
|
+
'clipbus-plugin-attachment-host-invoke': PluginAttachmentHostInvokePayload;
|
|
30
|
+
'clipbus-plugin-action-host-invoke': PluginActionHostInvokePayload;
|
|
31
|
+
'clipbus-plugin-info-panel-on-action': PluginInfoPanelOnActionPayload;
|
|
32
|
+
'clipbus-plugin-info-panel-on-close': PluginInfoPanelOnClosePayload;
|
|
33
|
+
'clipbus-plugin-locale': PluginLocalePayload;
|
|
34
|
+
}
|
|
35
|
+
export type HostEventName = keyof PluginHostEventMap;
|
|
36
|
+
export declare const HOST_EVENT_WINDOW_GLOBALS: {
|
|
37
|
+
readonly [K in HostEventName]: string | null;
|
|
38
|
+
};
|
|
39
|
+
export interface PluginAttachmentBootstrap {
|
|
40
|
+
context?: PluginContextPayload;
|
|
41
|
+
item?: PluginClipboardItem;
|
|
42
|
+
attachment?: PluginAttachmentPayload;
|
|
43
|
+
theme?: PluginThemeTokenSnapshot;
|
|
44
|
+
locale?: PluginLocalePayload;
|
|
45
|
+
}
|
|
46
|
+
export declare const ATTACHMENT_BOOTSTRAP_EVENTS: {
|
|
47
|
+
readonly context: "clipbus-plugin-context";
|
|
48
|
+
readonly item: "clipbus-plugin-item";
|
|
49
|
+
readonly attachment: "clipbus-plugin-attachment";
|
|
50
|
+
readonly theme: "clipbus-plugin-theme";
|
|
51
|
+
readonly locale: "clipbus-plugin-locale";
|
|
52
|
+
};
|
|
53
|
+
export interface PluginActionBootstrap {
|
|
54
|
+
context?: PluginContextPayload;
|
|
55
|
+
item?: PluginClipboardItem;
|
|
56
|
+
draft?: Record<string, unknown>;
|
|
57
|
+
actionInput?: PluginActionUIInput;
|
|
58
|
+
theme?: PluginThemeTokenSnapshot;
|
|
59
|
+
locale?: PluginLocalePayload;
|
|
60
|
+
}
|
|
61
|
+
export declare const ACTION_BOOTSTRAP_EVENTS: {
|
|
62
|
+
readonly context: "clipbus-plugin-context";
|
|
63
|
+
readonly item: "clipbus-plugin-item";
|
|
64
|
+
readonly draft: "clipbus-plugin-draft";
|
|
65
|
+
readonly actionInput: "clipbus-plugin-action-input";
|
|
66
|
+
readonly theme: "clipbus-plugin-theme";
|
|
67
|
+
readonly locale: "clipbus-plugin-locale";
|
|
68
|
+
};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type { PluginActionOperationResult, PluginActionResolveResult, PluginAttachmentResolveResult, PluginAutoRunActionInput, PluginDetectorArtifact, PluginDetectorInput, PluginResolveActionSessionInput, PluginResolveAttachmentInput } from './data.generated.js';
|
|
2
|
+
export interface PluginRuntimeUserRPCRequest {
|
|
3
|
+
key: string;
|
|
4
|
+
payload: unknown;
|
|
5
|
+
}
|
|
6
|
+
export interface PluginRuntimeUserRPCResponse {
|
|
7
|
+
result: unknown;
|
|
8
|
+
}
|
|
9
|
+
export interface PluginRuntimeInvokeRendererRequest {
|
|
10
|
+
requestID: string;
|
|
11
|
+
rendererID: string;
|
|
12
|
+
input: PluginResolveAttachmentInput;
|
|
13
|
+
}
|
|
14
|
+
export interface PluginRuntimeInvokeRendererResponse {
|
|
15
|
+
requestID: string;
|
|
16
|
+
result?: PluginAttachmentResolveResult;
|
|
17
|
+
errorMessage?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface PluginRuntimeInvokeDetectorRequest {
|
|
20
|
+
requestID: string;
|
|
21
|
+
detectorID: string;
|
|
22
|
+
input: PluginDetectorInput;
|
|
23
|
+
}
|
|
24
|
+
export interface PluginRuntimeInvokeDetectorResponse {
|
|
25
|
+
requestID: string;
|
|
26
|
+
result?: PluginDetectorArtifact[];
|
|
27
|
+
errorMessage?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface PluginRuntimeInvokeActionRequest {
|
|
30
|
+
requestID: string;
|
|
31
|
+
actionID: string;
|
|
32
|
+
input: PluginResolveActionSessionInput;
|
|
33
|
+
}
|
|
34
|
+
export interface PluginRuntimeInvokeActionResponse {
|
|
35
|
+
requestID: string;
|
|
36
|
+
result?: PluginActionResolveResult;
|
|
37
|
+
errorMessage?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface PluginRuntimeInvokeActionAutoRunRequest {
|
|
40
|
+
requestID: string;
|
|
41
|
+
actionID: string;
|
|
42
|
+
input: PluginAutoRunActionInput;
|
|
43
|
+
}
|
|
44
|
+
export interface PluginRuntimeInvokeActionAutoRunResponse {
|
|
45
|
+
requestID: string;
|
|
46
|
+
result?: PluginActionOperationResult;
|
|
47
|
+
errorMessage?: string;
|
|
48
|
+
}
|
|
49
|
+
export interface PluginRuntimeReadyRequest {
|
|
50
|
+
}
|
|
51
|
+
export interface PluginRuntimeReadyResponse {
|
|
52
|
+
}
|
|
53
|
+
export interface PluginNodeIPCMethodMap {
|
|
54
|
+
'runtime.userRPC': {
|
|
55
|
+
request: PluginRuntimeUserRPCRequest;
|
|
56
|
+
response: PluginRuntimeUserRPCResponse;
|
|
57
|
+
};
|
|
58
|
+
'runtime.invokeRenderer': {
|
|
59
|
+
request: PluginRuntimeInvokeRendererRequest;
|
|
60
|
+
response: PluginRuntimeInvokeRendererResponse;
|
|
61
|
+
};
|
|
62
|
+
'runtime.invokeDetector': {
|
|
63
|
+
request: PluginRuntimeInvokeDetectorRequest;
|
|
64
|
+
response: PluginRuntimeInvokeDetectorResponse;
|
|
65
|
+
};
|
|
66
|
+
'runtime.invokeAction': {
|
|
67
|
+
request: PluginRuntimeInvokeActionRequest;
|
|
68
|
+
response: PluginRuntimeInvokeActionResponse;
|
|
69
|
+
};
|
|
70
|
+
'runtime.invokeActionAutoRun': {
|
|
71
|
+
request: PluginRuntimeInvokeActionAutoRunRequest;
|
|
72
|
+
response: PluginRuntimeInvokeActionAutoRunResponse;
|
|
73
|
+
};
|
|
74
|
+
'runtime.ready': {
|
|
75
|
+
request: PluginRuntimeReadyRequest;
|
|
76
|
+
response: PluginRuntimeReadyResponse;
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
export type NodeIPCMethodName = keyof PluginNodeIPCMethodMap;
|
|
80
|
+
/** Methods dispatched to a plugin registry entry, keyed by Node IPC method. */
|
|
81
|
+
export declare const NODE_IPC_HANDLER_ROUTES: {
|
|
82
|
+
readonly 'runtime.invokeRenderer': {
|
|
83
|
+
readonly registryKey: "attachmentRenderers";
|
|
84
|
+
readonly handlerMethod: "resolveAttachment";
|
|
85
|
+
readonly idField: "rendererID";
|
|
86
|
+
readonly inputField: "input";
|
|
87
|
+
};
|
|
88
|
+
readonly 'runtime.invokeDetector': {
|
|
89
|
+
readonly registryKey: "detectors";
|
|
90
|
+
readonly handlerMethod: "detect";
|
|
91
|
+
readonly idField: "detectorID";
|
|
92
|
+
readonly inputField: "input";
|
|
93
|
+
};
|
|
94
|
+
readonly 'runtime.invokeAction': {
|
|
95
|
+
readonly registryKey: "actions";
|
|
96
|
+
readonly handlerMethod: "resolveSession";
|
|
97
|
+
readonly idField: "actionID";
|
|
98
|
+
readonly inputField: "input";
|
|
99
|
+
};
|
|
100
|
+
readonly 'runtime.invokeActionAutoRun': {
|
|
101
|
+
readonly registryKey: "actions";
|
|
102
|
+
readonly handlerMethod: "runAutoAction";
|
|
103
|
+
readonly idField: "actionID";
|
|
104
|
+
readonly inputField: "input";
|
|
105
|
+
};
|
|
106
|
+
};
|
package/dist/generated/{runtime.definePlugin.generated.d.ts → runtime.registry.generated.d.ts}
RENAMED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { PluginAttachmentRendererHandler, PluginAutoRunActionHandler, PluginDetectorHandler } from './runtime.handlers.generated.js';
|
|
2
2
|
import type { HostClient } from './hostClients.generated.js';
|
|
3
|
+
import type { PluginRuntimeLaunchContext } from './data.generated.js';
|
|
3
4
|
export interface MessageHandlerContext {
|
|
4
5
|
host: HostClient;
|
|
5
6
|
}
|
|
@@ -11,6 +12,5 @@ export interface PluginRegistry {
|
|
|
11
12
|
messageHandlers?: Record<string, MessageHandler>;
|
|
12
13
|
}
|
|
13
14
|
export interface PluginSetup {
|
|
14
|
-
setup(): PluginRegistry;
|
|
15
|
+
setup(context?: PluginRuntimeLaunchContext): PluginRegistry;
|
|
15
16
|
}
|
|
16
|
-
export declare function definePlugin(definition: PluginRegistry | PluginSetup): PluginSetup;
|