@yaklabs-ai/plugin-protocol 0.51.0 → 0.52.1
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 +949 -153
- package/dist/index.js +1166 -950
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -266,8 +266,10 @@ var JsonSchema = z4.record(z4.string(), JsonValue);
|
|
|
266
266
|
var KAY_PLUGIN_MANIFEST_SIZE_CAP_BYTES = 1024 * 1024;
|
|
267
267
|
var KAY_PLUGIN_PROTOCOL_VERSION = "kay.plugin.v1";
|
|
268
268
|
var KAY_PLUGIN_PROTOCOL_PACKAGE_NAME = "@bonsai/plugin-protocol";
|
|
269
|
-
var KAY_PLUGIN_SDK_VERSION = "0.
|
|
269
|
+
var KAY_PLUGIN_SDK_VERSION = "0.52.1";
|
|
270
270
|
var KAY_PLUGIN_COMPATIBLE_SDK_VERSIONS = [
|
|
271
|
+
"0.52.0",
|
|
272
|
+
"0.51.0",
|
|
271
273
|
"0.50.0",
|
|
272
274
|
"0.49.0"
|
|
273
275
|
];
|
|
@@ -1233,7 +1235,7 @@ function finalizeArtifactProvenanceEnvelope(capture, artifacts) {
|
|
|
1233
1235
|
}
|
|
1234
1236
|
|
|
1235
1237
|
// packages/plugin-protocol/dist/authority.js
|
|
1236
|
-
import { z as
|
|
1238
|
+
import { z as z11 } from "zod";
|
|
1237
1239
|
|
|
1238
1240
|
// packages/plugin-protocol/dist/permissions.js
|
|
1239
1241
|
var permissions_exports = {};
|
|
@@ -1268,7 +1270,7 @@ __export(permissions_exports, {
|
|
|
1268
1270
|
retiredPermissionAsksIn: () => retiredPermissionAsksIn,
|
|
1269
1271
|
webSessionPathWithinPrefix: () => webSessionPathWithinPrefix
|
|
1270
1272
|
});
|
|
1271
|
-
import { z as
|
|
1273
|
+
import { z as z10 } from "zod";
|
|
1272
1274
|
|
|
1273
1275
|
// packages/plugin-protocol/dist/ids.js
|
|
1274
1276
|
function resolvePluginNamespace(pluginId, namespace) {
|
|
@@ -1296,6 +1298,50 @@ function resolveAdapterId(globalId, declaredAdapterId) {
|
|
|
1296
1298
|
return declaredAdapterId ?? globalId;
|
|
1297
1299
|
}
|
|
1298
1300
|
|
|
1301
|
+
// packages/plugin-protocol/dist/sign-in-facts.js
|
|
1302
|
+
import { z as z9 } from "zod";
|
|
1303
|
+
var Label = z9.string().min(1).max(120).refine((value) => value.trim().length > 0);
|
|
1304
|
+
var SetupText = z9.string().min(1).max(2048).refine((value) => value.trim().length > 0);
|
|
1305
|
+
var ClientFieldValidation = z9.discriminatedUnion("kind", [
|
|
1306
|
+
z9.strictObject({ kind: z9.literal("uuid") }),
|
|
1307
|
+
z9.strictObject({
|
|
1308
|
+
kind: z9.literal("suffix"),
|
|
1309
|
+
value: z9.string().min(1).max(120)
|
|
1310
|
+
})
|
|
1311
|
+
]);
|
|
1312
|
+
var PluginByoocProfile = z9.strictObject({
|
|
1313
|
+
displayName: Label,
|
|
1314
|
+
fields: z9.array(z9.strictObject({
|
|
1315
|
+
id: z9.string().regex(/^[A-Za-z][A-Za-z0-9]{0,63}$/),
|
|
1316
|
+
label: Label,
|
|
1317
|
+
optional: z9.boolean().optional(),
|
|
1318
|
+
validation: ClientFieldValidation.optional(),
|
|
1319
|
+
failureMessage: SetupText.optional()
|
|
1320
|
+
})).min(1).max(8).refine((fields) => fields[0]?.id === "clientId", {
|
|
1321
|
+
message: "the first BYOOC field must be clientId"
|
|
1322
|
+
}).refine((fields) => new Set(fields.map((field) => field.id)).size === fields.length, {
|
|
1323
|
+
message: "BYOOC field ids must be unique"
|
|
1324
|
+
}),
|
|
1325
|
+
setup: z9.strictObject({
|
|
1326
|
+
steps: z9.array(SetupText).min(1).max(20),
|
|
1327
|
+
notes: z9.array(SetupText).max(20),
|
|
1328
|
+
url: z9.url().startsWith("https://")
|
|
1329
|
+
}),
|
|
1330
|
+
endpointTemplates: z9.strictObject({
|
|
1331
|
+
authorizationUrl: z9.string().min(1).max(512),
|
|
1332
|
+
tokenUrl: z9.string().min(1).max(512)
|
|
1333
|
+
}).optional()
|
|
1334
|
+
});
|
|
1335
|
+
var PluginPickerRound = z9.strictObject({
|
|
1336
|
+
scopes: z9.array(z9.string().min(1).max(512)).min(1).max(16),
|
|
1337
|
+
extraAuthorizeParams: z9.record(z9.string().min(1), z9.string()),
|
|
1338
|
+
redirectParam: z9.string().min(1).max(120),
|
|
1339
|
+
requiresGrantedScope: z9.string().min(1).max(512),
|
|
1340
|
+
supersededByScopes: z9.array(z9.string().min(1).max(512)).max(16),
|
|
1341
|
+
purpose: Label,
|
|
1342
|
+
displayNoun: Label
|
|
1343
|
+
});
|
|
1344
|
+
|
|
1299
1345
|
// packages/plugin-protocol/dist/permissions.js
|
|
1300
1346
|
var WEB_SESSION_CSRF_SELECTOR_PATTERN = /^(?=.)(?:[a-zA-Z][a-zA-Z0-9-]*)?(?:#[a-zA-Z_][\w-]*|\[[a-zA-Z_:][\w:.-]*(?:=(?:"[^"]*"|'[^']*'|[\w-]+))?\])*$/u;
|
|
1301
1347
|
var RETIRED_PERMISSION_ASK_KEYS = [
|
|
@@ -1321,39 +1367,39 @@ var RETIRED_PERMISSION_ASK_KEYS = [
|
|
|
1321
1367
|
var RETIRED_WEB_SESSION_ROW_KEYS = ["operations"];
|
|
1322
1368
|
function createPermissionsSchemas(canonical) {
|
|
1323
1369
|
const { AuthSchemeReference: AuthSchemeReference2, AuthServiceReference: AuthServiceReference2, GlobalContributionId: GlobalContributionId2, LocalContributionId: LocalContributionId2, NonEmptyString: NonEmptyString3 } = canonical ? canonicalCommonSchemas : common_exports;
|
|
1324
|
-
const AuthGrantOperation2 =
|
|
1370
|
+
const AuthGrantOperation2 = z10.enum([
|
|
1325
1371
|
"status",
|
|
1326
1372
|
"list",
|
|
1327
1373
|
"connect",
|
|
1328
1374
|
"disconnect",
|
|
1329
1375
|
"resolve"
|
|
1330
1376
|
]);
|
|
1331
|
-
const AuthAccountSelector2 =
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
kind:
|
|
1377
|
+
const AuthAccountSelector2 = z10.discriminatedUnion("kind", [
|
|
1378
|
+
z10.strictObject({ kind: z10.literal("active") }),
|
|
1379
|
+
z10.strictObject({
|
|
1380
|
+
kind: z10.literal("account-id"),
|
|
1335
1381
|
accountId: NonEmptyString3
|
|
1336
1382
|
}),
|
|
1337
|
-
|
|
1383
|
+
z10.strictObject({ kind: z10.literal("record-id"), recordId: NonEmptyString3 })
|
|
1338
1384
|
]);
|
|
1339
|
-
const AuthScopeDefinition2 =
|
|
1385
|
+
const AuthScopeDefinition2 = z10.strictObject({
|
|
1340
1386
|
id: NonEmptyString3,
|
|
1341
1387
|
label: NonEmptyString3,
|
|
1342
1388
|
description: NonEmptyString3,
|
|
1343
|
-
documentationUrl:
|
|
1389
|
+
documentationUrl: z10.url().optional()
|
|
1344
1390
|
});
|
|
1345
|
-
const ScopeNeed2 =
|
|
1391
|
+
const ScopeNeed2 = z10.strictObject({
|
|
1346
1392
|
scope: NonEmptyString3,
|
|
1347
1393
|
reason: NonEmptyString3.exactOptional()
|
|
1348
1394
|
});
|
|
1349
|
-
const ScopeAlternative2 =
|
|
1350
|
-
allOf:
|
|
1395
|
+
const ScopeAlternative2 = z10.strictObject({
|
|
1396
|
+
allOf: z10.array(ScopeNeed2).min(1)
|
|
1351
1397
|
});
|
|
1352
|
-
const ScopeRequirement2 =
|
|
1398
|
+
const ScopeRequirement2 = z10.strictObject({
|
|
1353
1399
|
purpose: NonEmptyString3,
|
|
1354
|
-
alternatives:
|
|
1400
|
+
alternatives: z10.array(ScopeAlternative2).min(1)
|
|
1355
1401
|
});
|
|
1356
|
-
const AuthGrantFrontDoor2 =
|
|
1402
|
+
const AuthGrantFrontDoor2 = z10.strictObject({
|
|
1357
1403
|
/**
|
|
1358
1404
|
* The door id: the id `service_connect` takes (`gmail`). Never a registered auth service's id, and
|
|
1359
1405
|
* not the grant's `service`, which names the shared sign-in the door expands.
|
|
@@ -1365,15 +1411,20 @@ function createPermissionsSchemas(canonical) {
|
|
|
1365
1411
|
* first connect chains into a pick. `selection`: the scope already reaches every file of the
|
|
1366
1412
|
* type, and the pick only records which ones the person meant.
|
|
1367
1413
|
*/
|
|
1368
|
-
resourcePicker:
|
|
1369
|
-
effect:
|
|
1414
|
+
resourcePicker: z10.strictObject({
|
|
1415
|
+
effect: z10.enum(["selection", "resource-grant"]),
|
|
1370
1416
|
/** The file types the picker offers. */
|
|
1371
|
-
mimeTypes:
|
|
1417
|
+
mimeTypes: z10.array(NonEmptyString3.max(255)).min(1).max(32).optional(),
|
|
1372
1418
|
/** What the agent is told about the picked set once the pick lands. */
|
|
1373
|
-
successNote: NonEmptyString3.max(2048).optional()
|
|
1419
|
+
successNote: NonEmptyString3.max(2048).optional(),
|
|
1420
|
+
round: PluginPickerRound.optional(),
|
|
1421
|
+
completion: z10.strictObject({
|
|
1422
|
+
pluginId: z10.string().min(1),
|
|
1423
|
+
moduleId: z10.string().min(1)
|
|
1424
|
+
}).optional()
|
|
1374
1425
|
}).optional()
|
|
1375
1426
|
});
|
|
1376
|
-
const AuthGrantRequestBase =
|
|
1427
|
+
const AuthGrantRequestBase = z10.strictObject({
|
|
1377
1428
|
// A local (undotted) service must be declared in this same manifest; a
|
|
1378
1429
|
// qualified (dotted) service names another plugin's global id and is an
|
|
1379
1430
|
// external service dependency, recorded on the resolved contract's
|
|
@@ -1382,22 +1433,22 @@ function createPermissionsSchemas(canonical) {
|
|
|
1382
1433
|
// Optional for backward compatibility with grants whose service has a
|
|
1383
1434
|
// single unambiguous scheme. Local ids resolve under the service owner's
|
|
1384
1435
|
// namespace; qualified ids are preserved.
|
|
1385
|
-
schemes:
|
|
1386
|
-
operations:
|
|
1387
|
-
purposes:
|
|
1436
|
+
schemes: z10.array(AuthSchemeReference2).min(1).optional(),
|
|
1437
|
+
operations: z10.array(AuthGrantOperation2).min(1),
|
|
1438
|
+
purposes: z10.array(NonEmptyString3).optional(),
|
|
1388
1439
|
// Bridged by the runtime into an enforceable `CredentialGrant`:
|
|
1389
1440
|
// `allowedScopes` is the caller's scope ENVELOPE and
|
|
1390
1441
|
// `accountSelectors` map through. Absent `accountSelectors` resolves to the
|
|
1391
1442
|
// narrowest bound (see `ResolvedAuthGrantRequest`); absent scope envelope
|
|
1392
1443
|
// leaves the bridged grant scope-agnostic.
|
|
1393
|
-
allowedScopes:
|
|
1444
|
+
allowedScopes: z10.array(NonEmptyString3).min(1).optional(),
|
|
1394
1445
|
// Legacy spelling for `allowedScopes`; new manifests should use the authority-shaped name.
|
|
1395
|
-
requiredScopes:
|
|
1446
|
+
requiredScopes: z10.array(NonEmptyString3).min(1).optional(),
|
|
1396
1447
|
// Preferred proactive consent bundle; runtime resolution still uses `scopeRequirement`.
|
|
1397
|
-
connectScopes:
|
|
1448
|
+
connectScopes: z10.array(NonEmptyString3).min(1).optional(),
|
|
1398
1449
|
scopeRequirement: ScopeRequirement2.optional(),
|
|
1399
|
-
scopeDefinitions:
|
|
1400
|
-
accountSelectors:
|
|
1450
|
+
scopeDefinitions: z10.array(AuthScopeDefinition2).min(1).optional(),
|
|
1451
|
+
accountSelectors: z10.array(AuthAccountSelector2).min(1).optional(),
|
|
1401
1452
|
frontDoor: AuthGrantFrontDoor2.optional()
|
|
1402
1453
|
});
|
|
1403
1454
|
function validateAuthGrantRequest(grant, ctx) {
|
|
@@ -1485,19 +1536,19 @@ function createPermissionsSchemas(canonical) {
|
|
|
1485
1536
|
}
|
|
1486
1537
|
}
|
|
1487
1538
|
const AuthGrantRequest2 = AuthGrantRequestBase.superRefine(validateAuthGrantRequest);
|
|
1488
|
-
const StorageGrantRequest2 =
|
|
1489
|
-
kind:
|
|
1490
|
-
operations:
|
|
1539
|
+
const StorageGrantRequest2 = z10.strictObject({
|
|
1540
|
+
kind: z10.enum(["sqlite", "dataDir"]),
|
|
1541
|
+
operations: z10.array(z10.enum(["open", "read", "write"])).min(1)
|
|
1491
1542
|
});
|
|
1492
|
-
const EventGrantRequest2 =
|
|
1543
|
+
const EventGrantRequest2 = z10.strictObject({
|
|
1493
1544
|
event: NonEmptyString3,
|
|
1494
|
-
operations:
|
|
1545
|
+
operations: z10.array(z10.enum(["subscribe", "publish"])).min(1)
|
|
1495
1546
|
});
|
|
1496
|
-
const EndpointGrantRequest2 =
|
|
1547
|
+
const EndpointGrantRequest2 = z10.strictObject({
|
|
1497
1548
|
endpoint: LocalContributionId2,
|
|
1498
|
-
operations:
|
|
1549
|
+
operations: z10.array(z10.enum(["register", "invoke"])).min(1)
|
|
1499
1550
|
});
|
|
1500
|
-
const WebSessionOrigin =
|
|
1551
|
+
const WebSessionOrigin = z10.string().superRefine((value, ctx) => {
|
|
1501
1552
|
try {
|
|
1502
1553
|
const url = new URL(value);
|
|
1503
1554
|
if (url.protocol !== "https:" || url.username !== "" || url.password !== "" || url.pathname !== "/" || url.search !== "" || url.hash !== "" || url.origin !== value) {
|
|
@@ -1510,7 +1561,7 @@ function createPermissionsSchemas(canonical) {
|
|
|
1510
1561
|
ctx.addIssue({ code: "custom", message: "must be a valid HTTPS origin" });
|
|
1511
1562
|
}
|
|
1512
1563
|
});
|
|
1513
|
-
const WebSessionCsrfSourceUrl =
|
|
1564
|
+
const WebSessionCsrfSourceUrl = z10.url({ protocol: /^https$/ }).superRefine((value, ctx) => {
|
|
1514
1565
|
const url = new URL(value);
|
|
1515
1566
|
if (url.username !== "" || url.password !== "" || url.hash !== "") {
|
|
1516
1567
|
ctx.addIssue({
|
|
@@ -1552,10 +1603,10 @@ function createPermissionsSchemas(canonical) {
|
|
|
1552
1603
|
}
|
|
1553
1604
|
});
|
|
1554
1605
|
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)");
|
|
1555
|
-
const WebSessionGrantRequest2 =
|
|
1606
|
+
const WebSessionGrantRequest2 = z10.strictObject({
|
|
1556
1607
|
origin: WebSessionOrigin,
|
|
1557
|
-
pathPrefixes:
|
|
1558
|
-
csrf:
|
|
1608
|
+
pathPrefixes: z10.array(WebSessionPathPrefix).min(1),
|
|
1609
|
+
csrf: z10.strictObject({
|
|
1559
1610
|
sourceUrl: WebSessionCsrfSourceUrl,
|
|
1560
1611
|
selector: WebSessionCsrfSelector2,
|
|
1561
1612
|
attribute: NonEmptyString3,
|
|
@@ -1564,14 +1615,14 @@ function createPermissionsSchemas(canonical) {
|
|
|
1564
1615
|
bodyField: NonEmptyString3.optional()
|
|
1565
1616
|
}).optional()
|
|
1566
1617
|
});
|
|
1567
|
-
const KnowledgeSearchGrantRequest2 =
|
|
1568
|
-
scope:
|
|
1618
|
+
const KnowledgeSearchGrantRequest2 = z10.strictObject({
|
|
1619
|
+
scope: z10.literal("own-schemes")
|
|
1569
1620
|
});
|
|
1570
|
-
const KnownResourcesGrantRequest2 =
|
|
1571
|
-
scope:
|
|
1621
|
+
const KnownResourcesGrantRequest2 = z10.strictObject({
|
|
1622
|
+
scope: z10.literal("own-modules")
|
|
1572
1623
|
});
|
|
1573
|
-
const PluginAgentDefinitionPermissionRule2 =
|
|
1574
|
-
effect:
|
|
1624
|
+
const PluginAgentDefinitionPermissionRule2 = z10.strictObject({
|
|
1625
|
+
effect: z10.enum(["allow", "deny", "ask"]),
|
|
1575
1626
|
/** Restrict to one tool name. */
|
|
1576
1627
|
tool: NonEmptyString3.optional(),
|
|
1577
1628
|
/** Restrict to one classified capability key. */
|
|
@@ -1581,7 +1632,7 @@ function createPermissionsSchemas(canonical) {
|
|
|
1581
1632
|
/** Restrict to matching resources (a path glob, or a URI-shaped policy address). */
|
|
1582
1633
|
resource: NonEmptyString3.optional(),
|
|
1583
1634
|
/** Restrict the rule to one permission mode; omit to apply in all modes. */
|
|
1584
|
-
mode:
|
|
1635
|
+
mode: z10.enum(["default", "ask", "allow", "auto"]).optional()
|
|
1585
1636
|
});
|
|
1586
1637
|
function stripRetiredPermissionAsks(value) {
|
|
1587
1638
|
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
@@ -1603,14 +1654,14 @@ function createPermissionsSchemas(canonical) {
|
|
|
1603
1654
|
}
|
|
1604
1655
|
return remaining;
|
|
1605
1656
|
}
|
|
1606
|
-
const TargetPermissionWiring2 =
|
|
1607
|
-
auth:
|
|
1608
|
-
storage:
|
|
1609
|
-
events:
|
|
1610
|
-
endpoints:
|
|
1611
|
-
webSession:
|
|
1612
|
-
knowledgeSearch:
|
|
1613
|
-
knownResources:
|
|
1657
|
+
const TargetPermissionWiring2 = z10.strictObject({
|
|
1658
|
+
auth: z10.array(AuthGrantRequest2).optional(),
|
|
1659
|
+
storage: z10.array(StorageGrantRequest2).optional(),
|
|
1660
|
+
events: z10.array(EventGrantRequest2).optional(),
|
|
1661
|
+
endpoints: z10.array(EndpointGrantRequest2).optional(),
|
|
1662
|
+
webSession: z10.array(WebSessionGrantRequest2).optional(),
|
|
1663
|
+
knowledgeSearch: z10.array(KnowledgeSearchGrantRequest2).optional(),
|
|
1664
|
+
knownResources: z10.array(KnownResourcesGrantRequest2).optional()
|
|
1614
1665
|
}).superRefine((permissions, ctx) => {
|
|
1615
1666
|
const rows = permissions.webSession ?? [];
|
|
1616
1667
|
for (const [index, row] of rows.entries()) {
|
|
@@ -1628,9 +1679,9 @@ function createPermissionsSchemas(canonical) {
|
|
|
1628
1679
|
}
|
|
1629
1680
|
}
|
|
1630
1681
|
});
|
|
1631
|
-
const TargetPermissionSet2 = canonical ? TargetPermissionWiring2 :
|
|
1632
|
-
const PluginPermissionManifest2 =
|
|
1633
|
-
byTarget:
|
|
1682
|
+
const TargetPermissionSet2 = canonical ? TargetPermissionWiring2 : z10.preprocess(stripRetiredPermissionAsks, TargetPermissionWiring2);
|
|
1683
|
+
const PluginPermissionManifest2 = z10.strictObject({
|
|
1684
|
+
byTarget: z10.strictObject({
|
|
1634
1685
|
"kay.agent": TargetPermissionSet2.optional(),
|
|
1635
1686
|
"kay.app": TargetPermissionSet2.optional(),
|
|
1636
1687
|
"kay.ui": TargetPermissionSet2.optional()
|
|
@@ -1648,26 +1699,26 @@ function createPermissionsSchemas(canonical) {
|
|
|
1648
1699
|
});
|
|
1649
1700
|
const ResolvedAuthGrantRequest2 = AuthGrantRequestBase.extend({
|
|
1650
1701
|
service: GlobalContributionId2,
|
|
1651
|
-
schemes:
|
|
1702
|
+
schemes: z10.array(GlobalContributionId2).min(1).optional(),
|
|
1652
1703
|
// Resolution fills an absent binding with the narrowest bound, so a resolved
|
|
1653
1704
|
// grant ALWAYS carries an explicit, non-broadening account selector - the
|
|
1654
1705
|
// runtime never has to invent a default and fail open.
|
|
1655
|
-
accountSelectors:
|
|
1706
|
+
accountSelectors: z10.array(AuthAccountSelector2).min(1)
|
|
1656
1707
|
}).superRefine(validateAuthGrantRequest);
|
|
1657
1708
|
const ResolvedEndpointGrantRequest2 = EndpointGrantRequest2.extend({
|
|
1658
1709
|
endpoint: GlobalContributionId2
|
|
1659
1710
|
});
|
|
1660
|
-
const ResolvedTargetGrantSet2 =
|
|
1661
|
-
auth:
|
|
1662
|
-
storage:
|
|
1663
|
-
events:
|
|
1664
|
-
endpoints:
|
|
1665
|
-
webSession:
|
|
1666
|
-
knowledgeSearch:
|
|
1667
|
-
knownResources:
|
|
1668
|
-
});
|
|
1669
|
-
const ResolvedPluginGrants2 =
|
|
1670
|
-
byTarget:
|
|
1711
|
+
const ResolvedTargetGrantSet2 = z10.strictObject({
|
|
1712
|
+
auth: z10.array(ResolvedAuthGrantRequest2).optional(),
|
|
1713
|
+
storage: z10.array(StorageGrantRequest2).optional(),
|
|
1714
|
+
events: z10.array(EventGrantRequest2).optional(),
|
|
1715
|
+
endpoints: z10.array(ResolvedEndpointGrantRequest2).optional(),
|
|
1716
|
+
webSession: z10.array(WebSessionGrantRequest2).optional(),
|
|
1717
|
+
knowledgeSearch: z10.array(KnowledgeSearchGrantRequest2).optional(),
|
|
1718
|
+
knownResources: z10.array(KnownResourcesGrantRequest2).optional()
|
|
1719
|
+
});
|
|
1720
|
+
const ResolvedPluginGrants2 = z10.strictObject({
|
|
1721
|
+
byTarget: z10.strictObject({
|
|
1671
1722
|
"kay.agent": ResolvedTargetGrantSet2.optional(),
|
|
1672
1723
|
"kay.app": ResolvedTargetGrantSet2.optional(),
|
|
1673
1724
|
"kay.ui": ResolvedTargetGrantSet2.optional()
|
|
@@ -1772,6 +1823,7 @@ var PLUGIN_CAPABILITY_SLUGS = [
|
|
|
1772
1823
|
"agents.run",
|
|
1773
1824
|
"dynamic-context.register",
|
|
1774
1825
|
"app-data.register",
|
|
1826
|
+
"app-data.read",
|
|
1775
1827
|
"knowledge-source.register",
|
|
1776
1828
|
"artifacts.read",
|
|
1777
1829
|
"session-artifacts.read",
|
|
@@ -1818,24 +1870,24 @@ var AGENT_PERMISSION_RULE_FIELDS = [
|
|
|
1818
1870
|
function createAuthoritySchemas(canonical) {
|
|
1819
1871
|
const { ArtifactGenerationId: ArtifactGenerationId2, NonEmptyString: NonEmptyString3, UriScheme: UriScheme2, PluginId: PluginId2, LocalContributionId: LocalContributionId2 } = canonical ? canonicalCommonSchemas : common_exports;
|
|
1820
1872
|
const { PluginAgentDefinitionPermissionRule: PluginAgentDefinitionPermissionRule2 } = canonical ? canonicalPermissionSchemas : permissions_exports;
|
|
1821
|
-
const WhiteboardCapabilityScope2 =
|
|
1822
|
-
const WhiteboardCapabilityOperation2 =
|
|
1873
|
+
const WhiteboardCapabilityScope2 = z11.enum(["own-types", "all-types"]);
|
|
1874
|
+
const WhiteboardCapabilityOperation2 = z11.enum([
|
|
1823
1875
|
"discover",
|
|
1824
1876
|
"read",
|
|
1825
1877
|
"create",
|
|
1826
1878
|
"update",
|
|
1827
1879
|
"remove"
|
|
1828
1880
|
]);
|
|
1829
|
-
const WhiteboardCapabilityClaimV12 =
|
|
1830
|
-
target:
|
|
1831
|
-
slug:
|
|
1881
|
+
const WhiteboardCapabilityClaimV12 = z11.strictObject({
|
|
1882
|
+
target: z11.enum(["kay.agent", "kay.app"]),
|
|
1883
|
+
slug: z11.enum([
|
|
1832
1884
|
"whiteboard.discover",
|
|
1833
1885
|
"whiteboard.read",
|
|
1834
1886
|
"whiteboard.create",
|
|
1835
1887
|
"whiteboard.update",
|
|
1836
1888
|
"whiteboard.remove"
|
|
1837
1889
|
]),
|
|
1838
|
-
envelope:
|
|
1890
|
+
envelope: z11.strictObject({ scope: WhiteboardCapabilityScope2 })
|
|
1839
1891
|
}).superRefine((claim, ctx) => {
|
|
1840
1892
|
if (claim.target === "kay.app" && claim.slug !== "whiteboard.discover" && claim.slug !== "whiteboard.read") {
|
|
1841
1893
|
ctx.addIssue({
|
|
@@ -1845,167 +1897,167 @@ function createAuthoritySchemas(canonical) {
|
|
|
1845
1897
|
});
|
|
1846
1898
|
}
|
|
1847
1899
|
});
|
|
1848
|
-
const DeclaredSkillSourceEnvelope2 =
|
|
1849
|
-
|
|
1850
|
-
channel:
|
|
1900
|
+
const DeclaredSkillSourceEnvelope2 = z11.discriminatedUnion("channel", [
|
|
1901
|
+
z11.strictObject({
|
|
1902
|
+
channel: z11.literal("git-clone"),
|
|
1851
1903
|
locator: NonEmptyString3,
|
|
1852
1904
|
ref: NonEmptyString3.optional(),
|
|
1853
1905
|
subdir: NonEmptyString3.optional()
|
|
1854
1906
|
}),
|
|
1855
|
-
|
|
1856
|
-
channel:
|
|
1907
|
+
z11.strictObject({
|
|
1908
|
+
channel: z11.literal("installer"),
|
|
1857
1909
|
command: NonEmptyString3,
|
|
1858
|
-
args:
|
|
1910
|
+
args: z11.array(NonEmptyString3)
|
|
1859
1911
|
})
|
|
1860
1912
|
]);
|
|
1861
|
-
const PluginCapabilityClaimV12 =
|
|
1862
|
-
|
|
1863
|
-
target:
|
|
1864
|
-
slug:
|
|
1865
|
-
envelope:
|
|
1913
|
+
const PluginCapabilityClaimV12 = z11.discriminatedUnion("slug", [
|
|
1914
|
+
z11.strictObject({
|
|
1915
|
+
target: z11.literal("kay.app"),
|
|
1916
|
+
slug: z11.literal("sessions.run"),
|
|
1917
|
+
envelope: z11.strictObject({})
|
|
1866
1918
|
}),
|
|
1867
|
-
|
|
1868
|
-
target:
|
|
1869
|
-
slug:
|
|
1870
|
-
envelope:
|
|
1919
|
+
z11.strictObject({
|
|
1920
|
+
target: z11.literal("kay.agent"),
|
|
1921
|
+
slug: z11.literal("network.connect"),
|
|
1922
|
+
envelope: z11.strictObject({ connect: NonEmptyString3 })
|
|
1871
1923
|
}),
|
|
1872
|
-
|
|
1873
|
-
target:
|
|
1874
|
-
slug:
|
|
1875
|
-
envelope:
|
|
1924
|
+
z11.strictObject({
|
|
1925
|
+
target: z11.literal("kay.agent"),
|
|
1926
|
+
slug: z11.literal("web-session.request"),
|
|
1927
|
+
envelope: z11.strictObject({
|
|
1876
1928
|
origin: NonEmptyString3,
|
|
1877
1929
|
pathPrefix: NonEmptyString3
|
|
1878
1930
|
})
|
|
1879
1931
|
}),
|
|
1880
|
-
|
|
1881
|
-
target:
|
|
1882
|
-
slug:
|
|
1883
|
-
envelope:
|
|
1932
|
+
z11.strictObject({
|
|
1933
|
+
target: z11.literal("kay.agent"),
|
|
1934
|
+
slug: z11.literal("web-session.download"),
|
|
1935
|
+
envelope: z11.strictObject({
|
|
1884
1936
|
origin: NonEmptyString3,
|
|
1885
1937
|
pathPrefix: NonEmptyString3
|
|
1886
1938
|
})
|
|
1887
1939
|
}),
|
|
1888
|
-
|
|
1889
|
-
target:
|
|
1890
|
-
slug:
|
|
1891
|
-
envelope:
|
|
1940
|
+
z11.strictObject({
|
|
1941
|
+
target: z11.literal("kay.agent"),
|
|
1942
|
+
slug: z11.literal("process.spawn"),
|
|
1943
|
+
envelope: z11.strictObject({
|
|
1892
1944
|
command: NonEmptyString3,
|
|
1893
1945
|
argvClass: NonEmptyString3
|
|
1894
1946
|
})
|
|
1895
1947
|
}),
|
|
1896
|
-
|
|
1897
|
-
target:
|
|
1898
|
-
slug:
|
|
1899
|
-
envelope:
|
|
1948
|
+
z11.strictObject({
|
|
1949
|
+
target: z11.literal("kay.app"),
|
|
1950
|
+
slug: z11.literal("sessions.read"),
|
|
1951
|
+
envelope: z11.strictObject({})
|
|
1900
1952
|
}),
|
|
1901
|
-
|
|
1953
|
+
z11.strictObject({
|
|
1902
1954
|
// Every plugin's recorded Jev signals, not only the caller's own: an empty envelope because
|
|
1903
1955
|
// the grant itself is the visibility decision. Both first consumers (a session timeline, and
|
|
1904
1956
|
// an agent loop turning signals into skills) read rows another plugin recorded.
|
|
1905
|
-
target:
|
|
1906
|
-
slug:
|
|
1907
|
-
envelope:
|
|
1957
|
+
target: z11.literal("kay.app"),
|
|
1958
|
+
slug: z11.literal("signals.read"),
|
|
1959
|
+
envelope: z11.strictObject({})
|
|
1908
1960
|
}),
|
|
1909
|
-
|
|
1910
|
-
target:
|
|
1911
|
-
slug:
|
|
1912
|
-
envelope:
|
|
1961
|
+
z11.strictObject({
|
|
1962
|
+
target: z11.enum(["kay.agent", "kay.app"]),
|
|
1963
|
+
slug: z11.literal("uri.call"),
|
|
1964
|
+
envelope: z11.strictObject({
|
|
1913
1965
|
scheme: UriScheme2,
|
|
1914
|
-
verb:
|
|
1966
|
+
verb: z11.enum(["read", "list", "search", "write", "edit", "delete"])
|
|
1915
1967
|
})
|
|
1916
1968
|
}),
|
|
1917
|
-
|
|
1918
|
-
target:
|
|
1919
|
-
slug:
|
|
1920
|
-
envelope:
|
|
1969
|
+
z11.strictObject({
|
|
1970
|
+
target: z11.enum(["kay.agent", "kay.app", "kay.ui"]),
|
|
1971
|
+
slug: z11.literal("endpoints.invoke"),
|
|
1972
|
+
envelope: z11.strictObject({
|
|
1921
1973
|
pluginId: PluginId2,
|
|
1922
1974
|
endpointId: LocalContributionId2
|
|
1923
1975
|
})
|
|
1924
1976
|
}),
|
|
1925
|
-
|
|
1977
|
+
z11.strictObject({
|
|
1926
1978
|
// Read every managed skill and its history: identity, versions, revisions, changes against
|
|
1927
1979
|
// the source, past versions, suggestions. Never a write. An empty envelope because the
|
|
1928
1980
|
// grant itself is the visibility decision, as with `signals.read`.
|
|
1929
|
-
target:
|
|
1930
|
-
slug:
|
|
1931
|
-
envelope:
|
|
1981
|
+
target: z11.literal("kay.app"),
|
|
1982
|
+
slug: z11.literal("skills.read"),
|
|
1983
|
+
envelope: z11.strictObject({})
|
|
1932
1984
|
}),
|
|
1933
|
-
|
|
1985
|
+
z11.strictObject({
|
|
1934
1986
|
// Change, install and delete the user's skills. Every write follows the same rules an
|
|
1935
1987
|
// agent's `skill://` write does, and each revision records the plugin that made it.
|
|
1936
|
-
target:
|
|
1937
|
-
slug:
|
|
1938
|
-
envelope:
|
|
1988
|
+
target: z11.literal("kay.app"),
|
|
1989
|
+
slug: z11.literal("skills.write"),
|
|
1990
|
+
envelope: z11.strictObject({})
|
|
1939
1991
|
}),
|
|
1940
|
-
|
|
1992
|
+
z11.strictObject({
|
|
1941
1993
|
// Publish a share plan `skills.prepareShare` built: push the user's skill, with their git
|
|
1942
1994
|
// credentials, into a marketplace repository other people's installs read. Private
|
|
1943
1995
|
// (PRIVATE_PLUGIN_CAPABILITY_SLUGS): the host has no consent prompt for an SDK call that
|
|
1944
1996
|
// sends data off the machine.
|
|
1945
|
-
target:
|
|
1946
|
-
slug:
|
|
1947
|
-
envelope:
|
|
1997
|
+
target: z11.literal("kay.app"),
|
|
1998
|
+
slug: z11.literal("skills.share"),
|
|
1999
|
+
envelope: z11.strictObject({})
|
|
1948
2000
|
}),
|
|
1949
|
-
|
|
2001
|
+
z11.strictObject({
|
|
1950
2002
|
// Turn an installed plugin on or off, which starts or stops its code under its own grants.
|
|
1951
2003
|
// Private (PRIVATE_PLUGIN_CAPABILITY_SLUGS): a plugin holding it could turn back on what the
|
|
1952
2004
|
// user turned off.
|
|
1953
|
-
target:
|
|
1954
|
-
slug:
|
|
1955
|
-
envelope:
|
|
2005
|
+
target: z11.literal("kay.app"),
|
|
2006
|
+
slug: z11.literal("plugins.set-enabled"),
|
|
2007
|
+
envelope: z11.strictObject({})
|
|
1956
2008
|
}),
|
|
1957
|
-
|
|
2009
|
+
z11.strictObject({
|
|
1958
2010
|
// Write a steward entry (recap, next steps, title, work headlines) into the session whose
|
|
1959
2011
|
// event the calling handler is answering. Bound to that session: a call for any other is
|
|
1960
2012
|
// refused. The daemon keeps its own bounds on every field.
|
|
1961
|
-
target:
|
|
1962
|
-
slug:
|
|
1963
|
-
envelope:
|
|
2013
|
+
target: z11.literal("kay.app"),
|
|
2014
|
+
slug: z11.literal("sessions.annotate"),
|
|
2015
|
+
envelope: z11.strictObject({})
|
|
1964
2016
|
}),
|
|
1965
|
-
|
|
2017
|
+
z11.strictObject({
|
|
1966
2018
|
// Compact the session whose event the calling handler is answering. Its own claim because
|
|
1967
2019
|
// compaction rewrites the live context and spends a model call; the daemon keeps the user's
|
|
1968
2020
|
// consent switch and the context floor in front of it.
|
|
1969
|
-
target:
|
|
1970
|
-
slug:
|
|
1971
|
-
envelope:
|
|
2021
|
+
target: z11.literal("kay.app"),
|
|
2022
|
+
slug: z11.literal("sessions.compact"),
|
|
2023
|
+
envelope: z11.strictObject({})
|
|
1972
2024
|
}),
|
|
1973
|
-
|
|
2025
|
+
z11.strictObject({
|
|
1974
2026
|
// Read and rewrite the soul file every new conversation is told. Private
|
|
1975
2027
|
// (PRIVATE_PLUGIN_CAPABILITY_SLUGS): only a plugin the release carries may hold it.
|
|
1976
|
-
target:
|
|
1977
|
-
slug:
|
|
1978
|
-
envelope:
|
|
2028
|
+
target: z11.literal("kay.app"),
|
|
2029
|
+
slug: z11.literal("soul.write"),
|
|
2030
|
+
envelope: z11.strictObject({})
|
|
1979
2031
|
}),
|
|
1980
|
-
|
|
2032
|
+
z11.strictObject({
|
|
1981
2033
|
// The text an agent sees for a tool or an address in a live session, where each comes from,
|
|
1982
2034
|
// and whether it is one of Bonsai's own. Read-only and never a call. An empty envelope because
|
|
1983
2035
|
// the grant itself is the visibility decision, as with `skills.read`.
|
|
1984
|
-
target:
|
|
1985
|
-
slug:
|
|
1986
|
-
envelope:
|
|
2036
|
+
target: z11.literal("kay.app"),
|
|
2037
|
+
slug: z11.literal("tools.describe"),
|
|
2038
|
+
envelope: z11.strictObject({})
|
|
1987
2039
|
}),
|
|
1988
|
-
|
|
1989
|
-
target:
|
|
1990
|
-
slug:
|
|
1991
|
-
envelope:
|
|
2040
|
+
z11.strictObject({
|
|
2041
|
+
target: z11.literal("kay.app"),
|
|
2042
|
+
slug: z11.literal("workspace.command"),
|
|
2043
|
+
envelope: z11.strictObject({})
|
|
1992
2044
|
}),
|
|
1993
|
-
|
|
1994
|
-
target:
|
|
1995
|
-
slug:
|
|
1996
|
-
envelope:
|
|
2045
|
+
z11.strictObject({
|
|
2046
|
+
target: z11.literal("kay.app"),
|
|
2047
|
+
slug: z11.literal("sessions.create"),
|
|
2048
|
+
envelope: z11.strictObject({})
|
|
1997
2049
|
}),
|
|
1998
|
-
|
|
1999
|
-
target:
|
|
2000
|
-
slug:
|
|
2001
|
-
envelope:
|
|
2050
|
+
z11.strictObject({
|
|
2051
|
+
target: z11.literal("kay.app"),
|
|
2052
|
+
slug: z11.literal("sessions.update"),
|
|
2053
|
+
envelope: z11.strictObject({})
|
|
2002
2054
|
}),
|
|
2003
|
-
|
|
2004
|
-
target:
|
|
2005
|
-
slug:
|
|
2006
|
-
envelope:
|
|
2055
|
+
z11.strictObject({
|
|
2056
|
+
target: z11.literal("kay.app"),
|
|
2057
|
+
slug: z11.literal("models.complete"),
|
|
2058
|
+
envelope: z11.strictObject({})
|
|
2007
2059
|
}),
|
|
2008
|
-
|
|
2060
|
+
z11.strictObject({
|
|
2009
2061
|
// Held to `kay.app`, the daemon-lifetime tier, even though the same System One client is exposed on
|
|
2010
2062
|
// BOTH the `kay.app` and `kay.agent` plugin SDKs (and to host composition directly): a slug
|
|
2011
2063
|
// pins exactly one target (see this file's module doc), so one shared claim is simpler and
|
|
@@ -2014,195 +2066,203 @@ function createAuthoritySchemas(canonical) {
|
|
|
2014
2066
|
// plugin's own pinned authority, which already spans both targets for every other capability
|
|
2015
2067
|
// (`network.connect`/`tool-interception.register` are decided by the identical per-plugin
|
|
2016
2068
|
// handle `kay.app`-target claims use). `app.systemOne` authorizes against it the same way.
|
|
2017
|
-
target:
|
|
2018
|
-
slug:
|
|
2019
|
-
envelope:
|
|
2069
|
+
target: z11.literal("kay.app"),
|
|
2070
|
+
slug: z11.literal("systemOne.use"),
|
|
2071
|
+
envelope: z11.strictObject({})
|
|
2020
2072
|
}),
|
|
2021
|
-
|
|
2022
|
-
target:
|
|
2023
|
-
slug:
|
|
2024
|
-
envelope:
|
|
2073
|
+
z11.strictObject({
|
|
2074
|
+
target: z11.literal("kay.app"),
|
|
2075
|
+
slug: z11.literal("automations.write"),
|
|
2076
|
+
envelope: z11.strictObject({})
|
|
2025
2077
|
}),
|
|
2026
|
-
|
|
2027
|
-
target:
|
|
2028
|
-
slug:
|
|
2029
|
-
envelope:
|
|
2078
|
+
z11.strictObject({
|
|
2079
|
+
target: z11.literal("kay.app"),
|
|
2080
|
+
slug: z11.literal("automations.run"),
|
|
2081
|
+
envelope: z11.strictObject({})
|
|
2030
2082
|
}),
|
|
2031
|
-
|
|
2032
|
-
target:
|
|
2033
|
-
slug:
|
|
2034
|
-
envelope:
|
|
2083
|
+
z11.strictObject({
|
|
2084
|
+
target: z11.literal("kay.app"),
|
|
2085
|
+
slug: z11.literal("workflows.define"),
|
|
2086
|
+
envelope: z11.strictObject({})
|
|
2035
2087
|
}),
|
|
2036
|
-
|
|
2088
|
+
z11.strictObject({
|
|
2037
2089
|
// Start a declared workflow on every plugin's signal events (`signals: true`), which carry
|
|
2038
2090
|
// other plugins' data. Private (PRIVATE_PLUGIN_CAPABILITY_SLUGS): only a plugin the release
|
|
2039
2091
|
// carries may hold it, so a third-party plugin cannot read every source's signals.
|
|
2040
|
-
target:
|
|
2041
|
-
slug:
|
|
2042
|
-
envelope:
|
|
2092
|
+
target: z11.literal("kay.app"),
|
|
2093
|
+
slug: z11.literal("workflows.signals"),
|
|
2094
|
+
envelope: z11.strictObject({})
|
|
2043
2095
|
}),
|
|
2044
|
-
|
|
2045
|
-
target:
|
|
2046
|
-
slug:
|
|
2047
|
-
envelope:
|
|
2096
|
+
z11.strictObject({
|
|
2097
|
+
target: z11.literal("kay.app"),
|
|
2098
|
+
slug: z11.literal("session-events.subscribe"),
|
|
2099
|
+
envelope: z11.strictObject({})
|
|
2048
2100
|
}),
|
|
2049
|
-
|
|
2050
|
-
target:
|
|
2051
|
-
slug:
|
|
2052
|
-
envelope:
|
|
2101
|
+
z11.strictObject({
|
|
2102
|
+
target: z11.literal("kay.app"),
|
|
2103
|
+
slug: z11.literal("agents.run"),
|
|
2104
|
+
envelope: z11.strictObject({})
|
|
2053
2105
|
}),
|
|
2054
|
-
|
|
2055
|
-
target:
|
|
2056
|
-
slug:
|
|
2106
|
+
z11.strictObject({
|
|
2107
|
+
target: z11.literal("kay.app"),
|
|
2108
|
+
slug: z11.literal("dynamic-context.register"),
|
|
2057
2109
|
// The declared `contributes.contextContributors` localId, which doubles as the contributor's
|
|
2058
2110
|
// section tag at the model boundary - so the row a human consents to names the section.
|
|
2059
|
-
envelope:
|
|
2111
|
+
envelope: z11.strictObject({ contributor: NonEmptyString3 })
|
|
2060
2112
|
}),
|
|
2061
|
-
|
|
2062
|
-
target:
|
|
2063
|
-
slug:
|
|
2113
|
+
z11.strictObject({
|
|
2114
|
+
target: z11.literal("kay.ui"),
|
|
2115
|
+
slug: z11.literal("app-data.read"),
|
|
2116
|
+
envelope: z11.strictObject({
|
|
2117
|
+
pluginId: PluginId2,
|
|
2118
|
+
sourceId: LocalContributionId2
|
|
2119
|
+
})
|
|
2120
|
+
}),
|
|
2121
|
+
z11.strictObject({
|
|
2122
|
+
target: z11.literal("kay.app"),
|
|
2123
|
+
slug: z11.literal("app-data.register"),
|
|
2064
2124
|
/** The declared `contributes.dataSources` localId. */
|
|
2065
|
-
envelope:
|
|
2125
|
+
envelope: z11.strictObject({ source: NonEmptyString3 })
|
|
2066
2126
|
}),
|
|
2067
|
-
|
|
2068
|
-
target:
|
|
2069
|
-
slug:
|
|
2070
|
-
envelope:
|
|
2127
|
+
z11.strictObject({
|
|
2128
|
+
target: z11.literal("kay.agent"),
|
|
2129
|
+
slug: z11.literal("session-artifacts.read"),
|
|
2130
|
+
envelope: z11.strictObject({ kind: z11.enum(["upload", "output"]) })
|
|
2071
2131
|
}),
|
|
2072
|
-
|
|
2073
|
-
target:
|
|
2074
|
-
slug:
|
|
2075
|
-
envelope:
|
|
2132
|
+
z11.strictObject({
|
|
2133
|
+
target: z11.literal("kay.agent"),
|
|
2134
|
+
slug: z11.literal("session-artifacts.create"),
|
|
2135
|
+
envelope: z11.strictObject({ kind: z11.literal("output") })
|
|
2076
2136
|
}),
|
|
2077
|
-
|
|
2078
|
-
target:
|
|
2079
|
-
slug:
|
|
2080
|
-
envelope:
|
|
2137
|
+
z11.strictObject({
|
|
2138
|
+
target: z11.literal("kay.app"),
|
|
2139
|
+
slug: z11.literal("artifacts.read"),
|
|
2140
|
+
envelope: z11.strictObject({ kind: z11.literal("output") })
|
|
2081
2141
|
}),
|
|
2082
|
-
|
|
2083
|
-
target:
|
|
2084
|
-
slug:
|
|
2085
|
-
envelope:
|
|
2142
|
+
z11.strictObject({
|
|
2143
|
+
target: z11.literal("kay.app"),
|
|
2144
|
+
slug: z11.literal("knowledge-source.register"),
|
|
2145
|
+
envelope: z11.strictObject({ source: NonEmptyString3 })
|
|
2086
2146
|
}),
|
|
2087
|
-
|
|
2088
|
-
target:
|
|
2089
|
-
slug:
|
|
2090
|
-
envelope:
|
|
2147
|
+
z11.strictObject({
|
|
2148
|
+
target: z11.literal("kay.app"),
|
|
2149
|
+
slug: z11.literal("account.assert"),
|
|
2150
|
+
envelope: z11.strictObject({})
|
|
2091
2151
|
}),
|
|
2092
|
-
|
|
2093
|
-
target:
|
|
2094
|
-
slug:
|
|
2095
|
-
envelope:
|
|
2152
|
+
z11.strictObject({
|
|
2153
|
+
target: z11.literal("kay.app"),
|
|
2154
|
+
slug: z11.literal("account.update"),
|
|
2155
|
+
envelope: z11.strictObject({})
|
|
2096
2156
|
}),
|
|
2097
|
-
|
|
2098
|
-
target:
|
|
2099
|
-
slug:
|
|
2100
|
-
envelope:
|
|
2157
|
+
z11.strictObject({
|
|
2158
|
+
target: z11.literal("kay.app"),
|
|
2159
|
+
slug: z11.literal("agents.permissions"),
|
|
2160
|
+
envelope: z11.strictObject({
|
|
2101
2161
|
/** The definition's local id - WHICH agent these rules are authored onto. */
|
|
2102
2162
|
agent: NonEmptyString3,
|
|
2103
2163
|
/** `definition.permissions`, in declaration order (order is semantic; first match wins). */
|
|
2104
|
-
rules:
|
|
2164
|
+
rules: z11.array(PluginAgentDefinitionPermissionRule2),
|
|
2105
2165
|
/** `definition.permissionsFallback`, in declaration order. */
|
|
2106
|
-
fallback:
|
|
2166
|
+
fallback: z11.array(PluginAgentDefinitionPermissionRule2)
|
|
2107
2167
|
})
|
|
2108
2168
|
}),
|
|
2109
|
-
|
|
2110
|
-
target:
|
|
2111
|
-
slug:
|
|
2112
|
-
envelope:
|
|
2169
|
+
z11.strictObject({
|
|
2170
|
+
target: z11.literal("kay.agent"),
|
|
2171
|
+
slug: z11.literal("tool-interception.register"),
|
|
2172
|
+
envelope: z11.strictObject({})
|
|
2113
2173
|
}),
|
|
2114
|
-
|
|
2115
|
-
target:
|
|
2116
|
-
slug:
|
|
2174
|
+
z11.strictObject({
|
|
2175
|
+
target: z11.literal("kay.agent"),
|
|
2176
|
+
slug: z11.literal("interaction.surface"),
|
|
2117
2177
|
/** The one Bonsai-shipped interaction surface this plugin may drive; one claim per surface. */
|
|
2118
|
-
envelope:
|
|
2119
|
-
surface:
|
|
2178
|
+
envelope: z11.strictObject({
|
|
2179
|
+
surface: z11.enum(["browser-pane", "desktop"])
|
|
2120
2180
|
})
|
|
2121
2181
|
}),
|
|
2122
|
-
|
|
2123
|
-
target:
|
|
2124
|
-
slug:
|
|
2182
|
+
z11.strictObject({
|
|
2183
|
+
target: z11.literal("plugin"),
|
|
2184
|
+
slug: z11.literal("config.declare-section"),
|
|
2125
2185
|
/** The settings-document section key, e.g. `models` or `plugins.com.acme.thing`. */
|
|
2126
|
-
envelope:
|
|
2186
|
+
envelope: z11.strictObject({ section: NonEmptyString3 })
|
|
2127
2187
|
}),
|
|
2128
|
-
|
|
2129
|
-
target:
|
|
2130
|
-
slug:
|
|
2188
|
+
z11.strictObject({
|
|
2189
|
+
target: z11.literal("plugin"),
|
|
2190
|
+
slug: z11.literal("auth.own-service"),
|
|
2131
2191
|
/** The minted global service id this plugin would own, e.g. `google.account`. */
|
|
2132
|
-
envelope:
|
|
2192
|
+
envelope: z11.strictObject({ service: NonEmptyString3 })
|
|
2133
2193
|
}),
|
|
2134
|
-
|
|
2135
|
-
target:
|
|
2136
|
-
slug:
|
|
2194
|
+
z11.strictObject({
|
|
2195
|
+
target: z11.literal("plugin"),
|
|
2196
|
+
slug: z11.literal("auth.shared-identity"),
|
|
2137
2197
|
/** The foreign global service id whose identity this plugin would resolve against. */
|
|
2138
|
-
envelope:
|
|
2198
|
+
envelope: z11.strictObject({ service: NonEmptyString3 })
|
|
2139
2199
|
}),
|
|
2140
|
-
|
|
2141
|
-
target:
|
|
2142
|
-
slug:
|
|
2200
|
+
z11.strictObject({
|
|
2201
|
+
target: z11.literal("plugin"),
|
|
2202
|
+
slug: z11.literal("cli.bind"),
|
|
2143
2203
|
/** The binary basename a resolved credential would be injected into. */
|
|
2144
|
-
envelope:
|
|
2204
|
+
envelope: z11.strictObject({ binary: NonEmptyString3 })
|
|
2145
2205
|
}),
|
|
2146
|
-
|
|
2147
|
-
target:
|
|
2148
|
-
slug:
|
|
2206
|
+
z11.strictObject({
|
|
2207
|
+
target: z11.literal("plugin"),
|
|
2208
|
+
slug: z11.literal("mcp.host-server"),
|
|
2149
2209
|
// The daemon dials this endpoint, holds its sign-in, and serves it as `mcp://<name>`, so the
|
|
2150
2210
|
// endpoint becomes daemon execution authority. It also lets the plugin's own code call any of
|
|
2151
2211
|
// the server's tools, writes included, through `api.vendoredMcp`, which the per-tool
|
|
2152
2212
|
// `mcp:<server>::<tool>` permission rows do not gate. One claim per exact name and URL.
|
|
2153
|
-
envelope:
|
|
2213
|
+
envelope: z11.strictObject({ name: NonEmptyString3, url: NonEmptyString3 })
|
|
2154
2214
|
}),
|
|
2155
|
-
|
|
2156
|
-
target:
|
|
2157
|
-
slug:
|
|
2215
|
+
z11.strictObject({
|
|
2216
|
+
target: z11.literal("plugin"),
|
|
2217
|
+
slug: z11.literal("prompt.resident"),
|
|
2158
2218
|
// A section of the plugin's own text in every session's system prompt. An empty envelope
|
|
2159
2219
|
// because the grant itself is the decision; the host caps the section's length.
|
|
2160
|
-
envelope:
|
|
2220
|
+
envelope: z11.strictObject({})
|
|
2161
2221
|
}),
|
|
2162
|
-
|
|
2222
|
+
z11.strictObject({
|
|
2163
2223
|
// Private API: registering the policy the daemon consults to pick a chat's model as it goes
|
|
2164
2224
|
// (`app.modelSelection.registerPolicy`). Only a plugin the release carries holds it.
|
|
2165
|
-
target:
|
|
2166
|
-
slug:
|
|
2167
|
-
envelope:
|
|
2225
|
+
target: z11.literal("kay.app"),
|
|
2226
|
+
slug: z11.literal("model-selection.register"),
|
|
2227
|
+
envelope: z11.strictObject({})
|
|
2168
2228
|
}),
|
|
2169
|
-
|
|
2229
|
+
z11.strictObject({
|
|
2170
2230
|
// Private API: adding text to every chat's system prompt (`app.systemPrompt.register`).
|
|
2171
2231
|
// Only a plugin the release carries holds it, so the text has no length cap yet.
|
|
2172
|
-
target:
|
|
2173
|
-
slug:
|
|
2174
|
-
envelope:
|
|
2232
|
+
target: z11.literal("kay.app"),
|
|
2233
|
+
slug: z11.literal("system-prompt.register"),
|
|
2234
|
+
envelope: z11.strictObject({})
|
|
2175
2235
|
}),
|
|
2176
|
-
|
|
2177
|
-
target:
|
|
2178
|
-
slug:
|
|
2236
|
+
z11.strictObject({
|
|
2237
|
+
target: z11.literal("plugin"),
|
|
2238
|
+
slug: z11.literal("skills.declared-source"),
|
|
2179
2239
|
envelope: DeclaredSkillSourceEnvelope2
|
|
2180
2240
|
}),
|
|
2181
2241
|
WhiteboardCapabilityClaimV12
|
|
2182
2242
|
]);
|
|
2183
|
-
const PluginCapabilityRefusalLayer2 =
|
|
2184
|
-
const PluginCapabilityRefusalCode2 =
|
|
2243
|
+
const PluginCapabilityRefusalLayer2 = z11.enum(["grant", "binding", "release"]);
|
|
2244
|
+
const PluginCapabilityRefusalCode2 = z11.enum([
|
|
2185
2245
|
"not-granted",
|
|
2186
2246
|
"grant-read-failed",
|
|
2187
2247
|
"binding-missing",
|
|
2188
2248
|
"argv-outside-class",
|
|
2189
2249
|
"builtin-only"
|
|
2190
2250
|
]);
|
|
2191
|
-
const PluginCapabilityRefusalV12 =
|
|
2251
|
+
const PluginCapabilityRefusalV12 = z11.strictObject({
|
|
2192
2252
|
claim: PluginCapabilityClaimV12,
|
|
2193
2253
|
layer: PluginCapabilityRefusalLayer2,
|
|
2194
2254
|
code: PluginCapabilityRefusalCode2,
|
|
2195
2255
|
message: NonEmptyString3,
|
|
2196
2256
|
artifactGenerationId: ArtifactGenerationId2.optional()
|
|
2197
2257
|
});
|
|
2198
|
-
const PluginCapabilityDecisionV12 =
|
|
2199
|
-
|
|
2200
|
-
kind:
|
|
2258
|
+
const PluginCapabilityDecisionV12 = z11.discriminatedUnion("kind", [
|
|
2259
|
+
z11.strictObject({
|
|
2260
|
+
kind: z11.literal("allowed"),
|
|
2201
2261
|
claim: PluginCapabilityClaimV12,
|
|
2202
2262
|
artifactGenerationId: ArtifactGenerationId2.optional()
|
|
2203
2263
|
}),
|
|
2204
|
-
|
|
2205
|
-
kind:
|
|
2264
|
+
z11.strictObject({
|
|
2265
|
+
kind: z11.literal("refused"),
|
|
2206
2266
|
refusal: PluginCapabilityRefusalV12
|
|
2207
2267
|
})
|
|
2208
2268
|
]);
|
|
@@ -2220,7 +2280,7 @@ function createAuthoritySchemas(canonical) {
|
|
|
2220
2280
|
}
|
|
2221
2281
|
var { WhiteboardCapabilityScope, WhiteboardCapabilityOperation, WhiteboardCapabilityClaimV1, DeclaredSkillSourceEnvelope, PluginCapabilityClaimV1, PluginCapabilityRefusalLayer, PluginCapabilityRefusalCode, PluginCapabilityRefusalV1, PluginCapabilityDecisionV1 } = createAuthoritySchemas(false);
|
|
2222
2282
|
var canonicalAuthoritySchemas = createAuthoritySchemas(true);
|
|
2223
|
-
var PluginCapabilityClaimInputV1 =
|
|
2283
|
+
var PluginCapabilityClaimInputV1 = z11.custom((value) => PluginCapabilityClaimV1.safeParse(value).success, "Invalid capability claim");
|
|
2224
2284
|
function normalizeNetworkConnectHost(value) {
|
|
2225
2285
|
const trimmed = value.trim();
|
|
2226
2286
|
if (trimmed.length === 0)
|
|
@@ -2311,6 +2371,8 @@ function sameClaim(a, b) {
|
|
|
2311
2371
|
return b.slug === a.slug && a.envelope.kind === b.envelope.kind;
|
|
2312
2372
|
case "knowledge-source.register":
|
|
2313
2373
|
return b.slug === "knowledge-source.register" && a.envelope.source === b.envelope.source;
|
|
2374
|
+
case "app-data.read":
|
|
2375
|
+
return b.slug === "app-data.read" && a.envelope.pluginId === b.envelope.pluginId && a.envelope.sourceId === b.envelope.sourceId;
|
|
2314
2376
|
case "app-data.register":
|
|
2315
2377
|
return b.slug === "app-data.register" && a.envelope.source === b.envelope.source;
|
|
2316
2378
|
case "agents.permissions":
|
|
@@ -2412,6 +2474,11 @@ function envelopePairs(a, b) {
|
|
|
2412
2474
|
return b.slug === a.slug ? [[a.envelope.kind, b.envelope.kind]] : [];
|
|
2413
2475
|
case "knowledge-source.register":
|
|
2414
2476
|
return b.slug === "knowledge-source.register" ? [[a.envelope.source, b.envelope.source]] : [];
|
|
2477
|
+
case "app-data.read":
|
|
2478
|
+
return b.slug === "app-data.read" ? [
|
|
2479
|
+
[a.envelope.pluginId, b.envelope.pluginId],
|
|
2480
|
+
[a.envelope.sourceId, b.envelope.sourceId]
|
|
2481
|
+
] : [];
|
|
2415
2482
|
case "app-data.register":
|
|
2416
2483
|
return b.slug === "app-data.register" ? [[a.envelope.source, b.envelope.source]] : [];
|
|
2417
2484
|
case "agents.permissions":
|
|
@@ -2814,6 +2881,7 @@ __export(contributions_exports, {
|
|
|
2814
2881
|
ToolContribution: () => ToolContribution,
|
|
2815
2882
|
ToolPermission: () => ToolPermission,
|
|
2816
2883
|
UiAppCapabilities: () => UiAppCapabilities,
|
|
2884
|
+
UiAppCapabilityReference: () => UiAppCapabilityReference,
|
|
2817
2885
|
UiAppContribution: () => UiAppContribution,
|
|
2818
2886
|
UiCommandContribution: () => UiCommandContribution,
|
|
2819
2887
|
UiEventSubscriptionContribution: () => UiEventSubscriptionContribution,
|
|
@@ -2830,7 +2898,7 @@ __export(contributions_exports, {
|
|
|
2830
2898
|
isUiAppSourceModule: () => isUiAppSourceModule,
|
|
2831
2899
|
uiAppSourceStylePath: () => uiAppSourceStylePath
|
|
2832
2900
|
});
|
|
2833
|
-
import { z as
|
|
2901
|
+
import { z as z13 } from "zod";
|
|
2834
2902
|
|
|
2835
2903
|
// packages/plugin-protocol/dist/plugin-events.js
|
|
2836
2904
|
var plugin_events_exports = {};
|
|
@@ -2857,7 +2925,7 @@ __export(plugin_events_exports, {
|
|
|
2857
2925
|
canonicalPluginEventSchemas: () => canonicalPluginEventSchemas,
|
|
2858
2926
|
pluginSignalPayloadJsonSchema: () => pluginSignalPayloadJsonSchema
|
|
2859
2927
|
});
|
|
2860
|
-
import { z as
|
|
2928
|
+
import { z as z12 } from "zod";
|
|
2861
2929
|
|
|
2862
2930
|
// packages/plugin-protocol/dist/plugin-signal-limits.js
|
|
2863
2931
|
var PLUGIN_EVENT_REFUSED_ERROR_NAME = "PluginEventRefusedError";
|
|
@@ -2883,8 +2951,8 @@ var PLUGIN_SIGNAL_RELATED_KEYS = [
|
|
|
2883
2951
|
var PLUGIN_EVENT_ID_MAX_BYTES = 1024;
|
|
2884
2952
|
function createPluginEventsSchemas(canonical) {
|
|
2885
2953
|
const { GlobalContributionId: GlobalContributionId2, NonEmptyString: NonEmptyString3 } = canonical ? canonicalCommonSchemas : common_exports;
|
|
2886
|
-
const PluginEventLocalId2 =
|
|
2887
|
-
const PluginEventUri2 =
|
|
2954
|
+
const PluginEventLocalId2 = z12.string().regex(/^[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)*$/);
|
|
2955
|
+
const PluginEventUri2 = z12.string().refine((value) => {
|
|
2888
2956
|
if (!/^[a-z][a-z0-9+.-]*:/i.test(value) || /[\s\p{Cc}\\<>"{}|^`]/u.test(value) || /%(?![a-f0-9]{2})/i.test(value))
|
|
2889
2957
|
return false;
|
|
2890
2958
|
try {
|
|
@@ -2893,24 +2961,24 @@ function createPluginEventsSchemas(canonical) {
|
|
|
2893
2961
|
return false;
|
|
2894
2962
|
}
|
|
2895
2963
|
}, { message: "Expected an absolute resource URI" });
|
|
2896
|
-
const PluginEventTimestamp2 =
|
|
2964
|
+
const PluginEventTimestamp2 = z12.iso.datetime().refine((value) => !/\.\d{10}/.test(value), {
|
|
2897
2965
|
message: "Expected an ISO instant with at most nanosecond precision"
|
|
2898
2966
|
});
|
|
2899
|
-
const PluginEventRelated2 =
|
|
2900
|
-
const PluginEventPublishSource2 =
|
|
2967
|
+
const PluginEventRelated2 = z12.record(NonEmptyString3, z12.union([PluginEventUri2, z12.array(PluginEventUri2)]));
|
|
2968
|
+
const PluginEventPublishSource2 = z12.strictObject({
|
|
2901
2969
|
poller: NonEmptyString3.optional(),
|
|
2902
2970
|
runId: NonEmptyString3.optional()
|
|
2903
2971
|
});
|
|
2904
|
-
const PluginEventSource2 =
|
|
2905
|
-
layer:
|
|
2972
|
+
const PluginEventSource2 = z12.strictObject({
|
|
2973
|
+
layer: z12.literal("runtime"),
|
|
2906
2974
|
pluginId: NonEmptyString3,
|
|
2907
2975
|
sessionId: NonEmptyString3.optional(),
|
|
2908
2976
|
...PluginEventPublishSource2.shape
|
|
2909
2977
|
});
|
|
2910
|
-
const PluginEventId2 =
|
|
2978
|
+
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, {
|
|
2911
2979
|
message: "Event identity must be control-free, unpadded, and at most 1024 UTF-8 bytes"
|
|
2912
2980
|
});
|
|
2913
|
-
const PluginEventPublishInput2 =
|
|
2981
|
+
const PluginEventPublishInput2 = z12.strictObject({
|
|
2914
2982
|
uri: PluginEventUri2,
|
|
2915
2983
|
related: PluginEventRelated2.optional(),
|
|
2916
2984
|
key: PluginEventId2.optional(),
|
|
@@ -2918,11 +2986,11 @@ function createPluginEventsSchemas(canonical) {
|
|
|
2918
2986
|
source: PluginEventPublishSource2.optional(),
|
|
2919
2987
|
payload: JsonValue.optional()
|
|
2920
2988
|
});
|
|
2921
|
-
const PluginEventEnvelope2 =
|
|
2989
|
+
const PluginEventEnvelope2 = z12.strictObject({
|
|
2922
2990
|
id: PluginEventId2,
|
|
2923
2991
|
localId: PluginEventLocalId2,
|
|
2924
2992
|
type: GlobalContributionId2,
|
|
2925
|
-
version:
|
|
2993
|
+
version: z12.number().int().positive(),
|
|
2926
2994
|
uri: PluginEventUri2,
|
|
2927
2995
|
related: PluginEventRelated2.optional(),
|
|
2928
2996
|
key: PluginEventPublishInput2.shape.key,
|
|
@@ -2931,30 +2999,30 @@ function createPluginEventsSchemas(canonical) {
|
|
|
2931
2999
|
source: PluginEventSource2,
|
|
2932
3000
|
payload: JsonValue.optional()
|
|
2933
3001
|
});
|
|
2934
|
-
const PluginSignal2 =
|
|
2935
|
-
kind:
|
|
2936
|
-
direction:
|
|
2937
|
-
title:
|
|
2938
|
-
snippet:
|
|
2939
|
-
actor:
|
|
2940
|
-
name:
|
|
3002
|
+
const PluginSignal2 = z12.strictObject({
|
|
3003
|
+
kind: z12.enum(PLUGIN_SIGNAL_KINDS),
|
|
3004
|
+
direction: z12.enum(["in", "out"]).optional(),
|
|
3005
|
+
title: z12.string().max(PLUGIN_SIGNAL_TITLE_MAX).optional(),
|
|
3006
|
+
snippet: z12.string().max(PLUGIN_SIGNAL_SNIPPET_MAX).optional(),
|
|
3007
|
+
actor: z12.strictObject({
|
|
3008
|
+
name: z12.string().max(PLUGIN_SIGNAL_TITLE_MAX).optional(),
|
|
2941
3009
|
uri: PluginEventUri2
|
|
2942
3010
|
}).optional(),
|
|
2943
|
-
addressed:
|
|
2944
|
-
labels:
|
|
3011
|
+
addressed: z12.enum(["direct", "cc", "mention", "group", "none"]).optional(),
|
|
3012
|
+
labels: z12.array(z12.string().min(1).max(PLUGIN_SIGNAL_LABEL_MAX)).max(PLUGIN_SIGNAL_LABELS_MAX).optional(),
|
|
2945
3013
|
dueAt: PluginEventTimestamp2.optional(),
|
|
2946
|
-
state:
|
|
3014
|
+
state: z12.enum(["open", "resolved"]).optional()
|
|
2947
3015
|
}).refine((signal) => signal.state === void 0 || signal.kind === "status", {
|
|
2948
3016
|
message: "state is only for a status signal",
|
|
2949
3017
|
path: ["state"]
|
|
2950
3018
|
});
|
|
2951
|
-
const PluginSignalRelatedValue =
|
|
3019
|
+
const PluginSignalRelatedValue = z12.union([
|
|
2952
3020
|
PluginEventUri2,
|
|
2953
|
-
|
|
3021
|
+
z12.array(PluginEventUri2)
|
|
2954
3022
|
]);
|
|
2955
|
-
const PluginSignalPublish2 =
|
|
3023
|
+
const PluginSignalPublish2 = z12.object({
|
|
2956
3024
|
payload: PluginSignal2,
|
|
2957
|
-
related:
|
|
3025
|
+
related: z12.strictObject({
|
|
2958
3026
|
thread: PluginEventUri2,
|
|
2959
3027
|
from: PluginSignalRelatedValue.optional(),
|
|
2960
3028
|
to: PluginSignalRelatedValue.optional(),
|
|
@@ -2978,7 +3046,7 @@ function createPluginEventsSchemas(canonical) {
|
|
|
2978
3046
|
var { PluginSignal, PluginSignalPublish, PluginEventLocalId, PluginEventUri, PluginEventTimestamp, PluginEventRelated, PluginEventPublishSource, PluginEventSource, PluginEventId, PluginEventPublishInput, PluginEventEnvelope } = createPluginEventsSchemas(false);
|
|
2979
3047
|
var canonicalPluginEventSchemas = createPluginEventsSchemas(true);
|
|
2980
3048
|
function pluginSignalPayloadJsonSchema() {
|
|
2981
|
-
return
|
|
3049
|
+
return z12.toJSONSchema(PluginSignal, {
|
|
2982
3050
|
io: "input",
|
|
2983
3051
|
unrepresentable: "any"
|
|
2984
3052
|
});
|
|
@@ -3333,22 +3401,22 @@ function createContributionsSchemas(canonical) {
|
|
|
3333
3401
|
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;
|
|
3334
3402
|
const { ScopeRequirement: ScopeRequirement2 } = canonical ? canonicalPermissionSchemas : permissions_exports;
|
|
3335
3403
|
const OptionalDisplayName = NonEmptyString3.optional();
|
|
3336
|
-
const ApprovalCardValueName =
|
|
3337
|
-
const ApprovalCardForm2 =
|
|
3404
|
+
const ApprovalCardValueName = z13.string().regex(/^[A-Za-z][A-Za-z0-9_]{0,63}$/u, "must be a plain field name");
|
|
3405
|
+
const ApprovalCardForm2 = z13.strictObject({
|
|
3338
3406
|
/** Where the write goes: a fixed address, or the card value that names one. */
|
|
3339
|
-
uri:
|
|
3340
|
-
|
|
3341
|
-
|
|
3407
|
+
uri: z13.union([
|
|
3408
|
+
z13.strictObject({ fixed: NonEmptyString3 }),
|
|
3409
|
+
z13.strictObject({ value: ApprovalCardValueName })
|
|
3342
3410
|
]),
|
|
3343
3411
|
/** The delivery request fields this kind of card accepts, beyond provider and account. */
|
|
3344
|
-
requestFields:
|
|
3412
|
+
requestFields: z13.array(ApprovalCardValueName).optional(),
|
|
3345
3413
|
/** Payload field to the card value it is filled from. An absent value or empty list is left out. */
|
|
3346
|
-
payload:
|
|
3414
|
+
payload: z13.record(ApprovalCardValueName, ApprovalCardValueName),
|
|
3347
3415
|
/** Payload fields with a constant value. */
|
|
3348
|
-
fixed:
|
|
3416
|
+
fixed: z13.record(ApprovalCardValueName, z13.union([z13.string(), z13.boolean()])).optional()
|
|
3349
3417
|
});
|
|
3350
3418
|
const ApprovalCardStoredForm2 = ApprovalCardForm2.extend({
|
|
3351
|
-
read:
|
|
3419
|
+
read: z13.strictObject({
|
|
3352
3420
|
revision: ApprovalCardValueName,
|
|
3353
3421
|
body: ApprovalCardValueName,
|
|
3354
3422
|
subject: ApprovalCardValueName.optional(),
|
|
@@ -3359,13 +3427,13 @@ function createContributionsSchemas(canonical) {
|
|
|
3359
3427
|
attachments: ApprovalCardValueName.optional()
|
|
3360
3428
|
})
|
|
3361
3429
|
});
|
|
3362
|
-
const ApprovalCardField =
|
|
3430
|
+
const ApprovalCardField = z13.strictObject({
|
|
3363
3431
|
key: ApprovalCardValueName,
|
|
3364
|
-
max:
|
|
3432
|
+
max: z13.number().int().positive()
|
|
3365
3433
|
});
|
|
3366
|
-
const ApprovalTypeContribution2 =
|
|
3434
|
+
const ApprovalTypeContribution2 = z13.strictObject({
|
|
3367
3435
|
localId: LocalContributionId2,
|
|
3368
|
-
kind:
|
|
3436
|
+
kind: z13.literal("message"),
|
|
3369
3437
|
/** The URI scheme of `uriModule` that cards of this type write to. */
|
|
3370
3438
|
provider: UriScheme2,
|
|
3371
3439
|
/** The local id of this plugin's URI module that handles the write. */
|
|
@@ -3373,82 +3441,82 @@ function createContributionsSchemas(canonical) {
|
|
|
3373
3441
|
/** Shown when a send's outcome cannot be confirmed: where the person checks. */
|
|
3374
3442
|
unknownMessage: NonEmptyString3,
|
|
3375
3443
|
/** The payload fields holding the text a person may edit. A `subject` makes this a mail type. */
|
|
3376
|
-
fields:
|
|
3444
|
+
fields: z13.strictObject({
|
|
3377
3445
|
body: ApprovalCardField,
|
|
3378
3446
|
subject: ApprovalCardField.optional()
|
|
3379
3447
|
}),
|
|
3380
|
-
presentation:
|
|
3381
|
-
showAccount:
|
|
3382
|
-
recipient:
|
|
3448
|
+
presentation: z13.strictObject({
|
|
3449
|
+
showAccount: z13.boolean(),
|
|
3450
|
+
recipient: z13.enum(["person", "target"])
|
|
3383
3451
|
}),
|
|
3384
3452
|
/** One form per kind of card this provider supports. A kind left out is never bound. */
|
|
3385
|
-
forms:
|
|
3453
|
+
forms: z13.strictObject({
|
|
3386
3454
|
inline: ApprovalCardForm2.optional(),
|
|
3387
3455
|
saved: ApprovalCardForm2.optional(),
|
|
3388
3456
|
stored: ApprovalCardStoredForm2.optional()
|
|
3389
3457
|
}),
|
|
3390
3458
|
/** What the card shows beyond its text, read from the delivery request. */
|
|
3391
|
-
display:
|
|
3459
|
+
display: z13.strictObject({
|
|
3392
3460
|
/** How the renderer reads the body. Absent is Markdown, or plain for a stored draft. */
|
|
3393
|
-
bodyFormat:
|
|
3461
|
+
bodyFormat: z13.literal("mrkdwn").optional(),
|
|
3394
3462
|
/** The request field naming what this card replies to. */
|
|
3395
3463
|
replyField: ApprovalCardValueName.optional(),
|
|
3396
3464
|
/** Shown instead of the reply's id when that id means nothing to a person. */
|
|
3397
3465
|
replyLabel: NonEmptyString3.optional(),
|
|
3398
3466
|
/** Further request fields shown as labelled lines. */
|
|
3399
|
-
facts:
|
|
3467
|
+
facts: z13.array(z13.strictObject({
|
|
3400
3468
|
label: NonEmptyString3,
|
|
3401
3469
|
field: ApprovalCardValueName
|
|
3402
3470
|
})).optional()
|
|
3403
3471
|
}).optional()
|
|
3404
3472
|
});
|
|
3405
|
-
const ToolIdentity =
|
|
3473
|
+
const ToolIdentity = z13.strictObject({
|
|
3406
3474
|
localId: LocalContributionId2,
|
|
3407
3475
|
toolName: PluginToolName2,
|
|
3408
3476
|
displayName: OptionalDisplayName,
|
|
3409
3477
|
description: NonEmptyString3.optional()
|
|
3410
3478
|
});
|
|
3411
|
-
const ToolPermission2 =
|
|
3412
|
-
kind:
|
|
3479
|
+
const ToolPermission2 = z13.strictObject({
|
|
3480
|
+
kind: z13.enum(["read", "mutate", "destructive", "execute"]),
|
|
3413
3481
|
ruleKey: NonEmptyString3.optional(),
|
|
3414
3482
|
scheme: NonEmptyString3.optional(),
|
|
3415
|
-
resourcePrefix:
|
|
3483
|
+
resourcePrefix: z13.string().max(256).optional(),
|
|
3416
3484
|
// Arguments whose string values name the resources a call touches.
|
|
3417
|
-
resourceArgs:
|
|
3418
|
-
resourceTrim:
|
|
3419
|
-
defaultPermission:
|
|
3485
|
+
resourceArgs: z13.array(NonEmptyString3).min(1).optional(),
|
|
3486
|
+
resourceTrim: z13.literal(true).optional(),
|
|
3487
|
+
defaultPermission: z13.enum(["allow", "ask", "never"]).optional(),
|
|
3420
3488
|
/** First matching rule wins; every condition in its when list must hold. */
|
|
3421
|
-
classificationRules:
|
|
3422
|
-
when:
|
|
3423
|
-
|
|
3489
|
+
classificationRules: z13.array(z13.strictObject({
|
|
3490
|
+
when: z13.array(z13.union([
|
|
3491
|
+
z13.strictObject({
|
|
3424
3492
|
arg: NonEmptyString3,
|
|
3425
|
-
equals:
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3493
|
+
equals: z13.union([
|
|
3494
|
+
z13.string(),
|
|
3495
|
+
z13.number(),
|
|
3496
|
+
z13.boolean(),
|
|
3497
|
+
z13.null()
|
|
3430
3498
|
])
|
|
3431
3499
|
}),
|
|
3432
|
-
|
|
3500
|
+
z13.strictObject({ arg: NonEmptyString3, present: z13.boolean() })
|
|
3433
3501
|
])).min(1).max(32),
|
|
3434
|
-
kind:
|
|
3502
|
+
kind: z13.enum(["read", "mutate", "destructive", "execute"]),
|
|
3435
3503
|
ruleKey: NonEmptyString3.optional()
|
|
3436
3504
|
})).min(1).max(64).optional()
|
|
3437
3505
|
});
|
|
3438
|
-
const ToolContribution2 =
|
|
3506
|
+
const ToolContribution2 = z13.strictObject({
|
|
3439
3507
|
...ToolIdentity.shape,
|
|
3440
3508
|
parameters: JsonSchema.optional(),
|
|
3441
|
-
executionMode:
|
|
3509
|
+
executionMode: z13.enum(["sequential", "parallel"]).optional(),
|
|
3442
3510
|
promptSnippet: NonEmptyString3.optional(),
|
|
3443
|
-
promptGuidelines:
|
|
3511
|
+
promptGuidelines: z13.array(NonEmptyString3).optional(),
|
|
3444
3512
|
permission: ToolPermission2.optional()
|
|
3445
3513
|
});
|
|
3446
|
-
const AgentToolContribution2 =
|
|
3514
|
+
const AgentToolContribution2 = z13.strictObject({
|
|
3447
3515
|
...ToolContribution2.shape,
|
|
3448
3516
|
parameters: JsonSchema.optional(),
|
|
3449
|
-
executionMode:
|
|
3517
|
+
executionMode: z13.enum(["sequential", "parallel"]).optional(),
|
|
3450
3518
|
promptSnippet: NonEmptyString3.optional(),
|
|
3451
|
-
promptGuidelines:
|
|
3519
|
+
promptGuidelines: z13.array(NonEmptyString3).optional(),
|
|
3452
3520
|
// A local ref names an auth service declared in this manifest; a dotted ref names another
|
|
3453
3521
|
// plugin's service, as `UriModuleContribution.authService` does.
|
|
3454
3522
|
authService: AuthServiceReference2.optional(),
|
|
@@ -3456,17 +3524,17 @@ function createContributionsSchemas(canonical) {
|
|
|
3456
3524
|
authScheme: LocalContributionId2.optional(),
|
|
3457
3525
|
permission: ToolPermission2.optional()
|
|
3458
3526
|
});
|
|
3459
|
-
const ConverterContribution2 =
|
|
3527
|
+
const ConverterContribution2 = z13.strictObject({
|
|
3460
3528
|
localId: LocalContributionId2,
|
|
3461
3529
|
displayName: OptionalDisplayName,
|
|
3462
3530
|
description: NonEmptyString3.optional(),
|
|
3463
3531
|
/** MIME types this converter claims - contract data for introspection and
|
|
3464
3532
|
* collision checks; runtime match behavior stays the converter's `matches()`. */
|
|
3465
|
-
mimeTypes:
|
|
3533
|
+
mimeTypes: z13.array(MimeTypeString2).min(1),
|
|
3466
3534
|
/** Extension fallbacks (no dot) used when a probe has no usable MIME type. */
|
|
3467
|
-
extensions:
|
|
3535
|
+
extensions: z13.array(FileExtensionToken2).min(1).optional()
|
|
3468
3536
|
});
|
|
3469
|
-
const UriOperationName =
|
|
3537
|
+
const UriOperationName = z13.enum([
|
|
3470
3538
|
"help",
|
|
3471
3539
|
"read",
|
|
3472
3540
|
"write",
|
|
@@ -3475,8 +3543,8 @@ function createContributionsSchemas(canonical) {
|
|
|
3475
3543
|
"search",
|
|
3476
3544
|
"delete"
|
|
3477
3545
|
]);
|
|
3478
|
-
const UriPermissionDefault =
|
|
3479
|
-
const UriVerbSentences =
|
|
3546
|
+
const UriPermissionDefault = z13.enum(["allow", "ask", "never"]);
|
|
3547
|
+
const UriVerbSentences = z13.strictObject({
|
|
3480
3548
|
read: NonEmptyString3.exactOptional(),
|
|
3481
3549
|
list: NonEmptyString3.exactOptional(),
|
|
3482
3550
|
search: NonEmptyString3.exactOptional(),
|
|
@@ -3484,81 +3552,83 @@ function createContributionsSchemas(canonical) {
|
|
|
3484
3552
|
edit: NonEmptyString3.exactOptional(),
|
|
3485
3553
|
delete: NonEmptyString3.exactOptional()
|
|
3486
3554
|
});
|
|
3487
|
-
const UriPatternInit =
|
|
3555
|
+
const UriPatternInit = z13.strictObject({
|
|
3488
3556
|
protocol: NonEmptyString3.exactOptional(),
|
|
3489
3557
|
hostname: NonEmptyString3.exactOptional(),
|
|
3490
3558
|
pathname: NonEmptyString3.exactOptional(),
|
|
3491
|
-
search:
|
|
3559
|
+
search: z13.string().exactOptional()
|
|
3492
3560
|
});
|
|
3493
|
-
const UriClaimContribution =
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
kind:
|
|
3561
|
+
const UriClaimContribution = z13.discriminatedUnion("kind", [
|
|
3562
|
+
z13.strictObject({ kind: z13.literal("scheme"), scheme: UriScheme2 }),
|
|
3563
|
+
z13.strictObject({
|
|
3564
|
+
kind: z13.literal("uriPattern"),
|
|
3497
3565
|
pattern: UriPatternInit,
|
|
3498
3566
|
normalizeTo: NonEmptyString3.exactOptional(),
|
|
3499
3567
|
route: LocalContributionId2.exactOptional(),
|
|
3500
3568
|
sourceUrl: NonEmptyString3.exactOptional(),
|
|
3501
3569
|
title: NonEmptyString3.exactOptional(),
|
|
3502
|
-
examples:
|
|
3570
|
+
examples: z13.array(NonEmptyString3).exactOptional()
|
|
3503
3571
|
}),
|
|
3504
|
-
|
|
3505
|
-
kind:
|
|
3572
|
+
z13.strictObject({
|
|
3573
|
+
kind: z13.literal("urlPattern"),
|
|
3506
3574
|
pattern: UriPatternInit,
|
|
3507
3575
|
normalizeTo: NonEmptyString3.exactOptional(),
|
|
3508
3576
|
route: LocalContributionId2.exactOptional(),
|
|
3509
|
-
examples:
|
|
3577
|
+
examples: z13.array(NonEmptyString3).exactOptional()
|
|
3510
3578
|
})
|
|
3511
3579
|
]);
|
|
3512
|
-
const UriTemplateContribution =
|
|
3580
|
+
const UriTemplateContribution = z13.strictObject({
|
|
3513
3581
|
uri: NonEmptyString3,
|
|
3514
3582
|
description: NonEmptyString3,
|
|
3515
|
-
operations:
|
|
3516
|
-
operationDocs:
|
|
3517
|
-
operationDefaults:
|
|
3583
|
+
operations: z13.array(UriOperationName).exactOptional(),
|
|
3584
|
+
operationDocs: z13.partialRecord(UriOperationName, NonEmptyString3).exactOptional(),
|
|
3585
|
+
operationDefaults: z13.partialRecord(UriOperationName, UriPermissionDefault).exactOptional()
|
|
3518
3586
|
});
|
|
3519
3587
|
const UriAuthActionRuleConditions = {
|
|
3520
|
-
operations:
|
|
3521
|
-
routes:
|
|
3522
|
-
query:
|
|
3588
|
+
operations: z13.array(UriOperationName).min(1).exactOptional(),
|
|
3589
|
+
routes: z13.array(LocalContributionId2).min(1).exactOptional(),
|
|
3590
|
+
query: z13.record(NonEmptyString3, z13.string()).exactOptional()
|
|
3523
3591
|
};
|
|
3524
|
-
const UriAuthActionRule =
|
|
3525
|
-
|
|
3526
|
-
|
|
3592
|
+
const UriAuthActionRule = z13.union([
|
|
3593
|
+
z13.strictObject({ ...UriAuthActionRuleConditions, action: NonEmptyString3 }),
|
|
3594
|
+
z13.strictObject({ ...UriAuthActionRuleConditions, public: z13.literal(true) })
|
|
3527
3595
|
]);
|
|
3528
|
-
const UriAgentHintContribution =
|
|
3596
|
+
const UriAgentHintContribution = z13.strictObject({
|
|
3529
3597
|
summary: NonEmptyString3,
|
|
3530
|
-
commonFlows:
|
|
3598
|
+
commonFlows: z13.array(z13.strictObject({
|
|
3531
3599
|
label: NonEmptyString3,
|
|
3532
3600
|
when: NonEmptyString3.exactOptional(),
|
|
3533
3601
|
example: NonEmptyString3
|
|
3534
3602
|
})).exactOptional(),
|
|
3535
3603
|
helpUri: NonEmptyString3.exactOptional(),
|
|
3536
|
-
triggers:
|
|
3537
|
-
keywords:
|
|
3538
|
-
patterns:
|
|
3604
|
+
triggers: z13.strictObject({
|
|
3605
|
+
keywords: z13.array(NonEmptyString3).exactOptional(),
|
|
3606
|
+
patterns: z13.array(NonEmptyString3).exactOptional()
|
|
3539
3607
|
}).exactOptional(),
|
|
3540
|
-
skills:
|
|
3608
|
+
skills: z13.array(NonEmptyString3).exactOptional()
|
|
3541
3609
|
});
|
|
3542
|
-
const ScreenActionOption =
|
|
3543
|
-
|
|
3544
|
-
kind:
|
|
3610
|
+
const ScreenActionOption = z13.discriminatedUnion("kind", [
|
|
3611
|
+
z13.strictObject({
|
|
3612
|
+
kind: z13.literal("exact"),
|
|
3545
3613
|
description: NonEmptyString3,
|
|
3546
|
-
verb:
|
|
3614
|
+
verb: z13.enum(["read", "write", "edit", "delete"]),
|
|
3547
3615
|
uri: NonEmptyString3
|
|
3548
3616
|
}),
|
|
3549
|
-
|
|
3550
|
-
kind:
|
|
3617
|
+
z13.strictObject({
|
|
3618
|
+
kind: z13.literal("catch-all"),
|
|
3551
3619
|
description: NonEmptyString3,
|
|
3552
|
-
verb:
|
|
3620
|
+
verb: z13.enum(["read", "write", "edit", "delete"])
|
|
3553
3621
|
})
|
|
3554
3622
|
]);
|
|
3555
3623
|
const UriModuleFactsShape = {
|
|
3556
|
-
|
|
3624
|
+
revisionBacked: z13.literal(true).optional(),
|
|
3625
|
+
mailCalibrationSource: z13.literal(true).optional(),
|
|
3626
|
+
screenActions: z13.strictObject({
|
|
3557
3627
|
scheme: UriScheme2,
|
|
3558
|
-
hosts:
|
|
3559
|
-
paths:
|
|
3560
|
-
apps:
|
|
3561
|
-
options:
|
|
3628
|
+
hosts: z13.array(NonEmptyString3),
|
|
3629
|
+
paths: z13.array(NonEmptyString3).min(1).optional(),
|
|
3630
|
+
apps: z13.array(NonEmptyString3),
|
|
3631
|
+
options: z13.record(NonEmptyString3, ScreenActionOption)
|
|
3562
3632
|
}).superRefine((catalog, ctx) => {
|
|
3563
3633
|
if (catalog.hosts.length === 0 && catalog.apps.length === 0) {
|
|
3564
3634
|
ctx.addIssue({
|
|
@@ -3583,29 +3653,29 @@ function createContributionsSchemas(canonical) {
|
|
|
3583
3653
|
}
|
|
3584
3654
|
}).exactOptional(),
|
|
3585
3655
|
/** Addresses the module answers, in match order; see `@herd/uri`'s `UriClaim`. */
|
|
3586
|
-
claims:
|
|
3656
|
+
claims: z13.array(UriClaimContribution).min(1).exactOptional(),
|
|
3587
3657
|
/** The module's routes, as its scheme-root `help` lists them. */
|
|
3588
|
-
templates:
|
|
3589
|
-
verbs:
|
|
3590
|
-
readable:
|
|
3591
|
-
writable:
|
|
3592
|
-
editable:
|
|
3593
|
-
deletable:
|
|
3594
|
-
listable:
|
|
3658
|
+
templates: z13.array(UriTemplateContribution).exactOptional(),
|
|
3659
|
+
verbs: z13.strictObject({
|
|
3660
|
+
readable: z13.boolean(),
|
|
3661
|
+
writable: z13.boolean(),
|
|
3662
|
+
editable: z13.boolean(),
|
|
3663
|
+
deletable: z13.boolean().exactOptional(),
|
|
3664
|
+
listable: z13.boolean(),
|
|
3595
3665
|
/** The module answers `search`. */
|
|
3596
|
-
searchable:
|
|
3666
|
+
searchable: z13.boolean().exactOptional()
|
|
3597
3667
|
}).exactOptional(),
|
|
3598
3668
|
verbDocs: UriVerbSentences.exactOptional(),
|
|
3599
|
-
permissionDefaults:
|
|
3669
|
+
permissionDefaults: z13.strictObject({
|
|
3600
3670
|
read: UriPermissionDefault.exactOptional(),
|
|
3601
3671
|
write: UriPermissionDefault.exactOptional(),
|
|
3602
3672
|
edit: UriPermissionDefault.exactOptional(),
|
|
3603
3673
|
delete: UriPermissionDefault.exactOptional()
|
|
3604
3674
|
}).exactOptional(),
|
|
3605
3675
|
/** Which sign-in action each call needs: the action table and the rules that pick one. */
|
|
3606
|
-
authActions:
|
|
3607
|
-
actions:
|
|
3608
|
-
rules:
|
|
3676
|
+
authActions: z13.strictObject({
|
|
3677
|
+
actions: z13.record(NonEmptyString3, ScopeRequirement2),
|
|
3678
|
+
rules: z13.array(UriAuthActionRule).min(1)
|
|
3609
3679
|
}).superRefine((policy, ctx) => {
|
|
3610
3680
|
policy.rules.forEach((rule, index) => {
|
|
3611
3681
|
if ("action" in rule && !(rule.action in policy.actions)) {
|
|
@@ -3617,18 +3687,18 @@ function createContributionsSchemas(canonical) {
|
|
|
3617
3687
|
}
|
|
3618
3688
|
});
|
|
3619
3689
|
}).exactOptional(),
|
|
3620
|
-
requiresConnection:
|
|
3621
|
-
acceptsSourceCopy:
|
|
3622
|
-
acceptsWriteSources:
|
|
3623
|
-
acceptsBytes:
|
|
3624
|
-
ownsLineSelectors:
|
|
3690
|
+
requiresConnection: z13.literal(true).exactOptional(),
|
|
3691
|
+
acceptsSourceCopy: z13.literal(false).exactOptional(),
|
|
3692
|
+
acceptsWriteSources: z13.literal(true).exactOptional(),
|
|
3693
|
+
acceptsBytes: z13.literal(true).exactOptional(),
|
|
3694
|
+
ownsLineSelectors: z13.literal(true).exactOptional(),
|
|
3625
3695
|
description: NonEmptyString3.exactOptional(),
|
|
3626
3696
|
agentHint: UriAgentHintContribution.exactOptional()
|
|
3627
3697
|
};
|
|
3628
|
-
const UriModuleFacts2 =
|
|
3629
|
-
const UriModuleContribution2 =
|
|
3698
|
+
const UriModuleFacts2 = z13.strictObject(UriModuleFactsShape);
|
|
3699
|
+
const UriModuleContribution2 = z13.strictObject({
|
|
3630
3700
|
localId: LocalContributionId2,
|
|
3631
|
-
schemes:
|
|
3701
|
+
schemes: z13.array(UriScheme2).min(1),
|
|
3632
3702
|
displayName: OptionalDisplayName,
|
|
3633
3703
|
...UriModuleFactsShape,
|
|
3634
3704
|
// A local ref (no dot) must name an auth service declared in this same
|
|
@@ -3651,15 +3721,15 @@ function createContributionsSchemas(canonical) {
|
|
|
3651
3721
|
// `knownResources` permission grant (`api.knownResources`). Present-means-on
|
|
3652
3722
|
// (`true` or absent; `false` is not a state). Decision record:
|
|
3653
3723
|
// `lab/user-plugins/decisions/014-known-resources-ledger.md`.
|
|
3654
|
-
knownResources:
|
|
3724
|
+
knownResources: z13.literal(true).optional(),
|
|
3655
3725
|
// The module's code defines `describeOperation`, the approval card's facts for a call. The
|
|
3656
3726
|
// daemon reads it here because it may hold only the manifest (a plugin that runs in the
|
|
3657
3727
|
// plugin host), and the host refuses a module whose code disagrees.
|
|
3658
|
-
describesOperations:
|
|
3728
|
+
describesOperations: z13.literal(true).optional(),
|
|
3659
3729
|
// The module's code defines `lookupWebLink`, which finds a resource's page when someone opens
|
|
3660
3730
|
// it. The daemon reads it here for the same reason, and the host refuses a module whose code
|
|
3661
3731
|
// disagrees.
|
|
3662
|
-
looksUpWebLinks:
|
|
3732
|
+
looksUpWebLinks: z13.literal(true).optional()
|
|
3663
3733
|
});
|
|
3664
3734
|
const AppUriModuleContribution2 = UriModuleContribution2.omit({
|
|
3665
3735
|
authActions: true,
|
|
@@ -3669,30 +3739,30 @@ function createContributionsSchemas(canonical) {
|
|
|
3669
3739
|
describesOperations: true,
|
|
3670
3740
|
looksUpWebLinks: true
|
|
3671
3741
|
});
|
|
3672
|
-
const AppDataSourceStore =
|
|
3673
|
-
|
|
3674
|
-
shape:
|
|
3742
|
+
const AppDataSourceStore = z13.discriminatedUnion("shape", [
|
|
3743
|
+
z13.strictObject({
|
|
3744
|
+
shape: z13.literal("rows"),
|
|
3675
3745
|
rowsField: NonEmptyString3,
|
|
3676
|
-
key:
|
|
3746
|
+
key: z13.array(NonEmptyString3).min(1)
|
|
3677
3747
|
}),
|
|
3678
|
-
|
|
3748
|
+
z13.strictObject({ shape: z13.literal("value") })
|
|
3679
3749
|
]);
|
|
3680
|
-
const AppDataSourceContribution2 =
|
|
3750
|
+
const AppDataSourceContribution2 = z13.strictObject({
|
|
3681
3751
|
localId: LocalContributionId2,
|
|
3682
|
-
scope:
|
|
3683
|
-
snapshot:
|
|
3684
|
-
version:
|
|
3752
|
+
scope: z13.enum(["runtime", "account", "session"]),
|
|
3753
|
+
snapshot: z13.strictObject({
|
|
3754
|
+
version: z13.number().int().positive(),
|
|
3685
3755
|
schema: JsonSchema
|
|
3686
3756
|
}),
|
|
3687
|
-
change:
|
|
3688
|
-
version:
|
|
3757
|
+
change: z13.strictObject({
|
|
3758
|
+
version: z13.number().int().positive(),
|
|
3689
3759
|
schema: JsonSchema,
|
|
3690
3760
|
/** Review-only claim; source schemas and behavioral tests enforce it because the daemon treats changes as opaque. */
|
|
3691
|
-
semantics:
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
kind:
|
|
3695
|
-
maxEncodedBytes:
|
|
3761
|
+
semantics: z13.discriminatedUnion("kind", [
|
|
3762
|
+
z13.strictObject({ kind: z13.literal("incremental") }),
|
|
3763
|
+
z13.strictObject({
|
|
3764
|
+
kind: z13.literal("snapshot-replacement"),
|
|
3765
|
+
maxEncodedBytes: z13.number().int().positive(),
|
|
3696
3766
|
rationale: pluginString(canonical).min(1).max(1024)
|
|
3697
3767
|
})
|
|
3698
3768
|
]).optional()
|
|
@@ -3718,25 +3788,25 @@ function createContributionsSchemas(canonical) {
|
|
|
3718
3788
|
});
|
|
3719
3789
|
}
|
|
3720
3790
|
});
|
|
3721
|
-
const WhiteboardTypeStorage2 =
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
kind:
|
|
3791
|
+
const WhiteboardTypeStorage2 = z13.discriminatedUnion("kind", [
|
|
3792
|
+
z13.strictObject({ kind: z13.literal("json") }),
|
|
3793
|
+
z13.strictObject({ kind: z13.literal("payload") }),
|
|
3794
|
+
z13.strictObject({
|
|
3795
|
+
kind: z13.literal("markdown"),
|
|
3726
3796
|
bodyField: NonEmptyString3
|
|
3727
3797
|
})
|
|
3728
3798
|
]);
|
|
3729
|
-
const WhiteboardTypeContribution2 =
|
|
3799
|
+
const WhiteboardTypeContribution2 = z13.strictObject({
|
|
3730
3800
|
localId: LocalContributionId2,
|
|
3731
3801
|
displayName: NonEmptyString3,
|
|
3732
|
-
schemaVersion:
|
|
3802
|
+
schemaVersion: z13.number().int().positive(),
|
|
3733
3803
|
storage: WhiteboardTypeStorage2,
|
|
3734
3804
|
valueSchema: JsonSchema
|
|
3735
3805
|
});
|
|
3736
|
-
const AppDataMaterializerContribution2 =
|
|
3806
|
+
const AppDataMaterializerContribution2 = z13.strictObject({
|
|
3737
3807
|
source: LocalContributionId2
|
|
3738
3808
|
});
|
|
3739
|
-
const ArtifactUriModuleContribution2 =
|
|
3809
|
+
const ArtifactUriModuleContribution2 = z13.strictObject({
|
|
3740
3810
|
localId: LocalContributionId2,
|
|
3741
3811
|
/** The single `scheme://` this module owns; also the on-disk artifact kind. */
|
|
3742
3812
|
scheme: UriScheme2,
|
|
@@ -3750,17 +3820,17 @@ function createContributionsSchemas(canonical) {
|
|
|
3750
3820
|
* composes its description from the plugin's own display name + scheme - a per-scheme label
|
|
3751
3821
|
* would have no path to matter, so it is intentionally omitted rather than accepted-and-ignored.
|
|
3752
3822
|
*/
|
|
3753
|
-
editable:
|
|
3823
|
+
editable: z13.boolean().optional(),
|
|
3754
3824
|
/** Opt in to `list` over the kind's stored names. Default false. Mirrors
|
|
3755
3825
|
* `CreateArtifactUriModuleOptions.listable`. */
|
|
3756
|
-
listable:
|
|
3826
|
+
listable: z13.boolean().optional(),
|
|
3757
3827
|
/**
|
|
3758
3828
|
* Opt in to `delete` for same-session entries. Default false. Deletion
|
|
3759
3829
|
* unlinks the stored file - no trash tier; a kind that wants recoverable
|
|
3760
3830
|
* deletion is not artifact-backed. Mirrors
|
|
3761
3831
|
* `CreateArtifactUriModuleOptions.deletable`.
|
|
3762
3832
|
*/
|
|
3763
|
-
deletable:
|
|
3833
|
+
deletable: z13.boolean().optional(),
|
|
3764
3834
|
/**
|
|
3765
3835
|
* Opt in to the `{ content, mode: "append" }` write envelope, which extends
|
|
3766
3836
|
* stored text instead of replacing it (concurrent-appender-safe: the host
|
|
@@ -3768,7 +3838,7 @@ function createContributionsSchemas(canonical) {
|
|
|
3768
3838
|
* keep their verbatim round-trip. Mirrors
|
|
3769
3839
|
* `CreateArtifactUriModuleOptions.appendable`.
|
|
3770
3840
|
*/
|
|
3771
|
-
appendable:
|
|
3841
|
+
appendable: z13.boolean().optional(),
|
|
3772
3842
|
/**
|
|
3773
3843
|
* Which sessions share one storage namespace. Default `"session"` - the existing
|
|
3774
3844
|
* per-session behavior (each session gets its own kind directory; other sessions'
|
|
@@ -3779,14 +3849,14 @@ function createContributionsSchemas(canonical) {
|
|
|
3779
3849
|
* the scope; the host derives the family root from provenance it already holds, so
|
|
3780
3850
|
* family identity never crosses the SDK boundary.
|
|
3781
3851
|
*/
|
|
3782
|
-
storageScope:
|
|
3852
|
+
storageScope: z13.enum(["session", "family"]).optional()
|
|
3783
3853
|
});
|
|
3784
|
-
const CliBindingContribution2 =
|
|
3854
|
+
const CliBindingContribution2 = z13.strictObject({
|
|
3785
3855
|
localId: LocalContributionId2,
|
|
3786
3856
|
binary: CliBinaryName2,
|
|
3787
|
-
aliases:
|
|
3857
|
+
aliases: z13.array(CliBinaryName2).optional(),
|
|
3788
3858
|
/** Where the binary comes from. Omitted => `"vendored"` (decision 007). */
|
|
3789
|
-
provider:
|
|
3859
|
+
provider: z13.enum(["vendored", "path"]).optional(),
|
|
3790
3860
|
// A local ref (no dot) must name an auth service declared in this same
|
|
3791
3861
|
// manifest; a qualified ref (dotted, e.g. `google.account`) names another
|
|
3792
3862
|
// plugin's already-minted global id and is recorded, not resolved, here (see
|
|
@@ -3799,20 +3869,20 @@ function createContributionsSchemas(canonical) {
|
|
|
3799
3869
|
* MUST be absent for a `path` binding, which can never receive a token.
|
|
3800
3870
|
*/
|
|
3801
3871
|
authEnvVar: CliAuthEnvVarName2.optional(),
|
|
3802
|
-
readOnly:
|
|
3803
|
-
write:
|
|
3872
|
+
readOnly: z13.array(NonEmptyString3),
|
|
3873
|
+
write: z13.array(NonEmptyString3)
|
|
3804
3874
|
});
|
|
3805
|
-
const GitHostContribution2 =
|
|
3875
|
+
const GitHostContribution2 = z13.strictObject({
|
|
3806
3876
|
host: GitHostName2,
|
|
3807
3877
|
authService: LocalContributionId2,
|
|
3808
3878
|
basicAuthUser: GitBasicAuthUser2
|
|
3809
3879
|
});
|
|
3810
|
-
const ResourceContribution2 =
|
|
3880
|
+
const ResourceContribution2 = z13.strictObject({
|
|
3811
3881
|
localId: LocalContributionId2,
|
|
3812
3882
|
displayName: OptionalDisplayName,
|
|
3813
3883
|
description: NonEmptyString3.optional()
|
|
3814
3884
|
});
|
|
3815
|
-
const SkillContribution2 =
|
|
3885
|
+
const SkillContribution2 = z13.strictObject({
|
|
3816
3886
|
localId: LocalContributionId2,
|
|
3817
3887
|
displayName: OptionalDisplayName,
|
|
3818
3888
|
/** Model-visible one-liner: when to reach for this skill. */
|
|
@@ -3820,18 +3890,18 @@ function createContributionsSchemas(canonical) {
|
|
|
3820
3890
|
/** The SKILL.md-style file inside the package carrying the full instructions. */
|
|
3821
3891
|
path: PackageAssetPath2
|
|
3822
3892
|
});
|
|
3823
|
-
const PluginSkillSourceDeclaration2 =
|
|
3824
|
-
|
|
3825
|
-
channel:
|
|
3893
|
+
const PluginSkillSourceDeclaration2 = z13.discriminatedUnion("channel", [
|
|
3894
|
+
z13.strictObject({
|
|
3895
|
+
channel: z13.literal("installer"),
|
|
3826
3896
|
localId: LocalContributionId2,
|
|
3827
3897
|
displayName: OptionalDisplayName,
|
|
3828
3898
|
/** The package-runner executable, e.g. `npx` - checked against the daemon's allowlist. */
|
|
3829
3899
|
command: NonEmptyString3,
|
|
3830
3900
|
/** Its argv, e.g. `["skills", "add", "clerk/skills"]`. */
|
|
3831
|
-
args:
|
|
3901
|
+
args: z13.array(NonEmptyString3)
|
|
3832
3902
|
}),
|
|
3833
|
-
|
|
3834
|
-
channel:
|
|
3903
|
+
z13.strictObject({
|
|
3904
|
+
channel: z13.literal("git-clone"),
|
|
3835
3905
|
localId: LocalContributionId2,
|
|
3836
3906
|
displayName: OptionalDisplayName,
|
|
3837
3907
|
/** The repository locator - canonicalized and hygiene-checked by the daemon. */
|
|
@@ -3842,17 +3912,17 @@ function createContributionsSchemas(canonical) {
|
|
|
3842
3912
|
subdir: NonEmptyString3.optional()
|
|
3843
3913
|
})
|
|
3844
3914
|
]);
|
|
3845
|
-
const SearchProviderContribution2 =
|
|
3915
|
+
const SearchProviderContribution2 = z13.strictObject({
|
|
3846
3916
|
localId: LocalContributionId2,
|
|
3847
3917
|
displayName: OptionalDisplayName,
|
|
3848
|
-
schemes:
|
|
3918
|
+
schemes: z13.array(UriScheme2).optional()
|
|
3849
3919
|
});
|
|
3850
|
-
const InteractionDriverContribution2 =
|
|
3920
|
+
const InteractionDriverContribution2 = z13.strictObject({
|
|
3851
3921
|
localId: LocalContributionId2,
|
|
3852
3922
|
displayName: OptionalDisplayName,
|
|
3853
|
-
kind:
|
|
3923
|
+
kind: z13.enum(["browser", "computer-use"])
|
|
3854
3924
|
});
|
|
3855
|
-
const EntityResolverContribution2 =
|
|
3925
|
+
const EntityResolverContribution2 = z13.strictObject({
|
|
3856
3926
|
localId: LocalContributionId2,
|
|
3857
3927
|
displayName: OptionalDisplayName,
|
|
3858
3928
|
/** The `kay.agent` URI module (this manifest's own `contributes.uriModules[].localId`) whose
|
|
@@ -3860,17 +3930,17 @@ function createContributionsSchemas(canonical) {
|
|
|
3860
3930
|
uriModule: LocalContributionId2,
|
|
3861
3931
|
/** `person` | `channel` | `repo` | `pull-request` | ... -- drives avatar-first vs glyph-first row
|
|
3862
3932
|
* anatomy (N10-R2) and lets the renderer request a narrower `entityTypes` filter. */
|
|
3863
|
-
entityTypes:
|
|
3933
|
+
entityTypes: z13.array(NonEmptyString3).min(1),
|
|
3864
3934
|
/** The URI namespace/route `search()` is called against, e.g. `slack://directory` or
|
|
3865
3935
|
* `github://search/repositories` -- the resolver's fixed search scope; the live user query is
|
|
3866
3936
|
* the `search()` call's `query` param, never concatenated into this string. */
|
|
3867
3937
|
uriHint: NonEmptyString3
|
|
3868
3938
|
});
|
|
3869
|
-
const AgentRenderContribution2 =
|
|
3939
|
+
const AgentRenderContribution2 = z13.strictObject({
|
|
3870
3940
|
localId: LocalContributionId2,
|
|
3871
|
-
resultKinds:
|
|
3941
|
+
resultKinds: z13.array(NonEmptyString3).min(1)
|
|
3872
3942
|
});
|
|
3873
|
-
const PluginCardContribution2 =
|
|
3943
|
+
const PluginCardContribution2 = z13.strictObject({
|
|
3874
3944
|
localId: LocalContributionId2,
|
|
3875
3945
|
description: NonEmptyString3,
|
|
3876
3946
|
inputs: JsonSchema,
|
|
@@ -3878,26 +3948,26 @@ function createContributionsSchemas(canonical) {
|
|
|
3878
3948
|
submitEndpoint: LocalContributionId2,
|
|
3879
3949
|
authService: AuthServiceReference2.optional()
|
|
3880
3950
|
});
|
|
3881
|
-
const EndpointContribution2 =
|
|
3951
|
+
const EndpointContribution2 = z13.strictObject({
|
|
3882
3952
|
localId: LocalContributionId2,
|
|
3883
3953
|
displayName: OptionalDisplayName,
|
|
3884
3954
|
requestSchema: JsonSchema.optional(),
|
|
3885
3955
|
responseSchema: JsonSchema.optional(),
|
|
3886
|
-
auth:
|
|
3956
|
+
auth: z13.strictObject({
|
|
3887
3957
|
service: AuthServiceReference2,
|
|
3888
|
-
schemes:
|
|
3958
|
+
schemes: z13.array(AuthSchemeReference2).min(1),
|
|
3889
3959
|
purpose: NonEmptyString3
|
|
3890
3960
|
}).optional(),
|
|
3891
|
-
timeoutMs:
|
|
3961
|
+
timeoutMs: z13.number().int().positive().optional()
|
|
3892
3962
|
});
|
|
3893
|
-
const WorkflowContribution2 =
|
|
3963
|
+
const WorkflowContribution2 = z13.strictObject({
|
|
3894
3964
|
localId: LocalContributionId2,
|
|
3895
3965
|
name: NonEmptyString3,
|
|
3896
3966
|
/** Plain-text purpose, at most 280 characters. */
|
|
3897
3967
|
description: NonEmptyString3,
|
|
3898
3968
|
/** How often it runs. The automations engine enforces its scheduling floor. */
|
|
3899
|
-
everyMs:
|
|
3900
|
-
auth:
|
|
3969
|
+
everyMs: z13.number().int().positive(),
|
|
3970
|
+
auth: z13.strictObject({
|
|
3901
3971
|
/** A local ref names a service in this manifest; a dotted ref names another plugin's. */
|
|
3902
3972
|
service: AuthServiceReference2,
|
|
3903
3973
|
scheme: AuthSchemeReference2,
|
|
@@ -3905,7 +3975,7 @@ function createContributionsSchemas(canonical) {
|
|
|
3905
3975
|
* Scopes each account's token must hold. Omitted, the host asks for the first scope of the
|
|
3906
3976
|
* `background-job` grant's `allowedScopes` that the account holds.
|
|
3907
3977
|
*/
|
|
3908
|
-
scopes:
|
|
3978
|
+
scopes: z13.array(NonEmptyString3).min(1).optional()
|
|
3909
3979
|
}).optional()
|
|
3910
3980
|
});
|
|
3911
3981
|
const McpServerUrl2 = pluginString(canonical).min(1).refine((value) => {
|
|
@@ -3921,8 +3991,8 @@ function createContributionsSchemas(canonical) {
|
|
|
3921
3991
|
}, {
|
|
3922
3992
|
message: "mcp server url must be https://, or http:// only for localhost/127.0.0.1 test servers"
|
|
3923
3993
|
});
|
|
3924
|
-
const McpServerAuthMode2 =
|
|
3925
|
-
const McpServerContribution2 =
|
|
3994
|
+
const McpServerAuthMode2 = z13.enum(["oauth", "api-key", "none"]);
|
|
3995
|
+
const McpServerContribution2 = z13.strictObject({
|
|
3926
3996
|
url: McpServerUrl2,
|
|
3927
3997
|
auth: McpServerAuthMode2.optional(),
|
|
3928
3998
|
authService: LocalContributionId2.optional()
|
|
@@ -3935,24 +4005,24 @@ function createContributionsSchemas(canonical) {
|
|
|
3935
4005
|
});
|
|
3936
4006
|
}
|
|
3937
4007
|
});
|
|
3938
|
-
const McpServerContributions2 =
|
|
3939
|
-
const AppEventSubscription2 =
|
|
4008
|
+
const McpServerContributions2 = z13.record(LocalContributionId2, McpServerContribution2);
|
|
4009
|
+
const AppEventSubscription2 = z13.strictObject({
|
|
3940
4010
|
localId: LocalContributionId2,
|
|
3941
4011
|
event: NonEmptyString3
|
|
3942
4012
|
});
|
|
3943
|
-
const ContextContributorContribution2 =
|
|
4013
|
+
const ContextContributorContribution2 = z13.strictObject({
|
|
3944
4014
|
localId: LocalContributionId2.max(64),
|
|
3945
4015
|
displayName: OptionalDisplayName,
|
|
3946
4016
|
description: NonEmptyString3.optional()
|
|
3947
4017
|
});
|
|
3948
|
-
const EventDefinitionVersion =
|
|
3949
|
-
const PluginEventDefinitionContribution2 =
|
|
4018
|
+
const EventDefinitionVersion = z13.number().int().positive();
|
|
4019
|
+
const PluginEventDefinitionContribution2 = z13.strictObject({
|
|
3950
4020
|
localId: PluginEventLocalId2,
|
|
3951
4021
|
displayName: OptionalDisplayName,
|
|
3952
4022
|
description: NonEmptyString3.optional(),
|
|
3953
4023
|
version: canonical ? EventDefinitionVersion : EventDefinitionVersion.default(1),
|
|
3954
4024
|
uriScheme: UriScheme2,
|
|
3955
|
-
relatedKeys:
|
|
4025
|
+
relatedKeys: z13.array(NonEmptyString3).readonly().optional(),
|
|
3956
4026
|
payloadSchema: JsonSchema.optional(),
|
|
3957
4027
|
/**
|
|
3958
4028
|
* This event is a signal: its payload is the shared `PluginSignal` v1 and every publish
|
|
@@ -3961,7 +4031,7 @@ function createContributionsSchemas(canonical) {
|
|
|
3961
4031
|
* and `relatedKeys` holds `thread` plus any of `from`, `to`, `cc`. Turning it on changes
|
|
3962
4032
|
* the payload, so bump `version` with it.
|
|
3963
4033
|
*/
|
|
3964
|
-
signal:
|
|
4034
|
+
signal: z13.boolean().optional()
|
|
3965
4035
|
}).superRefine((definition, context) => {
|
|
3966
4036
|
if (definition.signal !== true)
|
|
3967
4037
|
return;
|
|
@@ -3982,42 +4052,42 @@ function createContributionsSchemas(canonical) {
|
|
|
3982
4052
|
});
|
|
3983
4053
|
}
|
|
3984
4054
|
});
|
|
3985
|
-
const PluginNotificationRuleContribution2 =
|
|
4055
|
+
const PluginNotificationRuleContribution2 = z13.strictObject({
|
|
3986
4056
|
localId: LocalContributionId2,
|
|
3987
4057
|
/** The same-plugin `eventDefinitions` local id this rule matches. */
|
|
3988
4058
|
event: PluginEventLocalId2,
|
|
3989
|
-
where:
|
|
4059
|
+
where: z13.string({ error: (issue) => whereNotAStringMessage(issue.input) }).optional(),
|
|
3990
4060
|
rule: JsonObject
|
|
3991
4061
|
});
|
|
3992
|
-
const PluginProductEventContribution2 =
|
|
3993
|
-
|
|
4062
|
+
const PluginProductEventContribution2 = z13.union([
|
|
4063
|
+
z13.strictObject({
|
|
3994
4064
|
name: NonEmptyString3,
|
|
3995
4065
|
description: NonEmptyString3.optional(),
|
|
3996
|
-
fields:
|
|
4066
|
+
fields: z13.record(z13.string(), JsonObject).optional()
|
|
3997
4067
|
}),
|
|
3998
|
-
|
|
4068
|
+
z13.strictObject({ catalogEvent: NonEmptyString3 })
|
|
3999
4069
|
]);
|
|
4000
|
-
const UiEventSubscriptionContribution2 =
|
|
4070
|
+
const UiEventSubscriptionContribution2 = z13.strictObject({
|
|
4001
4071
|
localId: LocalContributionId2,
|
|
4002
4072
|
event: NonEmptyString3
|
|
4003
4073
|
});
|
|
4004
|
-
const DeviceDelegationContribution2 =
|
|
4074
|
+
const DeviceDelegationContribution2 = z13.strictObject({
|
|
4005
4075
|
localId: LocalContributionId2,
|
|
4006
|
-
device:
|
|
4007
|
-
delegateAs:
|
|
4076
|
+
device: z13.enum(["microphone"]),
|
|
4077
|
+
delegateAs: z13.enum(["clip", "stream", "status"])
|
|
4008
4078
|
});
|
|
4009
|
-
const CorpusAccess =
|
|
4010
|
-
const SessionReaderContribution2 =
|
|
4079
|
+
const CorpusAccess = z13.enum(["read"]);
|
|
4080
|
+
const SessionReaderContribution2 = z13.strictObject({
|
|
4011
4081
|
localId: LocalContributionId2,
|
|
4012
4082
|
displayName: OptionalDisplayName,
|
|
4013
4083
|
access: canonical ? CorpusAccess : CorpusAccess.default("read")
|
|
4014
4084
|
});
|
|
4015
|
-
const UiCommandContribution2 =
|
|
4085
|
+
const UiCommandContribution2 = z13.strictObject({
|
|
4016
4086
|
localId: LocalContributionId2,
|
|
4017
4087
|
title: NonEmptyString3,
|
|
4018
4088
|
icon: PackageAssetPath2.optional(),
|
|
4019
|
-
button:
|
|
4020
|
-
menu:
|
|
4089
|
+
button: z13.enum(["tabStrip"]).optional(),
|
|
4090
|
+
menu: z13.enum(["help"]).optional(),
|
|
4021
4091
|
where: NonEmptyString3.optional()
|
|
4022
4092
|
}).superRefine((command, ctx) => {
|
|
4023
4093
|
if (command.where === void 0)
|
|
@@ -4038,7 +4108,7 @@ function createContributionsSchemas(canonical) {
|
|
|
4038
4108
|
});
|
|
4039
4109
|
}
|
|
4040
4110
|
});
|
|
4041
|
-
const UiSlotContribution2 =
|
|
4111
|
+
const UiSlotContribution2 = z13.strictObject({
|
|
4042
4112
|
localId: LocalContributionId2,
|
|
4043
4113
|
slot: NonEmptyString3,
|
|
4044
4114
|
title: NonEmptyString3.optional()
|
|
@@ -4052,84 +4122,84 @@ function createContributionsSchemas(canonical) {
|
|
|
4052
4122
|
"blob",
|
|
4053
4123
|
"about"
|
|
4054
4124
|
]);
|
|
4055
|
-
const ReferenceOpenBehavior2 =
|
|
4056
|
-
|
|
4057
|
-
|
|
4125
|
+
const ReferenceOpenBehavior2 = z13.discriminatedUnion("kind", [
|
|
4126
|
+
z13.strictObject({ kind: z13.literal("working-document") }),
|
|
4127
|
+
z13.strictObject({ kind: z13.literal("browser-pane") }),
|
|
4058
4128
|
/**
|
|
4059
4129
|
* Open one of the pages this manifest declares in `pages`. The window answers this from the
|
|
4060
4130
|
* manifest, and the page gets the whole address as its `objectId` unless `addresses` says
|
|
4061
4131
|
* otherwise. Needs no web address, so a plugin-only resource (`user-todo://items/3`) can pill.
|
|
4062
4132
|
*/
|
|
4063
|
-
|
|
4133
|
+
z13.strictObject({ kind: z13.literal("page"), pageId: NonEmptyString3 }),
|
|
4064
4134
|
/**
|
|
4065
4135
|
* Hand the address's link to an app on this machine. The module's claims fill the link as its
|
|
4066
4136
|
* `sourceUrl`, and `schemes` names every scheme those links may use: main opens a link only when
|
|
4067
4137
|
* a loaded plugin declares its scheme here. A plugin the person installed can't declare this.
|
|
4068
4138
|
*/
|
|
4069
|
-
|
|
4070
|
-
kind:
|
|
4071
|
-
schemes:
|
|
4139
|
+
z13.strictObject({
|
|
4140
|
+
kind: z13.literal("local-app"),
|
|
4141
|
+
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)
|
|
4072
4142
|
})
|
|
4073
4143
|
]);
|
|
4074
|
-
const ReferencePresentationVariant2 =
|
|
4144
|
+
const ReferencePresentationVariant2 = z13.strictObject({
|
|
4075
4145
|
resourceKind: NonEmptyString3,
|
|
4076
4146
|
presentationPluginId: PluginId2.optional()
|
|
4077
4147
|
});
|
|
4078
|
-
const ReferencePresentationVariants2 =
|
|
4079
|
-
const ReferencePresentationUriPattern2 =
|
|
4148
|
+
const ReferencePresentationVariants2 = z13.record(MimeTypeString2, ReferencePresentationVariant2);
|
|
4149
|
+
const ReferencePresentationUriPattern2 = z13.strictObject({
|
|
4080
4150
|
protocol: NonEmptyString3,
|
|
4081
4151
|
hostname: NonEmptyString3,
|
|
4082
|
-
pathname:
|
|
4083
|
-
search:
|
|
4152
|
+
pathname: z13.string().optional(),
|
|
4153
|
+
search: z13.string().optional()
|
|
4084
4154
|
});
|
|
4085
|
-
const ReferencePresentationUrlClaim2 =
|
|
4086
|
-
kind:
|
|
4155
|
+
const ReferencePresentationUrlClaim2 = z13.strictObject({
|
|
4156
|
+
kind: z13.literal("urlPattern"),
|
|
4087
4157
|
pattern: ReferencePresentationUriPattern2.extend({
|
|
4088
|
-
protocol:
|
|
4158
|
+
protocol: z13.enum(["http", "https"])
|
|
4089
4159
|
}),
|
|
4090
4160
|
/** The claim's mark: an SVG file in the plugin, drawn in its own colours. */
|
|
4091
4161
|
brandIcon: PackageAssetPath2.optional()
|
|
4092
4162
|
});
|
|
4093
|
-
const ReferencePresentationTooltip2 =
|
|
4163
|
+
const ReferencePresentationTooltip2 = z13.strictObject({
|
|
4094
4164
|
/** Same-plugin kay.ui app mounted with read-only reference URI context. */
|
|
4095
4165
|
app: LocalContributionId2,
|
|
4096
4166
|
pattern: ReferencePresentationUriPattern2
|
|
4097
4167
|
});
|
|
4098
|
-
const ReferencePresentationAddress2 =
|
|
4168
|
+
const ReferencePresentationAddress2 = z13.strictObject({
|
|
4099
4169
|
pattern: ReferencePresentationUriPattern2,
|
|
4100
4170
|
objectId: NonEmptyString3.optional(),
|
|
4101
|
-
open:
|
|
4171
|
+
open: z13.strictObject({ kind: z13.literal("none") }).optional()
|
|
4102
4172
|
});
|
|
4103
|
-
const ReferencePresentationAccountLinkPage =
|
|
4173
|
+
const ReferencePresentationAccountLinkPage = z13.strictObject({
|
|
4104
4174
|
/** A literal host name. */
|
|
4105
|
-
hostname:
|
|
4106
|
-
pathname:
|
|
4175
|
+
hostname: z13.string().regex(/^[a-z0-9.-]+$/, "An account link's hostname is a literal lower-case host name."),
|
|
4176
|
+
pathname: z13.string().optional(),
|
|
4107
4177
|
/** A page matching one of these already names its account, so it stays as it is. */
|
|
4108
|
-
unlessPathname:
|
|
4178
|
+
unlessPathname: z13.array(z13.string()).min(1).optional(),
|
|
4109
4179
|
/** The path the page opens at, in place of its own. */
|
|
4110
|
-
setPathname:
|
|
4180
|
+
setPathname: z13.string().startsWith("/").optional(),
|
|
4111
4181
|
/** Query values to add. A page that already has one of these names stays as it is. */
|
|
4112
|
-
addQuery:
|
|
4182
|
+
addQuery: z13.record(NonEmptyString3, NonEmptyString3)
|
|
4113
4183
|
});
|
|
4114
|
-
const ReferencePresentationAccountLinkAddress =
|
|
4184
|
+
const ReferencePresentationAccountLinkAddress = z13.strictObject({
|
|
4115
4185
|
pattern: ReferencePresentationUriPattern2,
|
|
4116
|
-
url:
|
|
4186
|
+
url: z13.string().regex(/^https?:\/\//, "An account link's url is a web page.")
|
|
4117
4187
|
});
|
|
4118
|
-
const ReferencePresentationAccountLinks2 =
|
|
4119
|
-
label:
|
|
4120
|
-
pages:
|
|
4121
|
-
addresses:
|
|
4188
|
+
const ReferencePresentationAccountLinks2 = z13.strictObject({
|
|
4189
|
+
label: z13.enum(["email", "name"]).optional(),
|
|
4190
|
+
pages: z13.array(ReferencePresentationAccountLinkPage).min(1).optional(),
|
|
4191
|
+
addresses: z13.array(ReferencePresentationAccountLinkAddress).min(1).optional()
|
|
4122
4192
|
});
|
|
4123
|
-
const ReferencePresentationWords2 =
|
|
4193
|
+
const ReferencePresentationWords2 = z13.strictObject({
|
|
4124
4194
|
/** The row's mark, for a source with no icon of its own. Left out: the plugin's main icon. */
|
|
4125
|
-
glyph:
|
|
4195
|
+
glyph: z13.enum(TOOL_GLYPHS).optional(),
|
|
4126
4196
|
/** The thing an address names ("channel" in "Read Slack channel"). Left out: the row reads the scheme's own name. */
|
|
4127
4197
|
kind: NonEmptyString3.optional(),
|
|
4128
4198
|
/**
|
|
4129
4199
|
* A more specific kind by the address's shape. The first row that matches decides, and an
|
|
4130
4200
|
* address no row matches reads `kind`.
|
|
4131
4201
|
*/
|
|
4132
|
-
kinds:
|
|
4202
|
+
kinds: z13.array(z13.strictObject({
|
|
4133
4203
|
pattern: ReferencePresentationUriPattern2,
|
|
4134
4204
|
kind: NonEmptyString3
|
|
4135
4205
|
})).min(1).optional(),
|
|
@@ -4138,7 +4208,7 @@ function createContributionsSchemas(canonical) {
|
|
|
4138
4208
|
/** What the live phrase names ("Slack" in "Reading Slack"). Left out: the bare verb ("Reading"). */
|
|
4139
4209
|
target: NonEmptyString3.optional(),
|
|
4140
4210
|
/** `kind` already says which source this is: "Edited plan", not "Edited Plan plan". */
|
|
4141
|
-
kindNamesSource:
|
|
4211
|
+
kindNamesSource: z13.literal(true).optional()
|
|
4142
4212
|
}).superRefine((value, ctx) => {
|
|
4143
4213
|
if (value.kind === void 0 && (value.glyph !== void 0 || value.kindNamesSource !== void 0 || value.kinds !== void 0)) {
|
|
4144
4214
|
ctx.addIssue({
|
|
@@ -4148,7 +4218,7 @@ function createContributionsSchemas(canonical) {
|
|
|
4148
4218
|
});
|
|
4149
4219
|
}
|
|
4150
4220
|
});
|
|
4151
|
-
const ReferencePresentationContribution2 =
|
|
4221
|
+
const ReferencePresentationContribution2 = z13.strictObject({
|
|
4152
4222
|
localId: LocalContributionId2,
|
|
4153
4223
|
/** This manifest's URI module. Leave it out only for an address another layer serves. */
|
|
4154
4224
|
uriModule: LocalContributionId2.optional(),
|
|
@@ -4159,7 +4229,7 @@ function createContributionsSchemas(canonical) {
|
|
|
4159
4229
|
*/
|
|
4160
4230
|
scheme: UriScheme2.optional(),
|
|
4161
4231
|
/** Which of the addresses open the page, and on what. Read by the window. */
|
|
4162
|
-
addresses:
|
|
4232
|
+
addresses: z13.array(ReferencePresentationAddress2).min(1).optional(),
|
|
4163
4233
|
/** Comes with `open`. A presentation with neither only words its module's addresses. */
|
|
4164
4234
|
resourceKind: NonEmptyString3.optional(),
|
|
4165
4235
|
/** How the address opens. Left out, it stays plain text. */
|
|
@@ -4167,7 +4237,7 @@ function createContributionsSchemas(canonical) {
|
|
|
4167
4237
|
/** MIME-specific resource kinds; absent keys use the base presentation. */
|
|
4168
4238
|
variants: ReferencePresentationVariants2.optional(),
|
|
4169
4239
|
/** Lexical public URL claims used only for host-rendered browser presentations. */
|
|
4170
|
-
claims:
|
|
4240
|
+
claims: z13.array(ReferencePresentationUrlClaim2).optional(),
|
|
4171
4241
|
/** Informational app presentation matched against the canonical resource URI. */
|
|
4172
4242
|
tooltip: ReferencePresentationTooltip2.optional(),
|
|
4173
4243
|
/** What the transcript calls this module's addresses. Needs a `uriModule`. */
|
|
@@ -4250,7 +4320,7 @@ function createContributionsSchemas(canonical) {
|
|
|
4250
4320
|
});
|
|
4251
4321
|
}
|
|
4252
4322
|
});
|
|
4253
|
-
const KayUiAppHostCapability2 =
|
|
4323
|
+
const KayUiAppHostCapability2 = z13.enum([
|
|
4254
4324
|
"navigation.open-session",
|
|
4255
4325
|
// Lets `navigation.openChat` create a blank chat (no message, no model
|
|
4256
4326
|
// turn) when no session id is given. It never sends anything.
|
|
@@ -4274,6 +4344,16 @@ function createContributionsSchemas(canonical) {
|
|
|
4274
4344
|
// artifacts the account may manage the access rule with a count of listed addresses, never the addresses.
|
|
4275
4345
|
// It reads no artifact bytes.
|
|
4276
4346
|
"shared-artifacts.read",
|
|
4347
|
+
// Lists the person's projects with their pinned-to-Home state and build state, pins or unpins
|
|
4348
|
+
// one to Home, renames a project or changes its description, and draws the host's project
|
|
4349
|
+
// controls in the app's pane (mark, working folder and repository, sessions, build status, the
|
|
4350
|
+
// new-project flow). Through `BonsaiProjectSessions` and `sessionsView` it exposes each
|
|
4351
|
+
// project's session titles, states and activity times. The page app holding it is the window's
|
|
4352
|
+
// project view and receives every request to show a project (`onOpenRequest`). It cannot
|
|
4353
|
+
// remove or refile a project or a file. Only a plugin that ships with Bonsai keeps it: desktop
|
|
4354
|
+
// main drops it from any other plugin's apps when it accepts them
|
|
4355
|
+
// (`BUNDLED_ONLY_UI_APP_HOST_CAPABILITIES`).
|
|
4356
|
+
"projects.manage",
|
|
4277
4357
|
// Grants exactly `panes.place` (see `WORKSPACE_VERB_TIERS`/`KayWorkspaceCommand` in
|
|
4278
4358
|
// `@bonsai/agent-runtime-protocol`) through the `kay.ui` capability broker's `workspace.place`,
|
|
4279
4359
|
// and `workspace.openBeside`: one artifact in the shell's reference side pane beside the app's own
|
|
@@ -4287,31 +4367,36 @@ function createContributionsSchemas(canonical) {
|
|
|
4287
4367
|
// rearrange the workspace but never remove something the user would have to notice going missing.
|
|
4288
4368
|
"workspace.arrange"
|
|
4289
4369
|
]);
|
|
4290
|
-
const
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
|
|
4370
|
+
const UiAppCapabilityReference2 = z13.union([
|
|
4371
|
+
LocalContributionId2,
|
|
4372
|
+
z13.strictObject({ pluginId: PluginId2, localId: LocalContributionId2 })
|
|
4373
|
+
]);
|
|
4374
|
+
const UiAppCapabilities2 = z13.strictObject({
|
|
4375
|
+
endpoints: z13.array(UiAppCapabilityReference2).optional(),
|
|
4376
|
+
host: z13.array(KayUiAppHostCapability2).optional(),
|
|
4377
|
+
// A local name selects this plugin's source first, otherwise the daemon's.
|
|
4378
|
+
// An explicit reference selects only the named plugin.
|
|
4379
|
+
feeds: z13.array(UiAppCapabilityReference2).optional()
|
|
4296
4380
|
}).superRefine((capabilities, ctx) => {
|
|
4297
4381
|
for (const field of ["endpoints", "host", "feeds"]) {
|
|
4298
4382
|
const seen = /* @__PURE__ */ new Set();
|
|
4299
4383
|
for (const [index, value] of (capabilities[field] ?? []).entries()) {
|
|
4300
|
-
|
|
4384
|
+
const key = typeof value === "string" ? value : JSON.stringify([value.pluginId, value.localId]);
|
|
4385
|
+
if (seen.has(key)) {
|
|
4301
4386
|
ctx.addIssue({
|
|
4302
4387
|
code: "custom",
|
|
4303
4388
|
path: [field, index],
|
|
4304
|
-
message: `duplicate ui app ${field} capability ${
|
|
4389
|
+
message: `duplicate ui app ${field} capability ${key}`
|
|
4305
4390
|
});
|
|
4306
4391
|
}
|
|
4307
|
-
seen.add(
|
|
4392
|
+
seen.add(key);
|
|
4308
4393
|
}
|
|
4309
4394
|
}
|
|
4310
4395
|
});
|
|
4311
|
-
const UiRailBadge =
|
|
4396
|
+
const UiRailBadge = z13.strictObject({
|
|
4312
4397
|
source: LocalContributionId2,
|
|
4313
4398
|
where: NonEmptyString3.optional(),
|
|
4314
|
-
label:
|
|
4399
|
+
label: z13.strictObject({
|
|
4315
4400
|
one: NonEmptyString3.optional(),
|
|
4316
4401
|
other: NonEmptyString3
|
|
4317
4402
|
})
|
|
@@ -4327,48 +4412,48 @@ function createContributionsSchemas(canonical) {
|
|
|
4327
4412
|
});
|
|
4328
4413
|
}
|
|
4329
4414
|
});
|
|
4330
|
-
const UiRailEntryContribution2 =
|
|
4415
|
+
const UiRailEntryContribution2 = z13.strictObject({
|
|
4331
4416
|
id: LocalContributionId2,
|
|
4332
4417
|
title: NonEmptyString3,
|
|
4333
4418
|
icon: PackageAssetPath2.optional(),
|
|
4334
4419
|
page: NonEmptyString3,
|
|
4335
4420
|
homeLocation: NonEmptyString3.optional(),
|
|
4336
4421
|
shortcut: NonEmptyString3.optional(),
|
|
4337
|
-
order:
|
|
4338
|
-
section:
|
|
4422
|
+
order: z13.number().finite().optional(),
|
|
4423
|
+
section: z13.enum(["primary", "plugins"]).optional(),
|
|
4339
4424
|
badge: UiRailBadge.optional(),
|
|
4340
|
-
panel:
|
|
4341
|
-
featureFlagVariant:
|
|
4425
|
+
panel: z13.strictObject({ body: LocalContributionId2 }).optional(),
|
|
4426
|
+
featureFlagVariant: z13.strictObject({
|
|
4342
4427
|
flag: NonEmptyString3,
|
|
4343
4428
|
title: NonEmptyString3.optional(),
|
|
4344
4429
|
icon: PackageAssetPath2.optional(),
|
|
4345
|
-
panel:
|
|
4430
|
+
panel: z13.literal(false).optional()
|
|
4346
4431
|
}).optional()
|
|
4347
4432
|
});
|
|
4348
|
-
const UiToastPreviewContribution2 =
|
|
4433
|
+
const UiToastPreviewContribution2 = z13.strictObject({
|
|
4349
4434
|
rule: LocalContributionId2,
|
|
4350
4435
|
body: LocalContributionId2,
|
|
4351
4436
|
address: NonEmptyString3
|
|
4352
4437
|
});
|
|
4353
|
-
const UiPageContribution2 =
|
|
4438
|
+
const UiPageContribution2 = z13.strictObject({
|
|
4354
4439
|
id: NonEmptyString3,
|
|
4355
4440
|
title: NonEmptyString3.optional(),
|
|
4356
4441
|
icon: PackageAssetPath2.optional(),
|
|
4357
|
-
companion:
|
|
4442
|
+
companion: z13.boolean().optional(),
|
|
4358
4443
|
openedEvent: NonEmptyString3.optional()
|
|
4359
4444
|
});
|
|
4360
|
-
const UiAppFields =
|
|
4445
|
+
const UiAppFields = z13.strictObject({
|
|
4361
4446
|
localId: LocalContributionId2,
|
|
4362
4447
|
displayName: NonEmptyString3,
|
|
4363
4448
|
description: NonEmptyString3.optional(),
|
|
4364
4449
|
icon: PackageAssetPath2.optional(),
|
|
4365
|
-
runtime:
|
|
4450
|
+
runtime: z13.literal("kay.react-app.v1"),
|
|
4366
4451
|
/** Mounted only by a host-supplied context; never a standalone navigation destination. */
|
|
4367
|
-
contextOnly:
|
|
4368
|
-
sdk:
|
|
4452
|
+
contextOnly: z13.literal(true).optional(),
|
|
4453
|
+
sdk: z13.strictObject({ range: NonEmptyString3 }),
|
|
4369
4454
|
entrypoint: TargetEntrypoint2,
|
|
4370
|
-
styles:
|
|
4371
|
-
assets:
|
|
4455
|
+
styles: z13.array(PackageAssetPath2).optional(),
|
|
4456
|
+
assets: z13.array(PackageAssetPath2).optional(),
|
|
4372
4457
|
capabilities: UiAppCapabilities2.optional()
|
|
4373
4458
|
});
|
|
4374
4459
|
function stripRetiredUiAppFields(value) {
|
|
@@ -4379,36 +4464,36 @@ function createContributionsSchemas(canonical) {
|
|
|
4379
4464
|
delete remaining["activityRail"];
|
|
4380
4465
|
return remaining;
|
|
4381
4466
|
}
|
|
4382
|
-
const UiAppContribution2 = canonical ? UiAppFields :
|
|
4383
|
-
const ThemeContribution2 =
|
|
4467
|
+
const UiAppContribution2 = canonical ? UiAppFields : z13.preprocess(stripRetiredUiAppFields, UiAppFields);
|
|
4468
|
+
const ThemeContribution2 = z13.strictObject({
|
|
4384
4469
|
localId: LocalContributionId2,
|
|
4385
4470
|
displayName: NonEmptyString3,
|
|
4386
|
-
appearance:
|
|
4471
|
+
appearance: z13.enum(["light", "dark"]),
|
|
4387
4472
|
tokens: PackageAssetPath2
|
|
4388
4473
|
});
|
|
4389
|
-
const CommandHandler2 =
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
kind:
|
|
4474
|
+
const CommandHandler2 = z13.discriminatedUnion("kind", [
|
|
4475
|
+
z13.strictObject({ kind: z13.literal("skill"), skill: LocalContributionId2 }),
|
|
4476
|
+
z13.strictObject({
|
|
4477
|
+
kind: z13.literal("tool"),
|
|
4393
4478
|
tool: PluginToolName2,
|
|
4394
4479
|
/** Positional mapping from tokenized `argsText` onto the tool's own input fields - see this
|
|
4395
4480
|
* union's doc for the exact tokenize/map/last-field-absorbs rule. */
|
|
4396
|
-
argumentFields:
|
|
4481
|
+
argumentFields: z13.array(NonEmptyString3)
|
|
4397
4482
|
}),
|
|
4398
|
-
|
|
4399
|
-
kind:
|
|
4483
|
+
z13.strictObject({
|
|
4484
|
+
kind: z13.literal("endpoint"),
|
|
4400
4485
|
endpoint: LocalContributionId2
|
|
4401
4486
|
})
|
|
4402
4487
|
]);
|
|
4403
|
-
const CommandContribution2 =
|
|
4488
|
+
const CommandContribution2 = z13.strictObject({
|
|
4404
4489
|
localId: LocalContributionId2,
|
|
4405
4490
|
displayName: OptionalDisplayName,
|
|
4406
4491
|
description: NonEmptyString3,
|
|
4407
|
-
aliases:
|
|
4492
|
+
aliases: z13.array(LocalContributionId2).optional(),
|
|
4408
4493
|
argumentHint: NonEmptyString3.optional(),
|
|
4409
4494
|
handler: CommandHandler2
|
|
4410
4495
|
});
|
|
4411
|
-
const PluginContributionKind2 =
|
|
4496
|
+
const PluginContributionKind2 = z13.enum([
|
|
4412
4497
|
"tool",
|
|
4413
4498
|
"converter",
|
|
4414
4499
|
"uriModule",
|
|
@@ -4496,6 +4581,7 @@ function createContributionsSchemas(canonical) {
|
|
|
4496
4581
|
ReferencePresentationWords: ReferencePresentationWords2,
|
|
4497
4582
|
ReferencePresentationContribution: ReferencePresentationContribution2,
|
|
4498
4583
|
KayUiAppHostCapability: KayUiAppHostCapability2,
|
|
4584
|
+
UiAppCapabilityReference: UiAppCapabilityReference2,
|
|
4499
4585
|
UiAppCapabilities: UiAppCapabilities2,
|
|
4500
4586
|
UiRailEntryContribution: UiRailEntryContribution2,
|
|
4501
4587
|
UiToastPreviewContribution: UiToastPreviewContribution2,
|
|
@@ -4507,7 +4593,7 @@ function createContributionsSchemas(canonical) {
|
|
|
4507
4593
|
PluginContributionKind: PluginContributionKind2
|
|
4508
4594
|
};
|
|
4509
4595
|
}
|
|
4510
|
-
var { ApprovalCardForm, ApprovalCardStoredForm, ApprovalTypeContribution, UriModuleFacts, ToolContribution, ToolPermission, AgentToolContribution, ConverterContribution, UriModuleContribution, AppUriModuleContribution, AppDataSourceContribution, WhiteboardTypeStorage, WhiteboardTypeContribution, AppDataMaterializerContribution, ArtifactUriModuleContribution, CliBindingContribution, GitHostContribution, ResourceContribution, SkillContribution, PluginSkillSourceDeclaration, SearchProviderContribution, InteractionDriverContribution, EntityResolverContribution, AgentRenderContribution, EndpointContribution, PluginCardContribution, WorkflowContribution, McpServerUrl, McpServerAuthMode, McpServerContribution, McpServerContributions, AppEventSubscription, ContextContributorContribution, PluginEventDefinitionContribution, PluginNotificationRuleContribution, PluginProductEventContribution, UiEventSubscriptionContribution, DeviceDelegationContribution, SessionReaderContribution, UiCommandContribution, UiSlotContribution, ReferenceOpenBehavior, ReferencePresentationVariant, ReferencePresentationVariants, ReferencePresentationUriPattern, ReferencePresentationUrlClaim, ReferencePresentationTooltip, ReferencePresentationAddress, ReferencePresentationAccountLinks, ReferencePresentationWords, ReferencePresentationContribution, KayUiAppHostCapability, UiAppCapabilities, UiRailEntryContribution, UiToastPreviewContribution, UiPageContribution, UiAppContribution, ThemeContribution, CommandHandler, CommandContribution, PluginContributionKind } = createContributionsSchemas(false);
|
|
4596
|
+
var { ApprovalCardForm, ApprovalCardStoredForm, ApprovalTypeContribution, UriModuleFacts, ToolContribution, ToolPermission, AgentToolContribution, ConverterContribution, UriModuleContribution, AppUriModuleContribution, AppDataSourceContribution, WhiteboardTypeStorage, WhiteboardTypeContribution, AppDataMaterializerContribution, ArtifactUriModuleContribution, CliBindingContribution, GitHostContribution, ResourceContribution, SkillContribution, PluginSkillSourceDeclaration, SearchProviderContribution, InteractionDriverContribution, EntityResolverContribution, AgentRenderContribution, EndpointContribution, PluginCardContribution, WorkflowContribution, McpServerUrl, McpServerAuthMode, McpServerContribution, McpServerContributions, AppEventSubscription, ContextContributorContribution, PluginEventDefinitionContribution, PluginNotificationRuleContribution, PluginProductEventContribution, UiEventSubscriptionContribution, DeviceDelegationContribution, SessionReaderContribution, UiCommandContribution, UiSlotContribution, ReferenceOpenBehavior, ReferencePresentationVariant, ReferencePresentationVariants, ReferencePresentationUriPattern, ReferencePresentationUrlClaim, ReferencePresentationTooltip, ReferencePresentationAddress, ReferencePresentationAccountLinks, ReferencePresentationWords, ReferencePresentationContribution, KayUiAppHostCapability, UiAppCapabilityReference, UiAppCapabilities, UiRailEntryContribution, UiToastPreviewContribution, UiPageContribution, UiAppContribution, ThemeContribution, CommandHandler, CommandContribution, PluginContributionKind } = createContributionsSchemas(false);
|
|
4511
4597
|
var canonicalContributionSchemas = createContributionsSchemas(true);
|
|
4512
4598
|
var UI_APP_SOURCE_MODULE = /\.(?:tsx|ts|jsx)$/;
|
|
4513
4599
|
function isUiAppSourceModule(module) {
|
|
@@ -4566,7 +4652,56 @@ __export(manifest_exports, {
|
|
|
4566
4652
|
retiredCompatibilityKeysIn: () => retiredCompatibilityKeysIn,
|
|
4567
4653
|
validateKayUiEventSubscription: () => validateKayUiEventSubscription
|
|
4568
4654
|
});
|
|
4569
|
-
|
|
4655
|
+
|
|
4656
|
+
// packages/plugin-protocol/dist/shell-commands.js
|
|
4657
|
+
import { z as z14 } from "zod";
|
|
4658
|
+
var PluginShellCommand = z14.strictObject({
|
|
4659
|
+
name: z14.string().regex(/^[a-z][a-z0-9-]*$/),
|
|
4660
|
+
aliases: z14.array(z14.string().regex(/^[a-z][a-z0-9-]*$/)).optional(),
|
|
4661
|
+
endpoint: z14.string().min(1),
|
|
4662
|
+
usage: z14.string().min(1)
|
|
4663
|
+
});
|
|
4664
|
+
var ShellCommandOutcome = z14.strictObject({
|
|
4665
|
+
exitCode: z14.number().int(),
|
|
4666
|
+
envelope: JsonValue,
|
|
4667
|
+
result: JsonValue.optional()
|
|
4668
|
+
});
|
|
4669
|
+
var ShellCommandRequest = z14.strictObject({
|
|
4670
|
+
argv: z14.array(z14.string()),
|
|
4671
|
+
cwd: z14.string(),
|
|
4672
|
+
outcomes: z14.array(ShellCommandOutcome).max(3)
|
|
4673
|
+
});
|
|
4674
|
+
var ShellCommandStep = z14.discriminatedUnion("kind", [
|
|
4675
|
+
z14.strictObject({
|
|
4676
|
+
kind: z14.literal("invoke"),
|
|
4677
|
+
toolName: z14.enum([
|
|
4678
|
+
"read",
|
|
4679
|
+
"list",
|
|
4680
|
+
"search",
|
|
4681
|
+
"write",
|
|
4682
|
+
"edit",
|
|
4683
|
+
"delete",
|
|
4684
|
+
"help"
|
|
4685
|
+
]),
|
|
4686
|
+
input: z14.record(z14.string(), JsonValue),
|
|
4687
|
+
flags: z14.record(z14.string(), z14.string())
|
|
4688
|
+
}),
|
|
4689
|
+
z14.strictObject({
|
|
4690
|
+
kind: z14.literal("finish"),
|
|
4691
|
+
exitCode: z14.number().int(),
|
|
4692
|
+
stdout: z14.string()
|
|
4693
|
+
})
|
|
4694
|
+
]);
|
|
4695
|
+
|
|
4696
|
+
// packages/plugin-protocol/dist/manifest.js
|
|
4697
|
+
import { z as z16 } from "zod";
|
|
4698
|
+
|
|
4699
|
+
// packages/plugin-protocol/dist/workload-purposes.js
|
|
4700
|
+
import { z as z15 } from "zod";
|
|
4701
|
+
var PluginWorkloadPurpose = z15.strictObject({
|
|
4702
|
+
purpose: z15.string().regex(/^[a-z][a-z0-9-]*$/),
|
|
4703
|
+
workloadClass: z15.enum(["dreaming", "hindsight"])
|
|
4704
|
+
});
|
|
4570
4705
|
|
|
4571
4706
|
// packages/plugin-protocol/dist/synthetic-contributions.js
|
|
4572
4707
|
function resolveConfigSectionContributionLocalId(section) {
|
|
@@ -4591,34 +4726,34 @@ function createManifestSchemas(canonical) {
|
|
|
4591
4726
|
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;
|
|
4592
4727
|
const { HttpsUrl: HttpsUrl2, LocalContributionId: LocalContributionId2, NonEmptyString: NonEmptyString3, PackageAssetPath: PackageAssetPath2, PluginId: PluginId2, PluginNamespace: PluginNamespace2, RegistrableDomain: RegistrableDomain2, SignedInStatusCode: SignedInStatusCode2, TargetEntrypoint: TargetEntrypoint2 } = canonical ? canonicalCommonSchemas : common_exports;
|
|
4593
4728
|
const { PluginPermissionManifest: PluginPermissionManifest2 } = canonical ? canonicalPermissionSchemas : permissions_exports;
|
|
4594
|
-
const KayAgentTargetManifest2 =
|
|
4729
|
+
const KayAgentTargetManifest2 = z16.strictObject({
|
|
4595
4730
|
entrypoint: TargetEntrypoint2,
|
|
4596
|
-
contributes:
|
|
4597
|
-
tools:
|
|
4598
|
-
converters:
|
|
4599
|
-
uriModules:
|
|
4731
|
+
contributes: z16.strictObject({
|
|
4732
|
+
tools: z16.array(AgentToolContribution2).optional(),
|
|
4733
|
+
converters: z16.array(ConverterContribution2).optional(),
|
|
4734
|
+
uriModules: z16.array(UriModuleContribution2).optional(),
|
|
4600
4735
|
// Host-composed artifact-backed schemes (see `ArtifactUriModuleContribution`): the plugin
|
|
4601
4736
|
// declares scheme + editability; the daemon binds each to the kernel's artifact lifecycle
|
|
4602
4737
|
// per session. Separate from `uriModules` (plugin-implemented backends) precisely because
|
|
4603
4738
|
// the plugin registers NOTHING for these at activation.
|
|
4604
|
-
artifactUriModules:
|
|
4605
|
-
cliBindings:
|
|
4739
|
+
artifactUriModules: z16.array(ArtifactUriModuleContribution2).optional(),
|
|
4740
|
+
cliBindings: z16.array(CliBindingContribution2).optional(),
|
|
4606
4741
|
// Which git hosts this plugin's credential serves (see `GitHostContribution`): a
|
|
4607
4742
|
// declaration, so a plugin for any git backend gets credentialed clones without
|
|
4608
4743
|
// the daemon learning its name. Sibling of `cliBindings` because both answer the
|
|
4609
4744
|
// same question - which of this plugin's auth services a host-side consumer
|
|
4610
4745
|
// resolves - for two different transports.
|
|
4611
|
-
gitHosts:
|
|
4612
|
-
resources:
|
|
4613
|
-
skills:
|
|
4614
|
-
searchProviders:
|
|
4615
|
-
interactionDrivers:
|
|
4616
|
-
entityResolvers:
|
|
4617
|
-
renderers:
|
|
4746
|
+
gitHosts: z16.array(GitHostContribution2).optional(),
|
|
4747
|
+
resources: z16.array(ResourceContribution2).optional(),
|
|
4748
|
+
skills: z16.array(SkillContribution2).optional(),
|
|
4749
|
+
searchProviders: z16.array(SearchProviderContribution2).optional(),
|
|
4750
|
+
interactionDrivers: z16.array(InteractionDriverContribution2).optional(),
|
|
4751
|
+
entityResolvers: z16.array(EntityResolverContribution2).optional(),
|
|
4752
|
+
renderers: z16.array(AgentRenderContribution2).optional(),
|
|
4618
4753
|
// Handler restricted to skill | tool by the manifest-level refinement below (see
|
|
4619
4754
|
// `CommandContribution`'s doc for why the restriction is not expressed in the type, and
|
|
4620
4755
|
// `CommandHandler`'s doc for why there is no promptTemplate variant to declare here).
|
|
4621
|
-
commands:
|
|
4756
|
+
commands: z16.array(CommandContribution2).optional()
|
|
4622
4757
|
}).optional(),
|
|
4623
4758
|
/**
|
|
4624
4759
|
* The plugin's primer skill - the `localId` of one of its own declared
|
|
@@ -4664,61 +4799,61 @@ function createManifestSchemas(canonical) {
|
|
|
4664
4799
|
* acquisition, not declared here, so there is nothing for the resolved contract to mint a
|
|
4665
4800
|
* `globalId` for at parse time.
|
|
4666
4801
|
*/
|
|
4667
|
-
skillSources:
|
|
4802
|
+
skillSources: z16.array(PluginSkillSourceDeclaration2).optional()
|
|
4668
4803
|
});
|
|
4669
|
-
const KayAppTargetManifest2 =
|
|
4804
|
+
const KayAppTargetManifest2 = z16.strictObject({
|
|
4670
4805
|
// Optional, like `kay.ui`'s: a target may carry only declarative `contributes` (e.g. a plugin
|
|
4671
4806
|
// that ships nothing but `mcpServers`) with no app-lifetime module for the host to load.
|
|
4672
4807
|
entrypoint: TargetEntrypoint2.optional(),
|
|
4673
|
-
contributes:
|
|
4808
|
+
contributes: z16.strictObject({
|
|
4674
4809
|
// Session tools implemented by the app-lifetime activation (registered once, injected into
|
|
4675
4810
|
// every session with a host-stamped session context) - the tool counterpart of `uriModules`
|
|
4676
4811
|
// below. Same descriptor shape as kay.agent tools; `toolName` shares ONE flat session
|
|
4677
4812
|
// namespace with them (enforced by the manifest-level refinement below).
|
|
4678
|
-
tools:
|
|
4679
|
-
endpoints:
|
|
4680
|
-
cards:
|
|
4681
|
-
uriModules:
|
|
4682
|
-
dataSources:
|
|
4683
|
-
whiteboardTypes:
|
|
4684
|
-
approvalTypes:
|
|
4685
|
-
workflows:
|
|
4686
|
-
eventDefinitions:
|
|
4813
|
+
tools: z16.array(ToolContribution2).optional(),
|
|
4814
|
+
endpoints: z16.array(EndpointContribution2).optional(),
|
|
4815
|
+
cards: z16.array(PluginCardContribution2).optional(),
|
|
4816
|
+
uriModules: z16.array(AppUriModuleContribution2).optional(),
|
|
4817
|
+
dataSources: z16.array(AppDataSourceContribution2).optional(),
|
|
4818
|
+
whiteboardTypes: z16.array(WhiteboardTypeContribution2).optional(),
|
|
4819
|
+
approvalTypes: z16.array(ApprovalTypeContribution2).optional(),
|
|
4820
|
+
workflows: z16.array(WorkflowContribution2).optional(),
|
|
4821
|
+
eventDefinitions: z16.array(PluginEventDefinitionContribution2).optional(),
|
|
4687
4822
|
// Default notification rules over this plugin's own `eventDefinitions`; seeded by the host
|
|
4688
4823
|
// (see `PluginNotificationRuleContribution`).
|
|
4689
|
-
notificationRules:
|
|
4690
|
-
productEvents:
|
|
4691
|
-
eventSubscriptions:
|
|
4692
|
-
deviceDelegations:
|
|
4693
|
-
sessionReaders:
|
|
4694
|
-
contextContributors:
|
|
4824
|
+
notificationRules: z16.array(PluginNotificationRuleContribution2).optional(),
|
|
4825
|
+
productEvents: z16.array(PluginProductEventContribution2).optional(),
|
|
4826
|
+
eventSubscriptions: z16.array(AppEventSubscription2).optional(),
|
|
4827
|
+
deviceDelegations: z16.array(DeviceDelegationContribution2).optional(),
|
|
4828
|
+
sessionReaders: z16.array(SessionReaderContribution2).optional(),
|
|
4829
|
+
contextContributors: z16.array(ContextContributorContribution2).optional(),
|
|
4695
4830
|
// Vendored MCP servers this plugin ships (see `McpServerContributions`). Each is hosted only
|
|
4696
4831
|
// for a plugin holding `mcp.host-server` for its name and URL; that is decided at
|
|
4697
4832
|
// composition, not here (see ARCHITECTURE.md "Validation Law").
|
|
4698
4833
|
mcpServers: McpServerContributions2.optional(),
|
|
4699
4834
|
// Handler restricted to endpoint-only by the manifest-level refinement below.
|
|
4700
|
-
commands:
|
|
4835
|
+
commands: z16.array(CommandContribution2).optional()
|
|
4701
4836
|
}).optional()
|
|
4702
4837
|
});
|
|
4703
|
-
const KayUiTargetManifest2 =
|
|
4838
|
+
const KayUiTargetManifest2 = z16.strictObject({
|
|
4704
4839
|
entrypoint: TargetEntrypoint2.extend({
|
|
4705
|
-
format:
|
|
4840
|
+
format: z16.literal("compiled-bundle").optional()
|
|
4706
4841
|
}).optional(),
|
|
4707
|
-
contributes:
|
|
4708
|
-
commands:
|
|
4709
|
-
slots:
|
|
4710
|
-
referencePresentations:
|
|
4711
|
-
apps:
|
|
4712
|
-
railEntries:
|
|
4713
|
-
toastPreviews:
|
|
4714
|
-
pages:
|
|
4715
|
-
themes:
|
|
4716
|
-
eventSubscriptions:
|
|
4717
|
-
dataMaterializers:
|
|
4842
|
+
contributes: z16.strictObject({
|
|
4843
|
+
commands: z16.array(UiCommandContribution2).optional(),
|
|
4844
|
+
slots: z16.array(UiSlotContribution2).optional(),
|
|
4845
|
+
referencePresentations: z16.array(ReferencePresentationContribution2).optional(),
|
|
4846
|
+
apps: z16.array(UiAppContribution2).optional(),
|
|
4847
|
+
railEntries: z16.array(UiRailEntryContribution2).optional(),
|
|
4848
|
+
toastPreviews: z16.array(UiToastPreviewContribution2).optional(),
|
|
4849
|
+
pages: z16.array(UiPageContribution2).optional(),
|
|
4850
|
+
themes: z16.array(ThemeContribution2).optional(),
|
|
4851
|
+
eventSubscriptions: z16.array(UiEventSubscriptionContribution2).optional(),
|
|
4852
|
+
dataMaterializers: z16.array(AppDataMaterializerContribution2).optional()
|
|
4718
4853
|
}).optional()
|
|
4719
4854
|
});
|
|
4720
|
-
const PluginConfigScope2 =
|
|
4721
|
-
const PluginConfigSectionManifest2 =
|
|
4855
|
+
const PluginConfigScope2 = z16.enum(["global", "project", "agent"]);
|
|
4856
|
+
const PluginConfigSectionManifest2 = z16.strictObject({
|
|
4722
4857
|
section: NonEmptyString3.optional(),
|
|
4723
4858
|
schema: JsonSchema,
|
|
4724
4859
|
/**
|
|
@@ -4736,22 +4871,23 @@ function createManifestSchemas(canonical) {
|
|
|
4736
4871
|
* is the baseline every section has; `agent` has no runtime mapping (the
|
|
4737
4872
|
* agent/entity fold is downstream of the document protocol).
|
|
4738
4873
|
*/
|
|
4739
|
-
scopes:
|
|
4874
|
+
scopes: z16.array(PluginConfigScope2).optional()
|
|
4740
4875
|
});
|
|
4741
|
-
const PluginConfigManifest2 =
|
|
4742
|
-
const PluginStorageManifest2 =
|
|
4743
|
-
sqlite:
|
|
4744
|
-
enabled:
|
|
4745
|
-
ownerTarget:
|
|
4876
|
+
const PluginConfigManifest2 = z16.array(PluginConfigSectionManifest2).min(1);
|
|
4877
|
+
const PluginStorageManifest2 = z16.strictObject({
|
|
4878
|
+
sqlite: z16.strictObject({
|
|
4879
|
+
enabled: z16.boolean(),
|
|
4880
|
+
ownerTarget: z16.literal("kay.app").optional(),
|
|
4746
4881
|
migrations: NonEmptyString3.optional()
|
|
4747
4882
|
}).optional(),
|
|
4748
|
-
dataDir:
|
|
4749
|
-
enabled:
|
|
4750
|
-
ownerTarget:
|
|
4883
|
+
dataDir: z16.strictObject({
|
|
4884
|
+
enabled: z16.boolean(),
|
|
4885
|
+
ownerTarget: z16.literal("kay.app").optional(),
|
|
4886
|
+
sharedWith: PluginId2.optional()
|
|
4751
4887
|
}).optional()
|
|
4752
4888
|
});
|
|
4753
|
-
const PluginOAuthClientSupplier2 =
|
|
4754
|
-
const PluginProvisioningProbe2 =
|
|
4889
|
+
const PluginOAuthClientSupplier2 = z16.enum(["kay", "user"]);
|
|
4890
|
+
const PluginProvisioningProbe2 = z16.strictObject({
|
|
4755
4891
|
/**
|
|
4756
4892
|
* The API endpoint that answers the question. The host sends the service's OWN credential here,
|
|
4757
4893
|
* so this must belong to the provider that minted it - enforced by the daemon against the
|
|
@@ -4759,13 +4895,13 @@ function createManifestSchemas(canonical) {
|
|
|
4759
4895
|
*/
|
|
4760
4896
|
url: HttpsUrl2,
|
|
4761
4897
|
/** Absent => `GET`. */
|
|
4762
|
-
method:
|
|
4898
|
+
method: z16.enum(["GET"]).optional(),
|
|
4763
4899
|
/**
|
|
4764
4900
|
* The statuses that make the response a VERDICT at all. Anything else (a 401 from a stale
|
|
4765
4901
|
* token, a 5xx, a rate limit) means the probe learned nothing and reports `unknown` - never
|
|
4766
4902
|
* `unsatisfied`, which would tell a user to go fix setup that is fine.
|
|
4767
4903
|
*/
|
|
4768
|
-
verdictStatuses:
|
|
4904
|
+
verdictStatuses: z16.array(SignedInStatusCode2).min(1),
|
|
4769
4905
|
/**
|
|
4770
4906
|
* Dot-path to a JSON array in the response body that must be NON-EMPTY for the requirement to
|
|
4771
4907
|
* count as satisfied (e.g. `installations`). Absent means a verdict status alone is enough.
|
|
@@ -4774,7 +4910,7 @@ function createManifestSchemas(canonical) {
|
|
|
4774
4910
|
*/
|
|
4775
4911
|
nonEmptyArrayAt: NonEmptyString3.optional()
|
|
4776
4912
|
});
|
|
4777
|
-
const PluginProvisioningRequirement2 =
|
|
4913
|
+
const PluginProvisioningRequirement2 = z16.strictObject({
|
|
4778
4914
|
/** Stable id, unique within the scheme. */
|
|
4779
4915
|
id: LocalContributionId2,
|
|
4780
4916
|
/** Human-facing requirement name, e.g. "GitHub App installation". */
|
|
@@ -4791,7 +4927,7 @@ function createManifestSchemas(canonical) {
|
|
|
4791
4927
|
probe: PluginProvisioningProbe2
|
|
4792
4928
|
});
|
|
4793
4929
|
const PluginProvisioningField = {
|
|
4794
|
-
provisioning:
|
|
4930
|
+
provisioning: z16.array(PluginProvisioningRequirement2).optional()
|
|
4795
4931
|
};
|
|
4796
4932
|
const PluginAuthSchemeDescriptionFields = {
|
|
4797
4933
|
/** Human-facing flow name; absent, the service's name stands in. */
|
|
@@ -4808,16 +4944,17 @@ function createManifestSchemas(canonical) {
|
|
|
4808
4944
|
authorizationUrl: HttpsUrl2,
|
|
4809
4945
|
tokenUrl: HttpsUrl2,
|
|
4810
4946
|
/** Provider-specific query parameters added to the authorize URL. */
|
|
4811
|
-
extraAuthorizeParams:
|
|
4947
|
+
extraAuthorizeParams: z16.record(NonEmptyString3, z16.string()).optional()
|
|
4812
4948
|
};
|
|
4813
|
-
const PluginAuthSchemeAccountLookup =
|
|
4814
|
-
const PluginAuthSchemeOAuthPkce =
|
|
4949
|
+
const PluginAuthSchemeAccountLookup = z16.literal("lookup");
|
|
4950
|
+
const PluginAuthSchemeOAuthPkce = z16.strictObject({
|
|
4815
4951
|
...PluginProvisioningField,
|
|
4816
4952
|
...PluginAuthSchemeDescriptionFields,
|
|
4817
4953
|
...PluginAuthSchemeOAuthEndpointFields,
|
|
4818
4954
|
localId: LocalContributionId2,
|
|
4819
|
-
kind:
|
|
4820
|
-
exchange:
|
|
4955
|
+
kind: z16.literal("oauth2"),
|
|
4956
|
+
exchange: z16.literal("pkce"),
|
|
4957
|
+
byoocProfile: PluginByoocProfile.optional(),
|
|
4821
4958
|
/**
|
|
4822
4959
|
* A public client id the plugin ships for its own sign-in. Only an installed plugin's is used:
|
|
4823
4960
|
* Bonsai's own plugins sign in with clients the host holds.
|
|
@@ -4840,7 +4977,7 @@ function createManifestSchemas(canonical) {
|
|
|
4840
4977
|
* runs on an untrusted manifest, so a hand-built `["kay","kay"]` must be refused here, not
|
|
4841
4978
|
* silently normalized).
|
|
4842
4979
|
*/
|
|
4843
|
-
clientSuppliers:
|
|
4980
|
+
clientSuppliers: z16.array(PluginOAuthClientSupplier2).nonempty().superRefine((suppliers, ctx) => {
|
|
4844
4981
|
if (new Set(suppliers).size !== suppliers.length) {
|
|
4845
4982
|
ctx.addIssue({
|
|
4846
4983
|
code: "custom",
|
|
@@ -4848,7 +4985,10 @@ function createManifestSchemas(canonical) {
|
|
|
4848
4985
|
});
|
|
4849
4986
|
}
|
|
4850
4987
|
}),
|
|
4851
|
-
scopes:
|
|
4988
|
+
scopes: z16.array(NonEmptyString3).optional()
|
|
4989
|
+
}).refine((scheme) => scheme.byoocProfile === void 0 || scheme.clientSuppliers.includes("user"), {
|
|
4990
|
+
message: "An own-client profile requires the user client supplier.",
|
|
4991
|
+
path: ["byoocProfile"]
|
|
4852
4992
|
}).refine((scheme) => scheme.clientSecret === void 0 || scheme.clientId !== void 0, {
|
|
4853
4993
|
message: "clientSecret needs the clientId it belongs to",
|
|
4854
4994
|
path: ["clientSecret"]
|
|
@@ -4856,33 +4996,33 @@ function createManifestSchemas(canonical) {
|
|
|
4856
4996
|
message: "a scheme with its own clientId names where its account comes from (`account`)",
|
|
4857
4997
|
path: ["account"]
|
|
4858
4998
|
});
|
|
4859
|
-
const PluginAuthSchemeOAuthConfidential =
|
|
4999
|
+
const PluginAuthSchemeOAuthConfidential = z16.strictObject({
|
|
4860
5000
|
...PluginProvisioningField,
|
|
4861
5001
|
...PluginAuthSchemeDescriptionFields,
|
|
4862
5002
|
...PluginAuthSchemeOAuthEndpointFields,
|
|
4863
5003
|
localId: LocalContributionId2,
|
|
4864
|
-
kind:
|
|
4865
|
-
exchange:
|
|
5004
|
+
kind: z16.literal("oauth2"),
|
|
5005
|
+
exchange: z16.literal("confidential"),
|
|
4866
5006
|
/** Absent means `["kay"]` - a confidential exchange's secret may only ever be Bonsai's. */
|
|
4867
|
-
clientSuppliers:
|
|
4868
|
-
scopes:
|
|
5007
|
+
clientSuppliers: z16.tuple([z16.literal("kay")]).optional(),
|
|
5008
|
+
scopes: z16.array(NonEmptyString3).optional(),
|
|
4869
5009
|
/** Where the account comes from (see {@link PluginAuthSchemeAccountLookup}). */
|
|
4870
|
-
account:
|
|
5010
|
+
account: z16.union([PluginAuthSchemeAccountLookup, z16.literal("sign-in")])
|
|
4871
5011
|
});
|
|
4872
|
-
const PluginAuthSchemeOAuth2 =
|
|
5012
|
+
const PluginAuthSchemeOAuth2 = z16.discriminatedUnion("exchange", [
|
|
4873
5013
|
PluginAuthSchemeOAuthPkce,
|
|
4874
5014
|
PluginAuthSchemeOAuthConfidential
|
|
4875
5015
|
]);
|
|
4876
|
-
const PluginAuthSchemeApiKey =
|
|
5016
|
+
const PluginAuthSchemeApiKey = z16.strictObject({
|
|
4877
5017
|
...PluginProvisioningField,
|
|
4878
5018
|
...PluginAuthSchemeDescriptionFields,
|
|
4879
5019
|
localId: LocalContributionId2,
|
|
4880
|
-
kind:
|
|
4881
|
-
scopes:
|
|
5020
|
+
kind: z16.literal("api-key"),
|
|
5021
|
+
scopes: z16.array(NonEmptyString3).optional(),
|
|
4882
5022
|
/** The connect prompt's label for the key. Absent: "<service name> API key". */
|
|
4883
5023
|
inputLabel: NonEmptyString3.optional(),
|
|
4884
5024
|
/** Two or more labeled inputs for a secret that comes in parts; absent asks for one key. */
|
|
4885
|
-
fields:
|
|
5025
|
+
fields: z16.array(z16.strictObject({ id: LocalContributionId2, label: NonEmptyString3 })).min(2).superRefine((fields, ctx) => {
|
|
4886
5026
|
if (new Set(fields.map((field) => field.id)).size !== fields.length) {
|
|
4887
5027
|
ctx.addIssue({
|
|
4888
5028
|
code: "custom",
|
|
@@ -4891,7 +5031,7 @@ function createManifestSchemas(canonical) {
|
|
|
4891
5031
|
}
|
|
4892
5032
|
}).optional(),
|
|
4893
5033
|
/** Where and how the person creates the key outside Bonsai. */
|
|
4894
|
-
setup:
|
|
5034
|
+
setup: z16.strictObject({ instructions: NonEmptyString3, url: HttpsUrl2 }).optional(),
|
|
4895
5035
|
/**
|
|
4896
5036
|
* `"lookup"`: the plugin checks a key before it is saved and names its account, with the function
|
|
4897
5037
|
* it registers (`api.auth.registerAccountLookup`). Absent: the key is saved unchecked, under the
|
|
@@ -4899,27 +5039,27 @@ function createManifestSchemas(canonical) {
|
|
|
4899
5039
|
*/
|
|
4900
5040
|
account: PluginAuthSchemeAccountLookup.optional()
|
|
4901
5041
|
});
|
|
4902
|
-
const PluginAuthSchemeDelegated =
|
|
5042
|
+
const PluginAuthSchemeDelegated = z16.strictObject({
|
|
4903
5043
|
...PluginAuthSchemeDescriptionFields,
|
|
4904
5044
|
localId: LocalContributionId2,
|
|
4905
|
-
kind:
|
|
4906
|
-
scopes:
|
|
5045
|
+
kind: z16.literal("delegated"),
|
|
5046
|
+
scopes: z16.array(NonEmptyString3).optional()
|
|
4907
5047
|
});
|
|
4908
|
-
const ExternalCliArgument =
|
|
5048
|
+
const ExternalCliArgument = z16.string().min(1).max(16384).refine((value) => ![...value].some(isUnsafeArgumentCharacter), {
|
|
4909
5049
|
message: "an argument may hold tabs and line breaks, but no other control character, no invisible character and no bidirectional override"
|
|
4910
5050
|
});
|
|
4911
|
-
const ExternalCliCommand =
|
|
5051
|
+
const ExternalCliCommand = z16.string().max(128).regex(/^[A-Za-z0-9][A-Za-z0-9._+-]*$/, {
|
|
4912
5052
|
message: "a command is an executable's basename (letters, digits, '.', '_', '+', '-'), never a path"
|
|
4913
5053
|
});
|
|
4914
5054
|
const ExternalCliHint = NonEmptyString3.max(2048);
|
|
4915
|
-
const ExternalCliArguments =
|
|
5055
|
+
const ExternalCliArguments = z16.array(ExternalCliArgument).max(64);
|
|
4916
5056
|
const SignedOutMarker = ExternalCliArgument.refine((value) => value.trim() !== "", { message: "a signed-out marker needs text beyond whitespace" });
|
|
4917
|
-
const PluginExternalCliConnect2 =
|
|
5057
|
+
const PluginExternalCliConnect2 = z16.strictObject({
|
|
4918
5058
|
/** A basename the host finds on `PATH` (`osascript`, `wrangler`), never a path. */
|
|
4919
5059
|
binary: ExternalCliCommand,
|
|
4920
|
-
probe:
|
|
5060
|
+
probe: z16.strictObject({
|
|
4921
5061
|
args: ExternalCliArguments.min(1),
|
|
4922
|
-
timeoutMs:
|
|
5062
|
+
timeoutMs: z16.number().int().min(1).max(12e4).optional(),
|
|
4923
5063
|
/**
|
|
4924
5064
|
* The CLI's own signed-out marker: text a failed probe's output (stderr, else stdout) contains
|
|
4925
5065
|
* when the CLI is signed out. A failure that carries it is a sign-in problem, and only such a
|
|
@@ -4927,13 +5067,13 @@ function createManifestSchemas(canonical) {
|
|
|
4927
5067
|
* unavailable. Required when `login` is declared, so a timeout never starts a sign-in. A list
|
|
4928
5068
|
* is for a CLI with several signed-out messages; any one of them counts.
|
|
4929
5069
|
*/
|
|
4930
|
-
signedOutMarker:
|
|
5070
|
+
signedOutMarker: z16.union([SignedOutMarker, z16.array(SignedOutMarker).min(1)]).optional()
|
|
4931
5071
|
}),
|
|
4932
5072
|
/** The CLI's interactive sign-in. Absent: connect only probes and reports. */
|
|
4933
|
-
login:
|
|
5073
|
+
login: z16.strictObject({
|
|
4934
5074
|
args: ExternalCliArguments.min(1),
|
|
4935
|
-
timeoutMs:
|
|
4936
|
-
pasteCode:
|
|
5075
|
+
timeoutMs: z16.number().int().min(1).max(6e5).optional(),
|
|
5076
|
+
pasteCode: z16.strictObject({
|
|
4937
5077
|
/** The redeeming argv; the host appends the code as its last argument. */
|
|
4938
5078
|
args: ExternalCliArguments.min(1),
|
|
4939
5079
|
/** What the prompt says, for a person. */
|
|
@@ -4945,12 +5085,12 @@ function createManifestSchemas(canonical) {
|
|
|
4945
5085
|
* for display, or hands it to an agent session that runs it behind the ordinary bash approval.
|
|
4946
5086
|
* Absent for a binary the OS ships (`osascript`).
|
|
4947
5087
|
*/
|
|
4948
|
-
install:
|
|
5088
|
+
install: z16.strictObject({
|
|
4949
5089
|
command: ExternalCliCommand,
|
|
4950
5090
|
args: ExternalCliArguments
|
|
4951
5091
|
}).optional(),
|
|
4952
5092
|
/** Prose for a person: `install` when the binary is missing, `login` when the probe fails. */
|
|
4953
|
-
hints:
|
|
5093
|
+
hints: z16.strictObject({
|
|
4954
5094
|
install: ExternalCliHint,
|
|
4955
5095
|
login: ExternalCliHint
|
|
4956
5096
|
})
|
|
@@ -4963,50 +5103,50 @@ function createManifestSchemas(canonical) {
|
|
|
4963
5103
|
});
|
|
4964
5104
|
}
|
|
4965
5105
|
});
|
|
4966
|
-
const PluginAuthSchemeExternalCli =
|
|
5106
|
+
const PluginAuthSchemeExternalCli = z16.strictObject({
|
|
4967
5107
|
...PluginAuthSchemeDescriptionFields,
|
|
4968
5108
|
localId: LocalContributionId2,
|
|
4969
|
-
kind:
|
|
4970
|
-
scopes:
|
|
5109
|
+
kind: z16.literal("external-cli"),
|
|
5110
|
+
scopes: z16.array(NonEmptyString3).optional(),
|
|
4971
5111
|
cli: PluginExternalCliConnect2.optional()
|
|
4972
5112
|
});
|
|
4973
|
-
const PluginAuthScheme2 =
|
|
5113
|
+
const PluginAuthScheme2 = z16.discriminatedUnion("kind", [
|
|
4974
5114
|
PluginAuthSchemeOAuth2,
|
|
4975
5115
|
PluginAuthSchemeApiKey,
|
|
4976
5116
|
PluginAuthSchemeDelegated,
|
|
4977
5117
|
PluginAuthSchemeExternalCli
|
|
4978
5118
|
]);
|
|
4979
|
-
const PluginWebSessionProbe2 =
|
|
5119
|
+
const PluginWebSessionProbe2 = z16.strictObject({
|
|
4980
5120
|
url: HttpsUrl2,
|
|
4981
5121
|
/** Absent => `GET`. `POST` sends an empty JSON object body. */
|
|
4982
|
-
method:
|
|
4983
|
-
signedInStatuses:
|
|
5122
|
+
method: z16.enum(["GET", "POST"]).optional(),
|
|
5123
|
+
signedInStatuses: z16.array(SignedInStatusCode2).min(1)
|
|
4984
5124
|
});
|
|
4985
|
-
const PluginWebSessionDeclaration2 =
|
|
5125
|
+
const PluginWebSessionDeclaration2 = z16.strictObject({
|
|
4986
5126
|
/** `required`: capabilities degrade without the site login; `recommended`: it only smooths UX. */
|
|
4987
|
-
importance:
|
|
5127
|
+
importance: z16.enum(["required", "recommended"]),
|
|
4988
5128
|
loginUrl: HttpsUrl2,
|
|
4989
|
-
cookieDomains:
|
|
5129
|
+
cookieDomains: z16.array(RegistrableDomain2).min(1),
|
|
4990
5130
|
probe: PluginWebSessionProbe2,
|
|
4991
|
-
oauthVenue:
|
|
5131
|
+
oauthVenue: z16.enum(["embedded", "external"]),
|
|
4992
5132
|
/**
|
|
4993
5133
|
* Where a page goes first when it opens in one of Bonsai's browser panes and this site login
|
|
4994
5134
|
* is missing: a sign-in page that continues to the page. A template with `:email` and `:url`
|
|
4995
5135
|
* (see `UriClaimTemplate`), on a host within `cookieDomains`.
|
|
4996
5136
|
*/
|
|
4997
|
-
signInFirst:
|
|
5137
|
+
signInFirst: z16.string().optional()
|
|
4998
5138
|
}).superRefine(refineWebSessionScopeConfined);
|
|
4999
|
-
const PluginAuthService2 =
|
|
5139
|
+
const PluginAuthService2 = z16.strictObject({
|
|
5000
5140
|
localId: LocalContributionId2,
|
|
5001
5141
|
displayName: NonEmptyString3,
|
|
5002
5142
|
/** One plain sentence on what connecting this service gives Bonsai. */
|
|
5003
5143
|
summary: NonEmptyString3.optional(),
|
|
5004
|
-
schemes:
|
|
5005
|
-
purposes:
|
|
5144
|
+
schemes: z16.array(PluginAuthScheme2).min(1),
|
|
5145
|
+
purposes: z16.array(NonEmptyString3).min(1),
|
|
5006
5146
|
webSession: PluginWebSessionDeclaration2.optional()
|
|
5007
5147
|
});
|
|
5008
|
-
const PluginAuthManifest2 =
|
|
5009
|
-
services:
|
|
5148
|
+
const PluginAuthManifest2 = z16.strictObject({
|
|
5149
|
+
services: z16.array(PluginAuthService2).optional()
|
|
5010
5150
|
});
|
|
5011
5151
|
function stripRetiredCompatibilityKeys(value) {
|
|
5012
5152
|
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
@@ -5017,17 +5157,17 @@ function createManifestSchemas(canonical) {
|
|
|
5017
5157
|
delete remaining[key];
|
|
5018
5158
|
return remaining;
|
|
5019
5159
|
}
|
|
5020
|
-
const PluginCompatibilityFields =
|
|
5021
|
-
supportedProtocols:
|
|
5160
|
+
const PluginCompatibilityFields = z16.strictObject({
|
|
5161
|
+
supportedProtocols: z16.array(KayPluginProtocolVersion).optional(),
|
|
5022
5162
|
minKayVersion: NonEmptyString3.optional(),
|
|
5023
5163
|
sdk: NonEmptyString3.optional()
|
|
5024
5164
|
});
|
|
5025
|
-
const PluginCompatibilityManifest2 = canonical ? PluginCompatibilityFields :
|
|
5165
|
+
const PluginCompatibilityManifest2 = canonical ? PluginCompatibilityFields : z16.preprocess(stripRetiredCompatibilityKeys, PluginCompatibilityFields);
|
|
5026
5166
|
const KayVersionString2 = NonEmptyString3.regex(SEMVER_PATTERN, {
|
|
5027
5167
|
message: "version must be semver, for example 1.2.3"
|
|
5028
5168
|
});
|
|
5029
|
-
const KayPluginManifestV12 =
|
|
5030
|
-
protocol:
|
|
5169
|
+
const KayPluginManifestV12 = z16.strictObject({
|
|
5170
|
+
protocol: z16.literal(KAY_PLUGIN_PROTOCOL_VERSION),
|
|
5031
5171
|
id: PluginId2,
|
|
5032
5172
|
displayName: NonEmptyString3,
|
|
5033
5173
|
version: KayVersionString2,
|
|
@@ -5055,8 +5195,8 @@ function createManifestSchemas(canonical) {
|
|
|
5055
5195
|
icon: PackageAssetPath2.optional(),
|
|
5056
5196
|
iconDark: PackageAssetPath2.optional(),
|
|
5057
5197
|
namespace: PluginNamespace2.optional(),
|
|
5058
|
-
targets:
|
|
5059
|
-
kay:
|
|
5198
|
+
targets: z16.strictObject({
|
|
5199
|
+
kay: z16.strictObject({
|
|
5060
5200
|
agent: KayAgentTargetManifest2.optional(),
|
|
5061
5201
|
app: KayAppTargetManifest2.optional(),
|
|
5062
5202
|
ui: KayUiTargetManifest2.optional()
|
|
@@ -5064,6 +5204,8 @@ function createManifestSchemas(canonical) {
|
|
|
5064
5204
|
}).optional(),
|
|
5065
5205
|
config: PluginConfigManifest2.optional(),
|
|
5066
5206
|
storage: PluginStorageManifest2.optional(),
|
|
5207
|
+
workloadPurposes: z16.array(PluginWorkloadPurpose).optional(),
|
|
5208
|
+
shellCommands: z16.array(PluginShellCommand).optional(),
|
|
5067
5209
|
auth: PluginAuthManifest2.optional(),
|
|
5068
5210
|
permissions: PluginPermissionManifest2.optional(),
|
|
5069
5211
|
compatibility: PluginCompatibilityManifest2.optional(),
|
|
@@ -5073,17 +5215,36 @@ function createManifestSchemas(canonical) {
|
|
|
5073
5215
|
* schemes then report `ownedByBonsai`. Honoured only for a plugin that ships with Bonsai: the
|
|
5074
5216
|
* host reads any other plugin's flag as false. Absent => false.
|
|
5075
5217
|
*/
|
|
5076
|
-
ownedByBonsai:
|
|
5218
|
+
ownedByBonsai: z16.boolean().optional(),
|
|
5077
5219
|
/**
|
|
5078
5220
|
* Explicit plugin-level dependencies - other plugins this plugin requires to be present in the
|
|
5079
5221
|
* composed roster. At composition time the runtime checks each id against the accepted
|
|
5080
5222
|
* registration list and derives a provenance-complete dependency graph (together with implicit
|
|
5081
5223
|
* auth-service edges from `consumesAuthServices`). Absent => no explicit dependencies.
|
|
5082
5224
|
*/
|
|
5083
|
-
dependencies:
|
|
5084
|
-
plugins:
|
|
5225
|
+
dependencies: z16.strictObject({
|
|
5226
|
+
plugins: z16.array(PluginId2).optional()
|
|
5085
5227
|
}).optional()
|
|
5086
5228
|
}).superRefine((manifest, ctx) => {
|
|
5229
|
+
const sharedWith = manifest.storage?.dataDir?.sharedWith;
|
|
5230
|
+
if (sharedWith !== void 0 && (!manifest.storage?.dataDir?.enabled || sharedWith === manifest.id || !manifest.dependencies?.plugins?.includes(sharedWith))) {
|
|
5231
|
+
ctx.addIssue({
|
|
5232
|
+
code: "custom",
|
|
5233
|
+
path: ["storage", "dataDir", "sharedWith"],
|
|
5234
|
+
message: "A shared data directory must name another declared plugin dependency."
|
|
5235
|
+
});
|
|
5236
|
+
}
|
|
5237
|
+
const workloadPurposes = /* @__PURE__ */ new Set();
|
|
5238
|
+
for (const [index, workload] of (manifest.workloadPurposes ?? []).entries()) {
|
|
5239
|
+
if (workloadPurposes.has(workload.purpose)) {
|
|
5240
|
+
ctx.addIssue({
|
|
5241
|
+
code: "custom",
|
|
5242
|
+
path: ["workloadPurposes", index, "purpose"],
|
|
5243
|
+
message: "A workload purpose must be unique within its plugin."
|
|
5244
|
+
});
|
|
5245
|
+
}
|
|
5246
|
+
workloadPurposes.add(workload.purpose);
|
|
5247
|
+
}
|
|
5087
5248
|
const authServices = new Set(manifest.auth?.services?.map((service) => service.localId) ?? []);
|
|
5088
5249
|
const authSchemeIdsByService = new Map((manifest.auth?.services ?? []).map((service) => [
|
|
5089
5250
|
service.localId,
|
|
@@ -5093,6 +5254,33 @@ function createManifestSchemas(canonical) {
|
|
|
5093
5254
|
]))
|
|
5094
5255
|
]));
|
|
5095
5256
|
const endpointIds = new Set(manifest.targets?.kay?.app?.contributes?.endpoints?.map((endpoint) => endpoint.localId) ?? []);
|
|
5257
|
+
const shellNames = /* @__PURE__ */ new Set([
|
|
5258
|
+
"help",
|
|
5259
|
+
"version",
|
|
5260
|
+
"info",
|
|
5261
|
+
"open",
|
|
5262
|
+
"launch",
|
|
5263
|
+
"session"
|
|
5264
|
+
]);
|
|
5265
|
+
for (const [index, command] of (manifest.shellCommands ?? []).entries()) {
|
|
5266
|
+
if (!endpointIds.has(command.endpoint)) {
|
|
5267
|
+
ctx.addIssue({
|
|
5268
|
+
code: "custom",
|
|
5269
|
+
path: ["shellCommands", index, "endpoint"],
|
|
5270
|
+
message: "A shell command must name an endpoint declared by this plugin's app target."
|
|
5271
|
+
});
|
|
5272
|
+
}
|
|
5273
|
+
for (const name of [command.name, ...command.aliases ?? []]) {
|
|
5274
|
+
if (shellNames.has(name)) {
|
|
5275
|
+
ctx.addIssue({
|
|
5276
|
+
code: "custom",
|
|
5277
|
+
path: ["shellCommands", index],
|
|
5278
|
+
message: `Shell command name '${name}' is reserved or already declared.`
|
|
5279
|
+
});
|
|
5280
|
+
}
|
|
5281
|
+
shellNames.add(name);
|
|
5282
|
+
}
|
|
5283
|
+
}
|
|
5096
5284
|
const storageKinds = /* @__PURE__ */ new Set();
|
|
5097
5285
|
if (manifest.storage?.sqlite?.enabled)
|
|
5098
5286
|
storageKinds.add("sqlite");
|
|
@@ -5843,6 +6031,8 @@ function createManifestSchemas(canonical) {
|
|
|
5843
6031
|
"endpoints",
|
|
5844
6032
|
endpointIndex
|
|
5845
6033
|
];
|
|
6034
|
+
if (typeof endpoint !== "string")
|
|
6035
|
+
continue;
|
|
5846
6036
|
if (!endpointIds.has(endpoint)) {
|
|
5847
6037
|
ctx.addIssue({
|
|
5848
6038
|
code: "custom",
|
|
@@ -6143,7 +6333,7 @@ function pushContributionIds(output, path, items) {
|
|
|
6143
6333
|
}
|
|
6144
6334
|
|
|
6145
6335
|
// packages/plugin-protocol/dist/plugin-directory-verdict.js
|
|
6146
|
-
import { z as
|
|
6336
|
+
import { z as z18 } from "zod";
|
|
6147
6337
|
|
|
6148
6338
|
// packages/plugin-protocol/dist/plugin-load-diagnostic.js
|
|
6149
6339
|
var PLUGIN_DIAGNOSTIC_MESSAGE_CAP = 300;
|
|
@@ -6152,14 +6342,14 @@ function boundPluginDiagnosticMessage(message) {
|
|
|
6152
6342
|
}
|
|
6153
6343
|
|
|
6154
6344
|
// packages/plugin-protocol/dist/resolved-contract.js
|
|
6155
|
-
import { z as
|
|
6345
|
+
import { z as z17 } from "zod";
|
|
6156
6346
|
function createResolvedContractSchemas(canonical) {
|
|
6157
6347
|
const { PluginEventLocalId: PluginEventLocalId2 } = canonical ? canonicalPluginEventSchemas : plugin_events_exports;
|
|
6158
6348
|
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;
|
|
6159
6349
|
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;
|
|
6160
6350
|
const { PluginExternalCliConnect: PluginExternalCliConnect2, PluginOAuthClientSupplier: PluginOAuthClientSupplier2 } = canonical ? canonicalManifestSchemas : manifest_exports;
|
|
6161
6351
|
const { ResolvedPluginGrants: ResolvedPluginGrants2 } = canonical ? canonicalPermissionSchemas : permissions_exports;
|
|
6162
|
-
const ResolvedPluginContributionId2 =
|
|
6352
|
+
const ResolvedPluginContributionId2 = z17.strictObject({
|
|
6163
6353
|
target: PluginTargetName,
|
|
6164
6354
|
kind: PluginContributionKindSchema,
|
|
6165
6355
|
localId: PluginEventLocalId2,
|
|
@@ -6173,54 +6363,54 @@ function createResolvedContractSchemas(canonical) {
|
|
|
6173
6363
|
});
|
|
6174
6364
|
}
|
|
6175
6365
|
});
|
|
6176
|
-
const ResolvedKayToolId =
|
|
6366
|
+
const ResolvedKayToolId = z17.strictObject({
|
|
6177
6367
|
localId: LocalContributionId2,
|
|
6178
6368
|
globalId: GlobalContributionId2,
|
|
6179
6369
|
toolName: PluginToolName2
|
|
6180
6370
|
});
|
|
6181
|
-
const ResolvedKayAgentTool2 =
|
|
6371
|
+
const ResolvedKayAgentTool2 = z17.strictObject({
|
|
6182
6372
|
...ResolvedKayToolId.shape,
|
|
6183
6373
|
displayName: NonEmptyString3.optional(),
|
|
6184
6374
|
description: NonEmptyString3.optional(),
|
|
6185
6375
|
parameters: JsonSchema.optional(),
|
|
6186
|
-
executionMode:
|
|
6376
|
+
executionMode: z17.enum(["sequential", "parallel"]).optional(),
|
|
6187
6377
|
promptSnippet: NonEmptyString3.optional(),
|
|
6188
|
-
promptGuidelines:
|
|
6189
|
-
requiresAuth:
|
|
6378
|
+
promptGuidelines: z17.array(NonEmptyString3).optional(),
|
|
6379
|
+
requiresAuth: z17.strictObject({
|
|
6190
6380
|
serviceId: GlobalContributionId2,
|
|
6191
6381
|
schemeId: GlobalContributionId2.optional()
|
|
6192
6382
|
}).optional(),
|
|
6193
6383
|
permission: canonical ? canonicalContributionSchemas.ToolPermission.optional() : ToolPermission.optional()
|
|
6194
6384
|
});
|
|
6195
6385
|
const ResolvedKayAppTool2 = ResolvedKayAgentTool2.omit({ requiresAuth: true });
|
|
6196
|
-
const ResolvedKayAppDataSource2 =
|
|
6386
|
+
const ResolvedKayAppDataSource2 = z17.strictObject({
|
|
6197
6387
|
localId: LocalContributionId2,
|
|
6198
6388
|
globalId: GlobalContributionId2,
|
|
6199
|
-
scope:
|
|
6200
|
-
snapshot:
|
|
6201
|
-
version:
|
|
6202
|
-
schema:
|
|
6389
|
+
scope: z17.enum(["runtime", "account", "session"]),
|
|
6390
|
+
snapshot: z17.strictObject({
|
|
6391
|
+
version: z17.number().int().positive(),
|
|
6392
|
+
schema: z17.record(z17.string(), z17.unknown())
|
|
6203
6393
|
}),
|
|
6204
|
-
change:
|
|
6205
|
-
version:
|
|
6206
|
-
schema:
|
|
6207
|
-
semantics:
|
|
6208
|
-
|
|
6209
|
-
|
|
6210
|
-
kind:
|
|
6211
|
-
maxEncodedBytes:
|
|
6394
|
+
change: z17.strictObject({
|
|
6395
|
+
version: z17.number().int().positive(),
|
|
6396
|
+
schema: z17.record(z17.string(), z17.unknown()),
|
|
6397
|
+
semantics: z17.discriminatedUnion("kind", [
|
|
6398
|
+
z17.strictObject({ kind: z17.literal("incremental") }),
|
|
6399
|
+
z17.strictObject({
|
|
6400
|
+
kind: z17.literal("snapshot-replacement"),
|
|
6401
|
+
maxEncodedBytes: z17.number().int().positive(),
|
|
6212
6402
|
rationale: pluginString(canonical).min(1).max(1024)
|
|
6213
6403
|
})
|
|
6214
6404
|
]).optional()
|
|
6215
6405
|
}),
|
|
6216
6406
|
read: AppDataSourceRead.optional(),
|
|
6217
|
-
store:
|
|
6218
|
-
|
|
6219
|
-
shape:
|
|
6220
|
-
rowsField:
|
|
6221
|
-
key:
|
|
6407
|
+
store: z17.discriminatedUnion("shape", [
|
|
6408
|
+
z17.strictObject({
|
|
6409
|
+
shape: z17.literal("rows"),
|
|
6410
|
+
rowsField: z17.string().min(1),
|
|
6411
|
+
key: z17.array(z17.string().min(1)).min(1)
|
|
6222
6412
|
}),
|
|
6223
|
-
|
|
6413
|
+
z17.strictObject({ shape: z17.literal("value") })
|
|
6224
6414
|
]).optional()
|
|
6225
6415
|
}).superRefine((source, ctx) => {
|
|
6226
6416
|
if (source.read !== void 0 && source.scope !== "session") {
|
|
@@ -6240,127 +6430,127 @@ function createResolvedContractSchemas(canonical) {
|
|
|
6240
6430
|
/** The auth service that module signs in through, whose accounts a card may send from. */
|
|
6241
6431
|
authService: GlobalContributionId2.optional()
|
|
6242
6432
|
});
|
|
6243
|
-
const ResolvedPluginCard2 =
|
|
6433
|
+
const ResolvedPluginCard2 = z17.strictObject({
|
|
6244
6434
|
localId: LocalContributionId2,
|
|
6245
6435
|
globalId: GlobalContributionId2,
|
|
6246
6436
|
pluginId: PluginId2,
|
|
6247
6437
|
description: NonEmptyString3,
|
|
6248
6438
|
inputs: JsonSchema,
|
|
6249
|
-
readEndpoint:
|
|
6439
|
+
readEndpoint: z17.strictObject({
|
|
6250
6440
|
localId: LocalContributionId2,
|
|
6251
6441
|
globalId: GlobalContributionId2
|
|
6252
6442
|
}),
|
|
6253
|
-
submitEndpoint:
|
|
6443
|
+
submitEndpoint: z17.strictObject({
|
|
6254
6444
|
localId: LocalContributionId2,
|
|
6255
6445
|
globalId: GlobalContributionId2
|
|
6256
6446
|
}),
|
|
6257
6447
|
authService: GlobalContributionId2.optional()
|
|
6258
6448
|
});
|
|
6259
|
-
const ResolvedKayAppWorkflow2 =
|
|
6449
|
+
const ResolvedKayAppWorkflow2 = z17.strictObject({
|
|
6260
6450
|
localId: LocalContributionId2,
|
|
6261
6451
|
globalId: GlobalContributionId2,
|
|
6262
6452
|
name: NonEmptyString3,
|
|
6263
6453
|
description: NonEmptyString3,
|
|
6264
|
-
everyMs:
|
|
6265
|
-
auth:
|
|
6454
|
+
everyMs: z17.number().int().positive(),
|
|
6455
|
+
auth: z17.strictObject({
|
|
6266
6456
|
serviceId: GlobalContributionId2,
|
|
6267
6457
|
schemeId: GlobalContributionId2,
|
|
6268
|
-
scopes:
|
|
6458
|
+
scopes: z17.array(NonEmptyString3).min(1).optional()
|
|
6269
6459
|
}).optional()
|
|
6270
6460
|
});
|
|
6271
|
-
const ResolvedKayAppWhiteboardType2 =
|
|
6461
|
+
const ResolvedKayAppWhiteboardType2 = z17.strictObject({
|
|
6272
6462
|
localId: LocalContributionId2,
|
|
6273
6463
|
globalId: GlobalContributionId2,
|
|
6274
6464
|
displayName: NonEmptyString3,
|
|
6275
|
-
schemaVersion:
|
|
6465
|
+
schemaVersion: z17.number().int().positive(),
|
|
6276
6466
|
storage: WhiteboardTypeStorage2,
|
|
6277
6467
|
valueSchema: JsonSchema
|
|
6278
6468
|
});
|
|
6279
|
-
const ResolvedKayAppMcpServer2 =
|
|
6469
|
+
const ResolvedKayAppMcpServer2 = z17.strictObject({
|
|
6280
6470
|
name: LocalContributionId2,
|
|
6281
6471
|
pluginId: PluginId2,
|
|
6282
6472
|
url: McpServerUrl2,
|
|
6283
6473
|
auth: McpServerAuthMode2,
|
|
6284
6474
|
authServiceId: GlobalContributionId2.optional()
|
|
6285
6475
|
});
|
|
6286
|
-
const ResolvedKayAgentUriModule2 =
|
|
6476
|
+
const ResolvedKayAgentUriModule2 = z17.strictObject({
|
|
6287
6477
|
localId: LocalContributionId2,
|
|
6288
6478
|
globalId: GlobalContributionId2,
|
|
6289
|
-
schemes:
|
|
6479
|
+
schemes: z17.array(UriScheme2).min(1),
|
|
6290
6480
|
displayName: NonEmptyString3.optional(),
|
|
6291
6481
|
authServiceId: GlobalContributionId2.optional(),
|
|
6292
6482
|
/** Mirrors `UriModuleContribution.authScheme`; a local ref takes the plugin's namespace. */
|
|
6293
6483
|
authSchemeId: GlobalContributionId2.optional(),
|
|
6294
6484
|
/** Mirrors `UriModuleContribution.knownResources` (host-side recording opt-in). */
|
|
6295
|
-
knownResources:
|
|
6485
|
+
knownResources: z17.literal(true).optional(),
|
|
6296
6486
|
/** Mirrors `UriModuleContribution.describesOperations`. */
|
|
6297
|
-
describesOperations:
|
|
6487
|
+
describesOperations: z17.literal(true).optional(),
|
|
6298
6488
|
/** Mirrors `UriModuleContribution.looksUpWebLinks`. */
|
|
6299
|
-
looksUpWebLinks:
|
|
6489
|
+
looksUpWebLinks: z17.literal(true).optional(),
|
|
6300
6490
|
...UriModuleFacts2.shape
|
|
6301
6491
|
});
|
|
6302
|
-
const ResolvedKayAgentArtifactUriModule2 =
|
|
6492
|
+
const ResolvedKayAgentArtifactUriModule2 = z17.strictObject({
|
|
6303
6493
|
localId: LocalContributionId2,
|
|
6304
6494
|
globalId: GlobalContributionId2,
|
|
6305
6495
|
scheme: UriScheme2,
|
|
6306
|
-
editable:
|
|
6307
|
-
listable:
|
|
6308
|
-
deletable:
|
|
6309
|
-
appendable:
|
|
6310
|
-
storageScope:
|
|
6496
|
+
editable: z17.boolean(),
|
|
6497
|
+
listable: z17.boolean(),
|
|
6498
|
+
deletable: z17.boolean(),
|
|
6499
|
+
appendable: z17.boolean(),
|
|
6500
|
+
storageScope: z17.enum(["session", "family"])
|
|
6311
6501
|
});
|
|
6312
|
-
const ResolvedKayAgentEntityResolver2 =
|
|
6502
|
+
const ResolvedKayAgentEntityResolver2 = z17.strictObject({
|
|
6313
6503
|
localId: LocalContributionId2,
|
|
6314
6504
|
globalId: GlobalContributionId2,
|
|
6315
6505
|
displayName: NonEmptyString3.optional(),
|
|
6316
6506
|
uriModule: GlobalContributionId2,
|
|
6317
|
-
entityTypes:
|
|
6507
|
+
entityTypes: z17.array(NonEmptyString3).min(1),
|
|
6318
6508
|
uriHint: NonEmptyString3
|
|
6319
6509
|
});
|
|
6320
|
-
const ResolvedKayAgentGitHostClaim2 =
|
|
6510
|
+
const ResolvedKayAgentGitHostClaim2 = z17.strictObject({
|
|
6321
6511
|
host: GitHostName2,
|
|
6322
6512
|
authServiceId: GlobalContributionId2,
|
|
6323
6513
|
/** Manifest-declared order; the clone ladder tries them in sequence. */
|
|
6324
|
-
authSchemeIds:
|
|
6514
|
+
authSchemeIds: z17.array(GlobalContributionId2).min(1),
|
|
6325
6515
|
/** Non-secret display copy for the claiming service, for clone failure text. */
|
|
6326
|
-
authServiceDisplayName:
|
|
6516
|
+
authServiceDisplayName: z17.string(),
|
|
6327
6517
|
basicAuthUser: GitBasicAuthUser2
|
|
6328
6518
|
});
|
|
6329
|
-
const ResolvedKayAgentConverter2 =
|
|
6519
|
+
const ResolvedKayAgentConverter2 = z17.strictObject({
|
|
6330
6520
|
localId: LocalContributionId2,
|
|
6331
6521
|
globalId: GlobalContributionId2,
|
|
6332
6522
|
description: NonEmptyString3.optional(),
|
|
6333
|
-
mimeTypes:
|
|
6334
|
-
extensions:
|
|
6523
|
+
mimeTypes: z17.array(MimeTypeString2).min(1),
|
|
6524
|
+
extensions: z17.array(FileExtensionToken2).min(1).optional()
|
|
6335
6525
|
});
|
|
6336
6526
|
const ResolvedReferencePresentationUrlClaim = ReferencePresentationUrlClaim2.extend({
|
|
6337
|
-
brandIcon:
|
|
6527
|
+
brandIcon: z17.string().max(64 * 1024).optional()
|
|
6338
6528
|
});
|
|
6339
|
-
const ResolvedReferencePresentation2 =
|
|
6529
|
+
const ResolvedReferencePresentation2 = z17.strictObject({
|
|
6340
6530
|
localId: LocalContributionId2,
|
|
6341
6531
|
globalId: GlobalContributionId2,
|
|
6342
6532
|
uriModule: GlobalContributionId2.optional(),
|
|
6343
6533
|
/** The schemes this presentation is about: its `scheme`, or its module's. */
|
|
6344
|
-
schemes:
|
|
6534
|
+
schemes: z17.array(UriScheme2).min(1).optional(),
|
|
6345
6535
|
/** The module's `displayName`: the source's name in a row. */
|
|
6346
6536
|
displayName: NonEmptyString3.optional(),
|
|
6347
6537
|
/** The module's auth service, qualified: whose accounts `accountLinks` reads. */
|
|
6348
6538
|
authService: GlobalContributionId2.optional(),
|
|
6349
6539
|
accountLinks: ReferencePresentationAccountLinks2.optional(),
|
|
6350
|
-
addresses:
|
|
6540
|
+
addresses: z17.array(ReferencePresentationAddress2).min(1).optional(),
|
|
6351
6541
|
/** Comes with `open`. A presentation with neither only words its module's addresses. */
|
|
6352
6542
|
resourceKind: NonEmptyString3.optional(),
|
|
6353
6543
|
open: ReferenceOpenBehavior2.optional(),
|
|
6354
6544
|
/** MIME-specific resource kinds; absent keys use the base presentation. */
|
|
6355
6545
|
variants: ReferencePresentationVariants2.optional(),
|
|
6356
|
-
claims:
|
|
6357
|
-
tooltip:
|
|
6546
|
+
claims: z17.array(ResolvedReferencePresentationUrlClaim).optional(),
|
|
6547
|
+
tooltip: z17.strictObject({
|
|
6358
6548
|
app: GlobalContributionId2,
|
|
6359
6549
|
pattern: ReferencePresentationUriPattern2
|
|
6360
6550
|
}).optional(),
|
|
6361
6551
|
words: ReferencePresentationWords2.optional()
|
|
6362
6552
|
});
|
|
6363
|
-
const ResolvedPluginProvisioningRequirement2 =
|
|
6553
|
+
const ResolvedPluginProvisioningRequirement2 = z17.strictObject({
|
|
6364
6554
|
id: LocalContributionId2,
|
|
6365
6555
|
displayName: NonEmptyString3,
|
|
6366
6556
|
description: NonEmptyString3,
|
|
@@ -6370,15 +6560,15 @@ function createResolvedContractSchemas(canonical) {
|
|
|
6370
6560
|
* URL degrades to "Reconnect" in the UI instead of a broken link.
|
|
6371
6561
|
*/
|
|
6372
6562
|
remediationUrl: HttpsUrl2.optional(),
|
|
6373
|
-
probe:
|
|
6563
|
+
probe: z17.strictObject({
|
|
6374
6564
|
url: HttpsUrl2,
|
|
6375
|
-
method:
|
|
6376
|
-
verdictStatuses:
|
|
6565
|
+
method: z17.enum(["GET"]),
|
|
6566
|
+
verdictStatuses: z17.array(SignedInStatusCode2).min(1),
|
|
6377
6567
|
nonEmptyArrayAt: NonEmptyString3.optional()
|
|
6378
6568
|
})
|
|
6379
6569
|
});
|
|
6380
6570
|
const ResolvedProvisioningField = {
|
|
6381
|
-
provisioning:
|
|
6571
|
+
provisioning: z17.array(ResolvedPluginProvisioningRequirement2).optional()
|
|
6382
6572
|
};
|
|
6383
6573
|
const ResolvedPluginAuthSchemeDescriptionFields = {
|
|
6384
6574
|
displayName: NonEmptyString3.optional(),
|
|
@@ -6390,114 +6580,118 @@ function createResolvedContractSchemas(canonical) {
|
|
|
6390
6580
|
...ResolvedPluginAuthSchemeDescriptionFields,
|
|
6391
6581
|
localId: LocalContributionId2,
|
|
6392
6582
|
globalId: GlobalContributionId2,
|
|
6393
|
-
kind:
|
|
6394
|
-
scopes:
|
|
6583
|
+
kind: z17.literal("oauth2"),
|
|
6584
|
+
scopes: z17.array(z17.string()).optional(),
|
|
6395
6585
|
authorizationUrl: HttpsUrl2,
|
|
6396
6586
|
tokenUrl: HttpsUrl2,
|
|
6397
|
-
extraAuthorizeParams:
|
|
6587
|
+
extraAuthorizeParams: z17.record(z17.string(), z17.string()).optional()
|
|
6398
6588
|
};
|
|
6399
|
-
const ResolvedPluginAuthSchemeOAuthPkce =
|
|
6589
|
+
const ResolvedPluginAuthSchemeOAuthPkce = z17.strictObject({
|
|
6400
6590
|
...ResolvedPluginAuthSchemeOAuthBase,
|
|
6401
|
-
exchange:
|
|
6402
|
-
|
|
6591
|
+
exchange: z17.literal("pkce"),
|
|
6592
|
+
byoocProfile: PluginByoocProfile.optional(),
|
|
6593
|
+
clientSuppliers: z17.array(PluginOAuthClientSupplier2).nonempty(),
|
|
6403
6594
|
clientId: NonEmptyString3.optional(),
|
|
6404
6595
|
clientSecret: NonEmptyString3.optional(),
|
|
6405
|
-
account:
|
|
6596
|
+
account: z17.literal("lookup").optional()
|
|
6406
6597
|
});
|
|
6407
|
-
const ResolvedPluginAuthSchemeOAuthConfidential =
|
|
6598
|
+
const ResolvedPluginAuthSchemeOAuthConfidential = z17.strictObject({
|
|
6408
6599
|
...ResolvedPluginAuthSchemeOAuthBase,
|
|
6409
|
-
exchange:
|
|
6410
|
-
clientSuppliers:
|
|
6411
|
-
account:
|
|
6600
|
+
exchange: z17.literal("confidential"),
|
|
6601
|
+
clientSuppliers: z17.tuple([z17.literal("kay")]),
|
|
6602
|
+
account: z17.enum(["lookup", "sign-in"])
|
|
6412
6603
|
});
|
|
6413
|
-
const ResolvedPluginAuthSchemeOAuth2 =
|
|
6604
|
+
const ResolvedPluginAuthSchemeOAuth2 = z17.discriminatedUnion("exchange", [
|
|
6414
6605
|
ResolvedPluginAuthSchemeOAuthPkce,
|
|
6415
6606
|
ResolvedPluginAuthSchemeOAuthConfidential
|
|
6416
6607
|
]);
|
|
6417
|
-
const ResolvedPluginAuthSchemeApiKey =
|
|
6608
|
+
const ResolvedPluginAuthSchemeApiKey = z17.strictObject({
|
|
6418
6609
|
...ResolvedProvisioningField,
|
|
6419
6610
|
...ResolvedPluginAuthSchemeDescriptionFields,
|
|
6420
6611
|
localId: LocalContributionId2,
|
|
6421
6612
|
globalId: GlobalContributionId2,
|
|
6422
|
-
kind:
|
|
6423
|
-
scopes:
|
|
6613
|
+
kind: z17.literal("api-key"),
|
|
6614
|
+
scopes: z17.array(z17.string()).optional(),
|
|
6424
6615
|
/** Resolution applies the manifest's default, "<service name> API key". */
|
|
6425
6616
|
inputLabel: NonEmptyString3,
|
|
6426
|
-
fields:
|
|
6427
|
-
setup:
|
|
6428
|
-
account:
|
|
6617
|
+
fields: z17.array(z17.strictObject({ id: z17.string(), label: z17.string() })).optional(),
|
|
6618
|
+
setup: z17.strictObject({ instructions: z17.string(), url: HttpsUrl2 }).optional(),
|
|
6619
|
+
account: z17.literal("lookup").optional()
|
|
6429
6620
|
});
|
|
6430
|
-
const ResolvedPluginAuthSchemeDelegated =
|
|
6621
|
+
const ResolvedPluginAuthSchemeDelegated = z17.strictObject({
|
|
6431
6622
|
...ResolvedPluginAuthSchemeDescriptionFields,
|
|
6432
6623
|
localId: LocalContributionId2,
|
|
6433
6624
|
globalId: GlobalContributionId2,
|
|
6434
|
-
kind:
|
|
6435
|
-
scopes:
|
|
6625
|
+
kind: z17.literal("delegated"),
|
|
6626
|
+
scopes: z17.array(z17.string()).optional()
|
|
6436
6627
|
});
|
|
6437
|
-
const ResolvedPluginAuthSchemeExternalCli =
|
|
6628
|
+
const ResolvedPluginAuthSchemeExternalCli = z17.strictObject({
|
|
6438
6629
|
...ResolvedPluginAuthSchemeDescriptionFields,
|
|
6439
6630
|
localId: LocalContributionId2,
|
|
6440
6631
|
globalId: GlobalContributionId2,
|
|
6441
|
-
kind:
|
|
6442
|
-
scopes:
|
|
6632
|
+
kind: z17.literal("external-cli"),
|
|
6633
|
+
scopes: z17.array(z17.string()).optional(),
|
|
6443
6634
|
/** The manifest's connect facts, verbatim. */
|
|
6444
6635
|
cli: PluginExternalCliConnect2.optional()
|
|
6445
6636
|
});
|
|
6446
|
-
const ResolvedPluginAuthScheme2 =
|
|
6637
|
+
const ResolvedPluginAuthScheme2 = z17.discriminatedUnion("kind", [
|
|
6447
6638
|
ResolvedPluginAuthSchemeOAuth2,
|
|
6448
6639
|
ResolvedPluginAuthSchemeApiKey,
|
|
6449
6640
|
ResolvedPluginAuthSchemeDelegated,
|
|
6450
6641
|
ResolvedPluginAuthSchemeExternalCli
|
|
6451
6642
|
]);
|
|
6452
|
-
const ResolvedPluginWebSession2 =
|
|
6453
|
-
importance:
|
|
6643
|
+
const ResolvedPluginWebSession2 = z17.strictObject({
|
|
6644
|
+
importance: z17.enum(["required", "recommended"]),
|
|
6454
6645
|
loginUrl: HttpsUrl2,
|
|
6455
|
-
cookieDomains:
|
|
6456
|
-
probe:
|
|
6646
|
+
cookieDomains: z17.array(RegistrableDomain2).min(1),
|
|
6647
|
+
probe: z17.strictObject({
|
|
6457
6648
|
url: HttpsUrl2,
|
|
6458
|
-
method:
|
|
6459
|
-
signedInStatuses:
|
|
6649
|
+
method: z17.enum(["GET", "POST"]),
|
|
6650
|
+
signedInStatuses: z17.array(SignedInStatusCode2).min(1)
|
|
6460
6651
|
}),
|
|
6461
|
-
oauthVenue:
|
|
6462
|
-
signInFirst:
|
|
6652
|
+
oauthVenue: z17.enum(["embedded", "external"]),
|
|
6653
|
+
signInFirst: z17.string().optional()
|
|
6463
6654
|
}).superRefine(refineWebSessionScopeConfined);
|
|
6464
|
-
const ResolvedPluginAuthService2 =
|
|
6655
|
+
const ResolvedPluginAuthService2 = z17.strictObject({
|
|
6465
6656
|
localId: LocalContributionId2,
|
|
6466
6657
|
globalId: GlobalContributionId2,
|
|
6467
|
-
displayName:
|
|
6468
|
-
summary:
|
|
6469
|
-
schemes:
|
|
6470
|
-
purposes:
|
|
6658
|
+
displayName: z17.string(),
|
|
6659
|
+
summary: z17.string().optional(),
|
|
6660
|
+
schemes: z17.array(ResolvedPluginAuthScheme2).min(1),
|
|
6661
|
+
purposes: z17.array(z17.string()).min(1),
|
|
6471
6662
|
/** The service's browser half, when the manifest declares one. */
|
|
6472
6663
|
webSession: ResolvedPluginWebSession2.optional()
|
|
6473
6664
|
});
|
|
6474
|
-
const ResolvedKayUiAppEndpointCapability2 =
|
|
6475
|
-
|
|
6476
|
-
|
|
6477
|
-
|
|
6478
|
-
|
|
6665
|
+
const ResolvedKayUiAppEndpointCapability2 = z17.union([
|
|
6666
|
+
z17.strictObject({
|
|
6667
|
+
localId: LocalContributionId2,
|
|
6668
|
+
globalId: GlobalContributionId2
|
|
6669
|
+
}),
|
|
6670
|
+
z17.strictObject({ pluginId: PluginId2, localId: LocalContributionId2 })
|
|
6671
|
+
]);
|
|
6672
|
+
const ResolvedKayUiApp2 = z17.strictObject({
|
|
6479
6673
|
localId: LocalContributionId2,
|
|
6480
6674
|
globalId: GlobalContributionId2,
|
|
6481
6675
|
displayName: NonEmptyString3,
|
|
6482
|
-
contextOnly:
|
|
6676
|
+
contextOnly: z17.literal(true).optional(),
|
|
6483
6677
|
description: NonEmptyString3.optional(),
|
|
6484
6678
|
icon: PackageAssetPath2.optional(),
|
|
6485
|
-
runtime:
|
|
6486
|
-
sdk:
|
|
6679
|
+
runtime: z17.literal("kay.react-app.v1"),
|
|
6680
|
+
sdk: z17.strictObject({ range: NonEmptyString3 }),
|
|
6487
6681
|
entrypoint: TargetEntrypoint2,
|
|
6488
|
-
styles:
|
|
6489
|
-
assets:
|
|
6490
|
-
capabilities:
|
|
6491
|
-
endpoints:
|
|
6492
|
-
host:
|
|
6493
|
-
feeds:
|
|
6682
|
+
styles: z17.array(PackageAssetPath2).optional(),
|
|
6683
|
+
assets: z17.array(PackageAssetPath2).optional(),
|
|
6684
|
+
capabilities: z17.strictObject({
|
|
6685
|
+
endpoints: z17.array(ResolvedKayUiAppEndpointCapability2).optional(),
|
|
6686
|
+
host: z17.array(KayUiAppHostCapability2).optional(),
|
|
6687
|
+
feeds: z17.array((canonical ? canonicalContributionSchemas : contributions_exports).UiAppCapabilityReference).optional()
|
|
6494
6688
|
}).optional()
|
|
6495
6689
|
});
|
|
6496
|
-
const ResolvedPluginContractV12 =
|
|
6497
|
-
protocol:
|
|
6690
|
+
const ResolvedPluginContractV12 = z17.strictObject({
|
|
6691
|
+
protocol: z17.literal("kay.plugin.v1"),
|
|
6498
6692
|
pluginId: PluginId2,
|
|
6499
6693
|
namespace: PluginNamespace2,
|
|
6500
|
-
contributions:
|
|
6694
|
+
contributions: z17.array(ResolvedPluginContributionId2),
|
|
6501
6695
|
// The deduplicated set of qualified (dotted) external auth-service ids this
|
|
6502
6696
|
// plugin references, from agent uriModule, tool and cliBinding
|
|
6503
6697
|
// `authService` refs, card sign-in refs, and auth-grant `service` refs. Always present - a plugin
|
|
@@ -6505,33 +6699,38 @@ function createResolvedContractSchemas(canonical) {
|
|
|
6505
6699
|
// is a recorded dependency, not a resolution: there is no runtime plugin
|
|
6506
6700
|
// loader in v1, so nothing here verifies the reference resolves within a
|
|
6507
6701
|
// composed roster (a composition-time concern owned elsewhere).
|
|
6508
|
-
consumesAuthServices:
|
|
6702
|
+
consumesAuthServices: z17.array(GlobalContributionId2),
|
|
6509
6703
|
// The explicit plugin-level dependency ids declared in `dependencies.plugins` on the manifest,
|
|
6510
6704
|
// deduped and validated at parse time. Always present; a plugin with no explicit dependencies
|
|
6511
6705
|
// carries an empty array. Composition checks each id against the accepted roster and derives the
|
|
6512
6706
|
// full dependency graph together with auth-inferred edges from `consumesAuthServices`.
|
|
6513
|
-
explicitDependencies:
|
|
6707
|
+
explicitDependencies: z17.array(PluginId2),
|
|
6708
|
+
dataDirSharedWith: PluginId2.optional(),
|
|
6709
|
+
workloadPurposes: z17.array(PluginWorkloadPurpose).optional(),
|
|
6710
|
+
shellCommands: z17.array(PluginShellCommand.omit({ endpoint: true }).extend({
|
|
6711
|
+
endpointId: GlobalContributionId2
|
|
6712
|
+
})).optional(),
|
|
6514
6713
|
// The auth services this plugin OWNS, carrying the global ids its harness
|
|
6515
6714
|
// target must register and the credential authority keys on. Always present;
|
|
6516
6715
|
// a plugin that declares no `auth.services` carries an empty array. The dual
|
|
6517
6716
|
// of `consumesAuthServices` (services it merely references).
|
|
6518
|
-
authServices:
|
|
6717
|
+
authServices: z17.array(ResolvedPluginAuthService2),
|
|
6519
6718
|
grants: ResolvedPluginGrants2.optional(),
|
|
6520
|
-
kayAgentUriModules:
|
|
6521
|
-
kayAgentArtifactUriModules:
|
|
6522
|
-
kayAgentEntityResolvers:
|
|
6523
|
-
kayAgentGitHostClaims:
|
|
6524
|
-
kayAgentTools:
|
|
6525
|
-
kayAppTools:
|
|
6526
|
-
kayAppApprovalTypes:
|
|
6527
|
-
kayAppWorkflows:
|
|
6528
|
-
kayAppCards:
|
|
6529
|
-
kayAppDataSources:
|
|
6530
|
-
kayAppWhiteboardTypes:
|
|
6531
|
-
kayAppMcpServers:
|
|
6532
|
-
kayAgentConverters:
|
|
6533
|
-
referencePresentations:
|
|
6534
|
-
kayUiApps:
|
|
6719
|
+
kayAgentUriModules: z17.array(ResolvedKayAgentUriModule2).optional(),
|
|
6720
|
+
kayAgentArtifactUriModules: z17.array(ResolvedKayAgentArtifactUriModule2).optional(),
|
|
6721
|
+
kayAgentEntityResolvers: z17.array(ResolvedKayAgentEntityResolver2).optional(),
|
|
6722
|
+
kayAgentGitHostClaims: z17.array(ResolvedKayAgentGitHostClaim2).optional(),
|
|
6723
|
+
kayAgentTools: z17.array(ResolvedKayAgentTool2).optional(),
|
|
6724
|
+
kayAppTools: z17.array(ResolvedKayAppTool2).optional(),
|
|
6725
|
+
kayAppApprovalTypes: z17.array(ResolvedKayAppApprovalType2).optional(),
|
|
6726
|
+
kayAppWorkflows: z17.array(ResolvedKayAppWorkflow2).optional(),
|
|
6727
|
+
kayAppCards: z17.array(ResolvedPluginCard2).optional(),
|
|
6728
|
+
kayAppDataSources: z17.array(ResolvedKayAppDataSource2).optional(),
|
|
6729
|
+
kayAppWhiteboardTypes: z17.array(ResolvedKayAppWhiteboardType2).optional(),
|
|
6730
|
+
kayAppMcpServers: z17.array(ResolvedKayAppMcpServer2).optional(),
|
|
6731
|
+
kayAgentConverters: z17.array(ResolvedKayAgentConverter2).optional(),
|
|
6732
|
+
referencePresentations: z17.array(ResolvedReferencePresentation2).optional(),
|
|
6733
|
+
kayUiApps: z17.array(ResolvedKayUiApp2).optional()
|
|
6535
6734
|
});
|
|
6536
6735
|
return {
|
|
6537
6736
|
ResolvedPluginContributionId: ResolvedPluginContributionId2,
|
|
@@ -6769,6 +6968,7 @@ function resolveAuthServices(namespace, manifest) {
|
|
|
6769
6968
|
kind: "oauth2",
|
|
6770
6969
|
exchange: "pkce",
|
|
6771
6970
|
clientSuppliers: scheme.clientSuppliers,
|
|
6971
|
+
...scheme.byoocProfile === void 0 ? {} : { byoocProfile: scheme.byoocProfile },
|
|
6772
6972
|
...scheme.clientId === void 0 ? {} : { clientId: scheme.clientId },
|
|
6773
6973
|
...scheme.clientSecret === void 0 ? {} : { clientSecret: scheme.clientSecret },
|
|
6774
6974
|
...scheme.account === void 0 ? {} : { account: scheme.account },
|
|
@@ -7037,10 +7237,10 @@ function resolveKayPluginContractV1(manifest) {
|
|
|
7037
7237
|
...app.capabilities === void 0 ? {} : {
|
|
7038
7238
|
capabilities: {
|
|
7039
7239
|
...app.capabilities.endpoints === void 0 ? {} : {
|
|
7040
|
-
endpoints: app.capabilities.endpoints.map((endpoint) =>
|
|
7240
|
+
endpoints: app.capabilities.endpoints.map((endpoint) => typeof endpoint === "string" ? {
|
|
7041
7241
|
localId: endpoint,
|
|
7042
7242
|
globalId: resolveGlobalContributionId(namespace, endpoint)
|
|
7043
|
-
})
|
|
7243
|
+
} : endpoint)
|
|
7044
7244
|
},
|
|
7045
7245
|
...app.capabilities.host === void 0 ? {} : { host: [...app.capabilities.host] },
|
|
7046
7246
|
...app.capabilities.feeds === void 0 ? {} : { feeds: [...app.capabilities.feeds] }
|
|
@@ -7059,6 +7259,14 @@ function resolveKayPluginContractV1(manifest) {
|
|
|
7059
7259
|
...manifest.dependencies?.plugins ?? []
|
|
7060
7260
|
],
|
|
7061
7261
|
authServices,
|
|
7262
|
+
...manifest.storage?.dataDir?.sharedWith === void 0 ? {} : { dataDirSharedWith: manifest.storage.dataDir.sharedWith },
|
|
7263
|
+
...manifest.workloadPurposes === void 0 ? {} : { workloadPurposes: manifest.workloadPurposes },
|
|
7264
|
+
...manifest.shellCommands === void 0 ? {} : {
|
|
7265
|
+
shellCommands: manifest.shellCommands.map(({ endpoint, ...command }) => ({
|
|
7266
|
+
...command,
|
|
7267
|
+
endpointId: resolveGlobalContributionId(namespace, endpoint)
|
|
7268
|
+
}))
|
|
7269
|
+
},
|
|
7062
7270
|
...grants && Object.keys(grants.byTarget).length > 0 ? { grants } : {},
|
|
7063
7271
|
...kayAgentUriModules && kayAgentUriModules.length > 0 ? { kayAgentUriModules } : {},
|
|
7064
7272
|
...kayAgentArtifactUriModules && kayAgentArtifactUriModules.length > 0 ? { kayAgentArtifactUriModules } : {},
|
|
@@ -7242,14 +7450,14 @@ function kayPluginCompatibilityAdvisories(input) {
|
|
|
7242
7450
|
message: boundPluginDiagnosticMessage(`${manifest.displayName} (${manifest.id}) ${advisory.message}`)
|
|
7243
7451
|
}));
|
|
7244
7452
|
}
|
|
7245
|
-
var ReadableCompatibility =
|
|
7246
|
-
supportedProtocols:
|
|
7453
|
+
var ReadableCompatibility = z18.object({
|
|
7454
|
+
supportedProtocols: z18.array(z18.string()).optional().catch(void 0),
|
|
7247
7455
|
minKayVersion: NonEmptyString.optional().catch(void 0),
|
|
7248
7456
|
sdk: NonEmptyString.optional().catch(void 0)
|
|
7249
7457
|
});
|
|
7250
|
-
var ReadableManifestHead =
|
|
7251
|
-
id:
|
|
7252
|
-
displayName:
|
|
7458
|
+
var ReadableManifestHead = z18.object({
|
|
7459
|
+
id: z18.string().optional().catch(void 0),
|
|
7460
|
+
displayName: z18.string().optional().catch(void 0),
|
|
7253
7461
|
compatibility: ReadableCompatibility.optional().catch(void 0)
|
|
7254
7462
|
});
|
|
7255
7463
|
function keepNamespaceDerivedTools(contract, grandfathered) {
|
|
@@ -7353,28 +7561,28 @@ function errorText(error) {
|
|
|
7353
7561
|
}
|
|
7354
7562
|
|
|
7355
7563
|
// packages/plugin-protocol/dist/session-health.js
|
|
7356
|
-
import { z as
|
|
7564
|
+
import { z as z19 } from "zod";
|
|
7357
7565
|
var SESSION_HEALTH_EXTENSION_ID = "kay.session-health";
|
|
7358
7566
|
var SESSION_HEALTH_ENTRY_NAME = "session_health";
|
|
7359
7567
|
var SESSION_HEALTH_CUSTOM_TYPE = `ext:${SESSION_HEALTH_EXTENSION_ID}:${SESSION_HEALTH_ENTRY_NAME}`;
|
|
7360
7568
|
var SESSION_HEALTH_CLASSIFIER_IDS = ["jev"];
|
|
7361
|
-
var sessionHealthEntrySchema =
|
|
7362
|
-
v:
|
|
7363
|
-
verdict:
|
|
7569
|
+
var sessionHealthEntrySchema = z19.object({
|
|
7570
|
+
v: z19.literal(1),
|
|
7571
|
+
verdict: z19.enum(["well", "bad", "unknown"]),
|
|
7364
7572
|
/**
|
|
7365
7573
|
* The model's calibrated confidence in `well`, 0..1, or null when the
|
|
7366
7574
|
* classifier declined to produce one. Never exported raw: the telemetry
|
|
7367
7575
|
* event carries only the decile bucket.
|
|
7368
7576
|
*/
|
|
7369
|
-
p_well:
|
|
7370
|
-
classifier:
|
|
7371
|
-
classifier_version:
|
|
7372
|
-
judged_at:
|
|
7373
|
-
user_entry_id:
|
|
7374
|
-
through_entry_id:
|
|
7375
|
-
usage:
|
|
7376
|
-
input_tokens:
|
|
7377
|
-
output_tokens:
|
|
7577
|
+
p_well: z19.number().min(0).max(1).nullable(),
|
|
7578
|
+
classifier: z19.enum(SESSION_HEALTH_CLASSIFIER_IDS),
|
|
7579
|
+
classifier_version: z19.string().min(1).max(64),
|
|
7580
|
+
judged_at: z19.number().int().nonnegative(),
|
|
7581
|
+
user_entry_id: z19.string().min(1).max(256),
|
|
7582
|
+
through_entry_id: z19.string().min(1).max(256),
|
|
7583
|
+
usage: z19.strictObject({
|
|
7584
|
+
input_tokens: z19.number().int().nonnegative(),
|
|
7585
|
+
output_tokens: z19.number().int().nonnegative()
|
|
7378
7586
|
}).optional()
|
|
7379
7587
|
});
|
|
7380
7588
|
function sessionHealthPWellDecile(pWell) {
|
|
@@ -7384,23 +7592,23 @@ function sessionHealthPWellDecile(pWell) {
|
|
|
7384
7592
|
}
|
|
7385
7593
|
|
|
7386
7594
|
// packages/plugin-protocol/dist/resource-invocations.js
|
|
7387
|
-
import { z as
|
|
7388
|
-
var CorpusResourceKind =
|
|
7595
|
+
import { z as z20 } from "zod";
|
|
7596
|
+
var CorpusResourceKind = z20.enum([
|
|
7389
7597
|
"skill",
|
|
7390
7598
|
"context-file",
|
|
7391
7599
|
"prompt-command"
|
|
7392
7600
|
]);
|
|
7393
|
-
var CorpusResourceInvocationCursor =
|
|
7394
|
-
at:
|
|
7395
|
-
eventId:
|
|
7601
|
+
var CorpusResourceInvocationCursor = z20.strictObject({
|
|
7602
|
+
at: z20.iso.datetime({ offset: true }),
|
|
7603
|
+
eventId: z20.string().min(1)
|
|
7396
7604
|
});
|
|
7397
|
-
var CorpusResourceInvocationQuery =
|
|
7605
|
+
var CorpusResourceInvocationQuery = z20.strictObject({
|
|
7398
7606
|
kind: CorpusResourceKind,
|
|
7399
|
-
since:
|
|
7400
|
-
until:
|
|
7607
|
+
since: z20.iso.datetime({ offset: true }),
|
|
7608
|
+
until: z20.iso.datetime({ offset: true }),
|
|
7401
7609
|
after: CorpusResourceInvocationCursor.optional(),
|
|
7402
|
-
limit:
|
|
7403
|
-
rootCreatedByKind:
|
|
7610
|
+
limit: z20.number().int().min(1).max(1e3).optional(),
|
|
7611
|
+
rootCreatedByKind: z20.enum(AGENT_RUNTIME_SESSION_CREATOR_KINDS).optional()
|
|
7404
7612
|
}).refine((value) => Date.parse(value.since) < Date.parse(value.until), {
|
|
7405
7613
|
message: "since must precede until"
|
|
7406
7614
|
});
|
|
@@ -7580,14 +7788,14 @@ function skillSuggestionEvidenceItems(evidence, options = {}) {
|
|
|
7580
7788
|
}
|
|
7581
7789
|
|
|
7582
7790
|
// packages/plugin-protocol/dist/ui-app-package.js
|
|
7583
|
-
import { z as
|
|
7791
|
+
import { z as z21 } from "zod";
|
|
7584
7792
|
var KAY_UI_APP_PACKAGE_PROTOCOL = "kay.ui.app-package.v1";
|
|
7585
7793
|
var KAY_UI_BUNDLE_INDEX_PROTOCOL = "kay.ui.bundle-index.v1";
|
|
7586
|
-
var KayUiBundleOutputPath =
|
|
7587
|
-
var KayUiBundleIndexV1 =
|
|
7588
|
-
protocol:
|
|
7794
|
+
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" });
|
|
7795
|
+
var KayUiBundleIndexV1 = z21.strictObject({
|
|
7796
|
+
protocol: z21.literal(KAY_UI_BUNDLE_INDEX_PROTOCOL),
|
|
7589
7797
|
entryPath: KayUiBundleOutputPath,
|
|
7590
|
-
files:
|
|
7798
|
+
files: z21.array(z21.strictObject({
|
|
7591
7799
|
path: KayUiBundleOutputPath,
|
|
7592
7800
|
mediaType: NonEmptyString
|
|
7593
7801
|
})).min(1)
|
|
@@ -7614,19 +7822,19 @@ var KayUiBundleIndexV1 = z18.strictObject({
|
|
|
7614
7822
|
function parseKayUiBundleIndexV1(input) {
|
|
7615
7823
|
return KayUiBundleIndexV1.parse(input);
|
|
7616
7824
|
}
|
|
7617
|
-
var KayUiAppPackageFile =
|
|
7825
|
+
var KayUiAppPackageFile = z21.strictObject({
|
|
7618
7826
|
path: PackageAssetPath,
|
|
7619
7827
|
mediaType: NonEmptyString,
|
|
7620
|
-
bytes:
|
|
7828
|
+
bytes: z21.instanceof(Uint8Array).refine((bytes) => bytes.byteLength > 0, {
|
|
7621
7829
|
message: "app package file bytes must not be empty"
|
|
7622
7830
|
})
|
|
7623
7831
|
});
|
|
7624
|
-
var KayUiAppPackageV1 =
|
|
7625
|
-
protocol:
|
|
7832
|
+
var KayUiAppPackageV1 = z21.strictObject({
|
|
7833
|
+
protocol: z21.literal(KAY_UI_APP_PACKAGE_PROTOCOL),
|
|
7626
7834
|
appLocalId: LocalContributionId,
|
|
7627
7835
|
entry: KayUiAppPackageFile,
|
|
7628
|
-
styles:
|
|
7629
|
-
assets:
|
|
7836
|
+
styles: z21.array(KayUiAppPackageFile).optional(),
|
|
7837
|
+
assets: z21.array(KayUiAppPackageFile).optional()
|
|
7630
7838
|
}).superRefine((appPackage, ctx) => {
|
|
7631
7839
|
if (appPackage.entry.mediaType !== "application/javascript") {
|
|
7632
7840
|
ctx.addIssue({
|
|
@@ -7663,16 +7871,16 @@ function parseKayUiAppPackageV1(input) {
|
|
|
7663
7871
|
}
|
|
7664
7872
|
|
|
7665
7873
|
// packages/plugin-protocol/dist/whiteboard.js
|
|
7666
|
-
import { z as
|
|
7874
|
+
import { z as z22 } from "zod";
|
|
7667
7875
|
var WhiteboardValue = JsonValue;
|
|
7668
|
-
var WhiteboardEntryEnvelope =
|
|
7876
|
+
var WhiteboardEntryEnvelope = z22.strictObject({
|
|
7669
7877
|
id: NonEmptyString,
|
|
7670
7878
|
typeId: GlobalContributionId,
|
|
7671
|
-
schemaVersion:
|
|
7672
|
-
title:
|
|
7879
|
+
schemaVersion: z22.number().int().positive(),
|
|
7880
|
+
title: z22.string(),
|
|
7673
7881
|
authorSessionId: NonEmptyString.nullable()
|
|
7674
7882
|
});
|
|
7675
|
-
var WhiteboardEntrySummary =
|
|
7883
|
+
var WhiteboardEntrySummary = z22.strictObject({
|
|
7676
7884
|
name: NonEmptyString,
|
|
7677
7885
|
entry: WhiteboardEntryEnvelope,
|
|
7678
7886
|
revision: NonEmptyString
|
|
@@ -7680,54 +7888,54 @@ var WhiteboardEntrySummary = z19.strictObject({
|
|
|
7680
7888
|
var WhiteboardEntrySnapshot = WhiteboardEntrySummary.extend({
|
|
7681
7889
|
value: WhiteboardValue
|
|
7682
7890
|
});
|
|
7683
|
-
var WhiteboardDiagnostic =
|
|
7891
|
+
var WhiteboardDiagnostic = z22.strictObject({
|
|
7684
7892
|
ruleId: NonEmptyString,
|
|
7685
|
-
severity:
|
|
7893
|
+
severity: z22.enum(["error", "warning"]),
|
|
7686
7894
|
message: NonEmptyString
|
|
7687
7895
|
});
|
|
7688
|
-
var WhiteboardEntryInfo =
|
|
7896
|
+
var WhiteboardEntryInfo = z22.strictObject({
|
|
7689
7897
|
name: NonEmptyString,
|
|
7690
7898
|
revision: NonEmptyString,
|
|
7691
7899
|
entry: WhiteboardEntryEnvelope.optional(),
|
|
7692
|
-
state:
|
|
7693
|
-
mutable:
|
|
7694
|
-
diagnostics:
|
|
7900
|
+
state: z22.enum(["available", "unavailable", "unsupported-version", "invalid"]),
|
|
7901
|
+
mutable: z22.boolean(),
|
|
7902
|
+
diagnostics: z22.array(z22.string())
|
|
7695
7903
|
});
|
|
7696
7904
|
var WhiteboardEntryInspection = WhiteboardEntryInfo.extend({
|
|
7697
7905
|
value: WhiteboardValue.optional(),
|
|
7698
|
-
text:
|
|
7699
|
-
truncated:
|
|
7906
|
+
text: z22.string(),
|
|
7907
|
+
truncated: z22.boolean()
|
|
7700
7908
|
});
|
|
7701
|
-
var WhiteboardTypeInfo =
|
|
7909
|
+
var WhiteboardTypeInfo = z22.strictObject({
|
|
7702
7910
|
typeId: GlobalContributionId,
|
|
7703
7911
|
displayName: NonEmptyString,
|
|
7704
|
-
schemaVersion:
|
|
7705
|
-
available:
|
|
7912
|
+
schemaVersion: z22.number().int().positive(),
|
|
7913
|
+
available: z22.boolean()
|
|
7706
7914
|
});
|
|
7707
7915
|
|
|
7708
7916
|
// packages/plugin-protocol/dist/product-events.js
|
|
7709
|
-
import { z as
|
|
7917
|
+
import { z as z23 } from "zod";
|
|
7710
7918
|
var exportable = {
|
|
7711
|
-
class:
|
|
7712
|
-
optional:
|
|
7919
|
+
class: z23.literal("exportable"),
|
|
7920
|
+
optional: z23.boolean().optional()
|
|
7713
7921
|
};
|
|
7714
|
-
var PluginProductEventField =
|
|
7715
|
-
|
|
7716
|
-
|
|
7922
|
+
var PluginProductEventField = z23.union([
|
|
7923
|
+
z23.strictObject({ class: z23.literal("local") }),
|
|
7924
|
+
z23.strictObject({
|
|
7717
7925
|
...exportable,
|
|
7718
|
-
type:
|
|
7719
|
-
values:
|
|
7926
|
+
type: z23.literal("enum"),
|
|
7927
|
+
values: z23.array(z23.string())
|
|
7720
7928
|
}),
|
|
7721
|
-
|
|
7929
|
+
z23.strictObject({
|
|
7722
7930
|
...exportable,
|
|
7723
|
-
type:
|
|
7724
|
-
min:
|
|
7725
|
-
max:
|
|
7726
|
-
integer:
|
|
7931
|
+
type: z23.literal("number"),
|
|
7932
|
+
min: z23.number(),
|
|
7933
|
+
max: z23.number(),
|
|
7934
|
+
integer: z23.boolean().optional()
|
|
7727
7935
|
}),
|
|
7728
|
-
|
|
7936
|
+
z23.strictObject({
|
|
7729
7937
|
...exportable,
|
|
7730
|
-
type:
|
|
7938
|
+
type: z23.enum([
|
|
7731
7939
|
"boolean",
|
|
7732
7940
|
"id",
|
|
7733
7941
|
"identifier",
|
|
@@ -7743,9 +7951,9 @@ function isPluginProductEventName(name) {
|
|
|
7743
7951
|
}
|
|
7744
7952
|
|
|
7745
7953
|
// packages/plugin-protocol/dist/artifact-outputs.js
|
|
7746
|
-
import { z as
|
|
7954
|
+
import { z as z24 } from "zod";
|
|
7747
7955
|
var ARTIFACT_OUTPUT_PAGE_MAX = 200;
|
|
7748
|
-
var Segment =
|
|
7956
|
+
var Segment = z24.string().min(1).max(1024).refine((value) => !/[^A-Za-z0-9._-]/.test(value)).refine((value) => value !== "." && value !== "..");
|
|
7749
7957
|
function parseArtifactOutputUri(uri) {
|
|
7750
7958
|
const match = /^output:\/\/([^/]+)\/([^/]+)$/.exec(uri);
|
|
7751
7959
|
if (match === null || !Segment.safeParse(match[1]).success || !Segment.safeParse(match[2]).success)
|
|
@@ -7755,12 +7963,12 @@ function parseArtifactOutputUri(uri) {
|
|
|
7755
7963
|
function isCanonicalArtifactOutputUri(uri) {
|
|
7756
7964
|
return parseArtifactOutputUri(uri) !== void 0;
|
|
7757
7965
|
}
|
|
7758
|
-
var ArtifactOutputUri =
|
|
7759
|
-
var ArtifactOutputChange =
|
|
7760
|
-
|
|
7761
|
-
uris:
|
|
7966
|
+
var ArtifactOutputUri = z24.string().refine(isCanonicalArtifactOutputUri, "Expected a canonical output://session/name URI");
|
|
7967
|
+
var ArtifactOutputChange = z24.union([
|
|
7968
|
+
z24.strictObject({
|
|
7969
|
+
uris: z24.array(ArtifactOutputUri).min(1).max(ARTIFACT_OUTPUT_PAGE_MAX)
|
|
7762
7970
|
}),
|
|
7763
|
-
|
|
7971
|
+
z24.strictObject({ sessionId: Segment })
|
|
7764
7972
|
]);
|
|
7765
7973
|
|
|
7766
7974
|
// packages/plugin-protocol/dist/credential-text.js
|
|
@@ -7803,25 +8011,25 @@ function isCredentialShapedText(value) {
|
|
|
7803
8011
|
}
|
|
7804
8012
|
|
|
7805
8013
|
// packages/plugin-protocol/dist/ui-module-bundle.js
|
|
7806
|
-
import { z as
|
|
8014
|
+
import { z as z25 } from "zod";
|
|
7807
8015
|
var KAY_UI_MODULE_BUNDLE_PROTOCOL = "kay.ui.module-bundle.v1";
|
|
7808
8016
|
var KAY_UI_MODULE_FILE_MAX_BYTES = 8 * 1024 * 1024;
|
|
7809
8017
|
var KAY_UI_MODULE_BUNDLE_MAX_BYTES = 32 * 1024 * 1024;
|
|
7810
8018
|
var KAY_UI_MODULE_BUNDLE_MAX_FILES = 256;
|
|
7811
|
-
var OutputPath =
|
|
8019
|
+
var OutputPath = z25.string().min(1).max(1024).refine((value) => {
|
|
7812
8020
|
const parsed = KayUiBundleIndexV1.shape.entryPath.safeParse(value);
|
|
7813
8021
|
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.
|
|
7814
8022
|
!/[\u0000-\u001f?#:%]/.test(value);
|
|
7815
8023
|
}, { message: "bundle path must contain only unambiguous relative segments" });
|
|
7816
|
-
var Sha256 =
|
|
7817
|
-
var KayUiModuleBundleIndexV1 =
|
|
7818
|
-
protocol:
|
|
8024
|
+
var Sha256 = z25.string().regex(/^[a-f0-9]{64}$/);
|
|
8025
|
+
var KayUiModuleBundleIndexV1 = z25.strictObject({
|
|
8026
|
+
protocol: z25.literal(KAY_UI_MODULE_BUNDLE_PROTOCOL),
|
|
7819
8027
|
entryPath: OutputPath,
|
|
7820
|
-
stylePaths:
|
|
7821
|
-
files:
|
|
8028
|
+
stylePaths: z25.array(OutputPath).max(KAY_UI_MODULE_BUNDLE_MAX_FILES),
|
|
8029
|
+
files: z25.array(z25.strictObject({
|
|
7822
8030
|
path: OutputPath,
|
|
7823
|
-
mediaType:
|
|
7824
|
-
byteLength:
|
|
8031
|
+
mediaType: z25.string().min(1).max(128).regex(/^[a-zA-Z0-9!#$&^_.+-]+\/[a-zA-Z0-9!#$&^_.+-]+$/),
|
|
8032
|
+
byteLength: z25.number().int().min(1).max(KAY_UI_MODULE_FILE_MAX_BYTES),
|
|
7825
8033
|
sha256: Sha256
|
|
7826
8034
|
})).min(1).max(KAY_UI_MODULE_BUNDLE_MAX_FILES)
|
|
7827
8035
|
}).superRefine((index, ctx) => {
|
|
@@ -7851,9 +8059,9 @@ var KayUiModuleBundleIndexV1 = z22.strictObject({
|
|
|
7851
8059
|
message: "bundle exceeds byte cap"
|
|
7852
8060
|
});
|
|
7853
8061
|
});
|
|
7854
|
-
var KayUiModuleBundleReference =
|
|
8062
|
+
var KayUiModuleBundleReference = z25.strictObject({
|
|
7855
8063
|
generationId: Sha256,
|
|
7856
|
-
revision:
|
|
8064
|
+
revision: z25.string().min(1).max(4096).refine((value) => value.trim() === value),
|
|
7857
8065
|
index: KayUiModuleBundleIndexV1
|
|
7858
8066
|
});
|
|
7859
8067
|
export {
|
|
@@ -7988,6 +8196,7 @@ export {
|
|
|
7988
8196
|
PluginAuthManifest,
|
|
7989
8197
|
PluginAuthScheme,
|
|
7990
8198
|
PluginAuthService,
|
|
8199
|
+
PluginByoocProfile,
|
|
7991
8200
|
PluginCapabilityClaimInputV1,
|
|
7992
8201
|
PluginCapabilityClaimV1,
|
|
7993
8202
|
PluginCapabilityDecisionV1,
|
|
@@ -8016,10 +8225,12 @@ export {
|
|
|
8016
8225
|
PluginNotificationRuleContribution,
|
|
8017
8226
|
PluginOAuthClientSupplier,
|
|
8018
8227
|
PluginPermissionManifest,
|
|
8228
|
+
PluginPickerRound,
|
|
8019
8229
|
PluginProductEventContribution,
|
|
8020
8230
|
PluginProductEventField,
|
|
8021
8231
|
PluginProvisioningProbe,
|
|
8022
8232
|
PluginProvisioningRequirement,
|
|
8233
|
+
PluginShellCommand,
|
|
8023
8234
|
PluginSignal,
|
|
8024
8235
|
PluginSignalPublish,
|
|
8025
8236
|
PluginSkillSourceDeclaration,
|
|
@@ -8029,6 +8240,7 @@ export {
|
|
|
8029
8240
|
PluginToolName,
|
|
8030
8241
|
PluginWebSessionDeclaration,
|
|
8031
8242
|
PluginWebSessionProbe,
|
|
8243
|
+
PluginWorkloadPurpose,
|
|
8032
8244
|
RENAMED_PLUGIN_CAPABILITY_SLUGS,
|
|
8033
8245
|
RESERVED_DIRECTORY_PLUGIN_ID_PREFIXES,
|
|
8034
8246
|
RETIRED_COMPATIBILITY_KEYS,
|
|
@@ -8091,6 +8303,9 @@ export {
|
|
|
8091
8303
|
SessionProvenanceRecord,
|
|
8092
8304
|
SessionReaderContribution,
|
|
8093
8305
|
SessionRelationship,
|
|
8306
|
+
ShellCommandOutcome,
|
|
8307
|
+
ShellCommandRequest,
|
|
8308
|
+
ShellCommandStep,
|
|
8094
8309
|
SignedInStatusCode,
|
|
8095
8310
|
SkillContribution,
|
|
8096
8311
|
StorageGrantRequest,
|
|
@@ -8102,6 +8317,7 @@ export {
|
|
|
8102
8317
|
ToolContribution,
|
|
8103
8318
|
ToolPermission,
|
|
8104
8319
|
UiAppCapabilities,
|
|
8320
|
+
UiAppCapabilityReference,
|
|
8105
8321
|
UiAppContribution,
|
|
8106
8322
|
UiCommandContribution,
|
|
8107
8323
|
UiEventSubscriptionContribution,
|