@yaklabs-ai/plugin-protocol 0.55.10 → 0.55.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -11,7 +11,7 @@ flow.
11
11
  ```json
12
12
  {
13
13
  "dependencies": {
14
- "@bonsai/plugin-protocol": "npm:@yaklabs-ai/plugin-protocol@^0.55.10"
14
+ "@bonsai/plugin-protocol": "npm:@yaklabs-ai/plugin-protocol@^0.55.12"
15
15
  }
16
16
  }
17
17
  ```
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "package": "@yaklabs-ai/plugin-protocol",
4
- "version": "0.55.10",
4
+ "version": "0.55.12",
5
5
  "target": "npm",
6
6
  "firstPartyLicense": "MIT",
7
7
  "bundled": [
package/dist/index.d.ts CHANGED
@@ -552,6 +552,9 @@ export declare const AppUriModuleContribution: z.ZodObject<{
552
552
 
553
553
  export declare type AppUriModuleContribution = z.infer<typeof AppUriModuleContribution>;
554
554
 
555
+ /** The most chats one `outputs.folderMarks` request may name (SDK 0.55.11). */
556
+ export declare const ARTIFACT_OUTPUT_FOLDER_MARKS_MAX = 500;
557
+
555
558
  export declare const ARTIFACT_OUTPUT_PAGE_MAX = 200;
556
559
 
557
560
  export declare const ARTIFACT_PROVENANCE_VERSION: "kay.artifact-provenance.v1";
@@ -560,16 +563,116 @@ export declare const ArtifactGenerationId: z.core.$ZodBranded<z.ZodString, "Arti
560
563
 
561
564
  export declare type ArtifactGenerationId = z.infer<typeof ArtifactGenerationId>;
562
565
 
566
+ /**
567
+ * A notice that output files changed. `{ uris }` names the files; since SDK 0.55.11 it may also
568
+ * carry `changes`, one per URI in `uris` and in the same order, saying what happened to each.
569
+ * `{ sessionId }` is the legacy chat-only notice from older adapters.
570
+ */
563
571
  export declare const ArtifactOutputChange: z.ZodUnion<readonly [z.ZodObject<{
564
572
  uris: z.ZodArray<z.ZodString>;
573
+ changes: z.ZodOptional<z.ZodArray<z.ZodObject<{
574
+ uri: z.ZodString;
575
+ kind: z.ZodEnum<{
576
+ created: "created";
577
+ changed: "changed";
578
+ deleted: "deleted";
579
+ }>;
580
+ file: z.ZodOptional<z.ZodObject<{
581
+ sizeBytes: z.ZodNumber;
582
+ modifiedAtMs: z.ZodNumber;
583
+ title: z.ZodString;
584
+ mimeType: z.ZodOptional<z.ZodString>;
585
+ versionState: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
586
+ state: z.ZodLiteral<"draft">;
587
+ }, z.core.$strict>, z.ZodObject<{
588
+ state: z.ZodEnum<{
589
+ clean: "clean";
590
+ edited: "edited";
591
+ }>;
592
+ committedVersion: z.ZodNumber;
593
+ }, z.core.$strict>], "state">>;
594
+ }, z.core.$strict>>;
595
+ metadataOnly: z.ZodOptional<z.ZodLiteral<true>>;
596
+ }, z.core.$strict>>>;
565
597
  }, z.core.$strict>, z.ZodObject<{
566
598
  sessionId: z.ZodString;
567
599
  }, z.core.$strict>]>;
568
600
 
569
601
  export declare type ArtifactOutputChange = z.infer<typeof ArtifactOutputChange>;
570
602
 
603
+ /**
604
+ * One file's change (SDK 0.55.11). `created` and `deleted` are exact. `changed` means the file
605
+ * exists and its facts are as given; the host says `created` only when it knows the file is new,
606
+ * so a consumer that has no record of a `changed` file treats it as added. `metadataOnly` marks a
607
+ * change of version state alone: the bytes did not change. A `deleted` change carries no facts;
608
+ * every other change does. There is no rename: a rename is a delete plus a create.
609
+ */
610
+ export declare const ArtifactOutputFileChange: z.ZodObject<{
611
+ uri: z.ZodString;
612
+ kind: z.ZodEnum<{
613
+ created: "created";
614
+ changed: "changed";
615
+ deleted: "deleted";
616
+ }>;
617
+ file: z.ZodOptional<z.ZodObject<{
618
+ sizeBytes: z.ZodNumber;
619
+ modifiedAtMs: z.ZodNumber;
620
+ title: z.ZodString;
621
+ mimeType: z.ZodOptional<z.ZodString>;
622
+ versionState: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
623
+ state: z.ZodLiteral<"draft">;
624
+ }, z.core.$strict>, z.ZodObject<{
625
+ state: z.ZodEnum<{
626
+ clean: "clean";
627
+ edited: "edited";
628
+ }>;
629
+ committedVersion: z.ZodNumber;
630
+ }, z.core.$strict>], "state">>;
631
+ }, z.core.$strict>>;
632
+ metadataOnly: z.ZodOptional<z.ZodLiteral<true>>;
633
+ }, z.core.$strict>;
634
+
635
+ export declare type ArtifactOutputFileChange = z.infer<typeof ArtifactOutputFileChange>;
636
+
637
+ /**
638
+ * What the host knows about one output file without reading its body (SDK 0.55.11): its size and
639
+ * modified time from one stat, its title (a Markdown file's first `# ` heading within its first
640
+ * 4 KB, else its name), its type from the name, and its committed-version state when the chat
641
+ * has a version history.
642
+ */
643
+ export declare const ArtifactOutputFileFacts: z.ZodObject<{
644
+ sizeBytes: z.ZodNumber;
645
+ modifiedAtMs: z.ZodNumber;
646
+ title: z.ZodString;
647
+ mimeType: z.ZodOptional<z.ZodString>;
648
+ versionState: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
649
+ state: z.ZodLiteral<"draft">;
650
+ }, z.core.$strict>, z.ZodObject<{
651
+ state: z.ZodEnum<{
652
+ clean: "clean";
653
+ edited: "edited";
654
+ }>;
655
+ committedVersion: z.ZodNumber;
656
+ }, z.core.$strict>], "state">>;
657
+ }, z.core.$strict>;
658
+
659
+ export declare type ArtifactOutputFileFacts = z.infer<typeof ArtifactOutputFileFacts>;
660
+
571
661
  export declare const ArtifactOutputUri: z.ZodString;
572
662
 
663
+ /** A file's committed-version label, as the host's listing reports it. */
664
+ export declare const ArtifactOutputVersionState: z.ZodDiscriminatedUnion<[z.ZodObject<{
665
+ state: z.ZodLiteral<"draft">;
666
+ }, z.core.$strict>, z.ZodObject<{
667
+ state: z.ZodEnum<{
668
+ clean: "clean";
669
+ edited: "edited";
670
+ }>;
671
+ committedVersion: z.ZodNumber;
672
+ }, z.core.$strict>], "state">;
673
+
674
+ export declare type ArtifactOutputVersionState = z.infer<typeof ArtifactOutputVersionState>;
675
+
573
676
  export declare const ArtifactProvenanceActor: z.ZodDiscriminatedUnion<[z.ZodObject<{
574
677
  kind: z.ZodLiteral<"session">;
575
678
  sessionId: z.ZodString;
@@ -3021,6 +3124,7 @@ declare const canonicalContributionSchemas: {
3021
3124
  localId: z.ZodString;
3022
3125
  slot: z.ZodString;
3023
3126
  title: z.ZodOptional<z.ZodString>;
3127
+ app: z.ZodOptional<z.ZodString>;
3024
3128
  }, z.core.$strict>;
3025
3129
  ReferenceOpenBehavior: z.ZodDiscriminatedUnion<[z.ZodObject<{
3026
3130
  kind: z.ZodLiteral<"working-document">;
@@ -3282,6 +3386,7 @@ declare const canonicalContributionSchemas: {
3282
3386
  "artifacts.preview": "artifacts.preview";
3283
3387
  "markdown.document-view": "markdown.document-view";
3284
3388
  "references.open": "references.open";
3389
+ "files.choose-folder": "files.choose-folder";
3285
3390
  "billing.read": "billing.read";
3286
3391
  "account.read": "account.read";
3287
3392
  "plugins.read": "plugins.read";
@@ -3320,6 +3425,7 @@ declare const canonicalContributionSchemas: {
3320
3425
  "artifacts.preview": "artifacts.preview";
3321
3426
  "markdown.document-view": "markdown.document-view";
3322
3427
  "references.open": "references.open";
3428
+ "files.choose-folder": "files.choose-folder";
3323
3429
  "billing.read": "billing.read";
3324
3430
  "account.read": "account.read";
3325
3431
  "plugins.read": "plugins.read";
@@ -3356,6 +3462,13 @@ declare const canonicalContributionSchemas: {
3356
3462
  localId: z.ZodString;
3357
3463
  }, z.core.$strict>]>;
3358
3464
  where: z.ZodOptional<z.ZodString>;
3465
+ also: z.ZodOptional<z.ZodObject<{
3466
+ source: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
3467
+ pluginId: z.ZodString;
3468
+ localId: z.ZodString;
3469
+ }, z.core.$strict>]>;
3470
+ where: z.ZodOptional<z.ZodString>;
3471
+ }, z.core.$strict>>;
3359
3472
  label: z.ZodObject<{
3360
3473
  one: z.ZodOptional<z.ZodString>;
3361
3474
  other: z.ZodString;
@@ -3426,6 +3539,7 @@ declare const canonicalContributionSchemas: {
3426
3539
  "artifacts.preview": "artifacts.preview";
3427
3540
  "markdown.document-view": "markdown.document-view";
3428
3541
  "references.open": "references.open";
3542
+ "files.choose-folder": "files.choose-folder";
3429
3543
  "billing.read": "billing.read";
3430
3544
  "account.read": "account.read";
3431
3545
  "plugins.read": "plugins.read";
@@ -3481,6 +3595,7 @@ declare const canonicalContributionSchemas: {
3481
3595
  "artifacts.preview": "artifacts.preview";
3482
3596
  "markdown.document-view": "markdown.document-view";
3483
3597
  "references.open": "references.open";
3598
+ "files.choose-folder": "files.choose-folder";
3484
3599
  "billing.read": "billing.read";
3485
3600
  "account.read": "account.read";
3486
3601
  "plugins.read": "plugins.read";
@@ -5004,8 +5119,25 @@ export declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
5004
5119
  * compacts with). A plugin preparing a reset text reads them to spend nothing on a session whose
5005
5120
  * reset would not read it (compaction plan, phase 2, #16713). Additive; a plugin reading them
5006
5121
  * declares ^0.55.10.
5122
+ *
5123
+ * 0.55.11 widens `app.artifacts.outputs()` for the Files table (#15965). A `{ uris }` change may
5124
+ * carry `changes`: for each file, `created`, `changed` or `deleted`, with its size, modified
5125
+ * time, title, type and committed-version state (`ArtifactOutputFileFacts`). `enumerate` takes
5126
+ * `facts` and then returns the same facts per item (and an `excluded` count of names the output
5127
+ * identity cannot carry), the new optional `folderMarks()` answers each chat's outputs-folder
5128
+ * modified time, and the new optional `chatsWithOutputs()` lists every chat with an outputs folder
5129
+ * from one scan. The `{ uris }` and `{ sessionId }` shapes stay valid. Additive; a plugin reading
5130
+ * the new fields declares ^0.55.11.
5131
+ *
5132
+ * 0.55.12 raises the reset text's cap (compaction plan, 11 Nov): `RESET_TEXT_MAX_CHARS` goes from
5133
+ * 18,000 to 31,500 characters, and the new `RESET_TEXT_MAX_TOKENS` (10,500) states the same cap in
5134
+ * herd's estimated tokens, which herd's own check now allows. Compatible: every entry valid before
5135
+ * is still valid. An entry over 18,000 characters, read by a host before 0.55.12 (an older app
5136
+ * opening the same transcript), fails that host's parse and its reset writes the summary, as for
5137
+ * any entry it cannot use. A plugin writing such a text, or reading the token cap, declares
5138
+ * ^0.55.12; no other plugin's range changes.
5007
5139
  */
5008
- export declare const KAY_PLUGIN_SDK_VERSION: "0.55.10";
5140
+ export declare const KAY_PLUGIN_SDK_VERSION: "0.55.12";
5009
5141
 
5010
5142
  export declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
5011
5143
 
@@ -6879,6 +7011,7 @@ export declare const KayPluginManifestV1: z.ZodObject<{
6879
7011
  localId: z.ZodString;
6880
7012
  slot: z.ZodString;
6881
7013
  title: z.ZodOptional<z.ZodString>;
7014
+ app: z.ZodOptional<z.ZodString>;
6882
7015
  }, z.core.$strict>>>;
6883
7016
  referencePresentations: z.ZodOptional<z.ZodArray<z.ZodObject<{
6884
7017
  localId: z.ZodString;
@@ -7037,6 +7170,7 @@ export declare const KayPluginManifestV1: z.ZodObject<{
7037
7170
  "artifacts.preview": "artifacts.preview";
7038
7171
  "markdown.document-view": "markdown.document-view";
7039
7172
  "references.open": "references.open";
7173
+ "files.choose-folder": "files.choose-folder";
7040
7174
  "billing.read": "billing.read";
7041
7175
  "account.read": "account.read";
7042
7176
  "plugins.read": "plugins.read";
@@ -7092,6 +7226,7 @@ export declare const KayPluginManifestV1: z.ZodObject<{
7092
7226
  "artifacts.preview": "artifacts.preview";
7093
7227
  "markdown.document-view": "markdown.document-view";
7094
7228
  "references.open": "references.open";
7229
+ "files.choose-folder": "files.choose-folder";
7095
7230
  "billing.read": "billing.read";
7096
7231
  "account.read": "account.read";
7097
7232
  "plugins.read": "plugins.read";
@@ -7129,6 +7264,13 @@ export declare const KayPluginManifestV1: z.ZodObject<{
7129
7264
  localId: z.ZodString;
7130
7265
  }, z.core.$strict>]>;
7131
7266
  where: z.ZodOptional<z.ZodString>;
7267
+ also: z.ZodOptional<z.ZodObject<{
7268
+ source: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
7269
+ pluginId: z.ZodString;
7270
+ localId: z.ZodString;
7271
+ }, z.core.$strict>]>;
7272
+ where: z.ZodOptional<z.ZodString>;
7273
+ }, z.core.$strict>>;
7132
7274
  label: z.ZodObject<{
7133
7275
  one: z.ZodOptional<z.ZodString>;
7134
7276
  other: z.ZodString;
@@ -8118,6 +8260,7 @@ export declare const KayUiAppHostCapability: z.ZodEnum<{
8118
8260
  "artifacts.preview": "artifacts.preview";
8119
8261
  "markdown.document-view": "markdown.document-view";
8120
8262
  "references.open": "references.open";
8263
+ "files.choose-folder": "files.choose-folder";
8121
8264
  "billing.read": "billing.read";
8122
8265
  "account.read": "account.read";
8123
8266
  "plugins.read": "plugins.read";
@@ -8253,6 +8396,7 @@ export declare const KayUiTargetManifest: z.ZodObject<{
8253
8396
  localId: z.ZodString;
8254
8397
  slot: z.ZodString;
8255
8398
  title: z.ZodOptional<z.ZodString>;
8399
+ app: z.ZodOptional<z.ZodString>;
8256
8400
  }, z.core.$strict>>>;
8257
8401
  referencePresentations: z.ZodOptional<z.ZodArray<z.ZodObject<{
8258
8402
  localId: z.ZodString;
@@ -8411,6 +8555,7 @@ export declare const KayUiTargetManifest: z.ZodObject<{
8411
8555
  "artifacts.preview": "artifacts.preview";
8412
8556
  "markdown.document-view": "markdown.document-view";
8413
8557
  "references.open": "references.open";
8558
+ "files.choose-folder": "files.choose-folder";
8414
8559
  "billing.read": "billing.read";
8415
8560
  "account.read": "account.read";
8416
8561
  "plugins.read": "plugins.read";
@@ -8466,6 +8611,7 @@ export declare const KayUiTargetManifest: z.ZodObject<{
8466
8611
  "artifacts.preview": "artifacts.preview";
8467
8612
  "markdown.document-view": "markdown.document-view";
8468
8613
  "references.open": "references.open";
8614
+ "files.choose-folder": "files.choose-folder";
8469
8615
  "billing.read": "billing.read";
8470
8616
  "account.read": "account.read";
8471
8617
  "plugins.read": "plugins.read";
@@ -8503,6 +8649,13 @@ export declare const KayUiTargetManifest: z.ZodObject<{
8503
8649
  localId: z.ZodString;
8504
8650
  }, z.core.$strict>]>;
8505
8651
  where: z.ZodOptional<z.ZodString>;
8652
+ also: z.ZodOptional<z.ZodObject<{
8653
+ source: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
8654
+ pluginId: z.ZodString;
8655
+ localId: z.ZodString;
8656
+ }, z.core.$strict>]>;
8657
+ where: z.ZodOptional<z.ZodString>;
8658
+ }, z.core.$strict>>;
8506
8659
  label: z.ZodObject<{
8507
8660
  one: z.ZodOptional<z.ZodString>;
8508
8661
  other: z.ZodString;
@@ -8835,7 +8988,7 @@ export declare function parseSemver(value: string): ParsedSemver | undefined;
8835
8988
  export declare function parseWhere(source: string, keyTypes?: WhereKeyTypes): WhereParseResult;
8836
8989
 
8837
8990
  /** Every capability slug {@link PluginCapabilityClaimV1} can express, for exhaustive table checks. */
8838
- export declare const PLUGIN_CAPABILITY_SLUGS: readonly ["sessions.run", "network.connect", "web-session.request", "web-session.download", "process.spawn", "sessions.read", "signals.read", "uri.call", "endpoints.invoke", "skills.read", "skills.write", "skills.share", "plugins.set-enabled", "plugins.read", "sessions.assign-project", "artifacts.resolve-file", "process.run", "sessions.annotate", "sessions.compact", "sessions.state", "compaction.reset-text", "soul.write", "tools.describe", "workspace.command", "sessions.create", "sessions.update", "models.complete", "systemOne.use", "automations.write", "automations.run", "workflows.define", "workflows.signals", "session-events.subscribe", "agents.run", "dynamic-context.register", "app-data.register", "app-data.read", "knowledge-source.register", "artifacts.read", "session-artifacts.read", "session-artifacts.create", "account.assert", "account.update", "agents.permissions", "tool-interception.register", "interaction.surface", "config.declare-section", "auth.own-service", "auth.shared-identity", "cli.bind", "mcp.host-server", "prompt.resident", "skills.declared-source", "family-folder.root", "whiteboard.discover", "whiteboard.read", "whiteboard.create", "whiteboard.update", "whiteboard.remove", "model-selection.register", "system-prompt.register"];
8991
+ export declare const PLUGIN_CAPABILITY_SLUGS: readonly ["sessions.run", "network.connect", "web-session.request", "web-session.download", "process.spawn", "sessions.read", "signals.read", "uri.call", "endpoints.invoke", "skills.read", "skills.write", "skills.share", "plugins.set-enabled", "plugins.read", "sessions.assign-project", "artifacts.resolve-file", "process.run", "sessions.annotate", "sessions.compact", "sessions.state", "compaction.reset-text", "soul.write", "tools.describe", "workspace.command", "sessions.create", "sessions.update", "models.complete", "systemOne.use", "automations.write", "automations.run", "workflows.define", "workflows.signals", "session-events.subscribe", "agents.run", "dynamic-context.register", "app-data.register", "app-data.read", "knowledge-source.register", "artifacts.read", "session-artifacts.read", "session-artifacts.create", "account.assert", "account.update", "agents.permissions", "tool-interception.register", "interaction.surface", "config.declare-section", "auth.own-service", "auth.shared-identity", "cli.bind", "mcp.host-server", "prompt.resident", "skills.declared-source", "family-folder.root", "messages.send", "whiteboard.discover", "whiteboard.read", "whiteboard.create", "whiteboard.update", "whiteboard.remove", "model-selection.register", "system-prompt.register"];
8839
8992
 
8840
8993
  /** Diagnostic messages carry plugin-controlled text (parse errors, module errors); bound it so a
8841
8994
  * hostile or accidental multi-megabyte error can never blow up a log line or a render surface. */
@@ -9612,6 +9765,12 @@ export declare const PluginCapabilityClaimInputV1: z.ZodCustom<{
9612
9765
  target: "kay.app";
9613
9766
  slug: "workspace.command";
9614
9767
  envelope: Record<string, never>;
9768
+ } | {
9769
+ target: "kay.app";
9770
+ slug: "messages.send";
9771
+ envelope: {
9772
+ provider: string;
9773
+ };
9615
9774
  } | {
9616
9775
  target: "kay.app";
9617
9776
  slug: "sessions.create";
@@ -9914,6 +10073,12 @@ export declare const PluginCapabilityClaimInputV1: z.ZodCustom<{
9914
10073
  target: "kay.app";
9915
10074
  slug: "workspace.command";
9916
10075
  envelope: Record<string, never>;
10076
+ } | {
10077
+ target: "kay.app";
10078
+ slug: "messages.send";
10079
+ envelope: {
10080
+ provider: string;
10081
+ };
9917
10082
  } | {
9918
10083
  target: "kay.app";
9919
10084
  slug: "sessions.create";
@@ -10226,6 +10391,12 @@ export declare const PluginCapabilityClaimV1: z.ZodDiscriminatedUnion<[z.ZodObje
10226
10391
  target: z.ZodLiteral<"kay.app">;
10227
10392
  slug: z.ZodLiteral<"workspace.command">;
10228
10393
  envelope: z.ZodObject<{}, z.core.$strict>;
10394
+ }, z.core.$strict>, z.ZodObject<{
10395
+ target: z.ZodLiteral<"kay.app">;
10396
+ slug: z.ZodLiteral<"messages.send">;
10397
+ envelope: z.ZodObject<{
10398
+ provider: z.ZodString;
10399
+ }, z.core.$strict>;
10229
10400
  }, z.core.$strict>, z.ZodObject<{
10230
10401
  target: z.ZodLiteral<"kay.app">;
10231
10402
  slug: z.ZodLiteral<"sessions.create">;
@@ -10584,6 +10755,12 @@ export declare const PluginCapabilityDecisionV1: z.ZodDiscriminatedUnion<[z.ZodO
10584
10755
  target: z.ZodLiteral<"kay.app">;
10585
10756
  slug: z.ZodLiteral<"workspace.command">;
10586
10757
  envelope: z.ZodObject<{}, z.core.$strict>;
10758
+ }, z.core.$strict>, z.ZodObject<{
10759
+ target: z.ZodLiteral<"kay.app">;
10760
+ slug: z.ZodLiteral<"messages.send">;
10761
+ envelope: z.ZodObject<{
10762
+ provider: z.ZodString;
10763
+ }, z.core.$strict>;
10587
10764
  }, z.core.$strict>, z.ZodObject<{
10588
10765
  target: z.ZodLiteral<"kay.app">;
10589
10766
  slug: z.ZodLiteral<"sessions.create">;
@@ -10941,6 +11118,12 @@ export declare const PluginCapabilityDecisionV1: z.ZodDiscriminatedUnion<[z.ZodO
10941
11118
  target: z.ZodLiteral<"kay.app">;
10942
11119
  slug: z.ZodLiteral<"workspace.command">;
10943
11120
  envelope: z.ZodObject<{}, z.core.$strict>;
11121
+ }, z.core.$strict>, z.ZodObject<{
11122
+ target: z.ZodLiteral<"kay.app">;
11123
+ slug: z.ZodLiteral<"messages.send">;
11124
+ envelope: z.ZodObject<{
11125
+ provider: z.ZodString;
11126
+ }, z.core.$strict>;
10944
11127
  }, z.core.$strict>, z.ZodObject<{
10945
11128
  target: z.ZodLiteral<"kay.app">;
10946
11129
  slug: z.ZodLiteral<"sessions.create">;
@@ -11332,6 +11515,12 @@ export declare const PluginCapabilityRefusalV1: z.ZodObject<{
11332
11515
  target: z.ZodLiteral<"kay.app">;
11333
11516
  slug: z.ZodLiteral<"workspace.command">;
11334
11517
  envelope: z.ZodObject<{}, z.core.$strict>;
11518
+ }, z.core.$strict>, z.ZodObject<{
11519
+ target: z.ZodLiteral<"kay.app">;
11520
+ slug: z.ZodLiteral<"messages.send">;
11521
+ envelope: z.ZodObject<{
11522
+ provider: z.ZodString;
11523
+ }, z.core.$strict>;
11335
11524
  }, z.core.$strict>, z.ZodObject<{
11336
11525
  target: z.ZodLiteral<"kay.app">;
11337
11526
  slug: z.ZodLiteral<"sessions.create">;
@@ -13259,10 +13448,20 @@ export declare const RENAMED_PLUGIN_CAPABILITY_SLUGS: {
13259
13448
  export declare const RESERVED_DIRECTORY_PLUGIN_ID_PREFIXES: readonly ["herd.", "kay."];
13260
13449
 
13261
13450
  /**
13262
- * The longest text an entry may hold, in characters: herd's 6,000 estimated tokens at its three
13451
+ * The longest text an entry may hold, in characters: {@link RESET_TEXT_MAX_TOKENS} at herd's three
13263
13452
  * characters per token for ASCII. Herd also counts the tokens, so denser text is refused sooner.
13264
13453
  */
13265
- export declare const RESET_TEXT_MAX_CHARS = 18000;
13454
+ export declare const RESET_TEXT_MAX_CHARS: number;
13455
+
13456
+ /**
13457
+ * The most a reset text may hold, in herd's estimated tokens: about 3 characters a token for ASCII,
13458
+ * one token for any other character (`estimateTokens` in herd's compaction executor, which a
13459
+ * plugin's count must repeat). Herd refuses a larger text and writes today's summary
13460
+ * (`PREPARED_STATE_MAX_TOKENS`, kept equal to this by a test in `@bonsai/agent-runtime`). 10,500
13461
+ * fits the median record render the compaction plan chose, about 30,000 characters; a larger render
13462
+ * is trimmed to fit (`docs/plans/compaction.md`, decision log, 11 Nov).
13463
+ */
13464
+ export declare const RESET_TEXT_MAX_TOKENS = 10500;
13266
13465
 
13267
13466
  /** The `contributes.resetText` declaration: which of the plugin's state entries holds it. */
13268
13467
  export declare const ResetTextContribution: z.ZodObject<{
@@ -13984,6 +14183,7 @@ export declare const ResolvedKayUiApp: z.ZodObject<{
13984
14183
  "artifacts.preview": "artifacts.preview";
13985
14184
  "markdown.document-view": "markdown.document-view";
13986
14185
  "references.open": "references.open";
14186
+ "files.choose-folder": "files.choose-folder";
13987
14187
  "billing.read": "billing.read";
13988
14188
  "account.read": "account.read";
13989
14189
  "plugins.read": "plugins.read";
@@ -15908,6 +16108,7 @@ export declare const ResolvedPluginContractV1: z.ZodObject<{
15908
16108
  "artifacts.preview": "artifacts.preview";
15909
16109
  "markdown.document-view": "markdown.document-view";
15910
16110
  "references.open": "references.open";
16111
+ "files.choose-folder": "files.choose-folder";
15911
16112
  "billing.read": "billing.read";
15912
16113
  "account.read": "account.read";
15913
16114
  "plugins.read": "plugins.read";
@@ -17814,6 +18015,7 @@ export declare const UiAppCapabilities: z.ZodObject<{
17814
18015
  "artifacts.preview": "artifacts.preview";
17815
18016
  "markdown.document-view": "markdown.document-view";
17816
18017
  "references.open": "references.open";
18018
+ "files.choose-folder": "files.choose-folder";
17817
18019
  "billing.read": "billing.read";
17818
18020
  "account.read": "account.read";
17819
18021
  "plugins.read": "plugins.read";
@@ -17879,6 +18081,7 @@ export declare const UiAppContribution: z.ZodObject<{
17879
18081
  "artifacts.preview": "artifacts.preview";
17880
18082
  "markdown.document-view": "markdown.document-view";
17881
18083
  "references.open": "references.open";
18084
+ "files.choose-folder": "files.choose-folder";
17882
18085
  "billing.read": "billing.read";
17883
18086
  "account.read": "account.read";
17884
18087
  "plugins.read": "plugins.read";
@@ -17934,6 +18137,7 @@ export declare const UiAppContribution: z.ZodObject<{
17934
18137
  "artifacts.preview": "artifacts.preview";
17935
18138
  "markdown.document-view": "markdown.document-view";
17936
18139
  "references.open": "references.open";
18140
+ "files.choose-folder": "files.choose-folder";
17937
18141
  "billing.read": "billing.read";
17938
18142
  "account.read": "account.read";
17939
18143
  "plugins.read": "plugins.read";
@@ -18046,6 +18250,13 @@ export declare const UiRailEntryContribution: z.ZodObject<{
18046
18250
  localId: z.ZodString;
18047
18251
  }, z.core.$strict>]>;
18048
18252
  where: z.ZodOptional<z.ZodString>;
18253
+ also: z.ZodOptional<z.ZodObject<{
18254
+ source: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
18255
+ pluginId: z.ZodString;
18256
+ localId: z.ZodString;
18257
+ }, z.core.$strict>]>;
18258
+ where: z.ZodOptional<z.ZodString>;
18259
+ }, z.core.$strict>>;
18049
18260
  label: z.ZodObject<{
18050
18261
  one: z.ZodOptional<z.ZodString>;
18051
18262
  other: z.ZodString;
@@ -18066,6 +18277,7 @@ export declare const UiSlotContribution: z.ZodObject<{
18066
18277
  localId: z.ZodString;
18067
18278
  slot: z.ZodString;
18068
18279
  title: z.ZodOptional<z.ZodString>;
18280
+ app: z.ZodOptional<z.ZodString>;
18069
18281
  }, z.core.$strict>;
18070
18282
 
18071
18283
  export declare type UiSlotContribution = z.infer<typeof UiSlotContribution>;
package/dist/index.js CHANGED
@@ -260,8 +260,10 @@ var JsonSchema = z4.record(z4.string(), JsonValue);
260
260
  var KAY_PLUGIN_MANIFEST_SIZE_CAP_BYTES = 1024 * 1024;
261
261
  var KAY_PLUGIN_PROTOCOL_VERSION = "kay.plugin.v1";
262
262
  var KAY_PLUGIN_PROTOCOL_PACKAGE_NAME = "@bonsai/plugin-protocol";
263
- var KAY_PLUGIN_SDK_VERSION = "0.55.10";
263
+ var KAY_PLUGIN_SDK_VERSION = "0.55.12";
264
264
  var KAY_PLUGIN_COMPATIBLE_SDK_VERSIONS = [
265
+ "0.55.11",
266
+ "0.55.10",
265
267
  "0.55.9",
266
268
  "0.55.8",
267
269
  "0.55.7",
@@ -1856,6 +1858,7 @@ var PLUGIN_CAPABILITY_SLUGS = [
1856
1858
  "prompt.resident",
1857
1859
  "skills.declared-source",
1858
1860
  "family-folder.root",
1861
+ "messages.send",
1859
1862
  "whiteboard.discover",
1860
1863
  "whiteboard.read",
1861
1864
  "whiteboard.create",
@@ -2109,6 +2112,14 @@ function createAuthoritySchemas(canonical) {
2109
2112
  slug: z11.literal("workspace.command"),
2110
2113
  envelope: z11.strictObject({})
2111
2114
  }),
2115
+ z11.strictObject({
2116
+ // Prepare and send replies through one provider (`app.messages`). Preparing reads who a
2117
+ // message's reply goes to, so it needs this claim too; sending also needs the person's
2118
+ // command on the plugin's own page.
2119
+ target: z11.literal("kay.app"),
2120
+ slug: z11.literal("messages.send"),
2121
+ envelope: z11.strictObject({ provider: NonEmptyString3.max(100) })
2122
+ }),
2112
2123
  z11.strictObject({
2113
2124
  target: z11.literal("kay.app"),
2114
2125
  slug: z11.literal("sessions.create"),
@@ -2431,6 +2442,8 @@ function sameClaim(a, b) {
2431
2442
  return true;
2432
2443
  case "uri.call":
2433
2444
  return b.slug === "uri.call" && a.envelope.scheme === b.envelope.scheme && a.envelope.verb === b.envelope.verb;
2445
+ case "messages.send":
2446
+ return b.slug === "messages.send" && a.envelope.provider === b.envelope.provider;
2434
2447
  case "endpoints.invoke":
2435
2448
  return b.slug === "endpoints.invoke" && a.envelope.pluginId === b.envelope.pluginId && a.envelope.endpointId === b.envelope.endpointId;
2436
2449
  case "network.connect":
@@ -2532,6 +2545,8 @@ function envelopePairs(a, b) {
2532
2545
  [a.envelope.scheme, b.envelope.scheme],
2533
2546
  [a.envelope.verb, b.envelope.verb]
2534
2547
  ] : [];
2548
+ case "messages.send":
2549
+ return b.slug === "messages.send" ? [[a.envelope.provider, b.envelope.provider]] : [];
2535
2550
  case "endpoints.invoke":
2536
2551
  return b.slug === "endpoints.invoke" ? [
2537
2552
  [a.envelope.pluginId, b.envelope.pluginId],
@@ -4339,7 +4354,12 @@ function createContributionsSchemas(canonical) {
4339
4354
  const UiSlotContribution2 = z14.strictObject({
4340
4355
  localId: LocalContributionId2,
4341
4356
  slot: NonEmptyString3,
4342
- title: NonEmptyString3.optional()
4357
+ title: NonEmptyString3.optional(),
4358
+ /**
4359
+ * The `contextOnly` app in this plugin that fills the slot. Home reads `home.tasks` this way:
4360
+ * it mounts that app in each Home pane.
4361
+ */
4362
+ app: LocalContributionId2.optional()
4343
4363
  });
4344
4364
  const NOT_LOCAL_APP_SCHEMES = /* @__PURE__ */ new Set([
4345
4365
  "http",
@@ -4577,6 +4597,9 @@ function createContributionsSchemas(canonical) {
4577
4597
  // Draws links the host resolves and opens (`BonsaiReferencePill`, `BonsaiReferenceRow`,
4578
4598
  // `BonsaiReferenceMarkdown`). A person's click on one can open a session or another plugin's page.
4579
4599
  "references.open",
4600
+ // Opens the system folder picker when the person acts (`useBonsaiFolderPicker`) and answers
4601
+ // the one folder they chose, or nothing when they cancel. It lists and reads nothing.
4602
+ "files.choose-folder",
4580
4603
  // Server-rated organization billing, distinct from local/provider cost.
4581
4604
  "billing.read",
4582
4605
  "account.read",
@@ -4642,20 +4665,33 @@ function createContributionsSchemas(canonical) {
4642
4665
  const UiRailBadge = z14.strictObject({
4643
4666
  source: UiAppCapabilityReference2,
4644
4667
  where: NonEmptyString3.optional(),
4668
+ /**
4669
+ * A second rows source the count adds, with its own `where`: for a page that tends two kinds
4670
+ * of thing kept by different plugins. The label's `${count}` is the sum.
4671
+ */
4672
+ also: z14.strictObject({
4673
+ source: UiAppCapabilityReference2,
4674
+ where: NonEmptyString3.optional()
4675
+ }).optional(),
4645
4676
  label: z14.strictObject({
4646
4677
  one: NonEmptyString3.optional(),
4647
4678
  other: NonEmptyString3
4648
4679
  })
4649
4680
  }).superRefine((badge, ctx) => {
4650
- if (badge.where === void 0)
4651
- return;
4652
- const parsed = parseWhere(badge.where);
4653
- if (!parsed.ok) {
4654
- ctx.addIssue({
4655
- code: "custom",
4656
- path: ["where"],
4657
- message: `rail badge has an invalid where: ${parsed.message}`
4658
- });
4681
+ for (const [path, where] of [
4682
+ [["where"], badge.where],
4683
+ [["also", "where"], badge.also?.where]
4684
+ ]) {
4685
+ if (where === void 0)
4686
+ continue;
4687
+ const parsed = parseWhere(where);
4688
+ if (!parsed.ok) {
4689
+ ctx.addIssue({
4690
+ code: "custom",
4691
+ path: [...path],
4692
+ message: `rail badge has an invalid where: ${parsed.message}`
4693
+ });
4694
+ }
4659
4695
  }
4660
4696
  });
4661
4697
  const UiRailEntryContribution2 = z14.strictObject({
@@ -4991,7 +5027,8 @@ function isPluginStateEntryCustomType(customType) {
4991
5027
  }
4992
5028
 
4993
5029
  // packages/plugin-protocol/dist/reset-text.js
4994
- var RESET_TEXT_MAX_CHARS = 18e3;
5030
+ var RESET_TEXT_MAX_TOKENS = 10500;
5031
+ var RESET_TEXT_MAX_CHARS = RESET_TEXT_MAX_TOKENS * 3;
4995
5032
  var EntryAddress = z18.strictObject({
4996
5033
  sessionId: z18.string().min(1),
4997
5034
  entryId: z18.string().min(1)
@@ -5716,12 +5753,17 @@ function createManifestSchemas(canonical) {
5716
5753
  index,
5717
5754
  "badge"
5718
5755
  ];
5719
- if (typeof entry.badge.source === "string" && !declaredRowsStores.has(entry.badge.source)) {
5720
- ctx.addIssue({
5721
- code: "custom",
5722
- path: [...path, "source"],
5723
- message: `rail entry ${entry.id} counts ${entry.badge.source}, which is not one of this plugin's data sources with a rows store`
5724
- });
5756
+ for (const [at, source] of [
5757
+ [["source"], entry.badge.source],
5758
+ [["also", "source"], entry.badge.also?.source]
5759
+ ]) {
5760
+ if (typeof source === "string" && !declaredRowsStores.has(source)) {
5761
+ ctx.addIssue({
5762
+ code: "custom",
5763
+ path: [...path, ...at],
5764
+ message: `rail entry ${entry.id} counts ${source}, which is not one of this plugin's data sources with a rows store`
5765
+ });
5766
+ }
5725
5767
  }
5726
5768
  }
5727
5769
  for (const source of declaredAppDataSources) {
@@ -5783,6 +5825,26 @@ function createManifestSchemas(canonical) {
5783
5825
  });
5784
5826
  }
5785
5827
  }
5828
+ for (const [index, slot] of (manifest.targets?.kay?.ui?.contributes?.slots ?? []).entries()) {
5829
+ if (slot.app === void 0)
5830
+ continue;
5831
+ const app = manifest.targets?.kay?.ui?.contributes?.apps?.find((candidate) => candidate.localId === slot.app);
5832
+ if (app === void 0 || app.contextOnly !== true) {
5833
+ ctx.addIssue({
5834
+ code: "custom",
5835
+ path: [
5836
+ "targets",
5837
+ "kay",
5838
+ "ui",
5839
+ "contributes",
5840
+ "slots",
5841
+ index,
5842
+ "app"
5843
+ ],
5844
+ message: app === void 0 ? `Slot ${slot.localId} names app ${slot.app}, which this plugin does not declare` : `Slot ${slot.localId} app ${app.localId} must be a contextOnly ui app`
5845
+ });
5846
+ }
5847
+ }
5786
5848
  const notificationRuleIds = new Set(manifest.targets?.kay?.app?.contributes?.notificationRules?.map((rule) => rule.localId) ?? []);
5787
5849
  const previewedRules = /* @__PURE__ */ new Set();
5788
5850
  for (const [index, preview] of (manifest.targets?.kay?.ui?.contributes?.toastPreviews ?? []).entries()) {
@@ -8479,10 +8541,32 @@ function isCanonicalArtifactOutputUri(uri) {
8479
8541
  return parseArtifactOutputUri(uri) !== void 0;
8480
8542
  }
8481
8543
  var ArtifactOutputUri = z27.string().refine(isCanonicalArtifactOutputUri, "Expected a canonical output://session/name URI");
8544
+ var ARTIFACT_OUTPUT_FOLDER_MARKS_MAX = 500;
8545
+ var ArtifactOutputVersionState = z27.discriminatedUnion("state", [
8546
+ z27.strictObject({ state: z27.literal("draft") }),
8547
+ z27.strictObject({
8548
+ state: z27.enum(["clean", "edited"]),
8549
+ committedVersion: z27.number().int().positive()
8550
+ })
8551
+ ]);
8552
+ var ArtifactOutputFileFacts = z27.strictObject({
8553
+ sizeBytes: z27.number().finite().nonnegative(),
8554
+ modifiedAtMs: z27.number().finite().nonnegative(),
8555
+ title: z27.string().min(1).max(4096),
8556
+ mimeType: z27.string().min(1).max(255).optional(),
8557
+ versionState: ArtifactOutputVersionState.optional()
8558
+ });
8559
+ var ArtifactOutputFileChange = z27.strictObject({
8560
+ uri: ArtifactOutputUri,
8561
+ kind: z27.enum(["created", "changed", "deleted"]),
8562
+ file: ArtifactOutputFileFacts.optional(),
8563
+ metadataOnly: z27.literal(true).optional()
8564
+ }).refine((change) => change.kind === "deleted" === (change.file === void 0), "A deleted change carries no facts; every other change carries them.");
8482
8565
  var ArtifactOutputChange = z27.union([
8483
8566
  z27.strictObject({
8484
- uris: z27.array(ArtifactOutputUri).min(1).max(ARTIFACT_OUTPUT_PAGE_MAX)
8485
- }),
8567
+ uris: z27.array(ArtifactOutputUri).min(1).max(ARTIFACT_OUTPUT_PAGE_MAX),
8568
+ changes: z27.array(ArtifactOutputFileChange).min(1).max(ARTIFACT_OUTPUT_PAGE_MAX).optional()
8569
+ }).refine((change) => change.changes === void 0 || change.changes.length === change.uris.length && change.changes.every((file, index) => file.uri === change.uris[index]), "Each change names the URI at the same position in uris."),
8486
8570
  z27.strictObject({ sessionId: Segment })
8487
8571
  ]);
8488
8572
 
@@ -8584,6 +8668,7 @@ export {
8584
8668
  AGENT_RUNTIME_SESSION_CREATOR_KINDS,
8585
8669
  APPROVAL_ANSWERS,
8586
8670
  APPROVAL_KINDS,
8671
+ ARTIFACT_OUTPUT_FOLDER_MARKS_MAX,
8587
8672
  ARTIFACT_OUTPUT_PAGE_MAX,
8588
8673
  ARTIFACT_PROVENANCE_VERSION,
8589
8674
  AccessApprovalReview,
@@ -8602,7 +8687,10 @@ export {
8602
8687
  ApprovalTypeContribution,
8603
8688
  ArtifactGenerationId,
8604
8689
  ArtifactOutputChange,
8690
+ ArtifactOutputFileChange,
8691
+ ArtifactOutputFileFacts,
8605
8692
  ArtifactOutputUri,
8693
+ ArtifactOutputVersionState,
8606
8694
  ArtifactProvenanceActor,
8607
8695
  ArtifactProvenanceCaptureContextSchema,
8608
8696
  ArtifactProvenanceCause,
@@ -8771,6 +8859,7 @@ export {
8771
8859
  RENAMED_PLUGIN_CAPABILITY_SLUGS,
8772
8860
  RESERVED_DIRECTORY_PLUGIN_ID_PREFIXES,
8773
8861
  RESET_TEXT_MAX_CHARS,
8862
+ RESET_TEXT_MAX_TOKENS,
8774
8863
  RETIRED_COMPATIBILITY_KEYS,
8775
8864
  RETIRED_PERMISSION_ASK_KEYS,
8776
8865
  RETIRED_PLUGIN_CAPABILITY_SLUGS,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yaklabs-ai/plugin-protocol",
3
- "version": "0.55.10",
3
+ "version": "0.55.12",
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",