@ai-ecoverse/slicc-spectrum 1.61.0 → 1.62.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
@@ -26564,13 +26564,14 @@ function trigger(text2, caret) {
26564
26564
  return { kind: "mention", start: before.length - mention[2].length - 1, query: mention[2] };
26565
26565
  return null;
26566
26566
  }
26567
- var SliccComposer = class extends ModelElement {
26567
+ var SliccComposer = class extends ThemedElement {
26568
26568
  static properties = {
26569
- ...ModelElement.properties,
26569
+ ...ThemedElement.properties,
26570
26570
  value: { state: true },
26571
26571
  attachments: { state: true },
26572
26572
  popup: { state: true },
26573
26573
  dictating: { state: true },
26574
+ blocked: { state: true },
26574
26575
  agent: {}
26575
26576
  };
26576
26577
  #drafts = /* @__PURE__ */ new Map();
@@ -26586,6 +26587,7 @@ var SliccComposer = class extends ModelElement {
26586
26587
  this.attachments = [];
26587
26588
  this.popup = null;
26588
26589
  this.dictating = false;
26590
+ this.blocked = false;
26589
26591
  this.agent = "";
26590
26592
  }
26591
26593
  static styles = [
@@ -26624,6 +26626,38 @@ var SliccComposer = class extends ModelElement {
26624
26626
  border: var(--swc-border-width-100) dashed var(--swc-gray-300);
26625
26627
  color: var(--swc-neutral-content-color-default);
26626
26628
  }
26629
+ .hold {
26630
+ display: flex;
26631
+ flex-wrap: wrap;
26632
+ align-items: center;
26633
+ gap: var(--swc-spacing-100);
26634
+ margin: 0 0 var(--swc-spacing-100);
26635
+ padding: var(--swc-spacing-75) var(--swc-spacing-100) var(--swc-spacing-75) var(--swc-spacing-200);
26636
+ border-radius: var(--swc-corner-radius-medium-default);
26637
+ background: var(--swc-informative-subtle-background-color-default);
26638
+ color: var(--swc-neutral-content-color-default);
26639
+ }
26640
+ .hold[data-hold='locked'] {
26641
+ background: var(--swc-notice-subtle-background-color-default);
26642
+ }
26643
+ .hold swc-icon-lock,
26644
+ .hold swc-progress-circle {
26645
+ flex: none;
26646
+ }
26647
+ .hold .text {
26648
+ flex: 1;
26649
+ min-inline-size: 12em;
26650
+ }
26651
+ .hold .blocked {
26652
+ flex-basis: 100%;
26653
+ display: flex;
26654
+ align-items: center;
26655
+ gap: var(--swc-spacing-75);
26656
+ color: var(--swc-negative-content-color-default);
26657
+ }
26658
+ .hold .held {
26659
+ color: var(--swc-neutral-subdued-content-color-default);
26660
+ }
26627
26661
  .queued swc-icon-clock {
26628
26662
  flex: none;
26629
26663
  color: var(--swc-neutral-subdued-content-color-default);
@@ -26818,9 +26852,14 @@ var SliccComposer = class extends ModelElement {
26818
26852
  });
26819
26853
  const update = () => this.requestUpdate();
26820
26854
  return [
26855
+ ...super.subscribe(model),
26821
26856
  model.agent.on("active", (id) => {
26822
26857
  if (!this.agent) this.#switch(id);
26823
26858
  }),
26859
+ model.agent.on("hold", (hold) => {
26860
+ if (hold?.reason !== "locked") this.blocked = false;
26861
+ update();
26862
+ }),
26824
26863
  model.agent.on("agents", update),
26825
26864
  model.agent.on("messages", update),
26826
26865
  model.agent.on("message", update),
@@ -27206,6 +27245,26 @@ var SliccComposer = class extends ModelElement {
27206
27245
  ) : b`<div class="empty">Nothing matches.</div>`}
27207
27246
  </div>`;
27208
27247
  }
27248
+ #hold() {
27249
+ const hold = this.model?.agent.hold?.();
27250
+ if (!hold) return A;
27251
+ const locked = hold.reason === "locked";
27252
+ const vault = this.model?.vault;
27253
+ const held = hold.held === 1 ? "1 tool result held" : `${hold.held} tool results held`;
27254
+ return b`<div class="hold" role="status" data-hold=${hold.reason}>
27255
+ ${locked ? b`<swc-icon-lock size="s" aria-hidden="true"></swc-icon-lock>` : b`<swc-progress-circle size="s" label="Waiting" aria-hidden="true"></swc-progress-circle>`}
27256
+ <span class="text">${locked ? "Unlock the vault to continue" : "Waiting for the vault"}${hold.held ? b`<span class="held"> · ${held}</span>` : A}</span>
27257
+ ${locked && vault ? b`<slicc-vault-button
27258
+ data-action="unlock-vault"
27259
+ .vault=${vault}
27260
+ .config=${{ intent: { kind: "unlock" }, label: "Unlock", size: "s", variant: "accent", theme: this.color }}
27261
+ @vault-popup=${(event2) => {
27262
+ this.blocked = event2.detail.state === "blocked";
27263
+ }}
27264
+ ></slicc-vault-button>` : A}
27265
+ ${locked && this.blocked ? b`<span class="blocked" role="alert" data-popup="blocked"><swc-icon-alert-triangle size="s" aria-hidden="true"></swc-icon-alert-triangle>The browser blocked the vault window. Allow pop-ups for this site, then try again.</span>` : A}
27266
+ </div>`;
27267
+ }
27209
27268
  #queue() {
27210
27269
  const queued = this.model?.agent.queue(this.#agent) ?? [];
27211
27270
  if (queued.length === 0) return A;
@@ -27236,6 +27295,7 @@ var SliccComposer = class extends ModelElement {
27236
27295
  const speech = "SpeechRecognition" in globalThis || "webkitSpeechRecognition" in globalThis;
27237
27296
  const held = this.#held();
27238
27297
  return b`<div class="column">
27298
+ ${this.#hold()}
27239
27299
  ${this.#queue()}
27240
27300
  ${this.#popup()}
27241
27301
  <swc-prompt-field