@yaklabs-ai/plugin-sdk 0.52.1 → 0.54.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.52.1"
16
+ "@bonsai/plugin-sdk": "npm:@yaklabs-ai/plugin-sdk@^0.54.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.52.1" },
65
+ "compatibility": { "sdk": "^0.54.0" },
66
66
  "targets": {
67
67
  "kay": {
68
68
  "agent": {
@@ -134,24 +134,26 @@ naming both versions, instead of loading it and finding no `activate`.
134
134
 
135
135
  ## Entrypoints
136
136
 
137
- | Import | What it gives you |
138
- | --------------------------------------- | ---------------------------------------------------------------------------------------- |
139
- | `@bonsai/plugin-sdk/kay-agent` | Tools, URI modules, search providers, auth — the per-session agent surface |
140
- | `@bonsai/plugin-sdk/kay-app` | App-lifetime surface: storage, endpoints, app-scoped URI modules |
141
- | `@bonsai/plugin-sdk/uri` | Sessionless resource caller types, revision digest and unavailable fallback, from 0.49.0 |
142
- | `@bonsai/plugin-sdk/endpoints` | Sessionless cross-plugin endpoint caller and outcome types, from 0.50.0 |
143
- | `@bonsai/plugin-sdk/kay-agent/testing` | `invokeToolForTest`, `fauxAuthContext` — for your own `node --test` runs |
144
- | `@bonsai/plugin-sdk/disclosure` | The conformance audit Bonsai gates your plugin with — run it before you ship |
145
- | `@bonsai/plugin-sdk/time` | `Temporal` (Bonsai's own instance) and the time-zone helpers, from 0.13.6 |
146
- | `@bonsai/plugin-sdk/transcript` | The active-branch walk; the turn walk and run records from 0.13.6 |
147
- | `@bonsai/plugin-sdk/transcript-review` | The review fold: a session's spans, tool-call attempts and records, from 0.13.7 |
148
- | `@bonsai/plugin-sdk/agent-conversation` | How a session's agent-to-agent traffic groups into conversations, from 0.13.7 |
149
- | `@bonsai/plugin-sdk/app-data` | The app-data size caps, on an entry with no other import, from 0.13.7 |
150
- | `@bonsai/plugin-sdk/vendored-mcp` | The kit for a plugin built on a vendor's hosted MCP server, from 0.13.7 |
151
- | `@bonsai/plugin-sdk/system-one` | The types and error class for `api.systemOne` / `app.systemOne`, from 0.13.8 |
152
- | `@bonsai/plugin-sdk/zod` | `z` (the host's in the daemon), on an entry with no other import, from 0.13.9 |
153
-
154
- A plugin that imports these subpaths declares the current supported SDK range (`^0.52.1`).
137
+ | Import | What it gives you |
138
+ | --------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
139
+ | `@bonsai/plugin-sdk/kay-agent` | Tools, URI modules, search providers, auth — the per-session agent surface |
140
+ | `@bonsai/plugin-sdk/kay-app` | App-lifetime surface: storage, endpoints, app-scoped URI modules |
141
+ | `@bonsai/plugin-sdk/uri` | Sessionless resource caller types, revision digest and unavailable fallback, from 0.49.0 |
142
+ | `@bonsai/plugin-sdk/endpoints` | Sessionless cross-plugin endpoint caller and outcome types, from 0.50.0; `projectDirectories` endpoint shapes |
143
+ | `@bonsai/plugin-sdk/kay-agent/testing` | `invokeToolForTest`, `fauxAuthContext` — for your own `node --test` runs |
144
+ | `@bonsai/plugin-sdk/disclosure` | The conformance audit Bonsai gates your plugin with — run it before you ship |
145
+ | `@bonsai/plugin-sdk/time` | `Temporal` (Bonsai's own instance) and the time-zone helpers, from 0.13.6 |
146
+ | `@bonsai/plugin-sdk/transcript` | Active-branch and turn walks, message origin, preceding messages, and skill evidence folds |
147
+ | `@bonsai/plugin-sdk/transcript-review` | The review fold: a session's spans, tool-call attempts and records, from 0.13.7 |
148
+ | `@bonsai/plugin-sdk/agent-conversation` | How a session's agent-to-agent traffic groups into conversations, from 0.13.7 |
149
+ | `@bonsai/plugin-sdk/text-diff` | Word-level draft comparison and Unicode-safe text clipping |
150
+ | `@bonsai/plugin-sdk/fs` | File I/O, shared keyed work ordering and committed-change notices |
151
+ | `@bonsai/plugin-sdk/app-data` | The app-data size caps, on an entry with no other import, from 0.13.7 |
152
+ | `@bonsai/plugin-sdk/vendored-mcp` | The kit for a plugin built on a vendor's hosted MCP server, from 0.13.7 |
153
+ | `@bonsai/plugin-sdk/system-one` | The types and error class for `api.systemOne` / `app.systemOne`, from 0.13.8 |
154
+ | `@bonsai/plugin-sdk/zod` | `z` (the host's in the daemon), on an entry with no other import, from 0.13.9 |
155
+
156
+ A plugin that imports these subpaths declares the current supported SDK range (`^0.54.0`).
155
157
  The rows record when each subpath appeared, not retained runtime compatibility. `vendored-mcp` builds the plugin's URI module (its link cards and help); hosting the
156
158
  vendor's MCP server itself is a separate host decision: Bonsai hosts it once a person approves
157
159
  the plugin's `mcp.host-server` grant for that server's name and URL. A server that needs an OAuth
@@ -159,7 +161,7 @@ sign-in names one of the plugin's auth services in `authService`; that service m
159
161
  one `delegated` scheme, which Bonsai uses to sign the person in to the server. Bonsai declares that
160
162
  scheme at runtime; the plugin's code must not declare it again. From 0.16.2 a plugin's code can also
161
163
  call the server's tools through `api.vendoredMcp.port(<server>)`, typed by this subpath's
162
- `VendoredMcpPort` and `VendoredMcpOutcome` (declare `^0.52.1`).
164
+ `VendoredMcpPort` and `VendoredMcpOutcome` (declare `^0.54.0`).
163
165
 
164
166
  From 0.13.10 the manifest schema carries two facts Bonsai reads for its own plugins only; another
165
167
  plugin's are ignored, with a load diagnostic. An `external-cli` auth scheme's `cli` says how Bonsai
@@ -241,7 +243,7 @@ Provider schemas remain authoritative; declaring a dependency grants no authorit
241
243
  through `app.uri`, parse returned Markdown in the consuming plugin, and retain the read's
242
244
  revision (or `contentDigest` from `/uri`) for edits. The old `memory.read` and `memory.write`
243
245
  grants do not authorize the replacement scheme-and-verb calls. Contracts before 0.49.0 are
244
- refused; migrate and declare `^0.52.1`. The current host also serves the 0.49.0 resource contract.
246
+ refused; migrate and declare `^0.54.0`. The current host also serves the 0.49.0 resource contract.
245
247
 
246
248
  ## What this package is, and is not, at runtime
247
249
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "package": "@yaklabs-ai/plugin-sdk",
4
- "version": "0.52.1",
4
+ "version": "0.54.0",
5
5
  "target": "npm",
6
6
  "firstPartyLicense": "MIT",
7
7
  "bundled": [
@@ -234,13 +234,13 @@ declare const ArtifactProvenanceCaptureContextSchema: z.ZodObject<{
234
234
  gaps: z.ZodArray<z.ZodObject<{
235
235
  code: z.ZodEnum<{
236
236
  unknown: "unknown";
237
+ truncated: "truncated";
237
238
  "capture-failed": "capture-failed";
238
239
  "legacy-derived": "legacy-derived";
239
240
  "ambiguous-predecessor": "ambiguous-predecessor";
240
241
  "unverified-index": "unverified-index";
241
242
  "missing-ancestor": "missing-ancestor";
242
243
  cycle: "cycle";
243
- truncated: "truncated";
244
244
  "metadata-write-failed": "metadata-write-failed";
245
245
  "invalid-record": "invalid-record";
246
246
  }>;
@@ -584,13 +584,13 @@ export declare const ArtifactProvenanceEnvelopeV1: z.ZodPipe<z.ZodUnknown, z.Zod
584
584
  gaps: z.ZodArray<z.ZodObject<{
585
585
  code: z.ZodEnum<{
586
586
  unknown: "unknown";
587
+ truncated: "truncated";
587
588
  "capture-failed": "capture-failed";
588
589
  "legacy-derived": "legacy-derived";
589
590
  "ambiguous-predecessor": "ambiguous-predecessor";
590
591
  "unverified-index": "unverified-index";
591
592
  "missing-ancestor": "missing-ancestor";
592
593
  cycle: "cycle";
593
- truncated: "truncated";
594
594
  "metadata-write-failed": "metadata-write-failed";
595
595
  "invalid-record": "invalid-record";
596
596
  }>;
@@ -604,13 +604,13 @@ export declare type ArtifactProvenanceEnvelopeV1 = z.infer<typeof ArtifactProven
604
604
  declare const ArtifactProvenanceGap: z.ZodObject<{
605
605
  code: z.ZodEnum<{
606
606
  unknown: "unknown";
607
+ truncated: "truncated";
607
608
  "capture-failed": "capture-failed";
608
609
  "legacy-derived": "legacy-derived";
609
610
  "ambiguous-predecessor": "ambiguous-predecessor";
610
611
  "unverified-index": "unverified-index";
611
612
  "missing-ancestor": "missing-ancestor";
612
613
  cycle: "cycle";
613
- truncated: "truncated";
614
614
  "metadata-write-failed": "metadata-write-failed";
615
615
  "invalid-record": "invalid-record";
616
616
  }>;
@@ -2462,8 +2462,16 @@ declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
2462
2462
  * 0.52.0 adds plugin-owned operational facts through existing manifests and registrations.
2463
2463
  *
2464
2464
  * 0.52.1 adds owner-qualified page feed and endpoint references and their kay.ui claims.
2465
+ *
2466
+ * 0.53.0 adds declared working-content layouts, family-root authority, draft projection discovery
2467
+ * and session-bound page references. Older customized Whiteboard copies must accept the plugin
2468
+ * update before using these interfaces.
2469
+ *
2470
+ * 0.54.0 adds named UI host grants for shared configuration/auth/account reads, retained connection
2471
+ * progress/dismissal and support. Built-in-only page capability scopes are removed; executable
2472
+ * pages declare capabilities on apps[].
2465
2473
  */
2466
- declare const KAY_PLUGIN_SDK_VERSION: "0.52.1";
2474
+ declare const KAY_PLUGIN_SDK_VERSION: "0.54.0";
2467
2475
 
2468
2476
  declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
2469
2477
 
@@ -2509,9 +2517,9 @@ declare interface KayAgentEvents {
2509
2517
  /** This plugin's folder in the session family's shared Whiteboard. */
2510
2518
  declare interface KayAgentFamilyFolder {
2511
2519
  /**
2512
- * The folder's absolute path, created on first use. The plugin that owns the Whiteboard gets
2513
- * the whole family folder; every other plugin gets its own `plugins/<plugin-id>/` inside it.
2514
- * Undefined outside a session.
2520
+ * Absolute path, created on first use; undefined outside a session. A declared and granted
2521
+ * family-root owner receives the whole folder; other plugins receive `plugins/<plugin-id>/`.
2522
+ * Root access checks the live `family-folder.root` grant on every call.
2515
2523
  */
2516
2524
  path(): Promise<string | undefined>;
2517
2525
  }
@@ -10498,8 +10506,8 @@ declare const WhiteboardEntryInfo: z.ZodObject<{
10498
10506
  authorSessionId: z.ZodNullable<z.ZodString>;
10499
10507
  }, z.core.$strict>>;
10500
10508
  state: z.ZodEnum<{
10501
- unavailable: "unavailable";
10502
10509
  available: "available";
10510
+ unavailable: "unavailable";
10503
10511
  "unsupported-version": "unsupported-version";
10504
10512
  invalid: "invalid";
10505
10513
  }>;
@@ -10520,8 +10528,8 @@ declare const WhiteboardEntryInspection: z.ZodObject<{
10520
10528
  authorSessionId: z.ZodNullable<z.ZodString>;
10521
10529
  }, z.core.$strict>>;
10522
10530
  state: z.ZodEnum<{
10523
- unavailable: "unavailable";
10524
10531
  available: "available";
10532
+ unavailable: "unavailable";
10525
10533
  "unsupported-version": "unsupported-version";
10526
10534
  invalid: "invalid";
10527
10535
  }>;
@@ -10572,6 +10580,9 @@ declare const WhiteboardTypeInfo: z.ZodObject<{
10572
10580
  displayName: z.ZodString;
10573
10581
  schemaVersion: z.ZodNumber;
10574
10582
  available: z.ZodBoolean;
10583
+ reference: z.ZodOptional<z.ZodObject<{
10584
+ uriTemplate: z.ZodString;
10585
+ }, z.core.$strict>>;
10575
10586
  }, z.core.$strict>;
10576
10587
 
10577
10588
  declare type WhiteboardTypeInfo = Readonly<z.infer<typeof WhiteboardTypeInfo>>;
@@ -737,6 +737,31 @@ function createUnavailableUriCaller(message) {
737
737
  };
738
738
  }
739
739
 
740
+ // packages/plugin-protocol/dist/project-directories.js
741
+ import { z as z5 } from "zod";
742
+ var PluginProjectDirectories = z5.strictObject({
743
+ /** An endpoint this plugin's app target declares; called with a {@link ProjectDirectoryRequest}. */
744
+ endpoint: z5.string().min(1),
745
+ /** A scheme this plugin's URI modules serve; a project is addressed as `<scheme>://<id>`. */
746
+ scheme: z5.string().min(1)
747
+ });
748
+ var ProjectDirectoryRequest = z5.strictObject({
749
+ /** The project's stable id. */
750
+ id: z5.string().min(1)
751
+ });
752
+ var ProjectDirectory = z5.strictObject({
753
+ id: z5.string().min(1),
754
+ /** Absolute path of the project's folder. */
755
+ path: z5.string().min(1),
756
+ /** Absolute path a new session in this project starts in. */
757
+ defaultCwd: z5.string().min(1),
758
+ /** Ancestor project ids, root first. */
759
+ ancestorIds: z5.array(z5.string().min(1))
760
+ });
761
+ var ProjectDirectoryResponse = z5.strictObject({
762
+ project: ProjectDirectory.nullable()
763
+ });
764
+
740
765
  // packages/plugin-sdk/dist/endpoints.js
741
766
  function createUnavailablePluginEndpointCaller(message) {
742
767
  return {
@@ -1,3 +1,5 @@
1
+ import { z } from 'zod';
2
+
1
3
  export declare function createUnavailablePluginEndpointCaller(message: string): PluginEndpointCaller;
2
4
 
3
5
  /** Sessionless JSON calls to another plugin's declared, publicly reachable endpoint. */
@@ -22,4 +24,31 @@ export declare type PluginEndpointOutcome = {
22
24
  readonly message: string;
23
25
  };
24
26
 
27
+ export declare const ProjectDirectory: z.ZodObject<{
28
+ id: z.ZodString;
29
+ path: z.ZodString;
30
+ defaultCwd: z.ZodString;
31
+ ancestorIds: z.ZodArray<z.ZodString>;
32
+ }, z.core.$strict>;
33
+
34
+ export declare type ProjectDirectory = z.infer<typeof ProjectDirectory>;
35
+
36
+ export declare const ProjectDirectoryRequest: z.ZodObject<{
37
+ id: z.ZodString;
38
+ }, z.core.$strict>;
39
+
40
+ export declare type ProjectDirectoryRequest = z.infer<typeof ProjectDirectoryRequest>;
41
+
42
+ /** `project` is null when no project has the requested id. */
43
+ export declare const ProjectDirectoryResponse: z.ZodObject<{
44
+ project: z.ZodNullable<z.ZodObject<{
45
+ id: z.ZodString;
46
+ path: z.ZodString;
47
+ defaultCwd: z.ZodString;
48
+ ancestorIds: z.ZodArray<z.ZodString>;
49
+ }, z.core.$strict>>;
50
+ }, z.core.$strict>;
51
+
52
+ export declare type ProjectDirectoryResponse = z.infer<typeof ProjectDirectoryResponse>;
53
+
25
54
  export { }
package/dist/endpoints.js CHANGED
@@ -1,3 +1,28 @@
1
+ // packages/plugin-protocol/dist/project-directories.js
2
+ import { z } from "zod";
3
+ var PluginProjectDirectories = z.strictObject({
4
+ /** An endpoint this plugin's app target declares; called with a {@link ProjectDirectoryRequest}. */
5
+ endpoint: z.string().min(1),
6
+ /** A scheme this plugin's URI modules serve; a project is addressed as `<scheme>://<id>`. */
7
+ scheme: z.string().min(1)
8
+ });
9
+ var ProjectDirectoryRequest = z.strictObject({
10
+ /** The project's stable id. */
11
+ id: z.string().min(1)
12
+ });
13
+ var ProjectDirectory = z.strictObject({
14
+ id: z.string().min(1),
15
+ /** Absolute path of the project's folder. */
16
+ path: z.string().min(1),
17
+ /** Absolute path a new session in this project starts in. */
18
+ defaultCwd: z.string().min(1),
19
+ /** Ancestor project ids, root first. */
20
+ ancestorIds: z.array(z.string().min(1))
21
+ });
22
+ var ProjectDirectoryResponse = z.strictObject({
23
+ project: ProjectDirectory.nullable()
24
+ });
25
+
1
26
  // packages/plugin-sdk/dist/endpoints.js
2
27
  function createUnavailablePluginEndpointCaller(message) {
3
28
  return {
@@ -5,5 +30,8 @@ function createUnavailablePluginEndpointCaller(message) {
5
30
  };
6
31
  }
7
32
  export {
33
+ ProjectDirectory,
34
+ ProjectDirectoryRequest,
35
+ ProjectDirectoryResponse,
8
36
  createUnavailablePluginEndpointCaller
9
37
  };
package/dist/fs.d.ts CHANGED
@@ -10,6 +10,9 @@ export declare const chmod: typeof nodeFsp.chmod;
10
10
 
11
11
  export declare const chown: typeof nodeFsp.chown;
12
12
 
13
+ /** Receives the committed paths under the folder it subscribed to. */
14
+ export declare type CommittedChangeListener = (paths: readonly string[]) => void;
15
+
13
16
  export { constants }
14
17
 
15
18
  export declare const copyFile: typeof nodeFsp.copyFile;
@@ -59,6 +62,21 @@ declare const _default: {
59
62
  };
60
63
  export default _default;
61
64
 
65
+ /**
66
+ * Report paths whose writes have landed: created, replaced, moved or removed. A path is a source
67
+ * that changed, never a claim that anything is gone. Never throws: a subscriber's failure goes
68
+ * to its own `warn`, and a failing `warn` is ignored, because a report cannot undo the write.
69
+ */
70
+ export declare function emitCommittedChanges(paths: readonly string[]): void;
71
+
72
+ /**
73
+ * Run `work` after every task queued earlier under `key` in this process, and
74
+ * before every task queued later. Nothing touches the filesystem: `key` is an
75
+ * opaque string, and there is no cross-process lock. Use it when this process
76
+ * is the only writer and only same-process ordering matters.
77
+ */
78
+ export declare function enqueueInProcess<T>(key: string, work: () => Promise<T>): Promise<T>;
79
+
62
80
  export { FileHandle }
63
81
 
64
82
  export declare const glob: typeof nodeFsp.glob;
@@ -124,6 +142,14 @@ export declare const stat: typeof nodeFsp.stat;
124
142
 
125
143
  export declare const statfs: typeof nodeFsp.statfs;
126
144
 
145
+ /**
146
+ * Hear about writes any plugin in this process reports with {@link emitCommittedChanges} under
147
+ * `folder`. `listener` receives the absolute, deduplicated paths inside `folder` (the folder
148
+ * itself included), synchronously from the emit. A throw from `listener` goes to `warn`. Returns
149
+ * the function that stops delivery.
150
+ */
151
+ export declare function subscribeCommittedChanges(folder: string, listener: CommittedChangeListener, warn: (error: unknown) => void): () => void;
152
+
127
153
  export declare const symlink: typeof nodeFsp.symlink;
128
154
 
129
155
  export declare const truncate: typeof nodeFsp.truncate;
package/dist/fs.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import { Buffer as Buffer3 } from "node:buffer";
3
3
  import { constants } from "node:fs";
4
4
  import * as nodeFsp from "node:fs/promises";
5
- import { basename, dirname, join, resolve as resolve2 } from "node:path";
5
+ import { basename, dirname, join, resolve as resolve3 } from "node:path";
6
6
 
7
7
  // packages/plugin-sdk/dist/fs/handle.js
8
8
  import { Buffer as Buffer2 } from "node:buffer";
@@ -611,6 +611,50 @@ function currentKayFsBackend() {
611
611
  return globalThis[KAY_FS_BACKEND];
612
612
  }
613
613
 
614
+ // packages/plugin-sdk/dist/fs/mutation-queue.js
615
+ var mutationQueues = /* @__PURE__ */ new Map();
616
+ async function enqueueInProcess(key, work) {
617
+ const previous = mutationQueues.get(key) ?? Promise.resolve();
618
+ const next = previous.catch(() => void 0).then(work);
619
+ mutationQueues.set(key, next);
620
+ try {
621
+ return await next;
622
+ } finally {
623
+ if (mutationQueues.get(key) === next)
624
+ mutationQueues.delete(key);
625
+ }
626
+ }
627
+
628
+ // packages/plugin-sdk/dist/fs/committed-changes.js
629
+ import { isAbsolute, relative, resolve as resolve2 } from "node:path";
630
+ var subscriptions = /* @__PURE__ */ new Set();
631
+ function subscribeCommittedChanges(folder, listener, warn) {
632
+ const subscription = { folder: resolve2(folder), listener, warn };
633
+ subscriptions.add(subscription);
634
+ return () => {
635
+ subscriptions.delete(subscription);
636
+ };
637
+ }
638
+ function emitCommittedChanges(paths) {
639
+ const resolved = [...new Set(paths.map((path) => resolve2(path)))];
640
+ for (const subscription of subscriptions) {
641
+ const owned = resolved.filter((path) => {
642
+ const fromFolder = relative(subscription.folder, path);
643
+ return fromFolder === "" || !fromFolder.startsWith("..") && !isAbsolute(fromFolder);
644
+ });
645
+ if (owned.length === 0)
646
+ continue;
647
+ try {
648
+ subscription.listener(owned);
649
+ } catch (error) {
650
+ try {
651
+ subscription.warn(error);
652
+ } catch {
653
+ }
654
+ }
655
+ }
656
+ }
657
+
614
658
  // packages/plugin-sdk/dist/fs/index.js
615
659
  function route(node, host) {
616
660
  return ((...args) => {
@@ -766,7 +810,7 @@ var glob2 = route(() => nodeFsp.glob, (backend, pattern, options) => {
766
810
  pattern,
767
811
  wire === void 0 ? {} : { ...wire, ...cwd === void 0 ? {} : { cwd: wirePath(cwd) } }
768
812
  ], {
769
- paths: [cwd === void 0 ? resolve2(".") : keyPath(cwd)],
813
+ paths: [cwd === void 0 ? resolve3(".") : keyPath(cwd)],
770
814
  timeoutMs: timeoutOf(options),
771
815
  walksTree: true
772
816
  });
@@ -864,6 +908,8 @@ export {
864
908
  copyFile2 as copyFile,
865
909
  cp2 as cp,
866
910
  index_default as default,
911
+ emitCommittedChanges,
912
+ enqueueInProcess,
867
913
  glob2 as glob,
868
914
  lchmod2 as lchmod,
869
915
  lchown2 as lchown,
@@ -884,6 +930,7 @@ export {
884
930
  rmdir2 as rmdir,
885
931
  stat2 as stat,
886
932
  statfs2 as statfs,
933
+ subscribeCommittedChanges,
887
934
  symlink2 as symlink,
888
935
  truncate2 as truncate,
889
936
  unlink2 as unlink,
@@ -2516,8 +2516,16 @@ declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
2516
2516
  * 0.52.0 adds plugin-owned operational facts through existing manifests and registrations.
2517
2517
  *
2518
2518
  * 0.52.1 adds owner-qualified page feed and endpoint references and their kay.ui claims.
2519
+ *
2520
+ * 0.53.0 adds declared working-content layouts, family-root authority, draft projection discovery
2521
+ * and session-bound page references. Older customized Whiteboard copies must accept the plugin
2522
+ * update before using these interfaces.
2523
+ *
2524
+ * 0.54.0 adds named UI host grants for shared configuration/auth/account reads, retained connection
2525
+ * progress/dismissal and support. Built-in-only page capability scopes are removed; executable
2526
+ * pages declare capabilities on apps[].
2519
2527
  */
2520
- declare const KAY_PLUGIN_SDK_VERSION: "0.52.1";
2528
+ declare const KAY_PLUGIN_SDK_VERSION: "0.54.0";
2521
2529
 
2522
2530
  declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
2523
2531
 
@@ -2560,9 +2568,9 @@ declare interface KayAgentEvents {
2560
2568
  /** This plugin's folder in the session family's shared Whiteboard. */
2561
2569
  declare interface KayAgentFamilyFolder {
2562
2570
  /**
2563
- * The folder's absolute path, created on first use. The plugin that owns the Whiteboard gets
2564
- * the whole family folder; every other plugin gets its own `plugins/<plugin-id>/` inside it.
2565
- * Undefined outside a session.
2571
+ * Absolute path, created on first use; undefined outside a session. A declared and granted
2572
+ * family-root owner receives the whole folder; other plugins receive `plugins/<plugin-id>/`.
2573
+ * Root access checks the live `family-folder.root` grant on every call.
2566
2574
  */
2567
2575
  path(): Promise<string | undefined>;
2568
2576
  }
@@ -4955,6 +4963,10 @@ declare const ResolvedPluginContractV1: z.ZodObject<{
4955
4963
  usage: z.ZodString;
4956
4964
  endpointId: z.ZodString;
4957
4965
  }, z.core.$strict>>>;
4966
+ projectDirectories: z.ZodOptional<z.ZodObject<{
4967
+ scheme: z.ZodString;
4968
+ endpointId: z.ZodString;
4969
+ }, z.core.$strict>>;
4958
4970
  authServices: z.ZodArray<z.ZodObject<{
4959
4971
  localId: z.ZodString;
4960
4972
  globalId: z.ZodString;
@@ -4997,9 +5009,11 @@ declare const ResolvedPluginContractV1: z.ZodObject<{
4997
5009
  globalId: z.ZodString;
4998
5010
  kind: z.ZodLiteral<"oauth2">;
4999
5011
  scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
5012
+ connectScopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
5000
5013
  authorizationUrl: z.ZodURL;
5001
5014
  tokenUrl: z.ZodURL;
5002
5015
  extraAuthorizeParams: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
5016
+ extraAuthorizeParamsWhenAccountHeld: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
5003
5017
  displayName: z.ZodOptional<z.ZodString>;
5004
5018
  agentHint: z.ZodOptional<z.ZodString>;
5005
5019
  summary: z.ZodOptional<z.ZodString>;
@@ -5028,9 +5042,11 @@ declare const ResolvedPluginContractV1: z.ZodObject<{
5028
5042
  globalId: z.ZodString;
5029
5043
  kind: z.ZodLiteral<"oauth2">;
5030
5044
  scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
5045
+ connectScopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
5031
5046
  authorizationUrl: z.ZodURL;
5032
5047
  tokenUrl: z.ZodURL;
5033
5048
  extraAuthorizeParams: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
5049
+ extraAuthorizeParamsWhenAccountHeld: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
5034
5050
  displayName: z.ZodOptional<z.ZodString>;
5035
5051
  agentHint: z.ZodOptional<z.ZodString>;
5036
5052
  summary: z.ZodOptional<z.ZodString>;
@@ -5472,6 +5488,9 @@ declare const ResolvedPluginContractV1: z.ZodObject<{
5472
5488
  }, z.core.$strict>>;
5473
5489
  }, z.core.$strict>;
5474
5490
  }, z.core.$strict>>;
5491
+ kayAgentFamilyFolder: z.ZodOptional<z.ZodObject<{
5492
+ scope: z.ZodLiteral<"root">;
5493
+ }, z.core.$strict>>;
5475
5494
  kayAgentUriModules: z.ZodOptional<z.ZodArray<z.ZodObject<{
5476
5495
  revisionBacked: z.ZodOptional<z.ZodLiteral<true>>;
5477
5496
  mailCalibrationSource: z.ZodOptional<z.ZodLiteral<true>>;
@@ -5661,6 +5680,7 @@ declare const ResolvedPluginContractV1: z.ZodObject<{
5661
5680
  skills: z.ZodExactOptional<z.ZodArray<z.ZodString>>;
5662
5681
  }, z.core.$strict>>;
5663
5682
  localId: z.ZodString;
5683
+ adapterId: z.ZodOptional<z.ZodString>;
5664
5684
  globalId: z.ZodString;
5665
5685
  schemes: z.ZodArray<z.ZodString>;
5666
5686
  displayName: z.ZodOptional<z.ZodString>;
@@ -5935,6 +5955,9 @@ declare const ResolvedPluginContractV1: z.ZodObject<{
5935
5955
  schema: z.ZodRecord<z.ZodString, z.ZodType<authoringCommonSchemas.JsonValue, unknown, z.core.$ZodTypeInternals<authoringCommonSchemas.JsonValue, unknown>>>;
5936
5956
  }, z.core.$strict>;
5937
5957
  }, z.core.$strict>>;
5958
+ messageDraft: z.ZodOptional<z.ZodObject<{
5959
+ schemes: z.ZodArray<z.ZodString>;
5960
+ }, z.core.$strict>>;
5938
5961
  store: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
5939
5962
  shape: z.ZodLiteral<"rows">;
5940
5963
  rowsField: z.ZodString;
@@ -5945,7 +5968,6 @@ declare const ResolvedPluginContractV1: z.ZodObject<{
5945
5968
  }, z.core.$strict>>>;
5946
5969
  kayAppWhiteboardTypes: z.ZodOptional<z.ZodArray<z.ZodObject<{
5947
5970
  localId: z.ZodString;
5948
- globalId: z.ZodString;
5949
5971
  displayName: z.ZodString;
5950
5972
  schemaVersion: z.ZodNumber;
5951
5973
  storage: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -5957,6 +5979,12 @@ declare const ResolvedPluginContractV1: z.ZodObject<{
5957
5979
  bodyField: z.ZodString;
5958
5980
  }, z.core.$strict>], "kind">;
5959
5981
  valueSchema: z.ZodRecord<z.ZodString, z.ZodType<authoringCommonSchemas.JsonValue, unknown, z.core.$ZodTypeInternals<authoringCommonSchemas.JsonValue, unknown>>>;
5982
+ directory: z.ZodOptional<z.ZodArray<z.ZodString>>;
5983
+ reference: z.ZodOptional<z.ZodObject<{
5984
+ uriTemplate: z.ZodString;
5985
+ }, z.core.$strict>>;
5986
+ handover: z.ZodOptional<z.ZodLiteral<true>>;
5987
+ globalId: z.ZodString;
5960
5988
  }, z.core.$strict>>>;
5961
5989
  kayAppMcpServers: z.ZodOptional<z.ZodArray<z.ZodObject<{
5962
5990
  name: z.ZodString;
@@ -6013,6 +6041,8 @@ declare const ResolvedPluginContractV1: z.ZodObject<{
6013
6041
  search: z.ZodOptional<z.ZodString>;
6014
6042
  }, z.core.$strict>;
6015
6043
  objectId: z.ZodOptional<z.ZodString>;
6044
+ resourceKind: z.ZodOptional<z.ZodString>;
6045
+ label: z.ZodOptional<z.ZodString>;
6016
6046
  open: z.ZodOptional<z.ZodObject<{
6017
6047
  kind: z.ZodLiteral<"none">;
6018
6048
  }, z.core.$strict>>;
@@ -6123,6 +6153,13 @@ declare const ResolvedPluginContractV1: z.ZodObject<{
6123
6153
  }, z.core.$strict>]>>>;
6124
6154
  host: z.ZodOptional<z.ZodArray<z.ZodEnum<{
6125
6155
  "navigation.open-session": "navigation.open-session";
6156
+ "navigation.open-external": "navigation.open-external";
6157
+ "configuration.read": "configuration.read";
6158
+ "auth-services.read": "auth-services.read";
6159
+ "connect-flows.read": "connect-flows.read";
6160
+ "connect-flows.dismiss": "connect-flows.dismiss";
6161
+ "support.report": "support.report";
6162
+ "navigation.open-page": "navigation.open-page";
6126
6163
  "sessions.create": "sessions.create";
6127
6164
  "models.complete": "models.complete";
6128
6165
  "artifacts.read": "artifacts.read";
@@ -6130,6 +6167,10 @@ declare const ResolvedPluginContractV1: z.ZodObject<{
6130
6167
  "markdown.document-view": "markdown.document-view";
6131
6168
  "references.open": "references.open";
6132
6169
  "billing.read": "billing.read";
6170
+ "account.read": "account.read";
6171
+ "plugins.read": "plugins.read";
6172
+ "plugins.settings": "plugins.settings";
6173
+ "permissions.manage": "permissions.manage";
6133
6174
  "automations.read": "automations.read";
6134
6175
  "automations.run": "automations.run";
6135
6176
  "shared-artifacts.read": "shared-artifacts.read";
@@ -11847,8 +11888,8 @@ declare const WhiteboardEntryInfo: z.ZodObject<{
11847
11888
  authorSessionId: z.ZodNullable<z.ZodString>;
11848
11889
  }, z.core.$strict>>;
11849
11890
  state: z.ZodEnum<{
11850
- unavailable: "unavailable";
11851
11891
  available: "available";
11892
+ unavailable: "unavailable";
11852
11893
  "unsupported-version": "unsupported-version";
11853
11894
  invalid: "invalid";
11854
11895
  }>;
@@ -11869,8 +11910,8 @@ declare const WhiteboardEntryInspection: z.ZodObject<{
11869
11910
  authorSessionId: z.ZodNullable<z.ZodString>;
11870
11911
  }, z.core.$strict>>;
11871
11912
  state: z.ZodEnum<{
11872
- unavailable: "unavailable";
11873
11913
  available: "available";
11914
+ unavailable: "unavailable";
11874
11915
  "unsupported-version": "unsupported-version";
11875
11916
  invalid: "invalid";
11876
11917
  }>;
@@ -11921,6 +11962,9 @@ declare const WhiteboardTypeInfo: z.ZodObject<{
11921
11962
  displayName: z.ZodString;
11922
11963
  schemaVersion: z.ZodNumber;
11923
11964
  available: z.ZodBoolean;
11965
+ reference: z.ZodOptional<z.ZodObject<{
11966
+ uriTemplate: z.ZodString;
11967
+ }, z.core.$strict>>;
11924
11968
  }, z.core.$strict>;
11925
11969
 
11926
11970
  declare type WhiteboardTypeInfo = Readonly<z.infer<typeof WhiteboardTypeInfo>>;