@ai-ecoverse/slicc-spectrum 2.9.2 → 2.10.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
@@ -39964,7 +39964,7 @@ function watchTitles(model, update) {
39964
39964
  seen.set(id, title2);
39965
39965
  update();
39966
39966
  };
39967
- const stops = [
39967
+ const stops2 = [
39968
39968
  model.agent.on("messages", check3),
39969
39969
  model.agent.on("message", ({ agentId }) => check3(agentId)),
39970
39970
  model.agent.on("agents", (agents) => {
@@ -39974,7 +39974,7 @@ function watchTitles(model, update) {
39974
39974
  })
39975
39975
  ];
39976
39976
  return () => {
39977
- for (const stop of stops) stop();
39977
+ for (const stop of stops2) stop();
39978
39978
  };
39979
39979
  }
39980
39980
 
@@ -51980,8 +51980,11 @@ function extras(approval) {
51980
51980
  if (approval.kind === "capture") return [approval.detail, approval.requester];
51981
51981
  return [];
51982
51982
  }
51983
+ var stops = (approval) => approval.kind === "sudo" && approval.stoppable === true && approval.requester.kind === "agent" && !!approval.requester.agentId;
51984
+ var denies = (decision2) => decision2 === "deny" || decision2 === "stop";
51983
51985
  function answerable(approval, decision2) {
51984
51986
  if (decision2 === "deny") return true;
51987
+ if (decision2 === "stop") return stops(approval);
51985
51988
  if (approval.kind === "secret") return false;
51986
51989
  return approval.kind !== "click" || approval.here;
51987
51990
  }
@@ -52152,9 +52155,23 @@ var SliccApprovals = class extends ModelElement {
52152
52155
  .judged p {
52153
52156
  margin: 0;
52154
52157
  }
52155
- [slot='button'][data-action='deny'] {
52158
+ [slot='button'][data-action='deny'],
52159
+ [slot='button'][data-action='stop'] {
52156
52160
  margin-inline-end: auto;
52157
52161
  }
52162
+ [slot='button'][data-action='deny']:has(+ [data-action='stop']) {
52163
+ margin-inline-end: 0;
52164
+ }
52165
+ sp-alert-dialog {
52166
+ --mod-buttongroup-spacing: var(--swc-spacing-300);
52167
+ }
52168
+ .break {
52169
+ flex-basis: 100%;
52170
+ block-size: 0;
52171
+ }
52172
+ .break ~ [slot='button'] {
52173
+ margin-block-start: calc(-1 * var(--swc-spacing-300));
52174
+ }
52158
52175
  .prompt {
52159
52176
  margin-block-start: var(--swc-spacing-200);
52160
52177
  padding-inline-start: var(--swc-spacing-200);
@@ -52264,10 +52281,11 @@ var SliccApprovals = class extends ModelElement {
52264
52281
  async decide(approval, decision2) {
52265
52282
  const port = this.model?.approvals;
52266
52283
  const { id } = approval;
52267
- if (!port?.decide || this.busy || this.gone || this.#showing?.id !== id || this.#done.has(id) || this.#closed.has(id) || !answerable(approval, decision2) || decision2 !== "deny" && (!this.#arming.settled() || !this.#whole(approval)))
52284
+ if (!port?.decide || this.busy || this.gone || this.#showing?.id !== id || this.#done.has(id) || this.#closed.has(id) || !answerable(approval, decision2) || !denies(decision2) && (!this.#arming.settled() || !this.#whole(approval)))
52268
52285
  return;
52269
52286
  const live = port.list().find(({ id: id2 }) => id2 === approval.id);
52270
52287
  if (decision2 === "always" && !(live && offersAlways(live))) return;
52288
+ if (decision2 === "stop" && !(live && stops(live))) return;
52271
52289
  this.busy = decision2;
52272
52290
  this.failure = null;
52273
52291
  this.#pending.add(approval.id);
@@ -52407,7 +52425,7 @@ var SliccApprovals = class extends ModelElement {
52407
52425
  fill-style=${variant === "accent" ? A : "outline"}
52408
52426
  data-action=${decision2}
52409
52427
  ?pending=${this.busy === decision2}
52410
- ?disabled=${!!this.busy && this.busy !== decision2 || decision2 !== "deny" && !this.#whole(approval)}
52428
+ ?disabled=${!!this.busy && this.busy !== decision2 || !denies(decision2) && !this.#whole(approval)}
52411
52429
  @click=${(event2) => this.#click(event2, approval, decision2)}
52412
52430
  >${label}</swc-button
52413
52431
  >`;
@@ -52469,6 +52487,7 @@ var SliccApprovals = class extends ModelElement {
52469
52487
  return b`<swc-button slot="button" variant="secondary" fill-style="outline" data-action="close" @click=${() => this.#dismiss(approval)}>Close</swc-button>`;
52470
52488
  const click = approval.kind === "click";
52471
52489
  return b`${this.#button(approval, "deny", click ? "Cancel" : "Deny", "secondary")}
52490
+ ${stops(approval) ? b`${this.#button(approval, "stop", "Deny and stop", "secondary")}<span slot="button" class="break" aria-hidden="true"></span>` : A}
52472
52491
  ${always ? this.#button(approval, "always", inCwd(approval) ? "Always allow in this directory" : "Always allow", "secondary") : A}
52473
52492
  ${answerable(approval, "once") ? this.#button(approval, "once", click ? approval.action : "Allow once", "accent") : A}`;
52474
52493
  }