@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.
Files changed (49) hide show
  1. package/API.md +94 -27
  2. package/CHANGELOG.md +84 -0
  3. package/README.md +11 -3
  4. package/SPECIFICATION.md +3 -2
  5. package/dist/dom/index.cjs +29 -34
  6. package/dist/dom/index.js +29 -34
  7. package/dist/dom/topicAdapter.d.ts +1 -1
  8. package/dist/generated/capabilities.generated.d.ts +355 -0
  9. package/dist/generated/data.generated.d.ts +33 -0
  10. package/dist/generated/hostClients.generated.d.ts +8 -5
  11. package/dist/generated/hostEvents.generated.d.ts +68 -0
  12. package/dist/generated/nodeIPC.generated.d.ts +106 -0
  13. package/dist/generated/{runtime.definePlugin.generated.d.ts → runtime.registry.generated.d.ts} +2 -2
  14. package/dist/generated/ui.clipbus.generated.d.ts +19 -20
  15. package/dist/generated/wireConstants.generated.d.ts +21 -0
  16. package/dist/internal/capabilities.d.ts +1 -1
  17. package/dist/internal/hostEvents.d.ts +15 -0
  18. package/dist/internal/pluginCall.d.ts +11 -0
  19. package/dist/internal/pluginContext.d.ts +6 -0
  20. package/dist/preview/index.cjs +41 -48
  21. package/dist/preview/index.js +41 -48
  22. package/dist/preview/wire.d.ts +2 -2
  23. package/dist/runtime/defineMessage.d.ts +1 -1
  24. package/dist/runtime/definePlugin.d.ts +2 -0
  25. package/dist/runtime/index.cjs +10 -82
  26. package/dist/runtime/index.d.cts +7 -1
  27. package/dist/runtime/index.d.ts +7 -1
  28. package/dist/runtime/index.js +9 -80
  29. package/dist/ui/index.cjs +107 -169
  30. package/dist/ui/index.d.cts +5 -1
  31. package/dist/ui/index.d.ts +5 -1
  32. package/dist/ui/index.js +107 -169
  33. package/dist/validate/index.d.cts +5 -4
  34. package/dist/validate/index.d.ts +5 -4
  35. package/docs/authoring.md +1 -1
  36. package/docs/capability-detection.md +2 -2
  37. package/docs/entry.md +4 -3
  38. package/docs/item-context.md +5 -3
  39. package/docs/permissions.md +1 -1
  40. package/package.json +7 -5
  41. package/dist/generated/INDEX.runtime.generated.d.ts +0 -6
  42. package/dist/generated/INDEX.ui.generated.d.ts +0 -4
  43. package/dist/generated/capabilityClients.generated.d.ts +0 -231
  44. package/dist/generated/hostBootstrap.generated.d.ts +0 -23
  45. package/dist/generated/runtime.host.generated.d.ts +0 -39
  46. package/dist/generated/topicSubscribers.generated.d.ts +0 -39
  47. package/dist/generated/ui.bootstrap.generated.d.ts +0 -17
  48. package/dist/internal/ipcBus.d.ts +0 -48
  49. package/dist/internal/runtimeInvokeClient.d.ts +0 -3
@@ -1,231 +0,0 @@
1
- import type { PluginActionResult, PluginAttachmentMutationEntry, PluginConsoleLogLevel, 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 PluginAssetRegisterImagePayload {
83
- path: string;
84
- }
85
- export interface PluginAssetRegisterImageResponse {
86
- url: string;
87
- }
88
- export interface PluginClipboardCopyTextPayload {
89
- text: string;
90
- }
91
- export interface PluginClipboardCopyTextResponse {
92
- }
93
- export interface PluginNavigationOpenUrlPayload {
94
- url: string;
95
- }
96
- export interface PluginNavigationOpenUrlResponse {
97
- }
98
- export interface PluginNavigationRevealInFinderPayload {
99
- path: string;
100
- }
101
- export interface PluginNavigationRevealInFinderResponse {
102
- }
103
- export interface PluginNavigationOpenFilePathPayload {
104
- path: string;
105
- }
106
- export interface PluginNavigationOpenFilePathResponse {
107
- }
108
- export interface PluginActionAllocateImageTempPathPayload {
109
- formatHint: string;
110
- }
111
- export interface PluginActionAllocateImageTempPathResponse {
112
- path: string;
113
- }
114
- export interface PluginActionMaterializeInputImagePathPayload {
115
- }
116
- export interface PluginActionMaterializeInputImagePathResponse {
117
- path: string;
118
- }
119
- export interface PluginActionAllocateOutputFilePathPayload {
120
- suggestedName?: string;
121
- }
122
- export interface PluginActionAllocateOutputFilePathResponse {
123
- path: string;
124
- }
125
- export interface PluginActionSetButtonsPayload {
126
- buttons: {
127
- id: string;
128
- title: string;
129
- isEnabled?: boolean;
130
- }[];
131
- }
132
- export interface PluginActionSetButtonsResponse {
133
- }
134
- export interface PluginActionCompletePayload {
135
- result: PluginActionResult;
136
- userMessage?: string;
137
- }
138
- export interface PluginActionCompleteResponse {
139
- }
140
- export interface PluginAttachmentRendererSetButtonsPayload {
141
- buttons: {
142
- id: string;
143
- title: string;
144
- isEnabled?: boolean;
145
- }[];
146
- }
147
- export interface PluginAttachmentRendererSetButtonsResponse {
148
- }
149
- export interface PluginWindowSetHeightPayload {
150
- height: number;
151
- }
152
- export interface PluginWindowSetHeightResponse {
153
- }
154
- export interface PluginWindowAutoFitPayload {
155
- }
156
- export interface PluginWindowAutoFitResponse {
157
- }
158
- export interface PluginInfoPanelOpenPayload {
159
- document: PluginInfoPanelDocument;
160
- }
161
- export interface PluginInfoPanelOpenResponse {
162
- panelID: string;
163
- }
164
- export interface PluginInfoPanelClosePayload {
165
- panelID: string;
166
- }
167
- export interface PluginInfoPanelCloseResponse {
168
- }
169
- export interface PluginSettingsGetPayload {
170
- key: string;
171
- }
172
- export interface PluginSettingsGetResponse {
173
- value: unknown | null;
174
- }
175
- export interface PluginSettingsGetAllPayload {
176
- }
177
- export interface PluginSettingsGetAllResponse {
178
- settings: Record<string, unknown>;
179
- }
180
- export interface PluginConsoleLogPayload {
181
- level: PluginConsoleLogLevel;
182
- message: string;
183
- }
184
- export interface PluginConsoleLogResponse {
185
- }
186
- export interface PluginTextInputStateChangedPayload {
187
- isFocused: boolean;
188
- isComposing: boolean;
189
- }
190
- export interface PluginTextInputStateChangedResponse {
191
- }
192
- export interface PluginLocaleGetPayload {
193
- }
194
- export interface PluginLocaleGetResponse {
195
- locale: string;
196
- }
197
- 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.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", "textInput.stateChanged", "locale.get"];
198
- export type CapabilityMethodName = (typeof CAPABILITY_METHOD_NAMES)[number];
199
- export declare const callRuntimeInvoke: (payload: PluginRuntimeInvokePayload) => Promise<PluginRuntimeInvokeResponse>;
200
- export declare const callItemSetTags: (payload: PluginItemSetTagsPayload) => Promise<PluginItemSetTagsResponse>;
201
- export declare const callItemAddTags: (payload: PluginItemAddTagsPayload) => Promise<PluginItemAddTagsResponse>;
202
- export declare const callItemRemoveTags: (payload: PluginItemRemoveTagsPayload) => Promise<PluginItemRemoveTagsResponse>;
203
- export declare const callItemSetPinned: (payload: PluginItemSetPinnedPayload) => Promise<PluginItemSetPinnedResponse>;
204
- export declare const callItemSetAttachments: (payload: PluginItemSetAttachmentsPayload) => Promise<PluginItemSetAttachmentsResponse>;
205
- export declare const callItemSetSearchExtension: (payload: PluginItemSetSearchExtensionPayload) => Promise<PluginItemSetSearchExtensionResponse>;
206
- export declare const callItemMaterializeImagePath: () => Promise<PluginItemMaterializeImagePathResponse>;
207
- export declare const callItemReadAttachment: (payload: PluginItemReadAttachmentPayload) => Promise<PluginItemReadAttachmentResponse>;
208
- export declare const callAssetCurrentItemImageUrl: () => Promise<PluginAssetCurrentItemImageUrlResponse>;
209
- export declare const callAssetPathReferenceImageUrl: (payload: PluginAssetPathReferenceImageUrlPayload) => Promise<PluginAssetPathReferenceImageUrlResponse>;
210
- export declare const callAssetCurrentActionInputImageUrl: () => Promise<PluginAssetCurrentActionInputImageUrlResponse>;
211
- export declare const callAssetCurrentActionInputPathReferenceImageUrl: (payload: PluginAssetCurrentActionInputPathReferenceImageUrlPayload) => Promise<PluginAssetCurrentActionInputPathReferenceImageUrlResponse>;
212
- export declare const callAssetRegisterImage: (payload: PluginAssetRegisterImagePayload) => Promise<PluginAssetRegisterImageResponse>;
213
- export declare const callClipboardCopyText: (payload: PluginClipboardCopyTextPayload) => Promise<PluginClipboardCopyTextResponse>;
214
- export declare const callNavigationOpenUrl: (payload: PluginNavigationOpenUrlPayload) => Promise<PluginNavigationOpenUrlResponse>;
215
- export declare const callNavigationRevealInFinder: (payload: PluginNavigationRevealInFinderPayload) => Promise<PluginNavigationRevealInFinderResponse>;
216
- export declare const callNavigationOpenFilePath: (payload: PluginNavigationOpenFilePathPayload) => Promise<PluginNavigationOpenFilePathResponse>;
217
- export declare const callActionAllocateImageTempPath: (payload: PluginActionAllocateImageTempPathPayload) => Promise<PluginActionAllocateImageTempPathResponse>;
218
- export declare const callActionMaterializeInputImagePath: () => Promise<PluginActionMaterializeInputImagePathResponse>;
219
- export declare const callActionAllocateOutputFilePath: (payload: PluginActionAllocateOutputFilePathPayload) => Promise<PluginActionAllocateOutputFilePathResponse>;
220
- export declare const callActionSetButtons: (payload: PluginActionSetButtonsPayload) => Promise<PluginActionSetButtonsResponse>;
221
- export declare const callActionComplete: (payload: PluginActionCompletePayload) => Promise<PluginActionCompleteResponse>;
222
- export declare const callAttachmentRendererSetButtons: (payload: PluginAttachmentRendererSetButtonsPayload) => Promise<PluginAttachmentRendererSetButtonsResponse>;
223
- export declare const callWindowSetHeight: (payload: PluginWindowSetHeightPayload) => Promise<PluginWindowSetHeightResponse>;
224
- export declare const callWindowAutoFit: () => Promise<PluginWindowAutoFitResponse>;
225
- export declare const callInfoPanelOpen: (payload: PluginInfoPanelOpenPayload) => Promise<PluginInfoPanelOpenResponse>;
226
- export declare const callInfoPanelClose: (payload: PluginInfoPanelClosePayload) => Promise<PluginInfoPanelCloseResponse>;
227
- export declare const callSettingsGet: (payload: PluginSettingsGetPayload) => Promise<PluginSettingsGetResponse>;
228
- export declare const callSettingsGetAll: () => Promise<PluginSettingsGetAllResponse>;
229
- export declare const callConsoleLog: (payload: PluginConsoleLogPayload) => Promise<PluginConsoleLogResponse>;
230
- export declare const callTextInputStateChanged: (payload: PluginTextInputStateChangedPayload) => Promise<PluginTextInputStateChangedResponse>;
231
- export declare const callLocaleGet: () => Promise<PluginLocaleGetResponse>;
@@ -1,23 +0,0 @@
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 PluginLocalePayload {
7
- locale: string;
8
- }
9
- export declare function emitAttachmentBootstrap(p: {
10
- context?: PluginContextPayload;
11
- item?: PluginClipboardItem;
12
- attachment?: PluginAttachmentPayload;
13
- theme?: PluginThemeTokenSnapshot;
14
- locale?: PluginLocalePayload;
15
- }): void;
16
- export declare function emitActionBootstrap(p: {
17
- context?: PluginContextPayload;
18
- item?: PluginClipboardItem;
19
- draft?: Record<string, unknown>;
20
- actionInput?: PluginActionUIInput;
21
- theme?: PluginThemeTokenSnapshot;
22
- locale?: PluginLocalePayload;
23
- }): void;
@@ -1,39 +0,0 @@
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 './capabilityClients.generated.js';
2
- export declare const host: {
3
- item: {
4
- setTags: (payload: PluginItemSetTagsPayload) => Promise<PluginItemSetTagsResponse>;
5
- addTags: (payload: PluginItemAddTagsPayload) => Promise<PluginItemAddTagsResponse>;
6
- removeTags: (payload: PluginItemRemoveTagsPayload) => Promise<PluginItemRemoveTagsResponse>;
7
- setPinned: (payload: PluginItemSetPinnedPayload) => Promise<PluginItemSetPinnedResponse>;
8
- setAttachments: (payload: PluginItemSetAttachmentsPayload) => Promise<PluginItemSetAttachmentsResponse>;
9
- setSearchExtension: (payload: PluginItemSetSearchExtensionPayload) => Promise<PluginItemSetSearchExtensionResponse>;
10
- materializeImagePath: () => Promise<PluginItemMaterializeImagePathResponse>;
11
- readAttachment: (payload: PluginItemReadAttachmentPayload) => Promise<PluginItemReadAttachmentResponse>;
12
- };
13
- asset: {
14
- registerImage: (payload: PluginAssetRegisterImagePayload) => Promise<PluginAssetRegisterImageResponse>;
15
- };
16
- clipboard: {
17
- copyText: (payload: PluginClipboardCopyTextPayload) => Promise<PluginClipboardCopyTextResponse>;
18
- };
19
- navigation: {
20
- openUrl: (payload: PluginNavigationOpenUrlPayload) => Promise<PluginNavigationOpenUrlResponse>;
21
- revealInFinder: (payload: PluginNavigationRevealInFinderPayload) => Promise<PluginNavigationRevealInFinderResponse>;
22
- openFilePath: (payload: PluginNavigationOpenFilePathPayload) => Promise<PluginNavigationOpenFilePathResponse>;
23
- };
24
- action: {
25
- allocateImageTempPath: (payload: PluginActionAllocateImageTempPathPayload) => Promise<PluginActionAllocateImageTempPathResponse>;
26
- materializeInputImagePath: () => Promise<PluginActionMaterializeInputImagePathResponse>;
27
- allocateOutputFilePath: (payload: PluginActionAllocateOutputFilePathPayload) => Promise<PluginActionAllocateOutputFilePathResponse>;
28
- };
29
- settings: {
30
- get: (payload: PluginSettingsGetPayload) => Promise<PluginSettingsGetResponse>;
31
- getAll: () => Promise<PluginSettingsGetAllResponse>;
32
- };
33
- console: {
34
- log: (payload: PluginConsoleLogPayload) => Promise<PluginConsoleLogResponse>;
35
- };
36
- locale: {
37
- get: () => Promise<PluginLocaleGetResponse>;
38
- };
39
- };
@@ -1,39 +0,0 @@
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 declare function onContext(listener: (payload: PluginContextPayload) => void): () => void;
7
- export declare function getContextSnapshot(): PluginContextPayload | undefined;
8
- export declare function onItem(listener: (payload: PluginClipboardItem) => void): () => void;
9
- export declare function getItemSnapshot(): PluginClipboardItem | undefined;
10
- export declare function onAttachment(listener: (payload: PluginAttachmentPayload) => void): () => void;
11
- export declare function getAttachmentSnapshot(): PluginAttachmentPayload | undefined;
12
- export declare function onDraft(listener: (payload: Record<string, unknown>) => void): () => void;
13
- export declare function getDraftSnapshot(): Record<string, unknown> | undefined;
14
- export declare function onActionInput(listener: (payload: PluginActionUIInput) => void): () => void;
15
- export declare function getActionInputSnapshot(): PluginActionUIInput | undefined;
16
- export declare function onTheme(listener: (payload: PluginThemeTokenSnapshot) => void): () => void;
17
- export declare function getThemeSnapshot(): PluginThemeTokenSnapshot | undefined;
18
- export interface PluginAttachmentHostInvokePayload {
19
- buttonID: string;
20
- }
21
- export declare function onAttachmentHostInvoke(listener: (payload: PluginAttachmentHostInvokePayload) => void): () => void;
22
- export interface PluginActionHostInvokePayload {
23
- buttonID: string;
24
- }
25
- export declare function onActionHostInvoke(listener: (payload: PluginActionHostInvokePayload) => void): () => void;
26
- export interface PluginInfoPanelOnActionPayload {
27
- panelID: string;
28
- buttonID: string;
29
- }
30
- export declare function onInfoPanelOnAction(listener: (payload: PluginInfoPanelOnActionPayload) => void): () => void;
31
- export interface PluginInfoPanelOnClosePayload {
32
- panelID: string;
33
- }
34
- export declare function onInfoPanelOnClose(listener: (payload: PluginInfoPanelOnClosePayload) => void): () => void;
35
- export interface PluginLocalePayload {
36
- locale: string;
37
- }
38
- export declare function onLocale(listener: (payload: PluginLocalePayload) => void): () => void;
39
- export declare function getLocaleSnapshot(): PluginLocalePayload | undefined;
@@ -1,17 +0,0 @@
1
- import type { PluginActionUIInput, PluginAttachmentPayload, PluginClipboardItem, PluginThemeTokenSnapshot } from './data.generated.js';
2
- import type { PluginActionHostInvokePayload, PluginAttachmentHostInvokePayload, PluginContextPayload, PluginInfoPanelOnActionPayload, PluginInfoPanelOnClosePayload, PluginLocalePayload } from './topicSubscribers.generated.js';
3
- export declare const _pluginContextTopic: import("../internal/topic.js").MutableTopic<PluginContextPayload>;
4
- export declare const _itemTopic: import("../internal/topic.js").MutableTopic<PluginClipboardItem>;
5
- export declare const _itemAttachmentTopic: import("../internal/topic.js").MutableTopic<PluginAttachmentPayload>;
6
- export declare const _actionDraftTopic: import("../internal/topic.js").MutableTopic<Record<string, unknown>>;
7
- export declare const _actionInputTopic: import("../internal/topic.js").MutableTopic<PluginActionUIInput>;
8
- export declare const _themeTopic: import("../internal/topic.js").MutableTopic<PluginThemeTokenSnapshot>;
9
- export declare const _attachmentRendererOnHostInvokeStream: import("../internal/topic.js").MutableStream<PluginAttachmentHostInvokePayload>;
10
- export declare const _actionOnHostInvokeStream: import("../internal/topic.js").MutableStream<PluginActionHostInvokePayload>;
11
- export declare const _infoPanelOnActionStream: import("../internal/topic.js").MutableStream<PluginInfoPanelOnActionPayload>;
12
- export declare const _infoPanelOnCloseStream: import("../internal/topic.js").MutableStream<PluginInfoPanelOnClosePayload>;
13
- export declare const _localeTopic: import("../internal/topic.js").MutableTopic<PluginLocalePayload>;
14
- export declare class PluginContextError extends Error {
15
- constructor(message: string);
16
- }
17
- export declare function guardContext<A extends unknown[], R>(expected: 'attachmentRenderer' | 'action', run: (...args: A) => R): (...args: A) => R;
@@ -1,48 +0,0 @@
1
- export interface IPCBusIO {
2
- write(line: string): void;
3
- onLine(handler: (line: string) => void): void;
4
- }
5
- export interface InboundHandler<Req, Resp> {
6
- (request: Req): Promise<Resp> | Resp;
7
- }
8
- export interface IPCBus {
9
- request<Req, Resp>(method: string, payload: Req): Promise<Resp>;
10
- onMethod<Req, Resp>(method: string, handler: InboundHandler<Req, Resp>): void;
11
- start(): void;
12
- }
13
- /**
14
- * Structured error frame shape (D6.1 upgrade). Old wire shape was `error: string`;
15
- * the bus now emits `error: { name, message, data? }` and accepts both shapes on
16
- * the inbound path. See docs/specs/2026-05-19-plugin-ui-to-runtime-rpc-design.md §7.
17
- */
18
- export interface IPCBusErrorFrame {
19
- name: string;
20
- message: string;
21
- data?: unknown;
22
- }
23
- /**
24
- * Serialize a thrown value into the structured wire shape `{name, message, data?}`.
25
- * Preserves Error subclass `.name` and any `.data` payload custom Error
26
- * subclasses may carry. Non-Error throws collapse to `name: 'Error'`.
27
- */
28
- export declare function serializeError(err: unknown): IPCBusErrorFrame;
29
- /**
30
- * Reconstruct an Error from a wire-side error field. Accepts both the legacy
31
- * bare-string shape (older native runtime) and the new structured shape
32
- * (D6.1+). Custom Error subclass prototypes cannot be restored across the bus
33
- * — callers should branch on `err.name` and read `(err as any).data` for
34
- * business fields.
35
- */
36
- export declare function deserializeError(raw: unknown): Error;
37
- export declare function createIPCBus(io: IPCBusIO): IPCBus;
38
- /**
39
- * Configure the global IPC bus singleton.
40
- * Must be called once by the plugin runtime before any generated code runs.
41
- */
42
- export declare function configureIpcBus(bus: IPCBus): void;
43
- /**
44
- * The global IPC bus singleton.
45
- * Access is proxied so callers can import `ipcBus` at module evaluation time
46
- * without requiring the bus to be configured yet.
47
- */
48
- export declare const ipcBus: IPCBus;
@@ -1,3 +0,0 @@
1
- import type { PluginRuntimeInvokePayload } from '../generated/capabilityClients.generated.js';
2
- export declare function callRuntimeInvokeStrict(payload: PluginRuntimeInvokePayload): Promise<unknown>;
3
- export declare function parseReplyError(raw: unknown): Error;