@alexgorbatchev/dotfiles 0.0.1

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.
Files changed (36) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +397 -0
  3. package/cli-fj2hdbnx.js +5 -0
  4. package/cli-fj2hdbnx.js.map +9 -0
  5. package/cli-w822cqdk.js +4 -0
  6. package/cli-w822cqdk.js.map +10 -0
  7. package/cli.js +449 -0
  8. package/cli.js.map +283 -0
  9. package/dashboard-0ebz5sqb.js +159 -0
  10. package/dashboard-0ebz5sqb.js.map +102 -0
  11. package/dashboard-3axqywva.css +1 -0
  12. package/dashboard.js +13 -0
  13. package/package.json +63 -0
  14. package/prerender-kpxyx916.js +3 -0
  15. package/prerender-kpxyx916.js.map +11 -0
  16. package/schemas.d.ts +2730 -0
  17. package/skill/SKILL.md +74 -0
  18. package/skill/references/api-reference.md +614 -0
  19. package/skill/references/configuration.md +1154 -0
  20. package/skill/references/installation-methods/brew.md +62 -0
  21. package/skill/references/installation-methods/cargo.md +86 -0
  22. package/skill/references/installation-methods/curl-binary.md +73 -0
  23. package/skill/references/installation-methods/curl-script.md +132 -0
  24. package/skill/references/installation-methods/curl-tar.md +58 -0
  25. package/skill/references/installation-methods/dmg.md +113 -0
  26. package/skill/references/installation-methods/gitea-release.md +106 -0
  27. package/skill/references/installation-methods/github-release.md +97 -0
  28. package/skill/references/installation-methods/manual.md +74 -0
  29. package/skill/references/installation-methods/npm.md +75 -0
  30. package/skill/references/installation-methods/overview.md +293 -0
  31. package/skill/references/installation-methods/zsh-plugin.md +156 -0
  32. package/skill/references/make-tool.md +866 -0
  33. package/skill/references/shell-and-hooks.md +833 -0
  34. package/tool-types.d.ts +14 -0
  35. package/wasm-n3cagcre.js +3 -0
  36. package/wasm-n3cagcre.js.map +10 -0
package/schemas.d.ts ADDED
@@ -0,0 +1,2730 @@
1
+ // Generated by dts-bundle-generator v9.5.1
2
+
3
+ import { z } from 'zod';
4
+
5
+ type Resolvable<TParams, TReturn> = TReturn | ((params: TParams) => TReturn) | ((params: TParams) => Promise<TReturn>);
6
+ /**
7
+ * Strips common leading whitespace from all lines in a string.
8
+ * This is useful for cleaning up template literals that are indented for readability.
9
+ *
10
+ * @param str - The string to dedent
11
+ * @returns The dedented string with common leading whitespace removed
12
+ *
13
+ * @example
14
+ * ```typescript
15
+ * const indented = `
16
+ * function hello() {
17
+ * echo "Hello World"
18
+ * }
19
+ * `;
20
+ *
21
+ * const dedented = dedentString(indented);
22
+ * // Result:
23
+ * // function hello() {
24
+ * // echo "Hello World"
25
+ * // }
26
+ * ```
27
+ */
28
+ export declare function dedentString(str: string): string;
29
+ /**
30
+ * Processes a template string by removing common indentation and replacing placeholders with values.
31
+ *
32
+ * This function:
33
+ * - Removes common leading whitespace using the dedent function
34
+ * - Replaces standalone placeholders (e.g., {key}) with properly indented multiline values
35
+ * - Replaces inline placeholders within text with their corresponding values
36
+ *
37
+ * @param template - The template string containing placeholders in the format {key}
38
+ * @param values - An object mapping placeholder keys to their replacement values
39
+ * @returns The processed string with proper indentation and replaced placeholders
40
+ */
41
+ export declare function dedentTemplate(template: string, values: Record<string, string>): string;
42
+ interface IFileSystem {
43
+ /**
44
+ * Reads the entire content of a file.
45
+ * @param path - A path to a file.
46
+ * @param encoding - The encoding to use.
47
+ * @returns A promise that resolves with the file content as a string.
48
+ */
49
+ readFile(path: string, encoding?: BufferEncoding): Promise<string>;
50
+ /**
51
+ * Reads the entire content of a file.
52
+ * @param path - A path to a file.
53
+ * @returns A promise that resolves with the file content as a Buffer.
54
+ */
55
+ readFileBuffer(path: string): Promise<Buffer>;
56
+ /**
57
+ * Asynchronously writes data to a file, replacing the file if it already exists.
58
+ * @param path - A path to a file.
59
+ * @param content - The content to write.
60
+ * @param encoding - The encoding to use.
61
+ * @returns A promise that resolves when the file has been written.
62
+ */
63
+ writeFile(path: string, content: string | NodeJS.ArrayBufferView, encoding?: BufferEncoding): Promise<void>;
64
+ /**
65
+ * Checks if a file or directory exists.
66
+ * @param path - A path to a file or directory.
67
+ * @returns A promise that resolves with `true` if the path exists, `false` otherwise.
68
+ */
69
+ exists(path: string): Promise<boolean>;
70
+ /**
71
+ * Asynchronously creates a directory.
72
+ * @param path - A path to a directory.
73
+ * @param options - Options for creating the directory.
74
+ * @returns A promise that resolves when the directory has been created.
75
+ */
76
+ mkdir(path: string, options?: {
77
+ recursive?: boolean;
78
+ }): Promise<void>;
79
+ /**
80
+ * Reads the contents of a directory.
81
+ * @param path - A path to a directory.
82
+ * @returns A promise that resolves with an array of file and directory names.
83
+ */
84
+ readdir(path: string): Promise<string[]>;
85
+ /**
86
+ * Removes a file or directory.
87
+ * @param path - A path to a file or directory.
88
+ * @param options - Options for removal.
89
+ * @returns A promise that resolves when the file or directory has been removed.
90
+ */
91
+ rm(path: string, options?: {
92
+ recursive?: boolean;
93
+ force?: boolean;
94
+ }): Promise<void>;
95
+ /**
96
+ * Asynchronously removes a directory.
97
+ * @param path - A path to a directory.
98
+ * @param options - Options for removing the directory.
99
+ * @returns A promise that resolves when the directory has been removed.
100
+ * @deprecated Use {@link IFileSystem.rm} with `recursive: true` instead.
101
+ */
102
+ rmdir(path: string, options?: {
103
+ recursive?: boolean;
104
+ }): Promise<void>;
105
+ /**
106
+ * Gets file or directory stats.
107
+ * @param path - A path to a file or directory.
108
+ * @returns A promise that resolves with the {@link NodeStats} object.
109
+ */
110
+ stat(path: string): Promise<NodeStats>;
111
+ /**
112
+ * Gets file or directory stats without following symbolic links.
113
+ * @param path - A path to a file or directory.
114
+ * @returns A promise that resolves with the {@link NodeStats} object for the link itself.
115
+ */
116
+ lstat(path: string): Promise<NodeStats>;
117
+ /**
118
+ * Creates a symbolic link.
119
+ * @param target - A path the symbolic link will point to.
120
+ * @param path - A path where the symbolic link will be created.
121
+ * @param type - The type of symbolic link ('file', 'dir', or 'junction').
122
+ * @returns A promise that resolves when the symbolic link has been created.
123
+ */
124
+ symlink(target: string, path: string, type?: "file" | "dir" | "junction"): Promise<void>;
125
+ /**
126
+ * Reads the value of a symbolic link.
127
+ * @param path - A path to a symbolic link.
128
+ * @returns A promise that resolves with the target path as a string.
129
+ */
130
+ readlink(path: string): Promise<string>;
131
+ /**
132
+ * Changes the permissions of a file or directory.
133
+ * @param path - A path to a file or directory.
134
+ * @param mode - The permissions mode (e.g., `0o755`).
135
+ * @returns A promise that resolves when the permissions have been changed.
136
+ */
137
+ chmod(path: string, mode: number | string): Promise<void>;
138
+ /**
139
+ * Asynchronously copies a file.
140
+ * @param src - The source file path.
141
+ * @param dest - The destination file path.
142
+ * @param flags - Optional flags for the copy operation.
143
+ * @returns A promise that resolves when the file has been copied.
144
+ */
145
+ copyFile(src: string, dest: string, flags?: number): Promise<void>;
146
+ /**
147
+ * Asynchronously renames a file or directory.
148
+ * @param oldPath - The current path.
149
+ * @param newPath - The new path.
150
+ * @returns A promise that resolves when the rename operation is complete.
151
+ */
152
+ rename(oldPath: string, newPath: string): Promise<void>;
153
+ /**
154
+ * Ensures that a directory exists. If the directory structure does not exist, it is created.
155
+ * @param path - A path of the directory.
156
+ * @returns A promise that resolves when the directory exists.
157
+ */
158
+ ensureDir(path: string): Promise<void>;
159
+ }
160
+ type ReplaceInFileMode = "file" | "line";
161
+ type ReplaceCapture = string | undefined;
162
+ type ReplaceGroups = Record<string, string>;
163
+ interface IReplaceInFileMatch {
164
+ substring: string;
165
+ captures: ReplaceCapture[];
166
+ offset: number;
167
+ input: string;
168
+ groups?: ReplaceGroups;
169
+ }
170
+ type ReplaceInFileReplacer = Resolvable<IReplaceInFileMatch, string>;
171
+ type ReplaceInFilePattern = RegExp | string;
172
+ declare const projectConfigSchema: z.ZodObject<{
173
+ paths: z.ZodDefault<z.ZodObject<{
174
+ homeDir: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
175
+ dotfilesDir: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
176
+ targetDir: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
177
+ generatedDir: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
178
+ toolConfigsDir: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
179
+ shellScriptsDir: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
180
+ binariesDir: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
181
+ }, z.core.$strict>>;
182
+ system: z.ZodDefault<z.ZodObject<{
183
+ sudoPrompt: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
184
+ }, z.core.$strict>>;
185
+ logging: z.ZodDefault<z.ZodObject<{
186
+ debug: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
187
+ }, z.core.$strict>>;
188
+ updates: z.ZodDefault<z.ZodObject<{
189
+ checkOnRun: z.ZodNonOptional<z.ZodDefault<z.ZodBoolean>>;
190
+ checkInterval: z.ZodNonOptional<z.ZodDefault<z.ZodNumber>>;
191
+ }, z.core.$strict>>;
192
+ github: z.ZodDefault<z.ZodObject<{
193
+ host: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
194
+ cache: z.ZodNonOptional<z.ZodDefault<z.ZodObject<{
195
+ enabled: z.ZodDefault<z.ZodBoolean>;
196
+ ttl: z.ZodDefault<z.ZodNumber>;
197
+ }, z.core.$strict>>>;
198
+ token: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
199
+ userAgent: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
200
+ }, z.core.$strict>>;
201
+ cargo: z.ZodDefault<z.ZodObject<{
202
+ cratesIo: z.ZodNonOptional<z.ZodDefault<z.ZodObject<{
203
+ host: z.ZodDefault<z.ZodString>;
204
+ cache: z.ZodDefault<z.ZodObject<{
205
+ enabled: z.ZodDefault<z.ZodBoolean>;
206
+ ttl: z.ZodDefault<z.ZodNumber>;
207
+ }, z.core.$strict>>;
208
+ token: z.ZodDefault<z.ZodString>;
209
+ userAgent: z.ZodDefault<z.ZodString>;
210
+ }, z.core.$strict>>>;
211
+ githubRaw: z.ZodNonOptional<z.ZodDefault<z.ZodObject<{
212
+ host: z.ZodDefault<z.ZodString>;
213
+ cache: z.ZodDefault<z.ZodObject<{
214
+ enabled: z.ZodDefault<z.ZodBoolean>;
215
+ ttl: z.ZodDefault<z.ZodNumber>;
216
+ }, z.core.$strict>>;
217
+ token: z.ZodDefault<z.ZodString>;
218
+ userAgent: z.ZodDefault<z.ZodString>;
219
+ }, z.core.$strict>>>;
220
+ githubRelease: z.ZodNonOptional<z.ZodDefault<z.ZodObject<{
221
+ host: z.ZodDefault<z.ZodString>;
222
+ cache: z.ZodDefault<z.ZodObject<{
223
+ enabled: z.ZodDefault<z.ZodBoolean>;
224
+ ttl: z.ZodDefault<z.ZodNumber>;
225
+ }, z.core.$strict>>;
226
+ token: z.ZodDefault<z.ZodString>;
227
+ userAgent: z.ZodDefault<z.ZodString>;
228
+ }, z.core.$strict>>>;
229
+ userAgent: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
230
+ }, z.core.$strict>>;
231
+ downloader: z.ZodDefault<z.ZodObject<{
232
+ timeout: z.ZodNonOptional<z.ZodDefault<z.ZodNumber>>;
233
+ retryCount: z.ZodNonOptional<z.ZodDefault<z.ZodNumber>>;
234
+ retryDelay: z.ZodNonOptional<z.ZodDefault<z.ZodNumber>>;
235
+ cache: z.ZodNonOptional<z.ZodDefault<z.ZodObject<{
236
+ enabled: z.ZodDefault<z.ZodBoolean>;
237
+ ttl: z.ZodDefault<z.ZodNumber>;
238
+ }, z.core.$strict>>>;
239
+ }, z.core.$strict>>;
240
+ features: z.ZodDefault<z.ZodObject<{
241
+ catalog: z.ZodDefault<z.ZodObject<{
242
+ generate: z.ZodDefault<z.ZodBoolean>;
243
+ filePath: z.ZodDefault<z.ZodString>;
244
+ }, z.core.$strict>>;
245
+ shellInstall: z.ZodOptional<z.ZodObject<{
246
+ zsh: z.ZodOptional<z.ZodString>;
247
+ bash: z.ZodOptional<z.ZodString>;
248
+ powershell: z.ZodOptional<z.ZodString>;
249
+ }, z.core.$strict>>;
250
+ }, z.core.$strict>>;
251
+ platform: z.ZodOptional<z.ZodArray<z.ZodObject<{
252
+ match: z.ZodArray<z.ZodUnion<readonly [
253
+ z.ZodObject<{
254
+ os: z.ZodEnum<{
255
+ linux: "linux";
256
+ macos: "macos";
257
+ windows: "windows";
258
+ }>;
259
+ arch: z.ZodOptional<z.ZodEnum<{
260
+ arm64: "arm64";
261
+ x86_64: "x86_64";
262
+ }>>;
263
+ }, z.core.$strict>,
264
+ z.ZodObject<{
265
+ os: z.ZodOptional<z.ZodEnum<{
266
+ linux: "linux";
267
+ macos: "macos";
268
+ windows: "windows";
269
+ }>>;
270
+ arch: z.ZodEnum<{
271
+ arm64: "arm64";
272
+ x86_64: "x86_64";
273
+ }>;
274
+ }, z.core.$strict>
275
+ ]>>;
276
+ config: z.ZodObject<{
277
+ paths: z.ZodOptional<z.ZodOptional<z.ZodObject<{
278
+ homeDir: z.ZodOptional<z.ZodDefault<z.ZodString>>;
279
+ dotfilesDir: z.ZodOptional<z.ZodDefault<z.ZodString>>;
280
+ targetDir: z.ZodOptional<z.ZodDefault<z.ZodString>>;
281
+ generatedDir: z.ZodOptional<z.ZodDefault<z.ZodString>>;
282
+ toolConfigsDir: z.ZodOptional<z.ZodDefault<z.ZodString>>;
283
+ shellScriptsDir: z.ZodOptional<z.ZodDefault<z.ZodString>>;
284
+ binariesDir: z.ZodOptional<z.ZodDefault<z.ZodString>>;
285
+ }, z.core.$strict>>>;
286
+ system: z.ZodOptional<z.ZodOptional<z.ZodObject<{
287
+ sudoPrompt: z.ZodOptional<z.ZodDefault<z.ZodString>>;
288
+ }, z.core.$strict>>>;
289
+ logging: z.ZodOptional<z.ZodOptional<z.ZodObject<{
290
+ debug: z.ZodOptional<z.ZodDefault<z.ZodString>>;
291
+ }, z.core.$strict>>>;
292
+ updates: z.ZodOptional<z.ZodOptional<z.ZodObject<{
293
+ checkOnRun: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
294
+ checkInterval: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
295
+ }, z.core.$strict>>>;
296
+ github: z.ZodOptional<z.ZodOptional<z.ZodObject<{
297
+ host: z.ZodOptional<z.ZodDefault<z.ZodString>>;
298
+ cache: z.ZodOptional<z.ZodDefault<z.ZodObject<{
299
+ enabled: z.ZodDefault<z.ZodBoolean>;
300
+ ttl: z.ZodDefault<z.ZodNumber>;
301
+ }, z.core.$strict>>>;
302
+ token: z.ZodOptional<z.ZodDefault<z.ZodString>>;
303
+ userAgent: z.ZodOptional<z.ZodDefault<z.ZodString>>;
304
+ }, z.core.$strict>>>;
305
+ cargo: z.ZodOptional<z.ZodOptional<z.ZodObject<{
306
+ cratesIo: z.ZodOptional<z.ZodDefault<z.ZodObject<{
307
+ host: z.ZodDefault<z.ZodString>;
308
+ cache: z.ZodDefault<z.ZodObject<{
309
+ enabled: z.ZodDefault<z.ZodBoolean>;
310
+ ttl: z.ZodDefault<z.ZodNumber>;
311
+ }, z.core.$strict>>;
312
+ token: z.ZodDefault<z.ZodString>;
313
+ userAgent: z.ZodDefault<z.ZodString>;
314
+ }, z.core.$strict>>>;
315
+ githubRaw: z.ZodOptional<z.ZodDefault<z.ZodObject<{
316
+ host: z.ZodDefault<z.ZodString>;
317
+ cache: z.ZodDefault<z.ZodObject<{
318
+ enabled: z.ZodDefault<z.ZodBoolean>;
319
+ ttl: z.ZodDefault<z.ZodNumber>;
320
+ }, z.core.$strict>>;
321
+ token: z.ZodDefault<z.ZodString>;
322
+ userAgent: z.ZodDefault<z.ZodString>;
323
+ }, z.core.$strict>>>;
324
+ githubRelease: z.ZodOptional<z.ZodDefault<z.ZodObject<{
325
+ host: z.ZodDefault<z.ZodString>;
326
+ cache: z.ZodDefault<z.ZodObject<{
327
+ enabled: z.ZodDefault<z.ZodBoolean>;
328
+ ttl: z.ZodDefault<z.ZodNumber>;
329
+ }, z.core.$strict>>;
330
+ token: z.ZodDefault<z.ZodString>;
331
+ userAgent: z.ZodDefault<z.ZodString>;
332
+ }, z.core.$strict>>>;
333
+ userAgent: z.ZodOptional<z.ZodDefault<z.ZodString>>;
334
+ }, z.core.$strict>>>;
335
+ downloader: z.ZodOptional<z.ZodOptional<z.ZodObject<{
336
+ timeout: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
337
+ retryCount: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
338
+ retryDelay: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
339
+ cache: z.ZodOptional<z.ZodDefault<z.ZodObject<{
340
+ enabled: z.ZodDefault<z.ZodBoolean>;
341
+ ttl: z.ZodDefault<z.ZodNumber>;
342
+ }, z.core.$strict>>>;
343
+ }, z.core.$strict>>>;
344
+ features: z.ZodOptional<z.ZodOptional<z.ZodObject<{
345
+ catalog: z.ZodOptional<z.ZodDefault<z.ZodObject<{
346
+ generate: z.ZodDefault<z.ZodBoolean>;
347
+ filePath: z.ZodDefault<z.ZodString>;
348
+ }, z.core.$strict>>>;
349
+ shellInstall: z.ZodOptional<z.ZodOptional<z.ZodObject<{
350
+ zsh: z.ZodOptional<z.ZodString>;
351
+ bash: z.ZodOptional<z.ZodString>;
352
+ powershell: z.ZodOptional<z.ZodString>;
353
+ }, z.core.$strict>>>;
354
+ }, z.core.$strict>>>;
355
+ }, z.core.$strict>;
356
+ }, z.core.$strict>>>;
357
+ }, z.core.$strict>;
358
+ type ProjectConfigPartial = PartialDeep<ProjectConfig>;
359
+ declare const privateProjectConfigFields: z.ZodObject<{
360
+ configFilePath: z.ZodString;
361
+ configFileDir: z.ZodString;
362
+ }, z.core.$strip>;
363
+ type ProjectConfig = z.infer<typeof projectConfigSchema> & z.infer<typeof privateProjectConfigFields>;
364
+ /**
365
+ * Represents operating system platforms using a bitwise enum, allowing for
366
+ * combinations of multiple platforms.
367
+ *
368
+ * @example
369
+ * ```typescript
370
+ * const supported = Platform.Linux | Platform.MacOS;
371
+ * if (supported & Platform.Linux) {
372
+ * // Supported on Linux
373
+ * }
374
+ * ```
375
+ */
376
+ export declare enum Platform {
377
+ /** Represents no specific platform. */
378
+ None = 0,
379
+ /** The Linux operating system. */
380
+ Linux = 1,
381
+ /** The macOS operating system. */
382
+ MacOS = 2,
383
+ /** The Windows operating system. */
384
+ Windows = 4,
385
+ /** A combination of Unix-like systems (Linux and macOS). */
386
+ Unix = 3,
387
+ /** A combination of all supported platforms. */
388
+ All = 7
389
+ }
390
+ /**
391
+ * Represents CPU architectures using a bitwise enum, allowing for combinations.
392
+ *
393
+ * @example
394
+ * ```typescript
395
+ * const supported = Architecture.X86_64 | Architecture.Arm64;
396
+ * if (supported & Architecture.Arm64) {
397
+ * // Supported on ARM64
398
+ * }
399
+ * ```
400
+ */
401
+ export declare enum Architecture {
402
+ /** Represents no specific architecture. */
403
+ None = 0,
404
+ /** The 64-bit x86 architecture (also known as AMD64). */
405
+ X86_64 = 1,
406
+ /** The 64-bit ARM architecture. */
407
+ Arm64 = 2,
408
+ /** A combination of all supported architectures. */
409
+ All = 3
410
+ }
411
+ /**
412
+ * Represents essential system information used for architecture detection and compatibility checks.
413
+ * This information is typically derived from the operating system's properties.
414
+ * It is used as input, for example, to `getArchitectureRegex` for testability via Dependency Injection.
415
+ */
416
+ interface ISystemInfo {
417
+ /**
418
+ * The operating system platform.
419
+ */
420
+ platform: Platform;
421
+ /**
422
+ * The CPU architecture.
423
+ */
424
+ arch: Architecture;
425
+ /**
426
+ * The user's home directory path.
427
+ * Corresponds to the value returned by `os.homedir()` in Node.js.
428
+ * Used for expanding tilde (~) in file paths.
429
+ */
430
+ homeDir: string;
431
+ /**
432
+ * The machine hostname.
433
+ * Corresponds to the value returned by `os.hostname()` in Node.js.
434
+ * Used for hostname-based tool filtering.
435
+ */
436
+ hostname: string;
437
+ }
438
+ interface IToolLog {
439
+ /**
440
+ * Log a trace-level message (most verbose).
441
+ * @param message - The message to log
442
+ */
443
+ trace(message: string): void;
444
+ /**
445
+ * Log a debug-level message.
446
+ * @param message - The message to log
447
+ */
448
+ debug(message: string): void;
449
+ /**
450
+ * Log an info-level message.
451
+ * @param message - The message to log
452
+ */
453
+ info(message: string): void;
454
+ /**
455
+ * Log a warning-level message.
456
+ * @param message - The message to log
457
+ */
458
+ warn(message: string): void;
459
+ /**
460
+ * Log an error-level message.
461
+ * @param message - The message to log
462
+ * @param error - Optional error object to include in the log output
463
+ */
464
+ error(message: string, error?: unknown): void;
465
+ }
466
+ interface IBoundReplaceInFileOptions {
467
+ /** Optional. Defaults to `'file'` when not provided. */
468
+ mode?: ReplaceInFileMode;
469
+ /**
470
+ * Optional error message to log if no replacements were made.
471
+ *
472
+ * When provided and no matches are found, an error is logged with the tool name prefix:
473
+ * `[toolName] <errorMessage>`
474
+ *
475
+ * This is useful for detecting when expected patterns aren't found in config files.
476
+ *
477
+ * @example
478
+ * ```ts
479
+ * await ctx.replaceInFile(
480
+ * `${ctx.installedDir}/config.toml`,
481
+ * /theme = ".*"/,
482
+ * 'theme = "dark"',
483
+ * { errorMessage: 'Could not find theme setting in config.toml' }
484
+ * );
485
+ * ```
486
+ */
487
+ errorMessage?: string;
488
+ }
489
+ type BoundReplaceInFile = (filePath: string, from: ReplaceInFilePattern, to: ReplaceInFileReplacer, options?: IBoundReplaceInFileOptions) => Promise<boolean>;
490
+ type BoundResolve = (pattern: string) => string;
491
+ interface IBaseToolContext {
492
+ /**
493
+ * The user's parsed application configuration from the main `config.ts` file.
494
+ */
495
+ projectConfig: ProjectConfig;
496
+ /**
497
+ * Information about the system on which the installation is occurring
498
+ * (e.g., platform, architecture).
499
+ */
500
+ systemInfo: ISystemInfo;
501
+ /**
502
+ * The name of the tool currently being processed.
503
+ */
504
+ toolName: string;
505
+ /**
506
+ * Absolute path to the directory containing the tool's `.tool.ts` file.
507
+ *
508
+ * This is the **tool configuration directory**. It is the reference point for all
509
+ * relative paths in `.tool.ts` files (for example `./config.toml`, `./themes/`, etc.).
510
+ *
511
+ * This value is derived from the path to the `.tool.ts` file itself.
512
+ *
513
+ * @example
514
+ * If your tool config is located at:
515
+ * `"${projectConfig.paths.toolConfigsDir}/fzf/fzf.tool.ts"`
516
+ * then:
517
+ * `toolDir === "${projectConfig.paths.toolConfigsDir}/fzf"`
518
+ *
519
+ * @example
520
+ * Use `toolDir` to reference a file next to the tool config:
521
+ * `"${toolDir}/shell/key-bindings.zsh"`
522
+ */
523
+ toolDir: string;
524
+ /**
525
+ * Absolute path to the tool's stable "current" directory.
526
+ *
527
+ * This is always the path where the installer will create the `current` symlink:
528
+ * `"${projectConfig.paths.binariesDir}/${toolName}/current"`.
529
+ *
530
+ * Lifecycle note:
531
+ * - This path is always present on the context.
532
+ * - The directory/symlink on disk typically only exists **after a successful install**
533
+ * (i.e. from post-install hooks onward).
534
+ * - Hooks that run before installation must not assume it exists.
535
+ */
536
+ currentDir: string;
537
+ /**
538
+ * Performs a regex-based replacement within a file.
539
+ *
540
+ * Pre-bound with the resolved file system. See {@link BoundReplaceInFile} for full documentation.
541
+ *
542
+ * @returns `true` if replacements were made, `false` if no matches found
543
+ *
544
+ * @example
545
+ * ```ts
546
+ * // Replace all occurrences of 'foo' with 'bar'
547
+ * const wasReplaced = await ctx.replaceInFile('/path/to/file', /foo/, 'bar');
548
+ *
549
+ * // Line-by-line replacement with callback
550
+ * await ctx.replaceInFile('~/config.txt', /version=(\d+)/, (match) => {
551
+ * return `version=${Number(match.captures[0]) + 1}`;
552
+ * }, { mode: 'line' });
553
+ *
554
+ * // Log error if pattern not found
555
+ * await ctx.replaceInFile(
556
+ * '~/config.txt',
557
+ * /theme = ".*"/,
558
+ * 'theme = "dark"',
559
+ * { errorMessage: 'Could not find theme setting' }
560
+ * );
561
+ * ```
562
+ */
563
+ replaceInFile: BoundReplaceInFile;
564
+ /**
565
+ * A user-facing logger for logging messages from tool configurations and hooks.
566
+ *
567
+ * All log messages are automatically prefixed with `[toolName]` to identify which
568
+ * tool produced the output.
569
+ *
570
+ * @example
571
+ * ```ts
572
+ * export default defineTool((install, ctx) =>
573
+ * install('github-release', { repo: 'sharkdp/bat' })
574
+ * .bin('bat')
575
+ * .hook('after-install', async () => {
576
+ * ctx.log.info('Running post-install setup...');
577
+ * ctx.log.debug('Checking configuration files');
578
+ * })
579
+ * );
580
+ * ```
581
+ */
582
+ log: IToolLog;
583
+ /**
584
+ * Resolves a glob pattern to a single path.
585
+ *
586
+ * Use this when you need to reference a file or directory with a flexible name
587
+ * (e.g., versioned directories, platform-specific binaries) and expect exactly
588
+ * one match.
589
+ *
590
+ * The pattern is resolved relative to `toolDir` unless it's an absolute path.
591
+ * Returns the absolute path of the matched file or directory.
592
+ *
593
+ * **Throws** if zero matches or multiple matches are found (stops tool processing).
594
+ *
595
+ * @param pattern - Glob pattern to match
596
+ * @returns The resolved absolute path
597
+ *
598
+ * @example
599
+ * ```ts
600
+ * // Resolve a versioned directory
601
+ * const versionDir = ctx.resolve('ripgrep-*-x86_64-*');
602
+ *
603
+ * // Use in shell configuration
604
+ * export default defineTool((install, ctx) =>
605
+ * install('github-release', { repo: 'owner/tool' })
606
+ * .bin('tool')
607
+ * .zsh((shell) =>
608
+ * shell.always(`source "${ctx.resolve('completions/*.zsh')}"`))
609
+ * );
610
+ * ```
611
+ */
612
+ resolve: BoundResolve;
613
+ }
614
+ interface IExtractResult {
615
+ /** An array of absolute paths to all files that were successfully extracted. */
616
+ extractedFiles: string[];
617
+ /**
618
+ * An array of absolute paths to files that were identified as executables
619
+ * and had their permissions set accordingly.
620
+ */
621
+ executables: string[];
622
+ }
623
+ interface IGitHubReleaseAsset {
624
+ /** The name of the asset file (e.g., `mytool-linux-amd64.tar.gz`). */
625
+ name: string;
626
+ /** The direct URL for downloading the asset. */
627
+ browser_download_url: string;
628
+ /** The size of the asset in bytes. */
629
+ size: number;
630
+ /** The MIME type of the asset (e.g., `application/gzip`). */
631
+ content_type: string;
632
+ /** The state of the asset, typically 'uploaded'. */
633
+ state: "uploaded" | "open";
634
+ /** The number of times this asset has been downloaded. */
635
+ download_count: number;
636
+ /** An ISO 8601 timestamp string for when the asset was created. */
637
+ created_at: string;
638
+ /** An ISO 8601 timestamp string for when the asset was last updated. */
639
+ updated_at: string;
640
+ }
641
+ interface IGitHubRelease {
642
+ /** The unique identifier for the release. */
643
+ id: number;
644
+ /** The tag name associated with the release (e.g., `v1.0.0`). */
645
+ tag_name: string;
646
+ /** The display name of the release (e.g., `Version 1.0.0`). */
647
+ name: string;
648
+ /** `true` if the release is a draft (unpublished); `false` otherwise. */
649
+ draft: boolean;
650
+ /** `true` if the release is marked as a pre-release; `false` otherwise. */
651
+ prerelease: boolean;
652
+ /** An ISO 8601 timestamp string for when the release was created. */
653
+ created_at: string;
654
+ /** An ISO 8601 timestamp string for when the release was published. Can be `null` for drafts. */
655
+ published_at: string;
656
+ /** An array of {@link IGitHubReleaseAsset} objects associated with this release. */
657
+ assets: IGitHubReleaseAsset[];
658
+ /** The release notes or description, often in Markdown format. */
659
+ body?: string;
660
+ /** The URL to view this release on the GitHub website. */
661
+ html_url: string;
662
+ }
663
+ interface ShellResult {
664
+ /** Exit code of the process */
665
+ code: number;
666
+ /** Stdout as string */
667
+ stdout: string;
668
+ /** Stderr as string */
669
+ stderr: string;
670
+ }
671
+ interface ShellCommand extends PromiseLike<ShellResult> {
672
+ /** Set working directory */
673
+ cwd(path: string): ShellCommand;
674
+ /** Set/merge environment variables */
675
+ env(vars: Record<string, string | undefined>): ShellCommand;
676
+ /** Suppress output logging (command still logged) */
677
+ quiet(): ShellCommand;
678
+ /** Don't throw on non-zero exit code, return result with code instead */
679
+ noThrow(): ShellCommand;
680
+ /** Get stdout as trimmed string */
681
+ text(): Promise<string>;
682
+ /** Parse stdout as JSON */
683
+ json<T = unknown>(): Promise<T>;
684
+ /** Get stdout as array of lines */
685
+ lines(): Promise<string[]>;
686
+ /** Get stdout as bytes */
687
+ bytes(): Promise<Uint8Array>;
688
+ }
689
+ interface Shell {
690
+ (strings: TemplateStringsArray, ...values: unknown[]): ShellCommand;
691
+ (command: string): ShellCommand;
692
+ }
693
+ interface IEnvContext {
694
+ /** Project configuration with paths and settings */
695
+ projectConfig: ProjectConfig;
696
+ /**
697
+ * The absolute path to the temporary staging directory for this installation attempt.
698
+ * After successful installation, the entire directory is renamed to the versioned path.
699
+ */
700
+ stagingDir: string;
701
+ }
702
+ interface IInstallBaseContext extends IBaseToolContext {
703
+ /**
704
+ * The full tool configuration being processed.
705
+ *
706
+ * This is the resolved `ToolConfig` for the current tool, including any platform-specific overrides.
707
+ */
708
+ toolConfig: ToolConfig;
709
+ /**
710
+ * A timestamp for the current installation attempt.
711
+ *
712
+ * Used as a stable identifier for this run and as a fallback version label when a version
713
+ * cannot be resolved.
714
+ *
715
+ * @example
716
+ * `timestamp === "2025-12-23-09-41-12"`
717
+ */
718
+ timestamp: string;
719
+ /**
720
+ * Bun's shell executor for running shell commands that inherit the current environment.
721
+ *
722
+ * Use the `$` tagged template literal to execute shell commands within hooks.
723
+ * The working directory can be changed using `cd` commands or `process.chdir()`.
724
+ */
725
+ $: Shell;
726
+ /**
727
+ * An instance of the file system for performing file operations.
728
+ */
729
+ fileSystem: IFileSystem;
730
+ /**
731
+ * The installation environment variables.
732
+ *
733
+ * This includes the recursion guard and modified PATH for the current installation.
734
+ * Used internally by HookExecutor to create shells with output streaming while
735
+ * preserving the installation environment.
736
+ */
737
+ installEnv?: Record<string, string | undefined>;
738
+ }
739
+ interface IInstallContext extends IInstallBaseContext {
740
+ /**
741
+ * Per-attempt staging directory for this installation attempt.
742
+ *
743
+ * This is a transient workspace for download/extract/build steps and may be removed or renamed
744
+ * after installation. Do not persist references to this directory.
745
+ *
746
+ * For successful managed installs, this directory is typically renamed to `installedDir`.
747
+ *
748
+ * @example
749
+ * `stagingDir === "${projectConfig.paths.binariesDir}/${toolName}/<uuid>"`
750
+ */
751
+ stagingDir: string;
752
+ }
753
+ interface IDownloadContext extends IInstallContext {
754
+ /**
755
+ * The path to the downloaded file or archive.
756
+ *
757
+ * This is the on-disk artifact produced by the download step (e.g., a `.tar.gz`, `.zip`, or
758
+ * standalone binary) stored under the current `stagingDir`.
759
+ *
760
+ * @example
761
+ * `downloadPath === "${stagingDir}/downloads/tool.tar.gz"`
762
+ */
763
+ downloadPath: string;
764
+ }
765
+ interface IExtractContext extends IDownloadContext {
766
+ /**
767
+ * The path to the directory where the archive contents were extracted.
768
+ *
769
+ * This is a transient directory under `stagingDir` containing the extracted payload.
770
+ * Hooks commonly move binaries out of this directory into a stable layout under `stagingDir`
771
+ * before the installer finalizes the installation.
772
+ *
773
+ * @example
774
+ * `extractDir === "${stagingDir}/extracted"`
775
+ */
776
+ extractDir: string;
777
+ /**
778
+ * The result of the archive extraction process.
779
+ *
780
+ * Contains extraction metadata such as which files were extracted.
781
+ */
782
+ extractResult: IExtractResult;
783
+ }
784
+ interface IAfterInstallContext extends IInstallBaseContext {
785
+ /**
786
+ * The final installation directory.
787
+ *
788
+ * For managed installers, this is versioned when a version is known.
789
+ * For externally managed installers (e.g., Homebrew), this is typically the tool's
790
+ * managed directory under the tool root (e.g., `external`).
791
+ *
792
+ * `currentDir` is repointed to this directory after a successful install.
793
+ *
794
+ * @example
795
+ * Managed: `installedDir === "${projectConfig.paths.binariesDir}/${toolName}/1.2.3"`
796
+ *
797
+ * @example
798
+ * External: `installedDir === "${projectConfig.paths.binariesDir}/${toolName}/external"`
799
+ */
800
+ installedDir: string;
801
+ /**
802
+ * Absolute paths to installed binaries.
803
+ *
804
+ * These paths point at the *real* installed executables for this successful install.
805
+ * For multi-binary tools, this can include multiple entries.
806
+ *
807
+ * If you need a single “primary” binary, use `binaryPaths[0]`.
808
+ *
809
+ * @example
810
+ * Single binary: `binaryPaths === ["${installedDir}/rg"]`
811
+ *
812
+ * @example
813
+ * Multi-binary: `binaryPaths === ["${installedDir}/node", "${installedDir}/npm", "${installedDir}/npx"]`
814
+ */
815
+ binaryPaths: string[];
816
+ /**
817
+ * The version of the installed tool.
818
+ *
819
+ * This is populated when the installer can determine a version (e.g., from a release tag
820
+ * or an installer-specific version source). For externally managed installers, or when
821
+ * the version cannot be resolved, this may be `undefined`.
822
+ *
823
+ * @example
824
+ * `version === "1.2.3"`
825
+ */
826
+ version?: string;
827
+ }
828
+ type AsyncInstallHook<T extends IInstallBaseContext = IInstallContext> = {
829
+ bivarianceHack(context: T): Promise<void>;
830
+ }["bivarianceHack"];
831
+ type OnceScript = {
832
+ readonly kind: "once";
833
+ readonly value: string;
834
+ };
835
+ type AlwaysScript = {
836
+ readonly kind: "always";
837
+ readonly value: string;
838
+ };
839
+ type RawScript = {
840
+ readonly kind: "raw";
841
+ readonly value: string;
842
+ };
843
+ type ShellScript = OnceScript | AlwaysScript | RawScript;
844
+ type Primitive = string | number | bigint | boolean | symbol | undefined | null;
845
+ type DeepPartialArray<T extends readonly unknown[]> = number extends T["length"] ? readonly PartialDeep<T[number]>[] : {
846
+ [K in keyof T]?: PartialDeep<T[K]>;
847
+ };
848
+ type DeepPartialSet<T> = T extends Set<infer TValue> ? Set<PartialDeep<TValue>> : T extends ReadonlySet<infer TValue> ? ReadonlySet<PartialDeep<TValue>> : never;
849
+ type DeepPartialMap<T> = T extends Map<infer TKey, infer TValue> ? Map<TKey, PartialDeep<TValue>> : T extends ReadonlyMap<infer TKey, infer TValue> ? ReadonlyMap<TKey, PartialDeep<TValue>> : never;
850
+ type DeepPartialObject<T extends object> = {
851
+ [K in keyof T]?: PartialDeep<T[K]>;
852
+ };
853
+ type PartialDeep<T> = T extends Primitive ? T : T extends (...args: infer TArgs) => infer TResult ? (...args: TArgs) => TResult : T extends Promise<infer TValue> ? Promise<PartialDeep<TValue>> : T extends readonly unknown[] ? DeepPartialArray<T> : T extends Set<unknown> | ReadonlySet<unknown> ? DeepPartialSet<T> : T extends Map<unknown, unknown> | ReadonlyMap<unknown, unknown> ? DeepPartialMap<T> : T extends object ? DeepPartialObject<T> : Partial<T>;
854
+ /**
855
+ * Registry of plugin install parameter types - plugins extend this interface via module augmentation
856
+ *
857
+ * @example
858
+ * ```typescript
859
+ * // In your plugin file
860
+ * declare module '@dotfiles/core' {
861
+ * interface IInstallParamsRegistry {
862
+ * 'github-release': GithubReleaseInstallParams;
863
+ * }
864
+ * }
865
+ * ```
866
+ */
867
+ interface IInstallParamsRegistry {
868
+ }
869
+ interface IToolConfigRegistry {
870
+ }
871
+ type ToolConfig = IToolConfigRegistry extends Record<string, never> ? never : IToolConfigRegistry[keyof IToolConfigRegistry];
872
+ interface ICompletionContext {
873
+ /**
874
+ * The installed version of the tool.
875
+ *
876
+ * Only available after `dotfiles install` completes successfully.
877
+ * Contains the actual resolved version (e.g., `'15.1.0'`), not the configured
878
+ * version which may be `'latest'`.
879
+ *
880
+ * @example
881
+ * '15.1.0'
882
+ * 'v0.26.1'
883
+ */
884
+ version: string;
885
+ }
886
+ interface IShellCompletionConfigBase {
887
+ /**
888
+ * Binary name for shell-specific completion filename.
889
+ *
890
+ * Applies naming conventions: `_bin` for zsh, `bin.bash` for bash.
891
+ * Use when tool name differs from binary name.
892
+ *
893
+ * Equivalent bash:
894
+ * ```bash
895
+ * # bin: 'fnm' → output filename
896
+ * # zsh: _fnm
897
+ * # bash: fnm.bash
898
+ * ```
899
+ *
900
+ * @example 'fnm' → '_fnm' for zsh
901
+ */
902
+ bin?: string;
903
+ }
904
+ interface IShellCompletionSourceConfig extends IShellCompletionConfigBase {
905
+ /**
906
+ * Path to an existing completion file.
907
+ *
908
+ * - **Relative** (e.g., `_tool.zsh`) → resolved from `toolDir` (next to `.tool.ts`)
909
+ * - **Absolute** (e.g., `${ctx.currentDir}/completions/_tool`) → used as-is
910
+ *
911
+ * For files extracted from archives, use `ctx.currentDir` to build the absolute path.
912
+ *
913
+ * Equivalent bash:
914
+ * ```bash
915
+ * # Relative: '_tool.zsh' resolves to toolDir (next to .tool.ts)
916
+ * ln -s ${ctx.toolDir}/_tool.zsh ${ctx.projectConfig.paths.shellScriptsDir}/{shell}/completions/_mytool
917
+ *
918
+ * # Extracted archive: ctx.currentDir = ${ctx.projectConfig.paths.installDir}/mytool/1.0.0
919
+ * ln -s ${ctx.currentDir}/completions/_tool ${ctx.projectConfig.paths.shellScriptsDir}/{shell}/completions/_mytool
920
+ * ```
921
+ *
922
+ * @example
923
+ * '_tool.zsh'
924
+ * `${ctx.currentDir}/completions/_tool`
925
+ */
926
+ source: string;
927
+ }
928
+ interface IShellCompletionCmdConfig extends IShellCompletionConfigBase {
929
+ /**
930
+ * Command to generate completion content dynamically.
931
+ *
932
+ * Executes in the tool's installation directory during shell script generation.
933
+ * The tool must be installed before this command can run.
934
+ *
935
+ * Equivalent bash:
936
+ * ```bash
937
+ * cd ${ctx.projectConfig.paths.installDir}/mytool/1.0.0
938
+ * ./bin/tool completion zsh > ${ctx.projectConfig.paths.shellScriptsDir}/{shell}/completions/_tool
939
+ * ```
940
+ *
941
+ * @example
942
+ * 'tool completion zsh'
943
+ * 'fnm completions --shell zsh'
944
+ */
945
+ cmd: string;
946
+ }
947
+ interface IShellCompletionUrlConfig extends IShellCompletionConfigBase {
948
+ /**
949
+ * URL to download the completion file or archive from.
950
+ *
951
+ * Supports both:
952
+ * - Direct completion files (e.g., `_tool.zsh`, `tool.bash`)
953
+ * - Archives (e.g., `.tar.gz`, `.zip`) which are automatically extracted
954
+ *
955
+ * The file/archive is downloaded to `ctx.currentDir`.
956
+ *
957
+ * Equivalent bash (archive):
958
+ * ```bash
959
+ * curl -fsSL "https://github.com/user/repo/releases/download/v1.0.0/completions.tar.gz" \
960
+ * -o ${ctx.projectConfig.paths.installDir}/mytool/1.0.0/completions.tar.gz
961
+ * tar -xzf completions.tar.gz -C ${ctx.projectConfig.paths.installDir}/mytool/1.0.0/
962
+ * ```
963
+ *
964
+ * Equivalent bash (direct file):
965
+ * ```bash
966
+ * curl -fsSL "https://raw.githubusercontent.com/user/repo/main/completions/_tool" \
967
+ * -o ${ctx.projectConfig.paths.installDir}/mytool/1.0.0/_tool
968
+ * ```
969
+ *
970
+ * @example 'https://github.com/user/repo/releases/download/v1.0.0/completions.tar.gz'
971
+ * @example 'https://raw.githubusercontent.com/user/repo/main/completions/_tool'
972
+ */
973
+ url: string;
974
+ /**
975
+ * Path to the completion file.
976
+ *
977
+ * For archives: absolute path to the completion file within the extracted archive.
978
+ * For direct files: optional - if omitted, the filename is derived from the URL.
979
+ *
980
+ * The archive is extracted to `ctx.currentDir`, so use that to build the path.
981
+ *
982
+ * Equivalent bash (archive - source required):
983
+ * ```bash
984
+ * ln -s ${ctx.currentDir}/completions/_tool ${ctx.projectConfig.paths.shellScriptsDir}/{shell}/completions/_tool
985
+ * ```
986
+ *
987
+ * Equivalent bash (direct file - source omitted):
988
+ * ```bash
989
+ * # Filename '_tool' derived from URL
990
+ * ln -s ${ctx.currentDir}/_tool ${ctx.projectConfig.paths.shellScriptsDir}/{shell}/completions/_tool
991
+ * ```
992
+ *
993
+ * @example `${ctx.currentDir}/completions/_tool` - for archives
994
+ * @example undefined - for direct files (filename derived from URL)
995
+ */
996
+ source?: string;
997
+ }
998
+ type ShellCompletionConfigValue = string | IShellCompletionSourceConfig | IShellCompletionCmdConfig | IShellCompletionUrlConfig;
999
+ type ShellCompletionConfigInput = Resolvable<ICompletionContext, ShellCompletionConfigValue>;
1000
+ interface IShellConfigurator<KnownFunctions extends string = never> {
1001
+ /**
1002
+ * Sets environment variables for the shell.
1003
+ *
1004
+ * **Note**: To modify PATH, use `shell.path()` instead. Setting PATH via
1005
+ * env() is prohibited to ensure proper deduplication.
1006
+ *
1007
+ * @param values - A record of environment variable names and values.
1008
+ */
1009
+ env<T extends Record<string, string>>(values: "PATH" extends keyof T ? [
1010
+ "ERROR: Use shell.path() to modify PATH"
1011
+ ] : T): IShellConfigurator<KnownFunctions>;
1012
+ /**
1013
+ * Sets shell aliases.
1014
+ * @param values - A record of alias names and their commands.
1015
+ */
1016
+ aliases(values: Record<string, string>): IShellConfigurator<KnownFunctions>;
1017
+ /**
1018
+ * Sources a script file during shell initialization.
1019
+ *
1020
+ * - **Relative paths** → resolve to `toolDir` (directory containing `.tool.ts`)
1021
+ * - **Absolute paths** → used as-is
1022
+ * - **Files from downloaded archives** (GitHub releases, tarballs) are extracted to
1023
+ * `ctx.currentDir`. Use this to build an absolute path: `${ctx.currentDir}/init.sh`
1024
+ *
1025
+ * Equivalent bash:
1026
+ * ```bash
1027
+ * # Relative: 'init.sh' resolves to toolDir (next to .tool.ts)
1028
+ * source ${ctx.toolDir}/init.sh
1029
+ *
1030
+ * # Extracted archive: ctx.currentDir = ${ctx.projectConfig.paths.installDir}/mytool/1.0.0
1031
+ * source ${ctx.currentDir}/init.sh
1032
+ * ```
1033
+ *
1034
+ * @param relativePath - Path to the script file relative to the tool directory.
1035
+ *
1036
+ * @example
1037
+ * shell.sourceFile('init.zsh')
1038
+ * shell.sourceFile(`${ctx.currentDir}/shell/init.sh`)
1039
+ */
1040
+ sourceFile(relativePath: string): IShellConfigurator<KnownFunctions>;
1041
+ /**
1042
+ * Sources the output of a shell function defined via `functions()`.
1043
+ * The function must be defined before this call via `.functions({ fnName: '...' })`.
1044
+ *
1045
+ * **Important**: When a function is used with `sourceFunction()`, its body must
1046
+ * **output shell code to stdout**. This output is then sourced (executed) in the
1047
+ * current shell. Common tools like `fnm`, `pyenv`, `rbenv`, and `zoxide` have
1048
+ * commands that print shell code for this purpose.
1049
+ *
1050
+ * Unlike `sourceFile()`, this does NOT check if the output exists and is NOT wrapped
1051
+ * in a subshell. It emits: `source <(fnName)`
1052
+ *
1053
+ * @param functionName - Name of a function defined via `.functions()`.
1054
+ *
1055
+ * @example
1056
+ * // fnm env --use-on-cd PRINTS shell code like:
1057
+ * // export FNM_DIR="/Users/me/.fnm"
1058
+ * // export PATH="...fnm/bin:$PATH"
1059
+ * shell.functions({ initFnm: 'fnm env --use-on-cd' })
1060
+ * shell.sourceFunction('initFnm')
1061
+ * // Generates: source <(initFnm)
1062
+ */
1063
+ sourceFunction(functionName: KnownFunctions): IShellConfigurator<KnownFunctions>;
1064
+ /**
1065
+ * Sources the output of inline shell code by wrapping it in a temporary function.
1066
+ * The content must **output shell code to stdout** - this output is then sourced.
1067
+ *
1068
+ * This is useful when you need to source the output of a command inline without
1069
+ * defining a named function via `functions()`.
1070
+ *
1071
+ * @param content - Shell code that **prints** shell code to stdout
1072
+ *
1073
+ * @example
1074
+ * // Content outputs "export MY_VAR=value" which gets sourced
1075
+ * shell.source('echo "export MY_VAR=value"')
1076
+ * // Generates:
1077
+ * // __dotfiles_source_toolname_0() {
1078
+ * // echo "export MY_VAR=value"
1079
+ * // }
1080
+ * // source <(__dotfiles_source_toolname_0)
1081
+ * // unset -f __dotfiles_source_toolname_0
1082
+ *
1083
+ * @example
1084
+ * // fnm env prints shell code like "export PATH=..." which gets sourced
1085
+ * shell.source('fnm env --use-on-cd')
1086
+ */
1087
+ source(content: string): IShellConfigurator<KnownFunctions>;
1088
+ /**
1089
+ * Configures shell completions from static files or generated dynamically.
1090
+ *
1091
+ * **Lifecycle**: All completions are generated only after the tool is installed.
1092
+ * This ensures cmd-based completions can execute the installed binary and callbacks
1093
+ * receive the actual installed version in `ctx.version`.
1094
+ *
1095
+ * - **Relative paths** → resolve to `toolDir` (directory containing `.tool.ts`)
1096
+ * - **Files from downloaded archives** (GitHub releases, tarballs) are extracted to
1097
+ * `ctx.currentDir`. Use this to build an absolute path.
1098
+ * - **Dynamic** → use `{ cmd: 'tool completion zsh' }`
1099
+ *
1100
+ * @param completion - Path string, config object, or callback
1101
+ *
1102
+ * @example
1103
+ * shell.completions('_tool.zsh')
1104
+ * shell.completions(`${ctx.currentDir}/completions/_tool`)
1105
+ * shell.completions({ cmd: 'tool completion zsh' })
1106
+ * shell.completions((ctx) => ({
1107
+ * url: `https://github.com/owner/repo/releases/download/${ctx.version}/completions.zsh`,
1108
+ * source: `${ctx.currentDir}/_tool`
1109
+ * }))
1110
+ */
1111
+ completions(completion: ShellCompletionConfigInput): IShellConfigurator<KnownFunctions>;
1112
+ /**
1113
+ * Adds a script to be executed once during shell initialization.
1114
+ * @param script - The script content.
1115
+ */
1116
+ once(script: string): IShellConfigurator<KnownFunctions>;
1117
+ /**
1118
+ * Adds a script to be executed always during shell initialization.
1119
+ * @param script - The script content.
1120
+ */
1121
+ always(script: string): IShellConfigurator<KnownFunctions>;
1122
+ /**
1123
+ * Defines shell functions.
1124
+ *
1125
+ * @param values - A record of function names to their body content.
1126
+ *
1127
+ * @example
1128
+ * shell.functions({
1129
+ * mycommand: 'echo "Running mycommand"'
1130
+ * })
1131
+ * // Generates:
1132
+ * // mycommand() {
1133
+ * // echo "Running mycommand"
1134
+ * // }
1135
+ */
1136
+ functions<K extends string>(values: Record<K, string>): IShellConfigurator<KnownFunctions | K>;
1137
+ /**
1138
+ * Adds a directory to the PATH environment variable.
1139
+ * Paths are deduplicated during shell init generation.
1140
+ *
1141
+ * @param pathValue - Directory path to add to PATH. May contain $HOME or other env vars.
1142
+ *
1143
+ * @example
1144
+ * shell.path('$HOME/.local/bin')
1145
+ * shell.path('${ctx.currentDir}/bin')
1146
+ */
1147
+ path(pathValue: Resolvable<void, string>): IShellConfigurator<KnownFunctions>;
1148
+ }
1149
+ type ShellConfiguratorSyncResult = IShellConfigurator<string> | undefined;
1150
+ type ShellConfiguratorAsyncResult = Promise<ShellConfiguratorSyncResult>;
1151
+ type ShellConfiguratorCallback = (shell: IShellConfigurator) => ShellConfiguratorSyncResult;
1152
+ type ShellConfiguratorAsyncCallback = (shell: IShellConfigurator) => ShellConfiguratorAsyncResult;
1153
+ /**
1154
+ * Known binary names for type-safe dependsOn() calls.
1155
+ * Generated tool type definitions augment this registry with string literal properties.
1156
+ * The fallback behaviour resolves to `string` when no binary names are registered.
1157
+ */
1158
+ interface IKnownBinNameRegistry {
1159
+ __placeholder__?: never;
1160
+ }
1161
+ type KnownBinNameKeys = Exclude<keyof IKnownBinNameRegistry, "__placeholder__">;
1162
+ type KnownBinName = [
1163
+ KnownBinNameKeys
1164
+ ] extends [
1165
+ never
1166
+ ] ? string : KnownBinNameKeys;
1167
+ type PluginEmittedHookEvent = "after-download" | "after-extract";
1168
+ type HookEventName = "before-install" | PluginEmittedHookEvent | "after-install";
1169
+ /**
1170
+ * Fluent builder interface for configuring a tool.
1171
+ * Returned by InstallFunction after selecting installer method.
1172
+ */
1173
+ export interface IToolConfigBuilder {
1174
+ /**
1175
+ * Define a binary that this tool provides.
1176
+ * @param name - The name of the binary executable
1177
+ * @param pattern - Optional glob pattern to locate the binary within extracted archives
1178
+ */
1179
+ bin(name: string, pattern?: string): this;
1180
+ /**
1181
+ * Set a specific version for this tool.
1182
+ * @param version - The version string (e.g., "1.2.3", "latest")
1183
+ */
1184
+ version(version: string): this;
1185
+ /**
1186
+ * Declare binary dependencies that must be installed before this tool.
1187
+ *
1188
+ * During generation, the system:
1189
+ * 1. Builds a dependency graph mapping binaries to their provider tools
1190
+ * 2. Validates that all dependencies exist and are unambiguous
1191
+ * 3. Detects circular dependencies and platform mismatches
1192
+ * 4. Topologically sorts tools so dependencies are processed first
1193
+ *
1194
+ * @param binaryNames - Names of binaries this tool depends on (from other tools' `.bin()` calls)
1195
+ */
1196
+ dependsOn(...binaryNames: KnownBinName[]): this;
1197
+ /**
1198
+ * Attach a hook handler to a specific lifecycle event.
1199
+ * Multiple handlers can be added by calling this method multiple times with the same event name.
1200
+ * @param event - The lifecycle event name (kebab-case)
1201
+ * @param handler - The async hook function to execute
1202
+ */
1203
+ hook(event: "before-install", handler: AsyncInstallHook<IInstallContext>): this;
1204
+ hook(event: "after-download", handler: AsyncInstallHook<IDownloadContext>): this;
1205
+ hook(event: "after-extract", handler: AsyncInstallHook<IExtractContext>): this;
1206
+ hook(event: "after-install", handler: AsyncInstallHook<IAfterInstallContext>): this;
1207
+ hook(event: HookEventName, handler: AsyncInstallHook<never>): this;
1208
+ /**
1209
+ * Configure zsh shell initialization for this tool.
1210
+ * @param callback - Function that receives shell configurator to add paths, aliases, env vars
1211
+ */
1212
+ zsh(callback: ShellConfiguratorCallback): this;
1213
+ zsh(callback: ShellConfiguratorAsyncCallback): Promise<this>;
1214
+ /**
1215
+ * Configure bash shell initialization for this tool.
1216
+ * @param callback - Function that receives shell configurator to add paths, aliases, env vars
1217
+ */
1218
+ bash(callback: ShellConfiguratorCallback): this;
1219
+ bash(callback: ShellConfiguratorAsyncCallback): Promise<this>;
1220
+ /**
1221
+ * Configure PowerShell initialization for this tool.
1222
+ * @param callback - Function that receives shell configurator to add paths, aliases, env vars
1223
+ */
1224
+ powershell(callback: ShellConfiguratorCallback): this;
1225
+ powershell(callback: ShellConfiguratorAsyncCallback): Promise<this>;
1226
+ /**
1227
+ * Create a symbolic link from source to target.
1228
+ * @param source - The source path (what to link from)
1229
+ * @param target - The target path (where to create the symlink)
1230
+ */
1231
+ symlink(source: string, target: string): this;
1232
+ /**
1233
+ * Copy a file or directory from source to target.
1234
+ * @param source - The source path (what to copy from)
1235
+ * @param target - The target path (where to copy to)
1236
+ */
1237
+ copy(source: string, target: string): this;
1238
+ /**
1239
+ * Add platform-specific configuration overrides.
1240
+ * @param platforms - Target platform(s): 'macos', 'linux', 'windows', or array
1241
+ * @param configure - Function to configure platform-specific settings
1242
+ */
1243
+ platform(platforms: Platform, configure: (install: IPlatformInstallFunction) => Omit<IPlatformConfigBuilder, "bin">): this;
1244
+ /**
1245
+ * Add platform and architecture-specific configuration overrides.
1246
+ * @param platforms - Target platform(s): 'macos', 'linux', 'windows', or array
1247
+ * @param architectures - Target architecture(s): 'x64', 'arm64', or array
1248
+ * @param configure - Function to configure platform-specific settings
1249
+ */
1250
+ platform(platforms: Platform, architectures: Architecture, configure: (install: IPlatformInstallFunction) => Omit<IPlatformConfigBuilder, "bin">): this;
1251
+ /**
1252
+ * Mark this tool as disabled.
1253
+ * A disabled tool is skipped during generation with a warning message.
1254
+ * Useful for temporarily disabling a tool without removing its configuration.
1255
+ */
1256
+ disable(): this;
1257
+ /**
1258
+ * Restrict this tool to specific hostnames.
1259
+ * When set, the tool is only installed on machines where the hostname matches.
1260
+ * @param pattern - A literal hostname string or regex pattern (e.g., "my-laptop" or /^work-.*$/)
1261
+ */
1262
+ hostname(pattern: string | RegExp): this;
1263
+ /**
1264
+ * Finalize and build the tool configuration.
1265
+ * Call this as the last method in the chain.
1266
+ * @returns The complete ToolConfig object
1267
+ */
1268
+ build(): ToolConfig;
1269
+ }
1270
+ interface IPlatformConfigBuilder {
1271
+ /**
1272
+ * Define a binary that this tool provides on this platform.
1273
+ * @param name - The name of the binary executable
1274
+ * @param pattern - Optional glob pattern to locate the binary within extracted archives
1275
+ */
1276
+ bin(name: string, pattern?: string): this;
1277
+ /**
1278
+ * Set a specific version for this tool on this platform.
1279
+ * @param version - The version string (e.g., "1.2.3", "latest")
1280
+ */
1281
+ version(version: string): this;
1282
+ /**
1283
+ * Declare binary dependencies for this platform.
1284
+ *
1285
+ * During generation, the system validates dependencies exist and orders tools
1286
+ * so that dependencies are processed first.
1287
+ *
1288
+ * @param binaryNames - Names of binaries this tool depends on (from other tools' `.bin()` calls)
1289
+ */
1290
+ dependsOn(...binaryNames: KnownBinName[]): this;
1291
+ /**
1292
+ * Attach a hook handler to a specific lifecycle event.
1293
+ * Multiple handlers can be added by calling this method multiple times with the same event name.
1294
+ * @param event - The lifecycle event name (kebab-case)
1295
+ * @param handler - The async hook function to execute
1296
+ */
1297
+ hook(event: "before-install", handler: AsyncInstallHook<IInstallContext>): this;
1298
+ hook(event: "after-download", handler: AsyncInstallHook<IDownloadContext>): this;
1299
+ hook(event: "after-extract", handler: AsyncInstallHook<IExtractContext>): this;
1300
+ hook(event: "after-install", handler: AsyncInstallHook<IAfterInstallContext>): this;
1301
+ hook(event: HookEventName, handler: AsyncInstallHook<never>): this;
1302
+ /**
1303
+ * Configure zsh shell initialization for this platform.
1304
+ * @param callback - Function that receives shell configurator
1305
+ */
1306
+ zsh(callback: ShellConfiguratorCallback): this;
1307
+ zsh(callback: ShellConfiguratorAsyncCallback): Promise<this>;
1308
+ /**
1309
+ * Configure bash shell initialization for this platform.
1310
+ * @param callback - Function that receives shell configurator
1311
+ */
1312
+ bash(callback: ShellConfiguratorCallback): this;
1313
+ bash(callback: ShellConfiguratorAsyncCallback): Promise<this>;
1314
+ /**
1315
+ * Configure PowerShell initialization for this platform.
1316
+ * @param callback - Function that receives shell configurator
1317
+ */
1318
+ powershell(callback: ShellConfiguratorCallback): this;
1319
+ powershell(callback: ShellConfiguratorAsyncCallback): Promise<this>;
1320
+ /**
1321
+ * Create a symbolic link from source to target.
1322
+ * @param source - The source path (what to link from)
1323
+ * @param target - The target path (where to create the symlink)
1324
+ */
1325
+ symlink(source: string, target: string): this;
1326
+ /**
1327
+ * Copy a file or directory from source to target.
1328
+ * @param source - The source path (what to copy from)
1329
+ * @param target - The target path (where to copy to)
1330
+ */
1331
+ copy(source: string, target: string): this;
1332
+ }
1333
+ /**
1334
+ * Map of installer methods to their parameter types.
1335
+ * Built dynamically from plugins via IInstallParamsRegistry module augmentation.
1336
+ */
1337
+ type InstallMethod = keyof IInstallParamsRegistry;
1338
+ interface INoBinMethodRegistry {
1339
+ __placeholder__?: never;
1340
+ }
1341
+ type NoBinMethodKeys = Exclude<keyof INoBinMethodRegistry, "__placeholder__">;
1342
+ interface INoParamsMethodRegistry {
1343
+ __placeholder__?: never;
1344
+ }
1345
+ type NoParamsMethodKeys = Exclude<keyof INoParamsMethodRegistry, "__placeholder__">;
1346
+ type ToolBuilderForMethod<M extends InstallMethod> = [
1347
+ M
1348
+ ] extends [
1349
+ NoBinMethodKeys
1350
+ ] ? Omit<IToolConfigBuilder, "bin"> : IToolConfigBuilder;
1351
+ type PlatformBuilderForMethod<M extends InstallMethod> = [
1352
+ M
1353
+ ] extends [
1354
+ NoBinMethodKeys
1355
+ ] ? Omit<IPlatformConfigBuilder, "bin"> : IPlatformConfigBuilder;
1356
+ interface InstallFunction {
1357
+ <M extends InstallMethod>(method: M, params: IInstallParamsRegistry[M]): ToolBuilderForMethod<M>;
1358
+ <M extends NoParamsMethodKeys & InstallMethod>(method: M): ToolBuilderForMethod<M>;
1359
+ (): IToolConfigBuilder;
1360
+ }
1361
+ interface IPlatformInstallFunction {
1362
+ <M extends InstallMethod>(method: M, params: IInstallParamsRegistry[M]): PlatformBuilderForMethod<M>;
1363
+ <M extends NoParamsMethodKeys & InstallMethod>(method: M): PlatformBuilderForMethod<M>;
1364
+ (): IPlatformConfigBuilder;
1365
+ }
1366
+ interface IToolConfigContext extends IBaseToolContext {
1367
+ }
1368
+ type AsyncConfigureTool = (install: InstallFunction, ctx: IToolConfigContext) => Promise<undefined | IToolConfigBuilder | Omit<IToolConfigBuilder, "bin"> | ToolConfig> | undefined | IToolConfigBuilder | Omit<IToolConfigBuilder, "bin"> | ToolConfig;
1369
+ declare const platformConfigSchema: z.ZodObject<{
1370
+ binaries: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [
1371
+ z.ZodString,
1372
+ z.ZodObject<{
1373
+ name: z.ZodString;
1374
+ pattern: z.ZodString;
1375
+ }, z.core.$strict>
1376
+ ]>>>;
1377
+ dependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
1378
+ disabled: z.ZodOptional<z.ZodBoolean>;
1379
+ hostname: z.ZodOptional<z.ZodString>;
1380
+ version: z.ZodOptional<z.ZodString>;
1381
+ shellConfigs: z.ZodOptional<z.ZodObject<{
1382
+ zsh: z.ZodOptional<z.ZodObject<{
1383
+ scripts: z.ZodOptional<z.ZodArray<z.ZodType<ShellScript, unknown, z.core.$ZodTypeInternals<ShellScript, unknown>>>>;
1384
+ aliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1385
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1386
+ functions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1387
+ paths: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
1388
+ completions: z.ZodOptional<z.ZodUnknown>;
1389
+ }, z.core.$strict>>;
1390
+ bash: z.ZodOptional<z.ZodObject<{
1391
+ scripts: z.ZodOptional<z.ZodArray<z.ZodType<ShellScript, unknown, z.core.$ZodTypeInternals<ShellScript, unknown>>>>;
1392
+ aliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1393
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1394
+ functions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1395
+ paths: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
1396
+ completions: z.ZodOptional<z.ZodUnknown>;
1397
+ }, z.core.$strict>>;
1398
+ powershell: z.ZodOptional<z.ZodObject<{
1399
+ scripts: z.ZodOptional<z.ZodArray<z.ZodType<ShellScript, unknown, z.core.$ZodTypeInternals<ShellScript, unknown>>>>;
1400
+ aliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1401
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1402
+ functions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1403
+ paths: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
1404
+ completions: z.ZodOptional<z.ZodUnknown>;
1405
+ }, z.core.$strict>>;
1406
+ }, z.core.$strict>>;
1407
+ symlinks: z.ZodOptional<z.ZodArray<z.ZodObject<{
1408
+ source: z.ZodString;
1409
+ target: z.ZodString;
1410
+ }, z.core.$strict>>>;
1411
+ copies: z.ZodOptional<z.ZodArray<z.ZodObject<{
1412
+ source: z.ZodString;
1413
+ target: z.ZodString;
1414
+ }, z.core.$strict>>>;
1415
+ updateCheck: z.ZodOptional<z.ZodObject<{
1416
+ enabled: z.ZodOptional<z.ZodBoolean>;
1417
+ constraint: z.ZodOptional<z.ZodString>;
1418
+ }, z.core.$strict>>;
1419
+ installationMethod: z.ZodOptional<z.ZodString>;
1420
+ installParams: z.ZodOptional<z.ZodUnknown>;
1421
+ }, z.core.$strict>;
1422
+ type PlatformConfig = Omit<z.infer<typeof platformConfigSchema>, "installationMethod" | "installParams"> & {
1423
+ installationMethod?: ToolConfig["installationMethod"];
1424
+ installParams?: ToolConfig["installParams"];
1425
+ };
1426
+ type InstallHook = AsyncInstallHook<IInstallBaseContext>;
1427
+ type BaseEnv = Resolvable<IEnvContext, Record<string, string>>;
1428
+ interface InstallHooks {
1429
+ /** Runs before any other installation steps (download, extract, main install command) begin. */
1430
+ "before-install"?: InstallHook[];
1431
+ /** Runs after download but before extraction or execution. */
1432
+ "after-download"?: InstallHook[];
1433
+ /** Runs after extraction but before the main binary is finalized. */
1434
+ "after-extract"?: InstallHook[];
1435
+ /** Runs after the main installation command completes. */
1436
+ "after-install"?: InstallHook[];
1437
+ }
1438
+ interface BaseInstallParams {
1439
+ /**
1440
+ * When true, the tool will be automatically installed during the `generate` command
1441
+ * if not already installed. This is useful for tools that must be installed before
1442
+ * shell initialization can be generated (e.g., zsh plugins that need to be sourced).
1443
+ */
1444
+ auto?: boolean;
1445
+ /**
1446
+ * A record of environment variables to be set specifically for the duration of this tool's installation process.
1447
+ * Can be a static object or a function that receives context and returns the object.
1448
+ */
1449
+ env?: BaseEnv;
1450
+ /**
1451
+ * A collection of optional asynchronous hook functions that can be executed at different stages
1452
+ * of the installation lifecycle.
1453
+ */
1454
+ hooks?: InstallHooks;
1455
+ }
1456
+ declare const platformConfigEntrySchema: z.ZodObject<{
1457
+ platforms: z.ZodNumber;
1458
+ architectures: z.ZodOptional<z.ZodNumber>;
1459
+ config: z.ZodUnknown;
1460
+ }, z.core.$strict>;
1461
+ type BasePlatformConfigEntry = z.infer<typeof platformConfigEntrySchema>;
1462
+ type PlatformConfigEntry = Omit<BasePlatformConfigEntry, "config"> & {
1463
+ config: PlatformConfig;
1464
+ };
1465
+ type InferToolConfigWithPlatforms<TSchema extends z.ZodType> = Omit<z.infer<TSchema>, "platformConfigs"> & {
1466
+ platformConfigs?: PlatformConfigEntry[];
1467
+ };
1468
+ /**
1469
+ * Parameters for installing a tool using Homebrew (`brew`).
1470
+ * This method is typically used on macOS and Linux (via Linuxbrew).
1471
+ * It involves running `brew install` commands.
1472
+ *
1473
+ * NOTE: This is an explicit interface (not z.infer) to ensure TypeScript fully resolves
1474
+ * the property names, which is required for proper `keyof` behavior in declaration files.
1475
+ */
1476
+ interface BrewInstallParams extends BaseInstallParams {
1477
+ /** The name of the Homebrew formula to install (e.g., `ripgrep`). */
1478
+ formula?: string;
1479
+ /** If `true`, the `formula` property is treated as a Homebrew Cask name. */
1480
+ cask?: boolean;
1481
+ /** An optional Homebrew tap or an array of taps. */
1482
+ tap?: string | string[];
1483
+ /** Arguments to pass to the binary to check the version. */
1484
+ versionArgs?: string[];
1485
+ /** Regex to extract version from output. */
1486
+ versionRegex?: string;
1487
+ }
1488
+ declare const brewToolConfigSchema: z.ZodObject<{
1489
+ binaries: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [
1490
+ z.ZodString,
1491
+ z.ZodObject<{
1492
+ name: z.ZodString;
1493
+ pattern: z.ZodString;
1494
+ }, z.core.$strict>
1495
+ ]>>>;
1496
+ dependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
1497
+ disabled: z.ZodOptional<z.ZodBoolean>;
1498
+ hostname: z.ZodOptional<z.ZodString>;
1499
+ shellConfigs: z.ZodOptional<z.ZodObject<{
1500
+ zsh: z.ZodOptional<z.ZodObject<{
1501
+ scripts: z.ZodOptional<z.ZodArray<z.ZodType<ShellScript, unknown, z.core.$ZodTypeInternals<ShellScript, unknown>>>>;
1502
+ aliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1503
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1504
+ functions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1505
+ paths: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
1506
+ completions: z.ZodOptional<z.ZodUnknown>;
1507
+ }, z.core.$strict>>;
1508
+ bash: z.ZodOptional<z.ZodObject<{
1509
+ scripts: z.ZodOptional<z.ZodArray<z.ZodType<ShellScript, unknown, z.core.$ZodTypeInternals<ShellScript, unknown>>>>;
1510
+ aliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1511
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1512
+ functions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1513
+ paths: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
1514
+ completions: z.ZodOptional<z.ZodUnknown>;
1515
+ }, z.core.$strict>>;
1516
+ powershell: z.ZodOptional<z.ZodObject<{
1517
+ scripts: z.ZodOptional<z.ZodArray<z.ZodType<ShellScript, unknown, z.core.$ZodTypeInternals<ShellScript, unknown>>>>;
1518
+ aliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1519
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1520
+ functions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1521
+ paths: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
1522
+ completions: z.ZodOptional<z.ZodUnknown>;
1523
+ }, z.core.$strict>>;
1524
+ }, z.core.$strict>>;
1525
+ symlinks: z.ZodOptional<z.ZodArray<z.ZodObject<{
1526
+ source: z.ZodString;
1527
+ target: z.ZodString;
1528
+ }, z.core.$strict>>>;
1529
+ copies: z.ZodOptional<z.ZodArray<z.ZodObject<{
1530
+ source: z.ZodString;
1531
+ target: z.ZodString;
1532
+ }, z.core.$strict>>>;
1533
+ updateCheck: z.ZodOptional<z.ZodObject<{
1534
+ enabled: z.ZodOptional<z.ZodBoolean>;
1535
+ constraint: z.ZodOptional<z.ZodString>;
1536
+ }, z.core.$strict>>;
1537
+ name: z.ZodString;
1538
+ version: z.ZodString;
1539
+ configFilePath: z.ZodOptional<z.ZodString>;
1540
+ platformConfigs: z.ZodOptional<z.ZodArray<z.ZodObject<{
1541
+ platforms: z.ZodNumber;
1542
+ architectures: z.ZodOptional<z.ZodNumber>;
1543
+ config: z.ZodUnknown;
1544
+ }, z.core.$strict>>>;
1545
+ installationMethod: z.ZodLiteral<"brew">;
1546
+ installParams: z.ZodObject<{
1547
+ auto: z.ZodOptional<z.ZodBoolean>;
1548
+ env: z.ZodOptional<z.ZodCustom<BaseEnv, BaseEnv>>;
1549
+ hooks: z.ZodOptional<z.ZodObject<{
1550
+ "before-install": z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodCustom<InstallHook, InstallHook>>>>;
1551
+ "after-download": z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodCustom<InstallHook, InstallHook>>>>;
1552
+ "after-extract": z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodCustom<InstallHook, InstallHook>>>>;
1553
+ "after-install": z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodCustom<InstallHook, InstallHook>>>>;
1554
+ }, z.core.$strip>>;
1555
+ formula: z.ZodOptional<z.ZodString>;
1556
+ cask: z.ZodOptional<z.ZodBoolean>;
1557
+ tap: z.ZodOptional<z.ZodUnion<readonly [
1558
+ z.ZodString,
1559
+ z.ZodArray<z.ZodString>
1560
+ ]>>;
1561
+ versionArgs: z.ZodOptional<z.ZodArray<z.ZodString>>;
1562
+ versionRegex: z.ZodOptional<z.ZodString>;
1563
+ }, z.core.$strict>;
1564
+ }, z.core.$strict>;
1565
+ type BrewToolConfig = InferToolConfigWithPlatforms<typeof brewToolConfigSchema>;
1566
+ interface IInstallParamsRegistry {
1567
+ brew: BrewInstallParams;
1568
+ }
1569
+ interface IToolConfigRegistry {
1570
+ brew: BrewToolConfig;
1571
+ }
1572
+ declare const cargoToolConfigSchema: z.ZodObject<{
1573
+ binaries: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [
1574
+ z.ZodString,
1575
+ z.ZodObject<{
1576
+ name: z.ZodString;
1577
+ pattern: z.ZodString;
1578
+ }, z.core.$strict>
1579
+ ]>>>;
1580
+ dependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
1581
+ disabled: z.ZodOptional<z.ZodBoolean>;
1582
+ hostname: z.ZodOptional<z.ZodString>;
1583
+ shellConfigs: z.ZodOptional<z.ZodObject<{
1584
+ zsh: z.ZodOptional<z.ZodObject<{
1585
+ scripts: z.ZodOptional<z.ZodArray<z.ZodType<ShellScript, unknown, z.core.$ZodTypeInternals<ShellScript, unknown>>>>;
1586
+ aliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1587
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1588
+ functions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1589
+ paths: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
1590
+ completions: z.ZodOptional<z.ZodUnknown>;
1591
+ }, z.core.$strict>>;
1592
+ bash: z.ZodOptional<z.ZodObject<{
1593
+ scripts: z.ZodOptional<z.ZodArray<z.ZodType<ShellScript, unknown, z.core.$ZodTypeInternals<ShellScript, unknown>>>>;
1594
+ aliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1595
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1596
+ functions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1597
+ paths: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
1598
+ completions: z.ZodOptional<z.ZodUnknown>;
1599
+ }, z.core.$strict>>;
1600
+ powershell: z.ZodOptional<z.ZodObject<{
1601
+ scripts: z.ZodOptional<z.ZodArray<z.ZodType<ShellScript, unknown, z.core.$ZodTypeInternals<ShellScript, unknown>>>>;
1602
+ aliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1603
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1604
+ functions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1605
+ paths: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
1606
+ completions: z.ZodOptional<z.ZodUnknown>;
1607
+ }, z.core.$strict>>;
1608
+ }, z.core.$strict>>;
1609
+ symlinks: z.ZodOptional<z.ZodArray<z.ZodObject<{
1610
+ source: z.ZodString;
1611
+ target: z.ZodString;
1612
+ }, z.core.$strict>>>;
1613
+ copies: z.ZodOptional<z.ZodArray<z.ZodObject<{
1614
+ source: z.ZodString;
1615
+ target: z.ZodString;
1616
+ }, z.core.$strict>>>;
1617
+ updateCheck: z.ZodOptional<z.ZodObject<{
1618
+ enabled: z.ZodOptional<z.ZodBoolean>;
1619
+ constraint: z.ZodOptional<z.ZodString>;
1620
+ }, z.core.$strict>>;
1621
+ name: z.ZodString;
1622
+ version: z.ZodString;
1623
+ configFilePath: z.ZodOptional<z.ZodString>;
1624
+ platformConfigs: z.ZodOptional<z.ZodArray<z.ZodObject<{
1625
+ platforms: z.ZodNumber;
1626
+ architectures: z.ZodOptional<z.ZodNumber>;
1627
+ config: z.ZodUnknown;
1628
+ }, z.core.$strict>>>;
1629
+ installationMethod: z.ZodLiteral<"cargo">;
1630
+ installParams: z.ZodObject<{
1631
+ auto: z.ZodOptional<z.ZodBoolean>;
1632
+ env: z.ZodOptional<z.ZodCustom<BaseEnv, BaseEnv>>;
1633
+ hooks: z.ZodOptional<z.ZodObject<{
1634
+ "before-install": z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodCustom<InstallHook, InstallHook>>>>;
1635
+ "after-download": z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodCustom<InstallHook, InstallHook>>>>;
1636
+ "after-extract": z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodCustom<InstallHook, InstallHook>>>>;
1637
+ "after-install": z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodCustom<InstallHook, InstallHook>>>>;
1638
+ }, z.core.$strip>>;
1639
+ crateName: z.ZodString;
1640
+ binarySource: z.ZodOptional<z.ZodEnum<{
1641
+ "cargo-quickinstall": "cargo-quickinstall";
1642
+ "github-releases": "github-releases";
1643
+ }>>;
1644
+ githubRepo: z.ZodOptional<z.ZodString>;
1645
+ assetPattern: z.ZodOptional<z.ZodString>;
1646
+ versionSource: z.ZodOptional<z.ZodEnum<{
1647
+ "cargo-toml": "cargo-toml";
1648
+ "crates-io": "crates-io";
1649
+ "github-releases": "github-releases";
1650
+ }>>;
1651
+ cargoTomlUrl: z.ZodOptional<z.ZodString>;
1652
+ }, z.core.$strict>;
1653
+ }, z.core.$strict>;
1654
+ /**
1655
+ * Installation parameters for Cargo-based tools using pre-compiled binaries.
1656
+ *
1657
+ * NOTE: This is an explicit interface (not z.infer) to ensure TypeScript fully resolves
1658
+ * the property names, which is required for proper `keyof` behavior in declaration files.
1659
+ */
1660
+ interface CargoInstallParams extends BaseInstallParams {
1661
+ /** The crate name */
1662
+ crateName: string;
1663
+ /** Source for binaries - either cargo-quickinstall or GitHub releases */
1664
+ binarySource?: "cargo-quickinstall" | "github-releases";
1665
+ /** GitHub repository for the crate (required for github-releases source). Format: "owner/repo" */
1666
+ githubRepo?: string;
1667
+ /** Asset pattern for GitHub releases. Supports placeholders: {version}, {platform}, {arch}, {crateName} */
1668
+ assetPattern?: string;
1669
+ /** Version source - where to get the version information */
1670
+ versionSource?: "cargo-toml" | "crates-io" | "github-releases";
1671
+ /** Custom Cargo.toml URL if different from standard GitHub location */
1672
+ cargoTomlUrl?: string;
1673
+ }
1674
+ type CargoToolConfig = InferToolConfigWithPlatforms<typeof cargoToolConfigSchema>;
1675
+ interface IInstallParamsRegistry {
1676
+ cargo: CargoInstallParams;
1677
+ }
1678
+ interface IToolConfigRegistry {
1679
+ cargo: CargoToolConfig;
1680
+ }
1681
+ interface ICurlScriptArgsContext extends IEnvContext {
1682
+ /** Project configuration with paths and settings */
1683
+ projectConfig: ProjectConfig;
1684
+ /**
1685
+ * The absolute path to the downloaded installation script file on the local file system.
1686
+ * The script is downloaded from the URL specified in `installParams.url`, saved to the
1687
+ * staging directory, and made executable (chmod +x). This file is preserved after
1688
+ * installation completes (moved along with the staging directory to the versioned path).
1689
+ *
1690
+ * Example: `${stagingDir}/<tool-name>-install.sh`
1691
+ */
1692
+ scriptPath: string;
1693
+ /**
1694
+ * The absolute path to the temporary staging directory for this installation attempt.
1695
+ * The downloaded installation script (`scriptPath`) is saved here, along with any files
1696
+ * the script or your code creates during installation. After successful installation,
1697
+ * the entire directory is renamed to the versioned path (e.g., `<tool-name>/1.2.3`),
1698
+ * preserving all contents.
1699
+ *
1700
+ * Example: `${projectConfig.paths.binariesDir}/<tool-name>/<uuid>`
1701
+ */
1702
+ stagingDir: string;
1703
+ }
1704
+ type CurlScriptArgs = Resolvable<ICurlScriptArgsContext, string[]>;
1705
+ type CurlScriptEnv = Resolvable<ICurlScriptArgsContext, Record<string, string>>;
1706
+ /**
1707
+ * Parameters for installing a tool by downloading and executing a shell script using `curl`.
1708
+ *
1709
+ * NOTE: This is an explicit interface (not z.infer) to ensure TypeScript fully resolves
1710
+ * the property names, which is required for proper `keyof` behavior in declaration files.
1711
+ * Uses Omit because `env` has a more specific type than BaseInstallParams.env.
1712
+ */
1713
+ interface CurlScriptInstallParams extends Omit<BaseInstallParams, "env"> {
1714
+ /** The URL of the installation script to download. */
1715
+ url: string;
1716
+ /** The shell to use for executing the downloaded script. */
1717
+ shell: "bash" | "sh";
1718
+ /** Arguments to pass to the script - can be static array or function returning array. */
1719
+ args?: CurlScriptArgs;
1720
+ /** Environment variables to pass to the script - can be static object or function returning object. */
1721
+ env?: CurlScriptEnv;
1722
+ /** Arguments to pass to the binary to check the version. */
1723
+ versionArgs?: string[];
1724
+ /** Regex to extract version from output. */
1725
+ versionRegex?: string;
1726
+ }
1727
+ declare const curlScriptToolConfigSchema: z.ZodObject<{
1728
+ dependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
1729
+ disabled: z.ZodOptional<z.ZodBoolean>;
1730
+ hostname: z.ZodOptional<z.ZodString>;
1731
+ shellConfigs: z.ZodOptional<z.ZodObject<{
1732
+ zsh: z.ZodOptional<z.ZodObject<{
1733
+ scripts: z.ZodOptional<z.ZodArray<z.ZodType<ShellScript, unknown, z.core.$ZodTypeInternals<ShellScript, unknown>>>>;
1734
+ aliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1735
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1736
+ functions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1737
+ paths: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
1738
+ completions: z.ZodOptional<z.ZodUnknown>;
1739
+ }, z.core.$strict>>;
1740
+ bash: z.ZodOptional<z.ZodObject<{
1741
+ scripts: z.ZodOptional<z.ZodArray<z.ZodType<ShellScript, unknown, z.core.$ZodTypeInternals<ShellScript, unknown>>>>;
1742
+ aliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1743
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1744
+ functions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1745
+ paths: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
1746
+ completions: z.ZodOptional<z.ZodUnknown>;
1747
+ }, z.core.$strict>>;
1748
+ powershell: z.ZodOptional<z.ZodObject<{
1749
+ scripts: z.ZodOptional<z.ZodArray<z.ZodType<ShellScript, unknown, z.core.$ZodTypeInternals<ShellScript, unknown>>>>;
1750
+ aliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1751
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1752
+ functions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1753
+ paths: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
1754
+ completions: z.ZodOptional<z.ZodUnknown>;
1755
+ }, z.core.$strict>>;
1756
+ }, z.core.$strict>>;
1757
+ symlinks: z.ZodOptional<z.ZodArray<z.ZodObject<{
1758
+ source: z.ZodString;
1759
+ target: z.ZodString;
1760
+ }, z.core.$strict>>>;
1761
+ copies: z.ZodOptional<z.ZodArray<z.ZodObject<{
1762
+ source: z.ZodString;
1763
+ target: z.ZodString;
1764
+ }, z.core.$strict>>>;
1765
+ updateCheck: z.ZodOptional<z.ZodObject<{
1766
+ enabled: z.ZodOptional<z.ZodBoolean>;
1767
+ constraint: z.ZodOptional<z.ZodString>;
1768
+ }, z.core.$strict>>;
1769
+ name: z.ZodString;
1770
+ version: z.ZodString;
1771
+ configFilePath: z.ZodOptional<z.ZodString>;
1772
+ platformConfigs: z.ZodOptional<z.ZodArray<z.ZodObject<{
1773
+ platforms: z.ZodNumber;
1774
+ architectures: z.ZodOptional<z.ZodNumber>;
1775
+ config: z.ZodUnknown;
1776
+ }, z.core.$strict>>>;
1777
+ installationMethod: z.ZodLiteral<"curl-script">;
1778
+ installParams: z.ZodObject<{
1779
+ auto: z.ZodOptional<z.ZodBoolean>;
1780
+ hooks: z.ZodOptional<z.ZodObject<{
1781
+ "before-install": z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodCustom<InstallHook, InstallHook>>>>;
1782
+ "after-download": z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodCustom<InstallHook, InstallHook>>>>;
1783
+ "after-extract": z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodCustom<InstallHook, InstallHook>>>>;
1784
+ "after-install": z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodCustom<InstallHook, InstallHook>>>>;
1785
+ }, z.core.$strip>>;
1786
+ url: z.ZodString;
1787
+ shell: z.ZodEnum<{
1788
+ bash: "bash";
1789
+ sh: "sh";
1790
+ }>;
1791
+ args: z.ZodOptional<z.ZodCustom<CurlScriptArgs, CurlScriptArgs>>;
1792
+ env: z.ZodOptional<z.ZodCustom<CurlScriptEnv, CurlScriptEnv>>;
1793
+ versionArgs: z.ZodOptional<z.ZodArray<z.ZodString>>;
1794
+ versionRegex: z.ZodOptional<z.ZodString>;
1795
+ }, z.core.$strict>;
1796
+ binaries: z.ZodArray<z.ZodUnion<readonly [
1797
+ z.ZodString,
1798
+ z.ZodObject<{
1799
+ name: z.ZodString;
1800
+ pattern: z.ZodString;
1801
+ }, z.core.$strict>
1802
+ ]>>;
1803
+ }, z.core.$strict>;
1804
+ type CurlScriptToolConfig = InferToolConfigWithPlatforms<typeof curlScriptToolConfigSchema>;
1805
+ interface IInstallParamsRegistry {
1806
+ "curl-script": CurlScriptInstallParams;
1807
+ }
1808
+ interface IToolConfigRegistry {
1809
+ "curl-script": CurlScriptToolConfig;
1810
+ }
1811
+ /**
1812
+ * Parameters for installing a tool by downloading a tarball (`.tar`, `.tar.gz`, etc.) using `curl`,
1813
+ * then extracting it and potentially moving a binary from within.
1814
+ *
1815
+ * NOTE: This is an explicit interface (not z.infer) to ensure TypeScript fully resolves
1816
+ * the property names, which is required for proper `keyof` behavior in declaration files.
1817
+ */
1818
+ interface CurlTarInstallParams extends BaseInstallParams {
1819
+ /** The URL of the tarball to download. */
1820
+ url: string;
1821
+ /** Arguments to pass to the binary to check the version. */
1822
+ versionArgs?: string[];
1823
+ /** Regex to extract version from output. */
1824
+ versionRegex?: string;
1825
+ }
1826
+ declare const curlTarToolConfigSchema: z.ZodObject<{
1827
+ dependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
1828
+ disabled: z.ZodOptional<z.ZodBoolean>;
1829
+ hostname: z.ZodOptional<z.ZodString>;
1830
+ shellConfigs: z.ZodOptional<z.ZodObject<{
1831
+ zsh: z.ZodOptional<z.ZodObject<{
1832
+ scripts: z.ZodOptional<z.ZodArray<z.ZodType<ShellScript, unknown, z.core.$ZodTypeInternals<ShellScript, unknown>>>>;
1833
+ aliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1834
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1835
+ functions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1836
+ paths: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
1837
+ completions: z.ZodOptional<z.ZodUnknown>;
1838
+ }, z.core.$strict>>;
1839
+ bash: z.ZodOptional<z.ZodObject<{
1840
+ scripts: z.ZodOptional<z.ZodArray<z.ZodType<ShellScript, unknown, z.core.$ZodTypeInternals<ShellScript, unknown>>>>;
1841
+ aliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1842
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1843
+ functions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1844
+ paths: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
1845
+ completions: z.ZodOptional<z.ZodUnknown>;
1846
+ }, z.core.$strict>>;
1847
+ powershell: z.ZodOptional<z.ZodObject<{
1848
+ scripts: z.ZodOptional<z.ZodArray<z.ZodType<ShellScript, unknown, z.core.$ZodTypeInternals<ShellScript, unknown>>>>;
1849
+ aliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1850
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1851
+ functions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1852
+ paths: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
1853
+ completions: z.ZodOptional<z.ZodUnknown>;
1854
+ }, z.core.$strict>>;
1855
+ }, z.core.$strict>>;
1856
+ symlinks: z.ZodOptional<z.ZodArray<z.ZodObject<{
1857
+ source: z.ZodString;
1858
+ target: z.ZodString;
1859
+ }, z.core.$strict>>>;
1860
+ copies: z.ZodOptional<z.ZodArray<z.ZodObject<{
1861
+ source: z.ZodString;
1862
+ target: z.ZodString;
1863
+ }, z.core.$strict>>>;
1864
+ updateCheck: z.ZodOptional<z.ZodObject<{
1865
+ enabled: z.ZodOptional<z.ZodBoolean>;
1866
+ constraint: z.ZodOptional<z.ZodString>;
1867
+ }, z.core.$strict>>;
1868
+ name: z.ZodString;
1869
+ version: z.ZodString;
1870
+ configFilePath: z.ZodOptional<z.ZodString>;
1871
+ platformConfigs: z.ZodOptional<z.ZodArray<z.ZodObject<{
1872
+ platforms: z.ZodNumber;
1873
+ architectures: z.ZodOptional<z.ZodNumber>;
1874
+ config: z.ZodUnknown;
1875
+ }, z.core.$strict>>>;
1876
+ installationMethod: z.ZodLiteral<"curl-tar">;
1877
+ installParams: z.ZodObject<{
1878
+ auto: z.ZodOptional<z.ZodBoolean>;
1879
+ env: z.ZodOptional<z.ZodCustom<BaseEnv, BaseEnv>>;
1880
+ hooks: z.ZodOptional<z.ZodObject<{
1881
+ "before-install": z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodCustom<InstallHook, InstallHook>>>>;
1882
+ "after-download": z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodCustom<InstallHook, InstallHook>>>>;
1883
+ "after-extract": z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodCustom<InstallHook, InstallHook>>>>;
1884
+ "after-install": z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodCustom<InstallHook, InstallHook>>>>;
1885
+ }, z.core.$strip>>;
1886
+ url: z.ZodString;
1887
+ versionArgs: z.ZodOptional<z.ZodArray<z.ZodString>>;
1888
+ versionRegex: z.ZodOptional<z.ZodString>;
1889
+ }, z.core.$strict>;
1890
+ binaries: z.ZodArray<z.ZodUnion<readonly [
1891
+ z.ZodString,
1892
+ z.ZodObject<{
1893
+ name: z.ZodString;
1894
+ pattern: z.ZodString;
1895
+ }, z.core.$strict>
1896
+ ]>>;
1897
+ }, z.core.$strict>;
1898
+ type CurlTarToolConfig = InferToolConfigWithPlatforms<typeof curlTarToolConfigSchema>;
1899
+ interface IInstallParamsRegistry {
1900
+ "curl-tar": CurlTarInstallParams;
1901
+ }
1902
+ interface IToolConfigRegistry {
1903
+ "curl-tar": CurlTarToolConfig;
1904
+ }
1905
+ type AssetPattern = string | RegExp;
1906
+ interface IAssetSelectionContext extends IInstallContext {
1907
+ /** Available release assets to choose from */
1908
+ assets: IGitHubReleaseAsset[];
1909
+ /** The GitHub release being processed */
1910
+ release: IGitHubRelease;
1911
+ /** Asset pattern from configuration (if provided) */
1912
+ assetPattern?: AssetPattern;
1913
+ }
1914
+ type AssetSelector = (context: IAssetSelectionContext) => IGitHubReleaseAsset | undefined;
1915
+ /**
1916
+ * Parameters for installing a tool from a GitHub Release.
1917
+ *
1918
+ * NOTE: This is an explicit interface (not z.infer) to ensure TypeScript fully resolves
1919
+ * the property names, which is required for proper `keyof` behavior in declaration files.
1920
+ */
1921
+ interface GithubReleaseInstallParams extends BaseInstallParams {
1922
+ /**
1923
+ * The GitHub repository in "owner/repo" format (e.g., `junegunn/fzf`).
1924
+ */
1925
+ repo: string;
1926
+ /**
1927
+ * A glob pattern or regular expression used to match the desired asset filename.
1928
+ * Example: `*linux_amd64.tar.gz` or `/fzf-.*-linux_amd64\.tar\.gz/`.
1929
+ */
1930
+ assetPattern?: string | RegExp;
1931
+ /**
1932
+ * A specific version string (e.g., `v1.2.3`, `0.48.0`) or a SemVer constraint.
1933
+ */
1934
+ version?: string;
1935
+ /**
1936
+ * A custom function to select the desired asset from available release assets.
1937
+ */
1938
+ assetSelector?: AssetSelector;
1939
+ /**
1940
+ * When true, uses the `gh` CLI for GitHub API requests instead of direct fetch.
1941
+ */
1942
+ ghCli?: boolean;
1943
+ /**
1944
+ * When true, includes prerelease versions when fetching the latest release.
1945
+ */
1946
+ prerelease?: boolean;
1947
+ }
1948
+ declare const githubReleaseToolConfigSchema: z.ZodObject<{
1949
+ dependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
1950
+ disabled: z.ZodOptional<z.ZodBoolean>;
1951
+ hostname: z.ZodOptional<z.ZodString>;
1952
+ shellConfigs: z.ZodOptional<z.ZodObject<{
1953
+ zsh: z.ZodOptional<z.ZodObject<{
1954
+ scripts: z.ZodOptional<z.ZodArray<z.ZodType<ShellScript, unknown, z.core.$ZodTypeInternals<ShellScript, unknown>>>>;
1955
+ aliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1956
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1957
+ functions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1958
+ paths: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
1959
+ completions: z.ZodOptional<z.ZodUnknown>;
1960
+ }, z.core.$strict>>;
1961
+ bash: z.ZodOptional<z.ZodObject<{
1962
+ scripts: z.ZodOptional<z.ZodArray<z.ZodType<ShellScript, unknown, z.core.$ZodTypeInternals<ShellScript, unknown>>>>;
1963
+ aliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1964
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1965
+ functions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1966
+ paths: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
1967
+ completions: z.ZodOptional<z.ZodUnknown>;
1968
+ }, z.core.$strict>>;
1969
+ powershell: z.ZodOptional<z.ZodObject<{
1970
+ scripts: z.ZodOptional<z.ZodArray<z.ZodType<ShellScript, unknown, z.core.$ZodTypeInternals<ShellScript, unknown>>>>;
1971
+ aliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1972
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1973
+ functions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1974
+ paths: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
1975
+ completions: z.ZodOptional<z.ZodUnknown>;
1976
+ }, z.core.$strict>>;
1977
+ }, z.core.$strict>>;
1978
+ symlinks: z.ZodOptional<z.ZodArray<z.ZodObject<{
1979
+ source: z.ZodString;
1980
+ target: z.ZodString;
1981
+ }, z.core.$strict>>>;
1982
+ copies: z.ZodOptional<z.ZodArray<z.ZodObject<{
1983
+ source: z.ZodString;
1984
+ target: z.ZodString;
1985
+ }, z.core.$strict>>>;
1986
+ updateCheck: z.ZodOptional<z.ZodObject<{
1987
+ enabled: z.ZodOptional<z.ZodBoolean>;
1988
+ constraint: z.ZodOptional<z.ZodString>;
1989
+ }, z.core.$strict>>;
1990
+ name: z.ZodString;
1991
+ version: z.ZodString;
1992
+ configFilePath: z.ZodOptional<z.ZodString>;
1993
+ platformConfigs: z.ZodOptional<z.ZodArray<z.ZodObject<{
1994
+ platforms: z.ZodNumber;
1995
+ architectures: z.ZodOptional<z.ZodNumber>;
1996
+ config: z.ZodUnknown;
1997
+ }, z.core.$strict>>>;
1998
+ installationMethod: z.ZodLiteral<"github-release">;
1999
+ installParams: z.ZodObject<{
2000
+ auto: z.ZodOptional<z.ZodBoolean>;
2001
+ env: z.ZodOptional<z.ZodCustom<BaseEnv, BaseEnv>>;
2002
+ hooks: z.ZodOptional<z.ZodObject<{
2003
+ "before-install": z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodCustom<InstallHook, InstallHook>>>>;
2004
+ "after-download": z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodCustom<InstallHook, InstallHook>>>>;
2005
+ "after-extract": z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodCustom<InstallHook, InstallHook>>>>;
2006
+ "after-install": z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodCustom<InstallHook, InstallHook>>>>;
2007
+ }, z.core.$strip>>;
2008
+ repo: z.ZodString;
2009
+ assetPattern: z.ZodOptional<z.ZodUnion<readonly [
2010
+ z.ZodString,
2011
+ z.ZodCustom<RegExp, RegExp>
2012
+ ]>>;
2013
+ version: z.ZodOptional<z.ZodString>;
2014
+ assetSelector: z.ZodOptional<z.ZodCustom<AssetSelector, AssetSelector>>;
2015
+ ghCli: z.ZodOptional<z.ZodBoolean>;
2016
+ prerelease: z.ZodOptional<z.ZodBoolean>;
2017
+ }, z.core.$strict>;
2018
+ binaries: z.ZodArray<z.ZodUnion<readonly [
2019
+ z.ZodString,
2020
+ z.ZodObject<{
2021
+ name: z.ZodString;
2022
+ pattern: z.ZodString;
2023
+ }, z.core.$strict>
2024
+ ]>>;
2025
+ }, z.core.$strict>;
2026
+ type GithubReleaseToolConfig = InferToolConfigWithPlatforms<typeof githubReleaseToolConfigSchema>;
2027
+ interface IInstallParamsRegistry {
2028
+ "github-release": GithubReleaseInstallParams;
2029
+ }
2030
+ interface IToolConfigRegistry {
2031
+ "github-release": GithubReleaseToolConfig;
2032
+ }
2033
+ interface DmgInstallParams extends BaseInstallParams {
2034
+ /** Source definition for resolving the DMG file. */
2035
+ source: DmgSource;
2036
+ /** The name of the .app bundle inside the DMG. */
2037
+ appName?: string;
2038
+ /** Relative path to the binary inside the .app bundle. */
2039
+ binaryPath?: string;
2040
+ /** Arguments to pass to the binary to check the version. */
2041
+ versionArgs?: string[];
2042
+ /** Regex to extract version from output. */
2043
+ versionRegex?: string;
2044
+ }
2045
+ interface DmgUrlSource {
2046
+ type: "url";
2047
+ url: string;
2048
+ }
2049
+ interface DmgGitHubReleaseSource extends Pick<GithubReleaseInstallParams, "repo" | "version" | "assetPattern" | "assetSelector" | "ghCli" | "prerelease"> {
2050
+ type: "github-release";
2051
+ }
2052
+ type DmgSource = DmgUrlSource | DmgGitHubReleaseSource;
2053
+ declare const dmgToolConfigSchema: z.ZodObject<{
2054
+ binaries: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [
2055
+ z.ZodString,
2056
+ z.ZodObject<{
2057
+ name: z.ZodString;
2058
+ pattern: z.ZodString;
2059
+ }, z.core.$strict>
2060
+ ]>>>;
2061
+ dependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
2062
+ disabled: z.ZodOptional<z.ZodBoolean>;
2063
+ hostname: z.ZodOptional<z.ZodString>;
2064
+ shellConfigs: z.ZodOptional<z.ZodObject<{
2065
+ zsh: z.ZodOptional<z.ZodObject<{
2066
+ scripts: z.ZodOptional<z.ZodArray<z.ZodType<ShellScript, unknown, z.core.$ZodTypeInternals<ShellScript, unknown>>>>;
2067
+ aliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2068
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2069
+ functions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2070
+ paths: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
2071
+ completions: z.ZodOptional<z.ZodUnknown>;
2072
+ }, z.core.$strict>>;
2073
+ bash: z.ZodOptional<z.ZodObject<{
2074
+ scripts: z.ZodOptional<z.ZodArray<z.ZodType<ShellScript, unknown, z.core.$ZodTypeInternals<ShellScript, unknown>>>>;
2075
+ aliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2076
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2077
+ functions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2078
+ paths: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
2079
+ completions: z.ZodOptional<z.ZodUnknown>;
2080
+ }, z.core.$strict>>;
2081
+ powershell: z.ZodOptional<z.ZodObject<{
2082
+ scripts: z.ZodOptional<z.ZodArray<z.ZodType<ShellScript, unknown, z.core.$ZodTypeInternals<ShellScript, unknown>>>>;
2083
+ aliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2084
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2085
+ functions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2086
+ paths: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
2087
+ completions: z.ZodOptional<z.ZodUnknown>;
2088
+ }, z.core.$strict>>;
2089
+ }, z.core.$strict>>;
2090
+ symlinks: z.ZodOptional<z.ZodArray<z.ZodObject<{
2091
+ source: z.ZodString;
2092
+ target: z.ZodString;
2093
+ }, z.core.$strict>>>;
2094
+ copies: z.ZodOptional<z.ZodArray<z.ZodObject<{
2095
+ source: z.ZodString;
2096
+ target: z.ZodString;
2097
+ }, z.core.$strict>>>;
2098
+ updateCheck: z.ZodOptional<z.ZodObject<{
2099
+ enabled: z.ZodOptional<z.ZodBoolean>;
2100
+ constraint: z.ZodOptional<z.ZodString>;
2101
+ }, z.core.$strict>>;
2102
+ name: z.ZodString;
2103
+ version: z.ZodString;
2104
+ configFilePath: z.ZodOptional<z.ZodString>;
2105
+ platformConfigs: z.ZodOptional<z.ZodArray<z.ZodObject<{
2106
+ platforms: z.ZodNumber;
2107
+ architectures: z.ZodOptional<z.ZodNumber>;
2108
+ config: z.ZodUnknown;
2109
+ }, z.core.$strict>>>;
2110
+ installationMethod: z.ZodLiteral<"dmg">;
2111
+ installParams: z.ZodObject<{
2112
+ auto: z.ZodOptional<z.ZodBoolean>;
2113
+ env: z.ZodOptional<z.ZodCustom<BaseEnv, BaseEnv>>;
2114
+ hooks: z.ZodOptional<z.ZodObject<{
2115
+ "before-install": z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodCustom<InstallHook, InstallHook>>>>;
2116
+ "after-download": z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodCustom<InstallHook, InstallHook>>>>;
2117
+ "after-extract": z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodCustom<InstallHook, InstallHook>>>>;
2118
+ "after-install": z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodCustom<InstallHook, InstallHook>>>>;
2119
+ }, z.core.$strip>>;
2120
+ source: z.ZodDiscriminatedUnion<[
2121
+ z.ZodObject<{
2122
+ type: z.ZodLiteral<"url">;
2123
+ url: z.ZodString;
2124
+ }, z.core.$strip>,
2125
+ z.ZodObject<{
2126
+ repo: z.ZodString;
2127
+ assetPattern: z.ZodOptional<z.ZodUnion<readonly [
2128
+ z.ZodString,
2129
+ z.ZodCustom<RegExp, RegExp>
2130
+ ]>>;
2131
+ version: z.ZodOptional<z.ZodString>;
2132
+ assetSelector: z.ZodOptional<z.ZodCustom<AssetSelector, AssetSelector>>;
2133
+ ghCli: z.ZodOptional<z.ZodBoolean>;
2134
+ prerelease: z.ZodOptional<z.ZodBoolean>;
2135
+ type: z.ZodLiteral<"github-release">;
2136
+ }, z.core.$strip>
2137
+ ], "type">;
2138
+ appName: z.ZodOptional<z.ZodString>;
2139
+ binaryPath: z.ZodOptional<z.ZodString>;
2140
+ versionArgs: z.ZodOptional<z.ZodArray<z.ZodString>>;
2141
+ versionRegex: z.ZodOptional<z.ZodString>;
2142
+ }, z.core.$strict>;
2143
+ }, z.core.$strict>;
2144
+ type DmgToolConfig = InferToolConfigWithPlatforms<typeof dmgToolConfigSchema>;
2145
+ interface IInstallParamsRegistry {
2146
+ dmg: DmgInstallParams;
2147
+ }
2148
+ interface IToolConfigRegistry {
2149
+ dmg: DmgToolConfig;
2150
+ }
2151
+ type AssetPattern$1 = string | RegExp;
2152
+ interface IGiteaAssetSelectionContext extends IInstallContext {
2153
+ assets: IGitHubReleaseAsset[];
2154
+ release: IGitHubRelease;
2155
+ assetPattern?: AssetPattern$1;
2156
+ }
2157
+ type GiteaAssetSelector = (context: IGiteaAssetSelectionContext) => IGitHubReleaseAsset | undefined;
2158
+ /**
2159
+ * Parameters for installing a tool from a Gitea/Forgejo release.
2160
+ */
2161
+ interface GiteaReleaseInstallParams extends BaseInstallParams {
2162
+ instanceUrl: string;
2163
+ repo: string;
2164
+ assetPattern?: string | RegExp;
2165
+ version?: string;
2166
+ assetSelector?: GiteaAssetSelector;
2167
+ prerelease?: boolean;
2168
+ token?: string;
2169
+ }
2170
+ declare const giteaReleaseToolConfigSchema: z.ZodObject<{
2171
+ dependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
2172
+ disabled: z.ZodOptional<z.ZodBoolean>;
2173
+ hostname: z.ZodOptional<z.ZodString>;
2174
+ shellConfigs: z.ZodOptional<z.ZodObject<{
2175
+ zsh: z.ZodOptional<z.ZodObject<{
2176
+ scripts: z.ZodOptional<z.ZodArray<z.ZodType<ShellScript, unknown, z.core.$ZodTypeInternals<ShellScript, unknown>>>>;
2177
+ aliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2178
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2179
+ functions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2180
+ paths: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
2181
+ completions: z.ZodOptional<z.ZodUnknown>;
2182
+ }, z.core.$strict>>;
2183
+ bash: z.ZodOptional<z.ZodObject<{
2184
+ scripts: z.ZodOptional<z.ZodArray<z.ZodType<ShellScript, unknown, z.core.$ZodTypeInternals<ShellScript, unknown>>>>;
2185
+ aliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2186
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2187
+ functions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2188
+ paths: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
2189
+ completions: z.ZodOptional<z.ZodUnknown>;
2190
+ }, z.core.$strict>>;
2191
+ powershell: z.ZodOptional<z.ZodObject<{
2192
+ scripts: z.ZodOptional<z.ZodArray<z.ZodType<ShellScript, unknown, z.core.$ZodTypeInternals<ShellScript, unknown>>>>;
2193
+ aliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2194
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2195
+ functions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2196
+ paths: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
2197
+ completions: z.ZodOptional<z.ZodUnknown>;
2198
+ }, z.core.$strict>>;
2199
+ }, z.core.$strict>>;
2200
+ symlinks: z.ZodOptional<z.ZodArray<z.ZodObject<{
2201
+ source: z.ZodString;
2202
+ target: z.ZodString;
2203
+ }, z.core.$strict>>>;
2204
+ copies: z.ZodOptional<z.ZodArray<z.ZodObject<{
2205
+ source: z.ZodString;
2206
+ target: z.ZodString;
2207
+ }, z.core.$strict>>>;
2208
+ updateCheck: z.ZodOptional<z.ZodObject<{
2209
+ enabled: z.ZodOptional<z.ZodBoolean>;
2210
+ constraint: z.ZodOptional<z.ZodString>;
2211
+ }, z.core.$strict>>;
2212
+ name: z.ZodString;
2213
+ version: z.ZodString;
2214
+ configFilePath: z.ZodOptional<z.ZodString>;
2215
+ platformConfigs: z.ZodOptional<z.ZodArray<z.ZodObject<{
2216
+ platforms: z.ZodNumber;
2217
+ architectures: z.ZodOptional<z.ZodNumber>;
2218
+ config: z.ZodUnknown;
2219
+ }, z.core.$strict>>>;
2220
+ installationMethod: z.ZodLiteral<"gitea-release">;
2221
+ installParams: z.ZodObject<{
2222
+ auto: z.ZodOptional<z.ZodBoolean>;
2223
+ env: z.ZodOptional<z.ZodCustom<BaseEnv, BaseEnv>>;
2224
+ hooks: z.ZodOptional<z.ZodObject<{
2225
+ "before-install": z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodCustom<InstallHook, InstallHook>>>>;
2226
+ "after-download": z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodCustom<InstallHook, InstallHook>>>>;
2227
+ "after-extract": z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodCustom<InstallHook, InstallHook>>>>;
2228
+ "after-install": z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodCustom<InstallHook, InstallHook>>>>;
2229
+ }, z.core.$strip>>;
2230
+ instanceUrl: z.ZodString;
2231
+ repo: z.ZodString;
2232
+ assetPattern: z.ZodOptional<z.ZodUnion<readonly [
2233
+ z.ZodString,
2234
+ z.ZodCustom<RegExp, RegExp>
2235
+ ]>>;
2236
+ version: z.ZodOptional<z.ZodString>;
2237
+ assetSelector: z.ZodOptional<z.ZodCustom<GiteaAssetSelector, GiteaAssetSelector>>;
2238
+ prerelease: z.ZodOptional<z.ZodBoolean>;
2239
+ token: z.ZodOptional<z.ZodString>;
2240
+ }, z.core.$strict>;
2241
+ binaries: z.ZodArray<z.ZodUnion<readonly [
2242
+ z.ZodString,
2243
+ z.ZodObject<{
2244
+ name: z.ZodString;
2245
+ pattern: z.ZodString;
2246
+ }, z.core.$strict>
2247
+ ]>>;
2248
+ }, z.core.$strict>;
2249
+ type GiteaReleaseToolConfig = InferToolConfigWithPlatforms<typeof giteaReleaseToolConfigSchema>;
2250
+ interface IInstallParamsRegistry {
2251
+ "gitea-release": GiteaReleaseInstallParams;
2252
+ }
2253
+ interface IToolConfigRegistry {
2254
+ "gitea-release": GiteaReleaseToolConfig;
2255
+ }
2256
+ /**
2257
+ * Parameters for a "manual" installation method.
2258
+ *
2259
+ * NOTE: This is an explicit interface (not z.infer) to ensure TypeScript fully resolves
2260
+ * the property names, which is required for proper `keyof` behavior in declaration files.
2261
+ */
2262
+ interface ManualInstallParams extends BaseInstallParams {
2263
+ /**
2264
+ * The path to the binary file relative to the tool configuration file location.
2265
+ * If not specified, only shell configurations and symlinks will be processed.
2266
+ */
2267
+ binaryPath?: string;
2268
+ }
2269
+ declare const manualToolConfigSchema: z.ZodObject<{
2270
+ dependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
2271
+ disabled: z.ZodOptional<z.ZodBoolean>;
2272
+ hostname: z.ZodOptional<z.ZodString>;
2273
+ shellConfigs: z.ZodOptional<z.ZodObject<{
2274
+ zsh: z.ZodOptional<z.ZodObject<{
2275
+ scripts: z.ZodOptional<z.ZodArray<z.ZodType<ShellScript, unknown, z.core.$ZodTypeInternals<ShellScript, unknown>>>>;
2276
+ aliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2277
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2278
+ functions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2279
+ paths: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
2280
+ completions: z.ZodOptional<z.ZodUnknown>;
2281
+ }, z.core.$strict>>;
2282
+ bash: z.ZodOptional<z.ZodObject<{
2283
+ scripts: z.ZodOptional<z.ZodArray<z.ZodType<ShellScript, unknown, z.core.$ZodTypeInternals<ShellScript, unknown>>>>;
2284
+ aliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2285
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2286
+ functions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2287
+ paths: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
2288
+ completions: z.ZodOptional<z.ZodUnknown>;
2289
+ }, z.core.$strict>>;
2290
+ powershell: z.ZodOptional<z.ZodObject<{
2291
+ scripts: z.ZodOptional<z.ZodArray<z.ZodType<ShellScript, unknown, z.core.$ZodTypeInternals<ShellScript, unknown>>>>;
2292
+ aliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2293
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2294
+ functions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2295
+ paths: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
2296
+ completions: z.ZodOptional<z.ZodUnknown>;
2297
+ }, z.core.$strict>>;
2298
+ }, z.core.$strict>>;
2299
+ symlinks: z.ZodOptional<z.ZodArray<z.ZodObject<{
2300
+ source: z.ZodString;
2301
+ target: z.ZodString;
2302
+ }, z.core.$strict>>>;
2303
+ copies: z.ZodOptional<z.ZodArray<z.ZodObject<{
2304
+ source: z.ZodString;
2305
+ target: z.ZodString;
2306
+ }, z.core.$strict>>>;
2307
+ updateCheck: z.ZodOptional<z.ZodObject<{
2308
+ enabled: z.ZodOptional<z.ZodBoolean>;
2309
+ constraint: z.ZodOptional<z.ZodString>;
2310
+ }, z.core.$strict>>;
2311
+ name: z.ZodString;
2312
+ version: z.ZodString;
2313
+ configFilePath: z.ZodOptional<z.ZodString>;
2314
+ platformConfigs: z.ZodOptional<z.ZodArray<z.ZodObject<{
2315
+ platforms: z.ZodNumber;
2316
+ architectures: z.ZodOptional<z.ZodNumber>;
2317
+ config: z.ZodUnknown;
2318
+ }, z.core.$strict>>>;
2319
+ installationMethod: z.ZodLiteral<"manual">;
2320
+ installParams: z.ZodOptional<z.ZodObject<{
2321
+ auto: z.ZodOptional<z.ZodBoolean>;
2322
+ env: z.ZodOptional<z.ZodCustom<BaseEnv, BaseEnv>>;
2323
+ hooks: z.ZodOptional<z.ZodObject<{
2324
+ "before-install": z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodCustom<InstallHook, InstallHook>>>>;
2325
+ "after-download": z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodCustom<InstallHook, InstallHook>>>>;
2326
+ "after-extract": z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodCustom<InstallHook, InstallHook>>>>;
2327
+ "after-install": z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodCustom<InstallHook, InstallHook>>>>;
2328
+ }, z.core.$strip>>;
2329
+ binaryPath: z.ZodOptional<z.ZodString>;
2330
+ }, z.core.$strict>>;
2331
+ binaries: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [
2332
+ z.ZodString,
2333
+ z.ZodObject<{
2334
+ name: z.ZodString;
2335
+ pattern: z.ZodString;
2336
+ }, z.core.$strict>
2337
+ ]>>>;
2338
+ }, z.core.$strict>;
2339
+ type ManualToolConfig = InferToolConfigWithPlatforms<typeof manualToolConfigSchema>;
2340
+ interface IInstallParamsRegistry {
2341
+ manual: ManualInstallParams;
2342
+ }
2343
+ interface INoParamsMethodRegistry {
2344
+ manual: true;
2345
+ }
2346
+ interface IToolConfigRegistry {
2347
+ manual: ManualToolConfig;
2348
+ }
2349
+ interface ConfigContext {
2350
+ /**
2351
+ * The directory containing the configuration file.
2352
+ */
2353
+ configFileDir: string;
2354
+ /**
2355
+ * Information about the current system (platform, architecture, etc.).
2356
+ */
2357
+ systemInfo: ISystemInfo;
2358
+ }
2359
+ type ConfigFactory = (ctx: ConfigContext) => Promise<ProjectConfigPartial> | ProjectConfigPartial;
2360
+ /**
2361
+ * Wraps a configuration factory so `.ts` config files stay fully typed.
2362
+ *
2363
+ * The factory can be synchronous or asynchronous and should return a {@link ProjectConfigPartial}.
2364
+ *
2365
+ * @param configFn - Configuration factory.
2366
+ * @returns The configuration factory function.
2367
+ *
2368
+ * @example Asynchronous factory
2369
+ * ```typescript
2370
+ * export default defineConfig(async () => ({
2371
+ * github: {
2372
+ * token: await fetchToken(),
2373
+ * },
2374
+ * }));
2375
+ * ```
2376
+ *
2377
+ * @example Synchronous factory
2378
+ * ```typescript
2379
+ * export default defineConfig(() => ({
2380
+ * paths: {
2381
+ * dotfilesDir: '~/.dotfiles',
2382
+ * targetDir: '~/.local/bin',
2383
+ * },
2384
+ * }));
2385
+ * ```
2386
+ */
2387
+ export declare function defineConfig(configFn: ConfigFactory): ConfigFactory;
2388
+ type ConfigureToolFnResult = ToolConfig | IToolConfigBuilder | Omit<IToolConfigBuilder, "bin"> | undefined | Promise<ToolConfig | IToolConfigBuilder | Omit<IToolConfigBuilder, "bin"> | undefined>;
2389
+ /**
2390
+ * Define a tool configuration with type-safe install method selection.
2391
+ *
2392
+ * The install function is provided as the first parameter, allowing you to
2393
+ * select the installer method and provide type-checked parameters upfront.
2394
+ *
2395
+ * @param fn - Configuration callback that receives:
2396
+ * - `install` - Function to select installer method. Call with method name and params,
2397
+ * or call with no args for manual tools. Returns a fluent builder.
2398
+ * - `ctx` - Context with tool/config info (toolName, projectConfig, systemInfo).
2399
+ *
2400
+ * @returns Async function compatible with tool loading system
2401
+ *
2402
+ * @example
2403
+ * ```ts
2404
+ * export default defineTool((install, ctx) =>
2405
+ * install('github-release', { repo: 'BurntSushi/ripgrep' })
2406
+ * .bin('rg')
2407
+ * .version('14.0.0')
2408
+ * );
2409
+ * ```
2410
+ */
2411
+ export declare function defineTool(fn: (
2412
+ /**
2413
+ * Function to select the installation method and provide type-checked parameters.
2414
+ * Call with a method name and params for installers, or call with no args for manual tools.
2415
+ * Returns a fluent builder to configure binaries, versions, hooks, and shell settings.
2416
+ *
2417
+ * @inheritdoc
2418
+ */
2419
+ install: InstallFunction,
2420
+ /**
2421
+ * Context object providing access to paths, configuration, and system information.
2422
+ * Use `ctx.projectConfig.paths.*` for configured directory paths.
2423
+ */
2424
+ ctx: IToolConfigContext) => ConfigureToolFnResult): AsyncConfigureTool;
2425
+ /**
2426
+ * Parameters for installing a tool by downloading a standalone binary file.
2427
+ *
2428
+ * NOTE: This is an explicit interface (not z.infer) to ensure TypeScript fully resolves
2429
+ * the property names, which is required for proper `keyof` behavior in declaration files.
2430
+ */
2431
+ interface CurlBinaryInstallParams extends BaseInstallParams {
2432
+ /** The URL of the binary file to download. */
2433
+ url: string;
2434
+ /** Arguments to pass to the binary to check the version. */
2435
+ versionArgs?: string[];
2436
+ /** Regex to extract version from output. */
2437
+ versionRegex?: string;
2438
+ }
2439
+ declare const curlBinaryToolConfigSchema: z.ZodObject<{
2440
+ dependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
2441
+ disabled: z.ZodOptional<z.ZodBoolean>;
2442
+ hostname: z.ZodOptional<z.ZodString>;
2443
+ shellConfigs: z.ZodOptional<z.ZodObject<{
2444
+ zsh: z.ZodOptional<z.ZodObject<{
2445
+ scripts: z.ZodOptional<z.ZodArray<z.ZodType<ShellScript, unknown, z.core.$ZodTypeInternals<ShellScript, unknown>>>>;
2446
+ aliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2447
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2448
+ functions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2449
+ paths: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
2450
+ completions: z.ZodOptional<z.ZodUnknown>;
2451
+ }, z.core.$strict>>;
2452
+ bash: z.ZodOptional<z.ZodObject<{
2453
+ scripts: z.ZodOptional<z.ZodArray<z.ZodType<ShellScript, unknown, z.core.$ZodTypeInternals<ShellScript, unknown>>>>;
2454
+ aliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2455
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2456
+ functions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2457
+ paths: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
2458
+ completions: z.ZodOptional<z.ZodUnknown>;
2459
+ }, z.core.$strict>>;
2460
+ powershell: z.ZodOptional<z.ZodObject<{
2461
+ scripts: z.ZodOptional<z.ZodArray<z.ZodType<ShellScript, unknown, z.core.$ZodTypeInternals<ShellScript, unknown>>>>;
2462
+ aliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2463
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2464
+ functions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2465
+ paths: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
2466
+ completions: z.ZodOptional<z.ZodUnknown>;
2467
+ }, z.core.$strict>>;
2468
+ }, z.core.$strict>>;
2469
+ symlinks: z.ZodOptional<z.ZodArray<z.ZodObject<{
2470
+ source: z.ZodString;
2471
+ target: z.ZodString;
2472
+ }, z.core.$strict>>>;
2473
+ copies: z.ZodOptional<z.ZodArray<z.ZodObject<{
2474
+ source: z.ZodString;
2475
+ target: z.ZodString;
2476
+ }, z.core.$strict>>>;
2477
+ updateCheck: z.ZodOptional<z.ZodObject<{
2478
+ enabled: z.ZodOptional<z.ZodBoolean>;
2479
+ constraint: z.ZodOptional<z.ZodString>;
2480
+ }, z.core.$strict>>;
2481
+ name: z.ZodString;
2482
+ version: z.ZodString;
2483
+ configFilePath: z.ZodOptional<z.ZodString>;
2484
+ platformConfigs: z.ZodOptional<z.ZodArray<z.ZodObject<{
2485
+ platforms: z.ZodNumber;
2486
+ architectures: z.ZodOptional<z.ZodNumber>;
2487
+ config: z.ZodUnknown;
2488
+ }, z.core.$strict>>>;
2489
+ installationMethod: z.ZodLiteral<"curl-binary">;
2490
+ installParams: z.ZodObject<{
2491
+ auto: z.ZodOptional<z.ZodBoolean>;
2492
+ env: z.ZodOptional<z.ZodCustom<BaseEnv, BaseEnv>>;
2493
+ hooks: z.ZodOptional<z.ZodObject<{
2494
+ "before-install": z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodCustom<InstallHook, InstallHook>>>>;
2495
+ "after-download": z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodCustom<InstallHook, InstallHook>>>>;
2496
+ "after-extract": z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodCustom<InstallHook, InstallHook>>>>;
2497
+ "after-install": z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodCustom<InstallHook, InstallHook>>>>;
2498
+ }, z.core.$strip>>;
2499
+ url: z.ZodString;
2500
+ versionArgs: z.ZodOptional<z.ZodArray<z.ZodString>>;
2501
+ versionRegex: z.ZodOptional<z.ZodString>;
2502
+ }, z.core.$strict>;
2503
+ binaries: z.ZodArray<z.ZodUnion<readonly [
2504
+ z.ZodString,
2505
+ z.ZodObject<{
2506
+ name: z.ZodString;
2507
+ pattern: z.ZodString;
2508
+ }, z.core.$strict>
2509
+ ]>>;
2510
+ }, z.core.$strict>;
2511
+ type CurlBinaryToolConfig = InferToolConfigWithPlatforms<typeof curlBinaryToolConfigSchema>;
2512
+ interface IInstallParamsRegistry {
2513
+ "curl-binary": CurlBinaryInstallParams;
2514
+ }
2515
+ interface IToolConfigRegistry {
2516
+ "curl-binary": CurlBinaryToolConfig;
2517
+ }
2518
+ /**
2519
+ * Parameters for a "zsh-plugin" installation method.
2520
+ *
2521
+ * NOTE: This is an explicit interface (not z.infer) to ensure TypeScript fully resolves
2522
+ * the property names, which is required for proper `keyof` behavior in declaration files.
2523
+ */
2524
+ interface ZshPluginInstallParams extends BaseInstallParams {
2525
+ /** GitHub repository in `user/repo` format. Either `repo` or `url` must be specified. */
2526
+ repo?: string;
2527
+ /** Full git URL for non-GitHub repositories. Either `repo` or `url` must be specified. */
2528
+ url?: string;
2529
+ /** Custom plugin name for the cloned directory. */
2530
+ pluginName?: string;
2531
+ /** Path to the plugin's main source file relative to the plugin directory. */
2532
+ source?: string;
2533
+ /** Whether to automatically source the plugin in shell init. @default true */
2534
+ auto?: boolean;
2535
+ }
2536
+ declare const zshPluginToolConfigSchema: z.ZodObject<{
2537
+ dependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
2538
+ disabled: z.ZodOptional<z.ZodBoolean>;
2539
+ hostname: z.ZodOptional<z.ZodString>;
2540
+ shellConfigs: z.ZodOptional<z.ZodObject<{
2541
+ zsh: z.ZodOptional<z.ZodObject<{
2542
+ scripts: z.ZodOptional<z.ZodArray<z.ZodType<ShellScript, unknown, z.core.$ZodTypeInternals<ShellScript, unknown>>>>;
2543
+ aliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2544
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2545
+ functions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2546
+ paths: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
2547
+ completions: z.ZodOptional<z.ZodUnknown>;
2548
+ }, z.core.$strict>>;
2549
+ bash: z.ZodOptional<z.ZodObject<{
2550
+ scripts: z.ZodOptional<z.ZodArray<z.ZodType<ShellScript, unknown, z.core.$ZodTypeInternals<ShellScript, unknown>>>>;
2551
+ aliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2552
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2553
+ functions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2554
+ paths: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
2555
+ completions: z.ZodOptional<z.ZodUnknown>;
2556
+ }, z.core.$strict>>;
2557
+ powershell: z.ZodOptional<z.ZodObject<{
2558
+ scripts: z.ZodOptional<z.ZodArray<z.ZodType<ShellScript, unknown, z.core.$ZodTypeInternals<ShellScript, unknown>>>>;
2559
+ aliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2560
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2561
+ functions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2562
+ paths: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
2563
+ completions: z.ZodOptional<z.ZodUnknown>;
2564
+ }, z.core.$strict>>;
2565
+ }, z.core.$strict>>;
2566
+ symlinks: z.ZodOptional<z.ZodArray<z.ZodObject<{
2567
+ source: z.ZodString;
2568
+ target: z.ZodString;
2569
+ }, z.core.$strict>>>;
2570
+ copies: z.ZodOptional<z.ZodArray<z.ZodObject<{
2571
+ source: z.ZodString;
2572
+ target: z.ZodString;
2573
+ }, z.core.$strict>>>;
2574
+ updateCheck: z.ZodOptional<z.ZodObject<{
2575
+ enabled: z.ZodOptional<z.ZodBoolean>;
2576
+ constraint: z.ZodOptional<z.ZodString>;
2577
+ }, z.core.$strict>>;
2578
+ name: z.ZodString;
2579
+ version: z.ZodString;
2580
+ configFilePath: z.ZodOptional<z.ZodString>;
2581
+ platformConfigs: z.ZodOptional<z.ZodArray<z.ZodObject<{
2582
+ platforms: z.ZodNumber;
2583
+ architectures: z.ZodOptional<z.ZodNumber>;
2584
+ config: z.ZodUnknown;
2585
+ }, z.core.$strict>>>;
2586
+ installationMethod: z.ZodLiteral<"zsh-plugin">;
2587
+ installParams: z.ZodObject<{
2588
+ env: z.ZodOptional<z.ZodCustom<BaseEnv, BaseEnv>>;
2589
+ hooks: z.ZodOptional<z.ZodObject<{
2590
+ "before-install": z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodCustom<InstallHook, InstallHook>>>>;
2591
+ "after-download": z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodCustom<InstallHook, InstallHook>>>>;
2592
+ "after-extract": z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodCustom<InstallHook, InstallHook>>>>;
2593
+ "after-install": z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodCustom<InstallHook, InstallHook>>>>;
2594
+ }, z.core.$strip>>;
2595
+ repo: z.ZodOptional<z.ZodString>;
2596
+ url: z.ZodOptional<z.ZodString>;
2597
+ pluginName: z.ZodOptional<z.ZodString>;
2598
+ source: z.ZodOptional<z.ZodString>;
2599
+ auto: z.ZodDefault<z.ZodBoolean>;
2600
+ }, z.core.$strict>;
2601
+ binaries: z.ZodDefault<z.ZodArray<z.ZodString>>;
2602
+ }, z.core.$strict>;
2603
+ type ZshPluginToolConfig = InferToolConfigWithPlatforms<typeof zshPluginToolConfigSchema>;
2604
+ interface IInstallParamsRegistry {
2605
+ "zsh-plugin": ZshPluginInstallParams;
2606
+ }
2607
+ interface IToolConfigRegistry {
2608
+ "zsh-plugin": ZshPluginToolConfig;
2609
+ }
2610
+ /**
2611
+ * Parameters for installing a tool using npm.
2612
+ *
2613
+ * NOTE: This is an explicit interface (not z.infer) to ensure TypeScript fully resolves
2614
+ * the property names, which is required for proper `keyof` behavior in declaration files.
2615
+ */
2616
+ interface NpmInstallParams extends BaseInstallParams {
2617
+ /** The npm package name to install. */
2618
+ package?: string;
2619
+ /** The version or version range to install. */
2620
+ version?: string;
2621
+ /** Arguments to pass to the binary to check the version. */
2622
+ versionArgs?: string[];
2623
+ /** Regex to extract version from output. */
2624
+ versionRegex?: string;
2625
+ /** The package manager to use for installation. Defaults to `'npm'`. */
2626
+ packageManager?: "npm" | "bun";
2627
+ }
2628
+ declare const npmToolConfigSchema: z.ZodObject<{
2629
+ dependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
2630
+ disabled: z.ZodOptional<z.ZodBoolean>;
2631
+ hostname: z.ZodOptional<z.ZodString>;
2632
+ shellConfigs: z.ZodOptional<z.ZodObject<{
2633
+ zsh: z.ZodOptional<z.ZodObject<{
2634
+ scripts: z.ZodOptional<z.ZodArray<z.ZodType<ShellScript, unknown, z.core.$ZodTypeInternals<ShellScript, unknown>>>>;
2635
+ aliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2636
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2637
+ functions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2638
+ paths: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
2639
+ completions: z.ZodOptional<z.ZodUnknown>;
2640
+ }, z.core.$strict>>;
2641
+ bash: z.ZodOptional<z.ZodObject<{
2642
+ scripts: z.ZodOptional<z.ZodArray<z.ZodType<ShellScript, unknown, z.core.$ZodTypeInternals<ShellScript, unknown>>>>;
2643
+ aliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2644
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2645
+ functions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2646
+ paths: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
2647
+ completions: z.ZodOptional<z.ZodUnknown>;
2648
+ }, z.core.$strict>>;
2649
+ powershell: z.ZodOptional<z.ZodObject<{
2650
+ scripts: z.ZodOptional<z.ZodArray<z.ZodType<ShellScript, unknown, z.core.$ZodTypeInternals<ShellScript, unknown>>>>;
2651
+ aliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2652
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2653
+ functions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2654
+ paths: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
2655
+ completions: z.ZodOptional<z.ZodUnknown>;
2656
+ }, z.core.$strict>>;
2657
+ }, z.core.$strict>>;
2658
+ symlinks: z.ZodOptional<z.ZodArray<z.ZodObject<{
2659
+ source: z.ZodString;
2660
+ target: z.ZodString;
2661
+ }, z.core.$strict>>>;
2662
+ copies: z.ZodOptional<z.ZodArray<z.ZodObject<{
2663
+ source: z.ZodString;
2664
+ target: z.ZodString;
2665
+ }, z.core.$strict>>>;
2666
+ updateCheck: z.ZodOptional<z.ZodObject<{
2667
+ enabled: z.ZodOptional<z.ZodBoolean>;
2668
+ constraint: z.ZodOptional<z.ZodString>;
2669
+ }, z.core.$strict>>;
2670
+ name: z.ZodString;
2671
+ version: z.ZodString;
2672
+ configFilePath: z.ZodOptional<z.ZodString>;
2673
+ platformConfigs: z.ZodOptional<z.ZodArray<z.ZodObject<{
2674
+ platforms: z.ZodNumber;
2675
+ architectures: z.ZodOptional<z.ZodNumber>;
2676
+ config: z.ZodUnknown;
2677
+ }, z.core.$strict>>>;
2678
+ installationMethod: z.ZodLiteral<"npm">;
2679
+ installParams: z.ZodObject<{
2680
+ auto: z.ZodOptional<z.ZodBoolean>;
2681
+ env: z.ZodOptional<z.ZodCustom<BaseEnv, BaseEnv>>;
2682
+ hooks: z.ZodOptional<z.ZodObject<{
2683
+ "before-install": z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodCustom<InstallHook, InstallHook>>>>;
2684
+ "after-download": z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodCustom<InstallHook, InstallHook>>>>;
2685
+ "after-extract": z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodCustom<InstallHook, InstallHook>>>>;
2686
+ "after-install": z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodCustom<InstallHook, InstallHook>>>>;
2687
+ }, z.core.$strip>>;
2688
+ package: z.ZodOptional<z.ZodString>;
2689
+ version: z.ZodOptional<z.ZodString>;
2690
+ versionArgs: z.ZodOptional<z.ZodArray<z.ZodString>>;
2691
+ versionRegex: z.ZodOptional<z.ZodString>;
2692
+ packageManager: z.ZodOptional<z.ZodEnum<{
2693
+ bun: "bun";
2694
+ npm: "npm";
2695
+ }>>;
2696
+ }, z.core.$strict>;
2697
+ binaries: z.ZodArray<z.ZodUnion<readonly [
2698
+ z.ZodString,
2699
+ z.ZodObject<{
2700
+ name: z.ZodString;
2701
+ pattern: z.ZodString;
2702
+ }, z.core.$strict>
2703
+ ]>>;
2704
+ }, z.core.$strict>;
2705
+ type NpmToolConfig = InferToolConfigWithPlatforms<typeof npmToolConfigSchema>;
2706
+ interface IInstallParamsRegistry {
2707
+ npm: NpmInstallParams;
2708
+ }
2709
+ interface IToolConfigRegistry {
2710
+ npm: NpmToolConfig;
2711
+ }
2712
+
2713
+ export {
2714
+ BrewInstallParams as z_internal_BrewInstallParams,
2715
+ CargoInstallParams as z_internal_CargoInstallParams,
2716
+ CurlBinaryInstallParams as z_internal_CurlBinaryInstallParams,
2717
+ CurlScriptInstallParams as z_internal_CurlScriptInstallParams,
2718
+ CurlTarInstallParams as z_internal_CurlTarInstallParams,
2719
+ GiteaReleaseInstallParams as z_internal_GiteaReleaseInstallParams,
2720
+ GithubReleaseInstallParams as z_internal_GithubReleaseInstallParams,
2721
+ IInstallParamsRegistry as z_internal_IInstallParamsRegistry,
2722
+ IKnownBinNameRegistry as z_internal_IKnownBinNameRegistry,
2723
+ ISystemInfo as z_internal_ISystemInfo,
2724
+ InstallMethod as z_internal_InstallMethod,
2725
+ ManualInstallParams as z_internal_ManualInstallParams,
2726
+ NpmInstallParams as z_internal_NpmInstallParams,
2727
+ ZshPluginInstallParams as z_internal_ZshPluginInstallParams,
2728
+ };
2729
+
2730
+ export {};