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