byterover-cli 3.8.3 → 3.9.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/agent/infra/llm/providers/google.js +1 -1
- package/dist/oclif/commands/vc/diff.d.ts +12 -0
- package/dist/oclif/commands/vc/diff.js +40 -0
- package/dist/oclif/commands/vc/remote/remove.d.ts +9 -0
- package/dist/oclif/commands/vc/remote/remove.js +23 -0
- package/dist/server/core/domain/entities/brv-config.d.ts +4 -0
- package/dist/server/core/domain/entities/brv-config.js +12 -0
- package/dist/server/core/domain/entities/provider-registry.js +1 -1
- package/dist/server/core/interfaces/services/i-git-service.d.ts +55 -4
- package/dist/server/infra/context-tree/summary-frontmatter.js +2 -2
- package/dist/server/infra/dream/operations/consolidate.js +5 -4
- package/dist/server/infra/dream/operations/synthesize.js +1 -1
- package/dist/server/infra/git/isomorphic-git-service.d.ts +24 -1
- package/dist/server/infra/git/isomorphic-git-service.js +207 -7
- package/dist/server/infra/transport/handlers/config-handler.js +1 -0
- package/dist/server/infra/transport/handlers/locations-handler.d.ts +1 -0
- package/dist/server/infra/transport/handlers/locations-handler.js +25 -1
- package/dist/server/infra/transport/handlers/reveal-command.d.ts +9 -0
- package/dist/server/infra/transport/handlers/reveal-command.js +7 -0
- package/dist/server/infra/transport/handlers/vc-handler.d.ts +11 -0
- package/dist/server/infra/transport/handlers/vc-handler.js +143 -9
- package/dist/server/infra/webui/webui-middleware.js +6 -1
- package/dist/shared/transport/events/config-events.d.ts +1 -0
- package/dist/shared/transport/events/index.d.ts +1 -0
- package/dist/shared/transport/events/locations-events.d.ts +7 -0
- package/dist/shared/transport/events/locations-events.js +1 -0
- package/dist/shared/transport/events/vc-events.d.ts +56 -5
- package/dist/shared/transport/events/vc-events.js +7 -0
- package/dist/tui/features/commands/definitions/vc-diff.d.ts +2 -0
- package/dist/tui/features/commands/definitions/vc-diff.js +23 -0
- package/dist/tui/features/commands/definitions/vc-remote.js +16 -7
- package/dist/tui/features/commands/definitions/vc.js +2 -0
- package/dist/tui/features/vc/diff/api/execute-vc-diff.d.ts +8 -0
- package/dist/tui/features/vc/diff/api/execute-vc-diff.js +13 -0
- package/dist/tui/features/vc/diff/components/vc-diff-flow.d.ts +8 -0
- package/dist/tui/features/vc/diff/components/vc-diff-flow.js +31 -0
- package/dist/tui/features/vc/diff/utils/format-diff.d.ts +2 -0
- package/dist/tui/features/vc/diff/utils/format-diff.js +83 -0
- package/dist/tui/features/vc/diff/utils/parse-mode.d.ts +2 -0
- package/dist/tui/features/vc/diff/utils/parse-mode.js +16 -0
- package/dist/tui/features/vc/remote/components/vc-remote-flow.js +23 -8
- package/dist/webui/assets/index-CvcqpMYn.css +1 -0
- package/dist/webui/assets/index-thSZZahh.js +130 -0
- package/dist/webui/index.html +3 -3
- package/dist/webui/sw.js +1 -1
- package/oclif.manifest.json +639 -566
- package/package.json +3 -1
- package/dist/webui/assets/index-DFMY2d5W.css +0 -1
- package/dist/webui/assets/index-Dkyf6c5F.js +0 -130
|
@@ -15,7 +15,7 @@ export const googleProvider = {
|
|
|
15
15
|
model: provider(config.model),
|
|
16
16
|
});
|
|
17
17
|
},
|
|
18
|
-
defaultModel: 'gemini-
|
|
18
|
+
defaultModel: 'gemini-3-flash-preview',
|
|
19
19
|
description: 'Gemini models by Google',
|
|
20
20
|
envVars: ['GOOGLE_API_KEY', 'GEMINI_API_KEY'],
|
|
21
21
|
id: 'google',
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class VcDiff extends Command {
|
|
3
|
+
static args: {
|
|
4
|
+
ref: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
5
|
+
};
|
|
6
|
+
static description: string;
|
|
7
|
+
static examples: string[];
|
|
8
|
+
static flags: {
|
|
9
|
+
staged: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
};
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Args, Command, Flags } from '@oclif/core';
|
|
2
|
+
import { VcEvents, } from '../../../shared/transport/events/vc-events.js';
|
|
3
|
+
import { formatDiff } from '../../../tui/features/vc/diff/utils/format-diff.js';
|
|
4
|
+
import { parseMode } from '../../../tui/features/vc/diff/utils/parse-mode.js';
|
|
5
|
+
import { formatConnectionError, withDaemonRetry } from '../../lib/daemon-client.js';
|
|
6
|
+
export default class VcDiff extends Command {
|
|
7
|
+
static args = {
|
|
8
|
+
ref: Args.string({ description: 'commit, branch, or <ref1>..<ref2> range' }),
|
|
9
|
+
};
|
|
10
|
+
static description = 'Show changes between commits, the index, or the working tree';
|
|
11
|
+
static examples = [
|
|
12
|
+
'<%= config.bin %> <%= command.id %>',
|
|
13
|
+
'<%= config.bin %> <%= command.id %> --staged',
|
|
14
|
+
'<%= config.bin %> <%= command.id %> HEAD~1',
|
|
15
|
+
'<%= config.bin %> <%= command.id %> main..feature/x',
|
|
16
|
+
'<%= config.bin %> <%= command.id %> main',
|
|
17
|
+
];
|
|
18
|
+
static flags = {
|
|
19
|
+
staged: Flags.boolean({ description: 'Show staged changes (HEAD vs index)' }),
|
|
20
|
+
};
|
|
21
|
+
async run() {
|
|
22
|
+
const { args, flags } = await this.parse(VcDiff);
|
|
23
|
+
let request;
|
|
24
|
+
try {
|
|
25
|
+
request = { mode: parseMode(args.ref, flags.staged) };
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
this.error(error instanceof Error ? error.message : String(error));
|
|
29
|
+
}
|
|
30
|
+
try {
|
|
31
|
+
const response = await withDaemonRetry((client) => client.requestWithAck(VcEvents.DIFFS, request));
|
|
32
|
+
const text = formatDiff(response);
|
|
33
|
+
if (text.length > 0)
|
|
34
|
+
process.stdout.write(text);
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
this.error(formatConnectionError(error));
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class VcRemoteRemove extends Command {
|
|
3
|
+
static args: {
|
|
4
|
+
name: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
|
+
};
|
|
6
|
+
static description: string;
|
|
7
|
+
static examples: string[];
|
|
8
|
+
run(): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Args, Command } from '@oclif/core';
|
|
2
|
+
import { VcEvents } from '../../../../shared/transport/events/vc-events.js';
|
|
3
|
+
import { formatConnectionError, withDaemonRetry } from '../../../lib/daemon-client.js';
|
|
4
|
+
export default class VcRemoteRemove extends Command {
|
|
5
|
+
static args = {
|
|
6
|
+
name: Args.string({ description: 'Remote name', required: true }),
|
|
7
|
+
};
|
|
8
|
+
static description = 'Remove a named remote';
|
|
9
|
+
static examples = [`<%= config.bin %> <%= command.id %> origin`];
|
|
10
|
+
async run() {
|
|
11
|
+
const { args } = await this.parse(VcRemoteRemove);
|
|
12
|
+
if (args.name !== 'origin') {
|
|
13
|
+
this.error(`Only 'origin' remote is currently supported.`);
|
|
14
|
+
}
|
|
15
|
+
try {
|
|
16
|
+
await withDaemonRetry(async (client) => client.requestWithAck(VcEvents.REMOTE, { subcommand: 'remove' }));
|
|
17
|
+
this.log(`Remote 'origin' removed.`);
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
this.error(formatConnectionError(error));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -85,6 +85,10 @@ export declare class BrvConfig {
|
|
|
85
85
|
* Serializes the config to JSON format
|
|
86
86
|
*/
|
|
87
87
|
toJson(): Record<string, unknown>;
|
|
88
|
+
/**
|
|
89
|
+
* Creates a new BrvConfig with space fields cleared, preserving all other fields.
|
|
90
|
+
*/
|
|
91
|
+
withoutSpace(): BrvConfig;
|
|
88
92
|
/**
|
|
89
93
|
* Creates a new BrvConfig with space fields replaced, preserving all other fields.
|
|
90
94
|
*/
|
|
@@ -170,6 +170,18 @@ export class BrvConfig {
|
|
|
170
170
|
version: this.version,
|
|
171
171
|
};
|
|
172
172
|
}
|
|
173
|
+
/**
|
|
174
|
+
* Creates a new BrvConfig with space fields cleared, preserving all other fields.
|
|
175
|
+
*/
|
|
176
|
+
withoutSpace() {
|
|
177
|
+
return new BrvConfig({
|
|
178
|
+
...this,
|
|
179
|
+
spaceId: undefined,
|
|
180
|
+
spaceName: undefined,
|
|
181
|
+
teamId: undefined,
|
|
182
|
+
teamName: undefined,
|
|
183
|
+
});
|
|
184
|
+
}
|
|
173
185
|
/**
|
|
174
186
|
* Creates a new BrvConfig with space fields replaced, preserving all other fields.
|
|
175
187
|
*/
|
|
@@ -89,7 +89,7 @@ export const PROVIDER_REGISTRY = {
|
|
|
89
89
|
apiKeyUrl: 'https://aistudio.google.com/apikey',
|
|
90
90
|
baseUrl: '',
|
|
91
91
|
category: 'popular',
|
|
92
|
-
defaultModel: 'gemini-
|
|
92
|
+
defaultModel: 'gemini-3-flash-preview',
|
|
93
93
|
description: 'Gemini models by Google',
|
|
94
94
|
envVars: ['GOOGLE_API_KEY', 'GEMINI_API_KEY'],
|
|
95
95
|
headers: {},
|
|
@@ -166,10 +166,12 @@ export type CloneGitParams = BaseGitParams & {
|
|
|
166
166
|
};
|
|
167
167
|
/**
|
|
168
168
|
* Source of the blob content.
|
|
169
|
-
* - `'HEAD'` → blob at the HEAD commit
|
|
170
169
|
* - `'STAGE'` → blob in the git index (staging area)
|
|
170
|
+
* - `{commitish: string}` → blob at the resolved commit (branch name, tag, SHA, or `'HEAD'`)
|
|
171
171
|
*/
|
|
172
|
-
export type GitBlobRef = '
|
|
172
|
+
export type GitBlobRef = 'STAGE' | {
|
|
173
|
+
commitish: string;
|
|
174
|
+
};
|
|
173
175
|
export type GetBlobContentParams = BaseGitParams & {
|
|
174
176
|
path: string;
|
|
175
177
|
ref: GitBlobRef;
|
|
@@ -180,6 +182,30 @@ export type GetBlobContentsParams = BaseGitParams & {
|
|
|
180
182
|
};
|
|
181
183
|
/** Map of path → blob content (utf8). Missing entries indicate the blob is absent at that ref. */
|
|
182
184
|
export type BlobContents = Record<string, string | undefined>;
|
|
185
|
+
/**
|
|
186
|
+
* Source of the side being diffed. Beyond `GitBlobRef`, also supports `'WORKDIR'`
|
|
187
|
+
* (the working tree, used for unstaged and ref-vs-worktree comparisons).
|
|
188
|
+
*/
|
|
189
|
+
export type GitDiffSide = 'STAGE' | 'WORKDIR' | {
|
|
190
|
+
commitish: string;
|
|
191
|
+
};
|
|
192
|
+
export type ListChangedFilesParams = BaseGitParams & {
|
|
193
|
+
from: GitDiffSide;
|
|
194
|
+
to: GitDiffSide;
|
|
195
|
+
};
|
|
196
|
+
export type ChangedFile = {
|
|
197
|
+
path: string;
|
|
198
|
+
status: 'added' | 'deleted' | 'modified';
|
|
199
|
+
};
|
|
200
|
+
/** Content + short oid pair returned by {@link IGitService.getTextBlob}. */
|
|
201
|
+
export type TextBlob = {
|
|
202
|
+
/** True when the blob contains a NUL byte; `content` is then empty. */
|
|
203
|
+
binary?: boolean;
|
|
204
|
+
/** UTF-8 decoded blob content (empty string when binary). */
|
|
205
|
+
content: string;
|
|
206
|
+
/** 7-char short oid. */
|
|
207
|
+
oid: string;
|
|
208
|
+
};
|
|
183
209
|
export interface IGitService {
|
|
184
210
|
abortMerge(params: AbortMergeGitParams): Promise<void>;
|
|
185
211
|
add(params: AddGitParams): Promise<void>;
|
|
@@ -194,11 +220,11 @@ export interface IGitService {
|
|
|
194
220
|
getAheadBehind(params: GetAheadBehindParams): Promise<AheadBehind>;
|
|
195
221
|
/**
|
|
196
222
|
* Reads the content of a file blob at a given git ref.
|
|
197
|
-
* - `ref: 'HEAD'` → resolves HEAD commit, then reads the blob at `path`
|
|
198
223
|
* - `ref: 'STAGE'` → reads the blob staged in the index at `path`
|
|
224
|
+
* - `ref: {commitish}` → resolves the commit-ish ref (branch name, tag, SHA, or `'HEAD'`), then reads the blob at `path`
|
|
199
225
|
*
|
|
200
226
|
* Returns `undefined` when no blob exists at that ref (e.g. file not yet committed,
|
|
201
|
-
* or file not yet staged), or when
|
|
227
|
+
* or file not yet staged), or when the ref has no commits.
|
|
202
228
|
*/
|
|
203
229
|
getBlobContent(params: GetBlobContentParams): Promise<string | undefined>;
|
|
204
230
|
/**
|
|
@@ -227,8 +253,21 @@ export interface IGitService {
|
|
|
227
253
|
*/
|
|
228
254
|
getFilesWithConflictMarkers(params: BaseGitParams): Promise<string[]>;
|
|
229
255
|
getRemoteUrl(params: GetRemoteUrlGitParams): Promise<string | undefined>;
|
|
256
|
+
/**
|
|
257
|
+
* Reads a UTF-8 text blob together with its short oid in a single pass.
|
|
258
|
+
* Returns `undefined` when the blob is absent or detected as binary (contains a NUL byte).
|
|
259
|
+
* Used by diff producers to avoid the double-read pattern of calling `getBlobContent`
|
|
260
|
+
* and `git.hashBlob` separately.
|
|
261
|
+
*/
|
|
262
|
+
getTextBlob(params: GetBlobContentParams): Promise<TextBlob | undefined>;
|
|
230
263
|
/** Returns the upstream tracking branch config, or `undefined` if not configured. */
|
|
231
264
|
getTrackingBranch(params: GetTrackingBranchParams): Promise<TrackingBranch | undefined>;
|
|
265
|
+
/**
|
|
266
|
+
* Returns the 7-character short oid that git would assign to the given content,
|
|
267
|
+
* computed via `git.hashBlob`. Used to render the working-tree side of a
|
|
268
|
+
* `git diff`-style `index <oid>..<oid>` header (the working tree has no stored oid).
|
|
269
|
+
*/
|
|
270
|
+
hashBlob(content: Buffer): Promise<string>;
|
|
232
271
|
init(params: InitGitParams): Promise<void>;
|
|
233
272
|
/** Returns true if `ancestor` commit is reachable from `commit`. */
|
|
234
273
|
isAncestor(params: BaseGitParams & {
|
|
@@ -241,6 +280,18 @@ export interface IGitService {
|
|
|
241
280
|
isInitialized(params: BaseGitParams): Promise<boolean>;
|
|
242
281
|
/** Lists local branches. When `remote` is specified, also includes remote-tracking branches. */
|
|
243
282
|
listBranches(params: ListBranchesGitParams): Promise<GitBranch[]>;
|
|
283
|
+
/**
|
|
284
|
+
* Returns the set of files that differ between two diff sides, with their change status.
|
|
285
|
+
*
|
|
286
|
+
* Status mirrors `git diff` semantics:
|
|
287
|
+
* - `'added'` → present on `to` side, absent on `from` side
|
|
288
|
+
* - `'deleted'` → present on `from` side, absent on `to` side
|
|
289
|
+
* - `'modified'` → present on both, differs
|
|
290
|
+
*
|
|
291
|
+
* Untracked files (absent from both HEAD and STAGE) are excluded from the
|
|
292
|
+
* unstaged case (`from='STAGE', to='WORKDIR'`) to match `git diff` no-args behavior.
|
|
293
|
+
*/
|
|
294
|
+
listChangedFiles(params: ListChangedFilesParams): Promise<ChangedFile[]>;
|
|
244
295
|
listRemotes(params: BaseGitParams): Promise<GitRemote[]>;
|
|
245
296
|
log(params: LogGitParams): Promise<GitCommit[]>;
|
|
246
297
|
merge(params: MergeGitParams): Promise<MergeResult>;
|
|
@@ -44,7 +44,7 @@ export function generateSummaryContent(frontmatter, body) {
|
|
|
44
44
|
token_count: frontmatter.token_count,
|
|
45
45
|
type: 'summary',
|
|
46
46
|
};
|
|
47
|
-
const yamlContent = yamlDump(fm, { flowLevel: 1, lineWidth: -1, sortKeys:
|
|
47
|
+
const yamlContent = yamlDump(fm, { flowLevel: 1, lineWidth: -1, sortKeys: false }).trimEnd();
|
|
48
48
|
return `---\n${yamlContent}\n---\n${body}`;
|
|
49
49
|
}
|
|
50
50
|
// ---------------------------------------------------------------------------
|
|
@@ -79,7 +79,7 @@ export function generateArchiveStubContent(frontmatter, ghostCue) {
|
|
|
79
79
|
points_to: frontmatter.points_to,
|
|
80
80
|
type: 'archive_stub',
|
|
81
81
|
};
|
|
82
|
-
const yamlContent = yamlDump(fm, { flowLevel: 1, lineWidth: -1, sortKeys:
|
|
82
|
+
const yamlContent = yamlDump(fm, { flowLevel: 1, lineWidth: -1, sortKeys: false }).trimEnd();
|
|
83
83
|
return `---\n${yamlContent}\n---\n${ghostCue}`;
|
|
84
84
|
}
|
|
85
85
|
// ---------------------------------------------------------------------------
|
|
@@ -224,8 +224,9 @@ function addFrontmatterFields(content, fields) {
|
|
|
224
224
|
try {
|
|
225
225
|
const parsed = yamlLoad(yamlBlock);
|
|
226
226
|
if (parsed && typeof parsed === 'object') {
|
|
227
|
+
// Spread preserves existing key order; new fields are appended at end.
|
|
227
228
|
const merged = { ...parsed, ...fields };
|
|
228
|
-
const newYaml = yamlDump(merged, { flowLevel: 2, lineWidth: -1, sortKeys:
|
|
229
|
+
const newYaml = yamlDump(merged, { flowLevel: 2, lineWidth: -1, sortKeys: false }).trimEnd();
|
|
229
230
|
return `---\n${newYaml}\n---\n${body}`;
|
|
230
231
|
}
|
|
231
232
|
}
|
|
@@ -235,7 +236,7 @@ function addFrontmatterFields(content, fields) {
|
|
|
235
236
|
}
|
|
236
237
|
}
|
|
237
238
|
// No valid frontmatter — prepend
|
|
238
|
-
const yaml = yamlDump(fields, { flowLevel: 2, lineWidth: -1, sortKeys:
|
|
239
|
+
const yaml = yamlDump(fields, { flowLevel: 2, lineWidth: -1, sortKeys: false }).trimEnd();
|
|
239
240
|
return `---\n${yaml}\n---\n${content}`;
|
|
240
241
|
}
|
|
241
242
|
// ── Helpers ──────────────────────────────────────────────────────────────────
|
|
@@ -492,7 +493,7 @@ async function addRelatedLinks(filePath, relatedPaths) {
|
|
|
492
493
|
if (parsed && typeof parsed === 'object') {
|
|
493
494
|
const existing = Array.isArray(parsed.related) ? parsed.related : [];
|
|
494
495
|
parsed.related = [...new Set([...existing, ...relatedPaths])];
|
|
495
|
-
const newYaml = yamlDump(parsed, { flowLevel: 1, lineWidth: -1, sortKeys:
|
|
496
|
+
const newYaml = yamlDump(parsed, { flowLevel: 1, lineWidth: -1, sortKeys: false }).trimEnd();
|
|
496
497
|
await atomicWrite(filePath, `---\n${newYaml}\n---\n${body}`);
|
|
497
498
|
return;
|
|
498
499
|
}
|
|
@@ -503,7 +504,7 @@ async function addRelatedLinks(filePath, relatedPaths) {
|
|
|
503
504
|
}
|
|
504
505
|
}
|
|
505
506
|
// No existing frontmatter — add one with related field
|
|
506
|
-
const yaml = yamlDump({ related: relatedPaths }, { flowLevel: 1, lineWidth: -1, sortKeys:
|
|
507
|
+
const yaml = yamlDump({ related: relatedPaths }, { flowLevel: 1, lineWidth: -1, sortKeys: false }).trimEnd();
|
|
507
508
|
await atomicWrite(filePath, `---\n${yaml}\n---\n${content}`);
|
|
508
509
|
}
|
|
509
510
|
async function determineNeedsReview(actionType, files, opts) {
|
|
@@ -208,7 +208,7 @@ async function writeSynthesisFile(candidate, contextTreeDir, runtimeSignalStore,
|
|
|
208
208
|
type: 'synthesis',
|
|
209
209
|
};
|
|
210
210
|
/* eslint-enable camelcase */
|
|
211
|
-
const yaml = yamlDump(frontmatter, { lineWidth: -1, sortKeys:
|
|
211
|
+
const yaml = yamlDump(frontmatter, { lineWidth: -1, sortKeys: false }).trimEnd();
|
|
212
212
|
const body = [
|
|
213
213
|
`# ${candidate.title}`,
|
|
214
214
|
'',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AbortMergeGitParams, AddGitParams, AddRemoteGitParams, AheadBehind, BaseGitParams, BlobContents, CheckoutGitParams, CloneGitParams, CommitGitParams, CreateBranchGitParams, DeleteBranchGitParams, FetchGitParams, GetAheadBehindParams, GetBlobContentParams, GetBlobContentsParams, GetRemoteUrlGitParams, GetTrackingBranchParams, GitBranch, GitCommit, GitConflict, GitRemote, GitStatus, IGitService, InitGitParams, ListBranchesGitParams, LogGitParams, MergeGitParams, MergeResult, PullGitParams, PullResult, PushGitParams, PushResult, RemoveRemoteGitParams, ResetGitParams, ResetResult, SetTrackingBranchParams, TrackingBranch } from '../../core/interfaces/services/i-git-service.js';
|
|
1
|
+
import type { AbortMergeGitParams, AddGitParams, AddRemoteGitParams, AheadBehind, BaseGitParams, BlobContents, ChangedFile, CheckoutGitParams, CloneGitParams, CommitGitParams, CreateBranchGitParams, DeleteBranchGitParams, FetchGitParams, GetAheadBehindParams, GetBlobContentParams, GetBlobContentsParams, GetRemoteUrlGitParams, GetTrackingBranchParams, GitBranch, GitCommit, GitConflict, GitRemote, GitStatus, IGitService, InitGitParams, ListBranchesGitParams, ListChangedFilesParams, LogGitParams, MergeGitParams, MergeResult, PullGitParams, PullResult, PushGitParams, PushResult, RemoveRemoteGitParams, ResetGitParams, ResetResult, SetTrackingBranchParams, TextBlob, TrackingBranch } from '../../core/interfaces/services/i-git-service.js';
|
|
2
2
|
import type { IAuthStateStore } from '../../core/interfaces/state/i-auth-state-store.js';
|
|
3
3
|
export declare class IsomorphicGitService implements IGitService {
|
|
4
4
|
private readonly authStateStore;
|
|
@@ -21,7 +21,9 @@ export declare class IsomorphicGitService implements IGitService {
|
|
|
21
21
|
getCurrentBranch(params: BaseGitParams): Promise<string | undefined>;
|
|
22
22
|
getFilesWithConflictMarkers(params: BaseGitParams): Promise<string[]>;
|
|
23
23
|
getRemoteUrl(params: GetRemoteUrlGitParams): Promise<string | undefined>;
|
|
24
|
+
getTextBlob(params: GetBlobContentParams): Promise<TextBlob | undefined>;
|
|
24
25
|
getTrackingBranch(params: GetTrackingBranchParams): Promise<TrackingBranch | undefined>;
|
|
26
|
+
hashBlob(content: Buffer): Promise<string>;
|
|
25
27
|
init(params: InitGitParams): Promise<void>;
|
|
26
28
|
isAncestor(params: BaseGitParams & {
|
|
27
29
|
ancestor: string;
|
|
@@ -30,6 +32,7 @@ export declare class IsomorphicGitService implements IGitService {
|
|
|
30
32
|
isEmptyRepository(params: BaseGitParams): Promise<boolean>;
|
|
31
33
|
isInitialized(params: BaseGitParams): Promise<boolean>;
|
|
32
34
|
listBranches(params: ListBranchesGitParams): Promise<GitBranch[]>;
|
|
35
|
+
listChangedFiles(params: ListChangedFilesParams): Promise<ChangedFile[]>;
|
|
33
36
|
listRemotes(params: BaseGitParams): Promise<GitRemote[]>;
|
|
34
37
|
log(params: LogGitParams): Promise<GitCommit[]>;
|
|
35
38
|
merge(params: MergeGitParams): Promise<MergeResult>;
|
|
@@ -40,7 +43,11 @@ export declare class IsomorphicGitService implements IGitService {
|
|
|
40
43
|
setTrackingBranch(params: SetTrackingBranchParams): Promise<void>;
|
|
41
44
|
status(params: BaseGitParams): Promise<GitStatus>;
|
|
42
45
|
private buildBasicAuthHeaders;
|
|
46
|
+
private classifyRefVsWorkdir;
|
|
47
|
+
private classifyStagedRow;
|
|
48
|
+
private classifyUnstagedRow;
|
|
43
49
|
private conflictsFromError;
|
|
50
|
+
private describeSide;
|
|
44
51
|
private getAuthor;
|
|
45
52
|
private getOnAuth;
|
|
46
53
|
private getOnAuthFailure;
|
|
@@ -51,6 +58,10 @@ export declare class IsomorphicGitService implements IGitService {
|
|
|
51
58
|
* to match native git behavior.
|
|
52
59
|
*/
|
|
53
60
|
private guardStagedConflicts;
|
|
61
|
+
private hashWorkdirFile;
|
|
62
|
+
private isCommitishSide;
|
|
63
|
+
private listChangedBetweenCommits;
|
|
64
|
+
private listChangedFromMatrix;
|
|
54
65
|
/**
|
|
55
66
|
* Manual merge for unrelated histories (no common ancestor).
|
|
56
67
|
* isomorphic-git throws MergeNotSupportedError because it can't handle
|
|
@@ -59,6 +70,12 @@ export declare class IsomorphicGitService implements IGitService {
|
|
|
59
70
|
private mergeUnrelatedHistories;
|
|
60
71
|
private parseMatrix;
|
|
61
72
|
private readBlobOid;
|
|
73
|
+
/**
|
|
74
|
+
* Reads the raw blob bytes + full oid at the given ref in a single pass.
|
|
75
|
+
* Returns `undefined` when the blob is absent (path missing, ref unresolved, etc.).
|
|
76
|
+
* Used by {@link getTextBlob}; callers downstream decide binary vs text.
|
|
77
|
+
*/
|
|
78
|
+
private readRawBlob;
|
|
62
79
|
private requireDirectory;
|
|
63
80
|
private requireToken;
|
|
64
81
|
/**
|
|
@@ -71,6 +88,12 @@ export declare class IsomorphicGitService implements IGitService {
|
|
|
71
88
|
* Falls back to git.resolveRef for plain refs.
|
|
72
89
|
*/
|
|
73
90
|
private resolveRefExpression;
|
|
91
|
+
/**
|
|
92
|
+
* Resolve a single ref (branch name, tag, full SHA, or short SHA).
|
|
93
|
+
* Falls back to `git.expandOid` for short SHAs since `git.resolveRef`
|
|
94
|
+
* only accepts full OIDs and symbolic refs.
|
|
95
|
+
*/
|
|
96
|
+
private resolveSingleRef;
|
|
74
97
|
/**
|
|
75
98
|
* Fixes conflict markers written by isomorphic-git to match native git:
|
|
76
99
|
* 1. Replaces `<<<<<<< <branchName>` with `<<<<<<< HEAD`
|