@ai-ecoverse/slicc-spectrum 1.108.6 → 1.109.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
@@ -49899,6 +49899,7 @@ function truncated(approval) {
49899
49899
  function hintOf(approval) {
49900
49900
  return approval.kind === "sudo" ? commandText(alwaysHint(approval), false) : guestAlwaysHint(approval);
49901
49901
  }
49902
+ var deniedSudo = (approval) => approval.kind === "sudo" && approval.verdict?.decision === "deny";
49902
49903
  var tooLong = "This request is too long to show in full, so it can\u2019t be allowed.";
49903
49904
  function guestWaiting(approval) {
49904
49905
  return approval.kind === "guest-message" ? `${approval.requester.name}'s message to ${approval.agentName ?? "this cone"} waits for the owner's approval.` : `${approval.agentName ?? "This cone"} wants to run ${approval.tool} for ${approval.requester.name}, which waits for the owner's approval.`;
@@ -50141,7 +50142,8 @@ var SliccApprovals = class extends ModelElement {
50141
50142
  return;
50142
50143
  const verdict = rulesOf(approval);
50143
50144
  const always = approval.kind === "sudo" || approval.kind !== "tray" && approval.always;
50144
- if (decision2 === "always" && (!always || verdict.certain || verdict.maybe)) return;
50145
+ if (decision2 === "always" && (!always || deniedSudo(approval) || verdict.certain || verdict.maybe))
50146
+ return;
50145
50147
  this.busy = decision2;
50146
50148
  this.failure = null;
50147
50149
  this.#pending.add(approval.id);
@@ -50269,7 +50271,7 @@ var SliccApprovals = class extends ModelElement {
50269
50271
  ${files.length ? b`<ul class="files" data-attachments>${files.map((file) => b`<li>${file.name} · ${file.mimeType} · ${size3(file.size)}</li>`)}</ul>` : A}`;
50270
50272
  }
50271
50273
  #verdict(approval) {
50272
- const verdict = approval.kind === "sudo" || approval.kind === "tray" ? void 0 : approval.verdict;
50274
+ const verdict = approval.kind === "tray" ? void 0 : approval.verdict;
50273
50275
  return verdict ? b`<p class="verdict" data-verdict=${verdict.decision}>${verdict.decision === "unsure" ? "The automatic check wasn\u2019t sure" : `The automatic check would ${verdict.decision} this`}: ${verdict.reason}</p>` : A;
50274
50276
  }
50275
50277
  #actions(approval, rejected, always) {
@@ -50278,7 +50280,7 @@ var SliccApprovals = class extends ModelElement {
50278
50280
  const whole = this.#whole(approval);
50279
50281
  return b`${this.#button(approval, "deny", "Deny", "secondary")}
50280
50282
  ${whole && always ? this.#button(approval, "always", inCwd(approval) ? "Always allow in this directory" : "Always allow", "secondary") : A}
50281
- ${whole ? this.#button(approval, "once", "Allow once", "accent") : A}`;
50283
+ ${whole ? this.#button(approval, "once", deniedSudo(approval) ? "Allow anyway (once)" : "Allow once", "accent") : A}`;
50282
50284
  }
50283
50285
  render() {
50284
50286
  if (this.gone) {
@@ -50301,7 +50303,7 @@ var SliccApprovals = class extends ModelElement {
50301
50303
  const failure2 = this.failure?.id === approval.id ? this.failure.message : "";
50302
50304
  const verdict = rulesOf(approval);
50303
50305
  const rules = verdict.certain ?? verdict.maybe;
50304
- const always = approval.kind !== "tray" && approval.always && !rules;
50306
+ const always = approval.kind !== "tray" && approval.always && !deniedSudo(approval) && !rules;
50305
50307
  const gate = this.#gate(approval);
50306
50308
  const hint2 = always && this.#whole(approval) ? hintOf(approval) : "";
50307
50309
  return this.#dialog(
@@ -50310,8 +50312,8 @@ var SliccApprovals = class extends ModelElement {
50310
50312
  b`<sp-alert-dialog variant="warning" data-approval-kind=${approval.kind}>
50311
50313
  <h2 id="title" slot="heading">${title(approval)}</h2>
50312
50314
  ${this.#request(approval, true)}
50313
- ${this.#verdict(approval)}
50314
50315
  ${approval.kind === "sudo" && approval.cwd ? b`<p class="cwd">In ${commandText(approval.cwd, false)}</p>` : A}
50316
+ ${this.#verdict(approval)}
50315
50317
  ${rules ? b`<div class="rules" data-secret-rules=${rules}><swc-icon-alert-triangle size="s" aria-hidden="true"></swc-icon-alert-triangle><p>${verdict.certain ? b`<strong>This changes secret rules.</strong> It names <code>${commandText(rules, false)}</code>, where SLICC keeps which secrets programs may use and where they may be sent.` : b`<strong>This may change secret rules.</strong> SLICC can't tell where <code>${commandText(rules, false)}</code> leads, and it could reach the files where SLICC keeps which secrets programs may use and where they may be sent.`} Allow it only if you asked for this change.</p></div>` : A}
50316
50318
  ${hint2 ? b`<p class="hint">${hint2}</p>` : A}
50317
50319
  ${!failure2 && gate ? b`<p class="hint" data-allow-hint>${gate}</p>` : A}