@yaklabs-ai/plugin-protocol 0.28.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 +1 -1
- package/THIRD-PARTY-INVENTORY.json +1 -1
- package/dist/index.d.ts +94 -2
- package/dist/index.js +90 -6
- package/package.json +1 -1
package/README.md
CHANGED
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
|
|
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";
|
|
@@ -3917,8 +3931,20 @@ export declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
|
|
|
3917
3931
|
* host holds may name one too. A plugin using a removed member or value stops loading until it is
|
|
3918
3932
|
* rebuilt; a code search found none outside this repo. A plugin with a sign-in declares ^0.28.0. 0.26.3 and 0.27.1
|
|
3919
3933
|
* stay served for a plugin that uses none of these.
|
|
3934
|
+
*
|
|
3935
|
+
* 0.29.0 replaces `servedSimulators` (`KayServedSimulators`, a lookup by adapter id) with
|
|
3936
|
+
* `simulator` on both targets (#14929): what the plugin's own simulator built, handed over once by
|
|
3937
|
+
* whichever process runs the plugin. A plugin's simulator file exports `createPluginSimulator`
|
|
3938
|
+
* (`KayPluginSimulatorFactory`). A clean break: only this repo's plugins read the old member, and
|
|
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.
|
|
3920
3946
|
*/
|
|
3921
|
-
export declare const KAY_PLUGIN_SDK_VERSION: "0.
|
|
3947
|
+
export declare const KAY_PLUGIN_SDK_VERSION: "0.30.0";
|
|
3922
3948
|
|
|
3923
3949
|
export declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
|
|
3924
3950
|
|
|
@@ -4509,6 +4535,17 @@ export declare const KayAppTargetManifest: z.ZodObject<{
|
|
|
4509
4535
|
}, z.core.$strict>>>;
|
|
4510
4536
|
}, z.core.$strict>>;
|
|
4511
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>>>;
|
|
4512
4549
|
eventDefinitions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
4513
4550
|
localId: z.ZodString;
|
|
4514
4551
|
displayName: z.ZodOptional<z.ZodString>;
|
|
@@ -5262,6 +5299,17 @@ export declare const KayPluginManifestV1: z.ZodObject<{
|
|
|
5262
5299
|
}, z.core.$strict>>>;
|
|
5263
5300
|
}, z.core.$strict>>;
|
|
5264
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>>>;
|
|
5265
5313
|
eventDefinitions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
5266
5314
|
localId: z.ZodString;
|
|
5267
5315
|
displayName: z.ZodOptional<z.ZodString>;
|
|
@@ -8929,6 +8977,7 @@ export declare const PluginContributionKind: z.ZodEnum<{
|
|
|
8929
8977
|
appDataSource: "appDataSource";
|
|
8930
8978
|
whiteboardType: "whiteboardType";
|
|
8931
8979
|
approvalType: "approvalType";
|
|
8980
|
+
workflow: "workflow";
|
|
8932
8981
|
contextContributor: "contextContributor";
|
|
8933
8982
|
transcriptionProvider: "transcriptionProvider";
|
|
8934
8983
|
deviceDelegation: "deviceDelegation";
|
|
@@ -10507,6 +10556,21 @@ export declare const ResolvedKayAppWhiteboardType: z.ZodObject<{
|
|
|
10507
10556
|
|
|
10508
10557
|
export declare type ResolvedKayAppWhiteboardType = z.infer<typeof ResolvedKayAppWhiteboardType>;
|
|
10509
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
|
+
|
|
10510
10574
|
export declare const ResolvedKayUiApp: z.ZodObject<{
|
|
10511
10575
|
localId: z.ZodString;
|
|
10512
10576
|
globalId: z.ZodString;
|
|
@@ -10910,6 +10974,7 @@ export declare const ResolvedPluginContractV1: z.ZodObject<{
|
|
|
10910
10974
|
appDataSource: "appDataSource";
|
|
10911
10975
|
whiteboardType: "whiteboardType";
|
|
10912
10976
|
approvalType: "approvalType";
|
|
10977
|
+
workflow: "workflow";
|
|
10913
10978
|
contextContributor: "contextContributor";
|
|
10914
10979
|
transcriptionProvider: "transcriptionProvider";
|
|
10915
10980
|
deviceDelegation: "deviceDelegation";
|
|
@@ -11681,6 +11746,18 @@ export declare const ResolvedPluginContractV1: z.ZodObject<{
|
|
|
11681
11746
|
moduleId: z.ZodString;
|
|
11682
11747
|
authService: z.ZodOptional<z.ZodString>;
|
|
11683
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>>>;
|
|
11684
11761
|
kayAppDataSources: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
11685
11762
|
localId: z.ZodString;
|
|
11686
11763
|
globalId: z.ZodString;
|
|
@@ -11877,6 +11954,7 @@ export declare const ResolvedPluginContributionId: z.ZodObject<{
|
|
|
11877
11954
|
appDataSource: "appDataSource";
|
|
11878
11955
|
whiteboardType: "whiteboardType";
|
|
11879
11956
|
approvalType: "approvalType";
|
|
11957
|
+
workflow: "workflow";
|
|
11880
11958
|
contextContributor: "contextContributor";
|
|
11881
11959
|
transcriptionProvider: "transcriptionProvider";
|
|
11882
11960
|
deviceDelegation: "deviceDelegation";
|
|
@@ -14102,4 +14180,18 @@ export declare const WhiteboardValue: z.ZodType<JsonValue, unknown, z.core.$ZodT
|
|
|
14102
14180
|
|
|
14103
14181
|
export declare type WhiteboardValue = z.infer<typeof WhiteboardValue>;
|
|
14104
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
|
+
|
|
14105
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,12 +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.
|
|
227
|
+
var KAY_PLUGIN_SDK_VERSION = "0.30.0";
|
|
226
228
|
var KAY_PLUGIN_COMPATIBLE_SDK_VERSIONS = [
|
|
227
229
|
"0.26.3",
|
|
228
|
-
"0.27.1"
|
|
230
|
+
"0.27.1",
|
|
231
|
+
"0.28.0",
|
|
232
|
+
"0.29.0"
|
|
229
233
|
];
|
|
230
234
|
var KAY_PLUGIN_TARGET_NAMES = [
|
|
231
235
|
"kay.agent",
|
|
@@ -2724,6 +2728,7 @@ __export(contributions_exports, {
|
|
|
2724
2728
|
UriModuleFacts: () => UriModuleFacts,
|
|
2725
2729
|
WhiteboardTypeContribution: () => WhiteboardTypeContribution,
|
|
2726
2730
|
WhiteboardTypeStorage: () => WhiteboardTypeStorage,
|
|
2731
|
+
WorkflowContribution: () => WorkflowContribution,
|
|
2727
2732
|
canonicalContributionSchemas: () => canonicalContributionSchemas
|
|
2728
2733
|
});
|
|
2729
2734
|
import { z as z12 } from "zod";
|
|
@@ -3274,6 +3279,24 @@ function createContributionsSchemas(canonical) {
|
|
|
3274
3279
|
requestSchema: JsonSchema.optional(),
|
|
3275
3280
|
responseSchema: JsonSchema.optional()
|
|
3276
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
|
+
});
|
|
3277
3300
|
const McpServerUrl2 = pluginString(canonical).min(1).refine((value) => {
|
|
3278
3301
|
let parsed;
|
|
3279
3302
|
try {
|
|
@@ -3550,6 +3573,7 @@ function createContributionsSchemas(canonical) {
|
|
|
3550
3573
|
"appDataSource",
|
|
3551
3574
|
"whiteboardType",
|
|
3552
3575
|
"approvalType",
|
|
3576
|
+
"workflow",
|
|
3553
3577
|
"contextContributor",
|
|
3554
3578
|
"transcriptionProvider",
|
|
3555
3579
|
"deviceDelegation",
|
|
@@ -3593,6 +3617,7 @@ function createContributionsSchemas(canonical) {
|
|
|
3593
3617
|
EntityResolverContribution: EntityResolverContribution2,
|
|
3594
3618
|
AgentRenderContribution: AgentRenderContribution2,
|
|
3595
3619
|
EndpointContribution: EndpointContribution2,
|
|
3620
|
+
WorkflowContribution: WorkflowContribution2,
|
|
3596
3621
|
McpServerUrl: McpServerUrl2,
|
|
3597
3622
|
McpServerAuthMode: McpServerAuthMode2,
|
|
3598
3623
|
McpServerContribution: McpServerContribution2,
|
|
@@ -3626,7 +3651,7 @@ function createContributionsSchemas(canonical) {
|
|
|
3626
3651
|
PluginContributionKind: PluginContributionKind2
|
|
3627
3652
|
};
|
|
3628
3653
|
}
|
|
3629
|
-
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);
|
|
3630
3655
|
var canonicalContributionSchemas = createContributionsSchemas(true);
|
|
3631
3656
|
|
|
3632
3657
|
// packages/plugin-protocol/dist/icon-shape.js
|
|
@@ -3700,7 +3725,7 @@ var KAY_UI_NATIVE_EVENT_SUBSCRIPTIONS = [
|
|
|
3700
3725
|
var KAY_UI_NATIVE_EVENT_ALLOWLIST = new Set(KAY_UI_NATIVE_EVENT_SUBSCRIPTIONS);
|
|
3701
3726
|
var RETIRED_COMPATIBILITY_KEYS = ["policy"];
|
|
3702
3727
|
function createManifestSchemas(canonical) {
|
|
3703
|
-
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;
|
|
3704
3729
|
const { HttpsUrl: HttpsUrl2, LocalContributionId: LocalContributionId2, NonEmptyString: NonEmptyString3, PackageAssetPath: PackageAssetPath2, PluginId: PluginId2, PluginNamespace: PluginNamespace2, RegistrableDomain: RegistrableDomain2, SignedInStatusCode: SignedInStatusCode2, TargetEntrypoint: TargetEntrypoint2 } = canonical ? canonicalCommonSchemas : common_exports;
|
|
3705
3730
|
const { PluginPermissionManifest: PluginPermissionManifest2 } = canonical ? canonicalPermissionSchemas : permissions_exports;
|
|
3706
3731
|
const KayAgentTargetManifest2 = z13.strictObject({
|
|
@@ -3793,6 +3818,7 @@ function createManifestSchemas(canonical) {
|
|
|
3793
3818
|
dataSources: z13.array(AppDataSourceContribution2).optional(),
|
|
3794
3819
|
whiteboardTypes: z13.array(WhiteboardTypeContribution2).optional(),
|
|
3795
3820
|
approvalTypes: z13.array(ApprovalTypeContribution2).optional(),
|
|
3821
|
+
workflows: z13.array(WorkflowContribution2).optional(),
|
|
3796
3822
|
eventDefinitions: z13.array(PluginEventDefinitionContribution2).optional(),
|
|
3797
3823
|
// Default notification rules over this plugin's own `eventDefinitions`; seeded by the host
|
|
3798
3824
|
// (see `PluginNotificationRuleContribution`).
|
|
@@ -4373,6 +4399,35 @@ function createManifestSchemas(canonical) {
|
|
|
4373
4399
|
});
|
|
4374
4400
|
}
|
|
4375
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
|
+
}
|
|
4376
4431
|
const syntheticContributionIds = collectSyntheticContributionIds(manifest);
|
|
4377
4432
|
for (const contribution of collectDeclaredContributionIds(manifest)) {
|
|
4378
4433
|
if (syntheticContributionIds.has(contribution.localId)) {
|
|
@@ -4921,6 +4976,7 @@ function collectKayAppContributionIds(manifest) {
|
|
|
4921
4976
|
const contributes = manifest.targets?.kay?.app?.contributes;
|
|
4922
4977
|
const output = [];
|
|
4923
4978
|
pushContributionIds(output, ["targets", "kay", "app", "contributes", "approvalTypes"], contributes?.approvalTypes);
|
|
4979
|
+
pushContributionIds(output, ["targets", "kay", "app", "contributes", "workflows"], contributes?.workflows);
|
|
4924
4980
|
pushContributionIds(output, ["targets", "kay", "app", "contributes", "tools"], contributes?.tools);
|
|
4925
4981
|
pushContributionIds(output, ["targets", "kay", "app", "contributes", "endpoints"], contributes?.endpoints);
|
|
4926
4982
|
pushContributionIds(output, ["targets", "kay", "app", "contributes", "uriModules"], contributes?.uriModules);
|
|
@@ -5070,6 +5126,18 @@ function createResolvedContractSchemas(canonical) {
|
|
|
5070
5126
|
/** The auth service that module signs in through, whose accounts a card may send from. */
|
|
5071
5127
|
authService: GlobalContributionId2.optional()
|
|
5072
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
|
+
});
|
|
5073
5141
|
const ResolvedKayAppWhiteboardType2 = z14.strictObject({
|
|
5074
5142
|
localId: LocalContributionId2,
|
|
5075
5143
|
globalId: GlobalContributionId2,
|
|
@@ -5313,6 +5381,7 @@ function createResolvedContractSchemas(canonical) {
|
|
|
5313
5381
|
kayAgentTools: z14.array(ResolvedKayAgentTool2).optional(),
|
|
5314
5382
|
kayAppTools: z14.array(ResolvedKayAppTool2).optional(),
|
|
5315
5383
|
kayAppApprovalTypes: z14.array(ResolvedKayAppApprovalType2).optional(),
|
|
5384
|
+
kayAppWorkflows: z14.array(ResolvedKayAppWorkflow2).optional(),
|
|
5316
5385
|
kayAppDataSources: z14.array(ResolvedKayAppDataSource2).optional(),
|
|
5317
5386
|
kayAppWhiteboardTypes: z14.array(ResolvedKayAppWhiteboardType2).optional(),
|
|
5318
5387
|
kayAppMcpServers: z14.array(ResolvedKayAppMcpServer2).optional(),
|
|
@@ -5325,6 +5394,7 @@ function createResolvedContractSchemas(canonical) {
|
|
|
5325
5394
|
ResolvedKayAgentTool: ResolvedKayAgentTool2,
|
|
5326
5395
|
ResolvedKayAppTool: ResolvedKayAppTool2,
|
|
5327
5396
|
ResolvedKayAppApprovalType: ResolvedKayAppApprovalType2,
|
|
5397
|
+
ResolvedKayAppWorkflow: ResolvedKayAppWorkflow2,
|
|
5328
5398
|
ResolvedKayAppDataSource: ResolvedKayAppDataSource2,
|
|
5329
5399
|
ResolvedKayAppWhiteboardType: ResolvedKayAppWhiteboardType2,
|
|
5330
5400
|
ResolvedKayAppMcpServer: ResolvedKayAppMcpServer2,
|
|
@@ -5343,7 +5413,7 @@ function createResolvedContractSchemas(canonical) {
|
|
|
5343
5413
|
ResolvedPluginContractV1: ResolvedPluginContractV12
|
|
5344
5414
|
};
|
|
5345
5415
|
}
|
|
5346
|
-
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);
|
|
5347
5417
|
var canonicalResolvedContractSchemas = createResolvedContractSchemas(true);
|
|
5348
5418
|
function narrowestAccountSelectors() {
|
|
5349
5419
|
return [{ kind: "active" }];
|
|
@@ -5383,6 +5453,7 @@ function collectContributionSources(manifest) {
|
|
|
5383
5453
|
pushAll(output, "kay.app", "appDataSource", app?.dataSources);
|
|
5384
5454
|
pushAll(output, "kay.app", "whiteboardType", app?.whiteboardTypes);
|
|
5385
5455
|
pushAll(output, "kay.app", "approvalType", app?.approvalTypes);
|
|
5456
|
+
pushAll(output, "kay.app", "workflow", app?.workflows);
|
|
5386
5457
|
pushAll(output, "kay.app", "command", app?.commands);
|
|
5387
5458
|
pushAll(output, "kay.app", "eventDefinition", app?.eventDefinitions);
|
|
5388
5459
|
pushAll(output, "kay.app", "eventSubscription", app?.eventSubscriptions);
|
|
@@ -5661,6 +5732,17 @@ function resolveKayPluginContractV1(manifest) {
|
|
|
5661
5732
|
globalId: resolveGlobalContributionId(namespace, tool.localId),
|
|
5662
5733
|
toolName: tool.toolName
|
|
5663
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
|
+
}));
|
|
5664
5746
|
const kayAppDataSources = manifest.targets?.kay?.app?.contributes?.dataSources?.map((source) => ({
|
|
5665
5747
|
localId: source.localId,
|
|
5666
5748
|
globalId: resolveGlobalContributionId(namespace, source.localId),
|
|
@@ -5811,6 +5893,7 @@ function resolveKayPluginContractV1(manifest) {
|
|
|
5811
5893
|
...kayAgentTools && kayAgentTools.length > 0 ? { kayAgentTools } : {},
|
|
5812
5894
|
...kayAppTools && kayAppTools.length > 0 ? { kayAppTools } : {},
|
|
5813
5895
|
...kayAppApprovalTypes && kayAppApprovalTypes.length > 0 ? { kayAppApprovalTypes } : {},
|
|
5896
|
+
...kayAppWorkflows && kayAppWorkflows.length > 0 ? { kayAppWorkflows } : {},
|
|
5814
5897
|
...kayAppDataSources && kayAppDataSources.length > 0 ? { kayAppDataSources } : {},
|
|
5815
5898
|
...kayAppWhiteboardTypes && kayAppWhiteboardTypes.length > 0 ? { kayAppWhiteboardTypes } : {},
|
|
5816
5899
|
...kayAppMcpServers.length > 0 ? { kayAppMcpServers } : {},
|
|
@@ -5838,7 +5921,6 @@ function uriModuleFacts({ localId: _localId, schemes: _schemes, displayName: _di
|
|
|
5838
5921
|
|
|
5839
5922
|
// packages/plugin-protocol/dist/plugin-directory-verdict.js
|
|
5840
5923
|
var KAY_PLUGIN_MANIFEST_FILENAME = "kay-plugin.json";
|
|
5841
|
-
var KAY_PLUGIN_MANIFEST_SIZE_CAP_BYTES = 64 * 1024;
|
|
5842
5924
|
var RESERVED_DIRECTORY_PLUGIN_ID_PREFIXES = ["herd.", "kay."];
|
|
5843
5925
|
async function judgeKayPluginDirectory(input) {
|
|
5844
5926
|
const { tree, root, dir, host } = input;
|
|
@@ -6697,6 +6779,7 @@ export {
|
|
|
6697
6779
|
ResolvedKayAppMcpServer,
|
|
6698
6780
|
ResolvedKayAppTool,
|
|
6699
6781
|
ResolvedKayAppWhiteboardType,
|
|
6782
|
+
ResolvedKayAppWorkflow,
|
|
6700
6783
|
ResolvedKayUiApp,
|
|
6701
6784
|
ResolvedKayUiAppEndpointCapability,
|
|
6702
6785
|
ResolvedPluginAuthScheme,
|
|
@@ -6763,6 +6846,7 @@ export {
|
|
|
6763
6846
|
WhiteboardTypeInfo,
|
|
6764
6847
|
WhiteboardTypeStorage,
|
|
6765
6848
|
WhiteboardValue,
|
|
6849
|
+
WorkflowContribution,
|
|
6766
6850
|
approvalKindSchema,
|
|
6767
6851
|
boundPluginDiagnosticMessage,
|
|
6768
6852
|
captureArtifactProvenance,
|
package/package.json
CHANGED