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