@yaklabs-ai/plugin-protocol 0.13.5 → 0.13.7
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 +182 -10
- package/dist/index.js +846 -711
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -115,13 +115,28 @@ function precedingPersonMessages(entries, packet, count) {
|
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
// packages/plugin-protocol/dist/app-data-read.js
|
|
118
|
-
import { z as
|
|
118
|
+
import { z as z4 } from "zod";
|
|
119
119
|
|
|
120
120
|
// packages/plugin-protocol/dist/common.js
|
|
121
|
+
import { z as z3 } from "zod";
|
|
122
|
+
|
|
123
|
+
// packages/plugin-protocol/dist/json.js
|
|
121
124
|
import { z as z2 } from "zod";
|
|
125
|
+
var JsonValue = z2.lazy(() => z2.union([
|
|
126
|
+
z2.string(),
|
|
127
|
+
z2.number(),
|
|
128
|
+
z2.boolean(),
|
|
129
|
+
z2.null(),
|
|
130
|
+
z2.array(JsonValue),
|
|
131
|
+
z2.record(z2.string(), JsonValue)
|
|
132
|
+
]));
|
|
133
|
+
var JsonObject = z2.record(z2.string(), JsonValue);
|
|
134
|
+
var JsonSchema = z2.record(z2.string(), JsonValue);
|
|
135
|
+
|
|
136
|
+
// packages/plugin-protocol/dist/common.js
|
|
122
137
|
var KAY_PLUGIN_PROTOCOL_VERSION = "kay.plugin.v1";
|
|
123
138
|
var KAY_PLUGIN_PROTOCOL_PACKAGE_NAME = "@bonsai/plugin-protocol";
|
|
124
|
-
var KAY_PLUGIN_SDK_VERSION = "0.13.
|
|
139
|
+
var KAY_PLUGIN_SDK_VERSION = "0.13.7";
|
|
125
140
|
var KAY_PLUGIN_COMPATIBLE_SDK_VERSIONS = [
|
|
126
141
|
"0.8.0",
|
|
127
142
|
"0.8.1",
|
|
@@ -144,70 +159,62 @@ var KAY_PLUGIN_COMPATIBLE_SDK_VERSIONS = [
|
|
|
144
159
|
"0.13.1",
|
|
145
160
|
"0.13.2",
|
|
146
161
|
"0.13.3",
|
|
147
|
-
"0.13.4"
|
|
162
|
+
"0.13.4",
|
|
163
|
+
"0.13.5",
|
|
164
|
+
"0.13.6"
|
|
148
165
|
];
|
|
149
166
|
var KAY_PLUGIN_TARGET_NAMES = [
|
|
150
167
|
"kay.agent",
|
|
151
168
|
"kay.app",
|
|
152
169
|
"kay.ui"
|
|
153
170
|
];
|
|
154
|
-
var KayPluginProtocolVersion =
|
|
155
|
-
var PluginTargetName =
|
|
156
|
-
var NonEmptyString =
|
|
157
|
-
var JsonValue = z2.lazy(() => z2.union([
|
|
158
|
-
z2.string(),
|
|
159
|
-
z2.number(),
|
|
160
|
-
z2.boolean(),
|
|
161
|
-
z2.null(),
|
|
162
|
-
z2.array(JsonValue),
|
|
163
|
-
z2.record(z2.string(), JsonValue)
|
|
164
|
-
]));
|
|
165
|
-
var JsonObject = z2.record(z2.string(), JsonValue);
|
|
166
|
-
var JsonSchema = z2.record(z2.string(), JsonValue);
|
|
171
|
+
var KayPluginProtocolVersion = z3.literal(KAY_PLUGIN_PROTOCOL_VERSION);
|
|
172
|
+
var PluginTargetName = z3.enum(KAY_PLUGIN_TARGET_NAMES);
|
|
173
|
+
var NonEmptyString = z3.string().trim().min(1);
|
|
167
174
|
var PLUGIN_ID_PATTERN = /^[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)*$/;
|
|
168
175
|
var LOCAL_CONTRIBUTION_ID_PATTERN = /^[a-z][a-z0-9-]*$/;
|
|
169
176
|
var PLUGIN_TOOL_NAME_PATTERN = /^[a-z][a-z0-9_-]*$/;
|
|
170
177
|
var PACKAGE_ASSET_PATH_PATTERN = /^\.\/(?:[A-Za-z0-9._-]+\/)*[A-Za-z0-9._-]+$/;
|
|
171
178
|
var KAY_EVENT_PUBLISHER_ID = "kay";
|
|
172
|
-
var PluginId =
|
|
179
|
+
var PluginId = z3.string().trim().regex(PLUGIN_ID_PATTERN).refine((id) => id !== KAY_EVENT_PUBLISHER_ID, {
|
|
173
180
|
message: `'${KAY_EVENT_PUBLISHER_ID}' is reserved for Bonsai's own event publisher`
|
|
174
181
|
});
|
|
175
182
|
var PluginNamespace = PluginId;
|
|
176
|
-
var LocalContributionId =
|
|
177
|
-
var GlobalContributionId =
|
|
178
|
-
var PluginToolName =
|
|
183
|
+
var LocalContributionId = z3.string().trim().regex(LOCAL_CONTRIBUTION_ID_PATTERN);
|
|
184
|
+
var GlobalContributionId = z3.string().trim().regex(PLUGIN_ID_PATTERN);
|
|
185
|
+
var PluginToolName = z3.string().trim().regex(PLUGIN_TOOL_NAME_PATTERN);
|
|
179
186
|
var AuthServiceReference = GlobalContributionId;
|
|
180
187
|
var AuthSchemeReference = GlobalContributionId;
|
|
181
|
-
var AdapterSelectionKey =
|
|
182
|
-
var AdapterPlacement =
|
|
183
|
-
var UriScheme =
|
|
184
|
-
var MimeTypeString =
|
|
185
|
-
var FileExtensionToken =
|
|
188
|
+
var AdapterSelectionKey = z3.string().trim().regex(PLUGIN_ID_PATTERN);
|
|
189
|
+
var AdapterPlacement = z3.enum(["local-only", "anywhere"]);
|
|
190
|
+
var UriScheme = z3.string().trim().regex(/^[a-z][a-z0-9+.-]*$/);
|
|
191
|
+
var MimeTypeString = z3.string().trim().regex(/^[a-z0-9][a-z0-9!#$&^_.+-]*\/[a-z0-9][a-z0-9!#$&^_.+-]*$/);
|
|
192
|
+
var FileExtensionToken = z3.string().trim().regex(/^[a-z0-9]+$/);
|
|
186
193
|
var CliBinaryName = NonEmptyString.refine((value) => !value.includes("/"), {
|
|
187
194
|
message: "cli binding binary/alias must be a basename, not a path (no '/')"
|
|
188
195
|
});
|
|
189
|
-
var CliAuthEnvVarName =
|
|
190
|
-
var PackageAssetPath =
|
|
196
|
+
var CliAuthEnvVarName = z3.string().trim().regex(/^[A-Z][A-Z0-9_]*$/);
|
|
197
|
+
var PackageAssetPath = z3.string().trim().regex(PACKAGE_ASSET_PATH_PATTERN).refine((value) => !value.split("/").includes(".."), {
|
|
191
198
|
message: "package asset path must not contain a '..' path segment"
|
|
192
199
|
});
|
|
193
|
-
var PluginSourceClass =
|
|
200
|
+
var PluginSourceClass = z3.enum([
|
|
194
201
|
"bundled",
|
|
195
202
|
"org-shared",
|
|
196
203
|
"user-local",
|
|
197
204
|
"verified-marketplace",
|
|
198
205
|
"freeform"
|
|
199
206
|
]);
|
|
200
|
-
var ArtifactGenerationId =
|
|
201
|
-
var HttpsUrl =
|
|
202
|
-
var RegistrableDomain =
|
|
207
|
+
var ArtifactGenerationId = z3.string().trim().min(1).brand();
|
|
208
|
+
var HttpsUrl = z3.url({ protocol: /^https$/ });
|
|
209
|
+
var RegistrableDomain = z3.string().trim().regex(/^[a-z0-9-]+(?:\.[a-z0-9-]+)+$/);
|
|
203
210
|
var HOST_LABEL_PATTERN = /^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/;
|
|
204
211
|
var MAX_HOST_LENGTH = 253;
|
|
205
212
|
var MAX_HOST_LABEL_LENGTH = 63;
|
|
206
213
|
var GitHostName = RegistrableDomain.max(MAX_HOST_LENGTH).refine((host) => host.split(".").every((label) => label.length <= MAX_HOST_LABEL_LENGTH && HOST_LABEL_PATTERN.test(label)), {
|
|
207
214
|
message: "git host labels must be 1-63 characters and start and end with a letter or digit"
|
|
208
215
|
});
|
|
209
|
-
var GitBasicAuthUser =
|
|
210
|
-
var HttpStatusCode =
|
|
216
|
+
var GitBasicAuthUser = z3.string().trim().min(1).max(128).regex(/^[A-Za-z0-9._~-]+$/);
|
|
217
|
+
var HttpStatusCode = z3.number().int().min(100).max(599);
|
|
211
218
|
var SignedInStatusCode = HttpStatusCode.refine((status) => !(status < 200 || status >= 300 && status < 400), {
|
|
212
219
|
message: "signedInStatuses cannot include 1xx or 3xx: the probe follows redirects and never observes them as a final status"
|
|
213
220
|
});
|
|
@@ -238,57 +245,57 @@ function refineWebSessionScopeConfined(webSession, ctx) {
|
|
|
238
245
|
});
|
|
239
246
|
}
|
|
240
247
|
}
|
|
241
|
-
var JsonPointer =
|
|
242
|
-
var TargetEntrypoint =
|
|
248
|
+
var JsonPointer = z3.string().trim().regex(/^(?:\/(?:[^/~]|~[01])*)*$/);
|
|
249
|
+
var TargetEntrypoint = z3.strictObject({
|
|
243
250
|
module: NonEmptyString,
|
|
244
251
|
export: NonEmptyString.optional()
|
|
245
252
|
});
|
|
246
253
|
|
|
247
254
|
// packages/plugin-protocol/dist/app-data-read.js
|
|
248
|
-
var AppDataVersionedSchema =
|
|
249
|
-
version:
|
|
255
|
+
var AppDataVersionedSchema = z4.strictObject({
|
|
256
|
+
version: z4.number().int().positive(),
|
|
250
257
|
schema: JsonSchema
|
|
251
258
|
});
|
|
252
|
-
var AppDataSourceRead =
|
|
259
|
+
var AppDataSourceRead = z4.strictObject({
|
|
253
260
|
request: AppDataVersionedSchema,
|
|
254
261
|
result: AppDataVersionedSchema
|
|
255
262
|
});
|
|
256
263
|
|
|
257
264
|
// packages/plugin-protocol/dist/artifact-provenance.js
|
|
258
|
-
import { z as
|
|
265
|
+
import { z as z6 } from "zod";
|
|
259
266
|
|
|
260
267
|
// packages/plugin-protocol/dist/session-provenance.js
|
|
261
|
-
import { z as
|
|
262
|
-
var NonEmptyString2 =
|
|
268
|
+
import { z as z5 } from "zod";
|
|
269
|
+
var NonEmptyString2 = z5.string().min(1);
|
|
263
270
|
var SessionId = NonEmptyString2;
|
|
264
|
-
var SessionRelationship =
|
|
271
|
+
var SessionRelationship = z5.discriminatedUnion("kind", [
|
|
265
272
|
/** Spawn lineage: this session is a subagent child of `sessionId`. */
|
|
266
|
-
|
|
273
|
+
z5.strictObject({ kind: z5.literal("child-of"), sessionId: SessionId }),
|
|
267
274
|
/**
|
|
268
275
|
* This session was forked from a point in `sessionId`'s transcript — `/fork`, and every
|
|
269
276
|
* hindsight followup. `atEntryId` pins the fork point when one was given.
|
|
270
277
|
*/
|
|
271
|
-
|
|
272
|
-
kind:
|
|
278
|
+
z5.strictObject({
|
|
279
|
+
kind: z5.literal("forked-from"),
|
|
273
280
|
sessionId: SessionId,
|
|
274
281
|
atEntryId: NonEmptyString2.optional()
|
|
275
282
|
})
|
|
276
283
|
]);
|
|
277
|
-
var SdkSessionDoor =
|
|
284
|
+
var SdkSessionDoor = z5.enum([
|
|
278
285
|
"sessions.create",
|
|
279
286
|
"sessions.run",
|
|
280
287
|
"hindsight.runFollowup",
|
|
281
288
|
"agents.run"
|
|
282
289
|
]);
|
|
283
|
-
var SessionCreator =
|
|
290
|
+
var SessionCreator = z5.discriminatedUnion("kind", [
|
|
284
291
|
/** A person, at the keyboard. `surface` names a scripted experience when one minted it. */
|
|
285
|
-
|
|
286
|
-
kind:
|
|
292
|
+
z5.strictObject({
|
|
293
|
+
kind: z5.literal("human"),
|
|
287
294
|
surface: NonEmptyString2.optional()
|
|
288
295
|
}),
|
|
289
296
|
/** Another session's agent, through a tool call. */
|
|
290
|
-
|
|
291
|
-
kind:
|
|
297
|
+
z5.strictObject({
|
|
298
|
+
kind: z5.literal("agent"),
|
|
292
299
|
sessionId: SessionId,
|
|
293
300
|
tool: NonEmptyString2,
|
|
294
301
|
/**
|
|
@@ -306,8 +313,8 @@ var SessionCreator = z4.discriminatedUnion("kind", [
|
|
|
306
313
|
toolCallId: NonEmptyString2.optional()
|
|
307
314
|
}),
|
|
308
315
|
/** A plugin, through one of its SDK doors. */
|
|
309
|
-
|
|
310
|
-
kind:
|
|
316
|
+
z5.strictObject({
|
|
317
|
+
kind: z5.literal("plugin"),
|
|
311
318
|
pluginId: NonEmptyString2,
|
|
312
319
|
door: SdkSessionDoor,
|
|
313
320
|
callerSessionId: SessionId.optional()
|
|
@@ -321,8 +328,8 @@ var SessionCreator = z4.discriminatedUnion("kind", [
|
|
|
321
328
|
* schedule nor a session-fact occurrence. Added 2026-08-19, when the automation producers
|
|
322
329
|
* landed and a watcher's report session had nothing honest to stamp.
|
|
323
330
|
*/
|
|
324
|
-
|
|
325
|
-
kind:
|
|
331
|
+
z5.strictObject({
|
|
332
|
+
kind: z5.literal("trigger"),
|
|
326
333
|
automationId: NonEmptyString2,
|
|
327
334
|
/**
|
|
328
335
|
* The AUTOMATION RUN that fired the binding (R2 provenance). Optional at
|
|
@@ -332,10 +339,10 @@ var SessionCreator = z4.discriminatedUnion("kind", [
|
|
|
332
339
|
*/
|
|
333
340
|
runId: NonEmptyString2.optional(),
|
|
334
341
|
bindingName: NonEmptyString2,
|
|
335
|
-
triggerKind:
|
|
342
|
+
triggerKind: z5.enum(["cron", "time", "occurrence", "uri-change", "manual"])
|
|
336
343
|
}),
|
|
337
344
|
/** The daemon itself, for one of its own capabilities. */
|
|
338
|
-
|
|
345
|
+
z5.strictObject({ kind: z5.literal("daemon"), capability: NonEmptyString2 })
|
|
339
346
|
]);
|
|
340
347
|
var AGENT_RUNTIME_SESSION_CREATOR_KINDS = [
|
|
341
348
|
"human",
|
|
@@ -344,26 +351,26 @@ var AGENT_RUNTIME_SESSION_CREATOR_KINDS = [
|
|
|
344
351
|
"trigger",
|
|
345
352
|
"daemon"
|
|
346
353
|
];
|
|
347
|
-
var SessionDefiner =
|
|
348
|
-
|
|
349
|
-
layer:
|
|
354
|
+
var SessionDefiner = z5.discriminatedUnion("layer", [
|
|
355
|
+
z5.strictObject({
|
|
356
|
+
layer: z5.literal("plugin"),
|
|
350
357
|
pluginId: NonEmptyString2,
|
|
351
358
|
capability: NonEmptyString2,
|
|
352
359
|
/** See the type docblock: unpopulated by design until #5230's children land. */
|
|
353
360
|
version: NonEmptyString2.optional()
|
|
354
361
|
}),
|
|
355
|
-
|
|
362
|
+
z5.strictObject({ layer: z5.literal("host"), capability: NonEmptyString2 })
|
|
356
363
|
]);
|
|
357
|
-
var SessionIntent =
|
|
358
|
-
var SessionCausedByEventShape =
|
|
364
|
+
var SessionIntent = z5.enum(["interactive", "headless"]);
|
|
365
|
+
var SessionCausedByEventShape = z5.strictObject({
|
|
359
366
|
/** The plugin's own name for the subscribe handler that made this run, e.g. `"work-record"`. */
|
|
360
367
|
handler: NonEmptyString2,
|
|
361
368
|
/** Absent reads as `"session-event"` — see this type's own doc comment. */
|
|
362
|
-
kind:
|
|
369
|
+
kind: z5.enum(["session-event", "backfill"]).optional(),
|
|
363
370
|
/** Required when `kind` is `"session-event"` or absent; must be omitted when `kind` is `"backfill"`. */
|
|
364
|
-
event:
|
|
371
|
+
event: z5.strictObject({
|
|
365
372
|
/** {@link KayAppSessionEventType} in `@bonsai/plugin-sdk`, mirrored: a closed, extensible union. */
|
|
366
|
-
type:
|
|
373
|
+
type: z5.enum([
|
|
367
374
|
"turn-settled",
|
|
368
375
|
"phase-shift",
|
|
369
376
|
"human-message",
|
|
@@ -392,8 +399,8 @@ var SessionCausedByEvent = SessionCausedByEventShape.refine((value) => (value.ki
|
|
|
392
399
|
message: 'event must be omitted when kind is "backfill"',
|
|
393
400
|
path: ["event"]
|
|
394
401
|
});
|
|
395
|
-
var SessionProvenanceRecord =
|
|
396
|
-
relationships:
|
|
402
|
+
var SessionProvenanceRecord = z5.strictObject({
|
|
403
|
+
relationships: z5.array(SessionRelationship),
|
|
397
404
|
createdBy: SessionCreator,
|
|
398
405
|
definedBy: SessionDefiner,
|
|
399
406
|
intent: SessionIntent,
|
|
@@ -457,93 +464,93 @@ function isProvenanceJson(input) {
|
|
|
457
464
|
}
|
|
458
465
|
return true;
|
|
459
466
|
}
|
|
460
|
-
var Text =
|
|
467
|
+
var Text = z6.string().min(1).refine((value) => !hasControlCharacter(value), {
|
|
461
468
|
message: "Provenance text must not contain control characters"
|
|
462
469
|
});
|
|
463
|
-
var ArtifactProvenanceRevision =
|
|
470
|
+
var ArtifactProvenanceRevision = z6.strictObject({
|
|
464
471
|
storeId: Text,
|
|
465
472
|
artifactId: Text,
|
|
466
473
|
uri: Text.optional(),
|
|
467
474
|
/** The enclosing commit is resolved by the reader, avoiding a self-referential commit hash. */
|
|
468
|
-
revision:
|
|
475
|
+
revision: z6.union([
|
|
469
476
|
Text,
|
|
470
|
-
|
|
471
|
-
|
|
477
|
+
z6.strictObject({ kind: z6.literal("enclosing-commit") }),
|
|
478
|
+
z6.null()
|
|
472
479
|
]),
|
|
473
480
|
operationId: Text.nullable(),
|
|
474
481
|
/** Optional when the store identifies revisions without content addressing (including tombstones). */
|
|
475
|
-
digest:
|
|
482
|
+
digest: z6.strictObject({ algorithm: Text, value: Text }).optional()
|
|
476
483
|
});
|
|
477
|
-
var ArtifactProvenanceActor =
|
|
478
|
-
|
|
479
|
-
kind:
|
|
484
|
+
var ArtifactProvenanceActor = z6.discriminatedUnion("kind", [
|
|
485
|
+
z6.strictObject({
|
|
486
|
+
kind: z6.literal("session"),
|
|
480
487
|
sessionId: Text,
|
|
481
488
|
runId: Text.nullable()
|
|
482
489
|
}),
|
|
483
|
-
|
|
484
|
-
kind:
|
|
490
|
+
z6.strictObject({
|
|
491
|
+
kind: z6.literal("human"),
|
|
485
492
|
userId: Text.optional(),
|
|
486
493
|
surface: Text
|
|
487
494
|
}),
|
|
488
|
-
|
|
489
|
-
kind:
|
|
495
|
+
z6.strictObject({
|
|
496
|
+
kind: z6.literal("plugin"),
|
|
490
497
|
pluginId: Text,
|
|
491
498
|
capability: Text
|
|
492
499
|
}),
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
500
|
+
z6.strictObject({ kind: z6.literal("host"), capability: Text }),
|
|
501
|
+
z6.strictObject({ kind: z6.literal("import"), source: Text }),
|
|
502
|
+
z6.strictObject({ kind: z6.literal("unknown") })
|
|
496
503
|
]);
|
|
497
|
-
var ArtifactProvenanceCause =
|
|
498
|
-
|
|
499
|
-
kind:
|
|
504
|
+
var ArtifactProvenanceCause = z6.discriminatedUnion("kind", [
|
|
505
|
+
z6.strictObject({
|
|
506
|
+
kind: z6.literal("session"),
|
|
500
507
|
sessionId: Text,
|
|
501
508
|
runId: Text.nullable()
|
|
502
509
|
}),
|
|
503
|
-
|
|
504
|
-
kind:
|
|
510
|
+
z6.strictObject({
|
|
511
|
+
kind: z6.literal("session-event"),
|
|
505
512
|
sessionId: Text,
|
|
506
513
|
cause: SessionCausedByEvent
|
|
507
514
|
}),
|
|
508
|
-
|
|
509
|
-
kind:
|
|
515
|
+
z6.strictObject({
|
|
516
|
+
kind: z6.literal("automation"),
|
|
510
517
|
automationId: Text,
|
|
511
518
|
runId: Text.nullable()
|
|
512
519
|
}),
|
|
513
|
-
|
|
520
|
+
z6.strictObject({ kind: z6.literal("operation"), operationId: Text })
|
|
514
521
|
]);
|
|
515
|
-
var ArtifactProvenanceOperation =
|
|
522
|
+
var ArtifactProvenanceOperation = z6.strictObject({
|
|
516
523
|
id: Text.nullable(),
|
|
517
|
-
at:
|
|
524
|
+
at: z6.iso.datetime().nullable(),
|
|
518
525
|
name: Text,
|
|
519
526
|
actor: ArtifactProvenanceActor,
|
|
520
527
|
/** Null means no tool invocation; a known invocation with an unknown id records a gap. */
|
|
521
|
-
invocation:
|
|
528
|
+
invocation: z6.strictObject({
|
|
522
529
|
tool: Text,
|
|
523
530
|
toolCallId: Text.nullable(),
|
|
524
|
-
origin:
|
|
531
|
+
origin: z6.enum(["model", "host"])
|
|
525
532
|
}).nullable(),
|
|
526
533
|
/** Known causes only; unavailable cause capture requires a gap, never a guessed creation cause. */
|
|
527
|
-
causes:
|
|
534
|
+
causes: z6.array(ArtifactProvenanceCause)
|
|
528
535
|
});
|
|
529
|
-
var ArtifactProvenanceReference =
|
|
530
|
-
|
|
531
|
-
kind:
|
|
536
|
+
var ArtifactProvenanceReference = z6.discriminatedUnion("kind", [
|
|
537
|
+
z6.strictObject({
|
|
538
|
+
kind: z6.literal("session"),
|
|
532
539
|
sessionId: Text,
|
|
533
540
|
runId: Text.optional()
|
|
534
541
|
}),
|
|
535
|
-
|
|
536
|
-
kind:
|
|
542
|
+
z6.strictObject({
|
|
543
|
+
kind: z6.literal("artifact"),
|
|
537
544
|
revision: ArtifactProvenanceRevision
|
|
538
545
|
}),
|
|
539
|
-
|
|
540
|
-
kind:
|
|
546
|
+
z6.strictObject({
|
|
547
|
+
kind: z6.literal("resource"),
|
|
541
548
|
uri: Text,
|
|
542
549
|
revision: Text.nullable()
|
|
543
550
|
})
|
|
544
551
|
]);
|
|
545
|
-
var ArtifactProvenanceGap =
|
|
546
|
-
code:
|
|
552
|
+
var ArtifactProvenanceGap = z6.strictObject({
|
|
553
|
+
code: z6.enum([
|
|
547
554
|
"unknown",
|
|
548
555
|
"capture-failed",
|
|
549
556
|
"legacy-derived",
|
|
@@ -556,18 +563,18 @@ var ArtifactProvenanceGap = z5.strictObject({
|
|
|
556
563
|
"invalid-record"
|
|
557
564
|
]),
|
|
558
565
|
/** JSON Pointer into this envelope; the empty pointer covers the whole capture. */
|
|
559
|
-
at:
|
|
566
|
+
at: z6.string().regex(/^(?:\/(?:[^~/]|~[01])*)*$/).refine((value) => !hasControlCharacter(value)),
|
|
560
567
|
detail: Text.optional()
|
|
561
568
|
}).refine((gap) => gap.at !== "" || gap.code === "capture-failed", {
|
|
562
569
|
message: "Only a whole-capture failure may cover the entire envelope"
|
|
563
570
|
});
|
|
564
|
-
var ArtifactProvenanceSession =
|
|
571
|
+
var ArtifactProvenanceSession = z6.strictObject({
|
|
565
572
|
sessionId: Text,
|
|
566
|
-
basis:
|
|
573
|
+
basis: z6.enum(["recorded", "legacy-derived", "unverified-index", "missing"]),
|
|
567
574
|
record: SessionProvenanceRecord.nullable()
|
|
568
575
|
});
|
|
569
|
-
var ArtifactProvenanceSource =
|
|
570
|
-
relationship:
|
|
576
|
+
var ArtifactProvenanceSource = z6.strictObject({
|
|
577
|
+
relationship: z6.enum([
|
|
571
578
|
"revision-of",
|
|
572
579
|
"copied-from",
|
|
573
580
|
"harvested-from",
|
|
@@ -577,8 +584,8 @@ var ArtifactProvenanceSource = z5.strictObject({
|
|
|
577
584
|
]),
|
|
578
585
|
revision: ArtifactProvenanceRevision
|
|
579
586
|
});
|
|
580
|
-
var ArtifactProvenanceMutation =
|
|
581
|
-
kind:
|
|
587
|
+
var ArtifactProvenanceMutation = z6.strictObject({
|
|
588
|
+
kind: z6.enum([
|
|
582
589
|
"create",
|
|
583
590
|
"update",
|
|
584
591
|
"delete",
|
|
@@ -591,16 +598,16 @@ var ArtifactProvenanceMutation = z5.strictObject({
|
|
|
591
598
|
target: ArtifactProvenanceRevision,
|
|
592
599
|
/** Retained from the source on copies/acceptance; operation.actor is the persistence actor. */
|
|
593
600
|
producer: ArtifactProvenanceOperation,
|
|
594
|
-
sources:
|
|
601
|
+
sources: z6.array(ArtifactProvenanceSource)
|
|
595
602
|
});
|
|
596
|
-
var Envelope =
|
|
597
|
-
version:
|
|
603
|
+
var Envelope = z6.strictObject({
|
|
604
|
+
version: z6.literal(ARTIFACT_PROVENANCE_VERSION),
|
|
598
605
|
operation: ArtifactProvenanceOperation,
|
|
599
|
-
artifacts:
|
|
600
|
-
sessions:
|
|
601
|
-
subjects:
|
|
602
|
-
evidence:
|
|
603
|
-
gaps:
|
|
606
|
+
artifacts: z6.array(ArtifactProvenanceMutation).min(1),
|
|
607
|
+
sessions: z6.array(ArtifactProvenanceSession),
|
|
608
|
+
subjects: z6.array(ArtifactProvenanceReference),
|
|
609
|
+
evidence: z6.array(ArtifactProvenanceReference),
|
|
610
|
+
gaps: z6.array(ArtifactProvenanceGap)
|
|
604
611
|
});
|
|
605
612
|
var UNKNOWN = [
|
|
606
613
|
"unknown",
|
|
@@ -771,18 +778,18 @@ function validateEnvelope(envelope, context) {
|
|
|
771
778
|
}
|
|
772
779
|
checkGraph(envelope, gap, issue);
|
|
773
780
|
}
|
|
774
|
-
var ArtifactProvenanceEnvelopeV1 =
|
|
781
|
+
var ArtifactProvenanceEnvelopeV1 = z6.unknown().refine(isProvenanceJson, {
|
|
775
782
|
message: "Provenance must be plain, acyclic, lossless JSON without control characters"
|
|
776
783
|
}).pipe(Envelope.superRefine(validateEnvelope));
|
|
777
784
|
function parseArtifactProvenanceEnvelope(input) {
|
|
778
785
|
return ArtifactProvenanceEnvelopeV1.parse(input);
|
|
779
786
|
}
|
|
780
|
-
var ArtifactProvenanceCaptureContextSchema =
|
|
787
|
+
var ArtifactProvenanceCaptureContextSchema = z6.strictObject({
|
|
781
788
|
operation: ArtifactProvenanceOperation,
|
|
782
|
-
sessions:
|
|
783
|
-
subjects:
|
|
784
|
-
evidence:
|
|
785
|
-
gaps:
|
|
789
|
+
sessions: z6.array(ArtifactProvenanceSession),
|
|
790
|
+
subjects: z6.array(ArtifactProvenanceReference),
|
|
791
|
+
evidence: z6.array(ArtifactProvenanceReference),
|
|
792
|
+
gaps: z6.array(ArtifactProvenanceGap)
|
|
786
793
|
});
|
|
787
794
|
function parseArtifactProvenanceCaptureContext(input) {
|
|
788
795
|
return ArtifactProvenanceCaptureContextSchema.parse(input);
|
|
@@ -1080,39 +1087,39 @@ function finalizeArtifactProvenanceEnvelope(capture, artifacts) {
|
|
|
1080
1087
|
}
|
|
1081
1088
|
|
|
1082
1089
|
// packages/plugin-protocol/dist/authority.js
|
|
1083
|
-
import { z as
|
|
1090
|
+
import { z as z8 } from "zod";
|
|
1084
1091
|
|
|
1085
1092
|
// packages/plugin-protocol/dist/permissions.js
|
|
1086
|
-
import { z as
|
|
1087
|
-
var AuthGrantOperation =
|
|
1093
|
+
import { z as z7 } from "zod";
|
|
1094
|
+
var AuthGrantOperation = z7.enum([
|
|
1088
1095
|
"status",
|
|
1089
1096
|
"connect",
|
|
1090
1097
|
"disconnect",
|
|
1091
1098
|
"resolve"
|
|
1092
1099
|
]);
|
|
1093
|
-
var AuthAccountSelector =
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1100
|
+
var AuthAccountSelector = z7.discriminatedUnion("kind", [
|
|
1101
|
+
z7.strictObject({ kind: z7.literal("active") }),
|
|
1102
|
+
z7.strictObject({ kind: z7.literal("account-id"), accountId: NonEmptyString }),
|
|
1103
|
+
z7.strictObject({ kind: z7.literal("record-id"), recordId: NonEmptyString })
|
|
1097
1104
|
]);
|
|
1098
|
-
var AuthScopeDefinition =
|
|
1105
|
+
var AuthScopeDefinition = z7.strictObject({
|
|
1099
1106
|
id: NonEmptyString,
|
|
1100
1107
|
label: NonEmptyString,
|
|
1101
1108
|
description: NonEmptyString,
|
|
1102
|
-
documentationUrl:
|
|
1109
|
+
documentationUrl: z7.url().optional()
|
|
1103
1110
|
});
|
|
1104
|
-
var ScopeNeed =
|
|
1111
|
+
var ScopeNeed = z7.strictObject({
|
|
1105
1112
|
scope: NonEmptyString,
|
|
1106
1113
|
reason: NonEmptyString.optional()
|
|
1107
1114
|
});
|
|
1108
|
-
var ScopeAlternative =
|
|
1109
|
-
allOf:
|
|
1115
|
+
var ScopeAlternative = z7.strictObject({
|
|
1116
|
+
allOf: z7.array(ScopeNeed).min(1)
|
|
1110
1117
|
});
|
|
1111
|
-
var ScopeRequirement =
|
|
1118
|
+
var ScopeRequirement = z7.strictObject({
|
|
1112
1119
|
purpose: NonEmptyString,
|
|
1113
|
-
alternatives:
|
|
1120
|
+
alternatives: z7.array(ScopeAlternative).min(1)
|
|
1114
1121
|
});
|
|
1115
|
-
var AuthGrantRequestBase =
|
|
1122
|
+
var AuthGrantRequestBase = z7.strictObject({
|
|
1116
1123
|
// A local (undotted) service must be declared in this same manifest; a
|
|
1117
1124
|
// qualified (dotted) service names another plugin's global id and is an
|
|
1118
1125
|
// external service dependency, recorded on the resolved contract's
|
|
@@ -1121,22 +1128,22 @@ var AuthGrantRequestBase = z6.strictObject({
|
|
|
1121
1128
|
// Optional for backward compatibility with grants whose service has a
|
|
1122
1129
|
// single unambiguous scheme. Local ids resolve under the service owner's
|
|
1123
1130
|
// namespace; qualified ids are preserved.
|
|
1124
|
-
schemes:
|
|
1125
|
-
operations:
|
|
1126
|
-
purposes:
|
|
1131
|
+
schemes: z7.array(AuthSchemeReference).min(1).optional(),
|
|
1132
|
+
operations: z7.array(AuthGrantOperation).min(1),
|
|
1133
|
+
purposes: z7.array(NonEmptyString).optional(),
|
|
1127
1134
|
// Bridged by the runtime into an enforceable `CredentialGrant`:
|
|
1128
1135
|
// `allowedScopes` is the caller's scope ENVELOPE and
|
|
1129
1136
|
// `accountSelectors` map through. Absent `accountSelectors` resolves to the
|
|
1130
1137
|
// narrowest bound (see `ResolvedAuthGrantRequest`); absent scope envelope
|
|
1131
1138
|
// leaves the bridged grant scope-agnostic.
|
|
1132
|
-
allowedScopes:
|
|
1139
|
+
allowedScopes: z7.array(NonEmptyString).min(1).optional(),
|
|
1133
1140
|
// Legacy spelling for `allowedScopes`; new manifests should use the authority-shaped name.
|
|
1134
|
-
requiredScopes:
|
|
1141
|
+
requiredScopes: z7.array(NonEmptyString).min(1).optional(),
|
|
1135
1142
|
// Preferred proactive consent bundle; runtime resolution still uses `scopeRequirement`.
|
|
1136
|
-
connectScopes:
|
|
1143
|
+
connectScopes: z7.array(NonEmptyString).min(1).optional(),
|
|
1137
1144
|
scopeRequirement: ScopeRequirement.optional(),
|
|
1138
|
-
scopeDefinitions:
|
|
1139
|
-
accountSelectors:
|
|
1145
|
+
scopeDefinitions: z7.array(AuthScopeDefinition).min(1).optional(),
|
|
1146
|
+
accountSelectors: z7.array(AuthAccountSelector).min(1).optional()
|
|
1140
1147
|
});
|
|
1141
1148
|
function validateAuthGrantRequest(grant, ctx) {
|
|
1142
1149
|
if (grant.allowedScopes !== void 0 && grant.requiredScopes !== void 0) {
|
|
@@ -1216,19 +1223,19 @@ function validateAuthGrantRequest(grant, ctx) {
|
|
|
1216
1223
|
}
|
|
1217
1224
|
}
|
|
1218
1225
|
var AuthGrantRequest = AuthGrantRequestBase.superRefine(validateAuthGrantRequest);
|
|
1219
|
-
var StorageGrantRequest =
|
|
1220
|
-
kind:
|
|
1221
|
-
operations:
|
|
1226
|
+
var StorageGrantRequest = z7.strictObject({
|
|
1227
|
+
kind: z7.enum(["sqlite", "dataDir"]),
|
|
1228
|
+
operations: z7.array(z7.enum(["open", "read", "write"])).min(1)
|
|
1222
1229
|
});
|
|
1223
|
-
var EventGrantRequest =
|
|
1230
|
+
var EventGrantRequest = z7.strictObject({
|
|
1224
1231
|
event: NonEmptyString,
|
|
1225
|
-
operations:
|
|
1232
|
+
operations: z7.array(z7.enum(["subscribe", "publish"])).min(1)
|
|
1226
1233
|
});
|
|
1227
|
-
var EndpointGrantRequest =
|
|
1234
|
+
var EndpointGrantRequest = z7.strictObject({
|
|
1228
1235
|
endpoint: LocalContributionId,
|
|
1229
|
-
operations:
|
|
1236
|
+
operations: z7.array(z7.enum(["register", "invoke"])).min(1)
|
|
1230
1237
|
});
|
|
1231
|
-
var WebSessionOrigin =
|
|
1238
|
+
var WebSessionOrigin = z7.string().superRefine((value, ctx) => {
|
|
1232
1239
|
try {
|
|
1233
1240
|
const url = new URL(value);
|
|
1234
1241
|
if (url.protocol !== "https:" || url.username !== "" || url.password !== "" || url.pathname !== "/" || url.search !== "" || url.hash !== "" || url.origin !== value) {
|
|
@@ -1241,7 +1248,7 @@ var WebSessionOrigin = z6.string().superRefine((value, ctx) => {
|
|
|
1241
1248
|
ctx.addIssue({ code: "custom", message: "must be a valid HTTPS origin" });
|
|
1242
1249
|
}
|
|
1243
1250
|
});
|
|
1244
|
-
var WebSessionCsrfSourceUrl =
|
|
1251
|
+
var WebSessionCsrfSourceUrl = z7.url({ protocol: /^https$/ }).superRefine((value, ctx) => {
|
|
1245
1252
|
const url = new URL(value);
|
|
1246
1253
|
if (url.username !== "" || url.password !== "" || url.hash !== "") {
|
|
1247
1254
|
ctx.addIssue({
|
|
@@ -1289,10 +1296,10 @@ function webSessionPathWithinPrefix(pathname, pathPrefix) {
|
|
|
1289
1296
|
}
|
|
1290
1297
|
var WEB_SESSION_CSRF_SELECTOR_PATTERN = /^(?=.)(?:[a-zA-Z][a-zA-Z0-9-]*)?(?:#[a-zA-Z_][\w-]*|\[[a-zA-Z_:][\w:.-]*(?:=(?:"[^"]*"|'[^']*'|[\w-]+))?\])*$/u;
|
|
1291
1298
|
var WebSessionCsrfSelector = NonEmptyString.regex(WEB_SESSION_CSRF_SELECTOR_PATTERN, "must be a compound simple selector: optional tag, then #id or [attr=value] predicates on that one element (no combinators, classes, or pseudo-classes)");
|
|
1292
|
-
var WebSessionGrantRequest =
|
|
1299
|
+
var WebSessionGrantRequest = z7.strictObject({
|
|
1293
1300
|
origin: WebSessionOrigin,
|
|
1294
|
-
pathPrefixes:
|
|
1295
|
-
csrf:
|
|
1301
|
+
pathPrefixes: z7.array(WebSessionPathPrefix).min(1),
|
|
1302
|
+
csrf: z7.strictObject({
|
|
1296
1303
|
sourceUrl: WebSessionCsrfSourceUrl,
|
|
1297
1304
|
selector: WebSessionCsrfSelector,
|
|
1298
1305
|
attribute: NonEmptyString,
|
|
@@ -1301,14 +1308,14 @@ var WebSessionGrantRequest = z6.strictObject({
|
|
|
1301
1308
|
bodyField: NonEmptyString.optional()
|
|
1302
1309
|
}).optional()
|
|
1303
1310
|
});
|
|
1304
|
-
var KnowledgeSearchGrantRequest =
|
|
1305
|
-
scope:
|
|
1311
|
+
var KnowledgeSearchGrantRequest = z7.strictObject({
|
|
1312
|
+
scope: z7.literal("own-schemes")
|
|
1306
1313
|
});
|
|
1307
|
-
var KnownResourcesGrantRequest =
|
|
1308
|
-
scope:
|
|
1314
|
+
var KnownResourcesGrantRequest = z7.strictObject({
|
|
1315
|
+
scope: z7.literal("own-modules")
|
|
1309
1316
|
});
|
|
1310
|
-
var PluginAgentDefinitionPermissionRule =
|
|
1311
|
-
effect:
|
|
1317
|
+
var PluginAgentDefinitionPermissionRule = z7.strictObject({
|
|
1318
|
+
effect: z7.enum(["allow", "deny", "ask"]),
|
|
1312
1319
|
/** Restrict to one tool name. */
|
|
1313
1320
|
tool: NonEmptyString.optional(),
|
|
1314
1321
|
/** Restrict to one classified capability key. */
|
|
@@ -1318,7 +1325,7 @@ var PluginAgentDefinitionPermissionRule = z6.strictObject({
|
|
|
1318
1325
|
/** Restrict to matching resources (a path glob, or a URI-shaped policy address). */
|
|
1319
1326
|
resource: NonEmptyString.optional(),
|
|
1320
1327
|
/** Restrict the rule to one permission mode; omit to apply in all modes. */
|
|
1321
|
-
mode:
|
|
1328
|
+
mode: z7.enum(["default", "ask", "allow", "auto"]).optional()
|
|
1322
1329
|
});
|
|
1323
1330
|
var RETIRED_PERMISSION_ASK_KEYS = [
|
|
1324
1331
|
"network",
|
|
@@ -1384,14 +1391,14 @@ function retiredPermissionAsksIn(rawManifest) {
|
|
|
1384
1391
|
}
|
|
1385
1392
|
return found;
|
|
1386
1393
|
}
|
|
1387
|
-
var TargetPermissionWiring =
|
|
1388
|
-
auth:
|
|
1389
|
-
storage:
|
|
1390
|
-
events:
|
|
1391
|
-
endpoints:
|
|
1392
|
-
webSession:
|
|
1393
|
-
knowledgeSearch:
|
|
1394
|
-
knownResources:
|
|
1394
|
+
var TargetPermissionWiring = z7.strictObject({
|
|
1395
|
+
auth: z7.array(AuthGrantRequest).optional(),
|
|
1396
|
+
storage: z7.array(StorageGrantRequest).optional(),
|
|
1397
|
+
events: z7.array(EventGrantRequest).optional(),
|
|
1398
|
+
endpoints: z7.array(EndpointGrantRequest).optional(),
|
|
1399
|
+
webSession: z7.array(WebSessionGrantRequest).optional(),
|
|
1400
|
+
knowledgeSearch: z7.array(KnowledgeSearchGrantRequest).optional(),
|
|
1401
|
+
knownResources: z7.array(KnownResourcesGrantRequest).optional()
|
|
1395
1402
|
}).superRefine((permissions, ctx) => {
|
|
1396
1403
|
const rows = permissions.webSession ?? [];
|
|
1397
1404
|
for (const [index, row] of rows.entries()) {
|
|
@@ -1409,9 +1416,9 @@ var TargetPermissionWiring = z6.strictObject({
|
|
|
1409
1416
|
}
|
|
1410
1417
|
}
|
|
1411
1418
|
});
|
|
1412
|
-
var TargetPermissionSet =
|
|
1413
|
-
var PluginPermissionManifest =
|
|
1414
|
-
byTarget:
|
|
1419
|
+
var TargetPermissionSet = z7.preprocess(stripRetiredPermissionAsks, TargetPermissionWiring);
|
|
1420
|
+
var PluginPermissionManifest = z7.strictObject({
|
|
1421
|
+
byTarget: z7.strictObject({
|
|
1415
1422
|
"kay.agent": TargetPermissionSet.optional(),
|
|
1416
1423
|
"kay.app": TargetPermissionSet.optional(),
|
|
1417
1424
|
"kay.ui": TargetPermissionSet.optional()
|
|
@@ -1429,26 +1436,26 @@ var PluginPermissionManifest = z6.strictObject({
|
|
|
1429
1436
|
});
|
|
1430
1437
|
var ResolvedAuthGrantRequest = AuthGrantRequestBase.extend({
|
|
1431
1438
|
service: GlobalContributionId,
|
|
1432
|
-
schemes:
|
|
1439
|
+
schemes: z7.array(GlobalContributionId).min(1).optional(),
|
|
1433
1440
|
// Resolution fills an absent binding with the narrowest bound, so a resolved
|
|
1434
1441
|
// grant ALWAYS carries an explicit, non-broadening account selector — the
|
|
1435
1442
|
// runtime never has to invent a default and fail open.
|
|
1436
|
-
accountSelectors:
|
|
1443
|
+
accountSelectors: z7.array(AuthAccountSelector).min(1)
|
|
1437
1444
|
}).superRefine(validateAuthGrantRequest);
|
|
1438
1445
|
var ResolvedEndpointGrantRequest = EndpointGrantRequest.extend({
|
|
1439
1446
|
endpoint: GlobalContributionId
|
|
1440
1447
|
});
|
|
1441
|
-
var ResolvedTargetGrantSet =
|
|
1442
|
-
auth:
|
|
1443
|
-
storage:
|
|
1444
|
-
events:
|
|
1445
|
-
endpoints:
|
|
1446
|
-
webSession:
|
|
1447
|
-
knowledgeSearch:
|
|
1448
|
-
knownResources:
|
|
1449
|
-
});
|
|
1450
|
-
var ResolvedPluginGrants =
|
|
1451
|
-
byTarget:
|
|
1448
|
+
var ResolvedTargetGrantSet = z7.strictObject({
|
|
1449
|
+
auth: z7.array(ResolvedAuthGrantRequest).optional(),
|
|
1450
|
+
storage: z7.array(StorageGrantRequest).optional(),
|
|
1451
|
+
events: z7.array(EventGrantRequest).optional(),
|
|
1452
|
+
endpoints: z7.array(ResolvedEndpointGrantRequest).optional(),
|
|
1453
|
+
webSession: z7.array(WebSessionGrantRequest).optional(),
|
|
1454
|
+
knowledgeSearch: z7.array(KnowledgeSearchGrantRequest).optional(),
|
|
1455
|
+
knownResources: z7.array(KnownResourcesGrantRequest).optional()
|
|
1456
|
+
});
|
|
1457
|
+
var ResolvedPluginGrants = z7.strictObject({
|
|
1458
|
+
byTarget: z7.strictObject({
|
|
1452
1459
|
"kay.agent": ResolvedTargetGrantSet.optional(),
|
|
1453
1460
|
"kay.app": ResolvedTargetGrantSet.optional(),
|
|
1454
1461
|
"kay.ui": ResolvedTargetGrantSet.optional()
|
|
@@ -1456,24 +1463,24 @@ var ResolvedPluginGrants = z6.strictObject({
|
|
|
1456
1463
|
});
|
|
1457
1464
|
|
|
1458
1465
|
// packages/plugin-protocol/dist/authority.js
|
|
1459
|
-
var WhiteboardCapabilityScope =
|
|
1460
|
-
var WhiteboardCapabilityOperation =
|
|
1466
|
+
var WhiteboardCapabilityScope = z8.enum(["own-types", "all-types"]);
|
|
1467
|
+
var WhiteboardCapabilityOperation = z8.enum([
|
|
1461
1468
|
"discover",
|
|
1462
1469
|
"read",
|
|
1463
1470
|
"create",
|
|
1464
1471
|
"update",
|
|
1465
1472
|
"remove"
|
|
1466
1473
|
]);
|
|
1467
|
-
var WhiteboardCapabilityClaimV1 =
|
|
1468
|
-
target:
|
|
1469
|
-
slug:
|
|
1474
|
+
var WhiteboardCapabilityClaimV1 = z8.strictObject({
|
|
1475
|
+
target: z8.enum(["kay.agent", "kay.app"]),
|
|
1476
|
+
slug: z8.enum([
|
|
1470
1477
|
"whiteboard.discover",
|
|
1471
1478
|
"whiteboard.read",
|
|
1472
1479
|
"whiteboard.create",
|
|
1473
1480
|
"whiteboard.update",
|
|
1474
1481
|
"whiteboard.remove"
|
|
1475
1482
|
]),
|
|
1476
|
-
envelope:
|
|
1483
|
+
envelope: z8.strictObject({ scope: WhiteboardCapabilityScope })
|
|
1477
1484
|
}).superRefine((claim, ctx) => {
|
|
1478
1485
|
if (claim.target === "kay.app" && claim.slug !== "whiteboard.discover" && claim.slug !== "whiteboard.read") {
|
|
1479
1486
|
ctx.addIssue({
|
|
@@ -1483,91 +1490,104 @@ var WhiteboardCapabilityClaimV1 = z7.strictObject({
|
|
|
1483
1490
|
});
|
|
1484
1491
|
}
|
|
1485
1492
|
});
|
|
1486
|
-
var
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1493
|
+
var DeclaredSkillSourceEnvelope = z8.discriminatedUnion("channel", [
|
|
1494
|
+
z8.strictObject({
|
|
1495
|
+
channel: z8.literal("git-clone"),
|
|
1496
|
+
locator: NonEmptyString,
|
|
1497
|
+
ref: NonEmptyString.optional(),
|
|
1498
|
+
subdir: NonEmptyString.optional()
|
|
1499
|
+
}),
|
|
1500
|
+
z8.strictObject({
|
|
1501
|
+
channel: z8.literal("installer"),
|
|
1502
|
+
command: NonEmptyString,
|
|
1503
|
+
args: z8.array(NonEmptyString)
|
|
1504
|
+
})
|
|
1505
|
+
]);
|
|
1506
|
+
var PluginCapabilityClaimV1 = z8.discriminatedUnion("slug", [
|
|
1507
|
+
z8.strictObject({
|
|
1508
|
+
target: z8.literal("kay.app"),
|
|
1509
|
+
slug: z8.literal("sessions.run"),
|
|
1510
|
+
envelope: z8.strictObject({})
|
|
1491
1511
|
}),
|
|
1492
|
-
|
|
1493
|
-
target:
|
|
1494
|
-
slug:
|
|
1495
|
-
envelope:
|
|
1512
|
+
z8.strictObject({
|
|
1513
|
+
target: z8.literal("kay.agent"),
|
|
1514
|
+
slug: z8.literal("network.connect"),
|
|
1515
|
+
envelope: z8.strictObject({ connect: NonEmptyString })
|
|
1496
1516
|
}),
|
|
1497
|
-
|
|
1498
|
-
target:
|
|
1499
|
-
slug:
|
|
1500
|
-
envelope:
|
|
1517
|
+
z8.strictObject({
|
|
1518
|
+
target: z8.literal("kay.agent"),
|
|
1519
|
+
slug: z8.literal("web-session.request"),
|
|
1520
|
+
envelope: z8.strictObject({
|
|
1501
1521
|
origin: NonEmptyString,
|
|
1502
1522
|
pathPrefix: NonEmptyString
|
|
1503
1523
|
})
|
|
1504
1524
|
}),
|
|
1505
|
-
|
|
1506
|
-
target:
|
|
1507
|
-
slug:
|
|
1508
|
-
envelope:
|
|
1525
|
+
z8.strictObject({
|
|
1526
|
+
target: z8.literal("kay.agent"),
|
|
1527
|
+
slug: z8.literal("web-session.download"),
|
|
1528
|
+
envelope: z8.strictObject({
|
|
1509
1529
|
origin: NonEmptyString,
|
|
1510
1530
|
pathPrefix: NonEmptyString
|
|
1511
1531
|
})
|
|
1512
1532
|
}),
|
|
1513
|
-
|
|
1514
|
-
target:
|
|
1515
|
-
slug:
|
|
1516
|
-
envelope:
|
|
1533
|
+
z8.strictObject({
|
|
1534
|
+
target: z8.literal("kay.agent"),
|
|
1535
|
+
slug: z8.literal("process.spawn"),
|
|
1536
|
+
envelope: z8.strictObject({
|
|
1517
1537
|
command: NonEmptyString,
|
|
1518
1538
|
argvClass: NonEmptyString
|
|
1519
1539
|
})
|
|
1520
1540
|
}),
|
|
1521
|
-
|
|
1522
|
-
target:
|
|
1523
|
-
slug:
|
|
1524
|
-
envelope:
|
|
1541
|
+
z8.strictObject({
|
|
1542
|
+
target: z8.literal("kay.app"),
|
|
1543
|
+
slug: z8.literal("corpus.read"),
|
|
1544
|
+
envelope: z8.strictObject({})
|
|
1525
1545
|
}),
|
|
1526
|
-
|
|
1546
|
+
z8.strictObject({
|
|
1527
1547
|
// Every plugin's recorded Jev signals, not only the caller's own: an empty envelope because
|
|
1528
1548
|
// the grant itself is the visibility decision. Both first consumers (a session timeline, and
|
|
1529
1549
|
// an agent loop turning signals into skills) read rows another plugin recorded.
|
|
1530
|
-
target:
|
|
1531
|
-
slug:
|
|
1532
|
-
envelope:
|
|
1550
|
+
target: z8.literal("kay.app"),
|
|
1551
|
+
slug: z8.literal("signals.read"),
|
|
1552
|
+
envelope: z8.strictObject({})
|
|
1533
1553
|
}),
|
|
1534
|
-
|
|
1554
|
+
z8.strictObject({
|
|
1535
1555
|
// Read-only metadata about every managed skill: identity, versions, history, suggestions.
|
|
1536
1556
|
// Never a skill's bytes (an agent reads those through `skill://`) and never a write. An
|
|
1537
1557
|
// empty envelope because the grant itself is the visibility decision, as with `signals.read`.
|
|
1538
|
-
target:
|
|
1539
|
-
slug:
|
|
1540
|
-
envelope:
|
|
1558
|
+
target: z8.literal("kay.app"),
|
|
1559
|
+
slug: z8.literal("skills.read"),
|
|
1560
|
+
envelope: z8.strictObject({})
|
|
1541
1561
|
}),
|
|
1542
|
-
|
|
1562
|
+
z8.strictObject({
|
|
1543
1563
|
// The text an agent sees for a tool or an address in a live session, where each comes from,
|
|
1544
1564
|
// and whether it is one of Bonsai's own. Read-only and never a call. An empty envelope because
|
|
1545
1565
|
// the grant itself is the visibility decision, as with `skills.read`.
|
|
1546
|
-
target:
|
|
1547
|
-
slug:
|
|
1548
|
-
envelope:
|
|
1566
|
+
target: z8.literal("kay.app"),
|
|
1567
|
+
slug: z8.literal("tools.describe"),
|
|
1568
|
+
envelope: z8.strictObject({})
|
|
1549
1569
|
}),
|
|
1550
|
-
|
|
1551
|
-
target:
|
|
1552
|
-
slug:
|
|
1553
|
-
envelope:
|
|
1570
|
+
z8.strictObject({
|
|
1571
|
+
target: z8.literal("kay.app"),
|
|
1572
|
+
slug: z8.literal("workspace.command"),
|
|
1573
|
+
envelope: z8.strictObject({})
|
|
1554
1574
|
}),
|
|
1555
|
-
|
|
1556
|
-
target:
|
|
1557
|
-
slug:
|
|
1558
|
-
envelope:
|
|
1575
|
+
z8.strictObject({
|
|
1576
|
+
target: z8.literal("kay.app"),
|
|
1577
|
+
slug: z8.literal("sessions.create"),
|
|
1578
|
+
envelope: z8.strictObject({})
|
|
1559
1579
|
}),
|
|
1560
|
-
|
|
1561
|
-
target:
|
|
1562
|
-
slug:
|
|
1563
|
-
envelope:
|
|
1580
|
+
z8.strictObject({
|
|
1581
|
+
target: z8.literal("kay.app"),
|
|
1582
|
+
slug: z8.literal("sessions.update"),
|
|
1583
|
+
envelope: z8.strictObject({})
|
|
1564
1584
|
}),
|
|
1565
|
-
|
|
1566
|
-
target:
|
|
1567
|
-
slug:
|
|
1568
|
-
envelope:
|
|
1585
|
+
z8.strictObject({
|
|
1586
|
+
target: z8.literal("kay.app"),
|
|
1587
|
+
slug: z8.literal("models.complete"),
|
|
1588
|
+
envelope: z8.strictObject({})
|
|
1569
1589
|
}),
|
|
1570
|
-
|
|
1590
|
+
z8.strictObject({
|
|
1571
1591
|
// Held to `kay.app`, the daemon-lifetime tier, even though the same wrapper is exposed on
|
|
1572
1592
|
// BOTH the `kay.app` and `kay.agent` plugin SDKs (and to host composition directly): a slug
|
|
1573
1593
|
// pins exactly one target (see this file's module doc), so one shared claim is simpler and
|
|
@@ -1576,104 +1596,123 @@ var PluginCapabilityClaimV1 = z7.discriminatedUnion("slug", [
|
|
|
1576
1596
|
// plugin's own pinned authority, which already spans both targets for every other capability
|
|
1577
1597
|
// (`network.connect`/`tool-interception.register` are decided by the identical per-plugin
|
|
1578
1598
|
// handle `kay.app`-target claims use).
|
|
1579
|
-
target:
|
|
1580
|
-
slug:
|
|
1581
|
-
envelope:
|
|
1599
|
+
target: z8.literal("kay.app"),
|
|
1600
|
+
slug: z8.literal("jev.use"),
|
|
1601
|
+
envelope: z8.strictObject({})
|
|
1582
1602
|
}),
|
|
1583
|
-
|
|
1584
|
-
target:
|
|
1585
|
-
slug:
|
|
1586
|
-
envelope:
|
|
1603
|
+
z8.strictObject({
|
|
1604
|
+
target: z8.literal("kay.app"),
|
|
1605
|
+
slug: z8.literal("automations.write"),
|
|
1606
|
+
envelope: z8.strictObject({})
|
|
1587
1607
|
}),
|
|
1588
|
-
|
|
1589
|
-
target:
|
|
1590
|
-
slug:
|
|
1591
|
-
envelope:
|
|
1608
|
+
z8.strictObject({
|
|
1609
|
+
target: z8.literal("kay.app"),
|
|
1610
|
+
slug: z8.literal("automations.run"),
|
|
1611
|
+
envelope: z8.strictObject({})
|
|
1592
1612
|
}),
|
|
1593
|
-
|
|
1594
|
-
target:
|
|
1595
|
-
slug:
|
|
1596
|
-
envelope:
|
|
1613
|
+
z8.strictObject({
|
|
1614
|
+
target: z8.literal("kay.app"),
|
|
1615
|
+
slug: z8.literal("workflows.define"),
|
|
1616
|
+
envelope: z8.strictObject({})
|
|
1597
1617
|
}),
|
|
1598
|
-
|
|
1599
|
-
target:
|
|
1600
|
-
slug:
|
|
1601
|
-
envelope:
|
|
1618
|
+
z8.strictObject({
|
|
1619
|
+
target: z8.literal("kay.app"),
|
|
1620
|
+
slug: z8.literal("session-events.subscribe"),
|
|
1621
|
+
envelope: z8.strictObject({})
|
|
1602
1622
|
}),
|
|
1603
|
-
|
|
1604
|
-
target:
|
|
1605
|
-
slug:
|
|
1606
|
-
envelope:
|
|
1623
|
+
z8.strictObject({
|
|
1624
|
+
target: z8.literal("kay.app"),
|
|
1625
|
+
slug: z8.literal("agents.run"),
|
|
1626
|
+
envelope: z8.strictObject({})
|
|
1607
1627
|
}),
|
|
1608
|
-
|
|
1609
|
-
target:
|
|
1610
|
-
slug:
|
|
1628
|
+
z8.strictObject({
|
|
1629
|
+
target: z8.literal("kay.app"),
|
|
1630
|
+
slug: z8.literal("dynamic-context.register"),
|
|
1611
1631
|
// The declared `contributes.contextContributors` localId, which doubles as the contributor's
|
|
1612
1632
|
// section tag at the model boundary — so the row a human consents to names the section.
|
|
1613
|
-
envelope:
|
|
1633
|
+
envelope: z8.strictObject({ contributor: NonEmptyString })
|
|
1614
1634
|
}),
|
|
1615
|
-
|
|
1616
|
-
target:
|
|
1617
|
-
slug:
|
|
1635
|
+
z8.strictObject({
|
|
1636
|
+
target: z8.literal("kay.app"),
|
|
1637
|
+
slug: z8.literal("app-data.register"),
|
|
1618
1638
|
/** The declared `contributes.dataSources` localId. */
|
|
1619
|
-
envelope:
|
|
1639
|
+
envelope: z8.strictObject({ source: NonEmptyString })
|
|
1620
1640
|
}),
|
|
1621
|
-
|
|
1622
|
-
target:
|
|
1623
|
-
slug:
|
|
1624
|
-
envelope:
|
|
1641
|
+
z8.strictObject({
|
|
1642
|
+
target: z8.literal("kay.app"),
|
|
1643
|
+
slug: z8.literal("account.assert"),
|
|
1644
|
+
envelope: z8.strictObject({})
|
|
1625
1645
|
}),
|
|
1626
|
-
|
|
1627
|
-
target:
|
|
1628
|
-
slug:
|
|
1629
|
-
envelope:
|
|
1646
|
+
z8.strictObject({
|
|
1647
|
+
target: z8.literal("kay.app"),
|
|
1648
|
+
slug: z8.literal("account.update"),
|
|
1649
|
+
envelope: z8.strictObject({})
|
|
1630
1650
|
}),
|
|
1631
|
-
|
|
1632
|
-
target:
|
|
1633
|
-
slug:
|
|
1634
|
-
envelope:
|
|
1651
|
+
z8.strictObject({
|
|
1652
|
+
target: z8.literal("kay.app"),
|
|
1653
|
+
slug: z8.literal("agents.permissions"),
|
|
1654
|
+
envelope: z8.strictObject({
|
|
1635
1655
|
/** The definition's local id — WHICH agent these rules are authored onto. */
|
|
1636
1656
|
agent: NonEmptyString,
|
|
1637
1657
|
/** `definition.permissions`, in declaration order (order is semantic; first match wins). */
|
|
1638
|
-
rules:
|
|
1658
|
+
rules: z8.array(PluginAgentDefinitionPermissionRule),
|
|
1639
1659
|
/** `definition.permissionsFallback`, in declaration order. */
|
|
1640
|
-
fallback:
|
|
1660
|
+
fallback: z8.array(PluginAgentDefinitionPermissionRule)
|
|
1641
1661
|
})
|
|
1642
1662
|
}),
|
|
1643
|
-
|
|
1644
|
-
target:
|
|
1645
|
-
slug:
|
|
1646
|
-
envelope:
|
|
1663
|
+
z8.strictObject({
|
|
1664
|
+
target: z8.literal("kay.agent"),
|
|
1665
|
+
slug: z8.literal("tool-interception.register"),
|
|
1666
|
+
envelope: z8.strictObject({})
|
|
1647
1667
|
}),
|
|
1648
|
-
|
|
1649
|
-
target:
|
|
1650
|
-
slug:
|
|
1668
|
+
z8.strictObject({
|
|
1669
|
+
target: z8.literal("kay.agent"),
|
|
1670
|
+
slug: z8.literal("interaction.surface"),
|
|
1651
1671
|
/** The one Bonsai-shipped interaction surface this plugin may drive; one claim per surface. */
|
|
1652
|
-
envelope:
|
|
1672
|
+
envelope: z8.strictObject({ surface: z8.enum(["browser-pane", "desktop"]) })
|
|
1653
1673
|
}),
|
|
1654
|
-
|
|
1655
|
-
target:
|
|
1656
|
-
slug:
|
|
1674
|
+
z8.strictObject({
|
|
1675
|
+
target: z8.literal("plugin"),
|
|
1676
|
+
slug: z8.literal("config.declare-section"),
|
|
1657
1677
|
/** The settings-document section key, e.g. `models` or `plugins.com.acme.thing`. */
|
|
1658
|
-
envelope:
|
|
1678
|
+
envelope: z8.strictObject({ section: NonEmptyString })
|
|
1659
1679
|
}),
|
|
1660
|
-
|
|
1661
|
-
target:
|
|
1662
|
-
slug:
|
|
1680
|
+
z8.strictObject({
|
|
1681
|
+
target: z8.literal("plugin"),
|
|
1682
|
+
slug: z8.literal("auth.own-service"),
|
|
1663
1683
|
/** The minted global service id this plugin would own, e.g. `google.account`. */
|
|
1664
|
-
envelope:
|
|
1684
|
+
envelope: z8.strictObject({ service: NonEmptyString })
|
|
1665
1685
|
}),
|
|
1666
|
-
|
|
1667
|
-
target:
|
|
1668
|
-
slug:
|
|
1686
|
+
z8.strictObject({
|
|
1687
|
+
target: z8.literal("plugin"),
|
|
1688
|
+
slug: z8.literal("auth.shared-identity"),
|
|
1669
1689
|
/** The foreign global service id whose identity this plugin would resolve against. */
|
|
1670
|
-
envelope:
|
|
1690
|
+
envelope: z8.strictObject({ service: NonEmptyString })
|
|
1671
1691
|
}),
|
|
1672
|
-
|
|
1673
|
-
target:
|
|
1674
|
-
slug:
|
|
1692
|
+
z8.strictObject({
|
|
1693
|
+
target: z8.literal("plugin"),
|
|
1694
|
+
slug: z8.literal("cli.bind"),
|
|
1675
1695
|
/** The binary basename a resolved credential would be injected into. */
|
|
1676
|
-
envelope:
|
|
1696
|
+
envelope: z8.strictObject({ binary: NonEmptyString })
|
|
1697
|
+
}),
|
|
1698
|
+
z8.strictObject({
|
|
1699
|
+
target: z8.literal("plugin"),
|
|
1700
|
+
slug: z8.literal("mcp.host-server"),
|
|
1701
|
+
// The daemon dials this endpoint, holds its sign-in, and serves it as `mcp://<name>`, so the
|
|
1702
|
+
// endpoint becomes daemon execution authority. One claim per exact name and URL.
|
|
1703
|
+
envelope: z8.strictObject({ name: NonEmptyString, url: NonEmptyString })
|
|
1704
|
+
}),
|
|
1705
|
+
z8.strictObject({
|
|
1706
|
+
target: z8.literal("plugin"),
|
|
1707
|
+
slug: z8.literal("prompt.resident"),
|
|
1708
|
+
// A section of the plugin's own text in every session's system prompt. An empty envelope
|
|
1709
|
+
// because the grant itself is the decision; the host caps the section's length.
|
|
1710
|
+
envelope: z8.strictObject({})
|
|
1711
|
+
}),
|
|
1712
|
+
z8.strictObject({
|
|
1713
|
+
target: z8.literal("plugin"),
|
|
1714
|
+
slug: z8.literal("skills.declared-source"),
|
|
1715
|
+
envelope: DeclaredSkillSourceEnvelope
|
|
1677
1716
|
}),
|
|
1678
1717
|
WhiteboardCapabilityClaimV1
|
|
1679
1718
|
]);
|
|
@@ -1712,34 +1751,37 @@ var PLUGIN_CAPABILITY_SLUGS = [
|
|
|
1712
1751
|
"auth.own-service",
|
|
1713
1752
|
"auth.shared-identity",
|
|
1714
1753
|
"cli.bind",
|
|
1754
|
+
"mcp.host-server",
|
|
1755
|
+
"prompt.resident",
|
|
1756
|
+
"skills.declared-source",
|
|
1715
1757
|
"whiteboard.discover",
|
|
1716
1758
|
"whiteboard.read",
|
|
1717
1759
|
"whiteboard.create",
|
|
1718
1760
|
"whiteboard.update",
|
|
1719
1761
|
"whiteboard.remove"
|
|
1720
1762
|
];
|
|
1721
|
-
var PluginCapabilityRefusalLayer =
|
|
1722
|
-
var PluginCapabilityRefusalCode =
|
|
1763
|
+
var PluginCapabilityRefusalLayer = z8.enum(["grant", "binding"]);
|
|
1764
|
+
var PluginCapabilityRefusalCode = z8.enum([
|
|
1723
1765
|
"not-granted",
|
|
1724
1766
|
"grant-read-failed",
|
|
1725
1767
|
"binding-missing",
|
|
1726
1768
|
"argv-outside-class"
|
|
1727
1769
|
]);
|
|
1728
|
-
var PluginCapabilityRefusalV1 =
|
|
1770
|
+
var PluginCapabilityRefusalV1 = z8.strictObject({
|
|
1729
1771
|
claim: PluginCapabilityClaimV1,
|
|
1730
1772
|
layer: PluginCapabilityRefusalLayer,
|
|
1731
1773
|
code: PluginCapabilityRefusalCode,
|
|
1732
1774
|
message: NonEmptyString,
|
|
1733
1775
|
artifactGenerationId: ArtifactGenerationId.optional()
|
|
1734
1776
|
});
|
|
1735
|
-
var PluginCapabilityDecisionV1 =
|
|
1736
|
-
|
|
1737
|
-
kind:
|
|
1777
|
+
var PluginCapabilityDecisionV1 = z8.discriminatedUnion("kind", [
|
|
1778
|
+
z8.strictObject({
|
|
1779
|
+
kind: z8.literal("allowed"),
|
|
1738
1780
|
claim: PluginCapabilityClaimV1,
|
|
1739
1781
|
artifactGenerationId: ArtifactGenerationId.optional()
|
|
1740
1782
|
}),
|
|
1741
|
-
|
|
1742
|
-
kind:
|
|
1783
|
+
z8.strictObject({
|
|
1784
|
+
kind: z8.literal("refused"),
|
|
1743
1785
|
refusal: PluginCapabilityRefusalV1
|
|
1744
1786
|
})
|
|
1745
1787
|
]);
|
|
@@ -1809,6 +1851,7 @@ function sameClaim(a, b) {
|
|
|
1809
1851
|
case "account.assert":
|
|
1810
1852
|
case "account.update":
|
|
1811
1853
|
case "tool-interception.register":
|
|
1854
|
+
case "prompt.resident":
|
|
1812
1855
|
return true;
|
|
1813
1856
|
case "network.connect":
|
|
1814
1857
|
return b.slug === "network.connect" && a.envelope.connect === b.envelope.connect;
|
|
@@ -1832,6 +1875,10 @@ function sameClaim(a, b) {
|
|
|
1832
1875
|
return (b.slug === "auth.own-service" || b.slug === "auth.shared-identity") && a.envelope.service === b.envelope.service;
|
|
1833
1876
|
case "cli.bind":
|
|
1834
1877
|
return b.slug === "cli.bind" && a.envelope.binary === b.envelope.binary;
|
|
1878
|
+
case "mcp.host-server":
|
|
1879
|
+
return b.slug === "mcp.host-server" && a.envelope.name === b.envelope.name && a.envelope.url === b.envelope.url;
|
|
1880
|
+
case "skills.declared-source":
|
|
1881
|
+
return b.slug === "skills.declared-source" && declaredSourcePairs(a.envelope, b.envelope).every(([left, right]) => left === right);
|
|
1835
1882
|
case "whiteboard.discover":
|
|
1836
1883
|
case "whiteboard.read":
|
|
1837
1884
|
case "whiteboard.create":
|
|
@@ -1874,6 +1921,7 @@ function envelopePairs(a, b) {
|
|
|
1874
1921
|
case "account.assert":
|
|
1875
1922
|
case "account.update":
|
|
1876
1923
|
case "tool-interception.register":
|
|
1924
|
+
case "prompt.resident":
|
|
1877
1925
|
return [];
|
|
1878
1926
|
case "network.connect":
|
|
1879
1927
|
return b.slug === "network.connect" ? [[a.envelope.connect, b.envelope.connect]] : [];
|
|
@@ -1913,6 +1961,13 @@ function envelopePairs(a, b) {
|
|
|
1913
1961
|
return b.slug === "auth.own-service" || b.slug === "auth.shared-identity" ? [[a.envelope.service, b.envelope.service]] : [];
|
|
1914
1962
|
case "cli.bind":
|
|
1915
1963
|
return b.slug === "cli.bind" ? [[a.envelope.binary, b.envelope.binary]] : [];
|
|
1964
|
+
case "mcp.host-server":
|
|
1965
|
+
return b.slug === "mcp.host-server" ? [
|
|
1966
|
+
[a.envelope.name, b.envelope.name],
|
|
1967
|
+
[a.envelope.url, b.envelope.url]
|
|
1968
|
+
] : [];
|
|
1969
|
+
case "skills.declared-source":
|
|
1970
|
+
return b.slug === "skills.declared-source" ? declaredSourcePairs(a.envelope, b.envelope) : [];
|
|
1916
1971
|
case "whiteboard.discover":
|
|
1917
1972
|
case "whiteboard.read":
|
|
1918
1973
|
case "whiteboard.create":
|
|
@@ -1921,6 +1976,24 @@ function envelopePairs(a, b) {
|
|
|
1921
1976
|
return b.slug === a.slug && "scope" in b.envelope ? [[a.envelope.scope, b.envelope.scope]] : [];
|
|
1922
1977
|
}
|
|
1923
1978
|
}
|
|
1979
|
+
function declaredSourcePairs(a, b) {
|
|
1980
|
+
if (a.channel === "git-clone" && b.channel === "git-clone") {
|
|
1981
|
+
return [
|
|
1982
|
+
[a.channel, b.channel],
|
|
1983
|
+
[a.locator, b.locator],
|
|
1984
|
+
[a.ref ?? "", b.ref ?? ""],
|
|
1985
|
+
[a.subdir ?? "", b.subdir ?? ""]
|
|
1986
|
+
];
|
|
1987
|
+
}
|
|
1988
|
+
if (a.channel === "installer" && b.channel === "installer") {
|
|
1989
|
+
return [
|
|
1990
|
+
[a.channel, b.channel],
|
|
1991
|
+
[a.command, b.command],
|
|
1992
|
+
[JSON.stringify(a.args), JSON.stringify(b.args)]
|
|
1993
|
+
];
|
|
1994
|
+
}
|
|
1995
|
+
return [[a.channel, b.channel]];
|
|
1996
|
+
}
|
|
1924
1997
|
function whiteboardCapabilityClaim(operation, scope, target = "kay.agent") {
|
|
1925
1998
|
if (target === "kay.app" && operation !== "discover" && operation !== "read") {
|
|
1926
1999
|
throw new TypeError("kay.app Whiteboard claims are read-only");
|
|
@@ -2121,6 +2194,15 @@ function kayPluginHostCompatibility(appVersion) {
|
|
|
2121
2194
|
appVersion
|
|
2122
2195
|
};
|
|
2123
2196
|
}
|
|
2197
|
+
var KAY_PLUGIN_COMPATIBILITY_REFUSAL_CODES = [
|
|
2198
|
+
"unsupported-protocol",
|
|
2199
|
+
"sdk-range-unsatisfied",
|
|
2200
|
+
"sdk-range-unsupported",
|
|
2201
|
+
"host-sdk-version-invalid"
|
|
2202
|
+
];
|
|
2203
|
+
function isKayPluginCompatibilityRefusal(code) {
|
|
2204
|
+
return KAY_PLUGIN_COMPATIBILITY_REFUSAL_CODES.includes(code);
|
|
2205
|
+
}
|
|
2124
2206
|
function isCompatible(report) {
|
|
2125
2207
|
return report.refusal === void 0;
|
|
2126
2208
|
}
|
|
@@ -2207,30 +2289,30 @@ function checkKayPluginHostCompatibility(compatibility, host) {
|
|
|
2207
2289
|
}
|
|
2208
2290
|
|
|
2209
2291
|
// packages/plugin-protocol/dist/contributions.js
|
|
2210
|
-
import { z as
|
|
2292
|
+
import { z as z9 } from "zod";
|
|
2211
2293
|
var OptionalDisplayName = NonEmptyString.optional();
|
|
2212
|
-
var UriFilesystemBacking =
|
|
2213
|
-
root:
|
|
2294
|
+
var UriFilesystemBacking = z9.strictObject({
|
|
2295
|
+
root: z9.literal("dataDir")
|
|
2214
2296
|
});
|
|
2215
|
-
var ToolContribution =
|
|
2297
|
+
var ToolContribution = z9.strictObject({
|
|
2216
2298
|
localId: LocalContributionId,
|
|
2217
2299
|
toolName: PluginToolName,
|
|
2218
2300
|
displayName: OptionalDisplayName,
|
|
2219
2301
|
description: NonEmptyString.optional()
|
|
2220
2302
|
});
|
|
2221
|
-
var ConverterContribution =
|
|
2303
|
+
var ConverterContribution = z9.strictObject({
|
|
2222
2304
|
localId: LocalContributionId,
|
|
2223
2305
|
displayName: OptionalDisplayName,
|
|
2224
2306
|
description: NonEmptyString.optional(),
|
|
2225
2307
|
/** MIME types this converter claims — contract data for introspection and
|
|
2226
2308
|
* collision checks; runtime match behavior stays the converter's `matches()`. */
|
|
2227
|
-
mimeTypes:
|
|
2309
|
+
mimeTypes: z9.array(MimeTypeString).min(1),
|
|
2228
2310
|
/** Extension fallbacks (no dot) used when a probe has no usable MIME type. */
|
|
2229
|
-
extensions:
|
|
2311
|
+
extensions: z9.array(FileExtensionToken).min(1).optional()
|
|
2230
2312
|
});
|
|
2231
|
-
var UriModuleContribution =
|
|
2313
|
+
var UriModuleContribution = z9.strictObject({
|
|
2232
2314
|
localId: LocalContributionId,
|
|
2233
|
-
schemes:
|
|
2315
|
+
schemes: z9.array(UriScheme).min(1),
|
|
2234
2316
|
displayName: OptionalDisplayName,
|
|
2235
2317
|
// The plugin only requests a projection. The daemon binds the effective root
|
|
2236
2318
|
// and retains access control at finalization.
|
|
@@ -2249,30 +2331,30 @@ var UriModuleContribution = z8.strictObject({
|
|
|
2249
2331
|
// `knownResources` permission grant (`api.knownResources`). Present-means-on
|
|
2250
2332
|
// (`true` or absent; `false` is not a state). Decision record:
|
|
2251
2333
|
// `lab/user-plugins/decisions/014-known-resources-ledger.md`.
|
|
2252
|
-
knownResources:
|
|
2334
|
+
knownResources: z9.literal(true).optional()
|
|
2253
2335
|
});
|
|
2254
2336
|
var AppUriModuleContribution = UriModuleContribution.omit({
|
|
2255
2337
|
authService: true,
|
|
2256
2338
|
filesystemBacking: true,
|
|
2257
2339
|
knownResources: true
|
|
2258
2340
|
});
|
|
2259
|
-
var AppDataSourceContribution =
|
|
2341
|
+
var AppDataSourceContribution = z9.strictObject({
|
|
2260
2342
|
localId: LocalContributionId,
|
|
2261
|
-
scope:
|
|
2262
|
-
snapshot:
|
|
2263
|
-
version:
|
|
2343
|
+
scope: z9.enum(["runtime", "account", "session"]),
|
|
2344
|
+
snapshot: z9.strictObject({
|
|
2345
|
+
version: z9.number().int().positive(),
|
|
2264
2346
|
schema: JsonSchema
|
|
2265
2347
|
}),
|
|
2266
|
-
change:
|
|
2267
|
-
version:
|
|
2348
|
+
change: z9.strictObject({
|
|
2349
|
+
version: z9.number().int().positive(),
|
|
2268
2350
|
schema: JsonSchema,
|
|
2269
2351
|
/** Review-only claim; source schemas and behavioral tests enforce it because the daemon treats changes as opaque. */
|
|
2270
|
-
semantics:
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
kind:
|
|
2274
|
-
maxEncodedBytes:
|
|
2275
|
-
rationale:
|
|
2352
|
+
semantics: z9.discriminatedUnion("kind", [
|
|
2353
|
+
z9.strictObject({ kind: z9.literal("incremental") }),
|
|
2354
|
+
z9.strictObject({
|
|
2355
|
+
kind: z9.literal("snapshot-replacement"),
|
|
2356
|
+
maxEncodedBytes: z9.number().int().positive(),
|
|
2357
|
+
rationale: z9.string().trim().min(1).max(1024)
|
|
2276
2358
|
})
|
|
2277
2359
|
]).optional()
|
|
2278
2360
|
}),
|
|
@@ -2286,28 +2368,28 @@ var AppDataSourceContribution = z8.strictObject({
|
|
|
2286
2368
|
});
|
|
2287
2369
|
}
|
|
2288
2370
|
});
|
|
2289
|
-
var WhiteboardTypeStorage =
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
kind:
|
|
2371
|
+
var WhiteboardTypeStorage = z9.discriminatedUnion("kind", [
|
|
2372
|
+
z9.strictObject({ kind: z9.literal("json") }),
|
|
2373
|
+
z9.strictObject({ kind: z9.literal("payload") }),
|
|
2374
|
+
z9.strictObject({
|
|
2375
|
+
kind: z9.literal("markdown"),
|
|
2294
2376
|
bodyField: NonEmptyString
|
|
2295
2377
|
})
|
|
2296
2378
|
]);
|
|
2297
|
-
var WhiteboardTypeContribution =
|
|
2379
|
+
var WhiteboardTypeContribution = z9.strictObject({
|
|
2298
2380
|
localId: LocalContributionId,
|
|
2299
2381
|
displayName: NonEmptyString,
|
|
2300
|
-
schemaVersion:
|
|
2382
|
+
schemaVersion: z9.number().int().positive(),
|
|
2301
2383
|
storage: WhiteboardTypeStorage,
|
|
2302
2384
|
valueSchema: JsonSchema,
|
|
2303
|
-
presentation:
|
|
2385
|
+
presentation: z9.strictObject({
|
|
2304
2386
|
app: LocalContributionId
|
|
2305
2387
|
}).optional()
|
|
2306
2388
|
});
|
|
2307
|
-
var AppDataMaterializerContribution =
|
|
2389
|
+
var AppDataMaterializerContribution = z9.strictObject({
|
|
2308
2390
|
source: LocalContributionId
|
|
2309
2391
|
});
|
|
2310
|
-
var ArtifactUriModuleContribution =
|
|
2392
|
+
var ArtifactUriModuleContribution = z9.strictObject({
|
|
2311
2393
|
localId: LocalContributionId,
|
|
2312
2394
|
/** The single `scheme://` this module owns; also the on-disk artifact kind. */
|
|
2313
2395
|
scheme: UriScheme,
|
|
@@ -2321,17 +2403,17 @@ var ArtifactUriModuleContribution = z8.strictObject({
|
|
|
2321
2403
|
* composes its description from the plugin's own display name + scheme — a per-scheme label
|
|
2322
2404
|
* would have no path to matter, so it is intentionally omitted rather than accepted-and-ignored.
|
|
2323
2405
|
*/
|
|
2324
|
-
editable:
|
|
2406
|
+
editable: z9.boolean().optional(),
|
|
2325
2407
|
/** Opt in to `list` over the kind's stored names. Default false. Mirrors
|
|
2326
2408
|
* `CreateArtifactUriModuleOptions.listable`. */
|
|
2327
|
-
listable:
|
|
2409
|
+
listable: z9.boolean().optional(),
|
|
2328
2410
|
/**
|
|
2329
2411
|
* Opt in to `delete` for same-session entries. Default false. Deletion
|
|
2330
2412
|
* unlinks the stored file — no trash tier; a kind that wants recoverable
|
|
2331
2413
|
* deletion is not artifact-backed. Mirrors
|
|
2332
2414
|
* `CreateArtifactUriModuleOptions.deletable`.
|
|
2333
2415
|
*/
|
|
2334
|
-
deletable:
|
|
2416
|
+
deletable: z9.boolean().optional(),
|
|
2335
2417
|
/**
|
|
2336
2418
|
* Opt in to the `{ content, mode: "append" }` write envelope, which extends
|
|
2337
2419
|
* stored text instead of replacing it (concurrent-appender-safe: the host
|
|
@@ -2339,7 +2421,7 @@ var ArtifactUriModuleContribution = z8.strictObject({
|
|
|
2339
2421
|
* keep their verbatim round-trip. Mirrors
|
|
2340
2422
|
* `CreateArtifactUriModuleOptions.appendable`.
|
|
2341
2423
|
*/
|
|
2342
|
-
appendable:
|
|
2424
|
+
appendable: z9.boolean().optional(),
|
|
2343
2425
|
/**
|
|
2344
2426
|
* Which sessions share one storage namespace. Default `"session"` — the existing
|
|
2345
2427
|
* per-session behavior (each session gets its own kind directory; other sessions'
|
|
@@ -2350,14 +2432,14 @@ var ArtifactUriModuleContribution = z8.strictObject({
|
|
|
2350
2432
|
* the scope; the host derives the family root from provenance it already holds, so
|
|
2351
2433
|
* family identity never crosses the SDK boundary.
|
|
2352
2434
|
*/
|
|
2353
|
-
storageScope:
|
|
2435
|
+
storageScope: z9.enum(["session", "family"]).optional()
|
|
2354
2436
|
});
|
|
2355
|
-
var CliBindingContribution =
|
|
2437
|
+
var CliBindingContribution = z9.strictObject({
|
|
2356
2438
|
localId: LocalContributionId,
|
|
2357
2439
|
binary: CliBinaryName,
|
|
2358
|
-
aliases:
|
|
2440
|
+
aliases: z9.array(CliBinaryName).optional(),
|
|
2359
2441
|
/** Where the binary comes from. Omitted ⇒ `"vendored"` (decision 007). */
|
|
2360
|
-
provider:
|
|
2442
|
+
provider: z9.enum(["vendored", "path"]).optional(),
|
|
2361
2443
|
// A local ref (no dot) must name an auth service declared in this same
|
|
2362
2444
|
// manifest; a qualified ref (dotted, e.g. `google.account`) names another
|
|
2363
2445
|
// plugin's already-minted global id and is recorded, not resolved, here (see
|
|
@@ -2370,20 +2452,20 @@ var CliBindingContribution = z8.strictObject({
|
|
|
2370
2452
|
* MUST be absent for a `path` binding, which can never receive a token.
|
|
2371
2453
|
*/
|
|
2372
2454
|
authEnvVar: CliAuthEnvVarName.optional(),
|
|
2373
|
-
readOnly:
|
|
2374
|
-
write:
|
|
2455
|
+
readOnly: z9.array(NonEmptyString),
|
|
2456
|
+
write: z9.array(NonEmptyString)
|
|
2375
2457
|
});
|
|
2376
|
-
var GitHostContribution =
|
|
2458
|
+
var GitHostContribution = z9.strictObject({
|
|
2377
2459
|
host: GitHostName,
|
|
2378
2460
|
authService: LocalContributionId,
|
|
2379
2461
|
basicAuthUser: GitBasicAuthUser
|
|
2380
2462
|
});
|
|
2381
|
-
var ResourceContribution =
|
|
2463
|
+
var ResourceContribution = z9.strictObject({
|
|
2382
2464
|
localId: LocalContributionId,
|
|
2383
2465
|
displayName: OptionalDisplayName,
|
|
2384
2466
|
description: NonEmptyString.optional()
|
|
2385
2467
|
});
|
|
2386
|
-
var SkillContribution =
|
|
2468
|
+
var SkillContribution = z9.strictObject({
|
|
2387
2469
|
localId: LocalContributionId,
|
|
2388
2470
|
displayName: OptionalDisplayName,
|
|
2389
2471
|
/** Model-visible one-liner: when to reach for this skill. */
|
|
@@ -2391,18 +2473,18 @@ var SkillContribution = z8.strictObject({
|
|
|
2391
2473
|
/** The SKILL.md-style file inside the package carrying the full instructions. */
|
|
2392
2474
|
path: PackageAssetPath
|
|
2393
2475
|
});
|
|
2394
|
-
var PluginSkillSourceDeclaration =
|
|
2395
|
-
|
|
2396
|
-
channel:
|
|
2476
|
+
var PluginSkillSourceDeclaration = z9.discriminatedUnion("channel", [
|
|
2477
|
+
z9.strictObject({
|
|
2478
|
+
channel: z9.literal("installer"),
|
|
2397
2479
|
localId: LocalContributionId,
|
|
2398
2480
|
displayName: OptionalDisplayName,
|
|
2399
2481
|
/** The package-runner executable, e.g. `npx` — checked against the daemon's allowlist. */
|
|
2400
2482
|
command: NonEmptyString,
|
|
2401
2483
|
/** Its argv, e.g. `["skills", "add", "clerk/skills"]`. */
|
|
2402
|
-
args:
|
|
2484
|
+
args: z9.array(NonEmptyString)
|
|
2403
2485
|
}),
|
|
2404
|
-
|
|
2405
|
-
channel:
|
|
2486
|
+
z9.strictObject({
|
|
2487
|
+
channel: z9.literal("git-clone"),
|
|
2406
2488
|
localId: LocalContributionId,
|
|
2407
2489
|
displayName: OptionalDisplayName,
|
|
2408
2490
|
/** The repository locator — canonicalized and hygiene-checked by the daemon. */
|
|
@@ -2413,17 +2495,17 @@ var PluginSkillSourceDeclaration = z8.discriminatedUnion("channel", [
|
|
|
2413
2495
|
subdir: NonEmptyString.optional()
|
|
2414
2496
|
})
|
|
2415
2497
|
]);
|
|
2416
|
-
var SearchProviderContribution =
|
|
2498
|
+
var SearchProviderContribution = z9.strictObject({
|
|
2417
2499
|
localId: LocalContributionId,
|
|
2418
2500
|
displayName: OptionalDisplayName,
|
|
2419
|
-
schemes:
|
|
2501
|
+
schemes: z9.array(UriScheme).optional()
|
|
2420
2502
|
});
|
|
2421
|
-
var InteractionDriverContribution =
|
|
2503
|
+
var InteractionDriverContribution = z9.strictObject({
|
|
2422
2504
|
localId: LocalContributionId,
|
|
2423
2505
|
displayName: OptionalDisplayName,
|
|
2424
|
-
kind:
|
|
2506
|
+
kind: z9.enum(["browser", "computer-use"])
|
|
2425
2507
|
});
|
|
2426
|
-
var EntityResolverContribution =
|
|
2508
|
+
var EntityResolverContribution = z9.strictObject({
|
|
2427
2509
|
localId: LocalContributionId,
|
|
2428
2510
|
displayName: OptionalDisplayName,
|
|
2429
2511
|
/** The `kay.agent` URI module (this manifest's own `contributes.uriModules[].localId`) whose
|
|
@@ -2431,24 +2513,24 @@ var EntityResolverContribution = z8.strictObject({
|
|
|
2431
2513
|
uriModule: LocalContributionId,
|
|
2432
2514
|
/** `person` | `channel` | `repo` | `pull-request` | ... -- drives avatar-first vs glyph-first row
|
|
2433
2515
|
* anatomy (N10-R2) and lets the renderer request a narrower `entityTypes` filter. */
|
|
2434
|
-
entityTypes:
|
|
2516
|
+
entityTypes: z9.array(NonEmptyString).min(1),
|
|
2435
2517
|
/** The URI namespace/route `search()` is called against, e.g. `slack://directory` or
|
|
2436
2518
|
* `github://search/repositories` -- the resolver's fixed search scope; the live user query is
|
|
2437
2519
|
* the `search()` call's `query` param, never concatenated into this string. */
|
|
2438
2520
|
uriHint: NonEmptyString
|
|
2439
2521
|
});
|
|
2440
|
-
var AgentRenderContribution =
|
|
2522
|
+
var AgentRenderContribution = z9.strictObject({
|
|
2441
2523
|
localId: LocalContributionId,
|
|
2442
|
-
resultKinds:
|
|
2524
|
+
resultKinds: z9.array(NonEmptyString).min(1)
|
|
2443
2525
|
});
|
|
2444
|
-
var EndpointContribution =
|
|
2526
|
+
var EndpointContribution = z9.strictObject({
|
|
2445
2527
|
localId: LocalContributionId,
|
|
2446
2528
|
displayName: OptionalDisplayName,
|
|
2447
2529
|
requestSchema: JsonSchema.optional(),
|
|
2448
2530
|
responseSchema: JsonSchema.optional()
|
|
2449
2531
|
});
|
|
2450
2532
|
var MCP_SERVER_LOCAL_HTTP_HOSTNAMES = /* @__PURE__ */ new Set(["localhost", "127.0.0.1"]);
|
|
2451
|
-
var McpServerUrl =
|
|
2533
|
+
var McpServerUrl = z9.string().trim().min(1).refine((value) => {
|
|
2452
2534
|
let parsed;
|
|
2453
2535
|
try {
|
|
2454
2536
|
parsed = new URL(value);
|
|
@@ -2461,8 +2543,8 @@ var McpServerUrl = z8.string().trim().min(1).refine((value) => {
|
|
|
2461
2543
|
}, {
|
|
2462
2544
|
message: "mcp server url must be https://, or http:// only for localhost/127.0.0.1 test servers"
|
|
2463
2545
|
});
|
|
2464
|
-
var McpServerAuthMode =
|
|
2465
|
-
var McpServerContribution =
|
|
2546
|
+
var McpServerAuthMode = z9.enum(["oauth", "none"]);
|
|
2547
|
+
var McpServerContribution = z9.strictObject({
|
|
2466
2548
|
url: McpServerUrl,
|
|
2467
2549
|
auth: McpServerAuthMode.optional(),
|
|
2468
2550
|
authService: LocalContributionId.optional()
|
|
@@ -2475,28 +2557,28 @@ var McpServerContribution = z8.strictObject({
|
|
|
2475
2557
|
});
|
|
2476
2558
|
}
|
|
2477
2559
|
});
|
|
2478
|
-
var McpServerContributions =
|
|
2479
|
-
var AppEventSubscription =
|
|
2560
|
+
var McpServerContributions = z9.record(LocalContributionId, McpServerContribution);
|
|
2561
|
+
var AppEventSubscription = z9.strictObject({
|
|
2480
2562
|
localId: LocalContributionId,
|
|
2481
2563
|
event: NonEmptyString
|
|
2482
2564
|
});
|
|
2483
|
-
var ContextContributorContribution =
|
|
2565
|
+
var ContextContributorContribution = z9.strictObject({
|
|
2484
2566
|
localId: LocalContributionId.max(64),
|
|
2485
2567
|
displayName: OptionalDisplayName,
|
|
2486
2568
|
description: NonEmptyString.optional()
|
|
2487
2569
|
});
|
|
2488
|
-
var PluginEventDefinitionContribution =
|
|
2570
|
+
var PluginEventDefinitionContribution = z9.strictObject({
|
|
2489
2571
|
localId: LocalContributionId,
|
|
2490
2572
|
displayName: OptionalDisplayName,
|
|
2491
2573
|
description: NonEmptyString.optional(),
|
|
2492
|
-
version:
|
|
2574
|
+
version: z9.number().int().positive().default(1),
|
|
2493
2575
|
payloadSchema: JsonSchema
|
|
2494
2576
|
});
|
|
2495
|
-
var PluginNotificationRuleContribution =
|
|
2577
|
+
var PluginNotificationRuleContribution = z9.strictObject({
|
|
2496
2578
|
localId: LocalContributionId,
|
|
2497
2579
|
/** The same-plugin `eventDefinitions` local id this rule matches. */
|
|
2498
2580
|
event: LocalContributionId,
|
|
2499
|
-
where:
|
|
2581
|
+
where: z9.array(JsonObject).optional(),
|
|
2500
2582
|
rule: JsonObject
|
|
2501
2583
|
});
|
|
2502
2584
|
var PLUGIN_NOTIFICATION_RULE_HOST_KEYS = [
|
|
@@ -2504,67 +2586,67 @@ var PLUGIN_NOTIFICATION_RULE_HOST_KEYS = [
|
|
|
2504
2586
|
"match",
|
|
2505
2587
|
"sender"
|
|
2506
2588
|
];
|
|
2507
|
-
var UiEventSubscriptionContribution =
|
|
2589
|
+
var UiEventSubscriptionContribution = z9.strictObject({
|
|
2508
2590
|
localId: LocalContributionId,
|
|
2509
2591
|
event: NonEmptyString
|
|
2510
2592
|
});
|
|
2511
|
-
var DeviceDelegationContribution =
|
|
2593
|
+
var DeviceDelegationContribution = z9.strictObject({
|
|
2512
2594
|
localId: LocalContributionId,
|
|
2513
|
-
device:
|
|
2514
|
-
delegateAs:
|
|
2595
|
+
device: z9.enum(["microphone"]),
|
|
2596
|
+
delegateAs: z9.enum(["clip", "stream", "status"])
|
|
2515
2597
|
});
|
|
2516
|
-
var CorpusContribution =
|
|
2598
|
+
var CorpusContribution = z9.strictObject({
|
|
2517
2599
|
localId: LocalContributionId,
|
|
2518
2600
|
displayName: OptionalDisplayName,
|
|
2519
|
-
access:
|
|
2601
|
+
access: z9.enum(["read"]).default("read")
|
|
2520
2602
|
});
|
|
2521
|
-
var UiCommandContribution =
|
|
2603
|
+
var UiCommandContribution = z9.strictObject({
|
|
2522
2604
|
localId: LocalContributionId,
|
|
2523
2605
|
title: NonEmptyString,
|
|
2524
2606
|
icon: NonEmptyString.optional(),
|
|
2525
2607
|
placement: NonEmptyString.optional()
|
|
2526
2608
|
});
|
|
2527
|
-
var UiSlotContribution =
|
|
2609
|
+
var UiSlotContribution = z9.strictObject({
|
|
2528
2610
|
localId: LocalContributionId,
|
|
2529
2611
|
slot: NonEmptyString,
|
|
2530
2612
|
title: NonEmptyString.optional()
|
|
2531
2613
|
});
|
|
2532
|
-
var SettingsPanelContribution =
|
|
2614
|
+
var SettingsPanelContribution = z9.strictObject({
|
|
2533
2615
|
localId: LocalContributionId,
|
|
2534
2616
|
title: NonEmptyString,
|
|
2535
2617
|
configSection: NonEmptyString.optional()
|
|
2536
2618
|
});
|
|
2537
|
-
var ResultRendererContribution =
|
|
2619
|
+
var ResultRendererContribution = z9.strictObject({
|
|
2538
2620
|
localId: LocalContributionId,
|
|
2539
|
-
resultKinds:
|
|
2621
|
+
resultKinds: z9.array(NonEmptyString).min(1)
|
|
2540
2622
|
});
|
|
2541
|
-
var ReferenceOpenBehavior =
|
|
2542
|
-
|
|
2543
|
-
|
|
2623
|
+
var ReferenceOpenBehavior = z9.discriminatedUnion("kind", [
|
|
2624
|
+
z9.strictObject({ kind: z9.literal("working-document") }),
|
|
2625
|
+
z9.strictObject({ kind: z9.literal("browser-pane") }),
|
|
2544
2626
|
/**
|
|
2545
2627
|
* Open one of the presenting plugin's OWN registered pages (`registerPage`'s
|
|
2546
2628
|
* descriptor id) with the reference's canonical URI as the page's `objectId`.
|
|
2547
2629
|
* Needs no web address, so a plugin-only resource (`user-todo://items/3`) can pill.
|
|
2548
2630
|
*/
|
|
2549
|
-
|
|
2631
|
+
z9.strictObject({ kind: z9.literal("page"), pageId: NonEmptyString })
|
|
2550
2632
|
]);
|
|
2551
|
-
var ReferencePresentationVariant =
|
|
2633
|
+
var ReferencePresentationVariant = z9.strictObject({
|
|
2552
2634
|
resourceKind: NonEmptyString,
|
|
2553
2635
|
presentationPluginId: PluginId.optional()
|
|
2554
2636
|
});
|
|
2555
|
-
var ReferencePresentationVariants =
|
|
2556
|
-
var InlineSvg =
|
|
2557
|
-
var ReferencePresentationUrlClaim =
|
|
2558
|
-
kind:
|
|
2559
|
-
pattern:
|
|
2560
|
-
protocol:
|
|
2637
|
+
var ReferencePresentationVariants = z9.record(MimeTypeString, ReferencePresentationVariant);
|
|
2638
|
+
var InlineSvg = z9.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." });
|
|
2639
|
+
var ReferencePresentationUrlClaim = z9.strictObject({
|
|
2640
|
+
kind: z9.literal("urlPattern"),
|
|
2641
|
+
pattern: z9.strictObject({
|
|
2642
|
+
protocol: z9.enum(["http", "https"]),
|
|
2561
2643
|
hostname: NonEmptyString,
|
|
2562
|
-
pathname:
|
|
2563
|
-
search:
|
|
2644
|
+
pathname: z9.string().optional(),
|
|
2645
|
+
search: z9.string().optional()
|
|
2564
2646
|
}),
|
|
2565
2647
|
brandIcon: InlineSvg.optional()
|
|
2566
2648
|
});
|
|
2567
|
-
var ReferencePresentationContribution =
|
|
2649
|
+
var ReferencePresentationContribution = z9.strictObject({
|
|
2568
2650
|
localId: LocalContributionId,
|
|
2569
2651
|
uriModule: LocalContributionId,
|
|
2570
2652
|
resourceKind: NonEmptyString,
|
|
@@ -2572,7 +2654,7 @@ var ReferencePresentationContribution = z8.strictObject({
|
|
|
2572
2654
|
/** MIME-specific resource kinds; absent keys use the base presentation. */
|
|
2573
2655
|
variants: ReferencePresentationVariants.optional(),
|
|
2574
2656
|
/** Lexical public URL claims used only for host-rendered browser presentations. */
|
|
2575
|
-
claims:
|
|
2657
|
+
claims: z9.array(ReferencePresentationUrlClaim).optional()
|
|
2576
2658
|
}).superRefine((value, ctx) => {
|
|
2577
2659
|
if (value.claims !== void 0 && value.claims.length > 0 && value.open.kind !== "browser-pane") {
|
|
2578
2660
|
ctx.addIssue({
|
|
@@ -2582,12 +2664,12 @@ var ReferencePresentationContribution = z8.strictObject({
|
|
|
2582
2664
|
});
|
|
2583
2665
|
}
|
|
2584
2666
|
});
|
|
2585
|
-
var RichViewContribution =
|
|
2667
|
+
var RichViewContribution = z9.strictObject({
|
|
2586
2668
|
localId: LocalContributionId,
|
|
2587
2669
|
title: NonEmptyString,
|
|
2588
2670
|
route: NonEmptyString.optional()
|
|
2589
2671
|
});
|
|
2590
|
-
var KayUiAppHostCapability =
|
|
2672
|
+
var KayUiAppHostCapability = z9.enum([
|
|
2591
2673
|
"navigation.open-session",
|
|
2592
2674
|
"cost.read",
|
|
2593
2675
|
// Server-rated organization billing, distinct from local/provider cost.
|
|
@@ -2618,9 +2700,9 @@ var KayUiAppHostCapability = z8.enum([
|
|
|
2618
2700
|
// rearrange the workspace but never remove something the user would have to notice going missing.
|
|
2619
2701
|
"workspace.arrange"
|
|
2620
2702
|
]);
|
|
2621
|
-
var UiAppCapabilities =
|
|
2622
|
-
endpoints:
|
|
2623
|
-
host:
|
|
2703
|
+
var UiAppCapabilities = z9.strictObject({
|
|
2704
|
+
endpoints: z9.array(LocalContributionId).optional(),
|
|
2705
|
+
host: z9.array(KayUiAppHostCapability).optional()
|
|
2624
2706
|
}).superRefine((capabilities, ctx) => {
|
|
2625
2707
|
for (const field of ["endpoints", "host"]) {
|
|
2626
2708
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -2636,47 +2718,47 @@ var UiAppCapabilities = z8.strictObject({
|
|
|
2636
2718
|
}
|
|
2637
2719
|
}
|
|
2638
2720
|
});
|
|
2639
|
-
var UiAppContribution =
|
|
2721
|
+
var UiAppContribution = z9.strictObject({
|
|
2640
2722
|
localId: LocalContributionId,
|
|
2641
2723
|
displayName: NonEmptyString,
|
|
2642
2724
|
description: NonEmptyString.optional(),
|
|
2643
2725
|
icon: PackageAssetPath.optional(),
|
|
2644
|
-
runtime:
|
|
2645
|
-
sdk:
|
|
2726
|
+
runtime: z9.literal("kay.react-app.v1"),
|
|
2727
|
+
sdk: z9.strictObject({ range: NonEmptyString }),
|
|
2646
2728
|
entrypoint: TargetEntrypoint,
|
|
2647
|
-
styles:
|
|
2648
|
-
assets:
|
|
2729
|
+
styles: z9.array(PackageAssetPath).optional(),
|
|
2730
|
+
assets: z9.array(PackageAssetPath).optional(),
|
|
2649
2731
|
capabilities: UiAppCapabilities.optional()
|
|
2650
2732
|
});
|
|
2651
|
-
var ThemeContribution =
|
|
2733
|
+
var ThemeContribution = z9.strictObject({
|
|
2652
2734
|
localId: LocalContributionId,
|
|
2653
2735
|
displayName: NonEmptyString,
|
|
2654
|
-
appearance:
|
|
2736
|
+
appearance: z9.enum(["light", "dark"]),
|
|
2655
2737
|
tokens: PackageAssetPath
|
|
2656
2738
|
});
|
|
2657
|
-
var CommandHandler =
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
kind:
|
|
2739
|
+
var CommandHandler = z9.discriminatedUnion("kind", [
|
|
2740
|
+
z9.strictObject({ kind: z9.literal("skill"), skill: LocalContributionId }),
|
|
2741
|
+
z9.strictObject({
|
|
2742
|
+
kind: z9.literal("tool"),
|
|
2661
2743
|
tool: PluginToolName,
|
|
2662
2744
|
/** Positional mapping from tokenized `argsText` onto the tool's own input fields — see this
|
|
2663
2745
|
* union's doc for the exact tokenize/map/last-field-absorbs rule. */
|
|
2664
|
-
argumentFields:
|
|
2746
|
+
argumentFields: z9.array(NonEmptyString)
|
|
2665
2747
|
}),
|
|
2666
|
-
|
|
2667
|
-
kind:
|
|
2748
|
+
z9.strictObject({
|
|
2749
|
+
kind: z9.literal("endpoint"),
|
|
2668
2750
|
endpoint: LocalContributionId
|
|
2669
2751
|
})
|
|
2670
2752
|
]);
|
|
2671
|
-
var CommandContribution =
|
|
2753
|
+
var CommandContribution = z9.strictObject({
|
|
2672
2754
|
localId: LocalContributionId,
|
|
2673
2755
|
displayName: OptionalDisplayName,
|
|
2674
2756
|
description: NonEmptyString,
|
|
2675
|
-
aliases:
|
|
2757
|
+
aliases: z9.array(LocalContributionId).optional(),
|
|
2676
2758
|
argumentHint: NonEmptyString.optional(),
|
|
2677
2759
|
handler: CommandHandler
|
|
2678
2760
|
});
|
|
2679
|
-
var PluginContributionKind =
|
|
2761
|
+
var PluginContributionKind = z9.enum([
|
|
2680
2762
|
"tool",
|
|
2681
2763
|
"converter",
|
|
2682
2764
|
"uriModule",
|
|
@@ -2737,6 +2819,9 @@ function resolvePluginNamespace(pluginId, namespace) {
|
|
|
2737
2819
|
function resolveGlobalContributionId(namespace, localId) {
|
|
2738
2820
|
return `${namespace}.${localId}`;
|
|
2739
2821
|
}
|
|
2822
|
+
function deriveDirectoryPluginToolName(namespace, localId) {
|
|
2823
|
+
return `${namespace.replaceAll(".", "_")}_${localId}`;
|
|
2824
|
+
}
|
|
2740
2825
|
function resolvePluginEventType(namespace, localId) {
|
|
2741
2826
|
return resolveGlobalContributionId(namespace, localId);
|
|
2742
2827
|
}
|
|
@@ -2751,7 +2836,7 @@ function resolveAdapterId(globalId, declaredAdapterId) {
|
|
|
2751
2836
|
}
|
|
2752
2837
|
|
|
2753
2838
|
// packages/plugin-protocol/dist/manifest.js
|
|
2754
|
-
import { z as
|
|
2839
|
+
import { z as z10 } from "zod";
|
|
2755
2840
|
|
|
2756
2841
|
// packages/plugin-protocol/dist/synthetic-contributions.js
|
|
2757
2842
|
function resolveConfigSectionContributionLocalId(section) {
|
|
@@ -2771,34 +2856,34 @@ var KAY_UI_NATIVE_EVENT_SUBSCRIPTIONS = [
|
|
|
2771
2856
|
"native:renderer.contributions.changed"
|
|
2772
2857
|
];
|
|
2773
2858
|
var KAY_UI_NATIVE_EVENT_ALLOWLIST = new Set(KAY_UI_NATIVE_EVENT_SUBSCRIPTIONS);
|
|
2774
|
-
var KayAgentTargetManifest =
|
|
2859
|
+
var KayAgentTargetManifest = z10.strictObject({
|
|
2775
2860
|
entrypoint: TargetEntrypoint,
|
|
2776
|
-
contributes:
|
|
2777
|
-
tools:
|
|
2778
|
-
converters:
|
|
2779
|
-
uriModules:
|
|
2861
|
+
contributes: z10.strictObject({
|
|
2862
|
+
tools: z10.array(ToolContribution).optional(),
|
|
2863
|
+
converters: z10.array(ConverterContribution).optional(),
|
|
2864
|
+
uriModules: z10.array(UriModuleContribution).optional(),
|
|
2780
2865
|
// Host-composed artifact-backed schemes (see `ArtifactUriModuleContribution`): the plugin
|
|
2781
2866
|
// declares scheme + editability; the daemon binds each to the kernel's artifact lifecycle
|
|
2782
2867
|
// per session. Separate from `uriModules` (plugin-implemented backends) precisely because
|
|
2783
2868
|
// the plugin registers NOTHING for these at activation.
|
|
2784
|
-
artifactUriModules:
|
|
2785
|
-
cliBindings:
|
|
2869
|
+
artifactUriModules: z10.array(ArtifactUriModuleContribution).optional(),
|
|
2870
|
+
cliBindings: z10.array(CliBindingContribution).optional(),
|
|
2786
2871
|
// Which git hosts this plugin's credential serves (see `GitHostContribution`): a
|
|
2787
2872
|
// declaration, so a plugin for any git backend gets credentialed clones without
|
|
2788
2873
|
// the daemon learning its name. Sibling of `cliBindings` because both answer the
|
|
2789
2874
|
// same question — which of this plugin's auth services a host-side consumer
|
|
2790
2875
|
// resolves — for two different transports.
|
|
2791
|
-
gitHosts:
|
|
2792
|
-
resources:
|
|
2793
|
-
skills:
|
|
2794
|
-
searchProviders:
|
|
2795
|
-
interactionDrivers:
|
|
2796
|
-
entityResolvers:
|
|
2797
|
-
renderers:
|
|
2876
|
+
gitHosts: z10.array(GitHostContribution).optional(),
|
|
2877
|
+
resources: z10.array(ResourceContribution).optional(),
|
|
2878
|
+
skills: z10.array(SkillContribution).optional(),
|
|
2879
|
+
searchProviders: z10.array(SearchProviderContribution).optional(),
|
|
2880
|
+
interactionDrivers: z10.array(InteractionDriverContribution).optional(),
|
|
2881
|
+
entityResolvers: z10.array(EntityResolverContribution).optional(),
|
|
2882
|
+
renderers: z10.array(AgentRenderContribution).optional(),
|
|
2798
2883
|
// Handler restricted to skill | tool by the manifest-level refinement below (see
|
|
2799
2884
|
// `CommandContribution`'s doc for why the restriction is not expressed in the type, and
|
|
2800
2885
|
// `CommandHandler`'s doc for why there is no promptTemplate variant to declare here).
|
|
2801
|
-
commands:
|
|
2886
|
+
commands: z10.array(CommandContribution).optional()
|
|
2802
2887
|
}).optional(),
|
|
2803
2888
|
/**
|
|
2804
2889
|
* The plugin's primer skill — the `localId` of one of its own declared
|
|
@@ -2825,7 +2910,7 @@ var KayAgentTargetManifest = z9.strictObject({
|
|
|
2825
2910
|
* `# Your workbench`, for every session the plugin is enabled in. Declaring it is the opt-in:
|
|
2826
2911
|
* most plugins should NOT be resident (their `<installed_plugins>` line plus primer is the
|
|
2827
2912
|
* default advertisement); a plugin that is part of how the agent works every turn (memory,
|
|
2828
|
-
*
|
|
2913
|
+
* whiteboard) earns a section here. The body is prose the agent reads before any
|
|
2829
2914
|
* routing, so it should say what the capability is and when to reach for it, not how to
|
|
2830
2915
|
* operate it — that is the primer's job, and the host appends the primer route after the body.
|
|
2831
2916
|
*
|
|
@@ -2844,55 +2929,55 @@ var KayAgentTargetManifest = z9.strictObject({
|
|
|
2844
2929
|
* acquisition, not declared here, so there is nothing for the resolved contract to mint a
|
|
2845
2930
|
* `globalId` for at parse time.
|
|
2846
2931
|
*/
|
|
2847
|
-
skillSources:
|
|
2932
|
+
skillSources: z10.array(PluginSkillSourceDeclaration).optional()
|
|
2848
2933
|
});
|
|
2849
|
-
var KayAppTargetManifest =
|
|
2934
|
+
var KayAppTargetManifest = z10.strictObject({
|
|
2850
2935
|
// Optional, like `kay.ui`'s: a target may carry only declarative `contributes` (e.g. a plugin
|
|
2851
2936
|
// that ships nothing but `mcpServers`) with no app-lifetime module for the host to load.
|
|
2852
2937
|
entrypoint: TargetEntrypoint.optional(),
|
|
2853
|
-
contributes:
|
|
2938
|
+
contributes: z10.strictObject({
|
|
2854
2939
|
// Session tools implemented by the app-lifetime activation (registered once, injected into
|
|
2855
2940
|
// every session with a host-stamped session context) — the tool counterpart of `uriModules`
|
|
2856
2941
|
// below. Same descriptor shape as kay.agent tools; `toolName` shares ONE flat session
|
|
2857
2942
|
// namespace with them (enforced by the manifest-level refinement below).
|
|
2858
|
-
tools:
|
|
2859
|
-
endpoints:
|
|
2860
|
-
uriModules:
|
|
2861
|
-
dataSources:
|
|
2862
|
-
whiteboardTypes:
|
|
2863
|
-
eventDefinitions:
|
|
2943
|
+
tools: z10.array(ToolContribution).optional(),
|
|
2944
|
+
endpoints: z10.array(EndpointContribution).optional(),
|
|
2945
|
+
uriModules: z10.array(AppUriModuleContribution).optional(),
|
|
2946
|
+
dataSources: z10.array(AppDataSourceContribution).optional(),
|
|
2947
|
+
whiteboardTypes: z10.array(WhiteboardTypeContribution).optional(),
|
|
2948
|
+
eventDefinitions: z10.array(PluginEventDefinitionContribution).optional(),
|
|
2864
2949
|
// Default notification rules over this plugin's own `eventDefinitions`; seeded by the host
|
|
2865
2950
|
// (see `PluginNotificationRuleContribution`).
|
|
2866
|
-
notificationRules:
|
|
2867
|
-
eventSubscriptions:
|
|
2868
|
-
deviceDelegations:
|
|
2869
|
-
corpusConsumers:
|
|
2870
|
-
contextContributors:
|
|
2951
|
+
notificationRules: z10.array(PluginNotificationRuleContribution).optional(),
|
|
2952
|
+
eventSubscriptions: z10.array(AppEventSubscription).optional(),
|
|
2953
|
+
deviceDelegations: z10.array(DeviceDelegationContribution).optional(),
|
|
2954
|
+
corpusConsumers: z10.array(CorpusContribution).optional(),
|
|
2955
|
+
contextContributors: z10.array(ContextContributorContribution).optional(),
|
|
2871
2956
|
// Vendored MCP servers this plugin ships (see `McpServerContributions`). Bundled-plugin-only
|
|
2872
2957
|
// in practice; this package cannot see plugin origin, so that ceiling is enforced at
|
|
2873
2958
|
// composition, not here (see ARCHITECTURE.md "Validation Law").
|
|
2874
2959
|
mcpServers: McpServerContributions.optional(),
|
|
2875
2960
|
// Handler restricted to endpoint-only by the manifest-level refinement below.
|
|
2876
|
-
commands:
|
|
2961
|
+
commands: z10.array(CommandContribution).optional()
|
|
2877
2962
|
}).optional()
|
|
2878
2963
|
});
|
|
2879
|
-
var KayUiTargetManifest =
|
|
2964
|
+
var KayUiTargetManifest = z10.strictObject({
|
|
2880
2965
|
entrypoint: TargetEntrypoint.optional(),
|
|
2881
|
-
contributes:
|
|
2882
|
-
commands:
|
|
2883
|
-
slots:
|
|
2884
|
-
settingsPanels:
|
|
2885
|
-
resultRenderers:
|
|
2886
|
-
referencePresentations:
|
|
2887
|
-
views:
|
|
2888
|
-
apps:
|
|
2889
|
-
themes:
|
|
2890
|
-
eventSubscriptions:
|
|
2891
|
-
dataMaterializers:
|
|
2966
|
+
contributes: z10.strictObject({
|
|
2967
|
+
commands: z10.array(UiCommandContribution).optional(),
|
|
2968
|
+
slots: z10.array(UiSlotContribution).optional(),
|
|
2969
|
+
settingsPanels: z10.array(SettingsPanelContribution).optional(),
|
|
2970
|
+
resultRenderers: z10.array(ResultRendererContribution).optional(),
|
|
2971
|
+
referencePresentations: z10.array(ReferencePresentationContribution).optional(),
|
|
2972
|
+
views: z10.array(RichViewContribution).optional(),
|
|
2973
|
+
apps: z10.array(UiAppContribution).optional(),
|
|
2974
|
+
themes: z10.array(ThemeContribution).optional(),
|
|
2975
|
+
eventSubscriptions: z10.array(UiEventSubscriptionContribution).optional(),
|
|
2976
|
+
dataMaterializers: z10.array(AppDataMaterializerContribution).optional()
|
|
2892
2977
|
}).optional()
|
|
2893
2978
|
});
|
|
2894
|
-
var PluginConfigScope =
|
|
2895
|
-
var PluginConfigSectionManifest =
|
|
2979
|
+
var PluginConfigScope = z10.enum(["global", "project", "agent"]);
|
|
2980
|
+
var PluginConfigSectionManifest = z10.strictObject({
|
|
2896
2981
|
section: NonEmptyString.optional(),
|
|
2897
2982
|
schema: JsonSchema,
|
|
2898
2983
|
/**
|
|
@@ -2910,25 +2995,25 @@ var PluginConfigSectionManifest = z9.strictObject({
|
|
|
2910
2995
|
* is the baseline every section has; `agent` has no runtime mapping (the
|
|
2911
2996
|
* agent/entity fold is downstream of the document protocol).
|
|
2912
2997
|
*/
|
|
2913
|
-
scopes:
|
|
2998
|
+
scopes: z10.array(PluginConfigScope).optional()
|
|
2914
2999
|
});
|
|
2915
|
-
var PluginConfigManifest =
|
|
3000
|
+
var PluginConfigManifest = z10.array(PluginConfigSectionManifest).min(1);
|
|
2916
3001
|
function configSectionKeysForManifest(manifest) {
|
|
2917
3002
|
return manifest.config?.map((config) => config.section ?? `plugins.${manifest.id}`) ?? [];
|
|
2918
3003
|
}
|
|
2919
|
-
var PluginStorageManifest =
|
|
2920
|
-
sqlite:
|
|
2921
|
-
enabled:
|
|
2922
|
-
ownerTarget:
|
|
3004
|
+
var PluginStorageManifest = z10.strictObject({
|
|
3005
|
+
sqlite: z10.strictObject({
|
|
3006
|
+
enabled: z10.boolean(),
|
|
3007
|
+
ownerTarget: z10.literal("kay.app").optional(),
|
|
2923
3008
|
migrations: NonEmptyString.optional()
|
|
2924
3009
|
}).optional(),
|
|
2925
|
-
dataDir:
|
|
2926
|
-
enabled:
|
|
2927
|
-
ownerTarget:
|
|
3010
|
+
dataDir: z10.strictObject({
|
|
3011
|
+
enabled: z10.boolean(),
|
|
3012
|
+
ownerTarget: z10.literal("kay.app").optional()
|
|
2928
3013
|
}).optional()
|
|
2929
3014
|
});
|
|
2930
|
-
var PluginOAuthClientSupplier =
|
|
2931
|
-
var PluginProvisioningProbe =
|
|
3015
|
+
var PluginOAuthClientSupplier = z10.enum(["kay", "user"]);
|
|
3016
|
+
var PluginProvisioningProbe = z10.strictObject({
|
|
2932
3017
|
/**
|
|
2933
3018
|
* The API endpoint that answers the question. The host sends the service's OWN credential here,
|
|
2934
3019
|
* so this must belong to the provider that minted it — enforced by the daemon against the
|
|
@@ -2936,13 +3021,13 @@ var PluginProvisioningProbe = z9.strictObject({
|
|
|
2936
3021
|
*/
|
|
2937
3022
|
url: HttpsUrl,
|
|
2938
3023
|
/** Absent ⇒ `GET`. */
|
|
2939
|
-
method:
|
|
3024
|
+
method: z10.enum(["GET"]).optional(),
|
|
2940
3025
|
/**
|
|
2941
3026
|
* The statuses that make the response a VERDICT at all. Anything else (a 401 from a stale
|
|
2942
3027
|
* token, a 5xx, a rate limit) means the probe learned nothing and reports `unknown` — never
|
|
2943
3028
|
* `unsatisfied`, which would tell a user to go fix setup that is fine.
|
|
2944
3029
|
*/
|
|
2945
|
-
verdictStatuses:
|
|
3030
|
+
verdictStatuses: z10.array(SignedInStatusCode).min(1),
|
|
2946
3031
|
/**
|
|
2947
3032
|
* Dot-path to a JSON array in the response body that must be NON-EMPTY for the requirement to
|
|
2948
3033
|
* count as satisfied (e.g. `installations`). Absent means a verdict status alone is enough.
|
|
@@ -2951,7 +3036,7 @@ var PluginProvisioningProbe = z9.strictObject({
|
|
|
2951
3036
|
*/
|
|
2952
3037
|
nonEmptyArrayAt: NonEmptyString.optional()
|
|
2953
3038
|
});
|
|
2954
|
-
var PluginProvisioningRequirement =
|
|
3039
|
+
var PluginProvisioningRequirement = z10.strictObject({
|
|
2955
3040
|
/** Stable id, unique within the scheme. */
|
|
2956
3041
|
id: LocalContributionId,
|
|
2957
3042
|
/** Human-facing requirement name, e.g. "GitHub App installation". */
|
|
@@ -2968,7 +3053,7 @@ var PluginProvisioningRequirement = z9.strictObject({
|
|
|
2968
3053
|
probe: PluginProvisioningProbe
|
|
2969
3054
|
});
|
|
2970
3055
|
var PluginProvisioningField = {
|
|
2971
|
-
provisioning:
|
|
3056
|
+
provisioning: z10.array(PluginProvisioningRequirement).optional()
|
|
2972
3057
|
};
|
|
2973
3058
|
var PluginAuthSchemeDescriptionFields = {
|
|
2974
3059
|
/** Human-facing flow name; the runtime scheme name is the fallback. */
|
|
@@ -2981,19 +3066,19 @@ var PluginAuthSchemeDescriptionFields = {
|
|
|
2981
3066
|
*/
|
|
2982
3067
|
summary: NonEmptyString.optional()
|
|
2983
3068
|
};
|
|
2984
|
-
var PluginAuthSchemeOAuthPkce =
|
|
3069
|
+
var PluginAuthSchemeOAuthPkce = z10.strictObject({
|
|
2985
3070
|
...PluginProvisioningField,
|
|
2986
3071
|
...PluginAuthSchemeDescriptionFields,
|
|
2987
3072
|
localId: LocalContributionId,
|
|
2988
|
-
kind:
|
|
2989
|
-
exchange:
|
|
3073
|
+
kind: z10.literal("oauth2"),
|
|
3074
|
+
exchange: z10.literal("pkce"),
|
|
2990
3075
|
/**
|
|
2991
3076
|
* Unordered SET of who may supply the client — non-empty, and every entry must be distinct
|
|
2992
3077
|
* (fail-closed re-assertion of the kernel's construction-time dedupe: TS exhaustiveness never
|
|
2993
3078
|
* runs on an untrusted manifest, so a hand-built `["kay","kay"]` must be refused here, not
|
|
2994
3079
|
* silently normalized).
|
|
2995
3080
|
*/
|
|
2996
|
-
clientSuppliers:
|
|
3081
|
+
clientSuppliers: z10.array(PluginOAuthClientSupplier).nonempty().superRefine((suppliers, ctx) => {
|
|
2997
3082
|
if (new Set(suppliers).size !== suppliers.length) {
|
|
2998
3083
|
ctx.addIssue({
|
|
2999
3084
|
code: "custom",
|
|
@@ -3001,70 +3086,70 @@ var PluginAuthSchemeOAuthPkce = z9.strictObject({
|
|
|
3001
3086
|
});
|
|
3002
3087
|
}
|
|
3003
3088
|
}),
|
|
3004
|
-
scopes:
|
|
3089
|
+
scopes: z10.array(NonEmptyString).optional()
|
|
3005
3090
|
});
|
|
3006
|
-
var PluginAuthSchemeOAuthConfidential =
|
|
3091
|
+
var PluginAuthSchemeOAuthConfidential = z10.strictObject({
|
|
3007
3092
|
...PluginProvisioningField,
|
|
3008
3093
|
...PluginAuthSchemeDescriptionFields,
|
|
3009
3094
|
localId: LocalContributionId,
|
|
3010
|
-
kind:
|
|
3011
|
-
exchange:
|
|
3095
|
+
kind: z10.literal("oauth2"),
|
|
3096
|
+
exchange: z10.literal("confidential"),
|
|
3012
3097
|
/** Absent means `["kay"]` — a confidential exchange's secret may only ever be Bonsai's. */
|
|
3013
|
-
clientSuppliers:
|
|
3014
|
-
scopes:
|
|
3098
|
+
clientSuppliers: z10.tuple([z10.literal("kay")]).optional(),
|
|
3099
|
+
scopes: z10.array(NonEmptyString).optional()
|
|
3015
3100
|
});
|
|
3016
|
-
var PluginAuthSchemeOAuth2 =
|
|
3101
|
+
var PluginAuthSchemeOAuth2 = z10.discriminatedUnion("exchange", [
|
|
3017
3102
|
PluginAuthSchemeOAuthPkce,
|
|
3018
3103
|
PluginAuthSchemeOAuthConfidential
|
|
3019
3104
|
]);
|
|
3020
|
-
var PluginAuthSchemeApiKey =
|
|
3105
|
+
var PluginAuthSchemeApiKey = z10.strictObject({
|
|
3021
3106
|
...PluginProvisioningField,
|
|
3022
3107
|
...PluginAuthSchemeDescriptionFields,
|
|
3023
3108
|
localId: LocalContributionId,
|
|
3024
|
-
kind:
|
|
3025
|
-
scopes:
|
|
3109
|
+
kind: z10.literal("api-key"),
|
|
3110
|
+
scopes: z10.array(NonEmptyString).optional()
|
|
3026
3111
|
});
|
|
3027
|
-
var PluginAuthSchemeDelegated =
|
|
3112
|
+
var PluginAuthSchemeDelegated = z10.strictObject({
|
|
3028
3113
|
...PluginAuthSchemeDescriptionFields,
|
|
3029
3114
|
localId: LocalContributionId,
|
|
3030
|
-
kind:
|
|
3031
|
-
scopes:
|
|
3115
|
+
kind: z10.literal("delegated"),
|
|
3116
|
+
scopes: z10.array(NonEmptyString).optional()
|
|
3032
3117
|
});
|
|
3033
|
-
var PluginAuthSchemeExternalCli =
|
|
3118
|
+
var PluginAuthSchemeExternalCli = z10.strictObject({
|
|
3034
3119
|
...PluginAuthSchemeDescriptionFields,
|
|
3035
3120
|
localId: LocalContributionId,
|
|
3036
|
-
kind:
|
|
3037
|
-
scopes:
|
|
3121
|
+
kind: z10.literal("external-cli"),
|
|
3122
|
+
scopes: z10.array(NonEmptyString).optional()
|
|
3038
3123
|
});
|
|
3039
|
-
var PluginAuthScheme =
|
|
3124
|
+
var PluginAuthScheme = z10.discriminatedUnion("kind", [
|
|
3040
3125
|
PluginAuthSchemeOAuth2,
|
|
3041
3126
|
PluginAuthSchemeApiKey,
|
|
3042
3127
|
PluginAuthSchemeDelegated,
|
|
3043
3128
|
PluginAuthSchemeExternalCli
|
|
3044
3129
|
]);
|
|
3045
|
-
var PluginWebSessionProbe =
|
|
3130
|
+
var PluginWebSessionProbe = z10.strictObject({
|
|
3046
3131
|
url: HttpsUrl,
|
|
3047
3132
|
/** Absent ⇒ `GET`. `POST` sends an empty JSON object body. */
|
|
3048
|
-
method:
|
|
3049
|
-
signedInStatuses:
|
|
3133
|
+
method: z10.enum(["GET", "POST"]).optional(),
|
|
3134
|
+
signedInStatuses: z10.array(SignedInStatusCode).min(1)
|
|
3050
3135
|
});
|
|
3051
|
-
var PluginWebSessionDeclaration =
|
|
3136
|
+
var PluginWebSessionDeclaration = z10.strictObject({
|
|
3052
3137
|
/** `required`: capabilities degrade without the site login; `recommended`: it only smooths UX. */
|
|
3053
|
-
importance:
|
|
3138
|
+
importance: z10.enum(["required", "recommended"]),
|
|
3054
3139
|
loginUrl: HttpsUrl,
|
|
3055
|
-
cookieDomains:
|
|
3140
|
+
cookieDomains: z10.array(RegistrableDomain).min(1),
|
|
3056
3141
|
probe: PluginWebSessionProbe,
|
|
3057
|
-
oauthVenue:
|
|
3142
|
+
oauthVenue: z10.enum(["embedded", "external"])
|
|
3058
3143
|
}).superRefine(refineWebSessionScopeConfined);
|
|
3059
|
-
var PluginAuthService =
|
|
3144
|
+
var PluginAuthService = z10.strictObject({
|
|
3060
3145
|
localId: LocalContributionId,
|
|
3061
3146
|
displayName: NonEmptyString,
|
|
3062
|
-
schemes:
|
|
3063
|
-
purposes:
|
|
3147
|
+
schemes: z10.array(PluginAuthScheme).min(1),
|
|
3148
|
+
purposes: z10.array(NonEmptyString).min(1),
|
|
3064
3149
|
webSession: PluginWebSessionDeclaration.optional()
|
|
3065
3150
|
});
|
|
3066
|
-
var PluginAuthManifest =
|
|
3067
|
-
services:
|
|
3151
|
+
var PluginAuthManifest = z10.strictObject({
|
|
3152
|
+
services: z10.array(PluginAuthService).optional()
|
|
3068
3153
|
});
|
|
3069
3154
|
var RETIRED_COMPATIBILITY_KEYS = ["policy"];
|
|
3070
3155
|
function stripRetiredCompatibilityKeys(value) {
|
|
@@ -3076,8 +3161,8 @@ function stripRetiredCompatibilityKeys(value) {
|
|
|
3076
3161
|
delete remaining[key];
|
|
3077
3162
|
return remaining;
|
|
3078
3163
|
}
|
|
3079
|
-
var PluginCompatibilityManifest =
|
|
3080
|
-
supportedProtocols:
|
|
3164
|
+
var PluginCompatibilityManifest = z10.preprocess(stripRetiredCompatibilityKeys, z10.strictObject({
|
|
3165
|
+
supportedProtocols: z10.array(KayPluginProtocolVersion).optional(),
|
|
3081
3166
|
minKayVersion: NonEmptyString.optional(),
|
|
3082
3167
|
sdk: NonEmptyString.optional()
|
|
3083
3168
|
}));
|
|
@@ -3093,8 +3178,8 @@ function retiredCompatibilityKeysIn(rawManifest) {
|
|
|
3093
3178
|
var KayVersionString = NonEmptyString.regex(SEMVER_PATTERN, {
|
|
3094
3179
|
message: "version must be semver, for example 1.2.3"
|
|
3095
3180
|
});
|
|
3096
|
-
var KayPluginManifestV1 =
|
|
3097
|
-
protocol:
|
|
3181
|
+
var KayPluginManifestV1 = z10.strictObject({
|
|
3182
|
+
protocol: z10.literal(KAY_PLUGIN_PROTOCOL_VERSION),
|
|
3098
3183
|
id: PluginId,
|
|
3099
3184
|
displayName: NonEmptyString,
|
|
3100
3185
|
version: KayVersionString,
|
|
@@ -3124,8 +3209,8 @@ var KayPluginManifestV1 = z9.strictObject({
|
|
|
3124
3209
|
icon: PackageAssetPath.optional(),
|
|
3125
3210
|
iconDark: PackageAssetPath.optional(),
|
|
3126
3211
|
namespace: PluginNamespace.optional(),
|
|
3127
|
-
targets:
|
|
3128
|
-
kay:
|
|
3212
|
+
targets: z10.strictObject({
|
|
3213
|
+
kay: z10.strictObject({
|
|
3129
3214
|
agent: KayAgentTargetManifest.optional(),
|
|
3130
3215
|
app: KayAppTargetManifest.optional(),
|
|
3131
3216
|
ui: KayUiTargetManifest.optional()
|
|
@@ -3142,15 +3227,15 @@ var KayPluginManifestV1 = z9.strictObject({
|
|
|
3142
3227
|
* schemes then report `ownedByBonsai`. Honoured only for a plugin that ships with Bonsai: the
|
|
3143
3228
|
* host reads any other plugin's flag as false. Absent ⇒ false.
|
|
3144
3229
|
*/
|
|
3145
|
-
ownedByBonsai:
|
|
3230
|
+
ownedByBonsai: z10.boolean().optional(),
|
|
3146
3231
|
/**
|
|
3147
3232
|
* Explicit plugin-level dependencies — other plugins this plugin requires to be present in the
|
|
3148
3233
|
* composed roster. At composition time the runtime checks each id against the accepted
|
|
3149
3234
|
* registration list and derives a provenance-complete dependency graph (together with implicit
|
|
3150
3235
|
* auth-service edges from `consumesAuthServices`). Absent ⇒ no explicit dependencies.
|
|
3151
3236
|
*/
|
|
3152
|
-
dependencies:
|
|
3153
|
-
plugins:
|
|
3237
|
+
dependencies: z10.strictObject({
|
|
3238
|
+
plugins: z10.array(PluginId).optional()
|
|
3154
3239
|
}).optional()
|
|
3155
3240
|
}).superRefine((manifest, ctx) => {
|
|
3156
3241
|
const authServices = new Set(manifest.auth?.services?.map((service) => service.localId) ?? []);
|
|
@@ -3820,7 +3905,7 @@ function pushContributionIds(output, path, items) {
|
|
|
3820
3905
|
}
|
|
3821
3906
|
|
|
3822
3907
|
// packages/plugin-protocol/dist/plugin-directory-verdict.js
|
|
3823
|
-
import { z as
|
|
3908
|
+
import { z as z12 } from "zod";
|
|
3824
3909
|
|
|
3825
3910
|
// packages/plugin-protocol/dist/plugin-load-diagnostic.js
|
|
3826
3911
|
var PLUGIN_DIAGNOSTIC_MESSAGE_CAP = 300;
|
|
@@ -3829,36 +3914,36 @@ function boundPluginDiagnosticMessage(message) {
|
|
|
3829
3914
|
}
|
|
3830
3915
|
|
|
3831
3916
|
// packages/plugin-protocol/dist/resolved-contract.js
|
|
3832
|
-
import { z as
|
|
3833
|
-
var ResolvedPluginContributionId =
|
|
3917
|
+
import { z as z11 } from "zod";
|
|
3918
|
+
var ResolvedPluginContributionId = z11.strictObject({
|
|
3834
3919
|
target: PluginTargetName,
|
|
3835
3920
|
kind: PluginContributionKind,
|
|
3836
3921
|
localId: LocalContributionId,
|
|
3837
3922
|
globalId: GlobalContributionId
|
|
3838
3923
|
});
|
|
3839
|
-
var ResolvedKayAgentTool =
|
|
3924
|
+
var ResolvedKayAgentTool = z11.strictObject({
|
|
3840
3925
|
localId: LocalContributionId,
|
|
3841
3926
|
globalId: GlobalContributionId,
|
|
3842
3927
|
toolName: PluginToolName
|
|
3843
3928
|
});
|
|
3844
3929
|
var ResolvedKayAppTool = ResolvedKayAgentTool;
|
|
3845
|
-
var ResolvedKayAppDataSource =
|
|
3930
|
+
var ResolvedKayAppDataSource = z11.strictObject({
|
|
3846
3931
|
localId: LocalContributionId,
|
|
3847
3932
|
globalId: GlobalContributionId,
|
|
3848
|
-
scope:
|
|
3849
|
-
snapshot:
|
|
3850
|
-
version:
|
|
3851
|
-
schema:
|
|
3933
|
+
scope: z11.enum(["runtime", "account", "session"]),
|
|
3934
|
+
snapshot: z11.strictObject({
|
|
3935
|
+
version: z11.number().int().positive(),
|
|
3936
|
+
schema: z11.record(z11.string(), z11.unknown())
|
|
3852
3937
|
}),
|
|
3853
|
-
change:
|
|
3854
|
-
version:
|
|
3855
|
-
schema:
|
|
3856
|
-
semantics:
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
kind:
|
|
3860
|
-
maxEncodedBytes:
|
|
3861
|
-
rationale:
|
|
3938
|
+
change: z11.strictObject({
|
|
3939
|
+
version: z11.number().int().positive(),
|
|
3940
|
+
schema: z11.record(z11.string(), z11.unknown()),
|
|
3941
|
+
semantics: z11.discriminatedUnion("kind", [
|
|
3942
|
+
z11.strictObject({ kind: z11.literal("incremental") }),
|
|
3943
|
+
z11.strictObject({
|
|
3944
|
+
kind: z11.literal("snapshot-replacement"),
|
|
3945
|
+
maxEncodedBytes: z11.number().int().positive(),
|
|
3946
|
+
rationale: z11.string().trim().min(1).max(1024)
|
|
3862
3947
|
})
|
|
3863
3948
|
]).optional()
|
|
3864
3949
|
}),
|
|
@@ -3872,66 +3957,66 @@ var ResolvedKayAppDataSource = z10.strictObject({
|
|
|
3872
3957
|
});
|
|
3873
3958
|
}
|
|
3874
3959
|
});
|
|
3875
|
-
var ResolvedKayAppWhiteboardType =
|
|
3960
|
+
var ResolvedKayAppWhiteboardType = z11.strictObject({
|
|
3876
3961
|
localId: LocalContributionId,
|
|
3877
3962
|
globalId: GlobalContributionId,
|
|
3878
3963
|
displayName: NonEmptyString,
|
|
3879
|
-
schemaVersion:
|
|
3964
|
+
schemaVersion: z11.number().int().positive(),
|
|
3880
3965
|
storage: WhiteboardTypeStorage,
|
|
3881
3966
|
valueSchema: JsonSchema,
|
|
3882
|
-
presentation:
|
|
3967
|
+
presentation: z11.strictObject({
|
|
3883
3968
|
app: GlobalContributionId
|
|
3884
3969
|
}).optional()
|
|
3885
3970
|
});
|
|
3886
|
-
var ResolvedKayAppMcpServer =
|
|
3971
|
+
var ResolvedKayAppMcpServer = z11.strictObject({
|
|
3887
3972
|
name: LocalContributionId,
|
|
3888
3973
|
pluginId: PluginId,
|
|
3889
3974
|
url: McpServerUrl,
|
|
3890
3975
|
auth: McpServerAuthMode,
|
|
3891
3976
|
authServiceId: GlobalContributionId.optional()
|
|
3892
3977
|
});
|
|
3893
|
-
var ResolvedKayAgentUriModule =
|
|
3978
|
+
var ResolvedKayAgentUriModule = z11.strictObject({
|
|
3894
3979
|
localId: LocalContributionId,
|
|
3895
3980
|
globalId: GlobalContributionId,
|
|
3896
|
-
schemes:
|
|
3981
|
+
schemes: z11.array(UriScheme).min(1),
|
|
3897
3982
|
filesystemBacking: UriFilesystemBacking.optional(),
|
|
3898
3983
|
/** Mirrors `UriModuleContribution.knownResources` (host-side recording opt-in). */
|
|
3899
|
-
knownResources:
|
|
3984
|
+
knownResources: z11.literal(true).optional()
|
|
3900
3985
|
});
|
|
3901
|
-
var ResolvedKayAgentArtifactUriModule =
|
|
3986
|
+
var ResolvedKayAgentArtifactUriModule = z11.strictObject({
|
|
3902
3987
|
localId: LocalContributionId,
|
|
3903
3988
|
globalId: GlobalContributionId,
|
|
3904
3989
|
scheme: UriScheme,
|
|
3905
|
-
editable:
|
|
3906
|
-
listable:
|
|
3907
|
-
deletable:
|
|
3908
|
-
appendable:
|
|
3909
|
-
storageScope:
|
|
3990
|
+
editable: z11.boolean(),
|
|
3991
|
+
listable: z11.boolean(),
|
|
3992
|
+
deletable: z11.boolean(),
|
|
3993
|
+
appendable: z11.boolean(),
|
|
3994
|
+
storageScope: z11.enum(["session", "family"])
|
|
3910
3995
|
});
|
|
3911
|
-
var ResolvedKayAgentEntityResolver =
|
|
3996
|
+
var ResolvedKayAgentEntityResolver = z11.strictObject({
|
|
3912
3997
|
localId: LocalContributionId,
|
|
3913
3998
|
globalId: GlobalContributionId,
|
|
3914
3999
|
displayName: NonEmptyString.optional(),
|
|
3915
4000
|
uriModule: GlobalContributionId,
|
|
3916
|
-
entityTypes:
|
|
4001
|
+
entityTypes: z11.array(NonEmptyString).min(1),
|
|
3917
4002
|
uriHint: NonEmptyString
|
|
3918
4003
|
});
|
|
3919
|
-
var ResolvedKayAgentGitHostClaim =
|
|
4004
|
+
var ResolvedKayAgentGitHostClaim = z11.strictObject({
|
|
3920
4005
|
host: GitHostName,
|
|
3921
4006
|
authServiceId: GlobalContributionId,
|
|
3922
4007
|
/** Manifest-declared order; the clone ladder tries them in sequence. */
|
|
3923
|
-
authSchemeIds:
|
|
4008
|
+
authSchemeIds: z11.array(GlobalContributionId).min(1),
|
|
3924
4009
|
/** Non-secret display copy for the claiming service, for clone failure text. */
|
|
3925
|
-
authServiceDisplayName:
|
|
4010
|
+
authServiceDisplayName: z11.string(),
|
|
3926
4011
|
basicAuthUser: GitBasicAuthUser
|
|
3927
4012
|
});
|
|
3928
|
-
var ResolvedKayAgentConverter =
|
|
4013
|
+
var ResolvedKayAgentConverter = z11.strictObject({
|
|
3929
4014
|
localId: LocalContributionId,
|
|
3930
4015
|
globalId: GlobalContributionId,
|
|
3931
|
-
mimeTypes:
|
|
3932
|
-
extensions:
|
|
4016
|
+
mimeTypes: z11.array(MimeTypeString).min(1),
|
|
4017
|
+
extensions: z11.array(FileExtensionToken).min(1).optional()
|
|
3933
4018
|
});
|
|
3934
|
-
var ResolvedReferencePresentation =
|
|
4019
|
+
var ResolvedReferencePresentation = z11.strictObject({
|
|
3935
4020
|
localId: LocalContributionId,
|
|
3936
4021
|
globalId: GlobalContributionId,
|
|
3937
4022
|
uriModule: GlobalContributionId,
|
|
@@ -3939,9 +4024,9 @@ var ResolvedReferencePresentation = z10.strictObject({
|
|
|
3939
4024
|
open: ReferenceOpenBehavior,
|
|
3940
4025
|
/** MIME-specific resource kinds; absent keys use the base presentation. */
|
|
3941
4026
|
variants: ReferencePresentationVariants.optional(),
|
|
3942
|
-
claims:
|
|
4027
|
+
claims: z11.array(ReferencePresentationUrlClaim).optional()
|
|
3943
4028
|
});
|
|
3944
|
-
var ResolvedPluginProvisioningRequirement =
|
|
4029
|
+
var ResolvedPluginProvisioningRequirement = z11.strictObject({
|
|
3945
4030
|
id: LocalContributionId,
|
|
3946
4031
|
displayName: NonEmptyString,
|
|
3947
4032
|
description: NonEmptyString,
|
|
@@ -3951,15 +4036,15 @@ var ResolvedPluginProvisioningRequirement = z10.strictObject({
|
|
|
3951
4036
|
* URL degrades to "Reconnect" in the UI instead of a broken link.
|
|
3952
4037
|
*/
|
|
3953
4038
|
remediationUrl: HttpsUrl.optional(),
|
|
3954
|
-
probe:
|
|
4039
|
+
probe: z11.strictObject({
|
|
3955
4040
|
url: HttpsUrl,
|
|
3956
|
-
method:
|
|
3957
|
-
verdictStatuses:
|
|
4041
|
+
method: z11.enum(["GET"]),
|
|
4042
|
+
verdictStatuses: z11.array(SignedInStatusCode).min(1),
|
|
3958
4043
|
nonEmptyArrayAt: NonEmptyString.optional()
|
|
3959
4044
|
})
|
|
3960
4045
|
});
|
|
3961
4046
|
var ResolvedProvisioningField = {
|
|
3962
|
-
provisioning:
|
|
4047
|
+
provisioning: z11.array(ResolvedPluginProvisioningRequirement).optional()
|
|
3963
4048
|
};
|
|
3964
4049
|
var ResolvedPluginAuthSchemeDescriptionFields = {
|
|
3965
4050
|
displayName: NonEmptyString.optional(),
|
|
@@ -3971,96 +4056,96 @@ var ResolvedPluginAuthSchemeOAuthBase = {
|
|
|
3971
4056
|
...ResolvedPluginAuthSchemeDescriptionFields,
|
|
3972
4057
|
localId: LocalContributionId,
|
|
3973
4058
|
globalId: GlobalContributionId,
|
|
3974
|
-
kind:
|
|
3975
|
-
scopes:
|
|
4059
|
+
kind: z11.literal("oauth2"),
|
|
4060
|
+
scopes: z11.array(z11.string()).optional()
|
|
3976
4061
|
};
|
|
3977
|
-
var ResolvedPluginAuthSchemeOAuthPkce =
|
|
4062
|
+
var ResolvedPluginAuthSchemeOAuthPkce = z11.strictObject({
|
|
3978
4063
|
...ResolvedPluginAuthSchemeOAuthBase,
|
|
3979
|
-
exchange:
|
|
3980
|
-
clientSuppliers:
|
|
4064
|
+
exchange: z11.literal("pkce"),
|
|
4065
|
+
clientSuppliers: z11.array(PluginOAuthClientSupplier).nonempty()
|
|
3981
4066
|
});
|
|
3982
|
-
var ResolvedPluginAuthSchemeOAuthConfidential =
|
|
4067
|
+
var ResolvedPluginAuthSchemeOAuthConfidential = z11.strictObject({
|
|
3983
4068
|
...ResolvedPluginAuthSchemeOAuthBase,
|
|
3984
|
-
exchange:
|
|
3985
|
-
clientSuppliers:
|
|
4069
|
+
exchange: z11.literal("confidential"),
|
|
4070
|
+
clientSuppliers: z11.tuple([z11.literal("kay")])
|
|
3986
4071
|
});
|
|
3987
|
-
var ResolvedPluginAuthSchemeOAuth2 =
|
|
4072
|
+
var ResolvedPluginAuthSchemeOAuth2 = z11.discriminatedUnion("exchange", [
|
|
3988
4073
|
ResolvedPluginAuthSchemeOAuthPkce,
|
|
3989
4074
|
ResolvedPluginAuthSchemeOAuthConfidential
|
|
3990
4075
|
]);
|
|
3991
|
-
var ResolvedPluginAuthSchemeApiKey =
|
|
4076
|
+
var ResolvedPluginAuthSchemeApiKey = z11.strictObject({
|
|
3992
4077
|
...ResolvedProvisioningField,
|
|
3993
4078
|
...ResolvedPluginAuthSchemeDescriptionFields,
|
|
3994
4079
|
localId: LocalContributionId,
|
|
3995
4080
|
globalId: GlobalContributionId,
|
|
3996
|
-
kind:
|
|
3997
|
-
scopes:
|
|
4081
|
+
kind: z11.literal("api-key"),
|
|
4082
|
+
scopes: z11.array(z11.string()).optional()
|
|
3998
4083
|
});
|
|
3999
|
-
var ResolvedPluginAuthSchemeDelegated =
|
|
4084
|
+
var ResolvedPluginAuthSchemeDelegated = z11.strictObject({
|
|
4000
4085
|
...ResolvedPluginAuthSchemeDescriptionFields,
|
|
4001
4086
|
localId: LocalContributionId,
|
|
4002
4087
|
globalId: GlobalContributionId,
|
|
4003
|
-
kind:
|
|
4004
|
-
scopes:
|
|
4088
|
+
kind: z11.literal("delegated"),
|
|
4089
|
+
scopes: z11.array(z11.string()).optional()
|
|
4005
4090
|
});
|
|
4006
|
-
var ResolvedPluginAuthSchemeExternalCli =
|
|
4091
|
+
var ResolvedPluginAuthSchemeExternalCli = z11.strictObject({
|
|
4007
4092
|
...ResolvedPluginAuthSchemeDescriptionFields,
|
|
4008
4093
|
localId: LocalContributionId,
|
|
4009
4094
|
globalId: GlobalContributionId,
|
|
4010
|
-
kind:
|
|
4011
|
-
scopes:
|
|
4095
|
+
kind: z11.literal("external-cli"),
|
|
4096
|
+
scopes: z11.array(z11.string()).optional()
|
|
4012
4097
|
});
|
|
4013
|
-
var ResolvedPluginAuthScheme =
|
|
4098
|
+
var ResolvedPluginAuthScheme = z11.discriminatedUnion("kind", [
|
|
4014
4099
|
ResolvedPluginAuthSchemeOAuth2,
|
|
4015
4100
|
ResolvedPluginAuthSchemeApiKey,
|
|
4016
4101
|
ResolvedPluginAuthSchemeDelegated,
|
|
4017
4102
|
ResolvedPluginAuthSchemeExternalCli
|
|
4018
4103
|
]);
|
|
4019
|
-
var ResolvedPluginWebSession =
|
|
4020
|
-
importance:
|
|
4104
|
+
var ResolvedPluginWebSession = z11.strictObject({
|
|
4105
|
+
importance: z11.enum(["required", "recommended"]),
|
|
4021
4106
|
loginUrl: HttpsUrl,
|
|
4022
|
-
cookieDomains:
|
|
4023
|
-
probe:
|
|
4107
|
+
cookieDomains: z11.array(RegistrableDomain).min(1),
|
|
4108
|
+
probe: z11.strictObject({
|
|
4024
4109
|
url: HttpsUrl,
|
|
4025
|
-
method:
|
|
4026
|
-
signedInStatuses:
|
|
4110
|
+
method: z11.enum(["GET", "POST"]),
|
|
4111
|
+
signedInStatuses: z11.array(SignedInStatusCode).min(1)
|
|
4027
4112
|
}),
|
|
4028
|
-
oauthVenue:
|
|
4113
|
+
oauthVenue: z11.enum(["embedded", "external"])
|
|
4029
4114
|
}).superRefine(refineWebSessionScopeConfined);
|
|
4030
|
-
var ResolvedPluginAuthService =
|
|
4115
|
+
var ResolvedPluginAuthService = z11.strictObject({
|
|
4031
4116
|
localId: LocalContributionId,
|
|
4032
4117
|
globalId: GlobalContributionId,
|
|
4033
|
-
displayName:
|
|
4034
|
-
schemes:
|
|
4035
|
-
purposes:
|
|
4118
|
+
displayName: z11.string(),
|
|
4119
|
+
schemes: z11.array(ResolvedPluginAuthScheme).min(1),
|
|
4120
|
+
purposes: z11.array(z11.string()).min(1),
|
|
4036
4121
|
/** The service's browser half, when the manifest declares one. */
|
|
4037
4122
|
webSession: ResolvedPluginWebSession.optional()
|
|
4038
4123
|
});
|
|
4039
|
-
var ResolvedKayUiAppEndpointCapability =
|
|
4124
|
+
var ResolvedKayUiAppEndpointCapability = z11.strictObject({
|
|
4040
4125
|
localId: LocalContributionId,
|
|
4041
4126
|
globalId: GlobalContributionId
|
|
4042
4127
|
});
|
|
4043
|
-
var ResolvedKayUiApp =
|
|
4128
|
+
var ResolvedKayUiApp = z11.strictObject({
|
|
4044
4129
|
localId: LocalContributionId,
|
|
4045
4130
|
globalId: GlobalContributionId,
|
|
4046
4131
|
displayName: NonEmptyString,
|
|
4047
4132
|
description: NonEmptyString.optional(),
|
|
4048
4133
|
icon: PackageAssetPath.optional(),
|
|
4049
|
-
runtime:
|
|
4050
|
-
sdk:
|
|
4134
|
+
runtime: z11.literal("kay.react-app.v1"),
|
|
4135
|
+
sdk: z11.strictObject({ range: NonEmptyString }),
|
|
4051
4136
|
entrypoint: TargetEntrypoint,
|
|
4052
|
-
styles:
|
|
4053
|
-
assets:
|
|
4054
|
-
capabilities:
|
|
4055
|
-
endpoints:
|
|
4056
|
-
host:
|
|
4137
|
+
styles: z11.array(PackageAssetPath).optional(),
|
|
4138
|
+
assets: z11.array(PackageAssetPath).optional(),
|
|
4139
|
+
capabilities: z11.strictObject({
|
|
4140
|
+
endpoints: z11.array(ResolvedKayUiAppEndpointCapability).optional(),
|
|
4141
|
+
host: z11.array(KayUiAppHostCapability).optional()
|
|
4057
4142
|
}).optional()
|
|
4058
4143
|
});
|
|
4059
|
-
var ResolvedPluginContractV1 =
|
|
4060
|
-
protocol:
|
|
4144
|
+
var ResolvedPluginContractV1 = z11.strictObject({
|
|
4145
|
+
protocol: z11.literal("kay.plugin.v1"),
|
|
4061
4146
|
pluginId: PluginId,
|
|
4062
4147
|
namespace: PluginNamespace,
|
|
4063
|
-
contributions:
|
|
4148
|
+
contributions: z11.array(ResolvedPluginContributionId),
|
|
4064
4149
|
// The deduplicated set of qualified (dotted) external auth-service ids this
|
|
4065
4150
|
// plugin references, from agent uriModule `authService` refs, cliBinding
|
|
4066
4151
|
// `authService` refs, and auth-grant `service` refs. Always present — a plugin
|
|
@@ -4068,30 +4153,30 @@ var ResolvedPluginContractV1 = z10.strictObject({
|
|
|
4068
4153
|
// is a recorded dependency, not a resolution: there is no runtime plugin
|
|
4069
4154
|
// loader in v1, so nothing here verifies the reference resolves within a
|
|
4070
4155
|
// composed roster (a composition-time concern owned elsewhere).
|
|
4071
|
-
consumesAuthServices:
|
|
4156
|
+
consumesAuthServices: z11.array(GlobalContributionId),
|
|
4072
4157
|
// The explicit plugin-level dependency ids declared in `dependencies.plugins` on the manifest,
|
|
4073
4158
|
// deduped and validated at parse time. Always present; a plugin with no explicit dependencies
|
|
4074
4159
|
// carries an empty array. Composition checks each id against the accepted roster and derives the
|
|
4075
4160
|
// full dependency graph together with auth-inferred edges from `consumesAuthServices`.
|
|
4076
|
-
explicitDependencies:
|
|
4161
|
+
explicitDependencies: z11.array(PluginId),
|
|
4077
4162
|
// The auth services this plugin OWNS, carrying the global ids its harness
|
|
4078
4163
|
// target must register and the credential authority keys on. Always present;
|
|
4079
4164
|
// a plugin that declares no `auth.services` carries an empty array. The dual
|
|
4080
4165
|
// of `consumesAuthServices` (services it merely references).
|
|
4081
|
-
authServices:
|
|
4166
|
+
authServices: z11.array(ResolvedPluginAuthService),
|
|
4082
4167
|
grants: ResolvedPluginGrants.optional(),
|
|
4083
|
-
kayAgentUriModules:
|
|
4084
|
-
kayAgentArtifactUriModules:
|
|
4085
|
-
kayAgentEntityResolvers:
|
|
4086
|
-
kayAgentGitHostClaims:
|
|
4087
|
-
kayAgentTools:
|
|
4088
|
-
kayAppTools:
|
|
4089
|
-
kayAppDataSources:
|
|
4090
|
-
kayAppWhiteboardTypes:
|
|
4091
|
-
kayAppMcpServers:
|
|
4092
|
-
kayAgentConverters:
|
|
4093
|
-
referencePresentations:
|
|
4094
|
-
kayUiApps:
|
|
4168
|
+
kayAgentUriModules: z11.array(ResolvedKayAgentUriModule).optional(),
|
|
4169
|
+
kayAgentArtifactUriModules: z11.array(ResolvedKayAgentArtifactUriModule).optional(),
|
|
4170
|
+
kayAgentEntityResolvers: z11.array(ResolvedKayAgentEntityResolver).optional(),
|
|
4171
|
+
kayAgentGitHostClaims: z11.array(ResolvedKayAgentGitHostClaim).optional(),
|
|
4172
|
+
kayAgentTools: z11.array(ResolvedKayAgentTool).optional(),
|
|
4173
|
+
kayAppTools: z11.array(ResolvedKayAppTool).optional(),
|
|
4174
|
+
kayAppDataSources: z11.array(ResolvedKayAppDataSource).optional(),
|
|
4175
|
+
kayAppWhiteboardTypes: z11.array(ResolvedKayAppWhiteboardType).optional(),
|
|
4176
|
+
kayAppMcpServers: z11.array(ResolvedKayAppMcpServer).optional(),
|
|
4177
|
+
kayAgentConverters: z11.array(ResolvedKayAgentConverter).optional(),
|
|
4178
|
+
referencePresentations: z11.array(ResolvedReferencePresentation).optional(),
|
|
4179
|
+
kayUiApps: z11.array(ResolvedKayUiApp).optional()
|
|
4095
4180
|
});
|
|
4096
4181
|
function narrowestAccountSelectors() {
|
|
4097
4182
|
return [{ kind: "active" }];
|
|
@@ -4518,10 +4603,12 @@ async function judgeKayPluginDirectory(input) {
|
|
|
4518
4603
|
const file = KAY_PLUGIN_MANIFEST_FILENAME;
|
|
4519
4604
|
const hostSdkVersion = host?.sdkVersion;
|
|
4520
4605
|
const warnings = [];
|
|
4606
|
+
let pluginId;
|
|
4521
4607
|
const refuse = (stage, code, message) => ({
|
|
4522
4608
|
outcome: "refused",
|
|
4523
4609
|
hostSdkVersion,
|
|
4524
4610
|
refusal: { stage, root, dir, code, message: boundPluginDiagnosticMessage(message) },
|
|
4611
|
+
...pluginId === void 0 ? {} : { pluginId },
|
|
4525
4612
|
warnings
|
|
4526
4613
|
});
|
|
4527
4614
|
let manifestEntry;
|
|
@@ -4555,6 +4642,8 @@ async function judgeKayPluginDirectory(input) {
|
|
|
4555
4642
|
return refuse("manifest-parse", "invalid-json", `${file} is not valid JSON: ${errorText(error)}`);
|
|
4556
4643
|
}
|
|
4557
4644
|
const head = ReadableManifestHead.safeParse(json);
|
|
4645
|
+
if (head.success)
|
|
4646
|
+
pluginId = head.data.id;
|
|
4558
4647
|
if (host !== void 0 && head.success && head.data.compatibility) {
|
|
4559
4648
|
const { refusal } = checkKayPluginHostCompatibility(head.data.compatibility, host);
|
|
4560
4649
|
if (refusal !== void 0) {
|
|
@@ -4597,6 +4686,16 @@ async function judgeKayPluginDirectory(input) {
|
|
|
4597
4686
|
if (!resolved.success) {
|
|
4598
4687
|
return refuse("contract-resolve", "contract-unresolvable", `contract could not be resolved: ${resolved.error.message}`);
|
|
4599
4688
|
}
|
|
4689
|
+
const { contract, misnamedTools } = keepNamespaceDerivedTools(resolved.data);
|
|
4690
|
+
for (const tool of misnamedTools) {
|
|
4691
|
+
warnings.push({
|
|
4692
|
+
stage: "contract-resolve",
|
|
4693
|
+
root,
|
|
4694
|
+
dir,
|
|
4695
|
+
code: "directory-tool-name-not-namespace-derived",
|
|
4696
|
+
message: boundPluginDiagnosticMessage(`plugin '${manifest.id}' tool '${tool.localId}' declares toolName '${tool.toolName}'; a directory plugin's tool must be named '${tool.expected}', so that tool is left out and the plugin otherwise loads`)
|
|
4697
|
+
});
|
|
4698
|
+
}
|
|
4600
4699
|
const realDirectory = await tree.realDirectory();
|
|
4601
4700
|
if (realDirectory === void 0) {
|
|
4602
4701
|
return refuse("source-scan", "unreadable-dir", "could not resolve the real path of the plugin directory");
|
|
@@ -4610,7 +4709,7 @@ async function judgeKayPluginDirectory(input) {
|
|
|
4610
4709
|
outcome: "loads",
|
|
4611
4710
|
hostSdkVersion,
|
|
4612
4711
|
manifest,
|
|
4613
|
-
contract
|
|
4712
|
+
contract,
|
|
4614
4713
|
warnings,
|
|
4615
4714
|
advisories: host === void 0 ? [] : kayPluginCompatibilityAdvisories({ manifest, host, root })
|
|
4616
4715
|
};
|
|
@@ -4628,16 +4727,49 @@ function kayPluginCompatibilityAdvisories(input) {
|
|
|
4628
4727
|
message: boundPluginDiagnosticMessage(`${manifest.displayName} (${manifest.id}) ${advisory.message}`)
|
|
4629
4728
|
}));
|
|
4630
4729
|
}
|
|
4631
|
-
var ReadableCompatibility =
|
|
4632
|
-
supportedProtocols:
|
|
4730
|
+
var ReadableCompatibility = z12.object({
|
|
4731
|
+
supportedProtocols: z12.array(z12.string()).optional().catch(void 0),
|
|
4633
4732
|
minKayVersion: NonEmptyString.optional().catch(void 0),
|
|
4634
4733
|
sdk: NonEmptyString.optional().catch(void 0)
|
|
4635
4734
|
});
|
|
4636
|
-
var ReadableManifestHead =
|
|
4637
|
-
id:
|
|
4638
|
-
displayName:
|
|
4735
|
+
var ReadableManifestHead = z12.object({
|
|
4736
|
+
id: z12.string().optional().catch(void 0),
|
|
4737
|
+
displayName: z12.string().optional().catch(void 0),
|
|
4639
4738
|
compatibility: ReadableCompatibility.optional().catch(void 0)
|
|
4640
4739
|
});
|
|
4740
|
+
function keepNamespaceDerivedTools(contract) {
|
|
4741
|
+
const misnamedTools = [];
|
|
4742
|
+
const droppedGlobalIds = /* @__PURE__ */ new Set();
|
|
4743
|
+
const keep = (tools) => {
|
|
4744
|
+
const kept = tools?.filter((tool) => {
|
|
4745
|
+
const expected = deriveDirectoryPluginToolName(contract.namespace, tool.localId);
|
|
4746
|
+
if (tool.toolName === expected)
|
|
4747
|
+
return true;
|
|
4748
|
+
misnamedTools.push({
|
|
4749
|
+
localId: tool.localId,
|
|
4750
|
+
toolName: tool.toolName,
|
|
4751
|
+
expected
|
|
4752
|
+
});
|
|
4753
|
+
droppedGlobalIds.add(tool.globalId);
|
|
4754
|
+
return false;
|
|
4755
|
+
});
|
|
4756
|
+
return kept === void 0 || kept.length === 0 ? void 0 : kept;
|
|
4757
|
+
};
|
|
4758
|
+
const kayAgentTools = keep(contract.kayAgentTools);
|
|
4759
|
+
const kayAppTools = keep(contract.kayAppTools);
|
|
4760
|
+
if (misnamedTools.length === 0)
|
|
4761
|
+
return { contract, misnamedTools };
|
|
4762
|
+
const { kayAgentTools: _agent, kayAppTools: _app, ...rest } = contract;
|
|
4763
|
+
return {
|
|
4764
|
+
contract: {
|
|
4765
|
+
...rest,
|
|
4766
|
+
contributions: contract.contributions.filter((contribution) => contribution.kind !== "tool" || !droppedGlobalIds.has(contribution.globalId)),
|
|
4767
|
+
...kayAgentTools === void 0 ? {} : { kayAgentTools },
|
|
4768
|
+
...kayAppTools === void 0 ? {} : { kayAppTools }
|
|
4769
|
+
},
|
|
4770
|
+
misnamedTools
|
|
4771
|
+
};
|
|
4772
|
+
}
|
|
4641
4773
|
function namedIn(head) {
|
|
4642
4774
|
if (head.id === void 0)
|
|
4643
4775
|
return KAY_PLUGIN_MANIFEST_FILENAME;
|
|
@@ -4698,28 +4830,28 @@ function errorText(error) {
|
|
|
4698
4830
|
}
|
|
4699
4831
|
|
|
4700
4832
|
// packages/plugin-protocol/dist/session-health.js
|
|
4701
|
-
import { z as
|
|
4833
|
+
import { z as z13 } from "zod";
|
|
4702
4834
|
var SESSION_HEALTH_EXTENSION_ID = "kay.session-health";
|
|
4703
4835
|
var SESSION_HEALTH_ENTRY_NAME = "session_health";
|
|
4704
4836
|
var SESSION_HEALTH_CUSTOM_TYPE = `ext:${SESSION_HEALTH_EXTENSION_ID}:${SESSION_HEALTH_ENTRY_NAME}`;
|
|
4705
4837
|
var SESSION_HEALTH_CLASSIFIER_IDS = ["jev"];
|
|
4706
|
-
var sessionHealthEntrySchema =
|
|
4707
|
-
v:
|
|
4708
|
-
verdict:
|
|
4838
|
+
var sessionHealthEntrySchema = z13.object({
|
|
4839
|
+
v: z13.literal(1),
|
|
4840
|
+
verdict: z13.enum(["well", "bad", "unknown"]),
|
|
4709
4841
|
/**
|
|
4710
4842
|
* The model's calibrated confidence in `well`, 0..1, or null when the
|
|
4711
4843
|
* classifier declined to produce one. Never exported raw: the telemetry
|
|
4712
4844
|
* event carries only the decile bucket.
|
|
4713
4845
|
*/
|
|
4714
|
-
p_well:
|
|
4715
|
-
classifier:
|
|
4716
|
-
classifier_version:
|
|
4717
|
-
judged_at:
|
|
4718
|
-
user_entry_id:
|
|
4719
|
-
through_entry_id:
|
|
4720
|
-
usage:
|
|
4721
|
-
input_tokens:
|
|
4722
|
-
output_tokens:
|
|
4846
|
+
p_well: z13.number().min(0).max(1).nullable(),
|
|
4847
|
+
classifier: z13.enum(SESSION_HEALTH_CLASSIFIER_IDS),
|
|
4848
|
+
classifier_version: z13.string().min(1).max(64),
|
|
4849
|
+
judged_at: z13.number().int().nonnegative(),
|
|
4850
|
+
user_entry_id: z13.string().min(1).max(256),
|
|
4851
|
+
through_entry_id: z13.string().min(1).max(256),
|
|
4852
|
+
usage: z13.strictObject({
|
|
4853
|
+
input_tokens: z13.number().int().nonnegative(),
|
|
4854
|
+
output_tokens: z13.number().int().nonnegative()
|
|
4723
4855
|
}).optional()
|
|
4724
4856
|
});
|
|
4725
4857
|
function sessionHealthPWellDecile(pWell) {
|
|
@@ -4729,36 +4861,36 @@ function sessionHealthPWellDecile(pWell) {
|
|
|
4729
4861
|
}
|
|
4730
4862
|
|
|
4731
4863
|
// packages/plugin-protocol/dist/resource-invocations.js
|
|
4732
|
-
import { z as
|
|
4733
|
-
var CorpusResourceKind =
|
|
4864
|
+
import { z as z14 } from "zod";
|
|
4865
|
+
var CorpusResourceKind = z14.enum([
|
|
4734
4866
|
"skill",
|
|
4735
4867
|
"context-file",
|
|
4736
4868
|
"prompt-command"
|
|
4737
4869
|
]);
|
|
4738
|
-
var CorpusResourceInvocationCursor =
|
|
4739
|
-
at:
|
|
4740
|
-
eventId:
|
|
4870
|
+
var CorpusResourceInvocationCursor = z14.strictObject({
|
|
4871
|
+
at: z14.iso.datetime({ offset: true }),
|
|
4872
|
+
eventId: z14.string().min(1)
|
|
4741
4873
|
});
|
|
4742
|
-
var CorpusResourceInvocationQuery =
|
|
4874
|
+
var CorpusResourceInvocationQuery = z14.strictObject({
|
|
4743
4875
|
kind: CorpusResourceKind,
|
|
4744
|
-
since:
|
|
4745
|
-
until:
|
|
4876
|
+
since: z14.iso.datetime({ offset: true }),
|
|
4877
|
+
until: z14.iso.datetime({ offset: true }),
|
|
4746
4878
|
after: CorpusResourceInvocationCursor.optional(),
|
|
4747
|
-
limit:
|
|
4748
|
-
rootCreatedByKind:
|
|
4879
|
+
limit: z14.number().int().min(1).max(1e3).optional(),
|
|
4880
|
+
rootCreatedByKind: z14.enum(AGENT_RUNTIME_SESSION_CREATOR_KINDS).optional()
|
|
4749
4881
|
}).refine((value) => Date.parse(value.since) < Date.parse(value.until), {
|
|
4750
4882
|
message: "since must precede until"
|
|
4751
4883
|
});
|
|
4752
4884
|
|
|
4753
4885
|
// packages/plugin-protocol/dist/ui-app-package.js
|
|
4754
|
-
import { z as
|
|
4886
|
+
import { z as z15 } from "zod";
|
|
4755
4887
|
var KAY_UI_APP_PACKAGE_PROTOCOL = "kay.ui.app-package.v1";
|
|
4756
4888
|
var KAY_UI_BUNDLE_INDEX_PROTOCOL = "kay.ui.bundle-index.v1";
|
|
4757
|
-
var KayUiBundleOutputPath =
|
|
4758
|
-
var KayUiBundleIndexV1 =
|
|
4759
|
-
protocol:
|
|
4889
|
+
var KayUiBundleOutputPath = z15.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" });
|
|
4890
|
+
var KayUiBundleIndexV1 = z15.strictObject({
|
|
4891
|
+
protocol: z15.literal(KAY_UI_BUNDLE_INDEX_PROTOCOL),
|
|
4760
4892
|
entryPath: KayUiBundleOutputPath,
|
|
4761
|
-
files:
|
|
4893
|
+
files: z15.array(z15.strictObject({
|
|
4762
4894
|
path: KayUiBundleOutputPath,
|
|
4763
4895
|
mediaType: NonEmptyString
|
|
4764
4896
|
})).min(1)
|
|
@@ -4785,19 +4917,19 @@ var KayUiBundleIndexV1 = z14.strictObject({
|
|
|
4785
4917
|
function parseKayUiBundleIndexV1(input) {
|
|
4786
4918
|
return KayUiBundleIndexV1.parse(input);
|
|
4787
4919
|
}
|
|
4788
|
-
var KayUiAppPackageFile =
|
|
4920
|
+
var KayUiAppPackageFile = z15.strictObject({
|
|
4789
4921
|
path: PackageAssetPath,
|
|
4790
4922
|
mediaType: NonEmptyString,
|
|
4791
|
-
bytes:
|
|
4923
|
+
bytes: z15.instanceof(Uint8Array).refine((bytes) => bytes.byteLength > 0, {
|
|
4792
4924
|
message: "app package file bytes must not be empty"
|
|
4793
4925
|
})
|
|
4794
4926
|
});
|
|
4795
|
-
var KayUiAppPackageV1 =
|
|
4796
|
-
protocol:
|
|
4927
|
+
var KayUiAppPackageV1 = z15.strictObject({
|
|
4928
|
+
protocol: z15.literal(KAY_UI_APP_PACKAGE_PROTOCOL),
|
|
4797
4929
|
appLocalId: LocalContributionId,
|
|
4798
4930
|
entry: KayUiAppPackageFile,
|
|
4799
|
-
styles:
|
|
4800
|
-
assets:
|
|
4931
|
+
styles: z15.array(KayUiAppPackageFile).optional(),
|
|
4932
|
+
assets: z15.array(KayUiAppPackageFile).optional()
|
|
4801
4933
|
}).superRefine((appPackage, ctx) => {
|
|
4802
4934
|
if (appPackage.entry.mediaType !== "application/javascript") {
|
|
4803
4935
|
ctx.addIssue({
|
|
@@ -4834,16 +4966,16 @@ function parseKayUiAppPackageV1(input) {
|
|
|
4834
4966
|
}
|
|
4835
4967
|
|
|
4836
4968
|
// packages/plugin-protocol/dist/whiteboard.js
|
|
4837
|
-
import { z as
|
|
4969
|
+
import { z as z16 } from "zod";
|
|
4838
4970
|
var WhiteboardValue = JsonValue;
|
|
4839
|
-
var WhiteboardEntryEnvelope =
|
|
4971
|
+
var WhiteboardEntryEnvelope = z16.strictObject({
|
|
4840
4972
|
id: NonEmptyString,
|
|
4841
4973
|
typeId: GlobalContributionId,
|
|
4842
|
-
schemaVersion:
|
|
4843
|
-
title:
|
|
4974
|
+
schemaVersion: z16.number().int().positive(),
|
|
4975
|
+
title: z16.string(),
|
|
4844
4976
|
authorSessionId: NonEmptyString.nullable()
|
|
4845
4977
|
});
|
|
4846
|
-
var WhiteboardEntrySummary =
|
|
4978
|
+
var WhiteboardEntrySummary = z16.strictObject({
|
|
4847
4979
|
name: NonEmptyString,
|
|
4848
4980
|
entry: WhiteboardEntryEnvelope,
|
|
4849
4981
|
revision: NonEmptyString
|
|
@@ -4851,31 +4983,31 @@ var WhiteboardEntrySummary = z15.strictObject({
|
|
|
4851
4983
|
var WhiteboardEntrySnapshot = WhiteboardEntrySummary.extend({
|
|
4852
4984
|
value: WhiteboardValue
|
|
4853
4985
|
});
|
|
4854
|
-
var WhiteboardDiagnostic =
|
|
4986
|
+
var WhiteboardDiagnostic = z16.strictObject({
|
|
4855
4987
|
ruleId: NonEmptyString,
|
|
4856
|
-
severity:
|
|
4988
|
+
severity: z16.enum(["error", "warning"]),
|
|
4857
4989
|
message: NonEmptyString
|
|
4858
4990
|
});
|
|
4859
|
-
var WhiteboardEntryInfo =
|
|
4991
|
+
var WhiteboardEntryInfo = z16.strictObject({
|
|
4860
4992
|
name: NonEmptyString,
|
|
4861
4993
|
revision: NonEmptyString,
|
|
4862
4994
|
entry: WhiteboardEntryEnvelope.optional(),
|
|
4863
|
-
state:
|
|
4864
|
-
mutable:
|
|
4865
|
-
diagnostics:
|
|
4995
|
+
state: z16.enum(["available", "unavailable", "unsupported-version", "invalid"]),
|
|
4996
|
+
mutable: z16.boolean(),
|
|
4997
|
+
diagnostics: z16.array(z16.string())
|
|
4866
4998
|
});
|
|
4867
4999
|
var WhiteboardEntryInspection = WhiteboardEntryInfo.extend({
|
|
4868
5000
|
value: WhiteboardValue.optional(),
|
|
4869
|
-
text:
|
|
4870
|
-
truncated:
|
|
5001
|
+
text: z16.string(),
|
|
5002
|
+
truncated: z16.boolean()
|
|
4871
5003
|
});
|
|
4872
|
-
var WhiteboardTypeInfo =
|
|
5004
|
+
var WhiteboardTypeInfo = z16.strictObject({
|
|
4873
5005
|
typeId: GlobalContributionId,
|
|
4874
5006
|
displayName: NonEmptyString,
|
|
4875
|
-
schemaVersion:
|
|
4876
|
-
available:
|
|
5007
|
+
schemaVersion: z16.number().int().positive(),
|
|
5008
|
+
available: z16.boolean(),
|
|
4877
5009
|
/** A plugin-owned readonly presentation; absent types use the host fallback. */
|
|
4878
|
-
presentation:
|
|
5010
|
+
presentation: z16.strictObject({
|
|
4879
5011
|
app: GlobalContributionId
|
|
4880
5012
|
}).optional()
|
|
4881
5013
|
});
|
|
@@ -4920,6 +5052,7 @@ export {
|
|
|
4920
5052
|
CorpusResourceInvocationCursor,
|
|
4921
5053
|
CorpusResourceInvocationQuery,
|
|
4922
5054
|
CorpusResourceKind,
|
|
5055
|
+
DeclaredSkillSourceEnvelope,
|
|
4923
5056
|
DeviceDelegationContribution,
|
|
4924
5057
|
EndpointContribution,
|
|
4925
5058
|
EndpointGrantRequest,
|
|
@@ -5101,10 +5234,12 @@ export {
|
|
|
5101
5234
|
compareSemver,
|
|
5102
5235
|
configSectionKeysForManifest,
|
|
5103
5236
|
dedupeClaims,
|
|
5237
|
+
deriveDirectoryPluginToolName,
|
|
5104
5238
|
finalizeArtifactProvenanceEnvelope,
|
|
5105
5239
|
hasClaim,
|
|
5106
5240
|
hostWithinDomain,
|
|
5107
5241
|
isCompatible,
|
|
5242
|
+
isKayPluginCompatibilityRefusal,
|
|
5108
5243
|
isQualifiedAuthSchemeRef,
|
|
5109
5244
|
isQualifiedAuthServiceRef,
|
|
5110
5245
|
isSupportedSemverRange,
|