@yaklabs-ai/plugin-protocol 0.29.0 → 0.30.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.29.0"
14
+ "@bonsai/plugin-protocol": "npm:@yaklabs-ai/plugin-protocol@^0.30.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.29.0",
4
+ "version": "0.30.0",
5
5
  "target": "npm",
6
6
  "firstPartyLicense": "MIT",
7
7
  "bundled": [],
package/dist/index.d.ts CHANGED
@@ -1564,6 +1564,7 @@ declare namespace authoringCommonSchemas {
1564
1564
  hostWithinDomain,
1565
1565
  urlHostWithinDomain,
1566
1566
  refineWebSessionScopeConfined,
1567
+ KAY_PLUGIN_MANIFEST_SIZE_CAP_BYTES,
1567
1568
  KAY_PLUGIN_PROTOCOL_VERSION,
1568
1569
  KAY_PLUGIN_PROTOCOL_PACKAGE_NAME,
1569
1570
  KAY_PLUGIN_SDK_VERSION,
@@ -1634,6 +1635,7 @@ declare namespace authoringContributionSchemas {
1634
1635
  EntityResolverContribution,
1635
1636
  AgentRenderContribution,
1636
1637
  EndpointContribution,
1638
+ WorkflowContribution,
1637
1639
  McpServerUrl,
1638
1640
  McpServerAuthMode,
1639
1641
  McpServerContribution,
@@ -2477,6 +2479,17 @@ declare const canonicalContributionSchemas: {
2477
2479
  requestSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<authoringCommonSchemas.JsonValue, unknown, z.core.$ZodTypeInternals<authoringCommonSchemas.JsonValue, unknown>>>>;
2478
2480
  responseSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<authoringCommonSchemas.JsonValue, unknown, z.core.$ZodTypeInternals<authoringCommonSchemas.JsonValue, unknown>>>>;
2479
2481
  }, z.core.$strict>;
2482
+ WorkflowContribution: z.ZodObject<{
2483
+ localId: z.ZodString;
2484
+ name: z.ZodString;
2485
+ description: z.ZodString;
2486
+ everyMs: z.ZodNumber;
2487
+ auth: z.ZodOptional<z.ZodObject<{
2488
+ service: z.ZodString;
2489
+ scheme: z.ZodString;
2490
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
2491
+ }, z.core.$strict>>;
2492
+ }, z.core.$strict>;
2480
2493
  McpServerUrl: z.ZodString;
2481
2494
  McpServerAuthMode: z.ZodEnum<{
2482
2495
  oauth: "oauth";
@@ -2818,6 +2831,7 @@ declare const canonicalContributionSchemas: {
2818
2831
  appDataSource: "appDataSource";
2819
2832
  whiteboardType: "whiteboardType";
2820
2833
  approvalType: "approvalType";
2834
+ workflow: "workflow";
2821
2835
  contextContributor: "contextContributor";
2822
2836
  transcriptionProvider: "transcriptionProvider";
2823
2837
  deviceDelegation: "deviceDelegation";
@@ -3344,7 +3358,7 @@ export declare const KAY_PLUGIN_COMPATIBLE_SDK_VERSIONS: readonly string[];
3344
3358
  /** The file whose presence makes a directory a plugin. A directory without one is not a plugin. */
3345
3359
  export declare const KAY_PLUGIN_MANIFEST_FILENAME = "kay-plugin.json";
3346
3360
 
3347
- /** Manifest byte cap: a larger file is refused unread. */
3361
+ /** Manifest byte cap, including declared app-data schemas; larger files are refused unread. */
3348
3362
  export declare const KAY_PLUGIN_MANIFEST_SIZE_CAP_BYTES: number;
3349
3363
 
3350
3364
  export declare const KAY_PLUGIN_PROTOCOL_PACKAGE_NAME: "@bonsai/plugin-protocol";
@@ -3923,8 +3937,14 @@ export declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
3923
3937
  * whichever process runs the plugin. A plugin's simulator file exports `createPluginSimulator`
3924
3938
  * (`KayPluginSimulatorFactory`). A clean break: only this repo's plugins read the old member, and
3925
3939
  * a plugin with no simulator is unaffected, so 0.28.0 stays served.
3940
+ *
3941
+ * 0.30.0 lets a scheduled workflow be described as data (#15722). `contributes.workflows` under
3942
+ * `kay.app` declares its name, schedule and sign-in, and `app.implementWorkflow(localId, run)`
3943
+ * supplies what a run does: each run is handed the workflow's accounts and tokens, so the code
3944
+ * runs the same in the daemon and in the plugin host. Additive: `app.workflows.define` stays, and
3945
+ * a plugin that declares a workflow declares ^0.30.0.
3926
3946
  */
3927
- export declare const KAY_PLUGIN_SDK_VERSION: "0.29.0";
3947
+ export declare const KAY_PLUGIN_SDK_VERSION: "0.30.0";
3928
3948
 
3929
3949
  export declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
3930
3950
 
@@ -4515,6 +4535,17 @@ export declare const KayAppTargetManifest: z.ZodObject<{
4515
4535
  }, z.core.$strict>>>;
4516
4536
  }, z.core.$strict>>;
4517
4537
  }, z.core.$strict>>>;
4538
+ workflows: z.ZodOptional<z.ZodArray<z.ZodObject<{
4539
+ localId: z.ZodString;
4540
+ name: z.ZodString;
4541
+ description: z.ZodString;
4542
+ everyMs: z.ZodNumber;
4543
+ auth: z.ZodOptional<z.ZodObject<{
4544
+ service: z.ZodString;
4545
+ scheme: z.ZodString;
4546
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
4547
+ }, z.core.$strict>>;
4548
+ }, z.core.$strict>>>;
4518
4549
  eventDefinitions: z.ZodOptional<z.ZodArray<z.ZodObject<{
4519
4550
  localId: z.ZodString;
4520
4551
  displayName: z.ZodOptional<z.ZodString>;
@@ -5268,6 +5299,17 @@ export declare const KayPluginManifestV1: z.ZodObject<{
5268
5299
  }, z.core.$strict>>>;
5269
5300
  }, z.core.$strict>>;
5270
5301
  }, z.core.$strict>>>;
5302
+ workflows: z.ZodOptional<z.ZodArray<z.ZodObject<{
5303
+ localId: z.ZodString;
5304
+ name: z.ZodString;
5305
+ description: z.ZodString;
5306
+ everyMs: z.ZodNumber;
5307
+ auth: z.ZodOptional<z.ZodObject<{
5308
+ service: z.ZodString;
5309
+ scheme: z.ZodString;
5310
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
5311
+ }, z.core.$strict>>;
5312
+ }, z.core.$strict>>>;
5271
5313
  eventDefinitions: z.ZodOptional<z.ZodArray<z.ZodObject<{
5272
5314
  localId: z.ZodString;
5273
5315
  displayName: z.ZodOptional<z.ZodString>;
@@ -8935,6 +8977,7 @@ export declare const PluginContributionKind: z.ZodEnum<{
8935
8977
  appDataSource: "appDataSource";
8936
8978
  whiteboardType: "whiteboardType";
8937
8979
  approvalType: "approvalType";
8980
+ workflow: "workflow";
8938
8981
  contextContributor: "contextContributor";
8939
8982
  transcriptionProvider: "transcriptionProvider";
8940
8983
  deviceDelegation: "deviceDelegation";
@@ -10513,6 +10556,21 @@ export declare const ResolvedKayAppWhiteboardType: z.ZodObject<{
10513
10556
 
10514
10557
  export declare type ResolvedKayAppWhiteboardType = z.infer<typeof ResolvedKayAppWhiteboardType>;
10515
10558
 
10559
+ export declare const ResolvedKayAppWorkflow: z.ZodObject<{
10560
+ localId: z.ZodString;
10561
+ globalId: z.ZodString;
10562
+ name: z.ZodString;
10563
+ description: z.ZodString;
10564
+ everyMs: z.ZodNumber;
10565
+ auth: z.ZodOptional<z.ZodObject<{
10566
+ serviceId: z.ZodString;
10567
+ schemeId: z.ZodString;
10568
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
10569
+ }, z.core.$strict>>;
10570
+ }, z.core.$strict>;
10571
+
10572
+ export declare type ResolvedKayAppWorkflow = z.infer<typeof ResolvedKayAppWorkflow>;
10573
+
10516
10574
  export declare const ResolvedKayUiApp: z.ZodObject<{
10517
10575
  localId: z.ZodString;
10518
10576
  globalId: z.ZodString;
@@ -10916,6 +10974,7 @@ export declare const ResolvedPluginContractV1: z.ZodObject<{
10916
10974
  appDataSource: "appDataSource";
10917
10975
  whiteboardType: "whiteboardType";
10918
10976
  approvalType: "approvalType";
10977
+ workflow: "workflow";
10919
10978
  contextContributor: "contextContributor";
10920
10979
  transcriptionProvider: "transcriptionProvider";
10921
10980
  deviceDelegation: "deviceDelegation";
@@ -11687,6 +11746,18 @@ export declare const ResolvedPluginContractV1: z.ZodObject<{
11687
11746
  moduleId: z.ZodString;
11688
11747
  authService: z.ZodOptional<z.ZodString>;
11689
11748
  }, z.core.$strict>>>;
11749
+ kayAppWorkflows: z.ZodOptional<z.ZodArray<z.ZodObject<{
11750
+ localId: z.ZodString;
11751
+ globalId: z.ZodString;
11752
+ name: z.ZodString;
11753
+ description: z.ZodString;
11754
+ everyMs: z.ZodNumber;
11755
+ auth: z.ZodOptional<z.ZodObject<{
11756
+ serviceId: z.ZodString;
11757
+ schemeId: z.ZodString;
11758
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
11759
+ }, z.core.$strict>>;
11760
+ }, z.core.$strict>>>;
11690
11761
  kayAppDataSources: z.ZodOptional<z.ZodArray<z.ZodObject<{
11691
11762
  localId: z.ZodString;
11692
11763
  globalId: z.ZodString;
@@ -11883,6 +11954,7 @@ export declare const ResolvedPluginContributionId: z.ZodObject<{
11883
11954
  appDataSource: "appDataSource";
11884
11955
  whiteboardType: "whiteboardType";
11885
11956
  approvalType: "approvalType";
11957
+ workflow: "workflow";
11886
11958
  contextContributor: "contextContributor";
11887
11959
  transcriptionProvider: "transcriptionProvider";
11888
11960
  deviceDelegation: "deviceDelegation";
@@ -14108,4 +14180,18 @@ export declare const WhiteboardValue: z.ZodType<JsonValue, unknown, z.core.$ZodT
14108
14180
 
14109
14181
  export declare type WhiteboardValue = z.infer<typeof WhiteboardValue>;
14110
14182
 
14183
+ export declare const WorkflowContribution: z.ZodObject<{
14184
+ localId: z.ZodString;
14185
+ name: z.ZodString;
14186
+ description: z.ZodString;
14187
+ everyMs: z.ZodNumber;
14188
+ auth: z.ZodOptional<z.ZodObject<{
14189
+ service: z.ZodString;
14190
+ scheme: z.ZodString;
14191
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
14192
+ }, z.core.$strict>>;
14193
+ }, z.core.$strict>;
14194
+
14195
+ export declare type WorkflowContribution = z.infer<typeof WorkflowContribution>;
14196
+
14111
14197
  export { }
package/dist/index.js CHANGED
@@ -173,6 +173,7 @@ __export(common_exports, {
173
173
  JsonValue: () => JsonValue,
174
174
  KAY_EVENT_PUBLISHER_ID: () => KAY_EVENT_PUBLISHER_ID,
175
175
  KAY_PLUGIN_COMPATIBLE_SDK_VERSIONS: () => KAY_PLUGIN_COMPATIBLE_SDK_VERSIONS,
176
+ KAY_PLUGIN_MANIFEST_SIZE_CAP_BYTES: () => KAY_PLUGIN_MANIFEST_SIZE_CAP_BYTES,
176
177
  KAY_PLUGIN_PROTOCOL_PACKAGE_NAME: () => KAY_PLUGIN_PROTOCOL_PACKAGE_NAME,
177
178
  KAY_PLUGIN_PROTOCOL_VERSION: () => KAY_PLUGIN_PROTOCOL_VERSION,
178
179
  KAY_PLUGIN_SDK_VERSION: () => KAY_PLUGIN_SDK_VERSION,
@@ -220,13 +221,15 @@ var JsonObject = z4.record(z4.string(), JsonValue);
220
221
  var JsonSchema = z4.record(z4.string(), JsonValue);
221
222
 
222
223
  // packages/plugin-protocol/dist/common.js
224
+ var KAY_PLUGIN_MANIFEST_SIZE_CAP_BYTES = 1024 * 1024;
223
225
  var KAY_PLUGIN_PROTOCOL_VERSION = "kay.plugin.v1";
224
226
  var KAY_PLUGIN_PROTOCOL_PACKAGE_NAME = "@bonsai/plugin-protocol";
225
- var KAY_PLUGIN_SDK_VERSION = "0.29.0";
227
+ var KAY_PLUGIN_SDK_VERSION = "0.30.0";
226
228
  var KAY_PLUGIN_COMPATIBLE_SDK_VERSIONS = [
227
229
  "0.26.3",
228
230
  "0.27.1",
229
- "0.28.0"
231
+ "0.28.0",
232
+ "0.29.0"
230
233
  ];
231
234
  var KAY_PLUGIN_TARGET_NAMES = [
232
235
  "kay.agent",
@@ -2725,6 +2728,7 @@ __export(contributions_exports, {
2725
2728
  UriModuleFacts: () => UriModuleFacts,
2726
2729
  WhiteboardTypeContribution: () => WhiteboardTypeContribution,
2727
2730
  WhiteboardTypeStorage: () => WhiteboardTypeStorage,
2731
+ WorkflowContribution: () => WorkflowContribution,
2728
2732
  canonicalContributionSchemas: () => canonicalContributionSchemas
2729
2733
  });
2730
2734
  import { z as z12 } from "zod";
@@ -3275,6 +3279,24 @@ function createContributionsSchemas(canonical) {
3275
3279
  requestSchema: JsonSchema.optional(),
3276
3280
  responseSchema: JsonSchema.optional()
3277
3281
  });
3282
+ const WorkflowContribution2 = z12.strictObject({
3283
+ localId: LocalContributionId2,
3284
+ name: NonEmptyString3,
3285
+ /** Plain-text purpose, at most 280 characters. */
3286
+ description: NonEmptyString3,
3287
+ /** How often it runs. The automations engine enforces its scheduling floor. */
3288
+ everyMs: z12.number().int().positive(),
3289
+ auth: z12.strictObject({
3290
+ /** A local ref names a service in this manifest; a dotted ref names another plugin's. */
3291
+ service: AuthServiceReference2,
3292
+ scheme: AuthSchemeReference2,
3293
+ /**
3294
+ * Scopes each account's token must hold. Omitted, the host asks for the first scope of the
3295
+ * `background-job` grant's `allowedScopes` that the account holds.
3296
+ */
3297
+ scopes: z12.array(NonEmptyString3).min(1).optional()
3298
+ }).optional()
3299
+ });
3278
3300
  const McpServerUrl2 = pluginString(canonical).min(1).refine((value) => {
3279
3301
  let parsed;
3280
3302
  try {
@@ -3551,6 +3573,7 @@ function createContributionsSchemas(canonical) {
3551
3573
  "appDataSource",
3552
3574
  "whiteboardType",
3553
3575
  "approvalType",
3576
+ "workflow",
3554
3577
  "contextContributor",
3555
3578
  "transcriptionProvider",
3556
3579
  "deviceDelegation",
@@ -3594,6 +3617,7 @@ function createContributionsSchemas(canonical) {
3594
3617
  EntityResolverContribution: EntityResolverContribution2,
3595
3618
  AgentRenderContribution: AgentRenderContribution2,
3596
3619
  EndpointContribution: EndpointContribution2,
3620
+ WorkflowContribution: WorkflowContribution2,
3597
3621
  McpServerUrl: McpServerUrl2,
3598
3622
  McpServerAuthMode: McpServerAuthMode2,
3599
3623
  McpServerContribution: McpServerContribution2,
@@ -3627,7 +3651,7 @@ function createContributionsSchemas(canonical) {
3627
3651
  PluginContributionKind: PluginContributionKind2
3628
3652
  };
3629
3653
  }
3630
- 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);
3654
+ var { ApprovalCardForm, ApprovalCardStoredForm, ApprovalTypeContribution, UriModuleFacts, ToolContribution, ToolPermission, AgentToolContribution, ConverterContribution, UriModuleContribution, AppUriModuleContribution, AppDataSourceContribution, WhiteboardTypeStorage, WhiteboardTypeContribution, AppDataMaterializerContribution, ArtifactUriModuleContribution, CliBindingContribution, GitHostContribution, ResourceContribution, SkillContribution, PluginSkillSourceDeclaration, SearchProviderContribution, InteractionDriverContribution, EntityResolverContribution, AgentRenderContribution, EndpointContribution, WorkflowContribution, McpServerUrl, McpServerAuthMode, McpServerContribution, McpServerContributions, AppEventSubscription, ContextContributorContribution, PluginEventDefinitionContribution, PluginNotificationRuleContribution, UiEventSubscriptionContribution, DeviceDelegationContribution, SessionReaderContribution, UiCommandContribution, UiSlotContribution, SettingsPanelContribution, ResultRendererContribution, ReferenceOpenBehavior, ReferencePresentationVariant, ReferencePresentationVariants, ReferencePresentationUriPattern, ReferencePresentationUrlClaim, ReferencePresentationTooltip, ReferencePresentationContribution, RichViewContribution, KayUiAppHostCapability, UiAppCapabilities, UiAppActivityRail, UiAppContribution, ThemeContribution, CommandHandler, CommandContribution, PluginContributionKind } = createContributionsSchemas(false);
3631
3655
  var canonicalContributionSchemas = createContributionsSchemas(true);
3632
3656
 
3633
3657
  // packages/plugin-protocol/dist/icon-shape.js
@@ -3701,7 +3725,7 @@ var KAY_UI_NATIVE_EVENT_SUBSCRIPTIONS = [
3701
3725
  var KAY_UI_NATIVE_EVENT_ALLOWLIST = new Set(KAY_UI_NATIVE_EVENT_SUBSCRIPTIONS);
3702
3726
  var RETIRED_COMPATIBILITY_KEYS = ["policy"];
3703
3727
  function createManifestSchemas(canonical) {
3704
- const { AgentRenderContribution: AgentRenderContribution2, ApprovalTypeContribution: ApprovalTypeContribution2, AppDataMaterializerContribution: AppDataMaterializerContribution2, AppDataSourceContribution: AppDataSourceContribution2, AppUriModuleContribution: AppUriModuleContribution2, AppEventSubscription: AppEventSubscription2, ArtifactUriModuleContribution: ArtifactUriModuleContribution2, CliBindingContribution: CliBindingContribution2, CommandContribution: CommandContribution2, ContextContributorContribution: ContextContributorContribution2, ConverterContribution: ConverterContribution2, SessionReaderContribution: SessionReaderContribution2, DeviceDelegationContribution: DeviceDelegationContribution2, EndpointContribution: EndpointContribution2, EntityResolverContribution: EntityResolverContribution2, GitHostContribution: GitHostContribution2, McpServerContributions: McpServerContributions2, PluginEventDefinitionContribution: PluginEventDefinitionContribution2, PluginNotificationRuleContribution: PluginNotificationRuleContribution2, ResourceContribution: ResourceContribution2, ReferencePresentationContribution: ReferencePresentationContribution2, ResultRendererContribution: ResultRendererContribution2, RichViewContribution: RichViewContribution2, PluginSkillSourceDeclaration: PluginSkillSourceDeclaration2, InteractionDriverContribution: InteractionDriverContribution2, SearchProviderContribution: SearchProviderContribution2, SkillContribution: SkillContribution2, SettingsPanelContribution: SettingsPanelContribution2, ThemeContribution: ThemeContribution2, AgentToolContribution: AgentToolContribution2, ToolContribution: ToolContribution2, UiCommandContribution: UiCommandContribution2, UiAppContribution: UiAppContribution2, UiEventSubscriptionContribution: UiEventSubscriptionContribution2, UiSlotContribution: UiSlotContribution2, UriModuleContribution: UriModuleContribution2, WhiteboardTypeContribution: WhiteboardTypeContribution2 } = canonical ? canonicalContributionSchemas : contributions_exports;
3728
+ const { AgentRenderContribution: AgentRenderContribution2, ApprovalTypeContribution: ApprovalTypeContribution2, WorkflowContribution: WorkflowContribution2, AppDataMaterializerContribution: AppDataMaterializerContribution2, AppDataSourceContribution: AppDataSourceContribution2, AppUriModuleContribution: AppUriModuleContribution2, AppEventSubscription: AppEventSubscription2, ArtifactUriModuleContribution: ArtifactUriModuleContribution2, CliBindingContribution: CliBindingContribution2, CommandContribution: CommandContribution2, ContextContributorContribution: ContextContributorContribution2, ConverterContribution: ConverterContribution2, SessionReaderContribution: SessionReaderContribution2, DeviceDelegationContribution: DeviceDelegationContribution2, EndpointContribution: EndpointContribution2, EntityResolverContribution: EntityResolverContribution2, GitHostContribution: GitHostContribution2, McpServerContributions: McpServerContributions2, PluginEventDefinitionContribution: PluginEventDefinitionContribution2, PluginNotificationRuleContribution: PluginNotificationRuleContribution2, ResourceContribution: ResourceContribution2, ReferencePresentationContribution: ReferencePresentationContribution2, ResultRendererContribution: ResultRendererContribution2, RichViewContribution: RichViewContribution2, PluginSkillSourceDeclaration: PluginSkillSourceDeclaration2, InteractionDriverContribution: InteractionDriverContribution2, SearchProviderContribution: SearchProviderContribution2, SkillContribution: SkillContribution2, SettingsPanelContribution: SettingsPanelContribution2, ThemeContribution: ThemeContribution2, AgentToolContribution: AgentToolContribution2, ToolContribution: ToolContribution2, UiCommandContribution: UiCommandContribution2, UiAppContribution: UiAppContribution2, UiEventSubscriptionContribution: UiEventSubscriptionContribution2, UiSlotContribution: UiSlotContribution2, UriModuleContribution: UriModuleContribution2, WhiteboardTypeContribution: WhiteboardTypeContribution2 } = canonical ? canonicalContributionSchemas : contributions_exports;
3705
3729
  const { HttpsUrl: HttpsUrl2, LocalContributionId: LocalContributionId2, NonEmptyString: NonEmptyString3, PackageAssetPath: PackageAssetPath2, PluginId: PluginId2, PluginNamespace: PluginNamespace2, RegistrableDomain: RegistrableDomain2, SignedInStatusCode: SignedInStatusCode2, TargetEntrypoint: TargetEntrypoint2 } = canonical ? canonicalCommonSchemas : common_exports;
3706
3730
  const { PluginPermissionManifest: PluginPermissionManifest2 } = canonical ? canonicalPermissionSchemas : permissions_exports;
3707
3731
  const KayAgentTargetManifest2 = z13.strictObject({
@@ -3794,6 +3818,7 @@ function createManifestSchemas(canonical) {
3794
3818
  dataSources: z13.array(AppDataSourceContribution2).optional(),
3795
3819
  whiteboardTypes: z13.array(WhiteboardTypeContribution2).optional(),
3796
3820
  approvalTypes: z13.array(ApprovalTypeContribution2).optional(),
3821
+ workflows: z13.array(WorkflowContribution2).optional(),
3797
3822
  eventDefinitions: z13.array(PluginEventDefinitionContribution2).optional(),
3798
3823
  // Default notification rules over this plugin's own `eventDefinitions`; seeded by the host
3799
3824
  // (see `PluginNotificationRuleContribution`).
@@ -4374,6 +4399,35 @@ function createManifestSchemas(canonical) {
4374
4399
  });
4375
4400
  }
4376
4401
  }
4402
+ reportDuplicateLocalIds(ctx, ["targets", "kay", "app", "contributes", "workflows"], manifest.targets?.kay?.app?.contributes?.workflows, "workflow");
4403
+ for (const [index, workflow] of (manifest.targets?.kay?.app?.contributes?.workflows ?? []).entries()) {
4404
+ const path = [
4405
+ "targets",
4406
+ "kay",
4407
+ "app",
4408
+ "contributes",
4409
+ "workflows",
4410
+ index
4411
+ ];
4412
+ if (manifest.targets?.kay?.app?.entrypoint === void 0) {
4413
+ ctx.addIssue({
4414
+ code: "custom",
4415
+ path,
4416
+ message: `workflow ${workflow.localId} needs a kay.app entrypoint to implement it`
4417
+ });
4418
+ }
4419
+ const { auth } = workflow;
4420
+ if (auth === void 0)
4421
+ continue;
4422
+ const granted = manifest.permissions?.byTarget["kay.app"]?.auth?.some((grant) => grant.service === auth.service && grant.operations.includes("list") && grant.operations.includes("resolve") && (grant.purposes === void 0 || grant.purposes.includes("background-job")));
4423
+ if (granted !== true) {
4424
+ ctx.addIssue({
4425
+ code: "custom",
4426
+ path: [...path, "auth", "service"],
4427
+ message: `workflow ${workflow.localId} needs a kay.app auth grant on ${auth.service} with the list and resolve operations and the background-job purpose`
4428
+ });
4429
+ }
4430
+ }
4377
4431
  const syntheticContributionIds = collectSyntheticContributionIds(manifest);
4378
4432
  for (const contribution of collectDeclaredContributionIds(manifest)) {
4379
4433
  if (syntheticContributionIds.has(contribution.localId)) {
@@ -4922,6 +4976,7 @@ function collectKayAppContributionIds(manifest) {
4922
4976
  const contributes = manifest.targets?.kay?.app?.contributes;
4923
4977
  const output = [];
4924
4978
  pushContributionIds(output, ["targets", "kay", "app", "contributes", "approvalTypes"], contributes?.approvalTypes);
4979
+ pushContributionIds(output, ["targets", "kay", "app", "contributes", "workflows"], contributes?.workflows);
4925
4980
  pushContributionIds(output, ["targets", "kay", "app", "contributes", "tools"], contributes?.tools);
4926
4981
  pushContributionIds(output, ["targets", "kay", "app", "contributes", "endpoints"], contributes?.endpoints);
4927
4982
  pushContributionIds(output, ["targets", "kay", "app", "contributes", "uriModules"], contributes?.uriModules);
@@ -5071,6 +5126,18 @@ function createResolvedContractSchemas(canonical) {
5071
5126
  /** The auth service that module signs in through, whose accounts a card may send from. */
5072
5127
  authService: GlobalContributionId2.optional()
5073
5128
  });
5129
+ const ResolvedKayAppWorkflow2 = z14.strictObject({
5130
+ localId: LocalContributionId2,
5131
+ globalId: GlobalContributionId2,
5132
+ name: NonEmptyString3,
5133
+ description: NonEmptyString3,
5134
+ everyMs: z14.number().int().positive(),
5135
+ auth: z14.strictObject({
5136
+ serviceId: GlobalContributionId2,
5137
+ schemeId: GlobalContributionId2,
5138
+ scopes: z14.array(NonEmptyString3).min(1).optional()
5139
+ }).optional()
5140
+ });
5074
5141
  const ResolvedKayAppWhiteboardType2 = z14.strictObject({
5075
5142
  localId: LocalContributionId2,
5076
5143
  globalId: GlobalContributionId2,
@@ -5314,6 +5381,7 @@ function createResolvedContractSchemas(canonical) {
5314
5381
  kayAgentTools: z14.array(ResolvedKayAgentTool2).optional(),
5315
5382
  kayAppTools: z14.array(ResolvedKayAppTool2).optional(),
5316
5383
  kayAppApprovalTypes: z14.array(ResolvedKayAppApprovalType2).optional(),
5384
+ kayAppWorkflows: z14.array(ResolvedKayAppWorkflow2).optional(),
5317
5385
  kayAppDataSources: z14.array(ResolvedKayAppDataSource2).optional(),
5318
5386
  kayAppWhiteboardTypes: z14.array(ResolvedKayAppWhiteboardType2).optional(),
5319
5387
  kayAppMcpServers: z14.array(ResolvedKayAppMcpServer2).optional(),
@@ -5326,6 +5394,7 @@ function createResolvedContractSchemas(canonical) {
5326
5394
  ResolvedKayAgentTool: ResolvedKayAgentTool2,
5327
5395
  ResolvedKayAppTool: ResolvedKayAppTool2,
5328
5396
  ResolvedKayAppApprovalType: ResolvedKayAppApprovalType2,
5397
+ ResolvedKayAppWorkflow: ResolvedKayAppWorkflow2,
5329
5398
  ResolvedKayAppDataSource: ResolvedKayAppDataSource2,
5330
5399
  ResolvedKayAppWhiteboardType: ResolvedKayAppWhiteboardType2,
5331
5400
  ResolvedKayAppMcpServer: ResolvedKayAppMcpServer2,
@@ -5344,7 +5413,7 @@ function createResolvedContractSchemas(canonical) {
5344
5413
  ResolvedPluginContractV1: ResolvedPluginContractV12
5345
5414
  };
5346
5415
  }
5347
- var { ResolvedKayAppApprovalType, ResolvedPluginContributionId, ResolvedKayAgentTool, ResolvedKayAppTool, ResolvedKayAppDataSource, ResolvedKayAppWhiteboardType, ResolvedKayAppMcpServer, ResolvedKayAgentUriModule, ResolvedKayAgentArtifactUriModule, ResolvedKayAgentEntityResolver, ResolvedKayAgentGitHostClaim, ResolvedKayAgentConverter, ResolvedReferencePresentation, ResolvedPluginProvisioningRequirement, ResolvedPluginAuthScheme, ResolvedPluginWebSession, ResolvedPluginAuthService, ResolvedKayUiAppEndpointCapability, ResolvedKayUiApp, ResolvedPluginContractV1 } = createResolvedContractSchemas(false);
5416
+ var { ResolvedKayAppApprovalType, ResolvedKayAppWorkflow, ResolvedPluginContributionId, ResolvedKayAgentTool, ResolvedKayAppTool, ResolvedKayAppDataSource, ResolvedKayAppWhiteboardType, ResolvedKayAppMcpServer, ResolvedKayAgentUriModule, ResolvedKayAgentArtifactUriModule, ResolvedKayAgentEntityResolver, ResolvedKayAgentGitHostClaim, ResolvedKayAgentConverter, ResolvedReferencePresentation, ResolvedPluginProvisioningRequirement, ResolvedPluginAuthScheme, ResolvedPluginWebSession, ResolvedPluginAuthService, ResolvedKayUiAppEndpointCapability, ResolvedKayUiApp, ResolvedPluginContractV1 } = createResolvedContractSchemas(false);
5348
5417
  var canonicalResolvedContractSchemas = createResolvedContractSchemas(true);
5349
5418
  function narrowestAccountSelectors() {
5350
5419
  return [{ kind: "active" }];
@@ -5384,6 +5453,7 @@ function collectContributionSources(manifest) {
5384
5453
  pushAll(output, "kay.app", "appDataSource", app?.dataSources);
5385
5454
  pushAll(output, "kay.app", "whiteboardType", app?.whiteboardTypes);
5386
5455
  pushAll(output, "kay.app", "approvalType", app?.approvalTypes);
5456
+ pushAll(output, "kay.app", "workflow", app?.workflows);
5387
5457
  pushAll(output, "kay.app", "command", app?.commands);
5388
5458
  pushAll(output, "kay.app", "eventDefinition", app?.eventDefinitions);
5389
5459
  pushAll(output, "kay.app", "eventSubscription", app?.eventSubscriptions);
@@ -5662,6 +5732,17 @@ function resolveKayPluginContractV1(manifest) {
5662
5732
  globalId: resolveGlobalContributionId(namespace, tool.localId),
5663
5733
  toolName: tool.toolName
5664
5734
  }));
5735
+ const kayAppWorkflows = manifest.targets?.kay?.app?.contributes?.workflows?.map(({ auth, ...workflow }) => ({
5736
+ ...workflow,
5737
+ globalId: resolveGlobalContributionId(namespace, workflow.localId),
5738
+ ...auth === void 0 ? {} : {
5739
+ auth: {
5740
+ serviceId: isQualifiedAuthServiceRef(auth.service) ? auth.service : resolveGlobalContributionId(namespace, auth.service),
5741
+ schemeId: isQualifiedAuthSchemeRef(auth.scheme) ? auth.scheme : resolveGlobalContributionId(namespace, auth.scheme),
5742
+ ...auth.scopes === void 0 ? {} : { scopes: auth.scopes }
5743
+ }
5744
+ }
5745
+ }));
5665
5746
  const kayAppDataSources = manifest.targets?.kay?.app?.contributes?.dataSources?.map((source) => ({
5666
5747
  localId: source.localId,
5667
5748
  globalId: resolveGlobalContributionId(namespace, source.localId),
@@ -5812,6 +5893,7 @@ function resolveKayPluginContractV1(manifest) {
5812
5893
  ...kayAgentTools && kayAgentTools.length > 0 ? { kayAgentTools } : {},
5813
5894
  ...kayAppTools && kayAppTools.length > 0 ? { kayAppTools } : {},
5814
5895
  ...kayAppApprovalTypes && kayAppApprovalTypes.length > 0 ? { kayAppApprovalTypes } : {},
5896
+ ...kayAppWorkflows && kayAppWorkflows.length > 0 ? { kayAppWorkflows } : {},
5815
5897
  ...kayAppDataSources && kayAppDataSources.length > 0 ? { kayAppDataSources } : {},
5816
5898
  ...kayAppWhiteboardTypes && kayAppWhiteboardTypes.length > 0 ? { kayAppWhiteboardTypes } : {},
5817
5899
  ...kayAppMcpServers.length > 0 ? { kayAppMcpServers } : {},
@@ -5839,7 +5921,6 @@ function uriModuleFacts({ localId: _localId, schemes: _schemes, displayName: _di
5839
5921
 
5840
5922
  // packages/plugin-protocol/dist/plugin-directory-verdict.js
5841
5923
  var KAY_PLUGIN_MANIFEST_FILENAME = "kay-plugin.json";
5842
- var KAY_PLUGIN_MANIFEST_SIZE_CAP_BYTES = 64 * 1024;
5843
5924
  var RESERVED_DIRECTORY_PLUGIN_ID_PREFIXES = ["herd.", "kay."];
5844
5925
  async function judgeKayPluginDirectory(input) {
5845
5926
  const { tree, root, dir, host } = input;
@@ -6698,6 +6779,7 @@ export {
6698
6779
  ResolvedKayAppMcpServer,
6699
6780
  ResolvedKayAppTool,
6700
6781
  ResolvedKayAppWhiteboardType,
6782
+ ResolvedKayAppWorkflow,
6701
6783
  ResolvedKayUiApp,
6702
6784
  ResolvedKayUiAppEndpointCapability,
6703
6785
  ResolvedPluginAuthScheme,
@@ -6764,6 +6846,7 @@ export {
6764
6846
  WhiteboardTypeInfo,
6765
6847
  WhiteboardTypeStorage,
6766
6848
  WhiteboardValue,
6849
+ WorkflowContribution,
6767
6850
  approvalKindSchema,
6768
6851
  boundPluginDiagnosticMessage,
6769
6852
  captureArtifactProvenance,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yaklabs-ai/plugin-protocol",
3
- "version": "0.29.0",
3
+ "version": "0.30.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",