@yaklabs-ai/plugin-protocol 0.35.0 → 0.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -11,7 +11,7 @@ flow.
11
11
  ```json
12
12
  {
13
13
  "dependencies": {
14
- "@bonsai/plugin-protocol": "npm:@yaklabs-ai/plugin-protocol@^0.35.0"
14
+ "@bonsai/plugin-protocol": "npm:@yaklabs-ai/plugin-protocol@^0.37.0"
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.35.0",
4
+ "version": "0.37.0",
5
5
  "target": "npm",
6
6
  "firstPartyLicense": "MIT",
7
7
  "bundled": [],
package/dist/index.d.ts CHANGED
@@ -1683,11 +1683,14 @@ declare namespace authoringContributionSchemas {
1683
1683
  ReferencePresentationUriPattern,
1684
1684
  ReferencePresentationUrlClaim,
1685
1685
  ReferencePresentationTooltip,
1686
+ ReferencePresentationAddress,
1686
1687
  ReferencePresentationContribution,
1687
1688
  RichViewContribution,
1688
1689
  KayUiAppHostCapability,
1689
1690
  UiAppCapabilities,
1690
1691
  UiRailEntryContribution,
1692
+ UiToastPreviewContribution,
1693
+ UiPageContribution,
1691
1694
  UiAppContribution,
1692
1695
  ThemeContribution,
1693
1696
  CommandHandler,
@@ -2665,9 +2668,34 @@ declare const canonicalContributionSchemas: {
2665
2668
  search: z.ZodOptional<z.ZodString>;
2666
2669
  }, z.core.$strict>;
2667
2670
  }, z.core.$strict>;
2671
+ ReferencePresentationAddress: z.ZodObject<{
2672
+ pattern: z.ZodObject<{
2673
+ protocol: z.ZodString;
2674
+ hostname: z.ZodString;
2675
+ pathname: z.ZodOptional<z.ZodString>;
2676
+ search: z.ZodOptional<z.ZodString>;
2677
+ }, z.core.$strict>;
2678
+ objectId: z.ZodOptional<z.ZodString>;
2679
+ open: z.ZodOptional<z.ZodObject<{
2680
+ kind: z.ZodLiteral<"none">;
2681
+ }, z.core.$strict>>;
2682
+ }, z.core.$strict>;
2668
2683
  ReferencePresentationContribution: z.ZodObject<{
2669
2684
  localId: z.ZodString;
2670
- uriModule: z.ZodString;
2685
+ uriModule: z.ZodOptional<z.ZodString>;
2686
+ scheme: z.ZodOptional<z.ZodString>;
2687
+ addresses: z.ZodOptional<z.ZodArray<z.ZodObject<{
2688
+ pattern: z.ZodObject<{
2689
+ protocol: z.ZodString;
2690
+ hostname: z.ZodString;
2691
+ pathname: z.ZodOptional<z.ZodString>;
2692
+ search: z.ZodOptional<z.ZodString>;
2693
+ }, z.core.$strict>;
2694
+ objectId: z.ZodOptional<z.ZodString>;
2695
+ open: z.ZodOptional<z.ZodObject<{
2696
+ kind: z.ZodLiteral<"none">;
2697
+ }, z.core.$strict>>;
2698
+ }, z.core.$strict>>>;
2671
2699
  resourceKind: z.ZodString;
2672
2700
  open: z.ZodDiscriminatedUnion<[z.ZodObject<{
2673
2701
  kind: z.ZodLiteral<"working-document">;
@@ -2714,6 +2742,7 @@ declare const canonicalContributionSchemas: {
2714
2742
  "sessions.create": "sessions.create";
2715
2743
  "artifacts.read": "artifacts.read";
2716
2744
  "artifacts.preview": "artifacts.preview";
2745
+ "markdown.document-view": "markdown.document-view";
2717
2746
  "cost.read": "cost.read";
2718
2747
  "billing.read": "billing.read";
2719
2748
  "skills.read": "skills.read";
@@ -2733,6 +2762,7 @@ declare const canonicalContributionSchemas: {
2733
2762
  "sessions.create": "sessions.create";
2734
2763
  "artifacts.read": "artifacts.read";
2735
2764
  "artifacts.preview": "artifacts.preview";
2765
+ "markdown.document-view": "markdown.document-view";
2736
2766
  "cost.read": "cost.read";
2737
2767
  "billing.read": "billing.read";
2738
2768
  "skills.read": "skills.read";
@@ -2770,6 +2800,18 @@ declare const canonicalContributionSchemas: {
2770
2800
  body: z.ZodString;
2771
2801
  }, z.core.$strict>>;
2772
2802
  }, z.core.$strict>;
2803
+ UiToastPreviewContribution: z.ZodObject<{
2804
+ rule: z.ZodString;
2805
+ body: z.ZodString;
2806
+ address: z.ZodString;
2807
+ }, z.core.$strict>;
2808
+ UiPageContribution: z.ZodObject<{
2809
+ id: z.ZodString;
2810
+ title: z.ZodOptional<z.ZodString>;
2811
+ icon: z.ZodOptional<z.ZodString>;
2812
+ companion: z.ZodOptional<z.ZodBoolean>;
2813
+ openedEvent: z.ZodOptional<z.ZodString>;
2814
+ }, z.core.$strict>;
2773
2815
  UiAppContribution: z.ZodObject<{
2774
2816
  localId: z.ZodString;
2775
2817
  displayName: z.ZodString;
@@ -2793,6 +2835,7 @@ declare const canonicalContributionSchemas: {
2793
2835
  "sessions.create": "sessions.create";
2794
2836
  "artifacts.read": "artifacts.read";
2795
2837
  "artifacts.preview": "artifacts.preview";
2838
+ "markdown.document-view": "markdown.document-view";
2796
2839
  "cost.read": "cost.read";
2797
2840
  "billing.read": "billing.read";
2798
2841
  "skills.read": "skills.read";
@@ -2829,6 +2872,7 @@ declare const canonicalContributionSchemas: {
2829
2872
  "sessions.create": "sessions.create";
2830
2873
  "artifacts.read": "artifacts.read";
2831
2874
  "artifacts.preview": "artifacts.preview";
2875
+ "markdown.document-view": "markdown.document-view";
2832
2876
  "cost.read": "cost.read";
2833
2877
  "billing.read": "billing.read";
2834
2878
  "skills.read": "skills.read";
@@ -3193,6 +3237,17 @@ export declare interface DeclaredKayPluginCompatibility {
3193
3237
  readonly sdk?: string | undefined;
3194
3238
  }
3195
3239
 
3240
+ /**
3241
+ * Every plugin's reference presentations. The daemon delivers this one kind from the resolved
3242
+ * contract rather than the manifest, so its rows carry `schemes`.
3243
+ */
3244
+ export declare function declaredReferencePresentations<TPlugin extends {
3245
+ readonly contributes: Readonly<Record<string, unknown>>;
3246
+ }>(plugins: readonly TPlugin[]): readonly {
3247
+ readonly plugin: TPlugin;
3248
+ readonly declaration: ResolvedReferencePresentation;
3249
+ }[];
3250
+
3196
3251
  export declare const DeclaredSkillSourceEnvelope: z.ZodDiscriminatedUnion<[z.ZodObject<{
3197
3252
  channel: z.ZodLiteral<"git-clone">;
3198
3253
  locator: z.ZodString;
@@ -4087,8 +4142,18 @@ export declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
4087
4142
  * names one of the plugin's `rows` data sources, an optional `where` and a plural `label`.
4088
4143
  * `app.skills` gains `listPendingSuggestions` and `subscribeSuggestions` under `skills.read`. A plugin
4089
4144
  * that declares a badge declares ^0.35.0.
4145
+ *
4146
+ * 0.36.0 lets a plugin declare its pages and which page an address opens (#15897, #15898). `pages`
4147
+ * under `kay.ui` `contributes` names each page's title, icon file, companion status and opened
4148
+ * event. A reference presentation that opens a page gains `scheme` and `addresses`, and may leave
4149
+ * out `uriModule` when another layer serves the address. A plugin using these declares ^0.36.0.
4150
+ *
4151
+ * 0.37.0 lets a notification rule's toast declare a preview (#15904). `toastPreviews` under `kay.ui`
4152
+ * `contributes` names the `rule`, the `body` that fills the preview, either a `contextOnly` app in
4153
+ * the plugin or a body the host ships, and the `address` it is about. Additive. A plugin that
4154
+ * declares a preview declares ^0.37.0.
4090
4155
  */
4091
- export declare const KAY_PLUGIN_SDK_VERSION: "0.35.0";
4156
+ export declare const KAY_PLUGIN_SDK_VERSION: "0.37.0";
4092
4157
 
4093
4158
  export declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
4094
4159
 
@@ -5576,7 +5641,20 @@ export declare const KayPluginManifestV1: z.ZodObject<{
5576
5641
  }, z.core.$strict>>>;
5577
5642
  referencePresentations: z.ZodOptional<z.ZodArray<z.ZodObject<{
5578
5643
  localId: z.ZodString;
5579
- uriModule: z.ZodString;
5644
+ uriModule: z.ZodOptional<z.ZodString>;
5645
+ scheme: z.ZodOptional<z.ZodString>;
5646
+ addresses: z.ZodOptional<z.ZodArray<z.ZodObject<{
5647
+ pattern: z.ZodObject<{
5648
+ protocol: z.ZodString;
5649
+ hostname: z.ZodString;
5650
+ pathname: z.ZodOptional<z.ZodString>;
5651
+ search: z.ZodOptional<z.ZodString>;
5652
+ }, z.core.$strict>;
5653
+ objectId: z.ZodOptional<z.ZodString>;
5654
+ open: z.ZodOptional<z.ZodObject<{
5655
+ kind: z.ZodLiteral<"none">;
5656
+ }, z.core.$strict>>;
5657
+ }, z.core.$strict>>>;
5580
5658
  resourceKind: z.ZodString;
5581
5659
  open: z.ZodDiscriminatedUnion<[z.ZodObject<{
5582
5660
  kind: z.ZodLiteral<"working-document">;
@@ -5641,6 +5719,7 @@ export declare const KayPluginManifestV1: z.ZodObject<{
5641
5719
  "sessions.create": "sessions.create";
5642
5720
  "artifacts.read": "artifacts.read";
5643
5721
  "artifacts.preview": "artifacts.preview";
5722
+ "markdown.document-view": "markdown.document-view";
5644
5723
  "cost.read": "cost.read";
5645
5724
  "billing.read": "billing.read";
5646
5725
  "skills.read": "skills.read";
@@ -5677,6 +5756,7 @@ export declare const KayPluginManifestV1: z.ZodObject<{
5677
5756
  "sessions.create": "sessions.create";
5678
5757
  "artifacts.read": "artifacts.read";
5679
5758
  "artifacts.preview": "artifacts.preview";
5759
+ "markdown.document-view": "markdown.document-view";
5680
5760
  "cost.read": "cost.read";
5681
5761
  "billing.read": "billing.read";
5682
5762
  "skills.read": "skills.read";
@@ -5715,6 +5795,18 @@ export declare const KayPluginManifestV1: z.ZodObject<{
5715
5795
  body: z.ZodString;
5716
5796
  }, z.core.$strict>>;
5717
5797
  }, z.core.$strict>>>;
5798
+ toastPreviews: z.ZodOptional<z.ZodArray<z.ZodObject<{
5799
+ rule: z.ZodString;
5800
+ body: z.ZodString;
5801
+ address: z.ZodString;
5802
+ }, z.core.$strict>>>;
5803
+ pages: z.ZodOptional<z.ZodArray<z.ZodObject<{
5804
+ id: z.ZodString;
5805
+ title: z.ZodOptional<z.ZodString>;
5806
+ icon: z.ZodOptional<z.ZodString>;
5807
+ companion: z.ZodOptional<z.ZodBoolean>;
5808
+ openedEvent: z.ZodOptional<z.ZodString>;
5809
+ }, z.core.$strict>>>;
5718
5810
  themes: z.ZodOptional<z.ZodArray<z.ZodObject<{
5719
5811
  localId: z.ZodString;
5720
5812
  displayName: z.ZodString;
@@ -6535,6 +6627,7 @@ export declare const KayUiAppHostCapability: z.ZodEnum<{
6535
6627
  "sessions.create": "sessions.create";
6536
6628
  "artifacts.read": "artifacts.read";
6537
6629
  "artifacts.preview": "artifacts.preview";
6630
+ "markdown.document-view": "markdown.document-view";
6538
6631
  "cost.read": "cost.read";
6539
6632
  "billing.read": "billing.read";
6540
6633
  "skills.read": "skills.read";
@@ -6681,7 +6774,20 @@ export declare const KayUiTargetManifest: z.ZodObject<{
6681
6774
  }, z.core.$strict>>>;
6682
6775
  referencePresentations: z.ZodOptional<z.ZodArray<z.ZodObject<{
6683
6776
  localId: z.ZodString;
6684
- uriModule: z.ZodString;
6777
+ uriModule: z.ZodOptional<z.ZodString>;
6778
+ scheme: z.ZodOptional<z.ZodString>;
6779
+ addresses: z.ZodOptional<z.ZodArray<z.ZodObject<{
6780
+ pattern: z.ZodObject<{
6781
+ protocol: z.ZodString;
6782
+ hostname: z.ZodString;
6783
+ pathname: z.ZodOptional<z.ZodString>;
6784
+ search: z.ZodOptional<z.ZodString>;
6785
+ }, z.core.$strict>;
6786
+ objectId: z.ZodOptional<z.ZodString>;
6787
+ open: z.ZodOptional<z.ZodObject<{
6788
+ kind: z.ZodLiteral<"none">;
6789
+ }, z.core.$strict>>;
6790
+ }, z.core.$strict>>>;
6685
6791
  resourceKind: z.ZodString;
6686
6792
  open: z.ZodDiscriminatedUnion<[z.ZodObject<{
6687
6793
  kind: z.ZodLiteral<"working-document">;
@@ -6746,6 +6852,7 @@ export declare const KayUiTargetManifest: z.ZodObject<{
6746
6852
  "sessions.create": "sessions.create";
6747
6853
  "artifacts.read": "artifacts.read";
6748
6854
  "artifacts.preview": "artifacts.preview";
6855
+ "markdown.document-view": "markdown.document-view";
6749
6856
  "cost.read": "cost.read";
6750
6857
  "billing.read": "billing.read";
6751
6858
  "skills.read": "skills.read";
@@ -6782,6 +6889,7 @@ export declare const KayUiTargetManifest: z.ZodObject<{
6782
6889
  "sessions.create": "sessions.create";
6783
6890
  "artifacts.read": "artifacts.read";
6784
6891
  "artifacts.preview": "artifacts.preview";
6892
+ "markdown.document-view": "markdown.document-view";
6785
6893
  "cost.read": "cost.read";
6786
6894
  "billing.read": "billing.read";
6787
6895
  "skills.read": "skills.read";
@@ -6820,6 +6928,18 @@ export declare const KayUiTargetManifest: z.ZodObject<{
6820
6928
  body: z.ZodString;
6821
6929
  }, z.core.$strict>>;
6822
6930
  }, z.core.$strict>>>;
6931
+ toastPreviews: z.ZodOptional<z.ZodArray<z.ZodObject<{
6932
+ rule: z.ZodString;
6933
+ body: z.ZodString;
6934
+ address: z.ZodString;
6935
+ }, z.core.$strict>>>;
6936
+ pages: z.ZodOptional<z.ZodArray<z.ZodObject<{
6937
+ id: z.ZodString;
6938
+ title: z.ZodOptional<z.ZodString>;
6939
+ icon: z.ZodOptional<z.ZodString>;
6940
+ companion: z.ZodOptional<z.ZodBoolean>;
6941
+ openedEvent: z.ZodOptional<z.ZodString>;
6942
+ }, z.core.$strict>>>;
6823
6943
  themes: z.ZodOptional<z.ZodArray<z.ZodObject<{
6824
6944
  localId: z.ZodString;
6825
6945
  displayName: z.ZodString;
@@ -10213,9 +10333,37 @@ export declare const ReferenceOpenBehavior: z.ZodDiscriminatedUnion<[z.ZodObject
10213
10333
 
10214
10334
  export declare type ReferenceOpenBehavior = z.infer<typeof ReferenceOpenBehavior>;
10215
10335
 
10336
+ export declare const ReferencePresentationAddress: z.ZodObject<{
10337
+ pattern: z.ZodObject<{
10338
+ protocol: z.ZodString;
10339
+ hostname: z.ZodString;
10340
+ pathname: z.ZodOptional<z.ZodString>;
10341
+ search: z.ZodOptional<z.ZodString>;
10342
+ }, z.core.$strict>;
10343
+ objectId: z.ZodOptional<z.ZodString>;
10344
+ open: z.ZodOptional<z.ZodObject<{
10345
+ kind: z.ZodLiteral<"none">;
10346
+ }, z.core.$strict>>;
10347
+ }, z.core.$strict>;
10348
+
10349
+ export declare type ReferencePresentationAddress = z.infer<typeof ReferencePresentationAddress>;
10350
+
10216
10351
  export declare const ReferencePresentationContribution: z.ZodObject<{
10217
10352
  localId: z.ZodString;
10218
- uriModule: z.ZodString;
10353
+ uriModule: z.ZodOptional<z.ZodString>;
10354
+ scheme: z.ZodOptional<z.ZodString>;
10355
+ addresses: z.ZodOptional<z.ZodArray<z.ZodObject<{
10356
+ pattern: z.ZodObject<{
10357
+ protocol: z.ZodString;
10358
+ hostname: z.ZodString;
10359
+ pathname: z.ZodOptional<z.ZodString>;
10360
+ search: z.ZodOptional<z.ZodString>;
10361
+ }, z.core.$strict>;
10362
+ objectId: z.ZodOptional<z.ZodString>;
10363
+ open: z.ZodOptional<z.ZodObject<{
10364
+ kind: z.ZodLiteral<"none">;
10365
+ }, z.core.$strict>>;
10366
+ }, z.core.$strict>>>;
10219
10367
  resourceKind: z.ZodString;
10220
10368
  open: z.ZodDiscriminatedUnion<[z.ZodObject<{
10221
10369
  kind: z.ZodLiteral<"working-document">;
@@ -10882,6 +11030,7 @@ export declare const ResolvedKayUiApp: z.ZodObject<{
10882
11030
  "sessions.create": "sessions.create";
10883
11031
  "artifacts.read": "artifacts.read";
10884
11032
  "artifacts.preview": "artifacts.preview";
11033
+ "markdown.document-view": "markdown.document-view";
10885
11034
  "cost.read": "cost.read";
10886
11035
  "billing.read": "billing.read";
10887
11036
  "skills.read": "skills.read";
@@ -12110,7 +12259,20 @@ export declare const ResolvedPluginContractV1: z.ZodObject<{
12110
12259
  referencePresentations: z.ZodOptional<z.ZodArray<z.ZodObject<{
12111
12260
  localId: z.ZodString;
12112
12261
  globalId: z.ZodString;
12113
- uriModule: z.ZodString;
12262
+ uriModule: z.ZodOptional<z.ZodString>;
12263
+ schemes: z.ZodOptional<z.ZodArray<z.ZodString>>;
12264
+ addresses: z.ZodOptional<z.ZodArray<z.ZodObject<{
12265
+ pattern: z.ZodObject<{
12266
+ protocol: z.ZodString;
12267
+ hostname: z.ZodString;
12268
+ pathname: z.ZodOptional<z.ZodString>;
12269
+ search: z.ZodOptional<z.ZodString>;
12270
+ }, z.core.$strict>;
12271
+ objectId: z.ZodOptional<z.ZodString>;
12272
+ open: z.ZodOptional<z.ZodObject<{
12273
+ kind: z.ZodLiteral<"none">;
12274
+ }, z.core.$strict>>;
12275
+ }, z.core.$strict>>>;
12114
12276
  resourceKind: z.ZodString;
12115
12277
  open: z.ZodDiscriminatedUnion<[z.ZodObject<{
12116
12278
  kind: z.ZodLiteral<"working-document">;
@@ -12174,6 +12336,7 @@ export declare const ResolvedPluginContractV1: z.ZodObject<{
12174
12336
  "sessions.create": "sessions.create";
12175
12337
  "artifacts.read": "artifacts.read";
12176
12338
  "artifacts.preview": "artifacts.preview";
12339
+ "markdown.document-view": "markdown.document-view";
12177
12340
  "cost.read": "cost.read";
12178
12341
  "billing.read": "billing.read";
12179
12342
  "skills.read": "skills.read";
@@ -12576,7 +12739,20 @@ export declare type ResolvedPluginWebSession = z.infer<typeof ResolvedPluginWebS
12576
12739
  export declare const ResolvedReferencePresentation: z.ZodObject<{
12577
12740
  localId: z.ZodString;
12578
12741
  globalId: z.ZodString;
12579
- uriModule: z.ZodString;
12742
+ uriModule: z.ZodOptional<z.ZodString>;
12743
+ schemes: z.ZodOptional<z.ZodArray<z.ZodString>>;
12744
+ addresses: z.ZodOptional<z.ZodArray<z.ZodObject<{
12745
+ pattern: z.ZodObject<{
12746
+ protocol: z.ZodString;
12747
+ hostname: z.ZodString;
12748
+ pathname: z.ZodOptional<z.ZodString>;
12749
+ search: z.ZodOptional<z.ZodString>;
12750
+ }, z.core.$strict>;
12751
+ objectId: z.ZodOptional<z.ZodString>;
12752
+ open: z.ZodOptional<z.ZodObject<{
12753
+ kind: z.ZodLiteral<"none">;
12754
+ }, z.core.$strict>>;
12755
+ }, z.core.$strict>>>;
12580
12756
  resourceKind: z.ZodString;
12581
12757
  open: z.ZodDiscriminatedUnion<[z.ZodObject<{
12582
12758
  kind: z.ZodLiteral<"working-document">;
@@ -13761,6 +13937,7 @@ export declare const UiAppCapabilities: z.ZodObject<{
13761
13937
  "sessions.create": "sessions.create";
13762
13938
  "artifacts.read": "artifacts.read";
13763
13939
  "artifacts.preview": "artifacts.preview";
13940
+ "markdown.document-view": "markdown.document-view";
13764
13941
  "cost.read": "cost.read";
13765
13942
  "billing.read": "billing.read";
13766
13943
  "skills.read": "skills.read";
@@ -13800,6 +13977,7 @@ export declare const UiAppContribution: z.ZodObject<{
13800
13977
  "sessions.create": "sessions.create";
13801
13978
  "artifacts.read": "artifacts.read";
13802
13979
  "artifacts.preview": "artifacts.preview";
13980
+ "markdown.document-view": "markdown.document-view";
13803
13981
  "cost.read": "cost.read";
13804
13982
  "billing.read": "billing.read";
13805
13983
  "skills.read": "skills.read";
@@ -13836,6 +14014,7 @@ export declare const UiAppContribution: z.ZodObject<{
13836
14014
  "sessions.create": "sessions.create";
13837
14015
  "artifacts.read": "artifacts.read";
13838
14016
  "artifacts.preview": "artifacts.preview";
14017
+ "markdown.document-view": "markdown.document-view";
13839
14018
  "cost.read": "cost.read";
13840
14019
  "billing.read": "billing.read";
13841
14020
  "skills.read": "skills.read";
@@ -13877,6 +14056,16 @@ export declare const UiEventSubscriptionContribution: z.ZodObject<{
13877
14056
 
13878
14057
  export declare type UiEventSubscriptionContribution = z.infer<typeof UiEventSubscriptionContribution>;
13879
14058
 
14059
+ export declare const UiPageContribution: z.ZodObject<{
14060
+ id: z.ZodString;
14061
+ title: z.ZodOptional<z.ZodString>;
14062
+ icon: z.ZodOptional<z.ZodString>;
14063
+ companion: z.ZodOptional<z.ZodBoolean>;
14064
+ openedEvent: z.ZodOptional<z.ZodString>;
14065
+ }, z.core.$strict>;
14066
+
14067
+ export declare type UiPageContribution = z.infer<typeof UiPageContribution>;
14068
+
13880
14069
  export declare const UiRailEntryContribution: z.ZodObject<{
13881
14070
  id: z.ZodString;
13882
14071
  title: z.ZodString;
@@ -13912,6 +14101,14 @@ export declare const UiSlotContribution: z.ZodObject<{
13912
14101
 
13913
14102
  export declare type UiSlotContribution = z.infer<typeof UiSlotContribution>;
13914
14103
 
14104
+ export declare const UiToastPreviewContribution: z.ZodObject<{
14105
+ rule: z.ZodString;
14106
+ body: z.ZodString;
14107
+ address: z.ZodString;
14108
+ }, z.core.$strict>;
14109
+
14110
+ export declare type UiToastPreviewContribution = z.infer<typeof UiToastPreviewContribution>;
14111
+
13915
14112
  export declare const UriModuleContribution: z.ZodObject<{
13916
14113
  authService: z.ZodOptional<z.ZodString>;
13917
14114
  authScheme: z.ZodOptional<z.ZodString>;
package/dist/index.js CHANGED
@@ -30,6 +30,7 @@ function declaredUiIconPaths(manifest) {
30
30
  const contributes = manifest.targets?.kay?.ui?.contributes;
31
31
  return [
32
32
  ...(contributes?.railEntries ?? []).flatMap((entry) => entry.icon === void 0 ? [] : [{ label: `kay.ui rail entry '${entry.id}' icon`, path: entry.icon }]),
33
+ ...(contributes?.pages ?? []).flatMap((page) => page.icon === void 0 ? [] : [{ label: `kay.ui page '${page.id}' icon`, path: page.icon }]),
33
34
  ...(contributes?.commands ?? []).flatMap((command) => command.icon === void 0 ? [] : [
34
35
  {
35
36
  label: `kay.ui command '${command.localId}' icon`,
@@ -253,7 +254,7 @@ var JsonSchema = z4.record(z4.string(), JsonValue);
253
254
  var KAY_PLUGIN_MANIFEST_SIZE_CAP_BYTES = 1024 * 1024;
254
255
  var KAY_PLUGIN_PROTOCOL_VERSION = "kay.plugin.v1";
255
256
  var KAY_PLUGIN_PROTOCOL_PACKAGE_NAME = "@bonsai/plugin-protocol";
256
- var KAY_PLUGIN_SDK_VERSION = "0.35.0";
257
+ var KAY_PLUGIN_SDK_VERSION = "0.37.0";
257
258
  var KAY_PLUGIN_COMPATIBLE_SDK_VERSIONS = [
258
259
  "0.26.3",
259
260
  "0.27.1",
@@ -263,7 +264,9 @@ var KAY_PLUGIN_COMPATIBLE_SDK_VERSIONS = [
263
264
  "0.31.0",
264
265
  "0.32.0",
265
266
  "0.33.0",
266
- "0.34.0"
267
+ "0.34.0",
268
+ "0.35.0",
269
+ "0.36.0"
267
270
  ];
268
271
  var KAY_PLUGIN_TARGET_NAMES = [
269
272
  "kay.agent",
@@ -2736,6 +2739,7 @@ __export(contributions_exports, {
2736
2739
  PluginNotificationRuleContribution: () => PluginNotificationRuleContribution,
2737
2740
  PluginSkillSourceDeclaration: () => PluginSkillSourceDeclaration,
2738
2741
  ReferenceOpenBehavior: () => ReferenceOpenBehavior,
2742
+ ReferencePresentationAddress: () => ReferencePresentationAddress,
2739
2743
  ReferencePresentationContribution: () => ReferencePresentationContribution,
2740
2744
  ReferencePresentationTooltip: () => ReferencePresentationTooltip,
2741
2745
  ReferencePresentationUriPattern: () => ReferencePresentationUriPattern,
@@ -2756,8 +2760,10 @@ __export(contributions_exports, {
2756
2760
  UiAppContribution: () => UiAppContribution,
2757
2761
  UiCommandContribution: () => UiCommandContribution,
2758
2762
  UiEventSubscriptionContribution: () => UiEventSubscriptionContribution,
2763
+ UiPageContribution: () => UiPageContribution,
2759
2764
  UiRailEntryContribution: () => UiRailEntryContribution,
2760
2765
  UiSlotContribution: () => UiSlotContribution,
2766
+ UiToastPreviewContribution: () => UiToastPreviewContribution,
2761
2767
  UriModuleContribution: () => UriModuleContribution,
2762
2768
  UriModuleFacts: () => UriModuleFacts,
2763
2769
  WhiteboardTypeContribution: () => WhiteboardTypeContribution,
@@ -3012,6 +3018,9 @@ function declarationsOfKind(plugins, kind) {
3012
3018
  declaration
3013
3019
  })));
3014
3020
  }
3021
+ function declaredReferencePresentations(plugins) {
3022
+ return plugins.flatMap((plugin) => (plugin.contributes["referencePresentations"] ?? []).map((declaration) => ({ plugin, declaration })));
3023
+ }
3015
3024
  function declaredCommandId(pluginId, localId) {
3016
3025
  return `${pluginId}/${localId}`;
3017
3026
  }
@@ -3647,9 +3656,9 @@ function createContributionsSchemas(canonical) {
3647
3656
  z12.strictObject({ kind: z12.literal("working-document") }),
3648
3657
  z12.strictObject({ kind: z12.literal("browser-pane") }),
3649
3658
  /**
3650
- * Open one of the presenting plugin's OWN registered pages (`registerPage`'s
3651
- * descriptor id) with the reference's canonical URI as the page's `objectId`.
3652
- * Needs no web address, so a plugin-only resource (`user-todo://items/3`) can pill.
3659
+ * Open one of the pages this manifest declares in `pages`. The window answers this from the
3660
+ * manifest, and the page gets the whole address as its `objectId` unless `addresses` says
3661
+ * otherwise. Needs no web address, so a plugin-only resource (`user-todo://items/3`) can pill.
3653
3662
  */
3654
3663
  z12.strictObject({ kind: z12.literal("page"), pageId: NonEmptyString3 })
3655
3664
  ]);
@@ -3677,9 +3686,23 @@ function createContributionsSchemas(canonical) {
3677
3686
  app: LocalContributionId2,
3678
3687
  pattern: ReferencePresentationUriPattern2
3679
3688
  });
3689
+ const ReferencePresentationAddress2 = z12.strictObject({
3690
+ pattern: ReferencePresentationUriPattern2,
3691
+ objectId: NonEmptyString3.optional(),
3692
+ open: z12.strictObject({ kind: z12.literal("none") }).optional()
3693
+ });
3680
3694
  const ReferencePresentationContribution2 = z12.strictObject({
3681
3695
  localId: LocalContributionId2,
3682
- uriModule: LocalContributionId2,
3696
+ /** This manifest's URI module. Leave it out only for an address another layer serves. */
3697
+ uriModule: LocalContributionId2.optional(),
3698
+ /**
3699
+ * The scheme this presentation opens, for an address with no module in this manifest. A
3700
+ * module's own schemes are filled in for the window. Every address of the scheme with something
3701
+ * after `://` opens the page, unless `addresses` narrows it.
3702
+ */
3703
+ scheme: UriScheme2.optional(),
3704
+ /** Which of the addresses open the page, and on what. Read by the window. */
3705
+ addresses: z12.array(ReferencePresentationAddress2).min(1).optional(),
3683
3706
  resourceKind: NonEmptyString3,
3684
3707
  open: ReferenceOpenBehavior2,
3685
3708
  /** MIME-specific resource kinds; absent keys use the base presentation. */
@@ -3696,6 +3719,38 @@ function createContributionsSchemas(canonical) {
3696
3719
  message: "URL claims require browser-pane opening."
3697
3720
  });
3698
3721
  }
3722
+ if (value.uriModule === void 0 && value.scheme === void 0) {
3723
+ ctx.addIssue({
3724
+ code: "custom",
3725
+ path: ["uriModule"],
3726
+ message: "A reference presentation names a uriModule or a scheme."
3727
+ });
3728
+ }
3729
+ if ((value.scheme !== void 0 || value.addresses !== void 0) && value.open.kind !== "page") {
3730
+ ctx.addIssue({
3731
+ code: "custom",
3732
+ path: ["open"],
3733
+ message: "scheme and addresses require page opening."
3734
+ });
3735
+ }
3736
+ if (value.tooltip !== void 0 && value.open.kind === "page") {
3737
+ ctx.addIssue({
3738
+ code: "custom",
3739
+ path: ["tooltip"],
3740
+ message: "A presentation that opens a page has no tooltip."
3741
+ });
3742
+ }
3743
+ const protocols = [
3744
+ ...value.scheme === void 0 ? [] : [value.scheme],
3745
+ ...(value.addresses ?? []).map((row) => row.pattern.protocol)
3746
+ ];
3747
+ if (protocols.some((protocol) => /^https?:?$/iu.test(protocol))) {
3748
+ ctx.addIssue({
3749
+ code: "custom",
3750
+ path: ["addresses"],
3751
+ message: "A web link never opens a page: use a plugin scheme."
3752
+ });
3753
+ }
3699
3754
  });
3700
3755
  const RichViewContribution2 = z12.strictObject({
3701
3756
  localId: LocalContributionId2,
@@ -3709,6 +3764,9 @@ function createContributionsSchemas(canonical) {
3709
3764
  "sessions.create",
3710
3765
  "artifacts.read",
3711
3766
  "artifacts.preview",
3767
+ // Draws Bonsai's markdown document view in the app's page (`BonsaiMarkdownDocumentView`).
3768
+ // It reads and saves nothing: the app supplies the text and keeps the edits.
3769
+ "markdown.document-view",
3712
3770
  "cost.read",
3713
3771
  // Server-rated organization billing, distinct from local/provider cost.
3714
3772
  "billing.read",
@@ -3787,6 +3845,18 @@ function createContributionsSchemas(canonical) {
3787
3845
  badge: UiRailBadge.optional(),
3788
3846
  panel: z12.strictObject({ body: LocalContributionId2 }).optional()
3789
3847
  });
3848
+ const UiToastPreviewContribution2 = z12.strictObject({
3849
+ rule: LocalContributionId2,
3850
+ body: LocalContributionId2,
3851
+ address: NonEmptyString3
3852
+ });
3853
+ const UiPageContribution2 = z12.strictObject({
3854
+ id: NonEmptyString3,
3855
+ title: NonEmptyString3.optional(),
3856
+ icon: PackageAssetPath2.optional(),
3857
+ companion: z12.boolean().optional(),
3858
+ openedEvent: NonEmptyString3.optional()
3859
+ });
3790
3860
  const UiAppFields = z12.strictObject({
3791
3861
  localId: LocalContributionId2,
3792
3862
  displayName: NonEmptyString3,
@@ -3923,11 +3993,14 @@ function createContributionsSchemas(canonical) {
3923
3993
  ReferencePresentationUriPattern: ReferencePresentationUriPattern2,
3924
3994
  ReferencePresentationUrlClaim: ReferencePresentationUrlClaim2,
3925
3995
  ReferencePresentationTooltip: ReferencePresentationTooltip2,
3996
+ ReferencePresentationAddress: ReferencePresentationAddress2,
3926
3997
  ReferencePresentationContribution: ReferencePresentationContribution2,
3927
3998
  RichViewContribution: RichViewContribution2,
3928
3999
  KayUiAppHostCapability: KayUiAppHostCapability2,
3929
4000
  UiAppCapabilities: UiAppCapabilities2,
3930
4001
  UiRailEntryContribution: UiRailEntryContribution2,
4002
+ UiToastPreviewContribution: UiToastPreviewContribution2,
4003
+ UiPageContribution: UiPageContribution2,
3931
4004
  UiAppContribution: UiAppContribution2,
3932
4005
  ThemeContribution: ThemeContribution2,
3933
4006
  CommandHandler: CommandHandler2,
@@ -3935,7 +4008,7 @@ function createContributionsSchemas(canonical) {
3935
4008
  PluginContributionKind: PluginContributionKind2
3936
4009
  };
3937
4010
  }
3938
- var { ApprovalCardForm, ApprovalCardStoredForm, ApprovalTypeContribution, UriModuleFacts, ToolContribution, ToolPermission, AgentToolContribution, ConverterContribution, UriModuleContribution, AppUriModuleContribution, AppDataSourceContribution, WhiteboardTypeStorage, WhiteboardTypeContribution, AppDataMaterializerContribution, ArtifactUriModuleContribution, CliBindingContribution, GitHostContribution, ResourceContribution, SkillContribution, PluginSkillSourceDeclaration, SearchProviderContribution, InteractionDriverContribution, EntityResolverContribution, AgentRenderContribution, EndpointContribution, WorkflowContribution, McpServerUrl, McpServerAuthMode, McpServerContribution, McpServerContributions, AppEventSubscription, ContextContributorContribution, PluginEventDefinitionContribution, PluginNotificationRuleContribution, UiEventSubscriptionContribution, DeviceDelegationContribution, SessionReaderContribution, UiCommandContribution, UiSlotContribution, SettingsPanelContribution, ResultRendererContribution, ReferenceOpenBehavior, ReferencePresentationVariant, ReferencePresentationVariants, ReferencePresentationUriPattern, ReferencePresentationUrlClaim, ReferencePresentationTooltip, ReferencePresentationContribution, RichViewContribution, KayUiAppHostCapability, UiAppCapabilities, UiRailEntryContribution, UiAppContribution, ThemeContribution, CommandHandler, CommandContribution, PluginContributionKind } = createContributionsSchemas(false);
4011
+ var { ApprovalCardForm, ApprovalCardStoredForm, ApprovalTypeContribution, UriModuleFacts, ToolContribution, ToolPermission, AgentToolContribution, ConverterContribution, UriModuleContribution, AppUriModuleContribution, AppDataSourceContribution, WhiteboardTypeStorage, WhiteboardTypeContribution, AppDataMaterializerContribution, ArtifactUriModuleContribution, CliBindingContribution, GitHostContribution, ResourceContribution, SkillContribution, PluginSkillSourceDeclaration, SearchProviderContribution, InteractionDriverContribution, EntityResolverContribution, AgentRenderContribution, EndpointContribution, WorkflowContribution, McpServerUrl, McpServerAuthMode, McpServerContribution, McpServerContributions, AppEventSubscription, ContextContributorContribution, PluginEventDefinitionContribution, PluginNotificationRuleContribution, UiEventSubscriptionContribution, DeviceDelegationContribution, SessionReaderContribution, UiCommandContribution, UiSlotContribution, SettingsPanelContribution, ResultRendererContribution, ReferenceOpenBehavior, ReferencePresentationVariant, ReferencePresentationVariants, ReferencePresentationUriPattern, ReferencePresentationUrlClaim, ReferencePresentationTooltip, ReferencePresentationAddress, ReferencePresentationContribution, RichViewContribution, KayUiAppHostCapability, UiAppCapabilities, UiRailEntryContribution, UiToastPreviewContribution, UiPageContribution, UiAppContribution, ThemeContribution, CommandHandler, CommandContribution, PluginContributionKind } = createContributionsSchemas(false);
3939
4012
  var canonicalContributionSchemas = createContributionsSchemas(true);
3940
4013
 
3941
4014
  // packages/plugin-protocol/dist/icon-shape.js
@@ -4009,7 +4082,7 @@ var KAY_UI_NATIVE_EVENT_SUBSCRIPTIONS = [
4009
4082
  var KAY_UI_NATIVE_EVENT_ALLOWLIST = new Set(KAY_UI_NATIVE_EVENT_SUBSCRIPTIONS);
4010
4083
  var RETIRED_COMPATIBILITY_KEYS = ["policy"];
4011
4084
  function createManifestSchemas(canonical) {
4012
- const { AgentRenderContribution: AgentRenderContribution2, ApprovalTypeContribution: ApprovalTypeContribution2, WorkflowContribution: WorkflowContribution2, AppDataMaterializerContribution: AppDataMaterializerContribution2, AppDataSourceContribution: AppDataSourceContribution2, AppUriModuleContribution: AppUriModuleContribution2, AppEventSubscription: AppEventSubscription2, ArtifactUriModuleContribution: ArtifactUriModuleContribution2, CliBindingContribution: CliBindingContribution2, CommandContribution: CommandContribution2, ContextContributorContribution: ContextContributorContribution2, ConverterContribution: ConverterContribution2, SessionReaderContribution: SessionReaderContribution2, DeviceDelegationContribution: DeviceDelegationContribution2, EndpointContribution: EndpointContribution2, EntityResolverContribution: EntityResolverContribution2, GitHostContribution: GitHostContribution2, McpServerContributions: McpServerContributions2, PluginEventDefinitionContribution: PluginEventDefinitionContribution2, PluginNotificationRuleContribution: PluginNotificationRuleContribution2, ResourceContribution: ResourceContribution2, ReferencePresentationContribution: ReferencePresentationContribution2, ResultRendererContribution: ResultRendererContribution2, RichViewContribution: RichViewContribution2, PluginSkillSourceDeclaration: PluginSkillSourceDeclaration2, InteractionDriverContribution: InteractionDriverContribution2, SearchProviderContribution: SearchProviderContribution2, SkillContribution: SkillContribution2, SettingsPanelContribution: SettingsPanelContribution2, ThemeContribution: ThemeContribution2, AgentToolContribution: AgentToolContribution2, ToolContribution: ToolContribution2, UiCommandContribution: UiCommandContribution2, UiAppContribution: UiAppContribution2, UiRailEntryContribution: UiRailEntryContribution2, UiEventSubscriptionContribution: UiEventSubscriptionContribution2, UiSlotContribution: UiSlotContribution2, UriModuleContribution: UriModuleContribution2, WhiteboardTypeContribution: WhiteboardTypeContribution2 } = canonical ? canonicalContributionSchemas : contributions_exports;
4085
+ const { AgentRenderContribution: AgentRenderContribution2, ApprovalTypeContribution: ApprovalTypeContribution2, WorkflowContribution: WorkflowContribution2, AppDataMaterializerContribution: AppDataMaterializerContribution2, AppDataSourceContribution: AppDataSourceContribution2, AppUriModuleContribution: AppUriModuleContribution2, AppEventSubscription: AppEventSubscription2, ArtifactUriModuleContribution: ArtifactUriModuleContribution2, CliBindingContribution: CliBindingContribution2, CommandContribution: CommandContribution2, ContextContributorContribution: ContextContributorContribution2, ConverterContribution: ConverterContribution2, SessionReaderContribution: SessionReaderContribution2, DeviceDelegationContribution: DeviceDelegationContribution2, EndpointContribution: EndpointContribution2, EntityResolverContribution: EntityResolverContribution2, GitHostContribution: GitHostContribution2, McpServerContributions: McpServerContributions2, PluginEventDefinitionContribution: PluginEventDefinitionContribution2, PluginNotificationRuleContribution: PluginNotificationRuleContribution2, ResourceContribution: ResourceContribution2, ReferencePresentationContribution: ReferencePresentationContribution2, ResultRendererContribution: ResultRendererContribution2, RichViewContribution: RichViewContribution2, PluginSkillSourceDeclaration: PluginSkillSourceDeclaration2, InteractionDriverContribution: InteractionDriverContribution2, SearchProviderContribution: SearchProviderContribution2, SkillContribution: SkillContribution2, SettingsPanelContribution: SettingsPanelContribution2, ThemeContribution: ThemeContribution2, AgentToolContribution: AgentToolContribution2, ToolContribution: ToolContribution2, UiCommandContribution: UiCommandContribution2, UiAppContribution: UiAppContribution2, UiRailEntryContribution: UiRailEntryContribution2, UiToastPreviewContribution: UiToastPreviewContribution2, UiPageContribution: UiPageContribution2, UiEventSubscriptionContribution: UiEventSubscriptionContribution2, UiSlotContribution: UiSlotContribution2, UriModuleContribution: UriModuleContribution2, WhiteboardTypeContribution: WhiteboardTypeContribution2 } = canonical ? canonicalContributionSchemas : contributions_exports;
4013
4086
  const { HttpsUrl: HttpsUrl2, LocalContributionId: LocalContributionId2, NonEmptyString: NonEmptyString3, PackageAssetPath: PackageAssetPath2, PluginId: PluginId2, PluginNamespace: PluginNamespace2, RegistrableDomain: RegistrableDomain2, SignedInStatusCode: SignedInStatusCode2, TargetEntrypoint: TargetEntrypoint2 } = canonical ? canonicalCommonSchemas : common_exports;
4014
4087
  const { PluginPermissionManifest: PluginPermissionManifest2 } = canonical ? canonicalPermissionSchemas : permissions_exports;
4015
4088
  const KayAgentTargetManifest2 = z13.strictObject({
@@ -4132,6 +4205,8 @@ function createManifestSchemas(canonical) {
4132
4205
  views: z13.array(RichViewContribution2).optional(),
4133
4206
  apps: z13.array(UiAppContribution2).optional(),
4134
4207
  railEntries: z13.array(UiRailEntryContribution2).optional(),
4208
+ toastPreviews: z13.array(UiToastPreviewContribution2).optional(),
4209
+ pages: z13.array(UiPageContribution2).optional(),
4135
4210
  themes: z13.array(ThemeContribution2).optional(),
4136
4211
  eventSubscriptions: z13.array(UiEventSubscriptionContribution2).optional(),
4137
4212
  dataMaterializers: z13.array(AppDataMaterializerContribution2).optional()
@@ -4680,6 +4755,50 @@ function createManifestSchemas(canonical) {
4680
4755
  });
4681
4756
  }
4682
4757
  }
4758
+ const notificationRuleIds = new Set(manifest.targets?.kay?.app?.contributes?.notificationRules?.map((rule) => rule.localId) ?? []);
4759
+ const previewedRules = /* @__PURE__ */ new Set();
4760
+ for (const [index, preview] of (manifest.targets?.kay?.ui?.contributes?.toastPreviews ?? []).entries()) {
4761
+ const path = [
4762
+ "targets",
4763
+ "kay",
4764
+ "ui",
4765
+ "contributes",
4766
+ "toastPreviews",
4767
+ index
4768
+ ];
4769
+ if (!notificationRuleIds.has(preview.rule)) {
4770
+ ctx.addIssue({
4771
+ code: "custom",
4772
+ path: [...path, "rule"],
4773
+ message: `Toast preview references unknown notification rule ${preview.rule}`
4774
+ });
4775
+ }
4776
+ if (previewedRules.has(preview.rule)) {
4777
+ ctx.addIssue({
4778
+ code: "custom",
4779
+ path: [...path, "rule"],
4780
+ message: `Notification rule ${preview.rule} has more than one toast preview`
4781
+ });
4782
+ }
4783
+ previewedRules.add(preview.rule);
4784
+ for (const [, name] of preview.address.matchAll(/\$\{([^}]*)\}/g)) {
4785
+ if (name !== "navigateTarget" && name !== "revision") {
4786
+ ctx.addIssue({
4787
+ code: "custom",
4788
+ path: [...path, "address"],
4789
+ message: `Toast preview address can't fill \${${name}}: only \${navigateTarget} and \${revision}`
4790
+ });
4791
+ }
4792
+ }
4793
+ const app = manifest.targets?.kay?.ui?.contributes?.apps?.find((candidate) => candidate.localId === preview.body);
4794
+ if (app !== void 0 && app.contextOnly !== true) {
4795
+ ctx.addIssue({
4796
+ code: "custom",
4797
+ path: [...path, "body"],
4798
+ message: `Toast preview body ${app.localId} must be a contextOnly ui app`
4799
+ });
4800
+ }
4801
+ }
4683
4802
  const subscribedUiEvents = new Set(manifest.targets?.kay?.ui?.contributes?.eventSubscriptions?.map((subscription) => subscription.event) ?? []);
4684
4803
  const invokedUiEndpoints = new Set(manifest.permissions?.byTarget["kay.ui"]?.endpoints?.filter((grant) => grant.operations.includes("invoke")).map((grant) => grant.endpoint) ?? []);
4685
4804
  const uriModuleIds = new Set([
@@ -4687,6 +4806,10 @@ function createManifestSchemas(canonical) {
4687
4806
  ...manifest.targets?.kay?.app?.contributes?.uriModules ?? []
4688
4807
  ].map((module) => module.localId));
4689
4808
  const presentationByUriModule = /* @__PURE__ */ new Map();
4809
+ const declaredPageIds = /* @__PURE__ */ new Set([
4810
+ ...(manifest.targets?.kay?.ui?.contributes?.pages ?? []).map((page) => page.id),
4811
+ ...(manifest.targets?.kay?.ui?.contributes?.railEntries ?? []).map((entry) => entry.page)
4812
+ ]);
4690
4813
  for (const [index, presentation] of (manifest.targets?.kay?.ui?.contributes?.referencePresentations ?? []).entries()) {
4691
4814
  const path = [
4692
4815
  "targets",
@@ -4696,7 +4819,7 @@ function createManifestSchemas(canonical) {
4696
4819
  "referencePresentations",
4697
4820
  index
4698
4821
  ];
4699
- if (!uriModuleIds.has(presentation.uriModule)) {
4822
+ if (presentation.uriModule !== void 0 && !uriModuleIds.has(presentation.uriModule)) {
4700
4823
  ctx.addIssue({
4701
4824
  code: "custom",
4702
4825
  path: [...path, "uriModule"],
@@ -4710,6 +4833,15 @@ function createManifestSchemas(canonical) {
4710
4833
  message: `reference presentation ${presentation.localId} references unknown ui app ${presentation.tooltip.app}`
4711
4834
  });
4712
4835
  }
4836
+ if (presentation.open.kind === "page" && !declaredPageIds.has(presentation.open.pageId)) {
4837
+ ctx.addIssue({
4838
+ code: "custom",
4839
+ path: [...path, "open", "pageId"],
4840
+ message: `reference presentation ${presentation.localId} opens page ${presentation.open.pageId}, which this manifest declares in neither pages nor railEntries`
4841
+ });
4842
+ }
4843
+ if (presentation.uriModule === void 0)
4844
+ continue;
4713
4845
  const existing = presentationByUriModule.get(presentation.uriModule);
4714
4846
  if (existing !== void 0) {
4715
4847
  ctx.addIssue({
@@ -5400,7 +5532,7 @@ function boundPluginDiagnosticMessage(message) {
5400
5532
  import { z as z14 } from "zod";
5401
5533
  function createResolvedContractSchemas(canonical) {
5402
5534
  const { PluginEventLocalId: PluginEventLocalId2 } = canonical ? canonicalPluginEventSchemas : plugin_events_exports;
5403
- const { ApprovalTypeContribution: ApprovalTypeContribution2, KayUiAppHostCapability: KayUiAppHostCapability2, McpServerAuthMode: McpServerAuthMode2, McpServerUrl: McpServerUrl2, PluginContributionKind: PluginContributionKindSchema, ReferenceOpenBehavior: ReferenceOpenBehavior2, ReferencePresentationUriPattern: ReferencePresentationUriPattern2, ReferencePresentationUrlClaim: ReferencePresentationUrlClaim2, ReferencePresentationVariants: ReferencePresentationVariants2, UriModuleFacts: UriModuleFacts2, WhiteboardTypeStorage: WhiteboardTypeStorage2 } = canonical ? canonicalContributionSchemas : contributions_exports;
5535
+ const { ApprovalTypeContribution: ApprovalTypeContribution2, KayUiAppHostCapability: KayUiAppHostCapability2, McpServerAuthMode: McpServerAuthMode2, McpServerUrl: McpServerUrl2, PluginContributionKind: PluginContributionKindSchema, ReferenceOpenBehavior: ReferenceOpenBehavior2, ReferencePresentationUriPattern: ReferencePresentationUriPattern2, ReferencePresentationAddress: ReferencePresentationAddress2, ReferencePresentationUrlClaim: ReferencePresentationUrlClaim2, ReferencePresentationVariants: ReferencePresentationVariants2, UriModuleFacts: UriModuleFacts2, WhiteboardTypeStorage: WhiteboardTypeStorage2 } = canonical ? canonicalContributionSchemas : contributions_exports;
5404
5536
  const { FileExtensionToken: FileExtensionToken2, GitBasicAuthUser: GitBasicAuthUser2, GitHostName: GitHostName2, GlobalContributionId: GlobalContributionId2, HttpsUrl: HttpsUrl2, LocalContributionId: LocalContributionId2, MimeTypeString: MimeTypeString2, NonEmptyString: NonEmptyString3, PackageAssetPath: PackageAssetPath2, PluginId: PluginId2, PluginNamespace: PluginNamespace2, PluginToolName: PluginToolName2, RegistrableDomain: RegistrableDomain2, SignedInStatusCode: SignedInStatusCode2, TargetEntrypoint: TargetEntrypoint2, UriScheme: UriScheme2 } = canonical ? canonicalCommonSchemas : common_exports;
5405
5537
  const { PluginExternalCliConnect: PluginExternalCliConnect2, PluginOAuthClientSupplier: PluginOAuthClientSupplier2 } = canonical ? canonicalManifestSchemas : manifest_exports;
5406
5538
  const { ResolvedPluginGrants: ResolvedPluginGrants2 } = canonical ? canonicalPermissionSchemas : permissions_exports;
@@ -5563,7 +5695,10 @@ function createResolvedContractSchemas(canonical) {
5563
5695
  const ResolvedReferencePresentation2 = z14.strictObject({
5564
5696
  localId: LocalContributionId2,
5565
5697
  globalId: GlobalContributionId2,
5566
- uriModule: GlobalContributionId2,
5698
+ uriModule: GlobalContributionId2.optional(),
5699
+ /** The schemes a page-opening presentation answers for: its `scheme`, or its module's. */
5700
+ schemes: z14.array(UriScheme2).min(1).optional(),
5701
+ addresses: z14.array(ReferencePresentationAddress2).min(1).optional(),
5567
5702
  resourceKind: NonEmptyString3,
5568
5703
  open: ReferenceOpenBehavior2,
5569
5704
  /** MIME-specific resource kinds; absent keys use the base presentation. */
@@ -6185,7 +6320,11 @@ function resolveKayPluginContractV1(manifest) {
6185
6320
  const referencePresentations = manifest.targets?.kay?.ui?.contributes?.referencePresentations?.map((presentation) => ({
6186
6321
  localId: presentation.localId,
6187
6322
  globalId: resolveGlobalContributionId(namespace, presentation.localId),
6188
- uriModule: resolveGlobalContributionId(namespace, presentation.uriModule),
6323
+ ...presentation.uriModule === void 0 ? {} : {
6324
+ uriModule: resolveGlobalContributionId(namespace, presentation.uriModule)
6325
+ },
6326
+ ...presentationSchemes(manifest, presentation),
6327
+ ...presentation.addresses === void 0 ? {} : { addresses: presentation.addresses },
6189
6328
  resourceKind: presentation.resourceKind,
6190
6329
  open: presentation.open,
6191
6330
  ...presentation.tooltip === void 0 ? {} : {
@@ -6270,6 +6409,19 @@ function safeResolveKayPluginContractV1(manifest) {
6270
6409
  throw error;
6271
6410
  }
6272
6411
  }
6412
+ function presentationSchemes(manifest, presentation) {
6413
+ if (presentation.scheme !== void 0) {
6414
+ return { schemes: [presentation.scheme] };
6415
+ }
6416
+ if (presentation.open.kind !== "page")
6417
+ return {};
6418
+ const contributes = manifest.targets?.kay;
6419
+ const module = [
6420
+ ...contributes?.agent?.contributes?.uriModules ?? [],
6421
+ ...contributes?.app?.contributes?.uriModules ?? []
6422
+ ].find((candidate) => candidate.localId === presentation.uriModule);
6423
+ return module === void 0 ? {} : { schemes: [...module.schemes] };
6424
+ }
6273
6425
  function uriModuleFacts({ localId: _localId, schemes: _schemes, displayName: _displayName, authService: _authService, authScheme: _authScheme, knownResources: _knownResources, describesOperations: _describesOperations, ...facts }) {
6274
6426
  return facts;
6275
6427
  }
@@ -7115,6 +7267,7 @@ export {
7115
7267
  RETIRED_PLUGIN_CAPABILITY_SLUGS,
7116
7268
  RETIRED_WEB_SESSION_ROW_KEYS,
7117
7269
  ReferenceOpenBehavior,
7270
+ ReferencePresentationAddress,
7118
7271
  ReferencePresentationContribution,
7119
7272
  ReferencePresentationTooltip,
7120
7273
  ReferencePresentationUriPattern,
@@ -7182,8 +7335,10 @@ export {
7182
7335
  UiAppContribution,
7183
7336
  UiCommandContribution,
7184
7337
  UiEventSubscriptionContribution,
7338
+ UiPageContribution,
7185
7339
  UiRailEntryContribution,
7186
7340
  UiSlotContribution,
7341
+ UiToastPreviewContribution,
7187
7342
  UriModuleContribution,
7188
7343
  UriScheme,
7189
7344
  WEB_SESSION_CSRF_SELECTOR_PATTERN,
@@ -7214,6 +7369,7 @@ export {
7214
7369
  configSectionKeysForManifest,
7215
7370
  declarationsOfKind,
7216
7371
  declaredCommandId,
7372
+ declaredReferencePresentations,
7217
7373
  declaredUiIconPaths,
7218
7374
  dedupeClaims,
7219
7375
  deriveDirectoryPluginToolName,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yaklabs-ai/plugin-protocol",
3
- "version": "0.35.0",
3
+ "version": "0.37.0",
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",