type-git 0.7.0 → 0.8.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.
package/README.md CHANGED
@@ -119,6 +119,13 @@ and the runtime checks against argument injection, and neither its bundle nor it
119
119
  declarations include the catalogue. For an application that only calls high-level methods such
120
120
  as `repo.status()`, the bundled size is about 180 KB minified instead of about 1.6 MB.
121
121
 
122
+ Nothing outside `dist/strict/` loads from it, so an application that ships its `node_modules`
123
+ (for example an Electron app) and never imports `type-git/strict` can leave that directory out,
124
+ such as with `"!**/node_modules/type-git/dist/strict/**"` in electron-builder's `files`.
125
+ The strict entry keeps its catalogue in a CommonJS file that both its ESM and CJS builds load, so
126
+ an ESM bundler needs CommonJS interop to bundle `type-git/strict` (esbuild, webpack and Vite have
127
+ it built in; Rollup needs `@rollup/plugin-commonjs`).
128
+
122
129
  ### Advanced Usage
123
130
 
124
131
  For more control over adapters, you can use the factory function:
@@ -165,6 +172,9 @@ const lfsStatus = await repo.lfs.status();
165
172
 
166
173
  // Raw escape hatch when needed
167
174
  const result = await repo.raw(['rev-parse', 'HEAD']);
175
+
176
+ // Send data on stdin instead of putting it in argv
177
+ const { stdout: blobId } = await repo.raw(['hash-object', '-w', '--stdin'], { stdin: 'hello' });
168
178
  ```
169
179
 
170
180
  ### Audit Mode
@@ -218,6 +228,96 @@ Runs `git lfs push --object-id origin --stdin`, sending one OID per line and
218
228
  closing standard input. This avoids command-line length limits for large OID lists.
219
229
  Omit `stdin` to pass object IDs as command-line arguments.
220
230
 
231
+ ## Security model
232
+
233
+ type-git checks where an untrusted value, such as a branch name, remote URL or path typed by a
234
+ user, could otherwise turn into a Git option. It does not make every input safe. This section
235
+ lists what each API level checks and what stays the caller's responsibility.
236
+
237
+ **High-level API** (`repo.status()`, `git.clone()`, `repo.fetch()`, …)
238
+
239
+ - Remotes, URLs, refs, paths and other positional operands that start with `-` are refused
240
+ with `GitArgumentError` before Git starts, because Git would parse them as options such as
241
+ `--upload-pack=<command>`. Many path lists are also passed after `--`.
242
+ - Option names come from the typed option fields. A caller's string becomes an option value or
243
+ an operand, not a new option.
244
+ - `git.clone(url, path, { config })` accepts only data-only configuration keys (see
245
+ `CloneConfigSchema`). Keys such as `protocol.ext.allow`, `include.path`, `core.sshCommand`
246
+ or `core.fsmonitor` are refused, because `git clone -c` would apply them to the first fetch.
247
+ Transport keys such as `http.sslVerify`, `http.proxy` and `http.extraHeader` are accepted:
248
+ they cannot run a program, but they decide which server is trusted and what is sent to it.
249
+ - Some options exist to run a program, and they run what you give them. Treat these values
250
+ as code: `config.set()`, `config.add()` and `config.setRaw()` (for example `core.sshCommand`,
251
+ `core.pager`, `gpg.program`), `submodule.foreach()`, `rebase({ exec })`, the merge
252
+ `strategy` (Git runs `git-merge-<strategy>`) and the `credentialHelper` open option.
253
+
254
+ **Strict API** (`strict(repo).command(...)`)
255
+
256
+ - Options are checked against Git's option grammar. Only canonical option names are accepted:
257
+ abbreviations such as `--upload-p` and bundled short options that hide another option, such as
258
+ `-vu`, are refused.
259
+ - An `{ operand }` that starts with `-` is refused wherever Git would read it as an option, for
260
+ example before an explicit `['--']`.
261
+
262
+ **Raw API** (`git.raw(argv)`, `repo.raw(argv)`)
263
+
264
+ - `raw()` passes `argv` to Git unchanged and checks nothing. Build its argv only from trusted
265
+ values. Send untrusted data on standard input with the `stdin` option instead of in argv, but
266
+ only to a command that reads standard input as data, such as `hash-object --stdin` or
267
+ `commit -F -`. Commands that read standard input as instructions, such as `fast-import` or
268
+ `update-ref --stdin`, let that input create or move refs, so do not feed them untrusted input.
269
+
270
+ **Environment**
271
+
272
+ - Spawned Git processes inherit only an allowlist of the parent environment
273
+ (`DEFAULT_ENV_ALLOWLIST`), so other application secrets are not passed on. No variable that
274
+ names a program Git runs, such as `GIT_SSH_COMMAND`, `GIT_ASKPASS`, `GIT_EXTERNAL_DIFF` or
275
+ `GIT_PAGER`, is inherited by default. Opt one in with `inheritEnv: ['GIT_SSH_COMMAND']`, or
276
+ pass it with the `env` option, when you trust the value.
277
+ - `inheritEnv: true` passes the whole parent environment, including application secrets and the
278
+ program-naming variables above. A predicate passed as `inheritEnv` bypasses
279
+ `DEFAULT_ENV_ALLOWLIST` and passes exactly the variables it selects. Use these forms only when
280
+ every variable they can select is trusted.
281
+ - The allowlist does pass `PATH` (which picks the `ssh`, `git-lfs` and `git-remote-*` programs),
282
+ `HOME` (and so `~/.gitconfig`), the proxy variables (whose URLs may hold credentials) and the
283
+ SSH agent variables. An HTTPS-only application can drop the agent with
284
+ `inheritEnv: { remove: ['SSH_AUTH_SOCK', 'SSH_AGENT_PID'] }`.
285
+
286
+ **Untrusted repositories** (`git.open(path, { untrusted: true })`)
287
+
288
+ - Git runs whatever a repository's own configuration and hooks name, such as `core.fsmonitor`,
289
+ hooks, and clean, smudge or diff filters. By default, opening a repository directory that
290
+ someone else controls is as dangerous with type-git as running `git status` in it yourself.
291
+ - With `untrusted: true` (also on `openBare()` and `openRaw()`), every command runs with `-c`
292
+ overrides that point `core.hooksPath` at a path that cannot hold hooks, turn off
293
+ `core.fsmonitor`, refuse the `ext::` transport and set `safe.bareRepository=explicit`.
294
+ Opening fails with `GitError` kind `'UnsafeRepoConfig'` when the repository's own
295
+ configuration (`local` and `worktree` scopes, including included files) sets any key outside a
296
+ closed list of data-only keys. The list covers the usual keys that `git init`, `git clone`,
297
+ `git sparse-checkout` and `git lfs install` write, `branch.<name>.*` and similar; driver keys
298
+ such as `diff.<driver>.textconv` cannot be overridden by name, so they are refused instead.
299
+ The configuration of every populated submodule is checked the same way, because Git runs
300
+ commands such as `status` inside submodules.
301
+ - A key that names a remote, such as `branch.<name>.remote`, must name a remote whose URL the
302
+ repository's configuration sets, and a repository with legacy `.git/remotes/` or
303
+ `.git/branches/` files is refused: Git reads those for remotes the configuration does not
304
+ define, and a name without a URL is read as a path. A custom file system adapter needs
305
+ `readDirectory` for untrusted mode.
306
+ - Remote and submodule URLs in that configuration must be `https`, `http`, `ssh`, `git` or
307
+ scp-style URLs. A local path or `file://` URL would make Git run `upload-pack` or
308
+ `receive-pack` in another repository without the overrides, so its hooks and configuration
309
+ would run unchecked. The same holds for a local path you pass yourself as a remote, so pass
310
+ one only when you trust that repository.
311
+ - The check runs once, when the repository is opened, so nobody else may change the directory
312
+ while you use it. Your own global and system configuration is still trusted. Open a worktree
313
+ by its top-level directory, not its `.git` directory. Untrusted mode needs Git 2.38 or later.
314
+
315
+ **Not covered**
316
+ - A cloned repository does not carry the remote's configuration or hooks. Its `.gitattributes`
317
+ can still select filters that your own configuration defines, and its `.gitmodules` and
318
+ `.lfsconfig` still steer submodule and LFS transfers. The clone `template` option and your
319
+ `init.templateDir` copy hooks into the new repository.
320
+
221
321
  ## Architecture
222
322
 
223
323
  ```
@@ -5,8 +5,8 @@
5
5
 
6
6
 
7
7
 
8
- var _chunkNBX6BNQFcjs = require('../../chunk-NBX6BNQF.cjs');
9
- require('../../chunk-MFY7MGIJ.cjs');
8
+ var _chunkUHZWPYTFcjs = require('../../chunk-UHZWPYTF.cjs');
9
+ require('../../chunk-6HDMSFY7.cjs');
10
10
 
11
11
  // src/adapters/bun/exec.ts
12
12
  function resolveChildEnv(env, inheritEnv) {
@@ -117,7 +117,7 @@ var BunExecAdapter = class {
117
117
  let stderr = "";
118
118
  if (binary) {
119
119
  [stdout, stderr] = await Promise.all([
120
- proc.stdout ? _chunkNBX6BNQFcjs.readBytes.call(void 0, proc.stdout) : Promise.resolve(new Uint8Array(0)),
120
+ proc.stdout ? _chunkUHZWPYTFcjs.readBytes.call(void 0, proc.stdout) : Promise.resolve(new Uint8Array(0)),
121
121
  proc.stderr ? readStream(proc.stderr, _optionalChain([handlers, 'optionalAccess', _4 => _4.onStderr])) : Promise.resolve("")
122
122
  ]);
123
123
  } else if (_optionalChain([handlers, 'optionalAccess', _5 => _5.onStdout]) || _optionalChain([handlers, 'optionalAccess', _6 => _6.onStderr])) {
@@ -294,7 +294,7 @@ var BunFsAdapter = (_class = class {constructor() { _class.prototype.__init.call
294
294
  },
295
295
  sleep: (ms) => Bun.sleep(ms)
296
296
  };
297
- await _chunkNBX6BNQFcjs.runTailPolling.call(void 0, { adapter, signal, pollInterval, onLine });
297
+ await _chunkUHZWPYTFcjs.runTailPolling.call(void 0, { adapter, signal, pollInterval, onLine });
298
298
  }
299
299
  async deleteFile(filePath) {
300
300
  const tempDir = this.tempFileDirs.get(filePath);
@@ -308,6 +308,17 @@ var BunFsAdapter = (_class = class {constructor() { _class.prototype.__init.call
308
308
  async deleteDirectory(dirPath) {
309
309
  await _promises.rm.call(void 0, dirPath, { force: true, recursive: true });
310
310
  }
311
+ async readDirectory(dirPath) {
312
+ try {
313
+ return await _promises.readdir.call(void 0, dirPath);
314
+ } catch (error) {
315
+ const code = error.code;
316
+ if (code === "ENOENT" || code === "ENOTDIR") {
317
+ return [];
318
+ }
319
+ throw error;
320
+ }
321
+ }
311
322
  async exists(filePath) {
312
323
  const file = Bun.file(filePath);
313
324
  return await file.exists();
@@ -338,7 +349,7 @@ var BunFsAdapter = (_class = class {constructor() { _class.prototype.__init.call
338
349
  },
339
350
  sleep: (ms) => Bun.sleep(ms)
340
351
  };
341
- return _chunkNBX6BNQFcjs.createTailPolling.call(void 0, { adapter, signal, pollInterval });
352
+ return _chunkUHZWPYTFcjs.createTailPolling.call(void 0, { adapter, signal, pollInterval });
342
353
  }
343
354
  }, _class);
344
355
 
@@ -349,13 +360,13 @@ function createBunAdapters() {
349
360
  fs: new BunFsAdapter()
350
361
  };
351
362
  }
352
- var TypeGit = class _TypeGit extends _chunkNBX6BNQFcjs.GitClient {
363
+ var TypeGit = class _TypeGit extends _chunkUHZWPYTFcjs.GitClient {
353
364
  static async create(options) {
354
- return new _TypeGit(await _chunkNBX6BNQFcjs.createGit.call(void 0, { ...options, adapters: createBunAdapters() }));
365
+ return new _TypeGit(await _chunkUHZWPYTFcjs.createGit.call(void 0, { ...options, adapters: createBunAdapters() }));
355
366
  }
356
367
  constructor(optionsOrGit) {
357
368
  super(
358
- optionsOrGit && "open" in optionsOrGit ? optionsOrGit : _chunkNBX6BNQFcjs.createGitSync.call(void 0, { ...optionsOrGit, adapters: createBunAdapters() })
369
+ optionsOrGit && "open" in optionsOrGit ? optionsOrGit : _chunkUHZWPYTFcjs.createGitSync.call(void 0, { ...optionsOrGit, adapters: createBunAdapters() })
359
370
  );
360
371
  }
361
372
  };
@@ -1,5 +1,5 @@
1
- import { E as ExecAdapter, S as SpawnOptions, a as StreamHandler, b as SpawnResult, c as SpawnHandle, F as FsAdapter, T as TailOptions, d as TailHandle, R as RuntimeAdapters, C as CreateGitOptions, G as GitClient } from '../../client.d-PRQCR2_T.cjs';
2
- import { C as Capabilities, G as Git } from '../../git.d-DrhCzWEn.cjs';
1
+ import { E as ExecAdapter, S as SpawnOptions, a as StreamHandler, b as SpawnResult, c as SpawnHandle, F as FsAdapter, T as TailOptions, d as TailHandle, R as RuntimeAdapters, C as CreateGitOptions, G as GitClient } from '../../client.d-Cg5wWJnY.cjs';
2
+ import { C as Capabilities, G as Git } from '../../git.d-DqAvRXEf.cjs';
3
3
 
4
4
  /**
5
5
  * Bun ExecAdapter implementation
@@ -29,6 +29,7 @@ declare class BunFsAdapter implements FsAdapter {
29
29
  tail(options: TailOptions): Promise<void>;
30
30
  deleteFile(filePath: string): Promise<void>;
31
31
  deleteDirectory(dirPath: string): Promise<void>;
32
+ readDirectory(dirPath: string): Promise<string[]>;
32
33
  exists(filePath: string): Promise<boolean>;
33
34
  readFile(filePath: string): Promise<string>;
34
35
  writeFile(filePath: string, contents: string): Promise<void>;
@@ -1,5 +1,5 @@
1
- import { E as ExecAdapter, S as SpawnOptions, a as StreamHandler, b as SpawnResult, c as SpawnHandle, F as FsAdapter, T as TailOptions, d as TailHandle, R as RuntimeAdapters, C as CreateGitOptions, G as GitClient } from '../../client.d-Cs32YZX6.js';
2
- import { C as Capabilities, G as Git } from '../../git.d-DrhCzWEn.cjs';
1
+ import { E as ExecAdapter, S as SpawnOptions, a as StreamHandler, b as SpawnResult, c as SpawnHandle, F as FsAdapter, T as TailOptions, d as TailHandle, R as RuntimeAdapters, C as CreateGitOptions, G as GitClient } from '../../client.d-DCiFA_CK.js';
2
+ import { C as Capabilities, G as Git } from '../../git.d-DqAvRXEf.cjs';
3
3
 
4
4
  /**
5
5
  * Bun ExecAdapter implementation
@@ -29,6 +29,7 @@ declare class BunFsAdapter implements FsAdapter {
29
29
  tail(options: TailOptions): Promise<void>;
30
30
  deleteFile(filePath: string): Promise<void>;
31
31
  deleteDirectory(dirPath: string): Promise<void>;
32
+ readDirectory(dirPath: string): Promise<string[]>;
32
33
  exists(filePath: string): Promise<boolean>;
33
34
  readFile(filePath: string): Promise<string>;
34
35
  writeFile(filePath: string, contents: string): Promise<void>;
@@ -5,8 +5,8 @@ import {
5
5
  createTailPolling,
6
6
  readBytes,
7
7
  runTailPolling
8
- } from "../../chunk-YIWTIIXH.js";
9
- import "../../chunk-5NI3KM5Z.js";
8
+ } from "../../chunk-ADC26634.js";
9
+ import "../../chunk-UAKOSACD.js";
10
10
 
11
11
  // src/adapters/bun/exec.ts
12
12
  function resolveChildEnv(env, inheritEnv) {
@@ -259,7 +259,7 @@ var BunExecAdapter = class {
259
259
  };
260
260
 
261
261
  // src/adapters/bun/fs.ts
262
- import { mkdtemp, rm } from "fs/promises";
262
+ import { mkdtemp, readdir, rm } from "fs/promises";
263
263
  import { tmpdir } from "os";
264
264
  import { join } from "path";
265
265
  var BunFsAdapter = class {
@@ -308,6 +308,17 @@ var BunFsAdapter = class {
308
308
  async deleteDirectory(dirPath) {
309
309
  await rm(dirPath, { force: true, recursive: true });
310
310
  }
311
+ async readDirectory(dirPath) {
312
+ try {
313
+ return await readdir(dirPath);
314
+ } catch (error) {
315
+ const code = error.code;
316
+ if (code === "ENOENT" || code === "ENOTDIR") {
317
+ return [];
318
+ }
319
+ throw error;
320
+ }
321
+ }
311
322
  async exists(filePath) {
312
323
  const file = Bun.file(filePath);
313
324
  return await file.exists();
@@ -5,8 +5,8 @@
5
5
 
6
6
 
7
7
 
8
- var _chunkNBX6BNQFcjs = require('../../chunk-NBX6BNQF.cjs');
9
- require('../../chunk-MFY7MGIJ.cjs');
8
+ var _chunkUHZWPYTFcjs = require('../../chunk-UHZWPYTF.cjs');
9
+ require('../../chunk-6HDMSFY7.cjs');
10
10
 
11
11
  // src/adapters/deno/exec.ts
12
12
  function resolveChildEnvOptions(env, inheritEnv) {
@@ -141,7 +141,7 @@ var DenoExecAdapter = class {
141
141
  let stderr = "";
142
142
  if (binary) {
143
143
  [stdout, stderr] = await Promise.all([
144
- child.stdout ? _chunkNBX6BNQFcjs.readBytes.call(void 0, child.stdout) : Promise.resolve(new Uint8Array(0)),
144
+ child.stdout ? _chunkUHZWPYTFcjs.readBytes.call(void 0, child.stdout) : Promise.resolve(new Uint8Array(0)),
145
145
  child.stderr ? readStream(child.stderr, _optionalChain([handlers, 'optionalAccess', _4 => _4.onStderr])) : Promise.resolve("")
146
146
  ]);
147
147
  } else if (_optionalChain([handlers, 'optionalAccess', _5 => _5.onStdout]) || _optionalChain([handlers, 'optionalAccess', _6 => _6.onStderr])) {
@@ -357,7 +357,7 @@ var DenoFsAdapter = (_class = class {constructor() { _class.prototype.__init.cal
357
357
  },
358
358
  sleep: (ms) => delay(ms)
359
359
  };
360
- await _chunkNBX6BNQFcjs.runTailPolling.call(void 0, { adapter, signal, pollInterval, onLine });
360
+ await _chunkUHZWPYTFcjs.runTailPolling.call(void 0, { adapter, signal, pollInterval, onLine });
361
361
  }
362
362
  async deleteFile(filePath) {
363
363
  const tempDir = this.tempFileDirs.get(filePath);
@@ -385,6 +385,21 @@ var DenoFsAdapter = (_class = class {constructor() { _class.prototype.__init.cal
385
385
  }
386
386
  }
387
387
  }
388
+ async readDirectory(dirPath) {
389
+ const names = [];
390
+ try {
391
+ for await (const entry of Deno.readDir(dirPath)) {
392
+ names.push(entry.name);
393
+ }
394
+ } catch (error) {
395
+ const notADirectory = Deno.errors.NotADirectory;
396
+ if (error instanceof Deno.errors.NotFound || notADirectory !== void 0 && error instanceof notADirectory) {
397
+ return [];
398
+ }
399
+ throw error;
400
+ }
401
+ return names;
402
+ }
388
403
  async exists(filePath) {
389
404
  try {
390
405
  await Deno.stat(filePath);
@@ -428,7 +443,7 @@ var DenoFsAdapter = (_class = class {constructor() { _class.prototype.__init.cal
428
443
  },
429
444
  sleep: (ms) => delay(ms)
430
445
  };
431
- return _chunkNBX6BNQFcjs.createTailPolling.call(void 0, { adapter, signal, pollInterval });
446
+ return _chunkUHZWPYTFcjs.createTailPolling.call(void 0, { adapter, signal, pollInterval });
432
447
  }
433
448
  }, _class);
434
449
 
@@ -439,13 +454,13 @@ function createDenoAdapters() {
439
454
  fs: new DenoFsAdapter()
440
455
  };
441
456
  }
442
- var TypeGit = class _TypeGit extends _chunkNBX6BNQFcjs.GitClient {
457
+ var TypeGit = class _TypeGit extends _chunkUHZWPYTFcjs.GitClient {
443
458
  static async create(options) {
444
- return new _TypeGit(await _chunkNBX6BNQFcjs.createGit.call(void 0, { ...options, adapters: createDenoAdapters() }));
459
+ return new _TypeGit(await _chunkUHZWPYTFcjs.createGit.call(void 0, { ...options, adapters: createDenoAdapters() }));
445
460
  }
446
461
  constructor(optionsOrGit) {
447
462
  super(
448
- optionsOrGit && "open" in optionsOrGit ? optionsOrGit : _chunkNBX6BNQFcjs.createGitSync.call(void 0, { ...optionsOrGit, adapters: createDenoAdapters() })
463
+ optionsOrGit && "open" in optionsOrGit ? optionsOrGit : _chunkUHZWPYTFcjs.createGitSync.call(void 0, { ...optionsOrGit, adapters: createDenoAdapters() })
449
464
  );
450
465
  }
451
466
  };
@@ -1,5 +1,5 @@
1
- import { E as ExecAdapter, S as SpawnOptions, a as StreamHandler, b as SpawnResult, c as SpawnHandle, F as FsAdapter, T as TailOptions, d as TailHandle, R as RuntimeAdapters, C as CreateGitOptions, G as GitClient } from '../../client.d-PRQCR2_T.cjs';
2
- import { C as Capabilities, G as Git } from '../../git.d-DrhCzWEn.cjs';
1
+ import { E as ExecAdapter, S as SpawnOptions, a as StreamHandler, b as SpawnResult, c as SpawnHandle, F as FsAdapter, T as TailOptions, d as TailHandle, R as RuntimeAdapters, C as CreateGitOptions, G as GitClient } from '../../client.d-Cg5wWJnY.cjs';
2
+ import { C as Capabilities, G as Git } from '../../git.d-DqAvRXEf.cjs';
3
3
 
4
4
  /**
5
5
  * Deno ExecAdapter implementation
@@ -31,6 +31,7 @@ declare class DenoFsAdapter implements FsAdapter {
31
31
  tail(options: TailOptions): Promise<void>;
32
32
  deleteFile(filePath: string): Promise<void>;
33
33
  deleteDirectory(dirPath: string): Promise<void>;
34
+ readDirectory(dirPath: string): Promise<string[]>;
34
35
  exists(filePath: string): Promise<boolean>;
35
36
  readFile(filePath: string): Promise<string>;
36
37
  writeFile(filePath: string, contents: string): Promise<void>;
@@ -1,5 +1,5 @@
1
- import { E as ExecAdapter, S as SpawnOptions, a as StreamHandler, b as SpawnResult, c as SpawnHandle, F as FsAdapter, T as TailOptions, d as TailHandle, R as RuntimeAdapters, C as CreateGitOptions, G as GitClient } from '../../client.d-Cs32YZX6.js';
2
- import { C as Capabilities, G as Git } from '../../git.d-DrhCzWEn.cjs';
1
+ import { E as ExecAdapter, S as SpawnOptions, a as StreamHandler, b as SpawnResult, c as SpawnHandle, F as FsAdapter, T as TailOptions, d as TailHandle, R as RuntimeAdapters, C as CreateGitOptions, G as GitClient } from '../../client.d-DCiFA_CK.js';
2
+ import { C as Capabilities, G as Git } from '../../git.d-DqAvRXEf.cjs';
3
3
 
4
4
  /**
5
5
  * Deno ExecAdapter implementation
@@ -31,6 +31,7 @@ declare class DenoFsAdapter implements FsAdapter {
31
31
  tail(options: TailOptions): Promise<void>;
32
32
  deleteFile(filePath: string): Promise<void>;
33
33
  deleteDirectory(dirPath: string): Promise<void>;
34
+ readDirectory(dirPath: string): Promise<string[]>;
34
35
  exists(filePath: string): Promise<boolean>;
35
36
  readFile(filePath: string): Promise<string>;
36
37
  writeFile(filePath: string, contents: string): Promise<void>;
@@ -5,8 +5,8 @@ import {
5
5
  createTailPolling,
6
6
  readBytes,
7
7
  runTailPolling
8
- } from "../../chunk-YIWTIIXH.js";
9
- import "../../chunk-5NI3KM5Z.js";
8
+ } from "../../chunk-ADC26634.js";
9
+ import "../../chunk-UAKOSACD.js";
10
10
 
11
11
  // src/adapters/deno/exec.ts
12
12
  function resolveChildEnvOptions(env, inheritEnv) {
@@ -385,6 +385,21 @@ var DenoFsAdapter = class {
385
385
  }
386
386
  }
387
387
  }
388
+ async readDirectory(dirPath) {
389
+ const names = [];
390
+ try {
391
+ for await (const entry of Deno.readDir(dirPath)) {
392
+ names.push(entry.name);
393
+ }
394
+ } catch (error) {
395
+ const notADirectory = Deno.errors.NotADirectory;
396
+ if (error instanceof Deno.errors.NotFound || notADirectory !== void 0 && error instanceof notADirectory) {
397
+ return [];
398
+ }
399
+ throw error;
400
+ }
401
+ return names;
402
+ }
388
403
  async exists(filePath) {
389
404
  try {
390
405
  await Deno.stat(filePath);
@@ -3,12 +3,12 @@
3
3
 
4
4
 
5
5
 
6
- var _chunkX3F6MDXQcjs = require('../../chunk-X3F6MDXQ.cjs');
7
- require('../../chunk-NBX6BNQF.cjs');
8
- require('../../chunk-MFY7MGIJ.cjs');
6
+ var _chunkJDCCYWIXcjs = require('../../chunk-JDCCYWIX.cjs');
7
+ require('../../chunk-UHZWPYTF.cjs');
8
+ require('../../chunk-6HDMSFY7.cjs');
9
9
 
10
10
 
11
11
 
12
12
 
13
13
 
14
- exports.NodeExecAdapter = _chunkX3F6MDXQcjs.NodeExecAdapter; exports.NodeFsAdapter = _chunkX3F6MDXQcjs.NodeFsAdapter; exports.TypeGit = _chunkX3F6MDXQcjs.TypeGit; exports.createNodeAdapters = _chunkX3F6MDXQcjs.createNodeAdapters;
14
+ exports.NodeExecAdapter = _chunkJDCCYWIXcjs.NodeExecAdapter; exports.NodeFsAdapter = _chunkJDCCYWIXcjs.NodeFsAdapter; exports.TypeGit = _chunkJDCCYWIXcjs.TypeGit; exports.createNodeAdapters = _chunkJDCCYWIXcjs.createNodeAdapters;
@@ -1,5 +1,5 @@
1
- import { E as ExecAdapter, S as SpawnOptions, a as StreamHandler, b as SpawnResult, c as SpawnHandle, F as FsAdapter, T as TailOptions, d as TailHandle, R as RuntimeAdapters, C as CreateGitOptions, G as GitClient } from '../../client.d-PRQCR2_T.cjs';
2
- import { C as Capabilities, G as Git } from '../../git.d-DrhCzWEn.cjs';
1
+ import { E as ExecAdapter, S as SpawnOptions, a as StreamHandler, b as SpawnResult, c as SpawnHandle, F as FsAdapter, T as TailOptions, d as TailHandle, R as RuntimeAdapters, C as CreateGitOptions, G as GitClient } from '../../client.d-Cg5wWJnY.cjs';
2
+ import { C as Capabilities, G as Git } from '../../git.d-DqAvRXEf.cjs';
3
3
 
4
4
  /**
5
5
  * Options for {@link NodeExecAdapter}.
@@ -51,6 +51,7 @@ declare class NodeFsAdapter implements FsAdapter {
51
51
  tail(options: TailOptions): Promise<void>;
52
52
  deleteFile(filePath: string): Promise<void>;
53
53
  deleteDirectory(dirPath: string): Promise<void>;
54
+ readDirectory(dirPath: string): Promise<string[]>;
54
55
  exists(filePath: string): Promise<boolean>;
55
56
  readFile(filePath: string): Promise<string>;
56
57
  writeFile(filePath: string, contents: string): Promise<void>;
@@ -1,5 +1,5 @@
1
- import { E as ExecAdapter, S as SpawnOptions, a as StreamHandler, b as SpawnResult, c as SpawnHandle, F as FsAdapter, T as TailOptions, d as TailHandle, R as RuntimeAdapters, C as CreateGitOptions, G as GitClient } from '../../client.d-Cs32YZX6.js';
2
- import { C as Capabilities, G as Git } from '../../git.d-DrhCzWEn.cjs';
1
+ import { E as ExecAdapter, S as SpawnOptions, a as StreamHandler, b as SpawnResult, c as SpawnHandle, F as FsAdapter, T as TailOptions, d as TailHandle, R as RuntimeAdapters, C as CreateGitOptions, G as GitClient } from '../../client.d-DCiFA_CK.js';
2
+ import { C as Capabilities, G as Git } from '../../git.d-DqAvRXEf.cjs';
3
3
 
4
4
  /**
5
5
  * Options for {@link NodeExecAdapter}.
@@ -51,6 +51,7 @@ declare class NodeFsAdapter implements FsAdapter {
51
51
  tail(options: TailOptions): Promise<void>;
52
52
  deleteFile(filePath: string): Promise<void>;
53
53
  deleteDirectory(dirPath: string): Promise<void>;
54
+ readDirectory(dirPath: string): Promise<string[]>;
54
55
  exists(filePath: string): Promise<boolean>;
55
56
  readFile(filePath: string): Promise<string>;
56
57
  writeFile(filePath: string, contents: string): Promise<void>;
@@ -3,9 +3,9 @@ import {
3
3
  NodeFsAdapter,
4
4
  TypeGit,
5
5
  createNodeAdapters
6
- } from "../../chunk-IAJF67MB.js";
7
- import "../../chunk-YIWTIIXH.js";
8
- import "../../chunk-5NI3KM5Z.js";
6
+ } from "../../chunk-S3EFBFVP.js";
7
+ import "../../chunk-ADC26634.js";
8
+ import "../../chunk-UAKOSACD.js";
9
9
  export {
10
10
  NodeExecAdapter,
11
11
  NodeFsAdapter,