@yaklabs-ai/plugin-protocol 0.12.5 → 0.13.1

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
@@ -1,6 +1,6 @@
1
1
  # @yaklabs-ai/plugin-protocol
2
2
 
3
- The **`kay.plugin.v1` manifest schema** — the same Zod schema Kay's daemon uses
3
+ The **`kay.plugin.v1` manifest schema** — the same Zod schema Bonsai's daemon uses
4
4
  to parse `kay-plugin.json` at load time.
5
5
 
6
6
  Published to the public npm registry under the MIT licence, always at the same
@@ -11,7 +11,7 @@ flow.
11
11
  ```json
12
12
  {
13
13
  "dependencies": {
14
- "@kay/plugin-protocol": "npm:@yaklabs-ai/plugin-protocol@^0.12.5"
14
+ "@kay/plugin-protocol": "npm:@yaklabs-ai/plugin-protocol@^0.13.1"
15
15
  }
16
16
  }
17
17
  ```
@@ -37,22 +37,22 @@ if (!parsed.success) {
37
37
 
38
38
  A hand-rolled field check drifts from the contract it claims to enforce and
39
39
  passes while the host rejects the plugin at load. This is the host's own schema,
40
- so it cannot drift — and unlike resolving it out of a Kay checkout, it needs no
40
+ so it cannot drift — and unlike resolving it out of a Bonsai checkout, it needs no
41
41
  clone, no build, and no `KAY_REPO` environment variable.
42
42
 
43
- ## Version it against your Kay app
43
+ ## Version it against your Bonsai app
44
44
 
45
45
  The schema changes over time — it gains fields, and it can also **remove** one.
46
46
  Three skews follow, and only the first two fail on your machine:
47
47
 
48
- - Validating against a **newer** schema than your Kay app runs can accept a
48
+ - Validating against a **newer** schema than your Bonsai app runs can accept a
49
49
  manifest the host will reject.
50
50
  - Validating against an **older** schema can reject a manifest the host would
51
51
  happily load.
52
52
  - Validating against an **older** schema can also _accept_ a field the host has
53
53
  since removed. `KayPluginManifestV1` parses with `strictObject`, so an
54
54
  unrecognized key is a hard rejection: your local validation goes green, and
55
- Kay drops the plugin at load with a diagnostic you never see.
55
+ Bonsai drops the plugin at load with a diagnostic you never see.
56
56
 
57
- Keep this package in step with the Kay version you target — the third skew is
57
+ Keep this package in step with the Bonsai version you target — the third skew is
58
58
  the one a green local run will not warn you about.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "package": "@yaklabs-ai/plugin-protocol",
4
- "version": "0.12.5",
4
+ "version": "0.13.1",
5
5
  "target": "npm",
6
6
  "firstPartyLicense": "MIT",
7
7
  "bundled": [],
package/dist/index.d.ts CHANGED
@@ -1417,7 +1417,7 @@ export declare type CliBinaryName = z.infer<typeof CliBinaryName>;
1417
1417
  * catalog, pinned and checksum-verified. Credential injection is available, and
1418
1418
  * gated on the binary actually being materialized in `vendoredToolsDir`
1419
1419
  * (constraint 12, vendored-or-nothing).
1420
- * - `"path"` — a binary the USER OR AGENT installed on `PATH`. Kay ships nothing,
1420
+ * - `"path"` — a binary the USER OR AGENT installed on `PATH`. Bonsai ships nothing,
1421
1421
  * pins nothing, and verifies nothing, so this binding is structurally barred from
1422
1422
  * receiving a secret: `authEnvVar` must be absent, and `authService` must declare
1423
1423
  * only `external-cli` schemes. `buildCliBindingRoster` throws on either violation.
@@ -1792,7 +1792,7 @@ export declare function finalizeArtifactProvenanceEnvelope(capture: ArtifactProv
1792
1792
  * The Basic-auth USERNAME a git host expects beside an injected token
1793
1793
  * (`x-access-token` for GitHub, `oauth2` for GitLab). The token is the password
1794
1794
  * half, so this is a fixed per-vendor literal rather than a user identity, and
1795
- * it is the only per-vendor variance in Kay's git transport.
1795
+ * it is the only per-vendor variance in Bonsai's git transport.
1796
1796
  *
1797
1797
  * Restricted to unreserved URL characters: a colon would move the `user:token`
1798
1798
  * boundary the `Authorization: Basic` header encodes, and whitespace or control
@@ -1965,15 +1965,15 @@ export declare const KAY_APP_DATA_READ_RESULT_MAX_BYTES: number;
1965
1965
  export declare const KAY_APP_DATA_SNAPSHOT_MAX_BYTES: number;
1966
1966
 
1967
1967
  /**
1968
- * The publisher id Kay's own subsystems publish declared events under (skill
1968
+ * The publisher id Bonsai's own subsystems publish declared events under (skill
1969
1969
  * changes, wallet notices, automation failures). A notification rule matches a
1970
1970
  * declared event by (publisher id, event local id), so no plugin may take this
1971
- * id or it could publish events that Kay's default rules read as Kay's own.
1971
+ * id or it could publish events that Bonsai's default rules read as Bonsai's own.
1972
1972
  */
1973
1973
  export declare const KAY_EVENT_PUBLISHER_ID: "kay";
1974
1974
 
1975
1975
  /** Released SDK contracts still implemented by the host, alongside its current SDK. */
1976
- 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"];
1976
+ 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"];
1977
1977
 
1978
1978
  export declare const KAY_PLUGIN_PROTOCOL_PACKAGE_NAME: "@kay/plugin-protocol";
1979
1979
 
@@ -1986,7 +1986,7 @@ export declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
1986
1986
  * ── Why this is the compatibility axis, and the app version is not ──────────
1987
1987
  * A plugin never bundles the SDK: the host injects its own `@kay/plugin-sdk`
1988
1988
  * dist at import time. So the SDK surface a plugin was written against is the
1989
- * thing that can break under it, and the Kay app version is only correlated
1989
+ * thing that can break under it, and the Bonsai app version is only correlated
1990
1990
  * with that — it moves for reasons a plugin cannot observe.
1991
1991
  *
1992
1992
  * ── Two lines, deliberately, not one ────────────────────────────────────────
@@ -2115,8 +2115,8 @@ export declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
2115
2115
  * failing.
2116
2116
  *
2117
2117
  * 0.12.0 replaces the vendor client `api.withJev` hands its callback. `use`
2118
- * now receives Kay's own `JevClient` (`@kay/plugin-sdk/jev`): one method,
2119
- * `classify({state, questions})`, in Kay's question and answer vocabulary
2118
+ * now receives Bonsai's own `JevClient` (`@kay/plugin-sdk/jev`): one method,
2119
+ * `classify({state, questions})`, in Bonsai's question and answer vocabulary
2120
2120
  * (yes/no is `bool` answering `probability`; instructions and criteria are
2121
2121
  * text; the state is a JSON object), rejecting with a classified
2122
2122
  * `JevCallError`. TypeSafe's `TypeSafeClient`, `SystemOneRequest`,
@@ -2177,8 +2177,35 @@ export declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
2177
2177
  * ungated, like `app.paths`. Additive: a plugin compiled against 0.12.4 never reads it. A plugin
2178
2178
  * that calls it declares `^0.12.5`, so an older host refuses a directory or repository plugin at
2179
2179
  * load instead of the call failing.
2180
+ *
2181
+ * 0.13.0 adds `@kay/plugin-sdk/fs`, Bonsai's own `node:fs/promises`: the same functions, arguments,
2182
+ * return types and errors, with every call run on the host's user-files workers under a deadline
2183
+ * (`ERR_KAY_FS_DEADLINE` and siblings when the host gives up or does not try), plus
2184
+ * `writeFileAtomic` and `withTimeout`. With no host installed it is Node's own module. It adds
2185
+ * `api.familyFolder` (`KayAgentFamilyFolder`), whose `path()` answers the plugin's folder in its
2186
+ * session family's Whiteboard, and makes it a required member of `KayAgentPluginApi`. It removes
2187
+ * the `kay.agent` api's `filesystem` broker, the `filesystem.read` / `filesystem.write`
2188
+ * permissions it was gated by, the `{ root: "filesystem", selector }` URI backing and the URI
2189
+ * module `verbs` that went with it: plugins use `@kay/plugin-sdk/fs`, `userFiles` or
2190
+ * `familyFolder` instead. No plugin used them. Stored grants naming the retired permissions are
2191
+ * ignored, not refused. For the api surface this is a clean break with no shim and deliberately
2192
+ * NOT a load refusal, like 0.12.0: every earlier release stays in the retention list, so a
2193
+ * plugin compiled against 0.12.x that reads `api.filesystem` gets `undefined` at the call. The
2194
+ * manifest is different: a manifest that still declares URI-module `verbs` or
2195
+ * `filesystemBacking: { root: "filesystem" }` fails to parse and is refused at load (no plugin
2196
+ * declared either). A plugin that imports
2197
+ * `@kay/plugin-sdk/fs` or calls `familyFolder` declares `^0.13.0`, so an older host refuses a
2198
+ * directory or repository plugin at load.
2199
+ *
2200
+ * 0.13.1 adds the signal engine to `@kay/plugin-sdk/signals`: `SignalDefinition`,
2201
+ * `createSignalEngine` and `signalAnswersPass` (a plugin declares its Jev signals as data and the
2202
+ * engine evaluates them, upstreams first, through `app.signals.observe`), plus `signalDigest`.
2203
+ * `observe` gains three optional input fields, `subject`, `after` and `reuse`, and an observation
2204
+ * and a read signal carry the stored `subject` and `upstreamId` back. Additive: a plugin compiled
2205
+ * against 0.13.0 never sends or reads them. A plugin that imports the engine declares `^0.13.1`,
2206
+ * so an older host refuses a directory or repository plugin at load.
2180
2207
  */
2181
- export declare const KAY_PLUGIN_SDK_VERSION: "0.12.5";
2208
+ export declare const KAY_PLUGIN_SDK_VERSION: "0.13.1";
2182
2209
 
2183
2210
  export declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
2184
2211
 
@@ -2211,16 +2238,8 @@ export declare const KayAgentTargetManifest: z.ZodObject<{
2211
2238
  localId: z.ZodString;
2212
2239
  schemes: z.ZodArray<z.ZodString>;
2213
2240
  displayName: z.ZodOptional<z.ZodString>;
2214
- filesystemBacking: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
2241
+ filesystemBacking: z.ZodOptional<z.ZodObject<{
2215
2242
  root: z.ZodLiteral<"dataDir">;
2216
- }, z.core.$strict>, z.ZodObject<{
2217
- root: z.ZodLiteral<"filesystem">;
2218
- selector: z.ZodString;
2219
- }, z.core.$strict>], "root">>;
2220
- verbs: z.ZodOptional<z.ZodObject<{
2221
- writable: z.ZodOptional<z.ZodBoolean>;
2222
- editable: z.ZodOptional<z.ZodBoolean>;
2223
- deletable: z.ZodOptional<z.ZodBoolean>;
2224
2243
  }, z.core.$strict>>;
2225
2244
  authService: z.ZodOptional<z.ZodString>;
2226
2245
  knownResources: z.ZodOptional<z.ZodLiteral<true>>;
@@ -2509,10 +2528,10 @@ export declare interface KayPluginHostCompatibility {
2509
2528
  readonly sdkVersion: string;
2510
2529
  /** Older SDK releases whose runtime contracts this host still implements; absent means none. */
2511
2530
  readonly compatibleSdkVersions?: readonly string[];
2512
- /** The Kay app version. Advisory only — never a refusal. */
2531
+ /** The Bonsai app version. Advisory only — never a refusal. */
2513
2532
  readonly appVersion: string;
2514
2533
  /**
2515
- * Whether the plugin ships WITH Kay. A bundled plugin is cut from this tree,
2534
+ * Whether the plugin ships WITH Bonsai. A bundled plugin is cut from this tree,
2516
2535
  * so declaring no SDK range is a property of how it ships rather than a gap
2517
2536
  * its author left, and the undeclared-range advisory is suppressed for it.
2518
2537
  *
@@ -2559,16 +2578,8 @@ export declare const KayPluginManifestV1: z.ZodObject<{
2559
2578
  localId: z.ZodString;
2560
2579
  schemes: z.ZodArray<z.ZodString>;
2561
2580
  displayName: z.ZodOptional<z.ZodString>;
2562
- filesystemBacking: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
2581
+ filesystemBacking: z.ZodOptional<z.ZodObject<{
2563
2582
  root: z.ZodLiteral<"dataDir">;
2564
- }, z.core.$strict>, z.ZodObject<{
2565
- root: z.ZodLiteral<"filesystem">;
2566
- selector: z.ZodString;
2567
- }, z.core.$strict>], "root">>;
2568
- verbs: z.ZodOptional<z.ZodObject<{
2569
- writable: z.ZodOptional<z.ZodBoolean>;
2570
- editable: z.ZodOptional<z.ZodBoolean>;
2571
- deletable: z.ZodOptional<z.ZodBoolean>;
2572
2583
  }, z.core.$strict>>;
2573
2584
  authService: z.ZodOptional<z.ZodString>;
2574
2585
  knownResources: z.ZodOptional<z.ZodLiteral<true>>;
@@ -3530,7 +3541,7 @@ export declare type KayVersionString = z.infer<typeof KayVersionString>;
3530
3541
  *
3531
3542
  * Distinct from raw session-transcript streaming (`app.corpus`, authorized per call by the
3532
3543
  * `corpus.read` claim) and from `registerSearchProvider` (a plugin registering a backend behind
3533
- * Kay's own web-search tool) — this grant is the reverse direction: a plugin READING the shared
3544
+ * Bonsai's own web-search tool) — this grant is the reverse direction: a plugin READING the shared
3534
3545
  * knowledge index that OTHER ingest lanes (skills, URIs) already populate, confined to its own
3535
3546
  * address space.
3536
3547
  */
@@ -3709,7 +3720,7 @@ export declare interface ParsedSemver {
3709
3720
 
3710
3721
  export declare function parseKayPluginManifestV1(value: unknown): KayPluginManifestV1;
3711
3722
 
3712
- /** Parses one origin-agnostic, loadable Kay React app package. */
3723
+ /** Parses one origin-agnostic, loadable Bonsai React app package. */
3713
3724
  export declare function parseKayUiAppPackageV1(input: unknown): KayUiAppPackageV1;
3714
3725
 
3715
3726
  export declare function parseKayUiBundleIndexV1(input: unknown): KayUiBundleIndexV1;
@@ -3720,7 +3731,7 @@ export declare function parseResolvedPluginContractV1(value: unknown): ResolvedP
3720
3731
  export declare function parseSemver(value: string): ParsedSemver | undefined;
3721
3732
 
3722
3733
  /** Every capability slug {@link PluginCapabilityClaimV1} can express, for exhaustive table checks. */
3723
- export declare const PLUGIN_CAPABILITY_SLUGS: readonly ["sessions.run", "network.connect", "web-session.request", "web-session.download", "filesystem.read", "filesystem.write", "process.spawn", "corpus.read", "signals.read", "skills.read", "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"];
3734
+ 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", "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"];
3724
3735
 
3725
3736
  /** The root `<svg>` attribute a tile icon declares itself with. */
3726
3737
  export declare const PLUGIN_ICON_SHAPE_ATTRIBUTE = "data-icon-shape";
@@ -4129,18 +4140,6 @@ export declare const PluginCapabilityClaimV1: z.ZodDiscriminatedUnion<[z.ZodObje
4129
4140
  origin: z.ZodString;
4130
4141
  pathPrefix: z.ZodString;
4131
4142
  }, z.core.$strict>;
4132
- }, z.core.$strict>, z.ZodObject<{
4133
- target: z.ZodLiteral<"kay.agent">;
4134
- slug: z.ZodLiteral<"filesystem.read">;
4135
- envelope: z.ZodObject<{
4136
- root: z.ZodString;
4137
- }, z.core.$strict>;
4138
- }, z.core.$strict>, z.ZodObject<{
4139
- target: z.ZodLiteral<"kay.agent">;
4140
- slug: z.ZodLiteral<"filesystem.write">;
4141
- envelope: z.ZodObject<{
4142
- root: z.ZodString;
4143
- }, z.core.$strict>;
4144
4143
  }, z.core.$strict>, z.ZodObject<{
4145
4144
  target: z.ZodLiteral<"kay.agent">;
4146
4145
  slug: z.ZodLiteral<"process.spawn">;
@@ -4349,18 +4348,6 @@ export declare const PluginCapabilityDecisionV1: z.ZodDiscriminatedUnion<[z.ZodO
4349
4348
  origin: z.ZodString;
4350
4349
  pathPrefix: z.ZodString;
4351
4350
  }, z.core.$strict>;
4352
- }, z.core.$strict>, z.ZodObject<{
4353
- target: z.ZodLiteral<"kay.agent">;
4354
- slug: z.ZodLiteral<"filesystem.read">;
4355
- envelope: z.ZodObject<{
4356
- root: z.ZodString;
4357
- }, z.core.$strict>;
4358
- }, z.core.$strict>, z.ZodObject<{
4359
- target: z.ZodLiteral<"kay.agent">;
4360
- slug: z.ZodLiteral<"filesystem.write">;
4361
- envelope: z.ZodObject<{
4362
- root: z.ZodString;
4363
- }, z.core.$strict>;
4364
4351
  }, z.core.$strict>, z.ZodObject<{
4365
4352
  target: z.ZodLiteral<"kay.agent">;
4366
4353
  slug: z.ZodLiteral<"process.spawn">;
@@ -4564,18 +4551,6 @@ export declare const PluginCapabilityDecisionV1: z.ZodDiscriminatedUnion<[z.ZodO
4564
4551
  origin: z.ZodString;
4565
4552
  pathPrefix: z.ZodString;
4566
4553
  }, z.core.$strict>;
4567
- }, z.core.$strict>, z.ZodObject<{
4568
- target: z.ZodLiteral<"kay.agent">;
4569
- slug: z.ZodLiteral<"filesystem.read">;
4570
- envelope: z.ZodObject<{
4571
- root: z.ZodString;
4572
- }, z.core.$strict>;
4573
- }, z.core.$strict>, z.ZodObject<{
4574
- target: z.ZodLiteral<"kay.agent">;
4575
- slug: z.ZodLiteral<"filesystem.write">;
4576
- envelope: z.ZodObject<{
4577
- root: z.ZodString;
4578
- }, z.core.$strict>;
4579
4554
  }, z.core.$strict>, z.ZodObject<{
4580
4555
  target: z.ZodLiteral<"kay.agent">;
4581
4556
  slug: z.ZodLiteral<"process.spawn">;
@@ -4842,18 +4817,6 @@ export declare const PluginCapabilityRefusalV1: z.ZodObject<{
4842
4817
  origin: z.ZodString;
4843
4818
  pathPrefix: z.ZodString;
4844
4819
  }, z.core.$strict>;
4845
- }, z.core.$strict>, z.ZodObject<{
4846
- target: z.ZodLiteral<"kay.agent">;
4847
- slug: z.ZodLiteral<"filesystem.read">;
4848
- envelope: z.ZodObject<{
4849
- root: z.ZodString;
4850
- }, z.core.$strict>;
4851
- }, z.core.$strict>, z.ZodObject<{
4852
- target: z.ZodLiteral<"kay.agent">;
4853
- slug: z.ZodLiteral<"filesystem.write">;
4854
- envelope: z.ZodObject<{
4855
- root: z.ZodString;
4856
- }, z.core.$strict>;
4857
4820
  }, z.core.$strict>, z.ZodObject<{
4858
4821
  target: z.ZodLiteral<"kay.agent">;
4859
4822
  slug: z.ZodLiteral<"process.spawn">;
@@ -5536,7 +5499,7 @@ export declare type PluginProvisioningRequirement = z.infer<typeof PluginProvisi
5536
5499
  *
5537
5500
  * ── What this schema deliberately does NOT validate ─────────────────────────────────────────
5538
5501
  * Structure and bounds only. WHICH installer commands are legal, and whether a git locator is
5539
- * canonical/safe, are Kay-layer POLICY that already has exactly one home each
5502
+ * canonical/safe, are Bonsai-layer POLICY that already has exactly one home each
5540
5503
  * (`installer-skill-source.ts`'s executable allowlist, `remote-skill-source.ts`'s locator
5541
5504
  * hygiene). Re-stating either here would fork the policy: this package would then hold a second
5542
5505
  * answer that drifts from the one the daemon enforces. The daemon applies those validators to a
@@ -5568,7 +5531,7 @@ export declare type PluginSkillSourceDeclaration = z.infer<typeof PluginSkillSou
5568
5531
  * generation `freeform`.
5569
5532
  *
5570
5533
  * Five classes, ordered loosely by how much the host knows about the author:
5571
- * `bundled` (compiled into Kay), `org-shared` (distributed inside the user's
5534
+ * `bundled` (compiled into Bonsai), `org-shared` (distributed inside the user's
5572
5535
  * organization), `user-local` (the user put it in their own plugins root),
5573
5536
  * `verified-marketplace` (a reviewed marketplace artifact), `freeform`
5574
5537
  * (anything else — today, a plugin repository generation). Two of them
@@ -5576,7 +5539,7 @@ export declare type PluginSkillSourceDeclaration = z.infer<typeof PluginSkillSou
5576
5539
  *
5577
5540
  * IT DECIDES NOTHING. There is no ceiling table keyed on this and no capability a class grants or
5578
5541
  * withholds: authority is the user's grant ledger, one exact claim at a time, plus the one rule
5579
- * that a plugin Kay itself bundles holds every grant. A future gate that wants to read this is a
5542
+ * that a plugin Bonsai itself bundles holds every grant. A future gate that wants to read this is a
5580
5543
  * new decision to argue for, not a use this type already sanctions.
5581
5544
  */
5582
5545
  export declare const PluginSourceClass: z.ZodEnum<{
@@ -5951,16 +5914,8 @@ export declare const ResolvedKayAgentUriModule: z.ZodObject<{
5951
5914
  localId: z.ZodString;
5952
5915
  globalId: z.ZodString;
5953
5916
  schemes: z.ZodArray<z.ZodString>;
5954
- filesystemBacking: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
5917
+ filesystemBacking: z.ZodOptional<z.ZodObject<{
5955
5918
  root: z.ZodLiteral<"dataDir">;
5956
- }, z.core.$strict>, z.ZodObject<{
5957
- root: z.ZodLiteral<"filesystem">;
5958
- selector: z.ZodString;
5959
- }, z.core.$strict>], "root">>;
5960
- verbs: z.ZodOptional<z.ZodObject<{
5961
- writable: z.ZodOptional<z.ZodBoolean>;
5962
- editable: z.ZodOptional<z.ZodBoolean>;
5963
- deletable: z.ZodOptional<z.ZodBoolean>;
5964
5919
  }, z.core.$strict>>;
5965
5920
  knownResources: z.ZodOptional<z.ZodLiteral<true>>;
5966
5921
  }, z.core.$strict>;
@@ -6769,16 +6724,8 @@ export declare const ResolvedPluginContractV1: z.ZodObject<{
6769
6724
  localId: z.ZodString;
6770
6725
  globalId: z.ZodString;
6771
6726
  schemes: z.ZodArray<z.ZodString>;
6772
- filesystemBacking: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
6727
+ filesystemBacking: z.ZodOptional<z.ZodObject<{
6773
6728
  root: z.ZodLiteral<"dataDir">;
6774
- }, z.core.$strict>, z.ZodObject<{
6775
- root: z.ZodLiteral<"filesystem">;
6776
- selector: z.ZodString;
6777
- }, z.core.$strict>], "root">>;
6778
- verbs: z.ZodOptional<z.ZodObject<{
6779
- writable: z.ZodOptional<z.ZodBoolean>;
6780
- editable: z.ZodOptional<z.ZodBoolean>;
6781
- deletable: z.ZodOptional<z.ZodBoolean>;
6782
6729
  }, z.core.$strict>>;
6783
6730
  knownResources: z.ZodOptional<z.ZodLiteral<true>>;
6784
6731
  }, z.core.$strict>>>;
@@ -7519,6 +7466,9 @@ export declare const RETIRED_COMPATIBILITY_KEYS: readonly ["policy"];
7519
7466
  */
7520
7467
  export declare const RETIRED_PERMISSION_ASK_KEYS: readonly ["network", "process", "filesystem", "corpus", "paths", "workspace", "sessions", "automations", "hindsight", "agents", "dynamicContext", "appData", "toolInterception", "account", "device", "config", "workflows", "whiteboard"];
7521
7468
 
7469
+ /** Capability slugs retired in SDK 0.13.0; a stored grant naming one is ignored, never refused. */
7470
+ export declare const RETIRED_PLUGIN_CAPABILITY_SLUGS: readonly ["filesystem.read", "filesystem.write"];
7471
+
7522
7472
  /**
7523
7473
  * The one retired FIELD inside a surviving row: a `webSession` row's `operations` only ever fed the
7524
7474
  * deleted declaration check (the row itself stays, as routing).
@@ -8434,13 +8384,10 @@ export declare const UiSlotContribution: z.ZodObject<{
8434
8384
 
8435
8385
  export declare type UiSlotContribution = z.infer<typeof UiSlotContribution>;
8436
8386
 
8437
- /** A request for host-authorized filesystem projection; mutation needs separate verb authority. */
8438
- export declare const UriFilesystemBacking: z.ZodDiscriminatedUnion<[z.ZodObject<{
8387
+ /** A request for a read-only projection of the plugin's private data directory. */
8388
+ export declare const UriFilesystemBacking: z.ZodObject<{
8439
8389
  root: z.ZodLiteral<"dataDir">;
8440
- }, z.core.$strict>, z.ZodObject<{
8441
- root: z.ZodLiteral<"filesystem">;
8442
- selector: z.ZodString;
8443
- }, z.core.$strict>], "root">;
8390
+ }, z.core.$strict>;
8444
8391
 
8445
8392
  export declare type UriFilesystemBacking = z.infer<typeof UriFilesystemBacking>;
8446
8393
 
@@ -8448,16 +8395,8 @@ export declare const UriModuleContribution: z.ZodObject<{
8448
8395
  localId: z.ZodString;
8449
8396
  schemes: z.ZodArray<z.ZodString>;
8450
8397
  displayName: z.ZodOptional<z.ZodString>;
8451
- filesystemBacking: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
8398
+ filesystemBacking: z.ZodOptional<z.ZodObject<{
8452
8399
  root: z.ZodLiteral<"dataDir">;
8453
- }, z.core.$strict>, z.ZodObject<{
8454
- root: z.ZodLiteral<"filesystem">;
8455
- selector: z.ZodString;
8456
- }, z.core.$strict>], "root">>;
8457
- verbs: z.ZodOptional<z.ZodObject<{
8458
- writable: z.ZodOptional<z.ZodBoolean>;
8459
- editable: z.ZodOptional<z.ZodBoolean>;
8460
- deletable: z.ZodOptional<z.ZodBoolean>;
8461
8400
  }, z.core.$strict>>;
8462
8401
  authService: z.ZodOptional<z.ZodString>;
8463
8402
  knownResources: z.ZodOptional<z.ZodLiteral<true>>;
package/dist/index.js CHANGED
@@ -115,7 +115,7 @@ import { z as z2 } from "zod";
115
115
  import { z } from "zod";
116
116
  var KAY_PLUGIN_PROTOCOL_VERSION = "kay.plugin.v1";
117
117
  var KAY_PLUGIN_PROTOCOL_PACKAGE_NAME = "@kay/plugin-protocol";
118
- var KAY_PLUGIN_SDK_VERSION = "0.12.5";
118
+ var KAY_PLUGIN_SDK_VERSION = "0.13.1";
119
119
  var KAY_PLUGIN_COMPATIBLE_SDK_VERSIONS = [
120
120
  "0.8.0",
121
121
  "0.8.1",
@@ -132,7 +132,9 @@ var KAY_PLUGIN_COMPATIBLE_SDK_VERSIONS = [
132
132
  "0.12.1",
133
133
  "0.12.2",
134
134
  "0.12.3",
135
- "0.12.4"
135
+ "0.12.4",
136
+ "0.12.5",
137
+ "0.13.0"
136
138
  ];
137
139
  var KAY_PLUGIN_TARGET_NAMES = [
138
140
  "kay.agent",
@@ -1497,16 +1499,6 @@ var PluginCapabilityClaimV1 = z6.discriminatedUnion("slug", [
1497
1499
  pathPrefix: NonEmptyString
1498
1500
  })
1499
1501
  }),
1500
- z6.strictObject({
1501
- target: z6.literal("kay.agent"),
1502
- slug: z6.literal("filesystem.read"),
1503
- envelope: z6.strictObject({ root: NonEmptyString })
1504
- }),
1505
- z6.strictObject({
1506
- target: z6.literal("kay.agent"),
1507
- slug: z6.literal("filesystem.write"),
1508
- envelope: z6.strictObject({ root: NonEmptyString })
1509
- }),
1510
1502
  z6.strictObject({
1511
1503
  target: z6.literal("kay.agent"),
1512
1504
  slug: z6.literal("process.spawn"),
@@ -1637,7 +1629,7 @@ var PluginCapabilityClaimV1 = z6.discriminatedUnion("slug", [
1637
1629
  z6.strictObject({
1638
1630
  target: z6.literal("kay.agent"),
1639
1631
  slug: z6.literal("interaction.surface"),
1640
- /** The one Kay-shipped interaction surface this plugin may drive; one claim per surface. */
1632
+ /** The one Bonsai-shipped interaction surface this plugin may drive; one claim per surface. */
1641
1633
  envelope: z6.strictObject({ surface: z6.enum(["browser-pane", "desktop"]) })
1642
1634
  }),
1643
1635
  z6.strictObject({
@@ -1666,13 +1658,15 @@ var PluginCapabilityClaimV1 = z6.discriminatedUnion("slug", [
1666
1658
  }),
1667
1659
  WhiteboardCapabilityClaimV1
1668
1660
  ]);
1661
+ var RETIRED_PLUGIN_CAPABILITY_SLUGS = [
1662
+ "filesystem.read",
1663
+ "filesystem.write"
1664
+ ];
1669
1665
  var PLUGIN_CAPABILITY_SLUGS = [
1670
1666
  "sessions.run",
1671
1667
  "network.connect",
1672
1668
  "web-session.request",
1673
1669
  "web-session.download",
1674
- "filesystem.read",
1675
- "filesystem.write",
1676
1670
  "process.spawn",
1677
1671
  "corpus.read",
1678
1672
  "signals.read",
@@ -1800,9 +1794,6 @@ function sameClaim(a, b) {
1800
1794
  case "web-session.request":
1801
1795
  case "web-session.download":
1802
1796
  return (b.slug === "web-session.request" || b.slug === "web-session.download") && a.envelope.origin === b.envelope.origin && a.envelope.pathPrefix === b.envelope.pathPrefix;
1803
- case "filesystem.read":
1804
- case "filesystem.write":
1805
- return (b.slug === "filesystem.read" || b.slug === "filesystem.write") && a.envelope.root === b.envelope.root;
1806
1797
  case "process.spawn":
1807
1798
  return b.slug === "process.spawn" && a.envelope.command === b.envelope.command && a.envelope.argvClass === b.envelope.argvClass;
1808
1799
  case "interaction.surface":
@@ -1870,9 +1861,6 @@ function envelopePairs(a, b) {
1870
1861
  [a.envelope.origin, b.envelope.origin],
1871
1862
  [a.envelope.pathPrefix, b.envelope.pathPrefix]
1872
1863
  ] : [];
1873
- case "filesystem.read":
1874
- case "filesystem.write":
1875
- return b.slug === "filesystem.read" || b.slug === "filesystem.write" ? [[a.envelope.root, b.envelope.root]] : [];
1876
1864
  case "process.spawn":
1877
1865
  return b.slug === "process.spawn" ? [
1878
1866
  [a.envelope.command, b.envelope.command],
@@ -2115,7 +2103,7 @@ function checkKayPluginHostCompatibility(compatibility, host) {
2115
2103
  return {
2116
2104
  refusal: {
2117
2105
  code: "unsupported-protocol",
2118
- message: `declares support for ${declared} but this Kay speaks ${host.protocolVersion}`
2106
+ message: `declares support for ${declared} but this Bonsai speaks ${host.protocolVersion}`
2119
2107
  },
2120
2108
  advisories
2121
2109
  };
@@ -2126,19 +2114,19 @@ function checkKayPluginHostCompatibility(compatibility, host) {
2126
2114
  if (parseSemver(minKayVersion) === void 0) {
2127
2115
  advisories.push({
2128
2116
  code: "min-kay-version-unparseable",
2129
- message: `declares a minimum Kay version of "${minKayVersion}", which is not a version Kay can compare`
2117
+ message: `declares a minimum Bonsai version of "${minKayVersion}", which is not a version Bonsai can compare`
2130
2118
  });
2131
2119
  } else {
2132
2120
  const order = compareSemver(host.appVersion, minKayVersion);
2133
2121
  if (order === void 0) {
2134
2122
  advisories.push({
2135
2123
  code: "min-kay-version-unparseable",
2136
- message: `asks for Kay ${minKayVersion} or newer, which cannot be checked against this Kay's version "${host.appVersion}"`
2124
+ message: `asks for Bonsai ${minKayVersion} or newer, which cannot be checked against this Bonsai's version "${host.appVersion}"`
2137
2125
  });
2138
2126
  } else if (order < 0) {
2139
2127
  advisories.push({
2140
2128
  code: "min-kay-version-unmet",
2141
- message: `asks for Kay ${minKayVersion} or newer; this is ${host.appVersion}`
2129
+ message: `asks for Bonsai ${minKayVersion} or newer; this is ${host.appVersion}`
2142
2130
  });
2143
2131
  }
2144
2132
  }
@@ -2148,7 +2136,7 @@ function checkKayPluginHostCompatibility(compatibility, host) {
2148
2136
  if (host.bundled !== true) {
2149
2137
  advisories.push({
2150
2138
  code: "sdk-range-undeclared",
2151
- message: `declares no compatibility.sdk range; this Kay ships plugin SDK ${host.sdkVersion}`
2139
+ message: `declares no compatibility.sdk range; this Bonsai ships plugin SDK ${host.sdkVersion}`
2152
2140
  });
2153
2141
  }
2154
2142
  return { refusal: void 0, advisories };
@@ -2162,7 +2150,7 @@ function checkKayPluginHostCompatibility(compatibility, host) {
2162
2150
  return {
2163
2151
  refusal: {
2164
2152
  code: "host-sdk-version-invalid",
2165
- message: `cannot be checked: this Kay reports plugin SDK "${invalidVersion}", which is not valid semver`
2153
+ message: `cannot be checked: this Bonsai reports plugin SDK "${invalidVersion}", which is not valid semver`
2166
2154
  },
2167
2155
  advisories
2168
2156
  };
@@ -2171,7 +2159,7 @@ function checkKayPluginHostCompatibility(compatibility, host) {
2171
2159
  return {
2172
2160
  refusal: {
2173
2161
  code: "sdk-range-unsupported",
2174
- message: `declares an SDK range of "${range}", which Kay cannot interpret (use a caret, tilde, or comparator range such as ^${host.sdkVersion})`
2162
+ message: `declares an SDK range of "${range}", which Bonsai cannot interpret (use a caret, tilde, or comparator range such as ^${host.sdkVersion})`
2175
2163
  },
2176
2164
  advisories
2177
2165
  };
@@ -2180,7 +2168,7 @@ function checkKayPluginHostCompatibility(compatibility, host) {
2180
2168
  return {
2181
2169
  refusal: {
2182
2170
  code: "sdk-range-unsatisfied",
2183
- message: `needs plugin SDK ${range}, this Kay ships ${host.sdkVersion}`
2171
+ message: `needs plugin SDK ${range}, this Bonsai ships ${host.sdkVersion}`
2184
2172
  },
2185
2173
  advisories
2186
2174
  };
@@ -2191,13 +2179,9 @@ function checkKayPluginHostCompatibility(compatibility, host) {
2191
2179
  // packages/plugin-protocol/dist/contributions.js
2192
2180
  import { z as z7 } from "zod";
2193
2181
  var OptionalDisplayName = NonEmptyString.optional();
2194
- var UriFilesystemBacking = z7.discriminatedUnion("root", [
2195
- z7.strictObject({ root: z7.literal("dataDir") }),
2196
- z7.strictObject({
2197
- root: z7.literal("filesystem"),
2198
- selector: NonEmptyString
2199
- })
2200
- ]);
2182
+ var UriFilesystemBacking = z7.strictObject({
2183
+ root: z7.literal("dataDir")
2184
+ });
2201
2185
  var ToolContribution = z7.strictObject({
2202
2186
  localId: LocalContributionId,
2203
2187
  toolName: PluginToolName,
@@ -2214,20 +2198,13 @@ var ConverterContribution = z7.strictObject({
2214
2198
  /** Extension fallbacks (no dot) used when a probe has no usable MIME type. */
2215
2199
  extensions: z7.array(FileExtensionToken).min(1).optional()
2216
2200
  });
2217
- var UriMutationVerbs = z7.strictObject({
2218
- writable: z7.boolean().optional(),
2219
- editable: z7.boolean().optional(),
2220
- deletable: z7.boolean().optional()
2221
- });
2222
- var UriModuleContributionBase = z7.strictObject({
2201
+ var UriModuleContribution = z7.strictObject({
2223
2202
  localId: LocalContributionId,
2224
2203
  schemes: z7.array(UriScheme).min(1),
2225
2204
  displayName: OptionalDisplayName,
2226
2205
  // The plugin only requests a projection. The daemon binds the effective root
2227
2206
  // and retains access control at finalization.
2228
2207
  filesystemBacking: UriFilesystemBacking.optional(),
2229
- /** Host-native mutation verbs requested for an external filesystem projection. */
2230
- verbs: UriMutationVerbs.optional(),
2231
2208
  // A local ref (no dot) must name an auth service declared in this same
2232
2209
  // manifest; a qualified ref (dotted, e.g. `google.account`) names another
2233
2210
  // plugin's already-minted global id and is recorded, not resolved, here (see
@@ -2244,19 +2221,9 @@ var UriModuleContributionBase = z7.strictObject({
2244
2221
  // `lab/user-plugins/decisions/014-known-resources-ledger.md`.
2245
2222
  knownResources: z7.literal(true).optional()
2246
2223
  });
2247
- var UriModuleContribution = UriModuleContributionBase.superRefine((module, ctx) => {
2248
- if (module.verbs !== void 0 && module.filesystemBacking?.root !== "filesystem") {
2249
- ctx.addIssue({
2250
- code: "custom",
2251
- path: ["verbs"],
2252
- message: "URI mutation verbs require external filesystem backing (root: 'filesystem')."
2253
- });
2254
- }
2255
- });
2256
- var AppUriModuleContribution = UriModuleContributionBase.omit({
2224
+ var AppUriModuleContribution = UriModuleContribution.omit({
2257
2225
  authService: true,
2258
2226
  filesystemBacking: true,
2259
- verbs: true,
2260
2227
  knownResources: true
2261
2228
  });
2262
2229
  var AppDataSourceContribution = z7.strictObject({
@@ -3002,7 +2969,7 @@ var PluginAuthSchemeOAuthConfidential = z8.strictObject({
3002
2969
  localId: LocalContributionId,
3003
2970
  kind: z8.literal("oauth2"),
3004
2971
  exchange: z8.literal("confidential"),
3005
- /** Absent means `["kay"]` — a confidential exchange's secret may only ever be Kay's. */
2972
+ /** Absent means `["kay"]` — a confidential exchange's secret may only ever be Bonsai's. */
3006
2973
  clientSuppliers: z8.tuple([z8.literal("kay")]).optional(),
3007
2974
  scopes: z8.array(NonEmptyString).optional()
3008
2975
  });
@@ -3866,21 +3833,8 @@ var ResolvedKayAgentUriModule = z9.strictObject({
3866
3833
  globalId: GlobalContributionId,
3867
3834
  schemes: z9.array(UriScheme).min(1),
3868
3835
  filesystemBacking: UriFilesystemBacking.optional(),
3869
- verbs: z9.strictObject({
3870
- writable: z9.boolean().optional(),
3871
- editable: z9.boolean().optional(),
3872
- deletable: z9.boolean().optional()
3873
- }).optional(),
3874
3836
  /** Mirrors `UriModuleContribution.knownResources` (host-side recording opt-in). */
3875
3837
  knownResources: z9.literal(true).optional()
3876
- }).superRefine((module, ctx) => {
3877
- if (module.verbs !== void 0 && module.filesystemBacking?.root !== "filesystem") {
3878
- ctx.addIssue({
3879
- code: "custom",
3880
- path: ["verbs"],
3881
- message: "Resolved URI mutation verbs require external filesystem backing (root: 'filesystem')."
3882
- });
3883
- }
3884
3838
  });
3885
3839
  var ResolvedKayAgentArtifactUriModule = z9.strictObject({
3886
3840
  localId: LocalContributionId,
@@ -4385,7 +4339,6 @@ function resolveKayPluginContractV1(manifest) {
4385
4339
  globalId: resolveGlobalContributionId(namespace, module.localId),
4386
4340
  schemes: [...module.schemes],
4387
4341
  ...module.filesystemBacking === void 0 ? {} : { filesystemBacking: module.filesystemBacking },
4388
- ...module.verbs === void 0 ? {} : { verbs: module.verbs },
4389
4342
  ...module.knownResources === void 0 ? {} : { knownResources: module.knownResources }
4390
4343
  }));
4391
4344
  const kayAgentArtifactUriModules = manifest.targets?.kay?.agent?.contributes?.artifactUriModules?.map((module) => ({
@@ -4802,6 +4755,7 @@ export {
4802
4755
  PluginWebSessionProbe,
4803
4756
  RETIRED_COMPATIBILITY_KEYS,
4804
4757
  RETIRED_PERMISSION_ASK_KEYS,
4758
+ RETIRED_PLUGIN_CAPABILITY_SLUGS,
4805
4759
  RETIRED_WEB_SESSION_ROW_KEYS,
4806
4760
  ReferenceOpenBehavior,
4807
4761
  ReferencePresentationContribution,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yaklabs-ai/plugin-protocol",
3
- "version": "0.12.5",
3
+ "version": "0.13.1",
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",