@kdlbs/plugin-sdk 0.2.0 → 0.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kdlbs/plugin-sdk",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Versioned frontend contracts for Kandev runtime plugins",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
package/sdk-release.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schema_version": 1,
3
- "sdk_version": "0.2.0",
4
- "host_release": "0.100.0",
5
- "min_kandev_version": "0.100.0",
3
+ "sdk_version": "0.3.0",
4
+ "host_release": "0.102.0",
5
+ "min_kandev_version": "0.102.0",
6
6
  "api_versions": [
7
7
  1,
8
8
  2
package/src/index.ts CHANGED
@@ -269,6 +269,8 @@ export interface HostReact {
269
269
  }
270
270
 
271
271
  export interface ActionInput {
272
+ notificationProviderId?: string;
273
+ notificationFormatter?: NotificationFormatterActionContext;
272
274
  workspaceId?: string;
273
275
  taskId?: string;
274
276
  sessionId?: string;
@@ -276,6 +278,55 @@ export interface ActionInput {
276
278
  body?: unknown;
277
279
  }
278
280
 
281
+ export interface NotificationFormatterActionContext {
282
+ installationId: string;
283
+ formatterKey: string;
284
+ expectedBindingRevision: string;
285
+ mode: "candidate" | "active";
286
+ }
287
+
288
+ /** Content-extension declaration selected for an owned notification provider. */
289
+ export interface NotificationFormatterChoice {
290
+ plugin_id: string;
291
+ installation_id: string;
292
+ key: string;
293
+ version: string;
294
+ }
295
+
296
+ export interface NotificationFormatterBinding {
297
+ provider_id: string;
298
+ provider_type: string;
299
+ plugin_id: string;
300
+ installation_id: string;
301
+ formatter_key: string;
302
+ configuration_revision: string;
303
+ digest: string;
304
+ revision: string;
305
+ }
306
+
307
+ /** Props for the owner-isolated notification-formatter slot. The backend
308
+ * reauthorizes provider and installation identity for every operation. */
309
+ export interface NotificationFormatterSlotProps {
310
+ provider: { id: string; name: string; type: string; events: readonly string[] };
311
+ events: readonly string[];
312
+ formatter: NotificationFormatterChoice;
313
+ binding: NotificationFormatterBinding | null;
314
+ /** Register selection-only drafts with shared Save; first activation stays explicit. */
315
+ selectionChanged?: boolean;
316
+ activateConfiguration(
317
+ prepared: { revision: string; digest: string },
318
+ expectedBindingRevision: string,
319
+ ): Promise<NotificationFormatterBinding>;
320
+ reload(): Promise<void>;
321
+ readActiveBinding(): Promise<NotificationFormatterBinding | null>;
322
+ previewConfiguration(
323
+ draft: unknown,
324
+ event: string,
325
+ sample: string,
326
+ signal?: AbortSignal,
327
+ ): Promise<{ title: string; body: string; used_fallback: boolean }>;
328
+ }
329
+
279
330
  export interface PluginHostRepository {
280
331
  id: string;
281
332
  workspace_id: string;