@yaklabs-ai/plugin-protocol 0.14.1 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/THIRD-PARTY-INVENTORY.json +1 -1
- package/dist/index.d.ts +217 -19
- package/dist/index.js +488 -430
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -136,38 +136,8 @@ var JsonSchema = z2.record(z2.string(), JsonValue);
|
|
|
136
136
|
// packages/plugin-protocol/dist/common.js
|
|
137
137
|
var KAY_PLUGIN_PROTOCOL_VERSION = "kay.plugin.v1";
|
|
138
138
|
var KAY_PLUGIN_PROTOCOL_PACKAGE_NAME = "@bonsai/plugin-protocol";
|
|
139
|
-
var KAY_PLUGIN_SDK_VERSION = "0.
|
|
140
|
-
var KAY_PLUGIN_COMPATIBLE_SDK_VERSIONS = [
|
|
141
|
-
"0.8.0",
|
|
142
|
-
"0.8.1",
|
|
143
|
-
"0.8.2",
|
|
144
|
-
"0.8.3",
|
|
145
|
-
"0.8.4",
|
|
146
|
-
"0.8.5",
|
|
147
|
-
"0.9.0",
|
|
148
|
-
"0.9.1",
|
|
149
|
-
"0.10.0",
|
|
150
|
-
"0.11.0",
|
|
151
|
-
"0.11.1",
|
|
152
|
-
"0.12.0",
|
|
153
|
-
"0.12.1",
|
|
154
|
-
"0.12.2",
|
|
155
|
-
"0.12.3",
|
|
156
|
-
"0.12.4",
|
|
157
|
-
"0.12.5",
|
|
158
|
-
"0.13.0",
|
|
159
|
-
"0.13.1",
|
|
160
|
-
"0.13.2",
|
|
161
|
-
"0.13.3",
|
|
162
|
-
"0.13.4",
|
|
163
|
-
"0.13.5",
|
|
164
|
-
"0.13.6",
|
|
165
|
-
"0.13.7",
|
|
166
|
-
"0.13.8",
|
|
167
|
-
"0.13.9",
|
|
168
|
-
"0.13.10",
|
|
169
|
-
"0.14.0"
|
|
170
|
-
];
|
|
139
|
+
var KAY_PLUGIN_SDK_VERSION = "0.15.0";
|
|
140
|
+
var KAY_PLUGIN_COMPATIBLE_SDK_VERSIONS = [];
|
|
171
141
|
var KAY_PLUGIN_TARGET_NAMES = [
|
|
172
142
|
"kay.agent",
|
|
173
143
|
"kay.app",
|
|
@@ -2350,31 +2320,83 @@ function checkKayPluginHostCompatibility(compatibility, host) {
|
|
|
2350
2320
|
return { refusal: void 0, advisories };
|
|
2351
2321
|
}
|
|
2352
2322
|
|
|
2353
|
-
// packages/plugin-protocol/dist/
|
|
2323
|
+
// packages/plugin-protocol/dist/plugin-events.js
|
|
2354
2324
|
import { z as z9 } from "zod";
|
|
2325
|
+
var PluginEventLocalId = z9.string().regex(/^[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)*$/);
|
|
2326
|
+
var PluginEventUri = z9.string().refine((value) => {
|
|
2327
|
+
if (!/^[a-z][a-z0-9+.-]*:/i.test(value) || /[\s\p{Cc}\\<>"{}|^`]/u.test(value) || /%(?![a-f0-9]{2})/i.test(value))
|
|
2328
|
+
return false;
|
|
2329
|
+
try {
|
|
2330
|
+
return new URL(value).protocol.length > 1;
|
|
2331
|
+
} catch {
|
|
2332
|
+
return false;
|
|
2333
|
+
}
|
|
2334
|
+
}, { message: "Expected an absolute resource URI" });
|
|
2335
|
+
var PluginEventTimestamp = z9.iso.datetime().refine((value) => !/\.\d{10}/.test(value), {
|
|
2336
|
+
message: "Expected an ISO instant with at most nanosecond precision"
|
|
2337
|
+
});
|
|
2338
|
+
var PluginEventRelated = z9.record(NonEmptyString, z9.union([PluginEventUri, z9.array(PluginEventUri)]));
|
|
2339
|
+
var PluginEventPublishSource = z9.strictObject({
|
|
2340
|
+
poller: NonEmptyString.optional(),
|
|
2341
|
+
runId: NonEmptyString.optional()
|
|
2342
|
+
});
|
|
2343
|
+
var PluginEventSource = z9.strictObject({
|
|
2344
|
+
layer: z9.literal("runtime"),
|
|
2345
|
+
pluginId: NonEmptyString,
|
|
2346
|
+
sessionId: NonEmptyString.optional(),
|
|
2347
|
+
...PluginEventPublishSource.shape
|
|
2348
|
+
});
|
|
2349
|
+
var PLUGIN_EVENT_ID_MAX_BYTES = 1024;
|
|
2350
|
+
var PluginEventId = z9.string().min(1).refine((value) => value === value.trim() && !/\p{Cc}/u.test(value) && new TextEncoder().encode(value).length <= PLUGIN_EVENT_ID_MAX_BYTES, {
|
|
2351
|
+
message: "Event identity must be control-free, unpadded, and at most 1024 UTF-8 bytes"
|
|
2352
|
+
});
|
|
2353
|
+
var PluginEventPublishInput = z9.strictObject({
|
|
2354
|
+
uri: PluginEventUri,
|
|
2355
|
+
related: PluginEventRelated.optional(),
|
|
2356
|
+
key: PluginEventId.optional(),
|
|
2357
|
+
occurredAt: PluginEventTimestamp.optional(),
|
|
2358
|
+
source: PluginEventPublishSource.optional(),
|
|
2359
|
+
payload: JsonValue.optional()
|
|
2360
|
+
});
|
|
2361
|
+
var PluginEventEnvelope = z9.strictObject({
|
|
2362
|
+
id: PluginEventId,
|
|
2363
|
+
localId: PluginEventLocalId,
|
|
2364
|
+
type: GlobalContributionId,
|
|
2365
|
+
version: z9.number().int().positive(),
|
|
2366
|
+
uri: PluginEventUri,
|
|
2367
|
+
related: PluginEventRelated.optional(),
|
|
2368
|
+
key: PluginEventPublishInput.shape.key,
|
|
2369
|
+
occurredAt: PluginEventTimestamp,
|
|
2370
|
+
publishedAt: PluginEventTimestamp,
|
|
2371
|
+
source: PluginEventSource,
|
|
2372
|
+
payload: JsonValue.optional()
|
|
2373
|
+
});
|
|
2374
|
+
|
|
2375
|
+
// packages/plugin-protocol/dist/contributions.js
|
|
2376
|
+
import { z as z10 } from "zod";
|
|
2355
2377
|
var OptionalDisplayName = NonEmptyString.optional();
|
|
2356
|
-
var UriFilesystemBacking =
|
|
2357
|
-
root:
|
|
2378
|
+
var UriFilesystemBacking = z10.strictObject({
|
|
2379
|
+
root: z10.literal("dataDir")
|
|
2358
2380
|
});
|
|
2359
|
-
var ToolContribution =
|
|
2381
|
+
var ToolContribution = z10.strictObject({
|
|
2360
2382
|
localId: LocalContributionId,
|
|
2361
2383
|
toolName: PluginToolName,
|
|
2362
2384
|
displayName: OptionalDisplayName,
|
|
2363
2385
|
description: NonEmptyString.optional()
|
|
2364
2386
|
});
|
|
2365
|
-
var ConverterContribution =
|
|
2387
|
+
var ConverterContribution = z10.strictObject({
|
|
2366
2388
|
localId: LocalContributionId,
|
|
2367
2389
|
displayName: OptionalDisplayName,
|
|
2368
2390
|
description: NonEmptyString.optional(),
|
|
2369
2391
|
/** MIME types this converter claims — contract data for introspection and
|
|
2370
2392
|
* collision checks; runtime match behavior stays the converter's `matches()`. */
|
|
2371
|
-
mimeTypes:
|
|
2393
|
+
mimeTypes: z10.array(MimeTypeString).min(1),
|
|
2372
2394
|
/** Extension fallbacks (no dot) used when a probe has no usable MIME type. */
|
|
2373
|
-
extensions:
|
|
2395
|
+
extensions: z10.array(FileExtensionToken).min(1).optional()
|
|
2374
2396
|
});
|
|
2375
|
-
var UriModuleContribution =
|
|
2397
|
+
var UriModuleContribution = z10.strictObject({
|
|
2376
2398
|
localId: LocalContributionId,
|
|
2377
|
-
schemes:
|
|
2399
|
+
schemes: z10.array(UriScheme).min(1),
|
|
2378
2400
|
displayName: OptionalDisplayName,
|
|
2379
2401
|
// The plugin only requests a projection. The daemon binds the effective root
|
|
2380
2402
|
// and retains access control at finalization.
|
|
@@ -2393,30 +2415,30 @@ var UriModuleContribution = z9.strictObject({
|
|
|
2393
2415
|
// `knownResources` permission grant (`api.knownResources`). Present-means-on
|
|
2394
2416
|
// (`true` or absent; `false` is not a state). Decision record:
|
|
2395
2417
|
// `lab/user-plugins/decisions/014-known-resources-ledger.md`.
|
|
2396
|
-
knownResources:
|
|
2418
|
+
knownResources: z10.literal(true).optional()
|
|
2397
2419
|
});
|
|
2398
2420
|
var AppUriModuleContribution = UriModuleContribution.omit({
|
|
2399
2421
|
authService: true,
|
|
2400
2422
|
filesystemBacking: true,
|
|
2401
2423
|
knownResources: true
|
|
2402
2424
|
});
|
|
2403
|
-
var AppDataSourceContribution =
|
|
2425
|
+
var AppDataSourceContribution = z10.strictObject({
|
|
2404
2426
|
localId: LocalContributionId,
|
|
2405
|
-
scope:
|
|
2406
|
-
snapshot:
|
|
2407
|
-
version:
|
|
2427
|
+
scope: z10.enum(["runtime", "account", "session"]),
|
|
2428
|
+
snapshot: z10.strictObject({
|
|
2429
|
+
version: z10.number().int().positive(),
|
|
2408
2430
|
schema: JsonSchema
|
|
2409
2431
|
}),
|
|
2410
|
-
change:
|
|
2411
|
-
version:
|
|
2432
|
+
change: z10.strictObject({
|
|
2433
|
+
version: z10.number().int().positive(),
|
|
2412
2434
|
schema: JsonSchema,
|
|
2413
2435
|
/** Review-only claim; source schemas and behavioral tests enforce it because the daemon treats changes as opaque. */
|
|
2414
|
-
semantics:
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
kind:
|
|
2418
|
-
maxEncodedBytes:
|
|
2419
|
-
rationale:
|
|
2436
|
+
semantics: z10.discriminatedUnion("kind", [
|
|
2437
|
+
z10.strictObject({ kind: z10.literal("incremental") }),
|
|
2438
|
+
z10.strictObject({
|
|
2439
|
+
kind: z10.literal("snapshot-replacement"),
|
|
2440
|
+
maxEncodedBytes: z10.number().int().positive(),
|
|
2441
|
+
rationale: z10.string().trim().min(1).max(1024)
|
|
2420
2442
|
})
|
|
2421
2443
|
]).optional()
|
|
2422
2444
|
}),
|
|
@@ -2430,28 +2452,28 @@ var AppDataSourceContribution = z9.strictObject({
|
|
|
2430
2452
|
});
|
|
2431
2453
|
}
|
|
2432
2454
|
});
|
|
2433
|
-
var WhiteboardTypeStorage =
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
kind:
|
|
2455
|
+
var WhiteboardTypeStorage = z10.discriminatedUnion("kind", [
|
|
2456
|
+
z10.strictObject({ kind: z10.literal("json") }),
|
|
2457
|
+
z10.strictObject({ kind: z10.literal("payload") }),
|
|
2458
|
+
z10.strictObject({
|
|
2459
|
+
kind: z10.literal("markdown"),
|
|
2438
2460
|
bodyField: NonEmptyString
|
|
2439
2461
|
})
|
|
2440
2462
|
]);
|
|
2441
|
-
var WhiteboardTypeContribution =
|
|
2463
|
+
var WhiteboardTypeContribution = z10.strictObject({
|
|
2442
2464
|
localId: LocalContributionId,
|
|
2443
2465
|
displayName: NonEmptyString,
|
|
2444
|
-
schemaVersion:
|
|
2466
|
+
schemaVersion: z10.number().int().positive(),
|
|
2445
2467
|
storage: WhiteboardTypeStorage,
|
|
2446
2468
|
valueSchema: JsonSchema,
|
|
2447
|
-
presentation:
|
|
2469
|
+
presentation: z10.strictObject({
|
|
2448
2470
|
app: LocalContributionId
|
|
2449
2471
|
}).optional()
|
|
2450
2472
|
});
|
|
2451
|
-
var AppDataMaterializerContribution =
|
|
2473
|
+
var AppDataMaterializerContribution = z10.strictObject({
|
|
2452
2474
|
source: LocalContributionId
|
|
2453
2475
|
});
|
|
2454
|
-
var ArtifactUriModuleContribution =
|
|
2476
|
+
var ArtifactUriModuleContribution = z10.strictObject({
|
|
2455
2477
|
localId: LocalContributionId,
|
|
2456
2478
|
/** The single `scheme://` this module owns; also the on-disk artifact kind. */
|
|
2457
2479
|
scheme: UriScheme,
|
|
@@ -2465,17 +2487,17 @@ var ArtifactUriModuleContribution = z9.strictObject({
|
|
|
2465
2487
|
* composes its description from the plugin's own display name + scheme — a per-scheme label
|
|
2466
2488
|
* would have no path to matter, so it is intentionally omitted rather than accepted-and-ignored.
|
|
2467
2489
|
*/
|
|
2468
|
-
editable:
|
|
2490
|
+
editable: z10.boolean().optional(),
|
|
2469
2491
|
/** Opt in to `list` over the kind's stored names. Default false. Mirrors
|
|
2470
2492
|
* `CreateArtifactUriModuleOptions.listable`. */
|
|
2471
|
-
listable:
|
|
2493
|
+
listable: z10.boolean().optional(),
|
|
2472
2494
|
/**
|
|
2473
2495
|
* Opt in to `delete` for same-session entries. Default false. Deletion
|
|
2474
2496
|
* unlinks the stored file — no trash tier; a kind that wants recoverable
|
|
2475
2497
|
* deletion is not artifact-backed. Mirrors
|
|
2476
2498
|
* `CreateArtifactUriModuleOptions.deletable`.
|
|
2477
2499
|
*/
|
|
2478
|
-
deletable:
|
|
2500
|
+
deletable: z10.boolean().optional(),
|
|
2479
2501
|
/**
|
|
2480
2502
|
* Opt in to the `{ content, mode: "append" }` write envelope, which extends
|
|
2481
2503
|
* stored text instead of replacing it (concurrent-appender-safe: the host
|
|
@@ -2483,7 +2505,7 @@ var ArtifactUriModuleContribution = z9.strictObject({
|
|
|
2483
2505
|
* keep their verbatim round-trip. Mirrors
|
|
2484
2506
|
* `CreateArtifactUriModuleOptions.appendable`.
|
|
2485
2507
|
*/
|
|
2486
|
-
appendable:
|
|
2508
|
+
appendable: z10.boolean().optional(),
|
|
2487
2509
|
/**
|
|
2488
2510
|
* Which sessions share one storage namespace. Default `"session"` — the existing
|
|
2489
2511
|
* per-session behavior (each session gets its own kind directory; other sessions'
|
|
@@ -2494,14 +2516,14 @@ var ArtifactUriModuleContribution = z9.strictObject({
|
|
|
2494
2516
|
* the scope; the host derives the family root from provenance it already holds, so
|
|
2495
2517
|
* family identity never crosses the SDK boundary.
|
|
2496
2518
|
*/
|
|
2497
|
-
storageScope:
|
|
2519
|
+
storageScope: z10.enum(["session", "family"]).optional()
|
|
2498
2520
|
});
|
|
2499
|
-
var CliBindingContribution =
|
|
2521
|
+
var CliBindingContribution = z10.strictObject({
|
|
2500
2522
|
localId: LocalContributionId,
|
|
2501
2523
|
binary: CliBinaryName,
|
|
2502
|
-
aliases:
|
|
2524
|
+
aliases: z10.array(CliBinaryName).optional(),
|
|
2503
2525
|
/** Where the binary comes from. Omitted ⇒ `"vendored"` (decision 007). */
|
|
2504
|
-
provider:
|
|
2526
|
+
provider: z10.enum(["vendored", "path"]).optional(),
|
|
2505
2527
|
// A local ref (no dot) must name an auth service declared in this same
|
|
2506
2528
|
// manifest; a qualified ref (dotted, e.g. `google.account`) names another
|
|
2507
2529
|
// plugin's already-minted global id and is recorded, not resolved, here (see
|
|
@@ -2514,20 +2536,20 @@ var CliBindingContribution = z9.strictObject({
|
|
|
2514
2536
|
* MUST be absent for a `path` binding, which can never receive a token.
|
|
2515
2537
|
*/
|
|
2516
2538
|
authEnvVar: CliAuthEnvVarName.optional(),
|
|
2517
|
-
readOnly:
|
|
2518
|
-
write:
|
|
2539
|
+
readOnly: z10.array(NonEmptyString),
|
|
2540
|
+
write: z10.array(NonEmptyString)
|
|
2519
2541
|
});
|
|
2520
|
-
var GitHostContribution =
|
|
2542
|
+
var GitHostContribution = z10.strictObject({
|
|
2521
2543
|
host: GitHostName,
|
|
2522
2544
|
authService: LocalContributionId,
|
|
2523
2545
|
basicAuthUser: GitBasicAuthUser
|
|
2524
2546
|
});
|
|
2525
|
-
var ResourceContribution =
|
|
2547
|
+
var ResourceContribution = z10.strictObject({
|
|
2526
2548
|
localId: LocalContributionId,
|
|
2527
2549
|
displayName: OptionalDisplayName,
|
|
2528
2550
|
description: NonEmptyString.optional()
|
|
2529
2551
|
});
|
|
2530
|
-
var SkillContribution =
|
|
2552
|
+
var SkillContribution = z10.strictObject({
|
|
2531
2553
|
localId: LocalContributionId,
|
|
2532
2554
|
displayName: OptionalDisplayName,
|
|
2533
2555
|
/** Model-visible one-liner: when to reach for this skill. */
|
|
@@ -2535,18 +2557,18 @@ var SkillContribution = z9.strictObject({
|
|
|
2535
2557
|
/** The SKILL.md-style file inside the package carrying the full instructions. */
|
|
2536
2558
|
path: PackageAssetPath
|
|
2537
2559
|
});
|
|
2538
|
-
var PluginSkillSourceDeclaration =
|
|
2539
|
-
|
|
2540
|
-
channel:
|
|
2560
|
+
var PluginSkillSourceDeclaration = z10.discriminatedUnion("channel", [
|
|
2561
|
+
z10.strictObject({
|
|
2562
|
+
channel: z10.literal("installer"),
|
|
2541
2563
|
localId: LocalContributionId,
|
|
2542
2564
|
displayName: OptionalDisplayName,
|
|
2543
2565
|
/** The package-runner executable, e.g. `npx` — checked against the daemon's allowlist. */
|
|
2544
2566
|
command: NonEmptyString,
|
|
2545
2567
|
/** Its argv, e.g. `["skills", "add", "clerk/skills"]`. */
|
|
2546
|
-
args:
|
|
2568
|
+
args: z10.array(NonEmptyString)
|
|
2547
2569
|
}),
|
|
2548
|
-
|
|
2549
|
-
channel:
|
|
2570
|
+
z10.strictObject({
|
|
2571
|
+
channel: z10.literal("git-clone"),
|
|
2550
2572
|
localId: LocalContributionId,
|
|
2551
2573
|
displayName: OptionalDisplayName,
|
|
2552
2574
|
/** The repository locator — canonicalized and hygiene-checked by the daemon. */
|
|
@@ -2557,17 +2579,17 @@ var PluginSkillSourceDeclaration = z9.discriminatedUnion("channel", [
|
|
|
2557
2579
|
subdir: NonEmptyString.optional()
|
|
2558
2580
|
})
|
|
2559
2581
|
]);
|
|
2560
|
-
var SearchProviderContribution =
|
|
2582
|
+
var SearchProviderContribution = z10.strictObject({
|
|
2561
2583
|
localId: LocalContributionId,
|
|
2562
2584
|
displayName: OptionalDisplayName,
|
|
2563
|
-
schemes:
|
|
2585
|
+
schemes: z10.array(UriScheme).optional()
|
|
2564
2586
|
});
|
|
2565
|
-
var InteractionDriverContribution =
|
|
2587
|
+
var InteractionDriverContribution = z10.strictObject({
|
|
2566
2588
|
localId: LocalContributionId,
|
|
2567
2589
|
displayName: OptionalDisplayName,
|
|
2568
|
-
kind:
|
|
2590
|
+
kind: z10.enum(["browser", "computer-use"])
|
|
2569
2591
|
});
|
|
2570
|
-
var EntityResolverContribution =
|
|
2592
|
+
var EntityResolverContribution = z10.strictObject({
|
|
2571
2593
|
localId: LocalContributionId,
|
|
2572
2594
|
displayName: OptionalDisplayName,
|
|
2573
2595
|
/** The `kay.agent` URI module (this manifest's own `contributes.uriModules[].localId`) whose
|
|
@@ -2575,24 +2597,24 @@ var EntityResolverContribution = z9.strictObject({
|
|
|
2575
2597
|
uriModule: LocalContributionId,
|
|
2576
2598
|
/** `person` | `channel` | `repo` | `pull-request` | ... -- drives avatar-first vs glyph-first row
|
|
2577
2599
|
* anatomy (N10-R2) and lets the renderer request a narrower `entityTypes` filter. */
|
|
2578
|
-
entityTypes:
|
|
2600
|
+
entityTypes: z10.array(NonEmptyString).min(1),
|
|
2579
2601
|
/** The URI namespace/route `search()` is called against, e.g. `slack://directory` or
|
|
2580
2602
|
* `github://search/repositories` -- the resolver's fixed search scope; the live user query is
|
|
2581
2603
|
* the `search()` call's `query` param, never concatenated into this string. */
|
|
2582
2604
|
uriHint: NonEmptyString
|
|
2583
2605
|
});
|
|
2584
|
-
var AgentRenderContribution =
|
|
2606
|
+
var AgentRenderContribution = z10.strictObject({
|
|
2585
2607
|
localId: LocalContributionId,
|
|
2586
|
-
resultKinds:
|
|
2608
|
+
resultKinds: z10.array(NonEmptyString).min(1)
|
|
2587
2609
|
});
|
|
2588
|
-
var EndpointContribution =
|
|
2610
|
+
var EndpointContribution = z10.strictObject({
|
|
2589
2611
|
localId: LocalContributionId,
|
|
2590
2612
|
displayName: OptionalDisplayName,
|
|
2591
2613
|
requestSchema: JsonSchema.optional(),
|
|
2592
2614
|
responseSchema: JsonSchema.optional()
|
|
2593
2615
|
});
|
|
2594
2616
|
var MCP_SERVER_LOCAL_HTTP_HOSTNAMES = /* @__PURE__ */ new Set(["localhost", "127.0.0.1"]);
|
|
2595
|
-
var McpServerUrl =
|
|
2617
|
+
var McpServerUrl = z10.string().trim().min(1).refine((value) => {
|
|
2596
2618
|
let parsed;
|
|
2597
2619
|
try {
|
|
2598
2620
|
parsed = new URL(value);
|
|
@@ -2605,8 +2627,12 @@ var McpServerUrl = z9.string().trim().min(1).refine((value) => {
|
|
|
2605
2627
|
}, {
|
|
2606
2628
|
message: "mcp server url must be https://, or http:// only for localhost/127.0.0.1 test servers"
|
|
2607
2629
|
});
|
|
2608
|
-
var McpServerAuthMode =
|
|
2609
|
-
var
|
|
2630
|
+
var McpServerAuthMode = z10.enum(["oauth", "api-key", "none"]);
|
|
2631
|
+
var MCP_SIGN_IN_SCHEME_KIND = {
|
|
2632
|
+
oauth: "delegated",
|
|
2633
|
+
"api-key": "api-key"
|
|
2634
|
+
};
|
|
2635
|
+
var McpServerContribution = z10.strictObject({
|
|
2610
2636
|
url: McpServerUrl,
|
|
2611
2637
|
auth: McpServerAuthMode.optional(),
|
|
2612
2638
|
authService: LocalContributionId.optional()
|
|
@@ -2615,32 +2641,34 @@ var McpServerContribution = z9.strictObject({
|
|
|
2615
2641
|
ctx.addIssue({
|
|
2616
2642
|
code: "custom",
|
|
2617
2643
|
path: ["authService"],
|
|
2618
|
-
message: "oauth mcp servers must name an authService
|
|
2644
|
+
message: `${server.auth ?? "oauth"} mcp servers must name an authService`
|
|
2619
2645
|
});
|
|
2620
2646
|
}
|
|
2621
2647
|
});
|
|
2622
|
-
var McpServerContributions =
|
|
2623
|
-
var AppEventSubscription =
|
|
2648
|
+
var McpServerContributions = z10.record(LocalContributionId, McpServerContribution);
|
|
2649
|
+
var AppEventSubscription = z10.strictObject({
|
|
2624
2650
|
localId: LocalContributionId,
|
|
2625
2651
|
event: NonEmptyString
|
|
2626
2652
|
});
|
|
2627
|
-
var ContextContributorContribution =
|
|
2653
|
+
var ContextContributorContribution = z10.strictObject({
|
|
2628
2654
|
localId: LocalContributionId.max(64),
|
|
2629
2655
|
displayName: OptionalDisplayName,
|
|
2630
2656
|
description: NonEmptyString.optional()
|
|
2631
2657
|
});
|
|
2632
|
-
var PluginEventDefinitionContribution =
|
|
2633
|
-
localId:
|
|
2658
|
+
var PluginEventDefinitionContribution = z10.strictObject({
|
|
2659
|
+
localId: PluginEventLocalId,
|
|
2634
2660
|
displayName: OptionalDisplayName,
|
|
2635
2661
|
description: NonEmptyString.optional(),
|
|
2636
|
-
version:
|
|
2637
|
-
|
|
2662
|
+
version: z10.number().int().positive().default(1),
|
|
2663
|
+
uriScheme: UriScheme,
|
|
2664
|
+
relatedKeys: z10.array(NonEmptyString).readonly().optional(),
|
|
2665
|
+
payloadSchema: JsonSchema.optional()
|
|
2638
2666
|
});
|
|
2639
|
-
var PluginNotificationRuleContribution =
|
|
2667
|
+
var PluginNotificationRuleContribution = z10.strictObject({
|
|
2640
2668
|
localId: LocalContributionId,
|
|
2641
2669
|
/** The same-plugin `eventDefinitions` local id this rule matches. */
|
|
2642
|
-
event:
|
|
2643
|
-
where:
|
|
2670
|
+
event: PluginEventLocalId,
|
|
2671
|
+
where: z10.array(JsonObject).optional(),
|
|
2644
2672
|
rule: JsonObject
|
|
2645
2673
|
});
|
|
2646
2674
|
var PLUGIN_NOTIFICATION_RULE_HOST_KEYS = [
|
|
@@ -2648,67 +2676,67 @@ var PLUGIN_NOTIFICATION_RULE_HOST_KEYS = [
|
|
|
2648
2676
|
"match",
|
|
2649
2677
|
"sender"
|
|
2650
2678
|
];
|
|
2651
|
-
var UiEventSubscriptionContribution =
|
|
2679
|
+
var UiEventSubscriptionContribution = z10.strictObject({
|
|
2652
2680
|
localId: LocalContributionId,
|
|
2653
2681
|
event: NonEmptyString
|
|
2654
2682
|
});
|
|
2655
|
-
var DeviceDelegationContribution =
|
|
2683
|
+
var DeviceDelegationContribution = z10.strictObject({
|
|
2656
2684
|
localId: LocalContributionId,
|
|
2657
|
-
device:
|
|
2658
|
-
delegateAs:
|
|
2685
|
+
device: z10.enum(["microphone"]),
|
|
2686
|
+
delegateAs: z10.enum(["clip", "stream", "status"])
|
|
2659
2687
|
});
|
|
2660
|
-
var CorpusContribution =
|
|
2688
|
+
var CorpusContribution = z10.strictObject({
|
|
2661
2689
|
localId: LocalContributionId,
|
|
2662
2690
|
displayName: OptionalDisplayName,
|
|
2663
|
-
access:
|
|
2691
|
+
access: z10.enum(["read"]).default("read")
|
|
2664
2692
|
});
|
|
2665
|
-
var UiCommandContribution =
|
|
2693
|
+
var UiCommandContribution = z10.strictObject({
|
|
2666
2694
|
localId: LocalContributionId,
|
|
2667
2695
|
title: NonEmptyString,
|
|
2668
2696
|
icon: NonEmptyString.optional(),
|
|
2669
2697
|
placement: NonEmptyString.optional()
|
|
2670
2698
|
});
|
|
2671
|
-
var UiSlotContribution =
|
|
2699
|
+
var UiSlotContribution = z10.strictObject({
|
|
2672
2700
|
localId: LocalContributionId,
|
|
2673
2701
|
slot: NonEmptyString,
|
|
2674
2702
|
title: NonEmptyString.optional()
|
|
2675
2703
|
});
|
|
2676
|
-
var SettingsPanelContribution =
|
|
2704
|
+
var SettingsPanelContribution = z10.strictObject({
|
|
2677
2705
|
localId: LocalContributionId,
|
|
2678
2706
|
title: NonEmptyString,
|
|
2679
2707
|
configSection: NonEmptyString.optional()
|
|
2680
2708
|
});
|
|
2681
|
-
var ResultRendererContribution =
|
|
2709
|
+
var ResultRendererContribution = z10.strictObject({
|
|
2682
2710
|
localId: LocalContributionId,
|
|
2683
|
-
resultKinds:
|
|
2711
|
+
resultKinds: z10.array(NonEmptyString).min(1)
|
|
2684
2712
|
});
|
|
2685
|
-
var ReferenceOpenBehavior =
|
|
2686
|
-
|
|
2687
|
-
|
|
2713
|
+
var ReferenceOpenBehavior = z10.discriminatedUnion("kind", [
|
|
2714
|
+
z10.strictObject({ kind: z10.literal("working-document") }),
|
|
2715
|
+
z10.strictObject({ kind: z10.literal("browser-pane") }),
|
|
2688
2716
|
/**
|
|
2689
2717
|
* Open one of the presenting plugin's OWN registered pages (`registerPage`'s
|
|
2690
2718
|
* descriptor id) with the reference's canonical URI as the page's `objectId`.
|
|
2691
2719
|
* Needs no web address, so a plugin-only resource (`user-todo://items/3`) can pill.
|
|
2692
2720
|
*/
|
|
2693
|
-
|
|
2721
|
+
z10.strictObject({ kind: z10.literal("page"), pageId: NonEmptyString })
|
|
2694
2722
|
]);
|
|
2695
|
-
var ReferencePresentationVariant =
|
|
2723
|
+
var ReferencePresentationVariant = z10.strictObject({
|
|
2696
2724
|
resourceKind: NonEmptyString,
|
|
2697
2725
|
presentationPluginId: PluginId.optional()
|
|
2698
2726
|
});
|
|
2699
|
-
var ReferencePresentationVariants =
|
|
2700
|
-
var InlineSvg =
|
|
2701
|
-
var ReferencePresentationUrlClaim =
|
|
2702
|
-
kind:
|
|
2703
|
-
pattern:
|
|
2704
|
-
protocol:
|
|
2727
|
+
var ReferencePresentationVariants = z10.record(MimeTypeString, ReferencePresentationVariant);
|
|
2728
|
+
var InlineSvg = z10.string().max(64 * 1024).refine((value) => /^\s*(?:<\?xml[^>]*>\s*)?(?:<!--[\s\S]*?-->\s*)*(?:<!DOCTYPE[^>]*>\s*)?<svg[\s>]/iu.test(value), { message: "brandIcon must be inline SVG markup." });
|
|
2729
|
+
var ReferencePresentationUrlClaim = z10.strictObject({
|
|
2730
|
+
kind: z10.literal("urlPattern"),
|
|
2731
|
+
pattern: z10.strictObject({
|
|
2732
|
+
protocol: z10.enum(["http", "https"]),
|
|
2705
2733
|
hostname: NonEmptyString,
|
|
2706
|
-
pathname:
|
|
2707
|
-
search:
|
|
2734
|
+
pathname: z10.string().optional(),
|
|
2735
|
+
search: z10.string().optional()
|
|
2708
2736
|
}),
|
|
2709
2737
|
brandIcon: InlineSvg.optional()
|
|
2710
2738
|
});
|
|
2711
|
-
var ReferencePresentationContribution =
|
|
2739
|
+
var ReferencePresentationContribution = z10.strictObject({
|
|
2712
2740
|
localId: LocalContributionId,
|
|
2713
2741
|
uriModule: LocalContributionId,
|
|
2714
2742
|
resourceKind: NonEmptyString,
|
|
@@ -2716,7 +2744,7 @@ var ReferencePresentationContribution = z9.strictObject({
|
|
|
2716
2744
|
/** MIME-specific resource kinds; absent keys use the base presentation. */
|
|
2717
2745
|
variants: ReferencePresentationVariants.optional(),
|
|
2718
2746
|
/** Lexical public URL claims used only for host-rendered browser presentations. */
|
|
2719
|
-
claims:
|
|
2747
|
+
claims: z10.array(ReferencePresentationUrlClaim).optional()
|
|
2720
2748
|
}).superRefine((value, ctx) => {
|
|
2721
2749
|
if (value.claims !== void 0 && value.claims.length > 0 && value.open.kind !== "browser-pane") {
|
|
2722
2750
|
ctx.addIssue({
|
|
@@ -2726,13 +2754,15 @@ var ReferencePresentationContribution = z9.strictObject({
|
|
|
2726
2754
|
});
|
|
2727
2755
|
}
|
|
2728
2756
|
});
|
|
2729
|
-
var RichViewContribution =
|
|
2757
|
+
var RichViewContribution = z10.strictObject({
|
|
2730
2758
|
localId: LocalContributionId,
|
|
2731
2759
|
title: NonEmptyString,
|
|
2732
2760
|
route: NonEmptyString.optional()
|
|
2733
2761
|
});
|
|
2734
|
-
var KayUiAppHostCapability =
|
|
2762
|
+
var KayUiAppHostCapability = z10.enum([
|
|
2735
2763
|
"navigation.open-session",
|
|
2764
|
+
"artifacts.read",
|
|
2765
|
+
"artifacts.preview",
|
|
2736
2766
|
"cost.read",
|
|
2737
2767
|
// Server-rated organization billing, distinct from local/provider cost.
|
|
2738
2768
|
"billing.read",
|
|
@@ -2762,9 +2792,9 @@ var KayUiAppHostCapability = z9.enum([
|
|
|
2762
2792
|
// rearrange the workspace but never remove something the user would have to notice going missing.
|
|
2763
2793
|
"workspace.arrange"
|
|
2764
2794
|
]);
|
|
2765
|
-
var UiAppCapabilities =
|
|
2766
|
-
endpoints:
|
|
2767
|
-
host:
|
|
2795
|
+
var UiAppCapabilities = z10.strictObject({
|
|
2796
|
+
endpoints: z10.array(LocalContributionId).optional(),
|
|
2797
|
+
host: z10.array(KayUiAppHostCapability).optional()
|
|
2768
2798
|
}).superRefine((capabilities, ctx) => {
|
|
2769
2799
|
for (const field of ["endpoints", "host"]) {
|
|
2770
2800
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -2780,47 +2810,53 @@ var UiAppCapabilities = z9.strictObject({
|
|
|
2780
2810
|
}
|
|
2781
2811
|
}
|
|
2782
2812
|
});
|
|
2783
|
-
var
|
|
2813
|
+
var UiAppActivityRail = z10.strictObject({
|
|
2814
|
+
section: z10.enum(["primary", "plugins"]).optional(),
|
|
2815
|
+
order: z10.number().finite().optional(),
|
|
2816
|
+
icon: z10.union([NonEmptyString, z10.strictObject({ svg: NonEmptyString })]).optional()
|
|
2817
|
+
});
|
|
2818
|
+
var UiAppContribution = z10.strictObject({
|
|
2784
2819
|
localId: LocalContributionId,
|
|
2785
2820
|
displayName: NonEmptyString,
|
|
2786
2821
|
description: NonEmptyString.optional(),
|
|
2787
2822
|
icon: PackageAssetPath.optional(),
|
|
2788
|
-
runtime:
|
|
2789
|
-
sdk:
|
|
2823
|
+
runtime: z10.literal("kay.react-app.v1"),
|
|
2824
|
+
sdk: z10.strictObject({ range: NonEmptyString }),
|
|
2790
2825
|
entrypoint: TargetEntrypoint,
|
|
2791
|
-
styles:
|
|
2792
|
-
assets:
|
|
2793
|
-
capabilities: UiAppCapabilities.optional()
|
|
2826
|
+
styles: z10.array(PackageAssetPath).optional(),
|
|
2827
|
+
assets: z10.array(PackageAssetPath).optional(),
|
|
2828
|
+
capabilities: UiAppCapabilities.optional(),
|
|
2829
|
+
activityRail: UiAppActivityRail.optional()
|
|
2794
2830
|
});
|
|
2795
|
-
var ThemeContribution =
|
|
2831
|
+
var ThemeContribution = z10.strictObject({
|
|
2796
2832
|
localId: LocalContributionId,
|
|
2797
2833
|
displayName: NonEmptyString,
|
|
2798
|
-
appearance:
|
|
2834
|
+
appearance: z10.enum(["light", "dark"]),
|
|
2799
2835
|
tokens: PackageAssetPath
|
|
2800
2836
|
});
|
|
2801
|
-
var CommandHandler =
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
kind:
|
|
2837
|
+
var CommandHandler = z10.discriminatedUnion("kind", [
|
|
2838
|
+
z10.strictObject({ kind: z10.literal("skill"), skill: LocalContributionId }),
|
|
2839
|
+
z10.strictObject({
|
|
2840
|
+
kind: z10.literal("tool"),
|
|
2805
2841
|
tool: PluginToolName,
|
|
2806
2842
|
/** Positional mapping from tokenized `argsText` onto the tool's own input fields — see this
|
|
2807
2843
|
* union's doc for the exact tokenize/map/last-field-absorbs rule. */
|
|
2808
|
-
argumentFields:
|
|
2844
|
+
argumentFields: z10.array(NonEmptyString)
|
|
2809
2845
|
}),
|
|
2810
|
-
|
|
2811
|
-
kind:
|
|
2846
|
+
z10.strictObject({
|
|
2847
|
+
kind: z10.literal("endpoint"),
|
|
2812
2848
|
endpoint: LocalContributionId
|
|
2813
2849
|
})
|
|
2814
2850
|
]);
|
|
2815
|
-
var CommandContribution =
|
|
2851
|
+
var CommandContribution = z10.strictObject({
|
|
2816
2852
|
localId: LocalContributionId,
|
|
2817
2853
|
displayName: OptionalDisplayName,
|
|
2818
2854
|
description: NonEmptyString,
|
|
2819
|
-
aliases:
|
|
2855
|
+
aliases: z10.array(LocalContributionId).optional(),
|
|
2820
2856
|
argumentHint: NonEmptyString.optional(),
|
|
2821
2857
|
handler: CommandHandler
|
|
2822
2858
|
});
|
|
2823
|
-
var PluginContributionKind =
|
|
2859
|
+
var PluginContributionKind = z10.enum([
|
|
2824
2860
|
"tool",
|
|
2825
2861
|
"converter",
|
|
2826
2862
|
"uriModule",
|
|
@@ -2875,7 +2911,7 @@ function pluginIconShape(svg) {
|
|
|
2875
2911
|
}
|
|
2876
2912
|
|
|
2877
2913
|
// packages/plugin-protocol/dist/manifest.js
|
|
2878
|
-
import { z as
|
|
2914
|
+
import { z as z11 } from "zod";
|
|
2879
2915
|
|
|
2880
2916
|
// packages/plugin-protocol/dist/synthetic-contributions.js
|
|
2881
2917
|
function resolveConfigSectionContributionLocalId(section) {
|
|
@@ -2895,34 +2931,34 @@ var KAY_UI_NATIVE_EVENT_SUBSCRIPTIONS = [
|
|
|
2895
2931
|
"native:renderer.contributions.changed"
|
|
2896
2932
|
];
|
|
2897
2933
|
var KAY_UI_NATIVE_EVENT_ALLOWLIST = new Set(KAY_UI_NATIVE_EVENT_SUBSCRIPTIONS);
|
|
2898
|
-
var KayAgentTargetManifest =
|
|
2934
|
+
var KayAgentTargetManifest = z11.strictObject({
|
|
2899
2935
|
entrypoint: TargetEntrypoint,
|
|
2900
|
-
contributes:
|
|
2901
|
-
tools:
|
|
2902
|
-
converters:
|
|
2903
|
-
uriModules:
|
|
2936
|
+
contributes: z11.strictObject({
|
|
2937
|
+
tools: z11.array(ToolContribution).optional(),
|
|
2938
|
+
converters: z11.array(ConverterContribution).optional(),
|
|
2939
|
+
uriModules: z11.array(UriModuleContribution).optional(),
|
|
2904
2940
|
// Host-composed artifact-backed schemes (see `ArtifactUriModuleContribution`): the plugin
|
|
2905
2941
|
// declares scheme + editability; the daemon binds each to the kernel's artifact lifecycle
|
|
2906
2942
|
// per session. Separate from `uriModules` (plugin-implemented backends) precisely because
|
|
2907
2943
|
// the plugin registers NOTHING for these at activation.
|
|
2908
|
-
artifactUriModules:
|
|
2909
|
-
cliBindings:
|
|
2944
|
+
artifactUriModules: z11.array(ArtifactUriModuleContribution).optional(),
|
|
2945
|
+
cliBindings: z11.array(CliBindingContribution).optional(),
|
|
2910
2946
|
// Which git hosts this plugin's credential serves (see `GitHostContribution`): a
|
|
2911
2947
|
// declaration, so a plugin for any git backend gets credentialed clones without
|
|
2912
2948
|
// the daemon learning its name. Sibling of `cliBindings` because both answer the
|
|
2913
2949
|
// same question — which of this plugin's auth services a host-side consumer
|
|
2914
2950
|
// resolves — for two different transports.
|
|
2915
|
-
gitHosts:
|
|
2916
|
-
resources:
|
|
2917
|
-
skills:
|
|
2918
|
-
searchProviders:
|
|
2919
|
-
interactionDrivers:
|
|
2920
|
-
entityResolvers:
|
|
2921
|
-
renderers:
|
|
2951
|
+
gitHosts: z11.array(GitHostContribution).optional(),
|
|
2952
|
+
resources: z11.array(ResourceContribution).optional(),
|
|
2953
|
+
skills: z11.array(SkillContribution).optional(),
|
|
2954
|
+
searchProviders: z11.array(SearchProviderContribution).optional(),
|
|
2955
|
+
interactionDrivers: z11.array(InteractionDriverContribution).optional(),
|
|
2956
|
+
entityResolvers: z11.array(EntityResolverContribution).optional(),
|
|
2957
|
+
renderers: z11.array(AgentRenderContribution).optional(),
|
|
2922
2958
|
// Handler restricted to skill | tool by the manifest-level refinement below (see
|
|
2923
2959
|
// `CommandContribution`'s doc for why the restriction is not expressed in the type, and
|
|
2924
2960
|
// `CommandHandler`'s doc for why there is no promptTemplate variant to declare here).
|
|
2925
|
-
commands:
|
|
2961
|
+
commands: z11.array(CommandContribution).optional()
|
|
2926
2962
|
}).optional(),
|
|
2927
2963
|
/**
|
|
2928
2964
|
* The plugin's primer skill — the `localId` of one of its own declared
|
|
@@ -2968,55 +3004,55 @@ var KayAgentTargetManifest = z10.strictObject({
|
|
|
2968
3004
|
* acquisition, not declared here, so there is nothing for the resolved contract to mint a
|
|
2969
3005
|
* `globalId` for at parse time.
|
|
2970
3006
|
*/
|
|
2971
|
-
skillSources:
|
|
3007
|
+
skillSources: z11.array(PluginSkillSourceDeclaration).optional()
|
|
2972
3008
|
});
|
|
2973
|
-
var KayAppTargetManifest =
|
|
3009
|
+
var KayAppTargetManifest = z11.strictObject({
|
|
2974
3010
|
// Optional, like `kay.ui`'s: a target may carry only declarative `contributes` (e.g. a plugin
|
|
2975
3011
|
// that ships nothing but `mcpServers`) with no app-lifetime module for the host to load.
|
|
2976
3012
|
entrypoint: TargetEntrypoint.optional(),
|
|
2977
|
-
contributes:
|
|
3013
|
+
contributes: z11.strictObject({
|
|
2978
3014
|
// Session tools implemented by the app-lifetime activation (registered once, injected into
|
|
2979
3015
|
// every session with a host-stamped session context) — the tool counterpart of `uriModules`
|
|
2980
3016
|
// below. Same descriptor shape as kay.agent tools; `toolName` shares ONE flat session
|
|
2981
3017
|
// namespace with them (enforced by the manifest-level refinement below).
|
|
2982
|
-
tools:
|
|
2983
|
-
endpoints:
|
|
2984
|
-
uriModules:
|
|
2985
|
-
dataSources:
|
|
2986
|
-
whiteboardTypes:
|
|
2987
|
-
eventDefinitions:
|
|
3018
|
+
tools: z11.array(ToolContribution).optional(),
|
|
3019
|
+
endpoints: z11.array(EndpointContribution).optional(),
|
|
3020
|
+
uriModules: z11.array(AppUriModuleContribution).optional(),
|
|
3021
|
+
dataSources: z11.array(AppDataSourceContribution).optional(),
|
|
3022
|
+
whiteboardTypes: z11.array(WhiteboardTypeContribution).optional(),
|
|
3023
|
+
eventDefinitions: z11.array(PluginEventDefinitionContribution).optional(),
|
|
2988
3024
|
// Default notification rules over this plugin's own `eventDefinitions`; seeded by the host
|
|
2989
3025
|
// (see `PluginNotificationRuleContribution`).
|
|
2990
|
-
notificationRules:
|
|
2991
|
-
eventSubscriptions:
|
|
2992
|
-
deviceDelegations:
|
|
2993
|
-
corpusConsumers:
|
|
2994
|
-
contextContributors:
|
|
3026
|
+
notificationRules: z11.array(PluginNotificationRuleContribution).optional(),
|
|
3027
|
+
eventSubscriptions: z11.array(AppEventSubscription).optional(),
|
|
3028
|
+
deviceDelegations: z11.array(DeviceDelegationContribution).optional(),
|
|
3029
|
+
corpusConsumers: z11.array(CorpusContribution).optional(),
|
|
3030
|
+
contextContributors: z11.array(ContextContributorContribution).optional(),
|
|
2995
3031
|
// Vendored MCP servers this plugin ships (see `McpServerContributions`). Each is hosted only
|
|
2996
3032
|
// for a plugin holding `mcp.host-server` for its name and URL; that is decided at
|
|
2997
3033
|
// composition, not here (see ARCHITECTURE.md "Validation Law").
|
|
2998
3034
|
mcpServers: McpServerContributions.optional(),
|
|
2999
3035
|
// Handler restricted to endpoint-only by the manifest-level refinement below.
|
|
3000
|
-
commands:
|
|
3036
|
+
commands: z11.array(CommandContribution).optional()
|
|
3001
3037
|
}).optional()
|
|
3002
3038
|
});
|
|
3003
|
-
var KayUiTargetManifest =
|
|
3039
|
+
var KayUiTargetManifest = z11.strictObject({
|
|
3004
3040
|
entrypoint: TargetEntrypoint.optional(),
|
|
3005
|
-
contributes:
|
|
3006
|
-
commands:
|
|
3007
|
-
slots:
|
|
3008
|
-
settingsPanels:
|
|
3009
|
-
resultRenderers:
|
|
3010
|
-
referencePresentations:
|
|
3011
|
-
views:
|
|
3012
|
-
apps:
|
|
3013
|
-
themes:
|
|
3014
|
-
eventSubscriptions:
|
|
3015
|
-
dataMaterializers:
|
|
3041
|
+
contributes: z11.strictObject({
|
|
3042
|
+
commands: z11.array(UiCommandContribution).optional(),
|
|
3043
|
+
slots: z11.array(UiSlotContribution).optional(),
|
|
3044
|
+
settingsPanels: z11.array(SettingsPanelContribution).optional(),
|
|
3045
|
+
resultRenderers: z11.array(ResultRendererContribution).optional(),
|
|
3046
|
+
referencePresentations: z11.array(ReferencePresentationContribution).optional(),
|
|
3047
|
+
views: z11.array(RichViewContribution).optional(),
|
|
3048
|
+
apps: z11.array(UiAppContribution).optional(),
|
|
3049
|
+
themes: z11.array(ThemeContribution).optional(),
|
|
3050
|
+
eventSubscriptions: z11.array(UiEventSubscriptionContribution).optional(),
|
|
3051
|
+
dataMaterializers: z11.array(AppDataMaterializerContribution).optional()
|
|
3016
3052
|
}).optional()
|
|
3017
3053
|
});
|
|
3018
|
-
var PluginConfigScope =
|
|
3019
|
-
var PluginConfigSectionManifest =
|
|
3054
|
+
var PluginConfigScope = z11.enum(["global", "project", "agent"]);
|
|
3055
|
+
var PluginConfigSectionManifest = z11.strictObject({
|
|
3020
3056
|
section: NonEmptyString.optional(),
|
|
3021
3057
|
schema: JsonSchema,
|
|
3022
3058
|
/**
|
|
@@ -3034,25 +3070,25 @@ var PluginConfigSectionManifest = z10.strictObject({
|
|
|
3034
3070
|
* is the baseline every section has; `agent` has no runtime mapping (the
|
|
3035
3071
|
* agent/entity fold is downstream of the document protocol).
|
|
3036
3072
|
*/
|
|
3037
|
-
scopes:
|
|
3073
|
+
scopes: z11.array(PluginConfigScope).optional()
|
|
3038
3074
|
});
|
|
3039
|
-
var PluginConfigManifest =
|
|
3075
|
+
var PluginConfigManifest = z11.array(PluginConfigSectionManifest).min(1);
|
|
3040
3076
|
function configSectionKeysForManifest(manifest) {
|
|
3041
3077
|
return manifest.config?.map((config) => config.section ?? `plugins.${manifest.id}`) ?? [];
|
|
3042
3078
|
}
|
|
3043
|
-
var PluginStorageManifest =
|
|
3044
|
-
sqlite:
|
|
3045
|
-
enabled:
|
|
3046
|
-
ownerTarget:
|
|
3079
|
+
var PluginStorageManifest = z11.strictObject({
|
|
3080
|
+
sqlite: z11.strictObject({
|
|
3081
|
+
enabled: z11.boolean(),
|
|
3082
|
+
ownerTarget: z11.literal("kay.app").optional(),
|
|
3047
3083
|
migrations: NonEmptyString.optional()
|
|
3048
3084
|
}).optional(),
|
|
3049
|
-
dataDir:
|
|
3050
|
-
enabled:
|
|
3051
|
-
ownerTarget:
|
|
3085
|
+
dataDir: z11.strictObject({
|
|
3086
|
+
enabled: z11.boolean(),
|
|
3087
|
+
ownerTarget: z11.literal("kay.app").optional()
|
|
3052
3088
|
}).optional()
|
|
3053
3089
|
});
|
|
3054
|
-
var PluginOAuthClientSupplier =
|
|
3055
|
-
var PluginProvisioningProbe =
|
|
3090
|
+
var PluginOAuthClientSupplier = z11.enum(["kay", "user"]);
|
|
3091
|
+
var PluginProvisioningProbe = z11.strictObject({
|
|
3056
3092
|
/**
|
|
3057
3093
|
* The API endpoint that answers the question. The host sends the service's OWN credential here,
|
|
3058
3094
|
* so this must belong to the provider that minted it — enforced by the daemon against the
|
|
@@ -3060,13 +3096,13 @@ var PluginProvisioningProbe = z10.strictObject({
|
|
|
3060
3096
|
*/
|
|
3061
3097
|
url: HttpsUrl,
|
|
3062
3098
|
/** Absent ⇒ `GET`. */
|
|
3063
|
-
method:
|
|
3099
|
+
method: z11.enum(["GET"]).optional(),
|
|
3064
3100
|
/**
|
|
3065
3101
|
* The statuses that make the response a VERDICT at all. Anything else (a 401 from a stale
|
|
3066
3102
|
* token, a 5xx, a rate limit) means the probe learned nothing and reports `unknown` — never
|
|
3067
3103
|
* `unsatisfied`, which would tell a user to go fix setup that is fine.
|
|
3068
3104
|
*/
|
|
3069
|
-
verdictStatuses:
|
|
3105
|
+
verdictStatuses: z11.array(SignedInStatusCode).min(1),
|
|
3070
3106
|
/**
|
|
3071
3107
|
* Dot-path to a JSON array in the response body that must be NON-EMPTY for the requirement to
|
|
3072
3108
|
* count as satisfied (e.g. `installations`). Absent means a verdict status alone is enough.
|
|
@@ -3075,7 +3111,7 @@ var PluginProvisioningProbe = z10.strictObject({
|
|
|
3075
3111
|
*/
|
|
3076
3112
|
nonEmptyArrayAt: NonEmptyString.optional()
|
|
3077
3113
|
});
|
|
3078
|
-
var PluginProvisioningRequirement =
|
|
3114
|
+
var PluginProvisioningRequirement = z11.strictObject({
|
|
3079
3115
|
/** Stable id, unique within the scheme. */
|
|
3080
3116
|
id: LocalContributionId,
|
|
3081
3117
|
/** Human-facing requirement name, e.g. "GitHub App installation". */
|
|
@@ -3092,7 +3128,7 @@ var PluginProvisioningRequirement = z10.strictObject({
|
|
|
3092
3128
|
probe: PluginProvisioningProbe
|
|
3093
3129
|
});
|
|
3094
3130
|
var PluginProvisioningField = {
|
|
3095
|
-
provisioning:
|
|
3131
|
+
provisioning: z11.array(PluginProvisioningRequirement).optional()
|
|
3096
3132
|
};
|
|
3097
3133
|
var PluginAuthSchemeDescriptionFields = {
|
|
3098
3134
|
/** Human-facing flow name; the runtime scheme name is the fallback. */
|
|
@@ -3105,19 +3141,19 @@ var PluginAuthSchemeDescriptionFields = {
|
|
|
3105
3141
|
*/
|
|
3106
3142
|
summary: NonEmptyString.optional()
|
|
3107
3143
|
};
|
|
3108
|
-
var PluginAuthSchemeOAuthPkce =
|
|
3144
|
+
var PluginAuthSchemeOAuthPkce = z11.strictObject({
|
|
3109
3145
|
...PluginProvisioningField,
|
|
3110
3146
|
...PluginAuthSchemeDescriptionFields,
|
|
3111
3147
|
localId: LocalContributionId,
|
|
3112
|
-
kind:
|
|
3113
|
-
exchange:
|
|
3148
|
+
kind: z11.literal("oauth2"),
|
|
3149
|
+
exchange: z11.literal("pkce"),
|
|
3114
3150
|
/**
|
|
3115
3151
|
* Unordered SET of who may supply the client — non-empty, and every entry must be distinct
|
|
3116
3152
|
* (fail-closed re-assertion of the kernel's construction-time dedupe: TS exhaustiveness never
|
|
3117
3153
|
* runs on an untrusted manifest, so a hand-built `["kay","kay"]` must be refused here, not
|
|
3118
3154
|
* silently normalized).
|
|
3119
3155
|
*/
|
|
3120
|
-
clientSuppliers:
|
|
3156
|
+
clientSuppliers: z11.array(PluginOAuthClientSupplier).nonempty().superRefine((suppliers, ctx) => {
|
|
3121
3157
|
if (new Set(suppliers).size !== suppliers.length) {
|
|
3122
3158
|
ctx.addIssue({
|
|
3123
3159
|
code: "custom",
|
|
@@ -3125,53 +3161,53 @@ var PluginAuthSchemeOAuthPkce = z10.strictObject({
|
|
|
3125
3161
|
});
|
|
3126
3162
|
}
|
|
3127
3163
|
}),
|
|
3128
|
-
scopes:
|
|
3164
|
+
scopes: z11.array(NonEmptyString).optional()
|
|
3129
3165
|
});
|
|
3130
|
-
var PluginAuthSchemeOAuthConfidential =
|
|
3166
|
+
var PluginAuthSchemeOAuthConfidential = z11.strictObject({
|
|
3131
3167
|
...PluginProvisioningField,
|
|
3132
3168
|
...PluginAuthSchemeDescriptionFields,
|
|
3133
3169
|
localId: LocalContributionId,
|
|
3134
|
-
kind:
|
|
3135
|
-
exchange:
|
|
3170
|
+
kind: z11.literal("oauth2"),
|
|
3171
|
+
exchange: z11.literal("confidential"),
|
|
3136
3172
|
/** Absent means `["kay"]` — a confidential exchange's secret may only ever be Bonsai's. */
|
|
3137
|
-
clientSuppliers:
|
|
3138
|
-
scopes:
|
|
3173
|
+
clientSuppliers: z11.tuple([z11.literal("kay")]).optional(),
|
|
3174
|
+
scopes: z11.array(NonEmptyString).optional()
|
|
3139
3175
|
});
|
|
3140
|
-
var PluginAuthSchemeOAuth2 =
|
|
3176
|
+
var PluginAuthSchemeOAuth2 = z11.discriminatedUnion("exchange", [
|
|
3141
3177
|
PluginAuthSchemeOAuthPkce,
|
|
3142
3178
|
PluginAuthSchemeOAuthConfidential
|
|
3143
3179
|
]);
|
|
3144
|
-
var PluginAuthSchemeApiKey =
|
|
3180
|
+
var PluginAuthSchemeApiKey = z11.strictObject({
|
|
3145
3181
|
...PluginProvisioningField,
|
|
3146
3182
|
...PluginAuthSchemeDescriptionFields,
|
|
3147
3183
|
localId: LocalContributionId,
|
|
3148
|
-
kind:
|
|
3149
|
-
scopes:
|
|
3184
|
+
kind: z11.literal("api-key"),
|
|
3185
|
+
scopes: z11.array(NonEmptyString).optional()
|
|
3150
3186
|
});
|
|
3151
|
-
var PluginAuthSchemeDelegated =
|
|
3187
|
+
var PluginAuthSchemeDelegated = z11.strictObject({
|
|
3152
3188
|
...PluginAuthSchemeDescriptionFields,
|
|
3153
3189
|
localId: LocalContributionId,
|
|
3154
|
-
kind:
|
|
3155
|
-
scopes:
|
|
3190
|
+
kind: z11.literal("delegated"),
|
|
3191
|
+
scopes: z11.array(NonEmptyString).optional()
|
|
3156
3192
|
});
|
|
3157
|
-
var ExternalCliArgument =
|
|
3193
|
+
var ExternalCliArgument = z11.string().min(1).max(16384).refine((value) => ![...value].some(isUnsafeArgumentCharacter), {
|
|
3158
3194
|
message: "an argument may hold tabs and line breaks, but no other control character, no invisible character and no bidirectional override"
|
|
3159
3195
|
});
|
|
3160
3196
|
function isUnsafeArgumentCharacter(character) {
|
|
3161
3197
|
const code = character.codePointAt(0) ?? 0;
|
|
3162
3198
|
return code <= 31 && code !== 9 && code !== 10 || code >= 127 && code <= 159 || code === 1564 || code >= 8203 && code <= 8207 || code === 8232 || code === 8233 || code >= 8234 && code <= 8238 || code >= 8288 && code <= 8297 || code === 65279;
|
|
3163
3199
|
}
|
|
3164
|
-
var ExternalCliCommand =
|
|
3200
|
+
var ExternalCliCommand = z11.string().max(128).regex(/^[A-Za-z0-9][A-Za-z0-9._+-]*$/, {
|
|
3165
3201
|
message: "a command is an executable's basename (letters, digits, '.', '_', '+', '-'), never a path"
|
|
3166
3202
|
});
|
|
3167
3203
|
var ExternalCliHint = NonEmptyString.max(2048);
|
|
3168
|
-
var ExternalCliArguments =
|
|
3169
|
-
var PluginExternalCliConnect =
|
|
3204
|
+
var ExternalCliArguments = z11.array(ExternalCliArgument).max(64);
|
|
3205
|
+
var PluginExternalCliConnect = z11.strictObject({
|
|
3170
3206
|
/** A basename the host finds on `PATH` (`osascript`, `wrangler`), never a path. */
|
|
3171
3207
|
binary: ExternalCliCommand,
|
|
3172
|
-
probe:
|
|
3208
|
+
probe: z11.strictObject({
|
|
3173
3209
|
args: ExternalCliArguments.min(1),
|
|
3174
|
-
timeoutMs:
|
|
3210
|
+
timeoutMs: z11.number().int().min(1).max(12e4).optional(),
|
|
3175
3211
|
/**
|
|
3176
3212
|
* The CLI's own signed-out marker: text a failed probe's output (stderr, else stdout) contains
|
|
3177
3213
|
* when the CLI is signed out. A failure that carries it is a sign-in problem, and only such a
|
|
@@ -3181,18 +3217,18 @@ var PluginExternalCliConnect = z10.strictObject({
|
|
|
3181
3217
|
signedOutMarker: ExternalCliArgument.refine((value) => value.trim() !== "", { message: "a signed-out marker needs text beyond whitespace" }).optional()
|
|
3182
3218
|
}),
|
|
3183
3219
|
/** The CLI's interactive sign-in. Absent: connect only probes and reports. */
|
|
3184
|
-
login:
|
|
3220
|
+
login: z11.strictObject({
|
|
3185
3221
|
args: ExternalCliArguments.min(1),
|
|
3186
|
-
timeoutMs:
|
|
3222
|
+
timeoutMs: z11.number().int().min(1).max(6e5).optional()
|
|
3187
3223
|
}).optional(),
|
|
3188
3224
|
/**
|
|
3189
3225
|
* The command that installs `binary`, as an argv. Bonsai never runs it: a surface shows it, joined
|
|
3190
3226
|
* for display, or hands it to an agent session that runs it behind the ordinary bash approval.
|
|
3191
3227
|
* Absent for a binary the OS ships (`osascript`).
|
|
3192
3228
|
*/
|
|
3193
|
-
install:
|
|
3229
|
+
install: z11.strictObject({ command: ExternalCliCommand, args: ExternalCliArguments }).optional(),
|
|
3194
3230
|
/** Prose for a person: `install` when the binary is missing, `login` when the probe fails. */
|
|
3195
|
-
hints:
|
|
3231
|
+
hints: z11.strictObject({ install: ExternalCliHint, login: ExternalCliHint })
|
|
3196
3232
|
}).superRefine((cli, ctx) => {
|
|
3197
3233
|
if (cli.login !== void 0 && cli.probe.signedOutMarker === void 0) {
|
|
3198
3234
|
ctx.addIssue({
|
|
@@ -3202,42 +3238,42 @@ var PluginExternalCliConnect = z10.strictObject({
|
|
|
3202
3238
|
});
|
|
3203
3239
|
}
|
|
3204
3240
|
});
|
|
3205
|
-
var PluginAuthSchemeExternalCli =
|
|
3241
|
+
var PluginAuthSchemeExternalCli = z11.strictObject({
|
|
3206
3242
|
...PluginAuthSchemeDescriptionFields,
|
|
3207
3243
|
localId: LocalContributionId,
|
|
3208
|
-
kind:
|
|
3209
|
-
scopes:
|
|
3244
|
+
kind: z11.literal("external-cli"),
|
|
3245
|
+
scopes: z11.array(NonEmptyString).optional(),
|
|
3210
3246
|
cli: PluginExternalCliConnect.optional()
|
|
3211
3247
|
});
|
|
3212
|
-
var PluginAuthScheme =
|
|
3248
|
+
var PluginAuthScheme = z11.discriminatedUnion("kind", [
|
|
3213
3249
|
PluginAuthSchemeOAuth2,
|
|
3214
3250
|
PluginAuthSchemeApiKey,
|
|
3215
3251
|
PluginAuthSchemeDelegated,
|
|
3216
3252
|
PluginAuthSchemeExternalCli
|
|
3217
3253
|
]);
|
|
3218
|
-
var PluginWebSessionProbe =
|
|
3254
|
+
var PluginWebSessionProbe = z11.strictObject({
|
|
3219
3255
|
url: HttpsUrl,
|
|
3220
3256
|
/** Absent ⇒ `GET`. `POST` sends an empty JSON object body. */
|
|
3221
|
-
method:
|
|
3222
|
-
signedInStatuses:
|
|
3257
|
+
method: z11.enum(["GET", "POST"]).optional(),
|
|
3258
|
+
signedInStatuses: z11.array(SignedInStatusCode).min(1)
|
|
3223
3259
|
});
|
|
3224
|
-
var PluginWebSessionDeclaration =
|
|
3260
|
+
var PluginWebSessionDeclaration = z11.strictObject({
|
|
3225
3261
|
/** `required`: capabilities degrade without the site login; `recommended`: it only smooths UX. */
|
|
3226
|
-
importance:
|
|
3262
|
+
importance: z11.enum(["required", "recommended"]),
|
|
3227
3263
|
loginUrl: HttpsUrl,
|
|
3228
|
-
cookieDomains:
|
|
3264
|
+
cookieDomains: z11.array(RegistrableDomain).min(1),
|
|
3229
3265
|
probe: PluginWebSessionProbe,
|
|
3230
|
-
oauthVenue:
|
|
3266
|
+
oauthVenue: z11.enum(["embedded", "external"])
|
|
3231
3267
|
}).superRefine(refineWebSessionScopeConfined);
|
|
3232
|
-
var PluginAuthService =
|
|
3268
|
+
var PluginAuthService = z11.strictObject({
|
|
3233
3269
|
localId: LocalContributionId,
|
|
3234
3270
|
displayName: NonEmptyString,
|
|
3235
|
-
schemes:
|
|
3236
|
-
purposes:
|
|
3271
|
+
schemes: z11.array(PluginAuthScheme).min(1),
|
|
3272
|
+
purposes: z11.array(NonEmptyString).min(1),
|
|
3237
3273
|
webSession: PluginWebSessionDeclaration.optional()
|
|
3238
3274
|
});
|
|
3239
|
-
var PluginAuthManifest =
|
|
3240
|
-
services:
|
|
3275
|
+
var PluginAuthManifest = z11.strictObject({
|
|
3276
|
+
services: z11.array(PluginAuthService).optional()
|
|
3241
3277
|
});
|
|
3242
3278
|
var RETIRED_COMPATIBILITY_KEYS = ["policy"];
|
|
3243
3279
|
function stripRetiredCompatibilityKeys(value) {
|
|
@@ -3249,8 +3285,8 @@ function stripRetiredCompatibilityKeys(value) {
|
|
|
3249
3285
|
delete remaining[key];
|
|
3250
3286
|
return remaining;
|
|
3251
3287
|
}
|
|
3252
|
-
var PluginCompatibilityManifest =
|
|
3253
|
-
supportedProtocols:
|
|
3288
|
+
var PluginCompatibilityManifest = z11.preprocess(stripRetiredCompatibilityKeys, z11.strictObject({
|
|
3289
|
+
supportedProtocols: z11.array(KayPluginProtocolVersion).optional(),
|
|
3254
3290
|
minKayVersion: NonEmptyString.optional(),
|
|
3255
3291
|
sdk: NonEmptyString.optional()
|
|
3256
3292
|
}));
|
|
@@ -3266,8 +3302,8 @@ function retiredCompatibilityKeysIn(rawManifest) {
|
|
|
3266
3302
|
var KayVersionString = NonEmptyString.regex(SEMVER_PATTERN, {
|
|
3267
3303
|
message: "version must be semver, for example 1.2.3"
|
|
3268
3304
|
});
|
|
3269
|
-
var KayPluginManifestV1 =
|
|
3270
|
-
protocol:
|
|
3305
|
+
var KayPluginManifestV1 = z11.strictObject({
|
|
3306
|
+
protocol: z11.literal(KAY_PLUGIN_PROTOCOL_VERSION),
|
|
3271
3307
|
id: PluginId,
|
|
3272
3308
|
displayName: NonEmptyString,
|
|
3273
3309
|
version: KayVersionString,
|
|
@@ -3297,8 +3333,8 @@ var KayPluginManifestV1 = z10.strictObject({
|
|
|
3297
3333
|
icon: PackageAssetPath.optional(),
|
|
3298
3334
|
iconDark: PackageAssetPath.optional(),
|
|
3299
3335
|
namespace: PluginNamespace.optional(),
|
|
3300
|
-
targets:
|
|
3301
|
-
kay:
|
|
3336
|
+
targets: z11.strictObject({
|
|
3337
|
+
kay: z11.strictObject({
|
|
3302
3338
|
agent: KayAgentTargetManifest.optional(),
|
|
3303
3339
|
app: KayAppTargetManifest.optional(),
|
|
3304
3340
|
ui: KayUiTargetManifest.optional()
|
|
@@ -3315,15 +3351,15 @@ var KayPluginManifestV1 = z10.strictObject({
|
|
|
3315
3351
|
* schemes then report `ownedByBonsai`. Honoured only for a plugin that ships with Bonsai: the
|
|
3316
3352
|
* host reads any other plugin's flag as false. Absent ⇒ false.
|
|
3317
3353
|
*/
|
|
3318
|
-
ownedByBonsai:
|
|
3354
|
+
ownedByBonsai: z11.boolean().optional(),
|
|
3319
3355
|
/**
|
|
3320
3356
|
* Explicit plugin-level dependencies — other plugins this plugin requires to be present in the
|
|
3321
3357
|
* composed roster. At composition time the runtime checks each id against the accepted
|
|
3322
3358
|
* registration list and derives a provenance-complete dependency graph (together with implicit
|
|
3323
3359
|
* auth-service edges from `consumesAuthServices`). Absent ⇒ no explicit dependencies.
|
|
3324
3360
|
*/
|
|
3325
|
-
dependencies:
|
|
3326
|
-
plugins:
|
|
3361
|
+
dependencies: z11.strictObject({
|
|
3362
|
+
plugins: z11.array(PluginId).optional()
|
|
3327
3363
|
}).optional()
|
|
3328
3364
|
}).superRefine((manifest, ctx) => {
|
|
3329
3365
|
const authServices = new Set(manifest.auth?.services?.map((service) => service.localId) ?? []);
|
|
@@ -4008,7 +4044,7 @@ function pushContributionIds(output, path, items) {
|
|
|
4008
4044
|
}
|
|
4009
4045
|
|
|
4010
4046
|
// packages/plugin-protocol/dist/plugin-directory-verdict.js
|
|
4011
|
-
import { z as
|
|
4047
|
+
import { z as z13 } from "zod";
|
|
4012
4048
|
|
|
4013
4049
|
// packages/plugin-protocol/dist/plugin-load-diagnostic.js
|
|
4014
4050
|
var PLUGIN_DIAGNOSTIC_MESSAGE_CAP = 300;
|
|
@@ -4017,36 +4053,44 @@ function boundPluginDiagnosticMessage(message) {
|
|
|
4017
4053
|
}
|
|
4018
4054
|
|
|
4019
4055
|
// packages/plugin-protocol/dist/resolved-contract.js
|
|
4020
|
-
import { z as
|
|
4021
|
-
var ResolvedPluginContributionId =
|
|
4056
|
+
import { z as z12 } from "zod";
|
|
4057
|
+
var ResolvedPluginContributionId = z12.strictObject({
|
|
4022
4058
|
target: PluginTargetName,
|
|
4023
4059
|
kind: PluginContributionKind,
|
|
4024
|
-
localId:
|
|
4060
|
+
localId: PluginEventLocalId,
|
|
4025
4061
|
globalId: GlobalContributionId
|
|
4062
|
+
}).superRefine((value, ctx) => {
|
|
4063
|
+
if (value.kind !== "eventDefinition" && !LocalContributionId.safeParse(value.localId).success) {
|
|
4064
|
+
ctx.addIssue({
|
|
4065
|
+
code: "custom",
|
|
4066
|
+
path: ["localId"],
|
|
4067
|
+
message: "Only event definitions may use dotted local ids"
|
|
4068
|
+
});
|
|
4069
|
+
}
|
|
4026
4070
|
});
|
|
4027
|
-
var ResolvedKayAgentTool =
|
|
4071
|
+
var ResolvedKayAgentTool = z12.strictObject({
|
|
4028
4072
|
localId: LocalContributionId,
|
|
4029
4073
|
globalId: GlobalContributionId,
|
|
4030
4074
|
toolName: PluginToolName
|
|
4031
4075
|
});
|
|
4032
4076
|
var ResolvedKayAppTool = ResolvedKayAgentTool;
|
|
4033
|
-
var ResolvedKayAppDataSource =
|
|
4077
|
+
var ResolvedKayAppDataSource = z12.strictObject({
|
|
4034
4078
|
localId: LocalContributionId,
|
|
4035
4079
|
globalId: GlobalContributionId,
|
|
4036
|
-
scope:
|
|
4037
|
-
snapshot:
|
|
4038
|
-
version:
|
|
4039
|
-
schema:
|
|
4080
|
+
scope: z12.enum(["runtime", "account", "session"]),
|
|
4081
|
+
snapshot: z12.strictObject({
|
|
4082
|
+
version: z12.number().int().positive(),
|
|
4083
|
+
schema: z12.record(z12.string(), z12.unknown())
|
|
4040
4084
|
}),
|
|
4041
|
-
change:
|
|
4042
|
-
version:
|
|
4043
|
-
schema:
|
|
4044
|
-
semantics:
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
kind:
|
|
4048
|
-
maxEncodedBytes:
|
|
4049
|
-
rationale:
|
|
4085
|
+
change: z12.strictObject({
|
|
4086
|
+
version: z12.number().int().positive(),
|
|
4087
|
+
schema: z12.record(z12.string(), z12.unknown()),
|
|
4088
|
+
semantics: z12.discriminatedUnion("kind", [
|
|
4089
|
+
z12.strictObject({ kind: z12.literal("incremental") }),
|
|
4090
|
+
z12.strictObject({
|
|
4091
|
+
kind: z12.literal("snapshot-replacement"),
|
|
4092
|
+
maxEncodedBytes: z12.number().int().positive(),
|
|
4093
|
+
rationale: z12.string().trim().min(1).max(1024)
|
|
4050
4094
|
})
|
|
4051
4095
|
]).optional()
|
|
4052
4096
|
}),
|
|
@@ -4060,66 +4104,66 @@ var ResolvedKayAppDataSource = z11.strictObject({
|
|
|
4060
4104
|
});
|
|
4061
4105
|
}
|
|
4062
4106
|
});
|
|
4063
|
-
var ResolvedKayAppWhiteboardType =
|
|
4107
|
+
var ResolvedKayAppWhiteboardType = z12.strictObject({
|
|
4064
4108
|
localId: LocalContributionId,
|
|
4065
4109
|
globalId: GlobalContributionId,
|
|
4066
4110
|
displayName: NonEmptyString,
|
|
4067
|
-
schemaVersion:
|
|
4111
|
+
schemaVersion: z12.number().int().positive(),
|
|
4068
4112
|
storage: WhiteboardTypeStorage,
|
|
4069
4113
|
valueSchema: JsonSchema,
|
|
4070
|
-
presentation:
|
|
4114
|
+
presentation: z12.strictObject({
|
|
4071
4115
|
app: GlobalContributionId
|
|
4072
4116
|
}).optional()
|
|
4073
4117
|
});
|
|
4074
|
-
var ResolvedKayAppMcpServer =
|
|
4118
|
+
var ResolvedKayAppMcpServer = z12.strictObject({
|
|
4075
4119
|
name: LocalContributionId,
|
|
4076
4120
|
pluginId: PluginId,
|
|
4077
4121
|
url: McpServerUrl,
|
|
4078
4122
|
auth: McpServerAuthMode,
|
|
4079
4123
|
authServiceId: GlobalContributionId.optional()
|
|
4080
4124
|
});
|
|
4081
|
-
var ResolvedKayAgentUriModule =
|
|
4125
|
+
var ResolvedKayAgentUriModule = z12.strictObject({
|
|
4082
4126
|
localId: LocalContributionId,
|
|
4083
4127
|
globalId: GlobalContributionId,
|
|
4084
|
-
schemes:
|
|
4128
|
+
schemes: z12.array(UriScheme).min(1),
|
|
4085
4129
|
filesystemBacking: UriFilesystemBacking.optional(),
|
|
4086
4130
|
/** Mirrors `UriModuleContribution.knownResources` (host-side recording opt-in). */
|
|
4087
|
-
knownResources:
|
|
4131
|
+
knownResources: z12.literal(true).optional()
|
|
4088
4132
|
});
|
|
4089
|
-
var ResolvedKayAgentArtifactUriModule =
|
|
4133
|
+
var ResolvedKayAgentArtifactUriModule = z12.strictObject({
|
|
4090
4134
|
localId: LocalContributionId,
|
|
4091
4135
|
globalId: GlobalContributionId,
|
|
4092
4136
|
scheme: UriScheme,
|
|
4093
|
-
editable:
|
|
4094
|
-
listable:
|
|
4095
|
-
deletable:
|
|
4096
|
-
appendable:
|
|
4097
|
-
storageScope:
|
|
4137
|
+
editable: z12.boolean(),
|
|
4138
|
+
listable: z12.boolean(),
|
|
4139
|
+
deletable: z12.boolean(),
|
|
4140
|
+
appendable: z12.boolean(),
|
|
4141
|
+
storageScope: z12.enum(["session", "family"])
|
|
4098
4142
|
});
|
|
4099
|
-
var ResolvedKayAgentEntityResolver =
|
|
4143
|
+
var ResolvedKayAgentEntityResolver = z12.strictObject({
|
|
4100
4144
|
localId: LocalContributionId,
|
|
4101
4145
|
globalId: GlobalContributionId,
|
|
4102
4146
|
displayName: NonEmptyString.optional(),
|
|
4103
4147
|
uriModule: GlobalContributionId,
|
|
4104
|
-
entityTypes:
|
|
4148
|
+
entityTypes: z12.array(NonEmptyString).min(1),
|
|
4105
4149
|
uriHint: NonEmptyString
|
|
4106
4150
|
});
|
|
4107
|
-
var ResolvedKayAgentGitHostClaim =
|
|
4151
|
+
var ResolvedKayAgentGitHostClaim = z12.strictObject({
|
|
4108
4152
|
host: GitHostName,
|
|
4109
4153
|
authServiceId: GlobalContributionId,
|
|
4110
4154
|
/** Manifest-declared order; the clone ladder tries them in sequence. */
|
|
4111
|
-
authSchemeIds:
|
|
4155
|
+
authSchemeIds: z12.array(GlobalContributionId).min(1),
|
|
4112
4156
|
/** Non-secret display copy for the claiming service, for clone failure text. */
|
|
4113
|
-
authServiceDisplayName:
|
|
4157
|
+
authServiceDisplayName: z12.string(),
|
|
4114
4158
|
basicAuthUser: GitBasicAuthUser
|
|
4115
4159
|
});
|
|
4116
|
-
var ResolvedKayAgentConverter =
|
|
4160
|
+
var ResolvedKayAgentConverter = z12.strictObject({
|
|
4117
4161
|
localId: LocalContributionId,
|
|
4118
4162
|
globalId: GlobalContributionId,
|
|
4119
|
-
mimeTypes:
|
|
4120
|
-
extensions:
|
|
4163
|
+
mimeTypes: z12.array(MimeTypeString).min(1),
|
|
4164
|
+
extensions: z12.array(FileExtensionToken).min(1).optional()
|
|
4121
4165
|
});
|
|
4122
|
-
var ResolvedReferencePresentation =
|
|
4166
|
+
var ResolvedReferencePresentation = z12.strictObject({
|
|
4123
4167
|
localId: LocalContributionId,
|
|
4124
4168
|
globalId: GlobalContributionId,
|
|
4125
4169
|
uriModule: GlobalContributionId,
|
|
@@ -4127,9 +4171,9 @@ var ResolvedReferencePresentation = z11.strictObject({
|
|
|
4127
4171
|
open: ReferenceOpenBehavior,
|
|
4128
4172
|
/** MIME-specific resource kinds; absent keys use the base presentation. */
|
|
4129
4173
|
variants: ReferencePresentationVariants.optional(),
|
|
4130
|
-
claims:
|
|
4174
|
+
claims: z12.array(ReferencePresentationUrlClaim).optional()
|
|
4131
4175
|
});
|
|
4132
|
-
var ResolvedPluginProvisioningRequirement =
|
|
4176
|
+
var ResolvedPluginProvisioningRequirement = z12.strictObject({
|
|
4133
4177
|
id: LocalContributionId,
|
|
4134
4178
|
displayName: NonEmptyString,
|
|
4135
4179
|
description: NonEmptyString,
|
|
@@ -4139,15 +4183,15 @@ var ResolvedPluginProvisioningRequirement = z11.strictObject({
|
|
|
4139
4183
|
* URL degrades to "Reconnect" in the UI instead of a broken link.
|
|
4140
4184
|
*/
|
|
4141
4185
|
remediationUrl: HttpsUrl.optional(),
|
|
4142
|
-
probe:
|
|
4186
|
+
probe: z12.strictObject({
|
|
4143
4187
|
url: HttpsUrl,
|
|
4144
|
-
method:
|
|
4145
|
-
verdictStatuses:
|
|
4188
|
+
method: z12.enum(["GET"]),
|
|
4189
|
+
verdictStatuses: z12.array(SignedInStatusCode).min(1),
|
|
4146
4190
|
nonEmptyArrayAt: NonEmptyString.optional()
|
|
4147
4191
|
})
|
|
4148
4192
|
});
|
|
4149
4193
|
var ResolvedProvisioningField = {
|
|
4150
|
-
provisioning:
|
|
4194
|
+
provisioning: z12.array(ResolvedPluginProvisioningRequirement).optional()
|
|
4151
4195
|
};
|
|
4152
4196
|
var ResolvedPluginAuthSchemeDescriptionFields = {
|
|
4153
4197
|
displayName: NonEmptyString.optional(),
|
|
@@ -4159,98 +4203,99 @@ var ResolvedPluginAuthSchemeOAuthBase = {
|
|
|
4159
4203
|
...ResolvedPluginAuthSchemeDescriptionFields,
|
|
4160
4204
|
localId: LocalContributionId,
|
|
4161
4205
|
globalId: GlobalContributionId,
|
|
4162
|
-
kind:
|
|
4163
|
-
scopes:
|
|
4206
|
+
kind: z12.literal("oauth2"),
|
|
4207
|
+
scopes: z12.array(z12.string()).optional()
|
|
4164
4208
|
};
|
|
4165
|
-
var ResolvedPluginAuthSchemeOAuthPkce =
|
|
4209
|
+
var ResolvedPluginAuthSchemeOAuthPkce = z12.strictObject({
|
|
4166
4210
|
...ResolvedPluginAuthSchemeOAuthBase,
|
|
4167
|
-
exchange:
|
|
4168
|
-
clientSuppliers:
|
|
4211
|
+
exchange: z12.literal("pkce"),
|
|
4212
|
+
clientSuppliers: z12.array(PluginOAuthClientSupplier).nonempty()
|
|
4169
4213
|
});
|
|
4170
|
-
var ResolvedPluginAuthSchemeOAuthConfidential =
|
|
4214
|
+
var ResolvedPluginAuthSchemeOAuthConfidential = z12.strictObject({
|
|
4171
4215
|
...ResolvedPluginAuthSchemeOAuthBase,
|
|
4172
|
-
exchange:
|
|
4173
|
-
clientSuppliers:
|
|
4216
|
+
exchange: z12.literal("confidential"),
|
|
4217
|
+
clientSuppliers: z12.tuple([z12.literal("kay")])
|
|
4174
4218
|
});
|
|
4175
|
-
var ResolvedPluginAuthSchemeOAuth2 =
|
|
4219
|
+
var ResolvedPluginAuthSchemeOAuth2 = z12.discriminatedUnion("exchange", [
|
|
4176
4220
|
ResolvedPluginAuthSchemeOAuthPkce,
|
|
4177
4221
|
ResolvedPluginAuthSchemeOAuthConfidential
|
|
4178
4222
|
]);
|
|
4179
|
-
var ResolvedPluginAuthSchemeApiKey =
|
|
4223
|
+
var ResolvedPluginAuthSchemeApiKey = z12.strictObject({
|
|
4180
4224
|
...ResolvedProvisioningField,
|
|
4181
4225
|
...ResolvedPluginAuthSchemeDescriptionFields,
|
|
4182
4226
|
localId: LocalContributionId,
|
|
4183
4227
|
globalId: GlobalContributionId,
|
|
4184
|
-
kind:
|
|
4185
|
-
scopes:
|
|
4228
|
+
kind: z12.literal("api-key"),
|
|
4229
|
+
scopes: z12.array(z12.string()).optional()
|
|
4186
4230
|
});
|
|
4187
|
-
var ResolvedPluginAuthSchemeDelegated =
|
|
4231
|
+
var ResolvedPluginAuthSchemeDelegated = z12.strictObject({
|
|
4188
4232
|
...ResolvedPluginAuthSchemeDescriptionFields,
|
|
4189
4233
|
localId: LocalContributionId,
|
|
4190
4234
|
globalId: GlobalContributionId,
|
|
4191
|
-
kind:
|
|
4192
|
-
scopes:
|
|
4235
|
+
kind: z12.literal("delegated"),
|
|
4236
|
+
scopes: z12.array(z12.string()).optional()
|
|
4193
4237
|
});
|
|
4194
|
-
var ResolvedPluginAuthSchemeExternalCli =
|
|
4238
|
+
var ResolvedPluginAuthSchemeExternalCli = z12.strictObject({
|
|
4195
4239
|
...ResolvedPluginAuthSchemeDescriptionFields,
|
|
4196
4240
|
localId: LocalContributionId,
|
|
4197
4241
|
globalId: GlobalContributionId,
|
|
4198
|
-
kind:
|
|
4199
|
-
scopes:
|
|
4242
|
+
kind: z12.literal("external-cli"),
|
|
4243
|
+
scopes: z12.array(z12.string()).optional(),
|
|
4200
4244
|
/** The manifest's connect facts, verbatim. */
|
|
4201
4245
|
cli: PluginExternalCliConnect.optional()
|
|
4202
4246
|
});
|
|
4203
|
-
var ResolvedPluginAuthScheme =
|
|
4247
|
+
var ResolvedPluginAuthScheme = z12.discriminatedUnion("kind", [
|
|
4204
4248
|
ResolvedPluginAuthSchemeOAuth2,
|
|
4205
4249
|
ResolvedPluginAuthSchemeApiKey,
|
|
4206
4250
|
ResolvedPluginAuthSchemeDelegated,
|
|
4207
4251
|
ResolvedPluginAuthSchemeExternalCli
|
|
4208
4252
|
]);
|
|
4209
|
-
var ResolvedPluginWebSession =
|
|
4210
|
-
importance:
|
|
4253
|
+
var ResolvedPluginWebSession = z12.strictObject({
|
|
4254
|
+
importance: z12.enum(["required", "recommended"]),
|
|
4211
4255
|
loginUrl: HttpsUrl,
|
|
4212
|
-
cookieDomains:
|
|
4213
|
-
probe:
|
|
4256
|
+
cookieDomains: z12.array(RegistrableDomain).min(1),
|
|
4257
|
+
probe: z12.strictObject({
|
|
4214
4258
|
url: HttpsUrl,
|
|
4215
|
-
method:
|
|
4216
|
-
signedInStatuses:
|
|
4259
|
+
method: z12.enum(["GET", "POST"]),
|
|
4260
|
+
signedInStatuses: z12.array(SignedInStatusCode).min(1)
|
|
4217
4261
|
}),
|
|
4218
|
-
oauthVenue:
|
|
4262
|
+
oauthVenue: z12.enum(["embedded", "external"])
|
|
4219
4263
|
}).superRefine(refineWebSessionScopeConfined);
|
|
4220
|
-
var ResolvedPluginAuthService =
|
|
4264
|
+
var ResolvedPluginAuthService = z12.strictObject({
|
|
4221
4265
|
localId: LocalContributionId,
|
|
4222
4266
|
globalId: GlobalContributionId,
|
|
4223
|
-
displayName:
|
|
4224
|
-
schemes:
|
|
4225
|
-
purposes:
|
|
4267
|
+
displayName: z12.string(),
|
|
4268
|
+
schemes: z12.array(ResolvedPluginAuthScheme).min(1),
|
|
4269
|
+
purposes: z12.array(z12.string()).min(1),
|
|
4226
4270
|
/** The service's browser half, when the manifest declares one. */
|
|
4227
4271
|
webSession: ResolvedPluginWebSession.optional()
|
|
4228
4272
|
});
|
|
4229
|
-
var ResolvedKayUiAppEndpointCapability =
|
|
4273
|
+
var ResolvedKayUiAppEndpointCapability = z12.strictObject({
|
|
4230
4274
|
localId: LocalContributionId,
|
|
4231
4275
|
globalId: GlobalContributionId
|
|
4232
4276
|
});
|
|
4233
|
-
var ResolvedKayUiApp =
|
|
4277
|
+
var ResolvedKayUiApp = z12.strictObject({
|
|
4234
4278
|
localId: LocalContributionId,
|
|
4235
4279
|
globalId: GlobalContributionId,
|
|
4236
4280
|
displayName: NonEmptyString,
|
|
4281
|
+
activityRail: UiAppActivityRail.optional(),
|
|
4237
4282
|
description: NonEmptyString.optional(),
|
|
4238
4283
|
icon: PackageAssetPath.optional(),
|
|
4239
|
-
runtime:
|
|
4240
|
-
sdk:
|
|
4284
|
+
runtime: z12.literal("kay.react-app.v1"),
|
|
4285
|
+
sdk: z12.strictObject({ range: NonEmptyString }),
|
|
4241
4286
|
entrypoint: TargetEntrypoint,
|
|
4242
|
-
styles:
|
|
4243
|
-
assets:
|
|
4244
|
-
capabilities:
|
|
4245
|
-
endpoints:
|
|
4246
|
-
host:
|
|
4287
|
+
styles: z12.array(PackageAssetPath).optional(),
|
|
4288
|
+
assets: z12.array(PackageAssetPath).optional(),
|
|
4289
|
+
capabilities: z12.strictObject({
|
|
4290
|
+
endpoints: z12.array(ResolvedKayUiAppEndpointCapability).optional(),
|
|
4291
|
+
host: z12.array(KayUiAppHostCapability).optional()
|
|
4247
4292
|
}).optional()
|
|
4248
4293
|
});
|
|
4249
|
-
var ResolvedPluginContractV1 =
|
|
4250
|
-
protocol:
|
|
4294
|
+
var ResolvedPluginContractV1 = z12.strictObject({
|
|
4295
|
+
protocol: z12.literal("kay.plugin.v1"),
|
|
4251
4296
|
pluginId: PluginId,
|
|
4252
4297
|
namespace: PluginNamespace,
|
|
4253
|
-
contributions:
|
|
4298
|
+
contributions: z12.array(ResolvedPluginContributionId),
|
|
4254
4299
|
// The deduplicated set of qualified (dotted) external auth-service ids this
|
|
4255
4300
|
// plugin references, from agent uriModule `authService` refs, cliBinding
|
|
4256
4301
|
// `authService` refs, and auth-grant `service` refs. Always present — a plugin
|
|
@@ -4258,30 +4303,30 @@ var ResolvedPluginContractV1 = z11.strictObject({
|
|
|
4258
4303
|
// is a recorded dependency, not a resolution: there is no runtime plugin
|
|
4259
4304
|
// loader in v1, so nothing here verifies the reference resolves within a
|
|
4260
4305
|
// composed roster (a composition-time concern owned elsewhere).
|
|
4261
|
-
consumesAuthServices:
|
|
4306
|
+
consumesAuthServices: z12.array(GlobalContributionId),
|
|
4262
4307
|
// The explicit plugin-level dependency ids declared in `dependencies.plugins` on the manifest,
|
|
4263
4308
|
// deduped and validated at parse time. Always present; a plugin with no explicit dependencies
|
|
4264
4309
|
// carries an empty array. Composition checks each id against the accepted roster and derives the
|
|
4265
4310
|
// full dependency graph together with auth-inferred edges from `consumesAuthServices`.
|
|
4266
|
-
explicitDependencies:
|
|
4311
|
+
explicitDependencies: z12.array(PluginId),
|
|
4267
4312
|
// The auth services this plugin OWNS, carrying the global ids its harness
|
|
4268
4313
|
// target must register and the credential authority keys on. Always present;
|
|
4269
4314
|
// a plugin that declares no `auth.services` carries an empty array. The dual
|
|
4270
4315
|
// of `consumesAuthServices` (services it merely references).
|
|
4271
|
-
authServices:
|
|
4316
|
+
authServices: z12.array(ResolvedPluginAuthService),
|
|
4272
4317
|
grants: ResolvedPluginGrants.optional(),
|
|
4273
|
-
kayAgentUriModules:
|
|
4274
|
-
kayAgentArtifactUriModules:
|
|
4275
|
-
kayAgentEntityResolvers:
|
|
4276
|
-
kayAgentGitHostClaims:
|
|
4277
|
-
kayAgentTools:
|
|
4278
|
-
kayAppTools:
|
|
4279
|
-
kayAppDataSources:
|
|
4280
|
-
kayAppWhiteboardTypes:
|
|
4281
|
-
kayAppMcpServers:
|
|
4282
|
-
kayAgentConverters:
|
|
4283
|
-
referencePresentations:
|
|
4284
|
-
kayUiApps:
|
|
4318
|
+
kayAgentUriModules: z12.array(ResolvedKayAgentUriModule).optional(),
|
|
4319
|
+
kayAgentArtifactUriModules: z12.array(ResolvedKayAgentArtifactUriModule).optional(),
|
|
4320
|
+
kayAgentEntityResolvers: z12.array(ResolvedKayAgentEntityResolver).optional(),
|
|
4321
|
+
kayAgentGitHostClaims: z12.array(ResolvedKayAgentGitHostClaim).optional(),
|
|
4322
|
+
kayAgentTools: z12.array(ResolvedKayAgentTool).optional(),
|
|
4323
|
+
kayAppTools: z12.array(ResolvedKayAppTool).optional(),
|
|
4324
|
+
kayAppDataSources: z12.array(ResolvedKayAppDataSource).optional(),
|
|
4325
|
+
kayAppWhiteboardTypes: z12.array(ResolvedKayAppWhiteboardType).optional(),
|
|
4326
|
+
kayAppMcpServers: z12.array(ResolvedKayAppMcpServer).optional(),
|
|
4327
|
+
kayAgentConverters: z12.array(ResolvedKayAgentConverter).optional(),
|
|
4328
|
+
referencePresentations: z12.array(ResolvedReferencePresentation).optional(),
|
|
4329
|
+
kayUiApps: z12.array(ResolvedKayUiApp).optional()
|
|
4285
4330
|
});
|
|
4286
4331
|
function narrowestAccountSelectors() {
|
|
4287
4332
|
return [{ kind: "active" }];
|
|
@@ -4639,6 +4684,7 @@ function resolveKayPluginContractV1(manifest) {
|
|
|
4639
4684
|
const kayUiApps = manifest.targets?.kay?.ui?.contributes?.apps?.map((app) => ({
|
|
4640
4685
|
localId: app.localId,
|
|
4641
4686
|
globalId: resolveGlobalContributionId(namespace, app.localId),
|
|
4687
|
+
...app.activityRail === void 0 ? {} : { activityRail: app.activityRail },
|
|
4642
4688
|
displayName: app.displayName,
|
|
4643
4689
|
...app.description === void 0 ? {} : { description: app.description },
|
|
4644
4690
|
...app.icon === void 0 ? {} : { icon: app.icon },
|
|
@@ -4792,7 +4838,7 @@ async function judgeKayPluginDirectory(input) {
|
|
|
4792
4838
|
if (!resolved.success) {
|
|
4793
4839
|
return refuse("contract-resolve", "contract-unresolvable", `contract could not be resolved: ${resolved.error.message}`);
|
|
4794
4840
|
}
|
|
4795
|
-
const { contract, misnamedTools } = keepNamespaceDerivedTools(resolved.data);
|
|
4841
|
+
const { contract, misnamedTools } = keepNamespaceDerivedTools(resolved.data, new Set(input.grandfatheredToolNames?.(manifest.id) ?? []));
|
|
4796
4842
|
for (const tool of misnamedTools) {
|
|
4797
4843
|
warnings.push({
|
|
4798
4844
|
stage: "contract-resolve",
|
|
@@ -4833,23 +4879,23 @@ function kayPluginCompatibilityAdvisories(input) {
|
|
|
4833
4879
|
message: boundPluginDiagnosticMessage(`${manifest.displayName} (${manifest.id}) ${advisory.message}`)
|
|
4834
4880
|
}));
|
|
4835
4881
|
}
|
|
4836
|
-
var ReadableCompatibility =
|
|
4837
|
-
supportedProtocols:
|
|
4882
|
+
var ReadableCompatibility = z13.object({
|
|
4883
|
+
supportedProtocols: z13.array(z13.string()).optional().catch(void 0),
|
|
4838
4884
|
minKayVersion: NonEmptyString.optional().catch(void 0),
|
|
4839
4885
|
sdk: NonEmptyString.optional().catch(void 0)
|
|
4840
4886
|
});
|
|
4841
|
-
var ReadableManifestHead =
|
|
4842
|
-
id:
|
|
4843
|
-
displayName:
|
|
4887
|
+
var ReadableManifestHead = z13.object({
|
|
4888
|
+
id: z13.string().optional().catch(void 0),
|
|
4889
|
+
displayName: z13.string().optional().catch(void 0),
|
|
4844
4890
|
compatibility: ReadableCompatibility.optional().catch(void 0)
|
|
4845
4891
|
});
|
|
4846
|
-
function keepNamespaceDerivedTools(contract) {
|
|
4892
|
+
function keepNamespaceDerivedTools(contract, grandfathered) {
|
|
4847
4893
|
const misnamedTools = [];
|
|
4848
4894
|
const droppedGlobalIds = /* @__PURE__ */ new Set();
|
|
4849
4895
|
const keep = (tools) => {
|
|
4850
4896
|
const kept = tools?.filter((tool) => {
|
|
4851
4897
|
const expected = deriveDirectoryPluginToolName(contract.namespace, tool.localId);
|
|
4852
|
-
if (tool.toolName === expected)
|
|
4898
|
+
if (tool.toolName === expected || grandfathered.has(tool.toolName))
|
|
4853
4899
|
return true;
|
|
4854
4900
|
misnamedTools.push({
|
|
4855
4901
|
localId: tool.localId,
|
|
@@ -4939,28 +4985,28 @@ function errorText(error) {
|
|
|
4939
4985
|
}
|
|
4940
4986
|
|
|
4941
4987
|
// packages/plugin-protocol/dist/session-health.js
|
|
4942
|
-
import { z as
|
|
4988
|
+
import { z as z14 } from "zod";
|
|
4943
4989
|
var SESSION_HEALTH_EXTENSION_ID = "kay.session-health";
|
|
4944
4990
|
var SESSION_HEALTH_ENTRY_NAME = "session_health";
|
|
4945
4991
|
var SESSION_HEALTH_CUSTOM_TYPE = `ext:${SESSION_HEALTH_EXTENSION_ID}:${SESSION_HEALTH_ENTRY_NAME}`;
|
|
4946
4992
|
var SESSION_HEALTH_CLASSIFIER_IDS = ["jev"];
|
|
4947
|
-
var sessionHealthEntrySchema =
|
|
4948
|
-
v:
|
|
4949
|
-
verdict:
|
|
4993
|
+
var sessionHealthEntrySchema = z14.object({
|
|
4994
|
+
v: z14.literal(1),
|
|
4995
|
+
verdict: z14.enum(["well", "bad", "unknown"]),
|
|
4950
4996
|
/**
|
|
4951
4997
|
* The model's calibrated confidence in `well`, 0..1, or null when the
|
|
4952
4998
|
* classifier declined to produce one. Never exported raw: the telemetry
|
|
4953
4999
|
* event carries only the decile bucket.
|
|
4954
5000
|
*/
|
|
4955
|
-
p_well:
|
|
4956
|
-
classifier:
|
|
4957
|
-
classifier_version:
|
|
4958
|
-
judged_at:
|
|
4959
|
-
user_entry_id:
|
|
4960
|
-
through_entry_id:
|
|
4961
|
-
usage:
|
|
4962
|
-
input_tokens:
|
|
4963
|
-
output_tokens:
|
|
5001
|
+
p_well: z14.number().min(0).max(1).nullable(),
|
|
5002
|
+
classifier: z14.enum(SESSION_HEALTH_CLASSIFIER_IDS),
|
|
5003
|
+
classifier_version: z14.string().min(1).max(64),
|
|
5004
|
+
judged_at: z14.number().int().nonnegative(),
|
|
5005
|
+
user_entry_id: z14.string().min(1).max(256),
|
|
5006
|
+
through_entry_id: z14.string().min(1).max(256),
|
|
5007
|
+
usage: z14.strictObject({
|
|
5008
|
+
input_tokens: z14.number().int().nonnegative(),
|
|
5009
|
+
output_tokens: z14.number().int().nonnegative()
|
|
4964
5010
|
}).optional()
|
|
4965
5011
|
});
|
|
4966
5012
|
function sessionHealthPWellDecile(pWell) {
|
|
@@ -4970,23 +5016,23 @@ function sessionHealthPWellDecile(pWell) {
|
|
|
4970
5016
|
}
|
|
4971
5017
|
|
|
4972
5018
|
// packages/plugin-protocol/dist/resource-invocations.js
|
|
4973
|
-
import { z as
|
|
4974
|
-
var CorpusResourceKind =
|
|
5019
|
+
import { z as z15 } from "zod";
|
|
5020
|
+
var CorpusResourceKind = z15.enum([
|
|
4975
5021
|
"skill",
|
|
4976
5022
|
"context-file",
|
|
4977
5023
|
"prompt-command"
|
|
4978
5024
|
]);
|
|
4979
|
-
var CorpusResourceInvocationCursor =
|
|
4980
|
-
at:
|
|
4981
|
-
eventId:
|
|
5025
|
+
var CorpusResourceInvocationCursor = z15.strictObject({
|
|
5026
|
+
at: z15.iso.datetime({ offset: true }),
|
|
5027
|
+
eventId: z15.string().min(1)
|
|
4982
5028
|
});
|
|
4983
|
-
var CorpusResourceInvocationQuery =
|
|
5029
|
+
var CorpusResourceInvocationQuery = z15.strictObject({
|
|
4984
5030
|
kind: CorpusResourceKind,
|
|
4985
|
-
since:
|
|
4986
|
-
until:
|
|
5031
|
+
since: z15.iso.datetime({ offset: true }),
|
|
5032
|
+
until: z15.iso.datetime({ offset: true }),
|
|
4987
5033
|
after: CorpusResourceInvocationCursor.optional(),
|
|
4988
|
-
limit:
|
|
4989
|
-
rootCreatedByKind:
|
|
5034
|
+
limit: z15.number().int().min(1).max(1e3).optional(),
|
|
5035
|
+
rootCreatedByKind: z15.enum(AGENT_RUNTIME_SESSION_CREATOR_KINDS).optional()
|
|
4990
5036
|
}).refine((value) => Date.parse(value.since) < Date.parse(value.until), {
|
|
4991
5037
|
message: "since must precede until"
|
|
4992
5038
|
});
|
|
@@ -5166,14 +5212,14 @@ function skillSuggestionEvidenceItems(evidence, options = {}) {
|
|
|
5166
5212
|
}
|
|
5167
5213
|
|
|
5168
5214
|
// packages/plugin-protocol/dist/ui-app-package.js
|
|
5169
|
-
import { z as
|
|
5215
|
+
import { z as z16 } from "zod";
|
|
5170
5216
|
var KAY_UI_APP_PACKAGE_PROTOCOL = "kay.ui.app-package.v1";
|
|
5171
5217
|
var KAY_UI_BUNDLE_INDEX_PROTOCOL = "kay.ui.bundle-index.v1";
|
|
5172
|
-
var KayUiBundleOutputPath =
|
|
5173
|
-
var KayUiBundleIndexV1 =
|
|
5174
|
-
protocol:
|
|
5218
|
+
var KayUiBundleOutputPath = z16.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" });
|
|
5219
|
+
var KayUiBundleIndexV1 = z16.strictObject({
|
|
5220
|
+
protocol: z16.literal(KAY_UI_BUNDLE_INDEX_PROTOCOL),
|
|
5175
5221
|
entryPath: KayUiBundleOutputPath,
|
|
5176
|
-
files:
|
|
5222
|
+
files: z16.array(z16.strictObject({
|
|
5177
5223
|
path: KayUiBundleOutputPath,
|
|
5178
5224
|
mediaType: NonEmptyString
|
|
5179
5225
|
})).min(1)
|
|
@@ -5200,19 +5246,19 @@ var KayUiBundleIndexV1 = z15.strictObject({
|
|
|
5200
5246
|
function parseKayUiBundleIndexV1(input) {
|
|
5201
5247
|
return KayUiBundleIndexV1.parse(input);
|
|
5202
5248
|
}
|
|
5203
|
-
var KayUiAppPackageFile =
|
|
5249
|
+
var KayUiAppPackageFile = z16.strictObject({
|
|
5204
5250
|
path: PackageAssetPath,
|
|
5205
5251
|
mediaType: NonEmptyString,
|
|
5206
|
-
bytes:
|
|
5252
|
+
bytes: z16.instanceof(Uint8Array).refine((bytes) => bytes.byteLength > 0, {
|
|
5207
5253
|
message: "app package file bytes must not be empty"
|
|
5208
5254
|
})
|
|
5209
5255
|
});
|
|
5210
|
-
var KayUiAppPackageV1 =
|
|
5211
|
-
protocol:
|
|
5256
|
+
var KayUiAppPackageV1 = z16.strictObject({
|
|
5257
|
+
protocol: z16.literal(KAY_UI_APP_PACKAGE_PROTOCOL),
|
|
5212
5258
|
appLocalId: LocalContributionId,
|
|
5213
5259
|
entry: KayUiAppPackageFile,
|
|
5214
|
-
styles:
|
|
5215
|
-
assets:
|
|
5260
|
+
styles: z16.array(KayUiAppPackageFile).optional(),
|
|
5261
|
+
assets: z16.array(KayUiAppPackageFile).optional()
|
|
5216
5262
|
}).superRefine((appPackage, ctx) => {
|
|
5217
5263
|
if (appPackage.entry.mediaType !== "application/javascript") {
|
|
5218
5264
|
ctx.addIssue({
|
|
@@ -5249,16 +5295,16 @@ function parseKayUiAppPackageV1(input) {
|
|
|
5249
5295
|
}
|
|
5250
5296
|
|
|
5251
5297
|
// packages/plugin-protocol/dist/whiteboard.js
|
|
5252
|
-
import { z as
|
|
5298
|
+
import { z as z17 } from "zod";
|
|
5253
5299
|
var WhiteboardValue = JsonValue;
|
|
5254
|
-
var WhiteboardEntryEnvelope =
|
|
5300
|
+
var WhiteboardEntryEnvelope = z17.strictObject({
|
|
5255
5301
|
id: NonEmptyString,
|
|
5256
5302
|
typeId: GlobalContributionId,
|
|
5257
|
-
schemaVersion:
|
|
5258
|
-
title:
|
|
5303
|
+
schemaVersion: z17.number().int().positive(),
|
|
5304
|
+
title: z17.string(),
|
|
5259
5305
|
authorSessionId: NonEmptyString.nullable()
|
|
5260
5306
|
});
|
|
5261
|
-
var WhiteboardEntrySummary =
|
|
5307
|
+
var WhiteboardEntrySummary = z17.strictObject({
|
|
5262
5308
|
name: NonEmptyString,
|
|
5263
5309
|
entry: WhiteboardEntryEnvelope,
|
|
5264
5310
|
revision: NonEmptyString
|
|
@@ -5266,31 +5312,31 @@ var WhiteboardEntrySummary = z16.strictObject({
|
|
|
5266
5312
|
var WhiteboardEntrySnapshot = WhiteboardEntrySummary.extend({
|
|
5267
5313
|
value: WhiteboardValue
|
|
5268
5314
|
});
|
|
5269
|
-
var WhiteboardDiagnostic =
|
|
5315
|
+
var WhiteboardDiagnostic = z17.strictObject({
|
|
5270
5316
|
ruleId: NonEmptyString,
|
|
5271
|
-
severity:
|
|
5317
|
+
severity: z17.enum(["error", "warning"]),
|
|
5272
5318
|
message: NonEmptyString
|
|
5273
5319
|
});
|
|
5274
|
-
var WhiteboardEntryInfo =
|
|
5320
|
+
var WhiteboardEntryInfo = z17.strictObject({
|
|
5275
5321
|
name: NonEmptyString,
|
|
5276
5322
|
revision: NonEmptyString,
|
|
5277
5323
|
entry: WhiteboardEntryEnvelope.optional(),
|
|
5278
|
-
state:
|
|
5279
|
-
mutable:
|
|
5280
|
-
diagnostics:
|
|
5324
|
+
state: z17.enum(["available", "unavailable", "unsupported-version", "invalid"]),
|
|
5325
|
+
mutable: z17.boolean(),
|
|
5326
|
+
diagnostics: z17.array(z17.string())
|
|
5281
5327
|
});
|
|
5282
5328
|
var WhiteboardEntryInspection = WhiteboardEntryInfo.extend({
|
|
5283
5329
|
value: WhiteboardValue.optional(),
|
|
5284
|
-
text:
|
|
5285
|
-
truncated:
|
|
5330
|
+
text: z17.string(),
|
|
5331
|
+
truncated: z17.boolean()
|
|
5286
5332
|
});
|
|
5287
|
-
var WhiteboardTypeInfo =
|
|
5333
|
+
var WhiteboardTypeInfo = z17.strictObject({
|
|
5288
5334
|
typeId: GlobalContributionId,
|
|
5289
5335
|
displayName: NonEmptyString,
|
|
5290
|
-
schemaVersion:
|
|
5291
|
-
available:
|
|
5336
|
+
schemaVersion: z17.number().int().positive(),
|
|
5337
|
+
available: z17.boolean(),
|
|
5292
5338
|
/** A plugin-owned readonly presentation; absent types use the host fallback. */
|
|
5293
|
-
presentation:
|
|
5339
|
+
presentation: z17.strictObject({
|
|
5294
5340
|
app: GlobalContributionId
|
|
5295
5341
|
}).optional()
|
|
5296
5342
|
});
|
|
@@ -5383,6 +5429,7 @@ export {
|
|
|
5383
5429
|
KnowledgeSearchGrantRequest,
|
|
5384
5430
|
KnownResourcesGrantRequest,
|
|
5385
5431
|
LocalContributionId,
|
|
5432
|
+
MCP_SIGN_IN_SCHEME_KIND,
|
|
5386
5433
|
McpServerAuthMode,
|
|
5387
5434
|
McpServerContribution,
|
|
5388
5435
|
McpServerContributions,
|
|
@@ -5391,6 +5438,7 @@ export {
|
|
|
5391
5438
|
NonEmptyString,
|
|
5392
5439
|
PLUGIN_CAPABILITY_SLUGS,
|
|
5393
5440
|
PLUGIN_DIAGNOSTIC_MESSAGE_CAP,
|
|
5441
|
+
PLUGIN_EVENT_ID_MAX_BYTES,
|
|
5394
5442
|
PLUGIN_ICON_SHAPE_ATTRIBUTE,
|
|
5395
5443
|
PLUGIN_NOTIFICATION_RULE_HOST_KEYS,
|
|
5396
5444
|
PackageAssetPath,
|
|
@@ -5409,6 +5457,15 @@ export {
|
|
|
5409
5457
|
PluginConfigSectionManifest,
|
|
5410
5458
|
PluginContributionKind,
|
|
5411
5459
|
PluginEventDefinitionContribution,
|
|
5460
|
+
PluginEventEnvelope,
|
|
5461
|
+
PluginEventId,
|
|
5462
|
+
PluginEventLocalId,
|
|
5463
|
+
PluginEventPublishInput,
|
|
5464
|
+
PluginEventPublishSource,
|
|
5465
|
+
PluginEventRelated,
|
|
5466
|
+
PluginEventSource,
|
|
5467
|
+
PluginEventTimestamp,
|
|
5468
|
+
PluginEventUri,
|
|
5412
5469
|
PluginExternalCliConnect,
|
|
5413
5470
|
PluginId,
|
|
5414
5471
|
PluginNamespace,
|
|
@@ -5488,6 +5545,7 @@ export {
|
|
|
5488
5545
|
TargetPermissionWiring,
|
|
5489
5546
|
ThemeContribution,
|
|
5490
5547
|
ToolContribution,
|
|
5548
|
+
UiAppActivityRail,
|
|
5491
5549
|
UiAppCapabilities,
|
|
5492
5550
|
UiAppContribution,
|
|
5493
5551
|
UiCommandContribution,
|