@yaklabs-ai/plugin-protocol 0.43.0 → 0.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -11,7 +11,7 @@ flow.
11
11
  ```json
12
12
  {
13
13
  "dependencies": {
14
- "@bonsai/plugin-protocol": "npm:@yaklabs-ai/plugin-protocol@^0.43.0"
14
+ "@bonsai/plugin-protocol": "npm:@yaklabs-ai/plugin-protocol@^0.45.0"
15
15
  }
16
16
  }
17
17
  ```
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "package": "@yaklabs-ai/plugin-protocol",
4
- "version": "0.43.0",
4
+ "version": "0.45.0",
5
5
  "target": "npm",
6
6
  "firstPartyLicense": "MIT",
7
7
  "bundled": [],
package/dist/index.d.ts CHANGED
@@ -1669,6 +1669,7 @@ declare namespace authoringContributionSchemas {
1669
1669
  EntityResolverContribution,
1670
1670
  AgentRenderContribution,
1671
1671
  EndpointContribution,
1672
+ PluginCardContribution,
1672
1673
  WorkflowContribution,
1673
1674
  McpServerUrl,
1674
1675
  McpServerAuthMode,
@@ -1706,7 +1707,8 @@ declare namespace authoringContributionSchemas {
1706
1707
  CommandHandler,
1707
1708
  CommandContribution,
1708
1709
  PluginContributionKind,
1709
- canonicalContributionSchemas
1710
+ canonicalContributionSchemas,
1711
+ PluginCardResult
1710
1712
  }
1711
1713
  }
1712
1714
 
@@ -2541,6 +2543,14 @@ declare const canonicalContributionSchemas: {
2541
2543
  }, z.core.$strict>>;
2542
2544
  timeoutMs: z.ZodOptional<z.ZodNumber>;
2543
2545
  }, z.core.$strict>;
2546
+ PluginCardContribution: z.ZodObject<{
2547
+ localId: z.ZodString;
2548
+ description: z.ZodString;
2549
+ inputs: z.ZodRecord<z.ZodString, z.ZodType<authoringCommonSchemas.JsonValue, unknown, z.core.$ZodTypeInternals<authoringCommonSchemas.JsonValue, unknown>>>;
2550
+ readEndpoint: z.ZodString;
2551
+ submitEndpoint: z.ZodString;
2552
+ authService: z.ZodOptional<z.ZodString>;
2553
+ }, z.core.$strict>;
2544
2554
  WorkflowContribution: z.ZodObject<{
2545
2555
  localId: z.ZodString;
2546
2556
  name: z.ZodString;
@@ -2741,6 +2751,15 @@ declare const canonicalContributionSchemas: {
2741
2751
  plugin: "plugin";
2742
2752
  }>>;
2743
2753
  kind: z.ZodOptional<z.ZodString>;
2754
+ kinds: z.ZodOptional<z.ZodArray<z.ZodObject<{
2755
+ pattern: z.ZodObject<{
2756
+ protocol: z.ZodString;
2757
+ hostname: z.ZodString;
2758
+ pathname: z.ZodOptional<z.ZodString>;
2759
+ search: z.ZodOptional<z.ZodString>;
2760
+ }, z.core.$strict>;
2761
+ kind: z.ZodString;
2762
+ }, z.core.$strict>>>;
2744
2763
  noun: z.ZodOptional<z.ZodString>;
2745
2764
  target: z.ZodOptional<z.ZodString>;
2746
2765
  kindNamesSource: z.ZodOptional<z.ZodLiteral<true>>;
@@ -2823,6 +2842,15 @@ declare const canonicalContributionSchemas: {
2823
2842
  plugin: "plugin";
2824
2843
  }>>;
2825
2844
  kind: z.ZodOptional<z.ZodString>;
2845
+ kinds: z.ZodOptional<z.ZodArray<z.ZodObject<{
2846
+ pattern: z.ZodObject<{
2847
+ protocol: z.ZodString;
2848
+ hostname: z.ZodString;
2849
+ pathname: z.ZodOptional<z.ZodString>;
2850
+ search: z.ZodOptional<z.ZodString>;
2851
+ }, z.core.$strict>;
2852
+ kind: z.ZodString;
2853
+ }, z.core.$strict>>>;
2826
2854
  noun: z.ZodOptional<z.ZodString>;
2827
2855
  target: z.ZodOptional<z.ZodString>;
2828
2856
  kindNamesSource: z.ZodOptional<z.ZodLiteral<true>>;
@@ -3030,6 +3058,7 @@ declare const canonicalContributionSchemas: {
3030
3058
  interactionDriver: "interactionDriver";
3031
3059
  entityResolver: "entityResolver";
3032
3060
  agentRenderer: "agentRenderer";
3061
+ pluginCard: "pluginCard";
3033
3062
  eventDefinition: "eventDefinition";
3034
3063
  eventSubscription: "eventSubscription";
3035
3064
  appDataSource: "appDataSource";
@@ -4294,8 +4323,13 @@ export declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
4294
4323
  *
4295
4324
  * 0.43.0 adds product events (#15769). `productEvents` in a plugin's `kay.app` target declares them,
4296
4325
  * and `app.productEvents.send` sends them. Additive: a plugin that declares one declares ^0.43.0.
4326
+ *
4327
+ * 0.44.0 adds `words.kinds` to a reference presentation (#15905): an ordered list of address patterns
4328
+ * and the kind each one names. Additive: a plugin that lists them declares ^0.44.0.
4329
+ *
4330
+ * 0.45.0 adds declared plugin cards and app.implementCard for their read/submit endpoints.
4297
4331
  */
4298
- export declare const KAY_PLUGIN_SDK_VERSION: "0.43.0";
4332
+ export declare const KAY_PLUGIN_SDK_VERSION: "0.45.0";
4299
4333
 
4300
4334
  export declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
4301
4335
 
@@ -4650,6 +4684,14 @@ export declare const KayAppTargetManifest: z.ZodObject<{
4650
4684
  }, z.core.$strict>>;
4651
4685
  timeoutMs: z.ZodOptional<z.ZodNumber>;
4652
4686
  }, z.core.$strict>>>;
4687
+ cards: z.ZodOptional<z.ZodArray<z.ZodObject<{
4688
+ localId: z.ZodString;
4689
+ description: z.ZodString;
4690
+ inputs: z.ZodRecord<z.ZodString, z.ZodType<authoringCommonSchemas.JsonValue, unknown, z.core.$ZodTypeInternals<authoringCommonSchemas.JsonValue, unknown>>>;
4691
+ readEndpoint: z.ZodString;
4692
+ submitEndpoint: z.ZodString;
4693
+ authService: z.ZodOptional<z.ZodString>;
4694
+ }, z.core.$strict>>>;
4653
4695
  uriModules: z.ZodOptional<z.ZodArray<z.ZodObject<{
4654
4696
  description: z.ZodExactOptional<z.ZodString>;
4655
4697
  localId: z.ZodString;
@@ -5443,6 +5485,14 @@ export declare const KayPluginManifestV1: z.ZodObject<{
5443
5485
  }, z.core.$strict>>;
5444
5486
  timeoutMs: z.ZodOptional<z.ZodNumber>;
5445
5487
  }, z.core.$strict>>>;
5488
+ cards: z.ZodOptional<z.ZodArray<z.ZodObject<{
5489
+ localId: z.ZodString;
5490
+ description: z.ZodString;
5491
+ inputs: z.ZodRecord<z.ZodString, z.ZodType<authoringCommonSchemas.JsonValue, unknown, z.core.$ZodTypeInternals<authoringCommonSchemas.JsonValue, unknown>>>;
5492
+ readEndpoint: z.ZodString;
5493
+ submitEndpoint: z.ZodString;
5494
+ authService: z.ZodOptional<z.ZodString>;
5495
+ }, z.core.$strict>>>;
5446
5496
  uriModules: z.ZodOptional<z.ZodArray<z.ZodObject<{
5447
5497
  description: z.ZodExactOptional<z.ZodString>;
5448
5498
  localId: z.ZodString;
@@ -5903,6 +5953,15 @@ export declare const KayPluginManifestV1: z.ZodObject<{
5903
5953
  plugin: "plugin";
5904
5954
  }>>;
5905
5955
  kind: z.ZodOptional<z.ZodString>;
5956
+ kinds: z.ZodOptional<z.ZodArray<z.ZodObject<{
5957
+ pattern: z.ZodObject<{
5958
+ protocol: z.ZodString;
5959
+ hostname: z.ZodString;
5960
+ pathname: z.ZodOptional<z.ZodString>;
5961
+ search: z.ZodOptional<z.ZodString>;
5962
+ }, z.core.$strict>;
5963
+ kind: z.ZodString;
5964
+ }, z.core.$strict>>>;
5906
5965
  noun: z.ZodOptional<z.ZodString>;
5907
5966
  target: z.ZodOptional<z.ZodString>;
5908
5967
  kindNamesSource: z.ZodOptional<z.ZodLiteral<true>>;
@@ -7060,6 +7119,15 @@ export declare const KayUiTargetManifest: z.ZodObject<{
7060
7119
  plugin: "plugin";
7061
7120
  }>>;
7062
7121
  kind: z.ZodOptional<z.ZodString>;
7122
+ kinds: z.ZodOptional<z.ZodArray<z.ZodObject<{
7123
+ pattern: z.ZodObject<{
7124
+ protocol: z.ZodString;
7125
+ hostname: z.ZodString;
7126
+ pathname: z.ZodOptional<z.ZodString>;
7127
+ search: z.ZodOptional<z.ZodString>;
7128
+ }, z.core.$strict>;
7129
+ kind: z.ZodString;
7130
+ }, z.core.$strict>>>;
7063
7131
  noun: z.ZodOptional<z.ZodString>;
7064
7132
  target: z.ZodOptional<z.ZodString>;
7065
7133
  kindNamesSource: z.ZodOptional<z.ZodLiteral<true>>;
@@ -9676,6 +9744,26 @@ export declare type PluginCapabilityRefusalV1 = z.infer<typeof PluginCapabilityR
9676
9744
 
9677
9745
  export declare type PluginCapabilitySlug = (typeof PLUGIN_CAPABILITY_SLUGS)[number];
9678
9746
 
9747
+ export declare const PluginCardContribution: z.ZodObject<{
9748
+ localId: z.ZodString;
9749
+ description: z.ZodString;
9750
+ inputs: z.ZodRecord<z.ZodString, z.ZodType<authoringCommonSchemas.JsonValue, unknown, z.core.$ZodTypeInternals<authoringCommonSchemas.JsonValue, unknown>>>;
9751
+ readEndpoint: z.ZodString;
9752
+ submitEndpoint: z.ZodString;
9753
+ authService: z.ZodOptional<z.ZodString>;
9754
+ }, z.core.$strict>;
9755
+
9756
+ export declare type PluginCardContribution = z.infer<typeof PluginCardContribution>;
9757
+
9758
+ export declare type PluginCardResult<T> = {
9759
+ readonly ok: true;
9760
+ readonly data: T;
9761
+ } | {
9762
+ readonly ok: false;
9763
+ readonly reason: "needs-auth" | "failed";
9764
+ readonly message: string;
9765
+ };
9766
+
9679
9767
  export declare const PluginCompatibilityManifest: z.ZodObject<{
9680
9768
  supportedProtocols: z.ZodOptional<z.ZodArray<z.ZodLiteral<"kay.plugin.v1">>>;
9681
9769
  minKayVersion: z.ZodOptional<z.ZodString>;
@@ -9740,6 +9828,7 @@ export declare const PluginContributionKind: z.ZodEnum<{
9740
9828
  interactionDriver: "interactionDriver";
9741
9829
  entityResolver: "entityResolver";
9742
9830
  agentRenderer: "agentRenderer";
9831
+ pluginCard: "pluginCard";
9743
9832
  eventDefinition: "eventDefinition";
9744
9833
  eventSubscription: "eventSubscription";
9745
9834
  appDataSource: "appDataSource";
@@ -10938,6 +11027,15 @@ export declare const ReferencePresentationContribution: z.ZodObject<{
10938
11027
  plugin: "plugin";
10939
11028
  }>>;
10940
11029
  kind: z.ZodOptional<z.ZodString>;
11030
+ kinds: z.ZodOptional<z.ZodArray<z.ZodObject<{
11031
+ pattern: z.ZodObject<{
11032
+ protocol: z.ZodString;
11033
+ hostname: z.ZodString;
11034
+ pathname: z.ZodOptional<z.ZodString>;
11035
+ search: z.ZodOptional<z.ZodString>;
11036
+ }, z.core.$strict>;
11037
+ kind: z.ZodString;
11038
+ }, z.core.$strict>>>;
10941
11039
  noun: z.ZodOptional<z.ZodString>;
10942
11040
  target: z.ZodOptional<z.ZodString>;
10943
11041
  kindNamesSource: z.ZodOptional<z.ZodLiteral<true>>;
@@ -11024,6 +11122,15 @@ export declare const ReferencePresentationWords: z.ZodObject<{
11024
11122
  plugin: "plugin";
11025
11123
  }>>;
11026
11124
  kind: z.ZodOptional<z.ZodString>;
11125
+ kinds: z.ZodOptional<z.ZodArray<z.ZodObject<{
11126
+ pattern: z.ZodObject<{
11127
+ protocol: z.ZodString;
11128
+ hostname: z.ZodString;
11129
+ pathname: z.ZodOptional<z.ZodString>;
11130
+ search: z.ZodOptional<z.ZodString>;
11131
+ }, z.core.$strict>;
11132
+ kind: z.ZodString;
11133
+ }, z.core.$strict>>>;
11027
11134
  noun: z.ZodOptional<z.ZodString>;
11028
11135
  target: z.ZodOptional<z.ZodString>;
11029
11136
  kindNamesSource: z.ZodOptional<z.ZodLiteral<true>>;
@@ -11945,6 +12052,25 @@ export declare const ResolvedPluginAuthService: z.ZodObject<{
11945
12052
 
11946
12053
  export declare type ResolvedPluginAuthService = z.infer<typeof ResolvedPluginAuthService>;
11947
12054
 
12055
+ export declare const ResolvedPluginCard: z.ZodObject<{
12056
+ localId: z.ZodString;
12057
+ globalId: z.ZodString;
12058
+ pluginId: z.ZodString;
12059
+ description: z.ZodString;
12060
+ inputs: z.ZodRecord<z.ZodString, z.ZodType<authoringCommonSchemas.JsonValue, unknown, z.core.$ZodTypeInternals<authoringCommonSchemas.JsonValue, unknown>>>;
12061
+ readEndpoint: z.ZodObject<{
12062
+ localId: z.ZodString;
12063
+ globalId: z.ZodString;
12064
+ }, z.core.$strict>;
12065
+ submitEndpoint: z.ZodObject<{
12066
+ localId: z.ZodString;
12067
+ globalId: z.ZodString;
12068
+ }, z.core.$strict>;
12069
+ authService: z.ZodOptional<z.ZodString>;
12070
+ }, z.core.$strict>;
12071
+
12072
+ export declare type ResolvedPluginCard = z.infer<typeof ResolvedPluginCard>;
12073
+
11948
12074
  export declare const ResolvedPluginContractV1: z.ZodObject<{
11949
12075
  protocol: z.ZodLiteral<"kay.plugin.v1">;
11950
12076
  pluginId: z.ZodString;
@@ -11973,6 +12099,7 @@ export declare const ResolvedPluginContractV1: z.ZodObject<{
11973
12099
  interactionDriver: "interactionDriver";
11974
12100
  entityResolver: "entityResolver";
11975
12101
  agentRenderer: "agentRenderer";
12102
+ pluginCard: "pluginCard";
11976
12103
  eventDefinition: "eventDefinition";
11977
12104
  eventSubscription: "eventSubscription";
11978
12105
  appDataSource: "appDataSource";
@@ -12770,6 +12897,22 @@ export declare const ResolvedPluginContractV1: z.ZodObject<{
12770
12897
  scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
12771
12898
  }, z.core.$strict>>;
12772
12899
  }, z.core.$strict>>>;
12900
+ kayAppCards: z.ZodOptional<z.ZodArray<z.ZodObject<{
12901
+ localId: z.ZodString;
12902
+ globalId: z.ZodString;
12903
+ pluginId: z.ZodString;
12904
+ description: z.ZodString;
12905
+ inputs: z.ZodRecord<z.ZodString, z.ZodType<authoringCommonSchemas.JsonValue, unknown, z.core.$ZodTypeInternals<authoringCommonSchemas.JsonValue, unknown>>>;
12906
+ readEndpoint: z.ZodObject<{
12907
+ localId: z.ZodString;
12908
+ globalId: z.ZodString;
12909
+ }, z.core.$strict>;
12910
+ submitEndpoint: z.ZodObject<{
12911
+ localId: z.ZodString;
12912
+ globalId: z.ZodString;
12913
+ }, z.core.$strict>;
12914
+ authService: z.ZodOptional<z.ZodString>;
12915
+ }, z.core.$strict>>>;
12773
12916
  kayAppDataSources: z.ZodOptional<z.ZodArray<z.ZodObject<{
12774
12917
  localId: z.ZodString;
12775
12918
  globalId: z.ZodString;
@@ -12927,6 +13070,15 @@ export declare const ResolvedPluginContractV1: z.ZodObject<{
12927
13070
  plugin: "plugin";
12928
13071
  }>>;
12929
13072
  kind: z.ZodOptional<z.ZodString>;
13073
+ kinds: z.ZodOptional<z.ZodArray<z.ZodObject<{
13074
+ pattern: z.ZodObject<{
13075
+ protocol: z.ZodString;
13076
+ hostname: z.ZodString;
13077
+ pathname: z.ZodOptional<z.ZodString>;
13078
+ search: z.ZodOptional<z.ZodString>;
13079
+ }, z.core.$strict>;
13080
+ kind: z.ZodString;
13081
+ }, z.core.$strict>>>;
12930
13082
  noun: z.ZodOptional<z.ZodString>;
12931
13083
  target: z.ZodOptional<z.ZodString>;
12932
13084
  kindNamesSource: z.ZodOptional<z.ZodLiteral<true>>;
@@ -13000,6 +13152,7 @@ export declare const ResolvedPluginContributionId: z.ZodObject<{
13000
13152
  interactionDriver: "interactionDriver";
13001
13153
  entityResolver: "entityResolver";
13002
13154
  agentRenderer: "agentRenderer";
13155
+ pluginCard: "pluginCard";
13003
13156
  eventDefinition: "eventDefinition";
13004
13157
  eventSubscription: "eventSubscription";
13005
13158
  appDataSource: "appDataSource";
@@ -13437,6 +13590,15 @@ export declare const ResolvedReferencePresentation: z.ZodObject<{
13437
13590
  plugin: "plugin";
13438
13591
  }>>;
13439
13592
  kind: z.ZodOptional<z.ZodString>;
13593
+ kinds: z.ZodOptional<z.ZodArray<z.ZodObject<{
13594
+ pattern: z.ZodObject<{
13595
+ protocol: z.ZodString;
13596
+ hostname: z.ZodString;
13597
+ pathname: z.ZodOptional<z.ZodString>;
13598
+ search: z.ZodOptional<z.ZodString>;
13599
+ }, z.core.$strict>;
13600
+ kind: z.ZodString;
13601
+ }, z.core.$strict>>>;
13440
13602
  noun: z.ZodOptional<z.ZodString>;
13441
13603
  target: z.ZodOptional<z.ZodString>;
13442
13604
  kindNamesSource: z.ZodOptional<z.ZodLiteral<true>>;
package/dist/index.js CHANGED
@@ -254,10 +254,12 @@ var JsonSchema = z4.record(z4.string(), JsonValue);
254
254
  var KAY_PLUGIN_MANIFEST_SIZE_CAP_BYTES = 1024 * 1024;
255
255
  var KAY_PLUGIN_PROTOCOL_VERSION = "kay.plugin.v1";
256
256
  var KAY_PLUGIN_PROTOCOL_PACKAGE_NAME = "@bonsai/plugin-protocol";
257
- var KAY_PLUGIN_SDK_VERSION = "0.43.0";
257
+ var KAY_PLUGIN_SDK_VERSION = "0.45.0";
258
258
  var KAY_PLUGIN_COMPATIBLE_SDK_VERSIONS = [
259
259
  "0.42.0",
260
- "0.42.1"
260
+ "0.42.1",
261
+ "0.43.0",
262
+ "0.44.0"
261
263
  ];
262
264
  var KAY_PLUGIN_TARGET_NAMES = [
263
265
  "kay.agent",
@@ -2753,6 +2755,7 @@ __export(contributions_exports, {
2753
2755
  McpServerContributions: () => McpServerContributions,
2754
2756
  McpServerUrl: () => McpServerUrl,
2755
2757
  PLUGIN_NOTIFICATION_RULE_HOST_KEYS: () => PLUGIN_NOTIFICATION_RULE_HOST_KEYS,
2758
+ PluginCardContribution: () => PluginCardContribution,
2756
2759
  PluginContributionKind: () => PluginContributionKind,
2757
2760
  PluginEventDefinitionContribution: () => PluginEventDefinitionContribution,
2758
2761
  PluginNotificationRuleContribution: () => PluginNotificationRuleContribution,
@@ -3635,6 +3638,14 @@ function createContributionsSchemas(canonical) {
3635
3638
  localId: LocalContributionId2,
3636
3639
  resultKinds: z12.array(NonEmptyString3).min(1)
3637
3640
  });
3641
+ const PluginCardContribution2 = z12.strictObject({
3642
+ localId: LocalContributionId2,
3643
+ description: NonEmptyString3,
3644
+ inputs: JsonSchema,
3645
+ readEndpoint: LocalContributionId2,
3646
+ submitEndpoint: LocalContributionId2,
3647
+ authService: AuthServiceReference2.optional()
3648
+ });
3638
3649
  const EndpointContribution2 = z12.strictObject({
3639
3650
  localId: LocalContributionId2,
3640
3651
  displayName: OptionalDisplayName,
@@ -3853,6 +3864,14 @@ function createContributionsSchemas(canonical) {
3853
3864
  glyph: z12.enum(TOOL_GLYPHS).optional(),
3854
3865
  /** The thing an address names ("channel" in "Read Slack channel"). Left out: the row reads the scheme's own name. */
3855
3866
  kind: NonEmptyString3.optional(),
3867
+ /**
3868
+ * A more specific kind by the address's shape. The first row that matches decides, and an
3869
+ * address no row matches reads `kind`.
3870
+ */
3871
+ kinds: z12.array(z12.strictObject({
3872
+ pattern: ReferencePresentationUriPattern2,
3873
+ kind: NonEmptyString3
3874
+ })).min(1).optional(),
3856
3875
  /** What a tally counts one address as ("Slack message"). Left out: `kind`, else "item". */
3857
3876
  noun: NonEmptyString3.optional(),
3858
3877
  /** What the live phrase names ("Slack" in "Reading Slack"). Left out: the bare verb ("Reading"). */
@@ -3860,11 +3879,11 @@ function createContributionsSchemas(canonical) {
3860
3879
  /** `kind` already says which source this is: "Edited plan", not "Edited Plan plan". */
3861
3880
  kindNamesSource: z12.literal(true).optional()
3862
3881
  }).superRefine((value, ctx) => {
3863
- if (value.kind === void 0 && (value.glyph !== void 0 || value.kindNamesSource !== void 0)) {
3882
+ if (value.kind === void 0 && (value.glyph !== void 0 || value.kindNamesSource !== void 0 || value.kinds !== void 0)) {
3864
3883
  ctx.addIssue({
3865
3884
  code: "custom",
3866
3885
  path: ["kind"],
3867
- message: "glyph and kindNamesSource describe a row, which needs a kind."
3886
+ message: "glyph, kinds and kindNamesSource describe a row, which needs a kind."
3868
3887
  });
3869
3888
  }
3870
3889
  });
@@ -4129,6 +4148,7 @@ function createContributionsSchemas(canonical) {
4129
4148
  "entityResolver",
4130
4149
  "agentRenderer",
4131
4150
  "endpoint",
4151
+ "pluginCard",
4132
4152
  "command",
4133
4153
  "eventDefinition",
4134
4154
  "eventSubscription",
@@ -4179,6 +4199,7 @@ function createContributionsSchemas(canonical) {
4179
4199
  EntityResolverContribution: EntityResolverContribution2,
4180
4200
  AgentRenderContribution: AgentRenderContribution2,
4181
4201
  EndpointContribution: EndpointContribution2,
4202
+ PluginCardContribution: PluginCardContribution2,
4182
4203
  WorkflowContribution: WorkflowContribution2,
4183
4204
  McpServerUrl: McpServerUrl2,
4184
4205
  McpServerAuthMode: McpServerAuthMode2,
@@ -4218,7 +4239,7 @@ function createContributionsSchemas(canonical) {
4218
4239
  PluginContributionKind: PluginContributionKind2
4219
4240
  };
4220
4241
  }
4221
- var { ApprovalCardForm, ApprovalCardStoredForm, ApprovalTypeContribution, UriModuleFacts, ToolContribution, ToolPermission, AgentToolContribution, ConverterContribution, UriModuleContribution, AppUriModuleContribution, AppDataSourceContribution, WhiteboardTypeStorage, WhiteboardTypeContribution, AppDataMaterializerContribution, ArtifactUriModuleContribution, CliBindingContribution, GitHostContribution, ResourceContribution, SkillContribution, PluginSkillSourceDeclaration, SearchProviderContribution, InteractionDriverContribution, EntityResolverContribution, AgentRenderContribution, EndpointContribution, WorkflowContribution, McpServerUrl, McpServerAuthMode, McpServerContribution, McpServerContributions, AppEventSubscription, ContextContributorContribution, PluginEventDefinitionContribution, PluginNotificationRuleContribution, PluginProductEventContribution, UiEventSubscriptionContribution, DeviceDelegationContribution, SessionReaderContribution, UiCommandContribution, UiSlotContribution, SettingsPanelContribution, ResultRendererContribution, ReferenceOpenBehavior, ReferencePresentationVariant, ReferencePresentationVariants, ReferencePresentationUriPattern, ReferencePresentationUrlClaim, ReferencePresentationTooltip, ReferencePresentationAddress, ReferencePresentationWords, ReferencePresentationContribution, RichViewContribution, KayUiAppHostCapability, UiAppCapabilities, UiRailEntryContribution, UiToastPreviewContribution, UiPageContribution, UiAppContribution, ThemeContribution, CommandHandler, CommandContribution, PluginContributionKind } = createContributionsSchemas(false);
4242
+ 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, SettingsPanelContribution, ResultRendererContribution, ReferenceOpenBehavior, ReferencePresentationVariant, ReferencePresentationVariants, ReferencePresentationUriPattern, ReferencePresentationUrlClaim, ReferencePresentationTooltip, ReferencePresentationAddress, ReferencePresentationWords, ReferencePresentationContribution, RichViewContribution, KayUiAppHostCapability, UiAppCapabilities, UiRailEntryContribution, UiToastPreviewContribution, UiPageContribution, UiAppContribution, ThemeContribution, CommandHandler, CommandContribution, PluginContributionKind } = createContributionsSchemas(false);
4222
4243
  var canonicalContributionSchemas = createContributionsSchemas(true);
4223
4244
 
4224
4245
  // packages/plugin-protocol/dist/icon-shape.js
@@ -4292,7 +4313,7 @@ var KAY_UI_NATIVE_EVENT_SUBSCRIPTIONS = [
4292
4313
  var KAY_UI_NATIVE_EVENT_ALLOWLIST = new Set(KAY_UI_NATIVE_EVENT_SUBSCRIPTIONS);
4293
4314
  var RETIRED_COMPATIBILITY_KEYS = ["policy"];
4294
4315
  function createManifestSchemas(canonical) {
4295
- const { AgentRenderContribution: AgentRenderContribution2, ApprovalTypeContribution: ApprovalTypeContribution2, WorkflowContribution: WorkflowContribution2, AppDataMaterializerContribution: AppDataMaterializerContribution2, AppDataSourceContribution: AppDataSourceContribution2, AppUriModuleContribution: AppUriModuleContribution2, AppEventSubscription: AppEventSubscription2, ArtifactUriModuleContribution: ArtifactUriModuleContribution2, CliBindingContribution: CliBindingContribution2, CommandContribution: CommandContribution2, ContextContributorContribution: ContextContributorContribution2, ConverterContribution: ConverterContribution2, SessionReaderContribution: SessionReaderContribution2, DeviceDelegationContribution: DeviceDelegationContribution2, EndpointContribution: EndpointContribution2, EntityResolverContribution: EntityResolverContribution2, GitHostContribution: GitHostContribution2, McpServerContributions: McpServerContributions2, PluginEventDefinitionContribution: PluginEventDefinitionContribution2, PluginNotificationRuleContribution: PluginNotificationRuleContribution2, PluginProductEventContribution: PluginProductEventContribution2, ResourceContribution: ResourceContribution2, ReferencePresentationContribution: ReferencePresentationContribution2, ResultRendererContribution: ResultRendererContribution2, RichViewContribution: RichViewContribution2, PluginSkillSourceDeclaration: PluginSkillSourceDeclaration2, InteractionDriverContribution: InteractionDriverContribution2, SearchProviderContribution: SearchProviderContribution2, SkillContribution: SkillContribution2, SettingsPanelContribution: SettingsPanelContribution2, ThemeContribution: ThemeContribution2, AgentToolContribution: AgentToolContribution2, ToolContribution: ToolContribution2, UiCommandContribution: UiCommandContribution2, UiAppContribution: UiAppContribution2, UiRailEntryContribution: UiRailEntryContribution2, UiToastPreviewContribution: UiToastPreviewContribution2, UiPageContribution: UiPageContribution2, UiEventSubscriptionContribution: UiEventSubscriptionContribution2, UiSlotContribution: UiSlotContribution2, UriModuleContribution: UriModuleContribution2, WhiteboardTypeContribution: WhiteboardTypeContribution2 } = canonical ? canonicalContributionSchemas : contributions_exports;
4316
+ 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, ResultRendererContribution: ResultRendererContribution2, RichViewContribution: RichViewContribution2, PluginSkillSourceDeclaration: PluginSkillSourceDeclaration2, InteractionDriverContribution: InteractionDriverContribution2, SearchProviderContribution: SearchProviderContribution2, SkillContribution: SkillContribution2, SettingsPanelContribution: SettingsPanelContribution2, ThemeContribution: ThemeContribution2, AgentToolContribution: AgentToolContribution2, ToolContribution: ToolContribution2, UiCommandContribution: UiCommandContribution2, UiAppContribution: UiAppContribution2, UiRailEntryContribution: UiRailEntryContribution2, UiToastPreviewContribution: UiToastPreviewContribution2, UiPageContribution: UiPageContribution2, UiEventSubscriptionContribution: UiEventSubscriptionContribution2, UiSlotContribution: UiSlotContribution2, UriModuleContribution: UriModuleContribution2, WhiteboardTypeContribution: WhiteboardTypeContribution2 } = canonical ? canonicalContributionSchemas : contributions_exports;
4296
4317
  const { HttpsUrl: HttpsUrl2, LocalContributionId: LocalContributionId2, NonEmptyString: NonEmptyString3, PackageAssetPath: PackageAssetPath2, PluginId: PluginId2, PluginNamespace: PluginNamespace2, RegistrableDomain: RegistrableDomain2, SignedInStatusCode: SignedInStatusCode2, TargetEntrypoint: TargetEntrypoint2 } = canonical ? canonicalCommonSchemas : common_exports;
4297
4318
  const { PluginPermissionManifest: PluginPermissionManifest2 } = canonical ? canonicalPermissionSchemas : permissions_exports;
4298
4319
  const KayAgentTargetManifest2 = z13.strictObject({
@@ -4381,6 +4402,7 @@ function createManifestSchemas(canonical) {
4381
4402
  // namespace with them (enforced by the manifest-level refinement below).
4382
4403
  tools: z13.array(ToolContribution2).optional(),
4383
4404
  endpoints: z13.array(EndpointContribution2).optional(),
4405
+ cards: z13.array(PluginCardContribution2).optional(),
4384
4406
  uriModules: z13.array(AppUriModuleContribution2).optional(),
4385
4407
  dataSources: z13.array(AppDataSourceContribution2).optional(),
4386
4408
  whiteboardTypes: z13.array(WhiteboardTypeContribution2).optional(),
@@ -5111,6 +5133,39 @@ function createManifestSchemas(canonical) {
5111
5133
  message: `signal event ${definition.localId} must use a URI scheme one of this plugin's own URI modules serves; '${definition.uriScheme}' is not among them`
5112
5134
  });
5113
5135
  }
5136
+ for (const [index, card] of (manifest.targets?.kay?.app?.contributes?.cards ?? []).entries()) {
5137
+ const path = ["targets", "kay", "app", "contributes", "cards", index];
5138
+ if (manifest.targets?.kay?.app?.entrypoint === void 0) {
5139
+ ctx.addIssue({
5140
+ code: "custom",
5141
+ path,
5142
+ message: `plugin card ${card.localId} needs a kay.app entrypoint to implement it`
5143
+ });
5144
+ }
5145
+ for (const field of ["readEndpoint", "submitEndpoint"]) {
5146
+ if (!endpointIds.has(card[field])) {
5147
+ ctx.addIssue({
5148
+ code: "custom",
5149
+ path: [...path, field],
5150
+ message: `plugin card ${card.localId} references unknown endpoint ${card[field]}`
5151
+ });
5152
+ }
5153
+ }
5154
+ if (card.readEndpoint === card.submitEndpoint) {
5155
+ ctx.addIssue({
5156
+ code: "custom",
5157
+ path: [...path, "submitEndpoint"],
5158
+ message: `plugin card ${card.localId} needs distinct read and submit endpoints`
5159
+ });
5160
+ }
5161
+ if (card.authService !== void 0 && !isQualifiedAuthServiceRef(card.authService) && !authServices.has(card.authService)) {
5162
+ ctx.addIssue({
5163
+ code: "custom",
5164
+ path: [...path, "authService"],
5165
+ message: `plugin card ${card.localId} references unknown auth service ${card.authService}`
5166
+ });
5167
+ }
5168
+ }
5114
5169
  reportDuplicateLocalIds(ctx, ["targets", "kay", "app", "contributes", "workflows"], manifest.targets?.kay?.app?.contributes?.workflows, "workflow");
5115
5170
  for (const [index, workflow] of (manifest.targets?.kay?.app?.contributes?.workflows ?? []).entries()) {
5116
5171
  const path = [
@@ -5735,6 +5790,7 @@ function collectKayAppContributionIds(manifest) {
5735
5790
  const contributes = manifest.targets?.kay?.app?.contributes;
5736
5791
  const output = [];
5737
5792
  pushContributionIds(output, ["targets", "kay", "app", "contributes", "approvalTypes"], contributes?.approvalTypes);
5793
+ pushContributionIds(output, ["targets", "kay", "app", "contributes", "cards"], contributes?.cards);
5738
5794
  pushContributionIds(output, ["targets", "kay", "app", "contributes", "workflows"], contributes?.workflows);
5739
5795
  pushContributionIds(output, ["targets", "kay", "app", "contributes", "tools"], contributes?.tools);
5740
5796
  pushContributionIds(output, ["targets", "kay", "app", "contributes", "endpoints"], contributes?.endpoints);
@@ -5896,6 +5952,22 @@ function createResolvedContractSchemas(canonical) {
5896
5952
  /** The auth service that module signs in through, whose accounts a card may send from. */
5897
5953
  authService: GlobalContributionId2.optional()
5898
5954
  });
5955
+ const ResolvedPluginCard2 = z14.strictObject({
5956
+ localId: LocalContributionId2,
5957
+ globalId: GlobalContributionId2,
5958
+ pluginId: PluginId2,
5959
+ description: NonEmptyString3,
5960
+ inputs: JsonSchema,
5961
+ readEndpoint: z14.strictObject({
5962
+ localId: LocalContributionId2,
5963
+ globalId: GlobalContributionId2
5964
+ }),
5965
+ submitEndpoint: z14.strictObject({
5966
+ localId: LocalContributionId2,
5967
+ globalId: GlobalContributionId2
5968
+ }),
5969
+ authService: GlobalContributionId2.optional()
5970
+ });
5899
5971
  const ResolvedKayAppWorkflow2 = z14.strictObject({
5900
5972
  localId: LocalContributionId2,
5901
5973
  globalId: GlobalContributionId2,
@@ -6134,7 +6206,7 @@ function createResolvedContractSchemas(canonical) {
6134
6206
  contributions: z14.array(ResolvedPluginContributionId2),
6135
6207
  // The deduplicated set of qualified (dotted) external auth-service ids this
6136
6208
  // plugin references, from agent uriModule, tool and cliBinding
6137
- // `authService` refs, and auth-grant `service` refs. Always present - a plugin
6209
+ // `authService` refs, card sign-in refs, and auth-grant `service` refs. Always present - a plugin
6138
6210
  // that only references its own local services carries an empty array. This
6139
6211
  // is a recorded dependency, not a resolution: there is no runtime plugin
6140
6212
  // loader in v1, so nothing here verifies the reference resolves within a
@@ -6159,6 +6231,7 @@ function createResolvedContractSchemas(canonical) {
6159
6231
  kayAppTools: z14.array(ResolvedKayAppTool2).optional(),
6160
6232
  kayAppApprovalTypes: z14.array(ResolvedKayAppApprovalType2).optional(),
6161
6233
  kayAppWorkflows: z14.array(ResolvedKayAppWorkflow2).optional(),
6234
+ kayAppCards: z14.array(ResolvedPluginCard2).optional(),
6162
6235
  kayAppDataSources: z14.array(ResolvedKayAppDataSource2).optional(),
6163
6236
  kayAppWhiteboardTypes: z14.array(ResolvedKayAppWhiteboardType2).optional(),
6164
6237
  kayAppMcpServers: z14.array(ResolvedKayAppMcpServer2).optional(),
@@ -6172,6 +6245,7 @@ function createResolvedContractSchemas(canonical) {
6172
6245
  ResolvedKayAppTool: ResolvedKayAppTool2,
6173
6246
  ResolvedKayAppApprovalType: ResolvedKayAppApprovalType2,
6174
6247
  ResolvedKayAppWorkflow: ResolvedKayAppWorkflow2,
6248
+ ResolvedPluginCard: ResolvedPluginCard2,
6175
6249
  ResolvedKayAppDataSource: ResolvedKayAppDataSource2,
6176
6250
  ResolvedKayAppWhiteboardType: ResolvedKayAppWhiteboardType2,
6177
6251
  ResolvedKayAppMcpServer: ResolvedKayAppMcpServer2,
@@ -6190,7 +6264,7 @@ function createResolvedContractSchemas(canonical) {
6190
6264
  ResolvedPluginContractV1: ResolvedPluginContractV12
6191
6265
  };
6192
6266
  }
6193
- var { ResolvedKayAppApprovalType, ResolvedKayAppWorkflow, ResolvedPluginContributionId, ResolvedKayAgentTool, ResolvedKayAppTool, ResolvedKayAppDataSource, ResolvedKayAppWhiteboardType, ResolvedKayAppMcpServer, ResolvedKayAgentUriModule, ResolvedKayAgentArtifactUriModule, ResolvedKayAgentEntityResolver, ResolvedKayAgentGitHostClaim, ResolvedKayAgentConverter, ResolvedReferencePresentation, ResolvedPluginProvisioningRequirement, ResolvedPluginAuthScheme, ResolvedPluginWebSession, ResolvedPluginAuthService, ResolvedKayUiAppEndpointCapability, ResolvedKayUiApp, ResolvedPluginContractV1 } = createResolvedContractSchemas(false);
6267
+ 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);
6194
6268
  var canonicalResolvedContractSchemas = createResolvedContractSchemas(true);
6195
6269
  function narrowestAccountSelectors() {
6196
6270
  return [{ kind: "active" }];
@@ -6226,6 +6300,7 @@ function collectContributionSources(manifest) {
6226
6300
  const app = manifest.targets?.kay?.app?.contributes;
6227
6301
  pushAll(output, "kay.app", "tool", app?.tools);
6228
6302
  pushAll(output, "kay.app", "endpoint", app?.endpoints);
6303
+ pushAll(output, "kay.app", "pluginCard", app?.cards);
6229
6304
  pushAll(output, "kay.app", "uriModule", app?.uriModules);
6230
6305
  pushAll(output, "kay.app", "appDataSource", app?.dataSources);
6231
6306
  pushAll(output, "kay.app", "whiteboardType", app?.whiteboardTypes);
@@ -6330,6 +6405,9 @@ function collectConsumedAuthServiceIds(manifest) {
6330
6405
  for (const binding of manifest.targets?.kay?.agent?.contributes?.cliBindings ?? []) {
6331
6406
  add(binding.authService);
6332
6407
  }
6408
+ for (const card of manifest.targets?.kay?.app?.contributes?.cards ?? []) {
6409
+ add(card.authService);
6410
+ }
6333
6411
  for (const target of KAY_PLUGIN_TARGET_NAMES) {
6334
6412
  for (const grant of manifest.permissions?.byTarget[target]?.auth ?? []) {
6335
6413
  add(grant.service);
@@ -6512,6 +6590,24 @@ function resolveKayPluginContractV1(manifest) {
6512
6590
  globalId: resolveGlobalContributionId(namespace, tool.localId),
6513
6591
  toolName: tool.toolName
6514
6592
  }));
6593
+ const kayAppCards = manifest.targets?.kay?.app?.contributes?.cards?.map((card) => ({
6594
+ localId: card.localId,
6595
+ globalId: resolveGlobalContributionId(namespace, card.localId),
6596
+ pluginId: manifest.id,
6597
+ description: card.description,
6598
+ inputs: card.inputs,
6599
+ readEndpoint: {
6600
+ localId: card.readEndpoint,
6601
+ globalId: resolveGlobalContributionId(namespace, card.readEndpoint)
6602
+ },
6603
+ submitEndpoint: {
6604
+ localId: card.submitEndpoint,
6605
+ globalId: resolveGlobalContributionId(namespace, card.submitEndpoint)
6606
+ },
6607
+ ...card.authService === void 0 ? {} : {
6608
+ authService: isQualifiedAuthServiceRef(card.authService) ? card.authService : resolveGlobalContributionId(namespace, card.authService)
6609
+ }
6610
+ }));
6515
6611
  const kayAppWorkflows = manifest.targets?.kay?.app?.contributes?.workflows?.map(({ auth, ...workflow }) => ({
6516
6612
  ...workflow,
6517
6613
  globalId: resolveGlobalContributionId(namespace, workflow.localId),
@@ -6680,6 +6776,7 @@ function resolveKayPluginContractV1(manifest) {
6680
6776
  ...kayAgentGitHostClaims.length > 0 ? { kayAgentGitHostClaims } : {},
6681
6777
  ...kayAgentTools && kayAgentTools.length > 0 ? { kayAgentTools } : {},
6682
6778
  ...kayAppTools && kayAppTools.length > 0 ? { kayAppTools } : {},
6779
+ ...kayAppCards && kayAppCards.length > 0 ? { kayAppCards } : {},
6683
6780
  ...kayAppApprovalTypes && kayAppApprovalTypes.length > 0 ? { kayAppApprovalTypes } : {},
6684
6781
  ...kayAppWorkflows && kayAppWorkflows.length > 0 ? { kayAppWorkflows } : {},
6685
6782
  ...kayAppDataSources && kayAppDataSources.length > 0 ? { kayAppDataSources } : {},
@@ -7607,6 +7704,7 @@ export {
7607
7704
  PluginCapabilityRefusalCode,
7608
7705
  PluginCapabilityRefusalLayer,
7609
7706
  PluginCapabilityRefusalV1,
7707
+ PluginCardContribution,
7610
7708
  PluginCompatibilityManifest,
7611
7709
  PluginConfigManifest,
7612
7710
  PluginConfigScope,
@@ -7675,6 +7773,7 @@ export {
7675
7773
  ResolvedKayUiAppEndpointCapability,
7676
7774
  ResolvedPluginAuthScheme,
7677
7775
  ResolvedPluginAuthService,
7776
+ ResolvedPluginCard,
7678
7777
  ResolvedPluginContractV1,
7679
7778
  ResolvedPluginContributionId,
7680
7779
  ResolvedPluginGrants,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yaklabs-ai/plugin-protocol",
3
- "version": "0.43.0",
3
+ "version": "0.45.0",
4
4
  "description": "The Kay plugin manifest schema (`kay.plugin.v1`) — parse and validate a kay-plugin.json.",
5
5
  "author": "YakLabs",
6
6
  "type": "module",