@junctionpanel/server 0.1.80 → 0.1.82
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/server/server/agent/agent-manager.d.ts +2 -0
- package/dist/server/server/agent/agent-manager.d.ts.map +1 -1
- package/dist/server/server/agent/agent-manager.js +115 -2
- package/dist/server/server/agent/agent-manager.js.map +1 -1
- package/dist/server/server/agent/agent-sdk-types.d.ts +2 -0
- package/dist/server/server/agent/agent-sdk-types.d.ts.map +1 -1
- package/dist/server/server/agent/agent-sdk-types.js.map +1 -1
- package/dist/server/server/agent/harness/context.d.ts +21 -0
- package/dist/server/server/agent/harness/context.d.ts.map +1 -0
- package/dist/server/server/agent/harness/context.js +541 -0
- package/dist/server/server/agent/harness/context.js.map +1 -0
- package/dist/server/server/agent/harness/memory.d.ts +17 -0
- package/dist/server/server/agent/harness/memory.d.ts.map +1 -0
- package/dist/server/server/agent/harness/memory.js +261 -0
- package/dist/server/server/agent/harness/memory.js.map +1 -0
- package/dist/server/server/agent/harness/types.d.ts +114 -0
- package/dist/server/server/agent/harness/types.d.ts.map +1 -0
- package/dist/server/server/agent/harness/types.js +3 -0
- package/dist/server/server/agent/harness/types.js.map +1 -0
- package/dist/server/server/agent/providers/gemini-agent.d.ts +1 -1
- package/dist/server/server/agent/providers/gemini-agent.d.ts.map +1 -1
- package/dist/server/server/agent/providers/gemini-agent.js +24 -12
- package/dist/server/server/agent/providers/gemini-agent.js.map +1 -1
- package/dist/server/server/agent/providers/tool-call-detail-primitives.d.ts.map +1 -1
- package/dist/server/server/persisted-config.d.ts +4 -4
- package/dist/server/server/session.d.ts.map +1 -1
- package/dist/server/server/session.js +7 -9
- package/dist/server/server/session.js.map +1 -1
- package/dist/server/shared/messages.d.ts +20 -20
- package/dist/server/utils/checkout-git.d.ts +2 -0
- package/dist/server/utils/checkout-git.d.ts.map +1 -1
- package/dist/server/utils/checkout-git.js +74 -29
- package/dist/server/utils/checkout-git.js.map +1 -1
- package/package.json +2 -2
|
@@ -1825,10 +1825,10 @@ export declare const SubscribeCheckoutDiffRequestSchema: z.ZodObject<{
|
|
|
1825
1825
|
mode: z.ZodEnum<["uncommitted", "base", "staged", "unstaged"]>;
|
|
1826
1826
|
baseRef: z.ZodOptional<z.ZodString>;
|
|
1827
1827
|
}, "strip", z.ZodTypeAny, {
|
|
1828
|
-
mode: "
|
|
1828
|
+
mode: "base" | "uncommitted" | "staged" | "unstaged";
|
|
1829
1829
|
baseRef?: string | undefined;
|
|
1830
1830
|
}, {
|
|
1831
|
-
mode: "
|
|
1831
|
+
mode: "base" | "uncommitted" | "staged" | "unstaged";
|
|
1832
1832
|
baseRef?: string | undefined;
|
|
1833
1833
|
}>;
|
|
1834
1834
|
detail: z.ZodOptional<z.ZodEnum<["summary", "full"]>>;
|
|
@@ -1839,7 +1839,7 @@ export declare const SubscribeCheckoutDiffRequestSchema: z.ZodObject<{
|
|
|
1839
1839
|
requestId: string;
|
|
1840
1840
|
subscriptionId: string;
|
|
1841
1841
|
compare: {
|
|
1842
|
-
mode: "
|
|
1842
|
+
mode: "base" | "uncommitted" | "staged" | "unstaged";
|
|
1843
1843
|
baseRef?: string | undefined;
|
|
1844
1844
|
};
|
|
1845
1845
|
detail?: "summary" | "full" | undefined;
|
|
@@ -1849,7 +1849,7 @@ export declare const SubscribeCheckoutDiffRequestSchema: z.ZodObject<{
|
|
|
1849
1849
|
requestId: string;
|
|
1850
1850
|
subscriptionId: string;
|
|
1851
1851
|
compare: {
|
|
1852
|
-
mode: "
|
|
1852
|
+
mode: "base" | "uncommitted" | "staged" | "unstaged";
|
|
1853
1853
|
baseRef?: string | undefined;
|
|
1854
1854
|
};
|
|
1855
1855
|
detail?: "summary" | "full" | undefined;
|
|
@@ -3804,10 +3804,10 @@ export declare const SessionInboundMessageSchema: z.ZodDiscriminatedUnion<"type"
|
|
|
3804
3804
|
mode: z.ZodEnum<["uncommitted", "base", "staged", "unstaged"]>;
|
|
3805
3805
|
baseRef: z.ZodOptional<z.ZodString>;
|
|
3806
3806
|
}, "strip", z.ZodTypeAny, {
|
|
3807
|
-
mode: "
|
|
3807
|
+
mode: "base" | "uncommitted" | "staged" | "unstaged";
|
|
3808
3808
|
baseRef?: string | undefined;
|
|
3809
3809
|
}, {
|
|
3810
|
-
mode: "
|
|
3810
|
+
mode: "base" | "uncommitted" | "staged" | "unstaged";
|
|
3811
3811
|
baseRef?: string | undefined;
|
|
3812
3812
|
}>;
|
|
3813
3813
|
detail: z.ZodOptional<z.ZodEnum<["summary", "full"]>>;
|
|
@@ -3818,7 +3818,7 @@ export declare const SessionInboundMessageSchema: z.ZodDiscriminatedUnion<"type"
|
|
|
3818
3818
|
requestId: string;
|
|
3819
3819
|
subscriptionId: string;
|
|
3820
3820
|
compare: {
|
|
3821
|
-
mode: "
|
|
3821
|
+
mode: "base" | "uncommitted" | "staged" | "unstaged";
|
|
3822
3822
|
baseRef?: string | undefined;
|
|
3823
3823
|
};
|
|
3824
3824
|
detail?: "summary" | "full" | undefined;
|
|
@@ -3828,7 +3828,7 @@ export declare const SessionInboundMessageSchema: z.ZodDiscriminatedUnion<"type"
|
|
|
3828
3828
|
requestId: string;
|
|
3829
3829
|
subscriptionId: string;
|
|
3830
3830
|
compare: {
|
|
3831
|
-
mode: "
|
|
3831
|
+
mode: "base" | "uncommitted" | "staged" | "unstaged";
|
|
3832
3832
|
baseRef?: string | undefined;
|
|
3833
3833
|
};
|
|
3834
3834
|
detail?: "summary" | "full" | undefined;
|
|
@@ -31005,10 +31005,10 @@ export declare const WSSessionInboundSchema: z.ZodObject<{
|
|
|
31005
31005
|
mode: z.ZodEnum<["uncommitted", "base", "staged", "unstaged"]>;
|
|
31006
31006
|
baseRef: z.ZodOptional<z.ZodString>;
|
|
31007
31007
|
}, "strip", z.ZodTypeAny, {
|
|
31008
|
-
mode: "
|
|
31008
|
+
mode: "base" | "uncommitted" | "staged" | "unstaged";
|
|
31009
31009
|
baseRef?: string | undefined;
|
|
31010
31010
|
}, {
|
|
31011
|
-
mode: "
|
|
31011
|
+
mode: "base" | "uncommitted" | "staged" | "unstaged";
|
|
31012
31012
|
baseRef?: string | undefined;
|
|
31013
31013
|
}>;
|
|
31014
31014
|
detail: z.ZodOptional<z.ZodEnum<["summary", "full"]>>;
|
|
@@ -31019,7 +31019,7 @@ export declare const WSSessionInboundSchema: z.ZodObject<{
|
|
|
31019
31019
|
requestId: string;
|
|
31020
31020
|
subscriptionId: string;
|
|
31021
31021
|
compare: {
|
|
31022
|
-
mode: "
|
|
31022
|
+
mode: "base" | "uncommitted" | "staged" | "unstaged";
|
|
31023
31023
|
baseRef?: string | undefined;
|
|
31024
31024
|
};
|
|
31025
31025
|
detail?: "summary" | "full" | undefined;
|
|
@@ -31029,7 +31029,7 @@ export declare const WSSessionInboundSchema: z.ZodObject<{
|
|
|
31029
31029
|
requestId: string;
|
|
31030
31030
|
subscriptionId: string;
|
|
31031
31031
|
compare: {
|
|
31032
|
-
mode: "
|
|
31032
|
+
mode: "base" | "uncommitted" | "staged" | "unstaged";
|
|
31033
31033
|
baseRef?: string | undefined;
|
|
31034
31034
|
};
|
|
31035
31035
|
detail?: "summary" | "full" | undefined;
|
|
@@ -32100,7 +32100,7 @@ export declare const WSSessionInboundSchema: z.ZodObject<{
|
|
|
32100
32100
|
requestId: string;
|
|
32101
32101
|
subscriptionId: string;
|
|
32102
32102
|
compare: {
|
|
32103
|
-
mode: "
|
|
32103
|
+
mode: "base" | "uncommitted" | "staged" | "unstaged";
|
|
32104
32104
|
baseRef?: string | undefined;
|
|
32105
32105
|
};
|
|
32106
32106
|
detail?: "summary" | "full" | undefined;
|
|
@@ -32632,7 +32632,7 @@ export declare const WSSessionInboundSchema: z.ZodObject<{
|
|
|
32632
32632
|
requestId: string;
|
|
32633
32633
|
subscriptionId: string;
|
|
32634
32634
|
compare: {
|
|
32635
|
-
mode: "
|
|
32635
|
+
mode: "base" | "uncommitted" | "staged" | "unstaged";
|
|
32636
32636
|
baseRef?: string | undefined;
|
|
32637
32637
|
};
|
|
32638
32638
|
detail?: "summary" | "full" | undefined;
|
|
@@ -48659,10 +48659,10 @@ export declare const WSInboundMessageSchema: z.ZodDiscriminatedUnion<"type", [z.
|
|
|
48659
48659
|
mode: z.ZodEnum<["uncommitted", "base", "staged", "unstaged"]>;
|
|
48660
48660
|
baseRef: z.ZodOptional<z.ZodString>;
|
|
48661
48661
|
}, "strip", z.ZodTypeAny, {
|
|
48662
|
-
mode: "
|
|
48662
|
+
mode: "base" | "uncommitted" | "staged" | "unstaged";
|
|
48663
48663
|
baseRef?: string | undefined;
|
|
48664
48664
|
}, {
|
|
48665
|
-
mode: "
|
|
48665
|
+
mode: "base" | "uncommitted" | "staged" | "unstaged";
|
|
48666
48666
|
baseRef?: string | undefined;
|
|
48667
48667
|
}>;
|
|
48668
48668
|
detail: z.ZodOptional<z.ZodEnum<["summary", "full"]>>;
|
|
@@ -48673,7 +48673,7 @@ export declare const WSInboundMessageSchema: z.ZodDiscriminatedUnion<"type", [z.
|
|
|
48673
48673
|
requestId: string;
|
|
48674
48674
|
subscriptionId: string;
|
|
48675
48675
|
compare: {
|
|
48676
|
-
mode: "
|
|
48676
|
+
mode: "base" | "uncommitted" | "staged" | "unstaged";
|
|
48677
48677
|
baseRef?: string | undefined;
|
|
48678
48678
|
};
|
|
48679
48679
|
detail?: "summary" | "full" | undefined;
|
|
@@ -48683,7 +48683,7 @@ export declare const WSInboundMessageSchema: z.ZodDiscriminatedUnion<"type", [z.
|
|
|
48683
48683
|
requestId: string;
|
|
48684
48684
|
subscriptionId: string;
|
|
48685
48685
|
compare: {
|
|
48686
|
-
mode: "
|
|
48686
|
+
mode: "base" | "uncommitted" | "staged" | "unstaged";
|
|
48687
48687
|
baseRef?: string | undefined;
|
|
48688
48688
|
};
|
|
48689
48689
|
detail?: "summary" | "full" | undefined;
|
|
@@ -49754,7 +49754,7 @@ export declare const WSInboundMessageSchema: z.ZodDiscriminatedUnion<"type", [z.
|
|
|
49754
49754
|
requestId: string;
|
|
49755
49755
|
subscriptionId: string;
|
|
49756
49756
|
compare: {
|
|
49757
|
-
mode: "
|
|
49757
|
+
mode: "base" | "uncommitted" | "staged" | "unstaged";
|
|
49758
49758
|
baseRef?: string | undefined;
|
|
49759
49759
|
};
|
|
49760
49760
|
detail?: "summary" | "full" | undefined;
|
|
@@ -50286,7 +50286,7 @@ export declare const WSInboundMessageSchema: z.ZodDiscriminatedUnion<"type", [z.
|
|
|
50286
50286
|
requestId: string;
|
|
50287
50287
|
subscriptionId: string;
|
|
50288
50288
|
compare: {
|
|
50289
|
-
mode: "
|
|
50289
|
+
mode: "base" | "uncommitted" | "staged" | "unstaged";
|
|
50290
50290
|
baseRef?: string | undefined;
|
|
50291
50291
|
};
|
|
50292
50292
|
detail?: "summary" | "full" | undefined;
|
|
@@ -109,6 +109,8 @@ export interface CheckoutDiffCompare {
|
|
|
109
109
|
mode: "uncommitted" | "base" | "staged" | "unstaged";
|
|
110
110
|
baseRef?: string;
|
|
111
111
|
includeStructured?: boolean;
|
|
112
|
+
structuredDetail?: "summary" | "full";
|
|
113
|
+
includeDiffText?: boolean;
|
|
112
114
|
}
|
|
113
115
|
export interface MergeToBaseOptions {
|
|
114
116
|
baseRef?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkout-git.d.ts","sourceRoot":"","sources":["../../../src/utils/checkout-git.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"checkout-git.d.ts","sourceRoot":"","sources":["../../../src/utils/checkout-git.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAuH1E,MAAM,MAAM,uBAAuB,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;AACjE,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,QAAQ,CAAC;AAErD,MAAM,MAAM,aAAa,GAAG;IA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AEG;AACH,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,MAAM,EACX,OAAO,GAAE;IACP,MAAM,CAAC,EAAE,QAAQ,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;CACnB,GACL,OAAO,CAAC,IAAI,CAAC,CAwCf"}
|
|
@@ -3,7 +3,7 @@ import { promisify } from "util";
|
|
|
3
3
|
import { resolve, dirname, basename } from "path";
|
|
4
4
|
import { realpathSync } from "fs";
|
|
5
5
|
import { open as openFile, stat as statFile } from "fs/promises";
|
|
6
|
-
import { parseAndHighlightDiff } from "../server/utils/diff-highlighter.js";
|
|
6
|
+
import { parseAndHighlightDiff, parseDiff } from "../server/utils/diff-highlighter.js";
|
|
7
7
|
import { expandTilde } from "./path.js";
|
|
8
8
|
import { isJunctionOwnedWorktreeCwd } from "./worktree.js";
|
|
9
9
|
import { requireJunctionWorktreeBaseRefName } from "./worktree-metadata.js";
|
|
@@ -15,8 +15,8 @@ const READ_ONLY_GIT_ENV = {
|
|
|
15
15
|
};
|
|
16
16
|
const SAFE_GIT_REMOTE_NAME_PATTERN = /^[A-Za-z0-9._-]+$/;
|
|
17
17
|
const SMALL_OUTPUT_MAX_BUFFER = 20 * 1024 * 1024; // 20MB
|
|
18
|
-
async function execGit(
|
|
19
|
-
return
|
|
18
|
+
async function execGit(args, options) {
|
|
19
|
+
return execFileAsync("git", [...args], { ...options, maxBuffer: SMALL_OUTPUT_MAX_BUFFER });
|
|
20
20
|
}
|
|
21
21
|
function isSafeRemoteName(remoteName) {
|
|
22
22
|
return SAFE_GIT_REMOTE_NAME_PATTERN.test(remoteName);
|
|
@@ -108,7 +108,7 @@ function normalizeBranchSuggestionName(raw, source) {
|
|
|
108
108
|
return normalized;
|
|
109
109
|
}
|
|
110
110
|
async function listGitRefs(cwd, refPrefix) {
|
|
111
|
-
const { stdout } = await execGit(
|
|
111
|
+
const { stdout } = await execGit(["for-each-ref", "--format=%(refname:short)", refPrefix], {
|
|
112
112
|
cwd,
|
|
113
113
|
env: READ_ONLY_GIT_ENV,
|
|
114
114
|
});
|
|
@@ -214,8 +214,7 @@ export async function listBranchSuggestions(cwd, options) {
|
|
|
214
214
|
async function listCheckoutFileChanges(cwd, diffArgs, opts) {
|
|
215
215
|
const changes = [];
|
|
216
216
|
const includeUntracked = opts?.includeUntracked ?? true;
|
|
217
|
-
const
|
|
218
|
-
const { stdout: nameStatusOut } = await execGit(`git diff --name-status${diffArgsStr}`, {
|
|
217
|
+
const { stdout: nameStatusOut } = await execGit(["diff", "--name-status", ...diffArgs], {
|
|
219
218
|
cwd,
|
|
220
219
|
env: READ_ONLY_GIT_ENV,
|
|
221
220
|
});
|
|
@@ -251,7 +250,7 @@ async function listCheckoutFileChanges(cwd, diffArgs, opts) {
|
|
|
251
250
|
});
|
|
252
251
|
}
|
|
253
252
|
if (includeUntracked) {
|
|
254
|
-
const { stdout: untrackedOut } = await execGit("
|
|
253
|
+
const { stdout: untrackedOut } = await execGit(["ls-files", "--others", "--exclude-standard"], {
|
|
255
254
|
cwd,
|
|
256
255
|
env: READ_ONLY_GIT_ENV,
|
|
257
256
|
});
|
|
@@ -281,7 +280,10 @@ async function listCheckoutFileChanges(cwd, diffArgs, opts) {
|
|
|
281
280
|
}
|
|
282
281
|
async function tryResolveMergeBase(cwd, baseRef) {
|
|
283
282
|
try {
|
|
284
|
-
const { stdout } = await execGit(
|
|
283
|
+
const { stdout } = await execGit(["merge-base", baseRef, "HEAD"], {
|
|
284
|
+
cwd,
|
|
285
|
+
env: READ_ONLY_GIT_ENV,
|
|
286
|
+
});
|
|
285
287
|
const sha = stdout.trim();
|
|
286
288
|
return sha.length > 0 ? sha : null;
|
|
287
289
|
}
|
|
@@ -341,7 +343,10 @@ async function getTrackedNumstatByPath(cwd, diffArgs) {
|
|
|
341
343
|
}
|
|
342
344
|
stats.set(path, { additions, deletions, isBinary: false });
|
|
343
345
|
}
|
|
344
|
-
return
|
|
346
|
+
return {
|
|
347
|
+
stats,
|
|
348
|
+
truncated: result.truncated,
|
|
349
|
+
};
|
|
345
350
|
}
|
|
346
351
|
function isTrackedDiffTooLarge(stat) {
|
|
347
352
|
if (!stat || stat.isBinary) {
|
|
@@ -1130,6 +1135,9 @@ export async function getCheckoutStatusLite(cwd, context) {
|
|
|
1130
1135
|
}
|
|
1131
1136
|
export async function getCheckoutDiff(cwd, compare, context) {
|
|
1132
1137
|
await requireGitRepo(cwd);
|
|
1138
|
+
const includeStructured = compare.includeStructured === true;
|
|
1139
|
+
const structuredDetail = compare.structuredDetail ?? "full";
|
|
1140
|
+
const includeDiffText = compare.includeDiffText ?? true;
|
|
1133
1141
|
let diffArgs;
|
|
1134
1142
|
let includeUntracked;
|
|
1135
1143
|
if (compare.mode === "uncommitted") {
|
|
@@ -1173,20 +1181,29 @@ export async function getCheckoutDiff(cwd, compare, context) {
|
|
|
1173
1181
|
if (diffBytes >= TOTAL_DIFF_MAX_BYTES)
|
|
1174
1182
|
return;
|
|
1175
1183
|
const buf = Buffer.from(text, "utf8");
|
|
1176
|
-
|
|
1177
|
-
|
|
1184
|
+
const remaining = TOTAL_DIFF_MAX_BYTES - diffBytes;
|
|
1185
|
+
if (buf.length <= remaining) {
|
|
1178
1186
|
diffBytes += buf.length;
|
|
1187
|
+
if (includeDiffText) {
|
|
1188
|
+
diffText += text;
|
|
1189
|
+
}
|
|
1179
1190
|
return;
|
|
1180
1191
|
}
|
|
1181
|
-
const remaining = TOTAL_DIFF_MAX_BYTES - diffBytes;
|
|
1182
1192
|
if (remaining > 0) {
|
|
1183
|
-
diffText += buf.subarray(0, remaining).toString("utf8");
|
|
1184
1193
|
diffBytes = TOTAL_DIFF_MAX_BYTES;
|
|
1194
|
+
if (includeDiffText) {
|
|
1195
|
+
diffText += buf.subarray(0, remaining).toString("utf8");
|
|
1196
|
+
}
|
|
1185
1197
|
}
|
|
1186
1198
|
};
|
|
1187
1199
|
const trackedChanges = changes.filter((change) => !change.isUntracked);
|
|
1188
1200
|
const untrackedChanges = changes.filter((change) => change.isUntracked === true);
|
|
1189
|
-
const
|
|
1201
|
+
const needsTrackedDiffText = includeDiffText || (includeStructured && structuredDetail === "full");
|
|
1202
|
+
const trackedNumstatResult = trackedChanges.length > 0
|
|
1203
|
+
? await getTrackedNumstatByPath(cwd, diffArgs)
|
|
1204
|
+
: { stats: new Map(), truncated: false };
|
|
1205
|
+
const trackedNumstatByPath = trackedNumstatResult.stats;
|
|
1206
|
+
const trackedNumstatTruncated = trackedNumstatResult.truncated;
|
|
1190
1207
|
const trackedDiffPaths = [];
|
|
1191
1208
|
const trackedPlaceholderByPath = new Map();
|
|
1192
1209
|
for (const change of trackedChanges) {
|
|
@@ -1203,7 +1220,7 @@ export async function getCheckoutDiff(cwd, compare, context) {
|
|
|
1203
1220
|
}
|
|
1204
1221
|
let trackedDiffText = "";
|
|
1205
1222
|
let trackedDiffTruncated = false;
|
|
1206
|
-
if (trackedDiffPaths.length > 0) {
|
|
1223
|
+
if (trackedDiffPaths.length > 0 && needsTrackedDiffText) {
|
|
1207
1224
|
const trackedDiffResult = await spawnLimitedText({
|
|
1208
1225
|
cmd: "git",
|
|
1209
1226
|
args: ["diff", ...diffArgs, "--", ...trackedDiffPaths],
|
|
@@ -1214,7 +1231,7 @@ export async function getCheckoutDiff(cwd, compare, context) {
|
|
|
1214
1231
|
trackedDiffText = trackedDiffResult.text;
|
|
1215
1232
|
trackedDiffTruncated = trackedDiffResult.truncated;
|
|
1216
1233
|
appendDiff(trackedDiffText);
|
|
1217
|
-
if (trackedDiffTruncated) {
|
|
1234
|
+
if (includeDiffText && trackedDiffTruncated) {
|
|
1218
1235
|
appendDiff("# tracked diff truncated\n");
|
|
1219
1236
|
}
|
|
1220
1237
|
}
|
|
@@ -1225,8 +1242,10 @@ export async function getCheckoutDiff(cwd, compare, context) {
|
|
|
1225
1242
|
}
|
|
1226
1243
|
appendDiff(`# ${change.path}: diff too large omitted\n`);
|
|
1227
1244
|
};
|
|
1228
|
-
if (
|
|
1229
|
-
const parsedTrackedFiles = trackedDiffText.length > 0
|
|
1245
|
+
if (includeStructured) {
|
|
1246
|
+
const parsedTrackedFiles = structuredDetail === "full" && trackedDiffText.length > 0
|
|
1247
|
+
? await parseAndHighlightDiff(trackedDiffText, cwd)
|
|
1248
|
+
: [];
|
|
1230
1249
|
const parsedTrackedByPath = new Map(parsedTrackedFiles.map((file) => [file.path, file]));
|
|
1231
1250
|
for (const change of trackedChanges) {
|
|
1232
1251
|
const placeholder = trackedPlaceholderByPath.get(change.path);
|
|
@@ -1235,10 +1254,25 @@ export async function getCheckoutDiff(cwd, compare, context) {
|
|
|
1235
1254
|
status: placeholder.status,
|
|
1236
1255
|
stat: placeholder.stat,
|
|
1237
1256
|
}));
|
|
1238
|
-
|
|
1257
|
+
if (includeDiffText) {
|
|
1258
|
+
appendTrackedPlaceholderComment(change, placeholder.status);
|
|
1259
|
+
}
|
|
1239
1260
|
continue;
|
|
1240
1261
|
}
|
|
1241
1262
|
const stat = trackedNumstatByPath.get(change.path) ?? null;
|
|
1263
|
+
if (structuredDetail === "summary") {
|
|
1264
|
+
const missingSummaryStat = stat === null && trackedNumstatTruncated;
|
|
1265
|
+
structured.push({
|
|
1266
|
+
path: change.path,
|
|
1267
|
+
isNew: change.isNew,
|
|
1268
|
+
isDeleted: change.isDeleted,
|
|
1269
|
+
additions: stat?.additions ?? 0,
|
|
1270
|
+
deletions: stat?.deletions ?? 0,
|
|
1271
|
+
hunks: [],
|
|
1272
|
+
status: missingSummaryStat ? "too_large" : "ok",
|
|
1273
|
+
});
|
|
1274
|
+
continue;
|
|
1275
|
+
}
|
|
1242
1276
|
const parsedFile = parsedTrackedByPath.get(change.path);
|
|
1243
1277
|
if (parsedFile) {
|
|
1244
1278
|
structured.push({
|
|
@@ -1264,7 +1298,7 @@ export async function getCheckoutDiff(cwd, compare, context) {
|
|
|
1264
1298
|
else {
|
|
1265
1299
|
for (const change of trackedChanges) {
|
|
1266
1300
|
const placeholder = trackedPlaceholderByPath.get(change.path);
|
|
1267
|
-
if (placeholder) {
|
|
1301
|
+
if (placeholder && includeDiffText) {
|
|
1268
1302
|
appendTrackedPlaceholderComment(change, placeholder.status);
|
|
1269
1303
|
}
|
|
1270
1304
|
}
|
|
@@ -1274,12 +1308,16 @@ export async function getCheckoutDiff(cwd, compare, context) {
|
|
|
1274
1308
|
break;
|
|
1275
1309
|
}
|
|
1276
1310
|
const { text, truncated, stat } = await getUntrackedDiffText(cwd, change);
|
|
1277
|
-
if (!
|
|
1311
|
+
if (!includeStructured) {
|
|
1278
1312
|
if (stat?.isBinary) {
|
|
1279
|
-
|
|
1313
|
+
if (includeDiffText) {
|
|
1314
|
+
appendDiff(`# ${change.path}: binary diff omitted\n`);
|
|
1315
|
+
}
|
|
1280
1316
|
}
|
|
1281
1317
|
else if (truncated) {
|
|
1282
|
-
|
|
1318
|
+
if (includeDiffText) {
|
|
1319
|
+
appendDiff(`# ${change.path}: diff too large omitted\n`);
|
|
1320
|
+
}
|
|
1283
1321
|
}
|
|
1284
1322
|
else {
|
|
1285
1323
|
appendDiff(text);
|
|
@@ -1288,16 +1326,22 @@ export async function getCheckoutDiff(cwd, compare, context) {
|
|
|
1288
1326
|
}
|
|
1289
1327
|
if (stat?.isBinary) {
|
|
1290
1328
|
structured.push(buildPlaceholderParsedDiffFile(change, { status: "binary", stat }));
|
|
1291
|
-
|
|
1329
|
+
if (includeDiffText) {
|
|
1330
|
+
appendDiff(`# ${change.path}: binary diff omitted\n`);
|
|
1331
|
+
}
|
|
1292
1332
|
continue;
|
|
1293
1333
|
}
|
|
1294
1334
|
if (truncated) {
|
|
1295
1335
|
structured.push(buildPlaceholderParsedDiffFile(change, { status: "too_large", stat }));
|
|
1296
|
-
|
|
1336
|
+
if (includeDiffText) {
|
|
1337
|
+
appendDiff(`# ${change.path}: diff too large omitted\n`);
|
|
1338
|
+
}
|
|
1297
1339
|
continue;
|
|
1298
1340
|
}
|
|
1299
1341
|
appendDiff(text);
|
|
1300
|
-
const parsed =
|
|
1342
|
+
const parsed = structuredDetail === "summary"
|
|
1343
|
+
? parseDiff(text)
|
|
1344
|
+
: await parseAndHighlightDiff(text, cwd);
|
|
1301
1345
|
const parsedFile = parsed[0] ??
|
|
1302
1346
|
{
|
|
1303
1347
|
path: change.path,
|
|
@@ -1312,13 +1356,14 @@ export async function getCheckoutDiff(cwd, compare, context) {
|
|
|
1312
1356
|
path: change.path,
|
|
1313
1357
|
isNew: change.isNew,
|
|
1314
1358
|
isDeleted: change.isDeleted,
|
|
1359
|
+
hunks: structuredDetail === "summary" ? [] : parsedFile.hunks,
|
|
1315
1360
|
status: "ok",
|
|
1316
1361
|
});
|
|
1317
1362
|
}
|
|
1318
|
-
if (
|
|
1319
|
-
return { diff: diffText, structured };
|
|
1363
|
+
if (includeStructured) {
|
|
1364
|
+
return { diff: includeDiffText ? diffText : "", structured };
|
|
1320
1365
|
}
|
|
1321
|
-
return { diff: diffText };
|
|
1366
|
+
return { diff: includeDiffText ? diffText : "" };
|
|
1322
1367
|
}
|
|
1323
1368
|
export async function commitChanges(cwd, options) {
|
|
1324
1369
|
await requireGitRepo(cwd);
|