@yaklabs-ai/plugin-protocol 0.54.0 → 0.54.2

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.54.0"
14
+ "@bonsai/plugin-protocol": "npm:@yaklabs-ai/plugin-protocol@^0.54.2"
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.54.0",
4
+ "version": "0.54.2",
5
5
  "target": "npm",
6
6
  "firstPartyLicense": "MIT",
7
7
  "bundled": [
package/dist/index.d.ts CHANGED
@@ -1801,6 +1801,7 @@ declare namespace authoringContributionSchemas {
1801
1801
  AppDataSourceContribution,
1802
1802
  WhiteboardTypeStorage,
1803
1803
  WhiteboardTypeContribution,
1804
+ WorkingDocumentProviderContribution,
1804
1805
  AppDataMaterializerContribution,
1805
1806
  ArtifactUriModuleContribution,
1806
1807
  CliBindingContribution,
@@ -2770,6 +2771,23 @@ declare const canonicalContributionSchemas: {
2770
2771
  }, z.core.$strict>>;
2771
2772
  handover: z.ZodOptional<z.ZodLiteral<true>>;
2772
2773
  }, z.core.$strict>;
2774
+ WorkingDocumentProviderContribution: z.ZodObject<{
2775
+ localId: z.ZodString;
2776
+ displayName: z.ZodString;
2777
+ schemes: z.ZodOptional<z.ZodArray<z.ZodString>>;
2778
+ hosts: z.ZodOptional<z.ZodArray<z.ZodString>>;
2779
+ authService: z.ZodOptional<z.ZodString>;
2780
+ authScheme: z.ZodOptional<z.ZodString>;
2781
+ scopeRequirement: z.ZodOptional<z.ZodObject<{
2782
+ purpose: z.ZodString;
2783
+ alternatives: z.ZodArray<z.ZodObject<{
2784
+ allOf: z.ZodArray<z.ZodObject<{
2785
+ scope: z.ZodString;
2786
+ reason: z.ZodExactOptional<z.ZodString>;
2787
+ }, z.core.$strict>>;
2788
+ }, z.core.$strict>>;
2789
+ }, z.core.$strict>>;
2790
+ }, z.core.$strict>;
2773
2791
  AppDataMaterializerContribution: z.ZodObject<{
2774
2792
  source: z.ZodString;
2775
2793
  }, z.core.$strict>;
@@ -3305,7 +3323,10 @@ declare const canonicalContributionSchemas: {
3305
3323
  plugins: "plugins";
3306
3324
  }>>;
3307
3325
  badge: z.ZodOptional<z.ZodObject<{
3308
- source: z.ZodString;
3326
+ source: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
3327
+ pluginId: z.ZodString;
3328
+ localId: z.ZodString;
3329
+ }, z.core.$strict>]>;
3309
3330
  where: z.ZodOptional<z.ZodString>;
3310
3331
  label: z.ZodObject<{
3311
3332
  one: z.ZodOptional<z.ZodString>;
@@ -3315,11 +3336,9 @@ declare const canonicalContributionSchemas: {
3315
3336
  panel: z.ZodOptional<z.ZodObject<{
3316
3337
  body: z.ZodString;
3317
3338
  }, z.core.$strict>>;
3318
- featureFlagVariant: z.ZodOptional<z.ZodObject<{
3339
+ visibleWhen: z.ZodOptional<z.ZodObject<{
3319
3340
  flag: z.ZodString;
3320
- title: z.ZodOptional<z.ZodString>;
3321
- icon: z.ZodOptional<z.ZodString>;
3322
- panel: z.ZodOptional<z.ZodLiteral<false>>;
3341
+ enabled: z.ZodBoolean;
3323
3342
  }, z.core.$strict>>;
3324
3343
  }, z.core.$strict>;
3325
3344
  UiToastPreviewContribution: z.ZodObject<{
@@ -3511,6 +3530,7 @@ declare const canonicalContributionSchemas: {
3511
3530
  eventSubscription: "eventSubscription";
3512
3531
  appDataSource: "appDataSource";
3513
3532
  whiteboardType: "whiteboardType";
3533
+ workingDocumentProvider: "workingDocumentProvider";
3514
3534
  approvalType: "approvalType";
3515
3535
  workflow: "workflow";
3516
3536
  contextContributor: "contextContributor";
@@ -4893,8 +4913,16 @@ export declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
4893
4913
  * 0.54.0 adds named UI host grants for shared configuration/auth/account reads, retained connection
4894
4914
  * progress/dismissal and support. Built-in-only page capability scopes are removed; executable
4895
4915
  * pages declare capabilities on apps[].
4916
+ *
4917
+ * 0.54.1 adds manifest-declared plugin workers on both backend targets and exposes the canonical
4918
+ * transcript placement and answer-stretch rules through the SDK.
4919
+ *
4920
+ * 0.54.2 lets a signal list the files that came with it (epic #15668). `PluginSignal` gains an
4921
+ * optional `attachments`: each file's name, media type, size and the address its bytes are read
4922
+ * from, never the bytes. Gmail lists a mail's attachments there, so Flows can file them. Additive:
4923
+ * a plugin that publishes attachments declares ^0.54.2.
4896
4924
  */
4897
- export declare const KAY_PLUGIN_SDK_VERSION: "0.54.0";
4925
+ export declare const KAY_PLUGIN_SDK_VERSION: "0.54.2";
4898
4926
 
4899
4927
  export declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
4900
4928
 
@@ -5570,6 +5598,23 @@ export declare const KayAppTargetManifest: z.ZodObject<{
5570
5598
  }, z.core.$strict>>;
5571
5599
  handover: z.ZodOptional<z.ZodLiteral<true>>;
5572
5600
  }, z.core.$strict>>>;
5601
+ workingDocumentProviders: z.ZodOptional<z.ZodArray<z.ZodObject<{
5602
+ localId: z.ZodString;
5603
+ displayName: z.ZodString;
5604
+ schemes: z.ZodOptional<z.ZodArray<z.ZodString>>;
5605
+ hosts: z.ZodOptional<z.ZodArray<z.ZodString>>;
5606
+ authService: z.ZodOptional<z.ZodString>;
5607
+ authScheme: z.ZodOptional<z.ZodString>;
5608
+ scopeRequirement: z.ZodOptional<z.ZodObject<{
5609
+ purpose: z.ZodString;
5610
+ alternatives: z.ZodArray<z.ZodObject<{
5611
+ allOf: z.ZodArray<z.ZodObject<{
5612
+ scope: z.ZodString;
5613
+ reason: z.ZodExactOptional<z.ZodString>;
5614
+ }, z.core.$strict>>;
5615
+ }, z.core.$strict>>;
5616
+ }, z.core.$strict>>;
5617
+ }, z.core.$strict>>>;
5573
5618
  approvalTypes: z.ZodOptional<z.ZodArray<z.ZodObject<{
5574
5619
  localId: z.ZodString;
5575
5620
  kind: z.ZodLiteral<"message">;
@@ -5844,6 +5889,10 @@ export declare const KayPluginManifestV1: z.ZodObject<{
5844
5889
  icon: z.ZodOptional<z.ZodString>;
5845
5890
  iconDark: z.ZodOptional<z.ZodString>;
5846
5891
  namespace: z.ZodOptional<z.ZodString>;
5892
+ workers: z.ZodOptional<z.ZodArray<z.ZodObject<{
5893
+ localId: z.ZodString;
5894
+ module: z.ZodString;
5895
+ }, z.core.$strict>>>;
5847
5896
  targets: z.ZodOptional<z.ZodObject<{
5848
5897
  kay: z.ZodOptional<z.ZodObject<{
5849
5898
  agent: z.ZodOptional<z.ZodObject<{
@@ -6501,6 +6550,23 @@ export declare const KayPluginManifestV1: z.ZodObject<{
6501
6550
  }, z.core.$strict>>;
6502
6551
  handover: z.ZodOptional<z.ZodLiteral<true>>;
6503
6552
  }, z.core.$strict>>>;
6553
+ workingDocumentProviders: z.ZodOptional<z.ZodArray<z.ZodObject<{
6554
+ localId: z.ZodString;
6555
+ displayName: z.ZodString;
6556
+ schemes: z.ZodOptional<z.ZodArray<z.ZodString>>;
6557
+ hosts: z.ZodOptional<z.ZodArray<z.ZodString>>;
6558
+ authService: z.ZodOptional<z.ZodString>;
6559
+ authScheme: z.ZodOptional<z.ZodString>;
6560
+ scopeRequirement: z.ZodOptional<z.ZodObject<{
6561
+ purpose: z.ZodString;
6562
+ alternatives: z.ZodArray<z.ZodObject<{
6563
+ allOf: z.ZodArray<z.ZodObject<{
6564
+ scope: z.ZodString;
6565
+ reason: z.ZodExactOptional<z.ZodString>;
6566
+ }, z.core.$strict>>;
6567
+ }, z.core.$strict>>;
6568
+ }, z.core.$strict>>;
6569
+ }, z.core.$strict>>>;
6504
6570
  approvalTypes: z.ZodOptional<z.ZodArray<z.ZodObject<{
6505
6571
  localId: z.ZodString;
6506
6572
  kind: z.ZodLiteral<"message">;
@@ -6932,7 +6998,10 @@ export declare const KayPluginManifestV1: z.ZodObject<{
6932
6998
  plugins: "plugins";
6933
6999
  }>>;
6934
7000
  badge: z.ZodOptional<z.ZodObject<{
6935
- source: z.ZodString;
7001
+ source: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
7002
+ pluginId: z.ZodString;
7003
+ localId: z.ZodString;
7004
+ }, z.core.$strict>]>;
6936
7005
  where: z.ZodOptional<z.ZodString>;
6937
7006
  label: z.ZodObject<{
6938
7007
  one: z.ZodOptional<z.ZodString>;
@@ -6942,11 +7011,9 @@ export declare const KayPluginManifestV1: z.ZodObject<{
6942
7011
  panel: z.ZodOptional<z.ZodObject<{
6943
7012
  body: z.ZodString;
6944
7013
  }, z.core.$strict>>;
6945
- featureFlagVariant: z.ZodOptional<z.ZodObject<{
7014
+ visibleWhen: z.ZodOptional<z.ZodObject<{
6946
7015
  flag: z.ZodString;
6947
- title: z.ZodOptional<z.ZodString>;
6948
- icon: z.ZodOptional<z.ZodString>;
6949
- panel: z.ZodOptional<z.ZodLiteral<false>>;
7016
+ enabled: z.ZodBoolean;
6950
7017
  }, z.core.$strict>>;
6951
7018
  }, z.core.$strict>>>;
6952
7019
  toastPreviews: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -8301,7 +8368,10 @@ export declare const KayUiTargetManifest: z.ZodObject<{
8301
8368
  plugins: "plugins";
8302
8369
  }>>;
8303
8370
  badge: z.ZodOptional<z.ZodObject<{
8304
- source: z.ZodString;
8371
+ source: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
8372
+ pluginId: z.ZodString;
8373
+ localId: z.ZodString;
8374
+ }, z.core.$strict>]>;
8305
8375
  where: z.ZodOptional<z.ZodString>;
8306
8376
  label: z.ZodObject<{
8307
8377
  one: z.ZodOptional<z.ZodString>;
@@ -8311,11 +8381,9 @@ export declare const KayUiTargetManifest: z.ZodObject<{
8311
8381
  panel: z.ZodOptional<z.ZodObject<{
8312
8382
  body: z.ZodString;
8313
8383
  }, z.core.$strict>>;
8314
- featureFlagVariant: z.ZodOptional<z.ZodObject<{
8384
+ visibleWhen: z.ZodOptional<z.ZodObject<{
8315
8385
  flag: z.ZodString;
8316
- title: z.ZodOptional<z.ZodString>;
8317
- icon: z.ZodOptional<z.ZodString>;
8318
- panel: z.ZodOptional<z.ZodLiteral<false>>;
8386
+ enabled: z.ZodBoolean;
8319
8387
  }, z.core.$strict>>;
8320
8388
  }, z.core.$strict>>>;
8321
8389
  toastPreviews: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -8663,6 +8731,15 @@ export declare const PLUGIN_NOTIFICATION_RULE_HOST_KEYS: readonly ["id", "match"
8663
8731
  */
8664
8732
  export declare const PLUGIN_PRODUCT_EVENT_NAME_PATTERN: RegExp;
8665
8733
 
8734
+ /** An attachment's file name, at most this many characters. */
8735
+ export declare const PLUGIN_SIGNAL_ATTACHMENT_NAME_MAX = 255;
8736
+
8737
+ /** An attachment's media type (`application/pdf`), at most this many characters. */
8738
+ export declare const PLUGIN_SIGNAL_ATTACHMENT_TYPE_MAX = 127;
8739
+
8740
+ /** At most this many entries in a signal's `attachments`; a source lists the first ones. */
8741
+ export declare const PLUGIN_SIGNAL_ATTACHMENTS_MAX = 10;
8742
+
8666
8743
  /** The `kind` values of `PluginSignal` v1. `status` is system state that clears itself. */
8667
8744
  export declare const PLUGIN_SIGNAL_KINDS: readonly ["message", "request", "mention", "invite", "status"];
8668
8745
 
@@ -11376,6 +11453,7 @@ export declare const PluginContributionKind: z.ZodEnum<{
11376
11453
  eventSubscription: "eventSubscription";
11377
11454
  appDataSource: "appDataSource";
11378
11455
  whiteboardType: "whiteboardType";
11456
+ workingDocumentProvider: "workingDocumentProvider";
11379
11457
  approvalType: "approvalType";
11380
11458
  workflow: "workflow";
11381
11459
  contextContributor: "contextContributor";
@@ -12405,6 +12483,12 @@ export declare const PluginSignal: z.ZodObject<{
12405
12483
  open: "open";
12406
12484
  resolved: "resolved";
12407
12485
  }>>;
12486
+ attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
12487
+ name: z.ZodString;
12488
+ type: z.ZodString;
12489
+ size: z.ZodNumber;
12490
+ uri: z.ZodString;
12491
+ }, z.core.$strict>>>;
12408
12492
  }, z.core.$strict>;
12409
12493
 
12410
12494
  export declare type PluginSignal = z.infer<typeof PluginSignal>;
@@ -12449,6 +12533,12 @@ export declare const PluginSignalPublish: z.ZodObject<{
12449
12533
  open: "open";
12450
12534
  resolved: "resolved";
12451
12535
  }>>;
12536
+ attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
12537
+ name: z.ZodString;
12538
+ type: z.ZodString;
12539
+ size: z.ZodNumber;
12540
+ uri: z.ZodString;
12541
+ }, z.core.$strict>>>;
12452
12542
  }, z.core.$strict>;
12453
12543
  related: z.ZodObject<{
12454
12544
  thread: z.ZodString;
@@ -13557,6 +13647,27 @@ export declare const ResolvedKayAppWorkflow: z.ZodObject<{
13557
13647
 
13558
13648
  export declare type ResolvedKayAppWorkflow = z.infer<typeof ResolvedKayAppWorkflow>;
13559
13649
 
13650
+ export declare const ResolvedKayAppWorkingDocumentProvider: z.ZodObject<{
13651
+ localId: z.ZodString;
13652
+ globalId: z.ZodString;
13653
+ displayName: z.ZodString;
13654
+ schemes: z.ZodArray<z.ZodString>;
13655
+ hosts: z.ZodArray<z.ZodString>;
13656
+ authServiceId: z.ZodOptional<z.ZodString>;
13657
+ authSchemeId: z.ZodOptional<z.ZodString>;
13658
+ scopeRequirement: z.ZodOptional<z.ZodObject<{
13659
+ purpose: z.ZodString;
13660
+ alternatives: z.ZodArray<z.ZodObject<{
13661
+ allOf: z.ZodArray<z.ZodObject<{
13662
+ scope: z.ZodString;
13663
+ reason: z.ZodExactOptional<z.ZodString>;
13664
+ }, z.core.$strict>>;
13665
+ }, z.core.$strict>>;
13666
+ }, z.core.$strict>>;
13667
+ }, z.core.$strict>;
13668
+
13669
+ export declare type ResolvedKayAppWorkingDocumentProvider = z.infer<typeof ResolvedKayAppWorkingDocumentProvider>;
13670
+
13560
13671
  export declare const ResolvedKayUiApp: z.ZodObject<{
13561
13672
  localId: z.ZodString;
13562
13673
  globalId: z.ZodString;
@@ -14044,6 +14155,7 @@ export declare const ResolvedPluginContractV1: z.ZodObject<{
14044
14155
  eventSubscription: "eventSubscription";
14045
14156
  appDataSource: "appDataSource";
14046
14157
  whiteboardType: "whiteboardType";
14158
+ workingDocumentProvider: "workingDocumentProvider";
14047
14159
  approvalType: "approvalType";
14048
14160
  workflow: "workflow";
14049
14161
  contextContributor: "contextContributor";
@@ -14063,6 +14175,10 @@ export declare const ResolvedPluginContractV1: z.ZodObject<{
14063
14175
  consumesAuthServices: z.ZodArray<z.ZodString>;
14064
14176
  explicitDependencies: z.ZodArray<z.ZodString>;
14065
14177
  dataDirSharedWith: z.ZodOptional<z.ZodString>;
14178
+ workers: z.ZodOptional<z.ZodArray<z.ZodObject<{
14179
+ localId: z.ZodString;
14180
+ module: z.ZodString;
14181
+ }, z.core.$strict>>>;
14066
14182
  workloadPurposes: z.ZodOptional<z.ZodArray<z.ZodObject<{
14067
14183
  purpose: z.ZodString;
14068
14184
  workloadClass: z.ZodEnum<{
@@ -15099,6 +15215,24 @@ export declare const ResolvedPluginContractV1: z.ZodObject<{
15099
15215
  handover: z.ZodOptional<z.ZodLiteral<true>>;
15100
15216
  globalId: z.ZodString;
15101
15217
  }, z.core.$strict>>>;
15218
+ kayAppWorkingDocumentProviders: z.ZodOptional<z.ZodArray<z.ZodObject<{
15219
+ localId: z.ZodString;
15220
+ globalId: z.ZodString;
15221
+ displayName: z.ZodString;
15222
+ schemes: z.ZodArray<z.ZodString>;
15223
+ hosts: z.ZodArray<z.ZodString>;
15224
+ authServiceId: z.ZodOptional<z.ZodString>;
15225
+ authSchemeId: z.ZodOptional<z.ZodString>;
15226
+ scopeRequirement: z.ZodOptional<z.ZodObject<{
15227
+ purpose: z.ZodString;
15228
+ alternatives: z.ZodArray<z.ZodObject<{
15229
+ allOf: z.ZodArray<z.ZodObject<{
15230
+ scope: z.ZodString;
15231
+ reason: z.ZodExactOptional<z.ZodString>;
15232
+ }, z.core.$strict>>;
15233
+ }, z.core.$strict>>;
15234
+ }, z.core.$strict>>;
15235
+ }, z.core.$strict>>>;
15102
15236
  kayAppMcpServers: z.ZodOptional<z.ZodArray<z.ZodObject<{
15103
15237
  name: z.ZodString;
15104
15238
  pluginId: z.ZodString;
@@ -15330,6 +15464,7 @@ export declare const ResolvedPluginContributionId: z.ZodObject<{
15330
15464
  eventSubscription: "eventSubscription";
15331
15465
  appDataSource: "appDataSource";
15332
15466
  whiteboardType: "whiteboardType";
15467
+ workingDocumentProvider: "workingDocumentProvider";
15333
15468
  approvalType: "approvalType";
15334
15469
  workflow: "workflow";
15335
15470
  contextContributor: "contextContributor";
@@ -17398,7 +17533,10 @@ export declare const UiRailEntryContribution: z.ZodObject<{
17398
17533
  plugins: "plugins";
17399
17534
  }>>;
17400
17535
  badge: z.ZodOptional<z.ZodObject<{
17401
- source: z.ZodString;
17536
+ source: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
17537
+ pluginId: z.ZodString;
17538
+ localId: z.ZodString;
17539
+ }, z.core.$strict>]>;
17402
17540
  where: z.ZodOptional<z.ZodString>;
17403
17541
  label: z.ZodObject<{
17404
17542
  one: z.ZodOptional<z.ZodString>;
@@ -17408,11 +17546,9 @@ export declare const UiRailEntryContribution: z.ZodObject<{
17408
17546
  panel: z.ZodOptional<z.ZodObject<{
17409
17547
  body: z.ZodString;
17410
17548
  }, z.core.$strict>>;
17411
- featureFlagVariant: z.ZodOptional<z.ZodObject<{
17549
+ visibleWhen: z.ZodOptional<z.ZodObject<{
17412
17550
  flag: z.ZodString;
17413
- title: z.ZodOptional<z.ZodString>;
17414
- icon: z.ZodOptional<z.ZodString>;
17415
- panel: z.ZodOptional<z.ZodLiteral<false>>;
17551
+ enabled: z.ZodBoolean;
17416
17552
  }, z.core.$strict>>;
17417
17553
  }, z.core.$strict>;
17418
17554
 
@@ -18175,4 +18311,24 @@ export declare const WorkflowContribution: z.ZodObject<{
18175
18311
 
18176
18312
  export declare type WorkflowContribution = z.infer<typeof WorkflowContribution>;
18177
18313
 
18314
+ export declare const WorkingDocumentProviderContribution: z.ZodObject<{
18315
+ localId: z.ZodString;
18316
+ displayName: z.ZodString;
18317
+ schemes: z.ZodOptional<z.ZodArray<z.ZodString>>;
18318
+ hosts: z.ZodOptional<z.ZodArray<z.ZodString>>;
18319
+ authService: z.ZodOptional<z.ZodString>;
18320
+ authScheme: z.ZodOptional<z.ZodString>;
18321
+ scopeRequirement: z.ZodOptional<z.ZodObject<{
18322
+ purpose: z.ZodString;
18323
+ alternatives: z.ZodArray<z.ZodObject<{
18324
+ allOf: z.ZodArray<z.ZodObject<{
18325
+ scope: z.ZodString;
18326
+ reason: z.ZodExactOptional<z.ZodString>;
18327
+ }, z.core.$strict>>;
18328
+ }, z.core.$strict>>;
18329
+ }, z.core.$strict>>;
18330
+ }, z.core.$strict>;
18331
+
18332
+ export declare type WorkingDocumentProviderContribution = z.infer<typeof WorkingDocumentProviderContribution>;
18333
+
18178
18334
  export { }
package/dist/index.js CHANGED
@@ -30,12 +30,6 @@ 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?.railEntries ?? []).flatMap((entry) => entry.featureFlagVariant?.icon === void 0 ? [] : [
34
- {
35
- label: "kay.ui rail variant icon",
36
- path: entry.featureFlagVariant.icon
37
- }
38
- ]),
39
33
  ...(contributes?.pages ?? []).flatMap((page) => page.icon === void 0 ? [] : [{ label: `kay.ui page '${page.id}' icon`, path: page.icon }]),
40
34
  ...(contributes?.commands ?? []).flatMap((command) => command.icon === void 0 ? [] : [
41
35
  {
@@ -266,8 +260,10 @@ var JsonSchema = z4.record(z4.string(), JsonValue);
266
260
  var KAY_PLUGIN_MANIFEST_SIZE_CAP_BYTES = 1024 * 1024;
267
261
  var KAY_PLUGIN_PROTOCOL_VERSION = "kay.plugin.v1";
268
262
  var KAY_PLUGIN_PROTOCOL_PACKAGE_NAME = "@bonsai/plugin-protocol";
269
- var KAY_PLUGIN_SDK_VERSION = "0.54.0";
263
+ var KAY_PLUGIN_SDK_VERSION = "0.54.2";
270
264
  var KAY_PLUGIN_COMPATIBLE_SDK_VERSIONS = [
265
+ "0.54.1",
266
+ "0.54.0",
271
267
  "0.53.0",
272
268
  "0.52.1",
273
269
  "0.52.0",
@@ -2939,6 +2935,7 @@ __export(contributions_exports, {
2939
2935
  WhiteboardTypeContribution: () => WhiteboardTypeContribution,
2940
2936
  WhiteboardTypeStorage: () => WhiteboardTypeStorage,
2941
2937
  WorkflowContribution: () => WorkflowContribution,
2938
+ WorkingDocumentProviderContribution: () => WorkingDocumentProviderContribution,
2942
2939
  canonicalContributionSchemas: () => canonicalContributionSchemas,
2943
2940
  isUiAppSourceModule: () => isUiAppSourceModule,
2944
2941
  uiAppSourceStylePath: () => uiAppSourceStylePath
@@ -2950,6 +2947,9 @@ var plugin_events_exports = {};
2950
2947
  __export(plugin_events_exports, {
2951
2948
  PLUGIN_EVENT_ID_MAX_BYTES: () => PLUGIN_EVENT_ID_MAX_BYTES,
2952
2949
  PLUGIN_EVENT_REFUSED_ERROR_NAME: () => PLUGIN_EVENT_REFUSED_ERROR_NAME,
2950
+ PLUGIN_SIGNAL_ATTACHMENTS_MAX: () => PLUGIN_SIGNAL_ATTACHMENTS_MAX,
2951
+ PLUGIN_SIGNAL_ATTACHMENT_NAME_MAX: () => PLUGIN_SIGNAL_ATTACHMENT_NAME_MAX,
2952
+ PLUGIN_SIGNAL_ATTACHMENT_TYPE_MAX: () => PLUGIN_SIGNAL_ATTACHMENT_TYPE_MAX,
2953
2953
  PLUGIN_SIGNAL_KINDS: () => PLUGIN_SIGNAL_KINDS,
2954
2954
  PLUGIN_SIGNAL_LABELS_MAX: () => PLUGIN_SIGNAL_LABELS_MAX,
2955
2955
  PLUGIN_SIGNAL_LABEL_MAX: () => PLUGIN_SIGNAL_LABEL_MAX,
@@ -2985,6 +2985,9 @@ var PLUGIN_SIGNAL_TITLE_MAX = 300;
2985
2985
  var PLUGIN_SIGNAL_SNIPPET_MAX = 500;
2986
2986
  var PLUGIN_SIGNAL_LABELS_MAX = 20;
2987
2987
  var PLUGIN_SIGNAL_LABEL_MAX = 64;
2988
+ var PLUGIN_SIGNAL_ATTACHMENTS_MAX = 10;
2989
+ var PLUGIN_SIGNAL_ATTACHMENT_NAME_MAX = 255;
2990
+ var PLUGIN_SIGNAL_ATTACHMENT_TYPE_MAX = 127;
2988
2991
  var PLUGIN_SIGNAL_RELATED_KEYS = [
2989
2992
  "thread",
2990
2993
  "from",
@@ -3056,7 +3059,19 @@ function createPluginEventsSchemas(canonical) {
3056
3059
  addressed: z12.enum(["direct", "cc", "mention", "group", "none"]).optional(),
3057
3060
  labels: z12.array(z12.string().min(1).max(PLUGIN_SIGNAL_LABEL_MAX)).max(PLUGIN_SIGNAL_LABELS_MAX).optional(),
3058
3061
  dueAt: PluginEventTimestamp2.optional(),
3059
- state: z12.enum(["open", "resolved"]).optional()
3062
+ state: z12.enum(["open", "resolved"]).optional(),
3063
+ /**
3064
+ * Files that came with the item, such as a mail's attachments: each one's name, media type,
3065
+ * size in bytes, and the address its bytes are read from. Never the bytes themselves. A
3066
+ * source leaves out what it knows is not a document of the person's (a mail's inline
3067
+ * signature image), and lists at most `PLUGIN_SIGNAL_ATTACHMENTS_MAX`.
3068
+ */
3069
+ attachments: z12.array(z12.strictObject({
3070
+ name: z12.string().min(1).max(PLUGIN_SIGNAL_ATTACHMENT_NAME_MAX),
3071
+ type: z12.string().min(1).max(PLUGIN_SIGNAL_ATTACHMENT_TYPE_MAX),
3072
+ size: z12.number().int().nonnegative(),
3073
+ uri: PluginEventUri2
3074
+ })).max(PLUGIN_SIGNAL_ATTACHMENTS_MAX).optional()
3060
3075
  }).refine((signal) => signal.state === void 0 || signal.kind === "status", {
3061
3076
  message: "state is only for a status signal",
3062
3077
  path: ["state"]
@@ -3891,6 +3906,42 @@ function createContributionsSchemas(canonical) {
3891
3906
  });
3892
3907
  }
3893
3908
  });
3909
+ const WorkingDocumentProviderContribution2 = z14.strictObject({
3910
+ localId: LocalContributionId2,
3911
+ /** What it pulls, as a short noun phrase for copy: `a Google Doc`. */
3912
+ displayName: NonEmptyString3,
3913
+ /** URI schemes it claims (`gdrive`), compared without case. */
3914
+ schemes: z14.array(UriScheme2).min(1).optional(),
3915
+ /** Web hosts it claims (`docs.google.com`), compared without case. */
3916
+ hosts: z14.array(NonEmptyString3).min(1).optional(),
3917
+ /** The sign-in its token comes from, as on a URI module. */
3918
+ authService: AuthServiceReference2.optional(),
3919
+ /** The scheme of `authService` every call uses, as on a URI module. */
3920
+ authScheme: AuthSchemeReference2.optional(),
3921
+ /** What a stored grant must carry; absent means any credential of the scheme. */
3922
+ scopeRequirement: ScopeRequirement2.optional()
3923
+ }).superRefine((provider, ctx) => {
3924
+ if (provider.schemes === void 0 && provider.hosts === void 0) {
3925
+ ctx.addIssue({
3926
+ code: "custom",
3927
+ message: "A working-document provider must claim a scheme or a host."
3928
+ });
3929
+ }
3930
+ if (provider.authService === void 0 !== (provider.authScheme === void 0)) {
3931
+ ctx.addIssue({
3932
+ code: "custom",
3933
+ path: ["authScheme"],
3934
+ message: "authService and authScheme are declared together."
3935
+ });
3936
+ }
3937
+ if (provider.scopeRequirement !== void 0 && provider.authService === void 0) {
3938
+ ctx.addIssue({
3939
+ code: "custom",
3940
+ path: ["scopeRequirement"],
3941
+ message: "A scope requirement needs an authService."
3942
+ });
3943
+ }
3944
+ });
3894
3945
  const WhiteboardTypeStorage2 = z14.discriminatedUnion("kind", [
3895
3946
  z14.strictObject({ kind: z14.literal("json") }),
3896
3947
  z14.strictObject({ kind: z14.literal("payload") }),
@@ -4520,7 +4571,7 @@ function createContributionsSchemas(canonical) {
4520
4571
  }
4521
4572
  });
4522
4573
  const UiRailBadge = z14.strictObject({
4523
- source: LocalContributionId2,
4574
+ source: UiAppCapabilityReference2,
4524
4575
  where: NonEmptyString3.optional(),
4525
4576
  label: z14.strictObject({
4526
4577
  one: NonEmptyString3.optional(),
@@ -4549,12 +4600,7 @@ function createContributionsSchemas(canonical) {
4549
4600
  section: z14.enum(["primary", "plugins"]).optional(),
4550
4601
  badge: UiRailBadge.optional(),
4551
4602
  panel: z14.strictObject({ body: LocalContributionId2 }).optional(),
4552
- featureFlagVariant: z14.strictObject({
4553
- flag: NonEmptyString3,
4554
- title: NonEmptyString3.optional(),
4555
- icon: PackageAssetPath2.optional(),
4556
- panel: z14.literal(false).optional()
4557
- }).optional()
4603
+ visibleWhen: z14.strictObject({ flag: NonEmptyString3, enabled: z14.boolean() }).optional()
4558
4604
  });
4559
4605
  const UiToastPreviewContribution2 = z14.strictObject({
4560
4606
  rule: LocalContributionId2,
@@ -4642,6 +4688,7 @@ function createContributionsSchemas(canonical) {
4642
4688
  "eventSubscription",
4643
4689
  "appDataSource",
4644
4690
  "whiteboardType",
4691
+ "workingDocumentProvider",
4645
4692
  "approvalType",
4646
4693
  "workflow",
4647
4694
  "contextContributor",
@@ -4672,6 +4719,7 @@ function createContributionsSchemas(canonical) {
4672
4719
  AppDataSourceContribution: AppDataSourceContribution2,
4673
4720
  WhiteboardTypeStorage: WhiteboardTypeStorage2,
4674
4721
  WhiteboardTypeContribution: WhiteboardTypeContribution2,
4722
+ WorkingDocumentProviderContribution: WorkingDocumentProviderContribution2,
4675
4723
  AppDataMaterializerContribution: AppDataMaterializerContribution2,
4676
4724
  ArtifactUriModuleContribution: ArtifactUriModuleContribution2,
4677
4725
  CliBindingContribution: CliBindingContribution2,
@@ -4723,7 +4771,7 @@ function createContributionsSchemas(canonical) {
4723
4771
  PluginContributionKind: PluginContributionKind2
4724
4772
  };
4725
4773
  }
4726
- 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, PluginCardContribution, WorkflowContribution, McpServerUrl, McpServerAuthMode, McpServerContribution, McpServerContributions, AppEventSubscription, ContextContributorContribution, PluginEventDefinitionContribution, PluginNotificationRuleContribution, PluginProductEventContribution, UiEventSubscriptionContribution, DeviceDelegationContribution, SessionReaderContribution, UiCommandContribution, UiSlotContribution, ReferenceOpenBehavior, ReferencePresentationVariant, ReferencePresentationVariants, ReferencePresentationUriPattern, ReferencePresentationUrlClaim, ReferencePresentationTooltip, ReferencePresentationAddress, ReferencePresentationAccountLinks, ReferencePresentationWords, ReferencePresentationContribution, KayUiAppHostCapability, UiAppCapabilityReference, UiAppCapabilities, UiRailEntryContribution, UiToastPreviewContribution, UiPageContribution, UiAppContribution, ThemeContribution, CommandHandler, CommandContribution, PluginContributionKind } = createContributionsSchemas(false);
4774
+ var { ApprovalCardForm, ApprovalCardStoredForm, ApprovalTypeContribution, UriModuleFacts, ToolContribution, ToolPermission, AgentToolContribution, ConverterContribution, UriModuleContribution, AppUriModuleContribution, AppDataSourceContribution, WhiteboardTypeStorage, WhiteboardTypeContribution, WorkingDocumentProviderContribution, AppDataMaterializerContribution, ArtifactUriModuleContribution, CliBindingContribution, GitHostContribution, ResourceContribution, SkillContribution, PluginSkillSourceDeclaration, SearchProviderContribution, InteractionDriverContribution, EntityResolverContribution, AgentRenderContribution, EndpointContribution, PluginCardContribution, WorkflowContribution, McpServerUrl, McpServerAuthMode, McpServerContribution, McpServerContributions, AppEventSubscription, ContextContributorContribution, PluginEventDefinitionContribution, PluginNotificationRuleContribution, PluginProductEventContribution, UiEventSubscriptionContribution, DeviceDelegationContribution, SessionReaderContribution, UiCommandContribution, UiSlotContribution, ReferenceOpenBehavior, ReferencePresentationVariant, ReferencePresentationVariants, ReferencePresentationUriPattern, ReferencePresentationUrlClaim, ReferencePresentationTooltip, ReferencePresentationAddress, ReferencePresentationAccountLinks, ReferencePresentationWords, ReferencePresentationContribution, KayUiAppHostCapability, UiAppCapabilityReference, UiAppCapabilities, UiRailEntryContribution, UiToastPreviewContribution, UiPageContribution, UiAppContribution, ThemeContribution, CommandHandler, CommandContribution, PluginContributionKind } = createContributionsSchemas(false);
4727
4775
  var canonicalContributionSchemas = createContributionsSchemas(true);
4728
4776
  var UI_APP_SOURCE_MODULE = /\.(?:tsx|ts|jsx)$/;
4729
4777
  function isUiAppSourceModule(module) {
@@ -4878,7 +4926,7 @@ var KAY_UI_NATIVE_EVENT_SUBSCRIPTIONS = [
4878
4926
  var KAY_UI_NATIVE_EVENT_ALLOWLIST = new Set(KAY_UI_NATIVE_EVENT_SUBSCRIPTIONS);
4879
4927
  var RETIRED_COMPATIBILITY_KEYS = ["policy"];
4880
4928
  function createManifestSchemas(canonical) {
4881
- const { AgentRenderContribution: AgentRenderContribution2, ApprovalTypeContribution: ApprovalTypeContribution2, WorkflowContribution: WorkflowContribution2, PluginCardContribution: PluginCardContribution2, 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, PluginProductEventContribution: PluginProductEventContribution2, ResourceContribution: ResourceContribution2, ReferencePresentationContribution: ReferencePresentationContribution2, PluginSkillSourceDeclaration: PluginSkillSourceDeclaration2, InteractionDriverContribution: InteractionDriverContribution2, SearchProviderContribution: SearchProviderContribution2, SkillContribution: SkillContribution2, 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;
4929
+ const { AgentRenderContribution: AgentRenderContribution2, ApprovalTypeContribution: ApprovalTypeContribution2, WorkflowContribution: WorkflowContribution2, PluginCardContribution: PluginCardContribution2, 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, PluginProductEventContribution: PluginProductEventContribution2, ResourceContribution: ResourceContribution2, ReferencePresentationContribution: ReferencePresentationContribution2, PluginSkillSourceDeclaration: PluginSkillSourceDeclaration2, InteractionDriverContribution: InteractionDriverContribution2, SearchProviderContribution: SearchProviderContribution2, SkillContribution: SkillContribution2, ThemeContribution: ThemeContribution2, AgentToolContribution: AgentToolContribution2, ToolContribution: ToolContribution2, UiCommandContribution: UiCommandContribution2, UiAppContribution: UiAppContribution2, UiRailEntryContribution: UiRailEntryContribution2, UiToastPreviewContribution: UiToastPreviewContribution2, UiPageContribution: UiPageContribution2, UiEventSubscriptionContribution: UiEventSubscriptionContribution2, UiSlotContribution: UiSlotContribution2, UriModuleContribution: UriModuleContribution2, WhiteboardTypeContribution: WhiteboardTypeContribution2, WorkingDocumentProviderContribution: WorkingDocumentProviderContribution2 } = canonical ? canonicalContributionSchemas : contributions_exports;
4882
4930
  const { HttpsUrl: HttpsUrl2, LocalContributionId: LocalContributionId2, NonEmptyString: NonEmptyString3, PackageAssetPath: PackageAssetPath2, PluginId: PluginId2, PluginNamespace: PluginNamespace2, RegistrableDomain: RegistrableDomain2, SignedInStatusCode: SignedInStatusCode2, TargetEntrypoint: TargetEntrypoint2 } = canonical ? canonicalCommonSchemas : common_exports;
4883
4931
  const { PluginPermissionManifest: PluginPermissionManifest2 } = canonical ? canonicalPermissionSchemas : permissions_exports;
4884
4932
  const KayAgentTargetManifest2 = z18.strictObject({
@@ -4973,6 +5021,8 @@ function createManifestSchemas(canonical) {
4973
5021
  uriModules: z18.array(AppUriModuleContribution2).optional(),
4974
5022
  dataSources: z18.array(AppDataSourceContribution2).optional(),
4975
5023
  whiteboardTypes: z18.array(WhiteboardTypeContribution2).optional(),
5024
+ // Document sources whose pull, push and revision check the app entrypoint registers.
5025
+ workingDocumentProviders: z18.array(WorkingDocumentProviderContribution2).optional(),
4976
5026
  approvalTypes: z18.array(ApprovalTypeContribution2).optional(),
4977
5027
  workflows: z18.array(WorkflowContribution2).optional(),
4978
5028
  eventDefinitions: z18.array(PluginEventDefinitionContribution2).optional(),
@@ -5356,6 +5406,10 @@ function createManifestSchemas(canonical) {
5356
5406
  icon: PackageAssetPath2.optional(),
5357
5407
  iconDark: PackageAssetPath2.optional(),
5358
5408
  namespace: PluginNamespace2.optional(),
5409
+ workers: z18.array(z18.strictObject({
5410
+ localId: LocalContributionId2,
5411
+ module: PackageAssetPath2
5412
+ })).optional(),
5359
5413
  targets: z18.strictObject({
5360
5414
  kay: z18.strictObject({
5361
5415
  agent: KayAgentTargetManifest2.optional(),
@@ -5388,6 +5442,7 @@ function createManifestSchemas(canonical) {
5388
5442
  plugins: z18.array(PluginId2).optional()
5389
5443
  }).optional()
5390
5444
  }).superRefine((manifest, ctx) => {
5445
+ reportDuplicateLocalIds(ctx, ["workers"], manifest.workers, "worker");
5391
5446
  const sharedWith = manifest.storage?.dataDir?.sharedWith;
5392
5447
  if (sharedWith !== void 0 && (!manifest.storage?.dataDir?.enabled || sharedWith === manifest.id || !manifest.dependencies?.plugins?.includes(sharedWith))) {
5393
5448
  ctx.addIssue({
@@ -5552,7 +5607,7 @@ function createManifestSchemas(canonical) {
5552
5607
  index,
5553
5608
  "badge"
5554
5609
  ];
5555
- if (!declaredRowsStores.has(entry.badge.source)) {
5610
+ if (typeof entry.badge.source === "string" && !declaredRowsStores.has(entry.badge.source)) {
5556
5611
  ctx.addIssue({
5557
5612
  code: "custom",
5558
5613
  path: [...path, "source"],
@@ -5570,6 +5625,34 @@ function createManifestSchemas(canonical) {
5570
5625
  });
5571
5626
  }
5572
5627
  reportDuplicateLocalIds(ctx, ["targets", "kay", "app", "contributes", "whiteboardTypes"], manifest.targets?.kay?.app?.contributes?.whiteboardTypes, "Whiteboard type");
5628
+ reportDuplicateLocalIds(ctx, ["targets", "kay", "app", "contributes", "workingDocumentProviders"], manifest.targets?.kay?.app?.contributes?.workingDocumentProviders, "Working-document provider");
5629
+ for (const [index, provider] of (manifest.targets?.kay?.app?.contributes?.workingDocumentProviders ?? []).entries()) {
5630
+ const path = [
5631
+ "targets",
5632
+ "kay",
5633
+ "app",
5634
+ "contributes",
5635
+ "workingDocumentProviders",
5636
+ index
5637
+ ];
5638
+ if (manifest.targets?.kay?.app?.entrypoint === void 0) {
5639
+ ctx.addIssue({
5640
+ code: "custom",
5641
+ path,
5642
+ message: `working-document provider ${provider.localId} needs a kay.app entrypoint to implement it`
5643
+ });
5644
+ }
5645
+ if (provider.authService === void 0)
5646
+ continue;
5647
+ const granted = manifest.permissions?.byTarget["kay.app"]?.auth?.some((grant) => grant.service === provider.authService && grant.operations.includes("resolve"));
5648
+ if (granted !== true) {
5649
+ ctx.addIssue({
5650
+ code: "custom",
5651
+ path: [...path, "authService"],
5652
+ message: `working-document provider ${provider.localId} needs a kay.app auth grant that resolves ${provider.authService}`
5653
+ });
5654
+ }
5655
+ }
5573
5656
  const uiAppIds = new Set(manifest.targets?.kay?.ui?.contributes?.apps?.map((app) => app.localId) ?? []);
5574
5657
  for (const [index, entry] of (manifest.targets?.kay?.ui?.contributes?.railEntries ?? []).entries()) {
5575
5658
  const body = entry.panel?.body;
@@ -6545,6 +6628,7 @@ function collectKayAppContributionIds(manifest) {
6545
6628
  pushContributionIds(output, ["targets", "kay", "app", "contributes", "uriModules"], contributes?.uriModules);
6546
6629
  pushContributionIds(output, ["targets", "kay", "app", "contributes", "dataSources"], contributes?.dataSources);
6547
6630
  pushContributionIds(output, ["targets", "kay", "app", "contributes", "whiteboardTypes"], contributes?.whiteboardTypes);
6631
+ pushContributionIds(output, ["targets", "kay", "app", "contributes", "workingDocumentProviders"], contributes?.workingDocumentProviders);
6548
6632
  pushContributionIds(output, ["targets", "kay", "app", "contributes", "eventDefinitions"], contributes?.eventDefinitions);
6549
6633
  pushContributionIds(output, ["targets", "kay", "app", "contributes", "eventSubscriptions"], contributes?.eventSubscriptions);
6550
6634
  pushContributionIds(output, ["targets", "kay", "app", "contributes", "deviceDelegations"], contributes?.deviceDelegations);
@@ -6615,7 +6699,7 @@ function createResolvedContractSchemas(canonical) {
6615
6699
  const { ApprovalTypeContribution: ApprovalTypeContribution2, KayUiAppHostCapability: KayUiAppHostCapability2, McpServerAuthMode: McpServerAuthMode2, McpServerUrl: McpServerUrl2, PluginContributionKind: PluginContributionKindSchema, ReferenceOpenBehavior: ReferenceOpenBehavior2, ReferencePresentationUriPattern: ReferencePresentationUriPattern2, ReferencePresentationAccountLinks: ReferencePresentationAccountLinks2, ReferencePresentationAddress: ReferencePresentationAddress2, ReferencePresentationUrlClaim: ReferencePresentationUrlClaim2, ReferencePresentationVariants: ReferencePresentationVariants2, ReferencePresentationWords: ReferencePresentationWords2, UriModuleFacts: UriModuleFacts2, WhiteboardTypeContribution: WhiteboardTypeContribution2 } = canonical ? canonicalContributionSchemas : contributions_exports;
6616
6700
  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;
6617
6701
  const { PluginExternalCliConnect: PluginExternalCliConnect2, PluginOAuthClientSupplier: PluginOAuthClientSupplier2 } = canonical ? canonicalManifestSchemas : manifest_exports;
6618
- const { ResolvedPluginGrants: ResolvedPluginGrants2 } = canonical ? canonicalPermissionSchemas : permissions_exports;
6702
+ const { ResolvedPluginGrants: ResolvedPluginGrants2, ScopeRequirement: ScopeRequirement2 } = canonical ? canonicalPermissionSchemas : permissions_exports;
6619
6703
  const ResolvedPluginContributionId2 = z19.strictObject({
6620
6704
  target: PluginTargetName,
6621
6705
  kind: PluginContributionKindSchema,
@@ -6736,6 +6820,16 @@ function createResolvedContractSchemas(canonical) {
6736
6820
  auth: McpServerAuthMode2,
6737
6821
  authServiceId: GlobalContributionId2.optional()
6738
6822
  });
6823
+ const ResolvedKayAppWorkingDocumentProvider2 = z19.strictObject({
6824
+ localId: LocalContributionId2,
6825
+ globalId: GlobalContributionId2,
6826
+ displayName: NonEmptyString3,
6827
+ schemes: z19.array(UriScheme2),
6828
+ hosts: z19.array(NonEmptyString3),
6829
+ authServiceId: GlobalContributionId2.optional(),
6830
+ authSchemeId: GlobalContributionId2.optional(),
6831
+ scopeRequirement: ScopeRequirement2.optional()
6832
+ });
6739
6833
  const ResolvedKayAgentUriModule2 = z19.strictObject({
6740
6834
  localId: LocalContributionId2,
6741
6835
  adapterId: z19.string().min(1).optional(),
@@ -6972,6 +7066,10 @@ function createResolvedContractSchemas(canonical) {
6972
7066
  // full dependency graph together with auth-inferred edges from `consumesAuthServices`.
6973
7067
  explicitDependencies: z19.array(PluginId2),
6974
7068
  dataDirSharedWith: PluginId2.optional(),
7069
+ workers: z19.array(z19.strictObject({
7070
+ localId: LocalContributionId2,
7071
+ module: PackageAssetPath2
7072
+ })).optional(),
6975
7073
  workloadPurposes: z19.array(PluginWorkloadPurpose).optional(),
6976
7074
  shellCommands: z19.array(PluginShellCommand.omit({ endpoint: true }).extend({
6977
7075
  endpointId: GlobalContributionId2
@@ -6995,6 +7093,7 @@ function createResolvedContractSchemas(canonical) {
6995
7093
  kayAppCards: z19.array(ResolvedPluginCard2).optional(),
6996
7094
  kayAppDataSources: z19.array(ResolvedKayAppDataSource2).optional(),
6997
7095
  kayAppWhiteboardTypes: z19.array(ResolvedKayAppWhiteboardType2).optional(),
7096
+ kayAppWorkingDocumentProviders: z19.array(ResolvedKayAppWorkingDocumentProvider2).optional(),
6998
7097
  kayAppMcpServers: z19.array(ResolvedKayAppMcpServer2).optional(),
6999
7098
  kayAgentConverters: z19.array(ResolvedKayAgentConverter2).optional(),
7000
7099
  referencePresentations: z19.array(ResolvedReferencePresentation2).optional(),
@@ -7009,6 +7108,7 @@ function createResolvedContractSchemas(canonical) {
7009
7108
  ResolvedPluginCard: ResolvedPluginCard2,
7010
7109
  ResolvedKayAppDataSource: ResolvedKayAppDataSource2,
7011
7110
  ResolvedKayAppWhiteboardType: ResolvedKayAppWhiteboardType2,
7111
+ ResolvedKayAppWorkingDocumentProvider: ResolvedKayAppWorkingDocumentProvider2,
7012
7112
  ResolvedKayAppMcpServer: ResolvedKayAppMcpServer2,
7013
7113
  ResolvedKayAgentUriModule: ResolvedKayAgentUriModule2,
7014
7114
  ResolvedKayAgentArtifactUriModule: ResolvedKayAgentArtifactUriModule2,
@@ -7025,7 +7125,7 @@ function createResolvedContractSchemas(canonical) {
7025
7125
  ResolvedPluginContractV1: ResolvedPluginContractV12
7026
7126
  };
7027
7127
  }
7028
- var { ResolvedKayAppApprovalType, ResolvedKayAppWorkflow, ResolvedPluginCard, ResolvedPluginContributionId, ResolvedKayAgentTool, ResolvedKayAppTool, ResolvedKayAppDataSource, ResolvedKayAppWhiteboardType, ResolvedKayAppMcpServer, ResolvedKayAgentUriModule, ResolvedKayAgentArtifactUriModule, ResolvedKayAgentEntityResolver, ResolvedKayAgentGitHostClaim, ResolvedKayAgentConverter, ResolvedReferencePresentation, ResolvedPluginProvisioningRequirement, ResolvedPluginAuthScheme, ResolvedPluginWebSession, ResolvedPluginAuthService, ResolvedKayUiAppEndpointCapability, ResolvedKayUiApp, ResolvedPluginContractV1 } = createResolvedContractSchemas(false);
7128
+ var { ResolvedKayAppApprovalType, ResolvedKayAppWorkflow, ResolvedPluginCard, ResolvedPluginContributionId, ResolvedKayAgentTool, ResolvedKayAppTool, ResolvedKayAppDataSource, ResolvedKayAppWhiteboardType, ResolvedKayAppWorkingDocumentProvider, ResolvedKayAppMcpServer, ResolvedKayAgentUriModule, ResolvedKayAgentArtifactUriModule, ResolvedKayAgentEntityResolver, ResolvedKayAgentGitHostClaim, ResolvedKayAgentConverter, ResolvedReferencePresentation, ResolvedPluginProvisioningRequirement, ResolvedPluginAuthScheme, ResolvedPluginWebSession, ResolvedPluginAuthService, ResolvedKayUiAppEndpointCapability, ResolvedKayUiApp, ResolvedPluginContractV1 } = createResolvedContractSchemas(false);
7029
7129
  var canonicalResolvedContractSchemas = createResolvedContractSchemas(true);
7030
7130
  function narrowestAccountSelectors() {
7031
7131
  return [{ kind: "active" }];
@@ -7065,6 +7165,7 @@ function collectContributionSources(manifest) {
7065
7165
  pushAll(output, "kay.app", "uriModule", app?.uriModules);
7066
7166
  pushAll(output, "kay.app", "appDataSource", app?.dataSources);
7067
7167
  pushAll(output, "kay.app", "whiteboardType", app?.whiteboardTypes);
7168
+ pushAll(output, "kay.app", "workingDocumentProvider", app?.workingDocumentProviders);
7068
7169
  pushAll(output, "kay.app", "approvalType", app?.approvalTypes);
7069
7170
  pushAll(output, "kay.app", "workflow", app?.workflows);
7070
7171
  pushAll(output, "kay.app", "command", app?.commands);
@@ -7166,6 +7267,9 @@ function collectConsumedAuthServiceIds(manifest) {
7166
7267
  for (const card of manifest.targets?.kay?.app?.contributes?.cards ?? []) {
7167
7268
  add(card.authService);
7168
7269
  }
7270
+ for (const provider of manifest.targets?.kay?.app?.contributes?.workingDocumentProviders ?? []) {
7271
+ add(provider.authService);
7272
+ }
7169
7273
  for (const target of KAY_PLUGIN_TARGET_NAMES) {
7170
7274
  for (const grant of manifest.permissions?.byTarget[target]?.auth ?? []) {
7171
7275
  add(grant.service);
@@ -7418,6 +7522,20 @@ function resolveKayPluginContractV1(manifest) {
7418
7522
  ...type.reference === void 0 ? {} : { reference: type.reference },
7419
7523
  ...type.handover === void 0 ? {} : { handover: type.handover }
7420
7524
  }));
7525
+ const kayAppWorkingDocumentProviders = manifest.targets?.kay?.app?.contributes?.workingDocumentProviders?.map((provider) => ({
7526
+ localId: provider.localId,
7527
+ globalId: resolveGlobalContributionId(namespace, provider.localId),
7528
+ displayName: provider.displayName,
7529
+ schemes: (provider.schemes ?? []).map((scheme) => scheme.toLowerCase()),
7530
+ hosts: (provider.hosts ?? []).map((host) => host.toLowerCase()),
7531
+ ...provider.authService === void 0 ? {} : {
7532
+ authServiceId: isQualifiedAuthServiceRef(provider.authService) ? provider.authService : resolveGlobalContributionId(namespace, provider.authService)
7533
+ },
7534
+ ...provider.authScheme === void 0 ? {} : {
7535
+ authSchemeId: isQualifiedAuthSchemeRef(provider.authScheme) ? provider.authScheme : resolveGlobalContributionId(namespace, provider.authScheme)
7536
+ },
7537
+ ...provider.scopeRequirement === void 0 ? {} : { scopeRequirement: provider.scopeRequirement }
7538
+ }));
7421
7539
  const kayAppMcpServers = Object.entries(manifest.targets?.kay?.app?.contributes?.mcpServers ?? {}).map(([name, server]) => ({
7422
7540
  name,
7423
7541
  pluginId: manifest.id,
@@ -7538,6 +7656,7 @@ function resolveKayPluginContractV1(manifest) {
7538
7656
  ...manifest.dependencies?.plugins ?? []
7539
7657
  ],
7540
7658
  authServices,
7659
+ ...manifest.workers === void 0 ? {} : { workers: manifest.workers },
7541
7660
  ...manifest.storage?.dataDir?.sharedWith === void 0 ? {} : { dataDirSharedWith: manifest.storage.dataDir.sharedWith },
7542
7661
  ...manifest.workloadPurposes === void 0 ? {} : { workloadPurposes: manifest.workloadPurposes },
7543
7662
  ...manifest.shellCommands === void 0 ? {} : {
@@ -7565,6 +7684,7 @@ function resolveKayPluginContractV1(manifest) {
7565
7684
  ...kayAppWorkflows && kayAppWorkflows.length > 0 ? { kayAppWorkflows } : {},
7566
7685
  ...kayAppDataSources && kayAppDataSources.length > 0 ? { kayAppDataSources } : {},
7567
7686
  ...kayAppWhiteboardTypes && kayAppWhiteboardTypes.length > 0 ? { kayAppWhiteboardTypes } : {},
7687
+ ...kayAppWorkingDocumentProviders && kayAppWorkingDocumentProviders.length > 0 ? { kayAppWorkingDocumentProviders } : {},
7568
7688
  ...kayAppMcpServers.length > 0 ? { kayAppMcpServers } : {},
7569
7689
  ...kayAgentConverters && kayAgentConverters.length > 0 ? { kayAgentConverters } : {},
7570
7690
  ...referencePresentations && referencePresentations.length > 0 ? { referencePresentations } : {},
@@ -7714,6 +7834,17 @@ async function judgeKayPluginDirectory(input) {
7714
7834
  return refuse("contract-resolve", "path-escapes-plugin-dir", `${reference.label} path '${reference.path}' resolves outside the plugin directory (no symlink escapes, no traversal)`);
7715
7835
  }
7716
7836
  }
7837
+ for (const worker of manifest.workers ?? []) {
7838
+ let entry;
7839
+ try {
7840
+ entry = await tree.entry(worker.module);
7841
+ } catch {
7842
+ return refuse("contract-resolve", "invalid-worker-module", "A declared worker module could not be inspected.");
7843
+ }
7844
+ if (entry?.kind !== "file") {
7845
+ return refuse("contract-resolve", "invalid-worker-module", `worker '${worker.localId}' must name an existing regular file`);
7846
+ }
7847
+ }
7717
7848
  return {
7718
7849
  outcome: "loads",
7719
7850
  hostSdkVersion,
@@ -7789,7 +7920,10 @@ function namedIn(head) {
7789
7920
  return head.displayName === void 0 ? head.id : `${head.displayName} (${head.id})`;
7790
7921
  }
7791
7922
  function referencedPaths(manifest) {
7792
- const refs = [];
7923
+ const refs = (manifest.workers ?? []).map((worker) => ({
7924
+ label: `worker '${worker.localId}'`,
7925
+ path: worker.module
7926
+ }));
7793
7927
  const kayAgent = manifest.targets?.kay?.agent;
7794
7928
  if (kayAgent !== void 0) {
7795
7929
  refs.push({
@@ -8432,6 +8566,9 @@ export {
8432
8566
  PLUGIN_ICON_SHAPE_ATTRIBUTE,
8433
8567
  PLUGIN_NOTIFICATION_RULE_HOST_KEYS,
8434
8568
  PLUGIN_PRODUCT_EVENT_NAME_PATTERN,
8569
+ PLUGIN_SIGNAL_ATTACHMENTS_MAX,
8570
+ PLUGIN_SIGNAL_ATTACHMENT_NAME_MAX,
8571
+ PLUGIN_SIGNAL_ATTACHMENT_TYPE_MAX,
8435
8572
  PLUGIN_SIGNAL_KINDS,
8436
8573
  PLUGIN_SIGNAL_LABELS_MAX,
8437
8574
  PLUGIN_SIGNAL_LABEL_MAX,
@@ -8524,6 +8661,7 @@ export {
8524
8661
  ResolvedKayAppTool,
8525
8662
  ResolvedKayAppWhiteboardType,
8526
8663
  ResolvedKayAppWorkflow,
8664
+ ResolvedKayAppWorkingDocumentProvider,
8527
8665
  ResolvedKayUiApp,
8528
8666
  ResolvedKayUiAppEndpointCapability,
8529
8667
  ResolvedPluginAuthScheme,
@@ -8598,6 +8736,7 @@ export {
8598
8736
  WhiteboardTypeStorage,
8599
8737
  WhiteboardValue,
8600
8738
  WorkflowContribution,
8739
+ WorkingDocumentProviderContribution,
8601
8740
  appDataSourceDeclaration,
8602
8741
  approvalKindSchema,
8603
8742
  boundPluginDiagnosticMessage,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yaklabs-ai/plugin-protocol",
3
- "version": "0.54.0",
3
+ "version": "0.54.2",
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",