@ai-ecoverse/slicc-spectrum 1.35.0 → 1.37.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
@@ -8636,6 +8636,9 @@ var ModelElement = class extends i2 {
8636
8636
  this.#off = [];
8637
8637
  }
8638
8638
  };
8639
+ function changesOf(model) {
8640
+ return model.changes ?? model.files;
8641
+ }
8639
8642
  function resolveColor(scheme, prefersDark) {
8640
8643
  if (scheme === "system") return prefersDark ? "dark" : "light";
8641
8644
  return scheme;
@@ -9240,6 +9243,11 @@ var dialogStyles = i`
9240
9243
  --mod-alert-dialog-description-to-buttons: var(--swc-spacing-500);
9241
9244
  --system-alert-dialog-divider-background-color: transparent;
9242
9245
  }
9246
+ @media (max-width: 512px) {
9247
+ sp-alert-dialog {
9248
+ --mod-alert-dialog-min-width: calc(100vw - 2 * var(--swc-spacing-300));
9249
+ }
9250
+ }
9243
9251
  p {
9244
9252
  margin: 0;
9245
9253
  }
@@ -9253,7 +9261,7 @@ var dialogStyles = i`
9253
9261
  }
9254
9262
  `;
9255
9263
  var SliccConfirm = class extends i2 {
9256
- static properties = { heading: {}, body: {}, action: {}, variant: {} };
9264
+ static properties = { heading: {}, body: {}, action: {}, variant: {}, cancel: {} };
9257
9265
  trigger = null;
9258
9266
  #result = Promise.withResolvers();
9259
9267
  constructor() {
@@ -9262,6 +9270,7 @@ var SliccConfirm = class extends i2 {
9262
9270
  this.body = "";
9263
9271
  this.action = "";
9264
9272
  this.variant = "destructive";
9273
+ this.cancel = "Cancel";
9265
9274
  }
9266
9275
  static styles = dialogStyles;
9267
9276
  get result() {
@@ -9290,7 +9299,7 @@ var SliccConfirm = class extends i2 {
9290
9299
  <sp-alert-dialog variant=${this.variant}>
9291
9300
  <h2 id="title" slot="heading">${this.heading}</h2>
9292
9301
  <p id="body">${this.body}</p>
9293
- <swc-button slot="button" variant="secondary" fill-style="outline" data-cancel @click=${() => this.#dialog.close()}>Cancel</swc-button>
9302
+ <swc-button slot="button" variant="secondary" fill-style="outline" data-cancel @click=${() => this.#dialog.close()}>${this.cancel}</swc-button>
9294
9303
  <swc-button
9295
9304
  slot="button"
9296
9305
  variant=${this.variant === "destructive" ? "negative" : "accent"}
@@ -9309,6 +9318,7 @@ function confirm(options) {
9309
9318
  element2.body = options.body;
9310
9319
  element2.action = options.action;
9311
9320
  element2.variant = options.variant ?? "destructive";
9321
+ element2.cancel = options.cancel ?? "Cancel";
9312
9322
  element2.trigger = trigger2;
9313
9323
  themeOf(trigger2).append(element2);
9314
9324
  return element2.result;
@@ -9992,6 +10002,9 @@ function agentName(model, id) {
9992
10002
  if (!id) return "you";
9993
10003
  return model?.agent.list().find((agent) => agent.id === id)?.name ?? id;
9994
10004
  }
10005
+ function author(model, change) {
10006
+ return change.agentId === null && change.repo ? null : agentName(model, change.agentId);
10007
+ }
9995
10008
  function request(target, type, path) {
9996
10009
  target.dispatchEvent(new CustomEvent(type, { detail: { path }, bubbles: true, composed: true }));
9997
10010
  }
@@ -10074,6 +10087,25 @@ function statusMark(status2, announce = true) {
10074
10087
  function failure(error) {
10075
10088
  return error instanceof Error ? error.message : String(error);
10076
10089
  }
10090
+ var errorCss = i`
10091
+ .error {
10092
+ display: flex;
10093
+ align-items: flex-start;
10094
+ gap: var(--swc-spacing-75);
10095
+ flex: none;
10096
+ color: var(--swc-negative-content-color-default);
10097
+ background: var(--swc-background-layer-1-color);
10098
+ white-space: normal;
10099
+ }
10100
+ .error:not(:empty) {
10101
+ padding: var(--swc-spacing-75) var(--swc-spacing-100) var(--swc-spacing-75) var(--swc-spacing-200);
10102
+ border-bottom: var(--swc-border-width-100) solid var(--swc-gray-200);
10103
+ }
10104
+ .error swc-icon-alert-diamond {
10105
+ flex: none;
10106
+ color: var(--swc-negative-content-color-default);
10107
+ }
10108
+ `;
10077
10109
  var SliccFiles = class extends ModelElement {
10078
10110
  static properties = {
10079
10111
  ...ModelElement.properties,
@@ -10101,6 +10133,7 @@ var SliccFiles = class extends ModelElement {
10101
10133
  static styles = [
10102
10134
  shared,
10103
10135
  panelCss,
10136
+ errorCss,
10104
10137
  i`
10105
10138
  :host {
10106
10139
  container-type: inline-size;
@@ -10117,23 +10150,6 @@ var SliccFiles = class extends ModelElement {
10117
10150
  .mount {
10118
10151
  flex: none;
10119
10152
  }
10120
- .error {
10121
- display: flex;
10122
- align-items: flex-start;
10123
- gap: var(--swc-spacing-75);
10124
- flex: none;
10125
- color: var(--swc-negative-content-color-default);
10126
- background: var(--swc-background-layer-1-color);
10127
- white-space: normal;
10128
- }
10129
- .error:not(:empty) {
10130
- padding: var(--swc-spacing-75) var(--swc-spacing-100) var(--swc-spacing-75) var(--swc-spacing-200);
10131
- border-bottom: var(--swc-border-width-100) solid var(--swc-gray-200);
10132
- }
10133
- .error swc-icon-alert-diamond {
10134
- flex: none;
10135
- color: var(--swc-negative-content-color-default);
10136
- }
10137
10153
  .mounts {
10138
10154
  flex: none;
10139
10155
  display: flex;
@@ -10190,7 +10206,7 @@ var SliccFiles = class extends ModelElement {
10190
10206
  this.#mounts(model.files);
10191
10207
  return [
10192
10208
  model.files.on("files", (entries) => this.#load(entries)),
10193
- model.files.on("changes", () => this.#sync()),
10209
+ changesOf(model).on("changes", () => this.#sync()),
10194
10210
  model.files.on("mounts", () => this.#mounts(model.files))
10195
10211
  ];
10196
10212
  }
@@ -10212,7 +10228,7 @@ var SliccFiles = class extends ModelElement {
10212
10228
  }
10213
10229
  #sync() {
10214
10230
  const tree = this.#tree();
10215
- const changes = this.model?.files.changes() ?? [];
10231
+ const changes = this.model ? changesOf(this.model).changes() : [];
10216
10232
  if (!tree) return;
10217
10233
  if (tree.paths.length === 0) tree.expanded = ancestors(changes.map((change) => change.path));
10218
10234
  tree.paths = treePaths(this.#entries);
@@ -10457,7 +10473,7 @@ var SliccFileView = class extends ThemedElement {
10457
10473
  model.files.on("file", (path) => {
10458
10474
  if (path === this.path) void this.#read(model);
10459
10475
  }),
10460
- model.files.on("changes", () => this.requestUpdate())
10476
+ changesOf(model).on("changes", () => this.requestUpdate())
10461
10477
  ];
10462
10478
  }
10463
10479
  async #read(model) {
@@ -10470,12 +10486,14 @@ var SliccFileView = class extends ThemedElement {
10470
10486
  }
10471
10487
  }
10472
10488
  render() {
10473
- const change = this.model?.files.changes().find((candidate) => candidate.path === this.path);
10489
+ const port = this.model ? changesOf(this.model) : null;
10490
+ const change = port && !port.unavailable?.() ? port.changes().find((candidate) => candidate.path === this.path) : void 0;
10491
+ const by = change && author(this.model, change);
10474
10492
  return b`<div class="bar">
10475
10493
  <span class="path" title=${this.path}>${this.path}</span>
10476
10494
  <span class="spacer"></span>
10477
10495
  ${change ? b`${statusMark(change.status, false)}
10478
- <span>${statusLabels[change.status]} by ${agentName(this.model, change.agentId)}</span>
10496
+ <span>${by ? `${statusLabels[change.status]} by ${by}` : statusLabels[change.status]}</span>
10479
10497
  <swc-action-button size="s" quiet @click=${() => request(this, "open-diff", this.path)}>
10480
10498
  <swc-icon-compare slot="icon"></swc-icon-compare>Diff
10481
10499
  </swc-action-button>` : A}
@@ -10599,8 +10617,12 @@ var routes = {
10599
10617
  var automation = {
10600
10618
  extension: "Browser automation: through the SLICC extension.",
10601
10619
  proxy: "Browser automation: through slicc-node.",
10602
- none: "Browser automation: not available. Install the extension or run slicc-node."
10620
+ none: "Browser automation: not available. Install the extension or run slicc-node.",
10621
+ declined: "Browser automation: off for this session. You declined it; reload to be asked again."
10603
10622
  };
10623
+ function automationOf(browser) {
10624
+ return browser.declined ? "declined" : browser.via ?? "none";
10625
+ }
10604
10626
  function networkLabel(status2) {
10605
10627
  return `Network: ${networkHealth[status2.health][1].toLowerCase()}`;
10606
10628
  }
@@ -10660,9 +10682,8 @@ var SliccNetwork = class extends ModelElement {
10660
10682
  margin: 0 auto;
10661
10683
  box-sizing: border-box;
10662
10684
  }
10663
- .page:focus-visible {
10664
- outline: var(--swc-focus-indicator-thickness) solid var(--swc-focus-indicator-color);
10665
- outline-offset: calc(-1 * var(--swc-focus-indicator-thickness));
10685
+ .page:focus {
10686
+ outline: none;
10666
10687
  }
10667
10688
  section {
10668
10689
  display: grid;
@@ -10831,7 +10852,7 @@ var SliccNetwork = class extends ModelElement {
10831
10852
  </div>
10832
10853
  <p data-route=${status2.route ?? "none"}>${routes[status2.route ?? "none"]}</p>
10833
10854
  ${status2.detail ? b`<p class="detail">${status2.detail}</p>` : A}
10834
- ${status2.browser ? b`<p data-browser=${status2.browser.via ?? "none"}>${automation[status2.browser.via ?? "none"]}${status2.browser.detail ? b` <span class="detail">${status2.browser.detail}</span>` : A}</p>` : A}
10855
+ ${status2.browser ? b`<p data-browser=${automationOf(status2.browser)} class=${status2.browser.declined ? "muted" : ""}>${automation[automationOf(status2.browser)]}${status2.browser.detail ? b` <span class="detail">${status2.browser.detail}</span>` : A}</p>` : A}
10835
10856
  ${this.model?.network?.check ? b`<div class="actions"><swc-button size="m" variant="secondary" data-action="check" ?pending=${this.checking} @click=${() => this.check()}>Check again</swc-button></div>` : A}
10836
10857
  ${this.error ? b`<div class="error" role="alert"><swc-icon-alert-triangle size="s" aria-hidden="true"></swc-icon-alert-triangle><span>${this.error}</span></div>` : A}
10837
10858
  </section>`;
@@ -14476,6 +14497,7 @@ e25("swc-progress-bar", o56);
14476
14497
  var states = {
14477
14498
  current: ["neutral", "Up to date"],
14478
14499
  queued: ["neutral", "Waiting"],
14500
+ starting: ["info", "Starting"],
14479
14501
  checking: ["info", "Checking"],
14480
14502
  downloading: ["info", "Downloading"],
14481
14503
  linking: ["info", "Linking"],
@@ -14506,7 +14528,7 @@ function updatesStatus(items) {
14506
14528
  if (items.some((item2) => item2.state === "ready" || item2.state === "available")) {
14507
14529
  return "update ready";
14508
14530
  }
14509
- return null;
14531
+ return items.some((item2) => item2.state === "starting") ? "starting" : null;
14510
14532
  }
14511
14533
  var UpdateVisibility = class {
14512
14534
  #boot;
@@ -14557,9 +14579,8 @@ var SliccUpdates = class extends ModelElement {
14557
14579
  padding: var(--swc-spacing-400);
14558
14580
  margin: 0 auto;
14559
14581
  }
14560
- .page:focus-visible {
14561
- outline: var(--swc-focus-indicator-thickness) solid var(--swc-focus-indicator-color);
14562
- outline-offset: calc(-1 * var(--swc-focus-indicator-thickness));
14582
+ .page:focus {
14583
+ outline: none;
14563
14584
  }
14564
14585
  .hint {
14565
14586
  margin: 0 0 var(--swc-spacing-300);
@@ -14711,7 +14732,7 @@ var SliccUpdates = class extends ModelElement {
14711
14732
  accessible-label=${`${item2.label}: ${progress.phase === "download" ? "downloading" : "linking"}`}
14712
14733
  ></swc-progress-bar>`;
14713
14734
  }
14714
- if (!running.has(item2.state)) return A;
14735
+ if (!running.has(item2.state) && item2.state !== "starting") return A;
14715
14736
  return b`<swc-progress-bar
14716
14737
  size="s"
14717
14738
  indeterminate
@@ -14750,7 +14771,7 @@ var SliccUpdates = class extends ModelElement {
14750
14771
  </div>
14751
14772
  <div class="meta">
14752
14773
  <span class="version">${item2.from ?? "Not installed"}${item2.to && item2.to !== item2.from ? b` → ${item2.to}` : A}</span>
14753
- ${this.#checked(item2.checkedAt)}
14774
+ ${item2.state === "starting" ? A : this.#checked(item2.checkedAt)}
14754
14775
  </div>
14755
14776
  ${this.#progress(item2)}
14756
14777
  ${error ? b`<div class="error" role="alert">
@@ -14796,6 +14817,7 @@ function railCapacity(width, count) {
14796
14817
  function updatesVariant(status2) {
14797
14818
  if (status2.endsWith("failed")) return "negative";
14798
14819
  if (status2.startsWith("updating")) return "info";
14820
+ if (status2 === "starting") return "neutral";
14799
14821
  return "notice";
14800
14822
  }
14801
14823
  var overscrollLocks = /* @__PURE__ */ new WeakMap();
@@ -14981,7 +15003,7 @@ var SliccApp = class extends ThemedElement {
14981
15003
  margin-inline-end: var(--swc-spacing-200);
14982
15004
  }
14983
15005
  :host([screen='phone']) header sp-picker {
14984
- min-width: 0;
15006
+ min-width: calc(var(--swc-spacing-400) * 4);
14985
15007
  width: 0;
14986
15008
  flex: 1;
14987
15009
  }
@@ -15033,7 +15055,7 @@ var SliccApp = class extends ThemedElement {
15033
15055
  }
15034
15056
  update();
15035
15057
  }),
15036
- model.files.on("changes", update),
15058
+ changesOf(model).on("changes", update),
15037
15059
  model.terminals.on("terminals", () => {
15038
15060
  this.#prune();
15039
15061
  update();
@@ -15120,10 +15142,12 @@ var SliccApp = class extends ThemedElement {
15120
15142
  if (!port || !this.#offers("updates")) return;
15121
15143
  const change = this.#updatesVisibility?.change(port, layout);
15122
15144
  if (change === "open") {
15123
- if (this.dock.has("updates")) this.dock.reveal("updates");
15124
- else {
15125
- this.show("updates");
15126
- if (!port.ready()) this.dock.api.getPanel("updates")?.api.updateParameters({ boot: true });
15145
+ const restored = this.dock.api.getPanel("updates");
15146
+ if (restored) this.dock.reveal("updates");
15147
+ else this.show("updates");
15148
+ if (!port.ready() && restored?.params?.boot !== false) {
15149
+ this.dock.api.getPanel("updates")?.api.updateParameters({ boot: true });
15150
+ this.#save();
15127
15151
  }
15128
15152
  } else if (this.dock.api.getPanel("updates")?.params?.boot && port.ready() && !port.list().some((item2) => item2.state === "failed")) {
15129
15153
  this.dock.close("updates");
@@ -15281,7 +15305,8 @@ var SliccApp = class extends ThemedElement {
15281
15305
  return changes ? b`<span class="badged">${button}<swc-badge size="s" variant="neutral" aria-hidden="true">${changes}</swc-badge></span>${tooltip}` : b`${button}${tooltip}`;
15282
15306
  }
15283
15307
  #changes() {
15284
- return this.model?.files.changes().length ?? 0;
15308
+ const port = this.model ? changesOf(this.model) : null;
15309
+ return port && !port.unavailable?.() ? port.changes().length : 0;
15285
15310
  }
15286
15311
  #more(items) {
15287
15312
  if (!items.length) return A;
@@ -15399,8 +15424,9 @@ var SliccApp = class extends ThemedElement {
15399
15424
  if (!updates) return A;
15400
15425
  const text2 = updates[0].toUpperCase() + updates.slice(1);
15401
15426
  return b`<swc-action-button id="updates" quiet size="s" data-updates accessible-label=${`Install / Update: ${updates}`} @click=${() => this.show("updates")}>
15402
- <swc-status-light size="s" variant=${updatesVariant(updates)}>${text2}</swc-status-light>
15403
- </swc-action-button>`;
15427
+ <swc-status-light size="s" variant=${updatesVariant(updates)}>${this.screen === "phone" ? A : text2}</swc-status-light>
15428
+ </swc-action-button>
15429
+ <swc-tooltip for="updates" placement="bottom">${text2}</swc-tooltip>`;
15404
15430
  }
15405
15431
  #networkIndicator() {
15406
15432
  const port = this.model?.network;
@@ -16746,15 +16772,65 @@ var layouts = [
16746
16772
  function folder(path) {
16747
16773
  return path.slice(0, path.lastIndexOf("/")) || "/";
16748
16774
  }
16749
- var confirmRevert = (path) => confirm({
16750
- title: `Revert ${basename(path)}?`,
16751
- body: `This discards the agent\u2019s edits to ${path}. You can\u2019t undo this.`,
16752
- action: "Revert"
16753
- });
16775
+ function where(change) {
16776
+ const at = folder(change.path);
16777
+ if (!change.repo) return at;
16778
+ if (at === change.repo) return "";
16779
+ return at.startsWith(`${change.repo}/`) ? at.slice(change.repo.length + 1) : at;
16780
+ }
16781
+ function lost(changes) {
16782
+ const kind = changes.every((change) => change.repo) ? "uncommitted" : "pending";
16783
+ return `${changes.length === 1 ? "Its" : "Their"} ${kind} changes are discarded and can\u2019t be undone.`;
16784
+ }
16785
+ var confirmRevert = (change) => confirm({ title: `Revert ${basename(change.path)}?`, body: lost([change]), action: "Revert" });
16786
+ async function revertPaths(port, paths) {
16787
+ const errors = [];
16788
+ for (const path of paths) {
16789
+ try {
16790
+ await port.revert(path);
16791
+ } catch (error) {
16792
+ errors.push(failure(error));
16793
+ }
16794
+ }
16795
+ if (errors.length > 1) return `Couldn\u2019t revert ${errors.length} files. ${errors[0]}`;
16796
+ return errors[0] ?? "";
16797
+ }
16798
+ function groups(changes) {
16799
+ const byRepo = /* @__PURE__ */ new Map();
16800
+ for (const change of changes) {
16801
+ const key2 = change.repo ?? "";
16802
+ byRepo.set(key2, [...byRepo.get(key2) ?? [], change]);
16803
+ }
16804
+ return [...byRepo];
16805
+ }
16806
+ function commands(text2) {
16807
+ const parts2 = text2.split("`").map((part2, index) => index % 2 ? { code: part2 } : part2);
16808
+ if (parts2.length % 2 === 0) return { parts: [text2], codes: [] };
16809
+ const codes = parts2.flatMap(
16810
+ (part2) => typeof part2 === "string" || !part2.code ? [] : [part2.code]
16811
+ );
16812
+ return { parts: parts2, codes: [...new Set(codes)] };
16813
+ }
16814
+ function errorLine(error) {
16815
+ 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>`;
16816
+ }
16754
16817
  var SliccChanges = class extends ModelElement {
16818
+ static properties = {
16819
+ ...ModelElement.properties,
16820
+ error: { state: true },
16821
+ copied: { state: true },
16822
+ uncopied: { state: true }
16823
+ };
16824
+ constructor() {
16825
+ super();
16826
+ this.error = "";
16827
+ this.copied = "";
16828
+ this.uncopied = false;
16829
+ }
16755
16830
  static styles = [
16756
16831
  shared,
16757
16832
  panelCss,
16833
+ errorCss,
16758
16834
  i`
16759
16835
  ul {
16760
16836
  list-style: none;
@@ -16764,7 +16840,54 @@ var SliccChanges = class extends ModelElement {
16764
16840
  flex: 1;
16765
16841
  min-height: 0;
16766
16842
  }
16767
- li {
16843
+ ul ul {
16844
+ padding: 0;
16845
+ overflow: visible;
16846
+ }
16847
+ .unavailable {
16848
+ display: grid;
16849
+ gap: var(--swc-spacing-200);
16850
+ align-content: start;
16851
+ padding: var(--swc-spacing-300);
16852
+ overflow-y: auto;
16853
+ color: var(--swc-neutral-subdued-content-color-default);
16854
+ }
16855
+ .unavailable p {
16856
+ margin: 0;
16857
+ }
16858
+ .command {
16859
+ display: flex;
16860
+ align-items: center;
16861
+ gap: var(--swc-spacing-100);
16862
+ padding: var(--swc-spacing-75) var(--swc-spacing-75) var(--swc-spacing-75) var(--swc-spacing-200);
16863
+ border-radius: var(--swc-corner-radius-medium-default);
16864
+ background: var(--swc-background-layer-1-color);
16865
+ }
16866
+ code {
16867
+ overflow-wrap: anywhere;
16868
+ font-family: var(--swc-code-font-family-stack);
16869
+ font-size: var(--swc-font-size-75);
16870
+ color: var(--swc-code-color);
16871
+ }
16872
+ .command code {
16873
+ flex: 1;
16874
+ min-width: 0;
16875
+ user-select: all;
16876
+ }
16877
+ .repo {
16878
+ display: flex;
16879
+ gap: var(--swc-spacing-100);
16880
+ padding: var(--swc-spacing-100) var(--swc-spacing-200) var(--swc-spacing-50);
16881
+ font-size: var(--swc-font-size-75);
16882
+ font-weight: var(--swc-bold-font-weight);
16883
+ color: var(--swc-neutral-subdued-content-color-default);
16884
+ }
16885
+ .repo span:first-child {
16886
+ overflow: hidden;
16887
+ text-overflow: ellipsis;
16888
+ white-space: nowrap;
16889
+ }
16890
+ li[data-path] {
16768
16891
  display: grid;
16769
16892
  grid-template-columns: auto minmax(0, auto) minmax(0, 1fr) auto;
16770
16893
  align-items: center;
@@ -16773,11 +16896,11 @@ var SliccChanges = class extends ModelElement {
16773
16896
  padding: 0 var(--swc-spacing-75) 0 var(--swc-spacing-200);
16774
16897
  cursor: pointer;
16775
16898
  }
16776
- li:hover,
16777
- li:focus-within {
16899
+ li[data-path]:hover,
16900
+ li[data-path]:focus-within {
16778
16901
  background: var(--swc-gray-100);
16779
16902
  }
16780
- li:focus-visible {
16903
+ li[data-path]:focus-visible {
16781
16904
  outline: var(--swc-focus-indicator-thickness) solid var(--swc-focus-indicator-color);
16782
16905
  outline-offset: calc(-1 * var(--swc-focus-indicator-thickness));
16783
16906
  }
@@ -16797,12 +16920,12 @@ var SliccChanges = class extends ModelElement {
16797
16920
  display: flex;
16798
16921
  visibility: hidden;
16799
16922
  }
16800
- li:hover .actions,
16801
- li:focus-within .actions {
16923
+ li[data-path]:hover .actions,
16924
+ li[data-path]:focus-within .actions {
16802
16925
  visibility: visible;
16803
16926
  }
16804
16927
  @media (hover: none), (pointer: coarse) {
16805
- li {
16928
+ li[data-path] {
16806
16929
  min-height: var(--swc-component-height-200);
16807
16930
  }
16808
16931
  .actions {
@@ -16812,33 +16935,41 @@ var SliccChanges = class extends ModelElement {
16812
16935
  `
16813
16936
  ];
16814
16937
  subscribe(model) {
16815
- return [model.files.on("changes", () => this.requestUpdate())];
16938
+ return [changesOf(model).on("changes", () => this.requestUpdate())];
16816
16939
  }
16817
16940
  focus() {
16818
- this.focusOn("li");
16941
+ this.focusOn("li[data-path]");
16942
+ }
16943
+ #port() {
16944
+ return changesOf(this.model);
16819
16945
  }
16820
16946
  #accept(event2, path) {
16821
16947
  event2.stopPropagation();
16822
- this.model?.files.accept(path);
16948
+ this.#port().accept(path);
16823
16949
  }
16824
- async #revert(event2, path) {
16950
+ async #revert(event2, change) {
16825
16951
  event2.stopPropagation();
16826
- if (await confirmRevert(path)) await this.model?.files.revert(path);
16952
+ this.error = "";
16953
+ if (await confirmRevert(change)) this.error = await revertPaths(this.#port(), [change.path]);
16827
16954
  }
16828
16955
  async #all(action) {
16829
- const files = this.model?.files;
16830
- const changes = files?.changes() ?? [];
16956
+ const port = this.#port();
16957
+ const changes = port.changes();
16958
+ this.error = "";
16959
+ if (action === "accept") {
16960
+ for (const change of changes) port.accept(change.path);
16961
+ return;
16962
+ }
16831
16963
  const count = changes.length;
16832
16964
  const title = `Revert ${count} ${count === 1 ? "change" : "changes"}?`;
16833
- const body4 = "This discards the agents\u2019 edits and puts every file back. You can\u2019t undo this.";
16834
- if (action === "revert" && !await confirm({ title, body: body4, action: "Revert all" })) return;
16835
- for (const change of changes) {
16836
- if (action === "accept") files?.accept(change.path);
16837
- else void files?.revert(change.path);
16838
- }
16965
+ if (await confirm({ title, body: lost(changes), action: "Revert all" }))
16966
+ this.error = await revertPaths(
16967
+ port,
16968
+ changes.map((change) => change.path)
16969
+ );
16839
16970
  }
16840
16971
  #keydown(event2) {
16841
- const items = [...this.renderRoot.querySelectorAll("li")];
16972
+ const items = [...this.renderRoot.querySelectorAll("li[data-path]")];
16842
16973
  const index = items.indexOf(this.renderRoot.activeElement);
16843
16974
  if (index < 0) return;
16844
16975
  const moves = {
@@ -16856,15 +16987,17 @@ var SliccChanges = class extends ModelElement {
16856
16987
  }
16857
16988
  }
16858
16989
  #row(change) {
16990
+ const by = author(this.model, change);
16991
+ const at = where(change);
16859
16992
  return b`<li
16860
16993
  tabindex="0"
16861
16994
  data-path=${change.path}
16862
- title=${`${change.path}, ${change.status} by ${agentName(this.model, change.agentId)}`}
16995
+ title=${`${change.path}, ${change.status}${by ? ` by ${by}` : ""}`}
16863
16996
  @click=${() => request(this, "open-diff", change.path)}
16864
16997
  >
16865
16998
  ${statusMark(change.status)}
16866
16999
  <span class="name">${basename(change.path)}</span>
16867
- <span class="where"><bdi>${folder(change.path)} · ${agentName(this.model, change.agentId)}</bdi></span>
17000
+ <span class="where"><bdi>${[at, by].filter(Boolean).join(" \xB7 ")}</bdi></span>
16868
17001
  <span class="actions">
16869
17002
  <swc-action-button
16870
17003
  size="xs"
@@ -16880,33 +17013,78 @@ var SliccChanges = class extends ModelElement {
16880
17013
  quiet
16881
17014
  accessible-label=${`Revert ${basename(change.path)}`}
16882
17015
  title="Revert"
16883
- @click=${(event2) => this.#revert(event2, change.path)}
17016
+ @click=${(event2) => this.#revert(event2, change)}
16884
17017
  >
16885
17018
  <swc-icon-revert slot="icon"></swc-icon-revert>
16886
17019
  </swc-action-button>
16887
17020
  </span>
16888
17021
  </li>`;
16889
17022
  }
17023
+ #list(changes) {
17024
+ const grouped = groups(changes);
17025
+ if (grouped.length < 2)
17026
+ return b`<ul aria-label="Pending changes" @keydown=${this.#keydown}>${changes.map((change) => this.#row(change))}</ul>`;
17027
+ return b`<ul aria-label="Pending changes" @keydown=${this.#keydown}>${grouped.map(
17028
+ ([repo, items]) => b`<li data-repo=${repo}>
17029
+ <div class="repo" title=${repo}>
17030
+ <span>${repo || "Outside a repository"}</span>
17031
+ <span>${items.length}</span>
17032
+ </div>
17033
+ <ul aria-label=${repo || "Outside a repository"}>${items.map((change) => this.#row(change))}</ul>
17034
+ </li>`
17035
+ )}</ul>`;
17036
+ }
17037
+ async copy(code2) {
17038
+ try {
17039
+ await globalThis.navigator.clipboard.writeText(code2);
17040
+ this.copied = code2;
17041
+ this.uncopied = false;
17042
+ } catch {
17043
+ this.copied = "";
17044
+ this.uncopied = true;
17045
+ }
17046
+ }
17047
+ #unavailable(text2) {
17048
+ const { parts: parts2, codes } = commands(text2);
17049
+ return b`<div class="unavailable">
17050
+ <p data-unavailable>${parts2.map((part2) => typeof part2 === "string" ? part2 : b`<code>${part2.code}</code>`)}</p>
17051
+ ${codes.map(
17052
+ (code2) => b`<div class="command" data-command=${code2}>
17053
+ <code>${code2}</code>
17054
+ <swc-action-button size="s" quiet data-action="copy-command" accessible-label=${this.copied === code2 ? "Copied" : `Copy ${code2}`} @click=${() => this.copy(code2)}>
17055
+ <swc-icon-copy slot="icon"></swc-icon-copy>${this.copied === code2 ? "Copied" : "Copy"}
17056
+ </swc-action-button>
17057
+ </div>`
17058
+ )}
17059
+ ${this.uncopied ? b`<div class="error" role="alert" data-error="copy"><swc-icon-alert-diamond size="s" aria-hidden="true"></swc-icon-alert-diamond><span>Couldn’t copy. Select the command and copy it.</span></div>` : A}
17060
+ </div>`;
17061
+ }
16890
17062
  render() {
16891
- const changes = this.model?.files.changes() ?? [];
17063
+ const port = this.model ? changesOf(this.model) : null;
17064
+ const unavailable = port?.unavailable?.() ?? null;
17065
+ if (unavailable) return this.#unavailable(unavailable);
17066
+ const changes = port?.changes() ?? [];
16892
17067
  return b`<div class="bar">
16893
17068
  <span>${changes.length} pending ${changes.length === 1 ? "change" : "changes"}</span>
16894
17069
  <span class="spacer"></span>
16895
17070
  ${changes.length ? b`<swc-action-button size="s" quiet @click=${() => this.#all("accept")}>Accept all</swc-action-button>
16896
17071
  <swc-action-button size="s" quiet @click=${() => this.#all("revert")}>Revert all</swc-action-button>` : A}
16897
17072
  </div>
16898
- ${changes.length ? b`<ul aria-label="Pending changes" @keydown=${this.#keydown}>${changes.map((change) => this.#row(change))}</ul>` : b`<div class="note">No pending changes. Edits by agents show up here for review.</div>`}`;
17073
+ ${errorLine(this.error)}
17074
+ ${changes.length ? this.#list(changes) : b`<div class="note">No pending changes. Edits by agents show up here for review.</div>`}`;
16899
17075
  }
16900
17076
  };
16901
17077
  var SliccDiffPanel = class extends ThemedElement {
16902
- static properties = { ...ThemedElement.properties, path: {} };
17078
+ static properties = { ...ThemedElement.properties, path: {}, error: { state: true } };
16903
17079
  constructor() {
16904
17080
  super();
16905
17081
  this.path = "";
17082
+ this.error = "";
16906
17083
  }
16907
17084
  static styles = [
16908
17085
  shared,
16909
17086
  panelCss,
17087
+ errorCss,
16910
17088
  i`
16911
17089
  slicc-diff-view {
16912
17090
  flex: 1;
@@ -16928,17 +17106,34 @@ var SliccDiffPanel = class extends ThemedElement {
16928
17106
  `
16929
17107
  ];
16930
17108
  subscribe(model) {
16931
- return [...super.subscribe(model), model.files.on("changes", () => this.requestUpdate())];
17109
+ return [...super.subscribe(model), changesOf(model).on("changes", () => this.requestUpdate())];
17110
+ }
17111
+ async #revert(port, change) {
17112
+ this.error = "";
17113
+ if (await confirmRevert(change)) this.error = await revertPaths(port, [this.path]);
16932
17114
  }
16933
- async #revert() {
16934
- if (await confirmRevert(this.path)) await this.model?.files.revert(this.path);
17115
+ #body(change, style) {
17116
+ if (change.before === null && change.after === null) {
17117
+ return b`<div class="note" data-diff="none">
17118
+ No diff for this file: it’s binary or over 1 MB.
17119
+ ${change.status === "deleted" ? A : b`<swc-action-button size="s" quiet @click=${() => request(this, "open-file", this.path)}>Open the file</swc-action-button>`}
17120
+ </div>`;
17121
+ }
17122
+ return b`<slicc-diff-view
17123
+ path=${this.path}
17124
+ color=${this.color}
17125
+ diff-style=${style}
17126
+ .oldText=${change.before}
17127
+ .newText=${change.after}
17128
+ ></slicc-diff-view>`;
16935
17129
  }
16936
17130
  #style(style) {
16937
17131
  this.model?.settings.update({ diffStyle: style });
16938
17132
  }
16939
17133
  render() {
16940
17134
  const model = this.model;
16941
- const change = model?.files.changes().find((candidate) => candidate.path === this.path);
17135
+ const port = model ? changesOf(model) : null;
17136
+ const change = port?.changes().find((candidate) => candidate.path === this.path);
16942
17137
  const style = model?.settings.get().diffStyle ?? "unified";
16943
17138
  if (!change) {
16944
17139
  return b`<div class="bar"><span class="path" title=${this.path}>${this.path}</span></div>
@@ -16947,12 +17142,13 @@ var SliccDiffPanel = class extends ThemedElement {
16947
17142
  <swc-action-button size="s" quiet @click=${() => request(this, "open-file", this.path)}>Open the file</swc-action-button>
16948
17143
  </div>`;
16949
17144
  }
17145
+ const by = author(model, change);
16950
17146
  return b`<div class="bar">
16951
17147
  ${statusMark(change.status, false)}
16952
17148
  <span class="path" title=${this.path}>${this.path}</span>
16953
- <span>${statusLabels[change.status]} by ${agentName(model, change.agentId)}</span>
17149
+ <span>${statusLabels[change.status]}${by ? ` by ${by}` : ""}</span>
16954
17150
  <span class="spacer"></span>
16955
- <swc-action-group size="s" compact accessible-label="Diff layout">
17151
+ ${change.before === null && change.after === null ? A : b`<swc-action-group size="s" compact accessible-label="Diff layout">
16956
17152
  ${layouts.map(
16957
17153
  ([value, label]) => b`<swc-action-button
16958
17154
  class=${value === style ? "selected" : ""}
@@ -16962,21 +17158,16 @@ var SliccDiffPanel = class extends ThemedElement {
16962
17158
  >${label}</swc-action-button
16963
17159
  >`
16964
17160
  )}
16965
- </swc-action-group>
16966
- <swc-action-button size="s" quiet @click=${() => model?.files.accept(this.path)}>
17161
+ </swc-action-group>`}
17162
+ <swc-action-button size="s" quiet @click=${() => port?.accept(this.path)}>
16967
17163
  <swc-icon-checkmark slot="icon"></swc-icon-checkmark>Accept
16968
17164
  </swc-action-button>
16969
- <swc-action-button size="s" quiet @click=${() => this.#revert()}>
17165
+ <swc-action-button size="s" quiet @click=${() => this.#revert(port, change)}>
16970
17166
  <swc-icon-revert slot="icon"></swc-icon-revert>Revert
16971
17167
  </swc-action-button>
16972
17168
  </div>
16973
- <slicc-diff-view
16974
- path=${this.path}
16975
- color=${this.color}
16976
- diff-style=${style}
16977
- .oldText=${change.before}
16978
- .newText=${change.after}
16979
- ></slicc-diff-view>`;
17169
+ ${errorLine(this.error)}
17170
+ ${this.#body(change, style)}`;
16980
17171
  }
16981
17172
  };
16982
17173
 
@@ -19637,12 +19828,15 @@ function tool(call, color = "light") {
19637
19828
  const kind = toolKind(call.name);
19638
19829
  return b`<details class="tool" data-status=${call.status} data-tool=${call.name} data-kind=${kind.id}>
19639
19830
  <summary>
19640
- <swc-icon-chevron-right class="chevron" size="s" aria-hidden="true"></swc-icon-chevron-right>
19641
- <span class="kind">${kind.icon}</span>
19642
- <span class="title">${call.title}</span>
19643
- <span class="name">${call.name}</span>
19644
- ${call.meta ? b`<span class="tool-meta">${call.meta}</span>` : A}
19645
- ${state(call.status)}
19831
+ <span class="head">
19832
+ <swc-icon-chevron-right class="chevron" size="s" aria-hidden="true"></swc-icon-chevron-right>
19833
+ <span class="kind">${kind.icon}</span>
19834
+ <span class="title">${call.title}</span>
19835
+ <span class="name">${call.name}</span>
19836
+ ${call.meta ? b`<span class="tool-meta">${call.meta}</span>` : A}
19837
+ ${state(call.status)}
19838
+ </span>
19839
+ ${call.image ? b`<span class="thumb"><img src=${call.image} alt="" /></span>` : A}
19646
19840
  </summary>
19647
19841
  <div class="call">
19648
19842
  ${body(call, color)}
@@ -20194,6 +20388,18 @@ var messageCss = i`
20194
20388
  :is(details.tool, details.cluster) > summary {
20195
20389
  padding-inline: var(--swc-spacing-100);
20196
20390
  }
20391
+ details.tool > summary {
20392
+ flex-direction: column;
20393
+ align-items: stretch;
20394
+ justify-content: center;
20395
+ gap: 0;
20396
+ }
20397
+ details.tool > summary > .head {
20398
+ display: flex;
20399
+ align-items: center;
20400
+ gap: var(--swc-spacing-100);
20401
+ min-inline-size: 0;
20402
+ }
20197
20403
  :is(details.tool, details.cluster) > summary:hover {
20198
20404
  background: var(--swc-gray-100);
20199
20405
  }
@@ -20311,6 +20517,19 @@ var messageCss = i`
20311
20517
  white-space: pre-wrap;
20312
20518
  overflow-wrap: anywhere;
20313
20519
  }
20520
+ .thumb {
20521
+ padding-inline-start: calc(var(--swc-spacing-100) + var(--swc-spacing-300));
20522
+ padding-block: var(--swc-spacing-75);
20523
+ }
20524
+ .thumb img {
20525
+ display: block;
20526
+ max-inline-size: min(100%, calc(var(--swc-spacing-1000) * 2));
20527
+ max-block-size: calc(var(--swc-spacing-1000) * 1.25);
20528
+ border-radius: var(--swc-corner-radius-75);
20529
+ }
20530
+ details[open] > summary .thumb {
20531
+ display: none;
20532
+ }
20314
20533
  .shot {
20315
20534
  display: block;
20316
20535
  max-inline-size: min(100%, calc(var(--swc-spacing-1000) * 5));
@@ -21785,9 +22004,9 @@ e25("swc-icon-clock", o70);
21785
22004
  // src/app/composer.ts
21786
22005
  var limit = 25 * 1024 * 1024;
21787
22006
  function available(model) {
21788
- return commands.filter((command2) => command2.available?.(model) ?? true);
22007
+ return commands2.filter((command2) => command2.available?.(model) ?? true);
21789
22008
  }
21790
- var commands = [
22009
+ var commands2 = [
21791
22010
  {
21792
22011
  name: "clear",
21793
22012
  detail: "Start a new chat",
@@ -21976,14 +22195,27 @@ var SliccComposer = class extends ModelElement {
21976
22195
  min-height: var(--swc-component-height-75);
21977
22196
  }
21978
22197
  .hint {
22198
+ display: flex;
21979
22199
  flex: 1;
22200
+ flex-wrap: wrap;
22201
+ align-items: center;
21980
22202
  min-width: 0;
21981
- white-space: nowrap;
22203
+ max-block-size: var(--swc-component-height-75);
21982
22204
  overflow: hidden;
21983
- text-overflow: ellipsis;
21984
22205
  font-size: var(--swc-font-size-75);
21985
22206
  color: var(--swc-neutral-subdued-content-color-default);
21986
22207
  }
22208
+ .hint > span {
22209
+ display: flex;
22210
+ align-items: center;
22211
+ block-size: var(--swc-component-height-75);
22212
+ gap: var(--swc-spacing-50);
22213
+ white-space: nowrap;
22214
+ }
22215
+ .hint > span + span::before {
22216
+ content: '·';
22217
+ padding-inline-start: var(--swc-spacing-75);
22218
+ }
21987
22219
  .below swc-action-button {
21988
22220
  margin-inline-start: auto;
21989
22221
  }
@@ -22264,7 +22496,7 @@ var SliccComposer = class extends ModelElement {
22264
22496
  }
22265
22497
  if (kind === "argument") {
22266
22498
  const name = this.value.match(/^\/(\w+)/)?.[1];
22267
- return filter(commands.find((command2) => command2.name === name)?.args?.(model) ?? [], query);
22499
+ return filter(commands2.find((command2) => command2.name === name)?.args?.(model) ?? [], query);
22268
22500
  }
22269
22501
  const files = this.#paths.map((path) => ({
22270
22502
  value: path,
@@ -22284,7 +22516,7 @@ var SliccComposer = class extends ModelElement {
22284
22516
  if (this.popup?.kind === "file" || this.popup?.kind === "secret") return;
22285
22517
  const found = trigger(this.value, area.selectionStart ?? this.value.length);
22286
22518
  const name = this.value.match(/^\/(\w+)/)?.[1];
22287
- const takes = commands.some((command2) => command2.name === name && command2.args);
22519
+ const takes = commands2.some((command2) => command2.name === name && command2.args);
22288
22520
  this.popup = found && (found.kind !== "argument" || takes) ? { ...found, items: this.#choices(found.kind, found.query), index: 0 } : null;
22289
22521
  }
22290
22522
  openPopup(kind) {
@@ -22566,8 +22798,12 @@ var SliccComposer = class extends ModelElement {
22566
22798
  </div>
22567
22799
  <div class="below">
22568
22800
  <div class="hint">
22569
- <kbd>Enter</kbd> ${busy ? "steer" : "send"} · <kbd>Ctrl+Enter</kbd> queue · <kbd>Shift+Enter</kbd> new line · <kbd>/</kbd> commands ·
22570
- <kbd>@</kbd> mention · <kbd>↑</kbd> history${busy ? b` · <kbd>Esc</kbd> stop` : A}
22801
+ <span><kbd>Enter</kbd> ${busy ? "steer" : "send"}</span>
22802
+ ${busy ? b`<span><kbd>Ctrl+Enter</kbd> queue</span><span><kbd>Esc</kbd> stop</span>` : A}
22803
+ <span><kbd>/</kbd> commands</span>
22804
+ <span><kbd>@</kbd> mention</span>
22805
+ <span><kbd>Shift+Enter</kbd> new line</span>
22806
+ <span><kbd>↑</kbd> history</span>
22571
22807
  </div>
22572
22808
  ${speech ? b`<swc-action-button
22573
22809
  size="s"
@@ -22680,10 +22916,10 @@ var tagLabels = {
22680
22916
  project: "Project"
22681
22917
  };
22682
22918
  function sections(memories) {
22683
- const groups = /* @__PURE__ */ new Map();
22919
+ const groups2 = /* @__PURE__ */ new Map();
22684
22920
  for (const memory of memories)
22685
- groups.set(memory.section, [...groups.get(memory.section) ?? [], memory]);
22686
- return [...groups];
22921
+ groups2.set(memory.section, [...groups2.get(memory.section) ?? [], memory]);
22922
+ return [...groups2];
22687
22923
  }
22688
22924
  var SliccMemory = class extends ModelElement {
22689
22925
  static properties = {
@@ -23933,13 +24169,9 @@ var SliccTray = class extends ModelElement {
23933
24169
  align-items: center;
23934
24170
  gap: var(--swc-spacing-50);
23935
24171
  }
23936
- .chip .short,
23937
24172
  :host([compact]) .chip .detail {
23938
24173
  display: none;
23939
24174
  }
23940
- :host([compact]) .chip .short {
23941
- display: inline;
23942
- }
23943
24175
  .muted {
23944
24176
  color: var(--swc-neutral-subdued-content-color-default);
23945
24177
  }
@@ -24016,7 +24248,7 @@ var SliccTray = class extends ModelElement {
24016
24248
  >
24017
24249
  <span>
24018
24250
  <swc-status-light size="s" variant=${connectionVariant[status2.connection]}>
24019
- <span class="detail">${light}</span><span class="short">${connection}</span>
24251
+ <span class="detail">${light}</span>
24020
24252
  </swc-status-light>
24021
24253
  <span class="detail muted followers"><swc-icon-user-group size="s"></swc-icon-user-group>${status2.followers.length}</span>
24022
24254
  </span>
@@ -31566,12 +31798,12 @@ function charactersToExpressionCached(subset) {
31566
31798
  return cached;
31567
31799
  }
31568
31800
  function charactersToExpression(subset) {
31569
- const groups = [];
31801
+ const groups2 = [];
31570
31802
  let index = -1;
31571
31803
  while (++index < subset.length) {
31572
- groups.push(subset[index].replace(regexEscapeRegex, "\\$&"));
31804
+ groups2.push(subset[index].replace(regexEscapeRegex, "\\$&"));
31573
31805
  }
31574
- return new RegExp("(?:" + groups.join("|") + ")", "g");
31806
+ return new RegExp("(?:" + groups2.join("|") + ")", "g");
31575
31807
  }
31576
31808
 
31577
31809
  // node_modules/stringify-entities/lib/util/to-hexadecimal.js
@@ -32851,31 +33083,31 @@ function parseColor(sequence) {
32851
33083
  }
32852
33084
  }
32853
33085
  function parseSequence(sequence) {
32854
- const commands2 = [];
33086
+ const commands3 = [];
32855
33087
  while (sequence.length > 0) {
32856
33088
  const code2 = sequence.shift();
32857
33089
  if (!code2) continue;
32858
33090
  const codeInt = Number.parseInt(code2);
32859
33091
  if (Number.isNaN(codeInt)) continue;
32860
- if (codeInt === 0) commands2.push({ type: "resetAll" });
33092
+ if (codeInt === 0) commands3.push({ type: "resetAll" });
32861
33093
  else if (codeInt <= 9) {
32862
- if (decorations[codeInt]) commands2.push({
33094
+ if (decorations[codeInt]) commands3.push({
32863
33095
  type: "setDecoration",
32864
33096
  value: decorations[codeInt]
32865
33097
  });
32866
33098
  } else if (codeInt <= 29) {
32867
33099
  const decoration = decorations[codeInt - 20];
32868
33100
  if (decoration) {
32869
- commands2.push({
33101
+ commands3.push({
32870
33102
  type: "resetDecoration",
32871
33103
  value: decoration
32872
33104
  });
32873
- if (decoration === "dim") commands2.push({
33105
+ if (decoration === "dim") commands3.push({
32874
33106
  type: "resetDecoration",
32875
33107
  value: "bold"
32876
33108
  });
32877
33109
  }
32878
- } else if (codeInt <= 37) commands2.push({
33110
+ } else if (codeInt <= 37) commands3.push({
32879
33111
  type: "setForegroundColor",
32880
33112
  value: {
32881
33113
  type: "named",
@@ -32884,12 +33116,12 @@ function parseSequence(sequence) {
32884
33116
  });
32885
33117
  else if (codeInt === 38) {
32886
33118
  const color = parseColor(sequence);
32887
- if (color) commands2.push({
33119
+ if (color) commands3.push({
32888
33120
  type: "setForegroundColor",
32889
33121
  value: color
32890
33122
  });
32891
- } else if (codeInt === 39) commands2.push({ type: "resetForegroundColor" });
32892
- else if (codeInt <= 47) commands2.push({
33123
+ } else if (codeInt === 39) commands3.push({ type: "resetForegroundColor" });
33124
+ else if (codeInt <= 47) commands3.push({
32893
33125
  type: "setBackgroundColor",
32894
33126
  value: {
32895
33127
  type: "named",
@@ -32898,27 +33130,27 @@ function parseSequence(sequence) {
32898
33130
  });
32899
33131
  else if (codeInt === 48) {
32900
33132
  const color = parseColor(sequence);
32901
- if (color) commands2.push({
33133
+ if (color) commands3.push({
32902
33134
  type: "setBackgroundColor",
32903
33135
  value: color
32904
33136
  });
32905
- } else if (codeInt === 49) commands2.push({ type: "resetBackgroundColor" });
32906
- else if (codeInt === 53) commands2.push({
33137
+ } else if (codeInt === 49) commands3.push({ type: "resetBackgroundColor" });
33138
+ else if (codeInt === 53) commands3.push({
32907
33139
  type: "setDecoration",
32908
33140
  value: "overline"
32909
33141
  });
32910
- else if (codeInt === 55) commands2.push({
33142
+ else if (codeInt === 55) commands3.push({
32911
33143
  type: "resetDecoration",
32912
33144
  value: "overline"
32913
33145
  });
32914
- else if (codeInt >= 90 && codeInt <= 97) commands2.push({
33146
+ else if (codeInt >= 90 && codeInt <= 97) commands3.push({
32915
33147
  type: "setForegroundColor",
32916
33148
  value: {
32917
33149
  type: "named",
32918
33150
  name: namedColors[codeInt - 90 + 8]
32919
33151
  }
32920
33152
  });
32921
- else if (codeInt >= 100 && codeInt <= 107) commands2.push({
33153
+ else if (codeInt >= 100 && codeInt <= 107) commands3.push({
32922
33154
  type: "setBackgroundColor",
32923
33155
  value: {
32924
33156
  type: "named",
@@ -32926,7 +33158,7 @@ function parseSequence(sequence) {
32926
33158
  }
32927
33159
  });
32928
33160
  }
32929
- return commands2;
33161
+ return commands3;
32930
33162
  }
32931
33163
  function createAnsiSequenceParser() {
32932
33164
  let foreground = null;
@@ -32945,15 +33177,15 @@ function createAnsiSequenceParser() {
32945
33177
  decorations: new Set(decorations2)
32946
33178
  });
32947
33179
  if (findResult.sequence) {
32948
- const commands2 = parseSequence(findResult.sequence);
32949
- for (const styleToken of commands2) if (styleToken.type === "resetAll") {
33180
+ const commands3 = parseSequence(findResult.sequence);
33181
+ for (const styleToken of commands3) if (styleToken.type === "resetAll") {
32950
33182
  foreground = null;
32951
33183
  background = null;
32952
33184
  decorations2.clear();
32953
33185
  } else if (styleToken.type === "resetForegroundColor") foreground = null;
32954
33186
  else if (styleToken.type === "resetBackgroundColor") background = null;
32955
33187
  else if (styleToken.type === "resetDecoration") decorations2.delete(styleToken.value);
32956
- for (const styleToken of commands2) if (styleToken.type === "setForegroundColor") foreground = styleToken.value;
33188
+ for (const styleToken of commands3) if (styleToken.type === "setForegroundColor") foreground = styleToken.value;
32957
33189
  else if (styleToken.type === "setBackgroundColor") background = styleToken.value;
32958
33190
  else if (styleToken.type === "setDecoration") decorations2.add(styleToken.value);
32959
33191
  }
@@ -51638,8 +51870,8 @@ var BaseGrid = class extends Resizable {
51638
51870
  this._onDidRemove.fire(group);
51639
51871
  }
51640
51872
  if (!(options === null || options === void 0 ? void 0 : options.skipActive) && this._activeGroup === group) {
51641
- const groups = Array.from(this._groups.values());
51642
- this.doSetGroupActive(groups.length > 0 ? groups[0].value : void 0);
51873
+ const groups2 = Array.from(this._groups.values());
51874
+ this.doSetGroupActive(groups2.length > 0 ? groups2[0].value : void 0);
51643
51875
  }
51644
51876
  return view;
51645
51877
  }
@@ -61967,7 +62199,7 @@ var StrictEventsSequencing = class extends CompositeDisposable {
61967
62199
  }
61968
62200
  init() {
61969
62201
  const panels = /* @__PURE__ */ new Set();
61970
- const groups = /* @__PURE__ */ new Set();
62202
+ const groups2 = /* @__PURE__ */ new Set();
61971
62203
  this.addDisposables(this.accessor.onDidAddPanel((panel) => {
61972
62204
  if (panels.has(panel.api.id)) throw new Error(`dockview: Invalid event sequence. [onDidAddPanel] called for panel ${panel.api.id} but panel already exists`);
61973
62205
  else panels.add(panel.api.id);
@@ -61975,10 +62207,10 @@ var StrictEventsSequencing = class extends CompositeDisposable {
61975
62207
  if (panels.has(panel.api.id)) panels.delete(panel.api.id);
61976
62208
  else throw new Error(`dockview: Invalid event sequence. [onDidRemovePanel] called for panel ${panel.api.id} but panel does not exists`);
61977
62209
  }), this.accessor.onDidAddGroup((group) => {
61978
- if (groups.has(group.api.id)) throw new Error(`dockview: Invalid event sequence. [onDidAddGroup] called for group ${group.api.id} but group already exists`);
61979
- else groups.add(group.api.id);
62210
+ if (groups2.has(group.api.id)) throw new Error(`dockview: Invalid event sequence. [onDidAddGroup] called for group ${group.api.id} but group already exists`);
62211
+ else groups2.add(group.api.id);
61980
62212
  }), this.accessor.onDidRemoveGroup((group) => {
61981
- if (groups.has(group.api.id)) groups.delete(group.api.id);
62213
+ if (groups2.has(group.api.id)) groups2.delete(group.api.id);
61982
62214
  else throw new Error(`dockview: Invalid event sequence. [onDidRemoveGroup] called for group ${group.api.id} but group does not exists`);
61983
62215
  }));
61984
62216
  }
@@ -64772,9 +65004,9 @@ var DockviewComponent = class extends BaseGrid {
64772
65004
  this.mutation("clear", () => this._doClear());
64773
65005
  }
64774
65006
  _doClear() {
64775
- const groups = Array.from(this._groups.values()).map((_9) => _9.value);
65007
+ const groups2 = Array.from(this._groups.values()).map((_9) => _9.value);
64776
65008
  const hasActiveGroup = !!this.activeGroup;
64777
- for (const group of groups) {
65009
+ for (const group of groups2) {
64778
65010
  var _this$_edgeGroupServi9;
64779
65011
  if ((_this$_edgeGroupServi9 = this._edgeGroupService) === null || _this$_edgeGroupServi9 === void 0 ? void 0 : _this$_edgeGroupServi9.includes(group)) {
64780
65012
  const panels = [...group.panels];
@@ -65027,8 +65259,8 @@ var DockviewComponent = class extends BaseGrid {
65027
65259
  */
65028
65260
  activateFallbackGroupIfRemoved(removed, skipActive) {
65029
65261
  if (!skipActive && this._activeGroup === removed) {
65030
- const groups = Array.from(this._groups.values());
65031
- this.doSetGroupAndPanelActive(groups.length > 0 ? groups[0].value : void 0);
65262
+ const groups2 = Array.from(this._groups.values());
65263
+ this.doSetGroupAndPanelActive(groups2.length > 0 ? groups2[0].value : void 0);
65032
65264
  }
65033
65265
  }
65034
65266
  doRemoveGroup(group, options) {
@@ -65972,10 +66204,10 @@ var SliccDock = class extends HTMLElement {
65972
66204
  this.#contents.get(id)?.focus();
65973
66205
  }
65974
66206
  cycleGroup(delta) {
65975
- const groups = this.api.groups.filter((group) => group.activePanel);
65976
- if (groups.length === 0) return null;
65977
- const current = groups.indexOf(this.api.activeGroup);
65978
- const next = groups[(current + delta + groups.length) % groups.length];
66207
+ const groups2 = this.api.groups.filter((group) => group.activePanel);
66208
+ if (groups2.length === 0) return null;
66209
+ const current = groups2.indexOf(this.api.activeGroup);
66210
+ const next = groups2[(current + delta + groups2.length) % groups2.length];
65979
66211
  const id = next.activePanel?.id;
65980
66212
  this.focusPanel(id);
65981
66213
  return id;