@yaklabs-ai/plugin-protocol 0.55.9 → 0.55.11

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.9"
14
+ "@bonsai/plugin-protocol": "npm:@yaklabs-ai/plugin-protocol@^0.55.11"
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.9",
4
+ "version": "0.55.11",
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";
@@ -4996,8 +5111,25 @@ export declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
4996
5111
  * 0.55.9 lets a reference presentation's `words.kinds` row name its own tally `noun`, so a tally
4997
5112
  * counts that address shape as something other than the scheme's noun ("Read 1 availability
4998
5113
  * check", not "Read 1 calendar event"). Additive; a plugin declaring it declares ^0.55.9.
5114
+ *
5115
+ * 0.55.10 adds two optional fields to the `turn-settled` session event, set only for a plugin
5116
+ * holding the private `compaction.reset-text` claim: `resetTextEligible` (whether the session's
5117
+ * resets may use its reset text: a root conversation a person started, not a fork) and
5118
+ * `compactionThreshold` (the context size at which the session is reset, from the model registry it
5119
+ * compacts with). A plugin preparing a reset text reads them to spend nothing on a session whose
5120
+ * reset would not read it (compaction plan, phase 2, #16713). Additive; a plugin reading them
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.
4999
5131
  */
5000
- export declare const KAY_PLUGIN_SDK_VERSION: "0.55.9";
5132
+ export declare const KAY_PLUGIN_SDK_VERSION: "0.55.11";
5001
5133
 
5002
5134
  export declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
5003
5135
 
@@ -6871,6 +7003,7 @@ export declare const KayPluginManifestV1: z.ZodObject<{
6871
7003
  localId: z.ZodString;
6872
7004
  slot: z.ZodString;
6873
7005
  title: z.ZodOptional<z.ZodString>;
7006
+ app: z.ZodOptional<z.ZodString>;
6874
7007
  }, z.core.$strict>>>;
6875
7008
  referencePresentations: z.ZodOptional<z.ZodArray<z.ZodObject<{
6876
7009
  localId: z.ZodString;
@@ -7029,6 +7162,7 @@ export declare const KayPluginManifestV1: z.ZodObject<{
7029
7162
  "artifacts.preview": "artifacts.preview";
7030
7163
  "markdown.document-view": "markdown.document-view";
7031
7164
  "references.open": "references.open";
7165
+ "files.choose-folder": "files.choose-folder";
7032
7166
  "billing.read": "billing.read";
7033
7167
  "account.read": "account.read";
7034
7168
  "plugins.read": "plugins.read";
@@ -7084,6 +7218,7 @@ export declare const KayPluginManifestV1: z.ZodObject<{
7084
7218
  "artifacts.preview": "artifacts.preview";
7085
7219
  "markdown.document-view": "markdown.document-view";
7086
7220
  "references.open": "references.open";
7221
+ "files.choose-folder": "files.choose-folder";
7087
7222
  "billing.read": "billing.read";
7088
7223
  "account.read": "account.read";
7089
7224
  "plugins.read": "plugins.read";
@@ -7121,6 +7256,13 @@ export declare const KayPluginManifestV1: z.ZodObject<{
7121
7256
  localId: z.ZodString;
7122
7257
  }, z.core.$strict>]>;
7123
7258
  where: z.ZodOptional<z.ZodString>;
7259
+ also: z.ZodOptional<z.ZodObject<{
7260
+ source: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
7261
+ pluginId: z.ZodString;
7262
+ localId: z.ZodString;
7263
+ }, z.core.$strict>]>;
7264
+ where: z.ZodOptional<z.ZodString>;
7265
+ }, z.core.$strict>>;
7124
7266
  label: z.ZodObject<{
7125
7267
  one: z.ZodOptional<z.ZodString>;
7126
7268
  other: z.ZodString;
@@ -8110,6 +8252,7 @@ export declare const KayUiAppHostCapability: z.ZodEnum<{
8110
8252
  "artifacts.preview": "artifacts.preview";
8111
8253
  "markdown.document-view": "markdown.document-view";
8112
8254
  "references.open": "references.open";
8255
+ "files.choose-folder": "files.choose-folder";
8113
8256
  "billing.read": "billing.read";
8114
8257
  "account.read": "account.read";
8115
8258
  "plugins.read": "plugins.read";
@@ -8245,6 +8388,7 @@ export declare const KayUiTargetManifest: z.ZodObject<{
8245
8388
  localId: z.ZodString;
8246
8389
  slot: z.ZodString;
8247
8390
  title: z.ZodOptional<z.ZodString>;
8391
+ app: z.ZodOptional<z.ZodString>;
8248
8392
  }, z.core.$strict>>>;
8249
8393
  referencePresentations: z.ZodOptional<z.ZodArray<z.ZodObject<{
8250
8394
  localId: z.ZodString;
@@ -8403,6 +8547,7 @@ export declare const KayUiTargetManifest: z.ZodObject<{
8403
8547
  "artifacts.preview": "artifacts.preview";
8404
8548
  "markdown.document-view": "markdown.document-view";
8405
8549
  "references.open": "references.open";
8550
+ "files.choose-folder": "files.choose-folder";
8406
8551
  "billing.read": "billing.read";
8407
8552
  "account.read": "account.read";
8408
8553
  "plugins.read": "plugins.read";
@@ -8458,6 +8603,7 @@ export declare const KayUiTargetManifest: z.ZodObject<{
8458
8603
  "artifacts.preview": "artifacts.preview";
8459
8604
  "markdown.document-view": "markdown.document-view";
8460
8605
  "references.open": "references.open";
8606
+ "files.choose-folder": "files.choose-folder";
8461
8607
  "billing.read": "billing.read";
8462
8608
  "account.read": "account.read";
8463
8609
  "plugins.read": "plugins.read";
@@ -8495,6 +8641,13 @@ export declare const KayUiTargetManifest: z.ZodObject<{
8495
8641
  localId: z.ZodString;
8496
8642
  }, z.core.$strict>]>;
8497
8643
  where: z.ZodOptional<z.ZodString>;
8644
+ also: z.ZodOptional<z.ZodObject<{
8645
+ source: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
8646
+ pluginId: z.ZodString;
8647
+ localId: z.ZodString;
8648
+ }, z.core.$strict>]>;
8649
+ where: z.ZodOptional<z.ZodString>;
8650
+ }, z.core.$strict>>;
8498
8651
  label: z.ZodObject<{
8499
8652
  one: z.ZodOptional<z.ZodString>;
8500
8653
  other: z.ZodString;
@@ -8827,7 +8980,7 @@ export declare function parseSemver(value: string): ParsedSemver | undefined;
8827
8980
  export declare function parseWhere(source: string, keyTypes?: WhereKeyTypes): WhereParseResult;
8828
8981
 
8829
8982
  /** Every capability slug {@link PluginCapabilityClaimV1} can express, for exhaustive table checks. */
8830
- 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"];
8983
+ 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"];
8831
8984
 
8832
8985
  /** Diagnostic messages carry plugin-controlled text (parse errors, module errors); bound it so a
8833
8986
  * hostile or accidental multi-megabyte error can never blow up a log line or a render surface. */
@@ -9604,6 +9757,12 @@ export declare const PluginCapabilityClaimInputV1: z.ZodCustom<{
9604
9757
  target: "kay.app";
9605
9758
  slug: "workspace.command";
9606
9759
  envelope: Record<string, never>;
9760
+ } | {
9761
+ target: "kay.app";
9762
+ slug: "messages.send";
9763
+ envelope: {
9764
+ provider: string;
9765
+ };
9607
9766
  } | {
9608
9767
  target: "kay.app";
9609
9768
  slug: "sessions.create";
@@ -9906,6 +10065,12 @@ export declare const PluginCapabilityClaimInputV1: z.ZodCustom<{
9906
10065
  target: "kay.app";
9907
10066
  slug: "workspace.command";
9908
10067
  envelope: Record<string, never>;
10068
+ } | {
10069
+ target: "kay.app";
10070
+ slug: "messages.send";
10071
+ envelope: {
10072
+ provider: string;
10073
+ };
9909
10074
  } | {
9910
10075
  target: "kay.app";
9911
10076
  slug: "sessions.create";
@@ -10218,6 +10383,12 @@ export declare const PluginCapabilityClaimV1: z.ZodDiscriminatedUnion<[z.ZodObje
10218
10383
  target: z.ZodLiteral<"kay.app">;
10219
10384
  slug: z.ZodLiteral<"workspace.command">;
10220
10385
  envelope: z.ZodObject<{}, z.core.$strict>;
10386
+ }, z.core.$strict>, z.ZodObject<{
10387
+ target: z.ZodLiteral<"kay.app">;
10388
+ slug: z.ZodLiteral<"messages.send">;
10389
+ envelope: z.ZodObject<{
10390
+ provider: z.ZodString;
10391
+ }, z.core.$strict>;
10221
10392
  }, z.core.$strict>, z.ZodObject<{
10222
10393
  target: z.ZodLiteral<"kay.app">;
10223
10394
  slug: z.ZodLiteral<"sessions.create">;
@@ -10576,6 +10747,12 @@ export declare const PluginCapabilityDecisionV1: z.ZodDiscriminatedUnion<[z.ZodO
10576
10747
  target: z.ZodLiteral<"kay.app">;
10577
10748
  slug: z.ZodLiteral<"workspace.command">;
10578
10749
  envelope: z.ZodObject<{}, z.core.$strict>;
10750
+ }, z.core.$strict>, z.ZodObject<{
10751
+ target: z.ZodLiteral<"kay.app">;
10752
+ slug: z.ZodLiteral<"messages.send">;
10753
+ envelope: z.ZodObject<{
10754
+ provider: z.ZodString;
10755
+ }, z.core.$strict>;
10579
10756
  }, z.core.$strict>, z.ZodObject<{
10580
10757
  target: z.ZodLiteral<"kay.app">;
10581
10758
  slug: z.ZodLiteral<"sessions.create">;
@@ -10933,6 +11110,12 @@ export declare const PluginCapabilityDecisionV1: z.ZodDiscriminatedUnion<[z.ZodO
10933
11110
  target: z.ZodLiteral<"kay.app">;
10934
11111
  slug: z.ZodLiteral<"workspace.command">;
10935
11112
  envelope: z.ZodObject<{}, z.core.$strict>;
11113
+ }, z.core.$strict>, z.ZodObject<{
11114
+ target: z.ZodLiteral<"kay.app">;
11115
+ slug: z.ZodLiteral<"messages.send">;
11116
+ envelope: z.ZodObject<{
11117
+ provider: z.ZodString;
11118
+ }, z.core.$strict>;
10936
11119
  }, z.core.$strict>, z.ZodObject<{
10937
11120
  target: z.ZodLiteral<"kay.app">;
10938
11121
  slug: z.ZodLiteral<"sessions.create">;
@@ -11324,6 +11507,12 @@ export declare const PluginCapabilityRefusalV1: z.ZodObject<{
11324
11507
  target: z.ZodLiteral<"kay.app">;
11325
11508
  slug: z.ZodLiteral<"workspace.command">;
11326
11509
  envelope: z.ZodObject<{}, z.core.$strict>;
11510
+ }, z.core.$strict>, z.ZodObject<{
11511
+ target: z.ZodLiteral<"kay.app">;
11512
+ slug: z.ZodLiteral<"messages.send">;
11513
+ envelope: z.ZodObject<{
11514
+ provider: z.ZodString;
11515
+ }, z.core.$strict>;
11327
11516
  }, z.core.$strict>, z.ZodObject<{
11328
11517
  target: z.ZodLiteral<"kay.app">;
11329
11518
  slug: z.ZodLiteral<"sessions.create">;
@@ -13976,6 +14165,7 @@ export declare const ResolvedKayUiApp: z.ZodObject<{
13976
14165
  "artifacts.preview": "artifacts.preview";
13977
14166
  "markdown.document-view": "markdown.document-view";
13978
14167
  "references.open": "references.open";
14168
+ "files.choose-folder": "files.choose-folder";
13979
14169
  "billing.read": "billing.read";
13980
14170
  "account.read": "account.read";
13981
14171
  "plugins.read": "plugins.read";
@@ -15900,6 +16090,7 @@ export declare const ResolvedPluginContractV1: z.ZodObject<{
15900
16090
  "artifacts.preview": "artifacts.preview";
15901
16091
  "markdown.document-view": "markdown.document-view";
15902
16092
  "references.open": "references.open";
16093
+ "files.choose-folder": "files.choose-folder";
15903
16094
  "billing.read": "billing.read";
15904
16095
  "account.read": "account.read";
15905
16096
  "plugins.read": "plugins.read";
@@ -17806,6 +17997,7 @@ export declare const UiAppCapabilities: z.ZodObject<{
17806
17997
  "artifacts.preview": "artifacts.preview";
17807
17998
  "markdown.document-view": "markdown.document-view";
17808
17999
  "references.open": "references.open";
18000
+ "files.choose-folder": "files.choose-folder";
17809
18001
  "billing.read": "billing.read";
17810
18002
  "account.read": "account.read";
17811
18003
  "plugins.read": "plugins.read";
@@ -17871,6 +18063,7 @@ export declare const UiAppContribution: z.ZodObject<{
17871
18063
  "artifacts.preview": "artifacts.preview";
17872
18064
  "markdown.document-view": "markdown.document-view";
17873
18065
  "references.open": "references.open";
18066
+ "files.choose-folder": "files.choose-folder";
17874
18067
  "billing.read": "billing.read";
17875
18068
  "account.read": "account.read";
17876
18069
  "plugins.read": "plugins.read";
@@ -17926,6 +18119,7 @@ export declare const UiAppContribution: z.ZodObject<{
17926
18119
  "artifacts.preview": "artifacts.preview";
17927
18120
  "markdown.document-view": "markdown.document-view";
17928
18121
  "references.open": "references.open";
18122
+ "files.choose-folder": "files.choose-folder";
17929
18123
  "billing.read": "billing.read";
17930
18124
  "account.read": "account.read";
17931
18125
  "plugins.read": "plugins.read";
@@ -18038,6 +18232,13 @@ export declare const UiRailEntryContribution: z.ZodObject<{
18038
18232
  localId: z.ZodString;
18039
18233
  }, z.core.$strict>]>;
18040
18234
  where: z.ZodOptional<z.ZodString>;
18235
+ also: z.ZodOptional<z.ZodObject<{
18236
+ source: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
18237
+ pluginId: z.ZodString;
18238
+ localId: z.ZodString;
18239
+ }, z.core.$strict>]>;
18240
+ where: z.ZodOptional<z.ZodString>;
18241
+ }, z.core.$strict>>;
18041
18242
  label: z.ZodObject<{
18042
18243
  one: z.ZodOptional<z.ZodString>;
18043
18244
  other: z.ZodString;
@@ -18058,6 +18259,7 @@ export declare const UiSlotContribution: z.ZodObject<{
18058
18259
  localId: z.ZodString;
18059
18260
  slot: z.ZodString;
18060
18261
  title: z.ZodOptional<z.ZodString>;
18262
+ app: z.ZodOptional<z.ZodString>;
18061
18263
  }, z.core.$strict>;
18062
18264
 
18063
18265
  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.9";
263
+ var KAY_PLUGIN_SDK_VERSION = "0.55.11";
264
264
  var KAY_PLUGIN_COMPATIBLE_SDK_VERSIONS = [
265
+ "0.55.10",
266
+ "0.55.9",
265
267
  "0.55.8",
266
268
  "0.55.7",
267
269
  "0.55.6",
@@ -1855,6 +1857,7 @@ var PLUGIN_CAPABILITY_SLUGS = [
1855
1857
  "prompt.resident",
1856
1858
  "skills.declared-source",
1857
1859
  "family-folder.root",
1860
+ "messages.send",
1858
1861
  "whiteboard.discover",
1859
1862
  "whiteboard.read",
1860
1863
  "whiteboard.create",
@@ -2108,6 +2111,14 @@ function createAuthoritySchemas(canonical) {
2108
2111
  slug: z11.literal("workspace.command"),
2109
2112
  envelope: z11.strictObject({})
2110
2113
  }),
2114
+ z11.strictObject({
2115
+ // Prepare and send replies through one provider (`app.messages`). Preparing reads who a
2116
+ // message's reply goes to, so it needs this claim too; sending also needs the person's
2117
+ // command on the plugin's own page.
2118
+ target: z11.literal("kay.app"),
2119
+ slug: z11.literal("messages.send"),
2120
+ envelope: z11.strictObject({ provider: NonEmptyString3.max(100) })
2121
+ }),
2111
2122
  z11.strictObject({
2112
2123
  target: z11.literal("kay.app"),
2113
2124
  slug: z11.literal("sessions.create"),
@@ -2430,6 +2441,8 @@ function sameClaim(a, b) {
2430
2441
  return true;
2431
2442
  case "uri.call":
2432
2443
  return b.slug === "uri.call" && a.envelope.scheme === b.envelope.scheme && a.envelope.verb === b.envelope.verb;
2444
+ case "messages.send":
2445
+ return b.slug === "messages.send" && a.envelope.provider === b.envelope.provider;
2433
2446
  case "endpoints.invoke":
2434
2447
  return b.slug === "endpoints.invoke" && a.envelope.pluginId === b.envelope.pluginId && a.envelope.endpointId === b.envelope.endpointId;
2435
2448
  case "network.connect":
@@ -2531,6 +2544,8 @@ function envelopePairs(a, b) {
2531
2544
  [a.envelope.scheme, b.envelope.scheme],
2532
2545
  [a.envelope.verb, b.envelope.verb]
2533
2546
  ] : [];
2547
+ case "messages.send":
2548
+ return b.slug === "messages.send" ? [[a.envelope.provider, b.envelope.provider]] : [];
2534
2549
  case "endpoints.invoke":
2535
2550
  return b.slug === "endpoints.invoke" ? [
2536
2551
  [a.envelope.pluginId, b.envelope.pluginId],
@@ -4338,7 +4353,12 @@ function createContributionsSchemas(canonical) {
4338
4353
  const UiSlotContribution2 = z14.strictObject({
4339
4354
  localId: LocalContributionId2,
4340
4355
  slot: NonEmptyString3,
4341
- title: NonEmptyString3.optional()
4356
+ title: NonEmptyString3.optional(),
4357
+ /**
4358
+ * The `contextOnly` app in this plugin that fills the slot. Home reads `home.tasks` this way:
4359
+ * it mounts that app in each Home pane.
4360
+ */
4361
+ app: LocalContributionId2.optional()
4342
4362
  });
4343
4363
  const NOT_LOCAL_APP_SCHEMES = /* @__PURE__ */ new Set([
4344
4364
  "http",
@@ -4576,6 +4596,9 @@ function createContributionsSchemas(canonical) {
4576
4596
  // Draws links the host resolves and opens (`BonsaiReferencePill`, `BonsaiReferenceRow`,
4577
4597
  // `BonsaiReferenceMarkdown`). A person's click on one can open a session or another plugin's page.
4578
4598
  "references.open",
4599
+ // Opens the system folder picker when the person acts (`useBonsaiFolderPicker`) and answers
4600
+ // the one folder they chose, or nothing when they cancel. It lists and reads nothing.
4601
+ "files.choose-folder",
4579
4602
  // Server-rated organization billing, distinct from local/provider cost.
4580
4603
  "billing.read",
4581
4604
  "account.read",
@@ -4641,20 +4664,33 @@ function createContributionsSchemas(canonical) {
4641
4664
  const UiRailBadge = z14.strictObject({
4642
4665
  source: UiAppCapabilityReference2,
4643
4666
  where: NonEmptyString3.optional(),
4667
+ /**
4668
+ * A second rows source the count adds, with its own `where`: for a page that tends two kinds
4669
+ * of thing kept by different plugins. The label's `${count}` is the sum.
4670
+ */
4671
+ also: z14.strictObject({
4672
+ source: UiAppCapabilityReference2,
4673
+ where: NonEmptyString3.optional()
4674
+ }).optional(),
4644
4675
  label: z14.strictObject({
4645
4676
  one: NonEmptyString3.optional(),
4646
4677
  other: NonEmptyString3
4647
4678
  })
4648
4679
  }).superRefine((badge, ctx) => {
4649
- if (badge.where === void 0)
4650
- return;
4651
- const parsed = parseWhere(badge.where);
4652
- if (!parsed.ok) {
4653
- ctx.addIssue({
4654
- code: "custom",
4655
- path: ["where"],
4656
- message: `rail badge has an invalid where: ${parsed.message}`
4657
- });
4680
+ for (const [path, where] of [
4681
+ [["where"], badge.where],
4682
+ [["also", "where"], badge.also?.where]
4683
+ ]) {
4684
+ if (where === void 0)
4685
+ continue;
4686
+ const parsed = parseWhere(where);
4687
+ if (!parsed.ok) {
4688
+ ctx.addIssue({
4689
+ code: "custom",
4690
+ path: [...path],
4691
+ message: `rail badge has an invalid where: ${parsed.message}`
4692
+ });
4693
+ }
4658
4694
  }
4659
4695
  });
4660
4696
  const UiRailEntryContribution2 = z14.strictObject({
@@ -5715,12 +5751,17 @@ function createManifestSchemas(canonical) {
5715
5751
  index,
5716
5752
  "badge"
5717
5753
  ];
5718
- if (typeof entry.badge.source === "string" && !declaredRowsStores.has(entry.badge.source)) {
5719
- ctx.addIssue({
5720
- code: "custom",
5721
- path: [...path, "source"],
5722
- message: `rail entry ${entry.id} counts ${entry.badge.source}, which is not one of this plugin's data sources with a rows store`
5723
- });
5754
+ for (const [at, source] of [
5755
+ [["source"], entry.badge.source],
5756
+ [["also", "source"], entry.badge.also?.source]
5757
+ ]) {
5758
+ if (typeof source === "string" && !declaredRowsStores.has(source)) {
5759
+ ctx.addIssue({
5760
+ code: "custom",
5761
+ path: [...path, ...at],
5762
+ message: `rail entry ${entry.id} counts ${source}, which is not one of this plugin's data sources with a rows store`
5763
+ });
5764
+ }
5724
5765
  }
5725
5766
  }
5726
5767
  for (const source of declaredAppDataSources) {
@@ -5782,6 +5823,26 @@ function createManifestSchemas(canonical) {
5782
5823
  });
5783
5824
  }
5784
5825
  }
5826
+ for (const [index, slot] of (manifest.targets?.kay?.ui?.contributes?.slots ?? []).entries()) {
5827
+ if (slot.app === void 0)
5828
+ continue;
5829
+ const app = manifest.targets?.kay?.ui?.contributes?.apps?.find((candidate) => candidate.localId === slot.app);
5830
+ if (app === void 0 || app.contextOnly !== true) {
5831
+ ctx.addIssue({
5832
+ code: "custom",
5833
+ path: [
5834
+ "targets",
5835
+ "kay",
5836
+ "ui",
5837
+ "contributes",
5838
+ "slots",
5839
+ index,
5840
+ "app"
5841
+ ],
5842
+ 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`
5843
+ });
5844
+ }
5845
+ }
5785
5846
  const notificationRuleIds = new Set(manifest.targets?.kay?.app?.contributes?.notificationRules?.map((rule) => rule.localId) ?? []);
5786
5847
  const previewedRules = /* @__PURE__ */ new Set();
5787
5848
  for (const [index, preview] of (manifest.targets?.kay?.ui?.contributes?.toastPreviews ?? []).entries()) {
@@ -8478,10 +8539,32 @@ function isCanonicalArtifactOutputUri(uri) {
8478
8539
  return parseArtifactOutputUri(uri) !== void 0;
8479
8540
  }
8480
8541
  var ArtifactOutputUri = z27.string().refine(isCanonicalArtifactOutputUri, "Expected a canonical output://session/name URI");
8542
+ var ARTIFACT_OUTPUT_FOLDER_MARKS_MAX = 500;
8543
+ var ArtifactOutputVersionState = z27.discriminatedUnion("state", [
8544
+ z27.strictObject({ state: z27.literal("draft") }),
8545
+ z27.strictObject({
8546
+ state: z27.enum(["clean", "edited"]),
8547
+ committedVersion: z27.number().int().positive()
8548
+ })
8549
+ ]);
8550
+ var ArtifactOutputFileFacts = z27.strictObject({
8551
+ sizeBytes: z27.number().finite().nonnegative(),
8552
+ modifiedAtMs: z27.number().finite().nonnegative(),
8553
+ title: z27.string().min(1).max(4096),
8554
+ mimeType: z27.string().min(1).max(255).optional(),
8555
+ versionState: ArtifactOutputVersionState.optional()
8556
+ });
8557
+ var ArtifactOutputFileChange = z27.strictObject({
8558
+ uri: ArtifactOutputUri,
8559
+ kind: z27.enum(["created", "changed", "deleted"]),
8560
+ file: ArtifactOutputFileFacts.optional(),
8561
+ metadataOnly: z27.literal(true).optional()
8562
+ }).refine((change) => change.kind === "deleted" === (change.file === void 0), "A deleted change carries no facts; every other change carries them.");
8481
8563
  var ArtifactOutputChange = z27.union([
8482
8564
  z27.strictObject({
8483
- uris: z27.array(ArtifactOutputUri).min(1).max(ARTIFACT_OUTPUT_PAGE_MAX)
8484
- }),
8565
+ uris: z27.array(ArtifactOutputUri).min(1).max(ARTIFACT_OUTPUT_PAGE_MAX),
8566
+ changes: z27.array(ArtifactOutputFileChange).min(1).max(ARTIFACT_OUTPUT_PAGE_MAX).optional()
8567
+ }).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."),
8485
8568
  z27.strictObject({ sessionId: Segment })
8486
8569
  ]);
8487
8570
 
@@ -8583,6 +8666,7 @@ export {
8583
8666
  AGENT_RUNTIME_SESSION_CREATOR_KINDS,
8584
8667
  APPROVAL_ANSWERS,
8585
8668
  APPROVAL_KINDS,
8669
+ ARTIFACT_OUTPUT_FOLDER_MARKS_MAX,
8586
8670
  ARTIFACT_OUTPUT_PAGE_MAX,
8587
8671
  ARTIFACT_PROVENANCE_VERSION,
8588
8672
  AccessApprovalReview,
@@ -8601,7 +8685,10 @@ export {
8601
8685
  ApprovalTypeContribution,
8602
8686
  ArtifactGenerationId,
8603
8687
  ArtifactOutputChange,
8688
+ ArtifactOutputFileChange,
8689
+ ArtifactOutputFileFacts,
8604
8690
  ArtifactOutputUri,
8691
+ ArtifactOutputVersionState,
8605
8692
  ArtifactProvenanceActor,
8606
8693
  ArtifactProvenanceCaptureContextSchema,
8607
8694
  ArtifactProvenanceCause,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yaklabs-ai/plugin-protocol",
3
- "version": "0.55.9",
3
+ "version": "0.55.11",
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",