@yaklabs-ai/plugin-sdk 0.55.2 → 0.55.3

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/README.md CHANGED
@@ -13,7 +13,7 @@ it under the name your plugin code actually imports:
13
13
  ```json
14
14
  {
15
15
  "dependencies": {
16
- "@bonsai/plugin-sdk": "npm:@yaklabs-ai/plugin-sdk@^0.55.2"
16
+ "@bonsai/plugin-sdk": "npm:@yaklabs-ai/plugin-sdk@^0.55.3"
17
17
  }
18
18
  }
19
19
  ```
@@ -62,7 +62,7 @@ Every tool the entrypoint registers is declared in the manifest too:
62
62
  "description": "Greets people by name.",
63
63
  "version": "0.1.0",
64
64
  "namespace": "widgets",
65
- "compatibility": { "sdk": "^0.55.2" },
65
+ "compatibility": { "sdk": "^0.55.3" },
66
66
  "targets": {
67
67
  "kay": {
68
68
  "agent": {
@@ -153,7 +153,7 @@ naming both versions, instead of loading it and finding no `activate`.
153
153
  | `@bonsai/plugin-sdk/system-one` | The types and error class for `api.systemOne` / `app.systemOne`, from 0.13.8 |
154
154
  | `@bonsai/plugin-sdk/zod` | `z` (the host's in the daemon), on an entry with no other import, from 0.13.9 |
155
155
 
156
- A plugin that imports these subpaths declares the current supported SDK range (`^0.55.2`).
156
+ A plugin that imports these subpaths declares the current supported SDK range (`^0.55.3`).
157
157
  The rows record when each subpath appeared, not retained runtime compatibility. `vendored-mcp` builds the plugin's URI module (its link cards and help); hosting the
158
158
  vendor's MCP server itself is a separate host decision: Bonsai hosts it once a person approves
159
159
  the plugin's `mcp.host-server` grant for that server's name and URL. A server that needs an OAuth
@@ -161,7 +161,7 @@ sign-in names one of the plugin's auth services in `authService`; that service m
161
161
  one `delegated` scheme, which Bonsai uses to sign the person in to the server. Bonsai declares that
162
162
  scheme at runtime; the plugin's code must not declare it again. From 0.16.2 a plugin's code can also
163
163
  call the server's tools through `api.vendoredMcp.port(<server>)`, typed by this subpath's
164
- `VendoredMcpPort` and `VendoredMcpOutcome` (declare `^0.55.2`).
164
+ `VendoredMcpPort` and `VendoredMcpOutcome` (declare `^0.55.3`).
165
165
 
166
166
  From 0.13.10 the manifest schema carries two facts Bonsai reads for its own plugins only; another
167
167
  plugin's are ignored, with a load diagnostic. An `external-cli` auth scheme's `cli` says how Bonsai
@@ -243,7 +243,7 @@ Provider schemas remain authoritative; declaring a dependency grants no authorit
243
243
  through `app.uri`, parse returned Markdown in the consuming plugin, and retain the read's
244
244
  revision (or `contentDigest` from `/uri`) for edits. The old `memory.read` and `memory.write`
245
245
  grants do not authorize the replacement scheme-and-verb calls. Contracts before 0.49.0 are
246
- refused; migrate and declare `^0.55.2`. The current host also serves the 0.49.0 resource contract.
246
+ refused; migrate and declare `^0.55.3`. The current host also serves the 0.49.0 resource contract.
247
247
 
248
248
  ## What this package is, and is not, at runtime
249
249
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "package": "@yaklabs-ai/plugin-sdk",
4
- "version": "0.55.2",
4
+ "version": "0.55.3",
5
5
  "target": "npm",
6
6
  "firstPartyLicense": "MIT",
7
7
  "bundled": [
@@ -2682,8 +2682,13 @@ declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
2682
2682
  * artifact usage declarations. A plugin using these declares ^0.55.1.
2683
2683
  *
2684
2684
  * 0.55.2 adds opt-in query and connection-selector preservation during URI claim normalization.
2685
+ *
2686
+ * 0.55.3 lets a signal carry the item's own text. `PluginSignal` gains an optional `body`: plain
2687
+ * text, at most `PLUGIN_SIGNAL_BODY_MAX` (20,000) characters. Gmail puts a mail's text there, so
2688
+ * Flows can keep the messages a task came from. Additive: a plugin that publishes a body declares
2689
+ * ^0.55.3.
2685
2690
  */
2686
- declare const KAY_PLUGIN_SDK_VERSION: "0.55.2";
2691
+ declare const KAY_PLUGIN_SDK_VERSION: "0.55.3";
2687
2692
 
2688
2693
  declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
2689
2694
 
@@ -2736,8 +2736,13 @@ declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
2736
2736
  * artifact usage declarations. A plugin using these declares ^0.55.1.
2737
2737
  *
2738
2738
  * 0.55.2 adds opt-in query and connection-selector preservation during URI claim normalization.
2739
+ *
2740
+ * 0.55.3 lets a signal carry the item's own text. `PluginSignal` gains an optional `body`: plain
2741
+ * text, at most `PLUGIN_SIGNAL_BODY_MAX` (20,000) characters. Gmail puts a mail's text there, so
2742
+ * Flows can keep the messages a task came from. Additive: a plugin that publishes a body declares
2743
+ * ^0.55.3.
2739
2744
  */
2740
- declare const KAY_PLUGIN_SDK_VERSION: "0.55.2";
2745
+ declare const KAY_PLUGIN_SDK_VERSION: "0.55.3";
2741
2746
 
2742
2747
  declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
2743
2748
 
@@ -3090,8 +3090,13 @@ declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
3090
3090
  * artifact usage declarations. A plugin using these declares ^0.55.1.
3091
3091
  *
3092
3092
  * 0.55.2 adds opt-in query and connection-selector preservation during URI claim normalization.
3093
+ *
3094
+ * 0.55.3 lets a signal carry the item's own text. `PluginSignal` gains an optional `body`: plain
3095
+ * text, at most `PLUGIN_SIGNAL_BODY_MAX` (20,000) characters. Gmail puts a mail's text there, so
3096
+ * Flows can keep the messages a task came from. Additive: a plugin that publishes a body declares
3097
+ * ^0.55.3.
3093
3098
  */
3094
- declare const KAY_PLUGIN_SDK_VERSION: "0.55.2";
3099
+ declare const KAY_PLUGIN_SDK_VERSION: "0.55.3";
3095
3100
 
3096
3101
  declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
3097
3102
 
@@ -2230,6 +2230,14 @@ declare interface KayAppSessions {
2230
2230
  * against `sessions.read`. Unsupported hosts may omit it.
2231
2231
  */
2232
2232
  listSessionPage?(request: KayAppSessionListRequest): Promise<KayAppSessionList>;
2233
+ /**
2234
+ * Called after a stored session's index row changes (its title, folder or project, or its
2235
+ * removal); a change without `sessionId` means any session may have changed. Checked against
2236
+ * `sessions.read`. Returns the unsubscribe. Unsupported hosts may omit it.
2237
+ */
2238
+ subscribeChanges?(listener: (change: {
2239
+ readonly sessionId?: string;
2240
+ }) => void): () => void;
2233
2241
  /**
2234
2242
  * Read a cheap transcript change marker without loading the entry log. Unknown or deleted
2235
2243
  * sessions yield `undefined`.
package/dist/kay-app.d.ts CHANGED
@@ -4392,8 +4392,13 @@ declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
4392
4392
  * artifact usage declarations. A plugin using these declares ^0.55.1.
4393
4393
  *
4394
4394
  * 0.55.2 adds opt-in query and connection-selector preservation during URI claim normalization.
4395
+ *
4396
+ * 0.55.3 lets a signal carry the item's own text. `PluginSignal` gains an optional `body`: plain
4397
+ * text, at most `PLUGIN_SIGNAL_BODY_MAX` (20,000) characters. Gmail puts a mail's text there, so
4398
+ * Flows can keep the messages a task came from. Additive: a plugin that publishes a body declares
4399
+ * ^0.55.3.
4395
4400
  */
4396
- declare const KAY_PLUGIN_SDK_VERSION: "0.55.2";
4401
+ declare const KAY_PLUGIN_SDK_VERSION: "0.55.3";
4397
4402
 
4398
4403
  declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
4399
4404
 
@@ -6981,8 +6986,19 @@ export declare interface KayAppPluginApi {
6981
6986
  implementWorkflow(localId: string, run: KayAppWorkflowImplementation): void;
6982
6987
  }
6983
6988
 
6989
+ /** What `kay.app` code may add to one publish beyond the event itself. */
6990
+ export declare interface KayAppPluginEventPublishOptions {
6991
+ /**
6992
+ * A session this plugin created through `sessions.create`: the host records it as the event's
6993
+ * session, so a notification rule's `session-unfocused` stays quiet while that session is the
6994
+ * focused pane. The host refuses a session this plugin did not create. Absent publishes an
6995
+ * app-lifetime event, as before.
6996
+ */
6997
+ readonly sessionId?: string;
6998
+ }
6999
+
6984
7000
  export declare interface KayAppPluginEvents {
6985
- publish(localId: string, input: PluginEventPublishInput): void;
7001
+ publish(localId: string, input: PluginEventPublishInput, options?: KayAppPluginEventPublishOptions): void;
6986
7002
  }
6987
7003
 
6988
7004
  /**
@@ -7927,6 +7943,14 @@ export declare interface KayAppSessions {
7927
7943
  * against `sessions.read`. Unsupported hosts may omit it.
7928
7944
  */
7929
7945
  listSessionPage?(request: KayAppSessionListRequest): Promise<KayAppSessionList>;
7946
+ /**
7947
+ * Called after a stored session's index row changes (its title, folder or project, or its
7948
+ * removal); a change without `sessionId` means any session may have changed. Checked against
7949
+ * `sessions.read`. Returns the unsubscribe. Unsupported hosts may omit it.
7950
+ */
7951
+ subscribeChanges?(listener: (change: {
7952
+ readonly sessionId?: string;
7953
+ }) => void): () => void;
7930
7954
  /**
7931
7955
  * Read a cheap transcript change marker without loading the entry log. Unknown or deleted
7932
7956
  * sessions yield `undefined`.
@@ -10055,13 +10079,20 @@ export declare interface KayAppWorkingDocuments {
10055
10079
  * recovery data.
10056
10080
  */
10057
10081
  export declare interface KayAppWorkspace {
10082
+ /**
10083
+ * Called after the window publishes a new snapshot (tabs, groups, panes or titles changed). Read
10084
+ * `snapshot()` for the new state. Returns the unsubscribe.
10085
+ */
10086
+ subscribe(listener: () => void): () => void;
10058
10087
  snapshot(): Promise<{
10059
10088
  readonly kind: "snapshot";
10060
10089
  readonly snapshot: KayAppWorkspaceSnapshot;
10061
10090
  } | {
10062
10091
  readonly kind: "unavailable";
10063
10092
  }>;
10064
- execute(command: KayAppWorkspaceCommand, ctx: KayAppWorkspaceExecuteContext): Promise<{
10093
+ execute(command: KayAppWorkspaceCommand,
10094
+ /** The session the command is issued for; absent for a plugin's own background work. */
10095
+ ctx?: KayAppWorkspaceExecuteContext): Promise<{
10065
10096
  readonly kind: "outcome";
10066
10097
  readonly outcome: KayAppWorkspaceCommandOutcome;
10067
10098
  readonly validPageIds?: readonly string[];
@@ -10105,6 +10136,23 @@ export declare type KayAppWorkspaceCommand = {
10105
10136
  } | {
10106
10137
  verb: "tabs.ungroup";
10107
10138
  tabIds: readonly string[];
10139
+ } | {
10140
+ /**
10141
+ * Set the membership and look of this plugin's own linked tab groups, computed from the
10142
+ * snapshot numbered `rev` (`stale` when the tabs changed since). Each listed group ends up
10143
+ * holding exactly `tabIds` plus its guests, created when missing; only ungrouped Tabs join.
10144
+ * One of this plugin's groups left unlisted keeps only its guests. Never recorded as the
10145
+ * person's own edit.
10146
+ */
10147
+ verb: "tabs.syncLinkedGroups";
10148
+ rev: number;
10149
+ groups: readonly {
10150
+ readonly key: string;
10151
+ readonly name: string;
10152
+ readonly color?: KayAppWorkspaceTabGroupColor | undefined;
10153
+ readonly icon?: string | undefined;
10154
+ readonly tabIds: readonly string[];
10155
+ }[];
10108
10156
  } | {
10109
10157
  verb: "panes.split";
10110
10158
  tabId: string;
@@ -10263,15 +10311,21 @@ export declare type KayAppWorkspacePlaceContent = {
10263
10311
  };
10264
10312
 
10265
10313
  /** The full workspace tree, app-wide (every tab, not one session's). */
10266
- export declare interface KayAppWorkspaceSnapshot {
10267
- readonly rev: number;
10268
- readonly activeTabId: string;
10269
- readonly tabs: readonly KayAppWorkspaceTabSnapshot[];
10270
- }
10314
+ /**
10315
+ * The workspace as the window last published it: every Tab, the tab groups (`link` present only on
10316
+ * a linked tab group), and the person's linked-group guests and dismissals in this window.
10317
+ */
10318
+ export declare type KayAppWorkspaceSnapshot = ReadonlyContract<WorkspaceSnapshot>;
10271
10319
 
10272
10320
  /** The tab-group colour palette, by name (Chrome's nine); mirrors the wire schema's enum. */
10273
10321
  export declare type KayAppWorkspaceTabGroupColor = "grey" | "blue" | "red" | "yellow" | "green" | "pink" | "purple" | "cyan" | "orange";
10274
10322
 
10323
+ /** The plugin a linked tab group belongs to and the key that plugin chose for it. */
10324
+ export declare type KayAppWorkspaceTabGroupLink = NonNullable<KayAppWorkspaceTabGroupSnapshot["link"]>;
10325
+
10326
+ /** One tab group in the strip. */
10327
+ export declare type KayAppWorkspaceTabGroupSnapshot = NonNullable<KayAppWorkspaceSnapshot["groups"]>[number];
10328
+
10275
10329
  export declare type KayAppWorkspaceTabSnapshot = ReadonlyContract<WorkspaceTabSnapshot>;
10276
10330
 
10277
10331
  /**
@@ -11534,6 +11588,12 @@ export declare const PLUGIN_SIGNAL_ATTACHMENT_TYPE_MAX = 127;
11534
11588
  /** At most this many entries in a signal's `attachments`; a source lists the first ones. */
11535
11589
  export declare const PLUGIN_SIGNAL_ATTACHMENTS_MAX = 10;
11536
11590
 
11591
+ /**
11592
+ * A signal's `body`, the item's own text, at most this many characters: a source cuts longer text
11593
+ * and marks the cut. Enough for a long email with its quoted history.
11594
+ */
11595
+ export declare const PLUGIN_SIGNAL_BODY_MAX = 20000;
11596
+
11537
11597
  /** The `kind` values of `PluginSignal` v1. `status` is system state that clears itself. */
11538
11598
  export declare const PLUGIN_SIGNAL_KINDS: readonly ["message", "request", "mention", "invite", "status"];
11539
11599
 
@@ -11715,6 +11775,7 @@ export declare const PluginSignal: z.ZodObject<{
11715
11775
  }>>;
11716
11776
  title: z.ZodOptional<z.ZodString>;
11717
11777
  snippet: z.ZodOptional<z.ZodString>;
11778
+ body: z.ZodOptional<z.ZodString>;
11718
11779
  actor: z.ZodOptional<z.ZodObject<{
11719
11780
  name: z.ZodOptional<z.ZodString>;
11720
11781
  uri: z.ZodString;
@@ -11759,6 +11820,7 @@ export declare const PluginSignalPublish: z.ZodObject<{
11759
11820
  }>>;
11760
11821
  title: z.ZodOptional<z.ZodString>;
11761
11822
  snippet: z.ZodOptional<z.ZodString>;
11823
+ body: z.ZodOptional<z.ZodString>;
11762
11824
  actor: z.ZodOptional<z.ZodObject<{
11763
11825
  name: z.ZodOptional<z.ZodString>;
11764
11826
  uri: z.ZodString;
@@ -19170,6 +19232,7 @@ declare const WorkspaceCommandOutcome: z.ZodEnum<{
19170
19232
  "no-window": "no-window";
19171
19233
  "not-found": "not-found";
19172
19234
  applied: "applied";
19235
+ stale: "stale";
19173
19236
  }>;
19174
19237
 
19175
19238
  declare type WorkspaceCommandOutcome = z.infer<typeof WorkspaceCommandOutcome>;
@@ -19222,11 +19285,64 @@ declare type WorkspacePaneNode = {
19222
19285
 
19223
19286
  declare const WorkspacePaneNode: z.ZodType<WorkspacePaneNode>;
19224
19287
 
19288
+ /**
19289
+ * The full workspace tree, app-wide (every tab, not one session's). `rev` is a monotonic counter the
19290
+ * renderer stamps on push (mirroring the `<kay_tab_context>` block's `rev`), so a reader can tell a
19291
+ * pulled snapshot apart from one already in hand.
19292
+ */
19293
+ declare const WorkspaceSnapshot: z.ZodObject<{
19294
+ rev: z.ZodNumber;
19295
+ activeTabId: z.ZodString;
19296
+ tabs: z.ZodArray<z.ZodObject<{
19297
+ id: z.ZodString;
19298
+ label: z.ZodString;
19299
+ active: z.ZodBoolean;
19300
+ variable: z.ZodOptional<z.ZodBoolean>;
19301
+ preview: z.ZodOptional<z.ZodBoolean>;
19302
+ groupId: z.ZodOptional<z.ZodString>;
19303
+ sessionIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
19304
+ focusedPaneId: z.ZodString;
19305
+ maximizedPaneId: z.ZodNullable<z.ZodString>;
19306
+ root: z.ZodType<WorkspacePaneNode, unknown, z.core.$ZodTypeInternals<WorkspacePaneNode, unknown>>;
19307
+ }, z.core.$strict>>;
19308
+ groups: z.ZodOptional<z.ZodArray<z.ZodObject<{
19309
+ id: z.ZodString;
19310
+ name: z.ZodString;
19311
+ color: z.ZodEnum<{
19312
+ grey: "grey";
19313
+ blue: "blue";
19314
+ red: "red";
19315
+ yellow: "yellow";
19316
+ green: "green";
19317
+ pink: "pink";
19318
+ purple: "purple";
19319
+ cyan: "cyan";
19320
+ orange: "orange";
19321
+ }>;
19322
+ collapsed: z.ZodOptional<z.ZodBoolean>;
19323
+ icon: z.ZodOptional<z.ZodString>;
19324
+ link: z.ZodOptional<z.ZodObject<{
19325
+ pluginId: z.ZodString;
19326
+ key: z.ZodString;
19327
+ }, z.core.$strict>>;
19328
+ }, z.core.$strict>>>;
19329
+ linkedGroupGuests: z.ZodOptional<z.ZodArray<z.ZodString>>;
19330
+ linkedGroupsDismissed: z.ZodOptional<z.ZodArray<z.ZodObject<{
19331
+ pluginId: z.ZodString;
19332
+ key: z.ZodString;
19333
+ }, z.core.$strict>>>;
19334
+ }, z.core.$strict>;
19335
+
19336
+ declare type WorkspaceSnapshot = z.infer<typeof WorkspaceSnapshot>;
19337
+
19225
19338
  declare const WorkspaceTabSnapshot: z.ZodObject<{
19226
19339
  id: z.ZodString;
19227
19340
  label: z.ZodString;
19228
19341
  active: z.ZodBoolean;
19229
19342
  variable: z.ZodOptional<z.ZodBoolean>;
19343
+ preview: z.ZodOptional<z.ZodBoolean>;
19344
+ groupId: z.ZodOptional<z.ZodString>;
19345
+ sessionIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
19230
19346
  focusedPaneId: z.ZodString;
19231
19347
  maximizedPaneId: z.ZodNullable<z.ZodString>;
19232
19348
  root: z.ZodType<WorkspacePaneNode, unknown, z.core.$ZodTypeInternals<WorkspacePaneNode, unknown>>;
package/dist/kay-app.js CHANGED
@@ -371,6 +371,7 @@ var PLUGIN_SIGNAL_KINDS = [
371
371
  ];
372
372
  var PLUGIN_SIGNAL_TITLE_MAX = 300;
373
373
  var PLUGIN_SIGNAL_SNIPPET_MAX = 500;
374
+ var PLUGIN_SIGNAL_BODY_MAX = 2e4;
374
375
  var PLUGIN_SIGNAL_LABELS_MAX = 20;
375
376
  var PLUGIN_SIGNAL_LABEL_MAX = 64;
376
377
  var PLUGIN_SIGNAL_ATTACHMENTS_MAX = 10;
@@ -1205,6 +1206,7 @@ export {
1205
1206
  PLUGIN_SIGNAL_ATTACHMENTS_MAX,
1206
1207
  PLUGIN_SIGNAL_ATTACHMENT_NAME_MAX,
1207
1208
  PLUGIN_SIGNAL_ATTACHMENT_TYPE_MAX,
1209
+ PLUGIN_SIGNAL_BODY_MAX,
1208
1210
  PLUGIN_SIGNAL_KINDS,
1209
1211
  PLUGIN_SIGNAL_LABELS_MAX,
1210
1212
  PLUGIN_SIGNAL_LABEL_MAX,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yaklabs-ai/plugin-sdk",
3
- "version": "0.55.2",
3
+ "version": "0.55.3",
4
4
  "description": "The Kay plugin SDK — types and helpers for authoring a Kay directory plugin.",
5
5
  "author": "YakLabs",
6
6
  "type": "module",