@ai-ecoverse/slicc-spectrum 1.82.0 → 1.84.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/README.md +831 -123
- package/dist/slicc-dummy.js +46 -1
- package/dist/slicc-dummy.js.map +2 -2
- package/dist/slicc-ui.js +64 -32
- package/dist/slicc-ui.js.map +3 -3
- package/dist/types/app/approvals.d.ts +1 -0
- package/dist/types/app/guests.d.ts +3 -1
- package/dist/types/dummy/approvals.d.ts +1 -1
- package/dist/types/dummy/guest.d.ts +1 -0
- package/dist/types/dummy/guests.d.ts +4 -2
- package/dist/types/dummy.d.ts +2 -2
- package/dist/types/model/types.d.ts +7 -2
- package/package.json +4 -4
package/dist/slicc-ui.js
CHANGED
|
@@ -12325,30 +12325,43 @@ var guestExpiries = [
|
|
|
12325
12325
|
];
|
|
12326
12326
|
var guestNameLimit = 40;
|
|
12327
12327
|
var approve = "A person with Control approves each one.";
|
|
12328
|
-
|
|
12329
|
-
|
|
12330
|
-
|
|
12331
|
-
|
|
12332
|
-
|
|
12333
|
-
|
|
12334
|
-
|
|
12335
|
-
|
|
12336
|
-
|
|
12337
|
-
label:
|
|
12338
|
-
|
|
12339
|
-
|
|
12340
|
-
|
|
12341
|
-
|
|
12342
|
-
|
|
12343
|
-
|
|
12344
|
-
|
|
12328
|
+
var defaultGates = {
|
|
12329
|
+
messages: ["user", "agent", "cone", "scoop:*", "off"],
|
|
12330
|
+
tools: ["user", "agent", "scoop:*"]
|
|
12331
|
+
};
|
|
12332
|
+
function gateChoice(field, cone, gate) {
|
|
12333
|
+
if (gate === "scoop:*")
|
|
12334
|
+
return cone.scoops.flatMap((name) => gateChoice(field, cone, `scoop:${name}`));
|
|
12335
|
+
if (gate.startsWith("scoop:")) {
|
|
12336
|
+
const name = gate.slice(6);
|
|
12337
|
+
return cone.scoops.includes(name) ? [{ value: gate, label: `${name} decides`, description: `The scoop ${name} decides.` }] : [];
|
|
12338
|
+
}
|
|
12339
|
+
const choices = {
|
|
12340
|
+
user: { value: "user", label: "You approve each one", description: approve },
|
|
12341
|
+
agent: {
|
|
12342
|
+
value: "agent",
|
|
12343
|
+
label: "The automatic check decides",
|
|
12344
|
+
description: "It decides by your intent, and asks a person when unsure."
|
|
12345
|
+
},
|
|
12346
|
+
cone: {
|
|
12345
12347
|
value: "cone",
|
|
12346
12348
|
label: `${cone.name} decides`,
|
|
12347
12349
|
description: "The shared cone itself decides."
|
|
12348
12350
|
},
|
|
12349
|
-
|
|
12350
|
-
|
|
12351
|
-
|
|
12351
|
+
off: {
|
|
12352
|
+
value: "off",
|
|
12353
|
+
label: "No review",
|
|
12354
|
+
description: field === "messages" ? "Messages go straight in as follow-ups." : "Tool calls run without review."
|
|
12355
|
+
}
|
|
12356
|
+
};
|
|
12357
|
+
return choices[gate] ? [choices[gate]] : [];
|
|
12358
|
+
}
|
|
12359
|
+
function gateOptions(field, cone, allowed = defaultGates[field]) {
|
|
12360
|
+
const options = allowed.flatMap((gate) => gateChoice(field, cone, gate)).filter((option2, index, all2) => all2.findIndex(({ value }) => value === option2.value) === index);
|
|
12361
|
+
return options.length ? options : gateChoice(field, cone, "user");
|
|
12362
|
+
}
|
|
12363
|
+
function defaultGate(options) {
|
|
12364
|
+
return options.some(({ value }) => value === "user") ? "user" : options[0].value;
|
|
12352
12365
|
}
|
|
12353
12366
|
function guestCones(agents) {
|
|
12354
12367
|
return agents.filter((agent) => agent.kind === "cone" && !agent.frozen).map((cone) => ({
|
|
@@ -12490,16 +12503,25 @@ var SliccGuestInvite = class extends i2 {
|
|
|
12490
12503
|
get #current() {
|
|
12491
12504
|
return this.cones.find((cone) => cone.id === this.cone) ?? this.cones[0];
|
|
12492
12505
|
}
|
|
12506
|
+
#options(field, cone) {
|
|
12507
|
+
return gateOptions(field, cone, this.port?.gates?.()[field]);
|
|
12508
|
+
}
|
|
12493
12509
|
#keep(gate, field, cone) {
|
|
12494
|
-
|
|
12510
|
+
const options = this.#options(field, cone);
|
|
12511
|
+
return options.some((option2) => option2.value === gate) ? gate : defaultGate(options);
|
|
12512
|
+
}
|
|
12513
|
+
#settle() {
|
|
12514
|
+
this.messages = this.#keep(this.messages, "messages", this.#current);
|
|
12515
|
+
this.tools = this.#keep(this.tools, "tools", this.#current);
|
|
12495
12516
|
}
|
|
12496
12517
|
#pick(event2) {
|
|
12497
12518
|
return event2.target.value;
|
|
12498
12519
|
}
|
|
12499
12520
|
#setCone(event2) {
|
|
12500
12521
|
this.cone = this.#pick(event2);
|
|
12501
|
-
|
|
12502
|
-
|
|
12522
|
+
}
|
|
12523
|
+
willUpdate() {
|
|
12524
|
+
this.#settle();
|
|
12503
12525
|
}
|
|
12504
12526
|
#input(event2) {
|
|
12505
12527
|
this.label = event2.currentTarget.value;
|
|
@@ -12520,6 +12542,7 @@ var SliccGuestInvite = class extends i2 {
|
|
|
12520
12542
|
this.#focus("#guest-name");
|
|
12521
12543
|
return;
|
|
12522
12544
|
}
|
|
12545
|
+
this.#settle();
|
|
12523
12546
|
const ms = guestExpiries.find(([key2]) => key2 === this.expiry)[2];
|
|
12524
12547
|
this.pending = true;
|
|
12525
12548
|
try {
|
|
@@ -12557,7 +12580,7 @@ var SliccGuestInvite = class extends i2 {
|
|
|
12557
12580
|
if (this.trigger?.isConnected) this.trigger.focus();
|
|
12558
12581
|
}
|
|
12559
12582
|
#gate(field, title, value) {
|
|
12560
|
-
const options =
|
|
12583
|
+
const options = this.#options(field, this.#current);
|
|
12561
12584
|
const chosen = options.find((option2) => option2.value === value);
|
|
12562
12585
|
const id = `guest-${field}`;
|
|
12563
12586
|
return b`<div class="field">
|
|
@@ -31633,7 +31656,12 @@ function event(label, content) {
|
|
|
31633
31656
|
function outside(label, byline2, content) {
|
|
31634
31657
|
return b`<swc-conversation-turn type="user" class="event lick-turn" accessible-label=${label}><div class="bubble">${byline2}${content}</div></swc-conversation-turn>`;
|
|
31635
31658
|
}
|
|
31636
|
-
var ended2 = /* @__PURE__ */ new Set([
|
|
31659
|
+
var ended2 = /* @__PURE__ */ new Set([
|
|
31660
|
+
"Nobody approved this in time.",
|
|
31661
|
+
"It was declined.",
|
|
31662
|
+
"It was withdrawn.",
|
|
31663
|
+
"It was approved."
|
|
31664
|
+
]);
|
|
31637
31665
|
function system(message, handlers) {
|
|
31638
31666
|
if (message.kind === "compaction") {
|
|
31639
31667
|
const failed2 = message.state === "fallback" || message.state === "discarded";
|
|
@@ -31652,7 +31680,7 @@ function system(message, handlers) {
|
|
|
31652
31680
|
"Notice",
|
|
31653
31681
|
b`<div class="marker notice" role="note" data-id=${message.id} data-ended>
|
|
31654
31682
|
<span class="line"></span>
|
|
31655
|
-
<span class="marker-text"
|
|
31683
|
+
<span class="marker-text">${message.title === "It was approved." ? A : b`<span class="said" title=${message.text}>“${message.text}”</span> `}<span class="outcome">${message.title}</span></span>
|
|
31656
31684
|
<span class="line"></span>
|
|
31657
31685
|
</div>`
|
|
31658
31686
|
);
|
|
@@ -34469,11 +34497,15 @@ var inCwd = (approval) => approval.kind === "sudo" && approval.alwaysScope === "
|
|
|
34469
34497
|
function alwaysHint(approval) {
|
|
34470
34498
|
return inCwd(approval) ? `Always allow lets ${approval.requester.name} run exactly this command with sudo, in ${approval.cwd}, without asking again.` : `Always allow lets ${approval.requester.name} run exactly this command with sudo without asking again.`;
|
|
34471
34499
|
}
|
|
34500
|
+
function guestAlwaysHint(approval) {
|
|
34501
|
+
const agent = approval.agentName ?? "this cone";
|
|
34502
|
+
return approval.kind === "guest-message" ? `Always allow lets ${approval.requester.name} send messages to ${agent} without asking again.` : `Always allow lets ${agent} run exactly this ${approval.tool} call for ${approval.requester.name} without asking again.`;
|
|
34503
|
+
}
|
|
34472
34504
|
function guestAsking(approval) {
|
|
34473
34505
|
return approval.kind === "guest-message" ? `${approval.requester.name} wants to send this to ${approval.agentName ?? "this cone"}:` : `${approval.agentName ?? "This cone"} wants to run ${approval.tool} for ${approval.requester.name}:`;
|
|
34474
34506
|
}
|
|
34475
34507
|
function guestWaiting(approval) {
|
|
34476
|
-
return approval.kind === "guest-message" ? `${approval.requester.name}'s message to ${approval.agentName ?? "this cone"} waits for
|
|
34508
|
+
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.`;
|
|
34477
34509
|
}
|
|
34478
34510
|
var clear = { certain: null, maybe: null };
|
|
34479
34511
|
function rulesOf(approval) {
|
|
@@ -34659,8 +34691,8 @@ var SliccApprovals = class extends ModelElement {
|
|
|
34659
34691
|
const port = this.model?.approvals;
|
|
34660
34692
|
if (!port?.decide || this.busy || decision2 !== "deny" && !this.#armed) return;
|
|
34661
34693
|
const verdict = rulesOf(approval);
|
|
34662
|
-
|
|
34663
|
-
|
|
34694
|
+
const always = approval.kind === "sudo" || approval.always;
|
|
34695
|
+
if (decision2 === "always" && (!always || verdict.certain || verdict.maybe)) return;
|
|
34664
34696
|
this.busy = decision2;
|
|
34665
34697
|
this.failure = null;
|
|
34666
34698
|
this.#pending.add(approval.id);
|
|
@@ -34792,8 +34824,8 @@ var SliccApprovals = class extends ModelElement {
|
|
|
34792
34824
|
const failure2 = this.failure?.id === approval.id ? this.failure.message : "";
|
|
34793
34825
|
const verdict = rulesOf(approval);
|
|
34794
34826
|
const rules = verdict.certain ?? verdict.maybe;
|
|
34795
|
-
const always = approval.
|
|
34796
|
-
const hint2 = approval.kind === "sudo"
|
|
34827
|
+
const always = approval.always && !rules;
|
|
34828
|
+
const hint2 = always ? approval.kind === "sudo" ? alwaysHint(approval) : guestAlwaysHint(approval) : "";
|
|
34797
34829
|
return this.#dialog(
|
|
34798
34830
|
approval,
|
|
34799
34831
|
approval.id,
|
|
@@ -40467,7 +40499,7 @@ var SliccNotices = class extends ModelElement {
|
|
|
40467
40499
|
<div class="text">
|
|
40468
40500
|
<span class="title">Waiting for sudo approval</span>
|
|
40469
40501
|
<p>${asking(approval)}: <code>${sudo(approval)}</code></p>
|
|
40470
|
-
<p>
|
|
40502
|
+
<p>It waits for the owner's approval. Denied automatically at ${deadline(approval.expiresAt)}.</p>
|
|
40471
40503
|
</div>
|
|
40472
40504
|
</div>`;
|
|
40473
40505
|
}
|