type-git 0.0.1 → 0.0.3

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 (105) hide show
  1. package/README.md +3 -6
  2. package/dist/adapters/bun/index.cjs +395 -0
  3. package/dist/adapters/bun/index.cjs.map +1 -0
  4. package/dist/adapters/bun/index.d.cts +44 -0
  5. package/dist/adapters/bun/index.d.ts +38 -5
  6. package/dist/adapters/bun/index.js +362 -13
  7. package/dist/adapters/bun/index.js.map +1 -1
  8. package/dist/adapters/deno/index.cjs +443 -0
  9. package/dist/adapters/deno/index.cjs.map +1 -0
  10. package/dist/adapters/deno/index.d.cts +46 -0
  11. package/dist/adapters/deno/index.d.ts +40 -5
  12. package/dist/adapters/deno/index.js +410 -13
  13. package/dist/adapters/deno/index.js.map +1 -1
  14. package/dist/adapters/node/index.cjs +5625 -0
  15. package/dist/adapters/node/index.cjs.map +1 -0
  16. package/dist/adapters/node/index.d.cts +2 -0
  17. package/dist/adapters/node/index.d.ts +2 -61
  18. package/dist/adapters/node/index.js +5577 -68
  19. package/dist/adapters/node/index.js.map +1 -1
  20. package/dist/{core/types.d.ts → adapters-w9tZ_Qbd.d.cts} +225 -29
  21. package/dist/adapters-w9tZ_Qbd.d.ts +572 -0
  22. package/dist/index-D9acU30I.d.ts +3649 -0
  23. package/dist/index-DRd85eN5.d.cts +3649 -0
  24. package/dist/index.cjs +5744 -0
  25. package/dist/index.cjs.map +1 -0
  26. package/dist/index.d.cts +208 -0
  27. package/dist/index.d.ts +206 -7
  28. package/dist/index.js +5685 -13
  29. package/dist/index.js.map +1 -1
  30. package/package.json +19 -8
  31. package/dist/adapters/bun/exec.d.ts +0 -13
  32. package/dist/adapters/bun/exec.d.ts.map +0 -1
  33. package/dist/adapters/bun/exec.js +0 -242
  34. package/dist/adapters/bun/exec.js.map +0 -1
  35. package/dist/adapters/bun/fs.d.ts +0 -20
  36. package/dist/adapters/bun/fs.d.ts.map +0 -1
  37. package/dist/adapters/bun/fs.js +0 -148
  38. package/dist/adapters/bun/fs.js.map +0 -1
  39. package/dist/adapters/bun/index.d.ts.map +0 -1
  40. package/dist/adapters/deno/exec.d.ts +0 -14
  41. package/dist/adapters/deno/exec.d.ts.map +0 -1
  42. package/dist/adapters/deno/exec.js +0 -266
  43. package/dist/adapters/deno/exec.js.map +0 -1
  44. package/dist/adapters/deno/fs.d.ts +0 -21
  45. package/dist/adapters/deno/fs.d.ts.map +0 -1
  46. package/dist/adapters/deno/fs.js +0 -191
  47. package/dist/adapters/deno/fs.js.map +0 -1
  48. package/dist/adapters/deno/index.d.ts.map +0 -1
  49. package/dist/adapters/node/exec.d.ts +0 -11
  50. package/dist/adapters/node/exec.d.ts.map +0 -1
  51. package/dist/adapters/node/exec.js +0 -161
  52. package/dist/adapters/node/exec.js.map +0 -1
  53. package/dist/adapters/node/fs.d.ts +0 -18
  54. package/dist/adapters/node/fs.d.ts.map +0 -1
  55. package/dist/adapters/node/fs.js +0 -164
  56. package/dist/adapters/node/fs.js.map +0 -1
  57. package/dist/adapters/node/index.d.ts.map +0 -1
  58. package/dist/core/adapters.d.ts +0 -192
  59. package/dist/core/adapters.d.ts.map +0 -1
  60. package/dist/core/adapters.js +0 -10
  61. package/dist/core/adapters.js.map +0 -1
  62. package/dist/core/git.d.ts +0 -160
  63. package/dist/core/git.d.ts.map +0 -1
  64. package/dist/core/git.js +0 -5
  65. package/dist/core/git.js.map +0 -1
  66. package/dist/core/index.d.ts +0 -8
  67. package/dist/core/index.d.ts.map +0 -1
  68. package/dist/core/index.js +0 -8
  69. package/dist/core/index.js.map +0 -1
  70. package/dist/core/repo.d.ts +0 -1275
  71. package/dist/core/repo.d.ts.map +0 -1
  72. package/dist/core/repo.js +0 -5
  73. package/dist/core/repo.js.map +0 -1
  74. package/dist/core/types.d.ts.map +0 -1
  75. package/dist/core/types.js +0 -100
  76. package/dist/core/types.js.map +0 -1
  77. package/dist/impl/bare-repo-impl.d.ts +0 -72
  78. package/dist/impl/bare-repo-impl.d.ts.map +0 -1
  79. package/dist/impl/bare-repo-impl.js +0 -328
  80. package/dist/impl/bare-repo-impl.js.map +0 -1
  81. package/dist/impl/git-impl.d.ts +0 -92
  82. package/dist/impl/git-impl.d.ts.map +0 -1
  83. package/dist/impl/git-impl.js +0 -350
  84. package/dist/impl/git-impl.js.map +0 -1
  85. package/dist/impl/index.d.ts +0 -7
  86. package/dist/impl/index.d.ts.map +0 -1
  87. package/dist/impl/index.js +0 -7
  88. package/dist/impl/index.js.map +0 -1
  89. package/dist/impl/worktree-repo-impl.d.ts +0 -180
  90. package/dist/impl/worktree-repo-impl.d.ts.map +0 -1
  91. package/dist/impl/worktree-repo-impl.js +0 -1931
  92. package/dist/impl/worktree-repo-impl.js.map +0 -1
  93. package/dist/index.d.ts.map +0 -1
  94. package/dist/parsers/index.d.ts +0 -230
  95. package/dist/parsers/index.d.ts.map +0 -1
  96. package/dist/parsers/index.js +0 -529
  97. package/dist/parsers/index.js.map +0 -1
  98. package/dist/runner/cli-runner.d.ts +0 -94
  99. package/dist/runner/cli-runner.d.ts.map +0 -1
  100. package/dist/runner/cli-runner.js +0 -315
  101. package/dist/runner/cli-runner.js.map +0 -1
  102. package/dist/runner/index.d.ts +0 -5
  103. package/dist/runner/index.d.ts.map +0 -1
  104. package/dist/runner/index.js +0 -5
  105. package/dist/runner/index.js.map +0 -1
@@ -0,0 +1,572 @@
1
+ /**
2
+ * Core type definitions for the type-safe Git wrapper library
3
+ *
4
+ * This module defines:
5
+ * - Progress events (Git and LFS)
6
+ * - Execution options and results
7
+ * - Error types and handling
8
+ * - Runtime capabilities
9
+ * - Output contracts for typed parsing
10
+ * - Branded types for type safety
11
+ */
12
+ /**
13
+ * Brand symbol for NonEmptyString
14
+ * @internal
15
+ */
16
+ declare const NonEmptyBrand: unique symbol;
17
+ /**
18
+ * A string that is guaranteed to be non-empty at the type level.
19
+ *
20
+ * Use the `nonEmpty()` helper function to create NonEmptyString values,
21
+ * or cast string literals directly: `'main' as NonEmptyString`
22
+ *
23
+ * @example
24
+ * ```typescript
25
+ * // Using helper function (recommended for variables)
26
+ * const branch = nonEmpty(userInput);
27
+ * await repo.branch.create(branch);
28
+ *
29
+ * // Casting literals (safe for known values)
30
+ * await repo.checkout('main' as NonEmptyString);
31
+ * ```
32
+ */
33
+ type NonEmptyString = string & {
34
+ readonly [NonEmptyBrand]: never;
35
+ };
36
+ /**
37
+ * Validates and converts a string to NonEmptyString.
38
+ *
39
+ * @param s - The string to validate
40
+ * @returns The string as NonEmptyString
41
+ * @throws GitArgumentError if the string is empty
42
+ *
43
+ * @example
44
+ * ```typescript
45
+ * const branchName = nonEmpty('feature-branch'); // OK
46
+ * const invalid = nonEmpty(''); // throws GitArgumentError
47
+ * ```
48
+ */
49
+ declare function nonEmpty(s: string): NonEmptyString;
50
+ /**
51
+ * Type guard to check if a string is non-empty.
52
+ *
53
+ * @param s - The string to check
54
+ * @returns true if the string is non-empty
55
+ *
56
+ * @example
57
+ * ```typescript
58
+ * const input = getUserInput();
59
+ * if (isNonEmpty(input)) {
60
+ * await repo.branch.create(input); // input is NonEmptyString here
61
+ * }
62
+ * ```
63
+ */
64
+ declare function isNonEmpty(s: string): s is NonEmptyString;
65
+ /**
66
+ * Progress event for Git operations
67
+ *
68
+ * Parsed from git's stderr progress output like:
69
+ * - "Counting objects: 100% (10/10), done."
70
+ * - "Compressing objects: 100% (8/8), done."
71
+ */
72
+ type GitProgress = {
73
+ /** The phase of the git operation */
74
+ phase: string;
75
+ /** Current progress value */
76
+ current: number;
77
+ /** Total value (null if unknown) */
78
+ total: number | null;
79
+ /** Percentage (null if unknown) */
80
+ percent: number | null;
81
+ /** Raw message from stderr */
82
+ message?: string;
83
+ };
84
+ /**
85
+ * Progress event for LFS operations (§7.3)
86
+ *
87
+ * Parsed from LFS stderr output when GIT_LFS_FORCE_PROGRESS=1:
88
+ * "Downloading LFS objects: 50% (1/2), 1.2 MB | 500 KB/s"
89
+ */
90
+ type LfsProgress = {
91
+ /** Direction of the transfer */
92
+ direction: 'download' | 'upload' | 'checkout';
93
+ /** Total bytes transferred so far */
94
+ bytesSoFar: number;
95
+ /** Total bytes to transfer */
96
+ bytesTotal: number;
97
+ /** Transfer rate in bytes per second */
98
+ bitrate?: number;
99
+ /** Number of files completed */
100
+ filesCompleted: number;
101
+ /** Total number of files */
102
+ filesTotal: number;
103
+ /** Progress percentage (0-100) */
104
+ percent: number;
105
+ };
106
+ /**
107
+ * Execution options common to all Git operations
108
+ */
109
+ type ExecOpts = {
110
+ /** AbortSignal for cancellation */
111
+ signal?: AbortSignal;
112
+ /** Git progress callback (for operations like fetch, push, clone) */
113
+ onProgress?: (progress: GitProgress) => void;
114
+ /** LFS progress callback (for LFS transfer operations) */
115
+ onLfsProgress?: (progress: LfsProgress) => void;
116
+ };
117
+ /**
118
+ * Result from raw Git command execution
119
+ */
120
+ type RawResult = {
121
+ /** Standard output */
122
+ stdout: string;
123
+ /** Standard error */
124
+ stderr: string;
125
+ /** Exit code (0 = success) */
126
+ exitCode: number;
127
+ /** Whether the command was aborted via AbortSignal */
128
+ aborted: boolean;
129
+ };
130
+ /**
131
+ * Git error kinds
132
+ */
133
+ type GitErrorKind =
134
+ /** Failed to spawn the git process */
135
+ 'SpawnFailed'
136
+ /** Git exited with non-zero exit code */
137
+ | 'NonZeroExit'
138
+ /** Failed to parse git output */
139
+ | 'ParseError'
140
+ /** Command was aborted via AbortSignal */
141
+ | 'Aborted'
142
+ /** Required capability is missing (e.g., Deno permissions) */
143
+ | 'CapabilityMissing'
144
+ /** Expected a worktree repository but found bare repository */
145
+ | 'NotWorktreeRepo'
146
+ /** Expected a bare repository but found worktree repository */
147
+ | 'NotBareRepo';
148
+ /**
149
+ * Git error category for error handling (§13.2)
150
+ *
151
+ * Categorizes errors by their nature to enable appropriate handling strategies.
152
+ */
153
+ type GitErrorCategory =
154
+ /** Authentication errors (401, credential related) */
155
+ 'auth'
156
+ /** Network errors (timeout, DNS resolution failure, etc.) */
157
+ | 'network'
158
+ /** Merge/rebase conflicts */
159
+ | 'conflict'
160
+ /** LFS-specific errors (storage capacity, transfer failure, etc.) */
161
+ | 'lfs'
162
+ /** Permission errors (directory access, file lock) */
163
+ | 'permission'
164
+ /** Repository corruption */
165
+ | 'corruption'
166
+ /** Unclassifiable */
167
+ | 'unknown';
168
+ /**
169
+ * Git error with detailed context
170
+ */
171
+ declare class GitError extends Error {
172
+ readonly kind: GitErrorKind;
173
+ readonly context: {
174
+ argv?: string[];
175
+ workdir?: string;
176
+ gitDir?: string;
177
+ exitCode?: number;
178
+ stdout?: string;
179
+ stderr?: string;
180
+ };
181
+ readonly category: GitErrorCategory;
182
+ constructor(kind: GitErrorKind, message: string, context?: {
183
+ argv?: string[];
184
+ workdir?: string;
185
+ gitDir?: string;
186
+ exitCode?: number;
187
+ stdout?: string;
188
+ stderr?: string;
189
+ }, category?: GitErrorCategory);
190
+ /**
191
+ * Check if the error is retryable (§13.2)
192
+ *
193
+ * Network errors and some LFS errors are typically retryable.
194
+ */
195
+ isRetryable(): boolean;
196
+ /**
197
+ * Check if authentication is needed (§13.2)
198
+ */
199
+ needsAuthentication(): boolean;
200
+ }
201
+ /**
202
+ * Error thrown when an argument is invalid (e.g., empty string where non-empty is required)
203
+ *
204
+ * This error is thrown at the API boundary before the git command is executed,
205
+ * providing early feedback for invalid arguments.
206
+ *
207
+ * @example
208
+ * ```typescript
209
+ * try {
210
+ * await repo.branch.create(nonEmpty('')); // throws GitArgumentError
211
+ * } catch (e) {
212
+ * if (e instanceof GitArgumentError) {
213
+ * console.log('Invalid argument:', e.message);
214
+ * }
215
+ * }
216
+ * ```
217
+ */
218
+ declare class GitArgumentError extends Error {
219
+ constructor(message: string);
220
+ }
221
+ /**
222
+ * Runtime identifier
223
+ */
224
+ type Runtime = 'node' | 'deno' | 'bun';
225
+ /**
226
+ * Runtime capabilities
227
+ *
228
+ * Used to determine what features are available in the current runtime.
229
+ */
230
+ type Capabilities = {
231
+ /** Whether process spawning is available */
232
+ canSpawnProcess: boolean;
233
+ /** Whether environment variables can be read */
234
+ canReadEnv: boolean;
235
+ /** Whether temporary files can be written (for LFS progress) */
236
+ canWriteTemp: boolean;
237
+ /** Whether AbortSignal is supported */
238
+ supportsAbortSignal: boolean;
239
+ /** Whether kill signals can be sent to processes */
240
+ supportsKillSignal: boolean;
241
+ /** Runtime identifier */
242
+ runtime: Runtime;
243
+ /** Git version (if detected) */
244
+ gitVersion?: string;
245
+ /** Git LFS version (if detected) */
246
+ lfsVersion?: string;
247
+ };
248
+ /**
249
+ * LFS mode configuration
250
+ */
251
+ type LfsMode = 'enabled' | 'disabled' | {
252
+ /** Skip smudge filter (don't download LFS files on checkout) */
253
+ skipSmudge?: boolean;
254
+ /** Skip download (keep pointer files) */
255
+ skipDownload?: boolean;
256
+ };
257
+ /**
258
+ * Output contract types for typed API
259
+ *
260
+ * Typed API only supports commands with predictable output formats.
261
+ */
262
+ type OutputContract =
263
+ /** Raw output - no parsing */
264
+ {
265
+ type: 'raw';
266
+ }
267
+ /** Porcelain format (v1 or v2) */
268
+ | {
269
+ type: 'porcelain';
270
+ version: 1 | 2;
271
+ }
272
+ /** JSON output */
273
+ | {
274
+ type: 'json';
275
+ }
276
+ /** Custom format with a specific delimiter */
277
+ | {
278
+ type: 'delimited';
279
+ delimiter: string;
280
+ nullTerminated?: boolean;
281
+ }
282
+ /** Custom pretty format for git log */
283
+ | {
284
+ type: 'pretty';
285
+ format: string;
286
+ };
287
+ /**
288
+ * Command specification for typed API
289
+ */
290
+ type CommandSpec<TOptions, TResult> = {
291
+ /** Command name (e.g., "status", "log") */
292
+ name: string;
293
+ /** Subcommands (e.g., ["lfs", "pull"]) */
294
+ subcommands?: string[];
295
+ /** Build argv from options */
296
+ buildArgs: (options: TOptions) => string[];
297
+ /** Output contract */
298
+ outputContract: OutputContract;
299
+ /** Parse stdout/stderr to result */
300
+ parse: (stdout: string, stderr: string) => TResult;
301
+ };
302
+ /**
303
+ * Execution context for git commands
304
+ *
305
+ * Determines how git commands are executed:
306
+ * - Worktree: `git -C <workdir> <command>`
307
+ * - Bare: `git --git-dir=<gitDir> <command>`
308
+ */
309
+ type ExecutionContext = {
310
+ type: 'global';
311
+ } | {
312
+ type: 'worktree';
313
+ workdir: string;
314
+ } | {
315
+ type: 'bare';
316
+ gitDir: string;
317
+ };
318
+ /**
319
+ * Options for opening a repository with environment isolation (§6.3)
320
+ *
321
+ * Provides declarative environment configuration for Git operations.
322
+ */
323
+ type GitOpenOptions = {
324
+ /** Custom HOME directory (~/.gitconfig source) */
325
+ home?: string;
326
+ /** Ignore system config (--config-env=GIT_CONFIG_GLOBAL=/dev/null equivalent) */
327
+ ignoreSystemConfig?: boolean;
328
+ /** Custom credential helper */
329
+ credentialHelper?: string;
330
+ /** Additional environment variables */
331
+ env?: Record<string, string>;
332
+ /** Directories to prepend to PATH */
333
+ pathPrefix?: string[];
334
+ /** Credential configuration (§6.4) */
335
+ credential?: CredentialConfig;
336
+ /** LFS mode configuration */
337
+ lfs?: LfsMode;
338
+ };
339
+ /**
340
+ * Credential request information
341
+ */
342
+ type CredentialRequest = {
343
+ protocol: 'https' | 'ssh';
344
+ host: string;
345
+ path?: string;
346
+ };
347
+ /**
348
+ * Credential response
349
+ */
350
+ type Credential = {
351
+ username: string;
352
+ password: string;
353
+ };
354
+ /**
355
+ * Credential configuration for Git authentication (§6.4)
356
+ *
357
+ * Supports multiple authentication methods:
358
+ * 1. Built-in helper (store, cache, manager-core)
359
+ * 2. Custom helper binary
360
+ * 3. Programmatic authentication (recommended)
361
+ * 4. Static credentials (dev/test only)
362
+ */
363
+ type CredentialConfig = {
364
+ /** Method 1: Built-in helper name */
365
+ helper?: 'store' | 'cache' | 'manager-core' | string;
366
+ /** Method 2: Custom helper binary path */
367
+ helperPath?: string;
368
+ /** Method 3: Programmatic authentication provider (recommended) */
369
+ provider?: (request: CredentialRequest) => Promise<Credential>;
370
+ /** Method 4: Static credentials (dev/test only) */
371
+ username?: string;
372
+ password?: string;
373
+ token?: string;
374
+ /** Fallback credential configuration */
375
+ fallback?: CredentialConfig;
376
+ /** Callback when authentication fails */
377
+ onAuthFailure?: (error: Error, request: CredentialRequest) => void;
378
+ };
379
+
380
+ /**
381
+ * Runtime adapter interfaces for cross-platform support (Node/Deno/Bun)
382
+ *
383
+ * This module defines:
384
+ * - ExecAdapter: Process execution abstraction (#15)
385
+ * - FsAdapter: Filesystem operations abstraction (#16)
386
+ * - Related types and options
387
+ */
388
+
389
+ /**
390
+ * Options for spawning a process
391
+ */
392
+ type SpawnOptions = {
393
+ /** Command and arguments (first element is the command) */
394
+ argv: string[];
395
+ /** Additional environment variables */
396
+ env?: Record<string, string>;
397
+ /** Working directory */
398
+ cwd?: string;
399
+ /** AbortSignal for cancellation */
400
+ signal?: AbortSignal;
401
+ /** Kill signal to use when aborting (default: SIGTERM) */
402
+ killSignal?: 'SIGTERM' | 'SIGKILL';
403
+ };
404
+ /**
405
+ * Result from spawning a process
406
+ */
407
+ type SpawnResult = {
408
+ /** Standard output */
409
+ stdout: string;
410
+ /** Standard error */
411
+ stderr: string;
412
+ /** Exit code (-1 if unknown) */
413
+ exitCode: number;
414
+ /** Signal that terminated the process (if any) */
415
+ signal?: string;
416
+ /** Whether the process was aborted via AbortSignal */
417
+ aborted: boolean;
418
+ };
419
+ /**
420
+ * Stream handler for incremental output
421
+ *
422
+ * Used for progress tracking and real-time output processing.
423
+ */
424
+ type StreamHandler = {
425
+ /** Called when stdout data is received */
426
+ onStdout?: (chunk: string) => void;
427
+ /** Called when stderr data is received */
428
+ onStderr?: (chunk: string) => void;
429
+ };
430
+ /**
431
+ * Handle to a spawned process
432
+ *
433
+ * Allows streaming output and waiting for completion.
434
+ */
435
+ interface SpawnHandle {
436
+ /** Async iterator for stdout lines */
437
+ readonly stdout: AsyncIterable<string>;
438
+ /** Async iterator for stderr lines */
439
+ readonly stderr: AsyncIterable<string>;
440
+ /** Wait for process completion */
441
+ wait(): Promise<SpawnResult>;
442
+ /** Kill the process */
443
+ kill(signal?: 'SIGTERM' | 'SIGKILL'): void;
444
+ }
445
+ /**
446
+ * Adapter interface for process execution
447
+ *
448
+ * Abstracts process spawning across Node.js, Deno, and Bun.
449
+ */
450
+ interface ExecAdapter {
451
+ /**
452
+ * Get the capabilities of this runtime
453
+ */
454
+ getCapabilities(): Capabilities;
455
+ /**
456
+ * Spawn a process and wait for completion
457
+ *
458
+ * @param options - Spawn options
459
+ * @param handlers - Optional stream handlers for real-time output
460
+ * @returns Promise resolving to spawn result
461
+ */
462
+ spawn(options: SpawnOptions, handlers?: StreamHandler): Promise<SpawnResult>;
463
+ /**
464
+ * Spawn a process with streaming support
465
+ *
466
+ * @param options - Spawn options
467
+ * @returns Handle to the spawned process
468
+ */
469
+ spawnStreaming?(options: SpawnOptions): SpawnHandle;
470
+ }
471
+ /**
472
+ * Options for tailing a file
473
+ */
474
+ type TailOptions = {
475
+ /** Path to the file to tail */
476
+ filePath: string;
477
+ /** AbortSignal for cancellation */
478
+ signal?: AbortSignal;
479
+ /** Callback for each new line */
480
+ onLine: (line: string) => void;
481
+ /** Start offset in bytes (default: 0) */
482
+ startOffset?: number;
483
+ /** Polling interval in milliseconds (default: 100) */
484
+ pollInterval?: number;
485
+ };
486
+ /**
487
+ * Handle to a tail operation
488
+ */
489
+ interface TailHandle {
490
+ /** Async iterator for new lines */
491
+ readonly lines: AsyncIterable<string>;
492
+ /** Stop tailing */
493
+ stop(): void;
494
+ }
495
+ /**
496
+ * Adapter interface for filesystem operations
497
+ *
498
+ * Used primarily for LFS progress tracking via GIT_LFS_PROGRESS.
499
+ */
500
+ interface FsAdapter {
501
+ /**
502
+ * Create a temporary file and return its path
503
+ *
504
+ * @param prefix - Optional prefix for the temp file name
505
+ * @returns Path to the created temporary file
506
+ */
507
+ createTempFile(prefix?: string): Promise<string>;
508
+ /**
509
+ * Start tailing a file (watching for new lines)
510
+ *
511
+ * @param options - Tail options
512
+ * @returns Promise that resolves when tailing stops
513
+ */
514
+ tail(options: TailOptions): Promise<void>;
515
+ /**
516
+ * Start tailing a file with streaming support
517
+ *
518
+ * @param filePath - Path to the file to tail
519
+ * @param options - Optional tail options
520
+ * @returns Handle to the tail operation
521
+ */
522
+ tailStreaming?(filePath: string, options?: {
523
+ signal?: AbortSignal;
524
+ pollInterval?: number;
525
+ }): TailHandle;
526
+ /**
527
+ * Delete a file
528
+ *
529
+ * @param filePath - Path to the file to delete
530
+ */
531
+ deleteFile(filePath: string): Promise<void>;
532
+ /**
533
+ * Delete a directory recursively
534
+ *
535
+ * @param dirPath - Path to the directory to delete
536
+ */
537
+ deleteDirectory(dirPath: string): Promise<void>;
538
+ /**
539
+ * Check if a file exists
540
+ *
541
+ * @param filePath - Path to check
542
+ * @returns Whether the file exists
543
+ */
544
+ exists(filePath: string): Promise<boolean>;
545
+ /**
546
+ * Read a file's contents
547
+ *
548
+ * @param filePath - Path to the file
549
+ * @returns File contents as string
550
+ */
551
+ readFile?(filePath: string): Promise<string>;
552
+ /**
553
+ * Write contents to a file
554
+ *
555
+ * @param filePath - Path to the file
556
+ * @param contents - Contents to write
557
+ */
558
+ writeFile?(filePath: string, contents: string): Promise<void>;
559
+ }
560
+ /**
561
+ * Combined adapters for a runtime
562
+ */
563
+ interface RuntimeAdapters {
564
+ exec: ExecAdapter;
565
+ fs: FsAdapter;
566
+ }
567
+ /**
568
+ * Factory function type for creating runtime adapters
569
+ */
570
+ type AdapterFactory = () => RuntimeAdapters;
571
+
572
+ export { type AdapterFactory as A, type Capabilities as C, type ExecAdapter as E, type FsAdapter as F, type GitErrorCategory as G, type LfsProgress as L, type NonEmptyString as N, type OutputContract as O, type RuntimeAdapters as R, type SpawnOptions as S, type TailOptions as T, type SpawnResult as a, type StreamHandler as b, type SpawnHandle as c, type TailHandle as d, type GitProgress as e, type ExecOpts as f, type RawResult as g, type GitErrorKind as h, isNonEmpty as i, GitError as j, GitArgumentError as k, type Runtime as l, type LfsMode as m, nonEmpty as n, type CommandSpec as o, type ExecutionContext as p, type GitOpenOptions as q, type CredentialRequest as r, type Credential as s, type CredentialConfig as t };