@ai-ecoverse/slicc-spectrum 2.9.0 → 2.9.2
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 +6 -5
- package/dist/slicc-dummy.js +10 -2
- package/dist/slicc-dummy.js.map +2 -2
- package/dist/slicc-kernel-model.js.map +2 -2
- package/dist/slicc-ui.js +162 -58
- package/dist/slicc-ui.js.map +3 -3
- package/dist/types/app/browser.d.ts +28 -1
- package/dist/types/dummy/browser.d.ts +11 -1
- package/package.json +2 -2
package/dist/slicc-ui.js
CHANGED
|
@@ -50509,7 +50509,9 @@ function revealed(name, entries, now = Date.now(), more = false) {
|
|
|
50509
50509
|
const today = reveals.filter((entry) => entry.at >= start2).length;
|
|
50510
50510
|
const partial = more && (entries[entries.length - 1]?.at ?? 0) >= start2;
|
|
50511
50511
|
const when2 = today ? `${partial ? "at least " : ""}${today} ${today === 1 ? "time" : "times"} today` : since(last.at, now);
|
|
50512
|
-
|
|
50512
|
+
const argv = Array.from(last.argv);
|
|
50513
|
+
const clipped = argv.length > 120 ? `${argv.slice(0, 119).join("")}\u2026` : last.argv;
|
|
50514
|
+
return b`Revealed to programs ${when2}, last by ${shown4(who(last))} with <code>${shown4(clipped)}</code>`;
|
|
50513
50515
|
}
|
|
50514
50516
|
function changes(entry, devices) {
|
|
50515
50517
|
if (entry.changes)
|
|
@@ -50844,8 +50846,15 @@ var SliccSecrets = class extends ThemedElement {
|
|
|
50844
50846
|
.secret .form {
|
|
50845
50847
|
grid-column: 1 / -1;
|
|
50846
50848
|
}
|
|
50847
|
-
.
|
|
50849
|
+
.aside {
|
|
50850
|
+
display: flex;
|
|
50851
|
+
flex-wrap: wrap;
|
|
50852
|
+
align-items: center;
|
|
50853
|
+
justify-content: flex-end;
|
|
50854
|
+
gap: var(--swc-spacing-200);
|
|
50848
50855
|
align-self: start;
|
|
50856
|
+
}
|
|
50857
|
+
.secret .buttons {
|
|
50849
50858
|
justify-content: flex-end;
|
|
50850
50859
|
}
|
|
50851
50860
|
.name {
|
|
@@ -50961,10 +50970,13 @@ var SliccSecrets = class extends ThemedElement {
|
|
|
50961
50970
|
.secret {
|
|
50962
50971
|
grid-template-columns: minmax(0, 1fr);
|
|
50963
50972
|
}
|
|
50964
|
-
.
|
|
50973
|
+
.aside {
|
|
50965
50974
|
order: 1;
|
|
50966
50975
|
justify-content: flex-start;
|
|
50967
50976
|
}
|
|
50977
|
+
.secret .buttons {
|
|
50978
|
+
justify-content: flex-start;
|
|
50979
|
+
}
|
|
50968
50980
|
.secret .form {
|
|
50969
50981
|
order: 2;
|
|
50970
50982
|
}
|
|
@@ -51563,9 +51575,11 @@ var SliccSecrets = class extends ThemedElement {
|
|
|
51563
51575
|
<div class="name">
|
|
51564
51576
|
<code>${secret.name}</code>
|
|
51565
51577
|
${kind ? b`<swc-badge size="s" variant="neutral" subtle>${kind}</swc-badge>` : A}
|
|
51578
|
+
</div>
|
|
51579
|
+
<div class="aside">
|
|
51566
51580
|
${this.#state(secret)}
|
|
51581
|
+
${this.#controls(vault, secret)}
|
|
51567
51582
|
</div>
|
|
51568
|
-
${this.#controls(vault, secret)}
|
|
51569
51583
|
<dl>
|
|
51570
51584
|
${this.#reach(secret, gone3)}
|
|
51571
51585
|
${secret.exits ? b`<dt>${gone3 ? "Left through" : "Leaves through"}</dt><dd data-exits>${secret.exits.length ? list4(secret.exits.map((exit3) => exitLabel(exit3, devices))) : "No exit"}</dd>` : A}
|
|
@@ -51725,9 +51739,9 @@ var SliccSecrets = class extends ThemedElement {
|
|
|
51725
51739
|
${this.#feedback()}
|
|
51726
51740
|
${this.failure ? this.#error(this.failure, "vault") : A}
|
|
51727
51741
|
${waiting3.length ? b`<h3>Waiting for you</h3>${waiting3.map((request2) => this.#request(vault, request2))}` : A}
|
|
51728
|
-
${this.#backup(vault, status2)}
|
|
51729
51742
|
${this.#tools(vault, locked)}
|
|
51730
51743
|
${!current ? this.#offline ? A : b`<p class="muted" data-loading>Loading secrets…</p>` : current.secrets.length ? this.#secrets(vault, current, entries, devices, locked) : b`<p data-empty>No secrets yet. Add one here, or enter the value when an agent or program asks for one.</p>`}
|
|
51744
|
+
${this.#backup(vault, status2)}
|
|
51731
51745
|
${this.#refused(current?.refused ?? [])}
|
|
51732
51746
|
<p class="muted" data-policy>Rules live in <code>/etc/fnox/config.toml</code> and <code>/etc/slicc/secrets-policy.toml</code>. Change them with sudo; SLICC asks you before every change.</p>
|
|
51733
51747
|
${current ? this.#audit(vault, current, entries, devices) : A}
|
|
@@ -52718,6 +52732,38 @@ var verbs2 = {
|
|
|
52718
52732
|
function describe(action) {
|
|
52719
52733
|
return verbs2[action.kind](action);
|
|
52720
52734
|
}
|
|
52735
|
+
function recentActions(all2, shown6) {
|
|
52736
|
+
return all2.slice(-shown6).reverse();
|
|
52737
|
+
}
|
|
52738
|
+
function sameAction(a20, b10) {
|
|
52739
|
+
return a20.status === "done" && b10.status === "done" && a20.kind === b10.kind && a20.agentId === b10.agentId && a20.target === b10.target && a20.value === b10.value && a20.length === b10.length;
|
|
52740
|
+
}
|
|
52741
|
+
function foldActions(actions2) {
|
|
52742
|
+
const out = [];
|
|
52743
|
+
for (const action of actions2) {
|
|
52744
|
+
const prev = out.at(-1);
|
|
52745
|
+
if (prev && sameAction(prev.action, action)) {
|
|
52746
|
+
prev.count += 1;
|
|
52747
|
+
continue;
|
|
52748
|
+
}
|
|
52749
|
+
out.push({ action, count: 1 });
|
|
52750
|
+
}
|
|
52751
|
+
return out;
|
|
52752
|
+
}
|
|
52753
|
+
function pickImage(frame, shot, watching) {
|
|
52754
|
+
if (watching && frame) return frame;
|
|
52755
|
+
if (frame && (!shot || frame.at >= shot.at)) return frame;
|
|
52756
|
+
return shot ?? null;
|
|
52757
|
+
}
|
|
52758
|
+
function frameSize(box, dpr = 1, prior) {
|
|
52759
|
+
if (!box?.width || !box.height) return null;
|
|
52760
|
+
const width = Math.max(1, Math.round(box.width * dpr));
|
|
52761
|
+
const height = Math.max(1, Math.round(box.height * dpr));
|
|
52762
|
+
const slack = Math.max(2, Math.round(2 * dpr));
|
|
52763
|
+
if (prior && Math.abs(prior.width - width) <= slack && Math.abs(prior.height - height) <= slack)
|
|
52764
|
+
return { width: prior.width, height: prior.height, key: `${prior.width}x${prior.height}` };
|
|
52765
|
+
return { width, height, key: `${width}x${height}` };
|
|
52766
|
+
}
|
|
52721
52767
|
var icons = {
|
|
52722
52768
|
open: b`<swc-icon-open-in size="s"></swc-icon-open-in>`,
|
|
52723
52769
|
goto: b`<swc-icon-link size="s"></swc-icon-link>`,
|
|
@@ -52762,8 +52808,9 @@ var SliccBrowser = class extends ModelElement {
|
|
|
52762
52808
|
#last = null;
|
|
52763
52809
|
#shown = actionPage;
|
|
52764
52810
|
#anchor = null;
|
|
52811
|
+
#display = /* @__PURE__ */ new Map();
|
|
52812
|
+
#loading = /* @__PURE__ */ new Map();
|
|
52765
52813
|
#expanded = new ViewSet(this, "browser");
|
|
52766
|
-
#recent = new ViewState(this, "browser:recent", () => false);
|
|
52767
52814
|
#chosen = new ViewState(this, "browser:tab", () => void 0);
|
|
52768
52815
|
#scroll = new ViewScroll(this, "browser:scroll", {
|
|
52769
52816
|
scroller: () => this.renderRoot.querySelector(".cards")?.parentElement ?? null,
|
|
@@ -52942,24 +52989,31 @@ var SliccBrowser = class extends ModelElement {
|
|
|
52942
52989
|
.focused {
|
|
52943
52990
|
display: grid;
|
|
52944
52991
|
grid-template-columns: minmax(0, 1fr);
|
|
52945
|
-
gap: var(--swc-spacing-
|
|
52946
|
-
|
|
52992
|
+
gap: var(--swc-spacing-200);
|
|
52993
|
+
height: 100%;
|
|
52994
|
+
min-height: 0;
|
|
52995
|
+
padding: var(--swc-spacing-200);
|
|
52996
|
+
box-sizing: border-box;
|
|
52947
52997
|
}
|
|
52948
52998
|
.focused.wide {
|
|
52949
52999
|
grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
|
|
52950
|
-
|
|
53000
|
+
grid-template-rows: minmax(0, 1fr);
|
|
53001
|
+
align-items: stretch;
|
|
52951
53002
|
}
|
|
52952
53003
|
.detail {
|
|
52953
53004
|
display: flex;
|
|
52954
53005
|
flex-direction: column;
|
|
52955
|
-
gap: var(--swc-spacing-
|
|
53006
|
+
gap: var(--swc-spacing-100);
|
|
52956
53007
|
min-width: 0;
|
|
53008
|
+
min-height: 0;
|
|
53009
|
+
height: 100%;
|
|
52957
53010
|
}
|
|
52958
53011
|
.bar,
|
|
52959
53012
|
.address {
|
|
52960
53013
|
display: flex;
|
|
52961
53014
|
align-items: center;
|
|
52962
53015
|
gap: var(--swc-spacing-100);
|
|
53016
|
+
flex: none;
|
|
52963
53017
|
min-width: 0;
|
|
52964
53018
|
}
|
|
52965
53019
|
.bar sp-picker {
|
|
@@ -52967,13 +53021,14 @@ var SliccBrowser = class extends ModelElement {
|
|
|
52967
53021
|
min-width: 0;
|
|
52968
53022
|
max-width: 100%;
|
|
52969
53023
|
}
|
|
52970
|
-
.url {
|
|
53024
|
+
.address .url {
|
|
52971
53025
|
flex: 1;
|
|
52972
53026
|
min-width: 0;
|
|
52973
53027
|
font-family: var(--swc-code-font-family-stack);
|
|
52974
53028
|
color: var(--swc-neutral-subdued-content-color-default);
|
|
52975
53029
|
}
|
|
52976
53030
|
.detail .driving {
|
|
53031
|
+
flex: none;
|
|
52977
53032
|
flex-wrap: nowrap;
|
|
52978
53033
|
min-block-size: var(--swc-component-height-75);
|
|
52979
53034
|
}
|
|
@@ -52983,6 +53038,18 @@ var SliccBrowser = class extends ModelElement {
|
|
|
52983
53038
|
.detail .driving swc-button {
|
|
52984
53039
|
flex: none;
|
|
52985
53040
|
}
|
|
53041
|
+
.detail figure {
|
|
53042
|
+
flex: 0 1 auto;
|
|
53043
|
+
width: 100%;
|
|
53044
|
+
max-height: min(50vh, 100%);
|
|
53045
|
+
}
|
|
53046
|
+
.detail .feed {
|
|
53047
|
+
display: flex;
|
|
53048
|
+
flex-direction: column;
|
|
53049
|
+
flex: 1 1 10rem;
|
|
53050
|
+
min-height: 8rem;
|
|
53051
|
+
min-width: 0;
|
|
53052
|
+
}
|
|
52986
53053
|
.swc-Link {
|
|
52987
53054
|
font-size: inherit;
|
|
52988
53055
|
}
|
|
@@ -52990,6 +53057,9 @@ var SliccBrowser = class extends ModelElement {
|
|
|
52990
53057
|
display: flex;
|
|
52991
53058
|
flex-direction: column;
|
|
52992
53059
|
gap: var(--swc-spacing-50);
|
|
53060
|
+
min-height: 0;
|
|
53061
|
+
overflow: auto;
|
|
53062
|
+
overscroll-behavior: contain;
|
|
52993
53063
|
}
|
|
52994
53064
|
.tabs button {
|
|
52995
53065
|
display: grid;
|
|
@@ -53033,19 +53103,20 @@ var SliccBrowser = class extends ModelElement {
|
|
|
53033
53103
|
flex-direction: column;
|
|
53034
53104
|
gap: var(--swc-spacing-75);
|
|
53035
53105
|
margin: 0;
|
|
53106
|
+
min-height: 0;
|
|
53036
53107
|
}
|
|
53037
53108
|
.frame {
|
|
53038
53109
|
display: grid;
|
|
53039
53110
|
place-items: center;
|
|
53111
|
+
box-sizing: border-box;
|
|
53040
53112
|
aspect-ratio: 16 / 10;
|
|
53113
|
+
width: 100%;
|
|
53114
|
+
max-height: inherit;
|
|
53041
53115
|
overflow: hidden;
|
|
53042
53116
|
border: var(--swc-border-width-100) solid var(--swc-gray-200);
|
|
53043
53117
|
border-radius: var(--swc-corner-radius-medium-default);
|
|
53044
53118
|
background: var(--swc-card-background-well-color);
|
|
53045
53119
|
}
|
|
53046
|
-
.wide .frame {
|
|
53047
|
-
max-height: 50vh;
|
|
53048
|
-
}
|
|
53049
53120
|
.frame img {
|
|
53050
53121
|
width: 100%;
|
|
53051
53122
|
height: 100%;
|
|
@@ -53054,6 +53125,7 @@ var SliccBrowser = class extends ModelElement {
|
|
|
53054
53125
|
user-select: none;
|
|
53055
53126
|
}
|
|
53056
53127
|
figcaption {
|
|
53128
|
+
flex: none;
|
|
53057
53129
|
min-block-size: var(--swc-component-height-50);
|
|
53058
53130
|
display: flex;
|
|
53059
53131
|
align-items: center;
|
|
@@ -53146,10 +53218,15 @@ var SliccBrowser = class extends ModelElement {
|
|
|
53146
53218
|
white-space: normal;
|
|
53147
53219
|
user-select: text;
|
|
53148
53220
|
}
|
|
53221
|
+
.feed h3,
|
|
53222
|
+
.feed .more {
|
|
53223
|
+
flex: none;
|
|
53224
|
+
}
|
|
53149
53225
|
.actions {
|
|
53150
53226
|
display: flex;
|
|
53151
53227
|
flex-direction: column;
|
|
53152
|
-
|
|
53228
|
+
flex: 1;
|
|
53229
|
+
min-height: 0;
|
|
53153
53230
|
overflow: auto;
|
|
53154
53231
|
}
|
|
53155
53232
|
.actions li {
|
|
@@ -53173,11 +53250,10 @@ var SliccBrowser = class extends ModelElement {
|
|
|
53173
53250
|
min-width: 0;
|
|
53174
53251
|
overflow-wrap: anywhere;
|
|
53175
53252
|
}
|
|
53176
|
-
.
|
|
53177
|
-
|
|
53178
|
-
|
|
53179
|
-
|
|
53180
|
-
white-space: nowrap;
|
|
53253
|
+
.count {
|
|
53254
|
+
margin-inline-start: var(--swc-spacing-100);
|
|
53255
|
+
color: var(--swc-neutral-subdued-content-color-default);
|
|
53256
|
+
font-weight: var(--swc-bold-font-weight);
|
|
53181
53257
|
}
|
|
53182
53258
|
.actions .failure {
|
|
53183
53259
|
color: var(--swc-negative-content-color-default);
|
|
@@ -53239,6 +53315,8 @@ var SliccBrowser = class extends ModelElement {
|
|
|
53239
53315
|
subscribe(model) {
|
|
53240
53316
|
this.#shots.clear();
|
|
53241
53317
|
this.#frames.clear();
|
|
53318
|
+
this.#display.clear();
|
|
53319
|
+
this.#loading.clear();
|
|
53242
53320
|
this.#pulse.clear();
|
|
53243
53321
|
this.#shown = actionPage;
|
|
53244
53322
|
const tabs = model.browser.list();
|
|
@@ -53353,10 +53431,26 @@ var SliccBrowser = class extends ModelElement {
|
|
|
53353
53431
|
this.#running = false;
|
|
53354
53432
|
}
|
|
53355
53433
|
#image(id) {
|
|
53356
|
-
|
|
53357
|
-
|
|
53358
|
-
|
|
53359
|
-
|
|
53434
|
+
return pickImage(this.#frames.get(id), this.#shots.get(id), this.#watching?.tabId === id);
|
|
53435
|
+
}
|
|
53436
|
+
#hold(id, src) {
|
|
53437
|
+
const shown6 = this.#display.get(id);
|
|
53438
|
+
if (shown6 === src) return src;
|
|
53439
|
+
if (!shown6) {
|
|
53440
|
+
this.#display.set(id, src);
|
|
53441
|
+
return src;
|
|
53442
|
+
}
|
|
53443
|
+
if (this.#loading.get(id) === src) return shown6;
|
|
53444
|
+
this.#loading.set(id, src);
|
|
53445
|
+
const probe = document.createElement("img");
|
|
53446
|
+
probe.onload = () => {
|
|
53447
|
+
if (this.#loading.get(id) !== src) return;
|
|
53448
|
+
this.#loading.delete(id);
|
|
53449
|
+
this.#display.set(id, src);
|
|
53450
|
+
this.requestUpdate();
|
|
53451
|
+
};
|
|
53452
|
+
probe.src = src;
|
|
53453
|
+
return shown6;
|
|
53360
53454
|
}
|
|
53361
53455
|
#show(id) {
|
|
53362
53456
|
this.#chosen.value = id;
|
|
@@ -53386,29 +53480,39 @@ var SliccBrowser = class extends ModelElement {
|
|
|
53386
53480
|
if (visible3 && tab && !this.#ticker)
|
|
53387
53481
|
this.#ticker = setInterval(() => this.requestUpdate(), 1e3);
|
|
53388
53482
|
if (!(visible3 && tab)) this.#still();
|
|
53389
|
-
const list6 = this.renderRoot.querySelector(".actions
|
|
53390
|
-
const
|
|
53391
|
-
if (list6 && this.#anchor !== null) list6.scrollTop =
|
|
53392
|
-
else if (list6 &&
|
|
53483
|
+
const list6 = this.renderRoot.querySelector(".actions");
|
|
53484
|
+
const head = list6?.firstElementChild?.getAttribute("data-action-id") ?? null;
|
|
53485
|
+
if (list6 && this.#anchor !== null) list6.scrollTop = this.#anchor;
|
|
53486
|
+
else if (list6 && head !== this.#last) list6.scrollTop = 0;
|
|
53393
53487
|
this.#anchor = null;
|
|
53394
|
-
this.#last =
|
|
53488
|
+
this.#last = head;
|
|
53395
53489
|
}
|
|
53396
53490
|
#still() {
|
|
53397
53491
|
if (this.#ticker) clearInterval(this.#ticker);
|
|
53398
53492
|
this.#ticker = null;
|
|
53399
53493
|
}
|
|
53400
53494
|
#settle(id) {
|
|
53401
|
-
|
|
53402
|
-
|
|
53403
|
-
|
|
53404
|
-
|
|
53495
|
+
if (!id) {
|
|
53496
|
+
this.#watching?.stop();
|
|
53497
|
+
this.#watching = null;
|
|
53498
|
+
return;
|
|
53499
|
+
}
|
|
53500
|
+
const box = this.renderRoot.querySelector(".frame")?.getBoundingClientRect();
|
|
53501
|
+
const area = box ? { width: box.width, height: box.height } : null;
|
|
53502
|
+
const prior = this.#watching?.tabId === id ? this.#watching.pixels : null;
|
|
53503
|
+
const sized = frameSize(area, globalThis.devicePixelRatio || 1, prior);
|
|
53504
|
+
const key = sized?.key ?? (this.#watching?.tabId === id ? this.#watching.size : "");
|
|
53505
|
+
const pixels = sized ? { width: sized.width, height: sized.height } : this.#watching?.tabId === id ? this.#watching.pixels : { width: 0, height: 0 };
|
|
53506
|
+
if (this.#watching?.tabId === id && this.#watching.size === key) return;
|
|
53405
53507
|
this.#watching?.stop();
|
|
53406
|
-
this.#watching = null;
|
|
53407
|
-
if (!id) return;
|
|
53408
53508
|
this.#watching = {
|
|
53409
53509
|
tabId: id,
|
|
53410
53510
|
size: key,
|
|
53411
|
-
|
|
53511
|
+
pixels,
|
|
53512
|
+
stop: this.model.browser.watch?.(
|
|
53513
|
+
id,
|
|
53514
|
+
sized ? { width: sized.width, height: sized.height } : void 0
|
|
53515
|
+
)
|
|
53412
53516
|
};
|
|
53413
53517
|
}
|
|
53414
53518
|
#open() {
|
|
@@ -53510,24 +53614,26 @@ var SliccBrowser = class extends ModelElement {
|
|
|
53510
53614
|
#view(tab) {
|
|
53511
53615
|
const image2 = this.#image(tab.id);
|
|
53512
53616
|
const now = Date.now();
|
|
53513
|
-
const
|
|
53617
|
+
const liveFrame = !!image2 && this.#watching?.tabId === tab.id && this.#frames.get(tab.id) === image2 && now - image2.at < fresh;
|
|
53618
|
+
const view = !image2 ? "none" : liveFrame ? "live" : "shot";
|
|
53619
|
+
const src = image2 ? this.#hold(tab.id, image2.src) : null;
|
|
53514
53620
|
return b`<figure data-view=${view}>
|
|
53515
53621
|
<div class="frame">
|
|
53516
|
-
${
|
|
53622
|
+
${src ? b`<img src=${src} alt=${`${tab.title}, as the agent sees it`} draggable="false" />` : b`<swc-progress-circle size="m" label="Loading preview"></swc-progress-circle>`}
|
|
53517
53623
|
</div>
|
|
53518
53624
|
<figcaption>
|
|
53519
53625
|
${view === "live" ? b`<swc-status-light size="s" variant="positive">Live</swc-status-light>` : b`<span>${image2 ? since2(image2.at, now) : "No preview yet"}</span>`}
|
|
53520
|
-
<span>
|
|
53626
|
+
<span>Watching only</span>
|
|
53521
53627
|
</figcaption>
|
|
53522
53628
|
</figure>`;
|
|
53523
53629
|
}
|
|
53524
53630
|
#more(total) {
|
|
53525
|
-
const list6 = this.renderRoot.querySelector(".actions
|
|
53526
|
-
this.#anchor = list6.
|
|
53631
|
+
const list6 = this.renderRoot.querySelector(".actions");
|
|
53632
|
+
this.#anchor = list6.scrollTop;
|
|
53527
53633
|
this.#shown += actionPage;
|
|
53528
53634
|
const done2 = this.#shown >= total;
|
|
53529
53635
|
void this.updateComplete.then(() => {
|
|
53530
|
-
if (done2) this.focusOn(".actions
|
|
53636
|
+
if (done2) this.focusOn(".actions");
|
|
53531
53637
|
});
|
|
53532
53638
|
this.requestUpdate();
|
|
53533
53639
|
}
|
|
@@ -53540,12 +53646,12 @@ var SliccBrowser = class extends ModelElement {
|
|
|
53540
53646
|
const open = this.#expanded.has(action.id);
|
|
53541
53647
|
return b`<button class="url-toggle" data-action="action-url" aria-expanded=${open ? "true" : "false"} aria-controls=${`url-${action.id}`} @click=${() => this.#toggle(action.id)}><span>${describe(action)}</span><swc-icon-chevron-down class="chevron" size="s" aria-hidden="true"></swc-icon-chevron-down></button>${open ? b`<span class="full" id=${`url-${action.id}`}>${url}</span>` : A}`;
|
|
53542
53648
|
}
|
|
53543
|
-
#row(action) {
|
|
53649
|
+
#row(action, count2 = 1) {
|
|
53544
53650
|
const failed2 = action.status === "failed";
|
|
53545
53651
|
const url = linked.has(action.kind) ? action.value : void 0;
|
|
53546
|
-
return b`<li data-action-id=${action.id} data-kind=${action.kind} data-status=${action.status} title=${url ?? A}>
|
|
53652
|
+
return b`<li data-action-id=${action.id} data-kind=${action.kind} data-status=${action.status} ?data-group=${count2 > 1} title=${url ?? A}>
|
|
53547
53653
|
<span>${action.status === "running" ? b`<swc-progress-circle size="s" indeterminate label="Running"></swc-progress-circle>` : failed2 ? b`<swc-icon-alert-triangle size="s" aria-label="Failed"></swc-icon-alert-triangle>` : icons[action.kind]}</span>
|
|
53548
|
-
<span class="what">${this.#what(action)}${failed2 && action.error ? b`<span class="failure">${action.error}</span>` : A}</span>
|
|
53654
|
+
<span class="what">${this.#what(action)}${count2 > 1 ? b`<span class="count">×${count2}</span>` : A}${failed2 && action.error ? b`<span class="failure">${action.error}</span>` : A}</span>
|
|
53549
53655
|
<span class="who">${agentName(this.model, action.agentId)} ${time(action.at)}</span>
|
|
53550
53656
|
</li>`;
|
|
53551
53657
|
}
|
|
@@ -53556,23 +53662,21 @@ var SliccBrowser = class extends ModelElement {
|
|
|
53556
53662
|
(action) => action.tabId === tab.id || action.tabId === null && action.agentId !== null && action.agentId === tab.agentId
|
|
53557
53663
|
);
|
|
53558
53664
|
if (!all2.length)
|
|
53559
|
-
return b`<h3>Recent actions</h3><p class="muted" data-actions="none">No actions yet.</p>`;
|
|
53560
|
-
const actions2 = all2
|
|
53665
|
+
return b`<div class="feed"><h3>Recent actions</h3><p class="muted" data-actions="none">No actions yet.</p></div>`;
|
|
53666
|
+
const actions2 = recentActions(all2, this.#shown);
|
|
53667
|
+
const folded = foldActions(actions2);
|
|
53561
53668
|
const more = all2.length > actions2.length ? b`<div class="more"><span>Showing the latest ${actions2.length} of ${all2.length}</span><swc-button size="s" variant="secondary" fill-style="outline" data-action="more-actions" @click=${() => this.#more(all2.length)}>Show more</swc-button></div>` : A;
|
|
53562
|
-
|
|
53563
|
-
|
|
53564
|
-
|
|
53565
|
-
|
|
53566
|
-
|
|
53567
|
-
${more}
|
|
53568
|
-
<ol class="actions" aria-label="Earlier actions" tabindex="0">${actions2.slice(0, -1).map((action) => this.#row(action))}</ol>
|
|
53569
|
-
</details>
|
|
53570
|
-
<ol class="actions last" aria-label="Last action">${this.#row(last)}</ol>`;
|
|
53669
|
+
return b`<div class="feed">
|
|
53670
|
+
<h3>Recent actions</h3>
|
|
53671
|
+
${more}
|
|
53672
|
+
<ol class="actions" aria-label="Recent actions" tabindex="0">${folded.map((item2) => this.#row(item2.action, item2.count))}</ol>
|
|
53673
|
+
</div>`;
|
|
53571
53674
|
}
|
|
53572
53675
|
#detail(tabs, tab) {
|
|
53573
53676
|
const narrow = this.#width < narrowWidth;
|
|
53574
53677
|
const wide2 = this.#width >= wideWidth;
|
|
53575
53678
|
const copy = this.#copied === "url" ? "Copied" : this.#copied === "failed" ? "Couldn\u2019t copy" : "Copy";
|
|
53679
|
+
const watching = tab.controlled ? tab.agentId ? `Watching ${agentName(this.model, tab.agentId)}` : "In use" : "No agent is using this tab";
|
|
53576
53680
|
return b`<div class=${`focused${wide2 ? " wide" : ""}${narrow ? " narrow" : ""}`}>
|
|
53577
53681
|
${wide2 ? this.#list(tabs, tab) : A}
|
|
53578
53682
|
<section class="detail" aria-label=${tab.title}>
|
|
@@ -53591,7 +53695,7 @@ var SliccBrowser = class extends ModelElement {
|
|
|
53591
53695
|
<swc-action-button size="s" quiet data-action="open-tab" accessible-label="Show in the browser" @click=${() => this.model?.browser.activate(tab.id)}><swc-icon-open-in slot="icon"></swc-icon-open-in>${narrow ? A : "Open"}</swc-action-button>
|
|
53592
53696
|
</div>
|
|
53593
53697
|
<div class="driving" data-driving=${tab.controlled ? tab.agentId ? "agent" : "user" : "none"}>
|
|
53594
|
-
<swc-status-light size="m" variant=${tab.controlled ? "info" : "neutral"}>${
|
|
53698
|
+
<swc-status-light size="m" variant=${tab.controlled ? "info" : "neutral"}>${watching}</swc-status-light>
|
|
53595
53699
|
${tab.controlled ? this.#stopButton(tab, '[data-action="all-tabs"]') : A}
|
|
53596
53700
|
</div>
|
|
53597
53701
|
${this.#view(tab)}
|
|
@@ -53620,7 +53724,7 @@ var SliccBrowser = class extends ModelElement {
|
|
|
53620
53724
|
const tabs = this.model?.browser.list() ?? [];
|
|
53621
53725
|
if (!tabs.length && this.model?.network?.status().browser?.via === null) return this.#offline();
|
|
53622
53726
|
const tab = tabs.find((candidate) => candidate.id === this.#focus);
|
|
53623
|
-
return tab ?
|
|
53727
|
+
return tab ? this.#detail(tabs, tab) : this.#overview(tabs);
|
|
53624
53728
|
}
|
|
53625
53729
|
};
|
|
53626
53730
|
|