@yaklabs-ai/plugin-protocol 0.13.5 → 0.13.7

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
@@ -11,7 +11,7 @@ flow.
11
11
  ```json
12
12
  {
13
13
  "dependencies": {
14
- "@bonsai/plugin-protocol": "npm:@yaklabs-ai/plugin-protocol@^0.13.5"
14
+ "@bonsai/plugin-protocol": "npm:@yaklabs-ai/plugin-protocol@^0.13.7"
15
15
  }
16
16
  }
17
17
  ```
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "package": "@yaklabs-ai/plugin-protocol",
4
- "version": "0.13.5",
4
+ "version": "0.13.7",
5
5
  "target": "npm",
6
6
  "firstPartyLicense": "MIT",
7
7
  "bundled": [],
package/dist/index.d.ts CHANGED
@@ -1705,9 +1705,44 @@ export declare interface DeclaredKayPluginCompatibility {
1705
1705
  readonly sdk?: string | undefined;
1706
1706
  }
1707
1707
 
1708
+ /**
1709
+ * Where a plugin-declared skill source's bytes come from, as the daemon resolved it: the manifest
1710
+ * declaration (`PluginSkillSourceDeclaration`) less its local id and display name, which grant
1711
+ * nothing. The git channel carries the canonical locator plus the ref and subdir, because the same
1712
+ * repository at another ref or folder is a different source the user never approved; the installer
1713
+ * channel carries the command and its argv exactly, never joined into one string.
1714
+ */
1715
+ export declare const DeclaredSkillSourceEnvelope: z.ZodDiscriminatedUnion<[z.ZodObject<{
1716
+ channel: z.ZodLiteral<"git-clone">;
1717
+ locator: z.ZodString;
1718
+ ref: z.ZodOptional<z.ZodString>;
1719
+ subdir: z.ZodOptional<z.ZodString>;
1720
+ }, z.core.$strict>, z.ZodObject<{
1721
+ channel: z.ZodLiteral<"installer">;
1722
+ command: z.ZodString;
1723
+ args: z.ZodArray<z.ZodString>;
1724
+ }, z.core.$strict>], "channel">;
1725
+
1726
+ export declare type DeclaredSkillSourceEnvelope = z.infer<typeof DeclaredSkillSourceEnvelope>;
1727
+
1708
1728
  /** Drop repeats under {@link sameClaim}, preserving first-seen order (a sort settles the rest). */
1709
1729
  export declare function dedupeClaims(claims: readonly PluginCapabilityClaimV1[]): PluginCapabilityClaimV1[];
1710
1730
 
1731
+ /**
1732
+ * The one `toolName` a directory plugin may declare for the tool `localId`: every `.` in
1733
+ * `namespace` becomes `_`, then one more `_` joins `localId`. The directory verdict drops a tool
1734
+ * that declares anything else. Bundled plugins are not held to it.
1735
+ *
1736
+ * Injective over every schema-valid pair, so two directory plugins can only derive the same tool
1737
+ * name by sharing both namespace and localId. Neither input can contain `_` (`PLUGIN_ID_PATTERN`
1738
+ * and `LOCAL_CONTRIBUTION_ID_PATTERN` exclude it), so every `_` in the output was inserted here,
1739
+ * and splitting on `_` recovers the namespace's segments and then `localId` (which has no `.`).
1740
+ *
1741
+ * A `-` is deliberately left alone: mapping it to `_` too would send `("a", "b-c")` and
1742
+ * `("a-b", "c")` to the same `a_b_c`. The tool-name alphabet admits `-` for that reason (#4341).
1743
+ */
1744
+ export declare function deriveDirectoryPluginToolName(namespace: string, localId: string): string;
1745
+
1711
1746
  export declare const DeviceDelegationContribution: z.ZodObject<{
1712
1747
  localId: z.ZodString;
1713
1748
  device: z.ZodEnum<{
@@ -1933,6 +1968,12 @@ export declare type InteractionDriverContribution = z.infer<typeof InteractionDr
1933
1968
  /** Whether the report permits the plugin to load. */
1934
1969
  export declare function isCompatible(report: KayPluginCompatibilityReport): boolean;
1935
1970
 
1971
+ /**
1972
+ * Whether a refusal `code` came from the compatibility check: the plugin was written for another
1973
+ * SDK or protocol, as opposed to being malformed.
1974
+ */
1975
+ export declare function isKayPluginCompatibilityRefusal(code: string): code is KayPluginCompatibilityRefusalCode;
1976
+
1936
1977
  /**
1937
1978
  * Discriminates a grant's auth-scheme reference between a local id and an
1938
1979
  * already-qualified global id. Local contribution ids cannot contain dots.
@@ -2015,8 +2056,10 @@ export declare const KAY_APP_DATA_SNAPSHOT_MAX_BYTES: number;
2015
2056
  */
2016
2057
  export declare const KAY_EVENT_PUBLISHER_ID: "kay";
2017
2058
 
2059
+ declare const KAY_PLUGIN_COMPATIBILITY_REFUSAL_CODES: readonly ["unsupported-protocol", "sdk-range-unsatisfied", "sdk-range-unsupported", "host-sdk-version-invalid"];
2060
+
2018
2061
  /** Released SDK contracts still implemented by the host, alongside its current SDK. */
2019
- export declare const KAY_PLUGIN_COMPATIBLE_SDK_VERSIONS: readonly ["0.8.0", "0.8.1", "0.8.2", "0.8.3", "0.8.4", "0.8.5", "0.9.0", "0.9.1", "0.10.0", "0.11.0", "0.11.1", "0.12.0", "0.12.1", "0.12.2", "0.12.3", "0.12.4", "0.12.5", "0.13.0", "0.13.1", "0.13.2", "0.13.3", "0.13.4"];
2062
+ export declare const KAY_PLUGIN_COMPATIBLE_SDK_VERSIONS: readonly ["0.8.0", "0.8.1", "0.8.2", "0.8.3", "0.8.4", "0.8.5", "0.9.0", "0.9.1", "0.10.0", "0.11.0", "0.11.1", "0.12.0", "0.12.1", "0.12.2", "0.12.3", "0.12.4", "0.12.5", "0.13.0", "0.13.1", "0.13.2", "0.13.3", "0.13.4", "0.13.5", "0.13.6"];
2020
2063
 
2021
2064
  /** The file whose presence makes a directory a plugin. A directory without one is not a plugin. */
2022
2065
  export declare const KAY_PLUGIN_MANIFEST_FILENAME = "kay-plugin.json";
@@ -2281,11 +2324,36 @@ export declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
2281
2324
  *
2282
2325
  * 0.13.5 loads a `kay.agent` or `kay.app` entrypoint's default export when the manifest's
2283
2326
  * `entrypoint.export` names none, the way Pi writes extensions; a module with no default export
2284
- * still loads from a named `activate`. No API changes. A plugin whose entrypoint has only a default
2327
+ * still loads from a named `activate`. A plugin whose entrypoint has only a default
2285
2328
  * export declares `^0.13.5`, so an older host, which reads only `activate`, refuses it at load
2286
- * instead of failing to find the export.
2329
+ * instead of failing to find the export. It also renamed three published types with no aliases,
2330
+ * a break in the authoring types that shipped in this patch: `kay-app`'s `SessionTreeEntry`
2331
+ * became `TranscriptEntry`, and `transcript`'s `TranscriptEntry` and `TranscriptSourceEntry`
2332
+ * became `TranscriptEntryLike` and `TranscriptSourceEntryLike`.
2333
+ *
2334
+ * 0.13.6 publishes the pure contracts Bonsai's own plugins took from its internal libraries, so a
2335
+ * plugin needs less beside the SDK. A new `@bonsai/plugin-sdk/time` carries `Temporal` (the
2336
+ * host's own instance, like `z`), `canonicalZone`, `isValidZone` and `sameZone`, and the time
2337
+ * door's types. `kay-app` adds
2338
+ * the `JsonSchema` and `JsonValue` schemas, `PluginAgentDefinitionPermissionRule`,
2339
+ * `KAY_APP_DATA_SNAPSHOT_MAX_BYTES`, and the URI types `UriHelp`, `RawResource`, `UriPayload`,
2340
+ * `UriListParams`, `UriListResult`, `UriSearchParams` and `UriSearchResult`. `kay-agent` adds
2341
+ * `compileUriClaim`, `kay-agent/testing` adds `createTestClock`, and `transcript` adds the turn walk
2342
+ * (`turnSegments`), the run records and the work-block and work-headline helpers. Additive: a
2343
+ * plugin compiled against 0.13.5 never imports them. A plugin that imports one declares `^0.13.6`,
2344
+ * so an older host refuses a directory or repository plugin at load instead of the import failing.
2345
+ *
2346
+ * 0.13.7 adds four subpaths. `@bonsai/plugin-sdk/vendored-mcp` re-exports
2347
+ * `@bonsai/vendored-mcp-integration` (`createVendoredMcpUriModule` and its descriptor types; not
2348
+ * the MCP read-port types). `transcript-review` and `agent-conversation` re-export the session
2349
+ * folds Bonsai's own Sessions and Hindsight plugins share. `app-data` carries the app-data size
2350
+ * caps on an entry with no other import, for code a `kay.ui` page also loads. The protocol it
2351
+ * ships also carries three new capability-claim slugs (`mcp.host-server`, `prompt.resident`,
2352
+ * `skills.declared-source`). Additive: a plugin compiled against 0.13.6 never imports the new
2353
+ * subpaths, and its manifest parses unchanged. A plugin that imports one declares `^0.13.7`, so
2354
+ * an older host refuses a directory or repository plugin at load instead of the import failing.
2287
2355
  */
2288
- export declare const KAY_PLUGIN_SDK_VERSION: "0.13.5";
2356
+ export declare const KAY_PLUGIN_SDK_VERSION: "0.13.7";
2289
2357
 
2290
2358
  export declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
2291
2359
 
@@ -2600,7 +2668,7 @@ export declare interface KayPluginCompatibilityNote<TCode extends string> {
2600
2668
  readonly message: string;
2601
2669
  }
2602
2670
 
2603
- export declare type KayPluginCompatibilityRefusalCode = "unsupported-protocol" | "sdk-range-unsatisfied" | "sdk-range-unsupported" | "host-sdk-version-invalid";
2671
+ export declare type KayPluginCompatibilityRefusalCode = (typeof KAY_PLUGIN_COMPATIBILITY_REFUSAL_CODES)[number];
2604
2672
 
2605
2673
  /**
2606
2674
  * What the check found. `refusal` absent means the plugin may load; advisories
@@ -2626,6 +2694,11 @@ export declare type KayPluginDirectoryVerdict = {
2626
2694
  } | {
2627
2695
  readonly outcome: "refused";
2628
2696
  readonly refusal: PluginLoadDiagnostic;
2697
+ /**
2698
+ * The id the manifest declares, as written, when the refusal came after the manifest was
2699
+ * read; it is not validated, so it may not be a well-formed plugin id.
2700
+ */
2701
+ readonly pluginId?: string;
2629
2702
  /** Notes raised before the refusal; the author still meets them once it is fixed. */
2630
2703
  readonly warnings: readonly PluginLoadDiagnostic[];
2631
2704
  } | {
@@ -3878,7 +3951,7 @@ export declare function parseResolvedPluginContractV1(value: unknown): ResolvedP
3878
3951
  export declare function parseSemver(value: string): ParsedSemver | undefined;
3879
3952
 
3880
3953
  /** Every capability slug {@link PluginCapabilityClaimV1} can express, for exhaustive table checks. */
3881
- export declare const PLUGIN_CAPABILITY_SLUGS: readonly ["sessions.run", "network.connect", "web-session.request", "web-session.download", "process.spawn", "corpus.read", "signals.read", "skills.read", "tools.describe", "workspace.command", "sessions.create", "sessions.update", "models.complete", "jev.use", "automations.write", "automations.run", "workflows.define", "session-events.subscribe", "agents.run", "dynamic-context.register", "app-data.register", "account.assert", "account.update", "agents.permissions", "tool-interception.register", "interaction.surface", "config.declare-section", "auth.own-service", "auth.shared-identity", "cli.bind", "whiteboard.discover", "whiteboard.read", "whiteboard.create", "whiteboard.update", "whiteboard.remove"];
3954
+ export declare const PLUGIN_CAPABILITY_SLUGS: readonly ["sessions.run", "network.connect", "web-session.request", "web-session.download", "process.spawn", "corpus.read", "signals.read", "skills.read", "tools.describe", "workspace.command", "sessions.create", "sessions.update", "models.complete", "jev.use", "automations.write", "automations.run", "workflows.define", "session-events.subscribe", "agents.run", "dynamic-context.register", "app-data.register", "account.assert", "account.update", "agents.permissions", "tool-interception.register", "interaction.surface", "config.declare-section", "auth.own-service", "auth.shared-identity", "cli.bind", "mcp.host-server", "prompt.resident", "skills.declared-source", "whiteboard.discover", "whiteboard.read", "whiteboard.create", "whiteboard.update", "whiteboard.remove"];
3882
3955
 
3883
3956
  /** Diagnostic messages carry plugin-controlled text (parse errors, module errors); bound it so a
3884
3957
  * hostile or accidental multi-megabyte error can never blow up a log line or a render surface. */
@@ -4255,17 +4328,20 @@ export declare type PluginAuthService = z.infer<typeof PluginAuthService>;
4255
4328
  * `target` names that scope, and carries ONE value beyond the three plugin targets
4256
4329
  * (`PluginTargetName`): `"plugin"`, for a claim held by the plugin as a whole rather than by one
4257
4330
  * of its targets. Composition decides those — owning a shared auth service, consuming another
4258
- * plugin's identity, binding a CLI credential, declaring a config section — before any target
4259
- * code is loaded, so there is no target to charge them to. They are still exactly claims: one
4331
+ * plugin's identity, binding a CLI credential, declaring a config section, hosting an MCP server,
4332
+ * a resident prompt section, a plugin-declared skill source — before any target code is loaded, so
4333
+ * there is no target to charge them to. They are still exactly claims: one
4260
4334
  * exact envelope, one grant row, one consent.
4261
4335
  *
4262
4336
  * `process.spawn` additionally carries `argvClass`: the declared CLASS of argument vector the
4263
4337
  * plugin will spawn with. It is an opaque exact string here — this module never interprets it —
4264
4338
  * and the broker packet that consumes it owns what a class permits.
4265
4339
  *
4266
- * `agents.permissions` is the one variant whose envelope is not flat: it carries the permission
4340
+ * Two variants carry an envelope that is not flat. `agents.permissions` carries the permission
4267
4341
  * rules themselves, in declaration order, because a human approving it must read the rules they
4268
- * are approving. Its equality is still exact — see {@link sameClaim}.
4342
+ * are approving. `skills.declared-source` carries one of two source shapes
4343
+ * ({@link DeclaredSkillSourceEnvelope}), because a git source and an installer differ in what
4344
+ * pins them. Equality for both is still exact — see {@link sameClaim}.
4269
4345
  */
4270
4346
  export declare const PluginCapabilityClaimV1: z.ZodDiscriminatedUnion<[z.ZodObject<{
4271
4347
  target: z.ZodLiteral<"kay.app">;
@@ -4451,6 +4527,30 @@ export declare const PluginCapabilityClaimV1: z.ZodDiscriminatedUnion<[z.ZodObje
4451
4527
  envelope: z.ZodObject<{
4452
4528
  binary: z.ZodString;
4453
4529
  }, z.core.$strict>;
4530
+ }, z.core.$strict>, z.ZodObject<{
4531
+ target: z.ZodLiteral<"plugin">;
4532
+ slug: z.ZodLiteral<"mcp.host-server">;
4533
+ envelope: z.ZodObject<{
4534
+ name: z.ZodString;
4535
+ url: z.ZodString;
4536
+ }, z.core.$strict>;
4537
+ }, z.core.$strict>, z.ZodObject<{
4538
+ target: z.ZodLiteral<"plugin">;
4539
+ slug: z.ZodLiteral<"prompt.resident">;
4540
+ envelope: z.ZodObject<{}, z.core.$strict>;
4541
+ }, z.core.$strict>, z.ZodObject<{
4542
+ target: z.ZodLiteral<"plugin">;
4543
+ slug: z.ZodLiteral<"skills.declared-source">;
4544
+ envelope: z.ZodDiscriminatedUnion<[z.ZodObject<{
4545
+ channel: z.ZodLiteral<"git-clone">;
4546
+ locator: z.ZodString;
4547
+ ref: z.ZodOptional<z.ZodString>;
4548
+ subdir: z.ZodOptional<z.ZodString>;
4549
+ }, z.core.$strict>, z.ZodObject<{
4550
+ channel: z.ZodLiteral<"installer">;
4551
+ command: z.ZodString;
4552
+ args: z.ZodArray<z.ZodString>;
4553
+ }, z.core.$strict>], "channel">;
4454
4554
  }, z.core.$strict>, z.ZodObject<{
4455
4555
  target: z.ZodEnum<{
4456
4556
  "kay.agent": "kay.agent";
@@ -4663,6 +4763,30 @@ export declare const PluginCapabilityDecisionV1: z.ZodDiscriminatedUnion<[z.ZodO
4663
4763
  envelope: z.ZodObject<{
4664
4764
  binary: z.ZodString;
4665
4765
  }, z.core.$strict>;
4766
+ }, z.core.$strict>, z.ZodObject<{
4767
+ target: z.ZodLiteral<"plugin">;
4768
+ slug: z.ZodLiteral<"mcp.host-server">;
4769
+ envelope: z.ZodObject<{
4770
+ name: z.ZodString;
4771
+ url: z.ZodString;
4772
+ }, z.core.$strict>;
4773
+ }, z.core.$strict>, z.ZodObject<{
4774
+ target: z.ZodLiteral<"plugin">;
4775
+ slug: z.ZodLiteral<"prompt.resident">;
4776
+ envelope: z.ZodObject<{}, z.core.$strict>;
4777
+ }, z.core.$strict>, z.ZodObject<{
4778
+ target: z.ZodLiteral<"plugin">;
4779
+ slug: z.ZodLiteral<"skills.declared-source">;
4780
+ envelope: z.ZodDiscriminatedUnion<[z.ZodObject<{
4781
+ channel: z.ZodLiteral<"git-clone">;
4782
+ locator: z.ZodString;
4783
+ ref: z.ZodOptional<z.ZodString>;
4784
+ subdir: z.ZodOptional<z.ZodString>;
4785
+ }, z.core.$strict>, z.ZodObject<{
4786
+ channel: z.ZodLiteral<"installer">;
4787
+ command: z.ZodString;
4788
+ args: z.ZodArray<z.ZodString>;
4789
+ }, z.core.$strict>], "channel">;
4666
4790
  }, z.core.$strict>, z.ZodObject<{
4667
4791
  target: z.ZodEnum<{
4668
4792
  "kay.agent": "kay.agent";
@@ -4870,6 +4994,30 @@ export declare const PluginCapabilityDecisionV1: z.ZodDiscriminatedUnion<[z.ZodO
4870
4994
  envelope: z.ZodObject<{
4871
4995
  binary: z.ZodString;
4872
4996
  }, z.core.$strict>;
4997
+ }, z.core.$strict>, z.ZodObject<{
4998
+ target: z.ZodLiteral<"plugin">;
4999
+ slug: z.ZodLiteral<"mcp.host-server">;
5000
+ envelope: z.ZodObject<{
5001
+ name: z.ZodString;
5002
+ url: z.ZodString;
5003
+ }, z.core.$strict>;
5004
+ }, z.core.$strict>, z.ZodObject<{
5005
+ target: z.ZodLiteral<"plugin">;
5006
+ slug: z.ZodLiteral<"prompt.resident">;
5007
+ envelope: z.ZodObject<{}, z.core.$strict>;
5008
+ }, z.core.$strict>, z.ZodObject<{
5009
+ target: z.ZodLiteral<"plugin">;
5010
+ slug: z.ZodLiteral<"skills.declared-source">;
5011
+ envelope: z.ZodDiscriminatedUnion<[z.ZodObject<{
5012
+ channel: z.ZodLiteral<"git-clone">;
5013
+ locator: z.ZodString;
5014
+ ref: z.ZodOptional<z.ZodString>;
5015
+ subdir: z.ZodOptional<z.ZodString>;
5016
+ }, z.core.$strict>, z.ZodObject<{
5017
+ channel: z.ZodLiteral<"installer">;
5018
+ command: z.ZodString;
5019
+ args: z.ZodArray<z.ZodString>;
5020
+ }, z.core.$strict>], "channel">;
4873
5021
  }, z.core.$strict>, z.ZodObject<{
4874
5022
  target: z.ZodEnum<{
4875
5023
  "kay.agent": "kay.agent";
@@ -5140,6 +5288,30 @@ export declare const PluginCapabilityRefusalV1: z.ZodObject<{
5140
5288
  envelope: z.ZodObject<{
5141
5289
  binary: z.ZodString;
5142
5290
  }, z.core.$strict>;
5291
+ }, z.core.$strict>, z.ZodObject<{
5292
+ target: z.ZodLiteral<"plugin">;
5293
+ slug: z.ZodLiteral<"mcp.host-server">;
5294
+ envelope: z.ZodObject<{
5295
+ name: z.ZodString;
5296
+ url: z.ZodString;
5297
+ }, z.core.$strict>;
5298
+ }, z.core.$strict>, z.ZodObject<{
5299
+ target: z.ZodLiteral<"plugin">;
5300
+ slug: z.ZodLiteral<"prompt.resident">;
5301
+ envelope: z.ZodObject<{}, z.core.$strict>;
5302
+ }, z.core.$strict>, z.ZodObject<{
5303
+ target: z.ZodLiteral<"plugin">;
5304
+ slug: z.ZodLiteral<"skills.declared-source">;
5305
+ envelope: z.ZodDiscriminatedUnion<[z.ZodObject<{
5306
+ channel: z.ZodLiteral<"git-clone">;
5307
+ locator: z.ZodString;
5308
+ ref: z.ZodOptional<z.ZodString>;
5309
+ subdir: z.ZodOptional<z.ZodString>;
5310
+ }, z.core.$strict>, z.ZodObject<{
5311
+ channel: z.ZodLiteral<"installer">;
5312
+ command: z.ZodString;
5313
+ args: z.ZodArray<z.ZodString>;
5314
+ }, z.core.$strict>], "channel">;
5143
5315
  }, z.core.$strict>, z.ZodObject<{
5144
5316
  target: z.ZodEnum<{
5145
5317
  "kay.agent": "kay.agent";