@open-cr-agent/vcs-local 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/git.d.ts CHANGED
@@ -7,7 +7,6 @@ export interface GitOptions {
7
7
  truncateAt?: number;
8
8
  timeoutMs?: number;
9
9
  }
10
- export declare const GIT_TIMEOUT_MS: number;
11
10
  export declare class GitError extends OcraError {
12
11
  readonly args: readonly string[];
13
12
  readonly exitCode: number | undefined;
package/dist/git.js CHANGED
@@ -2,7 +2,7 @@ import { execFile } from "node:child_process";
2
2
  import { OcraError } from "@open-cr-agent/core";
3
3
  // Every git call ends: a fetch can wait on the network forever, and a diff
4
4
  // of a huge repository should fail rather than hang the review.
5
- export const GIT_TIMEOUT_MS = 10 * 60_000;
5
+ const GIT_TIMEOUT_MS = 10 * 60_000;
6
6
  export class GitError extends OcraError {
7
7
  args;
8
8
  exitCode;
@@ -15,9 +15,9 @@ export interface LocalGitOptions {
15
15
  }
16
16
  export declare const MAX_READ_BYTES: number;
17
17
  export declare class LocalGitAdapter implements VcsAdapter {
18
- private readonly options;
19
18
  readonly name = "local";
20
19
  private resolved;
20
+ private readonly options;
21
21
  constructor(options: LocalGitOptions);
22
22
  repositoryRoot(): Promise<string>;
23
23
  getChangeRequest(): Promise<ChangeRequest>;
@@ -2,7 +2,7 @@ import { cp, lstat, mkdtemp, open, readFile, readlink, realpath, rm } from "node
2
2
  import { tmpdir } from "node:os";
3
3
  import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
4
4
  import { OcraError, } from "@open-cr-agent/core";
5
- import { parseUnifiedDiff } from "@open-cr-agent/core/internal";
5
+ import { errnoCode, parseUnifiedDiff } from "@open-cr-agent/core/internal";
6
6
  import { GitError, git, isShallow, SHALLOW_HINT } from "./git.js";
7
7
  const WORKING_TREE = "working-tree";
8
8
  const SEARCH_RESULT_LIMIT = 100;
@@ -29,9 +29,9 @@ const DIFF_ARGS = [
29
29
  "--dst-prefix=b/",
30
30
  ];
31
31
  export class LocalGitAdapter {
32
- options;
33
32
  name = "local";
34
33
  resolved;
34
+ options;
35
35
  constructor(options) {
36
36
  this.options = options;
37
37
  }
@@ -222,7 +222,7 @@ async function readWorkingTreeFile(root, inside) {
222
222
  }
223
223
  }
224
224
  catch (error) {
225
- const code = error.code;
225
+ const code = errnoCode(error);
226
226
  if (code === "ENOENT" || code === "ENOTDIR")
227
227
  return undefined;
228
228
  throw error;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-cr-agent/vcs-local",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "Local git adapter for Open-CR-Agent: working tree, ranges and commits",
5
5
  "keywords": [
6
6
  "code-review",
@@ -37,10 +37,13 @@
37
37
  "!dist/**/*.map"
38
38
  ],
39
39
  "dependencies": {
40
- "@open-cr-agent/core": "0.5.0",
40
+ "@open-cr-agent/core": "0.6.0",
41
41
  "zod": "^4.6.5"
42
42
  },
43
43
  "publishConfig": {
44
44
  "access": "public"
45
+ },
46
+ "devDependencies": {
47
+ "@open-cr-agent/test-support": "0.0.0"
45
48
  }
46
49
  }