@yaklabs-ai/plugin-protocol 0.52.0 → 0.53.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 +309 -39
- package/dist/index.js +824 -670
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -266,8 +266,10 @@ var JsonSchema = z4.record(z4.string(), JsonValue);
|
|
|
266
266
|
var KAY_PLUGIN_MANIFEST_SIZE_CAP_BYTES = 1024 * 1024;
|
|
267
267
|
var KAY_PLUGIN_PROTOCOL_VERSION = "kay.plugin.v1";
|
|
268
268
|
var KAY_PLUGIN_PROTOCOL_PACKAGE_NAME = "@bonsai/plugin-protocol";
|
|
269
|
-
var KAY_PLUGIN_SDK_VERSION = "0.
|
|
269
|
+
var KAY_PLUGIN_SDK_VERSION = "0.53.0";
|
|
270
270
|
var KAY_PLUGIN_COMPATIBLE_SDK_VERSIONS = [
|
|
271
|
+
"0.52.1",
|
|
272
|
+
"0.52.0",
|
|
271
273
|
"0.51.0",
|
|
272
274
|
"0.50.0",
|
|
273
275
|
"0.49.0"
|
|
@@ -1822,6 +1824,7 @@ var PLUGIN_CAPABILITY_SLUGS = [
|
|
|
1822
1824
|
"agents.run",
|
|
1823
1825
|
"dynamic-context.register",
|
|
1824
1826
|
"app-data.register",
|
|
1827
|
+
"app-data.read",
|
|
1825
1828
|
"knowledge-source.register",
|
|
1826
1829
|
"artifacts.read",
|
|
1827
1830
|
"session-artifacts.read",
|
|
@@ -1838,6 +1841,7 @@ var PLUGIN_CAPABILITY_SLUGS = [
|
|
|
1838
1841
|
"mcp.host-server",
|
|
1839
1842
|
"prompt.resident",
|
|
1840
1843
|
"skills.declared-source",
|
|
1844
|
+
"family-folder.root",
|
|
1841
1845
|
"whiteboard.discover",
|
|
1842
1846
|
"whiteboard.read",
|
|
1843
1847
|
"whiteboard.create",
|
|
@@ -1965,7 +1969,7 @@ function createAuthoritySchemas(canonical) {
|
|
|
1965
1969
|
})
|
|
1966
1970
|
}),
|
|
1967
1971
|
z11.strictObject({
|
|
1968
|
-
target: z11.enum(["kay.agent", "kay.app"]),
|
|
1972
|
+
target: z11.enum(["kay.agent", "kay.app", "kay.ui"]),
|
|
1969
1973
|
slug: z11.literal("endpoints.invoke"),
|
|
1970
1974
|
envelope: z11.strictObject({
|
|
1971
1975
|
pluginId: PluginId2,
|
|
@@ -2108,6 +2112,14 @@ function createAuthoritySchemas(canonical) {
|
|
|
2108
2112
|
// section tag at the model boundary - so the row a human consents to names the section.
|
|
2109
2113
|
envelope: z11.strictObject({ contributor: NonEmptyString3 })
|
|
2110
2114
|
}),
|
|
2115
|
+
z11.strictObject({
|
|
2116
|
+
target: z11.literal("kay.ui"),
|
|
2117
|
+
slug: z11.literal("app-data.read"),
|
|
2118
|
+
envelope: z11.strictObject({
|
|
2119
|
+
pluginId: PluginId2,
|
|
2120
|
+
sourceId: LocalContributionId2
|
|
2121
|
+
})
|
|
2122
|
+
}),
|
|
2111
2123
|
z11.strictObject({
|
|
2112
2124
|
target: z11.literal("kay.app"),
|
|
2113
2125
|
slug: z11.literal("app-data.register"),
|
|
@@ -2228,6 +2240,11 @@ function createAuthoritySchemas(canonical) {
|
|
|
2228
2240
|
slug: z11.literal("skills.declared-source"),
|
|
2229
2241
|
envelope: DeclaredSkillSourceEnvelope2
|
|
2230
2242
|
}),
|
|
2243
|
+
z11.strictObject({
|
|
2244
|
+
target: z11.literal("kay.agent"),
|
|
2245
|
+
slug: z11.literal("family-folder.root"),
|
|
2246
|
+
envelope: z11.strictObject({})
|
|
2247
|
+
}),
|
|
2231
2248
|
WhiteboardCapabilityClaimV12
|
|
2232
2249
|
]);
|
|
2233
2250
|
const PluginCapabilityRefusalLayer2 = z11.enum(["grant", "binding", "release"]);
|
|
@@ -2339,6 +2356,7 @@ function sameClaim(a, b) {
|
|
|
2339
2356
|
case "prompt.resident":
|
|
2340
2357
|
case "model-selection.register":
|
|
2341
2358
|
case "system-prompt.register":
|
|
2359
|
+
case "family-folder.root":
|
|
2342
2360
|
return true;
|
|
2343
2361
|
case "uri.call":
|
|
2344
2362
|
return b.slug === "uri.call" && a.envelope.scheme === b.envelope.scheme && a.envelope.verb === b.envelope.verb;
|
|
@@ -2361,6 +2379,8 @@ function sameClaim(a, b) {
|
|
|
2361
2379
|
return b.slug === a.slug && a.envelope.kind === b.envelope.kind;
|
|
2362
2380
|
case "knowledge-source.register":
|
|
2363
2381
|
return b.slug === "knowledge-source.register" && a.envelope.source === b.envelope.source;
|
|
2382
|
+
case "app-data.read":
|
|
2383
|
+
return b.slug === "app-data.read" && a.envelope.pluginId === b.envelope.pluginId && a.envelope.sourceId === b.envelope.sourceId;
|
|
2364
2384
|
case "app-data.register":
|
|
2365
2385
|
return b.slug === "app-data.register" && a.envelope.source === b.envelope.source;
|
|
2366
2386
|
case "agents.permissions":
|
|
@@ -2428,6 +2448,7 @@ function envelopePairs(a, b) {
|
|
|
2428
2448
|
case "prompt.resident":
|
|
2429
2449
|
case "model-selection.register":
|
|
2430
2450
|
case "system-prompt.register":
|
|
2451
|
+
case "family-folder.root":
|
|
2431
2452
|
return [];
|
|
2432
2453
|
case "uri.call":
|
|
2433
2454
|
return b.slug === "uri.call" ? [
|
|
@@ -2462,6 +2483,11 @@ function envelopePairs(a, b) {
|
|
|
2462
2483
|
return b.slug === a.slug ? [[a.envelope.kind, b.envelope.kind]] : [];
|
|
2463
2484
|
case "knowledge-source.register":
|
|
2464
2485
|
return b.slug === "knowledge-source.register" ? [[a.envelope.source, b.envelope.source]] : [];
|
|
2486
|
+
case "app-data.read":
|
|
2487
|
+
return b.slug === "app-data.read" ? [
|
|
2488
|
+
[a.envelope.pluginId, b.envelope.pluginId],
|
|
2489
|
+
[a.envelope.sourceId, b.envelope.sourceId]
|
|
2490
|
+
] : [];
|
|
2465
2491
|
case "app-data.register":
|
|
2466
2492
|
return b.slug === "app-data.register" ? [[a.envelope.source, b.envelope.source]] : [];
|
|
2467
2493
|
case "agents.permissions":
|
|
@@ -2864,6 +2890,7 @@ __export(contributions_exports, {
|
|
|
2864
2890
|
ToolContribution: () => ToolContribution,
|
|
2865
2891
|
ToolPermission: () => ToolPermission,
|
|
2866
2892
|
UiAppCapabilities: () => UiAppCapabilities,
|
|
2893
|
+
UiAppCapabilityReference: () => UiAppCapabilityReference,
|
|
2867
2894
|
UiAppContribution: () => UiAppContribution,
|
|
2868
2895
|
UiCommandContribution: () => UiCommandContribution,
|
|
2869
2896
|
UiEventSubscriptionContribution: () => UiEventSubscriptionContribution,
|
|
@@ -2880,7 +2907,7 @@ __export(contributions_exports, {
|
|
|
2880
2907
|
isUiAppSourceModule: () => isUiAppSourceModule,
|
|
2881
2908
|
uiAppSourceStylePath: () => uiAppSourceStylePath
|
|
2882
2909
|
});
|
|
2883
|
-
import { z as
|
|
2910
|
+
import { z as z14 } from "zod";
|
|
2884
2911
|
|
|
2885
2912
|
// packages/plugin-protocol/dist/plugin-events.js
|
|
2886
2913
|
var plugin_events_exports = {};
|
|
@@ -3034,6 +3061,53 @@ function pluginSignalPayloadJsonSchema() {
|
|
|
3034
3061
|
});
|
|
3035
3062
|
}
|
|
3036
3063
|
|
|
3064
|
+
// packages/plugin-protocol/dist/whiteboard.js
|
|
3065
|
+
import { z as z13 } from "zod";
|
|
3066
|
+
var WhiteboardEntryReference = z13.strictObject({
|
|
3067
|
+
uriTemplate: z13.string().regex(/^[a-z][a-z0-9+.-]*:\/\/[^\s?#{}]+\/\{name\}$/u)
|
|
3068
|
+
});
|
|
3069
|
+
var WhiteboardValue = JsonValue;
|
|
3070
|
+
var WhiteboardEntryEnvelope = z13.strictObject({
|
|
3071
|
+
id: NonEmptyString,
|
|
3072
|
+
typeId: GlobalContributionId,
|
|
3073
|
+
schemaVersion: z13.number().int().positive(),
|
|
3074
|
+
title: z13.string(),
|
|
3075
|
+
authorSessionId: NonEmptyString.nullable()
|
|
3076
|
+
});
|
|
3077
|
+
var WhiteboardEntrySummary = z13.strictObject({
|
|
3078
|
+
name: NonEmptyString,
|
|
3079
|
+
entry: WhiteboardEntryEnvelope,
|
|
3080
|
+
revision: NonEmptyString
|
|
3081
|
+
});
|
|
3082
|
+
var WhiteboardEntrySnapshot = WhiteboardEntrySummary.extend({
|
|
3083
|
+
value: WhiteboardValue
|
|
3084
|
+
});
|
|
3085
|
+
var WhiteboardDiagnostic = z13.strictObject({
|
|
3086
|
+
ruleId: NonEmptyString,
|
|
3087
|
+
severity: z13.enum(["error", "warning"]),
|
|
3088
|
+
message: NonEmptyString
|
|
3089
|
+
});
|
|
3090
|
+
var WhiteboardEntryInfo = z13.strictObject({
|
|
3091
|
+
name: NonEmptyString,
|
|
3092
|
+
revision: NonEmptyString,
|
|
3093
|
+
entry: WhiteboardEntryEnvelope.optional(),
|
|
3094
|
+
state: z13.enum(["available", "unavailable", "unsupported-version", "invalid"]),
|
|
3095
|
+
mutable: z13.boolean(),
|
|
3096
|
+
diagnostics: z13.array(z13.string())
|
|
3097
|
+
});
|
|
3098
|
+
var WhiteboardEntryInspection = WhiteboardEntryInfo.extend({
|
|
3099
|
+
value: WhiteboardValue.optional(),
|
|
3100
|
+
text: z13.string(),
|
|
3101
|
+
truncated: z13.boolean()
|
|
3102
|
+
});
|
|
3103
|
+
var WhiteboardTypeInfo = z13.strictObject({
|
|
3104
|
+
typeId: GlobalContributionId,
|
|
3105
|
+
displayName: NonEmptyString,
|
|
3106
|
+
schemaVersion: z13.number().int().positive(),
|
|
3107
|
+
available: z13.boolean(),
|
|
3108
|
+
reference: WhiteboardEntryReference.optional()
|
|
3109
|
+
});
|
|
3110
|
+
|
|
3037
3111
|
// packages/plugin-protocol/dist/where-expression.js
|
|
3038
3112
|
var NUMBER_SOURCE = String.raw`-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?`;
|
|
3039
3113
|
var SEGMENT_SOURCE = "[A-Za-z0-9_][A-Za-z0-9_-]*";
|
|
@@ -3383,22 +3457,22 @@ function createContributionsSchemas(canonical) {
|
|
|
3383
3457
|
const { AuthSchemeReference: AuthSchemeReference2, AuthServiceReference: AuthServiceReference2, CliAuthEnvVarName: CliAuthEnvVarName2, CliBinaryName: CliBinaryName2, FileExtensionToken: FileExtensionToken2, GitBasicAuthUser: GitBasicAuthUser2, GitHostName: GitHostName2, LocalContributionId: LocalContributionId2, MimeTypeString: MimeTypeString2, NonEmptyString: NonEmptyString3, PackageAssetPath: PackageAssetPath2, PluginId: PluginId2, PluginToolName: PluginToolName2, TargetEntrypoint: TargetEntrypoint2, UriScheme: UriScheme2 } = canonical ? canonicalCommonSchemas : common_exports;
|
|
3384
3458
|
const { ScopeRequirement: ScopeRequirement2 } = canonical ? canonicalPermissionSchemas : permissions_exports;
|
|
3385
3459
|
const OptionalDisplayName = NonEmptyString3.optional();
|
|
3386
|
-
const ApprovalCardValueName =
|
|
3387
|
-
const ApprovalCardForm2 =
|
|
3460
|
+
const ApprovalCardValueName = z14.string().regex(/^[A-Za-z][A-Za-z0-9_]{0,63}$/u, "must be a plain field name");
|
|
3461
|
+
const ApprovalCardForm2 = z14.strictObject({
|
|
3388
3462
|
/** Where the write goes: a fixed address, or the card value that names one. */
|
|
3389
|
-
uri:
|
|
3390
|
-
|
|
3391
|
-
|
|
3463
|
+
uri: z14.union([
|
|
3464
|
+
z14.strictObject({ fixed: NonEmptyString3 }),
|
|
3465
|
+
z14.strictObject({ value: ApprovalCardValueName })
|
|
3392
3466
|
]),
|
|
3393
3467
|
/** The delivery request fields this kind of card accepts, beyond provider and account. */
|
|
3394
|
-
requestFields:
|
|
3468
|
+
requestFields: z14.array(ApprovalCardValueName).optional(),
|
|
3395
3469
|
/** Payload field to the card value it is filled from. An absent value or empty list is left out. */
|
|
3396
|
-
payload:
|
|
3470
|
+
payload: z14.record(ApprovalCardValueName, ApprovalCardValueName),
|
|
3397
3471
|
/** Payload fields with a constant value. */
|
|
3398
|
-
fixed:
|
|
3472
|
+
fixed: z14.record(ApprovalCardValueName, z14.union([z14.string(), z14.boolean()])).optional()
|
|
3399
3473
|
});
|
|
3400
3474
|
const ApprovalCardStoredForm2 = ApprovalCardForm2.extend({
|
|
3401
|
-
read:
|
|
3475
|
+
read: z14.strictObject({
|
|
3402
3476
|
revision: ApprovalCardValueName,
|
|
3403
3477
|
body: ApprovalCardValueName,
|
|
3404
3478
|
subject: ApprovalCardValueName.optional(),
|
|
@@ -3409,13 +3483,13 @@ function createContributionsSchemas(canonical) {
|
|
|
3409
3483
|
attachments: ApprovalCardValueName.optional()
|
|
3410
3484
|
})
|
|
3411
3485
|
});
|
|
3412
|
-
const ApprovalCardField =
|
|
3486
|
+
const ApprovalCardField = z14.strictObject({
|
|
3413
3487
|
key: ApprovalCardValueName,
|
|
3414
|
-
max:
|
|
3488
|
+
max: z14.number().int().positive()
|
|
3415
3489
|
});
|
|
3416
|
-
const ApprovalTypeContribution2 =
|
|
3490
|
+
const ApprovalTypeContribution2 = z14.strictObject({
|
|
3417
3491
|
localId: LocalContributionId2,
|
|
3418
|
-
kind:
|
|
3492
|
+
kind: z14.literal("message"),
|
|
3419
3493
|
/** The URI scheme of `uriModule` that cards of this type write to. */
|
|
3420
3494
|
provider: UriScheme2,
|
|
3421
3495
|
/** The local id of this plugin's URI module that handles the write. */
|
|
@@ -3423,82 +3497,82 @@ function createContributionsSchemas(canonical) {
|
|
|
3423
3497
|
/** Shown when a send's outcome cannot be confirmed: where the person checks. */
|
|
3424
3498
|
unknownMessage: NonEmptyString3,
|
|
3425
3499
|
/** The payload fields holding the text a person may edit. A `subject` makes this a mail type. */
|
|
3426
|
-
fields:
|
|
3500
|
+
fields: z14.strictObject({
|
|
3427
3501
|
body: ApprovalCardField,
|
|
3428
3502
|
subject: ApprovalCardField.optional()
|
|
3429
3503
|
}),
|
|
3430
|
-
presentation:
|
|
3431
|
-
showAccount:
|
|
3432
|
-
recipient:
|
|
3504
|
+
presentation: z14.strictObject({
|
|
3505
|
+
showAccount: z14.boolean(),
|
|
3506
|
+
recipient: z14.enum(["person", "target"])
|
|
3433
3507
|
}),
|
|
3434
3508
|
/** One form per kind of card this provider supports. A kind left out is never bound. */
|
|
3435
|
-
forms:
|
|
3509
|
+
forms: z14.strictObject({
|
|
3436
3510
|
inline: ApprovalCardForm2.optional(),
|
|
3437
3511
|
saved: ApprovalCardForm2.optional(),
|
|
3438
3512
|
stored: ApprovalCardStoredForm2.optional()
|
|
3439
3513
|
}),
|
|
3440
3514
|
/** What the card shows beyond its text, read from the delivery request. */
|
|
3441
|
-
display:
|
|
3515
|
+
display: z14.strictObject({
|
|
3442
3516
|
/** How the renderer reads the body. Absent is Markdown, or plain for a stored draft. */
|
|
3443
|
-
bodyFormat:
|
|
3517
|
+
bodyFormat: z14.literal("mrkdwn").optional(),
|
|
3444
3518
|
/** The request field naming what this card replies to. */
|
|
3445
3519
|
replyField: ApprovalCardValueName.optional(),
|
|
3446
3520
|
/** Shown instead of the reply's id when that id means nothing to a person. */
|
|
3447
3521
|
replyLabel: NonEmptyString3.optional(),
|
|
3448
3522
|
/** Further request fields shown as labelled lines. */
|
|
3449
|
-
facts:
|
|
3523
|
+
facts: z14.array(z14.strictObject({
|
|
3450
3524
|
label: NonEmptyString3,
|
|
3451
3525
|
field: ApprovalCardValueName
|
|
3452
3526
|
})).optional()
|
|
3453
3527
|
}).optional()
|
|
3454
3528
|
});
|
|
3455
|
-
const ToolIdentity =
|
|
3529
|
+
const ToolIdentity = z14.strictObject({
|
|
3456
3530
|
localId: LocalContributionId2,
|
|
3457
3531
|
toolName: PluginToolName2,
|
|
3458
3532
|
displayName: OptionalDisplayName,
|
|
3459
3533
|
description: NonEmptyString3.optional()
|
|
3460
3534
|
});
|
|
3461
|
-
const ToolPermission2 =
|
|
3462
|
-
kind:
|
|
3535
|
+
const ToolPermission2 = z14.strictObject({
|
|
3536
|
+
kind: z14.enum(["read", "mutate", "destructive", "execute"]),
|
|
3463
3537
|
ruleKey: NonEmptyString3.optional(),
|
|
3464
3538
|
scheme: NonEmptyString3.optional(),
|
|
3465
|
-
resourcePrefix:
|
|
3539
|
+
resourcePrefix: z14.string().max(256).optional(),
|
|
3466
3540
|
// Arguments whose string values name the resources a call touches.
|
|
3467
|
-
resourceArgs:
|
|
3468
|
-
resourceTrim:
|
|
3469
|
-
defaultPermission:
|
|
3541
|
+
resourceArgs: z14.array(NonEmptyString3).min(1).optional(),
|
|
3542
|
+
resourceTrim: z14.literal(true).optional(),
|
|
3543
|
+
defaultPermission: z14.enum(["allow", "ask", "never"]).optional(),
|
|
3470
3544
|
/** First matching rule wins; every condition in its when list must hold. */
|
|
3471
|
-
classificationRules:
|
|
3472
|
-
when:
|
|
3473
|
-
|
|
3545
|
+
classificationRules: z14.array(z14.strictObject({
|
|
3546
|
+
when: z14.array(z14.union([
|
|
3547
|
+
z14.strictObject({
|
|
3474
3548
|
arg: NonEmptyString3,
|
|
3475
|
-
equals:
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3549
|
+
equals: z14.union([
|
|
3550
|
+
z14.string(),
|
|
3551
|
+
z14.number(),
|
|
3552
|
+
z14.boolean(),
|
|
3553
|
+
z14.null()
|
|
3480
3554
|
])
|
|
3481
3555
|
}),
|
|
3482
|
-
|
|
3556
|
+
z14.strictObject({ arg: NonEmptyString3, present: z14.boolean() })
|
|
3483
3557
|
])).min(1).max(32),
|
|
3484
|
-
kind:
|
|
3558
|
+
kind: z14.enum(["read", "mutate", "destructive", "execute"]),
|
|
3485
3559
|
ruleKey: NonEmptyString3.optional()
|
|
3486
3560
|
})).min(1).max(64).optional()
|
|
3487
3561
|
});
|
|
3488
|
-
const ToolContribution2 =
|
|
3562
|
+
const ToolContribution2 = z14.strictObject({
|
|
3489
3563
|
...ToolIdentity.shape,
|
|
3490
3564
|
parameters: JsonSchema.optional(),
|
|
3491
|
-
executionMode:
|
|
3565
|
+
executionMode: z14.enum(["sequential", "parallel"]).optional(),
|
|
3492
3566
|
promptSnippet: NonEmptyString3.optional(),
|
|
3493
|
-
promptGuidelines:
|
|
3567
|
+
promptGuidelines: z14.array(NonEmptyString3).optional(),
|
|
3494
3568
|
permission: ToolPermission2.optional()
|
|
3495
3569
|
});
|
|
3496
|
-
const AgentToolContribution2 =
|
|
3570
|
+
const AgentToolContribution2 = z14.strictObject({
|
|
3497
3571
|
...ToolContribution2.shape,
|
|
3498
3572
|
parameters: JsonSchema.optional(),
|
|
3499
|
-
executionMode:
|
|
3573
|
+
executionMode: z14.enum(["sequential", "parallel"]).optional(),
|
|
3500
3574
|
promptSnippet: NonEmptyString3.optional(),
|
|
3501
|
-
promptGuidelines:
|
|
3575
|
+
promptGuidelines: z14.array(NonEmptyString3).optional(),
|
|
3502
3576
|
// A local ref names an auth service declared in this manifest; a dotted ref names another
|
|
3503
3577
|
// plugin's service, as `UriModuleContribution.authService` does.
|
|
3504
3578
|
authService: AuthServiceReference2.optional(),
|
|
@@ -3506,17 +3580,17 @@ function createContributionsSchemas(canonical) {
|
|
|
3506
3580
|
authScheme: LocalContributionId2.optional(),
|
|
3507
3581
|
permission: ToolPermission2.optional()
|
|
3508
3582
|
});
|
|
3509
|
-
const ConverterContribution2 =
|
|
3583
|
+
const ConverterContribution2 = z14.strictObject({
|
|
3510
3584
|
localId: LocalContributionId2,
|
|
3511
3585
|
displayName: OptionalDisplayName,
|
|
3512
3586
|
description: NonEmptyString3.optional(),
|
|
3513
3587
|
/** MIME types this converter claims - contract data for introspection and
|
|
3514
3588
|
* collision checks; runtime match behavior stays the converter's `matches()`. */
|
|
3515
|
-
mimeTypes:
|
|
3589
|
+
mimeTypes: z14.array(MimeTypeString2).min(1),
|
|
3516
3590
|
/** Extension fallbacks (no dot) used when a probe has no usable MIME type. */
|
|
3517
|
-
extensions:
|
|
3591
|
+
extensions: z14.array(FileExtensionToken2).min(1).optional()
|
|
3518
3592
|
});
|
|
3519
|
-
const UriOperationName =
|
|
3593
|
+
const UriOperationName = z14.enum([
|
|
3520
3594
|
"help",
|
|
3521
3595
|
"read",
|
|
3522
3596
|
"write",
|
|
@@ -3525,8 +3599,8 @@ function createContributionsSchemas(canonical) {
|
|
|
3525
3599
|
"search",
|
|
3526
3600
|
"delete"
|
|
3527
3601
|
]);
|
|
3528
|
-
const UriPermissionDefault =
|
|
3529
|
-
const UriVerbSentences =
|
|
3602
|
+
const UriPermissionDefault = z14.enum(["allow", "ask", "never"]);
|
|
3603
|
+
const UriVerbSentences = z14.strictObject({
|
|
3530
3604
|
read: NonEmptyString3.exactOptional(),
|
|
3531
3605
|
list: NonEmptyString3.exactOptional(),
|
|
3532
3606
|
search: NonEmptyString3.exactOptional(),
|
|
@@ -3534,83 +3608,83 @@ function createContributionsSchemas(canonical) {
|
|
|
3534
3608
|
edit: NonEmptyString3.exactOptional(),
|
|
3535
3609
|
delete: NonEmptyString3.exactOptional()
|
|
3536
3610
|
});
|
|
3537
|
-
const UriPatternInit =
|
|
3611
|
+
const UriPatternInit = z14.strictObject({
|
|
3538
3612
|
protocol: NonEmptyString3.exactOptional(),
|
|
3539
3613
|
hostname: NonEmptyString3.exactOptional(),
|
|
3540
3614
|
pathname: NonEmptyString3.exactOptional(),
|
|
3541
|
-
search:
|
|
3615
|
+
search: z14.string().exactOptional()
|
|
3542
3616
|
});
|
|
3543
|
-
const UriClaimContribution =
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
kind:
|
|
3617
|
+
const UriClaimContribution = z14.discriminatedUnion("kind", [
|
|
3618
|
+
z14.strictObject({ kind: z14.literal("scheme"), scheme: UriScheme2 }),
|
|
3619
|
+
z14.strictObject({
|
|
3620
|
+
kind: z14.literal("uriPattern"),
|
|
3547
3621
|
pattern: UriPatternInit,
|
|
3548
3622
|
normalizeTo: NonEmptyString3.exactOptional(),
|
|
3549
3623
|
route: LocalContributionId2.exactOptional(),
|
|
3550
3624
|
sourceUrl: NonEmptyString3.exactOptional(),
|
|
3551
3625
|
title: NonEmptyString3.exactOptional(),
|
|
3552
|
-
examples:
|
|
3626
|
+
examples: z14.array(NonEmptyString3).exactOptional()
|
|
3553
3627
|
}),
|
|
3554
|
-
|
|
3555
|
-
kind:
|
|
3628
|
+
z14.strictObject({
|
|
3629
|
+
kind: z14.literal("urlPattern"),
|
|
3556
3630
|
pattern: UriPatternInit,
|
|
3557
3631
|
normalizeTo: NonEmptyString3.exactOptional(),
|
|
3558
3632
|
route: LocalContributionId2.exactOptional(),
|
|
3559
|
-
examples:
|
|
3633
|
+
examples: z14.array(NonEmptyString3).exactOptional()
|
|
3560
3634
|
})
|
|
3561
3635
|
]);
|
|
3562
|
-
const UriTemplateContribution =
|
|
3636
|
+
const UriTemplateContribution = z14.strictObject({
|
|
3563
3637
|
uri: NonEmptyString3,
|
|
3564
3638
|
description: NonEmptyString3,
|
|
3565
|
-
operations:
|
|
3566
|
-
operationDocs:
|
|
3567
|
-
operationDefaults:
|
|
3639
|
+
operations: z14.array(UriOperationName).exactOptional(),
|
|
3640
|
+
operationDocs: z14.partialRecord(UriOperationName, NonEmptyString3).exactOptional(),
|
|
3641
|
+
operationDefaults: z14.partialRecord(UriOperationName, UriPermissionDefault).exactOptional()
|
|
3568
3642
|
});
|
|
3569
3643
|
const UriAuthActionRuleConditions = {
|
|
3570
|
-
operations:
|
|
3571
|
-
routes:
|
|
3572
|
-
query:
|
|
3644
|
+
operations: z14.array(UriOperationName).min(1).exactOptional(),
|
|
3645
|
+
routes: z14.array(LocalContributionId2).min(1).exactOptional(),
|
|
3646
|
+
query: z14.record(NonEmptyString3, z14.string()).exactOptional()
|
|
3573
3647
|
};
|
|
3574
|
-
const UriAuthActionRule =
|
|
3575
|
-
|
|
3576
|
-
|
|
3648
|
+
const UriAuthActionRule = z14.union([
|
|
3649
|
+
z14.strictObject({ ...UriAuthActionRuleConditions, action: NonEmptyString3 }),
|
|
3650
|
+
z14.strictObject({ ...UriAuthActionRuleConditions, public: z14.literal(true) })
|
|
3577
3651
|
]);
|
|
3578
|
-
const UriAgentHintContribution =
|
|
3652
|
+
const UriAgentHintContribution = z14.strictObject({
|
|
3579
3653
|
summary: NonEmptyString3,
|
|
3580
|
-
commonFlows:
|
|
3654
|
+
commonFlows: z14.array(z14.strictObject({
|
|
3581
3655
|
label: NonEmptyString3,
|
|
3582
3656
|
when: NonEmptyString3.exactOptional(),
|
|
3583
3657
|
example: NonEmptyString3
|
|
3584
3658
|
})).exactOptional(),
|
|
3585
3659
|
helpUri: NonEmptyString3.exactOptional(),
|
|
3586
|
-
triggers:
|
|
3587
|
-
keywords:
|
|
3588
|
-
patterns:
|
|
3660
|
+
triggers: z14.strictObject({
|
|
3661
|
+
keywords: z14.array(NonEmptyString3).exactOptional(),
|
|
3662
|
+
patterns: z14.array(NonEmptyString3).exactOptional()
|
|
3589
3663
|
}).exactOptional(),
|
|
3590
|
-
skills:
|
|
3664
|
+
skills: z14.array(NonEmptyString3).exactOptional()
|
|
3591
3665
|
});
|
|
3592
|
-
const ScreenActionOption =
|
|
3593
|
-
|
|
3594
|
-
kind:
|
|
3666
|
+
const ScreenActionOption = z14.discriminatedUnion("kind", [
|
|
3667
|
+
z14.strictObject({
|
|
3668
|
+
kind: z14.literal("exact"),
|
|
3595
3669
|
description: NonEmptyString3,
|
|
3596
|
-
verb:
|
|
3670
|
+
verb: z14.enum(["read", "write", "edit", "delete"]),
|
|
3597
3671
|
uri: NonEmptyString3
|
|
3598
3672
|
}),
|
|
3599
|
-
|
|
3600
|
-
kind:
|
|
3673
|
+
z14.strictObject({
|
|
3674
|
+
kind: z14.literal("catch-all"),
|
|
3601
3675
|
description: NonEmptyString3,
|
|
3602
|
-
verb:
|
|
3676
|
+
verb: z14.enum(["read", "write", "edit", "delete"])
|
|
3603
3677
|
})
|
|
3604
3678
|
]);
|
|
3605
3679
|
const UriModuleFactsShape = {
|
|
3606
|
-
revisionBacked:
|
|
3607
|
-
mailCalibrationSource:
|
|
3608
|
-
screenActions:
|
|
3680
|
+
revisionBacked: z14.literal(true).optional(),
|
|
3681
|
+
mailCalibrationSource: z14.literal(true).optional(),
|
|
3682
|
+
screenActions: z14.strictObject({
|
|
3609
3683
|
scheme: UriScheme2,
|
|
3610
|
-
hosts:
|
|
3611
|
-
paths:
|
|
3612
|
-
apps:
|
|
3613
|
-
options:
|
|
3684
|
+
hosts: z14.array(NonEmptyString3),
|
|
3685
|
+
paths: z14.array(NonEmptyString3).min(1).optional(),
|
|
3686
|
+
apps: z14.array(NonEmptyString3),
|
|
3687
|
+
options: z14.record(NonEmptyString3, ScreenActionOption)
|
|
3614
3688
|
}).superRefine((catalog, ctx) => {
|
|
3615
3689
|
if (catalog.hosts.length === 0 && catalog.apps.length === 0) {
|
|
3616
3690
|
ctx.addIssue({
|
|
@@ -3635,29 +3709,29 @@ function createContributionsSchemas(canonical) {
|
|
|
3635
3709
|
}
|
|
3636
3710
|
}).exactOptional(),
|
|
3637
3711
|
/** Addresses the module answers, in match order; see `@herd/uri`'s `UriClaim`. */
|
|
3638
|
-
claims:
|
|
3712
|
+
claims: z14.array(UriClaimContribution).min(1).exactOptional(),
|
|
3639
3713
|
/** The module's routes, as its scheme-root `help` lists them. */
|
|
3640
|
-
templates:
|
|
3641
|
-
verbs:
|
|
3642
|
-
readable:
|
|
3643
|
-
writable:
|
|
3644
|
-
editable:
|
|
3645
|
-
deletable:
|
|
3646
|
-
listable:
|
|
3714
|
+
templates: z14.array(UriTemplateContribution).exactOptional(),
|
|
3715
|
+
verbs: z14.strictObject({
|
|
3716
|
+
readable: z14.boolean(),
|
|
3717
|
+
writable: z14.boolean(),
|
|
3718
|
+
editable: z14.boolean(),
|
|
3719
|
+
deletable: z14.boolean().exactOptional(),
|
|
3720
|
+
listable: z14.boolean(),
|
|
3647
3721
|
/** The module answers `search`. */
|
|
3648
|
-
searchable:
|
|
3722
|
+
searchable: z14.boolean().exactOptional()
|
|
3649
3723
|
}).exactOptional(),
|
|
3650
3724
|
verbDocs: UriVerbSentences.exactOptional(),
|
|
3651
|
-
permissionDefaults:
|
|
3725
|
+
permissionDefaults: z14.strictObject({
|
|
3652
3726
|
read: UriPermissionDefault.exactOptional(),
|
|
3653
3727
|
write: UriPermissionDefault.exactOptional(),
|
|
3654
3728
|
edit: UriPermissionDefault.exactOptional(),
|
|
3655
3729
|
delete: UriPermissionDefault.exactOptional()
|
|
3656
3730
|
}).exactOptional(),
|
|
3657
3731
|
/** Which sign-in action each call needs: the action table and the rules that pick one. */
|
|
3658
|
-
authActions:
|
|
3659
|
-
actions:
|
|
3660
|
-
rules:
|
|
3732
|
+
authActions: z14.strictObject({
|
|
3733
|
+
actions: z14.record(NonEmptyString3, ScopeRequirement2),
|
|
3734
|
+
rules: z14.array(UriAuthActionRule).min(1)
|
|
3661
3735
|
}).superRefine((policy, ctx) => {
|
|
3662
3736
|
policy.rules.forEach((rule, index) => {
|
|
3663
3737
|
if ("action" in rule && !(rule.action in policy.actions)) {
|
|
@@ -3669,18 +3743,18 @@ function createContributionsSchemas(canonical) {
|
|
|
3669
3743
|
}
|
|
3670
3744
|
});
|
|
3671
3745
|
}).exactOptional(),
|
|
3672
|
-
requiresConnection:
|
|
3673
|
-
acceptsSourceCopy:
|
|
3674
|
-
acceptsWriteSources:
|
|
3675
|
-
acceptsBytes:
|
|
3676
|
-
ownsLineSelectors:
|
|
3746
|
+
requiresConnection: z14.literal(true).exactOptional(),
|
|
3747
|
+
acceptsSourceCopy: z14.literal(false).exactOptional(),
|
|
3748
|
+
acceptsWriteSources: z14.literal(true).exactOptional(),
|
|
3749
|
+
acceptsBytes: z14.literal(true).exactOptional(),
|
|
3750
|
+
ownsLineSelectors: z14.literal(true).exactOptional(),
|
|
3677
3751
|
description: NonEmptyString3.exactOptional(),
|
|
3678
3752
|
agentHint: UriAgentHintContribution.exactOptional()
|
|
3679
3753
|
};
|
|
3680
|
-
const UriModuleFacts2 =
|
|
3681
|
-
const UriModuleContribution2 =
|
|
3754
|
+
const UriModuleFacts2 = z14.strictObject(UriModuleFactsShape);
|
|
3755
|
+
const UriModuleContribution2 = z14.strictObject({
|
|
3682
3756
|
localId: LocalContributionId2,
|
|
3683
|
-
schemes:
|
|
3757
|
+
schemes: z14.array(UriScheme2).min(1),
|
|
3684
3758
|
displayName: OptionalDisplayName,
|
|
3685
3759
|
...UriModuleFactsShape,
|
|
3686
3760
|
// A local ref (no dot) must name an auth service declared in this same
|
|
@@ -3703,15 +3777,15 @@ function createContributionsSchemas(canonical) {
|
|
|
3703
3777
|
// `knownResources` permission grant (`api.knownResources`). Present-means-on
|
|
3704
3778
|
// (`true` or absent; `false` is not a state). Decision record:
|
|
3705
3779
|
// `lab/user-plugins/decisions/014-known-resources-ledger.md`.
|
|
3706
|
-
knownResources:
|
|
3780
|
+
knownResources: z14.literal(true).optional(),
|
|
3707
3781
|
// The module's code defines `describeOperation`, the approval card's facts for a call. The
|
|
3708
3782
|
// daemon reads it here because it may hold only the manifest (a plugin that runs in the
|
|
3709
3783
|
// plugin host), and the host refuses a module whose code disagrees.
|
|
3710
|
-
describesOperations:
|
|
3784
|
+
describesOperations: z14.literal(true).optional(),
|
|
3711
3785
|
// The module's code defines `lookupWebLink`, which finds a resource's page when someone opens
|
|
3712
3786
|
// it. The daemon reads it here for the same reason, and the host refuses a module whose code
|
|
3713
3787
|
// disagrees.
|
|
3714
|
-
looksUpWebLinks:
|
|
3788
|
+
looksUpWebLinks: z14.literal(true).optional()
|
|
3715
3789
|
});
|
|
3716
3790
|
const AppUriModuleContribution2 = UriModuleContribution2.omit({
|
|
3717
3791
|
authActions: true,
|
|
@@ -3721,35 +3795,36 @@ function createContributionsSchemas(canonical) {
|
|
|
3721
3795
|
describesOperations: true,
|
|
3722
3796
|
looksUpWebLinks: true
|
|
3723
3797
|
});
|
|
3724
|
-
const AppDataSourceStore =
|
|
3725
|
-
|
|
3726
|
-
shape:
|
|
3798
|
+
const AppDataSourceStore = z14.discriminatedUnion("shape", [
|
|
3799
|
+
z14.strictObject({
|
|
3800
|
+
shape: z14.literal("rows"),
|
|
3727
3801
|
rowsField: NonEmptyString3,
|
|
3728
|
-
key:
|
|
3802
|
+
key: z14.array(NonEmptyString3).min(1)
|
|
3729
3803
|
}),
|
|
3730
|
-
|
|
3804
|
+
z14.strictObject({ shape: z14.literal("value") })
|
|
3731
3805
|
]);
|
|
3732
|
-
const AppDataSourceContribution2 =
|
|
3806
|
+
const AppDataSourceContribution2 = z14.strictObject({
|
|
3733
3807
|
localId: LocalContributionId2,
|
|
3734
|
-
scope:
|
|
3735
|
-
snapshot:
|
|
3736
|
-
version:
|
|
3808
|
+
scope: z14.enum(["runtime", "account", "session"]),
|
|
3809
|
+
snapshot: z14.strictObject({
|
|
3810
|
+
version: z14.number().int().positive(),
|
|
3737
3811
|
schema: JsonSchema
|
|
3738
3812
|
}),
|
|
3739
|
-
change:
|
|
3740
|
-
version:
|
|
3813
|
+
change: z14.strictObject({
|
|
3814
|
+
version: z14.number().int().positive(),
|
|
3741
3815
|
schema: JsonSchema,
|
|
3742
3816
|
/** Review-only claim; source schemas and behavioral tests enforce it because the daemon treats changes as opaque. */
|
|
3743
|
-
semantics:
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
kind:
|
|
3747
|
-
maxEncodedBytes:
|
|
3817
|
+
semantics: z14.discriminatedUnion("kind", [
|
|
3818
|
+
z14.strictObject({ kind: z14.literal("incremental") }),
|
|
3819
|
+
z14.strictObject({
|
|
3820
|
+
kind: z14.literal("snapshot-replacement"),
|
|
3821
|
+
maxEncodedBytes: z14.number().int().positive(),
|
|
3748
3822
|
rationale: pluginString(canonical).min(1).max(1024)
|
|
3749
3823
|
})
|
|
3750
3824
|
]).optional()
|
|
3751
3825
|
}),
|
|
3752
3826
|
read: AppDataSourceRead.optional(),
|
|
3827
|
+
messageDraft: z14.strictObject({ schemes: z14.array(UriScheme2).min(1) }).optional(),
|
|
3753
3828
|
store: AppDataSourceStore.optional()
|
|
3754
3829
|
}).superRefine((source, ctx) => {
|
|
3755
3830
|
if (source.read !== void 0 && source.scope !== "session") {
|
|
@@ -3759,6 +3834,13 @@ function createContributionsSchemas(canonical) {
|
|
|
3759
3834
|
message: "App-data read operations require session scope."
|
|
3760
3835
|
});
|
|
3761
3836
|
}
|
|
3837
|
+
if (source.messageDraft !== void 0 && source.read === void 0) {
|
|
3838
|
+
ctx.addIssue({
|
|
3839
|
+
code: "custom",
|
|
3840
|
+
path: ["messageDraft"],
|
|
3841
|
+
message: "Message draft projections require a session read operation."
|
|
3842
|
+
});
|
|
3843
|
+
}
|
|
3762
3844
|
if (source.store === void 0)
|
|
3763
3845
|
return;
|
|
3764
3846
|
const replaces = source.change.semantics?.kind === "snapshot-replacement";
|
|
@@ -3770,25 +3852,36 @@ function createContributionsSchemas(canonical) {
|
|
|
3770
3852
|
});
|
|
3771
3853
|
}
|
|
3772
3854
|
});
|
|
3773
|
-
const WhiteboardTypeStorage2 =
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
kind:
|
|
3855
|
+
const WhiteboardTypeStorage2 = z14.discriminatedUnion("kind", [
|
|
3856
|
+
z14.strictObject({ kind: z14.literal("json") }),
|
|
3857
|
+
z14.strictObject({ kind: z14.literal("payload") }),
|
|
3858
|
+
z14.strictObject({
|
|
3859
|
+
kind: z14.literal("markdown"),
|
|
3778
3860
|
bodyField: NonEmptyString3
|
|
3779
3861
|
})
|
|
3780
3862
|
]);
|
|
3781
|
-
const WhiteboardTypeContribution2 =
|
|
3863
|
+
const WhiteboardTypeContribution2 = z14.strictObject({
|
|
3782
3864
|
localId: LocalContributionId2,
|
|
3783
3865
|
displayName: NonEmptyString3,
|
|
3784
|
-
schemaVersion:
|
|
3866
|
+
schemaVersion: z14.number().int().positive(),
|
|
3785
3867
|
storage: WhiteboardTypeStorage2,
|
|
3786
|
-
valueSchema: JsonSchema
|
|
3868
|
+
valueSchema: JsonSchema,
|
|
3869
|
+
directory: z14.array(z14.string().regex(/^[A-Za-z0-9][A-Za-z0-9_-]*$/u)).min(1).optional(),
|
|
3870
|
+
reference: WhiteboardEntryReference.optional(),
|
|
3871
|
+
handover: z14.literal(true).optional()
|
|
3872
|
+
}).superRefine((type, ctx) => {
|
|
3873
|
+
if (type.handover === true && type.storage.kind !== "markdown") {
|
|
3874
|
+
ctx.addIssue({
|
|
3875
|
+
code: "custom",
|
|
3876
|
+
path: ["handover"],
|
|
3877
|
+
message: "Handover content requires Markdown storage."
|
|
3878
|
+
});
|
|
3879
|
+
}
|
|
3787
3880
|
});
|
|
3788
|
-
const AppDataMaterializerContribution2 =
|
|
3881
|
+
const AppDataMaterializerContribution2 = z14.strictObject({
|
|
3789
3882
|
source: LocalContributionId2
|
|
3790
3883
|
});
|
|
3791
|
-
const ArtifactUriModuleContribution2 =
|
|
3884
|
+
const ArtifactUriModuleContribution2 = z14.strictObject({
|
|
3792
3885
|
localId: LocalContributionId2,
|
|
3793
3886
|
/** The single `scheme://` this module owns; also the on-disk artifact kind. */
|
|
3794
3887
|
scheme: UriScheme2,
|
|
@@ -3802,17 +3895,17 @@ function createContributionsSchemas(canonical) {
|
|
|
3802
3895
|
* composes its description from the plugin's own display name + scheme - a per-scheme label
|
|
3803
3896
|
* would have no path to matter, so it is intentionally omitted rather than accepted-and-ignored.
|
|
3804
3897
|
*/
|
|
3805
|
-
editable:
|
|
3898
|
+
editable: z14.boolean().optional(),
|
|
3806
3899
|
/** Opt in to `list` over the kind's stored names. Default false. Mirrors
|
|
3807
3900
|
* `CreateArtifactUriModuleOptions.listable`. */
|
|
3808
|
-
listable:
|
|
3901
|
+
listable: z14.boolean().optional(),
|
|
3809
3902
|
/**
|
|
3810
3903
|
* Opt in to `delete` for same-session entries. Default false. Deletion
|
|
3811
3904
|
* unlinks the stored file - no trash tier; a kind that wants recoverable
|
|
3812
3905
|
* deletion is not artifact-backed. Mirrors
|
|
3813
3906
|
* `CreateArtifactUriModuleOptions.deletable`.
|
|
3814
3907
|
*/
|
|
3815
|
-
deletable:
|
|
3908
|
+
deletable: z14.boolean().optional(),
|
|
3816
3909
|
/**
|
|
3817
3910
|
* Opt in to the `{ content, mode: "append" }` write envelope, which extends
|
|
3818
3911
|
* stored text instead of replacing it (concurrent-appender-safe: the host
|
|
@@ -3820,7 +3913,7 @@ function createContributionsSchemas(canonical) {
|
|
|
3820
3913
|
* keep their verbatim round-trip. Mirrors
|
|
3821
3914
|
* `CreateArtifactUriModuleOptions.appendable`.
|
|
3822
3915
|
*/
|
|
3823
|
-
appendable:
|
|
3916
|
+
appendable: z14.boolean().optional(),
|
|
3824
3917
|
/**
|
|
3825
3918
|
* Which sessions share one storage namespace. Default `"session"` - the existing
|
|
3826
3919
|
* per-session behavior (each session gets its own kind directory; other sessions'
|
|
@@ -3831,14 +3924,14 @@ function createContributionsSchemas(canonical) {
|
|
|
3831
3924
|
* the scope; the host derives the family root from provenance it already holds, so
|
|
3832
3925
|
* family identity never crosses the SDK boundary.
|
|
3833
3926
|
*/
|
|
3834
|
-
storageScope:
|
|
3927
|
+
storageScope: z14.enum(["session", "family"]).optional()
|
|
3835
3928
|
});
|
|
3836
|
-
const CliBindingContribution2 =
|
|
3929
|
+
const CliBindingContribution2 = z14.strictObject({
|
|
3837
3930
|
localId: LocalContributionId2,
|
|
3838
3931
|
binary: CliBinaryName2,
|
|
3839
|
-
aliases:
|
|
3932
|
+
aliases: z14.array(CliBinaryName2).optional(),
|
|
3840
3933
|
/** Where the binary comes from. Omitted => `"vendored"` (decision 007). */
|
|
3841
|
-
provider:
|
|
3934
|
+
provider: z14.enum(["vendored", "path"]).optional(),
|
|
3842
3935
|
// A local ref (no dot) must name an auth service declared in this same
|
|
3843
3936
|
// manifest; a qualified ref (dotted, e.g. `google.account`) names another
|
|
3844
3937
|
// plugin's already-minted global id and is recorded, not resolved, here (see
|
|
@@ -3851,20 +3944,20 @@ function createContributionsSchemas(canonical) {
|
|
|
3851
3944
|
* MUST be absent for a `path` binding, which can never receive a token.
|
|
3852
3945
|
*/
|
|
3853
3946
|
authEnvVar: CliAuthEnvVarName2.optional(),
|
|
3854
|
-
readOnly:
|
|
3855
|
-
write:
|
|
3947
|
+
readOnly: z14.array(NonEmptyString3),
|
|
3948
|
+
write: z14.array(NonEmptyString3)
|
|
3856
3949
|
});
|
|
3857
|
-
const GitHostContribution2 =
|
|
3950
|
+
const GitHostContribution2 = z14.strictObject({
|
|
3858
3951
|
host: GitHostName2,
|
|
3859
3952
|
authService: LocalContributionId2,
|
|
3860
3953
|
basicAuthUser: GitBasicAuthUser2
|
|
3861
3954
|
});
|
|
3862
|
-
const ResourceContribution2 =
|
|
3955
|
+
const ResourceContribution2 = z14.strictObject({
|
|
3863
3956
|
localId: LocalContributionId2,
|
|
3864
3957
|
displayName: OptionalDisplayName,
|
|
3865
3958
|
description: NonEmptyString3.optional()
|
|
3866
3959
|
});
|
|
3867
|
-
const SkillContribution2 =
|
|
3960
|
+
const SkillContribution2 = z14.strictObject({
|
|
3868
3961
|
localId: LocalContributionId2,
|
|
3869
3962
|
displayName: OptionalDisplayName,
|
|
3870
3963
|
/** Model-visible one-liner: when to reach for this skill. */
|
|
@@ -3872,18 +3965,18 @@ function createContributionsSchemas(canonical) {
|
|
|
3872
3965
|
/** The SKILL.md-style file inside the package carrying the full instructions. */
|
|
3873
3966
|
path: PackageAssetPath2
|
|
3874
3967
|
});
|
|
3875
|
-
const PluginSkillSourceDeclaration2 =
|
|
3876
|
-
|
|
3877
|
-
channel:
|
|
3968
|
+
const PluginSkillSourceDeclaration2 = z14.discriminatedUnion("channel", [
|
|
3969
|
+
z14.strictObject({
|
|
3970
|
+
channel: z14.literal("installer"),
|
|
3878
3971
|
localId: LocalContributionId2,
|
|
3879
3972
|
displayName: OptionalDisplayName,
|
|
3880
3973
|
/** The package-runner executable, e.g. `npx` - checked against the daemon's allowlist. */
|
|
3881
3974
|
command: NonEmptyString3,
|
|
3882
3975
|
/** Its argv, e.g. `["skills", "add", "clerk/skills"]`. */
|
|
3883
|
-
args:
|
|
3976
|
+
args: z14.array(NonEmptyString3)
|
|
3884
3977
|
}),
|
|
3885
|
-
|
|
3886
|
-
channel:
|
|
3978
|
+
z14.strictObject({
|
|
3979
|
+
channel: z14.literal("git-clone"),
|
|
3887
3980
|
localId: LocalContributionId2,
|
|
3888
3981
|
displayName: OptionalDisplayName,
|
|
3889
3982
|
/** The repository locator - canonicalized and hygiene-checked by the daemon. */
|
|
@@ -3894,17 +3987,17 @@ function createContributionsSchemas(canonical) {
|
|
|
3894
3987
|
subdir: NonEmptyString3.optional()
|
|
3895
3988
|
})
|
|
3896
3989
|
]);
|
|
3897
|
-
const SearchProviderContribution2 =
|
|
3990
|
+
const SearchProviderContribution2 = z14.strictObject({
|
|
3898
3991
|
localId: LocalContributionId2,
|
|
3899
3992
|
displayName: OptionalDisplayName,
|
|
3900
|
-
schemes:
|
|
3993
|
+
schemes: z14.array(UriScheme2).optional()
|
|
3901
3994
|
});
|
|
3902
|
-
const InteractionDriverContribution2 =
|
|
3995
|
+
const InteractionDriverContribution2 = z14.strictObject({
|
|
3903
3996
|
localId: LocalContributionId2,
|
|
3904
3997
|
displayName: OptionalDisplayName,
|
|
3905
|
-
kind:
|
|
3998
|
+
kind: z14.enum(["browser", "computer-use"])
|
|
3906
3999
|
});
|
|
3907
|
-
const EntityResolverContribution2 =
|
|
4000
|
+
const EntityResolverContribution2 = z14.strictObject({
|
|
3908
4001
|
localId: LocalContributionId2,
|
|
3909
4002
|
displayName: OptionalDisplayName,
|
|
3910
4003
|
/** The `kay.agent` URI module (this manifest's own `contributes.uriModules[].localId`) whose
|
|
@@ -3912,17 +4005,17 @@ function createContributionsSchemas(canonical) {
|
|
|
3912
4005
|
uriModule: LocalContributionId2,
|
|
3913
4006
|
/** `person` | `channel` | `repo` | `pull-request` | ... -- drives avatar-first vs glyph-first row
|
|
3914
4007
|
* anatomy (N10-R2) and lets the renderer request a narrower `entityTypes` filter. */
|
|
3915
|
-
entityTypes:
|
|
4008
|
+
entityTypes: z14.array(NonEmptyString3).min(1),
|
|
3916
4009
|
/** The URI namespace/route `search()` is called against, e.g. `slack://directory` or
|
|
3917
4010
|
* `github://search/repositories` -- the resolver's fixed search scope; the live user query is
|
|
3918
4011
|
* the `search()` call's `query` param, never concatenated into this string. */
|
|
3919
4012
|
uriHint: NonEmptyString3
|
|
3920
4013
|
});
|
|
3921
|
-
const AgentRenderContribution2 =
|
|
4014
|
+
const AgentRenderContribution2 = z14.strictObject({
|
|
3922
4015
|
localId: LocalContributionId2,
|
|
3923
|
-
resultKinds:
|
|
4016
|
+
resultKinds: z14.array(NonEmptyString3).min(1)
|
|
3924
4017
|
});
|
|
3925
|
-
const PluginCardContribution2 =
|
|
4018
|
+
const PluginCardContribution2 = z14.strictObject({
|
|
3926
4019
|
localId: LocalContributionId2,
|
|
3927
4020
|
description: NonEmptyString3,
|
|
3928
4021
|
inputs: JsonSchema,
|
|
@@ -3930,26 +4023,26 @@ function createContributionsSchemas(canonical) {
|
|
|
3930
4023
|
submitEndpoint: LocalContributionId2,
|
|
3931
4024
|
authService: AuthServiceReference2.optional()
|
|
3932
4025
|
});
|
|
3933
|
-
const EndpointContribution2 =
|
|
4026
|
+
const EndpointContribution2 = z14.strictObject({
|
|
3934
4027
|
localId: LocalContributionId2,
|
|
3935
4028
|
displayName: OptionalDisplayName,
|
|
3936
4029
|
requestSchema: JsonSchema.optional(),
|
|
3937
4030
|
responseSchema: JsonSchema.optional(),
|
|
3938
|
-
auth:
|
|
4031
|
+
auth: z14.strictObject({
|
|
3939
4032
|
service: AuthServiceReference2,
|
|
3940
|
-
schemes:
|
|
4033
|
+
schemes: z14.array(AuthSchemeReference2).min(1),
|
|
3941
4034
|
purpose: NonEmptyString3
|
|
3942
4035
|
}).optional(),
|
|
3943
|
-
timeoutMs:
|
|
4036
|
+
timeoutMs: z14.number().int().positive().optional()
|
|
3944
4037
|
});
|
|
3945
|
-
const WorkflowContribution2 =
|
|
4038
|
+
const WorkflowContribution2 = z14.strictObject({
|
|
3946
4039
|
localId: LocalContributionId2,
|
|
3947
4040
|
name: NonEmptyString3,
|
|
3948
4041
|
/** Plain-text purpose, at most 280 characters. */
|
|
3949
4042
|
description: NonEmptyString3,
|
|
3950
4043
|
/** How often it runs. The automations engine enforces its scheduling floor. */
|
|
3951
|
-
everyMs:
|
|
3952
|
-
auth:
|
|
4044
|
+
everyMs: z14.number().int().positive(),
|
|
4045
|
+
auth: z14.strictObject({
|
|
3953
4046
|
/** A local ref names a service in this manifest; a dotted ref names another plugin's. */
|
|
3954
4047
|
service: AuthServiceReference2,
|
|
3955
4048
|
scheme: AuthSchemeReference2,
|
|
@@ -3957,7 +4050,7 @@ function createContributionsSchemas(canonical) {
|
|
|
3957
4050
|
* Scopes each account's token must hold. Omitted, the host asks for the first scope of the
|
|
3958
4051
|
* `background-job` grant's `allowedScopes` that the account holds.
|
|
3959
4052
|
*/
|
|
3960
|
-
scopes:
|
|
4053
|
+
scopes: z14.array(NonEmptyString3).min(1).optional()
|
|
3961
4054
|
}).optional()
|
|
3962
4055
|
});
|
|
3963
4056
|
const McpServerUrl2 = pluginString(canonical).min(1).refine((value) => {
|
|
@@ -3973,8 +4066,8 @@ function createContributionsSchemas(canonical) {
|
|
|
3973
4066
|
}, {
|
|
3974
4067
|
message: "mcp server url must be https://, or http:// only for localhost/127.0.0.1 test servers"
|
|
3975
4068
|
});
|
|
3976
|
-
const McpServerAuthMode2 =
|
|
3977
|
-
const McpServerContribution2 =
|
|
4069
|
+
const McpServerAuthMode2 = z14.enum(["oauth", "api-key", "none"]);
|
|
4070
|
+
const McpServerContribution2 = z14.strictObject({
|
|
3978
4071
|
url: McpServerUrl2,
|
|
3979
4072
|
auth: McpServerAuthMode2.optional(),
|
|
3980
4073
|
authService: LocalContributionId2.optional()
|
|
@@ -3987,24 +4080,24 @@ function createContributionsSchemas(canonical) {
|
|
|
3987
4080
|
});
|
|
3988
4081
|
}
|
|
3989
4082
|
});
|
|
3990
|
-
const McpServerContributions2 =
|
|
3991
|
-
const AppEventSubscription2 =
|
|
4083
|
+
const McpServerContributions2 = z14.record(LocalContributionId2, McpServerContribution2);
|
|
4084
|
+
const AppEventSubscription2 = z14.strictObject({
|
|
3992
4085
|
localId: LocalContributionId2,
|
|
3993
4086
|
event: NonEmptyString3
|
|
3994
4087
|
});
|
|
3995
|
-
const ContextContributorContribution2 =
|
|
4088
|
+
const ContextContributorContribution2 = z14.strictObject({
|
|
3996
4089
|
localId: LocalContributionId2.max(64),
|
|
3997
4090
|
displayName: OptionalDisplayName,
|
|
3998
4091
|
description: NonEmptyString3.optional()
|
|
3999
4092
|
});
|
|
4000
|
-
const EventDefinitionVersion =
|
|
4001
|
-
const PluginEventDefinitionContribution2 =
|
|
4093
|
+
const EventDefinitionVersion = z14.number().int().positive();
|
|
4094
|
+
const PluginEventDefinitionContribution2 = z14.strictObject({
|
|
4002
4095
|
localId: PluginEventLocalId2,
|
|
4003
4096
|
displayName: OptionalDisplayName,
|
|
4004
4097
|
description: NonEmptyString3.optional(),
|
|
4005
4098
|
version: canonical ? EventDefinitionVersion : EventDefinitionVersion.default(1),
|
|
4006
4099
|
uriScheme: UriScheme2,
|
|
4007
|
-
relatedKeys:
|
|
4100
|
+
relatedKeys: z14.array(NonEmptyString3).readonly().optional(),
|
|
4008
4101
|
payloadSchema: JsonSchema.optional(),
|
|
4009
4102
|
/**
|
|
4010
4103
|
* This event is a signal: its payload is the shared `PluginSignal` v1 and every publish
|
|
@@ -4013,7 +4106,7 @@ function createContributionsSchemas(canonical) {
|
|
|
4013
4106
|
* and `relatedKeys` holds `thread` plus any of `from`, `to`, `cc`. Turning it on changes
|
|
4014
4107
|
* the payload, so bump `version` with it.
|
|
4015
4108
|
*/
|
|
4016
|
-
signal:
|
|
4109
|
+
signal: z14.boolean().optional()
|
|
4017
4110
|
}).superRefine((definition, context) => {
|
|
4018
4111
|
if (definition.signal !== true)
|
|
4019
4112
|
return;
|
|
@@ -4034,42 +4127,42 @@ function createContributionsSchemas(canonical) {
|
|
|
4034
4127
|
});
|
|
4035
4128
|
}
|
|
4036
4129
|
});
|
|
4037
|
-
const PluginNotificationRuleContribution2 =
|
|
4130
|
+
const PluginNotificationRuleContribution2 = z14.strictObject({
|
|
4038
4131
|
localId: LocalContributionId2,
|
|
4039
4132
|
/** The same-plugin `eventDefinitions` local id this rule matches. */
|
|
4040
4133
|
event: PluginEventLocalId2,
|
|
4041
|
-
where:
|
|
4134
|
+
where: z14.string({ error: (issue) => whereNotAStringMessage(issue.input) }).optional(),
|
|
4042
4135
|
rule: JsonObject
|
|
4043
4136
|
});
|
|
4044
|
-
const PluginProductEventContribution2 =
|
|
4045
|
-
|
|
4137
|
+
const PluginProductEventContribution2 = z14.union([
|
|
4138
|
+
z14.strictObject({
|
|
4046
4139
|
name: NonEmptyString3,
|
|
4047
4140
|
description: NonEmptyString3.optional(),
|
|
4048
|
-
fields:
|
|
4141
|
+
fields: z14.record(z14.string(), JsonObject).optional()
|
|
4049
4142
|
}),
|
|
4050
|
-
|
|
4143
|
+
z14.strictObject({ catalogEvent: NonEmptyString3 })
|
|
4051
4144
|
]);
|
|
4052
|
-
const UiEventSubscriptionContribution2 =
|
|
4145
|
+
const UiEventSubscriptionContribution2 = z14.strictObject({
|
|
4053
4146
|
localId: LocalContributionId2,
|
|
4054
4147
|
event: NonEmptyString3
|
|
4055
4148
|
});
|
|
4056
|
-
const DeviceDelegationContribution2 =
|
|
4149
|
+
const DeviceDelegationContribution2 = z14.strictObject({
|
|
4057
4150
|
localId: LocalContributionId2,
|
|
4058
|
-
device:
|
|
4059
|
-
delegateAs:
|
|
4151
|
+
device: z14.enum(["microphone"]),
|
|
4152
|
+
delegateAs: z14.enum(["clip", "stream", "status"])
|
|
4060
4153
|
});
|
|
4061
|
-
const CorpusAccess =
|
|
4062
|
-
const SessionReaderContribution2 =
|
|
4154
|
+
const CorpusAccess = z14.enum(["read"]);
|
|
4155
|
+
const SessionReaderContribution2 = z14.strictObject({
|
|
4063
4156
|
localId: LocalContributionId2,
|
|
4064
4157
|
displayName: OptionalDisplayName,
|
|
4065
4158
|
access: canonical ? CorpusAccess : CorpusAccess.default("read")
|
|
4066
4159
|
});
|
|
4067
|
-
const UiCommandContribution2 =
|
|
4160
|
+
const UiCommandContribution2 = z14.strictObject({
|
|
4068
4161
|
localId: LocalContributionId2,
|
|
4069
4162
|
title: NonEmptyString3,
|
|
4070
4163
|
icon: PackageAssetPath2.optional(),
|
|
4071
|
-
button:
|
|
4072
|
-
menu:
|
|
4164
|
+
button: z14.enum(["tabStrip"]).optional(),
|
|
4165
|
+
menu: z14.enum(["help"]).optional(),
|
|
4073
4166
|
where: NonEmptyString3.optional()
|
|
4074
4167
|
}).superRefine((command, ctx) => {
|
|
4075
4168
|
if (command.where === void 0)
|
|
@@ -4090,7 +4183,7 @@ function createContributionsSchemas(canonical) {
|
|
|
4090
4183
|
});
|
|
4091
4184
|
}
|
|
4092
4185
|
});
|
|
4093
|
-
const UiSlotContribution2 =
|
|
4186
|
+
const UiSlotContribution2 = z14.strictObject({
|
|
4094
4187
|
localId: LocalContributionId2,
|
|
4095
4188
|
slot: NonEmptyString3,
|
|
4096
4189
|
title: NonEmptyString3.optional()
|
|
@@ -4104,84 +4197,86 @@ function createContributionsSchemas(canonical) {
|
|
|
4104
4197
|
"blob",
|
|
4105
4198
|
"about"
|
|
4106
4199
|
]);
|
|
4107
|
-
const ReferenceOpenBehavior2 =
|
|
4108
|
-
|
|
4109
|
-
|
|
4200
|
+
const ReferenceOpenBehavior2 = z14.discriminatedUnion("kind", [
|
|
4201
|
+
z14.strictObject({ kind: z14.literal("working-document") }),
|
|
4202
|
+
z14.strictObject({ kind: z14.literal("browser-pane") }),
|
|
4110
4203
|
/**
|
|
4111
4204
|
* Open one of the pages this manifest declares in `pages`. The window answers this from the
|
|
4112
4205
|
* manifest, and the page gets the whole address as its `objectId` unless `addresses` says
|
|
4113
4206
|
* otherwise. Needs no web address, so a plugin-only resource (`user-todo://items/3`) can pill.
|
|
4114
4207
|
*/
|
|
4115
|
-
|
|
4208
|
+
z14.strictObject({ kind: z14.literal("page"), pageId: NonEmptyString3 }),
|
|
4116
4209
|
/**
|
|
4117
4210
|
* Hand the address's link to an app on this machine. The module's claims fill the link as its
|
|
4118
4211
|
* `sourceUrl`, and `schemes` names every scheme those links may use: main opens a link only when
|
|
4119
4212
|
* a loaded plugin declares its scheme here. A plugin the person installed can't declare this.
|
|
4120
4213
|
*/
|
|
4121
|
-
|
|
4122
|
-
kind:
|
|
4123
|
-
schemes:
|
|
4214
|
+
z14.strictObject({
|
|
4215
|
+
kind: z14.literal("local-app"),
|
|
4216
|
+
schemes: z14.array(UriScheme2.refine((scheme) => !NOT_LOCAL_APP_SCHEMES.has(scheme), "Names the web, a file or script, not an app on this machine")).min(1)
|
|
4124
4217
|
})
|
|
4125
4218
|
]);
|
|
4126
|
-
const ReferencePresentationVariant2 =
|
|
4219
|
+
const ReferencePresentationVariant2 = z14.strictObject({
|
|
4127
4220
|
resourceKind: NonEmptyString3,
|
|
4128
4221
|
presentationPluginId: PluginId2.optional()
|
|
4129
4222
|
});
|
|
4130
|
-
const ReferencePresentationVariants2 =
|
|
4131
|
-
const ReferencePresentationUriPattern2 =
|
|
4223
|
+
const ReferencePresentationVariants2 = z14.record(MimeTypeString2, ReferencePresentationVariant2);
|
|
4224
|
+
const ReferencePresentationUriPattern2 = z14.strictObject({
|
|
4132
4225
|
protocol: NonEmptyString3,
|
|
4133
|
-
hostname:
|
|
4134
|
-
pathname:
|
|
4135
|
-
search:
|
|
4226
|
+
hostname: z14.string(),
|
|
4227
|
+
pathname: z14.string().optional(),
|
|
4228
|
+
search: z14.string().optional()
|
|
4136
4229
|
});
|
|
4137
|
-
const ReferencePresentationUrlClaim2 =
|
|
4138
|
-
kind:
|
|
4230
|
+
const ReferencePresentationUrlClaim2 = z14.strictObject({
|
|
4231
|
+
kind: z14.literal("urlPattern"),
|
|
4139
4232
|
pattern: ReferencePresentationUriPattern2.extend({
|
|
4140
|
-
protocol:
|
|
4233
|
+
protocol: z14.enum(["http", "https"])
|
|
4141
4234
|
}),
|
|
4142
4235
|
/** The claim's mark: an SVG file in the plugin, drawn in its own colours. */
|
|
4143
4236
|
brandIcon: PackageAssetPath2.optional()
|
|
4144
4237
|
});
|
|
4145
|
-
const ReferencePresentationTooltip2 =
|
|
4238
|
+
const ReferencePresentationTooltip2 = z14.strictObject({
|
|
4146
4239
|
/** Same-plugin kay.ui app mounted with read-only reference URI context. */
|
|
4147
4240
|
app: LocalContributionId2,
|
|
4148
4241
|
pattern: ReferencePresentationUriPattern2
|
|
4149
4242
|
});
|
|
4150
|
-
const ReferencePresentationAddress2 =
|
|
4243
|
+
const ReferencePresentationAddress2 = z14.strictObject({
|
|
4151
4244
|
pattern: ReferencePresentationUriPattern2,
|
|
4152
4245
|
objectId: NonEmptyString3.optional(),
|
|
4153
|
-
|
|
4246
|
+
resourceKind: NonEmptyString3.optional(),
|
|
4247
|
+
label: NonEmptyString3.optional(),
|
|
4248
|
+
open: z14.strictObject({ kind: z14.literal("none") }).optional()
|
|
4154
4249
|
});
|
|
4155
|
-
const ReferencePresentationAccountLinkPage =
|
|
4250
|
+
const ReferencePresentationAccountLinkPage = z14.strictObject({
|
|
4156
4251
|
/** A literal host name. */
|
|
4157
|
-
hostname:
|
|
4158
|
-
pathname:
|
|
4252
|
+
hostname: z14.string().regex(/^[a-z0-9.-]+$/, "An account link's hostname is a literal lower-case host name."),
|
|
4253
|
+
pathname: z14.string().optional(),
|
|
4159
4254
|
/** A page matching one of these already names its account, so it stays as it is. */
|
|
4160
|
-
unlessPathname:
|
|
4255
|
+
unlessPathname: z14.array(z14.string()).min(1).optional(),
|
|
4161
4256
|
/** The path the page opens at, in place of its own. */
|
|
4162
|
-
setPathname:
|
|
4257
|
+
setPathname: z14.string().startsWith("/").optional(),
|
|
4163
4258
|
/** Query values to add. A page that already has one of these names stays as it is. */
|
|
4164
|
-
addQuery:
|
|
4259
|
+
addQuery: z14.record(NonEmptyString3, NonEmptyString3)
|
|
4165
4260
|
});
|
|
4166
|
-
const ReferencePresentationAccountLinkAddress =
|
|
4261
|
+
const ReferencePresentationAccountLinkAddress = z14.strictObject({
|
|
4167
4262
|
pattern: ReferencePresentationUriPattern2,
|
|
4168
|
-
url:
|
|
4263
|
+
url: z14.string().regex(/^https?:\/\//, "An account link's url is a web page.")
|
|
4169
4264
|
});
|
|
4170
|
-
const ReferencePresentationAccountLinks2 =
|
|
4171
|
-
label:
|
|
4172
|
-
pages:
|
|
4173
|
-
addresses:
|
|
4265
|
+
const ReferencePresentationAccountLinks2 = z14.strictObject({
|
|
4266
|
+
label: z14.enum(["email", "name"]).optional(),
|
|
4267
|
+
pages: z14.array(ReferencePresentationAccountLinkPage).min(1).optional(),
|
|
4268
|
+
addresses: z14.array(ReferencePresentationAccountLinkAddress).min(1).optional()
|
|
4174
4269
|
});
|
|
4175
|
-
const ReferencePresentationWords2 =
|
|
4270
|
+
const ReferencePresentationWords2 = z14.strictObject({
|
|
4176
4271
|
/** The row's mark, for a source with no icon of its own. Left out: the plugin's main icon. */
|
|
4177
|
-
glyph:
|
|
4272
|
+
glyph: z14.enum(TOOL_GLYPHS).optional(),
|
|
4178
4273
|
/** The thing an address names ("channel" in "Read Slack channel"). Left out: the row reads the scheme's own name. */
|
|
4179
4274
|
kind: NonEmptyString3.optional(),
|
|
4180
4275
|
/**
|
|
4181
4276
|
* A more specific kind by the address's shape. The first row that matches decides, and an
|
|
4182
4277
|
* address no row matches reads `kind`.
|
|
4183
4278
|
*/
|
|
4184
|
-
kinds:
|
|
4279
|
+
kinds: z14.array(z14.strictObject({
|
|
4185
4280
|
pattern: ReferencePresentationUriPattern2,
|
|
4186
4281
|
kind: NonEmptyString3
|
|
4187
4282
|
})).min(1).optional(),
|
|
@@ -4190,7 +4285,7 @@ function createContributionsSchemas(canonical) {
|
|
|
4190
4285
|
/** What the live phrase names ("Slack" in "Reading Slack"). Left out: the bare verb ("Reading"). */
|
|
4191
4286
|
target: NonEmptyString3.optional(),
|
|
4192
4287
|
/** `kind` already says which source this is: "Edited plan", not "Edited Plan plan". */
|
|
4193
|
-
kindNamesSource:
|
|
4288
|
+
kindNamesSource: z14.literal(true).optional()
|
|
4194
4289
|
}).superRefine((value, ctx) => {
|
|
4195
4290
|
if (value.kind === void 0 && (value.glyph !== void 0 || value.kindNamesSource !== void 0 || value.kinds !== void 0)) {
|
|
4196
4291
|
ctx.addIssue({
|
|
@@ -4200,7 +4295,7 @@ function createContributionsSchemas(canonical) {
|
|
|
4200
4295
|
});
|
|
4201
4296
|
}
|
|
4202
4297
|
});
|
|
4203
|
-
const ReferencePresentationContribution2 =
|
|
4298
|
+
const ReferencePresentationContribution2 = z14.strictObject({
|
|
4204
4299
|
localId: LocalContributionId2,
|
|
4205
4300
|
/** This manifest's URI module. Leave it out only for an address another layer serves. */
|
|
4206
4301
|
uriModule: LocalContributionId2.optional(),
|
|
@@ -4211,7 +4306,7 @@ function createContributionsSchemas(canonical) {
|
|
|
4211
4306
|
*/
|
|
4212
4307
|
scheme: UriScheme2.optional(),
|
|
4213
4308
|
/** Which of the addresses open the page, and on what. Read by the window. */
|
|
4214
|
-
addresses:
|
|
4309
|
+
addresses: z14.array(ReferencePresentationAddress2).min(1).optional(),
|
|
4215
4310
|
/** Comes with `open`. A presentation with neither only words its module's addresses. */
|
|
4216
4311
|
resourceKind: NonEmptyString3.optional(),
|
|
4217
4312
|
/** How the address opens. Left out, it stays plain text. */
|
|
@@ -4219,7 +4314,7 @@ function createContributionsSchemas(canonical) {
|
|
|
4219
4314
|
/** MIME-specific resource kinds; absent keys use the base presentation. */
|
|
4220
4315
|
variants: ReferencePresentationVariants2.optional(),
|
|
4221
4316
|
/** Lexical public URL claims used only for host-rendered browser presentations. */
|
|
4222
|
-
claims:
|
|
4317
|
+
claims: z14.array(ReferencePresentationUrlClaim2).optional(),
|
|
4223
4318
|
/** Informational app presentation matched against the canonical resource URI. */
|
|
4224
4319
|
tooltip: ReferencePresentationTooltip2.optional(),
|
|
4225
4320
|
/** What the transcript calls this module's addresses. Needs a `uriModule`. */
|
|
@@ -4302,7 +4397,7 @@ function createContributionsSchemas(canonical) {
|
|
|
4302
4397
|
});
|
|
4303
4398
|
}
|
|
4304
4399
|
});
|
|
4305
|
-
const KayUiAppHostCapability2 =
|
|
4400
|
+
const KayUiAppHostCapability2 = z14.enum([
|
|
4306
4401
|
"navigation.open-session",
|
|
4307
4402
|
// Lets `navigation.openChat` create a blank chat (no message, no model
|
|
4308
4403
|
// turn) when no session id is given. It never sends anything.
|
|
@@ -4349,31 +4444,36 @@ function createContributionsSchemas(canonical) {
|
|
|
4349
4444
|
// rearrange the workspace but never remove something the user would have to notice going missing.
|
|
4350
4445
|
"workspace.arrange"
|
|
4351
4446
|
]);
|
|
4352
|
-
const
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4447
|
+
const UiAppCapabilityReference2 = z14.union([
|
|
4448
|
+
LocalContributionId2,
|
|
4449
|
+
z14.strictObject({ pluginId: PluginId2, localId: LocalContributionId2 })
|
|
4450
|
+
]);
|
|
4451
|
+
const UiAppCapabilities2 = z14.strictObject({
|
|
4452
|
+
endpoints: z14.array(UiAppCapabilityReference2).optional(),
|
|
4453
|
+
host: z14.array(KayUiAppHostCapability2).optional(),
|
|
4454
|
+
// A local name selects this plugin's source first, otherwise the daemon's.
|
|
4455
|
+
// An explicit reference selects only the named plugin.
|
|
4456
|
+
feeds: z14.array(UiAppCapabilityReference2).optional()
|
|
4358
4457
|
}).superRefine((capabilities, ctx) => {
|
|
4359
4458
|
for (const field of ["endpoints", "host", "feeds"]) {
|
|
4360
4459
|
const seen = /* @__PURE__ */ new Set();
|
|
4361
4460
|
for (const [index, value] of (capabilities[field] ?? []).entries()) {
|
|
4362
|
-
|
|
4461
|
+
const key = typeof value === "string" ? value : JSON.stringify([value.pluginId, value.localId]);
|
|
4462
|
+
if (seen.has(key)) {
|
|
4363
4463
|
ctx.addIssue({
|
|
4364
4464
|
code: "custom",
|
|
4365
4465
|
path: [field, index],
|
|
4366
|
-
message: `duplicate ui app ${field} capability ${
|
|
4466
|
+
message: `duplicate ui app ${field} capability ${key}`
|
|
4367
4467
|
});
|
|
4368
4468
|
}
|
|
4369
|
-
seen.add(
|
|
4469
|
+
seen.add(key);
|
|
4370
4470
|
}
|
|
4371
4471
|
}
|
|
4372
4472
|
});
|
|
4373
|
-
const UiRailBadge =
|
|
4473
|
+
const UiRailBadge = z14.strictObject({
|
|
4374
4474
|
source: LocalContributionId2,
|
|
4375
4475
|
where: NonEmptyString3.optional(),
|
|
4376
|
-
label:
|
|
4476
|
+
label: z14.strictObject({
|
|
4377
4477
|
one: NonEmptyString3.optional(),
|
|
4378
4478
|
other: NonEmptyString3
|
|
4379
4479
|
})
|
|
@@ -4389,48 +4489,50 @@ function createContributionsSchemas(canonical) {
|
|
|
4389
4489
|
});
|
|
4390
4490
|
}
|
|
4391
4491
|
});
|
|
4392
|
-
const UiRailEntryContribution2 =
|
|
4492
|
+
const UiRailEntryContribution2 = z14.strictObject({
|
|
4393
4493
|
id: LocalContributionId2,
|
|
4394
4494
|
title: NonEmptyString3,
|
|
4395
4495
|
icon: PackageAssetPath2.optional(),
|
|
4396
4496
|
page: NonEmptyString3,
|
|
4397
4497
|
homeLocation: NonEmptyString3.optional(),
|
|
4398
4498
|
shortcut: NonEmptyString3.optional(),
|
|
4399
|
-
order:
|
|
4400
|
-
section:
|
|
4499
|
+
order: z14.number().finite().optional(),
|
|
4500
|
+
section: z14.enum(["primary", "plugins"]).optional(),
|
|
4401
4501
|
badge: UiRailBadge.optional(),
|
|
4402
|
-
panel:
|
|
4403
|
-
featureFlagVariant:
|
|
4502
|
+
panel: z14.strictObject({ body: LocalContributionId2 }).optional(),
|
|
4503
|
+
featureFlagVariant: z14.strictObject({
|
|
4404
4504
|
flag: NonEmptyString3,
|
|
4405
4505
|
title: NonEmptyString3.optional(),
|
|
4406
4506
|
icon: PackageAssetPath2.optional(),
|
|
4407
|
-
panel:
|
|
4507
|
+
panel: z14.literal(false).optional()
|
|
4408
4508
|
}).optional()
|
|
4409
4509
|
});
|
|
4410
|
-
const UiToastPreviewContribution2 =
|
|
4510
|
+
const UiToastPreviewContribution2 = z14.strictObject({
|
|
4411
4511
|
rule: LocalContributionId2,
|
|
4412
4512
|
body: LocalContributionId2,
|
|
4413
4513
|
address: NonEmptyString3
|
|
4414
4514
|
});
|
|
4415
|
-
const UiPageContribution2 =
|
|
4515
|
+
const UiPageContribution2 = z14.strictObject({
|
|
4416
4516
|
id: NonEmptyString3,
|
|
4417
4517
|
title: NonEmptyString3.optional(),
|
|
4418
4518
|
icon: PackageAssetPath2.optional(),
|
|
4419
|
-
companion:
|
|
4519
|
+
companion: z14.boolean().optional(),
|
|
4520
|
+
sessionBinding: z14.enum(["session", "family"]).optional(),
|
|
4521
|
+
aliases: z14.array(NonEmptyString3).optional(),
|
|
4420
4522
|
openedEvent: NonEmptyString3.optional()
|
|
4421
4523
|
});
|
|
4422
|
-
const UiAppFields =
|
|
4524
|
+
const UiAppFields = z14.strictObject({
|
|
4423
4525
|
localId: LocalContributionId2,
|
|
4424
4526
|
displayName: NonEmptyString3,
|
|
4425
4527
|
description: NonEmptyString3.optional(),
|
|
4426
4528
|
icon: PackageAssetPath2.optional(),
|
|
4427
|
-
runtime:
|
|
4529
|
+
runtime: z14.literal("kay.react-app.v1"),
|
|
4428
4530
|
/** Mounted only by a host-supplied context; never a standalone navigation destination. */
|
|
4429
|
-
contextOnly:
|
|
4430
|
-
sdk:
|
|
4531
|
+
contextOnly: z14.literal(true).optional(),
|
|
4532
|
+
sdk: z14.strictObject({ range: NonEmptyString3 }),
|
|
4431
4533
|
entrypoint: TargetEntrypoint2,
|
|
4432
|
-
styles:
|
|
4433
|
-
assets:
|
|
4534
|
+
styles: z14.array(PackageAssetPath2).optional(),
|
|
4535
|
+
assets: z14.array(PackageAssetPath2).optional(),
|
|
4434
4536
|
capabilities: UiAppCapabilities2.optional()
|
|
4435
4537
|
});
|
|
4436
4538
|
function stripRetiredUiAppFields(value) {
|
|
@@ -4441,36 +4543,36 @@ function createContributionsSchemas(canonical) {
|
|
|
4441
4543
|
delete remaining["activityRail"];
|
|
4442
4544
|
return remaining;
|
|
4443
4545
|
}
|
|
4444
|
-
const UiAppContribution2 = canonical ? UiAppFields :
|
|
4445
|
-
const ThemeContribution2 =
|
|
4546
|
+
const UiAppContribution2 = canonical ? UiAppFields : z14.preprocess(stripRetiredUiAppFields, UiAppFields);
|
|
4547
|
+
const ThemeContribution2 = z14.strictObject({
|
|
4446
4548
|
localId: LocalContributionId2,
|
|
4447
4549
|
displayName: NonEmptyString3,
|
|
4448
|
-
appearance:
|
|
4550
|
+
appearance: z14.enum(["light", "dark"]),
|
|
4449
4551
|
tokens: PackageAssetPath2
|
|
4450
4552
|
});
|
|
4451
|
-
const CommandHandler2 =
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
kind:
|
|
4553
|
+
const CommandHandler2 = z14.discriminatedUnion("kind", [
|
|
4554
|
+
z14.strictObject({ kind: z14.literal("skill"), skill: LocalContributionId2 }),
|
|
4555
|
+
z14.strictObject({
|
|
4556
|
+
kind: z14.literal("tool"),
|
|
4455
4557
|
tool: PluginToolName2,
|
|
4456
4558
|
/** Positional mapping from tokenized `argsText` onto the tool's own input fields - see this
|
|
4457
4559
|
* union's doc for the exact tokenize/map/last-field-absorbs rule. */
|
|
4458
|
-
argumentFields:
|
|
4560
|
+
argumentFields: z14.array(NonEmptyString3)
|
|
4459
4561
|
}),
|
|
4460
|
-
|
|
4461
|
-
kind:
|
|
4562
|
+
z14.strictObject({
|
|
4563
|
+
kind: z14.literal("endpoint"),
|
|
4462
4564
|
endpoint: LocalContributionId2
|
|
4463
4565
|
})
|
|
4464
4566
|
]);
|
|
4465
|
-
const CommandContribution2 =
|
|
4567
|
+
const CommandContribution2 = z14.strictObject({
|
|
4466
4568
|
localId: LocalContributionId2,
|
|
4467
4569
|
displayName: OptionalDisplayName,
|
|
4468
4570
|
description: NonEmptyString3,
|
|
4469
|
-
aliases:
|
|
4571
|
+
aliases: z14.array(LocalContributionId2).optional(),
|
|
4470
4572
|
argumentHint: NonEmptyString3.optional(),
|
|
4471
4573
|
handler: CommandHandler2
|
|
4472
4574
|
});
|
|
4473
|
-
const PluginContributionKind2 =
|
|
4575
|
+
const PluginContributionKind2 = z14.enum([
|
|
4474
4576
|
"tool",
|
|
4475
4577
|
"converter",
|
|
4476
4578
|
"uriModule",
|
|
@@ -4558,6 +4660,7 @@ function createContributionsSchemas(canonical) {
|
|
|
4558
4660
|
ReferencePresentationWords: ReferencePresentationWords2,
|
|
4559
4661
|
ReferencePresentationContribution: ReferencePresentationContribution2,
|
|
4560
4662
|
KayUiAppHostCapability: KayUiAppHostCapability2,
|
|
4663
|
+
UiAppCapabilityReference: UiAppCapabilityReference2,
|
|
4561
4664
|
UiAppCapabilities: UiAppCapabilities2,
|
|
4562
4665
|
UiRailEntryContribution: UiRailEntryContribution2,
|
|
4563
4666
|
UiToastPreviewContribution: UiToastPreviewContribution2,
|
|
@@ -4569,7 +4672,7 @@ function createContributionsSchemas(canonical) {
|
|
|
4569
4672
|
PluginContributionKind: PluginContributionKind2
|
|
4570
4673
|
};
|
|
4571
4674
|
}
|
|
4572
|
-
var { ApprovalCardForm, ApprovalCardStoredForm, ApprovalTypeContribution, UriModuleFacts, ToolContribution, ToolPermission, AgentToolContribution, ConverterContribution, UriModuleContribution, AppUriModuleContribution, AppDataSourceContribution, WhiteboardTypeStorage, WhiteboardTypeContribution, AppDataMaterializerContribution, ArtifactUriModuleContribution, CliBindingContribution, GitHostContribution, ResourceContribution, SkillContribution, PluginSkillSourceDeclaration, SearchProviderContribution, InteractionDriverContribution, EntityResolverContribution, AgentRenderContribution, EndpointContribution, PluginCardContribution, WorkflowContribution, McpServerUrl, McpServerAuthMode, McpServerContribution, McpServerContributions, AppEventSubscription, ContextContributorContribution, PluginEventDefinitionContribution, PluginNotificationRuleContribution, PluginProductEventContribution, UiEventSubscriptionContribution, DeviceDelegationContribution, SessionReaderContribution, UiCommandContribution, UiSlotContribution, ReferenceOpenBehavior, ReferencePresentationVariant, ReferencePresentationVariants, ReferencePresentationUriPattern, ReferencePresentationUrlClaim, ReferencePresentationTooltip, ReferencePresentationAddress, ReferencePresentationAccountLinks, ReferencePresentationWords, ReferencePresentationContribution, KayUiAppHostCapability, UiAppCapabilities, UiRailEntryContribution, UiToastPreviewContribution, UiPageContribution, UiAppContribution, ThemeContribution, CommandHandler, CommandContribution, PluginContributionKind } = createContributionsSchemas(false);
|
|
4675
|
+
var { ApprovalCardForm, ApprovalCardStoredForm, ApprovalTypeContribution, UriModuleFacts, ToolContribution, ToolPermission, AgentToolContribution, ConverterContribution, UriModuleContribution, AppUriModuleContribution, AppDataSourceContribution, WhiteboardTypeStorage, WhiteboardTypeContribution, AppDataMaterializerContribution, ArtifactUriModuleContribution, CliBindingContribution, GitHostContribution, ResourceContribution, SkillContribution, PluginSkillSourceDeclaration, SearchProviderContribution, InteractionDriverContribution, EntityResolverContribution, AgentRenderContribution, EndpointContribution, PluginCardContribution, WorkflowContribution, McpServerUrl, McpServerAuthMode, McpServerContribution, McpServerContributions, AppEventSubscription, ContextContributorContribution, PluginEventDefinitionContribution, PluginNotificationRuleContribution, PluginProductEventContribution, UiEventSubscriptionContribution, DeviceDelegationContribution, SessionReaderContribution, UiCommandContribution, UiSlotContribution, ReferenceOpenBehavior, ReferencePresentationVariant, ReferencePresentationVariants, ReferencePresentationUriPattern, ReferencePresentationUrlClaim, ReferencePresentationTooltip, ReferencePresentationAddress, ReferencePresentationAccountLinks, ReferencePresentationWords, ReferencePresentationContribution, KayUiAppHostCapability, UiAppCapabilityReference, UiAppCapabilities, UiRailEntryContribution, UiToastPreviewContribution, UiPageContribution, UiAppContribution, ThemeContribution, CommandHandler, CommandContribution, PluginContributionKind } = createContributionsSchemas(false);
|
|
4573
4676
|
var canonicalContributionSchemas = createContributionsSchemas(true);
|
|
4574
4677
|
var UI_APP_SOURCE_MODULE = /\.(?:tsx|ts|jsx)$/;
|
|
4575
4678
|
function isUiAppSourceModule(module) {
|
|
@@ -4630,27 +4733,27 @@ __export(manifest_exports, {
|
|
|
4630
4733
|
});
|
|
4631
4734
|
|
|
4632
4735
|
// packages/plugin-protocol/dist/shell-commands.js
|
|
4633
|
-
import { z as
|
|
4634
|
-
var PluginShellCommand =
|
|
4635
|
-
name:
|
|
4636
|
-
aliases:
|
|
4637
|
-
endpoint:
|
|
4638
|
-
usage:
|
|
4736
|
+
import { z as z15 } from "zod";
|
|
4737
|
+
var PluginShellCommand = z15.strictObject({
|
|
4738
|
+
name: z15.string().regex(/^[a-z][a-z0-9-]*$/),
|
|
4739
|
+
aliases: z15.array(z15.string().regex(/^[a-z][a-z0-9-]*$/)).optional(),
|
|
4740
|
+
endpoint: z15.string().min(1),
|
|
4741
|
+
usage: z15.string().min(1)
|
|
4639
4742
|
});
|
|
4640
|
-
var ShellCommandOutcome =
|
|
4641
|
-
exitCode:
|
|
4743
|
+
var ShellCommandOutcome = z15.strictObject({
|
|
4744
|
+
exitCode: z15.number().int(),
|
|
4642
4745
|
envelope: JsonValue,
|
|
4643
4746
|
result: JsonValue.optional()
|
|
4644
4747
|
});
|
|
4645
|
-
var ShellCommandRequest =
|
|
4646
|
-
argv:
|
|
4647
|
-
cwd:
|
|
4648
|
-
outcomes:
|
|
4748
|
+
var ShellCommandRequest = z15.strictObject({
|
|
4749
|
+
argv: z15.array(z15.string()),
|
|
4750
|
+
cwd: z15.string(),
|
|
4751
|
+
outcomes: z15.array(ShellCommandOutcome).max(3)
|
|
4649
4752
|
});
|
|
4650
|
-
var ShellCommandStep =
|
|
4651
|
-
|
|
4652
|
-
kind:
|
|
4653
|
-
toolName:
|
|
4753
|
+
var ShellCommandStep = z15.discriminatedUnion("kind", [
|
|
4754
|
+
z15.strictObject({
|
|
4755
|
+
kind: z15.literal("invoke"),
|
|
4756
|
+
toolName: z15.enum([
|
|
4654
4757
|
"read",
|
|
4655
4758
|
"list",
|
|
4656
4759
|
"search",
|
|
@@ -4659,24 +4762,24 @@ var ShellCommandStep = z14.discriminatedUnion("kind", [
|
|
|
4659
4762
|
"delete",
|
|
4660
4763
|
"help"
|
|
4661
4764
|
]),
|
|
4662
|
-
input:
|
|
4663
|
-
flags:
|
|
4765
|
+
input: z15.record(z15.string(), JsonValue),
|
|
4766
|
+
flags: z15.record(z15.string(), z15.string())
|
|
4664
4767
|
}),
|
|
4665
|
-
|
|
4666
|
-
kind:
|
|
4667
|
-
exitCode:
|
|
4668
|
-
stdout:
|
|
4768
|
+
z15.strictObject({
|
|
4769
|
+
kind: z15.literal("finish"),
|
|
4770
|
+
exitCode: z15.number().int(),
|
|
4771
|
+
stdout: z15.string()
|
|
4669
4772
|
})
|
|
4670
4773
|
]);
|
|
4671
4774
|
|
|
4672
4775
|
// packages/plugin-protocol/dist/manifest.js
|
|
4673
|
-
import { z as
|
|
4776
|
+
import { z as z17 } from "zod";
|
|
4674
4777
|
|
|
4675
4778
|
// packages/plugin-protocol/dist/workload-purposes.js
|
|
4676
|
-
import { z as
|
|
4677
|
-
var PluginWorkloadPurpose =
|
|
4678
|
-
purpose:
|
|
4679
|
-
workloadClass:
|
|
4779
|
+
import { z as z16 } from "zod";
|
|
4780
|
+
var PluginWorkloadPurpose = z16.strictObject({
|
|
4781
|
+
purpose: z16.string().regex(/^[a-z][a-z0-9-]*$/),
|
|
4782
|
+
workloadClass: z16.enum(["dreaming", "hindsight"])
|
|
4680
4783
|
});
|
|
4681
4784
|
|
|
4682
4785
|
// packages/plugin-protocol/dist/synthetic-contributions.js
|
|
@@ -4702,34 +4805,34 @@ function createManifestSchemas(canonical) {
|
|
|
4702
4805
|
const { AgentRenderContribution: AgentRenderContribution2, ApprovalTypeContribution: ApprovalTypeContribution2, WorkflowContribution: WorkflowContribution2, PluginCardContribution: PluginCardContribution2, AppDataMaterializerContribution: AppDataMaterializerContribution2, AppDataSourceContribution: AppDataSourceContribution2, AppUriModuleContribution: AppUriModuleContribution2, AppEventSubscription: AppEventSubscription2, ArtifactUriModuleContribution: ArtifactUriModuleContribution2, CliBindingContribution: CliBindingContribution2, CommandContribution: CommandContribution2, ContextContributorContribution: ContextContributorContribution2, ConverterContribution: ConverterContribution2, SessionReaderContribution: SessionReaderContribution2, DeviceDelegationContribution: DeviceDelegationContribution2, EndpointContribution: EndpointContribution2, EntityResolverContribution: EntityResolverContribution2, GitHostContribution: GitHostContribution2, McpServerContributions: McpServerContributions2, PluginEventDefinitionContribution: PluginEventDefinitionContribution2, PluginNotificationRuleContribution: PluginNotificationRuleContribution2, PluginProductEventContribution: PluginProductEventContribution2, ResourceContribution: ResourceContribution2, ReferencePresentationContribution: ReferencePresentationContribution2, PluginSkillSourceDeclaration: PluginSkillSourceDeclaration2, InteractionDriverContribution: InteractionDriverContribution2, SearchProviderContribution: SearchProviderContribution2, SkillContribution: SkillContribution2, ThemeContribution: ThemeContribution2, AgentToolContribution: AgentToolContribution2, ToolContribution: ToolContribution2, UiCommandContribution: UiCommandContribution2, UiAppContribution: UiAppContribution2, UiRailEntryContribution: UiRailEntryContribution2, UiToastPreviewContribution: UiToastPreviewContribution2, UiPageContribution: UiPageContribution2, UiEventSubscriptionContribution: UiEventSubscriptionContribution2, UiSlotContribution: UiSlotContribution2, UriModuleContribution: UriModuleContribution2, WhiteboardTypeContribution: WhiteboardTypeContribution2 } = canonical ? canonicalContributionSchemas : contributions_exports;
|
|
4703
4806
|
const { HttpsUrl: HttpsUrl2, LocalContributionId: LocalContributionId2, NonEmptyString: NonEmptyString3, PackageAssetPath: PackageAssetPath2, PluginId: PluginId2, PluginNamespace: PluginNamespace2, RegistrableDomain: RegistrableDomain2, SignedInStatusCode: SignedInStatusCode2, TargetEntrypoint: TargetEntrypoint2 } = canonical ? canonicalCommonSchemas : common_exports;
|
|
4704
4807
|
const { PluginPermissionManifest: PluginPermissionManifest2 } = canonical ? canonicalPermissionSchemas : permissions_exports;
|
|
4705
|
-
const KayAgentTargetManifest2 =
|
|
4808
|
+
const KayAgentTargetManifest2 = z17.strictObject({
|
|
4706
4809
|
entrypoint: TargetEntrypoint2,
|
|
4707
|
-
contributes:
|
|
4708
|
-
tools:
|
|
4709
|
-
converters:
|
|
4710
|
-
uriModules:
|
|
4810
|
+
contributes: z17.strictObject({
|
|
4811
|
+
tools: z17.array(AgentToolContribution2).optional(),
|
|
4812
|
+
converters: z17.array(ConverterContribution2).optional(),
|
|
4813
|
+
uriModules: z17.array(UriModuleContribution2).optional(),
|
|
4711
4814
|
// Host-composed artifact-backed schemes (see `ArtifactUriModuleContribution`): the plugin
|
|
4712
4815
|
// declares scheme + editability; the daemon binds each to the kernel's artifact lifecycle
|
|
4713
4816
|
// per session. Separate from `uriModules` (plugin-implemented backends) precisely because
|
|
4714
4817
|
// the plugin registers NOTHING for these at activation.
|
|
4715
|
-
artifactUriModules:
|
|
4716
|
-
cliBindings:
|
|
4818
|
+
artifactUriModules: z17.array(ArtifactUriModuleContribution2).optional(),
|
|
4819
|
+
cliBindings: z17.array(CliBindingContribution2).optional(),
|
|
4717
4820
|
// Which git hosts this plugin's credential serves (see `GitHostContribution`): a
|
|
4718
4821
|
// declaration, so a plugin for any git backend gets credentialed clones without
|
|
4719
4822
|
// the daemon learning its name. Sibling of `cliBindings` because both answer the
|
|
4720
4823
|
// same question - which of this plugin's auth services a host-side consumer
|
|
4721
4824
|
// resolves - for two different transports.
|
|
4722
|
-
gitHosts:
|
|
4723
|
-
resources:
|
|
4724
|
-
skills:
|
|
4725
|
-
searchProviders:
|
|
4726
|
-
interactionDrivers:
|
|
4727
|
-
entityResolvers:
|
|
4728
|
-
renderers:
|
|
4825
|
+
gitHosts: z17.array(GitHostContribution2).optional(),
|
|
4826
|
+
resources: z17.array(ResourceContribution2).optional(),
|
|
4827
|
+
skills: z17.array(SkillContribution2).optional(),
|
|
4828
|
+
searchProviders: z17.array(SearchProviderContribution2).optional(),
|
|
4829
|
+
interactionDrivers: z17.array(InteractionDriverContribution2).optional(),
|
|
4830
|
+
entityResolvers: z17.array(EntityResolverContribution2).optional(),
|
|
4831
|
+
renderers: z17.array(AgentRenderContribution2).optional(),
|
|
4729
4832
|
// Handler restricted to skill | tool by the manifest-level refinement below (see
|
|
4730
4833
|
// `CommandContribution`'s doc for why the restriction is not expressed in the type, and
|
|
4731
4834
|
// `CommandHandler`'s doc for why there is no promptTemplate variant to declare here).
|
|
4732
|
-
commands:
|
|
4835
|
+
commands: z17.array(CommandContribution2).optional()
|
|
4733
4836
|
}).optional(),
|
|
4734
4837
|
/**
|
|
4735
4838
|
* The plugin's primer skill - the `localId` of one of its own declared
|
|
@@ -4765,6 +4868,8 @@ function createManifestSchemas(canonical) {
|
|
|
4765
4868
|
* grant a person approved), and a body over 500 words is dropped.
|
|
4766
4869
|
*/
|
|
4767
4870
|
prompt: PackageAssetPath2.optional(),
|
|
4871
|
+
promptOrder: z17.number().finite().optional(),
|
|
4872
|
+
familyFolder: z17.strictObject({ scope: z17.literal("root") }).optional(),
|
|
4768
4873
|
/**
|
|
4769
4874
|
* External origins of skills this plugin claims as its own (see
|
|
4770
4875
|
* {@link PluginSkillSourceDeclaration}). Acquired by the daemon at boot and landed under the
|
|
@@ -4775,61 +4880,61 @@ function createManifestSchemas(canonical) {
|
|
|
4775
4880
|
* acquisition, not declared here, so there is nothing for the resolved contract to mint a
|
|
4776
4881
|
* `globalId` for at parse time.
|
|
4777
4882
|
*/
|
|
4778
|
-
skillSources:
|
|
4883
|
+
skillSources: z17.array(PluginSkillSourceDeclaration2).optional()
|
|
4779
4884
|
});
|
|
4780
|
-
const KayAppTargetManifest2 =
|
|
4885
|
+
const KayAppTargetManifest2 = z17.strictObject({
|
|
4781
4886
|
// Optional, like `kay.ui`'s: a target may carry only declarative `contributes` (e.g. a plugin
|
|
4782
4887
|
// that ships nothing but `mcpServers`) with no app-lifetime module for the host to load.
|
|
4783
4888
|
entrypoint: TargetEntrypoint2.optional(),
|
|
4784
|
-
contributes:
|
|
4889
|
+
contributes: z17.strictObject({
|
|
4785
4890
|
// Session tools implemented by the app-lifetime activation (registered once, injected into
|
|
4786
4891
|
// every session with a host-stamped session context) - the tool counterpart of `uriModules`
|
|
4787
4892
|
// below. Same descriptor shape as kay.agent tools; `toolName` shares ONE flat session
|
|
4788
4893
|
// namespace with them (enforced by the manifest-level refinement below).
|
|
4789
|
-
tools:
|
|
4790
|
-
endpoints:
|
|
4791
|
-
cards:
|
|
4792
|
-
uriModules:
|
|
4793
|
-
dataSources:
|
|
4794
|
-
whiteboardTypes:
|
|
4795
|
-
approvalTypes:
|
|
4796
|
-
workflows:
|
|
4797
|
-
eventDefinitions:
|
|
4894
|
+
tools: z17.array(ToolContribution2).optional(),
|
|
4895
|
+
endpoints: z17.array(EndpointContribution2).optional(),
|
|
4896
|
+
cards: z17.array(PluginCardContribution2).optional(),
|
|
4897
|
+
uriModules: z17.array(AppUriModuleContribution2).optional(),
|
|
4898
|
+
dataSources: z17.array(AppDataSourceContribution2).optional(),
|
|
4899
|
+
whiteboardTypes: z17.array(WhiteboardTypeContribution2).optional(),
|
|
4900
|
+
approvalTypes: z17.array(ApprovalTypeContribution2).optional(),
|
|
4901
|
+
workflows: z17.array(WorkflowContribution2).optional(),
|
|
4902
|
+
eventDefinitions: z17.array(PluginEventDefinitionContribution2).optional(),
|
|
4798
4903
|
// Default notification rules over this plugin's own `eventDefinitions`; seeded by the host
|
|
4799
4904
|
// (see `PluginNotificationRuleContribution`).
|
|
4800
|
-
notificationRules:
|
|
4801
|
-
productEvents:
|
|
4802
|
-
eventSubscriptions:
|
|
4803
|
-
deviceDelegations:
|
|
4804
|
-
sessionReaders:
|
|
4805
|
-
contextContributors:
|
|
4905
|
+
notificationRules: z17.array(PluginNotificationRuleContribution2).optional(),
|
|
4906
|
+
productEvents: z17.array(PluginProductEventContribution2).optional(),
|
|
4907
|
+
eventSubscriptions: z17.array(AppEventSubscription2).optional(),
|
|
4908
|
+
deviceDelegations: z17.array(DeviceDelegationContribution2).optional(),
|
|
4909
|
+
sessionReaders: z17.array(SessionReaderContribution2).optional(),
|
|
4910
|
+
contextContributors: z17.array(ContextContributorContribution2).optional(),
|
|
4806
4911
|
// Vendored MCP servers this plugin ships (see `McpServerContributions`). Each is hosted only
|
|
4807
4912
|
// for a plugin holding `mcp.host-server` for its name and URL; that is decided at
|
|
4808
4913
|
// composition, not here (see ARCHITECTURE.md "Validation Law").
|
|
4809
4914
|
mcpServers: McpServerContributions2.optional(),
|
|
4810
4915
|
// Handler restricted to endpoint-only by the manifest-level refinement below.
|
|
4811
|
-
commands:
|
|
4916
|
+
commands: z17.array(CommandContribution2).optional()
|
|
4812
4917
|
}).optional()
|
|
4813
4918
|
});
|
|
4814
|
-
const KayUiTargetManifest2 =
|
|
4919
|
+
const KayUiTargetManifest2 = z17.strictObject({
|
|
4815
4920
|
entrypoint: TargetEntrypoint2.extend({
|
|
4816
|
-
format:
|
|
4921
|
+
format: z17.literal("compiled-bundle").optional()
|
|
4817
4922
|
}).optional(),
|
|
4818
|
-
contributes:
|
|
4819
|
-
commands:
|
|
4820
|
-
slots:
|
|
4821
|
-
referencePresentations:
|
|
4822
|
-
apps:
|
|
4823
|
-
railEntries:
|
|
4824
|
-
toastPreviews:
|
|
4825
|
-
pages:
|
|
4826
|
-
themes:
|
|
4827
|
-
eventSubscriptions:
|
|
4828
|
-
dataMaterializers:
|
|
4923
|
+
contributes: z17.strictObject({
|
|
4924
|
+
commands: z17.array(UiCommandContribution2).optional(),
|
|
4925
|
+
slots: z17.array(UiSlotContribution2).optional(),
|
|
4926
|
+
referencePresentations: z17.array(ReferencePresentationContribution2).optional(),
|
|
4927
|
+
apps: z17.array(UiAppContribution2).optional(),
|
|
4928
|
+
railEntries: z17.array(UiRailEntryContribution2).optional(),
|
|
4929
|
+
toastPreviews: z17.array(UiToastPreviewContribution2).optional(),
|
|
4930
|
+
pages: z17.array(UiPageContribution2).optional(),
|
|
4931
|
+
themes: z17.array(ThemeContribution2).optional(),
|
|
4932
|
+
eventSubscriptions: z17.array(UiEventSubscriptionContribution2).optional(),
|
|
4933
|
+
dataMaterializers: z17.array(AppDataMaterializerContribution2).optional()
|
|
4829
4934
|
}).optional()
|
|
4830
4935
|
});
|
|
4831
|
-
const PluginConfigScope2 =
|
|
4832
|
-
const PluginConfigSectionManifest2 =
|
|
4936
|
+
const PluginConfigScope2 = z17.enum(["global", "project", "agent"]);
|
|
4937
|
+
const PluginConfigSectionManifest2 = z17.strictObject({
|
|
4833
4938
|
section: NonEmptyString3.optional(),
|
|
4834
4939
|
schema: JsonSchema,
|
|
4835
4940
|
/**
|
|
@@ -4847,23 +4952,23 @@ function createManifestSchemas(canonical) {
|
|
|
4847
4952
|
* is the baseline every section has; `agent` has no runtime mapping (the
|
|
4848
4953
|
* agent/entity fold is downstream of the document protocol).
|
|
4849
4954
|
*/
|
|
4850
|
-
scopes:
|
|
4955
|
+
scopes: z17.array(PluginConfigScope2).optional()
|
|
4851
4956
|
});
|
|
4852
|
-
const PluginConfigManifest2 =
|
|
4853
|
-
const PluginStorageManifest2 =
|
|
4854
|
-
sqlite:
|
|
4855
|
-
enabled:
|
|
4856
|
-
ownerTarget:
|
|
4957
|
+
const PluginConfigManifest2 = z17.array(PluginConfigSectionManifest2).min(1);
|
|
4958
|
+
const PluginStorageManifest2 = z17.strictObject({
|
|
4959
|
+
sqlite: z17.strictObject({
|
|
4960
|
+
enabled: z17.boolean(),
|
|
4961
|
+
ownerTarget: z17.literal("kay.app").optional(),
|
|
4857
4962
|
migrations: NonEmptyString3.optional()
|
|
4858
4963
|
}).optional(),
|
|
4859
|
-
dataDir:
|
|
4860
|
-
enabled:
|
|
4861
|
-
ownerTarget:
|
|
4964
|
+
dataDir: z17.strictObject({
|
|
4965
|
+
enabled: z17.boolean(),
|
|
4966
|
+
ownerTarget: z17.literal("kay.app").optional(),
|
|
4862
4967
|
sharedWith: PluginId2.optional()
|
|
4863
4968
|
}).optional()
|
|
4864
4969
|
});
|
|
4865
|
-
const PluginOAuthClientSupplier2 =
|
|
4866
|
-
const PluginProvisioningProbe2 =
|
|
4970
|
+
const PluginOAuthClientSupplier2 = z17.enum(["kay", "user"]);
|
|
4971
|
+
const PluginProvisioningProbe2 = z17.strictObject({
|
|
4867
4972
|
/**
|
|
4868
4973
|
* The API endpoint that answers the question. The host sends the service's OWN credential here,
|
|
4869
4974
|
* so this must belong to the provider that minted it - enforced by the daemon against the
|
|
@@ -4871,13 +4976,13 @@ function createManifestSchemas(canonical) {
|
|
|
4871
4976
|
*/
|
|
4872
4977
|
url: HttpsUrl2,
|
|
4873
4978
|
/** Absent => `GET`. */
|
|
4874
|
-
method:
|
|
4979
|
+
method: z17.enum(["GET"]).optional(),
|
|
4875
4980
|
/**
|
|
4876
4981
|
* The statuses that make the response a VERDICT at all. Anything else (a 401 from a stale
|
|
4877
4982
|
* token, a 5xx, a rate limit) means the probe learned nothing and reports `unknown` - never
|
|
4878
4983
|
* `unsatisfied`, which would tell a user to go fix setup that is fine.
|
|
4879
4984
|
*/
|
|
4880
|
-
verdictStatuses:
|
|
4985
|
+
verdictStatuses: z17.array(SignedInStatusCode2).min(1),
|
|
4881
4986
|
/**
|
|
4882
4987
|
* Dot-path to a JSON array in the response body that must be NON-EMPTY for the requirement to
|
|
4883
4988
|
* count as satisfied (e.g. `installations`). Absent means a verdict status alone is enough.
|
|
@@ -4886,7 +4991,7 @@ function createManifestSchemas(canonical) {
|
|
|
4886
4991
|
*/
|
|
4887
4992
|
nonEmptyArrayAt: NonEmptyString3.optional()
|
|
4888
4993
|
});
|
|
4889
|
-
const PluginProvisioningRequirement2 =
|
|
4994
|
+
const PluginProvisioningRequirement2 = z17.strictObject({
|
|
4890
4995
|
/** Stable id, unique within the scheme. */
|
|
4891
4996
|
id: LocalContributionId2,
|
|
4892
4997
|
/** Human-facing requirement name, e.g. "GitHub App installation". */
|
|
@@ -4903,7 +5008,7 @@ function createManifestSchemas(canonical) {
|
|
|
4903
5008
|
probe: PluginProvisioningProbe2
|
|
4904
5009
|
});
|
|
4905
5010
|
const PluginProvisioningField = {
|
|
4906
|
-
provisioning:
|
|
5011
|
+
provisioning: z17.array(PluginProvisioningRequirement2).optional()
|
|
4907
5012
|
};
|
|
4908
5013
|
const PluginAuthSchemeDescriptionFields = {
|
|
4909
5014
|
/** Human-facing flow name; absent, the service's name stands in. */
|
|
@@ -4920,16 +5025,16 @@ function createManifestSchemas(canonical) {
|
|
|
4920
5025
|
authorizationUrl: HttpsUrl2,
|
|
4921
5026
|
tokenUrl: HttpsUrl2,
|
|
4922
5027
|
/** Provider-specific query parameters added to the authorize URL. */
|
|
4923
|
-
extraAuthorizeParams:
|
|
5028
|
+
extraAuthorizeParams: z17.record(NonEmptyString3, z17.string()).optional()
|
|
4924
5029
|
};
|
|
4925
|
-
const PluginAuthSchemeAccountLookup =
|
|
4926
|
-
const PluginAuthSchemeOAuthPkce =
|
|
5030
|
+
const PluginAuthSchemeAccountLookup = z17.literal("lookup");
|
|
5031
|
+
const PluginAuthSchemeOAuthPkce = z17.strictObject({
|
|
4927
5032
|
...PluginProvisioningField,
|
|
4928
5033
|
...PluginAuthSchemeDescriptionFields,
|
|
4929
5034
|
...PluginAuthSchemeOAuthEndpointFields,
|
|
4930
5035
|
localId: LocalContributionId2,
|
|
4931
|
-
kind:
|
|
4932
|
-
exchange:
|
|
5036
|
+
kind: z17.literal("oauth2"),
|
|
5037
|
+
exchange: z17.literal("pkce"),
|
|
4933
5038
|
byoocProfile: PluginByoocProfile.optional(),
|
|
4934
5039
|
/**
|
|
4935
5040
|
* A public client id the plugin ships for its own sign-in. Only an installed plugin's is used:
|
|
@@ -4953,7 +5058,7 @@ function createManifestSchemas(canonical) {
|
|
|
4953
5058
|
* runs on an untrusted manifest, so a hand-built `["kay","kay"]` must be refused here, not
|
|
4954
5059
|
* silently normalized).
|
|
4955
5060
|
*/
|
|
4956
|
-
clientSuppliers:
|
|
5061
|
+
clientSuppliers: z17.array(PluginOAuthClientSupplier2).nonempty().superRefine((suppliers, ctx) => {
|
|
4957
5062
|
if (new Set(suppliers).size !== suppliers.length) {
|
|
4958
5063
|
ctx.addIssue({
|
|
4959
5064
|
code: "custom",
|
|
@@ -4961,7 +5066,7 @@ function createManifestSchemas(canonical) {
|
|
|
4961
5066
|
});
|
|
4962
5067
|
}
|
|
4963
5068
|
}),
|
|
4964
|
-
scopes:
|
|
5069
|
+
scopes: z17.array(NonEmptyString3).optional()
|
|
4965
5070
|
}).refine((scheme) => scheme.byoocProfile === void 0 || scheme.clientSuppliers.includes("user"), {
|
|
4966
5071
|
message: "An own-client profile requires the user client supplier.",
|
|
4967
5072
|
path: ["byoocProfile"]
|
|
@@ -4972,33 +5077,33 @@ function createManifestSchemas(canonical) {
|
|
|
4972
5077
|
message: "a scheme with its own clientId names where its account comes from (`account`)",
|
|
4973
5078
|
path: ["account"]
|
|
4974
5079
|
});
|
|
4975
|
-
const PluginAuthSchemeOAuthConfidential =
|
|
5080
|
+
const PluginAuthSchemeOAuthConfidential = z17.strictObject({
|
|
4976
5081
|
...PluginProvisioningField,
|
|
4977
5082
|
...PluginAuthSchemeDescriptionFields,
|
|
4978
5083
|
...PluginAuthSchemeOAuthEndpointFields,
|
|
4979
5084
|
localId: LocalContributionId2,
|
|
4980
|
-
kind:
|
|
4981
|
-
exchange:
|
|
5085
|
+
kind: z17.literal("oauth2"),
|
|
5086
|
+
exchange: z17.literal("confidential"),
|
|
4982
5087
|
/** Absent means `["kay"]` - a confidential exchange's secret may only ever be Bonsai's. */
|
|
4983
|
-
clientSuppliers:
|
|
4984
|
-
scopes:
|
|
5088
|
+
clientSuppliers: z17.tuple([z17.literal("kay")]).optional(),
|
|
5089
|
+
scopes: z17.array(NonEmptyString3).optional(),
|
|
4985
5090
|
/** Where the account comes from (see {@link PluginAuthSchemeAccountLookup}). */
|
|
4986
|
-
account:
|
|
5091
|
+
account: z17.union([PluginAuthSchemeAccountLookup, z17.literal("sign-in")])
|
|
4987
5092
|
});
|
|
4988
|
-
const PluginAuthSchemeOAuth2 =
|
|
5093
|
+
const PluginAuthSchemeOAuth2 = z17.discriminatedUnion("exchange", [
|
|
4989
5094
|
PluginAuthSchemeOAuthPkce,
|
|
4990
5095
|
PluginAuthSchemeOAuthConfidential
|
|
4991
5096
|
]);
|
|
4992
|
-
const PluginAuthSchemeApiKey =
|
|
5097
|
+
const PluginAuthSchemeApiKey = z17.strictObject({
|
|
4993
5098
|
...PluginProvisioningField,
|
|
4994
5099
|
...PluginAuthSchemeDescriptionFields,
|
|
4995
5100
|
localId: LocalContributionId2,
|
|
4996
|
-
kind:
|
|
4997
|
-
scopes:
|
|
5101
|
+
kind: z17.literal("api-key"),
|
|
5102
|
+
scopes: z17.array(NonEmptyString3).optional(),
|
|
4998
5103
|
/** The connect prompt's label for the key. Absent: "<service name> API key". */
|
|
4999
5104
|
inputLabel: NonEmptyString3.optional(),
|
|
5000
5105
|
/** Two or more labeled inputs for a secret that comes in parts; absent asks for one key. */
|
|
5001
|
-
fields:
|
|
5106
|
+
fields: z17.array(z17.strictObject({ id: LocalContributionId2, label: NonEmptyString3 })).min(2).superRefine((fields, ctx) => {
|
|
5002
5107
|
if (new Set(fields.map((field) => field.id)).size !== fields.length) {
|
|
5003
5108
|
ctx.addIssue({
|
|
5004
5109
|
code: "custom",
|
|
@@ -5007,7 +5112,7 @@ function createManifestSchemas(canonical) {
|
|
|
5007
5112
|
}
|
|
5008
5113
|
}).optional(),
|
|
5009
5114
|
/** Where and how the person creates the key outside Bonsai. */
|
|
5010
|
-
setup:
|
|
5115
|
+
setup: z17.strictObject({ instructions: NonEmptyString3, url: HttpsUrl2 }).optional(),
|
|
5011
5116
|
/**
|
|
5012
5117
|
* `"lookup"`: the plugin checks a key before it is saved and names its account, with the function
|
|
5013
5118
|
* it registers (`api.auth.registerAccountLookup`). Absent: the key is saved unchecked, under the
|
|
@@ -5015,27 +5120,27 @@ function createManifestSchemas(canonical) {
|
|
|
5015
5120
|
*/
|
|
5016
5121
|
account: PluginAuthSchemeAccountLookup.optional()
|
|
5017
5122
|
});
|
|
5018
|
-
const PluginAuthSchemeDelegated =
|
|
5123
|
+
const PluginAuthSchemeDelegated = z17.strictObject({
|
|
5019
5124
|
...PluginAuthSchemeDescriptionFields,
|
|
5020
5125
|
localId: LocalContributionId2,
|
|
5021
|
-
kind:
|
|
5022
|
-
scopes:
|
|
5126
|
+
kind: z17.literal("delegated"),
|
|
5127
|
+
scopes: z17.array(NonEmptyString3).optional()
|
|
5023
5128
|
});
|
|
5024
|
-
const ExternalCliArgument =
|
|
5129
|
+
const ExternalCliArgument = z17.string().min(1).max(16384).refine((value) => ![...value].some(isUnsafeArgumentCharacter), {
|
|
5025
5130
|
message: "an argument may hold tabs and line breaks, but no other control character, no invisible character and no bidirectional override"
|
|
5026
5131
|
});
|
|
5027
|
-
const ExternalCliCommand =
|
|
5132
|
+
const ExternalCliCommand = z17.string().max(128).regex(/^[A-Za-z0-9][A-Za-z0-9._+-]*$/, {
|
|
5028
5133
|
message: "a command is an executable's basename (letters, digits, '.', '_', '+', '-'), never a path"
|
|
5029
5134
|
});
|
|
5030
5135
|
const ExternalCliHint = NonEmptyString3.max(2048);
|
|
5031
|
-
const ExternalCliArguments =
|
|
5136
|
+
const ExternalCliArguments = z17.array(ExternalCliArgument).max(64);
|
|
5032
5137
|
const SignedOutMarker = ExternalCliArgument.refine((value) => value.trim() !== "", { message: "a signed-out marker needs text beyond whitespace" });
|
|
5033
|
-
const PluginExternalCliConnect2 =
|
|
5138
|
+
const PluginExternalCliConnect2 = z17.strictObject({
|
|
5034
5139
|
/** A basename the host finds on `PATH` (`osascript`, `wrangler`), never a path. */
|
|
5035
5140
|
binary: ExternalCliCommand,
|
|
5036
|
-
probe:
|
|
5141
|
+
probe: z17.strictObject({
|
|
5037
5142
|
args: ExternalCliArguments.min(1),
|
|
5038
|
-
timeoutMs:
|
|
5143
|
+
timeoutMs: z17.number().int().min(1).max(12e4).optional(),
|
|
5039
5144
|
/**
|
|
5040
5145
|
* The CLI's own signed-out marker: text a failed probe's output (stderr, else stdout) contains
|
|
5041
5146
|
* when the CLI is signed out. A failure that carries it is a sign-in problem, and only such a
|
|
@@ -5043,13 +5148,13 @@ function createManifestSchemas(canonical) {
|
|
|
5043
5148
|
* unavailable. Required when `login` is declared, so a timeout never starts a sign-in. A list
|
|
5044
5149
|
* is for a CLI with several signed-out messages; any one of them counts.
|
|
5045
5150
|
*/
|
|
5046
|
-
signedOutMarker:
|
|
5151
|
+
signedOutMarker: z17.union([SignedOutMarker, z17.array(SignedOutMarker).min(1)]).optional()
|
|
5047
5152
|
}),
|
|
5048
5153
|
/** The CLI's interactive sign-in. Absent: connect only probes and reports. */
|
|
5049
|
-
login:
|
|
5154
|
+
login: z17.strictObject({
|
|
5050
5155
|
args: ExternalCliArguments.min(1),
|
|
5051
|
-
timeoutMs:
|
|
5052
|
-
pasteCode:
|
|
5156
|
+
timeoutMs: z17.number().int().min(1).max(6e5).optional(),
|
|
5157
|
+
pasteCode: z17.strictObject({
|
|
5053
5158
|
/** The redeeming argv; the host appends the code as its last argument. */
|
|
5054
5159
|
args: ExternalCliArguments.min(1),
|
|
5055
5160
|
/** What the prompt says, for a person. */
|
|
@@ -5061,12 +5166,12 @@ function createManifestSchemas(canonical) {
|
|
|
5061
5166
|
* for display, or hands it to an agent session that runs it behind the ordinary bash approval.
|
|
5062
5167
|
* Absent for a binary the OS ships (`osascript`).
|
|
5063
5168
|
*/
|
|
5064
|
-
install:
|
|
5169
|
+
install: z17.strictObject({
|
|
5065
5170
|
command: ExternalCliCommand,
|
|
5066
5171
|
args: ExternalCliArguments
|
|
5067
5172
|
}).optional(),
|
|
5068
5173
|
/** Prose for a person: `install` when the binary is missing, `login` when the probe fails. */
|
|
5069
|
-
hints:
|
|
5174
|
+
hints: z17.strictObject({
|
|
5070
5175
|
install: ExternalCliHint,
|
|
5071
5176
|
login: ExternalCliHint
|
|
5072
5177
|
})
|
|
@@ -5079,50 +5184,50 @@ function createManifestSchemas(canonical) {
|
|
|
5079
5184
|
});
|
|
5080
5185
|
}
|
|
5081
5186
|
});
|
|
5082
|
-
const PluginAuthSchemeExternalCli =
|
|
5187
|
+
const PluginAuthSchemeExternalCli = z17.strictObject({
|
|
5083
5188
|
...PluginAuthSchemeDescriptionFields,
|
|
5084
5189
|
localId: LocalContributionId2,
|
|
5085
|
-
kind:
|
|
5086
|
-
scopes:
|
|
5190
|
+
kind: z17.literal("external-cli"),
|
|
5191
|
+
scopes: z17.array(NonEmptyString3).optional(),
|
|
5087
5192
|
cli: PluginExternalCliConnect2.optional()
|
|
5088
5193
|
});
|
|
5089
|
-
const PluginAuthScheme2 =
|
|
5194
|
+
const PluginAuthScheme2 = z17.discriminatedUnion("kind", [
|
|
5090
5195
|
PluginAuthSchemeOAuth2,
|
|
5091
5196
|
PluginAuthSchemeApiKey,
|
|
5092
5197
|
PluginAuthSchemeDelegated,
|
|
5093
5198
|
PluginAuthSchemeExternalCli
|
|
5094
5199
|
]);
|
|
5095
|
-
const PluginWebSessionProbe2 =
|
|
5200
|
+
const PluginWebSessionProbe2 = z17.strictObject({
|
|
5096
5201
|
url: HttpsUrl2,
|
|
5097
5202
|
/** Absent => `GET`. `POST` sends an empty JSON object body. */
|
|
5098
|
-
method:
|
|
5099
|
-
signedInStatuses:
|
|
5203
|
+
method: z17.enum(["GET", "POST"]).optional(),
|
|
5204
|
+
signedInStatuses: z17.array(SignedInStatusCode2).min(1)
|
|
5100
5205
|
});
|
|
5101
|
-
const PluginWebSessionDeclaration2 =
|
|
5206
|
+
const PluginWebSessionDeclaration2 = z17.strictObject({
|
|
5102
5207
|
/** `required`: capabilities degrade without the site login; `recommended`: it only smooths UX. */
|
|
5103
|
-
importance:
|
|
5208
|
+
importance: z17.enum(["required", "recommended"]),
|
|
5104
5209
|
loginUrl: HttpsUrl2,
|
|
5105
|
-
cookieDomains:
|
|
5210
|
+
cookieDomains: z17.array(RegistrableDomain2).min(1),
|
|
5106
5211
|
probe: PluginWebSessionProbe2,
|
|
5107
|
-
oauthVenue:
|
|
5212
|
+
oauthVenue: z17.enum(["embedded", "external"]),
|
|
5108
5213
|
/**
|
|
5109
5214
|
* Where a page goes first when it opens in one of Bonsai's browser panes and this site login
|
|
5110
5215
|
* is missing: a sign-in page that continues to the page. A template with `:email` and `:url`
|
|
5111
5216
|
* (see `UriClaimTemplate`), on a host within `cookieDomains`.
|
|
5112
5217
|
*/
|
|
5113
|
-
signInFirst:
|
|
5218
|
+
signInFirst: z17.string().optional()
|
|
5114
5219
|
}).superRefine(refineWebSessionScopeConfined);
|
|
5115
|
-
const PluginAuthService2 =
|
|
5220
|
+
const PluginAuthService2 = z17.strictObject({
|
|
5116
5221
|
localId: LocalContributionId2,
|
|
5117
5222
|
displayName: NonEmptyString3,
|
|
5118
5223
|
/** One plain sentence on what connecting this service gives Bonsai. */
|
|
5119
5224
|
summary: NonEmptyString3.optional(),
|
|
5120
|
-
schemes:
|
|
5121
|
-
purposes:
|
|
5225
|
+
schemes: z17.array(PluginAuthScheme2).min(1),
|
|
5226
|
+
purposes: z17.array(NonEmptyString3).min(1),
|
|
5122
5227
|
webSession: PluginWebSessionDeclaration2.optional()
|
|
5123
5228
|
});
|
|
5124
|
-
const PluginAuthManifest2 =
|
|
5125
|
-
services:
|
|
5229
|
+
const PluginAuthManifest2 = z17.strictObject({
|
|
5230
|
+
services: z17.array(PluginAuthService2).optional()
|
|
5126
5231
|
});
|
|
5127
5232
|
function stripRetiredCompatibilityKeys(value) {
|
|
5128
5233
|
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
@@ -5133,17 +5238,17 @@ function createManifestSchemas(canonical) {
|
|
|
5133
5238
|
delete remaining[key];
|
|
5134
5239
|
return remaining;
|
|
5135
5240
|
}
|
|
5136
|
-
const PluginCompatibilityFields =
|
|
5137
|
-
supportedProtocols:
|
|
5241
|
+
const PluginCompatibilityFields = z17.strictObject({
|
|
5242
|
+
supportedProtocols: z17.array(KayPluginProtocolVersion).optional(),
|
|
5138
5243
|
minKayVersion: NonEmptyString3.optional(),
|
|
5139
5244
|
sdk: NonEmptyString3.optional()
|
|
5140
5245
|
});
|
|
5141
|
-
const PluginCompatibilityManifest2 = canonical ? PluginCompatibilityFields :
|
|
5246
|
+
const PluginCompatibilityManifest2 = canonical ? PluginCompatibilityFields : z17.preprocess(stripRetiredCompatibilityKeys, PluginCompatibilityFields);
|
|
5142
5247
|
const KayVersionString2 = NonEmptyString3.regex(SEMVER_PATTERN, {
|
|
5143
5248
|
message: "version must be semver, for example 1.2.3"
|
|
5144
5249
|
});
|
|
5145
|
-
const KayPluginManifestV12 =
|
|
5146
|
-
protocol:
|
|
5250
|
+
const KayPluginManifestV12 = z17.strictObject({
|
|
5251
|
+
protocol: z17.literal(KAY_PLUGIN_PROTOCOL_VERSION),
|
|
5147
5252
|
id: PluginId2,
|
|
5148
5253
|
displayName: NonEmptyString3,
|
|
5149
5254
|
version: KayVersionString2,
|
|
@@ -5171,8 +5276,8 @@ function createManifestSchemas(canonical) {
|
|
|
5171
5276
|
icon: PackageAssetPath2.optional(),
|
|
5172
5277
|
iconDark: PackageAssetPath2.optional(),
|
|
5173
5278
|
namespace: PluginNamespace2.optional(),
|
|
5174
|
-
targets:
|
|
5175
|
-
kay:
|
|
5279
|
+
targets: z17.strictObject({
|
|
5280
|
+
kay: z17.strictObject({
|
|
5176
5281
|
agent: KayAgentTargetManifest2.optional(),
|
|
5177
5282
|
app: KayAppTargetManifest2.optional(),
|
|
5178
5283
|
ui: KayUiTargetManifest2.optional()
|
|
@@ -5180,8 +5285,8 @@ function createManifestSchemas(canonical) {
|
|
|
5180
5285
|
}).optional(),
|
|
5181
5286
|
config: PluginConfigManifest2.optional(),
|
|
5182
5287
|
storage: PluginStorageManifest2.optional(),
|
|
5183
|
-
workloadPurposes:
|
|
5184
|
-
shellCommands:
|
|
5288
|
+
workloadPurposes: z17.array(PluginWorkloadPurpose).optional(),
|
|
5289
|
+
shellCommands: z17.array(PluginShellCommand).optional(),
|
|
5185
5290
|
auth: PluginAuthManifest2.optional(),
|
|
5186
5291
|
permissions: PluginPermissionManifest2.optional(),
|
|
5187
5292
|
compatibility: PluginCompatibilityManifest2.optional(),
|
|
@@ -5191,15 +5296,15 @@ function createManifestSchemas(canonical) {
|
|
|
5191
5296
|
* schemes then report `ownedByBonsai`. Honoured only for a plugin that ships with Bonsai: the
|
|
5192
5297
|
* host reads any other plugin's flag as false. Absent => false.
|
|
5193
5298
|
*/
|
|
5194
|
-
ownedByBonsai:
|
|
5299
|
+
ownedByBonsai: z17.boolean().optional(),
|
|
5195
5300
|
/**
|
|
5196
5301
|
* Explicit plugin-level dependencies - other plugins this plugin requires to be present in the
|
|
5197
5302
|
* composed roster. At composition time the runtime checks each id against the accepted
|
|
5198
5303
|
* registration list and derives a provenance-complete dependency graph (together with implicit
|
|
5199
5304
|
* auth-service edges from `consumesAuthServices`). Absent => no explicit dependencies.
|
|
5200
5305
|
*/
|
|
5201
|
-
dependencies:
|
|
5202
|
-
plugins:
|
|
5306
|
+
dependencies: z17.strictObject({
|
|
5307
|
+
plugins: z17.array(PluginId2).optional()
|
|
5203
5308
|
}).optional()
|
|
5204
5309
|
}).superRefine((manifest, ctx) => {
|
|
5205
5310
|
const sharedWith = manifest.storage?.dataDir?.sharedWith;
|
|
@@ -5460,6 +5565,89 @@ function createManifestSchemas(canonical) {
|
|
|
5460
5565
|
...(manifest.targets?.kay?.ui?.contributes?.pages ?? []).map((page) => page.id),
|
|
5461
5566
|
...(manifest.targets?.kay?.ui?.contributes?.railEntries ?? []).map((entry) => entry.page)
|
|
5462
5567
|
]);
|
|
5568
|
+
const pageAliases = /* @__PURE__ */ new Set();
|
|
5569
|
+
for (const [index, page] of (manifest.targets?.kay?.ui?.contributes?.pages ?? []).entries()) {
|
|
5570
|
+
for (const alias of page.aliases ?? []) {
|
|
5571
|
+
if (declaredPageIds.has(alias) || pageAliases.has(alias)) {
|
|
5572
|
+
ctx.addIssue({
|
|
5573
|
+
code: "custom",
|
|
5574
|
+
path: [
|
|
5575
|
+
"targets",
|
|
5576
|
+
"kay",
|
|
5577
|
+
"ui",
|
|
5578
|
+
"contributes",
|
|
5579
|
+
"pages",
|
|
5580
|
+
index,
|
|
5581
|
+
"aliases"
|
|
5582
|
+
],
|
|
5583
|
+
message: `Page alias ${alias} conflicts with a declared page or alias.`
|
|
5584
|
+
});
|
|
5585
|
+
}
|
|
5586
|
+
pageAliases.add(alias);
|
|
5587
|
+
}
|
|
5588
|
+
}
|
|
5589
|
+
const types = manifest.targets?.kay?.app?.contributes?.whiteboardTypes ?? [];
|
|
5590
|
+
if (types.filter((type) => type.handover === true).length > 1) {
|
|
5591
|
+
ctx.addIssue({
|
|
5592
|
+
code: "custom",
|
|
5593
|
+
path: ["targets", "kay", "app", "contributes", "whiteboardTypes"],
|
|
5594
|
+
message: "A plugin may declare only one handover type."
|
|
5595
|
+
});
|
|
5596
|
+
}
|
|
5597
|
+
const servedSchemes = new Set([
|
|
5598
|
+
...manifest.targets?.kay?.agent?.contributes?.uriModules ?? [],
|
|
5599
|
+
...manifest.targets?.kay?.app?.contributes?.uriModules ?? []
|
|
5600
|
+
].flatMap((module) => module.schemes));
|
|
5601
|
+
for (const [index, type] of types.entries()) {
|
|
5602
|
+
if ((type.directory !== void 0 || type.handover === true) && manifest.targets?.kay?.agent?.familyFolder?.scope !== "root") {
|
|
5603
|
+
ctx.addIssue({
|
|
5604
|
+
code: "custom",
|
|
5605
|
+
path: [
|
|
5606
|
+
"targets",
|
|
5607
|
+
"kay",
|
|
5608
|
+
"app",
|
|
5609
|
+
"contributes",
|
|
5610
|
+
"whiteboardTypes",
|
|
5611
|
+
index,
|
|
5612
|
+
"directory"
|
|
5613
|
+
],
|
|
5614
|
+
message: "A root content directory requires a declared family-folder root role."
|
|
5615
|
+
});
|
|
5616
|
+
}
|
|
5617
|
+
const scheme = type.reference?.uriTemplate.split(":", 1)[0];
|
|
5618
|
+
if (scheme !== void 0 && !servedSchemes.has(scheme)) {
|
|
5619
|
+
ctx.addIssue({
|
|
5620
|
+
code: "custom",
|
|
5621
|
+
path: [
|
|
5622
|
+
"targets",
|
|
5623
|
+
"kay",
|
|
5624
|
+
"app",
|
|
5625
|
+
"contributes",
|
|
5626
|
+
"whiteboardTypes",
|
|
5627
|
+
index,
|
|
5628
|
+
"reference"
|
|
5629
|
+
],
|
|
5630
|
+
message: "A content reference must use a scheme this plugin serves."
|
|
5631
|
+
});
|
|
5632
|
+
}
|
|
5633
|
+
}
|
|
5634
|
+
for (const [index, source] of (manifest.targets?.kay?.app?.contributes?.dataSources ?? []).entries()) {
|
|
5635
|
+
if (source.messageDraft?.schemes.some((scheme) => !servedSchemes.has(scheme))) {
|
|
5636
|
+
ctx.addIssue({
|
|
5637
|
+
code: "custom",
|
|
5638
|
+
path: [
|
|
5639
|
+
"targets",
|
|
5640
|
+
"kay",
|
|
5641
|
+
"app",
|
|
5642
|
+
"contributes",
|
|
5643
|
+
"dataSources",
|
|
5644
|
+
index,
|
|
5645
|
+
"messageDraft"
|
|
5646
|
+
],
|
|
5647
|
+
message: "A message draft projection must use schemes this plugin serves."
|
|
5648
|
+
});
|
|
5649
|
+
}
|
|
5650
|
+
}
|
|
5463
5651
|
for (const [index, presentation] of (manifest.targets?.kay?.ui?.contributes?.referencePresentations ?? []).entries()) {
|
|
5464
5652
|
const path = [
|
|
5465
5653
|
"targets",
|
|
@@ -6007,6 +6195,8 @@ function createManifestSchemas(canonical) {
|
|
|
6007
6195
|
"endpoints",
|
|
6008
6196
|
endpointIndex
|
|
6009
6197
|
];
|
|
6198
|
+
if (typeof endpoint !== "string")
|
|
6199
|
+
continue;
|
|
6010
6200
|
if (!endpointIds.has(endpoint)) {
|
|
6011
6201
|
ctx.addIssue({
|
|
6012
6202
|
code: "custom",
|
|
@@ -6307,7 +6497,7 @@ function pushContributionIds(output, path, items) {
|
|
|
6307
6497
|
}
|
|
6308
6498
|
|
|
6309
6499
|
// packages/plugin-protocol/dist/plugin-directory-verdict.js
|
|
6310
|
-
import { z as
|
|
6500
|
+
import { z as z19 } from "zod";
|
|
6311
6501
|
|
|
6312
6502
|
// packages/plugin-protocol/dist/plugin-load-diagnostic.js
|
|
6313
6503
|
var PLUGIN_DIAGNOSTIC_MESSAGE_CAP = 300;
|
|
@@ -6316,14 +6506,14 @@ function boundPluginDiagnosticMessage(message) {
|
|
|
6316
6506
|
}
|
|
6317
6507
|
|
|
6318
6508
|
// packages/plugin-protocol/dist/resolved-contract.js
|
|
6319
|
-
import { z as
|
|
6509
|
+
import { z as z18 } from "zod";
|
|
6320
6510
|
function createResolvedContractSchemas(canonical) {
|
|
6321
6511
|
const { PluginEventLocalId: PluginEventLocalId2 } = canonical ? canonicalPluginEventSchemas : plugin_events_exports;
|
|
6322
|
-
const { ApprovalTypeContribution: ApprovalTypeContribution2, KayUiAppHostCapability: KayUiAppHostCapability2, McpServerAuthMode: McpServerAuthMode2, McpServerUrl: McpServerUrl2, PluginContributionKind: PluginContributionKindSchema, ReferenceOpenBehavior: ReferenceOpenBehavior2, ReferencePresentationUriPattern: ReferencePresentationUriPattern2, ReferencePresentationAccountLinks: ReferencePresentationAccountLinks2, ReferencePresentationAddress: ReferencePresentationAddress2, ReferencePresentationUrlClaim: ReferencePresentationUrlClaim2, ReferencePresentationVariants: ReferencePresentationVariants2, ReferencePresentationWords: ReferencePresentationWords2, UriModuleFacts: UriModuleFacts2,
|
|
6512
|
+
const { ApprovalTypeContribution: ApprovalTypeContribution2, KayUiAppHostCapability: KayUiAppHostCapability2, McpServerAuthMode: McpServerAuthMode2, McpServerUrl: McpServerUrl2, PluginContributionKind: PluginContributionKindSchema, ReferenceOpenBehavior: ReferenceOpenBehavior2, ReferencePresentationUriPattern: ReferencePresentationUriPattern2, ReferencePresentationAccountLinks: ReferencePresentationAccountLinks2, ReferencePresentationAddress: ReferencePresentationAddress2, ReferencePresentationUrlClaim: ReferencePresentationUrlClaim2, ReferencePresentationVariants: ReferencePresentationVariants2, ReferencePresentationWords: ReferencePresentationWords2, UriModuleFacts: UriModuleFacts2, WhiteboardTypeContribution: WhiteboardTypeContribution2 } = canonical ? canonicalContributionSchemas : contributions_exports;
|
|
6323
6513
|
const { FileExtensionToken: FileExtensionToken2, GitBasicAuthUser: GitBasicAuthUser2, GitHostName: GitHostName2, GlobalContributionId: GlobalContributionId2, HttpsUrl: HttpsUrl2, LocalContributionId: LocalContributionId2, MimeTypeString: MimeTypeString2, NonEmptyString: NonEmptyString3, PackageAssetPath: PackageAssetPath2, PluginId: PluginId2, PluginNamespace: PluginNamespace2, PluginToolName: PluginToolName2, RegistrableDomain: RegistrableDomain2, SignedInStatusCode: SignedInStatusCode2, TargetEntrypoint: TargetEntrypoint2, UriScheme: UriScheme2 } = canonical ? canonicalCommonSchemas : common_exports;
|
|
6324
6514
|
const { PluginExternalCliConnect: PluginExternalCliConnect2, PluginOAuthClientSupplier: PluginOAuthClientSupplier2 } = canonical ? canonicalManifestSchemas : manifest_exports;
|
|
6325
6515
|
const { ResolvedPluginGrants: ResolvedPluginGrants2 } = canonical ? canonicalPermissionSchemas : permissions_exports;
|
|
6326
|
-
const ResolvedPluginContributionId2 =
|
|
6516
|
+
const ResolvedPluginContributionId2 = z18.strictObject({
|
|
6327
6517
|
target: PluginTargetName,
|
|
6328
6518
|
kind: PluginContributionKindSchema,
|
|
6329
6519
|
localId: PluginEventLocalId2,
|
|
@@ -6337,54 +6527,55 @@ function createResolvedContractSchemas(canonical) {
|
|
|
6337
6527
|
});
|
|
6338
6528
|
}
|
|
6339
6529
|
});
|
|
6340
|
-
const ResolvedKayToolId =
|
|
6530
|
+
const ResolvedKayToolId = z18.strictObject({
|
|
6341
6531
|
localId: LocalContributionId2,
|
|
6342
6532
|
globalId: GlobalContributionId2,
|
|
6343
6533
|
toolName: PluginToolName2
|
|
6344
6534
|
});
|
|
6345
|
-
const ResolvedKayAgentTool2 =
|
|
6535
|
+
const ResolvedKayAgentTool2 = z18.strictObject({
|
|
6346
6536
|
...ResolvedKayToolId.shape,
|
|
6347
6537
|
displayName: NonEmptyString3.optional(),
|
|
6348
6538
|
description: NonEmptyString3.optional(),
|
|
6349
6539
|
parameters: JsonSchema.optional(),
|
|
6350
|
-
executionMode:
|
|
6540
|
+
executionMode: z18.enum(["sequential", "parallel"]).optional(),
|
|
6351
6541
|
promptSnippet: NonEmptyString3.optional(),
|
|
6352
|
-
promptGuidelines:
|
|
6353
|
-
requiresAuth:
|
|
6542
|
+
promptGuidelines: z18.array(NonEmptyString3).optional(),
|
|
6543
|
+
requiresAuth: z18.strictObject({
|
|
6354
6544
|
serviceId: GlobalContributionId2,
|
|
6355
6545
|
schemeId: GlobalContributionId2.optional()
|
|
6356
6546
|
}).optional(),
|
|
6357
6547
|
permission: canonical ? canonicalContributionSchemas.ToolPermission.optional() : ToolPermission.optional()
|
|
6358
6548
|
});
|
|
6359
6549
|
const ResolvedKayAppTool2 = ResolvedKayAgentTool2.omit({ requiresAuth: true });
|
|
6360
|
-
const ResolvedKayAppDataSource2 =
|
|
6550
|
+
const ResolvedKayAppDataSource2 = z18.strictObject({
|
|
6361
6551
|
localId: LocalContributionId2,
|
|
6362
6552
|
globalId: GlobalContributionId2,
|
|
6363
|
-
scope:
|
|
6364
|
-
snapshot:
|
|
6365
|
-
version:
|
|
6366
|
-
schema:
|
|
6553
|
+
scope: z18.enum(["runtime", "account", "session"]),
|
|
6554
|
+
snapshot: z18.strictObject({
|
|
6555
|
+
version: z18.number().int().positive(),
|
|
6556
|
+
schema: z18.record(z18.string(), z18.unknown())
|
|
6367
6557
|
}),
|
|
6368
|
-
change:
|
|
6369
|
-
version:
|
|
6370
|
-
schema:
|
|
6371
|
-
semantics:
|
|
6372
|
-
|
|
6373
|
-
|
|
6374
|
-
kind:
|
|
6375
|
-
maxEncodedBytes:
|
|
6558
|
+
change: z18.strictObject({
|
|
6559
|
+
version: z18.number().int().positive(),
|
|
6560
|
+
schema: z18.record(z18.string(), z18.unknown()),
|
|
6561
|
+
semantics: z18.discriminatedUnion("kind", [
|
|
6562
|
+
z18.strictObject({ kind: z18.literal("incremental") }),
|
|
6563
|
+
z18.strictObject({
|
|
6564
|
+
kind: z18.literal("snapshot-replacement"),
|
|
6565
|
+
maxEncodedBytes: z18.number().int().positive(),
|
|
6376
6566
|
rationale: pluginString(canonical).min(1).max(1024)
|
|
6377
6567
|
})
|
|
6378
6568
|
]).optional()
|
|
6379
6569
|
}),
|
|
6380
6570
|
read: AppDataSourceRead.optional(),
|
|
6381
|
-
|
|
6382
|
-
|
|
6383
|
-
|
|
6384
|
-
|
|
6385
|
-
|
|
6571
|
+
messageDraft: z18.strictObject({ schemes: z18.array(UriScheme2).min(1) }).optional(),
|
|
6572
|
+
store: z18.discriminatedUnion("shape", [
|
|
6573
|
+
z18.strictObject({
|
|
6574
|
+
shape: z18.literal("rows"),
|
|
6575
|
+
rowsField: z18.string().min(1),
|
|
6576
|
+
key: z18.array(z18.string().min(1)).min(1)
|
|
6386
6577
|
}),
|
|
6387
|
-
|
|
6578
|
+
z18.strictObject({ shape: z18.literal("value") })
|
|
6388
6579
|
]).optional()
|
|
6389
6580
|
}).superRefine((source, ctx) => {
|
|
6390
6581
|
if (source.read !== void 0 && source.scope !== "session") {
|
|
@@ -6404,127 +6595,122 @@ function createResolvedContractSchemas(canonical) {
|
|
|
6404
6595
|
/** The auth service that module signs in through, whose accounts a card may send from. */
|
|
6405
6596
|
authService: GlobalContributionId2.optional()
|
|
6406
6597
|
});
|
|
6407
|
-
const ResolvedPluginCard2 =
|
|
6598
|
+
const ResolvedPluginCard2 = z18.strictObject({
|
|
6408
6599
|
localId: LocalContributionId2,
|
|
6409
6600
|
globalId: GlobalContributionId2,
|
|
6410
6601
|
pluginId: PluginId2,
|
|
6411
6602
|
description: NonEmptyString3,
|
|
6412
6603
|
inputs: JsonSchema,
|
|
6413
|
-
readEndpoint:
|
|
6604
|
+
readEndpoint: z18.strictObject({
|
|
6414
6605
|
localId: LocalContributionId2,
|
|
6415
6606
|
globalId: GlobalContributionId2
|
|
6416
6607
|
}),
|
|
6417
|
-
submitEndpoint:
|
|
6608
|
+
submitEndpoint: z18.strictObject({
|
|
6418
6609
|
localId: LocalContributionId2,
|
|
6419
6610
|
globalId: GlobalContributionId2
|
|
6420
6611
|
}),
|
|
6421
6612
|
authService: GlobalContributionId2.optional()
|
|
6422
6613
|
});
|
|
6423
|
-
const ResolvedKayAppWorkflow2 =
|
|
6614
|
+
const ResolvedKayAppWorkflow2 = z18.strictObject({
|
|
6424
6615
|
localId: LocalContributionId2,
|
|
6425
6616
|
globalId: GlobalContributionId2,
|
|
6426
6617
|
name: NonEmptyString3,
|
|
6427
6618
|
description: NonEmptyString3,
|
|
6428
|
-
everyMs:
|
|
6429
|
-
auth:
|
|
6619
|
+
everyMs: z18.number().int().positive(),
|
|
6620
|
+
auth: z18.strictObject({
|
|
6430
6621
|
serviceId: GlobalContributionId2,
|
|
6431
6622
|
schemeId: GlobalContributionId2,
|
|
6432
|
-
scopes:
|
|
6623
|
+
scopes: z18.array(NonEmptyString3).min(1).optional()
|
|
6433
6624
|
}).optional()
|
|
6434
6625
|
});
|
|
6435
|
-
const ResolvedKayAppWhiteboardType2 =
|
|
6436
|
-
|
|
6437
|
-
globalId: GlobalContributionId2,
|
|
6438
|
-
displayName: NonEmptyString3,
|
|
6439
|
-
schemaVersion: z17.number().int().positive(),
|
|
6440
|
-
storage: WhiteboardTypeStorage2,
|
|
6441
|
-
valueSchema: JsonSchema
|
|
6626
|
+
const ResolvedKayAppWhiteboardType2 = WhiteboardTypeContribution2.safeExtend({
|
|
6627
|
+
globalId: GlobalContributionId2
|
|
6442
6628
|
});
|
|
6443
|
-
const ResolvedKayAppMcpServer2 =
|
|
6629
|
+
const ResolvedKayAppMcpServer2 = z18.strictObject({
|
|
6444
6630
|
name: LocalContributionId2,
|
|
6445
6631
|
pluginId: PluginId2,
|
|
6446
6632
|
url: McpServerUrl2,
|
|
6447
6633
|
auth: McpServerAuthMode2,
|
|
6448
6634
|
authServiceId: GlobalContributionId2.optional()
|
|
6449
6635
|
});
|
|
6450
|
-
const ResolvedKayAgentUriModule2 =
|
|
6636
|
+
const ResolvedKayAgentUriModule2 = z18.strictObject({
|
|
6451
6637
|
localId: LocalContributionId2,
|
|
6452
6638
|
globalId: GlobalContributionId2,
|
|
6453
|
-
schemes:
|
|
6639
|
+
schemes: z18.array(UriScheme2).min(1),
|
|
6454
6640
|
displayName: NonEmptyString3.optional(),
|
|
6455
6641
|
authServiceId: GlobalContributionId2.optional(),
|
|
6456
6642
|
/** Mirrors `UriModuleContribution.authScheme`; a local ref takes the plugin's namespace. */
|
|
6457
6643
|
authSchemeId: GlobalContributionId2.optional(),
|
|
6458
6644
|
/** Mirrors `UriModuleContribution.knownResources` (host-side recording opt-in). */
|
|
6459
|
-
knownResources:
|
|
6645
|
+
knownResources: z18.literal(true).optional(),
|
|
6460
6646
|
/** Mirrors `UriModuleContribution.describesOperations`. */
|
|
6461
|
-
describesOperations:
|
|
6647
|
+
describesOperations: z18.literal(true).optional(),
|
|
6462
6648
|
/** Mirrors `UriModuleContribution.looksUpWebLinks`. */
|
|
6463
|
-
looksUpWebLinks:
|
|
6649
|
+
looksUpWebLinks: z18.literal(true).optional(),
|
|
6464
6650
|
...UriModuleFacts2.shape
|
|
6465
6651
|
});
|
|
6466
|
-
const ResolvedKayAgentArtifactUriModule2 =
|
|
6652
|
+
const ResolvedKayAgentArtifactUriModule2 = z18.strictObject({
|
|
6467
6653
|
localId: LocalContributionId2,
|
|
6468
6654
|
globalId: GlobalContributionId2,
|
|
6469
6655
|
scheme: UriScheme2,
|
|
6470
|
-
editable:
|
|
6471
|
-
listable:
|
|
6472
|
-
deletable:
|
|
6473
|
-
appendable:
|
|
6474
|
-
storageScope:
|
|
6656
|
+
editable: z18.boolean(),
|
|
6657
|
+
listable: z18.boolean(),
|
|
6658
|
+
deletable: z18.boolean(),
|
|
6659
|
+
appendable: z18.boolean(),
|
|
6660
|
+
storageScope: z18.enum(["session", "family"])
|
|
6475
6661
|
});
|
|
6476
|
-
const ResolvedKayAgentEntityResolver2 =
|
|
6662
|
+
const ResolvedKayAgentEntityResolver2 = z18.strictObject({
|
|
6477
6663
|
localId: LocalContributionId2,
|
|
6478
6664
|
globalId: GlobalContributionId2,
|
|
6479
6665
|
displayName: NonEmptyString3.optional(),
|
|
6480
6666
|
uriModule: GlobalContributionId2,
|
|
6481
|
-
entityTypes:
|
|
6667
|
+
entityTypes: z18.array(NonEmptyString3).min(1),
|
|
6482
6668
|
uriHint: NonEmptyString3
|
|
6483
6669
|
});
|
|
6484
|
-
const ResolvedKayAgentGitHostClaim2 =
|
|
6670
|
+
const ResolvedKayAgentGitHostClaim2 = z18.strictObject({
|
|
6485
6671
|
host: GitHostName2,
|
|
6486
6672
|
authServiceId: GlobalContributionId2,
|
|
6487
6673
|
/** Manifest-declared order; the clone ladder tries them in sequence. */
|
|
6488
|
-
authSchemeIds:
|
|
6674
|
+
authSchemeIds: z18.array(GlobalContributionId2).min(1),
|
|
6489
6675
|
/** Non-secret display copy for the claiming service, for clone failure text. */
|
|
6490
|
-
authServiceDisplayName:
|
|
6676
|
+
authServiceDisplayName: z18.string(),
|
|
6491
6677
|
basicAuthUser: GitBasicAuthUser2
|
|
6492
6678
|
});
|
|
6493
|
-
const ResolvedKayAgentConverter2 =
|
|
6679
|
+
const ResolvedKayAgentConverter2 = z18.strictObject({
|
|
6494
6680
|
localId: LocalContributionId2,
|
|
6495
6681
|
globalId: GlobalContributionId2,
|
|
6496
6682
|
description: NonEmptyString3.optional(),
|
|
6497
|
-
mimeTypes:
|
|
6498
|
-
extensions:
|
|
6683
|
+
mimeTypes: z18.array(MimeTypeString2).min(1),
|
|
6684
|
+
extensions: z18.array(FileExtensionToken2).min(1).optional()
|
|
6499
6685
|
});
|
|
6500
6686
|
const ResolvedReferencePresentationUrlClaim = ReferencePresentationUrlClaim2.extend({
|
|
6501
|
-
brandIcon:
|
|
6687
|
+
brandIcon: z18.string().max(64 * 1024).optional()
|
|
6502
6688
|
});
|
|
6503
|
-
const ResolvedReferencePresentation2 =
|
|
6689
|
+
const ResolvedReferencePresentation2 = z18.strictObject({
|
|
6504
6690
|
localId: LocalContributionId2,
|
|
6505
6691
|
globalId: GlobalContributionId2,
|
|
6506
6692
|
uriModule: GlobalContributionId2.optional(),
|
|
6507
6693
|
/** The schemes this presentation is about: its `scheme`, or its module's. */
|
|
6508
|
-
schemes:
|
|
6694
|
+
schemes: z18.array(UriScheme2).min(1).optional(),
|
|
6509
6695
|
/** The module's `displayName`: the source's name in a row. */
|
|
6510
6696
|
displayName: NonEmptyString3.optional(),
|
|
6511
6697
|
/** The module's auth service, qualified: whose accounts `accountLinks` reads. */
|
|
6512
6698
|
authService: GlobalContributionId2.optional(),
|
|
6513
6699
|
accountLinks: ReferencePresentationAccountLinks2.optional(),
|
|
6514
|
-
addresses:
|
|
6700
|
+
addresses: z18.array(ReferencePresentationAddress2).min(1).optional(),
|
|
6515
6701
|
/** Comes with `open`. A presentation with neither only words its module's addresses. */
|
|
6516
6702
|
resourceKind: NonEmptyString3.optional(),
|
|
6517
6703
|
open: ReferenceOpenBehavior2.optional(),
|
|
6518
6704
|
/** MIME-specific resource kinds; absent keys use the base presentation. */
|
|
6519
6705
|
variants: ReferencePresentationVariants2.optional(),
|
|
6520
|
-
claims:
|
|
6521
|
-
tooltip:
|
|
6706
|
+
claims: z18.array(ResolvedReferencePresentationUrlClaim).optional(),
|
|
6707
|
+
tooltip: z18.strictObject({
|
|
6522
6708
|
app: GlobalContributionId2,
|
|
6523
6709
|
pattern: ReferencePresentationUriPattern2
|
|
6524
6710
|
}).optional(),
|
|
6525
6711
|
words: ReferencePresentationWords2.optional()
|
|
6526
6712
|
});
|
|
6527
|
-
const ResolvedPluginProvisioningRequirement2 =
|
|
6713
|
+
const ResolvedPluginProvisioningRequirement2 = z18.strictObject({
|
|
6528
6714
|
id: LocalContributionId2,
|
|
6529
6715
|
displayName: NonEmptyString3,
|
|
6530
6716
|
description: NonEmptyString3,
|
|
@@ -6534,15 +6720,15 @@ function createResolvedContractSchemas(canonical) {
|
|
|
6534
6720
|
* URL degrades to "Reconnect" in the UI instead of a broken link.
|
|
6535
6721
|
*/
|
|
6536
6722
|
remediationUrl: HttpsUrl2.optional(),
|
|
6537
|
-
probe:
|
|
6723
|
+
probe: z18.strictObject({
|
|
6538
6724
|
url: HttpsUrl2,
|
|
6539
|
-
method:
|
|
6540
|
-
verdictStatuses:
|
|
6725
|
+
method: z18.enum(["GET"]),
|
|
6726
|
+
verdictStatuses: z18.array(SignedInStatusCode2).min(1),
|
|
6541
6727
|
nonEmptyArrayAt: NonEmptyString3.optional()
|
|
6542
6728
|
})
|
|
6543
6729
|
});
|
|
6544
6730
|
const ResolvedProvisioningField = {
|
|
6545
|
-
provisioning:
|
|
6731
|
+
provisioning: z18.array(ResolvedPluginProvisioningRequirement2).optional()
|
|
6546
6732
|
};
|
|
6547
6733
|
const ResolvedPluginAuthSchemeDescriptionFields = {
|
|
6548
6734
|
displayName: NonEmptyString3.optional(),
|
|
@@ -6554,115 +6740,118 @@ function createResolvedContractSchemas(canonical) {
|
|
|
6554
6740
|
...ResolvedPluginAuthSchemeDescriptionFields,
|
|
6555
6741
|
localId: LocalContributionId2,
|
|
6556
6742
|
globalId: GlobalContributionId2,
|
|
6557
|
-
kind:
|
|
6558
|
-
scopes:
|
|
6743
|
+
kind: z18.literal("oauth2"),
|
|
6744
|
+
scopes: z18.array(z18.string()).optional(),
|
|
6559
6745
|
authorizationUrl: HttpsUrl2,
|
|
6560
6746
|
tokenUrl: HttpsUrl2,
|
|
6561
|
-
extraAuthorizeParams:
|
|
6747
|
+
extraAuthorizeParams: z18.record(z18.string(), z18.string()).optional()
|
|
6562
6748
|
};
|
|
6563
|
-
const ResolvedPluginAuthSchemeOAuthPkce =
|
|
6749
|
+
const ResolvedPluginAuthSchemeOAuthPkce = z18.strictObject({
|
|
6564
6750
|
...ResolvedPluginAuthSchemeOAuthBase,
|
|
6565
|
-
exchange:
|
|
6751
|
+
exchange: z18.literal("pkce"),
|
|
6566
6752
|
byoocProfile: PluginByoocProfile.optional(),
|
|
6567
|
-
clientSuppliers:
|
|
6753
|
+
clientSuppliers: z18.array(PluginOAuthClientSupplier2).nonempty(),
|
|
6568
6754
|
clientId: NonEmptyString3.optional(),
|
|
6569
6755
|
clientSecret: NonEmptyString3.optional(),
|
|
6570
|
-
account:
|
|
6756
|
+
account: z18.literal("lookup").optional()
|
|
6571
6757
|
});
|
|
6572
|
-
const ResolvedPluginAuthSchemeOAuthConfidential =
|
|
6758
|
+
const ResolvedPluginAuthSchemeOAuthConfidential = z18.strictObject({
|
|
6573
6759
|
...ResolvedPluginAuthSchemeOAuthBase,
|
|
6574
|
-
exchange:
|
|
6575
|
-
clientSuppliers:
|
|
6576
|
-
account:
|
|
6760
|
+
exchange: z18.literal("confidential"),
|
|
6761
|
+
clientSuppliers: z18.tuple([z18.literal("kay")]),
|
|
6762
|
+
account: z18.enum(["lookup", "sign-in"])
|
|
6577
6763
|
});
|
|
6578
|
-
const ResolvedPluginAuthSchemeOAuth2 =
|
|
6764
|
+
const ResolvedPluginAuthSchemeOAuth2 = z18.discriminatedUnion("exchange", [
|
|
6579
6765
|
ResolvedPluginAuthSchemeOAuthPkce,
|
|
6580
6766
|
ResolvedPluginAuthSchemeOAuthConfidential
|
|
6581
6767
|
]);
|
|
6582
|
-
const ResolvedPluginAuthSchemeApiKey =
|
|
6768
|
+
const ResolvedPluginAuthSchemeApiKey = z18.strictObject({
|
|
6583
6769
|
...ResolvedProvisioningField,
|
|
6584
6770
|
...ResolvedPluginAuthSchemeDescriptionFields,
|
|
6585
6771
|
localId: LocalContributionId2,
|
|
6586
6772
|
globalId: GlobalContributionId2,
|
|
6587
|
-
kind:
|
|
6588
|
-
scopes:
|
|
6773
|
+
kind: z18.literal("api-key"),
|
|
6774
|
+
scopes: z18.array(z18.string()).optional(),
|
|
6589
6775
|
/** Resolution applies the manifest's default, "<service name> API key". */
|
|
6590
6776
|
inputLabel: NonEmptyString3,
|
|
6591
|
-
fields:
|
|
6592
|
-
setup:
|
|
6593
|
-
account:
|
|
6777
|
+
fields: z18.array(z18.strictObject({ id: z18.string(), label: z18.string() })).optional(),
|
|
6778
|
+
setup: z18.strictObject({ instructions: z18.string(), url: HttpsUrl2 }).optional(),
|
|
6779
|
+
account: z18.literal("lookup").optional()
|
|
6594
6780
|
});
|
|
6595
|
-
const ResolvedPluginAuthSchemeDelegated =
|
|
6781
|
+
const ResolvedPluginAuthSchemeDelegated = z18.strictObject({
|
|
6596
6782
|
...ResolvedPluginAuthSchemeDescriptionFields,
|
|
6597
6783
|
localId: LocalContributionId2,
|
|
6598
6784
|
globalId: GlobalContributionId2,
|
|
6599
|
-
kind:
|
|
6600
|
-
scopes:
|
|
6785
|
+
kind: z18.literal("delegated"),
|
|
6786
|
+
scopes: z18.array(z18.string()).optional()
|
|
6601
6787
|
});
|
|
6602
|
-
const ResolvedPluginAuthSchemeExternalCli =
|
|
6788
|
+
const ResolvedPluginAuthSchemeExternalCli = z18.strictObject({
|
|
6603
6789
|
...ResolvedPluginAuthSchemeDescriptionFields,
|
|
6604
6790
|
localId: LocalContributionId2,
|
|
6605
6791
|
globalId: GlobalContributionId2,
|
|
6606
|
-
kind:
|
|
6607
|
-
scopes:
|
|
6792
|
+
kind: z18.literal("external-cli"),
|
|
6793
|
+
scopes: z18.array(z18.string()).optional(),
|
|
6608
6794
|
/** The manifest's connect facts, verbatim. */
|
|
6609
6795
|
cli: PluginExternalCliConnect2.optional()
|
|
6610
6796
|
});
|
|
6611
|
-
const ResolvedPluginAuthScheme2 =
|
|
6797
|
+
const ResolvedPluginAuthScheme2 = z18.discriminatedUnion("kind", [
|
|
6612
6798
|
ResolvedPluginAuthSchemeOAuth2,
|
|
6613
6799
|
ResolvedPluginAuthSchemeApiKey,
|
|
6614
6800
|
ResolvedPluginAuthSchemeDelegated,
|
|
6615
6801
|
ResolvedPluginAuthSchemeExternalCli
|
|
6616
6802
|
]);
|
|
6617
|
-
const ResolvedPluginWebSession2 =
|
|
6618
|
-
importance:
|
|
6803
|
+
const ResolvedPluginWebSession2 = z18.strictObject({
|
|
6804
|
+
importance: z18.enum(["required", "recommended"]),
|
|
6619
6805
|
loginUrl: HttpsUrl2,
|
|
6620
|
-
cookieDomains:
|
|
6621
|
-
probe:
|
|
6806
|
+
cookieDomains: z18.array(RegistrableDomain2).min(1),
|
|
6807
|
+
probe: z18.strictObject({
|
|
6622
6808
|
url: HttpsUrl2,
|
|
6623
|
-
method:
|
|
6624
|
-
signedInStatuses:
|
|
6809
|
+
method: z18.enum(["GET", "POST"]),
|
|
6810
|
+
signedInStatuses: z18.array(SignedInStatusCode2).min(1)
|
|
6625
6811
|
}),
|
|
6626
|
-
oauthVenue:
|
|
6627
|
-
signInFirst:
|
|
6812
|
+
oauthVenue: z18.enum(["embedded", "external"]),
|
|
6813
|
+
signInFirst: z18.string().optional()
|
|
6628
6814
|
}).superRefine(refineWebSessionScopeConfined);
|
|
6629
|
-
const ResolvedPluginAuthService2 =
|
|
6815
|
+
const ResolvedPluginAuthService2 = z18.strictObject({
|
|
6630
6816
|
localId: LocalContributionId2,
|
|
6631
6817
|
globalId: GlobalContributionId2,
|
|
6632
|
-
displayName:
|
|
6633
|
-
summary:
|
|
6634
|
-
schemes:
|
|
6635
|
-
purposes:
|
|
6818
|
+
displayName: z18.string(),
|
|
6819
|
+
summary: z18.string().optional(),
|
|
6820
|
+
schemes: z18.array(ResolvedPluginAuthScheme2).min(1),
|
|
6821
|
+
purposes: z18.array(z18.string()).min(1),
|
|
6636
6822
|
/** The service's browser half, when the manifest declares one. */
|
|
6637
6823
|
webSession: ResolvedPluginWebSession2.optional()
|
|
6638
6824
|
});
|
|
6639
|
-
const ResolvedKayUiAppEndpointCapability2 =
|
|
6640
|
-
|
|
6641
|
-
|
|
6642
|
-
|
|
6643
|
-
|
|
6825
|
+
const ResolvedKayUiAppEndpointCapability2 = z18.union([
|
|
6826
|
+
z18.strictObject({
|
|
6827
|
+
localId: LocalContributionId2,
|
|
6828
|
+
globalId: GlobalContributionId2
|
|
6829
|
+
}),
|
|
6830
|
+
z18.strictObject({ pluginId: PluginId2, localId: LocalContributionId2 })
|
|
6831
|
+
]);
|
|
6832
|
+
const ResolvedKayUiApp2 = z18.strictObject({
|
|
6644
6833
|
localId: LocalContributionId2,
|
|
6645
6834
|
globalId: GlobalContributionId2,
|
|
6646
6835
|
displayName: NonEmptyString3,
|
|
6647
|
-
contextOnly:
|
|
6836
|
+
contextOnly: z18.literal(true).optional(),
|
|
6648
6837
|
description: NonEmptyString3.optional(),
|
|
6649
6838
|
icon: PackageAssetPath2.optional(),
|
|
6650
|
-
runtime:
|
|
6651
|
-
sdk:
|
|
6839
|
+
runtime: z18.literal("kay.react-app.v1"),
|
|
6840
|
+
sdk: z18.strictObject({ range: NonEmptyString3 }),
|
|
6652
6841
|
entrypoint: TargetEntrypoint2,
|
|
6653
|
-
styles:
|
|
6654
|
-
assets:
|
|
6655
|
-
capabilities:
|
|
6656
|
-
endpoints:
|
|
6657
|
-
host:
|
|
6658
|
-
feeds:
|
|
6842
|
+
styles: z18.array(PackageAssetPath2).optional(),
|
|
6843
|
+
assets: z18.array(PackageAssetPath2).optional(),
|
|
6844
|
+
capabilities: z18.strictObject({
|
|
6845
|
+
endpoints: z18.array(ResolvedKayUiAppEndpointCapability2).optional(),
|
|
6846
|
+
host: z18.array(KayUiAppHostCapability2).optional(),
|
|
6847
|
+
feeds: z18.array((canonical ? canonicalContributionSchemas : contributions_exports).UiAppCapabilityReference).optional()
|
|
6659
6848
|
}).optional()
|
|
6660
6849
|
});
|
|
6661
|
-
const ResolvedPluginContractV12 =
|
|
6662
|
-
protocol:
|
|
6850
|
+
const ResolvedPluginContractV12 = z18.strictObject({
|
|
6851
|
+
protocol: z18.literal("kay.plugin.v1"),
|
|
6663
6852
|
pluginId: PluginId2,
|
|
6664
6853
|
namespace: PluginNamespace2,
|
|
6665
|
-
contributions:
|
|
6854
|
+
contributions: z18.array(ResolvedPluginContributionId2),
|
|
6666
6855
|
// The deduplicated set of qualified (dotted) external auth-service ids this
|
|
6667
6856
|
// plugin references, from agent uriModule, tool and cliBinding
|
|
6668
6857
|
// `authService` refs, card sign-in refs, and auth-grant `service` refs. Always present - a plugin
|
|
@@ -6670,38 +6859,39 @@ function createResolvedContractSchemas(canonical) {
|
|
|
6670
6859
|
// is a recorded dependency, not a resolution: there is no runtime plugin
|
|
6671
6860
|
// loader in v1, so nothing here verifies the reference resolves within a
|
|
6672
6861
|
// composed roster (a composition-time concern owned elsewhere).
|
|
6673
|
-
consumesAuthServices:
|
|
6862
|
+
consumesAuthServices: z18.array(GlobalContributionId2),
|
|
6674
6863
|
// The explicit plugin-level dependency ids declared in `dependencies.plugins` on the manifest,
|
|
6675
6864
|
// deduped and validated at parse time. Always present; a plugin with no explicit dependencies
|
|
6676
6865
|
// carries an empty array. Composition checks each id against the accepted roster and derives the
|
|
6677
6866
|
// full dependency graph together with auth-inferred edges from `consumesAuthServices`.
|
|
6678
|
-
explicitDependencies:
|
|
6867
|
+
explicitDependencies: z18.array(PluginId2),
|
|
6679
6868
|
dataDirSharedWith: PluginId2.optional(),
|
|
6680
|
-
workloadPurposes:
|
|
6681
|
-
shellCommands:
|
|
6869
|
+
workloadPurposes: z18.array(PluginWorkloadPurpose).optional(),
|
|
6870
|
+
shellCommands: z18.array(PluginShellCommand.omit({ endpoint: true }).extend({
|
|
6682
6871
|
endpointId: GlobalContributionId2
|
|
6683
6872
|
})).optional(),
|
|
6684
6873
|
// The auth services this plugin OWNS, carrying the global ids its harness
|
|
6685
6874
|
// target must register and the credential authority keys on. Always present;
|
|
6686
6875
|
// a plugin that declares no `auth.services` carries an empty array. The dual
|
|
6687
6876
|
// of `consumesAuthServices` (services it merely references).
|
|
6688
|
-
authServices:
|
|
6877
|
+
authServices: z18.array(ResolvedPluginAuthService2),
|
|
6689
6878
|
grants: ResolvedPluginGrants2.optional(),
|
|
6690
|
-
|
|
6691
|
-
|
|
6692
|
-
|
|
6693
|
-
|
|
6694
|
-
|
|
6695
|
-
|
|
6696
|
-
|
|
6697
|
-
|
|
6698
|
-
|
|
6699
|
-
|
|
6700
|
-
|
|
6701
|
-
|
|
6702
|
-
|
|
6703
|
-
|
|
6704
|
-
|
|
6879
|
+
kayAgentFamilyFolder: z18.strictObject({ scope: z18.literal("root") }).optional(),
|
|
6880
|
+
kayAgentUriModules: z18.array(ResolvedKayAgentUriModule2).optional(),
|
|
6881
|
+
kayAgentArtifactUriModules: z18.array(ResolvedKayAgentArtifactUriModule2).optional(),
|
|
6882
|
+
kayAgentEntityResolvers: z18.array(ResolvedKayAgentEntityResolver2).optional(),
|
|
6883
|
+
kayAgentGitHostClaims: z18.array(ResolvedKayAgentGitHostClaim2).optional(),
|
|
6884
|
+
kayAgentTools: z18.array(ResolvedKayAgentTool2).optional(),
|
|
6885
|
+
kayAppTools: z18.array(ResolvedKayAppTool2).optional(),
|
|
6886
|
+
kayAppApprovalTypes: z18.array(ResolvedKayAppApprovalType2).optional(),
|
|
6887
|
+
kayAppWorkflows: z18.array(ResolvedKayAppWorkflow2).optional(),
|
|
6888
|
+
kayAppCards: z18.array(ResolvedPluginCard2).optional(),
|
|
6889
|
+
kayAppDataSources: z18.array(ResolvedKayAppDataSource2).optional(),
|
|
6890
|
+
kayAppWhiteboardTypes: z18.array(ResolvedKayAppWhiteboardType2).optional(),
|
|
6891
|
+
kayAppMcpServers: z18.array(ResolvedKayAppMcpServer2).optional(),
|
|
6892
|
+
kayAgentConverters: z18.array(ResolvedKayAgentConverter2).optional(),
|
|
6893
|
+
referencePresentations: z18.array(ResolvedReferencePresentation2).optional(),
|
|
6894
|
+
kayUiApps: z18.array(ResolvedKayUiApp2).optional()
|
|
6705
6895
|
});
|
|
6706
6896
|
return {
|
|
6707
6897
|
ResolvedPluginContributionId: ResolvedPluginContributionId2,
|
|
@@ -7090,6 +7280,7 @@ function resolveKayPluginContractV1(manifest) {
|
|
|
7090
7280
|
snapshot: source.snapshot,
|
|
7091
7281
|
change: source.change,
|
|
7092
7282
|
...source.read === void 0 ? {} : { read: source.read },
|
|
7283
|
+
...source.messageDraft === void 0 ? {} : { messageDraft: source.messageDraft },
|
|
7093
7284
|
...source.store === void 0 ? {} : { store: source.store }
|
|
7094
7285
|
}));
|
|
7095
7286
|
const kayAppApprovalTypes = manifest.targets?.kay?.app?.contributes?.approvalTypes?.map(({ uriModule, ...type }) => {
|
|
@@ -7109,7 +7300,10 @@ function resolveKayPluginContractV1(manifest) {
|
|
|
7109
7300
|
displayName: type.displayName,
|
|
7110
7301
|
schemaVersion: type.schemaVersion,
|
|
7111
7302
|
storage: type.storage,
|
|
7112
|
-
valueSchema: type.valueSchema
|
|
7303
|
+
valueSchema: type.valueSchema,
|
|
7304
|
+
...type.directory === void 0 ? {} : { directory: type.directory },
|
|
7305
|
+
...type.reference === void 0 ? {} : { reference: type.reference },
|
|
7306
|
+
...type.handover === void 0 ? {} : { handover: type.handover }
|
|
7113
7307
|
}));
|
|
7114
7308
|
const kayAppMcpServers = Object.entries(manifest.targets?.kay?.app?.contributes?.mcpServers ?? {}).map(([name, server]) => ({
|
|
7115
7309
|
name,
|
|
@@ -7208,10 +7402,10 @@ function resolveKayPluginContractV1(manifest) {
|
|
|
7208
7402
|
...app.capabilities === void 0 ? {} : {
|
|
7209
7403
|
capabilities: {
|
|
7210
7404
|
...app.capabilities.endpoints === void 0 ? {} : {
|
|
7211
|
-
endpoints: app.capabilities.endpoints.map((endpoint) =>
|
|
7405
|
+
endpoints: app.capabilities.endpoints.map((endpoint) => typeof endpoint === "string" ? {
|
|
7212
7406
|
localId: endpoint,
|
|
7213
7407
|
globalId: resolveGlobalContributionId(namespace, endpoint)
|
|
7214
|
-
})
|
|
7408
|
+
} : endpoint)
|
|
7215
7409
|
},
|
|
7216
7410
|
...app.capabilities.host === void 0 ? {} : { host: [...app.capabilities.host] },
|
|
7217
7411
|
...app.capabilities.feeds === void 0 ? {} : { feeds: [...app.capabilities.feeds] }
|
|
@@ -7239,6 +7433,7 @@ function resolveKayPluginContractV1(manifest) {
|
|
|
7239
7433
|
}))
|
|
7240
7434
|
},
|
|
7241
7435
|
...grants && Object.keys(grants.byTarget).length > 0 ? { grants } : {},
|
|
7436
|
+
...manifest.targets?.kay?.agent?.familyFolder === void 0 ? {} : { kayAgentFamilyFolder: manifest.targets.kay.agent.familyFolder },
|
|
7242
7437
|
...kayAgentUriModules && kayAgentUriModules.length > 0 ? { kayAgentUriModules } : {},
|
|
7243
7438
|
...kayAgentArtifactUriModules && kayAgentArtifactUriModules.length > 0 ? { kayAgentArtifactUriModules } : {},
|
|
7244
7439
|
...kayAgentEntityResolvers && kayAgentEntityResolvers.length > 0 ? { kayAgentEntityResolvers } : {},
|
|
@@ -7421,14 +7616,14 @@ function kayPluginCompatibilityAdvisories(input) {
|
|
|
7421
7616
|
message: boundPluginDiagnosticMessage(`${manifest.displayName} (${manifest.id}) ${advisory.message}`)
|
|
7422
7617
|
}));
|
|
7423
7618
|
}
|
|
7424
|
-
var ReadableCompatibility =
|
|
7425
|
-
supportedProtocols:
|
|
7619
|
+
var ReadableCompatibility = z19.object({
|
|
7620
|
+
supportedProtocols: z19.array(z19.string()).optional().catch(void 0),
|
|
7426
7621
|
minKayVersion: NonEmptyString.optional().catch(void 0),
|
|
7427
7622
|
sdk: NonEmptyString.optional().catch(void 0)
|
|
7428
7623
|
});
|
|
7429
|
-
var ReadableManifestHead =
|
|
7430
|
-
id:
|
|
7431
|
-
displayName:
|
|
7624
|
+
var ReadableManifestHead = z19.object({
|
|
7625
|
+
id: z19.string().optional().catch(void 0),
|
|
7626
|
+
displayName: z19.string().optional().catch(void 0),
|
|
7432
7627
|
compatibility: ReadableCompatibility.optional().catch(void 0)
|
|
7433
7628
|
});
|
|
7434
7629
|
function keepNamespaceDerivedTools(contract, grandfathered) {
|
|
@@ -7532,28 +7727,28 @@ function errorText(error) {
|
|
|
7532
7727
|
}
|
|
7533
7728
|
|
|
7534
7729
|
// packages/plugin-protocol/dist/session-health.js
|
|
7535
|
-
import { z as
|
|
7730
|
+
import { z as z20 } from "zod";
|
|
7536
7731
|
var SESSION_HEALTH_EXTENSION_ID = "kay.session-health";
|
|
7537
7732
|
var SESSION_HEALTH_ENTRY_NAME = "session_health";
|
|
7538
7733
|
var SESSION_HEALTH_CUSTOM_TYPE = `ext:${SESSION_HEALTH_EXTENSION_ID}:${SESSION_HEALTH_ENTRY_NAME}`;
|
|
7539
7734
|
var SESSION_HEALTH_CLASSIFIER_IDS = ["jev"];
|
|
7540
|
-
var sessionHealthEntrySchema =
|
|
7541
|
-
v:
|
|
7542
|
-
verdict:
|
|
7735
|
+
var sessionHealthEntrySchema = z20.object({
|
|
7736
|
+
v: z20.literal(1),
|
|
7737
|
+
verdict: z20.enum(["well", "bad", "unknown"]),
|
|
7543
7738
|
/**
|
|
7544
7739
|
* The model's calibrated confidence in `well`, 0..1, or null when the
|
|
7545
7740
|
* classifier declined to produce one. Never exported raw: the telemetry
|
|
7546
7741
|
* event carries only the decile bucket.
|
|
7547
7742
|
*/
|
|
7548
|
-
p_well:
|
|
7549
|
-
classifier:
|
|
7550
|
-
classifier_version:
|
|
7551
|
-
judged_at:
|
|
7552
|
-
user_entry_id:
|
|
7553
|
-
through_entry_id:
|
|
7554
|
-
usage:
|
|
7555
|
-
input_tokens:
|
|
7556
|
-
output_tokens:
|
|
7743
|
+
p_well: z20.number().min(0).max(1).nullable(),
|
|
7744
|
+
classifier: z20.enum(SESSION_HEALTH_CLASSIFIER_IDS),
|
|
7745
|
+
classifier_version: z20.string().min(1).max(64),
|
|
7746
|
+
judged_at: z20.number().int().nonnegative(),
|
|
7747
|
+
user_entry_id: z20.string().min(1).max(256),
|
|
7748
|
+
through_entry_id: z20.string().min(1).max(256),
|
|
7749
|
+
usage: z20.strictObject({
|
|
7750
|
+
input_tokens: z20.number().int().nonnegative(),
|
|
7751
|
+
output_tokens: z20.number().int().nonnegative()
|
|
7557
7752
|
}).optional()
|
|
7558
7753
|
});
|
|
7559
7754
|
function sessionHealthPWellDecile(pWell) {
|
|
@@ -7563,23 +7758,23 @@ function sessionHealthPWellDecile(pWell) {
|
|
|
7563
7758
|
}
|
|
7564
7759
|
|
|
7565
7760
|
// packages/plugin-protocol/dist/resource-invocations.js
|
|
7566
|
-
import { z as
|
|
7567
|
-
var CorpusResourceKind =
|
|
7761
|
+
import { z as z21 } from "zod";
|
|
7762
|
+
var CorpusResourceKind = z21.enum([
|
|
7568
7763
|
"skill",
|
|
7569
7764
|
"context-file",
|
|
7570
7765
|
"prompt-command"
|
|
7571
7766
|
]);
|
|
7572
|
-
var CorpusResourceInvocationCursor =
|
|
7573
|
-
at:
|
|
7574
|
-
eventId:
|
|
7767
|
+
var CorpusResourceInvocationCursor = z21.strictObject({
|
|
7768
|
+
at: z21.iso.datetime({ offset: true }),
|
|
7769
|
+
eventId: z21.string().min(1)
|
|
7575
7770
|
});
|
|
7576
|
-
var CorpusResourceInvocationQuery =
|
|
7771
|
+
var CorpusResourceInvocationQuery = z21.strictObject({
|
|
7577
7772
|
kind: CorpusResourceKind,
|
|
7578
|
-
since:
|
|
7579
|
-
until:
|
|
7773
|
+
since: z21.iso.datetime({ offset: true }),
|
|
7774
|
+
until: z21.iso.datetime({ offset: true }),
|
|
7580
7775
|
after: CorpusResourceInvocationCursor.optional(),
|
|
7581
|
-
limit:
|
|
7582
|
-
rootCreatedByKind:
|
|
7776
|
+
limit: z21.number().int().min(1).max(1e3).optional(),
|
|
7777
|
+
rootCreatedByKind: z21.enum(AGENT_RUNTIME_SESSION_CREATOR_KINDS).optional()
|
|
7583
7778
|
}).refine((value) => Date.parse(value.since) < Date.parse(value.until), {
|
|
7584
7779
|
message: "since must precede until"
|
|
7585
7780
|
});
|
|
@@ -7759,14 +7954,14 @@ function skillSuggestionEvidenceItems(evidence, options = {}) {
|
|
|
7759
7954
|
}
|
|
7760
7955
|
|
|
7761
7956
|
// packages/plugin-protocol/dist/ui-app-package.js
|
|
7762
|
-
import { z as
|
|
7957
|
+
import { z as z22 } from "zod";
|
|
7763
7958
|
var KAY_UI_APP_PACKAGE_PROTOCOL = "kay.ui.app-package.v1";
|
|
7764
7959
|
var KAY_UI_BUNDLE_INDEX_PROTOCOL = "kay.ui.bundle-index.v1";
|
|
7765
|
-
var KayUiBundleOutputPath =
|
|
7766
|
-
var KayUiBundleIndexV1 =
|
|
7767
|
-
protocol:
|
|
7960
|
+
var KayUiBundleOutputPath = z22.string().trim().min(1).refine((value) => !value.startsWith("/") && !value.startsWith("./") && !value.includes("\\") && !value.split("/").includes(".."), { message: "bundle output path must stay relative to the bundle root" });
|
|
7961
|
+
var KayUiBundleIndexV1 = z22.strictObject({
|
|
7962
|
+
protocol: z22.literal(KAY_UI_BUNDLE_INDEX_PROTOCOL),
|
|
7768
7963
|
entryPath: KayUiBundleOutputPath,
|
|
7769
|
-
files:
|
|
7964
|
+
files: z22.array(z22.strictObject({
|
|
7770
7965
|
path: KayUiBundleOutputPath,
|
|
7771
7966
|
mediaType: NonEmptyString
|
|
7772
7967
|
})).min(1)
|
|
@@ -7793,19 +7988,19 @@ var KayUiBundleIndexV1 = z21.strictObject({
|
|
|
7793
7988
|
function parseKayUiBundleIndexV1(input) {
|
|
7794
7989
|
return KayUiBundleIndexV1.parse(input);
|
|
7795
7990
|
}
|
|
7796
|
-
var KayUiAppPackageFile =
|
|
7991
|
+
var KayUiAppPackageFile = z22.strictObject({
|
|
7797
7992
|
path: PackageAssetPath,
|
|
7798
7993
|
mediaType: NonEmptyString,
|
|
7799
|
-
bytes:
|
|
7994
|
+
bytes: z22.instanceof(Uint8Array).refine((bytes) => bytes.byteLength > 0, {
|
|
7800
7995
|
message: "app package file bytes must not be empty"
|
|
7801
7996
|
})
|
|
7802
7997
|
});
|
|
7803
|
-
var KayUiAppPackageV1 =
|
|
7804
|
-
protocol:
|
|
7998
|
+
var KayUiAppPackageV1 = z22.strictObject({
|
|
7999
|
+
protocol: z22.literal(KAY_UI_APP_PACKAGE_PROTOCOL),
|
|
7805
8000
|
appLocalId: LocalContributionId,
|
|
7806
8001
|
entry: KayUiAppPackageFile,
|
|
7807
|
-
styles:
|
|
7808
|
-
assets:
|
|
8002
|
+
styles: z22.array(KayUiAppPackageFile).optional(),
|
|
8003
|
+
assets: z22.array(KayUiAppPackageFile).optional()
|
|
7809
8004
|
}).superRefine((appPackage, ctx) => {
|
|
7810
8005
|
if (appPackage.entry.mediaType !== "application/javascript") {
|
|
7811
8006
|
ctx.addIssue({
|
|
@@ -7841,49 +8036,6 @@ function parseKayUiAppPackageV1(input) {
|
|
|
7841
8036
|
return KayUiAppPackageV1.parse(input);
|
|
7842
8037
|
}
|
|
7843
8038
|
|
|
7844
|
-
// packages/plugin-protocol/dist/whiteboard.js
|
|
7845
|
-
import { z as z22 } from "zod";
|
|
7846
|
-
var WhiteboardValue = JsonValue;
|
|
7847
|
-
var WhiteboardEntryEnvelope = z22.strictObject({
|
|
7848
|
-
id: NonEmptyString,
|
|
7849
|
-
typeId: GlobalContributionId,
|
|
7850
|
-
schemaVersion: z22.number().int().positive(),
|
|
7851
|
-
title: z22.string(),
|
|
7852
|
-
authorSessionId: NonEmptyString.nullable()
|
|
7853
|
-
});
|
|
7854
|
-
var WhiteboardEntrySummary = z22.strictObject({
|
|
7855
|
-
name: NonEmptyString,
|
|
7856
|
-
entry: WhiteboardEntryEnvelope,
|
|
7857
|
-
revision: NonEmptyString
|
|
7858
|
-
});
|
|
7859
|
-
var WhiteboardEntrySnapshot = WhiteboardEntrySummary.extend({
|
|
7860
|
-
value: WhiteboardValue
|
|
7861
|
-
});
|
|
7862
|
-
var WhiteboardDiagnostic = z22.strictObject({
|
|
7863
|
-
ruleId: NonEmptyString,
|
|
7864
|
-
severity: z22.enum(["error", "warning"]),
|
|
7865
|
-
message: NonEmptyString
|
|
7866
|
-
});
|
|
7867
|
-
var WhiteboardEntryInfo = z22.strictObject({
|
|
7868
|
-
name: NonEmptyString,
|
|
7869
|
-
revision: NonEmptyString,
|
|
7870
|
-
entry: WhiteboardEntryEnvelope.optional(),
|
|
7871
|
-
state: z22.enum(["available", "unavailable", "unsupported-version", "invalid"]),
|
|
7872
|
-
mutable: z22.boolean(),
|
|
7873
|
-
diagnostics: z22.array(z22.string())
|
|
7874
|
-
});
|
|
7875
|
-
var WhiteboardEntryInspection = WhiteboardEntryInfo.extend({
|
|
7876
|
-
value: WhiteboardValue.optional(),
|
|
7877
|
-
text: z22.string(),
|
|
7878
|
-
truncated: z22.boolean()
|
|
7879
|
-
});
|
|
7880
|
-
var WhiteboardTypeInfo = z22.strictObject({
|
|
7881
|
-
typeId: GlobalContributionId,
|
|
7882
|
-
displayName: NonEmptyString,
|
|
7883
|
-
schemaVersion: z22.number().int().positive(),
|
|
7884
|
-
available: z22.boolean()
|
|
7885
|
-
});
|
|
7886
|
-
|
|
7887
8039
|
// packages/plugin-protocol/dist/product-events.js
|
|
7888
8040
|
import { z as z23 } from "zod";
|
|
7889
8041
|
var exportable = {
|
|
@@ -8288,6 +8440,7 @@ export {
|
|
|
8288
8440
|
ToolContribution,
|
|
8289
8441
|
ToolPermission,
|
|
8290
8442
|
UiAppCapabilities,
|
|
8443
|
+
UiAppCapabilityReference,
|
|
8291
8444
|
UiAppContribution,
|
|
8292
8445
|
UiCommandContribution,
|
|
8293
8446
|
UiEventSubscriptionContribution,
|
|
@@ -8308,6 +8461,7 @@ export {
|
|
|
8308
8461
|
WhiteboardEntryEnvelope,
|
|
8309
8462
|
WhiteboardEntryInfo,
|
|
8310
8463
|
WhiteboardEntryInspection,
|
|
8464
|
+
WhiteboardEntryReference,
|
|
8311
8465
|
WhiteboardEntrySnapshot,
|
|
8312
8466
|
WhiteboardEntrySummary,
|
|
8313
8467
|
WhiteboardTypeContribution,
|