@yaklabs-ai/plugin-protocol 0.13.6 → 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.6"
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.6",
4
+ "version": "0.13.7",
5
5
  "target": "npm",
6
6
  "firstPartyLicense": "MIT",
7
7
  "bundled": [],
package/dist/index.d.ts CHANGED
@@ -1705,6 +1705,26 @@ 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
 
@@ -1948,6 +1968,12 @@ export declare type InteractionDriverContribution = z.infer<typeof InteractionDr
1948
1968
  /** Whether the report permits the plugin to load. */
1949
1969
  export declare function isCompatible(report: KayPluginCompatibilityReport): boolean;
1950
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
+
1951
1977
  /**
1952
1978
  * Discriminates a grant's auth-scheme reference between a local id and an
1953
1979
  * already-qualified global id. Local contribution ids cannot contain dots.
@@ -2030,8 +2056,10 @@ export declare const KAY_APP_DATA_SNAPSHOT_MAX_BYTES: number;
2030
2056
  */
2031
2057
  export declare const KAY_EVENT_PUBLISHER_ID: "kay";
2032
2058
 
2059
+ declare const KAY_PLUGIN_COMPATIBILITY_REFUSAL_CODES: readonly ["unsupported-protocol", "sdk-range-unsatisfied", "sdk-range-unsupported", "host-sdk-version-invalid"];
2060
+
2033
2061
  /** Released SDK contracts still implemented by the host, alongside its current SDK. */
2034
- 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"];
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"];
2035
2063
 
2036
2064
  /** The file whose presence makes a directory a plugin. A directory without one is not a plugin. */
2037
2065
  export declare const KAY_PLUGIN_MANIFEST_FILENAME = "kay-plugin.json";
@@ -2314,8 +2342,18 @@ export declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
2314
2342
  * (`turnSegments`), the run records and the work-block and work-headline helpers. Additive: a
2315
2343
  * plugin compiled against 0.13.5 never imports them. A plugin that imports one declares `^0.13.6`,
2316
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.
2317
2355
  */
2318
- export declare const KAY_PLUGIN_SDK_VERSION: "0.13.6";
2356
+ export declare const KAY_PLUGIN_SDK_VERSION: "0.13.7";
2319
2357
 
2320
2358
  export declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
2321
2359
 
@@ -2630,7 +2668,7 @@ export declare interface KayPluginCompatibilityNote<TCode extends string> {
2630
2668
  readonly message: string;
2631
2669
  }
2632
2670
 
2633
- 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];
2634
2672
 
2635
2673
  /**
2636
2674
  * What the check found. `refusal` absent means the plugin may load; advisories
@@ -2656,6 +2694,11 @@ export declare type KayPluginDirectoryVerdict = {
2656
2694
  } | {
2657
2695
  readonly outcome: "refused";
2658
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;
2659
2702
  /** Notes raised before the refusal; the author still meets them once it is fixed. */
2660
2703
  readonly warnings: readonly PluginLoadDiagnostic[];
2661
2704
  } | {
@@ -3908,7 +3951,7 @@ export declare function parseResolvedPluginContractV1(value: unknown): ResolvedP
3908
3951
  export declare function parseSemver(value: string): ParsedSemver | undefined;
3909
3952
 
3910
3953
  /** Every capability slug {@link PluginCapabilityClaimV1} can express, for exhaustive table checks. */
3911
- 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"];
3912
3955
 
3913
3956
  /** Diagnostic messages carry plugin-controlled text (parse errors, module errors); bound it so a
3914
3957
  * hostile or accidental multi-megabyte error can never blow up a log line or a render surface. */
@@ -4285,17 +4328,20 @@ export declare type PluginAuthService = z.infer<typeof PluginAuthService>;
4285
4328
  * `target` names that scope, and carries ONE value beyond the three plugin targets
4286
4329
  * (`PluginTargetName`): `"plugin"`, for a claim held by the plugin as a whole rather than by one
4287
4330
  * of its targets. Composition decides those — owning a shared auth service, consuming another
4288
- * plugin's identity, binding a CLI credential, declaring a config section — before any target
4289
- * 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
4290
4334
  * exact envelope, one grant row, one consent.
4291
4335
  *
4292
4336
  * `process.spawn` additionally carries `argvClass`: the declared CLASS of argument vector the
4293
4337
  * plugin will spawn with. It is an opaque exact string here — this module never interprets it —
4294
4338
  * and the broker packet that consumes it owns what a class permits.
4295
4339
  *
4296
- * `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
4297
4341
  * rules themselves, in declaration order, because a human approving it must read the rules they
4298
- * 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}.
4299
4345
  */
4300
4346
  export declare const PluginCapabilityClaimV1: z.ZodDiscriminatedUnion<[z.ZodObject<{
4301
4347
  target: z.ZodLiteral<"kay.app">;
@@ -4481,6 +4527,30 @@ export declare const PluginCapabilityClaimV1: z.ZodDiscriminatedUnion<[z.ZodObje
4481
4527
  envelope: z.ZodObject<{
4482
4528
  binary: z.ZodString;
4483
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">;
4484
4554
  }, z.core.$strict>, z.ZodObject<{
4485
4555
  target: z.ZodEnum<{
4486
4556
  "kay.agent": "kay.agent";
@@ -4693,6 +4763,30 @@ export declare const PluginCapabilityDecisionV1: z.ZodDiscriminatedUnion<[z.ZodO
4693
4763
  envelope: z.ZodObject<{
4694
4764
  binary: z.ZodString;
4695
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">;
4696
4790
  }, z.core.$strict>, z.ZodObject<{
4697
4791
  target: z.ZodEnum<{
4698
4792
  "kay.agent": "kay.agent";
@@ -4900,6 +4994,30 @@ export declare const PluginCapabilityDecisionV1: z.ZodDiscriminatedUnion<[z.ZodO
4900
4994
  envelope: z.ZodObject<{
4901
4995
  binary: z.ZodString;
4902
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">;
4903
5021
  }, z.core.$strict>, z.ZodObject<{
4904
5022
  target: z.ZodEnum<{
4905
5023
  "kay.agent": "kay.agent";
@@ -5170,6 +5288,30 @@ export declare const PluginCapabilityRefusalV1: z.ZodObject<{
5170
5288
  envelope: z.ZodObject<{
5171
5289
  binary: z.ZodString;
5172
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">;
5173
5315
  }, z.core.$strict>, z.ZodObject<{
5174
5316
  target: z.ZodEnum<{
5175
5317
  "kay.agent": "kay.agent";
package/dist/index.js CHANGED
@@ -136,7 +136,7 @@ var JsonSchema = z2.record(z2.string(), JsonValue);
136
136
  // packages/plugin-protocol/dist/common.js
137
137
  var KAY_PLUGIN_PROTOCOL_VERSION = "kay.plugin.v1";
138
138
  var KAY_PLUGIN_PROTOCOL_PACKAGE_NAME = "@bonsai/plugin-protocol";
139
- var KAY_PLUGIN_SDK_VERSION = "0.13.6";
139
+ var KAY_PLUGIN_SDK_VERSION = "0.13.7";
140
140
  var KAY_PLUGIN_COMPATIBLE_SDK_VERSIONS = [
141
141
  "0.8.0",
142
142
  "0.8.1",
@@ -160,7 +160,8 @@ var KAY_PLUGIN_COMPATIBLE_SDK_VERSIONS = [
160
160
  "0.13.2",
161
161
  "0.13.3",
162
162
  "0.13.4",
163
- "0.13.5"
163
+ "0.13.5",
164
+ "0.13.6"
164
165
  ];
165
166
  var KAY_PLUGIN_TARGET_NAMES = [
166
167
  "kay.agent",
@@ -1489,6 +1490,19 @@ var WhiteboardCapabilityClaimV1 = z8.strictObject({
1489
1490
  });
1490
1491
  }
1491
1492
  });
1493
+ var DeclaredSkillSourceEnvelope = z8.discriminatedUnion("channel", [
1494
+ z8.strictObject({
1495
+ channel: z8.literal("git-clone"),
1496
+ locator: NonEmptyString,
1497
+ ref: NonEmptyString.optional(),
1498
+ subdir: NonEmptyString.optional()
1499
+ }),
1500
+ z8.strictObject({
1501
+ channel: z8.literal("installer"),
1502
+ command: NonEmptyString,
1503
+ args: z8.array(NonEmptyString)
1504
+ })
1505
+ ]);
1492
1506
  var PluginCapabilityClaimV1 = z8.discriminatedUnion("slug", [
1493
1507
  z8.strictObject({
1494
1508
  target: z8.literal("kay.app"),
@@ -1681,6 +1695,25 @@ var PluginCapabilityClaimV1 = z8.discriminatedUnion("slug", [
1681
1695
  /** The binary basename a resolved credential would be injected into. */
1682
1696
  envelope: z8.strictObject({ binary: NonEmptyString })
1683
1697
  }),
1698
+ z8.strictObject({
1699
+ target: z8.literal("plugin"),
1700
+ slug: z8.literal("mcp.host-server"),
1701
+ // The daemon dials this endpoint, holds its sign-in, and serves it as `mcp://<name>`, so the
1702
+ // endpoint becomes daemon execution authority. One claim per exact name and URL.
1703
+ envelope: z8.strictObject({ name: NonEmptyString, url: NonEmptyString })
1704
+ }),
1705
+ z8.strictObject({
1706
+ target: z8.literal("plugin"),
1707
+ slug: z8.literal("prompt.resident"),
1708
+ // A section of the plugin's own text in every session's system prompt. An empty envelope
1709
+ // because the grant itself is the decision; the host caps the section's length.
1710
+ envelope: z8.strictObject({})
1711
+ }),
1712
+ z8.strictObject({
1713
+ target: z8.literal("plugin"),
1714
+ slug: z8.literal("skills.declared-source"),
1715
+ envelope: DeclaredSkillSourceEnvelope
1716
+ }),
1684
1717
  WhiteboardCapabilityClaimV1
1685
1718
  ]);
1686
1719
  var RETIRED_PLUGIN_CAPABILITY_SLUGS = [
@@ -1718,6 +1751,9 @@ var PLUGIN_CAPABILITY_SLUGS = [
1718
1751
  "auth.own-service",
1719
1752
  "auth.shared-identity",
1720
1753
  "cli.bind",
1754
+ "mcp.host-server",
1755
+ "prompt.resident",
1756
+ "skills.declared-source",
1721
1757
  "whiteboard.discover",
1722
1758
  "whiteboard.read",
1723
1759
  "whiteboard.create",
@@ -1815,6 +1851,7 @@ function sameClaim(a, b) {
1815
1851
  case "account.assert":
1816
1852
  case "account.update":
1817
1853
  case "tool-interception.register":
1854
+ case "prompt.resident":
1818
1855
  return true;
1819
1856
  case "network.connect":
1820
1857
  return b.slug === "network.connect" && a.envelope.connect === b.envelope.connect;
@@ -1838,6 +1875,10 @@ function sameClaim(a, b) {
1838
1875
  return (b.slug === "auth.own-service" || b.slug === "auth.shared-identity") && a.envelope.service === b.envelope.service;
1839
1876
  case "cli.bind":
1840
1877
  return b.slug === "cli.bind" && a.envelope.binary === b.envelope.binary;
1878
+ case "mcp.host-server":
1879
+ return b.slug === "mcp.host-server" && a.envelope.name === b.envelope.name && a.envelope.url === b.envelope.url;
1880
+ case "skills.declared-source":
1881
+ return b.slug === "skills.declared-source" && declaredSourcePairs(a.envelope, b.envelope).every(([left, right]) => left === right);
1841
1882
  case "whiteboard.discover":
1842
1883
  case "whiteboard.read":
1843
1884
  case "whiteboard.create":
@@ -1880,6 +1921,7 @@ function envelopePairs(a, b) {
1880
1921
  case "account.assert":
1881
1922
  case "account.update":
1882
1923
  case "tool-interception.register":
1924
+ case "prompt.resident":
1883
1925
  return [];
1884
1926
  case "network.connect":
1885
1927
  return b.slug === "network.connect" ? [[a.envelope.connect, b.envelope.connect]] : [];
@@ -1919,6 +1961,13 @@ function envelopePairs(a, b) {
1919
1961
  return b.slug === "auth.own-service" || b.slug === "auth.shared-identity" ? [[a.envelope.service, b.envelope.service]] : [];
1920
1962
  case "cli.bind":
1921
1963
  return b.slug === "cli.bind" ? [[a.envelope.binary, b.envelope.binary]] : [];
1964
+ case "mcp.host-server":
1965
+ return b.slug === "mcp.host-server" ? [
1966
+ [a.envelope.name, b.envelope.name],
1967
+ [a.envelope.url, b.envelope.url]
1968
+ ] : [];
1969
+ case "skills.declared-source":
1970
+ return b.slug === "skills.declared-source" ? declaredSourcePairs(a.envelope, b.envelope) : [];
1922
1971
  case "whiteboard.discover":
1923
1972
  case "whiteboard.read":
1924
1973
  case "whiteboard.create":
@@ -1927,6 +1976,24 @@ function envelopePairs(a, b) {
1927
1976
  return b.slug === a.slug && "scope" in b.envelope ? [[a.envelope.scope, b.envelope.scope]] : [];
1928
1977
  }
1929
1978
  }
1979
+ function declaredSourcePairs(a, b) {
1980
+ if (a.channel === "git-clone" && b.channel === "git-clone") {
1981
+ return [
1982
+ [a.channel, b.channel],
1983
+ [a.locator, b.locator],
1984
+ [a.ref ?? "", b.ref ?? ""],
1985
+ [a.subdir ?? "", b.subdir ?? ""]
1986
+ ];
1987
+ }
1988
+ if (a.channel === "installer" && b.channel === "installer") {
1989
+ return [
1990
+ [a.channel, b.channel],
1991
+ [a.command, b.command],
1992
+ [JSON.stringify(a.args), JSON.stringify(b.args)]
1993
+ ];
1994
+ }
1995
+ return [[a.channel, b.channel]];
1996
+ }
1930
1997
  function whiteboardCapabilityClaim(operation, scope, target = "kay.agent") {
1931
1998
  if (target === "kay.app" && operation !== "discover" && operation !== "read") {
1932
1999
  throw new TypeError("kay.app Whiteboard claims are read-only");
@@ -2127,6 +2194,15 @@ function kayPluginHostCompatibility(appVersion) {
2127
2194
  appVersion
2128
2195
  };
2129
2196
  }
2197
+ var KAY_PLUGIN_COMPATIBILITY_REFUSAL_CODES = [
2198
+ "unsupported-protocol",
2199
+ "sdk-range-unsatisfied",
2200
+ "sdk-range-unsupported",
2201
+ "host-sdk-version-invalid"
2202
+ ];
2203
+ function isKayPluginCompatibilityRefusal(code) {
2204
+ return KAY_PLUGIN_COMPATIBILITY_REFUSAL_CODES.includes(code);
2205
+ }
2130
2206
  function isCompatible(report) {
2131
2207
  return report.refusal === void 0;
2132
2208
  }
@@ -4527,10 +4603,12 @@ async function judgeKayPluginDirectory(input) {
4527
4603
  const file = KAY_PLUGIN_MANIFEST_FILENAME;
4528
4604
  const hostSdkVersion = host?.sdkVersion;
4529
4605
  const warnings = [];
4606
+ let pluginId;
4530
4607
  const refuse = (stage, code, message) => ({
4531
4608
  outcome: "refused",
4532
4609
  hostSdkVersion,
4533
4610
  refusal: { stage, root, dir, code, message: boundPluginDiagnosticMessage(message) },
4611
+ ...pluginId === void 0 ? {} : { pluginId },
4534
4612
  warnings
4535
4613
  });
4536
4614
  let manifestEntry;
@@ -4564,6 +4642,8 @@ async function judgeKayPluginDirectory(input) {
4564
4642
  return refuse("manifest-parse", "invalid-json", `${file} is not valid JSON: ${errorText(error)}`);
4565
4643
  }
4566
4644
  const head = ReadableManifestHead.safeParse(json);
4645
+ if (head.success)
4646
+ pluginId = head.data.id;
4567
4647
  if (host !== void 0 && head.success && head.data.compatibility) {
4568
4648
  const { refusal } = checkKayPluginHostCompatibility(head.data.compatibility, host);
4569
4649
  if (refusal !== void 0) {
@@ -4972,6 +5052,7 @@ export {
4972
5052
  CorpusResourceInvocationCursor,
4973
5053
  CorpusResourceInvocationQuery,
4974
5054
  CorpusResourceKind,
5055
+ DeclaredSkillSourceEnvelope,
4975
5056
  DeviceDelegationContribution,
4976
5057
  EndpointContribution,
4977
5058
  EndpointGrantRequest,
@@ -5158,6 +5239,7 @@ export {
5158
5239
  hasClaim,
5159
5240
  hostWithinDomain,
5160
5241
  isCompatible,
5242
+ isKayPluginCompatibilityRefusal,
5161
5243
  isQualifiedAuthSchemeRef,
5162
5244
  isQualifiedAuthServiceRef,
5163
5245
  isSupportedSemverRange,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yaklabs-ai/plugin-protocol",
3
- "version": "0.13.6",
3
+ "version": "0.13.7",
4
4
  "description": "The Kay plugin manifest schema (`kay.plugin.v1`) — parse and validate a kay-plugin.json.",
5
5
  "author": "YakLabs",
6
6
  "type": "module",