@yaklabs-ai/plugin-protocol 0.53.0 → 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,9 @@ 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.53.0";
269
+ var KAY_PLUGIN_SDK_VERSION = "0.54.0";
270
270
  var KAY_PLUGIN_COMPATIBLE_SDK_VERSIONS = [
271
+ "0.53.0",
271
272
  "0.52.1",
272
273
  "0.52.0",
273
274
  "0.51.0",
@@ -1807,6 +1808,9 @@ var PLUGIN_CAPABILITY_SLUGS = [
1807
1808
  "skills.write",
1808
1809
  "skills.share",
1809
1810
  "plugins.set-enabled",
1811
+ "sessions.assign-project",
1812
+ "artifacts.resolve-file",
1813
+ "process.run",
1810
1814
  "sessions.annotate",
1811
1815
  "sessions.compact",
1812
1816
  "soul.write",
@@ -1856,7 +1860,10 @@ var PRIVATE_PLUGIN_CAPABILITY_SLUGS = [
1856
1860
  "skills.share",
1857
1861
  "plugins.set-enabled",
1858
1862
  "system-prompt.register",
1859
- "workflows.signals"
1863
+ "workflows.signals",
1864
+ "sessions.assign-project",
1865
+ "artifacts.resolve-file",
1866
+ "process.run"
1860
1867
  ];
1861
1868
  function isPrivateCapabilityClaim(claim) {
1862
1869
  return PRIVATE_PLUGIN_CAPABILITY_SLUGS.includes(claim.slug);
@@ -2008,6 +2015,29 @@ function createAuthoritySchemas(canonical) {
2008
2015
  slug: z11.literal("plugins.set-enabled"),
2009
2016
  envelope: z11.strictObject({})
2010
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
+ }),
2011
2041
  z11.strictObject({
2012
2042
  // Write a steward entry (recap, next steps, title, work headlines) into the session whose
2013
2043
  // event the calling handler is answering. Bound to that session: a call for any other is
@@ -2337,6 +2367,9 @@ function sameClaim(a, b) {
2337
2367
  case "skills.write":
2338
2368
  case "skills.share":
2339
2369
  case "plugins.set-enabled":
2370
+ case "sessions.assign-project":
2371
+ case "artifacts.resolve-file":
2372
+ case "process.run":
2340
2373
  case "sessions.annotate":
2341
2374
  case "sessions.compact":
2342
2375
  case "soul.write":
@@ -2429,6 +2462,9 @@ function envelopePairs(a, b) {
2429
2462
  case "skills.write":
2430
2463
  case "skills.share":
2431
2464
  case "plugins.set-enabled":
2465
+ case "sessions.assign-project":
2466
+ case "artifacts.resolve-file":
2467
+ case "process.run":
2432
2468
  case "sessions.annotate":
2433
2469
  case "sessions.compact":
2434
2470
  case "soul.write":
@@ -3754,6 +3790,8 @@ function createContributionsSchemas(canonical) {
3754
3790
  const UriModuleFacts2 = z14.strictObject(UriModuleFactsShape);
3755
3791
  const UriModuleContribution2 = z14.strictObject({
3756
3792
  localId: LocalContributionId2,
3793
+ /** Opaque adapter id for account-bound connections; never namespaced. */
3794
+ adapterId: z14.string().min(1).optional(),
3757
3795
  schemes: z14.array(UriScheme2).min(1),
3758
3796
  displayName: OptionalDisplayName,
3759
3797
  ...UriModuleFactsShape,
@@ -3788,6 +3826,7 @@ function createContributionsSchemas(canonical) {
3788
3826
  looksUpWebLinks: z14.literal(true).optional()
3789
3827
  });
3790
3828
  const AppUriModuleContribution2 = UriModuleContribution2.omit({
3829
+ adapterId: true,
3791
3830
  authActions: true,
3792
3831
  authService: true,
3793
3832
  authScheme: true,
@@ -4399,6 +4438,13 @@ function createContributionsSchemas(canonical) {
4399
4438
  });
4400
4439
  const KayUiAppHostCapability2 = z14.enum([
4401
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",
4402
4448
  // Lets `navigation.openChat` create a blank chat (no message, no model
4403
4449
  // turn) when no session id is given. It never sends anything.
4404
4450
  "sessions.create",
@@ -4408,12 +4454,15 @@ function createContributionsSchemas(canonical) {
4408
4454
  // Draws Bonsai's markdown document view in the app's page (`BonsaiMarkdownDocumentView`).
4409
4455
  // It reads and saves nothing: the app supplies the text and keeps the edits.
4410
4456
  "markdown.document-view",
4411
- "models.complete",
4412
4457
  // Draws links the host resolves and opens (`BonsaiReferencePill`, `BonsaiReferenceRow`,
4413
4458
  // `BonsaiReferenceMarkdown`). A person's click on one can open a session or another plugin's page.
4414
4459
  "references.open",
4415
4460
  // Server-rated organization billing, distinct from local/provider cost.
4416
4461
  "billing.read",
4462
+ "account.read",
4463
+ "plugins.read",
4464
+ "plugins.settings",
4465
+ "permissions.manage",
4417
4466
  "automations.read",
4418
4467
  "automations.run",
4419
4468
  // Lists the shared artifacts the signed-in account may open and opens one in Bonsai's shared
@@ -4518,6 +4567,8 @@ function createContributionsSchemas(canonical) {
4518
4567
  icon: PackageAssetPath2.optional(),
4519
4568
  companion: z14.boolean().optional(),
4520
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(),
4521
4572
  aliases: z14.array(NonEmptyString3).optional(),
4522
4573
  openedEvent: NonEmptyString3.optional()
4523
4574
  });
@@ -4732,28 +4783,53 @@ __export(manifest_exports, {
4732
4783
  validateKayUiEventSubscription: () => validateKayUiEventSubscription
4733
4784
  });
4734
4785
 
4735
- // packages/plugin-protocol/dist/shell-commands.js
4786
+ // packages/plugin-protocol/dist/project-directories.js
4736
4787
  import { z as z15 } from "zod";
4737
- var PluginShellCommand = z15.strictObject({
4738
- name: z15.string().regex(/^[a-z][a-z0-9-]*$/),
4739
- aliases: z15.array(z15.string().regex(/^[a-z][a-z0-9-]*$/)).optional(),
4788
+ var PluginProjectDirectories = z15.strictObject({
4789
+ /** An endpoint this plugin's app target declares; called with a {@link ProjectDirectoryRequest}. */
4740
4790
  endpoint: z15.string().min(1),
4741
- usage: 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
+
4811
+ // packages/plugin-protocol/dist/shell-commands.js
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)
4742
4818
  });
4743
- var ShellCommandOutcome = z15.strictObject({
4744
- exitCode: z15.number().int(),
4819
+ var ShellCommandOutcome = z16.strictObject({
4820
+ exitCode: z16.number().int(),
4745
4821
  envelope: JsonValue,
4746
4822
  result: JsonValue.optional()
4747
4823
  });
4748
- var ShellCommandRequest = z15.strictObject({
4749
- argv: z15.array(z15.string()),
4750
- cwd: z15.string(),
4751
- outcomes: z15.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)
4752
4828
  });
4753
- var ShellCommandStep = z15.discriminatedUnion("kind", [
4754
- z15.strictObject({
4755
- kind: z15.literal("invoke"),
4756
- toolName: z15.enum([
4829
+ var ShellCommandStep = z16.discriminatedUnion("kind", [
4830
+ z16.strictObject({
4831
+ kind: z16.literal("invoke"),
4832
+ toolName: z16.enum([
4757
4833
  "read",
4758
4834
  "list",
4759
4835
  "search",
@@ -4762,24 +4838,24 @@ var ShellCommandStep = z15.discriminatedUnion("kind", [
4762
4838
  "delete",
4763
4839
  "help"
4764
4840
  ]),
4765
- input: z15.record(z15.string(), JsonValue),
4766
- flags: z15.record(z15.string(), z15.string())
4841
+ input: z16.record(z16.string(), JsonValue),
4842
+ flags: z16.record(z16.string(), z16.string())
4767
4843
  }),
4768
- z15.strictObject({
4769
- kind: z15.literal("finish"),
4770
- exitCode: z15.number().int(),
4771
- stdout: z15.string()
4844
+ z16.strictObject({
4845
+ kind: z16.literal("finish"),
4846
+ exitCode: z16.number().int(),
4847
+ stdout: z16.string()
4772
4848
  })
4773
4849
  ]);
4774
4850
 
4775
4851
  // packages/plugin-protocol/dist/manifest.js
4776
- import { z as z17 } from "zod";
4852
+ import { z as z18 } from "zod";
4777
4853
 
4778
4854
  // packages/plugin-protocol/dist/workload-purposes.js
4779
- import { z as z16 } from "zod";
4780
- var PluginWorkloadPurpose = z16.strictObject({
4781
- purpose: z16.string().regex(/^[a-z][a-z0-9-]*$/),
4782
- workloadClass: z16.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"])
4783
4859
  });
4784
4860
 
4785
4861
  // packages/plugin-protocol/dist/synthetic-contributions.js
@@ -4805,34 +4881,34 @@ function createManifestSchemas(canonical) {
4805
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;
4806
4882
  const { HttpsUrl: HttpsUrl2, LocalContributionId: LocalContributionId2, NonEmptyString: NonEmptyString3, PackageAssetPath: PackageAssetPath2, PluginId: PluginId2, PluginNamespace: PluginNamespace2, RegistrableDomain: RegistrableDomain2, SignedInStatusCode: SignedInStatusCode2, TargetEntrypoint: TargetEntrypoint2 } = canonical ? canonicalCommonSchemas : common_exports;
4807
4883
  const { PluginPermissionManifest: PluginPermissionManifest2 } = canonical ? canonicalPermissionSchemas : permissions_exports;
4808
- const KayAgentTargetManifest2 = z17.strictObject({
4884
+ const KayAgentTargetManifest2 = z18.strictObject({
4809
4885
  entrypoint: TargetEntrypoint2,
4810
- contributes: z17.strictObject({
4811
- tools: z17.array(AgentToolContribution2).optional(),
4812
- converters: z17.array(ConverterContribution2).optional(),
4813
- uriModules: z17.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(),
4814
4890
  // Host-composed artifact-backed schemes (see `ArtifactUriModuleContribution`): the plugin
4815
4891
  // declares scheme + editability; the daemon binds each to the kernel's artifact lifecycle
4816
4892
  // per session. Separate from `uriModules` (plugin-implemented backends) precisely because
4817
4893
  // the plugin registers NOTHING for these at activation.
4818
- artifactUriModules: z17.array(ArtifactUriModuleContribution2).optional(),
4819
- cliBindings: z17.array(CliBindingContribution2).optional(),
4894
+ artifactUriModules: z18.array(ArtifactUriModuleContribution2).optional(),
4895
+ cliBindings: z18.array(CliBindingContribution2).optional(),
4820
4896
  // Which git hosts this plugin's credential serves (see `GitHostContribution`): a
4821
4897
  // declaration, so a plugin for any git backend gets credentialed clones without
4822
4898
  // the daemon learning its name. Sibling of `cliBindings` because both answer the
4823
4899
  // same question - which of this plugin's auth services a host-side consumer
4824
4900
  // resolves - for two different transports.
4825
- gitHosts: z17.array(GitHostContribution2).optional(),
4826
- resources: z17.array(ResourceContribution2).optional(),
4827
- skills: z17.array(SkillContribution2).optional(),
4828
- searchProviders: z17.array(SearchProviderContribution2).optional(),
4829
- interactionDrivers: z17.array(InteractionDriverContribution2).optional(),
4830
- entityResolvers: z17.array(EntityResolverContribution2).optional(),
4831
- renderers: z17.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(),
4832
4908
  // Handler restricted to skill | tool by the manifest-level refinement below (see
4833
4909
  // `CommandContribution`'s doc for why the restriction is not expressed in the type, and
4834
4910
  // `CommandHandler`'s doc for why there is no promptTemplate variant to declare here).
4835
- commands: z17.array(CommandContribution2).optional()
4911
+ commands: z18.array(CommandContribution2).optional()
4836
4912
  }).optional(),
4837
4913
  /**
4838
4914
  * The plugin's primer skill - the `localId` of one of its own declared
@@ -4868,8 +4944,8 @@ function createManifestSchemas(canonical) {
4868
4944
  * grant a person approved), and a body over 500 words is dropped.
4869
4945
  */
4870
4946
  prompt: PackageAssetPath2.optional(),
4871
- promptOrder: z17.number().finite().optional(),
4872
- familyFolder: z17.strictObject({ scope: z17.literal("root") }).optional(),
4947
+ promptOrder: z18.number().finite().optional(),
4948
+ familyFolder: z18.strictObject({ scope: z18.literal("root") }).optional(),
4873
4949
  /**
4874
4950
  * External origins of skills this plugin claims as its own (see
4875
4951
  * {@link PluginSkillSourceDeclaration}). Acquired by the daemon at boot and landed under the
@@ -4880,61 +4956,61 @@ function createManifestSchemas(canonical) {
4880
4956
  * acquisition, not declared here, so there is nothing for the resolved contract to mint a
4881
4957
  * `globalId` for at parse time.
4882
4958
  */
4883
- skillSources: z17.array(PluginSkillSourceDeclaration2).optional()
4959
+ skillSources: z18.array(PluginSkillSourceDeclaration2).optional()
4884
4960
  });
4885
- const KayAppTargetManifest2 = z17.strictObject({
4961
+ const KayAppTargetManifest2 = z18.strictObject({
4886
4962
  // Optional, like `kay.ui`'s: a target may carry only declarative `contributes` (e.g. a plugin
4887
4963
  // that ships nothing but `mcpServers`) with no app-lifetime module for the host to load.
4888
4964
  entrypoint: TargetEntrypoint2.optional(),
4889
- contributes: z17.strictObject({
4965
+ contributes: z18.strictObject({
4890
4966
  // Session tools implemented by the app-lifetime activation (registered once, injected into
4891
4967
  // every session with a host-stamped session context) - the tool counterpart of `uriModules`
4892
4968
  // below. Same descriptor shape as kay.agent tools; `toolName` shares ONE flat session
4893
4969
  // namespace with them (enforced by the manifest-level refinement below).
4894
- tools: z17.array(ToolContribution2).optional(),
4895
- endpoints: z17.array(EndpointContribution2).optional(),
4896
- cards: z17.array(PluginCardContribution2).optional(),
4897
- uriModules: z17.array(AppUriModuleContribution2).optional(),
4898
- dataSources: z17.array(AppDataSourceContribution2).optional(),
4899
- whiteboardTypes: z17.array(WhiteboardTypeContribution2).optional(),
4900
- approvalTypes: z17.array(ApprovalTypeContribution2).optional(),
4901
- workflows: z17.array(WorkflowContribution2).optional(),
4902
- eventDefinitions: z17.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(),
4903
4979
  // Default notification rules over this plugin's own `eventDefinitions`; seeded by the host
4904
4980
  // (see `PluginNotificationRuleContribution`).
4905
- notificationRules: z17.array(PluginNotificationRuleContribution2).optional(),
4906
- productEvents: z17.array(PluginProductEventContribution2).optional(),
4907
- eventSubscriptions: z17.array(AppEventSubscription2).optional(),
4908
- deviceDelegations: z17.array(DeviceDelegationContribution2).optional(),
4909
- sessionReaders: z17.array(SessionReaderContribution2).optional(),
4910
- contextContributors: z17.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(),
4911
4987
  // Vendored MCP servers this plugin ships (see `McpServerContributions`). Each is hosted only
4912
4988
  // for a plugin holding `mcp.host-server` for its name and URL; that is decided at
4913
4989
  // composition, not here (see ARCHITECTURE.md "Validation Law").
4914
4990
  mcpServers: McpServerContributions2.optional(),
4915
4991
  // Handler restricted to endpoint-only by the manifest-level refinement below.
4916
- commands: z17.array(CommandContribution2).optional()
4992
+ commands: z18.array(CommandContribution2).optional()
4917
4993
  }).optional()
4918
4994
  });
4919
- const KayUiTargetManifest2 = z17.strictObject({
4995
+ const KayUiTargetManifest2 = z18.strictObject({
4920
4996
  entrypoint: TargetEntrypoint2.extend({
4921
- format: z17.literal("compiled-bundle").optional()
4997
+ format: z18.literal("compiled-bundle").optional()
4922
4998
  }).optional(),
4923
- contributes: z17.strictObject({
4924
- commands: z17.array(UiCommandContribution2).optional(),
4925
- slots: z17.array(UiSlotContribution2).optional(),
4926
- referencePresentations: z17.array(ReferencePresentationContribution2).optional(),
4927
- apps: z17.array(UiAppContribution2).optional(),
4928
- railEntries: z17.array(UiRailEntryContribution2).optional(),
4929
- toastPreviews: z17.array(UiToastPreviewContribution2).optional(),
4930
- pages: z17.array(UiPageContribution2).optional(),
4931
- themes: z17.array(ThemeContribution2).optional(),
4932
- eventSubscriptions: z17.array(UiEventSubscriptionContribution2).optional(),
4933
- dataMaterializers: z17.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()
4934
5010
  }).optional()
4935
5011
  });
4936
- const PluginConfigScope2 = z17.enum(["global", "project", "agent"]);
4937
- const PluginConfigSectionManifest2 = z17.strictObject({
5012
+ const PluginConfigScope2 = z18.enum(["global", "project", "agent"]);
5013
+ const PluginConfigSectionManifest2 = z18.strictObject({
4938
5014
  section: NonEmptyString3.optional(),
4939
5015
  schema: JsonSchema,
4940
5016
  /**
@@ -4952,23 +5028,23 @@ function createManifestSchemas(canonical) {
4952
5028
  * is the baseline every section has; `agent` has no runtime mapping (the
4953
5029
  * agent/entity fold is downstream of the document protocol).
4954
5030
  */
4955
- scopes: z17.array(PluginConfigScope2).optional()
5031
+ scopes: z18.array(PluginConfigScope2).optional()
4956
5032
  });
4957
- const PluginConfigManifest2 = z17.array(PluginConfigSectionManifest2).min(1);
4958
- const PluginStorageManifest2 = z17.strictObject({
4959
- sqlite: z17.strictObject({
4960
- enabled: z17.boolean(),
4961
- ownerTarget: z17.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(),
4962
5038
  migrations: NonEmptyString3.optional()
4963
5039
  }).optional(),
4964
- dataDir: z17.strictObject({
4965
- enabled: z17.boolean(),
4966
- ownerTarget: z17.literal("kay.app").optional(),
5040
+ dataDir: z18.strictObject({
5041
+ enabled: z18.boolean(),
5042
+ ownerTarget: z18.literal("kay.app").optional(),
4967
5043
  sharedWith: PluginId2.optional()
4968
5044
  }).optional()
4969
5045
  });
4970
- const PluginOAuthClientSupplier2 = z17.enum(["kay", "user"]);
4971
- const PluginProvisioningProbe2 = z17.strictObject({
5046
+ const PluginOAuthClientSupplier2 = z18.enum(["kay", "user"]);
5047
+ const PluginProvisioningProbe2 = z18.strictObject({
4972
5048
  /**
4973
5049
  * The API endpoint that answers the question. The host sends the service's OWN credential here,
4974
5050
  * so this must belong to the provider that minted it - enforced by the daemon against the
@@ -4976,13 +5052,13 @@ function createManifestSchemas(canonical) {
4976
5052
  */
4977
5053
  url: HttpsUrl2,
4978
5054
  /** Absent => `GET`. */
4979
- method: z17.enum(["GET"]).optional(),
5055
+ method: z18.enum(["GET"]).optional(),
4980
5056
  /**
4981
5057
  * The statuses that make the response a VERDICT at all. Anything else (a 401 from a stale
4982
5058
  * token, a 5xx, a rate limit) means the probe learned nothing and reports `unknown` - never
4983
5059
  * `unsatisfied`, which would tell a user to go fix setup that is fine.
4984
5060
  */
4985
- verdictStatuses: z17.array(SignedInStatusCode2).min(1),
5061
+ verdictStatuses: z18.array(SignedInStatusCode2).min(1),
4986
5062
  /**
4987
5063
  * Dot-path to a JSON array in the response body that must be NON-EMPTY for the requirement to
4988
5064
  * count as satisfied (e.g. `installations`). Absent means a verdict status alone is enough.
@@ -4991,7 +5067,7 @@ function createManifestSchemas(canonical) {
4991
5067
  */
4992
5068
  nonEmptyArrayAt: NonEmptyString3.optional()
4993
5069
  });
4994
- const PluginProvisioningRequirement2 = z17.strictObject({
5070
+ const PluginProvisioningRequirement2 = z18.strictObject({
4995
5071
  /** Stable id, unique within the scheme. */
4996
5072
  id: LocalContributionId2,
4997
5073
  /** Human-facing requirement name, e.g. "GitHub App installation". */
@@ -5008,7 +5084,7 @@ function createManifestSchemas(canonical) {
5008
5084
  probe: PluginProvisioningProbe2
5009
5085
  });
5010
5086
  const PluginProvisioningField = {
5011
- provisioning: z17.array(PluginProvisioningRequirement2).optional()
5087
+ provisioning: z18.array(PluginProvisioningRequirement2).optional()
5012
5088
  };
5013
5089
  const PluginAuthSchemeDescriptionFields = {
5014
5090
  /** Human-facing flow name; absent, the service's name stands in. */
@@ -5024,17 +5100,21 @@ function createManifestSchemas(canonical) {
5024
5100
  const PluginAuthSchemeOAuthEndpointFields = {
5025
5101
  authorizationUrl: HttpsUrl2,
5026
5102
  tokenUrl: HttpsUrl2,
5103
+ /** Initial connect scopes; absent uses `scopes`, while an empty array requests none. */
5104
+ connectScopes: z18.array(NonEmptyString3).optional(),
5027
5105
  /** Provider-specific query parameters added to the authorize URL. */
5028
- extraAuthorizeParams: z17.record(NonEmptyString3, z17.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()
5029
5109
  };
5030
- const PluginAuthSchemeAccountLookup = z17.literal("lookup");
5031
- const PluginAuthSchemeOAuthPkce = z17.strictObject({
5110
+ const PluginAuthSchemeAccountLookup = z18.literal("lookup");
5111
+ const PluginAuthSchemeOAuthPkce = z18.strictObject({
5032
5112
  ...PluginProvisioningField,
5033
5113
  ...PluginAuthSchemeDescriptionFields,
5034
5114
  ...PluginAuthSchemeOAuthEndpointFields,
5035
5115
  localId: LocalContributionId2,
5036
- kind: z17.literal("oauth2"),
5037
- exchange: z17.literal("pkce"),
5116
+ kind: z18.literal("oauth2"),
5117
+ exchange: z18.literal("pkce"),
5038
5118
  byoocProfile: PluginByoocProfile.optional(),
5039
5119
  /**
5040
5120
  * A public client id the plugin ships for its own sign-in. Only an installed plugin's is used:
@@ -5058,7 +5138,7 @@ function createManifestSchemas(canonical) {
5058
5138
  * runs on an untrusted manifest, so a hand-built `["kay","kay"]` must be refused here, not
5059
5139
  * silently normalized).
5060
5140
  */
5061
- clientSuppliers: z17.array(PluginOAuthClientSupplier2).nonempty().superRefine((suppliers, ctx) => {
5141
+ clientSuppliers: z18.array(PluginOAuthClientSupplier2).nonempty().superRefine((suppliers, ctx) => {
5062
5142
  if (new Set(suppliers).size !== suppliers.length) {
5063
5143
  ctx.addIssue({
5064
5144
  code: "custom",
@@ -5066,7 +5146,7 @@ function createManifestSchemas(canonical) {
5066
5146
  });
5067
5147
  }
5068
5148
  }),
5069
- scopes: z17.array(NonEmptyString3).optional()
5149
+ scopes: z18.array(NonEmptyString3).optional()
5070
5150
  }).refine((scheme) => scheme.byoocProfile === void 0 || scheme.clientSuppliers.includes("user"), {
5071
5151
  message: "An own-client profile requires the user client supplier.",
5072
5152
  path: ["byoocProfile"]
@@ -5077,33 +5157,33 @@ function createManifestSchemas(canonical) {
5077
5157
  message: "a scheme with its own clientId names where its account comes from (`account`)",
5078
5158
  path: ["account"]
5079
5159
  });
5080
- const PluginAuthSchemeOAuthConfidential = z17.strictObject({
5160
+ const PluginAuthSchemeOAuthConfidential = z18.strictObject({
5081
5161
  ...PluginProvisioningField,
5082
5162
  ...PluginAuthSchemeDescriptionFields,
5083
5163
  ...PluginAuthSchemeOAuthEndpointFields,
5084
5164
  localId: LocalContributionId2,
5085
- kind: z17.literal("oauth2"),
5086
- exchange: z17.literal("confidential"),
5165
+ kind: z18.literal("oauth2"),
5166
+ exchange: z18.literal("confidential"),
5087
5167
  /** Absent means `["kay"]` - a confidential exchange's secret may only ever be Bonsai's. */
5088
- clientSuppliers: z17.tuple([z17.literal("kay")]).optional(),
5089
- scopes: z17.array(NonEmptyString3).optional(),
5168
+ clientSuppliers: z18.tuple([z18.literal("kay")]).optional(),
5169
+ scopes: z18.array(NonEmptyString3).optional(),
5090
5170
  /** Where the account comes from (see {@link PluginAuthSchemeAccountLookup}). */
5091
- account: z17.union([PluginAuthSchemeAccountLookup, z17.literal("sign-in")])
5171
+ account: z18.union([PluginAuthSchemeAccountLookup, z18.literal("sign-in")])
5092
5172
  });
5093
- const PluginAuthSchemeOAuth2 = z17.discriminatedUnion("exchange", [
5173
+ const PluginAuthSchemeOAuth2 = z18.discriminatedUnion("exchange", [
5094
5174
  PluginAuthSchemeOAuthPkce,
5095
5175
  PluginAuthSchemeOAuthConfidential
5096
5176
  ]);
5097
- const PluginAuthSchemeApiKey = z17.strictObject({
5177
+ const PluginAuthSchemeApiKey = z18.strictObject({
5098
5178
  ...PluginProvisioningField,
5099
5179
  ...PluginAuthSchemeDescriptionFields,
5100
5180
  localId: LocalContributionId2,
5101
- kind: z17.literal("api-key"),
5102
- scopes: z17.array(NonEmptyString3).optional(),
5181
+ kind: z18.literal("api-key"),
5182
+ scopes: z18.array(NonEmptyString3).optional(),
5103
5183
  /** The connect prompt's label for the key. Absent: "<service name> API key". */
5104
5184
  inputLabel: NonEmptyString3.optional(),
5105
5185
  /** Two or more labeled inputs for a secret that comes in parts; absent asks for one key. */
5106
- fields: z17.array(z17.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) => {
5107
5187
  if (new Set(fields.map((field) => field.id)).size !== fields.length) {
5108
5188
  ctx.addIssue({
5109
5189
  code: "custom",
@@ -5112,7 +5192,7 @@ function createManifestSchemas(canonical) {
5112
5192
  }
5113
5193
  }).optional(),
5114
5194
  /** Where and how the person creates the key outside Bonsai. */
5115
- setup: z17.strictObject({ instructions: NonEmptyString3, url: HttpsUrl2 }).optional(),
5195
+ setup: z18.strictObject({ instructions: NonEmptyString3, url: HttpsUrl2 }).optional(),
5116
5196
  /**
5117
5197
  * `"lookup"`: the plugin checks a key before it is saved and names its account, with the function
5118
5198
  * it registers (`api.auth.registerAccountLookup`). Absent: the key is saved unchecked, under the
@@ -5120,27 +5200,27 @@ function createManifestSchemas(canonical) {
5120
5200
  */
5121
5201
  account: PluginAuthSchemeAccountLookup.optional()
5122
5202
  });
5123
- const PluginAuthSchemeDelegated = z17.strictObject({
5203
+ const PluginAuthSchemeDelegated = z18.strictObject({
5124
5204
  ...PluginAuthSchemeDescriptionFields,
5125
5205
  localId: LocalContributionId2,
5126
- kind: z17.literal("delegated"),
5127
- scopes: z17.array(NonEmptyString3).optional()
5206
+ kind: z18.literal("delegated"),
5207
+ scopes: z18.array(NonEmptyString3).optional()
5128
5208
  });
5129
- const ExternalCliArgument = z17.string().min(1).max(16384).refine((value) => ![...value].some(isUnsafeArgumentCharacter), {
5209
+ const ExternalCliArgument = z18.string().min(1).max(16384).refine((value) => ![...value].some(isUnsafeArgumentCharacter), {
5130
5210
  message: "an argument may hold tabs and line breaks, but no other control character, no invisible character and no bidirectional override"
5131
5211
  });
5132
- const ExternalCliCommand = z17.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._+-]*$/, {
5133
5213
  message: "a command is an executable's basename (letters, digits, '.', '_', '+', '-'), never a path"
5134
5214
  });
5135
5215
  const ExternalCliHint = NonEmptyString3.max(2048);
5136
- const ExternalCliArguments = z17.array(ExternalCliArgument).max(64);
5216
+ const ExternalCliArguments = z18.array(ExternalCliArgument).max(64);
5137
5217
  const SignedOutMarker = ExternalCliArgument.refine((value) => value.trim() !== "", { message: "a signed-out marker needs text beyond whitespace" });
5138
- const PluginExternalCliConnect2 = z17.strictObject({
5218
+ const PluginExternalCliConnect2 = z18.strictObject({
5139
5219
  /** A basename the host finds on `PATH` (`osascript`, `wrangler`), never a path. */
5140
5220
  binary: ExternalCliCommand,
5141
- probe: z17.strictObject({
5221
+ probe: z18.strictObject({
5142
5222
  args: ExternalCliArguments.min(1),
5143
- timeoutMs: z17.number().int().min(1).max(12e4).optional(),
5223
+ timeoutMs: z18.number().int().min(1).max(12e4).optional(),
5144
5224
  /**
5145
5225
  * The CLI's own signed-out marker: text a failed probe's output (stderr, else stdout) contains
5146
5226
  * when the CLI is signed out. A failure that carries it is a sign-in problem, and only such a
@@ -5148,13 +5228,13 @@ function createManifestSchemas(canonical) {
5148
5228
  * unavailable. Required when `login` is declared, so a timeout never starts a sign-in. A list
5149
5229
  * is for a CLI with several signed-out messages; any one of them counts.
5150
5230
  */
5151
- signedOutMarker: z17.union([SignedOutMarker, z17.array(SignedOutMarker).min(1)]).optional()
5231
+ signedOutMarker: z18.union([SignedOutMarker, z18.array(SignedOutMarker).min(1)]).optional()
5152
5232
  }),
5153
5233
  /** The CLI's interactive sign-in. Absent: connect only probes and reports. */
5154
- login: z17.strictObject({
5234
+ login: z18.strictObject({
5155
5235
  args: ExternalCliArguments.min(1),
5156
- timeoutMs: z17.number().int().min(1).max(6e5).optional(),
5157
- pasteCode: z17.strictObject({
5236
+ timeoutMs: z18.number().int().min(1).max(6e5).optional(),
5237
+ pasteCode: z18.strictObject({
5158
5238
  /** The redeeming argv; the host appends the code as its last argument. */
5159
5239
  args: ExternalCliArguments.min(1),
5160
5240
  /** What the prompt says, for a person. */
@@ -5166,12 +5246,12 @@ function createManifestSchemas(canonical) {
5166
5246
  * for display, or hands it to an agent session that runs it behind the ordinary bash approval.
5167
5247
  * Absent for a binary the OS ships (`osascript`).
5168
5248
  */
5169
- install: z17.strictObject({
5249
+ install: z18.strictObject({
5170
5250
  command: ExternalCliCommand,
5171
5251
  args: ExternalCliArguments
5172
5252
  }).optional(),
5173
5253
  /** Prose for a person: `install` when the binary is missing, `login` when the probe fails. */
5174
- hints: z17.strictObject({
5254
+ hints: z18.strictObject({
5175
5255
  install: ExternalCliHint,
5176
5256
  login: ExternalCliHint
5177
5257
  })
@@ -5184,50 +5264,50 @@ function createManifestSchemas(canonical) {
5184
5264
  });
5185
5265
  }
5186
5266
  });
5187
- const PluginAuthSchemeExternalCli = z17.strictObject({
5267
+ const PluginAuthSchemeExternalCli = z18.strictObject({
5188
5268
  ...PluginAuthSchemeDescriptionFields,
5189
5269
  localId: LocalContributionId2,
5190
- kind: z17.literal("external-cli"),
5191
- scopes: z17.array(NonEmptyString3).optional(),
5270
+ kind: z18.literal("external-cli"),
5271
+ scopes: z18.array(NonEmptyString3).optional(),
5192
5272
  cli: PluginExternalCliConnect2.optional()
5193
5273
  });
5194
- const PluginAuthScheme2 = z17.discriminatedUnion("kind", [
5274
+ const PluginAuthScheme2 = z18.discriminatedUnion("kind", [
5195
5275
  PluginAuthSchemeOAuth2,
5196
5276
  PluginAuthSchemeApiKey,
5197
5277
  PluginAuthSchemeDelegated,
5198
5278
  PluginAuthSchemeExternalCli
5199
5279
  ]);
5200
- const PluginWebSessionProbe2 = z17.strictObject({
5280
+ const PluginWebSessionProbe2 = z18.strictObject({
5201
5281
  url: HttpsUrl2,
5202
5282
  /** Absent => `GET`. `POST` sends an empty JSON object body. */
5203
- method: z17.enum(["GET", "POST"]).optional(),
5204
- signedInStatuses: z17.array(SignedInStatusCode2).min(1)
5283
+ method: z18.enum(["GET", "POST"]).optional(),
5284
+ signedInStatuses: z18.array(SignedInStatusCode2).min(1)
5205
5285
  });
5206
- const PluginWebSessionDeclaration2 = z17.strictObject({
5286
+ const PluginWebSessionDeclaration2 = z18.strictObject({
5207
5287
  /** `required`: capabilities degrade without the site login; `recommended`: it only smooths UX. */
5208
- importance: z17.enum(["required", "recommended"]),
5288
+ importance: z18.enum(["required", "recommended"]),
5209
5289
  loginUrl: HttpsUrl2,
5210
- cookieDomains: z17.array(RegistrableDomain2).min(1),
5290
+ cookieDomains: z18.array(RegistrableDomain2).min(1),
5211
5291
  probe: PluginWebSessionProbe2,
5212
- oauthVenue: z17.enum(["embedded", "external"]),
5292
+ oauthVenue: z18.enum(["embedded", "external"]),
5213
5293
  /**
5214
5294
  * Where a page goes first when it opens in one of Bonsai's browser panes and this site login
5215
5295
  * is missing: a sign-in page that continues to the page. A template with `:email` and `:url`
5216
5296
  * (see `UriClaimTemplate`), on a host within `cookieDomains`.
5217
5297
  */
5218
- signInFirst: z17.string().optional()
5298
+ signInFirst: z18.string().optional()
5219
5299
  }).superRefine(refineWebSessionScopeConfined);
5220
- const PluginAuthService2 = z17.strictObject({
5300
+ const PluginAuthService2 = z18.strictObject({
5221
5301
  localId: LocalContributionId2,
5222
5302
  displayName: NonEmptyString3,
5223
5303
  /** One plain sentence on what connecting this service gives Bonsai. */
5224
5304
  summary: NonEmptyString3.optional(),
5225
- schemes: z17.array(PluginAuthScheme2).min(1),
5226
- purposes: z17.array(NonEmptyString3).min(1),
5305
+ schemes: z18.array(PluginAuthScheme2).min(1),
5306
+ purposes: z18.array(NonEmptyString3).min(1),
5227
5307
  webSession: PluginWebSessionDeclaration2.optional()
5228
5308
  });
5229
- const PluginAuthManifest2 = z17.strictObject({
5230
- services: z17.array(PluginAuthService2).optional()
5309
+ const PluginAuthManifest2 = z18.strictObject({
5310
+ services: z18.array(PluginAuthService2).optional()
5231
5311
  });
5232
5312
  function stripRetiredCompatibilityKeys(value) {
5233
5313
  if (typeof value !== "object" || value === null || Array.isArray(value)) {
@@ -5238,17 +5318,17 @@ function createManifestSchemas(canonical) {
5238
5318
  delete remaining[key];
5239
5319
  return remaining;
5240
5320
  }
5241
- const PluginCompatibilityFields = z17.strictObject({
5242
- supportedProtocols: z17.array(KayPluginProtocolVersion).optional(),
5321
+ const PluginCompatibilityFields = z18.strictObject({
5322
+ supportedProtocols: z18.array(KayPluginProtocolVersion).optional(),
5243
5323
  minKayVersion: NonEmptyString3.optional(),
5244
5324
  sdk: NonEmptyString3.optional()
5245
5325
  });
5246
- const PluginCompatibilityManifest2 = canonical ? PluginCompatibilityFields : z17.preprocess(stripRetiredCompatibilityKeys, PluginCompatibilityFields);
5326
+ const PluginCompatibilityManifest2 = canonical ? PluginCompatibilityFields : z18.preprocess(stripRetiredCompatibilityKeys, PluginCompatibilityFields);
5247
5327
  const KayVersionString2 = NonEmptyString3.regex(SEMVER_PATTERN, {
5248
5328
  message: "version must be semver, for example 1.2.3"
5249
5329
  });
5250
- const KayPluginManifestV12 = z17.strictObject({
5251
- protocol: z17.literal(KAY_PLUGIN_PROTOCOL_VERSION),
5330
+ const KayPluginManifestV12 = z18.strictObject({
5331
+ protocol: z18.literal(KAY_PLUGIN_PROTOCOL_VERSION),
5252
5332
  id: PluginId2,
5253
5333
  displayName: NonEmptyString3,
5254
5334
  version: KayVersionString2,
@@ -5276,8 +5356,8 @@ function createManifestSchemas(canonical) {
5276
5356
  icon: PackageAssetPath2.optional(),
5277
5357
  iconDark: PackageAssetPath2.optional(),
5278
5358
  namespace: PluginNamespace2.optional(),
5279
- targets: z17.strictObject({
5280
- kay: z17.strictObject({
5359
+ targets: z18.strictObject({
5360
+ kay: z18.strictObject({
5281
5361
  agent: KayAgentTargetManifest2.optional(),
5282
5362
  app: KayAppTargetManifest2.optional(),
5283
5363
  ui: KayUiTargetManifest2.optional()
@@ -5285,8 +5365,9 @@ function createManifestSchemas(canonical) {
5285
5365
  }).optional(),
5286
5366
  config: PluginConfigManifest2.optional(),
5287
5367
  storage: PluginStorageManifest2.optional(),
5288
- workloadPurposes: z17.array(PluginWorkloadPurpose).optional(),
5289
- shellCommands: z17.array(PluginShellCommand).optional(),
5368
+ workloadPurposes: z18.array(PluginWorkloadPurpose).optional(),
5369
+ shellCommands: z18.array(PluginShellCommand).optional(),
5370
+ projectDirectories: PluginProjectDirectories.optional(),
5290
5371
  auth: PluginAuthManifest2.optional(),
5291
5372
  permissions: PluginPermissionManifest2.optional(),
5292
5373
  compatibility: PluginCompatibilityManifest2.optional(),
@@ -5296,15 +5377,15 @@ function createManifestSchemas(canonical) {
5296
5377
  * schemes then report `ownedByBonsai`. Honoured only for a plugin that ships with Bonsai: the
5297
5378
  * host reads any other plugin's flag as false. Absent => false.
5298
5379
  */
5299
- ownedByBonsai: z17.boolean().optional(),
5380
+ ownedByBonsai: z18.boolean().optional(),
5300
5381
  /**
5301
5382
  * Explicit plugin-level dependencies - other plugins this plugin requires to be present in the
5302
5383
  * composed roster. At composition time the runtime checks each id against the accepted
5303
5384
  * registration list and derives a provenance-complete dependency graph (together with implicit
5304
5385
  * auth-service edges from `consumesAuthServices`). Absent => no explicit dependencies.
5305
5386
  */
5306
- dependencies: z17.strictObject({
5307
- plugins: z17.array(PluginId2).optional()
5387
+ dependencies: z18.strictObject({
5388
+ plugins: z18.array(PluginId2).optional()
5308
5389
  }).optional()
5309
5390
  }).superRefine((manifest, ctx) => {
5310
5391
  const sharedWith = manifest.storage?.dataDir?.sharedWith;
@@ -5598,6 +5679,22 @@ function createManifestSchemas(canonical) {
5598
5679
  ...manifest.targets?.kay?.agent?.contributes?.uriModules ?? [],
5599
5680
  ...manifest.targets?.kay?.app?.contributes?.uriModules ?? []
5600
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
+ }
5601
5698
  for (const [index, type] of types.entries()) {
5602
5699
  if ((type.directory !== void 0 || type.handover === true) && manifest.targets?.kay?.agent?.familyFolder?.scope !== "root") {
5603
5700
  ctx.addIssue({
@@ -6182,15 +6279,21 @@ function createManifestSchemas(canonical) {
6182
6279
  });
6183
6280
  }
6184
6281
  }
6185
- 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) {
6186
6289
  for (const [endpointIndex, endpoint] of (app.capabilities?.endpoints ?? []).entries()) {
6187
6290
  const path = [
6188
6291
  "targets",
6189
6292
  "kay",
6190
6293
  "ui",
6191
6294
  "contributes",
6192
- "apps",
6193
- appIndex,
6295
+ app.kind,
6296
+ app.index,
6194
6297
  "capabilities",
6195
6298
  "endpoints",
6196
6299
  endpointIndex
@@ -6201,13 +6304,13 @@ function createManifestSchemas(canonical) {
6201
6304
  ctx.addIssue({
6202
6305
  code: "custom",
6203
6306
  path,
6204
- message: `ui app ${app.localId} references unknown endpoint ${endpoint}`
6307
+ message: `ui app ${app.id} references unknown endpoint ${endpoint}`
6205
6308
  });
6206
6309
  } else if (!invokedUiEndpoints.has(endpoint)) {
6207
6310
  ctx.addIssue({
6208
6311
  code: "custom",
6209
6312
  path,
6210
- 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`
6211
6314
  });
6212
6315
  }
6213
6316
  }
@@ -6497,7 +6600,7 @@ function pushContributionIds(output, path, items) {
6497
6600
  }
6498
6601
 
6499
6602
  // packages/plugin-protocol/dist/plugin-directory-verdict.js
6500
- import { z as z19 } from "zod";
6603
+ import { z as z20 } from "zod";
6501
6604
 
6502
6605
  // packages/plugin-protocol/dist/plugin-load-diagnostic.js
6503
6606
  var PLUGIN_DIAGNOSTIC_MESSAGE_CAP = 300;
@@ -6506,14 +6609,14 @@ function boundPluginDiagnosticMessage(message) {
6506
6609
  }
6507
6610
 
6508
6611
  // packages/plugin-protocol/dist/resolved-contract.js
6509
- import { z as z18 } from "zod";
6612
+ import { z as z19 } from "zod";
6510
6613
  function createResolvedContractSchemas(canonical) {
6511
6614
  const { PluginEventLocalId: PluginEventLocalId2 } = canonical ? canonicalPluginEventSchemas : plugin_events_exports;
6512
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;
6513
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;
6514
6617
  const { PluginExternalCliConnect: PluginExternalCliConnect2, PluginOAuthClientSupplier: PluginOAuthClientSupplier2 } = canonical ? canonicalManifestSchemas : manifest_exports;
6515
6618
  const { ResolvedPluginGrants: ResolvedPluginGrants2 } = canonical ? canonicalPermissionSchemas : permissions_exports;
6516
- const ResolvedPluginContributionId2 = z18.strictObject({
6619
+ const ResolvedPluginContributionId2 = z19.strictObject({
6517
6620
  target: PluginTargetName,
6518
6621
  kind: PluginContributionKindSchema,
6519
6622
  localId: PluginEventLocalId2,
@@ -6527,55 +6630,55 @@ function createResolvedContractSchemas(canonical) {
6527
6630
  });
6528
6631
  }
6529
6632
  });
6530
- const ResolvedKayToolId = z18.strictObject({
6633
+ const ResolvedKayToolId = z19.strictObject({
6531
6634
  localId: LocalContributionId2,
6532
6635
  globalId: GlobalContributionId2,
6533
6636
  toolName: PluginToolName2
6534
6637
  });
6535
- const ResolvedKayAgentTool2 = z18.strictObject({
6638
+ const ResolvedKayAgentTool2 = z19.strictObject({
6536
6639
  ...ResolvedKayToolId.shape,
6537
6640
  displayName: NonEmptyString3.optional(),
6538
6641
  description: NonEmptyString3.optional(),
6539
6642
  parameters: JsonSchema.optional(),
6540
- executionMode: z18.enum(["sequential", "parallel"]).optional(),
6643
+ executionMode: z19.enum(["sequential", "parallel"]).optional(),
6541
6644
  promptSnippet: NonEmptyString3.optional(),
6542
- promptGuidelines: z18.array(NonEmptyString3).optional(),
6543
- requiresAuth: z18.strictObject({
6645
+ promptGuidelines: z19.array(NonEmptyString3).optional(),
6646
+ requiresAuth: z19.strictObject({
6544
6647
  serviceId: GlobalContributionId2,
6545
6648
  schemeId: GlobalContributionId2.optional()
6546
6649
  }).optional(),
6547
6650
  permission: canonical ? canonicalContributionSchemas.ToolPermission.optional() : ToolPermission.optional()
6548
6651
  });
6549
6652
  const ResolvedKayAppTool2 = ResolvedKayAgentTool2.omit({ requiresAuth: true });
6550
- const ResolvedKayAppDataSource2 = z18.strictObject({
6653
+ const ResolvedKayAppDataSource2 = z19.strictObject({
6551
6654
  localId: LocalContributionId2,
6552
6655
  globalId: GlobalContributionId2,
6553
- scope: z18.enum(["runtime", "account", "session"]),
6554
- snapshot: z18.strictObject({
6555
- version: z18.number().int().positive(),
6556
- schema: z18.record(z18.string(), z18.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())
6557
6660
  }),
6558
- change: z18.strictObject({
6559
- version: z18.number().int().positive(),
6560
- schema: z18.record(z18.string(), z18.unknown()),
6561
- semantics: z18.discriminatedUnion("kind", [
6562
- z18.strictObject({ kind: z18.literal("incremental") }),
6563
- z18.strictObject({
6564
- kind: z18.literal("snapshot-replacement"),
6565
- maxEncodedBytes: z18.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(),
6566
6669
  rationale: pluginString(canonical).min(1).max(1024)
6567
6670
  })
6568
6671
  ]).optional()
6569
6672
  }),
6570
6673
  read: AppDataSourceRead.optional(),
6571
- messageDraft: z18.strictObject({ schemes: z18.array(UriScheme2).min(1) }).optional(),
6572
- store: z18.discriminatedUnion("shape", [
6573
- z18.strictObject({
6574
- shape: z18.literal("rows"),
6575
- rowsField: z18.string().min(1),
6576
- key: z18.array(z18.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)
6577
6680
  }),
6578
- z18.strictObject({ shape: z18.literal("value") })
6681
+ z19.strictObject({ shape: z19.literal("value") })
6579
6682
  ]).optional()
6580
6683
  }).superRefine((source, ctx) => {
6581
6684
  if (source.read !== void 0 && source.scope !== "session") {
@@ -6595,122 +6698,123 @@ function createResolvedContractSchemas(canonical) {
6595
6698
  /** The auth service that module signs in through, whose accounts a card may send from. */
6596
6699
  authService: GlobalContributionId2.optional()
6597
6700
  });
6598
- const ResolvedPluginCard2 = z18.strictObject({
6701
+ const ResolvedPluginCard2 = z19.strictObject({
6599
6702
  localId: LocalContributionId2,
6600
6703
  globalId: GlobalContributionId2,
6601
6704
  pluginId: PluginId2,
6602
6705
  description: NonEmptyString3,
6603
6706
  inputs: JsonSchema,
6604
- readEndpoint: z18.strictObject({
6707
+ readEndpoint: z19.strictObject({
6605
6708
  localId: LocalContributionId2,
6606
6709
  globalId: GlobalContributionId2
6607
6710
  }),
6608
- submitEndpoint: z18.strictObject({
6711
+ submitEndpoint: z19.strictObject({
6609
6712
  localId: LocalContributionId2,
6610
6713
  globalId: GlobalContributionId2
6611
6714
  }),
6612
6715
  authService: GlobalContributionId2.optional()
6613
6716
  });
6614
- const ResolvedKayAppWorkflow2 = z18.strictObject({
6717
+ const ResolvedKayAppWorkflow2 = z19.strictObject({
6615
6718
  localId: LocalContributionId2,
6616
6719
  globalId: GlobalContributionId2,
6617
6720
  name: NonEmptyString3,
6618
6721
  description: NonEmptyString3,
6619
- everyMs: z18.number().int().positive(),
6620
- auth: z18.strictObject({
6722
+ everyMs: z19.number().int().positive(),
6723
+ auth: z19.strictObject({
6621
6724
  serviceId: GlobalContributionId2,
6622
6725
  schemeId: GlobalContributionId2,
6623
- scopes: z18.array(NonEmptyString3).min(1).optional()
6726
+ scopes: z19.array(NonEmptyString3).min(1).optional()
6624
6727
  }).optional()
6625
6728
  });
6626
6729
  const ResolvedKayAppWhiteboardType2 = WhiteboardTypeContribution2.safeExtend({
6627
6730
  globalId: GlobalContributionId2
6628
6731
  });
6629
- const ResolvedKayAppMcpServer2 = z18.strictObject({
6732
+ const ResolvedKayAppMcpServer2 = z19.strictObject({
6630
6733
  name: LocalContributionId2,
6631
6734
  pluginId: PluginId2,
6632
6735
  url: McpServerUrl2,
6633
6736
  auth: McpServerAuthMode2,
6634
6737
  authServiceId: GlobalContributionId2.optional()
6635
6738
  });
6636
- const ResolvedKayAgentUriModule2 = z18.strictObject({
6739
+ const ResolvedKayAgentUriModule2 = z19.strictObject({
6637
6740
  localId: LocalContributionId2,
6741
+ adapterId: z19.string().min(1).optional(),
6638
6742
  globalId: GlobalContributionId2,
6639
- schemes: z18.array(UriScheme2).min(1),
6743
+ schemes: z19.array(UriScheme2).min(1),
6640
6744
  displayName: NonEmptyString3.optional(),
6641
6745
  authServiceId: GlobalContributionId2.optional(),
6642
6746
  /** Mirrors `UriModuleContribution.authScheme`; a local ref takes the plugin's namespace. */
6643
6747
  authSchemeId: GlobalContributionId2.optional(),
6644
6748
  /** Mirrors `UriModuleContribution.knownResources` (host-side recording opt-in). */
6645
- knownResources: z18.literal(true).optional(),
6749
+ knownResources: z19.literal(true).optional(),
6646
6750
  /** Mirrors `UriModuleContribution.describesOperations`. */
6647
- describesOperations: z18.literal(true).optional(),
6751
+ describesOperations: z19.literal(true).optional(),
6648
6752
  /** Mirrors `UriModuleContribution.looksUpWebLinks`. */
6649
- looksUpWebLinks: z18.literal(true).optional(),
6753
+ looksUpWebLinks: z19.literal(true).optional(),
6650
6754
  ...UriModuleFacts2.shape
6651
6755
  });
6652
- const ResolvedKayAgentArtifactUriModule2 = z18.strictObject({
6756
+ const ResolvedKayAgentArtifactUriModule2 = z19.strictObject({
6653
6757
  localId: LocalContributionId2,
6654
6758
  globalId: GlobalContributionId2,
6655
6759
  scheme: UriScheme2,
6656
- editable: z18.boolean(),
6657
- listable: z18.boolean(),
6658
- deletable: z18.boolean(),
6659
- appendable: z18.boolean(),
6660
- storageScope: z18.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"])
6661
6765
  });
6662
- const ResolvedKayAgentEntityResolver2 = z18.strictObject({
6766
+ const ResolvedKayAgentEntityResolver2 = z19.strictObject({
6663
6767
  localId: LocalContributionId2,
6664
6768
  globalId: GlobalContributionId2,
6665
6769
  displayName: NonEmptyString3.optional(),
6666
6770
  uriModule: GlobalContributionId2,
6667
- entityTypes: z18.array(NonEmptyString3).min(1),
6771
+ entityTypes: z19.array(NonEmptyString3).min(1),
6668
6772
  uriHint: NonEmptyString3
6669
6773
  });
6670
- const ResolvedKayAgentGitHostClaim2 = z18.strictObject({
6774
+ const ResolvedKayAgentGitHostClaim2 = z19.strictObject({
6671
6775
  host: GitHostName2,
6672
6776
  authServiceId: GlobalContributionId2,
6673
6777
  /** Manifest-declared order; the clone ladder tries them in sequence. */
6674
- authSchemeIds: z18.array(GlobalContributionId2).min(1),
6778
+ authSchemeIds: z19.array(GlobalContributionId2).min(1),
6675
6779
  /** Non-secret display copy for the claiming service, for clone failure text. */
6676
- authServiceDisplayName: z18.string(),
6780
+ authServiceDisplayName: z19.string(),
6677
6781
  basicAuthUser: GitBasicAuthUser2
6678
6782
  });
6679
- const ResolvedKayAgentConverter2 = z18.strictObject({
6783
+ const ResolvedKayAgentConverter2 = z19.strictObject({
6680
6784
  localId: LocalContributionId2,
6681
6785
  globalId: GlobalContributionId2,
6682
6786
  description: NonEmptyString3.optional(),
6683
- mimeTypes: z18.array(MimeTypeString2).min(1),
6684
- extensions: z18.array(FileExtensionToken2).min(1).optional()
6787
+ mimeTypes: z19.array(MimeTypeString2).min(1),
6788
+ extensions: z19.array(FileExtensionToken2).min(1).optional()
6685
6789
  });
6686
6790
  const ResolvedReferencePresentationUrlClaim = ReferencePresentationUrlClaim2.extend({
6687
- brandIcon: z18.string().max(64 * 1024).optional()
6791
+ brandIcon: z19.string().max(64 * 1024).optional()
6688
6792
  });
6689
- const ResolvedReferencePresentation2 = z18.strictObject({
6793
+ const ResolvedReferencePresentation2 = z19.strictObject({
6690
6794
  localId: LocalContributionId2,
6691
6795
  globalId: GlobalContributionId2,
6692
6796
  uriModule: GlobalContributionId2.optional(),
6693
6797
  /** The schemes this presentation is about: its `scheme`, or its module's. */
6694
- schemes: z18.array(UriScheme2).min(1).optional(),
6798
+ schemes: z19.array(UriScheme2).min(1).optional(),
6695
6799
  /** The module's `displayName`: the source's name in a row. */
6696
6800
  displayName: NonEmptyString3.optional(),
6697
6801
  /** The module's auth service, qualified: whose accounts `accountLinks` reads. */
6698
6802
  authService: GlobalContributionId2.optional(),
6699
6803
  accountLinks: ReferencePresentationAccountLinks2.optional(),
6700
- addresses: z18.array(ReferencePresentationAddress2).min(1).optional(),
6804
+ addresses: z19.array(ReferencePresentationAddress2).min(1).optional(),
6701
6805
  /** Comes with `open`. A presentation with neither only words its module's addresses. */
6702
6806
  resourceKind: NonEmptyString3.optional(),
6703
6807
  open: ReferenceOpenBehavior2.optional(),
6704
6808
  /** MIME-specific resource kinds; absent keys use the base presentation. */
6705
6809
  variants: ReferencePresentationVariants2.optional(),
6706
- claims: z18.array(ResolvedReferencePresentationUrlClaim).optional(),
6707
- tooltip: z18.strictObject({
6810
+ claims: z19.array(ResolvedReferencePresentationUrlClaim).optional(),
6811
+ tooltip: z19.strictObject({
6708
6812
  app: GlobalContributionId2,
6709
6813
  pattern: ReferencePresentationUriPattern2
6710
6814
  }).optional(),
6711
6815
  words: ReferencePresentationWords2.optional()
6712
6816
  });
6713
- const ResolvedPluginProvisioningRequirement2 = z18.strictObject({
6817
+ const ResolvedPluginProvisioningRequirement2 = z19.strictObject({
6714
6818
  id: LocalContributionId2,
6715
6819
  displayName: NonEmptyString3,
6716
6820
  description: NonEmptyString3,
@@ -6720,15 +6824,15 @@ function createResolvedContractSchemas(canonical) {
6720
6824
  * URL degrades to "Reconnect" in the UI instead of a broken link.
6721
6825
  */
6722
6826
  remediationUrl: HttpsUrl2.optional(),
6723
- probe: z18.strictObject({
6827
+ probe: z19.strictObject({
6724
6828
  url: HttpsUrl2,
6725
- method: z18.enum(["GET"]),
6726
- verdictStatuses: z18.array(SignedInStatusCode2).min(1),
6829
+ method: z19.enum(["GET"]),
6830
+ verdictStatuses: z19.array(SignedInStatusCode2).min(1),
6727
6831
  nonEmptyArrayAt: NonEmptyString3.optional()
6728
6832
  })
6729
6833
  });
6730
6834
  const ResolvedProvisioningField = {
6731
- provisioning: z18.array(ResolvedPluginProvisioningRequirement2).optional()
6835
+ provisioning: z19.array(ResolvedPluginProvisioningRequirement2).optional()
6732
6836
  };
6733
6837
  const ResolvedPluginAuthSchemeDescriptionFields = {
6734
6838
  displayName: NonEmptyString3.optional(),
@@ -6740,118 +6844,120 @@ function createResolvedContractSchemas(canonical) {
6740
6844
  ...ResolvedPluginAuthSchemeDescriptionFields,
6741
6845
  localId: LocalContributionId2,
6742
6846
  globalId: GlobalContributionId2,
6743
- kind: z18.literal("oauth2"),
6744
- scopes: z18.array(z18.string()).optional(),
6847
+ kind: z19.literal("oauth2"),
6848
+ scopes: z19.array(z19.string()).optional(),
6849
+ connectScopes: z19.array(NonEmptyString3).optional(),
6745
6850
  authorizationUrl: HttpsUrl2,
6746
6851
  tokenUrl: HttpsUrl2,
6747
- extraAuthorizeParams: z18.record(z18.string(), z18.string()).optional()
6852
+ extraAuthorizeParams: z19.record(z19.string(), z19.string()).optional(),
6853
+ extraAuthorizeParamsWhenAccountHeld: z19.record(NonEmptyString3, z19.string()).optional()
6748
6854
  };
6749
- const ResolvedPluginAuthSchemeOAuthPkce = z18.strictObject({
6855
+ const ResolvedPluginAuthSchemeOAuthPkce = z19.strictObject({
6750
6856
  ...ResolvedPluginAuthSchemeOAuthBase,
6751
- exchange: z18.literal("pkce"),
6857
+ exchange: z19.literal("pkce"),
6752
6858
  byoocProfile: PluginByoocProfile.optional(),
6753
- clientSuppliers: z18.array(PluginOAuthClientSupplier2).nonempty(),
6859
+ clientSuppliers: z19.array(PluginOAuthClientSupplier2).nonempty(),
6754
6860
  clientId: NonEmptyString3.optional(),
6755
6861
  clientSecret: NonEmptyString3.optional(),
6756
- account: z18.literal("lookup").optional()
6862
+ account: z19.literal("lookup").optional()
6757
6863
  });
6758
- const ResolvedPluginAuthSchemeOAuthConfidential = z18.strictObject({
6864
+ const ResolvedPluginAuthSchemeOAuthConfidential = z19.strictObject({
6759
6865
  ...ResolvedPluginAuthSchemeOAuthBase,
6760
- exchange: z18.literal("confidential"),
6761
- clientSuppliers: z18.tuple([z18.literal("kay")]),
6762
- account: z18.enum(["lookup", "sign-in"])
6866
+ exchange: z19.literal("confidential"),
6867
+ clientSuppliers: z19.tuple([z19.literal("kay")]),
6868
+ account: z19.enum(["lookup", "sign-in"])
6763
6869
  });
6764
- const ResolvedPluginAuthSchemeOAuth2 = z18.discriminatedUnion("exchange", [
6870
+ const ResolvedPluginAuthSchemeOAuth2 = z19.discriminatedUnion("exchange", [
6765
6871
  ResolvedPluginAuthSchemeOAuthPkce,
6766
6872
  ResolvedPluginAuthSchemeOAuthConfidential
6767
6873
  ]);
6768
- const ResolvedPluginAuthSchemeApiKey = z18.strictObject({
6874
+ const ResolvedPluginAuthSchemeApiKey = z19.strictObject({
6769
6875
  ...ResolvedProvisioningField,
6770
6876
  ...ResolvedPluginAuthSchemeDescriptionFields,
6771
6877
  localId: LocalContributionId2,
6772
6878
  globalId: GlobalContributionId2,
6773
- kind: z18.literal("api-key"),
6774
- scopes: z18.array(z18.string()).optional(),
6879
+ kind: z19.literal("api-key"),
6880
+ scopes: z19.array(z19.string()).optional(),
6775
6881
  /** Resolution applies the manifest's default, "<service name> API key". */
6776
6882
  inputLabel: NonEmptyString3,
6777
- fields: z18.array(z18.strictObject({ id: z18.string(), label: z18.string() })).optional(),
6778
- setup: z18.strictObject({ instructions: z18.string(), url: HttpsUrl2 }).optional(),
6779
- account: z18.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()
6780
6886
  });
6781
- const ResolvedPluginAuthSchemeDelegated = z18.strictObject({
6887
+ const ResolvedPluginAuthSchemeDelegated = z19.strictObject({
6782
6888
  ...ResolvedPluginAuthSchemeDescriptionFields,
6783
6889
  localId: LocalContributionId2,
6784
6890
  globalId: GlobalContributionId2,
6785
- kind: z18.literal("delegated"),
6786
- scopes: z18.array(z18.string()).optional()
6891
+ kind: z19.literal("delegated"),
6892
+ scopes: z19.array(z19.string()).optional()
6787
6893
  });
6788
- const ResolvedPluginAuthSchemeExternalCli = z18.strictObject({
6894
+ const ResolvedPluginAuthSchemeExternalCli = z19.strictObject({
6789
6895
  ...ResolvedPluginAuthSchemeDescriptionFields,
6790
6896
  localId: LocalContributionId2,
6791
6897
  globalId: GlobalContributionId2,
6792
- kind: z18.literal("external-cli"),
6793
- scopes: z18.array(z18.string()).optional(),
6898
+ kind: z19.literal("external-cli"),
6899
+ scopes: z19.array(z19.string()).optional(),
6794
6900
  /** The manifest's connect facts, verbatim. */
6795
6901
  cli: PluginExternalCliConnect2.optional()
6796
6902
  });
6797
- const ResolvedPluginAuthScheme2 = z18.discriminatedUnion("kind", [
6903
+ const ResolvedPluginAuthScheme2 = z19.discriminatedUnion("kind", [
6798
6904
  ResolvedPluginAuthSchemeOAuth2,
6799
6905
  ResolvedPluginAuthSchemeApiKey,
6800
6906
  ResolvedPluginAuthSchemeDelegated,
6801
6907
  ResolvedPluginAuthSchemeExternalCli
6802
6908
  ]);
6803
- const ResolvedPluginWebSession2 = z18.strictObject({
6804
- importance: z18.enum(["required", "recommended"]),
6909
+ const ResolvedPluginWebSession2 = z19.strictObject({
6910
+ importance: z19.enum(["required", "recommended"]),
6805
6911
  loginUrl: HttpsUrl2,
6806
- cookieDomains: z18.array(RegistrableDomain2).min(1),
6807
- probe: z18.strictObject({
6912
+ cookieDomains: z19.array(RegistrableDomain2).min(1),
6913
+ probe: z19.strictObject({
6808
6914
  url: HttpsUrl2,
6809
- method: z18.enum(["GET", "POST"]),
6810
- signedInStatuses: z18.array(SignedInStatusCode2).min(1)
6915
+ method: z19.enum(["GET", "POST"]),
6916
+ signedInStatuses: z19.array(SignedInStatusCode2).min(1)
6811
6917
  }),
6812
- oauthVenue: z18.enum(["embedded", "external"]),
6813
- signInFirst: z18.string().optional()
6918
+ oauthVenue: z19.enum(["embedded", "external"]),
6919
+ signInFirst: z19.string().optional()
6814
6920
  }).superRefine(refineWebSessionScopeConfined);
6815
- const ResolvedPluginAuthService2 = z18.strictObject({
6921
+ const ResolvedPluginAuthService2 = z19.strictObject({
6816
6922
  localId: LocalContributionId2,
6817
6923
  globalId: GlobalContributionId2,
6818
- displayName: z18.string(),
6819
- summary: z18.string().optional(),
6820
- schemes: z18.array(ResolvedPluginAuthScheme2).min(1),
6821
- purposes: z18.array(z18.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),
6822
6928
  /** The service's browser half, when the manifest declares one. */
6823
6929
  webSession: ResolvedPluginWebSession2.optional()
6824
6930
  });
6825
- const ResolvedKayUiAppEndpointCapability2 = z18.union([
6826
- z18.strictObject({
6931
+ const ResolvedKayUiAppEndpointCapability2 = z19.union([
6932
+ z19.strictObject({
6827
6933
  localId: LocalContributionId2,
6828
6934
  globalId: GlobalContributionId2
6829
6935
  }),
6830
- z18.strictObject({ pluginId: PluginId2, localId: LocalContributionId2 })
6936
+ z19.strictObject({ pluginId: PluginId2, localId: LocalContributionId2 })
6831
6937
  ]);
6832
- const ResolvedKayUiApp2 = z18.strictObject({
6938
+ const ResolvedKayUiApp2 = z19.strictObject({
6833
6939
  localId: LocalContributionId2,
6834
6940
  globalId: GlobalContributionId2,
6835
6941
  displayName: NonEmptyString3,
6836
- contextOnly: z18.literal(true).optional(),
6942
+ contextOnly: z19.literal(true).optional(),
6837
6943
  description: NonEmptyString3.optional(),
6838
6944
  icon: PackageAssetPath2.optional(),
6839
- runtime: z18.literal("kay.react-app.v1"),
6840
- sdk: z18.strictObject({ range: NonEmptyString3 }),
6945
+ runtime: z19.literal("kay.react-app.v1"),
6946
+ sdk: z19.strictObject({ range: NonEmptyString3 }),
6841
6947
  entrypoint: TargetEntrypoint2,
6842
- styles: z18.array(PackageAssetPath2).optional(),
6843
- assets: z18.array(PackageAssetPath2).optional(),
6844
- capabilities: z18.strictObject({
6845
- endpoints: z18.array(ResolvedKayUiAppEndpointCapability2).optional(),
6846
- host: z18.array(KayUiAppHostCapability2).optional(),
6847
- feeds: z18.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()
6848
6954
  }).optional()
6849
6955
  });
6850
- const ResolvedPluginContractV12 = z18.strictObject({
6851
- protocol: z18.literal("kay.plugin.v1"),
6956
+ const ResolvedPluginContractV12 = z19.strictObject({
6957
+ protocol: z19.literal("kay.plugin.v1"),
6852
6958
  pluginId: PluginId2,
6853
6959
  namespace: PluginNamespace2,
6854
- contributions: z18.array(ResolvedPluginContributionId2),
6960
+ contributions: z19.array(ResolvedPluginContributionId2),
6855
6961
  // The deduplicated set of qualified (dotted) external auth-service ids this
6856
6962
  // plugin references, from agent uriModule, tool and cliBinding
6857
6963
  // `authService` refs, card sign-in refs, and auth-grant `service` refs. Always present - a plugin
@@ -6859,39 +6965,40 @@ function createResolvedContractSchemas(canonical) {
6859
6965
  // is a recorded dependency, not a resolution: there is no runtime plugin
6860
6966
  // loader in v1, so nothing here verifies the reference resolves within a
6861
6967
  // composed roster (a composition-time concern owned elsewhere).
6862
- consumesAuthServices: z18.array(GlobalContributionId2),
6968
+ consumesAuthServices: z19.array(GlobalContributionId2),
6863
6969
  // The explicit plugin-level dependency ids declared in `dependencies.plugins` on the manifest,
6864
6970
  // deduped and validated at parse time. Always present; a plugin with no explicit dependencies
6865
6971
  // carries an empty array. Composition checks each id against the accepted roster and derives the
6866
6972
  // full dependency graph together with auth-inferred edges from `consumesAuthServices`.
6867
- explicitDependencies: z18.array(PluginId2),
6973
+ explicitDependencies: z19.array(PluginId2),
6868
6974
  dataDirSharedWith: PluginId2.optional(),
6869
- workloadPurposes: z18.array(PluginWorkloadPurpose).optional(),
6870
- shellCommands: z18.array(PluginShellCommand.omit({ endpoint: true }).extend({
6975
+ workloadPurposes: z19.array(PluginWorkloadPurpose).optional(),
6976
+ shellCommands: z19.array(PluginShellCommand.omit({ endpoint: true }).extend({
6871
6977
  endpointId: GlobalContributionId2
6872
6978
  })).optional(),
6979
+ projectDirectories: PluginProjectDirectories.omit({ endpoint: true }).extend({ endpointId: GlobalContributionId2 }).optional(),
6873
6980
  // The auth services this plugin OWNS, carrying the global ids its harness
6874
6981
  // target must register and the credential authority keys on. Always present;
6875
6982
  // a plugin that declares no `auth.services` carries an empty array. The dual
6876
6983
  // of `consumesAuthServices` (services it merely references).
6877
- authServices: z18.array(ResolvedPluginAuthService2),
6984
+ authServices: z19.array(ResolvedPluginAuthService2),
6878
6985
  grants: ResolvedPluginGrants2.optional(),
6879
- kayAgentFamilyFolder: z18.strictObject({ scope: z18.literal("root") }).optional(),
6880
- kayAgentUriModules: z18.array(ResolvedKayAgentUriModule2).optional(),
6881
- kayAgentArtifactUriModules: z18.array(ResolvedKayAgentArtifactUriModule2).optional(),
6882
- kayAgentEntityResolvers: z18.array(ResolvedKayAgentEntityResolver2).optional(),
6883
- kayAgentGitHostClaims: z18.array(ResolvedKayAgentGitHostClaim2).optional(),
6884
- kayAgentTools: z18.array(ResolvedKayAgentTool2).optional(),
6885
- kayAppTools: z18.array(ResolvedKayAppTool2).optional(),
6886
- kayAppApprovalTypes: z18.array(ResolvedKayAppApprovalType2).optional(),
6887
- kayAppWorkflows: z18.array(ResolvedKayAppWorkflow2).optional(),
6888
- kayAppCards: z18.array(ResolvedPluginCard2).optional(),
6889
- kayAppDataSources: z18.array(ResolvedKayAppDataSource2).optional(),
6890
- kayAppWhiteboardTypes: z18.array(ResolvedKayAppWhiteboardType2).optional(),
6891
- kayAppMcpServers: z18.array(ResolvedKayAppMcpServer2).optional(),
6892
- kayAgentConverters: z18.array(ResolvedKayAgentConverter2).optional(),
6893
- referencePresentations: z18.array(ResolvedReferencePresentation2).optional(),
6894
- kayUiApps: z18.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()
6895
7002
  });
6896
7003
  return {
6897
7004
  ResolvedPluginContributionId: ResolvedPluginContributionId2,
@@ -7121,6 +7228,12 @@ function resolveAuthServices(namespace, manifest) {
7121
7228
  const endpointFields = {
7122
7229
  authorizationUrl: scheme.authorizationUrl,
7123
7230
  tokenUrl: scheme.tokenUrl,
7231
+ ...scheme.connectScopes === void 0 ? {} : { connectScopes: [...scheme.connectScopes] },
7232
+ ...scheme.extraAuthorizeParamsWhenAccountHeld === void 0 ? {} : {
7233
+ extraAuthorizeParamsWhenAccountHeld: {
7234
+ ...scheme.extraAuthorizeParamsWhenAccountHeld
7235
+ }
7236
+ },
7124
7237
  ...scheme.extraAuthorizeParams === void 0 ? {} : { extraAuthorizeParams: { ...scheme.extraAuthorizeParams } }
7125
7238
  };
7126
7239
  return scheme.exchange === "pkce" ? {
@@ -7316,6 +7429,7 @@ function resolveKayPluginContractV1(manifest) {
7316
7429
  }));
7317
7430
  const kayAgentUriModules = manifest.targets?.kay?.agent?.contributes?.uriModules?.map((module) => ({
7318
7431
  localId: module.localId,
7432
+ ...module.adapterId === void 0 ? {} : { adapterId: module.adapterId },
7319
7433
  globalId: resolveGlobalContributionId(namespace, module.localId),
7320
7434
  schemes: [...module.schemes],
7321
7435
  ...module.displayName === void 0 ? {} : { displayName: module.displayName },
@@ -7432,6 +7546,12 @@ function resolveKayPluginContractV1(manifest) {
7432
7546
  endpointId: resolveGlobalContributionId(namespace, endpoint)
7433
7547
  }))
7434
7548
  },
7549
+ ...manifest.projectDirectories === void 0 ? {} : {
7550
+ projectDirectories: {
7551
+ scheme: manifest.projectDirectories.scheme,
7552
+ endpointId: resolveGlobalContributionId(namespace, manifest.projectDirectories.endpoint)
7553
+ }
7554
+ },
7435
7555
  ...grants && Object.keys(grants.byTarget).length > 0 ? { grants } : {},
7436
7556
  ...manifest.targets?.kay?.agent?.familyFolder === void 0 ? {} : { kayAgentFamilyFolder: manifest.targets.kay.agent.familyFolder },
7437
7557
  ...kayAgentUriModules && kayAgentUriModules.length > 0 ? { kayAgentUriModules } : {},
@@ -7480,7 +7600,7 @@ function presentationSource(namespace, manifest, presentation) {
7480
7600
  } : {}
7481
7601
  };
7482
7602
  }
7483
- 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 }) {
7484
7604
  return facts;
7485
7605
  }
7486
7606
 
@@ -7616,14 +7736,14 @@ function kayPluginCompatibilityAdvisories(input) {
7616
7736
  message: boundPluginDiagnosticMessage(`${manifest.displayName} (${manifest.id}) ${advisory.message}`)
7617
7737
  }));
7618
7738
  }
7619
- var ReadableCompatibility = z19.object({
7620
- supportedProtocols: z19.array(z19.string()).optional().catch(void 0),
7739
+ var ReadableCompatibility = z20.object({
7740
+ supportedProtocols: z20.array(z20.string()).optional().catch(void 0),
7621
7741
  minKayVersion: NonEmptyString.optional().catch(void 0),
7622
7742
  sdk: NonEmptyString.optional().catch(void 0)
7623
7743
  });
7624
- var ReadableManifestHead = z19.object({
7625
- id: z19.string().optional().catch(void 0),
7626
- displayName: z19.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),
7627
7747
  compatibility: ReadableCompatibility.optional().catch(void 0)
7628
7748
  });
7629
7749
  function keepNamespaceDerivedTools(contract, grandfathered) {
@@ -7727,28 +7847,28 @@ function errorText(error) {
7727
7847
  }
7728
7848
 
7729
7849
  // packages/plugin-protocol/dist/session-health.js
7730
- import { z as z20 } from "zod";
7850
+ import { z as z21 } from "zod";
7731
7851
  var SESSION_HEALTH_EXTENSION_ID = "kay.session-health";
7732
7852
  var SESSION_HEALTH_ENTRY_NAME = "session_health";
7733
7853
  var SESSION_HEALTH_CUSTOM_TYPE = `ext:${SESSION_HEALTH_EXTENSION_ID}:${SESSION_HEALTH_ENTRY_NAME}`;
7734
7854
  var SESSION_HEALTH_CLASSIFIER_IDS = ["jev"];
7735
- var sessionHealthEntrySchema = z20.object({
7736
- v: z20.literal(1),
7737
- verdict: z20.enum(["well", "bad", "unknown"]),
7855
+ var sessionHealthEntrySchema = z21.object({
7856
+ v: z21.literal(1),
7857
+ verdict: z21.enum(["well", "bad", "unknown"]),
7738
7858
  /**
7739
7859
  * The model's calibrated confidence in `well`, 0..1, or null when the
7740
7860
  * classifier declined to produce one. Never exported raw: the telemetry
7741
7861
  * event carries only the decile bucket.
7742
7862
  */
7743
- p_well: z20.number().min(0).max(1).nullable(),
7744
- classifier: z20.enum(SESSION_HEALTH_CLASSIFIER_IDS),
7745
- classifier_version: z20.string().min(1).max(64),
7746
- judged_at: z20.number().int().nonnegative(),
7747
- user_entry_id: z20.string().min(1).max(256),
7748
- through_entry_id: z20.string().min(1).max(256),
7749
- usage: z20.strictObject({
7750
- input_tokens: z20.number().int().nonnegative(),
7751
- output_tokens: z20.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()
7752
7872
  }).optional()
7753
7873
  });
7754
7874
  function sessionHealthPWellDecile(pWell) {
@@ -7758,23 +7878,28 @@ function sessionHealthPWellDecile(pWell) {
7758
7878
  }
7759
7879
 
7760
7880
  // packages/plugin-protocol/dist/resource-invocations.js
7761
- import { z as z21 } from "zod";
7762
- var CorpusResourceKind = z21.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([
7763
7892
  "skill",
7764
7893
  "context-file",
7765
7894
  "prompt-command"
7766
7895
  ]);
7767
- var CorpusResourceInvocationCursor = z21.strictObject({
7768
- at: z21.iso.datetime({ offset: true }),
7769
- eventId: z21.string().min(1)
7770
- });
7771
- var CorpusResourceInvocationQuery = z21.strictObject({
7896
+ var CorpusResourceInvocationQuery = z23.strictObject({
7772
7897
  kind: CorpusResourceKind,
7773
- since: z21.iso.datetime({ offset: true }),
7774
- until: z21.iso.datetime({ offset: true }),
7898
+ since: z23.iso.datetime({ offset: true }),
7899
+ until: z23.iso.datetime({ offset: true }),
7775
7900
  after: CorpusResourceInvocationCursor.optional(),
7776
- limit: z21.number().int().min(1).max(1e3).optional(),
7777
- rootCreatedByKind: z21.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()
7778
7903
  }).refine((value) => Date.parse(value.since) < Date.parse(value.until), {
7779
7904
  message: "since must precede until"
7780
7905
  });
@@ -7954,14 +8079,14 @@ function skillSuggestionEvidenceItems(evidence, options = {}) {
7954
8079
  }
7955
8080
 
7956
8081
  // packages/plugin-protocol/dist/ui-app-package.js
7957
- import { z as z22 } from "zod";
8082
+ import { z as z24 } from "zod";
7958
8083
  var KAY_UI_APP_PACKAGE_PROTOCOL = "kay.ui.app-package.v1";
7959
8084
  var KAY_UI_BUNDLE_INDEX_PROTOCOL = "kay.ui.bundle-index.v1";
7960
- var KayUiBundleOutputPath = z22.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" });
7961
- var KayUiBundleIndexV1 = z22.strictObject({
7962
- protocol: z22.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),
7963
8088
  entryPath: KayUiBundleOutputPath,
7964
- files: z22.array(z22.strictObject({
8089
+ files: z24.array(z24.strictObject({
7965
8090
  path: KayUiBundleOutputPath,
7966
8091
  mediaType: NonEmptyString
7967
8092
  })).min(1)
@@ -7988,19 +8113,19 @@ var KayUiBundleIndexV1 = z22.strictObject({
7988
8113
  function parseKayUiBundleIndexV1(input) {
7989
8114
  return KayUiBundleIndexV1.parse(input);
7990
8115
  }
7991
- var KayUiAppPackageFile = z22.strictObject({
8116
+ var KayUiAppPackageFile = z24.strictObject({
7992
8117
  path: PackageAssetPath,
7993
8118
  mediaType: NonEmptyString,
7994
- bytes: z22.instanceof(Uint8Array).refine((bytes) => bytes.byteLength > 0, {
8119
+ bytes: z24.instanceof(Uint8Array).refine((bytes) => bytes.byteLength > 0, {
7995
8120
  message: "app package file bytes must not be empty"
7996
8121
  })
7997
8122
  });
7998
- var KayUiAppPackageV1 = z22.strictObject({
7999
- protocol: z22.literal(KAY_UI_APP_PACKAGE_PROTOCOL),
8123
+ var KayUiAppPackageV1 = z24.strictObject({
8124
+ protocol: z24.literal(KAY_UI_APP_PACKAGE_PROTOCOL),
8000
8125
  appLocalId: LocalContributionId,
8001
8126
  entry: KayUiAppPackageFile,
8002
- styles: z22.array(KayUiAppPackageFile).optional(),
8003
- assets: z22.array(KayUiAppPackageFile).optional()
8127
+ styles: z24.array(KayUiAppPackageFile).optional(),
8128
+ assets: z24.array(KayUiAppPackageFile).optional()
8004
8129
  }).superRefine((appPackage, ctx) => {
8005
8130
  if (appPackage.entry.mediaType !== "application/javascript") {
8006
8131
  ctx.addIssue({
@@ -8037,28 +8162,28 @@ function parseKayUiAppPackageV1(input) {
8037
8162
  }
8038
8163
 
8039
8164
  // packages/plugin-protocol/dist/product-events.js
8040
- import { z as z23 } from "zod";
8165
+ import { z as z25 } from "zod";
8041
8166
  var exportable = {
8042
- class: z23.literal("exportable"),
8043
- optional: z23.boolean().optional()
8167
+ class: z25.literal("exportable"),
8168
+ optional: z25.boolean().optional()
8044
8169
  };
8045
- var PluginProductEventField = z23.union([
8046
- z23.strictObject({ class: z23.literal("local") }),
8047
- z23.strictObject({
8170
+ var PluginProductEventField = z25.union([
8171
+ z25.strictObject({ class: z25.literal("local") }),
8172
+ z25.strictObject({
8048
8173
  ...exportable,
8049
- type: z23.literal("enum"),
8050
- values: z23.array(z23.string())
8174
+ type: z25.literal("enum"),
8175
+ values: z25.array(z25.string())
8051
8176
  }),
8052
- z23.strictObject({
8177
+ z25.strictObject({
8053
8178
  ...exportable,
8054
- type: z23.literal("number"),
8055
- min: z23.number(),
8056
- max: z23.number(),
8057
- integer: z23.boolean().optional()
8179
+ type: z25.literal("number"),
8180
+ min: z25.number(),
8181
+ max: z25.number(),
8182
+ integer: z25.boolean().optional()
8058
8183
  }),
8059
- z23.strictObject({
8184
+ z25.strictObject({
8060
8185
  ...exportable,
8061
- type: z23.enum([
8186
+ type: z25.enum([
8062
8187
  "boolean",
8063
8188
  "id",
8064
8189
  "identifier",
@@ -8074,9 +8199,9 @@ function isPluginProductEventName(name) {
8074
8199
  }
8075
8200
 
8076
8201
  // packages/plugin-protocol/dist/artifact-outputs.js
8077
- import { z as z24 } from "zod";
8202
+ import { z as z26 } from "zod";
8078
8203
  var ARTIFACT_OUTPUT_PAGE_MAX = 200;
8079
- 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 !== "..");
8080
8205
  function parseArtifactOutputUri(uri) {
8081
8206
  const match = /^output:\/\/([^/]+)\/([^/]+)$/.exec(uri);
8082
8207
  if (match === null || !Segment.safeParse(match[1]).success || !Segment.safeParse(match[2]).success)
@@ -8086,12 +8211,12 @@ function parseArtifactOutputUri(uri) {
8086
8211
  function isCanonicalArtifactOutputUri(uri) {
8087
8212
  return parseArtifactOutputUri(uri) !== void 0;
8088
8213
  }
8089
- var ArtifactOutputUri = z24.string().refine(isCanonicalArtifactOutputUri, "Expected a canonical output://session/name URI");
8090
- var ArtifactOutputChange = z24.union([
8091
- z24.strictObject({
8092
- 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)
8093
8218
  }),
8094
- z24.strictObject({ sessionId: Segment })
8219
+ z26.strictObject({ sessionId: Segment })
8095
8220
  ]);
8096
8221
 
8097
8222
  // packages/plugin-protocol/dist/credential-text.js
@@ -8134,25 +8259,25 @@ function isCredentialShapedText(value) {
8134
8259
  }
8135
8260
 
8136
8261
  // packages/plugin-protocol/dist/ui-module-bundle.js
8137
- import { z as z25 } from "zod";
8262
+ import { z as z27 } from "zod";
8138
8263
  var KAY_UI_MODULE_BUNDLE_PROTOCOL = "kay.ui.module-bundle.v1";
8139
8264
  var KAY_UI_MODULE_FILE_MAX_BYTES = 8 * 1024 * 1024;
8140
8265
  var KAY_UI_MODULE_BUNDLE_MAX_BYTES = 32 * 1024 * 1024;
8141
8266
  var KAY_UI_MODULE_BUNDLE_MAX_FILES = 256;
8142
- var OutputPath = z25.string().min(1).max(1024).refine((value) => {
8267
+ var OutputPath = z27.string().min(1).max(1024).refine((value) => {
8143
8268
  const parsed = KayUiBundleIndexV1.shape.entryPath.safeParse(value);
8144
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.
8145
8270
  !/[\u0000-\u001f?#:%]/.test(value);
8146
8271
  }, { message: "bundle path must contain only unambiguous relative segments" });
8147
- var Sha256 = z25.string().regex(/^[a-f0-9]{64}$/);
8148
- var KayUiModuleBundleIndexV1 = z25.strictObject({
8149
- 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),
8150
8275
  entryPath: OutputPath,
8151
- stylePaths: z25.array(OutputPath).max(KAY_UI_MODULE_BUNDLE_MAX_FILES),
8152
- files: z25.array(z25.strictObject({
8276
+ stylePaths: z27.array(OutputPath).max(KAY_UI_MODULE_BUNDLE_MAX_FILES),
8277
+ files: z27.array(z27.strictObject({
8153
8278
  path: OutputPath,
8154
- mediaType: z25.string().min(1).max(128).regex(/^[a-zA-Z0-9!#$&^_.+-]+\/[a-zA-Z0-9!#$&^_.+-]+$/),
8155
- 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),
8156
8281
  sha256: Sha256
8157
8282
  })).min(1).max(KAY_UI_MODULE_BUNDLE_MAX_FILES)
8158
8283
  }).superRefine((index, ctx) => {
@@ -8182,9 +8307,9 @@ var KayUiModuleBundleIndexV1 = z25.strictObject({
8182
8307
  message: "bundle exceeds byte cap"
8183
8308
  });
8184
8309
  });
8185
- var KayUiModuleBundleReference = z25.strictObject({
8310
+ var KayUiModuleBundleReference = z27.strictObject({
8186
8311
  generationId: Sha256,
8187
- 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),
8188
8313
  index: KayUiModuleBundleIndexV1
8189
8314
  });
8190
8315
  export {
@@ -8351,6 +8476,7 @@ export {
8351
8476
  PluginPickerRound,
8352
8477
  PluginProductEventContribution,
8353
8478
  PluginProductEventField,
8479
+ PluginProjectDirectories,
8354
8480
  PluginProvisioningProbe,
8355
8481
  PluginProvisioningRequirement,
8356
8482
  PluginShellCommand,
@@ -8364,6 +8490,9 @@ export {
8364
8490
  PluginWebSessionDeclaration,
8365
8491
  PluginWebSessionProbe,
8366
8492
  PluginWorkloadPurpose,
8493
+ ProjectDirectory,
8494
+ ProjectDirectoryRequest,
8495
+ ProjectDirectoryResponse,
8367
8496
  RENAMED_PLUGIN_CAPABILITY_SLUGS,
8368
8497
  RESERVED_DIRECTORY_PLUGIN_ID_PREFIXES,
8369
8498
  RETIRED_COMPATIBILITY_KEYS,