agentix-cli 0.182.0 → 0.183.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/{App-XWSSUYKF.js → App-777XBP22.js} +2 -2
- package/dist/{ChatApp-UT2BRHYE.js → ChatApp-ZYMF5HSR.js} +2 -2
- package/dist/{absorb-eval-SFGUURBD.js → absorb-eval-HYGBAPXS.js} +2 -2
- package/dist/{adapter-UHR7FVM7.js → adapter-VV626IYN.js} +2 -2
- package/dist/{agent-5NTFSCEO.js → agent-BS5VSO5T.js} +2 -2
- package/dist/{board-dashboard-7HIME2W4.js → board-dashboard-3CMB3NPI.js} +543 -2158
- package/dist/board-dashboard-3CMB3NPI.js.map +1 -0
- package/dist/{chunk-IFHVAHQM.js → chunk-3ENH7HAS.js} +2 -2
- package/dist/chunk-5ELIX7BQ.js +3 -0
- package/dist/chunk-5ELIX7BQ.js.map +1 -0
- package/dist/{chunk-YX4R2VGD.js → chunk-6D4RGQCU.js} +2 -2
- package/dist/{chunk-FYFJ7IQJ.js → chunk-6KWHQAXS.js} +2 -2
- package/dist/{chunk-FDX4IGLK.js → chunk-6MY7VXQV.js} +2 -2
- package/dist/chunk-CZMVJP7O.js +2 -0
- package/dist/chunk-CZMVJP7O.js.map +1 -0
- package/dist/{chunk-4KNHLHE3.js → chunk-DOCAWXV5.js} +2 -2
- package/dist/{chunk-5NGQQOVK.js → chunk-DYNXOYFN.js} +2 -2
- package/dist/{chunk-RDWDDPBI.js → chunk-GXOKZSCS.js} +2 -2
- package/dist/{chunk-Y4TVCWWF.js → chunk-JJ2WRGKI.js} +2 -2
- package/dist/{chunk-XI2HH5NR.js → chunk-KLWCVTBM.js} +2 -2
- package/dist/{chunk-MD2HCGSC.js → chunk-M7V7NCX6.js} +2 -2
- package/dist/chunk-M7V7NCX6.js.map +1 -0
- package/dist/chunk-MLNA54RW.js +888 -0
- package/dist/chunk-MLNA54RW.js.map +1 -0
- package/dist/{chunk-7WGJZLVJ.js → chunk-OIECBQ45.js} +2 -2
- package/dist/{chunk-XHJ5SVO5.js → chunk-OTITQCEQ.js} +271 -271
- package/dist/chunk-OTITQCEQ.js.map +1 -0
- package/dist/{chunk-QGNV2HA4.js → chunk-PIVIOIEC.js} +2 -2
- package/dist/{chunk-QB6UPODO.js → chunk-QSJA6S66.js} +2 -2
- package/dist/{chunk-IGBW4VVM.js → chunk-R2QFKEX5.js} +2 -2
- package/dist/{chunk-NIPMVM3G.js → chunk-RG6MO7G5.js} +2 -2
- package/dist/{chunk-5YG2ZQQW.js → chunk-RQOMUGUM.js} +2 -2
- package/dist/{chunk-Z4XVPGPZ.js → chunk-SBJHIBWX.js} +3 -3
- package/dist/{chunk-GEFZMDDX.js → chunk-TD2D4TGI.js} +2 -2
- package/dist/{chunk-H2KOXGDX.js → chunk-UNZVDS3P.js} +2 -2
- package/dist/{chunk-YSPBVLTZ.js → chunk-VDUMYEJH.js} +2 -2
- package/dist/{chunk-BY3AUZYM.js → chunk-XBQISUBE.js} +2 -2
- package/dist/chunk-XPE2WKPF.js +2903 -0
- package/dist/chunk-XPE2WKPF.js.map +1 -0
- package/dist/{chunk-JNWXHOJE.js → chunk-YH7NALJ4.js} +2 -2
- package/dist/{chunk-Y5TBOMHY.js → chunk-YZCQDZCA.js} +5 -5
- package/dist/{chunk-343MPMLD.js → chunk-ZOCRNNNG.js} +2 -2
- package/dist/{chunk-4WSJKKSA.js → chunk-ZSS3GL5A.js} +2 -2
- package/dist/cli.js +1 -1
- package/dist/{client-SQMU25PS.js → client-CMQZO22V.js} +2 -2
- package/dist/{config-56NBA4SF.js → config-BMYFEAO5.js} +2 -2
- package/dist/{config-mutate-PD4O3HZ7.js → config-mutate-N6W52YXB.js} +2 -2
- package/dist/config-mutator-S5SGBNOG.js +2 -0
- package/dist/{contributions-DKTJ623L.js → contributions-KRES5F2V.js} +2 -2
- package/dist/{doctor-OI6GJZR5.js → doctor-2KACCIZU.js} +2 -2
- package/dist/{follow-up-tool-DYSLS6ZI.js → follow-up-tool-M57XXTPX.js} +2 -2
- package/dist/{hub-4HDMTSR7.js → hub-FVAPTKTF.js} +2 -2
- package/dist/index.js +1 -1
- package/dist/{program-4GDIWCDM.js → program-BHDAV67G.js} +260 -259
- package/dist/program-BHDAV67G.js.map +1 -0
- package/dist/{promote-3272TZNI.js → promote-LXKF6A24.js} +2 -2
- package/dist/push-bridge-NR7SLHGX.js +1 -1
- package/dist/{query-7XM6V4QG.js → query-W7OBMMVM.js} +2 -2
- package/dist/{query-settings-HHVBIIVQ.js → query-settings-PTA2SA63.js} +2 -2
- package/dist/{registry-QL3AM3UH.js → registry-OHUOHAD2.js} +2 -2
- package/dist/{request-planner-WNEDEA7X.js → request-planner-T44RMVNO.js} +2 -2
- package/dist/{review-candidates-TGPDJMWJ.js → review-candidates-LKFIKTY6.js} +2 -2
- package/dist/{routing-ALXY25NE.js → routing-7HEUMP4R.js} +2 -2
- package/dist/schedule-tool-W6KPENHW.js +2 -0
- package/dist/{scheduler-5PHNW243.js → scheduler-I3UNKBBJ.js} +2 -2
- package/dist/{seat-ZYVVEILY.js → seat-DAMUB3CU.js} +2 -2
- package/dist/{select-6QLEV6AC.js → select-PMNHXNKI.js} +2 -2
- package/dist/self-SO6GCVYD.js +2 -0
- package/dist/{set-enabled-SYYTKJPC.js → set-enabled-36JN5ZRJ.js} +2 -2
- package/dist/signal-exit-C5EUGHKI.js +3 -0
- package/dist/signal-exit-C5EUGHKI.js.map +1 -0
- package/dist/{sprint-tool-PYVHPHR2.js → sprint-tool-Z4RRPK6I.js} +2 -2
- package/dist/{tool-TDOUM3BJ.js → tool-B6I22BG2.js} +2 -2
- package/dist/{tool-ZKZ4KYJT.js → tool-KTL4TLZP.js} +2 -2
- package/dist/{tool-GIYOYXXM.js → tool-SK3AAQYW.js} +2 -2
- package/dist/{wiki-ZRGLGMII.js → wiki-H2CBE4SM.js} +2 -2
- package/dist/wiki-enrich-GTUSSLCD.js +2 -0
- package/package.json +4 -1
- package/dist/board-dashboard-7HIME2W4.js.map +0 -1
- package/dist/chunk-7PQQZC6B.js +0 -310
- package/dist/chunk-7PQQZC6B.js.map +0 -1
- package/dist/chunk-MD2HCGSC.js.map +0 -1
- package/dist/chunk-NRUUT5TL.js +0 -256
- package/dist/chunk-NRUUT5TL.js.map +0 -1
- package/dist/chunk-OKADR5QO.js +0 -869
- package/dist/chunk-OKADR5QO.js.map +0 -1
- package/dist/chunk-R3CDFSNF.js +0 -580
- package/dist/chunk-R3CDFSNF.js.map +0 -1
- package/dist/chunk-XHJ5SVO5.js.map +0 -1
- package/dist/chunk-ZRALOFEG.js +0 -2035
- package/dist/chunk-ZRALOFEG.js.map +0 -1
- package/dist/config-mutator-ITL64FBW.js +0 -2
- package/dist/processes-M7YPWX7H.js +0 -2
- package/dist/program-4GDIWCDM.js.map +0 -1
- package/dist/schedule-tool-22UBZXCG.js +0 -2
- package/dist/signal-exit-WL7G3EEZ.js +0 -2
- package/dist/signal-exit-WL7G3EEZ.js.map +0 -1
- package/dist/wiki-enrich-CTID7JQW.js +0 -2
- /package/dist/{App-XWSSUYKF.js.map → App-777XBP22.js.map} +0 -0
- /package/dist/{ChatApp-UT2BRHYE.js.map → ChatApp-ZYMF5HSR.js.map} +0 -0
- /package/dist/{absorb-eval-SFGUURBD.js.map → absorb-eval-HYGBAPXS.js.map} +0 -0
- /package/dist/{adapter-UHR7FVM7.js.map → adapter-VV626IYN.js.map} +0 -0
- /package/dist/{agent-5NTFSCEO.js.map → agent-BS5VSO5T.js.map} +0 -0
- /package/dist/{chunk-IFHVAHQM.js.map → chunk-3ENH7HAS.js.map} +0 -0
- /package/dist/{chunk-YX4R2VGD.js.map → chunk-6D4RGQCU.js.map} +0 -0
- /package/dist/{chunk-FYFJ7IQJ.js.map → chunk-6KWHQAXS.js.map} +0 -0
- /package/dist/{chunk-FDX4IGLK.js.map → chunk-6MY7VXQV.js.map} +0 -0
- /package/dist/{chunk-4KNHLHE3.js.map → chunk-DOCAWXV5.js.map} +0 -0
- /package/dist/{chunk-5NGQQOVK.js.map → chunk-DYNXOYFN.js.map} +0 -0
- /package/dist/{chunk-RDWDDPBI.js.map → chunk-GXOKZSCS.js.map} +0 -0
- /package/dist/{chunk-Y4TVCWWF.js.map → chunk-JJ2WRGKI.js.map} +0 -0
- /package/dist/{chunk-XI2HH5NR.js.map → chunk-KLWCVTBM.js.map} +0 -0
- /package/dist/{chunk-7WGJZLVJ.js.map → chunk-OIECBQ45.js.map} +0 -0
- /package/dist/{chunk-QGNV2HA4.js.map → chunk-PIVIOIEC.js.map} +0 -0
- /package/dist/{chunk-QB6UPODO.js.map → chunk-QSJA6S66.js.map} +0 -0
- /package/dist/{chunk-IGBW4VVM.js.map → chunk-R2QFKEX5.js.map} +0 -0
- /package/dist/{chunk-NIPMVM3G.js.map → chunk-RG6MO7G5.js.map} +0 -0
- /package/dist/{chunk-5YG2ZQQW.js.map → chunk-RQOMUGUM.js.map} +0 -0
- /package/dist/{chunk-Z4XVPGPZ.js.map → chunk-SBJHIBWX.js.map} +0 -0
- /package/dist/{chunk-GEFZMDDX.js.map → chunk-TD2D4TGI.js.map} +0 -0
- /package/dist/{chunk-H2KOXGDX.js.map → chunk-UNZVDS3P.js.map} +0 -0
- /package/dist/{chunk-YSPBVLTZ.js.map → chunk-VDUMYEJH.js.map} +0 -0
- /package/dist/{chunk-BY3AUZYM.js.map → chunk-XBQISUBE.js.map} +0 -0
- /package/dist/{chunk-JNWXHOJE.js.map → chunk-YH7NALJ4.js.map} +0 -0
- /package/dist/{chunk-Y5TBOMHY.js.map → chunk-YZCQDZCA.js.map} +0 -0
- /package/dist/{chunk-343MPMLD.js.map → chunk-ZOCRNNNG.js.map} +0 -0
- /package/dist/{chunk-4WSJKKSA.js.map → chunk-ZSS3GL5A.js.map} +0 -0
- /package/dist/{client-SQMU25PS.js.map → client-CMQZO22V.js.map} +0 -0
- /package/dist/{config-56NBA4SF.js.map → config-BMYFEAO5.js.map} +0 -0
- /package/dist/{config-mutate-PD4O3HZ7.js.map → config-mutate-N6W52YXB.js.map} +0 -0
- /package/dist/{config-mutator-ITL64FBW.js.map → config-mutator-S5SGBNOG.js.map} +0 -0
- /package/dist/{contributions-DKTJ623L.js.map → contributions-KRES5F2V.js.map} +0 -0
- /package/dist/{doctor-OI6GJZR5.js.map → doctor-2KACCIZU.js.map} +0 -0
- /package/dist/{follow-up-tool-DYSLS6ZI.js.map → follow-up-tool-M57XXTPX.js.map} +0 -0
- /package/dist/{hub-4HDMTSR7.js.map → hub-FVAPTKTF.js.map} +0 -0
- /package/dist/{processes-M7YPWX7H.js.map → promote-LXKF6A24.js.map} +0 -0
- /package/dist/{promote-3272TZNI.js.map → query-W7OBMMVM.js.map} +0 -0
- /package/dist/{query-settings-HHVBIIVQ.js.map → query-settings-PTA2SA63.js.map} +0 -0
- /package/dist/{query-7XM6V4QG.js.map → registry-OHUOHAD2.js.map} +0 -0
- /package/dist/{request-planner-WNEDEA7X.js.map → request-planner-T44RMVNO.js.map} +0 -0
- /package/dist/{review-candidates-TGPDJMWJ.js.map → review-candidates-LKFIKTY6.js.map} +0 -0
- /package/dist/{registry-QL3AM3UH.js.map → routing-7HEUMP4R.js.map} +0 -0
- /package/dist/{routing-ALXY25NE.js.map → schedule-tool-W6KPENHW.js.map} +0 -0
- /package/dist/{schedule-tool-22UBZXCG.js.map → scheduler-I3UNKBBJ.js.map} +0 -0
- /package/dist/{scheduler-5PHNW243.js.map → seat-DAMUB3CU.js.map} +0 -0
- /package/dist/{select-6QLEV6AC.js.map → select-PMNHXNKI.js.map} +0 -0
- /package/dist/{seat-ZYVVEILY.js.map → self-SO6GCVYD.js.map} +0 -0
- /package/dist/{set-enabled-SYYTKJPC.js.map → set-enabled-36JN5ZRJ.js.map} +0 -0
- /package/dist/{sprint-tool-PYVHPHR2.js.map → sprint-tool-Z4RRPK6I.js.map} +0 -0
- /package/dist/{tool-TDOUM3BJ.js.map → tool-B6I22BG2.js.map} +0 -0
- /package/dist/{tool-ZKZ4KYJT.js.map → tool-KTL4TLZP.js.map} +0 -0
- /package/dist/{tool-GIYOYXXM.js.map → tool-SK3AAQYW.js.map} +0 -0
- /package/dist/{wiki-ZRGLGMII.js.map → wiki-H2CBE4SM.js.map} +0 -0
- /package/dist/{wiki-enrich-CTID7JQW.js.map → wiki-enrich-GTUSSLCD.js.map} +0 -0
|
@@ -0,0 +1,2903 @@
|
|
|
1
|
+
import{a as Ge,b as k,c as D,d as Xe,e as ge,f as ue,g as j,h as me,i as N,j as L,n as Ve,o as Qe,p as Ze,q as ea}from"./chunk-EFGAPAYZ.js";import{e as Ye,i as Je}from"./chunk-QAWKN2N4.js";import{b as xe}from"./chunk-DODL5POT.js";import{a as Q,b as Ke}from"./chunk-3ENH7HAS.js";import{Ia as We,Ja as Be,Ka as Ue,Ma as Fe,ja as _,oa as Le,wb as qe}from"./chunk-MLNA54RW.js";import{a as X}from"./chunk-IMLAPB7G.js";import{b as V}from"./chunk-2VDO2HEK.js";import{c as Me,e as He}from"./chunk-LQE73AZR.js";import{b as Ne}from"./chunk-MRIVENBY.js";import{n as pe,p as je}from"./chunk-CTNZVRPA.js";import{ga as G}from"./chunk-PIVIOIEC.js";import{a as q,b as J}from"./chunk-6MY7VXQV.js";import{a as De}from"./chunk-TD2D4TGI.js";import{c as Ee,d as Re}from"./chunk-OWNQ2FD4.js";import{a as Oe}from"./chunk-ROLSSYXE.js";import{a as Pe}from"./chunk-QUFIUXMQ.js";import{Gb as ce,Ta as Ie,_a as Va,ea as de,fa as Te,pa as Xa,tb as le,wb as F,xb as ze}from"./chunk-M7V7NCX6.js";import{existsSync as K,readFileSync as da,writeFileSync as la,appendFileSync as lt,mkdirSync as ct}from"fs";import{dirname as pt,resolve as M}from"path";import{fileURLToPath as xt}from"url";import{hostname as gt}from"os";import{spawn as ut}from"child_process";var fe=`:root {
|
|
2
|
+
/* --- Brand (agentina) --------------------------------------------- */
|
|
3
|
+
--ax-blue: #2979FF;
|
|
4
|
+
--ax-blue-d: #1B5FD9;
|
|
5
|
+
--ax-blue-t: #E7F0FF;
|
|
6
|
+
--ax-blue-e: #A9CBFF;
|
|
7
|
+
--ax-green: #22B573;
|
|
8
|
+
--ax-green-d: #178F58;
|
|
9
|
+
--ax-green-e: #A9E8C9;
|
|
10
|
+
--ax-amber: #FFB300;
|
|
11
|
+
--ax-amber-e: #FFE08A;
|
|
12
|
+
--ax-amber-t: #FFFCF5;
|
|
13
|
+
--ax-red: #F23A3A;
|
|
14
|
+
--ax-red-t: #FEECEC;
|
|
15
|
+
--ax-red-e: #F9C1C1;
|
|
16
|
+
|
|
17
|
+
/* Ink steps. Amber and red are legible as FILLS, not as small text:
|
|
18
|
+
#FFB300 on white is ~1.8:1 and #F23A3A ~3.6:1, both under 4.5:1. Use
|
|
19
|
+
these wherever the colour carries words rather than area. */
|
|
20
|
+
--ax-amber-ink: #8a5a00;
|
|
21
|
+
--ax-red-ink: #a52020;
|
|
22
|
+
|
|
23
|
+
/* --- Surfaces + text ---------------------------------------------- */
|
|
24
|
+
--ax-bg: #f8f9fa;
|
|
25
|
+
--ax-bg-elev: #f1f3f4;
|
|
26
|
+
--ax-surface: #ffffff;
|
|
27
|
+
--ax-surface-2: #f8f9fa;
|
|
28
|
+
--ax-surface-3: #f1f3f4;
|
|
29
|
+
--ax-border: #e8eaed;
|
|
30
|
+
--ax-border-2: #dadce0;
|
|
31
|
+
--ax-text: #202124;
|
|
32
|
+
--ax-text-2: #5f6368;
|
|
33
|
+
--ax-muted: #9aa0a6;
|
|
34
|
+
|
|
35
|
+
/* --- Semantic ------------------------------------------------------ */
|
|
36
|
+
--ax-accent: var(--ax-blue);
|
|
37
|
+
--ax-accent-2: var(--ax-blue-d);
|
|
38
|
+
--ax-accent-t: var(--ax-blue-t);
|
|
39
|
+
--ax-ok: var(--ax-green);
|
|
40
|
+
--ax-warn: var(--ax-amber);
|
|
41
|
+
--ax-err: var(--ax-red);
|
|
42
|
+
--ax-info: var(--ax-blue);
|
|
43
|
+
|
|
44
|
+
/* --- Shape ---------------------------------------------------------
|
|
45
|
+
The offset shadow is the signature move: a solid, un-blurred drop in a
|
|
46
|
+
darker shade of the element's own colour. It reads as a physical edge
|
|
47
|
+
rather than a glow, and it is what stops flat 2px-bordered boxes from
|
|
48
|
+
looking like a wireframe. */
|
|
49
|
+
--ax-border-w: 2px;
|
|
50
|
+
--ax-radius: 16px;
|
|
51
|
+
--ax-radius-lg: 20px;
|
|
52
|
+
--ax-radius-sm: 12px;
|
|
53
|
+
--ax-radius-pill: 999px;
|
|
54
|
+
--ax-shadow: 0 3px 0 var(--ax-border);
|
|
55
|
+
--ax-shadow-lg: 0 4px 0 var(--ax-border-2);
|
|
56
|
+
--ax-shadow-accent: 0 4px 0 var(--ax-blue-d);
|
|
57
|
+
--ax-shadow-ok: 0 4px 0 var(--ax-green-d);
|
|
58
|
+
|
|
59
|
+
/* --- Spacing ------------------------------------------------------- */
|
|
60
|
+
/* Width of the ask-an-agent drawer. Lives here because pages reflow
|
|
61
|
+
around it; the drawer overwrites it on :root when resized. */
|
|
62
|
+
--ax-as-w: 420px;
|
|
63
|
+
--ax-pad: 16px;
|
|
64
|
+
--ax-pad-sm: 10px;
|
|
65
|
+
--ax-gap: 12px;
|
|
66
|
+
|
|
67
|
+
/* --- Type ---------------------------------------------------------- */
|
|
68
|
+
--ax-font: "Outfit", -apple-system, "Segoe UI", system-ui, sans-serif;
|
|
69
|
+
--ax-mono: "Roboto Mono", ui-monospace, "SF Mono", Consolas, monospace;
|
|
70
|
+
--ax-fs: 14px;
|
|
71
|
+
--ax-fs-sm: 13px;
|
|
72
|
+
--ax-fs-xs: 12px;
|
|
73
|
+
|
|
74
|
+
/* Legacy aliases so older CSS blocks keep rendering until they're ported. */
|
|
75
|
+
--bg: var(--ax-bg);
|
|
76
|
+
--card: var(--ax-surface);
|
|
77
|
+
--node: var(--ax-bg-elev);
|
|
78
|
+
--border: var(--ax-border);
|
|
79
|
+
--text: var(--ax-text);
|
|
80
|
+
--muted: var(--ax-muted);
|
|
81
|
+
--accent: var(--ax-accent);
|
|
82
|
+
--yellow: var(--ax-warn);
|
|
83
|
+
--red: var(--ax-err);
|
|
84
|
+
--blue: var(--ax-info);
|
|
85
|
+
--gray: var(--ax-muted);
|
|
86
|
+
color-scheme: light;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/* Dark is not a tint of light \u2014 the brand colours are lifted toward their
|
|
90
|
+
tints so they keep contrast against a dark ground, and the offset shadow
|
|
91
|
+
goes DARKER than the surface instead of lighter. Same shape language,
|
|
92
|
+
inverted physics. */
|
|
93
|
+
[data-theme="dark"] {
|
|
94
|
+
--ax-blue: #6BA5FF;
|
|
95
|
+
--ax-blue-d: #1B5FD9;
|
|
96
|
+
--ax-blue-t: #16233d;
|
|
97
|
+
--ax-blue-e: #2f4d7a;
|
|
98
|
+
--ax-green: #4ED89B;
|
|
99
|
+
--ax-green-d: #178F58;
|
|
100
|
+
--ax-green-e: #1e4a36;
|
|
101
|
+
--ax-amber: #FFC948;
|
|
102
|
+
--ax-amber-e: #4a3a12;
|
|
103
|
+
--ax-amber-t: #2a2313;
|
|
104
|
+
--ax-red: #FF6B6B;
|
|
105
|
+
--ax-red-t: #3a1c1c;
|
|
106
|
+
--ax-red-e: #6b2f2f;
|
|
107
|
+
--ax-amber-ink: #FFC948;
|
|
108
|
+
--ax-red-ink: #FF8A8A;
|
|
109
|
+
|
|
110
|
+
--ax-bg: #14161a;
|
|
111
|
+
--ax-bg-elev: #191c21;
|
|
112
|
+
--ax-surface: #1e2228;
|
|
113
|
+
--ax-surface-2: #23272e;
|
|
114
|
+
--ax-surface-3: #2a2f37;
|
|
115
|
+
--ax-border: #2f353e;
|
|
116
|
+
--ax-border-2: #3d444f;
|
|
117
|
+
--ax-text: #f1f3f4;
|
|
118
|
+
--ax-text-2: #b6bcc4;
|
|
119
|
+
--ax-muted: #858c96;
|
|
120
|
+
|
|
121
|
+
--ax-shadow: 0 3px 0 #0e1013;
|
|
122
|
+
--ax-shadow-lg: 0 4px 0 #0e1013;
|
|
123
|
+
--ax-shadow-accent: 0 4px 0 #14396e;
|
|
124
|
+
--ax-shadow-ok: 0 4px 0 #11402c;
|
|
125
|
+
color-scheme: dark;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/* Base element resets shared across every page. */
|
|
129
|
+
* { box-sizing: border-box; }
|
|
130
|
+
html, body {
|
|
131
|
+
margin: 0; min-height: 100vh;
|
|
132
|
+
background: var(--ax-bg); color: var(--ax-text);
|
|
133
|
+
font-family: var(--ax-font); font-size: var(--ax-fs);
|
|
134
|
+
-webkit-font-smoothing: antialiased;
|
|
135
|
+
}
|
|
136
|
+
pre, code, .ax-mono {
|
|
137
|
+
font-family: var(--ax-mono); font-variant-numeric: tabular-nums;
|
|
138
|
+
letter-spacing: -0.01em;
|
|
139
|
+
}
|
|
140
|
+
a { color: var(--ax-accent); text-decoration: none; font-weight: 600; }
|
|
141
|
+
a:hover { color: var(--ax-accent-2); text-decoration: underline; }
|
|
142
|
+
.ax-muted { color: var(--ax-muted); }
|
|
143
|
+
.ax-accent { color: var(--ax-accent); }`;var he=`
|
|
144
|
+
/* --- Dots --- */
|
|
145
|
+
.ax-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ax-muted); }
|
|
146
|
+
.ax-dot--ok, .ax-dot--live { background: var(--ax-accent); }
|
|
147
|
+
.ax-dot--warn { background: var(--ax-warn); }
|
|
148
|
+
.ax-dot--err { background: var(--ax-err); }
|
|
149
|
+
.ax-dot--off { background: var(--ax-border-2); }
|
|
150
|
+
.ax-dot--pulse {
|
|
151
|
+
box-shadow: 0 0 0 0 currentColor;
|
|
152
|
+
animation: ax-pulse 1.8s infinite;
|
|
153
|
+
color: var(--ax-accent);
|
|
154
|
+
}
|
|
155
|
+
@keyframes ax-pulse {
|
|
156
|
+
0% { box-shadow: 0 0 0 0 color-mix(in oklch, var(--ax-accent) 70%, transparent); }
|
|
157
|
+
70% { box-shadow: 0 0 0 6px color-mix(in oklch, var(--ax-accent) 0%, transparent); }
|
|
158
|
+
100% { box-shadow: 0 0 0 0 color-mix(in oklch, var(--ax-accent) 0%, transparent); }
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/* --- Badges --- */
|
|
162
|
+
.ax-badge {
|
|
163
|
+
display: inline-flex; align-items: center; gap: 4px;
|
|
164
|
+
padding: 2px 10px; border-radius: var(--ax-radius-pill); font-size: var(--ax-fs-xs); line-height: 18px;
|
|
165
|
+
border: var(--ax-border-w) solid var(--ax-border-2); color: var(--ax-text-2);
|
|
166
|
+
background: var(--ax-surface); font-weight: 600;
|
|
167
|
+
}
|
|
168
|
+
.ax-badge--mono {
|
|
169
|
+
font-family: var(--ax-mono); letter-spacing: 0.02em;
|
|
170
|
+
text-transform: uppercase; font-size: 10px;
|
|
171
|
+
}
|
|
172
|
+
.ax-badge--accent {
|
|
173
|
+
color: var(--ax-accent);
|
|
174
|
+
border-color: color-mix(in oklch, var(--ax-accent) 50%, transparent);
|
|
175
|
+
}
|
|
176
|
+
.ax-badge--live {
|
|
177
|
+
color: var(--ax-accent);
|
|
178
|
+
background: color-mix(in oklch, var(--ax-accent) 14%, transparent);
|
|
179
|
+
border-color: color-mix(in oklch, var(--ax-accent) 60%, transparent);
|
|
180
|
+
font-weight: 600; letter-spacing: 0.06em;
|
|
181
|
+
}
|
|
182
|
+
.ax-badge--warn {
|
|
183
|
+
color: var(--ax-warn);
|
|
184
|
+
border-color: color-mix(in oklch, var(--ax-warn) 50%, transparent);
|
|
185
|
+
}
|
|
186
|
+
.ax-badge--err {
|
|
187
|
+
color: var(--ax-err);
|
|
188
|
+
border-color: color-mix(in oklch, var(--ax-err) 50%, transparent);
|
|
189
|
+
}
|
|
190
|
+
.ax-badge--ghost {
|
|
191
|
+
color: var(--ax-muted); border-color: var(--ax-border); background: var(--ax-surface-2);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/* --- Buttons --- */
|
|
195
|
+
.ax-btn {
|
|
196
|
+
background: var(--ax-surface); color: var(--ax-text-2);
|
|
197
|
+
border: var(--ax-border-w) solid var(--ax-border-2); border-radius: var(--ax-radius);
|
|
198
|
+
padding: 8px 16px; font: inherit; font-size: var(--ax-fs); font-weight: 600;
|
|
199
|
+
cursor: pointer; line-height: 1.4;
|
|
200
|
+
box-shadow: var(--ax-shadow);
|
|
201
|
+
transition: border-color 0.1s, color 0.1s, background 0.1s, transform 0.06s, box-shadow 0.06s;
|
|
202
|
+
}
|
|
203
|
+
.ax-btn:hover:not(:disabled) { color: var(--ax-text); border-color: var(--ax-accent); }
|
|
204
|
+
/* The offset shadow collapses on press so the control physically sinks \u2014
|
|
205
|
+
the whole point of an un-blurred drop rather than a glow. */
|
|
206
|
+
.ax-btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--ax-border); }
|
|
207
|
+
.ax-btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
|
|
208
|
+
|
|
209
|
+
.ax-btn--primary {
|
|
210
|
+
background: color-mix(in oklch, var(--ax-accent) 15%, var(--ax-surface));
|
|
211
|
+
color: var(--ax-accent);
|
|
212
|
+
border-color: color-mix(in oklch, var(--ax-accent) 50%, var(--ax-border-2));
|
|
213
|
+
font-weight: 700;
|
|
214
|
+
box-shadow: var(--ax-shadow-accent);
|
|
215
|
+
}
|
|
216
|
+
.ax-btn--primary:hover:not(:disabled) {
|
|
217
|
+
background: color-mix(in oklch, var(--ax-accent) 25%, var(--ax-surface));
|
|
218
|
+
border-color: var(--ax-accent);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.ax-btn--ghost {
|
|
222
|
+
background: transparent; color: var(--ax-muted);
|
|
223
|
+
border-color: var(--ax-border); box-shadow: none;
|
|
224
|
+
}
|
|
225
|
+
.ax-btn--ghost:active:not(:disabled) { transform: none; }
|
|
226
|
+
|
|
227
|
+
.ax-btn--danger {
|
|
228
|
+
color: var(--ax-err);
|
|
229
|
+
border-color: var(--ax-red-e);
|
|
230
|
+
box-shadow: 0 4px 0 var(--ax-red-e);
|
|
231
|
+
}
|
|
232
|
+
.ax-btn--danger:hover:not(:disabled) {
|
|
233
|
+
background: color-mix(in oklch, var(--ax-err) 12%, var(--ax-surface));
|
|
234
|
+
border-color: var(--ax-err);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/* --- Chips (read-only labels used in kanban filters, etc.) --- */
|
|
238
|
+
.ax-chip {
|
|
239
|
+
display: inline-block; padding: 0 6px; font-family: var(--ax-mono);
|
|
240
|
+
font-size: 11px; line-height: 18px; border-radius: var(--ax-radius-pill); color: var(--ax-text-2);
|
|
241
|
+
border: var(--ax-border-w) solid var(--ax-border); background: var(--ax-surface); font-weight: 600;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/* --- Cards --- */
|
|
245
|
+
.ax-card {
|
|
246
|
+
background: var(--ax-surface); border: var(--ax-border-w) solid var(--ax-border);
|
|
247
|
+
border-radius: var(--ax-radius-lg); padding: var(--ax-pad);
|
|
248
|
+
box-shadow: var(--ax-shadow);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/* Step cards used by the setup wizard / onboarding-style flows. */
|
|
252
|
+
.ax-step {
|
|
253
|
+
background: var(--ax-surface); border: var(--ax-border-w) solid var(--ax-border);
|
|
254
|
+
border-radius: var(--ax-radius); padding: 20px 22px; margin: 14px 0;
|
|
255
|
+
}
|
|
256
|
+
.ax-step__head {
|
|
257
|
+
font-size: var(--ax-fs-xs); font-weight: 600; text-transform: uppercase;
|
|
258
|
+
letter-spacing: 0.08em; color: var(--ax-muted);
|
|
259
|
+
margin: 0 0 14px; display: flex; align-items: center; gap: 10px;
|
|
260
|
+
}
|
|
261
|
+
.ax-step__num {
|
|
262
|
+
width: 22px; height: 22px; border-radius: var(--ax-radius-sm);
|
|
263
|
+
background: color-mix(in oklch, var(--ax-accent) 15%, var(--ax-surface));
|
|
264
|
+
border: 1px solid color-mix(in oklch, var(--ax-accent) 45%, var(--ax-border-2));
|
|
265
|
+
color: var(--ax-accent);
|
|
266
|
+
display: inline-flex; align-items: center; justify-content: center;
|
|
267
|
+
font-family: var(--ax-mono); font-size: 11px; font-weight: 700;
|
|
268
|
+
letter-spacing: 0; text-transform: none;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/* --- Stat strip (the "COUNT / label" cards across the top of Live) --- */
|
|
272
|
+
.ax-statstrip {
|
|
273
|
+
display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
|
|
274
|
+
gap: var(--ax-gap); padding: var(--ax-pad) var(--ax-pad) 0;
|
|
275
|
+
}
|
|
276
|
+
.ax-stat {
|
|
277
|
+
background: var(--ax-surface); border: var(--ax-border-w) solid var(--ax-border);
|
|
278
|
+
border-radius: var(--ax-radius); padding: 14px 16px;
|
|
279
|
+
}
|
|
280
|
+
.ax-stat__label {
|
|
281
|
+
font-size: var(--ax-fs-xs); text-transform: uppercase; letter-spacing: 0.06em;
|
|
282
|
+
color: var(--ax-muted); display: flex; align-items: center; gap: 6px;
|
|
283
|
+
}
|
|
284
|
+
.ax-stat__value {
|
|
285
|
+
font-size: 24px; font-weight: 600; margin-top: 4px; letter-spacing: -0.02em;
|
|
286
|
+
font-family: var(--ax-mono); font-variant-numeric: tabular-nums;
|
|
287
|
+
}
|
|
288
|
+
.ax-stat__sub {
|
|
289
|
+
font-size: var(--ax-fs-xs); color: var(--ax-muted); margin-top: 2px;
|
|
290
|
+
overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
|
|
291
|
+
}
|
|
292
|
+
.ax-stat--live .ax-stat__value { color: var(--ax-accent); }
|
|
293
|
+
.ax-stat--warn .ax-stat__value { color: var(--ax-warn); }
|
|
294
|
+
.ax-stat--err .ax-stat__value { color: var(--ax-err); }
|
|
295
|
+
|
|
296
|
+
/* --- Forms --- */
|
|
297
|
+
.ax-field { margin: 10px 0 0; }
|
|
298
|
+
.ax-field:first-child { margin-top: 0; }
|
|
299
|
+
.ax-field label {
|
|
300
|
+
display: block; margin-bottom: 5px;
|
|
301
|
+
font-size: var(--ax-fs-xs); color: var(--ax-muted);
|
|
302
|
+
text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500;
|
|
303
|
+
}
|
|
304
|
+
.ax-field label .ax-hint {
|
|
305
|
+
text-transform: none; letter-spacing: 0; color: var(--ax-muted);
|
|
306
|
+
font-weight: 400; font-size: var(--ax-fs-xs); margin-left: 6px;
|
|
307
|
+
}
|
|
308
|
+
.ax-field input, .ax-field textarea, .ax-field select {
|
|
309
|
+
width: 100%;
|
|
310
|
+
background: var(--ax-bg); color: var(--ax-text);
|
|
311
|
+
border: var(--ax-border-w) solid var(--ax-border-2); border-radius: var(--ax-radius);
|
|
312
|
+
padding: 11px 14px; font: inherit; font-size: var(--ax-fs);
|
|
313
|
+
transition: border-color 0.1s ease;
|
|
314
|
+
}
|
|
315
|
+
.ax-field input:focus, .ax-field textarea:focus, .ax-field select:focus {
|
|
316
|
+
outline: none; border-color: var(--ax-accent);
|
|
317
|
+
box-shadow: 0 0 0 2px color-mix(in oklch, var(--ax-accent) 18%, transparent);
|
|
318
|
+
}
|
|
319
|
+
.ax-field textarea { resize: vertical; min-height: 72px; font-family: var(--ax-font); }
|
|
320
|
+
.ax-field input::placeholder, .ax-field textarea::placeholder {
|
|
321
|
+
color: var(--ax-muted); opacity: 0.7;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.ax-row { display: flex; gap: 12px; }
|
|
325
|
+
.ax-row > * { flex: 1; }
|
|
326
|
+
|
|
327
|
+
/* --- Section titles shared across pages --- */
|
|
328
|
+
.ax-section-title {
|
|
329
|
+
display: flex; justify-content: space-between; align-items: center;
|
|
330
|
+
margin-bottom: 12px;
|
|
331
|
+
}
|
|
332
|
+
.ax-section-title__label {
|
|
333
|
+
font-size: var(--ax-fs-xs); text-transform: uppercase;
|
|
334
|
+
letter-spacing: 0.08em; color: var(--ax-muted);
|
|
335
|
+
}
|
|
336
|
+
.ax-section-title__right {
|
|
337
|
+
display: flex; align-items: center; gap: 8px;
|
|
338
|
+
font-size: var(--ax-fs-xs); color: var(--ax-muted);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
/* ============================================================
|
|
342
|
+
* Settings-page design system (also reusable on other pages).
|
|
343
|
+
* Ported from the Stitch redesign mockup so the primitives can
|
|
344
|
+
* be consumed by any page \u2014 not just /admin. Sections:
|
|
345
|
+
* page-head \u2014 kicker + h1 + lead paragraph
|
|
346
|
+
* health-strip \u2014 4-up status cards with coloured dot
|
|
347
|
+
* wit \u2014 dismissable "what is this?" info banner
|
|
348
|
+
* section-head \u2014 icon chip + title + lead + right-aligned CTA
|
|
349
|
+
* row-card \u2014 list row with avatar + info + actions + expand
|
|
350
|
+
* avatar \u2014 coloured-initial square (teal/coral/amber/blue)
|
|
351
|
+
* pill \u2014 small status pill with coloured dot (chip-flavor)
|
|
352
|
+
* connectors \u2014 2-up grid of connector cards
|
|
353
|
+
* tab-count \u2014 mono count bubble on a tab
|
|
354
|
+
* toast \u2014 bottom-right ephemeral notification
|
|
355
|
+
* modal \u2014 simple centred dialog + backdrop
|
|
356
|
+
* sec-label \u2014 uppercase mini-heading with optional CTA
|
|
357
|
+
* ============================================================ */
|
|
358
|
+
|
|
359
|
+
/* --- Page head --- */
|
|
360
|
+
.ax-page-head {
|
|
361
|
+
max-width: 1040px; margin: 0 auto; padding: 28px 24px 12px;
|
|
362
|
+
}
|
|
363
|
+
.ax-page-head .ax-kicker {
|
|
364
|
+
display: inline-block; font-size: 10px; letter-spacing: 0.1em;
|
|
365
|
+
color: var(--ax-muted); text-transform: uppercase; margin-bottom: 6px;
|
|
366
|
+
font-family: var(--ax-mono);
|
|
367
|
+
}
|
|
368
|
+
.ax-page-head h1 {
|
|
369
|
+
font-size: 22px; font-weight: 600; letter-spacing: -0.015em;
|
|
370
|
+
margin: 0 0 4px; display: flex; align-items: center; gap: 10px;
|
|
371
|
+
}
|
|
372
|
+
.ax-page-head .ax-lead {
|
|
373
|
+
color: var(--ax-text-2); margin: 0; font-size: 13px;
|
|
374
|
+
max-width: 640px; line-height: 1.6;
|
|
375
|
+
}
|
|
376
|
+
.ax-page-head .ax-lead code {
|
|
377
|
+
font-family: var(--ax-mono); font-size: 11.5px;
|
|
378
|
+
background: var(--ax-surface-2); padding: 1px 6px; border-radius: var(--ax-radius-sm);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/* --- Health strip --- */
|
|
382
|
+
.ax-health-strip {
|
|
383
|
+
max-width: 1040px; margin: 18px auto 22px; padding: 0 24px;
|
|
384
|
+
display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
|
|
385
|
+
}
|
|
386
|
+
.ax-health-card {
|
|
387
|
+
background: var(--ax-surface); border: var(--ax-border-w) solid var(--ax-border);
|
|
388
|
+
border-radius: var(--ax-radius-sm); padding: 12px 14px;
|
|
389
|
+
display: flex; align-items: center; gap: 11px;
|
|
390
|
+
transition: border-color 120ms;
|
|
391
|
+
}
|
|
392
|
+
.ax-health-card:hover { border-color: var(--ax-border-2); }
|
|
393
|
+
.ax-health-card .ax-hc-dot {
|
|
394
|
+
width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
|
|
395
|
+
}
|
|
396
|
+
.ax-health-card .ax-hc-dot--ok {
|
|
397
|
+
background: var(--ax-accent);
|
|
398
|
+
box-shadow: 0 0 8px color-mix(in oklch, var(--ax-accent) 50%, transparent);
|
|
399
|
+
}
|
|
400
|
+
.ax-health-card .ax-hc-dot--warn { background: var(--ax-warn); }
|
|
401
|
+
.ax-health-card .ax-hc-dot--off { background: var(--ax-border-2); }
|
|
402
|
+
.ax-health-card .ax-hc-txt { flex: 1; min-width: 0; }
|
|
403
|
+
.ax-health-card .ax-hc-num {
|
|
404
|
+
font-size: 17px; font-weight: 600; letter-spacing: -0.015em;
|
|
405
|
+
}
|
|
406
|
+
.ax-health-card .ax-hc-lbl {
|
|
407
|
+
font-size: 11px; color: var(--ax-muted); margin-top: 1px;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
/* --- "What is this?" info banner (dismissable) --- */
|
|
411
|
+
.ax-wit {
|
|
412
|
+
background: color-mix(in oklch, var(--ax-info) 6%, var(--ax-bg-elev));
|
|
413
|
+
border: 1px solid color-mix(in oklch, var(--ax-info) 22%, var(--ax-border));
|
|
414
|
+
border-radius: var(--ax-radius-sm); padding: 12px 14px; margin-bottom: 18px;
|
|
415
|
+
font-size: 12.5px; color: var(--ax-text-2); line-height: 1.6;
|
|
416
|
+
display: flex; gap: 10px; align-items: flex-start;
|
|
417
|
+
}
|
|
418
|
+
.ax-wit__icon {
|
|
419
|
+
width: 18px; height: 18px; border-radius: 50%;
|
|
420
|
+
background: color-mix(in oklch, var(--ax-info) 18%, transparent);
|
|
421
|
+
color: var(--ax-info);
|
|
422
|
+
display: grid; place-items: center;
|
|
423
|
+
font-size: 11px; font-weight: 600; flex-shrink: 0; margin-top: 1px;
|
|
424
|
+
}
|
|
425
|
+
.ax-wit b { color: var(--ax-text); font-weight: 600; }
|
|
426
|
+
.ax-wit code {
|
|
427
|
+
font-family: var(--ax-mono); font-size: 11.5px;
|
|
428
|
+
background: var(--ax-bg); padding: 1px 5px; border-radius: var(--ax-radius-sm);
|
|
429
|
+
border: var(--ax-border-w) solid var(--ax-border);
|
|
430
|
+
}
|
|
431
|
+
.ax-wit .ax-wit__dismiss {
|
|
432
|
+
background: transparent; border: 0; color: var(--ax-muted);
|
|
433
|
+
font-size: 16px; cursor: pointer; margin-left: auto;
|
|
434
|
+
padding: 0 4px; line-height: 1;
|
|
435
|
+
}
|
|
436
|
+
.ax-wit .ax-wit__dismiss:hover { color: var(--ax-text); }
|
|
437
|
+
|
|
438
|
+
/* --- Section head (icon + title + lead + right CTA) --- */
|
|
439
|
+
.ax-section-head {
|
|
440
|
+
display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px;
|
|
441
|
+
}
|
|
442
|
+
.ax-section-head__icon {
|
|
443
|
+
width: 44px; height: 44px; border-radius: var(--ax-radius);
|
|
444
|
+
background: color-mix(in oklch, var(--ax-accent) 10%, var(--ax-surface));
|
|
445
|
+
border: 1px solid color-mix(in oklch, var(--ax-accent) 25%, var(--ax-border));
|
|
446
|
+
display: grid; place-items: center; flex-shrink: 0;
|
|
447
|
+
color: var(--ax-accent);
|
|
448
|
+
}
|
|
449
|
+
.ax-section-head__icon svg { width: 22px; height: 22px; }
|
|
450
|
+
.ax-section-head__text { flex: 1; }
|
|
451
|
+
.ax-section-head h2 {
|
|
452
|
+
font-size: 18px; margin: 0 0 3px;
|
|
453
|
+
font-weight: 600; letter-spacing: -0.01em;
|
|
454
|
+
}
|
|
455
|
+
.ax-section-head .ax-lead {
|
|
456
|
+
color: var(--ax-text-2); margin: 0; font-size: 13px; line-height: 1.55;
|
|
457
|
+
max-width: 640px;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
/* --- Row cards (collapsible list items) --- */
|
|
461
|
+
.ax-stack { display: flex; flex-direction: column; gap: 10px; }
|
|
462
|
+
.ax-row-card {
|
|
463
|
+
background: var(--ax-surface); border: var(--ax-border-w) solid var(--ax-border);
|
|
464
|
+
border-radius: var(--ax-radius-lg); padding: 14px 16px;
|
|
465
|
+
transition: border-color 160ms, transform 160ms;
|
|
466
|
+
}
|
|
467
|
+
.ax-row-card:hover { border-color: var(--ax-border-2); }
|
|
468
|
+
.ax-row-card__top { display: flex; align-items: center; gap: 12px; }
|
|
469
|
+
.ax-row-card__info { flex: 1; min-width: 0; }
|
|
470
|
+
.ax-row-card__info .ax-name {
|
|
471
|
+
font-size: 14px; font-weight: 600; letter-spacing: -0.005em;
|
|
472
|
+
display: flex; align-items: center; gap: 8px;
|
|
473
|
+
}
|
|
474
|
+
.ax-row-card__info .ax-slug {
|
|
475
|
+
font-family: var(--ax-mono); font-size: 11px;
|
|
476
|
+
color: var(--ax-muted); margin-left: 4px;
|
|
477
|
+
}
|
|
478
|
+
.ax-row-card__info .ax-sub {
|
|
479
|
+
font-size: 12px; color: var(--ax-text-2); margin-top: 3px;
|
|
480
|
+
line-height: 1.5; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
|
|
481
|
+
}
|
|
482
|
+
.ax-row-card__actions { display: flex; gap: 6px; align-items: center; }
|
|
483
|
+
.ax-row-card__details {
|
|
484
|
+
display: none; margin-top: 14px; padding-top: 14px;
|
|
485
|
+
border-top: 1px dashed var(--ax-border);
|
|
486
|
+
font-size: 12.5px; color: var(--ax-text-2); line-height: 1.6;
|
|
487
|
+
}
|
|
488
|
+
.ax-row-card.is-open .ax-row-card__details { display: block; }
|
|
489
|
+
.ax-row-card.is-open .ax-chev { transform: rotate(180deg); }
|
|
490
|
+
.ax-chev { transition: transform 160ms; }
|
|
491
|
+
|
|
492
|
+
.ax-detail-grid {
|
|
493
|
+
display: grid; grid-template-columns: repeat(2, 1fr);
|
|
494
|
+
gap: 12px 20px; margin-bottom: 12px;
|
|
495
|
+
}
|
|
496
|
+
.ax-detail-grid dt {
|
|
497
|
+
font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
|
|
498
|
+
color: var(--ax-muted); margin-bottom: 3px; font-family: var(--ax-mono);
|
|
499
|
+
}
|
|
500
|
+
.ax-detail-grid dd {
|
|
501
|
+
margin: 0; font-size: 12.5px; color: var(--ax-text);
|
|
502
|
+
}
|
|
503
|
+
.ax-triggers { display: flex; gap: 4px; flex-wrap: wrap; }
|
|
504
|
+
.ax-trigger-pill {
|
|
505
|
+
font-family: var(--ax-mono); font-size: 11px;
|
|
506
|
+
padding: 2px 8px; background: var(--ax-bg);
|
|
507
|
+
border: var(--ax-border-w) solid var(--ax-border); border-radius: var(--ax-radius-sm);
|
|
508
|
+
color: var(--ax-text);
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
/* --- Avatars (coloured initial square) --- */
|
|
512
|
+
.ax-avatar {
|
|
513
|
+
width: 36px; height: 36px; border-radius: var(--ax-radius); flex-shrink: 0;
|
|
514
|
+
background: var(--ax-surface-2); border: var(--ax-border-w) solid var(--ax-border-2);
|
|
515
|
+
display: grid; place-items: center;
|
|
516
|
+
font-weight: 600; font-size: 14px; letter-spacing: -0.01em;
|
|
517
|
+
color: var(--ax-text);
|
|
518
|
+
}
|
|
519
|
+
.ax-avatar--teal {
|
|
520
|
+
background: color-mix(in oklch, var(--ax-accent) 18%, var(--ax-surface));
|
|
521
|
+
border-color: color-mix(in oklch, var(--ax-accent) 35%, var(--ax-border));
|
|
522
|
+
color: var(--ax-accent);
|
|
523
|
+
}
|
|
524
|
+
.ax-avatar--coral {
|
|
525
|
+
background: color-mix(in oklch, var(--ax-err) 14%, var(--ax-surface));
|
|
526
|
+
border-color: color-mix(in oklch, var(--ax-err) 30%, var(--ax-border));
|
|
527
|
+
color: var(--ax-err);
|
|
528
|
+
}
|
|
529
|
+
.ax-avatar--amber {
|
|
530
|
+
background: color-mix(in oklch, var(--ax-warn) 14%, var(--ax-surface));
|
|
531
|
+
border-color: color-mix(in oklch, var(--ax-warn) 30%, var(--ax-border));
|
|
532
|
+
color: var(--ax-warn);
|
|
533
|
+
}
|
|
534
|
+
.ax-avatar--pic { padding: 0; overflow: hidden; background: var(--ax-surface-2); }
|
|
535
|
+
.ax-avatar--pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
|
|
536
|
+
.ax-avatar--blue {
|
|
537
|
+
background: color-mix(in oklch, var(--ax-info) 14%, var(--ax-surface));
|
|
538
|
+
border-color: color-mix(in oklch, var(--ax-info) 30%, var(--ax-border));
|
|
539
|
+
color: var(--ax-info);
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
/* --- Pills (status indicator with coloured dot) ---
|
|
543
|
+
*
|
|
544
|
+
* Different from .ax-badge: pills have a rounded (10px) shape, a small
|
|
545
|
+
* leading coloured dot, and stronger semantics (ok/warn/off/info). Use
|
|
546
|
+
* for "live", "idle", "receiving", "stale" states next to a name.
|
|
547
|
+
*/
|
|
548
|
+
.ax-pill {
|
|
549
|
+
display: inline-flex; align-items: center; gap: 5px;
|
|
550
|
+
font-size: 11px; padding: 2px 8px; line-height: 16px;
|
|
551
|
+
border-radius: var(--ax-radius); background: var(--ax-surface-2);
|
|
552
|
+
color: var(--ax-text-2); border: var(--ax-border-w) solid var(--ax-border);
|
|
553
|
+
white-space: nowrap;
|
|
554
|
+
}
|
|
555
|
+
.ax-pill .ax-pill__dot {
|
|
556
|
+
width: 6px; height: 6px; border-radius: 50%; background: currentColor;
|
|
557
|
+
}
|
|
558
|
+
.ax-pill--ok {
|
|
559
|
+
background: color-mix(in oklch, var(--ax-accent) 14%, transparent);
|
|
560
|
+
color: var(--ax-accent);
|
|
561
|
+
border-color: color-mix(in oklch, var(--ax-accent) 30%, transparent);
|
|
562
|
+
}
|
|
563
|
+
.ax-pill--warn {
|
|
564
|
+
background: color-mix(in oklch, var(--ax-warn) 14%, transparent);
|
|
565
|
+
color: var(--ax-warn);
|
|
566
|
+
border-color: color-mix(in oklch, var(--ax-warn) 30%, transparent);
|
|
567
|
+
}
|
|
568
|
+
.ax-pill--off { color: var(--ax-muted); }
|
|
569
|
+
.ax-pill--info {
|
|
570
|
+
background: color-mix(in oklch, var(--ax-info) 14%, transparent);
|
|
571
|
+
color: var(--ax-info);
|
|
572
|
+
border-color: color-mix(in oklch, var(--ax-info) 30%, transparent);
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
/* --- Connectors grid (Channels tab) --- */
|
|
576
|
+
.ax-connectors {
|
|
577
|
+
display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
|
|
578
|
+
}
|
|
579
|
+
.ax-connector {
|
|
580
|
+
background: var(--ax-surface); border: var(--ax-border-w) solid var(--ax-border);
|
|
581
|
+
border-radius: var(--ax-radius-lg); padding: 18px 18px 16px;
|
|
582
|
+
cursor: pointer; position: relative;
|
|
583
|
+
transition: border-color 160ms, transform 160ms, background 160ms;
|
|
584
|
+
}
|
|
585
|
+
.ax-connector:hover { border-color: var(--ax-border-2); background: var(--ax-surface-2); }
|
|
586
|
+
.ax-connector.is-on {
|
|
587
|
+
border-color: color-mix(in oklch, var(--ax-accent) 40%, var(--ax-border));
|
|
588
|
+
}
|
|
589
|
+
.ax-connector.is-active {
|
|
590
|
+
border-color: var(--ax-accent);
|
|
591
|
+
background: color-mix(in oklch, var(--ax-accent) 8%, var(--ax-surface));
|
|
592
|
+
}
|
|
593
|
+
.ax-connector__top {
|
|
594
|
+
display: flex; align-items: center; gap: 12px; margin-bottom: 10px;
|
|
595
|
+
}
|
|
596
|
+
.ax-connector__logo {
|
|
597
|
+
width: 40px; height: 40px; border-radius: var(--ax-radius);
|
|
598
|
+
display: grid; place-items: center;
|
|
599
|
+
font-weight: 700; font-size: 15px; letter-spacing: -0.02em; flex-shrink: 0;
|
|
600
|
+
background: var(--ax-surface-2); border: var(--ax-border-w) solid var(--ax-border-2);
|
|
601
|
+
color: var(--ax-text); font-family: var(--ax-mono);
|
|
602
|
+
}
|
|
603
|
+
.ax-connector__meta { flex: 1; }
|
|
604
|
+
.ax-connector__name {
|
|
605
|
+
font-weight: 600; font-size: 14px; letter-spacing: -0.005em;
|
|
606
|
+
}
|
|
607
|
+
.ax-connector__sub {
|
|
608
|
+
font-size: 11.5px; color: var(--ax-muted); margin-top: 2px;
|
|
609
|
+
}
|
|
610
|
+
.ax-connector__status { margin-left: auto; }
|
|
611
|
+
.ax-connector__desc {
|
|
612
|
+
font-size: 12.5px; color: var(--ax-text-2); line-height: 1.5; min-height: 36px;
|
|
613
|
+
}
|
|
614
|
+
.ax-connector__foot {
|
|
615
|
+
margin-top: 12px; display: flex; align-items: center; justify-content: space-between;
|
|
616
|
+
font-size: 11.5px; color: var(--ax-muted);
|
|
617
|
+
}
|
|
618
|
+
.ax-connector__cta {
|
|
619
|
+
color: var(--ax-accent); font-weight: 500;
|
|
620
|
+
display: inline-flex; align-items: center; gap: 4px;
|
|
621
|
+
}
|
|
622
|
+
.ax-connector__cta svg { width: 12px; height: 12px; }
|
|
623
|
+
|
|
624
|
+
/* --- Tab counts + warn indicator --- */
|
|
625
|
+
.ax-tab-count {
|
|
626
|
+
font-family: var(--ax-mono); font-size: 10px;
|
|
627
|
+
padding: 1px 6px; background: var(--ax-surface-2);
|
|
628
|
+
color: var(--ax-muted); border-radius: var(--ax-radius); line-height: 14px;
|
|
629
|
+
margin-left: 6px;
|
|
630
|
+
}
|
|
631
|
+
.is-active .ax-tab-count {
|
|
632
|
+
background: color-mix(in oklch, var(--ax-accent) 18%, transparent);
|
|
633
|
+
color: var(--ax-accent);
|
|
634
|
+
}
|
|
635
|
+
.ax-tab-warn {
|
|
636
|
+
width: 6px; height: 6px; border-radius: 50%; background: var(--ax-warn);
|
|
637
|
+
display: inline-block; margin-left: 6px;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
/* --- Section mini-labels --- */
|
|
641
|
+
.ax-sec-label {
|
|
642
|
+
display: flex; align-items: center; justify-content: space-between;
|
|
643
|
+
margin: 22px 0 10px;
|
|
644
|
+
}
|
|
645
|
+
.ax-sec-label h3 {
|
|
646
|
+
font-size: 12px; font-weight: 600; letter-spacing: 0.06em;
|
|
647
|
+
text-transform: uppercase; color: var(--ax-muted);
|
|
648
|
+
margin: 0; font-family: var(--ax-mono);
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
/* --- Toast --- */
|
|
652
|
+
.ax-toast {
|
|
653
|
+
position: fixed; bottom: 24px; right: 24px;
|
|
654
|
+
background: var(--ax-surface-2);
|
|
655
|
+
border: var(--ax-border-w) solid var(--ax-accent); color: var(--ax-text);
|
|
656
|
+
padding: 10px 16px; border-radius: var(--ax-radius); font-size: 12.5px;
|
|
657
|
+
display: flex; align-items: center; gap: 10px;
|
|
658
|
+
box-shadow: 0 10px 30px rgba(0,0,0,0.3);
|
|
659
|
+
opacity: 0; transform: translateY(10px); pointer-events: none;
|
|
660
|
+
transition: opacity 200ms, transform 200ms; z-index: 100;
|
|
661
|
+
}
|
|
662
|
+
.ax-toast.is-show { opacity: 1; transform: none; }
|
|
663
|
+
.ax-toast__icon { color: var(--ax-accent); }
|
|
664
|
+
|
|
665
|
+
/* --- Modal (centred dialog + backdrop) --- */
|
|
666
|
+
.ax-modal-bd {
|
|
667
|
+
position: fixed; inset: 0;
|
|
668
|
+
background: color-mix(in oklch, var(--ax-bg) 60%, black);
|
|
669
|
+
display: none; align-items: center; justify-content: center;
|
|
670
|
+
z-index: 200; padding: 24px;
|
|
671
|
+
}
|
|
672
|
+
.ax-modal-bd.is-show { display: flex; }
|
|
673
|
+
.ax-modal {
|
|
674
|
+
width: min(560px, 94vw); max-height: 86vh; overflow: auto;
|
|
675
|
+
background: var(--ax-surface); border: var(--ax-border-w) solid var(--ax-border-2);
|
|
676
|
+
border-radius: var(--ax-radius-lg); padding: 0;
|
|
677
|
+
box-shadow: 0 20px 60px rgba(0,0,0,0.5);
|
|
678
|
+
}
|
|
679
|
+
.ax-modal > header {
|
|
680
|
+
padding: 18px 22px 10px; border-bottom: var(--ax-border-w) solid var(--ax-border);
|
|
681
|
+
display: flex; align-items: center; gap: 10px;
|
|
682
|
+
}
|
|
683
|
+
.ax-modal > header h3 {
|
|
684
|
+
margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; flex: 1;
|
|
685
|
+
}
|
|
686
|
+
.ax-modal > header .ax-modal__close {
|
|
687
|
+
background: transparent; border: 0; color: var(--ax-muted);
|
|
688
|
+
font-size: 22px; cursor: pointer; line-height: 1; padding: 0 6px;
|
|
689
|
+
}
|
|
690
|
+
.ax-modal__body { padding: 18px 22px; }
|
|
691
|
+
.ax-modal__foot {
|
|
692
|
+
padding: 12px 22px 18px;
|
|
693
|
+
display: flex; justify-content: flex-end; gap: 8px;
|
|
694
|
+
border-top: var(--ax-border-w) solid var(--ax-border);
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
/* --- Mesh hero (enable toggle + SVG network viz) --- */
|
|
698
|
+
.ax-mesh-hero {
|
|
699
|
+
background: var(--ax-surface); border: var(--ax-border-w) solid var(--ax-border);
|
|
700
|
+
border-radius: var(--ax-radius-lg); padding: 20px;
|
|
701
|
+
display: grid; grid-template-columns: 1fr 240px; gap: 24px;
|
|
702
|
+
align-items: center; margin-bottom: 18px;
|
|
703
|
+
}
|
|
704
|
+
.ax-mesh-hero h3 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
|
|
705
|
+
.ax-mesh-hero p { margin: 0 0 12px; font-size: 12.5px; color: var(--ax-text-2); line-height: 1.5; }
|
|
706
|
+
.ax-mesh-viz { position: relative; width: 240px; height: 140px; }
|
|
707
|
+
.ax-mesh-dot {
|
|
708
|
+
position: absolute; width: 44px; height: 44px; border-radius: 50%;
|
|
709
|
+
background: var(--ax-surface-2); border: 2px solid var(--ax-border-2);
|
|
710
|
+
display: grid; place-items: center;
|
|
711
|
+
font-family: var(--ax-mono); font-size: 10px; font-weight: 600;
|
|
712
|
+
color: var(--ax-text-2);
|
|
713
|
+
}
|
|
714
|
+
.ax-mesh-dot.self {
|
|
715
|
+
background: color-mix(in oklch, var(--ax-accent) 18%, var(--ax-surface));
|
|
716
|
+
border-color: var(--ax-accent); color: var(--ax-accent);
|
|
717
|
+
}
|
|
718
|
+
.ax-mesh-dot.empty {
|
|
719
|
+
border-style: dashed; color: var(--ax-muted); font-size: 14px;
|
|
720
|
+
}
|
|
721
|
+
.ax-mesh-wires { position: absolute; inset: 0; }
|
|
722
|
+
.ax-mesh-wires line { stroke: var(--ax-border-2); stroke-width: 1.5; stroke-dasharray: 3 3; }
|
|
723
|
+
.ax-mesh-wires line.live { stroke: var(--ax-accent); stroke-dasharray: 0; opacity: 0.6; }
|
|
724
|
+
|
|
725
|
+
/* Pill-shaped toggle (used for the mesh enable switch + similar binary actions). */
|
|
726
|
+
.ax-mesh-toggle {
|
|
727
|
+
display: inline-flex; align-items: center; gap: 10px;
|
|
728
|
+
background: var(--ax-bg-elev); border: var(--ax-border-w) solid var(--ax-border);
|
|
729
|
+
border-radius: 20px; padding: 4px 14px 4px 5px;
|
|
730
|
+
cursor: pointer; user-select: none; font-size: 12px;
|
|
731
|
+
}
|
|
732
|
+
.ax-mesh-switch {
|
|
733
|
+
width: 32px; height: 18px; background: var(--ax-surface-3);
|
|
734
|
+
border-radius: var(--ax-radius); position: relative; transition: background 160ms;
|
|
735
|
+
}
|
|
736
|
+
.ax-mesh-switch::after {
|
|
737
|
+
content: ""; position: absolute; top: 2px; left: 2px;
|
|
738
|
+
width: 14px; height: 14px; border-radius: 50%;
|
|
739
|
+
background: var(--ax-text-2); transition: all 160ms;
|
|
740
|
+
}
|
|
741
|
+
.ax-mesh-toggle.is-on .ax-mesh-switch {
|
|
742
|
+
background: color-mix(in oklch, var(--ax-accent) 80%, transparent);
|
|
743
|
+
}
|
|
744
|
+
.ax-mesh-toggle.is-on .ax-mesh-switch::after {
|
|
745
|
+
left: 16px; background: var(--ax-bg);
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
/* --- Schedule builder: sentence-builder + pill picks + day picker --- */
|
|
749
|
+
.ax-builder {
|
|
750
|
+
background: var(--ax-surface); border: var(--ax-border-w) solid var(--ax-border);
|
|
751
|
+
border-radius: var(--ax-radius-lg); padding: 20px;
|
|
752
|
+
}
|
|
753
|
+
.ax-builder h3 {
|
|
754
|
+
margin: 0 0 4px; font-size: 15px; font-weight: 600; letter-spacing: -0.005em;
|
|
755
|
+
}
|
|
756
|
+
.ax-builder__hint { margin: 0 0 16px; font-size: 12.5px; color: var(--ax-muted); }
|
|
757
|
+
.ax-builder__lbl {
|
|
758
|
+
display: block; font-size: 11px; color: var(--ax-muted);
|
|
759
|
+
letter-spacing: 0.03em; text-transform: uppercase; margin: 12px 0 5px;
|
|
760
|
+
font-weight: 500;
|
|
761
|
+
}
|
|
762
|
+
.ax-builder__lbl .opt {
|
|
763
|
+
text-transform: none; letter-spacing: 0; font-weight: 400;
|
|
764
|
+
opacity: 0.75; margin-left: 6px;
|
|
765
|
+
}
|
|
766
|
+
.ax-builder__inp {
|
|
767
|
+
width: 100%; background: var(--ax-bg); color: var(--ax-text);
|
|
768
|
+
border: var(--ax-border-w) solid var(--ax-border); border-radius: var(--ax-radius-sm);
|
|
769
|
+
padding: 8px 11px; font: inherit; font-size: 13px;
|
|
770
|
+
transition: border-color 120ms, box-shadow 120ms;
|
|
771
|
+
}
|
|
772
|
+
.ax-builder__inp:focus {
|
|
773
|
+
outline: none; border-color: var(--ax-accent);
|
|
774
|
+
box-shadow: 0 0 0 3px color-mix(in oklch, var(--ax-accent) 18%, transparent);
|
|
775
|
+
}
|
|
776
|
+
textarea.ax-builder__inp { min-height: 80px; line-height: 1.5; resize: vertical; }
|
|
777
|
+
|
|
778
|
+
.ax-mode-switch {
|
|
779
|
+
display: inline-flex; background: var(--ax-surface-2);
|
|
780
|
+
border: var(--ax-border-w) solid var(--ax-border); border-radius: var(--ax-radius); padding: 3px;
|
|
781
|
+
margin-bottom: 14px;
|
|
782
|
+
}
|
|
783
|
+
.ax-mode-switch button {
|
|
784
|
+
background: transparent; border: 0; color: var(--ax-muted);
|
|
785
|
+
padding: 6px 14px; font: inherit; font-size: 12px; cursor: pointer;
|
|
786
|
+
border-radius: var(--ax-radius-sm); font-weight: 500;
|
|
787
|
+
}
|
|
788
|
+
.ax-mode-switch button.is-active {
|
|
789
|
+
background: var(--ax-surface); color: var(--ax-text);
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
.ax-sentence {
|
|
793
|
+
display: flex; align-items: center; gap: 8px;
|
|
794
|
+
font-size: 16px; line-height: 1.9; flex-wrap: wrap;
|
|
795
|
+
margin-bottom: 14px; padding: 14px 16px;
|
|
796
|
+
background: var(--ax-bg-elev); border: var(--ax-border-w) solid var(--ax-border);
|
|
797
|
+
border-radius: var(--ax-radius-sm);
|
|
798
|
+
}
|
|
799
|
+
.ax-sentence > span { color: var(--ax-text-2); }
|
|
800
|
+
.ax-pill-pick {
|
|
801
|
+
background: var(--ax-surface); border: var(--ax-border-w) solid var(--ax-border-2);
|
|
802
|
+
color: var(--ax-accent); padding: 3px 10px; border-radius: var(--ax-radius);
|
|
803
|
+
font-size: 14px; font-family: inherit; cursor: pointer; font-weight: 500;
|
|
804
|
+
}
|
|
805
|
+
.ax-pill-pick:hover { background: var(--ax-surface-2); border-color: var(--ax-accent); }
|
|
806
|
+
.ax-pill-pick--sm { font-size: 13px; padding: 3px 8px; }
|
|
807
|
+
|
|
808
|
+
.ax-day-picker { display: flex; gap: 4px; }
|
|
809
|
+
.ax-day-picker button {
|
|
810
|
+
width: 30px; height: 30px; border-radius: var(--ax-radius);
|
|
811
|
+
background: var(--ax-surface); border: var(--ax-border-w) solid var(--ax-border);
|
|
812
|
+
color: var(--ax-muted); font: inherit; font-size: 11px; font-weight: 500;
|
|
813
|
+
cursor: pointer;
|
|
814
|
+
}
|
|
815
|
+
.ax-day-picker button:hover { border-color: var(--ax-border-2); color: var(--ax-text); }
|
|
816
|
+
.ax-day-picker button.is-active {
|
|
817
|
+
background: color-mix(in oklch, var(--ax-accent) 20%, var(--ax-surface));
|
|
818
|
+
border-color: var(--ax-accent); color: var(--ax-accent);
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
.ax-preview-box {
|
|
822
|
+
background: color-mix(in oklch, var(--ax-accent) 5%, var(--ax-bg-elev));
|
|
823
|
+
border: 1px solid color-mix(in oklch, var(--ax-accent) 20%, var(--ax-border));
|
|
824
|
+
border-radius: var(--ax-radius-sm); padding: 12px 14px; margin-top: 12px;
|
|
825
|
+
font-size: 12.5px; color: var(--ax-text-2);
|
|
826
|
+
display: flex; align-items: center; gap: 10px;
|
|
827
|
+
}
|
|
828
|
+
.ax-preview-box svg { width: 15px; height: 15px; color: var(--ax-accent); flex-shrink: 0; }
|
|
829
|
+
.ax-preview-box b { color: var(--ax-text); font-weight: 600; }
|
|
830
|
+
|
|
831
|
+
.ax-cron-hints {
|
|
832
|
+
display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 18px;
|
|
833
|
+
margin-top: 10px; font-size: 11.5px; color: var(--ax-muted);
|
|
834
|
+
}
|
|
835
|
+
.ax-cron-hints code {
|
|
836
|
+
font-family: var(--ax-mono); color: var(--ax-text);
|
|
837
|
+
background: var(--ax-bg); border: var(--ax-border-w) solid var(--ax-border);
|
|
838
|
+
padding: 1px 6px; border-radius: var(--ax-radius-sm); margin-right: 6px;
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
/* --- JSON tree viewer (Advanced tab) --- */
|
|
842
|
+
.ax-jv-toolbar {
|
|
843
|
+
display: flex; align-items: center; gap: 8px;
|
|
844
|
+
padding: 8px 12px; background: var(--ax-bg-elev);
|
|
845
|
+
border: var(--ax-border-w) solid var(--ax-border); border-bottom: 0;
|
|
846
|
+
border-radius: var(--ax-radius) var(--ax-radius) 0 0;
|
|
847
|
+
}
|
|
848
|
+
.ax-jv-toolbar .ax-jv-spacer { flex: 1; }
|
|
849
|
+
.ax-jv-toolbar .ax-jv-seg {
|
|
850
|
+
display: inline-flex; background: var(--ax-surface);
|
|
851
|
+
border: var(--ax-border-w) solid var(--ax-border); border-radius: var(--ax-radius-sm); padding: 2px;
|
|
852
|
+
}
|
|
853
|
+
.ax-jv-toolbar .ax-jv-seg button {
|
|
854
|
+
background: transparent; border: 0; color: var(--ax-muted);
|
|
855
|
+
padding: 4px 10px; font: inherit; font-size: 11px;
|
|
856
|
+
cursor: pointer; border-radius: var(--ax-radius-sm);
|
|
857
|
+
}
|
|
858
|
+
.ax-jv-toolbar .ax-jv-seg button.is-active { background: var(--ax-surface-2); color: var(--ax-text); }
|
|
859
|
+
.ax-jv-search {
|
|
860
|
+
background: var(--ax-surface); border: var(--ax-border-w) solid var(--ax-border);
|
|
861
|
+
border-radius: var(--ax-radius-sm); padding: 4px 9px; font: inherit; font-size: 12px;
|
|
862
|
+
color: var(--ax-text); width: 180px;
|
|
863
|
+
}
|
|
864
|
+
.ax-jv-search:focus { outline: none; border-color: var(--ax-accent); }
|
|
865
|
+
|
|
866
|
+
.ax-jv-viewer {
|
|
867
|
+
background: var(--ax-bg-elev); border: var(--ax-border-w) solid var(--ax-border);
|
|
868
|
+
border-top: 0; border-radius: 0 0 var(--ax-radius) var(--ax-radius);
|
|
869
|
+
font-family: var(--ax-mono); font-size: 12.5px; line-height: 1.75;
|
|
870
|
+
padding: 14px 18px; max-height: 620px; overflow: auto;
|
|
871
|
+
}
|
|
872
|
+
.ax-jv-line {
|
|
873
|
+
display: flex; align-items: flex-start; padding: 1px 0; gap: 0;
|
|
874
|
+
position: relative; border-radius: var(--ax-radius-sm); white-space: nowrap;
|
|
875
|
+
}
|
|
876
|
+
.ax-jv-line:hover { background: color-mix(in oklch, var(--ax-accent) 5%, transparent); }
|
|
877
|
+
.ax-jv-line.is-match { background: color-mix(in oklch, var(--ax-warn) 16%, transparent); }
|
|
878
|
+
.ax-jv-toggle {
|
|
879
|
+
width: 12px; display: inline-block; color: var(--ax-muted);
|
|
880
|
+
cursor: pointer; user-select: none; text-align: center;
|
|
881
|
+
font-size: 9px; line-height: 1.75;
|
|
882
|
+
}
|
|
883
|
+
/* Settings also styles a bare .empty as an empty-state box; a leaf's
|
|
884
|
+
* toggle must stay a plain 12px spacer. */
|
|
885
|
+
.ax-jv-toggle.empty {
|
|
886
|
+
cursor: default; padding: 0; border: 0; border-radius: 0;
|
|
887
|
+
font-size: 9px; font-style: normal; text-align: center;
|
|
888
|
+
}
|
|
889
|
+
.ax-jv-key { color: var(--ax-info); margin-right: 0; }
|
|
890
|
+
.ax-jv-punc { color: var(--ax-muted); }
|
|
891
|
+
.ax-jv-string { color: var(--ax-accent); }
|
|
892
|
+
.ax-jv-number { color: var(--ax-warn); }
|
|
893
|
+
.ax-jv-bool { color: var(--ax-info); font-weight: 500; }
|
|
894
|
+
.ax-jv-null { color: var(--ax-muted); font-style: italic; }
|
|
895
|
+
.ax-jv-comment {
|
|
896
|
+
color: var(--ax-muted); font-family: var(--ax-font);
|
|
897
|
+
font-style: italic; font-size: 11.5px; margin-left: 8px; opacity: 0.8;
|
|
898
|
+
}
|
|
899
|
+
.ax-jv-children {
|
|
900
|
+
padding-left: 18px;
|
|
901
|
+
border-left: 1px dashed color-mix(in oklch, var(--ax-border) 80%, transparent);
|
|
902
|
+
margin-left: 4px;
|
|
903
|
+
}
|
|
904
|
+
.ax-jv-children.is-collapsed { display: none; }
|
|
905
|
+
.ax-jv-collapsed-note {
|
|
906
|
+
color: var(--ax-muted); font-size: 11px; font-style: italic; margin-left: 4px;
|
|
907
|
+
}
|
|
908
|
+
.ax-jv-empty-brace { color: var(--ax-muted); }
|
|
909
|
+
|
|
910
|
+
/* ============================================================
|
|
911
|
+
* Detail-page primitives (Agent manage, and any future
|
|
912
|
+
* detail-view). Built around a 3-col layout:
|
|
913
|
+
*
|
|
914
|
+
* [rail 200px] [main] [test-drive 360px]
|
|
915
|
+
*
|
|
916
|
+
* Scales down: test-drive hides at 1180px, rail hides at 780px.
|
|
917
|
+
* ============================================================ */
|
|
918
|
+
|
|
919
|
+
/* Crumb */
|
|
920
|
+
.ax-crumb {
|
|
921
|
+
max-width: 1400px; margin: 0 auto; padding: 16px 24px 0;
|
|
922
|
+
font-size: 12px; color: var(--ax-muted);
|
|
923
|
+
display: flex; align-items: center; gap: 6px;
|
|
924
|
+
}
|
|
925
|
+
.ax-crumb a { color: var(--ax-muted); }
|
|
926
|
+
.ax-crumb a:hover { color: var(--ax-accent); text-decoration: none; }
|
|
927
|
+
.ax-crumb .ax-crumb__sep { color: var(--ax-border-2); }
|
|
928
|
+
.ax-crumb .ax-crumb__cur { color: var(--ax-text); }
|
|
929
|
+
|
|
930
|
+
/* Hero \u2014 large avatar + editable name + chip row + actions */
|
|
931
|
+
.ax-hero {
|
|
932
|
+
max-width: 1400px; margin: 0 auto; padding: 14px 24px 18px;
|
|
933
|
+
display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
|
|
934
|
+
}
|
|
935
|
+
.ax-hero__ava {
|
|
936
|
+
width: 64px; height: 64px; border-radius: 14px;
|
|
937
|
+
background: color-mix(in oklch, var(--ax-accent) 20%, var(--ax-surface));
|
|
938
|
+
border: 1px solid color-mix(in oklch, var(--ax-accent) 40%, var(--ax-border));
|
|
939
|
+
display: grid; place-items: center;
|
|
940
|
+
font-weight: 700; font-size: 22px; letter-spacing: -0.02em;
|
|
941
|
+
color: var(--ax-accent); flex-shrink: 0; position: relative;
|
|
942
|
+
}
|
|
943
|
+
.ax-hero__on {
|
|
944
|
+
position: absolute; bottom: -2px; right: -2px;
|
|
945
|
+
width: 16px; height: 16px; border-radius: 50%;
|
|
946
|
+
background: var(--ax-accent); border: 3px solid var(--ax-bg);
|
|
947
|
+
}
|
|
948
|
+
.ax-hero__title { flex: 1; min-width: 260px; }
|
|
949
|
+
.ax-hero h1 {
|
|
950
|
+
margin: 0 0 3px; font-size: 22px; font-weight: 600;
|
|
951
|
+
letter-spacing: -0.02em; display: flex; align-items: center; gap: 10px;
|
|
952
|
+
}
|
|
953
|
+
.ax-hero h1 input {
|
|
954
|
+
background: transparent; border: 0; color: var(--ax-text);
|
|
955
|
+
font: inherit; padding: 0; border-bottom: 1px dashed transparent;
|
|
956
|
+
transition: border-color 120ms; max-width: 260px;
|
|
957
|
+
}
|
|
958
|
+
.ax-hero h1 input:hover { border-color: var(--ax-border-2); }
|
|
959
|
+
.ax-hero h1 input:focus { outline: none; border-color: var(--ax-accent); }
|
|
960
|
+
.ax-hero__sub {
|
|
961
|
+
color: var(--ax-text-2); font-size: 13px; margin-top: 2px;
|
|
962
|
+
display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
|
|
963
|
+
}
|
|
964
|
+
.ax-hero__sub .ax-hero__dot {
|
|
965
|
+
width: 3px; height: 3px; background: var(--ax-border-2); border-radius: 50%;
|
|
966
|
+
}
|
|
967
|
+
.ax-hero__actions { display: flex; gap: 8px; align-items: center; }
|
|
968
|
+
|
|
969
|
+
/* Inline stats strip (smaller than the settings health strip \u2014 fits in
|
|
970
|
+
* the detail page hero below the hero title). */
|
|
971
|
+
.ax-stats-inline {
|
|
972
|
+
max-width: 1400px; margin: 0 auto; padding: 0 24px;
|
|
973
|
+
display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
|
|
974
|
+
}
|
|
975
|
+
.ax-stat-inline {
|
|
976
|
+
background: var(--ax-surface); border: var(--ax-border-w) solid var(--ax-border);
|
|
977
|
+
border-radius: var(--ax-radius-sm); padding: 10px 12px;
|
|
978
|
+
display: flex; align-items: center; gap: 11px;
|
|
979
|
+
}
|
|
980
|
+
.ax-stat-inline__icon {
|
|
981
|
+
width: 26px; height: 26px; border-radius: var(--ax-radius);
|
|
982
|
+
background: color-mix(in oklch, var(--ax-accent) 12%, var(--ax-surface-2));
|
|
983
|
+
display: grid; place-items: center;
|
|
984
|
+
color: var(--ax-accent); flex-shrink: 0;
|
|
985
|
+
}
|
|
986
|
+
.ax-stat-inline__icon svg { width: 14px; height: 14px; }
|
|
987
|
+
.ax-stat-inline__v {
|
|
988
|
+
font-size: 15px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.1;
|
|
989
|
+
}
|
|
990
|
+
.ax-stat-inline__l {
|
|
991
|
+
font-size: 11px; color: var(--ax-muted); margin-top: 1px;
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
/* Detail layout \u2014 2-col rail + main. Overlays (test-drive, history, etc.)
|
|
995
|
+
* dock separately via fixed positioning. */
|
|
996
|
+
.ax-layout {
|
|
997
|
+
max-width: 1400px; margin: 22px auto 0; padding: 0 24px 60px;
|
|
998
|
+
display: grid; grid-template-columns: 200px 1fr;
|
|
999
|
+
gap: 22px; align-items: flex-start;
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
/* Left rail \u2014 sticky nav list with grouped items */
|
|
1003
|
+
.ax-rail {
|
|
1004
|
+
position: sticky; top: 72px;
|
|
1005
|
+
display: flex; flex-direction: column; gap: 1px;
|
|
1006
|
+
}
|
|
1007
|
+
.ax-rail a {
|
|
1008
|
+
display: flex; align-items: center; gap: 10px;
|
|
1009
|
+
padding: 9px 11px; border-radius: var(--ax-radius);
|
|
1010
|
+
color: var(--ax-text-2); font-size: 13px; font-weight: 500;
|
|
1011
|
+
cursor: pointer; position: relative;
|
|
1012
|
+
transition: background 120ms, color 120ms;
|
|
1013
|
+
}
|
|
1014
|
+
.ax-rail a svg {
|
|
1015
|
+
width: 15px; height: 15px; flex-shrink: 0; color: var(--ax-muted);
|
|
1016
|
+
}
|
|
1017
|
+
.ax-rail a:hover {
|
|
1018
|
+
background: var(--ax-surface); color: var(--ax-text); text-decoration: none;
|
|
1019
|
+
}
|
|
1020
|
+
.ax-rail a:hover svg { color: var(--ax-text); }
|
|
1021
|
+
.ax-rail a.is-active {
|
|
1022
|
+
background: color-mix(in oklch, var(--ax-accent) 12%, var(--ax-surface));
|
|
1023
|
+
color: var(--ax-accent);
|
|
1024
|
+
}
|
|
1025
|
+
.ax-rail a.is-active svg { color: var(--ax-accent); }
|
|
1026
|
+
.ax-rail a.is-active::before {
|
|
1027
|
+
content: ""; position: absolute; left: -3px; top: 7px; bottom: 7px;
|
|
1028
|
+
width: 2px; border-radius: var(--ax-radius-sm); background: var(--ax-accent);
|
|
1029
|
+
}
|
|
1030
|
+
.ax-rail__count {
|
|
1031
|
+
margin-left: auto; font-family: var(--ax-mono);
|
|
1032
|
+
font-size: 10px; padding: 1px 6px; background: var(--ax-surface-2);
|
|
1033
|
+
color: var(--ax-muted); border-radius: var(--ax-radius); line-height: 14px;
|
|
1034
|
+
}
|
|
1035
|
+
.ax-rail a.is-active .ax-rail__count {
|
|
1036
|
+
background: color-mix(in oklch, var(--ax-accent) 22%, transparent);
|
|
1037
|
+
color: var(--ax-accent);
|
|
1038
|
+
}
|
|
1039
|
+
.ax-rail__sep { height: 1px; background: var(--ax-border); margin: 8px 4px; }
|
|
1040
|
+
.ax-rail__label {
|
|
1041
|
+
font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
|
|
1042
|
+
color: var(--ax-muted); padding: 6px 11px 4px; font-family: var(--ax-mono);
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
/* Main panel containers (one per section) */
|
|
1046
|
+
.ax-panel {
|
|
1047
|
+
background: var(--ax-surface); border: var(--ax-border-w) solid var(--ax-border);
|
|
1048
|
+
border-radius: var(--ax-radius-lg); padding: 22px;
|
|
1049
|
+
}
|
|
1050
|
+
.ax-panel + .ax-panel { margin-top: 12px; }
|
|
1051
|
+
.ax-panel h2 {
|
|
1052
|
+
margin: 0 0 4px; font-size: 16px; font-weight: 600; letter-spacing: -0.01em;
|
|
1053
|
+
}
|
|
1054
|
+
.ax-panel .ax-lead {
|
|
1055
|
+
margin: 0 0 16px; font-size: 12.5px; color: var(--ax-text-2); line-height: 1.55;
|
|
1056
|
+
}
|
|
1057
|
+
.ax-panel__head {
|
|
1058
|
+
display: flex; align-items: flex-start; justify-content: space-between;
|
|
1059
|
+
gap: 12px; margin-bottom: 14px;
|
|
1060
|
+
}
|
|
1061
|
+
.ax-panel__head h2 { margin: 0 0 3px; }
|
|
1062
|
+
.ax-panel__tab { display: none; animation: ax-fade 180ms ease; }
|
|
1063
|
+
.ax-panel__tab.is-active { display: block; }
|
|
1064
|
+
@keyframes ax-fade {
|
|
1065
|
+
from { opacity: 0; transform: translateY(4px); }
|
|
1066
|
+
to { opacity: 1; transform: none; }
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
/* Grids for form rows */
|
|
1070
|
+
.ax-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
|
|
1071
|
+
.ax-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
|
|
1072
|
+
|
|
1073
|
+
/* Slider-style setting row \u2014 label + hint + segmented options */
|
|
1074
|
+
.ax-slider-row {
|
|
1075
|
+
display: grid; grid-template-columns: 140px 1fr auto;
|
|
1076
|
+
gap: 12px; align-items: center;
|
|
1077
|
+
padding: 10px 0; border-bottom: 1px dashed var(--ax-border);
|
|
1078
|
+
}
|
|
1079
|
+
.ax-slider-row:last-child { border-bottom: 0; }
|
|
1080
|
+
.ax-slider-row label { font-size: 12.5px; color: var(--ax-text); margin: 0; }
|
|
1081
|
+
.ax-slider-row .ax-hint {
|
|
1082
|
+
margin: 0; color: var(--ax-muted); font-size: 11.5px;
|
|
1083
|
+
}
|
|
1084
|
+
.ax-slider-row .ax-opts {
|
|
1085
|
+
display: flex; gap: 4px; background: var(--ax-bg);
|
|
1086
|
+
border: var(--ax-border-w) solid var(--ax-border); border-radius: var(--ax-radius-sm); padding: 2px;
|
|
1087
|
+
}
|
|
1088
|
+
.ax-slider-row .ax-opts button {
|
|
1089
|
+
background: transparent; border: 0; color: var(--ax-muted);
|
|
1090
|
+
padding: 5px 11px; font: inherit; font-size: 11.5px;
|
|
1091
|
+
cursor: pointer; border-radius: var(--ax-radius-sm); white-space: nowrap;
|
|
1092
|
+
}
|
|
1093
|
+
.ax-slider-row .ax-opts button.is-active {
|
|
1094
|
+
background: var(--ax-surface-2); color: var(--ax-text);
|
|
1095
|
+
}
|
|
1096
|
+
|
|
1097
|
+
/* Sub-tabs (Guided/Freeform, CLAUDE.md/SOUL.md/IDENTITY.md) */
|
|
1098
|
+
.ax-subtabs {
|
|
1099
|
+
display: inline-flex; background: var(--ax-bg);
|
|
1100
|
+
border: var(--ax-border-w) solid var(--ax-border); border-radius: var(--ax-radius);
|
|
1101
|
+
padding: 3px; margin-bottom: 16px;
|
|
1102
|
+
}
|
|
1103
|
+
.ax-subtabs button {
|
|
1104
|
+
background: transparent; border: 0; color: var(--ax-muted);
|
|
1105
|
+
padding: 6px 14px; font: inherit; font-size: 12px;
|
|
1106
|
+
cursor: pointer; border-radius: var(--ax-radius-sm); font-weight: 500;
|
|
1107
|
+
}
|
|
1108
|
+
.ax-subtabs button.is-active {
|
|
1109
|
+
background: var(--ax-surface-2); color: var(--ax-text);
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1112
|
+
/* Trigger-word chips with inline input (for Wake words field) */
|
|
1113
|
+
.ax-triggers-edit {
|
|
1114
|
+
display: flex; flex-wrap: wrap; gap: 6px;
|
|
1115
|
+
background: var(--ax-bg); border: var(--ax-border-w) solid var(--ax-border);
|
|
1116
|
+
padding: 7px; border-radius: var(--ax-radius-sm); min-height: 38px;
|
|
1117
|
+
align-items: center; cursor: text;
|
|
1118
|
+
}
|
|
1119
|
+
.ax-triggers-edit:focus-within {
|
|
1120
|
+
border-color: var(--ax-accent);
|
|
1121
|
+
box-shadow: 0 0 0 3px color-mix(in oklch, var(--ax-accent) 18%, transparent);
|
|
1122
|
+
}
|
|
1123
|
+
.ax-trig-pill {
|
|
1124
|
+
display: inline-flex; align-items: center; gap: 6px;
|
|
1125
|
+
font-family: var(--ax-mono); font-size: 11px;
|
|
1126
|
+
padding: 3px 4px 3px 9px;
|
|
1127
|
+
background: color-mix(in oklch, var(--ax-accent) 16%, var(--ax-surface));
|
|
1128
|
+
border: 1px solid color-mix(in oklch, var(--ax-accent) 30%, var(--ax-border));
|
|
1129
|
+
border-radius: var(--ax-radius-sm); color: var(--ax-accent);
|
|
1130
|
+
}
|
|
1131
|
+
.ax-trig-pill button {
|
|
1132
|
+
background: transparent; border: 0; color: currentColor;
|
|
1133
|
+
opacity: 0.6; cursor: pointer; font-size: 13px; line-height: 1;
|
|
1134
|
+
padding: 0 2px; border-radius: var(--ax-radius-sm);
|
|
1135
|
+
}
|
|
1136
|
+
.ax-trig-pill button:hover {
|
|
1137
|
+
opacity: 1;
|
|
1138
|
+
background: color-mix(in oklch, var(--ax-accent) 20%, transparent);
|
|
1139
|
+
}
|
|
1140
|
+
.ax-triggers-edit input {
|
|
1141
|
+
flex: 1; min-width: 120px;
|
|
1142
|
+
background: transparent; border: 0; color: var(--ax-text);
|
|
1143
|
+
font: inherit; font-size: 12.5px;
|
|
1144
|
+
padding: 4px 6px; font-family: var(--ax-mono);
|
|
1145
|
+
}
|
|
1146
|
+
.ax-triggers-edit input:focus { outline: none; }
|
|
1147
|
+
|
|
1148
|
+
/* Prompt editor (freeform CLAUDE.md) */
|
|
1149
|
+
.ax-prompt-edit { position: relative; }
|
|
1150
|
+
.ax-prompt-edit textarea { min-height: 220px; line-height: 1.6; }
|
|
1151
|
+
.ax-prompt-badges {
|
|
1152
|
+
position: absolute; top: 8px; right: 8px; display: flex; gap: 6px;
|
|
1153
|
+
}
|
|
1154
|
+
.ax-prompt-badges .ax-pbadge {
|
|
1155
|
+
font-size: 10px; padding: 3px 7px; border-radius: var(--ax-radius-sm);
|
|
1156
|
+
background: var(--ax-surface-2); color: var(--ax-muted);
|
|
1157
|
+
font-family: var(--ax-mono); letter-spacing: 0.03em;
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1160
|
+
/* Skill gallery */
|
|
1161
|
+
.ax-skill-toolbar {
|
|
1162
|
+
display: flex; gap: 10px; align-items: center;
|
|
1163
|
+
margin-bottom: 14px; flex-wrap: wrap;
|
|
1164
|
+
}
|
|
1165
|
+
.ax-search {
|
|
1166
|
+
position: relative; flex: 1; min-width: 220px;
|
|
1167
|
+
}
|
|
1168
|
+
.ax-search svg {
|
|
1169
|
+
position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
|
|
1170
|
+
width: 13px; height: 13px; color: var(--ax-muted); pointer-events: none;
|
|
1171
|
+
}
|
|
1172
|
+
.ax-search input { width: 100%; padding-left: 30px; }
|
|
1173
|
+
.ax-skill-filter {
|
|
1174
|
+
display: flex; gap: 4px; background: var(--ax-bg);
|
|
1175
|
+
border: var(--ax-border-w) solid var(--ax-border); border-radius: var(--ax-radius-sm); padding: 2px;
|
|
1176
|
+
}
|
|
1177
|
+
.ax-skill-filter button {
|
|
1178
|
+
background: transparent; border: 0; color: var(--ax-muted);
|
|
1179
|
+
padding: 5px 10px; font: inherit; font-size: 11.5px;
|
|
1180
|
+
cursor: pointer; border-radius: var(--ax-radius-sm);
|
|
1181
|
+
}
|
|
1182
|
+
.ax-skill-filter button.is-active {
|
|
1183
|
+
background: var(--ax-surface-2); color: var(--ax-text);
|
|
1184
|
+
}
|
|
1185
|
+
.ax-skill-grid {
|
|
1186
|
+
display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
|
|
1187
|
+
gap: 10px;
|
|
1188
|
+
}
|
|
1189
|
+
.ax-skill-card {
|
|
1190
|
+
background: var(--ax-bg-elev); border: var(--ax-border-w) solid var(--ax-border);
|
|
1191
|
+
border-radius: var(--ax-radius-lg); padding: 14px;
|
|
1192
|
+
display: flex; flex-direction: column; gap: 8px;
|
|
1193
|
+
cursor: pointer; position: relative; overflow: hidden;
|
|
1194
|
+
transition: border-color 160ms, transform 160ms, background 160ms;
|
|
1195
|
+
}
|
|
1196
|
+
.ax-skill-card:hover { border-color: var(--ax-border-2); transform: translateY(-1px); }
|
|
1197
|
+
.ax-skill-card.is-on {
|
|
1198
|
+
border-color: color-mix(in oklch, var(--ax-accent) 40%, var(--ax-border));
|
|
1199
|
+
background: color-mix(in oklch, var(--ax-accent) 5%, var(--ax-bg-elev));
|
|
1200
|
+
}
|
|
1201
|
+
.ax-skill-card.is-on::after {
|
|
1202
|
+
content: ""; position: absolute; top: 0; right: 0;
|
|
1203
|
+
width: 0; height: 0;
|
|
1204
|
+
border-left: 26px solid transparent;
|
|
1205
|
+
border-top: 26px solid var(--ax-accent);
|
|
1206
|
+
}
|
|
1207
|
+
.ax-skill-card.is-on::before {
|
|
1208
|
+
content: ""; position: absolute; top: 5px; right: 3px;
|
|
1209
|
+
width: 7px; height: 4px;
|
|
1210
|
+
border-left: 2px solid var(--ax-bg);
|
|
1211
|
+
border-bottom: 2px solid var(--ax-bg);
|
|
1212
|
+
transform: rotate(-45deg); z-index: 2;
|
|
1213
|
+
}
|
|
1214
|
+
.ax-skill-card__top { display: flex; align-items: center; gap: 10px; }
|
|
1215
|
+
.ax-skill-card__icon {
|
|
1216
|
+
width: 32px; height: 32px; border-radius: var(--ax-radius);
|
|
1217
|
+
background: var(--ax-surface-2);
|
|
1218
|
+
display: grid; place-items: center; flex-shrink: 0;
|
|
1219
|
+
color: var(--ax-accent);
|
|
1220
|
+
}
|
|
1221
|
+
.ax-skill-card__icon svg { width: 16px; height: 16px; }
|
|
1222
|
+
.ax-skill-card__name {
|
|
1223
|
+
font-weight: 600; font-size: 13px; letter-spacing: -0.005em;
|
|
1224
|
+
}
|
|
1225
|
+
.ax-skill-card__slug {
|
|
1226
|
+
font-family: var(--ax-mono); font-size: 10.5px;
|
|
1227
|
+
color: var(--ax-muted); margin-top: 1px;
|
|
1228
|
+
}
|
|
1229
|
+
.ax-skill-card__desc {
|
|
1230
|
+
font-size: 12px; color: var(--ax-text-2); line-height: 1.5;
|
|
1231
|
+
flex: 1; min-height: 32px;
|
|
1232
|
+
}
|
|
1233
|
+
.ax-skill-card__foot {
|
|
1234
|
+
display: flex; align-items: center; justify-content: space-between;
|
|
1235
|
+
font-size: 11px; color: var(--ax-muted);
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
/* Info callout (similar to wit but inline inside panels) */
|
|
1239
|
+
.ax-callout {
|
|
1240
|
+
background: color-mix(in oklch, var(--ax-info) 5%, var(--ax-bg-elev));
|
|
1241
|
+
border: 1px solid color-mix(in oklch, var(--ax-info) 20%, var(--ax-border));
|
|
1242
|
+
border-radius: var(--ax-radius-sm); padding: 12px 14px;
|
|
1243
|
+
font-size: 12.5px; color: var(--ax-text-2); line-height: 1.6;
|
|
1244
|
+
display: flex; gap: 10px; align-items: flex-start; margin-bottom: 16px;
|
|
1245
|
+
}
|
|
1246
|
+
.ax-callout__icon {
|
|
1247
|
+
width: 18px; height: 18px; border-radius: 50%;
|
|
1248
|
+
background: color-mix(in oklch, var(--ax-info) 18%, transparent);
|
|
1249
|
+
color: var(--ax-info); display: grid; place-items: center;
|
|
1250
|
+
font-size: 11px; font-weight: 600; flex-shrink: 0; margin-top: 1px;
|
|
1251
|
+
}
|
|
1252
|
+
.ax-callout b { color: var(--ax-text); }
|
|
1253
|
+
.ax-callout code {
|
|
1254
|
+
font-family: var(--ax-mono); font-size: 11.5px;
|
|
1255
|
+
background: var(--ax-bg); padding: 1px 5px; border-radius: var(--ax-radius-sm);
|
|
1256
|
+
border: var(--ax-border-w) solid var(--ax-border);
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
/* Channel-binding rows (agent-specific view) */
|
|
1260
|
+
.ax-chan-row {
|
|
1261
|
+
background: var(--ax-bg-elev); border: var(--ax-border-w) solid var(--ax-border);
|
|
1262
|
+
border-radius: var(--ax-radius-lg); padding: 12px 14px;
|
|
1263
|
+
display: flex; align-items: center; gap: 12px; margin-bottom: 8px;
|
|
1264
|
+
}
|
|
1265
|
+
.ax-chan-row__logo {
|
|
1266
|
+
width: 32px; height: 32px; border-radius: var(--ax-radius);
|
|
1267
|
+
display: grid; place-items: center;
|
|
1268
|
+
font-weight: 700; font-size: 13px; color: white; flex-shrink: 0;
|
|
1269
|
+
font-family: var(--ax-mono);
|
|
1270
|
+
}
|
|
1271
|
+
.ax-chan-row__info { flex: 1; }
|
|
1272
|
+
.ax-chan-row__name { font-size: 13px; font-weight: 600; }
|
|
1273
|
+
.ax-chan-row__desc {
|
|
1274
|
+
font-size: 12px; color: var(--ax-muted);
|
|
1275
|
+
margin-top: 2px; font-family: var(--ax-mono);
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
/* Handover viz (from-agent \u2192 to-agent arrow) */
|
|
1279
|
+
.ax-handover-viz {
|
|
1280
|
+
display: flex; align-items: center; justify-content: space-between;
|
|
1281
|
+
gap: 14px; padding: 16px 18px;
|
|
1282
|
+
background: var(--ax-bg-elev); border: var(--ax-border-w) solid var(--ax-border);
|
|
1283
|
+
border-radius: var(--ax-radius-lg); margin-bottom: 14px;
|
|
1284
|
+
}
|
|
1285
|
+
.ax-ho-side {
|
|
1286
|
+
display: flex; flex-direction: column; align-items: center;
|
|
1287
|
+
gap: 6px; flex: 0 0 130px;
|
|
1288
|
+
}
|
|
1289
|
+
.ax-ho-side__av {
|
|
1290
|
+
width: 42px; height: 42px; border-radius: var(--ax-radius);
|
|
1291
|
+
display: grid; place-items: center;
|
|
1292
|
+
font-weight: 600; font-size: 15px;
|
|
1293
|
+
}
|
|
1294
|
+
.ax-ho-side--from .ax-ho-side__av {
|
|
1295
|
+
background: color-mix(in oklch, var(--ax-accent) 18%, var(--ax-surface));
|
|
1296
|
+
border: 1px solid color-mix(in oklch, var(--ax-accent) 35%, var(--ax-border));
|
|
1297
|
+
color: var(--ax-accent);
|
|
1298
|
+
}
|
|
1299
|
+
.ax-ho-side--to .ax-ho-side__av {
|
|
1300
|
+
background: var(--ax-surface-2); border: var(--ax-border-w) solid var(--ax-border-2);
|
|
1301
|
+
color: var(--ax-text);
|
|
1302
|
+
}
|
|
1303
|
+
.ax-ho-side__nm { font-size: 12px; font-weight: 600; }
|
|
1304
|
+
.ax-ho-side__rl {
|
|
1305
|
+
font-size: 10px; color: var(--ax-muted);
|
|
1306
|
+
text-transform: uppercase; letter-spacing: 0.06em;
|
|
1307
|
+
font-family: var(--ax-mono);
|
|
1308
|
+
}
|
|
1309
|
+
.ax-ho-wire {
|
|
1310
|
+
flex: 1; height: 2px; position: relative;
|
|
1311
|
+
background: repeating-linear-gradient(90deg,
|
|
1312
|
+
var(--ax-border-2) 0, var(--ax-border-2) 4px,
|
|
1313
|
+
transparent 4px, transparent 8px);
|
|
1314
|
+
}
|
|
1315
|
+
.ax-ho-wire svg {
|
|
1316
|
+
position: absolute; right: -6px; top: 50%; transform: translateY(-50%);
|
|
1317
|
+
width: 16px; height: 16px; color: var(--ax-accent);
|
|
1318
|
+
}
|
|
1319
|
+
.ax-ho-list-row {
|
|
1320
|
+
display: flex; align-items: center; gap: 10px;
|
|
1321
|
+
padding: 10px 12px;
|
|
1322
|
+
background: var(--ax-bg-elev); border: var(--ax-border-w) solid var(--ax-border);
|
|
1323
|
+
border-radius: var(--ax-radius-sm); margin-bottom: 6px;
|
|
1324
|
+
font-size: 12.5px;
|
|
1325
|
+
}
|
|
1326
|
+
.ax-ho-list-row .ax-who { flex: 1; color: var(--ax-text-2); }
|
|
1327
|
+
.ax-ho-list-row .ax-who b {
|
|
1328
|
+
color: var(--ax-text); font-family: var(--ax-mono); font-weight: 500;
|
|
1329
|
+
}
|
|
1330
|
+
.ax-ho-list-row .ax-when { color: var(--ax-muted); font-size: 11px; }
|
|
1331
|
+
|
|
1332
|
+
/* Activity cells + spark + session rows */
|
|
1333
|
+
.ax-activity-grid {
|
|
1334
|
+
display: grid; grid-template-columns: repeat(4, 1fr);
|
|
1335
|
+
gap: 10px; margin-bottom: 18px;
|
|
1336
|
+
}
|
|
1337
|
+
.ax-activity-cell {
|
|
1338
|
+
background: var(--ax-bg-elev); border: var(--ax-border-w) solid var(--ax-border);
|
|
1339
|
+
border-radius: var(--ax-radius-sm); padding: 14px;
|
|
1340
|
+
}
|
|
1341
|
+
.ax-activity-cell .ax-v {
|
|
1342
|
+
font-size: 20px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2;
|
|
1343
|
+
}
|
|
1344
|
+
.ax-activity-cell .ax-l {
|
|
1345
|
+
font-size: 11px; color: var(--ax-muted); margin-top: 2px;
|
|
1346
|
+
}
|
|
1347
|
+
.ax-activity-cell .ax-delta {
|
|
1348
|
+
font-size: 11px; margin-top: 6px;
|
|
1349
|
+
display: inline-flex; align-items: center; gap: 3px;
|
|
1350
|
+
}
|
|
1351
|
+
.ax-activity-cell .ax-delta--up { color: var(--ax-accent); }
|
|
1352
|
+
.ax-activity-cell .ax-delta--down { color: var(--ax-muted); }
|
|
1353
|
+
|
|
1354
|
+
.ax-spark { width: 100%; height: 100px; margin: 10px 0 14px; }
|
|
1355
|
+
|
|
1356
|
+
.ax-session {
|
|
1357
|
+
display: flex; align-items: center; gap: 10px;
|
|
1358
|
+
padding: 10px 12px;
|
|
1359
|
+
background: var(--ax-bg-elev); border: var(--ax-border-w) solid var(--ax-border);
|
|
1360
|
+
border-radius: var(--ax-radius-sm); margin-bottom: 6px;
|
|
1361
|
+
font-size: 12.5px;
|
|
1362
|
+
}
|
|
1363
|
+
.ax-session__ch {
|
|
1364
|
+
width: 24px; height: 24px; border-radius: var(--ax-radius-sm);
|
|
1365
|
+
display: grid; place-items: center;
|
|
1366
|
+
font-weight: 700; font-size: 10px; color: white;
|
|
1367
|
+
flex-shrink: 0; font-family: var(--ax-mono);
|
|
1368
|
+
}
|
|
1369
|
+
.ax-session__body { flex: 1; min-width: 0; }
|
|
1370
|
+
.ax-session__txt {
|
|
1371
|
+
color: var(--ax-text); overflow: hidden; text-overflow: ellipsis;
|
|
1372
|
+
white-space: nowrap;
|
|
1373
|
+
}
|
|
1374
|
+
.ax-session__meta {
|
|
1375
|
+
font-size: 11px; color: var(--ax-muted);
|
|
1376
|
+
margin-top: 1px; font-family: var(--ax-mono);
|
|
1377
|
+
}
|
|
1378
|
+
|
|
1379
|
+
/* Log row (Conversations tab) */
|
|
1380
|
+
.ax-log-head {
|
|
1381
|
+
display: grid; grid-template-columns: 24px 90px 160px 1fr auto;
|
|
1382
|
+
gap: 12px; padding: 8px 10px;
|
|
1383
|
+
border-bottom: var(--ax-border-w) solid var(--ax-border-2);
|
|
1384
|
+
font-size: 10px; color: var(--ax-muted);
|
|
1385
|
+
text-transform: uppercase; letter-spacing: 0.06em; font-family: var(--ax-mono);
|
|
1386
|
+
}
|
|
1387
|
+
.ax-log-row {
|
|
1388
|
+
display: grid; grid-template-columns: 24px 90px 160px 1fr auto;
|
|
1389
|
+
gap: 12px; align-items: center; padding: 9px 10px;
|
|
1390
|
+
border-bottom: var(--ax-border-w) solid var(--ax-border); font-size: 12px;
|
|
1391
|
+
}
|
|
1392
|
+
.ax-log-row:hover { background: color-mix(in oklch, var(--ax-accent) 4%, transparent); }
|
|
1393
|
+
.ax-log-row .ax-sev {
|
|
1394
|
+
width: 8px; height: 8px; border-radius: 50%; margin-left: 8px;
|
|
1395
|
+
}
|
|
1396
|
+
.ax-log-row .ax-sev--ok { background: var(--ax-accent); }
|
|
1397
|
+
.ax-log-row .ax-sev--warn { background: var(--ax-warn); }
|
|
1398
|
+
.ax-log-row .ax-sev--err { background: var(--ax-err); }
|
|
1399
|
+
.ax-log-row .ax-t {
|
|
1400
|
+
font-family: var(--ax-mono); color: var(--ax-muted); font-size: 11px;
|
|
1401
|
+
}
|
|
1402
|
+
.ax-log-row .ax-who {
|
|
1403
|
+
font-family: var(--ax-mono); font-size: 11px; color: var(--ax-text-2);
|
|
1404
|
+
}
|
|
1405
|
+
.ax-log-row .ax-msg {
|
|
1406
|
+
color: var(--ax-text); overflow: hidden;
|
|
1407
|
+
text-overflow: ellipsis; white-space: nowrap;
|
|
1408
|
+
}
|
|
1409
|
+
.ax-log-row .ax-ms {
|
|
1410
|
+
color: var(--ax-muted); font-family: var(--ax-mono); font-size: 11px;
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
/* Danger zone */
|
|
1414
|
+
.ax-panel--danger {
|
|
1415
|
+
border-color: color-mix(in oklch, var(--ax-err) 30%, var(--ax-border));
|
|
1416
|
+
}
|
|
1417
|
+
.ax-danger-item {
|
|
1418
|
+
display: flex; align-items: center; gap: 14px;
|
|
1419
|
+
padding: 14px 0; border-bottom: 1px dashed var(--ax-border);
|
|
1420
|
+
}
|
|
1421
|
+
.ax-danger-item:last-child { border-bottom: 0; padding-bottom: 0; }
|
|
1422
|
+
.ax-danger-item:first-child { padding-top: 4px; }
|
|
1423
|
+
.ax-danger-item__info { flex: 1; }
|
|
1424
|
+
.ax-danger-item__name { font-size: 13px; font-weight: 600; margin-bottom: 3px; }
|
|
1425
|
+
.ax-danger-item__desc { font-size: 12px; color: var(--ax-muted); line-height: 1.5; }
|
|
1426
|
+
|
|
1427
|
+
/* Test-drive panel \u2014 docked to the right edge, slides in from outside
|
|
1428
|
+
* the viewport when toggled. Similar to the Live page history-panel. */
|
|
1429
|
+
.ax-td-panel {
|
|
1430
|
+
position: fixed; top: 0; right: 0; bottom: 0; width: 420px;
|
|
1431
|
+
background: var(--ax-bg-elev); border-left: var(--ax-border-w) solid var(--ax-border);
|
|
1432
|
+
z-index: 900;
|
|
1433
|
+
display: flex; flex-direction: column;
|
|
1434
|
+
box-shadow: -8px 0 24px rgba(0,0,0,0.4);
|
|
1435
|
+
transform: translateX(100%); transition: transform 0.22s ease;
|
|
1436
|
+
}
|
|
1437
|
+
.ax-td-panel.is-open { transform: translateX(0); }
|
|
1438
|
+
@media (max-width: 520px) {
|
|
1439
|
+
.ax-td-panel { width: 100vw; }
|
|
1440
|
+
}
|
|
1441
|
+
.ax-td-head {
|
|
1442
|
+
padding: 12px 14px; border-bottom: var(--ax-border-w) solid var(--ax-border);
|
|
1443
|
+
background: var(--ax-bg-elev);
|
|
1444
|
+
display: flex; align-items: center; gap: 10px;
|
|
1445
|
+
}
|
|
1446
|
+
.ax-td-head__dot {
|
|
1447
|
+
width: 8px; height: 8px; border-radius: 50%;
|
|
1448
|
+
background: var(--ax-accent);
|
|
1449
|
+
box-shadow: 0 0 8px color-mix(in oklch, var(--ax-accent) 60%, transparent);
|
|
1450
|
+
animation: ax-pulse 2.2s infinite;
|
|
1451
|
+
}
|
|
1452
|
+
.ax-td-head__t { flex: 1; font-size: 12px; font-weight: 600; }
|
|
1453
|
+
.ax-td-head__sub {
|
|
1454
|
+
font-size: 11px; color: var(--ax-muted); font-family: var(--ax-mono);
|
|
1455
|
+
}
|
|
1456
|
+
.ax-td-head__seg {
|
|
1457
|
+
display: inline-flex; background: var(--ax-surface);
|
|
1458
|
+
border: var(--ax-border-w) solid var(--ax-border); border-radius: var(--ax-radius-sm); padding: 2px;
|
|
1459
|
+
}
|
|
1460
|
+
.ax-td-head__seg button {
|
|
1461
|
+
background: transparent; border: 0; color: var(--ax-muted);
|
|
1462
|
+
padding: 3px 8px; font: inherit; font-size: 10.5px;
|
|
1463
|
+
cursor: pointer; border-radius: var(--ax-radius-sm); font-family: var(--ax-mono);
|
|
1464
|
+
}
|
|
1465
|
+
.ax-td-head__seg button.is-active {
|
|
1466
|
+
background: var(--ax-surface-2); color: var(--ax-text);
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
.ax-td-scenarios {
|
|
1470
|
+
padding: 10px 14px; background: var(--ax-bg-elev);
|
|
1471
|
+
border-bottom: var(--ax-border-w) solid var(--ax-border);
|
|
1472
|
+
display: flex; gap: 5px; flex-wrap: wrap;
|
|
1473
|
+
}
|
|
1474
|
+
.ax-td-scenarios__lbl {
|
|
1475
|
+
font-size: 10px; color: var(--ax-muted);
|
|
1476
|
+
text-transform: uppercase; letter-spacing: 0.06em;
|
|
1477
|
+
font-family: var(--ax-mono); width: 100%; margin-bottom: 3px;
|
|
1478
|
+
}
|
|
1479
|
+
.ax-td-scenario {
|
|
1480
|
+
font-size: 11px; padding: 3px 8px;
|
|
1481
|
+
background: var(--ax-surface); border: var(--ax-border-w) solid var(--ax-border);
|
|
1482
|
+
border-radius: var(--ax-radius); color: var(--ax-text-2);
|
|
1483
|
+
cursor: pointer; transition: all 120ms;
|
|
1484
|
+
}
|
|
1485
|
+
.ax-td-scenario:hover { border-color: var(--ax-accent); color: var(--ax-accent); }
|
|
1486
|
+
|
|
1487
|
+
.ax-td-model {
|
|
1488
|
+
padding: 12px 14px; background: var(--ax-bg-elev);
|
|
1489
|
+
border-bottom: var(--ax-border-w) solid var(--ax-border);
|
|
1490
|
+
display: flex; flex-direction: column; gap: 8px;
|
|
1491
|
+
}
|
|
1492
|
+
.ax-td-model[hidden], .ax-td-model form[hidden] { display: none; }
|
|
1493
|
+
.ax-td-model__t { font-weight: 600; font-size: 13px; }
|
|
1494
|
+
.ax-td-model__hint { margin: 0; font-size: 12px; color: var(--ax-text-2); }
|
|
1495
|
+
.ax-td-model form { display: flex; gap: 6px; }
|
|
1496
|
+
.ax-td-model form .inp { flex: 1; min-width: 0; }
|
|
1497
|
+
.ax-td-model__err { font-size: 12px; color: var(--ax-danger, #c0392b); }
|
|
1498
|
+
.ax-td-model__err:empty { display: none; }
|
|
1499
|
+
|
|
1500
|
+
.ax-td-chat {
|
|
1501
|
+
flex: 1; overflow-y: auto; padding: 14px;
|
|
1502
|
+
display: flex; flex-direction: column; gap: 8px;
|
|
1503
|
+
background: var(--ax-bg);
|
|
1504
|
+
}
|
|
1505
|
+
.ax-td-chat__msg-wrap {
|
|
1506
|
+
display: flex; flex-direction: column; gap: 2px; max-width: 86%;
|
|
1507
|
+
}
|
|
1508
|
+
.ax-td-chat__msg-wrap.is-user { align-self: flex-end; align-items: flex-end; }
|
|
1509
|
+
.ax-td-chat__msg-wrap.is-bot { align-self: flex-start; }
|
|
1510
|
+
.ax-td-chat__bubble {
|
|
1511
|
+
padding: 8px 12px; border-radius: var(--ax-radius-lg);
|
|
1512
|
+
font-size: 12.5px; line-height: 1.55; word-wrap: break-word;
|
|
1513
|
+
}
|
|
1514
|
+
.ax-td-chat__bubble.is-user {
|
|
1515
|
+
background: var(--ax-accent); color: var(--ax-bg);
|
|
1516
|
+
border-bottom-right-radius: 3px; font-weight: 500;
|
|
1517
|
+
}
|
|
1518
|
+
.ax-td-chat__bubble.is-bot {
|
|
1519
|
+
background: var(--ax-surface-2); color: var(--ax-text);
|
|
1520
|
+
border-bottom-left-radius: 3px; border: var(--ax-border-w) solid var(--ax-border);
|
|
1521
|
+
}
|
|
1522
|
+
.ax-td-chat__meta {
|
|
1523
|
+
font-size: 9.5px; color: var(--ax-muted);
|
|
1524
|
+
font-family: var(--ax-mono); padding: 0 4px;
|
|
1525
|
+
}
|
|
1526
|
+
.ax-td-chat__typing {
|
|
1527
|
+
align-self: flex-start; padding: 10px 14px;
|
|
1528
|
+
background: var(--ax-surface-2); border: var(--ax-border-w) solid var(--ax-border);
|
|
1529
|
+
border-radius: var(--ax-radius-lg); border-bottom-left-radius: 3px;
|
|
1530
|
+
display: inline-flex; gap: 4px;
|
|
1531
|
+
}
|
|
1532
|
+
.ax-td-chat__typing span {
|
|
1533
|
+
width: 6px; height: 6px; background: var(--ax-muted);
|
|
1534
|
+
border-radius: 50%; animation: axTypingBounce 1.2s infinite;
|
|
1535
|
+
}
|
|
1536
|
+
.ax-td-chat__typing span:nth-child(2) { animation-delay: 0.15s; }
|
|
1537
|
+
.ax-td-chat__typing span:nth-child(3) { animation-delay: 0.3s; }
|
|
1538
|
+
@keyframes axTypingBounce {
|
|
1539
|
+
0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
|
|
1540
|
+
30% { transform: translateY(-5px); opacity: 1; }
|
|
1541
|
+
}
|
|
1542
|
+
.ax-td-input {
|
|
1543
|
+
padding: 10px; border-top: var(--ax-border-w) solid var(--ax-border);
|
|
1544
|
+
background: var(--ax-bg-elev); display: flex; gap: 6px;
|
|
1545
|
+
}
|
|
1546
|
+
.ax-td-input input {
|
|
1547
|
+
flex: 1; background: var(--ax-bg); border: var(--ax-border-w) solid var(--ax-border);
|
|
1548
|
+
border-radius: var(--ax-radius); padding: 8px 11px;
|
|
1549
|
+
color: var(--ax-text); font: inherit; font-size: 12.5px;
|
|
1550
|
+
}
|
|
1551
|
+
.ax-td-input input:focus { outline: none; border-color: var(--ax-accent); }
|
|
1552
|
+
.ax-td-input button {
|
|
1553
|
+
background: var(--ax-accent); color: var(--ax-bg); border: 0;
|
|
1554
|
+
border-radius: var(--ax-radius); padding: 0 12px;
|
|
1555
|
+
cursor: pointer; font-weight: 600;
|
|
1556
|
+
}
|
|
1557
|
+
.ax-td-input button:hover {
|
|
1558
|
+
background: color-mix(in oklch, var(--ax-accent) 88%, white);
|
|
1559
|
+
}
|
|
1560
|
+
|
|
1561
|
+
/* Inline task-queue chip on bot messages */
|
|
1562
|
+
.ax-td-task-chip {
|
|
1563
|
+
display: inline-flex; align-items: center; gap: 5px;
|
|
1564
|
+
margin-top: 5px; padding: 3px 8px;
|
|
1565
|
+
background: color-mix(in oklch, var(--ax-accent) 10%, var(--ax-surface));
|
|
1566
|
+
border: 1px solid color-mix(in oklch, var(--ax-accent) 35%, var(--ax-border));
|
|
1567
|
+
border-radius: var(--ax-radius); font-size: 10px; color: var(--ax-accent);
|
|
1568
|
+
font-family: var(--ax-mono); letter-spacing: 0.04em;
|
|
1569
|
+
cursor: default; user-select: none;
|
|
1570
|
+
}
|
|
1571
|
+
.ax-td-task-chip__dot {
|
|
1572
|
+
width: 6px; height: 6px; border-radius: 50%;
|
|
1573
|
+
background: var(--ax-accent); flex-shrink: 0;
|
|
1574
|
+
}
|
|
1575
|
+
.ax-td-task-chip--queued .ax-td-task-chip__dot {
|
|
1576
|
+
background: var(--ax-muted);
|
|
1577
|
+
}
|
|
1578
|
+
.ax-td-task-chip__id {
|
|
1579
|
+
font-family: var(--ax-mono); opacity: 0.7; font-size: 9px;
|
|
1580
|
+
}
|
|
1581
|
+
|
|
1582
|
+
/* Section mini-label used throughout detail pages */
|
|
1583
|
+
.ax-sec-label-d {
|
|
1584
|
+
display: flex; align-items: center; justify-content: space-between;
|
|
1585
|
+
margin: 20px 0 10px;
|
|
1586
|
+
}
|
|
1587
|
+
.ax-sec-label-d h3 {
|
|
1588
|
+
font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
|
|
1589
|
+
text-transform: uppercase; color: var(--ax-muted);
|
|
1590
|
+
margin: 0; font-family: var(--ax-mono);
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1593
|
+
/* --- Responsive collapses for the settings primitives --- */
|
|
1594
|
+
@media (max-width: 1180px) {
|
|
1595
|
+
.ax-layout { grid-template-columns: 180px 1fr; }
|
|
1596
|
+
}
|
|
1597
|
+
@media (max-width: 760px) {
|
|
1598
|
+
.ax-health-strip { grid-template-columns: repeat(2, 1fr); }
|
|
1599
|
+
.ax-connectors { grid-template-columns: 1fr; }
|
|
1600
|
+
.ax-detail-grid { grid-template-columns: 1fr; }
|
|
1601
|
+
.ax-mesh-hero { grid-template-columns: 1fr; }
|
|
1602
|
+
.ax-mesh-viz { margin: 0 auto; }
|
|
1603
|
+
.ax-cron-hints { grid-template-columns: 1fr; }
|
|
1604
|
+
.ax-layout { grid-template-columns: 1fr; }
|
|
1605
|
+
.ax-rail { display: none; }
|
|
1606
|
+
.ax-stats-inline { grid-template-columns: repeat(2, 1fr); }
|
|
1607
|
+
.ax-activity-grid { grid-template-columns: repeat(2, 1fr); }
|
|
1608
|
+
.ax-log-head, .ax-log-row { grid-template-columns: 8px 80px 1fr auto; }
|
|
1609
|
+
.ax-log-head span:nth-child(3), .ax-log-row .ax-who { display: none; }
|
|
1610
|
+
.ax-grid-2, .ax-grid-3 { grid-template-columns: 1fr; }
|
|
1611
|
+
}`;var aa=`
|
|
1612
|
+
.ax-as-dock{position:fixed;bottom:0;left:50%;transform:translateX(-50%);z-index:59;
|
|
1613
|
+
display:flex;flex-direction:column;align-items:center;
|
|
1614
|
+
width:min(620px,calc(100vw - 36px));transition:transform 160ms ease}
|
|
1615
|
+
/* Centred in the space that is left, not in the space the drawer covers. */
|
|
1616
|
+
body.ax-as-open .ax-as-dock{left:calc((100vw - var(--ax-as-w)) / 2)}
|
|
1617
|
+
/* Tucked: slide out of the way but leave the grip, or there is nothing to
|
|
1618
|
+
click to bring it back. */
|
|
1619
|
+
.ax-as-dock.is-tucked{transform:translateX(-50%) translateY(calc(100% - 26px))}
|
|
1620
|
+
body.ax-as-open .ax-as-dock.is-tucked{transform:translateX(-50%) translateY(calc(100% - 26px))}
|
|
1621
|
+
@media (prefers-reduced-motion:reduce){.ax-as-dock{transition:none}}
|
|
1622
|
+
.ax-as-dock__grip{width:56px;height:20px;margin-bottom:-2px;cursor:pointer;
|
|
1623
|
+
background:var(--ax-surface);border:var(--ax-border-w) solid var(--ax-border);
|
|
1624
|
+
border-bottom:none;border-radius:var(--ax-radius) var(--ax-radius) 0 0;padding:0;
|
|
1625
|
+
display:flex;align-items:center;justify-content:center}
|
|
1626
|
+
.ax-as-dock__grip::before{content:"";width:22px;height:3px;border-radius:2px;
|
|
1627
|
+
background:var(--ax-border-2)}
|
|
1628
|
+
.ax-as-dock__grip:hover::before{background:var(--ax-accent)}
|
|
1629
|
+
.ax-as-bar{display:flex;gap:8px;align-items:center;width:100%;padding:8px;
|
|
1630
|
+
background:var(--ax-surface);border:var(--ax-border-w) solid var(--ax-border);
|
|
1631
|
+
border-radius:var(--ax-radius-lg) var(--ax-radius-lg) 0 0;border-bottom:none;
|
|
1632
|
+
box-shadow:var(--ax-shadow-lg)}
|
|
1633
|
+
.ax-as-bar input{flex:1;min-width:0;font:inherit;font-size:13px;padding:7px 10px;
|
|
1634
|
+
border-radius:var(--ax-radius-sm);border:var(--ax-border-w) solid var(--ax-border-2);
|
|
1635
|
+
background:var(--ax-bg);color:var(--ax-text)}
|
|
1636
|
+
.ax-as-bar button{flex:none}
|
|
1637
|
+
/* Keep the last row of a page clear of the dock. */
|
|
1638
|
+
body{padding-bottom:86px}
|
|
1639
|
+
@media (max-width:640px){.ax-as-dock{width:calc(100vw - 24px)}
|
|
1640
|
+
body.ax-as-open .ax-as-dock{left:50%}}
|
|
1641
|
+
.ax-as-handle{position:fixed;right:0;top:50%;transform:translateY(-50%);z-index:60;
|
|
1642
|
+
display:flex;align-items:center;gap:6px;writing-mode:vertical-rl;
|
|
1643
|
+
background:var(--ax-surface);color:var(--ax-text);cursor:pointer;
|
|
1644
|
+
border:var(--ax-border-w) solid var(--ax-border);border-right:none;
|
|
1645
|
+
border-radius:var(--ax-radius) 0 0 var(--ax-radius);padding:14px 7px;
|
|
1646
|
+
font:inherit;font-size:12px;font-weight:600;box-shadow:var(--ax-shadow)}
|
|
1647
|
+
.ax-as-handle:hover{background:var(--ax-surface-2)}
|
|
1648
|
+
/* Open pushes the page over rather than covering it: a drawer that hides the
|
|
1649
|
+
rows you are asking about is worse than no drawer. Below 900px there is no
|
|
1650
|
+
room to give, so it overlays. */
|
|
1651
|
+
body.ax-as-open{padding-right:var(--ax-as-w)}
|
|
1652
|
+
@media (max-width:900px){body.ax-as-open{padding-right:0}}
|
|
1653
|
+
.ax-as{position:fixed;top:0;right:0;height:100vh;width:var(--ax-as-w);max-width:92vw;z-index:61;
|
|
1654
|
+
display:flex;flex-direction:column;background:var(--ax-surface);
|
|
1655
|
+
border-left:var(--ax-border-w) solid var(--ax-border);
|
|
1656
|
+
transform:translateX(100%);transition:transform 160ms ease}
|
|
1657
|
+
.ax-as.is-open{transform:translateX(0)}
|
|
1658
|
+
@media (prefers-reduced-motion:reduce){.ax-as{transition:none}}
|
|
1659
|
+
.ax-as__grip{position:absolute;left:0;top:0;bottom:0;width:6px;cursor:col-resize;
|
|
1660
|
+
background:transparent}
|
|
1661
|
+
.ax-as__grip:hover,.ax-as__grip:focus-visible{background:var(--ax-accent)}
|
|
1662
|
+
.ax-as__head{display:flex;align-items:center;gap:8px;padding:12px 14px;
|
|
1663
|
+
border-bottom:var(--ax-border-w) solid var(--ax-border)}
|
|
1664
|
+
.ax-as__title{font-size:13px;font-weight:600;flex:1}
|
|
1665
|
+
.ax-as__x{background:none;border:none;color:var(--ax-text-2);cursor:pointer;font:inherit;
|
|
1666
|
+
font-size:18px;line-height:1;padding:0 4px}
|
|
1667
|
+
.ax-as__icon{background:var(--ax-surface-2);border:1px solid var(--ax-border-2);color:var(--ax-text-2);
|
|
1668
|
+
cursor:pointer;font:inherit;font-size:11.5px;font-weight:600;padding:3px 9px;
|
|
1669
|
+
border-radius:var(--ax-radius-pill)}
|
|
1670
|
+
.ax-as__icon:hover{color:var(--ax-text);background:var(--ax-surface-3)}
|
|
1671
|
+
.ax-as__icon.is-on{background:var(--ax-blue-t);border-color:var(--ax-blue-e);color:var(--ax-blue-d)}
|
|
1672
|
+
.ax-as__hist{border-bottom:var(--ax-border-w) solid var(--ax-border);max-height:44vh;overflow:auto}
|
|
1673
|
+
.ax-as__hist-empty{padding:12px 14px;font-size:12px;color:var(--ax-text-2)}
|
|
1674
|
+
.ax-as__hist-list{list-style:none;margin:0;padding:0}
|
|
1675
|
+
.ax-as__hist-list li{display:flex;align-items:center;gap:8px;padding:9px 14px;
|
|
1676
|
+
border-bottom:1px solid var(--ax-border);cursor:pointer}
|
|
1677
|
+
.ax-as__hist-list li:hover{background:var(--ax-surface-2)}
|
|
1678
|
+
.ax-as__hist-list li.is-on{background:var(--ax-blue-t)}
|
|
1679
|
+
.ax-as__hist-t{flex:1;min-width:0;font-size:12.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
1680
|
+
.ax-as__hist-m{font-family:var(--ax-mono);font-size:10.5px;color:var(--ax-text-2);flex:none}
|
|
1681
|
+
.ax-as__hist-x{background:none;border:none;color:var(--ax-text-2);cursor:pointer;font-size:15px;
|
|
1682
|
+
line-height:1;padding:0 2px;flex:none}
|
|
1683
|
+
.ax-as__pending{opacity:0.75}
|
|
1684
|
+
/* Rendered markdown inside a bubble: tight enough not to look like a page. */
|
|
1685
|
+
.ax-as__md{white-space:normal}
|
|
1686
|
+
.ax-as__md p{margin:0 0 8px}
|
|
1687
|
+
.ax-as__md p:last-child{margin-bottom:0}
|
|
1688
|
+
.ax-as__md ul,.ax-as__md ol{margin:0 0 8px;padding-left:20px}
|
|
1689
|
+
.ax-as__md li{margin:2px 0}
|
|
1690
|
+
.ax-as__md code{font-family:var(--ax-mono);font-size:11.5px;background:var(--ax-surface-3);
|
|
1691
|
+
border:1px solid var(--ax-border);border-radius:4px;padding:0 4px}
|
|
1692
|
+
.ax-as__md pre{margin:0 0 8px;padding:9px 11px;overflow-x:auto;background:var(--ax-surface-3);
|
|
1693
|
+
border:1px solid var(--ax-border);border-radius:var(--ax-radius-sm)}
|
|
1694
|
+
.ax-as__md pre code{background:none;border:none;padding:0;font-size:11.5px}
|
|
1695
|
+
.ax-as__md h1,.ax-as__md h2,.ax-as__md h3,.ax-as__md h4{font-size:13px;margin:10px 0 6px}
|
|
1696
|
+
.ax-as__md blockquote{margin:0 0 8px;padding-left:10px;border-left:3px solid var(--ax-border-2);
|
|
1697
|
+
color:var(--ax-text-2)}
|
|
1698
|
+
.ax-as__md hr{border:none;border-top:1px solid var(--ax-border);margin:10px 0}
|
|
1699
|
+
/* Tables get their own scroller so a wide one cannot stretch the drawer. */
|
|
1700
|
+
.ax-as__md table{display:block;overflow-x:auto;border-collapse:collapse;margin:0 0 8px;font-size:12px}
|
|
1701
|
+
.ax-as__md th,.ax-as__md td{border:1px solid var(--ax-border);padding:4px 8px;text-align:left;
|
|
1702
|
+
white-space:nowrap}
|
|
1703
|
+
.ax-as__md th{background:var(--ax-surface-3);font-weight:600}
|
|
1704
|
+
.ax-as__pick{display:flex;gap:8px;padding:10px 14px;border-bottom:1px solid var(--ax-border)}
|
|
1705
|
+
.ax-as__pick select{flex:1;min-width:0;font:inherit;font-size:12px;padding:5px 8px;
|
|
1706
|
+
border-radius:var(--ax-radius-sm);border:var(--ax-border-w) solid var(--ax-border-2);
|
|
1707
|
+
background:var(--ax-bg);color:var(--ax-text)}
|
|
1708
|
+
.ax-as__ctx{padding:8px 14px;font-size:11.5px;color:var(--ax-text-2);
|
|
1709
|
+
border-bottom:1px solid var(--ax-border);display:flex;align-items:center;gap:7px;flex-wrap:wrap}
|
|
1710
|
+
.ax-as__ctx code{font-family:var(--ax-mono);font-size:11px}
|
|
1711
|
+
.ax-as__log{flex:1;overflow:auto;padding:12px 14px;display:flex;flex-direction:column;gap:10px}
|
|
1712
|
+
.ax-as__msg{font-size:13px;line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere;
|
|
1713
|
+
padding:9px 12px;border-radius:var(--ax-radius);border:var(--ax-border-w) solid var(--ax-border)}
|
|
1714
|
+
.ax-as__msg--me{background:var(--ax-blue-t);border-color:var(--ax-blue-e);align-self:flex-end;max-width:88%}
|
|
1715
|
+
.ax-as__msg--them{background:var(--ax-surface-2)}
|
|
1716
|
+
.ax-as__msg--err{background:var(--ax-red-t);border-color:var(--ax-red-e);color:var(--ax-red-ink)}
|
|
1717
|
+
.ax-as__empty{color:var(--ax-text-2);font-size:12.5px;line-height:1.5}
|
|
1718
|
+
.ax-as__foot{padding:10px 14px;border-top:var(--ax-border-w) solid var(--ax-border);
|
|
1719
|
+
display:flex;gap:8px;align-items:flex-end}
|
|
1720
|
+
.ax-as__foot textarea{flex:1;resize:none;font:inherit;font-size:13px;padding:8px 10px;
|
|
1721
|
+
min-height:38px;max-height:140px;border-radius:var(--ax-radius-sm);
|
|
1722
|
+
border:var(--ax-border-w) solid var(--ax-border-2);background:var(--ax-bg);color:var(--ax-text)}
|
|
1723
|
+
`,ta=`
|
|
1724
|
+
<div class="ax-as-dock" id="ax-as-dock">
|
|
1725
|
+
<button class="ax-as-dock__grip" id="ax-as-bar-toggle" type="button"
|
|
1726
|
+
aria-expanded="true" aria-controls="ax-as-bar" title="Hide the composer"></button>
|
|
1727
|
+
<form class="ax-as-bar" id="ax-as-bar">
|
|
1728
|
+
<input id="ax-as-bar-input" autocomplete="off" placeholder="Ask an agent about this page…" aria-label="Ask an agent about this page">
|
|
1729
|
+
<button class="ax-btn ax-btn--primary ax-btn--sm" type="submit" id="ax-as-bar-send">Ask</button>
|
|
1730
|
+
</form>
|
|
1731
|
+
</div>
|
|
1732
|
+
<button class="ax-as-handle" id="ax-as-handle" aria-expanded="false" aria-controls="ax-as">Ask an agent</button>
|
|
1733
|
+
<aside class="ax-as" id="ax-as" aria-label="Ask an agent" aria-hidden="true">
|
|
1734
|
+
<div class="ax-as__grip" id="ax-as-grip" role="separator" aria-orientation="vertical"
|
|
1735
|
+
tabindex="0" aria-label="Resize panel \u2014 arrow keys adjust"></div>
|
|
1736
|
+
<div class="ax-as__head">
|
|
1737
|
+
<span class="ax-as__title" id="ax-as-title">Ask an agent</span>
|
|
1738
|
+
<button class="ax-as__icon" id="ax-as-hist" title="Past conversations">History</button>
|
|
1739
|
+
<button class="ax-as__icon" id="ax-as-new" title="Start a new conversation">New</button>
|
|
1740
|
+
<button class="ax-as__x" id="ax-as-close" title="Close">×</button>
|
|
1741
|
+
</div>
|
|
1742
|
+
<div class="ax-as__hist" id="ax-as-hist-panel" hidden>
|
|
1743
|
+
<div class="ax-as__hist-empty" id="ax-as-hist-empty">No past conversations yet.</div>
|
|
1744
|
+
<ul class="ax-as__hist-list" id="ax-as-hist-list"></ul>
|
|
1745
|
+
</div>
|
|
1746
|
+
<div class="ax-as__pick">
|
|
1747
|
+
<select id="ax-as-agent" aria-label="Agent"><option value="">Loading agents…</option></select>
|
|
1748
|
+
<select id="ax-as-node" aria-label="Node"><option value="">This node</option></select>
|
|
1749
|
+
</div>
|
|
1750
|
+
<div class="ax-as__ctx" id="ax-as-ctx"></div>
|
|
1751
|
+
<div class="ax-as__log" id="ax-as-log">
|
|
1752
|
+
<p class="ax-as__empty">Ask about what is on this page. What you are looking at — the page, its filters and the rows in view — goes with the question.</p>
|
|
1753
|
+
</div>
|
|
1754
|
+
</aside>`,ra=String.raw`
|
|
1755
|
+
(function(){
|
|
1756
|
+
const $=id=>document.getElementById(id);
|
|
1757
|
+
const panel=$('ax-as'), handle=$('ax-as-handle');
|
|
1758
|
+
if(!panel||!handle)return;
|
|
1759
|
+
const esc=s=>String(s==null?'':s).replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]));
|
|
1760
|
+
let busy=false;
|
|
1761
|
+
|
|
1762
|
+
const WMIN=320,WMAX=760;
|
|
1763
|
+
function setWidth(px){
|
|
1764
|
+
const w=Math.max(WMIN,Math.min(WMAX,Math.round(px)));
|
|
1765
|
+
document.documentElement.style.setProperty('--ax-as-w',w+'px');
|
|
1766
|
+
try{localStorage.setItem('ax-assistant-w',String(w))}catch{}
|
|
1767
|
+
}
|
|
1768
|
+
try{const w=Number(localStorage.getItem('ax-assistant-w'));if(w)setWidth(w)}catch{}
|
|
1769
|
+
|
|
1770
|
+
/* '0' means the operator closed it on purpose; null means they simply have
|
|
1771
|
+
not opened it yet, and auto-open is still welcome. */
|
|
1772
|
+
function userHid(){try{return localStorage.getItem('ax-assistant-open')==='0'}catch{return false}}
|
|
1773
|
+
function open(v){
|
|
1774
|
+
document.body.classList.toggle('ax-as-open',v);
|
|
1775
|
+
panel.classList.toggle('is-open',v);
|
|
1776
|
+
panel.setAttribute('aria-hidden',String(!v));
|
|
1777
|
+
handle.setAttribute('aria-expanded',String(v));
|
|
1778
|
+
try{localStorage.setItem('ax-assistant-open',v?'1':'0')}catch{}
|
|
1779
|
+
if(v)paintCtx();
|
|
1780
|
+
}
|
|
1781
|
+
handle.onclick=()=>open(!panel.classList.contains('is-open'));
|
|
1782
|
+
$('ax-as-close').onclick=()=>open(false);
|
|
1783
|
+
document.addEventListener('keydown',e=>{if(e.key==='Escape'&&panel.classList.contains('is-open'))open(false);});
|
|
1784
|
+
try{if(localStorage.getItem('ax-assistant-open')==='1')open(true)}catch{}
|
|
1785
|
+
|
|
1786
|
+
/* What the agent is told about where you are. Pages publish their own slice;
|
|
1787
|
+
everything else still gets the path, so the question is never contextless. */
|
|
1788
|
+
function pageContext(){
|
|
1789
|
+
const base={path:location.pathname,tab:document.querySelector('.ax-topbar__tab.is-active')?.textContent?.trim()||null};
|
|
1790
|
+
try{ if(typeof window.axPageContext==='function') return {...base,...(window.axPageContext()||{})}; }catch(e){}
|
|
1791
|
+
return base;
|
|
1792
|
+
}
|
|
1793
|
+
function paintCtx(){
|
|
1794
|
+
const c=pageContext();
|
|
1795
|
+
// A page that names itself makes the raw path noise, and tab just
|
|
1796
|
+
// repeats the nav — so drop both when the page supplies its own name.
|
|
1797
|
+
const shownCtx={...c};
|
|
1798
|
+
if(shownCtx.page){delete shownCtx.path;delete shownCtx.tab;}
|
|
1799
|
+
const bits=Object.entries(shownCtx).filter(([k,v])=>v!=null&&v!=='').slice(0,4)
|
|
1800
|
+
.map(([k,v])=>'<code>'+esc(k)+'='+esc(typeof v==='object'?(Array.isArray(v)?v.length+' items':JSON.stringify(v).slice(0,28)):v)+'</code>');
|
|
1801
|
+
$('ax-as-ctx').innerHTML='Sending with your question: '+(bits.join(' ')||'<code>this page</code>');
|
|
1802
|
+
}
|
|
1803
|
+
|
|
1804
|
+
/* A one-off line in the log, for errors raised before a thread exists. */
|
|
1805
|
+
function add(kind,text){
|
|
1806
|
+
const log=$('ax-as-log');
|
|
1807
|
+
const empty=log.querySelector('.ax-as__empty'); if(empty)empty.remove();
|
|
1808
|
+
const el=document.createElement('div');
|
|
1809
|
+
el.className='ax-as__msg ax-as__msg--'+kind;
|
|
1810
|
+
el.textContent=text;
|
|
1811
|
+
log.appendChild(el); log.scrollTop=log.scrollHeight;
|
|
1812
|
+
return el;
|
|
1813
|
+
}
|
|
1814
|
+
|
|
1815
|
+
/* Who can answer, and where. Both pickers degrade to a plain statement
|
|
1816
|
+
rather than an empty dropdown that looks like it is still loading. */
|
|
1817
|
+
fetch('/api/agents').then(r=>r.json()).then(d=>{
|
|
1818
|
+
const list=(Array.isArray(d)?d:(d.agents||[])).map(a=>a.id||a.name).filter(Boolean);
|
|
1819
|
+
$('ax-as-agent').innerHTML=list.length
|
|
1820
|
+
?list.map(a=>'<option value="'+esc(a)+'">'+esc(a)+'</option>').join('')
|
|
1821
|
+
:'<option value="">no agents on this node</option>';
|
|
1822
|
+
}).catch(()=>{$('ax-as-agent').innerHTML='<option value="">agents unavailable</option>';});
|
|
1823
|
+
|
|
1824
|
+
fetch('/api/monitor').then(r=>r.json()).then(d=>{
|
|
1825
|
+
const ns=(d.nodes||[]).filter(n=>n.ok);
|
|
1826
|
+
if(ns.length>1)$('ax-as-node').innerHTML=ns.map(n=>'<option value="'+esc(n.url)+'">'+esc(n.name)+'</option>').join('');
|
|
1827
|
+
}).catch(()=>{});
|
|
1828
|
+
|
|
1829
|
+
/* --- Conversation state ---------------------------------------------------
|
|
1830
|
+
The thread lives on the daemon; the page only remembers which one it was
|
|
1831
|
+
looking at. That is what survives a navigation: a turn started here keeps
|
|
1832
|
+
running even after this page is gone, and the answer is waiting in the
|
|
1833
|
+
thread when you come back. */
|
|
1834
|
+
let threadId=null, poll=null;
|
|
1835
|
+
try{threadId=localStorage.getItem('ax-assistant-thread')||null}catch{}
|
|
1836
|
+
function setThread(id){
|
|
1837
|
+
threadId=id;
|
|
1838
|
+
try{id?localStorage.setItem('ax-assistant-thread',id):localStorage.removeItem('ax-assistant-thread')}catch{}
|
|
1839
|
+
}
|
|
1840
|
+
|
|
1841
|
+
function bubble(m){
|
|
1842
|
+
const el=document.createElement('div');
|
|
1843
|
+
const kind=m.role==='user'?'me':(m.status==='error'?'err':'them');
|
|
1844
|
+
el.className='ax-as__msg ax-as__msg--'+kind+(m.status==='pending'?' ax-as__pending':'');
|
|
1845
|
+
if(m.status==='pending'){el.textContent='Thinking…';return el;}
|
|
1846
|
+
const body=m.content||'(no reply)';
|
|
1847
|
+
// The reply is markdown. markdownToHtml escapes before it marks up, which
|
|
1848
|
+
// matters here: this text came from a model, not from us.
|
|
1849
|
+
if(m.role==='assistant'&&m.status==='done'&&typeof markdownToHtml==='function'){
|
|
1850
|
+
el.classList.add('ax-as__md');
|
|
1851
|
+
try{el.innerHTML=markdownToHtml(body);}catch(e){el.textContent=body;}
|
|
1852
|
+
}else el.textContent=body;
|
|
1853
|
+
return el;
|
|
1854
|
+
}
|
|
1855
|
+
function renderMessages(msgs){
|
|
1856
|
+
const log=$('ax-as-log');
|
|
1857
|
+
log.innerHTML='';
|
|
1858
|
+
if(!msgs.length){
|
|
1859
|
+
log.innerHTML='<p class="ax-as__empty">Ask about what is on this page. What you are looking at — the page, its filters and the rows in view — goes with the question.</p>';
|
|
1860
|
+
return;
|
|
1861
|
+
}
|
|
1862
|
+
for(const m of msgs)log.appendChild(bubble(m));
|
|
1863
|
+
log.scrollTop=log.scrollHeight;
|
|
1864
|
+
}
|
|
1865
|
+
|
|
1866
|
+
async function loadThread(id,{quiet}={}){
|
|
1867
|
+
if(!id){renderMessages([]);$('ax-as-title').textContent='Ask an agent';return;}
|
|
1868
|
+
try{
|
|
1869
|
+
const r=await fetch('/api/assistant/thread?id='+encodeURIComponent(id));
|
|
1870
|
+
if(!r.ok){setThread(null);renderMessages([]);return;}
|
|
1871
|
+
const d=await r.json();
|
|
1872
|
+
$('ax-as-title').textContent=d.thread.title||'Ask an agent';
|
|
1873
|
+
if(d.thread.agentId)$('ax-as-agent').value=d.thread.agentId;
|
|
1874
|
+
renderMessages(d.messages||[]);
|
|
1875
|
+
const pending=(d.messages||[]).some(m=>m.status==='pending');
|
|
1876
|
+
clearTimeout(poll);
|
|
1877
|
+
if(pending)poll=setTimeout(()=>loadThread(id,{quiet:true}),1500);
|
|
1878
|
+
else if(!quiet)loadHistory();
|
|
1879
|
+
}catch(e){}
|
|
1880
|
+
}
|
|
1881
|
+
|
|
1882
|
+
async function loadHistory(){
|
|
1883
|
+
try{
|
|
1884
|
+
const r=await fetch('/api/assistant/threads');
|
|
1885
|
+
const d=await r.json();
|
|
1886
|
+
const list=d.threads||[];
|
|
1887
|
+
$('ax-as-hist-empty').hidden=list.length>0;
|
|
1888
|
+
$('ax-as-hist-list').innerHTML=list.map(t=>
|
|
1889
|
+
'<li data-thread="'+esc(t.id)+'"'+(t.id===threadId?' class="is-on"':'')+'>'
|
|
1890
|
+
+'<span class="ax-as__hist-t">'+esc(t.title)+'</span>'
|
|
1891
|
+
+'<span class="ax-as__hist-m">'+esc(t.agentId)+'</span>'
|
|
1892
|
+
+'<button class="ax-as__hist-x" data-del="'+esc(t.id)+'" title="Delete">×</button></li>').join('');
|
|
1893
|
+
}catch(e){}
|
|
1894
|
+
}
|
|
1895
|
+
|
|
1896
|
+
$('ax-as-hist').onclick=()=>{
|
|
1897
|
+
const panel2=$('ax-as-hist-panel');
|
|
1898
|
+
const show=panel2.hidden;
|
|
1899
|
+
panel2.hidden=!show;
|
|
1900
|
+
$('ax-as-hist').classList.toggle('is-on',show);
|
|
1901
|
+
if(show)loadHistory();
|
|
1902
|
+
};
|
|
1903
|
+
$('ax-as-new').onclick=()=>{
|
|
1904
|
+
setThread(null);renderMessages([]);$('ax-as-title').textContent='Ask an agent';
|
|
1905
|
+
$('ax-as-hist-panel').hidden=true;$('ax-as-hist').classList.remove('is-on');
|
|
1906
|
+
$('ax-as-bar-input').focus();
|
|
1907
|
+
};
|
|
1908
|
+
$('ax-as-hist-list').addEventListener('click',async e=>{
|
|
1909
|
+
const del=e.target.closest('[data-del]');
|
|
1910
|
+
if(del){e.stopPropagation();
|
|
1911
|
+
await fetch('/api/assistant/delete',{method:'POST',headers:{'Content-Type':'application/json'},
|
|
1912
|
+
body:JSON.stringify({threadId:del.dataset.del})});
|
|
1913
|
+
if(del.dataset.del===threadId){setThread(null);renderMessages([]);}
|
|
1914
|
+
loadHistory();return;}
|
|
1915
|
+
const li=e.target.closest('[data-thread]');
|
|
1916
|
+
if(!li)return;
|
|
1917
|
+
setThread(li.dataset.thread);
|
|
1918
|
+
$('ax-as-hist-panel').hidden=true;$('ax-as-hist').classList.remove('is-on');
|
|
1919
|
+
loadThread(threadId);loadHistory();
|
|
1920
|
+
});
|
|
1921
|
+
|
|
1922
|
+
async function send(){
|
|
1923
|
+
const input=$('ax-as-bar-input'); const text=input.value.trim();
|
|
1924
|
+
if(!text||busy)return;
|
|
1925
|
+
const agent=$('ax-as-agent').value;
|
|
1926
|
+
if(!agent&&!threadId){add('err','Pick an agent first.');return;}
|
|
1927
|
+
busy=true; $('ax-as-bar-send').disabled=true;
|
|
1928
|
+
input.value='';
|
|
1929
|
+
try{
|
|
1930
|
+
const r=await fetch('/api/assistant',{method:'POST',headers:{'Content-Type':'application/json'},
|
|
1931
|
+
body:JSON.stringify({threadId:threadId||undefined,agentId:agent,node:$('ax-as-node').value||undefined,
|
|
1932
|
+
message:text,context:pageContext()})});
|
|
1933
|
+
const d=await r.json();
|
|
1934
|
+
if(!r.ok||d.error)throw new Error(d.error||('HTTP '+r.status));
|
|
1935
|
+
setThread(d.threadId);
|
|
1936
|
+
await loadThread(d.threadId);
|
|
1937
|
+
}catch(e){add('err',e.message);}
|
|
1938
|
+
finally{busy=false;$('ax-as-bar-send').disabled=false;input.focus();}
|
|
1939
|
+
}
|
|
1940
|
+
|
|
1941
|
+
/* The floating bar is the fast path: type from anywhere on the page, and the
|
|
1942
|
+
drawer opens to show the answer arriving. It shares one send(), so a
|
|
1943
|
+
question asked here continues the same conversation as one asked there. */
|
|
1944
|
+
$('ax-as-bar').addEventListener('submit',e=>{e.preventDefault();open(true);send();});
|
|
1945
|
+
|
|
1946
|
+
/* Focusing the composer is a statement of intent: show the conversation it
|
|
1947
|
+
belongs to — unless the operator has deliberately closed the drawer, in
|
|
1948
|
+
which case reopening it under them is the opposite of helpful. */
|
|
1949
|
+
$('ax-as-bar-input').addEventListener('focus',()=>{if(!userHid())open(true);});
|
|
1950
|
+
|
|
1951
|
+
/* Tuck the whole dock away, and remember it. */
|
|
1952
|
+
const dock=$('ax-as-dock');
|
|
1953
|
+
function tuck(v){
|
|
1954
|
+
dock.classList.toggle('is-tucked',v);
|
|
1955
|
+
$('ax-as-bar-toggle').setAttribute('aria-expanded',String(!v));
|
|
1956
|
+
$('ax-as-bar-toggle').title=v?'Show the composer':'Hide the composer';
|
|
1957
|
+
try{localStorage.setItem('ax-assistant-bar',v?'0':'1')}catch{}
|
|
1958
|
+
}
|
|
1959
|
+
$('ax-as-bar-toggle').onclick=()=>tuck(!dock.classList.contains('is-tucked'));
|
|
1960
|
+
try{if(localStorage.getItem('ax-assistant-bar')==='0')tuck(true)}catch{}
|
|
1961
|
+
|
|
1962
|
+
/* Restore whatever was in flight when the last page unloaded, and surface it:
|
|
1963
|
+
an answer landing while you are on another page is the whole point. */
|
|
1964
|
+
loadThread(threadId).then(()=>{
|
|
1965
|
+
if(threadId&&!userHid()&&$('ax-as-log').querySelector('.ax-as__pending'))open(true);
|
|
1966
|
+
});
|
|
1967
|
+
loadHistory();
|
|
1968
|
+
})();
|
|
1969
|
+
`;function na(e){return"globalThis.__axBind=globalThis.__axBind||((n,f)=>{globalThis[f.name]=f;globalThis[n]=f;return f});"+Object.entries(e).map(([t,r])=>`const ${t}=globalThis.__axBind(${JSON.stringify(t)},${r.toString()});`).join("")}function be(e){let a=`${fe}
|
|
1970
|
+
${he}
|
|
1971
|
+
${Be}
|
|
1972
|
+
${aa}${e.css?`
|
|
1973
|
+
`+e.css:""}`,t=e.customHeader??(e.activeTab==="custom"?"":Fe({activeTab:e.activeTab,subtitle:e.subtitle,subheader:e.subheader,peers:e.peers,currentPeerId:e.currentPeerId})),r=e.noMain?e.body:`<main>${e.body}</main>`;return`<!DOCTYPE html>
|
|
1974
|
+
<html lang="en">
|
|
1975
|
+
<head>
|
|
1976
|
+
<meta charset="utf-8">
|
|
1977
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
1978
|
+
<title>${Qa(e.title)}</title>
|
|
1979
|
+
${We}
|
|
1980
|
+
${e.headExtras||""}
|
|
1981
|
+
<style>${a}</style>
|
|
1982
|
+
</head>
|
|
1983
|
+
<body>
|
|
1984
|
+
${t}
|
|
1985
|
+
${r}
|
|
1986
|
+
${e.noAssistant?"":ta}
|
|
1987
|
+
${Ue}
|
|
1988
|
+
${e.scripts||""}
|
|
1989
|
+
${e.noAssistant?"":`<script>${na({markdownToHtml:X})}${ra}</script>`}
|
|
1990
|
+
</body>
|
|
1991
|
+
</html>`}function Qa(e){return String(e||"").replace(/[<>&]/g,a=>({"<":"<",">":">","&":"&"})[a])}function Z(e,a={}){let t=["ax-btn",a.primary?"ax-btn--primary":"",a.ghost?"ax-btn--ghost":"",a.danger?"ax-btn--danger":"",a.extraClass||""].filter(Boolean).join(" ");return`<button ${[`type="${a.type||"button"}"`,`class="${t}"`,a.id?`id="${_(a.id)}"`:"",a.disabled?"disabled":"",a.onclick?`onclick="${_(a.onclick)}"`:""].filter(Boolean).join(" ")}>${_(e)}</button>`}function z(e){let a=`<label>${_(e.label)}${e.hint?` <span class="ax-hint">${e.hint}</span>`:""}</label>`,t="",r=[`name="${_(e.name)}"`,e.required?"required":"",e.readonly?"readonly":"",e.placeholder?`placeholder="${_(e.placeholder)}"`:"",e.extraAttrs||""].filter(Boolean).join(" ");if(e.type==="textarea")t=`<textarea ${r} rows="${e.rows||3}">${_(e.value||"")}</textarea>`;else if(e.type==="select"&&e.options){let n=e.options.map(o=>`<option value="${_(o.value)}"${o.selected?" selected":""}>${_(o.label)}</option>`).join("");t=`<select ${r}>${n}</select>`}else t=`<input type="${e.type||"text"}" ${r}`+(e.value!==void 0?` value="${_(e.value)}"`:"")+(e.pattern?` pattern="${_(e.pattern)}"`:"")+" />";return`<div class="ax-field">${a}${t}</div>`}function ee(e){return`<div class="ax-row">${e.join("")}</div>`}function W(e,a,t){return`<section class="ax-step">
|
|
1992
|
+
<div class="ax-step__head"><span class="ax-step__num">${_(String(e))}</span>${_(a)}</div>
|
|
1993
|
+
${t}
|
|
1994
|
+
</section>`}function Za(e){return`<div class="ax-page-head">
|
|
1995
|
+
${e.kicker?`<div class="ax-kicker">${_(e.kicker)}</div>`:""}
|
|
1996
|
+
<h1>${_(e.title)}</h1>
|
|
1997
|
+
${e.lead?`<p class="ax-lead">${e.lead}</p>`:""}
|
|
1998
|
+
</div>`}function oa(e){return`<div class="ax-health-card">
|
|
1999
|
+
<div class="ax-hc-dot ax-hc-dot--${e.kind||"off"}"></div>
|
|
2000
|
+
<div class="ax-hc-txt">
|
|
2001
|
+
<div class="ax-hc-num">${_(e.num)}</div>
|
|
2002
|
+
<div class="ax-hc-lbl">${_(e.label)}</div>
|
|
2003
|
+
</div>
|
|
2004
|
+
</div>`}function et(e){return`<div class="ax-health-strip">${e.map(oa).join("")}</div>`}function at(e){return`<div class="ax-wit"${e.persistKey?` data-wit="${_(e.persistKey)}"`:""}>
|
|
2005
|
+
<span class="ax-wit__icon">${_(e.icon||"?")}</span>
|
|
2006
|
+
<div>${e.bodyHtml}</div>
|
|
2007
|
+
<button class="ax-wit__dismiss" onclick="this.parentElement.style.display='none'">\xD7</button>
|
|
2008
|
+
</div>`}function tt(e){return`<div class="ax-section-head">
|
|
2009
|
+
<div class="ax-section-head__icon">${e.icon}</div>
|
|
2010
|
+
<div class="ax-section-head__text">
|
|
2011
|
+
<h2>${_(e.title)}</h2>
|
|
2012
|
+
${e.lead?`<p class="ax-lead">${_(e.lead)}</p>`:""}
|
|
2013
|
+
</div>
|
|
2014
|
+
${e.actionHtml||""}
|
|
2015
|
+
</div>`}function rt(e){return`<div class="ax-sec-label"><h3>${_(e.label)}</h3>${e.rightHtml||""}</div>`}var nt=`<div class="ax-toast" id="ax-toast">
|
|
2016
|
+
<svg class="ax-toast__icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M20 6L9 17l-5-5"/></svg>
|
|
2017
|
+
<span id="ax-toast-msg">Copied</span>
|
|
2018
|
+
</div>`,ot=`
|
|
2019
|
+
let __axToastTimer;
|
|
2020
|
+
window.showToast = function(msg) {
|
|
2021
|
+
const el = document.getElementById('ax-toast');
|
|
2022
|
+
const m = document.getElementById('ax-toast-msg');
|
|
2023
|
+
if (!el || !m) return;
|
|
2024
|
+
m.textContent = msg;
|
|
2025
|
+
el.classList.add('is-show');
|
|
2026
|
+
clearTimeout(__axToastTimer);
|
|
2027
|
+
__axToastTimer = setTimeout(function(){ el.classList.remove('is-show'); }, 1800);
|
|
2028
|
+
};
|
|
2029
|
+
window.copyText = function(_btn, text) {
|
|
2030
|
+
try { navigator.clipboard.writeText(text); } catch (e) {}
|
|
2031
|
+
window.showToast('Copied to clipboard');
|
|
2032
|
+
};`,it=`
|
|
2033
|
+
window.toggleCard = function(btn) {
|
|
2034
|
+
const card = btn.closest('.ax-row-card');
|
|
2035
|
+
if (card) card.classList.toggle('is-open');
|
|
2036
|
+
};`;function ia(e,a){let t=e.configExists?e.agentCount===0?"Add your first agent":"Add another agent":"Set up your team",r=`<header class="ax-topbar">
|
|
2037
|
+
<div class="ax-topbar__left">
|
|
2038
|
+
<div class="ax-brand">
|
|
2039
|
+
<span class="ax-brand__mark">AX</span>
|
|
2040
|
+
<span class="ax-brand__name">AgentX</span>
|
|
2041
|
+
<span class="ax-brand__subtitle">Setup</span>
|
|
2042
|
+
</div>
|
|
2043
|
+
</div>
|
|
2044
|
+
<div class="ax-topbar__right">
|
|
2045
|
+
<a href="/wall#page=live" class="ax-skip">Skip \u2014 open dashboard</a>
|
|
2046
|
+
<div class="ax-theme-switch" role="tablist" aria-label="Theme">
|
|
2047
|
+
<button data-theme-opt="dark">Dark</button>
|
|
2048
|
+
<button data-theme-opt="light">Light</button>
|
|
2049
|
+
</div>
|
|
2050
|
+
</div>
|
|
2051
|
+
</header>`,n=W(1,"Team basics",z({name:"nodeName",label:"Team name",hint:"(what you'd call this AgentX install)",value:a,placeholder:"My Team",required:!0})),o=W(2,"First agent",ee([z({name:"agentName",label:"Agent name",value:"Assistant",placeholder:"Support Bot",required:!0}),z({name:"agentId",label:"Agent id",hint:"(lowercase, no spaces)",value:"assistant",pattern:"[a-z0-9][a-z0-9_-]*",required:!0})])+z({name:"triggerWords",label:"Trigger words",hint:"(comma or space separated \u2014 e.g. <code>@support, support</code>)",value:"@assistant, assistant",required:!0})+ee([z({name:"tier",label:"AI engine",type:"select",options:[{value:"claude-code",label:"Claude Code (recommended)",selected:!0},{value:"codex-cli",label:"Codex CLI"},{value:"opencode",label:"OpenCode CLI"},{value:"sdk",label:"Anthropic API (BYO key)"},{value:"orchestrator",label:"Orchestrator (any provider)"}]}),z({name:"model",label:"Model",hint:"(optional)",value:"claude-sonnet-4-6",placeholder:"claude-sonnet-4-6"})])+z({name:"personality",label:"Personality / instructions",hint:"(optional \u2014 what this agent does, in plain English)",type:"textarea",placeholder:"You are a support agent for Acme Co. Answer customer questions about our product, be friendly, keep replies short."})),i=W(3,"First channel",`
|
|
2052
|
+
<label class="ax-toggle"><input type="checkbox" id="enableTelegram" /> Connect Telegram now</label>
|
|
2053
|
+
<div class="ax-optional" id="telegramFields">
|
|
2054
|
+
${z({name:"telegramAccountId",label:"Account id",hint:"(a label you choose \u2014 e.g. <code>support</code>)",value:"default"})}
|
|
2055
|
+
${z({name:"telegramBotToken",label:"Bot token",hint:'(from <a href="https://t.me/BotFather" target="_blank">@BotFather</a>)',placeholder:"123456:ABCdef..."})}
|
|
2056
|
+
${z({name:"telegramBotUsername",label:"Bot username",hint:"(optional \u2014 e.g. <code>my_support_bot</code>)",placeholder:"my_support_bot"})}
|
|
2057
|
+
</div>
|
|
2058
|
+
`),s=W(4,"Anthropic API key",z({name:"anthropicApiKey",label:"API key",hint:"(optional \u2014 skip if you're using Claude Code)",type:"password",placeholder:"sk-ant-\u2026",extraAttrs:'autocomplete="off"'})+`<div class="ax-hint-block">
|
|
2059
|
+
The key is stored in <code>.env</code> as <code>ANTHROPIC_API_KEY</code> and used to authenticate requests to Anthropic. Keep it private.
|
|
2060
|
+
</div>`),d=e.configExists?`<div class="ax-banner">Existing install: <b>${e.agentCount}</b> agent(s), <b>${e.channelCount}</b> channel(s) already configured. This wizard will add to it.</div>`:"",l=`<div class="ax-wizard">
|
|
2061
|
+
<h1 class="ax-wizard__h1">${_(t)}</h1>
|
|
2062
|
+
<p class="ax-wizard__lead">Fill in the basics below. We'll write <code>agentx.json</code>, set up a folder for your first agent, and point you at the next step.</p>
|
|
2063
|
+
|
|
2064
|
+
${d}
|
|
2065
|
+
|
|
2066
|
+
<div id="msg" class="ax-msg"></div>
|
|
2067
|
+
|
|
2068
|
+
<form id="wizard" autocomplete="off">
|
|
2069
|
+
${n}
|
|
2070
|
+
${o}
|
|
2071
|
+
${i}
|
|
2072
|
+
${s}
|
|
2073
|
+
<footer class="ax-actions">
|
|
2074
|
+
${Z("Save and continue",{type:"submit",primary:!0,id:"submitBtn"})}
|
|
2075
|
+
${Z("Skip, I'll do it later",{onclick:"window.location.href='/wall#page=live'"})}
|
|
2076
|
+
</footer>
|
|
2077
|
+
</form>
|
|
2078
|
+
</div>`;return be({title:"AgentX \u2014 Setup",activeTab:"custom",subtitle:"Setup",customHeader:r,noMain:!0,body:l,css:st,scripts:dt})}var st=`
|
|
2079
|
+
/* Pre-dashboard topbar variant \u2014 no tab nav, the pills are the only chrome. */
|
|
2080
|
+
.ax-topbar__right a.ax-skip {
|
|
2081
|
+
padding: 4px 10px; border: 1px solid var(--ax-border-2); border-radius: 4px;
|
|
2082
|
+
color: var(--ax-text-2); font-size: var(--ax-fs-xs); text-decoration: none;
|
|
2083
|
+
}
|
|
2084
|
+
.ax-topbar__right a.ax-skip:hover { color: var(--ax-accent); border-color: var(--ax-accent); }
|
|
2085
|
+
|
|
2086
|
+
/* Wizard frame */
|
|
2087
|
+
.ax-wizard { max-width: 680px; margin: 0 auto; padding: 36px 22px 80px; }
|
|
2088
|
+
.ax-wizard__h1 { font-size: 22px; font-weight: 600; margin: 0 0 4px; letter-spacing: -0.015em; }
|
|
2089
|
+
.ax-wizard__lead { color: var(--ax-muted); margin: 0 0 24px; font-size: var(--ax-fs); line-height: 1.55; }
|
|
2090
|
+
.ax-wizard__lead code { background: var(--ax-surface-2); padding: 1px 6px; border-radius: 3px; color: var(--ax-text); font-size: var(--ax-fs-sm); }
|
|
2091
|
+
|
|
2092
|
+
/* Info banner ("You already have N agents\u2026") */
|
|
2093
|
+
.ax-banner {
|
|
2094
|
+
background: color-mix(in oklch, var(--ax-accent) 10%, var(--ax-bg-elev));
|
|
2095
|
+
border: 1px solid color-mix(in oklch, var(--ax-accent) 30%, var(--ax-border-2));
|
|
2096
|
+
border-radius: var(--ax-radius);
|
|
2097
|
+
padding: 10px 14px; margin-bottom: 18px;
|
|
2098
|
+
color: var(--ax-text-2); font-size: var(--ax-fs-sm);
|
|
2099
|
+
}
|
|
2100
|
+
.ax-banner b { color: var(--ax-text); font-weight: 600; }
|
|
2101
|
+
|
|
2102
|
+
/* "Connect Telegram now" toggle + collapsible fields */
|
|
2103
|
+
.ax-toggle { display: flex; align-items: center; gap: 8px; margin: 4px 0 6px; font-size: var(--ax-fs); color: var(--ax-text); cursor: pointer; user-select: none; }
|
|
2104
|
+
.ax-toggle input { width: auto; accent-color: var(--ax-accent); }
|
|
2105
|
+
.ax-optional { border-left: 2px solid var(--ax-border-2); padding-left: 14px; margin-top: 10px; display: none; }
|
|
2106
|
+
.ax-optional.is-show { display: block; }
|
|
2107
|
+
.ax-hint-block { font-size: var(--ax-fs-xs); color: var(--ax-muted); margin-top: 8px; line-height: 1.55; }
|
|
2108
|
+
.ax-hint-block code { background: var(--ax-surface-2); padding: 1px 6px; border-radius: 3px; color: var(--ax-text); font-family: var(--ax-mono); font-size: var(--ax-fs-xs); }
|
|
2109
|
+
|
|
2110
|
+
/* Form footer */
|
|
2111
|
+
.ax-actions {
|
|
2112
|
+
display: flex; gap: 10px; padding: 20px 0 0; align-items: center;
|
|
2113
|
+
border-top: 1px solid var(--ax-border); margin-top: 20px;
|
|
2114
|
+
}
|
|
2115
|
+
|
|
2116
|
+
/* Server-response messaging (success / error blocks) */
|
|
2117
|
+
.ax-msg { margin: 14px 0; padding: 12px 16px; border-radius: var(--ax-radius); font-size: var(--ax-fs); display: none; }
|
|
2118
|
+
.ax-msg.is-ok {
|
|
2119
|
+
display: block;
|
|
2120
|
+
background: color-mix(in oklch, var(--ax-accent) 12%, transparent);
|
|
2121
|
+
color: var(--ax-accent);
|
|
2122
|
+
border: 1px solid color-mix(in oklch, var(--ax-accent) 40%, transparent);
|
|
2123
|
+
}
|
|
2124
|
+
.ax-msg.is-err {
|
|
2125
|
+
display: block;
|
|
2126
|
+
background: color-mix(in oklch, var(--ax-err) 12%, transparent);
|
|
2127
|
+
color: var(--ax-err);
|
|
2128
|
+
border: 1px solid color-mix(in oklch, var(--ax-err) 40%, transparent);
|
|
2129
|
+
}
|
|
2130
|
+
.ax-next-steps { margin-top: 12px; padding-left: 20px; color: var(--ax-text-2); }
|
|
2131
|
+
.ax-next-steps li { margin: 4px 0; }
|
|
2132
|
+
.ax-next-steps code { background: var(--ax-surface-2); padding: 1px 6px; border-radius: 3px; color: var(--ax-text); font-family: var(--ax-mono); font-size: var(--ax-fs-sm); }
|
|
2133
|
+
.ax-startd { margin-top: 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
|
|
2134
|
+
.ax-startd__status { color: var(--ax-text-2); font-size: var(--ax-fs-sm); }
|
|
2135
|
+
.ax-startd__status a { color: var(--ax-accent); }`,dt=`<script>
|
|
2136
|
+
document.getElementById('enableTelegram').addEventListener('change', (e) => {
|
|
2137
|
+
document.getElementById('telegramFields').classList.toggle('is-show', e.target.checked);
|
|
2138
|
+
});
|
|
2139
|
+
document.getElementById('wizard').addEventListener('submit', async (e) => {
|
|
2140
|
+
e.preventDefault();
|
|
2141
|
+
const f = e.target;
|
|
2142
|
+
const msg = document.getElementById('msg');
|
|
2143
|
+
const btn = document.getElementById('submitBtn');
|
|
2144
|
+
msg.className = 'ax-msg'; msg.style.display = 'none';
|
|
2145
|
+
btn.disabled = true; btn.textContent = 'Saving\u2026';
|
|
2146
|
+
const telegramEnabled = document.getElementById('enableTelegram').checked;
|
|
2147
|
+
const payload = {
|
|
2148
|
+
nodeName: f.nodeName.value.trim(),
|
|
2149
|
+
agent: {
|
|
2150
|
+
id: f.agentId.value.trim(),
|
|
2151
|
+
name: f.agentName.value.trim(),
|
|
2152
|
+
triggerWords: f.triggerWords.value.trim(),
|
|
2153
|
+
tier: f.tier.value,
|
|
2154
|
+
model: f.model.value.trim() || undefined,
|
|
2155
|
+
personality: f.personality.value.trim() || undefined,
|
|
2156
|
+
},
|
|
2157
|
+
anthropicApiKey: f.anthropicApiKey.value.trim() || undefined,
|
|
2158
|
+
};
|
|
2159
|
+
if (telegramEnabled) {
|
|
2160
|
+
payload.telegram = {
|
|
2161
|
+
accountId: f.telegramAccountId.value.trim() || 'default',
|
|
2162
|
+
botToken: f.telegramBotToken.value.trim(),
|
|
2163
|
+
botUsername: f.telegramBotUsername.value.trim() || undefined,
|
|
2164
|
+
};
|
|
2165
|
+
if (!payload.telegram.botToken) {
|
|
2166
|
+
msg.className = 'ax-msg is-err'; msg.textContent = 'Bot token is required when Telegram is enabled.';
|
|
2167
|
+
btn.disabled = false; btn.textContent = 'Save and continue'; return;
|
|
2168
|
+
}
|
|
2169
|
+
}
|
|
2170
|
+
try {
|
|
2171
|
+
const r = await fetch('/api/setup', {
|
|
2172
|
+
method: 'POST',
|
|
2173
|
+
headers: { 'Content-Type': 'application/json', 'X-Requested-With': 'agentx-wizard' },
|
|
2174
|
+
body: JSON.stringify(payload),
|
|
2175
|
+
});
|
|
2176
|
+
const data = await r.json();
|
|
2177
|
+
if (!r.ok) throw new Error(data.error || ('HTTP ' + r.status));
|
|
2178
|
+
const steps = data.nextSteps.map((s) => '<li>' + s.replace(/\\\`([^\\\`]+)\\\`/g, '<code>$1</code>') + '</li>').join('');
|
|
2179
|
+
msg.className = 'ax-msg is-ok';
|
|
2180
|
+
msg.innerHTML = '<b>' + data.summary + '</b><ol class="ax-next-steps">' + steps + '</ol>'
|
|
2181
|
+
+ '<div class="ax-startd"><button type="button" id="startDaemonBtn" class="ax-btn ax-btn--primary">Start daemon now</button>'
|
|
2182
|
+
+ ' <span id="startDaemonStatus" class="ax-startd__status"></span></div>';
|
|
2183
|
+
btn.textContent = 'Done';
|
|
2184
|
+
btn.disabled = true;
|
|
2185
|
+
document.getElementById('startDaemonBtn').addEventListener('click', async () => {
|
|
2186
|
+
const sb = document.getElementById('startDaemonBtn');
|
|
2187
|
+
const ss = document.getElementById('startDaemonStatus');
|
|
2188
|
+
sb.disabled = true; sb.textContent = 'Starting\u2026'; ss.textContent = '';
|
|
2189
|
+
try {
|
|
2190
|
+
const r = await fetch('/api/setup/start-daemon', { method: 'POST' });
|
|
2191
|
+
const d = await r.json();
|
|
2192
|
+
if (d.ok) {
|
|
2193
|
+
sb.textContent = d.alreadyRunning ? 'Already running' : 'Daemon up';
|
|
2194
|
+
ss.innerHTML = 'Open <a href="' + d.url + '" target="_blank" rel="noopener">' + d.url + '</a>';
|
|
2195
|
+
} else {
|
|
2196
|
+
sb.disabled = false; sb.textContent = 'Try again';
|
|
2197
|
+
ss.textContent = d.error + (d.manualUrl ? ' Manual: ' + d.manualUrl : '');
|
|
2198
|
+
}
|
|
2199
|
+
} catch (e) {
|
|
2200
|
+
sb.disabled = false; sb.textContent = 'Try again';
|
|
2201
|
+
ss.textContent = e.message;
|
|
2202
|
+
}
|
|
2203
|
+
});
|
|
2204
|
+
} catch (err) {
|
|
2205
|
+
msg.className = 'ax-msg is-err'; msg.textContent = err.message;
|
|
2206
|
+
btn.disabled = false; btn.textContent = 'Save and continue';
|
|
2207
|
+
}
|
|
2208
|
+
});
|
|
2209
|
+
</script>`;ce();function ca(e=process.cwd()){let a=M(e,"agentx.json");if(!K(a))return{configExists:!1,agentCount:0,channelCount:0};try{let t=JSON.parse(da(a,"utf-8")),r=t.agents?Object.keys(t.agents).length:0,n=t.channels?Object.values(t.channels).filter(o=>o&&o.enabled).length:0;return{configExists:!0,agentCount:r,channelCount:n,nodeName:t.node?.name}}catch{return{configExists:!1,agentCount:0,channelCount:0}}}function mt(e,a=process.cwd(),t={}){if(!e.nodeName?.trim())throw new Error("Team name is required.");if(!e.agent?.id?.trim())throw new Error("Agent id is required.");if(!/^[a-z0-9][a-z0-9_-]*$/.test(e.agent.id))throw new Error("Agent id must be lowercase (letters, digits, -, _) and start with a letter or digit.");if(!e.agent.name?.trim())throw new Error("Agent name is required.");let r=ft(e.agent.triggerWords);if(r.length===0)throw new Error("At least one trigger word is required.");if(e.agent.tier!=="claude-code"&&e.agent.tier!=="codex-cli"&&e.agent.tier!=="opencode"&&e.agent.tier!=="sdk"&&e.agent.tier!=="orchestrator")throw new Error("AI engine must be claude-code, codex-cli, opencode, sdk, or orchestrator.");let n=M(a,"agentx.json"),o=M(a,".env"),i=M(a,"agents",e.agent.id),s=ca(a);ct(i,{recursive:!0});let d=M(i,"CLAUDE.md");if(!K(d)){let g=e.agent.personality?.trim()||`You are ${e.agent.name}, an assistant on the ${e.nodeName} team.`;la(d,`# ${e.agent.name}
|
|
2210
|
+
|
|
2211
|
+
${g}
|
|
2212
|
+
`)}let l=e.telegram?`TG_${e.agent.id.toUpperCase()}_BOT_TOKEN`:void 0,c;if(s.configExists)c=Q(u=>{if(u.node=u.node||{},u.node.name||(u.node.name=e.nodeName),u.node.id||(u.node.id=pa(e.nodeName)||"team"),u.node.bind||(u.node.bind="127.0.0.1:18800"),u.node.defaultAgent=u.node.defaultAgent||e.agent.id,u.providers=u.providers||{},u.providers.claude||(u.providers.claude={apiKey:"${ANTHROPIC_API_KEY}"}),u.agents=u.agents||{},u.agents[e.agent.id])throw new Error(`Agent "${e.agent.id}" already exists.`);return u.agents[e.agent.id]=xa(e,i,r),e.telegram&&(u.channels=u.channels||{},u.channels.telegram=u.channels.telegram||{enabled:!0,accounts:{},policy:{dm:"pair",group:"mention-required"}},u.channels.telegram.enabled=!0,u.channels.telegram.accounts=u.channels.telegram.accounts||{},u.channels.telegram.accounts[e.telegram.accountId]=ga(e,l)),{summary:`added agent "${e.agent.id}"`+(e.telegram?" + telegram account":"")}},{configPath:n}).backupPath;else{let g=ht(e,i,r,l,t);Ke(g,{configPath:n})}bt(o,e,l);let m=[];return(e.anthropicApiKey||!K(M(a,".env")))&&m.push("Double-check the API keys in .env"),e.agent.tier==="claude-code"&&m.push("Run claude --version to confirm Claude Code is installed (needed for the claude-code engine)"),e.agent.tier==="codex-cli"&&m.push("Run codex --version to confirm Codex CLI is installed (needed for the codex-cli engine)"),e.agent.tier==="opencode"&&m.push("Run opencode --version to confirm OpenCode is installed and authenticated"),m.push("Start the daemon: agentx daemon start"),m.push("Open the dashboard: http://127.0.0.1:4202"),{summary:s.configExists?`Added agent "${e.agent.id}" to your team.`:`Initialized your team with first agent "${e.agent.id}".`,nextSteps:m,backupPath:c}}function ft(e){return(e||"").split(/[,\s]+/).map(a=>a.trim()).filter(Boolean).filter((a,t,r)=>r.indexOf(a)===t)}function pa(e){return(e||"").toLowerCase().replace(/[^a-z0-9-]+/g,"-").replace(/^-+|-+$/g,"")}function ht(e,a,t,r,n={}){let o=pa(e.nodeName)||"team",i=n.daemonPort??18800,s={node:{id:o,name:e.nodeName,bind:`127.0.0.1:${i}`,defaultAgent:e.agent.id},providers:{claude:{apiKey:"${ANTHROPIC_API_KEY}"}},agents:{[e.agent.id]:xa(e,a,t)},channels:{},crons:{},mesh:{enabled:!1,peers:[],discovery:"static",healthCheck:{interval:60,timeout:10}},dashboard:{enabled:!0,port:n.dashboardPort??4202,bind:"127.0.0.1",daemonUrl:`http://localhost:${i}`},boards:[]};return e.telegram&&r?s.channels.telegram={enabled:!0,accounts:{[e.telegram.accountId]:ga(e,r)},policy:{dm:"pair",group:"mention-required"}}:s.channels.telegram={enabled:!1,accounts:{},policy:{dm:"pair",group:"mention-required"}},s}function xa(e,a,t){let r={name:e.agent.name,workspace:a,tier:e.agent.tier,mentions:t,maxConcurrent:2,permissionMode:"default"};return e.agent.model&&(r.model=e.agent.model),e.agent.provider&&(r.provider=e.agent.provider),e.agent.personality?.trim()&&(r.systemPrompt=e.agent.personality.trim().slice(0,400)),r}function ga(e,a){return e.telegram?.botUsername,{token:"${"+a+"}",agentBinding:e.agent.id}}function bt(e,a,t){let r=K(e)?da(e,"utf-8"):"",n=[];if(a.anthropicApiKey&&!r.includes("ANTHROPIC_API_KEY=")&&n.push(`ANTHROPIC_API_KEY=${a.anthropicApiKey}`),a.telegram&&t&&!r.includes(`${t}=`)&&n.push(`${t}=${a.telegram.botToken}`),!K(e)){la(e,[...["# AgentX environment variables","# (Never commit this file \u2014 it contains secrets.)",""],...n,""].join(`
|
|
2213
|
+
`),{mode:384});return}if(n.length>0){let o=r.endsWith(`
|
|
2214
|
+
`)?"":`
|
|
2215
|
+
`;lt(e,o+n.join(`
|
|
2216
|
+
`)+`
|
|
2217
|
+
`)}}function yn(e,a){let t=ca(),r=t.nodeName||gt().replace(/\.local$/,""),n=ia(t,r);a.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),a.end(n)}async function kn(e,a){let t="";await new Promise(n=>{e.on("data",o=>{t+=o}),e.on("end",()=>n())});let r;try{r=JSON.parse(t)}catch{a.writeHead(400,{"Content-Type":"application/json"}),a.end(JSON.stringify({error:"Invalid JSON"}));return}try{let n=mt(r);a.writeHead(200,{"Content-Type":"application/json"}),a.end(JSON.stringify(n))}catch(n){a.writeHead(400,{"Content-Type":"application/json"}),a.end(JSON.stringify({error:n.message||"wizard failed"}))}}async function _n(e,a){a.setHeader("Content-Type","application/json");let t;try{t=ze().node?.bind||"127.0.0.1:18800"}catch(i){a.writeHead(400),a.end(JSON.stringify({ok:!1,error:`Config validation failed: ${i.message}`}));return}let r=`http://${t.replace(/^0\.0\.0\.0/,"127.0.0.1")}`;if(await sa(r)){a.writeHead(200),a.end(JSON.stringify({ok:!0,url:r,alreadyRunning:!0}));return}let n=process.argv[1]||M(pt(xt(import.meta.url)),"cli.js");try{ut(process.execPath,[n,"daemon","start"],{detached:!0,stdio:"ignore",cwd:process.cwd()}).unref()}catch(i){a.writeHead(500),a.end(JSON.stringify({ok:!1,error:`Failed to spawn daemon: ${i.message}`,manualUrl:r}));return}let o=Date.now()+12e3;for(;Date.now()<o;)if(await new Promise(i=>setTimeout(i,400)),await sa(r)){a.writeHead(200),a.end(JSON.stringify({ok:!0,url:r,alreadyRunning:!1}));return}a.writeHead(504),a.end(JSON.stringify({ok:!1,error:"Daemon spawn succeeded but never bound the port within 12s \u2014 check `agentx daemon status` and the dotfile log for errors.",manualUrl:r}))}async function sa(e){try{let a=await fetch(e,{method:"GET",signal:AbortSignal.timeout(800)});return a.status>0&&a.status<600}catch{return!1}}import{mkdirSync as vt,readFileSync as wt,renameSync as yt,writeFileSync as kt}from"fs";import{dirname as _t,isAbsolute as $t,resolve as St}from"path";import{createHash as At,randomBytes as Ct}from"crypto";var zn=".agentx/app-pins.json",Pn=12,ua=40,ma=2e3,Tt=/^pin_[a-z0-9]{6,32}$/;function It(e,a){return $t(a)?a:St(e,a)}function ae(e){let a=typeof e=="string"?e.trim().replace(/\s+/g," "):"";return a?/[\p{Cc}\p{Cf}]/u.test(a)?{ok:!1,error:"Use only letters, numbers, spaces and punctuation in the name."}:[...a].length>ua?{ok:!1,error:`Keep the name under ${ua} characters.`}:{ok:!0,value:a}:{ok:!1,error:"Give the button a name."}}function we(e){let a=typeof e=="string"?e.trim():"";if(!a)return{ok:!1,error:"Give the page's address."};if(a.length>ma)return{ok:!1,error:`Keep the address under ${ma} characters.`};let t;try{t=new URL(a)}catch{return{ok:!1,error:"That is not a web address. It should start with https://"}}return t.protocol!=="https:"||!t.hostname?{ok:!1,error:"Only https:// pages can be pinned."}:t.username||t.password?{ok:!1,error:"Leave the user name and password out of the address."}:{ok:!0,value:t.href}}function zt(e){return`cfg_${At("sha256").update(e).digest("hex").slice(0,12)}`}function Pt(e){let a=[];for(let t of e){let r=ae(t.label),n=we(t.url);!r.ok||!n.ok||a.some(o=>o.url===n.value||o.label.toLowerCase()===r.value.toLowerCase())||a.push({id:zt(n.value),label:r.value,url:n.value,source:"config"})}return a}var fa="This button is set in agentx.json (app.pins.pages). Change or remove it there.";function Et(e){let a=ae(e.label);if(!a.ok)return a;let t=we(e.url);return t.ok?{ok:!0,value:{label:a.value,url:t.value}}:t}var ve=class{constructor(a,t=Date.now,r=[]){this.path=a;this.now=t;this.fixed=r}list(){return[...this.fixed,...this.load().pins.filter(a=>!this.shadowed(a))]}shadowed(a){return this.fixed.some(t=>t.url===a.url||t.label.toLowerCase()===a.label.toLowerCase())}isFixed(a){return this.fixed.some(t=>t.id===a)}load(){let a;try{a=wt(this.path,"utf-8")}catch(o){return{pins:[],damaged:o?.code!=="ENOENT"}}let t;try{t=JSON.parse(a)}catch{return{pins:[],damaged:!0}}let r=Array.isArray(t?.pins)?t.pins:[],n=r.filter(o=>{let i=o;return!!i&&typeof i.id=="string"&&Tt.test(i.id)&&ae(i.label).ok&&we(i.url).ok});return{pins:n,damaged:!Array.isArray(t?.pins)||n.length!==r.length}}locked(a){try{return Re(this.path,a,{what:"The pinned pages file"})}catch(t){if(t instanceof Ee)return{ok:!1,status:409,error:t.message};throw t}}editable(){let{pins:a,damaged:t}=this.load();return t?{ok:!1,status:409,error:`The pinned pages file (${this.path}) can't be read. Fix or remove it on the computer, then try again.`}:{ok:!0,pins:a}}write(a){vt(_t(this.path),{recursive:!0});let t=`${this.path}.${process.pid}.tmp`;kt(t,JSON.stringify({pins:a},null,2)+`
|
|
2218
|
+
`,{mode:384}),yt(t,this.path)}add(a,t){return this.locked(()=>this.addUnlocked(a,t))}addUnlocked(a,t){let r=this.editable();if(!r.ok)return r;let n=r.pins;if(n.filter(i=>!this.shadowed(i)).length+this.fixed.length>=t)return{ok:!1,status:409,error:`You already have ${t} pinned pages, the most allowed (app.pins.max). Remove one first.`};if([...this.fixed,...n].some(i=>i.label.toLowerCase()===a.label.toLowerCase()))return{ok:!1,status:409,error:`You already have a button called ${a.label}.`};if(this.fixed.some(i=>i.url===a.url))return{ok:!1,status:409,error:"This page is already a button, set in agentx.json (app.pins.pages)."};let o={id:`pin_${Ct(6).toString("hex")}`,...a,createdAt:new Date(this.now()).toISOString()};return n.push(o),this.write(n),{ok:!0,pin:o}}rename(a,t){return this.locked(()=>this.renameUnlocked(a,t))}renameUnlocked(a,t){if(this.isFixed(a))return{ok:!1,status:409,error:fa};let r=this.editable();if(!r.ok)return r;let n=r.pins,o=n.find(i=>i.id===a);return o?[...this.fixed,...n].some(i=>i.id!==a&&i.label.toLowerCase()===t.toLowerCase())?{ok:!1,status:409,error:`You already have a button called ${t}.`}:(o.label=t,this.write(n),{ok:!0,pin:o}):{ok:!1,status:404,error:"No such pinned page."}}remove(a){return this.locked(()=>this.removeUnlocked(a))}removeUnlocked(a){if(this.isFixed(a))return{ok:!1,status:409,error:fa};let t=this.editable();if(!t.ok)return t;let r=t.pins.filter(n=>n.id!==a);return r.length===t.pins.length?{ok:!1,status:404,error:"No such pinned page."}:(this.write(r),{ok:!0})}};function En(e,a){let t=e.app.pins;return{store:new ve(It(a,t.file),Date.now,Pt(t.pages)),max:t.max}}async function Rn(e,a,t,r,n){if(t!=="/api/app/pins"&&!t.startsWith("/api/app/pins/"))return!1;let o=t.slice(13);if(r==="GET"&&o==="")return P(a,200,{pins:n.store.list(),max:n.max});if(r!=="POST")return P(a,404,{error:"not found"});let i;try{i=await V(e,4096)}catch(d){return P(a,400,{error:d.message})}let s=typeof i.id=="string"?i.id:"";if(o==="/add"){let d=Et(i);if(!d.ok)return P(a,400,{error:d.error});let l=n.store.add(d.value,n.max);return l.ok?P(a,200,{ok:!0,pin:l.pin}):P(a,l.status,{error:l.error})}if(o==="/rename"){let d=ae(i.label);if(!d.ok)return P(a,400,{error:d.error});let l=n.store.rename(s,d.value);return l.ok?P(a,200,{ok:!0,pin:l.pin}):P(a,l.status,{error:l.error})}if(o==="/remove"){let d=n.store.remove(s);return d.ok?P(a,200,{ok:!0}):P(a,d.status,{error:d.error})}return P(a,404,{error:"not found"})}function P(e,a,t){return e.writeHead(a,{"Content-Type":"application/json","Cache-Control":"no-store"}),e.end(JSON.stringify(t)),!0}import{existsSync as ha,readFileSync as ba}from"fs";ce();function Rt(e){let a=q(e),t={};if(ha(a))try{t=F(JSON.parse(ba(a,"utf-8")))}catch{t={}}let r=le.safeParse(t?.approvals);return r.success?r.data:le.parse(void 0)}function Nn(e){let a=q(e),t={};if(ha(a))try{t=F(JSON.parse(ba(a,"utf-8")))}catch{t={}}return Le({desk:t?.notifications?.desk,popupEnabled:!!Rt(e).popup?.enabled})}function Ln(e){let a=e.indexOf(":");return a<=0||a===e.length-1?null:{channel:e.slice(0,a).trim(),chatId:e.slice(a+1).trim()}}async function Wn(e,a={}){return J(t=>{let r=t.approvals??={};if(e.defaultExpiryDays!==void 0&&(r.defaultExpiryDays=e.defaultExpiryDays),e.maxExpiryDays!==void 0&&(r.maxExpiryDays=e.maxExpiryDays),e.laterHours!==void 0&&(r.laterHours=e.laterHours),e.notifyAgent!==void 0&&(r.notifyAgent=e.notifyAgent),e.forwardTo===null)delete r.forwardTo;else if(e.forwardTo!==void 0){let l=Array.isArray(t.mesh?.peers)?t.mesh.peers:[];if(!l.some(c=>c.name===e.forwardTo))throw new Error(`"${e.forwardTo}" is not in mesh.peers${l.length?` (known: ${l.map(c=>c.name).join(", ")})`:""}; pair the machines first`);r.forwardTo=e.forwardTo}let n=r.digest??={};e.digestEnabled!==void 0&&(n.enabled=e.digestEnabled),e.digestTime!==void 0&&(n.time=e.digestTime),e.digestTimezone===null?delete n.timezone:e.digestTimezone!==void 0&&(n.timezone=e.digestTimezone),e.destination===null?delete n.destination:e.destination!==void 0&&(n.destination=e.destination);let o=r.popup??={};e.popupEnabled!==void 0&&(o.enabled=e.popupEnabled),e.popupSpeak!==void 0&&(o.speak=e.popupSpeak),e.popupVoice===null?delete o.voice:e.popupVoice!==void 0&&(o.voice=e.popupVoice),e.popupSound!==void 0&&(o.sound=e.popupSound),e.popupTimeoutSeconds!==void 0&&(o.timeoutSeconds=e.popupTimeoutSeconds),e.popupStyle!==void 0&&(o.style=e.popupStyle),e.popupTheme!==void 0&&(o.theme=e.popupTheme);let i=r.checkin??={};if(e.checkinEnabled!==void 0&&(i.enabled=e.checkinEnabled),e.checkinTimes!==void 0&&(i.times=e.checkinTimes),e.checkinDailyAt!==void 0&&(i.dailyAt=e.checkinDailyAt),e.checkinLists!==void 0&&(i.lists=e.checkinLists),e.checkinAgent===null?delete i.agent:e.checkinAgent!==void 0&&(i.agent=e.checkinAgent),e.deskPhone!==void 0||e.deskComputer!==void 0){let l=(t.notifications??={}).desk??={};e.deskPhone!==void 0&&(l.phone=e.deskPhone),e.deskComputer!==void 0&&(l.computer=e.deskComputer)}let s=r.defaultExpiryDays??3,d=r.maxExpiryDays??30;if(s>d)throw new Error(`defaultExpiryDays (${s}) can't be more than maxExpiryDays (${d})`)},{configPath:a.configPath,reload:a.reload})}import{createServer as Lt}from"http";var te=class{peers;cache=new Map;ttl=3e4;constructor(a){this.peers=a.map(t=>({...t,url:t.url.replace(/\/$/,"")}))}async getRemoteAgents(){let a=[];return await Promise.all(this.peers.map(async t=>{try{let r=await this.fetchJson(`${t.url}/wiki/agents`);t.nodeId=r.nodeId;for(let n of r.agents||[])(n.totalEntries>0||n.totalArticles>0)&&a.push({...n,nodeId:r.nodeId,peerUrl:t.url})}catch{}})),a}async getRemoteArticles(a,t){try{return(await this.fetchJson(`${a}/wiki/articles?agent=${encodeURIComponent(t)}`)).articles||[]}catch{return[]}}async getRemoteArticle(a,t,r){try{let n=await this.fetchJson(`${a}/wiki/article?agent=${encodeURIComponent(t)}&path=${encodeURIComponent(r)}`);return{meta:{title:n.title,tags:n.tags||[],owner:n.owner,access:"public",created:n.created,lastUpdated:n.lastUpdated,sources:n.sources||[]},content:n.content,path:n.path}}catch{return null}}async fetchJson(a){let t=this.cache.get(a);if(t&&Date.now()-t.ts<this.ttl)return t.data;let r=this.peers.find(i=>a.startsWith(`${i.url}/`))?.token,n=await fetch(a,{headers:r?{Authorization:`Bearer ${r}`}:{},signal:AbortSignal.timeout(5e3)});if(!n.ok)throw new Error(`HTTP ${n.status}`);let o=await n.json();return this.cache.set(a,{data:o,ts:Date.now()}),o}};var va=864e5;function ye(e){let a=new Map;for(let t of e.entities.values()){let r=a.get(t.type)??[];r.push(t),a.set(t.type,r)}return a}function ke(e,a){if(a.type==="event")return a.date||a.updated;let t=Ge(e,a,new Set(["event"]))[0],r=a.updated||a.date;return t&&t.date>r?t.date:r}function wa(e,a,t=Date.now()){let r=[],n=new Date(t+14*va).toISOString().slice(0,10),o=new Date(t).toISOString().slice(0,10);for(let s of a){let d=s.statements.find(c=>c.property==="due"&&/^\d{4}-\d{2}-\d{2}/.test(c.value)),l=s.statements.some(c=>c.property==="fulfilled_by")||s.statements.some(c=>c.property==="status"&&/^(fulfilled|done|paid|filed)$/i.test(c.value));s.statements.some(c=>c.property==="status"&&/^late$/i.test(c.value))?r.push({e:s,chip:"late",why:"marked late"}):d&&!l&&d.value<o?r.push({e:s,chip:"late",why:`was due ${d.value}`}):d&&!l&&d.value<=n?r.push({e:s,chip:"due",why:`due ${d.value}`}):s.statements.some(c=>c.status==="proposed")?r.push({e:s,chip:"proposed",why:"statements wait for confirmation"}):s.type==="event"&&s.importanceProposed&&s.importanceProposed!==s.importance?r.push({e:s,chip:"proposed",why:`proposed as ${s.importanceProposed}; the owner decides`}):s.type==="event"&&s.importance==="major"&&s.date&&t-Date.parse(s.date)<=30*va&&r.push({e:s,chip:"major",why:`major event ${s.date}`})}let i={late:0,due:1,major:2,proposed:3};return r.sort((s,d)=>i[s.chip]-i[d.chip])}function re(e,a,t="",r){return`<div class="ox-row"><span class="ox-ic">${Xe(e.ontology,a.type)}</span><div class="t"><a href="${ue(a.id)}">${k(a.title)}</a><div class="ox-sub">${k(r??`${ge(e.ontology,a.type).toLowerCase()} \xB7 ${ke(e,a)}`)}</div></div><div class="r">${t}</div></div>`}function ya(e,a){let t=a.slice(0,6).map(r=>re(e,r.e,`<span class="ox-st ${r.chip}">${r.chip}</span>`,r.why)).join("");return`<section class="ox-card"><div class="ox-card-h"><h2>Needs attention</h2><span class="note">${a.length}</span></div>${t||'<div class="ox-empty">Nothing waits on a person.</div>'}</section>`}function Ot(e){return e.length?`<div class="ox-err"><b>ontology.yaml has ${e.length} problem${e.length===1?"":"s"}</b> \u2014 the defaults are used where they apply. <a href="/ontology">See them</a></div>`:""}function ka(e,a){let t=ye(e),r=`<div class="ox-bar">${j([])}</div>`;r+=`<div class="ox-head"><div class="ox-avatar">${D("home")}</div><div><h1>Wiki</h1><p>${e.entities.size} things, merged from every agent's pages and typed by the <a href="/ontology">ontology</a>. <a href="/agents">Agent wikis</a> \xB7 <a href="/entries">raw entries</a></p></div></div>`,r+=Ot(a),r+='<div class="ox-grid3">';for(let o of e.ontology.pillars){let i=e.ontology.types.filter(l=>l.pillar===o.id),s=i.reduce((l,c)=>l+(t.get(c.id)?.length??0),0),d=i.filter(l=>t.get(l.id)?.length).map(l=>`${l.plural??l.label} ${t.get(l.id).length}`).join(" \xB7 ");r+=`<a class="ox-card" href="/p/${encodeURIComponent(o.id)}" style="color:inherit"><div class="ox-card-h"><span class="ox-ic">${D(o.icon)}</span><h2>${k(o.label)}</h2><span class="zin">${s}</span></div><div class="ox-sub" style="white-space:normal">${k(o.description??"")}</div><div class="ox-sub" style="margin-top:6px;white-space:normal">${k(d||"nothing yet")}</div></a>`}r+='</div><div class="ox-grid2">';let n=(t.get("event")??[]).filter(o=>o.importance!=="minor").sort((o,i)=>i.date.localeCompare(o.date)).slice(0,8);return r+='<section class="ox-card"><div class="ox-card-h"><h2>Recent events</h2><span class="note">major and normal</span><a class="zin" href="/p/events">all (Z1) \u2192</a></div>'+(n.map(o=>`<div class="ox-ev"><span class="d">${k(o.date)}</span><span class="ox-st ${o.importance}">${o.importance}</span><a href="${ue(o.id)}">${k(o.title)}</a></div>`).join("")||'<div class="ox-empty">No events yet.</div>')+"</section>",r+=ya(e,wa(e,[...e.entities.values()])),r+="</div>",L("Wiki",N(e,{home:!0}),r)}function _a(e,a,t){let r=e.ontology.pillars.find(c=>c.id===a);if(!r)return null;let n=ye(e),o=e.ontology.types.filter(c=>c.pillar===r.id),i=o.find(c=>c.id===t)??o.find(c=>n.get(c.id)?.length)??o[0],s=`<div class="ox-bar">${j([{label:r.label}])}${me(1)}</div>`;s+=`<div class="ox-head"><div class="ox-avatar">${D(r.icon)}</div><div><h1>${k(r.label)}</h1><p>${k(r.description??"")}</p></div></div>`,s+=`<nav class="ox-tabs">${o.map(c=>`<a class="${c.id===i?.id?"on":""}" href="/p/${encodeURIComponent(r.id)}?kind=${encodeURIComponent(c.id)}">${k(c.plural??c.label)}<small>${n.get(c.id)?.length??0}</small></a>`).join("")}</nav>`;let d=i?(n.get(i.id)??[]).map(c=>({e:c,at:ke(e,c)})).sort((c,m)=>m.at.localeCompare(c.at)):[];s+='<div class="ox-grid2">',s+=`<section class="ox-card"><div class="ox-card-h"><h2>${k(i?.plural??i?.label??"")}</h2><span class="note">${d.length} \xB7 most active first</span>`+(i?`<a class="zin" href="/p/${encodeURIComponent(r.id)}/${encodeURIComponent(i.id)}">open list (Z3) \u2192</a>`:"")+"</div>"+(d.slice(0,5).map(({e:c,at:m})=>re(e,c,c.type==="event"?`<span class="ox-st ${c.importance}">${c.importance}</span>`:"",`${Ve(c,90)||ge(e.ontology,c.type).toLowerCase()} \xB7 ${m}`)).join("")||`<div class="ox-empty">No ${k((i?.plural??"pages").toLowerCase())} yet.</div>`)+"</section>";let l=o.flatMap(c=>n.get(c.id)??[]);return s+=ya(e,wa(e,l)),s+="</div>",L(r.label,N(e,{pillar:r.id}),s)}function $a(e,a,t,r,n){let o=n&&Oe.includes(n)?n:null,i=e.ontology.pillars.find(x=>x.id===a),s=e.ontology.types.find(x=>x.id===t&&x.pillar===a);if(!i||!s)return null;let d=[...e.entities.values()].filter(x=>x.type===s.id);o&&(d=d.filter(x=>x.importance===o));let l=d.map(x=>({e:x,at:ke(e,x)})).sort((x,f)=>f.at.localeCompare(x.at)),c=50,m=Math.max(1,Math.ceil(l.length/c)),g=`/p/${encodeURIComponent(i.id)}/${encodeURIComponent(s.id)}`,u=`<div class="ox-bar">${j([{label:i.label,href:`/p/${encodeURIComponent(i.id)}`},{label:s.plural??s.label}])}${me(3)}</div>`;if(u+=`<div class="ox-head"><div class="ox-avatar">${D(s.icon)}</div><div><h1>${k(s.plural??s.label)}</h1><p>${l.length} page${l.length===1?"":"s"}${o?` \xB7 ${k(o)} only`:""}</p></div></div>`,s.id==="event"&&(u+=`<nav class="ox-tabs">${["","major","normal","minor"].map(x=>`<a class="${(o??"")===x?"on":""}" href="${g}${x?`?importance=${x}`:""}">${x||"all"}</a>`).join("")}</nav>`),u+='<section class="ox-card" style="margin-top:16px">'+(l.slice((r-1)*c,r*c).map(({e:x,at:f})=>re(e,x,x.type==="event"?`<span class="ox-st ${x.importance}">${x.importance}</span>`:"",`${f} \xB7 ${x.pages.map(C=>C.agentId).filter((C,w,v)=>v.indexOf(C)===w).join(", ")}`)).join("")||'<div class="ox-empty">None.</div>')+"</section>",m>1){let x=o?`importance=${o}&`:"";u+=`<div class="ox-pager">${r>1?`<a href="${g}?${x}page=${r-1}">\u2190 previous</a>`:""}<span>page ${r} of ${m}</span>${r<m?`<a href="${g}?${x}page=${r+1}">next \u2192</a>`:""}</div>`}return L(s.plural??s.label,N(e,{pillar:i.id}),u)}function Sa(e,a){let t=a.trim().toLowerCase(),r=[];if(t)for(let o of e.entities.values()){let i=o.title.toLowerCase(),s=i===t?100:i.startsWith(t)?60:i.includes(t)?40:0;!s&&o.pages.some(d=>d.article.content.toLowerCase().includes(t))&&(s=10),s&&r.push({e:o,s})}r.sort((o,i)=>i.s-o.s||i.e.updated.localeCompare(o.e.updated));let n=`<div class="ox-bar">${j([{label:"Search"}])}</div>`;return n+=`<div class="ox-head"><div class="ox-avatar">${D("search")}</div><div><h1>${t?`\u201C${k(a)}\u201D`:"Search"}</h1><p>${r.length} match${r.length===1?"":"es"}</p></div></div>`,n+=`<section class="ox-card">${r.slice(0,60).map(({e:o})=>re(e,o)).join("")||'<div class="ox-empty">No page matches.</div>'}</section>`,L(`Search: ${a}`,N(e,{}),n,"",a)}function Aa(e,a,t){let r=e.ontology,n=ye(e),o=`<div class="ox-bar">${j([{label:"Ontology"}])}</div>`;o+=`<div class="ox-head"><div class="ox-avatar">${D("steps")}</div><div><h1>Ontology</h1><p>${t?`Read from ${k(t)}`:"Built-in defaults. Run <code>agentx wiki ontology init</code> to write an ontology.yaml you can edit."}</p></div></div>`,a.length&&(o+=`<div class="ox-err"><b>Problems</b><ul>${a.map(i=>`<li>${k(i)}</li>`).join("")}</ul></div>`),o+=`<section class="ox-card"><div class="ox-card-h"><h2>Types</h2><span class="note">${r.types.length}</span></div>`;for(let i of r.types){let s=r.pillars.find(d=>d.id===i.pillar);o+=`<div class="ox-row"><span class="ox-ic">${D(i.icon)}</span><div class="t"><span class="l">${k(i.label)} <span class="ox-sub">${k(i.id)}</span></span><div class="ox-sub">${k(s?.label??i.pillar)} \xB7 lens: ${k((i.lens??[]).map(d=>d.title??d.panel).join(" \u2192 "))}</div></div><div class="r"><span class="ox-chip">${n.get(i.id)?.length??0}</span></div></div>`}o+=`</section><section class="ox-card" style="margin-top:16px"><div class="ox-card-h"><h2>Relations</h2><span class="note">${r.properties.length}</span></div>`;for(let i of r.properties)o+=`<div class="ox-kv"><span class="k">${k(i.id)}</span><span>${k(i.label)}${i.inverse?` \xB7 inverse: ${k(i.inverse)}`:""}${i.wikidata?` <span class="ox-sub">${k(i.wikidata)}</span>`:""}</span></div>`;return o+=`</section><section class="ox-card" style="margin-top:16px"><div class="ox-card-h"><h2>Event importance</h2></div><div class="ox-kv"><span class="k">default</span><span>${k(r.importance.default)}</span></div><div class="ox-kv"><span class="k">major set by</span><span>${k(r.importance.major_set_by)}</span></div><div class="ox-kv"><span class="k">roll-up</span><span>${r.importance.rollup.min} minor events in ${r.importance.rollup.days} days</span></div></section>`,L("Ontology",N(e,{}),o)}var ne=class{constructor(a,t){this.hub=a;this.wikiDir=t}cache=new Je;pageAt(a){if(!a.startsWith("/e/"))return null;let{ontology:t}=xe(this.wikiDir),n=this.cache.get(this.hub,t).entities.get(a.split("/").filter(Boolean)[1]??"")?.pages[0];return n?{agentId:n.agentId,path:n.article.path,title:n.article.meta.title}:null}handle(a,t){if(!(a==="/"||a===""||a.startsWith("/p/")||a.startsWith("/e/")||a==="/find"||a==="/ontology"))return null;let{ontology:r,errors:n,file:o}=xe(this.wikiDir),i=Ye(this.wikiDir,this.hub.listAgents([]),r.agent_names),s=this.cache.get(this.hub,r,i),d=Math.max(1,Number(t.get("page"))||1);if(a==="/"||a==="")return ka(s,n);if(a==="/find")return Sa(s,t.get("q")??"");if(a==="/ontology")return Aa(s,n,o);let l=a.split("/").filter(Boolean);if(l[0]==="p")return l.length===2?_a(s,l[1],t.get("kind")):l.length===3?$a(s,l[1],l[2],d,t.get("importance")):null;let c=s.entities.get(l[1]??"");if(!c)return null;let m={g:s,readEntries:g=>this.hub.getSharedStore().readEntries(g),versions:(g,u)=>this.hub.getAgentWiki(g).getVersions(u)};return l.length===2?Qe(m,c):l.length===3?Ze(m,c,l[2],d):l.length===4&&l[2]==="s"?ea(m,c,Number(l[3])):null}};var Dt=`
|
|
2219
|
+
.wc-root{--wc-bg:#fff;--wc-ink:#1b1f1e;--wc-muted:#5d6664;--wc-edge:#d9dedc;--wc-soft:#f3f5f4;--wc-accent:#2f6fde;--wc-on-accent:#fff;--wc-add:#e6f4ea;--wc-add-ink:#1e6b34;--wc-del:#fbe9e9;--wc-del-ink:#9b2c2c;
|
|
2220
|
+
font:14px/1.45 'IBM Plex Sans',system-ui,-apple-system,sans-serif;color:var(--wc-ink)}
|
|
2221
|
+
[data-theme=dark] .wc-root{--wc-bg:#181c1b;--wc-ink:#e9eeec;--wc-muted:#a3adab;--wc-edge:#2c3331;--wc-soft:#1f2422;--wc-accent:#6b9cff;--wc-on-accent:#0b1020;--wc-add:#173823;--wc-add-ink:#9be3b0;--wc-del:#3b1d1d;--wc-del-ink:#f3a9a9}
|
|
2222
|
+
.wc-fab{position:fixed;right:20px;bottom:20px;z-index:9990;width:52px;height:52px;border-radius:50%;border:0;background:var(--wc-accent);color:var(--wc-on-accent);box-shadow:0 6px 18px rgba(0,0,0,.22);cursor:pointer;display:grid;place-items:center}
|
|
2223
|
+
.wc-fab:focus-visible,.wc-root button:focus-visible,.wc-root textarea:focus-visible{outline:3px solid var(--wc-accent);outline-offset:2px}
|
|
2224
|
+
.wc-fab svg{width:24px;height:24px}
|
|
2225
|
+
.wc-panel{position:fixed;right:20px;bottom:84px;z-index:9991;width:min(400px,calc(100vw - 32px));max-height:min(620px,calc(100vh - 110px));display:flex;flex-direction:column;background:var(--wc-bg);border:1px solid var(--wc-edge);border-radius:14px;box-shadow:0 14px 40px rgba(0,0,0,.25);overflow:hidden}
|
|
2226
|
+
.wc-panel[hidden],.wc-fab[hidden]{display:none}
|
|
2227
|
+
.wc-head{display:flex;align-items:flex-start;gap:8px;padding:12px 14px;border-bottom:1px solid var(--wc-edge)}
|
|
2228
|
+
.wc-head h2{margin:0;font-size:15px}
|
|
2229
|
+
.wc-head p{margin:2px 0 0;color:var(--wc-muted);font-size:12px;word-break:break-word}
|
|
2230
|
+
.wc-x{margin-left:auto;background:none;border:0;color:var(--wc-muted);font-size:20px;line-height:1;cursor:pointer;padding:2px 6px;border-radius:6px}
|
|
2231
|
+
.wc-log{flex:1;overflow-y:auto;padding:12px 14px;display:flex;flex-direction:column;gap:10px}
|
|
2232
|
+
.wc-empty{color:var(--wc-muted);font-size:13px}
|
|
2233
|
+
.wc-msg{max-width:92%;padding:8px 11px;border-radius:12px;white-space:pre-wrap;word-break:break-word}
|
|
2234
|
+
.wc-owner{align-self:flex-end;background:var(--wc-accent);color:var(--wc-on-accent)}
|
|
2235
|
+
.wc-agent{align-self:flex-start;background:var(--wc-soft)}
|
|
2236
|
+
.wc-error{border:1px solid var(--wc-del-ink)}
|
|
2237
|
+
.wc-who{display:block;font-size:11px;color:var(--wc-muted);margin-bottom:2px}
|
|
2238
|
+
.wc-edit{margin-top:8px;padding-top:8px;border-top:1px solid var(--wc-edge);white-space:normal;font-size:13px}
|
|
2239
|
+
.wc-edit details{margin:6px 0}
|
|
2240
|
+
.wc-diff{margin:6px 0 0;padding:6px;max-height:220px;overflow:auto;background:var(--wc-bg);border:1px solid var(--wc-edge);border-radius:8px;font:12px/1.4 'IBM Plex Mono',ui-monospace,monospace;white-space:pre-wrap}
|
|
2241
|
+
.wc-diff .a{display:block;background:var(--wc-add);color:var(--wc-add-ink)}
|
|
2242
|
+
.wc-diff .d{display:block;background:var(--wc-del);color:var(--wc-del-ink);text-decoration:line-through}
|
|
2243
|
+
.wc-diff .c{display:block;color:var(--wc-muted)}
|
|
2244
|
+
.wc-src{margin:4px 0 0;padding-left:18px}
|
|
2245
|
+
.wc-src a{color:var(--wc-accent)}
|
|
2246
|
+
.wc-warn{color:var(--wc-del-ink)}
|
|
2247
|
+
.wc-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
|
|
2248
|
+
.wc-btn{border:1px solid var(--wc-edge);background:var(--wc-bg);color:var(--wc-ink);border-radius:8px;padding:5px 10px;font:inherit;font-size:12px;cursor:pointer}
|
|
2249
|
+
.wc-form{display:flex;gap:8px;padding:10px 14px;border-top:1px solid var(--wc-edge)}
|
|
2250
|
+
.wc-form textarea{flex:1;resize:none;min-height:40px;max-height:140px;padding:8px 10px;border:1px solid var(--wc-edge);border-radius:10px;background:var(--wc-bg);color:var(--wc-ink);font:inherit}
|
|
2251
|
+
.wc-send{border:0;border-radius:10px;padding:0 14px;background:var(--wc-accent);color:var(--wc-on-accent);font:inherit;font-weight:600;cursor:pointer}
|
|
2252
|
+
.wc-send:disabled{opacity:.5;cursor:default}
|
|
2253
|
+
.wc-dots::after{content:'\u2026';animation:wc-blink 1.2s steps(4) infinite}
|
|
2254
|
+
@keyframes wc-blink{0%{content:''}25%{content:'.'}50%{content:'..'}75%{content:'\u2026'}}
|
|
2255
|
+
@media (max-width:600px){.wc-panel{right:8px;left:8px;bottom:80px;width:auto;max-height:calc(100vh - 100px)}.wc-fab{right:14px;bottom:14px}}
|
|
2256
|
+
@media (prefers-reduced-motion:reduce){.wc-dots::after{animation:none;content:'\u2026'}}
|
|
2257
|
+
`,Mt=`
|
|
2258
|
+
(function(){
|
|
2259
|
+
var root=document.getElementById('wc-root'); if(!root) return;
|
|
2260
|
+
var cfg=JSON.parse(document.getElementById('wc-data').textContent);
|
|
2261
|
+
var fab=root.querySelector('.wc-fab'), panel=root.querySelector('.wc-panel'), log=root.querySelector('.wc-log');
|
|
2262
|
+
var form=root.querySelector('.wc-form'), input=form.querySelector('textarea'), send=form.querySelector('.wc-send');
|
|
2263
|
+
var sub=root.querySelector('.wc-sub'), timer=null, busy=false, openKey='wc-open:'+cfg.agent+'/'+cfg.path;
|
|
2264
|
+
function q(){return cfg.endpoint+'?agent='+encodeURIComponent(cfg.agent)+'&path='+encodeURIComponent(cfg.path)}
|
|
2265
|
+
function el(tag,cls,text){var e=document.createElement(tag);if(cls)e.className=cls;if(text!=null)e.textContent=text;return e}
|
|
2266
|
+
function isUrl(s){return /^https?:\\/\\/\\S+$/.test(s.split(/\\s/)[0])}
|
|
2267
|
+
function setOpen(o){panel.hidden=!o;fab.setAttribute('aria-expanded',String(o));try{sessionStorage.setItem(openKey,o?'1':'')}catch(e){}
|
|
2268
|
+
if(o){load();setTimeout(function(){input.focus()},0)}else{stop();fab.focus()}}
|
|
2269
|
+
function stop(){if(timer){clearTimeout(timer);timer=null}}
|
|
2270
|
+
// The same headers as the dashboard's other XHR: the write check and,
|
|
2271
|
+
// when dashboard.token is set, the token.
|
|
2272
|
+
function headers(){var h={'Content-Type':'application/json','X-Requested-With':'agentx-board'};if(cfg.token)h['Authorization']='Bearer '+cfg.token;return h}
|
|
2273
|
+
function api(method,url,body){return fetch(url,{method:method,headers:headers(),credentials:'same-origin',body:body?JSON.stringify(body):undefined})
|
|
2274
|
+
.then(function(r){return r.json().catch(function(){return {}}).then(function(j){if(!r.ok)throw new Error(j.error||('HTTP '+r.status));return j})})}
|
|
2275
|
+
function render(state){
|
|
2276
|
+
sub.textContent=(state.curator||'The agent')+' edits \u201C'+(state.title||cfg.title)+'\u201D'+(state.readOnly?' \xB7 read-only copy':'');
|
|
2277
|
+
log.textContent='';
|
|
2278
|
+
var msgs=state.messages||[];
|
|
2279
|
+
if(!msgs.length){log.appendChild(el('p','wc-empty','Tell the agent what to do with this page, for example \u201Cfind their contact details\u201D or \u201Crewrite the summary\u201D. Every change is saved as a new version you can restore.'))}
|
|
2280
|
+
msgs.forEach(function(m){
|
|
2281
|
+
var b=el('div','wc-msg '+(m.role==='owner'?'wc-owner':'wc-agent')+(m.status==='error'?' wc-error':''));
|
|
2282
|
+
if(m.role==='agent'){b.appendChild(el('span','wc-who',m.agent||'agent'))}
|
|
2283
|
+
if(m.status==='pending'){var p=el('span','wc-dots','Working');b.appendChild(p)}
|
|
2284
|
+
else b.appendChild(document.createTextNode(m.text));
|
|
2285
|
+
if(m.edit&&(m.edit.added||m.edit.removed)){
|
|
2286
|
+
var e=el('div','wc-edit');
|
|
2287
|
+
e.appendChild(el('strong',null,'Page changed: +'+m.edit.added+' / \u2212'+m.edit.removed+' lines'+(m.edit.restored?' (restored)':'')));
|
|
2288
|
+
var d=el('details');d.appendChild(el('summary',null,'What changed'));
|
|
2289
|
+
var pre=el('div','wc-diff');
|
|
2290
|
+
(m.edit.diff||[]).forEach(function(l){pre.appendChild(el('span',l.op==='+'?'a':l.op==='-'?'d':'c',(l.op===' '?' ':l.op+' ')+l.text))});
|
|
2291
|
+
d.appendChild(pre);e.appendChild(d);
|
|
2292
|
+
if(m.edit.sources&&m.edit.sources.length){
|
|
2293
|
+
e.appendChild(el('span',null,'Sources'));var ul=el('ul','wc-src');
|
|
2294
|
+
m.edit.sources.forEach(function(s){var li=el('li');if(isUrl(s)){var a=el('a',null,s);a.href=s.split(/\\s/)[0];a.target='_blank';a.rel='noopener noreferrer';li.appendChild(a)}else li.textContent=s;ul.appendChild(li)});
|
|
2295
|
+
e.appendChild(ul);
|
|
2296
|
+
} else e.appendChild(el('div','wc-warn','No sources were cited for this change.'));
|
|
2297
|
+
var acts=el('div','wc-actions');
|
|
2298
|
+
var show=el('button','wc-btn','Show the updated page');show.type='button';show.onclick=function(){location.reload()};acts.appendChild(show);
|
|
2299
|
+
if(m.edit.version&&!m.edit.restored&&!state.readOnly){var r=el('button','wc-btn','Restore the previous version');r.type='button';
|
|
2300
|
+
r.onclick=function(){if(!confirm('Put the page back as it was before this change?'))return;r.disabled=true;
|
|
2301
|
+
api('POST',cfg.endpoint+'/restore',{agent:cfg.agent,path:cfg.path,version:m.edit.version}).then(function(){location.reload()}).catch(function(err){r.disabled=false;alert(err.message)})};
|
|
2302
|
+
acts.appendChild(r)}
|
|
2303
|
+
e.appendChild(acts);b.appendChild(e);
|
|
2304
|
+
}
|
|
2305
|
+
log.appendChild(b);
|
|
2306
|
+
});
|
|
2307
|
+
busy=msgs.some(function(m){return m.status==='pending'});
|
|
2308
|
+
send.disabled=busy||state.readOnly||state.enabled===false;
|
|
2309
|
+
input.disabled=!!state.readOnly||state.enabled===false;
|
|
2310
|
+
if(state.enabled===false)log.appendChild(el('p','wc-empty','The page curator is turned off.'));
|
|
2311
|
+
log.scrollTop=log.scrollHeight;
|
|
2312
|
+
stop();if(busy&&!panel.hidden)timer=setTimeout(load,2000);
|
|
2313
|
+
}
|
|
2314
|
+
function load(){api('GET',q()).then(render).catch(function(err){log.textContent='';log.appendChild(el('p','wc-warn','Could not reach the agent: '+err.message))})}
|
|
2315
|
+
fab.addEventListener('click',function(){setOpen(panel.hidden)});
|
|
2316
|
+
root.querySelector('.wc-x').addEventListener('click',function(){setOpen(false)});
|
|
2317
|
+
panel.addEventListener('keydown',function(e){if(e.key==='Escape'){e.preventDefault();setOpen(false)}});
|
|
2318
|
+
input.addEventListener('keydown',function(e){if(e.key==='Enter'&&!e.shiftKey&&!e.isComposing){e.preventDefault();form.requestSubmit()}});
|
|
2319
|
+
form.addEventListener('submit',function(e){e.preventDefault();var t=input.value.trim();if(!t||busy)return;send.disabled=true;
|
|
2320
|
+
api('POST',cfg.endpoint,{agent:cfg.agent,path:cfg.path,message:t}).then(function(){input.value='';load()}).catch(function(err){send.disabled=false;alert(err.message)})});
|
|
2321
|
+
// Shown only when the daemon says the curator is on for this page.
|
|
2322
|
+
api('GET',q()).then(function(state){if(state.enabled===false)return;fab.hidden=false;
|
|
2323
|
+
try{if(sessionStorage.getItem(openKey))setOpen(true)}catch(e){}}).catch(function(){});
|
|
2324
|
+
})();
|
|
2325
|
+
`,Ht='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 12a8 8 0 0 1-11.6 7.1L4 20l1-4.6A8 8 0 1 1 21 12z"/><path d="M12 8.5l.9 2.1 2.1.9-2.1.9-.9 2.1-.9-2.1-2.1-.9 2.1-.9z"/></svg>';function jt(e){return e.replace(/[&<>"']/g,a=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[a])}function Nt(e,a="/api/wiki/curate",t){let r=JSON.stringify({agent:e.agentId,path:e.path,title:e.title,endpoint:a,...t?{token:t}:{}}).replace(/</g,"\\u003c");return`<style>${Dt}</style>
|
|
2326
|
+
<div class="wc-root" id="wc-root">
|
|
2327
|
+
<button class="wc-fab" type="button" hidden aria-label="Ask an agent to curate this page" aria-expanded="false" aria-controls="wc-panel" title="Curate this page">${Ht}</button>
|
|
2328
|
+
<section class="wc-panel" id="wc-panel" role="dialog" aria-label="Curate this page" hidden>
|
|
2329
|
+
<div class="wc-head"><div><h2>Curate this page</h2><p class="wc-sub">${jt(e.title)}</p></div><button class="wc-x" type="button" aria-label="Close">\xD7</button></div>
|
|
2330
|
+
<div class="wc-log" aria-live="polite"></div>
|
|
2331
|
+
<form class="wc-form"><textarea rows="2" aria-label="Instruction for the agent" placeholder="What should change on this page?"></textarea><button class="wc-send" type="submit">Send</button></form>
|
|
2332
|
+
</section>
|
|
2333
|
+
</div>
|
|
2334
|
+
<script type="application/json" id="wc-data">${r}</script>
|
|
2335
|
+
<script>${Mt}</script>`}function Ca(e,a,t,r){let n=Nt(a,t,r);return e.includes("</body>")?e.replace(/<\/body>(?![\s\S]*<\/body>)/,()=>`${n}
|
|
2336
|
+
</body>`):e+n}function p(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Wt(e){return e.replace(/<!--\s*tags?:[^>]*-->\s*\n?/gi,"")}function Ta(e,a){return`<a href="${a?`/agent/${encodeURIComponent(a)}/tag/${encodeURIComponent(e)}`:`/tag/${encodeURIComponent(e)}`}" class="tag">${p(e)}</a>`}function H(e,a){return(e||[]).map(t=>Ta(t,a)).join(" ")}function Bt(e,a){if(!e)return;let t=a.get(e);if(t)return t;let r=new Set(a.values());if(r.has(e))return e;let n=e.endsWith(".md")?e:`${e}.md`;if(r.has(n))return n;let o=e.toLowerCase();for(let[i,s]of a)if(i.toLowerCase()===o)return s}function oe(e,a,t=""){return X(Wt(e),{wikilink:(r,n)=>{let o=Bt(r,a);return o?`<a href="${t}/article/${encodeURIComponent(o)}" class="wikilink">${n}</a>`:`<a href="${t}/search?q=${encodeURIComponent(r)}" class="wikilink broken" title="Not found \u2014 click to search">${n}</a>`}})}var Ut=`<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
2337
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
2338
|
+
<link href="https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,300..600;1,6..72,300..600&family=Inter+Tight:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">`,Ft=`
|
|
2339
|
+
:root {
|
|
2340
|
+
--bg: #FAF8F3;
|
|
2341
|
+
--bg-raised: #FFFFFF;
|
|
2342
|
+
--bg-sunk: #F2EFE7;
|
|
2343
|
+
--bg-hover: #EFEBE0;
|
|
2344
|
+
--ink: #1A1915;
|
|
2345
|
+
--ink-2: #3D3A32;
|
|
2346
|
+
--muted: #6B6860;
|
|
2347
|
+
--muted-2: #96918A;
|
|
2348
|
+
--line: #E4DED0;
|
|
2349
|
+
--line-2: #D1CAB8;
|
|
2350
|
+
--accent: oklch(55% 0.14 45);
|
|
2351
|
+
--accent-soft: oklch(55% 0.14 45 / 0.10);
|
|
2352
|
+
--accent-hover: oklch(48% 0.14 45);
|
|
2353
|
+
--cool: oklch(55% 0.08 230);
|
|
2354
|
+
--cool-soft: oklch(55% 0.08 230 / 0.10);
|
|
2355
|
+
--ok: oklch(55% 0.10 145);
|
|
2356
|
+
--warn: oklch(60% 0.14 75);
|
|
2357
|
+
--err: oklch(55% 0.16 20);
|
|
2358
|
+
--font-display: 'Newsreader', Georgia, serif;
|
|
2359
|
+
--font-ui: 'Inter Tight', -apple-system, system-ui, sans-serif;
|
|
2360
|
+
--font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
|
|
2361
|
+
--sidebar-w: 260px;
|
|
2362
|
+
--topbar-h: 52px;
|
|
2363
|
+
--radius: 6px;
|
|
2364
|
+
--radius-sm: 4px;
|
|
2365
|
+
--radius-lg: 10px;
|
|
2366
|
+
--shadow-sm: 0 1px 2px rgba(26,25,21,0.04), 0 1px 1px rgba(26,25,21,0.03);
|
|
2367
|
+
--shadow-md: 0 4px 12px rgba(26,25,21,0.06), 0 2px 4px rgba(26,25,21,0.04);
|
|
2368
|
+
--shadow-lg: 0 12px 40px rgba(26,25,21,0.12), 0 4px 12px rgba(26,25,21,0.06);
|
|
2369
|
+
}
|
|
2370
|
+
[data-theme="dark"] {
|
|
2371
|
+
--bg: #0F0E0C;
|
|
2372
|
+
--bg-raised: #1A1815;
|
|
2373
|
+
--bg-sunk: #07060A;
|
|
2374
|
+
--bg-hover: #22201C;
|
|
2375
|
+
--ink: #EBE7DD;
|
|
2376
|
+
--ink-2: #C9C4B7;
|
|
2377
|
+
--muted: #8B867B;
|
|
2378
|
+
--muted-2: #5E5A52;
|
|
2379
|
+
--line: #2A2822;
|
|
2380
|
+
--line-2: #3A3830;
|
|
2381
|
+
--accent: oklch(70% 0.16 45);
|
|
2382
|
+
--accent-soft: oklch(70% 0.16 45 / 0.14);
|
|
2383
|
+
--accent-hover: oklch(78% 0.16 45);
|
|
2384
|
+
--cool: oklch(70% 0.10 230);
|
|
2385
|
+
--cool-soft: oklch(70% 0.10 230 / 0.14);
|
|
2386
|
+
--ok: oklch(70% 0.14 145);
|
|
2387
|
+
--warn: oklch(75% 0.16 75);
|
|
2388
|
+
--err: oklch(68% 0.18 20);
|
|
2389
|
+
--shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
|
|
2390
|
+
--shadow-md: 0 4px 12px rgba(0,0,0,0.5);
|
|
2391
|
+
--shadow-lg: 0 12px 40px rgba(0,0,0,0.7);
|
|
2392
|
+
}
|
|
2393
|
+
|
|
2394
|
+
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
2395
|
+
html, body {
|
|
2396
|
+
background: var(--bg); color: var(--ink);
|
|
2397
|
+
font-family: var(--font-ui); font-size: 14px; line-height: 1.55;
|
|
2398
|
+
font-feature-settings: 'ss01','cv11';
|
|
2399
|
+
-webkit-font-smoothing: antialiased; min-height: 100vh;
|
|
2400
|
+
}
|
|
2401
|
+
a { color: var(--accent); text-decoration: none; }
|
|
2402
|
+
a:hover { color: var(--accent-hover); }
|
|
2403
|
+
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
|
|
2404
|
+
input, textarea, select { font: inherit; color: inherit; }
|
|
2405
|
+
code, pre, .mono { font-family: var(--font-mono); font-size: 0.92em; }
|
|
2406
|
+
.display { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.01em; }
|
|
2407
|
+
|
|
2408
|
+
/* \u2014\u2014\u2014 App shell \u2014\u2014\u2014 */
|
|
2409
|
+
.app {
|
|
2410
|
+
display: grid;
|
|
2411
|
+
grid-template-columns: var(--sidebar-w) 1fr;
|
|
2412
|
+
grid-template-rows: var(--topbar-h) 1fr;
|
|
2413
|
+
min-height: 100vh;
|
|
2414
|
+
}
|
|
2415
|
+
.topbar {
|
|
2416
|
+
grid-column: 1 / -1;
|
|
2417
|
+
display: flex; align-items: center; gap: 16px; padding: 0 20px;
|
|
2418
|
+
background: var(--bg); border-bottom: 1px solid var(--line);
|
|
2419
|
+
position: sticky; top: 0; z-index: 20; backdrop-filter: blur(8px);
|
|
2420
|
+
}
|
|
2421
|
+
.topbar-logo {
|
|
2422
|
+
display: flex; align-items: center; gap: 10px;
|
|
2423
|
+
font-family: var(--font-display); font-size: 18px; color: var(--ink);
|
|
2424
|
+
width: calc(var(--sidebar-w) - 20px); padding-right: 12px;
|
|
2425
|
+
border-right: 1px solid var(--line); height: 100%;
|
|
2426
|
+
text-decoration: none;
|
|
2427
|
+
}
|
|
2428
|
+
.topbar-logo .mark {
|
|
2429
|
+
width: 22px; height: 22px; flex: 0 0 auto;
|
|
2430
|
+
display: inline-flex; align-items: center; justify-content: center;
|
|
2431
|
+
background: var(--accent); color: var(--bg-raised);
|
|
2432
|
+
border-radius: 5px; font-family: var(--font-mono);
|
|
2433
|
+
font-size: 11px; font-weight: 700;
|
|
2434
|
+
}
|
|
2435
|
+
.topbar-search {
|
|
2436
|
+
flex: 1; max-width: 520px;
|
|
2437
|
+
display: flex; align-items: center; gap: 8px; padding: 6px 12px;
|
|
2438
|
+
background: var(--bg-raised); border: 1px solid var(--line);
|
|
2439
|
+
border-radius: var(--radius); color: var(--muted);
|
|
2440
|
+
transition: border-color 0.15s, background 0.15s;
|
|
2441
|
+
}
|
|
2442
|
+
.topbar-search:focus-within { border-color: var(--line-2); background: var(--bg-hover); }
|
|
2443
|
+
.topbar-search input {
|
|
2444
|
+
flex: 1; border: 0; outline: 0; background: transparent;
|
|
2445
|
+
color: var(--ink); font: inherit;
|
|
2446
|
+
}
|
|
2447
|
+
.topbar-search input::placeholder { color: var(--muted); }
|
|
2448
|
+
.topbar-search kbd {
|
|
2449
|
+
font-family: var(--font-mono); font-size: 11px;
|
|
2450
|
+
padding: 2px 6px; border: 1px solid var(--line); border-radius: 3px;
|
|
2451
|
+
background: var(--bg); color: var(--muted);
|
|
2452
|
+
}
|
|
2453
|
+
.topbar-tools { margin-left: auto; display: flex; align-items: center; gap: 4px; }
|
|
2454
|
+
.icon-btn {
|
|
2455
|
+
width: 32px; height: 32px;
|
|
2456
|
+
display: inline-flex; align-items: center; justify-content: center;
|
|
2457
|
+
border-radius: var(--radius-sm); color: var(--muted);
|
|
2458
|
+
transition: background 0.15s, color 0.15s;
|
|
2459
|
+
}
|
|
2460
|
+
.icon-btn:hover { background: var(--bg-hover); color: var(--ink); }
|
|
2461
|
+
.icon-btn.active { color: var(--accent); background: var(--accent-soft); }
|
|
2462
|
+
.icon-btn svg { width: 16px; height: 16px; }
|
|
2463
|
+
|
|
2464
|
+
/* \u2014\u2014\u2014 Sidebar \u2014\u2014\u2014 */
|
|
2465
|
+
.sidebar {
|
|
2466
|
+
grid-column: 1; grid-row: 2;
|
|
2467
|
+
background: var(--bg); border-right: 1px solid var(--line);
|
|
2468
|
+
padding: 16px 12px 40px; overflow-y: auto;
|
|
2469
|
+
position: sticky; top: var(--topbar-h);
|
|
2470
|
+
height: calc(100vh - var(--topbar-h));
|
|
2471
|
+
}
|
|
2472
|
+
.nav-section { margin-bottom: 20px; }
|
|
2473
|
+
.nav-section-title {
|
|
2474
|
+
display: flex; align-items: center; justify-content: space-between;
|
|
2475
|
+
padding: 4px 10px; font-size: 11px; font-weight: 600;
|
|
2476
|
+
text-transform: uppercase; letter-spacing: 0.06em;
|
|
2477
|
+
color: var(--muted); margin-bottom: 2px;
|
|
2478
|
+
}
|
|
2479
|
+
.nav-item {
|
|
2480
|
+
display: flex; align-items: center; gap: 8px;
|
|
2481
|
+
padding: 5px 10px; color: var(--ink-2);
|
|
2482
|
+
font-size: 13px; border-radius: var(--radius-sm);
|
|
2483
|
+
line-height: 1.35; cursor: pointer;
|
|
2484
|
+
transition: background 0.1s;
|
|
2485
|
+
text-decoration: none;
|
|
2486
|
+
}
|
|
2487
|
+
.nav-item:hover { background: var(--bg-hover); color: var(--ink); }
|
|
2488
|
+
.nav-item.active {
|
|
2489
|
+
background: var(--accent-soft); color: var(--accent); font-weight: 500;
|
|
2490
|
+
}
|
|
2491
|
+
.nav-item .count {
|
|
2492
|
+
margin-left: auto; font-family: var(--font-mono);
|
|
2493
|
+
font-size: 11px; color: var(--muted);
|
|
2494
|
+
}
|
|
2495
|
+
.nav-item.active .count { color: var(--accent); }
|
|
2496
|
+
.nav-agent-header {
|
|
2497
|
+
display: flex; align-items: center; gap: 8px;
|
|
2498
|
+
padding: 6px 10px; font-size: 13px; color: var(--ink);
|
|
2499
|
+
cursor: pointer; border-radius: var(--radius-sm);
|
|
2500
|
+
text-decoration: none;
|
|
2501
|
+
}
|
|
2502
|
+
.nav-agent-header:hover { color: var(--accent); background: var(--bg-hover); }
|
|
2503
|
+
.nav-agent-header .name { font-weight: 500; }
|
|
2504
|
+
.nav-agent-header .badge {
|
|
2505
|
+
margin-left: auto; font-family: var(--font-mono);
|
|
2506
|
+
font-size: 10.5px; color: var(--muted);
|
|
2507
|
+
}
|
|
2508
|
+
.nav-agent-type-label {
|
|
2509
|
+
padding: 6px 8px 2px; font-size: 10px;
|
|
2510
|
+
text-transform: uppercase; letter-spacing: 0.08em;
|
|
2511
|
+
color: var(--muted-2); font-weight: 600;
|
|
2512
|
+
}
|
|
2513
|
+
.nav-agent-children {
|
|
2514
|
+
padding-left: 14px; display: flex; flex-direction: column; gap: 1px;
|
|
2515
|
+
margin-top: 2px; border-left: 1px dashed var(--line); margin-left: 10px;
|
|
2516
|
+
}
|
|
2517
|
+
|
|
2518
|
+
/* \u2014\u2014\u2014 Main \u2014\u2014\u2014 */
|
|
2519
|
+
.main {
|
|
2520
|
+
grid-column: 2; grid-row: 2;
|
|
2521
|
+
padding: 32px 48px 80px;
|
|
2522
|
+
max-width: 1180px; width: 100%;
|
|
2523
|
+
}
|
|
2524
|
+
.main.article { max-width: 1100px; }
|
|
2525
|
+
|
|
2526
|
+
/* \u2014\u2014\u2014 Breadcrumb \u2014\u2014\u2014 */
|
|
2527
|
+
.breadcrumb {
|
|
2528
|
+
display: flex; align-items: center; gap: 6px;
|
|
2529
|
+
font-size: 12.5px; color: var(--muted);
|
|
2530
|
+
margin-bottom: 14px; font-family: var(--font-ui);
|
|
2531
|
+
}
|
|
2532
|
+
.breadcrumb a { color: var(--muted); }
|
|
2533
|
+
.breadcrumb a:hover { color: var(--accent); }
|
|
2534
|
+
.breadcrumb .sep { color: var(--muted-2); }
|
|
2535
|
+
.breadcrumb .current { color: var(--ink-2); }
|
|
2536
|
+
|
|
2537
|
+
/* \u2014\u2014\u2014 Display heading \u2014\u2014\u2014 */
|
|
2538
|
+
.page-head {
|
|
2539
|
+
display: flex; align-items: flex-end; justify-content: space-between;
|
|
2540
|
+
gap: 24px; padding-bottom: 16px;
|
|
2541
|
+
border-bottom: 1px solid var(--line); margin-bottom: 28px;
|
|
2542
|
+
}
|
|
2543
|
+
.page-head h1 {
|
|
2544
|
+
font-family: var(--font-display); font-size: 38px;
|
|
2545
|
+
font-weight: 400; letter-spacing: -0.015em; line-height: 1.1;
|
|
2546
|
+
}
|
|
2547
|
+
.page-head .page-sub {
|
|
2548
|
+
font-size: 13.5px; color: var(--muted);
|
|
2549
|
+
margin-top: 6px; max-width: 60ch; line-height: 1.5;
|
|
2550
|
+
}
|
|
2551
|
+
.page-head .page-actions { display: flex; gap: 8px; flex: 0 0 auto; }
|
|
2552
|
+
|
|
2553
|
+
/* \u2014\u2014\u2014 Buttons \u2014\u2014\u2014 */
|
|
2554
|
+
.btn {
|
|
2555
|
+
display: inline-flex; align-items: center; gap: 6px;
|
|
2556
|
+
padding: 6px 12px; font-size: 13px;
|
|
2557
|
+
color: var(--ink-2); background: var(--bg-raised);
|
|
2558
|
+
border: 1px solid var(--line); border-radius: var(--radius-sm);
|
|
2559
|
+
transition: all 0.1s; text-decoration: none;
|
|
2560
|
+
}
|
|
2561
|
+
.btn:hover { background: var(--bg-hover); border-color: var(--line-2); color: var(--ink); }
|
|
2562
|
+
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
|
|
2563
|
+
.btn.primary:hover { background: var(--ink-2); color: var(--bg); }
|
|
2564
|
+
.btn.ghost { background: transparent; border-color: transparent; }
|
|
2565
|
+
.btn.ghost:hover { background: var(--bg-hover); }
|
|
2566
|
+
.btn svg { width: 14px; height: 14px; }
|
|
2567
|
+
|
|
2568
|
+
/* \u2014\u2014\u2014 Stat strip \u2014\u2014\u2014 */
|
|
2569
|
+
.stats, .stat-strip {
|
|
2570
|
+
display: grid;
|
|
2571
|
+
grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
|
|
2572
|
+
gap: 0;
|
|
2573
|
+
background: var(--bg-raised); border: 1px solid var(--line);
|
|
2574
|
+
border-radius: var(--radius); overflow: hidden;
|
|
2575
|
+
margin-bottom: 28px;
|
|
2576
|
+
}
|
|
2577
|
+
.stat-card, .stat-cell {
|
|
2578
|
+
padding: 16px 20px;
|
|
2579
|
+
border-right: 1px solid var(--line);
|
|
2580
|
+
display: flex; flex-direction: column; gap: 4px;
|
|
2581
|
+
background: transparent; text-align: left;
|
|
2582
|
+
}
|
|
2583
|
+
.stat-card:last-child, .stat-cell:last-child { border-right: none; }
|
|
2584
|
+
.stat-card .label, .stat-cell .label {
|
|
2585
|
+
font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
|
|
2586
|
+
color: var(--muted); font-weight: 600;
|
|
2587
|
+
}
|
|
2588
|
+
.stat-card .number, .stat-cell .number {
|
|
2589
|
+
font-family: var(--font-display); font-size: 32px; font-weight: 400;
|
|
2590
|
+
line-height: 1; color: var(--ink);
|
|
2591
|
+
}
|
|
2592
|
+
|
|
2593
|
+
/* \u2014\u2014\u2014 Section heading \u2014\u2014\u2014 */
|
|
2594
|
+
.section-head, h2.section {
|
|
2595
|
+
display: flex; align-items: baseline; justify-content: space-between;
|
|
2596
|
+
margin: 40px 0 14px;
|
|
2597
|
+
}
|
|
2598
|
+
.section-head h2 {
|
|
2599
|
+
font-family: var(--font-display); font-size: 22px;
|
|
2600
|
+
font-weight: 400; letter-spacing: -0.01em; color: var(--ink);
|
|
2601
|
+
border: none; padding: 0;
|
|
2602
|
+
}
|
|
2603
|
+
|
|
2604
|
+
/* \u2014\u2014\u2014 Agent grid (hub home) \u2014\u2014\u2014 */
|
|
2605
|
+
.agent-grid {
|
|
2606
|
+
display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
|
|
2607
|
+
gap: 14px;
|
|
2608
|
+
}
|
|
2609
|
+
.agent-card {
|
|
2610
|
+
background: var(--bg-raised); border: 1px solid var(--line);
|
|
2611
|
+
border-radius: var(--radius); padding: 18px 20px;
|
|
2612
|
+
display: flex; flex-direction: column; gap: 12px;
|
|
2613
|
+
transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
|
|
2614
|
+
}
|
|
2615
|
+
.agent-card:hover {
|
|
2616
|
+
border-color: var(--line-2); box-shadow: var(--shadow-md);
|
|
2617
|
+
transform: translateY(-1px);
|
|
2618
|
+
}
|
|
2619
|
+
.agent-card h3 {
|
|
2620
|
+
font-family: var(--font-display); font-size: 20px; font-weight: 400;
|
|
2621
|
+
color: var(--ink); margin: 0;
|
|
2622
|
+
}
|
|
2623
|
+
.agent-card h3 a { color: inherit; text-decoration: none; }
|
|
2624
|
+
.agent-card h3 a:hover { color: var(--accent); }
|
|
2625
|
+
.agent-card .agent-stats {
|
|
2626
|
+
display: flex; gap: 20px; font-size: 13px; color: var(--muted);
|
|
2627
|
+
}
|
|
2628
|
+
.agent-card .agent-stats strong {
|
|
2629
|
+
color: var(--ink); font-weight: 600; font-family: var(--font-mono);
|
|
2630
|
+
}
|
|
2631
|
+
.agent-card .article-list {
|
|
2632
|
+
display: flex; flex-direction: column; gap: 4px; margin-top: 4px; font-size: 13px;
|
|
2633
|
+
}
|
|
2634
|
+
.agent-card .article-row {
|
|
2635
|
+
display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
|
|
2636
|
+
padding: 2px 0;
|
|
2637
|
+
}
|
|
2638
|
+
.agent-card .article-row .article-title {
|
|
2639
|
+
color: var(--ink-2); text-decoration: none; margin-left: 4px; flex: 1;
|
|
2640
|
+
}
|
|
2641
|
+
.agent-card .article-row .article-title:hover { color: var(--accent); }
|
|
2642
|
+
|
|
2643
|
+
/* \u2014\u2014\u2014 Tags \u2014\u2014\u2014 */
|
|
2644
|
+
.tag {
|
|
2645
|
+
display: inline-flex; align-items: center;
|
|
2646
|
+
font-family: var(--font-mono); font-size: 11.5px;
|
|
2647
|
+
padding: 1px 7px 2px; background: var(--bg-sunk);
|
|
2648
|
+
color: var(--ink-2); border-radius: 3px;
|
|
2649
|
+
line-height: 1.4; cursor: pointer;
|
|
2650
|
+
transition: background 0.1s, color 0.1s;
|
|
2651
|
+
text-decoration: none;
|
|
2652
|
+
}
|
|
2653
|
+
.tag:hover { background: var(--accent-soft); color: var(--accent); }
|
|
2654
|
+
.tag.lg { font-size: 12.5px; padding: 3px 10px; }
|
|
2655
|
+
|
|
2656
|
+
/* \u2014\u2014\u2014 Article meta \u2014 inline dl below h1 \u2014\u2014\u2014 */
|
|
2657
|
+
.meta {
|
|
2658
|
+
background: var(--bg-raised); border: 1px solid var(--line);
|
|
2659
|
+
border-radius: var(--radius); padding: 14px 18px;
|
|
2660
|
+
margin-bottom: 24px; font-size: 13px;
|
|
2661
|
+
display: grid; grid-template-columns: auto 1fr;
|
|
2662
|
+
gap: 6px 18px;
|
|
2663
|
+
}
|
|
2664
|
+
.meta dt {
|
|
2665
|
+
font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em;
|
|
2666
|
+
color: var(--muted); font-weight: 600;
|
|
2667
|
+
align-self: center;
|
|
2668
|
+
}
|
|
2669
|
+
.meta dd { color: var(--ink-2); font-family: var(--font-mono); font-size: 12.5px; }
|
|
2670
|
+
|
|
2671
|
+
/* \u2014\u2014\u2014 Prose body \u2014\u2014\u2014 */
|
|
2672
|
+
.prose {
|
|
2673
|
+
font-size: 15.5px; line-height: 1.65; color: var(--ink-2);
|
|
2674
|
+
max-width: 68ch;
|
|
2675
|
+
}
|
|
2676
|
+
.main h1, .prose h1 {
|
|
2677
|
+
font-family: var(--font-display); font-size: 40px;
|
|
2678
|
+
font-weight: 400; letter-spacing: -0.015em; line-height: 1.1;
|
|
2679
|
+
color: var(--ink); margin-bottom: 16px;
|
|
2680
|
+
border: none; padding: 0;
|
|
2681
|
+
}
|
|
2682
|
+
.main h2, .prose h2 {
|
|
2683
|
+
font-family: var(--font-display); font-size: 26px;
|
|
2684
|
+
font-weight: 400; letter-spacing: -0.01em;
|
|
2685
|
+
margin: 36px 0 12px; color: var(--ink);
|
|
2686
|
+
padding-bottom: 4px; border-bottom: 1px solid var(--line);
|
|
2687
|
+
}
|
|
2688
|
+
.main h3, .prose h3 {
|
|
2689
|
+
font-family: var(--font-display); font-size: 20px; font-weight: 500;
|
|
2690
|
+
margin: 28px 0 8px; color: var(--ink);
|
|
2691
|
+
}
|
|
2692
|
+
.main h4, .prose h4 {
|
|
2693
|
+
font-size: 15px; font-weight: 600; margin: 20px 0 6px; color: var(--ink);
|
|
2694
|
+
}
|
|
2695
|
+
.main p, .prose p { margin: 10px 0; }
|
|
2696
|
+
.main ul, .prose ul, .main ol, .prose ol { margin: 10px 0 10px 22px; }
|
|
2697
|
+
.main li, .prose li { margin: 4px 0; }
|
|
2698
|
+
.main code, .prose code {
|
|
2699
|
+
background: var(--bg-sunk); padding: 1px 5px; border-radius: 3px;
|
|
2700
|
+
font-family: var(--font-mono);
|
|
2701
|
+
}
|
|
2702
|
+
.main pre, .prose pre {
|
|
2703
|
+
background: var(--bg-sunk); border: 1px solid var(--line);
|
|
2704
|
+
border-radius: var(--radius-sm); padding: 14px 16px;
|
|
2705
|
+
overflow-x: auto; margin: 14px 0; font-size: 13px;
|
|
2706
|
+
}
|
|
2707
|
+
.main pre code, .prose pre code { background: none; padding: 0; }
|
|
2708
|
+
.main blockquote, .prose blockquote {
|
|
2709
|
+
border-left: 3px solid var(--accent);
|
|
2710
|
+
padding: 4px 0 4px 14px; color: var(--muted);
|
|
2711
|
+
font-style: italic; margin: 14px 0;
|
|
2712
|
+
}
|
|
2713
|
+
|
|
2714
|
+
/* Wikilinks in prose */
|
|
2715
|
+
.prose a.wikilink, .main a.wikilink {
|
|
2716
|
+
color: var(--accent);
|
|
2717
|
+
text-decoration: underline;
|
|
2718
|
+
text-decoration-color: var(--accent-soft);
|
|
2719
|
+
text-underline-offset: 3px;
|
|
2720
|
+
text-decoration-thickness: 1.5px;
|
|
2721
|
+
}
|
|
2722
|
+
.prose a.wikilink:hover, .main a.wikilink:hover { text-decoration-color: var(--accent); }
|
|
2723
|
+
.prose a.wikilink.broken, .main a.wikilink.broken {
|
|
2724
|
+
color: var(--err); text-decoration-color: var(--err);
|
|
2725
|
+
text-decoration-style: dashed;
|
|
2726
|
+
}
|
|
2727
|
+
|
|
2728
|
+
/* \u2014\u2014\u2014 Tables \u2014\u2014\u2014 */
|
|
2729
|
+
table {
|
|
2730
|
+
width: 100%; border-collapse: collapse;
|
|
2731
|
+
margin: 14px 0; font-size: 14px;
|
|
2732
|
+
}
|
|
2733
|
+
th, td {
|
|
2734
|
+
border-bottom: 1px solid var(--line);
|
|
2735
|
+
padding: 8px 12px; text-align: left;
|
|
2736
|
+
}
|
|
2737
|
+
th {
|
|
2738
|
+
background: var(--bg-sunk); font-weight: 600;
|
|
2739
|
+
color: var(--ink); font-size: 12.5px;
|
|
2740
|
+
text-transform: uppercase; letter-spacing: 0.04em;
|
|
2741
|
+
}
|
|
2742
|
+
tr:hover td { background: var(--bg-hover); }
|
|
2743
|
+
|
|
2744
|
+
/* \u2014\u2014\u2014 Entry cards \u2014\u2014\u2014 */
|
|
2745
|
+
.entry-card {
|
|
2746
|
+
background: var(--bg-raised); border: 1px solid var(--line);
|
|
2747
|
+
border-radius: var(--radius);
|
|
2748
|
+
padding: 14px 18px; margin: 10px 0;
|
|
2749
|
+
transition: border-color 0.15s, box-shadow 0.15s;
|
|
2750
|
+
}
|
|
2751
|
+
.entry-card:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); }
|
|
2752
|
+
.entry-card .meta-line {
|
|
2753
|
+
font-size: 11.5px; color: var(--muted);
|
|
2754
|
+
margin-bottom: 6px; font-family: var(--font-mono);
|
|
2755
|
+
}
|
|
2756
|
+
.entry-card h3 {
|
|
2757
|
+
font-family: var(--font-display); font-size: 19px; font-weight: 400;
|
|
2758
|
+
color: var(--ink); margin: 4px 0 6px;
|
|
2759
|
+
border: none; padding: 0;
|
|
2760
|
+
}
|
|
2761
|
+
.entry-card h3 a { color: inherit; }
|
|
2762
|
+
.entry-card h3 a:hover { color: var(--accent); }
|
|
2763
|
+
.entry-card p {
|
|
2764
|
+
color: var(--ink-2); font-size: 13.5px;
|
|
2765
|
+
line-height: 1.55; margin: 4px 0;
|
|
2766
|
+
}
|
|
2767
|
+
|
|
2768
|
+
/* \u2014\u2014\u2014 Backlinks \u2014\u2014\u2014 */
|
|
2769
|
+
.backlinks {
|
|
2770
|
+
margin-top: 40px; padding: 16px 18px;
|
|
2771
|
+
background: var(--bg-raised); border: 1px solid var(--line);
|
|
2772
|
+
border-radius: var(--radius);
|
|
2773
|
+
}
|
|
2774
|
+
.backlinks h4 {
|
|
2775
|
+
font-size: 11px; text-transform: uppercase;
|
|
2776
|
+
letter-spacing: 0.08em; color: var(--muted);
|
|
2777
|
+
font-weight: 600; margin-bottom: 8px;
|
|
2778
|
+
}
|
|
2779
|
+
.backlinks ul { list-style: none; padding: 0; margin: 0; }
|
|
2780
|
+
.backlinks li { padding: 4px 0; font-size: 13.5px; }
|
|
2781
|
+
|
|
2782
|
+
/* \u2014\u2014\u2014 Health issues list \u2014\u2014\u2014 */
|
|
2783
|
+
.health-list { display: flex; flex-direction: column; gap: 6px; }
|
|
2784
|
+
.health-row {
|
|
2785
|
+
display: grid; grid-template-columns: 96px 1fr 2fr;
|
|
2786
|
+
gap: 14px; align-items: center;
|
|
2787
|
+
padding: 10px 14px; background: var(--bg-raised);
|
|
2788
|
+
border: 1px solid var(--line); border-radius: var(--radius-sm);
|
|
2789
|
+
font-size: 13px;
|
|
2790
|
+
}
|
|
2791
|
+
.health-row .kind {
|
|
2792
|
+
font-family: var(--font-mono); font-size: 10.5px;
|
|
2793
|
+
text-transform: uppercase; letter-spacing: 0.06em;
|
|
2794
|
+
color: var(--muted);
|
|
2795
|
+
}
|
|
2796
|
+
.health-row .article { color: var(--ink); font-weight: 500; }
|
|
2797
|
+
.health-row .msg { color: var(--ink-2); }
|
|
2798
|
+
|
|
2799
|
+
@media (max-width: 900px) {
|
|
2800
|
+
.app { grid-template-columns: 1fr; }
|
|
2801
|
+
.topbar-logo { width: auto; border-right: none; }
|
|
2802
|
+
.sidebar { display: none; }
|
|
2803
|
+
.main { padding: 20px; grid-column: 1; }
|
|
2804
|
+
}
|
|
2805
|
+
`;function A(e,a,t,r=""){return`<!DOCTYPE html>
|
|
2806
|
+
<html lang="en">
|
|
2807
|
+
<head>
|
|
2808
|
+
<meta charset="utf-8">
|
|
2809
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
2810
|
+
<title>${p(e)} \u2014 AgentX Wiki</title>
|
|
2811
|
+
${Ut}
|
|
2812
|
+
<style>${Ft}</style>
|
|
2813
|
+
<script>(function(){try{var t=localStorage.getItem('wiki-theme');if(t)document.documentElement.setAttribute('data-theme',t)}catch(e){}})();</script>
|
|
2814
|
+
</head>
|
|
2815
|
+
<body>
|
|
2816
|
+
<div class="app">
|
|
2817
|
+
<header class="topbar">
|
|
2818
|
+
<a href="/" class="topbar-logo">
|
|
2819
|
+
<span class="mark">W</span>
|
|
2820
|
+
<span class="display">AgentX Wiki</span>
|
|
2821
|
+
</a>
|
|
2822
|
+
<form class="topbar-search" action="/search" method="get">
|
|
2823
|
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="7"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
|
|
2824
|
+
<input type="search" name="q" placeholder="Search every wiki\u2026" value="${p(r)}" autocomplete="off" />
|
|
2825
|
+
<kbd>\u2318K</kbd>
|
|
2826
|
+
</form>
|
|
2827
|
+
<div class="topbar-tools">
|
|
2828
|
+
<button class="icon-btn" id="wiki-theme-toggle" title="Toggle theme" aria-label="Toggle theme">
|
|
2829
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/></svg>
|
|
2830
|
+
</button>
|
|
2831
|
+
</div>
|
|
2832
|
+
</header>
|
|
2833
|
+
<nav class="sidebar">${a}</nav>
|
|
2834
|
+
<main class="main">${t}</main>
|
|
2835
|
+
</div>
|
|
2836
|
+
<script>
|
|
2837
|
+
(function(){
|
|
2838
|
+
var btn = document.getElementById('wiki-theme-toggle');
|
|
2839
|
+
if (!btn) return;
|
|
2840
|
+
btn.addEventListener('click', function(){
|
|
2841
|
+
var cur = document.documentElement.getAttribute('data-theme') === 'dark' ? '' : 'dark';
|
|
2842
|
+
if (cur) document.documentElement.setAttribute('data-theme', 'dark');
|
|
2843
|
+
else document.documentElement.removeAttribute('data-theme');
|
|
2844
|
+
try { localStorage.setItem('wiki-theme', cur); } catch(e){}
|
|
2845
|
+
});
|
|
2846
|
+
// Cmd/Ctrl-K focuses search
|
|
2847
|
+
document.addEventListener('keydown', function(e){
|
|
2848
|
+
if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === 'k') {
|
|
2849
|
+
e.preventDefault();
|
|
2850
|
+
var inp = document.querySelector('.topbar-search input');
|
|
2851
|
+
if (inp) inp.focus();
|
|
2852
|
+
}
|
|
2853
|
+
});
|
|
2854
|
+
})();
|
|
2855
|
+
</script>
|
|
2856
|
+
</body>
|
|
2857
|
+
</html>`}function _e(e){let a=new Map;for(let t of e){let r=t.path.includes("/")?t.path.split("/").slice(0,-1).join("/"):"/",n=a.get(r)||[];n.push(t),a.set(r,n)}return new Map([...a].sort((t,r)=>t[0].localeCompare(r[0])))}function $e(e){return e==="/"?"Root":e.split("/").pop().replace(/-/g," ")}function E(e,a){let t='<div class="nav-section">';t+=`<a class="nav-item${a?"":" active"}" href="/">Home</a>`,t+='<a class="nav-item" href="/entries">All entries</a>',t+="</div>";for(let r of e){let n=`/agent/${encodeURIComponent(r.agentId)}`;t+='<div class="nav-section">',t+=`<a class="nav-agent-header" href="${n}">`,t+=`<span class="name">${p(r.agentId)}</span>`,t+=`<span class="badge">${r.totalArticles}</span>`,t+="</a>",t+='<div class="nav-agent-children">';let o=_e(r.articles);for(let[i,s]of o){t+=`<div class="nav-agent-type-label">${$e(i)}</div>`;for(let d of s){let c=`${r.agentId}/${d.path}`===a;t+=`<a class="nav-item${c?" active":""}" href="${n}/article/${encodeURIComponent(d.path)}">${p(d.title)}</a>`}}t+="</div>",t+="</div>"}return t}function qt(e,a,t){let r=a||e.summary(),o=e.getSharedStore().listEntries().length,i=r.reduce((c,m)=>c+m.totalArticles,0),s=r.reduce((c,m)=>c+m.unabsorbed,0),d=new Set((t||[]).map(c=>c.agentId)),l=`<div class="page-head">
|
|
2858
|
+
<div>
|
|
2859
|
+
<h1>AgentX Wiki</h1>
|
|
2860
|
+
<p class="page-sub">Agent-owned institutional knowledge, typed and cross-referenced. Everything here compiles from raw conversation entries through the nightly absorb pass.</p>
|
|
2861
|
+
</div>
|
|
2862
|
+
</div>`;if(l+='<div class="stat-strip">',l+=`<div class="stat-cell"><div class="label">Agents</div><div class="number">${r.length}</div></div>`,l+=`<div class="stat-cell"><div class="label">Articles</div><div class="number">${i}</div></div>`,l+=`<div class="stat-cell"><div class="label">Raw entries</div><div class="number">${o}</div></div>`,s>0&&(l+=`<div class="stat-cell"><div class="label">Unabsorbed</div><div class="number">${s}</div></div>`),t&&t.length>0){let c=new Set(t.map(m=>m.nodeId));l+=`<div class="stat-cell"><div class="label">Mesh nodes</div><div class="number">${c.size}</div></div>`}l+="</div>",l+='<div class="section-head"><h2>Agent wikis</h2></div>',l+='<div class="agent-grid">';for(let c of r){let m=c.unabsorbed>0?`<span class="tag" style="color:var(--warn);background:color-mix(in oklch, var(--warn) 12%, transparent)">${c.unabsorbed} unabsorbed</span>`:'<span class="tag" style="color:var(--ok);background:color-mix(in oklch, var(--ok) 12%, transparent)">up to date</span>',u=d.has(c.agentId)&&!e.listAgents().includes(c.agentId)?' <span class="tag" style="color:var(--cool);background:var(--cool-soft)">remote</span>':"";if(l+='<div class="agent-card">',l+=`<h3><a href="/agent/${encodeURIComponent(c.agentId)}">${p(c.agentId)}</a>${u}</h3>`,l+=`<div class="agent-stats">
|
|
2863
|
+
<span><strong>${c.totalArticles}</strong> articles</span>
|
|
2864
|
+
<span><strong>${c.totalEntries}</strong> entries</span>
|
|
2865
|
+
${m}
|
|
2866
|
+
</div>`,c.articles.length>0){l+='<div class="article-list">';for(let x of c.articles.slice(0,6)){let f=H((x.tags||[]).slice(0,2),c.agentId);l+=`<div class="article-row">${f} <a class="article-title" href="/agent/${encodeURIComponent(c.agentId)}/article/${encodeURIComponent(x.path)}">${p(x.title)}</a></div>`}c.articles.length>6&&(l+=`<div class="article-row"><a class="article-title" style="color:var(--muted)" href="/agent/${encodeURIComponent(c.agentId)}">+ ${c.articles.length-6} more \u2192</a></div>`),l+="</div>"}l+="</div>"}return l+="</div>",A("Hub",E(r),l)}function Kt(e,a,t){let r=t||e.summary(),n=r.find(g=>g.agentId===a);if(!n)return A("Not Found",E(r),"<h1>Agent not found</h1>");let o=n.peerUrl!==void 0,i=e.getAgentEntries(a),s=n.articles||[],d=`<nav class="breadcrumb"><a href="/">Hub</a> <span class="sep">/</span> <span class="current">${p(a)}</span></nav>`;if(d+=`<div class="page-head"><div><h1>${p(a)}</h1>`,o&&(d+=`<p class="page-sub"><span class="tag" style="color:var(--cool);background:var(--cool-soft)">remote @ ${p(n.nodeId)}</span></p>`),d+="</div></div>",d+='<div class="stat-strip">',d+=`<div class="stat-cell"><div class="label">Articles</div><div class="number">${n.totalArticles}</div></div>`,d+=`<div class="stat-cell"><div class="label">Entries</div><div class="number">${n.totalEntries}</div></div>`,d+=`<div class="stat-cell"><div class="label">Unabsorbed</div><div class="number">${n.unabsorbed}</div></div>`,d+="</div>",s.length>0){d+='<div class="section-head"><h2>Articles</h2><span class="mono" style="font-size:12px;color:var(--muted)">'+s.length+" total</span></div>";let g=_e(s);for(let[u,x]of g){d+=`<h3 class="display" style="font-size:17px;color:var(--muted);font-weight:500;margin:20px 0 8px">${$e(u)}</h3>`,d+='<div class="agent-card" style="padding:4px 14px"><div class="article-list">';for(let f of x)d+=`<div class="article-row">${H((f.tags||[]).slice(0,3),a)} <a class="article-title" href="/agent/${encodeURIComponent(a)}/article/${encodeURIComponent(f.path)}">${p(f.title)}</a></div>`;d+="</div></div>"}}let l=i.slice(-5).reverse();if(l.length>0){d+='<div class="section-head"><h2>Recent entries</h2><a class="btn ghost" href="/entries">See all \u2192</a></div>';for(let g of l)d+=`<div class="entry-card">
|
|
2867
|
+
<div class="meta-line">${g.date} \xB7 via ${p(g.source)} \xB7 <code>${p(g.id)}</code></div>
|
|
2868
|
+
<p>${p(g.content.slice(0,300))}${g.content.length>300?"\u2026":""}</p>
|
|
2869
|
+
</div>`}let m=e.getAgentWiki(a).lint();if(m.length>0){d+=`<div class="section-head"><h2>Health issues</h2><span class="mono" style="font-size:12px;color:var(--warn)">${m.length}</span></div>`,d+='<div class="health-list">';for(let g of m)d+=`<div class="health-row">
|
|
2870
|
+
<span class="kind">${p(g.type)}</span>
|
|
2871
|
+
<span class="article">${p(g.article)}</span>
|
|
2872
|
+
<span class="msg">${p(g.message)}</span>
|
|
2873
|
+
</div>`;d+="</div>"}return A(a,E(r,a),d)}function Yt(e,a,t,r){let n=e.getAgentWiki(a),o=n.readArticle(t);if(!o)return null;let i=r||e.summary(),s=n.rebuildIndex(),d=new Map;for(let u of s.articles)d.set(u.title,u.path);let l=`/agent/${encodeURIComponent(a)}`,m=n.buildBacklinks()[o.meta.title]||[],g=`<nav class="breadcrumb"><a href="/">Hub</a> <span class="sep">/</span> <a href="${l}">${p(a)}</a> <span class="sep">/</span> <span class="current">${p(o.meta.title)}</span></nav>`;if(g+=`<article class="prose"><h1>${p(o.meta.title)}</h1>`,g+='<dl class="meta">',o.meta.type&&(g+=`<dt>Type</dt><dd>${Ta(o.meta.type,a)}</dd>`),o.meta.tags?.length&&(g+=`<dt>Tags</dt><dd>${H(o.meta.tags,a)}</dd>`),o.meta.owner&&(g+=`<dt>Owner</dt><dd>${p(o.meta.owner)}</dd>`),g+=`<dt>Created</dt><dd>${p(o.meta.created||"\u2014")}</dd>`,g+=`<dt>Updated</dt><dd>${p(o.meta.lastUpdated||"\u2014")}</dd>`,o.meta.sources?.length&&(g+=`<dt>Sources</dt><dd>${o.meta.sources.length} entries</dd>`),g+="</dl>",g+=oe(o.content,d,l),m.length>0){g+='<div class="backlinks"><h4>Pages that link here</h4><ul>';for(let u of m){let x=n.readArticle(u);g+=`<li><a href="${l}/article/${encodeURIComponent(u)}">${p(x?.meta.title||u)}</a></li>`}g+="</ul></div>"}return g+="</article>",A(o.meta.title,E(i,`${a}/${t}`),g)}function Jt(e,a){let t=a||e.summary(),n=e.getSharedStore().listEntries(),o='<nav class="breadcrumb"><a href="/">Hub</a> <span class="sep">/</span> <span class="current">Entries</span></nav>';o+='<div class="page-head"><div><h1>All raw entries</h1><p class="page-sub">Every conversation line that the ingest pipeline captured. Absorb compiles these into typed articles nightly.</p></div></div>';let i=new Map;for(let s of n){let d=i.get(s.date)||[];d.push(s),i.set(s.date,d)}for(let[s,d]of[...i].reverse()){o+=`<div class="section-head"><h2>${s}</h2><span class="mono" style="font-size:12px;color:var(--muted)">${d.length} entries</span></div>`;for(let l of d)o+=`<div class="entry-card">
|
|
2874
|
+
<div class="meta-line">
|
|
2875
|
+
<a href="/agent/${encodeURIComponent(l.agentId)}">${p(l.agentId)}</a>
|
|
2876
|
+
\xB7 via ${p(l.source)} \xB7 <code>${p(l.id)}</code>
|
|
2877
|
+
</div>
|
|
2878
|
+
<p>${p(l.content.slice(0,400))}${l.content.length>400?"\u2026":""}</p>
|
|
2879
|
+
</div>`}return A("All Entries",E(t),o)}function Gt(e,a,t){let r=t||e.summary(),n='<nav class="breadcrumb"><a href="/">Hub</a> <span class="sep">/</span> <span class="current">Search</span></nav>';n+=`<div class="page-head"><div><h1>\u201C${p(a)}\u201D</h1><p class="page-sub">Full-text search across every agent's wiki.</p></div></div>`;let o=0,i=[];for(let s of r){let l=e.getAgentWiki(s.agentId).findRelevant(a,void 0,10);if(l.length>0){i.push(`<div class="section-head"><h2>${p(s.agentId)}</h2><span class="mono" style="font-size:12px;color:var(--muted)">${l.length} match${l.length===1?"":"es"}</span></div>`);for(let c of l){let m=`/agent/${encodeURIComponent(s.agentId)}`;i.push(`<div class="entry-card">
|
|
2880
|
+
<div class="meta-line">${H((c.meta.tags||[]).slice(0,3),s.agentId)}</div>
|
|
2881
|
+
<h3><a href="${m}/article/${encodeURIComponent(c.path)}">${p(c.meta.title)}</a></h3>
|
|
2882
|
+
<p>${p(c.content.slice(0,240))}\u2026</p>
|
|
2883
|
+
</div>`)}o+=l.length}}return n+=i.join(""),o===0&&(n+='<p style="color:var(--muted);margin-top:24px">No matching articles found.</p>'),A(`Search: ${a}`,E(r),n,a)}function Xt(e,a,t){let r=t||e.summary(),n='<nav class="breadcrumb"><a href="/">Hub</a> <span class="sep">/</span> <span class="current">Tag</span></nav>';n+=`<div class="page-head"><div><h1>${p(a)}</h1><p class="page-sub">All articles tagged <span class="tag">${p(a)}</span>, across every agent.</p></div></div>`;let o=0;for(let i of r){let s;try{s=e.getAgentWiki(i.agentId)}catch{continue}let d=s.findByTags([a],void 0,100);if(d.length!==0){n+=`<div class="section-head"><h2>${p(i.agentId)}</h2><span class="mono" style="font-size:12px;color:var(--muted)">${d.length}</span></div>`;for(let l of d){let c=`/agent/${encodeURIComponent(i.agentId)}`;n+=`<div class="entry-card">
|
|
2884
|
+
<div class="meta-line">${H((l.meta.tags||[]).slice(0,6),i.agentId)}</div>
|
|
2885
|
+
<h3><a href="${c}/article/${encodeURIComponent(l.path)}">${p(l.meta.title)}</a></h3>
|
|
2886
|
+
</div>`}o+=d.length}}return o===0&&(n+=`<p style="color:var(--muted);margin-top:24px">No articles tagged <code>${p(a)}</code>.</p>`),A(`Tag: ${a}`,E(r),n)}function Vt(e,a,t,r){let n=r||e.summary(),o;try{o=e.getAgentWiki(a)}catch{return A(`Tag: ${t}`,E(n),`<h1>Agent not found: ${p(a)}</h1>`)}let i=o.findByTags([t],void 0,100),s=`/agent/${encodeURIComponent(a)}`,d=`<nav class="breadcrumb"><a href="/">Hub</a> <span class="sep">/</span> <a href="${s}">${p(a)}</a> <span class="sep">/</span> <span class="current">${p(t)}</span></nav>`;d+=`<div class="page-head"><div><h1>${p(t)}</h1><p class="page-sub">${i.length} article${i.length===1?"":"s"} tagged <code>${p(t)}</code> in <b>${p(a)}</b>.</p></div></div>`;for(let l of i)d+=`<div class="entry-card">
|
|
2887
|
+
<div class="meta-line">${H((l.meta.tags||[]).slice(0,6),a)}</div>
|
|
2888
|
+
<h3><a href="${s}/article/${encodeURIComponent(l.path)}">${p(l.meta.title)}</a></h3>
|
|
2889
|
+
</div>`;return A(`${a} \xB7 ${t}`,E(n),d)}function B(e,a,t){let r=e.rebuildIndex(),n=_e(r.articles.map(i=>({title:i.title,path:i.path,tags:i.tags}))),o='<div class="nav-section">';o+=`<div class="nav-section-title">${p(a)}</div>`,o+=`<a class="nav-item${t?"":" active"}" href="/">Home</a>`,o+='<a class="nav-item" href="/lint">Health check</a>',o+="</div>";for(let[i,s]of n){o+='<div class="nav-section">',o+=`<div class="nav-section-title">${$e(i)}</div>`;for(let d of s){let l=d.path===t;o+=`<a class="nav-item${l?" active":""}" href="/article/${encodeURIComponent(d.path)}">${p(d.title)}</a>`}o+="</div>"}return o}function Qt(e){let{wikiDir:a,agentFilter:t,peers:r=[],mode:n="graph",pathPrefix:o=""}=e,i=o.replace(/\/+$/,""),s=new De(a,void 0,n),d=new ne(s,a),l=r.length>0?new te(r):null;return async(c,m)=>{let g=new URL(c.url||"/","http://localhost"),u=decodeURIComponent(g.pathname),x=i&&u.startsWith(i)?u.slice(i.length)||"/":u,f=null,C=200;try{if(x.startsWith("/remote/")&&l){let w=x.slice(8).split("/article/");if(w.length===2){let[v,b]=w,h=v.indexOf("/"),$=decodeURIComponent(v.slice(0,h)),y=v.slice(h+1),S=await l.getRemoteArticle($,y,b);if(S){let O=await l.getRemoteAgents(),Y=[...s.summary(),...O.map(I=>({...I,agentId:`${I.agentId} @${I.nodeId}`}))],T=`<div class="breadcrumb"><a href="/">Hub</a> / <span class="tag">remote</span> ${p(y)} @ ${p($)}</div>`;T+=`<h1>${p(S.meta.title)}</h1>`,T+='<dl class="meta">',T+=`<dt>Tags</dt><dd>${(S.meta.tags||[]).map(I=>`<span class="tag">${I}</span>`).join(" ")}</dd>`,T+=`<dt>Owner</dt><dd>${p(S.meta.owner)}</dd>`,T+=`<dt>Source</dt><dd><span class="tag">remote</span> ${p($)}</dd>`,T+=`<dt>Updated</dt><dd>${S.meta.lastUpdated}</dd>`,T+="</dl>";let R=new Map;T+=oe(S.content,R),f=A(S.meta.title,E(Y),T)}}}if(!f&&t){let w=s.getAgentWiki(t);if(x==="/"||x===""){let v=w.rebuildIndex(),b=s.getAgentEntries(t),h=`<h1>${p(t)}</h1>`;if(h+='<div class="stats">',h+=`<div class="stat-card"><div class="number">${v.articles.length}</div><div class="label">Articles</div></div>`,h+=`<div class="stat-card"><div class="number">${b.length}</div><div class="label">Entries</div></div>`,h+="</div>",v.articles.length>0){h+="<h2>Articles</h2><table><tr><th>Title</th><th>Type</th><th>Updated</th></tr>";for(let $ of v.articles)h+=`<tr><td><a href="/article/${encodeURIComponent($.path)}">${p($.title)}</a></td><td><span class="tag">${($.tags||[]).slice(0,3).join(", ")}</span></td><td>${$.lastUpdated||""}</td></tr>`;h+="</table>"}f=A(t,B(w,t),h)}else if(x.startsWith("/article/")){let v=x.slice(9),b=w.readArticle(v);if(b){let h=w.rebuildIndex(),$=new Map;for(let S of h.articles)$.set(S.title,S.path);let y=`<h1>${p(b.meta.title)}</h1>`;y+='<dl class="meta">',y+=`<dt>Tags</dt><dd>${(b.meta.tags||[]).map(S=>`<span class="tag">${S}</span>`).join(" ")}</dd>`,y+=`<dt>Updated</dt><dd>${b.meta.lastUpdated}</dd>`,b.meta.sources?.length&&(y+=`<dt>Sources</dt><dd>${b.meta.sources.length} entries</dd>`),y+="</dl>",y+=oe(b.content,$),f=A(b.meta.title,B(w,t,v),y)}}else if(x==="/lint"){let v=w.lint(),b="<h1>Health Check</h1>";if(v.length===0)b+='<p style="color:green;">No issues.</p>';else{b+="<table><tr><th>Type</th><th>Article</th><th>Issue</th></tr>";for(let h of v)b+=`<tr><td><span class="tag">${h.type}</span></td><td>${p(h.article)}</td><td>${p(h.message)}</td></tr>`;b+="</table>"}f=A("Health Check",B(w,t),b)}else if(x==="/search"){let v=g.searchParams.get("q")||"",b=await w.findRelevantReranked(v,void 0,20),h=`<h1>Search: "${p(v)}"</h1>`;for(let $ of b)h+=`<div class="entry-card"><h3><a href="/article/${encodeURIComponent($.path)}">${p($.meta.title)}</a></h3><p>${p($.content.slice(0,200))}...</p></div>`;b.length===0&&(h+="<p>No results.</p>"),f=A(`Search: ${v}`,B(w,t),h)}else if(x.startsWith("/tag/")){let v=decodeURIComponent(x.slice(5)),b=w.findByTags([v],void 0,100),h=`<h1>Tag: <a class="tag" href="#">${p(v)}</a></h1>`;h+=`<p>${b.length} article${b.length===1?"":"s"} tagged <code>${p(v)}</code></p>`;for(let $ of b)h+=`<div class="entry-card"><h3><a href="/article/${encodeURIComponent($.path)}">${p($.meta.title)}</a></h3><div class="meta-line">${H(($.meta.tags||[]).slice(0,6))}</div></div>`;b.length===0&&(h+="<p>No articles with this tag.</p>"),f=A(`Tag: ${v}`,B(w,t),h)}}else if(!f&&(f=d.handle(x,g.searchParams))===null){let w=l?await l.getRemoteAgents():[],v=s.summary(),b=new Map(v.map(y=>[y.agentId,y])),h=[],$=new Set;for(let y of v){let S=w.find(O=>O.agentId===y.agentId);S&&S.totalArticles>y.totalArticles?h.push({...S,totalEntries:Math.max(y.totalEntries,S.totalEntries),unabsorbed:Math.max(y.unabsorbed,S.unabsorbed)}):h.push(y),$.add(y.agentId)}for(let y of w)$.has(y.agentId)||(h.push(y),$.add(y.agentId));if(x==="/agents")f=qt(s,h,w);else if(x==="/entries")f=Jt(s,h);else if(x==="/search")f=Gt(s,g.searchParams.get("q")||"",h);else if(x.startsWith("/tag/"))f=Xt(s,decodeURIComponent(x.slice(5)),h);else if(x.match(/^\/agent\/[^/]+\/tag\/.+/)){let y=x.match(/^\/agent\/([^/]+)\/tag\/(.+)$/);f=Vt(s,decodeURIComponent(y[1]),decodeURIComponent(y[2]),h)}else if(x.startsWith("/agent/")){let y=x.slice(7),S=y.indexOf("/article/");if(S===-1)f=Kt(s,y,h);else{let O=y.slice(0,S),Y=y.slice(S+9);if(f=Yt(s,O,Y,h),!f&&l){let T=w.find(R=>R.agentId===O);if(T){let R=await l.getRemoteArticle(T.peerUrl,O,Y);if(R){let I=`<div class="breadcrumb"><a href="/">Hub</a> / <span class="tag">remote @ ${p(T.nodeId)}</span> / ${p(O)}</div>`;I+=`<h1>${p(R.meta.title)}</h1>`,I+='<dl class="meta">',I+=`<dt>Tags</dt><dd>${(R.meta.tags||[]).map(Ga=>`<span class="tag">${Ga}</span>`).join(" ")}</dd>`,I+=`<dt>Source</dt><dd><span class="tag">remote</span> ${p(T.nodeId)}</dd>`,I+=`<dt>Updated</dt><dd>${R.meta.lastUpdated}</dd>`,I+="</dl>",I+=oe(R.content,new Map),f=A(R.meta.title,E(h),I)}}}}}}if(!f){C=404;let w=t?B(s.getAgentWiki(t),t):E(s.summary());f=A("Not Found",w,"<h1>Page not found</h1>")}}catch(w){C=500,f=A("Error","",`<h1>Error</h1><pre>${p(w.message)}</pre>`)}if(C===200&&e.curator){let w=Zt(s,d,x,t);w&&(f=Ca(f,w,e.curatorEndpoint,e.curatorToken?.(c)))}m.writeHead(C,{"Content-Type":"text/html; charset=utf-8"}),m.end(i?er(f,i):f)}}function Zt(e,a,t,r){let n,o;if(r&&t.startsWith("/article/"))n=r,o=t.slice(9);else if(!r&&t.startsWith("/agent/")){let d=t.match(/^\/agent\/([^/]+)\/article\/(.+)$/);d&&(n=d[1],o=d[2])}else if(!r)return a.pageAt(t);if(!n||!o||!e.listAgents([]).includes(n))return null;let i=e.getAgentWiki(n);if(!Ne(i.baseDir,o))return null;let s=i.readArticle(o);return s?{agentId:n,path:o,title:s.meta.title}:null}function er(e,a){e=e.replace(/(\s(?:href|action)=")\/(?!\/)/g,`$1${a}/`),e=e.replace(new RegExp(`(${a})${a}/`,"g"),`${a}/`);let t=`<a href="/admin" style="position:fixed;top:10px;right:14px;z-index:9999;padding:5px 11px;background:rgba(0,0,0,0.55);color:#fff;font:12px/1.2 'IBM Plex Sans',system-ui,sans-serif;text-decoration:none;border-radius:6px;border:1px solid rgba(255,255,255,0.18);backdrop-filter:blur(6px)">\u2190 Dashboard</a>`;return e=e.replace(/<body([^>]*)>/,`<body$1>${t}`),e}function co(e,a=4200,t,r=[],n="graph"){let o=Qt({wikiDir:e,agentFilter:t,peers:r,mode:n});Lt((s,d)=>{o(s,d)}).listen(a)}import{existsSync as ar,readFileSync as tr}from"fs";ce();function fo(e){let a=q(e),t={};if(ar(a))try{t=F(JSON.parse(tr(a,"utf-8")))}catch{t={}}let r=t?.workflows?.required??{},n={};for(let[o,i]of Object.entries(r.agents??{}))typeof i=="boolean"&&(n[o]=i);return{enabled:typeof r.enabled=="boolean"?r.enabled:G.enabled,agents:n,exemptQuestions:typeof r.exemptQuestions=="boolean"?r.exemptQuestions:G.exemptQuestions,retentionDays:Number.isInteger(r.retentionDays)&&r.retentionDays>=0?r.retentionDays:G.retentionDays,engine:t?.workflows?.enabled===!0}}async function ho(e,a={}){return e.retentionDays!==void 0&&!(Number.isInteger(e.retentionDays)&&e.retentionDays>=0&&e.retentionDays<=3650)?{success:!1,error:"retentionDays is a whole number of days from 0 to 3650"}:e.agent&&!/^[A-Za-z0-9_.@-]{1,80}$/.test(e.agent.id)?{success:!1,error:`"${e.agent.id}" is not an agent id`}:J(t=>{let r=t.workflows??={},n=r.required??={};if(e.enabled!==void 0&&(n.enabled=e.enabled),e.exemptQuestions!==void 0&&(n.exemptQuestions=e.exemptQuestions),e.retentionDays!==void 0&&(n.retentionDays=e.retentionDays),e.agent){let o=n.agents??={};e.agent.value===null?delete o[e.agent.id]:o[e.agent.id]=e.agent.value}(e.enabled===!0||e.agent?.value===!0)&&(r.enabled=!0)},{configPath:a.configPath,reload:a.reload})}var rr={"claude-code":{bin:"claude",login:"Install Claude Code (https://claude.com/claude-code) and run `claude` once to log in"},"codex-cli":{bin:"codex",login:"Install Codex CLI and run `codex login`"},opencode:{bin:"opencode",login:"Install OpenCode and run `opencode auth login`"}};function nr(e){if(typeof e!="string")return null;let a=e.match(/^\$\{(\w+)\}$/);return a?a[1]:null}function vo(e){let a=e.rawConfig?.agents?.[e.agentId];if(!a)return{ready:!1,hint:`No agent "${e.agentId}" in agentx.json.`};let t=String(a.tier||""),r=rr[t];if(r)return e.hasBinary(r.bin)?e.cliLoggedIn?.(r.bin)===!1?{ready:!1,need:"cli",cli:r.bin,hint:`${r.bin} is installed but not logged in. In a terminal, run \`${r.bin}\` once and log in, then press Check again.`}:{ready:!0}:{ready:!1,need:"cli",cli:r.bin,hint:`${r.login}, then press Check again.`};if(t==="sdk"||t==="orchestrator"){let n=a.provider||(t==="sdk"?"claude":"claude-code"),o=e.rawConfig?.providers?.[n];if(t==="orchestrator"&&!(o&&"apiKey"in o))return{ready:!0};let i=o?.apiKey,s=nr(i);return s?e.env[s]||e.dotenv[s]?{ready:!0}:{ready:!1,need:"key",envVar:s,hint:`Paste an API key for "${n}". It is saved to .env as ${s} on this computer only.`}:typeof i=="string"&&i.trim()?{ready:!0}:{ready:!1,hint:`Set providers.${n}.apiKey in agentx.json.`}}return{ready:!0}}import{appendFileSync as or,chmodSync as ir,existsSync as Ia,readFileSync as za,writeFileSync as sr}from"fs";function dr(e){return Ia(e)?Object.fromEntries(Pe(za(e,"utf-8"))):{}}function _o(e,a,t){if(!/^[A-Z_][A-Z0-9_]*$/.test(a))throw new Error(`not an environment variable name: ${a}`);if(!t||/[\r\n]/.test(t))throw new Error("the value must be one non-empty line");if(dr(e)[a])return!1;if(!Ia(e))return sr(e,`# AgentX environment variables
|
|
2890
|
+
# (Never commit this file: it contains secrets.)
|
|
2891
|
+
|
|
2892
|
+
${a}=${t}
|
|
2893
|
+
`,{mode:384}),!0;try{ir(e,384)}catch{}let r=za(e,"utf-8"),n=r===""||r.endsWith(`
|
|
2894
|
+
`)?"":`
|
|
2895
|
+
`;return or(e,`${n}${a}=${t}
|
|
2896
|
+
`),!0}import{execFileSync as lr}from"child_process";function Co(e){if(e!=="claude")return null;let a=qe(e);if(!a)return null;try{let t=lr(a,["auth","status"],{encoding:"utf-8",timeout:1e4,stdio:["ignore","pipe","ignore"]});return Pa(t)}catch(t){return typeof t?.stdout=="string"?Pa(t.stdout):null}}function Pa(e){try{let a=JSON.parse(e);return typeof a?.loggedIn=="boolean"?a.loggedIn:null}catch{return null}}import{existsSync as ja,readdirSync as xr}from"fs";import{join as Na}from"path";import{join as cr}from"path";function Ea(e){return/^[\w@%+=:,./-]+$/.test(e)?e:`'${e.replace(/'/g,"'\\''")}'`}function U(e){return(a,t)=>`cd ${Ea(t)} && npx -y skills add ${Ea(a)} -a ${e} -y`}var ie={tier:"claude-code",skillDirs:e=>[cr(e,".claude","skills")],addSkillCommand:U("claude-code"),instructionsFile:"CLAUDE.md"};import{join as pr}from"path";var Ra={tier:"codex-cli",skillDirs:e=>[pr(e,".agents","skills")],addSkillCommand:U("codex"),instructionsFile:"AGENTS.md"};import{join as Se}from"path";var Oa={tier:"opencode",skillDirs:e=>[Se(e,".agents","skills"),Se(e,".opencode","skills"),Se(e,".claude","skills")],addSkillCommand:U("opencode"),instructionsFile:"AGENTS.md"};import{join as Ae}from"path";var Da=e=>({...ie,tier:e,skillDirs:a=>[Ae(a,".claude","skills"),Ae(a,".skills"),Ae(a,"skills")]}),Ma=Da("sdk"),Ha=Da("orchestrator");var gr={"claude-code":ie,"codex-cli":Ra,opencode:Oa,sdk:Ma,orchestrator:Ha};function La(e){return gr[e??"claude-code"]??null}function Jo(e,a){return La(e)?.skillDirs(a)[0]??null}function Go(e,a){let t=new Map;for(let r of La(e)?.skillDirs(a)??[])if(ja(r))for(let n of xr(r))n.startsWith(".")||t.has(n)||ja(Na(r,n,"SKILL.md"))&&t.set(n,Na(r,n));return[...t].map(([r,n])=>({name:r,dir:n})).sort((r,n)=>r.name.localeCompare(n.name))}Xa();function Qo(e,a,t=20){return e.prepare(`SELECT task_id, agent_id, channel, chat_id, status, started_at, finished_at, message_preview
|
|
2897
|
+
FROM task_traces
|
|
2898
|
+
WHERE person = ? AND (channel IS NULL OR channel != 'a2a')
|
|
2899
|
+
ORDER BY started_at DESC, rowid DESC LIMIT ?`).all(a,Math.max(1,Math.min(t,500))).map(n=>({taskId:n.task_id,agentId:n.agent_id,channel:n.channel,chatId:n.chat_id,status:n.status,startedAt:n.started_at,finishedAt:n.finished_at??null,messagePreview:n.message_preview}))}function ur(e){return e.prepare("SELECT 1 FROM sqlite_master WHERE type = 'table' AND name = 'requests'").get()?e.prepare("PRAGMA table_info(requests)").all().some(r=>r.name==="person"):!1}function Wa(e,a,t,r,...n){return ur(e)?e.prepare(`SELECT id, state, channel, agent_id, text, created_at FROM requests
|
|
2900
|
+
WHERE person = ? AND state IN (${t.map(()=>"?").join(",")})
|
|
2901
|
+
${r}`).all(a,...t,...n).map(i=>({id:i.id,state:i.state,channel:i.channel,agentId:i.agent_id,text:i.text,createdAt:i.created_at})):[]}function Zo(e,a){return Wa(e,a,de,"ORDER BY created_at")}function ei(e,a,t=50){return Wa(e,a,[...de,...Te],"ORDER BY created_at DESC, rowid DESC LIMIT ?",Math.max(1,Math.min(t,500)))}Va();var Ce="member:",mr=90,fr="members",hr="tailscale-user-login",br=400,vr=60*60*1e3;function wr(e){let a=e.scopes.find(t=>t.startsWith(Ce));return a?a.slice(Ce.length):null}function Ua(e,a){if(!e)return null;let t=a.verify(e),r=t?wr(t):null;return t&&r?{rec:t,personId:r}:null}function si(e,a){let t=e.people().find(s=>s.id===a);if(!t)return{ok:!1,error:`No person "${a}". Add them first: agentx people add ${a} --name "\u2026"`};let{token:r,record:n}=e.tokens.create({name:`${t.name} (machine not paired yet)`,scopes:[`${Ce}${t.id}`],expiresInDays:mr}),{code:o,expiresAt:i}=e.codes.create({token:r,tokenId:n.id,name:t.id});return e.members.log({person:t.id,device:n.id,event:"invited"}),{ok:!0,code:o,expiresAt:i,tokenId:n.id,person:t}}var yr=Math.round(Me/6e4);function kr(e){return e==="client"?"Your project":"My work"}function di(e){let a=kr(e.person.role),t=e.person.role==="client"?`I use AgentX to keep track of the work I do for you. It has a page for you, "${a}": what you asked us for, and where each request stands.`:`I use AgentX to give our AI agents their jobs. It has a page for you, "${a}": what you asked the agents for, and where each request stands.`;return[`Hi ${e.person.name},`,"",t,"","To open it:","1. Accept the Tailscale share I sent you. Tailscale is a small program that connects your computer to mine, privately.",`2. Open ${e.origin.replace(/\/+$/,"")}/member in Edge or Chrome, give your computer a name and type this code: ${He(e.code)}`,` The code works once, for ${yr} minutes. If it has stopped working, tell me and I will send you a new one.`,"","I then approve your machine, and the page opens by itself."].join(`
|
|
2902
|
+
`)}var _r="The private network says someone else is connecting from this machine. Ask the person who invited you for a new code.",$r="Too many machines are waiting for the owner's answer. Try again later.",Ba="That code didn't work. Check it, or ask the person who invited you for a new one.",Fa=(e,a)=>{let t=e.headers[a];return(Array.isArray(t)?t[0]:t||"").trim()};function qa(e){let a=e.socket?.remoteAddress||"";return a==="127.0.0.1"||a==="::1"||a==="::ffff:127.0.0.1"}function Sr(e){if(!qa(e))return null;let a=Fa(e,hr).toLowerCase();return a?a.slice(0,80):null}function Ar(e){let a=e.socket?.remoteAddress||"unknown";if(!qa(e))return a;let t=Fa(e,"x-forwarded-for").split(",").pop().trim();return/^[0-9a-fA-F:.]{2,45}$/.test(t)?t:a}function Cr(e){return typeof e=="string"?e.replace(/[^\p{L}\p{N} ._'()-]/gu," ").replace(/\s+/g," ").trim().slice(0,60):""}function Tr(e){return e.identities.map(Ie).filter(a=>!!a&&a.channel==="tailscale").map(a=>a.value)}async function li(e,a){let t=Date.now(),r=a.now??Date.now,n=a.log??(b=>console.log(b)),o=Ar(e),i=a.limiter.retryAfter(o);if(i>0)return n(`[member] pair-code refused from ${o}: locked out for ${i}s more`),{status:429,body:{error:"too many attempts",retryAfter:i},retryAfter:i};let s=null,d="";try{let b=await V(e,2048);s=b.code,d=Cr(b.machine)}catch{}let l=a.codes.redeem(s),c=l?Ua(l.token,a.tokens):null;if(await zr(t,a.minMs??br),!l||!c)return a.limiter.fail(o),n(`[member] pair-code failed from ${o}`),{status:401,body:{error:Ba}};a.limiter.succeed(o);let{rec:m,personId:g}=c,u=a.people().find(b=>b.id===g);if(!u)return a.tokens.revoke(m.id),a.members.log({person:g,device:m.id,event:"refused",address:o,detail:"person no longer listed"}),n(`[member] pair-code for ${g} refused from ${o}: person no longer listed`),{status:403,body:{error:Ba}};let x=Sr(e),f=Tr(u);if(f.length&&(!x||!f.includes(x)))return a.tokens.revoke(m.id),a.members.log({person:g,device:m.id,event:"refused",address:o,detail:`network login ${x??"missing"}; expected ${f.join(" or ")}`}),n(`[member] ${g}: pairing from ${o} refused: the network says "${x??"nobody"}", expected ${f.join(" or ")}`),{status:403,body:{error:_r}};let C=d||"Unnamed machine",w=u.name.slice(0,40),v=je(a.root,{title:`New machine for ${w}`,ask:`From ${o}, ${x?`network login ${x}`:"no network login reported"}. Machine name, as typed there: "${C}". Let it see ${w}'s own work?`,recommend:`Yes if ${w} told you they just paired this machine. No if you did not expect it.`,if_silent:"discard",raised_by:fr},{now:r()});return v.ok?(a.members.add({tokenId:m.id,personId:g,name:C,state:"pending",cardId:v.card.id,address:o,...x?{network:x}:{},createdAt:new Date(r()).toISOString()}),a.members.log({person:g,device:m.id,event:"paired",address:o,detail:C}),n(`[member] ${g} paired "${C}" from ${o}; waiting for the owner (card ${v.card.id})`),{status:200,body:{person:g,name:C,state:"pending"},token:l.token}):(a.tokens.revoke(m.id),a.members.log({person:g,device:m.id,event:"refused",address:o,detail:v.error}),n(`[member] ${g}: pairing from ${o} refused: ${v.error}`),{status:503,body:{error:$r}})}var se="this machine is not paired",Ir="waiting for the owner to approve this machine";function Ka(e){return e?e.status==="decided"?e.verdict??null:e.status==="expired"?"no":null:null}function ci(e,a){return a.state==="pending"&&a.cardId?Ka(pe(e,a.cardId)):null}function pi(e,a,t){let r=a.now??Date.now,n=a.log??(c=>console.log(c)),o=Ua(e,a.tokens);if(!o)return{ok:!1,status:401,error:se};let{rec:i,personId:s}=o,d=a.members.byToken(i.id);if(!d||d.state==="removed"||d.personId!==s)return{ok:!1,status:401,error:se};if(a.people&&!a.people().some(c=>c.id===s))return Ya(a,i.id,"person no longer listed"),n(`[member] ${s}: "${d.name}" ended: person no longer listed`),{ok:!1,status:401,error:se};if(d.state==="pending"){let c=d.cardId?pe(a.root,d.cardId):null,m=Ka(c);if(m==="yes")d=a.members.update(i.id,{state:"active",approvedAt:new Date(r()).toISOString()})??d,a.members.log({person:s,device:i.id,event:"approved",detail:c?.decided_by}),n(`[member] ${s}: "${d.name}" approved`);else if(m==="no"){let g=c?.status==="expired"?"the owner did not answer in time":"the owner said no";return a.tokens.revoke(i.id),a.members.update(i.id,{state:"removed",removedAt:new Date(r()).toISOString(),removedReason:g}),a.members.log({person:s,device:i.id,event:"refused",detail:g}),n(`[member] ${s}: "${d.name}" refused: ${g}`),{ok:!1,status:401,error:se}}else return{ok:!1,status:403,error:Ir,waiting:!0}}let l=d.lastSeenAt?Date.parse(d.lastSeenAt):0;return t&&(r()-l>=vr||d.lastAddress!==t)&&(d=a.members.update(i.id,{lastSeenAt:new Date(r()).toISOString(),lastAddress:t})??d,a.members.log({person:s,device:i.id,event:"signed-in",address:t})),{ok:!0,device:d,personId:s,rec:i}}function Ya(e,a,t="removed by the owner"){let r=e.members.byToken(a);if(!r)return null;e.tokens.revoke(a);let n=e.members.update(a,{state:"removed",removedAt:new Date((e.now??Date.now)()).toISOString(),removedReason:t});return e.members.log({person:r.personId,device:a,event:"removed",detail:t}),n}function xi(e,a){return e.members.devices(a).filter(t=>t.state!=="removed").map(t=>Ya(e,t.tokenId,"person removed by the owner")).filter(t=>!!t)}async function zr(e,a){let t=e+a-Date.now();t>0&&await new Promise(r=>setTimeout(r,t))}var Ja=["gitlab","github"];function Pr(e,a,t){let r=String(a||"").trim().toLowerCase();if(!Ja.includes(r))throw new Error(`Request status works on ${Ja.join(" and ")}, not on "${a}".`);e.requestStatus=e.requestStatus&&typeof e.requestStatus=="object"?e.requestStatus:{};let n=Array.isArray(e.requestStatus.channels)?e.requestStatus.channels.map(o=>String(o).toLowerCase()):[];return e.requestStatus.channels=t?[...new Set([...n,r])]:n.filter(o=>o!==r),`request status on ${r} is ${t?"on":"off"}`}function mi(e){return Array.isArray(e?.requestStatus?.channels)?e.requestStatus.channels.map(a=>String(a).toLowerCase()):[]}function fi(e){let{summary:a}=Q(t=>Pr(t,e?.channel,!!e?.enabled));return{summary:a}}var bi="https://myaccount.google.com/apppasswords";function vi(e){let a=e.split("@")[1]?.toLowerCase()??"";if(a==="gmail.com"||a==="googlemail.com")return{imapHost:"imap.gmail.com",imapPort:993,smtpHost:"smtp.gmail.com",smtpPort:465}}function wi(e){let a=e.user&&e.user!==e.address?{user:e.user}:{};return{agent:e.agent,address:e.address,imap:{host:e.imapHost,port:e.imapPort,secure:e.imapPort===993,...a,password:`\${${e.passwordEnv}}`},smtp:{host:e.smtpHost,port:e.smtpPort,secure:e.smtpPort===465},allowFrom:e.allowFrom,send:e.send}}function yi(e){return`EMAIL_${e.toUpperCase().replace(/[^A-Z0-9]/g,"_")}_PASSWORD`}function _i(e){return new Set(Object.entries(e).filter(([,a])=>a?.wiki?.absorb?.enabled===!1).map(([a])=>a))}function $i(e,a){return a.only?{agents:[a.only],skipped:[]}:{agents:e.filter(t=>!a.off.has(t)),skipped:e.filter(t=>a.off.has(t))}}function Si(e,a){return`absorb is off for this agent (agents.${e}.wiki.absorb.enabled); skipped.${e===a?" It reads the wiki notes inbox, so the inbox was not read.":""} Use --agent ${e} to run it anyway.`}function Ai(e,a){if(a){if(!e.wiki?.absorb)return;delete e.wiki.absorb.enabled,Object.keys(e.wiki.absorb).length===0&&delete e.wiki.absorb,Object.keys(e.wiki).length===0&&delete e.wiki;return}e.wiki??={},e.wiki.absorb??={},e.wiki.absorb.enabled=!1}var Er="https://ntfy.sh";function Ti(e){return{enabled:!!e?.enabled,server:e?.server||Er,topicSet:!!e?.topic,tokenSet:!!e?.token}}function Ii(e,a){let t={...e??{}};if("enabled"in a&&(t.enabled=!!a.enabled),"server"in a){let r=String(a.server).trim().replace(/\/+$/,"");if(!/^https?:\/\/\S+$/.test(r))throw new Error("ntfy server must be an http(s) URL");t.server=r}if("topic"in a){let r=String(a.topic).trim();if(!r)throw new Error("ntfy topic cannot be empty");t.topic=r}if("token"in a){let r=String(a.token??"").trim();r?t.token=r:delete t.token}if(t.enabled&&!t.topic)throw new Error("set a topic before enabling ntfy");return t}export{fe as a,na as b,be as c,Za as d,et as e,at as f,tt as g,rt as h,nt as i,ot as j,it as k,ca as l,mt as m,yn as n,kn as o,_n as p,vo as q,dr as r,_o as s,Co as t,La as u,Jo as v,Go as w,zn as x,Pn as y,It as z,Et as A,ve as B,En as C,Rn as D,Rt as E,Nn as F,Ln as G,Wn as H,Qo as I,Zo as J,ei as K,mr as L,si as M,yr as N,kr as O,di as P,Ar as Q,li as R,ci as S,pi as T,Ya as U,xi as V,Ja as W,Pr as X,mi as Y,fi as Z,bi as _,vi as $,wi as aa,yi as ba,_i as ca,$i as da,Si as ea,Ai as fa,Ti as ga,Ii as ha,Qt as ia,co as ja,fo as ka,ho as la};
|
|
2903
|
+
//# sourceMappingURL=chunk-XPE2WKPF.js.map
|