pi-fabric 0.61.2 → 0.61.3
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/chunks/{chunk-ZQMNKN4L.js → chunk-DVOJW7LJ.js} +17 -9
- package/dist/chunks/chunk-DVOJW7LJ.js.map +7 -0
- package/dist/chunks/{dashboard-CILP3YBM.js → dashboard-B6K3VWQL.js} +2 -2
- package/dist/index.js +2 -2
- package/dist/ui/core-tool-render.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/chunks/chunk-ZQMNKN4L.js.map +0 -7
- /package/dist/chunks/{dashboard-CILP3YBM.js.map → dashboard-B6K3VWQL.js.map} +0 -0
|
@@ -681,9 +681,9 @@ var fileHighlightRange = (entry, from, to, invalidate) => {
|
|
|
681
681
|
entry.waiters.push({ to: clampedTo, invalidate });
|
|
682
682
|
scheduleFileHighlight(entry);
|
|
683
683
|
}
|
|
684
|
-
if (entry.lines.length <
|
|
684
|
+
if (entry.lines.length < clampedTo) return null;
|
|
685
685
|
const out = [];
|
|
686
|
-
for (let index = from; index < to; index++) {
|
|
686
|
+
for (let index = from; index < Math.min(to, total); index++) {
|
|
687
687
|
out.push({ raw: entry.sourceLines[index] ?? "", ansi: entry.lines[index] ?? "" });
|
|
688
688
|
}
|
|
689
689
|
return out;
|
|
@@ -3225,20 +3225,26 @@ var highlightRemovedDiffLines = (parsed, filePath, language, cwd, invalidate) =>
|
|
|
3225
3225
|
while (end < parsed.length && parsed[end]) end++;
|
|
3226
3226
|
const block = parsed.slice(start, end);
|
|
3227
3227
|
const removed = [];
|
|
3228
|
-
|
|
3228
|
+
const contextBefore = [];
|
|
3229
3229
|
for (let offset = 0; offset < block.length; offset++) {
|
|
3230
3230
|
const line = block[offset];
|
|
3231
3231
|
const n = Number.parseInt(line.lineNumber.trim(), 10);
|
|
3232
|
-
if (!Number.isFinite(n) || n <= 0)
|
|
3232
|
+
if (!Number.isFinite(n) || n <= 0) continue;
|
|
3233
3233
|
if (line.kind === "-") removed.push({ row: start + offset, n, content: expandTabs(line.content) });
|
|
3234
|
-
else if (line.kind === " "
|
|
3234
|
+
else if (line.kind === " " && removed.length === 0) contextBefore.push({ n, content: expandTabs(line.content) });
|
|
3235
3235
|
}
|
|
3236
3236
|
if (removed.length === 0) return null;
|
|
3237
3237
|
for (let index = 1; index < removed.length; index++) {
|
|
3238
3238
|
if (removed[index].n !== removed[index - 1].n + 1) return null;
|
|
3239
3239
|
}
|
|
3240
3240
|
const firstRemoved = removed[0].n;
|
|
3241
|
-
|
|
3241
|
+
for (let index = 1; index < contextBefore.length; index++) {
|
|
3242
|
+
if (contextBefore[index].n !== contextBefore[index - 1].n + 1) return null;
|
|
3243
|
+
}
|
|
3244
|
+
if (contextBefore.length > 0 && contextBefore[contextBefore.length - 1].n !== firstRemoved - 1) {
|
|
3245
|
+
return null;
|
|
3246
|
+
}
|
|
3247
|
+
const anchor = contextBefore.length > 0 ? contextBefore[0].n : firstRemoved;
|
|
3242
3248
|
const absolute = resolve(cwd, filePath);
|
|
3243
3249
|
let stat;
|
|
3244
3250
|
try {
|
|
@@ -3258,12 +3264,14 @@ var highlightRemovedDiffLines = (parsed, filePath, language, cwd, invalidate) =>
|
|
|
3258
3264
|
for (const line of block) {
|
|
3259
3265
|
if (line.kind !== " ") continue;
|
|
3260
3266
|
const n = Number.parseInt(line.lineNumber.trim(), 10);
|
|
3267
|
+
if (!Number.isFinite(n)) continue;
|
|
3261
3268
|
if (fileLines[n - 1] !== expandTabs(line.content)) return null;
|
|
3262
3269
|
}
|
|
3263
3270
|
const prefixCount = Math.max(0, Math.min(anchor - 1, DIFF_REMOVED_CONTEXT_LINES));
|
|
3264
3271
|
const prefix = fileLines.slice(anchor - 1 - prefixCount, anchor - 1);
|
|
3265
3272
|
const removedContents = removed.map((row) => row.content);
|
|
3266
|
-
const
|
|
3273
|
+
const contextContents = contextBefore.map((context) => context.content);
|
|
3274
|
+
const virtual = [...prefix, ...contextContents, ...removedContents];
|
|
3267
3275
|
const cacheKey = `removed\0${language}\0${absolute}\0${hashSourceText(virtual.join("\n"))}`;
|
|
3268
3276
|
const covered = highlightSourceLines(
|
|
3269
3277
|
cacheKey,
|
|
@@ -3276,7 +3284,7 @@ var highlightRemovedDiffLines = (parsed, filePath, language, cwd, invalidate) =>
|
|
|
3276
3284
|
if (!covered) return null;
|
|
3277
3285
|
const out = /* @__PURE__ */ new Map();
|
|
3278
3286
|
for (let index = 0; index < removed.length; index++) {
|
|
3279
|
-
const entry = covered[index];
|
|
3287
|
+
const entry = covered[contextContents.length + index];
|
|
3280
3288
|
if (entry && entry.raw === removed[index].content) out.set(removed[index].row, entry.ansi);
|
|
3281
3289
|
}
|
|
3282
3290
|
return out;
|
|
@@ -4980,4 +4988,4 @@ export {
|
|
|
4980
4988
|
isActiveStatus,
|
|
4981
4989
|
orderAgentsByCreation
|
|
4982
4990
|
};
|
|
4983
|
-
//# sourceMappingURL=chunk-
|
|
4991
|
+
//# sourceMappingURL=chunk-DVOJW7LJ.js.map
|