@ai-ecoverse/slicc-spectrum 1.33.0 → 1.35.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.
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  DummySettings,
6
6
  clock
7
- } from "./chunk-43NIJXWH.js";
7
+ } from "./chunk-UKNZUMF6.js";
8
8
  import {
9
9
  Emitter
10
10
  } from "./chunk-T5NHW4KC.js";
package/dist/slicc-ui.js CHANGED
@@ -10596,6 +10596,11 @@ var routes = {
10596
10596
  page: "Through this page\u2019s own fetch. Sites that block cross-origin requests are out of reach.",
10597
10597
  none: "No route to the network."
10598
10598
  };
10599
+ var automation = {
10600
+ extension: "Browser automation: through the SLICC extension.",
10601
+ proxy: "Browser automation: through slicc-node.",
10602
+ none: "Browser automation: not available. Install the extension or run slicc-node."
10603
+ };
10599
10604
  function networkLabel(status2) {
10600
10605
  return `Network: ${networkHealth[status2.health][1].toLowerCase()}`;
10601
10606
  }
@@ -10826,6 +10831,7 @@ var SliccNetwork = class extends ModelElement {
10826
10831
  </div>
10827
10832
  <p data-route=${status2.route ?? "none"}>${routes[status2.route ?? "none"]}</p>
10828
10833
  ${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}
10829
10835
  ${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}
10830
10836
  ${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}
10831
10837
  </section>`;
@@ -20898,7 +20904,8 @@ var SliccChat = class extends ThemedElement {
20898
20904
  <sp-menu-item value="high">Think hard</sp-menu-item>
20899
20905
  </sp-picker>
20900
20906
  ${meter}
20901
- <swc-action-button size="s" quiet data-action="new-chat" ?disabled=${empty2} @click=${() => this.#newChat(agent)}><swc-icon-new slot="icon"></swc-icon-new>New chat</swc-action-button>`;
20907
+ <swc-action-button id="new-chat" size="s" quiet data-action="new-chat" ?disabled=${empty2} @click=${() => this.#newChat(agent)}><swc-icon-new slot="icon"></swc-icon-new>New chat</swc-action-button>
20908
+ <swc-tooltip for="new-chat" placement="bottom">${agent.kind === "cone" && model.agent.freeze ? "Freeze this chat and start a new one" : "Start a new chat"}</swc-tooltip>`;
20902
20909
  }
20903
20910
  render() {
20904
20911
  this.#handlers.color = this.color;
@@ -21783,7 +21790,7 @@ function available(model) {
21783
21790
  var commands = [
21784
21791
  {
21785
21792
  name: "clear",
21786
- detail: "Start the conversation over",
21793
+ detail: "Start a new chat",
21787
21794
  run: (model, id) => model.agent.clear(id)
21788
21795
  },
21789
21796
  {
@@ -23122,7 +23129,8 @@ var SliccMonitor = class extends ModelElement {
23122
23129
  var accountStatus = {
23123
23130
  connected: ["positive", "Connected"],
23124
23131
  expired: ["notice", "Expired"],
23125
- disconnected: ["neutral", "Not connected"]
23132
+ disconnected: ["neutral", "Not connected"],
23133
+ "signing-in": ["info", "Signing in\u2026"]
23126
23134
  };
23127
23135
  var SliccSettings = class extends ModelElement {
23128
23136
  static properties = {
@@ -23280,15 +23288,18 @@ var SliccSettings = class extends ModelElement {
23280
23288
  #checked(event2) {
23281
23289
  return event2.target.checked;
23282
23290
  }
23291
+ #cancelled = /* @__PURE__ */ new Set();
23283
23292
  async connect(id, secret) {
23284
23293
  this.pending = /* @__PURE__ */ new Set([...this.pending, id]);
23285
23294
  this.failure = null;
23295
+ this.#cancelled.delete(id);
23286
23296
  try {
23287
23297
  await this.model?.settings.connect(id, secret);
23288
23298
  if (this.entering === id) this.entering = null;
23289
23299
  } catch (error) {
23290
- this.failure = { id, message: error.message };
23300
+ if (!this.#cancelled.has(id)) this.failure = { id, message: error.message };
23291
23301
  } finally {
23302
+ this.#cancelled.delete(id);
23292
23303
  this.pending = new Set([...this.pending].filter((candidate) => candidate !== id));
23293
23304
  }
23294
23305
  }
@@ -23342,7 +23353,23 @@ var SliccSettings = class extends ModelElement {
23342
23353
  if (await confirm({ title, body: body4, action: "Disconnect", variant: "confirmation" }))
23343
23354
  this.model?.settings.disconnect(account.id);
23344
23355
  }
23356
+ #stopSigningIn(account) {
23357
+ this.#cancelled.add(account.id);
23358
+ this.model?.settings.cancel?.(account.id);
23359
+ }
23360
+ #signingIn(account) {
23361
+ return account.status === "signing-in" || account.auth !== "api-key" && account.status !== "connected" && this.pending.has(account.id);
23362
+ }
23345
23363
  #action(account) {
23364
+ if (this.#signingIn(account) && this.model?.settings.cancel) {
23365
+ return b`<swc-button
23366
+ size="m"
23367
+ variant="secondary"
23368
+ data-action="cancel-sign-in"
23369
+ accessible-label=${`Cancel signing in to ${account.provider}`}
23370
+ @click=${() => this.#stopSigningIn(account)}
23371
+ >Cancel</swc-button>`;
23372
+ }
23346
23373
  if (account.status === "connected") {
23347
23374
  return b`<swc-button
23348
23375
  size="m"
@@ -23354,18 +23381,19 @@ var SliccSettings = class extends ModelElement {
23354
23381
  }
23355
23382
  const label = account.status === "expired" ? "Reconnect" : "Connect";
23356
23383
  const entering = this.entering === account.id;
23384
+ const busy = this.#signingIn(account) || !entering && this.pending.has(account.id);
23357
23385
  return b`<swc-button
23358
23386
  size="m"
23359
23387
  variant="secondary"
23360
23388
  data-action="connect"
23361
23389
  accessible-label=${`${label} ${account.provider}`}
23362
- ?pending=${!entering && this.pending.has(account.id)}
23390
+ ?pending=${busy}
23363
23391
  ?disabled=${entering}
23364
23392
  @click=${() => this.#start(account)}
23365
23393
  >${label}</swc-button>`;
23366
23394
  }
23367
23395
  #account(account) {
23368
- const [variant, label] = accountStatus[account.status];
23396
+ const [variant, label] = accountStatus[this.#signingIn(account) ? "signing-in" : account.status];
23369
23397
  const failure2 = this.failure?.id === account.id ? b`<div class="failure" role="alert">
23370
23398
  <swc-icon-alert-triangle size="s" aria-hidden="true"></swc-icon-alert-triangle>
23371
23399
  <span>${this.failure.message}</span>