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