@yaklabs-ai/plugin-protocol 0.52.1 → 0.54.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -266,8 +266,10 @@ var JsonSchema = z4.record(z4.string(), JsonValue);
266
266
  var KAY_PLUGIN_MANIFEST_SIZE_CAP_BYTES = 1024 * 1024;
267
267
  var KAY_PLUGIN_PROTOCOL_VERSION = "kay.plugin.v1";
268
268
  var KAY_PLUGIN_PROTOCOL_PACKAGE_NAME = "@bonsai/plugin-protocol";
269
- var KAY_PLUGIN_SDK_VERSION = "0.52.1";
269
+ var KAY_PLUGIN_SDK_VERSION = "0.54.0";
270
270
  var KAY_PLUGIN_COMPATIBLE_SDK_VERSIONS = [
271
+ "0.53.0",
272
+ "0.52.1",
271
273
  "0.52.0",
272
274
  "0.51.0",
273
275
  "0.50.0",
@@ -1806,6 +1808,9 @@ var PLUGIN_CAPABILITY_SLUGS = [
1806
1808
  "skills.write",
1807
1809
  "skills.share",
1808
1810
  "plugins.set-enabled",
1811
+ "sessions.assign-project",
1812
+ "artifacts.resolve-file",
1813
+ "process.run",
1809
1814
  "sessions.annotate",
1810
1815
  "sessions.compact",
1811
1816
  "soul.write",
@@ -1840,6 +1845,7 @@ var PLUGIN_CAPABILITY_SLUGS = [
1840
1845
  "mcp.host-server",
1841
1846
  "prompt.resident",
1842
1847
  "skills.declared-source",
1848
+ "family-folder.root",
1843
1849
  "whiteboard.discover",
1844
1850
  "whiteboard.read",
1845
1851
  "whiteboard.create",
@@ -1854,7 +1860,10 @@ var PRIVATE_PLUGIN_CAPABILITY_SLUGS = [
1854
1860
  "skills.share",
1855
1861
  "plugins.set-enabled",
1856
1862
  "system-prompt.register",
1857
- "workflows.signals"
1863
+ "workflows.signals",
1864
+ "sessions.assign-project",
1865
+ "artifacts.resolve-file",
1866
+ "process.run"
1858
1867
  ];
1859
1868
  function isPrivateCapabilityClaim(claim) {
1860
1869
  return PRIVATE_PLUGIN_CAPABILITY_SLUGS.includes(claim.slug);
@@ -2006,6 +2015,29 @@ function createAuthoritySchemas(canonical) {
2006
2015
  slug: z11.literal("plugins.set-enabled"),
2007
2016
  envelope: z11.strictObject({})
2008
2017
  }),
2018
+ z11.strictObject({
2019
+ // Set the project of sessions no current call or event is about (accepting a project
2020
+ // suggestion, undoing an automatic filing). Private (PRIVATE_PLUGIN_CAPABILITY_SLUGS): whether
2021
+ // a plugin may write to sessions other than the one it is answering is not decided.
2022
+ target: z11.literal("kay.app"),
2023
+ slug: z11.literal("sessions.assign-project"),
2024
+ envelope: z11.strictObject({})
2025
+ }),
2026
+ z11.strictObject({
2027
+ // Turn an address a session's agent can read into the absolute path of its file. Private
2028
+ // (PRIVATE_PLUGIN_CAPABILITY_SLUGS): a path names where a person's files live on disk.
2029
+ target: z11.literal("kay.app"),
2030
+ slug: z11.literal("artifacts.resolve-file"),
2031
+ envelope: z11.strictObject({})
2032
+ }),
2033
+ z11.strictObject({
2034
+ // Run a program the host bound for this plugin from its app code, each run still checked
2035
+ // against the exact `process.spawn` claim. Private (PRIVATE_PLUGIN_CAPABILITY_SLUGS): the
2036
+ // host binds programs only for plugins it ships.
2037
+ target: z11.literal("kay.app"),
2038
+ slug: z11.literal("process.run"),
2039
+ envelope: z11.strictObject({})
2040
+ }),
2009
2041
  z11.strictObject({
2010
2042
  // Write a steward entry (recap, next steps, title, work headlines) into the session whose
2011
2043
  // event the calling handler is answering. Bound to that session: a call for any other is
@@ -2238,6 +2270,11 @@ function createAuthoritySchemas(canonical) {
2238
2270
  slug: z11.literal("skills.declared-source"),
2239
2271
  envelope: DeclaredSkillSourceEnvelope2
2240
2272
  }),
2273
+ z11.strictObject({
2274
+ target: z11.literal("kay.agent"),
2275
+ slug: z11.literal("family-folder.root"),
2276
+ envelope: z11.strictObject({})
2277
+ }),
2241
2278
  WhiteboardCapabilityClaimV12
2242
2279
  ]);
2243
2280
  const PluginCapabilityRefusalLayer2 = z11.enum(["grant", "binding", "release"]);
@@ -2330,6 +2367,9 @@ function sameClaim(a, b) {
2330
2367
  case "skills.write":
2331
2368
  case "skills.share":
2332
2369
  case "plugins.set-enabled":
2370
+ case "sessions.assign-project":
2371
+ case "artifacts.resolve-file":
2372
+ case "process.run":
2333
2373
  case "sessions.annotate":
2334
2374
  case "sessions.compact":
2335
2375
  case "soul.write":
@@ -2349,6 +2389,7 @@ function sameClaim(a, b) {
2349
2389
  case "prompt.resident":
2350
2390
  case "model-selection.register":
2351
2391
  case "system-prompt.register":
2392
+ case "family-folder.root":
2352
2393
  return true;
2353
2394
  case "uri.call":
2354
2395
  return b.slug === "uri.call" && a.envelope.scheme === b.envelope.scheme && a.envelope.verb === b.envelope.verb;
@@ -2421,6 +2462,9 @@ function envelopePairs(a, b) {
2421
2462
  case "skills.write":
2422
2463
  case "skills.share":
2423
2464
  case "plugins.set-enabled":
2465
+ case "sessions.assign-project":
2466
+ case "artifacts.resolve-file":
2467
+ case "process.run":
2424
2468
  case "sessions.annotate":
2425
2469
  case "sessions.compact":
2426
2470
  case "soul.write":
@@ -2440,6 +2484,7 @@ function envelopePairs(a, b) {
2440
2484
  case "prompt.resident":
2441
2485
  case "model-selection.register":
2442
2486
  case "system-prompt.register":
2487
+ case "family-folder.root":
2443
2488
  return [];
2444
2489
  case "uri.call":
2445
2490
  return b.slug === "uri.call" ? [
@@ -2898,7 +2943,7 @@ __export(contributions_exports, {
2898
2943
  isUiAppSourceModule: () => isUiAppSourceModule,
2899
2944
  uiAppSourceStylePath: () => uiAppSourceStylePath
2900
2945
  });
2901
- import { z as z13 } from "zod";
2946
+ import { z as z14 } from "zod";
2902
2947
 
2903
2948
  // packages/plugin-protocol/dist/plugin-events.js
2904
2949
  var plugin_events_exports = {};
@@ -3052,6 +3097,53 @@ function pluginSignalPayloadJsonSchema() {
3052
3097
  });
3053
3098
  }
3054
3099
 
3100
+ // packages/plugin-protocol/dist/whiteboard.js
3101
+ import { z as z13 } from "zod";
3102
+ var WhiteboardEntryReference = z13.strictObject({
3103
+ uriTemplate: z13.string().regex(/^[a-z][a-z0-9+.-]*:\/\/[^\s?#{}]+\/\{name\}$/u)
3104
+ });
3105
+ var WhiteboardValue = JsonValue;
3106
+ var WhiteboardEntryEnvelope = z13.strictObject({
3107
+ id: NonEmptyString,
3108
+ typeId: GlobalContributionId,
3109
+ schemaVersion: z13.number().int().positive(),
3110
+ title: z13.string(),
3111
+ authorSessionId: NonEmptyString.nullable()
3112
+ });
3113
+ var WhiteboardEntrySummary = z13.strictObject({
3114
+ name: NonEmptyString,
3115
+ entry: WhiteboardEntryEnvelope,
3116
+ revision: NonEmptyString
3117
+ });
3118
+ var WhiteboardEntrySnapshot = WhiteboardEntrySummary.extend({
3119
+ value: WhiteboardValue
3120
+ });
3121
+ var WhiteboardDiagnostic = z13.strictObject({
3122
+ ruleId: NonEmptyString,
3123
+ severity: z13.enum(["error", "warning"]),
3124
+ message: NonEmptyString
3125
+ });
3126
+ var WhiteboardEntryInfo = z13.strictObject({
3127
+ name: NonEmptyString,
3128
+ revision: NonEmptyString,
3129
+ entry: WhiteboardEntryEnvelope.optional(),
3130
+ state: z13.enum(["available", "unavailable", "unsupported-version", "invalid"]),
3131
+ mutable: z13.boolean(),
3132
+ diagnostics: z13.array(z13.string())
3133
+ });
3134
+ var WhiteboardEntryInspection = WhiteboardEntryInfo.extend({
3135
+ value: WhiteboardValue.optional(),
3136
+ text: z13.string(),
3137
+ truncated: z13.boolean()
3138
+ });
3139
+ var WhiteboardTypeInfo = z13.strictObject({
3140
+ typeId: GlobalContributionId,
3141
+ displayName: NonEmptyString,
3142
+ schemaVersion: z13.number().int().positive(),
3143
+ available: z13.boolean(),
3144
+ reference: WhiteboardEntryReference.optional()
3145
+ });
3146
+
3055
3147
  // packages/plugin-protocol/dist/where-expression.js
3056
3148
  var NUMBER_SOURCE = String.raw`-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?`;
3057
3149
  var SEGMENT_SOURCE = "[A-Za-z0-9_][A-Za-z0-9_-]*";
@@ -3401,22 +3493,22 @@ function createContributionsSchemas(canonical) {
3401
3493
  const { AuthSchemeReference: AuthSchemeReference2, AuthServiceReference: AuthServiceReference2, CliAuthEnvVarName: CliAuthEnvVarName2, CliBinaryName: CliBinaryName2, FileExtensionToken: FileExtensionToken2, GitBasicAuthUser: GitBasicAuthUser2, GitHostName: GitHostName2, LocalContributionId: LocalContributionId2, MimeTypeString: MimeTypeString2, NonEmptyString: NonEmptyString3, PackageAssetPath: PackageAssetPath2, PluginId: PluginId2, PluginToolName: PluginToolName2, TargetEntrypoint: TargetEntrypoint2, UriScheme: UriScheme2 } = canonical ? canonicalCommonSchemas : common_exports;
3402
3494
  const { ScopeRequirement: ScopeRequirement2 } = canonical ? canonicalPermissionSchemas : permissions_exports;
3403
3495
  const OptionalDisplayName = NonEmptyString3.optional();
3404
- const ApprovalCardValueName = z13.string().regex(/^[A-Za-z][A-Za-z0-9_]{0,63}$/u, "must be a plain field name");
3405
- const ApprovalCardForm2 = z13.strictObject({
3496
+ const ApprovalCardValueName = z14.string().regex(/^[A-Za-z][A-Za-z0-9_]{0,63}$/u, "must be a plain field name");
3497
+ const ApprovalCardForm2 = z14.strictObject({
3406
3498
  /** Where the write goes: a fixed address, or the card value that names one. */
3407
- uri: z13.union([
3408
- z13.strictObject({ fixed: NonEmptyString3 }),
3409
- z13.strictObject({ value: ApprovalCardValueName })
3499
+ uri: z14.union([
3500
+ z14.strictObject({ fixed: NonEmptyString3 }),
3501
+ z14.strictObject({ value: ApprovalCardValueName })
3410
3502
  ]),
3411
3503
  /** The delivery request fields this kind of card accepts, beyond provider and account. */
3412
- requestFields: z13.array(ApprovalCardValueName).optional(),
3504
+ requestFields: z14.array(ApprovalCardValueName).optional(),
3413
3505
  /** Payload field to the card value it is filled from. An absent value or empty list is left out. */
3414
- payload: z13.record(ApprovalCardValueName, ApprovalCardValueName),
3506
+ payload: z14.record(ApprovalCardValueName, ApprovalCardValueName),
3415
3507
  /** Payload fields with a constant value. */
3416
- fixed: z13.record(ApprovalCardValueName, z13.union([z13.string(), z13.boolean()])).optional()
3508
+ fixed: z14.record(ApprovalCardValueName, z14.union([z14.string(), z14.boolean()])).optional()
3417
3509
  });
3418
3510
  const ApprovalCardStoredForm2 = ApprovalCardForm2.extend({
3419
- read: z13.strictObject({
3511
+ read: z14.strictObject({
3420
3512
  revision: ApprovalCardValueName,
3421
3513
  body: ApprovalCardValueName,
3422
3514
  subject: ApprovalCardValueName.optional(),
@@ -3427,13 +3519,13 @@ function createContributionsSchemas(canonical) {
3427
3519
  attachments: ApprovalCardValueName.optional()
3428
3520
  })
3429
3521
  });
3430
- const ApprovalCardField = z13.strictObject({
3522
+ const ApprovalCardField = z14.strictObject({
3431
3523
  key: ApprovalCardValueName,
3432
- max: z13.number().int().positive()
3524
+ max: z14.number().int().positive()
3433
3525
  });
3434
- const ApprovalTypeContribution2 = z13.strictObject({
3526
+ const ApprovalTypeContribution2 = z14.strictObject({
3435
3527
  localId: LocalContributionId2,
3436
- kind: z13.literal("message"),
3528
+ kind: z14.literal("message"),
3437
3529
  /** The URI scheme of `uriModule` that cards of this type write to. */
3438
3530
  provider: UriScheme2,
3439
3531
  /** The local id of this plugin's URI module that handles the write. */
@@ -3441,82 +3533,82 @@ function createContributionsSchemas(canonical) {
3441
3533
  /** Shown when a send's outcome cannot be confirmed: where the person checks. */
3442
3534
  unknownMessage: NonEmptyString3,
3443
3535
  /** The payload fields holding the text a person may edit. A `subject` makes this a mail type. */
3444
- fields: z13.strictObject({
3536
+ fields: z14.strictObject({
3445
3537
  body: ApprovalCardField,
3446
3538
  subject: ApprovalCardField.optional()
3447
3539
  }),
3448
- presentation: z13.strictObject({
3449
- showAccount: z13.boolean(),
3450
- recipient: z13.enum(["person", "target"])
3540
+ presentation: z14.strictObject({
3541
+ showAccount: z14.boolean(),
3542
+ recipient: z14.enum(["person", "target"])
3451
3543
  }),
3452
3544
  /** One form per kind of card this provider supports. A kind left out is never bound. */
3453
- forms: z13.strictObject({
3545
+ forms: z14.strictObject({
3454
3546
  inline: ApprovalCardForm2.optional(),
3455
3547
  saved: ApprovalCardForm2.optional(),
3456
3548
  stored: ApprovalCardStoredForm2.optional()
3457
3549
  }),
3458
3550
  /** What the card shows beyond its text, read from the delivery request. */
3459
- display: z13.strictObject({
3551
+ display: z14.strictObject({
3460
3552
  /** How the renderer reads the body. Absent is Markdown, or plain for a stored draft. */
3461
- bodyFormat: z13.literal("mrkdwn").optional(),
3553
+ bodyFormat: z14.literal("mrkdwn").optional(),
3462
3554
  /** The request field naming what this card replies to. */
3463
3555
  replyField: ApprovalCardValueName.optional(),
3464
3556
  /** Shown instead of the reply's id when that id means nothing to a person. */
3465
3557
  replyLabel: NonEmptyString3.optional(),
3466
3558
  /** Further request fields shown as labelled lines. */
3467
- facts: z13.array(z13.strictObject({
3559
+ facts: z14.array(z14.strictObject({
3468
3560
  label: NonEmptyString3,
3469
3561
  field: ApprovalCardValueName
3470
3562
  })).optional()
3471
3563
  }).optional()
3472
3564
  });
3473
- const ToolIdentity = z13.strictObject({
3565
+ const ToolIdentity = z14.strictObject({
3474
3566
  localId: LocalContributionId2,
3475
3567
  toolName: PluginToolName2,
3476
3568
  displayName: OptionalDisplayName,
3477
3569
  description: NonEmptyString3.optional()
3478
3570
  });
3479
- const ToolPermission2 = z13.strictObject({
3480
- kind: z13.enum(["read", "mutate", "destructive", "execute"]),
3571
+ const ToolPermission2 = z14.strictObject({
3572
+ kind: z14.enum(["read", "mutate", "destructive", "execute"]),
3481
3573
  ruleKey: NonEmptyString3.optional(),
3482
3574
  scheme: NonEmptyString3.optional(),
3483
- resourcePrefix: z13.string().max(256).optional(),
3575
+ resourcePrefix: z14.string().max(256).optional(),
3484
3576
  // Arguments whose string values name the resources a call touches.
3485
- resourceArgs: z13.array(NonEmptyString3).min(1).optional(),
3486
- resourceTrim: z13.literal(true).optional(),
3487
- defaultPermission: z13.enum(["allow", "ask", "never"]).optional(),
3577
+ resourceArgs: z14.array(NonEmptyString3).min(1).optional(),
3578
+ resourceTrim: z14.literal(true).optional(),
3579
+ defaultPermission: z14.enum(["allow", "ask", "never"]).optional(),
3488
3580
  /** First matching rule wins; every condition in its when list must hold. */
3489
- classificationRules: z13.array(z13.strictObject({
3490
- when: z13.array(z13.union([
3491
- z13.strictObject({
3581
+ classificationRules: z14.array(z14.strictObject({
3582
+ when: z14.array(z14.union([
3583
+ z14.strictObject({
3492
3584
  arg: NonEmptyString3,
3493
- equals: z13.union([
3494
- z13.string(),
3495
- z13.number(),
3496
- z13.boolean(),
3497
- z13.null()
3585
+ equals: z14.union([
3586
+ z14.string(),
3587
+ z14.number(),
3588
+ z14.boolean(),
3589
+ z14.null()
3498
3590
  ])
3499
3591
  }),
3500
- z13.strictObject({ arg: NonEmptyString3, present: z13.boolean() })
3592
+ z14.strictObject({ arg: NonEmptyString3, present: z14.boolean() })
3501
3593
  ])).min(1).max(32),
3502
- kind: z13.enum(["read", "mutate", "destructive", "execute"]),
3594
+ kind: z14.enum(["read", "mutate", "destructive", "execute"]),
3503
3595
  ruleKey: NonEmptyString3.optional()
3504
3596
  })).min(1).max(64).optional()
3505
3597
  });
3506
- const ToolContribution2 = z13.strictObject({
3598
+ const ToolContribution2 = z14.strictObject({
3507
3599
  ...ToolIdentity.shape,
3508
3600
  parameters: JsonSchema.optional(),
3509
- executionMode: z13.enum(["sequential", "parallel"]).optional(),
3601
+ executionMode: z14.enum(["sequential", "parallel"]).optional(),
3510
3602
  promptSnippet: NonEmptyString3.optional(),
3511
- promptGuidelines: z13.array(NonEmptyString3).optional(),
3603
+ promptGuidelines: z14.array(NonEmptyString3).optional(),
3512
3604
  permission: ToolPermission2.optional()
3513
3605
  });
3514
- const AgentToolContribution2 = z13.strictObject({
3606
+ const AgentToolContribution2 = z14.strictObject({
3515
3607
  ...ToolContribution2.shape,
3516
3608
  parameters: JsonSchema.optional(),
3517
- executionMode: z13.enum(["sequential", "parallel"]).optional(),
3609
+ executionMode: z14.enum(["sequential", "parallel"]).optional(),
3518
3610
  promptSnippet: NonEmptyString3.optional(),
3519
- promptGuidelines: z13.array(NonEmptyString3).optional(),
3611
+ promptGuidelines: z14.array(NonEmptyString3).optional(),
3520
3612
  // A local ref names an auth service declared in this manifest; a dotted ref names another
3521
3613
  // plugin's service, as `UriModuleContribution.authService` does.
3522
3614
  authService: AuthServiceReference2.optional(),
@@ -3524,17 +3616,17 @@ function createContributionsSchemas(canonical) {
3524
3616
  authScheme: LocalContributionId2.optional(),
3525
3617
  permission: ToolPermission2.optional()
3526
3618
  });
3527
- const ConverterContribution2 = z13.strictObject({
3619
+ const ConverterContribution2 = z14.strictObject({
3528
3620
  localId: LocalContributionId2,
3529
3621
  displayName: OptionalDisplayName,
3530
3622
  description: NonEmptyString3.optional(),
3531
3623
  /** MIME types this converter claims - contract data for introspection and
3532
3624
  * collision checks; runtime match behavior stays the converter's `matches()`. */
3533
- mimeTypes: z13.array(MimeTypeString2).min(1),
3625
+ mimeTypes: z14.array(MimeTypeString2).min(1),
3534
3626
  /** Extension fallbacks (no dot) used when a probe has no usable MIME type. */
3535
- extensions: z13.array(FileExtensionToken2).min(1).optional()
3627
+ extensions: z14.array(FileExtensionToken2).min(1).optional()
3536
3628
  });
3537
- const UriOperationName = z13.enum([
3629
+ const UriOperationName = z14.enum([
3538
3630
  "help",
3539
3631
  "read",
3540
3632
  "write",
@@ -3543,8 +3635,8 @@ function createContributionsSchemas(canonical) {
3543
3635
  "search",
3544
3636
  "delete"
3545
3637
  ]);
3546
- const UriPermissionDefault = z13.enum(["allow", "ask", "never"]);
3547
- const UriVerbSentences = z13.strictObject({
3638
+ const UriPermissionDefault = z14.enum(["allow", "ask", "never"]);
3639
+ const UriVerbSentences = z14.strictObject({
3548
3640
  read: NonEmptyString3.exactOptional(),
3549
3641
  list: NonEmptyString3.exactOptional(),
3550
3642
  search: NonEmptyString3.exactOptional(),
@@ -3552,83 +3644,83 @@ function createContributionsSchemas(canonical) {
3552
3644
  edit: NonEmptyString3.exactOptional(),
3553
3645
  delete: NonEmptyString3.exactOptional()
3554
3646
  });
3555
- const UriPatternInit = z13.strictObject({
3647
+ const UriPatternInit = z14.strictObject({
3556
3648
  protocol: NonEmptyString3.exactOptional(),
3557
3649
  hostname: NonEmptyString3.exactOptional(),
3558
3650
  pathname: NonEmptyString3.exactOptional(),
3559
- search: z13.string().exactOptional()
3651
+ search: z14.string().exactOptional()
3560
3652
  });
3561
- const UriClaimContribution = z13.discriminatedUnion("kind", [
3562
- z13.strictObject({ kind: z13.literal("scheme"), scheme: UriScheme2 }),
3563
- z13.strictObject({
3564
- kind: z13.literal("uriPattern"),
3653
+ const UriClaimContribution = z14.discriminatedUnion("kind", [
3654
+ z14.strictObject({ kind: z14.literal("scheme"), scheme: UriScheme2 }),
3655
+ z14.strictObject({
3656
+ kind: z14.literal("uriPattern"),
3565
3657
  pattern: UriPatternInit,
3566
3658
  normalizeTo: NonEmptyString3.exactOptional(),
3567
3659
  route: LocalContributionId2.exactOptional(),
3568
3660
  sourceUrl: NonEmptyString3.exactOptional(),
3569
3661
  title: NonEmptyString3.exactOptional(),
3570
- examples: z13.array(NonEmptyString3).exactOptional()
3662
+ examples: z14.array(NonEmptyString3).exactOptional()
3571
3663
  }),
3572
- z13.strictObject({
3573
- kind: z13.literal("urlPattern"),
3664
+ z14.strictObject({
3665
+ kind: z14.literal("urlPattern"),
3574
3666
  pattern: UriPatternInit,
3575
3667
  normalizeTo: NonEmptyString3.exactOptional(),
3576
3668
  route: LocalContributionId2.exactOptional(),
3577
- examples: z13.array(NonEmptyString3).exactOptional()
3669
+ examples: z14.array(NonEmptyString3).exactOptional()
3578
3670
  })
3579
3671
  ]);
3580
- const UriTemplateContribution = z13.strictObject({
3672
+ const UriTemplateContribution = z14.strictObject({
3581
3673
  uri: NonEmptyString3,
3582
3674
  description: NonEmptyString3,
3583
- operations: z13.array(UriOperationName).exactOptional(),
3584
- operationDocs: z13.partialRecord(UriOperationName, NonEmptyString3).exactOptional(),
3585
- operationDefaults: z13.partialRecord(UriOperationName, UriPermissionDefault).exactOptional()
3675
+ operations: z14.array(UriOperationName).exactOptional(),
3676
+ operationDocs: z14.partialRecord(UriOperationName, NonEmptyString3).exactOptional(),
3677
+ operationDefaults: z14.partialRecord(UriOperationName, UriPermissionDefault).exactOptional()
3586
3678
  });
3587
3679
  const UriAuthActionRuleConditions = {
3588
- operations: z13.array(UriOperationName).min(1).exactOptional(),
3589
- routes: z13.array(LocalContributionId2).min(1).exactOptional(),
3590
- query: z13.record(NonEmptyString3, z13.string()).exactOptional()
3680
+ operations: z14.array(UriOperationName).min(1).exactOptional(),
3681
+ routes: z14.array(LocalContributionId2).min(1).exactOptional(),
3682
+ query: z14.record(NonEmptyString3, z14.string()).exactOptional()
3591
3683
  };
3592
- const UriAuthActionRule = z13.union([
3593
- z13.strictObject({ ...UriAuthActionRuleConditions, action: NonEmptyString3 }),
3594
- z13.strictObject({ ...UriAuthActionRuleConditions, public: z13.literal(true) })
3684
+ const UriAuthActionRule = z14.union([
3685
+ z14.strictObject({ ...UriAuthActionRuleConditions, action: NonEmptyString3 }),
3686
+ z14.strictObject({ ...UriAuthActionRuleConditions, public: z14.literal(true) })
3595
3687
  ]);
3596
- const UriAgentHintContribution = z13.strictObject({
3688
+ const UriAgentHintContribution = z14.strictObject({
3597
3689
  summary: NonEmptyString3,
3598
- commonFlows: z13.array(z13.strictObject({
3690
+ commonFlows: z14.array(z14.strictObject({
3599
3691
  label: NonEmptyString3,
3600
3692
  when: NonEmptyString3.exactOptional(),
3601
3693
  example: NonEmptyString3
3602
3694
  })).exactOptional(),
3603
3695
  helpUri: NonEmptyString3.exactOptional(),
3604
- triggers: z13.strictObject({
3605
- keywords: z13.array(NonEmptyString3).exactOptional(),
3606
- patterns: z13.array(NonEmptyString3).exactOptional()
3696
+ triggers: z14.strictObject({
3697
+ keywords: z14.array(NonEmptyString3).exactOptional(),
3698
+ patterns: z14.array(NonEmptyString3).exactOptional()
3607
3699
  }).exactOptional(),
3608
- skills: z13.array(NonEmptyString3).exactOptional()
3700
+ skills: z14.array(NonEmptyString3).exactOptional()
3609
3701
  });
3610
- const ScreenActionOption = z13.discriminatedUnion("kind", [
3611
- z13.strictObject({
3612
- kind: z13.literal("exact"),
3702
+ const ScreenActionOption = z14.discriminatedUnion("kind", [
3703
+ z14.strictObject({
3704
+ kind: z14.literal("exact"),
3613
3705
  description: NonEmptyString3,
3614
- verb: z13.enum(["read", "write", "edit", "delete"]),
3706
+ verb: z14.enum(["read", "write", "edit", "delete"]),
3615
3707
  uri: NonEmptyString3
3616
3708
  }),
3617
- z13.strictObject({
3618
- kind: z13.literal("catch-all"),
3709
+ z14.strictObject({
3710
+ kind: z14.literal("catch-all"),
3619
3711
  description: NonEmptyString3,
3620
- verb: z13.enum(["read", "write", "edit", "delete"])
3712
+ verb: z14.enum(["read", "write", "edit", "delete"])
3621
3713
  })
3622
3714
  ]);
3623
3715
  const UriModuleFactsShape = {
3624
- revisionBacked: z13.literal(true).optional(),
3625
- mailCalibrationSource: z13.literal(true).optional(),
3626
- screenActions: z13.strictObject({
3716
+ revisionBacked: z14.literal(true).optional(),
3717
+ mailCalibrationSource: z14.literal(true).optional(),
3718
+ screenActions: z14.strictObject({
3627
3719
  scheme: UriScheme2,
3628
- hosts: z13.array(NonEmptyString3),
3629
- paths: z13.array(NonEmptyString3).min(1).optional(),
3630
- apps: z13.array(NonEmptyString3),
3631
- options: z13.record(NonEmptyString3, ScreenActionOption)
3720
+ hosts: z14.array(NonEmptyString3),
3721
+ paths: z14.array(NonEmptyString3).min(1).optional(),
3722
+ apps: z14.array(NonEmptyString3),
3723
+ options: z14.record(NonEmptyString3, ScreenActionOption)
3632
3724
  }).superRefine((catalog, ctx) => {
3633
3725
  if (catalog.hosts.length === 0 && catalog.apps.length === 0) {
3634
3726
  ctx.addIssue({
@@ -3653,29 +3745,29 @@ function createContributionsSchemas(canonical) {
3653
3745
  }
3654
3746
  }).exactOptional(),
3655
3747
  /** Addresses the module answers, in match order; see `@herd/uri`'s `UriClaim`. */
3656
- claims: z13.array(UriClaimContribution).min(1).exactOptional(),
3748
+ claims: z14.array(UriClaimContribution).min(1).exactOptional(),
3657
3749
  /** The module's routes, as its scheme-root `help` lists them. */
3658
- templates: z13.array(UriTemplateContribution).exactOptional(),
3659
- verbs: z13.strictObject({
3660
- readable: z13.boolean(),
3661
- writable: z13.boolean(),
3662
- editable: z13.boolean(),
3663
- deletable: z13.boolean().exactOptional(),
3664
- listable: z13.boolean(),
3750
+ templates: z14.array(UriTemplateContribution).exactOptional(),
3751
+ verbs: z14.strictObject({
3752
+ readable: z14.boolean(),
3753
+ writable: z14.boolean(),
3754
+ editable: z14.boolean(),
3755
+ deletable: z14.boolean().exactOptional(),
3756
+ listable: z14.boolean(),
3665
3757
  /** The module answers `search`. */
3666
- searchable: z13.boolean().exactOptional()
3758
+ searchable: z14.boolean().exactOptional()
3667
3759
  }).exactOptional(),
3668
3760
  verbDocs: UriVerbSentences.exactOptional(),
3669
- permissionDefaults: z13.strictObject({
3761
+ permissionDefaults: z14.strictObject({
3670
3762
  read: UriPermissionDefault.exactOptional(),
3671
3763
  write: UriPermissionDefault.exactOptional(),
3672
3764
  edit: UriPermissionDefault.exactOptional(),
3673
3765
  delete: UriPermissionDefault.exactOptional()
3674
3766
  }).exactOptional(),
3675
3767
  /** Which sign-in action each call needs: the action table and the rules that pick one. */
3676
- authActions: z13.strictObject({
3677
- actions: z13.record(NonEmptyString3, ScopeRequirement2),
3678
- rules: z13.array(UriAuthActionRule).min(1)
3768
+ authActions: z14.strictObject({
3769
+ actions: z14.record(NonEmptyString3, ScopeRequirement2),
3770
+ rules: z14.array(UriAuthActionRule).min(1)
3679
3771
  }).superRefine((policy, ctx) => {
3680
3772
  policy.rules.forEach((rule, index) => {
3681
3773
  if ("action" in rule && !(rule.action in policy.actions)) {
@@ -3687,18 +3779,20 @@ function createContributionsSchemas(canonical) {
3687
3779
  }
3688
3780
  });
3689
3781
  }).exactOptional(),
3690
- requiresConnection: z13.literal(true).exactOptional(),
3691
- acceptsSourceCopy: z13.literal(false).exactOptional(),
3692
- acceptsWriteSources: z13.literal(true).exactOptional(),
3693
- acceptsBytes: z13.literal(true).exactOptional(),
3694
- ownsLineSelectors: z13.literal(true).exactOptional(),
3782
+ requiresConnection: z14.literal(true).exactOptional(),
3783
+ acceptsSourceCopy: z14.literal(false).exactOptional(),
3784
+ acceptsWriteSources: z14.literal(true).exactOptional(),
3785
+ acceptsBytes: z14.literal(true).exactOptional(),
3786
+ ownsLineSelectors: z14.literal(true).exactOptional(),
3695
3787
  description: NonEmptyString3.exactOptional(),
3696
3788
  agentHint: UriAgentHintContribution.exactOptional()
3697
3789
  };
3698
- const UriModuleFacts2 = z13.strictObject(UriModuleFactsShape);
3699
- const UriModuleContribution2 = z13.strictObject({
3790
+ const UriModuleFacts2 = z14.strictObject(UriModuleFactsShape);
3791
+ const UriModuleContribution2 = z14.strictObject({
3700
3792
  localId: LocalContributionId2,
3701
- schemes: z13.array(UriScheme2).min(1),
3793
+ /** Opaque adapter id for account-bound connections; never namespaced. */
3794
+ adapterId: z14.string().min(1).optional(),
3795
+ schemes: z14.array(UriScheme2).min(1),
3702
3796
  displayName: OptionalDisplayName,
3703
3797
  ...UriModuleFactsShape,
3704
3798
  // A local ref (no dot) must name an auth service declared in this same
@@ -3721,17 +3815,18 @@ function createContributionsSchemas(canonical) {
3721
3815
  // `knownResources` permission grant (`api.knownResources`). Present-means-on
3722
3816
  // (`true` or absent; `false` is not a state). Decision record:
3723
3817
  // `lab/user-plugins/decisions/014-known-resources-ledger.md`.
3724
- knownResources: z13.literal(true).optional(),
3818
+ knownResources: z14.literal(true).optional(),
3725
3819
  // The module's code defines `describeOperation`, the approval card's facts for a call. The
3726
3820
  // daemon reads it here because it may hold only the manifest (a plugin that runs in the
3727
3821
  // plugin host), and the host refuses a module whose code disagrees.
3728
- describesOperations: z13.literal(true).optional(),
3822
+ describesOperations: z14.literal(true).optional(),
3729
3823
  // The module's code defines `lookupWebLink`, which finds a resource's page when someone opens
3730
3824
  // it. The daemon reads it here for the same reason, and the host refuses a module whose code
3731
3825
  // disagrees.
3732
- looksUpWebLinks: z13.literal(true).optional()
3826
+ looksUpWebLinks: z14.literal(true).optional()
3733
3827
  });
3734
3828
  const AppUriModuleContribution2 = UriModuleContribution2.omit({
3829
+ adapterId: true,
3735
3830
  authActions: true,
3736
3831
  authService: true,
3737
3832
  authScheme: true,
@@ -3739,35 +3834,36 @@ function createContributionsSchemas(canonical) {
3739
3834
  describesOperations: true,
3740
3835
  looksUpWebLinks: true
3741
3836
  });
3742
- const AppDataSourceStore = z13.discriminatedUnion("shape", [
3743
- z13.strictObject({
3744
- shape: z13.literal("rows"),
3837
+ const AppDataSourceStore = z14.discriminatedUnion("shape", [
3838
+ z14.strictObject({
3839
+ shape: z14.literal("rows"),
3745
3840
  rowsField: NonEmptyString3,
3746
- key: z13.array(NonEmptyString3).min(1)
3841
+ key: z14.array(NonEmptyString3).min(1)
3747
3842
  }),
3748
- z13.strictObject({ shape: z13.literal("value") })
3843
+ z14.strictObject({ shape: z14.literal("value") })
3749
3844
  ]);
3750
- const AppDataSourceContribution2 = z13.strictObject({
3845
+ const AppDataSourceContribution2 = z14.strictObject({
3751
3846
  localId: LocalContributionId2,
3752
- scope: z13.enum(["runtime", "account", "session"]),
3753
- snapshot: z13.strictObject({
3754
- version: z13.number().int().positive(),
3847
+ scope: z14.enum(["runtime", "account", "session"]),
3848
+ snapshot: z14.strictObject({
3849
+ version: z14.number().int().positive(),
3755
3850
  schema: JsonSchema
3756
3851
  }),
3757
- change: z13.strictObject({
3758
- version: z13.number().int().positive(),
3852
+ change: z14.strictObject({
3853
+ version: z14.number().int().positive(),
3759
3854
  schema: JsonSchema,
3760
3855
  /** Review-only claim; source schemas and behavioral tests enforce it because the daemon treats changes as opaque. */
3761
- semantics: z13.discriminatedUnion("kind", [
3762
- z13.strictObject({ kind: z13.literal("incremental") }),
3763
- z13.strictObject({
3764
- kind: z13.literal("snapshot-replacement"),
3765
- maxEncodedBytes: z13.number().int().positive(),
3856
+ semantics: z14.discriminatedUnion("kind", [
3857
+ z14.strictObject({ kind: z14.literal("incremental") }),
3858
+ z14.strictObject({
3859
+ kind: z14.literal("snapshot-replacement"),
3860
+ maxEncodedBytes: z14.number().int().positive(),
3766
3861
  rationale: pluginString(canonical).min(1).max(1024)
3767
3862
  })
3768
3863
  ]).optional()
3769
3864
  }),
3770
3865
  read: AppDataSourceRead.optional(),
3866
+ messageDraft: z14.strictObject({ schemes: z14.array(UriScheme2).min(1) }).optional(),
3771
3867
  store: AppDataSourceStore.optional()
3772
3868
  }).superRefine((source, ctx) => {
3773
3869
  if (source.read !== void 0 && source.scope !== "session") {
@@ -3777,6 +3873,13 @@ function createContributionsSchemas(canonical) {
3777
3873
  message: "App-data read operations require session scope."
3778
3874
  });
3779
3875
  }
3876
+ if (source.messageDraft !== void 0 && source.read === void 0) {
3877
+ ctx.addIssue({
3878
+ code: "custom",
3879
+ path: ["messageDraft"],
3880
+ message: "Message draft projections require a session read operation."
3881
+ });
3882
+ }
3780
3883
  if (source.store === void 0)
3781
3884
  return;
3782
3885
  const replaces = source.change.semantics?.kind === "snapshot-replacement";
@@ -3788,25 +3891,36 @@ function createContributionsSchemas(canonical) {
3788
3891
  });
3789
3892
  }
3790
3893
  });
3791
- const WhiteboardTypeStorage2 = z13.discriminatedUnion("kind", [
3792
- z13.strictObject({ kind: z13.literal("json") }),
3793
- z13.strictObject({ kind: z13.literal("payload") }),
3794
- z13.strictObject({
3795
- kind: z13.literal("markdown"),
3894
+ const WhiteboardTypeStorage2 = z14.discriminatedUnion("kind", [
3895
+ z14.strictObject({ kind: z14.literal("json") }),
3896
+ z14.strictObject({ kind: z14.literal("payload") }),
3897
+ z14.strictObject({
3898
+ kind: z14.literal("markdown"),
3796
3899
  bodyField: NonEmptyString3
3797
3900
  })
3798
3901
  ]);
3799
- const WhiteboardTypeContribution2 = z13.strictObject({
3902
+ const WhiteboardTypeContribution2 = z14.strictObject({
3800
3903
  localId: LocalContributionId2,
3801
3904
  displayName: NonEmptyString3,
3802
- schemaVersion: z13.number().int().positive(),
3905
+ schemaVersion: z14.number().int().positive(),
3803
3906
  storage: WhiteboardTypeStorage2,
3804
- valueSchema: JsonSchema
3907
+ valueSchema: JsonSchema,
3908
+ directory: z14.array(z14.string().regex(/^[A-Za-z0-9][A-Za-z0-9_-]*$/u)).min(1).optional(),
3909
+ reference: WhiteboardEntryReference.optional(),
3910
+ handover: z14.literal(true).optional()
3911
+ }).superRefine((type, ctx) => {
3912
+ if (type.handover === true && type.storage.kind !== "markdown") {
3913
+ ctx.addIssue({
3914
+ code: "custom",
3915
+ path: ["handover"],
3916
+ message: "Handover content requires Markdown storage."
3917
+ });
3918
+ }
3805
3919
  });
3806
- const AppDataMaterializerContribution2 = z13.strictObject({
3920
+ const AppDataMaterializerContribution2 = z14.strictObject({
3807
3921
  source: LocalContributionId2
3808
3922
  });
3809
- const ArtifactUriModuleContribution2 = z13.strictObject({
3923
+ const ArtifactUriModuleContribution2 = z14.strictObject({
3810
3924
  localId: LocalContributionId2,
3811
3925
  /** The single `scheme://` this module owns; also the on-disk artifact kind. */
3812
3926
  scheme: UriScheme2,
@@ -3820,17 +3934,17 @@ function createContributionsSchemas(canonical) {
3820
3934
  * composes its description from the plugin's own display name + scheme - a per-scheme label
3821
3935
  * would have no path to matter, so it is intentionally omitted rather than accepted-and-ignored.
3822
3936
  */
3823
- editable: z13.boolean().optional(),
3937
+ editable: z14.boolean().optional(),
3824
3938
  /** Opt in to `list` over the kind's stored names. Default false. Mirrors
3825
3939
  * `CreateArtifactUriModuleOptions.listable`. */
3826
- listable: z13.boolean().optional(),
3940
+ listable: z14.boolean().optional(),
3827
3941
  /**
3828
3942
  * Opt in to `delete` for same-session entries. Default false. Deletion
3829
3943
  * unlinks the stored file - no trash tier; a kind that wants recoverable
3830
3944
  * deletion is not artifact-backed. Mirrors
3831
3945
  * `CreateArtifactUriModuleOptions.deletable`.
3832
3946
  */
3833
- deletable: z13.boolean().optional(),
3947
+ deletable: z14.boolean().optional(),
3834
3948
  /**
3835
3949
  * Opt in to the `{ content, mode: "append" }` write envelope, which extends
3836
3950
  * stored text instead of replacing it (concurrent-appender-safe: the host
@@ -3838,7 +3952,7 @@ function createContributionsSchemas(canonical) {
3838
3952
  * keep their verbatim round-trip. Mirrors
3839
3953
  * `CreateArtifactUriModuleOptions.appendable`.
3840
3954
  */
3841
- appendable: z13.boolean().optional(),
3955
+ appendable: z14.boolean().optional(),
3842
3956
  /**
3843
3957
  * Which sessions share one storage namespace. Default `"session"` - the existing
3844
3958
  * per-session behavior (each session gets its own kind directory; other sessions'
@@ -3849,14 +3963,14 @@ function createContributionsSchemas(canonical) {
3849
3963
  * the scope; the host derives the family root from provenance it already holds, so
3850
3964
  * family identity never crosses the SDK boundary.
3851
3965
  */
3852
- storageScope: z13.enum(["session", "family"]).optional()
3966
+ storageScope: z14.enum(["session", "family"]).optional()
3853
3967
  });
3854
- const CliBindingContribution2 = z13.strictObject({
3968
+ const CliBindingContribution2 = z14.strictObject({
3855
3969
  localId: LocalContributionId2,
3856
3970
  binary: CliBinaryName2,
3857
- aliases: z13.array(CliBinaryName2).optional(),
3971
+ aliases: z14.array(CliBinaryName2).optional(),
3858
3972
  /** Where the binary comes from. Omitted => `"vendored"` (decision 007). */
3859
- provider: z13.enum(["vendored", "path"]).optional(),
3973
+ provider: z14.enum(["vendored", "path"]).optional(),
3860
3974
  // A local ref (no dot) must name an auth service declared in this same
3861
3975
  // manifest; a qualified ref (dotted, e.g. `google.account`) names another
3862
3976
  // plugin's already-minted global id and is recorded, not resolved, here (see
@@ -3869,20 +3983,20 @@ function createContributionsSchemas(canonical) {
3869
3983
  * MUST be absent for a `path` binding, which can never receive a token.
3870
3984
  */
3871
3985
  authEnvVar: CliAuthEnvVarName2.optional(),
3872
- readOnly: z13.array(NonEmptyString3),
3873
- write: z13.array(NonEmptyString3)
3986
+ readOnly: z14.array(NonEmptyString3),
3987
+ write: z14.array(NonEmptyString3)
3874
3988
  });
3875
- const GitHostContribution2 = z13.strictObject({
3989
+ const GitHostContribution2 = z14.strictObject({
3876
3990
  host: GitHostName2,
3877
3991
  authService: LocalContributionId2,
3878
3992
  basicAuthUser: GitBasicAuthUser2
3879
3993
  });
3880
- const ResourceContribution2 = z13.strictObject({
3994
+ const ResourceContribution2 = z14.strictObject({
3881
3995
  localId: LocalContributionId2,
3882
3996
  displayName: OptionalDisplayName,
3883
3997
  description: NonEmptyString3.optional()
3884
3998
  });
3885
- const SkillContribution2 = z13.strictObject({
3999
+ const SkillContribution2 = z14.strictObject({
3886
4000
  localId: LocalContributionId2,
3887
4001
  displayName: OptionalDisplayName,
3888
4002
  /** Model-visible one-liner: when to reach for this skill. */
@@ -3890,18 +4004,18 @@ function createContributionsSchemas(canonical) {
3890
4004
  /** The SKILL.md-style file inside the package carrying the full instructions. */
3891
4005
  path: PackageAssetPath2
3892
4006
  });
3893
- const PluginSkillSourceDeclaration2 = z13.discriminatedUnion("channel", [
3894
- z13.strictObject({
3895
- channel: z13.literal("installer"),
4007
+ const PluginSkillSourceDeclaration2 = z14.discriminatedUnion("channel", [
4008
+ z14.strictObject({
4009
+ channel: z14.literal("installer"),
3896
4010
  localId: LocalContributionId2,
3897
4011
  displayName: OptionalDisplayName,
3898
4012
  /** The package-runner executable, e.g. `npx` - checked against the daemon's allowlist. */
3899
4013
  command: NonEmptyString3,
3900
4014
  /** Its argv, e.g. `["skills", "add", "clerk/skills"]`. */
3901
- args: z13.array(NonEmptyString3)
4015
+ args: z14.array(NonEmptyString3)
3902
4016
  }),
3903
- z13.strictObject({
3904
- channel: z13.literal("git-clone"),
4017
+ z14.strictObject({
4018
+ channel: z14.literal("git-clone"),
3905
4019
  localId: LocalContributionId2,
3906
4020
  displayName: OptionalDisplayName,
3907
4021
  /** The repository locator - canonicalized and hygiene-checked by the daemon. */
@@ -3912,17 +4026,17 @@ function createContributionsSchemas(canonical) {
3912
4026
  subdir: NonEmptyString3.optional()
3913
4027
  })
3914
4028
  ]);
3915
- const SearchProviderContribution2 = z13.strictObject({
4029
+ const SearchProviderContribution2 = z14.strictObject({
3916
4030
  localId: LocalContributionId2,
3917
4031
  displayName: OptionalDisplayName,
3918
- schemes: z13.array(UriScheme2).optional()
4032
+ schemes: z14.array(UriScheme2).optional()
3919
4033
  });
3920
- const InteractionDriverContribution2 = z13.strictObject({
4034
+ const InteractionDriverContribution2 = z14.strictObject({
3921
4035
  localId: LocalContributionId2,
3922
4036
  displayName: OptionalDisplayName,
3923
- kind: z13.enum(["browser", "computer-use"])
4037
+ kind: z14.enum(["browser", "computer-use"])
3924
4038
  });
3925
- const EntityResolverContribution2 = z13.strictObject({
4039
+ const EntityResolverContribution2 = z14.strictObject({
3926
4040
  localId: LocalContributionId2,
3927
4041
  displayName: OptionalDisplayName,
3928
4042
  /** The `kay.agent` URI module (this manifest's own `contributes.uriModules[].localId`) whose
@@ -3930,17 +4044,17 @@ function createContributionsSchemas(canonical) {
3930
4044
  uriModule: LocalContributionId2,
3931
4045
  /** `person` | `channel` | `repo` | `pull-request` | ... -- drives avatar-first vs glyph-first row
3932
4046
  * anatomy (N10-R2) and lets the renderer request a narrower `entityTypes` filter. */
3933
- entityTypes: z13.array(NonEmptyString3).min(1),
4047
+ entityTypes: z14.array(NonEmptyString3).min(1),
3934
4048
  /** The URI namespace/route `search()` is called against, e.g. `slack://directory` or
3935
4049
  * `github://search/repositories` -- the resolver's fixed search scope; the live user query is
3936
4050
  * the `search()` call's `query` param, never concatenated into this string. */
3937
4051
  uriHint: NonEmptyString3
3938
4052
  });
3939
- const AgentRenderContribution2 = z13.strictObject({
4053
+ const AgentRenderContribution2 = z14.strictObject({
3940
4054
  localId: LocalContributionId2,
3941
- resultKinds: z13.array(NonEmptyString3).min(1)
4055
+ resultKinds: z14.array(NonEmptyString3).min(1)
3942
4056
  });
3943
- const PluginCardContribution2 = z13.strictObject({
4057
+ const PluginCardContribution2 = z14.strictObject({
3944
4058
  localId: LocalContributionId2,
3945
4059
  description: NonEmptyString3,
3946
4060
  inputs: JsonSchema,
@@ -3948,26 +4062,26 @@ function createContributionsSchemas(canonical) {
3948
4062
  submitEndpoint: LocalContributionId2,
3949
4063
  authService: AuthServiceReference2.optional()
3950
4064
  });
3951
- const EndpointContribution2 = z13.strictObject({
4065
+ const EndpointContribution2 = z14.strictObject({
3952
4066
  localId: LocalContributionId2,
3953
4067
  displayName: OptionalDisplayName,
3954
4068
  requestSchema: JsonSchema.optional(),
3955
4069
  responseSchema: JsonSchema.optional(),
3956
- auth: z13.strictObject({
4070
+ auth: z14.strictObject({
3957
4071
  service: AuthServiceReference2,
3958
- schemes: z13.array(AuthSchemeReference2).min(1),
4072
+ schemes: z14.array(AuthSchemeReference2).min(1),
3959
4073
  purpose: NonEmptyString3
3960
4074
  }).optional(),
3961
- timeoutMs: z13.number().int().positive().optional()
4075
+ timeoutMs: z14.number().int().positive().optional()
3962
4076
  });
3963
- const WorkflowContribution2 = z13.strictObject({
4077
+ const WorkflowContribution2 = z14.strictObject({
3964
4078
  localId: LocalContributionId2,
3965
4079
  name: NonEmptyString3,
3966
4080
  /** Plain-text purpose, at most 280 characters. */
3967
4081
  description: NonEmptyString3,
3968
4082
  /** How often it runs. The automations engine enforces its scheduling floor. */
3969
- everyMs: z13.number().int().positive(),
3970
- auth: z13.strictObject({
4083
+ everyMs: z14.number().int().positive(),
4084
+ auth: z14.strictObject({
3971
4085
  /** A local ref names a service in this manifest; a dotted ref names another plugin's. */
3972
4086
  service: AuthServiceReference2,
3973
4087
  scheme: AuthSchemeReference2,
@@ -3975,7 +4089,7 @@ function createContributionsSchemas(canonical) {
3975
4089
  * Scopes each account's token must hold. Omitted, the host asks for the first scope of the
3976
4090
  * `background-job` grant's `allowedScopes` that the account holds.
3977
4091
  */
3978
- scopes: z13.array(NonEmptyString3).min(1).optional()
4092
+ scopes: z14.array(NonEmptyString3).min(1).optional()
3979
4093
  }).optional()
3980
4094
  });
3981
4095
  const McpServerUrl2 = pluginString(canonical).min(1).refine((value) => {
@@ -3991,8 +4105,8 @@ function createContributionsSchemas(canonical) {
3991
4105
  }, {
3992
4106
  message: "mcp server url must be https://, or http:// only for localhost/127.0.0.1 test servers"
3993
4107
  });
3994
- const McpServerAuthMode2 = z13.enum(["oauth", "api-key", "none"]);
3995
- const McpServerContribution2 = z13.strictObject({
4108
+ const McpServerAuthMode2 = z14.enum(["oauth", "api-key", "none"]);
4109
+ const McpServerContribution2 = z14.strictObject({
3996
4110
  url: McpServerUrl2,
3997
4111
  auth: McpServerAuthMode2.optional(),
3998
4112
  authService: LocalContributionId2.optional()
@@ -4005,24 +4119,24 @@ function createContributionsSchemas(canonical) {
4005
4119
  });
4006
4120
  }
4007
4121
  });
4008
- const McpServerContributions2 = z13.record(LocalContributionId2, McpServerContribution2);
4009
- const AppEventSubscription2 = z13.strictObject({
4122
+ const McpServerContributions2 = z14.record(LocalContributionId2, McpServerContribution2);
4123
+ const AppEventSubscription2 = z14.strictObject({
4010
4124
  localId: LocalContributionId2,
4011
4125
  event: NonEmptyString3
4012
4126
  });
4013
- const ContextContributorContribution2 = z13.strictObject({
4127
+ const ContextContributorContribution2 = z14.strictObject({
4014
4128
  localId: LocalContributionId2.max(64),
4015
4129
  displayName: OptionalDisplayName,
4016
4130
  description: NonEmptyString3.optional()
4017
4131
  });
4018
- const EventDefinitionVersion = z13.number().int().positive();
4019
- const PluginEventDefinitionContribution2 = z13.strictObject({
4132
+ const EventDefinitionVersion = z14.number().int().positive();
4133
+ const PluginEventDefinitionContribution2 = z14.strictObject({
4020
4134
  localId: PluginEventLocalId2,
4021
4135
  displayName: OptionalDisplayName,
4022
4136
  description: NonEmptyString3.optional(),
4023
4137
  version: canonical ? EventDefinitionVersion : EventDefinitionVersion.default(1),
4024
4138
  uriScheme: UriScheme2,
4025
- relatedKeys: z13.array(NonEmptyString3).readonly().optional(),
4139
+ relatedKeys: z14.array(NonEmptyString3).readonly().optional(),
4026
4140
  payloadSchema: JsonSchema.optional(),
4027
4141
  /**
4028
4142
  * This event is a signal: its payload is the shared `PluginSignal` v1 and every publish
@@ -4031,7 +4145,7 @@ function createContributionsSchemas(canonical) {
4031
4145
  * and `relatedKeys` holds `thread` plus any of `from`, `to`, `cc`. Turning it on changes
4032
4146
  * the payload, so bump `version` with it.
4033
4147
  */
4034
- signal: z13.boolean().optional()
4148
+ signal: z14.boolean().optional()
4035
4149
  }).superRefine((definition, context) => {
4036
4150
  if (definition.signal !== true)
4037
4151
  return;
@@ -4052,42 +4166,42 @@ function createContributionsSchemas(canonical) {
4052
4166
  });
4053
4167
  }
4054
4168
  });
4055
- const PluginNotificationRuleContribution2 = z13.strictObject({
4169
+ const PluginNotificationRuleContribution2 = z14.strictObject({
4056
4170
  localId: LocalContributionId2,
4057
4171
  /** The same-plugin `eventDefinitions` local id this rule matches. */
4058
4172
  event: PluginEventLocalId2,
4059
- where: z13.string({ error: (issue) => whereNotAStringMessage(issue.input) }).optional(),
4173
+ where: z14.string({ error: (issue) => whereNotAStringMessage(issue.input) }).optional(),
4060
4174
  rule: JsonObject
4061
4175
  });
4062
- const PluginProductEventContribution2 = z13.union([
4063
- z13.strictObject({
4176
+ const PluginProductEventContribution2 = z14.union([
4177
+ z14.strictObject({
4064
4178
  name: NonEmptyString3,
4065
4179
  description: NonEmptyString3.optional(),
4066
- fields: z13.record(z13.string(), JsonObject).optional()
4180
+ fields: z14.record(z14.string(), JsonObject).optional()
4067
4181
  }),
4068
- z13.strictObject({ catalogEvent: NonEmptyString3 })
4182
+ z14.strictObject({ catalogEvent: NonEmptyString3 })
4069
4183
  ]);
4070
- const UiEventSubscriptionContribution2 = z13.strictObject({
4184
+ const UiEventSubscriptionContribution2 = z14.strictObject({
4071
4185
  localId: LocalContributionId2,
4072
4186
  event: NonEmptyString3
4073
4187
  });
4074
- const DeviceDelegationContribution2 = z13.strictObject({
4188
+ const DeviceDelegationContribution2 = z14.strictObject({
4075
4189
  localId: LocalContributionId2,
4076
- device: z13.enum(["microphone"]),
4077
- delegateAs: z13.enum(["clip", "stream", "status"])
4190
+ device: z14.enum(["microphone"]),
4191
+ delegateAs: z14.enum(["clip", "stream", "status"])
4078
4192
  });
4079
- const CorpusAccess = z13.enum(["read"]);
4080
- const SessionReaderContribution2 = z13.strictObject({
4193
+ const CorpusAccess = z14.enum(["read"]);
4194
+ const SessionReaderContribution2 = z14.strictObject({
4081
4195
  localId: LocalContributionId2,
4082
4196
  displayName: OptionalDisplayName,
4083
4197
  access: canonical ? CorpusAccess : CorpusAccess.default("read")
4084
4198
  });
4085
- const UiCommandContribution2 = z13.strictObject({
4199
+ const UiCommandContribution2 = z14.strictObject({
4086
4200
  localId: LocalContributionId2,
4087
4201
  title: NonEmptyString3,
4088
4202
  icon: PackageAssetPath2.optional(),
4089
- button: z13.enum(["tabStrip"]).optional(),
4090
- menu: z13.enum(["help"]).optional(),
4203
+ button: z14.enum(["tabStrip"]).optional(),
4204
+ menu: z14.enum(["help"]).optional(),
4091
4205
  where: NonEmptyString3.optional()
4092
4206
  }).superRefine((command, ctx) => {
4093
4207
  if (command.where === void 0)
@@ -4108,7 +4222,7 @@ function createContributionsSchemas(canonical) {
4108
4222
  });
4109
4223
  }
4110
4224
  });
4111
- const UiSlotContribution2 = z13.strictObject({
4225
+ const UiSlotContribution2 = z14.strictObject({
4112
4226
  localId: LocalContributionId2,
4113
4227
  slot: NonEmptyString3,
4114
4228
  title: NonEmptyString3.optional()
@@ -4122,84 +4236,86 @@ function createContributionsSchemas(canonical) {
4122
4236
  "blob",
4123
4237
  "about"
4124
4238
  ]);
4125
- const ReferenceOpenBehavior2 = z13.discriminatedUnion("kind", [
4126
- z13.strictObject({ kind: z13.literal("working-document") }),
4127
- z13.strictObject({ kind: z13.literal("browser-pane") }),
4239
+ const ReferenceOpenBehavior2 = z14.discriminatedUnion("kind", [
4240
+ z14.strictObject({ kind: z14.literal("working-document") }),
4241
+ z14.strictObject({ kind: z14.literal("browser-pane") }),
4128
4242
  /**
4129
4243
  * Open one of the pages this manifest declares in `pages`. The window answers this from the
4130
4244
  * manifest, and the page gets the whole address as its `objectId` unless `addresses` says
4131
4245
  * otherwise. Needs no web address, so a plugin-only resource (`user-todo://items/3`) can pill.
4132
4246
  */
4133
- z13.strictObject({ kind: z13.literal("page"), pageId: NonEmptyString3 }),
4247
+ z14.strictObject({ kind: z14.literal("page"), pageId: NonEmptyString3 }),
4134
4248
  /**
4135
4249
  * Hand the address's link to an app on this machine. The module's claims fill the link as its
4136
4250
  * `sourceUrl`, and `schemes` names every scheme those links may use: main opens a link only when
4137
4251
  * a loaded plugin declares its scheme here. A plugin the person installed can't declare this.
4138
4252
  */
4139
- z13.strictObject({
4140
- kind: z13.literal("local-app"),
4141
- schemes: z13.array(UriScheme2.refine((scheme) => !NOT_LOCAL_APP_SCHEMES.has(scheme), "Names the web, a file or script, not an app on this machine")).min(1)
4253
+ z14.strictObject({
4254
+ kind: z14.literal("local-app"),
4255
+ schemes: z14.array(UriScheme2.refine((scheme) => !NOT_LOCAL_APP_SCHEMES.has(scheme), "Names the web, a file or script, not an app on this machine")).min(1)
4142
4256
  })
4143
4257
  ]);
4144
- const ReferencePresentationVariant2 = z13.strictObject({
4258
+ const ReferencePresentationVariant2 = z14.strictObject({
4145
4259
  resourceKind: NonEmptyString3,
4146
4260
  presentationPluginId: PluginId2.optional()
4147
4261
  });
4148
- const ReferencePresentationVariants2 = z13.record(MimeTypeString2, ReferencePresentationVariant2);
4149
- const ReferencePresentationUriPattern2 = z13.strictObject({
4262
+ const ReferencePresentationVariants2 = z14.record(MimeTypeString2, ReferencePresentationVariant2);
4263
+ const ReferencePresentationUriPattern2 = z14.strictObject({
4150
4264
  protocol: NonEmptyString3,
4151
- hostname: NonEmptyString3,
4152
- pathname: z13.string().optional(),
4153
- search: z13.string().optional()
4265
+ hostname: z14.string(),
4266
+ pathname: z14.string().optional(),
4267
+ search: z14.string().optional()
4154
4268
  });
4155
- const ReferencePresentationUrlClaim2 = z13.strictObject({
4156
- kind: z13.literal("urlPattern"),
4269
+ const ReferencePresentationUrlClaim2 = z14.strictObject({
4270
+ kind: z14.literal("urlPattern"),
4157
4271
  pattern: ReferencePresentationUriPattern2.extend({
4158
- protocol: z13.enum(["http", "https"])
4272
+ protocol: z14.enum(["http", "https"])
4159
4273
  }),
4160
4274
  /** The claim's mark: an SVG file in the plugin, drawn in its own colours. */
4161
4275
  brandIcon: PackageAssetPath2.optional()
4162
4276
  });
4163
- const ReferencePresentationTooltip2 = z13.strictObject({
4277
+ const ReferencePresentationTooltip2 = z14.strictObject({
4164
4278
  /** Same-plugin kay.ui app mounted with read-only reference URI context. */
4165
4279
  app: LocalContributionId2,
4166
4280
  pattern: ReferencePresentationUriPattern2
4167
4281
  });
4168
- const ReferencePresentationAddress2 = z13.strictObject({
4282
+ const ReferencePresentationAddress2 = z14.strictObject({
4169
4283
  pattern: ReferencePresentationUriPattern2,
4170
4284
  objectId: NonEmptyString3.optional(),
4171
- open: z13.strictObject({ kind: z13.literal("none") }).optional()
4285
+ resourceKind: NonEmptyString3.optional(),
4286
+ label: NonEmptyString3.optional(),
4287
+ open: z14.strictObject({ kind: z14.literal("none") }).optional()
4172
4288
  });
4173
- const ReferencePresentationAccountLinkPage = z13.strictObject({
4289
+ const ReferencePresentationAccountLinkPage = z14.strictObject({
4174
4290
  /** A literal host name. */
4175
- hostname: z13.string().regex(/^[a-z0-9.-]+$/, "An account link's hostname is a literal lower-case host name."),
4176
- pathname: z13.string().optional(),
4291
+ hostname: z14.string().regex(/^[a-z0-9.-]+$/, "An account link's hostname is a literal lower-case host name."),
4292
+ pathname: z14.string().optional(),
4177
4293
  /** A page matching one of these already names its account, so it stays as it is. */
4178
- unlessPathname: z13.array(z13.string()).min(1).optional(),
4294
+ unlessPathname: z14.array(z14.string()).min(1).optional(),
4179
4295
  /** The path the page opens at, in place of its own. */
4180
- setPathname: z13.string().startsWith("/").optional(),
4296
+ setPathname: z14.string().startsWith("/").optional(),
4181
4297
  /** Query values to add. A page that already has one of these names stays as it is. */
4182
- addQuery: z13.record(NonEmptyString3, NonEmptyString3)
4298
+ addQuery: z14.record(NonEmptyString3, NonEmptyString3)
4183
4299
  });
4184
- const ReferencePresentationAccountLinkAddress = z13.strictObject({
4300
+ const ReferencePresentationAccountLinkAddress = z14.strictObject({
4185
4301
  pattern: ReferencePresentationUriPattern2,
4186
- url: z13.string().regex(/^https?:\/\//, "An account link's url is a web page.")
4302
+ url: z14.string().regex(/^https?:\/\//, "An account link's url is a web page.")
4187
4303
  });
4188
- const ReferencePresentationAccountLinks2 = z13.strictObject({
4189
- label: z13.enum(["email", "name"]).optional(),
4190
- pages: z13.array(ReferencePresentationAccountLinkPage).min(1).optional(),
4191
- addresses: z13.array(ReferencePresentationAccountLinkAddress).min(1).optional()
4304
+ const ReferencePresentationAccountLinks2 = z14.strictObject({
4305
+ label: z14.enum(["email", "name"]).optional(),
4306
+ pages: z14.array(ReferencePresentationAccountLinkPage).min(1).optional(),
4307
+ addresses: z14.array(ReferencePresentationAccountLinkAddress).min(1).optional()
4192
4308
  });
4193
- const ReferencePresentationWords2 = z13.strictObject({
4309
+ const ReferencePresentationWords2 = z14.strictObject({
4194
4310
  /** The row's mark, for a source with no icon of its own. Left out: the plugin's main icon. */
4195
- glyph: z13.enum(TOOL_GLYPHS).optional(),
4311
+ glyph: z14.enum(TOOL_GLYPHS).optional(),
4196
4312
  /** The thing an address names ("channel" in "Read Slack channel"). Left out: the row reads the scheme's own name. */
4197
4313
  kind: NonEmptyString3.optional(),
4198
4314
  /**
4199
4315
  * A more specific kind by the address's shape. The first row that matches decides, and an
4200
4316
  * address no row matches reads `kind`.
4201
4317
  */
4202
- kinds: z13.array(z13.strictObject({
4318
+ kinds: z14.array(z14.strictObject({
4203
4319
  pattern: ReferencePresentationUriPattern2,
4204
4320
  kind: NonEmptyString3
4205
4321
  })).min(1).optional(),
@@ -4208,7 +4324,7 @@ function createContributionsSchemas(canonical) {
4208
4324
  /** What the live phrase names ("Slack" in "Reading Slack"). Left out: the bare verb ("Reading"). */
4209
4325
  target: NonEmptyString3.optional(),
4210
4326
  /** `kind` already says which source this is: "Edited plan", not "Edited Plan plan". */
4211
- kindNamesSource: z13.literal(true).optional()
4327
+ kindNamesSource: z14.literal(true).optional()
4212
4328
  }).superRefine((value, ctx) => {
4213
4329
  if (value.kind === void 0 && (value.glyph !== void 0 || value.kindNamesSource !== void 0 || value.kinds !== void 0)) {
4214
4330
  ctx.addIssue({
@@ -4218,7 +4334,7 @@ function createContributionsSchemas(canonical) {
4218
4334
  });
4219
4335
  }
4220
4336
  });
4221
- const ReferencePresentationContribution2 = z13.strictObject({
4337
+ const ReferencePresentationContribution2 = z14.strictObject({
4222
4338
  localId: LocalContributionId2,
4223
4339
  /** This manifest's URI module. Leave it out only for an address another layer serves. */
4224
4340
  uriModule: LocalContributionId2.optional(),
@@ -4229,7 +4345,7 @@ function createContributionsSchemas(canonical) {
4229
4345
  */
4230
4346
  scheme: UriScheme2.optional(),
4231
4347
  /** Which of the addresses open the page, and on what. Read by the window. */
4232
- addresses: z13.array(ReferencePresentationAddress2).min(1).optional(),
4348
+ addresses: z14.array(ReferencePresentationAddress2).min(1).optional(),
4233
4349
  /** Comes with `open`. A presentation with neither only words its module's addresses. */
4234
4350
  resourceKind: NonEmptyString3.optional(),
4235
4351
  /** How the address opens. Left out, it stays plain text. */
@@ -4237,7 +4353,7 @@ function createContributionsSchemas(canonical) {
4237
4353
  /** MIME-specific resource kinds; absent keys use the base presentation. */
4238
4354
  variants: ReferencePresentationVariants2.optional(),
4239
4355
  /** Lexical public URL claims used only for host-rendered browser presentations. */
4240
- claims: z13.array(ReferencePresentationUrlClaim2).optional(),
4356
+ claims: z14.array(ReferencePresentationUrlClaim2).optional(),
4241
4357
  /** Informational app presentation matched against the canonical resource URI. */
4242
4358
  tooltip: ReferencePresentationTooltip2.optional(),
4243
4359
  /** What the transcript calls this module's addresses. Needs a `uriModule`. */
@@ -4320,8 +4436,15 @@ function createContributionsSchemas(canonical) {
4320
4436
  });
4321
4437
  }
4322
4438
  });
4323
- const KayUiAppHostCapability2 = z13.enum([
4439
+ const KayUiAppHostCapability2 = z14.enum([
4324
4440
  "navigation.open-session",
4441
+ "navigation.open-external",
4442
+ "configuration.read",
4443
+ "auth-services.read",
4444
+ "connect-flows.read",
4445
+ "connect-flows.dismiss",
4446
+ "support.report",
4447
+ "navigation.open-page",
4325
4448
  // Lets `navigation.openChat` create a blank chat (no message, no model
4326
4449
  // turn) when no session id is given. It never sends anything.
4327
4450
  "sessions.create",
@@ -4331,12 +4454,15 @@ function createContributionsSchemas(canonical) {
4331
4454
  // Draws Bonsai's markdown document view in the app's page (`BonsaiMarkdownDocumentView`).
4332
4455
  // It reads and saves nothing: the app supplies the text and keeps the edits.
4333
4456
  "markdown.document-view",
4334
- "models.complete",
4335
4457
  // Draws links the host resolves and opens (`BonsaiReferencePill`, `BonsaiReferenceRow`,
4336
4458
  // `BonsaiReferenceMarkdown`). A person's click on one can open a session or another plugin's page.
4337
4459
  "references.open",
4338
4460
  // Server-rated organization billing, distinct from local/provider cost.
4339
4461
  "billing.read",
4462
+ "account.read",
4463
+ "plugins.read",
4464
+ "plugins.settings",
4465
+ "permissions.manage",
4340
4466
  "automations.read",
4341
4467
  "automations.run",
4342
4468
  // Lists the shared artifacts the signed-in account may open and opens one in Bonsai's shared
@@ -4367,16 +4493,16 @@ function createContributionsSchemas(canonical) {
4367
4493
  // rearrange the workspace but never remove something the user would have to notice going missing.
4368
4494
  "workspace.arrange"
4369
4495
  ]);
4370
- const UiAppCapabilityReference2 = z13.union([
4496
+ const UiAppCapabilityReference2 = z14.union([
4371
4497
  LocalContributionId2,
4372
- z13.strictObject({ pluginId: PluginId2, localId: LocalContributionId2 })
4498
+ z14.strictObject({ pluginId: PluginId2, localId: LocalContributionId2 })
4373
4499
  ]);
4374
- const UiAppCapabilities2 = z13.strictObject({
4375
- endpoints: z13.array(UiAppCapabilityReference2).optional(),
4376
- host: z13.array(KayUiAppHostCapability2).optional(),
4500
+ const UiAppCapabilities2 = z14.strictObject({
4501
+ endpoints: z14.array(UiAppCapabilityReference2).optional(),
4502
+ host: z14.array(KayUiAppHostCapability2).optional(),
4377
4503
  // A local name selects this plugin's source first, otherwise the daemon's.
4378
4504
  // An explicit reference selects only the named plugin.
4379
- feeds: z13.array(UiAppCapabilityReference2).optional()
4505
+ feeds: z14.array(UiAppCapabilityReference2).optional()
4380
4506
  }).superRefine((capabilities, ctx) => {
4381
4507
  for (const field of ["endpoints", "host", "feeds"]) {
4382
4508
  const seen = /* @__PURE__ */ new Set();
@@ -4393,10 +4519,10 @@ function createContributionsSchemas(canonical) {
4393
4519
  }
4394
4520
  }
4395
4521
  });
4396
- const UiRailBadge = z13.strictObject({
4522
+ const UiRailBadge = z14.strictObject({
4397
4523
  source: LocalContributionId2,
4398
4524
  where: NonEmptyString3.optional(),
4399
- label: z13.strictObject({
4525
+ label: z14.strictObject({
4400
4526
  one: NonEmptyString3.optional(),
4401
4527
  other: NonEmptyString3
4402
4528
  })
@@ -4412,48 +4538,52 @@ function createContributionsSchemas(canonical) {
4412
4538
  });
4413
4539
  }
4414
4540
  });
4415
- const UiRailEntryContribution2 = z13.strictObject({
4541
+ const UiRailEntryContribution2 = z14.strictObject({
4416
4542
  id: LocalContributionId2,
4417
4543
  title: NonEmptyString3,
4418
4544
  icon: PackageAssetPath2.optional(),
4419
4545
  page: NonEmptyString3,
4420
4546
  homeLocation: NonEmptyString3.optional(),
4421
4547
  shortcut: NonEmptyString3.optional(),
4422
- order: z13.number().finite().optional(),
4423
- section: z13.enum(["primary", "plugins"]).optional(),
4548
+ order: z14.number().finite().optional(),
4549
+ section: z14.enum(["primary", "plugins"]).optional(),
4424
4550
  badge: UiRailBadge.optional(),
4425
- panel: z13.strictObject({ body: LocalContributionId2 }).optional(),
4426
- featureFlagVariant: z13.strictObject({
4551
+ panel: z14.strictObject({ body: LocalContributionId2 }).optional(),
4552
+ featureFlagVariant: z14.strictObject({
4427
4553
  flag: NonEmptyString3,
4428
4554
  title: NonEmptyString3.optional(),
4429
4555
  icon: PackageAssetPath2.optional(),
4430
- panel: z13.literal(false).optional()
4556
+ panel: z14.literal(false).optional()
4431
4557
  }).optional()
4432
4558
  });
4433
- const UiToastPreviewContribution2 = z13.strictObject({
4559
+ const UiToastPreviewContribution2 = z14.strictObject({
4434
4560
  rule: LocalContributionId2,
4435
4561
  body: LocalContributionId2,
4436
4562
  address: NonEmptyString3
4437
4563
  });
4438
- const UiPageContribution2 = z13.strictObject({
4564
+ const UiPageContribution2 = z14.strictObject({
4439
4565
  id: NonEmptyString3,
4440
4566
  title: NonEmptyString3.optional(),
4441
4567
  icon: PackageAssetPath2.optional(),
4442
- companion: z13.boolean().optional(),
4568
+ companion: z14.boolean().optional(),
4569
+ sessionBinding: z14.enum(["session", "family"]).optional(),
4570
+ /** Lists this page in Settings beside native workspace sections, in the same order scale. */
4571
+ settings: z14.strictObject({ order: z14.number().optional() }).optional(),
4572
+ aliases: z14.array(NonEmptyString3).optional(),
4443
4573
  openedEvent: NonEmptyString3.optional()
4444
4574
  });
4445
- const UiAppFields = z13.strictObject({
4575
+ const UiAppFields = z14.strictObject({
4446
4576
  localId: LocalContributionId2,
4447
4577
  displayName: NonEmptyString3,
4448
4578
  description: NonEmptyString3.optional(),
4449
4579
  icon: PackageAssetPath2.optional(),
4450
- runtime: z13.literal("kay.react-app.v1"),
4580
+ runtime: z14.literal("kay.react-app.v1"),
4451
4581
  /** Mounted only by a host-supplied context; never a standalone navigation destination. */
4452
- contextOnly: z13.literal(true).optional(),
4453
- sdk: z13.strictObject({ range: NonEmptyString3 }),
4582
+ contextOnly: z14.literal(true).optional(),
4583
+ sdk: z14.strictObject({ range: NonEmptyString3 }),
4454
4584
  entrypoint: TargetEntrypoint2,
4455
- styles: z13.array(PackageAssetPath2).optional(),
4456
- assets: z13.array(PackageAssetPath2).optional(),
4585
+ styles: z14.array(PackageAssetPath2).optional(),
4586
+ assets: z14.array(PackageAssetPath2).optional(),
4457
4587
  capabilities: UiAppCapabilities2.optional()
4458
4588
  });
4459
4589
  function stripRetiredUiAppFields(value) {
@@ -4464,36 +4594,36 @@ function createContributionsSchemas(canonical) {
4464
4594
  delete remaining["activityRail"];
4465
4595
  return remaining;
4466
4596
  }
4467
- const UiAppContribution2 = canonical ? UiAppFields : z13.preprocess(stripRetiredUiAppFields, UiAppFields);
4468
- const ThemeContribution2 = z13.strictObject({
4597
+ const UiAppContribution2 = canonical ? UiAppFields : z14.preprocess(stripRetiredUiAppFields, UiAppFields);
4598
+ const ThemeContribution2 = z14.strictObject({
4469
4599
  localId: LocalContributionId2,
4470
4600
  displayName: NonEmptyString3,
4471
- appearance: z13.enum(["light", "dark"]),
4601
+ appearance: z14.enum(["light", "dark"]),
4472
4602
  tokens: PackageAssetPath2
4473
4603
  });
4474
- const CommandHandler2 = z13.discriminatedUnion("kind", [
4475
- z13.strictObject({ kind: z13.literal("skill"), skill: LocalContributionId2 }),
4476
- z13.strictObject({
4477
- kind: z13.literal("tool"),
4604
+ const CommandHandler2 = z14.discriminatedUnion("kind", [
4605
+ z14.strictObject({ kind: z14.literal("skill"), skill: LocalContributionId2 }),
4606
+ z14.strictObject({
4607
+ kind: z14.literal("tool"),
4478
4608
  tool: PluginToolName2,
4479
4609
  /** Positional mapping from tokenized `argsText` onto the tool's own input fields - see this
4480
4610
  * union's doc for the exact tokenize/map/last-field-absorbs rule. */
4481
- argumentFields: z13.array(NonEmptyString3)
4611
+ argumentFields: z14.array(NonEmptyString3)
4482
4612
  }),
4483
- z13.strictObject({
4484
- kind: z13.literal("endpoint"),
4613
+ z14.strictObject({
4614
+ kind: z14.literal("endpoint"),
4485
4615
  endpoint: LocalContributionId2
4486
4616
  })
4487
4617
  ]);
4488
- const CommandContribution2 = z13.strictObject({
4618
+ const CommandContribution2 = z14.strictObject({
4489
4619
  localId: LocalContributionId2,
4490
4620
  displayName: OptionalDisplayName,
4491
4621
  description: NonEmptyString3,
4492
- aliases: z13.array(LocalContributionId2).optional(),
4622
+ aliases: z14.array(LocalContributionId2).optional(),
4493
4623
  argumentHint: NonEmptyString3.optional(),
4494
4624
  handler: CommandHandler2
4495
4625
  });
4496
- const PluginContributionKind2 = z13.enum([
4626
+ const PluginContributionKind2 = z14.enum([
4497
4627
  "tool",
4498
4628
  "converter",
4499
4629
  "uriModule",
@@ -4653,28 +4783,53 @@ __export(manifest_exports, {
4653
4783
  validateKayUiEventSubscription: () => validateKayUiEventSubscription
4654
4784
  });
4655
4785
 
4786
+ // packages/plugin-protocol/dist/project-directories.js
4787
+ import { z as z15 } from "zod";
4788
+ var PluginProjectDirectories = z15.strictObject({
4789
+ /** An endpoint this plugin's app target declares; called with a {@link ProjectDirectoryRequest}. */
4790
+ endpoint: z15.string().min(1),
4791
+ /** A scheme this plugin's URI modules serve; a project is addressed as `<scheme>://<id>`. */
4792
+ scheme: z15.string().min(1)
4793
+ });
4794
+ var ProjectDirectoryRequest = z15.strictObject({
4795
+ /** The project's stable id. */
4796
+ id: z15.string().min(1)
4797
+ });
4798
+ var ProjectDirectory = z15.strictObject({
4799
+ id: z15.string().min(1),
4800
+ /** Absolute path of the project's folder. */
4801
+ path: z15.string().min(1),
4802
+ /** Absolute path a new session in this project starts in. */
4803
+ defaultCwd: z15.string().min(1),
4804
+ /** Ancestor project ids, root first. */
4805
+ ancestorIds: z15.array(z15.string().min(1))
4806
+ });
4807
+ var ProjectDirectoryResponse = z15.strictObject({
4808
+ project: ProjectDirectory.nullable()
4809
+ });
4810
+
4656
4811
  // packages/plugin-protocol/dist/shell-commands.js
4657
- import { z as z14 } from "zod";
4658
- var PluginShellCommand = z14.strictObject({
4659
- name: z14.string().regex(/^[a-z][a-z0-9-]*$/),
4660
- aliases: z14.array(z14.string().regex(/^[a-z][a-z0-9-]*$/)).optional(),
4661
- endpoint: z14.string().min(1),
4662
- usage: z14.string().min(1)
4812
+ import { z as z16 } from "zod";
4813
+ var PluginShellCommand = z16.strictObject({
4814
+ name: z16.string().regex(/^[a-z][a-z0-9-]*$/),
4815
+ aliases: z16.array(z16.string().regex(/^[a-z][a-z0-9-]*$/)).optional(),
4816
+ endpoint: z16.string().min(1),
4817
+ usage: z16.string().min(1)
4663
4818
  });
4664
- var ShellCommandOutcome = z14.strictObject({
4665
- exitCode: z14.number().int(),
4819
+ var ShellCommandOutcome = z16.strictObject({
4820
+ exitCode: z16.number().int(),
4666
4821
  envelope: JsonValue,
4667
4822
  result: JsonValue.optional()
4668
4823
  });
4669
- var ShellCommandRequest = z14.strictObject({
4670
- argv: z14.array(z14.string()),
4671
- cwd: z14.string(),
4672
- outcomes: z14.array(ShellCommandOutcome).max(3)
4824
+ var ShellCommandRequest = z16.strictObject({
4825
+ argv: z16.array(z16.string()),
4826
+ cwd: z16.string(),
4827
+ outcomes: z16.array(ShellCommandOutcome).max(3)
4673
4828
  });
4674
- var ShellCommandStep = z14.discriminatedUnion("kind", [
4675
- z14.strictObject({
4676
- kind: z14.literal("invoke"),
4677
- toolName: z14.enum([
4829
+ var ShellCommandStep = z16.discriminatedUnion("kind", [
4830
+ z16.strictObject({
4831
+ kind: z16.literal("invoke"),
4832
+ toolName: z16.enum([
4678
4833
  "read",
4679
4834
  "list",
4680
4835
  "search",
@@ -4683,24 +4838,24 @@ var ShellCommandStep = z14.discriminatedUnion("kind", [
4683
4838
  "delete",
4684
4839
  "help"
4685
4840
  ]),
4686
- input: z14.record(z14.string(), JsonValue),
4687
- flags: z14.record(z14.string(), z14.string())
4841
+ input: z16.record(z16.string(), JsonValue),
4842
+ flags: z16.record(z16.string(), z16.string())
4688
4843
  }),
4689
- z14.strictObject({
4690
- kind: z14.literal("finish"),
4691
- exitCode: z14.number().int(),
4692
- stdout: z14.string()
4844
+ z16.strictObject({
4845
+ kind: z16.literal("finish"),
4846
+ exitCode: z16.number().int(),
4847
+ stdout: z16.string()
4693
4848
  })
4694
4849
  ]);
4695
4850
 
4696
4851
  // packages/plugin-protocol/dist/manifest.js
4697
- import { z as z16 } from "zod";
4852
+ import { z as z18 } from "zod";
4698
4853
 
4699
4854
  // packages/plugin-protocol/dist/workload-purposes.js
4700
- import { z as z15 } from "zod";
4701
- var PluginWorkloadPurpose = z15.strictObject({
4702
- purpose: z15.string().regex(/^[a-z][a-z0-9-]*$/),
4703
- workloadClass: z15.enum(["dreaming", "hindsight"])
4855
+ import { z as z17 } from "zod";
4856
+ var PluginWorkloadPurpose = z17.strictObject({
4857
+ purpose: z17.string().max(128).regex(/^[a-z][a-z0-9_-]*(?:\/[a-z][a-z0-9_-]*)*$/),
4858
+ workloadClass: z17.enum(["dreaming", "hindsight"])
4704
4859
  });
4705
4860
 
4706
4861
  // packages/plugin-protocol/dist/synthetic-contributions.js
@@ -4726,34 +4881,34 @@ function createManifestSchemas(canonical) {
4726
4881
  const { AgentRenderContribution: AgentRenderContribution2, ApprovalTypeContribution: ApprovalTypeContribution2, WorkflowContribution: WorkflowContribution2, PluginCardContribution: PluginCardContribution2, AppDataMaterializerContribution: AppDataMaterializerContribution2, AppDataSourceContribution: AppDataSourceContribution2, AppUriModuleContribution: AppUriModuleContribution2, AppEventSubscription: AppEventSubscription2, ArtifactUriModuleContribution: ArtifactUriModuleContribution2, CliBindingContribution: CliBindingContribution2, CommandContribution: CommandContribution2, ContextContributorContribution: ContextContributorContribution2, ConverterContribution: ConverterContribution2, SessionReaderContribution: SessionReaderContribution2, DeviceDelegationContribution: DeviceDelegationContribution2, EndpointContribution: EndpointContribution2, EntityResolverContribution: EntityResolverContribution2, GitHostContribution: GitHostContribution2, McpServerContributions: McpServerContributions2, PluginEventDefinitionContribution: PluginEventDefinitionContribution2, PluginNotificationRuleContribution: PluginNotificationRuleContribution2, PluginProductEventContribution: PluginProductEventContribution2, ResourceContribution: ResourceContribution2, ReferencePresentationContribution: ReferencePresentationContribution2, PluginSkillSourceDeclaration: PluginSkillSourceDeclaration2, InteractionDriverContribution: InteractionDriverContribution2, SearchProviderContribution: SearchProviderContribution2, SkillContribution: SkillContribution2, ThemeContribution: ThemeContribution2, AgentToolContribution: AgentToolContribution2, ToolContribution: ToolContribution2, UiCommandContribution: UiCommandContribution2, UiAppContribution: UiAppContribution2, UiRailEntryContribution: UiRailEntryContribution2, UiToastPreviewContribution: UiToastPreviewContribution2, UiPageContribution: UiPageContribution2, UiEventSubscriptionContribution: UiEventSubscriptionContribution2, UiSlotContribution: UiSlotContribution2, UriModuleContribution: UriModuleContribution2, WhiteboardTypeContribution: WhiteboardTypeContribution2 } = canonical ? canonicalContributionSchemas : contributions_exports;
4727
4882
  const { HttpsUrl: HttpsUrl2, LocalContributionId: LocalContributionId2, NonEmptyString: NonEmptyString3, PackageAssetPath: PackageAssetPath2, PluginId: PluginId2, PluginNamespace: PluginNamespace2, RegistrableDomain: RegistrableDomain2, SignedInStatusCode: SignedInStatusCode2, TargetEntrypoint: TargetEntrypoint2 } = canonical ? canonicalCommonSchemas : common_exports;
4728
4883
  const { PluginPermissionManifest: PluginPermissionManifest2 } = canonical ? canonicalPermissionSchemas : permissions_exports;
4729
- const KayAgentTargetManifest2 = z16.strictObject({
4884
+ const KayAgentTargetManifest2 = z18.strictObject({
4730
4885
  entrypoint: TargetEntrypoint2,
4731
- contributes: z16.strictObject({
4732
- tools: z16.array(AgentToolContribution2).optional(),
4733
- converters: z16.array(ConverterContribution2).optional(),
4734
- uriModules: z16.array(UriModuleContribution2).optional(),
4886
+ contributes: z18.strictObject({
4887
+ tools: z18.array(AgentToolContribution2).optional(),
4888
+ converters: z18.array(ConverterContribution2).optional(),
4889
+ uriModules: z18.array(UriModuleContribution2).optional(),
4735
4890
  // Host-composed artifact-backed schemes (see `ArtifactUriModuleContribution`): the plugin
4736
4891
  // declares scheme + editability; the daemon binds each to the kernel's artifact lifecycle
4737
4892
  // per session. Separate from `uriModules` (plugin-implemented backends) precisely because
4738
4893
  // the plugin registers NOTHING for these at activation.
4739
- artifactUriModules: z16.array(ArtifactUriModuleContribution2).optional(),
4740
- cliBindings: z16.array(CliBindingContribution2).optional(),
4894
+ artifactUriModules: z18.array(ArtifactUriModuleContribution2).optional(),
4895
+ cliBindings: z18.array(CliBindingContribution2).optional(),
4741
4896
  // Which git hosts this plugin's credential serves (see `GitHostContribution`): a
4742
4897
  // declaration, so a plugin for any git backend gets credentialed clones without
4743
4898
  // the daemon learning its name. Sibling of `cliBindings` because both answer the
4744
4899
  // same question - which of this plugin's auth services a host-side consumer
4745
4900
  // resolves - for two different transports.
4746
- gitHosts: z16.array(GitHostContribution2).optional(),
4747
- resources: z16.array(ResourceContribution2).optional(),
4748
- skills: z16.array(SkillContribution2).optional(),
4749
- searchProviders: z16.array(SearchProviderContribution2).optional(),
4750
- interactionDrivers: z16.array(InteractionDriverContribution2).optional(),
4751
- entityResolvers: z16.array(EntityResolverContribution2).optional(),
4752
- renderers: z16.array(AgentRenderContribution2).optional(),
4901
+ gitHosts: z18.array(GitHostContribution2).optional(),
4902
+ resources: z18.array(ResourceContribution2).optional(),
4903
+ skills: z18.array(SkillContribution2).optional(),
4904
+ searchProviders: z18.array(SearchProviderContribution2).optional(),
4905
+ interactionDrivers: z18.array(InteractionDriverContribution2).optional(),
4906
+ entityResolvers: z18.array(EntityResolverContribution2).optional(),
4907
+ renderers: z18.array(AgentRenderContribution2).optional(),
4753
4908
  // Handler restricted to skill | tool by the manifest-level refinement below (see
4754
4909
  // `CommandContribution`'s doc for why the restriction is not expressed in the type, and
4755
4910
  // `CommandHandler`'s doc for why there is no promptTemplate variant to declare here).
4756
- commands: z16.array(CommandContribution2).optional()
4911
+ commands: z18.array(CommandContribution2).optional()
4757
4912
  }).optional(),
4758
4913
  /**
4759
4914
  * The plugin's primer skill - the `localId` of one of its own declared
@@ -4789,6 +4944,8 @@ function createManifestSchemas(canonical) {
4789
4944
  * grant a person approved), and a body over 500 words is dropped.
4790
4945
  */
4791
4946
  prompt: PackageAssetPath2.optional(),
4947
+ promptOrder: z18.number().finite().optional(),
4948
+ familyFolder: z18.strictObject({ scope: z18.literal("root") }).optional(),
4792
4949
  /**
4793
4950
  * External origins of skills this plugin claims as its own (see
4794
4951
  * {@link PluginSkillSourceDeclaration}). Acquired by the daemon at boot and landed under the
@@ -4799,61 +4956,61 @@ function createManifestSchemas(canonical) {
4799
4956
  * acquisition, not declared here, so there is nothing for the resolved contract to mint a
4800
4957
  * `globalId` for at parse time.
4801
4958
  */
4802
- skillSources: z16.array(PluginSkillSourceDeclaration2).optional()
4959
+ skillSources: z18.array(PluginSkillSourceDeclaration2).optional()
4803
4960
  });
4804
- const KayAppTargetManifest2 = z16.strictObject({
4961
+ const KayAppTargetManifest2 = z18.strictObject({
4805
4962
  // Optional, like `kay.ui`'s: a target may carry only declarative `contributes` (e.g. a plugin
4806
4963
  // that ships nothing but `mcpServers`) with no app-lifetime module for the host to load.
4807
4964
  entrypoint: TargetEntrypoint2.optional(),
4808
- contributes: z16.strictObject({
4965
+ contributes: z18.strictObject({
4809
4966
  // Session tools implemented by the app-lifetime activation (registered once, injected into
4810
4967
  // every session with a host-stamped session context) - the tool counterpart of `uriModules`
4811
4968
  // below. Same descriptor shape as kay.agent tools; `toolName` shares ONE flat session
4812
4969
  // namespace with them (enforced by the manifest-level refinement below).
4813
- tools: z16.array(ToolContribution2).optional(),
4814
- endpoints: z16.array(EndpointContribution2).optional(),
4815
- cards: z16.array(PluginCardContribution2).optional(),
4816
- uriModules: z16.array(AppUriModuleContribution2).optional(),
4817
- dataSources: z16.array(AppDataSourceContribution2).optional(),
4818
- whiteboardTypes: z16.array(WhiteboardTypeContribution2).optional(),
4819
- approvalTypes: z16.array(ApprovalTypeContribution2).optional(),
4820
- workflows: z16.array(WorkflowContribution2).optional(),
4821
- eventDefinitions: z16.array(PluginEventDefinitionContribution2).optional(),
4970
+ tools: z18.array(ToolContribution2).optional(),
4971
+ endpoints: z18.array(EndpointContribution2).optional(),
4972
+ cards: z18.array(PluginCardContribution2).optional(),
4973
+ uriModules: z18.array(AppUriModuleContribution2).optional(),
4974
+ dataSources: z18.array(AppDataSourceContribution2).optional(),
4975
+ whiteboardTypes: z18.array(WhiteboardTypeContribution2).optional(),
4976
+ approvalTypes: z18.array(ApprovalTypeContribution2).optional(),
4977
+ workflows: z18.array(WorkflowContribution2).optional(),
4978
+ eventDefinitions: z18.array(PluginEventDefinitionContribution2).optional(),
4822
4979
  // Default notification rules over this plugin's own `eventDefinitions`; seeded by the host
4823
4980
  // (see `PluginNotificationRuleContribution`).
4824
- notificationRules: z16.array(PluginNotificationRuleContribution2).optional(),
4825
- productEvents: z16.array(PluginProductEventContribution2).optional(),
4826
- eventSubscriptions: z16.array(AppEventSubscription2).optional(),
4827
- deviceDelegations: z16.array(DeviceDelegationContribution2).optional(),
4828
- sessionReaders: z16.array(SessionReaderContribution2).optional(),
4829
- contextContributors: z16.array(ContextContributorContribution2).optional(),
4981
+ notificationRules: z18.array(PluginNotificationRuleContribution2).optional(),
4982
+ productEvents: z18.array(PluginProductEventContribution2).optional(),
4983
+ eventSubscriptions: z18.array(AppEventSubscription2).optional(),
4984
+ deviceDelegations: z18.array(DeviceDelegationContribution2).optional(),
4985
+ sessionReaders: z18.array(SessionReaderContribution2).optional(),
4986
+ contextContributors: z18.array(ContextContributorContribution2).optional(),
4830
4987
  // Vendored MCP servers this plugin ships (see `McpServerContributions`). Each is hosted only
4831
4988
  // for a plugin holding `mcp.host-server` for its name and URL; that is decided at
4832
4989
  // composition, not here (see ARCHITECTURE.md "Validation Law").
4833
4990
  mcpServers: McpServerContributions2.optional(),
4834
4991
  // Handler restricted to endpoint-only by the manifest-level refinement below.
4835
- commands: z16.array(CommandContribution2).optional()
4992
+ commands: z18.array(CommandContribution2).optional()
4836
4993
  }).optional()
4837
4994
  });
4838
- const KayUiTargetManifest2 = z16.strictObject({
4995
+ const KayUiTargetManifest2 = z18.strictObject({
4839
4996
  entrypoint: TargetEntrypoint2.extend({
4840
- format: z16.literal("compiled-bundle").optional()
4997
+ format: z18.literal("compiled-bundle").optional()
4841
4998
  }).optional(),
4842
- contributes: z16.strictObject({
4843
- commands: z16.array(UiCommandContribution2).optional(),
4844
- slots: z16.array(UiSlotContribution2).optional(),
4845
- referencePresentations: z16.array(ReferencePresentationContribution2).optional(),
4846
- apps: z16.array(UiAppContribution2).optional(),
4847
- railEntries: z16.array(UiRailEntryContribution2).optional(),
4848
- toastPreviews: z16.array(UiToastPreviewContribution2).optional(),
4849
- pages: z16.array(UiPageContribution2).optional(),
4850
- themes: z16.array(ThemeContribution2).optional(),
4851
- eventSubscriptions: z16.array(UiEventSubscriptionContribution2).optional(),
4852
- dataMaterializers: z16.array(AppDataMaterializerContribution2).optional()
4999
+ contributes: z18.strictObject({
5000
+ commands: z18.array(UiCommandContribution2).optional(),
5001
+ slots: z18.array(UiSlotContribution2).optional(),
5002
+ referencePresentations: z18.array(ReferencePresentationContribution2).optional(),
5003
+ apps: z18.array(UiAppContribution2).optional(),
5004
+ railEntries: z18.array(UiRailEntryContribution2).optional(),
5005
+ toastPreviews: z18.array(UiToastPreviewContribution2).optional(),
5006
+ pages: z18.array(UiPageContribution2).optional(),
5007
+ themes: z18.array(ThemeContribution2).optional(),
5008
+ eventSubscriptions: z18.array(UiEventSubscriptionContribution2).optional(),
5009
+ dataMaterializers: z18.array(AppDataMaterializerContribution2).optional()
4853
5010
  }).optional()
4854
5011
  });
4855
- const PluginConfigScope2 = z16.enum(["global", "project", "agent"]);
4856
- const PluginConfigSectionManifest2 = z16.strictObject({
5012
+ const PluginConfigScope2 = z18.enum(["global", "project", "agent"]);
5013
+ const PluginConfigSectionManifest2 = z18.strictObject({
4857
5014
  section: NonEmptyString3.optional(),
4858
5015
  schema: JsonSchema,
4859
5016
  /**
@@ -4871,23 +5028,23 @@ function createManifestSchemas(canonical) {
4871
5028
  * is the baseline every section has; `agent` has no runtime mapping (the
4872
5029
  * agent/entity fold is downstream of the document protocol).
4873
5030
  */
4874
- scopes: z16.array(PluginConfigScope2).optional()
5031
+ scopes: z18.array(PluginConfigScope2).optional()
4875
5032
  });
4876
- const PluginConfigManifest2 = z16.array(PluginConfigSectionManifest2).min(1);
4877
- const PluginStorageManifest2 = z16.strictObject({
4878
- sqlite: z16.strictObject({
4879
- enabled: z16.boolean(),
4880
- ownerTarget: z16.literal("kay.app").optional(),
5033
+ const PluginConfigManifest2 = z18.array(PluginConfigSectionManifest2).min(1);
5034
+ const PluginStorageManifest2 = z18.strictObject({
5035
+ sqlite: z18.strictObject({
5036
+ enabled: z18.boolean(),
5037
+ ownerTarget: z18.literal("kay.app").optional(),
4881
5038
  migrations: NonEmptyString3.optional()
4882
5039
  }).optional(),
4883
- dataDir: z16.strictObject({
4884
- enabled: z16.boolean(),
4885
- ownerTarget: z16.literal("kay.app").optional(),
5040
+ dataDir: z18.strictObject({
5041
+ enabled: z18.boolean(),
5042
+ ownerTarget: z18.literal("kay.app").optional(),
4886
5043
  sharedWith: PluginId2.optional()
4887
5044
  }).optional()
4888
5045
  });
4889
- const PluginOAuthClientSupplier2 = z16.enum(["kay", "user"]);
4890
- const PluginProvisioningProbe2 = z16.strictObject({
5046
+ const PluginOAuthClientSupplier2 = z18.enum(["kay", "user"]);
5047
+ const PluginProvisioningProbe2 = z18.strictObject({
4891
5048
  /**
4892
5049
  * The API endpoint that answers the question. The host sends the service's OWN credential here,
4893
5050
  * so this must belong to the provider that minted it - enforced by the daemon against the
@@ -4895,13 +5052,13 @@ function createManifestSchemas(canonical) {
4895
5052
  */
4896
5053
  url: HttpsUrl2,
4897
5054
  /** Absent => `GET`. */
4898
- method: z16.enum(["GET"]).optional(),
5055
+ method: z18.enum(["GET"]).optional(),
4899
5056
  /**
4900
5057
  * The statuses that make the response a VERDICT at all. Anything else (a 401 from a stale
4901
5058
  * token, a 5xx, a rate limit) means the probe learned nothing and reports `unknown` - never
4902
5059
  * `unsatisfied`, which would tell a user to go fix setup that is fine.
4903
5060
  */
4904
- verdictStatuses: z16.array(SignedInStatusCode2).min(1),
5061
+ verdictStatuses: z18.array(SignedInStatusCode2).min(1),
4905
5062
  /**
4906
5063
  * Dot-path to a JSON array in the response body that must be NON-EMPTY for the requirement to
4907
5064
  * count as satisfied (e.g. `installations`). Absent means a verdict status alone is enough.
@@ -4910,7 +5067,7 @@ function createManifestSchemas(canonical) {
4910
5067
  */
4911
5068
  nonEmptyArrayAt: NonEmptyString3.optional()
4912
5069
  });
4913
- const PluginProvisioningRequirement2 = z16.strictObject({
5070
+ const PluginProvisioningRequirement2 = z18.strictObject({
4914
5071
  /** Stable id, unique within the scheme. */
4915
5072
  id: LocalContributionId2,
4916
5073
  /** Human-facing requirement name, e.g. "GitHub App installation". */
@@ -4927,7 +5084,7 @@ function createManifestSchemas(canonical) {
4927
5084
  probe: PluginProvisioningProbe2
4928
5085
  });
4929
5086
  const PluginProvisioningField = {
4930
- provisioning: z16.array(PluginProvisioningRequirement2).optional()
5087
+ provisioning: z18.array(PluginProvisioningRequirement2).optional()
4931
5088
  };
4932
5089
  const PluginAuthSchemeDescriptionFields = {
4933
5090
  /** Human-facing flow name; absent, the service's name stands in. */
@@ -4943,17 +5100,21 @@ function createManifestSchemas(canonical) {
4943
5100
  const PluginAuthSchemeOAuthEndpointFields = {
4944
5101
  authorizationUrl: HttpsUrl2,
4945
5102
  tokenUrl: HttpsUrl2,
5103
+ /** Initial connect scopes; absent uses `scopes`, while an empty array requests none. */
5104
+ connectScopes: z18.array(NonEmptyString3).optional(),
4946
5105
  /** Provider-specific query parameters added to the authorize URL. */
4947
- extraAuthorizeParams: z16.record(NonEmptyString3, z16.string()).optional()
5106
+ extraAuthorizeParams: z18.record(NonEmptyString3, z18.string()).optional(),
5107
+ /** Additional authorization parameters when this service already holds an account. */
5108
+ extraAuthorizeParamsWhenAccountHeld: z18.record(NonEmptyString3, z18.string()).optional()
4948
5109
  };
4949
- const PluginAuthSchemeAccountLookup = z16.literal("lookup");
4950
- const PluginAuthSchemeOAuthPkce = z16.strictObject({
5110
+ const PluginAuthSchemeAccountLookup = z18.literal("lookup");
5111
+ const PluginAuthSchemeOAuthPkce = z18.strictObject({
4951
5112
  ...PluginProvisioningField,
4952
5113
  ...PluginAuthSchemeDescriptionFields,
4953
5114
  ...PluginAuthSchemeOAuthEndpointFields,
4954
5115
  localId: LocalContributionId2,
4955
- kind: z16.literal("oauth2"),
4956
- exchange: z16.literal("pkce"),
5116
+ kind: z18.literal("oauth2"),
5117
+ exchange: z18.literal("pkce"),
4957
5118
  byoocProfile: PluginByoocProfile.optional(),
4958
5119
  /**
4959
5120
  * A public client id the plugin ships for its own sign-in. Only an installed plugin's is used:
@@ -4977,7 +5138,7 @@ function createManifestSchemas(canonical) {
4977
5138
  * runs on an untrusted manifest, so a hand-built `["kay","kay"]` must be refused here, not
4978
5139
  * silently normalized).
4979
5140
  */
4980
- clientSuppliers: z16.array(PluginOAuthClientSupplier2).nonempty().superRefine((suppliers, ctx) => {
5141
+ clientSuppliers: z18.array(PluginOAuthClientSupplier2).nonempty().superRefine((suppliers, ctx) => {
4981
5142
  if (new Set(suppliers).size !== suppliers.length) {
4982
5143
  ctx.addIssue({
4983
5144
  code: "custom",
@@ -4985,7 +5146,7 @@ function createManifestSchemas(canonical) {
4985
5146
  });
4986
5147
  }
4987
5148
  }),
4988
- scopes: z16.array(NonEmptyString3).optional()
5149
+ scopes: z18.array(NonEmptyString3).optional()
4989
5150
  }).refine((scheme) => scheme.byoocProfile === void 0 || scheme.clientSuppliers.includes("user"), {
4990
5151
  message: "An own-client profile requires the user client supplier.",
4991
5152
  path: ["byoocProfile"]
@@ -4996,33 +5157,33 @@ function createManifestSchemas(canonical) {
4996
5157
  message: "a scheme with its own clientId names where its account comes from (`account`)",
4997
5158
  path: ["account"]
4998
5159
  });
4999
- const PluginAuthSchemeOAuthConfidential = z16.strictObject({
5160
+ const PluginAuthSchemeOAuthConfidential = z18.strictObject({
5000
5161
  ...PluginProvisioningField,
5001
5162
  ...PluginAuthSchemeDescriptionFields,
5002
5163
  ...PluginAuthSchemeOAuthEndpointFields,
5003
5164
  localId: LocalContributionId2,
5004
- kind: z16.literal("oauth2"),
5005
- exchange: z16.literal("confidential"),
5165
+ kind: z18.literal("oauth2"),
5166
+ exchange: z18.literal("confidential"),
5006
5167
  /** Absent means `["kay"]` - a confidential exchange's secret may only ever be Bonsai's. */
5007
- clientSuppliers: z16.tuple([z16.literal("kay")]).optional(),
5008
- scopes: z16.array(NonEmptyString3).optional(),
5168
+ clientSuppliers: z18.tuple([z18.literal("kay")]).optional(),
5169
+ scopes: z18.array(NonEmptyString3).optional(),
5009
5170
  /** Where the account comes from (see {@link PluginAuthSchemeAccountLookup}). */
5010
- account: z16.union([PluginAuthSchemeAccountLookup, z16.literal("sign-in")])
5171
+ account: z18.union([PluginAuthSchemeAccountLookup, z18.literal("sign-in")])
5011
5172
  });
5012
- const PluginAuthSchemeOAuth2 = z16.discriminatedUnion("exchange", [
5173
+ const PluginAuthSchemeOAuth2 = z18.discriminatedUnion("exchange", [
5013
5174
  PluginAuthSchemeOAuthPkce,
5014
5175
  PluginAuthSchemeOAuthConfidential
5015
5176
  ]);
5016
- const PluginAuthSchemeApiKey = z16.strictObject({
5177
+ const PluginAuthSchemeApiKey = z18.strictObject({
5017
5178
  ...PluginProvisioningField,
5018
5179
  ...PluginAuthSchemeDescriptionFields,
5019
5180
  localId: LocalContributionId2,
5020
- kind: z16.literal("api-key"),
5021
- scopes: z16.array(NonEmptyString3).optional(),
5181
+ kind: z18.literal("api-key"),
5182
+ scopes: z18.array(NonEmptyString3).optional(),
5022
5183
  /** The connect prompt's label for the key. Absent: "<service name> API key". */
5023
5184
  inputLabel: NonEmptyString3.optional(),
5024
5185
  /** Two or more labeled inputs for a secret that comes in parts; absent asks for one key. */
5025
- fields: z16.array(z16.strictObject({ id: LocalContributionId2, label: NonEmptyString3 })).min(2).superRefine((fields, ctx) => {
5186
+ fields: z18.array(z18.strictObject({ id: LocalContributionId2, label: NonEmptyString3 })).min(2).superRefine((fields, ctx) => {
5026
5187
  if (new Set(fields.map((field) => field.id)).size !== fields.length) {
5027
5188
  ctx.addIssue({
5028
5189
  code: "custom",
@@ -5031,7 +5192,7 @@ function createManifestSchemas(canonical) {
5031
5192
  }
5032
5193
  }).optional(),
5033
5194
  /** Where and how the person creates the key outside Bonsai. */
5034
- setup: z16.strictObject({ instructions: NonEmptyString3, url: HttpsUrl2 }).optional(),
5195
+ setup: z18.strictObject({ instructions: NonEmptyString3, url: HttpsUrl2 }).optional(),
5035
5196
  /**
5036
5197
  * `"lookup"`: the plugin checks a key before it is saved and names its account, with the function
5037
5198
  * it registers (`api.auth.registerAccountLookup`). Absent: the key is saved unchecked, under the
@@ -5039,27 +5200,27 @@ function createManifestSchemas(canonical) {
5039
5200
  */
5040
5201
  account: PluginAuthSchemeAccountLookup.optional()
5041
5202
  });
5042
- const PluginAuthSchemeDelegated = z16.strictObject({
5203
+ const PluginAuthSchemeDelegated = z18.strictObject({
5043
5204
  ...PluginAuthSchemeDescriptionFields,
5044
5205
  localId: LocalContributionId2,
5045
- kind: z16.literal("delegated"),
5046
- scopes: z16.array(NonEmptyString3).optional()
5206
+ kind: z18.literal("delegated"),
5207
+ scopes: z18.array(NonEmptyString3).optional()
5047
5208
  });
5048
- const ExternalCliArgument = z16.string().min(1).max(16384).refine((value) => ![...value].some(isUnsafeArgumentCharacter), {
5209
+ const ExternalCliArgument = z18.string().min(1).max(16384).refine((value) => ![...value].some(isUnsafeArgumentCharacter), {
5049
5210
  message: "an argument may hold tabs and line breaks, but no other control character, no invisible character and no bidirectional override"
5050
5211
  });
5051
- const ExternalCliCommand = z16.string().max(128).regex(/^[A-Za-z0-9][A-Za-z0-9._+-]*$/, {
5212
+ const ExternalCliCommand = z18.string().max(128).regex(/^[A-Za-z0-9][A-Za-z0-9._+-]*$/, {
5052
5213
  message: "a command is an executable's basename (letters, digits, '.', '_', '+', '-'), never a path"
5053
5214
  });
5054
5215
  const ExternalCliHint = NonEmptyString3.max(2048);
5055
- const ExternalCliArguments = z16.array(ExternalCliArgument).max(64);
5216
+ const ExternalCliArguments = z18.array(ExternalCliArgument).max(64);
5056
5217
  const SignedOutMarker = ExternalCliArgument.refine((value) => value.trim() !== "", { message: "a signed-out marker needs text beyond whitespace" });
5057
- const PluginExternalCliConnect2 = z16.strictObject({
5218
+ const PluginExternalCliConnect2 = z18.strictObject({
5058
5219
  /** A basename the host finds on `PATH` (`osascript`, `wrangler`), never a path. */
5059
5220
  binary: ExternalCliCommand,
5060
- probe: z16.strictObject({
5221
+ probe: z18.strictObject({
5061
5222
  args: ExternalCliArguments.min(1),
5062
- timeoutMs: z16.number().int().min(1).max(12e4).optional(),
5223
+ timeoutMs: z18.number().int().min(1).max(12e4).optional(),
5063
5224
  /**
5064
5225
  * The CLI's own signed-out marker: text a failed probe's output (stderr, else stdout) contains
5065
5226
  * when the CLI is signed out. A failure that carries it is a sign-in problem, and only such a
@@ -5067,13 +5228,13 @@ function createManifestSchemas(canonical) {
5067
5228
  * unavailable. Required when `login` is declared, so a timeout never starts a sign-in. A list
5068
5229
  * is for a CLI with several signed-out messages; any one of them counts.
5069
5230
  */
5070
- signedOutMarker: z16.union([SignedOutMarker, z16.array(SignedOutMarker).min(1)]).optional()
5231
+ signedOutMarker: z18.union([SignedOutMarker, z18.array(SignedOutMarker).min(1)]).optional()
5071
5232
  }),
5072
5233
  /** The CLI's interactive sign-in. Absent: connect only probes and reports. */
5073
- login: z16.strictObject({
5234
+ login: z18.strictObject({
5074
5235
  args: ExternalCliArguments.min(1),
5075
- timeoutMs: z16.number().int().min(1).max(6e5).optional(),
5076
- pasteCode: z16.strictObject({
5236
+ timeoutMs: z18.number().int().min(1).max(6e5).optional(),
5237
+ pasteCode: z18.strictObject({
5077
5238
  /** The redeeming argv; the host appends the code as its last argument. */
5078
5239
  args: ExternalCliArguments.min(1),
5079
5240
  /** What the prompt says, for a person. */
@@ -5085,12 +5246,12 @@ function createManifestSchemas(canonical) {
5085
5246
  * for display, or hands it to an agent session that runs it behind the ordinary bash approval.
5086
5247
  * Absent for a binary the OS ships (`osascript`).
5087
5248
  */
5088
- install: z16.strictObject({
5249
+ install: z18.strictObject({
5089
5250
  command: ExternalCliCommand,
5090
5251
  args: ExternalCliArguments
5091
5252
  }).optional(),
5092
5253
  /** Prose for a person: `install` when the binary is missing, `login` when the probe fails. */
5093
- hints: z16.strictObject({
5254
+ hints: z18.strictObject({
5094
5255
  install: ExternalCliHint,
5095
5256
  login: ExternalCliHint
5096
5257
  })
@@ -5103,50 +5264,50 @@ function createManifestSchemas(canonical) {
5103
5264
  });
5104
5265
  }
5105
5266
  });
5106
- const PluginAuthSchemeExternalCli = z16.strictObject({
5267
+ const PluginAuthSchemeExternalCli = z18.strictObject({
5107
5268
  ...PluginAuthSchemeDescriptionFields,
5108
5269
  localId: LocalContributionId2,
5109
- kind: z16.literal("external-cli"),
5110
- scopes: z16.array(NonEmptyString3).optional(),
5270
+ kind: z18.literal("external-cli"),
5271
+ scopes: z18.array(NonEmptyString3).optional(),
5111
5272
  cli: PluginExternalCliConnect2.optional()
5112
5273
  });
5113
- const PluginAuthScheme2 = z16.discriminatedUnion("kind", [
5274
+ const PluginAuthScheme2 = z18.discriminatedUnion("kind", [
5114
5275
  PluginAuthSchemeOAuth2,
5115
5276
  PluginAuthSchemeApiKey,
5116
5277
  PluginAuthSchemeDelegated,
5117
5278
  PluginAuthSchemeExternalCli
5118
5279
  ]);
5119
- const PluginWebSessionProbe2 = z16.strictObject({
5280
+ const PluginWebSessionProbe2 = z18.strictObject({
5120
5281
  url: HttpsUrl2,
5121
5282
  /** Absent => `GET`. `POST` sends an empty JSON object body. */
5122
- method: z16.enum(["GET", "POST"]).optional(),
5123
- signedInStatuses: z16.array(SignedInStatusCode2).min(1)
5283
+ method: z18.enum(["GET", "POST"]).optional(),
5284
+ signedInStatuses: z18.array(SignedInStatusCode2).min(1)
5124
5285
  });
5125
- const PluginWebSessionDeclaration2 = z16.strictObject({
5286
+ const PluginWebSessionDeclaration2 = z18.strictObject({
5126
5287
  /** `required`: capabilities degrade without the site login; `recommended`: it only smooths UX. */
5127
- importance: z16.enum(["required", "recommended"]),
5288
+ importance: z18.enum(["required", "recommended"]),
5128
5289
  loginUrl: HttpsUrl2,
5129
- cookieDomains: z16.array(RegistrableDomain2).min(1),
5290
+ cookieDomains: z18.array(RegistrableDomain2).min(1),
5130
5291
  probe: PluginWebSessionProbe2,
5131
- oauthVenue: z16.enum(["embedded", "external"]),
5292
+ oauthVenue: z18.enum(["embedded", "external"]),
5132
5293
  /**
5133
5294
  * Where a page goes first when it opens in one of Bonsai's browser panes and this site login
5134
5295
  * is missing: a sign-in page that continues to the page. A template with `:email` and `:url`
5135
5296
  * (see `UriClaimTemplate`), on a host within `cookieDomains`.
5136
5297
  */
5137
- signInFirst: z16.string().optional()
5298
+ signInFirst: z18.string().optional()
5138
5299
  }).superRefine(refineWebSessionScopeConfined);
5139
- const PluginAuthService2 = z16.strictObject({
5300
+ const PluginAuthService2 = z18.strictObject({
5140
5301
  localId: LocalContributionId2,
5141
5302
  displayName: NonEmptyString3,
5142
5303
  /** One plain sentence on what connecting this service gives Bonsai. */
5143
5304
  summary: NonEmptyString3.optional(),
5144
- schemes: z16.array(PluginAuthScheme2).min(1),
5145
- purposes: z16.array(NonEmptyString3).min(1),
5305
+ schemes: z18.array(PluginAuthScheme2).min(1),
5306
+ purposes: z18.array(NonEmptyString3).min(1),
5146
5307
  webSession: PluginWebSessionDeclaration2.optional()
5147
5308
  });
5148
- const PluginAuthManifest2 = z16.strictObject({
5149
- services: z16.array(PluginAuthService2).optional()
5309
+ const PluginAuthManifest2 = z18.strictObject({
5310
+ services: z18.array(PluginAuthService2).optional()
5150
5311
  });
5151
5312
  function stripRetiredCompatibilityKeys(value) {
5152
5313
  if (typeof value !== "object" || value === null || Array.isArray(value)) {
@@ -5157,17 +5318,17 @@ function createManifestSchemas(canonical) {
5157
5318
  delete remaining[key];
5158
5319
  return remaining;
5159
5320
  }
5160
- const PluginCompatibilityFields = z16.strictObject({
5161
- supportedProtocols: z16.array(KayPluginProtocolVersion).optional(),
5321
+ const PluginCompatibilityFields = z18.strictObject({
5322
+ supportedProtocols: z18.array(KayPluginProtocolVersion).optional(),
5162
5323
  minKayVersion: NonEmptyString3.optional(),
5163
5324
  sdk: NonEmptyString3.optional()
5164
5325
  });
5165
- const PluginCompatibilityManifest2 = canonical ? PluginCompatibilityFields : z16.preprocess(stripRetiredCompatibilityKeys, PluginCompatibilityFields);
5326
+ const PluginCompatibilityManifest2 = canonical ? PluginCompatibilityFields : z18.preprocess(stripRetiredCompatibilityKeys, PluginCompatibilityFields);
5166
5327
  const KayVersionString2 = NonEmptyString3.regex(SEMVER_PATTERN, {
5167
5328
  message: "version must be semver, for example 1.2.3"
5168
5329
  });
5169
- const KayPluginManifestV12 = z16.strictObject({
5170
- protocol: z16.literal(KAY_PLUGIN_PROTOCOL_VERSION),
5330
+ const KayPluginManifestV12 = z18.strictObject({
5331
+ protocol: z18.literal(KAY_PLUGIN_PROTOCOL_VERSION),
5171
5332
  id: PluginId2,
5172
5333
  displayName: NonEmptyString3,
5173
5334
  version: KayVersionString2,
@@ -5195,8 +5356,8 @@ function createManifestSchemas(canonical) {
5195
5356
  icon: PackageAssetPath2.optional(),
5196
5357
  iconDark: PackageAssetPath2.optional(),
5197
5358
  namespace: PluginNamespace2.optional(),
5198
- targets: z16.strictObject({
5199
- kay: z16.strictObject({
5359
+ targets: z18.strictObject({
5360
+ kay: z18.strictObject({
5200
5361
  agent: KayAgentTargetManifest2.optional(),
5201
5362
  app: KayAppTargetManifest2.optional(),
5202
5363
  ui: KayUiTargetManifest2.optional()
@@ -5204,8 +5365,9 @@ function createManifestSchemas(canonical) {
5204
5365
  }).optional(),
5205
5366
  config: PluginConfigManifest2.optional(),
5206
5367
  storage: PluginStorageManifest2.optional(),
5207
- workloadPurposes: z16.array(PluginWorkloadPurpose).optional(),
5208
- shellCommands: z16.array(PluginShellCommand).optional(),
5368
+ workloadPurposes: z18.array(PluginWorkloadPurpose).optional(),
5369
+ shellCommands: z18.array(PluginShellCommand).optional(),
5370
+ projectDirectories: PluginProjectDirectories.optional(),
5209
5371
  auth: PluginAuthManifest2.optional(),
5210
5372
  permissions: PluginPermissionManifest2.optional(),
5211
5373
  compatibility: PluginCompatibilityManifest2.optional(),
@@ -5215,15 +5377,15 @@ function createManifestSchemas(canonical) {
5215
5377
  * schemes then report `ownedByBonsai`. Honoured only for a plugin that ships with Bonsai: the
5216
5378
  * host reads any other plugin's flag as false. Absent => false.
5217
5379
  */
5218
- ownedByBonsai: z16.boolean().optional(),
5380
+ ownedByBonsai: z18.boolean().optional(),
5219
5381
  /**
5220
5382
  * Explicit plugin-level dependencies - other plugins this plugin requires to be present in the
5221
5383
  * composed roster. At composition time the runtime checks each id against the accepted
5222
5384
  * registration list and derives a provenance-complete dependency graph (together with implicit
5223
5385
  * auth-service edges from `consumesAuthServices`). Absent => no explicit dependencies.
5224
5386
  */
5225
- dependencies: z16.strictObject({
5226
- plugins: z16.array(PluginId2).optional()
5387
+ dependencies: z18.strictObject({
5388
+ plugins: z18.array(PluginId2).optional()
5227
5389
  }).optional()
5228
5390
  }).superRefine((manifest, ctx) => {
5229
5391
  const sharedWith = manifest.storage?.dataDir?.sharedWith;
@@ -5484,6 +5646,105 @@ function createManifestSchemas(canonical) {
5484
5646
  ...(manifest.targets?.kay?.ui?.contributes?.pages ?? []).map((page) => page.id),
5485
5647
  ...(manifest.targets?.kay?.ui?.contributes?.railEntries ?? []).map((entry) => entry.page)
5486
5648
  ]);
5649
+ const pageAliases = /* @__PURE__ */ new Set();
5650
+ for (const [index, page] of (manifest.targets?.kay?.ui?.contributes?.pages ?? []).entries()) {
5651
+ for (const alias of page.aliases ?? []) {
5652
+ if (declaredPageIds.has(alias) || pageAliases.has(alias)) {
5653
+ ctx.addIssue({
5654
+ code: "custom",
5655
+ path: [
5656
+ "targets",
5657
+ "kay",
5658
+ "ui",
5659
+ "contributes",
5660
+ "pages",
5661
+ index,
5662
+ "aliases"
5663
+ ],
5664
+ message: `Page alias ${alias} conflicts with a declared page or alias.`
5665
+ });
5666
+ }
5667
+ pageAliases.add(alias);
5668
+ }
5669
+ }
5670
+ const types = manifest.targets?.kay?.app?.contributes?.whiteboardTypes ?? [];
5671
+ if (types.filter((type) => type.handover === true).length > 1) {
5672
+ ctx.addIssue({
5673
+ code: "custom",
5674
+ path: ["targets", "kay", "app", "contributes", "whiteboardTypes"],
5675
+ message: "A plugin may declare only one handover type."
5676
+ });
5677
+ }
5678
+ const servedSchemes = new Set([
5679
+ ...manifest.targets?.kay?.agent?.contributes?.uriModules ?? [],
5680
+ ...manifest.targets?.kay?.app?.contributes?.uriModules ?? []
5681
+ ].flatMap((module) => module.schemes));
5682
+ if (manifest.projectDirectories !== void 0) {
5683
+ if (!endpointIds.has(manifest.projectDirectories.endpoint)) {
5684
+ ctx.addIssue({
5685
+ code: "custom",
5686
+ path: ["projectDirectories", "endpoint"],
5687
+ message: "Project directories must name an endpoint declared by this plugin's app target."
5688
+ });
5689
+ }
5690
+ if (!servedSchemes.has(manifest.projectDirectories.scheme)) {
5691
+ ctx.addIssue({
5692
+ code: "custom",
5693
+ path: ["projectDirectories", "scheme"],
5694
+ message: "Project directories must name a scheme this plugin serves."
5695
+ });
5696
+ }
5697
+ }
5698
+ for (const [index, type] of types.entries()) {
5699
+ if ((type.directory !== void 0 || type.handover === true) && manifest.targets?.kay?.agent?.familyFolder?.scope !== "root") {
5700
+ ctx.addIssue({
5701
+ code: "custom",
5702
+ path: [
5703
+ "targets",
5704
+ "kay",
5705
+ "app",
5706
+ "contributes",
5707
+ "whiteboardTypes",
5708
+ index,
5709
+ "directory"
5710
+ ],
5711
+ message: "A root content directory requires a declared family-folder root role."
5712
+ });
5713
+ }
5714
+ const scheme = type.reference?.uriTemplate.split(":", 1)[0];
5715
+ if (scheme !== void 0 && !servedSchemes.has(scheme)) {
5716
+ ctx.addIssue({
5717
+ code: "custom",
5718
+ path: [
5719
+ "targets",
5720
+ "kay",
5721
+ "app",
5722
+ "contributes",
5723
+ "whiteboardTypes",
5724
+ index,
5725
+ "reference"
5726
+ ],
5727
+ message: "A content reference must use a scheme this plugin serves."
5728
+ });
5729
+ }
5730
+ }
5731
+ for (const [index, source] of (manifest.targets?.kay?.app?.contributes?.dataSources ?? []).entries()) {
5732
+ if (source.messageDraft?.schemes.some((scheme) => !servedSchemes.has(scheme))) {
5733
+ ctx.addIssue({
5734
+ code: "custom",
5735
+ path: [
5736
+ "targets",
5737
+ "kay",
5738
+ "app",
5739
+ "contributes",
5740
+ "dataSources",
5741
+ index,
5742
+ "messageDraft"
5743
+ ],
5744
+ message: "A message draft projection must use schemes this plugin serves."
5745
+ });
5746
+ }
5747
+ }
5487
5748
  for (const [index, presentation] of (manifest.targets?.kay?.ui?.contributes?.referencePresentations ?? []).entries()) {
5488
5749
  const path = [
5489
5750
  "targets",
@@ -6018,15 +6279,21 @@ function createManifestSchemas(canonical) {
6018
6279
  });
6019
6280
  }
6020
6281
  }
6021
- for (const [appIndex, app] of (manifest.targets?.kay?.ui?.contributes?.apps ?? []).entries()) {
6282
+ const endpointSurfaces = (manifest.targets?.kay?.ui?.contributes?.apps ?? []).map((app, index) => ({
6283
+ id: app.localId,
6284
+ kind: "apps",
6285
+ index,
6286
+ capabilities: app.capabilities
6287
+ }));
6288
+ for (const app of endpointSurfaces) {
6022
6289
  for (const [endpointIndex, endpoint] of (app.capabilities?.endpoints ?? []).entries()) {
6023
6290
  const path = [
6024
6291
  "targets",
6025
6292
  "kay",
6026
6293
  "ui",
6027
6294
  "contributes",
6028
- "apps",
6029
- appIndex,
6295
+ app.kind,
6296
+ app.index,
6030
6297
  "capabilities",
6031
6298
  "endpoints",
6032
6299
  endpointIndex
@@ -6037,13 +6304,13 @@ function createManifestSchemas(canonical) {
6037
6304
  ctx.addIssue({
6038
6305
  code: "custom",
6039
6306
  path,
6040
- message: `ui app ${app.localId} references unknown endpoint ${endpoint}`
6307
+ message: `ui app ${app.id} references unknown endpoint ${endpoint}`
6041
6308
  });
6042
6309
  } else if (!invokedUiEndpoints.has(endpoint)) {
6043
6310
  ctx.addIssue({
6044
6311
  code: "custom",
6045
6312
  path,
6046
- message: `ui app ${app.localId} endpoint ${endpoint} requires a kay.ui invoke grant`
6313
+ message: `ui app ${app.id} endpoint ${endpoint} requires a kay.ui invoke grant`
6047
6314
  });
6048
6315
  }
6049
6316
  }
@@ -6333,7 +6600,7 @@ function pushContributionIds(output, path, items) {
6333
6600
  }
6334
6601
 
6335
6602
  // packages/plugin-protocol/dist/plugin-directory-verdict.js
6336
- import { z as z18 } from "zod";
6603
+ import { z as z20 } from "zod";
6337
6604
 
6338
6605
  // packages/plugin-protocol/dist/plugin-load-diagnostic.js
6339
6606
  var PLUGIN_DIAGNOSTIC_MESSAGE_CAP = 300;
@@ -6342,14 +6609,14 @@ function boundPluginDiagnosticMessage(message) {
6342
6609
  }
6343
6610
 
6344
6611
  // packages/plugin-protocol/dist/resolved-contract.js
6345
- import { z as z17 } from "zod";
6612
+ import { z as z19 } from "zod";
6346
6613
  function createResolvedContractSchemas(canonical) {
6347
6614
  const { PluginEventLocalId: PluginEventLocalId2 } = canonical ? canonicalPluginEventSchemas : plugin_events_exports;
6348
- const { ApprovalTypeContribution: ApprovalTypeContribution2, KayUiAppHostCapability: KayUiAppHostCapability2, McpServerAuthMode: McpServerAuthMode2, McpServerUrl: McpServerUrl2, PluginContributionKind: PluginContributionKindSchema, ReferenceOpenBehavior: ReferenceOpenBehavior2, ReferencePresentationUriPattern: ReferencePresentationUriPattern2, ReferencePresentationAccountLinks: ReferencePresentationAccountLinks2, ReferencePresentationAddress: ReferencePresentationAddress2, ReferencePresentationUrlClaim: ReferencePresentationUrlClaim2, ReferencePresentationVariants: ReferencePresentationVariants2, ReferencePresentationWords: ReferencePresentationWords2, UriModuleFacts: UriModuleFacts2, WhiteboardTypeStorage: WhiteboardTypeStorage2 } = canonical ? canonicalContributionSchemas : contributions_exports;
6615
+ const { ApprovalTypeContribution: ApprovalTypeContribution2, KayUiAppHostCapability: KayUiAppHostCapability2, McpServerAuthMode: McpServerAuthMode2, McpServerUrl: McpServerUrl2, PluginContributionKind: PluginContributionKindSchema, ReferenceOpenBehavior: ReferenceOpenBehavior2, ReferencePresentationUriPattern: ReferencePresentationUriPattern2, ReferencePresentationAccountLinks: ReferencePresentationAccountLinks2, ReferencePresentationAddress: ReferencePresentationAddress2, ReferencePresentationUrlClaim: ReferencePresentationUrlClaim2, ReferencePresentationVariants: ReferencePresentationVariants2, ReferencePresentationWords: ReferencePresentationWords2, UriModuleFacts: UriModuleFacts2, WhiteboardTypeContribution: WhiteboardTypeContribution2 } = canonical ? canonicalContributionSchemas : contributions_exports;
6349
6616
  const { FileExtensionToken: FileExtensionToken2, GitBasicAuthUser: GitBasicAuthUser2, GitHostName: GitHostName2, GlobalContributionId: GlobalContributionId2, HttpsUrl: HttpsUrl2, LocalContributionId: LocalContributionId2, MimeTypeString: MimeTypeString2, NonEmptyString: NonEmptyString3, PackageAssetPath: PackageAssetPath2, PluginId: PluginId2, PluginNamespace: PluginNamespace2, PluginToolName: PluginToolName2, RegistrableDomain: RegistrableDomain2, SignedInStatusCode: SignedInStatusCode2, TargetEntrypoint: TargetEntrypoint2, UriScheme: UriScheme2 } = canonical ? canonicalCommonSchemas : common_exports;
6350
6617
  const { PluginExternalCliConnect: PluginExternalCliConnect2, PluginOAuthClientSupplier: PluginOAuthClientSupplier2 } = canonical ? canonicalManifestSchemas : manifest_exports;
6351
6618
  const { ResolvedPluginGrants: ResolvedPluginGrants2 } = canonical ? canonicalPermissionSchemas : permissions_exports;
6352
- const ResolvedPluginContributionId2 = z17.strictObject({
6619
+ const ResolvedPluginContributionId2 = z19.strictObject({
6353
6620
  target: PluginTargetName,
6354
6621
  kind: PluginContributionKindSchema,
6355
6622
  localId: PluginEventLocalId2,
@@ -6363,54 +6630,55 @@ function createResolvedContractSchemas(canonical) {
6363
6630
  });
6364
6631
  }
6365
6632
  });
6366
- const ResolvedKayToolId = z17.strictObject({
6633
+ const ResolvedKayToolId = z19.strictObject({
6367
6634
  localId: LocalContributionId2,
6368
6635
  globalId: GlobalContributionId2,
6369
6636
  toolName: PluginToolName2
6370
6637
  });
6371
- const ResolvedKayAgentTool2 = z17.strictObject({
6638
+ const ResolvedKayAgentTool2 = z19.strictObject({
6372
6639
  ...ResolvedKayToolId.shape,
6373
6640
  displayName: NonEmptyString3.optional(),
6374
6641
  description: NonEmptyString3.optional(),
6375
6642
  parameters: JsonSchema.optional(),
6376
- executionMode: z17.enum(["sequential", "parallel"]).optional(),
6643
+ executionMode: z19.enum(["sequential", "parallel"]).optional(),
6377
6644
  promptSnippet: NonEmptyString3.optional(),
6378
- promptGuidelines: z17.array(NonEmptyString3).optional(),
6379
- requiresAuth: z17.strictObject({
6645
+ promptGuidelines: z19.array(NonEmptyString3).optional(),
6646
+ requiresAuth: z19.strictObject({
6380
6647
  serviceId: GlobalContributionId2,
6381
6648
  schemeId: GlobalContributionId2.optional()
6382
6649
  }).optional(),
6383
6650
  permission: canonical ? canonicalContributionSchemas.ToolPermission.optional() : ToolPermission.optional()
6384
6651
  });
6385
6652
  const ResolvedKayAppTool2 = ResolvedKayAgentTool2.omit({ requiresAuth: true });
6386
- const ResolvedKayAppDataSource2 = z17.strictObject({
6653
+ const ResolvedKayAppDataSource2 = z19.strictObject({
6387
6654
  localId: LocalContributionId2,
6388
6655
  globalId: GlobalContributionId2,
6389
- scope: z17.enum(["runtime", "account", "session"]),
6390
- snapshot: z17.strictObject({
6391
- version: z17.number().int().positive(),
6392
- schema: z17.record(z17.string(), z17.unknown())
6656
+ scope: z19.enum(["runtime", "account", "session"]),
6657
+ snapshot: z19.strictObject({
6658
+ version: z19.number().int().positive(),
6659
+ schema: z19.record(z19.string(), z19.unknown())
6393
6660
  }),
6394
- change: z17.strictObject({
6395
- version: z17.number().int().positive(),
6396
- schema: z17.record(z17.string(), z17.unknown()),
6397
- semantics: z17.discriminatedUnion("kind", [
6398
- z17.strictObject({ kind: z17.literal("incremental") }),
6399
- z17.strictObject({
6400
- kind: z17.literal("snapshot-replacement"),
6401
- maxEncodedBytes: z17.number().int().positive(),
6661
+ change: z19.strictObject({
6662
+ version: z19.number().int().positive(),
6663
+ schema: z19.record(z19.string(), z19.unknown()),
6664
+ semantics: z19.discriminatedUnion("kind", [
6665
+ z19.strictObject({ kind: z19.literal("incremental") }),
6666
+ z19.strictObject({
6667
+ kind: z19.literal("snapshot-replacement"),
6668
+ maxEncodedBytes: z19.number().int().positive(),
6402
6669
  rationale: pluginString(canonical).min(1).max(1024)
6403
6670
  })
6404
6671
  ]).optional()
6405
6672
  }),
6406
6673
  read: AppDataSourceRead.optional(),
6407
- store: z17.discriminatedUnion("shape", [
6408
- z17.strictObject({
6409
- shape: z17.literal("rows"),
6410
- rowsField: z17.string().min(1),
6411
- key: z17.array(z17.string().min(1)).min(1)
6674
+ messageDraft: z19.strictObject({ schemes: z19.array(UriScheme2).min(1) }).optional(),
6675
+ store: z19.discriminatedUnion("shape", [
6676
+ z19.strictObject({
6677
+ shape: z19.literal("rows"),
6678
+ rowsField: z19.string().min(1),
6679
+ key: z19.array(z19.string().min(1)).min(1)
6412
6680
  }),
6413
- z17.strictObject({ shape: z17.literal("value") })
6681
+ z19.strictObject({ shape: z19.literal("value") })
6414
6682
  ]).optional()
6415
6683
  }).superRefine((source, ctx) => {
6416
6684
  if (source.read !== void 0 && source.scope !== "session") {
@@ -6430,127 +6698,123 @@ function createResolvedContractSchemas(canonical) {
6430
6698
  /** The auth service that module signs in through, whose accounts a card may send from. */
6431
6699
  authService: GlobalContributionId2.optional()
6432
6700
  });
6433
- const ResolvedPluginCard2 = z17.strictObject({
6701
+ const ResolvedPluginCard2 = z19.strictObject({
6434
6702
  localId: LocalContributionId2,
6435
6703
  globalId: GlobalContributionId2,
6436
6704
  pluginId: PluginId2,
6437
6705
  description: NonEmptyString3,
6438
6706
  inputs: JsonSchema,
6439
- readEndpoint: z17.strictObject({
6707
+ readEndpoint: z19.strictObject({
6440
6708
  localId: LocalContributionId2,
6441
6709
  globalId: GlobalContributionId2
6442
6710
  }),
6443
- submitEndpoint: z17.strictObject({
6711
+ submitEndpoint: z19.strictObject({
6444
6712
  localId: LocalContributionId2,
6445
6713
  globalId: GlobalContributionId2
6446
6714
  }),
6447
6715
  authService: GlobalContributionId2.optional()
6448
6716
  });
6449
- const ResolvedKayAppWorkflow2 = z17.strictObject({
6717
+ const ResolvedKayAppWorkflow2 = z19.strictObject({
6450
6718
  localId: LocalContributionId2,
6451
6719
  globalId: GlobalContributionId2,
6452
6720
  name: NonEmptyString3,
6453
6721
  description: NonEmptyString3,
6454
- everyMs: z17.number().int().positive(),
6455
- auth: z17.strictObject({
6722
+ everyMs: z19.number().int().positive(),
6723
+ auth: z19.strictObject({
6456
6724
  serviceId: GlobalContributionId2,
6457
6725
  schemeId: GlobalContributionId2,
6458
- scopes: z17.array(NonEmptyString3).min(1).optional()
6726
+ scopes: z19.array(NonEmptyString3).min(1).optional()
6459
6727
  }).optional()
6460
6728
  });
6461
- const ResolvedKayAppWhiteboardType2 = z17.strictObject({
6462
- localId: LocalContributionId2,
6463
- globalId: GlobalContributionId2,
6464
- displayName: NonEmptyString3,
6465
- schemaVersion: z17.number().int().positive(),
6466
- storage: WhiteboardTypeStorage2,
6467
- valueSchema: JsonSchema
6729
+ const ResolvedKayAppWhiteboardType2 = WhiteboardTypeContribution2.safeExtend({
6730
+ globalId: GlobalContributionId2
6468
6731
  });
6469
- const ResolvedKayAppMcpServer2 = z17.strictObject({
6732
+ const ResolvedKayAppMcpServer2 = z19.strictObject({
6470
6733
  name: LocalContributionId2,
6471
6734
  pluginId: PluginId2,
6472
6735
  url: McpServerUrl2,
6473
6736
  auth: McpServerAuthMode2,
6474
6737
  authServiceId: GlobalContributionId2.optional()
6475
6738
  });
6476
- const ResolvedKayAgentUriModule2 = z17.strictObject({
6739
+ const ResolvedKayAgentUriModule2 = z19.strictObject({
6477
6740
  localId: LocalContributionId2,
6741
+ adapterId: z19.string().min(1).optional(),
6478
6742
  globalId: GlobalContributionId2,
6479
- schemes: z17.array(UriScheme2).min(1),
6743
+ schemes: z19.array(UriScheme2).min(1),
6480
6744
  displayName: NonEmptyString3.optional(),
6481
6745
  authServiceId: GlobalContributionId2.optional(),
6482
6746
  /** Mirrors `UriModuleContribution.authScheme`; a local ref takes the plugin's namespace. */
6483
6747
  authSchemeId: GlobalContributionId2.optional(),
6484
6748
  /** Mirrors `UriModuleContribution.knownResources` (host-side recording opt-in). */
6485
- knownResources: z17.literal(true).optional(),
6749
+ knownResources: z19.literal(true).optional(),
6486
6750
  /** Mirrors `UriModuleContribution.describesOperations`. */
6487
- describesOperations: z17.literal(true).optional(),
6751
+ describesOperations: z19.literal(true).optional(),
6488
6752
  /** Mirrors `UriModuleContribution.looksUpWebLinks`. */
6489
- looksUpWebLinks: z17.literal(true).optional(),
6753
+ looksUpWebLinks: z19.literal(true).optional(),
6490
6754
  ...UriModuleFacts2.shape
6491
6755
  });
6492
- const ResolvedKayAgentArtifactUriModule2 = z17.strictObject({
6756
+ const ResolvedKayAgentArtifactUriModule2 = z19.strictObject({
6493
6757
  localId: LocalContributionId2,
6494
6758
  globalId: GlobalContributionId2,
6495
6759
  scheme: UriScheme2,
6496
- editable: z17.boolean(),
6497
- listable: z17.boolean(),
6498
- deletable: z17.boolean(),
6499
- appendable: z17.boolean(),
6500
- storageScope: z17.enum(["session", "family"])
6760
+ editable: z19.boolean(),
6761
+ listable: z19.boolean(),
6762
+ deletable: z19.boolean(),
6763
+ appendable: z19.boolean(),
6764
+ storageScope: z19.enum(["session", "family"])
6501
6765
  });
6502
- const ResolvedKayAgentEntityResolver2 = z17.strictObject({
6766
+ const ResolvedKayAgentEntityResolver2 = z19.strictObject({
6503
6767
  localId: LocalContributionId2,
6504
6768
  globalId: GlobalContributionId2,
6505
6769
  displayName: NonEmptyString3.optional(),
6506
6770
  uriModule: GlobalContributionId2,
6507
- entityTypes: z17.array(NonEmptyString3).min(1),
6771
+ entityTypes: z19.array(NonEmptyString3).min(1),
6508
6772
  uriHint: NonEmptyString3
6509
6773
  });
6510
- const ResolvedKayAgentGitHostClaim2 = z17.strictObject({
6774
+ const ResolvedKayAgentGitHostClaim2 = z19.strictObject({
6511
6775
  host: GitHostName2,
6512
6776
  authServiceId: GlobalContributionId2,
6513
6777
  /** Manifest-declared order; the clone ladder tries them in sequence. */
6514
- authSchemeIds: z17.array(GlobalContributionId2).min(1),
6778
+ authSchemeIds: z19.array(GlobalContributionId2).min(1),
6515
6779
  /** Non-secret display copy for the claiming service, for clone failure text. */
6516
- authServiceDisplayName: z17.string(),
6780
+ authServiceDisplayName: z19.string(),
6517
6781
  basicAuthUser: GitBasicAuthUser2
6518
6782
  });
6519
- const ResolvedKayAgentConverter2 = z17.strictObject({
6783
+ const ResolvedKayAgentConverter2 = z19.strictObject({
6520
6784
  localId: LocalContributionId2,
6521
6785
  globalId: GlobalContributionId2,
6522
6786
  description: NonEmptyString3.optional(),
6523
- mimeTypes: z17.array(MimeTypeString2).min(1),
6524
- extensions: z17.array(FileExtensionToken2).min(1).optional()
6787
+ mimeTypes: z19.array(MimeTypeString2).min(1),
6788
+ extensions: z19.array(FileExtensionToken2).min(1).optional()
6525
6789
  });
6526
6790
  const ResolvedReferencePresentationUrlClaim = ReferencePresentationUrlClaim2.extend({
6527
- brandIcon: z17.string().max(64 * 1024).optional()
6791
+ brandIcon: z19.string().max(64 * 1024).optional()
6528
6792
  });
6529
- const ResolvedReferencePresentation2 = z17.strictObject({
6793
+ const ResolvedReferencePresentation2 = z19.strictObject({
6530
6794
  localId: LocalContributionId2,
6531
6795
  globalId: GlobalContributionId2,
6532
6796
  uriModule: GlobalContributionId2.optional(),
6533
6797
  /** The schemes this presentation is about: its `scheme`, or its module's. */
6534
- schemes: z17.array(UriScheme2).min(1).optional(),
6798
+ schemes: z19.array(UriScheme2).min(1).optional(),
6535
6799
  /** The module's `displayName`: the source's name in a row. */
6536
6800
  displayName: NonEmptyString3.optional(),
6537
6801
  /** The module's auth service, qualified: whose accounts `accountLinks` reads. */
6538
6802
  authService: GlobalContributionId2.optional(),
6539
6803
  accountLinks: ReferencePresentationAccountLinks2.optional(),
6540
- addresses: z17.array(ReferencePresentationAddress2).min(1).optional(),
6804
+ addresses: z19.array(ReferencePresentationAddress2).min(1).optional(),
6541
6805
  /** Comes with `open`. A presentation with neither only words its module's addresses. */
6542
6806
  resourceKind: NonEmptyString3.optional(),
6543
6807
  open: ReferenceOpenBehavior2.optional(),
6544
6808
  /** MIME-specific resource kinds; absent keys use the base presentation. */
6545
6809
  variants: ReferencePresentationVariants2.optional(),
6546
- claims: z17.array(ResolvedReferencePresentationUrlClaim).optional(),
6547
- tooltip: z17.strictObject({
6810
+ claims: z19.array(ResolvedReferencePresentationUrlClaim).optional(),
6811
+ tooltip: z19.strictObject({
6548
6812
  app: GlobalContributionId2,
6549
6813
  pattern: ReferencePresentationUriPattern2
6550
6814
  }).optional(),
6551
6815
  words: ReferencePresentationWords2.optional()
6552
6816
  });
6553
- const ResolvedPluginProvisioningRequirement2 = z17.strictObject({
6817
+ const ResolvedPluginProvisioningRequirement2 = z19.strictObject({
6554
6818
  id: LocalContributionId2,
6555
6819
  displayName: NonEmptyString3,
6556
6820
  description: NonEmptyString3,
@@ -6560,15 +6824,15 @@ function createResolvedContractSchemas(canonical) {
6560
6824
  * URL degrades to "Reconnect" in the UI instead of a broken link.
6561
6825
  */
6562
6826
  remediationUrl: HttpsUrl2.optional(),
6563
- probe: z17.strictObject({
6827
+ probe: z19.strictObject({
6564
6828
  url: HttpsUrl2,
6565
- method: z17.enum(["GET"]),
6566
- verdictStatuses: z17.array(SignedInStatusCode2).min(1),
6829
+ method: z19.enum(["GET"]),
6830
+ verdictStatuses: z19.array(SignedInStatusCode2).min(1),
6567
6831
  nonEmptyArrayAt: NonEmptyString3.optional()
6568
6832
  })
6569
6833
  });
6570
6834
  const ResolvedProvisioningField = {
6571
- provisioning: z17.array(ResolvedPluginProvisioningRequirement2).optional()
6835
+ provisioning: z19.array(ResolvedPluginProvisioningRequirement2).optional()
6572
6836
  };
6573
6837
  const ResolvedPluginAuthSchemeDescriptionFields = {
6574
6838
  displayName: NonEmptyString3.optional(),
@@ -6580,118 +6844,120 @@ function createResolvedContractSchemas(canonical) {
6580
6844
  ...ResolvedPluginAuthSchemeDescriptionFields,
6581
6845
  localId: LocalContributionId2,
6582
6846
  globalId: GlobalContributionId2,
6583
- kind: z17.literal("oauth2"),
6584
- scopes: z17.array(z17.string()).optional(),
6847
+ kind: z19.literal("oauth2"),
6848
+ scopes: z19.array(z19.string()).optional(),
6849
+ connectScopes: z19.array(NonEmptyString3).optional(),
6585
6850
  authorizationUrl: HttpsUrl2,
6586
6851
  tokenUrl: HttpsUrl2,
6587
- extraAuthorizeParams: z17.record(z17.string(), z17.string()).optional()
6852
+ extraAuthorizeParams: z19.record(z19.string(), z19.string()).optional(),
6853
+ extraAuthorizeParamsWhenAccountHeld: z19.record(NonEmptyString3, z19.string()).optional()
6588
6854
  };
6589
- const ResolvedPluginAuthSchemeOAuthPkce = z17.strictObject({
6855
+ const ResolvedPluginAuthSchemeOAuthPkce = z19.strictObject({
6590
6856
  ...ResolvedPluginAuthSchemeOAuthBase,
6591
- exchange: z17.literal("pkce"),
6857
+ exchange: z19.literal("pkce"),
6592
6858
  byoocProfile: PluginByoocProfile.optional(),
6593
- clientSuppliers: z17.array(PluginOAuthClientSupplier2).nonempty(),
6859
+ clientSuppliers: z19.array(PluginOAuthClientSupplier2).nonempty(),
6594
6860
  clientId: NonEmptyString3.optional(),
6595
6861
  clientSecret: NonEmptyString3.optional(),
6596
- account: z17.literal("lookup").optional()
6862
+ account: z19.literal("lookup").optional()
6597
6863
  });
6598
- const ResolvedPluginAuthSchemeOAuthConfidential = z17.strictObject({
6864
+ const ResolvedPluginAuthSchemeOAuthConfidential = z19.strictObject({
6599
6865
  ...ResolvedPluginAuthSchemeOAuthBase,
6600
- exchange: z17.literal("confidential"),
6601
- clientSuppliers: z17.tuple([z17.literal("kay")]),
6602
- account: z17.enum(["lookup", "sign-in"])
6866
+ exchange: z19.literal("confidential"),
6867
+ clientSuppliers: z19.tuple([z19.literal("kay")]),
6868
+ account: z19.enum(["lookup", "sign-in"])
6603
6869
  });
6604
- const ResolvedPluginAuthSchemeOAuth2 = z17.discriminatedUnion("exchange", [
6870
+ const ResolvedPluginAuthSchemeOAuth2 = z19.discriminatedUnion("exchange", [
6605
6871
  ResolvedPluginAuthSchemeOAuthPkce,
6606
6872
  ResolvedPluginAuthSchemeOAuthConfidential
6607
6873
  ]);
6608
- const ResolvedPluginAuthSchemeApiKey = z17.strictObject({
6874
+ const ResolvedPluginAuthSchemeApiKey = z19.strictObject({
6609
6875
  ...ResolvedProvisioningField,
6610
6876
  ...ResolvedPluginAuthSchemeDescriptionFields,
6611
6877
  localId: LocalContributionId2,
6612
6878
  globalId: GlobalContributionId2,
6613
- kind: z17.literal("api-key"),
6614
- scopes: z17.array(z17.string()).optional(),
6879
+ kind: z19.literal("api-key"),
6880
+ scopes: z19.array(z19.string()).optional(),
6615
6881
  /** Resolution applies the manifest's default, "<service name> API key". */
6616
6882
  inputLabel: NonEmptyString3,
6617
- fields: z17.array(z17.strictObject({ id: z17.string(), label: z17.string() })).optional(),
6618
- setup: z17.strictObject({ instructions: z17.string(), url: HttpsUrl2 }).optional(),
6619
- account: z17.literal("lookup").optional()
6883
+ fields: z19.array(z19.strictObject({ id: z19.string(), label: z19.string() })).optional(),
6884
+ setup: z19.strictObject({ instructions: z19.string(), url: HttpsUrl2 }).optional(),
6885
+ account: z19.literal("lookup").optional()
6620
6886
  });
6621
- const ResolvedPluginAuthSchemeDelegated = z17.strictObject({
6887
+ const ResolvedPluginAuthSchemeDelegated = z19.strictObject({
6622
6888
  ...ResolvedPluginAuthSchemeDescriptionFields,
6623
6889
  localId: LocalContributionId2,
6624
6890
  globalId: GlobalContributionId2,
6625
- kind: z17.literal("delegated"),
6626
- scopes: z17.array(z17.string()).optional()
6891
+ kind: z19.literal("delegated"),
6892
+ scopes: z19.array(z19.string()).optional()
6627
6893
  });
6628
- const ResolvedPluginAuthSchemeExternalCli = z17.strictObject({
6894
+ const ResolvedPluginAuthSchemeExternalCli = z19.strictObject({
6629
6895
  ...ResolvedPluginAuthSchemeDescriptionFields,
6630
6896
  localId: LocalContributionId2,
6631
6897
  globalId: GlobalContributionId2,
6632
- kind: z17.literal("external-cli"),
6633
- scopes: z17.array(z17.string()).optional(),
6898
+ kind: z19.literal("external-cli"),
6899
+ scopes: z19.array(z19.string()).optional(),
6634
6900
  /** The manifest's connect facts, verbatim. */
6635
6901
  cli: PluginExternalCliConnect2.optional()
6636
6902
  });
6637
- const ResolvedPluginAuthScheme2 = z17.discriminatedUnion("kind", [
6903
+ const ResolvedPluginAuthScheme2 = z19.discriminatedUnion("kind", [
6638
6904
  ResolvedPluginAuthSchemeOAuth2,
6639
6905
  ResolvedPluginAuthSchemeApiKey,
6640
6906
  ResolvedPluginAuthSchemeDelegated,
6641
6907
  ResolvedPluginAuthSchemeExternalCli
6642
6908
  ]);
6643
- const ResolvedPluginWebSession2 = z17.strictObject({
6644
- importance: z17.enum(["required", "recommended"]),
6909
+ const ResolvedPluginWebSession2 = z19.strictObject({
6910
+ importance: z19.enum(["required", "recommended"]),
6645
6911
  loginUrl: HttpsUrl2,
6646
- cookieDomains: z17.array(RegistrableDomain2).min(1),
6647
- probe: z17.strictObject({
6912
+ cookieDomains: z19.array(RegistrableDomain2).min(1),
6913
+ probe: z19.strictObject({
6648
6914
  url: HttpsUrl2,
6649
- method: z17.enum(["GET", "POST"]),
6650
- signedInStatuses: z17.array(SignedInStatusCode2).min(1)
6915
+ method: z19.enum(["GET", "POST"]),
6916
+ signedInStatuses: z19.array(SignedInStatusCode2).min(1)
6651
6917
  }),
6652
- oauthVenue: z17.enum(["embedded", "external"]),
6653
- signInFirst: z17.string().optional()
6918
+ oauthVenue: z19.enum(["embedded", "external"]),
6919
+ signInFirst: z19.string().optional()
6654
6920
  }).superRefine(refineWebSessionScopeConfined);
6655
- const ResolvedPluginAuthService2 = z17.strictObject({
6921
+ const ResolvedPluginAuthService2 = z19.strictObject({
6656
6922
  localId: LocalContributionId2,
6657
6923
  globalId: GlobalContributionId2,
6658
- displayName: z17.string(),
6659
- summary: z17.string().optional(),
6660
- schemes: z17.array(ResolvedPluginAuthScheme2).min(1),
6661
- purposes: z17.array(z17.string()).min(1),
6924
+ displayName: z19.string(),
6925
+ summary: z19.string().optional(),
6926
+ schemes: z19.array(ResolvedPluginAuthScheme2).min(1),
6927
+ purposes: z19.array(z19.string()).min(1),
6662
6928
  /** The service's browser half, when the manifest declares one. */
6663
6929
  webSession: ResolvedPluginWebSession2.optional()
6664
6930
  });
6665
- const ResolvedKayUiAppEndpointCapability2 = z17.union([
6666
- z17.strictObject({
6931
+ const ResolvedKayUiAppEndpointCapability2 = z19.union([
6932
+ z19.strictObject({
6667
6933
  localId: LocalContributionId2,
6668
6934
  globalId: GlobalContributionId2
6669
6935
  }),
6670
- z17.strictObject({ pluginId: PluginId2, localId: LocalContributionId2 })
6936
+ z19.strictObject({ pluginId: PluginId2, localId: LocalContributionId2 })
6671
6937
  ]);
6672
- const ResolvedKayUiApp2 = z17.strictObject({
6938
+ const ResolvedKayUiApp2 = z19.strictObject({
6673
6939
  localId: LocalContributionId2,
6674
6940
  globalId: GlobalContributionId2,
6675
6941
  displayName: NonEmptyString3,
6676
- contextOnly: z17.literal(true).optional(),
6942
+ contextOnly: z19.literal(true).optional(),
6677
6943
  description: NonEmptyString3.optional(),
6678
6944
  icon: PackageAssetPath2.optional(),
6679
- runtime: z17.literal("kay.react-app.v1"),
6680
- sdk: z17.strictObject({ range: NonEmptyString3 }),
6945
+ runtime: z19.literal("kay.react-app.v1"),
6946
+ sdk: z19.strictObject({ range: NonEmptyString3 }),
6681
6947
  entrypoint: TargetEntrypoint2,
6682
- styles: z17.array(PackageAssetPath2).optional(),
6683
- assets: z17.array(PackageAssetPath2).optional(),
6684
- capabilities: z17.strictObject({
6685
- endpoints: z17.array(ResolvedKayUiAppEndpointCapability2).optional(),
6686
- host: z17.array(KayUiAppHostCapability2).optional(),
6687
- feeds: z17.array((canonical ? canonicalContributionSchemas : contributions_exports).UiAppCapabilityReference).optional()
6948
+ styles: z19.array(PackageAssetPath2).optional(),
6949
+ assets: z19.array(PackageAssetPath2).optional(),
6950
+ capabilities: z19.strictObject({
6951
+ endpoints: z19.array(ResolvedKayUiAppEndpointCapability2).optional(),
6952
+ host: z19.array(KayUiAppHostCapability2).optional(),
6953
+ feeds: z19.array((canonical ? canonicalContributionSchemas : contributions_exports).UiAppCapabilityReference).optional()
6688
6954
  }).optional()
6689
6955
  });
6690
- const ResolvedPluginContractV12 = z17.strictObject({
6691
- protocol: z17.literal("kay.plugin.v1"),
6956
+ const ResolvedPluginContractV12 = z19.strictObject({
6957
+ protocol: z19.literal("kay.plugin.v1"),
6692
6958
  pluginId: PluginId2,
6693
6959
  namespace: PluginNamespace2,
6694
- contributions: z17.array(ResolvedPluginContributionId2),
6960
+ contributions: z19.array(ResolvedPluginContributionId2),
6695
6961
  // The deduplicated set of qualified (dotted) external auth-service ids this
6696
6962
  // plugin references, from agent uriModule, tool and cliBinding
6697
6963
  // `authService` refs, card sign-in refs, and auth-grant `service` refs. Always present - a plugin
@@ -6699,38 +6965,40 @@ function createResolvedContractSchemas(canonical) {
6699
6965
  // is a recorded dependency, not a resolution: there is no runtime plugin
6700
6966
  // loader in v1, so nothing here verifies the reference resolves within a
6701
6967
  // composed roster (a composition-time concern owned elsewhere).
6702
- consumesAuthServices: z17.array(GlobalContributionId2),
6968
+ consumesAuthServices: z19.array(GlobalContributionId2),
6703
6969
  // The explicit plugin-level dependency ids declared in `dependencies.plugins` on the manifest,
6704
6970
  // deduped and validated at parse time. Always present; a plugin with no explicit dependencies
6705
6971
  // carries an empty array. Composition checks each id against the accepted roster and derives the
6706
6972
  // full dependency graph together with auth-inferred edges from `consumesAuthServices`.
6707
- explicitDependencies: z17.array(PluginId2),
6973
+ explicitDependencies: z19.array(PluginId2),
6708
6974
  dataDirSharedWith: PluginId2.optional(),
6709
- workloadPurposes: z17.array(PluginWorkloadPurpose).optional(),
6710
- shellCommands: z17.array(PluginShellCommand.omit({ endpoint: true }).extend({
6975
+ workloadPurposes: z19.array(PluginWorkloadPurpose).optional(),
6976
+ shellCommands: z19.array(PluginShellCommand.omit({ endpoint: true }).extend({
6711
6977
  endpointId: GlobalContributionId2
6712
6978
  })).optional(),
6979
+ projectDirectories: PluginProjectDirectories.omit({ endpoint: true }).extend({ endpointId: GlobalContributionId2 }).optional(),
6713
6980
  // The auth services this plugin OWNS, carrying the global ids its harness
6714
6981
  // target must register and the credential authority keys on. Always present;
6715
6982
  // a plugin that declares no `auth.services` carries an empty array. The dual
6716
6983
  // of `consumesAuthServices` (services it merely references).
6717
- authServices: z17.array(ResolvedPluginAuthService2),
6984
+ authServices: z19.array(ResolvedPluginAuthService2),
6718
6985
  grants: ResolvedPluginGrants2.optional(),
6719
- kayAgentUriModules: z17.array(ResolvedKayAgentUriModule2).optional(),
6720
- kayAgentArtifactUriModules: z17.array(ResolvedKayAgentArtifactUriModule2).optional(),
6721
- kayAgentEntityResolvers: z17.array(ResolvedKayAgentEntityResolver2).optional(),
6722
- kayAgentGitHostClaims: z17.array(ResolvedKayAgentGitHostClaim2).optional(),
6723
- kayAgentTools: z17.array(ResolvedKayAgentTool2).optional(),
6724
- kayAppTools: z17.array(ResolvedKayAppTool2).optional(),
6725
- kayAppApprovalTypes: z17.array(ResolvedKayAppApprovalType2).optional(),
6726
- kayAppWorkflows: z17.array(ResolvedKayAppWorkflow2).optional(),
6727
- kayAppCards: z17.array(ResolvedPluginCard2).optional(),
6728
- kayAppDataSources: z17.array(ResolvedKayAppDataSource2).optional(),
6729
- kayAppWhiteboardTypes: z17.array(ResolvedKayAppWhiteboardType2).optional(),
6730
- kayAppMcpServers: z17.array(ResolvedKayAppMcpServer2).optional(),
6731
- kayAgentConverters: z17.array(ResolvedKayAgentConverter2).optional(),
6732
- referencePresentations: z17.array(ResolvedReferencePresentation2).optional(),
6733
- kayUiApps: z17.array(ResolvedKayUiApp2).optional()
6986
+ kayAgentFamilyFolder: z19.strictObject({ scope: z19.literal("root") }).optional(),
6987
+ kayAgentUriModules: z19.array(ResolvedKayAgentUriModule2).optional(),
6988
+ kayAgentArtifactUriModules: z19.array(ResolvedKayAgentArtifactUriModule2).optional(),
6989
+ kayAgentEntityResolvers: z19.array(ResolvedKayAgentEntityResolver2).optional(),
6990
+ kayAgentGitHostClaims: z19.array(ResolvedKayAgentGitHostClaim2).optional(),
6991
+ kayAgentTools: z19.array(ResolvedKayAgentTool2).optional(),
6992
+ kayAppTools: z19.array(ResolvedKayAppTool2).optional(),
6993
+ kayAppApprovalTypes: z19.array(ResolvedKayAppApprovalType2).optional(),
6994
+ kayAppWorkflows: z19.array(ResolvedKayAppWorkflow2).optional(),
6995
+ kayAppCards: z19.array(ResolvedPluginCard2).optional(),
6996
+ kayAppDataSources: z19.array(ResolvedKayAppDataSource2).optional(),
6997
+ kayAppWhiteboardTypes: z19.array(ResolvedKayAppWhiteboardType2).optional(),
6998
+ kayAppMcpServers: z19.array(ResolvedKayAppMcpServer2).optional(),
6999
+ kayAgentConverters: z19.array(ResolvedKayAgentConverter2).optional(),
7000
+ referencePresentations: z19.array(ResolvedReferencePresentation2).optional(),
7001
+ kayUiApps: z19.array(ResolvedKayUiApp2).optional()
6734
7002
  });
6735
7003
  return {
6736
7004
  ResolvedPluginContributionId: ResolvedPluginContributionId2,
@@ -6960,6 +7228,12 @@ function resolveAuthServices(namespace, manifest) {
6960
7228
  const endpointFields = {
6961
7229
  authorizationUrl: scheme.authorizationUrl,
6962
7230
  tokenUrl: scheme.tokenUrl,
7231
+ ...scheme.connectScopes === void 0 ? {} : { connectScopes: [...scheme.connectScopes] },
7232
+ ...scheme.extraAuthorizeParamsWhenAccountHeld === void 0 ? {} : {
7233
+ extraAuthorizeParamsWhenAccountHeld: {
7234
+ ...scheme.extraAuthorizeParamsWhenAccountHeld
7235
+ }
7236
+ },
6963
7237
  ...scheme.extraAuthorizeParams === void 0 ? {} : { extraAuthorizeParams: { ...scheme.extraAuthorizeParams } }
6964
7238
  };
6965
7239
  return scheme.exchange === "pkce" ? {
@@ -7119,6 +7393,7 @@ function resolveKayPluginContractV1(manifest) {
7119
7393
  snapshot: source.snapshot,
7120
7394
  change: source.change,
7121
7395
  ...source.read === void 0 ? {} : { read: source.read },
7396
+ ...source.messageDraft === void 0 ? {} : { messageDraft: source.messageDraft },
7122
7397
  ...source.store === void 0 ? {} : { store: source.store }
7123
7398
  }));
7124
7399
  const kayAppApprovalTypes = manifest.targets?.kay?.app?.contributes?.approvalTypes?.map(({ uriModule, ...type }) => {
@@ -7138,7 +7413,10 @@ function resolveKayPluginContractV1(manifest) {
7138
7413
  displayName: type.displayName,
7139
7414
  schemaVersion: type.schemaVersion,
7140
7415
  storage: type.storage,
7141
- valueSchema: type.valueSchema
7416
+ valueSchema: type.valueSchema,
7417
+ ...type.directory === void 0 ? {} : { directory: type.directory },
7418
+ ...type.reference === void 0 ? {} : { reference: type.reference },
7419
+ ...type.handover === void 0 ? {} : { handover: type.handover }
7142
7420
  }));
7143
7421
  const kayAppMcpServers = Object.entries(manifest.targets?.kay?.app?.contributes?.mcpServers ?? {}).map(([name, server]) => ({
7144
7422
  name,
@@ -7151,6 +7429,7 @@ function resolveKayPluginContractV1(manifest) {
7151
7429
  }));
7152
7430
  const kayAgentUriModules = manifest.targets?.kay?.agent?.contributes?.uriModules?.map((module) => ({
7153
7431
  localId: module.localId,
7432
+ ...module.adapterId === void 0 ? {} : { adapterId: module.adapterId },
7154
7433
  globalId: resolveGlobalContributionId(namespace, module.localId),
7155
7434
  schemes: [...module.schemes],
7156
7435
  ...module.displayName === void 0 ? {} : { displayName: module.displayName },
@@ -7267,7 +7546,14 @@ function resolveKayPluginContractV1(manifest) {
7267
7546
  endpointId: resolveGlobalContributionId(namespace, endpoint)
7268
7547
  }))
7269
7548
  },
7549
+ ...manifest.projectDirectories === void 0 ? {} : {
7550
+ projectDirectories: {
7551
+ scheme: manifest.projectDirectories.scheme,
7552
+ endpointId: resolveGlobalContributionId(namespace, manifest.projectDirectories.endpoint)
7553
+ }
7554
+ },
7270
7555
  ...grants && Object.keys(grants.byTarget).length > 0 ? { grants } : {},
7556
+ ...manifest.targets?.kay?.agent?.familyFolder === void 0 ? {} : { kayAgentFamilyFolder: manifest.targets.kay.agent.familyFolder },
7271
7557
  ...kayAgentUriModules && kayAgentUriModules.length > 0 ? { kayAgentUriModules } : {},
7272
7558
  ...kayAgentArtifactUriModules && kayAgentArtifactUriModules.length > 0 ? { kayAgentArtifactUriModules } : {},
7273
7559
  ...kayAgentEntityResolvers && kayAgentEntityResolvers.length > 0 ? { kayAgentEntityResolvers } : {},
@@ -7314,7 +7600,7 @@ function presentationSource(namespace, manifest, presentation) {
7314
7600
  } : {}
7315
7601
  };
7316
7602
  }
7317
- function uriModuleFacts({ localId: _localId, schemes: _schemes, displayName: _displayName, authService: _authService, authScheme: _authScheme, knownResources: _knownResources, describesOperations: _describesOperations, looksUpWebLinks: _looksUpWebLinks, ...facts }) {
7603
+ function uriModuleFacts({ localId: _localId, adapterId: _adapterId, schemes: _schemes, displayName: _displayName, authService: _authService, authScheme: _authScheme, knownResources: _knownResources, describesOperations: _describesOperations, looksUpWebLinks: _looksUpWebLinks, ...facts }) {
7318
7604
  return facts;
7319
7605
  }
7320
7606
 
@@ -7450,14 +7736,14 @@ function kayPluginCompatibilityAdvisories(input) {
7450
7736
  message: boundPluginDiagnosticMessage(`${manifest.displayName} (${manifest.id}) ${advisory.message}`)
7451
7737
  }));
7452
7738
  }
7453
- var ReadableCompatibility = z18.object({
7454
- supportedProtocols: z18.array(z18.string()).optional().catch(void 0),
7739
+ var ReadableCompatibility = z20.object({
7740
+ supportedProtocols: z20.array(z20.string()).optional().catch(void 0),
7455
7741
  minKayVersion: NonEmptyString.optional().catch(void 0),
7456
7742
  sdk: NonEmptyString.optional().catch(void 0)
7457
7743
  });
7458
- var ReadableManifestHead = z18.object({
7459
- id: z18.string().optional().catch(void 0),
7460
- displayName: z18.string().optional().catch(void 0),
7744
+ var ReadableManifestHead = z20.object({
7745
+ id: z20.string().optional().catch(void 0),
7746
+ displayName: z20.string().optional().catch(void 0),
7461
7747
  compatibility: ReadableCompatibility.optional().catch(void 0)
7462
7748
  });
7463
7749
  function keepNamespaceDerivedTools(contract, grandfathered) {
@@ -7561,28 +7847,28 @@ function errorText(error) {
7561
7847
  }
7562
7848
 
7563
7849
  // packages/plugin-protocol/dist/session-health.js
7564
- import { z as z19 } from "zod";
7850
+ import { z as z21 } from "zod";
7565
7851
  var SESSION_HEALTH_EXTENSION_ID = "kay.session-health";
7566
7852
  var SESSION_HEALTH_ENTRY_NAME = "session_health";
7567
7853
  var SESSION_HEALTH_CUSTOM_TYPE = `ext:${SESSION_HEALTH_EXTENSION_ID}:${SESSION_HEALTH_ENTRY_NAME}`;
7568
7854
  var SESSION_HEALTH_CLASSIFIER_IDS = ["jev"];
7569
- var sessionHealthEntrySchema = z19.object({
7570
- v: z19.literal(1),
7571
- verdict: z19.enum(["well", "bad", "unknown"]),
7855
+ var sessionHealthEntrySchema = z21.object({
7856
+ v: z21.literal(1),
7857
+ verdict: z21.enum(["well", "bad", "unknown"]),
7572
7858
  /**
7573
7859
  * The model's calibrated confidence in `well`, 0..1, or null when the
7574
7860
  * classifier declined to produce one. Never exported raw: the telemetry
7575
7861
  * event carries only the decile bucket.
7576
7862
  */
7577
- p_well: z19.number().min(0).max(1).nullable(),
7578
- classifier: z19.enum(SESSION_HEALTH_CLASSIFIER_IDS),
7579
- classifier_version: z19.string().min(1).max(64),
7580
- judged_at: z19.number().int().nonnegative(),
7581
- user_entry_id: z19.string().min(1).max(256),
7582
- through_entry_id: z19.string().min(1).max(256),
7583
- usage: z19.strictObject({
7584
- input_tokens: z19.number().int().nonnegative(),
7585
- output_tokens: z19.number().int().nonnegative()
7863
+ p_well: z21.number().min(0).max(1).nullable(),
7864
+ classifier: z21.enum(SESSION_HEALTH_CLASSIFIER_IDS),
7865
+ classifier_version: z21.string().min(1).max(64),
7866
+ judged_at: z21.number().int().nonnegative(),
7867
+ user_entry_id: z21.string().min(1).max(256),
7868
+ through_entry_id: z21.string().min(1).max(256),
7869
+ usage: z21.strictObject({
7870
+ input_tokens: z21.number().int().nonnegative(),
7871
+ output_tokens: z21.number().int().nonnegative()
7586
7872
  }).optional()
7587
7873
  });
7588
7874
  function sessionHealthPWellDecile(pWell) {
@@ -7592,23 +7878,28 @@ function sessionHealthPWellDecile(pWell) {
7592
7878
  }
7593
7879
 
7594
7880
  // packages/plugin-protocol/dist/resource-invocations.js
7595
- import { z as z20 } from "zod";
7596
- var CorpusResourceKind = z20.enum([
7881
+ import { z as z23 } from "zod";
7882
+
7883
+ // packages/plugin-protocol/dist/resource-invocation-cursor.js
7884
+ import { z as z22 } from "zod";
7885
+ var CorpusResourceInvocationCursor = z22.strictObject({
7886
+ at: z22.iso.datetime({ offset: true }),
7887
+ eventId: z22.string().min(1)
7888
+ });
7889
+
7890
+ // packages/plugin-protocol/dist/resource-invocations.js
7891
+ var CorpusResourceKind = z23.enum([
7597
7892
  "skill",
7598
7893
  "context-file",
7599
7894
  "prompt-command"
7600
7895
  ]);
7601
- var CorpusResourceInvocationCursor = z20.strictObject({
7602
- at: z20.iso.datetime({ offset: true }),
7603
- eventId: z20.string().min(1)
7604
- });
7605
- var CorpusResourceInvocationQuery = z20.strictObject({
7896
+ var CorpusResourceInvocationQuery = z23.strictObject({
7606
7897
  kind: CorpusResourceKind,
7607
- since: z20.iso.datetime({ offset: true }),
7608
- until: z20.iso.datetime({ offset: true }),
7898
+ since: z23.iso.datetime({ offset: true }),
7899
+ until: z23.iso.datetime({ offset: true }),
7609
7900
  after: CorpusResourceInvocationCursor.optional(),
7610
- limit: z20.number().int().min(1).max(1e3).optional(),
7611
- rootCreatedByKind: z20.enum(AGENT_RUNTIME_SESSION_CREATOR_KINDS).optional()
7901
+ limit: z23.number().int().min(1).max(1e3).optional(),
7902
+ rootCreatedByKind: z23.enum(AGENT_RUNTIME_SESSION_CREATOR_KINDS).optional()
7612
7903
  }).refine((value) => Date.parse(value.since) < Date.parse(value.until), {
7613
7904
  message: "since must precede until"
7614
7905
  });
@@ -7788,14 +8079,14 @@ function skillSuggestionEvidenceItems(evidence, options = {}) {
7788
8079
  }
7789
8080
 
7790
8081
  // packages/plugin-protocol/dist/ui-app-package.js
7791
- import { z as z21 } from "zod";
8082
+ import { z as z24 } from "zod";
7792
8083
  var KAY_UI_APP_PACKAGE_PROTOCOL = "kay.ui.app-package.v1";
7793
8084
  var KAY_UI_BUNDLE_INDEX_PROTOCOL = "kay.ui.bundle-index.v1";
7794
- var KayUiBundleOutputPath = z21.string().trim().min(1).refine((value) => !value.startsWith("/") && !value.startsWith("./") && !value.includes("\\") && !value.split("/").includes(".."), { message: "bundle output path must stay relative to the bundle root" });
7795
- var KayUiBundleIndexV1 = z21.strictObject({
7796
- protocol: z21.literal(KAY_UI_BUNDLE_INDEX_PROTOCOL),
8085
+ var KayUiBundleOutputPath = z24.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" });
8086
+ var KayUiBundleIndexV1 = z24.strictObject({
8087
+ protocol: z24.literal(KAY_UI_BUNDLE_INDEX_PROTOCOL),
7797
8088
  entryPath: KayUiBundleOutputPath,
7798
- files: z21.array(z21.strictObject({
8089
+ files: z24.array(z24.strictObject({
7799
8090
  path: KayUiBundleOutputPath,
7800
8091
  mediaType: NonEmptyString
7801
8092
  })).min(1)
@@ -7822,19 +8113,19 @@ var KayUiBundleIndexV1 = z21.strictObject({
7822
8113
  function parseKayUiBundleIndexV1(input) {
7823
8114
  return KayUiBundleIndexV1.parse(input);
7824
8115
  }
7825
- var KayUiAppPackageFile = z21.strictObject({
8116
+ var KayUiAppPackageFile = z24.strictObject({
7826
8117
  path: PackageAssetPath,
7827
8118
  mediaType: NonEmptyString,
7828
- bytes: z21.instanceof(Uint8Array).refine((bytes) => bytes.byteLength > 0, {
8119
+ bytes: z24.instanceof(Uint8Array).refine((bytes) => bytes.byteLength > 0, {
7829
8120
  message: "app package file bytes must not be empty"
7830
8121
  })
7831
8122
  });
7832
- var KayUiAppPackageV1 = z21.strictObject({
7833
- protocol: z21.literal(KAY_UI_APP_PACKAGE_PROTOCOL),
8123
+ var KayUiAppPackageV1 = z24.strictObject({
8124
+ protocol: z24.literal(KAY_UI_APP_PACKAGE_PROTOCOL),
7834
8125
  appLocalId: LocalContributionId,
7835
8126
  entry: KayUiAppPackageFile,
7836
- styles: z21.array(KayUiAppPackageFile).optional(),
7837
- assets: z21.array(KayUiAppPackageFile).optional()
8127
+ styles: z24.array(KayUiAppPackageFile).optional(),
8128
+ assets: z24.array(KayUiAppPackageFile).optional()
7838
8129
  }).superRefine((appPackage, ctx) => {
7839
8130
  if (appPackage.entry.mediaType !== "application/javascript") {
7840
8131
  ctx.addIssue({
@@ -7870,72 +8161,29 @@ function parseKayUiAppPackageV1(input) {
7870
8161
  return KayUiAppPackageV1.parse(input);
7871
8162
  }
7872
8163
 
7873
- // packages/plugin-protocol/dist/whiteboard.js
7874
- import { z as z22 } from "zod";
7875
- var WhiteboardValue = JsonValue;
7876
- var WhiteboardEntryEnvelope = z22.strictObject({
7877
- id: NonEmptyString,
7878
- typeId: GlobalContributionId,
7879
- schemaVersion: z22.number().int().positive(),
7880
- title: z22.string(),
7881
- authorSessionId: NonEmptyString.nullable()
7882
- });
7883
- var WhiteboardEntrySummary = z22.strictObject({
7884
- name: NonEmptyString,
7885
- entry: WhiteboardEntryEnvelope,
7886
- revision: NonEmptyString
7887
- });
7888
- var WhiteboardEntrySnapshot = WhiteboardEntrySummary.extend({
7889
- value: WhiteboardValue
7890
- });
7891
- var WhiteboardDiagnostic = z22.strictObject({
7892
- ruleId: NonEmptyString,
7893
- severity: z22.enum(["error", "warning"]),
7894
- message: NonEmptyString
7895
- });
7896
- var WhiteboardEntryInfo = z22.strictObject({
7897
- name: NonEmptyString,
7898
- revision: NonEmptyString,
7899
- entry: WhiteboardEntryEnvelope.optional(),
7900
- state: z22.enum(["available", "unavailable", "unsupported-version", "invalid"]),
7901
- mutable: z22.boolean(),
7902
- diagnostics: z22.array(z22.string())
7903
- });
7904
- var WhiteboardEntryInspection = WhiteboardEntryInfo.extend({
7905
- value: WhiteboardValue.optional(),
7906
- text: z22.string(),
7907
- truncated: z22.boolean()
7908
- });
7909
- var WhiteboardTypeInfo = z22.strictObject({
7910
- typeId: GlobalContributionId,
7911
- displayName: NonEmptyString,
7912
- schemaVersion: z22.number().int().positive(),
7913
- available: z22.boolean()
7914
- });
7915
-
7916
8164
  // packages/plugin-protocol/dist/product-events.js
7917
- import { z as z23 } from "zod";
8165
+ import { z as z25 } from "zod";
7918
8166
  var exportable = {
7919
- class: z23.literal("exportable"),
7920
- optional: z23.boolean().optional()
8167
+ class: z25.literal("exportable"),
8168
+ optional: z25.boolean().optional()
7921
8169
  };
7922
- var PluginProductEventField = z23.union([
7923
- z23.strictObject({ class: z23.literal("local") }),
7924
- z23.strictObject({
8170
+ var PluginProductEventField = z25.union([
8171
+ z25.strictObject({ class: z25.literal("local") }),
8172
+ z25.strictObject({
7925
8173
  ...exportable,
7926
- type: z23.literal("enum"),
7927
- values: z23.array(z23.string())
8174
+ type: z25.literal("enum"),
8175
+ values: z25.array(z25.string())
7928
8176
  }),
7929
- z23.strictObject({
8177
+ z25.strictObject({
7930
8178
  ...exportable,
7931
- type: z23.literal("number"),
7932
- min: z23.number(),
7933
- max: z23.number(),
7934
- integer: z23.boolean().optional()
8179
+ type: z25.literal("number"),
8180
+ min: z25.number(),
8181
+ max: z25.number(),
8182
+ integer: z25.boolean().optional()
7935
8183
  }),
7936
- z23.strictObject({
8184
+ z25.strictObject({
7937
8185
  ...exportable,
7938
- type: z23.enum([
8186
+ type: z25.enum([
7939
8187
  "boolean",
7940
8188
  "id",
7941
8189
  "identifier",
@@ -7951,9 +8199,9 @@ function isPluginProductEventName(name) {
7951
8199
  }
7952
8200
 
7953
8201
  // packages/plugin-protocol/dist/artifact-outputs.js
7954
- import { z as z24 } from "zod";
8202
+ import { z as z26 } from "zod";
7955
8203
  var ARTIFACT_OUTPUT_PAGE_MAX = 200;
7956
- var Segment = z24.string().min(1).max(1024).refine((value) => !/[^A-Za-z0-9._-]/.test(value)).refine((value) => value !== "." && value !== "..");
8204
+ var Segment = z26.string().min(1).max(1024).refine((value) => !/[^A-Za-z0-9._-]/.test(value)).refine((value) => value !== "." && value !== "..");
7957
8205
  function parseArtifactOutputUri(uri) {
7958
8206
  const match = /^output:\/\/([^/]+)\/([^/]+)$/.exec(uri);
7959
8207
  if (match === null || !Segment.safeParse(match[1]).success || !Segment.safeParse(match[2]).success)
@@ -7963,12 +8211,12 @@ function parseArtifactOutputUri(uri) {
7963
8211
  function isCanonicalArtifactOutputUri(uri) {
7964
8212
  return parseArtifactOutputUri(uri) !== void 0;
7965
8213
  }
7966
- var ArtifactOutputUri = z24.string().refine(isCanonicalArtifactOutputUri, "Expected a canonical output://session/name URI");
7967
- var ArtifactOutputChange = z24.union([
7968
- z24.strictObject({
7969
- uris: z24.array(ArtifactOutputUri).min(1).max(ARTIFACT_OUTPUT_PAGE_MAX)
8214
+ var ArtifactOutputUri = z26.string().refine(isCanonicalArtifactOutputUri, "Expected a canonical output://session/name URI");
8215
+ var ArtifactOutputChange = z26.union([
8216
+ z26.strictObject({
8217
+ uris: z26.array(ArtifactOutputUri).min(1).max(ARTIFACT_OUTPUT_PAGE_MAX)
7970
8218
  }),
7971
- z24.strictObject({ sessionId: Segment })
8219
+ z26.strictObject({ sessionId: Segment })
7972
8220
  ]);
7973
8221
 
7974
8222
  // packages/plugin-protocol/dist/credential-text.js
@@ -8011,25 +8259,25 @@ function isCredentialShapedText(value) {
8011
8259
  }
8012
8260
 
8013
8261
  // packages/plugin-protocol/dist/ui-module-bundle.js
8014
- import { z as z25 } from "zod";
8262
+ import { z as z27 } from "zod";
8015
8263
  var KAY_UI_MODULE_BUNDLE_PROTOCOL = "kay.ui.module-bundle.v1";
8016
8264
  var KAY_UI_MODULE_FILE_MAX_BYTES = 8 * 1024 * 1024;
8017
8265
  var KAY_UI_MODULE_BUNDLE_MAX_BYTES = 32 * 1024 * 1024;
8018
8266
  var KAY_UI_MODULE_BUNDLE_MAX_FILES = 256;
8019
- var OutputPath = z25.string().min(1).max(1024).refine((value) => {
8267
+ var OutputPath = z27.string().min(1).max(1024).refine((value) => {
8020
8268
  const parsed = KayUiBundleIndexV1.shape.entryPath.safeParse(value);
8021
8269
  return parsed.success && parsed.data === value && value.split("/").every((part) => part !== "" && part !== ".") && // oxlint-disable-next-line eslint/no-control-regex -- Untrusted artifact paths must reject literal control characters.
8022
8270
  !/[\u0000-\u001f?#:%]/.test(value);
8023
8271
  }, { message: "bundle path must contain only unambiguous relative segments" });
8024
- var Sha256 = z25.string().regex(/^[a-f0-9]{64}$/);
8025
- var KayUiModuleBundleIndexV1 = z25.strictObject({
8026
- protocol: z25.literal(KAY_UI_MODULE_BUNDLE_PROTOCOL),
8272
+ var Sha256 = z27.string().regex(/^[a-f0-9]{64}$/);
8273
+ var KayUiModuleBundleIndexV1 = z27.strictObject({
8274
+ protocol: z27.literal(KAY_UI_MODULE_BUNDLE_PROTOCOL),
8027
8275
  entryPath: OutputPath,
8028
- stylePaths: z25.array(OutputPath).max(KAY_UI_MODULE_BUNDLE_MAX_FILES),
8029
- files: z25.array(z25.strictObject({
8276
+ stylePaths: z27.array(OutputPath).max(KAY_UI_MODULE_BUNDLE_MAX_FILES),
8277
+ files: z27.array(z27.strictObject({
8030
8278
  path: OutputPath,
8031
- mediaType: z25.string().min(1).max(128).regex(/^[a-zA-Z0-9!#$&^_.+-]+\/[a-zA-Z0-9!#$&^_.+-]+$/),
8032
- byteLength: z25.number().int().min(1).max(KAY_UI_MODULE_FILE_MAX_BYTES),
8279
+ mediaType: z27.string().min(1).max(128).regex(/^[a-zA-Z0-9!#$&^_.+-]+\/[a-zA-Z0-9!#$&^_.+-]+$/),
8280
+ byteLength: z27.number().int().min(1).max(KAY_UI_MODULE_FILE_MAX_BYTES),
8033
8281
  sha256: Sha256
8034
8282
  })).min(1).max(KAY_UI_MODULE_BUNDLE_MAX_FILES)
8035
8283
  }).superRefine((index, ctx) => {
@@ -8059,9 +8307,9 @@ var KayUiModuleBundleIndexV1 = z25.strictObject({
8059
8307
  message: "bundle exceeds byte cap"
8060
8308
  });
8061
8309
  });
8062
- var KayUiModuleBundleReference = z25.strictObject({
8310
+ var KayUiModuleBundleReference = z27.strictObject({
8063
8311
  generationId: Sha256,
8064
- revision: z25.string().min(1).max(4096).refine((value) => value.trim() === value),
8312
+ revision: z27.string().min(1).max(4096).refine((value) => value.trim() === value),
8065
8313
  index: KayUiModuleBundleIndexV1
8066
8314
  });
8067
8315
  export {
@@ -8228,6 +8476,7 @@ export {
8228
8476
  PluginPickerRound,
8229
8477
  PluginProductEventContribution,
8230
8478
  PluginProductEventField,
8479
+ PluginProjectDirectories,
8231
8480
  PluginProvisioningProbe,
8232
8481
  PluginProvisioningRequirement,
8233
8482
  PluginShellCommand,
@@ -8241,6 +8490,9 @@ export {
8241
8490
  PluginWebSessionDeclaration,
8242
8491
  PluginWebSessionProbe,
8243
8492
  PluginWorkloadPurpose,
8493
+ ProjectDirectory,
8494
+ ProjectDirectoryRequest,
8495
+ ProjectDirectoryResponse,
8244
8496
  RENAMED_PLUGIN_CAPABILITY_SLUGS,
8245
8497
  RESERVED_DIRECTORY_PLUGIN_ID_PREFIXES,
8246
8498
  RETIRED_COMPATIBILITY_KEYS,
@@ -8338,6 +8590,7 @@ export {
8338
8590
  WhiteboardEntryEnvelope,
8339
8591
  WhiteboardEntryInfo,
8340
8592
  WhiteboardEntryInspection,
8593
+ WhiteboardEntryReference,
8341
8594
  WhiteboardEntrySnapshot,
8342
8595
  WhiteboardEntrySummary,
8343
8596
  WhiteboardTypeContribution,