jaxon-agents 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.agent.md +203 -168
- package/README.md +51 -34
- package/README.zh-CN.md +55 -38
- package/dist/BUILD_INFO.json +3 -3
- package/dist/PACKAGE_MANIFEST.json +63 -42
- package/dist/RELEASE_META.json +8 -2
- package/dist/agents/directory-store.js +66 -11
- package/dist/agents/jaxon-admin.entry.js +5 -3
- package/dist/agents/session-switch.js +6 -0
- package/dist/api/mcp-tools.js +76 -45
- package/dist/connections/health.js +4 -1
- package/dist/console/activity-client.js +644 -0
- package/dist/console/activity-page.js +24 -0
- package/dist/console/activity-topics.js +698 -0
- package/dist/console/activity.js +379 -0
- package/dist/console/assets.js +394 -241
- package/dist/console/chat-library.js +685 -0
- package/dist/console/console-info.js +30 -0
- package/dist/console/icons.js +14 -0
- package/dist/console/pages.js +94 -31
- package/dist/console/server.js +58 -8
- package/dist/console/station-pages.js +83 -25
- package/dist/daemon/client.js +1 -1
- package/dist/daemon/host.js +16 -3
- package/dist/environment/pi-launch-spec.js +1 -1
- package/dist/index.js +87 -8
- package/dist/launcher.js +17 -26
- package/dist/ops/catalog.js +18 -14
- package/dist/ops/core.js +157 -77
- package/dist/pi-host/history-reader.js +20 -0
- package/dist/pi-host/mcp-bridge.entry.js +55 -7
- package/dist/platform/index.js +22 -0
- package/dist/platform/linux.js +64 -0
- package/dist/release/handoff.js +6 -8
- package/dist/release/store.js +3 -13
- package/dist/sessions/dashboard-usage.js +5 -3
- package/dist/sessions/supervisor.js +449 -60
- package/dist/stations/activity.js +24 -28
- package/dist/stations/boards.js +10 -5
- package/dist/stations/cues.js +71 -48
- package/dist/stations/interactions.js +75 -0
- package/dist/stations/member-instructions.js +23 -0
- package/dist/stations/station-member.entry.js +31 -14
- package/examples/README.md +23 -8
- package/examples/agents/README.md +93 -35
- package/examples/agents/coder/README.md +37 -0
- package/examples/agents/custom-gateway/README.md +42 -0
- package/examples/agents/local-qwen/README.md +46 -0
- package/examples/agents/planner/README.md +39 -0
- package/examples/agents/reviewer/README.md +42 -0
- package/examples/mcp-clients/README.md +35 -16
- package/examples/stations/README.md +98 -21
- package/examples/stations/dev-loop/README.md +40 -0
- package/examples/stations/parallel-coders/README.md +40 -0
- package/examples/stations/parallel-coders/STATION.md +2 -2
- package/examples/stations/research-writer/README.md +39 -0
- package/examples/stations/research-writer/STATION.md +1 -1
- package/examples/workflows/01-dev-loop-e2e.md +27 -5
- package/examples/workflows/02-human-auth-and-roster-switch.md +25 -3
- package/examples/workflows/README.md +17 -0
- package/package.json +8 -2
- package/runtime/provenance.json +3 -3
- package/runtime/runtime-lock.json +2 -2
- package/runtime/runtime-package.json +1 -1
package/dist/console/assets.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ACTIVITY_JS } from "./activity-client.js";
|
|
1
2
|
export const JAXON_LOGO_URL = "/assets/jaxon-logo.svg";
|
|
2
3
|
export const STYLE_CSS = String.raw `
|
|
3
4
|
:root{color-scheme:dark;--bg:#0d1117;--panel:#151b23;--panel2:#1c2430;--text:#e6edf3;--muted:#9aa7b5;--line:#303a46;--accent:#6ca8ff;--green:#4ec98b;--red:#ff7b72;--yellow:#e3b341;font:15px/1.5 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text)}a{color:var(--accent);text-decoration:none}a:hover{text-decoration:underline}.topbar{position:sticky;top:0;z-index:5;display:flex;align-items:center;gap:2rem;padding:.8rem max(1rem,calc((100vw - 1440px)/2));background:#0d1117ee;border-bottom:1px solid var(--line);backdrop-filter:blur(10px)}.brand{font-weight:750;color:var(--text);white-space:nowrap}.topbar nav{display:flex;gap:1.2rem;flex-wrap:wrap}main{max-width:1440px;margin:0 auto;padding:1.5rem}main.login{max-width:720px;padding-top:12vh}footer{max-width:1440px;margin:2rem auto;padding:1rem;color:var(--muted);border-top:1px solid var(--line)}h1{font-size:1.8rem;line-height:1.2;margin:.2rem 0}h2{font-size:1.2rem;margin:.2rem 0 1rem}h3{font-size:1rem;margin:.3rem 0}p{margin:.5rem 0}.page-heading,.section-heading{display:flex;justify-content:space-between;align-items:center;gap:1rem}.page-heading{margin-bottom:1.2rem}.page-heading p,.muted,small{color:var(--muted)}section{margin:1.5rem 0}.card{background:var(--panel);border:1px solid var(--line);border-radius:10px;padding:1.1rem;margin:1rem 0}.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:1rem}.cards.three{grid-template-columns:repeat(auto-fit,minmax(300px,1fr))}.cards.two{grid-template-columns:repeat(auto-fit,minmax(360px,1fr))}.banner{padding:1rem;border:1px solid var(--yellow);border-radius:8px;background:#e3b34112}.banner.error,.error{border-color:var(--red)}.warning{color:#f0d79a}.badge{display:inline-block;padding:.18rem .5rem;border-radius:999px;background:#303a46;color:var(--text);font-size:.78rem;font-weight:650;white-space:nowrap}.badge.ready,.badge.active,.badge.succeeded,.badge.fulfilled,.badge.completed{background:#174d35;color:#8ff0bc}.badge.open,.badge.running,.badge.starting,.badge.testing,.badge.waiting_input{background:#204779;color:#acd0ff}.badge.expired,.badge.failed,.badge.test_failed,.badge.degraded,.badge.cancelled{background:#5b2528;color:#ffb3ad}.badge.idle,.badge.dismissed,.badge.dormant{background:#3c3420;color:#eed493}dl.details{display:grid;grid-template-columns:minmax(110px,max-content) 1fr;gap:.4rem 1rem}dl.details dt{color:var(--muted)}dl.details dd{margin:0;min-width:0;overflow-wrap:anywhere}code,pre,textarea,input,select{font-family:ui-monospace,SFMono-Regular,Consolas,monospace}code{overflow-wrap:anywhere}pre{white-space:pre-wrap;overflow-wrap:anywhere;background:#0b1016;border:1px solid var(--line);padding:.75rem;border-radius:6px;max-height:36rem;overflow:auto}form{margin:.65rem 0}label{display:block;margin:.6rem 0;color:var(--muted)}input,textarea,select{display:block;width:100%;margin-top:.25rem;background:#0b1016;border:1px solid #3a4654;border-radius:6px;color:var(--text);padding:.55rem .65rem}input[type=checkbox]{display:inline-block;width:auto;margin-right:.4rem}input[readonly]{opacity:.75}textarea{resize:vertical;min-height:5rem}button{border:1px solid #3478c9;background:#2764aa;color:white;border-radius:6px;padding:.5rem .8rem;cursor:pointer;font-weight:600}button:hover{filter:brightness(1.15)}button:disabled{opacity:.55;cursor:wait}button.secondary{background:#252f3b;border-color:#4a5868}button.danger{background:#702e32;border-color:#a7464b}.actions{display:flex;gap:.45rem;align-items:flex-start;flex-wrap:wrap}.actions form{margin:.2rem 0}.inline-form{display:flex;align-items:end;gap:.6rem;flex-wrap:wrap}.inline-form label{margin:0}.grid-form{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:.2rem 1rem}.grid-form button{align-self:end;justify-self:start}.filters{display:flex;align-items:end;gap:.8rem;flex-wrap:wrap;background:var(--panel);padding:.8rem;border-radius:8px}.filters label{min-width:160px;margin:0}.table-wrap{overflow-x:auto;border:1px solid var(--line);border-radius:8px}table{width:100%;border-collapse:collapse;background:var(--panel)}th,td{text-align:left;vertical-align:top;padding:.65rem;border-bottom:1px solid var(--line)}th{color:var(--muted);font-size:.82rem;background:var(--panel2)}tr:last-child td{border-bottom:0}.empty{color:var(--muted);font-style:italic}.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:1rem}.stats div{background:var(--panel);border:1px solid var(--line);padding:1rem;border-radius:8px}.stats strong,.stats span{display:block}.stats strong{font-size:1.7rem}.stats span{color:var(--muted)}.danger-zone{border-color:#643237}.toast{position:fixed;right:1rem;bottom:1rem;z-index:10;max-width:480px;background:#243143;border:1px solid var(--accent);border-radius:8px;padding:.8rem 1rem;box-shadow:0 8px 30px #0008;white-space:pre-wrap}.toast.error{background:#482429;border-color:var(--red)}details{margin:.5rem 0}summary{cursor:pointer}summary h2{display:inline}.file pre{font-size:.82rem}.message{max-width:1100px;margin:1rem 0;padding:1rem;background:var(--panel);border:1px solid var(--line);border-radius:9px}.message.user{border-left:3px solid var(--accent)}.message.assistant{border-left:3px solid var(--green)}.message>header{display:flex;justify-content:space-between;gap:1rem}.message-text{background:transparent;border:0;padding:.2rem;max-height:none}.message img{display:block;max-width:min(100%,900px);max-height:700px;border-radius:6px}.message figcaption{color:var(--muted);font-size:.8rem}.terminal{background:#05080b;color:#b8f3cc;min-height:8rem;max-height:34rem;white-space:pre-wrap}.usage-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:1rem}.flow-events{padding-left:1.5rem}.flow-events li{margin:.8rem 0;padding-left:.3rem}.flow-events time{display:block;color:var(--muted);font-size:.8rem}.device-code{font-size:1.5rem;color:#ffe29a}.auth-link{font-size:1.1rem;font-weight:700}.secret-input{-webkit-text-security:disc}.flow-prompt{border-top:1px solid var(--line);padding-top:.7rem}@media(max-width:700px){main{padding:1rem}.topbar{align-items:flex-start;gap:.6rem;flex-direction:column}.topbar nav{gap:.8rem}.cards.two,.cards.three{grid-template-columns:1fr}dl.details{grid-template-columns:1fr}dl.details dd{margin-bottom:.5rem}.page-heading{align-items:flex-start}.table-wrap{font-size:.85rem}}
|
|
@@ -5,7 +6,7 @@ export const STYLE_CSS = String.raw `
|
|
|
5
6
|
:root {
|
|
6
7
|
--bg: #10161d; --panel: #18212b; --panel2: #202c38; --line: #303e4b;
|
|
7
8
|
--text: #ecf2f5; --muted: #a3b3c2; --accent: #99dccc; --conn-accent: var(--accent);
|
|
8
|
-
--conn-edge: var(--line); --rail-width: 13rem;
|
|
9
|
+
--conn-edge: var(--line); --rail-width: 13rem; --control-height: max(44px, 2.75rem);
|
|
9
10
|
font-family: Inter, "Segoe UI", system-ui, sans-serif;
|
|
10
11
|
}
|
|
11
12
|
body { min-height: 100vh; }
|
|
@@ -16,7 +17,8 @@ body { min-height: 100vh; }
|
|
|
16
17
|
background: #121b24; border-right: 1px solid var(--line); padding: 1.8rem 1rem; overflow-y: auto;
|
|
17
18
|
}
|
|
18
19
|
.rail .brand { display: flex; align-items: center; gap: .65rem; padding: 0 .45rem; letter-spacing: -.025em; }
|
|
19
|
-
.brand-mark { flex:
|
|
20
|
+
.brand-mark { display:block; flex:none; inline-size:32px; block-size:32px; }
|
|
21
|
+
.ui-icon { display:inline-block; flex:none; vertical-align:middle; }
|
|
20
22
|
.rail nav { display: grid; gap: .3rem; margin-top: 2.65rem; }
|
|
21
23
|
.rail nav a { border-radius: 7px; padding: .64rem .9rem; font-size: .94rem; font-weight: 550; color: var(--muted); }
|
|
22
24
|
.rail nav a:hover { background: #202c37; color: var(--text); text-decoration: none; }
|
|
@@ -53,6 +55,18 @@ button { min-height: 36px; border-radius: 7px; font: inherit; font-weight: 600;
|
|
|
53
55
|
.form-advanced { padding: .75rem 0; margin: .45rem 0; border-block: 1px solid var(--line); }
|
|
54
56
|
.card label, .filters label { color: #c8d5df; font-size: .92rem; }
|
|
55
57
|
input, select, textarea { font-family: inherit; font-size: 1rem; padding: .6rem .75rem; border-radius: 7px; }
|
|
58
|
+
:is(select, input:not([type="hidden"], [type="checkbox"], [type="radio"], [type="file"], [type="range"], [type="color"], [type="submit"], [type="button"], [type="reset"], [type="image"])) {
|
|
59
|
+
block-size: var(--control-height);
|
|
60
|
+
min-inline-size: 0;
|
|
61
|
+
}
|
|
62
|
+
:is(select, input:not([type="hidden"], [type="checkbox"], [type="radio"], [type="file"], [type="range"], [type="color"], [type="submit"], [type="button"], [type="reset"], [type="image"])), .conn-panel textarea {
|
|
63
|
+
margin-top: .4rem; border-radius: 8px; border-color: #455260; padding: .67rem .8rem;
|
|
64
|
+
background: #0f161e; color: #eff5f7; line-height: 1.4; font-weight: 400;
|
|
65
|
+
}
|
|
66
|
+
select { appearance: auto; cursor: pointer; padding-inline-end: 1.75rem; }
|
|
67
|
+
select:disabled { cursor: default; }
|
|
68
|
+
:is(.grid-form, .model-fields) > label:has(> :is(input:not([type="checkbox"], [type="radio"], [type="file"]), select)) { align-self: end; min-width: 0; }
|
|
69
|
+
.inline-form > button { min-block-size: var(--control-height); }
|
|
56
70
|
textarea[data-json], textarea[data-json-required], .secret-input { font-family: ui-monospace, monospace; font-size: .9rem; }
|
|
57
71
|
.stats { gap: .85rem; margin-bottom: 1.8rem; }
|
|
58
72
|
.stats > :is(a,div) { display: flex; flex-direction: column; align-items: start; gap: .2rem; padding: 1rem 1.25rem; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
|
|
@@ -80,14 +94,18 @@ td a { font-weight: 550; }
|
|
|
80
94
|
.status-group, .tag-list { display:flex; flex-wrap:wrap; gap:.35rem; align-items:center; }
|
|
81
95
|
.resource-tag { display:inline-block; overflow-wrap:anywhere; max-width:100%; padding:.13rem .5rem; border-radius:6px; border:1px solid var(--line); background:var(--panel2); color:#cbd9e0; font-size:.79rem; }
|
|
82
96
|
.station-list th:nth-child(4) { min-width:9rem; }
|
|
97
|
+
.station-heading { align-items:flex-start; flex-wrap:wrap; gap:.8rem 1.2rem; }
|
|
98
|
+
.station-heading-copy { flex:1 1 31rem; min-inline-size:0; max-inline-size:100%; overflow-wrap:anywhere; }
|
|
99
|
+
.station-heading .station-start { flex:none; gap:.4rem; max-inline-size:100%; white-space:normal; text-align:center; }
|
|
100
|
+
[data-station-live] > .resource-content { max-width:none; }
|
|
101
|
+
@media (max-width:600px) { .station-heading-copy { flex-basis:auto; } }
|
|
83
102
|
.badge.queued, .badge.joining, .badge.leaving, .badge.outsideeffectiveroster, .badge.formermember { background:#493b21; color:#f5d68c; }
|
|
84
103
|
.badge.warm { background:#204779; color:#acd0ff; }
|
|
85
104
|
.badge.missing { background:#5b2528; color:#ffb3ad; }
|
|
86
105
|
.badge.effective, .badge.activeowner { background:#174d35; color:#8ff0bc; }
|
|
87
106
|
.station-pending { border-inline-start:3px solid #b49150; }
|
|
88
107
|
.station-pending .row-actions { flex-wrap:wrap; }
|
|
89
|
-
.station-add-member {
|
|
90
|
-
.station-add-member :is(select, button) { min-height:40px; }
|
|
108
|
+
.station-add-member { margin-block:1rem; }
|
|
91
109
|
.station-ask-jaxon { margin-top:1.1rem; border-color:#507f73; background:#233b3a; }
|
|
92
110
|
.station-ask-jaxon .actions { align-items:center; margin-top:.75rem; }
|
|
93
111
|
.station-board h3 { overflow-wrap:anywhere; }
|
|
@@ -108,10 +126,14 @@ section > .empty, main > .empty { padding: 1rem 1.25rem; background: var(--panel
|
|
|
108
126
|
display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.35fr) auto;
|
|
109
127
|
align-items: end; gap: .8rem; padding: 0;
|
|
110
128
|
}
|
|
129
|
+
.filters-four { grid-template-columns: repeat(4, minmax(0, 1fr)) auto; }
|
|
111
130
|
.filters > label { display: grid; gap: .4rem; min-width: 0; margin: 0; }
|
|
112
131
|
.filters > label > :is(input, select) { margin: 0; min-width: 0; }
|
|
113
132
|
.filter-actions { display: flex; align-items: center; gap: .45rem; }
|
|
114
133
|
.filter-actions :is(a, button) { display: inline-flex; align-items: center; justify-content: center; height: var(--control-height); padding-inline: .85rem; }
|
|
134
|
+
@container (max-width: 49rem) {
|
|
135
|
+
.filters-four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
136
|
+
}
|
|
115
137
|
@container (max-width: 42rem) {
|
|
116
138
|
.filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
117
139
|
}
|
|
@@ -145,6 +167,8 @@ section > .empty, main > .empty { padding: 1rem 1.25rem; background: var(--panel
|
|
|
145
167
|
.tool-summary { min-width: 0; color: var(--muted); font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
146
168
|
.tool-status { color: var(--muted); font-size: .72rem; font-weight: 600; }
|
|
147
169
|
.tool-status.completed { color: #8ff0bc; }
|
|
170
|
+
.session-thinking .tool-output { color:#b4c3d0; }
|
|
171
|
+
.session-thinking-placeholder { display:flex; flex-wrap:wrap; gap:.35rem .75rem; padding:.55rem .65rem; color:var(--muted); }
|
|
148
172
|
.tool-status.failed { color: #ffb3ad; }
|
|
149
173
|
.tool-call > pre, .tool-detail { margin: 0 .55rem .55rem; }
|
|
150
174
|
.tool-output { max-height: 22rem; overflow: auto; font-size: .82rem; line-height: 1.5; }
|
|
@@ -266,11 +290,7 @@ section > .empty, main > .empty { padding: 1rem 1.25rem; background: var(--panel
|
|
|
266
290
|
.conn-kind input { width: auto; margin: 0; accent-color: var(--conn-accent); }
|
|
267
291
|
.conn-panel label small { color: #a9b7c5; font-weight: 400; }
|
|
268
292
|
.conn-panel input + small { display: block; margin-top: .3rem; }
|
|
269
|
-
|
|
270
|
-
select, input:where(:not([type]), [type="text"], [type="url"], [type="password"], [type="number"], [type="search"], [type="email"]) { height: var(--control-height); }
|
|
271
|
-
select, input:where(:not([type]), [type="text"], [type="url"], [type="password"], [type="number"], [type="search"], [type="email"]), .conn-panel textarea { min-height: var(--control-height); margin-top: .4rem; border-radius: 8px; border-color: #455260; padding: .67rem .8rem; background: #0f161e; color: #eff5f7; line-height: 1.4; font-family: inherit; font-size: 1rem; font-weight: 400; }
|
|
272
|
-
select { appearance: auto; cursor: pointer; padding-inline-end: 1.75rem; }
|
|
273
|
-
select:disabled { cursor: default; }
|
|
293
|
+
.conn-panel textarea { min-height: var(--control-height); }
|
|
274
294
|
.conn-panel :is(input, textarea)::placeholder { color: #8797a6; }
|
|
275
295
|
.conn-panel :is(input, textarea, select, summary, button):focus-visible { outline: 2px solid var(--conn-accent); outline-offset: 3px; }
|
|
276
296
|
.conn-panel button { min-height: 40px; border-radius: 8px; padding-inline: 1rem; }
|
|
@@ -326,16 +346,7 @@ select:disabled { cursor: default; }
|
|
|
326
346
|
.jaxon-dock { position:fixed; bottom:max(1rem,env(safe-area-inset-bottom)); right:max(1rem,env(safe-area-inset-right)); z-index:8; }
|
|
327
347
|
#jaxon-launch { display:flex; align-items:center; gap:.5rem; border-radius:2rem; padding:.75rem 1.15rem; box-shadow:0 4px 18px #0005; }
|
|
328
348
|
.jaxon-dock [hidden] { display:none !important; }
|
|
329
|
-
|
|
330
|
-
.jaxon-head,.jaxon-tools,.jaxon-actions { display:flex; align-items:center; gap:.5rem; }
|
|
331
|
-
.jaxon-head { justify-content:space-between; padding:1rem; border-bottom:1px solid var(--line); }
|
|
332
|
-
.jaxon-head h2 { margin:0; font-size:1.12rem; }.jaxon-head small { color:var(--muted); }
|
|
333
|
-
.jaxon-tools button { font-size:.8rem; padding:.3rem .65rem; }
|
|
334
|
-
.jaxon-scroll { flex:1; overflow:auto; overscroll-behavior:contain; padding:1rem; min-height:0; }
|
|
335
|
-
.jaxon-bubble { margin:0 1.4rem .8rem 0; padding:.7rem .85rem; border:1px solid var(--line); border-radius:.8rem .8rem .8rem .2rem; background:#1d2933; white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.5; }
|
|
336
|
-
.jaxon-bubble.user { margin:0 0 .8rem 1.4rem; background:#20362f; border-color:#355749; border-radius:.8rem .8rem .2rem .8rem; }
|
|
337
|
-
.jaxon-bubble.assistant { white-space:normal; }
|
|
338
|
-
.jaxon-bubble > strong { display:block; color:var(--accent); font-size:.75rem; margin-bottom:.25rem; }
|
|
349
|
+
|
|
339
350
|
.jaxon-markdown > :first-child { margin-top:0; }
|
|
340
351
|
.jaxon-markdown > :last-child { margin-bottom:0; }
|
|
341
352
|
.jaxon-markdown p { margin:.55rem 0; }
|
|
@@ -346,22 +357,254 @@ select:disabled { cursor: default; }
|
|
|
346
357
|
.jaxon-markdown code { font-size:.88em; }
|
|
347
358
|
.jaxon-markdown table { display:block; max-width:100%; overflow-x:auto; margin:.55rem 0; font-size:.82rem; }
|
|
348
359
|
.jaxon-markdown th, .jaxon-markdown td { padding:.35rem .5rem; }
|
|
349
|
-
.jaxon-
|
|
350
|
-
.jaxon-
|
|
351
|
-
.jaxon-tool .tool-heading { margin-bottom:.2rem; }
|
|
352
|
-
.jaxon-tool .tool-summary { display:block; padding-left:1.1rem; }
|
|
353
|
-
.jaxon-tool .tool-detail, .jaxon-tool > pre { margin:0 .55rem .55rem; }
|
|
354
|
-
.jaxon-tool .tool-output { max-height:14rem; font-size:.78rem; }
|
|
355
|
-
.jaxon-tool .tool-arguments-label { margin:.35rem 0; color:var(--muted); font-size:.75rem; }
|
|
356
|
-
#jaxon-chat { border-top:1px solid var(--line); padding:.8rem; margin:0; }
|
|
357
|
-
#jaxon-chat textarea { width:100%; min-height:3.6rem; max-height:8rem; margin:0; resize:vertical; font:inherit; }
|
|
358
|
-
.jaxon-actions { justify-content:flex-end; flex-wrap:wrap; margin-top:.4rem; }.jaxon-actions button { padding:.35rem .85rem; }
|
|
359
|
-
.jaxon-actions .key-hint { margin-right:auto; }
|
|
360
|
-
#jaxon-error { margin:.4rem .85rem; color:#ffb6ae; max-height:5rem; overflow:auto; }
|
|
361
|
-
#jaxon-question { padding:.7rem; border:1px solid var(--accent); border-radius:.6rem; }
|
|
362
|
-
#jaxon-question pre { max-height:9rem; }
|
|
360
|
+
.jaxon-chat-question { flex:none; margin:.55rem 0 0; padding:.65rem; border:1px solid var(--accent); border-radius:.6rem; }
|
|
361
|
+
.jaxon-chat-question pre { max-height:9rem; }
|
|
363
362
|
body:has(.jaxon-dock) main { padding-bottom:6rem; }
|
|
364
363
|
body:has(#jaxon-launch:not([hidden])) .toast { bottom:4.9rem; }
|
|
364
|
+
|
|
365
|
+
.activity-panel {
|
|
366
|
+
position:relative; margin:0 0 1.5rem; padding:clamp(.9rem,2vw,1.5rem); border:1px solid #2b3946;
|
|
367
|
+
border-radius:16px; background:radial-gradient(ellipse at 0 0,#17232d,transparent 62%),#0f171f;
|
|
368
|
+
}
|
|
369
|
+
.activity-panel [hidden] { display:none !important; }
|
|
370
|
+
.activity-header,.activity-meta,.activity-tools { display:flex; align-items:center; justify-content:space-between; gap:.75rem; flex-wrap:wrap; }
|
|
371
|
+
.activity-header { align-items:end; }
|
|
372
|
+
.activity-heading { min-width:0; }
|
|
373
|
+
.activity-heading h2 { margin:.15rem 0 0; font-size:clamp(1.2rem,2vw,1.7rem); letter-spacing:-.025em; overflow-wrap:anywhere; }
|
|
374
|
+
.activity-heading h2 a { color:inherit; }
|
|
375
|
+
.activity-kicker { display:flex; gap:.45rem; align-items:center; color:#9ab3bc; font-size:.69rem; font-weight:650; letter-spacing:.15em; text-transform:uppercase; }
|
|
376
|
+
.activity-kicker span { width:.42rem; height:.42rem; background:#91e2cd; border-radius:1px; rotate:45deg; box-shadow:0 0 11px #72ccb18c; }
|
|
377
|
+
.activity-all { font-size:.81rem; margin-inline-end:.35rem; }
|
|
378
|
+
.activity-window { display:flex; padding:3px; gap:3px; border:1px solid #34434f; border-radius:10px; background:#0d151c; }
|
|
379
|
+
.activity-window button { min-height:29px; min-width:2.4rem; padding:.15rem .45rem; border:1px solid transparent; border-radius:7px; color:#a9bac8; background:transparent; font-size:.75rem; font-variant-numeric:tabular-nums; }
|
|
380
|
+
.activity-window button:hover { color:#e4ffff; background:#1b2934; }
|
|
381
|
+
.activity-window button[aria-pressed="true"] { border-color:#41605e; color:#c5fff0; background:#1d3437; }
|
|
382
|
+
.activity-meta { margin:.85rem 0 .48rem; min-height:1.1rem; font-size:.72rem; }
|
|
383
|
+
.activity-legend { display:flex; gap:.9rem; flex-wrap:wrap; color:#adbdcc; }
|
|
384
|
+
.activity-legend span { display:flex; align-items:center; gap:.35rem; }
|
|
385
|
+
.activity-legend span::before { content:""; display:block; width:17px; border-top:3px solid #ffc981; }
|
|
386
|
+
.activity-legend [data-link="report"]::before { border-color:#85e3ff; border-top-width:2px; }
|
|
387
|
+
.activity-legend [data-link="cue"]::before { border-color:#cbafff; border-top-style:dashed; border-top-width:2px; }
|
|
388
|
+
.activity-batch { color:#a6bdc9; }
|
|
389
|
+
.activity-offline .activity-batch { color:#f2c484; }
|
|
390
|
+
.activity-empty { margin:.65rem 0; padding:.6rem .8rem; border:1px solid #293845; border-radius:8px; color:#bdcbd5; font-size:.82rem; }
|
|
391
|
+
.activity-scene { position:relative; overflow:clip; border-radius:12px; container-type:inline-size; }
|
|
392
|
+
.activity-stage {
|
|
393
|
+
position:relative; isolation:isolate; border-radius:12px;
|
|
394
|
+
background:radial-gradient(circle,#6a97b128 .8px,transparent 1.15px) 0 0/18px 18px,#0c131a;
|
|
395
|
+
box-shadow:inset 0 0 0 1px #2b3c4b;
|
|
396
|
+
}
|
|
397
|
+
.activity-outgoing { position:absolute; z-index:3; inset:0 0 auto; overflow:hidden; pointer-events:none; }
|
|
398
|
+
.activity-nodes {
|
|
399
|
+
position:relative; z-index:1; display:grid; align-items:start;
|
|
400
|
+
grid-template-columns:minmax(0,1fr) clamp(7.5rem,17cqi,9rem) minmax(0,1fr);
|
|
401
|
+
gap:clamp(1rem,2.7cqi,1.8rem); padding:.85rem clamp(1.55rem,3.3cqi,2.2rem);
|
|
402
|
+
}
|
|
403
|
+
.activity-agent-lanes { display:contents; }
|
|
404
|
+
.activity-hub { grid-area:1 / 2; }
|
|
405
|
+
.activity-lane { display:flex; flex-direction:column; gap:.55rem; min-width:0; }
|
|
406
|
+
.activity-lane:first-child { grid-area:1 / 1; }
|
|
407
|
+
.activity-lane:last-child { grid-area:1 / 3; }
|
|
408
|
+
.activity-node {
|
|
409
|
+
--role:hsl(var(--role-hue) 75% 77%);
|
|
410
|
+
--card-opacity:.83;
|
|
411
|
+
position:relative; isolation:isolate; min-width:0; contain:layout;
|
|
412
|
+
padding:.43rem .5rem; border:1px solid color-mix(in srgb,var(--role) 25%,#2a3b49);
|
|
413
|
+
border-radius:10px; background:#14202a;
|
|
414
|
+
opacity:var(--card-opacity); transition:opacity 500ms ease;
|
|
415
|
+
}
|
|
416
|
+
.activity-node:is(.master,.active,:hover,:focus-within) { --card-opacity:1; }
|
|
417
|
+
.activity-node.master {
|
|
418
|
+
border-color:#8f7448; background:#211f1a;
|
|
419
|
+
box-shadow:0 0 14px #ffc98116;
|
|
420
|
+
}
|
|
421
|
+
.activity-light { position:absolute; inset:-1px; z-index:-1; pointer-events:none; border-radius:inherit; opacity:var(--heat,0); transition:opacity 550ms linear;
|
|
422
|
+
border:1px solid color-mix(in srgb,var(--role) 58%,#354858);
|
|
423
|
+
background:linear-gradient(130deg,color-mix(in srgb,var(--role) 12%,transparent),transparent 72%);
|
|
424
|
+
box-shadow:0 0 17px color-mix(in srgb,var(--role) 14%,transparent);
|
|
425
|
+
}
|
|
426
|
+
.activity-node-head { display:flex; align-items:center; gap:.38rem; min-height:1.7rem; }
|
|
427
|
+
.activity-emblem { position:relative; isolation:isolate; display:grid; place-items:center; flex:0 0 1.6rem; height:1.6rem;
|
|
428
|
+
margin:0; border:1px solid color-mix(in srgb,var(--role) 55%,#334352); border-radius:50%;
|
|
429
|
+
background:#0d1721; color:var(--role); font:600 .82rem/1 ui-monospace,monospace;
|
|
430
|
+
}
|
|
431
|
+
.master .activity-emblem { color:#ecd493; border-color:#998451; background:#191f1e; }
|
|
432
|
+
.activity-emblem::before { content:""; position:absolute; z-index:-1; inset:-5px; border-radius:inherit;
|
|
433
|
+
background:var(--role); opacity:0; pointer-events:none;
|
|
434
|
+
}
|
|
435
|
+
.activity-node.active .activity-emblem::before { animation:activity-glow 3.4s ease-in-out infinite; }
|
|
436
|
+
.activity-identity { flex:1; min-width:0; }
|
|
437
|
+
.activity-name { margin:0; min-width:0; color:var(--role); font-size:.88rem; line-height:1.2; }
|
|
438
|
+
.activity-name > :is(a,span) { display:block; max-width:100%; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; color:inherit; }
|
|
439
|
+
.activity-name-chat { width:fit-content; text-decoration:underline; text-decoration-color:color-mix(in srgb,currentColor 55%,transparent); text-underline-offset:3px; }
|
|
440
|
+
.activity-name-chat:is(:hover,:focus-visible) { text-decoration-color:currentColor; }
|
|
441
|
+
.activity-count { display:block; margin-top:1px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; color:#c0cfda; font-size:.65rem; line-height:1.12; font-variant-numeric:tabular-nums; }
|
|
442
|
+
.master .activity-count { white-space:normal; }
|
|
443
|
+
.activity-gear { display:grid; place-items:center; flex:0 0 1.55rem; height:1.55rem; border-radius:6px; color:#aebfcd; }
|
|
444
|
+
.activity-gear .ui-icon { width:.9rem; height:.9rem; }
|
|
445
|
+
.activity-gear:hover,.activity-gear:focus-visible { color:#eafaff; background:#263846; }
|
|
446
|
+
.activity-sessions { max-height:5.6rem; overflow:auto; scrollbar-width:thin; scrollbar-color:#4a6070 transparent; scrollbar-gutter:stable; }
|
|
447
|
+
.activity-session-stack { display:flex; flex-direction:column; gap:.2rem; }
|
|
448
|
+
.activity-session-stack:has(.activity-session,.activity-more:not([hidden])) { padding-top:.35rem; }
|
|
449
|
+
.activity-session {
|
|
450
|
+
display:flex; align-items:center; gap:.3rem; flex:none;
|
|
451
|
+
min-width:0; min-height:1.55rem; padding:.1rem .4rem; overflow:hidden;
|
|
452
|
+
border-block-start:1px solid #304250;
|
|
453
|
+
color:#e2edf4; font-size:.76rem; font-weight:500; line-height:1.3; text-align:start;
|
|
454
|
+
}
|
|
455
|
+
.activity-session.closed { color:#acbcc9; }
|
|
456
|
+
.activity-session.activity-fallback:not(:hover,:focus-visible) { color:#bdcbd5; }
|
|
457
|
+
.activity-session:is(:hover,:focus-visible) { color:#fff; background:#203341; text-decoration:none; outline-offset:-2px; }
|
|
458
|
+
.activity-more { padding:.14rem .35rem; color:#bdd0de; font-size:.7rem; }
|
|
459
|
+
.cue-badge { display:inline-block; min-width:1.2em; padding:0 .28em; border:1px solid #8565b4; border-radius:5px; color:#ecd7ff; background:#34294c; font-size:.72rem; font-variant-numeric:tabular-nums; text-align:center; }
|
|
460
|
+
.activity-cue-count { flex:none; font-size:.62rem; }
|
|
461
|
+
.activity-cue-origin { flex:none; color:#ddbcff; }
|
|
462
|
+
.activity-cue-origin .ui-icon { display:block; width:.73rem; height:.73rem; }
|
|
463
|
+
.activity-state-dot { flex:none; width:.43rem; height:.43rem; border-radius:50%; color:#8195a7; background:currentColor; }
|
|
464
|
+
.activity-state-dot[data-state="running"] { color:#8fe1b8; box-shadow:0 0 7px #8fe1b8a0; }
|
|
465
|
+
.activity-state-dot[data-state="waiting_input"] { color:#ffcc83; border-radius:1px; rotate:45deg; }
|
|
466
|
+
.activity-state-dot[data-state="queued"] { color:#8bbaff; box-shadow:inset 0 0 0 1px currentColor; background:transparent; }
|
|
467
|
+
.activity-state-dot[data-state="failed"] { color:#ff9594; border-radius:1px; }
|
|
468
|
+
.activity-state-dot[data-state="closed"] { color:#738797; }
|
|
469
|
+
.activity-topic-viewport { flex:1; min-width:0; overflow:hidden; white-space:nowrap; }
|
|
470
|
+
.activity-topic-viewport.overflowing { mask-image:linear-gradient(to right,#000 calc(100% - 6px),transparent); }
|
|
471
|
+
.activity-topic-track { display:block; width:max-content; }
|
|
472
|
+
.activity-tooltip { position:absolute; max-width:min(25rem,calc(100% - 20px)); z-index:4; padding:.48rem .65rem; border:1px solid #557182;
|
|
473
|
+
border-radius:8px; background:#1e303d; color:#eef8ff; box-shadow:0 10px 18px #0006; pointer-events:none; font-size:.76rem; overflow-wrap:anywhere;
|
|
474
|
+
}
|
|
475
|
+
.activity-edges { position:absolute; inset:0; z-index:0; width:100%; height:100%; overflow:hidden; pointer-events:none; }
|
|
476
|
+
.activity-edge {
|
|
477
|
+
fill:none; stroke-width:2.85; stroke-linecap:round; stroke:#ffc981;
|
|
478
|
+
stroke-opacity:calc(.23 + .77 * var(--heat,0)); transition:stroke-opacity 550ms linear;
|
|
479
|
+
}
|
|
480
|
+
.activity-edge.report { stroke:#85e3ff; stroke-width:2; }
|
|
481
|
+
.activity-edge.cue { stroke:#cbafff; stroke-width:2.35; stroke-dasharray:2 5; }
|
|
482
|
+
.activity-pulse { fill:#fff0d6; filter:drop-shadow(0 0 4px #ffc981); }
|
|
483
|
+
.activity-pulse.report { fill:#d9f8ff; filter:drop-shadow(0 0 4px #85e3ff); }
|
|
484
|
+
.activity-pulse.cue { fill:#f0e1ff; filter:drop-shadow(0 0 5px #cbafff); }
|
|
485
|
+
.activity-pulse.steer { fill:#ffe9c2; filter:drop-shadow(0 0 5px #ffad65); }
|
|
486
|
+
.activity-secondary > summary { color:var(--muted); }
|
|
487
|
+
@keyframes activity-glow { 0%,100% { opacity:.06; transform:scale(.96); } 50% { opacity:.16; transform:scale(1.03); } }
|
|
488
|
+
@container (max-width:41rem) {
|
|
489
|
+
.activity-nodes { grid-template-columns:6.8rem minmax(0,1fr); }
|
|
490
|
+
.activity-hub { grid-area:1 / 1; }
|
|
491
|
+
.activity-agent-lanes { grid-area:1 / 2; display:flex; flex-direction:column; gap:.55rem; }
|
|
492
|
+
.activity-lane:empty { display:none; }
|
|
493
|
+
}
|
|
494
|
+
@container (max-width:27rem) {
|
|
495
|
+
.activity-nodes { grid-template-columns:minmax(0,1fr); gap:.72rem; padding-left:1.6rem; }
|
|
496
|
+
.activity-agent-lanes { grid-area:2 / 1; }
|
|
497
|
+
.activity-node.master { max-width:8rem; }
|
|
498
|
+
}
|
|
499
|
+
@media(prefers-reduced-motion:reduce) {
|
|
500
|
+
.activity-panel *,.activity-panel *::before { animation:none !important; transition:none !important; }
|
|
501
|
+
.activity-topic-viewport.overflowing { mask-image:none; text-overflow:ellipsis; }
|
|
502
|
+
.activity-topic-viewport.overflowing .activity-topic-track { display:inline; }
|
|
503
|
+
}
|
|
504
|
+
.jaxon-chat-root { position:fixed; inset:0; z-index:900; pointer-events:none; }
|
|
505
|
+
.jaxon-conversation {
|
|
506
|
+
--chat-shell:#18242e; --chat-deck:#101921; --chat-line:#2e404c; --chat-muted:#a5b9c8;
|
|
507
|
+
display:flex; flex-direction:column; margin:0; pointer-events:auto; container-type:inline-size;
|
|
508
|
+
overflow:hidden; overscroll-behavior:none;
|
|
509
|
+
background:var(--chat-deck); border:1px solid #415762; border-radius:15px; box-shadow:0 16px 48px #0009,0 2px 8px #0005;
|
|
510
|
+
}
|
|
511
|
+
.jaxon-chat-window {
|
|
512
|
+
position:fixed; resize:both;
|
|
513
|
+
min-width:min(18rem,calc(100% - 1rem)); min-height:min(16rem,calc(100% - 1rem));
|
|
514
|
+
max-width:calc(100% - 1rem); max-height:calc(100dvh - 1rem);
|
|
515
|
+
}
|
|
516
|
+
#jaxon-panel { width:min(456px,calc(100vw - 2rem)); height:min(568px,calc(100dvh - 2rem)); }
|
|
517
|
+
.jaxon-conversation [hidden] { display:none !important; }
|
|
518
|
+
.jaxon-conversation:focus-within { border-color:#56746f; }
|
|
519
|
+
.jaxon-chat-head { display:flex; flex:none; align-items:center; gap:.6rem; padding:.65rem .75rem;
|
|
520
|
+
background:linear-gradient(110deg,#1b2d37,var(--chat-shell) 65%); border-bottom:1px solid var(--chat-line); }
|
|
521
|
+
.jaxon-chat-head, .jaxon-chat-head * { -webkit-user-select:none; user-select:none; }
|
|
522
|
+
.jaxon-chat-window .jaxon-chat-head { cursor:grab; }
|
|
523
|
+
.jaxon-chat-window .jaxon-chat-head:active { cursor:grabbing; }
|
|
524
|
+
.jaxon-chat-emblem { display:grid; place-items:center; flex:none; width:2rem; height:2rem; border-radius:9px;
|
|
525
|
+
color:#b3e4d6; background:#213d3c; border:1px solid #426864; }
|
|
526
|
+
.jaxon-chat-emblem .ui-icon { width:1.1rem; height:1.1rem; }
|
|
527
|
+
.jaxon-chat-identity { display:grid; flex:1; gap:.12rem; min-width:0; line-height:1.25; }
|
|
528
|
+
.jaxon-chat-identity strong { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; font-size:.94rem; font-weight:650; }
|
|
529
|
+
.jaxon-chat-meta { display:flex; flex-wrap:wrap; align-items:baseline; column-gap:.4rem; color:var(--chat-muted); }
|
|
530
|
+
.jaxon-chat-meta small { color:inherit; font-size:.7rem; }
|
|
531
|
+
.jaxon-chat-meta small::before { content:"·"; margin-inline-end:.4rem; }
|
|
532
|
+
.jaxon-chat-status { display:inline-flex; align-items:center; gap:.3rem; font-size:.72rem; font-weight:600; }
|
|
533
|
+
.jaxon-chat-status::before { content:""; width:.38rem; height:.38rem; border-radius:50%; background:currentColor; }
|
|
534
|
+
.jaxon-chat-status:is([data-status="running"],[data-status="starting"],[data-status="stopping"]) { color:#a4e3c9; }
|
|
535
|
+
.jaxon-chat-status[data-status="waiting_input"] { color:#eac98c; }
|
|
536
|
+
.jaxon-chat-status[data-status="failed"] { color:#ffb3ad; }
|
|
537
|
+
.jaxon-chat-tools { display:flex; flex:none; align-items:center; gap:.16rem; }
|
|
538
|
+
.jaxon-chat-open { display:inline-flex; align-items:center; gap:.25rem; min-height:1.9rem; margin-inline-end:.18rem; padding:0 .35rem;
|
|
539
|
+
border-radius:6px; font-size:.73rem; font-weight:600; white-space:nowrap; color:#b5dbd2; }
|
|
540
|
+
.jaxon-chat-open .ui-icon { width:.8rem; height:.8rem; }
|
|
541
|
+
button.jaxon-chat-icon { flex:none; display:grid; place-items:center; width:1.9rem; min-height:1.9rem; padding:0;
|
|
542
|
+
border-radius:6px; color:#b9c9d4; background:transparent; border-color:transparent; }
|
|
543
|
+
.jaxon-chat-open:hover,button.jaxon-chat-icon:hover { background:#273943; color:var(--text); text-decoration:none; }
|
|
544
|
+
button.jaxon-chat-close:hover { background:#482e36; color:#ffd4cc; }
|
|
545
|
+
.jaxon-chat-scroll { display:flex; flex:1 1 auto; flex-direction:column; overflow:auto; overscroll-behavior:contain;
|
|
546
|
+
min-height:0; padding:.75rem; scrollbar-gutter:stable; scrollbar-width:thin; scrollbar-color:#4b6270 transparent; overflow-anchor:none; }
|
|
547
|
+
.jaxon-chat-scroll:focus-visible { outline:2px solid var(--accent); outline-offset:-3px; }
|
|
548
|
+
.jaxon-chat-empty { margin:auto; padding:.9rem; color:var(--chat-muted); text-align:center; font-size:.87rem; }
|
|
549
|
+
.jaxon-chat-history { display:flex; flex:none; flex-direction:column; gap:.55rem; margin-top:auto; min-width:0; }
|
|
550
|
+
.jaxon-chat-history:empty { display:none; }
|
|
551
|
+
.jaxon-chat-history .message { align-self:start; max-width:94%; margin:0; padding:.55rem .7rem; overflow-wrap:anywhere;
|
|
552
|
+
font-size:.86rem; line-height:1.55; border:1px solid var(--chat-line); border-radius:11px 11px 11px 4px; background:#182630; }
|
|
553
|
+
.jaxon-chat-history .message[data-role="user"] { align-self:end; border-color:#365b56; border-radius:11px 11px 4px 11px; background:#203a38; }
|
|
554
|
+
.jaxon-chat-history .message:not([data-role="user"],[data-role="assistant"]) { width:100%; max-width:100%; border-radius:8px; background:#141f28; }
|
|
555
|
+
.jaxon-chat-history .message > header { display:flex; flex-wrap:wrap; align-items:baseline; gap:.1rem .55rem; margin-bottom:.28rem; }
|
|
556
|
+
.jaxon-chat-history .message > header strong { font-size:.72rem; color:#d5e5e8; }
|
|
557
|
+
.jaxon-chat-history .message > header small { font-size:.67rem; color:var(--chat-muted); }
|
|
558
|
+
.jaxon-chat-history .message-text { margin:0; padding:0; font:inherit; max-height:none; }
|
|
559
|
+
.jaxon-chat-history :is(pre, .tool-output) { scrollbar-width:thin; }
|
|
560
|
+
.jaxon-chat-history figure { margin:.4rem 0; }
|
|
561
|
+
.jaxon-chat-history img { max-width:100%; object-fit:contain; }
|
|
562
|
+
button.jaxon-chat-older { flex:none; align-self:center; margin:0 0 .65rem; min-height:1.9rem; padding:.22rem .6rem;
|
|
563
|
+
border-radius:999px; border-color:var(--chat-line); background:var(--chat-shell); font-size:.73rem; color:var(--chat-muted); }
|
|
564
|
+
.jaxon-chat-footer { flex:none; margin:0; padding:.65rem .75rem .7rem; background:var(--chat-shell); border:0; border-top:1px solid var(--chat-line); }
|
|
565
|
+
.jaxon-chat-queue,.jaxon-chat-error { margin:0 0 .5rem; padding:.3rem .5rem; border-radius:6px; font-size:.74rem; overflow-wrap:anywhere; }
|
|
566
|
+
.jaxon-chat-queue { color:#ebce97; background:#393125; }
|
|
567
|
+
.jaxon-chat-error { color:#ffc2b8; background:#402b33; }
|
|
568
|
+
.jaxon-chat-composer { display:flex; align-items:stretch; gap:.3rem; padding:.28rem; border:1px solid #354953; border-radius:10px; background:#0e171f; }
|
|
569
|
+
.jaxon-chat-composer:focus-within { border-color:#69958a; }
|
|
570
|
+
.jaxon-chat-composer textarea { flex:1; margin:0; min-width:0; min-height:2.35rem; max-height:min(8.25rem,23dvh);
|
|
571
|
+
background:transparent; border:0; outline:none; padding:.52rem .45rem; resize:none; font-size:.87rem; line-height:1.4; }
|
|
572
|
+
.jaxon-chat-composer textarea::placeholder { color:#93a8b9; }
|
|
573
|
+
.jaxon-chat-composer button { flex:none; min-height:2.35rem; padding-inline:.65rem; font-size:.78rem; }
|
|
574
|
+
.jaxon-chat-composer button:disabled { cursor:not-allowed; }
|
|
575
|
+
button.jaxon-chat-stop { background:transparent; color:#e3b8ac; border-color:#664c4c; }
|
|
576
|
+
button.jaxon-chat-stop:disabled { color:var(--chat-muted); border-color:transparent; }
|
|
577
|
+
.jaxon-chat-note { margin:.4rem 0 0; color:var(--chat-muted); font-size:.71rem; line-height:1.4; }
|
|
578
|
+
.jaxon-conversation.closed .jaxon-chat-note { color:#ccd5de; }
|
|
579
|
+
.jaxon-chat-window.minimized { height:auto !important; min-height:0; resize:none; }
|
|
580
|
+
.jaxon-chat-window.minimized .jaxon-chat-head { border-bottom:0; }
|
|
581
|
+
.jaxon-chat-window.minimized :is(.jaxon-chat-scroll,.jaxon-chat-footer) { display:none; }
|
|
582
|
+
.jaxon-chat-window.drawer { left:0 !important; right:0 !important; bottom:0 !important; top:auto !important; width:100% !important;
|
|
583
|
+
max-width:100%; height:min(78dvh,40rem) !important; border-radius:15px 15px 0 0; resize:none; }
|
|
584
|
+
.jaxon-chat-window.drawer.minimized { height:auto !important; }
|
|
585
|
+
.jaxon-chat-window.drawer .jaxon-chat-head { cursor:default; }
|
|
586
|
+
button.jaxon-chat-new { min-height:1.9rem; padding:0 .45rem; font-size:.73rem; white-space:nowrap; }
|
|
587
|
+
@container (max-width:21rem) {
|
|
588
|
+
.jaxon-chat-emblem { display:none; }
|
|
589
|
+
.jaxon-chat-head,.jaxon-chat-footer { padding-inline:.55rem; }
|
|
590
|
+
.jaxon-chat-composer button { padding-inline:.45rem; }
|
|
591
|
+
}
|
|
592
|
+
.preset-picker { border:1px solid var(--line); border-radius:8px; padding:.6rem .75rem; margin:.6rem 0; min-width:0; }
|
|
593
|
+
.preset-picker legend { padding:0 .35rem; color:var(--muted); }
|
|
594
|
+
.preset-options { display:grid; grid-template-columns:repeat(auto-fill,minmax(170px,1fr)); gap:.25rem .8rem; }
|
|
595
|
+
label.preset-option { display:flex; align-items:center; gap:.4rem; margin:0; color:var(--text); cursor:pointer; }
|
|
596
|
+
label.preset-option input[type=checkbox] { width:auto; margin:0; }
|
|
597
|
+
.preset-picker [data-preset-summary] { margin:0 0 .4rem; font-size:.78rem; }
|
|
598
|
+
.station-board { padding:0; overflow:hidden; }
|
|
599
|
+
.station-board > summary { display:flex; align-items:center; gap:.65rem; padding:.7rem .9rem; cursor:pointer; list-style:none; }
|
|
600
|
+
.station-board > summary::-webkit-details-marker { display:none; }
|
|
601
|
+
.station-board > summary::after { content:"▸"; color:var(--muted); }
|
|
602
|
+
.station-board[open] > summary::after { content:"▾"; }
|
|
603
|
+
.station-board[open] > summary { border-bottom:1px solid var(--line); }
|
|
604
|
+
.station-board > summary .section-heading { flex:1 1 auto; margin:0; }
|
|
605
|
+
.board-version { white-space:nowrap; font-size:.75rem; }
|
|
606
|
+
.board-detail { padding:.75rem .9rem .9rem; }
|
|
607
|
+
.board-detail [data-board-content] { max-height:24rem; }
|
|
365
608
|
`;
|
|
366
609
|
export const APP_JS = String.raw `
|
|
367
610
|
"use strict";
|
|
@@ -412,8 +655,13 @@ function redirectFor(form, result) {
|
|
|
412
655
|
});
|
|
413
656
|
return path.includes("//") || /\/$/.test(path) ? null : path;
|
|
414
657
|
}
|
|
658
|
+
const agentSettingsDefaults = new WeakMap();
|
|
415
659
|
function paramsFor(form) {
|
|
416
660
|
const params = {};
|
|
661
|
+
// Checkboxes that share a name form a multi-select group (e.g. the preset picker).
|
|
662
|
+
const checkboxCounts = new Map();
|
|
663
|
+
for (const el of form.elements) if (el.name && el.type === "checkbox") checkboxCounts.set(el.name, (checkboxCounts.get(el.name) || 0) + 1);
|
|
664
|
+
const checkboxGroups = new Set([...checkboxCounts].filter(([, count]) => count > 1).map(([name]) => name));
|
|
417
665
|
for (const el of form.elements) {
|
|
418
666
|
if (!el.name || el.matches(":disabled") || el.type === "submit" || el.type === "button") continue;
|
|
419
667
|
if (["resolve_unknown", "unknown_turn_id"].includes(el.name)) continue;
|
|
@@ -423,10 +671,18 @@ function paramsFor(form) {
|
|
|
423
671
|
try { value = JSON.parse(value); } catch { throw new Error(el.name + " must be valid JSON"); }
|
|
424
672
|
} else if (el.hasAttribute("data-number") && value !== "") value = Number(value);
|
|
425
673
|
else if (el.hasAttribute("data-comma")) value = value.split(",").map(s => s.trim()).filter(Boolean);
|
|
674
|
+
if (checkboxGroups.has(el.name)) {
|
|
675
|
+
if (!Array.isArray(params[el.name])) params[el.name] = [];
|
|
676
|
+
params[el.name].push(value);
|
|
677
|
+
continue;
|
|
678
|
+
}
|
|
426
679
|
if (el.hasAttribute("data-null-empty") && value === "") value = null;
|
|
427
680
|
if (value === "" && !el.hasAttribute("data-null-empty") && !el.hasAttribute("data-keep-empty")) continue;
|
|
428
681
|
params[el.name] = value;
|
|
429
682
|
}
|
|
683
|
+
const picker = form.querySelector("[data-preset-picker]");
|
|
684
|
+
if (picker && !picker.querySelector('input[name="agents"]:checked')) throw new Error("Select at least one member preset.");
|
|
685
|
+
if (picker && params.agents === undefined) params.agents = [];
|
|
430
686
|
const tools = form.querySelector("[data-tool-set]");
|
|
431
687
|
const override = form.querySelector("[data-override-tools]");
|
|
432
688
|
if (tools && (!override || override.checked)) {
|
|
@@ -445,6 +701,9 @@ function paramsFor(form) {
|
|
|
445
701
|
}
|
|
446
702
|
if (form.dataset.kind === "agent-settings") {
|
|
447
703
|
if (form.elements.connection.value === form.elements.connection.dataset.original) delete params.connection;
|
|
704
|
+
const policy = form.elements.namedItem("session_switch");
|
|
705
|
+
if (policy && policy.value !== policy.dataset.original) params.session_switch = policy.value || null;
|
|
706
|
+
else delete params.session_switch;
|
|
448
707
|
let settings;
|
|
449
708
|
try { settings = JSON.parse(form.dataset.settings || "{}"); } catch { settings = {}; }
|
|
450
709
|
const setOrDelete = (key, value) => { if (value) settings[key] = value; else delete settings[key]; };
|
|
@@ -452,8 +711,37 @@ function paramsFor(form) {
|
|
|
452
711
|
setOrDelete("defaultModel", params.model);
|
|
453
712
|
setOrDelete("defaultThinkingLevel", params.thinking);
|
|
454
713
|
settings.defaultTools = params.tools;
|
|
714
|
+
const compactionFields = {
|
|
715
|
+
compaction_reserve: ["reserveTokens", "Context reserve"],
|
|
716
|
+
compaction_keep_recent: ["keepRecentTokens", "Recent history to keep"],
|
|
717
|
+
};
|
|
718
|
+
if (form.elements.namedItem("compaction_enabled")) {
|
|
719
|
+
const compaction = {...settings.compaction};
|
|
720
|
+
if (params.compaction_enabled === undefined) delete compaction.enabled;
|
|
721
|
+
else if (params.compaction_enabled === "true" || params.compaction_enabled === "false")
|
|
722
|
+
compaction.enabled = params.compaction_enabled === "true";
|
|
723
|
+
else throw new Error("Choose a valid automatic compaction setting.");
|
|
724
|
+
delete params.compaction_enabled;
|
|
725
|
+
for (const [field, [key, label]] of Object.entries(compactionFields)) {
|
|
726
|
+
const raw = params[field];
|
|
727
|
+
if (raw === undefined) delete compaction[key];
|
|
728
|
+
else {
|
|
729
|
+
const value = Number(raw);
|
|
730
|
+
if (!Number.isSafeInteger(value) || value < 0) throw new Error(label + " must be a non-negative safe integer.");
|
|
731
|
+
compaction[key] = value;
|
|
732
|
+
}
|
|
733
|
+
delete params[field];
|
|
734
|
+
}
|
|
735
|
+
if (Object.keys(compaction).length) settings.compaction = compaction;
|
|
736
|
+
else delete settings.compaction;
|
|
737
|
+
}
|
|
455
738
|
params.patch = {"settings.json": JSON.stringify(settings, null, 2) + "\n"};
|
|
456
739
|
for (const key of ["provider", "model", "thinking", "tools"]) delete params[key];
|
|
740
|
+
if (Object.hasOwn(params, "session_switch")) {
|
|
741
|
+
const { session_switch, ...rest } = params;
|
|
742
|
+
if (agentSettingsDefaults.get(form) === JSON.stringify(rest))
|
|
743
|
+
return { name: params.name, expected_rev: params.expected_rev, session_switch };
|
|
744
|
+
}
|
|
457
745
|
} else if (form.dataset.kind === "agent-instructions") {
|
|
458
746
|
params.patch = {"APPEND_SYSTEM.md": String(params.instructions || "")};
|
|
459
747
|
delete params.instructions;
|
|
@@ -491,6 +779,16 @@ function paramsFor(form) {
|
|
|
491
779
|
}
|
|
492
780
|
return params;
|
|
493
781
|
}
|
|
782
|
+
for (const picker of document.querySelectorAll("[data-preset-picker]")) {
|
|
783
|
+
const boxes = [...picker.querySelectorAll('input[name="agents"]')];
|
|
784
|
+
const summary = picker.querySelector("[data-preset-summary]");
|
|
785
|
+
const update = () => {
|
|
786
|
+
const chosen = boxes.filter(box => box.checked).map(box => box.value);
|
|
787
|
+
if (summary) summary.textContent = chosen.length ? chosen.length + " selected: " + chosen.join(", ") : "No presets selected";
|
|
788
|
+
};
|
|
789
|
+
picker.addEventListener("change", update);
|
|
790
|
+
update();
|
|
791
|
+
}
|
|
494
792
|
for (const block of document.querySelectorAll("[data-model-fields]")) {
|
|
495
793
|
const catalog = JSON.parse(block.dataset.catalog);
|
|
496
794
|
const form = block.closest("form");
|
|
@@ -543,6 +841,13 @@ for (const block of document.querySelectorAll("[data-model-fields]")) {
|
|
|
543
841
|
provider.addEventListener("input", suggestModels);
|
|
544
842
|
chooseConnection();
|
|
545
843
|
}
|
|
844
|
+
for (const form of document.querySelectorAll('form[data-kind="agent-settings"]')) {
|
|
845
|
+
// A policy-only edit must not pin model or tool defaults populated by the editor.
|
|
846
|
+
try {
|
|
847
|
+
const { session_switch, ...rest } = paramsFor(form);
|
|
848
|
+
agentSettingsDefaults.set(form, JSON.stringify(rest));
|
|
849
|
+
} catch { /* Invalid fields will be reported on submit. */ }
|
|
850
|
+
}
|
|
546
851
|
for (const form of document.querySelectorAll('form[data-kind="mcp-server"]')) {
|
|
547
852
|
const transport = form.elements.transport;
|
|
548
853
|
function showTransport() {
|
|
@@ -582,7 +887,7 @@ for (const form of document.querySelectorAll('form[data-op="connection_create"]'
|
|
|
582
887
|
showProviderFields();
|
|
583
888
|
window.addEventListener("pageshow", showProviderFields);
|
|
584
889
|
}
|
|
585
|
-
for (const input of document.querySelectorAll('
|
|
890
|
+
for (const input of document.querySelectorAll('form[data-op="session_send"] textarea[name="prompt"]')) {
|
|
586
891
|
input.addEventListener("keydown", event => {
|
|
587
892
|
if (event.key !== "Enter" || event.isComposing || event.keyCode === 229) return;
|
|
588
893
|
if (event.ctrlKey) {
|
|
@@ -630,6 +935,7 @@ document.addEventListener("submit", async event => {
|
|
|
630
935
|
no_change: "Published; no changes from the effective revision",
|
|
631
936
|
})[result?.takes_effect] : undefined;
|
|
632
937
|
if (form.dataset.kind === "flow-response") toast("Response submitted");
|
|
938
|
+
else if (operation === "board_write" && result.warning?.code === "BOARD_SOFT_LIMIT") toast(result.warning.message);
|
|
633
939
|
else toast(publishMessage || "Operation completed");
|
|
634
940
|
if (operation === "board_write") form.dispatchEvent(new CustomEvent("board-saved", { detail: { content: params.content, version: result.version } }));
|
|
635
941
|
const redirect = redirectFor(form, result);
|
|
@@ -644,7 +950,7 @@ document.addEventListener("submit", async event => {
|
|
|
644
950
|
if (el) el.value = "";
|
|
645
951
|
}
|
|
646
952
|
}
|
|
647
|
-
document.dispatchEvent(new CustomEvent("console-operation", {detail: {operation, result}}));
|
|
953
|
+
document.dispatchEvent(new CustomEvent("console-operation", {detail: {operation, result, sessionId: params.session_id}}));
|
|
648
954
|
} catch (e) {
|
|
649
955
|
toast(e.code === "BOARD_VERSION_CONFLICT" ? "Board changed while you were editing. Your draft was not saved. Use the latest version before retrying."
|
|
650
956
|
: (e.code ? e.code + ": " : "") + e.message, true);
|
|
@@ -909,7 +1215,7 @@ function renderPending(pending, session, target) {
|
|
|
909
1215
|
function renderUsage(usage) {
|
|
910
1216
|
const target = document.getElementById("session-usage"); target.replaceChildren();
|
|
911
1217
|
const grid = el("div", {className: "usage-grid"});
|
|
912
|
-
for (const key of ["current_turn", "session_total", "task_total"]) grid.append(el("div", {}, [el("h3", {text: key.replaceAll("_", " ")}), el("pre", {text: JSON.stringify(usage?.[key] || {}, null, 2)})]));
|
|
1218
|
+
for (const key of ["current_turn", "session_total", "task_total", ...(usage?.by_origin?.cue ? ["by_origin"] : [])]) grid.append(el("div", {}, [el("h3", {text: key.replaceAll("_", " ")}), el("pre", {text: JSON.stringify(usage?.[key] || {}, null, 2)})]));
|
|
913
1219
|
target.append(grid);
|
|
914
1220
|
}
|
|
915
1221
|
if (document.body.dataset.page === "session") {
|
|
@@ -922,6 +1228,36 @@ if (document.body.dataset.page === "session") {
|
|
|
922
1228
|
const emptyHistory = document.getElementById("session-history-empty");
|
|
923
1229
|
const older = document.getElementById("session-older");
|
|
924
1230
|
const latest = document.getElementById("session-latest");
|
|
1231
|
+
const thinkingToggle = document.getElementById("session-thinking-toggle");
|
|
1232
|
+
const thinkingBlocks = area => [...area.querySelectorAll("details.session-thinking")];
|
|
1233
|
+
const thinkingKey = block => block.closest("[data-entry-id]").dataset.entryId + ":" + block.dataset.thinkingIndex;
|
|
1234
|
+
let thinkingDefault = false;
|
|
1235
|
+
const thinkingOverrides = new Map();
|
|
1236
|
+
function updateThinkingToggle() {
|
|
1237
|
+
const blocks = thinkingBlocks(history);
|
|
1238
|
+
thinkingToggle.hidden = !blocks.length;
|
|
1239
|
+
thinkingToggle.textContent = blocks.length && blocks.every(block => block.open)
|
|
1240
|
+
? thinkingToggle.dataset.collapse : thinkingToggle.dataset.expand;
|
|
1241
|
+
}
|
|
1242
|
+
function prepareThinking(area) {
|
|
1243
|
+
for (const block of thinkingBlocks(area)) block.open = thinkingOverrides.get(thinkingKey(block)) ?? thinkingDefault;
|
|
1244
|
+
return area;
|
|
1245
|
+
}
|
|
1246
|
+
history.addEventListener("toggle", event => {
|
|
1247
|
+
if (!event.target.matches("details.session-thinking")) return;
|
|
1248
|
+
thinkingOverrides.set(thinkingKey(event.target), event.target.open);
|
|
1249
|
+
updateThinkingToggle();
|
|
1250
|
+
}, true);
|
|
1251
|
+
thinkingToggle.onclick = () => {
|
|
1252
|
+
const blocks = thinkingBlocks(history);
|
|
1253
|
+
thinkingDefault = !blocks.every(block => block.open);
|
|
1254
|
+
thinkingOverrides.clear();
|
|
1255
|
+
for (const block of blocks) block.open = thinkingDefault;
|
|
1256
|
+
updateThinkingToggle();
|
|
1257
|
+
recordScrollPosition();
|
|
1258
|
+
};
|
|
1259
|
+
updateThinkingToggle();
|
|
1260
|
+
const cueTurn = conversation.dataset.cueTurn;
|
|
925
1261
|
let cursor = conversation.dataset.cursor;
|
|
926
1262
|
let before = conversation.dataset.before;
|
|
927
1263
|
let generation = 0;
|
|
@@ -966,7 +1302,7 @@ if (document.body.dataset.page === "session") {
|
|
|
966
1302
|
loadingOlder = true;
|
|
967
1303
|
updateOlderButton();
|
|
968
1304
|
try {
|
|
969
|
-
const response = await fetch(url + "/history?" + new URLSearchParams({before}));
|
|
1305
|
+
const response = await fetch(url + "/history?" + new URLSearchParams({before, ...(cueTurn ? {turn:cueTurn} : {})}));
|
|
970
1306
|
if (!response.ok) throw new Error("Could not load earlier messages (" + response.status + ")");
|
|
971
1307
|
const page = await response.json();
|
|
972
1308
|
if (version !== generation) return;
|
|
@@ -981,7 +1317,8 @@ if (document.body.dataset.page === "session") {
|
|
|
981
1317
|
// Measure after the fetch, so scrolling or live appends during the request are respected.
|
|
982
1318
|
const anchor = history.firstElementChild;
|
|
983
1319
|
const top = anchor ? relativeTop(anchor) : 0;
|
|
984
|
-
history.prepend(fragment(page.conversation));
|
|
1320
|
+
history.prepend(prepareThinking(fragment(page.conversation)));
|
|
1321
|
+
updateThinkingToggle();
|
|
985
1322
|
before = page.before;
|
|
986
1323
|
older.hidden = !before;
|
|
987
1324
|
if (anchor) scroll.scrollTop += relativeTop(anchor) - top;
|
|
@@ -996,7 +1333,14 @@ if (document.body.dataset.page === "session") {
|
|
|
996
1333
|
}
|
|
997
1334
|
|
|
998
1335
|
function replaceConversation(read, messages, followLatest) {
|
|
999
|
-
const
|
|
1336
|
+
const offsets = new Map();
|
|
1337
|
+
for (const block of thinkingBlocks(history)) {
|
|
1338
|
+
const key = thinkingKey(block);
|
|
1339
|
+
thinkingOverrides.set(key, block.open);
|
|
1340
|
+
const text = block.querySelector("pre");
|
|
1341
|
+
if (block.open && text.scrollTop) offsets.set(key, text.scrollTop);
|
|
1342
|
+
}
|
|
1343
|
+
const next = prepareThinking(fragment(messages));
|
|
1000
1344
|
let anchor, top;
|
|
1001
1345
|
if (!followLatest) {
|
|
1002
1346
|
const byId = new Map(Array.from(next.children, node => [node.dataset.entryId, node]));
|
|
@@ -1014,6 +1358,11 @@ if (document.body.dataset.page === "session") {
|
|
|
1014
1358
|
generation++;
|
|
1015
1359
|
before = read.history_before;
|
|
1016
1360
|
history.replaceChildren(next);
|
|
1361
|
+
for (const block of thinkingBlocks(history)) {
|
|
1362
|
+
const top = offsets.get(thinkingKey(block));
|
|
1363
|
+
if (top !== undefined) block.querySelector("pre").scrollTop = top;
|
|
1364
|
+
}
|
|
1365
|
+
updateThinkingToggle();
|
|
1017
1366
|
emptyHistory.hidden = Boolean(history.firstElementChild);
|
|
1018
1367
|
updateOlderButton();
|
|
1019
1368
|
if (anchor) {
|
|
@@ -1026,7 +1375,7 @@ if (document.body.dataset.page === "session") {
|
|
|
1026
1375
|
}
|
|
1027
1376
|
|
|
1028
1377
|
async function poll() {
|
|
1029
|
-
if (running) return;
|
|
1378
|
+
if (running || cueTurn) return;
|
|
1030
1379
|
running = true;
|
|
1031
1380
|
const requestedCursor = cursor;
|
|
1032
1381
|
const version = generation;
|
|
@@ -1041,7 +1390,8 @@ if (document.body.dataset.page === "session") {
|
|
|
1041
1390
|
cursor = read.cursor;
|
|
1042
1391
|
if (!requestedCursor || read.history_reset) replaceConversation(read, messages, followLatest);
|
|
1043
1392
|
else if (messages) {
|
|
1044
|
-
history.append(fragment(messages));
|
|
1393
|
+
history.append(prepareThinking(fragment(messages)));
|
|
1394
|
+
updateThinkingToggle();
|
|
1045
1395
|
emptyHistory.hidden = true;
|
|
1046
1396
|
if (followLatest) jumpToLatest();
|
|
1047
1397
|
else updateLatestButton();
|
|
@@ -1185,203 +1535,6 @@ function renderMarkdown(text) {
|
|
|
1185
1535
|
}
|
|
1186
1536
|
return output;
|
|
1187
1537
|
}
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
let value = args.path || args.command || args.code || (args.pattern ? args.pattern + (args.path ? " · " + args.path : "") : "");
|
|
1192
|
-
if (!value) { try { value = JSON.stringify(args); } catch { value = "Arguments available"; } }
|
|
1193
|
-
const summary = String(value).replace(/\s+/g, " ").trim();
|
|
1194
|
-
return summary.length > 150 ? summary.slice(0, 149) + "…" : summary;
|
|
1195
|
-
}
|
|
1196
|
-
|
|
1197
|
-
function chatResultText(content) {
|
|
1198
|
-
if (typeof content === "string") return content;
|
|
1199
|
-
if (Array.isArray(content)) {
|
|
1200
|
-
const text = content.filter(part => part?.type === "text").map(part => part.text).join("\n");
|
|
1201
|
-
if (text) return text;
|
|
1202
|
-
}
|
|
1203
|
-
if (content === undefined) return "";
|
|
1204
|
-
try { return JSON.stringify(content, null, 2); } catch { return String(content); }
|
|
1205
|
-
}
|
|
1206
|
-
|
|
1207
|
-
function chatRows(history, sessionStatus) {
|
|
1208
|
-
const rows = [], calls = new Map();
|
|
1209
|
-
const addText = (role, text, id) => { if (text) rows.push({kind:"message", role, text, id}); };
|
|
1210
|
-
for (const entry of history) {
|
|
1211
|
-
if (entry.role === "user" || entry.role === "assistant") {
|
|
1212
|
-
if (typeof entry.content === "string") addText(entry.role, entry.content, entry.id);
|
|
1213
|
-
else if (Array.isArray(entry.content)) {
|
|
1214
|
-
let text = [];
|
|
1215
|
-
const flush = () => { if (text.length) addText(entry.role, text.join("\n"), entry.id); text = []; };
|
|
1216
|
-
for (const part of entry.content) {
|
|
1217
|
-
if (part?.type === "text") text.push(part.text);
|
|
1218
|
-
else if (part?.type === "toolCall") {
|
|
1219
|
-
flush();
|
|
1220
|
-
const row = {kind:"tool", id:part.id || entry.id, name:part.name || "tool", args:part.arguments,
|
|
1221
|
-
argsSummary:chatToolSummary(part.arguments), done:false, result:"", failed:false};
|
|
1222
|
-
rows.push(row); if (part.id) calls.set(part.id, row);
|
|
1223
|
-
}
|
|
1224
|
-
}
|
|
1225
|
-
flush();
|
|
1226
|
-
}
|
|
1227
|
-
} else if (entry.role === "toolResult") {
|
|
1228
|
-
const result = chatResultText(entry.content);
|
|
1229
|
-
let row = calls.get(entry.tool_call_id);
|
|
1230
|
-
if (!row) {
|
|
1231
|
-
row = {kind:"tool", id:entry.tool_call_id || entry.id, name:entry.tool_name || "tool", args:undefined, argsSummary:"", done:false};
|
|
1232
|
-
rows.push(row);
|
|
1233
|
-
}
|
|
1234
|
-
row.done = true; row.result = result; row.failed = Boolean(entry.is_error);
|
|
1235
|
-
}
|
|
1236
|
-
}
|
|
1237
|
-
const active = ["starting", "running", "waiting_input", "stopping"].includes(sessionStatus);
|
|
1238
|
-
for (const row of rows) if (row.kind === "tool" && !row.done) row.running = active;
|
|
1239
|
-
return rows;
|
|
1240
|
-
}
|
|
1241
|
-
|
|
1242
|
-
function chatToolNode(row, open) {
|
|
1243
|
-
const status = row.done ? (row.failed ? "Failed" : "Completed") : (row.running ? "Running" : "Stopped");
|
|
1244
|
-
const node = el("details", {className:"jaxon-tool", attrs:{"data-tool-id":row.id}});
|
|
1245
|
-
node.open = open;
|
|
1246
|
-
const heading = el("span", {className:"tool-heading"}, [
|
|
1247
|
-
el("code", {text:row.name}), el("span", {className:"tool-status " + status.toLowerCase(), text:status})
|
|
1248
|
-
]);
|
|
1249
|
-
const resultSummary = (row.done ? row.result : row.argsSummary).replace(/\s+/g, " ").trim();
|
|
1250
|
-
const summary = el("summary", {}, [heading, el("span", {className:"tool-summary", text:resultSummary ? (resultSummary.length > 150 ? resultSummary.slice(0, 149) + "…" : resultSummary) : (row.done ? "Result available" : "Waiting for a result")})]);
|
|
1251
|
-
node.append(summary);
|
|
1252
|
-
if (row.args !== undefined) node.append(el("p", {className:"tool-arguments-label", text:"Arguments"}), el("pre", {className:"tool-output", text:JSON.stringify(row.args, null, 2)}));
|
|
1253
|
-
if (row.done) node.append(el("p", {className:"tool-arguments-label", text:"Result"}), el("pre", {className:"tool-output", text:row.result || "(empty result)"}));
|
|
1254
|
-
return node;
|
|
1255
|
-
}
|
|
1256
|
-
|
|
1257
|
-
function mountJaXonChat() {
|
|
1258
|
-
const byId = id => document.getElementById(id);
|
|
1259
|
-
const panel = byId("jaxon-panel"), launch = byId("jaxon-launch"), form = byId("jaxon-chat");
|
|
1260
|
-
const messages = byId("jaxon-messages"), question = byId("jaxon-question"), status = byId("jaxon-status");
|
|
1261
|
-
const error = byId("jaxon-error"), stop = byId("jaxon-stop"), fresh = byId("jaxon-new"), input = form.elements.text;
|
|
1262
|
-
const key = "jaxon.console.chat";
|
|
1263
|
-
let state = {};
|
|
1264
|
-
try { state = JSON.parse(sessionStorage.getItem(key)) || {}; } catch {}
|
|
1265
|
-
const save = () => { try { sessionStorage.setItem(key, JSON.stringify(state)); } catch {} };
|
|
1266
|
-
let cursor, chatHistory = [];
|
|
1267
|
-
let snapshot, generation = 0, reading = false, writing = false, historyKey, opener = launch;
|
|
1268
|
-
const busy = s => ["starting","running","waiting_input","stopping"].includes(s);
|
|
1269
|
-
const report = message => { error.textContent = message || ""; error.hidden = !message; };
|
|
1270
|
-
const controls = () => {
|
|
1271
|
-
const s = snapshot?.status;
|
|
1272
|
-
form.querySelector('[type="submit"]').disabled = writing || Boolean(state.id && !snapshot) || busy(s) || s === "closed";
|
|
1273
|
-
input.readOnly = writing;
|
|
1274
|
-
fresh.disabled = writing;
|
|
1275
|
-
stop.hidden = !snapshot?.turn_id || !["running","waiting_input"].includes(s);
|
|
1276
|
-
stop.disabled = writing;
|
|
1277
|
-
};
|
|
1278
|
-
function resetView() {
|
|
1279
|
-
generation++;
|
|
1280
|
-
snapshot = undefined; cursor = undefined; chatHistory = []; historyKey = undefined;
|
|
1281
|
-
input.value = state.draft || "";
|
|
1282
|
-
messages.replaceChildren();
|
|
1283
|
-
question.hidden = true; question.firstElementChild.replaceChildren();
|
|
1284
|
-
delete question.firstElementChild.dataset.signature;
|
|
1285
|
-
report("");
|
|
1286
|
-
status.textContent = state.id ? "Loading conversation…" : "Console assistant";
|
|
1287
|
-
if (!state.id) messages.append(el("p", {text:"What would you like to manage?"}));
|
|
1288
|
-
controls();
|
|
1289
|
-
}
|
|
1290
|
-
function draw(read) {
|
|
1291
|
-
snapshot = read;
|
|
1292
|
-
const labels = {starting:"Starting…", running:"Working…", stopping:"Stopping…", waiting_input:"Waiting for your reply", idle:"Ready", dormant:"Sleeping · send to resume", closed:"Closed", failed:"Turn failed"};
|
|
1293
|
-
status.textContent = labels[read.status] || read.status;
|
|
1294
|
-
const rows = chatRows(read.history || [], read.status);
|
|
1295
|
-
const signature = JSON.stringify(rows);
|
|
1296
|
-
if (signature !== historyKey) {
|
|
1297
|
-
const scroll = messages.parentElement;
|
|
1298
|
-
const atEnd = historyKey === undefined || scroll.scrollHeight - scroll.scrollTop - scroll.clientHeight < 60;
|
|
1299
|
-
const openTools = new Set([...messages.querySelectorAll(".jaxon-tool[open]")].map(node => node.dataset.toolId));
|
|
1300
|
-
const nodes = rows.map(row => {
|
|
1301
|
-
if (row.kind === "tool") return chatToolNode(row, openTools.has(row.id));
|
|
1302
|
-
const bubble = el("div", {className:"jaxon-bubble " + row.role});
|
|
1303
|
-
bubble.append(el("strong", {text:row.role === "assistant" ? "JaXon" : "You"}));
|
|
1304
|
-
if (row.role === "assistant") {
|
|
1305
|
-
const content = el("div", {className:"jaxon-markdown"}); content.append(renderMarkdown(row.text)); bubble.append(content);
|
|
1306
|
-
} else bubble.append(document.createTextNode(row.text));
|
|
1307
|
-
return bubble;
|
|
1308
|
-
});
|
|
1309
|
-
messages.replaceChildren(...nodes);
|
|
1310
|
-
historyKey = signature;
|
|
1311
|
-
if (atEnd) scroll.scrollTop = scroll.scrollHeight;
|
|
1312
|
-
}
|
|
1313
|
-
const changed = question.firstElementChild.dataset.signature !== JSON.stringify(read.pending_request || null);
|
|
1314
|
-
question.hidden = !read.pending_request;
|
|
1315
|
-
renderPending(read.pending_request, state.id, question.firstElementChild);
|
|
1316
|
-
if (read.pending_request && changed) {
|
|
1317
|
-
if (read.screen && read.pending_request.kind === "select") question.firstElementChild.prepend(el("pre", {text:read.screen}));
|
|
1318
|
-
question.scrollIntoView({block:"nearest"});
|
|
1319
|
-
}
|
|
1320
|
-
if (read.last_error) report(read.last_error);
|
|
1321
|
-
controls();
|
|
1322
|
-
}
|
|
1323
|
-
async function poll() {
|
|
1324
|
-
if (!state.id || panel.hidden || document.hidden || reading || writing) return;
|
|
1325
|
-
const version = generation;
|
|
1326
|
-
reading = true;
|
|
1327
|
-
try {
|
|
1328
|
-
const read = await api("session_read", {session_id:state.id, after:cursor, include_inline_images:false});
|
|
1329
|
-
if (generation === version) {
|
|
1330
|
-
if (!cursor || read.history_reset) chatHistory = [];
|
|
1331
|
-
chatHistory.push(...(read.history || []));
|
|
1332
|
-
cursor = read.cursor;
|
|
1333
|
-
draw({...read, history:chatHistory});
|
|
1334
|
-
}
|
|
1335
|
-
} catch (e) { if (generation === version) report(e.message); }
|
|
1336
|
-
finally { reading = false; if (generation !== version) void poll(); }
|
|
1337
|
-
}
|
|
1338
|
-
function openChat(trigger, id) {
|
|
1339
|
-
if (id && id !== state.id) {
|
|
1340
|
-
if (writing) return;
|
|
1341
|
-
state = {id}; save(); resetView();
|
|
1342
|
-
}
|
|
1343
|
-
opener = trigger || launch;
|
|
1344
|
-
state.open = true; save();
|
|
1345
|
-
panel.hidden = false; launch.hidden = true; launch.setAttribute("aria-expanded","true");
|
|
1346
|
-
input.focus({preventScroll:true}); void poll();
|
|
1347
|
-
}
|
|
1348
|
-
function hideChat() {
|
|
1349
|
-
state.open = false; save(); panel.hidden = true; launch.hidden = false;
|
|
1350
|
-
launch.setAttribute("aria-expanded","false"); opener.focus({preventScroll:true});
|
|
1351
|
-
}
|
|
1352
|
-
launch.onclick = () => openChat(launch);
|
|
1353
|
-
byId("jaxon-hide").onclick = hideChat;
|
|
1354
|
-
panel.addEventListener("keydown", e => { if (e.key === "Escape") { e.preventDefault(); hideChat(); } });
|
|
1355
|
-
document.querySelectorAll("[data-ask-jaxon]").forEach(button => {
|
|
1356
|
-
button.onclick = () => openChat(button, button.dataset.askJaxon);
|
|
1357
|
-
});
|
|
1358
|
-
fresh.onclick = () => { state = {open:true}; save(); resetView(); input.focus(); };
|
|
1359
|
-
input.oninput = () => { state.draft = input.value; save(); };
|
|
1360
|
-
form.onsubmit = async e => {
|
|
1361
|
-
e.preventDefault();
|
|
1362
|
-
const text = input.value.trim();
|
|
1363
|
-
if (!text || form.querySelector('[type="submit"]').disabled) return;
|
|
1364
|
-
if (state.retry?.text !== text) state.retry = {text, id:crypto.randomUUID()};
|
|
1365
|
-
save(); writing = true; generation++; report(""); controls(); status.textContent = "Sending…";
|
|
1366
|
-
try {
|
|
1367
|
-
const result = await api("ask_jaxon", {text, ...(state.id ? {session_id:state.id} : {}), client_request_id:state.retry.id});
|
|
1368
|
-
state.id = result.session_id || state.id; state.draft = ""; delete state.retry; save(); input.value = "";
|
|
1369
|
-
draw({...snapshot, status:result.status, turn_id:result.turn_id, history:snapshot?.history || []});
|
|
1370
|
-
} catch (err) { report(err.message); status.textContent = "Message could not be sent"; }
|
|
1371
|
-
finally { writing = false; controls(); void poll(); }
|
|
1372
|
-
};
|
|
1373
|
-
stop.onclick = async () => {
|
|
1374
|
-
if (writing || !snapshot?.turn_id) return;
|
|
1375
|
-
writing = true; generation++; controls(); report("");
|
|
1376
|
-
try { await api("session_interrupt", {session_id:state.id, turn_id:snapshot.turn_id}); }
|
|
1377
|
-
catch (err) { report(err.message); }
|
|
1378
|
-
finally { writing = false; controls(); void poll(); }
|
|
1379
|
-
};
|
|
1380
|
-
resetView();
|
|
1381
|
-
if (state.open || (location.pathname === "/sessions" && new URL(location.href).searchParams.get("view") === "jaxon")) openChat(launch);
|
|
1382
|
-
document.addEventListener("visibilitychange", poll);
|
|
1383
|
-
document.addEventListener("console-operation", e => { if (e.detail.operation === "session_reply") void poll(); });
|
|
1384
|
-
setInterval(poll, 2000);
|
|
1385
|
-
}
|
|
1386
|
-
mountJaXonChat();
|
|
1387
|
-
`;
|
|
1538
|
+
// The shared conversation surface consumes the same Markdown and prompt helpers.
|
|
1539
|
+
window.JaxonConversation = { renderMarkdown, renderPending };
|
|
1540
|
+
` + ACTIVITY_JS + `\nmountStationActivity();\n`;
|