@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.
@@ -2795,8 +2795,16 @@ declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
2795
2795
  * 0.52.0 adds plugin-owned operational facts through existing manifests and registrations.
2796
2796
  *
2797
2797
  * 0.52.1 adds owner-qualified page feed and endpoint references and their kay.ui claims.
2798
+ *
2799
+ * 0.53.0 adds declared working-content layouts, family-root authority, draft projection discovery
2800
+ * and session-bound page references. Older customized Whiteboard copies must accept the plugin
2801
+ * update before using these interfaces.
2802
+ *
2803
+ * 0.54.0 adds named UI host grants for shared configuration/auth/account reads, retained connection
2804
+ * progress/dismissal and support. Built-in-only page capability scopes are removed; executable
2805
+ * pages declare capabilities on apps[].
2798
2806
  */
2799
- declare const KAY_PLUGIN_SDK_VERSION: "0.52.1";
2807
+ declare const KAY_PLUGIN_SDK_VERSION: "0.54.0";
2800
2808
 
2801
2809
  declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
2802
2810
 
@@ -2865,9 +2873,9 @@ export declare interface KayAgentEvents {
2865
2873
  /** This plugin's folder in the session family's shared Whiteboard. */
2866
2874
  export declare interface KayAgentFamilyFolder {
2867
2875
  /**
2868
- * The folder's absolute path, created on first use. The plugin that owns the Whiteboard gets
2869
- * the whole family folder; every other plugin gets its own `plugins/<plugin-id>/` inside it.
2870
- * Undefined outside a session.
2876
+ * Absolute path, created on first use; undefined outside a session. A declared and granted
2877
+ * family-root owner receives the whole folder; other plugins receive `plugins/<plugin-id>/`.
2878
+ * Root access checks the live `family-folder.root` grant on every call.
2871
2879
  */
2872
2880
  path(): Promise<string | undefined>;
2873
2881
  }
@@ -5130,6 +5138,18 @@ declare const PluginCapabilityRefusalV1: z.ZodObject<{
5130
5138
  target: z.ZodLiteral<"kay.app">;
5131
5139
  slug: z.ZodLiteral<"plugins.set-enabled">;
5132
5140
  envelope: z.ZodObject<{}, z.core.$strict>;
5141
+ }, z.core.$strict>, z.ZodObject<{
5142
+ target: z.ZodLiteral<"kay.app">;
5143
+ slug: z.ZodLiteral<"sessions.assign-project">;
5144
+ envelope: z.ZodObject<{}, z.core.$strict>;
5145
+ }, z.core.$strict>, z.ZodObject<{
5146
+ target: z.ZodLiteral<"kay.app">;
5147
+ slug: z.ZodLiteral<"artifacts.resolve-file">;
5148
+ envelope: z.ZodObject<{}, z.core.$strict>;
5149
+ }, z.core.$strict>, z.ZodObject<{
5150
+ target: z.ZodLiteral<"kay.app">;
5151
+ slug: z.ZodLiteral<"process.run">;
5152
+ envelope: z.ZodObject<{}, z.core.$strict>;
5133
5153
  }, z.core.$strict>, z.ZodObject<{
5134
5154
  target: z.ZodLiteral<"kay.app">;
5135
5155
  slug: z.ZodLiteral<"sessions.annotate">;
@@ -5353,6 +5373,10 @@ declare const PluginCapabilityRefusalV1: z.ZodObject<{
5353
5373
  command: z.ZodString;
5354
5374
  args: z.ZodArray<z.ZodString>;
5355
5375
  }, z.core.$strict>], "channel">;
5376
+ }, z.core.$strict>, z.ZodObject<{
5377
+ target: z.ZodLiteral<"kay.agent">;
5378
+ slug: z.ZodLiteral<"family-folder.root">;
5379
+ envelope: z.ZodObject<{}, z.core.$strict>;
5356
5380
  }, z.core.$strict>, z.ZodObject<{
5357
5381
  target: z.ZodEnum<{
5358
5382
  "kay.agent": "kay.agent";
@@ -5670,6 +5694,33 @@ export declare interface ProducedResourceDeclaration {
5670
5694
  readonly action: ProducedResourceAction;
5671
5695
  }
5672
5696
 
5697
+ export declare const ProjectDirectory: z.ZodObject<{
5698
+ id: z.ZodString;
5699
+ path: z.ZodString;
5700
+ defaultCwd: z.ZodString;
5701
+ ancestorIds: z.ZodArray<z.ZodString>;
5702
+ }, z.core.$strict>;
5703
+
5704
+ export declare type ProjectDirectory = z.infer<typeof ProjectDirectory>;
5705
+
5706
+ export declare const ProjectDirectoryRequest: z.ZodObject<{
5707
+ id: z.ZodString;
5708
+ }, z.core.$strict>;
5709
+
5710
+ export declare type ProjectDirectoryRequest = z.infer<typeof ProjectDirectoryRequest>;
5711
+
5712
+ /** `project` is null when no project has the requested id. */
5713
+ export declare const ProjectDirectoryResponse: z.ZodObject<{
5714
+ project: z.ZodNullable<z.ZodObject<{
5715
+ id: z.ZodString;
5716
+ path: z.ZodString;
5717
+ defaultCwd: z.ZodString;
5718
+ ancestorIds: z.ZodArray<z.ZodString>;
5719
+ }, z.core.$strict>>;
5720
+ }, z.core.$strict>;
5721
+
5722
+ export declare type ProjectDirectoryResponse = z.infer<typeof ProjectDirectoryResponse>;
5723
+
5673
5724
  declare const Properties: (input: string) => [unknown, string] | [];
5674
5725
 
5675
5726
  declare function PropertiesMapping(input: [unknown, unknown, unknown]): unknown;
@@ -12084,8 +12135,8 @@ export declare const WhiteboardEntryInfo: z.ZodObject<{
12084
12135
  authorSessionId: z.ZodNullable<z.ZodString>;
12085
12136
  }, z.core.$strict>>;
12086
12137
  state: z.ZodEnum<{
12087
- unavailable: "unavailable";
12088
12138
  available: "available";
12139
+ unavailable: "unavailable";
12089
12140
  "unsupported-version": "unsupported-version";
12090
12141
  invalid: "invalid";
12091
12142
  }>;
@@ -12106,8 +12157,8 @@ export declare const WhiteboardEntryInspection: z.ZodObject<{
12106
12157
  authorSessionId: z.ZodNullable<z.ZodString>;
12107
12158
  }, z.core.$strict>>;
12108
12159
  state: z.ZodEnum<{
12109
- unavailable: "unavailable";
12110
12160
  available: "available";
12161
+ unavailable: "unavailable";
12111
12162
  "unsupported-version": "unsupported-version";
12112
12163
  invalid: "invalid";
12113
12164
  }>;
@@ -12158,6 +12209,9 @@ export declare const WhiteboardTypeInfo: z.ZodObject<{
12158
12209
  displayName: z.ZodString;
12159
12210
  schemaVersion: z.ZodNumber;
12160
12211
  available: z.ZodBoolean;
12212
+ reference: z.ZodOptional<z.ZodObject<{
12213
+ uriTemplate: z.ZodString;
12214
+ }, z.core.$strict>>;
12161
12215
  }, z.core.$strict>;
12162
12216
 
12163
12217
  export declare type WhiteboardTypeInfo = Readonly<z.infer<typeof WhiteboardTypeInfo>>;
package/dist/kay-agent.js CHANGED
@@ -192,6 +192,8 @@ function isLoneCapture(pattern) {
192
192
  return pattern.length === 1 && pattern[0].capture !== void 0 && pattern[0].rest !== true;
193
193
  }
194
194
  function matchParts(pattern, value, separator, captures, foldLiterals = false) {
195
+ if (pattern.length === 0)
196
+ return value === "";
195
197
  const parts = separator === void 0 ? [value] : value.split(separator);
196
198
  let partIndex = 0;
197
199
  for (let i = 0; i < pattern.length; i += 1) {
@@ -997,6 +999,31 @@ function createUnavailableUriCaller(message) {
997
999
  };
998
1000
  }
999
1001
 
1002
+ // packages/plugin-protocol/dist/project-directories.js
1003
+ import { z as z5 } from "zod";
1004
+ var PluginProjectDirectories = z5.strictObject({
1005
+ /** An endpoint this plugin's app target declares; called with a {@link ProjectDirectoryRequest}. */
1006
+ endpoint: z5.string().min(1),
1007
+ /** A scheme this plugin's URI modules serve; a project is addressed as `<scheme>://<id>`. */
1008
+ scheme: z5.string().min(1)
1009
+ });
1010
+ var ProjectDirectoryRequest = z5.strictObject({
1011
+ /** The project's stable id. */
1012
+ id: z5.string().min(1)
1013
+ });
1014
+ var ProjectDirectory = z5.strictObject({
1015
+ id: z5.string().min(1),
1016
+ /** Absolute path of the project's folder. */
1017
+ path: z5.string().min(1),
1018
+ /** Absolute path a new session in this project starts in. */
1019
+ defaultCwd: z5.string().min(1),
1020
+ /** Ancestor project ids, root first. */
1021
+ ancestorIds: z5.array(z5.string().min(1))
1022
+ });
1023
+ var ProjectDirectoryResponse = z5.strictObject({
1024
+ project: ProjectDirectory.nullable()
1025
+ });
1026
+
1000
1027
  // packages/plugin-sdk/dist/endpoints.js
1001
1028
  function createUnavailablePluginEndpointCaller(message) {
1002
1029
  return {
@@ -1169,7 +1196,7 @@ async function readBodyWithByteCap(response, maxBytes) {
1169
1196
  }
1170
1197
 
1171
1198
  // packages/plugin-primitives/dist/tool-parameters.js
1172
- import { z as z5 } from "zod";
1199
+ import { z as z6 } from "zod";
1173
1200
  var URI_PAYLOAD_MARKER = "x-kay-uri-payload";
1174
1201
  var URI_PAYLOAD_WIRE_TYPES = [
1175
1202
  "string",
@@ -1179,16 +1206,16 @@ var URI_PAYLOAD_WIRE_TYPES = [
1179
1206
  "boolean",
1180
1207
  "null"
1181
1208
  ];
1182
- var uriPayloadSchema = z5.union([
1183
- z5.string(),
1184
- z5.record(z5.string(), z5.unknown()),
1185
- z5.array(z5.unknown()),
1186
- z5.number(),
1187
- z5.boolean(),
1188
- z5.null()
1209
+ var uriPayloadSchema = z6.union([
1210
+ z6.string(),
1211
+ z6.record(z6.string(), z6.unknown()),
1212
+ z6.array(z6.unknown()),
1213
+ z6.number(),
1214
+ z6.boolean(),
1215
+ z6.null()
1189
1216
  ]).meta({ [URI_PAYLOAD_MARKER]: true });
1190
1217
  function toToolParameters(schema) {
1191
- const jsonSchema = z5.toJSONSchema(schema, {
1218
+ const jsonSchema = z6.toJSONSchema(schema, {
1192
1219
  io: "input",
1193
1220
  override(ctx) {
1194
1221
  const node = ctx.jsonSchema;
@@ -1329,7 +1356,7 @@ function jsonValue(value) {
1329
1356
  }
1330
1357
 
1331
1358
  // packages/plugin-sdk/dist/kay-agent/index.js
1332
- import { z as z7 } from "zod";
1359
+ import { z as z8 } from "zod";
1333
1360
 
1334
1361
  // packages/plugin-sdk/dist/kay-agent/http-client.js
1335
1362
  var PluginApiError = class extends Error {
@@ -1505,7 +1532,7 @@ function createUnavailableEndpoints(message) {
1505
1532
  }
1506
1533
 
1507
1534
  // packages/plugin-sdk/dist/kay-agent/osascript.js
1508
- import { z as z6 } from "zod";
1535
+ import { z as z7 } from "zod";
1509
1536
  var OSASCRIPT_TIMEOUT_MS = 3e4;
1510
1537
  var OSASCRIPT_ENVELOPE_JXA = `
1511
1538
  function jsonOk(data) {
@@ -1515,11 +1542,11 @@ function jsonFail(code, message) {
1515
1542
  return JSON.stringify({ ok: false, error: { code: String(code), message: String(message) } });
1516
1543
  }
1517
1544
  `;
1518
- var envelopeSchema = z6.discriminatedUnion("ok", [
1519
- z6.object({ ok: z6.literal(true), data: z6.unknown() }),
1520
- z6.object({
1521
- ok: z6.literal(false),
1522
- error: z6.object({ code: z6.string(), message: z6.string() })
1545
+ var envelopeSchema = z7.discriminatedUnion("ok", [
1546
+ z7.object({ ok: z7.literal(true), data: z7.unknown() }),
1547
+ z7.object({
1548
+ ok: z7.literal(false),
1549
+ error: z7.object({ code: z7.string(), message: z7.string() })
1523
1550
  })
1524
1551
  ]);
1525
1552
  function readOsascriptOutput(stdout) {
@@ -1715,6 +1742,9 @@ export {
1715
1742
  OSASCRIPT_ENVELOPE_JXA,
1716
1743
  OSASCRIPT_TIMEOUT_MS,
1717
1744
  PluginApiError,
1745
+ ProjectDirectory,
1746
+ ProjectDirectoryRequest,
1747
+ ProjectDirectoryResponse,
1718
1748
  SearchProviderError,
1719
1749
  SecureTransportError,
1720
1750
  URI_TEXT_EDIT_SHAPE_SUMMARY,
@@ -1785,5 +1815,5 @@ export {
1785
1815
  uriTextEditPayloadSchema,
1786
1816
  withResolvedAuth,
1787
1817
  withResolvedSearchProvider,
1788
- z7 as z
1818
+ z8 as z
1789
1819
  };
@@ -1824,6 +1824,18 @@ declare type KayAppSessionPageItem = (Omit<Extract<TranscriptPageItem, {
1824
1824
  readonly unreadable: unknown;
1825
1825
  }>;
1826
1826
 
1827
+ /** One write for {@link KayAppSessions.assignProject}. */
1828
+ declare interface KayAppSessionProjectAssignment {
1829
+ readonly sessionId: string;
1830
+ /**
1831
+ * The project the session must still hold for the write to land: a project id, `null` for "no
1832
+ * project" chosen on purpose, or absent for a session whose project was never decided.
1833
+ */
1834
+ readonly expectedProjectId?: string | null;
1835
+ /** The project to set; `null` sets "no project". */
1836
+ readonly projectId: string | null;
1837
+ }
1838
+
1827
1839
  /**
1828
1840
  * What one headless system run reports back. The run's spend is read from the
1829
1841
  * ledger after the turn settles; `cost` is absent when no spend rows were
@@ -2158,6 +2170,15 @@ declare interface KayAppSessions {
2158
2170
  } | {
2159
2171
  readonly kind: "unavailable";
2160
2172
  }>;
2173
+ /**
2174
+ * Private API: only plugins Bonsai ships; refused for any other. Set the project of any stored
2175
+ * sessions, each only while it still holds the project the caller last saw (a compare-and-set,
2176
+ * so a person's own choice made meanwhile always wins). Answers one boolean per assignment, in
2177
+ * order: `false` when the session is gone or its project changed. A written session's project
2178
+ * folder and prompt block are refreshed. Checked against `sessions.assign-project`; a refused
2179
+ * call rejects.
2180
+ */
2181
+ assignProject?(assignments: readonly KayAppSessionProjectAssignment[]): Promise<readonly boolean[]>;
2161
2182
  /**
2162
2183
  * Run one hidden headless system session through Bonsai's harness and resolve
2163
2184
  * with its final output - the sole sanctioned way for a `kay.app` plugin to
package/dist/kay-app.d.ts CHANGED
@@ -1338,6 +1338,21 @@ declare class EncodeBuilder<Type extends TSchema, Encoded extends unknown, Decod
1338
1338
  Encode(callback: TEncodeCallback<Encoded, Decoded>): TCodec<Type, Decoded>;
1339
1339
  }
1340
1340
 
1341
+ export declare const EndpointContribution: z.ZodObject<{
1342
+ localId: z.ZodString;
1343
+ displayName: z.ZodOptional<z.ZodString>;
1344
+ requestSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<authoringCommonSchemas.JsonValue, unknown, z.core.$ZodTypeInternals<authoringCommonSchemas.JsonValue, unknown>>>>;
1345
+ responseSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<authoringCommonSchemas.JsonValue, unknown, z.core.$ZodTypeInternals<authoringCommonSchemas.JsonValue, unknown>>>>;
1346
+ auth: z.ZodOptional<z.ZodObject<{
1347
+ service: z.ZodString;
1348
+ schemes: z.ZodArray<z.ZodString>;
1349
+ purpose: z.ZodString;
1350
+ }, z.core.$strict>>;
1351
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
1352
+ }, z.core.$strict>;
1353
+
1354
+ export declare type EndpointContribution = z.infer<typeof EndpointContribution>;
1355
+
1341
1356
  declare interface EntryBase {
1342
1357
  id: string;
1343
1358
  parentId: string | null;
@@ -2911,11 +2926,49 @@ declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
2911
2926
  * 0.52.0 adds plugin-owned operational facts through existing manifests and registrations.
2912
2927
  *
2913
2928
  * 0.52.1 adds owner-qualified page feed and endpoint references and their kay.ui claims.
2929
+ *
2930
+ * 0.53.0 adds declared working-content layouts, family-root authority, draft projection discovery
2931
+ * and session-bound page references. Older customized Whiteboard copies must accept the plugin
2932
+ * update before using these interfaces.
2933
+ *
2934
+ * 0.54.0 adds named UI host grants for shared configuration/auth/account reads, retained connection
2935
+ * progress/dismissal and support. Built-in-only page capability scopes are removed; executable
2936
+ * pages declare capabilities on apps[].
2914
2937
  */
2915
- declare const KAY_PLUGIN_SDK_VERSION: "0.52.1";
2938
+ declare const KAY_PLUGIN_SDK_VERSION: "0.54.0";
2916
2939
 
2917
2940
  declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
2918
2941
 
2942
+ /**
2943
+ * One process the plugin asks the host to run.
2944
+ *
2945
+ * `argvClass` is required and is NOT decoration: it names the class of argument vector this
2946
+ * invocation belongs to, and it must match a class the plugin declared alongside `command` in its
2947
+ * manifest. Declaring a command alone would authorize `git log` and `git push --force` identically;
2948
+ * the class is what a user can be shown and asked to consent to. The host judges the real `args`
2949
+ * against the named class and refuses with `argv-outside-class` when they do not belong to it.
2950
+ */
2951
+ declare interface KayAgentProcessRunRequest {
2952
+ readonly command: string;
2953
+ readonly argvClass: string;
2954
+ readonly args: readonly string[];
2955
+ /** Abort the run; the host kills the DIRECT child and rejects - a forked descendant may outlive it (#6153). */
2956
+ readonly signal?: AbortSignal;
2957
+ }
2958
+
2959
+ /**
2960
+ * A finished run. `stdout`/`stderr` are decoded text, and the host CAPS them - a truncation flag is
2961
+ * set rather than the output silently ending, so a plugin parsing the stream can tell "the command
2962
+ * printed this" apart from "the command printed more than we kept".
2963
+ */
2964
+ declare interface KayAgentProcessRunResult {
2965
+ readonly exitCode: number;
2966
+ readonly stdout: string;
2967
+ readonly stderr: string;
2968
+ readonly stdoutTruncated?: boolean;
2969
+ readonly stderrTruncated?: boolean;
2970
+ }
2971
+
2919
2972
  declare interface KayAgentWhiteboardCreateInput {
2920
2973
  readonly name: string;
2921
2974
  readonly title: string;
@@ -3475,6 +3528,16 @@ export declare type KayAppArtifactOutputFile = {
3475
3528
  };
3476
3529
 
3477
3530
  export declare interface KayAppArtifactOutputs extends Omit<KayAppKnowledgeSource, "watchRoots"> {
3531
+ /**
3532
+ * One page of canonical output URIs across every chat or, with `sessionId`,
3533
+ * only that chat's outputs. A cursor continues the enumeration it came from.
3534
+ */
3535
+ enumerate(options: {
3536
+ readonly cursor?: JsonValue;
3537
+ readonly limit: number;
3538
+ readonly signal: AbortSignal;
3539
+ readonly sessionId?: string;
3540
+ }): ReturnType<KayAppKnowledgeSource["enumerate"]>;
3478
3541
  subscribe(listener: (change: ArtifactOutputChange) => void): () => void;
3479
3542
  /**
3480
3543
  * The exact bytes of one canonical `output://<session>/<name>` file, at most `maxBytes`
@@ -3490,6 +3553,13 @@ export declare interface KayAppArtifactOutputs extends Omit<KayAppKnowledgeSourc
3490
3553
  export declare interface KayAppArtifacts {
3491
3554
  /** Activation-only request for the public artifacts.read {kind: output} capability. */
3492
3555
  outputs(): KayAppArtifactOutputs;
3556
+ /**
3557
+ * Private API: only plugins Bonsai ships; refused for any other. The absolute path of the file
3558
+ * an address names as `sessionId`'s agent would see it (`output://`, `file://` and the other
3559
+ * file-backed schemes), or `undefined` when it names no readable file. Checked against
3560
+ * `artifacts.resolve-file`; a refused call rejects.
3561
+ */
3562
+ resolveFile?(sessionId: string, uri: string): Promise<string | undefined>;
3493
3563
  }
3494
3564
 
3495
3565
  /** A persisted assistant message, published without waiting for its subscribers. */
@@ -5194,6 +5264,13 @@ export declare interface KayAppPaths {
5194
5264
  * empty directory rather than an error.
5195
5265
  */
5196
5266
  readonly sessionsRoot?: string;
5267
+ /**
5268
+ * Absolute path to the folder holding the scratch working folders of chats started without a
5269
+ * folder of their own (`<chatsRoot>/<id>`). Files written there belong to that one chat. Ask for
5270
+ * this rather than deriving it: Desktop keeps it under the app's user-data root, not beside
5271
+ * {@link sessionsRoot}. Absent when the host composed none.
5272
+ */
5273
+ readonly chatsRoot?: string;
5197
5274
  /**
5198
5275
  * Absolute path to Bonsai's local telemetry directory. The live telemetry lane itself is a
5199
5276
  * Postgres table (`telemetry.usage_events`), not anything under this path; it is never a
@@ -5333,6 +5410,11 @@ export declare interface KayAppPluginApi {
5333
5410
  * which blocks the daemon; see {@link KayAppRepos}.
5334
5411
  */
5335
5412
  readonly repos: KayAppRepos;
5413
+ /**
5414
+ * Private API: only plugins Bonsai ships; refused for any other. Runs a program the host bound
5415
+ * for this plugin; see {@link KayAppProcess}. Absent when the host composed no program bindings.
5416
+ */
5417
+ readonly process?: KayAppProcess;
5336
5418
  /**
5337
5419
  * File I/O in user folders (stat, read, list, walk, realpath, write, mkdir, rename), run by the
5338
5420
  * host on its own worker threads under a deadline and answered as a typed result. Always present
@@ -5597,8 +5679,25 @@ export declare interface KayAppPollResult<Cursor extends JsonValue> {
5597
5679
  readonly summary?: string;
5598
5680
  }
5599
5681
 
5682
+ /**
5683
+ * Private API: only plugins Bonsai ships; refused for any other. Run a program the host bound
5684
+ * for this plugin, the way {@link import("../kay-agent/index.ts").KayAgentProcess} does for an
5685
+ * agent tool: the plugin names a command and an argument class, the host owns the executable,
5686
+ * which arguments belong to the class, the time limit, the output cap, the working directory and
5687
+ * the environment. Each run is checked against `process.run` and then the exact
5688
+ * `process.spawn {command, argvClass}` claim; a refusal rejects with `KayAgentCapabilityError`,
5689
+ * a timeout resolves with exit code 124.
5690
+ */
5691
+ export declare interface KayAppProcess {
5692
+ run(request: KayAppProcessRunRequest): Promise<KayAppProcessRunResult>;
5693
+ }
5694
+
5600
5695
  export declare type KayAppProcessingSpeed = "standard" | "fast";
5601
5696
 
5697
+ export declare type KayAppProcessRunRequest = KayAgentProcessRunRequest;
5698
+
5699
+ export declare type KayAppProcessRunResult = KayAgentProcessRunResult;
5700
+
5602
5701
  /**
5603
5702
  * A gap reason on the run-detail wire: something about the run's work the
5604
5703
  * daemon could not establish from its session transcripts. The vocabulary is
@@ -6261,6 +6360,18 @@ export declare type KayAppSessionPageItem = (Omit<Extract<TranscriptPageItem, {
6261
6360
  readonly unreadable: unknown;
6262
6361
  }>;
6263
6362
 
6363
+ /** One write for {@link KayAppSessions.assignProject}. */
6364
+ export declare interface KayAppSessionProjectAssignment {
6365
+ readonly sessionId: string;
6366
+ /**
6367
+ * The project the session must still hold for the write to land: a project id, `null` for "no
6368
+ * project" chosen on purpose, or absent for a session whose project was never decided.
6369
+ */
6370
+ readonly expectedProjectId?: string | null;
6371
+ /** The project to set; `null` sets "no project". */
6372
+ readonly projectId: string | null;
6373
+ }
6374
+
6264
6375
  export declare type KayAppSessionProvenanceRecord = SessionProvenanceRecord;
6265
6376
 
6266
6377
  export declare type KayAppSessionRelationship = SessionRelationship;
@@ -6601,6 +6712,15 @@ export declare interface KayAppSessions {
6601
6712
  } | {
6602
6713
  readonly kind: "unavailable";
6603
6714
  }>;
6715
+ /**
6716
+ * Private API: only plugins Bonsai ships; refused for any other. Set the project of any stored
6717
+ * sessions, each only while it still holds the project the caller last saw (a compare-and-set,
6718
+ * so a person's own choice made meanwhile always wins). Answers one boolean per assignment, in
6719
+ * order: `false` when the session is gone or its project changed. A written session's project
6720
+ * folder and prompt block are refreshed. Checked against `sessions.assign-project`; a refused
6721
+ * call rejects.
6722
+ */
6723
+ assignProject?(assignments: readonly KayAppSessionProjectAssignment[]): Promise<readonly boolean[]>;
6604
6724
  /**
6605
6725
  * Run one hidden headless system session through Bonsai's harness and resolve
6606
6726
  * with its final output - the sole sanctioned way for a `kay.app` plugin to
@@ -7688,6 +7808,12 @@ export declare interface KayAppSystemPromptFragment {
7688
7808
  * KayAppSystemPromptRegistration.refresh}.
7689
7809
  */
7690
7810
  readonly maxAgeMs?: number;
7811
+ /**
7812
+ * For text about the chat's project. A forked chat starts with its parent's texts unchanged, so
7813
+ * the model's prompt cache still matches; when set, a fork whose project is then chosen drops the
7814
+ * parent's copy of this text and renders its own. Absent: a fork keeps the parent's text.
7815
+ */
7816
+ readonly forksFollowProject?: boolean;
7691
7817
  /** The text, or `undefined` for none. A rejection leaves the text out and is logged. */
7692
7818
  render(request: KayAppSystemPromptRenderRequest): Promise<string | undefined>;
7693
7819
  }
@@ -9008,6 +9134,90 @@ declare type MatchTrueLike = (inferred: TProperties) => unknown;
9008
9134
  /** The most labels a recorded choice question may offer, and so the most one filter names. */
9009
9135
  export declare const MAX_CHOICE_LABELS = 64;
9010
9136
 
9137
+ /** The connection state published for one configured MCP server. */
9138
+ export declare type McpServerConnectionState = "disconnected" | "connecting" | "connected" | "needs-auth" | "failed";
9139
+
9140
+ /** A server mark already resolved into a data URI by its publisher. */
9141
+ export declare interface McpServerIcon {
9142
+ /** A `data:` URI. Consumers may render it directly in an `<img src>`. */
9143
+ readonly src: string;
9144
+ /**
9145
+ * Where the mark came from, because the two are not equally trustworthy.
9146
+ *
9147
+ * `declared` is the server's own `serverInfo.icons` (MCP spec 2025-11-25, SEP-973): evidence.
9148
+ * `favicon` is derived from an HTTP server's origin: still evidence, one step removed.
9149
+ * A name match against Bonsai's brand table is neither, and deliberately does not appear here -
9150
+ * that guess lives in the renderer's existing `BrandIcon` fallback, below both of these.
9151
+ */
9152
+ readonly source: "declared" | "favicon";
9153
+ /** The theme the server nominated this variant for, when it declared more than one. */
9154
+ readonly theme?: "light" | "dark";
9155
+ }
9156
+
9157
+ /** One keyed change to the MCP inventory. */
9158
+ export declare type McpServerInventoryChange = {
9159
+ readonly kind: "upsert";
9160
+ readonly server: McpServerRecord;
9161
+ } | {
9162
+ readonly kind: "remove";
9163
+ readonly name: string;
9164
+ };
9165
+
9166
+ /** One configured MCP server in the app-facing inventory. */
9167
+ export declare interface McpServerRecord {
9168
+ /** The config key, and the id the `mcp.<name>` auth service keys on. */
9169
+ readonly name: string;
9170
+ /**
9171
+ * The auth service that connects this server, when it has one: `mcp.<name>` for a plugins.mcp
9172
+ * server, the shipping plugin's own service for a vendored one. The Plugins page joins a
9173
+ * connection row to its server on THIS id - never by deriving a name from the service id,
9174
+ * which only ever fit the user-config namespace and left every vendored server toolless.
9175
+ */
9176
+ readonly authServiceId?: string;
9177
+ /** The server's own `serverInfo.title`, when it sent one. Display prefers it over `name`. */
9178
+ readonly title?: string;
9179
+ readonly transport: "stdio" | "http";
9180
+ /** What the server launches or connects to: joined command for stdio, url for http. */
9181
+ readonly target: string;
9182
+ /** The config-level switch (`enabled: false` in `plugins.mcp`), not the connection. */
9183
+ readonly enabled: boolean;
9184
+ readonly state: McpServerConnectionState;
9185
+ /** Live when connected, else from the persisted metadata cache. Zero is ordinary. */
9186
+ readonly toolCount: number;
9187
+ /**
9188
+ * What this server offers, for a surface that lists it. Live when connected, else from the
9189
+ * persisted metadata cache, so a server names its tools before it has connected this session
9190
+ * and after a restart.
9191
+ *
9192
+ * NAMES AND DESCRIPTIONS ONLY. The JSON-Schema input declarations stay out: they are by far the
9193
+ * biggest part of a tool list, nothing on this surface renders them, and this snapshot is
9194
+ * re-encoded whenever any server changes state. A surface that genuinely needs a schema is
9195
+ * asking a different question and should ask the agent bridge, which owns tool detail.
9196
+ *
9197
+ * Bounded by the publisher's tool-list limit - {@link toolCount} remains the true count, so a
9198
+ * server past the bound still reports honestly even though the list is clipped.
9199
+ */
9200
+ readonly tools?: readonly McpServerToolSummary[];
9201
+ readonly icon?: McpServerIcon;
9202
+ /**
9203
+ * Why a `failed` server failed, in one human-legible line, when the host knows. A broken row can
9204
+ * then say what went wrong instead of only offering Retry.
9205
+ */
9206
+ readonly failure?: string;
9207
+ }
9208
+
9209
+ /** A complete MCP inventory snapshot. */
9210
+ export declare interface McpServersSnapshot {
9211
+ readonly servers: readonly McpServerRecord[];
9212
+ }
9213
+
9214
+ /** A tool name and optional description for inventory presentation. */
9215
+ export declare interface McpServerToolSummary {
9216
+ readonly name: string;
9217
+ /** The server's own one-line description, trimmed to the publisher's summary limit. */
9218
+ readonly description?: string;
9219
+ }
9220
+
9011
9221
  export declare namespace Memory {
9012
9222
  export {
9013
9223
  Assign,
@@ -10252,6 +10462,33 @@ export declare interface PreparedAccessApproval {
10252
10462
  readonly binding?: unknown;
10253
10463
  }
10254
10464
 
10465
+ export declare const ProjectDirectory: z.ZodObject<{
10466
+ id: z.ZodString;
10467
+ path: z.ZodString;
10468
+ defaultCwd: z.ZodString;
10469
+ ancestorIds: z.ZodArray<z.ZodString>;
10470
+ }, z.core.$strict>;
10471
+
10472
+ export declare type ProjectDirectory = z.infer<typeof ProjectDirectory>;
10473
+
10474
+ export declare const ProjectDirectoryRequest: z.ZodObject<{
10475
+ id: z.ZodString;
10476
+ }, z.core.$strict>;
10477
+
10478
+ export declare type ProjectDirectoryRequest = z.infer<typeof ProjectDirectoryRequest>;
10479
+
10480
+ /** `project` is null when no project has the requested id. */
10481
+ export declare const ProjectDirectoryResponse: z.ZodObject<{
10482
+ project: z.ZodNullable<z.ZodObject<{
10483
+ id: z.ZodString;
10484
+ path: z.ZodString;
10485
+ defaultCwd: z.ZodString;
10486
+ ancestorIds: z.ZodArray<z.ZodString>;
10487
+ }, z.core.$strict>>;
10488
+ }, z.core.$strict>;
10489
+
10490
+ export declare type ProjectDirectoryResponse = z.infer<typeof ProjectDirectoryResponse>;
10491
+
10255
10492
  declare const Properties: (input: string) => [unknown, string] | [];
10256
10493
 
10257
10494
  declare function PropertiesMapping(input: [unknown, unknown, unknown]): unknown;
@@ -17301,8 +17538,8 @@ declare const WhiteboardEntryInfo: z.ZodObject<{
17301
17538
  authorSessionId: z.ZodNullable<z.ZodString>;
17302
17539
  }, z.core.$strict>>;
17303
17540
  state: z.ZodEnum<{
17304
- unavailable: "unavailable";
17305
17541
  available: "available";
17542
+ unavailable: "unavailable";
17306
17543
  "unsupported-version": "unsupported-version";
17307
17544
  invalid: "invalid";
17308
17545
  }>;
@@ -17323,8 +17560,8 @@ declare const WhiteboardEntryInspection: z.ZodObject<{
17323
17560
  authorSessionId: z.ZodNullable<z.ZodString>;
17324
17561
  }, z.core.$strict>>;
17325
17562
  state: z.ZodEnum<{
17326
- unavailable: "unavailable";
17327
17563
  available: "available";
17564
+ unavailable: "unavailable";
17328
17565
  "unsupported-version": "unsupported-version";
17329
17566
  invalid: "invalid";
17330
17567
  }>;
@@ -17375,6 +17612,9 @@ export declare const WhiteboardTypeInfo: z.ZodObject<{
17375
17612
  displayName: z.ZodString;
17376
17613
  schemaVersion: z.ZodNumber;
17377
17614
  available: z.ZodBoolean;
17615
+ reference: z.ZodOptional<z.ZodObject<{
17616
+ uriTemplate: z.ZodString;
17617
+ }, z.core.$strict>>;
17378
17618
  }, z.core.$strict>;
17379
17619
 
17380
17620
  export declare type WhiteboardTypeInfo = Readonly<z.infer<typeof WhiteboardTypeInfo>>;