@yaklabs-ai/plugin-protocol 0.50.0 → 0.52.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 +805 -120
- package/dist/index.js +1140 -945
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -30,6 +30,12 @@ function declaredUiIconPaths(manifest) {
|
|
|
30
30
|
const contributes = manifest.targets?.kay?.ui?.contributes;
|
|
31
31
|
return [
|
|
32
32
|
...(contributes?.railEntries ?? []).flatMap((entry) => entry.icon === void 0 ? [] : [{ label: `kay.ui rail entry '${entry.id}' icon`, path: entry.icon }]),
|
|
33
|
+
...(contributes?.railEntries ?? []).flatMap((entry) => entry.featureFlagVariant?.icon === void 0 ? [] : [
|
|
34
|
+
{
|
|
35
|
+
label: "kay.ui rail variant icon",
|
|
36
|
+
path: entry.featureFlagVariant.icon
|
|
37
|
+
}
|
|
38
|
+
]),
|
|
33
39
|
...(contributes?.pages ?? []).flatMap((page) => page.icon === void 0 ? [] : [{ label: `kay.ui page '${page.id}' icon`, path: page.icon }]),
|
|
34
40
|
...(contributes?.commands ?? []).flatMap((command) => command.icon === void 0 ? [] : [
|
|
35
41
|
{
|
|
@@ -260,8 +266,12 @@ var JsonSchema = z4.record(z4.string(), JsonValue);
|
|
|
260
266
|
var KAY_PLUGIN_MANIFEST_SIZE_CAP_BYTES = 1024 * 1024;
|
|
261
267
|
var KAY_PLUGIN_PROTOCOL_VERSION = "kay.plugin.v1";
|
|
262
268
|
var KAY_PLUGIN_PROTOCOL_PACKAGE_NAME = "@bonsai/plugin-protocol";
|
|
263
|
-
var KAY_PLUGIN_SDK_VERSION = "0.
|
|
264
|
-
var KAY_PLUGIN_COMPATIBLE_SDK_VERSIONS = [
|
|
269
|
+
var KAY_PLUGIN_SDK_VERSION = "0.52.0";
|
|
270
|
+
var KAY_PLUGIN_COMPATIBLE_SDK_VERSIONS = [
|
|
271
|
+
"0.51.0",
|
|
272
|
+
"0.50.0",
|
|
273
|
+
"0.49.0"
|
|
274
|
+
];
|
|
265
275
|
var KAY_PLUGIN_TARGET_NAMES = [
|
|
266
276
|
"kay.agent",
|
|
267
277
|
"kay.app",
|
|
@@ -1224,7 +1234,7 @@ function finalizeArtifactProvenanceEnvelope(capture, artifacts) {
|
|
|
1224
1234
|
}
|
|
1225
1235
|
|
|
1226
1236
|
// packages/plugin-protocol/dist/authority.js
|
|
1227
|
-
import { z as
|
|
1237
|
+
import { z as z11 } from "zod";
|
|
1228
1238
|
|
|
1229
1239
|
// packages/plugin-protocol/dist/permissions.js
|
|
1230
1240
|
var permissions_exports = {};
|
|
@@ -1259,7 +1269,7 @@ __export(permissions_exports, {
|
|
|
1259
1269
|
retiredPermissionAsksIn: () => retiredPermissionAsksIn,
|
|
1260
1270
|
webSessionPathWithinPrefix: () => webSessionPathWithinPrefix
|
|
1261
1271
|
});
|
|
1262
|
-
import { z as
|
|
1272
|
+
import { z as z10 } from "zod";
|
|
1263
1273
|
|
|
1264
1274
|
// packages/plugin-protocol/dist/ids.js
|
|
1265
1275
|
function resolvePluginNamespace(pluginId, namespace) {
|
|
@@ -1287,6 +1297,50 @@ function resolveAdapterId(globalId, declaredAdapterId) {
|
|
|
1287
1297
|
return declaredAdapterId ?? globalId;
|
|
1288
1298
|
}
|
|
1289
1299
|
|
|
1300
|
+
// packages/plugin-protocol/dist/sign-in-facts.js
|
|
1301
|
+
import { z as z9 } from "zod";
|
|
1302
|
+
var Label = z9.string().min(1).max(120).refine((value) => value.trim().length > 0);
|
|
1303
|
+
var SetupText = z9.string().min(1).max(2048).refine((value) => value.trim().length > 0);
|
|
1304
|
+
var ClientFieldValidation = z9.discriminatedUnion("kind", [
|
|
1305
|
+
z9.strictObject({ kind: z9.literal("uuid") }),
|
|
1306
|
+
z9.strictObject({
|
|
1307
|
+
kind: z9.literal("suffix"),
|
|
1308
|
+
value: z9.string().min(1).max(120)
|
|
1309
|
+
})
|
|
1310
|
+
]);
|
|
1311
|
+
var PluginByoocProfile = z9.strictObject({
|
|
1312
|
+
displayName: Label,
|
|
1313
|
+
fields: z9.array(z9.strictObject({
|
|
1314
|
+
id: z9.string().regex(/^[A-Za-z][A-Za-z0-9]{0,63}$/),
|
|
1315
|
+
label: Label,
|
|
1316
|
+
optional: z9.boolean().optional(),
|
|
1317
|
+
validation: ClientFieldValidation.optional(),
|
|
1318
|
+
failureMessage: SetupText.optional()
|
|
1319
|
+
})).min(1).max(8).refine((fields) => fields[0]?.id === "clientId", {
|
|
1320
|
+
message: "the first BYOOC field must be clientId"
|
|
1321
|
+
}).refine((fields) => new Set(fields.map((field) => field.id)).size === fields.length, {
|
|
1322
|
+
message: "BYOOC field ids must be unique"
|
|
1323
|
+
}),
|
|
1324
|
+
setup: z9.strictObject({
|
|
1325
|
+
steps: z9.array(SetupText).min(1).max(20),
|
|
1326
|
+
notes: z9.array(SetupText).max(20),
|
|
1327
|
+
url: z9.url().startsWith("https://")
|
|
1328
|
+
}),
|
|
1329
|
+
endpointTemplates: z9.strictObject({
|
|
1330
|
+
authorizationUrl: z9.string().min(1).max(512),
|
|
1331
|
+
tokenUrl: z9.string().min(1).max(512)
|
|
1332
|
+
}).optional()
|
|
1333
|
+
});
|
|
1334
|
+
var PluginPickerRound = z9.strictObject({
|
|
1335
|
+
scopes: z9.array(z9.string().min(1).max(512)).min(1).max(16),
|
|
1336
|
+
extraAuthorizeParams: z9.record(z9.string().min(1), z9.string()),
|
|
1337
|
+
redirectParam: z9.string().min(1).max(120),
|
|
1338
|
+
requiresGrantedScope: z9.string().min(1).max(512),
|
|
1339
|
+
supersededByScopes: z9.array(z9.string().min(1).max(512)).max(16),
|
|
1340
|
+
purpose: Label,
|
|
1341
|
+
displayNoun: Label
|
|
1342
|
+
});
|
|
1343
|
+
|
|
1290
1344
|
// packages/plugin-protocol/dist/permissions.js
|
|
1291
1345
|
var WEB_SESSION_CSRF_SELECTOR_PATTERN = /^(?=.)(?:[a-zA-Z][a-zA-Z0-9-]*)?(?:#[a-zA-Z_][\w-]*|\[[a-zA-Z_:][\w:.-]*(?:=(?:"[^"]*"|'[^']*'|[\w-]+))?\])*$/u;
|
|
1292
1346
|
var RETIRED_PERMISSION_ASK_KEYS = [
|
|
@@ -1312,39 +1366,39 @@ var RETIRED_PERMISSION_ASK_KEYS = [
|
|
|
1312
1366
|
var RETIRED_WEB_SESSION_ROW_KEYS = ["operations"];
|
|
1313
1367
|
function createPermissionsSchemas(canonical) {
|
|
1314
1368
|
const { AuthSchemeReference: AuthSchemeReference2, AuthServiceReference: AuthServiceReference2, GlobalContributionId: GlobalContributionId2, LocalContributionId: LocalContributionId2, NonEmptyString: NonEmptyString3 } = canonical ? canonicalCommonSchemas : common_exports;
|
|
1315
|
-
const AuthGrantOperation2 =
|
|
1369
|
+
const AuthGrantOperation2 = z10.enum([
|
|
1316
1370
|
"status",
|
|
1317
1371
|
"list",
|
|
1318
1372
|
"connect",
|
|
1319
1373
|
"disconnect",
|
|
1320
1374
|
"resolve"
|
|
1321
1375
|
]);
|
|
1322
|
-
const AuthAccountSelector2 =
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
kind:
|
|
1376
|
+
const AuthAccountSelector2 = z10.discriminatedUnion("kind", [
|
|
1377
|
+
z10.strictObject({ kind: z10.literal("active") }),
|
|
1378
|
+
z10.strictObject({
|
|
1379
|
+
kind: z10.literal("account-id"),
|
|
1326
1380
|
accountId: NonEmptyString3
|
|
1327
1381
|
}),
|
|
1328
|
-
|
|
1382
|
+
z10.strictObject({ kind: z10.literal("record-id"), recordId: NonEmptyString3 })
|
|
1329
1383
|
]);
|
|
1330
|
-
const AuthScopeDefinition2 =
|
|
1384
|
+
const AuthScopeDefinition2 = z10.strictObject({
|
|
1331
1385
|
id: NonEmptyString3,
|
|
1332
1386
|
label: NonEmptyString3,
|
|
1333
1387
|
description: NonEmptyString3,
|
|
1334
|
-
documentationUrl:
|
|
1388
|
+
documentationUrl: z10.url().optional()
|
|
1335
1389
|
});
|
|
1336
|
-
const ScopeNeed2 =
|
|
1390
|
+
const ScopeNeed2 = z10.strictObject({
|
|
1337
1391
|
scope: NonEmptyString3,
|
|
1338
1392
|
reason: NonEmptyString3.exactOptional()
|
|
1339
1393
|
});
|
|
1340
|
-
const ScopeAlternative2 =
|
|
1341
|
-
allOf:
|
|
1394
|
+
const ScopeAlternative2 = z10.strictObject({
|
|
1395
|
+
allOf: z10.array(ScopeNeed2).min(1)
|
|
1342
1396
|
});
|
|
1343
|
-
const ScopeRequirement2 =
|
|
1397
|
+
const ScopeRequirement2 = z10.strictObject({
|
|
1344
1398
|
purpose: NonEmptyString3,
|
|
1345
|
-
alternatives:
|
|
1399
|
+
alternatives: z10.array(ScopeAlternative2).min(1)
|
|
1346
1400
|
});
|
|
1347
|
-
const AuthGrantFrontDoor2 =
|
|
1401
|
+
const AuthGrantFrontDoor2 = z10.strictObject({
|
|
1348
1402
|
/**
|
|
1349
1403
|
* The door id: the id `service_connect` takes (`gmail`). Never a registered auth service's id, and
|
|
1350
1404
|
* not the grant's `service`, which names the shared sign-in the door expands.
|
|
@@ -1356,15 +1410,20 @@ function createPermissionsSchemas(canonical) {
|
|
|
1356
1410
|
* first connect chains into a pick. `selection`: the scope already reaches every file of the
|
|
1357
1411
|
* type, and the pick only records which ones the person meant.
|
|
1358
1412
|
*/
|
|
1359
|
-
resourcePicker:
|
|
1360
|
-
effect:
|
|
1413
|
+
resourcePicker: z10.strictObject({
|
|
1414
|
+
effect: z10.enum(["selection", "resource-grant"]),
|
|
1361
1415
|
/** The file types the picker offers. */
|
|
1362
|
-
mimeTypes:
|
|
1416
|
+
mimeTypes: z10.array(NonEmptyString3.max(255)).min(1).max(32).optional(),
|
|
1363
1417
|
/** What the agent is told about the picked set once the pick lands. */
|
|
1364
|
-
successNote: NonEmptyString3.max(2048).optional()
|
|
1418
|
+
successNote: NonEmptyString3.max(2048).optional(),
|
|
1419
|
+
round: PluginPickerRound.optional(),
|
|
1420
|
+
completion: z10.strictObject({
|
|
1421
|
+
pluginId: z10.string().min(1),
|
|
1422
|
+
moduleId: z10.string().min(1)
|
|
1423
|
+
}).optional()
|
|
1365
1424
|
}).optional()
|
|
1366
1425
|
});
|
|
1367
|
-
const AuthGrantRequestBase =
|
|
1426
|
+
const AuthGrantRequestBase = z10.strictObject({
|
|
1368
1427
|
// A local (undotted) service must be declared in this same manifest; a
|
|
1369
1428
|
// qualified (dotted) service names another plugin's global id and is an
|
|
1370
1429
|
// external service dependency, recorded on the resolved contract's
|
|
@@ -1373,22 +1432,22 @@ function createPermissionsSchemas(canonical) {
|
|
|
1373
1432
|
// Optional for backward compatibility with grants whose service has a
|
|
1374
1433
|
// single unambiguous scheme. Local ids resolve under the service owner's
|
|
1375
1434
|
// namespace; qualified ids are preserved.
|
|
1376
|
-
schemes:
|
|
1377
|
-
operations:
|
|
1378
|
-
purposes:
|
|
1435
|
+
schemes: z10.array(AuthSchemeReference2).min(1).optional(),
|
|
1436
|
+
operations: z10.array(AuthGrantOperation2).min(1),
|
|
1437
|
+
purposes: z10.array(NonEmptyString3).optional(),
|
|
1379
1438
|
// Bridged by the runtime into an enforceable `CredentialGrant`:
|
|
1380
1439
|
// `allowedScopes` is the caller's scope ENVELOPE and
|
|
1381
1440
|
// `accountSelectors` map through. Absent `accountSelectors` resolves to the
|
|
1382
1441
|
// narrowest bound (see `ResolvedAuthGrantRequest`); absent scope envelope
|
|
1383
1442
|
// leaves the bridged grant scope-agnostic.
|
|
1384
|
-
allowedScopes:
|
|
1443
|
+
allowedScopes: z10.array(NonEmptyString3).min(1).optional(),
|
|
1385
1444
|
// Legacy spelling for `allowedScopes`; new manifests should use the authority-shaped name.
|
|
1386
|
-
requiredScopes:
|
|
1445
|
+
requiredScopes: z10.array(NonEmptyString3).min(1).optional(),
|
|
1387
1446
|
// Preferred proactive consent bundle; runtime resolution still uses `scopeRequirement`.
|
|
1388
|
-
connectScopes:
|
|
1447
|
+
connectScopes: z10.array(NonEmptyString3).min(1).optional(),
|
|
1389
1448
|
scopeRequirement: ScopeRequirement2.optional(),
|
|
1390
|
-
scopeDefinitions:
|
|
1391
|
-
accountSelectors:
|
|
1449
|
+
scopeDefinitions: z10.array(AuthScopeDefinition2).min(1).optional(),
|
|
1450
|
+
accountSelectors: z10.array(AuthAccountSelector2).min(1).optional(),
|
|
1392
1451
|
frontDoor: AuthGrantFrontDoor2.optional()
|
|
1393
1452
|
});
|
|
1394
1453
|
function validateAuthGrantRequest(grant, ctx) {
|
|
@@ -1476,19 +1535,19 @@ function createPermissionsSchemas(canonical) {
|
|
|
1476
1535
|
}
|
|
1477
1536
|
}
|
|
1478
1537
|
const AuthGrantRequest2 = AuthGrantRequestBase.superRefine(validateAuthGrantRequest);
|
|
1479
|
-
const StorageGrantRequest2 =
|
|
1480
|
-
kind:
|
|
1481
|
-
operations:
|
|
1538
|
+
const StorageGrantRequest2 = z10.strictObject({
|
|
1539
|
+
kind: z10.enum(["sqlite", "dataDir"]),
|
|
1540
|
+
operations: z10.array(z10.enum(["open", "read", "write"])).min(1)
|
|
1482
1541
|
});
|
|
1483
|
-
const EventGrantRequest2 =
|
|
1542
|
+
const EventGrantRequest2 = z10.strictObject({
|
|
1484
1543
|
event: NonEmptyString3,
|
|
1485
|
-
operations:
|
|
1544
|
+
operations: z10.array(z10.enum(["subscribe", "publish"])).min(1)
|
|
1486
1545
|
});
|
|
1487
|
-
const EndpointGrantRequest2 =
|
|
1546
|
+
const EndpointGrantRequest2 = z10.strictObject({
|
|
1488
1547
|
endpoint: LocalContributionId2,
|
|
1489
|
-
operations:
|
|
1548
|
+
operations: z10.array(z10.enum(["register", "invoke"])).min(1)
|
|
1490
1549
|
});
|
|
1491
|
-
const WebSessionOrigin =
|
|
1550
|
+
const WebSessionOrigin = z10.string().superRefine((value, ctx) => {
|
|
1492
1551
|
try {
|
|
1493
1552
|
const url = new URL(value);
|
|
1494
1553
|
if (url.protocol !== "https:" || url.username !== "" || url.password !== "" || url.pathname !== "/" || url.search !== "" || url.hash !== "" || url.origin !== value) {
|
|
@@ -1501,7 +1560,7 @@ function createPermissionsSchemas(canonical) {
|
|
|
1501
1560
|
ctx.addIssue({ code: "custom", message: "must be a valid HTTPS origin" });
|
|
1502
1561
|
}
|
|
1503
1562
|
});
|
|
1504
|
-
const WebSessionCsrfSourceUrl =
|
|
1563
|
+
const WebSessionCsrfSourceUrl = z10.url({ protocol: /^https$/ }).superRefine((value, ctx) => {
|
|
1505
1564
|
const url = new URL(value);
|
|
1506
1565
|
if (url.username !== "" || url.password !== "" || url.hash !== "") {
|
|
1507
1566
|
ctx.addIssue({
|
|
@@ -1543,10 +1602,10 @@ function createPermissionsSchemas(canonical) {
|
|
|
1543
1602
|
}
|
|
1544
1603
|
});
|
|
1545
1604
|
const WebSessionCsrfSelector2 = NonEmptyString3.regex(WEB_SESSION_CSRF_SELECTOR_PATTERN, "must be a compound simple selector: optional tag, then #id or [attr=value] predicates on that one element (no combinators, classes, or pseudo-classes)");
|
|
1546
|
-
const WebSessionGrantRequest2 =
|
|
1605
|
+
const WebSessionGrantRequest2 = z10.strictObject({
|
|
1547
1606
|
origin: WebSessionOrigin,
|
|
1548
|
-
pathPrefixes:
|
|
1549
|
-
csrf:
|
|
1607
|
+
pathPrefixes: z10.array(WebSessionPathPrefix).min(1),
|
|
1608
|
+
csrf: z10.strictObject({
|
|
1550
1609
|
sourceUrl: WebSessionCsrfSourceUrl,
|
|
1551
1610
|
selector: WebSessionCsrfSelector2,
|
|
1552
1611
|
attribute: NonEmptyString3,
|
|
@@ -1555,14 +1614,14 @@ function createPermissionsSchemas(canonical) {
|
|
|
1555
1614
|
bodyField: NonEmptyString3.optional()
|
|
1556
1615
|
}).optional()
|
|
1557
1616
|
});
|
|
1558
|
-
const KnowledgeSearchGrantRequest2 =
|
|
1559
|
-
scope:
|
|
1617
|
+
const KnowledgeSearchGrantRequest2 = z10.strictObject({
|
|
1618
|
+
scope: z10.literal("own-schemes")
|
|
1560
1619
|
});
|
|
1561
|
-
const KnownResourcesGrantRequest2 =
|
|
1562
|
-
scope:
|
|
1620
|
+
const KnownResourcesGrantRequest2 = z10.strictObject({
|
|
1621
|
+
scope: z10.literal("own-modules")
|
|
1563
1622
|
});
|
|
1564
|
-
const PluginAgentDefinitionPermissionRule2 =
|
|
1565
|
-
effect:
|
|
1623
|
+
const PluginAgentDefinitionPermissionRule2 = z10.strictObject({
|
|
1624
|
+
effect: z10.enum(["allow", "deny", "ask"]),
|
|
1566
1625
|
/** Restrict to one tool name. */
|
|
1567
1626
|
tool: NonEmptyString3.optional(),
|
|
1568
1627
|
/** Restrict to one classified capability key. */
|
|
@@ -1572,7 +1631,7 @@ function createPermissionsSchemas(canonical) {
|
|
|
1572
1631
|
/** Restrict to matching resources (a path glob, or a URI-shaped policy address). */
|
|
1573
1632
|
resource: NonEmptyString3.optional(),
|
|
1574
1633
|
/** Restrict the rule to one permission mode; omit to apply in all modes. */
|
|
1575
|
-
mode:
|
|
1634
|
+
mode: z10.enum(["default", "ask", "allow", "auto"]).optional()
|
|
1576
1635
|
});
|
|
1577
1636
|
function stripRetiredPermissionAsks(value) {
|
|
1578
1637
|
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
@@ -1594,14 +1653,14 @@ function createPermissionsSchemas(canonical) {
|
|
|
1594
1653
|
}
|
|
1595
1654
|
return remaining;
|
|
1596
1655
|
}
|
|
1597
|
-
const TargetPermissionWiring2 =
|
|
1598
|
-
auth:
|
|
1599
|
-
storage:
|
|
1600
|
-
events:
|
|
1601
|
-
endpoints:
|
|
1602
|
-
webSession:
|
|
1603
|
-
knowledgeSearch:
|
|
1604
|
-
knownResources:
|
|
1656
|
+
const TargetPermissionWiring2 = z10.strictObject({
|
|
1657
|
+
auth: z10.array(AuthGrantRequest2).optional(),
|
|
1658
|
+
storage: z10.array(StorageGrantRequest2).optional(),
|
|
1659
|
+
events: z10.array(EventGrantRequest2).optional(),
|
|
1660
|
+
endpoints: z10.array(EndpointGrantRequest2).optional(),
|
|
1661
|
+
webSession: z10.array(WebSessionGrantRequest2).optional(),
|
|
1662
|
+
knowledgeSearch: z10.array(KnowledgeSearchGrantRequest2).optional(),
|
|
1663
|
+
knownResources: z10.array(KnownResourcesGrantRequest2).optional()
|
|
1605
1664
|
}).superRefine((permissions, ctx) => {
|
|
1606
1665
|
const rows = permissions.webSession ?? [];
|
|
1607
1666
|
for (const [index, row] of rows.entries()) {
|
|
@@ -1619,9 +1678,9 @@ function createPermissionsSchemas(canonical) {
|
|
|
1619
1678
|
}
|
|
1620
1679
|
}
|
|
1621
1680
|
});
|
|
1622
|
-
const TargetPermissionSet2 = canonical ? TargetPermissionWiring2 :
|
|
1623
|
-
const PluginPermissionManifest2 =
|
|
1624
|
-
byTarget:
|
|
1681
|
+
const TargetPermissionSet2 = canonical ? TargetPermissionWiring2 : z10.preprocess(stripRetiredPermissionAsks, TargetPermissionWiring2);
|
|
1682
|
+
const PluginPermissionManifest2 = z10.strictObject({
|
|
1683
|
+
byTarget: z10.strictObject({
|
|
1625
1684
|
"kay.agent": TargetPermissionSet2.optional(),
|
|
1626
1685
|
"kay.app": TargetPermissionSet2.optional(),
|
|
1627
1686
|
"kay.ui": TargetPermissionSet2.optional()
|
|
@@ -1639,26 +1698,26 @@ function createPermissionsSchemas(canonical) {
|
|
|
1639
1698
|
});
|
|
1640
1699
|
const ResolvedAuthGrantRequest2 = AuthGrantRequestBase.extend({
|
|
1641
1700
|
service: GlobalContributionId2,
|
|
1642
|
-
schemes:
|
|
1701
|
+
schemes: z10.array(GlobalContributionId2).min(1).optional(),
|
|
1643
1702
|
// Resolution fills an absent binding with the narrowest bound, so a resolved
|
|
1644
1703
|
// grant ALWAYS carries an explicit, non-broadening account selector - the
|
|
1645
1704
|
// runtime never has to invent a default and fail open.
|
|
1646
|
-
accountSelectors:
|
|
1705
|
+
accountSelectors: z10.array(AuthAccountSelector2).min(1)
|
|
1647
1706
|
}).superRefine(validateAuthGrantRequest);
|
|
1648
1707
|
const ResolvedEndpointGrantRequest2 = EndpointGrantRequest2.extend({
|
|
1649
1708
|
endpoint: GlobalContributionId2
|
|
1650
1709
|
});
|
|
1651
|
-
const ResolvedTargetGrantSet2 =
|
|
1652
|
-
auth:
|
|
1653
|
-
storage:
|
|
1654
|
-
events:
|
|
1655
|
-
endpoints:
|
|
1656
|
-
webSession:
|
|
1657
|
-
knowledgeSearch:
|
|
1658
|
-
knownResources:
|
|
1659
|
-
});
|
|
1660
|
-
const ResolvedPluginGrants2 =
|
|
1661
|
-
byTarget:
|
|
1710
|
+
const ResolvedTargetGrantSet2 = z10.strictObject({
|
|
1711
|
+
auth: z10.array(ResolvedAuthGrantRequest2).optional(),
|
|
1712
|
+
storage: z10.array(StorageGrantRequest2).optional(),
|
|
1713
|
+
events: z10.array(EventGrantRequest2).optional(),
|
|
1714
|
+
endpoints: z10.array(ResolvedEndpointGrantRequest2).optional(),
|
|
1715
|
+
webSession: z10.array(WebSessionGrantRequest2).optional(),
|
|
1716
|
+
knowledgeSearch: z10.array(KnowledgeSearchGrantRequest2).optional(),
|
|
1717
|
+
knownResources: z10.array(KnownResourcesGrantRequest2).optional()
|
|
1718
|
+
});
|
|
1719
|
+
const ResolvedPluginGrants2 = z10.strictObject({
|
|
1720
|
+
byTarget: z10.strictObject({
|
|
1662
1721
|
"kay.agent": ResolvedTargetGrantSet2.optional(),
|
|
1663
1722
|
"kay.app": ResolvedTargetGrantSet2.optional(),
|
|
1664
1723
|
"kay.ui": ResolvedTargetGrantSet2.optional()
|
|
@@ -1809,24 +1868,24 @@ var AGENT_PERMISSION_RULE_FIELDS = [
|
|
|
1809
1868
|
function createAuthoritySchemas(canonical) {
|
|
1810
1869
|
const { ArtifactGenerationId: ArtifactGenerationId2, NonEmptyString: NonEmptyString3, UriScheme: UriScheme2, PluginId: PluginId2, LocalContributionId: LocalContributionId2 } = canonical ? canonicalCommonSchemas : common_exports;
|
|
1811
1870
|
const { PluginAgentDefinitionPermissionRule: PluginAgentDefinitionPermissionRule2 } = canonical ? canonicalPermissionSchemas : permissions_exports;
|
|
1812
|
-
const WhiteboardCapabilityScope2 =
|
|
1813
|
-
const WhiteboardCapabilityOperation2 =
|
|
1871
|
+
const WhiteboardCapabilityScope2 = z11.enum(["own-types", "all-types"]);
|
|
1872
|
+
const WhiteboardCapabilityOperation2 = z11.enum([
|
|
1814
1873
|
"discover",
|
|
1815
1874
|
"read",
|
|
1816
1875
|
"create",
|
|
1817
1876
|
"update",
|
|
1818
1877
|
"remove"
|
|
1819
1878
|
]);
|
|
1820
|
-
const WhiteboardCapabilityClaimV12 =
|
|
1821
|
-
target:
|
|
1822
|
-
slug:
|
|
1879
|
+
const WhiteboardCapabilityClaimV12 = z11.strictObject({
|
|
1880
|
+
target: z11.enum(["kay.agent", "kay.app"]),
|
|
1881
|
+
slug: z11.enum([
|
|
1823
1882
|
"whiteboard.discover",
|
|
1824
1883
|
"whiteboard.read",
|
|
1825
1884
|
"whiteboard.create",
|
|
1826
1885
|
"whiteboard.update",
|
|
1827
1886
|
"whiteboard.remove"
|
|
1828
1887
|
]),
|
|
1829
|
-
envelope:
|
|
1888
|
+
envelope: z11.strictObject({ scope: WhiteboardCapabilityScope2 })
|
|
1830
1889
|
}).superRefine((claim, ctx) => {
|
|
1831
1890
|
if (claim.target === "kay.app" && claim.slug !== "whiteboard.discover" && claim.slug !== "whiteboard.read") {
|
|
1832
1891
|
ctx.addIssue({
|
|
@@ -1836,167 +1895,167 @@ function createAuthoritySchemas(canonical) {
|
|
|
1836
1895
|
});
|
|
1837
1896
|
}
|
|
1838
1897
|
});
|
|
1839
|
-
const DeclaredSkillSourceEnvelope2 =
|
|
1840
|
-
|
|
1841
|
-
channel:
|
|
1898
|
+
const DeclaredSkillSourceEnvelope2 = z11.discriminatedUnion("channel", [
|
|
1899
|
+
z11.strictObject({
|
|
1900
|
+
channel: z11.literal("git-clone"),
|
|
1842
1901
|
locator: NonEmptyString3,
|
|
1843
1902
|
ref: NonEmptyString3.optional(),
|
|
1844
1903
|
subdir: NonEmptyString3.optional()
|
|
1845
1904
|
}),
|
|
1846
|
-
|
|
1847
|
-
channel:
|
|
1905
|
+
z11.strictObject({
|
|
1906
|
+
channel: z11.literal("installer"),
|
|
1848
1907
|
command: NonEmptyString3,
|
|
1849
|
-
args:
|
|
1908
|
+
args: z11.array(NonEmptyString3)
|
|
1850
1909
|
})
|
|
1851
1910
|
]);
|
|
1852
|
-
const PluginCapabilityClaimV12 =
|
|
1853
|
-
|
|
1854
|
-
target:
|
|
1855
|
-
slug:
|
|
1856
|
-
envelope:
|
|
1911
|
+
const PluginCapabilityClaimV12 = z11.discriminatedUnion("slug", [
|
|
1912
|
+
z11.strictObject({
|
|
1913
|
+
target: z11.literal("kay.app"),
|
|
1914
|
+
slug: z11.literal("sessions.run"),
|
|
1915
|
+
envelope: z11.strictObject({})
|
|
1857
1916
|
}),
|
|
1858
|
-
|
|
1859
|
-
target:
|
|
1860
|
-
slug:
|
|
1861
|
-
envelope:
|
|
1917
|
+
z11.strictObject({
|
|
1918
|
+
target: z11.literal("kay.agent"),
|
|
1919
|
+
slug: z11.literal("network.connect"),
|
|
1920
|
+
envelope: z11.strictObject({ connect: NonEmptyString3 })
|
|
1862
1921
|
}),
|
|
1863
|
-
|
|
1864
|
-
target:
|
|
1865
|
-
slug:
|
|
1866
|
-
envelope:
|
|
1922
|
+
z11.strictObject({
|
|
1923
|
+
target: z11.literal("kay.agent"),
|
|
1924
|
+
slug: z11.literal("web-session.request"),
|
|
1925
|
+
envelope: z11.strictObject({
|
|
1867
1926
|
origin: NonEmptyString3,
|
|
1868
1927
|
pathPrefix: NonEmptyString3
|
|
1869
1928
|
})
|
|
1870
1929
|
}),
|
|
1871
|
-
|
|
1872
|
-
target:
|
|
1873
|
-
slug:
|
|
1874
|
-
envelope:
|
|
1930
|
+
z11.strictObject({
|
|
1931
|
+
target: z11.literal("kay.agent"),
|
|
1932
|
+
slug: z11.literal("web-session.download"),
|
|
1933
|
+
envelope: z11.strictObject({
|
|
1875
1934
|
origin: NonEmptyString3,
|
|
1876
1935
|
pathPrefix: NonEmptyString3
|
|
1877
1936
|
})
|
|
1878
1937
|
}),
|
|
1879
|
-
|
|
1880
|
-
target:
|
|
1881
|
-
slug:
|
|
1882
|
-
envelope:
|
|
1938
|
+
z11.strictObject({
|
|
1939
|
+
target: z11.literal("kay.agent"),
|
|
1940
|
+
slug: z11.literal("process.spawn"),
|
|
1941
|
+
envelope: z11.strictObject({
|
|
1883
1942
|
command: NonEmptyString3,
|
|
1884
1943
|
argvClass: NonEmptyString3
|
|
1885
1944
|
})
|
|
1886
1945
|
}),
|
|
1887
|
-
|
|
1888
|
-
target:
|
|
1889
|
-
slug:
|
|
1890
|
-
envelope:
|
|
1946
|
+
z11.strictObject({
|
|
1947
|
+
target: z11.literal("kay.app"),
|
|
1948
|
+
slug: z11.literal("sessions.read"),
|
|
1949
|
+
envelope: z11.strictObject({})
|
|
1891
1950
|
}),
|
|
1892
|
-
|
|
1951
|
+
z11.strictObject({
|
|
1893
1952
|
// Every plugin's recorded Jev signals, not only the caller's own: an empty envelope because
|
|
1894
1953
|
// the grant itself is the visibility decision. Both first consumers (a session timeline, and
|
|
1895
1954
|
// an agent loop turning signals into skills) read rows another plugin recorded.
|
|
1896
|
-
target:
|
|
1897
|
-
slug:
|
|
1898
|
-
envelope:
|
|
1955
|
+
target: z11.literal("kay.app"),
|
|
1956
|
+
slug: z11.literal("signals.read"),
|
|
1957
|
+
envelope: z11.strictObject({})
|
|
1899
1958
|
}),
|
|
1900
|
-
|
|
1901
|
-
target:
|
|
1902
|
-
slug:
|
|
1903
|
-
envelope:
|
|
1959
|
+
z11.strictObject({
|
|
1960
|
+
target: z11.enum(["kay.agent", "kay.app"]),
|
|
1961
|
+
slug: z11.literal("uri.call"),
|
|
1962
|
+
envelope: z11.strictObject({
|
|
1904
1963
|
scheme: UriScheme2,
|
|
1905
|
-
verb:
|
|
1964
|
+
verb: z11.enum(["read", "list", "search", "write", "edit", "delete"])
|
|
1906
1965
|
})
|
|
1907
1966
|
}),
|
|
1908
|
-
|
|
1909
|
-
target:
|
|
1910
|
-
slug:
|
|
1911
|
-
envelope:
|
|
1967
|
+
z11.strictObject({
|
|
1968
|
+
target: z11.enum(["kay.agent", "kay.app"]),
|
|
1969
|
+
slug: z11.literal("endpoints.invoke"),
|
|
1970
|
+
envelope: z11.strictObject({
|
|
1912
1971
|
pluginId: PluginId2,
|
|
1913
1972
|
endpointId: LocalContributionId2
|
|
1914
1973
|
})
|
|
1915
1974
|
}),
|
|
1916
|
-
|
|
1975
|
+
z11.strictObject({
|
|
1917
1976
|
// Read every managed skill and its history: identity, versions, revisions, changes against
|
|
1918
1977
|
// the source, past versions, suggestions. Never a write. An empty envelope because the
|
|
1919
1978
|
// grant itself is the visibility decision, as with `signals.read`.
|
|
1920
|
-
target:
|
|
1921
|
-
slug:
|
|
1922
|
-
envelope:
|
|
1979
|
+
target: z11.literal("kay.app"),
|
|
1980
|
+
slug: z11.literal("skills.read"),
|
|
1981
|
+
envelope: z11.strictObject({})
|
|
1923
1982
|
}),
|
|
1924
|
-
|
|
1983
|
+
z11.strictObject({
|
|
1925
1984
|
// Change, install and delete the user's skills. Every write follows the same rules an
|
|
1926
1985
|
// agent's `skill://` write does, and each revision records the plugin that made it.
|
|
1927
|
-
target:
|
|
1928
|
-
slug:
|
|
1929
|
-
envelope:
|
|
1986
|
+
target: z11.literal("kay.app"),
|
|
1987
|
+
slug: z11.literal("skills.write"),
|
|
1988
|
+
envelope: z11.strictObject({})
|
|
1930
1989
|
}),
|
|
1931
|
-
|
|
1990
|
+
z11.strictObject({
|
|
1932
1991
|
// Publish a share plan `skills.prepareShare` built: push the user's skill, with their git
|
|
1933
1992
|
// credentials, into a marketplace repository other people's installs read. Private
|
|
1934
1993
|
// (PRIVATE_PLUGIN_CAPABILITY_SLUGS): the host has no consent prompt for an SDK call that
|
|
1935
1994
|
// sends data off the machine.
|
|
1936
|
-
target:
|
|
1937
|
-
slug:
|
|
1938
|
-
envelope:
|
|
1995
|
+
target: z11.literal("kay.app"),
|
|
1996
|
+
slug: z11.literal("skills.share"),
|
|
1997
|
+
envelope: z11.strictObject({})
|
|
1939
1998
|
}),
|
|
1940
|
-
|
|
1999
|
+
z11.strictObject({
|
|
1941
2000
|
// Turn an installed plugin on or off, which starts or stops its code under its own grants.
|
|
1942
2001
|
// Private (PRIVATE_PLUGIN_CAPABILITY_SLUGS): a plugin holding it could turn back on what the
|
|
1943
2002
|
// user turned off.
|
|
1944
|
-
target:
|
|
1945
|
-
slug:
|
|
1946
|
-
envelope:
|
|
2003
|
+
target: z11.literal("kay.app"),
|
|
2004
|
+
slug: z11.literal("plugins.set-enabled"),
|
|
2005
|
+
envelope: z11.strictObject({})
|
|
1947
2006
|
}),
|
|
1948
|
-
|
|
2007
|
+
z11.strictObject({
|
|
1949
2008
|
// Write a steward entry (recap, next steps, title, work headlines) into the session whose
|
|
1950
2009
|
// event the calling handler is answering. Bound to that session: a call for any other is
|
|
1951
2010
|
// refused. The daemon keeps its own bounds on every field.
|
|
1952
|
-
target:
|
|
1953
|
-
slug:
|
|
1954
|
-
envelope:
|
|
2011
|
+
target: z11.literal("kay.app"),
|
|
2012
|
+
slug: z11.literal("sessions.annotate"),
|
|
2013
|
+
envelope: z11.strictObject({})
|
|
1955
2014
|
}),
|
|
1956
|
-
|
|
2015
|
+
z11.strictObject({
|
|
1957
2016
|
// Compact the session whose event the calling handler is answering. Its own claim because
|
|
1958
2017
|
// compaction rewrites the live context and spends a model call; the daemon keeps the user's
|
|
1959
2018
|
// consent switch and the context floor in front of it.
|
|
1960
|
-
target:
|
|
1961
|
-
slug:
|
|
1962
|
-
envelope:
|
|
2019
|
+
target: z11.literal("kay.app"),
|
|
2020
|
+
slug: z11.literal("sessions.compact"),
|
|
2021
|
+
envelope: z11.strictObject({})
|
|
1963
2022
|
}),
|
|
1964
|
-
|
|
2023
|
+
z11.strictObject({
|
|
1965
2024
|
// Read and rewrite the soul file every new conversation is told. Private
|
|
1966
2025
|
// (PRIVATE_PLUGIN_CAPABILITY_SLUGS): only a plugin the release carries may hold it.
|
|
1967
|
-
target:
|
|
1968
|
-
slug:
|
|
1969
|
-
envelope:
|
|
2026
|
+
target: z11.literal("kay.app"),
|
|
2027
|
+
slug: z11.literal("soul.write"),
|
|
2028
|
+
envelope: z11.strictObject({})
|
|
1970
2029
|
}),
|
|
1971
|
-
|
|
2030
|
+
z11.strictObject({
|
|
1972
2031
|
// The text an agent sees for a tool or an address in a live session, where each comes from,
|
|
1973
2032
|
// and whether it is one of Bonsai's own. Read-only and never a call. An empty envelope because
|
|
1974
2033
|
// the grant itself is the visibility decision, as with `skills.read`.
|
|
1975
|
-
target:
|
|
1976
|
-
slug:
|
|
1977
|
-
envelope:
|
|
2034
|
+
target: z11.literal("kay.app"),
|
|
2035
|
+
slug: z11.literal("tools.describe"),
|
|
2036
|
+
envelope: z11.strictObject({})
|
|
1978
2037
|
}),
|
|
1979
|
-
|
|
1980
|
-
target:
|
|
1981
|
-
slug:
|
|
1982
|
-
envelope:
|
|
2038
|
+
z11.strictObject({
|
|
2039
|
+
target: z11.literal("kay.app"),
|
|
2040
|
+
slug: z11.literal("workspace.command"),
|
|
2041
|
+
envelope: z11.strictObject({})
|
|
1983
2042
|
}),
|
|
1984
|
-
|
|
1985
|
-
target:
|
|
1986
|
-
slug:
|
|
1987
|
-
envelope:
|
|
2043
|
+
z11.strictObject({
|
|
2044
|
+
target: z11.literal("kay.app"),
|
|
2045
|
+
slug: z11.literal("sessions.create"),
|
|
2046
|
+
envelope: z11.strictObject({})
|
|
1988
2047
|
}),
|
|
1989
|
-
|
|
1990
|
-
target:
|
|
1991
|
-
slug:
|
|
1992
|
-
envelope:
|
|
2048
|
+
z11.strictObject({
|
|
2049
|
+
target: z11.literal("kay.app"),
|
|
2050
|
+
slug: z11.literal("sessions.update"),
|
|
2051
|
+
envelope: z11.strictObject({})
|
|
1993
2052
|
}),
|
|
1994
|
-
|
|
1995
|
-
target:
|
|
1996
|
-
slug:
|
|
1997
|
-
envelope:
|
|
2053
|
+
z11.strictObject({
|
|
2054
|
+
target: z11.literal("kay.app"),
|
|
2055
|
+
slug: z11.literal("models.complete"),
|
|
2056
|
+
envelope: z11.strictObject({})
|
|
1998
2057
|
}),
|
|
1999
|
-
|
|
2058
|
+
z11.strictObject({
|
|
2000
2059
|
// Held to `kay.app`, the daemon-lifetime tier, even though the same System One client is exposed on
|
|
2001
2060
|
// BOTH the `kay.app` and `kay.agent` plugin SDKs (and to host composition directly): a slug
|
|
2002
2061
|
// pins exactly one target (see this file's module doc), so one shared claim is simpler and
|
|
@@ -2005,195 +2064,195 @@ function createAuthoritySchemas(canonical) {
|
|
|
2005
2064
|
// plugin's own pinned authority, which already spans both targets for every other capability
|
|
2006
2065
|
// (`network.connect`/`tool-interception.register` are decided by the identical per-plugin
|
|
2007
2066
|
// handle `kay.app`-target claims use). `app.systemOne` authorizes against it the same way.
|
|
2008
|
-
target:
|
|
2009
|
-
slug:
|
|
2010
|
-
envelope:
|
|
2067
|
+
target: z11.literal("kay.app"),
|
|
2068
|
+
slug: z11.literal("systemOne.use"),
|
|
2069
|
+
envelope: z11.strictObject({})
|
|
2011
2070
|
}),
|
|
2012
|
-
|
|
2013
|
-
target:
|
|
2014
|
-
slug:
|
|
2015
|
-
envelope:
|
|
2071
|
+
z11.strictObject({
|
|
2072
|
+
target: z11.literal("kay.app"),
|
|
2073
|
+
slug: z11.literal("automations.write"),
|
|
2074
|
+
envelope: z11.strictObject({})
|
|
2016
2075
|
}),
|
|
2017
|
-
|
|
2018
|
-
target:
|
|
2019
|
-
slug:
|
|
2020
|
-
envelope:
|
|
2076
|
+
z11.strictObject({
|
|
2077
|
+
target: z11.literal("kay.app"),
|
|
2078
|
+
slug: z11.literal("automations.run"),
|
|
2079
|
+
envelope: z11.strictObject({})
|
|
2021
2080
|
}),
|
|
2022
|
-
|
|
2023
|
-
target:
|
|
2024
|
-
slug:
|
|
2025
|
-
envelope:
|
|
2081
|
+
z11.strictObject({
|
|
2082
|
+
target: z11.literal("kay.app"),
|
|
2083
|
+
slug: z11.literal("workflows.define"),
|
|
2084
|
+
envelope: z11.strictObject({})
|
|
2026
2085
|
}),
|
|
2027
|
-
|
|
2086
|
+
z11.strictObject({
|
|
2028
2087
|
// Start a declared workflow on every plugin's signal events (`signals: true`), which carry
|
|
2029
2088
|
// other plugins' data. Private (PRIVATE_PLUGIN_CAPABILITY_SLUGS): only a plugin the release
|
|
2030
2089
|
// carries may hold it, so a third-party plugin cannot read every source's signals.
|
|
2031
|
-
target:
|
|
2032
|
-
slug:
|
|
2033
|
-
envelope:
|
|
2090
|
+
target: z11.literal("kay.app"),
|
|
2091
|
+
slug: z11.literal("workflows.signals"),
|
|
2092
|
+
envelope: z11.strictObject({})
|
|
2034
2093
|
}),
|
|
2035
|
-
|
|
2036
|
-
target:
|
|
2037
|
-
slug:
|
|
2038
|
-
envelope:
|
|
2094
|
+
z11.strictObject({
|
|
2095
|
+
target: z11.literal("kay.app"),
|
|
2096
|
+
slug: z11.literal("session-events.subscribe"),
|
|
2097
|
+
envelope: z11.strictObject({})
|
|
2039
2098
|
}),
|
|
2040
|
-
|
|
2041
|
-
target:
|
|
2042
|
-
slug:
|
|
2043
|
-
envelope:
|
|
2099
|
+
z11.strictObject({
|
|
2100
|
+
target: z11.literal("kay.app"),
|
|
2101
|
+
slug: z11.literal("agents.run"),
|
|
2102
|
+
envelope: z11.strictObject({})
|
|
2044
2103
|
}),
|
|
2045
|
-
|
|
2046
|
-
target:
|
|
2047
|
-
slug:
|
|
2104
|
+
z11.strictObject({
|
|
2105
|
+
target: z11.literal("kay.app"),
|
|
2106
|
+
slug: z11.literal("dynamic-context.register"),
|
|
2048
2107
|
// The declared `contributes.contextContributors` localId, which doubles as the contributor's
|
|
2049
2108
|
// section tag at the model boundary - so the row a human consents to names the section.
|
|
2050
|
-
envelope:
|
|
2109
|
+
envelope: z11.strictObject({ contributor: NonEmptyString3 })
|
|
2051
2110
|
}),
|
|
2052
|
-
|
|
2053
|
-
target:
|
|
2054
|
-
slug:
|
|
2111
|
+
z11.strictObject({
|
|
2112
|
+
target: z11.literal("kay.app"),
|
|
2113
|
+
slug: z11.literal("app-data.register"),
|
|
2055
2114
|
/** The declared `contributes.dataSources` localId. */
|
|
2056
|
-
envelope:
|
|
2115
|
+
envelope: z11.strictObject({ source: NonEmptyString3 })
|
|
2057
2116
|
}),
|
|
2058
|
-
|
|
2059
|
-
target:
|
|
2060
|
-
slug:
|
|
2061
|
-
envelope:
|
|
2117
|
+
z11.strictObject({
|
|
2118
|
+
target: z11.literal("kay.agent"),
|
|
2119
|
+
slug: z11.literal("session-artifacts.read"),
|
|
2120
|
+
envelope: z11.strictObject({ kind: z11.enum(["upload", "output"]) })
|
|
2062
2121
|
}),
|
|
2063
|
-
|
|
2064
|
-
target:
|
|
2065
|
-
slug:
|
|
2066
|
-
envelope:
|
|
2122
|
+
z11.strictObject({
|
|
2123
|
+
target: z11.literal("kay.agent"),
|
|
2124
|
+
slug: z11.literal("session-artifacts.create"),
|
|
2125
|
+
envelope: z11.strictObject({ kind: z11.literal("output") })
|
|
2067
2126
|
}),
|
|
2068
|
-
|
|
2069
|
-
target:
|
|
2070
|
-
slug:
|
|
2071
|
-
envelope:
|
|
2127
|
+
z11.strictObject({
|
|
2128
|
+
target: z11.literal("kay.app"),
|
|
2129
|
+
slug: z11.literal("artifacts.read"),
|
|
2130
|
+
envelope: z11.strictObject({ kind: z11.literal("output") })
|
|
2072
2131
|
}),
|
|
2073
|
-
|
|
2074
|
-
target:
|
|
2075
|
-
slug:
|
|
2076
|
-
envelope:
|
|
2132
|
+
z11.strictObject({
|
|
2133
|
+
target: z11.literal("kay.app"),
|
|
2134
|
+
slug: z11.literal("knowledge-source.register"),
|
|
2135
|
+
envelope: z11.strictObject({ source: NonEmptyString3 })
|
|
2077
2136
|
}),
|
|
2078
|
-
|
|
2079
|
-
target:
|
|
2080
|
-
slug:
|
|
2081
|
-
envelope:
|
|
2137
|
+
z11.strictObject({
|
|
2138
|
+
target: z11.literal("kay.app"),
|
|
2139
|
+
slug: z11.literal("account.assert"),
|
|
2140
|
+
envelope: z11.strictObject({})
|
|
2082
2141
|
}),
|
|
2083
|
-
|
|
2084
|
-
target:
|
|
2085
|
-
slug:
|
|
2086
|
-
envelope:
|
|
2142
|
+
z11.strictObject({
|
|
2143
|
+
target: z11.literal("kay.app"),
|
|
2144
|
+
slug: z11.literal("account.update"),
|
|
2145
|
+
envelope: z11.strictObject({})
|
|
2087
2146
|
}),
|
|
2088
|
-
|
|
2089
|
-
target:
|
|
2090
|
-
slug:
|
|
2091
|
-
envelope:
|
|
2147
|
+
z11.strictObject({
|
|
2148
|
+
target: z11.literal("kay.app"),
|
|
2149
|
+
slug: z11.literal("agents.permissions"),
|
|
2150
|
+
envelope: z11.strictObject({
|
|
2092
2151
|
/** The definition's local id - WHICH agent these rules are authored onto. */
|
|
2093
2152
|
agent: NonEmptyString3,
|
|
2094
2153
|
/** `definition.permissions`, in declaration order (order is semantic; first match wins). */
|
|
2095
|
-
rules:
|
|
2154
|
+
rules: z11.array(PluginAgentDefinitionPermissionRule2),
|
|
2096
2155
|
/** `definition.permissionsFallback`, in declaration order. */
|
|
2097
|
-
fallback:
|
|
2156
|
+
fallback: z11.array(PluginAgentDefinitionPermissionRule2)
|
|
2098
2157
|
})
|
|
2099
2158
|
}),
|
|
2100
|
-
|
|
2101
|
-
target:
|
|
2102
|
-
slug:
|
|
2103
|
-
envelope:
|
|
2159
|
+
z11.strictObject({
|
|
2160
|
+
target: z11.literal("kay.agent"),
|
|
2161
|
+
slug: z11.literal("tool-interception.register"),
|
|
2162
|
+
envelope: z11.strictObject({})
|
|
2104
2163
|
}),
|
|
2105
|
-
|
|
2106
|
-
target:
|
|
2107
|
-
slug:
|
|
2164
|
+
z11.strictObject({
|
|
2165
|
+
target: z11.literal("kay.agent"),
|
|
2166
|
+
slug: z11.literal("interaction.surface"),
|
|
2108
2167
|
/** The one Bonsai-shipped interaction surface this plugin may drive; one claim per surface. */
|
|
2109
|
-
envelope:
|
|
2110
|
-
surface:
|
|
2168
|
+
envelope: z11.strictObject({
|
|
2169
|
+
surface: z11.enum(["browser-pane", "desktop"])
|
|
2111
2170
|
})
|
|
2112
2171
|
}),
|
|
2113
|
-
|
|
2114
|
-
target:
|
|
2115
|
-
slug:
|
|
2172
|
+
z11.strictObject({
|
|
2173
|
+
target: z11.literal("plugin"),
|
|
2174
|
+
slug: z11.literal("config.declare-section"),
|
|
2116
2175
|
/** The settings-document section key, e.g. `models` or `plugins.com.acme.thing`. */
|
|
2117
|
-
envelope:
|
|
2176
|
+
envelope: z11.strictObject({ section: NonEmptyString3 })
|
|
2118
2177
|
}),
|
|
2119
|
-
|
|
2120
|
-
target:
|
|
2121
|
-
slug:
|
|
2178
|
+
z11.strictObject({
|
|
2179
|
+
target: z11.literal("plugin"),
|
|
2180
|
+
slug: z11.literal("auth.own-service"),
|
|
2122
2181
|
/** The minted global service id this plugin would own, e.g. `google.account`. */
|
|
2123
|
-
envelope:
|
|
2182
|
+
envelope: z11.strictObject({ service: NonEmptyString3 })
|
|
2124
2183
|
}),
|
|
2125
|
-
|
|
2126
|
-
target:
|
|
2127
|
-
slug:
|
|
2184
|
+
z11.strictObject({
|
|
2185
|
+
target: z11.literal("plugin"),
|
|
2186
|
+
slug: z11.literal("auth.shared-identity"),
|
|
2128
2187
|
/** The foreign global service id whose identity this plugin would resolve against. */
|
|
2129
|
-
envelope:
|
|
2188
|
+
envelope: z11.strictObject({ service: NonEmptyString3 })
|
|
2130
2189
|
}),
|
|
2131
|
-
|
|
2132
|
-
target:
|
|
2133
|
-
slug:
|
|
2190
|
+
z11.strictObject({
|
|
2191
|
+
target: z11.literal("plugin"),
|
|
2192
|
+
slug: z11.literal("cli.bind"),
|
|
2134
2193
|
/** The binary basename a resolved credential would be injected into. */
|
|
2135
|
-
envelope:
|
|
2194
|
+
envelope: z11.strictObject({ binary: NonEmptyString3 })
|
|
2136
2195
|
}),
|
|
2137
|
-
|
|
2138
|
-
target:
|
|
2139
|
-
slug:
|
|
2196
|
+
z11.strictObject({
|
|
2197
|
+
target: z11.literal("plugin"),
|
|
2198
|
+
slug: z11.literal("mcp.host-server"),
|
|
2140
2199
|
// The daemon dials this endpoint, holds its sign-in, and serves it as `mcp://<name>`, so the
|
|
2141
2200
|
// endpoint becomes daemon execution authority. It also lets the plugin's own code call any of
|
|
2142
2201
|
// the server's tools, writes included, through `api.vendoredMcp`, which the per-tool
|
|
2143
2202
|
// `mcp:<server>::<tool>` permission rows do not gate. One claim per exact name and URL.
|
|
2144
|
-
envelope:
|
|
2203
|
+
envelope: z11.strictObject({ name: NonEmptyString3, url: NonEmptyString3 })
|
|
2145
2204
|
}),
|
|
2146
|
-
|
|
2147
|
-
target:
|
|
2148
|
-
slug:
|
|
2205
|
+
z11.strictObject({
|
|
2206
|
+
target: z11.literal("plugin"),
|
|
2207
|
+
slug: z11.literal("prompt.resident"),
|
|
2149
2208
|
// A section of the plugin's own text in every session's system prompt. An empty envelope
|
|
2150
2209
|
// because the grant itself is the decision; the host caps the section's length.
|
|
2151
|
-
envelope:
|
|
2210
|
+
envelope: z11.strictObject({})
|
|
2152
2211
|
}),
|
|
2153
|
-
|
|
2212
|
+
z11.strictObject({
|
|
2154
2213
|
// Private API: registering the policy the daemon consults to pick a chat's model as it goes
|
|
2155
2214
|
// (`app.modelSelection.registerPolicy`). Only a plugin the release carries holds it.
|
|
2156
|
-
target:
|
|
2157
|
-
slug:
|
|
2158
|
-
envelope:
|
|
2215
|
+
target: z11.literal("kay.app"),
|
|
2216
|
+
slug: z11.literal("model-selection.register"),
|
|
2217
|
+
envelope: z11.strictObject({})
|
|
2159
2218
|
}),
|
|
2160
|
-
|
|
2219
|
+
z11.strictObject({
|
|
2161
2220
|
// Private API: adding text to every chat's system prompt (`app.systemPrompt.register`).
|
|
2162
2221
|
// Only a plugin the release carries holds it, so the text has no length cap yet.
|
|
2163
|
-
target:
|
|
2164
|
-
slug:
|
|
2165
|
-
envelope:
|
|
2222
|
+
target: z11.literal("kay.app"),
|
|
2223
|
+
slug: z11.literal("system-prompt.register"),
|
|
2224
|
+
envelope: z11.strictObject({})
|
|
2166
2225
|
}),
|
|
2167
|
-
|
|
2168
|
-
target:
|
|
2169
|
-
slug:
|
|
2226
|
+
z11.strictObject({
|
|
2227
|
+
target: z11.literal("plugin"),
|
|
2228
|
+
slug: z11.literal("skills.declared-source"),
|
|
2170
2229
|
envelope: DeclaredSkillSourceEnvelope2
|
|
2171
2230
|
}),
|
|
2172
2231
|
WhiteboardCapabilityClaimV12
|
|
2173
2232
|
]);
|
|
2174
|
-
const PluginCapabilityRefusalLayer2 =
|
|
2175
|
-
const PluginCapabilityRefusalCode2 =
|
|
2233
|
+
const PluginCapabilityRefusalLayer2 = z11.enum(["grant", "binding", "release"]);
|
|
2234
|
+
const PluginCapabilityRefusalCode2 = z11.enum([
|
|
2176
2235
|
"not-granted",
|
|
2177
2236
|
"grant-read-failed",
|
|
2178
2237
|
"binding-missing",
|
|
2179
2238
|
"argv-outside-class",
|
|
2180
2239
|
"builtin-only"
|
|
2181
2240
|
]);
|
|
2182
|
-
const PluginCapabilityRefusalV12 =
|
|
2241
|
+
const PluginCapabilityRefusalV12 = z11.strictObject({
|
|
2183
2242
|
claim: PluginCapabilityClaimV12,
|
|
2184
2243
|
layer: PluginCapabilityRefusalLayer2,
|
|
2185
2244
|
code: PluginCapabilityRefusalCode2,
|
|
2186
2245
|
message: NonEmptyString3,
|
|
2187
2246
|
artifactGenerationId: ArtifactGenerationId2.optional()
|
|
2188
2247
|
});
|
|
2189
|
-
const PluginCapabilityDecisionV12 =
|
|
2190
|
-
|
|
2191
|
-
kind:
|
|
2248
|
+
const PluginCapabilityDecisionV12 = z11.discriminatedUnion("kind", [
|
|
2249
|
+
z11.strictObject({
|
|
2250
|
+
kind: z11.literal("allowed"),
|
|
2192
2251
|
claim: PluginCapabilityClaimV12,
|
|
2193
2252
|
artifactGenerationId: ArtifactGenerationId2.optional()
|
|
2194
2253
|
}),
|
|
2195
|
-
|
|
2196
|
-
kind:
|
|
2254
|
+
z11.strictObject({
|
|
2255
|
+
kind: z11.literal("refused"),
|
|
2197
2256
|
refusal: PluginCapabilityRefusalV12
|
|
2198
2257
|
})
|
|
2199
2258
|
]);
|
|
@@ -2211,7 +2270,7 @@ function createAuthoritySchemas(canonical) {
|
|
|
2211
2270
|
}
|
|
2212
2271
|
var { WhiteboardCapabilityScope, WhiteboardCapabilityOperation, WhiteboardCapabilityClaimV1, DeclaredSkillSourceEnvelope, PluginCapabilityClaimV1, PluginCapabilityRefusalLayer, PluginCapabilityRefusalCode, PluginCapabilityRefusalV1, PluginCapabilityDecisionV1 } = createAuthoritySchemas(false);
|
|
2213
2272
|
var canonicalAuthoritySchemas = createAuthoritySchemas(true);
|
|
2214
|
-
var PluginCapabilityClaimInputV1 =
|
|
2273
|
+
var PluginCapabilityClaimInputV1 = z11.custom((value) => PluginCapabilityClaimV1.safeParse(value).success, "Invalid capability claim");
|
|
2215
2274
|
function normalizeNetworkConnectHost(value) {
|
|
2216
2275
|
const trimmed = value.trim();
|
|
2217
2276
|
if (trimmed.length === 0)
|
|
@@ -2821,7 +2880,7 @@ __export(contributions_exports, {
|
|
|
2821
2880
|
isUiAppSourceModule: () => isUiAppSourceModule,
|
|
2822
2881
|
uiAppSourceStylePath: () => uiAppSourceStylePath
|
|
2823
2882
|
});
|
|
2824
|
-
import { z as
|
|
2883
|
+
import { z as z13 } from "zod";
|
|
2825
2884
|
|
|
2826
2885
|
// packages/plugin-protocol/dist/plugin-events.js
|
|
2827
2886
|
var plugin_events_exports = {};
|
|
@@ -2848,7 +2907,7 @@ __export(plugin_events_exports, {
|
|
|
2848
2907
|
canonicalPluginEventSchemas: () => canonicalPluginEventSchemas,
|
|
2849
2908
|
pluginSignalPayloadJsonSchema: () => pluginSignalPayloadJsonSchema
|
|
2850
2909
|
});
|
|
2851
|
-
import { z as
|
|
2910
|
+
import { z as z12 } from "zod";
|
|
2852
2911
|
|
|
2853
2912
|
// packages/plugin-protocol/dist/plugin-signal-limits.js
|
|
2854
2913
|
var PLUGIN_EVENT_REFUSED_ERROR_NAME = "PluginEventRefusedError";
|
|
@@ -2874,8 +2933,8 @@ var PLUGIN_SIGNAL_RELATED_KEYS = [
|
|
|
2874
2933
|
var PLUGIN_EVENT_ID_MAX_BYTES = 1024;
|
|
2875
2934
|
function createPluginEventsSchemas(canonical) {
|
|
2876
2935
|
const { GlobalContributionId: GlobalContributionId2, NonEmptyString: NonEmptyString3 } = canonical ? canonicalCommonSchemas : common_exports;
|
|
2877
|
-
const PluginEventLocalId2 =
|
|
2878
|
-
const PluginEventUri2 =
|
|
2936
|
+
const PluginEventLocalId2 = z12.string().regex(/^[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)*$/);
|
|
2937
|
+
const PluginEventUri2 = z12.string().refine((value) => {
|
|
2879
2938
|
if (!/^[a-z][a-z0-9+.-]*:/i.test(value) || /[\s\p{Cc}\\<>"{}|^`]/u.test(value) || /%(?![a-f0-9]{2})/i.test(value))
|
|
2880
2939
|
return false;
|
|
2881
2940
|
try {
|
|
@@ -2884,24 +2943,24 @@ function createPluginEventsSchemas(canonical) {
|
|
|
2884
2943
|
return false;
|
|
2885
2944
|
}
|
|
2886
2945
|
}, { message: "Expected an absolute resource URI" });
|
|
2887
|
-
const PluginEventTimestamp2 =
|
|
2946
|
+
const PluginEventTimestamp2 = z12.iso.datetime().refine((value) => !/\.\d{10}/.test(value), {
|
|
2888
2947
|
message: "Expected an ISO instant with at most nanosecond precision"
|
|
2889
2948
|
});
|
|
2890
|
-
const PluginEventRelated2 =
|
|
2891
|
-
const PluginEventPublishSource2 =
|
|
2949
|
+
const PluginEventRelated2 = z12.record(NonEmptyString3, z12.union([PluginEventUri2, z12.array(PluginEventUri2)]));
|
|
2950
|
+
const PluginEventPublishSource2 = z12.strictObject({
|
|
2892
2951
|
poller: NonEmptyString3.optional(),
|
|
2893
2952
|
runId: NonEmptyString3.optional()
|
|
2894
2953
|
});
|
|
2895
|
-
const PluginEventSource2 =
|
|
2896
|
-
layer:
|
|
2954
|
+
const PluginEventSource2 = z12.strictObject({
|
|
2955
|
+
layer: z12.literal("runtime"),
|
|
2897
2956
|
pluginId: NonEmptyString3,
|
|
2898
2957
|
sessionId: NonEmptyString3.optional(),
|
|
2899
2958
|
...PluginEventPublishSource2.shape
|
|
2900
2959
|
});
|
|
2901
|
-
const PluginEventId2 =
|
|
2960
|
+
const PluginEventId2 = z12.string().min(1).refine((value) => value === value.trim() && !/\p{Cc}/u.test(value) && new TextEncoder().encode(value).length <= PLUGIN_EVENT_ID_MAX_BYTES, {
|
|
2902
2961
|
message: "Event identity must be control-free, unpadded, and at most 1024 UTF-8 bytes"
|
|
2903
2962
|
});
|
|
2904
|
-
const PluginEventPublishInput2 =
|
|
2963
|
+
const PluginEventPublishInput2 = z12.strictObject({
|
|
2905
2964
|
uri: PluginEventUri2,
|
|
2906
2965
|
related: PluginEventRelated2.optional(),
|
|
2907
2966
|
key: PluginEventId2.optional(),
|
|
@@ -2909,11 +2968,11 @@ function createPluginEventsSchemas(canonical) {
|
|
|
2909
2968
|
source: PluginEventPublishSource2.optional(),
|
|
2910
2969
|
payload: JsonValue.optional()
|
|
2911
2970
|
});
|
|
2912
|
-
const PluginEventEnvelope2 =
|
|
2971
|
+
const PluginEventEnvelope2 = z12.strictObject({
|
|
2913
2972
|
id: PluginEventId2,
|
|
2914
2973
|
localId: PluginEventLocalId2,
|
|
2915
2974
|
type: GlobalContributionId2,
|
|
2916
|
-
version:
|
|
2975
|
+
version: z12.number().int().positive(),
|
|
2917
2976
|
uri: PluginEventUri2,
|
|
2918
2977
|
related: PluginEventRelated2.optional(),
|
|
2919
2978
|
key: PluginEventPublishInput2.shape.key,
|
|
@@ -2922,30 +2981,30 @@ function createPluginEventsSchemas(canonical) {
|
|
|
2922
2981
|
source: PluginEventSource2,
|
|
2923
2982
|
payload: JsonValue.optional()
|
|
2924
2983
|
});
|
|
2925
|
-
const PluginSignal2 =
|
|
2926
|
-
kind:
|
|
2927
|
-
direction:
|
|
2928
|
-
title:
|
|
2929
|
-
snippet:
|
|
2930
|
-
actor:
|
|
2931
|
-
name:
|
|
2984
|
+
const PluginSignal2 = z12.strictObject({
|
|
2985
|
+
kind: z12.enum(PLUGIN_SIGNAL_KINDS),
|
|
2986
|
+
direction: z12.enum(["in", "out"]).optional(),
|
|
2987
|
+
title: z12.string().max(PLUGIN_SIGNAL_TITLE_MAX).optional(),
|
|
2988
|
+
snippet: z12.string().max(PLUGIN_SIGNAL_SNIPPET_MAX).optional(),
|
|
2989
|
+
actor: z12.strictObject({
|
|
2990
|
+
name: z12.string().max(PLUGIN_SIGNAL_TITLE_MAX).optional(),
|
|
2932
2991
|
uri: PluginEventUri2
|
|
2933
2992
|
}).optional(),
|
|
2934
|
-
addressed:
|
|
2935
|
-
labels:
|
|
2993
|
+
addressed: z12.enum(["direct", "cc", "mention", "group", "none"]).optional(),
|
|
2994
|
+
labels: z12.array(z12.string().min(1).max(PLUGIN_SIGNAL_LABEL_MAX)).max(PLUGIN_SIGNAL_LABELS_MAX).optional(),
|
|
2936
2995
|
dueAt: PluginEventTimestamp2.optional(),
|
|
2937
|
-
state:
|
|
2996
|
+
state: z12.enum(["open", "resolved"]).optional()
|
|
2938
2997
|
}).refine((signal) => signal.state === void 0 || signal.kind === "status", {
|
|
2939
2998
|
message: "state is only for a status signal",
|
|
2940
2999
|
path: ["state"]
|
|
2941
3000
|
});
|
|
2942
|
-
const PluginSignalRelatedValue =
|
|
3001
|
+
const PluginSignalRelatedValue = z12.union([
|
|
2943
3002
|
PluginEventUri2,
|
|
2944
|
-
|
|
3003
|
+
z12.array(PluginEventUri2)
|
|
2945
3004
|
]);
|
|
2946
|
-
const PluginSignalPublish2 =
|
|
3005
|
+
const PluginSignalPublish2 = z12.object({
|
|
2947
3006
|
payload: PluginSignal2,
|
|
2948
|
-
related:
|
|
3007
|
+
related: z12.strictObject({
|
|
2949
3008
|
thread: PluginEventUri2,
|
|
2950
3009
|
from: PluginSignalRelatedValue.optional(),
|
|
2951
3010
|
to: PluginSignalRelatedValue.optional(),
|
|
@@ -2969,7 +3028,7 @@ function createPluginEventsSchemas(canonical) {
|
|
|
2969
3028
|
var { PluginSignal, PluginSignalPublish, PluginEventLocalId, PluginEventUri, PluginEventTimestamp, PluginEventRelated, PluginEventPublishSource, PluginEventSource, PluginEventId, PluginEventPublishInput, PluginEventEnvelope } = createPluginEventsSchemas(false);
|
|
2970
3029
|
var canonicalPluginEventSchemas = createPluginEventsSchemas(true);
|
|
2971
3030
|
function pluginSignalPayloadJsonSchema() {
|
|
2972
|
-
return
|
|
3031
|
+
return z12.toJSONSchema(PluginSignal, {
|
|
2973
3032
|
io: "input",
|
|
2974
3033
|
unrepresentable: "any"
|
|
2975
3034
|
});
|
|
@@ -3324,22 +3383,22 @@ function createContributionsSchemas(canonical) {
|
|
|
3324
3383
|
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;
|
|
3325
3384
|
const { ScopeRequirement: ScopeRequirement2 } = canonical ? canonicalPermissionSchemas : permissions_exports;
|
|
3326
3385
|
const OptionalDisplayName = NonEmptyString3.optional();
|
|
3327
|
-
const ApprovalCardValueName =
|
|
3328
|
-
const ApprovalCardForm2 =
|
|
3386
|
+
const ApprovalCardValueName = z13.string().regex(/^[A-Za-z][A-Za-z0-9_]{0,63}$/u, "must be a plain field name");
|
|
3387
|
+
const ApprovalCardForm2 = z13.strictObject({
|
|
3329
3388
|
/** Where the write goes: a fixed address, or the card value that names one. */
|
|
3330
|
-
uri:
|
|
3331
|
-
|
|
3332
|
-
|
|
3389
|
+
uri: z13.union([
|
|
3390
|
+
z13.strictObject({ fixed: NonEmptyString3 }),
|
|
3391
|
+
z13.strictObject({ value: ApprovalCardValueName })
|
|
3333
3392
|
]),
|
|
3334
3393
|
/** The delivery request fields this kind of card accepts, beyond provider and account. */
|
|
3335
|
-
requestFields:
|
|
3394
|
+
requestFields: z13.array(ApprovalCardValueName).optional(),
|
|
3336
3395
|
/** Payload field to the card value it is filled from. An absent value or empty list is left out. */
|
|
3337
|
-
payload:
|
|
3396
|
+
payload: z13.record(ApprovalCardValueName, ApprovalCardValueName),
|
|
3338
3397
|
/** Payload fields with a constant value. */
|
|
3339
|
-
fixed:
|
|
3398
|
+
fixed: z13.record(ApprovalCardValueName, z13.union([z13.string(), z13.boolean()])).optional()
|
|
3340
3399
|
});
|
|
3341
3400
|
const ApprovalCardStoredForm2 = ApprovalCardForm2.extend({
|
|
3342
|
-
read:
|
|
3401
|
+
read: z13.strictObject({
|
|
3343
3402
|
revision: ApprovalCardValueName,
|
|
3344
3403
|
body: ApprovalCardValueName,
|
|
3345
3404
|
subject: ApprovalCardValueName.optional(),
|
|
@@ -3350,13 +3409,13 @@ function createContributionsSchemas(canonical) {
|
|
|
3350
3409
|
attachments: ApprovalCardValueName.optional()
|
|
3351
3410
|
})
|
|
3352
3411
|
});
|
|
3353
|
-
const ApprovalCardField =
|
|
3412
|
+
const ApprovalCardField = z13.strictObject({
|
|
3354
3413
|
key: ApprovalCardValueName,
|
|
3355
|
-
max:
|
|
3414
|
+
max: z13.number().int().positive()
|
|
3356
3415
|
});
|
|
3357
|
-
const ApprovalTypeContribution2 =
|
|
3416
|
+
const ApprovalTypeContribution2 = z13.strictObject({
|
|
3358
3417
|
localId: LocalContributionId2,
|
|
3359
|
-
kind:
|
|
3418
|
+
kind: z13.literal("message"),
|
|
3360
3419
|
/** The URI scheme of `uriModule` that cards of this type write to. */
|
|
3361
3420
|
provider: UriScheme2,
|
|
3362
3421
|
/** The local id of this plugin's URI module that handles the write. */
|
|
@@ -3364,82 +3423,82 @@ function createContributionsSchemas(canonical) {
|
|
|
3364
3423
|
/** Shown when a send's outcome cannot be confirmed: where the person checks. */
|
|
3365
3424
|
unknownMessage: NonEmptyString3,
|
|
3366
3425
|
/** The payload fields holding the text a person may edit. A `subject` makes this a mail type. */
|
|
3367
|
-
fields:
|
|
3426
|
+
fields: z13.strictObject({
|
|
3368
3427
|
body: ApprovalCardField,
|
|
3369
3428
|
subject: ApprovalCardField.optional()
|
|
3370
3429
|
}),
|
|
3371
|
-
presentation:
|
|
3372
|
-
showAccount:
|
|
3373
|
-
recipient:
|
|
3430
|
+
presentation: z13.strictObject({
|
|
3431
|
+
showAccount: z13.boolean(),
|
|
3432
|
+
recipient: z13.enum(["person", "target"])
|
|
3374
3433
|
}),
|
|
3375
3434
|
/** One form per kind of card this provider supports. A kind left out is never bound. */
|
|
3376
|
-
forms:
|
|
3435
|
+
forms: z13.strictObject({
|
|
3377
3436
|
inline: ApprovalCardForm2.optional(),
|
|
3378
3437
|
saved: ApprovalCardForm2.optional(),
|
|
3379
3438
|
stored: ApprovalCardStoredForm2.optional()
|
|
3380
3439
|
}),
|
|
3381
3440
|
/** What the card shows beyond its text, read from the delivery request. */
|
|
3382
|
-
display:
|
|
3441
|
+
display: z13.strictObject({
|
|
3383
3442
|
/** How the renderer reads the body. Absent is Markdown, or plain for a stored draft. */
|
|
3384
|
-
bodyFormat:
|
|
3443
|
+
bodyFormat: z13.literal("mrkdwn").optional(),
|
|
3385
3444
|
/** The request field naming what this card replies to. */
|
|
3386
3445
|
replyField: ApprovalCardValueName.optional(),
|
|
3387
3446
|
/** Shown instead of the reply's id when that id means nothing to a person. */
|
|
3388
3447
|
replyLabel: NonEmptyString3.optional(),
|
|
3389
3448
|
/** Further request fields shown as labelled lines. */
|
|
3390
|
-
facts:
|
|
3449
|
+
facts: z13.array(z13.strictObject({
|
|
3391
3450
|
label: NonEmptyString3,
|
|
3392
3451
|
field: ApprovalCardValueName
|
|
3393
3452
|
})).optional()
|
|
3394
3453
|
}).optional()
|
|
3395
3454
|
});
|
|
3396
|
-
const ToolIdentity =
|
|
3455
|
+
const ToolIdentity = z13.strictObject({
|
|
3397
3456
|
localId: LocalContributionId2,
|
|
3398
3457
|
toolName: PluginToolName2,
|
|
3399
3458
|
displayName: OptionalDisplayName,
|
|
3400
3459
|
description: NonEmptyString3.optional()
|
|
3401
3460
|
});
|
|
3402
|
-
const ToolPermission2 =
|
|
3403
|
-
kind:
|
|
3461
|
+
const ToolPermission2 = z13.strictObject({
|
|
3462
|
+
kind: z13.enum(["read", "mutate", "destructive", "execute"]),
|
|
3404
3463
|
ruleKey: NonEmptyString3.optional(),
|
|
3405
3464
|
scheme: NonEmptyString3.optional(),
|
|
3406
|
-
resourcePrefix:
|
|
3465
|
+
resourcePrefix: z13.string().max(256).optional(),
|
|
3407
3466
|
// Arguments whose string values name the resources a call touches.
|
|
3408
|
-
resourceArgs:
|
|
3409
|
-
resourceTrim:
|
|
3410
|
-
defaultPermission:
|
|
3467
|
+
resourceArgs: z13.array(NonEmptyString3).min(1).optional(),
|
|
3468
|
+
resourceTrim: z13.literal(true).optional(),
|
|
3469
|
+
defaultPermission: z13.enum(["allow", "ask", "never"]).optional(),
|
|
3411
3470
|
/** First matching rule wins; every condition in its when list must hold. */
|
|
3412
|
-
classificationRules:
|
|
3413
|
-
when:
|
|
3414
|
-
|
|
3471
|
+
classificationRules: z13.array(z13.strictObject({
|
|
3472
|
+
when: z13.array(z13.union([
|
|
3473
|
+
z13.strictObject({
|
|
3415
3474
|
arg: NonEmptyString3,
|
|
3416
|
-
equals:
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3475
|
+
equals: z13.union([
|
|
3476
|
+
z13.string(),
|
|
3477
|
+
z13.number(),
|
|
3478
|
+
z13.boolean(),
|
|
3479
|
+
z13.null()
|
|
3421
3480
|
])
|
|
3422
3481
|
}),
|
|
3423
|
-
|
|
3482
|
+
z13.strictObject({ arg: NonEmptyString3, present: z13.boolean() })
|
|
3424
3483
|
])).min(1).max(32),
|
|
3425
|
-
kind:
|
|
3484
|
+
kind: z13.enum(["read", "mutate", "destructive", "execute"]),
|
|
3426
3485
|
ruleKey: NonEmptyString3.optional()
|
|
3427
3486
|
})).min(1).max(64).optional()
|
|
3428
3487
|
});
|
|
3429
|
-
const ToolContribution2 =
|
|
3488
|
+
const ToolContribution2 = z13.strictObject({
|
|
3430
3489
|
...ToolIdentity.shape,
|
|
3431
3490
|
parameters: JsonSchema.optional(),
|
|
3432
|
-
executionMode:
|
|
3491
|
+
executionMode: z13.enum(["sequential", "parallel"]).optional(),
|
|
3433
3492
|
promptSnippet: NonEmptyString3.optional(),
|
|
3434
|
-
promptGuidelines:
|
|
3493
|
+
promptGuidelines: z13.array(NonEmptyString3).optional(),
|
|
3435
3494
|
permission: ToolPermission2.optional()
|
|
3436
3495
|
});
|
|
3437
|
-
const AgentToolContribution2 =
|
|
3496
|
+
const AgentToolContribution2 = z13.strictObject({
|
|
3438
3497
|
...ToolContribution2.shape,
|
|
3439
3498
|
parameters: JsonSchema.optional(),
|
|
3440
|
-
executionMode:
|
|
3499
|
+
executionMode: z13.enum(["sequential", "parallel"]).optional(),
|
|
3441
3500
|
promptSnippet: NonEmptyString3.optional(),
|
|
3442
|
-
promptGuidelines:
|
|
3501
|
+
promptGuidelines: z13.array(NonEmptyString3).optional(),
|
|
3443
3502
|
// A local ref names an auth service declared in this manifest; a dotted ref names another
|
|
3444
3503
|
// plugin's service, as `UriModuleContribution.authService` does.
|
|
3445
3504
|
authService: AuthServiceReference2.optional(),
|
|
@@ -3447,17 +3506,17 @@ function createContributionsSchemas(canonical) {
|
|
|
3447
3506
|
authScheme: LocalContributionId2.optional(),
|
|
3448
3507
|
permission: ToolPermission2.optional()
|
|
3449
3508
|
});
|
|
3450
|
-
const ConverterContribution2 =
|
|
3509
|
+
const ConverterContribution2 = z13.strictObject({
|
|
3451
3510
|
localId: LocalContributionId2,
|
|
3452
3511
|
displayName: OptionalDisplayName,
|
|
3453
3512
|
description: NonEmptyString3.optional(),
|
|
3454
3513
|
/** MIME types this converter claims - contract data for introspection and
|
|
3455
3514
|
* collision checks; runtime match behavior stays the converter's `matches()`. */
|
|
3456
|
-
mimeTypes:
|
|
3515
|
+
mimeTypes: z13.array(MimeTypeString2).min(1),
|
|
3457
3516
|
/** Extension fallbacks (no dot) used when a probe has no usable MIME type. */
|
|
3458
|
-
extensions:
|
|
3517
|
+
extensions: z13.array(FileExtensionToken2).min(1).optional()
|
|
3459
3518
|
});
|
|
3460
|
-
const UriOperationName =
|
|
3519
|
+
const UriOperationName = z13.enum([
|
|
3461
3520
|
"help",
|
|
3462
3521
|
"read",
|
|
3463
3522
|
"write",
|
|
@@ -3466,8 +3525,8 @@ function createContributionsSchemas(canonical) {
|
|
|
3466
3525
|
"search",
|
|
3467
3526
|
"delete"
|
|
3468
3527
|
]);
|
|
3469
|
-
const UriPermissionDefault =
|
|
3470
|
-
const UriVerbSentences =
|
|
3528
|
+
const UriPermissionDefault = z13.enum(["allow", "ask", "never"]);
|
|
3529
|
+
const UriVerbSentences = z13.strictObject({
|
|
3471
3530
|
read: NonEmptyString3.exactOptional(),
|
|
3472
3531
|
list: NonEmptyString3.exactOptional(),
|
|
3473
3532
|
search: NonEmptyString3.exactOptional(),
|
|
@@ -3475,81 +3534,83 @@ function createContributionsSchemas(canonical) {
|
|
|
3475
3534
|
edit: NonEmptyString3.exactOptional(),
|
|
3476
3535
|
delete: NonEmptyString3.exactOptional()
|
|
3477
3536
|
});
|
|
3478
|
-
const UriPatternInit =
|
|
3537
|
+
const UriPatternInit = z13.strictObject({
|
|
3479
3538
|
protocol: NonEmptyString3.exactOptional(),
|
|
3480
3539
|
hostname: NonEmptyString3.exactOptional(),
|
|
3481
3540
|
pathname: NonEmptyString3.exactOptional(),
|
|
3482
|
-
search:
|
|
3541
|
+
search: z13.string().exactOptional()
|
|
3483
3542
|
});
|
|
3484
|
-
const UriClaimContribution =
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
kind:
|
|
3543
|
+
const UriClaimContribution = z13.discriminatedUnion("kind", [
|
|
3544
|
+
z13.strictObject({ kind: z13.literal("scheme"), scheme: UriScheme2 }),
|
|
3545
|
+
z13.strictObject({
|
|
3546
|
+
kind: z13.literal("uriPattern"),
|
|
3488
3547
|
pattern: UriPatternInit,
|
|
3489
3548
|
normalizeTo: NonEmptyString3.exactOptional(),
|
|
3490
3549
|
route: LocalContributionId2.exactOptional(),
|
|
3491
3550
|
sourceUrl: NonEmptyString3.exactOptional(),
|
|
3492
3551
|
title: NonEmptyString3.exactOptional(),
|
|
3493
|
-
examples:
|
|
3552
|
+
examples: z13.array(NonEmptyString3).exactOptional()
|
|
3494
3553
|
}),
|
|
3495
|
-
|
|
3496
|
-
kind:
|
|
3554
|
+
z13.strictObject({
|
|
3555
|
+
kind: z13.literal("urlPattern"),
|
|
3497
3556
|
pattern: UriPatternInit,
|
|
3498
3557
|
normalizeTo: NonEmptyString3.exactOptional(),
|
|
3499
3558
|
route: LocalContributionId2.exactOptional(),
|
|
3500
|
-
examples:
|
|
3559
|
+
examples: z13.array(NonEmptyString3).exactOptional()
|
|
3501
3560
|
})
|
|
3502
3561
|
]);
|
|
3503
|
-
const UriTemplateContribution =
|
|
3562
|
+
const UriTemplateContribution = z13.strictObject({
|
|
3504
3563
|
uri: NonEmptyString3,
|
|
3505
3564
|
description: NonEmptyString3,
|
|
3506
|
-
operations:
|
|
3507
|
-
operationDocs:
|
|
3508
|
-
operationDefaults:
|
|
3565
|
+
operations: z13.array(UriOperationName).exactOptional(),
|
|
3566
|
+
operationDocs: z13.partialRecord(UriOperationName, NonEmptyString3).exactOptional(),
|
|
3567
|
+
operationDefaults: z13.partialRecord(UriOperationName, UriPermissionDefault).exactOptional()
|
|
3509
3568
|
});
|
|
3510
3569
|
const UriAuthActionRuleConditions = {
|
|
3511
|
-
operations:
|
|
3512
|
-
routes:
|
|
3513
|
-
query:
|
|
3570
|
+
operations: z13.array(UriOperationName).min(1).exactOptional(),
|
|
3571
|
+
routes: z13.array(LocalContributionId2).min(1).exactOptional(),
|
|
3572
|
+
query: z13.record(NonEmptyString3, z13.string()).exactOptional()
|
|
3514
3573
|
};
|
|
3515
|
-
const UriAuthActionRule =
|
|
3516
|
-
|
|
3517
|
-
|
|
3574
|
+
const UriAuthActionRule = z13.union([
|
|
3575
|
+
z13.strictObject({ ...UriAuthActionRuleConditions, action: NonEmptyString3 }),
|
|
3576
|
+
z13.strictObject({ ...UriAuthActionRuleConditions, public: z13.literal(true) })
|
|
3518
3577
|
]);
|
|
3519
|
-
const UriAgentHintContribution =
|
|
3578
|
+
const UriAgentHintContribution = z13.strictObject({
|
|
3520
3579
|
summary: NonEmptyString3,
|
|
3521
|
-
commonFlows:
|
|
3580
|
+
commonFlows: z13.array(z13.strictObject({
|
|
3522
3581
|
label: NonEmptyString3,
|
|
3523
3582
|
when: NonEmptyString3.exactOptional(),
|
|
3524
3583
|
example: NonEmptyString3
|
|
3525
3584
|
})).exactOptional(),
|
|
3526
3585
|
helpUri: NonEmptyString3.exactOptional(),
|
|
3527
|
-
triggers:
|
|
3528
|
-
keywords:
|
|
3529
|
-
patterns:
|
|
3586
|
+
triggers: z13.strictObject({
|
|
3587
|
+
keywords: z13.array(NonEmptyString3).exactOptional(),
|
|
3588
|
+
patterns: z13.array(NonEmptyString3).exactOptional()
|
|
3530
3589
|
}).exactOptional(),
|
|
3531
|
-
skills:
|
|
3590
|
+
skills: z13.array(NonEmptyString3).exactOptional()
|
|
3532
3591
|
});
|
|
3533
|
-
const ScreenActionOption =
|
|
3534
|
-
|
|
3535
|
-
kind:
|
|
3592
|
+
const ScreenActionOption = z13.discriminatedUnion("kind", [
|
|
3593
|
+
z13.strictObject({
|
|
3594
|
+
kind: z13.literal("exact"),
|
|
3536
3595
|
description: NonEmptyString3,
|
|
3537
|
-
verb:
|
|
3596
|
+
verb: z13.enum(["read", "write", "edit", "delete"]),
|
|
3538
3597
|
uri: NonEmptyString3
|
|
3539
3598
|
}),
|
|
3540
|
-
|
|
3541
|
-
kind:
|
|
3599
|
+
z13.strictObject({
|
|
3600
|
+
kind: z13.literal("catch-all"),
|
|
3542
3601
|
description: NonEmptyString3,
|
|
3543
|
-
verb:
|
|
3602
|
+
verb: z13.enum(["read", "write", "edit", "delete"])
|
|
3544
3603
|
})
|
|
3545
3604
|
]);
|
|
3546
3605
|
const UriModuleFactsShape = {
|
|
3547
|
-
|
|
3606
|
+
revisionBacked: z13.literal(true).optional(),
|
|
3607
|
+
mailCalibrationSource: z13.literal(true).optional(),
|
|
3608
|
+
screenActions: z13.strictObject({
|
|
3548
3609
|
scheme: UriScheme2,
|
|
3549
|
-
hosts:
|
|
3550
|
-
paths:
|
|
3551
|
-
apps:
|
|
3552
|
-
options:
|
|
3610
|
+
hosts: z13.array(NonEmptyString3),
|
|
3611
|
+
paths: z13.array(NonEmptyString3).min(1).optional(),
|
|
3612
|
+
apps: z13.array(NonEmptyString3),
|
|
3613
|
+
options: z13.record(NonEmptyString3, ScreenActionOption)
|
|
3553
3614
|
}).superRefine((catalog, ctx) => {
|
|
3554
3615
|
if (catalog.hosts.length === 0 && catalog.apps.length === 0) {
|
|
3555
3616
|
ctx.addIssue({
|
|
@@ -3574,29 +3635,29 @@ function createContributionsSchemas(canonical) {
|
|
|
3574
3635
|
}
|
|
3575
3636
|
}).exactOptional(),
|
|
3576
3637
|
/** Addresses the module answers, in match order; see `@herd/uri`'s `UriClaim`. */
|
|
3577
|
-
claims:
|
|
3638
|
+
claims: z13.array(UriClaimContribution).min(1).exactOptional(),
|
|
3578
3639
|
/** The module's routes, as its scheme-root `help` lists them. */
|
|
3579
|
-
templates:
|
|
3580
|
-
verbs:
|
|
3581
|
-
readable:
|
|
3582
|
-
writable:
|
|
3583
|
-
editable:
|
|
3584
|
-
deletable:
|
|
3585
|
-
listable:
|
|
3640
|
+
templates: z13.array(UriTemplateContribution).exactOptional(),
|
|
3641
|
+
verbs: z13.strictObject({
|
|
3642
|
+
readable: z13.boolean(),
|
|
3643
|
+
writable: z13.boolean(),
|
|
3644
|
+
editable: z13.boolean(),
|
|
3645
|
+
deletable: z13.boolean().exactOptional(),
|
|
3646
|
+
listable: z13.boolean(),
|
|
3586
3647
|
/** The module answers `search`. */
|
|
3587
|
-
searchable:
|
|
3648
|
+
searchable: z13.boolean().exactOptional()
|
|
3588
3649
|
}).exactOptional(),
|
|
3589
3650
|
verbDocs: UriVerbSentences.exactOptional(),
|
|
3590
|
-
permissionDefaults:
|
|
3651
|
+
permissionDefaults: z13.strictObject({
|
|
3591
3652
|
read: UriPermissionDefault.exactOptional(),
|
|
3592
3653
|
write: UriPermissionDefault.exactOptional(),
|
|
3593
3654
|
edit: UriPermissionDefault.exactOptional(),
|
|
3594
3655
|
delete: UriPermissionDefault.exactOptional()
|
|
3595
3656
|
}).exactOptional(),
|
|
3596
3657
|
/** Which sign-in action each call needs: the action table and the rules that pick one. */
|
|
3597
|
-
authActions:
|
|
3598
|
-
actions:
|
|
3599
|
-
rules:
|
|
3658
|
+
authActions: z13.strictObject({
|
|
3659
|
+
actions: z13.record(NonEmptyString3, ScopeRequirement2),
|
|
3660
|
+
rules: z13.array(UriAuthActionRule).min(1)
|
|
3600
3661
|
}).superRefine((policy, ctx) => {
|
|
3601
3662
|
policy.rules.forEach((rule, index) => {
|
|
3602
3663
|
if ("action" in rule && !(rule.action in policy.actions)) {
|
|
@@ -3608,18 +3669,18 @@ function createContributionsSchemas(canonical) {
|
|
|
3608
3669
|
}
|
|
3609
3670
|
});
|
|
3610
3671
|
}).exactOptional(),
|
|
3611
|
-
requiresConnection:
|
|
3612
|
-
acceptsSourceCopy:
|
|
3613
|
-
acceptsWriteSources:
|
|
3614
|
-
acceptsBytes:
|
|
3615
|
-
ownsLineSelectors:
|
|
3672
|
+
requiresConnection: z13.literal(true).exactOptional(),
|
|
3673
|
+
acceptsSourceCopy: z13.literal(false).exactOptional(),
|
|
3674
|
+
acceptsWriteSources: z13.literal(true).exactOptional(),
|
|
3675
|
+
acceptsBytes: z13.literal(true).exactOptional(),
|
|
3676
|
+
ownsLineSelectors: z13.literal(true).exactOptional(),
|
|
3616
3677
|
description: NonEmptyString3.exactOptional(),
|
|
3617
3678
|
agentHint: UriAgentHintContribution.exactOptional()
|
|
3618
3679
|
};
|
|
3619
|
-
const UriModuleFacts2 =
|
|
3620
|
-
const UriModuleContribution2 =
|
|
3680
|
+
const UriModuleFacts2 = z13.strictObject(UriModuleFactsShape);
|
|
3681
|
+
const UriModuleContribution2 = z13.strictObject({
|
|
3621
3682
|
localId: LocalContributionId2,
|
|
3622
|
-
schemes:
|
|
3683
|
+
schemes: z13.array(UriScheme2).min(1),
|
|
3623
3684
|
displayName: OptionalDisplayName,
|
|
3624
3685
|
...UriModuleFactsShape,
|
|
3625
3686
|
// A local ref (no dot) must name an auth service declared in this same
|
|
@@ -3642,15 +3703,15 @@ function createContributionsSchemas(canonical) {
|
|
|
3642
3703
|
// `knownResources` permission grant (`api.knownResources`). Present-means-on
|
|
3643
3704
|
// (`true` or absent; `false` is not a state). Decision record:
|
|
3644
3705
|
// `lab/user-plugins/decisions/014-known-resources-ledger.md`.
|
|
3645
|
-
knownResources:
|
|
3706
|
+
knownResources: z13.literal(true).optional(),
|
|
3646
3707
|
// The module's code defines `describeOperation`, the approval card's facts for a call. The
|
|
3647
3708
|
// daemon reads it here because it may hold only the manifest (a plugin that runs in the
|
|
3648
3709
|
// plugin host), and the host refuses a module whose code disagrees.
|
|
3649
|
-
describesOperations:
|
|
3710
|
+
describesOperations: z13.literal(true).optional(),
|
|
3650
3711
|
// The module's code defines `lookupWebLink`, which finds a resource's page when someone opens
|
|
3651
3712
|
// it. The daemon reads it here for the same reason, and the host refuses a module whose code
|
|
3652
3713
|
// disagrees.
|
|
3653
|
-
looksUpWebLinks:
|
|
3714
|
+
looksUpWebLinks: z13.literal(true).optional()
|
|
3654
3715
|
});
|
|
3655
3716
|
const AppUriModuleContribution2 = UriModuleContribution2.omit({
|
|
3656
3717
|
authActions: true,
|
|
@@ -3660,30 +3721,30 @@ function createContributionsSchemas(canonical) {
|
|
|
3660
3721
|
describesOperations: true,
|
|
3661
3722
|
looksUpWebLinks: true
|
|
3662
3723
|
});
|
|
3663
|
-
const AppDataSourceStore =
|
|
3664
|
-
|
|
3665
|
-
shape:
|
|
3724
|
+
const AppDataSourceStore = z13.discriminatedUnion("shape", [
|
|
3725
|
+
z13.strictObject({
|
|
3726
|
+
shape: z13.literal("rows"),
|
|
3666
3727
|
rowsField: NonEmptyString3,
|
|
3667
|
-
key:
|
|
3728
|
+
key: z13.array(NonEmptyString3).min(1)
|
|
3668
3729
|
}),
|
|
3669
|
-
|
|
3730
|
+
z13.strictObject({ shape: z13.literal("value") })
|
|
3670
3731
|
]);
|
|
3671
|
-
const AppDataSourceContribution2 =
|
|
3732
|
+
const AppDataSourceContribution2 = z13.strictObject({
|
|
3672
3733
|
localId: LocalContributionId2,
|
|
3673
|
-
scope:
|
|
3674
|
-
snapshot:
|
|
3675
|
-
version:
|
|
3734
|
+
scope: z13.enum(["runtime", "account", "session"]),
|
|
3735
|
+
snapshot: z13.strictObject({
|
|
3736
|
+
version: z13.number().int().positive(),
|
|
3676
3737
|
schema: JsonSchema
|
|
3677
3738
|
}),
|
|
3678
|
-
change:
|
|
3679
|
-
version:
|
|
3739
|
+
change: z13.strictObject({
|
|
3740
|
+
version: z13.number().int().positive(),
|
|
3680
3741
|
schema: JsonSchema,
|
|
3681
3742
|
/** Review-only claim; source schemas and behavioral tests enforce it because the daemon treats changes as opaque. */
|
|
3682
|
-
semantics:
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
kind:
|
|
3686
|
-
maxEncodedBytes:
|
|
3743
|
+
semantics: z13.discriminatedUnion("kind", [
|
|
3744
|
+
z13.strictObject({ kind: z13.literal("incremental") }),
|
|
3745
|
+
z13.strictObject({
|
|
3746
|
+
kind: z13.literal("snapshot-replacement"),
|
|
3747
|
+
maxEncodedBytes: z13.number().int().positive(),
|
|
3687
3748
|
rationale: pluginString(canonical).min(1).max(1024)
|
|
3688
3749
|
})
|
|
3689
3750
|
]).optional()
|
|
@@ -3709,25 +3770,25 @@ function createContributionsSchemas(canonical) {
|
|
|
3709
3770
|
});
|
|
3710
3771
|
}
|
|
3711
3772
|
});
|
|
3712
|
-
const WhiteboardTypeStorage2 =
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
kind:
|
|
3773
|
+
const WhiteboardTypeStorage2 = z13.discriminatedUnion("kind", [
|
|
3774
|
+
z13.strictObject({ kind: z13.literal("json") }),
|
|
3775
|
+
z13.strictObject({ kind: z13.literal("payload") }),
|
|
3776
|
+
z13.strictObject({
|
|
3777
|
+
kind: z13.literal("markdown"),
|
|
3717
3778
|
bodyField: NonEmptyString3
|
|
3718
3779
|
})
|
|
3719
3780
|
]);
|
|
3720
|
-
const WhiteboardTypeContribution2 =
|
|
3781
|
+
const WhiteboardTypeContribution2 = z13.strictObject({
|
|
3721
3782
|
localId: LocalContributionId2,
|
|
3722
3783
|
displayName: NonEmptyString3,
|
|
3723
|
-
schemaVersion:
|
|
3784
|
+
schemaVersion: z13.number().int().positive(),
|
|
3724
3785
|
storage: WhiteboardTypeStorage2,
|
|
3725
3786
|
valueSchema: JsonSchema
|
|
3726
3787
|
});
|
|
3727
|
-
const AppDataMaterializerContribution2 =
|
|
3788
|
+
const AppDataMaterializerContribution2 = z13.strictObject({
|
|
3728
3789
|
source: LocalContributionId2
|
|
3729
3790
|
});
|
|
3730
|
-
const ArtifactUriModuleContribution2 =
|
|
3791
|
+
const ArtifactUriModuleContribution2 = z13.strictObject({
|
|
3731
3792
|
localId: LocalContributionId2,
|
|
3732
3793
|
/** The single `scheme://` this module owns; also the on-disk artifact kind. */
|
|
3733
3794
|
scheme: UriScheme2,
|
|
@@ -3741,17 +3802,17 @@ function createContributionsSchemas(canonical) {
|
|
|
3741
3802
|
* composes its description from the plugin's own display name + scheme - a per-scheme label
|
|
3742
3803
|
* would have no path to matter, so it is intentionally omitted rather than accepted-and-ignored.
|
|
3743
3804
|
*/
|
|
3744
|
-
editable:
|
|
3805
|
+
editable: z13.boolean().optional(),
|
|
3745
3806
|
/** Opt in to `list` over the kind's stored names. Default false. Mirrors
|
|
3746
3807
|
* `CreateArtifactUriModuleOptions.listable`. */
|
|
3747
|
-
listable:
|
|
3808
|
+
listable: z13.boolean().optional(),
|
|
3748
3809
|
/**
|
|
3749
3810
|
* Opt in to `delete` for same-session entries. Default false. Deletion
|
|
3750
3811
|
* unlinks the stored file - no trash tier; a kind that wants recoverable
|
|
3751
3812
|
* deletion is not artifact-backed. Mirrors
|
|
3752
3813
|
* `CreateArtifactUriModuleOptions.deletable`.
|
|
3753
3814
|
*/
|
|
3754
|
-
deletable:
|
|
3815
|
+
deletable: z13.boolean().optional(),
|
|
3755
3816
|
/**
|
|
3756
3817
|
* Opt in to the `{ content, mode: "append" }` write envelope, which extends
|
|
3757
3818
|
* stored text instead of replacing it (concurrent-appender-safe: the host
|
|
@@ -3759,7 +3820,7 @@ function createContributionsSchemas(canonical) {
|
|
|
3759
3820
|
* keep their verbatim round-trip. Mirrors
|
|
3760
3821
|
* `CreateArtifactUriModuleOptions.appendable`.
|
|
3761
3822
|
*/
|
|
3762
|
-
appendable:
|
|
3823
|
+
appendable: z13.boolean().optional(),
|
|
3763
3824
|
/**
|
|
3764
3825
|
* Which sessions share one storage namespace. Default `"session"` - the existing
|
|
3765
3826
|
* per-session behavior (each session gets its own kind directory; other sessions'
|
|
@@ -3770,14 +3831,14 @@ function createContributionsSchemas(canonical) {
|
|
|
3770
3831
|
* the scope; the host derives the family root from provenance it already holds, so
|
|
3771
3832
|
* family identity never crosses the SDK boundary.
|
|
3772
3833
|
*/
|
|
3773
|
-
storageScope:
|
|
3834
|
+
storageScope: z13.enum(["session", "family"]).optional()
|
|
3774
3835
|
});
|
|
3775
|
-
const CliBindingContribution2 =
|
|
3836
|
+
const CliBindingContribution2 = z13.strictObject({
|
|
3776
3837
|
localId: LocalContributionId2,
|
|
3777
3838
|
binary: CliBinaryName2,
|
|
3778
|
-
aliases:
|
|
3839
|
+
aliases: z13.array(CliBinaryName2).optional(),
|
|
3779
3840
|
/** Where the binary comes from. Omitted => `"vendored"` (decision 007). */
|
|
3780
|
-
provider:
|
|
3841
|
+
provider: z13.enum(["vendored", "path"]).optional(),
|
|
3781
3842
|
// A local ref (no dot) must name an auth service declared in this same
|
|
3782
3843
|
// manifest; a qualified ref (dotted, e.g. `google.account`) names another
|
|
3783
3844
|
// plugin's already-minted global id and is recorded, not resolved, here (see
|
|
@@ -3790,20 +3851,20 @@ function createContributionsSchemas(canonical) {
|
|
|
3790
3851
|
* MUST be absent for a `path` binding, which can never receive a token.
|
|
3791
3852
|
*/
|
|
3792
3853
|
authEnvVar: CliAuthEnvVarName2.optional(),
|
|
3793
|
-
readOnly:
|
|
3794
|
-
write:
|
|
3854
|
+
readOnly: z13.array(NonEmptyString3),
|
|
3855
|
+
write: z13.array(NonEmptyString3)
|
|
3795
3856
|
});
|
|
3796
|
-
const GitHostContribution2 =
|
|
3857
|
+
const GitHostContribution2 = z13.strictObject({
|
|
3797
3858
|
host: GitHostName2,
|
|
3798
3859
|
authService: LocalContributionId2,
|
|
3799
3860
|
basicAuthUser: GitBasicAuthUser2
|
|
3800
3861
|
});
|
|
3801
|
-
const ResourceContribution2 =
|
|
3862
|
+
const ResourceContribution2 = z13.strictObject({
|
|
3802
3863
|
localId: LocalContributionId2,
|
|
3803
3864
|
displayName: OptionalDisplayName,
|
|
3804
3865
|
description: NonEmptyString3.optional()
|
|
3805
3866
|
});
|
|
3806
|
-
const SkillContribution2 =
|
|
3867
|
+
const SkillContribution2 = z13.strictObject({
|
|
3807
3868
|
localId: LocalContributionId2,
|
|
3808
3869
|
displayName: OptionalDisplayName,
|
|
3809
3870
|
/** Model-visible one-liner: when to reach for this skill. */
|
|
@@ -3811,18 +3872,18 @@ function createContributionsSchemas(canonical) {
|
|
|
3811
3872
|
/** The SKILL.md-style file inside the package carrying the full instructions. */
|
|
3812
3873
|
path: PackageAssetPath2
|
|
3813
3874
|
});
|
|
3814
|
-
const PluginSkillSourceDeclaration2 =
|
|
3815
|
-
|
|
3816
|
-
channel:
|
|
3875
|
+
const PluginSkillSourceDeclaration2 = z13.discriminatedUnion("channel", [
|
|
3876
|
+
z13.strictObject({
|
|
3877
|
+
channel: z13.literal("installer"),
|
|
3817
3878
|
localId: LocalContributionId2,
|
|
3818
3879
|
displayName: OptionalDisplayName,
|
|
3819
3880
|
/** The package-runner executable, e.g. `npx` - checked against the daemon's allowlist. */
|
|
3820
3881
|
command: NonEmptyString3,
|
|
3821
3882
|
/** Its argv, e.g. `["skills", "add", "clerk/skills"]`. */
|
|
3822
|
-
args:
|
|
3883
|
+
args: z13.array(NonEmptyString3)
|
|
3823
3884
|
}),
|
|
3824
|
-
|
|
3825
|
-
channel:
|
|
3885
|
+
z13.strictObject({
|
|
3886
|
+
channel: z13.literal("git-clone"),
|
|
3826
3887
|
localId: LocalContributionId2,
|
|
3827
3888
|
displayName: OptionalDisplayName,
|
|
3828
3889
|
/** The repository locator - canonicalized and hygiene-checked by the daemon. */
|
|
@@ -3833,17 +3894,17 @@ function createContributionsSchemas(canonical) {
|
|
|
3833
3894
|
subdir: NonEmptyString3.optional()
|
|
3834
3895
|
})
|
|
3835
3896
|
]);
|
|
3836
|
-
const SearchProviderContribution2 =
|
|
3897
|
+
const SearchProviderContribution2 = z13.strictObject({
|
|
3837
3898
|
localId: LocalContributionId2,
|
|
3838
3899
|
displayName: OptionalDisplayName,
|
|
3839
|
-
schemes:
|
|
3900
|
+
schemes: z13.array(UriScheme2).optional()
|
|
3840
3901
|
});
|
|
3841
|
-
const InteractionDriverContribution2 =
|
|
3902
|
+
const InteractionDriverContribution2 = z13.strictObject({
|
|
3842
3903
|
localId: LocalContributionId2,
|
|
3843
3904
|
displayName: OptionalDisplayName,
|
|
3844
|
-
kind:
|
|
3905
|
+
kind: z13.enum(["browser", "computer-use"])
|
|
3845
3906
|
});
|
|
3846
|
-
const EntityResolverContribution2 =
|
|
3907
|
+
const EntityResolverContribution2 = z13.strictObject({
|
|
3847
3908
|
localId: LocalContributionId2,
|
|
3848
3909
|
displayName: OptionalDisplayName,
|
|
3849
3910
|
/** The `kay.agent` URI module (this manifest's own `contributes.uriModules[].localId`) whose
|
|
@@ -3851,17 +3912,17 @@ function createContributionsSchemas(canonical) {
|
|
|
3851
3912
|
uriModule: LocalContributionId2,
|
|
3852
3913
|
/** `person` | `channel` | `repo` | `pull-request` | ... -- drives avatar-first vs glyph-first row
|
|
3853
3914
|
* anatomy (N10-R2) and lets the renderer request a narrower `entityTypes` filter. */
|
|
3854
|
-
entityTypes:
|
|
3915
|
+
entityTypes: z13.array(NonEmptyString3).min(1),
|
|
3855
3916
|
/** The URI namespace/route `search()` is called against, e.g. `slack://directory` or
|
|
3856
3917
|
* `github://search/repositories` -- the resolver's fixed search scope; the live user query is
|
|
3857
3918
|
* the `search()` call's `query` param, never concatenated into this string. */
|
|
3858
3919
|
uriHint: NonEmptyString3
|
|
3859
3920
|
});
|
|
3860
|
-
const AgentRenderContribution2 =
|
|
3921
|
+
const AgentRenderContribution2 = z13.strictObject({
|
|
3861
3922
|
localId: LocalContributionId2,
|
|
3862
|
-
resultKinds:
|
|
3923
|
+
resultKinds: z13.array(NonEmptyString3).min(1)
|
|
3863
3924
|
});
|
|
3864
|
-
const PluginCardContribution2 =
|
|
3925
|
+
const PluginCardContribution2 = z13.strictObject({
|
|
3865
3926
|
localId: LocalContributionId2,
|
|
3866
3927
|
description: NonEmptyString3,
|
|
3867
3928
|
inputs: JsonSchema,
|
|
@@ -3869,26 +3930,26 @@ function createContributionsSchemas(canonical) {
|
|
|
3869
3930
|
submitEndpoint: LocalContributionId2,
|
|
3870
3931
|
authService: AuthServiceReference2.optional()
|
|
3871
3932
|
});
|
|
3872
|
-
const EndpointContribution2 =
|
|
3933
|
+
const EndpointContribution2 = z13.strictObject({
|
|
3873
3934
|
localId: LocalContributionId2,
|
|
3874
3935
|
displayName: OptionalDisplayName,
|
|
3875
3936
|
requestSchema: JsonSchema.optional(),
|
|
3876
3937
|
responseSchema: JsonSchema.optional(),
|
|
3877
|
-
auth:
|
|
3938
|
+
auth: z13.strictObject({
|
|
3878
3939
|
service: AuthServiceReference2,
|
|
3879
|
-
schemes:
|
|
3940
|
+
schemes: z13.array(AuthSchemeReference2).min(1),
|
|
3880
3941
|
purpose: NonEmptyString3
|
|
3881
3942
|
}).optional(),
|
|
3882
|
-
timeoutMs:
|
|
3943
|
+
timeoutMs: z13.number().int().positive().optional()
|
|
3883
3944
|
});
|
|
3884
|
-
const WorkflowContribution2 =
|
|
3945
|
+
const WorkflowContribution2 = z13.strictObject({
|
|
3885
3946
|
localId: LocalContributionId2,
|
|
3886
3947
|
name: NonEmptyString3,
|
|
3887
3948
|
/** Plain-text purpose, at most 280 characters. */
|
|
3888
3949
|
description: NonEmptyString3,
|
|
3889
3950
|
/** How often it runs. The automations engine enforces its scheduling floor. */
|
|
3890
|
-
everyMs:
|
|
3891
|
-
auth:
|
|
3951
|
+
everyMs: z13.number().int().positive(),
|
|
3952
|
+
auth: z13.strictObject({
|
|
3892
3953
|
/** A local ref names a service in this manifest; a dotted ref names another plugin's. */
|
|
3893
3954
|
service: AuthServiceReference2,
|
|
3894
3955
|
scheme: AuthSchemeReference2,
|
|
@@ -3896,7 +3957,7 @@ function createContributionsSchemas(canonical) {
|
|
|
3896
3957
|
* Scopes each account's token must hold. Omitted, the host asks for the first scope of the
|
|
3897
3958
|
* `background-job` grant's `allowedScopes` that the account holds.
|
|
3898
3959
|
*/
|
|
3899
|
-
scopes:
|
|
3960
|
+
scopes: z13.array(NonEmptyString3).min(1).optional()
|
|
3900
3961
|
}).optional()
|
|
3901
3962
|
});
|
|
3902
3963
|
const McpServerUrl2 = pluginString(canonical).min(1).refine((value) => {
|
|
@@ -3912,8 +3973,8 @@ function createContributionsSchemas(canonical) {
|
|
|
3912
3973
|
}, {
|
|
3913
3974
|
message: "mcp server url must be https://, or http:// only for localhost/127.0.0.1 test servers"
|
|
3914
3975
|
});
|
|
3915
|
-
const McpServerAuthMode2 =
|
|
3916
|
-
const McpServerContribution2 =
|
|
3976
|
+
const McpServerAuthMode2 = z13.enum(["oauth", "api-key", "none"]);
|
|
3977
|
+
const McpServerContribution2 = z13.strictObject({
|
|
3917
3978
|
url: McpServerUrl2,
|
|
3918
3979
|
auth: McpServerAuthMode2.optional(),
|
|
3919
3980
|
authService: LocalContributionId2.optional()
|
|
@@ -3926,24 +3987,24 @@ function createContributionsSchemas(canonical) {
|
|
|
3926
3987
|
});
|
|
3927
3988
|
}
|
|
3928
3989
|
});
|
|
3929
|
-
const McpServerContributions2 =
|
|
3930
|
-
const AppEventSubscription2 =
|
|
3990
|
+
const McpServerContributions2 = z13.record(LocalContributionId2, McpServerContribution2);
|
|
3991
|
+
const AppEventSubscription2 = z13.strictObject({
|
|
3931
3992
|
localId: LocalContributionId2,
|
|
3932
3993
|
event: NonEmptyString3
|
|
3933
3994
|
});
|
|
3934
|
-
const ContextContributorContribution2 =
|
|
3995
|
+
const ContextContributorContribution2 = z13.strictObject({
|
|
3935
3996
|
localId: LocalContributionId2.max(64),
|
|
3936
3997
|
displayName: OptionalDisplayName,
|
|
3937
3998
|
description: NonEmptyString3.optional()
|
|
3938
3999
|
});
|
|
3939
|
-
const EventDefinitionVersion =
|
|
3940
|
-
const PluginEventDefinitionContribution2 =
|
|
4000
|
+
const EventDefinitionVersion = z13.number().int().positive();
|
|
4001
|
+
const PluginEventDefinitionContribution2 = z13.strictObject({
|
|
3941
4002
|
localId: PluginEventLocalId2,
|
|
3942
4003
|
displayName: OptionalDisplayName,
|
|
3943
4004
|
description: NonEmptyString3.optional(),
|
|
3944
4005
|
version: canonical ? EventDefinitionVersion : EventDefinitionVersion.default(1),
|
|
3945
4006
|
uriScheme: UriScheme2,
|
|
3946
|
-
relatedKeys:
|
|
4007
|
+
relatedKeys: z13.array(NonEmptyString3).readonly().optional(),
|
|
3947
4008
|
payloadSchema: JsonSchema.optional(),
|
|
3948
4009
|
/**
|
|
3949
4010
|
* This event is a signal: its payload is the shared `PluginSignal` v1 and every publish
|
|
@@ -3952,7 +4013,7 @@ function createContributionsSchemas(canonical) {
|
|
|
3952
4013
|
* and `relatedKeys` holds `thread` plus any of `from`, `to`, `cc`. Turning it on changes
|
|
3953
4014
|
* the payload, so bump `version` with it.
|
|
3954
4015
|
*/
|
|
3955
|
-
signal:
|
|
4016
|
+
signal: z13.boolean().optional()
|
|
3956
4017
|
}).superRefine((definition, context) => {
|
|
3957
4018
|
if (definition.signal !== true)
|
|
3958
4019
|
return;
|
|
@@ -3973,42 +4034,42 @@ function createContributionsSchemas(canonical) {
|
|
|
3973
4034
|
});
|
|
3974
4035
|
}
|
|
3975
4036
|
});
|
|
3976
|
-
const PluginNotificationRuleContribution2 =
|
|
4037
|
+
const PluginNotificationRuleContribution2 = z13.strictObject({
|
|
3977
4038
|
localId: LocalContributionId2,
|
|
3978
4039
|
/** The same-plugin `eventDefinitions` local id this rule matches. */
|
|
3979
4040
|
event: PluginEventLocalId2,
|
|
3980
|
-
where:
|
|
4041
|
+
where: z13.string({ error: (issue) => whereNotAStringMessage(issue.input) }).optional(),
|
|
3981
4042
|
rule: JsonObject
|
|
3982
4043
|
});
|
|
3983
|
-
const PluginProductEventContribution2 =
|
|
3984
|
-
|
|
4044
|
+
const PluginProductEventContribution2 = z13.union([
|
|
4045
|
+
z13.strictObject({
|
|
3985
4046
|
name: NonEmptyString3,
|
|
3986
4047
|
description: NonEmptyString3.optional(),
|
|
3987
|
-
fields:
|
|
4048
|
+
fields: z13.record(z13.string(), JsonObject).optional()
|
|
3988
4049
|
}),
|
|
3989
|
-
|
|
4050
|
+
z13.strictObject({ catalogEvent: NonEmptyString3 })
|
|
3990
4051
|
]);
|
|
3991
|
-
const UiEventSubscriptionContribution2 =
|
|
4052
|
+
const UiEventSubscriptionContribution2 = z13.strictObject({
|
|
3992
4053
|
localId: LocalContributionId2,
|
|
3993
4054
|
event: NonEmptyString3
|
|
3994
4055
|
});
|
|
3995
|
-
const DeviceDelegationContribution2 =
|
|
4056
|
+
const DeviceDelegationContribution2 = z13.strictObject({
|
|
3996
4057
|
localId: LocalContributionId2,
|
|
3997
|
-
device:
|
|
3998
|
-
delegateAs:
|
|
4058
|
+
device: z13.enum(["microphone"]),
|
|
4059
|
+
delegateAs: z13.enum(["clip", "stream", "status"])
|
|
3999
4060
|
});
|
|
4000
|
-
const CorpusAccess =
|
|
4001
|
-
const SessionReaderContribution2 =
|
|
4061
|
+
const CorpusAccess = z13.enum(["read"]);
|
|
4062
|
+
const SessionReaderContribution2 = z13.strictObject({
|
|
4002
4063
|
localId: LocalContributionId2,
|
|
4003
4064
|
displayName: OptionalDisplayName,
|
|
4004
4065
|
access: canonical ? CorpusAccess : CorpusAccess.default("read")
|
|
4005
4066
|
});
|
|
4006
|
-
const UiCommandContribution2 =
|
|
4067
|
+
const UiCommandContribution2 = z13.strictObject({
|
|
4007
4068
|
localId: LocalContributionId2,
|
|
4008
4069
|
title: NonEmptyString3,
|
|
4009
4070
|
icon: PackageAssetPath2.optional(),
|
|
4010
|
-
button:
|
|
4011
|
-
menu:
|
|
4071
|
+
button: z13.enum(["tabStrip"]).optional(),
|
|
4072
|
+
menu: z13.enum(["help"]).optional(),
|
|
4012
4073
|
where: NonEmptyString3.optional()
|
|
4013
4074
|
}).superRefine((command, ctx) => {
|
|
4014
4075
|
if (command.where === void 0)
|
|
@@ -4029,7 +4090,7 @@ function createContributionsSchemas(canonical) {
|
|
|
4029
4090
|
});
|
|
4030
4091
|
}
|
|
4031
4092
|
});
|
|
4032
|
-
const UiSlotContribution2 =
|
|
4093
|
+
const UiSlotContribution2 = z13.strictObject({
|
|
4033
4094
|
localId: LocalContributionId2,
|
|
4034
4095
|
slot: NonEmptyString3,
|
|
4035
4096
|
title: NonEmptyString3.optional()
|
|
@@ -4043,84 +4104,84 @@ function createContributionsSchemas(canonical) {
|
|
|
4043
4104
|
"blob",
|
|
4044
4105
|
"about"
|
|
4045
4106
|
]);
|
|
4046
|
-
const ReferenceOpenBehavior2 =
|
|
4047
|
-
|
|
4048
|
-
|
|
4107
|
+
const ReferenceOpenBehavior2 = z13.discriminatedUnion("kind", [
|
|
4108
|
+
z13.strictObject({ kind: z13.literal("working-document") }),
|
|
4109
|
+
z13.strictObject({ kind: z13.literal("browser-pane") }),
|
|
4049
4110
|
/**
|
|
4050
4111
|
* Open one of the pages this manifest declares in `pages`. The window answers this from the
|
|
4051
4112
|
* manifest, and the page gets the whole address as its `objectId` unless `addresses` says
|
|
4052
4113
|
* otherwise. Needs no web address, so a plugin-only resource (`user-todo://items/3`) can pill.
|
|
4053
4114
|
*/
|
|
4054
|
-
|
|
4115
|
+
z13.strictObject({ kind: z13.literal("page"), pageId: NonEmptyString3 }),
|
|
4055
4116
|
/**
|
|
4056
4117
|
* Hand the address's link to an app on this machine. The module's claims fill the link as its
|
|
4057
4118
|
* `sourceUrl`, and `schemes` names every scheme those links may use: main opens a link only when
|
|
4058
4119
|
* a loaded plugin declares its scheme here. A plugin the person installed can't declare this.
|
|
4059
4120
|
*/
|
|
4060
|
-
|
|
4061
|
-
kind:
|
|
4062
|
-
schemes:
|
|
4121
|
+
z13.strictObject({
|
|
4122
|
+
kind: z13.literal("local-app"),
|
|
4123
|
+
schemes: z13.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)
|
|
4063
4124
|
})
|
|
4064
4125
|
]);
|
|
4065
|
-
const ReferencePresentationVariant2 =
|
|
4126
|
+
const ReferencePresentationVariant2 = z13.strictObject({
|
|
4066
4127
|
resourceKind: NonEmptyString3,
|
|
4067
4128
|
presentationPluginId: PluginId2.optional()
|
|
4068
4129
|
});
|
|
4069
|
-
const ReferencePresentationVariants2 =
|
|
4070
|
-
const ReferencePresentationUriPattern2 =
|
|
4130
|
+
const ReferencePresentationVariants2 = z13.record(MimeTypeString2, ReferencePresentationVariant2);
|
|
4131
|
+
const ReferencePresentationUriPattern2 = z13.strictObject({
|
|
4071
4132
|
protocol: NonEmptyString3,
|
|
4072
4133
|
hostname: NonEmptyString3,
|
|
4073
|
-
pathname:
|
|
4074
|
-
search:
|
|
4134
|
+
pathname: z13.string().optional(),
|
|
4135
|
+
search: z13.string().optional()
|
|
4075
4136
|
});
|
|
4076
|
-
const ReferencePresentationUrlClaim2 =
|
|
4077
|
-
kind:
|
|
4137
|
+
const ReferencePresentationUrlClaim2 = z13.strictObject({
|
|
4138
|
+
kind: z13.literal("urlPattern"),
|
|
4078
4139
|
pattern: ReferencePresentationUriPattern2.extend({
|
|
4079
|
-
protocol:
|
|
4140
|
+
protocol: z13.enum(["http", "https"])
|
|
4080
4141
|
}),
|
|
4081
4142
|
/** The claim's mark: an SVG file in the plugin, drawn in its own colours. */
|
|
4082
4143
|
brandIcon: PackageAssetPath2.optional()
|
|
4083
4144
|
});
|
|
4084
|
-
const ReferencePresentationTooltip2 =
|
|
4145
|
+
const ReferencePresentationTooltip2 = z13.strictObject({
|
|
4085
4146
|
/** Same-plugin kay.ui app mounted with read-only reference URI context. */
|
|
4086
4147
|
app: LocalContributionId2,
|
|
4087
4148
|
pattern: ReferencePresentationUriPattern2
|
|
4088
4149
|
});
|
|
4089
|
-
const ReferencePresentationAddress2 =
|
|
4150
|
+
const ReferencePresentationAddress2 = z13.strictObject({
|
|
4090
4151
|
pattern: ReferencePresentationUriPattern2,
|
|
4091
4152
|
objectId: NonEmptyString3.optional(),
|
|
4092
|
-
open:
|
|
4153
|
+
open: z13.strictObject({ kind: z13.literal("none") }).optional()
|
|
4093
4154
|
});
|
|
4094
|
-
const ReferencePresentationAccountLinkPage =
|
|
4155
|
+
const ReferencePresentationAccountLinkPage = z13.strictObject({
|
|
4095
4156
|
/** A literal host name. */
|
|
4096
|
-
hostname:
|
|
4097
|
-
pathname:
|
|
4157
|
+
hostname: z13.string().regex(/^[a-z0-9.-]+$/, "An account link's hostname is a literal lower-case host name."),
|
|
4158
|
+
pathname: z13.string().optional(),
|
|
4098
4159
|
/** A page matching one of these already names its account, so it stays as it is. */
|
|
4099
|
-
unlessPathname:
|
|
4160
|
+
unlessPathname: z13.array(z13.string()).min(1).optional(),
|
|
4100
4161
|
/** The path the page opens at, in place of its own. */
|
|
4101
|
-
setPathname:
|
|
4162
|
+
setPathname: z13.string().startsWith("/").optional(),
|
|
4102
4163
|
/** Query values to add. A page that already has one of these names stays as it is. */
|
|
4103
|
-
addQuery:
|
|
4164
|
+
addQuery: z13.record(NonEmptyString3, NonEmptyString3)
|
|
4104
4165
|
});
|
|
4105
|
-
const ReferencePresentationAccountLinkAddress =
|
|
4166
|
+
const ReferencePresentationAccountLinkAddress = z13.strictObject({
|
|
4106
4167
|
pattern: ReferencePresentationUriPattern2,
|
|
4107
|
-
url:
|
|
4168
|
+
url: z13.string().regex(/^https?:\/\//, "An account link's url is a web page.")
|
|
4108
4169
|
});
|
|
4109
|
-
const ReferencePresentationAccountLinks2 =
|
|
4110
|
-
label:
|
|
4111
|
-
pages:
|
|
4112
|
-
addresses:
|
|
4170
|
+
const ReferencePresentationAccountLinks2 = z13.strictObject({
|
|
4171
|
+
label: z13.enum(["email", "name"]).optional(),
|
|
4172
|
+
pages: z13.array(ReferencePresentationAccountLinkPage).min(1).optional(),
|
|
4173
|
+
addresses: z13.array(ReferencePresentationAccountLinkAddress).min(1).optional()
|
|
4113
4174
|
});
|
|
4114
|
-
const ReferencePresentationWords2 =
|
|
4175
|
+
const ReferencePresentationWords2 = z13.strictObject({
|
|
4115
4176
|
/** The row's mark, for a source with no icon of its own. Left out: the plugin's main icon. */
|
|
4116
|
-
glyph:
|
|
4177
|
+
glyph: z13.enum(TOOL_GLYPHS).optional(),
|
|
4117
4178
|
/** The thing an address names ("channel" in "Read Slack channel"). Left out: the row reads the scheme's own name. */
|
|
4118
4179
|
kind: NonEmptyString3.optional(),
|
|
4119
4180
|
/**
|
|
4120
4181
|
* A more specific kind by the address's shape. The first row that matches decides, and an
|
|
4121
4182
|
* address no row matches reads `kind`.
|
|
4122
4183
|
*/
|
|
4123
|
-
kinds:
|
|
4184
|
+
kinds: z13.array(z13.strictObject({
|
|
4124
4185
|
pattern: ReferencePresentationUriPattern2,
|
|
4125
4186
|
kind: NonEmptyString3
|
|
4126
4187
|
})).min(1).optional(),
|
|
@@ -4129,7 +4190,7 @@ function createContributionsSchemas(canonical) {
|
|
|
4129
4190
|
/** What the live phrase names ("Slack" in "Reading Slack"). Left out: the bare verb ("Reading"). */
|
|
4130
4191
|
target: NonEmptyString3.optional(),
|
|
4131
4192
|
/** `kind` already says which source this is: "Edited plan", not "Edited Plan plan". */
|
|
4132
|
-
kindNamesSource:
|
|
4193
|
+
kindNamesSource: z13.literal(true).optional()
|
|
4133
4194
|
}).superRefine((value, ctx) => {
|
|
4134
4195
|
if (value.kind === void 0 && (value.glyph !== void 0 || value.kindNamesSource !== void 0 || value.kinds !== void 0)) {
|
|
4135
4196
|
ctx.addIssue({
|
|
@@ -4139,7 +4200,7 @@ function createContributionsSchemas(canonical) {
|
|
|
4139
4200
|
});
|
|
4140
4201
|
}
|
|
4141
4202
|
});
|
|
4142
|
-
const ReferencePresentationContribution2 =
|
|
4203
|
+
const ReferencePresentationContribution2 = z13.strictObject({
|
|
4143
4204
|
localId: LocalContributionId2,
|
|
4144
4205
|
/** This manifest's URI module. Leave it out only for an address another layer serves. */
|
|
4145
4206
|
uriModule: LocalContributionId2.optional(),
|
|
@@ -4150,7 +4211,7 @@ function createContributionsSchemas(canonical) {
|
|
|
4150
4211
|
*/
|
|
4151
4212
|
scheme: UriScheme2.optional(),
|
|
4152
4213
|
/** Which of the addresses open the page, and on what. Read by the window. */
|
|
4153
|
-
addresses:
|
|
4214
|
+
addresses: z13.array(ReferencePresentationAddress2).min(1).optional(),
|
|
4154
4215
|
/** Comes with `open`. A presentation with neither only words its module's addresses. */
|
|
4155
4216
|
resourceKind: NonEmptyString3.optional(),
|
|
4156
4217
|
/** How the address opens. Left out, it stays plain text. */
|
|
@@ -4158,7 +4219,7 @@ function createContributionsSchemas(canonical) {
|
|
|
4158
4219
|
/** MIME-specific resource kinds; absent keys use the base presentation. */
|
|
4159
4220
|
variants: ReferencePresentationVariants2.optional(),
|
|
4160
4221
|
/** Lexical public URL claims used only for host-rendered browser presentations. */
|
|
4161
|
-
claims:
|
|
4222
|
+
claims: z13.array(ReferencePresentationUrlClaim2).optional(),
|
|
4162
4223
|
/** Informational app presentation matched against the canonical resource URI. */
|
|
4163
4224
|
tooltip: ReferencePresentationTooltip2.optional(),
|
|
4164
4225
|
/** What the transcript calls this module's addresses. Needs a `uriModule`. */
|
|
@@ -4241,7 +4302,7 @@ function createContributionsSchemas(canonical) {
|
|
|
4241
4302
|
});
|
|
4242
4303
|
}
|
|
4243
4304
|
});
|
|
4244
|
-
const KayUiAppHostCapability2 =
|
|
4305
|
+
const KayUiAppHostCapability2 = z13.enum([
|
|
4245
4306
|
"navigation.open-session",
|
|
4246
4307
|
// Lets `navigation.openChat` create a blank chat (no message, no model
|
|
4247
4308
|
// turn) when no session id is given. It never sends anything.
|
|
@@ -4252,6 +4313,7 @@ function createContributionsSchemas(canonical) {
|
|
|
4252
4313
|
// Draws Bonsai's markdown document view in the app's page (`BonsaiMarkdownDocumentView`).
|
|
4253
4314
|
// It reads and saves nothing: the app supplies the text and keeps the edits.
|
|
4254
4315
|
"markdown.document-view",
|
|
4316
|
+
"models.complete",
|
|
4255
4317
|
// Draws links the host resolves and opens (`BonsaiReferencePill`, `BonsaiReferenceRow`,
|
|
4256
4318
|
// `BonsaiReferenceMarkdown`). A person's click on one can open a session or another plugin's page.
|
|
4257
4319
|
"references.open",
|
|
@@ -4264,6 +4326,16 @@ function createContributionsSchemas(canonical) {
|
|
|
4264
4326
|
// artifacts the account may manage the access rule with a count of listed addresses, never the addresses.
|
|
4265
4327
|
// It reads no artifact bytes.
|
|
4266
4328
|
"shared-artifacts.read",
|
|
4329
|
+
// Lists the person's projects with their pinned-to-Home state and build state, pins or unpins
|
|
4330
|
+
// one to Home, renames a project or changes its description, and draws the host's project
|
|
4331
|
+
// controls in the app's pane (mark, working folder and repository, sessions, build status, the
|
|
4332
|
+
// new-project flow). Through `BonsaiProjectSessions` and `sessionsView` it exposes each
|
|
4333
|
+
// project's session titles, states and activity times. The page app holding it is the window's
|
|
4334
|
+
// project view and receives every request to show a project (`onOpenRequest`). It cannot
|
|
4335
|
+
// remove or refile a project or a file. Only a plugin that ships with Bonsai keeps it: desktop
|
|
4336
|
+
// main drops it from any other plugin's apps when it accepts them
|
|
4337
|
+
// (`BUNDLED_ONLY_UI_APP_HOST_CAPABILITIES`).
|
|
4338
|
+
"projects.manage",
|
|
4267
4339
|
// Grants exactly `panes.place` (see `WORKSPACE_VERB_TIERS`/`KayWorkspaceCommand` in
|
|
4268
4340
|
// `@bonsai/agent-runtime-protocol`) through the `kay.ui` capability broker's `workspace.place`,
|
|
4269
4341
|
// and `workspace.openBeside`: one artifact in the shell's reference side pane beside the app's own
|
|
@@ -4277,12 +4349,12 @@ function createContributionsSchemas(canonical) {
|
|
|
4277
4349
|
// rearrange the workspace but never remove something the user would have to notice going missing.
|
|
4278
4350
|
"workspace.arrange"
|
|
4279
4351
|
]);
|
|
4280
|
-
const UiAppCapabilities2 =
|
|
4281
|
-
endpoints:
|
|
4282
|
-
host:
|
|
4352
|
+
const UiAppCapabilities2 = z13.strictObject({
|
|
4353
|
+
endpoints: z13.array(LocalContributionId2).optional(),
|
|
4354
|
+
host: z13.array(KayUiAppHostCapability2).optional(),
|
|
4283
4355
|
// The feeds this app's pages read with `useBonsaiFeed`. A name means this plugin's own
|
|
4284
4356
|
// `kay.app` data source if it declares one, otherwise the feed the daemon publishes.
|
|
4285
|
-
feeds:
|
|
4357
|
+
feeds: z13.array(LocalContributionId2).optional()
|
|
4286
4358
|
}).superRefine((capabilities, ctx) => {
|
|
4287
4359
|
for (const field of ["endpoints", "host", "feeds"]) {
|
|
4288
4360
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -4298,10 +4370,10 @@ function createContributionsSchemas(canonical) {
|
|
|
4298
4370
|
}
|
|
4299
4371
|
}
|
|
4300
4372
|
});
|
|
4301
|
-
const UiRailBadge =
|
|
4373
|
+
const UiRailBadge = z13.strictObject({
|
|
4302
4374
|
source: LocalContributionId2,
|
|
4303
4375
|
where: NonEmptyString3.optional(),
|
|
4304
|
-
label:
|
|
4376
|
+
label: z13.strictObject({
|
|
4305
4377
|
one: NonEmptyString3.optional(),
|
|
4306
4378
|
other: NonEmptyString3
|
|
4307
4379
|
})
|
|
@@ -4317,42 +4389,48 @@ function createContributionsSchemas(canonical) {
|
|
|
4317
4389
|
});
|
|
4318
4390
|
}
|
|
4319
4391
|
});
|
|
4320
|
-
const UiRailEntryContribution2 =
|
|
4392
|
+
const UiRailEntryContribution2 = z13.strictObject({
|
|
4321
4393
|
id: LocalContributionId2,
|
|
4322
4394
|
title: NonEmptyString3,
|
|
4323
4395
|
icon: PackageAssetPath2.optional(),
|
|
4324
4396
|
page: NonEmptyString3,
|
|
4325
4397
|
homeLocation: NonEmptyString3.optional(),
|
|
4326
4398
|
shortcut: NonEmptyString3.optional(),
|
|
4327
|
-
order:
|
|
4328
|
-
section:
|
|
4399
|
+
order: z13.number().finite().optional(),
|
|
4400
|
+
section: z13.enum(["primary", "plugins"]).optional(),
|
|
4329
4401
|
badge: UiRailBadge.optional(),
|
|
4330
|
-
panel:
|
|
4402
|
+
panel: z13.strictObject({ body: LocalContributionId2 }).optional(),
|
|
4403
|
+
featureFlagVariant: z13.strictObject({
|
|
4404
|
+
flag: NonEmptyString3,
|
|
4405
|
+
title: NonEmptyString3.optional(),
|
|
4406
|
+
icon: PackageAssetPath2.optional(),
|
|
4407
|
+
panel: z13.literal(false).optional()
|
|
4408
|
+
}).optional()
|
|
4331
4409
|
});
|
|
4332
|
-
const UiToastPreviewContribution2 =
|
|
4410
|
+
const UiToastPreviewContribution2 = z13.strictObject({
|
|
4333
4411
|
rule: LocalContributionId2,
|
|
4334
4412
|
body: LocalContributionId2,
|
|
4335
4413
|
address: NonEmptyString3
|
|
4336
4414
|
});
|
|
4337
|
-
const UiPageContribution2 =
|
|
4415
|
+
const UiPageContribution2 = z13.strictObject({
|
|
4338
4416
|
id: NonEmptyString3,
|
|
4339
4417
|
title: NonEmptyString3.optional(),
|
|
4340
4418
|
icon: PackageAssetPath2.optional(),
|
|
4341
|
-
companion:
|
|
4419
|
+
companion: z13.boolean().optional(),
|
|
4342
4420
|
openedEvent: NonEmptyString3.optional()
|
|
4343
4421
|
});
|
|
4344
|
-
const UiAppFields =
|
|
4422
|
+
const UiAppFields = z13.strictObject({
|
|
4345
4423
|
localId: LocalContributionId2,
|
|
4346
4424
|
displayName: NonEmptyString3,
|
|
4347
4425
|
description: NonEmptyString3.optional(),
|
|
4348
4426
|
icon: PackageAssetPath2.optional(),
|
|
4349
|
-
runtime:
|
|
4427
|
+
runtime: z13.literal("kay.react-app.v1"),
|
|
4350
4428
|
/** Mounted only by a host-supplied context; never a standalone navigation destination. */
|
|
4351
|
-
contextOnly:
|
|
4352
|
-
sdk:
|
|
4429
|
+
contextOnly: z13.literal(true).optional(),
|
|
4430
|
+
sdk: z13.strictObject({ range: NonEmptyString3 }),
|
|
4353
4431
|
entrypoint: TargetEntrypoint2,
|
|
4354
|
-
styles:
|
|
4355
|
-
assets:
|
|
4432
|
+
styles: z13.array(PackageAssetPath2).optional(),
|
|
4433
|
+
assets: z13.array(PackageAssetPath2).optional(),
|
|
4356
4434
|
capabilities: UiAppCapabilities2.optional()
|
|
4357
4435
|
});
|
|
4358
4436
|
function stripRetiredUiAppFields(value) {
|
|
@@ -4363,36 +4441,36 @@ function createContributionsSchemas(canonical) {
|
|
|
4363
4441
|
delete remaining["activityRail"];
|
|
4364
4442
|
return remaining;
|
|
4365
4443
|
}
|
|
4366
|
-
const UiAppContribution2 = canonical ? UiAppFields :
|
|
4367
|
-
const ThemeContribution2 =
|
|
4444
|
+
const UiAppContribution2 = canonical ? UiAppFields : z13.preprocess(stripRetiredUiAppFields, UiAppFields);
|
|
4445
|
+
const ThemeContribution2 = z13.strictObject({
|
|
4368
4446
|
localId: LocalContributionId2,
|
|
4369
4447
|
displayName: NonEmptyString3,
|
|
4370
|
-
appearance:
|
|
4448
|
+
appearance: z13.enum(["light", "dark"]),
|
|
4371
4449
|
tokens: PackageAssetPath2
|
|
4372
4450
|
});
|
|
4373
|
-
const CommandHandler2 =
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
kind:
|
|
4451
|
+
const CommandHandler2 = z13.discriminatedUnion("kind", [
|
|
4452
|
+
z13.strictObject({ kind: z13.literal("skill"), skill: LocalContributionId2 }),
|
|
4453
|
+
z13.strictObject({
|
|
4454
|
+
kind: z13.literal("tool"),
|
|
4377
4455
|
tool: PluginToolName2,
|
|
4378
4456
|
/** Positional mapping from tokenized `argsText` onto the tool's own input fields - see this
|
|
4379
4457
|
* union's doc for the exact tokenize/map/last-field-absorbs rule. */
|
|
4380
|
-
argumentFields:
|
|
4458
|
+
argumentFields: z13.array(NonEmptyString3)
|
|
4381
4459
|
}),
|
|
4382
|
-
|
|
4383
|
-
kind:
|
|
4460
|
+
z13.strictObject({
|
|
4461
|
+
kind: z13.literal("endpoint"),
|
|
4384
4462
|
endpoint: LocalContributionId2
|
|
4385
4463
|
})
|
|
4386
4464
|
]);
|
|
4387
|
-
const CommandContribution2 =
|
|
4465
|
+
const CommandContribution2 = z13.strictObject({
|
|
4388
4466
|
localId: LocalContributionId2,
|
|
4389
4467
|
displayName: OptionalDisplayName,
|
|
4390
4468
|
description: NonEmptyString3,
|
|
4391
|
-
aliases:
|
|
4469
|
+
aliases: z13.array(LocalContributionId2).optional(),
|
|
4392
4470
|
argumentHint: NonEmptyString3.optional(),
|
|
4393
4471
|
handler: CommandHandler2
|
|
4394
4472
|
});
|
|
4395
|
-
const PluginContributionKind2 =
|
|
4473
|
+
const PluginContributionKind2 = z13.enum([
|
|
4396
4474
|
"tool",
|
|
4397
4475
|
"converter",
|
|
4398
4476
|
"uriModule",
|
|
@@ -4550,7 +4628,56 @@ __export(manifest_exports, {
|
|
|
4550
4628
|
retiredCompatibilityKeysIn: () => retiredCompatibilityKeysIn,
|
|
4551
4629
|
validateKayUiEventSubscription: () => validateKayUiEventSubscription
|
|
4552
4630
|
});
|
|
4553
|
-
|
|
4631
|
+
|
|
4632
|
+
// packages/plugin-protocol/dist/shell-commands.js
|
|
4633
|
+
import { z as z14 } from "zod";
|
|
4634
|
+
var PluginShellCommand = z14.strictObject({
|
|
4635
|
+
name: z14.string().regex(/^[a-z][a-z0-9-]*$/),
|
|
4636
|
+
aliases: z14.array(z14.string().regex(/^[a-z][a-z0-9-]*$/)).optional(),
|
|
4637
|
+
endpoint: z14.string().min(1),
|
|
4638
|
+
usage: z14.string().min(1)
|
|
4639
|
+
});
|
|
4640
|
+
var ShellCommandOutcome = z14.strictObject({
|
|
4641
|
+
exitCode: z14.number().int(),
|
|
4642
|
+
envelope: JsonValue,
|
|
4643
|
+
result: JsonValue.optional()
|
|
4644
|
+
});
|
|
4645
|
+
var ShellCommandRequest = z14.strictObject({
|
|
4646
|
+
argv: z14.array(z14.string()),
|
|
4647
|
+
cwd: z14.string(),
|
|
4648
|
+
outcomes: z14.array(ShellCommandOutcome).max(3)
|
|
4649
|
+
});
|
|
4650
|
+
var ShellCommandStep = z14.discriminatedUnion("kind", [
|
|
4651
|
+
z14.strictObject({
|
|
4652
|
+
kind: z14.literal("invoke"),
|
|
4653
|
+
toolName: z14.enum([
|
|
4654
|
+
"read",
|
|
4655
|
+
"list",
|
|
4656
|
+
"search",
|
|
4657
|
+
"write",
|
|
4658
|
+
"edit",
|
|
4659
|
+
"delete",
|
|
4660
|
+
"help"
|
|
4661
|
+
]),
|
|
4662
|
+
input: z14.record(z14.string(), JsonValue),
|
|
4663
|
+
flags: z14.record(z14.string(), z14.string())
|
|
4664
|
+
}),
|
|
4665
|
+
z14.strictObject({
|
|
4666
|
+
kind: z14.literal("finish"),
|
|
4667
|
+
exitCode: z14.number().int(),
|
|
4668
|
+
stdout: z14.string()
|
|
4669
|
+
})
|
|
4670
|
+
]);
|
|
4671
|
+
|
|
4672
|
+
// packages/plugin-protocol/dist/manifest.js
|
|
4673
|
+
import { z as z16 } from "zod";
|
|
4674
|
+
|
|
4675
|
+
// packages/plugin-protocol/dist/workload-purposes.js
|
|
4676
|
+
import { z as z15 } from "zod";
|
|
4677
|
+
var PluginWorkloadPurpose = z15.strictObject({
|
|
4678
|
+
purpose: z15.string().regex(/^[a-z][a-z0-9-]*$/),
|
|
4679
|
+
workloadClass: z15.enum(["dreaming", "hindsight"])
|
|
4680
|
+
});
|
|
4554
4681
|
|
|
4555
4682
|
// packages/plugin-protocol/dist/synthetic-contributions.js
|
|
4556
4683
|
function resolveConfigSectionContributionLocalId(section) {
|
|
@@ -4575,34 +4702,34 @@ function createManifestSchemas(canonical) {
|
|
|
4575
4702
|
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;
|
|
4576
4703
|
const { HttpsUrl: HttpsUrl2, LocalContributionId: LocalContributionId2, NonEmptyString: NonEmptyString3, PackageAssetPath: PackageAssetPath2, PluginId: PluginId2, PluginNamespace: PluginNamespace2, RegistrableDomain: RegistrableDomain2, SignedInStatusCode: SignedInStatusCode2, TargetEntrypoint: TargetEntrypoint2 } = canonical ? canonicalCommonSchemas : common_exports;
|
|
4577
4704
|
const { PluginPermissionManifest: PluginPermissionManifest2 } = canonical ? canonicalPermissionSchemas : permissions_exports;
|
|
4578
|
-
const KayAgentTargetManifest2 =
|
|
4705
|
+
const KayAgentTargetManifest2 = z16.strictObject({
|
|
4579
4706
|
entrypoint: TargetEntrypoint2,
|
|
4580
|
-
contributes:
|
|
4581
|
-
tools:
|
|
4582
|
-
converters:
|
|
4583
|
-
uriModules:
|
|
4707
|
+
contributes: z16.strictObject({
|
|
4708
|
+
tools: z16.array(AgentToolContribution2).optional(),
|
|
4709
|
+
converters: z16.array(ConverterContribution2).optional(),
|
|
4710
|
+
uriModules: z16.array(UriModuleContribution2).optional(),
|
|
4584
4711
|
// Host-composed artifact-backed schemes (see `ArtifactUriModuleContribution`): the plugin
|
|
4585
4712
|
// declares scheme + editability; the daemon binds each to the kernel's artifact lifecycle
|
|
4586
4713
|
// per session. Separate from `uriModules` (plugin-implemented backends) precisely because
|
|
4587
4714
|
// the plugin registers NOTHING for these at activation.
|
|
4588
|
-
artifactUriModules:
|
|
4589
|
-
cliBindings:
|
|
4715
|
+
artifactUriModules: z16.array(ArtifactUriModuleContribution2).optional(),
|
|
4716
|
+
cliBindings: z16.array(CliBindingContribution2).optional(),
|
|
4590
4717
|
// Which git hosts this plugin's credential serves (see `GitHostContribution`): a
|
|
4591
4718
|
// declaration, so a plugin for any git backend gets credentialed clones without
|
|
4592
4719
|
// the daemon learning its name. Sibling of `cliBindings` because both answer the
|
|
4593
4720
|
// same question - which of this plugin's auth services a host-side consumer
|
|
4594
4721
|
// resolves - for two different transports.
|
|
4595
|
-
gitHosts:
|
|
4596
|
-
resources:
|
|
4597
|
-
skills:
|
|
4598
|
-
searchProviders:
|
|
4599
|
-
interactionDrivers:
|
|
4600
|
-
entityResolvers:
|
|
4601
|
-
renderers:
|
|
4722
|
+
gitHosts: z16.array(GitHostContribution2).optional(),
|
|
4723
|
+
resources: z16.array(ResourceContribution2).optional(),
|
|
4724
|
+
skills: z16.array(SkillContribution2).optional(),
|
|
4725
|
+
searchProviders: z16.array(SearchProviderContribution2).optional(),
|
|
4726
|
+
interactionDrivers: z16.array(InteractionDriverContribution2).optional(),
|
|
4727
|
+
entityResolvers: z16.array(EntityResolverContribution2).optional(),
|
|
4728
|
+
renderers: z16.array(AgentRenderContribution2).optional(),
|
|
4602
4729
|
// Handler restricted to skill | tool by the manifest-level refinement below (see
|
|
4603
4730
|
// `CommandContribution`'s doc for why the restriction is not expressed in the type, and
|
|
4604
4731
|
// `CommandHandler`'s doc for why there is no promptTemplate variant to declare here).
|
|
4605
|
-
commands:
|
|
4732
|
+
commands: z16.array(CommandContribution2).optional()
|
|
4606
4733
|
}).optional(),
|
|
4607
4734
|
/**
|
|
4608
4735
|
* The plugin's primer skill - the `localId` of one of its own declared
|
|
@@ -4648,61 +4775,61 @@ function createManifestSchemas(canonical) {
|
|
|
4648
4775
|
* acquisition, not declared here, so there is nothing for the resolved contract to mint a
|
|
4649
4776
|
* `globalId` for at parse time.
|
|
4650
4777
|
*/
|
|
4651
|
-
skillSources:
|
|
4778
|
+
skillSources: z16.array(PluginSkillSourceDeclaration2).optional()
|
|
4652
4779
|
});
|
|
4653
|
-
const KayAppTargetManifest2 =
|
|
4780
|
+
const KayAppTargetManifest2 = z16.strictObject({
|
|
4654
4781
|
// Optional, like `kay.ui`'s: a target may carry only declarative `contributes` (e.g. a plugin
|
|
4655
4782
|
// that ships nothing but `mcpServers`) with no app-lifetime module for the host to load.
|
|
4656
4783
|
entrypoint: TargetEntrypoint2.optional(),
|
|
4657
|
-
contributes:
|
|
4784
|
+
contributes: z16.strictObject({
|
|
4658
4785
|
// Session tools implemented by the app-lifetime activation (registered once, injected into
|
|
4659
4786
|
// every session with a host-stamped session context) - the tool counterpart of `uriModules`
|
|
4660
4787
|
// below. Same descriptor shape as kay.agent tools; `toolName` shares ONE flat session
|
|
4661
4788
|
// namespace with them (enforced by the manifest-level refinement below).
|
|
4662
|
-
tools:
|
|
4663
|
-
endpoints:
|
|
4664
|
-
cards:
|
|
4665
|
-
uriModules:
|
|
4666
|
-
dataSources:
|
|
4667
|
-
whiteboardTypes:
|
|
4668
|
-
approvalTypes:
|
|
4669
|
-
workflows:
|
|
4670
|
-
eventDefinitions:
|
|
4789
|
+
tools: z16.array(ToolContribution2).optional(),
|
|
4790
|
+
endpoints: z16.array(EndpointContribution2).optional(),
|
|
4791
|
+
cards: z16.array(PluginCardContribution2).optional(),
|
|
4792
|
+
uriModules: z16.array(AppUriModuleContribution2).optional(),
|
|
4793
|
+
dataSources: z16.array(AppDataSourceContribution2).optional(),
|
|
4794
|
+
whiteboardTypes: z16.array(WhiteboardTypeContribution2).optional(),
|
|
4795
|
+
approvalTypes: z16.array(ApprovalTypeContribution2).optional(),
|
|
4796
|
+
workflows: z16.array(WorkflowContribution2).optional(),
|
|
4797
|
+
eventDefinitions: z16.array(PluginEventDefinitionContribution2).optional(),
|
|
4671
4798
|
// Default notification rules over this plugin's own `eventDefinitions`; seeded by the host
|
|
4672
4799
|
// (see `PluginNotificationRuleContribution`).
|
|
4673
|
-
notificationRules:
|
|
4674
|
-
productEvents:
|
|
4675
|
-
eventSubscriptions:
|
|
4676
|
-
deviceDelegations:
|
|
4677
|
-
sessionReaders:
|
|
4678
|
-
contextContributors:
|
|
4800
|
+
notificationRules: z16.array(PluginNotificationRuleContribution2).optional(),
|
|
4801
|
+
productEvents: z16.array(PluginProductEventContribution2).optional(),
|
|
4802
|
+
eventSubscriptions: z16.array(AppEventSubscription2).optional(),
|
|
4803
|
+
deviceDelegations: z16.array(DeviceDelegationContribution2).optional(),
|
|
4804
|
+
sessionReaders: z16.array(SessionReaderContribution2).optional(),
|
|
4805
|
+
contextContributors: z16.array(ContextContributorContribution2).optional(),
|
|
4679
4806
|
// Vendored MCP servers this plugin ships (see `McpServerContributions`). Each is hosted only
|
|
4680
4807
|
// for a plugin holding `mcp.host-server` for its name and URL; that is decided at
|
|
4681
4808
|
// composition, not here (see ARCHITECTURE.md "Validation Law").
|
|
4682
4809
|
mcpServers: McpServerContributions2.optional(),
|
|
4683
4810
|
// Handler restricted to endpoint-only by the manifest-level refinement below.
|
|
4684
|
-
commands:
|
|
4811
|
+
commands: z16.array(CommandContribution2).optional()
|
|
4685
4812
|
}).optional()
|
|
4686
4813
|
});
|
|
4687
|
-
const KayUiTargetManifest2 =
|
|
4814
|
+
const KayUiTargetManifest2 = z16.strictObject({
|
|
4688
4815
|
entrypoint: TargetEntrypoint2.extend({
|
|
4689
|
-
format:
|
|
4816
|
+
format: z16.literal("compiled-bundle").optional()
|
|
4690
4817
|
}).optional(),
|
|
4691
|
-
contributes:
|
|
4692
|
-
commands:
|
|
4693
|
-
slots:
|
|
4694
|
-
referencePresentations:
|
|
4695
|
-
apps:
|
|
4696
|
-
railEntries:
|
|
4697
|
-
toastPreviews:
|
|
4698
|
-
pages:
|
|
4699
|
-
themes:
|
|
4700
|
-
eventSubscriptions:
|
|
4701
|
-
dataMaterializers:
|
|
4818
|
+
contributes: z16.strictObject({
|
|
4819
|
+
commands: z16.array(UiCommandContribution2).optional(),
|
|
4820
|
+
slots: z16.array(UiSlotContribution2).optional(),
|
|
4821
|
+
referencePresentations: z16.array(ReferencePresentationContribution2).optional(),
|
|
4822
|
+
apps: z16.array(UiAppContribution2).optional(),
|
|
4823
|
+
railEntries: z16.array(UiRailEntryContribution2).optional(),
|
|
4824
|
+
toastPreviews: z16.array(UiToastPreviewContribution2).optional(),
|
|
4825
|
+
pages: z16.array(UiPageContribution2).optional(),
|
|
4826
|
+
themes: z16.array(ThemeContribution2).optional(),
|
|
4827
|
+
eventSubscriptions: z16.array(UiEventSubscriptionContribution2).optional(),
|
|
4828
|
+
dataMaterializers: z16.array(AppDataMaterializerContribution2).optional()
|
|
4702
4829
|
}).optional()
|
|
4703
4830
|
});
|
|
4704
|
-
const PluginConfigScope2 =
|
|
4705
|
-
const PluginConfigSectionManifest2 =
|
|
4831
|
+
const PluginConfigScope2 = z16.enum(["global", "project", "agent"]);
|
|
4832
|
+
const PluginConfigSectionManifest2 = z16.strictObject({
|
|
4706
4833
|
section: NonEmptyString3.optional(),
|
|
4707
4834
|
schema: JsonSchema,
|
|
4708
4835
|
/**
|
|
@@ -4720,22 +4847,23 @@ function createManifestSchemas(canonical) {
|
|
|
4720
4847
|
* is the baseline every section has; `agent` has no runtime mapping (the
|
|
4721
4848
|
* agent/entity fold is downstream of the document protocol).
|
|
4722
4849
|
*/
|
|
4723
|
-
scopes:
|
|
4850
|
+
scopes: z16.array(PluginConfigScope2).optional()
|
|
4724
4851
|
});
|
|
4725
|
-
const PluginConfigManifest2 =
|
|
4726
|
-
const PluginStorageManifest2 =
|
|
4727
|
-
sqlite:
|
|
4728
|
-
enabled:
|
|
4729
|
-
ownerTarget:
|
|
4852
|
+
const PluginConfigManifest2 = z16.array(PluginConfigSectionManifest2).min(1);
|
|
4853
|
+
const PluginStorageManifest2 = z16.strictObject({
|
|
4854
|
+
sqlite: z16.strictObject({
|
|
4855
|
+
enabled: z16.boolean(),
|
|
4856
|
+
ownerTarget: z16.literal("kay.app").optional(),
|
|
4730
4857
|
migrations: NonEmptyString3.optional()
|
|
4731
4858
|
}).optional(),
|
|
4732
|
-
dataDir:
|
|
4733
|
-
enabled:
|
|
4734
|
-
ownerTarget:
|
|
4859
|
+
dataDir: z16.strictObject({
|
|
4860
|
+
enabled: z16.boolean(),
|
|
4861
|
+
ownerTarget: z16.literal("kay.app").optional(),
|
|
4862
|
+
sharedWith: PluginId2.optional()
|
|
4735
4863
|
}).optional()
|
|
4736
4864
|
});
|
|
4737
|
-
const PluginOAuthClientSupplier2 =
|
|
4738
|
-
const PluginProvisioningProbe2 =
|
|
4865
|
+
const PluginOAuthClientSupplier2 = z16.enum(["kay", "user"]);
|
|
4866
|
+
const PluginProvisioningProbe2 = z16.strictObject({
|
|
4739
4867
|
/**
|
|
4740
4868
|
* The API endpoint that answers the question. The host sends the service's OWN credential here,
|
|
4741
4869
|
* so this must belong to the provider that minted it - enforced by the daemon against the
|
|
@@ -4743,13 +4871,13 @@ function createManifestSchemas(canonical) {
|
|
|
4743
4871
|
*/
|
|
4744
4872
|
url: HttpsUrl2,
|
|
4745
4873
|
/** Absent => `GET`. */
|
|
4746
|
-
method:
|
|
4874
|
+
method: z16.enum(["GET"]).optional(),
|
|
4747
4875
|
/**
|
|
4748
4876
|
* The statuses that make the response a VERDICT at all. Anything else (a 401 from a stale
|
|
4749
4877
|
* token, a 5xx, a rate limit) means the probe learned nothing and reports `unknown` - never
|
|
4750
4878
|
* `unsatisfied`, which would tell a user to go fix setup that is fine.
|
|
4751
4879
|
*/
|
|
4752
|
-
verdictStatuses:
|
|
4880
|
+
verdictStatuses: z16.array(SignedInStatusCode2).min(1),
|
|
4753
4881
|
/**
|
|
4754
4882
|
* Dot-path to a JSON array in the response body that must be NON-EMPTY for the requirement to
|
|
4755
4883
|
* count as satisfied (e.g. `installations`). Absent means a verdict status alone is enough.
|
|
@@ -4758,7 +4886,7 @@ function createManifestSchemas(canonical) {
|
|
|
4758
4886
|
*/
|
|
4759
4887
|
nonEmptyArrayAt: NonEmptyString3.optional()
|
|
4760
4888
|
});
|
|
4761
|
-
const PluginProvisioningRequirement2 =
|
|
4889
|
+
const PluginProvisioningRequirement2 = z16.strictObject({
|
|
4762
4890
|
/** Stable id, unique within the scheme. */
|
|
4763
4891
|
id: LocalContributionId2,
|
|
4764
4892
|
/** Human-facing requirement name, e.g. "GitHub App installation". */
|
|
@@ -4775,7 +4903,7 @@ function createManifestSchemas(canonical) {
|
|
|
4775
4903
|
probe: PluginProvisioningProbe2
|
|
4776
4904
|
});
|
|
4777
4905
|
const PluginProvisioningField = {
|
|
4778
|
-
provisioning:
|
|
4906
|
+
provisioning: z16.array(PluginProvisioningRequirement2).optional()
|
|
4779
4907
|
};
|
|
4780
4908
|
const PluginAuthSchemeDescriptionFields = {
|
|
4781
4909
|
/** Human-facing flow name; absent, the service's name stands in. */
|
|
@@ -4792,16 +4920,17 @@ function createManifestSchemas(canonical) {
|
|
|
4792
4920
|
authorizationUrl: HttpsUrl2,
|
|
4793
4921
|
tokenUrl: HttpsUrl2,
|
|
4794
4922
|
/** Provider-specific query parameters added to the authorize URL. */
|
|
4795
|
-
extraAuthorizeParams:
|
|
4923
|
+
extraAuthorizeParams: z16.record(NonEmptyString3, z16.string()).optional()
|
|
4796
4924
|
};
|
|
4797
|
-
const PluginAuthSchemeAccountLookup =
|
|
4798
|
-
const PluginAuthSchemeOAuthPkce =
|
|
4925
|
+
const PluginAuthSchemeAccountLookup = z16.literal("lookup");
|
|
4926
|
+
const PluginAuthSchemeOAuthPkce = z16.strictObject({
|
|
4799
4927
|
...PluginProvisioningField,
|
|
4800
4928
|
...PluginAuthSchemeDescriptionFields,
|
|
4801
4929
|
...PluginAuthSchemeOAuthEndpointFields,
|
|
4802
4930
|
localId: LocalContributionId2,
|
|
4803
|
-
kind:
|
|
4804
|
-
exchange:
|
|
4931
|
+
kind: z16.literal("oauth2"),
|
|
4932
|
+
exchange: z16.literal("pkce"),
|
|
4933
|
+
byoocProfile: PluginByoocProfile.optional(),
|
|
4805
4934
|
/**
|
|
4806
4935
|
* A public client id the plugin ships for its own sign-in. Only an installed plugin's is used:
|
|
4807
4936
|
* Bonsai's own plugins sign in with clients the host holds.
|
|
@@ -4824,7 +4953,7 @@ function createManifestSchemas(canonical) {
|
|
|
4824
4953
|
* runs on an untrusted manifest, so a hand-built `["kay","kay"]` must be refused here, not
|
|
4825
4954
|
* silently normalized).
|
|
4826
4955
|
*/
|
|
4827
|
-
clientSuppliers:
|
|
4956
|
+
clientSuppliers: z16.array(PluginOAuthClientSupplier2).nonempty().superRefine((suppliers, ctx) => {
|
|
4828
4957
|
if (new Set(suppliers).size !== suppliers.length) {
|
|
4829
4958
|
ctx.addIssue({
|
|
4830
4959
|
code: "custom",
|
|
@@ -4832,7 +4961,10 @@ function createManifestSchemas(canonical) {
|
|
|
4832
4961
|
});
|
|
4833
4962
|
}
|
|
4834
4963
|
}),
|
|
4835
|
-
scopes:
|
|
4964
|
+
scopes: z16.array(NonEmptyString3).optional()
|
|
4965
|
+
}).refine((scheme) => scheme.byoocProfile === void 0 || scheme.clientSuppliers.includes("user"), {
|
|
4966
|
+
message: "An own-client profile requires the user client supplier.",
|
|
4967
|
+
path: ["byoocProfile"]
|
|
4836
4968
|
}).refine((scheme) => scheme.clientSecret === void 0 || scheme.clientId !== void 0, {
|
|
4837
4969
|
message: "clientSecret needs the clientId it belongs to",
|
|
4838
4970
|
path: ["clientSecret"]
|
|
@@ -4840,33 +4972,33 @@ function createManifestSchemas(canonical) {
|
|
|
4840
4972
|
message: "a scheme with its own clientId names where its account comes from (`account`)",
|
|
4841
4973
|
path: ["account"]
|
|
4842
4974
|
});
|
|
4843
|
-
const PluginAuthSchemeOAuthConfidential =
|
|
4975
|
+
const PluginAuthSchemeOAuthConfidential = z16.strictObject({
|
|
4844
4976
|
...PluginProvisioningField,
|
|
4845
4977
|
...PluginAuthSchemeDescriptionFields,
|
|
4846
4978
|
...PluginAuthSchemeOAuthEndpointFields,
|
|
4847
4979
|
localId: LocalContributionId2,
|
|
4848
|
-
kind:
|
|
4849
|
-
exchange:
|
|
4980
|
+
kind: z16.literal("oauth2"),
|
|
4981
|
+
exchange: z16.literal("confidential"),
|
|
4850
4982
|
/** Absent means `["kay"]` - a confidential exchange's secret may only ever be Bonsai's. */
|
|
4851
|
-
clientSuppliers:
|
|
4852
|
-
scopes:
|
|
4983
|
+
clientSuppliers: z16.tuple([z16.literal("kay")]).optional(),
|
|
4984
|
+
scopes: z16.array(NonEmptyString3).optional(),
|
|
4853
4985
|
/** Where the account comes from (see {@link PluginAuthSchemeAccountLookup}). */
|
|
4854
|
-
account:
|
|
4986
|
+
account: z16.union([PluginAuthSchemeAccountLookup, z16.literal("sign-in")])
|
|
4855
4987
|
});
|
|
4856
|
-
const PluginAuthSchemeOAuth2 =
|
|
4988
|
+
const PluginAuthSchemeOAuth2 = z16.discriminatedUnion("exchange", [
|
|
4857
4989
|
PluginAuthSchemeOAuthPkce,
|
|
4858
4990
|
PluginAuthSchemeOAuthConfidential
|
|
4859
4991
|
]);
|
|
4860
|
-
const PluginAuthSchemeApiKey =
|
|
4992
|
+
const PluginAuthSchemeApiKey = z16.strictObject({
|
|
4861
4993
|
...PluginProvisioningField,
|
|
4862
4994
|
...PluginAuthSchemeDescriptionFields,
|
|
4863
4995
|
localId: LocalContributionId2,
|
|
4864
|
-
kind:
|
|
4865
|
-
scopes:
|
|
4996
|
+
kind: z16.literal("api-key"),
|
|
4997
|
+
scopes: z16.array(NonEmptyString3).optional(),
|
|
4866
4998
|
/** The connect prompt's label for the key. Absent: "<service name> API key". */
|
|
4867
4999
|
inputLabel: NonEmptyString3.optional(),
|
|
4868
5000
|
/** Two or more labeled inputs for a secret that comes in parts; absent asks for one key. */
|
|
4869
|
-
fields:
|
|
5001
|
+
fields: z16.array(z16.strictObject({ id: LocalContributionId2, label: NonEmptyString3 })).min(2).superRefine((fields, ctx) => {
|
|
4870
5002
|
if (new Set(fields.map((field) => field.id)).size !== fields.length) {
|
|
4871
5003
|
ctx.addIssue({
|
|
4872
5004
|
code: "custom",
|
|
@@ -4875,7 +5007,7 @@ function createManifestSchemas(canonical) {
|
|
|
4875
5007
|
}
|
|
4876
5008
|
}).optional(),
|
|
4877
5009
|
/** Where and how the person creates the key outside Bonsai. */
|
|
4878
|
-
setup:
|
|
5010
|
+
setup: z16.strictObject({ instructions: NonEmptyString3, url: HttpsUrl2 }).optional(),
|
|
4879
5011
|
/**
|
|
4880
5012
|
* `"lookup"`: the plugin checks a key before it is saved and names its account, with the function
|
|
4881
5013
|
* it registers (`api.auth.registerAccountLookup`). Absent: the key is saved unchecked, under the
|
|
@@ -4883,27 +5015,27 @@ function createManifestSchemas(canonical) {
|
|
|
4883
5015
|
*/
|
|
4884
5016
|
account: PluginAuthSchemeAccountLookup.optional()
|
|
4885
5017
|
});
|
|
4886
|
-
const PluginAuthSchemeDelegated =
|
|
5018
|
+
const PluginAuthSchemeDelegated = z16.strictObject({
|
|
4887
5019
|
...PluginAuthSchemeDescriptionFields,
|
|
4888
5020
|
localId: LocalContributionId2,
|
|
4889
|
-
kind:
|
|
4890
|
-
scopes:
|
|
5021
|
+
kind: z16.literal("delegated"),
|
|
5022
|
+
scopes: z16.array(NonEmptyString3).optional()
|
|
4891
5023
|
});
|
|
4892
|
-
const ExternalCliArgument =
|
|
5024
|
+
const ExternalCliArgument = z16.string().min(1).max(16384).refine((value) => ![...value].some(isUnsafeArgumentCharacter), {
|
|
4893
5025
|
message: "an argument may hold tabs and line breaks, but no other control character, no invisible character and no bidirectional override"
|
|
4894
5026
|
});
|
|
4895
|
-
const ExternalCliCommand =
|
|
5027
|
+
const ExternalCliCommand = z16.string().max(128).regex(/^[A-Za-z0-9][A-Za-z0-9._+-]*$/, {
|
|
4896
5028
|
message: "a command is an executable's basename (letters, digits, '.', '_', '+', '-'), never a path"
|
|
4897
5029
|
});
|
|
4898
5030
|
const ExternalCliHint = NonEmptyString3.max(2048);
|
|
4899
|
-
const ExternalCliArguments =
|
|
5031
|
+
const ExternalCliArguments = z16.array(ExternalCliArgument).max(64);
|
|
4900
5032
|
const SignedOutMarker = ExternalCliArgument.refine((value) => value.trim() !== "", { message: "a signed-out marker needs text beyond whitespace" });
|
|
4901
|
-
const PluginExternalCliConnect2 =
|
|
5033
|
+
const PluginExternalCliConnect2 = z16.strictObject({
|
|
4902
5034
|
/** A basename the host finds on `PATH` (`osascript`, `wrangler`), never a path. */
|
|
4903
5035
|
binary: ExternalCliCommand,
|
|
4904
|
-
probe:
|
|
5036
|
+
probe: z16.strictObject({
|
|
4905
5037
|
args: ExternalCliArguments.min(1),
|
|
4906
|
-
timeoutMs:
|
|
5038
|
+
timeoutMs: z16.number().int().min(1).max(12e4).optional(),
|
|
4907
5039
|
/**
|
|
4908
5040
|
* The CLI's own signed-out marker: text a failed probe's output (stderr, else stdout) contains
|
|
4909
5041
|
* when the CLI is signed out. A failure that carries it is a sign-in problem, and only such a
|
|
@@ -4911,13 +5043,13 @@ function createManifestSchemas(canonical) {
|
|
|
4911
5043
|
* unavailable. Required when `login` is declared, so a timeout never starts a sign-in. A list
|
|
4912
5044
|
* is for a CLI with several signed-out messages; any one of them counts.
|
|
4913
5045
|
*/
|
|
4914
|
-
signedOutMarker:
|
|
5046
|
+
signedOutMarker: z16.union([SignedOutMarker, z16.array(SignedOutMarker).min(1)]).optional()
|
|
4915
5047
|
}),
|
|
4916
5048
|
/** The CLI's interactive sign-in. Absent: connect only probes and reports. */
|
|
4917
|
-
login:
|
|
5049
|
+
login: z16.strictObject({
|
|
4918
5050
|
args: ExternalCliArguments.min(1),
|
|
4919
|
-
timeoutMs:
|
|
4920
|
-
pasteCode:
|
|
5051
|
+
timeoutMs: z16.number().int().min(1).max(6e5).optional(),
|
|
5052
|
+
pasteCode: z16.strictObject({
|
|
4921
5053
|
/** The redeeming argv; the host appends the code as its last argument. */
|
|
4922
5054
|
args: ExternalCliArguments.min(1),
|
|
4923
5055
|
/** What the prompt says, for a person. */
|
|
@@ -4929,12 +5061,12 @@ function createManifestSchemas(canonical) {
|
|
|
4929
5061
|
* for display, or hands it to an agent session that runs it behind the ordinary bash approval.
|
|
4930
5062
|
* Absent for a binary the OS ships (`osascript`).
|
|
4931
5063
|
*/
|
|
4932
|
-
install:
|
|
5064
|
+
install: z16.strictObject({
|
|
4933
5065
|
command: ExternalCliCommand,
|
|
4934
5066
|
args: ExternalCliArguments
|
|
4935
5067
|
}).optional(),
|
|
4936
5068
|
/** Prose for a person: `install` when the binary is missing, `login` when the probe fails. */
|
|
4937
|
-
hints:
|
|
5069
|
+
hints: z16.strictObject({
|
|
4938
5070
|
install: ExternalCliHint,
|
|
4939
5071
|
login: ExternalCliHint
|
|
4940
5072
|
})
|
|
@@ -4947,50 +5079,50 @@ function createManifestSchemas(canonical) {
|
|
|
4947
5079
|
});
|
|
4948
5080
|
}
|
|
4949
5081
|
});
|
|
4950
|
-
const PluginAuthSchemeExternalCli =
|
|
5082
|
+
const PluginAuthSchemeExternalCli = z16.strictObject({
|
|
4951
5083
|
...PluginAuthSchemeDescriptionFields,
|
|
4952
5084
|
localId: LocalContributionId2,
|
|
4953
|
-
kind:
|
|
4954
|
-
scopes:
|
|
5085
|
+
kind: z16.literal("external-cli"),
|
|
5086
|
+
scopes: z16.array(NonEmptyString3).optional(),
|
|
4955
5087
|
cli: PluginExternalCliConnect2.optional()
|
|
4956
5088
|
});
|
|
4957
|
-
const PluginAuthScheme2 =
|
|
5089
|
+
const PluginAuthScheme2 = z16.discriminatedUnion("kind", [
|
|
4958
5090
|
PluginAuthSchemeOAuth2,
|
|
4959
5091
|
PluginAuthSchemeApiKey,
|
|
4960
5092
|
PluginAuthSchemeDelegated,
|
|
4961
5093
|
PluginAuthSchemeExternalCli
|
|
4962
5094
|
]);
|
|
4963
|
-
const PluginWebSessionProbe2 =
|
|
5095
|
+
const PluginWebSessionProbe2 = z16.strictObject({
|
|
4964
5096
|
url: HttpsUrl2,
|
|
4965
5097
|
/** Absent => `GET`. `POST` sends an empty JSON object body. */
|
|
4966
|
-
method:
|
|
4967
|
-
signedInStatuses:
|
|
5098
|
+
method: z16.enum(["GET", "POST"]).optional(),
|
|
5099
|
+
signedInStatuses: z16.array(SignedInStatusCode2).min(1)
|
|
4968
5100
|
});
|
|
4969
|
-
const PluginWebSessionDeclaration2 =
|
|
5101
|
+
const PluginWebSessionDeclaration2 = z16.strictObject({
|
|
4970
5102
|
/** `required`: capabilities degrade without the site login; `recommended`: it only smooths UX. */
|
|
4971
|
-
importance:
|
|
5103
|
+
importance: z16.enum(["required", "recommended"]),
|
|
4972
5104
|
loginUrl: HttpsUrl2,
|
|
4973
|
-
cookieDomains:
|
|
5105
|
+
cookieDomains: z16.array(RegistrableDomain2).min(1),
|
|
4974
5106
|
probe: PluginWebSessionProbe2,
|
|
4975
|
-
oauthVenue:
|
|
5107
|
+
oauthVenue: z16.enum(["embedded", "external"]),
|
|
4976
5108
|
/**
|
|
4977
5109
|
* Where a page goes first when it opens in one of Bonsai's browser panes and this site login
|
|
4978
5110
|
* is missing: a sign-in page that continues to the page. A template with `:email` and `:url`
|
|
4979
5111
|
* (see `UriClaimTemplate`), on a host within `cookieDomains`.
|
|
4980
5112
|
*/
|
|
4981
|
-
signInFirst:
|
|
5113
|
+
signInFirst: z16.string().optional()
|
|
4982
5114
|
}).superRefine(refineWebSessionScopeConfined);
|
|
4983
|
-
const PluginAuthService2 =
|
|
5115
|
+
const PluginAuthService2 = z16.strictObject({
|
|
4984
5116
|
localId: LocalContributionId2,
|
|
4985
5117
|
displayName: NonEmptyString3,
|
|
4986
5118
|
/** One plain sentence on what connecting this service gives Bonsai. */
|
|
4987
5119
|
summary: NonEmptyString3.optional(),
|
|
4988
|
-
schemes:
|
|
4989
|
-
purposes:
|
|
5120
|
+
schemes: z16.array(PluginAuthScheme2).min(1),
|
|
5121
|
+
purposes: z16.array(NonEmptyString3).min(1),
|
|
4990
5122
|
webSession: PluginWebSessionDeclaration2.optional()
|
|
4991
5123
|
});
|
|
4992
|
-
const PluginAuthManifest2 =
|
|
4993
|
-
services:
|
|
5124
|
+
const PluginAuthManifest2 = z16.strictObject({
|
|
5125
|
+
services: z16.array(PluginAuthService2).optional()
|
|
4994
5126
|
});
|
|
4995
5127
|
function stripRetiredCompatibilityKeys(value) {
|
|
4996
5128
|
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
@@ -5001,17 +5133,17 @@ function createManifestSchemas(canonical) {
|
|
|
5001
5133
|
delete remaining[key];
|
|
5002
5134
|
return remaining;
|
|
5003
5135
|
}
|
|
5004
|
-
const PluginCompatibilityFields =
|
|
5005
|
-
supportedProtocols:
|
|
5136
|
+
const PluginCompatibilityFields = z16.strictObject({
|
|
5137
|
+
supportedProtocols: z16.array(KayPluginProtocolVersion).optional(),
|
|
5006
5138
|
minKayVersion: NonEmptyString3.optional(),
|
|
5007
5139
|
sdk: NonEmptyString3.optional()
|
|
5008
5140
|
});
|
|
5009
|
-
const PluginCompatibilityManifest2 = canonical ? PluginCompatibilityFields :
|
|
5141
|
+
const PluginCompatibilityManifest2 = canonical ? PluginCompatibilityFields : z16.preprocess(stripRetiredCompatibilityKeys, PluginCompatibilityFields);
|
|
5010
5142
|
const KayVersionString2 = NonEmptyString3.regex(SEMVER_PATTERN, {
|
|
5011
5143
|
message: "version must be semver, for example 1.2.3"
|
|
5012
5144
|
});
|
|
5013
|
-
const KayPluginManifestV12 =
|
|
5014
|
-
protocol:
|
|
5145
|
+
const KayPluginManifestV12 = z16.strictObject({
|
|
5146
|
+
protocol: z16.literal(KAY_PLUGIN_PROTOCOL_VERSION),
|
|
5015
5147
|
id: PluginId2,
|
|
5016
5148
|
displayName: NonEmptyString3,
|
|
5017
5149
|
version: KayVersionString2,
|
|
@@ -5039,8 +5171,8 @@ function createManifestSchemas(canonical) {
|
|
|
5039
5171
|
icon: PackageAssetPath2.optional(),
|
|
5040
5172
|
iconDark: PackageAssetPath2.optional(),
|
|
5041
5173
|
namespace: PluginNamespace2.optional(),
|
|
5042
|
-
targets:
|
|
5043
|
-
kay:
|
|
5174
|
+
targets: z16.strictObject({
|
|
5175
|
+
kay: z16.strictObject({
|
|
5044
5176
|
agent: KayAgentTargetManifest2.optional(),
|
|
5045
5177
|
app: KayAppTargetManifest2.optional(),
|
|
5046
5178
|
ui: KayUiTargetManifest2.optional()
|
|
@@ -5048,6 +5180,8 @@ function createManifestSchemas(canonical) {
|
|
|
5048
5180
|
}).optional(),
|
|
5049
5181
|
config: PluginConfigManifest2.optional(),
|
|
5050
5182
|
storage: PluginStorageManifest2.optional(),
|
|
5183
|
+
workloadPurposes: z16.array(PluginWorkloadPurpose).optional(),
|
|
5184
|
+
shellCommands: z16.array(PluginShellCommand).optional(),
|
|
5051
5185
|
auth: PluginAuthManifest2.optional(),
|
|
5052
5186
|
permissions: PluginPermissionManifest2.optional(),
|
|
5053
5187
|
compatibility: PluginCompatibilityManifest2.optional(),
|
|
@@ -5057,17 +5191,36 @@ function createManifestSchemas(canonical) {
|
|
|
5057
5191
|
* schemes then report `ownedByBonsai`. Honoured only for a plugin that ships with Bonsai: the
|
|
5058
5192
|
* host reads any other plugin's flag as false. Absent => false.
|
|
5059
5193
|
*/
|
|
5060
|
-
ownedByBonsai:
|
|
5194
|
+
ownedByBonsai: z16.boolean().optional(),
|
|
5061
5195
|
/**
|
|
5062
5196
|
* Explicit plugin-level dependencies - other plugins this plugin requires to be present in the
|
|
5063
5197
|
* composed roster. At composition time the runtime checks each id against the accepted
|
|
5064
5198
|
* registration list and derives a provenance-complete dependency graph (together with implicit
|
|
5065
5199
|
* auth-service edges from `consumesAuthServices`). Absent => no explicit dependencies.
|
|
5066
5200
|
*/
|
|
5067
|
-
dependencies:
|
|
5068
|
-
plugins:
|
|
5201
|
+
dependencies: z16.strictObject({
|
|
5202
|
+
plugins: z16.array(PluginId2).optional()
|
|
5069
5203
|
}).optional()
|
|
5070
5204
|
}).superRefine((manifest, ctx) => {
|
|
5205
|
+
const sharedWith = manifest.storage?.dataDir?.sharedWith;
|
|
5206
|
+
if (sharedWith !== void 0 && (!manifest.storage?.dataDir?.enabled || sharedWith === manifest.id || !manifest.dependencies?.plugins?.includes(sharedWith))) {
|
|
5207
|
+
ctx.addIssue({
|
|
5208
|
+
code: "custom",
|
|
5209
|
+
path: ["storage", "dataDir", "sharedWith"],
|
|
5210
|
+
message: "A shared data directory must name another declared plugin dependency."
|
|
5211
|
+
});
|
|
5212
|
+
}
|
|
5213
|
+
const workloadPurposes = /* @__PURE__ */ new Set();
|
|
5214
|
+
for (const [index, workload] of (manifest.workloadPurposes ?? []).entries()) {
|
|
5215
|
+
if (workloadPurposes.has(workload.purpose)) {
|
|
5216
|
+
ctx.addIssue({
|
|
5217
|
+
code: "custom",
|
|
5218
|
+
path: ["workloadPurposes", index, "purpose"],
|
|
5219
|
+
message: "A workload purpose must be unique within its plugin."
|
|
5220
|
+
});
|
|
5221
|
+
}
|
|
5222
|
+
workloadPurposes.add(workload.purpose);
|
|
5223
|
+
}
|
|
5071
5224
|
const authServices = new Set(manifest.auth?.services?.map((service) => service.localId) ?? []);
|
|
5072
5225
|
const authSchemeIdsByService = new Map((manifest.auth?.services ?? []).map((service) => [
|
|
5073
5226
|
service.localId,
|
|
@@ -5077,6 +5230,33 @@ function createManifestSchemas(canonical) {
|
|
|
5077
5230
|
]))
|
|
5078
5231
|
]));
|
|
5079
5232
|
const endpointIds = new Set(manifest.targets?.kay?.app?.contributes?.endpoints?.map((endpoint) => endpoint.localId) ?? []);
|
|
5233
|
+
const shellNames = /* @__PURE__ */ new Set([
|
|
5234
|
+
"help",
|
|
5235
|
+
"version",
|
|
5236
|
+
"info",
|
|
5237
|
+
"open",
|
|
5238
|
+
"launch",
|
|
5239
|
+
"session"
|
|
5240
|
+
]);
|
|
5241
|
+
for (const [index, command] of (manifest.shellCommands ?? []).entries()) {
|
|
5242
|
+
if (!endpointIds.has(command.endpoint)) {
|
|
5243
|
+
ctx.addIssue({
|
|
5244
|
+
code: "custom",
|
|
5245
|
+
path: ["shellCommands", index, "endpoint"],
|
|
5246
|
+
message: "A shell command must name an endpoint declared by this plugin's app target."
|
|
5247
|
+
});
|
|
5248
|
+
}
|
|
5249
|
+
for (const name of [command.name, ...command.aliases ?? []]) {
|
|
5250
|
+
if (shellNames.has(name)) {
|
|
5251
|
+
ctx.addIssue({
|
|
5252
|
+
code: "custom",
|
|
5253
|
+
path: ["shellCommands", index],
|
|
5254
|
+
message: `Shell command name '${name}' is reserved or already declared.`
|
|
5255
|
+
});
|
|
5256
|
+
}
|
|
5257
|
+
shellNames.add(name);
|
|
5258
|
+
}
|
|
5259
|
+
}
|
|
5080
5260
|
const storageKinds = /* @__PURE__ */ new Set();
|
|
5081
5261
|
if (manifest.storage?.sqlite?.enabled)
|
|
5082
5262
|
storageKinds.add("sqlite");
|
|
@@ -5193,13 +5373,6 @@ function createManifestSchemas(canonical) {
|
|
|
5193
5373
|
message: `rail entry ${entry.id} counts ${entry.badge.source}, which is not one of this plugin's data sources with a rows store`
|
|
5194
5374
|
});
|
|
5195
5375
|
}
|
|
5196
|
-
if (manifest.targets?.kay?.ui?.entrypoint === void 0) {
|
|
5197
|
-
ctx.addIssue({
|
|
5198
|
-
code: "custom",
|
|
5199
|
-
path,
|
|
5200
|
-
message: `rail entry ${entry.id} declares a badge, so its plugin needs a kay.ui entrypoint: the window starts a plugin's data sources when it loads that code`
|
|
5201
|
-
});
|
|
5202
|
-
}
|
|
5203
5376
|
}
|
|
5204
5377
|
for (const source of declaredAppDataSources) {
|
|
5205
5378
|
if (materializedAppDataSources.has(source) || declaredAppDataStores.has(source))
|
|
@@ -6134,7 +6307,7 @@ function pushContributionIds(output, path, items) {
|
|
|
6134
6307
|
}
|
|
6135
6308
|
|
|
6136
6309
|
// packages/plugin-protocol/dist/plugin-directory-verdict.js
|
|
6137
|
-
import { z as
|
|
6310
|
+
import { z as z18 } from "zod";
|
|
6138
6311
|
|
|
6139
6312
|
// packages/plugin-protocol/dist/plugin-load-diagnostic.js
|
|
6140
6313
|
var PLUGIN_DIAGNOSTIC_MESSAGE_CAP = 300;
|
|
@@ -6143,14 +6316,14 @@ function boundPluginDiagnosticMessage(message) {
|
|
|
6143
6316
|
}
|
|
6144
6317
|
|
|
6145
6318
|
// packages/plugin-protocol/dist/resolved-contract.js
|
|
6146
|
-
import { z as
|
|
6319
|
+
import { z as z17 } from "zod";
|
|
6147
6320
|
function createResolvedContractSchemas(canonical) {
|
|
6148
6321
|
const { PluginEventLocalId: PluginEventLocalId2 } = canonical ? canonicalPluginEventSchemas : plugin_events_exports;
|
|
6149
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, WhiteboardTypeStorage: WhiteboardTypeStorage2 } = canonical ? canonicalContributionSchemas : contributions_exports;
|
|
6150
6323
|
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;
|
|
6151
6324
|
const { PluginExternalCliConnect: PluginExternalCliConnect2, PluginOAuthClientSupplier: PluginOAuthClientSupplier2 } = canonical ? canonicalManifestSchemas : manifest_exports;
|
|
6152
6325
|
const { ResolvedPluginGrants: ResolvedPluginGrants2 } = canonical ? canonicalPermissionSchemas : permissions_exports;
|
|
6153
|
-
const ResolvedPluginContributionId2 =
|
|
6326
|
+
const ResolvedPluginContributionId2 = z17.strictObject({
|
|
6154
6327
|
target: PluginTargetName,
|
|
6155
6328
|
kind: PluginContributionKindSchema,
|
|
6156
6329
|
localId: PluginEventLocalId2,
|
|
@@ -6164,54 +6337,54 @@ function createResolvedContractSchemas(canonical) {
|
|
|
6164
6337
|
});
|
|
6165
6338
|
}
|
|
6166
6339
|
});
|
|
6167
|
-
const ResolvedKayToolId =
|
|
6340
|
+
const ResolvedKayToolId = z17.strictObject({
|
|
6168
6341
|
localId: LocalContributionId2,
|
|
6169
6342
|
globalId: GlobalContributionId2,
|
|
6170
6343
|
toolName: PluginToolName2
|
|
6171
6344
|
});
|
|
6172
|
-
const ResolvedKayAgentTool2 =
|
|
6345
|
+
const ResolvedKayAgentTool2 = z17.strictObject({
|
|
6173
6346
|
...ResolvedKayToolId.shape,
|
|
6174
6347
|
displayName: NonEmptyString3.optional(),
|
|
6175
6348
|
description: NonEmptyString3.optional(),
|
|
6176
6349
|
parameters: JsonSchema.optional(),
|
|
6177
|
-
executionMode:
|
|
6350
|
+
executionMode: z17.enum(["sequential", "parallel"]).optional(),
|
|
6178
6351
|
promptSnippet: NonEmptyString3.optional(),
|
|
6179
|
-
promptGuidelines:
|
|
6180
|
-
requiresAuth:
|
|
6352
|
+
promptGuidelines: z17.array(NonEmptyString3).optional(),
|
|
6353
|
+
requiresAuth: z17.strictObject({
|
|
6181
6354
|
serviceId: GlobalContributionId2,
|
|
6182
6355
|
schemeId: GlobalContributionId2.optional()
|
|
6183
6356
|
}).optional(),
|
|
6184
6357
|
permission: canonical ? canonicalContributionSchemas.ToolPermission.optional() : ToolPermission.optional()
|
|
6185
6358
|
});
|
|
6186
6359
|
const ResolvedKayAppTool2 = ResolvedKayAgentTool2.omit({ requiresAuth: true });
|
|
6187
|
-
const ResolvedKayAppDataSource2 =
|
|
6360
|
+
const ResolvedKayAppDataSource2 = z17.strictObject({
|
|
6188
6361
|
localId: LocalContributionId2,
|
|
6189
6362
|
globalId: GlobalContributionId2,
|
|
6190
|
-
scope:
|
|
6191
|
-
snapshot:
|
|
6192
|
-
version:
|
|
6193
|
-
schema:
|
|
6363
|
+
scope: z17.enum(["runtime", "account", "session"]),
|
|
6364
|
+
snapshot: z17.strictObject({
|
|
6365
|
+
version: z17.number().int().positive(),
|
|
6366
|
+
schema: z17.record(z17.string(), z17.unknown())
|
|
6194
6367
|
}),
|
|
6195
|
-
change:
|
|
6196
|
-
version:
|
|
6197
|
-
schema:
|
|
6198
|
-
semantics:
|
|
6199
|
-
|
|
6200
|
-
|
|
6201
|
-
kind:
|
|
6202
|
-
maxEncodedBytes:
|
|
6368
|
+
change: z17.strictObject({
|
|
6369
|
+
version: z17.number().int().positive(),
|
|
6370
|
+
schema: z17.record(z17.string(), z17.unknown()),
|
|
6371
|
+
semantics: z17.discriminatedUnion("kind", [
|
|
6372
|
+
z17.strictObject({ kind: z17.literal("incremental") }),
|
|
6373
|
+
z17.strictObject({
|
|
6374
|
+
kind: z17.literal("snapshot-replacement"),
|
|
6375
|
+
maxEncodedBytes: z17.number().int().positive(),
|
|
6203
6376
|
rationale: pluginString(canonical).min(1).max(1024)
|
|
6204
6377
|
})
|
|
6205
6378
|
]).optional()
|
|
6206
6379
|
}),
|
|
6207
6380
|
read: AppDataSourceRead.optional(),
|
|
6208
|
-
store:
|
|
6209
|
-
|
|
6210
|
-
shape:
|
|
6211
|
-
rowsField:
|
|
6212
|
-
key:
|
|
6381
|
+
store: z17.discriminatedUnion("shape", [
|
|
6382
|
+
z17.strictObject({
|
|
6383
|
+
shape: z17.literal("rows"),
|
|
6384
|
+
rowsField: z17.string().min(1),
|
|
6385
|
+
key: z17.array(z17.string().min(1)).min(1)
|
|
6213
6386
|
}),
|
|
6214
|
-
|
|
6387
|
+
z17.strictObject({ shape: z17.literal("value") })
|
|
6215
6388
|
]).optional()
|
|
6216
6389
|
}).superRefine((source, ctx) => {
|
|
6217
6390
|
if (source.read !== void 0 && source.scope !== "session") {
|
|
@@ -6231,127 +6404,127 @@ function createResolvedContractSchemas(canonical) {
|
|
|
6231
6404
|
/** The auth service that module signs in through, whose accounts a card may send from. */
|
|
6232
6405
|
authService: GlobalContributionId2.optional()
|
|
6233
6406
|
});
|
|
6234
|
-
const ResolvedPluginCard2 =
|
|
6407
|
+
const ResolvedPluginCard2 = z17.strictObject({
|
|
6235
6408
|
localId: LocalContributionId2,
|
|
6236
6409
|
globalId: GlobalContributionId2,
|
|
6237
6410
|
pluginId: PluginId2,
|
|
6238
6411
|
description: NonEmptyString3,
|
|
6239
6412
|
inputs: JsonSchema,
|
|
6240
|
-
readEndpoint:
|
|
6413
|
+
readEndpoint: z17.strictObject({
|
|
6241
6414
|
localId: LocalContributionId2,
|
|
6242
6415
|
globalId: GlobalContributionId2
|
|
6243
6416
|
}),
|
|
6244
|
-
submitEndpoint:
|
|
6417
|
+
submitEndpoint: z17.strictObject({
|
|
6245
6418
|
localId: LocalContributionId2,
|
|
6246
6419
|
globalId: GlobalContributionId2
|
|
6247
6420
|
}),
|
|
6248
6421
|
authService: GlobalContributionId2.optional()
|
|
6249
6422
|
});
|
|
6250
|
-
const ResolvedKayAppWorkflow2 =
|
|
6423
|
+
const ResolvedKayAppWorkflow2 = z17.strictObject({
|
|
6251
6424
|
localId: LocalContributionId2,
|
|
6252
6425
|
globalId: GlobalContributionId2,
|
|
6253
6426
|
name: NonEmptyString3,
|
|
6254
6427
|
description: NonEmptyString3,
|
|
6255
|
-
everyMs:
|
|
6256
|
-
auth:
|
|
6428
|
+
everyMs: z17.number().int().positive(),
|
|
6429
|
+
auth: z17.strictObject({
|
|
6257
6430
|
serviceId: GlobalContributionId2,
|
|
6258
6431
|
schemeId: GlobalContributionId2,
|
|
6259
|
-
scopes:
|
|
6432
|
+
scopes: z17.array(NonEmptyString3).min(1).optional()
|
|
6260
6433
|
}).optional()
|
|
6261
6434
|
});
|
|
6262
|
-
const ResolvedKayAppWhiteboardType2 =
|
|
6435
|
+
const ResolvedKayAppWhiteboardType2 = z17.strictObject({
|
|
6263
6436
|
localId: LocalContributionId2,
|
|
6264
6437
|
globalId: GlobalContributionId2,
|
|
6265
6438
|
displayName: NonEmptyString3,
|
|
6266
|
-
schemaVersion:
|
|
6439
|
+
schemaVersion: z17.number().int().positive(),
|
|
6267
6440
|
storage: WhiteboardTypeStorage2,
|
|
6268
6441
|
valueSchema: JsonSchema
|
|
6269
6442
|
});
|
|
6270
|
-
const ResolvedKayAppMcpServer2 =
|
|
6443
|
+
const ResolvedKayAppMcpServer2 = z17.strictObject({
|
|
6271
6444
|
name: LocalContributionId2,
|
|
6272
6445
|
pluginId: PluginId2,
|
|
6273
6446
|
url: McpServerUrl2,
|
|
6274
6447
|
auth: McpServerAuthMode2,
|
|
6275
6448
|
authServiceId: GlobalContributionId2.optional()
|
|
6276
6449
|
});
|
|
6277
|
-
const ResolvedKayAgentUriModule2 =
|
|
6450
|
+
const ResolvedKayAgentUriModule2 = z17.strictObject({
|
|
6278
6451
|
localId: LocalContributionId2,
|
|
6279
6452
|
globalId: GlobalContributionId2,
|
|
6280
|
-
schemes:
|
|
6453
|
+
schemes: z17.array(UriScheme2).min(1),
|
|
6281
6454
|
displayName: NonEmptyString3.optional(),
|
|
6282
6455
|
authServiceId: GlobalContributionId2.optional(),
|
|
6283
6456
|
/** Mirrors `UriModuleContribution.authScheme`; a local ref takes the plugin's namespace. */
|
|
6284
6457
|
authSchemeId: GlobalContributionId2.optional(),
|
|
6285
6458
|
/** Mirrors `UriModuleContribution.knownResources` (host-side recording opt-in). */
|
|
6286
|
-
knownResources:
|
|
6459
|
+
knownResources: z17.literal(true).optional(),
|
|
6287
6460
|
/** Mirrors `UriModuleContribution.describesOperations`. */
|
|
6288
|
-
describesOperations:
|
|
6461
|
+
describesOperations: z17.literal(true).optional(),
|
|
6289
6462
|
/** Mirrors `UriModuleContribution.looksUpWebLinks`. */
|
|
6290
|
-
looksUpWebLinks:
|
|
6463
|
+
looksUpWebLinks: z17.literal(true).optional(),
|
|
6291
6464
|
...UriModuleFacts2.shape
|
|
6292
6465
|
});
|
|
6293
|
-
const ResolvedKayAgentArtifactUriModule2 =
|
|
6466
|
+
const ResolvedKayAgentArtifactUriModule2 = z17.strictObject({
|
|
6294
6467
|
localId: LocalContributionId2,
|
|
6295
6468
|
globalId: GlobalContributionId2,
|
|
6296
6469
|
scheme: UriScheme2,
|
|
6297
|
-
editable:
|
|
6298
|
-
listable:
|
|
6299
|
-
deletable:
|
|
6300
|
-
appendable:
|
|
6301
|
-
storageScope:
|
|
6470
|
+
editable: z17.boolean(),
|
|
6471
|
+
listable: z17.boolean(),
|
|
6472
|
+
deletable: z17.boolean(),
|
|
6473
|
+
appendable: z17.boolean(),
|
|
6474
|
+
storageScope: z17.enum(["session", "family"])
|
|
6302
6475
|
});
|
|
6303
|
-
const ResolvedKayAgentEntityResolver2 =
|
|
6476
|
+
const ResolvedKayAgentEntityResolver2 = z17.strictObject({
|
|
6304
6477
|
localId: LocalContributionId2,
|
|
6305
6478
|
globalId: GlobalContributionId2,
|
|
6306
6479
|
displayName: NonEmptyString3.optional(),
|
|
6307
6480
|
uriModule: GlobalContributionId2,
|
|
6308
|
-
entityTypes:
|
|
6481
|
+
entityTypes: z17.array(NonEmptyString3).min(1),
|
|
6309
6482
|
uriHint: NonEmptyString3
|
|
6310
6483
|
});
|
|
6311
|
-
const ResolvedKayAgentGitHostClaim2 =
|
|
6484
|
+
const ResolvedKayAgentGitHostClaim2 = z17.strictObject({
|
|
6312
6485
|
host: GitHostName2,
|
|
6313
6486
|
authServiceId: GlobalContributionId2,
|
|
6314
6487
|
/** Manifest-declared order; the clone ladder tries them in sequence. */
|
|
6315
|
-
authSchemeIds:
|
|
6488
|
+
authSchemeIds: z17.array(GlobalContributionId2).min(1),
|
|
6316
6489
|
/** Non-secret display copy for the claiming service, for clone failure text. */
|
|
6317
|
-
authServiceDisplayName:
|
|
6490
|
+
authServiceDisplayName: z17.string(),
|
|
6318
6491
|
basicAuthUser: GitBasicAuthUser2
|
|
6319
6492
|
});
|
|
6320
|
-
const ResolvedKayAgentConverter2 =
|
|
6493
|
+
const ResolvedKayAgentConverter2 = z17.strictObject({
|
|
6321
6494
|
localId: LocalContributionId2,
|
|
6322
6495
|
globalId: GlobalContributionId2,
|
|
6323
6496
|
description: NonEmptyString3.optional(),
|
|
6324
|
-
mimeTypes:
|
|
6325
|
-
extensions:
|
|
6497
|
+
mimeTypes: z17.array(MimeTypeString2).min(1),
|
|
6498
|
+
extensions: z17.array(FileExtensionToken2).min(1).optional()
|
|
6326
6499
|
});
|
|
6327
6500
|
const ResolvedReferencePresentationUrlClaim = ReferencePresentationUrlClaim2.extend({
|
|
6328
|
-
brandIcon:
|
|
6501
|
+
brandIcon: z17.string().max(64 * 1024).optional()
|
|
6329
6502
|
});
|
|
6330
|
-
const ResolvedReferencePresentation2 =
|
|
6503
|
+
const ResolvedReferencePresentation2 = z17.strictObject({
|
|
6331
6504
|
localId: LocalContributionId2,
|
|
6332
6505
|
globalId: GlobalContributionId2,
|
|
6333
6506
|
uriModule: GlobalContributionId2.optional(),
|
|
6334
6507
|
/** The schemes this presentation is about: its `scheme`, or its module's. */
|
|
6335
|
-
schemes:
|
|
6508
|
+
schemes: z17.array(UriScheme2).min(1).optional(),
|
|
6336
6509
|
/** The module's `displayName`: the source's name in a row. */
|
|
6337
6510
|
displayName: NonEmptyString3.optional(),
|
|
6338
6511
|
/** The module's auth service, qualified: whose accounts `accountLinks` reads. */
|
|
6339
6512
|
authService: GlobalContributionId2.optional(),
|
|
6340
6513
|
accountLinks: ReferencePresentationAccountLinks2.optional(),
|
|
6341
|
-
addresses:
|
|
6514
|
+
addresses: z17.array(ReferencePresentationAddress2).min(1).optional(),
|
|
6342
6515
|
/** Comes with `open`. A presentation with neither only words its module's addresses. */
|
|
6343
6516
|
resourceKind: NonEmptyString3.optional(),
|
|
6344
6517
|
open: ReferenceOpenBehavior2.optional(),
|
|
6345
6518
|
/** MIME-specific resource kinds; absent keys use the base presentation. */
|
|
6346
6519
|
variants: ReferencePresentationVariants2.optional(),
|
|
6347
|
-
claims:
|
|
6348
|
-
tooltip:
|
|
6520
|
+
claims: z17.array(ResolvedReferencePresentationUrlClaim).optional(),
|
|
6521
|
+
tooltip: z17.strictObject({
|
|
6349
6522
|
app: GlobalContributionId2,
|
|
6350
6523
|
pattern: ReferencePresentationUriPattern2
|
|
6351
6524
|
}).optional(),
|
|
6352
6525
|
words: ReferencePresentationWords2.optional()
|
|
6353
6526
|
});
|
|
6354
|
-
const ResolvedPluginProvisioningRequirement2 =
|
|
6527
|
+
const ResolvedPluginProvisioningRequirement2 = z17.strictObject({
|
|
6355
6528
|
id: LocalContributionId2,
|
|
6356
6529
|
displayName: NonEmptyString3,
|
|
6357
6530
|
description: NonEmptyString3,
|
|
@@ -6361,15 +6534,15 @@ function createResolvedContractSchemas(canonical) {
|
|
|
6361
6534
|
* URL degrades to "Reconnect" in the UI instead of a broken link.
|
|
6362
6535
|
*/
|
|
6363
6536
|
remediationUrl: HttpsUrl2.optional(),
|
|
6364
|
-
probe:
|
|
6537
|
+
probe: z17.strictObject({
|
|
6365
6538
|
url: HttpsUrl2,
|
|
6366
|
-
method:
|
|
6367
|
-
verdictStatuses:
|
|
6539
|
+
method: z17.enum(["GET"]),
|
|
6540
|
+
verdictStatuses: z17.array(SignedInStatusCode2).min(1),
|
|
6368
6541
|
nonEmptyArrayAt: NonEmptyString3.optional()
|
|
6369
6542
|
})
|
|
6370
6543
|
});
|
|
6371
6544
|
const ResolvedProvisioningField = {
|
|
6372
|
-
provisioning:
|
|
6545
|
+
provisioning: z17.array(ResolvedPluginProvisioningRequirement2).optional()
|
|
6373
6546
|
};
|
|
6374
6547
|
const ResolvedPluginAuthSchemeDescriptionFields = {
|
|
6375
6548
|
displayName: NonEmptyString3.optional(),
|
|
@@ -6381,114 +6554,115 @@ function createResolvedContractSchemas(canonical) {
|
|
|
6381
6554
|
...ResolvedPluginAuthSchemeDescriptionFields,
|
|
6382
6555
|
localId: LocalContributionId2,
|
|
6383
6556
|
globalId: GlobalContributionId2,
|
|
6384
|
-
kind:
|
|
6385
|
-
scopes:
|
|
6557
|
+
kind: z17.literal("oauth2"),
|
|
6558
|
+
scopes: z17.array(z17.string()).optional(),
|
|
6386
6559
|
authorizationUrl: HttpsUrl2,
|
|
6387
6560
|
tokenUrl: HttpsUrl2,
|
|
6388
|
-
extraAuthorizeParams:
|
|
6561
|
+
extraAuthorizeParams: z17.record(z17.string(), z17.string()).optional()
|
|
6389
6562
|
};
|
|
6390
|
-
const ResolvedPluginAuthSchemeOAuthPkce =
|
|
6563
|
+
const ResolvedPluginAuthSchemeOAuthPkce = z17.strictObject({
|
|
6391
6564
|
...ResolvedPluginAuthSchemeOAuthBase,
|
|
6392
|
-
exchange:
|
|
6393
|
-
|
|
6565
|
+
exchange: z17.literal("pkce"),
|
|
6566
|
+
byoocProfile: PluginByoocProfile.optional(),
|
|
6567
|
+
clientSuppliers: z17.array(PluginOAuthClientSupplier2).nonempty(),
|
|
6394
6568
|
clientId: NonEmptyString3.optional(),
|
|
6395
6569
|
clientSecret: NonEmptyString3.optional(),
|
|
6396
|
-
account:
|
|
6570
|
+
account: z17.literal("lookup").optional()
|
|
6397
6571
|
});
|
|
6398
|
-
const ResolvedPluginAuthSchemeOAuthConfidential =
|
|
6572
|
+
const ResolvedPluginAuthSchemeOAuthConfidential = z17.strictObject({
|
|
6399
6573
|
...ResolvedPluginAuthSchemeOAuthBase,
|
|
6400
|
-
exchange:
|
|
6401
|
-
clientSuppliers:
|
|
6402
|
-
account:
|
|
6574
|
+
exchange: z17.literal("confidential"),
|
|
6575
|
+
clientSuppliers: z17.tuple([z17.literal("kay")]),
|
|
6576
|
+
account: z17.enum(["lookup", "sign-in"])
|
|
6403
6577
|
});
|
|
6404
|
-
const ResolvedPluginAuthSchemeOAuth2 =
|
|
6578
|
+
const ResolvedPluginAuthSchemeOAuth2 = z17.discriminatedUnion("exchange", [
|
|
6405
6579
|
ResolvedPluginAuthSchemeOAuthPkce,
|
|
6406
6580
|
ResolvedPluginAuthSchemeOAuthConfidential
|
|
6407
6581
|
]);
|
|
6408
|
-
const ResolvedPluginAuthSchemeApiKey =
|
|
6582
|
+
const ResolvedPluginAuthSchemeApiKey = z17.strictObject({
|
|
6409
6583
|
...ResolvedProvisioningField,
|
|
6410
6584
|
...ResolvedPluginAuthSchemeDescriptionFields,
|
|
6411
6585
|
localId: LocalContributionId2,
|
|
6412
6586
|
globalId: GlobalContributionId2,
|
|
6413
|
-
kind:
|
|
6414
|
-
scopes:
|
|
6587
|
+
kind: z17.literal("api-key"),
|
|
6588
|
+
scopes: z17.array(z17.string()).optional(),
|
|
6415
6589
|
/** Resolution applies the manifest's default, "<service name> API key". */
|
|
6416
6590
|
inputLabel: NonEmptyString3,
|
|
6417
|
-
fields:
|
|
6418
|
-
setup:
|
|
6419
|
-
account:
|
|
6591
|
+
fields: z17.array(z17.strictObject({ id: z17.string(), label: z17.string() })).optional(),
|
|
6592
|
+
setup: z17.strictObject({ instructions: z17.string(), url: HttpsUrl2 }).optional(),
|
|
6593
|
+
account: z17.literal("lookup").optional()
|
|
6420
6594
|
});
|
|
6421
|
-
const ResolvedPluginAuthSchemeDelegated =
|
|
6595
|
+
const ResolvedPluginAuthSchemeDelegated = z17.strictObject({
|
|
6422
6596
|
...ResolvedPluginAuthSchemeDescriptionFields,
|
|
6423
6597
|
localId: LocalContributionId2,
|
|
6424
6598
|
globalId: GlobalContributionId2,
|
|
6425
|
-
kind:
|
|
6426
|
-
scopes:
|
|
6599
|
+
kind: z17.literal("delegated"),
|
|
6600
|
+
scopes: z17.array(z17.string()).optional()
|
|
6427
6601
|
});
|
|
6428
|
-
const ResolvedPluginAuthSchemeExternalCli =
|
|
6602
|
+
const ResolvedPluginAuthSchemeExternalCli = z17.strictObject({
|
|
6429
6603
|
...ResolvedPluginAuthSchemeDescriptionFields,
|
|
6430
6604
|
localId: LocalContributionId2,
|
|
6431
6605
|
globalId: GlobalContributionId2,
|
|
6432
|
-
kind:
|
|
6433
|
-
scopes:
|
|
6606
|
+
kind: z17.literal("external-cli"),
|
|
6607
|
+
scopes: z17.array(z17.string()).optional(),
|
|
6434
6608
|
/** The manifest's connect facts, verbatim. */
|
|
6435
6609
|
cli: PluginExternalCliConnect2.optional()
|
|
6436
6610
|
});
|
|
6437
|
-
const ResolvedPluginAuthScheme2 =
|
|
6611
|
+
const ResolvedPluginAuthScheme2 = z17.discriminatedUnion("kind", [
|
|
6438
6612
|
ResolvedPluginAuthSchemeOAuth2,
|
|
6439
6613
|
ResolvedPluginAuthSchemeApiKey,
|
|
6440
6614
|
ResolvedPluginAuthSchemeDelegated,
|
|
6441
6615
|
ResolvedPluginAuthSchemeExternalCli
|
|
6442
6616
|
]);
|
|
6443
|
-
const ResolvedPluginWebSession2 =
|
|
6444
|
-
importance:
|
|
6617
|
+
const ResolvedPluginWebSession2 = z17.strictObject({
|
|
6618
|
+
importance: z17.enum(["required", "recommended"]),
|
|
6445
6619
|
loginUrl: HttpsUrl2,
|
|
6446
|
-
cookieDomains:
|
|
6447
|
-
probe:
|
|
6620
|
+
cookieDomains: z17.array(RegistrableDomain2).min(1),
|
|
6621
|
+
probe: z17.strictObject({
|
|
6448
6622
|
url: HttpsUrl2,
|
|
6449
|
-
method:
|
|
6450
|
-
signedInStatuses:
|
|
6623
|
+
method: z17.enum(["GET", "POST"]),
|
|
6624
|
+
signedInStatuses: z17.array(SignedInStatusCode2).min(1)
|
|
6451
6625
|
}),
|
|
6452
|
-
oauthVenue:
|
|
6453
|
-
signInFirst:
|
|
6626
|
+
oauthVenue: z17.enum(["embedded", "external"]),
|
|
6627
|
+
signInFirst: z17.string().optional()
|
|
6454
6628
|
}).superRefine(refineWebSessionScopeConfined);
|
|
6455
|
-
const ResolvedPluginAuthService2 =
|
|
6629
|
+
const ResolvedPluginAuthService2 = z17.strictObject({
|
|
6456
6630
|
localId: LocalContributionId2,
|
|
6457
6631
|
globalId: GlobalContributionId2,
|
|
6458
|
-
displayName:
|
|
6459
|
-
summary:
|
|
6460
|
-
schemes:
|
|
6461
|
-
purposes:
|
|
6632
|
+
displayName: z17.string(),
|
|
6633
|
+
summary: z17.string().optional(),
|
|
6634
|
+
schemes: z17.array(ResolvedPluginAuthScheme2).min(1),
|
|
6635
|
+
purposes: z17.array(z17.string()).min(1),
|
|
6462
6636
|
/** The service's browser half, when the manifest declares one. */
|
|
6463
6637
|
webSession: ResolvedPluginWebSession2.optional()
|
|
6464
6638
|
});
|
|
6465
|
-
const ResolvedKayUiAppEndpointCapability2 =
|
|
6639
|
+
const ResolvedKayUiAppEndpointCapability2 = z17.strictObject({
|
|
6466
6640
|
localId: LocalContributionId2,
|
|
6467
6641
|
globalId: GlobalContributionId2
|
|
6468
6642
|
});
|
|
6469
|
-
const ResolvedKayUiApp2 =
|
|
6643
|
+
const ResolvedKayUiApp2 = z17.strictObject({
|
|
6470
6644
|
localId: LocalContributionId2,
|
|
6471
6645
|
globalId: GlobalContributionId2,
|
|
6472
6646
|
displayName: NonEmptyString3,
|
|
6473
|
-
contextOnly:
|
|
6647
|
+
contextOnly: z17.literal(true).optional(),
|
|
6474
6648
|
description: NonEmptyString3.optional(),
|
|
6475
6649
|
icon: PackageAssetPath2.optional(),
|
|
6476
|
-
runtime:
|
|
6477
|
-
sdk:
|
|
6650
|
+
runtime: z17.literal("kay.react-app.v1"),
|
|
6651
|
+
sdk: z17.strictObject({ range: NonEmptyString3 }),
|
|
6478
6652
|
entrypoint: TargetEntrypoint2,
|
|
6479
|
-
styles:
|
|
6480
|
-
assets:
|
|
6481
|
-
capabilities:
|
|
6482
|
-
endpoints:
|
|
6483
|
-
host:
|
|
6484
|
-
feeds:
|
|
6653
|
+
styles: z17.array(PackageAssetPath2).optional(),
|
|
6654
|
+
assets: z17.array(PackageAssetPath2).optional(),
|
|
6655
|
+
capabilities: z17.strictObject({
|
|
6656
|
+
endpoints: z17.array(ResolvedKayUiAppEndpointCapability2).optional(),
|
|
6657
|
+
host: z17.array(KayUiAppHostCapability2).optional(),
|
|
6658
|
+
feeds: z17.array(LocalContributionId2).optional()
|
|
6485
6659
|
}).optional()
|
|
6486
6660
|
});
|
|
6487
|
-
const ResolvedPluginContractV12 =
|
|
6488
|
-
protocol:
|
|
6661
|
+
const ResolvedPluginContractV12 = z17.strictObject({
|
|
6662
|
+
protocol: z17.literal("kay.plugin.v1"),
|
|
6489
6663
|
pluginId: PluginId2,
|
|
6490
6664
|
namespace: PluginNamespace2,
|
|
6491
|
-
contributions:
|
|
6665
|
+
contributions: z17.array(ResolvedPluginContributionId2),
|
|
6492
6666
|
// The deduplicated set of qualified (dotted) external auth-service ids this
|
|
6493
6667
|
// plugin references, from agent uriModule, tool and cliBinding
|
|
6494
6668
|
// `authService` refs, card sign-in refs, and auth-grant `service` refs. Always present - a plugin
|
|
@@ -6496,33 +6670,38 @@ function createResolvedContractSchemas(canonical) {
|
|
|
6496
6670
|
// is a recorded dependency, not a resolution: there is no runtime plugin
|
|
6497
6671
|
// loader in v1, so nothing here verifies the reference resolves within a
|
|
6498
6672
|
// composed roster (a composition-time concern owned elsewhere).
|
|
6499
|
-
consumesAuthServices:
|
|
6673
|
+
consumesAuthServices: z17.array(GlobalContributionId2),
|
|
6500
6674
|
// The explicit plugin-level dependency ids declared in `dependencies.plugins` on the manifest,
|
|
6501
6675
|
// deduped and validated at parse time. Always present; a plugin with no explicit dependencies
|
|
6502
6676
|
// carries an empty array. Composition checks each id against the accepted roster and derives the
|
|
6503
6677
|
// full dependency graph together with auth-inferred edges from `consumesAuthServices`.
|
|
6504
|
-
explicitDependencies:
|
|
6678
|
+
explicitDependencies: z17.array(PluginId2),
|
|
6679
|
+
dataDirSharedWith: PluginId2.optional(),
|
|
6680
|
+
workloadPurposes: z17.array(PluginWorkloadPurpose).optional(),
|
|
6681
|
+
shellCommands: z17.array(PluginShellCommand.omit({ endpoint: true }).extend({
|
|
6682
|
+
endpointId: GlobalContributionId2
|
|
6683
|
+
})).optional(),
|
|
6505
6684
|
// The auth services this plugin OWNS, carrying the global ids its harness
|
|
6506
6685
|
// target must register and the credential authority keys on. Always present;
|
|
6507
6686
|
// a plugin that declares no `auth.services` carries an empty array. The dual
|
|
6508
6687
|
// of `consumesAuthServices` (services it merely references).
|
|
6509
|
-
authServices:
|
|
6688
|
+
authServices: z17.array(ResolvedPluginAuthService2),
|
|
6510
6689
|
grants: ResolvedPluginGrants2.optional(),
|
|
6511
|
-
kayAgentUriModules:
|
|
6512
|
-
kayAgentArtifactUriModules:
|
|
6513
|
-
kayAgentEntityResolvers:
|
|
6514
|
-
kayAgentGitHostClaims:
|
|
6515
|
-
kayAgentTools:
|
|
6516
|
-
kayAppTools:
|
|
6517
|
-
kayAppApprovalTypes:
|
|
6518
|
-
kayAppWorkflows:
|
|
6519
|
-
kayAppCards:
|
|
6520
|
-
kayAppDataSources:
|
|
6521
|
-
kayAppWhiteboardTypes:
|
|
6522
|
-
kayAppMcpServers:
|
|
6523
|
-
kayAgentConverters:
|
|
6524
|
-
referencePresentations:
|
|
6525
|
-
kayUiApps:
|
|
6690
|
+
kayAgentUriModules: z17.array(ResolvedKayAgentUriModule2).optional(),
|
|
6691
|
+
kayAgentArtifactUriModules: z17.array(ResolvedKayAgentArtifactUriModule2).optional(),
|
|
6692
|
+
kayAgentEntityResolvers: z17.array(ResolvedKayAgentEntityResolver2).optional(),
|
|
6693
|
+
kayAgentGitHostClaims: z17.array(ResolvedKayAgentGitHostClaim2).optional(),
|
|
6694
|
+
kayAgentTools: z17.array(ResolvedKayAgentTool2).optional(),
|
|
6695
|
+
kayAppTools: z17.array(ResolvedKayAppTool2).optional(),
|
|
6696
|
+
kayAppApprovalTypes: z17.array(ResolvedKayAppApprovalType2).optional(),
|
|
6697
|
+
kayAppWorkflows: z17.array(ResolvedKayAppWorkflow2).optional(),
|
|
6698
|
+
kayAppCards: z17.array(ResolvedPluginCard2).optional(),
|
|
6699
|
+
kayAppDataSources: z17.array(ResolvedKayAppDataSource2).optional(),
|
|
6700
|
+
kayAppWhiteboardTypes: z17.array(ResolvedKayAppWhiteboardType2).optional(),
|
|
6701
|
+
kayAppMcpServers: z17.array(ResolvedKayAppMcpServer2).optional(),
|
|
6702
|
+
kayAgentConverters: z17.array(ResolvedKayAgentConverter2).optional(),
|
|
6703
|
+
referencePresentations: z17.array(ResolvedReferencePresentation2).optional(),
|
|
6704
|
+
kayUiApps: z17.array(ResolvedKayUiApp2).optional()
|
|
6526
6705
|
});
|
|
6527
6706
|
return {
|
|
6528
6707
|
ResolvedPluginContributionId: ResolvedPluginContributionId2,
|
|
@@ -6760,6 +6939,7 @@ function resolveAuthServices(namespace, manifest) {
|
|
|
6760
6939
|
kind: "oauth2",
|
|
6761
6940
|
exchange: "pkce",
|
|
6762
6941
|
clientSuppliers: scheme.clientSuppliers,
|
|
6942
|
+
...scheme.byoocProfile === void 0 ? {} : { byoocProfile: scheme.byoocProfile },
|
|
6763
6943
|
...scheme.clientId === void 0 ? {} : { clientId: scheme.clientId },
|
|
6764
6944
|
...scheme.clientSecret === void 0 ? {} : { clientSecret: scheme.clientSecret },
|
|
6765
6945
|
...scheme.account === void 0 ? {} : { account: scheme.account },
|
|
@@ -7050,6 +7230,14 @@ function resolveKayPluginContractV1(manifest) {
|
|
|
7050
7230
|
...manifest.dependencies?.plugins ?? []
|
|
7051
7231
|
],
|
|
7052
7232
|
authServices,
|
|
7233
|
+
...manifest.storage?.dataDir?.sharedWith === void 0 ? {} : { dataDirSharedWith: manifest.storage.dataDir.sharedWith },
|
|
7234
|
+
...manifest.workloadPurposes === void 0 ? {} : { workloadPurposes: manifest.workloadPurposes },
|
|
7235
|
+
...manifest.shellCommands === void 0 ? {} : {
|
|
7236
|
+
shellCommands: manifest.shellCommands.map(({ endpoint, ...command }) => ({
|
|
7237
|
+
...command,
|
|
7238
|
+
endpointId: resolveGlobalContributionId(namespace, endpoint)
|
|
7239
|
+
}))
|
|
7240
|
+
},
|
|
7053
7241
|
...grants && Object.keys(grants.byTarget).length > 0 ? { grants } : {},
|
|
7054
7242
|
...kayAgentUriModules && kayAgentUriModules.length > 0 ? { kayAgentUriModules } : {},
|
|
7055
7243
|
...kayAgentArtifactUriModules && kayAgentArtifactUriModules.length > 0 ? { kayAgentArtifactUriModules } : {},
|
|
@@ -7233,14 +7421,14 @@ function kayPluginCompatibilityAdvisories(input) {
|
|
|
7233
7421
|
message: boundPluginDiagnosticMessage(`${manifest.displayName} (${manifest.id}) ${advisory.message}`)
|
|
7234
7422
|
}));
|
|
7235
7423
|
}
|
|
7236
|
-
var ReadableCompatibility =
|
|
7237
|
-
supportedProtocols:
|
|
7424
|
+
var ReadableCompatibility = z18.object({
|
|
7425
|
+
supportedProtocols: z18.array(z18.string()).optional().catch(void 0),
|
|
7238
7426
|
minKayVersion: NonEmptyString.optional().catch(void 0),
|
|
7239
7427
|
sdk: NonEmptyString.optional().catch(void 0)
|
|
7240
7428
|
});
|
|
7241
|
-
var ReadableManifestHead =
|
|
7242
|
-
id:
|
|
7243
|
-
displayName:
|
|
7429
|
+
var ReadableManifestHead = z18.object({
|
|
7430
|
+
id: z18.string().optional().catch(void 0),
|
|
7431
|
+
displayName: z18.string().optional().catch(void 0),
|
|
7244
7432
|
compatibility: ReadableCompatibility.optional().catch(void 0)
|
|
7245
7433
|
});
|
|
7246
7434
|
function keepNamespaceDerivedTools(contract, grandfathered) {
|
|
@@ -7344,28 +7532,28 @@ function errorText(error) {
|
|
|
7344
7532
|
}
|
|
7345
7533
|
|
|
7346
7534
|
// packages/plugin-protocol/dist/session-health.js
|
|
7347
|
-
import { z as
|
|
7535
|
+
import { z as z19 } from "zod";
|
|
7348
7536
|
var SESSION_HEALTH_EXTENSION_ID = "kay.session-health";
|
|
7349
7537
|
var SESSION_HEALTH_ENTRY_NAME = "session_health";
|
|
7350
7538
|
var SESSION_HEALTH_CUSTOM_TYPE = `ext:${SESSION_HEALTH_EXTENSION_ID}:${SESSION_HEALTH_ENTRY_NAME}`;
|
|
7351
7539
|
var SESSION_HEALTH_CLASSIFIER_IDS = ["jev"];
|
|
7352
|
-
var sessionHealthEntrySchema =
|
|
7353
|
-
v:
|
|
7354
|
-
verdict:
|
|
7540
|
+
var sessionHealthEntrySchema = z19.object({
|
|
7541
|
+
v: z19.literal(1),
|
|
7542
|
+
verdict: z19.enum(["well", "bad", "unknown"]),
|
|
7355
7543
|
/**
|
|
7356
7544
|
* The model's calibrated confidence in `well`, 0..1, or null when the
|
|
7357
7545
|
* classifier declined to produce one. Never exported raw: the telemetry
|
|
7358
7546
|
* event carries only the decile bucket.
|
|
7359
7547
|
*/
|
|
7360
|
-
p_well:
|
|
7361
|
-
classifier:
|
|
7362
|
-
classifier_version:
|
|
7363
|
-
judged_at:
|
|
7364
|
-
user_entry_id:
|
|
7365
|
-
through_entry_id:
|
|
7366
|
-
usage:
|
|
7367
|
-
input_tokens:
|
|
7368
|
-
output_tokens:
|
|
7548
|
+
p_well: z19.number().min(0).max(1).nullable(),
|
|
7549
|
+
classifier: z19.enum(SESSION_HEALTH_CLASSIFIER_IDS),
|
|
7550
|
+
classifier_version: z19.string().min(1).max(64),
|
|
7551
|
+
judged_at: z19.number().int().nonnegative(),
|
|
7552
|
+
user_entry_id: z19.string().min(1).max(256),
|
|
7553
|
+
through_entry_id: z19.string().min(1).max(256),
|
|
7554
|
+
usage: z19.strictObject({
|
|
7555
|
+
input_tokens: z19.number().int().nonnegative(),
|
|
7556
|
+
output_tokens: z19.number().int().nonnegative()
|
|
7369
7557
|
}).optional()
|
|
7370
7558
|
});
|
|
7371
7559
|
function sessionHealthPWellDecile(pWell) {
|
|
@@ -7375,23 +7563,23 @@ function sessionHealthPWellDecile(pWell) {
|
|
|
7375
7563
|
}
|
|
7376
7564
|
|
|
7377
7565
|
// packages/plugin-protocol/dist/resource-invocations.js
|
|
7378
|
-
import { z as
|
|
7379
|
-
var CorpusResourceKind =
|
|
7566
|
+
import { z as z20 } from "zod";
|
|
7567
|
+
var CorpusResourceKind = z20.enum([
|
|
7380
7568
|
"skill",
|
|
7381
7569
|
"context-file",
|
|
7382
7570
|
"prompt-command"
|
|
7383
7571
|
]);
|
|
7384
|
-
var CorpusResourceInvocationCursor =
|
|
7385
|
-
at:
|
|
7386
|
-
eventId:
|
|
7572
|
+
var CorpusResourceInvocationCursor = z20.strictObject({
|
|
7573
|
+
at: z20.iso.datetime({ offset: true }),
|
|
7574
|
+
eventId: z20.string().min(1)
|
|
7387
7575
|
});
|
|
7388
|
-
var CorpusResourceInvocationQuery =
|
|
7576
|
+
var CorpusResourceInvocationQuery = z20.strictObject({
|
|
7389
7577
|
kind: CorpusResourceKind,
|
|
7390
|
-
since:
|
|
7391
|
-
until:
|
|
7578
|
+
since: z20.iso.datetime({ offset: true }),
|
|
7579
|
+
until: z20.iso.datetime({ offset: true }),
|
|
7392
7580
|
after: CorpusResourceInvocationCursor.optional(),
|
|
7393
|
-
limit:
|
|
7394
|
-
rootCreatedByKind:
|
|
7581
|
+
limit: z20.number().int().min(1).max(1e3).optional(),
|
|
7582
|
+
rootCreatedByKind: z20.enum(AGENT_RUNTIME_SESSION_CREATOR_KINDS).optional()
|
|
7395
7583
|
}).refine((value) => Date.parse(value.since) < Date.parse(value.until), {
|
|
7396
7584
|
message: "since must precede until"
|
|
7397
7585
|
});
|
|
@@ -7571,14 +7759,14 @@ function skillSuggestionEvidenceItems(evidence, options = {}) {
|
|
|
7571
7759
|
}
|
|
7572
7760
|
|
|
7573
7761
|
// packages/plugin-protocol/dist/ui-app-package.js
|
|
7574
|
-
import { z as
|
|
7762
|
+
import { z as z21 } from "zod";
|
|
7575
7763
|
var KAY_UI_APP_PACKAGE_PROTOCOL = "kay.ui.app-package.v1";
|
|
7576
7764
|
var KAY_UI_BUNDLE_INDEX_PROTOCOL = "kay.ui.bundle-index.v1";
|
|
7577
|
-
var KayUiBundleOutputPath =
|
|
7578
|
-
var KayUiBundleIndexV1 =
|
|
7579
|
-
protocol:
|
|
7765
|
+
var KayUiBundleOutputPath = z21.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" });
|
|
7766
|
+
var KayUiBundleIndexV1 = z21.strictObject({
|
|
7767
|
+
protocol: z21.literal(KAY_UI_BUNDLE_INDEX_PROTOCOL),
|
|
7580
7768
|
entryPath: KayUiBundleOutputPath,
|
|
7581
|
-
files:
|
|
7769
|
+
files: z21.array(z21.strictObject({
|
|
7582
7770
|
path: KayUiBundleOutputPath,
|
|
7583
7771
|
mediaType: NonEmptyString
|
|
7584
7772
|
})).min(1)
|
|
@@ -7605,19 +7793,19 @@ var KayUiBundleIndexV1 = z18.strictObject({
|
|
|
7605
7793
|
function parseKayUiBundleIndexV1(input) {
|
|
7606
7794
|
return KayUiBundleIndexV1.parse(input);
|
|
7607
7795
|
}
|
|
7608
|
-
var KayUiAppPackageFile =
|
|
7796
|
+
var KayUiAppPackageFile = z21.strictObject({
|
|
7609
7797
|
path: PackageAssetPath,
|
|
7610
7798
|
mediaType: NonEmptyString,
|
|
7611
|
-
bytes:
|
|
7799
|
+
bytes: z21.instanceof(Uint8Array).refine((bytes) => bytes.byteLength > 0, {
|
|
7612
7800
|
message: "app package file bytes must not be empty"
|
|
7613
7801
|
})
|
|
7614
7802
|
});
|
|
7615
|
-
var KayUiAppPackageV1 =
|
|
7616
|
-
protocol:
|
|
7803
|
+
var KayUiAppPackageV1 = z21.strictObject({
|
|
7804
|
+
protocol: z21.literal(KAY_UI_APP_PACKAGE_PROTOCOL),
|
|
7617
7805
|
appLocalId: LocalContributionId,
|
|
7618
7806
|
entry: KayUiAppPackageFile,
|
|
7619
|
-
styles:
|
|
7620
|
-
assets:
|
|
7807
|
+
styles: z21.array(KayUiAppPackageFile).optional(),
|
|
7808
|
+
assets: z21.array(KayUiAppPackageFile).optional()
|
|
7621
7809
|
}).superRefine((appPackage, ctx) => {
|
|
7622
7810
|
if (appPackage.entry.mediaType !== "application/javascript") {
|
|
7623
7811
|
ctx.addIssue({
|
|
@@ -7654,16 +7842,16 @@ function parseKayUiAppPackageV1(input) {
|
|
|
7654
7842
|
}
|
|
7655
7843
|
|
|
7656
7844
|
// packages/plugin-protocol/dist/whiteboard.js
|
|
7657
|
-
import { z as
|
|
7845
|
+
import { z as z22 } from "zod";
|
|
7658
7846
|
var WhiteboardValue = JsonValue;
|
|
7659
|
-
var WhiteboardEntryEnvelope =
|
|
7847
|
+
var WhiteboardEntryEnvelope = z22.strictObject({
|
|
7660
7848
|
id: NonEmptyString,
|
|
7661
7849
|
typeId: GlobalContributionId,
|
|
7662
|
-
schemaVersion:
|
|
7663
|
-
title:
|
|
7850
|
+
schemaVersion: z22.number().int().positive(),
|
|
7851
|
+
title: z22.string(),
|
|
7664
7852
|
authorSessionId: NonEmptyString.nullable()
|
|
7665
7853
|
});
|
|
7666
|
-
var WhiteboardEntrySummary =
|
|
7854
|
+
var WhiteboardEntrySummary = z22.strictObject({
|
|
7667
7855
|
name: NonEmptyString,
|
|
7668
7856
|
entry: WhiteboardEntryEnvelope,
|
|
7669
7857
|
revision: NonEmptyString
|
|
@@ -7671,54 +7859,54 @@ var WhiteboardEntrySummary = z19.strictObject({
|
|
|
7671
7859
|
var WhiteboardEntrySnapshot = WhiteboardEntrySummary.extend({
|
|
7672
7860
|
value: WhiteboardValue
|
|
7673
7861
|
});
|
|
7674
|
-
var WhiteboardDiagnostic =
|
|
7862
|
+
var WhiteboardDiagnostic = z22.strictObject({
|
|
7675
7863
|
ruleId: NonEmptyString,
|
|
7676
|
-
severity:
|
|
7864
|
+
severity: z22.enum(["error", "warning"]),
|
|
7677
7865
|
message: NonEmptyString
|
|
7678
7866
|
});
|
|
7679
|
-
var WhiteboardEntryInfo =
|
|
7867
|
+
var WhiteboardEntryInfo = z22.strictObject({
|
|
7680
7868
|
name: NonEmptyString,
|
|
7681
7869
|
revision: NonEmptyString,
|
|
7682
7870
|
entry: WhiteboardEntryEnvelope.optional(),
|
|
7683
|
-
state:
|
|
7684
|
-
mutable:
|
|
7685
|
-
diagnostics:
|
|
7871
|
+
state: z22.enum(["available", "unavailable", "unsupported-version", "invalid"]),
|
|
7872
|
+
mutable: z22.boolean(),
|
|
7873
|
+
diagnostics: z22.array(z22.string())
|
|
7686
7874
|
});
|
|
7687
7875
|
var WhiteboardEntryInspection = WhiteboardEntryInfo.extend({
|
|
7688
7876
|
value: WhiteboardValue.optional(),
|
|
7689
|
-
text:
|
|
7690
|
-
truncated:
|
|
7877
|
+
text: z22.string(),
|
|
7878
|
+
truncated: z22.boolean()
|
|
7691
7879
|
});
|
|
7692
|
-
var WhiteboardTypeInfo =
|
|
7880
|
+
var WhiteboardTypeInfo = z22.strictObject({
|
|
7693
7881
|
typeId: GlobalContributionId,
|
|
7694
7882
|
displayName: NonEmptyString,
|
|
7695
|
-
schemaVersion:
|
|
7696
|
-
available:
|
|
7883
|
+
schemaVersion: z22.number().int().positive(),
|
|
7884
|
+
available: z22.boolean()
|
|
7697
7885
|
});
|
|
7698
7886
|
|
|
7699
7887
|
// packages/plugin-protocol/dist/product-events.js
|
|
7700
|
-
import { z as
|
|
7888
|
+
import { z as z23 } from "zod";
|
|
7701
7889
|
var exportable = {
|
|
7702
|
-
class:
|
|
7703
|
-
optional:
|
|
7890
|
+
class: z23.literal("exportable"),
|
|
7891
|
+
optional: z23.boolean().optional()
|
|
7704
7892
|
};
|
|
7705
|
-
var PluginProductEventField =
|
|
7706
|
-
|
|
7707
|
-
|
|
7893
|
+
var PluginProductEventField = z23.union([
|
|
7894
|
+
z23.strictObject({ class: z23.literal("local") }),
|
|
7895
|
+
z23.strictObject({
|
|
7708
7896
|
...exportable,
|
|
7709
|
-
type:
|
|
7710
|
-
values:
|
|
7897
|
+
type: z23.literal("enum"),
|
|
7898
|
+
values: z23.array(z23.string())
|
|
7711
7899
|
}),
|
|
7712
|
-
|
|
7900
|
+
z23.strictObject({
|
|
7713
7901
|
...exportable,
|
|
7714
|
-
type:
|
|
7715
|
-
min:
|
|
7716
|
-
max:
|
|
7717
|
-
integer:
|
|
7902
|
+
type: z23.literal("number"),
|
|
7903
|
+
min: z23.number(),
|
|
7904
|
+
max: z23.number(),
|
|
7905
|
+
integer: z23.boolean().optional()
|
|
7718
7906
|
}),
|
|
7719
|
-
|
|
7907
|
+
z23.strictObject({
|
|
7720
7908
|
...exportable,
|
|
7721
|
-
type:
|
|
7909
|
+
type: z23.enum([
|
|
7722
7910
|
"boolean",
|
|
7723
7911
|
"id",
|
|
7724
7912
|
"identifier",
|
|
@@ -7734,9 +7922,9 @@ function isPluginProductEventName(name) {
|
|
|
7734
7922
|
}
|
|
7735
7923
|
|
|
7736
7924
|
// packages/plugin-protocol/dist/artifact-outputs.js
|
|
7737
|
-
import { z as
|
|
7925
|
+
import { z as z24 } from "zod";
|
|
7738
7926
|
var ARTIFACT_OUTPUT_PAGE_MAX = 200;
|
|
7739
|
-
var Segment =
|
|
7927
|
+
var Segment = z24.string().min(1).max(1024).refine((value) => !/[^A-Za-z0-9._-]/.test(value)).refine((value) => value !== "." && value !== "..");
|
|
7740
7928
|
function parseArtifactOutputUri(uri) {
|
|
7741
7929
|
const match = /^output:\/\/([^/]+)\/([^/]+)$/.exec(uri);
|
|
7742
7930
|
if (match === null || !Segment.safeParse(match[1]).success || !Segment.safeParse(match[2]).success)
|
|
@@ -7746,12 +7934,12 @@ function parseArtifactOutputUri(uri) {
|
|
|
7746
7934
|
function isCanonicalArtifactOutputUri(uri) {
|
|
7747
7935
|
return parseArtifactOutputUri(uri) !== void 0;
|
|
7748
7936
|
}
|
|
7749
|
-
var ArtifactOutputUri =
|
|
7750
|
-
var ArtifactOutputChange =
|
|
7751
|
-
|
|
7752
|
-
uris:
|
|
7937
|
+
var ArtifactOutputUri = z24.string().refine(isCanonicalArtifactOutputUri, "Expected a canonical output://session/name URI");
|
|
7938
|
+
var ArtifactOutputChange = z24.union([
|
|
7939
|
+
z24.strictObject({
|
|
7940
|
+
uris: z24.array(ArtifactOutputUri).min(1).max(ARTIFACT_OUTPUT_PAGE_MAX)
|
|
7753
7941
|
}),
|
|
7754
|
-
|
|
7942
|
+
z24.strictObject({ sessionId: Segment })
|
|
7755
7943
|
]);
|
|
7756
7944
|
|
|
7757
7945
|
// packages/plugin-protocol/dist/credential-text.js
|
|
@@ -7794,25 +7982,25 @@ function isCredentialShapedText(value) {
|
|
|
7794
7982
|
}
|
|
7795
7983
|
|
|
7796
7984
|
// packages/plugin-protocol/dist/ui-module-bundle.js
|
|
7797
|
-
import { z as
|
|
7985
|
+
import { z as z25 } from "zod";
|
|
7798
7986
|
var KAY_UI_MODULE_BUNDLE_PROTOCOL = "kay.ui.module-bundle.v1";
|
|
7799
7987
|
var KAY_UI_MODULE_FILE_MAX_BYTES = 8 * 1024 * 1024;
|
|
7800
7988
|
var KAY_UI_MODULE_BUNDLE_MAX_BYTES = 32 * 1024 * 1024;
|
|
7801
7989
|
var KAY_UI_MODULE_BUNDLE_MAX_FILES = 256;
|
|
7802
|
-
var OutputPath =
|
|
7990
|
+
var OutputPath = z25.string().min(1).max(1024).refine((value) => {
|
|
7803
7991
|
const parsed = KayUiBundleIndexV1.shape.entryPath.safeParse(value);
|
|
7804
7992
|
return parsed.success && parsed.data === value && value.split("/").every((part) => part !== "" && part !== ".") && // oxlint-disable-next-line eslint/no-control-regex -- Untrusted artifact paths must reject literal control characters.
|
|
7805
7993
|
!/[\u0000-\u001f?#:%]/.test(value);
|
|
7806
7994
|
}, { message: "bundle path must contain only unambiguous relative segments" });
|
|
7807
|
-
var Sha256 =
|
|
7808
|
-
var KayUiModuleBundleIndexV1 =
|
|
7809
|
-
protocol:
|
|
7995
|
+
var Sha256 = z25.string().regex(/^[a-f0-9]{64}$/);
|
|
7996
|
+
var KayUiModuleBundleIndexV1 = z25.strictObject({
|
|
7997
|
+
protocol: z25.literal(KAY_UI_MODULE_BUNDLE_PROTOCOL),
|
|
7810
7998
|
entryPath: OutputPath,
|
|
7811
|
-
stylePaths:
|
|
7812
|
-
files:
|
|
7999
|
+
stylePaths: z25.array(OutputPath).max(KAY_UI_MODULE_BUNDLE_MAX_FILES),
|
|
8000
|
+
files: z25.array(z25.strictObject({
|
|
7813
8001
|
path: OutputPath,
|
|
7814
|
-
mediaType:
|
|
7815
|
-
byteLength:
|
|
8002
|
+
mediaType: z25.string().min(1).max(128).regex(/^[a-zA-Z0-9!#$&^_.+-]+\/[a-zA-Z0-9!#$&^_.+-]+$/),
|
|
8003
|
+
byteLength: z25.number().int().min(1).max(KAY_UI_MODULE_FILE_MAX_BYTES),
|
|
7816
8004
|
sha256: Sha256
|
|
7817
8005
|
})).min(1).max(KAY_UI_MODULE_BUNDLE_MAX_FILES)
|
|
7818
8006
|
}).superRefine((index, ctx) => {
|
|
@@ -7842,9 +8030,9 @@ var KayUiModuleBundleIndexV1 = z22.strictObject({
|
|
|
7842
8030
|
message: "bundle exceeds byte cap"
|
|
7843
8031
|
});
|
|
7844
8032
|
});
|
|
7845
|
-
var KayUiModuleBundleReference =
|
|
8033
|
+
var KayUiModuleBundleReference = z25.strictObject({
|
|
7846
8034
|
generationId: Sha256,
|
|
7847
|
-
revision:
|
|
8035
|
+
revision: z25.string().min(1).max(4096).refine((value) => value.trim() === value),
|
|
7848
8036
|
index: KayUiModuleBundleIndexV1
|
|
7849
8037
|
});
|
|
7850
8038
|
export {
|
|
@@ -7979,6 +8167,7 @@ export {
|
|
|
7979
8167
|
PluginAuthManifest,
|
|
7980
8168
|
PluginAuthScheme,
|
|
7981
8169
|
PluginAuthService,
|
|
8170
|
+
PluginByoocProfile,
|
|
7982
8171
|
PluginCapabilityClaimInputV1,
|
|
7983
8172
|
PluginCapabilityClaimV1,
|
|
7984
8173
|
PluginCapabilityDecisionV1,
|
|
@@ -8007,10 +8196,12 @@ export {
|
|
|
8007
8196
|
PluginNotificationRuleContribution,
|
|
8008
8197
|
PluginOAuthClientSupplier,
|
|
8009
8198
|
PluginPermissionManifest,
|
|
8199
|
+
PluginPickerRound,
|
|
8010
8200
|
PluginProductEventContribution,
|
|
8011
8201
|
PluginProductEventField,
|
|
8012
8202
|
PluginProvisioningProbe,
|
|
8013
8203
|
PluginProvisioningRequirement,
|
|
8204
|
+
PluginShellCommand,
|
|
8014
8205
|
PluginSignal,
|
|
8015
8206
|
PluginSignalPublish,
|
|
8016
8207
|
PluginSkillSourceDeclaration,
|
|
@@ -8020,6 +8211,7 @@ export {
|
|
|
8020
8211
|
PluginToolName,
|
|
8021
8212
|
PluginWebSessionDeclaration,
|
|
8022
8213
|
PluginWebSessionProbe,
|
|
8214
|
+
PluginWorkloadPurpose,
|
|
8023
8215
|
RENAMED_PLUGIN_CAPABILITY_SLUGS,
|
|
8024
8216
|
RESERVED_DIRECTORY_PLUGIN_ID_PREFIXES,
|
|
8025
8217
|
RETIRED_COMPATIBILITY_KEYS,
|
|
@@ -8082,6 +8274,9 @@ export {
|
|
|
8082
8274
|
SessionProvenanceRecord,
|
|
8083
8275
|
SessionReaderContribution,
|
|
8084
8276
|
SessionRelationship,
|
|
8277
|
+
ShellCommandOutcome,
|
|
8278
|
+
ShellCommandRequest,
|
|
8279
|
+
ShellCommandStep,
|
|
8085
8280
|
SignedInStatusCode,
|
|
8086
8281
|
SkillContribution,
|
|
8087
8282
|
StorageGrantRequest,
|