@ai-ecoverse/slicc-spectrum 1.67.0 → 1.68.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/README.md +4 -4
- package/dist/slicc-dummy.js +14 -7
- package/dist/slicc-dummy.js.map +2 -2
- package/dist/slicc-ui.js +115 -72
- package/dist/slicc-ui.js.map +3 -3
- package/dist/types/app/network.d.ts +8 -5
- package/dist/types/app/reach.d.ts +6 -3
- package/dist/types/model/types.d.ts +1 -1
- package/package.json +2 -2
package/dist/slicc-ui.js
CHANGED
|
@@ -11546,9 +11546,9 @@ var QrCode = class {
|
|
|
11546
11546
|
}
|
|
11547
11547
|
const result = [];
|
|
11548
11548
|
for (let i26 = 0; i26 < blocks[0].length; i26++) {
|
|
11549
|
-
blocks.forEach((
|
|
11549
|
+
blocks.forEach((block3, j5) => {
|
|
11550
11550
|
if (i26 !== shortBlockLen - blockEccLen || j5 >= numShortBlocks)
|
|
11551
|
-
result.push(
|
|
11551
|
+
result.push(block3[i26]);
|
|
11552
11552
|
});
|
|
11553
11553
|
}
|
|
11554
11554
|
return result;
|
|
@@ -11987,7 +11987,9 @@ function qrCode(text2, label) {
|
|
|
11987
11987
|
}
|
|
11988
11988
|
|
|
11989
11989
|
// src/app/reach.ts
|
|
11990
|
-
var command = "
|
|
11990
|
+
var command = "curl -fsSL https://get.sliccy.ai/slicc | sh";
|
|
11991
|
+
var startCommand = "slicc";
|
|
11992
|
+
var nodeCommand = "npx sliccy@next";
|
|
11991
11993
|
var reachStyles = i`
|
|
11992
11994
|
.command {
|
|
11993
11995
|
display: flex;
|
|
@@ -12000,22 +12002,48 @@ var reachStyles = i`
|
|
|
12000
12002
|
code {
|
|
12001
12003
|
flex: 1;
|
|
12002
12004
|
min-width: 0;
|
|
12003
|
-
overflow-wrap:
|
|
12005
|
+
overflow-wrap: break-word;
|
|
12006
|
+
word-break: normal;
|
|
12004
12007
|
font-family: var(--swc-code-font-family-stack);
|
|
12005
12008
|
font-size: var(--swc-font-size-75);
|
|
12006
12009
|
color: var(--swc-code-color);
|
|
12007
12010
|
user-select: all;
|
|
12008
12011
|
}
|
|
12012
|
+
.commands {
|
|
12013
|
+
display: grid;
|
|
12014
|
+
gap: var(--swc-spacing-100);
|
|
12015
|
+
}
|
|
12016
|
+
.commands p {
|
|
12017
|
+
margin: 0;
|
|
12018
|
+
font-size: var(--swc-font-size-75);
|
|
12019
|
+
color: var(--swc-neutral-subdued-content-color-default);
|
|
12020
|
+
}
|
|
12009
12021
|
`;
|
|
12022
|
+
function block(text2, copied, copy, first2 = false) {
|
|
12023
|
+
const done2 = copied === text2;
|
|
12024
|
+
return b`<div class="command" data-command=${text2}>
|
|
12025
|
+
<code>${breakable(text2)}</code>
|
|
12026
|
+
<swc-action-button size="s" quiet data-action=${first2 ? "copy-command" : A} accessible-label=${done2 ? "Copied" : `Copy ${text2}`} @click=${() => copy(text2)}>
|
|
12027
|
+
<swc-icon-copy slot="icon"></swc-icon-copy>${done2 ? "Copied" : "Copy"}
|
|
12028
|
+
</swc-action-button>
|
|
12029
|
+
</div>`;
|
|
12030
|
+
}
|
|
12031
|
+
function breakable(text2) {
|
|
12032
|
+
return text2.split("/").map(
|
|
12033
|
+
(part2, index, parts2) => b`${part2}${index < parts2.length - 1 ? b`/<wbr />` : A}`
|
|
12034
|
+
);
|
|
12035
|
+
}
|
|
12010
12036
|
function reach({ intro, extensionUrl, copied, uncopied, copy }) {
|
|
12011
12037
|
return b`<p>${intro}</p>
|
|
12012
12038
|
${extensionUrl ? b`<p><a class="swc-Link" href=${extensionUrl} target="_blank" rel="noopener noreferrer" data-action="install-extension">Install the Chrome extension</a></p>` : A}
|
|
12013
|
-
<p>To run slicc
|
|
12014
|
-
<div class="
|
|
12015
|
-
|
|
12016
|
-
|
|
12017
|
-
|
|
12018
|
-
|
|
12039
|
+
<p>To run slicc, enter this in a terminal:</p>
|
|
12040
|
+
<div class="commands">
|
|
12041
|
+
${block(command, copied, copy, true)}
|
|
12042
|
+
${block(startCommand, copied, copy)}
|
|
12043
|
+
</div>
|
|
12044
|
+
<div class="commands" data-commands="node">
|
|
12045
|
+
<p>With Node:</p>
|
|
12046
|
+
${block(nodeCommand, copied, copy)}
|
|
12019
12047
|
</div>
|
|
12020
12048
|
${uncopied ? b`<div class="error" role="alert" data-error="copy"><swc-icon-alert-triangle size="s" aria-hidden="true"></swc-icon-alert-triangle><span>Couldn’t copy. Select the command and copy it.</span></div>` : A}`;
|
|
12021
12049
|
}
|
|
@@ -12167,7 +12195,8 @@ var networkHealth = {
|
|
|
12167
12195
|
failing: ["negative", "Failing"]
|
|
12168
12196
|
};
|
|
12169
12197
|
var routes = {
|
|
12170
|
-
proxy: "Through slicc
|
|
12198
|
+
proxy: "Through slicc on this computer, which reaches every site.",
|
|
12199
|
+
link: "Through a linked device.",
|
|
12171
12200
|
extension: "Through the SLICC Chrome extension, which reaches every site.",
|
|
12172
12201
|
tailnet: "Through a Tailscale exit node, which reaches every site.",
|
|
12173
12202
|
page: "Through this page\u2019s own fetch. Sites that block cross-origin requests are out of reach.",
|
|
@@ -12175,27 +12204,36 @@ var routes = {
|
|
|
12175
12204
|
};
|
|
12176
12205
|
var automation = {
|
|
12177
12206
|
extension: "Browser automation: through the SLICC extension.",
|
|
12178
|
-
proxy: "Browser automation: through slicc
|
|
12207
|
+
proxy: "Browser automation: through slicc on this computer.",
|
|
12179
12208
|
link: "Browser automation: through a linked device.",
|
|
12180
|
-
none: "Browser automation: not available. Install the extension, or run slicc
|
|
12209
|
+
none: "Browser automation: not available. Install the extension, or run slicc on this computer."
|
|
12181
12210
|
};
|
|
12211
|
+
function exitDevice(status2) {
|
|
12212
|
+
const exit = status2.exit;
|
|
12213
|
+
return exit?.kind === "link" ? status2.links?.devices.find((device) => device.id === exit.id) : void 0;
|
|
12214
|
+
}
|
|
12215
|
+
function localExit(status2) {
|
|
12216
|
+
if (status2.exit?.kind === "link") return exitDevice(status2)?.mode === "local";
|
|
12217
|
+
return status2.route === "proxy";
|
|
12218
|
+
}
|
|
12182
12219
|
function automationOf(browser) {
|
|
12183
12220
|
return browser.via ?? "none";
|
|
12184
12221
|
}
|
|
12185
|
-
function browserLine(browser,
|
|
12222
|
+
function browserLine(browser, status2) {
|
|
12186
12223
|
const via = automationOf(browser);
|
|
12187
|
-
|
|
12188
|
-
|
|
12224
|
+
const local2 = localExit(status2);
|
|
12225
|
+
if (via === "none" && local2) return "slicc on this computer has no browser to control.";
|
|
12189
12226
|
if (via !== "link") return automation[via];
|
|
12190
|
-
const connected = (links?.devices ?? []).filter((device) => device.state === "connected");
|
|
12227
|
+
const connected = (status2.links?.devices ?? []).filter((device) => device.state === "connected");
|
|
12191
12228
|
const found = connected.flatMap(
|
|
12192
|
-
(device) => (device.browsers ?? []).map((item2) => ({ name: item2.name, device
|
|
12229
|
+
(device) => (device.browsers ?? []).map((item2) => ({ name: item2.name, device }))
|
|
12193
12230
|
);
|
|
12231
|
+
if (found.length === 1 && found[0].device.mode === "local") return automation.proxy;
|
|
12194
12232
|
if (found.length === 1)
|
|
12195
|
-
return `Browser automation: through ${found[0].name} on the linked device ${found[0].device}.`;
|
|
12233
|
+
return `Browser automation: through ${found[0].name} on the linked device ${found[0].device.name}.`;
|
|
12196
12234
|
if (found.length > 1)
|
|
12197
12235
|
return `Browser automation: through ${found.length} browsers on linked devices.`;
|
|
12198
|
-
return automation.link;
|
|
12236
|
+
return local2 ? automation.proxy : automation.link;
|
|
12199
12237
|
}
|
|
12200
12238
|
var tailnetStates = {
|
|
12201
12239
|
off: ["neutral", "Off"],
|
|
@@ -12206,7 +12244,8 @@ var tailnetStates = {
|
|
|
12206
12244
|
failed: ["negative", "Failed"]
|
|
12207
12245
|
};
|
|
12208
12246
|
var tailnetOnly = {
|
|
12209
|
-
proxy: "Tailnet hosts only. Everything else goes through slicc
|
|
12247
|
+
proxy: "Tailnet hosts only. Everything else goes through slicc on this computer.",
|
|
12248
|
+
link: "Tailnet hosts only. Everything else goes through a linked device.",
|
|
12210
12249
|
extension: "Tailnet hosts only. Everything else goes through the SLICC extension.",
|
|
12211
12250
|
tailnet: "Everything goes through your tailnet.",
|
|
12212
12251
|
page: "Tailnet hosts only. Everything else goes through this page\u2019s fetch.",
|
|
@@ -12215,6 +12254,13 @@ var tailnetOnly = {
|
|
|
12215
12254
|
function tailnetAddress(addresses) {
|
|
12216
12255
|
return addresses.find((address) => address.startsWith("100.")) ?? addresses[0];
|
|
12217
12256
|
}
|
|
12257
|
+
function tailnetLine(status2) {
|
|
12258
|
+
const route = routeOf(status2) ?? "none";
|
|
12259
|
+
if (route !== "link") return tailnetOnly[route];
|
|
12260
|
+
if (localExit(status2)) return tailnetOnly.proxy;
|
|
12261
|
+
const device = exitDevice(status2);
|
|
12262
|
+
return device ? `Tailnet hosts only. Everything else goes through ${device.name}.` : tailnetOnly.link;
|
|
12263
|
+
}
|
|
12218
12264
|
function exitNodeValue(tailnet) {
|
|
12219
12265
|
if (tailnet.autoExitNode) return "auto";
|
|
12220
12266
|
return tailnet.exitNodes?.find((node) => node.name === tailnet.exitNode)?.id ?? "none";
|
|
@@ -12360,14 +12406,15 @@ var wholeWeb = /* @__PURE__ */ new Set([
|
|
|
12360
12406
|
function routeOf(status2) {
|
|
12361
12407
|
return status2.exit?.kind === "link" ? "link" : status2.route;
|
|
12362
12408
|
}
|
|
12363
|
-
function linkLine(status2
|
|
12364
|
-
const device = status2
|
|
12409
|
+
function linkLine(status2) {
|
|
12410
|
+
const device = exitDevice(status2);
|
|
12365
12411
|
if (!device) return "Waiting for a linked device that isn\u2019t connected.";
|
|
12366
12412
|
if (device.state !== "connected") return `Waiting for the linked device ${device.name}.`;
|
|
12413
|
+
if (device.mode === "local") return routes.proxy;
|
|
12367
12414
|
return device.policy ? `Through the linked device ${device.name}, which reaches ${device.policy}.` : `Through the linked device ${device.name}.`;
|
|
12368
12415
|
}
|
|
12369
12416
|
function routeLine(status2) {
|
|
12370
|
-
if (status2.exit?.kind === "link") return linkLine(status2
|
|
12417
|
+
if (status2.exit?.kind === "link") return linkLine(status2);
|
|
12371
12418
|
const node = status2.route === "tailnet" ? status2.tailnet?.exitNode : null;
|
|
12372
12419
|
return node ? `Through the Tailscale exit node ${node}, which reaches every site.` : routes[status2.route ?? "none"];
|
|
12373
12420
|
}
|
|
@@ -12427,7 +12474,7 @@ var SliccNetwork = class extends ModelElement {
|
|
|
12427
12474
|
constructor() {
|
|
12428
12475
|
super();
|
|
12429
12476
|
this.checking = false;
|
|
12430
|
-
this.copied =
|
|
12477
|
+
this.copied = null;
|
|
12431
12478
|
this.uncopied = false;
|
|
12432
12479
|
this.error = "";
|
|
12433
12480
|
this.busy = "";
|
|
@@ -12794,9 +12841,9 @@ var SliccNetwork = class extends ModelElement {
|
|
|
12794
12841
|
this.checking = false;
|
|
12795
12842
|
}
|
|
12796
12843
|
}
|
|
12797
|
-
async copy() {
|
|
12798
|
-
const done2 = await copyText(
|
|
12799
|
-
this.copied = done2;
|
|
12844
|
+
async copy(text2 = command) {
|
|
12845
|
+
const done2 = await copyText(text2);
|
|
12846
|
+
this.copied = done2 ? text2 : null;
|
|
12800
12847
|
this.uncopied = !done2;
|
|
12801
12848
|
}
|
|
12802
12849
|
async #act(action, run2, area) {
|
|
@@ -12905,7 +12952,7 @@ var SliccNetwork = class extends ModelElement {
|
|
|
12905
12952
|
${tailnet.exitNodes.map((node) => b`<sp-menu-item value=${node.id} ?disabled=${!node.online}>${node.name}${node.online ? A : b`<span slot="description">Offline</span>`}</sp-menu-item>`)}
|
|
12906
12953
|
</sp-picker>
|
|
12907
12954
|
</div>` : A}
|
|
12908
|
-
<p data-exit=${tailnet.exitNode ? "node" : "none"}>${tailnet.exitNode ? `Internet through the exit node ${tailnet.exitNode}.` :
|
|
12955
|
+
<p data-exit=${tailnet.exitNode ? "node" : "none"}>${tailnet.exitNode ? `Internet through the exit node ${tailnet.exitNode}.` : tailnetLine(status2)}</p>`;
|
|
12909
12956
|
}
|
|
12910
12957
|
#exitLine(port, status2) {
|
|
12911
12958
|
const exit = status2.exit;
|
|
@@ -13165,7 +13212,7 @@ var SliccNetwork = class extends ModelElement {
|
|
|
13165
13212
|
<p data-route=${routeOf(status2) ?? "none"}>${routeLine(status2)}</p>
|
|
13166
13213
|
${status2.detail ? b`<p class="detail">${status2.detail}</p>` : A}
|
|
13167
13214
|
${this.#exitPicker(port, status2)}
|
|
13168
|
-
${status2.browser ? b`<p data-browser=${automationOf(status2.browser)}>${browserLine(status2.browser, status2
|
|
13215
|
+
${status2.browser ? b`<p data-browser=${automationOf(status2.browser)}>${browserLine(status2.browser, status2)}${status2.browser.detail ? b` <span class="detail">${status2.browser.detail}</span>` : A}</p>` : A}
|
|
13169
13216
|
${port.check ? b`<div class="actions"><swc-button size="m" variant="secondary" data-action="check" ?pending=${this.checking} @click=${() => this.check()}>Check again</swc-button></div>` : A}
|
|
13170
13217
|
${this.error ? b`<div class="error" role="alert"><swc-icon-alert-triangle size="s" aria-hidden="true"></swc-icon-alert-triangle><span>${this.error}</span></div>` : A}
|
|
13171
13218
|
</section>`;
|
|
@@ -13201,11 +13248,11 @@ var SliccNetwork = class extends ModelElement {
|
|
|
13201
13248
|
}
|
|
13202
13249
|
#ways(status2) {
|
|
13203
13250
|
return reach({
|
|
13204
|
-
intro: "Install the SLICC
|
|
13251
|
+
intro: "Install the SLICC extension, or run slicc on this computer. Either one reaches every site.",
|
|
13205
13252
|
extensionUrl: status2.extensionUrl,
|
|
13206
13253
|
copied: this.copied,
|
|
13207
13254
|
uncopied: this.uncopied,
|
|
13208
|
-
copy: () => this.copy()
|
|
13255
|
+
copy: (text2) => this.copy(text2)
|
|
13209
13256
|
});
|
|
13210
13257
|
}
|
|
13211
13258
|
#whole(status2) {
|
|
@@ -20303,7 +20350,7 @@ function list2(lines) {
|
|
|
20303
20350
|
return { type: "list", ordered: ordered2, items };
|
|
20304
20351
|
}
|
|
20305
20352
|
var starts = /^(```|#{1,4}\s|\s*\||>\s?|---\s*$)/;
|
|
20306
|
-
function
|
|
20353
|
+
function block2(lines, i26) {
|
|
20307
20354
|
const line = lines[i26];
|
|
20308
20355
|
if (line.startsWith("```")) return fence(lines, i26);
|
|
20309
20356
|
const heading = line.match(/^(#{1,4})\s+(.*)$/);
|
|
@@ -20341,7 +20388,7 @@ function parse2(text2) {
|
|
|
20341
20388
|
const blocks = [];
|
|
20342
20389
|
let i26 = 0;
|
|
20343
20390
|
while (i26 < lines.length) {
|
|
20344
|
-
const [next, end] =
|
|
20391
|
+
const [next, end] = block2(lines, i26);
|
|
20345
20392
|
if (next) blocks.push(next);
|
|
20346
20393
|
i26 = end;
|
|
20347
20394
|
}
|
|
@@ -24548,7 +24595,7 @@ var SliccBrowser = class extends ModelElement {
|
|
|
24548
24595
|
this.requestUpdate();
|
|
24549
24596
|
}
|
|
24550
24597
|
async #copyCommand(text2) {
|
|
24551
|
-
this.#command = await copyText(text2);
|
|
24598
|
+
this.#command = await copyText(text2) && text2;
|
|
24552
24599
|
this.requestUpdate();
|
|
24553
24600
|
}
|
|
24554
24601
|
#who(tab) {
|
|
@@ -24700,11 +24747,11 @@ var SliccBrowser = class extends ModelElement {
|
|
|
24700
24747
|
<span slot="description">Agents can’t open or use browser tabs yet.</span>
|
|
24701
24748
|
</swc-illustrated-message>
|
|
24702
24749
|
<div class="reach">${reach({
|
|
24703
|
-
intro: "Install the SLICC
|
|
24750
|
+
intro: "Install the SLICC extension, or run slicc on this computer.",
|
|
24704
24751
|
extensionUrl: status2?.extensionUrl,
|
|
24705
|
-
copied: this.#command
|
|
24752
|
+
copied: this.#command || null,
|
|
24706
24753
|
uncopied: this.#command === false,
|
|
24707
|
-
copy: () => this.#copyCommand(
|
|
24754
|
+
copy: (text2) => this.#copyCommand(text2)
|
|
24708
24755
|
})}</div>
|
|
24709
24756
|
</div></div>`;
|
|
24710
24757
|
}
|
|
@@ -24958,7 +25005,8 @@ var SliccChanges = class extends ModelElement {
|
|
|
24958
25005
|
background: var(--swc-background-layer-1-color);
|
|
24959
25006
|
}
|
|
24960
25007
|
code {
|
|
24961
|
-
overflow-wrap:
|
|
25008
|
+
overflow-wrap: break-word;
|
|
25009
|
+
word-break: normal;
|
|
24962
25010
|
font-family: var(--swc-code-font-family-stack);
|
|
24963
25011
|
font-size: var(--swc-font-size-75);
|
|
24964
25012
|
color: var(--swc-code-color);
|
|
@@ -25160,7 +25208,7 @@ var SliccChanges = class extends ModelElement {
|
|
|
25160
25208
|
<p data-unavailable>${parts2.map((part2) => typeof part2 === "string" ? part2 : b`<code>${part2.code}</code>`)}</p>
|
|
25161
25209
|
${codes.map(
|
|
25162
25210
|
(code2) => b`<div class="command" data-command=${code2}>
|
|
25163
|
-
<code>${code2}</code>
|
|
25211
|
+
<code>${breakable(code2)}</code>
|
|
25164
25212
|
<swc-action-button size="s" quiet data-action="copy-command" accessible-label=${this.copied === code2 ? "Copied" : `Copy ${code2}`} @click=${() => this.copy(code2)}>
|
|
25165
25213
|
<swc-icon-copy slot="icon"></swc-icon-copy>${this.copied === code2 ? "Copied" : "Copy"}
|
|
25166
25214
|
</swc-action-button>
|
|
@@ -30564,12 +30612,7 @@ var SliccSettings = class extends ThemedElement {
|
|
|
30564
30612
|
(secret) => secret.kind === "mcp" && secret.server === server && secret.state !== "removed"
|
|
30565
30613
|
).map((secret) => secret.name);
|
|
30566
30614
|
const tokens = names.length ? names : [`${upper(server)}_ACCESS_TOKEN`];
|
|
30567
|
-
return tokens.
|
|
30568
|
-
(name) => [
|
|
30569
|
-
[name, "mcp"],
|
|
30570
|
-
[`${name}_GRANT`, "grant"]
|
|
30571
|
-
]
|
|
30572
|
-
);
|
|
30615
|
+
return tokens.map((name) => [name, "mcp"]);
|
|
30573
30616
|
}
|
|
30574
30617
|
async #disconnect(account) {
|
|
30575
30618
|
const model = this.model;
|
|
@@ -50014,13 +50057,13 @@ function realignChangeContentBySimilarity(diff) {
|
|
|
50014
50057
|
function slideBlankBoundaryBlocksUp(hunk, diff, resolveSlide) {
|
|
50015
50058
|
const { hunkContent } = hunk;
|
|
50016
50059
|
for (let index = 1; index < hunkContent.length; index++) {
|
|
50017
|
-
const
|
|
50060
|
+
const block3 = hunkContent[index];
|
|
50018
50061
|
const previous = hunkContent[index - 1];
|
|
50019
|
-
if (
|
|
50020
|
-
const isInsert =
|
|
50062
|
+
if (block3.type !== "change" || block3.additions > 0 && block3.deletions > 0 || previous.type !== "context") continue;
|
|
50063
|
+
const isInsert = block3.additions > 0;
|
|
50021
50064
|
const lines = isInsert ? diff.additionLines : diff.deletionLines;
|
|
50022
|
-
const blockStart = isInsert ?
|
|
50023
|
-
const blockLength = isInsert ?
|
|
50065
|
+
const blockStart = isInsert ? block3.additionLineIndex : block3.deletionLineIndex;
|
|
50066
|
+
const blockLength = isInsert ? block3.additions : block3.deletions;
|
|
50024
50067
|
const unit = lines[blockStart] ?? "";
|
|
50025
50068
|
if (unit.trim() !== "") continue;
|
|
50026
50069
|
let uniform = true;
|
|
@@ -50034,13 +50077,13 @@ function slideBlankBoundaryBlocksUp(hunk, diff, resolveSlide) {
|
|
|
50034
50077
|
if (slide === 0) continue;
|
|
50035
50078
|
if (index === 1 && slide === previous.lines) continue;
|
|
50036
50079
|
if (resolveSlide != null) {
|
|
50037
|
-
slide = resolveSlide(
|
|
50080
|
+
slide = resolveSlide(block3, slide);
|
|
50038
50081
|
if (slide === 0) continue;
|
|
50039
50082
|
}
|
|
50040
|
-
|
|
50041
|
-
|
|
50042
|
-
const blockAdditionEnd =
|
|
50043
|
-
const blockDeletionEnd =
|
|
50083
|
+
block3.additionLineIndex -= slide;
|
|
50084
|
+
block3.deletionLineIndex -= slide;
|
|
50085
|
+
const blockAdditionEnd = block3.additionLineIndex + block3.additions;
|
|
50086
|
+
const blockDeletionEnd = block3.deletionLineIndex + block3.deletions;
|
|
50044
50087
|
const next = hunkContent[index + 1];
|
|
50045
50088
|
if (next?.type === "context") {
|
|
50046
50089
|
next.lines += slide;
|
|
@@ -52893,13 +52936,13 @@ function parseSessionChangeBlocks(diff, parseDiffOptions, getPreviousAdditionLin
|
|
|
52893
52936
|
lang: diff.lang
|
|
52894
52937
|
}, parseDiffOptions);
|
|
52895
52938
|
let previousBlocks;
|
|
52896
|
-
const resolveSlide = (
|
|
52939
|
+
const resolveSlide = (block3, maxSlide) => {
|
|
52897
52940
|
previousBlocks ??= collectPureChangeBlocks(diff.hunks);
|
|
52898
52941
|
for (let offset3 = 0; offset3 <= maxSlide; offset3++) {
|
|
52899
|
-
const previous = previousBlocks.get(
|
|
52900
|
-
if (previous == null || previous.additions !==
|
|
52901
|
-
if (
|
|
52902
|
-
for (let line = 0; line <
|
|
52942
|
+
const previous = previousBlocks.get(block3.deletionLineIndex - offset3);
|
|
52943
|
+
if (previous == null || previous.additions !== block3.additions || previous.deletions !== block3.deletions) continue;
|
|
52944
|
+
if (block3.additions > 0 && getPreviousAdditionLine != null) {
|
|
52945
|
+
for (let line = 0; line < block3.additions; line++) if (getPreviousAdditionLine(previous.additionLineIndex + line) !== parsed.additionLines[block3.additionLineIndex + line]) return maxSlide;
|
|
52903
52946
|
}
|
|
52904
52947
|
return offset3;
|
|
52905
52948
|
}
|
|
@@ -52919,12 +52962,12 @@ function parseSessionChangeBlocks(diff, parseDiffOptions, getPreviousAdditionLin
|
|
|
52919
52962
|
coveredDeletions += content.lines;
|
|
52920
52963
|
continue;
|
|
52921
52964
|
}
|
|
52922
|
-
const
|
|
52923
|
-
if (
|
|
52924
|
-
if (
|
|
52925
|
-
blocks.push(
|
|
52926
|
-
coveredAdditions +=
|
|
52927
|
-
coveredDeletions +=
|
|
52965
|
+
const block3 = offsetHunkContent(content, 0, 0);
|
|
52966
|
+
if (block3.additions === 0) block3.additionLineIndex = coveredAdditions;
|
|
52967
|
+
if (block3.deletions === 0) block3.deletionLineIndex = coveredDeletions;
|
|
52968
|
+
blocks.push(block3);
|
|
52969
|
+
coveredAdditions += block3.additions;
|
|
52970
|
+
coveredDeletions += block3.deletions;
|
|
52928
52971
|
}
|
|
52929
52972
|
}
|
|
52930
52973
|
return blocks;
|
|
@@ -52949,9 +52992,9 @@ function buildRegionPlans(previousHunks, blocks, deletionLineCount) {
|
|
|
52949
52992
|
});
|
|
52950
52993
|
const plans = [];
|
|
52951
52994
|
let previousIndex = 0;
|
|
52952
|
-
for (const
|
|
52953
|
-
const blockStart =
|
|
52954
|
-
const blockEnd = blockStart +
|
|
52995
|
+
for (const block3 of blocks) {
|
|
52996
|
+
const blockStart = block3.deletionLineIndex;
|
|
52997
|
+
const blockEnd = blockStart + block3.deletions;
|
|
52955
52998
|
while (previousIndex < previousPlans.length && previousPlans[previousIndex].deletionEnd < blockStart) {
|
|
52956
52999
|
plans.push(previousPlans[previousIndex]);
|
|
52957
53000
|
previousIndex++;
|
|
@@ -52964,7 +53007,7 @@ function buildRegionPlans(previousHunks, blocks, deletionLineCount) {
|
|
|
52964
53007
|
if (plan == null) {
|
|
52965
53008
|
let deletionStart = blockStart;
|
|
52966
53009
|
let deletionEnd = blockEnd;
|
|
52967
|
-
if ((
|
|
53010
|
+
if ((block3.deletions === 0 || block3.additions === 0) && deletionLineCount > block3.deletions) {
|
|
52968
53011
|
const previousEnd = plans[plans.length - 1]?.deletionEnd ?? 0;
|
|
52969
53012
|
const nextStart = previousPlans[previousIndex]?.deletionStart ?? deletionLineCount;
|
|
52970
53013
|
if (blockStart > previousEnd) deletionStart--;
|
|
@@ -52979,7 +53022,7 @@ function buildRegionPlans(previousHunks, blocks, deletionLineCount) {
|
|
|
52979
53022
|
}
|
|
52980
53023
|
plan.deletionStart = Math.min(plan.deletionStart, blockStart);
|
|
52981
53024
|
plan.deletionEnd = Math.max(plan.deletionEnd, blockEnd);
|
|
52982
|
-
plan.blocks.push(
|
|
53025
|
+
plan.blocks.push(block3);
|
|
52983
53026
|
plans.push(plan);
|
|
52984
53027
|
}
|
|
52985
53028
|
while (previousIndex < previousPlans.length) {
|