@yaklabs-ai/plugin-sdk 0.33.0 → 0.35.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.33.0"
16
+ "@bonsai/plugin-sdk": "npm:@yaklabs-ai/plugin-sdk@^0.35.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.33.0" },
65
+ "compatibility": { "sdk": "^0.35.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.33.0",
4
+ "version": "0.35.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
 
@@ -1596,11 +1598,18 @@ declare type FailureJsonValue = null | boolean | number | string | readonly Fail
1596
1598
  readonly [key: string]: FailureJsonValue;
1597
1599
  };
1598
1600
 
1599
- declare interface FailureOccurrence<C = FailureJsonValue> {
1601
+ /**
1602
+ * One failure, as every lane records it. `Code` and `Domain` default to
1603
+ * `string`; a lane that declares its codes (an `as const` list beside its
1604
+ * cause schema) passes them, so minting a record with an undeclared code
1605
+ * fails typecheck. Reading is unchanged: `failureSchema` keeps both as
1606
+ * strings, so a saved record with an unknown code still reads.
1607
+ */
1608
+ declare interface FailureOccurrence<C = FailureJsonValue, Code extends string = string, Domain extends string = string> {
1600
1609
  readonly ref: FailureRef;
1601
1610
  readonly sourceRef: FailureRef;
1602
- readonly domain: string;
1603
- readonly code: string;
1611
+ readonly domain: Domain;
1612
+ readonly code: Code;
1604
1613
  readonly context: {
1605
1614
  readonly component: string;
1606
1615
  readonly operation: string;
@@ -6831,6 +6840,17 @@ declare interface Tool<TParameters extends TSchema = TSchema> {
6831
6840
  constrainedSampling?: false | ConstrainedSamplingConfig;
6832
6841
  }
6833
6842
 
6843
+ /**
6844
+ * The closed vocabulary of tool call failure codes. The engine and the tools
6845
+ * mint only these; a returned failure with a code outside it is not a
6846
+ * classification (the engine records the rejection on an unexplained failure),
6847
+ * and a stored record with one reads as none.
6848
+ */
6849
+ 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"];
6850
+
6851
+ /** The `domain` of a tool call failure occurrence; it selects this lane's cause contract. */
6852
+ declare const TOOL_CALL_FAILURE_DOMAIN: "tool-call";
6853
+
6834
6854
  declare interface ToolCall {
6835
6855
  type: "toolCall";
6836
6856
  id: string;
@@ -6889,13 +6909,15 @@ declare const toolCallFailureCauseSchema: z.ZodObject<{
6889
6909
  }, z.core.$strict>>;
6890
6910
  }, z.core.$strict>;
6891
6911
 
6912
+ declare type ToolCallFailureCode = (typeof TOOL_CALL_FAILURE_CODES)[number];
6913
+
6892
6914
  /**
6893
6915
  * The failure occurrence a failed tool result carries under
6894
6916
  * `details.toolCallFailure`: the classification's code at the occurrence
6895
6917
  * level and the rest as its cause, with its own ref and the call it came out
6896
6918
  * of as its operation.
6897
6919
  */
6898
- declare type ToolCallFailureOccurrence = FailureOccurrence<ToolCallFailureCause>;
6920
+ declare type ToolCallFailureOccurrence = FailureOccurrence<ToolCallFailureCause, ToolCallFailureCode, typeof TOOL_CALL_FAILURE_DOMAIN>;
6899
6921
 
6900
6922
  /**
6901
6923
  * The minimal shape this leaf reads from a session entry: a `timestamp` and the
@@ -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;
@@ -2371,8 +2376,17 @@ declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
2371
2376
  * under `kay.ui` `contributes` names each command's title, icon file, `button`, `menu` and `where`,
2372
2377
  * and `api.implementCommand(localId, handler)` supplies what it does. `placement` is gone and `icon`
2373
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.
2383
+ *
2384
+ * 0.35.0 lets a rail entry declare a count badge as data (#15900). `badge` on a `railEntries` entry
2385
+ * names one of the plugin's `rows` data sources, an optional `where` and a plural `label`.
2386
+ * `app.skills` gains `listPendingSuggestions` and `subscribeSuggestions` under `skills.read`. A plugin
2387
+ * that declares a badge declares ^0.35.0.
2374
2388
  */
2375
- declare const KAY_PLUGIN_SDK_VERSION: "0.33.0";
2389
+ declare const KAY_PLUGIN_SDK_VERSION: "0.35.0";
2376
2390
 
2377
2391
  declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
2378
2392
 
@@ -7625,7 +7639,7 @@ declare type TOmitInstantiate<Context extends TProperties, State extends TState,
7625
7639
  * classification (the engine records the rejection on an unexplained failure),
7626
7640
  * and a stored record with one reads as none.
7627
7641
  */
7628
- 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"];
7642
+ 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"];
7629
7643
 
7630
7644
  /**
7631
7645
  * ---
@@ -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;
@@ -2425,8 +2430,17 @@ declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
2425
2430
  * under `kay.ui` `contributes` names each command's title, icon file, `button`, `menu` and `where`,
2426
2431
  * and `api.implementCommand(localId, handler)` supplies what it does. `placement` is gone and `icon`
2427
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.
2437
+ *
2438
+ * 0.35.0 lets a rail entry declare a count badge as data (#15900). `badge` on a `railEntries` entry
2439
+ * names one of the plugin's `rows` data sources, an optional `where` and a plural `label`.
2440
+ * `app.skills` gains `listPendingSuggestions` and `subscribeSuggestions` under `skills.read`. A plugin
2441
+ * that declares a badge declares ^0.35.0.
2428
2442
  */
2429
- declare const KAY_PLUGIN_SDK_VERSION: "0.33.0";
2443
+ declare const KAY_PLUGIN_SDK_VERSION: "0.35.0";
2430
2444
 
2431
2445
  declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
2432
2446
 
@@ -4747,14 +4761,14 @@ declare const ResolvedPluginContractV1: z.ZodObject<{
4747
4761
  "kay.ui": "kay.ui";
4748
4762
  }>;
4749
4763
  kind: z.ZodEnum<{
4764
+ endpoint: "endpoint";
4750
4765
  tool: "tool";
4751
4766
  resource: "resource";
4752
- endpoint: "endpoint";
4753
4767
  storage: "storage";
4754
- command: "command";
4755
4768
  uriModule: "uriModule";
4756
4769
  authService: "authService";
4757
4770
  app: "app";
4771
+ command: "command";
4758
4772
  configSection: "configSection";
4759
4773
  skill: "skill";
4760
4774
  converter: "converter";
@@ -5275,30 +5289,30 @@ declare const ResolvedPluginContractV1: z.ZodObject<{
5275
5289
  description: z.ZodString;
5276
5290
  operations: z.ZodExactOptional<z.ZodArray<z.ZodEnum<{
5277
5291
  search: "search";
5278
- delete: "delete";
5279
5292
  list: "list";
5280
5293
  read: "read";
5281
5294
  write: "write";
5282
5295
  help: "help";
5283
5296
  edit: "edit";
5297
+ delete: "delete";
5284
5298
  }>>>;
5285
5299
  operationDocs: z.ZodExactOptional<z.ZodRecord<z.ZodEnum<{
5286
5300
  search: "search";
5287
- delete: "delete";
5288
5301
  list: "list";
5289
5302
  read: "read";
5290
5303
  write: "write";
5291
5304
  help: "help";
5292
5305
  edit: "edit";
5306
+ delete: "delete";
5293
5307
  }> & z.core.$partial, z.ZodString>>;
5294
5308
  operationDefaults: z.ZodExactOptional<z.ZodRecord<z.ZodEnum<{
5295
5309
  search: "search";
5296
- delete: "delete";
5297
5310
  list: "list";
5298
5311
  read: "read";
5299
5312
  write: "write";
5300
5313
  help: "help";
5301
5314
  edit: "edit";
5315
+ delete: "delete";
5302
5316
  }> & z.core.$partial, z.ZodEnum<{
5303
5317
  never: "never";
5304
5318
  allow: "allow";
@@ -5357,12 +5371,12 @@ declare const ResolvedPluginContractV1: z.ZodObject<{
5357
5371
  action: z.ZodString;
5358
5372
  operations: z.ZodExactOptional<z.ZodArray<z.ZodEnum<{
5359
5373
  search: "search";
5360
- delete: "delete";
5361
5374
  list: "list";
5362
5375
  read: "read";
5363
5376
  write: "write";
5364
5377
  help: "help";
5365
5378
  edit: "edit";
5379
+ delete: "delete";
5366
5380
  }>>>;
5367
5381
  routes: z.ZodExactOptional<z.ZodArray<z.ZodString>>;
5368
5382
  query: z.ZodExactOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
@@ -5370,12 +5384,12 @@ declare const ResolvedPluginContractV1: z.ZodObject<{
5370
5384
  public: z.ZodLiteral<true>;
5371
5385
  operations: z.ZodExactOptional<z.ZodArray<z.ZodEnum<{
5372
5386
  search: "search";
5373
- delete: "delete";
5374
5387
  list: "list";
5375
5388
  read: "read";
5376
5389
  write: "write";
5377
5390
  help: "help";
5378
5391
  edit: "edit";
5392
+ delete: "delete";
5379
5393
  }>>>;
5380
5394
  routes: z.ZodExactOptional<z.ZodArray<z.ZodString>>;
5381
5395
  query: z.ZodExactOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
@@ -5557,9 +5571,9 @@ declare const ResolvedPluginContractV1: z.ZodObject<{
5557
5571
  localId: z.ZodString;
5558
5572
  globalId: z.ZodString;
5559
5573
  scope: z.ZodEnum<{
5560
- session: "session";
5561
5574
  runtime: "runtime";
5562
5575
  account: "account";
5576
+ session: "session";
5563
5577
  }>;
5564
5578
  snapshot: z.ZodObject<{
5565
5579
  version: z.ZodNumber;
@@ -5693,17 +5707,17 @@ declare const ResolvedPluginContractV1: z.ZodObject<{
5693
5707
  globalId: z.ZodString;
5694
5708
  }, z.core.$strict>>>;
5695
5709
  host: z.ZodOptional<z.ZodArray<z.ZodEnum<{
5710
+ "navigation.open-session": "navigation.open-session";
5696
5711
  "sessions.create": "sessions.create";
5697
- "memory.read": "memory.read";
5698
- "skills.read": "skills.read";
5699
- "automations.run": "automations.run";
5700
5712
  "artifacts.read": "artifacts.read";
5701
- "navigation.open-session": "navigation.open-session";
5702
5713
  "artifacts.preview": "artifacts.preview";
5703
5714
  "cost.read": "cost.read";
5704
5715
  "billing.read": "billing.read";
5716
+ "skills.read": "skills.read";
5717
+ "memory.read": "memory.read";
5705
5718
  "self-improvement.read": "self-improvement.read";
5706
5719
  "automations.read": "automations.read";
5720
+ "automations.run": "automations.run";
5707
5721
  "shared-artifacts.read": "shared-artifacts.read";
5708
5722
  "workspace.place-pane": "workspace.place-pane";
5709
5723
  "workspace.pane-header": "workspace.pane-header";
@@ -8696,7 +8710,7 @@ declare type TOmitInstantiate<Context extends TProperties, State extends TState,
8696
8710
  * classification (the engine records the rejection on an unexplained failure),
8697
8711
  * and a stored record with one reads as none.
8698
8712
  */
8699
- 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"];
8713
+ 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"];
8700
8714
 
8701
8715
  /**
8702
8716
  * ---
@@ -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;
@@ -2700,8 +2705,17 @@ declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
2700
2705
  * under `kay.ui` `contributes` names each command's title, icon file, `button`, `menu` and `where`,
2701
2706
  * and `api.implementCommand(localId, handler)` supplies what it does. `placement` is gone and `icon`
2702
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.
2712
+ *
2713
+ * 0.35.0 lets a rail entry declare a count badge as data (#15900). `badge` on a `railEntries` entry
2714
+ * names one of the plugin's `rows` data sources, an optional `where` and a plural `label`.
2715
+ * `app.skills` gains `listPendingSuggestions` and `subscribeSuggestions` under `skills.read`. A plugin
2716
+ * that declares a badge declares ^0.35.0.
2703
2717
  */
2704
- declare const KAY_PLUGIN_SDK_VERSION: "0.33.0";
2718
+ declare const KAY_PLUGIN_SDK_VERSION: "0.35.0";
2705
2719
 
2706
2720
  declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
2707
2721
 
@@ -8836,7 +8850,7 @@ declare type TOmitInstantiate<Context extends TProperties, State extends TState,
8836
8850
  * classification (the engine records the rejection on an unexplained failure),
8837
8851
  * and a stored record with one reads as none.
8838
8852
  */
8839
- 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"];
8853
+ 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"];
8840
8854
 
8841
8855
  /**
8842
8856
  * ---
@@ -453,9 +453,9 @@ declare const CorpusResourceInvocationQuery: z.ZodObject<{
453
453
  }, z.core.$strict>>;
454
454
  limit: z.ZodOptional<z.ZodNumber>;
455
455
  rootCreatedByKind: z.ZodOptional<z.ZodEnum<{
456
+ agent: "agent";
456
457
  plugin: "plugin";
457
458
  human: "human";
458
- agent: "agent";
459
459
  trigger: "trigger";
460
460
  daemon: "daemon";
461
461
  }>>;
@@ -841,11 +841,18 @@ declare type FailureJsonValue = null | boolean | number | string | readonly Fail
841
841
  readonly [key: string]: FailureJsonValue;
842
842
  };
843
843
 
844
- declare interface FailureOccurrence<C = FailureJsonValue> {
844
+ /**
845
+ * One failure, as every lane records it. `Code` and `Domain` default to
846
+ * `string`; a lane that declares its codes (an `as const` list beside its
847
+ * cause schema) passes them, so minting a record with an undeclared code
848
+ * fails typecheck. Reading is unchanged: `failureSchema` keeps both as
849
+ * strings, so a saved record with an unknown code still reads.
850
+ */
851
+ declare interface FailureOccurrence<C = FailureJsonValue, Code extends string = string, Domain extends string = string> {
845
852
  readonly ref: FailureRef;
846
853
  readonly sourceRef: FailureRef;
847
- readonly domain: string;
848
- readonly code: string;
854
+ readonly domain: Domain;
855
+ readonly code: Code;
849
856
  readonly context: {
850
857
  readonly component: string;
851
858
  readonly operation: string;
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;
@@ -790,9 +795,9 @@ export declare const CorpusResourceInvocationQuery: z.ZodObject<{
790
795
  }, z.core.$strict>>;
791
796
  limit: z.ZodOptional<z.ZodNumber>;
792
797
  rootCreatedByKind: z.ZodOptional<z.ZodEnum<{
798
+ agent: "agent";
793
799
  plugin: "plugin";
794
800
  human: "human";
795
- agent: "agent";
796
801
  trigger: "trigger";
797
802
  daemon: "daemon";
798
803
  }>>;
@@ -1496,11 +1501,18 @@ declare type FailureJsonValue = null | boolean | number | string | readonly Fail
1496
1501
  readonly [key: string]: FailureJsonValue;
1497
1502
  };
1498
1503
 
1499
- declare interface FailureOccurrence<C = FailureJsonValue> {
1504
+ /**
1505
+ * One failure, as every lane records it. `Code` and `Domain` default to
1506
+ * `string`; a lane that declares its codes (an `as const` list beside its
1507
+ * cause schema) passes them, so minting a record with an undeclared code
1508
+ * fails typecheck. Reading is unchanged: `failureSchema` keeps both as
1509
+ * strings, so a saved record with an unknown code still reads.
1510
+ */
1511
+ declare interface FailureOccurrence<C = FailureJsonValue, Code extends string = string, Domain extends string = string> {
1500
1512
  readonly ref: FailureRef;
1501
1513
  readonly sourceRef: FailureRef;
1502
- readonly domain: string;
1503
- readonly code: string;
1514
+ readonly domain: Domain;
1515
+ readonly code: Code;
1504
1516
  readonly context: {
1505
1517
  readonly component: string;
1506
1518
  readonly operation: string;
@@ -2655,8 +2667,17 @@ declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
2655
2667
  * under `kay.ui` `contributes` names each command's title, icon file, `button`, `menu` and `where`,
2656
2668
  * and `api.implementCommand(localId, handler)` supplies what it does. `placement` is gone and `icon`
2657
2669
  * is now a file path: nothing ever read either. A plugin that declares a command declares ^0.33.0.
2670
+ *
2671
+ * 0.34.0 lets a rail entry declare a sidebar (#15901). `panel.body` on a `railEntries` entry names
2672
+ * what fills it, either a `contextOnly` app in the plugin or a body the host ships. Additive: a rail
2673
+ * entry with no `panel` still opens its page alone. A plugin that declares a panel declares ^0.34.0.
2674
+ *
2675
+ * 0.35.0 lets a rail entry declare a count badge as data (#15900). `badge` on a `railEntries` entry
2676
+ * names one of the plugin's `rows` data sources, an optional `where` and a plural `label`.
2677
+ * `app.skills` gains `listPendingSuggestions` and `subscribeSuggestions` under `skills.read`. A plugin
2678
+ * that declares a badge declares ^0.35.0.
2658
2679
  */
2659
- declare const KAY_PLUGIN_SDK_VERSION: "0.33.0";
2680
+ declare const KAY_PLUGIN_SDK_VERSION: "0.35.0";
2660
2681
 
2661
2682
  declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
2662
2683
 
@@ -4977,6 +4998,18 @@ export declare interface KayAppPaths {
4977
4998
  readonly logsRoot?: string;
4978
4999
  }
4979
5000
 
5001
+ /** One suggested change waiting for a person's review. Ids repeat across skills, so all three identify it. */
5002
+ export declare interface KayAppPendingSkillSuggestion {
5003
+ readonly sourceId: string;
5004
+ readonly skillName: string;
5005
+ readonly suggestionId: string;
5006
+ }
5007
+
5008
+ export declare type KayAppPendingSkillSuggestionsResult = {
5009
+ readonly status: "ok";
5010
+ readonly suggestions: readonly KayAppPendingSkillSuggestion[];
5011
+ } | KayAppSkillsUnavailable;
5012
+
4980
5013
  export declare interface KayAppPermissions {
4981
5014
  /**
4982
5015
  * Register a live source of permission rows under a plugin-local id (register during
@@ -7189,6 +7222,13 @@ export declare interface KayAppSkills {
7189
7222
  list(): Promise<KayAppSkillsListResult>;
7190
7223
  /** One skill's identity, current version, and suggestions. */
7191
7224
  read(skill: KayAppSkillRef): Promise<KayAppSkillReadResult>;
7225
+ /** Every suggested change, across all skills, still waiting for a person's review. */
7226
+ listPendingSuggestions(): Promise<KayAppPendingSkillSuggestionsResult>;
7227
+ /**
7228
+ * Calls `listener` when {@link KayAppSkills.listPendingSuggestions} may answer differently, at most
7229
+ * once per burst of writes. Returns an unsubscribe.
7230
+ */
7231
+ subscribeSuggestions(listener: () => void): () => void;
7192
7232
  /** One skill's revisions, newest first, each with its version and how it came about. */
7193
7233
  history(skill: KayAppSkillRef, options?: KayAppSkillHistoryOptions): Promise<KayAppSkillHistoryResult>;
7194
7234
  /** How the skill's local copy differs from its source. */
@@ -13565,7 +13605,7 @@ declare interface Tool<TParameters extends TSchema = TSchema> {
13565
13605
  * classification (the engine records the rejection on an unexplained failure),
13566
13606
  * and a stored record with one reads as none.
13567
13607
  */
13568
- 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"];
13608
+ 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"];
13569
13609
 
13570
13610
  /**
13571
13611
  * ---
package/dist/kay-app.js CHANGED
@@ -735,6 +735,8 @@ function createUnavailableSkills(message) {
735
735
  },
736
736
  list: async () => unavailable,
737
737
  read: async () => unavailable,
738
+ listPendingSuggestions: async () => unavailable,
739
+ subscribeSuggestions: () => () => void 0,
738
740
  history: async () => unavailable,
739
741
  diff: async () => unavailable,
740
742
  revision: async () => unavailable,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yaklabs-ai/plugin-sdk",
3
- "version": "0.33.0",
3
+ "version": "0.35.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