@ai-ecoverse/slicc-spectrum 1.84.1 → 1.85.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
@@ -8675,6 +8675,15 @@ var o43 = class extends a10 {
8675
8675
  e25("swc-icon-close", o43);
8676
8676
 
8677
8677
  // src/app/base.ts
8678
+ var typed = false;
8679
+ document.addEventListener("keydown", () => typed = true, true);
8680
+ document.addEventListener("pointerdown", () => typed = false, true);
8681
+ function keyboardFocus() {
8682
+ let active = document.activeElement;
8683
+ while (active?.shadowRoot?.activeElement) active = active.shadowRoot.activeElement;
8684
+ if (!active || active === document.body) return typed;
8685
+ return active.matches(":focus-visible");
8686
+ }
8678
8687
  var ModelElement = class extends i2 {
8679
8688
  static properties = { model: { attribute: false } };
8680
8689
  static shadowRootOptions = {
@@ -8693,7 +8702,8 @@ var ModelElement = class extends i2 {
8693
8702
  this.focusWith({}, ...selectors);
8694
8703
  }
8695
8704
  focusWith(options, ...selectors) {
8696
- const focus = () => selectors.map((selector) => this.renderRoot.querySelector(selector)).find(Boolean)?.focus(options);
8705
+ const settled3 = { focusVisible: keyboardFocus(), ...options };
8706
+ const focus = () => selectors.map((selector) => this.renderRoot.querySelector(selector)).find(Boolean)?.focus(settled3);
8697
8707
  if (this.hasUpdated) focus();
8698
8708
  else void this.updateComplete.then(focus);
8699
8709
  }
@@ -9750,6 +9760,8 @@ var lights = {
9750
9760
  failed: ["negative", (owner) => `Can\u2019t reach ${owner}`]
9751
9761
  };
9752
9762
  function followLight(state2) {
9763
+ if (state2.refused && state2.link === "connected")
9764
+ return { variant: "neutral", text: `Can\u2019t follow ${state2.owner}` };
9753
9765
  const [variant, text2] = lights[state2.link];
9754
9766
  return { variant, text: text2(state2.owner) };
9755
9767
  }
@@ -9787,6 +9799,7 @@ function list(items, last) {
9787
9799
  return `${items.slice(0, -1).join(", ")} ${last} ${items.at(-1)}`;
9788
9800
  }
9789
9801
  function followCan(state2) {
9802
+ if (state2.refused) return state2.refused;
9790
9803
  const allowed = ["watch the agent"];
9791
9804
  const missing = [];
9792
9805
  (state2.access.control ? allowed : missing).push("send prompts");
@@ -9802,7 +9815,9 @@ function watchOnly(model) {
9802
9815
  const text2 = model?.agent?.readOnly?.();
9803
9816
  if (text2) return text2;
9804
9817
  const state2 = following(model);
9805
- if (!state2 || state2.access.control) return "";
9818
+ if (!state2) return "";
9819
+ if (state2.refused) return state2.refused;
9820
+ if (state2.access.control) return "";
9806
9821
  return `Watch only. To send prompts from this device, allow Control for it on ${state2.owner}.`;
9807
9822
  }
9808
9823
  function onWatch(model, listener) {
@@ -9813,7 +9828,7 @@ function onWatch(model, listener) {
9813
9828
  }
9814
9829
  function terminalsAllowed(model) {
9815
9830
  const state2 = model?.follow?.state();
9816
- return !state2 || !!state2.access.terminal;
9831
+ return !state2 || !state2.refused && !!state2.access.terminal;
9817
9832
  }
9818
9833
  var SliccFollow = class extends ModelElement {
9819
9834
  static properties = {
@@ -33329,7 +33344,9 @@ var SliccUpdates = class extends ModelElement {
33329
33344
  ${yours.length ? b`<section data-section="user-packages" aria-labelledby="user-packages">
33330
33345
  <swc-divider size="m"></swc-divider>
33331
33346
  <h2 id="user-packages">Your packages</h2>
33332
- <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>
33347
+ <p class="hint">
33348
+ Packages you added with pnpm in /opt/user. Seven’s updates keep them until you remove them.${yours.some((item2) => item2.actions.includes("unpin")) ? " Pinned versions stay until you unpin them." : ""}
33349
+ </p>
33333
33350
  ${this.#list(yours, all2, port)}
33334
33351
  </section>` : A}`;
33335
33352
  }
@@ -35186,7 +35203,7 @@ function called(value = "") {
35186
35203
  return `Called ${url}`.trim();
35187
35204
  }
35188
35205
  }
35189
- function typed(action) {
35206
+ function typed2(action) {
35190
35207
  const count = action.length === void 0 ? "" : ` ${action.length} ${action.length === 1 ? "character" : "characters"}`;
35191
35208
  return `Typed${count}${action.target ? ` into ${action.target}` : ""}`;
35192
35209
  }
@@ -35201,8 +35218,8 @@ var verbs2 = {
35201
35218
  screenshot: () => "Took a screenshot",
35202
35219
  eval: () => "Ran a script",
35203
35220
  click: (action) => `Clicked${action.target ? ` ${action.target}` : ""}`,
35204
- fill: typed,
35205
- type: typed,
35221
+ fill: typed2,
35222
+ type: typed2,
35206
35223
  press: (action) => `Pressed${action.value ? ` ${action.value}` : ""}`,
35207
35224
  scroll: () => "Scrolled",
35208
35225
  request: (action) => called(action.value)
@@ -37623,7 +37640,7 @@ var SliccChat = class extends ThemedElement {
37623
37640
  </div>
37624
37641
  </div>
37625
37642
  ${this.dropping ? b`<swc-dropzone dragged size="l" aria-label="Attach files" dragged-message="Drop to attach"><p>Drop to attach</p></swc-dropzone>` : A}
37626
- ${watch ? b`<p class="watch-only" role="note" data-follow="watch">${watch}</p>` : this.model && !agent?.frozen ? b`<slicc-composer .model=${this.model} .agent=${this.agent}></slicc-composer>` : A}
37643
+ ${watch ? watch === following(this.model)?.refused ? A : b`<p class="watch-only" role="note" data-follow="watch">${watch}</p>` : this.model && !agent?.frozen ? b`<slicc-composer .model=${this.model} .agent=${this.agent}></slicc-composer>` : A}
37627
37644
  `;
37628
37645
  }
37629
37646
  };