@yaklabs-ai/plugin-sdk 0.39.0 → 0.41.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.39.0"
16
+ "@bonsai/plugin-sdk": "npm:@yaklabs-ai/plugin-sdk@^0.41.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.39.0" },
65
+ "compatibility": { "sdk": "^0.41.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.39.0",
4
+ "version": "0.41.0",
5
5
  "target": "npm",
6
6
  "firstPartyLicense": "MIT",
7
7
  "bundled": [
@@ -2408,8 +2408,17 @@ declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
2408
2408
  * 0.39.0 lets a plugin word its own addresses (#15750). A reference presentation gains `words`, and
2409
2409
  * `open` and `resourceKind` become an optional pair, so a module can name its rows, tallies and live
2410
2410
  * phrases without its addresses opening. Additive. A plugin that declares words declares ^0.39.0.
2411
+ *
2412
+ * 0.40.0 lets a `kay.ui` app list the feeds it reads (#15909). `capabilities.feeds` names each one,
2413
+ * resolved at load to the plugin's own feed by that name or otherwise the daemon's, and a session
2414
+ * feed may now declare a `store`. It removes the `cost.read`, `skills.read`, `memory.read` and
2415
+ * `self-improvement.read` host capabilities, so a manifest still listing one no longer parses and
2416
+ * lists the feed instead. A plugin that lists feeds declares ^0.40.0.
2417
+ *
2418
+ * 0.41.0 adds app.mcp.callTool for background calls to a plugin's own manifest-declared MCP
2419
+ * servers, using Bonsai's managed connection without a session or working directory (#16172).
2411
2420
  */
2412
- declare const KAY_PLUGIN_SDK_VERSION: "0.39.0";
2421
+ declare const KAY_PLUGIN_SDK_VERSION: "0.41.0";
2413
2422
 
2414
2423
  declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
2415
2424
 
@@ -2462,8 +2462,17 @@ declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
2462
2462
  * 0.39.0 lets a plugin word its own addresses (#15750). A reference presentation gains `words`, and
2463
2463
  * `open` and `resourceKind` become an optional pair, so a module can name its rows, tallies and live
2464
2464
  * phrases without its addresses opening. Additive. A plugin that declares words declares ^0.39.0.
2465
+ *
2466
+ * 0.40.0 lets a `kay.ui` app list the feeds it reads (#15909). `capabilities.feeds` names each one,
2467
+ * resolved at load to the plugin's own feed by that name or otherwise the daemon's, and a session
2468
+ * feed may now declare a `store`. It removes the `cost.read`, `skills.read`, `memory.read` and
2469
+ * `self-improvement.read` host capabilities, so a manifest still listing one no longer parses and
2470
+ * lists the feed instead. A plugin that lists feeds declares ^0.40.0.
2471
+ *
2472
+ * 0.41.0 adds app.mcp.callTool for background calls to a plugin's own manifest-declared MCP
2473
+ * servers, using Bonsai's managed connection without a session or working directory (#16172).
2465
2474
  */
2466
- declare const KAY_PLUGIN_SDK_VERSION: "0.39.0";
2475
+ declare const KAY_PLUGIN_SDK_VERSION: "0.41.0";
2467
2476
 
2468
2477
  declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
2469
2478
 
@@ -5787,11 +5796,7 @@ declare const ResolvedPluginContractV1: z.ZodObject<{
5787
5796
  "artifacts.read": "artifacts.read";
5788
5797
  "artifacts.preview": "artifacts.preview";
5789
5798
  "markdown.document-view": "markdown.document-view";
5790
- "cost.read": "cost.read";
5791
5799
  "billing.read": "billing.read";
5792
- "skills.read": "skills.read";
5793
- "memory.read": "memory.read";
5794
- "self-improvement.read": "self-improvement.read";
5795
5800
  "automations.read": "automations.read";
5796
5801
  "automations.run": "automations.run";
5797
5802
  "shared-artifacts.read": "shared-artifacts.read";
@@ -5799,6 +5804,7 @@ declare const ResolvedPluginContractV1: z.ZodObject<{
5799
5804
  "workspace.pane-header": "workspace.pane-header";
5800
5805
  "workspace.arrange": "workspace.arrange";
5801
5806
  }>>>;
5807
+ feeds: z.ZodOptional<z.ZodArray<z.ZodString>>;
5802
5808
  }, z.core.$strict>>;
5803
5809
  }, z.core.$strict>>>;
5804
5810
  }, z.core.$strict>;
@@ -2737,8 +2737,17 @@ declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
2737
2737
  * 0.39.0 lets a plugin word its own addresses (#15750). A reference presentation gains `words`, and
2738
2738
  * `open` and `resourceKind` become an optional pair, so a module can name its rows, tallies and live
2739
2739
  * phrases without its addresses opening. Additive. A plugin that declares words declares ^0.39.0.
2740
+ *
2741
+ * 0.40.0 lets a `kay.ui` app list the feeds it reads (#15909). `capabilities.feeds` names each one,
2742
+ * resolved at load to the plugin's own feed by that name or otherwise the daemon's, and a session
2743
+ * feed may now declare a `store`. It removes the `cost.read`, `skills.read`, `memory.read` and
2744
+ * `self-improvement.read` host capabilities, so a manifest still listing one no longer parses and
2745
+ * lists the feed instead. A plugin that lists feeds declares ^0.40.0.
2746
+ *
2747
+ * 0.41.0 adds app.mcp.callTool for background calls to a plugin's own manifest-declared MCP
2748
+ * servers, using Bonsai's managed connection without a session or working directory (#16172).
2740
2749
  */
2741
- declare const KAY_PLUGIN_SDK_VERSION: "0.39.0";
2750
+ declare const KAY_PLUGIN_SDK_VERSION: "0.41.0";
2742
2751
 
2743
2752
  declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
2744
2753
 
package/dist/kay-app.d.ts CHANGED
@@ -2713,8 +2713,17 @@ declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
2713
2713
  * 0.39.0 lets a plugin word its own addresses (#15750). A reference presentation gains `words`, and
2714
2714
  * `open` and `resourceKind` become an optional pair, so a module can name its rows, tallies and live
2715
2715
  * phrases without its addresses opening. Additive. A plugin that declares words declares ^0.39.0.
2716
+ *
2717
+ * 0.40.0 lets a `kay.ui` app list the feeds it reads (#15909). `capabilities.feeds` names each one,
2718
+ * resolved at load to the plugin's own feed by that name or otherwise the daemon's, and a session
2719
+ * feed may now declare a `store`. It removes the `cost.read`, `skills.read`, `memory.read` and
2720
+ * `self-improvement.read` host capabilities, so a manifest still listing one no longer parses and
2721
+ * lists the feed instead. A plugin that lists feeds declares ^0.40.0.
2722
+ *
2723
+ * 0.41.0 adds app.mcp.callTool for background calls to a plugin's own manifest-declared MCP
2724
+ * servers, using Bonsai's managed connection without a session or working directory (#16172).
2716
2725
  */
2717
- declare const KAY_PLUGIN_SDK_VERSION: "0.39.0";
2726
+ declare const KAY_PLUGIN_SDK_VERSION: "0.41.0";
2718
2727
 
2719
2728
  declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
2720
2729
 
@@ -4609,6 +4618,21 @@ export declare interface KayAppMarketplaceContributors {
4609
4618
  };
4610
4619
  }
4611
4620
 
4621
+ /** Calls tools on this plugin's manifest-declared MCP servers through Bonsai's managed connection. */
4622
+ export declare interface KayAppMcp {
4623
+ /**
4624
+ * Uses the current app-wide server set, without a session or working directory.
4625
+ * Refuses undeclared or no-longer-hosted servers. Sign-in and tool failures return typed outcomes;
4626
+ * credentials remain with the host. Like the agent-side vendored MCP API, calls can read or write
4627
+ * and do not use the agent's per-tool approval path.
4628
+ */
4629
+ callTool(input: {
4630
+ readonly server: string;
4631
+ readonly tool: string;
4632
+ readonly args: Readonly<Record<string, unknown>>;
4633
+ }): Promise<VendoredMcpOutcome>;
4634
+ }
4635
+
4612
4636
  /**
4613
4637
  * Notes through Memory's ordinary notebook operations, without a chat session. Each call checks
4614
4638
  * `memory.read` or `memory.write`; a missing notebook or refused grant rejects. Paths are note
@@ -5081,6 +5105,7 @@ export declare interface KayAppPhaseShiftSessionEvent extends KayAppSessionEvent
5081
5105
  * physical sandbox against ambient Node imports.
5082
5106
  */
5083
5107
  export declare interface KayAppPluginApi {
5108
+ readonly mcp: KayAppMcp;
5084
5109
  /** This plugin's canonical id (already validated by the host registry). */
5085
5110
  readonly id: string;
5086
5111
  /** Register app-lifetime cleanup for plugin-owned processes, sockets, watchers, or timers. */
@@ -16725,6 +16750,52 @@ declare type UserShellCommandMessage = CustomMessage<UserShellCommandDetails> &
16725
16750
  readonly display: true;
16726
16751
  };
16727
16752
 
16753
+ /**
16754
+ * ---
16755
+ * responsibility: The one interface through which a vendored-MCP plugin's code calls a tool on its
16756
+ * own vendored MCP server, so every read-through plugin and the daemon that implements the port
16757
+ * agree on the same shape by construction.
16758
+ * owns:
16759
+ * - {@link VendoredMcpPort} - what a plugin's URI module and tools call.
16760
+ * - {@link VendoredMcpOutcome} - the typed result a plugin decodes, including every failure it
16761
+ * must surface to the agent rather than swallow.
16762
+ * does_not_own:
16763
+ * - The implementation. A plugin never dials MCP itself: it takes the port from
16764
+ * `api.vendoredMcp.port(server)` (`@bonsai/plugin-sdk/kay-agent`), which the daemon binds to the
16765
+ * plugin's own hosted server over its MCP host. Plugin source stays host-free, and a plugin
16766
+ * under test substitutes a fake port.
16767
+ * - Which tool names exist. `TTool` is the plugin's own union of the vendor tools it calls; the
16768
+ * port is generic so a typo in a tool name fails typecheck inside the plugin.
16769
+ * ---
16770
+ */
16771
+ /**
16772
+ * Why a call failed, as the plugin must tell the agent. `needs-auth` carries the exact service to
16773
+ * reconnect (`serviceId`) so a plugin can name it in its error instead of returning an empty
16774
+ * result; today's plugins name their statically declared `requiresAuth` service instead, which is
16775
+ * the same service for a single-service plugin. `unknown-server` and `unknown-tool` are wiring
16776
+ * faults (a server Bonsai does not host for this plugin, or a tool name the server does not have)
16777
+ * and stay loud for the same reason: an unreachable host must never decode as "no data".
16778
+ */
16779
+ declare type VendoredMcpFailureReason = "needs-auth" | "unknown-server" | "unknown-tool" | "failed";
16780
+
16781
+ declare type VendoredMcpOutcome =
16782
+ /**
16783
+ * `value` is the tool's `structuredContent` when it sent one, else its text content parsed as
16784
+ * JSON, else that text as a string: a vendor tool that answers in prose (a transcript, a
16785
+ * markdown summary) is a result, not a failure. A route that needs a record rejects a string
16786
+ * itself, with its own message.
16787
+ */
16788
+ {
16789
+ readonly ok: true;
16790
+ readonly value: unknown;
16791
+ } | {
16792
+ readonly ok: false;
16793
+ readonly reason: VendoredMcpFailureReason;
16794
+ readonly message: string;
16795
+ /** Exact reconnect target supplied by the MCP host for an auth failure. */
16796
+ readonly serviceId?: string;
16797
+ };
16798
+
16728
16799
  /** Creates a Void type. */
16729
16800
  declare function Void(options?: TSchemaOptions): TVoid;
16730
16801
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yaklabs-ai/plugin-sdk",
3
- "version": "0.39.0",
3
+ "version": "0.41.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",