@openvcs/git-plugin 0.1.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,593 @@
1
+ // Copyright © 2025-2026 OpenVCS Contributors
2
+ // SPDX-License-Identifier: GPL-3.0-or-later
3
+
4
+ import {
5
+ VcsDelegateBase,
6
+ pluginError,
7
+ type PluginRuntimeContext,
8
+ } from '@openvcs/sdk/runtime';
9
+ import type * as OpenVcs from '@openvcs/sdk/types';
10
+
11
+ import {
12
+ asNumber,
13
+ asRecord,
14
+ asString,
15
+ asStringArray,
16
+ asTrimmedString,
17
+ } from './plugin-helpers.js';
18
+ import { GitCommand } from './git.js';
19
+ import type { GitSession } from './plugin-types.js';
20
+
21
+ /** Describes the Git runtime services consumed by the VCS delegates. */
22
+ export interface GitRuntimeDependencies {
23
+ /** Allocates a new repository session and returns its id. */
24
+ allocateSession: (session: GitSession) => string;
25
+ /** Removes a repository session by id. */
26
+ closeSession: (sessionId: unknown) => void;
27
+ /** Resolves an active session or raises a plugin error. */
28
+ requireSession: (sessionId: unknown) => GitSession;
29
+ /** Creates a GitCommand instance for a given repository path. */
30
+ createGitCommand: (cwd: string) => GitCommand;
31
+ }
32
+
33
+ /** Implements the Git-backed `vcs.*` delegate surface for the SDK runtime. */
34
+ export class GitVcsDelegates extends VcsDelegateBase<GitRuntimeDependencies> {
35
+ /** Returns the required repository worktree path for a session id. */
36
+ protected requireSessionPath(sessionId: unknown): string {
37
+ return this.deps.requireSession(sessionId).path;
38
+ }
39
+
40
+ /** Returns a Git command helper bound to a required session. */
41
+ protected requireGit(sessionId: unknown): GitCommand {
42
+ const cwd = this.requireSessionPath(sessionId);
43
+ return this.deps.createGitCommand(cwd);
44
+ }
45
+
46
+ override getCaps(
47
+ _params: OpenVcs.RequestParams,
48
+ _context: PluginRuntimeContext,
49
+ ): OpenVcs.VcsCapabilities {
50
+ return {
51
+ commits: true,
52
+ branches: true,
53
+ tags: true,
54
+ staging: true,
55
+ push_pull: true,
56
+ fast_forward: true,
57
+ };
58
+ }
59
+
60
+ override open(
61
+ params: OpenVcs.VcsOpenParams,
62
+ _context: PluginRuntimeContext,
63
+ ): OpenVcs.VcsSessionResult {
64
+ const repoPath = asTrimmedString(params.path);
65
+ if (!repoPath) {
66
+ throw pluginError('vcs-open-invalid-path', 'path is required');
67
+ }
68
+
69
+ const git = this.deps.createGitCommand(repoPath);
70
+ git.runChecked(['rev-parse', '--git-dir'], 'vcs-open-not-repository');
71
+ const sessionId = this.deps.allocateSession({ path: repoPath });
72
+ return { session_id: sessionId };
73
+ }
74
+
75
+ override close(
76
+ params: OpenVcs.VcsSessionParams,
77
+ _context: PluginRuntimeContext,
78
+ ): null {
79
+ this.deps.closeSession(params.session_id);
80
+ return null;
81
+ }
82
+
83
+ override cloneRepo(
84
+ params: OpenVcs.VcsCloneRepoParams,
85
+ context: PluginRuntimeContext,
86
+ ): null {
87
+ const url = asTrimmedString(params.url);
88
+ const destination = asTrimmedString(params.dest);
89
+
90
+ if (!url || !destination) {
91
+ throw pluginError('vcs-clone-invalid-args', 'url and dest are required');
92
+ }
93
+
94
+ const git = this.deps.createGitCommand(process.cwd());
95
+ const output = git.runChecked(['clone', url, destination], 'vcs-clone-failed');
96
+ const lines = `${output.stdout}\n${output.stderr}`
97
+ .split(/\r?\n/g)
98
+ .map((line) => line.trim())
99
+ .filter(Boolean);
100
+
101
+ for (const line of lines) {
102
+ context.host.info(line);
103
+ }
104
+
105
+ return null;
106
+ }
107
+
108
+ override getWorkdir(
109
+ params: OpenVcs.VcsSessionParams,
110
+ _context: PluginRuntimeContext,
111
+ ): string {
112
+ return this.requireSessionPath(params.session_id);
113
+ }
114
+
115
+ override getCurrentBranch(
116
+ params: OpenVcs.VcsSessionParams,
117
+ _context: PluginRuntimeContext,
118
+ ): string | null {
119
+ const git = this.requireGit(params.session_id);
120
+ const branch = git.currentBranch();
121
+ return branch === 'HEAD' ? null : branch;
122
+ }
123
+
124
+ override listBranches(
125
+ params: OpenVcs.VcsSessionParams,
126
+ _context: PluginRuntimeContext,
127
+ ): OpenVcs.VcsBranchEntry[] {
128
+ const git = this.requireGit(params.session_id);
129
+ const raw = git.runChecked(
130
+ [
131
+ 'for-each-ref',
132
+ '--format=%(refname:short)\t%(refname)\t%(HEAD)',
133
+ 'refs/heads',
134
+ 'refs/remotes',
135
+ ],
136
+ 'vcs-list-branches-failed',
137
+ );
138
+
139
+ return raw.stdout
140
+ .split(/\r?\n/g)
141
+ .map((line) => line.trim())
142
+ .filter(Boolean)
143
+ .map((line): OpenVcs.VcsBranchEntry => {
144
+ const [name = '', fullRef = '', headMark = ''] = line.split('\t');
145
+ const isRemote = fullRef.startsWith('refs/remotes/');
146
+ const remote = isRemote ? name.split('/')[0] ?? null : null;
147
+ const kind: OpenVcs.VcsBranchKind = isRemote
148
+ ? { type: 'Remote', remote }
149
+ : { type: 'Local' };
150
+
151
+ return {
152
+ name,
153
+ full_ref: fullRef,
154
+ kind,
155
+ current: headMark === '*',
156
+ };
157
+ });
158
+ }
159
+
160
+ override listLocalBranches(
161
+ params: OpenVcs.VcsSessionParams,
162
+ _context: PluginRuntimeContext,
163
+ ): string[] {
164
+ const git = this.requireGit(params.session_id);
165
+ const raw = git.runChecked(
166
+ ['for-each-ref', '--format=%(refname:short)', 'refs/heads/'],
167
+ 'vcs-list-branches-failed',
168
+ );
169
+
170
+ return raw.stdout
171
+ .split('\n')
172
+ .map((branch) => branch.trim())
173
+ .filter(Boolean);
174
+ }
175
+
176
+ override createBranch(
177
+ params: OpenVcs.VcsCreateBranchParams,
178
+ _context: PluginRuntimeContext,
179
+ ): null {
180
+ const git = this.requireGit(params.session_id);
181
+ git.createBranch(asTrimmedString(params.name));
182
+ return null;
183
+ }
184
+
185
+ override checkoutBranch(
186
+ params: OpenVcs.VcsCheckoutBranchParams,
187
+ _context: PluginRuntimeContext,
188
+ ): null {
189
+ const git = this.requireGit(params.session_id);
190
+ git.checkoutBranch(asTrimmedString(params.name));
191
+ return null;
192
+ }
193
+
194
+ override ensureRemote(
195
+ params: OpenVcs.VcsEnsureRemoteParams,
196
+ _context: PluginRuntimeContext,
197
+ ): null {
198
+ const git = this.requireGit(params.session_id);
199
+ const name = asTrimmedString(params.name);
200
+ const url = asTrimmedString(params.url);
201
+ if (!name || !url) {
202
+ throw pluginError('vcs-remote-invalid-args', 'name and url are required');
203
+ }
204
+
205
+ git.ensureRemote(name, url);
206
+ return null;
207
+ }
208
+
209
+ override listRemotes(
210
+ params: OpenVcs.VcsSessionParams,
211
+ _context: PluginRuntimeContext,
212
+ ): OpenVcs.VcsRemoteEntry[] {
213
+ const git = this.requireGit(params.session_id);
214
+ const result = git.listRemotes();
215
+ return result.remotes.map((remote) => ({
216
+ name: remote.name,
217
+ url: remote.fetch || remote.push,
218
+ }));
219
+ }
220
+
221
+ override removeRemote(
222
+ params: OpenVcs.VcsRemoveRemoteParams,
223
+ _context: PluginRuntimeContext,
224
+ ): null {
225
+ const git = this.requireGit(params.session_id);
226
+ git.removeRemote(asTrimmedString(params.name));
227
+ return null;
228
+ }
229
+
230
+ override fetch(
231
+ params: OpenVcs.VcsFetchParams,
232
+ _context: PluginRuntimeContext,
233
+ ): null {
234
+ const git = this.requireGit(params.session_id);
235
+ const options = asRecord(params.opts);
236
+ git.fetch({
237
+ remote: asTrimmedString(params.remote) || undefined,
238
+ refspec: asTrimmedString(params.refspec) || undefined,
239
+ opts: { prune: options.prune === true },
240
+ });
241
+ return null;
242
+ }
243
+
244
+ override push(
245
+ params: OpenVcs.VcsPushParams,
246
+ _context: PluginRuntimeContext,
247
+ ): null {
248
+ const git = this.requireGit(params.session_id);
249
+ git.push({
250
+ remote: asTrimmedString(params.remote) || undefined,
251
+ refspec: asTrimmedString(params.refspec) || undefined,
252
+ });
253
+ return null;
254
+ }
255
+
256
+ override pullFfOnly(
257
+ params: OpenVcs.VcsPullFfOnlyParams,
258
+ _context: PluginRuntimeContext,
259
+ ): null {
260
+ const git = this.requireGit(params.session_id);
261
+ git.pull({
262
+ remote: asTrimmedString(params.remote) || undefined,
263
+ branch: asTrimmedString(params.branch) || undefined,
264
+ });
265
+ return null;
266
+ }
267
+
268
+ override commit(
269
+ params: OpenVcs.VcsCommitParams,
270
+ _context: PluginRuntimeContext,
271
+ ): string {
272
+ const git = this.requireGit(params.session_id);
273
+ const result = git.runChecked(['rev-parse', 'HEAD'], 'git-commit-failed');
274
+ git.commit(asTrimmedString(params.message));
275
+ return result.stdout.trim();
276
+ }
277
+
278
+ override commitIndex(
279
+ params: OpenVcs.VcsCommitParams,
280
+ _context: PluginRuntimeContext,
281
+ ): string {
282
+ const git = this.requireGit(params.session_id);
283
+ const result = git.runChecked(['rev-parse', 'HEAD'], 'git-commit-failed');
284
+ git.commitIndex(
285
+ asTrimmedString(params.message),
286
+ asTrimmedString(params.name),
287
+ asTrimmedString(params.email),
288
+ asStringArray(params.paths),
289
+ );
290
+ return result.stdout.trim();
291
+ }
292
+
293
+ override getStatusSummary(
294
+ params: OpenVcs.VcsSessionParams,
295
+ _context: PluginRuntimeContext,
296
+ ): OpenVcs.StatusSummary {
297
+ const git = this.requireGit(params.session_id);
298
+ return git.status().summary;
299
+ }
300
+
301
+ override getStatusPayload(
302
+ params: OpenVcs.VcsSessionParams,
303
+ _context: PluginRuntimeContext,
304
+ ): OpenVcs.StatusPayload {
305
+ const git = this.requireGit(params.session_id);
306
+ return git.status().payload;
307
+ }
308
+
309
+ override listCommits(
310
+ params: OpenVcs.VcsListCommitsParams,
311
+ _context: PluginRuntimeContext,
312
+ ): OpenVcs.CommitEntry[] {
313
+ const git = this.requireGit(params.session_id);
314
+ const query = asRecord(params.query);
315
+ const result = git.listCommits({
316
+ branch: asTrimmedString(query.rev) || undefined,
317
+ skip: asNumber(query.skip, 0) || undefined,
318
+ limit: asNumber(query.limit, 0),
319
+ topo_order: query.topo_order as boolean ?? undefined,
320
+ include_merges: query.include_merges as boolean ?? undefined,
321
+ author_contains: asTrimmedString(query.author_contains) || undefined,
322
+ since_utc: asTrimmedString(query.since_utc) || undefined,
323
+ until_utc: asTrimmedString(query.until_utc) || undefined,
324
+ path: asTrimmedString(query.path) || undefined,
325
+ });
326
+ return result.commits;
327
+ }
328
+
329
+ override diffFile(
330
+ params: OpenVcs.VcsDiffFileParams,
331
+ _context: PluginRuntimeContext,
332
+ ): string[] {
333
+ const git = this.requireGit(params.session_id);
334
+ return git.diffFile(asTrimmedString(params.path)).split('\n');
335
+ }
336
+
337
+ override diffCommit(
338
+ params: OpenVcs.VcsDiffCommitParams,
339
+ _context: PluginRuntimeContext,
340
+ ): string[] {
341
+ const git = this.requireGit(params.session_id);
342
+ return git.diffCommit(asTrimmedString(params.rev)).split('\n');
343
+ }
344
+
345
+ override getConflictDetails(
346
+ params: OpenVcs.VcsGetConflictDetailsParams,
347
+ _context: PluginRuntimeContext,
348
+ ): OpenVcs.VcsConflictDetails {
349
+ const git = this.requireGit(params.session_id);
350
+ return git.getConflictDetails(asTrimmedString(params.path));
351
+ }
352
+
353
+ override checkoutConflictSide(
354
+ params: OpenVcs.VcsCheckoutConflictSideParams,
355
+ _context: PluginRuntimeContext,
356
+ ): null {
357
+ const git = this.requireGit(params.session_id);
358
+ const side = asTrimmedString(params.side);
359
+ if (side !== 'ours' && side !== 'theirs') {
360
+ throw pluginError('vcs-invalid-side', 'side must be "ours" or "theirs"');
361
+ }
362
+
363
+ git.checkoutConflictSide(asTrimmedString(params.path), side);
364
+ return null;
365
+ }
366
+
367
+ override writeMergeResult(
368
+ params: OpenVcs.VcsWriteMergeResultParams,
369
+ _context: PluginRuntimeContext,
370
+ ): null {
371
+ const git = this.requireGit(params.session_id);
372
+ const content = Buffer.from(asTrimmedString(params.content_b64), 'base64').toString(
373
+ 'utf8',
374
+ );
375
+ git.writeMergeResult(asTrimmedString(params.path), content);
376
+ return null;
377
+ }
378
+
379
+ override stagePatch(
380
+ params: OpenVcs.VcsStagePatchParams,
381
+ _context: PluginRuntimeContext,
382
+ ): null {
383
+ const git = this.requireGit(params.session_id);
384
+ git.stagePatch(asString(params.patch));
385
+ return null;
386
+ }
387
+
388
+ override discardPaths(
389
+ params: OpenVcs.VcsDiscardPathsParams,
390
+ _context: PluginRuntimeContext,
391
+ ): null {
392
+ const git = this.requireGit(params.session_id);
393
+ const paths = asStringArray(params.paths);
394
+ if (paths.length === 0) {
395
+ return null;
396
+ }
397
+
398
+ git.runChecked(['checkout', '--', ...paths], 'git-discard-paths-failed');
399
+ return null;
400
+ }
401
+
402
+ override applyReversePatch(
403
+ params: OpenVcs.VcsApplyReversePatchParams,
404
+ _context: PluginRuntimeContext,
405
+ ): null {
406
+ const git = this.requireGit(params.session_id);
407
+ git.applyReversePatch(asString(params.patch));
408
+ return null;
409
+ }
410
+
411
+ override deleteBranch(
412
+ params: OpenVcs.VcsDeleteBranchParams,
413
+ _context: PluginRuntimeContext,
414
+ ): null {
415
+ const git = this.requireGit(params.session_id);
416
+ git.deleteBranch(asTrimmedString(params.name));
417
+ return null;
418
+ }
419
+
420
+ override renameBranch(
421
+ params: OpenVcs.VcsRenameBranchParams,
422
+ _context: PluginRuntimeContext,
423
+ ): null {
424
+ const git = this.requireGit(params.session_id);
425
+ git.renameBranch(asTrimmedString(params.old), asTrimmedString(params.new));
426
+ return null;
427
+ }
428
+
429
+ override mergeIntoCurrent(
430
+ params: OpenVcs.VcsMergeIntoCurrentParams,
431
+ _context: PluginRuntimeContext,
432
+ ): null {
433
+ const git = this.requireGit(params.session_id);
434
+ git.mergeIntoCurrent(asTrimmedString(params.name));
435
+ return null;
436
+ }
437
+
438
+ override mergeAbort(
439
+ params: OpenVcs.VcsSessionParams,
440
+ _context: PluginRuntimeContext,
441
+ ): null {
442
+ const git = this.requireGit(params.session_id);
443
+ git.mergeAbort();
444
+ return null;
445
+ }
446
+
447
+ override mergeContinue(
448
+ params: OpenVcs.VcsMergeContinueParams,
449
+ _context: PluginRuntimeContext,
450
+ ): null {
451
+ const git = this.requireGit(params.session_id);
452
+ git.mergeContinue(asTrimmedString(params.message) || undefined);
453
+ return null;
454
+ }
455
+
456
+ override isMergeInProgress(
457
+ params: OpenVcs.VcsSessionParams,
458
+ _context: PluginRuntimeContext,
459
+ ): boolean {
460
+ const git = this.requireGit(params.session_id);
461
+ return git.isMergeInProgress();
462
+ }
463
+
464
+ override setBranchUpstream(
465
+ params: OpenVcs.VcsSetBranchUpstreamParams,
466
+ _context: PluginRuntimeContext,
467
+ ): null {
468
+ const git = this.requireGit(params.session_id);
469
+ git.setBranchUpstream(
470
+ asTrimmedString(params.branch),
471
+ asTrimmedString(params.upstream),
472
+ );
473
+ return null;
474
+ }
475
+
476
+ override getBranchUpstream(
477
+ params: OpenVcs.VcsGetBranchUpstreamParams,
478
+ _context: PluginRuntimeContext,
479
+ ): string | null {
480
+ const git = this.requireGit(params.session_id);
481
+ return git.getBranchUpstream(asTrimmedString(params.branch));
482
+ }
483
+
484
+ override hardResetHead(
485
+ params: OpenVcs.VcsHardResetHeadParams,
486
+ _context: PluginRuntimeContext,
487
+ ): null {
488
+ const git = this.requireGit(params.session_id);
489
+ git.hardResetHead(params.ref);
490
+ return null;
491
+ }
492
+
493
+ override resetSoftTo(
494
+ params: OpenVcs.VcsResetSoftToParams,
495
+ _context: PluginRuntimeContext,
496
+ ): null {
497
+ const git = this.requireGit(params.session_id);
498
+ git.resetSoftTo(asTrimmedString(params.rev));
499
+ return null;
500
+ }
501
+
502
+ override getIdentity(
503
+ params: OpenVcs.VcsSessionParams,
504
+ _context: PluginRuntimeContext,
505
+ ): OpenVcs.VcsIdentity | null {
506
+ const git = this.requireGit(params.session_id);
507
+ return git.getIdentity();
508
+ }
509
+
510
+ override setIdentityLocal(
511
+ params: OpenVcs.VcsSetIdentityLocalParams,
512
+ _context: PluginRuntimeContext,
513
+ ): null {
514
+ const git = this.requireGit(params.session_id);
515
+ git.setIdentityLocal(
516
+ asTrimmedString(params.name),
517
+ asTrimmedString(params.email),
518
+ );
519
+ return null;
520
+ }
521
+
522
+ override listStashes(
523
+ params: OpenVcs.VcsSessionParams,
524
+ _context: PluginRuntimeContext,
525
+ ): OpenVcs.StashEntry[] {
526
+ const git = this.requireGit(params.session_id);
527
+ return git.listStashes();
528
+ }
529
+
530
+ override stashPush(
531
+ params: OpenVcs.VcsStashPushParams,
532
+ _context: PluginRuntimeContext,
533
+ ): string {
534
+ const git = this.requireGit(params.session_id);
535
+ return git.stashPush(
536
+ asTrimmedString(params.message) || undefined,
537
+ params.include_untracked,
538
+ );
539
+ }
540
+
541
+ override stashApply(
542
+ params: OpenVcs.VcsStashSelectorParams,
543
+ _context: PluginRuntimeContext,
544
+ ): null {
545
+ const git = this.requireGit(params.session_id);
546
+ git.stashApply(asString(params.selector));
547
+ return null;
548
+ }
549
+
550
+ override stashPop(
551
+ params: OpenVcs.VcsStashSelectorParams,
552
+ _context: PluginRuntimeContext,
553
+ ): null {
554
+ const git = this.requireGit(params.session_id);
555
+ git.stashPop(asString(params.selector));
556
+ return null;
557
+ }
558
+
559
+ override stashDrop(
560
+ params: OpenVcs.VcsStashSelectorParams,
561
+ _context: PluginRuntimeContext,
562
+ ): null {
563
+ const git = this.requireGit(params.session_id);
564
+ git.stashDrop(asString(params.selector));
565
+ return null;
566
+ }
567
+
568
+ override stashShow(
569
+ params: OpenVcs.VcsStashSelectorParams,
570
+ _context: PluginRuntimeContext,
571
+ ): string {
572
+ const git = this.requireGit(params.session_id);
573
+ return git.stashShow(asString(params.selector));
574
+ }
575
+
576
+ override cherryPick(
577
+ params: OpenVcs.VcsCherryPickParams,
578
+ _context: PluginRuntimeContext,
579
+ ): null {
580
+ const git = this.requireGit(params.session_id);
581
+ git.cherryPick(asTrimmedString(params.commit));
582
+ return null;
583
+ }
584
+
585
+ override revertCommit(
586
+ params: OpenVcs.VcsRevertCommitParams,
587
+ _context: PluginRuntimeContext,
588
+ ): null {
589
+ const git = this.requireGit(params.session_id);
590
+ git.revertCommit(asTrimmedString(params.commit), params.no_edit);
591
+ return null;
592
+ }
593
+ }
@@ -0,0 +1,52 @@
1
+ // Copyright © 2025-2026 OpenVCS Contributors
2
+ // SPDX-License-Identifier: GPL-3.0-or-later
3
+
4
+ import { pluginError } from '@openvcs/sdk/runtime';
5
+
6
+ import { asString } from './plugin-helpers.js';
7
+ import type { GitSession } from './plugin-types.js';
8
+
9
+ /** Stores the next session id allocated for `vcs.open`. Allocated once per plugin runtime instance
10
+ * and persists for the lifetime of the process. Session IDs are opaque integers assigned
11
+ * sequentially starting from 1. */
12
+ let nextSessionId = 1;
13
+
14
+ /** Stores all active repository sessions keyed by session id. */
15
+ const sessions = new Map<string, GitSession>();
16
+
17
+ /** Allocates a new repository session and returns its generated id. */
18
+ export function allocateSession(session: GitSession): string {
19
+ const sessionId = String(nextSessionId);
20
+ nextSessionId += 1;
21
+ sessions.set(sessionId, session);
22
+ return sessionId;
23
+ }
24
+
25
+ /** Removes an existing repository session. */
26
+ export function closeSession(sessionId: unknown): void {
27
+ const key = asString(sessionId);
28
+ if (!sessions.has(key)) {
29
+ throw pluginError('vcs-invalid-session', `session '${key}' not found`);
30
+ }
31
+ sessions.delete(key);
32
+ }
33
+
34
+ /** Resets all session state. Useful for testing to ensure clean state between test runs. */
35
+ export function resetSessions(): void {
36
+ nextSessionId = 1;
37
+ sessions.clear();
38
+ }
39
+
40
+ /** Resolves a required session or throws a host-facing plugin error. */
41
+ export function requireSession(sessionId: unknown): GitSession {
42
+ const session = sessions.get(asString(sessionId));
43
+
44
+ if (!session) {
45
+ throw pluginError(
46
+ 'vcs-invalid-session',
47
+ `unknown session '${asString(sessionId)}'`,
48
+ );
49
+ }
50
+
51
+ return session;
52
+ }
@@ -0,0 +1,35 @@
1
+ // Copyright © 2025-2026 OpenVCS Contributors
2
+ // SPDX-License-Identifier: GPL-3.0-or-later
3
+
4
+ export type {
5
+ CommitEntry,
6
+ JsonRpcId,
7
+ RequestParams,
8
+ StashEntry,
9
+ StatusFileEntry,
10
+ StatusParseResult,
11
+ StatusPayload,
12
+ StatusSummary,
13
+ } from '@openvcs/sdk/types';
14
+
15
+ /** Describes one opened Git repository session. */
16
+ export interface GitSession {
17
+ /** Stores the absolute repository path for the session. */
18
+ path: string;
19
+ }
20
+
21
+ /** Describes the captured result of one git subprocess. */
22
+ export interface GitCommandResult {
23
+ /** Stores the subprocess exit status. */
24
+ status: number;
25
+ /** Stores captured standard output. */
26
+ stdout: string;
27
+ /** Stores captured standard error. */
28
+ stderr: string;
29
+ }
30
+
31
+ /** Describes the optional stdin payload for one git subprocess. */
32
+ export interface RunGitOptions {
33
+ /** Supplies content written to stdin before the child exits. */
34
+ stdin?: string;
35
+ }