@cotal-ai/web 0.138.1 → 0.139.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/web/assets/AgentPage-CpDkKMSj.js +1 -0
- package/dist/web/assets/FailedTip-DfF85PmB.js +1 -0
- package/dist/web/assets/bash-CLZ0U2zV.js +1 -0
- package/dist/web/assets/characters-BsW4RWhl.js +9 -0
- package/dist/web/assets/controller-D_lQfVDy.js +70 -0
- package/dist/web/assets/core-Bfff_dYO.js +12 -0
- package/dist/web/assets/diff-woXpYk--.js +1 -0
- package/dist/web/assets/dist-BB9Crw5c.js +1 -0
- package/dist/web/assets/dist-DktEa9vr.js +1 -0
- package/dist/web/assets/engine-javascript-C30F4iNc.js +141 -0
- package/dist/web/assets/index-DQdr6c2w.css +1 -0
- package/dist/web/assets/index-Dfeh4Ewy.js +13 -0
- package/dist/web/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
- package/dist/web/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
- package/dist/web/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
- package/dist/web/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
- package/dist/web/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
- package/dist/web/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
- package/dist/web/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
- package/dist/web/assets/javascript-BgS3c2Ky.js +1 -0
- package/dist/web/assets/json-qhed-kSA.js +1 -0
- package/dist/web/assets/markdown-BYOwaDjH.js +1 -0
- package/dist/web/assets/python-gzcpVVnB.js +1 -0
- package/dist/web/assets/rolldown-runtime-XKyaHtl9.js +1 -0
- package/dist/web/assets/typescript-bsJCZSQ-.js +1 -0
- package/dist/web/assets/yaml-rwi0_p6S.js +1 -0
- package/dist/web/bundle-licenses.json +389 -0
- package/dist/web/index.html +9 -513
- package/dist/web/theme-boot.js +8 -0
- package/dist/web.d.ts +312 -21
- package/dist/web.d.ts.map +1 -1
- package/dist/web.js +647 -121
- package/dist/web.js.map +1 -1
- package/package.json +30 -6
- package/dist/web/agui-frame.js +0 -210
- package/dist/web/app.js +0 -1428
- package/dist/web/event-order.js +0 -283
- package/dist/web/graph.html +0 -225
- package/dist/web/graph.js +0 -868
- package/dist/web/harness.js +0 -46
- package/dist/web/md.js +0 -31
- package/dist/web/parts.js +0 -114
- package/dist/web/presence-ages.js +0 -33
- package/dist/web/presence.js +0 -17
- package/dist/web/snapshot.js +0 -99
- package/dist/web/vendor/marked.umd.js +0 -79
- package/dist/web/vendor/purify.min.js +0 -3
- package/dist/web/vendor/vendor-manifest.json +0 -18
package/dist/web/event-order.js
DELETED
|
@@ -1,283 +0,0 @@
|
|
|
1
|
-
// The bootstrap ordering this surface needs because it taps live BEFORE it reads history.
|
|
2
|
-
//
|
|
3
|
-
// THE RACE IS THIS PAGE'S, NOT A HYPOTHETICAL. `app.js` opens the SSE feed and only then calls
|
|
4
|
-
// `refresh()`, so `onMessage` is already appending live traffic while the backfill fetch is still in
|
|
5
|
-
// flight. For ordinary chat that is harmless: entries carry `ts`, the feed is a window, and a
|
|
6
|
-
// duplicate is caught by message id. For an event frame it is not harmless, because a frame's
|
|
7
|
-
// position in its stream is `seq`, and `seq` is the only thing that can tell a reader that a frame
|
|
8
|
-
// is MISSING. Message-id dedupe cannot: two ids are equal or they are not, which says nothing about
|
|
9
|
-
// what belongs between them.
|
|
10
|
-
//
|
|
11
|
-
// SO THE CONSUMER HAS TO IMPOSE ITS OWN PHASE BOUNDARY. The transport arms the watermark, goes live,
|
|
12
|
-
// and only then surfaces retained history, so a live frame at `seq` 1003 can legitimately be the
|
|
13
|
-
// FIRST frame this page ever sees, ahead of the retained 1000-1002. Two rules follow, and both are
|
|
14
|
-
// the opposite of what a first-arrival reading would do:
|
|
15
|
-
//
|
|
16
|
-
// · The baseline is the MINIMUM of the settled history batch, not the first frame observed.
|
|
17
|
-
// Baselining on arrival makes the entire backfill look like it ran backwards.
|
|
18
|
-
// · Gap checking is not armed until the boundary passes. Armed earlier, the same backfill reads as
|
|
19
|
-
// a hole between 1003 and 1000.
|
|
20
|
-
//
|
|
21
|
-
// WHAT A BASELINE ABOVE THE FIRST SEQUENCE MEANS, AND WHAT IT DOES NOT. The chat stream caps per
|
|
22
|
-
// subject, so a reader that arrives late finds the earliest retained frame at some `seq` N > 1. That
|
|
23
|
-
// is ordinary retention and NOT a fault: the chain is marked prefix-incomplete and applied forward.
|
|
24
|
-
// A discontinuity AFTER the baseline is the fault, and the two must never be reported as one thing,
|
|
25
|
-
// because the first is what always happens and the second is what must never be ignored.
|
|
26
|
-
//
|
|
27
|
-
// DETECTION IS NOT RECOVERY, AND A DETECTED GAP STILL DRAWS THE FRAME. A gap note is surfaced and
|
|
28
|
-
// the frame is emitted anyway. Holding it back until the missing predecessor turns up would hold it
|
|
29
|
-
// forever when the predecessor is genuinely gone, which converts a visible gap into a silent loss:
|
|
30
|
-
// the exact trade this lane exists to refuse. `next` also advances past the hole, so one lost frame
|
|
31
|
-
// reports once instead of reporting on every frame that follows it.
|
|
32
|
-
//
|
|
33
|
-
// FIRST SEQUENCE. The emitter publishes its first frame at `seq` 1 (`firstSeq` is the WAL frontier
|
|
34
|
-
// plus one, from a zero frontier), while the frame validator admits any non-negative safe integer.
|
|
35
|
-
// "Complete from origin" therefore keys on `<= 1` and not on `=== 1`, so a `seq` 0 frame, which is
|
|
36
|
-
// structurally valid and which no emitter produces, cannot be reported as an evicted prefix.
|
|
37
|
-
//
|
|
38
|
-
// NOT ORDERED, DELIBERATELY: anything that is not a frame carrying a usable `seq`. Chat, presence,
|
|
39
|
-
// DMs and a malformed frame all pass straight through in arrival order. A machine that held a frame
|
|
40
|
-
// it could not sequence would either hold it forever or invent a gap around it, and delaying chat
|
|
41
|
-
// behind a frame's backfill would make this file a latency bug for the traffic it does not own.
|
|
42
|
-
(() => {
|
|
43
|
-
const KIND = "ag-ui.frame";
|
|
44
|
-
/** The first `seq` any emitter publishes. A baseline at or below this is complete from origin. */
|
|
45
|
-
const FIRST_SEQ = 1;
|
|
46
|
-
|
|
47
|
-
const isSeq = (v) => Number.isSafeInteger(v) && v >= 0;
|
|
48
|
-
|
|
49
|
-
/** The frame part an entry carries, or `undefined`. A ROUTING question, so it never throws.
|
|
50
|
-
*
|
|
51
|
-
* Accepts a feed entry (`{mode, channel, msg}`, the all-activity shape) or a bare message (the
|
|
52
|
-
* selected-channel shape), because both merge sites run this race and a machine that only
|
|
53
|
-
* understood one of them would leave the other unordered. */
|
|
54
|
-
const frameOf = (entry) => {
|
|
55
|
-
try {
|
|
56
|
-
const msg = entry && typeof entry === "object" ? entry.msg || entry : undefined;
|
|
57
|
-
const parts = msg && msg.parts;
|
|
58
|
-
if (!Array.isArray(parts)) return undefined;
|
|
59
|
-
for (const p of parts)
|
|
60
|
-
if (p && typeof p === "object" && p.kind === KIND && isSeq(p.seq)) return p;
|
|
61
|
-
return undefined;
|
|
62
|
-
} catch {
|
|
63
|
-
return undefined;
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
/** The chain a frame belongs to: `(from.id, epoch, threadId)`.
|
|
68
|
-
*
|
|
69
|
-
* EPOCH IS IN THE KEY BECAUSE `runId` CANNOT DISCRIMINATE. Two writers pick run ids and sequences
|
|
70
|
-
* independently, so their `(runId, seq)` pairs collide by construction; `epoch` is what makes one
|
|
71
|
-
* writer's stream its own. A JSON array is the delimiter rather than a joining character, because
|
|
72
|
-
* a thread id is a producer-supplied string and any separator chosen here could appear inside it,
|
|
73
|
-
* which would fuse two chains into one and hide a gap in the merge. */
|
|
74
|
-
const chainKey = (entry, frame) => {
|
|
75
|
-
const msg = entry && typeof entry === "object" ? entry.msg || entry : undefined;
|
|
76
|
-
const from = msg && msg.from;
|
|
77
|
-
return JSON.stringify([
|
|
78
|
-
(from && typeof from.id === "string" ? from.id : null),
|
|
79
|
-
typeof frame.epoch === "string" ? frame.epoch : null,
|
|
80
|
-
typeof frame.threadId === "string" ? frame.threadId : null,
|
|
81
|
-
]);
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
/** A two-phase shape-B bootstrap. One instance per bootstrap: a reconnect re-runs both phases. */
|
|
85
|
-
const create = () => {
|
|
86
|
-
/** key -> {baseline, next, prefixIncomplete, faulted, seen:Set<seq>} */
|
|
87
|
-
const chains = new Map();
|
|
88
|
-
/** Live frames arriving before the boundary, in arrival order. */
|
|
89
|
-
const pending = [];
|
|
90
|
-
let settled = false;
|
|
91
|
-
|
|
92
|
-
const chainOf = (key) => {
|
|
93
|
-
let c = chains.get(key);
|
|
94
|
-
if (!c) {
|
|
95
|
-
c = { baseline: undefined, next: undefined, prefixIncomplete: false, faulted: false, released: false, seen: new Set() };
|
|
96
|
-
chains.set(key, c);
|
|
97
|
-
}
|
|
98
|
-
return c;
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
/** Admit one frame against an armed chain. Returns the notes it produced.
|
|
102
|
-
*
|
|
103
|
-
* `straddle` marks the ONE frame per chain whose predecessor lies on the other side of the
|
|
104
|
-
* bootstrap seam, and it changes what a hole MEANS rather than merely how it is worded. See
|
|
105
|
-
* {@link STRADDLE} below. */
|
|
106
|
-
const admit = (c, key, seq, straddle) => {
|
|
107
|
-
const notes = [];
|
|
108
|
-
if (c.seen.has(seq)) return { emit: false, notes };
|
|
109
|
-
c.seen.add(seq);
|
|
110
|
-
if (seq > c.next) {
|
|
111
|
-
// Both ends are named either way, so a reader sees WHAT is missing rather than only that
|
|
112
|
-
// something is.
|
|
113
|
-
const hole = { key, expected: c.next, got: seq, missing: seq - c.next };
|
|
114
|
-
if (straddle) {
|
|
115
|
-
// STRADDLE: THE ONE HOLE THIS PAGE CANNOT ATTRIBUTE, and calling it a fault was a measured
|
|
116
|
-
// false positive on healthy traffic.
|
|
117
|
-
//
|
|
118
|
-
// The two halves of the bootstrap are two independent reads with no shared cut: a live
|
|
119
|
-
// subscription, and a history request. Nothing makes the point the read was served equal
|
|
120
|
-
// the point the tap began delivering, and on this page the fetch is issued before the tap
|
|
121
|
-
// is even open. So a frame published inside that window is in NEITHER half, and the first
|
|
122
|
-
// buffered frame of a chain can therefore sit above the retained range's top by more than
|
|
123
|
-
// one with nothing lost by the broker at all. Reported as a fault, it latched `faulted`
|
|
124
|
-
// forever on a stream that was fine, and the frame that filled the hole a moment later did
|
|
125
|
-
// not clear it.
|
|
126
|
-
//
|
|
127
|
-
// A fault that fires on healthy traffic is worse than no fault at all, because it teaches
|
|
128
|
-
// the reader to ignore the one signal that matters. So this is reported as its own kind,
|
|
129
|
-
// named as unconfirmed on the surface, and it does NOT set `faulted`. What it is not is
|
|
130
|
-
// silence: the page says it could not establish the join, rather than saying nothing was
|
|
131
|
-
// missing.
|
|
132
|
-
//
|
|
133
|
-
// ONLY THE FIRST RELEASED FRAME OF A CHAIN GETS THIS TREATMENT. Every later buffered frame
|
|
134
|
-
// arrived through the SAME tap as the one before it, and a subscription delivers a subject
|
|
135
|
-
// in order, so a number missing BETWEEN two buffered frames was never delivered while the
|
|
136
|
-
// page was listening. That is a real loss and takes the hard path below, exactly like a
|
|
137
|
-
// post-boundary hole.
|
|
138
|
-
notes.push({ type: "boundary-hole", ...hole });
|
|
139
|
-
} else {
|
|
140
|
-
notes.push({ type: "gap", ...hole });
|
|
141
|
-
c.faulted = true;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
if (seq >= c.next) c.next = seq + 1;
|
|
145
|
-
return { emit: true, notes };
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
return {
|
|
149
|
-
/** A live arrival. Before the boundary a frame is HELD; everything else always passes. */
|
|
150
|
-
live(entry) {
|
|
151
|
-
const f = frameOf(entry);
|
|
152
|
-
if (!f) return { emit: [entry], held: false, notes: [] };
|
|
153
|
-
if (!settled) {
|
|
154
|
-
pending.push(entry);
|
|
155
|
-
return { emit: [], held: true, notes: [] };
|
|
156
|
-
}
|
|
157
|
-
const key = chainKey(entry, f);
|
|
158
|
-
const c = chainOf(key);
|
|
159
|
-
if (c.next === undefined) {
|
|
160
|
-
// First frame for a chain that the settled history did not mention: this arrival is the
|
|
161
|
-
// baseline, which is sound now only because the boundary has passed.
|
|
162
|
-
c.baseline = f.seq;
|
|
163
|
-
c.next = f.seq;
|
|
164
|
-
c.prefixIncomplete = f.seq > FIRST_SEQ;
|
|
165
|
-
}
|
|
166
|
-
const r = admit(c, key, f.seq);
|
|
167
|
-
return { emit: r.emit ? [entry] : [], held: false, notes: r.notes };
|
|
168
|
-
},
|
|
169
|
-
|
|
170
|
-
/** THE PHASE BOUNDARY: the history batch has settled.
|
|
171
|
-
*
|
|
172
|
-
* Returns the merged feed to render, oldest-first: the batch in the order the server sorted
|
|
173
|
-
* it, then every held live frame that the batch did not already carry, released in `seq`
|
|
174
|
-
* order per chain. The batch is the baseline source, so a live frame that ran ahead of it
|
|
175
|
-
* lands after its own retained predecessors instead of before them. */
|
|
176
|
-
backfill(batch) {
|
|
177
|
-
const notes = [];
|
|
178
|
-
const rows = Array.isArray(batch) ? batch.slice() : [];
|
|
179
|
-
|
|
180
|
-
// Phase one: the batch establishes each chain's baseline. Taken as a MINIMUM over the batch
|
|
181
|
-
// rather than from its first row, because the server sorts the union by `ts` across channels
|
|
182
|
-
// and a frame's `ts` is not its `seq`.
|
|
183
|
-
for (const row of rows) {
|
|
184
|
-
const f = frameOf(row);
|
|
185
|
-
if (!f) continue;
|
|
186
|
-
const c = chainOf(chainKey(row, f));
|
|
187
|
-
if (c.baseline === undefined || f.seq < c.baseline) c.baseline = f.seq;
|
|
188
|
-
c.seen.add(f.seq);
|
|
189
|
-
}
|
|
190
|
-
for (const [key, c] of chains) {
|
|
191
|
-
if (c.baseline === undefined) continue;
|
|
192
|
-
let highest = c.baseline;
|
|
193
|
-
for (const s of c.seen) if (s > highest) highest = s;
|
|
194
|
-
c.next = highest + 1;
|
|
195
|
-
c.prefixIncomplete = c.baseline > FIRST_SEQ;
|
|
196
|
-
if (c.prefixIncomplete) notes.push({ type: "prefix-incomplete", key, baseline: c.baseline });
|
|
197
|
-
// THE RETAINED RANGE IS AUDITED, NOT JUST ITS ENDS. Recording the minimum, the maximum and
|
|
198
|
-
// the set is enough to place the baseline and to dedupe, and it is NOT enough to notice that
|
|
199
|
-
// the middle is missing: a batch of 1, 2, 5 has a baseline of 1 and a frontier of 6, and
|
|
200
|
-
// every later frame follows contiguously, so the chain reads healthy forever while two
|
|
201
|
-
// frames are gone. A discontinuity that exists only inside retained history is still a
|
|
202
|
-
// discontinuity after the baseline, and it is the one kind no live arrival will ever
|
|
203
|
-
// reveal, because nothing after it is out of order.
|
|
204
|
-
//
|
|
205
|
-
// Reported as runs rather than per missing number, so losing a thousand frames is one note
|
|
206
|
-
// naming both ends instead of a thousand notes burying it. The walk stops at `highest`,
|
|
207
|
-
// which is in the set by construction, so a run always terminates on a present frame.
|
|
208
|
-
let run = 0;
|
|
209
|
-
for (let s = c.baseline + 1; s <= highest; s++) {
|
|
210
|
-
if (!c.seen.has(s)) {
|
|
211
|
-
run++;
|
|
212
|
-
continue;
|
|
213
|
-
}
|
|
214
|
-
if (run > 0) {
|
|
215
|
-
notes.push({ type: "gap", key, expected: s - run, got: s, missing: run });
|
|
216
|
-
c.faulted = true;
|
|
217
|
-
run = 0;
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
// Phase two: release what the tap delivered while the fetch was in flight. Sorted by `seq`
|
|
223
|
-
// within a chain and stable across chains, so a chain's frames are contiguous with the
|
|
224
|
-
// retained range they follow.
|
|
225
|
-
const heldFrames = pending
|
|
226
|
-
.map((entry, i) => ({ entry, frame: frameOf(entry), i }))
|
|
227
|
-
.filter((h) => h.frame !== undefined);
|
|
228
|
-
heldFrames.sort((a, b) => (a.frame.seq - b.frame.seq) || (a.i - b.i));
|
|
229
|
-
|
|
230
|
-
for (const h of heldFrames) {
|
|
231
|
-
const key = chainKey(h.entry, h.frame);
|
|
232
|
-
const c = chainOf(key);
|
|
233
|
-
if (c.next === undefined) {
|
|
234
|
-
// No retained frame for this chain, so the earliest BUFFERED frame is the baseline. This
|
|
235
|
-
// is the empty-history arm, and it is why the buffer is sorted before it is walked.
|
|
236
|
-
c.baseline = h.frame.seq;
|
|
237
|
-
c.next = h.frame.seq;
|
|
238
|
-
c.prefixIncomplete = h.frame.seq > FIRST_SEQ;
|
|
239
|
-
if (c.prefixIncomplete)
|
|
240
|
-
notes.push({ type: "prefix-incomplete", key, baseline: c.baseline });
|
|
241
|
-
}
|
|
242
|
-
// The seam is crossed once per chain: this frame's predecessor is retained history (or
|
|
243
|
-
// nothing), every later one's predecessor came through the same tap it did.
|
|
244
|
-
const straddle = !c.released;
|
|
245
|
-
c.released = true;
|
|
246
|
-
const r = admit(c, key, h.frame.seq, straddle);
|
|
247
|
-
for (const n of r.notes) notes.push(n);
|
|
248
|
-
if (r.emit) rows.push(h.entry);
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
pending.length = 0;
|
|
252
|
-
settled = true;
|
|
253
|
-
return { emit: rows, notes };
|
|
254
|
-
},
|
|
255
|
-
|
|
256
|
-
/** Whether the boundary has passed. Gap checking is armed only after it has. */
|
|
257
|
-
get settled() {
|
|
258
|
-
return settled;
|
|
259
|
-
},
|
|
260
|
-
/** Held-but-unreleased count. Zero after the boundary, by construction. */
|
|
261
|
-
get pendingCount() {
|
|
262
|
-
return pending.length;
|
|
263
|
-
},
|
|
264
|
-
/** A chain's observed state, for a surface that wants to mark it and for the suite. */
|
|
265
|
-
state(key) {
|
|
266
|
-
const c = chains.get(key);
|
|
267
|
-
return c === undefined
|
|
268
|
-
? undefined
|
|
269
|
-
: {
|
|
270
|
-
baseline: c.baseline,
|
|
271
|
-
next: c.next,
|
|
272
|
-
prefixIncomplete: c.prefixIncomplete,
|
|
273
|
-
faulted: c.faulted,
|
|
274
|
-
};
|
|
275
|
-
},
|
|
276
|
-
get chainKeys() {
|
|
277
|
-
return [...chains.keys()];
|
|
278
|
-
},
|
|
279
|
-
};
|
|
280
|
-
};
|
|
281
|
-
|
|
282
|
-
window.COTAL_EVENT_ORDER = { KIND, FIRST_SEQ, frameOf, chainKey, create };
|
|
283
|
-
})();
|
package/dist/web/graph.html
DELETED
|
@@ -1,225 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
-
<title>Cotal · graph</title>
|
|
7
|
-
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
8
|
-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
9
|
-
<link
|
|
10
|
-
href="https://fonts.googleapis.com/css2?family=Work+Sans:wght@400;500;600;700&display=swap"
|
|
11
|
-
rel="stylesheet"
|
|
12
|
-
/>
|
|
13
|
-
<style>
|
|
14
|
-
:root {
|
|
15
|
-
--bg: #131a26; --panel: #1b2330cc; --line: #38414f; --fg: #eef2f7;
|
|
16
|
-
--dim: #8b949e; --faint: #6e7681;
|
|
17
|
-
--chat: #58a6ff; --unicast: #d29922; --anycast: #3fb950;
|
|
18
|
-
--working: #3fb950; --waiting: #e3b341; --idle: #6e7681; --red: #f85149;
|
|
19
|
-
--font: "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
20
|
-
}
|
|
21
|
-
* { box-sizing: border-box; }
|
|
22
|
-
html, body { height: 100%; margin: 0; }
|
|
23
|
-
body {
|
|
24
|
-
font-family: var(--font); font-size: 13px; background: var(--bg); color: var(--fg);
|
|
25
|
-
overflow: hidden; -webkit-font-smoothing: antialiased;
|
|
26
|
-
}
|
|
27
|
-
#graph { position: fixed; inset: 0; display: block; cursor: grab; }
|
|
28
|
-
#graph.hover { cursor: pointer; }
|
|
29
|
-
|
|
30
|
-
/* floating glass surfaces */
|
|
31
|
-
.glass {
|
|
32
|
-
background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
|
|
33
|
-
backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/* ── header (top, floating) ── */
|
|
37
|
-
header {
|
|
38
|
-
position: fixed; top: 14px; left: 14px; right: 14px; z-index: 10;
|
|
39
|
-
display: flex; align-items: center; gap: 16px; padding: 9px 14px;
|
|
40
|
-
}
|
|
41
|
-
.brand { display: flex; align-items: center; gap: 9px; }
|
|
42
|
-
.brand .mark { width: 9px; height: 9px; border-radius: 50%; background: var(--chat);
|
|
43
|
-
box-shadow: 0 0 10px var(--chat); }
|
|
44
|
-
.brand .title { font-size: 16px; font-weight: 700; }
|
|
45
|
-
.brand .space { font-size: 13px; color: var(--dim); }
|
|
46
|
-
.navlink {
|
|
47
|
-
font-size: 12px; font-weight: 600; color: var(--dim); text-decoration: none;
|
|
48
|
-
padding: 5px 11px; border-radius: 8px; border: 1px solid var(--line);
|
|
49
|
-
}
|
|
50
|
-
.navlink:hover { color: var(--fg); border-color: var(--chat); }
|
|
51
|
-
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px;
|
|
52
|
-
border-radius: 20px; background: #1f2d24; }
|
|
53
|
-
.pill .d { width: 7px; height: 7px; border-radius: 50%; background: var(--working); }
|
|
54
|
-
.pill .t { font-size: 11px; font-weight: 600; color: var(--working); }
|
|
55
|
-
.pill.down { background: #2a1717; } .pill.down .d { background: var(--red); }
|
|
56
|
-
.pill.down .t { color: var(--red); }
|
|
57
|
-
/* membership-freshness pill states */
|
|
58
|
-
.pill.stale { background: #2a2417; } .pill.stale .d { background: var(--waiting); }
|
|
59
|
-
.pill.stale .t { color: var(--waiting); }
|
|
60
|
-
.pill.off { background: #1f242c; } .pill.off .d { background: var(--faint); }
|
|
61
|
-
.pill.off .t { color: var(--dim); }
|
|
62
|
-
|
|
63
|
-
.ctrls { margin-left: auto; display: flex; align-items: center; gap: 7px; }
|
|
64
|
-
.grp { display: flex; align-items: center; gap: 4px; padding-right: 7px;
|
|
65
|
-
margin-right: 0; border-right: 1px solid var(--line); }
|
|
66
|
-
.grp:last-child { border-right: 0; padding-right: 0; }
|
|
67
|
-
.chip {
|
|
68
|
-
font-size: 11px; padding: 4px 9px; border-radius: 13px; cursor: pointer;
|
|
69
|
-
color: var(--faint); user-select: none; border: 1px solid transparent; white-space: nowrap;
|
|
70
|
-
}
|
|
71
|
-
.chip:hover { color: var(--fg); }
|
|
72
|
-
.chip.on { background: #ffffff10; border-color: var(--line); color: var(--fg); }
|
|
73
|
-
.chip.mode.chat.on { color: var(--chat); } .chip.mode.unicast.on { color: var(--unicast); }
|
|
74
|
-
.chip.mode.anycast.on { color: var(--anycast); }
|
|
75
|
-
.chip.pause.on { color: var(--waiting); border-color: var(--waiting); }
|
|
76
|
-
.chip.offline.on { color: var(--idle); border-color: var(--line); }
|
|
77
|
-
|
|
78
|
-
/* ── legend (bottom-left, collapsible) ── */
|
|
79
|
-
#legend { position: fixed; left: 14px; bottom: 14px; z-index: 10; padding: 0;
|
|
80
|
-
max-width: 200px; overflow: hidden; }
|
|
81
|
-
#legend .ltoggle {
|
|
82
|
-
display: flex; align-items: center; justify-content: space-between;
|
|
83
|
-
width: 100%; padding: 7px 12px; cursor: pointer; appearance: none;
|
|
84
|
-
font-size: 10px; font-weight: 600; letter-spacing: .6px; color: var(--faint);
|
|
85
|
-
text-transform: uppercase; background: transparent; border: 0;
|
|
86
|
-
text-align: left; font-family: inherit;
|
|
87
|
-
}
|
|
88
|
-
#legend .ltoggle:hover { color: var(--dim); }
|
|
89
|
-
#legend .ltoggle .chev { font-size: 9px; opacity: .5; transition: transform .2s ease; }
|
|
90
|
-
#legend.collapsed .ltoggle .chev { transform: rotate(-90deg); }
|
|
91
|
-
#legend .lbody { display: flex; flex-direction: column; gap: 5px; padding: 2px 12px 10px; }
|
|
92
|
-
#legend.collapsed .lbody { display: none; }
|
|
93
|
-
#legend .ls { font-size: 9px; font-weight: 600; letter-spacing: .5px; color: var(--faint);
|
|
94
|
-
text-transform: uppercase; opacity: .65; margin-top: 3px; }
|
|
95
|
-
#legend .ls:first-child { margin-top: 0; }
|
|
96
|
-
#legend .row { display: flex; align-items: center; gap: 9px; font-size: 11px; color: var(--dim); }
|
|
97
|
-
#legend .sw { width: 14px; height: 2px; border-radius: 1px; flex: none; }
|
|
98
|
-
#legend .sw-dot { width: 8px; height: 8px; border-radius: 50%; }
|
|
99
|
-
#legend .ring { width: 8px; height: 8px; border-radius: 50%; flex: none;
|
|
100
|
-
background: transparent; box-shadow: 0 0 0 1.5px currentColor inset; }
|
|
101
|
-
/* Offline is hollow dashed (shape channel), not a filled/inset-solid ring. */
|
|
102
|
-
#legend .ring.off {
|
|
103
|
-
background: transparent; box-shadow: none;
|
|
104
|
-
border: 1.5px dashed currentColor;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/* ── detail panel (right, floating) ── */
|
|
108
|
-
#detail {
|
|
109
|
-
position: fixed; top: 64px; right: 14px; bottom: 14px; width: 308px; z-index: 10;
|
|
110
|
-
padding: 16px 16px 18px; overflow-y: auto; display: none; flex-direction: column; gap: 14px;
|
|
111
|
-
scrollbar-width: thin; scrollbar-color: var(--line) transparent;
|
|
112
|
-
}
|
|
113
|
-
#detail::-webkit-scrollbar { width: 6px; }
|
|
114
|
-
#detail::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
|
|
115
|
-
#detail.open { display: flex; }
|
|
116
|
-
#detail .x { position: absolute; top: 10px; right: 10px; cursor: pointer; color: var(--faint);
|
|
117
|
-
font-size: 13px; width: 22px; height: 22px; display: flex; align-items: center;
|
|
118
|
-
justify-content: center; border-radius: 5px; line-height: 1; }
|
|
119
|
-
#detail .x:hover { color: var(--fg); background: #ffffff12; }
|
|
120
|
-
.d-kind { font-size: 10px; font-weight: 600; letter-spacing: .6px; color: var(--faint);
|
|
121
|
-
text-transform: uppercase; }
|
|
122
|
-
.d-who { font-size: 16px; font-weight: 700; line-height: 1.25; padding-right: 26px; }
|
|
123
|
-
.d-who .role { font-size: 11px; font-weight: 500; color: var(--faint); margin-left: 6px; }
|
|
124
|
-
.d-status { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px;
|
|
125
|
-
font-weight: 500; padding: 3px 10px; border-radius: 20px; background: #ffffff08;
|
|
126
|
-
color: var(--dim); width: fit-content; }
|
|
127
|
-
.d-status .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor;
|
|
128
|
-
box-shadow: 0 0 6px currentColor; }
|
|
129
|
-
.d-status.working { background: #16231a; color: var(--working); }
|
|
130
|
-
.d-status.waiting { background: #2a2117; color: var(--waiting); }
|
|
131
|
-
.d-status.idle { color: var(--dim); }
|
|
132
|
-
.d-status.offline { color: var(--faint); }
|
|
133
|
-
.presence-facts { font-size: 12px; color: var(--dim); line-height: 1.5;
|
|
134
|
-
white-space: normal; overflow-wrap: anywhere; }
|
|
135
|
-
.d-section { display: flex; flex-direction: column; gap: 5px; }
|
|
136
|
-
.d-label { font-size: 9.5px; font-weight: 600; letter-spacing: .5px; color: var(--faint);
|
|
137
|
-
text-transform: uppercase; }
|
|
138
|
-
.d-block { font-size: 12px; line-height: 1.55; padding: 9px 11px; border-radius: 7px;
|
|
139
|
-
background: #ffffff08; border: 1px solid var(--line); white-space: pre-wrap; word-break: break-word; }
|
|
140
|
-
.d-block.muted { color: var(--dim); font-style: italic; }
|
|
141
|
-
.d-rows { display: flex; flex-direction: column; gap: 5px; }
|
|
142
|
-
.d-row { display: flex; gap: 10px; font-size: 11.5px; line-height: 1.4; }
|
|
143
|
-
.d-row .k { color: var(--faint); min-width: 64px; flex: none; }
|
|
144
|
-
.d-row .v { color: var(--fg); word-break: break-word; }
|
|
145
|
-
.d-row .v.muted { color: var(--faint); font-style: italic; }
|
|
146
|
-
.d-row .v .hmark { margin-right: 4px; font-weight: 700; }
|
|
147
|
-
.d-row .v.att-dnd { color: #db6d28; font-weight: 600; }
|
|
148
|
-
.d-row .v.att-focus { color: var(--chat); font-weight: 600; }
|
|
149
|
-
.d-msgs { display: flex; flex-direction: column; gap: 5px; }
|
|
150
|
-
.d-msg { font-size: 11px; line-height: 1.45; padding: 7px 10px 8px; border-radius: 6px;
|
|
151
|
-
background: #ffffff06; border-left: 2px solid var(--line); }
|
|
152
|
-
.d-msg .mhead { display: flex; align-items: baseline; gap: 6px; margin-bottom: 3px; }
|
|
153
|
-
.d-msg .m { font-size: 9px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; }
|
|
154
|
-
.d-msg .who { color: var(--fg); font-weight: 600; }
|
|
155
|
-
.d-msg .tgt { color: var(--dim); }
|
|
156
|
-
.d-msg .body { color: var(--dim); word-break: break-word; }
|
|
157
|
-
.d-msg.empty { text-align: center; color: var(--faint); font-style: italic; border-left-color: transparent; }
|
|
158
|
-
/* member / subscription tag rows in the detail panel */
|
|
159
|
-
.d-tags { display: flex; flex-wrap: wrap; gap: 5px; }
|
|
160
|
-
.mtag { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--fg);
|
|
161
|
-
padding: 3px 8px; border-radius: 13px; background: #ffffff08; border: 1px solid var(--line); }
|
|
162
|
-
.mtag .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; box-shadow: 0 0 5px currentColor; }
|
|
163
|
-
.mtag .act { font-size: 9px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; color: var(--chat); }
|
|
164
|
-
.mtag .off { font-size: 9px; font-weight: 600; letter-spacing: .3px; text-transform: uppercase; color: var(--faint); }
|
|
165
|
-
.ctag { font-size: 11px; color: var(--chat); padding: 3px 8px; border-radius: 13px;
|
|
166
|
-
background: #58a6ff14; border: 1px solid #58a6ff33; }
|
|
167
|
-
.ctag.off { color: var(--dim); background: #ffffff06; border-color: var(--line); }
|
|
168
|
-
.hint { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 9;
|
|
169
|
-
font-size: 11.5px; color: var(--faint); pointer-events: none; transition: opacity .4s; }
|
|
170
|
-
</style>
|
|
171
|
-
</head>
|
|
172
|
-
<body>
|
|
173
|
-
<canvas id="graph"></canvas>
|
|
174
|
-
|
|
175
|
-
<header class="glass">
|
|
176
|
-
<span class="brand">
|
|
177
|
-
<span class="mark"></span>
|
|
178
|
-
<span class="title">Cotal</span>
|
|
179
|
-
<span class="space" id="space"></span>
|
|
180
|
-
</span>
|
|
181
|
-
<a class="navlink" href="/">← Monitor</a>
|
|
182
|
-
<span class="pill down" id="conn"><span class="d"></span><span class="t">connecting</span></span>
|
|
183
|
-
<span class="pill stale" id="stale" hidden><span class="d"></span><span class="t"></span></span>
|
|
184
|
-
<span class="pill off" id="feed" hidden><span class="d"></span><span class="t">membership</span></span>
|
|
185
|
-
<div class="ctrls">
|
|
186
|
-
<div class="grp" id="modes">
|
|
187
|
-
<span class="chip mode chat on" data-mode="chat">channel</span>
|
|
188
|
-
<span class="chip mode unicast on" data-mode="unicast">direct</span>
|
|
189
|
-
<span class="chip mode anycast on" data-mode="anycast">anycast</span>
|
|
190
|
-
</div>
|
|
191
|
-
<span class="chip offline on" id="hideOffline">hide offline</span>
|
|
192
|
-
<span class="chip offline on" id="hideEmpty">hide empty</span>
|
|
193
|
-
<span class="chip pause" id="pause">⏸ pause</span>
|
|
194
|
-
</div>
|
|
195
|
-
</header>
|
|
196
|
-
|
|
197
|
-
<div id="legend" class="glass">
|
|
198
|
-
<button class="ltoggle" id="legendToggle" type="button"><span>legend</span><span class="chev">▾</span></button>
|
|
199
|
-
<div class="lbody">
|
|
200
|
-
<span class="ls">traffic</span>
|
|
201
|
-
<span class="row"><span class="sw" style="background:var(--chat)"></span> channel post → hub</span>
|
|
202
|
-
<span class="row"><span class="sw" style="background:var(--unicast)"></span> direct message</span>
|
|
203
|
-
<span class="row"><span class="sw sw-dot" style="background:var(--anycast)"></span> anycast (to a role)</span>
|
|
204
|
-
<span class="ls">membership</span>
|
|
205
|
-
<span class="row"><span class="sw" style="background:#8493a8"></span> subscribed (live)</span>
|
|
206
|
-
<span class="row"><span class="sw" style="background:#5a6472;opacity:.7"></span> member · offline</span>
|
|
207
|
-
<span class="ls">agents</span>
|
|
208
|
-
<span class="row"><span class="ring" style="color:var(--working)"></span> working</span>
|
|
209
|
-
<span class="row"><span class="ring" style="color:var(--waiting)"></span> waiting · needs input</span>
|
|
210
|
-
<span class="row"><span class="ring" style="color:var(--idle)"></span> idle (filled)</span>
|
|
211
|
-
<span class="row"><span class="ring off" style="color:var(--idle);opacity:.85"></span> offline (hollow dashed)</span>
|
|
212
|
-
<span class="row"><span style="font-size:12px;color:#db6d28;font-weight:700">◼</span> dnd · <span style="font-size:12px;color:var(--chat);font-weight:700">◉</span> focus</span>
|
|
213
|
-
</div>
|
|
214
|
-
</div>
|
|
215
|
-
|
|
216
|
-
<aside id="detail" class="glass"></aside>
|
|
217
|
-
<div class="hint" id="hint">click a node for detail · scroll to zoom · drag to pan</div>
|
|
218
|
-
|
|
219
|
-
<script src="/snapshot.js"></script>
|
|
220
|
-
<script src="/harness.js"></script>
|
|
221
|
-
<script src="/parts.js"></script>
|
|
222
|
-
<script src="/agui-frame.js"></script>
|
|
223
|
-
<script type="module" src="/graph.js"></script>
|
|
224
|
-
</body>
|
|
225
|
-
</html>
|