@yaklabs-ai/plugin-sdk 0.32.0 → 0.34.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/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.32.0"
16
+ "@bonsai/plugin-sdk": "npm:@yaklabs-ai/plugin-sdk@^0.34.0"
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.32.0" },
65
+ "compatibility": { "sdk": "^0.34.0" },
66
66
  "targets": {
67
67
  "kay": {
68
68
  "agent": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "package": "@yaklabs-ai/plugin-sdk",
4
- "version": "0.32.0",
4
+ "version": "0.34.0",
5
5
  "target": "npm",
6
6
  "firstPartyLicense": "MIT",
7
7
  "bundled": [
@@ -304,6 +304,8 @@ declare interface BackgroundTaskFailedEvent {
304
304
  readonly errorStack?: string;
305
305
  /** An agent task's run failure reason; see `BackgroundTaskCompletion.failureReason` in `@herd/plugin-primitives`. */
306
306
  readonly failureReason?: RunFailureReason;
307
+ /** The run failure record the task relays; see `BackgroundTaskCompletion.failureRef`. */
308
+ readonly failureRef?: FailureRef;
307
309
  readonly snapshot?: BackgroundTaskSnapshot;
308
310
  }
309
311
 
@@ -681,7 +681,15 @@ var TOOL_CALL_FAILURE_CODES = [
681
681
  "uri.not_connected.sign_in_expired",
682
682
  "tool.blocked.by_user",
683
683
  "tool.blocked.by_rule",
684
- "tool.blocked.by_bonsai"
684
+ "tool.blocked.by_bonsai",
685
+ // Situation codes that split the settings block (`by_rule` now means a
686
+ // Permissions rule only) and the Bonsai block further. Same reading rules
687
+ // as above.
688
+ "tool.blocked.by_mode",
689
+ "tool.blocked.protected_path",
690
+ "tool.blocked.approval_not_shown",
691
+ "tool.blocked.unverified",
692
+ "tool.blocked.edits_not_applied"
685
693
  ];
686
694
  var count = z5.number().int().nonnegative();
687
695
  var toolCallFailureDetailsSchema = z5.strictObject({
@@ -337,6 +337,11 @@ declare interface BackgroundTaskCompletion {
337
337
  readonly errorStack?: string;
338
338
  /** Why a failed AGENT task's run failed, classified from what it threw; absent for other kinds. */
339
339
  readonly failureReason?: RunFailureReason;
340
+ /** The run failure record a failed agent task relays, when its run already recorded one. */
341
+ readonly failureRef?: {
342
+ readonly authority: string;
343
+ readonly id: string;
344
+ };
340
345
  }
341
346
 
342
347
  declare type BackgroundTaskInspector = () => Promise<string> | string;
@@ -2366,8 +2371,17 @@ declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
2366
2371
  * 0.32.0 lets an app-data source declare its window store as data (#15891). `store` under
2367
2372
  * `contributes.dataSources` replaces a `kay.ui` data materializer, and a change too big for a live
2368
2373
  * update becomes a re-read of the snapshot. A plugin that declares a store declares ^0.32.0.
2374
+ *
2375
+ * 0.33.0 lets a plugin declare a window command with its button and menu item (#15903). `commands`
2376
+ * under `kay.ui` `contributes` names each command's title, icon file, `button`, `menu` and `where`,
2377
+ * and `api.implementCommand(localId, handler)` supplies what it does. `placement` is gone and `icon`
2378
+ * is now a file path: nothing ever read either. A plugin that declares a command declares ^0.33.0.
2379
+ *
2380
+ * 0.34.0 lets a rail entry declare a sidebar (#15901). `panel.body` on a `railEntries` entry names
2381
+ * what fills it, either a `contextOnly` app in the plugin or a body the host ships. Additive: a rail
2382
+ * entry with no `panel` still opens its page alone. A plugin that declares a panel declares ^0.34.0.
2369
2383
  */
2370
- declare const KAY_PLUGIN_SDK_VERSION: "0.32.0";
2384
+ declare const KAY_PLUGIN_SDK_VERSION: "0.34.0";
2371
2385
 
2372
2386
  declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
2373
2387
 
@@ -7620,7 +7634,7 @@ declare type TOmitInstantiate<Context extends TProperties, State extends TState,
7620
7634
  * classification (the engine records the rejection on an unexplained failure),
7621
7635
  * and a stored record with one reads as none.
7622
7636
  */
7623
- declare const TOOL_CALL_FAILURE_CODES: readonly ["tool.invalid_input", "tool.blocked", "tool.cancelled", "tool.timeout", "tool.not_found", "tool.unavailable", "tool.execution_failed", "tool.auth_unavailable", "tool.replies_owed", "provider.http", "provider.api", "provider.transport", "uri.not_found", "uri.unsupported_operation", "uri.not_connected", "uri.auth_unavailable", "permission.denied", "edit.empty_edits", "edit.text_not_found", "edit.text_not_unique", "edit.empty_old_text", "edit.overlapping_edits", "edit.no_change", "uri.not_connected.pick_account", "uri.not_connected.account_not_allowed", "uri.not_connected.sign_in_expired", "tool.blocked.by_user", "tool.blocked.by_rule", "tool.blocked.by_bonsai"];
7637
+ declare const TOOL_CALL_FAILURE_CODES: readonly ["tool.invalid_input", "tool.blocked", "tool.cancelled", "tool.timeout", "tool.not_found", "tool.unavailable", "tool.execution_failed", "tool.auth_unavailable", "tool.replies_owed", "provider.http", "provider.api", "provider.transport", "uri.not_found", "uri.unsupported_operation", "uri.not_connected", "uri.auth_unavailable", "permission.denied", "edit.empty_edits", "edit.text_not_found", "edit.text_not_unique", "edit.empty_old_text", "edit.overlapping_edits", "edit.no_change", "uri.not_connected.pick_account", "uri.not_connected.account_not_allowed", "uri.not_connected.sign_in_expired", "tool.blocked.by_user", "tool.blocked.by_rule", "tool.blocked.by_bonsai", "tool.blocked.by_mode", "tool.blocked.protected_path", "tool.blocked.approval_not_shown", "tool.blocked.unverified", "tool.blocked.edits_not_applied"];
7624
7638
 
7625
7639
  /**
7626
7640
  * ---
@@ -312,6 +312,11 @@ declare interface BackgroundTaskCompletion {
312
312
  readonly errorStack?: string;
313
313
  /** Why a failed AGENT task's run failed, classified from what it threw; absent for other kinds. */
314
314
  readonly failureReason?: RunFailureReason;
315
+ /** The run failure record a failed agent task relays, when its run already recorded one. */
316
+ readonly failureRef?: {
317
+ readonly authority: string;
318
+ readonly id: string;
319
+ };
315
320
  }
316
321
 
317
322
  declare type BackgroundTaskInspector = () => Promise<string> | string;
@@ -2420,8 +2425,17 @@ declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
2420
2425
  * 0.32.0 lets an app-data source declare its window store as data (#15891). `store` under
2421
2426
  * `contributes.dataSources` replaces a `kay.ui` data materializer, and a change too big for a live
2422
2427
  * update becomes a re-read of the snapshot. A plugin that declares a store declares ^0.32.0.
2428
+ *
2429
+ * 0.33.0 lets a plugin declare a window command with its button and menu item (#15903). `commands`
2430
+ * under `kay.ui` `contributes` names each command's title, icon file, `button`, `menu` and `where`,
2431
+ * and `api.implementCommand(localId, handler)` supplies what it does. `placement` is gone and `icon`
2432
+ * is now a file path: nothing ever read either. A plugin that declares a command declares ^0.33.0.
2433
+ *
2434
+ * 0.34.0 lets a rail entry declare a sidebar (#15901). `panel.body` on a `railEntries` entry names
2435
+ * what fills it, either a `contextOnly` app in the plugin or a body the host ships. Additive: a rail
2436
+ * entry with no `panel` still opens its page alone. A plugin that declares a panel declares ^0.34.0.
2423
2437
  */
2424
- declare const KAY_PLUGIN_SDK_VERSION: "0.32.0";
2438
+ declare const KAY_PLUGIN_SDK_VERSION: "0.34.0";
2425
2439
 
2426
2440
  declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
2427
2441
 
@@ -5697,8 +5711,6 @@ declare const ResolvedPluginContractV1: z.ZodObject<{
5697
5711
  "artifacts.preview": "artifacts.preview";
5698
5712
  "cost.read": "cost.read";
5699
5713
  "billing.read": "billing.read";
5700
- "context.read": "context.read";
5701
- "usage.read": "usage.read";
5702
5714
  "self-improvement.read": "self-improvement.read";
5703
5715
  "automations.read": "automations.read";
5704
5716
  "shared-artifacts.read": "shared-artifacts.read";
@@ -8693,7 +8705,7 @@ declare type TOmitInstantiate<Context extends TProperties, State extends TState,
8693
8705
  * classification (the engine records the rejection on an unexplained failure),
8694
8706
  * and a stored record with one reads as none.
8695
8707
  */
8696
- declare const TOOL_CALL_FAILURE_CODES: readonly ["tool.invalid_input", "tool.blocked", "tool.cancelled", "tool.timeout", "tool.not_found", "tool.unavailable", "tool.execution_failed", "tool.auth_unavailable", "tool.replies_owed", "provider.http", "provider.api", "provider.transport", "uri.not_found", "uri.unsupported_operation", "uri.not_connected", "uri.auth_unavailable", "permission.denied", "edit.empty_edits", "edit.text_not_found", "edit.text_not_unique", "edit.empty_old_text", "edit.overlapping_edits", "edit.no_change", "uri.not_connected.pick_account", "uri.not_connected.account_not_allowed", "uri.not_connected.sign_in_expired", "tool.blocked.by_user", "tool.blocked.by_rule", "tool.blocked.by_bonsai"];
8708
+ declare const TOOL_CALL_FAILURE_CODES: readonly ["tool.invalid_input", "tool.blocked", "tool.cancelled", "tool.timeout", "tool.not_found", "tool.unavailable", "tool.execution_failed", "tool.auth_unavailable", "tool.replies_owed", "provider.http", "provider.api", "provider.transport", "uri.not_found", "uri.unsupported_operation", "uri.not_connected", "uri.auth_unavailable", "permission.denied", "edit.empty_edits", "edit.text_not_found", "edit.text_not_unique", "edit.empty_old_text", "edit.overlapping_edits", "edit.no_change", "uri.not_connected.pick_account", "uri.not_connected.account_not_allowed", "uri.not_connected.sign_in_expired", "tool.blocked.by_user", "tool.blocked.by_rule", "tool.blocked.by_bonsai", "tool.blocked.by_mode", "tool.blocked.protected_path", "tool.blocked.approval_not_shown", "tool.blocked.unverified", "tool.blocked.edits_not_applied"];
8697
8709
 
8698
8710
  /**
8699
8711
  * ---
@@ -405,6 +405,11 @@ declare interface BackgroundTaskCompletion {
405
405
  readonly errorStack?: string;
406
406
  /** Why a failed AGENT task's run failed, classified from what it threw; absent for other kinds. */
407
407
  readonly failureReason?: RunFailureReason;
408
+ /** The run failure record a failed agent task relays, when its run already recorded one. */
409
+ readonly failureRef?: {
410
+ readonly authority: string;
411
+ readonly id: string;
412
+ };
408
413
  }
409
414
 
410
415
  declare type BackgroundTaskInspector = () => Promise<string> | string;
@@ -2695,8 +2700,17 @@ declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
2695
2700
  * 0.32.0 lets an app-data source declare its window store as data (#15891). `store` under
2696
2701
  * `contributes.dataSources` replaces a `kay.ui` data materializer, and a change too big for a live
2697
2702
  * update becomes a re-read of the snapshot. A plugin that declares a store declares ^0.32.0.
2703
+ *
2704
+ * 0.33.0 lets a plugin declare a window command with its button and menu item (#15903). `commands`
2705
+ * under `kay.ui` `contributes` names each command's title, icon file, `button`, `menu` and `where`,
2706
+ * and `api.implementCommand(localId, handler)` supplies what it does. `placement` is gone and `icon`
2707
+ * is now a file path: nothing ever read either. A plugin that declares a command declares ^0.33.0.
2708
+ *
2709
+ * 0.34.0 lets a rail entry declare a sidebar (#15901). `panel.body` on a `railEntries` entry names
2710
+ * what fills it, either a `contextOnly` app in the plugin or a body the host ships. Additive: a rail
2711
+ * entry with no `panel` still opens its page alone. A plugin that declares a panel declares ^0.34.0.
2698
2712
  */
2699
- declare const KAY_PLUGIN_SDK_VERSION: "0.32.0";
2713
+ declare const KAY_PLUGIN_SDK_VERSION: "0.34.0";
2700
2714
 
2701
2715
  declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
2702
2716
 
@@ -8831,7 +8845,7 @@ declare type TOmitInstantiate<Context extends TProperties, State extends TState,
8831
8845
  * classification (the engine records the rejection on an unexplained failure),
8832
8846
  * and a stored record with one reads as none.
8833
8847
  */
8834
- declare const TOOL_CALL_FAILURE_CODES: readonly ["tool.invalid_input", "tool.blocked", "tool.cancelled", "tool.timeout", "tool.not_found", "tool.unavailable", "tool.execution_failed", "tool.auth_unavailable", "tool.replies_owed", "provider.http", "provider.api", "provider.transport", "uri.not_found", "uri.unsupported_operation", "uri.not_connected", "uri.auth_unavailable", "permission.denied", "edit.empty_edits", "edit.text_not_found", "edit.text_not_unique", "edit.empty_old_text", "edit.overlapping_edits", "edit.no_change", "uri.not_connected.pick_account", "uri.not_connected.account_not_allowed", "uri.not_connected.sign_in_expired", "tool.blocked.by_user", "tool.blocked.by_rule", "tool.blocked.by_bonsai"];
8848
+ declare const TOOL_CALL_FAILURE_CODES: readonly ["tool.invalid_input", "tool.blocked", "tool.cancelled", "tool.timeout", "tool.not_found", "tool.unavailable", "tool.execution_failed", "tool.auth_unavailable", "tool.replies_owed", "provider.http", "provider.api", "provider.transport", "uri.not_found", "uri.unsupported_operation", "uri.not_connected", "uri.auth_unavailable", "permission.denied", "edit.empty_edits", "edit.text_not_found", "edit.text_not_unique", "edit.empty_old_text", "edit.overlapping_edits", "edit.no_change", "uri.not_connected.pick_account", "uri.not_connected.account_not_allowed", "uri.not_connected.sign_in_expired", "tool.blocked.by_user", "tool.blocked.by_rule", "tool.blocked.by_bonsai", "tool.blocked.by_mode", "tool.blocked.protected_path", "tool.blocked.approval_not_shown", "tool.blocked.unverified", "tool.blocked.edits_not_applied"];
8835
8849
 
8836
8850
  /**
8837
8851
  * ---
package/dist/kay-app.d.ts CHANGED
@@ -390,6 +390,11 @@ declare interface BackgroundTaskCompletion {
390
390
  readonly errorStack?: string;
391
391
  /** Why a failed AGENT task's run failed, classified from what it threw; absent for other kinds. */
392
392
  readonly failureReason?: RunFailureReason;
393
+ /** The run failure record a failed agent task relays, when its run already recorded one. */
394
+ readonly failureRef?: {
395
+ readonly authority: string;
396
+ readonly id: string;
397
+ };
393
398
  }
394
399
 
395
400
  declare type BackgroundTaskInspector = () => Promise<string> | string;
@@ -2650,8 +2655,17 @@ declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
2650
2655
  * 0.32.0 lets an app-data source declare its window store as data (#15891). `store` under
2651
2656
  * `contributes.dataSources` replaces a `kay.ui` data materializer, and a change too big for a live
2652
2657
  * update becomes a re-read of the snapshot. A plugin that declares a store declares ^0.32.0.
2658
+ *
2659
+ * 0.33.0 lets a plugin declare a window command with its button and menu item (#15903). `commands`
2660
+ * under `kay.ui` `contributes` names each command's title, icon file, `button`, `menu` and `where`,
2661
+ * and `api.implementCommand(localId, handler)` supplies what it does. `placement` is gone and `icon`
2662
+ * is now a file path: nothing ever read either. A plugin that declares a command declares ^0.33.0.
2663
+ *
2664
+ * 0.34.0 lets a rail entry declare a sidebar (#15901). `panel.body` on a `railEntries` entry names
2665
+ * what fills it, either a `contextOnly` app in the plugin or a body the host ships. Additive: a rail
2666
+ * entry with no `panel` still opens its page alone. A plugin that declares a panel declares ^0.34.0.
2653
2667
  */
2654
- declare const KAY_PLUGIN_SDK_VERSION: "0.32.0";
2668
+ declare const KAY_PLUGIN_SDK_VERSION: "0.34.0";
2655
2669
 
2656
2670
  declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
2657
2671
 
@@ -13560,7 +13574,7 @@ declare interface Tool<TParameters extends TSchema = TSchema> {
13560
13574
  * classification (the engine records the rejection on an unexplained failure),
13561
13575
  * and a stored record with one reads as none.
13562
13576
  */
13563
- declare const TOOL_CALL_FAILURE_CODES: readonly ["tool.invalid_input", "tool.blocked", "tool.cancelled", "tool.timeout", "tool.not_found", "tool.unavailable", "tool.execution_failed", "tool.auth_unavailable", "tool.replies_owed", "provider.http", "provider.api", "provider.transport", "uri.not_found", "uri.unsupported_operation", "uri.not_connected", "uri.auth_unavailable", "permission.denied", "edit.empty_edits", "edit.text_not_found", "edit.text_not_unique", "edit.empty_old_text", "edit.overlapping_edits", "edit.no_change", "uri.not_connected.pick_account", "uri.not_connected.account_not_allowed", "uri.not_connected.sign_in_expired", "tool.blocked.by_user", "tool.blocked.by_rule", "tool.blocked.by_bonsai"];
13577
+ declare const TOOL_CALL_FAILURE_CODES: readonly ["tool.invalid_input", "tool.blocked", "tool.cancelled", "tool.timeout", "tool.not_found", "tool.unavailable", "tool.execution_failed", "tool.auth_unavailable", "tool.replies_owed", "provider.http", "provider.api", "provider.transport", "uri.not_found", "uri.unsupported_operation", "uri.not_connected", "uri.auth_unavailable", "permission.denied", "edit.empty_edits", "edit.text_not_found", "edit.text_not_unique", "edit.empty_old_text", "edit.overlapping_edits", "edit.no_change", "uri.not_connected.pick_account", "uri.not_connected.account_not_allowed", "uri.not_connected.sign_in_expired", "tool.blocked.by_user", "tool.blocked.by_rule", "tool.blocked.by_bonsai", "tool.blocked.by_mode", "tool.blocked.protected_path", "tool.blocked.approval_not_shown", "tool.blocked.unverified", "tool.blocked.edits_not_applied"];
13564
13578
 
13565
13579
  /**
13566
13580
  * ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yaklabs-ai/plugin-sdk",
3
- "version": "0.32.0",
3
+ "version": "0.34.0",
4
4
  "description": "The Kay plugin SDK — types and helpers for authoring a Kay directory plugin.",
5
5
  "author": "YakLabs",
6
6
  "type": "module",
@@ -129,7 +129,9 @@ plugin UI contributes through `api.slots` (`registerPage`, `registerSidebarItem`
129
129
  `packages/kay-renderer/src/renderer/src/extension-loader/build-extension-api.ts`). A page gets its own
130
130
  activity-rail button when the manifest declares it: `railEntries` under `targets.kay.ui.contributes`,
131
131
  with `id`, `title` and `page`, and optionally `icon`, `shortcut`, `order` and `section`. That
132
- declaration works with no `ui.tsx` at all.
132
+ declaration works with no `ui.tsx` at all. To give the entry a sidebar, add `panel: { body }` naming
133
+ an app in the same manifest with `contextOnly: true`. The sidebar is always there once declared, so
134
+ the app shows its own empty state.
133
135
 
134
136
  **Icons: declare one plugin icon, override only where you mean it.** Set the manifest `icon` (a
135
137
  package-relative SVG) and every surface the plugin contributes inherits it: reference pills, its