@yaklabs-ai/plugin-protocol 0.26.3 → 0.27.1

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.26.3"
14
+ "@bonsai/plugin-protocol": "npm:@yaklabs-ai/plugin-protocol@^0.27.1"
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.26.3",
4
+ "version": "0.27.1",
5
5
  "target": "npm",
6
6
  "firstPartyLicense": "MIT",
7
7
  "bundled": [],
package/dist/index.d.ts CHANGED
@@ -137,6 +137,41 @@ export declare const APPROVAL_KINDS: readonly ["message", "change", "action", "a
137
137
 
138
138
  export declare type ApprovalAnswer = (typeof APPROVAL_ANSWERS)[number];
139
139
 
140
+ export declare const ApprovalCardForm: z.ZodObject<{
141
+ uri: z.ZodUnion<readonly [z.ZodObject<{
142
+ fixed: z.ZodString;
143
+ }, z.core.$strict>, z.ZodObject<{
144
+ value: z.ZodString;
145
+ }, z.core.$strict>]>;
146
+ requestFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
147
+ payload: z.ZodRecord<z.ZodString, z.ZodString>;
148
+ fixed: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>>;
149
+ }, z.core.$strict>;
150
+
151
+ export declare type ApprovalCardForm = z.infer<typeof ApprovalCardForm>;
152
+
153
+ export declare const ApprovalCardStoredForm: z.ZodObject<{
154
+ uri: z.ZodUnion<readonly [z.ZodObject<{
155
+ fixed: z.ZodString;
156
+ }, z.core.$strict>, z.ZodObject<{
157
+ value: z.ZodString;
158
+ }, z.core.$strict>]>;
159
+ requestFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
160
+ payload: z.ZodRecord<z.ZodString, z.ZodString>;
161
+ fixed: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>>;
162
+ read: z.ZodObject<{
163
+ revision: z.ZodString;
164
+ body: z.ZodString;
165
+ subject: z.ZodOptional<z.ZodString>;
166
+ to: z.ZodOptional<z.ZodString>;
167
+ cc: z.ZodOptional<z.ZodString>;
168
+ bcc: z.ZodOptional<z.ZodString>;
169
+ attachments: z.ZodOptional<z.ZodString>;
170
+ }, z.core.$strict>;
171
+ }, z.core.$strict>;
172
+
173
+ export declare type ApprovalCardStoredForm = z.infer<typeof ApprovalCardStoredForm>;
174
+
140
175
  export declare type ApprovalKind = (typeof APPROVAL_KINDS)[number];
141
176
 
142
177
  export declare const approvalKindSchema: z.ZodEnum<{
@@ -158,12 +193,77 @@ export declare type ApprovalOrigin = z.infer<typeof ApprovalOrigin>;
158
193
 
159
194
  export declare const ApprovalTypeContribution: z.ZodObject<{
160
195
  localId: z.ZodString;
161
- kind: z.ZodEnum<{
162
- message: "message";
163
- change: "change";
164
- action: "action";
165
- access: "access";
166
- }>;
196
+ kind: z.ZodLiteral<"message">;
197
+ provider: z.ZodString;
198
+ uriModule: z.ZodString;
199
+ unknownMessage: z.ZodString;
200
+ fields: z.ZodObject<{
201
+ body: z.ZodObject<{
202
+ key: z.ZodString;
203
+ max: z.ZodNumber;
204
+ }, z.core.$strict>;
205
+ subject: z.ZodOptional<z.ZodObject<{
206
+ key: z.ZodString;
207
+ max: z.ZodNumber;
208
+ }, z.core.$strict>>;
209
+ }, z.core.$strict>;
210
+ presentation: z.ZodObject<{
211
+ showAccount: z.ZodBoolean;
212
+ recipient: z.ZodEnum<{
213
+ target: "target";
214
+ person: "person";
215
+ }>;
216
+ }, z.core.$strict>;
217
+ forms: z.ZodObject<{
218
+ inline: z.ZodOptional<z.ZodObject<{
219
+ uri: z.ZodUnion<readonly [z.ZodObject<{
220
+ fixed: z.ZodString;
221
+ }, z.core.$strict>, z.ZodObject<{
222
+ value: z.ZodString;
223
+ }, z.core.$strict>]>;
224
+ requestFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
225
+ payload: z.ZodRecord<z.ZodString, z.ZodString>;
226
+ fixed: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>>;
227
+ }, z.core.$strict>>;
228
+ saved: z.ZodOptional<z.ZodObject<{
229
+ uri: z.ZodUnion<readonly [z.ZodObject<{
230
+ fixed: z.ZodString;
231
+ }, z.core.$strict>, z.ZodObject<{
232
+ value: z.ZodString;
233
+ }, z.core.$strict>]>;
234
+ requestFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
235
+ payload: z.ZodRecord<z.ZodString, z.ZodString>;
236
+ fixed: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>>;
237
+ }, z.core.$strict>>;
238
+ stored: z.ZodOptional<z.ZodObject<{
239
+ uri: z.ZodUnion<readonly [z.ZodObject<{
240
+ fixed: z.ZodString;
241
+ }, z.core.$strict>, z.ZodObject<{
242
+ value: z.ZodString;
243
+ }, z.core.$strict>]>;
244
+ requestFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
245
+ payload: z.ZodRecord<z.ZodString, z.ZodString>;
246
+ fixed: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>>;
247
+ read: z.ZodObject<{
248
+ revision: z.ZodString;
249
+ body: z.ZodString;
250
+ subject: z.ZodOptional<z.ZodString>;
251
+ to: z.ZodOptional<z.ZodString>;
252
+ cc: z.ZodOptional<z.ZodString>;
253
+ bcc: z.ZodOptional<z.ZodString>;
254
+ attachments: z.ZodOptional<z.ZodString>;
255
+ }, z.core.$strict>;
256
+ }, z.core.$strict>>;
257
+ }, z.core.$strict>;
258
+ display: z.ZodOptional<z.ZodObject<{
259
+ bodyFormat: z.ZodOptional<z.ZodLiteral<"mrkdwn">>;
260
+ replyField: z.ZodOptional<z.ZodString>;
261
+ replyLabel: z.ZodOptional<z.ZodString>;
262
+ facts: z.ZodOptional<z.ZodArray<z.ZodObject<{
263
+ label: z.ZodString;
264
+ field: z.ZodString;
265
+ }, z.core.$strict>>>;
266
+ }, z.core.$strict>>;
167
267
  }, z.core.$strict>;
168
268
 
169
269
  export declare type ApprovalTypeContribution = z.infer<typeof ApprovalTypeContribution>;
@@ -1509,6 +1609,8 @@ declare namespace authoringContributionSchemas {
1509
1609
  export {
1510
1610
  MCP_SIGN_IN_SCHEME_KIND,
1511
1611
  PLUGIN_NOTIFICATION_RULE_HOST_KEYS,
1612
+ ApprovalCardForm,
1613
+ ApprovalCardStoredForm,
1512
1614
  ApprovalTypeContribution,
1513
1615
  UriModuleFacts,
1514
1616
  ToolContribution,
@@ -1629,14 +1731,108 @@ declare const canonicalCommonSchemas: {
1629
1731
  };
1630
1732
 
1631
1733
  declare const canonicalContributionSchemas: {
1734
+ ApprovalCardForm: z.ZodObject<{
1735
+ uri: z.ZodUnion<readonly [z.ZodObject<{
1736
+ fixed: z.ZodString;
1737
+ }, z.core.$strict>, z.ZodObject<{
1738
+ value: z.ZodString;
1739
+ }, z.core.$strict>]>;
1740
+ requestFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
1741
+ payload: z.ZodRecord<z.ZodString, z.ZodString>;
1742
+ fixed: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>>;
1743
+ }, z.core.$strict>;
1744
+ ApprovalCardStoredForm: z.ZodObject<{
1745
+ uri: z.ZodUnion<readonly [z.ZodObject<{
1746
+ fixed: z.ZodString;
1747
+ }, z.core.$strict>, z.ZodObject<{
1748
+ value: z.ZodString;
1749
+ }, z.core.$strict>]>;
1750
+ requestFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
1751
+ payload: z.ZodRecord<z.ZodString, z.ZodString>;
1752
+ fixed: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>>;
1753
+ read: z.ZodObject<{
1754
+ revision: z.ZodString;
1755
+ body: z.ZodString;
1756
+ subject: z.ZodOptional<z.ZodString>;
1757
+ to: z.ZodOptional<z.ZodString>;
1758
+ cc: z.ZodOptional<z.ZodString>;
1759
+ bcc: z.ZodOptional<z.ZodString>;
1760
+ attachments: z.ZodOptional<z.ZodString>;
1761
+ }, z.core.$strict>;
1762
+ }, z.core.$strict>;
1632
1763
  ApprovalTypeContribution: z.ZodObject<{
1633
1764
  localId: z.ZodString;
1634
- kind: z.ZodEnum<{
1635
- message: "message";
1636
- change: "change";
1637
- action: "action";
1638
- access: "access";
1639
- }>;
1765
+ kind: z.ZodLiteral<"message">;
1766
+ provider: z.ZodString;
1767
+ uriModule: z.ZodString;
1768
+ unknownMessage: z.ZodString;
1769
+ fields: z.ZodObject<{
1770
+ body: z.ZodObject<{
1771
+ key: z.ZodString;
1772
+ max: z.ZodNumber;
1773
+ }, z.core.$strict>;
1774
+ subject: z.ZodOptional<z.ZodObject<{
1775
+ key: z.ZodString;
1776
+ max: z.ZodNumber;
1777
+ }, z.core.$strict>>;
1778
+ }, z.core.$strict>;
1779
+ presentation: z.ZodObject<{
1780
+ showAccount: z.ZodBoolean;
1781
+ recipient: z.ZodEnum<{
1782
+ target: "target";
1783
+ person: "person";
1784
+ }>;
1785
+ }, z.core.$strict>;
1786
+ forms: z.ZodObject<{
1787
+ inline: z.ZodOptional<z.ZodObject<{
1788
+ uri: z.ZodUnion<readonly [z.ZodObject<{
1789
+ fixed: z.ZodString;
1790
+ }, z.core.$strict>, z.ZodObject<{
1791
+ value: z.ZodString;
1792
+ }, z.core.$strict>]>;
1793
+ requestFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
1794
+ payload: z.ZodRecord<z.ZodString, z.ZodString>;
1795
+ fixed: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>>;
1796
+ }, z.core.$strict>>;
1797
+ saved: z.ZodOptional<z.ZodObject<{
1798
+ uri: z.ZodUnion<readonly [z.ZodObject<{
1799
+ fixed: z.ZodString;
1800
+ }, z.core.$strict>, z.ZodObject<{
1801
+ value: z.ZodString;
1802
+ }, z.core.$strict>]>;
1803
+ requestFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
1804
+ payload: z.ZodRecord<z.ZodString, z.ZodString>;
1805
+ fixed: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>>;
1806
+ }, z.core.$strict>>;
1807
+ stored: z.ZodOptional<z.ZodObject<{
1808
+ uri: z.ZodUnion<readonly [z.ZodObject<{
1809
+ fixed: z.ZodString;
1810
+ }, z.core.$strict>, z.ZodObject<{
1811
+ value: z.ZodString;
1812
+ }, z.core.$strict>]>;
1813
+ requestFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
1814
+ payload: z.ZodRecord<z.ZodString, z.ZodString>;
1815
+ fixed: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>>;
1816
+ read: z.ZodObject<{
1817
+ revision: z.ZodString;
1818
+ body: z.ZodString;
1819
+ subject: z.ZodOptional<z.ZodString>;
1820
+ to: z.ZodOptional<z.ZodString>;
1821
+ cc: z.ZodOptional<z.ZodString>;
1822
+ bcc: z.ZodOptional<z.ZodString>;
1823
+ attachments: z.ZodOptional<z.ZodString>;
1824
+ }, z.core.$strict>;
1825
+ }, z.core.$strict>>;
1826
+ }, z.core.$strict>;
1827
+ display: z.ZodOptional<z.ZodObject<{
1828
+ bodyFormat: z.ZodOptional<z.ZodLiteral<"mrkdwn">>;
1829
+ replyField: z.ZodOptional<z.ZodString>;
1830
+ replyLabel: z.ZodOptional<z.ZodString>;
1831
+ facts: z.ZodOptional<z.ZodArray<z.ZodObject<{
1832
+ label: z.ZodString;
1833
+ field: z.ZodString;
1834
+ }, z.core.$strict>>>;
1835
+ }, z.core.$strict>>;
1640
1836
  }, z.core.$strict>;
1641
1837
  UriModuleFacts: z.ZodObject<{
1642
1838
  claims: z.ZodExactOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -1843,6 +2039,7 @@ declare const canonicalContributionSchemas: {
1843
2039
  }, z.core.$strict>;
1844
2040
  UriModuleContribution: z.ZodObject<{
1845
2041
  authService: z.ZodOptional<z.ZodString>;
2042
+ authScheme: z.ZodOptional<z.ZodString>;
1846
2043
  knownResources: z.ZodOptional<z.ZodLiteral<true>>;
1847
2044
  describesOperations: z.ZodOptional<z.ZodLiteral<true>>;
1848
2045
  claims: z.ZodExactOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -2604,9 +2801,9 @@ declare const canonicalContributionSchemas: {
2604
2801
  endpoint: "endpoint";
2605
2802
  storage: "storage";
2606
2803
  command: "command";
2804
+ uriModule: "uriModule";
2607
2805
  authService: "authService";
2608
2806
  app: "app";
2609
- uriModule: "uriModule";
2610
2807
  configSection: "configSection";
2611
2808
  skill: "skill";
2612
2809
  converter: "converter";
@@ -3699,8 +3896,20 @@ export declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
3699
3896
  * registers the named function on any such scheme, its own client's included, and the SDK refuses a
3700
3897
  * plugin whose lookup and manifest disagree. An own-client (`pkce`) scheme may carry the
3701
3898
  * `clientSecret` that goes with its `clientId`. A plugin with an `oauth2` sign-in declares ^0.26.3.
3899
+ *
3900
+ * 0.27.0 makes a message approval card manifest data (#14574). `approvalTypes` declares the card's
3901
+ * facts and forms, and Bonsai draws it with the module's `describeOperation` and sends it with its
3902
+ * `write`. `app.approvals`, its `prepare`, `finalize` and `resolveResource` are gone, and a write can
3903
+ * refuse in the person's words with `UriProviderError.refusalMessage`. No plugin outside this repo
3904
+ * declared a card, so 0.26.3 stays served. A plugin that declares a card declares ^0.27.0.
3905
+ *
3906
+ * 0.27.1 lets a manifest URI module name the exact sign-in scheme its calls use, as a tool can
3907
+ * (#14928): `authScheme`, a scheme of the module's `authService`, local or another plugin's. A
3908
+ * hosted module's code and manifest must agree on it, and the daemon reads it to find an
3909
+ * external-CLI scheme without running the module. A module that runs in the daemon is unchanged,
3910
+ * so this is additive; a plugin whose manifest sets `authScheme` declares ^0.27.1.
3702
3911
  */
3703
- export declare const KAY_PLUGIN_SDK_VERSION: "0.26.3";
3912
+ export declare const KAY_PLUGIN_SDK_VERSION: "0.27.1";
3704
3913
 
3705
3914
  export declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
3706
3915
 
@@ -3752,6 +3961,7 @@ export declare const KayAgentTargetManifest: z.ZodObject<{
3752
3961
  }, z.core.$strict>>>;
3753
3962
  uriModules: z.ZodOptional<z.ZodArray<z.ZodObject<{
3754
3963
  authService: z.ZodOptional<z.ZodString>;
3964
+ authScheme: z.ZodOptional<z.ZodString>;
3755
3965
  knownResources: z.ZodOptional<z.ZodLiteral<true>>;
3756
3966
  describesOperations: z.ZodOptional<z.ZodLiteral<true>>;
3757
3967
  claims: z.ZodExactOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -4218,12 +4428,77 @@ export declare const KayAppTargetManifest: z.ZodObject<{
4218
4428
  }, z.core.$strict>>>;
4219
4429
  approvalTypes: z.ZodOptional<z.ZodArray<z.ZodObject<{
4220
4430
  localId: z.ZodString;
4221
- kind: z.ZodEnum<{
4222
- message: "message";
4223
- change: "change";
4224
- action: "action";
4225
- access: "access";
4226
- }>;
4431
+ kind: z.ZodLiteral<"message">;
4432
+ provider: z.ZodString;
4433
+ uriModule: z.ZodString;
4434
+ unknownMessage: z.ZodString;
4435
+ fields: z.ZodObject<{
4436
+ body: z.ZodObject<{
4437
+ key: z.ZodString;
4438
+ max: z.ZodNumber;
4439
+ }, z.core.$strict>;
4440
+ subject: z.ZodOptional<z.ZodObject<{
4441
+ key: z.ZodString;
4442
+ max: z.ZodNumber;
4443
+ }, z.core.$strict>>;
4444
+ }, z.core.$strict>;
4445
+ presentation: z.ZodObject<{
4446
+ showAccount: z.ZodBoolean;
4447
+ recipient: z.ZodEnum<{
4448
+ target: "target";
4449
+ person: "person";
4450
+ }>;
4451
+ }, z.core.$strict>;
4452
+ forms: z.ZodObject<{
4453
+ inline: z.ZodOptional<z.ZodObject<{
4454
+ uri: z.ZodUnion<readonly [z.ZodObject<{
4455
+ fixed: z.ZodString;
4456
+ }, z.core.$strict>, z.ZodObject<{
4457
+ value: z.ZodString;
4458
+ }, z.core.$strict>]>;
4459
+ requestFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
4460
+ payload: z.ZodRecord<z.ZodString, z.ZodString>;
4461
+ fixed: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>>;
4462
+ }, z.core.$strict>>;
4463
+ saved: z.ZodOptional<z.ZodObject<{
4464
+ uri: z.ZodUnion<readonly [z.ZodObject<{
4465
+ fixed: z.ZodString;
4466
+ }, z.core.$strict>, z.ZodObject<{
4467
+ value: z.ZodString;
4468
+ }, z.core.$strict>]>;
4469
+ requestFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
4470
+ payload: z.ZodRecord<z.ZodString, z.ZodString>;
4471
+ fixed: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>>;
4472
+ }, z.core.$strict>>;
4473
+ stored: z.ZodOptional<z.ZodObject<{
4474
+ uri: z.ZodUnion<readonly [z.ZodObject<{
4475
+ fixed: z.ZodString;
4476
+ }, z.core.$strict>, z.ZodObject<{
4477
+ value: z.ZodString;
4478
+ }, z.core.$strict>]>;
4479
+ requestFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
4480
+ payload: z.ZodRecord<z.ZodString, z.ZodString>;
4481
+ fixed: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>>;
4482
+ read: z.ZodObject<{
4483
+ revision: z.ZodString;
4484
+ body: z.ZodString;
4485
+ subject: z.ZodOptional<z.ZodString>;
4486
+ to: z.ZodOptional<z.ZodString>;
4487
+ cc: z.ZodOptional<z.ZodString>;
4488
+ bcc: z.ZodOptional<z.ZodString>;
4489
+ attachments: z.ZodOptional<z.ZodString>;
4490
+ }, z.core.$strict>;
4491
+ }, z.core.$strict>>;
4492
+ }, z.core.$strict>;
4493
+ display: z.ZodOptional<z.ZodObject<{
4494
+ bodyFormat: z.ZodOptional<z.ZodLiteral<"mrkdwn">>;
4495
+ replyField: z.ZodOptional<z.ZodString>;
4496
+ replyLabel: z.ZodOptional<z.ZodString>;
4497
+ facts: z.ZodOptional<z.ZodArray<z.ZodObject<{
4498
+ label: z.ZodString;
4499
+ field: z.ZodString;
4500
+ }, z.core.$strict>>>;
4501
+ }, z.core.$strict>>;
4227
4502
  }, z.core.$strict>>>;
4228
4503
  eventDefinitions: z.ZodOptional<z.ZodArray<z.ZodObject<{
4229
4504
  localId: z.ZodString;
@@ -4442,6 +4717,7 @@ export declare const KayPluginManifestV1: z.ZodObject<{
4442
4717
  }, z.core.$strict>>>;
4443
4718
  uriModules: z.ZodOptional<z.ZodArray<z.ZodObject<{
4444
4719
  authService: z.ZodOptional<z.ZodString>;
4720
+ authScheme: z.ZodOptional<z.ZodString>;
4445
4721
  knownResources: z.ZodOptional<z.ZodLiteral<true>>;
4446
4722
  describesOperations: z.ZodOptional<z.ZodLiteral<true>>;
4447
4723
  claims: z.ZodExactOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -4905,12 +5181,77 @@ export declare const KayPluginManifestV1: z.ZodObject<{
4905
5181
  }, z.core.$strict>>>;
4906
5182
  approvalTypes: z.ZodOptional<z.ZodArray<z.ZodObject<{
4907
5183
  localId: z.ZodString;
4908
- kind: z.ZodEnum<{
4909
- message: "message";
4910
- change: "change";
4911
- action: "action";
4912
- access: "access";
4913
- }>;
5184
+ kind: z.ZodLiteral<"message">;
5185
+ provider: z.ZodString;
5186
+ uriModule: z.ZodString;
5187
+ unknownMessage: z.ZodString;
5188
+ fields: z.ZodObject<{
5189
+ body: z.ZodObject<{
5190
+ key: z.ZodString;
5191
+ max: z.ZodNumber;
5192
+ }, z.core.$strict>;
5193
+ subject: z.ZodOptional<z.ZodObject<{
5194
+ key: z.ZodString;
5195
+ max: z.ZodNumber;
5196
+ }, z.core.$strict>>;
5197
+ }, z.core.$strict>;
5198
+ presentation: z.ZodObject<{
5199
+ showAccount: z.ZodBoolean;
5200
+ recipient: z.ZodEnum<{
5201
+ target: "target";
5202
+ person: "person";
5203
+ }>;
5204
+ }, z.core.$strict>;
5205
+ forms: z.ZodObject<{
5206
+ inline: z.ZodOptional<z.ZodObject<{
5207
+ uri: z.ZodUnion<readonly [z.ZodObject<{
5208
+ fixed: z.ZodString;
5209
+ }, z.core.$strict>, z.ZodObject<{
5210
+ value: z.ZodString;
5211
+ }, z.core.$strict>]>;
5212
+ requestFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
5213
+ payload: z.ZodRecord<z.ZodString, z.ZodString>;
5214
+ fixed: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>>;
5215
+ }, z.core.$strict>>;
5216
+ saved: z.ZodOptional<z.ZodObject<{
5217
+ uri: z.ZodUnion<readonly [z.ZodObject<{
5218
+ fixed: z.ZodString;
5219
+ }, z.core.$strict>, z.ZodObject<{
5220
+ value: z.ZodString;
5221
+ }, z.core.$strict>]>;
5222
+ requestFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
5223
+ payload: z.ZodRecord<z.ZodString, z.ZodString>;
5224
+ fixed: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>>;
5225
+ }, z.core.$strict>>;
5226
+ stored: z.ZodOptional<z.ZodObject<{
5227
+ uri: z.ZodUnion<readonly [z.ZodObject<{
5228
+ fixed: z.ZodString;
5229
+ }, z.core.$strict>, z.ZodObject<{
5230
+ value: z.ZodString;
5231
+ }, z.core.$strict>]>;
5232
+ requestFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
5233
+ payload: z.ZodRecord<z.ZodString, z.ZodString>;
5234
+ fixed: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>>;
5235
+ read: z.ZodObject<{
5236
+ revision: z.ZodString;
5237
+ body: z.ZodString;
5238
+ subject: z.ZodOptional<z.ZodString>;
5239
+ to: z.ZodOptional<z.ZodString>;
5240
+ cc: z.ZodOptional<z.ZodString>;
5241
+ bcc: z.ZodOptional<z.ZodString>;
5242
+ attachments: z.ZodOptional<z.ZodString>;
5243
+ }, z.core.$strict>;
5244
+ }, z.core.$strict>>;
5245
+ }, z.core.$strict>;
5246
+ display: z.ZodOptional<z.ZodObject<{
5247
+ bodyFormat: z.ZodOptional<z.ZodLiteral<"mrkdwn">>;
5248
+ replyField: z.ZodOptional<z.ZodString>;
5249
+ replyLabel: z.ZodOptional<z.ZodString>;
5250
+ facts: z.ZodOptional<z.ZodArray<z.ZodObject<{
5251
+ label: z.ZodString;
5252
+ field: z.ZodString;
5253
+ }, z.core.$strict>>>;
5254
+ }, z.core.$strict>>;
4914
5255
  }, z.core.$strict>>>;
4915
5256
  eventDefinitions: z.ZodOptional<z.ZodArray<z.ZodObject<{
4916
5257
  localId: z.ZodString;
@@ -6267,6 +6608,9 @@ export declare function mintOperation(input: OperationCaptureInput, clock?: Capt
6267
6608
  readonly gaps: readonly ArtifactProvenanceGap[];
6268
6609
  };
6269
6610
 
6611
+ /** The namespace of a qualified auth ref (`google` in `google.oauth`); empty for a local ref. */
6612
+ export declare function namespaceOfQualifiedRef(ref: string): string;
6613
+
6270
6614
  export declare const NonEmptyString: z.ZodString;
6271
6615
 
6272
6616
  /**
@@ -8583,9 +8927,9 @@ export declare const PluginContributionKind: z.ZodEnum<{
8583
8927
  endpoint: "endpoint";
8584
8928
  storage: "storage";
8585
8929
  command: "command";
8930
+ uriModule: "uriModule";
8586
8931
  authService: "authService";
8587
8932
  app: "app";
8588
- uriModule: "uriModule";
8589
8933
  configSection: "configSection";
8590
8934
  skill: "skill";
8591
8935
  converter: "converter";
@@ -9541,6 +9885,12 @@ declare type PrereleaseIdentifier = string | number;
9541
9885
  */
9542
9886
  export declare const PRIVATE_PLUGIN_CAPABILITY_SLUGS: readonly PluginCapabilitySlug[];
9543
9887
 
9888
+ /**
9889
+ * What a manifest's JSON declares about compatibility, read the way a directory's verdict reads it:
9890
+ * apart from the strict schema, because a manifest written for another SDK may not pass that schema.
9891
+ */
9892
+ export declare function readKayPluginDeclaredCompatibility(manifest: unknown): DeclaredKayPluginCompatibility | undefined;
9893
+
9544
9894
  export declare const ReferenceOpenBehavior: z.ZodDiscriminatedUnion<[z.ZodObject<{
9545
9895
  kind: z.ZodLiteral<"working-document">;
9546
9896
  }, z.core.$strict>, z.ZodObject<{
@@ -10006,6 +10356,7 @@ export declare const ResolvedKayAgentUriModule: z.ZodObject<{
10006
10356
  schemes: z.ZodArray<z.ZodString>;
10007
10357
  displayName: z.ZodOptional<z.ZodString>;
10008
10358
  authServiceId: z.ZodOptional<z.ZodString>;
10359
+ authSchemeId: z.ZodOptional<z.ZodString>;
10009
10360
  knownResources: z.ZodOptional<z.ZodLiteral<true>>;
10010
10361
  describesOperations: z.ZodOptional<z.ZodLiteral<true>>;
10011
10362
  }, z.core.$strict>;
@@ -10013,14 +10364,80 @@ export declare const ResolvedKayAgentUriModule: z.ZodObject<{
10013
10364
  export declare type ResolvedKayAgentUriModule = z.infer<typeof ResolvedKayAgentUriModule>;
10014
10365
 
10015
10366
  export declare const ResolvedKayAppApprovalType: z.ZodObject<{
10367
+ kind: z.ZodLiteral<"message">;
10016
10368
  localId: z.ZodString;
10369
+ provider: z.ZodString;
10370
+ unknownMessage: z.ZodString;
10371
+ fields: z.ZodObject<{
10372
+ body: z.ZodObject<{
10373
+ key: z.ZodString;
10374
+ max: z.ZodNumber;
10375
+ }, z.core.$strict>;
10376
+ subject: z.ZodOptional<z.ZodObject<{
10377
+ key: z.ZodString;
10378
+ max: z.ZodNumber;
10379
+ }, z.core.$strict>>;
10380
+ }, z.core.$strict>;
10381
+ presentation: z.ZodObject<{
10382
+ showAccount: z.ZodBoolean;
10383
+ recipient: z.ZodEnum<{
10384
+ target: "target";
10385
+ person: "person";
10386
+ }>;
10387
+ }, z.core.$strict>;
10388
+ forms: z.ZodObject<{
10389
+ inline: z.ZodOptional<z.ZodObject<{
10390
+ uri: z.ZodUnion<readonly [z.ZodObject<{
10391
+ fixed: z.ZodString;
10392
+ }, z.core.$strict>, z.ZodObject<{
10393
+ value: z.ZodString;
10394
+ }, z.core.$strict>]>;
10395
+ requestFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
10396
+ payload: z.ZodRecord<z.ZodString, z.ZodString>;
10397
+ fixed: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>>;
10398
+ }, z.core.$strict>>;
10399
+ saved: z.ZodOptional<z.ZodObject<{
10400
+ uri: z.ZodUnion<readonly [z.ZodObject<{
10401
+ fixed: z.ZodString;
10402
+ }, z.core.$strict>, z.ZodObject<{
10403
+ value: z.ZodString;
10404
+ }, z.core.$strict>]>;
10405
+ requestFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
10406
+ payload: z.ZodRecord<z.ZodString, z.ZodString>;
10407
+ fixed: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>>;
10408
+ }, z.core.$strict>>;
10409
+ stored: z.ZodOptional<z.ZodObject<{
10410
+ uri: z.ZodUnion<readonly [z.ZodObject<{
10411
+ fixed: z.ZodString;
10412
+ }, z.core.$strict>, z.ZodObject<{
10413
+ value: z.ZodString;
10414
+ }, z.core.$strict>]>;
10415
+ requestFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
10416
+ payload: z.ZodRecord<z.ZodString, z.ZodString>;
10417
+ fixed: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>>;
10418
+ read: z.ZodObject<{
10419
+ revision: z.ZodString;
10420
+ body: z.ZodString;
10421
+ subject: z.ZodOptional<z.ZodString>;
10422
+ to: z.ZodOptional<z.ZodString>;
10423
+ cc: z.ZodOptional<z.ZodString>;
10424
+ bcc: z.ZodOptional<z.ZodString>;
10425
+ attachments: z.ZodOptional<z.ZodString>;
10426
+ }, z.core.$strict>;
10427
+ }, z.core.$strict>>;
10428
+ }, z.core.$strict>;
10429
+ display: z.ZodOptional<z.ZodObject<{
10430
+ bodyFormat: z.ZodOptional<z.ZodLiteral<"mrkdwn">>;
10431
+ replyField: z.ZodOptional<z.ZodString>;
10432
+ replyLabel: z.ZodOptional<z.ZodString>;
10433
+ facts: z.ZodOptional<z.ZodArray<z.ZodObject<{
10434
+ label: z.ZodString;
10435
+ field: z.ZodString;
10436
+ }, z.core.$strict>>>;
10437
+ }, z.core.$strict>>;
10017
10438
  globalId: z.ZodString;
10018
- kind: z.ZodEnum<{
10019
- message: "message";
10020
- change: "change";
10021
- action: "action";
10022
- access: "access";
10023
- }>;
10439
+ moduleId: z.ZodString;
10440
+ authService: z.ZodOptional<z.ZodString>;
10024
10441
  }, z.core.$strict>;
10025
10442
 
10026
10443
  export declare type ResolvedKayAppApprovalType = z.infer<typeof ResolvedKayAppApprovalType>;
@@ -10499,9 +10916,9 @@ export declare const ResolvedPluginContractV1: z.ZodObject<{
10499
10916
  endpoint: "endpoint";
10500
10917
  storage: "storage";
10501
10918
  command: "command";
10919
+ uriModule: "uriModule";
10502
10920
  authService: "authService";
10503
10921
  app: "app";
10504
- uriModule: "uriModule";
10505
10922
  configSection: "configSection";
10506
10923
  skill: "skill";
10507
10924
  converter: "converter";
@@ -11156,6 +11573,7 @@ export declare const ResolvedPluginContractV1: z.ZodObject<{
11156
11573
  schemes: z.ZodArray<z.ZodString>;
11157
11574
  displayName: z.ZodOptional<z.ZodString>;
11158
11575
  authServiceId: z.ZodOptional<z.ZodString>;
11576
+ authSchemeId: z.ZodOptional<z.ZodString>;
11159
11577
  knownResources: z.ZodOptional<z.ZodLiteral<true>>;
11160
11578
  describesOperations: z.ZodOptional<z.ZodLiteral<true>>;
11161
11579
  }, z.core.$strict>>>;
@@ -11215,14 +11633,80 @@ export declare const ResolvedPluginContractV1: z.ZodObject<{
11215
11633
  toolName: z.ZodString;
11216
11634
  }, z.core.$strict>>>;
11217
11635
  kayAppApprovalTypes: z.ZodOptional<z.ZodArray<z.ZodObject<{
11636
+ kind: z.ZodLiteral<"message">;
11218
11637
  localId: z.ZodString;
11638
+ provider: z.ZodString;
11639
+ unknownMessage: z.ZodString;
11640
+ fields: z.ZodObject<{
11641
+ body: z.ZodObject<{
11642
+ key: z.ZodString;
11643
+ max: z.ZodNumber;
11644
+ }, z.core.$strict>;
11645
+ subject: z.ZodOptional<z.ZodObject<{
11646
+ key: z.ZodString;
11647
+ max: z.ZodNumber;
11648
+ }, z.core.$strict>>;
11649
+ }, z.core.$strict>;
11650
+ presentation: z.ZodObject<{
11651
+ showAccount: z.ZodBoolean;
11652
+ recipient: z.ZodEnum<{
11653
+ target: "target";
11654
+ person: "person";
11655
+ }>;
11656
+ }, z.core.$strict>;
11657
+ forms: z.ZodObject<{
11658
+ inline: z.ZodOptional<z.ZodObject<{
11659
+ uri: z.ZodUnion<readonly [z.ZodObject<{
11660
+ fixed: z.ZodString;
11661
+ }, z.core.$strict>, z.ZodObject<{
11662
+ value: z.ZodString;
11663
+ }, z.core.$strict>]>;
11664
+ requestFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
11665
+ payload: z.ZodRecord<z.ZodString, z.ZodString>;
11666
+ fixed: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>>;
11667
+ }, z.core.$strict>>;
11668
+ saved: z.ZodOptional<z.ZodObject<{
11669
+ uri: z.ZodUnion<readonly [z.ZodObject<{
11670
+ fixed: z.ZodString;
11671
+ }, z.core.$strict>, z.ZodObject<{
11672
+ value: z.ZodString;
11673
+ }, z.core.$strict>]>;
11674
+ requestFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
11675
+ payload: z.ZodRecord<z.ZodString, z.ZodString>;
11676
+ fixed: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>>;
11677
+ }, z.core.$strict>>;
11678
+ stored: z.ZodOptional<z.ZodObject<{
11679
+ uri: z.ZodUnion<readonly [z.ZodObject<{
11680
+ fixed: z.ZodString;
11681
+ }, z.core.$strict>, z.ZodObject<{
11682
+ value: z.ZodString;
11683
+ }, z.core.$strict>]>;
11684
+ requestFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
11685
+ payload: z.ZodRecord<z.ZodString, z.ZodString>;
11686
+ fixed: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>>;
11687
+ read: z.ZodObject<{
11688
+ revision: z.ZodString;
11689
+ body: z.ZodString;
11690
+ subject: z.ZodOptional<z.ZodString>;
11691
+ to: z.ZodOptional<z.ZodString>;
11692
+ cc: z.ZodOptional<z.ZodString>;
11693
+ bcc: z.ZodOptional<z.ZodString>;
11694
+ attachments: z.ZodOptional<z.ZodString>;
11695
+ }, z.core.$strict>;
11696
+ }, z.core.$strict>>;
11697
+ }, z.core.$strict>;
11698
+ display: z.ZodOptional<z.ZodObject<{
11699
+ bodyFormat: z.ZodOptional<z.ZodLiteral<"mrkdwn">>;
11700
+ replyField: z.ZodOptional<z.ZodString>;
11701
+ replyLabel: z.ZodOptional<z.ZodString>;
11702
+ facts: z.ZodOptional<z.ZodArray<z.ZodObject<{
11703
+ label: z.ZodString;
11704
+ field: z.ZodString;
11705
+ }, z.core.$strict>>>;
11706
+ }, z.core.$strict>>;
11219
11707
  globalId: z.ZodString;
11220
- kind: z.ZodEnum<{
11221
- message: "message";
11222
- change: "change";
11223
- action: "action";
11224
- access: "access";
11225
- }>;
11708
+ moduleId: z.ZodString;
11709
+ authService: z.ZodOptional<z.ZodString>;
11226
11710
  }, z.core.$strict>>>;
11227
11711
  kayAppDataSources: z.ZodOptional<z.ZodArray<z.ZodObject<{
11228
11712
  localId: z.ZodString;
@@ -11403,9 +11887,9 @@ export declare const ResolvedPluginContributionId: z.ZodObject<{
11403
11887
  endpoint: "endpoint";
11404
11888
  storage: "storage";
11405
11889
  command: "command";
11890
+ uriModule: "uriModule";
11406
11891
  authService: "authService";
11407
11892
  app: "app";
11408
- uriModule: "uriModule";
11409
11893
  configSection: "configSection";
11410
11894
  skill: "skill";
11411
11895
  converter: "converter";
@@ -13065,6 +13549,7 @@ export declare type UiSlotContribution = z.infer<typeof UiSlotContribution>;
13065
13549
 
13066
13550
  export declare const UriModuleContribution: z.ZodObject<{
13067
13551
  authService: z.ZodOptional<z.ZodString>;
13552
+ authScheme: z.ZodOptional<z.ZodString>;
13068
13553
  knownResources: z.ZodOptional<z.ZodLiteral<true>>;
13069
13554
  describesOperations: z.ZodOptional<z.ZodLiteral<true>>;
13070
13555
  claims: z.ZodExactOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
package/dist/index.js CHANGED
@@ -222,8 +222,8 @@ var JsonSchema = z4.record(z4.string(), JsonValue);
222
222
  // packages/plugin-protocol/dist/common.js
223
223
  var KAY_PLUGIN_PROTOCOL_VERSION = "kay.plugin.v1";
224
224
  var KAY_PLUGIN_PROTOCOL_PACKAGE_NAME = "@bonsai/plugin-protocol";
225
- var KAY_PLUGIN_SDK_VERSION = "0.26.3";
226
- var KAY_PLUGIN_COMPATIBLE_SDK_VERSIONS = [];
225
+ var KAY_PLUGIN_SDK_VERSION = "0.27.1";
226
+ var KAY_PLUGIN_COMPATIBLE_SDK_VERSIONS = ["0.26.3"];
227
227
  var KAY_PLUGIN_TARGET_NAMES = [
228
228
  "kay.agent",
229
229
  "kay.app",
@@ -1235,6 +1235,9 @@ function isQualifiedAuthServiceRef(ref) {
1235
1235
  function isQualifiedAuthSchemeRef(ref) {
1236
1236
  return ref.includes(".");
1237
1237
  }
1238
+ function namespaceOfQualifiedRef(ref) {
1239
+ return ref.slice(0, Math.max(0, ref.lastIndexOf(".")));
1240
+ }
1238
1241
  function resolveAdapterId(globalId, declaredAdapterId) {
1239
1242
  return declaredAdapterId ?? globalId;
1240
1243
  }
@@ -2666,6 +2669,8 @@ __export(contributions_exports, {
2666
2669
  AppDataSourceContribution: () => AppDataSourceContribution,
2667
2670
  AppEventSubscription: () => AppEventSubscription,
2668
2671
  AppUriModuleContribution: () => AppUriModuleContribution,
2672
+ ApprovalCardForm: () => ApprovalCardForm,
2673
+ ApprovalCardStoredForm: () => ApprovalCardStoredForm,
2669
2674
  ApprovalTypeContribution: () => ApprovalTypeContribution,
2670
2675
  ArtifactUriModuleContribution: () => ArtifactUriModuleContribution,
2671
2676
  CliBindingContribution: () => CliBindingContribution,
@@ -2815,12 +2820,77 @@ var PLUGIN_NOTIFICATION_RULE_HOST_KEYS = [
2815
2820
  ];
2816
2821
  function createContributionsSchemas(canonical) {
2817
2822
  const { PluginEventLocalId: PluginEventLocalId2 } = canonical ? canonicalPluginEventSchemas : plugin_events_exports;
2818
- const { AuthServiceReference: AuthServiceReference2, CliAuthEnvVarName: CliAuthEnvVarName2, CliBinaryName: CliBinaryName2, FileExtensionToken: FileExtensionToken2, GitBasicAuthUser: GitBasicAuthUser2, GitHostName: GitHostName2, LocalContributionId: LocalContributionId2, MimeTypeString: MimeTypeString2, NonEmptyString: NonEmptyString3, PackageAssetPath: PackageAssetPath2, PluginId: PluginId2, PluginToolName: PluginToolName2, TargetEntrypoint: TargetEntrypoint2, UriScheme: UriScheme2 } = canonical ? canonicalCommonSchemas : common_exports;
2823
+ const { AuthSchemeReference: AuthSchemeReference2, AuthServiceReference: AuthServiceReference2, CliAuthEnvVarName: CliAuthEnvVarName2, CliBinaryName: CliBinaryName2, FileExtensionToken: FileExtensionToken2, GitBasicAuthUser: GitBasicAuthUser2, GitHostName: GitHostName2, LocalContributionId: LocalContributionId2, MimeTypeString: MimeTypeString2, NonEmptyString: NonEmptyString3, PackageAssetPath: PackageAssetPath2, PluginId: PluginId2, PluginToolName: PluginToolName2, TargetEntrypoint: TargetEntrypoint2, UriScheme: UriScheme2 } = canonical ? canonicalCommonSchemas : common_exports;
2819
2824
  const { ScopeRequirement: ScopeRequirement2 } = canonical ? canonicalPermissionSchemas : permissions_exports;
2820
2825
  const OptionalDisplayName = NonEmptyString3.optional();
2826
+ const ApprovalCardValueName = z12.string().regex(/^[A-Za-z][A-Za-z0-9_]{0,63}$/u, "must be a plain field name");
2827
+ const ApprovalCardForm2 = z12.strictObject({
2828
+ /** Where the write goes: a fixed address, or the card value that names one. */
2829
+ uri: z12.union([
2830
+ z12.strictObject({ fixed: NonEmptyString3 }),
2831
+ z12.strictObject({ value: ApprovalCardValueName })
2832
+ ]),
2833
+ /** The delivery request fields this kind of card accepts, beyond provider and account. */
2834
+ requestFields: z12.array(ApprovalCardValueName).optional(),
2835
+ /** Payload field to the card value it is filled from. An absent value or empty list is left out. */
2836
+ payload: z12.record(ApprovalCardValueName, ApprovalCardValueName),
2837
+ /** Payload fields with a constant value. */
2838
+ fixed: z12.record(ApprovalCardValueName, z12.union([z12.string(), z12.boolean()])).optional()
2839
+ });
2840
+ const ApprovalCardStoredForm2 = ApprovalCardForm2.extend({
2841
+ read: z12.strictObject({
2842
+ revision: ApprovalCardValueName,
2843
+ body: ApprovalCardValueName,
2844
+ subject: ApprovalCardValueName.optional(),
2845
+ to: ApprovalCardValueName.optional(),
2846
+ cc: ApprovalCardValueName.optional(),
2847
+ bcc: ApprovalCardValueName.optional(),
2848
+ /** A list of `{ filename? }` objects: a card that has any cannot be sent by the app. */
2849
+ attachments: ApprovalCardValueName.optional()
2850
+ })
2851
+ });
2852
+ const ApprovalCardField = z12.strictObject({
2853
+ key: ApprovalCardValueName,
2854
+ max: z12.number().int().positive()
2855
+ });
2821
2856
  const ApprovalTypeContribution2 = z12.strictObject({
2822
2857
  localId: LocalContributionId2,
2823
- kind: approvalKindSchema
2858
+ kind: z12.literal("message"),
2859
+ /** The URI scheme of `uriModule` that cards of this type write to. */
2860
+ provider: UriScheme2,
2861
+ /** The local id of this plugin's URI module that handles the write. */
2862
+ uriModule: LocalContributionId2,
2863
+ /** Shown when a send's outcome cannot be confirmed: where the person checks. */
2864
+ unknownMessage: NonEmptyString3,
2865
+ /** The payload fields holding the text a person may edit. A `subject` makes this a mail type. */
2866
+ fields: z12.strictObject({
2867
+ body: ApprovalCardField,
2868
+ subject: ApprovalCardField.optional()
2869
+ }),
2870
+ presentation: z12.strictObject({
2871
+ showAccount: z12.boolean(),
2872
+ recipient: z12.enum(["person", "target"])
2873
+ }),
2874
+ /** One form per kind of card this provider supports. A kind left out is never bound. */
2875
+ forms: z12.strictObject({
2876
+ inline: ApprovalCardForm2.optional(),
2877
+ saved: ApprovalCardForm2.optional(),
2878
+ stored: ApprovalCardStoredForm2.optional()
2879
+ }),
2880
+ /** What the card shows beyond its text, read from the delivery request. */
2881
+ display: z12.strictObject({
2882
+ /** How the renderer reads the body. Absent is Markdown, or plain for a stored draft. */
2883
+ bodyFormat: z12.literal("mrkdwn").optional(),
2884
+ /** The request field naming what this card replies to. */
2885
+ replyField: ApprovalCardValueName.optional(),
2886
+ /** Shown instead of the reply's id when that id means nothing to a person. */
2887
+ replyLabel: NonEmptyString3.optional(),
2888
+ /** Further request fields shown as labelled lines. */
2889
+ facts: z12.array(z12.strictObject({
2890
+ label: NonEmptyString3,
2891
+ field: ApprovalCardValueName
2892
+ })).optional()
2893
+ }).optional()
2824
2894
  });
2825
2895
  const ToolContribution2 = z12.strictObject({
2826
2896
  localId: LocalContributionId2,
@@ -2982,6 +3052,12 @@ function createContributionsSchemas(canonical) {
2982
3052
  // plugin's already-minted global id and is recorded, not resolved, here (see
2983
3053
  // `consumesAuthServices` on the resolved contract).
2984
3054
  authService: AuthServiceReference2.optional(),
3055
+ // A scheme of the module's `authService`: every call to this module must use exactly this
3056
+ // scheme. A local ref names a scheme of a service in this manifest; a dotted ref names a scheme
3057
+ // of another plugin's service (`google.oauth`). The daemon reads it here because it may hold
3058
+ // only the manifest (a plugin that runs in the plugin host), and the host refuses a module
3059
+ // whose code names a different one.
3060
+ authScheme: AuthSchemeReference2.optional(),
2985
3061
  // Opt this module's traffic into the daemon's known-resources ledger: the
2986
3062
  // HOST records the canonical URIs (plus title/summary/mime facts) that flow
2987
3063
  // through the module's successful read/list/search resolutions (a read only
@@ -3000,6 +3076,7 @@ function createContributionsSchemas(canonical) {
3000
3076
  const AppUriModuleContribution2 = UriModuleContribution2.omit({
3001
3077
  authActions: true,
3002
3078
  authService: true,
3079
+ authScheme: true,
3003
3080
  knownResources: true,
3004
3081
  describesOperations: true
3005
3082
  });
@@ -3488,6 +3565,8 @@ function createContributionsSchemas(canonical) {
3488
3565
  "configSection"
3489
3566
  ]);
3490
3567
  return {
3568
+ ApprovalCardForm: ApprovalCardForm2,
3569
+ ApprovalCardStoredForm: ApprovalCardStoredForm2,
3491
3570
  ApprovalTypeContribution: ApprovalTypeContribution2,
3492
3571
  UriModuleFacts: UriModuleFacts2,
3493
3572
  ToolContribution: ToolContribution2,
@@ -3544,7 +3623,7 @@ function createContributionsSchemas(canonical) {
3544
3623
  PluginContributionKind: PluginContributionKind2
3545
3624
  };
3546
3625
  }
3547
- var { ApprovalTypeContribution, UriModuleFacts, ToolContribution, ToolPermission, AgentToolContribution, ConverterContribution, UriModuleContribution, AppUriModuleContribution, AppDataSourceContribution, WhiteboardTypeStorage, WhiteboardTypeContribution, AppDataMaterializerContribution, ArtifactUriModuleContribution, CliBindingContribution, GitHostContribution, ResourceContribution, SkillContribution, PluginSkillSourceDeclaration, SearchProviderContribution, InteractionDriverContribution, EntityResolverContribution, AgentRenderContribution, EndpointContribution, 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, UiAppActivityRail, UiAppContribution, ThemeContribution, CommandHandler, CommandContribution, PluginContributionKind } = createContributionsSchemas(false);
3626
+ 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, 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, UiAppActivityRail, UiAppContribution, ThemeContribution, CommandHandler, CommandContribution, PluginContributionKind } = createContributionsSchemas(false);
3548
3627
  var canonicalContributionSchemas = createContributionsSchemas(true);
3549
3628
 
3550
3629
  // packages/plugin-protocol/dist/icon-shape.js
@@ -4271,6 +4350,27 @@ function createManifestSchemas(canonical) {
4271
4350
  reportDuplicateLocalIds(ctx, ["targets", "kay", "app", "contributes", "eventDefinitions"], manifest.targets?.kay?.app?.contributes?.eventDefinitions, "plugin event definition");
4272
4351
  reportDuplicateLocalIds(ctx, ["targets", "kay", "app", "contributes", "contextContributors"], manifest.targets?.kay?.app?.contributes?.contextContributors, "context contributor");
4273
4352
  reportDuplicateLocalIds(ctx, ["targets", "kay", "app", "contributes", "approvalTypes"], manifest.targets?.kay?.app?.contributes?.approvalTypes, "approval type");
4353
+ for (const [index, type] of (manifest.targets?.kay?.app?.contributes?.approvalTypes ?? []).entries()) {
4354
+ const module = [
4355
+ ...manifest.targets?.kay?.agent?.contributes?.uriModules ?? [],
4356
+ ...manifest.targets?.kay?.app?.contributes?.uriModules ?? []
4357
+ ].find((candidate) => candidate.localId === type.uriModule);
4358
+ if (module === void 0 || !module.schemes.includes(type.provider)) {
4359
+ ctx.addIssue({
4360
+ code: "custom",
4361
+ path: [
4362
+ "targets",
4363
+ "kay",
4364
+ "app",
4365
+ "contributes",
4366
+ "approvalTypes",
4367
+ index,
4368
+ "uriModule"
4369
+ ],
4370
+ message: `approval type ${type.localId} must name one of this plugin's URI modules, with provider ${type.provider} among its schemes`
4371
+ });
4372
+ }
4373
+ }
4274
4374
  const syntheticContributionIds = collectSyntheticContributionIds(manifest);
4275
4375
  for (const contribution of collectDeclaredContributionIds(manifest)) {
4276
4376
  if (syntheticContributionIds.has(contribution.localId)) {
@@ -4344,6 +4444,13 @@ function createManifestSchemas(canonical) {
4344
4444
  message: `uri module ${module.localId} references unknown auth service ${module.authService}`
4345
4445
  });
4346
4446
  }
4447
+ if (module.authScheme !== void 0 && (module.authService === void 0 || (isQualifiedAuthServiceRef(module.authService) ? namespaceOfQualifiedRef(module.authScheme) !== namespaceOfQualifiedRef(module.authService) : authSchemeIdsByService.get(module.authService)?.has(module.authScheme) !== true))) {
4448
+ ctx.addIssue({
4449
+ code: "custom",
4450
+ path: ["targets", "kay", "agent", "contributes", "uriModules"],
4451
+ message: `uri module ${module.localId} names auth scheme ${module.authScheme}, which is not a scheme of its authService`
4452
+ });
4453
+ }
4347
4454
  }
4348
4455
  for (const [index, tool] of (manifest.targets?.kay?.agent?.contributes?.tools ?? []).entries()) {
4349
4456
  const path = ["targets", "kay", "agent", "contributes", "tools", index];
@@ -4887,7 +4994,7 @@ function boundPluginDiagnosticMessage(message) {
4887
4994
  import { z as z14 } from "zod";
4888
4995
  function createResolvedContractSchemas(canonical) {
4889
4996
  const { PluginEventLocalId: PluginEventLocalId2 } = canonical ? canonicalPluginEventSchemas : plugin_events_exports;
4890
- const { KayUiAppHostCapability: KayUiAppHostCapability2, UiAppActivityRail: UiAppActivityRail2, McpServerAuthMode: McpServerAuthMode2, McpServerUrl: McpServerUrl2, PluginContributionKind: PluginContributionKindSchema, ReferenceOpenBehavior: ReferenceOpenBehavior2, ReferencePresentationUriPattern: ReferencePresentationUriPattern2, ReferencePresentationUrlClaim: ReferencePresentationUrlClaim2, ReferencePresentationVariants: ReferencePresentationVariants2, UriModuleFacts: UriModuleFacts2, WhiteboardTypeStorage: WhiteboardTypeStorage2 } = canonical ? canonicalContributionSchemas : contributions_exports;
4997
+ const { ApprovalTypeContribution: ApprovalTypeContribution2, KayUiAppHostCapability: KayUiAppHostCapability2, UiAppActivityRail: UiAppActivityRail2, McpServerAuthMode: McpServerAuthMode2, McpServerUrl: McpServerUrl2, PluginContributionKind: PluginContributionKindSchema, ReferenceOpenBehavior: ReferenceOpenBehavior2, ReferencePresentationUriPattern: ReferencePresentationUriPattern2, ReferencePresentationUrlClaim: ReferencePresentationUrlClaim2, ReferencePresentationVariants: ReferencePresentationVariants2, UriModuleFacts: UriModuleFacts2, WhiteboardTypeStorage: WhiteboardTypeStorage2 } = canonical ? canonicalContributionSchemas : contributions_exports;
4891
4998
  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;
4892
4999
  const { PluginExternalCliConnect: PluginExternalCliConnect2, PluginOAuthClientSupplier: PluginOAuthClientSupplier2 } = canonical ? canonicalManifestSchemas : manifest_exports;
4893
5000
  const { ResolvedPluginGrants: ResolvedPluginGrants2 } = canonical ? canonicalPermissionSchemas : permissions_exports;
@@ -4952,10 +5059,14 @@ function createResolvedContractSchemas(canonical) {
4952
5059
  });
4953
5060
  }
4954
5061
  });
4955
- const ResolvedKayAppApprovalType2 = z14.strictObject({
4956
- localId: LocalContributionId2,
5062
+ const ResolvedKayAppApprovalType2 = ApprovalTypeContribution2.omit({
5063
+ uriModule: true
5064
+ }).extend({
4957
5065
  globalId: GlobalContributionId2,
4958
- kind: approvalKindSchema
5066
+ /** The global id of the URI module that handles the write. */
5067
+ moduleId: GlobalContributionId2,
5068
+ /** The auth service that module signs in through, whose accounts a card may send from. */
5069
+ authService: GlobalContributionId2.optional()
4959
5070
  });
4960
5071
  const ResolvedKayAppWhiteboardType2 = z14.strictObject({
4961
5072
  localId: LocalContributionId2,
@@ -4981,6 +5092,8 @@ function createResolvedContractSchemas(canonical) {
4981
5092
  schemes: z14.array(UriScheme2).min(1),
4982
5093
  displayName: NonEmptyString3.optional(),
4983
5094
  authServiceId: GlobalContributionId2.optional(),
5095
+ /** Mirrors `UriModuleContribution.authScheme`; a local ref takes the plugin's namespace. */
5096
+ authSchemeId: GlobalContributionId2.optional(),
4984
5097
  /** Mirrors `UriModuleContribution.knownResources` (host-side recording opt-in). */
4985
5098
  knownResources: z14.literal(true).optional(),
4986
5099
  /** Mirrors `UriModuleContribution.describesOperations`. */
@@ -5554,11 +5667,17 @@ function resolveKayPluginContractV1(manifest) {
5554
5667
  change: source.change,
5555
5668
  ...source.read === void 0 ? {} : { read: source.read }
5556
5669
  }));
5557
- const kayAppApprovalTypes = manifest.targets?.kay?.app?.contributes?.approvalTypes?.map((type) => ({
5558
- localId: type.localId,
5559
- globalId: resolveGlobalContributionId(namespace, type.localId),
5560
- kind: type.kind
5561
- }));
5670
+ const kayAppApprovalTypes = manifest.targets?.kay?.app?.contributes?.approvalTypes?.map(({ uriModule, ...type }) => {
5671
+ const authService = manifest.targets?.kay?.agent?.contributes?.uriModules?.find((candidate) => candidate.localId === uriModule)?.authService;
5672
+ return {
5673
+ ...type,
5674
+ globalId: resolveGlobalContributionId(namespace, type.localId),
5675
+ moduleId: resolveGlobalContributionId(namespace, uriModule),
5676
+ ...authService === void 0 ? {} : {
5677
+ authService: authService.includes(".") ? authService : resolveGlobalContributionId(namespace, authService)
5678
+ }
5679
+ };
5680
+ });
5562
5681
  const kayAppWhiteboardTypes = manifest.targets?.kay?.app?.contributes?.whiteboardTypes?.map((type) => ({
5563
5682
  localId: type.localId,
5564
5683
  globalId: resolveGlobalContributionId(namespace, type.localId),
@@ -5589,6 +5708,9 @@ function resolveKayPluginContractV1(manifest) {
5589
5708
  ...module.authService === void 0 ? {} : {
5590
5709
  authServiceId: isQualifiedAuthServiceRef(module.authService) ? module.authService : resolveGlobalContributionId(namespace, module.authService)
5591
5710
  },
5711
+ ...module.authScheme === void 0 ? {} : {
5712
+ authSchemeId: isQualifiedAuthSchemeRef(module.authScheme) ? module.authScheme : resolveGlobalContributionId(namespace, module.authScheme)
5713
+ },
5592
5714
  ...module.knownResources === void 0 ? {} : { knownResources: module.knownResources },
5593
5715
  ...module.describesOperations === void 0 ? {} : { describesOperations: module.describesOperations },
5594
5716
  ...uriModuleFacts(module)
@@ -5708,7 +5830,7 @@ function safeResolveKayPluginContractV1(manifest) {
5708
5830
  throw error;
5709
5831
  }
5710
5832
  }
5711
- function uriModuleFacts({ localId: _localId, schemes: _schemes, displayName: _displayName, authService: _authService, knownResources: _knownResources, describesOperations: _describesOperations, ...facts }) {
5833
+ function uriModuleFacts({ localId: _localId, schemes: _schemes, displayName: _displayName, authService: _authService, authScheme: _authScheme, knownResources: _knownResources, describesOperations: _describesOperations, ...facts }) {
5712
5834
  return facts;
5713
5835
  }
5714
5836
 
@@ -5888,6 +6010,10 @@ function keepNamespaceDerivedTools(contract, grandfathered) {
5888
6010
  misnamedTools
5889
6011
  };
5890
6012
  }
6013
+ function readKayPluginDeclaredCompatibility(manifest) {
6014
+ const head = ReadableManifestHead.safeParse(manifest);
6015
+ return head.success ? head.data.compatibility : void 0;
6016
+ }
5891
6017
  function namedIn(head) {
5892
6018
  if (head.id === void 0)
5893
6019
  return KAY_PLUGIN_MANIFEST_FILENAME;
@@ -6399,6 +6525,8 @@ export {
6399
6525
  AppDataSourceRead,
6400
6526
  AppEventSubscription,
6401
6527
  AppUriModuleContribution,
6528
+ ApprovalCardForm,
6529
+ ApprovalCardStoredForm,
6402
6530
  ApprovalOrigin,
6403
6531
  ApprovalTypeContribution,
6404
6532
  ArtifactGenerationId,
@@ -6659,6 +6787,7 @@ export {
6659
6787
  kayPluginHostCompatibility,
6660
6788
  kayUiEventSubscriptionsFromManifest,
6661
6789
  mintOperation,
6790
+ namespaceOfQualifiedRef,
6662
6791
  normalizeNetworkConnectHost,
6663
6792
  parseArtifactOutputUri,
6664
6793
  parseArtifactProvenanceCaptureContext,
@@ -6670,6 +6799,7 @@ export {
6670
6799
  parseSemver,
6671
6800
  pluginIconShape,
6672
6801
  precedingPersonMessages,
6802
+ readKayPluginDeclaredCompatibility,
6673
6803
  refineWebSessionScopeConfined,
6674
6804
  resolveAdapterId,
6675
6805
  resolveGlobalContributionId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yaklabs-ai/plugin-protocol",
3
- "version": "0.26.3",
3
+ "version": "0.27.1",
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",