@ai-ecoverse/slicc-spectrum 1.98.1 → 1.99.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 +11 -2
- package/dist/slicc-dummy.js +35 -1
- package/dist/slicc-dummy.js.map +2 -2
- package/dist/slicc-ui.js +203 -70
- package/dist/slicc-ui.js.map +3 -3
- package/dist/types/app/composer.d.ts +1 -0
- package/dist/types/dummy/updates.d.ts +1 -1
- package/dist/types/model/types.d.ts +7 -0
- package/package.json +3 -3
package/dist/slicc-ui.js
CHANGED
|
@@ -14119,7 +14119,7 @@ function createTokenizer(parser, initialize, from) {
|
|
|
14119
14119
|
previous: null,
|
|
14120
14120
|
sliceSerialize,
|
|
14121
14121
|
sliceStream,
|
|
14122
|
-
write
|
|
14122
|
+
write: write2
|
|
14123
14123
|
};
|
|
14124
14124
|
let state2 = initialize.tokenize.call(context, effects);
|
|
14125
14125
|
let expectedCode;
|
|
@@ -14127,7 +14127,7 @@ function createTokenizer(parser, initialize, from) {
|
|
|
14127
14127
|
resolveAllConstructs.push(initialize);
|
|
14128
14128
|
}
|
|
14129
14129
|
return context;
|
|
14130
|
-
function
|
|
14130
|
+
function write2(slice) {
|
|
14131
14131
|
chunks = push(chunks, slice);
|
|
14132
14132
|
main2();
|
|
14133
14133
|
if (chunks[chunks.length - 1] !== null) {
|
|
@@ -14324,9 +14324,9 @@ function createTokenizer(parser, initialize, from) {
|
|
|
14324
14324
|
const startStack = Array.from(stack);
|
|
14325
14325
|
return {
|
|
14326
14326
|
from: startEventsIndex,
|
|
14327
|
-
restore
|
|
14327
|
+
restore: restore2
|
|
14328
14328
|
};
|
|
14329
|
-
function
|
|
14329
|
+
function restore2() {
|
|
14330
14330
|
point3 = startPoint;
|
|
14331
14331
|
context.previous = startPrevious;
|
|
14332
14332
|
context.currentConstruct = startCurrentConstruct;
|
|
@@ -16998,13 +16998,13 @@ function parse2(text5) {
|
|
|
16998
16998
|
(node2) => text5.lastIndexOf("\n", tail2 + node2.position.start.offset - 1) + 1
|
|
16999
16999
|
)
|
|
17000
17000
|
];
|
|
17001
|
-
let
|
|
17002
|
-
while (
|
|
17001
|
+
let keep3 = Math.max(blocks.length - 1, 0);
|
|
17002
|
+
while (keep3 > 0 && !blankBefore(text5, starts[keep3])) keep3--;
|
|
17003
17003
|
const parsed = {
|
|
17004
17004
|
text: text5,
|
|
17005
17005
|
blocks,
|
|
17006
17006
|
starts,
|
|
17007
|
-
keep:
|
|
17007
|
+
keep: keep3,
|
|
17008
17008
|
definitions: collect(tree.children, /* @__PURE__ */ new Map())
|
|
17009
17009
|
};
|
|
17010
17010
|
cache.delete(base.text);
|
|
@@ -38724,14 +38724,14 @@ var KeptSession = class {
|
|
|
38724
38724
|
sink.exit(this.#status);
|
|
38725
38725
|
return Promise.resolve(ended2);
|
|
38726
38726
|
}
|
|
38727
|
-
const
|
|
38727
|
+
const session2 = this.#session !== null ? this.#session.then((live) => {
|
|
38728
38728
|
live.resize(size4.cols, size4.rows);
|
|
38729
38729
|
return live;
|
|
38730
38730
|
}) : this.#start(size4);
|
|
38731
|
-
return
|
|
38731
|
+
return session2.then((live) => this.#handle(live, sink));
|
|
38732
38732
|
}
|
|
38733
|
-
replay(
|
|
38734
|
-
for (const chunk of this.#log)
|
|
38733
|
+
replay(write2) {
|
|
38734
|
+
for (const chunk of this.#log) write2(chunk);
|
|
38735
38735
|
}
|
|
38736
38736
|
dispose() {
|
|
38737
38737
|
this.#sink = null;
|
|
@@ -38754,12 +38754,12 @@ var KeptSession = class {
|
|
|
38754
38754
|
this.#sink?.exit(status2);
|
|
38755
38755
|
}
|
|
38756
38756
|
};
|
|
38757
|
-
const
|
|
38758
|
-
this.#session =
|
|
38759
|
-
|
|
38760
|
-
if (this.#session ===
|
|
38757
|
+
const session2 = Promise.resolve().then(() => this.#backend().open(relay, size4));
|
|
38758
|
+
this.#session = session2;
|
|
38759
|
+
session2.catch(() => {
|
|
38760
|
+
if (this.#session === session2) this.#session = null;
|
|
38761
38761
|
});
|
|
38762
|
-
return
|
|
38762
|
+
return session2;
|
|
38763
38763
|
}
|
|
38764
38764
|
#record(data) {
|
|
38765
38765
|
this.#log.push(data.slice());
|
|
@@ -38788,9 +38788,9 @@ function sessions(port) {
|
|
|
38788
38788
|
kept.set(port, fresh2);
|
|
38789
38789
|
port.on("terminals", (terminals) => {
|
|
38790
38790
|
const live = new Set(terminals.map((terminal) => terminal.id));
|
|
38791
|
-
for (const [id,
|
|
38791
|
+
for (const [id, session2] of fresh2) {
|
|
38792
38792
|
if (live.has(id)) continue;
|
|
38793
|
-
|
|
38793
|
+
session2.dispose();
|
|
38794
38794
|
fresh2.delete(id);
|
|
38795
38795
|
}
|
|
38796
38796
|
});
|
|
@@ -38798,12 +38798,12 @@ function sessions(port) {
|
|
|
38798
38798
|
}
|
|
38799
38799
|
function keep(port, id) {
|
|
38800
38800
|
const map = sessions(port);
|
|
38801
|
-
let
|
|
38802
|
-
if (!
|
|
38803
|
-
|
|
38804
|
-
map.set(id,
|
|
38801
|
+
let session2 = map.get(id);
|
|
38802
|
+
if (!session2) {
|
|
38803
|
+
session2 = new KeptSession(() => port.backend(id));
|
|
38804
|
+
map.set(id, session2);
|
|
38805
38805
|
}
|
|
38806
|
-
return
|
|
38806
|
+
return session2;
|
|
38807
38807
|
}
|
|
38808
38808
|
var SliccTerminalPanel = class extends ThemedElement {
|
|
38809
38809
|
static properties = { ...ThemedElement.properties, terminal: {} };
|
|
@@ -38899,9 +38899,9 @@ var SliccTerminalPanel = class extends ThemedElement {
|
|
|
38899
38899
|
const hidden = await this.#placed(info.id, terminal);
|
|
38900
38900
|
terminal.fit();
|
|
38901
38901
|
const cols = terminal.cols;
|
|
38902
|
-
const
|
|
38902
|
+
const session2 = await backend.open(sink, { cols, rows: terminal.rows });
|
|
38903
38903
|
if (hidden) void this.#relayout(terminal, backend, cols);
|
|
38904
|
-
return
|
|
38904
|
+
return session2;
|
|
38905
38905
|
}
|
|
38906
38906
|
};
|
|
38907
38907
|
terminal.addEventListener("exit", () => model.terminals.close(info.id));
|
|
@@ -41843,6 +41843,32 @@ function pinVersion(item2, pin) {
|
|
|
41843
41843
|
if (pin.base === null) return [pin.range === version2 ? version2 : `${pin.range} \u2192 ${version2}`];
|
|
41844
41844
|
return [version2, pin.base === version2 ? "the version seven ships" : `seven ships ${pin.base}`];
|
|
41845
41845
|
}
|
|
41846
|
+
function placed(item2) {
|
|
41847
|
+
const installs = item2.installs ?? [];
|
|
41848
|
+
if (!installs.length) return item2;
|
|
41849
|
+
const version2 = item2.version ?? installs[0].version;
|
|
41850
|
+
const newer = item2.offered !== null && item2.offered !== version2;
|
|
41851
|
+
const state2 = item2.state === "available" ? newer ? "outdated" : "installed" : item2.state;
|
|
41852
|
+
const owned = installs.some((install) => install.manager === "panel");
|
|
41853
|
+
const hidden = new Set(owned ? ["install"] : ["install", "remove"]);
|
|
41854
|
+
return { ...item2, version: version2, state: state2, actions: item2.actions.filter((action) => !hidden.has(action)) };
|
|
41855
|
+
}
|
|
41856
|
+
var elsewhere = (item2) => (item2.installs ?? []).filter((install) => install.manager !== "panel");
|
|
41857
|
+
function installText(install, version2) {
|
|
41858
|
+
const place3 = install.user ? `for ${install.user}` : `in ${install.where}`;
|
|
41859
|
+
const via = install.manager === "pnpm" ? ", via pnpm" : "";
|
|
41860
|
+
return `${install.version === version2 ? "" : `${install.version} `}${place3}${via}`;
|
|
41861
|
+
}
|
|
41862
|
+
function managedText(item2) {
|
|
41863
|
+
const others = elsewhere(item2);
|
|
41864
|
+
if (!others.length || others.length !== item2.installs?.length) return null;
|
|
41865
|
+
return others.every((install) => install.manager === "pnpm") ? b`Managed by pnpm. Remove it with <code>pnpm remove -g ${item2.package}</code>.` : "Installed outside this panel. Remove it where it was installed.";
|
|
41866
|
+
}
|
|
41867
|
+
var shared2 = (item2) => elsewhere(item2).length > 0 && elsewhere(item2).length !== item2.installs?.length;
|
|
41868
|
+
function actionLabel2(item2, action) {
|
|
41869
|
+
if (action === "remove" && shared2(item2)) return `Remove the panel\u2019s copy of ${item2.label}`;
|
|
41870
|
+
return `${packageActions[action]} ${item2.label}`;
|
|
41871
|
+
}
|
|
41846
41872
|
var packageRunning = /* @__PURE__ */ new Set(["installing", "updating", "removing"]);
|
|
41847
41873
|
var list4 = (names) => new Intl.ListFormat("en", { type: "conjunction" }).format(names);
|
|
41848
41874
|
function requiresText(item2, all3) {
|
|
@@ -42101,6 +42127,10 @@ var SliccUpdates = class extends ModelElement {
|
|
|
42101
42127
|
line-height: var(--swc-line-height-200);
|
|
42102
42128
|
overflow-wrap: anywhere;
|
|
42103
42129
|
}
|
|
42130
|
+
[data-managed] code {
|
|
42131
|
+
display: inline-block;
|
|
42132
|
+
max-width: 100%;
|
|
42133
|
+
}
|
|
42104
42134
|
.warnings {
|
|
42105
42135
|
display: flex;
|
|
42106
42136
|
flex-direction: column;
|
|
@@ -42334,6 +42364,8 @@ var SliccUpdates = class extends ModelElement {
|
|
|
42334
42364
|
const requires = requiresText(item2, all3);
|
|
42335
42365
|
return b`<p class="meta">
|
|
42336
42366
|
${version2 ? b`<span class="version">${version2}</span>` : A}
|
|
42367
|
+
${shared2(item2) ? b`<span data-install="panel">the panel’s copy</span>` : A}
|
|
42368
|
+
${elsewhere(item2).map((install) => b`<span data-install>${installText(install, item2.version)}</span>`)}
|
|
42337
42369
|
${download2 ? b`<span>${size3(item2.size)}</span>` : A}
|
|
42338
42370
|
${requires ? b`<span data-requires>${requires}</span>` : A}
|
|
42339
42371
|
</p>`;
|
|
@@ -42354,6 +42386,7 @@ var SliccUpdates = class extends ModelElement {
|
|
|
42354
42386
|
const busy = this.busy.get(item2.id);
|
|
42355
42387
|
const shown4 = busy ? [busy] : act2 ? item2.actions : [];
|
|
42356
42388
|
const error = this.problems.get(item2.id) ?? item2.error;
|
|
42389
|
+
const managed = managedText(item2);
|
|
42357
42390
|
return b`<li data-id=${item2.id} data-state=${item2.state}>
|
|
42358
42391
|
<div class="name">
|
|
42359
42392
|
<h3 title=${item2.package}>${item2.label}</h3>
|
|
@@ -42364,14 +42397,14 @@ var SliccUpdates = class extends ModelElement {
|
|
|
42364
42397
|
size="s"
|
|
42365
42398
|
variant="secondary"
|
|
42366
42399
|
data-action=${action}
|
|
42367
|
-
accessible-label=${
|
|
42400
|
+
accessible-label=${actionLabel2(item2, action)}
|
|
42368
42401
|
?pending=${busy === action}
|
|
42369
42402
|
@click=${() => void this.actPackage(item2.id, action)}
|
|
42370
42403
|
>${packageActions[action]}</swc-button>`
|
|
42371
42404
|
)}</div>
|
|
42372
42405
|
<p class="description">${item2.description}</p>
|
|
42373
42406
|
${this.#packageMeta(item2, all3)}
|
|
42374
|
-
${item2.notes?.length ? b`<p class="notes" data-notes>${item2.notes.map((note) => b`<span>${note}</span>`)}</p>` : A}
|
|
42407
|
+
${item2.notes?.length || managed ? b`<p class="notes" data-notes>${(item2.notes ?? []).map((note) => b`<span>${note}</span>`)}${managed ? b`<span data-managed>${managed}</span>` : A}</p>` : A}
|
|
42375
42408
|
${item2.warnings?.length ? b`<p class="warnings" data-warnings>${item2.warnings.map(
|
|
42376
42409
|
(warning) => b`<span><swc-icon-alert-triangle size="s" aria-hidden="true"></swc-icon-alert-triangle>${warning}</span>`
|
|
42377
42410
|
)}</p>` : A}
|
|
@@ -42395,7 +42428,7 @@ var SliccUpdates = class extends ModelElement {
|
|
|
42395
42428
|
}
|
|
42396
42429
|
#packages(port) {
|
|
42397
42430
|
if (!port?.packages) return A;
|
|
42398
|
-
const all3 = port.packages();
|
|
42431
|
+
const all3 = port.packages().map(placed);
|
|
42399
42432
|
const offered = all3.filter((item2) => item2.origin !== "user");
|
|
42400
42433
|
const yours = all3.filter((item2) => item2.origin === "user");
|
|
42401
42434
|
return b`<section data-section="packages" aria-labelledby="packages">
|
|
@@ -42470,7 +42503,7 @@ function lockOverscroll(document4) {
|
|
|
42470
42503
|
})
|
|
42471
42504
|
);
|
|
42472
42505
|
lock.restore = () => {
|
|
42473
|
-
for (const
|
|
42506
|
+
for (const restore2 of saved) restore2();
|
|
42474
42507
|
};
|
|
42475
42508
|
}
|
|
42476
42509
|
lock.count += 1;
|
|
@@ -46948,6 +46981,73 @@ var SliccVaultButton = class extends i2 {
|
|
|
46948
46981
|
|
|
46949
46982
|
// src/app/composer.ts
|
|
46950
46983
|
var limit = 25 * 1024 * 1024;
|
|
46984
|
+
var startingKey = "slicc-spectrum.starting";
|
|
46985
|
+
function session() {
|
|
46986
|
+
try {
|
|
46987
|
+
return globalThis.sessionStorage ?? null;
|
|
46988
|
+
} catch {
|
|
46989
|
+
return null;
|
|
46990
|
+
}
|
|
46991
|
+
}
|
|
46992
|
+
function stored() {
|
|
46993
|
+
try {
|
|
46994
|
+
const rows2 = JSON.parse(session()?.getItem(startingKey) ?? "[]");
|
|
46995
|
+
return Array.isArray(rows2) ? rows2 : [];
|
|
46996
|
+
} catch {
|
|
46997
|
+
return [];
|
|
46998
|
+
}
|
|
46999
|
+
}
|
|
47000
|
+
function write(rows2) {
|
|
47001
|
+
try {
|
|
47002
|
+
if (rows2.length) session()?.setItem(startingKey, JSON.stringify(rows2));
|
|
47003
|
+
else session()?.removeItem(startingKey);
|
|
47004
|
+
} catch {
|
|
47005
|
+
return;
|
|
47006
|
+
}
|
|
47007
|
+
}
|
|
47008
|
+
function reloaded() {
|
|
47009
|
+
const [entry] = globalThis.performance?.getEntriesByType?.("navigation") ?? [];
|
|
47010
|
+
return entry?.type === "reload";
|
|
47011
|
+
}
|
|
47012
|
+
var claimed = null;
|
|
47013
|
+
function restore(owned) {
|
|
47014
|
+
if (!claimed) {
|
|
47015
|
+
claimed = /* @__PURE__ */ new Set();
|
|
47016
|
+
if (!reloaded()) write([]);
|
|
47017
|
+
}
|
|
47018
|
+
const taken = claimed;
|
|
47019
|
+
const fresh2 = stored().filter((row) => !taken.has(row.id));
|
|
47020
|
+
for (const row of fresh2) {
|
|
47021
|
+
taken.add(row.id);
|
|
47022
|
+
owned.add(row.id);
|
|
47023
|
+
}
|
|
47024
|
+
return fresh2.map(({ id, text: text5, mode: mode2, attachments, lost: lost2 = [] }) => ({
|
|
47025
|
+
id,
|
|
47026
|
+
text: text5,
|
|
47027
|
+
mode: mode2,
|
|
47028
|
+
attachments: [],
|
|
47029
|
+
lost: [...lost2, ...attachments]
|
|
47030
|
+
}));
|
|
47031
|
+
}
|
|
47032
|
+
function keep2(owned, rows2) {
|
|
47033
|
+
const meta = ({ name, mimeType, size: size4 }) => ({ name, mimeType, size: size4 });
|
|
47034
|
+
const others = stored().filter((row) => !owned.has(row.id));
|
|
47035
|
+
owned.clear();
|
|
47036
|
+
for (const row of rows2) {
|
|
47037
|
+
owned.add(row.id);
|
|
47038
|
+
claimed?.add(row.id);
|
|
47039
|
+
}
|
|
47040
|
+
write([
|
|
47041
|
+
...others,
|
|
47042
|
+
...rows2.map((row) => ({
|
|
47043
|
+
id: row.id,
|
|
47044
|
+
text: row.text,
|
|
47045
|
+
mode: row.mode,
|
|
47046
|
+
attachments: row.attachments.map(meta),
|
|
47047
|
+
lost: (row.lost ?? []).map(meta)
|
|
47048
|
+
}))
|
|
47049
|
+
]);
|
|
47050
|
+
}
|
|
46951
47051
|
var pages = /* @__PURE__ */ new WeakMap();
|
|
46952
47052
|
function owner(node2) {
|
|
46953
47053
|
let at = node2;
|
|
@@ -46967,7 +47067,10 @@ var PageQueue = class {
|
|
|
46967
47067
|
#page() {
|
|
46968
47068
|
this.#owner ??= this.#host.isConnected ? owner(this.#host) : null;
|
|
46969
47069
|
const page = this.#owner ?? this.#host.ownerDocument;
|
|
46970
|
-
const
|
|
47070
|
+
const known = pages.get(page);
|
|
47071
|
+
if (known) return known;
|
|
47072
|
+
const owned = /* @__PURE__ */ new Set();
|
|
47073
|
+
const found = { rows: restore(owned), owned, draft: null, hosts: /* @__PURE__ */ new Set() };
|
|
46971
47074
|
pages.set(page, found);
|
|
46972
47075
|
return found;
|
|
46973
47076
|
}
|
|
@@ -46977,6 +47080,7 @@ var PageQueue = class {
|
|
|
46977
47080
|
set value(rows2) {
|
|
46978
47081
|
const page = this.#page();
|
|
46979
47082
|
page.rows = rows2;
|
|
47083
|
+
keep2(page.owned, rows2);
|
|
46980
47084
|
for (const host4 of [...page.hosts]) host4.requestUpdate();
|
|
46981
47085
|
}
|
|
46982
47086
|
get draft() {
|
|
@@ -47277,6 +47381,27 @@ var SliccComposer = class extends ThemedElement {
|
|
|
47277
47381
|
font-size: var(--swc-font-size-75);
|
|
47278
47382
|
color: var(--swc-neutral-subdued-content-color-default);
|
|
47279
47383
|
}
|
|
47384
|
+
.queued .body {
|
|
47385
|
+
flex: 1;
|
|
47386
|
+
min-inline-size: 0;
|
|
47387
|
+
display: grid;
|
|
47388
|
+
}
|
|
47389
|
+
.queued > swc-icon-alert-triangle {
|
|
47390
|
+
flex: none;
|
|
47391
|
+
--swc-icon-color: var(--swc-notice-visual-color);
|
|
47392
|
+
}
|
|
47393
|
+
.queued [data-lost] swc-icon-alert-triangle {
|
|
47394
|
+
vertical-align: middle;
|
|
47395
|
+
margin-inline-end: var(--swc-spacing-50);
|
|
47396
|
+
--swc-icon-color: var(--swc-notice-visual-color);
|
|
47397
|
+
}
|
|
47398
|
+
.queued [data-lost] {
|
|
47399
|
+
overflow: hidden;
|
|
47400
|
+
text-overflow: ellipsis;
|
|
47401
|
+
white-space: nowrap;
|
|
47402
|
+
font-size: var(--swc-font-size-75);
|
|
47403
|
+
color: var(--swc-neutral-subdued-content-color-default);
|
|
47404
|
+
}
|
|
47280
47405
|
.queued [data-files] {
|
|
47281
47406
|
display: inline-flex;
|
|
47282
47407
|
align-items: center;
|
|
@@ -47530,8 +47655,10 @@ var SliccComposer = class extends ThemedElement {
|
|
|
47530
47655
|
if (!(model && waiting3.length && agents.length) || this.#starting()) return;
|
|
47531
47656
|
const active = model.agent.active();
|
|
47532
47657
|
const id = agents.some((agent) => agent.id === active) ? active : agents[0].id;
|
|
47533
|
-
|
|
47534
|
-
const [first2, ...rest] = waiting3;
|
|
47658
|
+
const sendable = (row) => !!(row.text || row.attachments.length);
|
|
47659
|
+
const [first2, ...rest] = waiting3.filter(sendable);
|
|
47660
|
+
if (!first2) return;
|
|
47661
|
+
this.#waiting.value = waiting3.filter((row) => !sendable(row));
|
|
47535
47662
|
this.#deliver(model, id, first2, "queue");
|
|
47536
47663
|
for (const { text: text5, attachments } of rest)
|
|
47537
47664
|
this.#post(model, id, { text: text5, attachments, mode: "queue" });
|
|
@@ -47548,9 +47675,9 @@ var SliccComposer = class extends ThemedElement {
|
|
|
47548
47675
|
#switch(id) {
|
|
47549
47676
|
if (this.#agent)
|
|
47550
47677
|
this.#drafts.set(this.#agent, { value: this.value, attachments: this.attachments });
|
|
47551
|
-
const
|
|
47552
|
-
if (
|
|
47553
|
-
const draft2 = this.#drafts.get(id) ??
|
|
47678
|
+
const shared3 = this.#agent || !this.isConnected ? null : this.#waiting.draft;
|
|
47679
|
+
if (shared3 && id && !this.#drafts.has(id)) this.#waiting.draft = null;
|
|
47680
|
+
const draft2 = this.#drafts.get(id) ?? shared3 ?? void 0;
|
|
47554
47681
|
this.#agent = id;
|
|
47555
47682
|
this.value = draft2?.value ?? "";
|
|
47556
47683
|
this.attachments = draft2?.attachments ?? [];
|
|
@@ -47591,7 +47718,7 @@ var SliccComposer = class extends ThemedElement {
|
|
|
47591
47718
|
this.popup = null;
|
|
47592
47719
|
this.#history = -1;
|
|
47593
47720
|
if (this.#starting()) {
|
|
47594
|
-
this.#waiting.value = [...this.#waiting.value, { id: this.#id(), text: text5, attachments }];
|
|
47721
|
+
this.#waiting.value = [...this.#waiting.value, { id: this.#id(), text: text5, mode: mode2, attachments }];
|
|
47595
47722
|
return;
|
|
47596
47723
|
}
|
|
47597
47724
|
if (known) {
|
|
@@ -48135,17 +48262,23 @@ ${this.value}` : text5;
|
|
|
48135
48262
|
#starters() {
|
|
48136
48263
|
const waiting3 = this.#waiting.value;
|
|
48137
48264
|
if (waiting3.length === 0) return A;
|
|
48265
|
+
const names = (files) => files.map((file) => file.name).join(", ");
|
|
48138
48266
|
return b`<ul class="queue" aria-label="Waiting for the agent">
|
|
48139
|
-
${waiting3.map(
|
|
48140
|
-
|
|
48141
|
-
|
|
48267
|
+
${waiting3.map((message) => {
|
|
48268
|
+
const lost2 = message.lost ?? [];
|
|
48269
|
+
const empty5 = !(message.text || message.attachments.length);
|
|
48270
|
+
return b`<li class="queued" data-id=${message.id} data-mode="starting" ?data-unsent=${empty5}>
|
|
48271
|
+
${empty5 ? b`<swc-icon-alert-triangle size="s" aria-hidden="true"></swc-icon-alert-triangle>` : b`<swc-icon-clock size="s" aria-hidden="true"></swc-icon-clock>`}
|
|
48142
48272
|
${message.text ? A : b`<swc-icon-file size="xs" aria-hidden="true"></swc-icon-file>`}
|
|
48143
|
-
<span class="
|
|
48273
|
+
<span class="body">
|
|
48274
|
+
<span class="text"><span class="sr">Queued: </span>${message.text || names(message.attachments) || names(lost2)}</span>
|
|
48275
|
+
${lost2.length ? b`<span class="lost" data-lost><swc-icon-alert-triangle size="xs" aria-hidden="true"></swc-icon-alert-triangle><span class="sr">, </span>Not kept after reload${message.text ? `: ${names(lost2)}` : ""}</span>` : A}
|
|
48276
|
+
</span>
|
|
48144
48277
|
${message.text && message.attachments.length ? b`<span class="next" data-files><swc-icon-file size="xs" aria-hidden="true"></swc-icon-file><span class="sr">, </span>${message.attachments.length === 1 ? "1 file" : `${message.attachments.length} files`}</span>` : A}
|
|
48145
|
-
<span class="next"
|
|
48146
|
-
<swc-close-button size="s" data-action="unqueue" accessible-label
|
|
48147
|
-
</li
|
|
48148
|
-
)}
|
|
48278
|
+
<span class="next">${empty5 ? "Not sent. Attach the files again." : "Sent when the agent starts"}</span>
|
|
48279
|
+
<swc-close-button size="s" data-action="unqueue" accessible-label=${empty5 ? "Dismiss" : "Remove from queue"} @click=${() => this.#unwait(message.id)}></swc-close-button>
|
|
48280
|
+
</li>`;
|
|
48281
|
+
})}
|
|
48149
48282
|
</ul>`;
|
|
48150
48283
|
}
|
|
48151
48284
|
#review() {
|
|
@@ -51221,7 +51354,7 @@ var SliccSettings = class extends ThemedElement {
|
|
|
51221
51354
|
const vaulted = account.store === "vault" && !!vault?.remove;
|
|
51222
51355
|
const key2 = vaulted && account.auth === "api-key";
|
|
51223
51356
|
const signIn = vaulted && account.auth !== "api-key" && account.group === "mcp";
|
|
51224
|
-
const
|
|
51357
|
+
const stored2 = key2 || signIn ? vault : void 0;
|
|
51225
51358
|
const body4 = `Agents can\u2019t use ${account.provider} until you connect it again.${key2 ? " You can restore its key from Removed in Secrets for 30 days." : ""}`;
|
|
51226
51359
|
const title = `Disconnect ${account.provider}?`;
|
|
51227
51360
|
if (!await confirm({ title, body: body4, action: "Disconnect", variant: "confirmation" })) return;
|
|
@@ -51230,11 +51363,11 @@ var SliccSettings = class extends ThemedElement {
|
|
|
51230
51363
|
const server = serverOf(account);
|
|
51231
51364
|
const pinned = !!this.#pinned(account);
|
|
51232
51365
|
const url = account.group === "mcp" ? registrations2()[server] ?? (pinned ? null : this.#mcpUrl(account)) : null;
|
|
51233
|
-
if (
|
|
51366
|
+
if (stored2 && !await this.#forget(account, stored2)) return;
|
|
51234
51367
|
if (this.model !== model) return;
|
|
51235
51368
|
model?.settings.disconnect(account.id);
|
|
51236
|
-
if (!url || !
|
|
51237
|
-
await
|
|
51369
|
+
if (!url || !stored2?.endpoints) return;
|
|
51370
|
+
await stored2.endpoints({ remove: { mcp: [{ server, url }] } }).then(() => register(server, void 0)).catch((error) => {
|
|
51238
51371
|
if (this.model === model) this.failure = { id: account.id, message: failureText(error) };
|
|
51239
51372
|
});
|
|
51240
51373
|
}
|
|
@@ -66482,15 +66615,15 @@ var InteractionManager = class {
|
|
|
66482
66615
|
case "idle":
|
|
66483
66616
|
return;
|
|
66484
66617
|
case "gutterSelecting": {
|
|
66485
|
-
const { pointerSession:
|
|
66486
|
-
if (event2.pointerId !==
|
|
66618
|
+
const { pointerSession: session2 } = this;
|
|
66619
|
+
if (event2.pointerId !== session2.pointerId) return;
|
|
66487
66620
|
event2.preventDefault();
|
|
66488
66621
|
const point3 = this.resolveSelectionPoint(event2, { source: "coordinates-first" });
|
|
66489
66622
|
if (point3 != null) {
|
|
66490
|
-
|
|
66623
|
+
session2.current = point3;
|
|
66491
66624
|
this.updateSelection(point3.lineNumber, point3.side);
|
|
66492
66625
|
}
|
|
66493
|
-
const completedRange = this.buildSelectedLineRange(
|
|
66626
|
+
const completedRange = this.buildSelectedLineRange(session2.anchor, session2.current);
|
|
66494
66627
|
onGutterUtilityClick?.({ ...completedRange });
|
|
66495
66628
|
this.selectionAnchor = void 0;
|
|
66496
66629
|
this.notifySelectionEnd(completedRange);
|
|
@@ -69569,21 +69702,21 @@ function adoptEditSessionAnnotations(annotations, getName, previousSession) {
|
|
|
69569
69702
|
slotNames
|
|
69570
69703
|
};
|
|
69571
69704
|
}
|
|
69572
|
-
function writeEditSessionAnnotations(
|
|
69705
|
+
function writeEditSessionAnnotations(session2, annotations, getName) {
|
|
69573
69706
|
for (const annotation of annotations) {
|
|
69574
69707
|
const source = getLineAnnotationSource(annotation);
|
|
69575
|
-
if (!
|
|
69708
|
+
if (!session2.slotNames.has(source)) session2.slotNames.set(source, getName(annotation));
|
|
69576
69709
|
}
|
|
69577
|
-
|
|
69578
|
-
|
|
69710
|
+
session2.provided = annotations;
|
|
69711
|
+
session2.current = annotations;
|
|
69579
69712
|
}
|
|
69580
|
-
function resolveEditSessionSlotName(
|
|
69581
|
-
if (
|
|
69713
|
+
function resolveEditSessionSlotName(session2, annotation, getName) {
|
|
69714
|
+
if (session2 == null) return getName(annotation);
|
|
69582
69715
|
const source = getLineAnnotationSource(annotation);
|
|
69583
|
-
let name =
|
|
69716
|
+
let name = session2.slotNames.get(source);
|
|
69584
69717
|
if (name == null) {
|
|
69585
69718
|
name = getName(annotation);
|
|
69586
|
-
|
|
69719
|
+
session2.slotNames.set(source, name);
|
|
69587
69720
|
}
|
|
69588
69721
|
return name;
|
|
69589
69722
|
}
|
|
@@ -69783,9 +69916,9 @@ var File = class {
|
|
|
69783
69916
|
return this.editSession?.annotations?.current ?? this.lineAnnotations;
|
|
69784
69917
|
}
|
|
69785
69918
|
isNewAnnotations(lineAnnotations) {
|
|
69786
|
-
const
|
|
69919
|
+
const session2 = this.editSession?.annotations;
|
|
69787
69920
|
if (lineAnnotations === this.lineAnnotations) return false;
|
|
69788
|
-
return
|
|
69921
|
+
return session2 == null || lineAnnotations !== session2.provided && lineAnnotations !== session2.current;
|
|
69789
69922
|
}
|
|
69790
69923
|
updateExternalFile(incomingFile, lineAnnotations) {
|
|
69791
69924
|
if (areFileTargetsEqual(this.file, incomingFile)) return false;
|
|
@@ -69857,9 +69990,9 @@ var File = class {
|
|
|
69857
69990
|
writeEditSessionAnnotations(sessionAnnotations, lineAnnotations, getLineAnnotationName);
|
|
69858
69991
|
}
|
|
69859
69992
|
syncEditSessionAnnotationsFromEditor(lineAnnotations) {
|
|
69860
|
-
const
|
|
69861
|
-
if (
|
|
69862
|
-
|
|
69993
|
+
const session2 = this.editSession?.annotations;
|
|
69994
|
+
if (session2 == null || lineAnnotations === session2.current) return false;
|
|
69995
|
+
session2.current = lineAnnotations;
|
|
69863
69996
|
this.fileRenderer.setLineAnnotations(lineAnnotations);
|
|
69864
69997
|
this.renderAnnotations();
|
|
69865
69998
|
return true;
|
|
@@ -75746,9 +75879,9 @@ var FileDiff = class {
|
|
|
75746
75879
|
return this.editSession?.annotations?.current ?? this.lineAnnotations;
|
|
75747
75880
|
}
|
|
75748
75881
|
isNewAnnotations(lineAnnotations) {
|
|
75749
|
-
const
|
|
75882
|
+
const session2 = this.editSession?.annotations;
|
|
75750
75883
|
if (lineAnnotations === this.lineAnnotations) return false;
|
|
75751
|
-
return
|
|
75884
|
+
return session2 == null || lineAnnotations !== session2.provided && lineAnnotations !== session2.current;
|
|
75752
75885
|
}
|
|
75753
75886
|
setLineAnnotations(lineAnnotations) {
|
|
75754
75887
|
const sessionAnnotations = this.editSession?.annotations;
|
|
@@ -75761,9 +75894,9 @@ var FileDiff = class {
|
|
|
75761
75894
|
writeEditSessionAnnotations(sessionAnnotations, lineAnnotations, getLineAnnotationName);
|
|
75762
75895
|
}
|
|
75763
75896
|
syncEditSessionAnnotationsFromEditor(lineAnnotations) {
|
|
75764
|
-
const
|
|
75765
|
-
if (
|
|
75766
|
-
|
|
75897
|
+
const session2 = this.editSession?.annotations;
|
|
75898
|
+
if (session2 == null || lineAnnotations === session2.current) return false;
|
|
75899
|
+
session2.current = lineAnnotations;
|
|
75767
75900
|
this.hunksRenderer.setLineAnnotations(lineAnnotations);
|
|
75768
75901
|
this.renderAnnotations();
|
|
75769
75902
|
return true;
|