type-git 0.6.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,584 @@
1
+ import { C as Capabilities, a as CompanionExecutable, E as EnvInheritance, A as AuditConfig, b as ExecutionContext, c as ExecOpts, R as RawResult, d as GitError, G as Git, e as GitOpenOptions, W as WorktreeRepo, B as BareRepo, f as CloneOpts, I as InitOpts, L as LsRemoteOpts, g as LsRemoteResult, h as CommandExecOpts, i as GlobalConfigOperations, j as GlobalLfsOperations } from './git.d-DqAvRXEf.cjs';
2
+
3
+ /**
4
+ * Runtime adapter interfaces for cross-platform support (Node/Deno/Bun)
5
+ *
6
+ * This module defines:
7
+ * - ExecAdapter: Process execution abstraction (#15)
8
+ * - FsAdapter: Filesystem operations abstraction (#16)
9
+ * - Related types and options
10
+ */
11
+
12
+ /**
13
+ * Options for spawning a process
14
+ */
15
+ type SpawnOptions = {
16
+ /** Command and arguments (first element is the command) */
17
+ argv: string[];
18
+ /** UTF-8 text or raw bytes to write to standard input, then close it. */
19
+ stdin?: string | Uint8Array;
20
+ /** Additional environment variables */
21
+ env?: Record<string, string>;
22
+ /**
23
+ * Whether to merge the parent process environment underneath `env`.
24
+ *
25
+ * - `true` (default when omitted): the parent environment is merged underneath `env`,
26
+ * so the child inherits the full parent environment with `env` overrides on top.
27
+ * - `false`: the child receives only the variables in `env` (and nothing from the
28
+ * parent process). This prevents implicit environment variable traversal — used by
29
+ * {@link CliRunner}, which resolves the inherited variables itself.
30
+ */
31
+ inheritEnv?: boolean;
32
+ /** Working directory */
33
+ cwd?: string;
34
+ /** AbortSignal for cancellation */
35
+ signal?: AbortSignal;
36
+ /** Kill signal to use when aborting (default: SIGTERM) */
37
+ killSignal?: 'SIGTERM' | 'SIGKILL';
38
+ };
39
+ /**
40
+ * Result from spawning a process
41
+ */
42
+ type SpawnResult<Output = string> = {
43
+ /** Standard output */
44
+ stdout: Output;
45
+ /** Standard error */
46
+ stderr: string;
47
+ /** Exit code (-1 if unknown) */
48
+ exitCode: number;
49
+ /** Signal that terminated the process (if any) */
50
+ signal?: string;
51
+ /** Whether the process was aborted via AbortSignal */
52
+ aborted: boolean;
53
+ };
54
+ /**
55
+ * Stream handler for incremental output
56
+ *
57
+ * Used for progress tracking and real-time output processing.
58
+ */
59
+ type StreamHandler = {
60
+ /** Called when stdout data is received */
61
+ onStdout?: (chunk: string) => void;
62
+ /** Called when stderr data is received */
63
+ onStderr?: (chunk: string) => void;
64
+ };
65
+ /**
66
+ * Handle to a spawned process
67
+ *
68
+ * Allows streaming output and waiting for completion.
69
+ * Implements AsyncDisposable for use with `await using`.
70
+ *
71
+ * @example
72
+ * ```typescript
73
+ * // Traditional usage
74
+ * const handle = adapter.spawnStreaming({ argv: ['git', 'fetch'] });
75
+ * try {
76
+ * for await (const line of handle.stdout) { console.log(line); }
77
+ * } finally {
78
+ * handle.kill();
79
+ * }
80
+ *
81
+ * // With await using (recommended)
82
+ * await using handle = adapter.spawnStreaming({ argv: ['git', 'fetch'] });
83
+ * for await (const line of handle.stdout) { console.log(line); }
84
+ * // Automatically disposed when scope exits
85
+ * ```
86
+ */
87
+ interface SpawnHandle extends AsyncDisposable {
88
+ /** Async iterator for stdout lines */
89
+ readonly stdout: AsyncIterable<string>;
90
+ /** Async iterator for stderr lines */
91
+ readonly stderr: AsyncIterable<string>;
92
+ /** Wait for process completion */
93
+ wait(): Promise<SpawnResult>;
94
+ /** Kill the process */
95
+ kill(signal?: 'SIGTERM' | 'SIGKILL'): void;
96
+ }
97
+ /**
98
+ * Adapter interface for process execution
99
+ *
100
+ * Abstracts process spawning across Node.js, Deno, and Bun.
101
+ */
102
+ interface ExecAdapter {
103
+ /**
104
+ * Get the capabilities of this runtime
105
+ */
106
+ getCapabilities(): Capabilities;
107
+ /**
108
+ * Spawn a process and wait for completion
109
+ *
110
+ * @param options - Spawn options
111
+ * @param handlers - Optional stream handlers for real-time output
112
+ * @returns Promise resolving to spawn result
113
+ */
114
+ spawn(options: SpawnOptions, handlers?: StreamHandler): Promise<SpawnResult>;
115
+ /** Capture stdout bytes without text decoding; optional for custom adapters. */
116
+ spawnBytes?(options: SpawnOptions, handlers?: Pick<StreamHandler, 'onStderr'>): Promise<SpawnResult<Uint8Array>>;
117
+ /**
118
+ * Spawn a process with streaming support
119
+ *
120
+ * @param options - Spawn options
121
+ * @returns Handle to the spawned process
122
+ */
123
+ spawnStreaming?(options: SpawnOptions): SpawnHandle;
124
+ }
125
+ /**
126
+ * Options for tailing a file
127
+ */
128
+ type TailOptions = {
129
+ /** Path to the file to tail */
130
+ filePath: string;
131
+ /** AbortSignal for cancellation */
132
+ signal?: AbortSignal;
133
+ /** Callback for each new line */
134
+ onLine: (line: string) => void;
135
+ /** Start offset in bytes (default: 0) */
136
+ startOffset?: number;
137
+ /** Polling interval in milliseconds (default: 100) */
138
+ pollInterval?: number;
139
+ };
140
+ /**
141
+ * Handle to a tail operation
142
+ *
143
+ * Implements AsyncDisposable for use with `await using`.
144
+ *
145
+ * @example
146
+ * ```typescript
147
+ * // Traditional usage
148
+ * const handle = adapter.tailStreaming('/path/to/file');
149
+ * try {
150
+ * for await (const line of handle.lines) { console.log(line); }
151
+ * } finally {
152
+ * handle.stop();
153
+ * }
154
+ *
155
+ * // With await using (recommended)
156
+ * await using handle = adapter.tailStreaming('/path/to/file');
157
+ * for await (const line of handle.lines) { console.log(line); }
158
+ * // Automatically stopped when scope exits
159
+ * ```
160
+ */
161
+ interface TailHandle extends AsyncDisposable {
162
+ /** Async iterator for new lines */
163
+ readonly lines: AsyncIterable<string>;
164
+ /** Stop tailing */
165
+ stop(): void;
166
+ }
167
+ /**
168
+ * Adapter interface for filesystem operations
169
+ *
170
+ * Used primarily for LFS progress tracking via GIT_LFS_PROGRESS.
171
+ */
172
+ interface FsAdapter {
173
+ /**
174
+ * Create a temporary file and return its path
175
+ *
176
+ * Calling `deleteFile` with the returned path should release everything this method
177
+ * allocated (built-in adapters also remove the private directory holding the file).
178
+ *
179
+ * @param prefix - Optional prefix for the temp file name
180
+ * @returns Path to the created temporary file
181
+ */
182
+ createTempFile(prefix?: string): Promise<string>;
183
+ /**
184
+ * Create a fresh, empty temporary directory and return its path
185
+ *
186
+ * Callers remove it with {@link FsAdapter.deleteDirectory}.
187
+ *
188
+ * @param prefix - Optional prefix for the temp directory name
189
+ * @returns Path to the created temporary directory
190
+ */
191
+ createTempDirectory?(prefix?: string): Promise<string>;
192
+ /**
193
+ * Start tailing a file (watching for new lines)
194
+ *
195
+ * @param options - Tail options
196
+ * @returns Promise that resolves when tailing stops
197
+ */
198
+ tail(options: TailOptions): Promise<void>;
199
+ /**
200
+ * Start tailing a file with streaming support
201
+ *
202
+ * @param filePath - Path to the file to tail
203
+ * @param options - Optional tail options
204
+ * @returns Handle to the tail operation
205
+ */
206
+ tailStreaming?(filePath: string, options?: {
207
+ signal?: AbortSignal;
208
+ pollInterval?: number;
209
+ }): TailHandle;
210
+ /**
211
+ * Delete a file
212
+ *
213
+ * @param filePath - Path to the file to delete
214
+ */
215
+ deleteFile(filePath: string): Promise<void>;
216
+ /**
217
+ * Delete a directory recursively
218
+ *
219
+ * @param dirPath - Path to the directory to delete
220
+ */
221
+ deleteDirectory(dirPath: string): Promise<void>;
222
+ /**
223
+ * Check if a file exists
224
+ *
225
+ * @param filePath - Path to check
226
+ * @returns Whether the file exists
227
+ */
228
+ exists(filePath: string): Promise<boolean>;
229
+ /**
230
+ * List the names of a directory's entries
231
+ *
232
+ * Used by `git.open(path, { untrusted: true })`, which fails with `CapabilityMissing` when the
233
+ * adapter does not provide it.
234
+ *
235
+ * @param dirPath - Path to the directory
236
+ * @returns Entry names, or an empty array when the directory does not exist
237
+ */
238
+ readDirectory?(dirPath: string): Promise<string[]>;
239
+ /**
240
+ * Read a file's contents
241
+ *
242
+ * @param filePath - Path to the file
243
+ * @returns File contents as string
244
+ */
245
+ readFile?(filePath: string): Promise<string>;
246
+ /**
247
+ * Write contents to a file
248
+ *
249
+ * @param filePath - Path to the file
250
+ * @param contents - Contents to write
251
+ */
252
+ writeFile?(filePath: string, contents: string): Promise<void>;
253
+ }
254
+ /**
255
+ * Combined adapters for a runtime
256
+ */
257
+ interface RuntimeAdapters {
258
+ exec: ExecAdapter;
259
+ fs: FsAdapter;
260
+ }
261
+ /**
262
+ * Factory function type for creating runtime adapters
263
+ */
264
+ type AdapterFactory = () => RuntimeAdapters;
265
+
266
+ /**
267
+ * Credential helper configuration
268
+ */
269
+ type CredentialHelperConfig = {
270
+ /** Helper name (e.g., 'store', 'cache', 'manager-core', or custom name) */
271
+ helper?: string;
272
+ /** Path to custom helper binary */
273
+ helperPath?: string;
274
+ };
275
+ /**
276
+ * Options for CliRunner
277
+ */
278
+ type CliRunnerOptions = {
279
+ /** Paths for upstream standalone programs; gitweb defaults to gitweb.cgi on PATH. */
280
+ companionBinaries?: Partial<Record<CompanionExecutable, string>>;
281
+ /** Git binary path (default: 'git') */
282
+ gitBinary?: string;
283
+ /** Additional environment variables */
284
+ env?: Record<string, string>;
285
+ /**
286
+ * Controls how the parent process environment is inherited by spawned Git commands.
287
+ *
288
+ * By default, only a curated allowlist of variables that Git needs to operate is
289
+ * inherited (environment variable traversal prevention); the full parent environment is
290
+ * NOT forwarded. See {@link EnvInheritance} for all options.
291
+ *
292
+ * @default undefined (inherit the default allowlist)
293
+ */
294
+ inheritEnv?: EnvInheritance;
295
+ /** Directories to prepend to PATH */
296
+ pathPrefix?: string[];
297
+ /** Custom HOME directory for git config isolation */
298
+ home?: string;
299
+ /** Credential helper configuration */
300
+ credential?: CredentialHelperConfig;
301
+ /** Audit configuration for command tracking and tracing */
302
+ audit?: AuditConfig;
303
+ /**
304
+ * `key=value` configuration passed with `-c` to every command (and to companion programs
305
+ * through `GIT_CONFIG_PARAMETERS`). Merged runners append to the parent's list.
306
+ */
307
+ configOverrides?: readonly string[];
308
+ };
309
+ /**
310
+ * Per-call options for {@link CliRunner.run} / {@link CliRunner.runOrThrow}.
311
+ *
312
+ * Extends {@link ExecOpts} with an `env` overlay so callers (e.g. the repository
313
+ * implementations) can inject command-specific environment variables — such as
314
+ * `GIT_LFS_SKIP_SMUDGE` for an LFS skip-smudge mode. This keeps `env` out of the
315
+ * public `ExecOpts` / repository operation option types, scoping it to the
316
+ * runner's own `run` / `runOrThrow` entry points.
317
+ */
318
+ type RunOptions = ExecOpts & {
319
+ /** Data written to standard input (UTF-8 for a string, bytes unchanged), then closed. */
320
+ stdin?: string | Uint8Array;
321
+ /**
322
+ * Extra environment variables merged on top of the resolved environment for
323
+ * this single command. Values here take precedence over the configured
324
+ * environment but do not persist across calls.
325
+ */
326
+ env?: Record<string, string>;
327
+ };
328
+ /**
329
+ * CLI Runner for executing Git commands
330
+ *
331
+ * Handles:
332
+ * - Command construction based on execution context
333
+ * - Progress tracking from stderr (Git and LFS)
334
+ * - Abort signal handling
335
+ * - Error mapping
336
+ */
337
+ declare class CliRunner {
338
+ private readonly exec;
339
+ private readonly fs;
340
+ private readonly gitBinary;
341
+ private readonly companionBinaries;
342
+ private readonly baseEnv;
343
+ private readonly inheritEnv;
344
+ private readonly pathPrefix;
345
+ private readonly home;
346
+ private readonly credential;
347
+ private readonly audit;
348
+ private readonly configOverrides;
349
+ constructor(adapters: RuntimeAdapters, options?: CliRunnerOptions);
350
+ /**
351
+ * Create a new CliRunner with additional options merged
352
+ *
353
+ * Used to create a runner for a specific repository with custom environment
354
+ */
355
+ withOptions(options: CliRunnerOptions): CliRunner;
356
+ /** `key=value` pairs passed with `-c`: the credential helper, then the configured overrides. */
357
+ private configParameters;
358
+ /**
359
+ * Build command argv based on execution context
360
+ */
361
+ private buildArgv;
362
+ /**
363
+ * Build the effective environment for command execution
364
+ *
365
+ * Seeds the environment from the inherited (allowlisted) parent variables, then layers
366
+ * the configured `env`, home directory, and PATH prefix overrides on top. The parent
367
+ * process environment is never forwarded wholesale unless `inheritEnv: true` is set
368
+ * (environment variable traversal prevention).
369
+ */
370
+ private buildEnv;
371
+ /**
372
+ * Extract directory from a file path
373
+ */
374
+ private extractDirectory;
375
+ /**
376
+ * Run a Git command
377
+ */
378
+ /** Resolve environment-dependent filter constraints before convenience execution. */
379
+ validateFilterOptions(context: ExecutionContext, name: 'clone' | 'submoduleUpdate', options: object | undefined, opts?: RunOptions): Promise<void>;
380
+ /** Resolve mainline narrowing against the executable used by the convenience call. */
381
+ validateMainlineOptions(context: ExecutionContext, name: 'cherryPick' | 'revert', options: object | undefined, opts?: RunOptions): Promise<void>;
382
+ /**
383
+ * Run a probe of a builtin that requires a repository (RUN_SETUP).
384
+ *
385
+ * Global contexts carry no repository, so such probes would otherwise discover one from the
386
+ * process working directory: outside a repository Git dies before parsing options, and inside
387
+ * an unrelated one its configuration leaks in. Run them against a throwaway empty repository.
388
+ */
389
+ private runRepositoryProbe;
390
+ /** Observe atoi using an existing file so clone stops before transport or destination creation. */
391
+ private observeDepthAtoi;
392
+ /** Resolve depth and other native constraints for a convenience fetch call. */
393
+ validateFetchOptions(context: ExecutionContext, options: object | undefined, opts?: RunOptions): Promise<void>;
394
+ /** Check universally invalid input first, then only the native dimensions that affect validity. */
395
+ private validateNativeOptions;
396
+ /** Text execution remains independent of extra command output-mode options. */
397
+ run(context: ExecutionContext, args: string[], opts?: RunOptions): Promise<RawResult>;
398
+ /**
399
+ * Run an internal capability probe.
400
+ *
401
+ * Probes classify Git's own diagnostics, so tracing is stripped from their environment
402
+ * (including GIT_TRACE* variables configured by the caller) and they never reach the
403
+ * user's audit or trace callbacks.
404
+ */
405
+ private probe;
406
+ runBytes(context: ExecutionContext, args: string[], opts?: RunOptions): Promise<RawResult<Uint8Array>>;
407
+ /** Run a standalone upstream program through the shared text execution path. */
408
+ runCompanion(context: ExecutionContext, executable: CompanionExecutable, args: string[], opts?: RunOptions): Promise<RawResult>;
409
+ /** Capture standalone program output without text decoding. */
410
+ runCompanionBytes(context: ExecutionContext, executable: CompanionExecutable, args: string[], opts?: RunOptions): Promise<RawResult<Uint8Array>>;
411
+ /** Validate per-call options, then spawn one Git or companion process and collect its result. */
412
+ private execute;
413
+ /**
414
+ * Process a single line from stderr for progress and trace callbacks
415
+ */
416
+ private processStderrLine;
417
+ /**
418
+ * Map Git result to GitError if needed
419
+ */
420
+ mapError(result: RawResult, context: ExecutionContext, argv: string[]): GitError | null;
421
+ /**
422
+ * Classify error type based on stderr content
423
+ */
424
+ private classifyError;
425
+ /**
426
+ * Extract user-friendly error message from stderr
427
+ */
428
+ private extractErrorMessage;
429
+ /**
430
+ * Run a command and throw on error
431
+ */
432
+ checkResult(context: ExecutionContext, args: string[], result: RawResult): void;
433
+ runOrThrow(context: ExecutionContext, args: string[], opts?: RunOptions): Promise<RawResult>;
434
+ }
435
+
436
+ /**
437
+ * Git implementation - repository-agnostic operations
438
+ */
439
+
440
+ /**
441
+ * Default minimum supported Git version.
442
+ *
443
+ * This is the minimum version required when `useLegacyVersion` is false (the default).
444
+ * Use `useLegacyVersion: true` to allow older Git versions (2.25.0+).
445
+ */
446
+ declare const MIN_GIT_VERSION = "2.30.0";
447
+ /**
448
+ * Legacy minimum Git version
449
+ *
450
+ * When `useLegacyVersion: true` is set, this version is used as the minimum.
451
+ * Git 2.25.0 is the default version on Ubuntu 20.04 LTS.
452
+ */
453
+ declare const LEGACY_GIT_VERSION = "2.25.0";
454
+ /**
455
+ * Options for creating a Git instance
456
+ */
457
+ type CreateGitOptions = CliRunnerOptions & {
458
+ /** Runtime adapters (exec, fs) */
459
+ adapters: RuntimeAdapters;
460
+ /**
461
+ * Controls whether to perform a Git version check during initialization.
462
+ * When true, skips the Git version check. When false (default), throws
463
+ * GitError if Git version is below the minimum required version.
464
+ * @default false
465
+ */
466
+ skipVersionCheck?: boolean;
467
+ /**
468
+ * Allow legacy Git versions (2.25.0+) instead of requiring 2.30.0+.
469
+ *
470
+ * Use this for environments with older Git installations such as
471
+ * Ubuntu 20.04 LTS which ships with Git 2.25.1 by default.
472
+ *
473
+ * @default false
474
+ */
475
+ useLegacyVersion?: boolean;
476
+ };
477
+ /**
478
+ * Create a new Git instance (synchronous, no version check)
479
+ *
480
+ * @param options - Creation options including runtime adapters
481
+ * @returns Git instance
482
+ * @deprecated Use createGit instead for version checking
483
+ */
484
+ declare function createGitSync(options: CreateGitOptions): Git;
485
+ /**
486
+ * Create a new Git instance with optional version check
487
+ *
488
+ * @param options - Creation options including runtime adapters
489
+ * @returns Git instance
490
+ * @throws GitError with kind 'UnsupportedGitVersion' if Git version is below minimum
491
+ */
492
+ declare function createGit(options: CreateGitOptions): Promise<Git>;
493
+
494
+ /** Runtime-independent convenience client. Runtime entrypoints supply the adapters. */
495
+ declare class GitClient implements Git {
496
+ private readonly git;
497
+ constructor(git: Git);
498
+ get open(): (path: string, opts?: GitOpenOptions) => Promise<WorktreeRepo>;
499
+ /**
500
+ * Open an existing bare repository
501
+ *
502
+ * Throws GitError if the repository is not bare.
503
+ *
504
+ * @throws GitError with kind 'NotBareRepo' if the repository is not bare
505
+ */
506
+ get openBare(): (path: string, opts?: GitOpenOptions) => Promise<BareRepo>;
507
+ /**
508
+ * Open an existing repository without type guarantee
509
+ *
510
+ * Returns either WorktreeRepo or BareRepo depending on the repository type.
511
+ * Use this when you don't know the repository type at compile time.
512
+ */
513
+ get openRaw(): (path: string, opts?: GitOpenOptions) => Promise<WorktreeRepo | BareRepo>;
514
+ /**
515
+ * Clone a repository
516
+ *
517
+ * The return type depends on the `bare` or `mirror` option:
518
+ * - `{ bare: true }` or `{ mirror: true }` → `BareRepo`
519
+ * - Otherwise → `WorktreeRepo`
520
+ */
521
+ clone(url: string, path: string, opts: CloneOpts & {
522
+ bare: true;
523
+ } & ExecOpts): Promise<BareRepo>;
524
+ clone(url: string, path: string, opts: CloneOpts & {
525
+ mirror: true;
526
+ } & ExecOpts): Promise<BareRepo>;
527
+ clone(url: string, path: string, opts?: CloneOpts & {
528
+ bare?: false;
529
+ mirror?: false;
530
+ } & ExecOpts): Promise<WorktreeRepo>;
531
+ clone(url: string, path: string, opts?: CloneOpts & ExecOpts): Promise<WorktreeRepo | BareRepo>;
532
+ /**
533
+ * Initialize a new repository
534
+ *
535
+ * The return type depends on the `bare` option:
536
+ * - `{ bare: true }` → `BareRepo`
537
+ * - Otherwise → `WorktreeRepo`
538
+ */
539
+ init(path: string, opts: InitOpts & {
540
+ bare: true;
541
+ } & ExecOpts): Promise<BareRepo>;
542
+ init(path: string, opts?: InitOpts & {
543
+ bare?: false;
544
+ } & ExecOpts): Promise<WorktreeRepo>;
545
+ init(path: string, opts?: InitOpts & ExecOpts): Promise<WorktreeRepo | BareRepo>;
546
+ /**
547
+ * List references in a remote repository
548
+ */
549
+ get lsRemote(): (url: string, opts?: LsRemoteOpts & ExecOpts) => Promise<LsRemoteResult>;
550
+ /**
551
+ * Get git version
552
+ */
553
+ get version(): (opts?: ExecOpts) => Promise<string>;
554
+ /** Execute a raw Git command without typed argument validation. */
555
+ get raw(): (argv: string[], opts?: CommandExecOpts) => Promise<RawResult>;
556
+ /**
557
+ * Global config operations
558
+ *
559
+ * Operates on ~/.gitconfig (user-level configuration).
560
+ * For repository-level config, use repo.config instead.
561
+ */
562
+ get config(): GlobalConfigOperations;
563
+ /**
564
+ * Global LFS operations
565
+ *
566
+ * Operates on ~/.gitconfig (user-level) or /etc/gitconfig (system-level).
567
+ * For repository-level LFS operations, use repo.lfs instead.
568
+ *
569
+ * @example
570
+ * ```typescript
571
+ * // Install LFS globally
572
+ * await git.lfs.install();
573
+ *
574
+ * // Install system-wide
575
+ * await git.lfs.install({ system: true });
576
+ *
577
+ * // Get LFS version
578
+ * const version = await git.lfs.version();
579
+ * ```
580
+ */
581
+ get lfs(): GlobalLfsOperations;
582
+ }
583
+
584
+ export { type AdapterFactory as A, type CreateGitOptions as C, type ExecAdapter as E, type FsAdapter as F, GitClient as G, LEGACY_GIT_VERSION as L, MIN_GIT_VERSION as M, type RuntimeAdapters as R, type SpawnOptions as S, type TailOptions as T, type StreamHandler as a, type SpawnResult as b, type SpawnHandle as c, type TailHandle as d, createGit as e, createGitSync as f, CliRunner as g, type CliRunnerOptions as h };