@ai-ecoverse/slicc-spectrum 1.99.3 → 1.101.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 +20 -4
- package/dist/slicc-dummy.js +239 -23
- package/dist/slicc-dummy.js.map +3 -3
- package/dist/slicc-ui.js +639 -248
- package/dist/slicc-ui.js.map +3 -3
- package/dist/types/app/composer.d.ts +11 -0
- package/dist/types/app/markdown.d.ts +5 -1
- package/dist/types/app/settings.d.ts +9 -0
- package/dist/types/app/updates.d.ts +14 -1
- package/dist/types/dummy/index.d.ts +3 -2
- package/dist/types/dummy/updates.d.ts +5 -0
- package/dist/types/dummy.d.ts +2 -2
- package/dist/types/model/types.d.ts +27 -1
- package/package.json +3 -3
package/dist/slicc-ui.js
CHANGED
|
@@ -8716,8 +8716,8 @@ var ModelElement = class extends i2 {
|
|
|
8716
8716
|
super.disconnectedCallback();
|
|
8717
8717
|
this.#unbind();
|
|
8718
8718
|
}
|
|
8719
|
-
willUpdate(
|
|
8720
|
-
if (
|
|
8719
|
+
willUpdate(changed2) {
|
|
8720
|
+
if (changed2.has("model") && this.isConnected) this.#bind();
|
|
8721
8721
|
}
|
|
8722
8722
|
#bind() {
|
|
8723
8723
|
this.#unbind();
|
|
@@ -19871,22 +19871,22 @@ function applyFileTreeGitStatusPatch(previous3, patch) {
|
|
|
19871
19871
|
const directoriesWithChanges = new Set(previous3?.directoriesWithChanges);
|
|
19872
19872
|
const ignoredDirectoryPaths = new Set(previous3?.ignoredDirectoryPaths);
|
|
19873
19873
|
const changeCountByDirectoryPath = new Map(previous3?.changeCountByDirectoryPath);
|
|
19874
|
-
let
|
|
19874
|
+
let changed2 = false;
|
|
19875
19875
|
for (const path2 of removeEntries) {
|
|
19876
19876
|
const resolved = resolveGitStatusPath(path2);
|
|
19877
19877
|
if (resolved == null) continue;
|
|
19878
|
-
|
|
19878
|
+
changed2 = removeGitStatusPath({
|
|
19879
19879
|
canonicalPath: resolved.canonicalPath,
|
|
19880
19880
|
changeCountByDirectoryPath,
|
|
19881
19881
|
directoriesWithChanges,
|
|
19882
19882
|
ignoredDirectoryPaths,
|
|
19883
19883
|
statusByPath
|
|
19884
|
-
}) ||
|
|
19884
|
+
}) || changed2;
|
|
19885
19885
|
}
|
|
19886
19886
|
for (const entry of setEntries) {
|
|
19887
19887
|
const resolved = resolveGitStatusEntry(entry);
|
|
19888
19888
|
if (resolved == null) continue;
|
|
19889
|
-
|
|
19889
|
+
changed2 = setGitStatusPath({
|
|
19890
19890
|
canonicalPath: resolved.canonicalPath,
|
|
19891
19891
|
changeCountByDirectoryPath,
|
|
19892
19892
|
directoriesWithChanges,
|
|
@@ -19894,9 +19894,9 @@ function applyFileTreeGitStatusPatch(previous3, patch) {
|
|
|
19894
19894
|
isDirectory: resolved.isDirectory,
|
|
19895
19895
|
status: entry.status,
|
|
19896
19896
|
statusByPath
|
|
19897
|
-
}) ||
|
|
19897
|
+
}) || changed2;
|
|
19898
19898
|
}
|
|
19899
|
-
if (!
|
|
19899
|
+
if (!changed2) return previous3;
|
|
19900
19900
|
if (statusByPath.size === 0) return null;
|
|
19901
19901
|
return {
|
|
19902
19902
|
changeCountByDirectoryPath,
|
|
@@ -25699,7 +25699,7 @@ var titleBefore = {
|
|
|
25699
25699
|
};
|
|
25700
25700
|
function tokenizeDefinition(effects, ok4, nok) {
|
|
25701
25701
|
const self2 = this;
|
|
25702
|
-
let
|
|
25702
|
+
let identifier2;
|
|
25703
25703
|
return start2;
|
|
25704
25704
|
function start2(code3) {
|
|
25705
25705
|
effects.enter("definition");
|
|
@@ -25718,7 +25718,7 @@ function tokenizeDefinition(effects, ok4, nok) {
|
|
|
25718
25718
|
)(code3);
|
|
25719
25719
|
}
|
|
25720
25720
|
function labelAfter(code3) {
|
|
25721
|
-
|
|
25721
|
+
identifier2 = normalizeIdentifier(self2.sliceSerialize(self2.events[self2.events.length - 1][1]).slice(1, -1));
|
|
25722
25722
|
if (code3 === 58) {
|
|
25723
25723
|
effects.enter("definitionMarker");
|
|
25724
25724
|
effects.consume(code3);
|
|
@@ -25752,7 +25752,7 @@ function tokenizeDefinition(effects, ok4, nok) {
|
|
|
25752
25752
|
function afterWhitespace(code3) {
|
|
25753
25753
|
if (code3 === null || markdownLineEnding(code3)) {
|
|
25754
25754
|
effects.exit("definition");
|
|
25755
|
-
self2.parser.defined.push(
|
|
25755
|
+
self2.parser.defined.push(identifier2);
|
|
25756
25756
|
return ok4(code3);
|
|
25757
25757
|
}
|
|
25758
25758
|
return nok(code3);
|
|
@@ -29073,16 +29073,16 @@ function findUrl(_9, protocol, domain2, path2, match) {
|
|
|
29073
29073
|
if (!isCorrectDomain(domain2)) {
|
|
29074
29074
|
return false;
|
|
29075
29075
|
}
|
|
29076
|
-
const
|
|
29077
|
-
if (!
|
|
29076
|
+
const parts3 = splitUrl(domain2 + path2);
|
|
29077
|
+
if (!parts3[0]) return false;
|
|
29078
29078
|
const result = {
|
|
29079
29079
|
type: "link",
|
|
29080
29080
|
title: null,
|
|
29081
|
-
url: prefix + protocol +
|
|
29082
|
-
children: [{ type: "text", value: protocol +
|
|
29081
|
+
url: prefix + protocol + parts3[0],
|
|
29082
|
+
children: [{ type: "text", value: protocol + parts3[0] }]
|
|
29083
29083
|
};
|
|
29084
|
-
if (
|
|
29085
|
-
return [result, { type: "text", value:
|
|
29084
|
+
if (parts3[1]) {
|
|
29085
|
+
return [result, { type: "text", value: parts3[1] }];
|
|
29086
29086
|
}
|
|
29087
29087
|
return result;
|
|
29088
29088
|
}
|
|
@@ -29102,8 +29102,8 @@ function findEmail(_9, atext, label, match) {
|
|
|
29102
29102
|
};
|
|
29103
29103
|
}
|
|
29104
29104
|
function isCorrectDomain(domain2) {
|
|
29105
|
-
const
|
|
29106
|
-
if (
|
|
29105
|
+
const parts3 = domain2.split(".");
|
|
29106
|
+
if (parts3.length < 2 || parts3[parts3.length - 1] && (/_/.test(parts3[parts3.length - 1]) || !/[a-zA-Z\d]/.test(parts3[parts3.length - 1])) || parts3[parts3.length - 2] && (/_/.test(parts3[parts3.length - 2]) || !/[a-zA-Z\d]/.test(parts3[parts3.length - 2]))) {
|
|
29107
29107
|
return false;
|
|
29108
29108
|
}
|
|
29109
29109
|
return true;
|
|
@@ -30329,7 +30329,7 @@ var options = {
|
|
|
30329
30329
|
var empty2 = { text: "", blocks: [], starts: [], keep: 0, definitions: /* @__PURE__ */ new Map() };
|
|
30330
30330
|
var cache = /* @__PURE__ */ new Map();
|
|
30331
30331
|
var streams = [];
|
|
30332
|
-
var rendered = /* @__PURE__ */ new
|
|
30332
|
+
var rendered = /* @__PURE__ */ new Map();
|
|
30333
30333
|
function collect(nodes, found) {
|
|
30334
30334
|
for (const node2 of nodes) {
|
|
30335
30335
|
if (node2.type === "definition" && !found.has(node2.identifier)) found.set(node2.identifier, node2);
|
|
@@ -30369,103 +30369,115 @@ function parse2(text5) {
|
|
|
30369
30369
|
streams.length = Math.min(streams.length, 8);
|
|
30370
30370
|
return parsed;
|
|
30371
30371
|
}
|
|
30372
|
-
function
|
|
30372
|
+
function inert(value, strict) {
|
|
30373
|
+
return strict ? value.replace(/<[^>]*>/g, "") : value;
|
|
30374
|
+
}
|
|
30375
|
+
function safeUrl(url, images = false, strict = false) {
|
|
30376
|
+
if (strict) return /^https:\/\//i.test(url);
|
|
30373
30377
|
return /^https?:\/\//.test(url) || !images && /^mailto:/.test(url) || images && /^data:image\/(png|jpeg|gif|webp|svg\+xml)[;,]/.test(url);
|
|
30374
30378
|
}
|
|
30375
|
-
function link(url, title, label) {
|
|
30376
|
-
return safeUrl(url) ? b`<a href=${url} title=${title ?? A} target="_blank" rel="noopener noreferrer">${label}</a>` : b`${label}`;
|
|
30379
|
+
function link(url, title, label, strict) {
|
|
30380
|
+
return safeUrl(url, false, strict) ? b`<a href=${url} title=${title ?? A} target="_blank" rel="noopener noreferrer">${label}</a>` : b`${label}`;
|
|
30377
30381
|
}
|
|
30378
|
-
function image(url, title, alt) {
|
|
30382
|
+
function image(url, title, alt, strict) {
|
|
30383
|
+
if (strict) return link(url, title, alt || url, true);
|
|
30379
30384
|
return safeUrl(url, true) ? b`<img src=${url} alt=${alt} title=${title ?? A} />` : alt;
|
|
30380
30385
|
}
|
|
30381
|
-
function inline3(node2,
|
|
30382
|
-
return node2.children.map((child) => phrasing(child,
|
|
30386
|
+
function inline3(node2, context) {
|
|
30387
|
+
return node2.children.map((child) => phrasing(child, context));
|
|
30383
30388
|
}
|
|
30384
|
-
function phrasing(node2,
|
|
30389
|
+
function phrasing(node2, context) {
|
|
30385
30390
|
switch (node2.type) {
|
|
30386
30391
|
case "text":
|
|
30387
|
-
case "html":
|
|
30388
30392
|
return node2.value;
|
|
30393
|
+
case "html":
|
|
30394
|
+
return inert(node2.value, context.strict);
|
|
30389
30395
|
case "inlineCode":
|
|
30390
30396
|
return b`<code>${node2.value}</code>`;
|
|
30391
30397
|
case "strong":
|
|
30392
|
-
return b`<strong>${inline3(node2,
|
|
30398
|
+
return b`<strong>${inline3(node2, context)}</strong>`;
|
|
30393
30399
|
case "emphasis":
|
|
30394
|
-
return b`<em>${inline3(node2,
|
|
30400
|
+
return b`<em>${inline3(node2, context)}</em>`;
|
|
30395
30401
|
case "delete":
|
|
30396
|
-
return b`<s>${inline3(node2,
|
|
30402
|
+
return b`<s>${inline3(node2, context)}</s>`;
|
|
30397
30403
|
case "break":
|
|
30398
30404
|
return b`<br />`;
|
|
30399
30405
|
case "link":
|
|
30400
|
-
return link(node2.url, node2.title, inline3(node2,
|
|
30406
|
+
return link(node2.url, node2.title, inline3(node2, context), context.strict);
|
|
30401
30407
|
case "linkReference": {
|
|
30402
|
-
const target2 = definitions.get(node2.identifier);
|
|
30403
|
-
return link(target2.url, target2.title, inline3(node2,
|
|
30408
|
+
const target2 = context.definitions.get(node2.identifier);
|
|
30409
|
+
return link(target2.url, target2.title, inline3(node2, context), context.strict);
|
|
30404
30410
|
}
|
|
30405
30411
|
case "image":
|
|
30406
|
-
return image(node2.url, node2.title, node2.alt);
|
|
30412
|
+
return image(node2.url, node2.title, node2.alt, context.strict);
|
|
30407
30413
|
default: {
|
|
30408
|
-
const target2 = definitions.get(node2.identifier);
|
|
30409
|
-
return image(target2.url, target2.title, node2.alt);
|
|
30414
|
+
const target2 = context.definitions.get(node2.identifier);
|
|
30415
|
+
return image(target2.url, target2.title, node2.alt, context.strict);
|
|
30410
30416
|
}
|
|
30411
30417
|
}
|
|
30412
30418
|
}
|
|
30413
|
-
function paragraph(node2,
|
|
30414
|
-
const content3 = inline3(node2,
|
|
30419
|
+
function paragraph(node2, context, tight, lead) {
|
|
30420
|
+
const content3 = inline3(node2, context);
|
|
30415
30421
|
return tight ? b`${lead}${content3}` : b`<p>${lead}${content3}</p>`;
|
|
30416
30422
|
}
|
|
30417
|
-
function item(node2,
|
|
30423
|
+
function item(node2, context, tight) {
|
|
30418
30424
|
const box = typeof node2.checked === "boolean" ? b`<span class="task" data-done=${node2.checked ? "true" : "false"} aria-label=${node2.checked ? "done" : "open"}>${node2.checked ? "\u2611" : "\u2610"}</span> ` : A;
|
|
30419
30425
|
return b`<li>${node2.children.map(
|
|
30420
|
-
(child, index2) => child.type === "paragraph" ? paragraph(child,
|
|
30426
|
+
(child, index2) => child.type === "paragraph" ? paragraph(child, context, tight, index2 ? A : box) : flow3(child, context)
|
|
30421
30427
|
)}</li>`;
|
|
30422
30428
|
}
|
|
30423
|
-
function list3(node2,
|
|
30429
|
+
function list3(node2, context) {
|
|
30424
30430
|
const tight = !node2.spread && !node2.children.some((entry) => entry.spread);
|
|
30425
|
-
const items = node2.children.map((entry) => item(entry,
|
|
30431
|
+
const items = node2.children.map((entry) => item(entry, context, tight));
|
|
30426
30432
|
return node2.ordered ? b`<ol start=${node2.start === 1 ? A : node2.start}>${items}</ol>` : b`<ul>${items}</ul>`;
|
|
30427
30433
|
}
|
|
30428
|
-
function table(node2,
|
|
30434
|
+
function table(node2, context) {
|
|
30429
30435
|
const [head2, ...body4] = node2.children;
|
|
30430
30436
|
const align = (index2) => node2.align[index2] ?? A;
|
|
30431
30437
|
return b`<div class="table"><table>
|
|
30432
|
-
<thead><tr>${head2.children.map((cell, index2) => b`<th data-align=${align(index2)}>${inline3(cell,
|
|
30433
|
-
<tbody>${body4.map((row) => b`<tr>${row.children.map((cell, index2) => b`<td data-align=${align(index2)}>${inline3(cell,
|
|
30438
|
+
<thead><tr>${head2.children.map((cell, index2) => b`<th data-align=${align(index2)}>${inline3(cell, context)}</th>`)}</tr></thead>
|
|
30439
|
+
<tbody>${body4.map((row) => b`<tr>${row.children.map((cell, index2) => b`<td data-align=${align(index2)}>${inline3(cell, context)}</td>`)}</tr>`)}</tbody>
|
|
30434
30440
|
</table></div>`;
|
|
30435
30441
|
}
|
|
30436
|
-
function flow3(node2,
|
|
30442
|
+
function flow3(node2, context) {
|
|
30437
30443
|
switch (node2.type) {
|
|
30438
30444
|
case "paragraph":
|
|
30439
|
-
return paragraph(node2,
|
|
30445
|
+
return paragraph(node2, context, false, A);
|
|
30440
30446
|
case "heading":
|
|
30441
|
-
return b`<p class="heading" role="heading" aria-level=${Math.min(node2.depth + 2, 6)}>${inline3(node2,
|
|
30447
|
+
return b`<p class="heading" role="heading" aria-level=${Math.min(context.level === null ? node2.depth + 2 : context.level + 1, 6)}>${inline3(node2, context)}</p>`;
|
|
30442
30448
|
case "code":
|
|
30443
30449
|
return b`<pre class="code" data-lang=${node2.lang || A}><code>${node2.value}</code></pre>`;
|
|
30444
30450
|
case "list":
|
|
30445
|
-
return list3(node2,
|
|
30451
|
+
return list3(node2, context);
|
|
30446
30452
|
case "table":
|
|
30447
|
-
return table(node2,
|
|
30453
|
+
return table(node2, context);
|
|
30448
30454
|
case "blockquote":
|
|
30449
|
-
return b`<blockquote>${node2.children.map((child) => flow3(child,
|
|
30455
|
+
return b`<blockquote>${node2.children.map((child) => flow3(child, context))}</blockquote>`;
|
|
30450
30456
|
case "thematicBreak":
|
|
30451
30457
|
return b`<hr />`;
|
|
30452
|
-
case "html":
|
|
30453
|
-
|
|
30458
|
+
case "html": {
|
|
30459
|
+
const text5 = inert(node2.value, context.strict).trim();
|
|
30460
|
+
return text5 ? b`<p>${text5}</p>` : A;
|
|
30461
|
+
}
|
|
30454
30462
|
default:
|
|
30455
30463
|
return A;
|
|
30456
30464
|
}
|
|
30457
30465
|
}
|
|
30458
|
-
function block(node2,
|
|
30459
|
-
|
|
30466
|
+
function block(node2, context) {
|
|
30467
|
+
const key2 = `${context.strict}:${context.level}`;
|
|
30468
|
+
const cache5 = rendered.get(key2) ?? /* @__PURE__ */ new WeakMap();
|
|
30469
|
+
rendered.set(key2, cache5);
|
|
30470
|
+
let output = cache5.get(node2);
|
|
30460
30471
|
if (output === void 0) {
|
|
30461
|
-
output = flow3(node2,
|
|
30462
|
-
|
|
30472
|
+
output = flow3(node2, context);
|
|
30473
|
+
cache5.set(node2, output);
|
|
30463
30474
|
}
|
|
30464
30475
|
return output;
|
|
30465
30476
|
}
|
|
30466
|
-
function markdown(text5) {
|
|
30477
|
+
function markdown(text5, options2 = {}) {
|
|
30467
30478
|
const { blocks, definitions } = parse2(text5);
|
|
30468
|
-
|
|
30479
|
+
const context = { definitions, strict: options2.strict === true, level: options2.level ?? null };
|
|
30480
|
+
return b`${blocks.map((node2) => block(node2, context))}`;
|
|
30469
30481
|
}
|
|
30470
30482
|
var markdownCss = i`
|
|
30471
30483
|
.markdown :is(p, ul, ol, .table, pre, blockquote) {
|
|
@@ -32532,8 +32544,8 @@ var SliccVaultButton = class extends i2 {
|
|
|
32532
32544
|
focus() {
|
|
32533
32545
|
this.#button?.post({ type: "slicc-vault", v: 1, op: "focus" });
|
|
32534
32546
|
}
|
|
32535
|
-
updated(
|
|
32536
|
-
if (
|
|
32547
|
+
updated(changed2) {
|
|
32548
|
+
if (changed2.has("vault")) this.#drop();
|
|
32537
32549
|
if (!this.#button && this.vault) this.#mount(this.vault);
|
|
32538
32550
|
this.#send();
|
|
32539
32551
|
}
|
|
@@ -32591,6 +32603,12 @@ var SliccVaultButton = class extends i2 {
|
|
|
32591
32603
|
var limit = 25 * 1024 * 1024;
|
|
32592
32604
|
var startingKey = "slicc-spectrum.starting";
|
|
32593
32605
|
var names = (files) => files.map((file) => file.name).join(", ");
|
|
32606
|
+
function reattach(files) {
|
|
32607
|
+
const all3 = files.map((file) => file.name);
|
|
32608
|
+
if (all3.length > 3) return `Attach these ${all3.length} files again: ${all3.join(", ")}.`;
|
|
32609
|
+
const listed2 = all3.length > 1 ? `${all3.slice(0, -1).join(", ")} and ${all3.at(-1)}` : all3[0];
|
|
32610
|
+
return `Attach ${listed2} again.`;
|
|
32611
|
+
}
|
|
32594
32612
|
var notKept = (files) => files.length === 1 ? `Not sent: ${files[0].name} wasn\u2019t kept after reload.` : `Not sent: ${files.length} files weren\u2019t kept after reload.`;
|
|
32595
32613
|
function session() {
|
|
32596
32614
|
try {
|
|
@@ -32866,6 +32884,7 @@ var SliccComposer = class extends ThemedElement {
|
|
|
32866
32884
|
secretError: { state: true },
|
|
32867
32885
|
secretField: { state: true },
|
|
32868
32886
|
failure: { state: true },
|
|
32887
|
+
reattach: { state: true },
|
|
32869
32888
|
agent: {}
|
|
32870
32889
|
};
|
|
32871
32890
|
#drafts = /* @__PURE__ */ new Map();
|
|
@@ -32894,6 +32913,7 @@ var SliccComposer = class extends ThemedElement {
|
|
|
32894
32913
|
this.secretError = null;
|
|
32895
32914
|
this.secretField = null;
|
|
32896
32915
|
this.failure = null;
|
|
32916
|
+
this.reattach = null;
|
|
32897
32917
|
this.agent = "";
|
|
32898
32918
|
}
|
|
32899
32919
|
static styles = [
|
|
@@ -33080,13 +33100,23 @@ var SliccComposer = class extends ThemedElement {
|
|
|
33080
33100
|
flex: none;
|
|
33081
33101
|
margin-block-start: var(--swc-spacing-50);
|
|
33082
33102
|
}
|
|
33083
|
-
.seat-note
|
|
33103
|
+
.seat-note,
|
|
33104
|
+
.reattach {
|
|
33084
33105
|
margin: var(--swc-spacing-100) 0 0;
|
|
33085
33106
|
padding-inline: var(--swc-spacing-200);
|
|
33086
33107
|
font-size: var(--swc-font-size-75);
|
|
33087
33108
|
color: var(--swc-neutral-subdued-content-color-default);
|
|
33088
33109
|
text-align: center;
|
|
33089
33110
|
}
|
|
33111
|
+
.reattach {
|
|
33112
|
+
display: flex;
|
|
33113
|
+
justify-content: center;
|
|
33114
|
+
align-items: center;
|
|
33115
|
+
gap: var(--swc-spacing-75);
|
|
33116
|
+
}
|
|
33117
|
+
.reattach swc-action-button {
|
|
33118
|
+
color: var(--swc-neutral-subdued-content-color-default);
|
|
33119
|
+
}
|
|
33090
33120
|
.popup {
|
|
33091
33121
|
position: absolute;
|
|
33092
33122
|
left: 0;
|
|
@@ -33182,15 +33212,20 @@ var SliccComposer = class extends ThemedElement {
|
|
|
33182
33212
|
}
|
|
33183
33213
|
`
|
|
33184
33214
|
];
|
|
33185
|
-
willUpdate(
|
|
33186
|
-
super.willUpdate(
|
|
33187
|
-
if (
|
|
33188
|
-
if (
|
|
33215
|
+
willUpdate(changed2) {
|
|
33216
|
+
super.willUpdate(changed2);
|
|
33217
|
+
if (changed2.has("popup") && this.popup?.kind !== "secret") clearValues(this.renderRoot);
|
|
33218
|
+
if (changed2.has("agent") && this.agent && this.model && this.agent !== this.#agent) {
|
|
33189
33219
|
this.#switch(this.agent);
|
|
33190
33220
|
}
|
|
33191
|
-
|
|
33221
|
+
if (this.reattach && !this.value.trim()) this.reattach = null;
|
|
33222
|
+
const edited = changed2.has("value") || changed2.has("attachments") || changed2.has("reattach");
|
|
33192
33223
|
if (edited && this.hasUpdated && !this.#agent && this.#starting())
|
|
33193
|
-
this.#waiting.draft = {
|
|
33224
|
+
this.#waiting.draft = {
|
|
33225
|
+
value: this.value,
|
|
33226
|
+
attachments: this.attachments,
|
|
33227
|
+
reattach: this.reattach
|
|
33228
|
+
};
|
|
33194
33229
|
}
|
|
33195
33230
|
connectedCallback() {
|
|
33196
33231
|
super.connectedCallback();
|
|
@@ -33217,8 +33252,8 @@ var SliccComposer = class extends ThemedElement {
|
|
|
33217
33252
|
for (const attachments of held) release(attachments);
|
|
33218
33253
|
}, linger);
|
|
33219
33254
|
}
|
|
33220
|
-
updated(
|
|
33221
|
-
if (
|
|
33255
|
+
updated(changed2) {
|
|
33256
|
+
if (changed2.has("popup"))
|
|
33222
33257
|
this.renderRoot.querySelector('.item[aria-selected="true"]')?.scrollIntoView({ block: "nearest" });
|
|
33223
33258
|
}
|
|
33224
33259
|
#wire() {
|
|
@@ -33295,6 +33330,11 @@ var SliccComposer = class extends ThemedElement {
|
|
|
33295
33330
|
#putBack(row) {
|
|
33296
33331
|
this.value = this.value.trim() ? `${this.value}
|
|
33297
33332
|
${row.text}` : row.text;
|
|
33333
|
+
const listed2 = new Set((this.reattach ?? []).map((file) => file.name));
|
|
33334
|
+
const fresh2 = (row.lost ?? []).filter(
|
|
33335
|
+
(file) => !listed2.has(file.name) && listed2.add(file.name)
|
|
33336
|
+
);
|
|
33337
|
+
this.reattach = [...this.reattach ?? [], ...fresh2];
|
|
33298
33338
|
this.#history = -1;
|
|
33299
33339
|
this.#unwait(row.id);
|
|
33300
33340
|
this.focus();
|
|
@@ -33310,13 +33350,18 @@ ${row.text}` : row.text;
|
|
|
33310
33350
|
}
|
|
33311
33351
|
#switch(id) {
|
|
33312
33352
|
if (this.#agent)
|
|
33313
|
-
this.#drafts.set(this.#agent, {
|
|
33353
|
+
this.#drafts.set(this.#agent, {
|
|
33354
|
+
value: this.value,
|
|
33355
|
+
attachments: this.attachments,
|
|
33356
|
+
reattach: this.reattach
|
|
33357
|
+
});
|
|
33314
33358
|
const shared3 = this.#agent || !this.isConnected ? null : this.#waiting.draft;
|
|
33315
33359
|
if (shared3 && id && !this.#drafts.has(id)) this.#waiting.draft = null;
|
|
33316
33360
|
const draft2 = this.#drafts.get(id) ?? shared3 ?? void 0;
|
|
33317
33361
|
this.#agent = id;
|
|
33318
33362
|
this.value = draft2?.value ?? "";
|
|
33319
33363
|
this.attachments = draft2?.attachments ?? [];
|
|
33364
|
+
this.reattach = draft2?.reattach ?? null;
|
|
33320
33365
|
this.popup = null;
|
|
33321
33366
|
this.#history = -1;
|
|
33322
33367
|
}
|
|
@@ -33975,6 +34020,10 @@ ${this.value}` : text5;
|
|
|
33975
34020
|
const talk = !!speech();
|
|
33976
34021
|
const held = this.#held();
|
|
33977
34022
|
const starting = this.#starting();
|
|
34023
|
+
const back = new Set(
|
|
34024
|
+
this.attachments.filter((attachment2) => !attachment2.error).map((attachment2) => attachment2.name)
|
|
34025
|
+
);
|
|
34026
|
+
const missing = (this.reattach ?? []).filter((file) => !back.has(file.name));
|
|
33978
34027
|
return b`<div class="column" @drop=${this.#mark}>
|
|
33979
34028
|
<span id="keys" class="sr" aria-hidden="true">${this.#instructions(busy)}</span>
|
|
33980
34029
|
${this.#hold()}
|
|
@@ -34006,6 +34055,7 @@ ${this.value}` : text5;
|
|
|
34006
34055
|
>
|
|
34007
34056
|
${this.attachments.map((attachment2) => this.#attachment(attachment2))}
|
|
34008
34057
|
</swc-prompt-field>
|
|
34058
|
+
${missing.length ? b`<p class="reattach" data-reattach><swc-action-button size="s" quiet data-action="reattach" @click=${() => this.renderRoot.querySelector("input[type=file]")?.click()}><swc-icon-attach slot="icon"></swc-icon-attach>${reattach(missing)}</swc-action-button></p>` : A}
|
|
34009
34059
|
<swc-popover placement="top-start" accessible-label="Add to the message" @keydown=${this.#menuKey} @swc-after-open=${() => this.renderRoot.querySelector("sp-menu")?.focus()}>
|
|
34010
34060
|
<sp-menu label="Add to the message" @change=${this.#add}>
|
|
34011
34061
|
<sp-menu-item value="upload">Upload from this computer</sp-menu-item>
|
|
@@ -34963,12 +35013,12 @@ var SliccChat = class _SliccChat extends ThemedElement {
|
|
|
34963
35013
|
}
|
|
34964
35014
|
this.#settings(account);
|
|
34965
35015
|
}
|
|
34966
|
-
#message(message, agent, suggestion,
|
|
35016
|
+
#message(message, agent, suggestion, changed2, extra, owners, stamp, pile) {
|
|
34967
35017
|
const model = this.model;
|
|
34968
35018
|
const handlers = { ...this.#handlers, owners };
|
|
34969
35019
|
switch (message.role) {
|
|
34970
35020
|
case "assistant": {
|
|
34971
|
-
const label =
|
|
35021
|
+
const label = changed2 ? model.settings.models().find((option2) => option2.id === message.model)?.label ?? message.model : "";
|
|
34972
35022
|
return assistant(
|
|
34973
35023
|
message,
|
|
34974
35024
|
agent.name,
|
|
@@ -35032,15 +35082,15 @@ var SliccChat = class _SliccChat extends ThemedElement {
|
|
|
35032
35082
|
previous3 = label;
|
|
35033
35083
|
}
|
|
35034
35084
|
const next = message.role === "assistant" ? message.model : void 0;
|
|
35035
|
-
const
|
|
35036
|
-
if (
|
|
35085
|
+
const changed2 = !!next && next !== shown4;
|
|
35086
|
+
if (changed2) shown4 = next;
|
|
35037
35087
|
out.push([
|
|
35038
35088
|
message.id,
|
|
35039
35089
|
this.#message(
|
|
35040
35090
|
message,
|
|
35041
35091
|
agent,
|
|
35042
35092
|
message.id === target2 ? suggestion : null,
|
|
35043
|
-
|
|
35093
|
+
changed2,
|
|
35044
35094
|
extra.get(message.id) ?? [],
|
|
35045
35095
|
owners,
|
|
35046
35096
|
stamped.has(message.id),
|
|
@@ -35217,8 +35267,8 @@ function treeStatus(changes2) {
|
|
|
35217
35267
|
function ancestors(paths) {
|
|
35218
35268
|
const out = /* @__PURE__ */ new Set();
|
|
35219
35269
|
for (const path2 of paths) {
|
|
35220
|
-
const
|
|
35221
|
-
for (let i26 = 1; i26 <=
|
|
35270
|
+
const parts3 = relative(path2).split("/").slice(0, -1);
|
|
35271
|
+
for (let i26 = 1; i26 <= parts3.length; i26++) out.add(parts3.slice(0, i26).join("/"));
|
|
35222
35272
|
}
|
|
35223
35273
|
return [...out];
|
|
35224
35274
|
}
|
|
@@ -36595,8 +36645,8 @@ var SliccFreezer = class extends ModelElement {
|
|
|
36595
36645
|
...onWatch(model, update)
|
|
36596
36646
|
];
|
|
36597
36647
|
}
|
|
36598
|
-
willUpdate(
|
|
36599
|
-
super.willUpdate(
|
|
36648
|
+
willUpdate(changed2) {
|
|
36649
|
+
super.willUpdate(changed2);
|
|
36600
36650
|
if (!this.importable) this.refused = false;
|
|
36601
36651
|
}
|
|
36602
36652
|
focus() {
|
|
@@ -36772,7 +36822,7 @@ function block2(text5, copied, copy, first2 = false) {
|
|
|
36772
36822
|
}
|
|
36773
36823
|
function breakable(text5) {
|
|
36774
36824
|
return text5.split("/").map(
|
|
36775
|
-
(part2, index2,
|
|
36825
|
+
(part2, index2, parts3) => b`${part2}${index2 < parts3.length - 1 ? b`/<wbr />` : A}`
|
|
36776
36826
|
);
|
|
36777
36827
|
}
|
|
36778
36828
|
function reach({ intro, extensionUrl, copied, uncopied, copy }) {
|
|
@@ -37951,8 +38001,8 @@ function grammarBase() {
|
|
|
37951
38001
|
function grammarUrls(kind, name, version2, remote, base = local, page = globalThis.document?.baseURI ?? "http://localhost/") {
|
|
37952
38002
|
const urls = [];
|
|
37953
38003
|
if (base) {
|
|
37954
|
-
const
|
|
37955
|
-
urls.push(new URL(`${kind}/dist/${name}.mjs`, new URL(
|
|
38004
|
+
const folder3 = base.endsWith("/") ? base : `${base}/`;
|
|
38005
|
+
urls.push(new URL(`${kind}/dist/${name}.mjs`, new URL(folder3, page)).href);
|
|
37956
38006
|
}
|
|
37957
38007
|
urls.push(`${remote}${kind}@${version2}/dist/${name}.mjs`);
|
|
37958
38008
|
return urls;
|
|
@@ -39113,11 +39163,11 @@ function budgetVariant(percent2) {
|
|
|
39113
39163
|
return variant === "informative" ? "neutral" : variant;
|
|
39114
39164
|
}
|
|
39115
39165
|
function spendLine(status2) {
|
|
39116
|
-
const
|
|
39166
|
+
const parts3 = [
|
|
39117
39167
|
status2.spent ? `Spent $${status2.spent.toFixed(2)}` : "",
|
|
39118
39168
|
status2.rate ? `$${status2.rate.toFixed(2)}/h` : ""
|
|
39119
39169
|
];
|
|
39120
|
-
const line =
|
|
39170
|
+
const line = parts3.filter(Boolean).join(" \xB7 ");
|
|
39121
39171
|
return line ? `${line}. ` : "";
|
|
39122
39172
|
}
|
|
39123
39173
|
function budgetLine(status2, budget) {
|
|
@@ -39194,8 +39244,8 @@ var SliccTray = class extends ModelElement {
|
|
|
39194
39244
|
const model = this.model;
|
|
39195
39245
|
if (!model) return b``;
|
|
39196
39246
|
const status2 = model.tray.status();
|
|
39197
|
-
const
|
|
39198
|
-
const connection = `${connectionLabel[status2.connection]}${
|
|
39247
|
+
const refused3 = refusedNow(model.follow?.state());
|
|
39248
|
+
const connection = `${connectionLabel[status2.connection]}${refused3 ? ", can\u2019t follow" : ""}`;
|
|
39199
39249
|
const followers = `${status2.followers.length} ${status2.followers.length === 1 ? "follower" : "followers"}`;
|
|
39200
39250
|
const light = status2.connection === "live" ? status2.name : `${status2.name}, ${connection}`;
|
|
39201
39251
|
const budget = shownBudget(status2);
|
|
@@ -39204,7 +39254,7 @@ var SliccTray = class extends ModelElement {
|
|
|
39204
39254
|
"network",
|
|
39205
39255
|
`Tray ${status2.name}: ${connection}, ${followers}`,
|
|
39206
39256
|
b`<span>
|
|
39207
|
-
<swc-status-light size="s" variant=${
|
|
39257
|
+
<swc-status-light size="s" variant=${refused3 ? "neutral" : connectionVariant[status2.connection]}>
|
|
39208
39258
|
<span class="detail">${light}</span>
|
|
39209
39259
|
</swc-status-light>
|
|
39210
39260
|
<span class="detail muted followers"><swc-icon-user-group size="s"></swc-icon-user-group>${status2.followers.length}</span>
|
|
@@ -40006,8 +40056,8 @@ var SliccNetwork = class extends ModelElement {
|
|
|
40006
40056
|
setTimeout(() => settle2.disconnect(), 1e3);
|
|
40007
40057
|
});
|
|
40008
40058
|
}
|
|
40009
|
-
willUpdate(
|
|
40010
|
-
super.willUpdate(
|
|
40059
|
+
willUpdate(changed2) {
|
|
40060
|
+
super.willUpdate(changed2);
|
|
40011
40061
|
const state2 = this.#pairing()?.state;
|
|
40012
40062
|
const was = this.#pairState;
|
|
40013
40063
|
this.#pairState = state2;
|
|
@@ -40380,19 +40430,19 @@ var SliccNetwork = class extends ModelElement {
|
|
|
40380
40430
|
const heading = `folders-${device.id}`;
|
|
40381
40431
|
return b`<div class="folders" data-folders>
|
|
40382
40432
|
<span class="subheading" id=${heading}>Folders</span>
|
|
40383
|
-
<ul aria-labelledby=${heading}>${folders2.map((
|
|
40433
|
+
<ul aria-labelledby=${heading}>${folders2.map((folder3) => this.#folder(port, device, folder3))}</ul>
|
|
40384
40434
|
</div>`;
|
|
40385
40435
|
}
|
|
40386
|
-
#folder(port, device,
|
|
40387
|
-
const action = `folder:${
|
|
40436
|
+
#folder(port, device, folder3) {
|
|
40437
|
+
const action = `folder:${folder3.source}`;
|
|
40388
40438
|
const busy = this.busy === action;
|
|
40389
|
-
const button =
|
|
40390
|
-
return b`<li data-folder=${
|
|
40439
|
+
const button = folder3.mounted ? port.ejectFolder ? b`<swc-button size="s" variant="secondary" fill-style="outline" data-action="eject-folder" data-id=${folder3.source} accessible-label=${`Eject ${folder3.mounted}`} ?pending=${busy} ?disabled=${this.#waiting(action)} @click=${() => this.#act(action, () => port.ejectFolder?.(folder3.source), "linksError")}>Eject</swc-button>` : A : port.mountFolder ? b`<swc-button size="s" variant="secondary" fill-style="outline" data-action="mount-folder" data-id=${folder3.source} accessible-label=${`Mount ${folder3.source}`} ?pending=${busy} ?disabled=${this.#waiting(action) || device.state !== "connected"} @click=${() => this.#act(action, () => this.#mountFolder(port, folder3.source), "linksError")}>Mount</swc-button>` : A;
|
|
40440
|
+
return b`<li data-folder=${folder3.source} data-mounted=${folder3.mounted ? "yes" : "no"}>
|
|
40391
40441
|
<swc-icon-folder size="s" aria-hidden="true"></swc-icon-folder>
|
|
40392
40442
|
<span class="folder">
|
|
40393
|
-
<code title=${
|
|
40394
|
-
${
|
|
40395
|
-
${
|
|
40443
|
+
<code title=${folder3.source}>${folder3.name}</code>
|
|
40444
|
+
${folder3.readonly ? b`<swc-badge size="s" variant="neutral" subtle data-readonly>Read-only</swc-badge>` : A}
|
|
40445
|
+
${folder3.mounted ? b`<span class="muted" data-mounted-at>Mounted at <code>${folder3.mounted}</code></span>` : A}
|
|
40396
40446
|
</span>
|
|
40397
40447
|
${button}
|
|
40398
40448
|
</li>`;
|
|
@@ -44627,8 +44677,56 @@ var actions = {
|
|
|
44627
44677
|
"restart-agent": "Restart agent",
|
|
44628
44678
|
reload: "Reload",
|
|
44629
44679
|
"update-now": "Update now",
|
|
44630
|
-
retry: "Retry"
|
|
44631
|
-
|
|
44680
|
+
retry: "Retry",
|
|
44681
|
+
"install-beta": "Install beta",
|
|
44682
|
+
"back-to-certified": "Back to certified"
|
|
44683
|
+
};
|
|
44684
|
+
var resting = /* @__PURE__ */ new Set(["current", "installed"]);
|
|
44685
|
+
var betaLight = ["notice", "Beta installed"];
|
|
44686
|
+
var betaActions = /* @__PURE__ */ new Set(["install-beta", "back-to-certified"]);
|
|
44687
|
+
var folder = (label) => /\((\/[^)]+)\)$/.exec(label)?.[1] ?? null;
|
|
44688
|
+
var component = (label) => label.replace(/\s*\(\/[^)]+\)$/, "");
|
|
44689
|
+
function betaText(items) {
|
|
44690
|
+
const item2 = items.find((candidate) => candidate.beta);
|
|
44691
|
+
if (!item2?.beta) return null;
|
|
44692
|
+
return `${component(item2.label)} runs beta ${item2.beta.version}, not certified`;
|
|
44693
|
+
}
|
|
44694
|
+
var release2 = (npm) => npm.latest ? `${npm.latest} on npm` : "a newer release on npm";
|
|
44695
|
+
var refused2 = (npm) => npm.reason ? `not offered: ${npm.reason}` : "not offered";
|
|
44696
|
+
var sentence = (text5) => text5[0].toUpperCase() + text5.slice(1);
|
|
44697
|
+
function npmMeta(item2) {
|
|
44698
|
+
const npm = item2.npm;
|
|
44699
|
+
const tried = item2.to === npm?.latest && (!item2.beta || item2.state === "failed");
|
|
44700
|
+
const target2 = item2.to && item2.to !== item2.from && !tried ? ` \u2192 ${item2.to}` : "";
|
|
44701
|
+
if (item2.beta) return `${item2.beta.version} beta \xB7 certified ${item2.beta.certified}${target2}`;
|
|
44702
|
+
const pinned = item2.from ? `${item2.from} (certified)${target2}` : "Not installed";
|
|
44703
|
+
if (npm?.state === "offered") return `${pinned} \xB7 ${release2(npm)}, not certified`;
|
|
44704
|
+
if (npm?.state === "not-offered") return `${pinned} \xB7 ${release2(npm)}, ${refused2(npm)}`;
|
|
44705
|
+
return null;
|
|
44706
|
+
}
|
|
44707
|
+
function changed(item2, npm) {
|
|
44708
|
+
const where2 = folder(item2.label);
|
|
44709
|
+
const changes2 = npm.changes;
|
|
44710
|
+
const gated = changes2?.gated ?? [];
|
|
44711
|
+
const count2 = changes2 ? `${changes2.count} ${changes2.count === 1 ? "package changes" : "packages change"}${where2 ? ` in ${where2}` : ""}.` : "";
|
|
44712
|
+
const text5 = [
|
|
44713
|
+
item2.beta ? `${sentence(release2(npm))}, not certified.` : "",
|
|
44714
|
+
count2,
|
|
44715
|
+
gated.length === 1 ? `${gated[0]} stays at its certified version.` : "",
|
|
44716
|
+
gated.length > 1 ? `${list5(gated)} stay at their certified versions.` : ""
|
|
44717
|
+
].filter(Boolean).join(" ");
|
|
44718
|
+
return text5 || null;
|
|
44719
|
+
}
|
|
44720
|
+
function npmNote(item2) {
|
|
44721
|
+
const npm = item2.npm;
|
|
44722
|
+
if (npm?.state === "current") return "npm: no newer release";
|
|
44723
|
+
if (npm?.state === "checking") return "Checking npm\u2026";
|
|
44724
|
+
if (npm?.state === "failed") return npm.reason ?? "Couldn\u2019t check npm";
|
|
44725
|
+
if (npm?.state === "offered") return changed(item2, npm);
|
|
44726
|
+
if (npm?.state === "not-offered" && item2.beta)
|
|
44727
|
+
return `${sentence(release2(npm))}, ${refused2(npm)}`;
|
|
44728
|
+
return null;
|
|
44729
|
+
}
|
|
44632
44730
|
var running = /* @__PURE__ */ new Set(["checking", "downloading", "linking"]);
|
|
44633
44731
|
var packageStates = {
|
|
44634
44732
|
available: null,
|
|
@@ -44662,8 +44760,8 @@ function placed(item2) {
|
|
|
44662
44760
|
const installs = item2.installs ?? [];
|
|
44663
44761
|
if (!installs.length) return item2;
|
|
44664
44762
|
const version2 = item2.version ?? installs[0].version;
|
|
44665
|
-
const
|
|
44666
|
-
const state2 = item2.state === "available" ?
|
|
44763
|
+
const newer2 = item2.offered !== null && item2.offered !== version2;
|
|
44764
|
+
const state2 = item2.state === "available" ? newer2 ? "outdated" : "installed" : item2.state;
|
|
44667
44765
|
const owned = installs.some((install) => install.manager === "panel");
|
|
44668
44766
|
const hidden = new Set(owned ? ["install"] : ["install", "remove"]);
|
|
44669
44767
|
return { ...item2, version: version2, state: state2, actions: item2.actions.filter((action) => !hidden.has(action)) };
|
|
@@ -44693,11 +44791,11 @@ function requiresText(item2, all3) {
|
|
|
44693
44791
|
});
|
|
44694
44792
|
const present = needs.filter((need) => !need.missing).map((need) => need.label);
|
|
44695
44793
|
const missing = needs.filter((need) => need.missing).map((need) => need.label);
|
|
44696
|
-
const
|
|
44794
|
+
const parts3 = [
|
|
44697
44795
|
present.length ? `Uses ${list5(present)}` : "",
|
|
44698
44796
|
item2.version === null && missing.length ? `Installs ${list5(missing)} too` : ""
|
|
44699
44797
|
].filter(Boolean);
|
|
44700
|
-
return
|
|
44798
|
+
return parts3.length ? parts3.join("; ") : null;
|
|
44701
44799
|
}
|
|
44702
44800
|
var fetched = (progress) => progress.phase === "download" && (progress.bytes?.total ?? 0) > 0 ? progress.bytes : null;
|
|
44703
44801
|
var phased = (progress) => {
|
|
@@ -44712,6 +44810,62 @@ var counted = (progress, unit = "") => {
|
|
|
44712
44810
|
};
|
|
44713
44811
|
var itemBusy = (item2) => running.has(item2.state) || item2.state === "starting" || item2.progress !== null;
|
|
44714
44812
|
var packageBusy = (item2) => packageRunning.has(item2.state) || item2.progress !== null;
|
|
44813
|
+
var parts2 = (version2) => {
|
|
44814
|
+
const main2 = version2.replace(/^v/, "").split("+")[0];
|
|
44815
|
+
const dash2 = main2.indexOf("-");
|
|
44816
|
+
return dash2 < 0 ? [main2, null] : [main2.slice(0, dash2), main2.slice(dash2 + 1)];
|
|
44817
|
+
};
|
|
44818
|
+
var identifier = (a23, b13) => {
|
|
44819
|
+
const numeric = [/^\d+$/.test(a23), /^\d+$/.test(b13)];
|
|
44820
|
+
if (numeric[0] && numeric[1]) return Math.sign(Number(a23) - Number(b13));
|
|
44821
|
+
if (numeric[0] !== numeric[1]) return numeric[0] ? -1 : 1;
|
|
44822
|
+
return a23 < b13 ? -1 : a23 > b13 ? 1 : 0;
|
|
44823
|
+
};
|
|
44824
|
+
var dotted = (a23, b13) => {
|
|
44825
|
+
const left = a23.split(".");
|
|
44826
|
+
const right = b13.split(".");
|
|
44827
|
+
for (let index2 = 0; index2 < Math.min(left.length, right.length); index2++) {
|
|
44828
|
+
const order = identifier(left[index2], right[index2]);
|
|
44829
|
+
if (order) return order;
|
|
44830
|
+
}
|
|
44831
|
+
return Math.sign(left.length - right.length);
|
|
44832
|
+
};
|
|
44833
|
+
var newer = (a23, b13) => {
|
|
44834
|
+
const [coreA, preA] = parts2(a23);
|
|
44835
|
+
const [coreB, preB] = parts2(b13);
|
|
44836
|
+
const core2 = dotted(coreA, coreB);
|
|
44837
|
+
if (core2 || preA === preB) return core2;
|
|
44838
|
+
if (preA === null) return 1;
|
|
44839
|
+
return preB === null ? -1 : dotted(preA, preB);
|
|
44840
|
+
};
|
|
44841
|
+
var certBlock = /<!--\s*cert-verify\s*-->([\s\S]*?)<!--\s*\/cert-verify\s*-->/g;
|
|
44842
|
+
var notesLimit = 8192;
|
|
44843
|
+
var noted = /* @__PURE__ */ new WeakMap();
|
|
44844
|
+
function releaseNotes(release3) {
|
|
44845
|
+
const known = noted.get(release3);
|
|
44846
|
+
if (known) return known;
|
|
44847
|
+
const text5 = release3.notes ?? "";
|
|
44848
|
+
const certified = [...text5.matchAll(certBlock)].some(
|
|
44849
|
+
([, inner]) => /^certified\b/.test(inner.trim())
|
|
44850
|
+
);
|
|
44851
|
+
const lines = text5.replace(certBlock, "").trim().split("\n");
|
|
44852
|
+
const heading = /^#{1,6}\s/.test(lines[0]) && lines[0].includes(release3.version.replace(/^v/, ""));
|
|
44853
|
+
const full = lines.slice(heading ? 1 : 0).join("\n").trim();
|
|
44854
|
+
const cut = full.length > notesLimit;
|
|
44855
|
+
const head2 = full.slice(0, notesLimit);
|
|
44856
|
+
const line = head2.lastIndexOf("\n");
|
|
44857
|
+
const body4 = cut ? `${(line > notesLimit / 2 ? head2.slice(0, line) : head2).trimEnd()}\u2026` : full;
|
|
44858
|
+
const notes2 = { release: release3, body: body4, certified, cut };
|
|
44859
|
+
noted.set(release3, notes2);
|
|
44860
|
+
return notes2;
|
|
44861
|
+
}
|
|
44862
|
+
function whatsNew(releases, from, to) {
|
|
44863
|
+
if (!releases || from === null || to === null || to === from) return [];
|
|
44864
|
+
const range3 = releases.filter((release3) => newer(release3.version, from) > 0 && newer(release3.version, to) <= 0).sort((a23, b13) => newer(b13.version, a23.version)).map(releaseNotes);
|
|
44865
|
+
return range3.some((entry) => entry.body) ? range3 : [];
|
|
44866
|
+
}
|
|
44867
|
+
var secure = (url) => /^https:\/\//i.test(url);
|
|
44868
|
+
var installed2 = (releases, version2) => releases?.find((release3) => newer(release3.version, version2) === 0 && secure(release3.url));
|
|
44715
44869
|
var snapshot = (items) => new Map(items.map(({ id, state: state2, error }) => [id, { state: state2, error }]));
|
|
44716
44870
|
function settled2(failures, before, after) {
|
|
44717
44871
|
return new Map(
|
|
@@ -44783,7 +44937,9 @@ var SliccUpdates = class extends ModelElement {
|
|
|
44783
44937
|
return running2 ? "a package is installing" : null;
|
|
44784
44938
|
}
|
|
44785
44939
|
static styles = [
|
|
44940
|
+
r(link_default),
|
|
44786
44941
|
disclosureStyles,
|
|
44942
|
+
markdownCss,
|
|
44787
44943
|
i`
|
|
44788
44944
|
:host {
|
|
44789
44945
|
display: block;
|
|
@@ -44837,6 +44993,20 @@ var SliccUpdates = class extends ModelElement {
|
|
|
44837
44993
|
swc-status-light {
|
|
44838
44994
|
align-self: center;
|
|
44839
44995
|
}
|
|
44996
|
+
.title {
|
|
44997
|
+
display: flex;
|
|
44998
|
+
align-items: center;
|
|
44999
|
+
flex-wrap: wrap;
|
|
45000
|
+
gap: var(--swc-spacing-100);
|
|
45001
|
+
min-width: 0;
|
|
45002
|
+
}
|
|
45003
|
+
.npm {
|
|
45004
|
+
margin: calc(-1 * var(--swc-spacing-100)) 0 0;
|
|
45005
|
+
color: var(--swc-neutral-subdued-content-color-default);
|
|
45006
|
+
font-size: var(--swc-font-size-75);
|
|
45007
|
+
line-height: var(--swc-line-height-200);
|
|
45008
|
+
overflow-wrap: anywhere;
|
|
45009
|
+
}
|
|
44840
45010
|
.version {
|
|
44841
45011
|
font-family: var(--swc-code-font-family-stack);
|
|
44842
45012
|
}
|
|
@@ -44881,12 +45051,12 @@ var SliccUpdates = class extends ModelElement {
|
|
|
44881
45051
|
section > .hint {
|
|
44882
45052
|
margin-block-end: var(--swc-spacing-100);
|
|
44883
45053
|
}
|
|
44884
|
-
|
|
45054
|
+
.rows {
|
|
44885
45055
|
margin: 0;
|
|
44886
45056
|
padding: 0;
|
|
44887
45057
|
list-style: none;
|
|
44888
45058
|
}
|
|
44889
|
-
li {
|
|
45059
|
+
.rows > li {
|
|
44890
45060
|
display: grid;
|
|
44891
45061
|
grid-template-columns: minmax(0, 1fr) auto;
|
|
44892
45062
|
grid-template-areas: 'name buttons' 'description buttons';
|
|
@@ -44895,7 +45065,7 @@ var SliccUpdates = class extends ModelElement {
|
|
|
44895
45065
|
padding: var(--swc-spacing-200) 0;
|
|
44896
45066
|
border-bottom: var(--swc-border-width-100) solid var(--swc-gray-200);
|
|
44897
45067
|
}
|
|
44898
|
-
li > :not(.name, .buttons, .description) {
|
|
45068
|
+
.rows > li > :not(.name, .buttons, .description) {
|
|
44899
45069
|
grid-column: 1 / -1;
|
|
44900
45070
|
margin: 0;
|
|
44901
45071
|
}
|
|
@@ -44926,11 +45096,11 @@ var SliccUpdates = class extends ModelElement {
|
|
|
44926
45096
|
text-overflow: ellipsis;
|
|
44927
45097
|
white-space: nowrap;
|
|
44928
45098
|
}
|
|
44929
|
-
li .meta {
|
|
45099
|
+
.rows > li > .meta {
|
|
44930
45100
|
justify-content: flex-start;
|
|
44931
45101
|
gap: 0;
|
|
44932
45102
|
}
|
|
44933
|
-
li .meta > * + *::before {
|
|
45103
|
+
.rows > li > .meta > * + *::before {
|
|
44934
45104
|
content: '·';
|
|
44935
45105
|
margin-inline: var(--swc-spacing-100);
|
|
44936
45106
|
}
|
|
@@ -44984,6 +45154,55 @@ var SliccUpdates = class extends ModelElement {
|
|
|
44984
45154
|
.package {
|
|
44985
45155
|
color: var(--swc-neutral-subdued-content-color-default);
|
|
44986
45156
|
}
|
|
45157
|
+
.swc-Link {
|
|
45158
|
+
font-size: inherit;
|
|
45159
|
+
}
|
|
45160
|
+
.title .swc-Link {
|
|
45161
|
+
font-weight: inherit;
|
|
45162
|
+
}
|
|
45163
|
+
.installed {
|
|
45164
|
+
display: flex;
|
|
45165
|
+
flex-wrap: wrap;
|
|
45166
|
+
align-items: baseline;
|
|
45167
|
+
gap: var(--swc-spacing-200);
|
|
45168
|
+
}
|
|
45169
|
+
.releases {
|
|
45170
|
+
display: grid;
|
|
45171
|
+
grid-template-columns: minmax(0, 1fr);
|
|
45172
|
+
gap: var(--swc-spacing-400);
|
|
45173
|
+
margin-block-start: var(--swc-spacing-200);
|
|
45174
|
+
padding: var(--swc-spacing-300);
|
|
45175
|
+
border: var(--swc-border-width-100) solid transparent;
|
|
45176
|
+
background: var(--swc-background-layer-1-color);
|
|
45177
|
+
border-radius: var(--swc-corner-radius-medium-default);
|
|
45178
|
+
overflow-wrap: anywhere;
|
|
45179
|
+
}
|
|
45180
|
+
.release {
|
|
45181
|
+
min-width: 0;
|
|
45182
|
+
}
|
|
45183
|
+
.title {
|
|
45184
|
+
margin: 0;
|
|
45185
|
+
font-size: var(--swc-font-size-100);
|
|
45186
|
+
font-weight: var(--swc-bold-font-weight);
|
|
45187
|
+
color: var(--swc-heading-color);
|
|
45188
|
+
display: flex;
|
|
45189
|
+
align-items: center;
|
|
45190
|
+
flex-wrap: wrap;
|
|
45191
|
+
gap: var(--swc-spacing-100);
|
|
45192
|
+
}
|
|
45193
|
+
.cut {
|
|
45194
|
+
margin: var(--swc-spacing-100) 0 0;
|
|
45195
|
+
}
|
|
45196
|
+
.release > .markdown {
|
|
45197
|
+
margin-block-start: var(--swc-spacing-100);
|
|
45198
|
+
line-height: var(--swc-line-height-200);
|
|
45199
|
+
}
|
|
45200
|
+
.release .markdown .heading[aria-level] {
|
|
45201
|
+
font-size: var(--swc-font-size-100);
|
|
45202
|
+
font-weight: var(--swc-bold-font-weight);
|
|
45203
|
+
color: var(--swc-neutral-subdued-content-color-default);
|
|
45204
|
+
margin-block: var(--swc-spacing-200) var(--swc-spacing-75);
|
|
45205
|
+
}
|
|
44987
45206
|
@container (max-width: 480px) {
|
|
44988
45207
|
.page {
|
|
44989
45208
|
padding: var(--swc-spacing-300);
|
|
@@ -44993,7 +45212,7 @@ var SliccUpdates = class extends ModelElement {
|
|
|
44993
45212
|
flex-direction: column;
|
|
44994
45213
|
gap: var(--swc-spacing-50);
|
|
44995
45214
|
}
|
|
44996
|
-
li {
|
|
45215
|
+
.rows > li {
|
|
44997
45216
|
grid-template-areas: 'name buttons' 'description description';
|
|
44998
45217
|
}
|
|
44999
45218
|
.description {
|
|
@@ -45123,9 +45342,13 @@ var SliccUpdates = class extends ModelElement {
|
|
|
45123
45342
|
);
|
|
45124
45343
|
}
|
|
45125
45344
|
#actions(item2) {
|
|
45126
|
-
|
|
45345
|
+
const developer = typeof this.model?.updates?.setDeveloper === "function";
|
|
45346
|
+
const shown4 = item2.actions.filter(
|
|
45347
|
+
(action) => !betaActions.has(action) || developer && (action !== "install-beta" || item2.npm?.state === "offered")
|
|
45348
|
+
);
|
|
45349
|
+
if (!shown4.length) return A;
|
|
45127
45350
|
const busy = this.pending.has(item2.id);
|
|
45128
|
-
return b`<div class="actions">${
|
|
45351
|
+
return b`<div class="actions">${shown4.map(
|
|
45129
45352
|
(action) => b`<swc-button
|
|
45130
45353
|
size="m"
|
|
45131
45354
|
variant="secondary"
|
|
@@ -45142,26 +45365,67 @@ var SliccUpdates = class extends ModelElement {
|
|
|
45142
45365
|
const shown4 = date.toLocaleString("en-GB", { dateStyle: "medium", timeStyle: "short" });
|
|
45143
45366
|
return b`<span>Checked <time datetime=${date.toISOString()}>${shown4}</time></span>`;
|
|
45144
45367
|
}
|
|
45368
|
+
#whatsNew(key2, label, entries, level) {
|
|
45369
|
+
if (!entries.length) return A;
|
|
45370
|
+
return b`<details data-releases ?open=${this.#logs.has(key2)} @toggle=${this.#logs.details(key2)}>
|
|
45371
|
+
<summary data-action="whats-new">${chevron}What’s new</summary>
|
|
45372
|
+
<div class="releases">${entries.map(
|
|
45373
|
+
({
|
|
45374
|
+
release: release3,
|
|
45375
|
+
body: body4,
|
|
45376
|
+
certified,
|
|
45377
|
+
cut
|
|
45378
|
+
}) => b`<div class="release" data-version=${release3.version}>
|
|
45379
|
+
<p class="title" role="heading" aria-level=${level}>${secure(release3.url) ? b`<a class="swc-Link swc-Link--standalone" href=${release3.url} target="_blank" rel="noopener noreferrer" data-action="release-notes" aria-label=${`${label} ${release3.version} release notes`}>${release3.version}</a>` : release3.version}${certified ? b`<swc-badge size="s" variant="positive" subtle data-certified>Certified</swc-badge>` : A}</p>
|
|
45380
|
+
${body4 ? b`<div class="markdown">${markdown(body4, { strict: true, level })}</div>` : A}
|
|
45381
|
+
${cut && secure(release3.url) ? b`<p class="cut" data-cut><a class="swc-Link swc-Link--standalone" href=${release3.url} target="_blank" rel="noopener noreferrer" data-action="release-notes" aria-label=${`Read the full notes for ${label} ${release3.version}`}>Read the full notes</a></p>` : A}
|
|
45382
|
+
</div>`
|
|
45383
|
+
)}</div>
|
|
45384
|
+
</details>`;
|
|
45385
|
+
}
|
|
45386
|
+
#releaseLink(label, version2, releases, npm) {
|
|
45387
|
+
const release3 = installed2(releases, version2);
|
|
45388
|
+
if (release3) {
|
|
45389
|
+
return b`<a class="swc-Link swc-Link--standalone" href=${release3.url} target="_blank" rel="noopener noreferrer" data-action="release-notes" aria-label=${`${label} ${version2} release notes`}>Release notes</a>`;
|
|
45390
|
+
}
|
|
45391
|
+
if (!npm) return A;
|
|
45392
|
+
return b`<a class="swc-Link swc-Link--standalone" href=${`https://www.npmjs.com/package/${npm}/v/${version2}`} target="_blank" rel="noopener noreferrer" data-action="npm-page" aria-label=${`npm page for ${label} ${version2}`}>npm page</a>`;
|
|
45393
|
+
}
|
|
45394
|
+
#version(item2, meta) {
|
|
45395
|
+
const text5 = meta ? b`<span data-npm-meta>${meta}</span>` : b`<span class="version">${item2.from ?? "Not installed"}${item2.to && item2.to !== item2.from ? b` → ${item2.to}` : A}</span>`;
|
|
45396
|
+
const link2 = item2.from !== null && (item2.to === null || item2.to === item2.from) ? this.#releaseLink(item2.label, item2.from, item2.releases) : A;
|
|
45397
|
+
return link2 === A ? text5 : b`<span class="installed">${text5}${link2}</span>`;
|
|
45398
|
+
}
|
|
45145
45399
|
#item(item2) {
|
|
45146
|
-
const [variant, state2] = states[item2.state];
|
|
45400
|
+
const [variant, state2] = item2.beta && resting.has(item2.state) ? betaLight : states[item2.state];
|
|
45147
45401
|
const label = item2.state === "failed" && item2.from !== null ? "Update failed" : state2;
|
|
45148
45402
|
const error = this.failures.get(item2.id) ?? item2.error;
|
|
45403
|
+
const developer = typeof this.model?.updates?.setDeveloper === "function";
|
|
45404
|
+
const shown4 = developer ? item2 : { ...item2, npm: null };
|
|
45405
|
+
const meta = npmMeta(shown4);
|
|
45406
|
+
const note = npmNote(shown4);
|
|
45407
|
+
const ahead = shown4.npm?.state === "offered" ? shown4.npm.latest ?? null : null;
|
|
45149
45408
|
return b`<swc-divider size="s"></swc-divider>
|
|
45150
|
-
<article data-id=${item2.id} data-state=${item2.state} aria-label=${item2.label}>
|
|
45409
|
+
<article data-id=${item2.id} data-state=${item2.state} data-npm=${item2.npm?.state ?? A} aria-label=${item2.label}>
|
|
45151
45410
|
<div class="head">
|
|
45152
|
-
<
|
|
45411
|
+
<div class="title">
|
|
45412
|
+
<h2>${item2.label}</h2>
|
|
45413
|
+
${item2.beta ? b`<swc-badge size="s" variant="notice" subtle data-beta>Beta</swc-badge>` : A}
|
|
45414
|
+
</div>
|
|
45153
45415
|
<swc-status-light variant=${variant}>${label}</swc-status-light>
|
|
45154
45416
|
</div>
|
|
45155
45417
|
<div class="meta">
|
|
45156
|
-
|
|
45418
|
+
${this.#version(item2, meta)}
|
|
45157
45419
|
${item2.state === "starting" ? A : this.#checked(item2.checkedAt)}
|
|
45158
45420
|
</div>
|
|
45421
|
+
${note ? b`<p class="npm" data-npm-note>${note}</p>` : A}
|
|
45159
45422
|
${this.#progress(item2)}
|
|
45160
45423
|
${error ? b`<div class="error" role="alert">
|
|
45161
45424
|
<swc-icon-alert-triangle size="s" aria-hidden="true"></swc-icon-alert-triangle>
|
|
45162
45425
|
<span>${error}</span>
|
|
45163
45426
|
</div>` : A}
|
|
45164
45427
|
${this.#actions(item2)}
|
|
45428
|
+
${this.#whatsNew(`releases:item:${item2.id}`, item2.label, whatsNew(item2.releases, item2.from, ahead ?? item2.to), 3)}
|
|
45165
45429
|
${item2.log ? b`<details ?open=${this.#logs.has(`item:${item2.id}`)} @toggle=${this.#logs.details(`item:${item2.id}`)}><summary>${chevron}Install log</summary><pre>${item2.log}</pre></details>` : A}
|
|
45166
45430
|
</article>`;
|
|
45167
45431
|
}
|
|
@@ -45183,8 +45447,14 @@ var SliccUpdates = class extends ModelElement {
|
|
|
45183
45447
|
${elsewhere(item2).map((install) => b`<span data-install>${installText(install, item2.version)}</span>`)}
|
|
45184
45448
|
${download2 ? b`<span>${size3(item2.size)}</span>` : A}
|
|
45185
45449
|
${requires ? b`<span data-requires>${requires}</span>` : A}
|
|
45450
|
+
${this.#packageLink(item2)}
|
|
45186
45451
|
</p>`;
|
|
45187
45452
|
}
|
|
45453
|
+
#packageLink(item2) {
|
|
45454
|
+
if (item2.version === null || item2.offered !== null && item2.offered !== item2.version)
|
|
45455
|
+
return A;
|
|
45456
|
+
return b`<span>${this.#releaseLink(item2.label, item2.version, item2.releases, item2.package)}</span>`;
|
|
45457
|
+
}
|
|
45188
45458
|
#packageProgress(item2) {
|
|
45189
45459
|
const progress = item2.progress;
|
|
45190
45460
|
const phase = progress ? progress.phase === "download" ? "downloading" : "linking" : null;
|
|
@@ -45226,6 +45496,7 @@ var SliccUpdates = class extends ModelElement {
|
|
|
45226
45496
|
${item2.commands.length ? b`<p class="commands"><span class="hidden">Commands: </span>${item2.commands.map(
|
|
45227
45497
|
(command3) => b`<code>${command3}</code>`
|
|
45228
45498
|
)}</p>` : A}
|
|
45499
|
+
${this.#whatsNew(`releases:package:${item2.id}`, item2.label, whatsNew(item2.releases, item2.version, item2.offered), 4)}
|
|
45229
45500
|
${this.#packageProgress(item2)}
|
|
45230
45501
|
${error ? b`<div class="error" role="alert" data-error>
|
|
45231
45502
|
<swc-icon-alert-triangle size="s" aria-hidden="true"></swc-icon-alert-triangle>
|
|
@@ -45235,7 +45506,7 @@ var SliccUpdates = class extends ModelElement {
|
|
|
45235
45506
|
</li>`;
|
|
45236
45507
|
}
|
|
45237
45508
|
#list(items, all3, port) {
|
|
45238
|
-
return b`<ul>${c(
|
|
45509
|
+
return b`<ul class="rows">${c(
|
|
45239
45510
|
items,
|
|
45240
45511
|
(item2) => item2.id,
|
|
45241
45512
|
(item2) => this.#package(item2, all3, Boolean(port.actPackage))
|
|
@@ -45425,6 +45696,12 @@ var SliccApp = class extends ThemedElement {
|
|
|
45425
45696
|
padding-inline: var(--swc-spacing-75);
|
|
45426
45697
|
border-radius: var(--swc-corner-radius-small-default);
|
|
45427
45698
|
}
|
|
45699
|
+
.update-status {
|
|
45700
|
+
display: inline-flex;
|
|
45701
|
+
align-items: center;
|
|
45702
|
+
gap: var(--swc-spacing-75);
|
|
45703
|
+
white-space: nowrap;
|
|
45704
|
+
}
|
|
45428
45705
|
header .tabs:focus-visible {
|
|
45429
45706
|
outline: var(--swc-focus-indicator-thickness) solid var(--swc-focus-indicator-color);
|
|
45430
45707
|
}
|
|
@@ -45702,7 +45979,7 @@ var SliccApp = class extends ThemedElement {
|
|
|
45702
45979
|
}
|
|
45703
45980
|
}
|
|
45704
45981
|
}
|
|
45705
|
-
updated(
|
|
45982
|
+
updated(changed2) {
|
|
45706
45983
|
const color2 = this.color;
|
|
45707
45984
|
if (this.#painted && this.#painted !== color2) {
|
|
45708
45985
|
const root2 = this.renderRoot;
|
|
@@ -45716,7 +45993,7 @@ var SliccApp = class extends ThemedElement {
|
|
|
45716
45993
|
this.panels.quietly(() => {
|
|
45717
45994
|
const layout = this.#started !== this.screen;
|
|
45718
45995
|
if (layout) this.#start(model);
|
|
45719
|
-
else if (
|
|
45996
|
+
else if (changed2.has("model")) this.#rebind(model);
|
|
45720
45997
|
this.#updates(layout);
|
|
45721
45998
|
this.#retitle();
|
|
45722
45999
|
});
|
|
@@ -46122,13 +46399,20 @@ var SliccApp = class extends ThemedElement {
|
|
|
46122
46399
|
);
|
|
46123
46400
|
}
|
|
46124
46401
|
#updatesIndicator() {
|
|
46125
|
-
const
|
|
46126
|
-
|
|
46127
|
-
const
|
|
46128
|
-
|
|
46129
|
-
|
|
46402
|
+
const items = this.#offers("updates") ? this.model?.updates?.list() ?? [] : [];
|
|
46403
|
+
const updates = updatesStatus(items);
|
|
46404
|
+
const beta = betaText(items);
|
|
46405
|
+
if (!updates && !beta) return A;
|
|
46406
|
+
const text5 = updates ? updates[0].toUpperCase() + updates.slice(1) : null;
|
|
46407
|
+
const said = [updates, beta].filter(Boolean).join(". ");
|
|
46408
|
+
const tip = [text5, beta].filter(Boolean).join(". ");
|
|
46409
|
+
return b`<swc-action-button id="updates" quiet size="s" data-updates accessible-label=${`Install / Update: ${said}`} @click=${() => this.show("updates")}>
|
|
46410
|
+
<span class="update-status">
|
|
46411
|
+
${updates ? b`<swc-status-light size="s" variant=${updatesVariant(updates)}>${this.screen === "phone" ? A : text5}</swc-status-light>` : A}
|
|
46412
|
+
${beta ? b`<swc-badge size="s" variant="notice" subtle data-beta>Beta</swc-badge>` : A}
|
|
46413
|
+
</span>
|
|
46130
46414
|
</swc-action-button>
|
|
46131
|
-
<swc-tooltip for="updates" placement="bottom">${
|
|
46415
|
+
<swc-tooltip for="updates" placement="bottom">${tip}</swc-tooltip>`;
|
|
46132
46416
|
}
|
|
46133
46417
|
#tabsIndicator() {
|
|
46134
46418
|
const state2 = this.model?.tabs?.state();
|
|
@@ -46253,16 +46537,16 @@ function sudo(approval) {
|
|
|
46253
46537
|
var rulePaths = ["/etc/fnox", "/etc/fnox/config.toml", "/etc/slicc/secrets-policy.toml"];
|
|
46254
46538
|
var ruleParents = ["/", "/etc", "/etc/slicc"];
|
|
46255
46539
|
function absolute(cwd, word) {
|
|
46256
|
-
const
|
|
46540
|
+
const parts3 = [];
|
|
46257
46541
|
for (const part2 of `${word.startsWith("/") ? "" : cwd}/${word}`.split("/")) {
|
|
46258
|
-
if (part2 === "..")
|
|
46259
|
-
else if (part2 && part2 !== ".")
|
|
46260
|
-
const alias =
|
|
46261
|
-
if (alias?.[2] === "root")
|
|
46542
|
+
if (part2 === "..") parts3.pop();
|
|
46543
|
+
else if (part2 && part2 !== ".") parts3.push(part2);
|
|
46544
|
+
const alias = parts3.join("/").match(/^proc\/([^/]+)\/(?:task\/[^/]+\/)?(root|cwd)$/);
|
|
46545
|
+
if (alias?.[2] === "root") parts3.length = 0;
|
|
46262
46546
|
else if (alias && /^(?:self|thread-self)$/.test(alias[1]))
|
|
46263
|
-
|
|
46547
|
+
parts3.splice(0, parts3.length, ...cwd.split("/").filter(Boolean));
|
|
46264
46548
|
}
|
|
46265
|
-
return `/${
|
|
46549
|
+
return `/${parts3.join("/")}`;
|
|
46266
46550
|
}
|
|
46267
46551
|
function pattern(path2) {
|
|
46268
46552
|
const source = path2.replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*\*\//g, "").replace(/\*\*/g, "").replace(/\*/g, "[^/]*").replace(/\?/g, "[^/]").replace(/\u0001/g, "(?:.*/)?").replace(/\u0002/g, ".*");
|
|
@@ -46673,8 +46957,8 @@ var SliccApprovals = class extends ModelElement {
|
|
|
46673
46957
|
#current() {
|
|
46674
46958
|
return this.model?.approvals?.decide ? waiting2(this.model, this.now).filter(({ id }) => !this.#closed.has(id)) : [];
|
|
46675
46959
|
}
|
|
46676
|
-
willUpdate(
|
|
46677
|
-
super.willUpdate(
|
|
46960
|
+
willUpdate(changed2) {
|
|
46961
|
+
super.willUpdate(changed2);
|
|
46678
46962
|
const list6 = this.#current();
|
|
46679
46963
|
const showing = this.#showing;
|
|
46680
46964
|
if (showing && this.#pending.has(showing.id)) return;
|
|
@@ -46690,8 +46974,8 @@ var SliccApprovals = class extends ModelElement {
|
|
|
46690
46974
|
this.#armed = false;
|
|
46691
46975
|
this.#arming = setTimeout(() => this.#armed = true, this.arming);
|
|
46692
46976
|
}
|
|
46693
|
-
updated(
|
|
46694
|
-
super.updated(
|
|
46977
|
+
updated(changed2) {
|
|
46978
|
+
super.updated(changed2);
|
|
46695
46979
|
const all3 = this.model?.approvals?.list() ?? [];
|
|
46696
46980
|
this.#tick(this.isConnected && all3.length > 0);
|
|
46697
46981
|
const dialog = this.renderRoot.querySelector("dialog");
|
|
@@ -47660,8 +47944,8 @@ var SliccBrowser = class extends ModelElement {
|
|
|
47660
47944
|
this.#shown = actionPage;
|
|
47661
47945
|
if (id) this.#pulse.delete(id);
|
|
47662
47946
|
}
|
|
47663
|
-
willUpdate(
|
|
47664
|
-
super.willUpdate(
|
|
47947
|
+
willUpdate(changed2) {
|
|
47948
|
+
super.willUpdate(changed2);
|
|
47665
47949
|
const chosen = this.#chosen.value;
|
|
47666
47950
|
if (chosen === void 0 || chosen === this.#focus) return;
|
|
47667
47951
|
if (chosen === null || this.model?.browser.list().some((tab) => tab.id === chosen))
|
|
@@ -48063,11 +48347,11 @@ var layouts = [
|
|
|
48063
48347
|
["unified", "Unified"],
|
|
48064
48348
|
["split", "Split"]
|
|
48065
48349
|
];
|
|
48066
|
-
function
|
|
48350
|
+
function folder2(path2) {
|
|
48067
48351
|
return path2.slice(0, path2.lastIndexOf("/")) || "/";
|
|
48068
48352
|
}
|
|
48069
48353
|
function where(change) {
|
|
48070
|
-
const at =
|
|
48354
|
+
const at = folder2(change.path);
|
|
48071
48355
|
if (!change.repo) return at;
|
|
48072
48356
|
if (at === change.repo) return "";
|
|
48073
48357
|
return at.startsWith(`${change.repo}/`) ? at.slice(change.repo.length + 1) : at;
|
|
@@ -48098,12 +48382,12 @@ function groups(changes2) {
|
|
|
48098
48382
|
return [...byRepo];
|
|
48099
48383
|
}
|
|
48100
48384
|
function commands2(text5) {
|
|
48101
|
-
const
|
|
48102
|
-
if (
|
|
48103
|
-
const codes =
|
|
48385
|
+
const parts3 = text5.split("`").map((part2, index2) => index2 % 2 ? { code: part2 } : part2);
|
|
48386
|
+
if (parts3.length % 2 === 0) return { parts: [text5], codes: [] };
|
|
48387
|
+
const codes = parts3.flatMap(
|
|
48104
48388
|
(part2) => typeof part2 === "string" || !part2.code ? [] : [part2.code]
|
|
48105
48389
|
);
|
|
48106
|
-
return { parts:
|
|
48390
|
+
return { parts: parts3, codes: [...new Set(codes)] };
|
|
48107
48391
|
}
|
|
48108
48392
|
function errorLine(error) {
|
|
48109
48393
|
return b`<div class="error" role="status" aria-live="polite">${error ? b`<swc-icon-alert-diamond size="s" aria-hidden="true"></swc-icon-alert-diamond><span>${error}</span>` : A}</div>`;
|
|
@@ -48363,10 +48647,10 @@ var SliccChanges = class extends ModelElement {
|
|
|
48363
48647
|
}
|
|
48364
48648
|
#unavailable(text5, extra) {
|
|
48365
48649
|
const found = commands2(text5);
|
|
48366
|
-
const { parts:
|
|
48650
|
+
const { parts: parts3 } = found;
|
|
48367
48651
|
const codes = [.../* @__PURE__ */ new Set([...found.codes, ...extra])];
|
|
48368
48652
|
return b`<div class="unavailable">
|
|
48369
|
-
<p data-unavailable>${
|
|
48653
|
+
<p data-unavailable>${parts3.map((part2) => typeof part2 === "string" ? part2 : b`<code>${part2.code}</code>`)}</p>
|
|
48370
48654
|
${codes.map(
|
|
48371
48655
|
(code3) => b`<div class="command" data-command=${code3}>
|
|
48372
48656
|
<code>${breakable(code3)}</code>
|
|
@@ -48567,8 +48851,8 @@ var SliccLucide = class extends i2 {
|
|
|
48567
48851
|
this.name = "";
|
|
48568
48852
|
this.markup = "";
|
|
48569
48853
|
}
|
|
48570
|
-
willUpdate(
|
|
48571
|
-
if (!
|
|
48854
|
+
willUpdate(changed2) {
|
|
48855
|
+
if (!changed2.has("name")) return;
|
|
48572
48856
|
const name = this.name;
|
|
48573
48857
|
void icons2([name]).then((found) => {
|
|
48574
48858
|
if (this.name === name) this.markup = found[name] ?? "";
|
|
@@ -48834,10 +49118,17 @@ var SliccMemory = class extends ModelElement {
|
|
|
48834
49118
|
.row {
|
|
48835
49119
|
--lead: var(--swc-spacing-300);
|
|
48836
49120
|
--indent: calc(var(--swc-spacing-100) + var(--lead) + var(--swc-spacing-75));
|
|
49121
|
+
position: relative;
|
|
48837
49122
|
border-radius: var(--swc-corner-radius-medium-default);
|
|
48838
49123
|
}
|
|
48839
|
-
li.row + li.row {
|
|
48840
|
-
|
|
49124
|
+
li.row + li.row::before {
|
|
49125
|
+
content: '';
|
|
49126
|
+
position: absolute;
|
|
49127
|
+
inset-block-start: 0;
|
|
49128
|
+
inset-inline: 0;
|
|
49129
|
+
block-size: var(--swc-border-width-100);
|
|
49130
|
+
background: var(--swc-gray-200);
|
|
49131
|
+
pointer-events: none;
|
|
48841
49132
|
}
|
|
48842
49133
|
.row:not([data-open]):hover,
|
|
48843
49134
|
.row[data-open] .head:hover {
|
|
@@ -48894,9 +49185,12 @@ var SliccMemory = class extends ModelElement {
|
|
|
48894
49185
|
.mark {
|
|
48895
49186
|
display: inline-flex;
|
|
48896
49187
|
}
|
|
49188
|
+
.row[data-open] .head :is(.tag, .scope) {
|
|
49189
|
+
visibility: hidden;
|
|
49190
|
+
}
|
|
48897
49191
|
.content {
|
|
48898
49192
|
overflow: hidden;
|
|
48899
|
-
max-height: 2lh;
|
|
49193
|
+
max-height: calc(2lh + var(--swc-spacing-100));
|
|
48900
49194
|
margin: 0 var(--swc-spacing-100) var(--swc-spacing-100) var(--indent);
|
|
48901
49195
|
line-height: var(--swc-line-height-100);
|
|
48902
49196
|
color: var(--swc-neutral-subdued-content-color-default);
|
|
@@ -48910,7 +49204,7 @@ var SliccMemory = class extends ModelElement {
|
|
|
48910
49204
|
@supports (height: calc-size(auto, size)) {
|
|
48911
49205
|
.content {
|
|
48912
49206
|
max-height: none;
|
|
48913
|
-
height: calc-size(auto, min(size, 2lh));
|
|
49207
|
+
height: calc-size(auto, min(size, 2lh + var(--swc-spacing-100)));
|
|
48914
49208
|
transition: height var(--swc-animation-duration-100) var(--swc-animation-ease-in-out);
|
|
48915
49209
|
}
|
|
48916
49210
|
.row[data-open] .content {
|
|
@@ -48940,10 +49234,30 @@ var SliccMemory = class extends ModelElement {
|
|
|
48940
49234
|
}
|
|
48941
49235
|
.actions {
|
|
48942
49236
|
display: flex;
|
|
49237
|
+
flex-wrap: wrap;
|
|
49238
|
+
align-items: center;
|
|
48943
49239
|
justify-content: flex-end;
|
|
48944
49240
|
gap: var(--swc-spacing-75);
|
|
48945
49241
|
padding-block-start: var(--swc-spacing-100);
|
|
48946
49242
|
}
|
|
49243
|
+
.meta {
|
|
49244
|
+
display: flex;
|
|
49245
|
+
flex-wrap: wrap;
|
|
49246
|
+
align-items: center;
|
|
49247
|
+
gap: var(--swc-spacing-50) var(--swc-spacing-200);
|
|
49248
|
+
margin-inline-end: auto;
|
|
49249
|
+
font-size: var(--swc-font-size-75);
|
|
49250
|
+
}
|
|
49251
|
+
.meta .label {
|
|
49252
|
+
display: inline-flex;
|
|
49253
|
+
align-items: center;
|
|
49254
|
+
gap: var(--swc-spacing-75);
|
|
49255
|
+
}
|
|
49256
|
+
.buttons {
|
|
49257
|
+
display: flex;
|
|
49258
|
+
gap: var(--swc-spacing-75);
|
|
49259
|
+
margin-inline-start: auto;
|
|
49260
|
+
}
|
|
48947
49261
|
.actions [data-action='forget'] {
|
|
48948
49262
|
--swc-action-button-content-color-default: var(--swc-negative-content-color-default);
|
|
48949
49263
|
--swc-action-button-content-color-hover: var(--swc-negative-content-color-hover);
|
|
@@ -49038,6 +49352,12 @@ var SliccMemory = class extends ModelElement {
|
|
|
49038
49352
|
}
|
|
49039
49353
|
return marks;
|
|
49040
49354
|
}
|
|
49355
|
+
#meta(marks) {
|
|
49356
|
+
const labelled = marks.filter((mark2) => mark2.kind !== "from");
|
|
49357
|
+
return labelled.length ? b`<div class="meta">${labelled.map(
|
|
49358
|
+
(mark2) => b`<span class="label" data-label=${mark2.kind}>${mark2.icon}${mark2.label}</span>`
|
|
49359
|
+
)}</div>` : A;
|
|
49360
|
+
}
|
|
49041
49361
|
#row(memory, section) {
|
|
49042
49362
|
if (this.editing === memory.id)
|
|
49043
49363
|
return b`<li class="row" data-id=${memory.id}>${this.#form(memory)}</li>`;
|
|
@@ -49057,19 +49377,22 @@ var SliccMemory = class extends ModelElement {
|
|
|
49057
49377
|
<div class="content" id=${`content-${memory.id}`} @click=${() => open || toggle()}>
|
|
49058
49378
|
<div class="body markdown">${markdown(memory.body)}</div>
|
|
49059
49379
|
${open ? b`<div class="actions">
|
|
49380
|
+
${this.#meta(marks)}
|
|
49381
|
+
<div class="buttons">
|
|
49060
49382
|
<swc-action-button size="s" quiet data-action="edit" @click=${() => this.editing = memory.id}>
|
|
49061
49383
|
<swc-icon-edit slot="icon"></swc-icon-edit>Edit
|
|
49062
49384
|
</swc-action-button>
|
|
49063
49385
|
<swc-action-button size="s" quiet data-action="forget" @click=${(event2) => this.#forget(memory, event2.currentTarget)}>
|
|
49064
49386
|
<swc-icon-delete slot="icon"></swc-icon-delete>Forget
|
|
49065
49387
|
</swc-action-button>
|
|
49388
|
+
</div>
|
|
49066
49389
|
</div>` : A}
|
|
49067
49390
|
</div>
|
|
49068
49391
|
</li>`;
|
|
49069
49392
|
}
|
|
49070
49393
|
#scopes = [];
|
|
49071
|
-
willUpdate(
|
|
49072
|
-
super.willUpdate(
|
|
49394
|
+
willUpdate(changed2) {
|
|
49395
|
+
super.willUpdate(changed2);
|
|
49073
49396
|
const model = this.model;
|
|
49074
49397
|
this.#scopes = (model?.memory.scopes?.() ?? [
|
|
49075
49398
|
{ id: "global", label: "Shared" },
|
|
@@ -49402,24 +49725,24 @@ function changes(entry, devices) {
|
|
|
49402
49725
|
}
|
|
49403
49726
|
var listed = (items, one3) => items.map((item2, index2) => b`${index2 ? ", " : ""}${one3(item2)}`);
|
|
49404
49727
|
function endpointsLine(entry, named2 = (provider) => provider) {
|
|
49405
|
-
const
|
|
49728
|
+
const parts3 = [];
|
|
49406
49729
|
if (entry.purged?.length)
|
|
49407
|
-
|
|
49730
|
+
parts3.push(
|
|
49408
49731
|
b`<span class="part" data-part="purged">Removed custom model URLs an agent set, automatically: ${listed(entry.purged, (item2) => b`${named2(item2.provider)} at <code>${item2.host ?? item2.url}</code>`)}. Only you can set a model URL now, in Settings › Accounts</span>`
|
|
49409
49732
|
);
|
|
49410
49733
|
if (entry.adopted?.length)
|
|
49411
|
-
|
|
49734
|
+
parts3.push(
|
|
49412
49735
|
b`<span class="part" data-part="adopted">Kept the MCP servers your tokens use, automatically: ${listed(entry.adopted, (item2) => b`${item2.server} at <code>${item2.host}</code>`)}</span>`
|
|
49413
49736
|
);
|
|
49414
49737
|
if (entry.pinned)
|
|
49415
|
-
|
|
49738
|
+
parts3.push(
|
|
49416
49739
|
b`<span class="part" data-part="pinned"><code>${entry.pinned.name ?? entry.pinned.server}</code> pinned to <code>${entry.pinned.host}</code> automatically, on first use</span>`
|
|
49417
49740
|
);
|
|
49418
49741
|
if (entry.unpinned)
|
|
49419
|
-
|
|
49742
|
+
parts3.push(
|
|
49420
49743
|
b`<span class="part" data-part="unpinned"><code>${entry.unpinned.name ?? entry.unpinned.server}</code> unpinned from <code>${entry.unpinned.host}</code>; the next use pins it again</span>`
|
|
49421
49744
|
);
|
|
49422
|
-
return b`${
|
|
49745
|
+
return b`${parts3.map((part2, index2) => b`${index2 ? ". " : ""}${part2}`)}`;
|
|
49423
49746
|
}
|
|
49424
49747
|
function auditLine(entry, devices, named2) {
|
|
49425
49748
|
switch (entry.type) {
|
|
@@ -49840,10 +50163,10 @@ var SliccSecrets = class extends ThemedElement {
|
|
|
49840
50163
|
this.older = [];
|
|
49841
50164
|
this.more = null;
|
|
49842
50165
|
}
|
|
49843
|
-
willUpdate(
|
|
49844
|
-
super.willUpdate(
|
|
49845
|
-
const before =
|
|
49846
|
-
if (!
|
|
50166
|
+
willUpdate(changed2) {
|
|
50167
|
+
super.willUpdate(changed2);
|
|
50168
|
+
const before = changed2.get("model");
|
|
50169
|
+
if (!changed2.has("model") || before?.vault === this.model?.vault) return;
|
|
49847
50170
|
clearValues(this.renderRoot);
|
|
49848
50171
|
this.older = [];
|
|
49849
50172
|
this.more = null;
|
|
@@ -50332,11 +50655,11 @@ var SliccSecrets = class extends ThemedElement {
|
|
|
50332
50655
|
<ul class="secrets">${removed.map(row)}</ul>
|
|
50333
50656
|
</details>` : A}`;
|
|
50334
50657
|
}
|
|
50335
|
-
#refused(
|
|
50336
|
-
if (!
|
|
50658
|
+
#refused(refused3) {
|
|
50659
|
+
if (!refused3.length) return A;
|
|
50337
50660
|
return b`<h3 id="secrets-refused">Rules SLICC refused</h3>
|
|
50338
50661
|
<ul class="refused" aria-labelledby="secrets-refused" data-refused>
|
|
50339
|
-
${
|
|
50662
|
+
${refused3.map((item2) => b`<li data-refused-secret=${item2.secret}><span><code>${item2.secret}</code> to ${ruleLine(item2.rule)}</span><span class="muted">${item2.reason}</span></li>`)}
|
|
50340
50663
|
</ul>`;
|
|
50341
50664
|
}
|
|
50342
50665
|
#provider(id) {
|
|
@@ -50605,12 +50928,17 @@ var SliccSettings = class extends ThemedElement {
|
|
|
50605
50928
|
picking: { state: true },
|
|
50606
50929
|
adding: { state: true },
|
|
50607
50930
|
query: { state: true },
|
|
50608
|
-
filled: { state: true }
|
|
50931
|
+
filled: { state: true },
|
|
50932
|
+
developing: { state: true },
|
|
50933
|
+
developerError: { state: true }
|
|
50609
50934
|
};
|
|
50610
50935
|
#waits = new SignInWaits(() => this.requestUpdate());
|
|
50611
50936
|
#landing = null;
|
|
50612
50937
|
#away = false;
|
|
50613
50938
|
#bases = /* @__PURE__ */ new Map();
|
|
50939
|
+
#wanted = null;
|
|
50940
|
+
#developerPort;
|
|
50941
|
+
#call = 0;
|
|
50614
50942
|
#scroll = new ViewScroll(this, "settings:scroll", { scroller: () => this, rows: "[data-id]" });
|
|
50615
50943
|
constructor() {
|
|
50616
50944
|
super();
|
|
@@ -50623,6 +50951,8 @@ var SliccSettings = class extends ThemedElement {
|
|
|
50623
50951
|
this.adding = null;
|
|
50624
50952
|
this.query = "";
|
|
50625
50953
|
this.filled = /* @__PURE__ */ new Set();
|
|
50954
|
+
this.developing = false;
|
|
50955
|
+
this.developerError = null;
|
|
50626
50956
|
}
|
|
50627
50957
|
static styles = [
|
|
50628
50958
|
fieldStyles,
|
|
@@ -50746,6 +51076,21 @@ var SliccSettings = class extends ThemedElement {
|
|
|
50746
51076
|
.switched {
|
|
50747
51077
|
grid-column: 2;
|
|
50748
51078
|
}
|
|
51079
|
+
.developer {
|
|
51080
|
+
display: grid;
|
|
51081
|
+
gap: var(--swc-spacing-75);
|
|
51082
|
+
padding-block: var(--swc-spacing-75);
|
|
51083
|
+
}
|
|
51084
|
+
.toggle {
|
|
51085
|
+
display: flex;
|
|
51086
|
+
align-items: center;
|
|
51087
|
+
gap: var(--swc-spacing-100);
|
|
51088
|
+
}
|
|
51089
|
+
.developer .hint,
|
|
51090
|
+
.developer .failure {
|
|
51091
|
+
margin: 0;
|
|
51092
|
+
line-height: var(--swc-line-height-200);
|
|
51093
|
+
}
|
|
50749
51094
|
.failure,
|
|
50750
51095
|
.problem {
|
|
50751
51096
|
display: flex;
|
|
@@ -50945,8 +51290,17 @@ var SliccSettings = class extends ThemedElement {
|
|
|
50945
51290
|
update();
|
|
50946
51291
|
};
|
|
50947
51292
|
queueMicrotask(() => settleModels(model));
|
|
51293
|
+
if (model.updates !== this.#developerPort) {
|
|
51294
|
+
this.#developerPort = model.updates;
|
|
51295
|
+
this.#call += 1;
|
|
51296
|
+
this.developing = false;
|
|
51297
|
+
this.developerError = null;
|
|
51298
|
+
this.#wanted = null;
|
|
51299
|
+
}
|
|
51300
|
+
const developer = typeof model.updates?.setDeveloper === "function";
|
|
50948
51301
|
return [
|
|
50949
51302
|
...super.subscribe(model),
|
|
51303
|
+
...developer && model.updates ? [model.updates.on("items", update)] : [],
|
|
50950
51304
|
model.settings.on("settings", settle2),
|
|
50951
51305
|
model.settings.on("accounts", settle2),
|
|
50952
51306
|
model.settings.on("providers", update),
|
|
@@ -50983,6 +51337,42 @@ var SliccSettings = class extends ThemedElement {
|
|
|
50983
51337
|
#checked(event2) {
|
|
50984
51338
|
return event2.target.checked;
|
|
50985
51339
|
}
|
|
51340
|
+
async #developer(event2) {
|
|
51341
|
+
const port = this.model?.updates;
|
|
51342
|
+
const on2 = this.#checked(event2);
|
|
51343
|
+
const call = ++this.#call;
|
|
51344
|
+
this.#wanted = on2;
|
|
51345
|
+
this.developing = true;
|
|
51346
|
+
this.developerError = null;
|
|
51347
|
+
try {
|
|
51348
|
+
await port?.setDeveloper?.(on2);
|
|
51349
|
+
} catch (error) {
|
|
51350
|
+
if (call === this.#call) {
|
|
51351
|
+
this.developerError = error instanceof Error ? error.message : String(error);
|
|
51352
|
+
}
|
|
51353
|
+
} finally {
|
|
51354
|
+
if (call === this.#call) {
|
|
51355
|
+
this.#wanted = null;
|
|
51356
|
+
this.developing = false;
|
|
51357
|
+
}
|
|
51358
|
+
}
|
|
51359
|
+
}
|
|
51360
|
+
#developerRow() {
|
|
51361
|
+
const port = this.model?.updates;
|
|
51362
|
+
if (typeof port?.setDeveloper !== "function") return A;
|
|
51363
|
+
const on2 = port.developer?.() ?? false;
|
|
51364
|
+
return b`<div class="row">
|
|
51365
|
+
<span class="label">Updates</span>
|
|
51366
|
+
<div class="developer">
|
|
51367
|
+
<div class="toggle">
|
|
51368
|
+
<sp-switch .checked=${l(this.#wanted ?? on2)} ?disabled=${this.developing} aria-busy=${this.developing ? "true" : A} data-setting="developer" @change=${(event2) => void this.#developer(event2)}>Developer mode</sp-switch>
|
|
51369
|
+
${this.developing ? b`<swc-progress-circle size="s" indeterminate label="Saving developer mode" data-pending></swc-progress-circle>` : A}
|
|
51370
|
+
</div>
|
|
51371
|
+
<p class="hint">Check npm for newer releases that aren't certified yet, and offer them as betas in Install / Update.</p>
|
|
51372
|
+
${this.developerError ? b`<p class="failure" role="alert" data-error><swc-icon-alert-triangle size="s" aria-hidden="true"></swc-icon-alert-triangle><span>${this.developerError}</span></p>` : A}
|
|
51373
|
+
</div>
|
|
51374
|
+
</div>`;
|
|
51375
|
+
}
|
|
50986
51376
|
#cancelled = /* @__PURE__ */ new Set();
|
|
50987
51377
|
#busy(id, on2) {
|
|
50988
51378
|
const rest = [...this.pending].filter((candidate) => candidate !== id);
|
|
@@ -51695,10 +52085,10 @@ var SliccSettings = class extends ThemedElement {
|
|
|
51695
52085
|
this.adding = null;
|
|
51696
52086
|
this.picking = true;
|
|
51697
52087
|
}
|
|
51698
|
-
updated(
|
|
51699
|
-
super.updated(
|
|
52088
|
+
updated(changed2) {
|
|
52089
|
+
super.updated(changed2);
|
|
51700
52090
|
const dialog = this.#dialog;
|
|
51701
|
-
if (!
|
|
52091
|
+
if (!changed2.has("picking") || !dialog || dialog.open) return;
|
|
51702
52092
|
dialog.showModal();
|
|
51703
52093
|
const field = this.renderRoot.querySelector("sp-search");
|
|
51704
52094
|
void field.updateComplete.then(() => field.focus());
|
|
@@ -51945,6 +52335,7 @@ var SliccSettings = class extends ThemedElement {
|
|
|
51945
52335
|
<sp-menu-item value="split">Split</sp-menu-item>
|
|
51946
52336
|
</sp-picker>
|
|
51947
52337
|
</div>
|
|
52338
|
+
${this.#developerRow()}
|
|
51948
52339
|
</div>
|
|
51949
52340
|
<h2 data-section="accounts">Accounts</h2>
|
|
51950
52341
|
${this.#providerList(providers)}
|
|
@@ -51984,7 +52375,7 @@ function closure(found, source) {
|
|
|
51984
52375
|
return used;
|
|
51985
52376
|
}
|
|
51986
52377
|
function args(value, start2) {
|
|
51987
|
-
const
|
|
52378
|
+
const parts3 = [];
|
|
51988
52379
|
let depth = 0;
|
|
51989
52380
|
let from = start2;
|
|
51990
52381
|
let at = start2;
|
|
@@ -51994,18 +52385,18 @@ function args(value, start2) {
|
|
|
51994
52385
|
else if (char === ")" && depth === 0) break;
|
|
51995
52386
|
else if (char === ")") depth--;
|
|
51996
52387
|
else if (char === "," && depth === 0) {
|
|
51997
|
-
|
|
52388
|
+
parts3.push(value.slice(from, at));
|
|
51998
52389
|
from = at + 1;
|
|
51999
52390
|
}
|
|
52000
52391
|
}
|
|
52001
|
-
|
|
52002
|
-
return [
|
|
52392
|
+
parts3.push(value.slice(from, at));
|
|
52393
|
+
return [parts3, at];
|
|
52003
52394
|
}
|
|
52004
52395
|
function branch(value, side) {
|
|
52005
52396
|
const at = value.indexOf("light-dark(");
|
|
52006
52397
|
if (at < 0) return value;
|
|
52007
|
-
const [
|
|
52008
|
-
const picked = branch((
|
|
52398
|
+
const [parts3, end] = args(value, at + "light-dark(".length);
|
|
52399
|
+
const picked = branch((parts3[side] ?? "").trim(), side);
|
|
52009
52400
|
return value.slice(0, at) + picked + branch(value.slice(end + 1), side);
|
|
52010
52401
|
}
|
|
52011
52402
|
function frameTokens(found) {
|
|
@@ -52349,8 +52740,8 @@ var SliccSprinkle = class extends ThemedElement {
|
|
|
52349
52740
|
};
|
|
52350
52741
|
ask.call(port, id, "getState", []).then(settle2, () => settle2(null));
|
|
52351
52742
|
}
|
|
52352
|
-
willUpdate(
|
|
52353
|
-
super.willUpdate(
|
|
52743
|
+
willUpdate(changed2) {
|
|
52744
|
+
super.willUpdate(changed2);
|
|
52354
52745
|
const port = this.model?.sprinkles;
|
|
52355
52746
|
if (port?.call && (this.#held.port !== port || this.#held.id !== this.sprinkle))
|
|
52356
52747
|
this.#hold(port, port.call, this.sprinkle);
|
|
@@ -52399,8 +52790,8 @@ ${data.html}`;
|
|
|
52399
52790
|
this.#frame = { key: key2, doc: frameDocument(data.html, this.color, data.name, state2) };
|
|
52400
52791
|
return this.#frame.doc;
|
|
52401
52792
|
}
|
|
52402
|
-
updated(
|
|
52403
|
-
super.updated(
|
|
52793
|
+
updated(changed2) {
|
|
52794
|
+
super.updated(changed2);
|
|
52404
52795
|
const frame = this.renderRoot.querySelector("iframe");
|
|
52405
52796
|
frame?.contentWindow?.postMessage({ type: "slicc-theme", color: this.color }, "*");
|
|
52406
52797
|
if (frame && this.#focusLater) {
|
|
@@ -52785,13 +53176,13 @@ var SliccValueRequest = class extends ThemedElement {
|
|
|
52785
53176
|
if (this.model?.vault === vault) this.busy = false;
|
|
52786
53177
|
}
|
|
52787
53178
|
}
|
|
52788
|
-
willUpdate(
|
|
52789
|
-
super.willUpdate(
|
|
53179
|
+
willUpdate(changed2) {
|
|
53180
|
+
super.willUpdate(changed2);
|
|
52790
53181
|
const current = this.#current(this.#queue());
|
|
52791
53182
|
if ((current?.id ?? "") !== this.#shown) clearValues(this.renderRoot);
|
|
52792
53183
|
}
|
|
52793
|
-
updated(
|
|
52794
|
-
super.updated(
|
|
53184
|
+
updated(changed2) {
|
|
53185
|
+
super.updated(changed2);
|
|
52795
53186
|
const dialog = this.renderRoot.querySelector("dialog");
|
|
52796
53187
|
this.#tick(this.isConnected && !!dialog);
|
|
52797
53188
|
const key2 = dialog?.dataset.request ?? "";
|
|
@@ -57430,9 +57821,9 @@ function nameMatcher(identifers, scopes) {
|
|
|
57430
57821
|
return false;
|
|
57431
57822
|
}
|
|
57432
57823
|
let lastIndex = 0;
|
|
57433
|
-
return identifers.every((
|
|
57824
|
+
return identifers.every((identifier2) => {
|
|
57434
57825
|
for (let i26 = lastIndex; i26 < scopes.length; i26++) {
|
|
57435
|
-
if (scopesAreMatching(scopes[i26],
|
|
57826
|
+
if (scopesAreMatching(scopes[i26], identifier2)) {
|
|
57436
57827
|
lastIndex = i26 + 1;
|
|
57437
57828
|
return true;
|
|
57438
57829
|
}
|
|
@@ -58400,14 +58791,14 @@ function isSpecialTheme(theme3) {
|
|
|
58400
58791
|
var RE_NEWLINE = /(\r?\n)/g;
|
|
58401
58792
|
function splitLines(code3, preserveEnding = false) {
|
|
58402
58793
|
if (code3.length === 0) return [["", 0]];
|
|
58403
|
-
const
|
|
58794
|
+
const parts3 = code3.split(RE_NEWLINE);
|
|
58404
58795
|
let index2 = 0;
|
|
58405
58796
|
const lines = [];
|
|
58406
|
-
for (let i26 = 0; i26 <
|
|
58407
|
-
const line = preserveEnding ?
|
|
58797
|
+
for (let i26 = 0; i26 < parts3.length; i26 += 2) {
|
|
58798
|
+
const line = preserveEnding ? parts3[i26] + (parts3[i26 + 1] || "") : parts3[i26];
|
|
58408
58799
|
lines.push([line, index2]);
|
|
58409
|
-
index2 +=
|
|
58410
|
-
index2 +=
|
|
58800
|
+
index2 += parts3[i26].length;
|
|
58801
|
+
index2 += parts3[i26 + 1]?.length || 0;
|
|
58411
58802
|
}
|
|
58412
58803
|
return lines;
|
|
58413
58804
|
}
|
|
@@ -61050,7 +61441,7 @@ function element2(node2, index2, parent, state2) {
|
|
|
61050
61441
|
const schema = state2.schema;
|
|
61051
61442
|
const omit = schema.space === "svg" ? false : state2.settings.omitOptionalTags;
|
|
61052
61443
|
let selfClosing = schema.space === "svg" ? state2.settings.closeEmptyElements : state2.settings.voids.includes(node2.tagName.toLowerCase());
|
|
61053
|
-
const
|
|
61444
|
+
const parts3 = [];
|
|
61054
61445
|
let last;
|
|
61055
61446
|
if (schema.space === "html" && node2.tagName === "svg") {
|
|
61056
61447
|
state2.schema = svg3;
|
|
@@ -61062,21 +61453,21 @@ function element2(node2, index2, parent, state2) {
|
|
|
61062
61453
|
state2.schema = schema;
|
|
61063
61454
|
if (content3) selfClosing = false;
|
|
61064
61455
|
if (attributes || !omit || !opening(node2, index2, parent)) {
|
|
61065
|
-
|
|
61456
|
+
parts3.push("<", node2.tagName, attributes ? " " + attributes : "");
|
|
61066
61457
|
if (selfClosing && (schema.space === "svg" || state2.settings.closeSelfClosing)) {
|
|
61067
61458
|
last = attributes.charAt(attributes.length - 1);
|
|
61068
61459
|
if (!state2.settings.tightSelfClosing || last === "/" || last && last !== '"' && last !== "'") {
|
|
61069
|
-
|
|
61460
|
+
parts3.push(" ");
|
|
61070
61461
|
}
|
|
61071
|
-
|
|
61462
|
+
parts3.push("/");
|
|
61072
61463
|
}
|
|
61073
|
-
|
|
61464
|
+
parts3.push(">");
|
|
61074
61465
|
}
|
|
61075
|
-
|
|
61466
|
+
parts3.push(content3);
|
|
61076
61467
|
if (!selfClosing && (!omit || !closing(node2, index2, parent))) {
|
|
61077
|
-
|
|
61468
|
+
parts3.push("</" + node2.tagName + ">");
|
|
61078
61469
|
}
|
|
61079
|
-
return
|
|
61470
|
+
return parts3.join("");
|
|
61080
61471
|
}
|
|
61081
61472
|
function serializeAttributes(state2, properties) {
|
|
61082
61473
|
const values = [];
|
|
@@ -68623,8 +69014,8 @@ function getFunctionalAlpha(color2) {
|
|
|
68623
69014
|
const slashIndex = inner.lastIndexOf("/");
|
|
68624
69015
|
if (slashIndex !== -1) return inner.slice(slashIndex + 1).trim();
|
|
68625
69016
|
if (/^(?:rgba|hsla)$/i.test(fn)) {
|
|
68626
|
-
const
|
|
68627
|
-
if (
|
|
69017
|
+
const parts3 = inner.split(",");
|
|
69018
|
+
if (parts3.length === 4) return parts3[3]?.trim();
|
|
68628
69019
|
}
|
|
68629
69020
|
}
|
|
68630
69021
|
function parseHexRgba(color2) {
|
|
@@ -71808,17 +72199,17 @@ function splitAtLinePrefix(contents, prefix) {
|
|
|
71808
72199
|
${prefix}`;
|
|
71809
72200
|
const firstBoundaryIndex = contents.startsWith(prefix) ? 0 : findLinePrefixIndex(contents, newlinePrefix, 0);
|
|
71810
72201
|
if (firstBoundaryIndex === -1) return [contents];
|
|
71811
|
-
const
|
|
71812
|
-
if (firstBoundaryIndex > 0)
|
|
72202
|
+
const parts3 = [];
|
|
72203
|
+
if (firstBoundaryIndex > 0) parts3.push(contents.slice(0, firstBoundaryIndex));
|
|
71813
72204
|
let startIndex = firstBoundaryIndex;
|
|
71814
72205
|
for (; ; ) {
|
|
71815
72206
|
const nextBoundaryIndex = findLinePrefixIndex(contents, newlinePrefix, startIndex + 1);
|
|
71816
72207
|
if (nextBoundaryIndex === -1) break;
|
|
71817
|
-
|
|
72208
|
+
parts3.push(contents.slice(startIndex, nextBoundaryIndex));
|
|
71818
72209
|
startIndex = nextBoundaryIndex;
|
|
71819
72210
|
}
|
|
71820
|
-
|
|
71821
|
-
return
|
|
72211
|
+
parts3.push(contents.slice(startIndex));
|
|
72212
|
+
return parts3;
|
|
71822
72213
|
}
|
|
71823
72214
|
function findLinePrefixIndex(contents, newlinePrefix, fromIndex) {
|
|
71824
72215
|
const index2 = contents.indexOf(newlinePrefix, fromIndex);
|
|
@@ -72027,25 +72418,25 @@ var Diff = class {
|
|
|
72027
72418
|
const componentLen = components.length;
|
|
72028
72419
|
let componentPos = 0, newPos = 0, oldPos = 0;
|
|
72029
72420
|
for (; componentPos < componentLen; componentPos++) {
|
|
72030
|
-
const
|
|
72031
|
-
if (!
|
|
72032
|
-
if (!
|
|
72033
|
-
let value = newTokens.slice(newPos, newPos +
|
|
72421
|
+
const component2 = components[componentPos];
|
|
72422
|
+
if (!component2.removed) {
|
|
72423
|
+
if (!component2.added && this.useLongestToken) {
|
|
72424
|
+
let value = newTokens.slice(newPos, newPos + component2.count);
|
|
72034
72425
|
value = value.map(function(value2, i26) {
|
|
72035
72426
|
const oldValue = oldTokens[oldPos + i26];
|
|
72036
72427
|
return oldValue.length > value2.length ? oldValue : value2;
|
|
72037
72428
|
});
|
|
72038
|
-
|
|
72429
|
+
component2.value = this.join(value);
|
|
72039
72430
|
} else {
|
|
72040
|
-
|
|
72431
|
+
component2.value = this.join(newTokens.slice(newPos, newPos + component2.count));
|
|
72041
72432
|
}
|
|
72042
|
-
newPos +=
|
|
72043
|
-
if (!
|
|
72044
|
-
oldPos +=
|
|
72433
|
+
newPos += component2.count;
|
|
72434
|
+
if (!component2.added) {
|
|
72435
|
+
oldPos += component2.count;
|
|
72045
72436
|
}
|
|
72046
72437
|
} else {
|
|
72047
|
-
|
|
72048
|
-
oldPos +=
|
|
72438
|
+
component2.value = this.join(oldTokens.slice(oldPos, oldPos + component2.count));
|
|
72439
|
+
oldPos += component2.count;
|
|
72049
72440
|
}
|
|
72050
72441
|
}
|
|
72051
72442
|
return components;
|
|
@@ -72143,16 +72534,16 @@ function overlapCount(a23, b13) {
|
|
|
72143
72534
|
return k8;
|
|
72144
72535
|
}
|
|
72145
72536
|
function segment(string3, segmenter) {
|
|
72146
|
-
const
|
|
72537
|
+
const parts3 = [];
|
|
72147
72538
|
for (const segmentObj of Array.from(segmenter.segment(string3))) {
|
|
72148
72539
|
const segment2 = segmentObj.segment;
|
|
72149
|
-
if (
|
|
72150
|
-
|
|
72540
|
+
if (parts3.length && /\s/.test(parts3[parts3.length - 1]) && /\s/.test(segment2)) {
|
|
72541
|
+
parts3[parts3.length - 1] += segment2;
|
|
72151
72542
|
} else {
|
|
72152
|
-
|
|
72543
|
+
parts3.push(segment2);
|
|
72153
72544
|
}
|
|
72154
72545
|
}
|
|
72155
|
-
return
|
|
72546
|
+
return parts3;
|
|
72156
72547
|
}
|
|
72157
72548
|
function trailingWs(string3, segmenter) {
|
|
72158
72549
|
if (segmenter) {
|
|
@@ -72200,19 +72591,19 @@ var WordDiff = class extends Diff {
|
|
|
72200
72591
|
return left.trim() === right.trim();
|
|
72201
72592
|
}
|
|
72202
72593
|
tokenize(value, options2 = {}) {
|
|
72203
|
-
let
|
|
72594
|
+
let parts3;
|
|
72204
72595
|
if (options2.intlSegmenter) {
|
|
72205
72596
|
const segmenter = options2.intlSegmenter;
|
|
72206
72597
|
if (segmenter.resolvedOptions().granularity != "word") {
|
|
72207
72598
|
throw new Error('The segmenter passed must have a granularity of "word"');
|
|
72208
72599
|
}
|
|
72209
|
-
|
|
72600
|
+
parts3 = segment(value, segmenter);
|
|
72210
72601
|
} else {
|
|
72211
|
-
|
|
72602
|
+
parts3 = value.match(tokenizeIncludingWhitespace) || [];
|
|
72212
72603
|
}
|
|
72213
72604
|
const tokens = [];
|
|
72214
72605
|
let prevPart = null;
|
|
72215
|
-
|
|
72606
|
+
parts3.forEach((part2) => {
|
|
72216
72607
|
if (/\s/.test(part2)) {
|
|
72217
72608
|
if (prevPart == null) {
|
|
72218
72609
|
tokens.push(part2);
|
|
@@ -80945,8 +81336,8 @@ var DockviewApi = class {
|
|
|
80945
81336
|
get messages() {
|
|
80946
81337
|
return resolveMessages(this.component.options.messages);
|
|
80947
81338
|
}
|
|
80948
|
-
constructor(
|
|
80949
|
-
this.component =
|
|
81339
|
+
constructor(component2) {
|
|
81340
|
+
this.component = component2;
|
|
80950
81341
|
}
|
|
80951
81342
|
/**
|
|
80952
81343
|
* Focus the component. Will try to focus an active panel if one exists.
|
|
@@ -82505,10 +82896,10 @@ var PanelApiImpl = class extends CompositeDisposable {
|
|
|
82505
82896
|
get height() {
|
|
82506
82897
|
return this._height;
|
|
82507
82898
|
}
|
|
82508
|
-
constructor(id,
|
|
82899
|
+
constructor(id, component2) {
|
|
82509
82900
|
super();
|
|
82510
82901
|
this.id = id;
|
|
82511
|
-
this.component =
|
|
82902
|
+
this.component = component2;
|
|
82512
82903
|
this._isFocused = false;
|
|
82513
82904
|
this._isActive = false;
|
|
82514
82905
|
this._isVisible = true;
|
|
@@ -82576,10 +82967,10 @@ var BasePanelView = class extends CompositeDisposable {
|
|
|
82576
82967
|
var _this$_params;
|
|
82577
82968
|
return (_this$_params = this._params) === null || _this$_params === void 0 ? void 0 : _this$_params.params;
|
|
82578
82969
|
}
|
|
82579
|
-
constructor(id,
|
|
82970
|
+
constructor(id, component2, api) {
|
|
82580
82971
|
super();
|
|
82581
82972
|
this.id = id;
|
|
82582
|
-
this.component =
|
|
82973
|
+
this.component = component2;
|
|
82583
82974
|
this.api = api;
|
|
82584
82975
|
this._height = 0;
|
|
82585
82976
|
this._width = 0;
|
|
@@ -88038,8 +88429,8 @@ var DockviewGroupPanelModel = class extends CompositeDisposable {
|
|
|
88038
88429
|
}
|
|
88039
88430
|
};
|
|
88040
88431
|
var GridviewPanelApiImpl = class extends PanelApiImpl {
|
|
88041
|
-
constructor(id,
|
|
88042
|
-
super(id,
|
|
88432
|
+
constructor(id, component2, panel) {
|
|
88433
|
+
super(id, component2);
|
|
88043
88434
|
this._onDidConstraintsChangeInternal = new Emitter2();
|
|
88044
88435
|
this.onDidConstraintsChangeInternal = this._onDidConstraintsChangeInternal.event;
|
|
88045
88436
|
this._onDidConstraintsChange = new Emitter2();
|
|
@@ -88113,8 +88504,8 @@ var GridviewPanel = class extends BasePanelView {
|
|
|
88113
88504
|
get isVisible() {
|
|
88114
88505
|
return this.api.isVisible;
|
|
88115
88506
|
}
|
|
88116
|
-
constructor(id,
|
|
88117
|
-
super(id,
|
|
88507
|
+
constructor(id, component2, options2, api) {
|
|
88508
|
+
super(id, component2, api !== null && api !== void 0 ? api : new GridviewPanelApiImpl(id, component2));
|
|
88118
88509
|
this._evaluatedMinimumWidth = 0;
|
|
88119
88510
|
this._evaluatedMaximumWidth = Number.MAX_SAFE_INTEGER;
|
|
88120
88511
|
this._evaluatedMinimumHeight = 0;
|
|
@@ -88457,8 +88848,8 @@ var DockviewPanelApiImpl = class extends GridviewPanelApiImpl {
|
|
|
88457
88848
|
get tabComponent() {
|
|
88458
88849
|
return this._tabComponent;
|
|
88459
88850
|
}
|
|
88460
|
-
constructor(panel, group, accessor,
|
|
88461
|
-
super(panel.id,
|
|
88851
|
+
constructor(panel, group, accessor, component2, tabComponent) {
|
|
88852
|
+
super(panel.id, component2);
|
|
88462
88853
|
this.panel = panel;
|
|
88463
88854
|
this.accessor = accessor;
|
|
88464
88855
|
this._onDidTitleChange = new Emitter2();
|
|
@@ -88590,7 +88981,7 @@ var DockviewPanel = class extends CompositeDisposable {
|
|
|
88590
88981
|
get maximumHeight() {
|
|
88591
88982
|
return this._maximumHeight;
|
|
88592
88983
|
}
|
|
88593
|
-
constructor(id,
|
|
88984
|
+
constructor(id, component2, tabComponent, accessor, containerApi, group, view, options2) {
|
|
88594
88985
|
super();
|
|
88595
88986
|
this.id = id;
|
|
88596
88987
|
this.accessor = accessor;
|
|
@@ -88603,7 +88994,7 @@ var DockviewPanel = class extends CompositeDisposable {
|
|
|
88603
88994
|
this._minimumHeight = options2.minimumHeight;
|
|
88604
88995
|
this._maximumWidth = options2.maximumWidth;
|
|
88605
88996
|
this._maximumHeight = options2.maximumHeight;
|
|
88606
|
-
this.api = new DockviewPanelApiImpl(this, this._group, accessor,
|
|
88997
|
+
this.api = new DockviewPanelApiImpl(this, this._group, accessor, component2, tabComponent);
|
|
88607
88998
|
this.addDisposables(this.api.onActiveChange(() => {
|
|
88608
88999
|
accessor.setActivePanel(this);
|
|
88609
89000
|
}), this.api.onDidSizeChange((event2) => {
|
|
@@ -88814,11 +89205,11 @@ var DockviewPanelModel = class {
|
|
|
88814
89205
|
const name = componentName !== null && componentName !== void 0 ? componentName : this.accessor.options.defaultTabComponent;
|
|
88815
89206
|
if (name) {
|
|
88816
89207
|
if (this.accessor.options.createTabComponent) {
|
|
88817
|
-
const
|
|
89208
|
+
const component2 = this.accessor.options.createTabComponent({
|
|
88818
89209
|
id,
|
|
88819
89210
|
name
|
|
88820
89211
|
});
|
|
88821
|
-
if (
|
|
89212
|
+
if (component2) return component2;
|
|
88822
89213
|
else return new DefaultTab();
|
|
88823
89214
|
}
|
|
88824
89215
|
console.warn(`dockview: tabComponent '${componentName}' was not found. falling back to the default tab.`);
|
|
@@ -91062,10 +91453,10 @@ var DropTargetAnchorContainer = class extends CompositeDisposable {
|
|
|
91062
91453
|
},
|
|
91063
91454
|
getElements: (event2, outline) => {
|
|
91064
91455
|
this._cancelPendingClear();
|
|
91065
|
-
const
|
|
91456
|
+
const changed2 = this._outline !== outline;
|
|
91066
91457
|
this._outline = outline;
|
|
91067
91458
|
if (this._model) {
|
|
91068
|
-
this._model.changed =
|
|
91459
|
+
this._model.changed = changed2;
|
|
91069
91460
|
return this._model;
|
|
91070
91461
|
}
|
|
91071
91462
|
const container = this.createContainer();
|
|
@@ -91073,7 +91464,7 @@ var DropTargetAnchorContainer = class extends CompositeDisposable {
|
|
|
91073
91464
|
this._model = {
|
|
91074
91465
|
root: container,
|
|
91075
91466
|
overlay: anchor,
|
|
91076
|
-
changed
|
|
91467
|
+
changed: changed2
|
|
91077
91468
|
};
|
|
91078
91469
|
container.appendChild(anchor);
|
|
91079
91470
|
this.element.appendChild(container);
|
|
@@ -95113,7 +95504,7 @@ var SliccFileTree = class extends HTMLElement {
|
|
|
95113
95504
|
const item2 = tree?.getItem(path2);
|
|
95114
95505
|
return item2 && "isExpanded" in item2 ? item2.isExpanded() : null;
|
|
95115
95506
|
};
|
|
95116
|
-
const shown4 = (path2) => path2.split("/").slice(0, -2).every((_9, i26,
|
|
95507
|
+
const shown4 = (path2) => path2.split("/").slice(0, -2).every((_9, i26, parts3) => open(`${parts3.slice(0, i26 + 1).join("/")}/`) !== false);
|
|
95117
95508
|
return this.#paths.filter((path2) => path2.endsWith("/") && open(path2) === true && shown4(path2)).map((path2) => path2.slice(0, -1));
|
|
95118
95509
|
}
|
|
95119
95510
|
get gitStatus() {
|