@ai-ecoverse/slicc-spectrum 1.54.0 → 1.55.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
@@ -20884,8 +20884,20 @@ var packageActions = {
20884
20884
  install: "Install",
20885
20885
  update: "Update",
20886
20886
  remove: "Remove",
20887
- retry: "Retry"
20887
+ retry: "Retry",
20888
+ unpin: "Unpin"
20888
20889
  };
20890
+ function packageLight(item2) {
20891
+ if (item2.pin && item2.state === "installed")
20892
+ return ["positive", item2.pin.base === null ? "Added" : "Pinned"];
20893
+ if (item2.pin?.base && item2.state === "removing") return ["info", "Unpinning"];
20894
+ return packageStates[item2.state];
20895
+ }
20896
+ function pinVersion(item2, pin) {
20897
+ const version2 = item2.version ?? pin.range;
20898
+ if (pin.base === null) return [pin.range === version2 ? version2 : `${pin.range} \u2192 ${version2}`];
20899
+ return [version2, pin.base === version2 ? "the version seven ships" : `seven ships ${pin.base}`];
20900
+ }
20889
20901
  var packageRunning = /* @__PURE__ */ new Set(["installing", "updating", "removing"]);
20890
20902
  var list3 = (names) => new Intl.ListFormat("en", { type: "conjunction" }).format(names);
20891
20903
  function requiresText(item2, all2) {
@@ -21335,6 +21347,14 @@ var SliccUpdates = class extends ModelElement {
21335
21347
  </article>`;
21336
21348
  }
21337
21349
  #packageMeta(item2, all2) {
21350
+ if (item2.pin) {
21351
+ const [version3, ...rest] = pinVersion(item2, item2.pin);
21352
+ return b`<p class="meta" data-pin=${item2.pin.base === null ? "added" : "pinned"}>
21353
+ <span class="version">${version3}</span>
21354
+ ${rest.map((part2) => b`<span>${part2}</span>`)}
21355
+ <span>in ${item2.pin.project}</span>
21356
+ </p>`;
21357
+ }
21338
21358
  const version2 = item2.version === null ? item2.offered : item2.offered && item2.offered !== item2.version ? `${item2.version} \u2192 ${item2.offered}` : item2.version;
21339
21359
  const download = item2.size !== void 0 && (item2.version === null || item2.offered !== item2.version);
21340
21360
  const requires = requiresText(item2, all2);
@@ -21360,11 +21380,11 @@ var SliccUpdates = class extends ModelElement {
21360
21380
  return b`<swc-progress-bar
21361
21381
  size="s"
21362
21382
  indeterminate
21363
- accessible-label=${`${item2.label}: ${packageStates[item2.state]?.[1].toLowerCase()}`}
21383
+ accessible-label=${`${item2.label}: ${packageLight(item2)?.[1].toLowerCase()}`}
21364
21384
  ></swc-progress-bar>`;
21365
21385
  }
21366
21386
  #package(item2, all2, act) {
21367
- const light = packageStates[item2.state];
21387
+ const light = packageLight(item2);
21368
21388
  const busy = this.busy.get(item2.id);
21369
21389
  const shown2 = busy ? [busy] : act ? item2.actions : [];
21370
21390
  const error = this.problems.get(item2.id) ?? item2.error;
@@ -21400,21 +21420,32 @@ var SliccUpdates = class extends ModelElement {
21400
21420
  ${item2.log ? b`<details><summary>Install log</summary><pre><span class="package">${item2.package}</span>\n${item2.log}</pre></details>` : A}
21401
21421
  </li>`;
21402
21422
  }
21423
+ #list(items, all2, port) {
21424
+ return b`<ul>${c(
21425
+ items,
21426
+ (item2) => item2.id,
21427
+ (item2) => this.#package(item2, all2, Boolean(port.actPackage))
21428
+ )}</ul>`;
21429
+ }
21403
21430
  #packages(port) {
21404
21431
  if (!port?.packages) return A;
21405
21432
  const all2 = port.packages();
21433
+ const offered = all2.filter((item2) => item2.origin !== "user");
21434
+ const yours = all2.filter((item2) => item2.origin === "user");
21406
21435
  return b`<section data-section="packages" aria-labelledby="packages">
21407
21436
  <swc-divider size="m"></swc-divider>
21408
21437
  <h2 id="packages">Optional packages</h2>
21409
21438
  <p class="hint">
21410
- ${all2.length ? "Tools for the agent and the terminal. Install the ones you need; you can remove them later." : "No optional packages are offered right now."}
21439
+ ${offered.length ? "Tools for the agent and the terminal. Install the ones you need; you can remove them later." : "No optional packages are offered right now."}
21411
21440
  </p>
21412
- ${all2.length ? b`<ul>${c(
21413
- all2,
21414
- (item2) => item2.id,
21415
- (item2) => this.#package(item2, all2, Boolean(port.actPackage))
21416
- )}</ul>` : A}
21417
- </section>`;
21441
+ ${offered.length ? this.#list(offered, all2, port) : A}
21442
+ </section>
21443
+ ${yours.length ? b`<section data-section="user-packages" aria-labelledby="user-packages">
21444
+ <swc-divider size="m"></swc-divider>
21445
+ <h2 id="user-packages">Your packages</h2>
21446
+ <p class="hint">Packages you added or pinned with pnpm in /opt/agent or /opt/grammars. Seven’s updates keep them until you unpin or remove them.</p>
21447
+ ${this.#list(yours, all2, port)}
21448
+ </section>` : A}`;
21418
21449
  }
21419
21450
  render() {
21420
21451
  const port = this.model?.updates;