@yaklabs-ai/plugin-sdk 0.13.1 → 0.13.2

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
- "@kay/plugin-sdk": "npm:@yaklabs-ai/plugin-sdk@^0.13.1"
16
+ "@kay/plugin-sdk": "npm:@yaklabs-ai/plugin-sdk@^0.13.2"
17
17
  }
18
18
  }
19
19
  ```
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "package": "@yaklabs-ai/plugin-sdk",
4
- "version": "0.13.1",
4
+ "version": "0.13.2",
5
5
  "target": "npm",
6
6
  "firstPartyLicense": "MIT",
7
7
  "bundled": [
@@ -3230,6 +3230,12 @@ declare interface UriHelp {
3230
3230
  readonly templates?: readonly UriTemplate[];
3231
3231
  readonly examples?: readonly UriExample[];
3232
3232
  readonly notes?: readonly string[];
3233
+ /**
3234
+ * Set when this help, for the address it was asked about, carries text a third party wrote and
3235
+ * the module relays as it received it (an MCP server's own tool names and descriptions), rather
3236
+ * than text the module's author wrote. Absent: the module's own text.
3237
+ */
3238
+ readonly thirdPartyContent?: true;
3233
3239
  }
3234
3240
 
3235
3241
  declare interface UriHintTriggers {
@@ -3128,6 +3128,12 @@ declare interface UriHelp {
3128
3128
  readonly templates?: readonly UriTemplate[];
3129
3129
  readonly examples?: readonly UriExample[];
3130
3130
  readonly notes?: readonly string[];
3131
+ /**
3132
+ * Set when this help, for the address it was asked about, carries text a third party wrote and
3133
+ * the module relays as it received it (an MCP server's own tool names and descriptions), rather
3134
+ * than text the module's author wrote. Absent: the module's own text.
3135
+ */
3136
+ readonly thirdPartyContent?: true;
3131
3137
  }
3132
3138
 
3133
3139
  declare interface UriHintTriggers {
@@ -2811,6 +2811,7 @@ declare const KayPluginManifestV1: z.ZodObject<{
2811
2811
  minKayVersion: z.ZodOptional<z.ZodString>;
2812
2812
  sdk: z.ZodOptional<z.ZodString>;
2813
2813
  }, z.core.$strict>>>;
2814
+ ownedByBonsai: z.ZodOptional<z.ZodBoolean>;
2814
2815
  dependencies: z.ZodOptional<z.ZodObject<{
2815
2816
  plugins: z.ZodOptional<z.ZodArray<z.ZodString>>;
2816
2817
  }, z.core.$strict>>;
@@ -3422,6 +3423,10 @@ declare const PluginCapabilityRefusalV1: z.ZodObject<{
3422
3423
  target: z.ZodLiteral<"kay.app">;
3423
3424
  slug: z.ZodLiteral<"skills.read">;
3424
3425
  envelope: z.ZodObject<{}, z.core.$strict>;
3426
+ }, z.core.$strict>, z.ZodObject<{
3427
+ target: z.ZodLiteral<"kay.app">;
3428
+ slug: z.ZodLiteral<"tools.describe">;
3429
+ envelope: z.ZodObject<{}, z.core.$strict>;
3425
3430
  }, z.core.$strict>, z.ZodObject<{
3426
3431
  target: z.ZodLiteral<"kay.app">;
3427
3432
  slug: z.ZodLiteral<"workspace.command">;
@@ -4939,6 +4944,12 @@ declare interface UriHelp {
4939
4944
  readonly templates?: readonly UriTemplate[];
4940
4945
  readonly examples?: readonly UriExample[];
4941
4946
  readonly notes?: readonly string[];
4947
+ /**
4948
+ * Set when this help, for the address it was asked about, carries text a third party wrote and
4949
+ * the module relays as it received it (an MCP server's own tool names and descriptions), rather
4950
+ * than text the module's author wrote. Absent: the module's own text.
4951
+ */
4952
+ readonly thirdPartyContent?: true;
4942
4953
  }
4943
4954
 
4944
4955
  declare interface UriHintTriggers {
package/dist/kay-app.d.ts CHANGED
@@ -431,6 +431,12 @@ export declare function createFallbackOnlyWithJev(): WithJev;
431
431
  */
432
432
  export declare function createUnavailableSkills(message: string): KayAppSkills;
433
433
 
434
+ /**
435
+ * The `app.tools` a host that cannot describe tools binds: every call answers `not-available`, so
436
+ * a plugin's code path never depends on host composition.
437
+ */
438
+ export declare function createUnavailableTools(): KayAppTools;
439
+
434
440
  declare interface CustomEntry extends EntryBase {
435
441
  type: "custom";
436
442
  customType: string;
@@ -2863,6 +2869,14 @@ export declare interface KayAppPluginApi {
2863
2869
  * present, like {@link signals}.
2864
2870
  */
2865
2871
  readonly skills: KayAppSkills;
2872
+ /**
2873
+ * What a live session's tools and addresses say to the agent, where each comes from, and whether
2874
+ * each is one of Bonsai's own. Each call is checked against `tools.describe`; a refused grant or
2875
+ * a session that is not live resolves to `{ status: "unavailable" }`, never a rejection, while
2876
+ * the plugin is enabled. After it is disabled, a kept handle's methods throw synchronously.
2877
+ * Always present, like {@link skills}.
2878
+ */
2879
+ readonly tools: KayAppTools;
2866
2880
  /** The app-wide endpoint bus (register handlers a consuming surface invokes). */
2867
2881
  readonly endpoints: KayAppEndpoints;
2868
2882
  /** Publish one event declared by this plugin's `kay.app` manifest target. */
@@ -4202,6 +4216,21 @@ export declare type KayAppToolDefinition<TParams extends ToolParametersWire = To
4202
4216
  execute(toolCallId: string, params: ToolExecutionAwareParams<TParams>, signal: AbortSignal | undefined, onUpdate: AgentToolUpdateCallback<TDetails> | undefined, ctx: KayAppToolContext): Promise<AgentToolResult<TDetails>>;
4203
4217
  };
4204
4218
 
4219
+ export declare interface KayAppToolDescription {
4220
+ readonly ref: KayAppToolRef;
4221
+ /** `false`: no such tool is registered, or no module owns that address, in this session. */
4222
+ readonly found: boolean;
4223
+ /**
4224
+ * For a tool, its own registered description. For an address, its help rendered as `help <uri>`
4225
+ * renders it for the agent; for `mcp://<server>`, that is the server's tool list in the server's
4226
+ * own words.
4227
+ */
4228
+ readonly description?: string;
4229
+ readonly origin?: KayAppToolOrigin;
4230
+ /** Whether this is one of Bonsai's own tools or addresses. `false` when not found. */
4231
+ readonly ownedByBonsai: boolean;
4232
+ }
4233
+
4205
4234
  /**
4206
4235
  * The fine-grained, app-wide per-tool event stream (every session's tool executions). Carries the
4207
4236
  * redaction caveat: raw tool args/results are OFF in packaged builds, so a handler must treat
@@ -4214,6 +4243,20 @@ export declare interface KayAppToolEvents {
4214
4243
  subscribe(handler: (event: unknown) => void): () => void;
4215
4244
  }
4216
4245
 
4246
+ /** Where a described tool or address comes from. */
4247
+ export declare type KayAppToolOrigin =
4248
+ /** The agent kernel's own (`bash`, `read`, `help`, `skill://`). */
4249
+ {
4250
+ readonly kind: "core";
4251
+ }
4252
+ /** Bonsai's host, outside any plugin (`task_status`, `config://`). */
4253
+ | {
4254
+ readonly kind: "host";
4255
+ } | {
4256
+ readonly kind: "plugin";
4257
+ readonly pluginId: string;
4258
+ };
4259
+
4217
4260
  /**
4218
4261
  * `app.permissions` — the plugin-facing seam through which a `kay.app` target advertises the
4219
4262
  * permission rows for tools it gates DYNAMICALLY, so they show in Bonsai's permission ledger with
@@ -4264,6 +4307,52 @@ export declare interface KayAppToolPermissionSource {
4264
4307
  readonly list: () => readonly KayAppToolPermissionDeclaration[] | Promise<readonly KayAppToolPermissionDeclaration[]>;
4265
4308
  }
4266
4309
 
4310
+ /**
4311
+ * The plugin-facing `kay.app` tools contract: for the tools and addresses a live session can use,
4312
+ * the text the agent sees for each, where each comes from, and whether each is one of Bonsai's own.
4313
+ *
4314
+ * Every call is checked against the `tools.describe` claim at the call, so a grant or revocation
4315
+ * takes effect on the next one. Like `app.skills`, the member is ALWAYS present and no call rejects
4316
+ * while the plugin is enabled: a refused grant or a session that is not live resolves to
4317
+ * `{ status: "unavailable" }`. After the plugin is disabled, a kept handle's methods throw
4318
+ * synchronously.
4319
+ *
4320
+ * `ownedByBonsai` is a fact declared where each surface is defined (a bundled plugin's manifest, or
4321
+ * the host's own registration), never a list kept by the host. What a plugin does with it is the
4322
+ * plugin's call.
4323
+ */
4324
+ /** A tool or an address to describe. */
4325
+ export declare type KayAppToolRef =
4326
+ /** A registered tool by name, e.g. `bash`, `read`, `mcp`, `submit_final`. */
4327
+ {
4328
+ readonly kind: "tool";
4329
+ readonly name: string;
4330
+ }
4331
+ /** A URI address whose `help` is wanted, e.g. `gmail://` or `mcp://linear`. */
4332
+ | {
4333
+ readonly kind: "address";
4334
+ readonly uri: string;
4335
+ };
4336
+
4337
+ /** `app.tools`: what a live session's tools and addresses say, each call checked against `tools.describe`. */
4338
+ export declare interface KayAppTools {
4339
+ describe(sessionId: string, refs: readonly KayAppToolRef[]): Promise<KayAppToolsDescribeResult>;
4340
+ }
4341
+
4342
+ /**
4343
+ * `not-granted`: the user has not granted `tools.describe`. `no-session`: the session is not live
4344
+ * on this host (only live sessions are described). `not-available`: this host cannot describe
4345
+ * tools.
4346
+ */
4347
+ export declare type KayAppToolsDescribeResult = {
4348
+ readonly status: "ok";
4349
+ /** One per ref, in the order of the refs. */
4350
+ readonly tools: readonly KayAppToolDescription[];
4351
+ } | {
4352
+ readonly status: "unavailable";
4353
+ readonly reason: "not-granted" | "no-session" | "not-available";
4354
+ };
4355
+
4267
4356
  /** An eligible settled turn — the generic door's root event. */
4268
4357
  export declare interface KayAppTurnSettledSessionEvent extends KayAppSessionEventBase {
4269
4358
  readonly type: "turn-settled";
@@ -6427,6 +6516,12 @@ declare interface UriHelp {
6427
6516
  readonly templates?: readonly UriTemplate[];
6428
6517
  readonly examples?: readonly UriExample[];
6429
6518
  readonly notes?: readonly string[];
6519
+ /**
6520
+ * Set when this help, for the address it was asked about, carries text a third party wrote and
6521
+ * the module relays as it received it (an MCP server's own tool names and descriptions), rather
6522
+ * than text the module's author wrote. Absent: the module's own text.
6523
+ */
6524
+ readonly thirdPartyContent?: true;
6430
6525
  }
6431
6526
 
6432
6527
  declare interface UriHintTriggers {
package/dist/kay-app.js CHANGED
@@ -503,6 +503,13 @@ function createUnavailableSkills(message) {
503
503
  };
504
504
  }
505
505
 
506
+ // packages/plugin-sdk/dist/kay-app/tools.js
507
+ function createUnavailableTools() {
508
+ return {
509
+ describe: async () => ({ status: "unavailable", reason: "not-available" })
510
+ };
511
+ }
512
+
506
513
  // packages/plugin-sdk/dist/kay-app/transcript-text.js
507
514
  function transcriptMessageTexts(entries) {
508
515
  return entries.flatMap((entry) => {
@@ -572,6 +579,7 @@ export {
572
579
  createFallbackOnlySignals,
573
580
  createFallbackOnlyWithJev,
574
581
  createUnavailableSkills,
582
+ createUnavailableTools,
575
583
  invalidObservation,
576
584
  isRetryable,
577
585
  parseLineSelector,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yaklabs-ai/plugin-sdk",
3
- "version": "0.13.1",
3
+ "version": "0.13.2",
4
4
  "description": "The Kay plugin SDK — types and helpers for authoring a Kay directory plugin.",
5
5
  "author": "YakLabs",
6
6
  "type": "module",