@x-otto/install 0.1.0-alpha.9 → 0.3.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,2452 +1,385 @@
1
- import { SkillDefinition } from "@x-otto/skill";
2
- import { PluginManifest } from "@x-otto/plugin";
3
- import { McpServerConfig } from "@x-otto/mcp";
1
+ import { AskClient, AskOutcome, CREDENTIAL_ISSUE_CODE, CommandContext, CommandMessage, CommandOutcome, ContributionRiskClass, ContributionValidator, ContributionValidatorRegistry, ExtensionPermissions, HitlAnswer, HitlAskRequest, InstallNotifyInput, InstallOperationContext, InstallOptions, InstallProgressInput, InstallResult, InstallSource, InstallStore, ManifestValidationResult, OfficialSelectionToken, PLUGIN_ID_PATTERN as ID_PATTERN, PLUGIN_MANIFEST_FILENAME as MANIFEST_FILENAME, PluginManifestRead, PluginManifestRead as PluginManifestRead$1, PluginManifestReadResult, PluginValidationContext, PluginValidationContext as PluginValidationContext$1, PluginValidationIssue, PluginValidationReport, UpdatePolicyMode, classifyContributionRisk, createContributionValidatorRegistry, credentialKeyNamed, isCredentialShaped, validateCredentialShapes, validateManifest, validatePlugin } from "@x-otto/kernel";
2
+ import * as _$_x_otto_universal0 from "@x-otto/universal";
3
+ import { boolean, list } from "@x-otto/settings";
4
+ import { HookRegistry } from "@x-otto/hooks";
4
5
 
5
- //#region src/types.d.ts
6
- /** postinstall 钩子执行结果(定义在 install 层,调用方注入 executor)。 */
7
- interface PostInstallResult {
8
- success: boolean;
9
- error?: string;
10
- exitCode?: number | null;
11
- timeout?: boolean;
12
- /** 执行的命令(供 CLI 日志)。 */
13
- command?: string;
14
- /** stderr 输出(供 CLI 日志)。 */
15
- stderr?: string;
16
- /** stdout/stderr 超 4KB 上限被截断。 */
17
- truncated?: boolean;
18
- }
19
- /** postinstall 钩子执行上下文。 */
20
- interface PostInstallContext {
21
- pluginDir: string;
22
- pluginId: string;
23
- workspaceDir?: string;
24
- }
25
- type ContentType = 'skill' | 'plugin' | 'mcp';
26
- type SourceType = 'file' | 'url' | 'git' | 'npm';
27
- /** 来源解析结果(RFC-131:+sourceUrl +sourceType +commit) */
28
- interface ResolvedSource {
29
- tempDir: string;
30
- /** 来源 URL(已剥离认证信息,R8)。git→sanitized URL, url→sanitized HTTP, file→文件名, npm→npm:spec */
31
- sourceUrl: string;
32
- sourceType: SourceType;
33
- /** Git commit hash (only for git source) */
34
- commit?: string;
6
+ //#region src/dev-extension-port.d.ts
7
+ type DevExtensionAction = {
8
+ action: 'add';
9
+ path: string;
10
+ } | {
11
+ action: 'remove';
12
+ id: string;
13
+ } | {
14
+ action: 'replace';
15
+ id: string;
16
+ path: string;
17
+ } | {
18
+ action: 'list';
19
+ };
20
+ interface DevExtensionPort {
21
+ ids(context: CommandContext): Promise<{
22
+ available: boolean;
23
+ ids: readonly string[];
24
+ }>;
25
+ lines(context: CommandContext): Promise<{
26
+ available: boolean;
27
+ lines: readonly string[];
28
+ }>;
29
+ isLocalDirectoryTarget(cwd: string, target: string): boolean;
30
+ run(action: DevExtensionAction, context: CommandContext): Promise<CommandOutcome>;
35
31
  }
36
- /** 安装来源元数据,写入 .otto-install.json */
37
- interface InstallSourceMetadata {
38
- sourceType: SourceType;
39
- sourceUrl: string;
40
- commit?: string;
41
- /** 仓库内子路径(monorepo skill;repo root skill 为 undefined) */
42
- subPath?: string;
43
- installedAt: string;
44
- /** 安装来源:'user'(手动CLI)/ 'auto'(自动化) */
45
- installedBy?: string;
46
- /** otto 版本号,用于调试兼容性问题 */
47
- installerVersion?: string;
32
+ //#endregion
33
+ //#region src/root-lock.d.ts
34
+ interface RootLock {
35
+ readonly touched: boolean;
36
+ assertHeld(): Promise<void>;
37
+ touch(): void;
38
+ release(): Promise<void>;
39
+ }
40
+ interface RootLockWaitNotice {
41
+ waitedMs: number;
42
+ holderPid?: number;
43
+ }
44
+ interface RootLockOptions {
45
+ timeoutMs?: number;
46
+ onWait?: (notice: RootLockWaitNotice) => void;
47
+ }
48
+ declare class RootLockBusyError extends Error {
49
+ readonly holder: {
50
+ pid: number;
51
+ host: string;
52
+ } | undefined;
53
+ constructor(holder: {
54
+ pid: number;
55
+ host: string;
56
+ } | undefined);
48
57
  }
49
- /** 安装进度阶段 */
50
- type ProgressPhase = 'resolving' | 'detecting' | 'installing' | 'refreshing';
51
- /** 安装进度回调参数 */
52
- interface InstallProgress {
53
- phase: ProgressPhase;
54
- /** 人读摘要 */
55
- message: string;
56
- /** 当前步骤(1-based)——多 skill 场景的"第几个"计数语义 */
57
- current?: number;
58
- /** 总步骤数——多 skill 场景的"共几个"计数语义 */
59
- total?: number;
60
- /**
61
- * 已下载字节数(RFC-224 D2;仅 url 来源下载阶段填充)。
62
- * 与 `current`/`total` 语义互斥——两者不应在同一次 `onProgress` 调用中同时具备
63
- * 冲突含义(`current`/`total` = 多 skill 计数,`bytesDownloaded`/`bytesTotal` =
64
- * 单文件字节下载进度)。类型层面为 runtime covenant,非编译期强制。
65
- */
66
- bytesDownloaded?: number;
67
- /** 总字节数(`Content-Length` 缺失时为 `undefined`,消费方须降级为纯字节计数展示,
68
- * 不得编造总数,见 RFC-224 R4)。 */
69
- bytesTotal?: number;
58
+ declare function withRootWrite<T>(root: string, operation: (lock: RootLock) => Promise<T>, options?: RootLockOptions): Promise<T>;
59
+ //#endregion
60
+ //#region src/official.d.ts
61
+ interface OfficialSelection {
62
+ readonly source: string;
63
+ readonly expectedId: string;
70
64
  }
71
- interface InstallResult {
72
- success: boolean;
73
- /** 安装的名称 */
74
- name?: string;
75
- /** 安装目标路径 */
76
- targetPath?: string;
77
- /** 错误信息 */
78
- error?: string;
79
- /**
80
- * 失败原因的**结构化分类**(RFC-290 D2)。
81
- *
82
- * `error` 是给人读的本地化文案,**不可**被消费方用子串匹配来判断失败类型——
83
- * 文案会随 locale 与措辞变化,嗅探必然脆断。需要按失败类型分支(如 UI 层决定
84
- * 是否提示 `--force`)时一律读本字段。
85
- *
86
- * `conflict` = 目标已存在且未加 `--force`。缺省表示未分类(消费方不得臆测)。
87
- */
88
- failureKind?: 'conflict';
89
- /** dry-run 时的预览计划,多行 */
90
- plan?: string[];
91
- /** skill 安装时的 SkillDefinition */
92
- definition?: SkillDefinition;
93
- /** plugin 安装时的 PluginManifest */
94
- manifest?: PluginManifest;
95
- /** mcp 安装时写入的 McpServerConfig */
96
- mcpConfig?: McpServerConfig;
97
- /** postinstall 钩子执行结果(RFC-080:仅当 manifest.scripts.postinstall 存在时) */
98
- postinstall?: PostInstallResult;
99
- /**
100
- * plugin 安装时,manifest 声明但尚未被显式授予的高危能力(`HIGH_RISK_CAPABILITIES` 子集,
101
- * 终局 review 2026-07-10 P0-1):`otto install <archive|url|git|npm>` 路径此前对高危能力
102
- * 完全零感知——静默 `trustPlugin()` 却从不检查/展示/授予 provider/tools/tui.renderer/network
103
- * 这类本质风险,与 `otto extension install` 的 `confirmHighRiskInstall`+`applyHighRiskGrant`
104
- * 审计路径不对称。本字段只做「计算 + 呈现」,不自动授予(fail-closed 不变)——调用方
105
- * (CLI handler)据此提示用户显式走 `/trust plugin <id>` 完成授权,装载侧 `pendingCapabilities`
106
- * 门禁(RFC-140 D3)在授权前继续拦截这些能力的实际生效。
107
- */
108
- pendingCapabilities?: string[];
109
- /** 安装过程中的非致命警告(如信任持久化失败、postinstall 失败等) */
110
- warnings?: string[];
111
- /** 多 skill 安装时的子结果列表(RFC-130:--as skill 多结果时填充;单结果时为 undefined) */
112
- results?: InstallResult[];
65
+ interface OfficialCapability {
66
+ readonly sourceName: string;
67
+ mint(selection: OfficialSelection): OfficialSelectionToken;
68
+ verify(token: unknown, selection: OfficialSelection): boolean;
113
69
  }
114
- interface InstallOptions {
115
- /** 项目工作目录(项目级安装时需要) */
116
- workspaceDir?: string;
117
- /** 安装到全局,默认项目级 */
118
- global?: boolean;
119
- /** 覆盖已有同名 */
120
- force?: boolean;
121
- /** 仅检测 + 预览 */
122
- dryRun?: boolean;
123
- /** 强制指定内容类型 */
124
- as?: ContentType;
125
- /** 强制指定来源类型 */
126
- type?: SourceType;
127
- /**
128
- * 来源内子路径(RFC-201 D0/M0):git/归档来源解析后,把内容检测根从 tempDir 切到
129
- * `tempDir/subPath`——monorepo 子目录插件(如本仓 extensions/plugin-weather)的安装
130
- * 前提。路径必须是相对路径且解析后不得越出 tempDir(traversal 防御在 installer 执行)。
131
- */
70
+ //#endregion
71
+ //#region src/registry/schema.d.ts
72
+ type RegistryEntryType = 'plugin';
73
+ interface RegistryEntry {
74
+ id: string;
75
+ type: RegistryEntryType;
76
+ description: string;
77
+ source: string;
132
78
  subPath?: string;
133
- /**
134
- * git 来源的 tag 或 branch 名(RFC-221 D2/T221-2):仅 `type==='git'` 时生效,其余
135
- * 来源类型忽略此字段。**不支持 commit hash**——spike 已验证主流 git 托管方默认拒绝
136
- * fetch 任意 commit(只允许 ref tip)。缺省时行为不变(clone 默认分支 HEAD)。
137
- */
138
- ref?: string;
139
- /** MCP 环境变量 */
140
- env?: Record<string, string>;
141
- /** postinstall 钩子执行器(调用方注入,解耦 plugin-hooks 依赖)。
142
- * 返回 PostInstallResult 或 Promise<PostInstallResult>(允许异步 spawn)。 */
143
- postInstallExecutor?: (ctx: PostInstallContext, command: string) => PostInstallResult | Promise<PostInstallResult>;
144
- /** 来源元数据(RFC-131:resolver 产出,installSkill/installPlugin 消费来写 .otto-install.json) */
145
- sourceMetadata?: {
146
- sourceType: SourceType;
147
- sourceUrl: string;
148
- commit?: string;
149
- subPath?: string;
150
- };
151
- /** 安装进度回调(RFC-131;dry-run 时不触发) */
152
- onProgress?: (p: InstallProgress) => void;
79
+ capabilities?: readonly string[];
80
+ keywords?: readonly string[];
81
+ author?: string;
82
+ homepage?: string;
153
83
  }
154
84
  //#endregion
155
- //#region src/installer.d.ts
156
- /**
157
- * install — 安装编排入口(自动检测来源类型和内容类型)。
158
- *
159
- * 支持四种来源 × 三种内容类型。
160
- * 来源:file(本地归档)、url(HTTP 下载)、git(浅克隆)、npm(npm pack)
161
- * 内容:skill、plugin、mcp
162
- *
163
- * **形态(终局 review 2026-08-14 P1-1)**:此前是 `class InstallManager`,但该类零实例状态
164
- * (无 logger/fetchImpl/配置持有),CLI 侧每次 `new InstallManager()` 都是空壳——类壳只是形式
165
- * 化封装,无语义价值。降级为纯函数:单次安装语义走 `options`,MCP settings 访问经 `getMcpSettings`
166
- * /`persistMcpSettings` 回调注入(本就是参数)。未引入 logger/fetchImpl/timeout 的 deps bag——
167
- * 那三者当前无任何消费方(logger 在 url-resolver 硬编码、fetchImpl 仅 RegistryClient 用、timeout
168
- * 已由 env var 覆盖),凭空造 bag 即为抽象而抽象。真需要时再随消费方一起引入。
169
- *
170
- * **阶段归属(RFC-286 D4)**:只负责 resolve / detect / write 三段,只 fire
171
- * `resolving` / `detecting` / `installing`。**不 fire `refreshing`**——该阶段语义是「能力热重载」,
172
- * 真实动作 `App.reloadCapabilities()` 由 CLI 侧持有,install 包无 App 句柄。谁执行谁上报:
173
- * `refreshing` 由 `handlers/install.ts` 在调用真实 reload 前 fire。`ProgressPhase` 类型保留
174
- * `'refreshing'` 取值供 CLI 使用。
175
- */
176
- declare function install(source: string, options: InstallOptions, getMcpSettings?: () => Record<string, unknown> | undefined, persistMcpSettings?: (servers: Record<string, unknown>) => Promise<void>): Promise<InstallResult>;
177
- /**
178
- * 安装 skill 包(便捷入口:强制 `as: 'skill'`)。
179
- */
180
- declare function installSkill(source: string, options: InstallOptions): Promise<InstallResult>;
181
- //#endregion
182
- //#region src/uninstaller.d.ts
183
- type UninstallTarget = 'skill' | 'plugin' | 'mcp';
184
- type InstallScope = 'global' | 'project' | 'repository';
185
- interface UninstallResult {
186
- success: boolean;
187
- /** 卸载的扩展名称 */
188
- name?: string;
189
- /** 卸载的类型 */
190
- type?: UninstallTarget;
191
- /** 错误信息 */
192
- error?: string;
193
- /** dry-run 预览 */
194
- plan?: string[];
195
- /**
196
- * 非阻断告警(RFC-354 安全修复):卸载成功但存在需用户知晓的残留风险。
197
- * 典型:信任记录撤销失败——目录已删但信任白名单/能力授权可能残留,
198
- * 重装同 id 插件到同一路径时旧授权会复活(fail-open)。撤销失败不阻断目录删除
199
- * (删除是用户明确意图),但必须可见而非静默吞掉。
200
- */
201
- warnings?: string[];
202
- }
203
- interface InstalledItem {
85
+ //#region src/registry/client.d.ts
86
+ interface RegistrySourceConfig {
204
87
  name: string;
205
- type: UninstallTarget;
206
- scope: InstallScope;
207
- /** mcp 详情(仅 type==='mcp') */
208
- detail?: string;
209
- }
210
- interface ListInstalledOptions {
211
- workspaceDir?: string;
212
- /** 仓库根目录(含 pnpm-workspace.yaml),用于 repository scope 扫描。 */
213
- workspaceRoot?: string;
214
- /** 过滤:不传列出所有(global + project + repository),传 'global' 仅全局,传 'project' 仅项目,传 'repository' 仅仓库 */
215
- scope?: InstallScope;
216
- }
217
- interface UninstallOptions {
218
- workspaceDir?: string;
219
- /** 仓库根目录(含 pnpm-workspace.yaml),用于 repository scope 卸载。 */
220
- workspaceRoot?: string;
221
- global?: boolean;
222
- dryRun?: boolean;
88
+ url: string;
89
+ builtin?: boolean;
90
+ disabled?: boolean;
223
91
  }
224
- /**
225
- * 检测给定名称的扩展类型。
226
- * 按顺序检查:skill > plugin > mcp(skills/ 目录优先)。
227
- */
228
- declare function detectUninstallTarget(name: string, options: UninstallOptions, mcpServers?: Record<string, unknown>): UninstallTarget | null;
229
- /**
230
- * 列出已安装的可卸载扩展(skill/plugin/mcp),支持按 scope 过滤。
231
- * 不传 scope 时合并 global + project 列表。
232
- *
233
- * @param options workspaceDir + scope 过滤
234
- * @param mcpServers 项目级 mcp_servers 配置(仅 project scope 时检查)
235
- */
236
- declare function listInstalledItems(options: ListInstalledOptions, mcpServers?: Record<string, unknown>): InstalledItem[];
237
- /**
238
- * 卸载已安装的扩展。
239
- *
240
- * @param name 扩展名称
241
- * @param type 扩展类型(由 detectUninstallTarget 提供)
242
- * @param options 卸载选项
243
- * @param getMcpServers 读取当前 mcp_servers 配置(仅 mcp 类型需要)
244
- * @param persistSettings 持久化 settings(仅 mcp 类型需要)
245
- */
246
- declare function uninstall(name: string, type: UninstallTarget, options: UninstallOptions, getMcpServers?: () => Record<string, unknown> | undefined, persistSettings?: (servers: Record<string, unknown>) => Promise<void>): Promise<UninstallResult>;
247
92
  //#endregion
248
- //#region src/upgrade-checker.d.ts
249
- interface VersionInfo {
250
- /** 扩展名称 */
251
- name: string;
252
- /** 扩展类型 */
253
- type: 'skill' | 'plugin';
254
- /** 已安装版本 */
255
- installed: string;
256
- /** 安装路径 */
257
- path: string;
258
- }
259
- interface UpgradeCheckResult {
260
- name: string;
261
- type: 'skill' | 'plugin';
262
- installed: string;
263
- /** npm 最新版本(仅 npm 来源有效) */
264
- latest?: string;
265
- /** 是否有更新 */
266
- newer?: boolean;
267
- /** 错误(无法检查时) */
268
- error?: string;
269
- }
270
- interface UpgradeCheckOptions {
271
- workspaceDir?: string;
272
- /** 仓库根目录(含 pnpm-workspace.yaml),用于 repository scope 扫描(RFC-130)。 */
273
- workspaceRoot?: string;
274
- /** 扫描范围:'all' | 'project' | 'repository' | 'global' */
275
- scope?: 'all' | 'project' | 'repository' | 'global';
276
- }
277
- /**
278
- * 扫描已安装的扩展,收集版本信息。
279
- * 仅扫描有 version 字段的 skill/plugin,MCP 不适用。
280
- */
281
- declare function scanInstalledVersions(options: UpgradeCheckOptions): VersionInfo[];
282
- /**
283
- * 对已安装扩展执行版本更新检查(通过 npm registry 或 git remote)。
284
- *
285
- * 路由依据(终局架构 review 2026-07-21):优先读安装时落盘的 `.otto-install.json`
286
- * 真实 `sourceType`(RFC-131),而非用包名字符串形状猜测来源——名称启发式对
287
- * "npm 包名恰好含 `.git`/`://`"等边缘场景会误判,且当来源元数据本就存在时完全
288
- * 没必要重新猜测。仅当 `.otto-install.json` 缺失(如 RFC-131 之前的旧安装、或
289
- * 手工放置的目录)才回退到 npm-first 的名称启发式(`isNpmPackageName`)。
290
- */
291
- declare function checkUpgrades(installed: VersionInfo[]): Promise<UpgradeCheckResult[]>;
292
- /** git 来源升级检查结果 */
293
- interface GitUpgradeCheckResult {
294
- name: string;
295
- type: 'skill' | 'plugin';
296
- sourceUrl: string;
297
- installedCommit: string;
298
- remoteCommit?: string;
299
- newer?: boolean;
300
- error?: string;
301
- }
302
- /**
303
- * 检查 git 来源 skill/plugin 是否有更新。
304
- * 扫描 baseDir 下所有子目录的 .otto-install.json → git ls-remote → 比较 hash。
305
- *
306
- * 异步化(终局 review 2026-08-14 P1-3):此前用 `spawnSync` 同步阻塞事件循环做
307
- * 网络 `git ls-remote`——N 个 git 来源项串行最长阻塞 N×10s,TUI 环境冻结整个界面。
308
- * 改为经包内共享 `spawnAsync`(与 git-resolver 同源),签名 `sync → async`。
309
- */
310
- declare function checkGitUpgrades(baseDir: string, type: 'skill' | 'plugin'): Promise<GitUpgradeCheckResult[]>;
93
+ //#region src/component.d.ts
94
+ interface OfficialRegistry {
95
+ source: RegistrySourceConfig;
96
+ capability: OfficialCapability;
97
+ }
98
+ declare function createOfficialRegistry(url?: string): OfficialRegistry;
99
+ interface InstallComponentOptions {
100
+ pluginInstallRoot: string;
101
+ official?: OfficialRegistry;
102
+ instance?: InstallStore;
103
+ stateDir?: string;
104
+ bundledSources?: readonly string[];
105
+ allowMonorepoLinks?: boolean;
106
+ workspaceRoots?: readonly string[];
107
+ dev?: DevExtensionPort;
108
+ uiPackageName?: string;
109
+ updateTimer?: boolean;
110
+ ottoVersion?: () => string | undefined;
111
+ requestRestart?: (targetVersion: string) => boolean;
112
+ uiVersion?: () => string | undefined;
113
+ onLockWait?: (notice: RootLockWaitNotice) => void;
114
+ env?: () => Readonly<Record<string, string | undefined>>;
115
+ }
116
+ declare const Install: _$_x_otto_universal0.ComponentDefinition<InstallComponentOptions>;
311
117
  //#endregion
312
- //#region src/archive-utils.d.ts
313
- /**
314
- * 解压归档到目标目录。
315
- * 异步执行(不阻塞事件循环),带 60s 超时。
316
- */
317
- declare function extractArchive(archivePath: string, extractDir: string): Promise<void>;
318
- /**
319
- * 打包目录为 `.tar.gz` 归档(RFC-219 M4:`otto migrate export` 复用)。
320
- *
321
- * 与 `extractArchive` 对称——同样走系统 `tar`(不引入 node tar 依赖),异步执行 + 60s 超时。
322
- * `sourceDir` 内的相对结构原样保留(`tar czf <out> -C <sourceDir> .`)。
323
- */
324
- declare function createArchive(sourceDir: string, outputPath: string): Promise<void>;
325
- /**
326
- * 验证解压后的所有文件都在 extractDir 内,防止路径穿越攻击。
327
- * 同时检查文件数量和总大小。
328
- *
329
- * 符号链接通过 realpathSync 解析真实路径后再做越界检查。
330
- *
331
- * @returns 解压后的总字节数(供归档炸弹检测使用)
332
- */
333
- declare function validateExtractedPaths(extractDir: string): {
334
- totalBytes: number;
118
+ //#region src/promote.d.ts
119
+ declare const PROMOTED_SOURCE_KIND = "promoted";
120
+ type PromotionRefusal = 'space-directory-missing' | 'manifest-unreadable' | 'version-missing' | 'version-invalid' | 'manifest-version-missing' | 'version-mismatch' | 'version-exists' | 'validation-failed' | 'placement-failed' | 'pointer-failed';
121
+ interface PromotionRequest {
122
+ installRoot: string;
123
+ spaceDirectory: string;
124
+ version?: string;
125
+ validate?: (stagingDirectory: string) => Promise<void>;
126
+ }
127
+ interface PromotionOutcome {
128
+ readonly id: string;
129
+ readonly version: string;
130
+ readonly directory: string;
131
+ readonly sourceKind: typeof PROMOTED_SOURCE_KIND;
132
+ readonly promotedFrom: string;
133
+ }
134
+ type PromotionResult = {
135
+ ok: true;
136
+ outcome: PromotionOutcome;
137
+ } | {
138
+ ok: false;
139
+ reason: PromotionRefusal;
140
+ detail?: string;
335
141
  };
336
- /**
337
- * 归档炸弹检测:比较归档文件压缩前/后的体积比。
338
- * 解压后总大小 / 归档文件大小 > MAX_COMPRESSION_RATIO → 拒绝。
339
- */
340
- declare function checkArchiveBomb(archivePath: string, totalExtractedBytes: number): void;
341
- declare function createTempDir(): string;
342
- declare function cleanTempDir(dir: string): void;
343
- /**
344
- * 剥离 URL 中的认证信息(user:password@),防止写入 .otto-install.json。
345
- * RFC-131 R8:覆盖 git 和 url 来源。
346
- */
347
- declare function sanitizeSourceUrl(raw: string): string;
348
- //#endregion
349
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/json-schema.d.cts
350
- type _JSONSchema = boolean | JSONSchema;
351
- type JSONSchema = {
352
- [k: string]: unknown;
353
- $schema?: "https://json-schema.org/draft/2020-12/schema" | "http://json-schema.org/draft-07/schema#" | "http://json-schema.org/draft-04/schema#";
354
- $id?: string;
355
- $anchor?: string;
356
- $ref?: string;
357
- $dynamicRef?: string;
358
- $dynamicAnchor?: string;
359
- $vocabulary?: Record<string, boolean>;
360
- $comment?: string;
361
- $defs?: Record<string, JSONSchema>;
362
- type?: "object" | "array" | "string" | "number" | "boolean" | "null" | "integer";
363
- additionalItems?: _JSONSchema;
364
- unevaluatedItems?: _JSONSchema;
365
- prefixItems?: _JSONSchema[];
366
- items?: _JSONSchema | _JSONSchema[];
367
- contains?: _JSONSchema;
368
- additionalProperties?: _JSONSchema;
369
- unevaluatedProperties?: _JSONSchema;
370
- properties?: Record<string, _JSONSchema>;
371
- patternProperties?: Record<string, _JSONSchema>;
372
- dependentSchemas?: Record<string, _JSONSchema>;
373
- propertyNames?: _JSONSchema;
374
- if?: _JSONSchema;
375
- then?: _JSONSchema;
376
- else?: _JSONSchema;
377
- allOf?: JSONSchema[];
378
- anyOf?: JSONSchema[];
379
- oneOf?: JSONSchema[];
380
- not?: _JSONSchema;
381
- multipleOf?: number;
382
- maximum?: number;
383
- exclusiveMaximum?: number | boolean;
384
- minimum?: number;
385
- exclusiveMinimum?: number | boolean;
386
- maxLength?: number;
387
- minLength?: number;
388
- pattern?: string;
389
- maxItems?: number;
390
- minItems?: number;
391
- uniqueItems?: boolean;
392
- maxContains?: number;
393
- minContains?: number;
394
- maxProperties?: number;
395
- minProperties?: number;
396
- required?: string[];
397
- dependentRequired?: Record<string, string[]>;
398
- enum?: Array<string | number | boolean | null>;
399
- const?: string | number | boolean | null;
400
- id?: string;
401
- title?: string;
402
- description?: string;
403
- default?: unknown;
404
- deprecated?: boolean;
405
- readOnly?: boolean;
406
- writeOnly?: boolean;
407
- nullable?: boolean;
408
- examples?: unknown[];
409
- format?: string;
410
- contentMediaType?: string;
411
- contentEncoding?: string;
412
- contentSchema?: JSONSchema;
413
- _prefault?: unknown;
142
+ declare function promotePlugin(request: PromotionRequest): Promise<PromotionResult>;
143
+ type RollbackRefusal = 'id-not-installed' | 'version-not-promoted' | 'already-current' | 'pointer-failed';
144
+ interface RollbackRequest {
145
+ installRoot: string;
146
+ id: string;
147
+ version: string;
148
+ affectedSpaces?: () => readonly string[] | Promise<readonly string[]>;
149
+ }
150
+ type RollbackResult = {
151
+ ok: true;
152
+ id: string;
153
+ version: string;
154
+ previous: string | undefined;
155
+ affectedSpaces: readonly string[];
156
+ } | {
157
+ ok: false;
158
+ reason: RollbackRefusal;
159
+ detail?: string;
414
160
  };
415
- type BaseSchema = JSONSchema;
161
+ declare function promotedVersionsOf(installRoot: string, id: string): Promise<string[]>;
162
+ declare function currentPromotedVersionOf(installRoot: string, id: string): Promise<string | undefined>;
163
+ declare function rollbackPromotion(request: RollbackRequest): Promise<RollbackResult>;
164
+ declare function recordPromotionOrigin(outcome: PromotionOutcome, installedAt: string): Promise<void>;
416
165
  //#endregion
417
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/standard-schema.d.cts
418
- /** The Standard interface. */
419
- interface StandardTypedV1<Input = unknown, Output = Input> {
420
- /** The Standard properties. */
421
- readonly "~standard": StandardTypedV1.Props<Input, Output>;
422
- }
423
- declare namespace StandardTypedV1 {
424
- /** The Standard properties interface. */
425
- interface Props<Input = unknown, Output = Input> {
426
- /** The version number of the standard. */
427
- readonly version: 1;
428
- /** The vendor name of the schema library. */
429
- readonly vendor: string;
430
- /** Inferred types associated with the schema. */
431
- readonly types?: Types<Input, Output> | undefined;
432
- }
433
- /** The Standard types interface. */
434
- interface Types<Input = unknown, Output = Input> {
435
- /** The input type of the schema. */
436
- readonly input: Input;
437
- /** The output type of the schema. */
438
- readonly output: Output;
439
- }
440
- /** Infers the input type of a Standard. */
441
- type InferInput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["input"];
442
- /** Infers the output type of a Standard. */
443
- type InferOutput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["output"];
444
- }
445
- /** The Standard Schema interface. */
446
- interface StandardSchemaV1<Input = unknown, Output = Input> {
447
- /** The Standard Schema properties. */
448
- readonly "~standard": StandardSchemaV1.Props<Input, Output>;
449
- }
450
- declare namespace StandardSchemaV1 {
451
- /** The Standard Schema properties interface. */
452
- interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
453
- /** Validates unknown input values. */
454
- readonly validate: (value: unknown, options?: StandardSchemaV1.Options | undefined) => Result<Output> | Promise<Result<Output>>;
455
- }
456
- /** The result interface of the validate function. */
457
- type Result<Output> = SuccessResult<Output> | FailureResult;
458
- /** The result interface if validation succeeds. */
459
- interface SuccessResult<Output> {
460
- /** The typed output value. */
461
- readonly value: Output;
462
- /** The absence of issues indicates success. */
463
- readonly issues?: undefined;
464
- }
465
- interface Options {
466
- /** Implicit support for additional vendor-specific parameters, if needed. */
467
- readonly libraryOptions?: Record<string, unknown> | undefined;
468
- }
469
- /** The result interface if validation fails. */
470
- interface FailureResult {
471
- /** The issues of failed validation. */
472
- readonly issues: ReadonlyArray<Issue>;
473
- }
474
- /** The issue interface of the failure output. */
475
- interface Issue {
476
- /** The error message of the issue. */
477
- readonly message: string;
478
- /** The path of the issue, if any. */
479
- readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
480
- }
481
- /** The path segment interface of the issue. */
482
- interface PathSegment {
483
- /** The key representing a path segment. */
484
- readonly key: PropertyKey;
485
- }
486
- /** The Standard types interface. */
487
- interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {}
488
- /** Infers the input type of a Standard. */
489
- type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
490
- /** Infers the output type of a Standard. */
491
- type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
492
- }
493
- /** The Standard JSON Schema interface. */
494
- interface StandardJSONSchemaV1<Input = unknown, Output = Input> {
495
- /** The Standard JSON Schema properties. */
496
- readonly "~standard": StandardJSONSchemaV1.Props<Input, Output>;
497
- }
498
- declare namespace StandardJSONSchemaV1 {
499
- /** The Standard JSON Schema properties interface. */
500
- interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
501
- /** Methods for generating the input/output JSON Schema. */
502
- readonly jsonSchema: Converter;
503
- }
504
- /** The Standard JSON Schema converter interface. */
505
- interface Converter {
506
- /** Converts the input type to JSON Schema. May throw if conversion is not supported. */
507
- readonly input: (options: StandardJSONSchemaV1.Options) => Record<string, unknown>;
508
- /** Converts the output type to JSON Schema. May throw if conversion is not supported. */
509
- readonly output: (options: StandardJSONSchemaV1.Options) => Record<string, unknown>;
510
- }
511
- /** The target version of the generated JSON Schema.
512
- *
513
- * It is *strongly recommended* that implementers support `"draft-2020-12"` and `"draft-07"`, as they are both in wide use.
514
- *
515
- * The `"openapi-3.0"` target is intended as a standardized specifier for OpenAPI 3.0 which is a superset of JSON Schema `"draft-04"`.
516
- *
517
- * All other targets can be implemented on a best-effort basis. Libraries should throw if they don't support a specified target.
518
- */
519
- type Target = "draft-2020-12" | "draft-07" | "openapi-3.0" | ({} & string);
520
- /** The options for the input/output methods. */
521
- interface Options {
522
- /** Specifies the target version of the generated JSON Schema. Support for all versions is on a best-effort basis. If a given version is not supported, the library should throw. */
523
- readonly target: Target;
524
- /** Implicit support for additional vendor-specific parameters, if needed. */
525
- readonly libraryOptions?: Record<string, unknown> | undefined;
526
- }
527
- /** The Standard types interface. */
528
- interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {}
529
- /** Infers the input type of a Standard. */
530
- type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
531
- /** Infers the output type of a Standard. */
532
- type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
533
- }
534
- interface StandardSchemaWithJSONProps<Input = unknown, Output = Input> extends StandardSchemaV1.Props<Input, Output>, StandardJSONSchemaV1.Props<Input, Output> {}
166
+ //#region src/commands/extension-lines.d.ts
167
+ declare function extensionLine(text: string, level?: CommandMessage['level']): CommandMessage;
535
168
  //#endregion
536
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/registries.d.cts
537
- declare const $output: unique symbol;
538
- type $output = typeof $output;
539
- declare const $input: unique symbol;
540
- type $input = typeof $input;
541
- type $replace<Meta, S extends $ZodType> = Meta extends $output ? output<S> : Meta extends $input ? input<S> : Meta extends (infer M)[] ? $replace<M, S>[] : Meta extends ((...args: infer P) => infer R) ? (...args: { [K in keyof P]: $replace<P[K], S> }) => $replace<R, S> : Meta extends object ? { [K in keyof Meta]: $replace<Meta[K], S> } : Meta;
542
- type MetadataType = object | undefined;
543
- declare class $ZodRegistry<Meta extends MetadataType = MetadataType, Schema extends $ZodType = $ZodType> {
544
- _meta: Meta;
545
- _schema: Schema;
546
- _map: WeakMap<Schema, $replace<Meta, Schema>>;
547
- _idmap: Map<string, Schema>;
548
- add<S extends Schema>(schema: S, ..._meta: undefined extends Meta ? [$replace<Meta, S>?] : [$replace<Meta, S>]): this;
549
- clear(): this;
550
- remove(schema: Schema): this;
551
- get<S extends Schema>(schema: S): $replace<Meta, S> | undefined;
552
- has(schema: Schema): boolean;
169
+ //#region src/manifest.d.ts
170
+ interface InstallOptions$1 extends InstallOptions {
171
+ readonly requestedBy?: 'user' | 'agent';
553
172
  }
554
- interface JSONSchemaMeta {
555
- id?: string | undefined;
556
- title?: string | undefined;
557
- description?: string | undefined;
558
- deprecated?: boolean | undefined;
559
- [k: string]: unknown;
560
- }
561
- interface GlobalMeta extends JSONSchemaMeta {}
562
173
  //#endregion
563
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/to-json-schema.d.cts
564
- type Processor<T extends $ZodType = $ZodType> = (schema: T, ctx: ToJSONSchemaContext, json: BaseSchema, params: ProcessParams) => void;
565
- interface JSONSchemaGeneratorParams {
566
- processors: Record<string, Processor>;
567
- /** A registry used to look up metadata for each schema. Any schema with an `id` property will be extracted as a $def.
568
- * @default globalRegistry */
569
- metadata?: $ZodRegistry<Record<string, any>>;
570
- /** The JSON Schema version to target.
571
- * - `"draft-2020-12"` — Default. JSON Schema Draft 2020-12
572
- * - `"draft-07"` — JSON Schema Draft 7
573
- * - `"draft-04"` — JSON Schema Draft 4
574
- * - `"openapi-3.0"` — OpenAPI 3.0 Schema Object */
575
- target?: "draft-04" | "draft-07" | "draft-2020-12" | "openapi-3.0" | ({} & string) | undefined;
576
- /** How to handle unrepresentable types.
577
- * - `"throw"` — Default. Unrepresentable types throw an error
578
- * - `"any"` — Unrepresentable types become `{}` */
579
- unrepresentable?: "throw" | "any";
580
- /** Arbitrary custom logic that can be used to modify the generated JSON Schema. */
581
- override?: (ctx: {
582
- zodSchema: $ZodTypes;
583
- jsonSchema: BaseSchema;
584
- path: (string | number)[];
585
- }) => void;
586
- /** Whether to extract the `"input"` or `"output"` type. Relevant to transforms, defaults, coerced primitives, etc.
587
- * - `"output"` — Default. Convert the output schema.
588
- * - `"input"` — Convert the input schema. */
589
- io?: "input" | "output";
590
- cycles?: "ref" | "throw";
591
- reused?: "ref" | "inline";
592
- external?: {
593
- registry: $ZodRegistry<{
594
- id?: string | undefined;
595
- }>;
596
- uri?: ((id: string) => string) | undefined;
597
- defs: Record<string, BaseSchema>;
598
- } | undefined;
599
- }
600
- /**
601
- * Parameters for the toJSONSchema function.
602
- */
603
- type ToJSONSchemaParams = Omit<JSONSchemaGeneratorParams, "processors" | "external">;
604
- interface ProcessParams {
605
- schemaPath: $ZodType[];
606
- path: (string | number)[];
607
- }
608
- interface Seen {
609
- /** JSON Schema result for this Zod schema */
610
- schema: BaseSchema;
611
- /** A cached version of the schema that doesn't get overwritten during ref resolution */
612
- def?: BaseSchema;
613
- defId?: string | undefined;
614
- /** Number of times this schema was encountered during traversal */
615
- count: number;
616
- /** Cycle path */
617
- cycle?: (string | number)[] | undefined;
618
- isParent?: boolean | undefined;
619
- /** Schema to inherit JSON Schema properties from (set by processor for wrappers) */
620
- ref?: $ZodType | null;
621
- /** JSON Schema property path for this schema */
622
- path?: (string | number)[] | undefined;
623
- }
624
- interface ToJSONSchemaContext {
625
- processors: Record<string, Processor>;
626
- metadataRegistry: $ZodRegistry<Record<string, any>>;
627
- target: "draft-04" | "draft-07" | "draft-2020-12" | "openapi-3.0" | ({} & string);
628
- unrepresentable: "throw" | "any";
629
- override: (ctx: {
630
- zodSchema: $ZodType;
631
- jsonSchema: BaseSchema;
632
- path: (string | number)[];
633
- }) => void;
634
- io: "input" | "output";
635
- counter: number;
636
- seen: Map<$ZodType, Seen>;
637
- cycles: "ref" | "throw";
638
- reused: "ref" | "inline";
639
- external?: {
640
- registry: $ZodRegistry<{
641
- id?: string | undefined;
642
- }>;
643
- uri?: ((id: string) => string) | undefined;
644
- defs: Record<string, BaseSchema>;
645
- } | undefined;
174
+ //#region src/ports.d.ts
175
+ interface InstallInteraction {
176
+ ask(req: HitlAskRequest, context?: InstallOperationContext): Promise<AskOutcome<HitlAnswer>>;
177
+ notify(req: InstallNotifyInput): void;
178
+ progress(req: InstallProgressInput): void;
179
+ }
180
+ type HitlSource = AskClient<HitlAskRequest, HitlAnswer> | (() => AskClient<HitlAskRequest, HitlAnswer> | undefined) | undefined;
181
+ type HookSource = HookRegistry | (() => HookRegistry | undefined) | undefined;
182
+ declare function createInstallInteraction(hitl?: HitlSource, hooks?: HookSource): InstallInteraction;
183
+ //#endregion
184
+ //#region src/resolvers/port.d.ts
185
+ interface ResolvedSource {
186
+ dir: string;
187
+ origin: {
188
+ sourceKind: string;
189
+ ref: string;
190
+ };
191
+ cleanup(): Promise<void>;
646
192
  }
647
- type ZodStandardSchemaWithJSON$1<T> = StandardSchemaWithJSONProps<input<T>, output<T>>;
648
- interface ZodStandardJSONSchemaPayload<T> extends BaseSchema {
649
- "~standard": ZodStandardSchemaWithJSON$1<T>;
193
+ interface SourceResolver {
194
+ kind: string;
195
+ match(ref: string): Promise<boolean> | boolean;
196
+ resolve(ref: string): Promise<ResolvedSource>;
650
197
  }
651
198
  //#endregion
652
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/util.d.cts
653
- type JWTAlgorithm = "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "EdDSA" | (string & {});
654
- type MimeTypes = "application/json" | "application/xml" | "application/x-www-form-urlencoded" | "application/javascript" | "application/pdf" | "application/zip" | "application/vnd.ms-excel" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/msword" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "application/vnd.ms-powerpoint" | "application/vnd.openxmlformats-officedocument.presentationml.presentation" | "application/octet-stream" | "application/graphql" | "text/html" | "text/plain" | "text/css" | "text/javascript" | "text/csv" | "image/png" | "image/jpeg" | "image/gif" | "image/svg+xml" | "image/webp" | "audio/mpeg" | "audio/ogg" | "audio/wav" | "audio/webm" | "video/mp4" | "video/webm" | "video/ogg" | "font/woff" | "font/woff2" | "font/ttf" | "font/otf" | "multipart/form-data" | (string & {});
655
- type IsAny<T> = 0 extends 1 & T ? true : false;
656
- type Omit$1<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
657
- type MakePartial<T, K extends keyof T> = Omit$1<T, K> & InexactPartial<Pick<T, K>>;
658
- type NoUndefined<T> = T extends undefined ? never : T;
659
- type LoosePartial<T extends object> = InexactPartial<T> & {
660
- [k: string]: unknown;
661
- };
662
- type Mask<Keys extends PropertyKey> = { [K in Keys]?: true };
663
- type InexactPartial<T> = { [P in keyof T]?: T[P] | undefined };
664
- type BuiltIn = (((...args: any[]) => any) | (new (...args: any[]) => any)) | {
665
- readonly [Symbol.toStringTag]: string;
666
- } | Date | Error | Generator | Promise<unknown> | RegExp;
667
- type MakeReadonly<T> = T extends Map<infer K, infer V> ? ReadonlyMap<K, V> : T extends Set<infer V> ? ReadonlySet<V> : T extends [infer Head, ...infer Tail] ? readonly [Head, ...Tail] : T extends Array<infer V> ? ReadonlyArray<V> : T extends BuiltIn ? T : Readonly<T>;
668
- type SomeObject = Record<PropertyKey, any>;
669
- type Identity<T> = T;
670
- type Flatten<T> = Identity<{ [k in keyof T]: T[k] }>;
671
- type Prettify<T> = { [K in keyof T]: T[K] } & {};
672
- type Extend<A extends SomeObject, B extends SomeObject> = Flatten<keyof A & keyof B extends never ? A & B : { [K in keyof A as K extends keyof B ? never : K]: A[K] } & { [K in keyof B]: B[K] }>;
673
- type TupleItems = ReadonlyArray<SomeType>;
674
- type AnyFunc = (...args: any[]) => any;
675
- type MaybeAsync<T> = T | Promise<T>;
676
- type EnumValue = string | number;
677
- type EnumLike = Readonly<Record<string, EnumValue>>;
678
- type ToEnum<T extends EnumValue> = Flatten<{ [k in T]: k }>;
679
- type Literal = string | number | bigint | boolean | null | undefined;
680
- type Primitive = string | number | symbol | bigint | boolean | null | undefined;
681
- type HasLength = {
682
- length: number;
683
- };
684
- type PropValues = Record<string, Set<Primitive>>;
685
- type PrimitiveSet = Set<Primitive>;
686
- type EmptyToNever<T> = keyof T extends never ? never : T;
687
- declare abstract class Class {
688
- constructor(..._args: any[]);
199
+ //#region src/workspace-probe.d.ts
200
+ interface WorkspaceProbe {
201
+ isInsideWorkTree(path: string): Promise<boolean | undefined>;
202
+ isIgnored(path: string): Promise<boolean | undefined>;
689
203
  }
690
204
  //#endregion
691
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/versions.d.cts
692
- declare const version: {
693
- readonly major: 4;
694
- readonly minor: 3;
695
- readonly patch: number;
205
+ //#region src/service.d.ts
206
+ interface UninstallOptions {
207
+ readonly force?: boolean;
208
+ }
209
+ type UninstallResultWithOrphan = {
210
+ ok: true;
211
+ id: string;
212
+ deferred?: readonly string[];
213
+ orphanCleaned?: boolean;
214
+ warnings?: readonly string[];
215
+ } | {
216
+ ok: false;
217
+ id: string;
218
+ kind: 'missing' | 'io';
219
+ error: string;
220
+ orphanCleaned?: false;
696
221
  };
222
+ interface InstallStoreWithOrphanUninstall extends Omit<InstallStore, 'uninstall' | 'install'> {
223
+ install(source: InstallSource, options?: InstallOptions$1): Promise<InstallResult>;
224
+ uninstall(id: string, options?: UninstallOptions): Promise<UninstallResultWithOrphan>;
225
+ trustStateDir?(): string | undefined;
226
+ installRoot?(): string;
227
+ }
228
+ interface InstallServiceConfig {
229
+ installRoot: string;
230
+ interaction: InstallInteraction;
231
+ resolvers?: readonly SourceResolver[];
232
+ officialCapability?: OfficialCapability;
233
+ stateDir?: string;
234
+ bundledSources?: readonly string[];
235
+ allowMonorepoLinks?: boolean;
236
+ workspaceRoots?: readonly string[];
237
+ workspaceProbe?: WorkspaceProbe;
238
+ extensionPermissions?: () => ExtensionPermissions | undefined;
239
+ env?: () => Readonly<Record<string, string | undefined>>;
240
+ npmRegistry?: () => string | undefined;
241
+ githubApi?: () => string | undefined;
242
+ onLockWait?: (notice: RootLockWaitNotice) => void;
243
+ }
244
+ declare function createInstallService(config: InstallServiceConfig): InstallStoreWithOrphanUninstall;
697
245
  //#endregion
698
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/schemas.d.cts
699
- interface ParseContext<T extends $ZodIssueBase = never> {
700
- /** Customize error messages. */
701
- readonly error?: $ZodErrorMap<T>;
702
- /** Include the `input` field in issue objects. Default `false`. */
703
- readonly reportInput?: boolean;
704
- /** Skip eval-based fast path. Default `false`. */
705
- readonly jitless?: boolean;
706
- }
707
- /** @internal */
708
- interface ParseContextInternal<T extends $ZodIssueBase = never> extends ParseContext<T> {
709
- readonly async?: boolean | undefined;
710
- readonly direction?: "forward" | "backward";
711
- readonly skipChecks?: boolean;
712
- }
713
- interface ParsePayload<T = unknown> {
714
- value: T;
715
- issues: $ZodRawIssue[];
716
- /** A may to mark a whole payload as aborted. Used in codecs/pipes. */
717
- aborted?: boolean;
718
- }
719
- type CheckFn<T> = (input: ParsePayload<T>) => MaybeAsync<void>;
720
- interface $ZodTypeDef {
721
- type: "string" | "number" | "int" | "boolean" | "bigint" | "symbol" | "null" | "undefined" | "void" | "never" | "any" | "unknown" | "date" | "object" | "record" | "file" | "array" | "tuple" | "union" | "intersection" | "map" | "set" | "enum" | "literal" | "nullable" | "optional" | "nonoptional" | "success" | "transform" | "default" | "prefault" | "catch" | "nan" | "pipe" | "readonly" | "template_literal" | "promise" | "lazy" | "function" | "custom";
722
- error?: $ZodErrorMap<never> | undefined;
723
- checks?: $ZodCheck<never>[];
724
- }
725
- interface _$ZodTypeInternals {
726
- /** The `@zod/core` version of this schema */
727
- version: typeof version;
728
- /** Schema definition. */
729
- def: $ZodTypeDef;
730
- /** @internal Randomly generated ID for this schema. */
731
- /** @internal List of deferred initializers. */
732
- deferred: AnyFunc[] | undefined;
733
- /** @internal Parses input and runs all checks (refinements). */
734
- run(payload: ParsePayload<any>, ctx: ParseContextInternal): MaybeAsync<ParsePayload>;
735
- /** @internal Parses input, doesn't run checks. */
736
- parse(payload: ParsePayload<any>, ctx: ParseContextInternal): MaybeAsync<ParsePayload>;
737
- /** @internal Stores identifiers for the set of traits implemented by this schema. */
738
- traits: Set<string>;
739
- /** @internal Indicates that a schema output type should be considered optional inside objects.
740
- * @default Required
741
- */
742
- /** @internal */
743
- optin?: "optional" | undefined;
744
- /** @internal */
745
- optout?: "optional" | undefined;
746
- /** @internal The set of literal values that will pass validation. Must be an exhaustive set. Used to determine optionality in z.record().
747
- *
748
- * Defined on: enum, const, literal, null, undefined
749
- * Passthrough: optional, nullable, branded, default, catch, pipe
750
- * Todo: unions?
751
- */
752
- values?: PrimitiveSet | undefined;
753
- /** Default value bubbled up from */
754
- /** @internal A set of literal discriminators used for the fast path in discriminated unions. */
755
- propValues?: PropValues | undefined;
756
- /** @internal This flag indicates that a schema validation can be represented with a regular expression. Used to determine allowable schemas in z.templateLiteral(). */
757
- pattern: RegExp | undefined;
758
- /** @internal The constructor function of this schema. */
759
- constr: new (def: any) => $ZodType;
760
- /** @internal A catchall object for bag metadata related to this schema. Commonly modified by checks using `onattach`. */
761
- bag: Record<string, unknown>;
762
- /** @internal The set of issues this schema might throw during type checking. */
763
- isst: $ZodIssueBase;
764
- /** @internal Subject to change, not a public API. */
765
- processJSONSchema?: ((ctx: ToJSONSchemaContext, json: BaseSchema, params: ProcessParams) => void) | undefined;
766
- /** An optional method used to override `toJSONSchema` logic. */
767
- toJSONSchema?: () => unknown;
768
- /** @internal The parent of this schema. Only set during certain clone operations. */
769
- parent?: $ZodType | undefined;
770
- }
771
- /** @internal */
772
- interface $ZodTypeInternals<out O = unknown, out I = unknown> extends _$ZodTypeInternals {
773
- /** @internal The inferred output type */
774
- output: O;
775
- /** @internal The inferred input type */
776
- input: I;
777
- }
778
- type $ZodStandardSchema<T> = StandardSchemaV1.Props<input<T>, output<T>>;
779
- type SomeType = {
780
- _zod: _$ZodTypeInternals;
781
- };
782
- interface $ZodType<O = unknown, I = unknown, Internals extends $ZodTypeInternals<O, I> = $ZodTypeInternals<O, I>> {
783
- _zod: Internals;
784
- "~standard": $ZodStandardSchema<this>;
785
- }
786
- interface _$ZodType<T extends $ZodTypeInternals = $ZodTypeInternals> extends $ZodType<T["output"], T["input"], T> {}
787
- declare const $ZodType: $constructor<$ZodType>;
788
- interface $ZodStringDef extends $ZodTypeDef {
789
- type: "string";
790
- coerce?: boolean;
791
- checks?: $ZodCheck<string>[];
792
- }
793
- interface $ZodStringInternals<Input> extends $ZodTypeInternals<string, Input> {
794
- def: $ZodStringDef;
795
- /** @deprecated Internal API, use with caution (not deprecated) */
796
- pattern: RegExp;
797
- /** @deprecated Internal API, use with caution (not deprecated) */
798
- isst: $ZodIssueInvalidType;
799
- bag: LoosePartial<{
800
- minimum: number;
801
- maximum: number;
802
- patterns: Set<RegExp>;
803
- format: string;
804
- contentEncoding: string;
805
- }>;
806
- }
807
- interface $ZodString<Input = unknown> extends _$ZodType<$ZodStringInternals<Input>> {}
808
- declare const $ZodString: $constructor<$ZodString>;
809
- interface $ZodStringFormatDef<Format extends string = string> extends $ZodStringDef, $ZodCheckStringFormatDef<Format> {}
810
- interface $ZodStringFormatInternals<Format extends string = string> extends $ZodStringInternals<string>, $ZodCheckStringFormatInternals {
811
- def: $ZodStringFormatDef<Format>;
812
- }
813
- interface $ZodStringFormat<Format extends string = string> extends $ZodType {
814
- _zod: $ZodStringFormatInternals<Format>;
815
- }
816
- declare const $ZodStringFormat: $constructor<$ZodStringFormat>;
817
- interface $ZodGUIDInternals extends $ZodStringFormatInternals<"guid"> {}
818
- interface $ZodGUID extends $ZodType {
819
- _zod: $ZodGUIDInternals;
820
- }
821
- declare const $ZodGUID: $constructor<$ZodGUID>;
822
- interface $ZodUUIDDef extends $ZodStringFormatDef<"uuid"> {
823
- version?: "v1" | "v2" | "v3" | "v4" | "v5" | "v6" | "v7" | "v8";
824
- }
825
- interface $ZodUUIDInternals extends $ZodStringFormatInternals<"uuid"> {
826
- def: $ZodUUIDDef;
827
- }
828
- interface $ZodUUID extends $ZodType {
829
- _zod: $ZodUUIDInternals;
830
- }
831
- declare const $ZodUUID: $constructor<$ZodUUID>;
832
- interface $ZodEmailInternals extends $ZodStringFormatInternals<"email"> {}
833
- interface $ZodEmail extends $ZodType {
834
- _zod: $ZodEmailInternals;
835
- }
836
- declare const $ZodEmail: $constructor<$ZodEmail>;
837
- interface $ZodURLDef extends $ZodStringFormatDef<"url"> {
838
- hostname?: RegExp | undefined;
839
- protocol?: RegExp | undefined;
840
- normalize?: boolean | undefined;
841
- }
842
- interface $ZodURLInternals extends $ZodStringFormatInternals<"url"> {
843
- def: $ZodURLDef;
844
- }
845
- interface $ZodURL extends $ZodType {
846
- _zod: $ZodURLInternals;
847
- }
848
- declare const $ZodURL: $constructor<$ZodURL>;
849
- interface $ZodEmojiInternals extends $ZodStringFormatInternals<"emoji"> {}
850
- interface $ZodEmoji extends $ZodType {
851
- _zod: $ZodEmojiInternals;
852
- }
853
- declare const $ZodEmoji: $constructor<$ZodEmoji>;
854
- interface $ZodNanoIDInternals extends $ZodStringFormatInternals<"nanoid"> {}
855
- interface $ZodNanoID extends $ZodType {
856
- _zod: $ZodNanoIDInternals;
857
- }
858
- declare const $ZodNanoID: $constructor<$ZodNanoID>;
859
- interface $ZodCUIDInternals extends $ZodStringFormatInternals<"cuid"> {}
860
- interface $ZodCUID extends $ZodType {
861
- _zod: $ZodCUIDInternals;
862
- }
863
- declare const $ZodCUID: $constructor<$ZodCUID>;
864
- interface $ZodCUID2Internals extends $ZodStringFormatInternals<"cuid2"> {}
865
- interface $ZodCUID2 extends $ZodType {
866
- _zod: $ZodCUID2Internals;
867
- }
868
- declare const $ZodCUID2: $constructor<$ZodCUID2>;
869
- interface $ZodULIDInternals extends $ZodStringFormatInternals<"ulid"> {}
870
- interface $ZodULID extends $ZodType {
871
- _zod: $ZodULIDInternals;
872
- }
873
- declare const $ZodULID: $constructor<$ZodULID>;
874
- interface $ZodXIDInternals extends $ZodStringFormatInternals<"xid"> {}
875
- interface $ZodXID extends $ZodType {
876
- _zod: $ZodXIDInternals;
877
- }
878
- declare const $ZodXID: $constructor<$ZodXID>;
879
- interface $ZodKSUIDInternals extends $ZodStringFormatInternals<"ksuid"> {}
880
- interface $ZodKSUID extends $ZodType {
881
- _zod: $ZodKSUIDInternals;
882
- }
883
- declare const $ZodKSUID: $constructor<$ZodKSUID>;
884
- interface $ZodISODateTimeDef extends $ZodStringFormatDef<"datetime"> {
885
- precision: number | null;
886
- offset: boolean;
887
- local: boolean;
888
- }
889
- interface $ZodISODateTimeInternals extends $ZodStringFormatInternals {
890
- def: $ZodISODateTimeDef;
891
- }
892
- interface $ZodISODateTime extends $ZodType {
893
- _zod: $ZodISODateTimeInternals;
894
- }
895
- declare const $ZodISODateTime: $constructor<$ZodISODateTime>;
896
- interface $ZodISODateInternals extends $ZodStringFormatInternals<"date"> {}
897
- interface $ZodISODate extends $ZodType {
898
- _zod: $ZodISODateInternals;
899
- }
900
- declare const $ZodISODate: $constructor<$ZodISODate>;
901
- interface $ZodISOTimeDef extends $ZodStringFormatDef<"time"> {
902
- precision?: number | null;
246
+ //#region src/lease-port.d.ts
247
+ declare const LEASE_WAIT_MS = 5000;
248
+ declare class InstallRetiringError extends Error {
249
+ readonly id: string;
250
+ readonly code = "install-retiring";
251
+ constructor(id: string);
903
252
  }
904
- interface $ZodISOTimeInternals extends $ZodStringFormatInternals<"time"> {
905
- def: $ZodISOTimeDef;
906
- }
907
- interface $ZodISOTime extends $ZodType {
908
- _zod: $ZodISOTimeInternals;
909
- }
910
- declare const $ZodISOTime: $constructor<$ZodISOTime>;
911
- interface $ZodISODurationInternals extends $ZodStringFormatInternals<"duration"> {}
912
- interface $ZodISODuration extends $ZodType {
913
- _zod: $ZodISODurationInternals;
914
- }
915
- declare const $ZodISODuration: $constructor<$ZodISODuration>;
916
- interface $ZodIPv4Def extends $ZodStringFormatDef<"ipv4"> {
917
- version?: "v4";
918
- }
919
- interface $ZodIPv4Internals extends $ZodStringFormatInternals<"ipv4"> {
920
- def: $ZodIPv4Def;
921
- }
922
- interface $ZodIPv4 extends $ZodType {
923
- _zod: $ZodIPv4Internals;
924
- }
925
- declare const $ZodIPv4: $constructor<$ZodIPv4>;
926
- interface $ZodIPv6Def extends $ZodStringFormatDef<"ipv6"> {
927
- version?: "v6";
928
- }
929
- interface $ZodIPv6Internals extends $ZodStringFormatInternals<"ipv6"> {
930
- def: $ZodIPv6Def;
931
- }
932
- interface $ZodIPv6 extends $ZodType {
933
- _zod: $ZodIPv6Internals;
934
- }
935
- declare const $ZodIPv6: $constructor<$ZodIPv6>;
936
- interface $ZodCIDRv4Def extends $ZodStringFormatDef<"cidrv4"> {
937
- version?: "v4";
938
- }
939
- interface $ZodCIDRv4Internals extends $ZodStringFormatInternals<"cidrv4"> {
940
- def: $ZodCIDRv4Def;
941
- }
942
- interface $ZodCIDRv4 extends $ZodType {
943
- _zod: $ZodCIDRv4Internals;
944
- }
945
- declare const $ZodCIDRv4: $constructor<$ZodCIDRv4>;
946
- interface $ZodCIDRv6Def extends $ZodStringFormatDef<"cidrv6"> {
947
- version?: "v6";
948
- }
949
- interface $ZodCIDRv6Internals extends $ZodStringFormatInternals<"cidrv6"> {
950
- def: $ZodCIDRv6Def;
951
- }
952
- interface $ZodCIDRv6 extends $ZodType {
953
- _zod: $ZodCIDRv6Internals;
954
- }
955
- declare const $ZodCIDRv6: $constructor<$ZodCIDRv6>;
956
- interface $ZodBase64Internals extends $ZodStringFormatInternals<"base64"> {}
957
- interface $ZodBase64 extends $ZodType {
958
- _zod: $ZodBase64Internals;
959
- }
960
- declare const $ZodBase64: $constructor<$ZodBase64>;
961
- interface $ZodBase64URLInternals extends $ZodStringFormatInternals<"base64url"> {}
962
- interface $ZodBase64URL extends $ZodType {
963
- _zod: $ZodBase64URLInternals;
964
- }
965
- declare const $ZodBase64URL: $constructor<$ZodBase64URL>;
966
- interface $ZodE164Internals extends $ZodStringFormatInternals<"e164"> {}
967
- interface $ZodE164 extends $ZodType {
968
- _zod: $ZodE164Internals;
969
- }
970
- declare const $ZodE164: $constructor<$ZodE164>;
971
- interface $ZodJWTDef extends $ZodStringFormatDef<"jwt"> {
972
- alg?: JWTAlgorithm | undefined;
973
- }
974
- interface $ZodJWTInternals extends $ZodStringFormatInternals<"jwt"> {
975
- def: $ZodJWTDef;
976
- }
977
- interface $ZodJWT extends $ZodType {
978
- _zod: $ZodJWTInternals;
979
- }
980
- declare const $ZodJWT: $constructor<$ZodJWT>;
981
- interface $ZodNumberDef extends $ZodTypeDef {
982
- type: "number";
983
- coerce?: boolean;
984
- }
985
- interface $ZodNumberInternals<Input = unknown> extends $ZodTypeInternals<number, Input> {
986
- def: $ZodNumberDef;
987
- /** @deprecated Internal API, use with caution (not deprecated) */
988
- pattern: RegExp;
989
- /** @deprecated Internal API, use with caution (not deprecated) */
990
- isst: $ZodIssueInvalidType;
991
- bag: LoosePartial<{
992
- minimum: number;
993
- maximum: number;
994
- exclusiveMinimum: number;
995
- exclusiveMaximum: number;
996
- format: string;
997
- pattern: RegExp;
998
- }>;
999
- }
1000
- interface $ZodNumber<Input = unknown> extends $ZodType {
1001
- _zod: $ZodNumberInternals<Input>;
1002
- }
1003
- declare const $ZodNumber: $constructor<$ZodNumber>;
1004
- interface $ZodBooleanDef extends $ZodTypeDef {
1005
- type: "boolean";
1006
- coerce?: boolean;
1007
- checks?: $ZodCheck<boolean>[];
1008
- }
1009
- interface $ZodBooleanInternals<T = unknown> extends $ZodTypeInternals<boolean, T> {
1010
- pattern: RegExp;
1011
- def: $ZodBooleanDef;
1012
- isst: $ZodIssueInvalidType;
1013
- }
1014
- interface $ZodBoolean<T = unknown> extends $ZodType {
1015
- _zod: $ZodBooleanInternals<T>;
1016
- }
1017
- declare const $ZodBoolean: $constructor<$ZodBoolean>;
1018
- interface $ZodBigIntDef extends $ZodTypeDef {
1019
- type: "bigint";
1020
- coerce?: boolean;
1021
- }
1022
- interface $ZodBigIntInternals<T = unknown> extends $ZodTypeInternals<bigint, T> {
1023
- pattern: RegExp;
1024
- /** @internal Internal API, use with caution */
1025
- def: $ZodBigIntDef;
1026
- isst: $ZodIssueInvalidType;
1027
- bag: LoosePartial<{
1028
- minimum: bigint;
1029
- maximum: bigint;
1030
- format: string;
1031
- }>;
1032
- }
1033
- interface $ZodBigInt<T = unknown> extends $ZodType {
1034
- _zod: $ZodBigIntInternals<T>;
1035
- }
1036
- declare const $ZodBigInt: $constructor<$ZodBigInt>;
1037
- interface $ZodSymbolDef extends $ZodTypeDef {
1038
- type: "symbol";
1039
- }
1040
- interface $ZodSymbolInternals extends $ZodTypeInternals<symbol, symbol> {
1041
- def: $ZodSymbolDef;
1042
- isst: $ZodIssueInvalidType;
1043
- }
1044
- interface $ZodSymbol extends $ZodType {
1045
- _zod: $ZodSymbolInternals;
1046
- }
1047
- declare const $ZodSymbol: $constructor<$ZodSymbol>;
1048
- interface $ZodUndefinedDef extends $ZodTypeDef {
1049
- type: "undefined";
1050
- }
1051
- interface $ZodUndefinedInternals extends $ZodTypeInternals<undefined, undefined> {
1052
- pattern: RegExp;
1053
- def: $ZodUndefinedDef;
1054
- values: PrimitiveSet;
1055
- isst: $ZodIssueInvalidType;
1056
- }
1057
- interface $ZodUndefined extends $ZodType {
1058
- _zod: $ZodUndefinedInternals;
1059
- }
1060
- declare const $ZodUndefined: $constructor<$ZodUndefined>;
1061
- interface $ZodNullDef extends $ZodTypeDef {
1062
- type: "null";
1063
- }
1064
- interface $ZodNullInternals extends $ZodTypeInternals<null, null> {
1065
- pattern: RegExp;
1066
- def: $ZodNullDef;
1067
- values: PrimitiveSet;
1068
- isst: $ZodIssueInvalidType;
1069
- }
1070
- interface $ZodNull extends $ZodType {
1071
- _zod: $ZodNullInternals;
1072
- }
1073
- declare const $ZodNull: $constructor<$ZodNull>;
1074
- interface $ZodAnyDef extends $ZodTypeDef {
1075
- type: "any";
1076
- }
1077
- interface $ZodAnyInternals extends $ZodTypeInternals<any, any> {
1078
- def: $ZodAnyDef;
1079
- isst: never;
1080
- }
1081
- interface $ZodAny extends $ZodType {
1082
- _zod: $ZodAnyInternals;
1083
- }
1084
- declare const $ZodAny: $constructor<$ZodAny>;
1085
- interface $ZodUnknownDef extends $ZodTypeDef {
1086
- type: "unknown";
1087
- }
1088
- interface $ZodUnknownInternals extends $ZodTypeInternals<unknown, unknown> {
1089
- def: $ZodUnknownDef;
1090
- isst: never;
1091
- }
1092
- interface $ZodUnknown extends $ZodType {
1093
- _zod: $ZodUnknownInternals;
1094
- }
1095
- declare const $ZodUnknown: $constructor<$ZodUnknown>;
1096
- interface $ZodNeverDef extends $ZodTypeDef {
1097
- type: "never";
1098
- }
1099
- interface $ZodNeverInternals extends $ZodTypeInternals<never, never> {
1100
- def: $ZodNeverDef;
1101
- isst: $ZodIssueInvalidType;
1102
- }
1103
- interface $ZodNever extends $ZodType {
1104
- _zod: $ZodNeverInternals;
1105
- }
1106
- declare const $ZodNever: $constructor<$ZodNever>;
1107
- interface $ZodVoidDef extends $ZodTypeDef {
1108
- type: "void";
1109
- }
1110
- interface $ZodVoidInternals extends $ZodTypeInternals<void, void> {
1111
- def: $ZodVoidDef;
1112
- isst: $ZodIssueInvalidType;
1113
- }
1114
- interface $ZodVoid extends $ZodType {
1115
- _zod: $ZodVoidInternals;
1116
- }
1117
- declare const $ZodVoid: $constructor<$ZodVoid>;
1118
- interface $ZodDateDef extends $ZodTypeDef {
1119
- type: "date";
1120
- coerce?: boolean;
1121
- }
1122
- interface $ZodDateInternals<T = unknown> extends $ZodTypeInternals<Date, T> {
1123
- def: $ZodDateDef;
1124
- isst: $ZodIssueInvalidType;
1125
- bag: LoosePartial<{
1126
- minimum: Date;
1127
- maximum: Date;
1128
- format: string;
1129
- }>;
1130
- }
1131
- interface $ZodDate<T = unknown> extends $ZodType {
1132
- _zod: $ZodDateInternals<T>;
1133
- }
1134
- declare const $ZodDate: $constructor<$ZodDate>;
1135
- interface $ZodArrayDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1136
- type: "array";
1137
- element: T;
1138
- }
1139
- interface $ZodArrayInternals<T extends SomeType = $ZodType> extends _$ZodTypeInternals {
1140
- def: $ZodArrayDef<T>;
1141
- isst: $ZodIssueInvalidType;
1142
- output: output<T>[];
1143
- input: input<T>[];
1144
- }
1145
- interface $ZodArray<T extends SomeType = $ZodType> extends $ZodType<any, any, $ZodArrayInternals<T>> {}
1146
- declare const $ZodArray: $constructor<$ZodArray>;
1147
- type OptionalOutSchema = {
1148
- _zod: {
1149
- optout: "optional";
1150
- };
1151
- };
1152
- type OptionalInSchema = {
1153
- _zod: {
1154
- optin: "optional";
1155
- };
1156
- };
1157
- type $InferObjectOutput<T extends $ZodLooseShape, Extra extends Record<string, unknown>> = string extends keyof T ? IsAny<T[keyof T]> extends true ? Record<string, unknown> : Record<string, output<T[keyof T]>> : keyof (T & Extra) extends never ? Record<string, never> : Prettify<{ -readonly [k in keyof T as T[k] extends OptionalOutSchema ? never : k]: T[k]["_zod"]["output"] } & { -readonly [k in keyof T as T[k] extends OptionalOutSchema ? k : never]?: T[k]["_zod"]["output"] } & Extra>;
1158
- type $InferObjectInput<T extends $ZodLooseShape, Extra extends Record<string, unknown>> = string extends keyof T ? IsAny<T[keyof T]> extends true ? Record<string, unknown> : Record<string, input<T[keyof T]>> : keyof (T & Extra) extends never ? Record<string, never> : Prettify<{ -readonly [k in keyof T as T[k] extends OptionalInSchema ? never : k]: T[k]["_zod"]["input"] } & { -readonly [k in keyof T as T[k] extends OptionalInSchema ? k : never]?: T[k]["_zod"]["input"] } & Extra>;
1159
- type $ZodObjectConfig = {
1160
- out: Record<string, unknown>;
1161
- in: Record<string, unknown>;
1162
- };
1163
- type $loose = {
1164
- out: Record<string, unknown>;
1165
- in: Record<string, unknown>;
1166
- };
1167
- type $strict = {
1168
- out: {};
1169
- in: {};
253
+ //#endregion
254
+ //#region src/plugin-manifest-read.d.ts
255
+ declare const PLUGIN_MANIFEST_BYTE_LIMIT: number;
256
+ declare function readPluginManifest(directory: string, context?: PluginValidationContext$1): Promise<PluginManifestRead$1>;
257
+ declare function readPluginManifestSync(directory: string, context?: PluginValidationContext$1): PluginManifestRead$1;
258
+ //#endregion
259
+ //#region src/trust.d.ts
260
+ interface ReconcileInput {
261
+ readonly trustedReason?: string;
262
+ readonly trustedCapabilitiesSnapshot?: readonly string[];
263
+ readonly currentCapabilities: readonly string[];
264
+ }
265
+ type ReconcileReason = 'reused' | 'capabilities-changed-low' | 'capabilities-expanded' | 'never-trusted';
266
+ interface TrustReconcileResult {
267
+ readonly ok: boolean;
268
+ readonly reason: ReconcileReason;
269
+ readonly addedCapabilities?: readonly string[];
270
+ readonly addedHighRiskCapabilities?: readonly string[];
271
+ }
272
+ declare function reconcileTrust(input: ReconcileInput): TrustReconcileResult;
273
+ //#endregion
274
+ //#region src/trust-ledger.d.ts
275
+ interface TrustLedgerRecord {
276
+ readonly id: string;
277
+ readonly trustedAt: string;
278
+ readonly trustedReason: 'local-workspace' | 'manual';
279
+ readonly trustedCapabilitiesSnapshot: readonly string[];
280
+ readonly trustedContentRevision?: string;
281
+ }
282
+ type TrustLedgerState = {
283
+ kind: 'missing';
284
+ } | {
285
+ kind: 'ok';
286
+ records: TrustLedgerRecord[];
287
+ } | {
288
+ kind: 'corrupt';
289
+ reason: string;
1170
290
  };
1171
- type $strip = {
1172
- out: {};
1173
- in: {};
291
+ type TrustLedgerReconcileRead = {
292
+ kind: 'ok';
293
+ records: readonly TrustLedgerRecord[];
294
+ } | {
295
+ kind: 'unavailable';
296
+ reason: string;
1174
297
  };
1175
- type $catchall<T extends SomeType> = {
1176
- out: {
1177
- [k: string]: output<T>;
1178
- };
1179
- in: {
1180
- [k: string]: input<T>;
1181
- };
1182
- };
1183
- type $ZodShape = Readonly<{
1184
- [k: string]: $ZodType;
1185
- }>;
1186
- interface $ZodObjectDef<Shape extends $ZodShape = $ZodShape> extends $ZodTypeDef {
1187
- type: "object";
1188
- shape: Shape;
1189
- catchall?: $ZodType | undefined;
1190
- }
1191
- interface $ZodObjectInternals< /** @ts-ignore Cast variance */out Shape extends $ZodShape = $ZodShape, out Config extends $ZodObjectConfig = $ZodObjectConfig> extends _$ZodTypeInternals {
1192
- def: $ZodObjectDef<Shape>;
1193
- config: Config;
1194
- isst: $ZodIssueInvalidType | $ZodIssueUnrecognizedKeys;
1195
- propValues: PropValues;
1196
- output: $InferObjectOutput<Shape, Config["out"]>;
1197
- input: $InferObjectInput<Shape, Config["in"]>;
1198
- optin?: "optional" | undefined;
1199
- optout?: "optional" | undefined;
1200
- }
1201
- type $ZodLooseShape = Record<string, any>;
1202
- interface $ZodObject< /** @ts-ignore Cast variance */out Shape extends Readonly<$ZodShape> = Readonly<$ZodShape>, out Params extends $ZodObjectConfig = $ZodObjectConfig> extends $ZodType<any, any, $ZodObjectInternals<Shape, Params>> {}
1203
- declare const $ZodObject: $constructor<$ZodObject>;
1204
- type $InferUnionOutput<T extends SomeType> = T extends any ? output<T> : never;
1205
- type $InferUnionInput<T extends SomeType> = T extends any ? input<T> : never;
1206
- interface $ZodUnionDef<Options extends readonly SomeType[] = readonly $ZodType[]> extends $ZodTypeDef {
1207
- type: "union";
1208
- options: Options;
1209
- inclusive?: boolean;
1210
- }
1211
- type IsOptionalIn<T extends SomeType> = T extends OptionalInSchema ? true : false;
1212
- type IsOptionalOut<T extends SomeType> = T extends OptionalOutSchema ? true : false;
1213
- interface $ZodUnionInternals<T extends readonly SomeType[] = readonly $ZodType[]> extends _$ZodTypeInternals {
1214
- def: $ZodUnionDef<T>;
1215
- isst: $ZodIssueInvalidUnion;
1216
- pattern: T[number]["_zod"]["pattern"];
1217
- values: T[number]["_zod"]["values"];
1218
- output: $InferUnionOutput<T[number]>;
1219
- input: $InferUnionInput<T[number]>;
1220
- optin: IsOptionalIn<T[number]> extends false ? "optional" | undefined : "optional";
1221
- optout: IsOptionalOut<T[number]> extends false ? "optional" | undefined : "optional";
1222
- }
1223
- interface $ZodUnion<T extends readonly SomeType[] = readonly $ZodType[]> extends $ZodType<any, any, $ZodUnionInternals<T>> {
1224
- _zod: $ZodUnionInternals<T>;
1225
- }
1226
- declare const $ZodUnion: $constructor<$ZodUnion>;
1227
- interface $ZodIntersectionDef<Left extends SomeType = $ZodType, Right extends SomeType = $ZodType> extends $ZodTypeDef {
1228
- type: "intersection";
1229
- left: Left;
1230
- right: Right;
1231
- }
1232
- interface $ZodIntersectionInternals<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends _$ZodTypeInternals {
1233
- def: $ZodIntersectionDef<A, B>;
1234
- isst: never;
1235
- optin: A["_zod"]["optin"] | B["_zod"]["optin"];
1236
- optout: A["_zod"]["optout"] | B["_zod"]["optout"];
1237
- output: output<A> & output<B>;
1238
- input: input<A> & input<B>;
1239
- }
1240
- interface $ZodIntersection<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends $ZodType {
1241
- _zod: $ZodIntersectionInternals<A, B>;
1242
- }
1243
- declare const $ZodIntersection: $constructor<$ZodIntersection>;
1244
- interface $ZodTupleDef<T extends TupleItems = readonly $ZodType[], Rest extends SomeType | null = $ZodType | null> extends $ZodTypeDef {
1245
- type: "tuple";
1246
- items: T;
1247
- rest: Rest;
1248
- }
1249
- type $InferTupleInputType<T extends TupleItems, Rest extends SomeType | null> = [...TupleInputTypeWithOptionals<T>, ...(Rest extends SomeType ? input<Rest>[] : [])];
1250
- type TupleInputTypeNoOptionals<T extends TupleItems> = { [k in keyof T]: input<T[k]> };
1251
- type TupleInputTypeWithOptionals<T extends TupleItems> = T extends readonly [...infer Prefix extends SomeType[], infer Tail extends SomeType] ? Tail["_zod"]["optin"] extends "optional" ? [...TupleInputTypeWithOptionals<Prefix>, input<Tail>?] : TupleInputTypeNoOptionals<T> : [];
1252
- type $InferTupleOutputType<T extends TupleItems, Rest extends SomeType | null> = [...TupleOutputTypeWithOptionals<T>, ...(Rest extends SomeType ? output<Rest>[] : [])];
1253
- type TupleOutputTypeNoOptionals<T extends TupleItems> = { [k in keyof T]: output<T[k]> };
1254
- type TupleOutputTypeWithOptionals<T extends TupleItems> = T extends readonly [...infer Prefix extends SomeType[], infer Tail extends SomeType] ? Tail["_zod"]["optout"] extends "optional" ? [...TupleOutputTypeWithOptionals<Prefix>, output<Tail>?] : TupleOutputTypeNoOptionals<T> : [];
1255
- interface $ZodTupleInternals<T extends TupleItems = readonly $ZodType[], Rest extends SomeType | null = $ZodType | null> extends _$ZodTypeInternals {
1256
- def: $ZodTupleDef<T, Rest>;
1257
- isst: $ZodIssueInvalidType | $ZodIssueTooBig<unknown[]> | $ZodIssueTooSmall<unknown[]>;
1258
- output: $InferTupleOutputType<T, Rest>;
1259
- input: $InferTupleInputType<T, Rest>;
1260
- }
1261
- interface $ZodTuple<T extends TupleItems = readonly $ZodType[], Rest extends SomeType | null = $ZodType | null> extends $ZodType {
1262
- _zod: $ZodTupleInternals<T, Rest>;
1263
- }
1264
- declare const $ZodTuple: $constructor<$ZodTuple>;
1265
- type $ZodRecordKey = $ZodType<string | number | symbol, unknown>;
1266
- interface $ZodRecordDef<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> extends $ZodTypeDef {
1267
- type: "record";
1268
- keyType: Key;
1269
- valueType: Value;
1270
- /** @default "strict" - errors on keys not matching keyType. "loose" passes through non-matching keys unchanged. */
1271
- mode?: "strict" | "loose";
1272
- }
1273
- type $InferZodRecordOutput<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> = Key extends $partial ? Partial<Record<output<Key>, output<Value>>> : Record<output<Key>, output<Value>>;
1274
- type $InferZodRecordInput<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> = Key extends $partial ? Partial<Record<input<Key> & PropertyKey, input<Value>>> : Record<input<Key> & PropertyKey, input<Value>>;
1275
- interface $ZodRecordInternals<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> extends $ZodTypeInternals<$InferZodRecordOutput<Key, Value>, $InferZodRecordInput<Key, Value>> {
1276
- def: $ZodRecordDef<Key, Value>;
1277
- isst: $ZodIssueInvalidType | $ZodIssueInvalidKey<Record<PropertyKey, unknown>>;
1278
- optin?: "optional" | undefined;
1279
- optout?: "optional" | undefined;
1280
- }
1281
- type $partial = {
1282
- "~~partial": true;
298
+ declare function readTrustLedgerState(stateDir: string): Promise<TrustLedgerState>;
299
+ declare function readTrustLedgerForReconcile(stateDir: string): Promise<TrustLedgerReconcileRead>;
300
+ declare function readTrustRecord(stateDir: string, id: string): Promise<TrustLedgerRecord | undefined>;
301
+ declare function readTrustLedger(stateDir: string): Promise<readonly TrustLedgerRecord[]>;
302
+ declare function writeTrustRecord(stateDir: string, record: TrustLedgerRecord): Promise<void>;
303
+ interface TrustLedgerGrantInput {
304
+ readonly id: string;
305
+ readonly trustedAt: string;
306
+ readonly reason: TrustLedgerRecord['trustedReason'];
307
+ readonly capabilities: readonly string[];
308
+ readonly contentRevision?: string;
309
+ }
310
+ type TrustLedgerGrantOutcome = {
311
+ kind: 'granted';
312
+ } | {
313
+ kind: 'kept-manual';
1283
314
  };
1284
- interface $ZodRecord<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> extends $ZodType {
1285
- _zod: $ZodRecordInternals<Key, Value>;
1286
- }
1287
- declare const $ZodRecord: $constructor<$ZodRecord>;
1288
- interface $ZodMapDef<Key extends SomeType = $ZodType, Value extends SomeType = $ZodType> extends $ZodTypeDef {
1289
- type: "map";
1290
- keyType: Key;
1291
- valueType: Value;
1292
- }
1293
- interface $ZodMapInternals<Key extends SomeType = $ZodType, Value extends SomeType = $ZodType> extends $ZodTypeInternals<Map<output<Key>, output<Value>>, Map<input<Key>, input<Value>>> {
1294
- def: $ZodMapDef<Key, Value>;
1295
- isst: $ZodIssueInvalidType | $ZodIssueInvalidKey | $ZodIssueInvalidElement<unknown>;
1296
- optin?: "optional" | undefined;
1297
- optout?: "optional" | undefined;
1298
- }
1299
- interface $ZodMap<Key extends SomeType = $ZodType, Value extends SomeType = $ZodType> extends $ZodType {
1300
- _zod: $ZodMapInternals<Key, Value>;
1301
- }
1302
- declare const $ZodMap: $constructor<$ZodMap>;
1303
- interface $ZodSetDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1304
- type: "set";
1305
- valueType: T;
1306
- }
1307
- interface $ZodSetInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<Set<output<T>>, Set<input<T>>> {
1308
- def: $ZodSetDef<T>;
1309
- isst: $ZodIssueInvalidType;
1310
- optin?: "optional" | undefined;
1311
- optout?: "optional" | undefined;
1312
- }
1313
- interface $ZodSet<T extends SomeType = $ZodType> extends $ZodType {
1314
- _zod: $ZodSetInternals<T>;
1315
- }
1316
- declare const $ZodSet: $constructor<$ZodSet>;
1317
- type $InferEnumOutput<T extends EnumLike> = T[keyof T] & {};
1318
- type $InferEnumInput<T extends EnumLike> = T[keyof T] & {};
1319
- interface $ZodEnumDef<T extends EnumLike = EnumLike> extends $ZodTypeDef {
1320
- type: "enum";
1321
- entries: T;
1322
- }
1323
- interface $ZodEnumInternals< /** @ts-ignore Cast variance */out T extends EnumLike = EnumLike> extends $ZodTypeInternals<$InferEnumOutput<T>, $InferEnumInput<T>> {
1324
- def: $ZodEnumDef<T>;
1325
- /** @deprecated Internal API, use with caution (not deprecated) */
1326
- values: PrimitiveSet;
1327
- /** @deprecated Internal API, use with caution (not deprecated) */
1328
- pattern: RegExp;
1329
- isst: $ZodIssueInvalidValue;
1330
- }
1331
- interface $ZodEnum<T extends EnumLike = EnumLike> extends $ZodType {
1332
- _zod: $ZodEnumInternals<T>;
1333
- }
1334
- declare const $ZodEnum: $constructor<$ZodEnum>;
1335
- interface $ZodLiteralDef<T extends Literal> extends $ZodTypeDef {
1336
- type: "literal";
1337
- values: T[];
1338
- }
1339
- interface $ZodLiteralInternals<T extends Literal = Literal> extends $ZodTypeInternals<T, T> {
1340
- def: $ZodLiteralDef<T>;
1341
- values: Set<T>;
1342
- pattern: RegExp;
1343
- isst: $ZodIssueInvalidValue;
1344
- }
1345
- interface $ZodLiteral<T extends Literal = Literal> extends $ZodType {
1346
- _zod: $ZodLiteralInternals<T>;
1347
- }
1348
- declare const $ZodLiteral: $constructor<$ZodLiteral>;
1349
- type _File = typeof globalThis extends {
1350
- File: infer F extends new (...args: any[]) => any;
1351
- } ? InstanceType<F> : {};
1352
- /** Do not reference this directly. */
1353
- interface File extends _File {
1354
- readonly type: string;
1355
- readonly size: number;
1356
- }
1357
- interface $ZodFileDef extends $ZodTypeDef {
1358
- type: "file";
1359
- }
1360
- interface $ZodFileInternals extends $ZodTypeInternals<File, File> {
1361
- def: $ZodFileDef;
1362
- isst: $ZodIssueInvalidType;
1363
- bag: LoosePartial<{
1364
- minimum: number;
1365
- maximum: number;
1366
- mime: MimeTypes[];
1367
- }>;
1368
- }
1369
- interface $ZodFile extends $ZodType {
1370
- _zod: $ZodFileInternals;
1371
- }
1372
- declare const $ZodFile: $constructor<$ZodFile>;
1373
- interface $ZodTransformDef extends $ZodTypeDef {
1374
- type: "transform";
1375
- transform: (input: unknown, payload: ParsePayload<unknown>) => MaybeAsync<unknown>;
1376
- }
1377
- interface $ZodTransformInternals<O = unknown, I = unknown> extends $ZodTypeInternals<O, I> {
1378
- def: $ZodTransformDef;
1379
- isst: never;
1380
- }
1381
- interface $ZodTransform<O = unknown, I = unknown> extends $ZodType {
1382
- _zod: $ZodTransformInternals<O, I>;
1383
- }
1384
- declare const $ZodTransform: $constructor<$ZodTransform>;
1385
- interface $ZodOptionalDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1386
- type: "optional";
1387
- innerType: T;
1388
- }
1389
- interface $ZodOptionalInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<output<T> | undefined, input<T> | undefined> {
1390
- def: $ZodOptionalDef<T>;
1391
- optin: "optional";
1392
- optout: "optional";
1393
- isst: never;
1394
- values: T["_zod"]["values"];
1395
- pattern: T["_zod"]["pattern"];
1396
- }
1397
- interface $ZodOptional<T extends SomeType = $ZodType> extends $ZodType {
1398
- _zod: $ZodOptionalInternals<T>;
1399
- }
1400
- declare const $ZodOptional: $constructor<$ZodOptional>;
1401
- interface $ZodExactOptionalDef<T extends SomeType = $ZodType> extends $ZodOptionalDef<T> {}
1402
- interface $ZodExactOptionalInternals<T extends SomeType = $ZodType> extends $ZodOptionalInternals<T> {
1403
- def: $ZodExactOptionalDef<T>;
1404
- output: output<T>;
1405
- input: input<T>;
1406
- }
1407
- interface $ZodExactOptional<T extends SomeType = $ZodType> extends $ZodType {
1408
- _zod: $ZodExactOptionalInternals<T>;
1409
- }
1410
- declare const $ZodExactOptional: $constructor<$ZodExactOptional>;
1411
- interface $ZodNullableDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1412
- type: "nullable";
1413
- innerType: T;
1414
- }
1415
- interface $ZodNullableInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<output<T> | null, input<T> | null> {
1416
- def: $ZodNullableDef<T>;
1417
- optin: T["_zod"]["optin"];
1418
- optout: T["_zod"]["optout"];
1419
- isst: never;
1420
- values: T["_zod"]["values"];
1421
- pattern: T["_zod"]["pattern"];
1422
- }
1423
- interface $ZodNullable<T extends SomeType = $ZodType> extends $ZodType {
1424
- _zod: $ZodNullableInternals<T>;
1425
- }
1426
- declare const $ZodNullable: $constructor<$ZodNullable>;
1427
- interface $ZodDefaultDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1428
- type: "default";
1429
- innerType: T;
1430
- /** The default value. May be a getter. */
1431
- defaultValue: NoUndefined<output<T>>;
1432
- }
1433
- interface $ZodDefaultInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<NoUndefined<output<T>>, input<T> | undefined> {
1434
- def: $ZodDefaultDef<T>;
1435
- optin: "optional";
1436
- optout?: "optional" | undefined;
1437
- isst: never;
1438
- values: T["_zod"]["values"];
1439
- }
1440
- interface $ZodDefault<T extends SomeType = $ZodType> extends $ZodType {
1441
- _zod: $ZodDefaultInternals<T>;
1442
- }
1443
- declare const $ZodDefault: $constructor<$ZodDefault>;
1444
- interface $ZodPrefaultDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1445
- type: "prefault";
1446
- innerType: T;
1447
- /** The default value. May be a getter. */
1448
- defaultValue: input<T>;
1449
- }
1450
- interface $ZodPrefaultInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<NoUndefined<output<T>>, input<T> | undefined> {
1451
- def: $ZodPrefaultDef<T>;
1452
- optin: "optional";
1453
- optout?: "optional" | undefined;
1454
- isst: never;
1455
- values: T["_zod"]["values"];
1456
- }
1457
- interface $ZodPrefault<T extends SomeType = $ZodType> extends $ZodType {
1458
- _zod: $ZodPrefaultInternals<T>;
1459
- }
1460
- declare const $ZodPrefault: $constructor<$ZodPrefault>;
1461
- interface $ZodNonOptionalDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1462
- type: "nonoptional";
1463
- innerType: T;
1464
- }
1465
- interface $ZodNonOptionalInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<NoUndefined<output<T>>, NoUndefined<input<T>>> {
1466
- def: $ZodNonOptionalDef<T>;
1467
- isst: $ZodIssueInvalidType;
1468
- values: T["_zod"]["values"];
1469
- optin: "optional" | undefined;
1470
- optout: "optional" | undefined;
1471
- }
1472
- interface $ZodNonOptional<T extends SomeType = $ZodType> extends $ZodType {
1473
- _zod: $ZodNonOptionalInternals<T>;
1474
- }
1475
- declare const $ZodNonOptional: $constructor<$ZodNonOptional>;
1476
- interface $ZodSuccessDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1477
- type: "success";
1478
- innerType: T;
1479
- }
1480
- interface $ZodSuccessInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<boolean, input<T>> {
1481
- def: $ZodSuccessDef<T>;
1482
- isst: never;
1483
- optin: T["_zod"]["optin"];
1484
- optout: "optional" | undefined;
1485
- }
1486
- interface $ZodSuccess<T extends SomeType = $ZodType> extends $ZodType {
1487
- _zod: $ZodSuccessInternals<T>;
1488
- }
1489
- declare const $ZodSuccess: $constructor<$ZodSuccess>;
1490
- interface $ZodCatchCtx extends ParsePayload {
1491
- /** @deprecated Use `ctx.issues` */
1492
- error: {
1493
- issues: $ZodIssue[];
1494
- };
1495
- /** @deprecated Use `ctx.value` */
1496
- input: unknown;
315
+ interface TrustLedger {
316
+ read(id: string): Promise<TrustLedgerRecord | undefined>;
317
+ reconcile(id: string, currentCapabilities: readonly string[]): Promise<TrustReconcileResult>;
318
+ grant(input: TrustLedgerGrantInput): Promise<TrustLedgerGrantOutcome>;
319
+ revoke(id: string): Promise<void>;
1497
320
  }
1498
- interface $ZodCatchDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1499
- type: "catch";
1500
- innerType: T;
1501
- catchValue: (ctx: $ZodCatchCtx) => unknown;
1502
- }
1503
- interface $ZodCatchInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<output<T>, input<T>> {
1504
- def: $ZodCatchDef<T>;
1505
- optin: T["_zod"]["optin"];
1506
- optout: T["_zod"]["optout"];
1507
- isst: never;
1508
- values: T["_zod"]["values"];
1509
- }
1510
- interface $ZodCatch<T extends SomeType = $ZodType> extends $ZodType {
1511
- _zod: $ZodCatchInternals<T>;
1512
- }
1513
- declare const $ZodCatch: $constructor<$ZodCatch>;
1514
- interface $ZodNaNDef extends $ZodTypeDef {
1515
- type: "nan";
1516
- }
1517
- interface $ZodNaNInternals extends $ZodTypeInternals<number, number> {
1518
- def: $ZodNaNDef;
1519
- isst: $ZodIssueInvalidType;
1520
- }
1521
- interface $ZodNaN extends $ZodType {
1522
- _zod: $ZodNaNInternals;
1523
- }
1524
- declare const $ZodNaN: $constructor<$ZodNaN>;
1525
- interface $ZodPipeDef<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends $ZodTypeDef {
1526
- type: "pipe";
1527
- in: A;
1528
- out: B;
1529
- /** Only defined inside $ZodCodec instances. */
1530
- transform?: (value: output<A>, payload: ParsePayload<output<A>>) => MaybeAsync<input<B>>;
1531
- /** Only defined inside $ZodCodec instances. */
1532
- reverseTransform?: (value: input<B>, payload: ParsePayload<input<B>>) => MaybeAsync<output<A>>;
1533
- }
1534
- interface $ZodPipeInternals<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends $ZodTypeInternals<output<B>, input<A>> {
1535
- def: $ZodPipeDef<A, B>;
1536
- isst: never;
1537
- values: A["_zod"]["values"];
1538
- optin: A["_zod"]["optin"];
1539
- optout: B["_zod"]["optout"];
1540
- propValues: A["_zod"]["propValues"];
1541
- }
1542
- interface $ZodPipe<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends $ZodType {
1543
- _zod: $ZodPipeInternals<A, B>;
1544
- }
1545
- declare const $ZodPipe: $constructor<$ZodPipe>;
1546
- interface $ZodReadonlyDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1547
- type: "readonly";
1548
- innerType: T;
1549
- }
1550
- interface $ZodReadonlyInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<MakeReadonly<output<T>>, MakeReadonly<input<T>>> {
1551
- def: $ZodReadonlyDef<T>;
1552
- optin: T["_zod"]["optin"];
1553
- optout: T["_zod"]["optout"];
1554
- isst: never;
1555
- propValues: T["_zod"]["propValues"];
1556
- values: T["_zod"]["values"];
1557
- }
1558
- interface $ZodReadonly<T extends SomeType = $ZodType> extends $ZodType {
1559
- _zod: $ZodReadonlyInternals<T>;
1560
- }
1561
- declare const $ZodReadonly: $constructor<$ZodReadonly>;
1562
- interface $ZodTemplateLiteralDef extends $ZodTypeDef {
1563
- type: "template_literal";
1564
- parts: $ZodTemplateLiteralPart[];
1565
- format?: string | undefined;
1566
- }
1567
- interface $ZodTemplateLiteralInternals<Template extends string = string> extends $ZodTypeInternals<Template, Template> {
1568
- pattern: RegExp;
1569
- def: $ZodTemplateLiteralDef;
1570
- isst: $ZodIssueInvalidType;
1571
- }
1572
- interface $ZodTemplateLiteral<Template extends string = string> extends $ZodType {
1573
- _zod: $ZodTemplateLiteralInternals<Template>;
1574
- }
1575
- type LiteralPart = Exclude<Literal, symbol>;
1576
- interface SchemaPartInternals extends $ZodTypeInternals<LiteralPart, LiteralPart> {
1577
- pattern: RegExp;
1578
- }
1579
- interface SchemaPart extends $ZodType {
1580
- _zod: SchemaPartInternals;
1581
- }
1582
- type $ZodTemplateLiteralPart = LiteralPart | SchemaPart;
1583
- declare const $ZodTemplateLiteral: $constructor<$ZodTemplateLiteral>;
1584
- type $ZodFunctionArgs = $ZodType<unknown[], unknown[]>;
1585
- type $ZodFunctionIn = $ZodFunctionArgs;
1586
- type $ZodFunctionOut = $ZodType;
1587
- type $InferInnerFunctionType<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : output<Args>) => input<Returns>;
1588
- type $InferInnerFunctionTypeAsync<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : output<Args>) => MaybeAsync<input<Returns>>;
1589
- type $InferOuterFunctionType<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : input<Args>) => output<Returns>;
1590
- type $InferOuterFunctionTypeAsync<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : input<Args>) => Promise<output<Returns>>;
1591
- interface $ZodFunctionDef<In extends $ZodFunctionIn = $ZodFunctionIn, Out extends $ZodFunctionOut = $ZodFunctionOut> extends $ZodTypeDef {
1592
- type: "function";
1593
- input: In;
1594
- output: Out;
1595
- }
1596
- interface $ZodFunctionInternals<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> extends $ZodTypeInternals<$InferOuterFunctionType<Args, Returns>, $InferInnerFunctionType<Args, Returns>> {
1597
- def: $ZodFunctionDef<Args, Returns>;
1598
- isst: $ZodIssueInvalidType;
1599
- }
1600
- interface $ZodFunction<Args extends $ZodFunctionIn = $ZodFunctionIn, Returns extends $ZodFunctionOut = $ZodFunctionOut> extends $ZodType<any, any, $ZodFunctionInternals<Args, Returns>> {
1601
- /** @deprecated */
1602
- _def: $ZodFunctionDef<Args, Returns>;
1603
- _input: $InferInnerFunctionType<Args, Returns>;
1604
- _output: $InferOuterFunctionType<Args, Returns>;
1605
- implement<F extends $InferInnerFunctionType<Args, Returns>>(func: F): (...args: Parameters<this["_output"]>) => ReturnType<F> extends ReturnType<this["_output"]> ? ReturnType<F> : ReturnType<this["_output"]>;
1606
- implementAsync<F extends $InferInnerFunctionTypeAsync<Args, Returns>>(func: F): F extends $InferOuterFunctionTypeAsync<Args, Returns> ? F : $InferOuterFunctionTypeAsync<Args, Returns>;
1607
- input<const Items extends TupleItems, const Rest extends $ZodFunctionOut = $ZodFunctionOut>(args: Items, rest?: Rest): $ZodFunction<$ZodTuple<Items, Rest>, Returns>;
1608
- input<NewArgs extends $ZodFunctionIn>(args: NewArgs): $ZodFunction<NewArgs, Returns>;
1609
- input(...args: any[]): $ZodFunction<any, Returns>;
1610
- output<NewReturns extends $ZodType>(output: NewReturns): $ZodFunction<Args, NewReturns>;
1611
- }
1612
- declare const $ZodFunction: $constructor<$ZodFunction>;
1613
- interface $ZodPromiseDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1614
- type: "promise";
1615
- innerType: T;
1616
- }
1617
- interface $ZodPromiseInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<Promise<output<T>>, MaybeAsync<input<T>>> {
1618
- def: $ZodPromiseDef<T>;
1619
- isst: never;
1620
- }
1621
- interface $ZodPromise<T extends SomeType = $ZodType> extends $ZodType {
1622
- _zod: $ZodPromiseInternals<T>;
1623
- }
1624
- declare const $ZodPromise: $constructor<$ZodPromise>;
1625
- interface $ZodLazyDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1626
- type: "lazy";
1627
- getter: () => T;
1628
- }
1629
- interface $ZodLazyInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<output<T>, input<T>> {
1630
- def: $ZodLazyDef<T>;
1631
- isst: never;
1632
- /** Auto-cached way to retrieve the inner schema */
1633
- innerType: T;
1634
- pattern: T["_zod"]["pattern"];
1635
- propValues: T["_zod"]["propValues"];
1636
- optin: T["_zod"]["optin"];
1637
- optout: T["_zod"]["optout"];
1638
- }
1639
- interface $ZodLazy<T extends SomeType = $ZodType> extends $ZodType {
1640
- _zod: $ZodLazyInternals<T>;
1641
- }
1642
- declare const $ZodLazy: $constructor<$ZodLazy>;
1643
- interface $ZodCustomDef<O = unknown> extends $ZodTypeDef, $ZodCheckDef {
1644
- type: "custom";
1645
- check: "custom";
1646
- path?: PropertyKey[] | undefined;
1647
- error?: $ZodErrorMap | undefined;
1648
- params?: Record<string, any> | undefined;
1649
- fn: (arg: O) => unknown;
1650
- }
1651
- interface $ZodCustomInternals<O = unknown, I = unknown> extends $ZodTypeInternals<O, I>, $ZodCheckInternals<O> {
1652
- def: $ZodCustomDef;
1653
- issc: $ZodIssue;
1654
- isst: never;
1655
- bag: LoosePartial<{
1656
- Class: typeof Class;
1657
- }>;
1658
- }
1659
- interface $ZodCustom<O = unknown, I = unknown> extends $ZodType {
1660
- _zod: $ZodCustomInternals<O, I>;
1661
- }
1662
- declare const $ZodCustom: $constructor<$ZodCustom>;
1663
- type $ZodTypes = $ZodString | $ZodNumber | $ZodBigInt | $ZodBoolean | $ZodDate | $ZodSymbol | $ZodUndefined | $ZodNullable | $ZodNull | $ZodAny | $ZodUnknown | $ZodNever | $ZodVoid | $ZodArray | $ZodObject | $ZodUnion | $ZodIntersection | $ZodTuple | $ZodRecord | $ZodMap | $ZodSet | $ZodLiteral | $ZodEnum | $ZodFunction | $ZodPromise | $ZodLazy | $ZodOptional | $ZodDefault | $ZodPrefault | $ZodTemplateLiteral | $ZodCustom | $ZodTransform | $ZodNonOptional | $ZodReadonly | $ZodNaN | $ZodPipe | $ZodSuccess | $ZodCatch | $ZodFile;
321
+ declare function createTrustLedger(stateDir: string): TrustLedger;
1664
322
  //#endregion
1665
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/checks.d.cts
1666
- interface $ZodCheckDef {
1667
- check: string;
1668
- error?: $ZodErrorMap<never> | undefined;
1669
- /** If true, no later checks will be executed if this check fails. Default `false`. */
1670
- abort?: boolean | undefined;
1671
- /** If provided, this check will only be executed if the function returns `true`. Defaults to `payload => z.util.isAborted(payload)`. */
1672
- when?: ((payload: ParsePayload) => boolean) | undefined;
1673
- }
1674
- interface $ZodCheckInternals<T> {
1675
- def: $ZodCheckDef;
1676
- /** The set of issues this check might throw. */
1677
- issc?: $ZodIssueBase;
1678
- check(payload: ParsePayload<T>): MaybeAsync<void>;
1679
- onattach: ((schema: $ZodType) => void)[];
1680
- }
1681
- interface $ZodCheck<in T = never> {
1682
- _zod: $ZodCheckInternals<T>;
1683
- }
1684
- declare const $ZodCheck: $constructor<$ZodCheck<any>>;
1685
- interface $ZodCheckMaxLengthDef extends $ZodCheckDef {
1686
- check: "max_length";
1687
- maximum: number;
1688
- }
1689
- interface $ZodCheckMaxLengthInternals<T extends HasLength = HasLength> extends $ZodCheckInternals<T> {
1690
- def: $ZodCheckMaxLengthDef;
1691
- issc: $ZodIssueTooBig<T>;
1692
- }
1693
- interface $ZodCheckMaxLength<T extends HasLength = HasLength> extends $ZodCheck<T> {
1694
- _zod: $ZodCheckMaxLengthInternals<T>;
1695
- }
1696
- declare const $ZodCheckMaxLength: $constructor<$ZodCheckMaxLength>;
1697
- interface $ZodCheckMinLengthDef extends $ZodCheckDef {
1698
- check: "min_length";
1699
- minimum: number;
1700
- }
1701
- interface $ZodCheckMinLengthInternals<T extends HasLength = HasLength> extends $ZodCheckInternals<T> {
1702
- def: $ZodCheckMinLengthDef;
1703
- issc: $ZodIssueTooSmall<T>;
1704
- }
1705
- interface $ZodCheckMinLength<T extends HasLength = HasLength> extends $ZodCheck<T> {
1706
- _zod: $ZodCheckMinLengthInternals<T>;
1707
- }
1708
- declare const $ZodCheckMinLength: $constructor<$ZodCheckMinLength>;
1709
- interface $ZodCheckLengthEqualsDef extends $ZodCheckDef {
1710
- check: "length_equals";
1711
- length: number;
1712
- }
1713
- interface $ZodCheckLengthEqualsInternals<T extends HasLength = HasLength> extends $ZodCheckInternals<T> {
1714
- def: $ZodCheckLengthEqualsDef;
1715
- issc: $ZodIssueTooBig<T> | $ZodIssueTooSmall<T>;
1716
- }
1717
- interface $ZodCheckLengthEquals<T extends HasLength = HasLength> extends $ZodCheck<T> {
1718
- _zod: $ZodCheckLengthEqualsInternals<T>;
1719
- }
1720
- declare const $ZodCheckLengthEquals: $constructor<$ZodCheckLengthEquals>;
1721
- type $ZodStringFormats = "email" | "url" | "emoji" | "uuid" | "guid" | "nanoid" | "cuid" | "cuid2" | "ulid" | "xid" | "ksuid" | "datetime" | "date" | "time" | "duration" | "ipv4" | "ipv6" | "cidrv4" | "cidrv6" | "base64" | "base64url" | "json_string" | "e164" | "lowercase" | "uppercase" | "regex" | "jwt" | "starts_with" | "ends_with" | "includes";
1722
- interface $ZodCheckStringFormatDef<Format extends string = string> extends $ZodCheckDef {
1723
- check: "string_format";
1724
- format: Format;
1725
- pattern?: RegExp | undefined;
1726
- }
1727
- interface $ZodCheckStringFormatInternals extends $ZodCheckInternals<string> {
1728
- def: $ZodCheckStringFormatDef;
1729
- issc: $ZodIssueInvalidStringFormat;
1730
- }
1731
- interface $ZodCheckRegexDef extends $ZodCheckStringFormatDef {
1732
- format: "regex";
1733
- pattern: RegExp;
1734
- }
1735
- interface $ZodCheckRegexInternals extends $ZodCheckInternals<string> {
1736
- def: $ZodCheckRegexDef;
1737
- issc: $ZodIssueInvalidStringFormat;
1738
- }
1739
- interface $ZodCheckRegex extends $ZodCheck<string> {
1740
- _zod: $ZodCheckRegexInternals;
1741
- }
1742
- declare const $ZodCheckRegex: $constructor<$ZodCheckRegex>;
1743
- interface $ZodCheckLowerCaseDef extends $ZodCheckStringFormatDef<"lowercase"> {}
1744
- interface $ZodCheckLowerCaseInternals extends $ZodCheckInternals<string> {
1745
- def: $ZodCheckLowerCaseDef;
1746
- issc: $ZodIssueInvalidStringFormat;
1747
- }
1748
- interface $ZodCheckLowerCase extends $ZodCheck<string> {
1749
- _zod: $ZodCheckLowerCaseInternals;
1750
- }
1751
- declare const $ZodCheckLowerCase: $constructor<$ZodCheckLowerCase>;
1752
- interface $ZodCheckUpperCaseDef extends $ZodCheckStringFormatDef<"uppercase"> {}
1753
- interface $ZodCheckUpperCaseInternals extends $ZodCheckInternals<string> {
1754
- def: $ZodCheckUpperCaseDef;
1755
- issc: $ZodIssueInvalidStringFormat;
1756
- }
1757
- interface $ZodCheckUpperCase extends $ZodCheck<string> {
1758
- _zod: $ZodCheckUpperCaseInternals;
1759
- }
1760
- declare const $ZodCheckUpperCase: $constructor<$ZodCheckUpperCase>;
1761
- interface $ZodCheckIncludesDef extends $ZodCheckStringFormatDef<"includes"> {
1762
- includes: string;
1763
- position?: number | undefined;
1764
- }
1765
- interface $ZodCheckIncludesInternals extends $ZodCheckInternals<string> {
1766
- def: $ZodCheckIncludesDef;
1767
- issc: $ZodIssueInvalidStringFormat;
1768
- }
1769
- interface $ZodCheckIncludes extends $ZodCheck<string> {
1770
- _zod: $ZodCheckIncludesInternals;
1771
- }
1772
- declare const $ZodCheckIncludes: $constructor<$ZodCheckIncludes>;
1773
- interface $ZodCheckStartsWithDef extends $ZodCheckStringFormatDef<"starts_with"> {
1774
- prefix: string;
1775
- }
1776
- interface $ZodCheckStartsWithInternals extends $ZodCheckInternals<string> {
1777
- def: $ZodCheckStartsWithDef;
1778
- issc: $ZodIssueInvalidStringFormat;
1779
- }
1780
- interface $ZodCheckStartsWith extends $ZodCheck<string> {
1781
- _zod: $ZodCheckStartsWithInternals;
1782
- }
1783
- declare const $ZodCheckStartsWith: $constructor<$ZodCheckStartsWith>;
1784
- interface $ZodCheckEndsWithDef extends $ZodCheckStringFormatDef<"ends_with"> {
1785
- suffix: string;
1786
- }
1787
- interface $ZodCheckEndsWithInternals extends $ZodCheckInternals<string> {
1788
- def: $ZodCheckEndsWithDef;
1789
- issc: $ZodIssueInvalidStringFormat;
1790
- }
1791
- interface $ZodCheckEndsWith extends $ZodCheckInternals<string> {
1792
- _zod: $ZodCheckEndsWithInternals;
1793
- }
1794
- declare const $ZodCheckEndsWith: $constructor<$ZodCheckEndsWith>;
1795
- //#endregion
1796
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/errors.d.cts
1797
- interface $ZodIssueBase {
1798
- readonly code?: string;
1799
- readonly input?: unknown;
1800
- readonly path: PropertyKey[];
1801
- readonly message: string;
1802
- }
1803
- type $ZodInvalidTypeExpected = "string" | "number" | "int" | "boolean" | "bigint" | "symbol" | "undefined" | "null" | "never" | "void" | "date" | "array" | "object" | "tuple" | "record" | "map" | "set" | "file" | "nonoptional" | "nan" | "function" | (string & {});
1804
- interface $ZodIssueInvalidType<Input = unknown> extends $ZodIssueBase {
1805
- readonly code: "invalid_type";
1806
- readonly expected: $ZodInvalidTypeExpected;
1807
- readonly input?: Input;
1808
- }
1809
- interface $ZodIssueTooBig<Input = unknown> extends $ZodIssueBase {
1810
- readonly code: "too_big";
1811
- readonly origin: "number" | "int" | "bigint" | "date" | "string" | "array" | "set" | "file" | (string & {});
1812
- readonly maximum: number | bigint;
1813
- readonly inclusive?: boolean;
1814
- readonly exact?: boolean;
1815
- readonly input?: Input;
1816
- }
1817
- interface $ZodIssueTooSmall<Input = unknown> extends $ZodIssueBase {
1818
- readonly code: "too_small";
1819
- readonly origin: "number" | "int" | "bigint" | "date" | "string" | "array" | "set" | "file" | (string & {});
1820
- readonly minimum: number | bigint;
1821
- /** True if the allowable range includes the minimum */
1822
- readonly inclusive?: boolean;
1823
- /** True if the allowed value is fixed (e.g.` z.length(5)`), not a range (`z.minLength(5)`) */
1824
- readonly exact?: boolean;
1825
- readonly input?: Input;
1826
- }
1827
- interface $ZodIssueInvalidStringFormat extends $ZodIssueBase {
1828
- readonly code: "invalid_format";
1829
- readonly format: $ZodStringFormats | (string & {});
1830
- readonly pattern?: string;
1831
- readonly input?: string;
1832
- }
1833
- interface $ZodIssueNotMultipleOf<Input extends number | bigint = number | bigint> extends $ZodIssueBase {
1834
- readonly code: "not_multiple_of";
1835
- readonly divisor: number;
1836
- readonly input?: Input;
1837
- }
1838
- interface $ZodIssueUnrecognizedKeys extends $ZodIssueBase {
1839
- readonly code: "unrecognized_keys";
1840
- readonly keys: string[];
1841
- readonly input?: Record<string, unknown>;
1842
- }
1843
- interface $ZodIssueInvalidUnionNoMatch extends $ZodIssueBase {
1844
- readonly code: "invalid_union";
1845
- readonly errors: $ZodIssue[][];
1846
- readonly input?: unknown;
1847
- readonly discriminator?: string | undefined;
1848
- readonly inclusive?: true;
1849
- }
1850
- interface $ZodIssueInvalidUnionMultipleMatch extends $ZodIssueBase {
1851
- readonly code: "invalid_union";
1852
- readonly errors: [];
1853
- readonly input?: unknown;
1854
- readonly discriminator?: string | undefined;
1855
- readonly inclusive: false;
1856
- }
1857
- type $ZodIssueInvalidUnion = $ZodIssueInvalidUnionNoMatch | $ZodIssueInvalidUnionMultipleMatch;
1858
- interface $ZodIssueInvalidKey<Input = unknown> extends $ZodIssueBase {
1859
- readonly code: "invalid_key";
1860
- readonly origin: "map" | "record";
1861
- readonly issues: $ZodIssue[];
1862
- readonly input?: Input;
1863
- }
1864
- interface $ZodIssueInvalidElement<Input = unknown> extends $ZodIssueBase {
1865
- readonly code: "invalid_element";
1866
- readonly origin: "map" | "set";
1867
- readonly key: unknown;
1868
- readonly issues: $ZodIssue[];
1869
- readonly input?: Input;
1870
- }
1871
- interface $ZodIssueInvalidValue<Input = unknown> extends $ZodIssueBase {
1872
- readonly code: "invalid_value";
1873
- readonly values: Primitive[];
1874
- readonly input?: Input;
1875
- }
1876
- interface $ZodIssueCustom extends $ZodIssueBase {
1877
- readonly code: "custom";
1878
- readonly params?: Record<string, any> | undefined;
1879
- readonly input?: unknown;
1880
- }
1881
- type $ZodIssue = $ZodIssueInvalidType | $ZodIssueTooBig | $ZodIssueTooSmall | $ZodIssueInvalidStringFormat | $ZodIssueNotMultipleOf | $ZodIssueUnrecognizedKeys | $ZodIssueInvalidUnion | $ZodIssueInvalidKey | $ZodIssueInvalidElement | $ZodIssueInvalidValue | $ZodIssueCustom;
1882
- type $ZodInternalIssue<T extends $ZodIssueBase = $ZodIssue> = T extends any ? RawIssue$1<T> : never;
1883
- type RawIssue$1<T extends $ZodIssueBase> = T extends any ? Flatten<MakePartial<T, "message" | "path"> & {
1884
- /** The input data */readonly input: unknown; /** The schema or check that originated this issue. */
1885
- readonly inst?: $ZodType | $ZodCheck; /** If `true`, Zod will continue executing checks/refinements after this issue. */
1886
- readonly continue?: boolean | undefined;
1887
- } & Record<string, unknown>> : never;
1888
- type $ZodRawIssue<T extends $ZodIssueBase = $ZodIssue> = $ZodInternalIssue<T>;
1889
- interface $ZodErrorMap<T extends $ZodIssueBase = $ZodIssue> {
1890
- (issue: $ZodRawIssue<T>): {
1891
- message: string;
1892
- } | string | undefined | null;
1893
- }
1894
- interface $ZodError<T = unknown> extends Error {
1895
- type: T;
1896
- issues: $ZodIssue[];
1897
- _zod: {
1898
- output: T;
1899
- def: $ZodIssue[];
323
+ //#region src/update-component.d.ts
324
+ declare const UPDATE_FIELD_SPECS: Readonly<{
325
+ check: {
326
+ key: string;
327
+ default: true;
328
+ env: string;
329
+ parse: typeof boolean;
330
+ ownership: "user-only";
1900
331
  };
1901
- stack?: string;
1902
- name: string;
1903
- }
1904
- declare const $ZodError: $constructor<$ZodError>;
1905
- type $ZodFlattenedError<T, U = string> = _FlattenedError<T, U>;
1906
- type _FlattenedError<T, U = string> = {
1907
- formErrors: U[];
1908
- fieldErrors: { [P in keyof T]?: U[] };
1909
- };
1910
- type _ZodFormattedError<T, U = string> = T extends [any, ...any[]] ? { [K in keyof T]?: $ZodFormattedError<T[K], U> } : T extends any[] ? {
1911
- [k: number]: $ZodFormattedError<T[number], U>;
1912
- } : T extends object ? Flatten<{ [K in keyof T]?: $ZodFormattedError<T[K], U> }> : any;
1913
- type $ZodFormattedError<T, U = string> = {
1914
- _errors: U[];
1915
- } & Flatten<_ZodFormattedError<T, U>>;
1916
- //#endregion
1917
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/core.d.cts
1918
- type ZodTrait = {
1919
- _zod: {
1920
- def: any;
1921
- [k: string]: any;
332
+ plugins: {
333
+ key: string;
334
+ default: UpdatePolicyMode;
335
+ env: string;
336
+ parse: (raw: unknown) => UpdatePolicyMode | undefined;
337
+ ownership: "user-only";
1922
338
  };
1923
- };
1924
- interface $constructor<T extends ZodTrait, D = T["_zod"]["def"]> {
1925
- new (def: D): T;
1926
- init(inst: T, def: D): asserts inst is T;
1927
- }
1928
- declare function $constructor<T extends ZodTrait, D = T["_zod"]["def"]>(name: string, initializer: (inst: T, def: D) => void, params?: {
1929
- Parent?: typeof Class;
1930
- }): $constructor<T, D>;
1931
- declare const $brand: unique symbol;
1932
- type $brand<T extends string | number | symbol = string | number | symbol> = {
1933
- [$brand]: { [k in T]: true };
1934
- };
1935
- type $ZodBranded<T extends SomeType, Brand extends string | number | symbol, Dir extends "in" | "out" | "inout" = "out"> = T & (Dir extends "inout" ? {
1936
- _zod: {
1937
- input: input<T> & $brand<Brand>;
1938
- output: output<T> & $brand<Brand>;
339
+ otto: {
340
+ key: string;
341
+ default: UpdatePolicyMode;
342
+ env: string;
343
+ parse: (raw: unknown) => UpdatePolicyMode | undefined;
344
+ ownership: "user-only";
1939
345
  };
1940
- } : Dir extends "in" ? {
1941
- _zod: {
1942
- input: input<T> & $brand<Brand>;
346
+ npmRegistry: {
347
+ key: string;
348
+ env: string;
349
+ ownership: "user-only";
350
+ legacy: {
351
+ aliases: string[];
352
+ };
1943
353
  };
1944
- } : {
1945
- _zod: {
1946
- output: output<T> & $brand<Brand>;
354
+ githubApi: {
355
+ key: string;
356
+ env: string;
357
+ ownership: "user-only";
358
+ legacy: {
359
+ aliases: string[];
360
+ };
1947
361
  };
1948
- });
1949
- type input<T> = T extends {
1950
- _zod: {
1951
- input: any;
362
+ intervalHours: {
363
+ key: string;
364
+ default: number;
365
+ env: string;
366
+ parse: (raw: unknown) => number | undefined;
367
+ ownership: "user-only";
1952
368
  };
1953
- } ? T["_zod"]["input"] : unknown;
1954
- type output<T> = T extends {
1955
- _zod: {
1956
- output: any;
369
+ channel: {
370
+ key: string;
371
+ default: "stable" | "next";
372
+ env: string;
373
+ parse: (raw: unknown) => "stable" | "next" | undefined;
374
+ ownership: "user-only";
375
+ };
376
+ sources: {
377
+ key: string;
378
+ default: readonly string[];
379
+ env: string;
380
+ parse: typeof list;
381
+ ownership: "user-only";
1957
382
  };
1958
- } ? T["_zod"]["output"] : unknown;
1959
- //#endregion
1960
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/api.d.cts
1961
- type Params<T extends $ZodType | $ZodCheck, IssueTypes extends $ZodIssueBase, OmitKeys extends keyof T["_zod"]["def"] = never> = Flatten<Partial<EmptyToNever<Omit<T["_zod"]["def"], OmitKeys> & ([IssueTypes] extends [never] ? {} : {
1962
- error?: string | $ZodErrorMap<IssueTypes> | undefined; /** @deprecated This parameter is deprecated. Use `error` instead. */
1963
- message?: string | undefined;
1964
- })>>>;
1965
- type TypeParams<T extends $ZodType = $ZodType & {
1966
- _isst: never;
1967
- }, AlsoOmit extends Exclude<keyof T["_zod"]["def"], "type" | "checks" | "error"> = never> = Params<T, NonNullable<T["_zod"]["isst"]>, "type" | "checks" | "error" | AlsoOmit>;
1968
- type CheckParams<T extends $ZodCheck = $ZodCheck, // & { _issc: never },
1969
- AlsoOmit extends Exclude<keyof T["_zod"]["def"], "check" | "error"> = never> = Params<T, NonNullable<T["_zod"]["issc"]>, "check" | "error" | AlsoOmit>;
1970
- type CheckStringFormatParams<T extends $ZodStringFormat = $ZodStringFormat, AlsoOmit extends Exclude<keyof T["_zod"]["def"], "type" | "coerce" | "checks" | "error" | "check" | "format"> = never> = Params<T, NonNullable<T["_zod"]["issc"]>, "type" | "coerce" | "checks" | "error" | "check" | "format" | AlsoOmit>;
1971
- type CheckTypeParams<T extends $ZodType & $ZodCheck = $ZodType & $ZodCheck, AlsoOmit extends Exclude<keyof T["_zod"]["def"], "type" | "checks" | "error" | "check"> = never> = Params<T, NonNullable<T["_zod"]["isst"] | T["_zod"]["issc"]>, "type" | "checks" | "error" | "check" | AlsoOmit>;
1972
- type $ZodCheckEmailParams = CheckStringFormatParams<$ZodEmail, "when">;
1973
- type $ZodCheckGUIDParams = CheckStringFormatParams<$ZodGUID, "pattern" | "when">;
1974
- type $ZodCheckUUIDParams = CheckStringFormatParams<$ZodUUID, "pattern" | "when">;
1975
- type $ZodCheckURLParams = CheckStringFormatParams<$ZodURL, "when">;
1976
- type $ZodCheckEmojiParams = CheckStringFormatParams<$ZodEmoji, "when">;
1977
- type $ZodCheckNanoIDParams = CheckStringFormatParams<$ZodNanoID, "when">;
1978
- type $ZodCheckCUIDParams = CheckStringFormatParams<$ZodCUID, "when">;
1979
- type $ZodCheckCUID2Params = CheckStringFormatParams<$ZodCUID2, "when">;
1980
- type $ZodCheckULIDParams = CheckStringFormatParams<$ZodULID, "when">;
1981
- type $ZodCheckXIDParams = CheckStringFormatParams<$ZodXID, "when">;
1982
- type $ZodCheckKSUIDParams = CheckStringFormatParams<$ZodKSUID, "when">;
1983
- type $ZodCheckIPv4Params = CheckStringFormatParams<$ZodIPv4, "pattern" | "when" | "version">;
1984
- type $ZodCheckIPv6Params = CheckStringFormatParams<$ZodIPv6, "pattern" | "when" | "version">;
1985
- type $ZodCheckCIDRv4Params = CheckStringFormatParams<$ZodCIDRv4, "pattern" | "when">;
1986
- type $ZodCheckCIDRv6Params = CheckStringFormatParams<$ZodCIDRv6, "pattern" | "when">;
1987
- type $ZodCheckBase64Params = CheckStringFormatParams<$ZodBase64, "pattern" | "when">;
1988
- type $ZodCheckBase64URLParams = CheckStringFormatParams<$ZodBase64URL, "pattern" | "when">;
1989
- type $ZodCheckE164Params = CheckStringFormatParams<$ZodE164, "when">;
1990
- type $ZodCheckJWTParams = CheckStringFormatParams<$ZodJWT, "pattern" | "when">;
1991
- type $ZodCheckISODateTimeParams = CheckStringFormatParams<$ZodISODateTime, "pattern" | "when">;
1992
- type $ZodCheckISODateParams = CheckStringFormatParams<$ZodISODate, "pattern" | "when">;
1993
- type $ZodCheckISOTimeParams = CheckStringFormatParams<$ZodISOTime, "pattern" | "when">;
1994
- type $ZodCheckISODurationParams = CheckStringFormatParams<$ZodISODuration, "when">;
1995
- type $ZodCheckMaxLengthParams = CheckParams<$ZodCheckMaxLength, "maximum" | "when">;
1996
- type $ZodCheckMinLengthParams = CheckParams<$ZodCheckMinLength, "minimum" | "when">;
1997
- type $ZodCheckLengthEqualsParams = CheckParams<$ZodCheckLengthEquals, "length" | "when">;
1998
- type $ZodCheckRegexParams = CheckParams<$ZodCheckRegex, "format" | "pattern" | "when">;
1999
- type $ZodCheckLowerCaseParams = CheckParams<$ZodCheckLowerCase, "format" | "when">;
2000
- type $ZodCheckUpperCaseParams = CheckParams<$ZodCheckUpperCase, "format" | "when">;
2001
- type $ZodCheckIncludesParams = CheckParams<$ZodCheckIncludes, "includes" | "format" | "when" | "pattern">;
2002
- type $ZodCheckStartsWithParams = CheckParams<$ZodCheckStartsWith, "prefix" | "format" | "when" | "pattern">;
2003
- type $ZodCheckEndsWithParams = CheckParams<$ZodCheckEndsWith, "suffix" | "format" | "pattern" | "when">;
2004
- type $ZodEnumParams = TypeParams<$ZodEnum, "entries">;
2005
- type $ZodNonOptionalParams = TypeParams<$ZodNonOptional, "innerType">;
2006
- type $ZodCustomParams = CheckTypeParams<$ZodCustom, "fn">;
2007
- type $ZodSuperRefineIssue<T extends $ZodIssueBase = $ZodIssue> = T extends any ? RawIssue<T> : never;
2008
- type RawIssue<T extends $ZodIssueBase> = T extends any ? Flatten<MakePartial<T, "message" | "path"> & {
2009
- /** The schema or check that originated this issue. */readonly inst?: $ZodType | $ZodCheck; /** If `true`, Zod will execute subsequent checks/refinements instead of immediately aborting */
2010
- readonly continue?: boolean | undefined;
2011
- } & Record<string, unknown>> : never;
2012
- interface $RefinementCtx<T = unknown> extends ParsePayload<T> {
2013
- addIssue(arg: string | $ZodSuperRefineIssue): void;
2014
- }
2015
- //#endregion
2016
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/errors.d.cts
2017
- /** An Error-like class used to store Zod validation issues. */
2018
- interface ZodError<T = unknown> extends $ZodError<T> {
2019
- /** @deprecated Use the `z.treeifyError(err)` function instead. */
2020
- format(): $ZodFormattedError<T>;
2021
- format<U>(mapper: (issue: $ZodIssue) => U): $ZodFormattedError<T, U>;
2022
- /** @deprecated Use the `z.treeifyError(err)` function instead. */
2023
- flatten(): $ZodFlattenedError<T>;
2024
- flatten<U>(mapper: (issue: $ZodIssue) => U): $ZodFlattenedError<T, U>;
2025
- /** @deprecated Push directly to `.issues` instead. */
2026
- addIssue(issue: $ZodIssue): void;
2027
- /** @deprecated Push directly to `.issues` instead. */
2028
- addIssues(issues: $ZodIssue[]): void;
2029
- /** @deprecated Check `err.issues.length === 0` instead. */
2030
- isEmpty: boolean;
2031
- }
2032
- declare const ZodError: $constructor<ZodError>;
2033
- //#endregion
2034
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/parse.d.cts
2035
- type ZodSafeParseResult<T> = ZodSafeParseSuccess<T> | ZodSafeParseError<T>;
2036
- type ZodSafeParseSuccess<T> = {
2037
- success: true;
2038
- data: T;
2039
- error?: never;
2040
- };
2041
- type ZodSafeParseError<T> = {
2042
- success: false;
2043
- data?: never;
2044
- error: ZodError<T>;
2045
- };
2046
- //#endregion
2047
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/schemas.d.cts
2048
- type ZodStandardSchemaWithJSON<T> = StandardSchemaWithJSONProps<input<T>, output<T>>;
2049
- interface ZodType<out Output = unknown, out Input = unknown, out Internals extends $ZodTypeInternals<Output, Input> = $ZodTypeInternals<Output, Input>> extends $ZodType<Output, Input, Internals> {
2050
- def: Internals["def"];
2051
- type: Internals["def"]["type"];
2052
- /** @deprecated Use `.def` instead. */
2053
- _def: Internals["def"];
2054
- /** @deprecated Use `z.output<typeof schema>` instead. */
2055
- _output: Internals["output"];
2056
- /** @deprecated Use `z.input<typeof schema>` instead. */
2057
- _input: Internals["input"];
2058
- "~standard": ZodStandardSchemaWithJSON<this>;
2059
- /** Converts this schema to a JSON Schema representation. */
2060
- toJSONSchema(params?: ToJSONSchemaParams): ZodStandardJSONSchemaPayload<this>;
2061
- check(...checks: (CheckFn<output<this>> | $ZodCheck<output<this>>)[]): this;
2062
- with(...checks: (CheckFn<output<this>> | $ZodCheck<output<this>>)[]): this;
2063
- clone(def?: Internals["def"], params?: {
2064
- parent: boolean;
2065
- }): this;
2066
- register<R extends $ZodRegistry>(registry: R, ...meta: this extends R["_schema"] ? undefined extends R["_meta"] ? [$replace<R["_meta"], this>?] : [$replace<R["_meta"], this>] : ["Incompatible schema"]): this;
2067
- brand<T extends PropertyKey = PropertyKey, Dir extends "in" | "out" | "inout" = "out">(value?: T): PropertyKey extends T ? this : $ZodBranded<this, T, Dir>;
2068
- parse(data: unknown, params?: ParseContext<$ZodIssue>): output<this>;
2069
- safeParse(data: unknown, params?: ParseContext<$ZodIssue>): ZodSafeParseResult<output<this>>;
2070
- parseAsync(data: unknown, params?: ParseContext<$ZodIssue>): Promise<output<this>>;
2071
- safeParseAsync(data: unknown, params?: ParseContext<$ZodIssue>): Promise<ZodSafeParseResult<output<this>>>;
2072
- spa: (data: unknown, params?: ParseContext<$ZodIssue>) => Promise<ZodSafeParseResult<output<this>>>;
2073
- encode(data: output<this>, params?: ParseContext<$ZodIssue>): input<this>;
2074
- decode(data: input<this>, params?: ParseContext<$ZodIssue>): output<this>;
2075
- encodeAsync(data: output<this>, params?: ParseContext<$ZodIssue>): Promise<input<this>>;
2076
- decodeAsync(data: input<this>, params?: ParseContext<$ZodIssue>): Promise<output<this>>;
2077
- safeEncode(data: output<this>, params?: ParseContext<$ZodIssue>): ZodSafeParseResult<input<this>>;
2078
- safeDecode(data: input<this>, params?: ParseContext<$ZodIssue>): ZodSafeParseResult<output<this>>;
2079
- safeEncodeAsync(data: output<this>, params?: ParseContext<$ZodIssue>): Promise<ZodSafeParseResult<input<this>>>;
2080
- safeDecodeAsync(data: input<this>, params?: ParseContext<$ZodIssue>): Promise<ZodSafeParseResult<output<this>>>;
2081
- refine<Ch extends (arg: output<this>) => unknown | Promise<unknown>>(check: Ch, params?: string | $ZodCustomParams): Ch extends ((arg: any) => arg is infer R) ? this & ZodType<R, input<this>> : this;
2082
- superRefine(refinement: (arg: output<this>, ctx: $RefinementCtx<output<this>>) => void | Promise<void>): this;
2083
- overwrite(fn: (x: output<this>) => output<this>): this;
2084
- optional(): ZodOptional<this>;
2085
- exactOptional(): ZodExactOptional<this>;
2086
- nonoptional(params?: string | $ZodNonOptionalParams): ZodNonOptional<this>;
2087
- nullable(): ZodNullable<this>;
2088
- nullish(): ZodOptional<ZodNullable<this>>;
2089
- default(def: NoUndefined<output<this>>): ZodDefault<this>;
2090
- default(def: () => NoUndefined<output<this>>): ZodDefault<this>;
2091
- prefault(def: () => input<this>): ZodPrefault<this>;
2092
- prefault(def: input<this>): ZodPrefault<this>;
2093
- array(): ZodArray<this>;
2094
- or<T extends SomeType>(option: T): ZodUnion<[this, T]>;
2095
- and<T extends SomeType>(incoming: T): ZodIntersection<this, T>;
2096
- transform<NewOut>(transform: (arg: output<this>, ctx: $RefinementCtx<output<this>>) => NewOut | Promise<NewOut>): ZodPipe<this, ZodTransform<Awaited<NewOut>, output<this>>>;
2097
- catch(def: output<this>): ZodCatch<this>;
2098
- catch(def: (ctx: $ZodCatchCtx) => output<this>): ZodCatch<this>;
2099
- pipe<T extends $ZodType<any, output<this>>>(target: T | $ZodType<any, output<this>>): ZodPipe<this, T>;
2100
- readonly(): ZodReadonly<this>;
2101
- /** Returns a new instance that has been registered in `z.globalRegistry` with the specified description */
2102
- describe(description: string): this;
2103
- description?: string;
2104
- /** Returns the metadata associated with this instance in `z.globalRegistry` */
2105
- meta(): $replace<GlobalMeta, this> | undefined;
2106
- /** Returns a new instance that has been registered in `z.globalRegistry` with the specified metadata */
2107
- meta(data: $replace<GlobalMeta, this>): this;
2108
- /** @deprecated Try safe-parsing `undefined` (this is what `isOptional` does internally):
2109
- *
2110
- * ```ts
2111
- * const schema = z.string().optional();
2112
- * const isOptional = schema.safeParse(undefined).success; // true
2113
- * ```
2114
- */
2115
- isOptional(): boolean;
2116
- /**
2117
- * @deprecated Try safe-parsing `null` (this is what `isNullable` does internally):
2118
- *
2119
- * ```ts
2120
- * const schema = z.string().nullable();
2121
- * const isNullable = schema.safeParse(null).success; // true
2122
- * ```
2123
- */
2124
- isNullable(): boolean;
2125
- apply<T>(fn: (schema: this) => T): T;
2126
- }
2127
- interface _ZodType<out Internals extends $ZodTypeInternals = $ZodTypeInternals> extends ZodType<any, any, Internals> {}
2128
- declare const ZodType: $constructor<ZodType>;
2129
- interface _ZodString<T extends $ZodStringInternals<unknown> = $ZodStringInternals<unknown>> extends _ZodType<T> {
2130
- format: string | null;
2131
- minLength: number | null;
2132
- maxLength: number | null;
2133
- regex(regex: RegExp, params?: string | $ZodCheckRegexParams): this;
2134
- includes(value: string, params?: string | $ZodCheckIncludesParams): this;
2135
- startsWith(value: string, params?: string | $ZodCheckStartsWithParams): this;
2136
- endsWith(value: string, params?: string | $ZodCheckEndsWithParams): this;
2137
- min(minLength: number, params?: string | $ZodCheckMinLengthParams): this;
2138
- max(maxLength: number, params?: string | $ZodCheckMaxLengthParams): this;
2139
- length(len: number, params?: string | $ZodCheckLengthEqualsParams): this;
2140
- nonempty(params?: string | $ZodCheckMinLengthParams): this;
2141
- lowercase(params?: string | $ZodCheckLowerCaseParams): this;
2142
- uppercase(params?: string | $ZodCheckUpperCaseParams): this;
2143
- trim(): this;
2144
- normalize(form?: "NFC" | "NFD" | "NFKC" | "NFKD" | (string & {})): this;
2145
- toLowerCase(): this;
2146
- toUpperCase(): this;
2147
- slugify(): this;
2148
- }
2149
- /** @internal */
2150
- declare const _ZodString: $constructor<_ZodString>;
2151
- interface ZodString extends _ZodString<$ZodStringInternals<string>> {
2152
- /** @deprecated Use `z.email()` instead. */
2153
- email(params?: string | $ZodCheckEmailParams): this;
2154
- /** @deprecated Use `z.url()` instead. */
2155
- url(params?: string | $ZodCheckURLParams): this;
2156
- /** @deprecated Use `z.jwt()` instead. */
2157
- jwt(params?: string | $ZodCheckJWTParams): this;
2158
- /** @deprecated Use `z.emoji()` instead. */
2159
- emoji(params?: string | $ZodCheckEmojiParams): this;
2160
- /** @deprecated Use `z.guid()` instead. */
2161
- guid(params?: string | $ZodCheckGUIDParams): this;
2162
- /** @deprecated Use `z.uuid()` instead. */
2163
- uuid(params?: string | $ZodCheckUUIDParams): this;
2164
- /** @deprecated Use `z.uuid()` instead. */
2165
- uuidv4(params?: string | $ZodCheckUUIDParams): this;
2166
- /** @deprecated Use `z.uuid()` instead. */
2167
- uuidv6(params?: string | $ZodCheckUUIDParams): this;
2168
- /** @deprecated Use `z.uuid()` instead. */
2169
- uuidv7(params?: string | $ZodCheckUUIDParams): this;
2170
- /** @deprecated Use `z.nanoid()` instead. */
2171
- nanoid(params?: string | $ZodCheckNanoIDParams): this;
2172
- /** @deprecated Use `z.guid()` instead. */
2173
- guid(params?: string | $ZodCheckGUIDParams): this;
2174
- /** @deprecated Use `z.cuid()` instead. */
2175
- cuid(params?: string | $ZodCheckCUIDParams): this;
2176
- /** @deprecated Use `z.cuid2()` instead. */
2177
- cuid2(params?: string | $ZodCheckCUID2Params): this;
2178
- /** @deprecated Use `z.ulid()` instead. */
2179
- ulid(params?: string | $ZodCheckULIDParams): this;
2180
- /** @deprecated Use `z.base64()` instead. */
2181
- base64(params?: string | $ZodCheckBase64Params): this;
2182
- /** @deprecated Use `z.base64url()` instead. */
2183
- base64url(params?: string | $ZodCheckBase64URLParams): this;
2184
- /** @deprecated Use `z.xid()` instead. */
2185
- xid(params?: string | $ZodCheckXIDParams): this;
2186
- /** @deprecated Use `z.ksuid()` instead. */
2187
- ksuid(params?: string | $ZodCheckKSUIDParams): this;
2188
- /** @deprecated Use `z.ipv4()` instead. */
2189
- ipv4(params?: string | $ZodCheckIPv4Params): this;
2190
- /** @deprecated Use `z.ipv6()` instead. */
2191
- ipv6(params?: string | $ZodCheckIPv6Params): this;
2192
- /** @deprecated Use `z.cidrv4()` instead. */
2193
- cidrv4(params?: string | $ZodCheckCIDRv4Params): this;
2194
- /** @deprecated Use `z.cidrv6()` instead. */
2195
- cidrv6(params?: string | $ZodCheckCIDRv6Params): this;
2196
- /** @deprecated Use `z.e164()` instead. */
2197
- e164(params?: string | $ZodCheckE164Params): this;
2198
- /** @deprecated Use `z.iso.datetime()` instead. */
2199
- datetime(params?: string | $ZodCheckISODateTimeParams): this;
2200
- /** @deprecated Use `z.iso.date()` instead. */
2201
- date(params?: string | $ZodCheckISODateParams): this;
2202
- /** @deprecated Use `z.iso.time()` instead. */
2203
- time(params?: string | $ZodCheckISOTimeParams): this;
2204
- /** @deprecated Use `z.iso.duration()` instead. */
2205
- duration(params?: string | $ZodCheckISODurationParams): this;
2206
- }
2207
- declare const ZodString: $constructor<ZodString>;
2208
- interface _ZodBoolean<T extends $ZodBooleanInternals = $ZodBooleanInternals> extends _ZodType<T> {}
2209
- interface ZodBoolean extends _ZodBoolean<$ZodBooleanInternals<boolean>> {}
2210
- declare const ZodBoolean: $constructor<ZodBoolean>;
2211
- interface ZodUnknown extends _ZodType<$ZodUnknownInternals> {}
2212
- declare const ZodUnknown: $constructor<ZodUnknown>;
2213
- interface ZodArray<T extends SomeType = $ZodType> extends _ZodType<$ZodArrayInternals<T>>, $ZodArray<T> {
2214
- element: T;
2215
- min(minLength: number, params?: string | $ZodCheckMinLengthParams): this;
2216
- nonempty(params?: string | $ZodCheckMinLengthParams): this;
2217
- max(maxLength: number, params?: string | $ZodCheckMaxLengthParams): this;
2218
- length(len: number, params?: string | $ZodCheckLengthEqualsParams): this;
2219
- unwrap(): T;
2220
- "~standard": ZodStandardSchemaWithJSON<this>;
2221
- }
2222
- declare const ZodArray: $constructor<ZodArray>;
2223
- type SafeExtendShape<Base extends $ZodShape, Ext extends $ZodLooseShape> = { [K in keyof Ext]: K extends keyof Base ? output<Ext[K]> extends output<Base[K]> ? input<Ext[K]> extends input<Base[K]> ? Ext[K] : never : never : Ext[K] };
2224
- interface ZodObject< /** @ts-ignore Cast variance */out Shape extends $ZodShape = $ZodLooseShape, out Config extends $ZodObjectConfig = $strip> extends _ZodType<$ZodObjectInternals<Shape, Config>>, $ZodObject<Shape, Config> {
2225
- "~standard": ZodStandardSchemaWithJSON<this>;
2226
- shape: Shape;
2227
- keyof(): ZodEnum<ToEnum<keyof Shape & string>>;
2228
- /** Define a schema to validate all unrecognized keys. This overrides the existing strict/loose behavior. */
2229
- catchall<T extends SomeType>(schema: T): ZodObject<Shape, $catchall<T>>;
2230
- /** @deprecated Use `z.looseObject()` or `.loose()` instead. */
2231
- passthrough(): ZodObject<Shape, $loose>;
2232
- /** Consider `z.looseObject(A.shape)` instead */
2233
- loose(): ZodObject<Shape, $loose>;
2234
- /** Consider `z.strictObject(A.shape)` instead */
2235
- strict(): ZodObject<Shape, $strict>;
2236
- /** This is the default behavior. This method call is likely unnecessary. */
2237
- strip(): ZodObject<Shape, $strip>;
2238
- extend<U extends $ZodLooseShape>(shape: U): ZodObject<Extend<Shape, U>, Config>;
2239
- safeExtend<U extends $ZodLooseShape>(shape: SafeExtendShape<Shape, U> & Partial<Record<keyof Shape, SomeType>>): ZodObject<Extend<Shape, U>, Config>;
2240
- /**
2241
- * @deprecated Use [`A.extend(B.shape)`](https://zod.dev/api?id=extend) instead.
2242
- */
2243
- merge<U extends ZodObject>(other: U): ZodObject<Extend<Shape, U["shape"]>, U["_zod"]["config"]>;
2244
- pick<M extends Mask<keyof Shape>>(mask: M & Record<Exclude<keyof M, keyof Shape>, never>): ZodObject<Flatten<Pick<Shape, Extract<keyof Shape, keyof M>>>, Config>;
2245
- omit<M extends Mask<keyof Shape>>(mask: M & Record<Exclude<keyof M, keyof Shape>, never>): ZodObject<Flatten<Omit<Shape, Extract<keyof Shape, keyof M>>>, Config>;
2246
- partial(): ZodObject<{ [k in keyof Shape]: ZodOptional<Shape[k]> }, Config>;
2247
- partial<M extends Mask<keyof Shape>>(mask: M & Record<Exclude<keyof M, keyof Shape>, never>): ZodObject<{ [k in keyof Shape]: k extends keyof M ? ZodOptional<Shape[k]> : Shape[k] }, Config>;
2248
- required(): ZodObject<{ [k in keyof Shape]: ZodNonOptional<Shape[k]> }, Config>;
2249
- required<M extends Mask<keyof Shape>>(mask: M & Record<Exclude<keyof M, keyof Shape>, never>): ZodObject<{ [k in keyof Shape]: k extends keyof M ? ZodNonOptional<Shape[k]> : Shape[k] }, Config>;
2250
- }
2251
- declare const ZodObject: $constructor<ZodObject>;
2252
- interface ZodUnion<T extends readonly SomeType[] = readonly $ZodType[]> extends _ZodType<$ZodUnionInternals<T>>, $ZodUnion<T> {
2253
- "~standard": ZodStandardSchemaWithJSON<this>;
2254
- options: T;
2255
- }
2256
- declare const ZodUnion: $constructor<ZodUnion>;
2257
- interface ZodIntersection<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends _ZodType<$ZodIntersectionInternals<A, B>>, $ZodIntersection<A, B> {
2258
- "~standard": ZodStandardSchemaWithJSON<this>;
2259
- }
2260
- declare const ZodIntersection: $constructor<ZodIntersection>;
2261
- interface ZodEnum< /** @ts-ignore Cast variance */out T extends EnumLike = EnumLike> extends _ZodType<$ZodEnumInternals<T>>, $ZodEnum<T> {
2262
- "~standard": ZodStandardSchemaWithJSON<this>;
2263
- enum: T;
2264
- options: Array<T[keyof T]>;
2265
- extract<const U extends readonly (keyof T)[]>(values: U, params?: string | $ZodEnumParams): ZodEnum<Flatten<Pick<T, U[number]>>>;
2266
- exclude<const U extends readonly (keyof T)[]>(values: U, params?: string | $ZodEnumParams): ZodEnum<Flatten<Omit<T, U[number]>>>;
2267
- }
2268
- declare const ZodEnum: $constructor<ZodEnum>;
2269
- interface ZodLiteral<T extends Literal = Literal> extends _ZodType<$ZodLiteralInternals<T>>, $ZodLiteral<T> {
2270
- "~standard": ZodStandardSchemaWithJSON<this>;
2271
- values: Set<T>;
2272
- /** @legacy Use `.values` instead. Accessing this property will throw an error if the literal accepts multiple values. */
2273
- value: T;
2274
- }
2275
- declare const ZodLiteral: $constructor<ZodLiteral>;
2276
- interface ZodTransform<O = unknown, I = unknown> extends _ZodType<$ZodTransformInternals<O, I>>, $ZodTransform<O, I> {
2277
- "~standard": ZodStandardSchemaWithJSON<this>;
2278
- }
2279
- declare const ZodTransform: $constructor<ZodTransform>;
2280
- interface ZodOptional<T extends SomeType = $ZodType> extends _ZodType<$ZodOptionalInternals<T>>, $ZodOptional<T> {
2281
- "~standard": ZodStandardSchemaWithJSON<this>;
2282
- unwrap(): T;
2283
- }
2284
- declare const ZodOptional: $constructor<ZodOptional>;
2285
- interface ZodExactOptional<T extends SomeType = $ZodType> extends _ZodType<$ZodExactOptionalInternals<T>>, $ZodExactOptional<T> {
2286
- "~standard": ZodStandardSchemaWithJSON<this>;
2287
- unwrap(): T;
2288
- }
2289
- declare const ZodExactOptional: $constructor<ZodExactOptional>;
2290
- interface ZodNullable<T extends SomeType = $ZodType> extends _ZodType<$ZodNullableInternals<T>>, $ZodNullable<T> {
2291
- "~standard": ZodStandardSchemaWithJSON<this>;
2292
- unwrap(): T;
2293
- }
2294
- declare const ZodNullable: $constructor<ZodNullable>;
2295
- interface ZodDefault<T extends SomeType = $ZodType> extends _ZodType<$ZodDefaultInternals<T>>, $ZodDefault<T> {
2296
- "~standard": ZodStandardSchemaWithJSON<this>;
2297
- unwrap(): T;
2298
- /** @deprecated Use `.unwrap()` instead. */
2299
- removeDefault(): T;
2300
- }
2301
- declare const ZodDefault: $constructor<ZodDefault>;
2302
- interface ZodPrefault<T extends SomeType = $ZodType> extends _ZodType<$ZodPrefaultInternals<T>>, $ZodPrefault<T> {
2303
- "~standard": ZodStandardSchemaWithJSON<this>;
2304
- unwrap(): T;
2305
- }
2306
- declare const ZodPrefault: $constructor<ZodPrefault>;
2307
- interface ZodNonOptional<T extends SomeType = $ZodType> extends _ZodType<$ZodNonOptionalInternals<T>>, $ZodNonOptional<T> {
2308
- "~standard": ZodStandardSchemaWithJSON<this>;
2309
- unwrap(): T;
2310
- }
2311
- declare const ZodNonOptional: $constructor<ZodNonOptional>;
2312
- interface ZodCatch<T extends SomeType = $ZodType> extends _ZodType<$ZodCatchInternals<T>>, $ZodCatch<T> {
2313
- "~standard": ZodStandardSchemaWithJSON<this>;
2314
- unwrap(): T;
2315
- /** @deprecated Use `.unwrap()` instead. */
2316
- removeCatch(): T;
2317
- }
2318
- declare const ZodCatch: $constructor<ZodCatch>;
2319
- interface ZodPipe<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends _ZodType<$ZodPipeInternals<A, B>>, $ZodPipe<A, B> {
2320
- "~standard": ZodStandardSchemaWithJSON<this>;
2321
- in: A;
2322
- out: B;
2323
- }
2324
- declare const ZodPipe: $constructor<ZodPipe>;
2325
- interface ZodReadonly<T extends SomeType = $ZodType> extends _ZodType<$ZodReadonlyInternals<T>>, $ZodReadonly<T> {
2326
- "~standard": ZodStandardSchemaWithJSON<this>;
2327
- unwrap(): T;
2328
- }
2329
- declare const ZodReadonly: $constructor<ZodReadonly>;
2330
- //#endregion
2331
- //#region src/registry/registry-schema.d.ts
2332
- /** 条目类型——对齐 install 管道的三种 ContentType。 */
2333
- declare const registryEntryTypeSchema: ZodEnum<{
2334
- plugin: "plugin";
2335
- skill: "skill";
2336
- mcp: "mcp";
2337
383
  }>;
2338
- declare const registryEntrySchema: ZodObject<{
2339
- id: ZodString;
2340
- type: ZodEnum<{
2341
- plugin: "plugin";
2342
- skill: "skill";
2343
- mcp: "mcp";
2344
- }>;
2345
- description: ZodString;
2346
- source: ZodString;
2347
- subPath: ZodOptional<ZodString>;
2348
- capabilities: ZodOptional<ZodArray<ZodString>>;
2349
- keywords: ZodOptional<ZodArray<ZodString>>;
2350
- author: ZodOptional<ZodString>;
2351
- homepage: ZodOptional<ZodString>;
2352
- versionPolicy: ZodOptional<ZodEnum<{
2353
- "latest-tag": "latest-tag";
2354
- "latest-release": "latest-release";
2355
- }>>;
2356
- deprecated: ZodOptional<ZodUnion<readonly [ZodBoolean, ZodObject<{
2357
- reason: ZodString;
2358
- alternative: ZodOptional<ZodString>;
2359
- }, $strip>]>>;
2360
- }, $strip>;
2361
- declare const registrySchema: ZodObject<{
2362
- version: ZodLiteral<1>;
2363
- name: ZodString;
2364
- entries: ZodArray<ZodUnknown>;
2365
- }, $strip>;
2366
- type RegistryEntryType = output<typeof registryEntryTypeSchema>;
2367
- type RegistryEntry = output<typeof registryEntrySchema>;
2368
- interface ParsedRegistry {
2369
- name: string;
2370
- version: 1;
2371
- entries: RegistryEntry[];
2372
- /** 宽容解析中被跳过的坏条目(index + 原因)——单条目坏不拖垮整表。 */
2373
- rejected: Array<{
2374
- index: number;
2375
- reason: string;
2376
- }>;
2377
- }
2378
- /**
2379
- * 宽容解析(对齐 manifest 解析纪律):外层结构(version/name)硬校验,
2380
- * entries 逐条 failSoft——坏条目记入 rejected 并跳过,不拖垮整表。
2381
- */
2382
- declare function parseRegistry(raw: unknown): ParsedRegistry;
2383
- //#endregion
2384
- //#region src/registry/registry-client.d.ts
2385
- interface RegistrySourceConfig {
2386
- /** 源名(唯一键;官方源恒为 'otto-official')。 */
2387
- name: string;
2388
- /** http(s) URL 或 file: 路径或裸本地路径。 */
2389
- url: string;
2390
- /** 内置官方源不可 remove,只可 disable。 */
2391
- builtin?: boolean;
2392
- disabled?: boolean;
2393
- }
2394
- interface RegistriesFile {
2395
- version: 1;
2396
- sources: RegistrySourceConfig[];
2397
- }
2398
- interface LoadedRegistry extends ParsedRegistry {
2399
- sourceName: string;
2400
- sourceUrl: string;
2401
- /** true = fetch 失败降级到过期缓存(结果仍可用但可能陈旧)。 */
2402
- stale: boolean;
2403
- }
2404
- /** 官方源缺省条目(url 由调用方装配注入——发布形态未定期间指向仓内文件)。 */
2405
- declare function builtinOfficialSource(url: string): RegistrySourceConfig;
2406
- /**
2407
- * 2026-08-14 修订(用户指令):删除内网官方源(`otto-official-internal`)自动加载——
2408
- * 原 RFC-341 G2 的 `OTTO_INTERNAL_REGISTRY_URL` + 内网可达探测机制整体退役,registry
2409
- * 单一走官方源(GitHub Pages)+ 用户自添源。内网插件发现不再依赖 registry 分发,
2410
- * 由插件自身的 install/装载链路负责(详见 RFC-341 修订记录)。
2411
- */
2412
- declare class RegistryClient {
2413
- private readonly options;
2414
- constructor(options: {
2415
- /** 用户配置目录(~/.config/otto)。 */configDir: string; /** 缓存目录父级(OTTO_HOME)。 */
2416
- ottoHome: string; /** 内置官方源(装配注入;测试可替换)。 */
2417
- officialSource: RegistrySourceConfig;
2418
- fetchImpl?: typeof fetch;
2419
- });
2420
- private get registriesPath();
2421
- private get cacheDir();
2422
- /**
2423
- * 读源清单(官方源恒在首位;用户文件坏/缺时退化为仅官方源)。
2424
- *
2425
- * 2026-08-14 修订:原 RFC-341 G2 的内网官方源自动追加(`listSourcesAsync`)已随
2426
- * 该特性整体退役删除——清单就是清单,不再含网络探测。
2427
- */
2428
- listSources(): RegistrySourceConfig[];
2429
- addSource(name: string, url: string): void;
2430
- removeSource(name: string): void;
2431
- /**
2432
- * 启用/禁用某个 registry 源。
2433
- * - 官方源:仅写 disabled 标记进用户配置(保留 builtin/url 等元信息不变)。
2434
- * - 第三方源:改写用户配置中该条目的 disabled 字段;条目不存在则抛错。
2435
- */
2436
- setSourceEnabled(name: string, enabled: boolean): void;
2437
- /** 拉取全部启用源(缓存优先 → fetch → 陈旧缓存降级)。坏源跳过并记 warning。 */
2438
- loadAll(): Promise<{
2439
- registries: LoadedRegistry[];
2440
- warnings: string[];
2441
- }>;
2442
- private loadOne;
2443
- /** 缓存优先 → fetch → 陈旧缓存降级(URL 源与 npm 包源共用)。 */
2444
- private loadWithCache;
2445
- private readUserSources;
2446
- private writeUserSources;
2447
- private readCache;
2448
- private writeCache;
2449
- }
2450
384
  //#endregion
2451
- export { type ContentType, type GitUpgradeCheckResult, type InstallOptions, type InstallProgress, type InstallResult, type InstallScope, type InstallSourceMetadata, type InstalledItem, type ListInstalledOptions, type LoadedRegistry, type ParsedRegistry, type PostInstallContext, type PostInstallResult, type ProgressPhase, type RegistriesFile, RegistryClient, type RegistryEntry, type RegistryEntryType, type RegistrySourceConfig, type ResolvedSource, type SourceType, type UninstallOptions, type UninstallResult, type UninstallTarget, type UpgradeCheckOptions, type UpgradeCheckResult, type VersionInfo, builtinOfficialSource, checkArchiveBomb, checkGitUpgrades, checkUpgrades, cleanTempDir, createArchive, createTempDir, detectUninstallTarget, extractArchive, install, installSkill, listInstalledItems, parseRegistry, registryEntrySchema, registryEntryTypeSchema, registrySchema, sanitizeSourceUrl, scanInstalledVersions, uninstall, validateExtractedPaths };
2452
- //# sourceMappingURL=index.d.ts.map
385
+ export { CREDENTIAL_ISSUE_CODE, type ContributionRiskClass, type ContributionValidator, type ContributionValidatorRegistry, type DevExtensionAction, type DevExtensionPort, ID_PATTERN, Install, type InstallComponentOptions, type InstallInteraction, InstallRetiringError, LEASE_WAIT_MS, MANIFEST_FILENAME, type ManifestValidationResult, type OfficialRegistry, PLUGIN_MANIFEST_BYTE_LIMIT, type PluginManifestRead, type PluginManifestReadResult, type PluginValidationContext, type PluginValidationIssue, type PluginValidationReport, type PromotionRefusal, type ReconcileInput, type RegistryEntry, type RollbackRefusal, RootLockBusyError, type RootLockWaitNotice, type SourceResolver, type TrustLedger, type TrustLedgerGrantInput, type TrustLedgerGrantOutcome, type TrustLedgerRecord, type TrustReconcileResult, UPDATE_FIELD_SPECS, classifyContributionRisk, createContributionValidatorRegistry, createInstallInteraction, createInstallService, createOfficialRegistry, createTrustLedger, credentialKeyNamed, currentPromotedVersionOf, extensionLine, isCredentialShaped, promotePlugin, promotedVersionsOf, readPluginManifest, readPluginManifestSync, readTrustLedger, readTrustLedgerForReconcile, readTrustLedgerState, readTrustRecord, reconcileTrust, recordPromotionOrigin, rollbackPromotion, validateCredentialShapes, validateManifest, validatePlugin, withRootWrite, writeTrustRecord };