@ai-ecoverse/slicc-spectrum 1.111.3 → 1.112.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/dist/slicc-ui.js CHANGED
@@ -10334,8 +10334,8 @@ var ranges = [
10334
10334
  [100, "bg", 8]
10335
10335
  ];
10336
10336
  function simple(code3) {
10337
- const flag2 = flags[code3];
10338
- if (flag2) return flag2;
10337
+ const flag = flags[code3];
10338
+ if (flag) return flag;
10339
10339
  const range2 = ranges.find(([start2]) => code3 >= start2 && code3 < start2 + 8);
10340
10340
  return range2 ? { [range2[1]]: code3 - range2[0] + range2[2] } : null;
10341
10341
  }
@@ -10617,8 +10617,8 @@ var Ends = class {
10617
10617
  this.#observer.disconnect();
10618
10618
  }
10619
10619
  };
10620
- function fullCommand(shown4, toggle) {
10621
- return b`<swc-action-button size="s" quiet class="full-command" data-action="full-command" data-shown=${shown4 ? "" : A} aria-expanded=${shown4 ? "true" : "false"} @click=${toggle}><swc-icon-chevron-down slot="icon" class="chevron" aria-hidden="true"></swc-icon-chevron-down>${shown4 ? "Hide the full command" : "Show the full command"}</swc-action-button>`;
10620
+ function fullCommand(shown5, toggle) {
10621
+ return b`<swc-action-button size="s" quiet class="full-command" data-action="full-command" data-shown=${shown5 ? "" : A} aria-expanded=${shown5 ? "true" : "false"} @click=${toggle}><swc-icon-chevron-down slot="icon" class="chevron" aria-hidden="true"></swc-icon-chevron-down>${shown5 ? "Hide the full command" : "Show the full command"}</swc-action-button>`;
10622
10622
  }
10623
10623
 
10624
10624
  // node_modules/@adobe/spectrum-wc/dist/components/ui-icons/ui-icons.types.js
@@ -33402,9 +33402,9 @@ function stopSigningIn(event2, handlers, account, id) {
33402
33402
  function fixButton(fix, item2, handlers, login) {
33403
33403
  const id = item2.id ?? "";
33404
33404
  const signing = login?.state === "signing-in";
33405
- const shown4 = login?.state === "connected" ? "retry" : fix;
33405
+ const shown5 = login?.state === "connected" ? "retry" : fix;
33406
33406
  const cancel = signing && login.cancel;
33407
- return b`${cancel ? b`<swc-button size="s" variant="secondary" fill-style="outline" data-action="cancel-login" @click=${(event2) => stopSigningIn(event2, handlers, item2.account, id)}>Cancel</swc-button>` : A}<swc-button size="s" variant="secondary" fill-style="outline" data-action=${shown4} ?pending=${signing} ?disabled=${handlers.readOnly} @click=${() => handlers.action(shown4, item2.id, item2.account)}>${signing ? "Signing in\u2026" : actionLabel(shown4, handlers, id)}</swc-button>`;
33407
+ return b`${cancel ? b`<swc-button size="s" variant="secondary" fill-style="outline" data-action="cancel-login" @click=${(event2) => stopSigningIn(event2, handlers, item2.account, id)}>Cancel</swc-button>` : A}<swc-button size="s" variant="secondary" fill-style="outline" data-action=${shown5} ?pending=${signing} ?disabled=${handlers.readOnly} @click=${() => handlers.action(shown5, item2.id, item2.account)}>${signing ? "Signing in\u2026" : actionLabel(shown5, handlers, id)}</swc-button>`;
33408
33408
  }
33409
33409
  function errorCard(item2, handlers) {
33410
33410
  const id = item2.id ?? "";
@@ -33439,7 +33439,7 @@ function day(at) {
33439
33439
  }
33440
33440
  var stampGap = 2 * 6e4;
33441
33441
  function stamps(messages) {
33442
- const shown4 = /* @__PURE__ */ new Set();
33442
+ const shown5 = /* @__PURE__ */ new Set();
33443
33443
  let last = -Infinity;
33444
33444
  let seen = "";
33445
33445
  for (const message of messages) {
@@ -33449,10 +33449,10 @@ function stamps(messages) {
33449
33449
  last = -Infinity;
33450
33450
  }
33451
33451
  if (message.role === "system" || message.createdAt - last < stampGap) continue;
33452
- shown4.add(message.id);
33452
+ shown5.add(message.id);
33453
33453
  last = message.createdAt;
33454
33454
  }
33455
- return shown4;
33455
+ return shown5;
33456
33456
  }
33457
33457
  function size3(bytes) {
33458
33458
  if (bytes < 1024) return `${bytes} B`;
@@ -33712,10 +33712,10 @@ function toolOnly(message, showThinking) {
33712
33712
  if (message.role === "tool") return [message.tool];
33713
33713
  if (message.role !== "assistant") return null;
33714
33714
  if (message.parts.some((entry) => entry.type === "question")) return null;
33715
- const shown4 = message.parts.filter((entry) => !silent(entry, showThinking));
33716
- if (shown4.some((entry) => entry.type !== "tool")) return null;
33717
- if (!shown4.length && message.status !== "streaming") return null;
33718
- return shown4.map((entry) => entry.tool);
33715
+ const shown5 = message.parts.filter((entry) => !silent(entry, showThinking));
33716
+ if (shown5.some((entry) => entry.type !== "tool")) return null;
33717
+ if (!shown5.length && message.status !== "streaming") return null;
33718
+ return shown5.map((entry) => entry.tool);
33719
33719
  }
33720
33720
  var attachmentIcons = {
33721
33721
  image: b`<swc-icon-file slot="thumbnail" aria-hidden="true"></swc-icon-file>`,
@@ -34006,9 +34006,9 @@ function decision(message, handlers) {
34006
34006
  const settled4 = expired || guest;
34007
34007
  const { actions: actions2, command: command3 } = decide(message, handlers, settled4);
34008
34008
  const detail = settled4 ? void 0 : handlers.detail;
34009
- const shown4 = !!detail?.has(message.id);
34010
- const more = detail ? b`<swc-action-button size="s" quiet class="detail" data-action="ask-detail" aria-expanded=${shown4 ? "true" : "false"} accessible-label=${shown4 ? "Hide details" : "Show details"} @click=${() => detail.toggle(message.id)}><swc-icon-chevron-right slot="icon" class="chevron"></swc-icon-chevron-right></swc-action-button>` : A;
34011
- return b`<swc-conversation-turn type="system" class="message decision-turn" tabindex="-1" accessible-label=${`Permission request from ${message.title}`} data-id=${message.id} data-pending=${settled4 ? A : ""} data-expired=${expired ? "" : A} data-detail=${shown4 ? "" : A} @click=${reveal} @keydown=${reveal}>
34009
+ const shown5 = !!detail?.has(message.id);
34010
+ const more = detail ? b`<swc-action-button size="s" quiet class="detail" data-action="ask-detail" aria-expanded=${shown5 ? "true" : "false"} accessible-label=${shown5 ? "Hide details" : "Show details"} @click=${() => detail.toggle(message.id)}><swc-icon-chevron-right slot="icon" class="chevron"></swc-icon-chevron-right></swc-action-button>` : A;
34011
+ return b`<swc-conversation-turn type="system" class="message decision-turn" tabindex="-1" accessible-label=${`Permission request from ${message.title}`} data-id=${message.id} data-pending=${settled4 ? A : ""} data-expired=${expired ? "" : A} data-detail=${shown5 ? "" : A} @click=${reveal} @keydown=${reveal}>
34012
34012
  <div class="decision" data-kind="approval">
34013
34013
  <div class="decision-head"><span class="who">${message.title}</span>${timer}${more}</div>
34014
34014
  <p class="decision-text">${message.text}</p>
@@ -34040,8 +34040,8 @@ function lickContent(message, body2, handlers) {
34040
34040
  const scoop = message.channel === "scoop-notify";
34041
34041
  const report = message.report;
34042
34042
  if (!scoop && !report) return b`<pre class="output">${body2}</pre>`;
34043
- const shown4 = !body2 ? A : scoop ? b`<div class="text">${markdown(body2)}</div>` : b`<pre class="output">${body2}</pre>`;
34044
- return b`<div class="report">${shown4}${report ? b`<swc-button size="s" variant="secondary" fill-style="outline" data-action="open-report" @click=${() => handlers.open(report)}>Open the report</swc-button>` : A}</div>`;
34043
+ const shown5 = !body2 ? A : scoop ? b`<div class="text">${markdown(body2)}</div>` : b`<pre class="output">${body2}</pre>`;
34044
+ return b`<div class="report">${shown5}${report ? b`<swc-button size="s" variant="secondary" fill-style="outline" data-action="open-report" @click=${() => handlers.open(report)}>Open the report</swc-button>` : A}</div>`;
34045
34045
  }
34046
34046
  function lick(message, handlers, stamp = true) {
34047
34047
  if (pendingApproval(message)) return decision(message, handlers);
@@ -36695,7 +36695,7 @@ var ModelFilter = class {
36695
36695
  items(options3) {
36696
36696
  if (options3.length <= searchable)
36697
36697
  return b`${options3.map((option2) => this.#item(option2, false))}`;
36698
- const shown4 = options3.filter((option2) => matchesModel(option2, this.#query));
36698
+ const shown5 = options3.filter((option2) => matchesModel(option2, this.#query));
36699
36699
  return b`<sp-search
36700
36700
  size="s"
36701
36701
  data-action="filter-models"
@@ -36707,8 +36707,8 @@ var ModelFilter = class {
36707
36707
  @submit=${(event2) => event2.preventDefault()}
36708
36708
  @keydown=${this.#key}
36709
36709
  ></sp-search>
36710
- ${options3.map((option2) => this.#item(option2, !shown4.includes(option2)))}
36711
- ${shown4.length ? A : b`<sp-menu-item disabled data-empty>No matching models</sp-menu-item>`}`;
36710
+ ${options3.map((option2) => this.#item(option2, !shown5.includes(option2)))}
36711
+ ${shown5.length ? A : b`<sp-menu-item disabled data-empty>No matching models</sp-menu-item>`}`;
36712
36712
  }
36713
36713
  #item(option2, hidden) {
36714
36714
  return b`<sp-menu-item value=${option2.id} ?hidden=${hidden}>${option2.label}<span slot="description">${option2.provider}</span></sp-menu-item>`;
@@ -37884,7 +37884,7 @@ var SliccChat = class _SliccChat extends ThemedElement {
37884
37884
  #items(messages, agent) {
37885
37885
  const out = [];
37886
37886
  let previous3 = "";
37887
- let shown4;
37887
+ let shown5;
37888
37888
  const model = this.model;
37889
37889
  const last = messages.at(-1);
37890
37890
  const suggestion = last?.role === "assistant" && !agent.frozen && !watchOnly(model) && !model.seat && !model.agent.busy(agent.id) ? model.agent.suggestion(agent.id) : null;
@@ -37910,8 +37910,8 @@ var SliccChat = class _SliccChat extends ThemedElement {
37910
37910
  previous3 = label;
37911
37911
  }
37912
37912
  const next = message.role === "assistant" ? message.model : void 0;
37913
- const changed2 = !!next && next !== shown4;
37914
- if (changed2) shown4 = next;
37913
+ const changed2 = !!next && next !== shown5;
37914
+ if (changed2) shown5 = next;
37915
37915
  out.push([
37916
37916
  message.id,
37917
37917
  this.#message(
@@ -39814,12 +39814,12 @@ var SliccTray = class extends ModelElement {
39814
39814
  const title2 = provider ? budgetTitle(provider, budget.window) : "";
39815
39815
  const label = `${title2 || "Budget"} ${budget.percent}%`;
39816
39816
  const line = budgetLine(status2, budget);
39817
- const shown4 = provider ? b`<span>${providerOf(provider)}<span class="window"> ${budget.window}</span> ${budget.percent}%</span>` : label;
39817
+ const shown5 = provider ? b`<span>${providerOf(provider)}<span class="window"> ${budget.window}</span> ${budget.percent}%</span>` : label;
39818
39818
  return b`${this.#item(
39819
39819
  "usage",
39820
39820
  "monitor",
39821
39821
  `${label}. ${line}`,
39822
- b`<swc-status-light size="s" variant=${budgetVariant(budget.percent)}>${shown4}</swc-status-light>`,
39822
+ b`<swc-status-light size="s" variant=${budgetVariant(budget.percent)}>${shown5}</swc-status-light>`,
39823
39823
  () => this.#open("monitor")
39824
39824
  )}
39825
39825
  <swc-tooltip for="usage" placement="bottom">${title2 ? `${title2}. ${line}` : line}</swc-tooltip>`;
@@ -40283,12 +40283,12 @@ var SliccMonitor = class extends ModelElement {
40283
40283
  </li>`;
40284
40284
  }
40285
40285
  #section(section) {
40286
- const flag2 = attention2(section);
40286
+ const flag = attention2(section);
40287
40287
  const surface2 = surfaces[section.id];
40288
40288
  const rows2 = section.rows.length > 0;
40289
- const open = rows2 && (this.expanded[section.id] ?? flag2 !== null);
40289
+ const open = rows2 && (this.expanded[section.id] ?? flag !== null);
40290
40290
  const list6 = `rows-${section.id}`;
40291
- const badge = flag2 ? b`<swc-badge size="s" variant=${flag2.variant} subtle>${flag2.text}</swc-badge>` : A;
40291
+ const badge = flag ? b`<swc-badge size="s" variant=${flag.variant} subtle>${flag.text}</swc-badge>` : A;
40292
40292
  return b`<li class="section" data-id=${section.id} data-open=${open ? "" : A}>
40293
40293
  <div class="line">
40294
40294
  <span class="caption">${rows2 ? b`<button class="toggle" aria-expanded=${open ? "true" : "false"} aria-controls=${open ? list6 : A} @click=${() => {
@@ -40886,8 +40886,8 @@ var SliccAgents = class extends ModelElement {
40886
40886
  const rows2 = ordered(list6).filter(
40887
40887
  (agent) => agent.kind === "cone" || this.#expanded.has(agent.parentId)
40888
40888
  );
40889
- const shown4 = rows2.find((agent) => agent.id === active);
40890
- const anchor = shown4 ? active : list6.find((agent) => agent.id === active)?.parentId ?? "";
40889
+ const shown5 = rows2.find((agent) => agent.id === active);
40890
+ const anchor = shown5 ? active : list6.find((agent) => agent.id === active)?.parentId ?? "";
40891
40891
  return b`<div class="list"><ul role="tree" aria-label="Cones and scoops" @keydown=${this.#keydown} @focusin=${this.#focusin} @focusout=${this.#focusout}>
40892
40892
  ${c(
40893
40893
  rows2,
@@ -44099,14 +44099,14 @@ var directions2 = /* @__PURE__ */ new Set(["left", "right", "above", "below", "w
44099
44099
  function scan(parsed, rest, positional) {
44100
44100
  for (let index2 = 0; index2 < rest.length; index2++) {
44101
44101
  const arg = rest[index2];
44102
- const flag2 = arg.startsWith("--") ? arg.slice(2) : null;
44103
- if (flag2 === "json") parsed.json = true;
44104
- else if (flag2 === "section" || flag2 !== null && directions2.has(flag2)) {
44102
+ const flag = arg.startsWith("--") ? arg.slice(2) : null;
44103
+ if (flag === "json") parsed.json = true;
44104
+ else if (flag === "section" || flag !== null && directions2.has(flag)) {
44105
44105
  const value = rest[++index2];
44106
- if (value === void 0) return `--${flag2} needs a value`;
44107
- if (flag2 === "section") parsed.section = value;
44106
+ if (value === void 0) return `--${flag} needs a value`;
44107
+ if (flag === "section") parsed.section = value;
44108
44108
  else if (parsed.place) return "give one place";
44109
- else parsed.place = { direction: flag2, ref: value };
44109
+ else parsed.place = { direction: flag, ref: value };
44110
44110
  } else if (arg.startsWith("-")) return `unknown option ${arg}`;
44111
44111
  else positional.push(arg);
44112
44112
  }
@@ -44164,13 +44164,13 @@ function resolve(panels, raw, reachable2, cone) {
44164
44164
  return found?.id ?? null;
44165
44165
  }
44166
44166
  function state(info) {
44167
- const shown4 = info.active ? "active" : info.visible ? "shown" : info.open ? "open" : "closed";
44168
- return info.busy ? `${shown4} \xB7 busy: ${info.busy}` : shown4;
44167
+ const shown5 = info.active ? "active" : info.visible ? "shown" : info.open ? "open" : "closed";
44168
+ return info.busy ? `${shown5} \xB7 busy: ${info.busy}` : shown5;
44169
44169
  }
44170
44170
  function table2(rows2) {
44171
44171
  const lines2 = [["ID", "TITLE", "STATE"], ...rows2.map((row) => [row.id, row.title, state(row)])];
44172
44172
  const widths = [0, 1].map((column) => Math.max(...lines2.map((line) => line[column].length)));
44173
- return lines2.map(([id, title2, shown4]) => `${id.padEnd(widths[0])} ${title2.padEnd(widths[1])} ${shown4}`).join("\n");
44173
+ return lines2.map(([id, title2, shown5]) => `${id.padEnd(widths[0])} ${title2.padEnd(widths[1])} ${shown5}`).join("\n");
44174
44174
  }
44175
44175
  var done = (result, note = "") => result.code === 0 ? { stdout: `${result.message}${note}
44176
44176
  `, stderr: "", code: 0 } : { stdout: "", stderr: `panel: ${result.message}
@@ -48468,17 +48468,17 @@ var SliccUpdates = class extends ModelElement {
48468
48468
  return A;
48469
48469
  }
48470
48470
  const before = this.#reached.get(key);
48471
- const shown4 = progress ? { value: Math.max(before?.value ?? 0, phased(progress)), label: count2 } : before;
48472
- if (!shown4) {
48471
+ const shown5 = progress ? { value: Math.max(before?.value ?? 0, phased(progress)), label: count2 } : before;
48472
+ if (!shown5) {
48473
48473
  return b`<swc-progress-bar size="s" indeterminate accessible-label=${accessible2}></swc-progress-bar>`;
48474
48474
  }
48475
- this.#reached.set(key, shown4);
48475
+ this.#reached.set(key, shown5);
48476
48476
  return b`<swc-progress-bar
48477
48477
  size="s"
48478
48478
  min-value="0"
48479
48479
  max-value="100"
48480
- value=${shown4.value}
48481
- value-label=${shown4.label}
48480
+ value=${shown5.value}
48481
+ value-label=${shown5.label}
48482
48482
  accessible-label=${accessible2}
48483
48483
  ></swc-progress-bar>`;
48484
48484
  }
@@ -48495,12 +48495,12 @@ var SliccUpdates = class extends ModelElement {
48495
48495
  }
48496
48496
  #actions(item2) {
48497
48497
  const developer = typeof this.model?.updates?.setDeveloper === "function";
48498
- const shown4 = item2.actions.filter(
48498
+ const shown5 = item2.actions.filter(
48499
48499
  (action) => !betaActions.has(action) || developer && (action !== "install-beta" || item2.npm?.state === "offered")
48500
48500
  );
48501
- if (!shown4.length) return A;
48501
+ if (!shown5.length) return A;
48502
48502
  const busy = this.pending.has(item2.id);
48503
- return b`<div class="actions">${shown4.map(
48503
+ return b`<div class="actions">${shown5.map(
48504
48504
  (action) => b`<swc-button
48505
48505
  size="m"
48506
48506
  variant="secondary"
@@ -48514,8 +48514,8 @@ var SliccUpdates = class extends ModelElement {
48514
48514
  #checked(at) {
48515
48515
  if (at === null) return b`<span>Not checked yet</span>`;
48516
48516
  const date = new Date(at);
48517
- const shown4 = date.toLocaleString("en-GB", { dateStyle: "medium", timeStyle: "short" });
48518
- return b`<span>Checked <time datetime=${date.toISOString()}>${shown4}</time></span>`;
48517
+ const shown5 = date.toLocaleString("en-GB", { dateStyle: "medium", timeStyle: "short" });
48518
+ return b`<span>Checked <time datetime=${date.toISOString()}>${shown5}</time></span>`;
48519
48519
  }
48520
48520
  #title({ release: release3, certified }, label) {
48521
48521
  return b`${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}`;
@@ -48567,10 +48567,10 @@ var SliccUpdates = class extends ModelElement {
48567
48567
  const label = item2.state === "failed" && item2.from !== null ? "Update failed" : state2;
48568
48568
  const error = this.failures.get(item2.id) ?? item2.error;
48569
48569
  const developer = typeof this.model?.updates?.setDeveloper === "function";
48570
- const shown4 = developer ? item2 : { ...item2, npm: null };
48571
- const meta = npmMeta(shown4);
48572
- const note = npmNote(shown4);
48573
- const ahead = shown4.npm?.state === "offered" ? shown4.npm.latest ?? null : null;
48570
+ const shown5 = developer ? item2 : { ...item2, npm: null };
48571
+ const meta = npmMeta(shown5);
48572
+ const note = npmNote(shown5);
48573
+ const ahead2 = shown5.npm?.state === "offered" ? shown5.npm.latest ?? null : null;
48574
48574
  return b`<swc-divider size="s"></swc-divider>
48575
48575
  <article data-id=${item2.id} data-state=${item2.state} data-npm=${item2.npm?.state ?? A} aria-label=${item2.label}>
48576
48576
  <div class="head">
@@ -48591,7 +48591,7 @@ var SliccUpdates = class extends ModelElement {
48591
48591
  <span>${error}</span>
48592
48592
  </div>` : A}
48593
48593
  ${this.#actions(item2)}
48594
- ${this.#whatsNew(`releases:item:${item2.id}`, item2.label, whatsNew(item2.releases, item2.from, ahead ?? item2.to), 3)}
48594
+ ${this.#whatsNew(`releases:item:${item2.id}`, item2.label, whatsNew(item2.releases, item2.from, ahead2 ?? item2.to), 3)}
48595
48595
  ${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}
48596
48596
  </article>`;
48597
48597
  }
@@ -48637,7 +48637,7 @@ var SliccUpdates = class extends ModelElement {
48637
48637
  const light = packageLight(item2);
48638
48638
  const busy = this.busy.get(item2.id);
48639
48639
  const actions2 = item2.registry ? item2.actions.filter((action) => action !== "retry") : item2.actions;
48640
- const shown4 = busy ? [busy] : act2 ? actions2 : [];
48640
+ const shown5 = busy ? [busy] : act2 ? actions2 : [];
48641
48641
  const error = this.problems.get(item2.id) ?? item2.error;
48642
48642
  const managed = managedText(item2);
48643
48643
  return b`<li data-id=${item2.id} data-state=${item2.state} data-registry=${item2.registry ?? A}>
@@ -48645,7 +48645,7 @@ var SliccUpdates = class extends ModelElement {
48645
48645
  <h3 title=${item2.package}>${item2.label}</h3>
48646
48646
  ${light ? b`<swc-status-light size="s" variant=${light[0]}>${light[1]}</swc-status-light>` : A}
48647
48647
  </div>
48648
- <div class="buttons">${shown4.map(
48648
+ <div class="buttons">${shown5.map(
48649
48649
  (action) => b`<swc-button
48650
48650
  size="s"
48651
48651
  variant="secondary"
@@ -49483,11 +49483,11 @@ var SliccApp = class extends ThemedElement {
49483
49483
  #rail(items, side) {
49484
49484
  const primary = side === "bottom" ? items.filter((item2) => phoneRail.includes(item2.id)) : items;
49485
49485
  const fit = primary.length < items.length ? Math.min(primary.length, railCapacity(this.#width, Infinity)) : railCapacity(this.#width, items.length);
49486
- const shown4 = side === "bottom" ? primary.slice(0, fit) : items;
49487
- const grouped = new Set(shown4.map((item2) => item2.cone).filter(Boolean)).size > 1;
49488
- return b`<nav class=${`rail ${side}`} aria-label=${`Panels, ${side}`} @dragover=${this.#railOver} @dragleave=${this.#railLeave} @drop=${this.#railDrop}>${shown4.map(
49489
- (item2, index2) => b`${grouped && index2 && shown4[index2 - 1].cone !== item2.cone ? b`<span class="cones" aria-hidden="true"></span>` : A}${this.#railButton(item2, side)}`
49490
- )}${this.#more(items.filter((item2) => !shown4.includes(item2)))}</nav>`;
49486
+ const shown5 = side === "bottom" ? primary.slice(0, fit) : items;
49487
+ const grouped = new Set(shown5.map((item2) => item2.cone).filter(Boolean)).size > 1;
49488
+ return b`<nav class=${`rail ${side}`} aria-label=${`Panels, ${side}`} @dragover=${this.#railOver} @dragleave=${this.#railLeave} @drop=${this.#railDrop}>${shown5.map(
49489
+ (item2, index2) => b`${grouped && index2 && shown5[index2 - 1].cone !== item2.cone ? b`<span class="cones" aria-hidden="true"></span>` : A}${this.#railButton(item2, side)}`
49490
+ )}${this.#more(items.filter((item2) => !shown5.includes(item2)))}</nav>`;
49491
49491
  }
49492
49492
  #rails() {
49493
49493
  const dock2 = this.renderRoot.querySelector("slicc-dock");
@@ -49843,26 +49843,6 @@ var readOnly = [
49843
49843
  "xxd",
49844
49844
  "yq"
49845
49845
  ];
49846
- var flag = (short2, long) => (args2) => args2.some((arg) => {
49847
- if (!arg.startsWith("--")) return /^-[^-]/.test(arg) && [...short2].some((c29) => arg.includes(c29));
49848
- const [name] = arg.slice(2).split("=");
49849
- return !!name && long.some((option2) => option2.startsWith(name));
49850
- });
49851
- var operands = (args2) => {
49852
- const end = args2.includes("--") ? args2.indexOf("--") : args2.length;
49853
- const named2 = args2.slice(0, end).filter((arg) => arg === "-" || !arg.startsWith("-"));
49854
- return named2.length + args2.slice(end + 1).length > 1;
49855
- };
49856
- var writes = {
49857
- base64: flag("o", ["output"]),
49858
- file: flag("C", ["compile"]),
49859
- find: (args2) => args2.some((arg) => /^-(?:delete|exec|execdir|ok|okdir|fls|fprint0?|fprintf)$/.test(arg)),
49860
- sort: flag("oT", ["output", "temporary-directory", "compress-program"]),
49861
- tree: flag("oR", []),
49862
- uniq: operands,
49863
- xxd: operands,
49864
- yq: flag("is", ["inplace", "in-place", "split-exp", "split-exp-file"])
49865
- };
49866
49846
  function candidates(word2) {
49867
49847
  if (word2 === "--") return [];
49868
49848
  if (word2.startsWith("--"))
@@ -49886,10 +49866,6 @@ function protects(path2, whole) {
49886
49866
  return rulePaths.some((rule) => glob.test(rule)) || top !== path2 && pattern(top).test("/etc/fnox") || whole && ruleParents.some((parent) => glob.test(parent));
49887
49867
  }
49888
49868
  var command2 = (word2) => word2.split("/").pop() ?? "";
49889
- var trusted2 = ([word2, ...args2]) => {
49890
- const name = word2.replace(/^\/(?:usr\/)?bin\/(?=[^/]+$)/, "");
49891
- return readOnly.includes(name) && !writes[name]?.(args2);
49892
- };
49893
49869
  function letter(arg, short2, takes) {
49894
49870
  for (const char of arg.slice(1)) {
49895
49871
  if (short2.includes(char)) return true;
@@ -49904,17 +49880,47 @@ var option = (short2, long, takes = "") => (args2) => args2.find((arg) => {
49904
49880
  });
49905
49881
  var outputs = (valued2) => (args2) => {
49906
49882
  const end = args2.includes("--") ? args2.indexOf("--") : args2.length;
49907
- const named2 = args2.slice(0, end).filter((arg, index2) => (arg === "-" || !arg.startsWith("-")) && !valued2.test(args2[index2 - 1]));
49883
+ const named2 = args2.slice(0, end).filter(
49884
+ (arg, index2) => (arg === "-" || !arg.startsWith("-")) && !valued2(args2[index2 - 1] ?? "")
49885
+ );
49908
49886
  return named2.length + args2.slice(end + 1).length > 1;
49909
49887
  };
49888
+ var uniqValue = (arg) => arg.startsWith("--") ? /^--(?:s|sk|ski|skip|skip-|skip-[fc][\w-]*|c|ch[\w-]*)$/.test(arg) : /^-[^-]/.test(arg) && arg.slice(1).search(/[fsw]/) === arg.length - 2;
49889
+ var xxdValue = {
49890
+ c: "ols",
49891
+ g: "roup",
49892
+ l: "en",
49893
+ n: "ame",
49894
+ o: "ffset"
49895
+ };
49896
+ function valuedXxd(letter2, rest) {
49897
+ if (letter2 === "c" && rest.startsWith("apitalize")) return false;
49898
+ if (letter2 === "R") return !rest;
49899
+ if (letter2 === "s") return !rest || rest.startsWith("kip") || rest.startsWith("eek");
49900
+ return Object.hasOwn(xxdValue, letter2) && (!rest || rest.startsWith(xxdValue[letter2]));
49901
+ }
49902
+ function xxd(args2) {
49903
+ let index2 = 0;
49904
+ for (; index2 < args2.length; index2++) {
49905
+ const arg = args2[index2];
49906
+ if (arg === "--") {
49907
+ index2++;
49908
+ break;
49909
+ }
49910
+ if (!/^-./.test(arg)) break;
49911
+ const pp = arg.startsWith("--") && arg.length > 2 ? arg.slice(1) : arg;
49912
+ if (valuedXxd(pp[1], pp.slice(2))) index2++;
49913
+ }
49914
+ return args2.length - index2 > 1;
49915
+ }
49910
49916
  var gates = {
49911
- base64: option("o", ["output"], "bwi"),
49917
+ base64: option("o", ["output"], "w"),
49912
49918
  file: option("C", ["compile"], "efFmP"),
49913
- find: writes.find,
49919
+ find: (args2) => args2.some((arg) => /^-(?:delete|exec|execdir|ok|okdir|fls|fprint0?|fprintf)$/.test(arg)),
49914
49920
  sort: option("oT", ["output", "temporary-directory", "compress-program"], "kSt"),
49915
- tree: option("oR", [], "HILPT"),
49916
- uniq: outputs(/^(?:-[^-]*[fsw]|--(?:s|sk|ski|skip|skip-|skip-[fc]\w*|c|ch\w*))$/),
49917
- xxd: outputs(/^-(?:[cglnosR]|cols|groupsize|len|name|offset|seek)$/),
49921
+ tree: option("oR", []),
49922
+ uniq: outputs(uniqValue),
49923
+ xxd,
49918
49924
  yq: option("is", ["inplace", "in-place", "split-exp", "split-exp-file"], "fIop")
49919
49925
  };
49920
49926
  var plainly = (word2) => word2.replace(/^\/(?:usr\/)?bin\/(?=[^/]+$)/, "");
@@ -49971,6 +49977,7 @@ var safe = ([word2, ...args2]) => {
49971
49977
  const name = plainly(word2);
49972
49978
  return readOnly.includes(name) && !gates[name]?.(args2);
49973
49979
  };
49980
+ var trusted2 = ([word2, ...args2]) => plainly(word2) === "xargs" ? launched(args2).every((run) => runs(run) && !Object.hasOwn(gates, plainly(run[0] ?? "echo"))) : safe([word2, ...args2]);
49974
49981
  var unseen2 = {
49975
49982
  xargs: (args2) => {
49976
49983
  const run = launched(args2).find((words2) => !runs(words2));
@@ -49992,10 +49999,18 @@ var wrappers = {
49992
49999
  timeout: ["ks", ["kill-after", "signal"], 1]
49993
50000
  };
49994
50001
  var assignment = /^[A-Za-z_]\w*(?:\[[^\]]*\])?\+?=/;
49995
- var shells = ["sh", "bash", "dash", "zsh", "ksh", "fish"];
50002
+ var shells = ["sh", "bash", "dash", "zsh", "ksh", "fish", "su", "runuser"];
50003
+ var firsts = /* @__PURE__ */ new WeakMap();
49996
50004
  function shell(words2, index2) {
49997
- const flag2 = words2[index2 - 1] === "--" ? index2 - 2 : index2 - 1;
49998
- return /^-[A-Za-z]*c[A-Za-z]*$/.test(words2[flag2] ?? "") && words2.slice(0, flag2).some((word2) => shells.includes(command2(word2)));
50005
+ const flag = words2[index2 - 1] === "--" ? index2 - 2 : index2 - 1;
50006
+ if (!/^-[A-Za-z]*c[A-Za-z]*$/.test(words2[flag] ?? "")) return false;
50007
+ if (!firsts.has(words2))
50008
+ firsts.set(
50009
+ words2,
50010
+ words2.findIndex((word2) => shells.includes(command2(word2)))
50011
+ );
50012
+ const first2 = firsts.get(words2);
50013
+ return first2 >= 0 && first2 < flag;
49999
50014
  }
50000
50015
  var escaped = /[\\$\ue124]/;
50001
50016
  function split(arg, next) {
@@ -50006,12 +50021,12 @@ function split(arg, next) {
50006
50021
  return value.length ? value.join("=") : next;
50007
50022
  }
50008
50023
  function options2(at, start2, name) {
50009
- if (at.seen.has(`${name} ${start2}`)) return;
50010
- at.seen.add(`${name} ${start2}`);
50011
50024
  const { words: words2 } = at;
50012
50025
  const [takes, long, positional] = wrappers[name];
50013
50026
  let index2 = start2;
50014
50027
  for (; words2[index2]?.startsWith("-") && (words2[index2] !== "-" || name === "env"); index2++) {
50028
+ if (at.seen.has(`${name} ${index2}`)) return;
50029
+ at.seen.add(`${name} ${index2}`);
50015
50030
  const arg = words2[index2];
50016
50031
  if (arg === "--") {
50017
50032
  index2++;
@@ -50206,11 +50221,38 @@ function tokens(segment2) {
50206
50221
  function commas(words2) {
50207
50222
  return words2.flatMap((word2) => word2.includes(",") ? [word2, ...word2.split(",")] : [word2]).filter(Boolean);
50208
50223
  }
50224
+ function ahead(words2, test) {
50225
+ const next = Array(words2.length + 1).fill(words2.length);
50226
+ for (let index2 = words2.length - 1; index2 >= 0; index2--)
50227
+ next[index2] = test(words2[index2]) ? next[index2 + 1] : index2;
50228
+ return next;
50229
+ }
50230
+ function positions2(words2) {
50231
+ const skip = ahead(
50232
+ words2,
50233
+ (word2) => assignment.test(word2) || Object.hasOwn(wrappers, command2(word2)) || /^-|^\d+$/.test(word2)
50234
+ );
50235
+ const dashes = ahead(words2, (word2) => word2.startsWith("-"));
50236
+ const at = [];
50237
+ let [runner, options3] = [-1, -1];
50238
+ for (const index2 of words2.keys()) {
50239
+ const flag = words2[index2 - 1] === "--" ? index2 - 2 : index2 - 1;
50240
+ const start2 = index2 === 0 || words2[index2] !== "--" && (words2[index2 - 1] === "-c" && shell(words2, index2) || flag > runner && runner >= 0 && index2 <= options3 && /^-[A-Za-z]*c[A-Za-z]*$/.test(words2[flag])) || at[index2 - 1] && keyword.test(words2[index2 - 1]) || at[index2 - 2] === true && words2[index2 - 2] === "function";
50241
+ at.push(start2);
50242
+ if (start2) {
50243
+ runner = skip[index2];
50244
+ options3 = dashes[runner + 1] ?? -1;
50245
+ if (!shells.includes(command2(words2[runner] ?? ""))) runner = -1;
50246
+ }
50247
+ }
50248
+ return at;
50249
+ }
50209
50250
  function scan2(words2, cwds, whole) {
50210
50251
  let cd = false;
50252
+ const at = positions2(words2);
50211
50253
  for (const [index2, word2] of words2.entries()) {
50212
50254
  let hit = null;
50213
- if (index2 === 0 || words2[index2 - 1] === "-c") {
50255
+ if (at[index2]) {
50214
50256
  cd = ["cd", "pushd"].includes(command2(word2));
50215
50257
  hit = touched2(cwds, word2, whole);
50216
50258
  } else if (!cd) hit = touched2(cwds, word2, whole);
@@ -50294,15 +50336,65 @@ function truncated(approval) {
50294
50336
  function hintOf(approval) {
50295
50337
  return approval.kind === "sudo" ? commandText(alwaysHint(approval), false) : guestAlwaysHint(approval);
50296
50338
  }
50297
- var deniedSudo = (approval) => approval.kind === "sudo" && approval.verdict?.decision === "deny";
50298
50339
  var tooLong = "This request is too long to show in full, so it can\u2019t be allowed.";
50299
50340
  function guestWaiting(approval) {
50300
50341
  return approval.kind === "guest-message" ? `${approval.requester.name}'s message to ${approval.agentName ?? "this cone"} waits for the owner's approval.` : `${approval.agentName ?? "This cone"} wants to run ${approval.tool} for ${approval.requester.name}, which waits for the owner's approval.`;
50301
50342
  }
50302
- var onceOnly = ({ once }) => once ? b`<p class="hint" data-once-only=${once}>Always allow isn’t offered: xargs adds arguments from its input, and they could include a write flag.</p>` : A;
50343
+ var levels2 = {
50344
+ 1: { name: "routine", label: "Routine." },
50345
+ 2: { name: "permissions", label: "Changes permissions." },
50346
+ 3: { name: "harm", label: "Could harm the system." }
50347
+ };
50348
+ var fits = (aligned) => aligned === void 0 ? "" : aligned ? " It fits what you asked for." : " It isn\u2019t clear it serves what you asked for.";
50349
+ function leveled(approval) {
50350
+ const level = approval.verdict?.level;
50351
+ return level === 1 || level === 2 || level === 3 ? level : null;
50352
+ }
50303
50353
  var clear = { certain: null, maybe: null, once: null };
50304
- function rulesOf(approval) {
50305
- return approval.kind === "sudo" ? secretRules(approval.command, approval.cwd) : clear;
50354
+ function legacyRules(approval) {
50355
+ return approval.kind === "sudo" && leveled(approval) === null ? secretRules(approval.command, approval.cwd) : clear;
50356
+ }
50357
+ function legacyClean(approval) {
50358
+ if (approval.kind !== "sudo") return true;
50359
+ if (approval.verdict?.decision === "deny") return false;
50360
+ const { certain: certain2, maybe, once } = legacyRules(approval);
50361
+ return !certain2 && !maybe && !once;
50362
+ }
50363
+ function legacyNotice(approval) {
50364
+ const verdict = legacyRules(approval);
50365
+ const rules = verdict.certain ?? verdict.maybe;
50366
+ if (rules)
50367
+ return b`<div class="rules" data-secret-rules=${rules}><swc-icon-alert-triangle size="s" aria-hidden="true"></swc-icon-alert-triangle><p>${verdict.certain ? b`<strong>This changes secret rules.</strong> It names <code>${commandText(rules, false)}</code>, where SLICC keeps which secrets programs may use and where they may be sent.` : b`<strong>This may change secret rules.</strong> SLICC can't tell where <code>${commandText(rules, false)}</code> leads, and it could reach the files where SLICC keeps which secrets programs may use and where they may be sent.`} Allow it only if you asked for this change.</p></div>`;
50368
+ return verdict.once && approval.kind === "sudo" && approval.always && approval.verdict?.decision !== "deny" ? b`<p class="hint" data-once-only=${verdict.once}>Always allow isn’t offered: xargs adds arguments from its input, and they could include a write flag.</p>` : A;
50369
+ }
50370
+ function offersAlways(approval) {
50371
+ return approval.kind !== "tray" && approval.always && (leveled(approval) !== null || legacyClean(approval));
50372
+ }
50373
+ function verdictNote(approval) {
50374
+ if (approval.kind !== "sudo" || offersAlways(approval)) return "";
50375
+ const level = leveled(approval);
50376
+ if (level === 2) return "Always allow isn\u2019t offered for permission changes.";
50377
+ if (!level && !approval.judging && !approval.verdict && approval.verdictError)
50378
+ return "Always allow appears only with a level 1 verdict.";
50379
+ return "";
50380
+ }
50381
+ var shown4 = (text4) => {
50382
+ const chars = Array.from(text4);
50383
+ return commandText(chars.length > 300 ? `${chars.slice(0, 299).join("")}\u2026` : text4, false);
50384
+ };
50385
+ function judged(approval) {
50386
+ const { verdict, judging, verdictError } = approval;
50387
+ const level = leveled(approval);
50388
+ if (verdict && level) {
50389
+ const { name, label } = levels2[level];
50390
+ return b`<div class="judged" data-verdict=${name} data-level=${level}>${level === 3 ? b`<swc-icon-alert-triangle size="s" aria-hidden="true"></swc-icon-alert-triangle>` : A}<p><strong>${label}</strong>${verdict.reason ? b` ${shown4(verdict.reason)}` : ""}${fits(verdict.aligned)}</p></div>`;
50391
+ }
50392
+ if (judging) return b`<div class="judged" data-verdict="checking"><p>Checking…</p></div>`;
50393
+ if (verdict?.decision)
50394
+ return b`<p class="verdict" data-verdict=${verdict.decision}>${verdict.decision === "unsure" ? "The automatic check wasn\u2019t sure" : `The automatic check would ${verdict.decision} this`}: ${shown4(verdict.reason)}</p>`;
50395
+ if (verdictError)
50396
+ return b`<div class="judged" data-verdict="none"><p><strong>No verdict:</strong> ${shown4(verdictError)}</p></div>`;
50397
+ return A;
50306
50398
  }
50307
50399
  function waiting2(model, now) {
50308
50400
  return [...model?.approvals?.list() ?? []].filter((approval) => approval.expiresAt > now && Object.hasOwn(titles, approval.kind)).sort((a20, b10) => a20.createdAt - b10.createdAt);
@@ -50476,6 +50568,39 @@ var SliccApprovals = class extends ModelElement {
50476
50568
  font-family: var(--swc-code-font-family-stack);
50477
50569
  overflow-wrap: anywhere;
50478
50570
  }
50571
+ .judged {
50572
+ display: flex;
50573
+ align-items: flex-start;
50574
+ gap: var(--swc-spacing-100);
50575
+ margin-block-start: var(--swc-spacing-200);
50576
+ padding: var(--swc-spacing-200) var(--swc-spacing-300);
50577
+ border-radius: var(--swc-corner-radius-medium-default);
50578
+ background: var(--swc-neutral-subtle-background-color-default);
50579
+ color: var(--swc-neutral-content-color-default);
50580
+ font-size: var(--swc-font-size-75);
50581
+ overflow-wrap: anywhere;
50582
+ }
50583
+ .judged[data-verdict='checking'],
50584
+ .judged[data-verdict='none'] {
50585
+ color: var(--swc-neutral-subdued-content-color-default);
50586
+ }
50587
+ .judged[data-level='1'] {
50588
+ background: var(--swc-positive-subtle-background-color-default);
50589
+ }
50590
+ .judged[data-level='2'] {
50591
+ background: var(--swc-notice-subtle-background-color-default);
50592
+ }
50593
+ .judged[data-level='3'] {
50594
+ background: var(--swc-negative-subtle-background-color-default);
50595
+ --swc-icon-color: var(--swc-icon-color-negative);
50596
+ }
50597
+ .judged swc-icon-alert-triangle {
50598
+ flex: none;
50599
+ margin-block-start: 0.15em;
50600
+ }
50601
+ .judged p {
50602
+ margin: 0;
50603
+ }
50479
50604
  .problem {
50480
50605
  display: flex;
50481
50606
  align-items: flex-start;
@@ -50536,10 +50661,8 @@ var SliccApprovals = class extends ModelElement {
50536
50661
  const port = this.model?.approvals;
50537
50662
  if (!port?.decide || this.busy || decision2 !== "deny" && (!this.#armed || !this.#whole(approval)))
50538
50663
  return;
50539
- const verdict = rulesOf(approval);
50540
- const always = approval.kind === "sudo" || approval.kind !== "tray" && approval.always;
50541
- if (decision2 === "always" && (!always || deniedSudo(approval) || verdict.certain || verdict.maybe || verdict.once))
50542
- return;
50664
+ const live = port.list().find(({ id }) => id === approval.id);
50665
+ if (decision2 === "always" && !(live && offersAlways(live))) return;
50543
50666
  this.busy = decision2;
50544
50667
  this.failure = null;
50545
50668
  this.#pending.add(approval.id);
@@ -50667,8 +50790,9 @@ var SliccApprovals = class extends ModelElement {
50667
50790
  ${files.length ? b`<ul class="files" data-attachments>${files.map((file) => b`<li>${file.name} · ${file.mimeType} · ${size3(file.size)}</li>`)}</ul>` : A}`;
50668
50791
  }
50669
50792
  #verdict(approval) {
50670
- const verdict = approval.kind === "tray" ? void 0 : approval.verdict;
50671
- return verdict ? b`<p class="verdict" data-verdict=${verdict.decision}>${verdict.decision === "unsure" ? "The automatic check wasn\u2019t sure" : `The automatic check would ${verdict.decision} this`}: ${verdict.reason}</p>` : A;
50793
+ if (approval.kind === "tray") return A;
50794
+ const note = verdictNote(approval);
50795
+ return b`<div class="judge" aria-live="polite">${judged(approval)}${note ? b`<p class="hint" data-verdict-note>${note}</p>` : A}</div>`;
50672
50796
  }
50673
50797
  #actions(approval, rejected, always) {
50674
50798
  if (rejected)
@@ -50676,10 +50800,7 @@ var SliccApprovals = class extends ModelElement {
50676
50800
  const whole = this.#whole(approval);
50677
50801
  return b`${this.#button(approval, "deny", "Deny", "secondary")}
50678
50802
  ${whole && always ? this.#button(approval, "always", inCwd(approval) ? "Always allow in this directory" : "Always allow", "secondary") : A}
50679
- ${whole ? this.#button(approval, "once", deniedSudo(approval) ? "Allow anyway (once)" : "Allow once", "accent") : A}`;
50680
- }
50681
- #offered(approval, rules) {
50682
- return approval.kind !== "tray" && approval.always && !deniedSudo(approval) && !rules;
50803
+ ${whole ? this.#button(approval, "once", "Allow once", "accent") : A}`;
50683
50804
  }
50684
50805
  render() {
50685
50806
  if (this.gone) {
@@ -50700,10 +50821,7 @@ var SliccApprovals = class extends ModelElement {
50700
50821
  const [approval, ...rest] = held2 ? [held2, ...list6.filter(({ id }) => id !== held2.id)] : list6;
50701
50822
  if (!approval) return A;
50702
50823
  const failure3 = this.failure?.id === approval.id ? this.failure.message : "";
50703
- const verdict = rulesOf(approval);
50704
- const rules = verdict.certain ?? verdict.maybe;
50705
- const offered = this.#offered(approval, rules);
50706
- const always = offered && !verdict.once;
50824
+ const always = offersAlways(approval);
50707
50825
  const gate = this.#gate(approval);
50708
50826
  const hint2 = always && this.#whole(approval) ? hintOf(approval) : "";
50709
50827
  return this.#dialog(
@@ -50714,8 +50832,7 @@ var SliccApprovals = class extends ModelElement {
50714
50832
  ${this.#request(approval, true)}
50715
50833
  ${approval.kind === "sudo" && approval.cwd ? b`<p class="cwd">In ${commandText(approval.cwd, false)}</p>` : A}
50716
50834
  ${this.#verdict(approval)}
50717
- ${rules ? b`<div class="rules" data-secret-rules=${rules}><swc-icon-alert-triangle size="s" aria-hidden="true"></swc-icon-alert-triangle><p>${verdict.certain ? b`<strong>This changes secret rules.</strong> It names <code>${commandText(rules, false)}</code>, where SLICC keeps which secrets programs may use and where they may be sent.` : b`<strong>This may change secret rules.</strong> SLICC can't tell where <code>${commandText(rules, false)}</code> leads, and it could reach the files where SLICC keeps which secrets programs may use and where they may be sent.`} Allow it only if you asked for this change.</p></div>` : A}
50718
- ${offered ? onceOnly(verdict) : A}
50835
+ ${legacyNotice(approval)}
50719
50836
  ${hint2 ? b`<p class="hint">${hint2}</p>` : A}
50720
50837
  ${!failure3 && gate ? b`<p class="hint" data-allow-hint>${gate}</p>` : A}
50721
50838
  ${failure3 ? b`<p class="problem" role="alert" data-error><swc-icon-alert-triangle size="s" aria-hidden="true"></swc-icon-alert-triangle><span>${failure3}</span></p>` : b`<p class="timer" data-timer>Denied automatically in ${countdown(approval.expiresAt - this.now)}.</p>`}
@@ -52456,7 +52573,7 @@ var SliccDiffPanel = class extends ThemedElement {
52456
52573
  // src/app/lucide.ts
52457
52574
  var library = null;
52458
52575
  function load2() {
52459
- library ??= import("./chunk-2UI4FYPN.js");
52576
+ library ??= import("./chunk-GIS2QBSN.js");
52460
52577
  return library;
52461
52578
  }
52462
52579
  function pascal(name) {
@@ -53063,11 +53180,11 @@ var SliccMemory = class extends ModelElement {
53063
53180
  const scopes = this.#scopes;
53064
53181
  const scope = this.scope;
53065
53182
  const option2 = (item2) => b`<sp-menu-item value=${item2.id}>${item2.label}</sp-menu-item>`;
53066
- const shown4 = visible2(all2, scope, this.tag, this.query);
53183
+ const shown5 = visible2(all2, scope, this.tag, this.query);
53067
53184
  const total = inScope(all2, scope);
53068
53185
  const filtered = this.tag !== "all" || this.query.trim() !== "";
53069
53186
  const current = scopes.find((item2) => item2.id === scope) ?? null;
53070
- return b`<div class="bar"><span>${shown4.length} of ${total} memories</span><span class="spacer"></span>
53187
+ return b`<div class="bar"><span>${shown5.length} of ${total} memories</span><span class="spacer"></span>
53071
53188
  <swc-action-button size="s" quiet data-action="remember" @click=${() => this.editing = "new"}><swc-icon-add slot="icon"></swc-icon-add>Remember</swc-action-button>
53072
53189
  </div>
53073
53190
  <div class="tools">
@@ -53090,7 +53207,7 @@ var SliccMemory = class extends ModelElement {
53090
53207
  </div>
53091
53208
  <div class="list">
53092
53209
  ${this.editing === "new" ? b`<div class="row">${this.#form({ scope: scope === everyone ? "global" : scope })}</div>` : A}
53093
- ${shown4.length ? sections(shown4).map(
53210
+ ${shown5.length ? sections(shown5).map(
53094
53211
  ([section, items]) => b`<section><h3>${section}</h3><ul>${items.map((memory) => this.#row(memory, section))}</ul></section>`
53095
53212
  ) : b`<div class="note">${emptyNote(total, filtered, current)}</div>`}
53096
53213
  </div>`;
@@ -54165,8 +54282,8 @@ var SliccSecrets = class extends ThemedElement {
54165
54282
  const before = entries[entries.length - 1]?.seq;
54166
54283
  const page = await vault.audit(before);
54167
54284
  if (this.model?.vault !== vault || !this.isConnected) return;
54168
- const shown4 = merged(vault.list()?.audit ?? [], this.older);
54169
- if (shown4[shown4.length - 1]?.seq !== before) return;
54285
+ const shown5 = merged(vault.list()?.audit ?? [], this.older);
54286
+ if (shown5[shown5.length - 1]?.seq !== before) return;
54170
54287
  this.older = merged(this.older, page.audit);
54171
54288
  this.more = page.more;
54172
54289
  } catch (error) {
@@ -54395,7 +54512,7 @@ var SliccSecrets = class extends ThemedElement {
54395
54512
  </li>`;
54396
54513
  }
54397
54514
  #audit(vault, list6, entries, devices) {
54398
- const shown4 = this.reveals ? entries.filter((entry) => entry.type === "materialize") : entries;
54515
+ const shown5 = this.reveals ? entries.filter((entry) => entry.type === "materialize") : entries;
54399
54516
  const more = this.more ?? list6.auditMore;
54400
54517
  const back = returned(entries);
54401
54518
  return b`<div class="audit-head">
@@ -54404,7 +54521,7 @@ var SliccSecrets = class extends ThemedElement {
54404
54521
  this.reveals = event2.target.checked;
54405
54522
  }}>Only reveals to programs</sp-switch>
54406
54523
  </div>
54407
- ${shown4.length ? b`<ol class="audit" aria-labelledby="secrets-audit">${shown4.map((entry) => this.#entry(entry, devices, vault, entries, back))}</ol>` : b`<p class="muted" data-audit-empty>${this.reveals ? more ? "No reveals in the activity loaded so far." : "No program has been given a secret." : "Nothing has used a secret yet."}</p>`}
54524
+ ${shown5.length ? b`<ol class="audit" aria-labelledby="secrets-audit">${shown5.map((entry) => this.#entry(entry, devices, vault, entries, back))}</ol>` : b`<p class="muted" data-audit-empty>${this.reveals ? more ? "No reveals in the activity loaded so far." : "No program has been given a secret." : "Nothing has used a secret yet."}</p>`}
54408
54525
  ${more ? b`<div class="row"><swc-button size="s" variant="secondary" fill-style="outline" data-action="older" ?pending=${this.loading} @click=${() => this.showOlder(vault, entries)}>Show older</swc-button></div>` : A}`;
54409
54526
  }
54410
54527
  #feedback() {
@@ -57536,10 +57653,10 @@ var SliccValueRequest = class extends ThemedElement {
57536
57653
  if (!vault || !request2) return A;
57537
57654
  const locked = !!vault.status()?.locked;
57538
57655
  const rest = queue.length - 1;
57539
- const shown4 = this.problem?.id === request2.id ? this.problem : null;
57540
- const problem = shown4?.text ?? "";
57541
- const name = this.#aria("name", shown4);
57542
- const field3 = this.#aria("value", shown4);
57656
+ const shown5 = this.problem?.id === request2.id ? this.problem : null;
57657
+ const problem = shown5?.text ?? "";
57658
+ const name = this.#aria("name", shown5);
57659
+ const field3 = this.#aria("value", shown5);
57543
57660
  return i23(
57544
57661
  request2.id,
57545
57662
  b`<dialog role="alertdialog" aria-labelledby="title" aria-describedby="asked" data-request=${request2.id} @cancel=${(event2) => {
@@ -64694,9 +64811,9 @@ var TabReorderController = class extends CompositeDisposable {
64694
64811
  else this._animState.currentInsertionIndex = null;
64695
64812
  }
64696
64813
  snapshotTabPositions() {
64697
- const positions2 = /* @__PURE__ */ new Map();
64698
- for (const tab of this._tabs) positions2.set(tab.value.panel.id, tab.value.element.getBoundingClientRect());
64699
- return positions2;
64814
+ const positions3 = /* @__PURE__ */ new Map();
64815
+ for (const tab of this._tabs) positions3.set(tab.value.panel.id, tab.value.element.getBoundingClientRect());
64816
+ return positions3;
64700
64817
  }
64701
64818
  /** Main-axis extent of a rect for this header's orientation. */
64702
64819
  _mainAxisSize(rect) {
@@ -75810,13 +75927,13 @@ function ensureChildIdByNameId(nodes, index2) {
75810
75927
  }
75811
75928
  function ensureChildPositions(index2) {
75812
75929
  if (index2.childPositionById != null) return index2.childPositionById;
75813
- const positions2 = /* @__PURE__ */ new Map();
75930
+ const positions3 = /* @__PURE__ */ new Map();
75814
75931
  for (let i26 = 0; i26 < index2.childIds.length; i26++) {
75815
75932
  const childId = index2.childIds[i26];
75816
- if (childId != null) positions2.set(childId, i26);
75933
+ if (childId != null) positions3.set(childId, i26);
75817
75934
  }
75818
- index2.childPositionById = positions2;
75819
- return positions2;
75935
+ index2.childPositionById = positions3;
75936
+ return positions3;
75820
75937
  }
75821
75938
  function appendChildReference(index2, childId) {
75822
75939
  if (index2.childPositionById != null) index2.childPositionById.set(childId, index2.childIds.length);
@@ -75955,11 +76072,11 @@ function isDirectoryNode(node2) {
75955
76072
  function getNodeFlags(node2) {
75956
76073
  return node2.depthAndFlags & PATH_STORE_NODE_FLAGS_MASK;
75957
76074
  }
75958
- function hasNodeFlag(node2, flag2) {
75959
- return (getNodeFlags(node2) & flag2) !== 0;
76075
+ function hasNodeFlag(node2, flag) {
76076
+ return (getNodeFlags(node2) & flag) !== 0;
75960
76077
  }
75961
- function addNodeFlag(node2, flag2) {
75962
- node2.depthAndFlags |= flag2;
76078
+ function addNodeFlag(node2, flag) {
76079
+ node2.depthAndFlags |= flag;
75963
76080
  }
75964
76081
  function setNodeDepth(node2, depth) {
75965
76082
  node2.depthAndFlags = createNodeDepthAndFlags(depth, getNodeFlags(node2), getNodeKind(node2));
@@ -77468,10 +77585,10 @@ function insertChildReference(state2, parentId, childId) {
77468
77585
  }
77469
77586
  function removeChildReference(state2, parentId, childId, childNameId) {
77470
77587
  const parentIndex = getDirectoryIndex(state2, parentId);
77471
- const positions2 = ensureChildPositions(parentIndex);
77472
- const childIndex = positions2.get(childId) ?? -1;
77588
+ const positions3 = ensureChildPositions(parentIndex);
77589
+ const childIndex = positions3.get(childId) ?? -1;
77473
77590
  ensureChildIdByNameId(state2.snapshot.nodes, parentIndex).delete(childNameId);
77474
- positions2.delete(childId);
77591
+ positions3.delete(childId);
77475
77592
  const childNode = state2.snapshot.nodes[childId];
77476
77593
  if (childNode != null) applyChildAggregateDelta(parentIndex, childId, -childNode.subtreeNodeCount, -childNode.visibleSubtreeCount);
77477
77594
  if (childIndex >= 0) {
@@ -84463,8 +84580,8 @@ var SliccFileTree = class extends HTMLElement {
84463
84580
  const item2 = tree?.getItem(path2);
84464
84581
  return item2 && "isExpanded" in item2 ? item2.isExpanded() : null;
84465
84582
  };
84466
- const shown4 = (path2) => path2.split("/").slice(0, -2).every((_7, i26, parts3) => open(`${parts3.slice(0, i26 + 1).join("/")}/`) !== false);
84467
- return this.#paths.filter((path2) => path2.endsWith("/") && open(path2) === true && shown4(path2)).map((path2) => path2.slice(0, -1));
84583
+ const shown5 = (path2) => path2.split("/").slice(0, -2).every((_7, i26, parts3) => open(`${parts3.slice(0, i26 + 1).join("/")}/`) !== false);
84584
+ return this.#paths.filter((path2) => path2.endsWith("/") && open(path2) === true && shown5(path2)).map((path2) => path2.slice(0, -1));
84468
84585
  }
84469
84586
  get gitStatus() {
84470
84587
  return this.#status;