@kdlbs/plugin-sdk 0.2.1 → 0.4.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.1",
3
+ "version": "0.4.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,11 +1,11 @@
1
1
  {
2
2
  "schema_version": 1,
3
- "sdk_version": "0.2.1",
4
- "host_release": "0.101.0",
5
- "min_kandev_version": "0.101.0",
3
+ "sdk_version": "0.4.0",
4
+ "host_release": "0.103.0",
5
+ "min_kandev_version": "0.103.0",
6
6
  "api_versions": [
7
7
  1,
8
8
  2
9
9
  ],
10
- "change_kind": "patch"
10
+ "change_kind": "additive"
11
11
  }
package/src/index.ts CHANGED
@@ -6,6 +6,22 @@
6
6
  * all runtime values during initialize and use these structural types at
7
7
  * compile time only.
8
8
  */
9
+
10
+ /** Host-resolved complete grouping, distinct from page-local task-list facets. */
11
+ export type SidebarGroupingReference = `plugin:${string}:${string}`;
12
+ export interface SidebarGroupingProvider {
13
+ reference: SidebarGroupingReference;
14
+ label: string;
15
+ labelKey?: string;
16
+ generation: string;
17
+ }
18
+ export interface SidebarGroupingSnapshot {
19
+ version: 1;
20
+ revision: string;
21
+ complete: true;
22
+ groups: Array<{ id: string; label: string; color?: string }>;
23
+ memberships: Array<{ task_id: string; group_id: string }>;
24
+ }
9
25
  export type HostNode = unknown;
10
26
  // `any` is deliberate at these two React compatibility seams. Reproducing
11
27
  // React's overloaded createElement and recursive ReactNode types would make
@@ -269,6 +285,8 @@ export interface HostReact {
269
285
  }
270
286
 
271
287
  export interface ActionInput {
288
+ notificationProviderId?: string;
289
+ notificationFormatter?: NotificationFormatterActionContext;
272
290
  workspaceId?: string;
273
291
  taskId?: string;
274
292
  sessionId?: string;
@@ -276,6 +294,55 @@ export interface ActionInput {
276
294
  body?: unknown;
277
295
  }
278
296
 
297
+ export interface NotificationFormatterActionContext {
298
+ installationId: string;
299
+ formatterKey: string;
300
+ expectedBindingRevision: string;
301
+ mode: "candidate" | "active";
302
+ }
303
+
304
+ /** Content-extension declaration selected for an owned notification provider. */
305
+ export interface NotificationFormatterChoice {
306
+ plugin_id: string;
307
+ installation_id: string;
308
+ key: string;
309
+ version: string;
310
+ }
311
+
312
+ export interface NotificationFormatterBinding {
313
+ provider_id: string;
314
+ provider_type: string;
315
+ plugin_id: string;
316
+ installation_id: string;
317
+ formatter_key: string;
318
+ configuration_revision: string;
319
+ digest: string;
320
+ revision: string;
321
+ }
322
+
323
+ /** Props for the owner-isolated notification-formatter slot. The backend
324
+ * reauthorizes provider and installation identity for every operation. */
325
+ export interface NotificationFormatterSlotProps {
326
+ provider: { id: string; name: string; type: string; events: readonly string[] };
327
+ events: readonly string[];
328
+ formatter: NotificationFormatterChoice;
329
+ binding: NotificationFormatterBinding | null;
330
+ /** Register selection-only drafts with shared Save; first activation stays explicit. */
331
+ selectionChanged?: boolean;
332
+ activateConfiguration(
333
+ prepared: { revision: string; digest: string },
334
+ expectedBindingRevision: string,
335
+ ): Promise<NotificationFormatterBinding>;
336
+ reload(): Promise<void>;
337
+ readActiveBinding(): Promise<NotificationFormatterBinding | null>;
338
+ previewConfiguration(
339
+ draft: unknown,
340
+ event: string,
341
+ sample: string,
342
+ signal?: AbortSignal,
343
+ ): Promise<{ title: string; body: string; used_fallback: boolean }>;
344
+ }
345
+
279
346
  export interface PluginHostRepository {
280
347
  id: string;
281
348
  workspace_id: string;
@@ -1435,7 +1502,19 @@ export interface IntegrationSettingsActionProps {
1435
1502
  surface: IntegrationSettingsActionSurface;
1436
1503
  }
1437
1504
 
1505
+ /** Host-selected, read-only file bytes. The host grants access before mounting. */
1506
+ export interface FileViewerProps {
1507
+ file: { name: string; sizeBytes: number; generation: string };
1508
+ readBytes(signal: AbortSignal): Promise<ArrayBuffer>;
1509
+ }
1510
+ export interface FileViewerRegistration {
1511
+ id: string;
1512
+ Component: Component<FileViewerProps>;
1513
+ }
1514
+
1438
1515
  export interface PluginRegistry {
1516
+ /** Register a viewer declared in ui.file_viewers. */
1517
+ registerFileViewer(registration: FileViewerRegistration): void;
1439
1518
  registerTranslations(catalogs: PluginTranslationCatalogs): void;
1440
1519
  registerRoute(path: string, component: Component, options?: PluginRouteOptions): void;
1441
1520
  registerNavItem(item: {