@yaklabs-ai/plugin-protocol 0.55.5 → 0.55.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/THIRD-PARTY-INVENTORY.json +1 -1
- package/dist/index.d.ts +61 -2
- package/dist/index.js +418 -375
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -260,8 +260,9 @@ var JsonSchema = z4.record(z4.string(), JsonValue);
|
|
|
260
260
|
var KAY_PLUGIN_MANIFEST_SIZE_CAP_BYTES = 1024 * 1024;
|
|
261
261
|
var KAY_PLUGIN_PROTOCOL_VERSION = "kay.plugin.v1";
|
|
262
262
|
var KAY_PLUGIN_PROTOCOL_PACKAGE_NAME = "@bonsai/plugin-protocol";
|
|
263
|
-
var KAY_PLUGIN_SDK_VERSION = "0.55.
|
|
263
|
+
var KAY_PLUGIN_SDK_VERSION = "0.55.6";
|
|
264
264
|
var KAY_PLUGIN_COMPATIBLE_SDK_VERSIONS = [
|
|
265
|
+
"0.55.5",
|
|
265
266
|
"0.55.4",
|
|
266
267
|
"0.55.3",
|
|
267
268
|
"0.55.2",
|
|
@@ -1817,6 +1818,7 @@ var PLUGIN_CAPABILITY_SLUGS = [
|
|
|
1817
1818
|
"sessions.annotate",
|
|
1818
1819
|
"sessions.compact",
|
|
1819
1820
|
"sessions.state",
|
|
1821
|
+
"compaction.reset-text",
|
|
1820
1822
|
"soul.write",
|
|
1821
1823
|
"tools.describe",
|
|
1822
1824
|
"workspace.command",
|
|
@@ -1867,7 +1869,8 @@ var PRIVATE_PLUGIN_CAPABILITY_SLUGS = [
|
|
|
1867
1869
|
"workflows.signals",
|
|
1868
1870
|
"sessions.assign-project",
|
|
1869
1871
|
"artifacts.resolve-file",
|
|
1870
|
-
"process.run"
|
|
1872
|
+
"process.run",
|
|
1873
|
+
"compaction.reset-text"
|
|
1871
1874
|
];
|
|
1872
1875
|
function isPrivateCapabilityClaim(claim) {
|
|
1873
1876
|
return PRIVATE_PLUGIN_CAPABILITY_SLUGS.includes(claim.slug);
|
|
@@ -2074,6 +2077,14 @@ function createAuthoritySchemas(canonical) {
|
|
|
2074
2077
|
slug: z11.literal("sessions.state"),
|
|
2075
2078
|
envelope: z11.strictObject({})
|
|
2076
2079
|
}),
|
|
2080
|
+
z11.strictObject({
|
|
2081
|
+
// Supply the working state a conversation's reset uses in place of the summary: the text the
|
|
2082
|
+
// plugin's declared `contributes.resetText` entry holds, checked by herd before it is used.
|
|
2083
|
+
// Private (PRIVATE_PLUGIN_CAPABILITY_SLUGS): only a plugin the release carries may hold it.
|
|
2084
|
+
target: z11.literal("kay.app"),
|
|
2085
|
+
slug: z11.literal("compaction.reset-text"),
|
|
2086
|
+
envelope: z11.strictObject({})
|
|
2087
|
+
}),
|
|
2077
2088
|
z11.strictObject({
|
|
2078
2089
|
// Read and rewrite the soul file every new conversation is told. Private
|
|
2079
2090
|
// (PRIVATE_PLUGIN_CAPABILITY_SLUGS): only a plugin the release carries may hold it.
|
|
@@ -2394,6 +2405,7 @@ function sameClaim(a, b) {
|
|
|
2394
2405
|
case "sessions.annotate":
|
|
2395
2406
|
case "sessions.compact":
|
|
2396
2407
|
case "sessions.state":
|
|
2408
|
+
case "compaction.reset-text":
|
|
2397
2409
|
case "soul.write":
|
|
2398
2410
|
case "tools.describe":
|
|
2399
2411
|
case "workspace.command":
|
|
@@ -2491,6 +2503,7 @@ function envelopePairs(a, b) {
|
|
|
2491
2503
|
case "sessions.annotate":
|
|
2492
2504
|
case "sessions.compact":
|
|
2493
2505
|
case "sessions.state":
|
|
2506
|
+
case "compaction.reset-text":
|
|
2494
2507
|
case "soul.write":
|
|
2495
2508
|
case "tools.describe":
|
|
2496
2509
|
case "workspace.command":
|
|
@@ -4947,7 +4960,7 @@ var ShellCommandStep = z16.discriminatedUnion("kind", [
|
|
|
4947
4960
|
]);
|
|
4948
4961
|
|
|
4949
4962
|
// packages/plugin-protocol/dist/manifest.js
|
|
4950
|
-
import { z as
|
|
4963
|
+
import { z as z19 } from "zod";
|
|
4951
4964
|
|
|
4952
4965
|
// packages/plugin-protocol/dist/workload-purposes.js
|
|
4953
4966
|
import { z as z17 } from "zod";
|
|
@@ -4956,6 +4969,42 @@ var PluginWorkloadPurpose = z17.strictObject({
|
|
|
4956
4969
|
workloadClass: z17.enum(["dreaming", "hindsight"])
|
|
4957
4970
|
});
|
|
4958
4971
|
|
|
4972
|
+
// packages/plugin-protocol/dist/reset-text.js
|
|
4973
|
+
import { z as z18 } from "zod";
|
|
4974
|
+
|
|
4975
|
+
// packages/plugin-protocol/dist/session-state.js
|
|
4976
|
+
var PLUGIN_STATE_ENTRY_NAME_PATTERN = /^[a-z][a-z0-9-]{0,63}$/;
|
|
4977
|
+
var PLUGIN_STATE_ENTRY_MAX_BYTES = 256 * 1024;
|
|
4978
|
+
var PLUGIN_STATE_ENTRY_MAX_DEPTH = 64;
|
|
4979
|
+
var PLUGIN_STATE_ENTRY_TYPE_PREFIX = "plugin-state:";
|
|
4980
|
+
function pluginStateEntryCustomType(pluginId, name) {
|
|
4981
|
+
return PLUGIN_STATE_ENTRY_NAME_PATTERN.test(name) ? `${PLUGIN_STATE_ENTRY_TYPE_PREFIX}${pluginId}:${name}` : void 0;
|
|
4982
|
+
}
|
|
4983
|
+
function isPluginStateEntryCustomType(customType) {
|
|
4984
|
+
return customType.startsWith(PLUGIN_STATE_ENTRY_TYPE_PREFIX);
|
|
4985
|
+
}
|
|
4986
|
+
|
|
4987
|
+
// packages/plugin-protocol/dist/reset-text.js
|
|
4988
|
+
var RESET_TEXT_MAX_CHARS = 18e3;
|
|
4989
|
+
var EntryAddress = z18.strictObject({
|
|
4990
|
+
sessionId: z18.string().min(1),
|
|
4991
|
+
entryId: z18.string().min(1)
|
|
4992
|
+
});
|
|
4993
|
+
var ResetTextEntry = z18.strictObject({
|
|
4994
|
+
version: z18.literal(1),
|
|
4995
|
+
/**
|
|
4996
|
+
* The newest conversation entry the text accounts for: a message of the session's context, by the
|
|
4997
|
+
* transcript id the plugin reads it under. It names the session the text was written for, so a
|
|
4998
|
+
* fork's copy of its parent's entry covers nothing in the fork.
|
|
4999
|
+
*/
|
|
5000
|
+
coveredThrough: EntryAddress,
|
|
5001
|
+
/** The working state as Markdown, without the harness ledger. */
|
|
5002
|
+
text: z18.string().min(1).max(RESET_TEXT_MAX_CHARS)
|
|
5003
|
+
});
|
|
5004
|
+
var ResetTextContribution = z18.strictObject({
|
|
5005
|
+
entry: z18.string().regex(PLUGIN_STATE_ENTRY_NAME_PATTERN)
|
|
5006
|
+
});
|
|
5007
|
+
|
|
4959
5008
|
// packages/plugin-protocol/dist/synthetic-contributions.js
|
|
4960
5009
|
function resolveConfigSectionContributionLocalId(section) {
|
|
4961
5010
|
return `config-${toLocalContributionIdFragment(section)}`;
|
|
@@ -4979,34 +5028,34 @@ function createManifestSchemas(canonical) {
|
|
|
4979
5028
|
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, WorkingDocumentProviderContribution: WorkingDocumentProviderContribution2 } = canonical ? canonicalContributionSchemas : contributions_exports;
|
|
4980
5029
|
const { HttpsUrl: HttpsUrl2, LocalContributionId: LocalContributionId2, NonEmptyString: NonEmptyString3, PackageAssetPath: PackageAssetPath2, PluginId: PluginId2, PluginNamespace: PluginNamespace2, RegistrableDomain: RegistrableDomain2, SignedInStatusCode: SignedInStatusCode2, TargetEntrypoint: TargetEntrypoint2 } = canonical ? canonicalCommonSchemas : common_exports;
|
|
4981
5030
|
const { PluginPermissionManifest: PluginPermissionManifest2 } = canonical ? canonicalPermissionSchemas : permissions_exports;
|
|
4982
|
-
const KayAgentTargetManifest2 =
|
|
5031
|
+
const KayAgentTargetManifest2 = z19.strictObject({
|
|
4983
5032
|
entrypoint: TargetEntrypoint2,
|
|
4984
|
-
contributes:
|
|
4985
|
-
tools:
|
|
4986
|
-
converters:
|
|
4987
|
-
uriModules:
|
|
5033
|
+
contributes: z19.strictObject({
|
|
5034
|
+
tools: z19.array(AgentToolContribution2).optional(),
|
|
5035
|
+
converters: z19.array(ConverterContribution2).optional(),
|
|
5036
|
+
uriModules: z19.array(UriModuleContribution2).optional(),
|
|
4988
5037
|
// Host-composed artifact-backed schemes (see `ArtifactUriModuleContribution`): the plugin
|
|
4989
5038
|
// declares scheme + editability; the daemon binds each to the kernel's artifact lifecycle
|
|
4990
5039
|
// per session. Separate from `uriModules` (plugin-implemented backends) precisely because
|
|
4991
5040
|
// the plugin registers NOTHING for these at activation.
|
|
4992
|
-
artifactUriModules:
|
|
4993
|
-
cliBindings:
|
|
5041
|
+
artifactUriModules: z19.array(ArtifactUriModuleContribution2).optional(),
|
|
5042
|
+
cliBindings: z19.array(CliBindingContribution2).optional(),
|
|
4994
5043
|
// Which git hosts this plugin's credential serves (see `GitHostContribution`): a
|
|
4995
5044
|
// declaration, so a plugin for any git backend gets credentialed clones without
|
|
4996
5045
|
// the daemon learning its name. Sibling of `cliBindings` because both answer the
|
|
4997
5046
|
// same question - which of this plugin's auth services a host-side consumer
|
|
4998
5047
|
// resolves - for two different transports.
|
|
4999
|
-
gitHosts:
|
|
5000
|
-
resources:
|
|
5001
|
-
skills:
|
|
5002
|
-
searchProviders:
|
|
5003
|
-
interactionDrivers:
|
|
5004
|
-
entityResolvers:
|
|
5005
|
-
renderers:
|
|
5048
|
+
gitHosts: z19.array(GitHostContribution2).optional(),
|
|
5049
|
+
resources: z19.array(ResourceContribution2).optional(),
|
|
5050
|
+
skills: z19.array(SkillContribution2).optional(),
|
|
5051
|
+
searchProviders: z19.array(SearchProviderContribution2).optional(),
|
|
5052
|
+
interactionDrivers: z19.array(InteractionDriverContribution2).optional(),
|
|
5053
|
+
entityResolvers: z19.array(EntityResolverContribution2).optional(),
|
|
5054
|
+
renderers: z19.array(AgentRenderContribution2).optional(),
|
|
5006
5055
|
// Handler restricted to skill | tool by the manifest-level refinement below (see
|
|
5007
5056
|
// `CommandContribution`'s doc for why the restriction is not expressed in the type, and
|
|
5008
5057
|
// `CommandHandler`'s doc for why there is no promptTemplate variant to declare here).
|
|
5009
|
-
commands:
|
|
5058
|
+
commands: z19.array(CommandContribution2).optional()
|
|
5010
5059
|
}).optional(),
|
|
5011
5060
|
/**
|
|
5012
5061
|
* The plugin's primer skill - the `localId` of one of its own declared
|
|
@@ -5042,8 +5091,8 @@ function createManifestSchemas(canonical) {
|
|
|
5042
5091
|
* grant a person approved), and a body over 500 words is dropped.
|
|
5043
5092
|
*/
|
|
5044
5093
|
prompt: PackageAssetPath2.optional(),
|
|
5045
|
-
promptOrder:
|
|
5046
|
-
familyFolder:
|
|
5094
|
+
promptOrder: z19.number().finite().optional(),
|
|
5095
|
+
familyFolder: z19.strictObject({ scope: z19.literal("root") }).optional(),
|
|
5047
5096
|
/**
|
|
5048
5097
|
* External origins of skills this plugin claims as its own (see
|
|
5049
5098
|
* {@link PluginSkillSourceDeclaration}). Acquired by the daemon at boot and landed under the
|
|
@@ -5054,64 +5103,67 @@ function createManifestSchemas(canonical) {
|
|
|
5054
5103
|
* acquisition, not declared here, so there is nothing for the resolved contract to mint a
|
|
5055
5104
|
* `globalId` for at parse time.
|
|
5056
5105
|
*/
|
|
5057
|
-
skillSources:
|
|
5106
|
+
skillSources: z19.array(PluginSkillSourceDeclaration2).optional()
|
|
5058
5107
|
});
|
|
5059
|
-
const KayAppTargetManifest2 =
|
|
5108
|
+
const KayAppTargetManifest2 = z19.strictObject({
|
|
5060
5109
|
// Optional, like `kay.ui`'s: a target may carry only declarative `contributes` (e.g. a plugin
|
|
5061
5110
|
// that ships nothing but `mcpServers`) with no app-lifetime module for the host to load.
|
|
5062
5111
|
entrypoint: TargetEntrypoint2.optional(),
|
|
5063
|
-
artifacts:
|
|
5064
|
-
contributes:
|
|
5112
|
+
artifacts: z19.strictObject({ outputs: z19.literal(true) }).optional(),
|
|
5113
|
+
contributes: z19.strictObject({
|
|
5065
5114
|
// Session tools implemented by the app-lifetime activation (registered once, injected into
|
|
5066
5115
|
// every session with a host-stamped session context) - the tool counterpart of `uriModules`
|
|
5067
5116
|
// below. Same descriptor shape as kay.agent tools; `toolName` shares ONE flat session
|
|
5068
5117
|
// namespace with them (enforced by the manifest-level refinement below).
|
|
5069
|
-
tools:
|
|
5070
|
-
endpoints:
|
|
5071
|
-
cards:
|
|
5072
|
-
uriModules:
|
|
5073
|
-
dataSources:
|
|
5074
|
-
whiteboardTypes:
|
|
5118
|
+
tools: z19.array(ToolContribution2).optional(),
|
|
5119
|
+
endpoints: z19.array(EndpointContribution2).optional(),
|
|
5120
|
+
cards: z19.array(PluginCardContribution2).optional(),
|
|
5121
|
+
uriModules: z19.array(AppUriModuleContribution2).optional(),
|
|
5122
|
+
dataSources: z19.array(AppDataSourceContribution2).optional(),
|
|
5123
|
+
whiteboardTypes: z19.array(WhiteboardTypeContribution2).optional(),
|
|
5075
5124
|
// Document sources whose pull, push and revision check the app entrypoint registers.
|
|
5076
|
-
workingDocumentProviders:
|
|
5077
|
-
approvalTypes:
|
|
5078
|
-
workflows:
|
|
5079
|
-
eventDefinitions:
|
|
5125
|
+
workingDocumentProviders: z19.array(WorkingDocumentProviderContribution2).optional(),
|
|
5126
|
+
approvalTypes: z19.array(ApprovalTypeContribution2).optional(),
|
|
5127
|
+
workflows: z19.array(WorkflowContribution2).optional(),
|
|
5128
|
+
eventDefinitions: z19.array(PluginEventDefinitionContribution2).optional(),
|
|
5080
5129
|
// Default notification rules over this plugin's own `eventDefinitions`; seeded by the host
|
|
5081
5130
|
// (see `PluginNotificationRuleContribution`).
|
|
5082
|
-
notificationRules:
|
|
5083
|
-
productEvents:
|
|
5084
|
-
eventSubscriptions:
|
|
5085
|
-
deviceDelegations:
|
|
5086
|
-
sessionReaders:
|
|
5087
|
-
contextContributors:
|
|
5131
|
+
notificationRules: z19.array(PluginNotificationRuleContribution2).optional(),
|
|
5132
|
+
productEvents: z19.array(PluginProductEventContribution2).optional(),
|
|
5133
|
+
eventSubscriptions: z19.array(AppEventSubscription2).optional(),
|
|
5134
|
+
deviceDelegations: z19.array(DeviceDelegationContribution2).optional(),
|
|
5135
|
+
sessionReaders: z19.array(SessionReaderContribution2).optional(),
|
|
5136
|
+
contextContributors: z19.array(ContextContributorContribution2).optional(),
|
|
5137
|
+
// The state entry holding the working state a reset may use in place of the summary
|
|
5138
|
+
// (`reset-text.ts`). Honored only for a plugin holding `compaction.reset-text`.
|
|
5139
|
+
resetText: ResetTextContribution.optional(),
|
|
5088
5140
|
// Vendored MCP servers this plugin ships (see `McpServerContributions`). Each is hosted only
|
|
5089
5141
|
// for a plugin holding `mcp.host-server` for its name and URL; that is decided at
|
|
5090
5142
|
// composition, not here (see AGENTS.md).
|
|
5091
5143
|
mcpServers: McpServerContributions2.optional(),
|
|
5092
5144
|
// Handler restricted to endpoint-only by the manifest-level refinement below.
|
|
5093
|
-
commands:
|
|
5145
|
+
commands: z19.array(CommandContribution2).optional()
|
|
5094
5146
|
}).optional()
|
|
5095
5147
|
});
|
|
5096
|
-
const KayUiTargetManifest2 =
|
|
5148
|
+
const KayUiTargetManifest2 = z19.strictObject({
|
|
5097
5149
|
entrypoint: TargetEntrypoint2.extend({
|
|
5098
|
-
format:
|
|
5150
|
+
format: z19.literal("compiled-bundle").optional()
|
|
5099
5151
|
}).optional(),
|
|
5100
|
-
contributes:
|
|
5101
|
-
commands:
|
|
5102
|
-
slots:
|
|
5103
|
-
referencePresentations:
|
|
5104
|
-
apps:
|
|
5105
|
-
railEntries:
|
|
5106
|
-
toastPreviews:
|
|
5107
|
-
pages:
|
|
5108
|
-
themes:
|
|
5109
|
-
eventSubscriptions:
|
|
5110
|
-
dataMaterializers:
|
|
5152
|
+
contributes: z19.strictObject({
|
|
5153
|
+
commands: z19.array(UiCommandContribution2).optional(),
|
|
5154
|
+
slots: z19.array(UiSlotContribution2).optional(),
|
|
5155
|
+
referencePresentations: z19.array(ReferencePresentationContribution2).optional(),
|
|
5156
|
+
apps: z19.array(UiAppContribution2).optional(),
|
|
5157
|
+
railEntries: z19.array(UiRailEntryContribution2).optional(),
|
|
5158
|
+
toastPreviews: z19.array(UiToastPreviewContribution2).optional(),
|
|
5159
|
+
pages: z19.array(UiPageContribution2).optional(),
|
|
5160
|
+
themes: z19.array(ThemeContribution2).optional(),
|
|
5161
|
+
eventSubscriptions: z19.array(UiEventSubscriptionContribution2).optional(),
|
|
5162
|
+
dataMaterializers: z19.array(AppDataMaterializerContribution2).optional()
|
|
5111
5163
|
}).optional()
|
|
5112
5164
|
});
|
|
5113
|
-
const PluginConfigScope2 =
|
|
5114
|
-
const PluginConfigSectionManifest2 =
|
|
5165
|
+
const PluginConfigScope2 = z19.enum(["global", "project", "agent"]);
|
|
5166
|
+
const PluginConfigSectionManifest2 = z19.strictObject({
|
|
5115
5167
|
section: NonEmptyString3.optional(),
|
|
5116
5168
|
schema: JsonSchema,
|
|
5117
5169
|
/**
|
|
@@ -5129,23 +5181,23 @@ function createManifestSchemas(canonical) {
|
|
|
5129
5181
|
* is the baseline every section has; `agent` has no runtime mapping (the
|
|
5130
5182
|
* agent/entity fold is downstream of the document protocol).
|
|
5131
5183
|
*/
|
|
5132
|
-
scopes:
|
|
5184
|
+
scopes: z19.array(PluginConfigScope2).optional()
|
|
5133
5185
|
});
|
|
5134
|
-
const PluginConfigManifest2 =
|
|
5135
|
-
const PluginStorageManifest2 =
|
|
5136
|
-
sqlite:
|
|
5137
|
-
enabled:
|
|
5138
|
-
ownerTarget:
|
|
5186
|
+
const PluginConfigManifest2 = z19.array(PluginConfigSectionManifest2).min(1);
|
|
5187
|
+
const PluginStorageManifest2 = z19.strictObject({
|
|
5188
|
+
sqlite: z19.strictObject({
|
|
5189
|
+
enabled: z19.boolean(),
|
|
5190
|
+
ownerTarget: z19.literal("kay.app").optional(),
|
|
5139
5191
|
migrations: NonEmptyString3.optional()
|
|
5140
5192
|
}).optional(),
|
|
5141
|
-
dataDir:
|
|
5142
|
-
enabled:
|
|
5143
|
-
ownerTarget:
|
|
5193
|
+
dataDir: z19.strictObject({
|
|
5194
|
+
enabled: z19.boolean(),
|
|
5195
|
+
ownerTarget: z19.literal("kay.app").optional(),
|
|
5144
5196
|
sharedWith: PluginId2.optional()
|
|
5145
5197
|
}).optional()
|
|
5146
5198
|
});
|
|
5147
|
-
const PluginOAuthClientSupplier2 =
|
|
5148
|
-
const PluginProvisioningProbe2 =
|
|
5199
|
+
const PluginOAuthClientSupplier2 = z19.enum(["kay", "user"]);
|
|
5200
|
+
const PluginProvisioningProbe2 = z19.strictObject({
|
|
5149
5201
|
/**
|
|
5150
5202
|
* The API endpoint that answers the question. The host sends the service's OWN credential here,
|
|
5151
5203
|
* so this must belong to the provider that minted it - enforced by the daemon against the
|
|
@@ -5153,13 +5205,13 @@ function createManifestSchemas(canonical) {
|
|
|
5153
5205
|
*/
|
|
5154
5206
|
url: HttpsUrl2,
|
|
5155
5207
|
/** Absent => `GET`. */
|
|
5156
|
-
method:
|
|
5208
|
+
method: z19.enum(["GET"]).optional(),
|
|
5157
5209
|
/**
|
|
5158
5210
|
* The statuses that make the response a VERDICT at all. Anything else (a 401 from a stale
|
|
5159
5211
|
* token, a 5xx, a rate limit) means the probe learned nothing and reports `unknown` - never
|
|
5160
5212
|
* `unsatisfied`, which would tell a user to go fix setup that is fine.
|
|
5161
5213
|
*/
|
|
5162
|
-
verdictStatuses:
|
|
5214
|
+
verdictStatuses: z19.array(SignedInStatusCode2).min(1),
|
|
5163
5215
|
/**
|
|
5164
5216
|
* Dot-path to a JSON array in the response body that must be NON-EMPTY for the requirement to
|
|
5165
5217
|
* count as satisfied (e.g. `installations`). Absent means a verdict status alone is enough.
|
|
@@ -5168,7 +5220,7 @@ function createManifestSchemas(canonical) {
|
|
|
5168
5220
|
*/
|
|
5169
5221
|
nonEmptyArrayAt: NonEmptyString3.optional()
|
|
5170
5222
|
});
|
|
5171
|
-
const PluginProvisioningRequirement2 =
|
|
5223
|
+
const PluginProvisioningRequirement2 = z19.strictObject({
|
|
5172
5224
|
/** Stable id, unique within the scheme. */
|
|
5173
5225
|
id: LocalContributionId2,
|
|
5174
5226
|
/** Human-facing requirement name, e.g. "GitHub App installation". */
|
|
@@ -5185,7 +5237,7 @@ function createManifestSchemas(canonical) {
|
|
|
5185
5237
|
probe: PluginProvisioningProbe2
|
|
5186
5238
|
});
|
|
5187
5239
|
const PluginProvisioningField = {
|
|
5188
|
-
provisioning:
|
|
5240
|
+
provisioning: z19.array(PluginProvisioningRequirement2).optional()
|
|
5189
5241
|
};
|
|
5190
5242
|
const PluginAuthSchemeDescriptionFields = {
|
|
5191
5243
|
/** Human-facing flow name; absent, the service's name stands in. */
|
|
@@ -5202,20 +5254,20 @@ function createManifestSchemas(canonical) {
|
|
|
5202
5254
|
authorizationUrl: HttpsUrl2,
|
|
5203
5255
|
tokenUrl: HttpsUrl2,
|
|
5204
5256
|
/** Initial connect scopes; absent uses `scopes`, while an empty array requests none. */
|
|
5205
|
-
connectScopes:
|
|
5257
|
+
connectScopes: z19.array(NonEmptyString3).optional(),
|
|
5206
5258
|
/** Provider-specific query parameters added to the authorize URL. */
|
|
5207
|
-
extraAuthorizeParams:
|
|
5259
|
+
extraAuthorizeParams: z19.record(NonEmptyString3, z19.string()).optional(),
|
|
5208
5260
|
/** Additional authorization parameters when this service already holds an account. */
|
|
5209
|
-
extraAuthorizeParamsWhenAccountHeld:
|
|
5261
|
+
extraAuthorizeParamsWhenAccountHeld: z19.record(NonEmptyString3, z19.string()).optional()
|
|
5210
5262
|
};
|
|
5211
|
-
const PluginAuthSchemeAccountLookup =
|
|
5212
|
-
const PluginAuthSchemeOAuthPkce =
|
|
5263
|
+
const PluginAuthSchemeAccountLookup = z19.literal("lookup");
|
|
5264
|
+
const PluginAuthSchemeOAuthPkce = z19.strictObject({
|
|
5213
5265
|
...PluginProvisioningField,
|
|
5214
5266
|
...PluginAuthSchemeDescriptionFields,
|
|
5215
5267
|
...PluginAuthSchemeOAuthEndpointFields,
|
|
5216
5268
|
localId: LocalContributionId2,
|
|
5217
|
-
kind:
|
|
5218
|
-
exchange:
|
|
5269
|
+
kind: z19.literal("oauth2"),
|
|
5270
|
+
exchange: z19.literal("pkce"),
|
|
5219
5271
|
byoocProfile: PluginByoocProfile.optional(),
|
|
5220
5272
|
/**
|
|
5221
5273
|
* A public client id the plugin ships for its own sign-in. Only an installed plugin's is used:
|
|
@@ -5239,7 +5291,7 @@ function createManifestSchemas(canonical) {
|
|
|
5239
5291
|
* runs on an untrusted manifest, so a hand-built `["kay","kay"]` must be refused here, not
|
|
5240
5292
|
* silently normalized).
|
|
5241
5293
|
*/
|
|
5242
|
-
clientSuppliers:
|
|
5294
|
+
clientSuppliers: z19.array(PluginOAuthClientSupplier2).nonempty().superRefine((suppliers, ctx) => {
|
|
5243
5295
|
if (new Set(suppliers).size !== suppliers.length) {
|
|
5244
5296
|
ctx.addIssue({
|
|
5245
5297
|
code: "custom",
|
|
@@ -5247,7 +5299,7 @@ function createManifestSchemas(canonical) {
|
|
|
5247
5299
|
});
|
|
5248
5300
|
}
|
|
5249
5301
|
}),
|
|
5250
|
-
scopes:
|
|
5302
|
+
scopes: z19.array(NonEmptyString3).optional()
|
|
5251
5303
|
}).refine((scheme) => scheme.byoocProfile === void 0 || scheme.clientSuppliers.includes("user"), {
|
|
5252
5304
|
message: "An own-client profile requires the user client supplier.",
|
|
5253
5305
|
path: ["byoocProfile"]
|
|
@@ -5258,33 +5310,33 @@ function createManifestSchemas(canonical) {
|
|
|
5258
5310
|
message: "a scheme with its own clientId names where its account comes from (`account`)",
|
|
5259
5311
|
path: ["account"]
|
|
5260
5312
|
});
|
|
5261
|
-
const PluginAuthSchemeOAuthConfidential =
|
|
5313
|
+
const PluginAuthSchemeOAuthConfidential = z19.strictObject({
|
|
5262
5314
|
...PluginProvisioningField,
|
|
5263
5315
|
...PluginAuthSchemeDescriptionFields,
|
|
5264
5316
|
...PluginAuthSchemeOAuthEndpointFields,
|
|
5265
5317
|
localId: LocalContributionId2,
|
|
5266
|
-
kind:
|
|
5267
|
-
exchange:
|
|
5318
|
+
kind: z19.literal("oauth2"),
|
|
5319
|
+
exchange: z19.literal("confidential"),
|
|
5268
5320
|
/** Absent means `["kay"]` - a confidential exchange's secret may only ever be Bonsai's. */
|
|
5269
|
-
clientSuppliers:
|
|
5270
|
-
scopes:
|
|
5321
|
+
clientSuppliers: z19.tuple([z19.literal("kay")]).optional(),
|
|
5322
|
+
scopes: z19.array(NonEmptyString3).optional(),
|
|
5271
5323
|
/** Where the account comes from (see {@link PluginAuthSchemeAccountLookup}). */
|
|
5272
|
-
account:
|
|
5324
|
+
account: z19.union([PluginAuthSchemeAccountLookup, z19.literal("sign-in")])
|
|
5273
5325
|
});
|
|
5274
|
-
const PluginAuthSchemeOAuth2 =
|
|
5326
|
+
const PluginAuthSchemeOAuth2 = z19.discriminatedUnion("exchange", [
|
|
5275
5327
|
PluginAuthSchemeOAuthPkce,
|
|
5276
5328
|
PluginAuthSchemeOAuthConfidential
|
|
5277
5329
|
]);
|
|
5278
|
-
const PluginAuthSchemeApiKey =
|
|
5330
|
+
const PluginAuthSchemeApiKey = z19.strictObject({
|
|
5279
5331
|
...PluginProvisioningField,
|
|
5280
5332
|
...PluginAuthSchemeDescriptionFields,
|
|
5281
5333
|
localId: LocalContributionId2,
|
|
5282
|
-
kind:
|
|
5283
|
-
scopes:
|
|
5334
|
+
kind: z19.literal("api-key"),
|
|
5335
|
+
scopes: z19.array(NonEmptyString3).optional(),
|
|
5284
5336
|
/** The connect prompt's label for the key. Absent: "<service name> API key". */
|
|
5285
5337
|
inputLabel: NonEmptyString3.optional(),
|
|
5286
5338
|
/** Two or more labeled inputs for a secret that comes in parts; absent asks for one key. */
|
|
5287
|
-
fields:
|
|
5339
|
+
fields: z19.array(z19.strictObject({ id: LocalContributionId2, label: NonEmptyString3 })).min(2).superRefine((fields, ctx) => {
|
|
5288
5340
|
if (new Set(fields.map((field) => field.id)).size !== fields.length) {
|
|
5289
5341
|
ctx.addIssue({
|
|
5290
5342
|
code: "custom",
|
|
@@ -5293,7 +5345,7 @@ function createManifestSchemas(canonical) {
|
|
|
5293
5345
|
}
|
|
5294
5346
|
}).optional(),
|
|
5295
5347
|
/** Where and how the person creates the key outside Bonsai. */
|
|
5296
|
-
setup:
|
|
5348
|
+
setup: z19.strictObject({ instructions: NonEmptyString3, url: HttpsUrl2 }).optional(),
|
|
5297
5349
|
/**
|
|
5298
5350
|
* `"lookup"`: the plugin checks a key before it is saved and names its account, with the function
|
|
5299
5351
|
* it registers (`api.auth.registerAccountLookup`). Absent: the key is saved unchecked, under the
|
|
@@ -5301,27 +5353,27 @@ function createManifestSchemas(canonical) {
|
|
|
5301
5353
|
*/
|
|
5302
5354
|
account: PluginAuthSchemeAccountLookup.optional()
|
|
5303
5355
|
});
|
|
5304
|
-
const PluginAuthSchemeDelegated =
|
|
5356
|
+
const PluginAuthSchemeDelegated = z19.strictObject({
|
|
5305
5357
|
...PluginAuthSchemeDescriptionFields,
|
|
5306
5358
|
localId: LocalContributionId2,
|
|
5307
|
-
kind:
|
|
5308
|
-
scopes:
|
|
5359
|
+
kind: z19.literal("delegated"),
|
|
5360
|
+
scopes: z19.array(NonEmptyString3).optional()
|
|
5309
5361
|
});
|
|
5310
|
-
const ExternalCliArgument =
|
|
5362
|
+
const ExternalCliArgument = z19.string().min(1).max(16384).refine((value) => ![...value].some(isUnsafeArgumentCharacter), {
|
|
5311
5363
|
message: "an argument may hold tabs and line breaks, but no other control character, no invisible character and no bidirectional override"
|
|
5312
5364
|
});
|
|
5313
|
-
const ExternalCliCommand =
|
|
5365
|
+
const ExternalCliCommand = z19.string().max(128).regex(/^[A-Za-z0-9][A-Za-z0-9._+-]*$/, {
|
|
5314
5366
|
message: "a command is an executable's basename (letters, digits, '.', '_', '+', '-'), never a path"
|
|
5315
5367
|
});
|
|
5316
5368
|
const ExternalCliHint = NonEmptyString3.max(2048);
|
|
5317
|
-
const ExternalCliArguments =
|
|
5369
|
+
const ExternalCliArguments = z19.array(ExternalCliArgument).max(64);
|
|
5318
5370
|
const SignedOutMarker = ExternalCliArgument.refine((value) => value.trim() !== "", { message: "a signed-out marker needs text beyond whitespace" });
|
|
5319
|
-
const PluginExternalCliConnect2 =
|
|
5371
|
+
const PluginExternalCliConnect2 = z19.strictObject({
|
|
5320
5372
|
/** A basename the host finds on `PATH` (`osascript`, `wrangler`), never a path. */
|
|
5321
5373
|
binary: ExternalCliCommand,
|
|
5322
|
-
probe:
|
|
5374
|
+
probe: z19.strictObject({
|
|
5323
5375
|
args: ExternalCliArguments.min(1),
|
|
5324
|
-
timeoutMs:
|
|
5376
|
+
timeoutMs: z19.number().int().min(1).max(12e4).optional(),
|
|
5325
5377
|
/**
|
|
5326
5378
|
* The CLI's own signed-out marker: text a failed probe's output (stderr, else stdout) contains
|
|
5327
5379
|
* when the CLI is signed out. A failure that carries it is a sign-in problem, and only such a
|
|
@@ -5329,13 +5381,13 @@ function createManifestSchemas(canonical) {
|
|
|
5329
5381
|
* unavailable. Required when `login` is declared, so a timeout never starts a sign-in. A list
|
|
5330
5382
|
* is for a CLI with several signed-out messages; any one of them counts.
|
|
5331
5383
|
*/
|
|
5332
|
-
signedOutMarker:
|
|
5384
|
+
signedOutMarker: z19.union([SignedOutMarker, z19.array(SignedOutMarker).min(1)]).optional()
|
|
5333
5385
|
}),
|
|
5334
5386
|
/** The CLI's interactive sign-in. Absent: connect only probes and reports. */
|
|
5335
|
-
login:
|
|
5387
|
+
login: z19.strictObject({
|
|
5336
5388
|
args: ExternalCliArguments.min(1),
|
|
5337
|
-
timeoutMs:
|
|
5338
|
-
pasteCode:
|
|
5389
|
+
timeoutMs: z19.number().int().min(1).max(6e5).optional(),
|
|
5390
|
+
pasteCode: z19.strictObject({
|
|
5339
5391
|
/** The redeeming argv; the host appends the code as its last argument. */
|
|
5340
5392
|
args: ExternalCliArguments.min(1),
|
|
5341
5393
|
/** What the prompt says, for a person. */
|
|
@@ -5347,12 +5399,12 @@ function createManifestSchemas(canonical) {
|
|
|
5347
5399
|
* for display, or hands it to an agent session that runs it behind the ordinary bash approval.
|
|
5348
5400
|
* Absent for a binary the OS ships (`osascript`).
|
|
5349
5401
|
*/
|
|
5350
|
-
install:
|
|
5402
|
+
install: z19.strictObject({
|
|
5351
5403
|
command: ExternalCliCommand,
|
|
5352
5404
|
args: ExternalCliArguments
|
|
5353
5405
|
}).optional(),
|
|
5354
5406
|
/** Prose for a person: `install` when the binary is missing, `login` when the probe fails. */
|
|
5355
|
-
hints:
|
|
5407
|
+
hints: z19.strictObject({
|
|
5356
5408
|
install: ExternalCliHint,
|
|
5357
5409
|
login: ExternalCliHint
|
|
5358
5410
|
})
|
|
@@ -5365,50 +5417,50 @@ function createManifestSchemas(canonical) {
|
|
|
5365
5417
|
});
|
|
5366
5418
|
}
|
|
5367
5419
|
});
|
|
5368
|
-
const PluginAuthSchemeExternalCli =
|
|
5420
|
+
const PluginAuthSchemeExternalCli = z19.strictObject({
|
|
5369
5421
|
...PluginAuthSchemeDescriptionFields,
|
|
5370
5422
|
localId: LocalContributionId2,
|
|
5371
|
-
kind:
|
|
5372
|
-
scopes:
|
|
5423
|
+
kind: z19.literal("external-cli"),
|
|
5424
|
+
scopes: z19.array(NonEmptyString3).optional(),
|
|
5373
5425
|
cli: PluginExternalCliConnect2.optional()
|
|
5374
5426
|
});
|
|
5375
|
-
const PluginAuthScheme2 =
|
|
5427
|
+
const PluginAuthScheme2 = z19.discriminatedUnion("kind", [
|
|
5376
5428
|
PluginAuthSchemeOAuth2,
|
|
5377
5429
|
PluginAuthSchemeApiKey,
|
|
5378
5430
|
PluginAuthSchemeDelegated,
|
|
5379
5431
|
PluginAuthSchemeExternalCli
|
|
5380
5432
|
]);
|
|
5381
|
-
const PluginWebSessionProbe2 =
|
|
5433
|
+
const PluginWebSessionProbe2 = z19.strictObject({
|
|
5382
5434
|
url: HttpsUrl2,
|
|
5383
5435
|
/** Absent => `GET`. `POST` sends an empty JSON object body. */
|
|
5384
|
-
method:
|
|
5385
|
-
signedInStatuses:
|
|
5436
|
+
method: z19.enum(["GET", "POST"]).optional(),
|
|
5437
|
+
signedInStatuses: z19.array(SignedInStatusCode2).min(1)
|
|
5386
5438
|
});
|
|
5387
|
-
const PluginWebSessionDeclaration2 =
|
|
5439
|
+
const PluginWebSessionDeclaration2 = z19.strictObject({
|
|
5388
5440
|
/** `required`: capabilities degrade without the site login; `recommended`: it only smooths UX. */
|
|
5389
|
-
importance:
|
|
5441
|
+
importance: z19.enum(["required", "recommended"]),
|
|
5390
5442
|
loginUrl: HttpsUrl2,
|
|
5391
|
-
cookieDomains:
|
|
5443
|
+
cookieDomains: z19.array(RegistrableDomain2).min(1),
|
|
5392
5444
|
probe: PluginWebSessionProbe2,
|
|
5393
|
-
oauthVenue:
|
|
5445
|
+
oauthVenue: z19.enum(["embedded", "external"]),
|
|
5394
5446
|
/**
|
|
5395
5447
|
* Where a page goes first when it opens in one of Bonsai's browser panes and this site login
|
|
5396
5448
|
* is missing: a sign-in page that continues to the page. A template with `:email` and `:url`
|
|
5397
5449
|
* (see `UriClaimTemplate`), on a host within `cookieDomains`.
|
|
5398
5450
|
*/
|
|
5399
|
-
signInFirst:
|
|
5451
|
+
signInFirst: z19.string().optional()
|
|
5400
5452
|
}).superRefine(refineWebSessionScopeConfined);
|
|
5401
|
-
const PluginAuthService2 =
|
|
5453
|
+
const PluginAuthService2 = z19.strictObject({
|
|
5402
5454
|
localId: LocalContributionId2,
|
|
5403
5455
|
displayName: NonEmptyString3,
|
|
5404
5456
|
/** One plain sentence on what connecting this service gives Bonsai. */
|
|
5405
5457
|
summary: NonEmptyString3.optional(),
|
|
5406
|
-
schemes:
|
|
5407
|
-
purposes:
|
|
5458
|
+
schemes: z19.array(PluginAuthScheme2).min(1),
|
|
5459
|
+
purposes: z19.array(NonEmptyString3).min(1),
|
|
5408
5460
|
webSession: PluginWebSessionDeclaration2.optional()
|
|
5409
5461
|
});
|
|
5410
|
-
const PluginAuthManifest2 =
|
|
5411
|
-
services:
|
|
5462
|
+
const PluginAuthManifest2 = z19.strictObject({
|
|
5463
|
+
services: z19.array(PluginAuthService2).optional()
|
|
5412
5464
|
});
|
|
5413
5465
|
function stripRetiredCompatibilityKeys(value) {
|
|
5414
5466
|
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
@@ -5419,17 +5471,17 @@ function createManifestSchemas(canonical) {
|
|
|
5419
5471
|
delete remaining[key];
|
|
5420
5472
|
return remaining;
|
|
5421
5473
|
}
|
|
5422
|
-
const PluginCompatibilityFields =
|
|
5423
|
-
supportedProtocols:
|
|
5474
|
+
const PluginCompatibilityFields = z19.strictObject({
|
|
5475
|
+
supportedProtocols: z19.array(KayPluginProtocolVersion).optional(),
|
|
5424
5476
|
minKayVersion: NonEmptyString3.optional(),
|
|
5425
5477
|
sdk: NonEmptyString3.optional()
|
|
5426
5478
|
});
|
|
5427
|
-
const PluginCompatibilityManifest2 = canonical ? PluginCompatibilityFields :
|
|
5479
|
+
const PluginCompatibilityManifest2 = canonical ? PluginCompatibilityFields : z19.preprocess(stripRetiredCompatibilityKeys, PluginCompatibilityFields);
|
|
5428
5480
|
const KayVersionString2 = NonEmptyString3.regex(SEMVER_PATTERN, {
|
|
5429
5481
|
message: "version must be semver, for example 1.2.3"
|
|
5430
5482
|
});
|
|
5431
|
-
const KayPluginManifestV12 =
|
|
5432
|
-
protocol:
|
|
5483
|
+
const KayPluginManifestV12 = z19.strictObject({
|
|
5484
|
+
protocol: z19.literal(KAY_PLUGIN_PROTOCOL_VERSION),
|
|
5433
5485
|
id: PluginId2,
|
|
5434
5486
|
displayName: NonEmptyString3,
|
|
5435
5487
|
version: KayVersionString2,
|
|
@@ -5457,12 +5509,12 @@ function createManifestSchemas(canonical) {
|
|
|
5457
5509
|
icon: PackageAssetPath2.optional(),
|
|
5458
5510
|
iconDark: PackageAssetPath2.optional(),
|
|
5459
5511
|
namespace: PluginNamespace2.optional(),
|
|
5460
|
-
workers:
|
|
5512
|
+
workers: z19.array(z19.strictObject({
|
|
5461
5513
|
localId: LocalContributionId2,
|
|
5462
5514
|
module: PackageAssetPath2
|
|
5463
5515
|
})).optional(),
|
|
5464
|
-
targets:
|
|
5465
|
-
kay:
|
|
5516
|
+
targets: z19.strictObject({
|
|
5517
|
+
kay: z19.strictObject({
|
|
5466
5518
|
agent: KayAgentTargetManifest2.optional(),
|
|
5467
5519
|
app: KayAppTargetManifest2.optional(),
|
|
5468
5520
|
ui: KayUiTargetManifest2.optional()
|
|
@@ -5470,8 +5522,8 @@ function createManifestSchemas(canonical) {
|
|
|
5470
5522
|
}).optional(),
|
|
5471
5523
|
config: PluginConfigManifest2.optional(),
|
|
5472
5524
|
storage: PluginStorageManifest2.optional(),
|
|
5473
|
-
workloadPurposes:
|
|
5474
|
-
shellCommands:
|
|
5525
|
+
workloadPurposes: z19.array(PluginWorkloadPurpose).optional(),
|
|
5526
|
+
shellCommands: z19.array(PluginShellCommand).optional(),
|
|
5475
5527
|
projectDirectories: PluginProjectDirectories.optional(),
|
|
5476
5528
|
auth: PluginAuthManifest2.optional(),
|
|
5477
5529
|
permissions: PluginPermissionManifest2.optional(),
|
|
@@ -5482,15 +5534,15 @@ function createManifestSchemas(canonical) {
|
|
|
5482
5534
|
* schemes then report `ownedByBonsai`. Honoured only for a plugin that ships with Bonsai: the
|
|
5483
5535
|
* host reads any other plugin's flag as false. Absent => false.
|
|
5484
5536
|
*/
|
|
5485
|
-
ownedByBonsai:
|
|
5537
|
+
ownedByBonsai: z19.boolean().optional(),
|
|
5486
5538
|
/**
|
|
5487
5539
|
* Explicit plugin-level dependencies - other plugins this plugin requires to be present in the
|
|
5488
5540
|
* composed roster. At composition time the runtime checks each id against the accepted
|
|
5489
5541
|
* registration list and derives a provenance-complete dependency graph (together with implicit
|
|
5490
5542
|
* auth-service edges from `consumesAuthServices`). Absent => no explicit dependencies.
|
|
5491
5543
|
*/
|
|
5492
|
-
dependencies:
|
|
5493
|
-
plugins:
|
|
5544
|
+
dependencies: z19.strictObject({
|
|
5545
|
+
plugins: z19.array(PluginId2).optional()
|
|
5494
5546
|
}).optional()
|
|
5495
5547
|
}).superRefine((manifest, ctx) => {
|
|
5496
5548
|
reportDuplicateLocalIds(ctx, ["workers"], manifest.workers, "worker");
|
|
@@ -6742,7 +6794,7 @@ function pushContributionIds(output, path, items) {
|
|
|
6742
6794
|
}
|
|
6743
6795
|
|
|
6744
6796
|
// packages/plugin-protocol/dist/plugin-directory-verdict.js
|
|
6745
|
-
import { z as
|
|
6797
|
+
import { z as z21 } from "zod";
|
|
6746
6798
|
|
|
6747
6799
|
// packages/plugin-protocol/dist/plugin-load-diagnostic.js
|
|
6748
6800
|
var PLUGIN_DIAGNOSTIC_MESSAGE_CAP = 300;
|
|
@@ -6751,14 +6803,14 @@ function boundPluginDiagnosticMessage(message) {
|
|
|
6751
6803
|
}
|
|
6752
6804
|
|
|
6753
6805
|
// packages/plugin-protocol/dist/resolved-contract.js
|
|
6754
|
-
import { z as
|
|
6806
|
+
import { z as z20 } from "zod";
|
|
6755
6807
|
function createResolvedContractSchemas(canonical) {
|
|
6756
6808
|
const { PluginEventLocalId: PluginEventLocalId2 } = canonical ? canonicalPluginEventSchemas : plugin_events_exports;
|
|
6757
6809
|
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;
|
|
6758
6810
|
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;
|
|
6759
6811
|
const { PluginExternalCliConnect: PluginExternalCliConnect2, PluginOAuthClientSupplier: PluginOAuthClientSupplier2 } = canonical ? canonicalManifestSchemas : manifest_exports;
|
|
6760
6812
|
const { ResolvedPluginGrants: ResolvedPluginGrants2, ScopeRequirement: ScopeRequirement2 } = canonical ? canonicalPermissionSchemas : permissions_exports;
|
|
6761
|
-
const ResolvedPluginContributionId2 =
|
|
6813
|
+
const ResolvedPluginContributionId2 = z20.strictObject({
|
|
6762
6814
|
target: PluginTargetName,
|
|
6763
6815
|
kind: PluginContributionKindSchema,
|
|
6764
6816
|
localId: PluginEventLocalId2,
|
|
@@ -6772,20 +6824,20 @@ function createResolvedContractSchemas(canonical) {
|
|
|
6772
6824
|
});
|
|
6773
6825
|
}
|
|
6774
6826
|
});
|
|
6775
|
-
const ResolvedKayToolId =
|
|
6827
|
+
const ResolvedKayToolId = z20.strictObject({
|
|
6776
6828
|
localId: LocalContributionId2,
|
|
6777
6829
|
globalId: GlobalContributionId2,
|
|
6778
6830
|
toolName: PluginToolName2
|
|
6779
6831
|
});
|
|
6780
|
-
const ResolvedKayAgentTool2 =
|
|
6832
|
+
const ResolvedKayAgentTool2 = z20.strictObject({
|
|
6781
6833
|
...ResolvedKayToolId.shape,
|
|
6782
6834
|
displayName: NonEmptyString3.optional(),
|
|
6783
6835
|
description: NonEmptyString3.optional(),
|
|
6784
6836
|
parameters: JsonSchema.optional(),
|
|
6785
|
-
executionMode:
|
|
6837
|
+
executionMode: z20.enum(["sequential", "parallel"]).optional(),
|
|
6786
6838
|
promptSnippet: NonEmptyString3.optional(),
|
|
6787
|
-
promptGuidelines:
|
|
6788
|
-
requiresAuth:
|
|
6839
|
+
promptGuidelines: z20.array(NonEmptyString3).optional(),
|
|
6840
|
+
requiresAuth: z20.strictObject({
|
|
6789
6841
|
serviceId: GlobalContributionId2,
|
|
6790
6842
|
schemeId: GlobalContributionId2.optional()
|
|
6791
6843
|
}).optional(),
|
|
@@ -6794,37 +6846,37 @@ function createResolvedContractSchemas(canonical) {
|
|
|
6794
6846
|
const ResolvedKayAppTool2 = ResolvedKayAgentTool2.omit({
|
|
6795
6847
|
requiresAuth: true
|
|
6796
6848
|
}).extend({
|
|
6797
|
-
availability:
|
|
6849
|
+
availability: z20.strictObject({ scope: z20.literal("app") }).optional()
|
|
6798
6850
|
});
|
|
6799
|
-
const ResolvedKayAppDataSource2 =
|
|
6851
|
+
const ResolvedKayAppDataSource2 = z20.strictObject({
|
|
6800
6852
|
localId: LocalContributionId2,
|
|
6801
6853
|
globalId: GlobalContributionId2,
|
|
6802
|
-
scope:
|
|
6803
|
-
snapshot:
|
|
6804
|
-
version:
|
|
6805
|
-
schema:
|
|
6854
|
+
scope: z20.enum(["runtime", "account", "session"]),
|
|
6855
|
+
snapshot: z20.strictObject({
|
|
6856
|
+
version: z20.number().int().positive(),
|
|
6857
|
+
schema: z20.record(z20.string(), z20.unknown())
|
|
6806
6858
|
}),
|
|
6807
|
-
change:
|
|
6808
|
-
version:
|
|
6809
|
-
schema:
|
|
6810
|
-
semantics:
|
|
6811
|
-
|
|
6812
|
-
|
|
6813
|
-
kind:
|
|
6814
|
-
maxEncodedBytes:
|
|
6859
|
+
change: z20.strictObject({
|
|
6860
|
+
version: z20.number().int().positive(),
|
|
6861
|
+
schema: z20.record(z20.string(), z20.unknown()),
|
|
6862
|
+
semantics: z20.discriminatedUnion("kind", [
|
|
6863
|
+
z20.strictObject({ kind: z20.literal("incremental") }),
|
|
6864
|
+
z20.strictObject({
|
|
6865
|
+
kind: z20.literal("snapshot-replacement"),
|
|
6866
|
+
maxEncodedBytes: z20.number().int().positive(),
|
|
6815
6867
|
rationale: pluginString(canonical).min(1).max(1024)
|
|
6816
6868
|
})
|
|
6817
6869
|
]).optional()
|
|
6818
6870
|
}),
|
|
6819
6871
|
read: AppDataSourceRead.optional(),
|
|
6820
|
-
messageDraft:
|
|
6821
|
-
store:
|
|
6822
|
-
|
|
6823
|
-
shape:
|
|
6824
|
-
rowsField:
|
|
6825
|
-
key:
|
|
6872
|
+
messageDraft: z20.strictObject({ schemes: z20.array(UriScheme2).min(1) }).optional(),
|
|
6873
|
+
store: z20.discriminatedUnion("shape", [
|
|
6874
|
+
z20.strictObject({
|
|
6875
|
+
shape: z20.literal("rows"),
|
|
6876
|
+
rowsField: z20.string().min(1),
|
|
6877
|
+
key: z20.array(z20.string().min(1)).min(1)
|
|
6826
6878
|
}),
|
|
6827
|
-
|
|
6879
|
+
z20.strictObject({ shape: z20.literal("value") })
|
|
6828
6880
|
]).optional()
|
|
6829
6881
|
}).superRefine((source, ctx) => {
|
|
6830
6882
|
if (source.read !== void 0 && source.scope !== "session") {
|
|
@@ -6844,134 +6896,134 @@ function createResolvedContractSchemas(canonical) {
|
|
|
6844
6896
|
/** The auth service that module signs in through, whose accounts a card may send from. */
|
|
6845
6897
|
authService: GlobalContributionId2.optional()
|
|
6846
6898
|
});
|
|
6847
|
-
const ResolvedPluginCard2 =
|
|
6899
|
+
const ResolvedPluginCard2 = z20.strictObject({
|
|
6848
6900
|
localId: LocalContributionId2,
|
|
6849
6901
|
globalId: GlobalContributionId2,
|
|
6850
6902
|
pluginId: PluginId2,
|
|
6851
6903
|
description: NonEmptyString3,
|
|
6852
6904
|
inputs: JsonSchema,
|
|
6853
|
-
readEndpoint:
|
|
6905
|
+
readEndpoint: z20.strictObject({
|
|
6854
6906
|
localId: LocalContributionId2,
|
|
6855
6907
|
globalId: GlobalContributionId2
|
|
6856
6908
|
}),
|
|
6857
|
-
submitEndpoint:
|
|
6909
|
+
submitEndpoint: z20.strictObject({
|
|
6858
6910
|
localId: LocalContributionId2,
|
|
6859
6911
|
globalId: GlobalContributionId2
|
|
6860
6912
|
}),
|
|
6861
6913
|
authService: GlobalContributionId2.optional()
|
|
6862
6914
|
});
|
|
6863
|
-
const ResolvedKayAppWorkflow2 =
|
|
6915
|
+
const ResolvedKayAppWorkflow2 = z20.strictObject({
|
|
6864
6916
|
localId: LocalContributionId2,
|
|
6865
6917
|
globalId: GlobalContributionId2,
|
|
6866
6918
|
name: NonEmptyString3,
|
|
6867
6919
|
description: NonEmptyString3,
|
|
6868
|
-
everyMs:
|
|
6869
|
-
auth:
|
|
6920
|
+
everyMs: z20.number().int().positive(),
|
|
6921
|
+
auth: z20.strictObject({
|
|
6870
6922
|
serviceId: GlobalContributionId2,
|
|
6871
6923
|
schemeId: GlobalContributionId2,
|
|
6872
|
-
scopes:
|
|
6924
|
+
scopes: z20.array(NonEmptyString3).min(1).optional()
|
|
6873
6925
|
}).optional()
|
|
6874
6926
|
});
|
|
6875
6927
|
const ResolvedKayAppWhiteboardType2 = WhiteboardTypeContribution2.safeExtend({
|
|
6876
6928
|
globalId: GlobalContributionId2
|
|
6877
6929
|
});
|
|
6878
|
-
const ResolvedKayAppMcpServer2 =
|
|
6930
|
+
const ResolvedKayAppMcpServer2 = z20.strictObject({
|
|
6879
6931
|
name: LocalContributionId2,
|
|
6880
6932
|
pluginId: PluginId2,
|
|
6881
6933
|
url: McpServerUrl2,
|
|
6882
6934
|
auth: McpServerAuthMode2,
|
|
6883
6935
|
authServiceId: GlobalContributionId2.optional()
|
|
6884
6936
|
});
|
|
6885
|
-
const ResolvedKayAppWorkingDocumentProvider2 =
|
|
6937
|
+
const ResolvedKayAppWorkingDocumentProvider2 = z20.strictObject({
|
|
6886
6938
|
localId: LocalContributionId2,
|
|
6887
6939
|
globalId: GlobalContributionId2,
|
|
6888
6940
|
displayName: NonEmptyString3,
|
|
6889
|
-
schemes:
|
|
6890
|
-
hosts:
|
|
6941
|
+
schemes: z20.array(UriScheme2),
|
|
6942
|
+
hosts: z20.array(NonEmptyString3),
|
|
6891
6943
|
authServiceId: GlobalContributionId2.optional(),
|
|
6892
6944
|
authSchemeId: GlobalContributionId2.optional(),
|
|
6893
6945
|
scopeRequirement: ScopeRequirement2.optional()
|
|
6894
6946
|
});
|
|
6895
|
-
const ResolvedKayAgentUriModule2 =
|
|
6947
|
+
const ResolvedKayAgentUriModule2 = z20.strictObject({
|
|
6896
6948
|
localId: LocalContributionId2,
|
|
6897
|
-
adapterId:
|
|
6949
|
+
adapterId: z20.string().min(1).optional(),
|
|
6898
6950
|
globalId: GlobalContributionId2,
|
|
6899
|
-
schemes:
|
|
6951
|
+
schemes: z20.array(UriScheme2).min(1),
|
|
6900
6952
|
displayName: NonEmptyString3.optional(),
|
|
6901
6953
|
authServiceId: GlobalContributionId2.optional(),
|
|
6902
6954
|
/** Mirrors `UriModuleContribution.authScheme`; a local ref takes the plugin's namespace. */
|
|
6903
6955
|
authSchemeId: GlobalContributionId2.optional(),
|
|
6904
|
-
requiredScopes:
|
|
6956
|
+
requiredScopes: z20.array(NonEmptyString3).optional(),
|
|
6905
6957
|
/** Mirrors `UriModuleContribution.knownResources` (host-side recording opt-in). */
|
|
6906
|
-
knownResources:
|
|
6958
|
+
knownResources: z20.literal(true).optional(),
|
|
6907
6959
|
/** Mirrors `UriModuleContribution.describesOperations`. */
|
|
6908
|
-
describesOperations:
|
|
6960
|
+
describesOperations: z20.literal(true).optional(),
|
|
6909
6961
|
/** Mirrors `UriModuleContribution.looksUpWebLinks`. */
|
|
6910
|
-
looksUpWebLinks:
|
|
6962
|
+
looksUpWebLinks: z20.literal(true).optional(),
|
|
6911
6963
|
...UriModuleFacts2.shape
|
|
6912
6964
|
});
|
|
6913
|
-
const ResolvedKayAgentArtifactUriModule2 =
|
|
6965
|
+
const ResolvedKayAgentArtifactUriModule2 = z20.strictObject({
|
|
6914
6966
|
localId: LocalContributionId2,
|
|
6915
6967
|
globalId: GlobalContributionId2,
|
|
6916
6968
|
scheme: UriScheme2,
|
|
6917
|
-
editable:
|
|
6918
|
-
listable:
|
|
6919
|
-
deletable:
|
|
6920
|
-
appendable:
|
|
6921
|
-
storageScope:
|
|
6969
|
+
editable: z20.boolean(),
|
|
6970
|
+
listable: z20.boolean(),
|
|
6971
|
+
deletable: z20.boolean(),
|
|
6972
|
+
appendable: z20.boolean(),
|
|
6973
|
+
storageScope: z20.enum(["session", "family"])
|
|
6922
6974
|
});
|
|
6923
|
-
const ResolvedKayAgentEntityResolver2 =
|
|
6975
|
+
const ResolvedKayAgentEntityResolver2 = z20.strictObject({
|
|
6924
6976
|
localId: LocalContributionId2,
|
|
6925
6977
|
globalId: GlobalContributionId2,
|
|
6926
6978
|
displayName: NonEmptyString3.optional(),
|
|
6927
6979
|
uriModule: GlobalContributionId2,
|
|
6928
|
-
entityTypes:
|
|
6980
|
+
entityTypes: z20.array(NonEmptyString3).min(1),
|
|
6929
6981
|
uriHint: NonEmptyString3
|
|
6930
6982
|
});
|
|
6931
|
-
const ResolvedKayAgentGitHostClaim2 =
|
|
6983
|
+
const ResolvedKayAgentGitHostClaim2 = z20.strictObject({
|
|
6932
6984
|
host: GitHostName2,
|
|
6933
6985
|
authServiceId: GlobalContributionId2,
|
|
6934
6986
|
/** Manifest-declared order; the clone ladder tries them in sequence. */
|
|
6935
|
-
authSchemeIds:
|
|
6987
|
+
authSchemeIds: z20.array(GlobalContributionId2).min(1),
|
|
6936
6988
|
/** Non-secret display copy for the claiming service, for clone failure text. */
|
|
6937
|
-
authServiceDisplayName:
|
|
6989
|
+
authServiceDisplayName: z20.string(),
|
|
6938
6990
|
basicAuthUser: GitBasicAuthUser2
|
|
6939
6991
|
});
|
|
6940
|
-
const ResolvedKayAgentConverter2 =
|
|
6992
|
+
const ResolvedKayAgentConverter2 = z20.strictObject({
|
|
6941
6993
|
localId: LocalContributionId2,
|
|
6942
6994
|
globalId: GlobalContributionId2,
|
|
6943
6995
|
description: NonEmptyString3.optional(),
|
|
6944
|
-
mimeTypes:
|
|
6945
|
-
extensions:
|
|
6996
|
+
mimeTypes: z20.array(MimeTypeString2).min(1),
|
|
6997
|
+
extensions: z20.array(FileExtensionToken2).min(1).optional()
|
|
6946
6998
|
});
|
|
6947
6999
|
const ResolvedReferencePresentationUrlClaim = ReferencePresentationUrlClaim2.extend({
|
|
6948
|
-
brandIcon:
|
|
7000
|
+
brandIcon: z20.string().max(64 * 1024).optional()
|
|
6949
7001
|
});
|
|
6950
|
-
const ResolvedReferencePresentation2 =
|
|
7002
|
+
const ResolvedReferencePresentation2 = z20.strictObject({
|
|
6951
7003
|
localId: LocalContributionId2,
|
|
6952
7004
|
globalId: GlobalContributionId2,
|
|
6953
7005
|
uriModule: GlobalContributionId2.optional(),
|
|
6954
7006
|
/** The schemes this presentation is about: its `scheme`, or its module's. */
|
|
6955
|
-
schemes:
|
|
7007
|
+
schemes: z20.array(UriScheme2).min(1).optional(),
|
|
6956
7008
|
/** The module's `displayName`: the source's name in a row. */
|
|
6957
7009
|
displayName: NonEmptyString3.optional(),
|
|
6958
7010
|
/** The module's auth service, qualified: whose accounts `accountLinks` reads. */
|
|
6959
7011
|
authService: GlobalContributionId2.optional(),
|
|
6960
7012
|
accountLinks: ReferencePresentationAccountLinks2.optional(),
|
|
6961
|
-
addresses:
|
|
7013
|
+
addresses: z20.array(ReferencePresentationAddress2).min(1).optional(),
|
|
6962
7014
|
/** Comes with `open`. A presentation with neither only words its module's addresses. */
|
|
6963
7015
|
resourceKind: NonEmptyString3.optional(),
|
|
6964
7016
|
open: ReferenceOpenBehavior2.optional(),
|
|
6965
7017
|
/** MIME-specific resource kinds; absent keys use the base presentation. */
|
|
6966
7018
|
variants: ReferencePresentationVariants2.optional(),
|
|
6967
|
-
claims:
|
|
6968
|
-
tooltip:
|
|
7019
|
+
claims: z20.array(ResolvedReferencePresentationUrlClaim).optional(),
|
|
7020
|
+
tooltip: z20.strictObject({
|
|
6969
7021
|
app: GlobalContributionId2,
|
|
6970
7022
|
pattern: ReferencePresentationUriPattern2
|
|
6971
7023
|
}).optional(),
|
|
6972
7024
|
words: ReferencePresentationWords2.optional()
|
|
6973
7025
|
});
|
|
6974
|
-
const ResolvedPluginProvisioningRequirement2 =
|
|
7026
|
+
const ResolvedPluginProvisioningRequirement2 = z20.strictObject({
|
|
6975
7027
|
id: LocalContributionId2,
|
|
6976
7028
|
displayName: NonEmptyString3,
|
|
6977
7029
|
description: NonEmptyString3,
|
|
@@ -6981,15 +7033,15 @@ function createResolvedContractSchemas(canonical) {
|
|
|
6981
7033
|
* URL degrades to "Reconnect" in the UI instead of a broken link.
|
|
6982
7034
|
*/
|
|
6983
7035
|
remediationUrl: HttpsUrl2.optional(),
|
|
6984
|
-
probe:
|
|
7036
|
+
probe: z20.strictObject({
|
|
6985
7037
|
url: HttpsUrl2,
|
|
6986
|
-
method:
|
|
6987
|
-
verdictStatuses:
|
|
7038
|
+
method: z20.enum(["GET"]),
|
|
7039
|
+
verdictStatuses: z20.array(SignedInStatusCode2).min(1),
|
|
6988
7040
|
nonEmptyArrayAt: NonEmptyString3.optional()
|
|
6989
7041
|
})
|
|
6990
7042
|
});
|
|
6991
7043
|
const ResolvedProvisioningField = {
|
|
6992
|
-
provisioning:
|
|
7044
|
+
provisioning: z20.array(ResolvedPluginProvisioningRequirement2).optional()
|
|
6993
7045
|
};
|
|
6994
7046
|
const ResolvedPluginAuthSchemeDescriptionFields = {
|
|
6995
7047
|
displayName: NonEmptyString3.optional(),
|
|
@@ -7001,120 +7053,120 @@ function createResolvedContractSchemas(canonical) {
|
|
|
7001
7053
|
...ResolvedPluginAuthSchemeDescriptionFields,
|
|
7002
7054
|
localId: LocalContributionId2,
|
|
7003
7055
|
globalId: GlobalContributionId2,
|
|
7004
|
-
kind:
|
|
7005
|
-
scopes:
|
|
7006
|
-
connectScopes:
|
|
7056
|
+
kind: z20.literal("oauth2"),
|
|
7057
|
+
scopes: z20.array(z20.string()).optional(),
|
|
7058
|
+
connectScopes: z20.array(NonEmptyString3).optional(),
|
|
7007
7059
|
authorizationUrl: HttpsUrl2,
|
|
7008
7060
|
tokenUrl: HttpsUrl2,
|
|
7009
|
-
extraAuthorizeParams:
|
|
7010
|
-
extraAuthorizeParamsWhenAccountHeld:
|
|
7061
|
+
extraAuthorizeParams: z20.record(z20.string(), z20.string()).optional(),
|
|
7062
|
+
extraAuthorizeParamsWhenAccountHeld: z20.record(NonEmptyString3, z20.string()).optional()
|
|
7011
7063
|
};
|
|
7012
|
-
const ResolvedPluginAuthSchemeOAuthPkce =
|
|
7064
|
+
const ResolvedPluginAuthSchemeOAuthPkce = z20.strictObject({
|
|
7013
7065
|
...ResolvedPluginAuthSchemeOAuthBase,
|
|
7014
|
-
exchange:
|
|
7066
|
+
exchange: z20.literal("pkce"),
|
|
7015
7067
|
byoocProfile: PluginByoocProfile.optional(),
|
|
7016
|
-
clientSuppliers:
|
|
7068
|
+
clientSuppliers: z20.array(PluginOAuthClientSupplier2).nonempty(),
|
|
7017
7069
|
clientId: NonEmptyString3.optional(),
|
|
7018
7070
|
clientSecret: NonEmptyString3.optional(),
|
|
7019
|
-
account:
|
|
7071
|
+
account: z20.literal("lookup").optional()
|
|
7020
7072
|
});
|
|
7021
|
-
const ResolvedPluginAuthSchemeOAuthConfidential =
|
|
7073
|
+
const ResolvedPluginAuthSchemeOAuthConfidential = z20.strictObject({
|
|
7022
7074
|
...ResolvedPluginAuthSchemeOAuthBase,
|
|
7023
|
-
exchange:
|
|
7024
|
-
clientSuppliers:
|
|
7025
|
-
account:
|
|
7075
|
+
exchange: z20.literal("confidential"),
|
|
7076
|
+
clientSuppliers: z20.tuple([z20.literal("kay")]),
|
|
7077
|
+
account: z20.enum(["lookup", "sign-in"])
|
|
7026
7078
|
});
|
|
7027
|
-
const ResolvedPluginAuthSchemeOAuth2 =
|
|
7079
|
+
const ResolvedPluginAuthSchemeOAuth2 = z20.discriminatedUnion("exchange", [
|
|
7028
7080
|
ResolvedPluginAuthSchemeOAuthPkce,
|
|
7029
7081
|
ResolvedPluginAuthSchemeOAuthConfidential
|
|
7030
7082
|
]);
|
|
7031
|
-
const ResolvedPluginAuthSchemeApiKey =
|
|
7083
|
+
const ResolvedPluginAuthSchemeApiKey = z20.strictObject({
|
|
7032
7084
|
...ResolvedProvisioningField,
|
|
7033
7085
|
...ResolvedPluginAuthSchemeDescriptionFields,
|
|
7034
7086
|
localId: LocalContributionId2,
|
|
7035
7087
|
globalId: GlobalContributionId2,
|
|
7036
|
-
kind:
|
|
7037
|
-
scopes:
|
|
7088
|
+
kind: z20.literal("api-key"),
|
|
7089
|
+
scopes: z20.array(z20.string()).optional(),
|
|
7038
7090
|
/** Resolution applies the manifest's default, "<service name> API key". */
|
|
7039
7091
|
inputLabel: NonEmptyString3,
|
|
7040
|
-
fields:
|
|
7041
|
-
setup:
|
|
7042
|
-
account:
|
|
7092
|
+
fields: z20.array(z20.strictObject({ id: z20.string(), label: z20.string() })).optional(),
|
|
7093
|
+
setup: z20.strictObject({ instructions: z20.string(), url: HttpsUrl2 }).optional(),
|
|
7094
|
+
account: z20.literal("lookup").optional()
|
|
7043
7095
|
});
|
|
7044
|
-
const ResolvedPluginAuthSchemeDelegated =
|
|
7096
|
+
const ResolvedPluginAuthSchemeDelegated = z20.strictObject({
|
|
7045
7097
|
...ResolvedPluginAuthSchemeDescriptionFields,
|
|
7046
7098
|
localId: LocalContributionId2,
|
|
7047
7099
|
globalId: GlobalContributionId2,
|
|
7048
|
-
kind:
|
|
7049
|
-
scopes:
|
|
7100
|
+
kind: z20.literal("delegated"),
|
|
7101
|
+
scopes: z20.array(z20.string()).optional()
|
|
7050
7102
|
});
|
|
7051
|
-
const ResolvedPluginAuthSchemeExternalCli =
|
|
7103
|
+
const ResolvedPluginAuthSchemeExternalCli = z20.strictObject({
|
|
7052
7104
|
...ResolvedPluginAuthSchemeDescriptionFields,
|
|
7053
7105
|
localId: LocalContributionId2,
|
|
7054
7106
|
globalId: GlobalContributionId2,
|
|
7055
|
-
kind:
|
|
7056
|
-
scopes:
|
|
7107
|
+
kind: z20.literal("external-cli"),
|
|
7108
|
+
scopes: z20.array(z20.string()).optional(),
|
|
7057
7109
|
/** The manifest's connect facts, verbatim. */
|
|
7058
7110
|
cli: PluginExternalCliConnect2.optional()
|
|
7059
7111
|
});
|
|
7060
|
-
const ResolvedPluginAuthScheme2 =
|
|
7112
|
+
const ResolvedPluginAuthScheme2 = z20.discriminatedUnion("kind", [
|
|
7061
7113
|
ResolvedPluginAuthSchemeOAuth2,
|
|
7062
7114
|
ResolvedPluginAuthSchemeApiKey,
|
|
7063
7115
|
ResolvedPluginAuthSchemeDelegated,
|
|
7064
7116
|
ResolvedPluginAuthSchemeExternalCli
|
|
7065
7117
|
]);
|
|
7066
|
-
const ResolvedPluginWebSession2 =
|
|
7067
|
-
importance:
|
|
7118
|
+
const ResolvedPluginWebSession2 = z20.strictObject({
|
|
7119
|
+
importance: z20.enum(["required", "recommended"]),
|
|
7068
7120
|
loginUrl: HttpsUrl2,
|
|
7069
|
-
cookieDomains:
|
|
7070
|
-
probe:
|
|
7121
|
+
cookieDomains: z20.array(RegistrableDomain2).min(1),
|
|
7122
|
+
probe: z20.strictObject({
|
|
7071
7123
|
url: HttpsUrl2,
|
|
7072
|
-
method:
|
|
7073
|
-
signedInStatuses:
|
|
7124
|
+
method: z20.enum(["GET", "POST"]),
|
|
7125
|
+
signedInStatuses: z20.array(SignedInStatusCode2).min(1)
|
|
7074
7126
|
}),
|
|
7075
|
-
oauthVenue:
|
|
7076
|
-
signInFirst:
|
|
7127
|
+
oauthVenue: z20.enum(["embedded", "external"]),
|
|
7128
|
+
signInFirst: z20.string().optional()
|
|
7077
7129
|
}).superRefine(refineWebSessionScopeConfined);
|
|
7078
|
-
const ResolvedPluginAuthService2 =
|
|
7130
|
+
const ResolvedPluginAuthService2 = z20.strictObject({
|
|
7079
7131
|
localId: LocalContributionId2,
|
|
7080
7132
|
globalId: GlobalContributionId2,
|
|
7081
|
-
displayName:
|
|
7082
|
-
summary:
|
|
7083
|
-
schemes:
|
|
7084
|
-
purposes:
|
|
7133
|
+
displayName: z20.string(),
|
|
7134
|
+
summary: z20.string().optional(),
|
|
7135
|
+
schemes: z20.array(ResolvedPluginAuthScheme2).min(1),
|
|
7136
|
+
purposes: z20.array(z20.string()).min(1),
|
|
7085
7137
|
/** The service's browser half, when the manifest declares one. */
|
|
7086
7138
|
webSession: ResolvedPluginWebSession2.optional()
|
|
7087
7139
|
});
|
|
7088
|
-
const ResolvedKayUiAppEndpointCapability2 =
|
|
7089
|
-
|
|
7140
|
+
const ResolvedKayUiAppEndpointCapability2 = z20.union([
|
|
7141
|
+
z20.strictObject({
|
|
7090
7142
|
localId: LocalContributionId2,
|
|
7091
7143
|
globalId: GlobalContributionId2
|
|
7092
7144
|
}),
|
|
7093
|
-
|
|
7145
|
+
z20.strictObject({ pluginId: PluginId2, localId: LocalContributionId2 })
|
|
7094
7146
|
]);
|
|
7095
|
-
const ResolvedKayUiApp2 =
|
|
7147
|
+
const ResolvedKayUiApp2 = z20.strictObject({
|
|
7096
7148
|
localId: LocalContributionId2,
|
|
7097
7149
|
globalId: GlobalContributionId2,
|
|
7098
7150
|
displayName: NonEmptyString3,
|
|
7099
|
-
contextOnly:
|
|
7151
|
+
contextOnly: z20.literal(true).optional(),
|
|
7100
7152
|
description: NonEmptyString3.optional(),
|
|
7101
7153
|
icon: PackageAssetPath2.optional(),
|
|
7102
|
-
runtime:
|
|
7103
|
-
sdk:
|
|
7154
|
+
runtime: z20.literal("kay.react-app.v1"),
|
|
7155
|
+
sdk: z20.strictObject({ range: NonEmptyString3 }),
|
|
7104
7156
|
entrypoint: TargetEntrypoint2,
|
|
7105
|
-
styles:
|
|
7106
|
-
assets:
|
|
7107
|
-
capabilities:
|
|
7108
|
-
endpoints:
|
|
7109
|
-
host:
|
|
7110
|
-
feeds:
|
|
7157
|
+
styles: z20.array(PackageAssetPath2).optional(),
|
|
7158
|
+
assets: z20.array(PackageAssetPath2).optional(),
|
|
7159
|
+
capabilities: z20.strictObject({
|
|
7160
|
+
endpoints: z20.array(ResolvedKayUiAppEndpointCapability2).optional(),
|
|
7161
|
+
host: z20.array(KayUiAppHostCapability2).optional(),
|
|
7162
|
+
feeds: z20.array((canonical ? canonicalContributionSchemas : contributions_exports).UiAppCapabilityReference).optional()
|
|
7111
7163
|
}).optional()
|
|
7112
7164
|
});
|
|
7113
|
-
const ResolvedPluginContractV12 =
|
|
7114
|
-
protocol:
|
|
7165
|
+
const ResolvedPluginContractV12 = z20.strictObject({
|
|
7166
|
+
protocol: z20.literal("kay.plugin.v1"),
|
|
7115
7167
|
pluginId: PluginId2,
|
|
7116
7168
|
namespace: PluginNamespace2,
|
|
7117
|
-
contributions:
|
|
7169
|
+
contributions: z20.array(ResolvedPluginContributionId2),
|
|
7118
7170
|
// The deduplicated set of qualified (dotted) external auth-service ids this
|
|
7119
7171
|
// plugin references, from agent uriModule, tool and cliBinding
|
|
7120
7172
|
// `authService` refs, card sign-in refs, and auth-grant `service` refs. Always present - a plugin
|
|
@@ -7122,19 +7174,19 @@ function createResolvedContractSchemas(canonical) {
|
|
|
7122
7174
|
// is a recorded dependency, not a resolution: there is no runtime plugin
|
|
7123
7175
|
// loader in v1, so nothing here verifies the reference resolves within a
|
|
7124
7176
|
// composed roster (a composition-time concern owned elsewhere).
|
|
7125
|
-
consumesAuthServices:
|
|
7177
|
+
consumesAuthServices: z20.array(GlobalContributionId2),
|
|
7126
7178
|
// The explicit plugin-level dependency ids declared in `dependencies.plugins` on the manifest,
|
|
7127
7179
|
// deduped and validated at parse time. Always present; a plugin with no explicit dependencies
|
|
7128
7180
|
// carries an empty array. Composition checks each id against the accepted roster and derives the
|
|
7129
7181
|
// full dependency graph together with auth-inferred edges from `consumesAuthServices`.
|
|
7130
|
-
explicitDependencies:
|
|
7182
|
+
explicitDependencies: z20.array(PluginId2),
|
|
7131
7183
|
dataDirSharedWith: PluginId2.optional(),
|
|
7132
|
-
workers:
|
|
7184
|
+
workers: z20.array(z20.strictObject({
|
|
7133
7185
|
localId: LocalContributionId2,
|
|
7134
7186
|
module: PackageAssetPath2
|
|
7135
7187
|
})).optional(),
|
|
7136
|
-
workloadPurposes:
|
|
7137
|
-
shellCommands:
|
|
7188
|
+
workloadPurposes: z20.array(PluginWorkloadPurpose).optional(),
|
|
7189
|
+
shellCommands: z20.array(PluginShellCommand.omit({ endpoint: true }).extend({
|
|
7138
7190
|
endpointId: GlobalContributionId2
|
|
7139
7191
|
})).optional(),
|
|
7140
7192
|
projectDirectories: PluginProjectDirectories.omit({ endpoint: true }).extend({ endpointId: GlobalContributionId2 }).optional(),
|
|
@@ -7142,27 +7194,27 @@ function createResolvedContractSchemas(canonical) {
|
|
|
7142
7194
|
// target must register and the credential authority keys on. Always present;
|
|
7143
7195
|
// a plugin that declares no `auth.services` carries an empty array. The dual
|
|
7144
7196
|
// of `consumesAuthServices` (services it merely references).
|
|
7145
|
-
authServices:
|
|
7197
|
+
authServices: z20.array(ResolvedPluginAuthService2),
|
|
7146
7198
|
grants: ResolvedPluginGrants2.optional(),
|
|
7147
|
-
kayAgentFamilyFolder:
|
|
7148
|
-
kayAgentUriModules:
|
|
7149
|
-
kayAgentArtifactUriModules:
|
|
7150
|
-
kayAgentEntityResolvers:
|
|
7151
|
-
kayAgentGitHostClaims:
|
|
7152
|
-
kayAgentTools:
|
|
7153
|
-
kayAppArtifacts:
|
|
7154
|
-
kayAppUriModules:
|
|
7155
|
-
kayAppTools:
|
|
7156
|
-
kayAppApprovalTypes:
|
|
7157
|
-
kayAppWorkflows:
|
|
7158
|
-
kayAppCards:
|
|
7159
|
-
kayAppDataSources:
|
|
7160
|
-
kayAppWhiteboardTypes:
|
|
7161
|
-
kayAppWorkingDocumentProviders:
|
|
7162
|
-
kayAppMcpServers:
|
|
7163
|
-
kayAgentConverters:
|
|
7164
|
-
referencePresentations:
|
|
7165
|
-
kayUiApps:
|
|
7199
|
+
kayAgentFamilyFolder: z20.strictObject({ scope: z20.literal("root") }).optional(),
|
|
7200
|
+
kayAgentUriModules: z20.array(ResolvedKayAgentUriModule2).optional(),
|
|
7201
|
+
kayAgentArtifactUriModules: z20.array(ResolvedKayAgentArtifactUriModule2).optional(),
|
|
7202
|
+
kayAgentEntityResolvers: z20.array(ResolvedKayAgentEntityResolver2).optional(),
|
|
7203
|
+
kayAgentGitHostClaims: z20.array(ResolvedKayAgentGitHostClaim2).optional(),
|
|
7204
|
+
kayAgentTools: z20.array(ResolvedKayAgentTool2).optional(),
|
|
7205
|
+
kayAppArtifacts: z20.strictObject({ outputs: z20.literal(true) }).optional(),
|
|
7206
|
+
kayAppUriModules: z20.array(ResolvedKayAgentUriModule2).optional(),
|
|
7207
|
+
kayAppTools: z20.array(ResolvedKayAppTool2).optional(),
|
|
7208
|
+
kayAppApprovalTypes: z20.array(ResolvedKayAppApprovalType2).optional(),
|
|
7209
|
+
kayAppWorkflows: z20.array(ResolvedKayAppWorkflow2).optional(),
|
|
7210
|
+
kayAppCards: z20.array(ResolvedPluginCard2).optional(),
|
|
7211
|
+
kayAppDataSources: z20.array(ResolvedKayAppDataSource2).optional(),
|
|
7212
|
+
kayAppWhiteboardTypes: z20.array(ResolvedKayAppWhiteboardType2).optional(),
|
|
7213
|
+
kayAppWorkingDocumentProviders: z20.array(ResolvedKayAppWorkingDocumentProvider2).optional(),
|
|
7214
|
+
kayAppMcpServers: z20.array(ResolvedKayAppMcpServer2).optional(),
|
|
7215
|
+
kayAgentConverters: z20.array(ResolvedKayAgentConverter2).optional(),
|
|
7216
|
+
referencePresentations: z20.array(ResolvedReferencePresentation2).optional(),
|
|
7217
|
+
kayUiApps: z20.array(ResolvedKayUiApp2).optional()
|
|
7166
7218
|
});
|
|
7167
7219
|
return {
|
|
7168
7220
|
ResolvedPluginContributionId: ResolvedPluginContributionId2,
|
|
@@ -7942,14 +7994,14 @@ function kayPluginCompatibilityAdvisories(input) {
|
|
|
7942
7994
|
message: boundPluginDiagnosticMessage(`${manifest.displayName} (${manifest.id}) ${advisory.message}`)
|
|
7943
7995
|
}));
|
|
7944
7996
|
}
|
|
7945
|
-
var ReadableCompatibility =
|
|
7946
|
-
supportedProtocols:
|
|
7997
|
+
var ReadableCompatibility = z21.object({
|
|
7998
|
+
supportedProtocols: z21.array(z21.string()).optional().catch(void 0),
|
|
7947
7999
|
minKayVersion: NonEmptyString.optional().catch(void 0),
|
|
7948
8000
|
sdk: NonEmptyString.optional().catch(void 0)
|
|
7949
8001
|
});
|
|
7950
|
-
var ReadableManifestHead =
|
|
7951
|
-
id:
|
|
7952
|
-
displayName:
|
|
8002
|
+
var ReadableManifestHead = z21.object({
|
|
8003
|
+
id: z21.string().optional().catch(void 0),
|
|
8004
|
+
displayName: z21.string().optional().catch(void 0),
|
|
7953
8005
|
compatibility: ReadableCompatibility.optional().catch(void 0)
|
|
7954
8006
|
});
|
|
7955
8007
|
function keepNamespaceDerivedTools(contract, grandfathered) {
|
|
@@ -8056,28 +8108,28 @@ function errorText(error) {
|
|
|
8056
8108
|
}
|
|
8057
8109
|
|
|
8058
8110
|
// packages/plugin-protocol/dist/session-health.js
|
|
8059
|
-
import { z as
|
|
8111
|
+
import { z as z22 } from "zod";
|
|
8060
8112
|
var SESSION_HEALTH_EXTENSION_ID = "kay.session-health";
|
|
8061
8113
|
var SESSION_HEALTH_ENTRY_NAME = "session_health";
|
|
8062
8114
|
var SESSION_HEALTH_CUSTOM_TYPE = `ext:${SESSION_HEALTH_EXTENSION_ID}:${SESSION_HEALTH_ENTRY_NAME}`;
|
|
8063
8115
|
var SESSION_HEALTH_CLASSIFIER_IDS = ["jev"];
|
|
8064
|
-
var sessionHealthEntrySchema =
|
|
8065
|
-
v:
|
|
8066
|
-
verdict:
|
|
8116
|
+
var sessionHealthEntrySchema = z22.object({
|
|
8117
|
+
v: z22.literal(1),
|
|
8118
|
+
verdict: z22.enum(["well", "bad", "unknown"]),
|
|
8067
8119
|
/**
|
|
8068
8120
|
* The model's calibrated confidence in `well`, 0..1, or null when the
|
|
8069
8121
|
* classifier declined to produce one. Never exported raw: the telemetry
|
|
8070
8122
|
* event carries only the decile bucket.
|
|
8071
8123
|
*/
|
|
8072
|
-
p_well:
|
|
8073
|
-
classifier:
|
|
8074
|
-
classifier_version:
|
|
8075
|
-
judged_at:
|
|
8076
|
-
user_entry_id:
|
|
8077
|
-
through_entry_id:
|
|
8078
|
-
usage:
|
|
8079
|
-
input_tokens:
|
|
8080
|
-
output_tokens:
|
|
8124
|
+
p_well: z22.number().min(0).max(1).nullable(),
|
|
8125
|
+
classifier: z22.enum(SESSION_HEALTH_CLASSIFIER_IDS),
|
|
8126
|
+
classifier_version: z22.string().min(1).max(64),
|
|
8127
|
+
judged_at: z22.number().int().nonnegative(),
|
|
8128
|
+
user_entry_id: z22.string().min(1).max(256),
|
|
8129
|
+
through_entry_id: z22.string().min(1).max(256),
|
|
8130
|
+
usage: z22.strictObject({
|
|
8131
|
+
input_tokens: z22.number().int().nonnegative(),
|
|
8132
|
+
output_tokens: z22.number().int().nonnegative()
|
|
8081
8133
|
}).optional()
|
|
8082
8134
|
});
|
|
8083
8135
|
function sessionHealthPWellDecile(pWell) {
|
|
@@ -8086,41 +8138,29 @@ function sessionHealthPWellDecile(pWell) {
|
|
|
8086
8138
|
return Math.min(9, Math.floor(pWell * 10));
|
|
8087
8139
|
}
|
|
8088
8140
|
|
|
8089
|
-
// packages/plugin-protocol/dist/session-state.js
|
|
8090
|
-
var PLUGIN_STATE_ENTRY_NAME_PATTERN = /^[a-z][a-z0-9-]{0,63}$/;
|
|
8091
|
-
var PLUGIN_STATE_ENTRY_MAX_BYTES = 256 * 1024;
|
|
8092
|
-
var PLUGIN_STATE_ENTRY_MAX_DEPTH = 64;
|
|
8093
|
-
var PLUGIN_STATE_ENTRY_TYPE_PREFIX = "plugin-state:";
|
|
8094
|
-
function pluginStateEntryCustomType(pluginId, name) {
|
|
8095
|
-
return PLUGIN_STATE_ENTRY_NAME_PATTERN.test(name) ? `${PLUGIN_STATE_ENTRY_TYPE_PREFIX}${pluginId}:${name}` : void 0;
|
|
8096
|
-
}
|
|
8097
|
-
function isPluginStateEntryCustomType(customType) {
|
|
8098
|
-
return customType.startsWith(PLUGIN_STATE_ENTRY_TYPE_PREFIX);
|
|
8099
|
-
}
|
|
8100
|
-
|
|
8101
8141
|
// packages/plugin-protocol/dist/resource-invocations.js
|
|
8102
|
-
import { z as
|
|
8142
|
+
import { z as z24 } from "zod";
|
|
8103
8143
|
|
|
8104
8144
|
// packages/plugin-protocol/dist/resource-invocation-cursor.js
|
|
8105
|
-
import { z as
|
|
8106
|
-
var CorpusResourceInvocationCursor =
|
|
8107
|
-
at:
|
|
8108
|
-
eventId:
|
|
8145
|
+
import { z as z23 } from "zod";
|
|
8146
|
+
var CorpusResourceInvocationCursor = z23.strictObject({
|
|
8147
|
+
at: z23.iso.datetime({ offset: true }),
|
|
8148
|
+
eventId: z23.string().min(1)
|
|
8109
8149
|
});
|
|
8110
8150
|
|
|
8111
8151
|
// packages/plugin-protocol/dist/resource-invocations.js
|
|
8112
|
-
var CorpusResourceKind =
|
|
8152
|
+
var CorpusResourceKind = z24.enum([
|
|
8113
8153
|
"skill",
|
|
8114
8154
|
"context-file",
|
|
8115
8155
|
"prompt-command"
|
|
8116
8156
|
]);
|
|
8117
|
-
var CorpusResourceInvocationQuery =
|
|
8157
|
+
var CorpusResourceInvocationQuery = z24.strictObject({
|
|
8118
8158
|
kind: CorpusResourceKind,
|
|
8119
|
-
since:
|
|
8120
|
-
until:
|
|
8159
|
+
since: z24.iso.datetime({ offset: true }),
|
|
8160
|
+
until: z24.iso.datetime({ offset: true }),
|
|
8121
8161
|
after: CorpusResourceInvocationCursor.optional(),
|
|
8122
|
-
limit:
|
|
8123
|
-
rootCreatedByKind:
|
|
8162
|
+
limit: z24.number().int().min(1).max(1e3).optional(),
|
|
8163
|
+
rootCreatedByKind: z24.enum(AGENT_RUNTIME_SESSION_CREATOR_KINDS).optional()
|
|
8124
8164
|
}).refine((value) => Date.parse(value.since) < Date.parse(value.until), {
|
|
8125
8165
|
message: "since must precede until"
|
|
8126
8166
|
});
|
|
@@ -8300,14 +8340,14 @@ function skillSuggestionEvidenceItems(evidence, options = {}) {
|
|
|
8300
8340
|
}
|
|
8301
8341
|
|
|
8302
8342
|
// packages/plugin-protocol/dist/ui-app-package.js
|
|
8303
|
-
import { z as
|
|
8343
|
+
import { z as z25 } from "zod";
|
|
8304
8344
|
var KAY_UI_APP_PACKAGE_PROTOCOL = "kay.ui.app-package.v1";
|
|
8305
8345
|
var KAY_UI_BUNDLE_INDEX_PROTOCOL = "kay.ui.bundle-index.v1";
|
|
8306
|
-
var KayUiBundleOutputPath =
|
|
8307
|
-
var KayUiBundleIndexV1 =
|
|
8308
|
-
protocol:
|
|
8346
|
+
var KayUiBundleOutputPath = z25.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" });
|
|
8347
|
+
var KayUiBundleIndexV1 = z25.strictObject({
|
|
8348
|
+
protocol: z25.literal(KAY_UI_BUNDLE_INDEX_PROTOCOL),
|
|
8309
8349
|
entryPath: KayUiBundleOutputPath,
|
|
8310
|
-
files:
|
|
8350
|
+
files: z25.array(z25.strictObject({
|
|
8311
8351
|
path: KayUiBundleOutputPath,
|
|
8312
8352
|
mediaType: NonEmptyString
|
|
8313
8353
|
})).min(1)
|
|
@@ -8334,19 +8374,19 @@ var KayUiBundleIndexV1 = z24.strictObject({
|
|
|
8334
8374
|
function parseKayUiBundleIndexV1(input) {
|
|
8335
8375
|
return KayUiBundleIndexV1.parse(input);
|
|
8336
8376
|
}
|
|
8337
|
-
var KayUiAppPackageFile =
|
|
8377
|
+
var KayUiAppPackageFile = z25.strictObject({
|
|
8338
8378
|
path: PackageAssetPath,
|
|
8339
8379
|
mediaType: NonEmptyString,
|
|
8340
|
-
bytes:
|
|
8380
|
+
bytes: z25.instanceof(Uint8Array).refine((bytes) => bytes.byteLength > 0, {
|
|
8341
8381
|
message: "app package file bytes must not be empty"
|
|
8342
8382
|
})
|
|
8343
8383
|
});
|
|
8344
|
-
var KayUiAppPackageV1 =
|
|
8345
|
-
protocol:
|
|
8384
|
+
var KayUiAppPackageV1 = z25.strictObject({
|
|
8385
|
+
protocol: z25.literal(KAY_UI_APP_PACKAGE_PROTOCOL),
|
|
8346
8386
|
appLocalId: LocalContributionId,
|
|
8347
8387
|
entry: KayUiAppPackageFile,
|
|
8348
|
-
styles:
|
|
8349
|
-
assets:
|
|
8388
|
+
styles: z25.array(KayUiAppPackageFile).optional(),
|
|
8389
|
+
assets: z25.array(KayUiAppPackageFile).optional()
|
|
8350
8390
|
}).superRefine((appPackage, ctx) => {
|
|
8351
8391
|
if (appPackage.entry.mediaType !== "application/javascript") {
|
|
8352
8392
|
ctx.addIssue({
|
|
@@ -8383,28 +8423,28 @@ function parseKayUiAppPackageV1(input) {
|
|
|
8383
8423
|
}
|
|
8384
8424
|
|
|
8385
8425
|
// packages/plugin-protocol/dist/product-events.js
|
|
8386
|
-
import { z as
|
|
8426
|
+
import { z as z26 } from "zod";
|
|
8387
8427
|
var exportable = {
|
|
8388
|
-
class:
|
|
8389
|
-
optional:
|
|
8428
|
+
class: z26.literal("exportable"),
|
|
8429
|
+
optional: z26.boolean().optional()
|
|
8390
8430
|
};
|
|
8391
|
-
var PluginProductEventField =
|
|
8392
|
-
|
|
8393
|
-
|
|
8431
|
+
var PluginProductEventField = z26.union([
|
|
8432
|
+
z26.strictObject({ class: z26.literal("local") }),
|
|
8433
|
+
z26.strictObject({
|
|
8394
8434
|
...exportable,
|
|
8395
|
-
type:
|
|
8396
|
-
values:
|
|
8435
|
+
type: z26.literal("enum"),
|
|
8436
|
+
values: z26.array(z26.string())
|
|
8397
8437
|
}),
|
|
8398
|
-
|
|
8438
|
+
z26.strictObject({
|
|
8399
8439
|
...exportable,
|
|
8400
|
-
type:
|
|
8401
|
-
min:
|
|
8402
|
-
max:
|
|
8403
|
-
integer:
|
|
8440
|
+
type: z26.literal("number"),
|
|
8441
|
+
min: z26.number(),
|
|
8442
|
+
max: z26.number(),
|
|
8443
|
+
integer: z26.boolean().optional()
|
|
8404
8444
|
}),
|
|
8405
|
-
|
|
8445
|
+
z26.strictObject({
|
|
8406
8446
|
...exportable,
|
|
8407
|
-
type:
|
|
8447
|
+
type: z26.enum([
|
|
8408
8448
|
"boolean",
|
|
8409
8449
|
"id",
|
|
8410
8450
|
"identifier",
|
|
@@ -8420,9 +8460,9 @@ function isPluginProductEventName(name) {
|
|
|
8420
8460
|
}
|
|
8421
8461
|
|
|
8422
8462
|
// packages/plugin-protocol/dist/artifact-outputs.js
|
|
8423
|
-
import { z as
|
|
8463
|
+
import { z as z27 } from "zod";
|
|
8424
8464
|
var ARTIFACT_OUTPUT_PAGE_MAX = 200;
|
|
8425
|
-
var Segment =
|
|
8465
|
+
var Segment = z27.string().min(1).max(1024).refine((value) => !/[^A-Za-z0-9._-]/.test(value)).refine((value) => value !== "." && value !== "..");
|
|
8426
8466
|
function parseArtifactOutputUri(uri) {
|
|
8427
8467
|
const match = /^output:\/\/([^/]+)\/([^/]+)$/.exec(uri);
|
|
8428
8468
|
if (match === null || !Segment.safeParse(match[1]).success || !Segment.safeParse(match[2]).success)
|
|
@@ -8432,12 +8472,12 @@ function parseArtifactOutputUri(uri) {
|
|
|
8432
8472
|
function isCanonicalArtifactOutputUri(uri) {
|
|
8433
8473
|
return parseArtifactOutputUri(uri) !== void 0;
|
|
8434
8474
|
}
|
|
8435
|
-
var ArtifactOutputUri =
|
|
8436
|
-
var ArtifactOutputChange =
|
|
8437
|
-
|
|
8438
|
-
uris:
|
|
8475
|
+
var ArtifactOutputUri = z27.string().refine(isCanonicalArtifactOutputUri, "Expected a canonical output://session/name URI");
|
|
8476
|
+
var ArtifactOutputChange = z27.union([
|
|
8477
|
+
z27.strictObject({
|
|
8478
|
+
uris: z27.array(ArtifactOutputUri).min(1).max(ARTIFACT_OUTPUT_PAGE_MAX)
|
|
8439
8479
|
}),
|
|
8440
|
-
|
|
8480
|
+
z27.strictObject({ sessionId: Segment })
|
|
8441
8481
|
]);
|
|
8442
8482
|
|
|
8443
8483
|
// packages/plugin-protocol/dist/credential-text.js
|
|
@@ -8480,25 +8520,25 @@ function isCredentialShapedText(value) {
|
|
|
8480
8520
|
}
|
|
8481
8521
|
|
|
8482
8522
|
// packages/plugin-protocol/dist/ui-module-bundle.js
|
|
8483
|
-
import { z as
|
|
8523
|
+
import { z as z28 } from "zod";
|
|
8484
8524
|
var KAY_UI_MODULE_BUNDLE_PROTOCOL = "kay.ui.module-bundle.v1";
|
|
8485
8525
|
var KAY_UI_MODULE_FILE_MAX_BYTES = 8 * 1024 * 1024;
|
|
8486
8526
|
var KAY_UI_MODULE_BUNDLE_MAX_BYTES = 32 * 1024 * 1024;
|
|
8487
8527
|
var KAY_UI_MODULE_BUNDLE_MAX_FILES = 256;
|
|
8488
|
-
var OutputPath =
|
|
8528
|
+
var OutputPath = z28.string().min(1).max(1024).refine((value) => {
|
|
8489
8529
|
const parsed = KayUiBundleIndexV1.shape.entryPath.safeParse(value);
|
|
8490
8530
|
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.
|
|
8491
8531
|
!/[\u0000-\u001f?#:%]/.test(value);
|
|
8492
8532
|
}, { message: "bundle path must contain only unambiguous relative segments" });
|
|
8493
|
-
var Sha256 =
|
|
8494
|
-
var KayUiModuleBundleIndexV1 =
|
|
8495
|
-
protocol:
|
|
8533
|
+
var Sha256 = z28.string().regex(/^[a-f0-9]{64}$/);
|
|
8534
|
+
var KayUiModuleBundleIndexV1 = z28.strictObject({
|
|
8535
|
+
protocol: z28.literal(KAY_UI_MODULE_BUNDLE_PROTOCOL),
|
|
8496
8536
|
entryPath: OutputPath,
|
|
8497
|
-
stylePaths:
|
|
8498
|
-
files:
|
|
8537
|
+
stylePaths: z28.array(OutputPath).max(KAY_UI_MODULE_BUNDLE_MAX_FILES),
|
|
8538
|
+
files: z28.array(z28.strictObject({
|
|
8499
8539
|
path: OutputPath,
|
|
8500
|
-
mediaType:
|
|
8501
|
-
byteLength:
|
|
8540
|
+
mediaType: z28.string().min(1).max(128).regex(/^[a-zA-Z0-9!#$&^_.+-]+\/[a-zA-Z0-9!#$&^_.+-]+$/),
|
|
8541
|
+
byteLength: z28.number().int().min(1).max(KAY_UI_MODULE_FILE_MAX_BYTES),
|
|
8502
8542
|
sha256: Sha256
|
|
8503
8543
|
})).min(1).max(KAY_UI_MODULE_BUNDLE_MAX_FILES)
|
|
8504
8544
|
}).superRefine((index, ctx) => {
|
|
@@ -8528,9 +8568,9 @@ var KayUiModuleBundleIndexV1 = z27.strictObject({
|
|
|
8528
8568
|
message: "bundle exceeds byte cap"
|
|
8529
8569
|
});
|
|
8530
8570
|
});
|
|
8531
|
-
var KayUiModuleBundleReference =
|
|
8571
|
+
var KayUiModuleBundleReference = z28.strictObject({
|
|
8532
8572
|
generationId: Sha256,
|
|
8533
|
-
revision:
|
|
8573
|
+
revision: z28.string().min(1).max(4096).refine((value) => value.trim() === value),
|
|
8534
8574
|
index: KayUiModuleBundleIndexV1
|
|
8535
8575
|
});
|
|
8536
8576
|
export {
|
|
@@ -8724,6 +8764,7 @@ export {
|
|
|
8724
8764
|
ProjectDirectoryResponse,
|
|
8725
8765
|
RENAMED_PLUGIN_CAPABILITY_SLUGS,
|
|
8726
8766
|
RESERVED_DIRECTORY_PLUGIN_ID_PREFIXES,
|
|
8767
|
+
RESET_TEXT_MAX_CHARS,
|
|
8727
8768
|
RETIRED_COMPATIBILITY_KEYS,
|
|
8728
8769
|
RETIRED_PERMISSION_ASK_KEYS,
|
|
8729
8770
|
RETIRED_PLUGIN_CAPABILITY_SLUGS,
|
|
@@ -8739,6 +8780,8 @@ export {
|
|
|
8739
8780
|
ReferencePresentationVariants,
|
|
8740
8781
|
ReferencePresentationWords,
|
|
8741
8782
|
RegistrableDomain,
|
|
8783
|
+
ResetTextContribution,
|
|
8784
|
+
ResetTextEntry,
|
|
8742
8785
|
ResolvedAuthGrantRequest,
|
|
8743
8786
|
ResolvedEndpointGrantRequest,
|
|
8744
8787
|
ResolvedKayAgentArtifactUriModule,
|